@seatlayer/js 0.83.0 → 0.84.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-TNTHWQQ2.js → chunk-RZ2VKZ44.js} +1 -1
- package/dist/index.cjs +340 -111
- package/dist/index.d.cts +112 -15
- package/dist/index.d.ts +112 -15
- package/dist/index.js +341 -112
- package/dist/manager.js +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Ul=Object.create;var vi=Object.defineProperty;var ql=Object.getOwnPropertyDescriptor;var Kl=Object.getOwnPropertyNames;var Wl=Object.getPrototypeOf,Yl=Object.prototype.hasOwnProperty;var Lo=i=>{throw TypeError(i)};var Xl=(i,e,t)=>()=>{if(t)throw t[0];try{return i&&(e=i(i=0)),e}catch(n){throw t=[n],n}};var Mo=(i,e)=>{for(var t in e)vi(i,t,{get:e[t],enumerable:!0})},Ho=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Kl(e))!Yl.call(i,o)&&o!==t&&vi(i,o,{get:()=>e[o],enumerable:!(n=ql(e,o))||n.enumerable});return i};var Ro=(i,e,t)=>(t=i!=null?Ul(Wl(i)):{},Ho(e||!i||!i.__esModule?vi(t,"default",{value:i,enumerable:!0}):t,i)),Zl=i=>Ho(vi({},"__esModule",{value:!0}),i);var An=(i,e,t)=>e.has(i)||Lo("Cannot "+t);var m=(i,e,t)=>(An(i,e,"read from private field"),t?t.call(i):e.get(i)),M=(i,e,t)=>e.has(i)?Lo("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),k=(i,e,t,n)=>(An(i,e,"write to private field"),n?n.call(i,t):e.set(i,t),t),x=(i,e,t)=>(An(i,e,"access private method"),t);var Fo={};Mo(Fo,{errorCopy:()=>Pn,mountCheckout:()=>hc,unavailableCopy:()=>Bo});function lc(i,e){try{window.sessionStorage.setItem(ac,JSON.stringify({orderId:i,...e?{eventKey:e}:{},storedAt:Date.now()}))}catch{}}function dc(){if(typeof document>"u"||document.getElementById(Do))return;let i=document.createElement("style");i.id=Do,i.textContent=cc,document.head.appendChild(i)}function Bo(i,e){let t=`${e} ${e===1?"seat is":"seats are"} held for a limited time.`;return i==="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."}:i==="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 Pn(i){switch(i){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 pc(){let i=window.Razorpay;return i?Promise.resolve(i):new Promise((e,t)=>{let n=document.querySelector(`script[src="${No}"]`),o=n??document.createElement("script"),s=()=>{let r=window.Razorpay;r?e(r):t(new Error("razorpay_unavailable"))};o.addEventListener("load",s,{once:!0}),o.addEventListener("error",()=>t(new Error("razorpay_script_failed")),{once:!0}),!n&&(o.src=No,o.async=!0,document.head.appendChild(o))})}function F(i,e,t){let n=document.createElement(i);return e&&(n.className=e),t!==void 0&&(n.textContent=t),n}function hc(i){dc();let e=!0,t=!1,n=F("div","sl-hco");n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true");let o=F("div","sl-hco-card");n.appendChild(o);let s=()=>{e=!1,n.remove(),document.removeEventListener("keydown",a,!0)},r=()=>{s(),i.onCancel()};function a(V){V.key!=="Escape"||!n.isConnected||(V.stopPropagation(),V.preventDefault(),r())}document.addEventListener("keydown",a,!0);let l=F("h2","sl-hco-title","Checkout"),c=`sl-hco-t-${Math.random().toString(36).slice(2,8)}`;l.id=c,n.setAttribute("aria-labelledby",c);let h=(...V)=>{o.replaceChildren(l,...V)},d=V=>{if(!e)return;let X=F("p","sl-hco-status sl-hco-error",V);X.setAttribute("role","alert");let H=F("button","sl-hco-back","Back to seats");H.type="button",H.addEventListener("click",r),h(X,H)},u=V=>{if(!e)return;let X=F("p","sl-hco-status",V);X.setAttribute("role","status"),h(X)},p=async V=>{u("Payment received \u2014 confirming your seats\u2026");let X=Date.now()+9e4;for(;e&&Date.now()<X;){try{let H=await i.orderStatus(V);if(!e)return;if(H.status==="confirmed"){t=!0,l.textContent="Your tickets are confirmed";let bt=F("p","sl-hco-status",`${H.seatCount} ${H.seatCount===1?"seat":"seats"} confirmed. Your tickets \u2014 with their door QR codes \u2014 are in your email.`),Ze=F("dl","sl-hco-receipt"),Wt=(H.tickets??[]).map(yt=>yt.label);Wt.length&&Ze.append(F("dt",void 0,"Seats"),F("dd",void 0,Wt.join(", "))),Ze.append(F("dt",void 0,"Paid"),F("dd",void 0,`${H.amountFormatted} ${H.currency}`),F("dt",void 0,"Order"),F("dd","sl-hco-ref",H.orderId));let yi=F("button","sl-hco-back","Close");if(yi.type="button",yi.addEventListener("click",r),H.ticketUrl){let yt=F("a","sl-hco-tickets","View tickets & QR codes");yt.href=H.ticketUrl,yt.target="_blank",yt.rel="noreferrer",h(bt,Ze,yt,yi)}else h(bt,Ze,yi);i.onConfirmed(H);return}if(H.status==="failed"||H.status==="expired"){d(H.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(H=>setTimeout(H,2e3))}!e||t||d("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(i.state.kind==="unavailable"){let V=Bo(i.state.reason,i.state.seatCount);l.textContent=V.title;let X=F("p","sl-hco-label","Seats held"),H=F("button","sl-hco-back","Back to seat map");return H.type="button",H.addEventListener("click",r),o.replaceChildren(X,l,F("p","sl-hco-status",V.body),F("p","sl-hco-note",V.detail),H),i.root.appendChild(n),H.focus(),{destroy:s}}if(i.state.kind==="resume")return i.root.appendChild(n),p(i.state.orderId),{destroy:s};let{order:g,provider:y}=i.state,T=F("div","sl-hco-summary"),S=F("div","sl-hco-seats");for(let V of g.labels)S.appendChild(F("span","sl-hco-seat",V));let v=i.formatMoney(g.total,g.currency),P=F("div","sl-hco-total");P.append(F("span",void 0,"Total"),F("strong",void 0,v)),T.append(S,P);let B=F("form","sl-hco-form"),U=F("label","sl-hco-label","Email \u2014 your tickets go here"),f=F("input","sl-hco-input");f.type="email",f.required=!0,f.autocomplete="email",f.placeholder="you@example.com",f.id=`${c}-email`,U.htmlFor=f.id;let L=F("label","sl-hco-label","Name (optional)"),A=F("input","sl-hco-input");A.type="text",A.autocomplete="name",A.placeholder="Your name",A.id=`${c}-name`,L.htmlFor=A.id;let E=F("button","sl-hco-pay",`Pay ${v}`);E.type="submit",E.disabled=!0;let I=F("button","sl-hco-back","Back to seats");I.type="button",I.addEventListener("click",r);let _=new Date(g.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),N=F("p","sl-hco-note",`Your seats are held until ${_}. Payment is handled by ${y==="razorpay"?"Razorpay":"Stripe"} \u2014 we never see your card details.`),W=F("p","sl-hco-note");W.append("The event organizer and SeatLayer use your email to issue and manage your tickets. ");let te=F("a",void 0,"Privacy Policy");te.href="https://seatlayer.io/privacy/",te.target="_blank",te.rel="noreferrer",W.appendChild(te);let Te=()=>/.+@.+\..+/.test(f.value.trim());f.addEventListener("input",()=>{E.disabled=!Te()});let fe=async()=>{u("Opening secure payment\u2026");try{let V=await i.startSession({holdId:g.holdId,buyerEmail:f.value.trim(),...A.value.trim()?{buyerName:A.value.trim()}:{}});if(!e)return;if(V.redirectUrl){lc(V.orderId,i.eventKey),u("Taking you to secure payment\u2026"),window.location.assign(V.redirectUrl);return}if(V.clientPayload){let X=V.clientPayload,H=await pc();if(!e)return;u("Waiting for payment\u2026"),new H({key:X.key,order_id:X.orderId,amount:X.amount,currency:X.currency,name:X.name,prefill:X.prefill,handler:()=>{p(V.orderId)},modal:{ondismiss:()=>{e&&Y()}}}).open();return}d(Pn("gateway_unavailable"))}catch(V){i.onError?.(V),d(Pn(V?.code))}};B.addEventListener("submit",V=>{V.preventDefault(),Te()&&fe()}),B.append(U,f,L,A,W,E,I,N);let Y=()=>{l.textContent="Checkout",h(T,B),E.disabled=!Te()};return Y(),i.root.appendChild(n),f.focus(),{destroy:s}}var No,Do,ac,cc,Vo=Xl(()=>{"use strict";No="https://checkout.razorpay.com/v1/checkout.js",Do="seatlayer-checkout-style",ac="@seatlayer/pending-checkout/v1";cc=`
|
|
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 gh={};Lo(gh,{ApiError:()=>G,BuyerAccessContext:()=>ue,BuyerAccessUnavailableError:()=>se,BuyerRealtimeClient:()=>ke,EmbeddedDesigner:()=>tn,PerformanceGroupDestroyedError:()=>Z,PerformanceGroupPicker:()=>Tn,SEATING_CHART_CALLBACK_PROPS:()=>Yn,SEATING_CHART_HANDLE_METHODS:()=>qn,SEATING_CHART_IDENTITY_PROPS:()=>Kn,SEATING_CHART_VALUE_PROPS:()=>Wn,SeasonApiError:()=>$,SeasonPicker:()=>An,SeasonPublicSessionRefused:()=>pi,SeasonRecoveryTimeoutError:()=>mi,SeatPicker:()=>Ue,SeatingChart:()=>en,attachPickerFrame:()=>Wl,bindSeatingChartHandle:()=>sr,buildSeatingChartOptions:()=>rr,createBuyerAccessContext:()=>Lt,createControllerSink:()=>vt,parseTicketOfferAvailability:()=>on,shortOperationReference:()=>Bt,ticketOfferPrices:()=>sn});module.exports=tc(gh);var j=require("@seatlayer/core");var Ze="seatlayer.v1";function ic(i){let e=typeof i.default=="string"?i.default:"free",t={};if(i.seats&&typeof i.seats=="object")for(let[n,o]of Object.entries(i.seats))typeof o=="string"&&o!==e&&(t[n]=o);return{default:e,exceptions:t}}function nc(i,e){if(!i||i.default!==e.default)return null;let t=[];for(let[n,o]of Object.entries(e.exceptions))i.exceptions[n]!==o&&t.push({label:n,status:o});for(let n of Object.keys(i.exceptions))n in e.exceptions||t.push({label:n,status:e.default});return t}function oc(i,e){for(let t of e)t.status===i.default?delete i.exceptions[t.label]:i.exceptions[t.label]=t.status}function Io(i){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(i))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(i))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var ke=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,Io(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=[Ze];if(this.opts.mintTicket){let s;try{s=await this.opts.mintTicket()}catch(r){this.reportIfAccessError(r),this.scheduleReconnect();return}if(this.stopped)return;s?.protocols?.length?(e=[...s.protocols],e.includes(Ze)||e.unshift(Ze)):s?.ticket&&(e=[Ze,`tkt.${s.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let n=this.useQueryMarker?`${this.opts.url}${this.opts.url.includes("?")?"&":"?"}pv=1`:this.opts.url;Io(n);let o;try{o=(this.opts.socketFactory??((r,a)=>new WebSocket(r,a)))(n,e)}catch{this.scheduleReconnect();return}this.ws=o,o.onopen=()=>{this.ws===o&&(this.attempt=0,this.v1=o.protocol===Ze,this.v1||(this.useQueryMarker=!0),this.startKeepalive(o),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},5e3):this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync({reason:"connect"})},5e3))},o.onmessage=s=>{if(this.ws!==o)return;let r;try{r=JSON.parse(typeof s.data=="string"?s.data:"")}catch{return}!r||typeof r!="object"||this.handleFrame(r)},o.onclose=s=>{if(this.ws===o){if(this.ws=null,this.clearTimers(),s?.code===4401){if(s.reason==="access_expired"){this.scheduleReconnect();return}this.stopped=!0,this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},o.onerror=()=>{try{o.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 n=Array.isArray(e.hidden)?e.hidden:[],o=Array.isArray(e.closed)?e.closed:[],s=n.join("\0"),r=o.join("\0");(s!==this.hidden||r!==this.closedSections)&&(this.hidden=s,this.closedSections=r,this.opts.sink.onSections?.(n,o,{withInventory:t==="snapshot"||!!e.seats}))}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 n=ic(e),o=nc(this.projection,n);this.projection=n,o===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(n):this.opts.sink.resync():o.length&&this.opts.sink.applyStatuses(o);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let n=e.changes.filter(o=>typeof o?.label=="string"&&typeof o?.status=="string").map(o=>({label:o.label,status:o.status}));if(!n.length)return;this.projection&&oc(this.projection,n),this.opts.sink.applyStatuses(n)}}}}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),n=Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}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 sc(i){return i==="blocked"?"not_for_sale":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}function vt(i,e={}){let t=n=>{let o=i.tableSelection(n);if(o)return o.physicalSeatIds;let s=i.idForLabel(n);return s?[s]:[]};return{applyStatuses(n){let o=new Set([...i.currentHold()?.labels??[],...e.ownLabels?.()??[]]),s={free:[],held:[],booked:[],not_for_sale:[]},r=[],a=[],l=new Map(i.getSelection().map(c=>[c.label,c.id]));for(let c of n){let h=t(c.label);if(!h.length)continue;let d=sc(c.status);if(s[d].push(...h),e.flashOnLiveChange&&d!=="free"&&!o.has(c.label)&&h.some(u=>i.getStatus(u)==="free")){let u=d==="held"?"#f4b740":"#f43f5e";for(let p of h)r.push({id:p,color:u})}d!=="free"&&!o.has(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])s[c].length&&i.setStatus(s[c],c);for(let c of r)i.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(d=>t(d));c.length&&i.deselect(c);let h=n.some(d=>d.status==="blocked"&&a.includes(d.label));e.onSelectedObjectUnavailable?.(a,h?"ineligible":"taken")}e.onStatusChange?.()},...i.applyProjection?{applyProjection:n=>{i.applyProjection(n)}}:{},async resync(n){await(i.resync?i.resync(n):i.refresh())},onSections(n,o,s){s?.withInventory||(i.resync?i.resync({reason:"frame"}):i.refresh()),e.onSections?.(n,o,s)}}}var G=class extends Error{constructor(e,t,n,o,s,r){super(t),this.name="ApiError",this.status=e,this.code=n,this.conflicts=o,this.reason=s,this.retryAfterS=r}},Oo=10,_o=1;function xi(i,e){let t=(i??"").trim();if(t){let n=Number(t);if(Number.isFinite(n)&&n>=0)return Math.ceil(n);let o=Date.parse(t);if(Number.isFinite(o))return Math.max(0,Math.ceil((o-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}var rc={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"},Be=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;let n=t.referral?.trim();this.referral=n?n.slice(0,120):void 0}get accessScoped(){return!!this.access?.configured}async request(e,t={},n={}){let o=t.method??"GET",s={},r;t.body!==void 0&&(s["Content-Type"]="application/json",r=JSON.stringify(t.body));let a=await this.access?.authorization(n.auth?"unauthorized":"initial");a&&(s.Authorization=a);let l=await fetch(`${this.base}${e}`,{method:o,headers:s,body:r,credentials:"omit"}),h=(l.headers.get("content-type")??"").includes("application/json")?await l.json().catch(()=>null):null;if(!l.ok){let d=h,u=d?.code??d?.error;if(this.access?.configured&&(l.status===401||l.status===403||l.status===422)&&await this.access.handleFailure(l.status,u)&&!n.auth)return this.request(e,t,{...n,auth:!0});if(l.status===409){let f=u?rc[u]:void 0,b=d?.conflicts?.map(k=>k.label)??t.labels??[];f&&this.onObjectUnavailable?.({labels:b,reason:f,code:u})}let p;if(l.status===429&&(p=xi(l.headers.get("Retry-After"),d?.retryAfterSeconds)??_o,o==="GET"&&!n.rateLimit&&p<=Oo))return await new Promise(f=>setTimeout(f,p*1e3)),this.request(e,t,{...n,rateLimit:!0});throw new G(l.status,d?.error??`request_failed_${l.status}`,u,d?.conflicts,d?.reason,p)}return h}async requestBlob(e,t={}){let n={},o=await this.access?.authorization(t.auth?"unauthorized":"initial");o&&(n.Authorization=o);let s=await fetch(`${this.base}${e}`,{method:"GET",headers:n,credentials:"omit"});if(s.ok)return s.blob();let a=(s.headers.get("content-type")??"").includes("application/json")?await s.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(s.status===401||s.status===403||s.status===422)&&await this.access.handleFailure(s.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(s.status===429&&(c=xi(s.headers.get("Retry-After"),a?.retryAfterSeconds)??_o,!t.rateLimit&&c<=Oo))return await new Promise(h=>setTimeout(h,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new G(s.status,a?.error??`request_failed_${s.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}eventConfiguration(e){return this.request(`/pub/events/${encodeURIComponent(e)}/event-configuration`)}reportViewEvidence(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/view-evidence-reports`,{method:"POST",body:{seatId:t.seatId,...t.evidenceId?{evidenceId:t.evidenceId}:{},...t.message?{message:t.message}:{}}})}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new G(404,"not_found","not_found"))}objects(e){return this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1`)}hold(e,t,n,o){return this.request(`/pub/events/${encodeURIComponent(e)}/hold`,{method:"POST",body:{selections:t,...n?{ttlMs:n}:{},...o?{replaceHoldId:o}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(s=>s.label)})}bestAvailable(e,t,n,o,s){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available`,{method:"POST",body:{qty:t,...n?{categoryKey:n}:{},...o?{zoneId:o}:{},...s?{ttlMs:s}:{},...this.referral?{referral:this.referral}:{}}})}resume(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}})}release(e,t,n){return this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:n}})}extend(e,t,n){return this.request(`/pub/events/${encodeURIComponent(e)}/extend`,{method:"POST",body:{holdId:t,...n?{ttlMs:n}:{}}})}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"),n=new URLSearchParams({surface:"picker",viewerId:this.viewerId});return`${t}/pub/events/${encodeURIComponent(e)}/subscribe?${n}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[Ze]}createRealtime(e,t){return this.accessScoped?null:new ke({url:this.subscribeUrl(e),sink:t})}};var oe=require("@seatlayer/core");var Et=require("@seatlayer/core");var ce=require("@seatlayer/core"),Wo=require("@seatlayer/core/core/seatConfidence");var zo=require("@seatlayer/core"),$o=require("@seatlayer/core/core/cdnAsset");var ac=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,lc=/[\s"'<>`\\]/;function cc(i){return i.startsWith("//")?!1:i.startsWith("/")||i.startsWith("./")||i.startsWith("../")}function dc(){try{let i=typeof location>"u"?"":location.origin;return i&&i!=="null"?i:null}catch{return null}}function wt(i){if(typeof i!="string"||!i||i.length>2e6||i!==i.trim())return!1;if(i.startsWith("data:"))return ac.test(i);if(lc.test(i))return!1;let e=dc();if(cc(i)){if(!e)return!1;try{let t=new URL(i,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(i);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}var bc=require("@seatlayer/core/core/cdnAsset");function g(i,e){let t=(0,zo.t)(i);return t===i?e:t}function Qe(){return globalThis.matchMedia?.("(pointer: coarse)").matches??!1?g("picker.dragToLookTouch","Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close"):g("picker.dragToLookMouse","Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function Si(){return{rotate:g("picker.dragToRotateVenue","Drag to rotate the venue"),move:g("picker.dragToMoveVenue","Drag to move the venue"),zoomIn:g("picker.zoomIn","Zoom in"),zoomOut:g("picker.zoomOut","Zoom out"),fitView:g("picker.fitWholeVenue","Show whole venue")}}function jo(i,e){let t=e?i.toLocaleUpperCase(e):i.toLocaleUpperCase(),n=e?i.toLocaleLowerCase(e):i.toLocaleLowerCase();if(i!==t||t===n)return i;let o=[...n][0]??"";return(e?o.toLocaleUpperCase(e):o.toLocaleUpperCase())+n.slice(o.length)}function Go(i){if(typeof i=="string"){let e=document.querySelector(i);if(!e)throw new Error(`seatmap: container "${i}" not found`);return e}if(!(i instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return i}function B(i){return String(i??"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}function Uo(i,e,t){let n=e.find(s=>wt(s))??null;if(i.replaceChildren(),!n)return i.textContent=t.slice(0,1).toUpperCase(),null;let o=document.createElement("img");return o.alt="",o.referrerPolicy="no-referrer",o.src=n,i.appendChild(o),n}var xt=null;function ki(){if(xt!==null)return xt;try{if(typeof document>"u")return xt=!1;xt=!!document.createElement("canvas").getContext("webgl2")}catch{xt=!1}return xt}function Ln(i){return(0,$o.cdnAssetUrl)(i)}var Xt=null;function Zt(){return Xt||(Xt=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Ln("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")).catch(e=>{throw Xt=null,e}),Xt)}function Ti(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||Zt().catch(()=>{})}async function Ei(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Ln("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function Ci(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Ln("seatlayer-checkout.mjs")):Promise.resolve().then(()=>(Vo(),Fo))}function qo(i){return i==="unavailable_for_event"||i==="payments_off_for_event"?i:"not_configured"}function Ai(i,e,t){let n={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},o=new Date(i);if(e)try{return o.toLocaleString(t,{...n,timeZone:e})}catch{}return o.toLocaleString(t,n)}function Hn(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function E(i){return String(i??"").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function Rn(i){return i?(0,ce.seatNoteRowModel)(i).map(e=>({...e,title:g(e.titleKey,e.titleFallback)})):[]}function Yo(i){return Rn(i).map(e=>e.title)}function Je(i,e={}){let t=Rn(i);if(!t.length)return"";let n=e.compact?15:17,o=t.map(s=>`<div class="sl-note sl-note-${E(s.tone)}"><span class="sl-note-i">${(0,ce.seatTypeIconSvg)(s.icon,{size:n})}</span><span class="sl-note-t"><b>${E(s.title)}</b>`+(s.note?`<span class="sl-note-n">${E(s.note)}</span>`:"")+"</span></div>").join("");return`<div class="sl-notes${e.compact?" compact":""}">${o}</div>`}function Xo(i){return Rn(i).map(e=>{let t=E(e.note?`${e.title}: ${e.note}`:e.title);return`<span class="sl-cx-mark sl-cx-mark-${E(e.tone)}" role="img" aria-label="${t}" title="${t}">${(0,ce.seatTypeIconSvg)(e.icon,{size:13})}</span>`}).join("")}function Pi(i){let e=[];return i?.restrictedView&&e.push(g("picker.restrictedView","Restricted view")),i?.obstructedView&&e.push(g("picker.obstructedView","Obstructed view")),e}function In(i,e){if(!i)return"";let t=e?g("picker.viewFromThisSeat","View from this seat"):g("picker.seeItIn3d","See it in 3D"),n=e?g("picker.viewFromHere","View from here"):t;return`<button type="button" class="sl-confirm-3d" aria-label="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span>${n}</span></button>`}function Zo(i){if(!i)return"";let e=i.previous.label||i.previous.id,t=i.next.label||i.next.id;return`<span class="sl-seccard-nav" aria-label="${g("picker.browseSections","Browse sections")}"><button type="button" data-section-nav="${B(i.previous.id)}" aria-label="${g("picker.previousSection","Previous section")}: ${B(e)}" title="${B(e)}">\u2190</button><button type="button" data-section-nav="${B(i.next.id)}" aria-label="${g("picker.nextSection","Next section")}: ${B(t)}" title="${B(t)}">\u2192</button></span>`}function Qo(i,e){if(!e)return"";let t=e,n=t.includes(i.id),o=n?t.length>1?g("picker.openComparison","Open comparison"):g("picker.savedForComparison","Saved for comparison"):t.length?g("picker.compareWithSaved","Compare with saved"):g("picker.saveToCompare","Save to compare");return`<button type="button" class="sl-confirm-compare"${n&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${E(o)}</span></button>`}function Jo(i,e,t){if(!t)return"";let n=(0,Wo.seatConfidenceDisclosure)(i.confidenceEvidence),o=n.modeledTarget??n.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${E(i.displayLabel??i.label)}"><span><em>${E(e)}</em><strong>${E(n.headline)}</strong><small>${E(o)}</small></span><b>Passport</b></button>`}function X(i){let e=i?.rowLabel,t=i?.sectionLabel;if(!e||!t)return e;for(let n of["-"," ","\xB7","/","_"]){let o=`${t}${n}`;if(e.startsWith(o)&&e.length>o.length)return e.slice(o.length)}return(0,ce.compactRowLabel)(e,t)}function yc(i){switch(i){case"paused":return{title:g("picker.accessPausedTitle","These seats are on hold right now"),body:g("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:g("picker.accessRetry","Try again")};case"revoked":return{title:g("picker.accessRevokedTitle","This access link is no longer active"),body:g("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats."),action:g("picker.accessRefresh","Refresh")};case"no_token":case"provider_failed":return{title:g("picker.accessExpiredTitle","The seat map timed out"),body:g("picker.accessExpiredBody","Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now."),action:g("picker.accessRefresh","Refresh")};default:return{title:g("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:g("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest."),action:g("picker.accessRefresh","Refresh")}}}var vc=6;function es(i,e,t){let n=Hn;return[i?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${i.sectionLabel.length>vc?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${g("picker.section","Section")}</span><span class="sl-confirm-value">${n(i.sectionLabel)}</span></div>`:"",i?.rowLabel||i?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${n(t)}</span><span class="sl-confirm-value">${n(X(i)??i?.displayLabel??e)}</span></div>`:"",i?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${g("picker.seat","Seat")}</span><span class="sl-confirm-value">${n(i?.seatNumber??i?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function ts(i,e,t){let n=Hn,o=i?.objectType==="booth",s=i?.objectType==="table"&&!!i?.bookingMode,r=o||s||!i?.seatNumber,a=i?.sectionLabel??(r?void 0:i?.displayLabel),l=s?`${g("picker.guests","Guests")} ${i?.bookingMode==="variable"?`${i?.minOccupancy}\u2013${i?.maxOccupancy}`:i?.capacity}`:void 0,h=(r?[l,a?i?.rowLabel??i?.displayLabel:void 0]:[i?.rowLabel?`${t} ${X(i)??""}`.trim():void 0,`${g("picker.seat","Seat")} ${i?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${n(a)}</span>`:"")+(h?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${n(h)}</span>`:"")+(a||h?"":`<span class="sl-confirm-pos">${n(e)}</span>`)}function is(i,e){if(!i)return"";let t=e?g("picker.viewFromThisSeat","View from this seat"):g("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-pill sl-confirm-3dpill" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function ns(i,e){if(!i||e)return"";let t=g("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-3drow" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function Ko(i){return i.buyerMessage?.trim()||(i.restriction==="companion"?g("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function os(i,e,t){let n=Hn;if(i.length>1)return`<fieldset class="sl-confirm-tiers"><legend>${g("picker.ticketType","Ticket type")}</legend>`+i.map(r=>{let a=Ko(r);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${n(r.id)}" aria-pressed="${r.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${n(r.name)}</span>`+(a?`<small class="sl-confirm-tier-note">${n(a)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${n(t(r))}</span></button>`}).join("")+"</fieldset>";let o=i[0],s=o?Ko(o):void 0;return s?`<p class="sl-confirm-tier-note">${n(s)}</p>`:""}function ss(i){return`<span class="sl-seccard-dot" style="background:${E(i.color)}"></span><span class="sl-seccard-name">${E(i.label)}</span><span class="sl-seccard-left" data-full="${E(i.leftLabel)}" data-short="${E(i.leftShortLabel??i.leftLabel)}">${E(i.leftLabel)}</span>`+i.nav+i.close}function rs(i){return`<div class="sl-seccard-head"><span class="sl-seccard-dot" style="background:${E(i.color)}"></span><span class="sl-seccard-name">${E(i.label)}</span>`+(i.showPrice?`<span class="sl-seccard-price">${E(i.priceLabel)}</span>`:"")+i.close+`</div><div class="sl-seccard-zone">${i.zoneLabel?`${E(i.zoneLabel)} \xB7 `:""}<span class="sl-seccard-left">${E(i.leftLabel)}</span></div>`+(i.entrance?`<div class="sl-seccard-entrance">${E(i.entrance)}</div>`:"")+(i.mix?`<div class="sl-seccard-mix">${i.mix}</div>`:"")+`<div class="sl-seccard-foot"><button type="button" class="sl-seccard-overview">\u2190 ${E(i.overviewLabel)}</button>`+i.nav+`<span class="sl-seccard-hint">${E(i.hint)}</span></div>`}function as(i){return`<span class="sl-seccard-mix-item${i.dim?" sl-dim":""}"><span class="sl-seccard-mix-dot" style="background:${E(i.color)}"></span>${E(i.label)} <span class="sl-seccard-mix-price">${E(i.rangeLabel)}</span></span>`}function ls(i){return'<div class="sl-confirm-grid">'+i.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${E(i.categoryLabel)}</span>`+(i.priceLabel?`<span class="sl-confirm-price">${E(i.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-id">'+i.marker+`<span class="sl-confirm-dot" style="background:${E(i.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${E(i.categoryLabel)}</span><span class="sl-confirm-who">`+i.identity+"</span>"+(i.priceLabel?`<span class="sl-confirm-idprice">${E(i.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+i.commercial+i.tierChoices+i.groupDates+i.wheelchair+(i.thumb||i.see3dPill?`<div class="sl-confirm-strip">${i.thumb}<span class="sl-confirm-pills">${i.see3dPill}</span></div>`:"")+i.inspect+'<div class="sl-confirm-row">'+(i.see3dRow??"")+`<button type="button" class="sl-confirm-cancel">${E(i.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${E(i.selectLabel)}</span></button></div></div>`}function cs(i,e){let t=B,{variable:n}=e;return`<section class="sl-table-dialog" role="dialog" aria-modal="true" aria-labelledby="sl-table-title" aria-describedby="sl-table-copy"><div class="sl-table-head"><div class="sl-table-eyebrow">${t(n?(0,ce.t)("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):(0,ce.t)("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(i.displayLabel??i.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(n?g("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):(0,ce.t)("picker.allPlacesBookedTogether",{count:i.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t((0,ce.t)("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(g("picker.tableCapacity","Table capacity"))}</span><span>${t((0,ce.t)("picker.guestsCount",{count:i.capacity}))}</span>`+(e.suppressPricing?"":`<span class="muted">${t(g("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(n?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(g("picker.numberOfGuests","Number of guests"))}</label><div class="sl-table-stepper" role="group" aria-labelledby="sl-table-qty-label"><button type="button" data-table-step="-1" aria-label="${t(g("picker.fewerGuests","Fewer guests"))}">\u2212</button><output aria-live="polite" data-table-qty>${i.quantity}</output><button type="button" data-table-step="1" aria-label="${t(g("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t((0,ce.t)("picker.chooseMinMaxGuests",{min:i.minOccupancy,max:i.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${i.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t((0,ce.t)("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?g("picker.updateTable","Update table"):n?g("picker.selectTable","Select table"):g("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function ds(i,e){let t=yc(i),n=document.createElement("div");n.className="sl-interrupt sl-access",n.setAttribute("role","status"),n.setAttribute("aria-live","polite");let o=document.createElement("div");o.className="sl-interrupt-card";let s=document.createElement("div");s.className="sl-interrupt-title",s.textContent=t.title;let r=document.createElement("div");r.className="sl-interrupt-body",r.textContent=t.body,o.append(s,r);let a=document.createElement("div");a.className="sl-interrupt-actions";let l=document.createElement("button");l.type="button",l.className="sl-interrupt-act";let c=document.createElement("span");c.className="sl-interrupt-act-icon",c.setAttribute("aria-hidden","true"),c.textContent="\u21BB";let h=document.createElement("span");return h.textContent=t.action,l.append(c,h),l.addEventListener("click",async()=>{n.classList.add("is-reloading"),l.disabled=!0;try{await e()}catch{}finally{n.isConnected&&(n.classList.remove("is-reloading"),l.disabled=!1)}}),a.appendChild(l),o.appendChild(a),n.appendChild(o),n}function ps(i,e){return`<div class="sl-a11yhead"><span class="sl-a11yhead-t">${E(i)}</span><button type="button" class="sl-a11yclose" data-a11y-close aria-label="${B(e)}"><svg viewBox="0 0 24 24" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function hs(i){return i.map(e=>{let t=`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${E(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"`+(e.disabled?' disabled aria-disabled="true"':"")+`><span class="sl-a11yrow-i" aria-hidden="true">${e.iconHtml}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${E(e.label)}</span></span>`+(e.count?`<span class="sl-a11yrow-c">${E(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>';return e.note?`<div class="sl-a11yrow-w">${t}${St({id:`sl-info-${B(e.key.replace(/[^A-Za-z0-9]+/g,"-"))}`,label:e.note,text:E(e.note)})}</div>`:t}).join("")}function St(i){return`<span class="sl-info"${i.wrapRef?` data-ref="${B(i.wrapRef)}"`:""}><button type="button" class="sl-info-btn" data-sl-info aria-label="${B(i.label)}" aria-describedby="${B(i.id)}" aria-expanded="false"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v5"/><path d="M12 8h.01"/></svg></button><span class="sl-info-pop" role="tooltip" id="${B(i.id)}"${i.ref?` data-ref="${B(i.ref)}"`:""}>${i.text}</span></span>`}var Hi=require("@seatlayer/core/core/color");function Le(i){if(!i)return null;let e=i.trim().toLowerCase();if(e==="white")return{r:255,g:255,b:255};if(e==="black")return{r:0,g:0,b:0};let t=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(e)?.[1];if(t){let o=t.length<=4?[...t].map(s=>`${s}${s}`).join(""):t;return{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16)}}let n=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/i.exec(e);return n?{r:Math.max(0,Math.min(255,Number(n[1]))),g:Math.max(0,Math.min(255,Number(n[2]))),b:Math.max(0,Math.min(255,Number(n[3])))}:null}function Mi(i){return(0,Hi.relativeLuminance255)([i.r,i.g,i.b])}function we(i,e){let t=Le(i),n=Le(e);if(!t||!n)return null;let o=Math.max(Mi(t),Mi(n)),s=Math.min(Mi(t),Mi(n));return(o+.05)/(s+.05)}function et(i,e="#172033",t="#eef1f8"){return(we(e,i)??0)>=(we(t,i)??0)?e:t}function wc(i){return(0,Hi.rgb255ToHex)(i.r,i.g,i.b)}function On(i,e,t){let n=Le(i),o=Le(e);if(!n||!o)return null;let s=Math.max(0,Math.min(1,t));return wc({r:n.r*s+o.r*(1-s),g:n.g*s+o.g*(1-s),b:n.b*s+o.b*(1-s)})}var Li="#d8a425",xc=.18;function us(i,e){let t=On(Li,e,xc)??e;if((we(Li,t)??0)>=4.5)return Li;for(let n=.15;n<=1;n+=.05){let o=On(Li,i,1-n);if(o&&(we(o,t)??0)>=4.5)return o}return et(t)}function ms(i,e,t,n){if((we(i,t)??4.5)>=4.5&&(we(i,n)??4.5)>=4.5)return i;if(!Le(i)||!Le(e))return e;for(let o=.15;o<=1;o+=.05){let s=On(i,e,1-o);if(s&&(we(s,t)??0)>=4.5&&(we(s,n)??0)>=4.5)return s}return e}function fs(i){return{"--sl-chrome":i?"#ffffff":"#556278","--sl-chrome-line":i?"rgba(23,32,51,.55)":"rgba(233,238,247,.55)"}}var gs=["--sl-bg","--sl-surface","--sl-text","--sl-muted","--sl-line","--sl-accent-text","--sl-warn-text","--sl-chrome","--sl-chrome-line"];function bs(i,e){let t=e??i["--sl-bg"],n=Le(t)?et(t)==="#172033":!1,o=Le(i["--sl-bg"])?et(i["--sl-bg"])==="#172033":!1;if(n===o)return null;let s=n?"#ffffff":"#1a2234",r=et(t),a=i["--sl-accent"];return{"--sl-bg":t,"--sl-surface":s,"--sl-text":r,"--sl-muted":n?"#667085":"#a5aec2","--sl-line":n?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)","--sl-accent-text":ms(a,r,t,s),...fs(n),"--sl-warn-text":us(r,s)}}var ys={light:{background:"#ffffff",surface:"#f6f7fb",text:"#172033",muted:"#667085",line:"rgba(23,32,51,.16)",map:"#e9edf4"},dark:{background:"#0f1522",surface:"#1a2234",text:"#eef1f8",muted:"#a5aec2",line:"rgba(165,174,194,.24)",map:"#0f1522"}};function Sc(){try{return window.matchMedia?.("(prefers-color-scheme: dark)").matches===!0}catch{return!1}}function Qt(i){if(i)return i==="auto"?Sc()?"dark":"light":i}function kt(i,e=i?.mode){if(i?.map)return i.map;let t=Qt(e);return t?{background:ys[t].map}:null}function Ri(i){let e;try{e=window.matchMedia?.("(prefers-color-scheme: dark)")}catch{return()=>{}}if(!e)return()=>{};let t=n=>i(n.matches);return typeof e.addEventListener=="function"?e.addEventListener("change",t):e.addListener?.(t),()=>{typeof e.removeEventListener=="function"?e.removeEventListener("change",t):e.removeListener?.(t)}}function Tt(i,e,t){let n=t?ys[t]:null,o=e?.background??n?.background??i?.background??"#0f1522",s=Le(o)?et(o)==="#172033":!1,r=e?.surface??n?.surface??(s?"#ffffff":"#1a2234"),a=e?.accent??i?.accent??"#f4b740",l=i?.accentInk,c=e?.accentInk??(l&&(we(l,a)??4.5)>=4.5?l:et(a,"#1a1200","#ffffff")),h=n?void 0:i?.textColor,d=e?.text??n?.text??(h&&(we(h,o)??4.5)>=4.5&&(we(h,r)??4.5)>=4.5?h:et(o));return{"--sl-accent":a,"--sl-accent-ink":c,"--sl-accent-text":ms(a,d,o,r),"--sl-warn-text":us(d,r),"--sl-bg":o,"--sl-surface":r,"--sl-text":d,"--sl-muted":e?.muted??n?.muted??(s?"#667085":"#a5aec2"),"--sl-line":e?.line??n?.line??(s?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)"),...fs(s),"--sl-scrim-ink":s?"rgba(16,22,36,1)":"rgba(4,7,13,1)","--sl-font":e?.fontFamily??i?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${e?.radius??14}px`}}function kc(){return`<svg class="sl-boot-venue" viewBox="0 0 200 140" preserveAspectRatio="xMidYMid meet" aria-hidden="true" focusable="false"><g class="sl-boot-shells">${["M20 92a80 52 0 0 1 160 0v14a94 62 0 0 0-160 0z","M32 74a68 42 0 0 1 136 0v12a80 50 0 0 0-136 0z","M46 58a54 32 0 0 1 108 0v10a64 38 0 0 0-108 0z"].map(e=>`<path d="${e}" />`).join("")}</g><rect class="sl-boot-stage" x="62" y="16" width="76" height="16" rx="4" /></svg>`}function vs(i,e,t){let n=document.createElement("div");n.className="sl-picker",n.tabIndex=-1,n.lang=(0,Et.getLocale)(),n.dir=(0,Et.localeDirection)(),i.appendChild(n),Object.entries(Tt(void 0,t)).forEach(([s,r])=>n.style.setProperty(s,r)),n.innerHTML=`
|
|
41
|
+
`});var hh={};Mo(hh,{ApiError:()=>j,BuyerAccessContext:()=>ue,BuyerAccessUnavailableError:()=>se,BuyerRealtimeClient:()=>Ee,EmbeddedDesigner:()=>en,PerformanceGroupDestroyedError:()=>Q,PerformanceGroupPicker:()=>kn,SEATING_CHART_CALLBACK_PROPS:()=>Wn,SEATING_CHART_HANDLE_METHODS:()=>Un,SEATING_CHART_IDENTITY_PROPS:()=>qn,SEATING_CHART_VALUE_PROPS:()=>Kn,SeasonApiError:()=>z,SeasonPicker:()=>Cn,SeasonPublicSessionRefused:()=>di,SeasonRecoveryTimeoutError:()=>ui,SeatPicker:()=>qe,SeatingChart:()=>Ji,attachPickerFrame:()=>Gl,bindSeatingChartHandle:()=>ir,buildSeatingChartOptions:()=>nr,createBuyerAccessContext:()=>Mt,createControllerSink:()=>vt,parseTicketOfferAvailability:()=>nn,shortOperationReference:()=>Bt,ticketOfferPrices:()=>on});module.exports=Zl(hh);var $=require("@seatlayer/core");var Qe="seatlayer.v1";function Ql(i){let e=typeof i.default=="string"?i.default:"free",t={};if(i.seats&&typeof i.seats=="object")for(let[n,o]of Object.entries(i.seats))typeof o=="string"&&o!==e&&(t[n]=o);return{default:e,exceptions:t}}function Jl(i,e){if(!i||i.default!==e.default)return null;let t=[];for(let[n,o]of Object.entries(e.exceptions))i.exceptions[n]!==o&&t.push({label:n,status:o});for(let n of Object.keys(i.exceptions))n in e.exceptions||t.push({label:n,status:e.default});return t}function ec(i,e){for(let t of e)t.status===i.default?delete i.exceptions[t.label]:i.exceptions[t.label]=t.status}function Io(i){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(i))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(i))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var Ee=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,Io(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=[Qe];if(this.opts.mintTicket){let s;try{s=await this.opts.mintTicket()}catch(r){this.reportIfAccessError(r),this.scheduleReconnect();return}if(this.stopped)return;s?.protocols?.length?(e=[...s.protocols],e.includes(Qe)||e.unshift(Qe)):s?.ticket&&(e=[Qe,`tkt.${s.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let n=this.useQueryMarker?`${this.opts.url}${this.opts.url.includes("?")?"&":"?"}pv=1`:this.opts.url;Io(n);let o;try{o=(this.opts.socketFactory??((r,a)=>new WebSocket(r,a)))(n,e)}catch{this.scheduleReconnect();return}this.ws=o,o.onopen=()=>{this.ws===o&&(this.attempt=0,this.v1=o.protocol===Qe,this.v1||(this.useQueryMarker=!0),this.startKeepalive(o),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},5e3):this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync({reason:"connect"})},5e3))},o.onmessage=s=>{if(this.ws!==o)return;let r;try{r=JSON.parse(typeof s.data=="string"?s.data:"")}catch{return}!r||typeof r!="object"||this.handleFrame(r)},o.onclose=s=>{if(this.ws===o){if(this.ws=null,this.clearTimers(),s?.code===4401){if(s.reason==="access_expired"){this.scheduleReconnect();return}this.stopped=!0,this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},o.onerror=()=>{try{o.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 n=Array.isArray(e.hidden)?e.hidden:[],o=Array.isArray(e.closed)?e.closed:[],s=n.join("\0"),r=o.join("\0");(s!==this.hidden||r!==this.closedSections)&&(this.hidden=s,this.closedSections=r,this.opts.sink.onSections?.(n,o,{withInventory:t==="snapshot"||!!e.seats}))}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 n=Ql(e),o=Jl(this.projection,n);this.projection=n,o===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(n):this.opts.sink.resync():o.length&&this.opts.sink.applyStatuses(o);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let n=e.changes.filter(o=>typeof o?.label=="string"&&typeof o?.status=="string").map(o=>({label:o.label,status:o.status}));if(!n.length)return;this.projection&&ec(this.projection,n),this.opts.sink.applyStatuses(n)}}}}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),n=Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}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 tc(i){return i==="blocked"?"not_for_sale":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}function vt(i,e={}){let t=n=>{let o=i.tableSelection(n);if(o)return o.physicalSeatIds;let s=i.idForLabel(n);return s?[s]:[]};return{applyStatuses(n){let o=new Set([...i.currentHold()?.labels??[],...e.ownLabels?.()??[]]),s={free:[],held:[],booked:[],not_for_sale:[]},r=[],a=[],l=new Map(i.getSelection().map(c=>[c.label,c.id]));for(let c of n){let h=t(c.label);if(!h.length)continue;let d=tc(c.status);if(s[d].push(...h),e.flashOnLiveChange&&d!=="free"&&!o.has(c.label)&&h.some(u=>i.getStatus(u)==="free")){let u=d==="held"?"#f4b740":"#f43f5e";for(let p of h)r.push({id:p,color:u})}d!=="free"&&!o.has(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])s[c].length&&i.setStatus(s[c],c);for(let c of r)i.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(d=>t(d));c.length&&i.deselect(c);let h=n.some(d=>d.status==="blocked"&&a.includes(d.label));e.onSelectedObjectUnavailable?.(a,h?"ineligible":"taken")}e.onStatusChange?.()},...i.applyProjection?{applyProjection:n=>{i.applyProjection(n)}}:{},async resync(n){await(i.resync?i.resync(n):i.refresh())},onSections(n,o,s){s?.withInventory||(i.resync?i.resync({reason:"frame"}):i.refresh()),e.onSections?.(n,o,s)}}}var j=class extends Error{constructor(e,t,n,o,s,r){super(t),this.name="ApiError",this.status=e,this.code=n,this.conflicts=o,this.reason=s,this.retryAfterS=r}},Oo=10,_o=1;function wi(i,e){let t=(i??"").trim();if(t){let n=Number(t);if(Number.isFinite(n)&&n>=0)return Math.ceil(n);let o=Date.parse(t);if(Number.isFinite(o))return Math.max(0,Math.ceil((o-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}var ic={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"},Fe=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;let n=t.referral?.trim();this.referral=n?n.slice(0,120):void 0}get accessScoped(){return!!this.access?.configured}async request(e,t={},n={}){let o=t.method??"GET",s={},r;t.body!==void 0&&(s["Content-Type"]="application/json",r=JSON.stringify(t.body));let a=await this.access?.authorization(n.auth?"unauthorized":"initial");a&&(s.Authorization=a);let l=await fetch(`${this.base}${e}`,{method:o,headers:s,body:r,credentials:"omit"}),h=(l.headers.get("content-type")??"").includes("application/json")?await l.json().catch(()=>null):null;if(!l.ok){let d=h,u=d?.code??d?.error;if(this.access?.configured&&(l.status===401||l.status===403||l.status===422)&&await this.access.handleFailure(l.status,u)&&!n.auth)return this.request(e,t,{...n,auth:!0});if(l.status===409){let g=u?ic[u]:void 0,y=d?.conflicts?.map(T=>T.label)??t.labels??[];g&&this.onObjectUnavailable?.({labels:y,reason:g,code:u})}let p;if(l.status===429&&(p=wi(l.headers.get("Retry-After"),d?.retryAfterSeconds)??_o,o==="GET"&&!n.rateLimit&&p<=Oo))return await new Promise(g=>setTimeout(g,p*1e3)),this.request(e,t,{...n,rateLimit:!0});throw new j(l.status,d?.error??`request_failed_${l.status}`,u,d?.conflicts,d?.reason,p)}return h}async requestBlob(e,t={}){let n={},o=await this.access?.authorization(t.auth?"unauthorized":"initial");o&&(n.Authorization=o);let s=await fetch(`${this.base}${e}`,{method:"GET",headers:n,credentials:"omit"});if(s.ok)return s.blob();let a=(s.headers.get("content-type")??"").includes("application/json")?await s.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(s.status===401||s.status===403||s.status===422)&&await this.access.handleFailure(s.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(s.status===429&&(c=wi(s.headers.get("Retry-After"),a?.retryAfterSeconds)??_o,!t.rateLimit&&c<=Oo))return await new Promise(h=>setTimeout(h,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new j(s.status,a?.error??`request_failed_${s.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}eventConfiguration(e){return this.request(`/pub/events/${encodeURIComponent(e)}/event-configuration`)}reportViewEvidence(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/view-evidence-reports`,{method:"POST",body:{seatId:t.seatId,...t.evidenceId?{evidenceId:t.evidenceId}:{},...t.message?{message:t.message}:{}}})}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new j(404,"not_found","not_found"))}objects(e){return this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1`)}hold(e,t,n,o){return this.request(`/pub/events/${encodeURIComponent(e)}/hold`,{method:"POST",body:{selections:t,...n?{ttlMs:n}:{},...o?{replaceHoldId:o}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(s=>s.label)})}bestAvailable(e,t,n,o,s){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available`,{method:"POST",body:{qty:t,...n?{categoryKey:n}:{},...o?{zoneId:o}:{},...s?{ttlMs:s}:{},...this.referral?{referral:this.referral}:{}}})}resume(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}})}release(e,t,n){return this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:n}})}extend(e,t,n){return this.request(`/pub/events/${encodeURIComponent(e)}/extend`,{method:"POST",body:{holdId:t,...n?{ttlMs:n}:{}}})}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"),n=new URLSearchParams({surface:"picker",viewerId:this.viewerId});return`${t}/pub/events/${encodeURIComponent(e)}/subscribe?${n}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[Qe]}createRealtime(e,t){return this.accessScoped?null:new Ee({url:this.subscribeUrl(e),sink:t})}};var oe=require("@seatlayer/core");var Et=require("@seatlayer/core");var ce=require("@seatlayer/core"),Wo=require("@seatlayer/core/core/seatConfidence");var zo=require("@seatlayer/core"),$o=require("@seatlayer/core/core/cdnAsset");var nc=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,oc=/[\s"'<>`\\]/;function sc(i){return i.startsWith("//")?!1:i.startsWith("/")||i.startsWith("./")||i.startsWith("../")}function rc(){try{let i=typeof location>"u"?"":location.origin;return i&&i!=="null"?i:null}catch{return null}}function wt(i){if(typeof i!="string"||!i||i.length>2e6||i!==i.trim())return!1;if(i.startsWith("data:"))return nc.test(i);if(oc.test(i))return!1;let e=rc();if(sc(i)){if(!e)return!1;try{let t=new URL(i,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(i);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}var uc=require("@seatlayer/core/core/cdnAsset");function b(i,e){let t=(0,zo.t)(i);return t===i?e:t}function Je(){return globalThis.matchMedia?.("(pointer: coarse)").matches??!1?b("picker.dragToLookTouch","Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close"):b("picker.dragToLookMouse","Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function xi(){return{rotate:b("picker.dragToRotateVenue","Drag to rotate the venue"),move:b("picker.dragToMoveVenue","Drag to move the venue"),zoomIn:b("picker.zoomIn","Zoom in"),zoomOut:b("picker.zoomOut","Zoom out"),fitView:b("picker.fitWholeVenue","Show whole venue")}}function jo(i,e){let t=e?i.toLocaleUpperCase(e):i.toLocaleUpperCase(),n=e?i.toLocaleLowerCase(e):i.toLocaleLowerCase();if(i!==t||t===n)return i;let o=[...n][0]??"";return(e?o.toLocaleUpperCase(e):o.toLocaleUpperCase())+n.slice(o.length)}function Go(i){if(typeof i=="string"){let e=document.querySelector(i);if(!e)throw new Error(`seatmap: container "${i}" not found`);return e}if(!(i instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return i}function D(i){return String(i??"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}function Uo(i,e,t){let n=e.find(s=>wt(s))??null;if(i.replaceChildren(),!n)return i.textContent=t.slice(0,1).toUpperCase(),null;let o=document.createElement("img");return o.alt="",o.referrerPolicy="no-referrer",o.src=n,i.appendChild(o),n}var xt=null;function Si(){if(xt!==null)return xt;try{if(typeof document>"u")return xt=!1;xt=!!document.createElement("canvas").getContext("webgl2")}catch{xt=!1}return xt}function Ln(i){return(0,$o.cdnAssetUrl)(i)}var Yt=null;function Xt(){return Yt||(Yt=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Ln("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")).catch(e=>{throw Yt=null,e}),Yt)}function ki(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||Xt().catch(()=>{})}async function Ti(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Ln("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function Ei(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Ln("seatlayer-checkout.mjs")):Promise.resolve().then(()=>(Vo(),Fo))}function qo(i){return i==="unavailable_for_event"||i==="payments_off_for_event"?i:"not_configured"}function Ci(i,e,t){let n={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},o=new Date(i);if(e)try{return o.toLocaleString(t,{...n,timeZone:e})}catch{}return o.toLocaleString(t,n)}function Mn(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function C(i){return String(i??"").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function Hn(i){return i?(0,ce.seatNoteRowModel)(i).map(e=>({...e,title:b(e.titleKey,e.titleFallback)})):[]}function Yo(i){return Hn(i).map(e=>e.title)}function et(i,e={}){let t=Hn(i);if(!t.length)return"";let n=e.compact?15:17,o=t.map(s=>`<div class="sl-note sl-note-${C(s.tone)}"><span class="sl-note-i">${(0,ce.seatTypeIconSvg)(s.icon,{size:n})}</span><span class="sl-note-t"><b>${C(s.title)}</b>`+(s.note?`<span class="sl-note-n">${C(s.note)}</span>`:"")+"</span></div>").join("");return`<div class="sl-notes${e.compact?" compact":""}">${o}</div>`}function Xo(i){return Hn(i).map(e=>{let t=C(e.note?`${e.title}: ${e.note}`:e.title);return`<span class="sl-cx-mark sl-cx-mark-${C(e.tone)}" role="img" aria-label="${t}" title="${t}">${(0,ce.seatTypeIconSvg)(e.icon,{size:13})}</span>`}).join("")}function Ai(i){let e=[];return i?.restrictedView&&e.push(b("picker.restrictedView","Restricted view")),i?.obstructedView&&e.push(b("picker.obstructedView","Obstructed view")),e}function Rn(i,e){if(!i)return"";let t=e?b("picker.viewFromThisSeat","View from this seat"):b("picker.seeItIn3d","See it in 3D"),n=e?b("picker.viewFromHere","View from here"):t;return`<button type="button" class="sl-confirm-3d" aria-label="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span>${n}</span></button>`}function Zo(i,e){if(!e)return"";let t=e,n=t.includes(i.id),o=n?t.length>1?b("picker.openComparison","Open comparison"):b("picker.savedForComparison","Saved for comparison"):t.length?b("picker.compareWithSaved","Compare with saved"):b("picker.saveToCompare","Save to compare");return`<button type="button" class="sl-confirm-compare"${n&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${C(o)}</span></button>`}function Qo(i,e,t){if(!t)return"";let n=(0,Wo.seatConfidenceDisclosure)(i.confidenceEvidence),o=n.modeledTarget??n.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${C(i.displayLabel??i.label)}"><span><em>${C(e)}</em><strong>${C(n.headline)}</strong><small>${C(o)}</small></span><b>Passport</b></button>`}function Z(i){let e=i?.rowLabel,t=i?.sectionLabel;if(!e||!t)return e;for(let n of["-"," ","\xB7","/","_"]){let o=`${t}${n}`;if(e.startsWith(o)&&e.length>o.length)return e.slice(o.length)}return(0,ce.compactRowLabel)(e,t)}function mc(i){switch(i){case"paused":return{title:b("picker.accessPausedTitle","These seats are on hold right now"),body:b("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:b("picker.accessRetry","Try again")};case"revoked":return{title:b("picker.accessRevokedTitle","This access link is no longer active"),body:b("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats."),action:b("picker.accessRefresh","Refresh")};case"no_token":case"provider_failed":return{title:b("picker.accessExpiredTitle","The seat map timed out"),body:b("picker.accessExpiredBody","Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now."),action:b("picker.accessRefresh","Refresh")};default:return{title:b("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:b("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest."),action:b("picker.accessRefresh","Refresh")}}}var fc=6;function Jo(i,e,t){let n=Mn;return[i?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${i.sectionLabel.length>fc?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${b("picker.section","Section")}</span><span class="sl-confirm-value">${n(i.sectionLabel)}</span></div>`:"",i?.rowLabel||i?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${n(t)}</span><span class="sl-confirm-value">${n(Z(i)??i?.displayLabel??e)}</span></div>`:"",i?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${b("picker.seat","Seat")}</span><span class="sl-confirm-value">${n(i?.seatNumber??i?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function es(i,e,t){let n=Mn,o=i?.objectType==="booth",s=i?.objectType==="table"&&!!i?.bookingMode,r=o||s||!i?.seatNumber,a=i?.sectionLabel??(r?void 0:i?.displayLabel),l=s?`${b("picker.guests","Guests")} ${i?.bookingMode==="variable"?`${i?.minOccupancy}\u2013${i?.maxOccupancy}`:i?.capacity}`:void 0,h=(r?[l,a?i?.rowLabel??i?.displayLabel:void 0]:[i?.rowLabel?`${t} ${Z(i)??""}`.trim():void 0,`${b("picker.seat","Seat")} ${i?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${n(a)}</span>`:"")+(h?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${n(h)}</span>`:"")+(a||h?"":`<span class="sl-confirm-pos">${n(e)}</span>`)}function ts(i,e){if(!i)return"";let t=e?b("picker.viewFromThisSeat","View from this seat"):b("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-pill sl-confirm-3dpill" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function is(i,e){if(!i||e)return"";let t=b("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-3drow" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function Ko(i){return i.buyerMessage?.trim()||(i.restriction==="companion"?b("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function ns(i,e,t){let n=Mn;if(i.length>1)return`<fieldset class="sl-confirm-tiers"><legend>${b("picker.ticketType","Ticket type")}</legend>`+i.map(r=>{let a=Ko(r);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${n(r.id)}" aria-pressed="${r.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${n(r.name)}</span>`+(a?`<small class="sl-confirm-tier-note">${n(a)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${n(t(r))}</span></button>`}).join("")+"</fieldset>";let o=i[0],s=o?Ko(o):void 0;return s?`<p class="sl-confirm-tier-note">${n(s)}</p>`:""}function os(i){return'<div class="sl-confirm-grid">'+i.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${C(i.categoryLabel)}</span>`+(i.priceLabel?`<span class="sl-confirm-price">${C(i.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-id">'+i.marker+`<span class="sl-confirm-dot" style="background:${C(i.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${C(i.categoryLabel)}</span><span class="sl-confirm-who">`+i.identity+"</span>"+(i.priceLabel?`<span class="sl-confirm-idprice">${C(i.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+i.commercial+i.tierChoices+i.groupDates+i.wheelchair+(i.thumb||i.see3dPill?`<div class="sl-confirm-strip">${i.thumb}<span class="sl-confirm-pills">${i.see3dPill}</span></div>`:"")+i.inspect+'<div class="sl-confirm-row">'+(i.see3dRow??"")+`<button type="button" class="sl-confirm-cancel">${C(i.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${C(i.selectLabel)}</span></button></div></div>`}function ss(i,e){let t=D,{variable:n}=e;return`<section class="sl-table-dialog" role="dialog" aria-modal="true" aria-labelledby="sl-table-title" aria-describedby="sl-table-copy"><div class="sl-table-head"><div class="sl-table-eyebrow">${t(n?(0,ce.t)("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):(0,ce.t)("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(i.displayLabel??i.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(n?b("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):(0,ce.t)("picker.allPlacesBookedTogether",{count:i.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t((0,ce.t)("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(b("picker.tableCapacity","Table capacity"))}</span><span>${t((0,ce.t)("picker.guestsCount",{count:i.capacity}))}</span>`+(e.suppressPricing?"":`<span class="muted">${t(b("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(n?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(b("picker.numberOfGuests","Number of guests"))}</label><div class="sl-table-stepper" role="group" aria-labelledby="sl-table-qty-label"><button type="button" data-table-step="-1" aria-label="${t(b("picker.fewerGuests","Fewer guests"))}">\u2212</button><output aria-live="polite" data-table-qty>${i.quantity}</output><button type="button" data-table-step="1" aria-label="${t(b("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t((0,ce.t)("picker.chooseMinMaxGuests",{min:i.minOccupancy,max:i.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${i.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t((0,ce.t)("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?b("picker.updateTable","Update table"):n?b("picker.selectTable","Select table"):b("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function rs(i,e){let t=mc(i),n=document.createElement("div");n.className="sl-interrupt sl-access",n.setAttribute("role","status"),n.setAttribute("aria-live","polite");let o=document.createElement("div");o.className="sl-interrupt-card";let s=document.createElement("div");s.className="sl-interrupt-title",s.textContent=t.title;let r=document.createElement("div");r.className="sl-interrupt-body",r.textContent=t.body,o.append(s,r);let a=document.createElement("div");a.className="sl-interrupt-actions";let l=document.createElement("button");l.type="button",l.className="sl-interrupt-act";let c=document.createElement("span");c.className="sl-interrupt-act-icon",c.setAttribute("aria-hidden","true"),c.textContent="\u21BB";let h=document.createElement("span");return h.textContent=t.action,l.append(c,h),l.addEventListener("click",async()=>{n.classList.add("is-reloading"),l.disabled=!0;try{await e()}catch{}finally{n.isConnected&&(n.classList.remove("is-reloading"),l.disabled=!1)}}),a.appendChild(l),o.appendChild(a),n.appendChild(o),n}function as(i,e){return`<div class="sl-a11yhead"><span class="sl-a11yhead-t">${C(i)}</span><button type="button" class="sl-a11yclose" data-a11y-close aria-label="${D(e)}"><svg viewBox="0 0 24 24" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function ls(i){return i.map(e=>{let t=`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${C(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"`+(e.disabled?' disabled aria-disabled="true"':"")+`><span class="sl-a11yrow-i" aria-hidden="true">${e.iconHtml}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${C(e.label)}</span></span>`+(e.count?`<span class="sl-a11yrow-c">${C(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>';return e.note?`<div class="sl-a11yrow-w">${t}${St({id:`sl-info-${D(e.key.replace(/[^A-Za-z0-9]+/g,"-"))}`,label:e.note,text:C(e.note)})}</div>`:t}).join("")}function St(i){return`<span class="sl-info"${i.wrapRef?` data-ref="${D(i.wrapRef)}"`:""}><button type="button" class="sl-info-btn" data-sl-info aria-label="${D(i.label)}" aria-describedby="${D(i.id)}" aria-expanded="false"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v5"/><path d="M12 8h.01"/></svg></button><span class="sl-info-pop" role="tooltip" id="${D(i.id)}"${i.ref?` data-ref="${D(i.ref)}"`:""}>${i.text}</span></span>`}var Mi=require("@seatlayer/core/core/color");function He(i){if(!i)return null;let e=i.trim().toLowerCase();if(e==="white")return{r:255,g:255,b:255};if(e==="black")return{r:0,g:0,b:0};let t=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(e)?.[1];if(t){let o=t.length<=4?[...t].map(s=>`${s}${s}`).join(""):t;return{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16)}}let n=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/i.exec(e);return n?{r:Math.max(0,Math.min(255,Number(n[1]))),g:Math.max(0,Math.min(255,Number(n[2]))),b:Math.max(0,Math.min(255,Number(n[3])))}:null}function Pi(i){return(0,Mi.relativeLuminance255)([i.r,i.g,i.b])}function xe(i,e){let t=He(i),n=He(e);if(!t||!n)return null;let o=Math.max(Pi(t),Pi(n)),s=Math.min(Pi(t),Pi(n));return(o+.05)/(s+.05)}function tt(i,e="#172033",t="#eef1f8"){return(xe(e,i)??0)>=(xe(t,i)??0)?e:t}function gc(i){return(0,Mi.rgb255ToHex)(i.r,i.g,i.b)}function In(i,e,t){let n=He(i),o=He(e);if(!n||!o)return null;let s=Math.max(0,Math.min(1,t));return gc({r:n.r*s+o.r*(1-s),g:n.g*s+o.g*(1-s),b:n.b*s+o.b*(1-s)})}var Li="#d8a425",bc=.18;function cs(i,e){let t=In(Li,e,bc)??e;if((xe(Li,t)??0)>=4.5)return Li;for(let n=.15;n<=1;n+=.05){let o=In(Li,i,1-n);if(o&&(xe(o,t)??0)>=4.5)return o}return tt(t)}function ds(i,e,t,n){if((xe(i,t)??4.5)>=4.5&&(xe(i,n)??4.5)>=4.5)return i;if(!He(i)||!He(e))return e;for(let o=.15;o<=1;o+=.05){let s=In(i,e,1-o);if(s&&(xe(s,t)??0)>=4.5&&(xe(s,n)??0)>=4.5)return s}return e}function ps(i){return{"--sl-chrome":i?"#d6dce6":"#556278","--sl-chrome-line":i?"rgba(23,32,51,.55)":"rgba(233,238,247,.55)"}}var hs=["--sl-bg","--sl-surface","--sl-text","--sl-muted","--sl-line","--sl-accent-text","--sl-warn-text","--sl-chrome","--sl-chrome-line"];function us(i,e){let t=e??i["--sl-bg"],n=He(t)?tt(t)==="#172033":!1,o=He(i["--sl-bg"])?tt(i["--sl-bg"])==="#172033":!1;if(n===o)return null;let s=n?"#ffffff":"#1a2234",r=tt(t),a=i["--sl-accent"];return{"--sl-bg":t,"--sl-surface":s,"--sl-text":r,"--sl-muted":n?"#667085":"#a5aec2","--sl-line":n?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)","--sl-accent-text":ds(a,r,t,s),...ps(n),"--sl-warn-text":cs(r,s)}}var ms={light:{background:"#ffffff",surface:"#f6f7fb",text:"#172033",muted:"#667085",line:"rgba(23,32,51,.16)",map:"#e9edf4"},dark:{background:"#0f1522",surface:"#1a2234",text:"#eef1f8",muted:"#a5aec2",line:"rgba(165,174,194,.24)",map:"#0f1522"}};function yc(){try{return window.matchMedia?.("(prefers-color-scheme: dark)").matches===!0}catch{return!1}}function Zt(i){if(i)return i==="auto"?yc()?"dark":"light":i}function kt(i,e=i?.mode){if(i?.map)return i.map;let t=Zt(e);return t?{background:ms[t].map}:null}function Hi(i){let e;try{e=window.matchMedia?.("(prefers-color-scheme: dark)")}catch{return()=>{}}if(!e)return()=>{};let t=n=>i(n.matches);return typeof e.addEventListener=="function"?e.addEventListener("change",t):e.addListener?.(t),()=>{typeof e.removeEventListener=="function"?e.removeEventListener("change",t):e.removeListener?.(t)}}function Tt(i,e,t){let n=t?ms[t]:null,o=e?.background??n?.background??i?.background??"#0f1522",s=He(o)?tt(o)==="#172033":!1,r=e?.surface??n?.surface??(s?"#ffffff":"#1a2234"),a=e?.accent??i?.accent??"#f4b740",l=i?.accentInk,c=e?.accentInk??(l&&(xe(l,a)??4.5)>=4.5?l:tt(a,"#1a1200","#ffffff")),h=n?void 0:i?.textColor,d=e?.text??n?.text??(h&&(xe(h,o)??4.5)>=4.5&&(xe(h,r)??4.5)>=4.5?h:tt(o));return{"--sl-accent":a,"--sl-accent-ink":c,"--sl-accent-text":ds(a,d,o,r),"--sl-warn-text":cs(d,r),"--sl-bg":o,"--sl-surface":r,"--sl-text":d,"--sl-muted":e?.muted??n?.muted??(s?"#667085":"#a5aec2"),"--sl-line":e?.line??n?.line??(s?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)"),...ps(s),"--sl-scrim-ink":s?"rgba(16,22,36,1)":"rgba(4,7,13,1)","--sl-font":e?.fontFamily??i?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${e?.radius??14}px`}}function vc(){return`<svg class="sl-boot-venue" viewBox="0 0 200 140" preserveAspectRatio="xMidYMid meet" aria-hidden="true" focusable="false"><g class="sl-boot-shells">${["M20 92a80 52 0 0 1 160 0v14a94 62 0 0 0-160 0z","M32 74a68 42 0 0 1 136 0v12a80 50 0 0 0-136 0z","M46 58a54 32 0 0 1 108 0v10a64 38 0 0 0-108 0z"].map(e=>`<path d="${e}" />`).join("")}</g><rect class="sl-boot-stage" x="62" y="16" width="76" height="16" rx="4" /></svg>`}function fs(i,e,t){let n=document.createElement("div");n.className="sl-picker",n.tabIndex=-1,n.lang=(0,Et.getLocale)(),n.dir=(0,Et.localeDirection)(),i.appendChild(n),Object.entries(Tt(void 0,t)).forEach(([s,r])=>n.style.setProperty(s,r)),n.innerHTML=`
|
|
42
42
|
<div class="sl-head">
|
|
43
43
|
<div class="sl-logo" data-ref="logo"></div>
|
|
44
44
|
<div class="sl-head-info" data-ref="headInfo">
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
</div>
|
|
74
74
|
<div class="sl-boot" data-ref="boot">
|
|
75
75
|
<div class="sl-boot-bar" aria-hidden="true"></div>
|
|
76
|
-
${
|
|
76
|
+
${vc()}
|
|
77
77
|
<span class="sl-boot-say" role="status" aria-live="polite" data-sl-t="picker.loadingSeatMap">${e("picker.loadingSeatMap","Loading seat map\u2026")}</span>
|
|
78
78
|
</div>
|
|
79
79
|
<div class="sl-toast" data-ref="toast" role="status" aria-live="polite"></div>
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
<button type="button" class="sl-cta" data-ref="cta" disabled></button>
|
|
100
100
|
</div>
|
|
101
101
|
</div>
|
|
102
|
-
</div>`;let o={};return n.querySelectorAll("[data-ref]").forEach(s=>{o[s.dataset.ref]=s}),{root:n,mapHost:o.map,els:o}}function
|
|
102
|
+
</div>`;let o={};return n.querySelectorAll("[data-ref]").forEach(s=>{o[s.dataset.ref]=s}),{root:n,mapHost:o.map,els:o}}function gs(i){let e=(t,n)=>{for(let o of i.querySelectorAll(`[${t}]`)){let s=o.getAttribute(t);if(!s)continue;let r=(0,Et.t)(s);r!==s&&n(o,r)}};e("data-sl-t",(t,n)=>{t.textContent=n}),e("data-sl-a",(t,n)=>{t.setAttribute("aria-label",n)}),e("data-sl-ti",(t,n)=>{t.setAttribute("title",n)})}function Ri(i,e){let t=(0,oe.resolveLocale)(i),n=oe.TRANSLATED_LOCALES.includes(t)?t:"en";return e&&(0,oe.setStringOverrides)(e),{locale:n,direction:(0,oe.localeDirection)(n),ready:(0,oe.loadLocale)(i)}}function Ii(i,e,t){i.lang=e.locale,i.dir=e.direction,e.ready.then(t)}function bs(i,e){if(!i)return null;let t=(e.languages??[]).map(o=>(0,oe.resolveLocale)(o)).filter((o,s,r)=>r.indexOf(o)===s);if(t.length<2)return null;let n=document.createElement("select");n.className="sl-langsel",n.setAttribute("aria-label",e.label);for(let o of t){let s=document.createElement("option");s.value=o,s.textContent=oe.LOCALE_NAMES[o]??o,s.selected=o===(0,oe.getLocale)(),n.appendChild(s)}return n.addEventListener("change",()=>e.onChange(n.value)),i.appendChild(n),n}function ys(i,e){e.root.lang=i,e.root.dir=(0,oe.localeDirection)(i),gs(e.root);for(let n of e.painters)try{n()}catch{}e.refreshMapCopy();let t=e.languageSelect;t&&t.value!==i&&(t.value=i)}var se=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}},wc=new Set(["buyer_access_expired"]),xc=new Set(["paused","provider_failed","channel_denied","sales_not_open"]);function Sc(i,e){switch(e){case"buyer_access_invalid":return"invalid";case"buyer_access_revoked":return"revoked";case"buyer_access_origin_mismatch":return"origin_mismatch";case"buyer_access_event_mismatch":return"event_mismatch";case"buyer_access_group_mismatch":return"group_mismatch";case"buyer_access_mode_mismatch":return"mode_mismatch";case"buyer_access_environment_mismatch":return"environment_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";case"audience_not_public":return"audience_not_public";case"sales_not_open":return"sales_not_open";case"origin_not_allowed":return"origin_not_allowed";default:break}return i===401?"invalid":null}function kc(i,e){return i===401&&!!e&&wc.has(e)}var Tc=3e4,de,pe,At,Pt,Qt,Ve,Re,Lt,Jt,ei,ti,it,he,On,Oi,Ct,ue=class{constructor(e){M(this,he);M(this,de,null);M(this,pe,0);M(this,At,null);M(this,Pt);M(this,Qt);M(this,Ve,null);M(this,Re,null);M(this,Lt,null);M(this,Jt);M(this,ei);M(this,ti,!1);M(this,it);if(k(this,Pt,e.provider),k(this,Qt,e.skewMs??Tc),k(this,Jt,e.onExpired),k(this,ei,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;x(this,he,On).call(this,t)}k(this,ti,!!m(this,Pt)||!!m(this,de))}get configured(){return m(this,ti)}onRenewed(e){k(this,it,e)}get unavailable(){return m(this,Re)}get hasToken(){return!!m(this,de)&&(m(this,pe)===0||m(this,pe)>Date.now())}get expiresAt(){return m(this,pe)}async authorization(e="initial"){if(!this.configured)return null;if(m(this,Re))throw new se(m(this,Re));let t=Date.now();if(!m(this,de)||m(this,pe)>0&&m(this,pe)-m(this,Qt)<=t){let o=!!m(this,de)&&m(this,pe)>0&&m(this,pe)<=t,s=m(this,de)?o?"expired":"expiring":e,r=await x(this,he,Oi).call(this,s);if(!r)throw new se(m(this,Re)??m(this,Lt)??x(this,he,Ct).call(this,"provider_failed"));return`Bearer ${r}`}return`Bearer ${m(this,de)}`}async handleFailure(e,t){var o;if(!this.configured)return!1;if(kc(e,t)){k(this,de,null),k(this,pe,0);let s=await x(this,he,Oi).call(this,"unauthorized",t);return(o=m(this,Jt))==null||o.call(this,{reason:"unauthorized",code:t,refreshed:!!s}),!!s}let n=Sc(e,t);return n&&x(this,he,Ct).call(this,n,t,e),!1}async refresh(e="manual"){return k(this,Re,null),k(this,Lt,null),k(this,de,null),k(this,pe,0),!!await x(this,he,Oi).call(this,e)}clear(){k(this,de,null),k(this,At,null),k(this,pe,0),k(this,Ve,null),k(this,it,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};de=new WeakMap,pe=new WeakMap,At=new WeakMap,Pt=new WeakMap,Qt=new WeakMap,Ve=new WeakMap,Re=new WeakMap,Lt=new WeakMap,Jt=new WeakMap,ei=new WeakMap,ti=new WeakMap,it=new WeakMap,he=new WeakSet,On=function(e){return!e||typeof e.token!="string"||!e.token?null:(k(this,At,e.token),k(this,de,e.token),k(this,pe,typeof e.expiresAt=="number"?e.expiresAt:0),m(this,de))},Oi=function(e,t){if(m(this,Ve))return m(this,Ve);let n=m(this,Pt);if(!n)return x(this,he,Ct).call(this,"no_token",t),Promise.resolve(null);let o=m(this,At),s=(async()=>{try{let r=await n({reason:e}),a=x(this,he,On).call(this,r);if(!a)return x(this,he,Ct).call(this,"provider_failed",t),null;if(o&&o!==a&&m(this,it))try{await m(this,it).call(this,{previousToken:o,token:a,reason:e})}catch{}return a}catch{return x(this,he,Ct).call(this,"provider_failed",t),null}finally{k(this,Ve,null)}})();return k(this,Ve,s),s},Ct=function(e,t,n){var s;let o={reason:e,code:t,status:n,retryable:e==="paused"||e==="channel_denied"||e==="sales_not_open"};return k(this,Lt,o),xc.has(e)||(k(this,Re,o),k(this,de,null),k(this,pe,0)),(s=m(this,ei))==null||s.call(this,o),o};function Mt(i,e={}){return!i.buyerAccessTokenProvider&&!i.buyerAccessToken?null:new ue({provider:i.buyerAccessTokenProvider,token:i.buyerAccessToken,...e})}var Ec=3e4;function Cc(i){if(!i||typeof i!="object"||Array.isArray(i))return!1;let e=i;return typeof e.token=="string"&&e.token.startsWith("bse_")&&typeof e.expiresAt=="number"&&Number.isFinite(e.expiresAt)&&e.expiresAt>Date.now()&&!!e.event&&typeof e.event=="object"&&!!e.doc&&typeof e.doc=="object"&&!!e.objects&&typeof e.objects=="object"&&!Array.isArray(e.objects)&&!!e.objects.seats&&typeof e.objects.seats=="object"}var _n=class{constructor(e,t,n){this.base=e;this.event=t;this.publicKey=n;this.value=null;this.inflight=null}async load(e=!1){if(e&&(this.value=null),this.value&&this.value.expiresAt-Ec>Date.now())return this.value;if(this.inflight)return this.inflight;let t=(async()=>{let n=await fetch(`${this.base}/pub/events/${encodeURIComponent(this.event)}/bootstrap`,{method:"POST",body:JSON.stringify({publicKey:this.publicKey}),credentials:"omit"}),o=await n.json().catch(()=>null);if(!n.ok){let s=n.status===429?wi(n.headers.get("Retry-After"),o?.retryAfterSeconds):void 0;throw new j(n.status,o?.error??`request_failed_${n.status}`,o?.code??o?.error,void 0,void 0,s)}if(!Cc(o))throw new j(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=o,o})();this.inflight=t;try{return await t}finally{this.inflight===t&&(this.inflight=null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",n=await this.load(t);return{token:n.token,expiresAt:n.expiresAt}}},Nn=class extends Fe{constructor(t,n,o,s,r){super(t,{...r,access:s});this.event=n;this.loader=o;this.bootstrapAccess=s;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1}assertEvent(t){if(t!==this.event)throw new j(404,"not_found","not_found")}async bundle(t){return this.assertEvent(t),await this.bootstrapAccess.authorization("initial"),this.loader.load()}async chart(t){if(this.assertEvent(t),this.initialChartDelivered)return super.chart(t);let n=await this.bundle(t);return this.initialChartDelivered=!0,{event:n.event,doc:n.doc,chartDelivery:n.chartDelivery}}async objects(t){if(this.assertEvent(t),this.initialObjectsDelivered)return super.objects(t);let n=await this.bundle(t);return this.initialObjectsDelivered=!0,n.objects}};function _i(i){let e=new _n(i.base,i.event,i.publicKey),t=new ue({provider:({reason:n})=>e.token(n),...i.accessHooks});return{access:t,api:new Nn(i.base,i.event,e,t,i.apiOptions??{})}}var ee=require("@seatlayer/core");var J={enter:260,exit:180,spring:320,flight:500,stagger:30,crossfade:120,collapse:150,rung:200,reducedFade:120,easeEnter:"cubic-bezier(.2,.8,.2,1)",easeExit:"cubic-bezier(.4,0,1,1)",easeSpring:"cubic-bezier(.34,1.56,.64,1)"};var Ac=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${J.enter}ms;--sl-dur-exit:${J.exit}ms;--sl-dur-spring:${J.spring}ms;--sl-dur-flight:${J.flight}ms;--sl-dur-stagger:${J.stagger}ms;--sl-dur-xfade:${J.crossfade}ms;--sl-dur-collapse:${J.collapse}ms;--sl-dur-rung:${J.rung}ms;--sl-ease-enter:${J.easeEnter};--sl-ease-exit:${J.easeExit};--sl-ease-spring:${J.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,Pc=`@media (prefers-reduced-motion:reduce){.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:0ms;--sl-dur-exit:0ms;--sl-dur-spring:0ms;--sl-dur-flight:0ms;--sl-dur-stagger:0ms;--sl-dur-collapse:0ms;--sl-dur-rung:0ms;--sl-dur-xfade:${J.reducedFade}ms}.sl-mo-in,.sl-mo-out,.sl-mo-slide-up,.sl-mo-slide-down,.sl-mo-spring,.sl-mo-rise,.sl-mo-zoom,.sl-mo-scrim,.sl-mo-stagger > *{animation-name:slMoFade;animation-duration:${J.reducedFade}ms;animation-delay:0ms}.sl-mo-hint,.sl-mo-rotate-in,.sl-mo-fly,.sl-mo-collapse{animation:none}.sl-confirm-add-invite,.sl-confirm-add-invite::after{animation:none}.sl-mo-indicator{transition:none}}`,vs=Ac+`
|
|
103
103
|
/* Anchored open/close. The translate is 8px TOWARD the anchor, which is what
|
|
104
104
|
makes the card look attached to the seat rather than dropped on the map. */
|
|
105
105
|
.sl-mo-in{transform-origin:var(--sl-mo-ox) var(--sl-mo-oy);
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
@keyframes slMoZoom{from{opacity:0;transform:scale(1.02)}to{opacity:1;transform:none}}
|
|
167
167
|
.sl-mo-rotate-in{animation:slMoSpin var(--sl-dur-spring) var(--sl-ease-spring) 1 both}
|
|
168
168
|
@keyframes slMoSpin{from{opacity:0;transform:rotate(-140deg) scale(.8)}to{opacity:1;transform:none}}
|
|
169
|
-
`+Rc;function Di(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function Bn(i,e){if(!e){i.style.removeProperty("--sl-mo-ox"),i.style.removeProperty("--sl-mo-oy");return}Bi(i,e,i.getBoundingClientRect())}function Bi(i,e,t){let n=t.width||1,o=t.height||1,s=r=>Math.max(0,Math.min(100,r));i.style.setProperty("--sl-mo-ox",`${s((e.x-t.left)/n*100).toFixed(1)}%`),i.style.setProperty("--sl-mo-oy",`${s((e.y-t.top)/o*100).toFixed(1)}%`)}function Ts(i,e,t){let n=i.getBoundingClientRect(),o=t.getBoundingClientRect();Bi(i,e,{left:n.left-o.left,top:n.top-o.top,width:n.width,height:n.height})}function Es(i,e){i.classList.remove("sl-mo-out"),e!==void 0&&Bn(i,e),i.classList.remove("sl-mo-in"),i.offsetWidth,i.classList.add("sl-mo-in")}function Cs(i){i.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(i.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function Fi(i,e,t={className:"sl-mo-out",duration:Q.exit}){let n=()=>{o||(o=!0,!(typeof window>"u")&&(clearTimeout(s),i.removeEventListener("animationend",n),e?e():i.remove()))},o=!1;i.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),i.classList.add(t.className),i.addEventListener("animationend",n);let s=setTimeout(n,Di()?0:t.duration+60)}var Dh={className:"sl-mo-slide-down",duration:Q.exit};function As(i){if(Di())return i.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=i.label??"",e.style.left=`${i.from.x}px`,e.style.top=`${i.from.y}px`,e.style.background=i.color??"var(--sl-accent,#6e7bff)",e.style.color=i.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(i.to.x-i.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(i.to.y-i.from.y)}px`),document.body.appendChild(e);let t=!1,n=()=>{t||(t=!0,window.clearTimeout(o),e.remove(),i.onArrive?.())};e.addEventListener("animationend",n);let o=window.setTimeout(n,Q.flight+80);return e}var U=i=>String(i??"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e]);function Ht(i,e){let t=0;for(let n of i.get(e)?.values()??[])t+=n;return t}function Ps(i){let e=[];for(let[t,n]of i)for(let[o,s]of n)s>0&&e.push({areaId:t,tierId:o,qty:s});return e}function Ms(i){let e=new Map;for(let t of i.keys())e.set(t,Ht(i,t));return e}function ni(i,e,t,n){let o=i.get(e)??new Map;n>0?o.set(t,n):o.delete(t),o.size?i.set(e,o):i.delete(e)}function Ls(i){let e=new Map;for(let t of i)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function Ve(i,e){let t=Ls(e),n=0;for(let o of i.keys())n+=Math.max(0,Ht(i,o)-(t.get(o)??0));return n}function Hs(i,e,t){let n=Ls(t),o=0;for(let s of e){let r=i.gaQty.get(s.id);if(!r)continue;let a=n.get(s.id)??0;for(let[l,c]of r){let h=Math.max(0,c-a);a=Math.max(0,a-c),o+=h*i.paidPrice(s.categoryKey,l,Ic(s,l),s.id)}}return o}function Ic(i,e){return e?i.tiers?.find(t=>t.id===e)?.price??i.price:i.price}function Rs(i){let e=[],t=new Map;for(let n of i){if(n.objectType!=="ga"||!n.objectId){e.push({...n,labels:[n.label]});continue}let o=`${n.objectId}\0${n.tierId??""}`,s=t.get(o);if(s){s.quantity=(s.quantity??0)+(n.quantity??1),s.labels.push(n.label);continue}let r={...n,quantity:n.quantity??1,labels:[n.label]};t.set(o,r),e.push(r)}return e}function Is(i,e,t){let n=new Set(t);for(let o of e)o.objectType==="ga"&&o.objectId&&n.has(o.label)&&ni(i,o.objectId,o.tierId??null,0)}function Vn(i,e){if(i.objectType!=="ga")return i.label;let t=e.find(n=>n.id===i.objectId);return t?.displayLabel??t?.label??i.label}function Oc(i){let e=new Map;for(let t of i){if(t.objectType!=="ga"||!t.objectId)continue;let n=`${t.objectId}\0${t.tierId??""}`;e.set(n,(e.get(n)??0)+(t.quantity??1))}return e}function Vi(i){let e=i.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:i.displayType??(0,J.t)("picker.generalAdmission"),price:i.price}]}function Os(i,e){let t=i.totalTicketCount()-Ht(i.gaQty,e.id);return Math.max(0,Math.min(e.available,i.maxTickets-t))}function zn(i,e,t,n){if(Te(i,!1),i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let o=Vi(e),s=i.gaQty.get(e.id),r=Ht(i.gaQty,e.id)>0,a=Os(i,e);if(a<=0&&!r){i.toast(e.available>0?(0,J.t)("picker.maxTicketsForOrder",{count:i.maxTickets}):i.tf("picker.soldOutTitle","Sold out"),"warning");return}if(i.onGAPromptHook){let u={};for(let[f,b]of s??[])u[f??""]=b;if(i.onGAPromptHook({area:e,selected:u,min:0,max:a,tiers:o,confirm:f=>{Bc(i,e,o,f,a)},cancel:()=>Te(i)})===!0)return}let l=new Map;for(let u of o)l.set(u.id,s?.get(u.id)??0);!r&&a>0&&l.set(o[0].id,1);let c={area:e,tiers:o,draft:l,max:a,reopened:r},h=i.root?.dataset.layout==="narrow",d=document.createElement("div");d.className=h?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",d.innerHTML=_c(i,c,h),i.root?.appendChild(d),i.gaPromptEl=d,i.gaPromptReturnFocus=n??document.activeElement,h||Fc(i,d,t),i.reducedMotion()&&(d.dataset.motion="reduced"),Ns(i,c),Nc(i,d,c),requestAnimationFrame(()=>d.querySelector('[data-ga-step="1"]')?.focus())}function _c(i,e,t){let{area:n,tiers:o}=e,s=o.length>1,r=n.displayLabel??n.label,a=o.map(l=>`<div class="sl-ga-prompt-row" data-ga-tier="${U(l.id??"")}"><div class="sl-ga-prompt-label"><span>${U(s?l.label:i.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(s?`<small>${U(i.money(i.paidPrice(n.categoryKey,l.id,l.price,n.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${U(s?l.label:r)}"><button type="button" data-ga-step="-1" aria-label="${U(i.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${U(i.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="${U((0,J.t)("picker.gaChooseForArea",{area:r}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${U(n.displayType??i.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${U(r)}</h2><p class="sl-ga-prompt-sub" data-ga-sub></p><button type="button" class="sl-ga-prompt-close" data-ga-cancel aria-label="${U((0,J.t)("common.close"))}">\xD7</button></div><div class="sl-ga-prompt-body">${a}`+(o.length>1?`<div class="sl-ga-prompt-total"><span>${U(i.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>${U(i.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${U((0,J.t)("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function $n(i){let e=0;for(let t of i.draft.values())e+=t;return e}function _s(i,e){let t=0;for(let n of e.tiers)t+=(e.draft.get(n.id)??0)*i.paidPrice(e.area.categoryKey,n.id,n.price,e.area.id);return t}function Ns(i,e){let t=i.gaPromptEl;if(!t)return;let n=$n(e),o=_s(i,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let h=c.dataset.gaTier?c.dataset.gaTier:null,d=e.draft.get(h)??0,u=c.querySelector("[data-ga-qty]");u&&(u.value=String(d)),c.querySelectorAll("[data-ga-step]").forEach(p=>{p.disabled=Number(p.dataset.gaStep)<0?d<=0:n>=e.max})});let s=t.querySelector("[data-ga-sub]");s&&(s.textContent=`${i.money(i.paidPrice(e.area.categoryKey,e.tiers[0].id,e.tiers[0].price,e.area.id))} \xB7 ${(0,J.tCount)("picker.leftCount",e.area.available)}`);let r=t.querySelector("[data-ga-total]");r&&(r.textContent=i.money(o));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=n>=e.max&&e.max>0?e.area.available<=e.max?(0,J.tCount)("picker.leftCount",e.area.available):(0,J.t)("picker.maxTicketsForOrder",{count:i.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");l&&(l.textContent=e.reopened?(0,J.tCount)("picker.gaUpdate",n,{count:n}):(0,J.tCount)("picker.gaAdd",n,{count:n,price:i.money(o)}),l.disabled=n<=0&&!e.reopened)}function Nc(i,e,t){e.querySelectorAll("[data-ga-step]").forEach(n=>{n.addEventListener("click",()=>{let o=n.closest("[data-ga-tier]");if(!o)return;let s=o.dataset.gaTier?o.dataset.gaTier:null,r=Number(n.dataset.gaStep),a=t.draft.get(s)??0,l=t.max-$n(t);t.draft.set(s,Math.max(0,a+(r>0?Math.min(1,l):-1))),Ns(i,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(n=>n.addEventListener("click",()=>Te(i))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{i.gaQty.delete(t.area.id),Te(i),i.syncTray(),Fn(i,(0,J.t)("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{Dc(i,t)}),e.addEventListener("mousedown",n=>{n.target===e&&Te(i)}),e.addEventListener("keydown",n=>{if(n.key==="Escape"){n.stopPropagation(),Te(i);return}if(n.key!=="Tab")return;let o=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!o.length)return;let s=o[0],r=o[o.length-1];n.shiftKey&&document.activeElement===s?(n.preventDefault(),r.focus()):!n.shiftKey&&document.activeElement===r&&(n.preventDefault(),s.focus())})}function Dc(i,e){let t=$n(e),n=_s(i,e);for(let s of e.tiers)ni(i.gaQty,e.area.id,s.id,e.draft.get(s.id)??0);Te(i),i.syncTray();let o=e.area.displayLabel??e.area.label;t>0?Fn(i,(0,J.tCount)("picker.gaAdded",t,{count:t,area:o,price:i.money(n)})):Fn(i,(0,J.t)("picker.gaRemoved",{area:o}))}function Bc(i,e,t,n,o){if(typeof n=="number")ni(i.gaQty,e.id,t[0].id,Math.max(0,Math.min(o,Math.floor(n))));else{i.gaQty.delete(e.id);let s=o;for(let r of t){let a=Math.max(0,Math.floor(n[r.id??""]??0)),l=Math.min(a,s);s-=l,ni(i.gaQty,e.id,r.id,l)}}i.syncTray()}function Te(i,e=!0){let t=i.gaPromptReturnFocus;i.gaPromptEl&&Fi(i.gaPromptEl),i.gaPromptEl=null,i.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:i.root)?.focus())}function Fc(i,e,t){let n=i.root,o=e.querySelector(".sl-ga-pop");if(!n||!o||!t)return;let s=n.getBoundingClientRect(),r=t.x-s.left,a=t.y-s.top;e.style.setProperty("--sl-ga-anchor-x",`${r}px`),e.style.setProperty("--sl-ga-anchor-y",`${a}px`),requestAnimationFrame(()=>{let l=o.offsetWidth||260,c=o.offsetHeight||220,h=Math.max(8,Math.min(s.width-l-8,r-l/2)),d=a-c-14,u=d>=8?d:Math.min(s.height-c-8,a+14);o.style.left=`${h}px`,o.style.top=`${Math.max(8,u)}px`,o.dataset.side=d>=8?"above":"below",o.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(l-12,r-h))}px`)})}function Fn(i,e){i.srEl&&(i.srEl.textContent=e)}function Ds(i,e,t=[]){let n=[],o=Oc(t);for(let r of e){let a=i.gaQty.get(r.id);if(!a)continue;let l=Vi(r);for(let c of l){let h=(a.get(c.id)??0)-(o.get(`${r.id}\0${c.id??""}`)??0);if(h<=0)continue;let d=i.paidPrice(r.categoryKey,c.id,c.price,r.id);n.push(`<div class="sl-ga" data-ga="${U(r.id)}" data-ga-row-tier="${U(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${U(r.displayLabel??r.label)}</div><div class="sl-ga-sub">${U(l.length>1?c.label:r.displayType??i.tf("picker.generalAdmission","General admission"))} \xB7 ${U(i.money(d))} \xB7 ${U((0,J.tCount)("picker.leftCount",r.available))}</div></div><div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${U(i.tf("picker.fewer","Fewer"))}">\u2212</button><span>${h}</span><button type="button" data-d="1" aria-label="${U(i.tf("picker.more","More"))}">+</button></div></div>`)}}let s=e.filter(r=>Ht(i.gaQty,r.id)<=0&&!t.some(a=>a.objectId===r.id));return s.length&&n.push(`<div class="sl-ga-areas" data-ga-areas><button type="button" class="sl-ga-areas-toggle" data-ga-areas-toggle aria-expanded="${i.gaAreasExpanded}"><span>${U(i.tf("picker.gaAreasHeading","Areas"))}</span><small>${s.length}</small></button>`+(i.gaAreasExpanded?`<div class="sl-ga-areas-list">${s.map(r=>`<button type="button" class="sl-ga-area-open" data-ga-open="${U(r.id)}"${r.available<=0?" disabled":""}><span class="name">${U(r.displayLabel??r.label)}<small>${U(r.displayType??i.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${U(i.money(i.paidPrice(r.categoryKey,null,r.price,r.id)))} \xB7 ${U(r.available>0?(0,J.tCount)("picker.leftCount",r.available):i.tf("picker.soldOutTitle","Sold out"))}</span></button>`).join("")}</div>`:"")+"</div>"),n.join("")}function Bs(i,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(n=>{n.addEventListener("click",()=>{let o=n.closest(".sl-ga");if(!o?.dataset.ga)return;let s=t.find(c=>c.id===o.dataset.ga);if(!s)return;let r=o.dataset.gaRowTier?o.dataset.gaRowTier:null,a=Number(n.dataset.d),l=i.gaQty.get(s.id)?.get(r)??0;if(a>0&&Os(i,s)-Ht(i.gaQty,s.id)<=0){i.toast((0,J.t)("picker.maxTicketsForOrder",{count:i.maxTickets}),"warning");return}ni(i.gaQty,s.id,r,Math.max(0,l+a)),i.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{i.gaAreasExpanded=!i.gaAreasExpanded,i.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(n=>{n.addEventListener("click",()=>{let o=t.find(s=>s.id===n.dataset.gaOpen);o&&zn(i,o,null,n)})})}var zi='<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 Vc=/^[a-zA-Z0-9._-]+$/;function jn(i){let e;try{e=new URL(i,"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 n=decodeURIComponent(t[1]),o=decodeURIComponent(t[2]);return!n||!Vc.test(o)?null:{eventKey:n,asset:o}}catch{return null}}function zc(i){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(i,"https://seatlayer.invalid").pathname)}catch{return!1}}var Rt=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=jn(e);if(!t)return Promise.resolve(zc(e)||!wt(e)?null:e);if(t.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);let n=this.pending.get(e);if(n)return n;let o=this.load(this.eventKey,t.asset).then(s=>{let r=URL.createObjectURL(s);return this.disposed?(URL.revokeObjectURL(r),null):(this.created.add(r),r)}).catch(s=>{throw this.pending.delete(e),s});return this.pending.set(e,o),o}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};var it=require("@seatlayer/core"),qi=require("@seatlayer/core/view3d/crossfade/panorama");var Fs=`
|
|
169
|
+
`+Pc;function Ni(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function Dn(i,e){if(!e){i.style.removeProperty("--sl-mo-ox"),i.style.removeProperty("--sl-mo-oy");return}Di(i,e,i.getBoundingClientRect())}function Di(i,e,t){let n=t.width||1,o=t.height||1,s=r=>Math.max(0,Math.min(100,r));i.style.setProperty("--sl-mo-ox",`${s((e.x-t.left)/n*100).toFixed(1)}%`),i.style.setProperty("--sl-mo-oy",`${s((e.y-t.top)/o*100).toFixed(1)}%`)}function ws(i,e,t){let n=i.getBoundingClientRect(),o=t.getBoundingClientRect();Di(i,e,{left:n.left-o.left,top:n.top-o.top,width:n.width,height:n.height})}function xs(i,e){i.classList.remove("sl-mo-out"),e!==void 0&&Dn(i,e),i.classList.remove("sl-mo-in"),i.offsetWidth,i.classList.add("sl-mo-in")}function Ss(i){i.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(i.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function Bi(i,e,t={className:"sl-mo-out",duration:J.exit}){let n=()=>{o||(o=!0,!(typeof window>"u")&&(clearTimeout(s),i.removeEventListener("animationend",n),e?e():i.remove()))},o=!1;i.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),i.classList.add(t.className),i.addEventListener("animationend",n);let s=setTimeout(n,Ni()?0:t.duration+60)}var Ih={className:"sl-mo-slide-down",duration:J.exit};function ks(i){if(Ni())return i.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=i.label??"",e.style.left=`${i.from.x}px`,e.style.top=`${i.from.y}px`,e.style.background=i.color??"var(--sl-accent,#6e7bff)",e.style.color=i.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(i.to.x-i.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(i.to.y-i.from.y)}px`),document.body.appendChild(e);let t=!1,n=()=>{t||(t=!0,window.clearTimeout(o),e.remove(),i.onArrive?.())};e.addEventListener("animationend",n);let o=window.setTimeout(n,J.flight+80);return e}var G=i=>String(i??"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e]);function Ht(i,e){let t=0;for(let n of i.get(e)?.values()??[])t+=n;return t}function Ts(i){let e=[];for(let[t,n]of i)for(let[o,s]of n)s>0&&e.push({areaId:t,tierId:o,qty:s});return e}function Es(i){let e=new Map;for(let t of i.keys())e.set(t,Ht(i,t));return e}function ii(i,e,t,n){let o=i.get(e)??new Map;n>0?o.set(t,n):o.delete(t),o.size?i.set(e,o):i.delete(e)}function Cs(i){let e=new Map;for(let t of i)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function ze(i,e){let t=Cs(e),n=0;for(let o of i.keys())n+=Math.max(0,Ht(i,o)-(t.get(o)??0));return n}function As(i,e,t){let n=Cs(t),o=0;for(let s of e){let r=i.gaQty.get(s.id);if(!r)continue;let a=n.get(s.id)??0;for(let[l,c]of r){let h=Math.max(0,c-a);a=Math.max(0,a-c),o+=h*i.paidPrice(s.categoryKey,l,Lc(s,l),s.id)}}return o}function Lc(i,e){return e?i.tiers?.find(t=>t.id===e)?.price??i.price:i.price}function Ps(i){let e=[],t=new Map;for(let n of i){if(n.objectType!=="ga"||!n.objectId){e.push({...n,labels:[n.label]});continue}let o=`${n.objectId}\0${n.tierId??""}`,s=t.get(o);if(s){s.quantity=(s.quantity??0)+(n.quantity??1),s.labels.push(n.label);continue}let r={...n,quantity:n.quantity??1,labels:[n.label]};t.set(o,r),e.push(r)}return e}function Ls(i,e,t){let n=new Set(t);for(let o of e)o.objectType==="ga"&&o.objectId&&n.has(o.label)&&ii(i,o.objectId,o.tierId??null,0)}function Fn(i,e){if(i.objectType!=="ga")return i.label;let t=e.find(n=>n.id===i.objectId);return t?.displayLabel??t?.label??i.label}function Mc(i){let e=new Map;for(let t of i){if(t.objectType!=="ga"||!t.objectId)continue;let n=`${t.objectId}\0${t.tierId??""}`;e.set(n,(e.get(n)??0)+(t.quantity??1))}return e}function Fi(i){let e=i.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:i.displayType??(0,ee.t)("picker.generalAdmission"),price:i.price}]}function Ms(i,e){let t=i.totalTicketCount()-Ht(i.gaQty,e.id);return Math.max(0,Math.min(e.available,i.maxTickets-t))}function Vn(i,e,t,n){if(Ce(i,!1),i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let o=Fi(e),s=i.gaQty.get(e.id),r=Ht(i.gaQty,e.id)>0,a=Ms(i,e);if(a<=0&&!r){i.toast(e.available>0?(0,ee.t)("picker.maxTicketsForOrder",{count:i.maxTickets}):i.tf("picker.soldOutTitle","Sold out"),"warning");return}if(i.onGAPromptHook){let u={};for(let[g,y]of s??[])u[g??""]=y;if(i.onGAPromptHook({area:e,selected:u,min:0,max:a,tiers:o,confirm:g=>{Oc(i,e,o,g,a)},cancel:()=>Ce(i)})===!0)return}let l=new Map;for(let u of o)l.set(u.id,s?.get(u.id)??0);!r&&a>0&&l.set(o[0].id,1);let c={area:e,tiers:o,draft:l,max:a,reopened:r},h=i.root?.dataset.layout==="narrow",d=document.createElement("div");d.className=h?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",d.innerHTML=Hc(i,c,h),i.root?.appendChild(d),i.gaPromptEl=d,i.gaPromptReturnFocus=n??document.activeElement,h||_c(i,d,t),i.reducedMotion()&&(d.dataset.motion="reduced"),Rs(i,c),Rc(i,d,c),requestAnimationFrame(()=>d.querySelector('[data-ga-step="1"]')?.focus())}function Hc(i,e,t){let{area:n,tiers:o}=e,s=o.length>1,r=n.displayLabel??n.label,a=o.map(l=>`<div class="sl-ga-prompt-row" data-ga-tier="${G(l.id??"")}"><div class="sl-ga-prompt-label"><span>${G(s?l.label:i.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(s?`<small>${G(i.money(i.paidPrice(n.categoryKey,l.id,l.price,n.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${G(s?l.label:r)}"><button type="button" data-ga-step="-1" aria-label="${G(i.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${G(i.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="${G((0,ee.t)("picker.gaChooseForArea",{area:r}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${G(n.displayType??i.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${G(r)}</h2><p class="sl-ga-prompt-sub" data-ga-sub></p><button type="button" class="sl-ga-prompt-close" data-ga-cancel aria-label="${G((0,ee.t)("common.close"))}">\xD7</button></div><div class="sl-ga-prompt-body">${a}`+(o.length>1?`<div class="sl-ga-prompt-total"><span>${G(i.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>${G(i.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${G((0,ee.t)("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function zn(i){let e=0;for(let t of i.draft.values())e+=t;return e}function Hs(i,e){let t=0;for(let n of e.tiers)t+=(e.draft.get(n.id)??0)*i.paidPrice(e.area.categoryKey,n.id,n.price,e.area.id);return t}function Rs(i,e){let t=i.gaPromptEl;if(!t)return;let n=zn(e),o=Hs(i,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let h=c.dataset.gaTier?c.dataset.gaTier:null,d=e.draft.get(h)??0,u=c.querySelector("[data-ga-qty]");u&&(u.value=String(d)),c.querySelectorAll("[data-ga-step]").forEach(p=>{p.disabled=Number(p.dataset.gaStep)<0?d<=0:n>=e.max})});let s=t.querySelector("[data-ga-sub]");s&&(s.textContent=`${i.money(i.paidPrice(e.area.categoryKey,e.tiers[0].id,e.tiers[0].price,e.area.id))} \xB7 ${(0,ee.tCount)("picker.leftCount",e.area.available)}`);let r=t.querySelector("[data-ga-total]");r&&(r.textContent=i.money(o));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=n>=e.max&&e.max>0?e.area.available<=e.max?(0,ee.tCount)("picker.leftCount",e.area.available):(0,ee.t)("picker.maxTicketsForOrder",{count:i.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");l&&(l.textContent=e.reopened?(0,ee.tCount)("picker.gaUpdate",n,{count:n}):(0,ee.tCount)("picker.gaAdd",n,{count:n,price:i.money(o)}),l.disabled=n<=0&&!e.reopened)}function Rc(i,e,t){e.querySelectorAll("[data-ga-step]").forEach(n=>{n.addEventListener("click",()=>{let o=n.closest("[data-ga-tier]");if(!o)return;let s=o.dataset.gaTier?o.dataset.gaTier:null,r=Number(n.dataset.gaStep),a=t.draft.get(s)??0,l=t.max-zn(t);t.draft.set(s,Math.max(0,a+(r>0?Math.min(1,l):-1))),Rs(i,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(n=>n.addEventListener("click",()=>Ce(i))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{i.gaQty.delete(t.area.id),Ce(i),i.syncTray(),Bn(i,(0,ee.t)("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{Ic(i,t)}),e.addEventListener("mousedown",n=>{n.target===e&&Ce(i)}),e.addEventListener("keydown",n=>{if(n.key==="Escape"){n.stopPropagation(),Ce(i);return}if(n.key!=="Tab")return;let o=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!o.length)return;let s=o[0],r=o[o.length-1];n.shiftKey&&document.activeElement===s?(n.preventDefault(),r.focus()):!n.shiftKey&&document.activeElement===r&&(n.preventDefault(),s.focus())})}function Ic(i,e){let t=zn(e),n=Hs(i,e);for(let s of e.tiers)ii(i.gaQty,e.area.id,s.id,e.draft.get(s.id)??0);Ce(i),i.syncTray();let o=e.area.displayLabel??e.area.label;t>0?Bn(i,(0,ee.tCount)("picker.gaAdded",t,{count:t,area:o,price:i.money(n)})):Bn(i,(0,ee.t)("picker.gaRemoved",{area:o}))}function Oc(i,e,t,n,o){if(typeof n=="number")ii(i.gaQty,e.id,t[0].id,Math.max(0,Math.min(o,Math.floor(n))));else{i.gaQty.delete(e.id);let s=o;for(let r of t){let a=Math.max(0,Math.floor(n[r.id??""]??0)),l=Math.min(a,s);s-=l,ii(i.gaQty,e.id,r.id,l)}}i.syncTray()}function Ce(i,e=!0){let t=i.gaPromptReturnFocus;i.gaPromptEl&&Bi(i.gaPromptEl),i.gaPromptEl=null,i.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:i.root)?.focus())}function _c(i,e,t){let n=i.root,o=e.querySelector(".sl-ga-pop");if(!n||!o||!t)return;let s=n.getBoundingClientRect(),r=t.x-s.left,a=t.y-s.top;e.style.setProperty("--sl-ga-anchor-x",`${r}px`),e.style.setProperty("--sl-ga-anchor-y",`${a}px`),requestAnimationFrame(()=>{let l=o.offsetWidth||260,c=o.offsetHeight||220,h=Math.max(8,Math.min(s.width-l-8,r-l/2)),d=a-c-14,u=d>=8?d:Math.min(s.height-c-8,a+14);o.style.left=`${h}px`,o.style.top=`${Math.max(8,u)}px`,o.dataset.side=d>=8?"above":"below",o.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(l-12,r-h))}px`)})}function Bn(i,e){i.srEl&&(i.srEl.textContent=e)}function Is(i,e,t=[]){let n=[],o=Mc(t);for(let r of e){let a=i.gaQty.get(r.id);if(!a)continue;let l=Fi(r);for(let c of l){let h=(a.get(c.id)??0)-(o.get(`${r.id}\0${c.id??""}`)??0);if(h<=0)continue;let d=i.paidPrice(r.categoryKey,c.id,c.price,r.id);n.push(`<div class="sl-ga" data-ga="${G(r.id)}" data-ga-row-tier="${G(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${G(r.displayLabel??r.label)}</div><div class="sl-ga-sub">${G(l.length>1?c.label:r.displayType??i.tf("picker.generalAdmission","General admission"))} \xB7 ${G(i.money(d))} \xB7 ${G((0,ee.tCount)("picker.leftCount",r.available))}</div></div><div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${G(i.tf("picker.fewer","Fewer"))}">\u2212</button><span>${h}</span><button type="button" data-d="1" aria-label="${G(i.tf("picker.more","More"))}">+</button></div></div>`)}}let s=e.filter(r=>Ht(i.gaQty,r.id)<=0&&!t.some(a=>a.objectId===r.id));return s.length&&n.push(`<div class="sl-ga-areas" data-ga-areas><button type="button" class="sl-ga-areas-toggle" data-ga-areas-toggle aria-expanded="${i.gaAreasExpanded}"><span>${G(i.tf("picker.gaAreasHeading","Areas"))}</span><small>${s.length}</small></button>`+(i.gaAreasExpanded?`<div class="sl-ga-areas-list">${s.map(r=>`<button type="button" class="sl-ga-area-open" data-ga-open="${G(r.id)}"${r.available<=0?" disabled":""}><span class="name">${G(r.displayLabel??r.label)}<small>${G(r.displayType??i.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${G(i.money(i.paidPrice(r.categoryKey,null,r.price,r.id)))} \xB7 ${G(r.available>0?(0,ee.tCount)("picker.leftCount",r.available):i.tf("picker.soldOutTitle","Sold out"))}</span></button>`).join("")}</div>`:"")+"</div>"),n.join("")}function Os(i,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(n=>{n.addEventListener("click",()=>{let o=n.closest(".sl-ga");if(!o?.dataset.ga)return;let s=t.find(c=>c.id===o.dataset.ga);if(!s)return;let r=o.dataset.gaRowTier?o.dataset.gaRowTier:null,a=Number(n.dataset.d),l=i.gaQty.get(s.id)?.get(r)??0;if(a>0&&Ms(i,s)-Ht(i.gaQty,s.id)<=0){i.toast((0,ee.t)("picker.maxTicketsForOrder",{count:i.maxTickets}),"warning");return}ii(i.gaQty,s.id,r,Math.max(0,l+a)),i.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{i.gaAreasExpanded=!i.gaAreasExpanded,i.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(n=>{n.addEventListener("click",()=>{let o=t.find(s=>s.id===n.dataset.gaOpen);o&&Vn(i,o,null,n)})})}var Vi='<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 Nc=/^[a-zA-Z0-9._-]+$/;function $n(i){let e;try{e=new URL(i,"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 n=decodeURIComponent(t[1]),o=decodeURIComponent(t[2]);return!n||!Nc.test(o)?null:{eventKey:n,asset:o}}catch{return null}}function Dc(i){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(i,"https://seatlayer.invalid").pathname)}catch{return!1}}var Rt=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=$n(e);if(!t)return Promise.resolve(Dc(e)||!wt(e)?null:e);if(t.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);let n=this.pending.get(e);if(n)return n;let o=this.load(this.eventKey,t.asset).then(s=>{let r=URL.createObjectURL(s);return this.disposed?(URL.revokeObjectURL(r),null):(this.created.add(r),r)}).catch(s=>{throw this.pending.delete(e),s});return this.pending.set(e,o),o}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};var nt=require("@seatlayer/core"),Ui=require("@seatlayer/core/view3d/crossfade/panorama");var _s=`
|
|
170
170
|
/* confirm card: a candidate is not in the tray until Select. Map gestures and
|
|
171
171
|
floating chrome pause while the card owns focus, keeping the camera stable. */
|
|
172
172
|
.sl-picker[data-confirming="true"] .sl-map-host>:not(.sl-confirm){pointer-events:none}
|
|
@@ -549,7 +549,7 @@
|
|
|
549
549
|
color:var(--sl-text);font-weight:700;font-size:12px;display:flex;align-items:center;justify-content:center;gap:7px}
|
|
550
550
|
.sl-confirm-view:hover{border-color:var(--sl-muted)}
|
|
551
551
|
.sl-confirm-view svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
|
|
552
|
-
`;var
|
|
552
|
+
`;var Ns=`
|
|
553
553
|
/* Test mode is environment context, not an action. The chip flows in the
|
|
554
554
|
top-left anchor region: the old rotated corner ribbon sat at a negative
|
|
555
555
|
offset and was clipped by the widget root's rounded overflow:hidden (its
|
|
@@ -810,7 +810,7 @@
|
|
|
810
810
|
.sl-pg-switch:hover{border-style:solid;color:var(--sl-text);border-color:var(--sl-accent)}
|
|
811
811
|
@media(prefers-reduced-motion:reduce){.sl-tip{animation:none!important}.sl-tip,.sl-tip-switch,.sl-pg-switch{transition:none!important}}
|
|
812
812
|
@media(max-width:639px){.sl-confirm-group-dates{width:min(340px,calc(100% - 20px))}.sl-confirm-date{min-height:32px}}
|
|
813
|
-
`;var
|
|
813
|
+
`;var Ds=`
|
|
814
814
|
/* 3D venue overlay \u2014 mounts over the (paused) Konva stage inside the map host.
|
|
815
815
|
Carries its own gradient so it paints instantly before the scene builds, and
|
|
816
816
|
cross-fades on enter/exit via a compositor-only opacity transition. Sits below
|
|
@@ -1181,7 +1181,7 @@
|
|
|
1181
1181
|
.sl-view3d-passport-shell{padding:max(10px,env(safe-area-inset-top)) 10px max(10px,env(safe-area-inset-bottom))}
|
|
1182
1182
|
.sl-view3d-passport{width:100%;max-height:100%;padding:14px 14px max(24px,calc(14px + env(safe-area-inset-bottom)));border-radius:15px}
|
|
1183
1183
|
}
|
|
1184
|
-
`;var
|
|
1184
|
+
`;var Bs=`
|
|
1185
1185
|
.sl-notes{display:flex;flex-direction:column;gap:0;margin:0}
|
|
1186
1186
|
/* No radius, no border, no inset: a band is the card's full width or it is a
|
|
1187
1187
|
plate again. The hairline lives on the JOIN, so the first band sits flush
|
|
@@ -1216,7 +1216,126 @@
|
|
|
1216
1216
|
.sl-notes.compact .sl-note{padding:7px 12px 7px 15px}
|
|
1217
1217
|
.sl-notes.compact .sl-note-t b{font-size:11.5px;font-weight:750}
|
|
1218
1218
|
.sl-notes.compact .sl-note-n{font-size:10.5px}
|
|
1219
|
-
`;var
|
|
1219
|
+
`;var Fs=`
|
|
1220
|
+
/* The head is a bare 19.5px strip: the pill's upper half and nothing else. It
|
|
1221
|
+
used to reserve 26px (6px of ground above a 20px pill) and the sheet drew a
|
|
1222
|
+
border above that, so the chrome between the map and the cart was 33px of
|
|
1223
|
+
which 20 was the mark. The whole strip is still the tap and swipe target,
|
|
1224
|
+
and so is the pill: the pointer handlers live on the head, and a press that
|
|
1225
|
+
starts on the pill tracks with them (SeatPicker's sheet wiring). */
|
|
1226
|
+
.sl-sheet-head{display:none;align-items:center;justify-content:center;min-height:0;
|
|
1227
|
+
cursor:pointer;touch-action:none;user-select:none;-webkit-user-select:none;flex:none}
|
|
1228
|
+
/* z-index:3 CLEARS THE FOOTER. .sl-foot is position:relative;z-index:2 and
|
|
1229
|
+
comes later in the DOM, so without this the pill's lower half \u2014 the half the
|
|
1230
|
+
owner asked for \u2014 paints UNDER the footer's own ground and the mark reads as
|
|
1231
|
+
a half-disc sitting on the line. The head has to win that stack, and only
|
|
1232
|
+
the phone sheet has a head to stack. */
|
|
1233
|
+
.sl-picker[data-layout="narrow"] .sl-sheet-head{display:flex;position:relative;z-index:3;
|
|
1234
|
+
border-bottom:1px solid var(--sl-line)}
|
|
1235
|
+
/* \u2026EXCEPT IN mini, where the footer's own border-top is already sitting at
|
|
1236
|
+
exactly this edge. Two hairlines a pixel apart is a 2px line, which is the
|
|
1237
|
+
band the owner asked us to remove. Dropping the WIDTH rather than the colour
|
|
1238
|
+
also keeps the arithmetic honest: the head's content box stays 19.5px, so
|
|
1239
|
+
the pill's centre lands on the footer's line as precisely as it lands on
|
|
1240
|
+
this one. */
|
|
1241
|
+
.sl-picker[data-layout="narrow"][data-sheet="mini"] .sl-sheet-head{border-bottom-width:0}
|
|
1242
|
+
/* A PILL IN THE FLOW, not a box positioned out of it: the head's height is
|
|
1243
|
+
simply this element's outer height (40 - 20.5 = 19.5), which is the only
|
|
1244
|
+
reason the sheet's ceilings in pickerStyles.ts can be derived at all.
|
|
1245
|
+
The negative margin is the straddle \u2014 see the file header for the half-pixel.
|
|
1246
|
+
NO transform HERE: the once-per-session handle hint animates transform
|
|
1247
|
+
(slMoHint) and would overwrite a centring one mid-bounce. */
|
|
1248
|
+
.sl-sheet-toggle{position:relative;margin-bottom:-20.5px;
|
|
1249
|
+
width:40px;height:40px;border-radius:999px;flex:none;display:flex;
|
|
1250
|
+
align-items:center;justify-content:center;color:var(--sl-text);
|
|
1251
|
+
background:var(--sl-bg);
|
|
1252
|
+
border:1px solid var(--sl-line);
|
|
1253
|
+
transition:color .15s,background .15s,border-color .15s}
|
|
1254
|
+
/* The disc's ground is the sheet's ground, so the half that overhangs the line
|
|
1255
|
+
is seamless against whatever it covers \u2014 the footer in mini, the tray's own
|
|
1256
|
+
top padding in peek and open. */
|
|
1257
|
+
.sl-sheet-toggle:hover,.sl-sheet-toggle:focus-visible{border-color:var(--sl-text);
|
|
1258
|
+
background:color-mix(in srgb,var(--sl-text) 7%,var(--sl-bg))}
|
|
1259
|
+
/* 20px of glyph in a 40px disc, at 2.8 \u2014 the mark is the control's whole point
|
|
1260
|
+
and it was 14px at 2.4 in muted ink, which is a hairline chevron on a phone. */
|
|
1261
|
+
.sl-sheet-toggle svg{width:20px;height:20px;stroke:currentColor;stroke-width:2.8;fill:none;
|
|
1262
|
+
stroke-linecap:round;stroke-linejoin:round}
|
|
1263
|
+
/* THE CHEVRON POINTS AT WHAT THE NEXT TAP DOES, and the only question it ever
|
|
1264
|
+
answers is "is there something here I can still put away?".
|
|
1265
|
+
|
|
1266
|
+
DOWN in "open", and in "peek" while the cart HAS cards \u2014 from there a tap
|
|
1267
|
+
makes the sheet smaller (open \u2192 peek \u2192 mini). UP in "mini", and in a "peek"
|
|
1268
|
+
whose cart is empty, because in both of those the sheet is already as small
|
|
1269
|
+
as that cart can make it and the only way left is up. Before the cart's
|
|
1270
|
+
first sync "data-has-selection" is absent, which reads as empty \u2014 the arrow
|
|
1271
|
+
points up over an empty sheet, which is the truth.
|
|
1272
|
+
|
|
1273
|
+
Base keeps an explicit rotate(0) \u2014 transitioning to/from a bare 'none' leaves
|
|
1274
|
+
the value stuck in some engines, so both endpoints must be real transforms. */
|
|
1275
|
+
.sl-sheet-toggle svg{transform:rotate(0deg);transition:transform .24s cubic-bezier(.2,.8,.2,1)}
|
|
1276
|
+
.sl-picker[data-sheet="open"] .sl-sheet-toggle svg{transform:rotate(180deg)}
|
|
1277
|
+
.sl-picker[data-sheet="peek"][data-has-selection="true"] .sl-sheet-toggle svg{transform:rotate(180deg)}
|
|
1278
|
+
/* 22px OF TRAY TOP PADDING, WHICH IS THE PILL'S OVERHANG PLUS CLEARANCE. The
|
|
1279
|
+
handle straddles the head's bottom hairline, so its lower 20px hangs into
|
|
1280
|
+
whatever comes next. In mini that is the footer's own padding and the empty
|
|
1281
|
+
middle of the total row, which has nothing in it to cover. In peek and open
|
|
1282
|
+
it is the tray, and a 40px disc drawn over the top of the first ticket card
|
|
1283
|
+
is exactly the "fleck of chrome dropped on the content" the pill was brought
|
|
1284
|
+
inside the sheet to stop being. The extra 12px over the panel's own 10px is
|
|
1285
|
+
the whole cost of the straddle; the peek tray cap in pickerStyles.ts carries
|
|
1286
|
+
the same 12px so three cards and the fourth's sliver still fit. */
|
|
1287
|
+
.sl-picker[data-layout="narrow"] .sl-tray{padding-top:22px}
|
|
1288
|
+
/* THE LINE IS THE SHEET'S TOP EDGE, AND THE MAP RUNS UP TO IT (owner,
|
|
1289
|
+
2026-09-06, on the phone: "above the arrow their black better remove and
|
|
1290
|
+
keep transparent"). The head is a 19.5px strip that exists only to hold the
|
|
1291
|
+
pill's upper half, and painted in the sheet's ground it read as a band of
|
|
1292
|
+
chrome between the map and the line \u2014 the thing the single hairline was
|
|
1293
|
+
meant to end. So the sheet is pulled up by the head's height and its ground
|
|
1294
|
+
is taken off the container: the map (flex:1, so it grows by the same 20px)
|
|
1295
|
+
shows through the strip, the disc floats on the map with its own filled
|
|
1296
|
+
ground and line-colour ring, and the first opaque pixel of the sheet is the
|
|
1297
|
+
hairline itself. Every block below the line paints its own ground because
|
|
1298
|
+
the container no longer does \u2014 the tray, the footer, and the panel sections
|
|
1299
|
+
the open sheet reveals; all of them sit on the picker's own ground anyway,
|
|
1300
|
+
so nothing changes colour except the strip.
|
|
1301
|
+
|
|
1302
|
+
The strip must not steal the map's taps: a thumb aiming at a seat in the
|
|
1303
|
+
bottom row would otherwise flip the sheet. Pointer events go through the
|
|
1304
|
+
head and stay on the pill, and the pill still bubbles its press to the
|
|
1305
|
+
head's swipe tracking (SeatPicker's sheet wiring), so the drag works from
|
|
1306
|
+
the one thing that looks like a handle. The upward shadow moves from the
|
|
1307
|
+
container to the tray, which is now the sheet's first painted block after
|
|
1308
|
+
the line in peek and open; the footer already casts its own. */
|
|
1309
|
+
/* z-index:7 CLEARS THE BOOT SKELETON. The disc's upper half now stands over
|
|
1310
|
+
the map, and the map is where the boot overlay (z 6) and the control
|
|
1311
|
+
anchors (z 5) are positioned; an unpositioned sheet paints under both, so
|
|
1312
|
+
while the chart was loading the owner's iPhone showed a half disc peeking
|
|
1313
|
+
from under the skeleton (2026-09-06). 7 sits below the \u267F menu (8), the
|
|
1314
|
+
confirm card (10) and every scrim, which all still belong on top. */
|
|
1315
|
+
.sl-picker[data-layout="narrow"] .sl-side{position:relative;z-index:7;margin-top:-20px;background:transparent;box-shadow:none}
|
|
1316
|
+
.sl-picker[data-layout="narrow"] .sl-side>:not(.sl-sheet-head){background:var(--sl-bg)}
|
|
1317
|
+
.sl-picker[data-layout="narrow"] .sl-sheet-head{pointer-events:none}
|
|
1318
|
+
/* NO HANDLE WHILE THE CONFIRM CARD IS UP. The card's scrim (z 9) dims the map
|
|
1319
|
+
and stops at the sheet's line, so the disc's upper half sat in the dark
|
|
1320
|
+
and its lower half in the light \u2014 a disc cut in two (owner's iPhone,
|
|
1321
|
+
2026-09-06). The footer already says "Confirm or cancel this seat" and the
|
|
1322
|
+
handle has nothing to offer until that is answered. visibility, not
|
|
1323
|
+
display: the head keeps its height so the sheet does not jump. */
|
|
1324
|
+
.sl-picker[data-layout="narrow"][data-confirming="true"] .sl-sheet-toggle{visibility:hidden}
|
|
1325
|
+
/* THE LANDING IS THE MOMENT ON THE PHONE. The desktop's chip lands in a tray
|
|
1326
|
+
where a whole card slides in; the phone's lands on a line of text in a
|
|
1327
|
+
closed sheet, so that line has to do the receiving: a bigger swell than the
|
|
1328
|
+
desktop's 1.15, and a blink of the accent ink, fired when the chip arrives
|
|
1329
|
+
(ConfirmCard.commit \u2192 cartLanded), not on the press. */
|
|
1330
|
+
.sl-picker[data-layout="narrow"] .sl-value-pop{animation:slValuePopPhone .36s cubic-bezier(.2,.8,.2,1)}
|
|
1331
|
+
@keyframes slValuePopPhone{0%{transform:scale(1)}40%{transform:scale(1.3);color:var(--sl-accent-text)}100%{transform:scale(1)}}
|
|
1332
|
+
.sl-picker[data-layout="narrow"] .sl-sheet-toggle{pointer-events:auto}
|
|
1333
|
+
.sl-picker[data-layout="narrow"] .sl-tray{box-shadow:0 -8px 26px -20px rgba(0,0,0,.72)}
|
|
1334
|
+
/* The map's corner column used to stop 12px above the sheet, which was 20px
|
|
1335
|
+
above the line. The map now reaches the line, so the column keeps the same
|
|
1336
|
+
clearance from the pill's top rather than dropping onto the hairline. */
|
|
1337
|
+
.sl-picker[data-layout="narrow"] .sl-anchor[data-region="bottom-right"]{bottom:32px}
|
|
1338
|
+
`;var Vs=`
|
|
1220
1339
|
/* THE PHONE SHOWS THE DESKTOP CARD (owner call 2026-09-06: "cards should be
|
|
1221
1340
|
the same design as desktop"). What used to be here was a second rendering of
|
|
1222
1341
|
the cart \u2014 a bordered .sl-tlist box of 44px hairline-divided .sl-tline rows,
|
|
@@ -1357,9 +1476,23 @@
|
|
|
1357
1476
|
which leaves the count (and the \u24D8, where a row has one) sitting between the
|
|
1358
1477
|
label and the toggle, in the order the row is read: icon, name, count,
|
|
1359
1478
|
switch. */
|
|
1360
|
-
|
|
1479
|
+
/* 54px, NOT 42: the switch is 34px wide and sits 8px in, so 42 left the row's
|
|
1480
|
+
last word \u2014 the "1 free" count \u2014 touching the track (owner phone capture,
|
|
1481
|
+
2026-09-06). The extra 12px is the gap the row's own flex gap gives every
|
|
1482
|
+
other pair. */
|
|
1483
|
+
.sl-a11yrow-w{position:relative;display:flex;align-items:center;gap:6px;padding-inline-end:54px}
|
|
1361
1484
|
.sl-a11yrow-w .sl-a11yrow{flex:1;min-width:0}
|
|
1362
1485
|
.sl-a11yrow-w .sl-a11yrow-s{position:absolute;inset-inline-end:8px;top:50%;transform:translateY(-50%)}
|
|
1486
|
+
/* THE \u24D8 WITH THE LABEL (owner, 2026-09-06). On a row that carries a note the
|
|
1487
|
+
row button shrinks to icon \xB7 name, the \u24D8 follows it directly, and the count
|
|
1488
|
+
is pushed to the switch's side by its own margin. The wrapper takes over the
|
|
1489
|
+
row's hover ground and its tap-through (pickerAccessibilityMenu), so the
|
|
1490
|
+
line still reads and behaves as one control. */
|
|
1491
|
+
.sl-a11yrow-w:has(.sl-info){border-radius:9px}
|
|
1492
|
+
.sl-a11yrow-w:has(.sl-info):hover{background:color-mix(in srgb,var(--sl-muted) 12%,transparent)}
|
|
1493
|
+
.sl-a11yrow-w:has(.sl-info) .sl-a11yrow{flex:0 1 auto}
|
|
1494
|
+
.sl-a11yrow-w:has(.sl-info) .sl-a11yrow:hover{background:transparent}
|
|
1495
|
+
.sl-a11yrow-w:has(.sl-info) .sl-a11yrow-c{margin-inline-start:auto}
|
|
1363
1496
|
button.sl-a11yrow-c{flex:none;width:auto;height:auto;min-height:32px;padding:0;border:0;background:transparent;cursor:pointer;
|
|
1364
1497
|
font:inherit;font-size:10.5px;font-weight:800;color:var(--sl-muted);font-variant-numeric:tabular-nums;
|
|
1365
1498
|
text-decoration:underline;text-decoration-color:transparent;text-underline-offset:3px;transition:color .15s,text-decoration-color .15s}
|
|
@@ -1410,7 +1543,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
1410
1543
|
.sl-picker .sl-fitpill.sl-fit-p2,.sl-picker .sl-fitpill.sl-fit-p3{font-size:11.5px}
|
|
1411
1544
|
.sl-picker .sl-fitpill.sl-fit-p3{white-space:normal;text-align:center;
|
|
1412
1545
|
padding-top:6px;padding-bottom:6px;line-height:1.2}
|
|
1413
|
-
`;var
|
|
1546
|
+
`;var zs="seatlayer-picker-style",Bc=`
|
|
1414
1547
|
.sl-picker{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:420px;overflow:hidden;
|
|
1415
1548
|
background:var(--sl-bg);color:var(--sl-text);font-family:var(--sl-font);border-radius:var(--sl-radius);
|
|
1416
1549
|
/* iOS INFLATES FIXED-PX TYPE IN A HOST LAYOUT IT DECIDES IS TOO NARROW, and
|
|
@@ -1527,8 +1660,21 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
1527
1660
|
|
|
1528
1661
|
/* narrow (container < 640px): map-first \u2014 the map claims ~80-85% of the
|
|
1529
1662
|
container and the side panel becomes a PEEKING bottom sheet (AXS/Ticketmaster
|
|
1530
|
-
mobile pattern).
|
|
1531
|
-
|
|
1663
|
+
mobile pattern).
|
|
1664
|
+
|
|
1665
|
+
THREE RESTING HEIGHTS on the root's data-sheet, smallest first:
|
|
1666
|
+
"mini" \u2014 the footer alone (total, CTA, by-line). The map gets everything
|
|
1667
|
+
else. An empty cart never has this state; see below.
|
|
1668
|
+
"peek" \u2014 the default: handle + the cart capped at three cards and a
|
|
1669
|
+
sliver of the fourth + the footer.
|
|
1670
|
+
"open" \u2014 the whole panel, swipe up or tap to reach.
|
|
1671
|
+
|
|
1672
|
+
WHY "mini" EXISTS (owner, 2026-09-06, on a real iPhone): two held seats put
|
|
1673
|
+
the collapsed sheet at ~45% of the screen with NO WAY to make it smaller \u2014
|
|
1674
|
+
the arrow's only remaining move was to make it bigger. The chevron now
|
|
1675
|
+
points down whenever a tap shrinks the sheet, so the buyer always has a way
|
|
1676
|
+
back to the map.
|
|
1677
|
+
|
|
1532
1678
|
Swipe handling lives on the sheet head ONLY \u2014 never the map host, so the
|
|
1533
1679
|
map's raw-pointer gesture pipeline is untouched. */
|
|
1534
1680
|
.sl-picker[data-layout="narrow"] .sl-body{flex-direction:column}
|
|
@@ -1548,36 +1694,51 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
1548
1694
|
max-height also keeps the .3s open/close feel: the sheet is clamped by the
|
|
1549
1695
|
animating ceiling on the way up and released by it on the way down, which
|
|
1550
1696
|
height:auto alone could never transition. */
|
|
1551
|
-
|
|
1697
|
+
/* NO TOP BORDER (owner, 2026-09-06: "we just not need top line"). The sheet
|
|
1698
|
+
used to draw a hairline along its own top edge, six pixels above the handle
|
|
1699
|
+
pill, with the footer drawing a second one below it \u2014 the arrow sat BETWEEN
|
|
1700
|
+
two lines, which is a band, not a handle. The single hairline the sheet has
|
|
1701
|
+
left is the one the pill straddles (pickerStylesSheet.ts). The upward shadow
|
|
1702
|
+
below still separates the panel from the map, which is what the border was
|
|
1703
|
+
really for on a dark chart. */
|
|
1704
|
+
.sl-picker[data-layout="narrow"] .sl-side{width:100%;border-left:0;
|
|
1552
1705
|
flex:none;height:auto;max-height:calc(min(72%,480px) + var(--sl-safe-b));padding-bottom:var(--sl-safe-b);
|
|
1553
1706
|
background:var(--sl-bg);box-shadow:0 -8px 26px -20px rgba(0,0,0,.72);
|
|
1554
|
-
overflow:
|
|
1707
|
+
overflow:hidden;
|
|
1555
1708
|
transition:max-height .3s cubic-bezier(.2,.8,.2,1);overscroll-behavior:contain}
|
|
1556
|
-
/*
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
max-height animation
|
|
1709
|
+
/* PLAIN overflow:hidden AGAIN. The sheet used to carry an inset clip-path with
|
|
1710
|
+
a negative top, because half the grab pill sat ABOVE this box's edge and
|
|
1711
|
+
overflow:hidden clips at the padding box, which erased it. The pill is
|
|
1712
|
+
inside the sheet now (owner, 2026-09-06: on a real phone it straddled the
|
|
1713
|
+
black map edge and read as a fleck of chrome floating over the venue), so
|
|
1714
|
+
there is nothing to let out \u2014 and the ordinary overflow does the one job the
|
|
1715
|
+
clip was doing besides, hiding the content the max-height animation squeezes
|
|
1716
|
+
past. The panel's own upward box-shadow is unaffected: overflow clips
|
|
1717
|
+
descendants, never the element's own shadow. */
|
|
1563
1718
|
/* AN OPEN SHEET NEVER TAKES THE MAP'S CONTROLS WITH IT. Every open-sheet cap
|
|
1564
1719
|
carries the same third term: the sheet may not grow past what leaves the map
|
|
1565
1720
|
--sl-map-floor of height. Without it a four-ticket cart drove the map host
|
|
1566
1721
|
to 193px and the bottom-right control column climbed into the Map/3D toggle
|
|
1567
1722
|
\u2014 two live controls in the same 38x28 box.
|
|
1568
|
-
The
|
|
1569
|
-
head
|
|
1570
|
-
|
|
1571
|
-
the
|
|
1572
|
-
|
|
1723
|
+
The 247px inner floor is the sheet's own irreducible content \u2014 20.5px of
|
|
1724
|
+
sheet head (the pill's upper half plus the hairline it straddles) + the
|
|
1725
|
+
tray's 96px floor + the 116px footer that carries the CTA, plus the rounding
|
|
1726
|
+
the measured sheet carries \u2014 so a very short container loses map clearance
|
|
1727
|
+
rather than the button that takes the money. At 375x812 the cap binds
|
|
1728
|
+
(map 264) and four tickets still stand in the tray without scrolling.
|
|
1729
|
+
|
|
1730
|
+
IT WAS 236 with a 10px head, then 252 when the pill came inside and made the
|
|
1731
|
+
head 26px. The pill now straddles the head's bottom edge instead of sitting
|
|
1732
|
+
in a band above it, so the head is 20.5px and every number derived from it
|
|
1733
|
+
comes back down by 5.5. */
|
|
1573
1734
|
.sl-picker[data-layout="narrow"][data-sheet="open"] .sl-side{
|
|
1574
|
-
max-height:calc(min(72%,480px,max(
|
|
1735
|
+
max-height:calc(min(72%,480px,max(247px,100% - var(--sl-map-floor))) + var(--sl-safe-b))}
|
|
1575
1736
|
.sl-picker[data-layout="narrow"][data-sheet="open"][data-has-selection="false"] .sl-side{
|
|
1576
|
-
max-height:calc(min(380px,64%,max(
|
|
1737
|
+
max-height:calc(min(380px,64%,max(247px,100% - var(--sl-map-floor))) + var(--sl-safe-b))}
|
|
1577
1738
|
/* With the price list expanded the sheet takes the with-selection height so
|
|
1578
1739
|
the tray (cart + best-seats) is never crushed under the fixed-size list. */
|
|
1579
1740
|
.sl-picker[data-layout="narrow"][data-sheet="open"][data-prices-open="true"] .sl-side{
|
|
1580
|
-
max-height:calc(min(480px,74%,max(
|
|
1741
|
+
max-height:calc(min(480px,74%,max(247px,100% - var(--sl-map-floor))) + var(--sl-safe-b))}
|
|
1581
1742
|
/* THE COLLAPSED SHEET IS THE FOOTER (owner call 2026-09-05), and the footer is
|
|
1582
1743
|
the SAME block the desktop panel has: the tickets, "1 ticket \u2026 $80", the CTA
|
|
1583
1744
|
and the by-line, in one set of rules for both widths.
|
|
@@ -1596,30 +1757,39 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
1596
1757
|
below is a flex item that gives way: on a short container the sheet clamps
|
|
1597
1758
|
here, the tray shrinks and scrolls, and the button is never the part that
|
|
1598
1759
|
gets cut off. */
|
|
1599
|
-
/*
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1760
|
+
/* 57% AND 378px. The cap below caps the TRAY, and this one must be able to
|
|
1761
|
+
hand it 240px or that cap never binds. Measured at 375x812 with ten tickets:
|
|
1762
|
+
20.5 head + 240 tray + 116 footer = 376.5, so the ceiling is 378 and the
|
|
1763
|
+
fraction has to clear it too \u2014 the body this resolves against is 672px, on
|
|
1764
|
+
which 56% is 376 and would eat the fourth card's sliver rather than leave
|
|
1765
|
+
the five pixels the tray cap deliberately reserves. The fraction still wins
|
|
1766
|
+
on a short phone, where the tray shrinks and scrolls and the button is never
|
|
1767
|
+
cut off.
|
|
1768
|
+
|
|
1769
|
+
IT WAS 54%/356 with a 10px head, then 56%/372 with the pill in a 26px band.
|
|
1770
|
+
The head is 20.5px now and the tray took 12px of that back as the top
|
|
1771
|
+
padding that keeps the pill's lower half off the first ticket card. */
|
|
1772
|
+
.sl-picker[data-layout="narrow"][data-sheet="peek"] .sl-side{max-height:calc(min(57%,378px) + var(--sl-safe-b))}
|
|
1606
1773
|
.sl-picker[data-layout="narrow"][data-sheet="peek"] .sl-side > :not(.sl-sheet-head):not(.sl-tray):not(.sl-foot){display:none}
|
|
1607
1774
|
/* THREE TICKETS AND A HAIRLINE OF THE FOURTH (owner item 20). Ten tickets used
|
|
1608
1775
|
to be a sheet that grew until it owned the phone; the cart scrolls inside
|
|
1609
1776
|
its own box now and the map keeps its room.
|
|
1610
1777
|
|
|
1611
1778
|
RE-DERIVED FOR THE DESKTOP CARD (2026-09-06), which is the card the phone
|
|
1612
|
-
shows now
|
|
1613
|
-
|
|
1779
|
+
shows now, and again for the straddling handle: the pill's lower half hangs
|
|
1780
|
+
20px BELOW the head, so the phone tray's top padding is 22px rather than 10
|
|
1781
|
+
and this cap carries the same 12px.
|
|
1782
|
+
MEASURED at 375x812: 22px of tray padding-top + three 64px
|
|
1783
|
+
.sl-chip cards + two 7px tray gaps = 228px for three whole tickets, then one
|
|
1614
1784
|
more gap and 5px of the fourth so the box reads as scrollable rather than
|
|
1615
|
-
finished \u2014
|
|
1785
|
+
finished \u2014 240px.
|
|
1616
1786
|
|
|
1617
1787
|
64px, not the 48px min-height in the rule and not the 52px the card measures
|
|
1618
1788
|
on a mouse: a coarse pointer gives the \u2715 and the eye a REAL 44px box (they
|
|
1619
1789
|
sit 2px apart, so grown invisible boxes would overlap and the \u2715 would claim
|
|
1620
1790
|
part of the eye's own ink), and 44 + 9 + 9 + 2 is 64. A touch desktop has
|
|
1621
1791
|
always drawn this card at 64 too. */
|
|
1622
|
-
.sl-picker[data-layout="narrow"][data-sheet="peek"] .sl-tray{max-height:
|
|
1792
|
+
.sl-picker[data-layout="narrow"][data-sheet="peek"] .sl-tray{max-height:240px;min-height:0;overflow-y:auto;overscroll-behavior:contain}
|
|
1623
1793
|
/* In peek the tray is the CART and nothing else. The best-seats card, the
|
|
1624
1794
|
closed note, the by-night summary and the "Areas" disclosure are all things
|
|
1625
1795
|
to read and decide about; they belong to the opened sheet, which has the
|
|
@@ -1627,13 +1797,31 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
1627
1797
|
added to the tray does not silently appear in the collapsed sheet. */
|
|
1628
1798
|
.sl-picker[data-layout="narrow"][data-sheet="peek"] .sl-tray > :not(.sl-chip):not(.sl-ga){display:none}
|
|
1629
1799
|
/* An empty cart has no tickets to show at all, and a tray with only its own
|
|
1630
|
-
padding in it would put
|
|
1800
|
+
padding in it would put a 36px band between the handle and the total. */
|
|
1631
1801
|
.sl-picker[data-layout="narrow"][data-sheet="peek"][data-has-selection="false"] .sl-tray{display:none}
|
|
1802
|
+
/* THE MINIMISED SHEET IS THE FOOTER AND NOTHING ELSE.
|
|
1803
|
+
Same block again \u2014 the tickets line, the total, the CTA, the by-line \u2014 with
|
|
1804
|
+
the cart itself put away. This is the state an empty cart's peek ALREADY is
|
|
1805
|
+
(the rule directly above), which is exactly why "mini" is skipped when the
|
|
1806
|
+
cart is empty: two names for one set of pixels is a chevron that appears to
|
|
1807
|
+
do nothing.
|
|
1808
|
+
|
|
1809
|
+
An allowlist of two, so the next thing added to the sheet does not silently
|
|
1810
|
+
appear in the smallest state. There is no map-floor term in the cap because
|
|
1811
|
+
this state is the one that GIVES the map its room: 19.5px of head plus the
|
|
1812
|
+
footer is the whole sheet \u2014 the head drops its own hairline here and lets
|
|
1813
|
+
the footer's be the line the pill straddles, so the chrome above the total
|
|
1814
|
+
is smaller than it has ever been. The ceiling is only here to stop a tall
|
|
1815
|
+
footer (a long by-line, a wrapped total) from growing without limit. */
|
|
1816
|
+
.sl-picker[data-layout="narrow"][data-sheet="mini"] .sl-side{max-height:calc(min(40%,260px) + var(--sl-safe-b))}
|
|
1817
|
+
.sl-picker[data-layout="narrow"][data-sheet="mini"] .sl-side > :not(.sl-sheet-head):not(.sl-foot){display:none}
|
|
1632
1818
|
/* flex:1 is 1 1 0%, and a ZERO basis makes the tray contribute nothing to the
|
|
1633
1819
|
sheet's content height \u2014 the sheet would collapse to its chrome no matter
|
|
1634
1820
|
how many tickets were in the cart. An auto basis is what lets the cart push
|
|
1635
1821
|
the sheet taller; grow/shrink stay 1 so the tray is still the one child that
|
|
1636
1822
|
gives way when the cap is reached, down to its 96px floor. */
|
|
1823
|
+
/* The tray's phone top padding is NOT here: it is the handle's overhang plus
|
|
1824
|
+
clearance, so it lives with the handle in pickerStylesSheet.ts. */
|
|
1637
1825
|
.sl-picker[data-layout="narrow"] .sl-tray{flex:1 1 auto;min-height:96px;overflow-y:auto;overscroll-behavior:contain}
|
|
1638
1826
|
.sl-picker[data-layout="narrow"][data-prices-open="true"] .sl-tray{min-height:48px}
|
|
1639
1827
|
/* AN EMPTY CART STILL HAS A PANEL FULL OF THINGS. With no seats picked the
|
|
@@ -1675,18 +1863,37 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
1675
1863
|
different thing: "+" steps in, "\u2212" walks one rung back out, and the framed
|
|
1676
1864
|
dot puts the whole venue on screen in one tap.
|
|
1677
1865
|
|
|
1678
|
-
This corner used to hold "\u2212" alone
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
labelled discs cost 72 more pixels of a corner and remove every dead end.
|
|
1866
|
+
This corner used to hold "\u2212" alone, on the argument that pinch already zooms
|
|
1867
|
+
in \u2014 but a buyer who has pinched themselves somewhere odd then has ONE
|
|
1868
|
+
control to reason with, and it was the one that also decided, wrongly, when
|
|
1869
|
+
it had nothing left to do. Three labelled discs remove every dead end.
|
|
1683
1870
|
|
|
1684
1871
|
"\u2212" and the fit disc do not duplicate each other: "\u2212" is the ladder (out of
|
|
1685
1872
|
the seat, out of the section, then the venue) and the fit disc is the whole
|
|
1686
|
-
venue immediately, however deep the buyer is.
|
|
1687
|
-
|
|
1873
|
+
venue immediately, however deep the buyer is. At the venue fit neither has
|
|
1874
|
+
anywhere to go and BOTH LEAVE THE COLUMN \u2014 see syncMapStepBack. */
|
|
1688
1875
|
.sl-zoom>[data-ref="zfit"]{display:none}
|
|
1689
1876
|
.sl-picker[data-layout="narrow"] .sl-zoom>[data-ref="zfit"]{display:flex}
|
|
1877
|
+
/* ...AND MUST ACTUALLY GO ON WIDE. The UA's own [hidden] rule cannot do it:
|
|
1878
|
+
the rule directly above outranks it (specificity 4), so a hidden disc kept
|
|
1879
|
+
painting \u2014 the .sl-fs-pill trap below, again. Wide closes the gap; the
|
|
1880
|
+
phone keeps the slot (next rule) because a column that reflows moves the
|
|
1881
|
+
disc the thumb is on. */
|
|
1882
|
+
.sl-picker .sl-zoom>button[hidden]{display:none}
|
|
1883
|
+
/* THE PHONE'S BACK-OUT DISCS GROW UPWARD. The column is anchored to the
|
|
1884
|
+
corner, so a disc that left it below "+" pulled "+" down \u2014 and the first
|
|
1885
|
+
press, which brings "\u2212" and fit back, moved "+" 100px up out from under the
|
|
1886
|
+
thumb (owner, 2026-09-06). Keeping empty slots fixed that and left \u267F and
|
|
1887
|
+
"+" floating two discs above the corner at the venue fit (owner, same
|
|
1888
|
+
evening: "why our icon move this up"). So on the phone the order is
|
|
1889
|
+
\u2212, fit, \u267F, + from the top: at the fit only \u267F and "+" show and they hug the
|
|
1890
|
+
corner; when "\u2212" and fit come back they stack ABOVE them and nothing under
|
|
1891
|
+
the thumb moves. Retired discs still leave the column (display:none). */
|
|
1892
|
+
.sl-picker[data-layout="narrow"] .sl-zoom>button[hidden]{display:none}
|
|
1893
|
+
.sl-picker[data-layout="narrow"] .sl-zoom>[data-ref="zout"]{order:1}
|
|
1894
|
+
.sl-picker[data-layout="narrow"] .sl-zoom>[data-ref="zfit"]{order:2}
|
|
1895
|
+
.sl-picker[data-layout="narrow"] .sl-zoom>.sl-a11y{order:3}
|
|
1896
|
+
.sl-picker[data-layout="narrow"] .sl-zoom>[data-ref="zin"]{order:4}
|
|
1690
1897
|
/* Wide keeps its two: the section pill's \u2715, the minimap and a mouse wheel are
|
|
1691
1898
|
all right there, and full screen already sits in the header as a labelled
|
|
1692
1899
|
pill (dockLayoutChrome). */
|
|
@@ -1785,38 +1992,9 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
1785
1992
|
.sl-rc:disabled{opacity:.45;cursor:default}
|
|
1786
1993
|
.sl-rc:disabled .sl-rc-t{text-decoration:line-through}
|
|
1787
1994
|
|
|
1788
|
-
/* THE SHEET HEAD
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
row is a ticket, which is what made the sheet read as three stacked blocks.
|
|
1792
|
-
The chevron is a 40x22 pill now, straddling the sheet's own top edge the way
|
|
1793
|
-
a drawer handle sits on a drawer: eleven pixels above the border line and
|
|
1794
|
-
eleven below, with the head reduced to that lower half and NOTHING drawn
|
|
1795
|
-
under it \u2014 no divider, no band.
|
|
1796
|
-
|
|
1797
|
-
The whole row is still the tap and swipe target, and so is the pill: the
|
|
1798
|
-
pointer handlers live on the head, and a press starting on the pill now
|
|
1799
|
-
tracks with them (a 10px strip is not something a thumb can drag). */
|
|
1800
|
-
.sl-sheet-head{display:none;align-items:center;justify-content:center;padding:0;min-height:10px;
|
|
1801
|
-
cursor:pointer;touch-action:none;user-select:none;-webkit-user-select:none;flex:none}
|
|
1802
|
-
.sl-picker[data-layout="narrow"] .sl-sheet-head{display:flex;position:relative}
|
|
1803
|
-
/* A PILL ON THE EDGE, NOT A DISC IN A BAND. Absolute rather than a negative
|
|
1804
|
-
margin so the head keeps its own 10px of height whatever the pill does, and
|
|
1805
|
-
the sheet's clip-path (see .sl-side above) is what lets the upper half out. */
|
|
1806
|
-
.sl-sheet-toggle{position:absolute;top:-11px;left:0;right:0;margin:0 auto;
|
|
1807
|
-
width:40px;height:22px;border-radius:999px;flex:none;display:flex;
|
|
1808
|
-
align-items:center;justify-content:center;color:var(--sl-muted);
|
|
1809
|
-
background:color-mix(in srgb,var(--sl-line) 62%,var(--sl-bg));
|
|
1810
|
-
border:1px solid var(--sl-line);
|
|
1811
|
-
transition:color .15s,background .15s}
|
|
1812
|
-
.sl-sheet-toggle:hover,.sl-sheet-toggle:focus-visible{color:var(--sl-text);background:color-mix(in srgb,var(--sl-line) 92%,var(--sl-bg))}
|
|
1813
|
-
.sl-sheet-toggle svg{width:14px;height:14px;stroke:currentColor;stroke-width:2.4;fill:none;
|
|
1814
|
-
stroke-linecap:round;stroke-linejoin:round}
|
|
1815
|
-
/* state chevron: points UP while peeking, rotates to point DOWN when open.
|
|
1816
|
-
Base keeps an explicit rotate(0) \u2014 transitioning to/from a bare 'none' leaves
|
|
1817
|
-
the value stuck in some engines, so both endpoints must be real transforms. */
|
|
1818
|
-
.sl-sheet-toggle svg{transform:rotate(0deg);transition:transform .24s cubic-bezier(.2,.8,.2,1)}
|
|
1819
|
-
.sl-picker[data-sheet="open"] .sl-sheet-toggle svg{transform:rotate(180deg)}
|
|
1995
|
+
/* THE SHEET HEAD AND ITS GRAB HANDLE \u2014 the rules live in pickerStylesSheet.ts
|
|
1996
|
+
(this sheet is at the app's 1,500-line cap on a vendored source); SHEET_CSS
|
|
1997
|
+
is concatenated immediately after it, which is where the block sat. */
|
|
1820
1998
|
|
|
1821
1999
|
/* The sheet's consolidated Filters row is RETIRED. It existed to give the a11y
|
|
1822
2000
|
chips a home on narrow, and the price rail is a better one: always in view,
|
|
@@ -1852,9 +2030,10 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
1852
2030
|
already looks for map controls, so the menu opens UPWARD from it and
|
|
1853
2031
|
towards the map, anchored to the column's own edge (inset-inline-end). */
|
|
1854
2032
|
.sl-a11y{position:relative}
|
|
1855
|
-
/* The zoom discs carry a definite width
|
|
1856
|
-
|
|
1857
|
-
.
|
|
2033
|
+
/* The zoom discs carry a definite width; this wrapper has none and would be
|
|
2034
|
+
stretched by the column. It takes the column's own edge instead, so the \u267F
|
|
2035
|
+
sits above "+" however wide the column's widest tenant turns out to be. */
|
|
2036
|
+
.sl-zoom>.sl-a11y{align-self:flex-end}
|
|
1858
2037
|
/* Same disc tokens as the zoom column, and it was the worse of the two: an
|
|
1859
2038
|
opaque panel surface with a .24 hairline \u2014 a dark blob with no edge. */
|
|
1860
2039
|
.sl-a11ybtn{width:36px;height:36px;border-radius:999px;display:grid;place-items:center;
|
|
@@ -2050,17 +2229,27 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
2050
2229
|
.sl-ticket-state svg{width:10px;height:10px;stroke:currentColor;stroke-width:2.6;fill:none;stroke-linecap:round;stroke-linejoin:round}
|
|
2051
2230
|
.sl-chip-main{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:2px}
|
|
2052
2231
|
.sl-chip-id{display:flex;flex-direction:column;gap:1px;min-width:0}
|
|
2053
|
-
/*
|
|
2232
|
+
/* A TICKET IS TWO LINES, AND BOTH OF THEM ARE READABLE ON A PHONE.
|
|
2233
|
+
Owner, 2026-09-06, on a real iPhone: "Row A \xB7 Seat 9 \xB7 Premium" reads thin \u2014
|
|
2234
|
+
11.5px of grey under a 13px name is a caption, and it is carrying the two
|
|
2235
|
+
facts the buyer checks against the map before they pay. The card is the same
|
|
2236
|
+
card on both widths, so both widths get the fix.
|
|
2237
|
+
|
|
2238
|
+
The name ellipsizes \u2014 a long venue section is the one fact here that can be
|
|
2054
2239
|
longer than the panel. Everything under it is short by construction. */
|
|
2055
|
-
.sl-chip-name{min-width:0;font-size:
|
|
2240
|
+
.sl-chip-name{min-width:0;font-size:15px;font-weight:700;line-height:1.25;color:var(--sl-text);
|
|
2056
2241
|
white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
2057
|
-
/* Grey WORDS, ink VALUES. "Row
|
|
2058
|
-
the numbers are the half
|
|
2059
|
-
|
|
2242
|
+
/* Grey WORDS, ink VALUES, and the same size for both. "Row A \xB7 Seat 9" is two
|
|
2243
|
+
labels and two numbers; the numbers are the half that has to survive a
|
|
2244
|
+
glance, so they take the panel's full text colour and a heavier weight while
|
|
2245
|
+
"Row" and "Seat" stay muted. The ticket type is a word like those words and
|
|
2246
|
+
is styled as one \u2014 pickerTray puts it in the same ".w" span, which is what
|
|
2247
|
+
makes the three weights here separately reachable at all. */
|
|
2248
|
+
.sl-chip-pos{display:flex;align-items:baseline;gap:4px;min-width:0;font-size:13px;font-weight:600;line-height:1.3;
|
|
2060
2249
|
white-space:nowrap;overflow:hidden;color:var(--sl-muted);font-variant-numeric:tabular-nums}
|
|
2061
2250
|
.sl-chip-pos .sl-chip-seg{flex:none;white-space:nowrap}
|
|
2062
2251
|
.sl-chip-pos .w{flex:none}
|
|
2063
|
-
.sl-chip-pos b{flex:none;font-weight:
|
|
2252
|
+
.sl-chip-pos b{flex:none;font-weight:700;color:var(--sl-text)}
|
|
2064
2253
|
.sl-chip-pos i{flex:none;font-style:normal;opacity:.6}
|
|
2065
2254
|
/* THE LINE SHORTENS BY THE FACT, NOT BY THE LETTER (fitTextRow, rungs 1-2).
|
|
2066
2255
|
A German cart line ran "Reihe C \xB7 Platz 5 \xB7 Standard" past the panel and
|
|
@@ -2080,7 +2269,9 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
2080
2269
|
.sl-chip-date{padding:3px 6px;border-radius:999px;background:color-mix(in srgb,var(--sl-accent) 13%,var(--sl-surface));
|
|
2081
2270
|
color:var(--sl-accent-text);font-size:10.5px;font-weight:700;line-height:1.25;white-space:nowrap}
|
|
2082
2271
|
.sl-chip-sub{display:flex;align-items:center;gap:6px;min-width:0;margin-top:3px}
|
|
2083
|
-
|
|
2272
|
+
/* The price rides with the name: same size, heavier, and tabular so a column
|
|
2273
|
+
of them lines up on the decimal. */
|
|
2274
|
+
.sl-chip .amt{font-size:15px;font-weight:800;font-variant-numeric:tabular-nums;flex:none;white-space:nowrap}
|
|
2084
2275
|
/* A HORIZONTAL PAIR, NOT A BORDERED COLUMN. The rail used to draw its own
|
|
2085
2276
|
left border and stack two 26px buttons inside it; on a one-line row that is
|
|
2086
2277
|
a box inside a box, and neither button reached a comfortable target. */
|
|
@@ -2185,7 +2376,20 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
2185
2376
|
background:var(--sl-bg);box-shadow:0 -10px 24px -22px rgba(0,0,0,.72)}
|
|
2186
2377
|
.sl-total{display:flex;justify-content:space-between;align-items:center;font-size:13px;margin-bottom:10px}
|
|
2187
2378
|
.sl-total b{font-size:17px;font-variant-numeric:tabular-nums}
|
|
2188
|
-
|
|
2379
|
+
/* A COUNT THAT GOES 6 \u2192 7 SHOULD LOOK LIKE 6 GOING TO 7 (owner, 2026-09-06:
|
|
2380
|
+
"the animation earlier look good but now once add their some animation that
|
|
2381
|
+
look like added to card number increase"). This is the peek bar's old
|
|
2382
|
+
slPeekBump restored onto the footer that replaced it: a scale swell, and
|
|
2383
|
+
nothing else. What sat here in between faded the value in from 60% opacity
|
|
2384
|
+
and slid it up three pixels, which reads as a number being REPLACED \u2014 the
|
|
2385
|
+
buyer watches the old total leave rather than the new one arrive.
|
|
2386
|
+
|
|
2387
|
+
Each value grows AWAY FROM ITS OWN EDGE of the space-between row, so the
|
|
2388
|
+
pair never twitches inward. prefers-reduced-motion is answered by the
|
|
2389
|
+
blanket rule at the end of this sheet. */
|
|
2390
|
+
.sl-total>span{transform-origin:left center}
|
|
2391
|
+
.sl-total>b{transform-origin:right center}
|
|
2392
|
+
.sl-value-pop{animation:slValuePop .26s cubic-bezier(.2,.8,.2,1)}
|
|
2189
2393
|
/* Primary checkout CTA. The extra root scope documents that this is widget
|
|
2190
2394
|
chrome and keeps the contract resilient when embedded beside host styles. */
|
|
2191
2395
|
.sl-picker .sl-cta{display:flex;align-items:center;justify-content:center;width:100%;min-height:44px;
|
|
@@ -2223,9 +2427,17 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
2223
2427
|
.sl-picker[data-layout="narrow"] .sl-anchor[data-region="top-left"]{max-width:calc(100% - 112px)}
|
|
2224
2428
|
.sl-picker[data-layout="narrow"] .sl-anchor[data-region="top-center"]{max-width:44%}
|
|
2225
2429
|
|
|
2226
|
-
/* zoom column (flows within the bottom-right region)
|
|
2227
|
-
|
|
2228
|
-
.
|
|
2430
|
+
/* zoom column (flows within the bottom-right region)
|
|
2431
|
+
|
|
2432
|
+
A COLUMN AT EVERY WIDTH, PHONE INCLUDED. Narrow briefly laid these out as a
|
|
2433
|
+
row, to shrink the vertical inset the cluster imposes on the map (see
|
|
2434
|
+
mapNavigationViewportInsets). What shipped was four discs strung along the
|
|
2435
|
+
bottom edge of a 375px screen \u2014 the widest the corner can be: under the
|
|
2436
|
+
sheet's shoulder, the \u267F at one END of a line instead of on top of the stack
|
|
2437
|
+
it was placed on, and nothing like the desktop's cluster (owner report with
|
|
2438
|
+
real-iPhone captures, 2026-09-06). The inset is answered by syncMapStepBack
|
|
2439
|
+
instead: at the whole-venue view this column is TWO discs. */
|
|
2440
|
+
.sl-zoom{display:flex;flex-direction:column;align-items:flex-end;gap:6px}
|
|
2229
2441
|
/* CSS-fallback full screen (iOS Safari has no element fullscreen API) */
|
|
2230
2442
|
.sl-picker.sl-fs{position:fixed;inset:0;z-index:2147483000;width:auto;height:auto;max-height:none;border-radius:0}
|
|
2231
2443
|
/* A WIDGET THAT IS THE WHOLE VIEWPORT HAS NO CORNERS TO ROUND. The .sl-fs rule above
|
|
@@ -2255,10 +2467,22 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
2255
2467
|
box-shadow:0 6px 16px -8px rgba(0,0,0,.55);
|
|
2256
2468
|
color:var(--sl-text);font-size:17px;font-weight:700;display:flex;align-items:center;justify-content:center;transition:border-color .15s,opacity .15s}
|
|
2257
2469
|
.sl-zoom>button:hover:not(:disabled){border-color:var(--sl-text)}
|
|
2258
|
-
/*
|
|
2259
|
-
|
|
2470
|
+
/* A REAL LIMIT REACHED \u2014 the ceiling on "+", not the floor on "\u2212". The
|
|
2471
|
+
back-out discs used to dim here too; two greyed discs at the arrival view
|
|
2472
|
+
read as a broken map, so they leave the column instead (syncMapStepBack,
|
|
2473
|
+
owner call 2026-09-06) and this rule keeps only genuine dead ends. */
|
|
2260
2474
|
.sl-zoom>button:disabled{opacity:.42;cursor:default;box-shadow:none}
|
|
2261
2475
|
.sl-zoom>button svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
|
|
2476
|
+
/* FOUR DISCS OF ONE SIZE ON THE PHONE. The \u267F takes the coarse-pointer floor
|
|
2477
|
+
(44px, two rules below) because it opens a menu of choices a buyer may need
|
|
2478
|
+
before anything else; the three zoom discs under it stayed at the desktop's
|
|
2479
|
+
36. Stacked in one column that reads as a mistake \u2014 the top disc visibly
|
|
2480
|
+
larger than the three below it, as if it belonged to something else \u2014 and it
|
|
2481
|
+
left the map's own controls the only phone targets under the floor. One size
|
|
2482
|
+
for the column, and it is the size the floor asks for. Desktop keeps 36:
|
|
2483
|
+
there is a mouse there, and the cluster is denser for it. */
|
|
2484
|
+
.sl-picker[data-layout="narrow"] .sl-zoom>button{width:44px;height:44px}
|
|
2485
|
+
.sl-picker[data-layout="narrow"] .sl-zoom>button svg{width:17px;height:17px}
|
|
2262
2486
|
/* Full-screen promotion: the capability existed (native + iOS overlay +
|
|
2263
2487
|
framed-host paths) but hid as the 4th unlabelled glyph in a corner stack \u2014
|
|
2264
2488
|
even the owner could not pick it out. dockLayoutChrome docks the SAME
|
|
@@ -2487,7 +2711,11 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
2487
2711
|
flex-wrap:nowrap;font-size:12.5px;font-weight:850}
|
|
2488
2712
|
.sl-ba-title-t{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
2489
2713
|
.sl-ba-title .spark{flex:none;color:var(--sl-accent-text);font-size:16px}
|
|
2490
|
-
|
|
2714
|
+
/* THE \u24D8 FOLLOWS THE WORDS IT EXPLAINS (owner, 2026-09-06: "info icon should
|
|
2715
|
+
be closer to the label text"). It used to be pushed to the chip's side by
|
|
2716
|
+
its own auto margin; the premium chip carries that margin now. */
|
|
2717
|
+
.sl-ba-title .sl-info{flex:none;margin-inline-start:0}
|
|
2718
|
+
.sl-ba-title .sl-ba-premium{margin-inline-start:auto}
|
|
2491
2719
|
.sl-ba-cat{grid-column:2}
|
|
2492
2720
|
.sl-ba-zone{grid-column:1/-1}
|
|
2493
2721
|
/* "\u2605 Best seats" premium quick-pick \u2014 gold accent echoing the \u2605 Premium pill on
|
|
@@ -2573,12 +2801,13 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
2573
2801
|
.sl-zoom>button,.sl-a11ybtn,.sl-cbbtn,.sl-close,.sl-ga-qty button,.sl-ba-qty button,.sl-price-more,
|
|
2574
2802
|
.sl-seccard-x,.sl-fs-pill,.sl-side-toggle,.sl-minimap-toggle,.sl-ba-premium,
|
|
2575
2803
|
.sl-floor-info{position:relative}
|
|
2576
|
-
/* THE SHEET HANDLE IS NOT ON THAT LIST
|
|
2577
|
-
|
|
2578
|
-
.
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2804
|
+
/* THE SHEET HANDLE IS NOT ON THAT LIST because it does not need to be: its
|
|
2805
|
+
own rule is position:relative already, so the ::after below has a
|
|
2806
|
+
containing block. (It used to be position:absolute on the panel's top
|
|
2807
|
+
edge, and a bare .sl-sheet-toggle{position:relative} here would have had
|
|
2808
|
+
equal specificity and a later position \u2014 it would have won and dropped the
|
|
2809
|
+
pill into the flex flow on every device this block exists for. The pill is
|
|
2810
|
+
in that flow deliberately now, so the trap is gone with it.) */
|
|
2582
2811
|
.sl-zoom>button::after,.sl-a11ybtn::after,.sl-cbbtn::after,.sl-close::after,.sl-ga-qty button::after,.sl-ba-qty button::after,
|
|
2583
2812
|
.sl-price-more::after,.sl-seccard-x::after,.sl-fs-pill::after,.sl-side-toggle::after,.sl-ba-premium::after,
|
|
2584
2813
|
.sl-minimap-toggle::after,.sl-floor-info::after,.sl-sheet-toggle::after{
|
|
@@ -2763,7 +2992,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
2763
2992
|
@keyframes slHoldPulse{0%{box-shadow:0 0 0 0 currentColor;opacity:.9}75%,100%{box-shadow:0 0 0 7px transparent;opacity:.55}}
|
|
2764
2993
|
@keyframes slChipIn{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
|
|
2765
2994
|
@keyframes slNoticeIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
|
|
2766
|
-
@keyframes slValuePop{0%{
|
|
2995
|
+
@keyframes slValuePop{0%{transform:scale(1)}45%{transform:scale(1.15)}100%{transform:scale(1)}}
|
|
2767
2996
|
@keyframes slCtaReady{0%{transform:scale(.98);box-shadow:0 0 0 0 transparent}55%{transform:scale(1.01);box-shadow:0 0 0 5px color-mix(in srgb,var(--sl-accent) 18%,transparent)}100%{transform:none;box-shadow:none}}
|
|
2768
2997
|
@keyframes slToastNudge{0%,100%{margin-left:0}30%{margin-left:-4px}60%{margin-left:3px}}
|
|
2769
2998
|
@keyframes slSuccessPop{0%{opacity:0;transform:scale(.72)}65%{opacity:1;transform:scale(1.08)}100%{opacity:1;transform:scale(1)}}
|
|
@@ -2902,7 +3131,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
2902
3131
|
corners, and it is the frame. */
|
|
2903
3132
|
.sl-modal-frame > .sl-picker{border-radius:0}
|
|
2904
3133
|
@media(max-width:640px){.sl-modal-scrim{padding:0}.sl-modal-frame{width:100%;height:100%;border-radius:0}}
|
|
2905
|
-
`;function It(){if(document.getElementById(Gs))return;let i=document.createElement("style");i.id=Gs,i.textContent=$c+$s+Fs+js+zs+Vs+ks,document.head.appendChild(i)}async function $i(i,e){let t=i.overlay.productionElements;if(!t?.some(o=>o.contentImageUrl))return i;let n=await Promise.all(t.map(async o=>{if(!o.contentImageUrl)return o;try{let s=await e(o.contentImageUrl);if(!s){let{contentImageUrl:r,...a}=o;return a}return{...o,runtimeContentImageUrl:s}}catch{let{contentImageUrl:s,...r}=o;return r}}));return{...i,overlay:{...i.overlay,productionElements:n}}}async function ji(i,e){if(i)try{let t=await e(i);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}var ze=require("@seatlayer/core/view/panoramaDelivery");function Gi(i){let{root:e,source:t,caption:n,real:o,closeLabel:s,dragHint:r,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:h,onClose:d}=i,u=i.chrome??{},p=document.createElement("div");p.className="sl-view sl-mo-zoom",p.setAttribute("role","dialog"),p.setAttribute("aria-label",a),p.innerHTML='<div class="sl-view-head"><span class="sl-view-title"></span><span class="sl-view-cap"></span><button type="button" class="sl-view-x"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div><div class="sl-view-pano"><span class="sl-view-badge"></span><span class="sl-view-hint"></span></div>';let f=R=>p.querySelector(R)?.remove();u.title===!1?f(".sl-view-title"):p.querySelector(".sl-view-title").textContent=a,u.caption===!1?f(".sl-view-cap"):p.querySelector(".sl-view-cap").textContent=n,p.querySelector(".sl-view-x").setAttribute("aria-label",s),u.badge===!1?f(".sl-view-badge"):p.querySelector(".sl-view-badge").textContent=o?l:c,p.querySelector(".sl-view-hint").textContent=r,e.appendChild(p);let b=p.querySelector(".sl-view-pano"),k=(0,ze.planPanoramaDelivery)(t,(0,ze.browserPanoramaConstraints)()),x=new AbortController;b.style.backgroundImage=`url(${JSON.stringify(k.initialUrl)})`;let v=()=>{};k.upgradeUrl&&(v=(0,ze.schedulePanoramaUpgrade)(()=>{h(k.upgradeUrl).then(R=>!R||x.signal.aborted?null:(0,ze.loadPanoramaImage)(R,x.signal).then(()=>R)).then(R=>{!R||!p.isConnected||x.signal.aborted||(b.style.backgroundImage=`url(${JSON.stringify(R)})`)}).catch(()=>{})}));let A=70,y=35,H=1,C=b.clientHeight||1,N=b.clientWidth||1,M=-(C*(180/A)*2/2-N/2),P=0,_=()=>{let R=b.clientHeight||1,bt=R*(180/A)*H,Xe=Math.max(0,bt-R),Yt=Math.min(Xe/2,y/180*bt);P=Math.min(Yt,Math.max(-Yt,P)),b.style.backgroundSize=`auto ${bt}px`,b.style.backgroundPosition=`${M}px ${P-Xe/2}px`};_();let D=!1,V=0,ne=0,ee=R=>{D=!0,V=R.clientX,ne=R.clientY,b.classList.add("drag"),b.setPointerCapture?.(R.pointerId)},W=R=>{D&&(M+=R.clientX-V,P+=R.clientY-ne,V=R.clientX,ne=R.clientY,_())},gt=R=>{D=!1,b.classList.remove("drag"),b.releasePointerCapture?.(R.pointerId)},Wt=R=>{R.preventDefault(),H=Math.min(2.4,Math.max(1,H+(R.deltaY<0?.12:-.12))),_()};b.addEventListener("pointerdown",ee),b.addEventListener("pointermove",W),b.addEventListener("pointerup",gt),b.addEventListener("pointercancel",gt),b.addEventListener("wheel",Wt,{passive:!1});let z=p.querySelector(".sl-view-x");z.addEventListener("click",d);let Y=R=>{R.key==="Escape"&&(R.stopPropagation(),d())};return p.addEventListener("keydown",Y),z.focus(),{element:p,dispose(){v(),x.abort(),b.removeEventListener("pointerdown",ee),b.removeEventListener("pointermove",W),b.removeEventListener("pointerup",gt),b.removeEventListener("pointercancel",gt),b.removeEventListener("wheel",Wt),p.removeEventListener("keydown",Y),z.removeEventListener("click",d)}}}function jc(i,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=i.find(s=>s.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let n=i.filter(s=>s.rowId===t.rowId),o=n.findIndex(s=>s.id===e);return{targetSeatId:e,previousSeatId:o>0?n[o-1].id:null,nextSeatId:o>=0&&o+1<n.length?n[o+1].id:null}}var Us=6e4,Ui=class{constructor(e){this.buyerView_="map";this.targetSeatId_=null;this.focusedSectionId_=null;this.navigationMode_="orbit";this.overlay=null;this.handle=null;this.generation=0;this.seatViewGeneration=0;this.seatViewElement=null;this.seatViewDispose=null;this.options=e}get buyerView(){return this.buyerView_}get targetSeatId(){return this.targetSeatId_}get focusedSectionId(){return this.focusedSectionId_}get seatPosition(){return jc(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!ki()?!1:this.options.seats().length<=this.max3DSeats():!1}canOfferSeatView(){return this.options.enableSeatView?this.options.seats().some(e=>!!e.viewUrl)?!0:this.hasStage():!1}async setBuyerView(e,t={}){if(e==="map"){this.exit3D();return}if(!this.canOffer3D())throw new Error("venue_3d_unavailable");if(this.buyerView_==="venue3d"&&this.handle){t.flyToSeatId?(this.targetSeatId_=t.flyToSeatId,this.focusedSectionId_=this.findSeat(t.flyToSeatId)?.sectionId??null,this.options.onViewChange(this.buyerView_,this.targetSeatId_),await this.handle.flyToSeat(t.flyToSeatId)):t.resetView&&this.handle.focusOverview();return}if(this.handle&&this.overlay){await this.restore3D(t);return}await this.enter3D(t.flyToSeatId)}async openSeatView(e){if(!this.canOfferSeatView())throw new Error("seat_view_unavailable");let t=this.findSeat(e),n=this.options.host(),o=this.options.doc();if(!t||!n||!o)throw new Error("seat_view_unavailable");let s=++this.seatViewGeneration,r,a,l=!1;if(t.viewUrl){let f=t.viewMeta?.previewUrl,b=!!f&&f!==t.viewUrl,k=b?await this.options.resolveAsset(f):null,x=b?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(s!==this.seatViewGeneration||!x||b&&!k)return;r={url:x,...k?{previewUrl:k}:{},...b?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}},a=(0,qi.seatViewDisclosure)(r),l=(0,qi.isAuthoredSeatView)(r)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:f}=await Ei();if(s!==this.seatViewGeneration)return;let b=o.floors?.find(v=>v.objects.some(A=>A.type==="row"&&A.id===t.rowId)),k=t.focalPoint??b?.focalPoint??o.focalPoint,x=f(t,k,[...this.options.seats()]);r={url:x.url,generated:!0},a=(0,it.t)("picker.illustrationCaption",{m:x.distanceM})}if(s!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(n,o),It();let c=this.options.chrome??{},h=Qe(),d=(0,it.t)("picker.viewFromSeat",{label:t.displayLabel||t.label}),u=l?(0,it.t)("picker.real360"):(0,it.t)("picker.preview"),p=Gi({root:n,source:r,caption:a,real:l,closeLabel:g("picker.close","Close"),dragHint:h,viewFromSeatLabel:d,real360Label:(0,it.t)("picker.real360"),previewLabel:(0,it.t)("picker.preview"),chrome:{title:c.seatViewTitle,caption:c.seatViewCaption,badge:c.seatViewBadge},resolveAsset:this.options.resolveAsset,onClose:()=>this.closeSeatView(!0,!0)});this.seatViewElement=p.element,this.seatViewDispose=p.dispose,this.options.onSeatViewChange?.({seatId:t.id,title:d,caption:a,badge:u,real:l,generated:!!r.generated,dragHint:h})}pushLiveState(){this.handle&&(this.handle.setAvailability(this.options.seats().map(e=>({seatId:e.id,state:this.seatState(e)}))),this.handle.setSelection(this.options.selection().map(e=>e.id)))}focusOverview(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.focusOverview(),!0)}focusSection(e){return this.buyerView_==="venue3d"?this.handle?.focusSection(e)??!1:!1}focusFloor(e){let t=this.options.doc();if(this.buyerView_!=="venue3d"||!this.handle||!t?.floors?.length)return!1;let n=t.floors.findIndex(o=>o.id===e);return n>=0&&this.handle.focusFloor(n)}zoomIn(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomIn(),!0)}zoomOut(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomOut(),!0)}setNavigationMode(e){return this.navigationMode_=e,this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.setNavigationMode(e),this.options.onViewChange(this.buyerView_,this.targetSeatId_),!0)}destroy(){this.generation+=1,this.closeSeatView(!0,!1);try{this.handle?.dispose()}catch{}this.handle=null,this.overlay?.remove(),this.overlay=null,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null}max3DSeats(){let e=this.options.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?Us/2:Us}async enter3D(e){let t=this.options.host(),n=this.options.doc();if(!t||!n||this.overlay)throw new Error("venue_3d_unavailable");It(),this.prepareHostTheme(t,n);let o=document.createElement("div");o.className="sl-view3d",o.setAttribute("role","group"),o.setAttribute("aria-label",g("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(o.style,{position:"absolute",inset:"0",zIndex:"4",opacity:"0",touchAction:"none",transition:this.reducedMotion()?"none":"opacity 260ms cubic-bezier(.2,.8,.2,1)",background:"radial-gradient(120% 120% at 50% 0%,#191f28 0%,#0d1014 70%)"});let s=document.createElement("div");s.className="sl-view3d-loading",s.setAttribute("role","status"),s.setAttribute("aria-live","polite"),s.textContent=g("picker.loading3d","Building the 3D venue\u2026"),o.appendChild(s),t.appendChild(o),this.overlay=o;let r=++this.generation;if(this.reducedMotion()?o.style.opacity="1":requestAnimationFrame(()=>{o.style.opacity="1"}),await this.nextPaint(),!(r!==this.generation||this.overlay!==o))try{let[a,l]=await Promise.all([Zt(),this.options.loadEventConfiguration()]),c=l?await $i(l,this.options.resolveAsset):null,h=await ji(n.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(r!==this.generation||this.overlay!==o)return;let d={doc:n,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...h?{registeredShellGlb:h}:{}};s.textContent=g("picker.building3d","Building venue geometry\u2026");let u=await a.prepareVenue3D(d);if(r!==this.generation||this.overlay!==o)return;let p=this.options.chrome??{},f=a.mountVenue3D(o,{...d,prepared:u},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:Qe(),navLabels:Si(),...p.view3dCaption===!1||p.view3dSeatStepper===!1||p.view3dControlDock===!1?{chrome:{caption:p.view3dCaption!==!1,seatStepper:p.view3dSeatStepper!==!1,controlDock:p.view3dControlDock!==!1}}:{},seatViewActionLabel:b=>this.findSeat(b)?.viewUrl?g("picker.openAuthored360","Open venue 360\xB0"):g("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:b=>this.toggleSeat(b),onSeatInspect:b=>this.toggleSeat(b),onViewTargetChange:b=>{this.targetSeatId_=b,b&&(this.focusedSectionId_=this.findSeat(b)?.sectionId??null),this.options.onViewChange("venue3d",b)},onSectionFocusChange:b=>{this.focusedSectionId_=b,this.options.onViewChange("venue3d",this.targetSeatId_)},...this.options.enableSeatView?{getSeatView:b=>this.seatViewFor3D(b)}:{}});if(r!==this.generation||this.overlay!==o){f.dispose();return}this.handle=f,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,f.setNavigationMode(this.navigationMode_),requestAnimationFrame(()=>s.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await f.flyToSeat(e)}catch(a){if(r!==this.generation)return;throw this.options.onError?.(a),this.remove3DOverlay(!1),a}}exit3D(){this.buyerView_==="map"&&!this.overlay||(this.generation+=1,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null,this.remove3DOverlay(!0,!!this.handle),this.options.onViewChange("map",null))}remove3DOverlay(e,t=!1){let n=this.handle,o=this.overlay;if(this.options.restoreMap(),t&&n&&o){o.style.pointerEvents="none";let s=()=>{this.buyerView_!=="map"||this.overlay!==o||(o.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(o.style.opacity="0",s()):(requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(s,280));return}if(this.handle=null,this.overlay=null,!o){try{n?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{n?.dispose()}catch{}o.remove(),this.options.restoreMap();return}o.style.pointerEvents="none",requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(()=>{try{n?.dispose()}catch{}o.remove(),this.options.restoreMap()},280)}async restore3D(e){let t=this.overlay,n=this.handle;if(!t||!n)throw new Error("venue_3d_unavailable");this.buyerView_="venue3d",this.targetSeatId_=e.flyToSeatId??null,this.focusedSectionId_=e.flyToSeatId?this.findSeat(e.flyToSeatId)?.sectionId??null:null,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),n.resize(),n.setNavigationMode(this.navigationMode_),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e.flyToSeatId?await n.flyToSeat(e.flyToSeatId):e.resetView&&n.focusOverview()}nextPaint(){return this.reducedMotion()||typeof requestAnimationFrame!="function"?Promise.resolve():new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}toggleSeat(e){if(!this.findSeat(e))return;this.options.selection().some(o=>o.id===e)?this.options.deselect(e):this.options.status(e)==="free"&&this.options.select(e),this.pushLiveState()}seatState(e){switch(this.options.status(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:return"available"}}async seatViewFor3D(e){let t=this.findSeat(e);if(!t)throw new Error("seat_view_unavailable");if(t.viewUrl){let n=t.viewMeta?.previewUrl,o=!!n&&n!==t.viewUrl,s=o?await this.options.resolveAsset(n):null,r=o?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!r||o&&!s)throw new Error("seat_view_unavailable");return{url:r,...s?{previewUrl:s}:{},...o?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:g("picker.chartDerivedModel","Chart-derived model")}}closeSeatView(e=!0,t=!1){e&&(this.seatViewGeneration+=1);let n=this.seatViewElement;if(this.seatViewDispose?.(),this.seatViewDispose=null,this.seatViewElement=null,!!n){if(this.options.onSeatViewChange?.(null),!t||this.reducedMotion()){n.remove();return}n.classList.add("is-leaving"),setTimeout(()=>n.remove(),190)}}findSeat(e){return this.options.seats().find(t=>t.id===e||t.label===e)}hasStage(){let e=this.options.doc();return e?(e.floors?.flatMap(n=>n.objects)??e.objects).some(n=>n.type==="shape"&&(n.role==="stage"||!!n.stageKind)):!1}prepareHostTheme(e,t){getComputedStyle(e).position==="static"&&(e.style.position="relative");let n=t.theme;e.style.setProperty("--sl-bg",n?.background??"#f6f7fb"),e.style.setProperty("--sl-surface","#ffffff"),e.style.setProperty("--sl-text",n?.textColor??"#10162a"),e.style.setProperty("--sl-muted","#697386"),e.style.setProperty("--sl-line","#d9deea"),e.style.setProperty("--sl-accent",n?.accent??"#ef4056"),e.style.setProperty("--sl-accent-ink",n?.accentInk??"#ffffff")}reducedMotion(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1}};var Gc={host:"web",platform:"web",bundle:"",protocol:0,chromeOwner:"web"},Uc={...Gc},Ki=null,qs=null;function qc(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function Kc(){let i=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:i(qc()),documentMs:Ki==null?0:i(Ki),handshakeMs:Ki==null||qs==null?0:i(qs-Ki)}}function Ks(){let{host:i,platform:e,bundle:t,protocol:n,chromeOwner:o}=Uc,s=Kc();return{host:i,platform:e,...t?{bundle:t}:{},...n?{protocol:n}:{},chromeOwner:o,bootMs:s.bootMs,documentMs:s.documentMs,handshakeMs:s.handshakeMs}}var Ws=new Set;function $e(i){return Ws.has(i)?"repeat":"cold"}function Wi(i){let e=$e(i);return Ws.add(i),e}function fe(i){return typeof i=="number"&&Number.isFinite(i)&&i>=0?Math.round(i):0}function Wc(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function Yc(i){if(!/^[A-Za-z0-9_-]{1,80}$/.test(i.event))return null;let e=i.performanceProfile??{};return{event:i.event,scope:i.scope,surface:i.surface,outcome:i.outcome,stage:i.stage?.slice(0,32)??"",ms:fe(i.ms),api:fe(e.loadChartAndStatuses)||fe(e.loadChart),scene:fe(e.buildScene),panel:fe(e.buildBuyerControls),paint:fe(e.firstPaint),normalize:fe(e.normalizeBuyerModel),renderer:fe(e.createRenderer),seats:fe(i.seats),floors:fe(i.floors),view:i.view??"map",load:i.load??$e(i.event),transport:i.transport??"pubapi",chartBytes:fe(i.chartDelivery?.bytes),chartCache:i.chartDelivery?.cache??"",...Ks(),availabilityMs:fe(e.loadStatuses)}}var Xc=new Set;function Re(i){let e=Yc(i);if(e){for(let t of Xc)try{t(e)}catch{}typeof fetch>"u"||Wc()||fetch(`${i.apiBase.replace(/\/+$/,"")}/pub/telemetry/chart-load`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify(e),credentials:"omit",keepalive:!0}).catch(()=>{})}}function Yi(i){if(!i)return null;let e=i.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function Zc(i){return Yi(i.foot?.querySelector(".sl-total"))??Yi(i.tray)??Yi(i.sheetHead)}function Un(i,e,t,n){let o=i,s=o.map;if(!s||!e)return;let r=s.getBoundingClientRect(),a={x:r.left+e.x,y:r.top+e.y},l=t.displayLabel??t.label,c=n?.find(d=>d.key===t.categoryKey)?.color,h=()=>{let d=Zc(o);d&&As({from:a,to:{x:d.left+d.width/2,y:d.top+d.height/2},label:l,color:c})};o.sheetHead&&Yi(o.sheetHead)?requestAnimationFrame(h):h()}var Gn=60,Qc=650;function Ys(i,e){if(!e.length||i.focusSeats?.(e.map(o=>o.id)))return;let t=e.find(o=>o.sectionId)?.sectionId;if(!t)return;let n=e.filter(o=>o.sectionId===t);i.focus(t,{x:n.reduce((o,s)=>o+s.x,0)/n.length,y:n.reduce((o,s)=>o+s.y,0)/n.length})}function Xs(i,e){let t=!Di();Ys({focusSeats:n=>i.focusSeats?.(n,{animate:t})===!0,focus:(n,o)=>i.focusSection(n,o)},(e?.items??[]).filter(n=>n.objectType!=="ga").slice(0,10).map(n=>i.seatByLabel(n.label)).filter(n=>!!n))}function Zs(i,e){if(!e.length)return;let t=i.reducedMotion===!0;t||e.forEach((r,a)=>{i.schedule(()=>i.pop(r.id),a*Gn)});let n=t?0:e.length*Gn,o=e.find(r=>r.sectionId)?.sectionId;if(i.schedule(()=>Ys(i,e),n),t)return;let s=n+(i.focusSeats||o?Qc:0);e.forEach((r,a)=>{i.schedule(()=>Un(i.regions,i.screenPoint(r),r,i.categories),s+a*Gn)})}function Jc(i,e,t){for(let n of i)if(e>=n.x&&t>=n.y&&e<=n.x+n.w&&t<=n.y+n.h)return!0;return!1}var Xi=class{constructor(){this.rects=[];this.host=null;this.pointers=new Set;this.touches=new Set;this.mouseDown=!1;this.onPointerDown=e=>{this.inside(e.clientX,e.clientY)&&(this.pointers.add(e.pointerId),this.swallow(e))};this.onPointerFollow=e=>{this.pointers.has(e.pointerId)&&this.swallow(e)};this.onPointerEnd=e=>{this.pointers.delete(e.pointerId)&&this.swallow(e)};this.onTouchStart=e=>{let t=this.changed(e);if(!t.length)return;let n=!0;for(let o of t)this.inside(o.clientX,o.clientY)?this.touches.add(o.identifier):n=!1;n&&this.swallow(e)};this.onTouchFollow=e=>{let t=this.changed(e);t.length&&t.every(n=>this.touches.has(n.identifier))&&this.swallow(e)};this.onTouchEnd=e=>{let t=this.changed(e);if(!t.length)return;let n=t.every(o=>this.touches.has(o.identifier));for(let o of t)this.touches.delete(o.identifier);n&&this.swallow(e)};this.onMouseDown=e=>{this.inside(e.clientX,e.clientY)&&(this.mouseDown=!0,this.swallow(e))};this.onMouseFollow=e=>{this.mouseDown&&this.swallow(e)};this.onMouseUp=e=>{this.mouseDown&&(this.mouseDown=!1,this.swallow(e))};this.onClick=e=>{this.inside(e.clientX,e.clientY)&&this.swallow(e)}}set(e){this.rects=e.map(t=>({x:t.x,y:t.y,w:t.w,h:t.h})),this.rects.length||(this.pointers.clear(),this.touches.clear(),this.mouseDown=!1)}get(){return this.rects}attach(e){if(this.host===e)return;this.detach(),this.host=e;let t={capture:!0,passive:!1};e.addEventListener("pointerdown",this.onPointerDown,t),e.addEventListener("pointermove",this.onPointerFollow,t),e.addEventListener("pointerup",this.onPointerEnd,t),e.addEventListener("pointercancel",this.onPointerEnd,t),e.addEventListener("touchstart",this.onTouchStart,t),e.addEventListener("touchmove",this.onTouchFollow,t),e.addEventListener("touchend",this.onTouchEnd,t),e.addEventListener("touchcancel",this.onTouchEnd,t),e.addEventListener("mousedown",this.onMouseDown,t),e.addEventListener("mousemove",this.onMouseFollow,t),e.addEventListener("mouseup",this.onMouseUp,t),e.addEventListener("click",this.onClick,t),e.addEventListener("dblclick",this.onClick,t)}detach(){let e=this.host;if(!e)return;let t={capture:!0};e.removeEventListener("pointerdown",this.onPointerDown,t),e.removeEventListener("pointermove",this.onPointerFollow,t),e.removeEventListener("pointerup",this.onPointerEnd,t),e.removeEventListener("pointercancel",this.onPointerEnd,t),e.removeEventListener("touchstart",this.onTouchStart,t),e.removeEventListener("touchmove",this.onTouchFollow,t),e.removeEventListener("touchend",this.onTouchEnd,t),e.removeEventListener("touchcancel",this.onTouchEnd,t),e.removeEventListener("mousedown",this.onMouseDown,t),e.removeEventListener("mousemove",this.onMouseFollow,t),e.removeEventListener("mouseup",this.onMouseUp,t),e.removeEventListener("click",this.onClick,t),e.removeEventListener("dblclick",this.onClick,t),this.host=null,this.pointers.clear(),this.touches.clear(),this.mouseDown=!1}inside(e,t){if(!this.rects.length||!this.host)return!1;let n=this.host.getBoundingClientRect();return Jc(this.rects,e-n.left,t-n.top)}swallow(e){e.stopImmediatePropagation(),e.stopPropagation(),e.cancelable&&e.preventDefault()}changed(e){let t=e.changedTouches;return t?Array.from(t):[]}},Qs=.48,ed=8;function td(i,e,t,n=Qs){let o=Math.max(0,t.top),s=e.height-Math.max(0,t.bottom);if(!(s>o))return 0;let r=Number.isFinite(n)?Math.min(1,Math.max(0,n)):Qs,a=o+(s-o)*r-i;return Math.abs(a)<=ed?0:Math.round(a)}function Js(i,e,t={}){let n=i.gestureCount();if(t.gestures!==void 0&&t.gestures!==n)return{dy:0,gestures:n};let o=i.seatPoint(e);if(!o)return{dy:0,gestures:n};let s=td(o.y,{height:i.mapHeight()},i.insets(),t.fraction);return s?{dy:i.panScreenBy({x:0,y:s},t.animate!==!1)?s:0,gestures:n}:{dy:0,gestures:n}}var oi=class i{constructor(e,t=null){this.seams=e;this.watch=null;this.mode=t,this.watchMode()}themeMode(){return this.mode}setThemeMode(e,t){let n=t!==void 0&&"mapTheme"in t;e===this.mode&&!n||(n&&this.seams.setHostMapTheme(t.mapTheme??void 0),this.mode=e,this.watchMode(),this.applyThemeMode())}static groundFor(e){return kt(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??i.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=Ri(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};var tr=require("@seatlayer/core"),ir=require("@seatlayer/core/core/seatConfidence");var er=require("@seatlayer/core");function Ot(i){let e=i.viewMeta?.previewUrl??i.viewUrl;return e&&(jn(e)||wt(e))?e:null}function Qi(i){if(!i)return!1;let e=i.floors?.length?i.floors.map(t=>t.objects??[]):[i.objects??[]];for(let t of e)for(let n of t)if(n.type==="shape"&&(n.role==="stage"||n.stageKind))return!0;return!1}var id=512,Zi=new Map;function Ji(i,e){if(!e)return null;let t=`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`,n=Zi.get(t);if(n!==void 0)return n;let o=null;try{o=(0,er.generateSeatThumb)(i,e).distanceM??null}catch{o=null}return Zi.size>=id&&Zi.clear(),Zi.set(t,o),o}function si(i){return i.getFocusedSection()!==null||i.seatsRevealed()}function nd(i){let e=i.atVenueFit?.(),t=i.canZoomIn?.();return{...typeof e=="boolean"?{atVenueFit:e}:{},...typeof t=="boolean"?{canZoomIn:t}:{}}}function od(i,e){return{accessibilityFilter:i.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function sd(i,e,t,n){for(let o of e){if(o.count<=0)continue;let s=i.accessibilitySpread?.([o.key]);for(let r of s?.sections??[]){let a=t.get(r.id)??n.get(r.id);if(!a||r.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[o.key]=r.free}}}function nr(i,e,t){let n=i.doc,o=n?.theme??{},s=i.categoryAvailability(),r=i.getGAAreas(),a=i.getFloors(),l=i.getExpandedSeats(),c=i.getAccessNeeds(),h=od(c,l),d=e.seatPosition,u=d.targetSeatId?i.seatDetails(d.targetSeatId):null,p=new Map(l.map(v=>[v.id,v])),f=Qi(n),b=n?.floors?.flatMap(v=>v.objects)??n?.objects??[],k=new Map,x=new Map;for(let v of b){if(v.type!=="section")continue;let A={id:v.id,label:v.label,...v.displayLabel?{displayLabel:v.displayLabel}:{},...v.zone?{zoneId:v.zone}:{}};k.set(v.id,A);let y=v.logicalSectionId??v.id;x.has(y)||x.set(y,A)}return sd(i,c,k,x),{event:{key:t.event,name:t.eventInfo?.name??n?.name??t.event,venue:t.eventInfo?.venue??null,startsAt:t.eventInfo?.startsAt??null,timezone:t.eventInfo?.timezone??null,currency:t.eventInfo?.currency??t.currency??"USD",locale:(0,tr.getLocale)()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...o.accent?{accent:o.accent}:{},...o.accentInk?{accentInk:o.accentInk}:{},...o.background?{background:o.background}:{},...o.textColor?{textColor:o.textColor}:{},...o.brandName?{brandName:o.brandName}:{},...o.logoUrl?{logoUrl:o.logoUrl}:{},attributionRequired:!o.hideBadge},features:{ga:r.length>0,tiers:!!n?.categories.some(v=>v.tiers?.length),floors:a.length>1,zones:!!n?.zones?.length,sections:k.size>0,bestAvailable:!0,...h,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(n?.categories??[]).filter(v=>!v.notForSale).map(v=>({key:v.key,label:v.label,color:v.color,price:v.price??v.tiers?.[0]?.price??0,available:s[v.key]??0,...Object.prototype.hasOwnProperty.call(s,v.key)?{free:s[v.key]}:{},tiers:(v.tiers??[]).map(A=>({id:A.id,name:A.name,price:A.price,...A.currency?{currency:A.currency}:{}}))})),zones:(n?.zones??[]).map(v=>({id:v.id,label:v.label,...v.color?{color:v.color}:{}})),sections:[...k.values()],gaAreas:r,bestAvailableZones:i.getBestAvailableZones()},map:{floors:a,activeFloorId:i.getActiveFloorId()||a[0]?.id||null,floorMode:i.isFloorOverview()?"all":"single",floorLabelStyle:i.getRenderer()?.getFloorLabelStyle?.()??"number",rung:i.getRung(),canZoomOut:si(i)||t.focusedSection_!==null,...nd(i),focusedSectionId:i.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:i.getViewMode(),buyerView:e.buyerView,view3dTargetSeatId:d.targetSeatId,view3dTargetSeat:u,view3dPreviousSeatId:d.previousSeatId,view3dNextSeatId:d.nextSeatId,view3dFocusedSectionId:e.focusedSectionId,view3dNavigationMode:e.navigationMode,colorblindSafe:t.colorblindSafe_,viewportInsets:i.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:c},selection:{seats:i.getSelection().map(v=>{let A=p.get(v.id);if(!A)return v;let y=i.worldToScreen({x:A.x,y:A.y}),H=Ot(A),C=f?Ji(A,A.focalPoint??n?.focalPoint):null;return{...v,screenPoint:{x:y.x,y:y.y},...H?{seatViewThumb:{reference:H,kind:"real"}}:{},...C!=null?{sightlineMetres:C}:{},...A.confidenceEvidence?{seatViewConfidence:(0,ir.seatConfidenceDisclosure)(A.confidenceEvidence)}:{}}}),validity:i.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var rd="https://api.seatlayer.io",or=10;function ad(i){if(typeof i=="string"){let e=document.querySelector(i);if(!e)throw new Error(`seatmap: container "${i}" not found`);return e}if(!(i instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return i}var en=class{constructor(e){this.mount=null;this.hostEl=null;this.interactionEnabled_=!0;this.eventLocale=null;this.localeGeneration=0;this.languageSelect=null;this.rendered=!1;this.mode_=null;this.eventInfo=null;this.categoryFilter_=null;this.accessibilityFilter_=null;this.hideLimitedView_=!1;this.focusedSection_=null;this.lastReportedViewRung_=null;this.lastReportedCanZoomOut_=!1;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.blockedRegions=null;this.realtime=null;this.holdingLabels=new Set;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.container)throw new Error("seatmap: `container` is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");this.opts=e,this.maxSelection_=e.maxSelection??or,this.colorblindSafe_=e.colorblindSafe??!1;let t=!!(e.buyerAccessTokenProvider||e.buyerAccessToken||e.publicKey);this.accessState_={configured:t,status:t?"ready":"public"},this.publicKey=e.publicKey;let n={onExpired:a=>{this.accessState_={configured:!0,status:a.refreshed?"ready":"expired"},this.opts.onAccessExpired?.(a),this.notifyMapStateChange()},onUnavailable:a=>{this.accessState_={configured:!0,status:"unavailable",reason:a.reason},this.opts.onAccessUnavailable?.(a),this.notifyMapStateChange()}},o=(e.apiBase??rd).replace(/\/+$/,"");this.apiBase=o;let s=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?Ni({base:o,event:e.event,publicKey:e.publicKey,accessHooks:n,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=s?.access??Lt(e,n);let r=s?.api??new Be(o,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=r,this.controller=new j.PickerController({transport:r,eventKey:e.event,maxSelection:this.maxSelection_,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,onSelectionChange:a=>{this.immersive?.pushLiveState(),this.opts.onSelectionChange?.(a)},onSelectionValidityChange:a=>this.opts.onSelectionValidityChange?.(a),onSelectionValid:a=>this.opts.onSelectionValid?.(a),onSelectionInvalid:a=>this.opts.onSelectionInvalid?.(a),onDeselect:a=>{this.controller.currentHold()?.labels.includes(a.label)&&this.controller.releaseLabels([a.label])},retapKeepsSelection:!0,onSeatRetap:a=>this.opts.onSeatRetap?.(a),onSelectionLimit:a=>this.opts.onSelectionLimit?.(a),onHold:a=>this.opts.onHold?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldRestored:a=>this.opts.onHoldRestored?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:a=>{let l=this.controller.getGAAreas().find(c=>c.id===a);l&&(this.opts.onGAClick?.(l),this.opts.onGAPrompt?.({area:l,selected:{},min:0,max:Math.max(0,Math.min(l.available,(this.opts.maxSelection??or)-this.controller.getSelection().length)),tiers:Vi(l),confirm:c=>{let h=typeof c=="number"?c:Object.values(c).reduce((d,u)=>d+u,0);this.holdGA(l.id,h)},cancel:()=>{}}))},onError:a=>this.opts.onError?.(a),onDeckTap:a=>{this.opts.onDeckTap?.(a),this.notifyMapStateChange()},onHint:a=>this.opts.onHint?.(a),onSectionFocus:a=>{this.focusedSection_=a,this.opts.onSectionFocus?.(a),this.notifyMapStateChange()},onViewChange:()=>this.handleViewChange(),onStatusChange:()=>{this.immersive?.pushLiveState(),this.opts.onStatusChange?.()},onSalesClosed:()=>{this.eventInfo&&(this.eventInfo.salesClosed=!0),this.opts.onSalesClosed?.()},flashOnLiveChange:!0,onSeatHover:a=>{this.opts.onSeatHover?.(a),this.opts.seatTooltip!==!1&&this.updateTooltip(a)},colorblindSafe:e.colorblindSafe,mapTheme:e.mapTheme??oi.groundFor(e.theme?.mode)??null}),this.hostSurface=new oi({mapTheme:()=>this.opts.mapTheme,setHostMapTheme:a=>{this.opts.mapTheme=a},applyMapTheme:a=>this.controller.setMapTheme(a),applyViewportInsets:a=>this.controller.setViewportInsets(a),readViewportInsets:()=>this.controller.getViewportInsets(),changed:()=>this.notifyMapStateChange()},e.theme?.mode??null),this.buyerAssetUrls=new Rt(e.event,(a,l)=>r.asset(a,l)),this.immersive=new Ui({host:()=>this.hostEl,doc:()=>this.controller.doc,seats:()=>this.controller.getExpandedSeats(),selection:()=>this.controller.getSelection(),status:a=>this.controller.getStatus(a),select:a=>this.controller.select([a]),deselect:a=>this.controller.deselect([a]),loadEventConfiguration:()=>this.controller.loadEventConfiguration(),resolveAsset:a=>this.buyerAssetUrls.resolve(a),enable3D:e.enable3D!==!1,enableSeatView:e.enableSeatView!==!1,max3DSeats:e.max3DSeats,...e.chrome?{chrome:e.chrome}:{},restoreMap:()=>this.controller.refitCurrentView(),onViewChange:(a,l)=>{this.opts.onBuyerViewChange?.({view:a,...l?{seatId:l}:{}}),this.notifyMapStateChange()},onSeatViewChange:a=>this.opts.onSeatViewChange?.(a),onError:a=>this.opts.onError?.(a)}),this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=si(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=si(this.controller);e===this.lastReportedViewRung_&&t===this.lastReportedCanZoomOut_||(this.lastReportedViewRung_=e,this.lastReportedCanZoomOut_=t,this.opts.onMapStateChange?.())}notifyMapStateChange(){this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=si(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=Ii(this.opts.locale,this.opts.messages),n=this.localeGeneration+=1,o=(0,j.getLocale)();this.mount=ad(this.opts.container);let s=document.createElement("div");s.style.width="100%",s.style.height="100%",s.style.position="relative",this.mount.appendChild(s),this.hostEl=s,this.blockedRegions?.attach(s),Oi(s,t,a=>{a!==o&&this.applyActiveLocale(a,n)}),this.applyInteractionState();let r=await this.controller.render(s);if(!r)return Re({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:$e(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(s),this;if(this.eventLocale=r.locale??null,!this.opts.locale&&this.eventLocale&&this.setLocale(this.eventLocale),this.buildLanguageSwitcher(s),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=r.mode==="test"?"test":"live",this.eventInfo={name:r.eventName,venue:r.venue??null,startsAt:r.startsAt??null,timezone:r.timezone??null,currency:r.currency??this.opts.currency??"USD",posterUrl:r.posterUrl??null,salesClosed:r.salesClosed},this.opts.seatTooltip!==!1){let a=document.createElement("div");a.setAttribute("role","tooltip"),a.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);',s.appendChild(a),this.tipEl=a,this.onTipMove=l=>{let c=s.getBoundingClientRect();this.tipPos={x:l.clientX-c.left,y:l.clientY-c.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},s.addEventListener("mousemove",this.onTipMove)}if(r.mode==="test"&&this.opts.showTestModeIndicator!==!1){s.style.overflow="hidden";let a=document.createElement("div");a.dataset.slI18n="testMode",a.textContent=(0,j.t)("picker.testMode"),a.setAttribute("aria-label",(0,j.t)("picker.testMode")),a.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;",s.appendChild(a)}return this.buildBadge(s),Re({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:r.performanceProfile,chartDelivery:r.chartDelivery,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:Wi(this.opts.event),transport:"pubapi"}),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,j.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);';let n=document.createElement("span");n.setAttribute("aria-hidden","true"),n.style.cssText="width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee",n.innerHTML=zi;let o=document.createElement("span");o.textContent=(0,j.t)("picker.poweredBy"),t.append(n,o),e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,n=this.tipEl.offsetHeight,o=this.tipPos.x+14,s=this.tipPos.y-n-12;o+t>e-8&&(o=this.tipPos.x-t-14),s<8&&(s=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,o)}px`,this.tipEl.style.top=`${Math.max(8,s)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=(0,j.formatMoney)(e.price,e.currency,{...Number.isInteger(e.price)?{minimumFractionDigits:0,maximumFractionDigits:0}:{},locale:this.opts.locale,fallback:(l,c)=>`${l} ${c}`}),n=document.createElement("div");n.style.cssText="font-weight:700;font-size:13px",n.textContent=e.label;let o=document.createElement("div");o.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let s=document.createElement("span");s.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",s.style.background=e.categoryColor;let r=document.createElement("span");r.textContent=e.categoryLabel;let a=document.createElement("span");if(a.style.cssText="margin-left:auto;font-weight:700;color:#fff",a.textContent=t,o.append(s,r,a),this.tipEl.replaceChildren(n,o),e.status!=="free"){let l=document.createElement("div");l.style.cssText="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700",l.textContent=e.status==="held"?(0,j.t)("map.statusHeld"):(0,j.t)("map.statusTaken"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(o=>(0,j.resolveLocale)(o)).filter((o,s,r)=>r.indexOf(o)===s);if(t.length<2)return;let n=document.createElement("select");n.setAttribute("aria-label",(0,j.t)("picker.preferredTicketType")),n.style.cssText='position:absolute;bottom:10px;left:12px;z-index:5;appearance:none;padding:5px 9px;border-radius:999px;border:0;cursor:pointer;background:rgba(255,255,255,.92);color:#4a5163;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 2px 8px rgba(0,0,0,.12);';for(let o of t){let s=document.createElement("option");s.value=o,s.textContent=j.LOCALE_NAMES[o]??o,s.selected=o===(0,j.getLocale)(),n.appendChild(s)}n.addEventListener("change",()=>{this.setLocale(n.value)}),e.appendChild(n),this.languageSelect=n}async setLocale(e){let t=(0,j.getLocale)(),n=this.localeGeneration+=1,o=await(0,j.loadLocale)(e);return this.opts.messages&&(0,j.setStringOverrides)(this.opts.messages),o===t||this.applyActiveLocale(o,n),o}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let n=this.hostEl;if(n){n.lang=e,n.dir=(0,j.localeDirection)(e);for(let o of n.querySelectorAll("[data-sl-i18n]"))if(o.dataset.slI18n==="testMode")o.textContent=(0,j.t)("picker.testMode"),o.setAttribute("aria-label",(0,j.t)("picker.testMode"));else if(o.dataset.slI18n==="badge"){o.setAttribute("aria-label",(0,j.t)("picker.poweredBy"));let s=o.querySelector("span:last-child");s&&(s.textContent=(0,j.t)("picker.poweredBy"))}this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy()}}getMode(){return this.mode_}getPickerState(){return nr(this.controller,this.immersive,{event:this.opts.event,currency:this.opts.currency,mode_:this.mode_,eventInfo:this.eventInfo,eventLocale:this.eventLocale,focusedSection_:this.focusedSection_,colorblindSafe_:this.colorblindSafe_,categoryFilter_:this.categoryFilter_,accessibilityFilter_:this.accessibilityFilter_,hideLimitedView_:this.hideLimitedView_,maxSelection_:this.maxSelection_,accessState_:this.accessState_})}getCategoryAvailability(){return this.controller.categoryAvailability()}getBestAvailableZones(){return this.controller.getBestAvailableZones()}getActiveFloorId(){return this.controller.getActiveFloorId()||null}getRung(){return this.controller.getRung()}getFocusedSection(){return this.controller.getFocusedSection()}focusSection(e){if(this.immersive.buyerView==="venue3d"&&this.immersive.focusSection(e)){this.notifyMapStateChange();return}this.controller.focusSection(e),this.notifyMapStateChange()}overview(){if(this.immersive.focusOverview()){this.notifyMapStateChange();return}this.controller.overview(),this.notifyMapStateChange()}setRung(e){this.controller.setRung(e),this.notifyMapStateChange()}setCategoryFilter(e,t=!1){this.categoryFilter_=e?[...e]:null,this.controller.setCategoryFilter(e),t&&this.controller.focusCategoryFilter(e),this.notifyMapStateChange()}setAccessibilityFilter(e){this.accessibilityFilter_=e?[...e]:null,this.controller.setAccessibilityFilter(e),this.notifyMapStateChange(),e?.length&&this.focusAccessibilityFilter()}focusAccessibilityFilter(){this.controller.focusAccessibilityFilter?.(),this.notifyMapStateChange()}focusNextAccessibleSection(e){let t=this.controller.focusNextAccessibleSection?.(e)??null;return t&&this.notifyMapStateChange(),t}setCommercialLimitedFilter(e){this.hideLimitedView_=e,this.controller.setCommercialLimitedFilter(e),this.notifyMapStateChange()}getSelection(){return this.controller.getSelection()}selectObjects(e){let t=this.controller.select(e);return this.immersive.pushLiveState(),t}deselectObjects(e){this.controller.deselect(e),this.immersive.pushLiveState()}clearSelection(){this.controller.clearSelection(),this.immersive.pushLiveState()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxSelection_=e,this.controller.setMaxSelection(e),this.notifyMapStateChange()}getSelectionValidity(){return this.controller.getSelectionValidity()}async hold(e={}){try{return await this.holdOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async holdOrThrow(e={}){let t=this.controller.getSelectionValidity();if(t&&!t.isValid){let n=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(n?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:n?"selection_count_mismatch":"selection_invalid",selection:t})}this.holdingLabels=new Set(this.controller.getSelection().map(n=>n.label));try{let n=await this.controller.hold(void 0,e.ttlMs);return n?{holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items}:null}finally{this.holdingLabels.clear()}}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}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,n={}){try{return await this.holdGAOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async holdGAOrThrow(e,t,n={}){let o=await this.controller.holdGA(e,t,n);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}async bestAvailable(e,t,n={}){try{return await this.bestAvailableOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async bestAvailableOrThrow(e,t,n={}){let o=await this.controller.bestAvailable(e,t,n);return Xs(this.controller,o),o?{holdId:o.holdId,expiresAt:o.expiresAt,labels:o.labels,seats:o.seats,items:o.items,...n.zoneId?{zoneId:n.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}setTableQuantity(e,t){return this.controller.setTableQuantity(e,t)}async replaceTableQuantity(e,t,n){try{return await this.replaceTableQuantityOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async replaceTableQuantityOrThrow(e,t,n){let o=await this.controller.replaceTableQuantity(e,t,n);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}getFloors(){return this.controller.getFloors()}setFloor(e){if(this.immersive.buyerView==="venue3d"&&e!=="all"&&this.immersive.focusFloor(e)){this.notifyMapStateChange();return}if(this.controller.getFloors().length<=1){console.warn("seatmap: setFloor() ignored \u2014 this chart has a single floor");return}e==="all"?this.controller.setFloorOverview(!0):this.controller.setFloor(e),this.notifyMapStateChange()}setFloorLabelStyle(e){this.controller.getRenderer()?.setFloorLabelStyle?.(e),this.notifyMapStateChange()}setSectionFocusDim(e){this.controller.setSectionFocusDim(e)}setSelectionFocus(e){this.controller.setSelectionFocus(e)}setBlockedRegions(e){if(!this.blockedRegions){if(!e.length)return;this.blockedRegions=new Xi,this.hostEl&&this.blockedRegions.attach(this.hostEl)}this.blockedRegions.set(e)}getBlockedRegions(){return this.blockedRegions?.get()??[]}frameSeat(e,t={}){let n=this.controller.getRenderer();return Js({seatPoint:o=>{let s=this.controller.getExpandedSeats().find(r=>r.id===o);return s?this.controller.worldToScreen({x:s.x,y:s.y}):null},mapHeight:()=>this.hostEl?.clientHeight??0,insets:()=>this.controller.getViewportInsets(),gestureCount:()=>n?.getCameraGestureCount?.()??0,panScreenBy:(o,s)=>n?.panScreenBy?(n.panScreenBy(o,{animate:s}),!0):!1},e,t)}setColorblindSafe(e){this.colorblindSafe_=e,this.controller.setColorblindSafe(e),this.notifyMapStateChange()}setViewMode(e){this.controller.setViewMode(e),this.notifyMapStateChange()}getViewMode(){return this.controller.getViewMode()}zoomIn(){this.immersive.zoomIn()||(this.controller.zoomIn(),this.notifyMapStateChange())}zoomOut(){this.immersive.zoomOut()||(this.controller.zoomOut(),this.notifyMapStateChange())}zoomToFit(){this.immersive.focusOverview()||(this.controller.zoomToFit(),this.notifyMapStateChange())}setThemeMode(e,t){this.hostSurface.setThemeMode(e,t)}getThemeMode(){return this.hostSurface.themeMode()}setViewportInsets(e){this.hostSurface.setViewportInsets(e)}getViewportInsets(){return this.hostSurface.viewportInsets()}setBuyerView(e,t){return this.immersive.setBuyerView(e,t)}getBuyerView(){return this.immersive.buyerView}openSeatView(e){return this.immersive.openSeatView(e)}setVenue3DNavigationMode(e){if(!this.immersive.setNavigationMode(e))throw new Error("venue_3d_not_active")}setInteractionEnabled(e){this.interactionEnabled_=e,this.applyInteractionState()}applyInteractionState(){let e=this.hostEl;e&&(e.style.pointerEvents=this.interactionEnabled_?"":"none",e.toggleAttribute("inert",!this.interactionEnabled_),this.interactionEnabled_?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true"))}async release(){await this.controller.release()}async releaseLabels(e){return this.controller.releaseLabels(e)}startRealtime(){!this.access?.configured||this.realtime||(this.realtime=new ke({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:vt(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.immersive.pushLiveState(),this.opts.onStatusChange?.()},onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAvailability(){let e=await this.controller.refreshAvailability();return this.immersive.pushLiveState(),this.opts.onStatusChange?.(),e.lost.length&&this.opts.onSelectedObjectUnavailable?.({labels:e.lost,reason:"taken"}),this.notifyMapStateChange(),e}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(this.accessState_={configured:!0,status:"ready"},await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),this.notifyMapStateChange(),e}showLoadFailure(e){let t=document.createElement("div");t.setAttribute("role","status"),t.style.cssText='display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;min-height:180px;box-sizing:border-box;padding:24px;text-align:center;font:500 14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#3b4256;';let n=document.createElement("div");n.textContent="The seat map didn\u2019t load.",t.appendChild(n);let o=document.createElement("button");o.type="button",o.textContent="Try again",o.style.cssText="appearance:none;border:1px solid #c9cede;background:#fff;color:#10162a;border-radius:8px;padding:8px 16px;font:600 13px/1 inherit;cursor:pointer;",o.addEventListener("click",()=>{this.destroy(),this.render().catch(s=>this.opts.onError?.(s))}),t.appendChild(o),e.appendChild(t)}destroy(){this.blockedRegions?.detach(),this.hostSurface.dispose(),this.immersive.destroy(),this.buyerAssetUrls.dispose(),this.realtime?.stop(),this.realtime=null,this.access?.clear(),this.hostEl&&this.onTipMove&&this.hostEl.removeEventListener("mousemove",this.onTipMove),this.tipEl=null,this.onTipMove=null,this.languageSelect=null,this.controller.destroy(),this.hostEl&&this.hostEl.parentNode&&this.hostEl.parentNode.removeChild(this.hostEl),this.hostEl=null,this.mount=null,this.rendered=!1,this.mode_=null,this.eventInfo=null,this.focusedSection_=null}};var qn=["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"],ld={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 sr(i){let e={};for(let t of qn)e[t]=(...n)=>{let o=i();return o?o[t](...n):ld[t]()};return e}var Kn=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],Wn=[...Kn,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],Yn=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function rr(i,e,t){let n={container:i};for(let o of Wn)n[o]=e[o];for(let o of Yn)n[o]=t[o];return n}var cd=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),dd=2e4,pd=480,hd=180*1e3,ud=900*1e3,md=.8,fd=30*1e3,gd=1e5,bd=4,yd=50;function Xn(i){if(typeof i!="string")return i;let e=document.querySelector(i);if(!e)throw new Error(`EmbeddedDesigner container not found: ${i}`);return e}function vd(i){let e=(i??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var wd={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."}},tn=class{constructor(e){this.frame=null;this.designerOrigin="";this.overlay=null;this.timeoutTimer=null;this.renewTimer=null;this.autoRecoverUsed=!1;this.phase="loading";this.identityEstablished=!1;this.restoreContainerPosition=null;this.pinned=!1;this.frameStyleBeforeFs=null;this.docOverflowBeforeFs=null;this.bodyOverflowBeforeFs=null;this.fsKeyHandler=null;this.lastAutoHeight="";this.fillRaf=null;this.reprobeRaf=null;this.fillListening=!1;this.containerEl=null;this.fillMode=null;this.resizeObs=null;this.scheduleFill=()=>{this.fillRaf===null&&(this.fillRaf=requestAnimationFrame(()=>{this.fillRaf=null,this.applyFill()}))};this.scheduleReprobe=()=>{this.reprobeRaf===null&&(this.reprobeRaf=requestAnimationFrame(()=>{this.reprobeRaf=null,!this.pinned&&(this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill())}))};this.handleMessage=e=>{if(!this.frame||e.origin!==this.designerOrigin||e.source!==this.frame.contentWindow||!e.data||typeof e.data!="object")return;let t=e.data;if(t.type==="seatlayer.designer.handshake"&&typeof t.nonce=="string"&&t.nonce.length<=128){this.frame.contentWindow?.postMessage({type:"seatlayer.designer.parent",nonce:t.nonce},this.designerOrigin);return}if(t.type==="seatlayer.designer.resize"){!this.fillEnabled()&&this.autoResizeEnabled()&&typeof t.px=="number"&&Number.isFinite(t.px)&&t.px>0&&(this.lastAutoHeight=`${Math.round(t.px)}px`,this.pinned||this.setFrameHeight(this.lastAutoHeight));return}if(t.type==="seatlayer.designer.fullscreen"){t.on===!0?this.pinFullscreen():t.on===!1&&this.unpinFullscreen();return}if(typeof t.type!="string"||!cd.has(t.type))return;let n={type:t.type,chartId:typeof t.chartId=="string"?t.chartId:void 0,workspaceId:typeof t.workspaceId=="string"?t.workspaceId:void 0,expiresAt:typeof t.expiresAt=="number"?t.expiresAt:void 0,code:typeof t.code=="string"?t.code:void 0,message:typeof t.message=="string"?t.message:void 0,meta:t.meta,fatal:typeof t.fatal=="boolean"?t.fatal:void 0,action:typeof t.action=="string"?t.action:void 0},o=this.identityEstablished||n.type==="seatlayer.designer.ready"||n.type==="seatlayer.designer.saved"||n.type==="seatlayer.designer.published"||n.type==="seatlayer.designer.close",s=this.options.expectedChartId!==void 0&&n.chartId!==this.options.expectedChartId&&(o||n.chartId!==void 0),r=this.options.expectedWorkspaceId!==void 0&&n.workspaceId!==this.options.expectedWorkspaceId&&(o||n.workspaceId!==void 0);if(s||r){this.showError("mismatch");return}switch(n.type){case"seatlayer.designer.ready":this.identityEstablished=!0,this.sessionExpiresAt=n.expiresAt,this.phase="ready",this.clearTimeoutTimer(),this.removeOverlay(),this.autoRecoverUsed=!1,this.scheduleRenewal(n.expiresAt),this.options.onReady?.(n);break;case"seatlayer.designer.saved":this.options.onSaved?.(n);break;case"seatlayer.designer.published":this.options.onPublished?.(n);break;case"seatlayer.designer.close":this.options.onClose?.(n);break;case"seatlayer.designer.error":{let a=vd(n.code);if(a==="expired"&&this.autoRenewEnabled()&&!this.autoRecoverUsed){this.autoRecoverUsed=!0,this.clearRenewTimer(),this.options.onRequestRelaunch();return}(typeof n.fatal=="boolean"?n.fatal:a!=="load"||this.phase!=="ready")&&this.showError(a),this.options.onError?.(n);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 n=Xn(this.options.container);if(this.containerEl=n,window.addEventListener("message",this.handleMessage),n.append(t),this.frame=t,this.fillEnabled()&&this.startFill(),this.phase="loading",this.loadingStateEnabled()){this.ensureContainerPositioned(n),this.renderOverlay(n,"loading");let o=this.options.loadingTimeoutMs??dd;o>0&&Number.isFinite(o)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},o))}return t}setDesignerUrl(e){return this.options={...this.options,designerUrl:e},this.mount()}getIframe(){return this.frame}setSizing(e,t){this.options={...this.options,height:e,minHeight:t},this.frame&&(this.stopFill(),this.lastAutoHeight="",this.fillEnabled()?(this.pinned||this.setFrameHeight("100%"),this.startFill()):this.pinned||this.setFrameHeight(`${e}px`))}setRelaunchPolicy(e,t){this.options={...this.options,onRequestRelaunch:e,autoRenewSession:t},this.clearRenewTimer(),this.phase==="ready"&&this.scheduleRenewal(this.sessionExpiresAt)}destroy(){window.removeEventListener("message",this.handleMessage),this.stopFill(),this.unpinFullscreen(),this.clearTimeoutTimer(),this.clearRenewTimer(),this.removeOverlay(),this.restoreContainerStyle(),this.frame?.remove(),this.frame=null,this.containerEl=null,this.fillMode=null,this.designerOrigin="",this.phase="loading",this.identityEstablished=!1,this.sessionExpiresAt=void 0,this.lastAutoHeight=""}loadingStateEnabled(){return this.options.showLoadingState!==!1}autoResizeEnabled(){return this.options.autoResize!==!1}fillEnabled(){return typeof this.options.height!="number"}setFrameHeight(e){this.frame?.style.setProperty("height",e,"important")}detectFillMode(){let e=this.containerEl,t=this.frame;if(this.pinned||!e||!t)return this.fillMode??"viewport";let n=()=>e.getBoundingClientRect().height,o=t.style.getPropertyValue("height"),s=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let r=n();t.style.setProperty("height",`${gd}px`,"important");let a=n();return o?t.style.setProperty("height",o,s):t.style.removeProperty("height"),!(a-r>bd)&&r>=yd?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??pd;if(this.fillMode==="container"&&this.containerEl){let o=Math.max(e,Math.round(this.containerEl.getBoundingClientRect().height));this.setFrameHeight(`${o}px`);return}let t=this.frame.getBoundingClientRect().top,n=Math.max(e,Math.round(window.innerHeight-t));this.setFrameHeight(`${n}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[n,o]of Object.entries(e))this.frame.style.setProperty(n,o,"important");let t=document.documentElement;this.docOverflowBeforeFs=t.style.overflow,t.style.overflow="hidden",document.body&&(this.bodyOverflowBeforeFs=document.body.style.overflow,document.body.style.overflow="hidden"),this.fsKeyHandler=n=>{n.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 n=t<ud?t*md:t-hd,o=Math.max(fd,n);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},o)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{Xn(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=Xn(this.options.container)}catch{return}this.renderOverlay(t,"error",e)}handleTryAgain(){if(this.options.onRequestRelaunch){this.options.onRequestRelaunch();return}this.mount()}renderOverlay(e,t,n){this.removeOverlay();let o=document.createElement("div");o.setAttribute("data-seatlayer-designer-overlay",t),o.setAttribute("role",t==="error"?"alert":"status"),o.setAttribute("aria-live","polite"),Object.assign(o.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:"#101625",color:"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:"hidden"}),t==="loading"?this.buildSkeleton(o):this.buildErrorCard(o,n??"load"),e.append(o),this.overlay=o}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
|
|
3134
|
+
`;function It(){if(document.getElementById(zs))return;let i=document.createElement("style");i.id=zs,i.textContent=Bc+Fs+Bs+_s+Vs+Ds+Ns+vs,document.head.appendChild(i)}async function zi(i,e){let t=i.overlay.productionElements;if(!t?.some(o=>o.contentImageUrl))return i;let n=await Promise.all(t.map(async o=>{if(!o.contentImageUrl)return o;try{let s=await e(o.contentImageUrl);if(!s){let{contentImageUrl:r,...a}=o;return a}return{...o,runtimeContentImageUrl:s}}catch{let{contentImageUrl:s,...r}=o;return r}}));return{...i,overlay:{...i.overlay,productionElements:n}}}async function $i(i,e){if(i)try{let t=await e(i);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}var $e=require("@seatlayer/core/view/panoramaDelivery");function ji(i){let{root:e,source:t,caption:n,real:o,closeLabel:s,dragHint:r,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:h,onClose:d}=i,u=i.chrome??{},p=document.createElement("div");p.className="sl-view sl-mo-zoom",p.setAttribute("role","dialog"),p.setAttribute("aria-label",a),p.innerHTML='<div class="sl-view-head"><span class="sl-view-title"></span><span class="sl-view-cap"></span><button type="button" class="sl-view-x"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div><div class="sl-view-pano"><span class="sl-view-badge"></span><span class="sl-view-hint"></span></div>';let g=H=>p.querySelector(H)?.remove();u.title===!1?g(".sl-view-title"):p.querySelector(".sl-view-title").textContent=a,u.caption===!1?g(".sl-view-cap"):p.querySelector(".sl-view-cap").textContent=n,p.querySelector(".sl-view-x").setAttribute("aria-label",s),u.badge===!1?g(".sl-view-badge"):p.querySelector(".sl-view-badge").textContent=o?l:c,p.querySelector(".sl-view-hint").textContent=r,e.appendChild(p);let y=p.querySelector(".sl-view-pano"),T=(0,$e.planPanoramaDelivery)(t,(0,$e.browserPanoramaConstraints)()),S=new AbortController;y.style.backgroundImage=`url(${JSON.stringify(T.initialUrl)})`;let v=()=>{};T.upgradeUrl&&(v=(0,$e.schedulePanoramaUpgrade)(()=>{h(T.upgradeUrl).then(H=>!H||S.signal.aborted?null:(0,$e.loadPanoramaImage)(H,S.signal).then(()=>H)).then(H=>{!H||!p.isConnected||S.signal.aborted||(y.style.backgroundImage=`url(${JSON.stringify(H)})`)}).catch(()=>{})}));let P=70,B=35,U=1,f=y.clientHeight||1,L=y.clientWidth||1,A=-(f*(180/P)*2/2-L/2),E=0,I=()=>{let H=y.clientHeight||1,bt=H*(180/P)*U,Ze=Math.max(0,bt-H),Wt=Math.min(Ze/2,B/180*bt);E=Math.min(Wt,Math.max(-Wt,E)),y.style.backgroundSize=`auto ${bt}px`,y.style.backgroundPosition=`${A}px ${E-Ze/2}px`};I();let _=!1,N=0,W=0,te=H=>{_=!0,N=H.clientX,W=H.clientY,y.classList.add("drag"),y.setPointerCapture?.(H.pointerId)},Te=H=>{_&&(A+=H.clientX-N,E+=H.clientY-W,N=H.clientX,W=H.clientY,I())},fe=H=>{_=!1,y.classList.remove("drag"),y.releasePointerCapture?.(H.pointerId)},Y=H=>{H.preventDefault(),U=Math.min(2.4,Math.max(1,U+(H.deltaY<0?.12:-.12))),I()};y.addEventListener("pointerdown",te),y.addEventListener("pointermove",Te),y.addEventListener("pointerup",fe),y.addEventListener("pointercancel",fe),y.addEventListener("wheel",Y,{passive:!1});let V=p.querySelector(".sl-view-x");V.addEventListener("click",d);let X=H=>{H.key==="Escape"&&(H.stopPropagation(),d())};return p.addEventListener("keydown",X),V.focus(),{element:p,dispose(){v(),S.abort(),y.removeEventListener("pointerdown",te),y.removeEventListener("pointermove",Te),y.removeEventListener("pointerup",fe),y.removeEventListener("pointercancel",fe),y.removeEventListener("wheel",Y),p.removeEventListener("keydown",X),V.removeEventListener("click",d)}}}function Fc(i,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=i.find(s=>s.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let n=i.filter(s=>s.rowId===t.rowId),o=n.findIndex(s=>s.id===e);return{targetSeatId:e,previousSeatId:o>0?n[o-1].id:null,nextSeatId:o>=0&&o+1<n.length?n[o+1].id:null}}var $s=6e4,Gi=class{constructor(e){this.buyerView_="map";this.targetSeatId_=null;this.focusedSectionId_=null;this.navigationMode_="orbit";this.overlay=null;this.handle=null;this.generation=0;this.seatViewGeneration=0;this.seatViewElement=null;this.seatViewDispose=null;this.options=e}get buyerView(){return this.buyerView_}get targetSeatId(){return this.targetSeatId_}get focusedSectionId(){return this.focusedSectionId_}get seatPosition(){return Fc(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!Si()?!1:this.options.seats().length<=this.max3DSeats():!1}canOfferSeatView(){return this.options.enableSeatView?this.options.seats().some(e=>!!e.viewUrl)?!0:this.hasStage():!1}async setBuyerView(e,t={}){if(e==="map"){this.exit3D();return}if(!this.canOffer3D())throw new Error("venue_3d_unavailable");if(this.buyerView_==="venue3d"&&this.handle){t.flyToSeatId?(this.targetSeatId_=t.flyToSeatId,this.focusedSectionId_=this.findSeat(t.flyToSeatId)?.sectionId??null,this.options.onViewChange(this.buyerView_,this.targetSeatId_),await this.handle.flyToSeat(t.flyToSeatId)):t.resetView&&this.handle.focusOverview();return}if(this.handle&&this.overlay){await this.restore3D(t);return}await this.enter3D(t.flyToSeatId)}async openSeatView(e){if(!this.canOfferSeatView())throw new Error("seat_view_unavailable");let t=this.findSeat(e),n=this.options.host(),o=this.options.doc();if(!t||!n||!o)throw new Error("seat_view_unavailable");let s=++this.seatViewGeneration,r,a,l=!1;if(t.viewUrl){let g=t.viewMeta?.previewUrl,y=!!g&&g!==t.viewUrl,T=y?await this.options.resolveAsset(g):null,S=y?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(s!==this.seatViewGeneration||!S||y&&!T)return;r={url:S,...T?{previewUrl:T}:{},...y?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}},a=(0,Ui.seatViewDisclosure)(r),l=(0,Ui.isAuthoredSeatView)(r)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:g}=await Ti();if(s!==this.seatViewGeneration)return;let y=o.floors?.find(v=>v.objects.some(P=>P.type==="row"&&P.id===t.rowId)),T=t.focalPoint??y?.focalPoint??o.focalPoint,S=g(t,T,[...this.options.seats()]);r={url:S.url,generated:!0},a=(0,nt.t)("picker.illustrationCaption",{m:S.distanceM})}if(s!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(n,o),It();let c=this.options.chrome??{},h=Je(),d=(0,nt.t)("picker.viewFromSeat",{label:t.displayLabel||t.label}),u=l?(0,nt.t)("picker.real360"):(0,nt.t)("picker.preview"),p=ji({root:n,source:r,caption:a,real:l,closeLabel:b("picker.close","Close"),dragHint:h,viewFromSeatLabel:d,real360Label:(0,nt.t)("picker.real360"),previewLabel:(0,nt.t)("picker.preview"),chrome:{title:c.seatViewTitle,caption:c.seatViewCaption,badge:c.seatViewBadge},resolveAsset:this.options.resolveAsset,onClose:()=>this.closeSeatView(!0,!0)});this.seatViewElement=p.element,this.seatViewDispose=p.dispose,this.options.onSeatViewChange?.({seatId:t.id,title:d,caption:a,badge:u,real:l,generated:!!r.generated,dragHint:h})}pushLiveState(){this.handle&&(this.handle.setAvailability(this.options.seats().map(e=>({seatId:e.id,state:this.seatState(e)}))),this.handle.setSelection(this.options.selection().map(e=>e.id)))}focusOverview(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.focusOverview(),!0)}focusSection(e){return this.buyerView_==="venue3d"?this.handle?.focusSection(e)??!1:!1}focusFloor(e){let t=this.options.doc();if(this.buyerView_!=="venue3d"||!this.handle||!t?.floors?.length)return!1;let n=t.floors.findIndex(o=>o.id===e);return n>=0&&this.handle.focusFloor(n)}zoomIn(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomIn(),!0)}zoomOut(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomOut(),!0)}setNavigationMode(e){return this.navigationMode_=e,this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.setNavigationMode(e),this.options.onViewChange(this.buyerView_,this.targetSeatId_),!0)}destroy(){this.generation+=1,this.closeSeatView(!0,!1);try{this.handle?.dispose()}catch{}this.handle=null,this.overlay?.remove(),this.overlay=null,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null}max3DSeats(){let e=this.options.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?$s/2:$s}async enter3D(e){let t=this.options.host(),n=this.options.doc();if(!t||!n||this.overlay)throw new Error("venue_3d_unavailable");It(),this.prepareHostTheme(t,n);let o=document.createElement("div");o.className="sl-view3d",o.setAttribute("role","group"),o.setAttribute("aria-label",b("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(o.style,{position:"absolute",inset:"0",zIndex:"4",opacity:"0",touchAction:"none",transition:this.reducedMotion()?"none":"opacity 260ms cubic-bezier(.2,.8,.2,1)",background:"radial-gradient(120% 120% at 50% 0%,#191f28 0%,#0d1014 70%)"});let s=document.createElement("div");s.className="sl-view3d-loading",s.setAttribute("role","status"),s.setAttribute("aria-live","polite"),s.textContent=b("picker.loading3d","Building the 3D venue\u2026"),o.appendChild(s),t.appendChild(o),this.overlay=o;let r=++this.generation;if(this.reducedMotion()?o.style.opacity="1":requestAnimationFrame(()=>{o.style.opacity="1"}),await this.nextPaint(),!(r!==this.generation||this.overlay!==o))try{let[a,l]=await Promise.all([Xt(),this.options.loadEventConfiguration()]),c=l?await zi(l,this.options.resolveAsset):null,h=await $i(n.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(r!==this.generation||this.overlay!==o)return;let d={doc:n,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...h?{registeredShellGlb:h}:{}};s.textContent=b("picker.building3d","Building venue geometry\u2026");let u=await a.prepareVenue3D(d);if(r!==this.generation||this.overlay!==o)return;let p=this.options.chrome??{},g=a.mountVenue3D(o,{...d,prepared:u},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:Je(),navLabels:xi(),...p.view3dCaption===!1||p.view3dSeatStepper===!1||p.view3dControlDock===!1?{chrome:{caption:p.view3dCaption!==!1,seatStepper:p.view3dSeatStepper!==!1,controlDock:p.view3dControlDock!==!1}}:{},seatViewActionLabel:y=>this.findSeat(y)?.viewUrl?b("picker.openAuthored360","Open venue 360\xB0"):b("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:y=>this.toggleSeat(y),onSeatInspect:y=>this.toggleSeat(y),onViewTargetChange:y=>{this.targetSeatId_=y,y&&(this.focusedSectionId_=this.findSeat(y)?.sectionId??null),this.options.onViewChange("venue3d",y)},onSectionFocusChange:y=>{this.focusedSectionId_=y,this.options.onViewChange("venue3d",this.targetSeatId_)},...this.options.enableSeatView?{getSeatView:y=>this.seatViewFor3D(y)}:{}});if(r!==this.generation||this.overlay!==o){g.dispose();return}this.handle=g,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,g.setNavigationMode(this.navigationMode_),requestAnimationFrame(()=>s.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await g.flyToSeat(e)}catch(a){if(r!==this.generation)return;throw this.options.onError?.(a),this.remove3DOverlay(!1),a}}exit3D(){this.buyerView_==="map"&&!this.overlay||(this.generation+=1,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null,this.remove3DOverlay(!0,!!this.handle),this.options.onViewChange("map",null))}remove3DOverlay(e,t=!1){let n=this.handle,o=this.overlay;if(this.options.restoreMap(),t&&n&&o){o.style.pointerEvents="none";let s=()=>{this.buyerView_!=="map"||this.overlay!==o||(o.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(o.style.opacity="0",s()):(requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(s,280));return}if(this.handle=null,this.overlay=null,!o){try{n?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{n?.dispose()}catch{}o.remove(),this.options.restoreMap();return}o.style.pointerEvents="none",requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(()=>{try{n?.dispose()}catch{}o.remove(),this.options.restoreMap()},280)}async restore3D(e){let t=this.overlay,n=this.handle;if(!t||!n)throw new Error("venue_3d_unavailable");this.buyerView_="venue3d",this.targetSeatId_=e.flyToSeatId??null,this.focusedSectionId_=e.flyToSeatId?this.findSeat(e.flyToSeatId)?.sectionId??null:null,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),n.resize(),n.setNavigationMode(this.navigationMode_),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e.flyToSeatId?await n.flyToSeat(e.flyToSeatId):e.resetView&&n.focusOverview()}nextPaint(){return this.reducedMotion()||typeof requestAnimationFrame!="function"?Promise.resolve():new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}toggleSeat(e){if(!this.findSeat(e))return;this.options.selection().some(o=>o.id===e)?this.options.deselect(e):this.options.status(e)==="free"&&this.options.select(e),this.pushLiveState()}seatState(e){switch(this.options.status(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:return"available"}}async seatViewFor3D(e){let t=this.findSeat(e);if(!t)throw new Error("seat_view_unavailable");if(t.viewUrl){let n=t.viewMeta?.previewUrl,o=!!n&&n!==t.viewUrl,s=o?await this.options.resolveAsset(n):null,r=o?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!r||o&&!s)throw new Error("seat_view_unavailable");return{url:r,...s?{previewUrl:s}:{},...o?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:b("picker.chartDerivedModel","Chart-derived model")}}closeSeatView(e=!0,t=!1){e&&(this.seatViewGeneration+=1);let n=this.seatViewElement;if(this.seatViewDispose?.(),this.seatViewDispose=null,this.seatViewElement=null,!!n){if(this.options.onSeatViewChange?.(null),!t||this.reducedMotion()){n.remove();return}n.classList.add("is-leaving"),setTimeout(()=>n.remove(),190)}}findSeat(e){return this.options.seats().find(t=>t.id===e||t.label===e)}hasStage(){let e=this.options.doc();return e?(e.floors?.flatMap(n=>n.objects)??e.objects).some(n=>n.type==="shape"&&(n.role==="stage"||!!n.stageKind)):!1}prepareHostTheme(e,t){getComputedStyle(e).position==="static"&&(e.style.position="relative");let n=t.theme;e.style.setProperty("--sl-bg",n?.background??"#f6f7fb"),e.style.setProperty("--sl-surface","#ffffff"),e.style.setProperty("--sl-text",n?.textColor??"#10162a"),e.style.setProperty("--sl-muted","#697386"),e.style.setProperty("--sl-line","#d9deea"),e.style.setProperty("--sl-accent",n?.accent??"#ef4056"),e.style.setProperty("--sl-accent-ink",n?.accentInk??"#ffffff")}reducedMotion(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1}};var Vc={host:"web",platform:"web",bundle:"",protocol:0,chromeOwner:"web"},zc={...Vc},qi=null,js=null;function $c(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function jc(){let i=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:i($c()),documentMs:qi==null?0:i(qi),handshakeMs:qi==null||js==null?0:i(js-qi)}}function Gs(){let{host:i,platform:e,bundle:t,protocol:n,chromeOwner:o}=zc,s=jc();return{host:i,platform:e,...t?{bundle:t}:{},...n?{protocol:n}:{},chromeOwner:o,bootMs:s.bootMs,documentMs:s.documentMs,handshakeMs:s.handshakeMs}}var Us=new Set;function je(i){return Us.has(i)?"repeat":"cold"}function Ki(i){let e=je(i);return Us.add(i),e}function ge(i){return typeof i=="number"&&Number.isFinite(i)&&i>=0?Math.round(i):0}function Gc(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function Uc(i){if(!/^[A-Za-z0-9_-]{1,80}$/.test(i.event))return null;let e=i.performanceProfile??{};return{event:i.event,scope:i.scope,surface:i.surface,outcome:i.outcome,stage:i.stage?.slice(0,32)??"",ms:ge(i.ms),api:ge(e.loadChartAndStatuses)||ge(e.loadChart),scene:ge(e.buildScene),panel:ge(e.buildBuyerControls),paint:ge(e.firstPaint),normalize:ge(e.normalizeBuyerModel),renderer:ge(e.createRenderer),seats:ge(i.seats),floors:ge(i.floors),view:i.view??"map",load:i.load??je(i.event),transport:i.transport??"pubapi",chartBytes:ge(i.chartDelivery?.bytes),chartCache:i.chartDelivery?.cache??"",...Gs(),availabilityMs:ge(e.loadStatuses)}}var qc=new Set;function Ie(i){let e=Uc(i);if(e){for(let t of qc)try{t(e)}catch{}typeof fetch>"u"||Gc()||fetch(`${i.apiBase.replace(/\/+$/,"")}/pub/telemetry/chart-load`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify(e),credentials:"omit",keepalive:!0}).catch(()=>{})}}function Wi(i){if(!i)return null;let e=i.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function Kc(i){return Wi(i.foot?.querySelector(".sl-total"))??Wi(i.tray)??Wi(i.sheetHead)}function Gn(i,e,t,n,o){let s=i,r=s.map;if(!r||!e){o?.();return}let a=r.getBoundingClientRect(),l={x:a.left+e.x,y:a.top+e.y},c=t.displayLabel??t.label,h=n?.find(u=>u.key===t.categoryKey)?.color,d=()=>{let u=Kc(s);if(!u){o?.();return}ks({from:l,to:{x:u.left+u.width/2,y:u.top+u.height/2},label:c,color:h,onArrive:o})};s.sheetHead&&Wi(s.sheetHead)?requestAnimationFrame(d):d()}var jn=60,Wc=650;function qs(i,e){if(!e.length||i.focusSeats?.(e.map(o=>o.id)))return;let t=e.find(o=>o.sectionId)?.sectionId;if(!t)return;let n=e.filter(o=>o.sectionId===t);i.focus(t,{x:n.reduce((o,s)=>o+s.x,0)/n.length,y:n.reduce((o,s)=>o+s.y,0)/n.length})}function Ks(i,e){let t=!Ni();qs({focusSeats:n=>i.focusSeats?.(n,{animate:t})===!0,focus:(n,o)=>i.focusSection(n,o)},(e?.items??[]).filter(n=>n.objectType!=="ga").slice(0,10).map(n=>i.seatByLabel(n.label)).filter(n=>!!n))}function Ws(i,e){if(!e.length)return;let t=i.reducedMotion===!0;t||e.forEach((r,a)=>{i.schedule(()=>i.pop(r.id),a*jn)});let n=t?0:e.length*jn,o=e.find(r=>r.sectionId)?.sectionId;if(i.schedule(()=>qs(i,e),n),t)return;let s=n+(i.focusSeats||o?Wc:0);e.forEach((r,a)=>{i.schedule(()=>Gn(i.regions,i.screenPoint(r),r,i.categories),s+a*jn)})}function Yc(i,e,t){for(let n of i)if(e>=n.x&&t>=n.y&&e<=n.x+n.w&&t<=n.y+n.h)return!0;return!1}var Yi=class{constructor(){this.rects=[];this.host=null;this.pointers=new Set;this.touches=new Set;this.mouseDown=!1;this.onPointerDown=e=>{this.inside(e.clientX,e.clientY)&&(this.pointers.add(e.pointerId),this.swallow(e))};this.onPointerFollow=e=>{this.pointers.has(e.pointerId)&&this.swallow(e)};this.onPointerEnd=e=>{this.pointers.delete(e.pointerId)&&this.swallow(e)};this.onTouchStart=e=>{let t=this.changed(e);if(!t.length)return;let n=!0;for(let o of t)this.inside(o.clientX,o.clientY)?this.touches.add(o.identifier):n=!1;n&&this.swallow(e)};this.onTouchFollow=e=>{let t=this.changed(e);t.length&&t.every(n=>this.touches.has(n.identifier))&&this.swallow(e)};this.onTouchEnd=e=>{let t=this.changed(e);if(!t.length)return;let n=t.every(o=>this.touches.has(o.identifier));for(let o of t)this.touches.delete(o.identifier);n&&this.swallow(e)};this.onMouseDown=e=>{this.inside(e.clientX,e.clientY)&&(this.mouseDown=!0,this.swallow(e))};this.onMouseFollow=e=>{this.mouseDown&&this.swallow(e)};this.onMouseUp=e=>{this.mouseDown&&(this.mouseDown=!1,this.swallow(e))};this.onClick=e=>{this.inside(e.clientX,e.clientY)&&this.swallow(e)}}set(e){this.rects=e.map(t=>({x:t.x,y:t.y,w:t.w,h:t.h})),this.rects.length||(this.pointers.clear(),this.touches.clear(),this.mouseDown=!1)}get(){return this.rects}attach(e){if(this.host===e)return;this.detach(),this.host=e;let t={capture:!0,passive:!1};e.addEventListener("pointerdown",this.onPointerDown,t),e.addEventListener("pointermove",this.onPointerFollow,t),e.addEventListener("pointerup",this.onPointerEnd,t),e.addEventListener("pointercancel",this.onPointerEnd,t),e.addEventListener("touchstart",this.onTouchStart,t),e.addEventListener("touchmove",this.onTouchFollow,t),e.addEventListener("touchend",this.onTouchEnd,t),e.addEventListener("touchcancel",this.onTouchEnd,t),e.addEventListener("mousedown",this.onMouseDown,t),e.addEventListener("mousemove",this.onMouseFollow,t),e.addEventListener("mouseup",this.onMouseUp,t),e.addEventListener("click",this.onClick,t),e.addEventListener("dblclick",this.onClick,t)}detach(){let e=this.host;if(!e)return;let t={capture:!0};e.removeEventListener("pointerdown",this.onPointerDown,t),e.removeEventListener("pointermove",this.onPointerFollow,t),e.removeEventListener("pointerup",this.onPointerEnd,t),e.removeEventListener("pointercancel",this.onPointerEnd,t),e.removeEventListener("touchstart",this.onTouchStart,t),e.removeEventListener("touchmove",this.onTouchFollow,t),e.removeEventListener("touchend",this.onTouchEnd,t),e.removeEventListener("touchcancel",this.onTouchEnd,t),e.removeEventListener("mousedown",this.onMouseDown,t),e.removeEventListener("mousemove",this.onMouseFollow,t),e.removeEventListener("mouseup",this.onMouseUp,t),e.removeEventListener("click",this.onClick,t),e.removeEventListener("dblclick",this.onClick,t),this.host=null,this.pointers.clear(),this.touches.clear(),this.mouseDown=!1}inside(e,t){if(!this.rects.length||!this.host)return!1;let n=this.host.getBoundingClientRect();return Yc(this.rects,e-n.left,t-n.top)}swallow(e){e.stopImmediatePropagation(),e.stopPropagation(),e.cancelable&&e.preventDefault()}changed(e){let t=e.changedTouches;return t?Array.from(t):[]}},Ys=.48,Xc=8;function Zc(i,e,t,n=Ys){let o=Math.max(0,t.top),s=e.height-Math.max(0,t.bottom);if(!(s>o))return 0;let r=Number.isFinite(n)?Math.min(1,Math.max(0,n)):Ys,a=o+(s-o)*r-i;return Math.abs(a)<=Xc?0:Math.round(a)}function Xs(i,e,t={}){let n=i.gestureCount();if(t.gestures!==void 0&&t.gestures!==n)return{dy:0,gestures:n};let o=i.seatPoint(e);if(!o)return{dy:0,gestures:n};let s=Zc(o.y,{height:i.mapHeight()},i.insets(),t.fraction);return s?{dy:i.panScreenBy({x:0,y:s},t.animate!==!1)?s:0,gestures:n}:{dy:0,gestures:n}}var ni=class i{constructor(e,t=null){this.seams=e;this.watch=null;this.mode=t,this.watchMode()}themeMode(){return this.mode}setThemeMode(e,t){let n=t!==void 0&&"mapTheme"in t;e===this.mode&&!n||(n&&this.seams.setHostMapTheme(t.mapTheme??void 0),this.mode=e,this.watchMode(),this.applyThemeMode())}static groundFor(e){return kt(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??i.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=Hi(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};var Qs=require("@seatlayer/core"),Js=require("@seatlayer/core/core/seatConfidence");var Zs=require("@seatlayer/core");function Ot(i){let e=i.viewMeta?.previewUrl??i.viewUrl;return e&&($n(e)||wt(e))?e:null}function Zi(i){if(!i)return!1;let e=i.floors?.length?i.floors.map(t=>t.objects??[]):[i.objects??[]];for(let t of e)for(let n of t)if(n.type==="shape"&&(n.role==="stage"||n.stageKind))return!0;return!1}var Qc=512,Xi=new Map;function Qi(i,e){if(!e)return null;let t=`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`,n=Xi.get(t);if(n!==void 0)return n;let o=null;try{o=(0,Zs.generateSeatThumb)(i,e).distanceM??null}catch{o=null}return Xi.size>=Qc&&Xi.clear(),Xi.set(t,o),o}function oi(i){return i.getFocusedSection()!==null||i.seatsRevealed()}function Jc(i){let e=i.atVenueFit?.(),t=i.canZoomIn?.();return{...typeof e=="boolean"?{atVenueFit:e}:{},...typeof t=="boolean"?{canZoomIn:t}:{}}}function ed(i,e){return{accessibilityFilter:i.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function td(i,e,t,n){for(let o of e){if(o.count<=0)continue;let s=i.accessibilitySpread?.([o.key]);for(let r of s?.sections??[]){let a=t.get(r.id)??n.get(r.id);if(!a||r.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[o.key]=r.free}}}function er(i,e,t){let n=i.doc,o=n?.theme??{},s=i.categoryAvailability(),r=i.getGAAreas(),a=i.getFloors(),l=i.getExpandedSeats(),c=i.getAccessNeeds(),h=ed(c,l),d=e.seatPosition,u=d.targetSeatId?i.seatDetails(d.targetSeatId):null,p=new Map(l.map(v=>[v.id,v])),g=Zi(n),y=n?.floors?.flatMap(v=>v.objects)??n?.objects??[],T=new Map,S=new Map;for(let v of y){if(v.type!=="section")continue;let P={id:v.id,label:v.label,...v.displayLabel?{displayLabel:v.displayLabel}:{},...v.zone?{zoneId:v.zone}:{}};T.set(v.id,P);let B=v.logicalSectionId??v.id;S.has(B)||S.set(B,P)}return td(i,c,T,S),{event:{key:t.event,name:t.eventInfo?.name??n?.name??t.event,venue:t.eventInfo?.venue??null,startsAt:t.eventInfo?.startsAt??null,timezone:t.eventInfo?.timezone??null,currency:t.eventInfo?.currency??t.currency??"USD",locale:(0,Qs.getLocale)()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...o.accent?{accent:o.accent}:{},...o.accentInk?{accentInk:o.accentInk}:{},...o.background?{background:o.background}:{},...o.textColor?{textColor:o.textColor}:{},...o.brandName?{brandName:o.brandName}:{},...o.logoUrl?{logoUrl:o.logoUrl}:{},attributionRequired:!o.hideBadge},features:{ga:r.length>0,tiers:!!n?.categories.some(v=>v.tiers?.length),floors:a.length>1,zones:!!n?.zones?.length,sections:T.size>0,bestAvailable:!0,...h,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(n?.categories??[]).filter(v=>!v.notForSale).map(v=>({key:v.key,label:v.label,color:v.color,price:v.price??v.tiers?.[0]?.price??0,available:s[v.key]??0,...Object.prototype.hasOwnProperty.call(s,v.key)?{free:s[v.key]}:{},tiers:(v.tiers??[]).map(P=>({id:P.id,name:P.name,price:P.price,...P.currency?{currency:P.currency}:{}}))})),zones:(n?.zones??[]).map(v=>({id:v.id,label:v.label,...v.color?{color:v.color}:{}})),sections:[...T.values()],gaAreas:r,bestAvailableZones:i.getBestAvailableZones()},map:{floors:a,activeFloorId:i.getActiveFloorId()||a[0]?.id||null,floorMode:i.isFloorOverview()?"all":"single",floorLabelStyle:i.getRenderer()?.getFloorLabelStyle?.()??"number",rung:i.getRung(),canZoomOut:oi(i)||t.focusedSection_!==null,...Jc(i),focusedSectionId:i.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:i.getViewMode(),buyerView:e.buyerView,view3dTargetSeatId:d.targetSeatId,view3dTargetSeat:u,view3dPreviousSeatId:d.previousSeatId,view3dNextSeatId:d.nextSeatId,view3dFocusedSectionId:e.focusedSectionId,view3dNavigationMode:e.navigationMode,colorblindSafe:t.colorblindSafe_,viewportInsets:i.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:c},selection:{seats:i.getSelection().map(v=>{let P=p.get(v.id);if(!P)return v;let B=i.worldToScreen({x:P.x,y:P.y}),U=Ot(P),f=g?Qi(P,P.focalPoint??n?.focalPoint):null;return{...v,screenPoint:{x:B.x,y:B.y},...U?{seatViewThumb:{reference:U,kind:"real"}}:{},...f!=null?{sightlineMetres:f}:{},...P.confidenceEvidence?{seatViewConfidence:(0,Js.seatConfidenceDisclosure)(P.confidenceEvidence)}:{}}}),validity:i.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var id="https://api.seatlayer.io",tr=10;function nd(i){if(typeof i=="string"){let e=document.querySelector(i);if(!e)throw new Error(`seatmap: container "${i}" not found`);return e}if(!(i instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return i}var Ji=class{constructor(e){this.mount=null;this.hostEl=null;this.interactionEnabled_=!0;this.eventLocale=null;this.localeGeneration=0;this.languageSelect=null;this.rendered=!1;this.mode_=null;this.eventInfo=null;this.categoryFilter_=null;this.accessibilityFilter_=null;this.hideLimitedView_=!1;this.focusedSection_=null;this.lastReportedViewRung_=null;this.lastReportedCanZoomOut_=!1;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.blockedRegions=null;this.realtime=null;this.holdingLabels=new Set;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.container)throw new Error("seatmap: `container` is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");this.opts=e,this.maxSelection_=e.maxSelection??tr,this.colorblindSafe_=e.colorblindSafe??!1;let t=!!(e.buyerAccessTokenProvider||e.buyerAccessToken||e.publicKey);this.accessState_={configured:t,status:t?"ready":"public"},this.publicKey=e.publicKey;let n={onExpired:a=>{this.accessState_={configured:!0,status:a.refreshed?"ready":"expired"},this.opts.onAccessExpired?.(a),this.notifyMapStateChange()},onUnavailable:a=>{this.accessState_={configured:!0,status:"unavailable",reason:a.reason},this.opts.onAccessUnavailable?.(a),this.notifyMapStateChange()}},o=(e.apiBase??id).replace(/\/+$/,"");this.apiBase=o;let s=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?_i({base:o,event:e.event,publicKey:e.publicKey,accessHooks:n,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=s?.access??Mt(e,n);let r=s?.api??new Fe(o,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=r,this.controller=new $.PickerController({transport:r,eventKey:e.event,maxSelection:this.maxSelection_,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,onSelectionChange:a=>{this.immersive?.pushLiveState(),this.opts.onSelectionChange?.(a)},onSelectionValidityChange:a=>this.opts.onSelectionValidityChange?.(a),onSelectionValid:a=>this.opts.onSelectionValid?.(a),onSelectionInvalid:a=>this.opts.onSelectionInvalid?.(a),onDeselect:a=>{this.controller.currentHold()?.labels.includes(a.label)&&this.controller.releaseLabels([a.label])},retapKeepsSelection:!0,onSeatRetap:a=>this.opts.onSeatRetap?.(a),onSelectionLimit:a=>this.opts.onSelectionLimit?.(a),onHold:a=>this.opts.onHold?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldRestored:a=>this.opts.onHoldRestored?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:a=>{let l=this.controller.getGAAreas().find(c=>c.id===a);l&&(this.opts.onGAClick?.(l),this.opts.onGAPrompt?.({area:l,selected:{},min:0,max:Math.max(0,Math.min(l.available,(this.opts.maxSelection??tr)-this.controller.getSelection().length)),tiers:Fi(l),confirm:c=>{let h=typeof c=="number"?c:Object.values(c).reduce((d,u)=>d+u,0);this.holdGA(l.id,h)},cancel:()=>{}}))},onError:a=>this.opts.onError?.(a),onDeckTap:a=>{this.opts.onDeckTap?.(a),this.notifyMapStateChange()},onHint:a=>this.opts.onHint?.(a),onSectionFocus:a=>{this.focusedSection_=a,this.opts.onSectionFocus?.(a),this.notifyMapStateChange()},onViewChange:()=>this.handleViewChange(),onStatusChange:()=>{this.immersive?.pushLiveState(),this.opts.onStatusChange?.()},onSalesClosed:()=>{this.eventInfo&&(this.eventInfo.salesClosed=!0),this.opts.onSalesClosed?.()},flashOnLiveChange:!0,onSeatHover:a=>{this.opts.onSeatHover?.(a),this.opts.seatTooltip!==!1&&this.updateTooltip(a)},colorblindSafe:e.colorblindSafe,mapTheme:e.mapTheme??ni.groundFor(e.theme?.mode)??null}),this.hostSurface=new ni({mapTheme:()=>this.opts.mapTheme,setHostMapTheme:a=>{this.opts.mapTheme=a},applyMapTheme:a=>this.controller.setMapTheme(a),applyViewportInsets:a=>this.controller.setViewportInsets(a),readViewportInsets:()=>this.controller.getViewportInsets(),changed:()=>this.notifyMapStateChange()},e.theme?.mode??null),this.buyerAssetUrls=new Rt(e.event,(a,l)=>r.asset(a,l)),this.immersive=new Gi({host:()=>this.hostEl,doc:()=>this.controller.doc,seats:()=>this.controller.getExpandedSeats(),selection:()=>this.controller.getSelection(),status:a=>this.controller.getStatus(a),select:a=>this.controller.select([a]),deselect:a=>this.controller.deselect([a]),loadEventConfiguration:()=>this.controller.loadEventConfiguration(),resolveAsset:a=>this.buyerAssetUrls.resolve(a),enable3D:e.enable3D!==!1,enableSeatView:e.enableSeatView!==!1,max3DSeats:e.max3DSeats,...e.chrome?{chrome:e.chrome}:{},restoreMap:()=>this.controller.refitCurrentView(),onViewChange:(a,l)=>{this.opts.onBuyerViewChange?.({view:a,...l?{seatId:l}:{}}),this.notifyMapStateChange()},onSeatViewChange:a=>this.opts.onSeatViewChange?.(a),onError:a=>this.opts.onError?.(a)}),this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=oi(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=oi(this.controller);e===this.lastReportedViewRung_&&t===this.lastReportedCanZoomOut_||(this.lastReportedViewRung_=e,this.lastReportedCanZoomOut_=t,this.opts.onMapStateChange?.())}notifyMapStateChange(){this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=oi(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=Ri(this.opts.locale,this.opts.messages),n=this.localeGeneration+=1,o=(0,$.getLocale)();this.mount=nd(this.opts.container);let s=document.createElement("div");s.style.width="100%",s.style.height="100%",s.style.position="relative",this.mount.appendChild(s),this.hostEl=s,this.blockedRegions?.attach(s),Ii(s,t,a=>{a!==o&&this.applyActiveLocale(a,n)}),this.applyInteractionState();let r=await this.controller.render(s);if(!r)return Ie({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:je(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(s),this;if(this.eventLocale=r.locale??null,!this.opts.locale&&this.eventLocale&&this.setLocale(this.eventLocale),this.buildLanguageSwitcher(s),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=r.mode==="test"?"test":"live",this.eventInfo={name:r.eventName,venue:r.venue??null,startsAt:r.startsAt??null,timezone:r.timezone??null,currency:r.currency??this.opts.currency??"USD",posterUrl:r.posterUrl??null,salesClosed:r.salesClosed},this.opts.seatTooltip!==!1){let a=document.createElement("div");a.setAttribute("role","tooltip"),a.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);',s.appendChild(a),this.tipEl=a,this.onTipMove=l=>{let c=s.getBoundingClientRect();this.tipPos={x:l.clientX-c.left,y:l.clientY-c.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},s.addEventListener("mousemove",this.onTipMove)}if(r.mode==="test"&&this.opts.showTestModeIndicator!==!1){s.style.overflow="hidden";let a=document.createElement("div");a.dataset.slI18n="testMode",a.textContent=(0,$.t)("picker.testMode"),a.setAttribute("aria-label",(0,$.t)("picker.testMode")),a.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;",s.appendChild(a)}return this.buildBadge(s),Ie({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:r.performanceProfile,chartDelivery:r.chartDelivery,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:Ki(this.opts.event),transport:"pubapi"}),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,$.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);';let n=document.createElement("span");n.setAttribute("aria-hidden","true"),n.style.cssText="width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee",n.innerHTML=Vi;let o=document.createElement("span");o.textContent=(0,$.t)("picker.poweredBy"),t.append(n,o),e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,n=this.tipEl.offsetHeight,o=this.tipPos.x+14,s=this.tipPos.y-n-12;o+t>e-8&&(o=this.tipPos.x-t-14),s<8&&(s=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,o)}px`,this.tipEl.style.top=`${Math.max(8,s)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=(0,$.formatMoney)(e.price,e.currency,{...Number.isInteger(e.price)?{minimumFractionDigits:0,maximumFractionDigits:0}:{},locale:this.opts.locale,fallback:(l,c)=>`${l} ${c}`}),n=document.createElement("div");n.style.cssText="font-weight:700;font-size:13px",n.textContent=e.label;let o=document.createElement("div");o.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let s=document.createElement("span");s.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",s.style.background=e.categoryColor;let r=document.createElement("span");r.textContent=e.categoryLabel;let a=document.createElement("span");if(a.style.cssText="margin-left:auto;font-weight:700;color:#fff",a.textContent=t,o.append(s,r,a),this.tipEl.replaceChildren(n,o),e.status!=="free"){let l=document.createElement("div");l.style.cssText="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700",l.textContent=e.status==="held"?(0,$.t)("map.statusHeld"):(0,$.t)("map.statusTaken"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(o=>(0,$.resolveLocale)(o)).filter((o,s,r)=>r.indexOf(o)===s);if(t.length<2)return;let n=document.createElement("select");n.setAttribute("aria-label",(0,$.t)("picker.preferredTicketType")),n.style.cssText='position:absolute;bottom:10px;left:12px;z-index:5;appearance:none;padding:5px 9px;border-radius:999px;border:0;cursor:pointer;background:rgba(255,255,255,.92);color:#4a5163;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 2px 8px rgba(0,0,0,.12);';for(let o of t){let s=document.createElement("option");s.value=o,s.textContent=$.LOCALE_NAMES[o]??o,s.selected=o===(0,$.getLocale)(),n.appendChild(s)}n.addEventListener("change",()=>{this.setLocale(n.value)}),e.appendChild(n),this.languageSelect=n}async setLocale(e){let t=(0,$.getLocale)(),n=this.localeGeneration+=1,o=await(0,$.loadLocale)(e);return this.opts.messages&&(0,$.setStringOverrides)(this.opts.messages),o===t||this.applyActiveLocale(o,n),o}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let n=this.hostEl;if(n){n.lang=e,n.dir=(0,$.localeDirection)(e);for(let o of n.querySelectorAll("[data-sl-i18n]"))if(o.dataset.slI18n==="testMode")o.textContent=(0,$.t)("picker.testMode"),o.setAttribute("aria-label",(0,$.t)("picker.testMode"));else if(o.dataset.slI18n==="badge"){o.setAttribute("aria-label",(0,$.t)("picker.poweredBy"));let s=o.querySelector("span:last-child");s&&(s.textContent=(0,$.t)("picker.poweredBy"))}this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy()}}getMode(){return this.mode_}getPickerState(){return er(this.controller,this.immersive,{event:this.opts.event,currency:this.opts.currency,mode_:this.mode_,eventInfo:this.eventInfo,eventLocale:this.eventLocale,focusedSection_:this.focusedSection_,colorblindSafe_:this.colorblindSafe_,categoryFilter_:this.categoryFilter_,accessibilityFilter_:this.accessibilityFilter_,hideLimitedView_:this.hideLimitedView_,maxSelection_:this.maxSelection_,accessState_:this.accessState_})}getCategoryAvailability(){return this.controller.categoryAvailability()}getBestAvailableZones(){return this.controller.getBestAvailableZones()}getActiveFloorId(){return this.controller.getActiveFloorId()||null}getRung(){return this.controller.getRung()}getFocusedSection(){return this.controller.getFocusedSection()}focusSection(e){if(this.immersive.buyerView==="venue3d"&&this.immersive.focusSection(e)){this.notifyMapStateChange();return}this.controller.focusSection(e),this.notifyMapStateChange()}overview(){if(this.immersive.focusOverview()){this.notifyMapStateChange();return}this.controller.overview(),this.notifyMapStateChange()}setRung(e){this.controller.setRung(e),this.notifyMapStateChange()}setCategoryFilter(e,t=!1){this.categoryFilter_=e?[...e]:null,this.controller.setCategoryFilter(e),t&&this.controller.focusCategoryFilter(e),this.notifyMapStateChange()}setAccessibilityFilter(e){this.accessibilityFilter_=e?[...e]:null,this.controller.setAccessibilityFilter(e),this.notifyMapStateChange(),e?.length&&this.focusAccessibilityFilter()}focusAccessibilityFilter(){this.controller.focusAccessibilityFilter?.(),this.notifyMapStateChange()}focusNextAccessibleSection(e){let t=this.controller.focusNextAccessibleSection?.(e)??null;return t&&this.notifyMapStateChange(),t}setCommercialLimitedFilter(e){this.hideLimitedView_=e,this.controller.setCommercialLimitedFilter(e),this.notifyMapStateChange()}getSelection(){return this.controller.getSelection()}selectObjects(e){let t=this.controller.select(e);return this.immersive.pushLiveState(),t}deselectObjects(e){this.controller.deselect(e),this.immersive.pushLiveState()}clearSelection(){this.controller.clearSelection(),this.immersive.pushLiveState()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxSelection_=e,this.controller.setMaxSelection(e),this.notifyMapStateChange()}getSelectionValidity(){return this.controller.getSelectionValidity()}async hold(e={}){try{return await this.holdOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async holdOrThrow(e={}){let t=this.controller.getSelectionValidity();if(t&&!t.isValid){let n=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(n?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:n?"selection_count_mismatch":"selection_invalid",selection:t})}this.holdingLabels=new Set(this.controller.getSelection().map(n=>n.label));try{let n=await this.controller.hold(void 0,e.ttlMs);return n?{holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items}:null}finally{this.holdingLabels.clear()}}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}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,n={}){try{return await this.holdGAOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async holdGAOrThrow(e,t,n={}){let o=await this.controller.holdGA(e,t,n);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}async bestAvailable(e,t,n={}){try{return await this.bestAvailableOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async bestAvailableOrThrow(e,t,n={}){let o=await this.controller.bestAvailable(e,t,n);return Ks(this.controller,o),o?{holdId:o.holdId,expiresAt:o.expiresAt,labels:o.labels,seats:o.seats,items:o.items,...n.zoneId?{zoneId:n.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}setTableQuantity(e,t){return this.controller.setTableQuantity(e,t)}async replaceTableQuantity(e,t,n){try{return await this.replaceTableQuantityOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async replaceTableQuantityOrThrow(e,t,n){let o=await this.controller.replaceTableQuantity(e,t,n);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}getFloors(){return this.controller.getFloors()}setFloor(e){if(this.immersive.buyerView==="venue3d"&&e!=="all"&&this.immersive.focusFloor(e)){this.notifyMapStateChange();return}if(this.controller.getFloors().length<=1){console.warn("seatmap: setFloor() ignored \u2014 this chart has a single floor");return}e==="all"?this.controller.setFloorOverview(!0):this.controller.setFloor(e),this.notifyMapStateChange()}setFloorLabelStyle(e){this.controller.getRenderer()?.setFloorLabelStyle?.(e),this.notifyMapStateChange()}setSectionFocusDim(e){this.controller.setSectionFocusDim(e)}setSelectionFocus(e){this.controller.setSelectionFocus(e)}setBlockedRegions(e){if(!this.blockedRegions){if(!e.length)return;this.blockedRegions=new Yi,this.hostEl&&this.blockedRegions.attach(this.hostEl)}this.blockedRegions.set(e)}getBlockedRegions(){return this.blockedRegions?.get()??[]}frameSeat(e,t={}){let n=this.controller.getRenderer();return Xs({seatPoint:o=>{let s=this.controller.getExpandedSeats().find(r=>r.id===o);return s?this.controller.worldToScreen({x:s.x,y:s.y}):null},mapHeight:()=>this.hostEl?.clientHeight??0,insets:()=>this.controller.getViewportInsets(),gestureCount:()=>n?.getCameraGestureCount?.()??0,panScreenBy:(o,s)=>n?.panScreenBy?(n.panScreenBy(o,{animate:s}),!0):!1},e,t)}setColorblindSafe(e){this.colorblindSafe_=e,this.controller.setColorblindSafe(e),this.notifyMapStateChange()}setViewMode(e){this.controller.setViewMode(e),this.notifyMapStateChange()}getViewMode(){return this.controller.getViewMode()}zoomIn(){this.immersive.zoomIn()||(this.controller.zoomIn(),this.notifyMapStateChange())}zoomOut(){this.immersive.zoomOut()||(this.controller.zoomOut(),this.notifyMapStateChange())}zoomToFit(){this.immersive.focusOverview()||(this.controller.zoomToFit(),this.notifyMapStateChange())}setThemeMode(e,t){this.hostSurface.setThemeMode(e,t)}getThemeMode(){return this.hostSurface.themeMode()}setViewportInsets(e){this.hostSurface.setViewportInsets(e)}getViewportInsets(){return this.hostSurface.viewportInsets()}setBuyerView(e,t){return this.immersive.setBuyerView(e,t)}getBuyerView(){return this.immersive.buyerView}openSeatView(e){return this.immersive.openSeatView(e)}setVenue3DNavigationMode(e){if(!this.immersive.setNavigationMode(e))throw new Error("venue_3d_not_active")}setInteractionEnabled(e){this.interactionEnabled_=e,this.applyInteractionState()}applyInteractionState(){let e=this.hostEl;e&&(e.style.pointerEvents=this.interactionEnabled_?"":"none",e.toggleAttribute("inert",!this.interactionEnabled_),this.interactionEnabled_?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true"))}async release(){await this.controller.release()}async releaseLabels(e){return this.controller.releaseLabels(e)}startRealtime(){!this.access?.configured||this.realtime||(this.realtime=new Ee({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:vt(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.immersive.pushLiveState(),this.opts.onStatusChange?.()},onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAvailability(){let e=await this.controller.refreshAvailability();return this.immersive.pushLiveState(),this.opts.onStatusChange?.(),e.lost.length&&this.opts.onSelectedObjectUnavailable?.({labels:e.lost,reason:"taken"}),this.notifyMapStateChange(),e}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(this.accessState_={configured:!0,status:"ready"},await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),this.notifyMapStateChange(),e}showLoadFailure(e){let t=document.createElement("div");t.setAttribute("role","status"),t.style.cssText='display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;min-height:180px;box-sizing:border-box;padding:24px;text-align:center;font:500 14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#3b4256;';let n=document.createElement("div");n.textContent="The seat map didn\u2019t load.",t.appendChild(n);let o=document.createElement("button");o.type="button",o.textContent="Try again",o.style.cssText="appearance:none;border:1px solid #c9cede;background:#fff;color:#10162a;border-radius:8px;padding:8px 16px;font:600 13px/1 inherit;cursor:pointer;",o.addEventListener("click",()=>{this.destroy(),this.render().catch(s=>this.opts.onError?.(s))}),t.appendChild(o),e.appendChild(t)}destroy(){this.blockedRegions?.detach(),this.hostSurface.dispose(),this.immersive.destroy(),this.buyerAssetUrls.dispose(),this.realtime?.stop(),this.realtime=null,this.access?.clear(),this.hostEl&&this.onTipMove&&this.hostEl.removeEventListener("mousemove",this.onTipMove),this.tipEl=null,this.onTipMove=null,this.languageSelect=null,this.controller.destroy(),this.hostEl&&this.hostEl.parentNode&&this.hostEl.parentNode.removeChild(this.hostEl),this.hostEl=null,this.mount=null,this.rendered=!1,this.mode_=null,this.eventInfo=null,this.focusedSection_=null}};var Un=["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"],od={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 ir(i){let e={};for(let t of Un)e[t]=(...n)=>{let o=i();return o?o[t](...n):od[t]()};return e}var qn=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],Kn=[...qn,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],Wn=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function nr(i,e,t){let n={container:i};for(let o of Kn)n[o]=e[o];for(let o of Wn)n[o]=t[o];return n}var sd=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),rd=2e4,ad=480,ld=180*1e3,cd=900*1e3,dd=.8,pd=30*1e3,hd=1e5,ud=4,md=50;function Yn(i){if(typeof i!="string")return i;let e=document.querySelector(i);if(!e)throw new Error(`EmbeddedDesigner container not found: ${i}`);return e}function fd(i){let e=(i??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var gd={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."}},en=class{constructor(e){this.frame=null;this.designerOrigin="";this.overlay=null;this.timeoutTimer=null;this.renewTimer=null;this.autoRecoverUsed=!1;this.phase="loading";this.identityEstablished=!1;this.restoreContainerPosition=null;this.pinned=!1;this.frameStyleBeforeFs=null;this.docOverflowBeforeFs=null;this.bodyOverflowBeforeFs=null;this.fsKeyHandler=null;this.lastAutoHeight="";this.fillRaf=null;this.reprobeRaf=null;this.fillListening=!1;this.containerEl=null;this.fillMode=null;this.resizeObs=null;this.scheduleFill=()=>{this.fillRaf===null&&(this.fillRaf=requestAnimationFrame(()=>{this.fillRaf=null,this.applyFill()}))};this.scheduleReprobe=()=>{this.reprobeRaf===null&&(this.reprobeRaf=requestAnimationFrame(()=>{this.reprobeRaf=null,!this.pinned&&(this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill())}))};this.handleMessage=e=>{if(!this.frame||e.origin!==this.designerOrigin||e.source!==this.frame.contentWindow||!e.data||typeof e.data!="object")return;let t=e.data;if(t.type==="seatlayer.designer.handshake"&&typeof t.nonce=="string"&&t.nonce.length<=128){this.frame.contentWindow?.postMessage({type:"seatlayer.designer.parent",nonce:t.nonce},this.designerOrigin);return}if(t.type==="seatlayer.designer.resize"){!this.fillEnabled()&&this.autoResizeEnabled()&&typeof t.px=="number"&&Number.isFinite(t.px)&&t.px>0&&(this.lastAutoHeight=`${Math.round(t.px)}px`,this.pinned||this.setFrameHeight(this.lastAutoHeight));return}if(t.type==="seatlayer.designer.fullscreen"){t.on===!0?this.pinFullscreen():t.on===!1&&this.unpinFullscreen();return}if(typeof t.type!="string"||!sd.has(t.type))return;let n={type:t.type,chartId:typeof t.chartId=="string"?t.chartId:void 0,workspaceId:typeof t.workspaceId=="string"?t.workspaceId:void 0,expiresAt:typeof t.expiresAt=="number"?t.expiresAt:void 0,code:typeof t.code=="string"?t.code:void 0,message:typeof t.message=="string"?t.message:void 0,meta:t.meta,fatal:typeof t.fatal=="boolean"?t.fatal:void 0,action:typeof t.action=="string"?t.action:void 0},o=this.identityEstablished||n.type==="seatlayer.designer.ready"||n.type==="seatlayer.designer.saved"||n.type==="seatlayer.designer.published"||n.type==="seatlayer.designer.close",s=this.options.expectedChartId!==void 0&&n.chartId!==this.options.expectedChartId&&(o||n.chartId!==void 0),r=this.options.expectedWorkspaceId!==void 0&&n.workspaceId!==this.options.expectedWorkspaceId&&(o||n.workspaceId!==void 0);if(s||r){this.showError("mismatch");return}switch(n.type){case"seatlayer.designer.ready":this.identityEstablished=!0,this.sessionExpiresAt=n.expiresAt,this.phase="ready",this.clearTimeoutTimer(),this.removeOverlay(),this.autoRecoverUsed=!1,this.scheduleRenewal(n.expiresAt),this.options.onReady?.(n);break;case"seatlayer.designer.saved":this.options.onSaved?.(n);break;case"seatlayer.designer.published":this.options.onPublished?.(n);break;case"seatlayer.designer.close":this.options.onClose?.(n);break;case"seatlayer.designer.error":{let a=fd(n.code);if(a==="expired"&&this.autoRenewEnabled()&&!this.autoRecoverUsed){this.autoRecoverUsed=!0,this.clearRenewTimer(),this.options.onRequestRelaunch();return}(typeof n.fatal=="boolean"?n.fatal:a!=="load"||this.phase!=="ready")&&this.showError(a),this.options.onError?.(n);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 n=Yn(this.options.container);if(this.containerEl=n,window.addEventListener("message",this.handleMessage),n.append(t),this.frame=t,this.fillEnabled()&&this.startFill(),this.phase="loading",this.loadingStateEnabled()){this.ensureContainerPositioned(n),this.renderOverlay(n,"loading");let o=this.options.loadingTimeoutMs??rd;o>0&&Number.isFinite(o)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},o))}return t}setDesignerUrl(e){return this.options={...this.options,designerUrl:e},this.mount()}getIframe(){return this.frame}setSizing(e,t){this.options={...this.options,height:e,minHeight:t},this.frame&&(this.stopFill(),this.lastAutoHeight="",this.fillEnabled()?(this.pinned||this.setFrameHeight("100%"),this.startFill()):this.pinned||this.setFrameHeight(`${e}px`))}setRelaunchPolicy(e,t){this.options={...this.options,onRequestRelaunch:e,autoRenewSession:t},this.clearRenewTimer(),this.phase==="ready"&&this.scheduleRenewal(this.sessionExpiresAt)}destroy(){window.removeEventListener("message",this.handleMessage),this.stopFill(),this.unpinFullscreen(),this.clearTimeoutTimer(),this.clearRenewTimer(),this.removeOverlay(),this.restoreContainerStyle(),this.frame?.remove(),this.frame=null,this.containerEl=null,this.fillMode=null,this.designerOrigin="",this.phase="loading",this.identityEstablished=!1,this.sessionExpiresAt=void 0,this.lastAutoHeight=""}loadingStateEnabled(){return this.options.showLoadingState!==!1}autoResizeEnabled(){return this.options.autoResize!==!1}fillEnabled(){return typeof this.options.height!="number"}setFrameHeight(e){this.frame?.style.setProperty("height",e,"important")}detectFillMode(){let e=this.containerEl,t=this.frame;if(this.pinned||!e||!t)return this.fillMode??"viewport";let n=()=>e.getBoundingClientRect().height,o=t.style.getPropertyValue("height"),s=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let r=n();t.style.setProperty("height",`${hd}px`,"important");let a=n();return o?t.style.setProperty("height",o,s):t.style.removeProperty("height"),!(a-r>ud)&&r>=md?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??ad;if(this.fillMode==="container"&&this.containerEl){let o=Math.max(e,Math.round(this.containerEl.getBoundingClientRect().height));this.setFrameHeight(`${o}px`);return}let t=this.frame.getBoundingClientRect().top,n=Math.max(e,Math.round(window.innerHeight-t));this.setFrameHeight(`${n}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[n,o]of Object.entries(e))this.frame.style.setProperty(n,o,"important");let t=document.documentElement;this.docOverflowBeforeFs=t.style.overflow,t.style.overflow="hidden",document.body&&(this.bodyOverflowBeforeFs=document.body.style.overflow,document.body.style.overflow="hidden"),this.fsKeyHandler=n=>{n.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 n=t<cd?t*dd:t-ld,o=Math.max(pd,n);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},o)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{Yn(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=Yn(this.options.container)}catch{return}this.renderOverlay(t,"error",e)}handleTryAgain(){if(this.options.onRequestRelaunch){this.options.onRequestRelaunch();return}this.mount()}renderOverlay(e,t,n){this.removeOverlay();let o=document.createElement("div");o.setAttribute("data-seatlayer-designer-overlay",t),o.setAttribute("role",t==="error"?"alert":"status"),o.setAttribute("aria-live","polite"),Object.assign(o.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:"#101625",color:"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:"hidden"}),t==="loading"?this.buildSkeleton(o):this.buildErrorCard(o,n??"load"),e.append(o),this.overlay=o}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
|
|
2906
3135
|
@media (prefers-reduced-motion: no-preference) {
|
|
2907
3136
|
@keyframes seatlayer-designer-shimmer {
|
|
2908
3137
|
0% { background-position: -320px 0; }
|
|
@@ -2912,9 +3141,9 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
2912
3141
|
animation: seatlayer-designer-shimmer 1.25s ease-in-out infinite;
|
|
2913
3142
|
background-size: 640px 100%;
|
|
2914
3143
|
}
|
|
2915
|
-
}`,e.append(t);let n="linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.04) 63%)",o=document.createElement("div");Object.assign(o.style,{position:"absolute",inset:"0",display:"flex",flexDirection:"column",padding:"16px",gap:"14px",opacity:"0.9"});let s=c=>{let h=document.createElement("div");return h.className="sl-shimmer",Object.assign(h.style,{background:n,borderRadius:"8px"}),Object.assign(h.style,c),h};o.append(s({height:"40px",width:"100%",flex:"0 0 auto"}));let r=document.createElement("div");Object.assign(r.style,{display:"flex",gap:"14px",flex:"1 1 auto",minHeight:"0"}),r.append(s({width:"220px",height:"100%",flex:"0 0 auto"})),r.append(s({flex:"1 1 auto",height:"100%"})),o.append(r),e.append(o);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:n,flex:"0 0 auto"}),a.append(l),a.append(document.createTextNode("Loading designer\u2026")),e.append(a)}buildErrorCard(e,t){let n=wd[t],o=document.createElement("div");Object.assign(o.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 s=document.createElement("h2");s.textContent=n.title,Object.assign(s.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let r=document.createElement("p");r.textContent=n.body,Object.assign(r.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let a=document.createElement("button");a.type="button",a.textContent="Try again",Object.assign(a.style,{appearance:"none",cursor:"pointer",border:"0",borderRadius:"10px",padding:"10px 22px",fontSize:"14px",fontWeight:"600",color:"#101625",background:"#7aa2ff"}),a.addEventListener("click",()=>this.handleTryAgain()),o.append(s,r,a),e.append(o)}};var I=require("@seatlayer/core"),Sn=require("@seatlayer/core/view3d/crossfade/panorama");function ar(i){return!!i&&i.clientWidth>0&&i.scrollWidth>i.clientWidth+1}function xd(i){return i.some(e=>ar(e))}var nn="data-fit-gone",Sd=12;function Zn(i,e,t=ar){if(!i)return 0;for(let n of e)i.classList.remove(n.cls);if(i.querySelectorAll(`[${nn}]`).forEach(n=>{n.removeAttribute(nn),n.hidden=!1}),i.dataset.fit="0",i.clientWidth<=0||!t(i))return 0;for(let n=0;n<e.length;n+=1){let o=e[n];n>0&&i.classList.remove(e[n-1].cls),i.classList.add(o.cls),i.dataset.fit=String(n+1);let s=o.give?o.give(i):!0;if(!t(i))return n+1;if(o.repeat&&o.give){for(let r=1;s&&r<Sd;r+=1)if(s=o.give(i),!t(i))return n+1}}return e.length}function kd(i,e="[data-fit-seg]"){let t=[...i.querySelectorAll(e)].filter(n=>!n.hidden);return t.length<2?!1:lr(t[t.length-1])}function Td(i,e){let t=i.querySelector(e);return t&&!t.hidden?lr(t):!1}function lr(i){let e=i.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(nn,""),e.hidden=!0),i.setAttribute(nn,""),i.hidden=!0,!0}function Ed(i){if(!i)return!1;let e=(i.getAttribute("aria-label")||i.textContent||"").trim();return e?(i.setAttribute("aria-label",e),i.setAttribute("title",e),!0):!1}function cr(i){if(!i)return 0;let e=i.querySelector(".sl-confirm-cancel"),t=i.querySelector(".sl-confirm-add-t");return Zn(i,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>Ed(e)}],()=>xd([e,t]))}function dr(i){return Zn(i,[{cls:"sl-fit-notype",give:e=>Td(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>kd(e),repeat:!0}])}function pr(i){return i?(i.classList.add("sl-fitpill"),Zn(i,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var Cd=["on-sale","low","sold-out","presale","closed"];function ri(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function ur(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function hr(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i,t=e.count,n=e.index;if(typeof n!="number"||!Number.isInteger(n)||n<1||typeof t!="number"||!Number.isInteger(t)||t<n)return;let o=e.remaining;if(o!=null&&(typeof o!="number"||!Number.isInteger(o)||o<0))return;let s={index:n,count:t,remaining:o??null};if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;s.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;s.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;s.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let r of["startsAt","endsAt"]){if(e[r]===void 0)continue;let a=ur(e[r]);if(a===void 0)return;s[r]=a}return s}function Ad(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],n=new Set;for(let r of e.channels){if(!r||typeof r!="object"||Array.isArray(r))return;let a=r,l=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||n.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],h=new Set;for(let d of a.priceOverrides){if(!d||typeof d!="object"||Array.isArray(d))return;let u=d,p=typeof u.categoryKey=="string"?u.categoryKey.trim():"",f=u.tierId===null?null:typeof u.tierId=="string"&&u.tierId.trim()?u.tierId.trim():void 0,b=ri(u.price);if(!p||f===void 0||b===void 0||b===null)return;let k=`${p}\0${f??""}`;if(h.has(k))return;h.add(k),c.push({categoryKey:p,tierId:f,price:b})}n.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let o=[],s=new Set;for(let r of e.objects){if(!r||typeof r!="object"||Array.isArray(r))return;let a=r,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||s.has(l)||!n.has(c))return;s.add(l),o.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:o}}function on(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i,t=Cd.find(h=>h===e.state);if(!t)return null;let n=ri(e.fromPrice),o=ri(e.previousPrice);if(n===void 0||o===void 0)return null;let s=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(s===void 0)return null;let r=hr(e.release);if(r===void 0)return null;let a=e.upcoming===void 0?null:hr(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 d of e.prices){if(!d||typeof d!="object"||Array.isArray(d))return null;let u=d,p=typeof u.categoryKey=="string"?u.categoryKey.trim():"";if(!p)return null;let f=ri(u.price),b=ri(u.previousPrice);if(f==null||b===void 0)return null;let k={categoryKey:p,price:f,previousPrice:b};if(u.offerId!==void 0){if(typeof u.offerId!="string"||!u.offerId.trim())return null;k.offerId=u.offerId.trim()}if(u.offerName!==void 0){if(typeof u.offerName!="string"||!u.offerName.trim())return null;k.offerName=u.offerName.trim()}if(u.remaining!==void 0){if(u.remaining!==null&&(typeof u.remaining!="number"||!Number.isInteger(u.remaining)||u.remaining<0))return null;k.remaining=u.remaining==null?null:u.remaining}for(let x of["startsAt","endsAt"]){if(u[x]===void 0)continue;let v=ur(u[x]);if(v===void 0)return null;k[x]=v}h.push(k)}l=h}let c=Ad(e.channelPricing);return c===void 0?null:{state:t,fromPrice:n,previousPrice:o,currency:s,release:r,upcoming:a,prices:l,channelPricing:c}}function mr(i){return i?.changed!==!1}function fr(i,e){if(!i)return null;let t=null,n=o=>{o!=null&&o>e&&(t===null||o<t)&&(t=o)};for(let o of[i.release,i.upcoming])n(o?.startsAt),n(o?.endsAt);for(let o of i.prices)n(o.startsAt),n(o.endsAt);return t}function sn(i){let e={};for(let t of i?.prices??[])e[t.categoryKey]=t.price;return e}function gr(i){return i.focusedSection!==null?i.deeperThanSectionFrame===!1?"venue":"section":i.atVenueFit!==void 0?i.atVenueFit?"none":"venue":i.seatsRevealed?"venue":"none"}function br(i,e,t=[],n=8){let o=e.reduce((r,a)=>!a||a.width<=0||a.height<=0?r:Math.max(r,a.bottom-i.top+n),0),s=t.reduce((r,a)=>!a||a.width<=0||a.height<=0?r:Math.max(r,i.bottom-a.top+n),o>0?n:0);return{top:Math.max(0,Math.ceil(o)),right:0,bottom:Math.max(0,Math.ceil(s)),left:0}}function yr(i){let e=document.createElement("div");e.className="sl-floors on",e.setAttribute("role","group"),e.setAttribute("aria-label",i.tf("picker.chooseLevel","Choose level"));let t=[{id:"",name:i.tf("picker.allLevels","All levels")},...i.floors.map(r=>({id:r.id,name:r.name}))],n=document.createElement("span");n.className="sl-floor-label",n.textContent=`${i.tf("picker.levels","Level")}:`,e.appendChild(n);let o=document.createElement("select");o.className="sl-floor-select",o.setAttribute("aria-label",i.tf("picker.chooseLevel","Choose level"));for(let r of t){let a=document.createElement("option");a.value=r.id,a.textContent=r.name,o.appendChild(a)}let s=i.tf("picker.floorHelp","All levels shows the complete venue. Choose one level to inspect and select its seats.");return o.title=s,o.addEventListener("change",()=>i.onChoose(o.value)),e.appendChild(o),e}function vr(i,e,t){if(!i)return;let n=t?"":e,o=i.querySelector(".sl-floor-select");o&&(o.value=n)}var Ee=require("@seatlayer/core");function wr(i){return typeof i?.min=="number"&&Number.isFinite(i.min)&&typeof i.max=="number"&&Number.isFinite(i.max)}var rn=class{constructor(e){this.el=null;this.current=null;this.collapsed=!1;this.shownAt=0;this.host=e}get summary(){return this.current}adopt(e){this.current=e}get element(){return this.el}show(e){if(e&&e.id!==this.current?.id&&this.host.collapseSheet(),this.current=e,!e){this.el?.remove(),this.el=null,this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}wireNavigation(e){e.querySelectorAll("[data-section-nav]").forEach(t=>{t.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation();let o=t.dataset.sectionNav;o&&this.host.controller.focusSection(o)})})}render(e){let t=this.host.map();if(!t)return;if(this.host.root()?.dataset.layout==="narrow"){this.el?.remove(),this.el=null;return}let n=(e.categories.length?e.categories.map(p=>{let f=this.host.controller.doc?.categories.find(b=>b.key===p.key);return f?this.host.catPriceRange(f):{min:p.priceMin,max:p.priceMax}}):[{min:e.priceMin,max:e.priceMax}]).filter(wr),o=n.length?Math.min(...n.map(p=>p.min)):null,s=n.length?Math.max(...n.map(p=>p.max)):null,r=o==null||s==null?"":o===s?this.host.money(o):`${this.host.money(o)}\u2013${this.host.money(s)}`,a=(0,Ee.tCount)("picker.seatsLeftInSection",e.seatsLeft),l=(0,Ee.t)("picker.seatsLeftShort",{count:e.seatsLeft}),c=`<button type="button" class="sl-seccard-x" aria-label="${(0,Ee.t)("picker.closeSectionSummary")}">\u2715</button>`,h=Zo(this.host.sectionNeighbours(e.id)),d={label:e.label,color:e.color,leftLabel:a,leftShortLabel:l,nav:h,close:c};this.el?.remove();let u=document.createElement("div");if(this.collapsed)u.className="sl-seccard mini on",u.setAttribute("role","button"),u.setAttribute("aria-label",(0,Ee.t)("picker.sectionSummaryAria",{label:e.label})),u.innerHTML=ss(d),this.wireNavigation(u),u.addEventListener("click",p=>{p.target.closest(".sl-seccard-x")||(this.collapsed=!1,this.shownAt=Date.now(),this.render(e))}),u.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),(this.host.region("top-center")??t).appendChild(u);else{u.className="sl-seccard on",u.setAttribute("role","dialog"),u.setAttribute("aria-label",(0,Ee.t)("picker.sectionSummaryAria",{label:e.label}));let p=this.host.priceBandKeys(),f=this.host.suppressPricing(),b=e.categories.map(k=>{let x=this.host.controller.doc?.categories.find(y=>y.key===k.key),v=x?this.host.catPriceRange(x):{min:k.priceMin,max:k.priceMax},A=wr(v)?v:void 0;return as({label:k.label,color:k.color,dim:p!=null&&!p.has(k.key),rangeLabel:f||!A?"":A.min!==A.max?`${this.host.money(A.min)}\u2013${this.host.money(A.max)}`:this.host.money(A.min)})}).join("");u.innerHTML=rs({...d,priceLabel:r,showPrice:!f&&n.length>0,zoneLabel:[e.floorLabel,e.zoneLabel].filter((k,x,v)=>!!k&&v.indexOf(k)===x).join(" \xB7 "),entrance:e.entrance?`${(0,Ee.t)("picker.entrance")} ${e.entrance}`:void 0,mix:b,overviewLabel:(0,Ee.t)("picker.backToVenue"),hint:(0,Ee.t)("picker.tapSeatHint")}),this.wireNavigation(u),u.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),u.querySelector(".sl-seccard-overview").addEventListener("click",()=>this.host.controller.overview()),(this.host.region("top-center")??t).appendChild(u)}this.el=u}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,n=this.host.map();if(!e||!t||!n)return 0;let o=this.host.activeFloorObjects().find(v=>v.type==="section"&&v.id===t.id)?.outline;if(!o||o.length<3)return 0;let s=o.map(v=>this.host.controller.worldToScreen(v)),r=s.map(v=>v.x),a=s.map(v=>v.y),l=Math.min(...r),c=Math.min(...a),h=Math.max(...r)-l,d=Math.max(...a)-c;if(h<=0||d<=0)return 0;let u=n.getBoundingClientRect(),p=e.getBoundingClientRect(),f=p.left-u.left,b=p.top-u.top,k=Math.max(0,Math.min(f+p.width,l+h)-Math.max(f,l)),x=Math.max(0,Math.min(b+p.height,c+d)-Math.max(b,c));return k*x/(h*d)}};var ot=require("@seatlayer/core"),qr=require("@seatlayer/core/core/color");var je=require("@seatlayer/core");function Qn(i,e,t){try{return new Intl.DateTimeFormat(e,{...t,...i.timezone?{timeZone:i.timezone}:{}}).format(new Date(i.startsAt))}catch{return new Date(i.startsAt).toLocaleString(e)}}var an=(i,e)=>Qn(i,e,{dateStyle:"medium"}),ln=(i,e)=>Qn(i,e,{timeStyle:"short"}),cn=(i,e)=>Qn(i,e,{weekday:"short",day:"numeric",month:"short"});function xr(i,e,t,n){return!i.length||i.length>=e?null:{summary:n,labels:i.map(o=>`${an(o,t)} \xB7 ${ln(o,t)}`)}}function Pd(i,e){let t=new Set(e);return i.map(n=>({...n,free:!t.has(n.eventKey)}))}function Sr(i,e){let t=[...i];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function Md(i,e,t="",n=!1){if(!i.length)return"";let o=i.map(s=>{let r=s.free?e.free:e.blocked,a=n&&s.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${E(s.eventKey)}" aria-label="${E(`${s.shortDate}: ${r}`)}" checked>`:"";return`<li class="sl-night${s.free?" ok":" no"}" aria-label="${E(`${s.shortDate}: ${r}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${E(s.shortDate)}</span><span class="st">${E(r)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${E(e.title)}</div><ul class="sl-nightstrip">${o}</ul><p class="sl-tip-nights-note">${E(e.notAvailableOn)}</p>`+t+"</div>"}function Ld(i){return i.selectPartialLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${E(i.selectPartialLabel)}</button>`:i.switchLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${E(i.switchLabel)}</button>`:i.switchLabel||i.selectPartialLabel?"":`<p class="sl-tip-advice">${E(i.advice)}</p>`}function Hd(i){return Number(i.available)+Number(i.selected)+Number(i.partial)+Number(i.unavailable)}function kr(i,e,t){if(Hd(i)<2)return"";let n=(s,r,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${s}"${a}></i>${E(r)}</li>`,o=[];return i.available&&o.push(n("sl-pg-sw-free",e.available,` style="background:${E(t)}"`)),i.selected&&o.push(n("sl-pg-sw-sel",e.selected)),i.partial&&o.push(n("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${E(t)}"`)),i.unavailable&&o.push(n("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${E(e.title)}">${o.join("")}</ul>`}function Tr(i,e){if(!i.length)return"";let t=i.map(n=>{let o=n.labels.length?n.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${n.labels.length?"":" empty"}${n.active?" active":""}" role="button" tabindex="0"${n.active?' aria-current="true"':""} data-event-key="${E(n.eventKey)}"><span class="n">${E(n.name)}</span><span class="s">${E(o)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${E(e.title)}"><div class="sl-pg-nights-title">${E(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function Jn(i,e){if(i?.kind!=="partial"||!e?.length)return null;let t=i.data?.blockedEventKeys??[],n=Pd(e,t);return{states:n,missing:n.filter(o=>!o.free).map(o=>o.shortDate)}}function Er(i,e){return i?Md(i.states,{title:g("picker.group.partlyAvailableTitle","Free on some nights only"),free:g("picker.group.nightFree","Free"),blocked:g("picker.group.nightBlocked","Not available"),notAvailableOn:(0,je.t)("picker.group.notAvailableOn",{dates:Sr(i.missing,e.locale)})},Ld({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:g("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function Rd(i,e,t,n){if(!i.length)return"";let o=new Set(e),s=new Set(t),r=i.map(a=>{let l=o.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${E(a.eventKey)}" aria-label="${E(`${a.shortDate}: ${l?n.available:n.unavailable}`)}"${l&&s.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${E(a.shortDate)}</span><span class="sl-confirm-date-state">${E(l?n.available:n.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${E(n.title)}</legend><p class="sl-confirm-dates-copy">${E(n.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${E(n.selectAll)}</span></label><ul>${r}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function Cr(i,e,t,n){let o=e.availableEventKeys(t);return Rd(i,o,e.includedEventKeys(),{title:n("picker.group.confirmDatesTitle","Choose performance dates"),copy:o.length===i.length?n("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(i.length)):n("picker.group.confirmPartialDatesCopy","This seat is available for {available} of {total} dates. Choose one date or keep every available date.").replace("{available}",String(o.length)).replace("{total}",String(i.length)),selectAll:n("picker.group.confirmSelectAll","Select all available dates"),available:n("picker.group.nightFree","Available"),unavailable:n("picker.group.nightBlocked","Unavailable")})}function Ar(i){return[...i.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function Pr(i,e,t,n){let o=[...i.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!o.length)return;let s=i.querySelector(".sl-confirm-add"),r=i.querySelector("[data-pg-confirm-all]"),a=()=>{let l=o.filter(d=>!d.disabled),c=Ar(i).length;r&&(r.checked=c===l.length,r.indeterminate=c>0&&c<l.length);let h=i.querySelector("[data-pg-confirm-summary]");h&&(h.textContent=c===l.length?t("picker.group.confirmAllSelected","All {count} available dates are selected.").replace("{count}",String(c)):t("picker.group.confirmSelectedOfAvailable","{selected} of {available} available dates selected.").replace("{selected}",String(c)).replace("{available}",String(l.length))),s.disabled=c===0,s.textContent=c?e.label(c):t("picker.group.confirmChooseOne","Choose at least 1 date"),n()};o.forEach(l=>l.addEventListener("change",a)),r?.addEventListener("change",()=>{o.filter(l=>!l.disabled).forEach(l=>{l.checked=r.checked}),a()}),a()}async function Mr(i,e,t){if(!i||!t||!i.querySelector("[data-pg-confirm-event-key]"))return!0;let n=Ar(i);if(!n.length)return!1;let o=i.querySelector(".sl-confirm-add");return o?.setAttribute("aria-busy","true"),o&&(o.disabled=!0),await t.apply(e,n)?!0:(o?.removeAttribute("aria-busy"),o?.isConnected&&(o.disabled=!1),!1)}function Lr(i,e,t){return i?(0,je.t)("picker.group.seatPartlyAvailable",{label:e,free:i.states.length-i.missing.length,total:i.states.length,dates:Sr(i.missing,t)}):""}function Hr(i,e){let t=i.map((n,o)=>{let s=n.state==="done"?e.done:n.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${E(n.id)}" data-state="${E(n.state)}"${n.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${n.state==="done"?"\u2713":String(o+1)}</span><span class="l">${E(n.label)}</span><span class="sl-pg-sr">${E(s)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${E(e.label)}">${t}</ol>`}function eo(i,e){return`<ul class="sl-pg-cards">${i.map(n=>`<li class="sl-pg-card" data-event-key="${E(n.eventKey)}"><span class="n">${E(n.name)}</span><time datetime="${E(n.iso)}"><span class="d">${E(n.date)}</span><span class="t">${E(n.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${E(e)}</p>`}function Rr(i){let e=i.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${E(t.eventKey)}"><span class="n">${E(t.name)}</span><span class="s">${E(t.labels.length?t.labels.join(", "):i.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${E(i.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(i.note?`<p class="sl-pg-pane-note">${E(i.note)}</p>`:"")+(i.total?`<div class="sl-pg-pane-total"><span>${E(i.total.label)}</span><b>${E(i.total.amount)}</b></div>`:"")+(i.holdStatus?`<p class="sl-pg-hold-status" role="status">${E(i.holdStatus)}</p>`:"")}function Ir(i){let e=Math.max(0,i);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function Or(i,e){if(!i||i.seats<=0)return"";if(e==="same_seat"){let t=i.perPerformance??i.seats;return i.totalPerformances&&i.performances<i.totalPerformances?(0,je.tCount)("picker.group.performancesChosenOf",t,{chosen:i.performances,total:i.totalPerformances}):(0,je.tCount)("picker.group.seatsEveryPerformance",t)}return i.perPerformance!=null&&i.performancesChosen===i.performances?(0,je.tCount)("picker.group.seatsPerPerformance",i.seats,{per:i.perPerformance}):(0,je.tCount)("picker.group.performancesChosenOf",i.seats,{chosen:i.performancesChosen,total:i.performances})}function _r(i,e){i.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let n=()=>e(t.dataset.eventKey);t.addEventListener("click",n),t.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),n())})})}var Nr=require("@seatlayer/core");function Ge(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function Id(i,e){let t=i.objectType==="table"&&!!i.bookingMode,n=i.objectType==="booth",o=t||n||!i.seatNumber,s=o?i.rowLabel??i.displayLabel??i.label:i.seatNumber,r=t?`${g("picker.guests","Guests")} ${i.bookingMode==="variable"?`${i.minOccupancy}\u2013${i.maxOccupancy}`:i.capacity}`:!n&&i.rowLabel?`${e} ${X(i)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${o?" name":""}">${Ge(s)}</span>`+(r?`<span class="sl-tip-row">${Ge(r)}</span>`:"")+"</div>"+(i.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${g("picker.section","Section")}</span><span class="sl-tip-secname">${Ge(i.sectionLabel)}</span></div>`:"")+"</div>"}function Dr(i,e){let t=i.status==="not_for_sale",n=i.mark?.kind==="partial",o=i.status==="free"||n?"":`<span class="sl-tip-tag">${t?g("picker.notAvailable","Not available"):i.status==="held"?(0,Nr.t)("map.statusHeld"):g("picker.sold","Sold")}</span>`,s=t?"":e.price,r=s?`<span class="sl-tip-amt">${Ge(s)}</span>`:"",a=!s&&e.priceNote?`<div class="sl-tip-note">${Ge(e.priceNote)}</div>`:"",l=Je(i,{compact:!0}),c=e.reason?`<div class="sl-tip-reason">${Ge(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+Id(i,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${Ge(i.categoryColor)}"></span><span class="sl-tip-name">${Ge(i.categoryLabel)}</span>`+o+r+"</div>"+a+c+l+(e.extra??"")}function Br(i,e,t,n){let o=i.x+14,s=i.y-n.height-12,r=i.y+18,a=s;o+n.width>e-8&&(o=i.x-n.width-14),s<8&&r+n.height<=t-8&&(a=r);let l=Math.max(8,t-n.height-8);return{left:Math.max(8,Math.min(o,Math.max(8,e-n.width-8))),top:Math.max(8,Math.min(a,l))}}function Fr(i,e,t,n=22){let o=Math.max(8,Math.min(i.x-t.width/2,Math.max(8,e.width-t.width-8))),s=i.y-n-t.height,r=i.y+n;return s>=8?{left:o,top:s,placement:"above"}:r+t.height<=e.height-8?{left:o,top:r,placement:"below"}:{left:o,top:Math.max(8,Math.min(s<8?r:s,Math.max(8,e.height-t.height-8))),placement:s<8?"below":"above"}}var to=14,Od=12,_d=12,Nd=8;function Vr(i,e,t,n=Od){let o=e.height-to-t.height,s=_d,r=o-n;if(r<=s)return{placement:"sheet",nudgeY:0};let a=(s+r)/2-i;return Math.abs(a)<=Nd?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function zr(i,e,t,n,o=0){let s=t.width/2+12,r=Math.max(s,Math.min(e.width-s,i.x)),a=i.y+o+t.height+24<=e.height,l=i.y-o<t.height+24&&a?"below":"above",c=l==="above"?i.y-o:i.y+o,h=n&&l==="above"?Math.max(t.height+24,c):c;return{left:r,top:Math.max(8,Math.min(e.height-8,h)),placement:l}}function $r(i,e,t){let n=i.querySelector("[data-pg-select-partial]"),o=[...i.querySelectorAll("[data-pg-event-key]")],s=()=>o.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),r=()=>{if(!n)return;let a=s().length;n.disabled=a===0,n.textContent=e?.(a)??n.textContent};o.forEach(a=>{a.addEventListener("change",r);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,r())})}),n?.addEventListener("click",()=>{let a=s();a.length&&t?.(a)})}function nt(i){let e=i?.displayType?.trim()||i?.rowType?.trim();return e||(i?.objectType==="table"?g("picker.table","Table"):i?.objectType==="booth"?g("picker.booth","Booth"):g("picker.row","Row"))}var Dd="sl-confirm-scrim",Bd="--sl-scrim-mask";function Fd(i){let e=Math.round(i.x),t=Math.round(i.y);return`radial-gradient(circle at ${e}px ${t}px, transparent 0 56px, #000 88px)`}function jr(i,e,t,n){let o=i??document.createElement("div");return i||(o.className=Dd),o.style.setProperty(Bd,Fd(n)),t.parentNode===e?o.nextSibling!==t&&e.insertBefore(o,t):o.parentNode!==e&&e.appendChild(o),o}function io(i){return i?.remove(),null}var Vd=360,zd=160,$d=700,Gr=450;function Ur(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function jd(i){return(0,qr.contrastRatio)("#ffffff",i)>=3?"#ffffff":"#0b0f19"}var dn=class{constructor(e){this.el=null;this.seat=null;this.outsideTap=null;this.scrim=null;this.shownAt=0;this.lift=null;this.framing=null;this.mode="add";this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let n=Ot(e)?e.viewUrl??"":"",o=Qi(t);if(!n&&!o)return"";let s=n?null:Ji(e,e.focalPoint??t.focalPoint);if(!n&&s==null)return"";let r=o&&s!=null?`<div class="sl-confirm-sight">${B((0,ot.t)("picker.sightline",{m:s}))}</div>`:"";if(!n)return r;let a=B((0,ot.t)("picker.viewFromSeat",{label:e.label})),l=B(this.host.tf("picker.viewFromHere","View from here"));return`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${a}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${l}</span></button>`+r}show(e,t="add"){let n=this.host;this.mode=t;let o=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,n.root()?.setAttribute("data-confirming","true"),n.els().side?.toggleAttribute("inert",!0),Object.values(n.regions()).forEach(M=>M.toggleAttribute("inert",!0)),n.controller.setSelectionFocus(e.id),o&&o!==e.id&&n.controller.deselect([o]),n.hideTooltip();let s=n.controller.seatDetails(e.id),r=n.controller.doc?.categories.find(M=>M.key===e.categoryKey),a=s?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),l=a!=null?n.paidPrice(e.categoryKey,s?.tierId??r?.tiers?.[0]?.id??null,a,e.label):void 0,c=es(s,e.displayLabel??e.label,nt(s)),h=s?.tiers??r?.tiers??[],d=s?.tierId??h[0]?.id,u=n.suppressPricing()?"":os(h,d,M=>n.money(n.paidPrice(e.categoryKey,M.id,M.price,e.label))),p=n.buyerView()==="venue3d",f=n.performanceGroup()?.confirmDateSelection??void 0,b=f?n.performanceGroup()?.nights?.()??[]:[],k=f?Cr(b,f,e.id,(M,P)=>n.tf(M,P)):"";this.shownAt=performance.now();let x=document.createElement("div");x.className="sl-confirm sl-mo-in",t==="remove"&&x.classList.add("sl-confirm-removing"),k&&x.classList.add("sl-confirm-group-dates"),x.setAttribute("role","dialog"),x.setAttribute("aria-label",(0,ot.t)("picker.confirmSeatLabel",{label:e.label}));let v=n.controller.getRenderer?.()?.categoryDisplayColor?.(e.categoryKey)??r?.color??"#6e7bff";x.style.setProperty("--sl-cat",v),x.style.setProperty("--sl-cat-ink",jd(v));let A=String(s?.categoryLabel??r?.label??e.categoryKey),y=n.controller.categoryAvailability()[e.categoryKey],H=typeof y=="number"&&y>0?(0,ot.tCount)("picker.leftCount",y):"";x.innerHTML=ls({identityFields:c,identity:ts(s,e.displayLabel??e.label,nt(s)),marker:Xo({...s?.wheelchairSpaceType?{wheelchairSpaceType:s.wheelchairSpaceType}:{}}),see3dPill:is(n.canOffer3d(),p),categoryColor:v,categoryLabel:A,priceLabel:!n.suppressPricing()&&l!=null?n.money(l):"",categoryLeftLabel:H,tierChoices:u,groupDates:k,wheelchair:"",commercial:Je({...e.accessibility?.length?{accessibility:e.accessibility}:{},...s?.wheelchairSpaceType?{wheelchairSpaceType:s.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{}}),thumb:n.seatViewEnabled()&&n.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:p?`<div class="sl-confirm-inspect-row">${Jo(e,n.suppressPricing()?`${s?.displayLabel??e.displayLabel??e.label}`:`${s?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?n.tf("picker.priceNotSupplied","Price not supplied"):n.money(l)}`,p)}${Qo(e,p?n.view3dCompareSeatIds():null)}${In(n.canOffer3d(),p)}</div>`:In(n.canOffer3d(),p),see3dRow:ns(n.canOffer3d(),p),cancelLabel:(0,ot.t)("common.cancel"),selectLabel:t==="remove"?n.tf("picker.removeSeat","Remove seat"):n.addSeatLabel(s?.objectType)}),t==="remove"&&x.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),n.els().map.appendChild(x),this.el=x;let C=x.querySelector(".sl-confirm-thumb"),N=C?.closest(".sl-confirm-thumbwrap")??null;if(C&&N){let M=!1,P=()=>{if(M||!N.isConnected)return;M=!0;let D=()=>{N.remove(),this.el===x&&n.reanchor()};if(n.reducedMotion()||typeof requestAnimationFrame!="function"){D();return}N.style.height=`${N.offsetHeight}px`,N.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{N.style.height="0px",N.style.opacity="0"}),setTimeout(D,zd)};C.addEventListener("error",P),C.addEventListener("load",()=>{C.naturalWidth||P()});let _=e.viewMeta?.previewUrl??e.viewUrl;_?n.resolveAssetUrl(_).then(D=>{if(!(!x.isConnected||this.el!==x)){if(!D){P();return}C.src=D}}).catch(D=>{P(),n.onError(D)}):P()}n.reanchor(),this.liftSeatClearOfSheet(e),x.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{n.openSeatView(e)}),x.querySelector(".sl-confirm-confidence")?.addEventListener("click",M=>{n.openSeatConfidencePassport(e,M.currentTarget instanceof HTMLElement?M.currentTarget:null)}),x.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>n.saveView3dComparisonSeat(e)),x.querySelectorAll("[data-confirm-tier]").forEach(M=>{M.addEventListener("click",()=>{let P=M.dataset.confirmTier,_=h.find(V=>V.id===P);if(!_)return;n.controller.setSeatTier(e.id,_.id),x.querySelectorAll("[data-confirm-tier]").forEach(V=>{V.setAttribute("aria-pressed",String(V===M))});let D=x.querySelector(".sl-confirm-price");D&&(D.textContent=n.money(n.paidPrice(e.categoryKey,_.id,_.price,e.label))),n.reanchor()})}),x.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(M=>{M.addEventListener("pointerdown",Ti,{once:!0}),M.addEventListener("click",()=>{n.buyerView()==="venue3d"?(n.dismiss(),n.view3dHandle()?.flyToSeat(e.id)):(n.rememberView3dReturnSeat(e),n.dismiss(),n.enter3d(e.id))})}),Pr(x,f,(M,P)=>n.tf(M,P),()=>n.reanchor()),x.querySelector(".sl-confirm-add").addEventListener("click",()=>{if(!this.ghostActivation()){if(this.mode==="remove"){this.removeCommitted();return}this.commit()}}),x.querySelector(".sl-confirm-cancel").addEventListener("click",()=>{this.ghostActivation()||this.cancel()}),this.armOutsideTap(x),requestAnimationFrame(()=>{let M=x.querySelector(".sl-confirm-add");M?.focus(),n.liftToastOverConfirm(),n.fitTranslatedRows(),n.inviteCommit(x,M)})}liftSeatClearOfSheet(e){let t=this.host.controller.getRenderer();this.framing={gestures:t?.getCameraGestureCount?.()??0,quietUntil:0},this.frameSeatForSheet(e)}frameSeatForSheet(e){let t=this.host,n=t.root();if(!this.el||n?.dataset.layout!=="narrow"||n?.dataset.view3d==="on")return;let o=t.els().map;if(!o)return;let s=t.controller.worldToScreen({x:e.x,y:e.y}),r=t.controller.getRenderer(),a=r?.getCameraGestureCount?.()??0,{nudgeY:l}=Vr(s.y,{height:o.clientHeight},{height:this.el.offsetHeight||230}),c=this.lift&&this.lift.gestures===a?this.lift.dy:0;if(!l){this.lift=c?{dy:c,gestures:a}:null;return}let h=!t.reducedMotion();r?.panScreenBy?.({x:0,y:l},{animate:h}),this.lift={dy:c+l,gestures:a},this.framing&&(this.framing.gestures=a,this.framing.quietUntil=h?this.now()+$d:0)}reframeSeatForSheet(){let e=this.framing,t=this.seat;!e||!t||e.quietUntil&&this.now()<e.quietUntil||(this.host.controller.getRenderer()?.getCameraGestureCount?.()??e.gestures)!==e.gestures||this.frameSeatForSheet(t)}now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}settleLift(){let e=this.lift;if(this.lift=null,this.framing=null,!e)return;let t=this.host.controller.getRenderer();(t?.getCameraGestureCount?.()??e.gestures)===e.gestures&&t?.panScreenBy?.({x:0,y:-e.dy},{animate:!this.host.reducedMotion()})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),n=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=jr(this.scrim,n,this.el,t),Ts(this.el,t,n),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=io(this.scrim);let o=n.clientWidth,s=n.clientHeight,r=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=e.controller.seatScreenRadius()*1.5,h=zr(t,{width:o,height:s},{width:r,height:a},l,c);this.el.dataset.placement=h.placement,this.el.style.left=`${h.left}px`,this.el.style.top=`${h.top}px`,Bi(this.el,t,{left:h.left,top:h.top,width:r,height:a})}ghostActivation(){return Ur()?performance.now()-this.shownAt<Gr:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,n=s=>{if(this.el!==e){this.disarmOutsideTap();return}let r=s.target;!r||e.contains(r)||t.els().tray?.contains(r)||this.cancel()};this.outsideTap=n;let o=t.root();setTimeout(()=>{this.outsideTap===n&&(o??document).addEventListener("pointerdown",n,!0)},Ur()?Gr:0)}disarmOutsideTap(){if(!this.outsideTap)return;let e=this.outsideTap;this.outsideTap=null,(this.host.root()??document).removeEventListener("pointerdown",e,!0),document.removeEventListener("pointerdown",e,!0)}dismiss(){let e=this.host;this.disarmOutsideTap(),this.scrim=io(this.scrim),this.settleLift(),this.el&&Fi(this.el),this.el=null,this.seat=null,e.liftToastOverConfirm(),e.root()?.removeAttribute("data-confirming"),Object.values(e.regions()).forEach(t=>t.toggleAttribute("inert",!1)),e.applyPanelCollapsed(),e.controller.setSelectionFocus(null)}async commit(){let e=this.host,t=this.seat;if(!t)return;let o=this.el?.querySelector(".sl-confirm-add")??null;if(o?.classList.contains("is-adding")||!await Mr(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let s=()=>{e.dismiss(),Un(e.els(),e.controller.worldToScreen(t),t,e.controller.doc?.categories)};if(!o||e.reducedMotion()){s();return}o.classList.remove("sl-confirm-add-invite"),o.classList.add("is-adding"),o.setAttribute("aria-disabled","true");let r=o.querySelector(".sl-confirm-add-t");r&&(r.textContent=e.tf("picker.added","Added")),e.scheduleMotion(s,Vd)}cancel(){let e=this.host,t=this.seat;t&&(this.mode!=="remove"&&e.controller.deselect([t.id]),this.seat&&e.dismiss(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}removeCommitted(){let e=this.host,t=this.seat;t&&(e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}};function Kr(i,e,t){if(!e||t||i.classList.contains("sl-confirm-removing"))return;e.classList.add("sl-confirm-add-invite");let n=()=>e.classList.remove("sl-confirm-add-invite");i.addEventListener("pointerdown",n,{once:!0}),i.addEventListener("keydown",n,{once:!0}),e.addEventListener("focus",n,{once:!0})}function Wr(i,e){return i&&i!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}var Yr=require("@seatlayer/core"),_t=require("@seatlayer/core/picker/minimapGeometry");function Gd(i){let e={inactive:0,available:1,selected:2},t=new Map;for(let o of i){let s=t.get(o.id);(!s||e[o.state]>e[s])&&t.set(o.id,o.state)}let n={selected:0,available:0,inactive:0};for(let o of t.values())n[o]+=1;return n}function Ud(i,e){return i.x<=e.x&&i.y<=e.y&&i.x+i.width>=e.x+e.width&&i.y+i.height>=e.y+e.height}function Xr(i,e){let t=new no(i);return t.build(e),t}var no=class{constructor(e){this.host=e;this.miniCanvas=null;this.miniBase=null;this.miniWrap=null;this.miniToggle=null;this.miniLabel=null;this.miniTf=null;this.miniDrag=null;this.miniSuppressClick=!1;this.userClosed=!1}dispose(){this.miniToggle?.remove(),this.miniWrap?.remove(),this.miniToggle=null,this.miniWrap=null,this.miniCanvas=null,this.miniBase=null,this.miniLabel=null,this.miniTf=null,this.miniDrag=null,this.host.root()?.removeAttribute("data-minimap-open")}build(e){if(!this.host.controller.getViewport())return;let n=document.createElement("button");n.type="button",n.className="sl-minimap-toggle",n.setAttribute("aria-label",g("picker.openVenueMap","Open venue overview map")),n.setAttribute("aria-expanded","false"),n.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(n),this.miniToggle=n;let o=document.createElement("div");o.className="sl-minimap",o.setAttribute("role","group");let s=document.createElement("div");s.className="sl-minimap-bar";let r=document.createElement("span");r.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",g("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",g("picker.closeVenueMap","Close venue overview map")),l.textContent="\xD7",s.append(r,a,l);let c=document.createElement("canvas");c.tabIndex=0,c.setAttribute("role","application"),c.setAttribute("aria-label",g("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),o.append(s,c),e.appendChild(o),this.miniWrap=o,this.miniLabel=r,this.miniCanvas=c;let h=document.createElement("canvas");this.miniBase=h,n.addEventListener("click",()=>{let d=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=d,this.setMinimapOpen(!d)}),l.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),c.addEventListener("click",d=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(d)}),c.addEventListener("pointerdown",d=>this.minimapPointerDown(d)),c.addEventListener("pointermove",d=>this.minimapPointerMove(d)),c.addEventListener("pointerup",d=>this.minimapPointerUp(d)),c.addEventListener("pointercancel",d=>this.minimapPointerUp(d)),c.addEventListener("keydown",d=>this.minimapKeydown(d)),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,n=this.host.controller.getViewport()?.bounds;if(!e||!t||!n||!(n.width>0&&n.height>0))return;let o=196,s=146,r=6,a=n.width/Math.max(1,n.height),l=o,c=Math.round(o/a);c>s&&(c=s,l=Math.round(s*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,_t.createMinimapTransform)(n,e.width,e.height,h,r)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),t=this.host.controller.isFloorOverview()?g("picker.allFloors","All floors"):e.find(h=>h.id===this.host.controller.getActiveFloorId())?.name??g("picker.venueOverview","Venue overview"),n=this.host.controller.getMinimapSnapshot().sections,s=n.find(h=>h.active)?.label??this.host.focusedSectionLabel(),r=s?`${t} \xB7 ${s}`:t;this.miniLabel.textContent=r;let{selected:a,available:l,inactive:c}=Gd(n);this.miniWrap.setAttribute("aria-label",n.length?`${r}. ${a} selected, ${l} available, ${c} inactive sections.`:r),this.miniCanvas?.setAttribute("aria-label",n.length?`${r}. ${a} selected, ${l} available, ${c} inactive sections. ${g("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${r}. ${g("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 n=e.getContext("2d");if(!n)return;n.clearRect(0,0,e.width,e.height);let o=d=>d*t.scale+t.offX,s=d=>d*t.scale+t.offY,r=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 d of h.sections){if(d.outline.length<3)continue;n.beginPath(),d.outline.forEach((p,f)=>f===0?n.moveTo(o(p.x),s(p.y)):n.lineTo(o(p.x),s(p.y))),n.closePath();let u=d.paint;if(n.globalAlpha=d.state==="inactive"?.5:.92,u?n.fillStyle=u.fill:(n.globalAlpha=d.state==="inactive"?.18:d.state==="selected"?.72:.34,n.fillStyle=d.state==="inactive"?a:d.state==="selected"?l:c),n.fill(),n.globalAlpha=.82,n.lineWidth=Math.max(1,t.dpr),n.strokeStyle=u?.stroke||r,n.stroke(),d.owned){n.globalAlpha=1,n.lineWidth=Math.max(2,t.dpr*1.5),n.strokeStyle=l,n.stroke();let p=d.outline.reduce((f,b)=>({x:f.x+b.x,y:f.y+b.y}),{x:0,y:0});n.beginPath(),n.arc(o(p.x/d.outline.length),s(p.y/d.outline.length),Math.max(1.5,t.dpr*1.6),0,Math.PI*2),n.fillStyle=l,n.fill(),n.beginPath(),d.outline.forEach((f,b)=>b===0?n.moveTo(o(f.x),s(f.y)):n.lineTo(o(f.x),s(f.y))),n.closePath()}d.active&&(n.globalAlpha=1,n.lineJoin="round",n.lineWidth=Math.max(4,t.dpr*3.5),n.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",n.stroke(),n.lineWidth=Math.max(2,t.dpr*1.75),n.strokeStyle=l,n.stroke())}if(n.globalAlpha=1,!h.sections.length){let d=Math.max(1,t.dpr),u=this.host.controller.getRenderer?.(),p=new Map,f=b=>{let k=p.get(b);if(k)return k;let x=u?.categoryDisplayColor?.(b)||c;return p.set(b,x),x};for(let b of h.seats)n.globalAlpha=b.state==="inactive"?.22:.78,n.fillStyle=b.state==="inactive"?a:b.state==="selected"?l:f(b.categoryKey),n.beginPath(),n.arc(o(b.x),s(b.y),d,0,Math.PI*2),n.fill();n.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,t=this.miniBase,n=this.miniTf;if(!e||!t||!n)return;let o=e.getContext("2d");if(!o)return;o.clearRect(0,0,e.width,e.height),o.drawImage(t,0,0);let s=this.host.controller.getViewport();if(!s||Ud(s.visible,s.bounds))return;let r=(0,_t.minimapViewportPlan)(s.visible,n,e.width,e.height,Math.max(2,n.dpr*2)),a=this.host.cssVar("--sl-text")||"#12151c",l=this.host.cssVar("--sl-surface")||"#fff";o.save(),o.globalAlpha=.1,o.fillStyle=a,o.fillRect(r.raw.x,r.raw.y,r.raw.width,r.raw.height),o.globalAlpha=.9,o.lineJoin="round",o.lineWidth=Math.max(4,n.dpr*3.25),o.strokeStyle=l,o.strokeRect(r.raw.x,r.raw.y,r.raw.width,r.raw.height),o.globalAlpha=1,o.lineWidth=Math.max(2,n.dpr*1.75),o.strokeStyle=a,o.strokeRect(r.raw.x,r.raw.y,r.raw.width,r.raw.height),r.clipped&&Object.values(r.clippedEdges).some(Boolean)&&(o.setLineDash([Math.max(3,n.dpr*3),Math.max(2,n.dpr*2)]),o.strokeRect(r.clipped.x,r.clipped.y,r.clipped.width,r.clipped.height)),o.restore()}minimapWorldPoint(e){let t=this.miniCanvas,n=this.miniTf;if(!t||!n)return null;let o=t.getBoundingClientRect(),s=(e.clientX-o.left)*(t.width/Math.max(1,o.width)),r=(e.clientY-o.top)*(t.height/Math.max(1,o.height));return{...(0,_t.minimapPointToWorld)({x:s,y:r},n),px:s,py:r}}minimapPointerDown(e){let t=this.minimapWorldPoint(e),n=this.host.controller.getViewport()?.visible;!t||!n||!(t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:t.x-(n.x+n.width/2),offsetY:t.y-(n.y+n.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 n=this.minimapWorldPoint(e);n&&(!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:n.x-t.offsetX,y:n.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 n=e.key==="ArrowLeft"?-t.width*.2:e.key==="ArrowRight"?t.width*.2:0,o=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!n&&!o||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+n,y:t.y+t.height/2+o}),e.preventDefault())}minimapJump(e){let t=this.minimapWorldPoint(e);if(t){for(let n of this.host.controller.getMinimapSnapshot().sections)if(!(n.state==="inactive"||n.outline.length<3)&&(0,Yr.pointInPolygon)(t,n.outline)){this.host.controller.focusSection(n.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var pn=require("@seatlayer/core");var qd=12;function Zr(i,e){let t=e.floors(),n=new Set(t.map(C=>C.label.trim().toLocaleLowerCase())),o=e.zones().filter(C=>C.seatCount>0&&!n.has(C.label.trim().toLocaleLowerCase())),s=e.sections().filter(C=>C.seatCount>0&&!n.has(C.label.trim().toLocaleLowerCase())),r=o.length>1?[]:s,a=t.length>1,l=o.length>1,c=r.length>1;if(!a&&!l&&!c)return null;let h=document.createElement("div");h.className="sl-view3d-nav";let d=null,u=document.createElement("button");u.type="button",u.className="sl-view3d-nav-toggle",u.setAttribute("aria-expanded","false");let p='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M15.5 8.5l-2 5-5 2 2-5z"/></svg>',f=document.createElement("span");u.innerHTML=p,u.appendChild(f);let b=()=>{for(let C of h.querySelectorAll(":scope > div")){let N=C.querySelector('[aria-pressed="true"]');!N||C.scrollWidth<=C.clientWidth||N.scrollIntoView({block:"nearest",inline:"nearest"})}},k=()=>{if(d)return d;for(let C of h.querySelectorAll(":scope > div")){let N=C.querySelector('button[aria-pressed="true"]'),M=N?.textContent?.trim();if(M&&N?.dataset.floor!=="")return M}return a&&(l||c)?g("picker.levelsAndAreas","Levels & areas"):a?g("picker.levels","Levels"):g("picker.areas","Areas")},x=C=>{h.classList.toggle("is-open",C),u.setAttribute("aria-expanded",String(C)),C&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(b),f.textContent=k()};u.addEventListener("click",()=>x(!h.classList.contains("is-open"))),h.addEventListener("keydown",C=>{C.key!=="Escape"||!h.classList.contains("is-open")||(C.preventDefault(),C.stopPropagation(),x(!1),u.focus())});let v=document.createElement("button");v.type="button",v.className="sl-view3d-nav-close",v.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let A=g("picker.closeVenueNavigation","Close venue navigation");v.setAttribute("aria-label",A),v.title=A,v.addEventListener("click",()=>{x(!1),u.focus()}),x(!1),h.appendChild(u);let y=C=>{},H=C=>{};if(a){let C=document.createElement("div");C.setAttribute("role","group"),C.setAttribute("aria-label",g("picker.levels","Levels"));let N=[];H=_=>{N.forEach(D=>{D.setAttribute("aria-pressed",String((D.dataset.floor===""?null:Number(D.dataset.floor))===_))})};let M=_=>{e.focusFloor(_)&&(H(_),y(_))},P=(_,D)=>{let V=document.createElement("button");V.type="button",V.textContent=_,V.dataset.floor=D===null?"":String(D),V.setAttribute("aria-pressed",String(D===null)),V.addEventListener("click",()=>{M(D),x(!1)}),N.push(V),C.appendChild(V)};P(g("picker.allLevels","All levels"),null);for(let _ of t)P(_.label||(0,pn.t)("picker.levelNumber",{number:_.index+1}),_.index);h.appendChild(C)}if(l||c){let C=document.createElement("div");C.setAttribute("role","group"),C.setAttribute("aria-label",g("picker.areas","Areas"));let N=l?o.map(P=>({id:P.id,label:P.label||P.id,go:()=>{e.focusZone(P.id)}})):r.map(P=>({id:P.id,label:P.label||P.id,floorIndex:P.floorIndex,go:()=>{e.focusSection(P.id),Number.isFinite(P.floorIndex)&&H(P.floorIndex)}})),M=P=>{let _=l||P===null?N:N.filter(D=>D.floorIndex===void 0||D.floorIndex===P);if(C.replaceChildren(),!_.length){C.remove();return}if(C.isConnected||h.insertBefore(C,v.isConnected?v:null),!l&&_.length>qd){let D=document.createElement("select");D.setAttribute("aria-label",g("picker.jumpToSection","Jump to section"));let V=document.createElement("option");V.value="",V.textContent=g("picker.jumpToSection","Jump to section"),D.appendChild(V);for(let ne of _){let ee=document.createElement("option");ee.value=ne.id,ee.textContent=ne.label,D.appendChild(ee)}D.addEventListener("change",()=>{_.find(ne=>ne.id===D.value)?.go()}),C.appendChild(D);return}for(let D of _){let V=document.createElement("button");V.type="button",V.textContent=D.label,V.dataset.area=D.id,V.addEventListener("click",()=>{d=D.label,D.go(),x(!1)}),C.appendChild(V)}};y=M,M(null)}return h.appendChild(v),i.appendChild(h),h}var hn=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",g("picker.savedSeatComparison","Saved seat comparison"));let s=document.createElement("button");s.type="button",s.className="main",s.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(g("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let r=document.createElement("button");r.type="button",r.className="clear",r.textContent="\xD7",r.setAttribute("aria-label",g("picker.clearSavedSeatComparison","Clear saved seat comparison")),r.addEventListener("click",()=>this.host.clearComparison()),t.append(s,r),e.appendChild(t),this.chip=t}let n=this.host.savedSeatIds().length,o=t.querySelector(".main");o&&(o.textContent=n>1?(0,pn.t)("picker.compareCount",{count:n}):g("picker.oneSeatSaved","1 seat saved"),o.setAttribute("aria-label",n>1?(0,pn.t)("picker.openComparisonOfSeats",{count:n}):g("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function Qr(i){return!i?.querySelector('[data-ref="zfs"]')}var Jr="sl:sheet-hint";function ea(i){let e=i.boot;if(!e?.isConnected)return;if(i.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),i.map?.appendChild(t),setTimeout(()=>t.remove(),650),i.rail?.classList.add("is-in"),i.root?.classList.add("is-arriving"),setTimeout(()=>{i.rail?.classList.remove("is-in"),i.root?.classList.remove("is-arriving"),Kd(i.root)},900)}function Kd(i){if(!i||i.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(Jr))return;window.sessionStorage.setItem(Jr,"1")}catch{}let e=i.querySelector(".sl-sheet-toggle");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function ta(i,e){i.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let n of e())if(n.open()){t.preventDefault(),t.stopPropagation(),n.close();return}}})}function un(i){let e=i.committedSelection(),t=i.controller.getGAAreas(),n=i.hold?.items??[],o=new Set(n.map(u=>u.label)),s=Hs(i,t,n),r=Ve(i.gaQty,n),a=n.reduce((u,p)=>u+i.paidPrice(p.categoryKey,p.tierId,p.unitPrice,p.label)*(p.quantity??1),0),l=n.reduce((u,p)=>u+(p.quantity??1),0),c=e.filter(u=>!o.has(u.label)),h=c.reduce((u,p)=>u+i.paidPrice(p.categoryKey,p.tierId??null,p.price,p.label)*(p.quantity??1),0)+s+a,d=c.reduce((u,p)=>u+(p.quantity??1),0)+r+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:n,heldLabels:o,heldCount:l,total:h,count:d}}function mn(i,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:i.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function fn(i,e){let t=e.tiers?.length?e.tiers.map(n=>i.paidPrice(e.key,n.id??null,n.price)):e.price==null?[]:[i.paidPrice(e.key,null,e.price)];if(e.key)for(let n of i.pricesByChannel.values())for(let o of n)o.categoryKey===e.key&&t.push(o.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var ai="seatlayer_";function Wd(){let i=globalThis;return i.document?.modelContext??i.navigator?.modelContext??null}function ge(i,e){return e?{ok:!1,reason:i,message:e}:{ok:!1,reason:i}}function Yd(i){return Array.isArray(i)?i.filter(e=>typeof e=="string"&&!!e):[]}function Xd(i,e){let t=i.event();if(!t)return ge("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits();return{ok:!0,event:t,selection:{max:n.max,...n.required!=null?{required:n.required}:{}},categories:i.categories(),zones:i.zones(),hasPremiumSeats:i.hasPremiumSeats(),holdsAllowed:e}}function ia(i,e){let t=o=>!!o&&o.toLowerCase()===e.toLowerCase(),n=i.find(o=>t(o.key??o.id))??i.find(o=>t(o.label));return n?.key??n?.id??null}function na(i,e){let t=e.map(n=>i.describeSeat(n.id));return{seatIds:e.map(n=>n.id),labels:e.map(n=>n.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((n,o)=>t[o]?.seat||n.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((n,o)=>n+o.price,0)}}function Zd(i,e,t){let n=new Map;for(let s of e){let r=n.get(s.rowKey);r?r.push(s):n.set(s.rowKey,[s])}let o=[];for(let s of n.values()){let r=[...s].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=r.length;l++)if(l===r.length||r[l].index!==r[l-1].index+1||r[l].categoryKey!==r[l-1].categoryKey){for(let h=a;h+t<=l;h+=t)o.push(na(i,r.slice(h,h+t)));a=l}}return o}function Qd(i,e,t){let n=new Map;for(let s of e){let r=n.get(s.sectionKey);r?r.push(s):n.set(s.sectionKey,[s])}let o=[];for(let s of n.values()){if(s.length<t)continue;let r=[...s].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);o.push(na(i,r.slice(0,t)))}return o}function Jd(i,e){if(!i.event())return ge("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits(),o=Math.floor(Number(e.count));if(!Number.isInteger(o)||o<1||o>n.max)return ge("bad_count",`count must be a whole number between 1 and ${n.max}.`);let s=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,r=e.together===void 0?!0:!!e.together,a=typeof e.max_price=="number"&&Number.isFinite(e.max_price)?e.max_price:null,l=typeof e.category=="string"&&e.category?e.category:null,c=typeof e.zone=="string"&&e.zone?e.zone:null,h=l?ia(i.categories(),l):null;if(l&&!h)return ge("no_match",`No ticket type called "${l}".`);let d=c?ia(i.zones(),c):null;if(c&&!d)return ge("no_match",`No zone called "${c}".`);let u=i.seats().filter(b=>b.available);if(!u.length)return ge("sold_out");let p=u.filter(b=>(!h||b.categoryKey===h)&&(!d||b.zoneId===d)&&(a==null||b.price<=a));if(!p.length)return ge("no_match");let f=r?Zd(i,p,o):Qd(i,p,o);return f.length?(f.sort((b,k)=>k.unitPrice!==b.unitPrice?k.unitPrice-b.unitPrice:b.row.localeCompare(k.row)||b.labels[0].localeCompare(k.labels[0])),{ok:!0,groups:f.slice(0,s),searched:{count:o,filters:{...a!=null?{max_price:a}:{},...h?{category:h}:{},...d?{zone:d}:{},together:r}}}):ge(r?"not_enough_together":"no_match")}function oa(i){return{ok:!0,...i.selection()}}function ep(i,e){let t=i.event();if(!t)return ge("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return ge("event_closed","Sales are closed for this event.");let n=Yd(e.seat_ids);return n.length?(i.clearSelection(),i.selectObjects(n),oa(i)):ge("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function tp(i,e){let t=async o=>{try{return await o()}catch(s){return ge("error",s instanceof Error?s.message:String(s))}},n=[{name:`${ai}describe_event`,title:"Describe this seated event",description:"Read the event, its ticket types with live availability and prices, its zones, and how many seats this buyer may select. Call this first.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>Xd(i,e))},{name:`${ai}find_seats`,title:"Find available seats",description:"Search the seat map for groups of available seats. Read-only: it never selects, holds or reserves anything. Returns candidate groups with their seat ids, prices and location.",inputSchema:{type:"object",properties:{count:{type:"integer",minimum:1,description:"How many seats are needed."},max_price:{type:"number",description:"Highest acceptable price per seat."},category:{type:"string",description:"Ticket type key or label to restrict the search to."},zone:{type:"string",description:"Zone id or label to restrict the search to."},together:{type:"boolean",description:"Require the seats to be side by side in one row (default true)."},limit:{type:"integer",minimum:1,maximum:20,description:"How many candidate groups to return (default 5)."}},required:["count"],additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:o=>t(()=>Jd(i,o))},{name:`${ai}select_seats`,title:"Select seats on the map",description:"Replace the current selection with the given seats, exactly as tapping them would. The buyer sees the seats light up and the basket update. No reservation is made.",inputSchema:{type:"object",properties:{seat_ids:{type:"array",items:{type:"string"},description:"Seat ids or labels, e.g. from find_seats."}},required:["seat_ids"],additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:o=>t(()=>ep(i,o))},{name:`${ai}get_selection`,title:"Read the current selection",description:"Read the seats currently selected in the basket, their total, any open reservation, and whether the selection satisfies this event\u2019s rules.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>oa(i))}];return e&&n.push({name:`${ai}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>i.hold())}),n}async function sa(i,e={}){let t=Wd();if(!t||typeof t.registerTool!="function")return null;let n=new AbortController,o=tp(i,!!e.holds),s=[],r=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of o)await t.registerTool(a,{signal:n.signal,...r?{exposedTo:r}:{}}),s.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return s.length?{names:s,dispose:()=>{if(n.abort(),typeof t.unregisterTool=="function")for(let a of s)try{t.unregisterTool(a)}catch{}}}:null}async function ra(i){let e=i.opts.webMcp;if(!e||i.destroyed)return;let t=typeof e=="object"&&!!e.holds,n=typeof e=="object"?e.exposedTo:void 0;try{i.webMcp=await sa(so(i,t),{holds:t,exposedTo:n}),i.destroyed&&oo(i)}catch(o){console.warn("seatmap: WebMCP registration failed",o)}}function oo(i){i.webMcp?.dispose(),i.webMcp=null}function so(i,e){let t=(n,o)=>{if(Number.isInteger(n.logicalSeatIndex))return n.logicalSeatIndex;let s=n.id.lastIndexOf(":"),r=s<0?NaN:Number(n.id.slice(s+1));return Number.isFinite(r)?r:o};return{event:()=>{let n=i.renderInfo;return n?{name:n.eventName??"",venue:n.venue??null,startsAt:n.startsAt??null,timezone:n.timezone??null,currency:i.currency,salesClosed:i.salesClosed}:null},selectionLimits:()=>({max:i.maxTickets,required:i.exactTickets}),categories:()=>{let n=i.controller.categoryAvailability();return(i.controller.doc?.categories??[]).filter(o=>!o.notForSale).map(o=>{let s=fn(i,o),r=mn(i,o);return{key:o.key,label:o.label??o.key,...r===void 0?{}:{price:r},...s&&s.min!==s.max?{priceRange:s}:{},available:n[o.key]??0}})},zones:()=>i.controller.getBestAvailableZones(),hasPremiumSeats:()=>i.controller.hasPremiumSeats(),seats:()=>{let n=i.controller.getActiveFloorId(),o=[];return i.allSeats().forEach((s,r)=>{if(s.floorId&&n&&s.floorId!==n)return;let a=i.controller.getStatus(s.id)??"free",l=i.controller.doc?.categories.find(h=>h.key===s.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;o.push({id:s.id,label:s.label,rowKey:s.logicalRowId??s.rowId,sectionKey:s.sectionId??s.rowId,index:t(s,r),categoryKey:s.categoryKey,price:i.paidPrice(s.categoryKey,l?.tiers?.[0]?.id??null,c,s.label),...s.zoneId?{zoneId:s.zoneId}:{},available:a==="free"&&!l?.notForSale})}),o},describeSeat:n=>{let o=i.controller.seatDetails(n);return o?{section:o.sectionLabel??"",row:X(o)??"",seat:o.seatNumber??o.label,category:o.categoryLabel??o.categoryKey}:null},selection:()=>{let{freshSeats:n,total:o,count:s}=un(i);return{seats:n.map(r=>({id:r.id,label:r.label,section:r.sectionLabel??"",row:X(r)??"",seat:r.seatNumber??r.label,category:r.categoryKey,price:i.paidPrice(r.categoryKey,r.tierId??null,r.price,r.label)})),count:s,total:o,currency:i.currency,hold:i.hold?{id:i.hold.holdId,expiresAt:i.hold.expiresAt}:null,validity:i.getSelectionValidity()}},clearSelection:()=>i.clearSelection(),selectObjects:n=>{i.selectObjects(n)},hold:()=>e?ip(i):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function ip(i){if(i.salesClosed)return{ok:!1,reason:"event_closed"};if(!i.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=i.controller.getSelectionValidity(i.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await i.handleCta(),i.hold?{ok:!0,hold:{id:i.hold.holdId,expiresAt:i.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function ro(i){return{renderingTimeMillis:i.ms,performanceProfile:i.performanceProfile,seatCount:i.seatCount,objectCount:i.objectCount,sectionCount:i.sectionCount,view:i.view,eventKey:i.eventKey,chartName:i.chartName,floorCount:i.floorCount,transport:i.transport,load:i.load,metricScope:i.metricScope,operationalTelemetryReporter:"sdk"}}function aa(i,e){Re({apiBase:i.apiBase,event:i.eventKey,scope:i.metricScope,surface:i.surface,outcome:"success",ms:i.ms,performanceProfile:i.performanceProfile,chartDelivery:i.chartDelivery,seats:i.seatCount,floors:i.floorCount,view:i.view,load:i.load,transport:i.transport}),e("chart_rendered",ro(i))}var la=require("@seatlayer/core/core/seatConfidence");function re(i){return String(i??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function ca(i){let e=(0,la.seatConfidenceDisclosure)(i.seat.confidenceEvidence),t=i.seat.confidenceEvidence,n=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${re(c)}</li>`).join("")}</ul>`:"",o=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${re(e.modeledTarget)}</dd></div>`:"",s=t?`<div><dt>Evidence ID</dt><dd>${re(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${re(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${re(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${re(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${re(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",r=Pi(i.seat.commercial).join(" \xB7 ")||i.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${re(r)}</dd></div>`+(i.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${re(i.seat.commercial.note)}</dd></div>`:""),l=i.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${re(i.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${re(e.headline)}</strong><span>${re(e.coverage)} \xB7 ${re(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${re(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${re(e.reality)}</dd></div><div><dt>Source</dt><dd>${re(e.provenance)}</dd></div>`+a+o+s+`</dl>${n}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function da(i){return i?i.closest("[data-report]")?"report":i.closest("[data-close]")||i.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function gn(i,e,t){let n=i?.querySelector("[data-report]"),o=i?.querySelector("[data-report-status]");n&&(n.disabled=e!=="failed",n.textContent=e==="received"?"Report received":"Report this view"),o&&(o.setAttribute("role",e==="failed"?"alert":"status"),o.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function ao(i,e,t=null){let n=i.view3dEl;if(!n)return;li(i,!1);let o=e.confidenceEvidence,s=i.controller.seatDetails(e.id),r=document.createElement("div");r.className="sl-view3d-passport-shell",r.innerHTML=ca({seat:e,title:s?.displayLabel??e.displayLabel??e.label,restrictionFallback:i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof i.api.reportViewEvidence=="function"});let a=[...new Set([...n.children,...[...i.els.map.children].filter(u=>u!==n)])].filter(u=>u instanceof HTMLElement),l=a.map(u=>({element:u,inert:u.inert,ariaHidden:u.getAttribute("aria-hidden")}));for(let u of a)u.inert=!0,u.setAttribute("aria-hidden","true");n.appendChild(r),n.classList.add("has-passport"),i.view3dPassportEl=r;let c=r.querySelector(".sl-view3d-passport"),h=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],d=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),li(i);return}if(u.key!=="Tab")return;let p=h();if(!p.length)return;let f=p[0],b=p[p.length-1];u.shiftKey&&document.activeElement===f?(u.preventDefault(),b.focus()):!u.shiftKey&&document.activeElement===b&&(u.preventDefault(),f.focus())};window.addEventListener("keydown",d,!0),i.view3dPassportCleanup=()=>{window.removeEventListener("keydown",d,!0);for(let b of l)b.element.inert=b.inert,b.ariaHidden===null?b.element.removeAttribute("aria-hidden"):b.element.setAttribute("aria-hidden",b.ariaHidden);let u=t?.isConnected?t:i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareEl?.querySelector("[data-passport-seat]")??null,p=u?.closest(".sl-confirm,.sl-view3d-compare");p?.isConnected&&(p.inert=!1,p.removeAttribute("aria-hidden")),r.remove(),n.classList.remove("has-passport"),i.view3dPassportEl===r&&(i.view3dPassportEl=null);let f=u??i.view3dCompareEl?.querySelector("[data-passport-seat]")??i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareChip.mainButton();(t?.isConnected?t:f)?.focus()},r.addEventListener("click",u=>{let p=da(u.target instanceof HTMLElement?u.target:null);p==="close"&&li(i),p==="report"&&np(i,e)}),requestAnimationFrame(()=>h()[0]?.focus()),i.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:o?.evidenceId??null,eventConfigurationId:o?.eventConfigurationId??null,modelLevel:o?.modelLevel??"unverified",realityLevel:o?.realityLevel??"none"})}async function np(i,e){if(i.api.reportViewEvidence){gn(i.view3dPassportEl,"sending");try{let t=await i.api.reportViewEvidence(i.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});i.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),gn(i.view3dPassportEl,"received",t.report.id)}catch{gn(i.view3dPassportEl,"failed")}}}function li(i,e=!0){let t=i.view3dPassportCleanup;if(i.view3dPassportCleanup=null,!t){i.view3dPassportEl?.remove(),i.view3dPassportEl=null,i.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function pa(i){let e=i.view3dEl;if(!e||i.view3dCompareSeatIds.length<2)return;st(i,!1);let t=i.view3dCompareSeatIds.map(p=>i.view3dComparisonSnapshot(p)).filter(p=>!!p);if(t.length<2){i.clearView3dComparison();return}let n=p=>E(p),o=t.some(p=>!!p.price),s=document.createElement("div");s.className="sl-view3d-compare-shell";let r=t.map((p,f)=>`<article><span>Seat ${f===0?"A":"B"}</span><strong>${n(p.label)}</strong><small>Section ${n(p.section)} \xB7 Row ${n(p.row)}</small><dl>`+(o?`<div><dt>Current price</dt><dd>${n(p.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${n(p.category)}</dd></div><div><dt>Availability</dt><dd>${n(p.availability)}</dd></div><div><dt>View source</dt><dd>${n(p.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${n(p.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${n(p.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${n(p.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${n(p.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${n(p.seat.id)}">Passport</button><button type="button" data-view-seat="${n(p.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${n(p.seat.id)}"${p.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">${o?"Current price and availability":"Availability"} comes from this picker. Modeled views are chart-derived unless organizer media is labeled.</p><div class="sl-view3d-compare-grid">${r}</div></section>`;let a=document.activeElement instanceof HTMLElement?document.activeElement:null,l=[...e.children].filter(p=>p instanceof HTMLElement),c=l.map(p=>({element:p,inert:p.inert,ariaHidden:p.getAttribute("aria-hidden")}));for(let p of l)p.inert=!0,p.setAttribute("aria-hidden","true");e.appendChild(s),e.classList.add("has-comparison"),i.view3dCompareEl=s;let h=s.querySelector(".sl-view3d-compare"),d=()=>[...h.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],u=p=>{if(p.key==="Escape"){p.preventDefault(),st(i);return}if(p.key!=="Tab")return;let f=d();if(!f.length)return;let b=f[0],k=f[f.length-1];p.shiftKey&&document.activeElement===b?(p.preventDefault(),k.focus()):!p.shiftKey&&document.activeElement===k&&(p.preventDefault(),b.focus())};window.addEventListener("keydown",u),i.view3dCompareCleanup=()=>{window.removeEventListener("keydown",u);for(let p of c)p.element.inert=p.inert,p.ariaHidden===null?p.element.removeAttribute("aria-hidden"):p.element.setAttribute("aria-hidden",p.ariaHidden);s.remove(),e.classList.remove("has-comparison"),i.view3dCompareEl===s&&(i.view3dCompareEl=null),a?.isConnected?a.focus():i.view3dCompareChip.mainButton()?.focus()},s.querySelector("[data-close]")?.addEventListener("click",()=>st(i)),s.querySelectorAll("[data-passport-seat]").forEach(p=>p.addEventListener("click",()=>{let f=p.dataset.passportSeat,b=f?i.allSeats().find(k=>k.id===f):void 0;b&&ao(i,b,p)})),s.querySelectorAll("[data-view-seat]").forEach(p=>p.addEventListener("click",()=>{let f=p.dataset.viewSeat;st(i,!1),f&&i.view3dHandle?.flyToSeat(f)})),s.querySelectorAll("[data-select-seat]").forEach(p=>p.addEventListener("click",()=>{let f=p.dataset.selectSeat;f&&op(i,f)})),requestAnimationFrame(()=>d()[0]?.focus()),i.emit3dAnalytics("3d_comparison_opened",{seatIds:i.view3dCompareSeatIds.slice()})}function st(i,e=!0){let t=i.view3dCompareCleanup;if(i.view3dCompareCleanup=null,!t){i.view3dCompareEl?.remove(),i.view3dCompareEl=null,i.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function op(i,e){if(i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=i.allSeats().find(o=>o.id===e);if(!t)return;if(st(i,!1),!i.controller.select([e]).length){i.syncSelectionTo3d(),i.toast(i.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}i.syncSelectionTo3d(),i.showConfirm(t),i.emit3dAnalytics("3d_comparison_selected",{seatId:e})}var ma=require("@seatlayer/core/view3d/crossfade/panorama");var lo=require("@seatlayer/core");var sp=900,rp=450;function ap(i){switch(i){case"seat":return g("picker.stopYourSeat","Your seat");case"row":return g("picker.stopYourRow","Your row");case"section":return g("picker.stopYourSection","Your section");default:return g("picker.stopWholeVenue","Whole venue")}}function ha(i,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let n=g("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",n),t.title=n,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let o=document.createElement("div");o.className="sl-view3d-stop",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),i.append(t,o);let s=null,r=null;return{onStopChange(a){if(s&&(clearTimeout(s),s=null),r&&(clearTimeout(r),r=null),!a){o.classList.remove("is-shown"),o.textContent="",r=setTimeout(()=>{r=null,i.classList.remove("is-seat-view")},rp);return}i.classList.add("is-seat-view"),o.textContent=ap(a),o.classList.add("is-shown"),s=setTimeout(()=>{s=null,o.classList.remove("is-shown")},sp)},dispose(){s&&(clearTimeout(s),s=null),r&&(clearTimeout(r),r=null),t.remove(),o.remove(),i.classList.remove("is-seat-view")}}}var lp=44,cp=92;function ua(i,e,t,n={}){let o=i?.sectionLabel,s=X(i),r=dp(i,e),a=[o,s?(0,lo.t)("picker.rowLabel",{label:s}):null,r?(0,lo.t)("picker.seatLabel",{label:r}):null].filter(Boolean).join(" \xB7 "),l=n.maxChars??(n.narrow?lp:cp);for(let c of[t,n.shortTail??t,null]){let h=[a,c].filter(Boolean).join(" \xB7 ");if(h.length<=l||c==null)return h}return a}function dp(i,e){if(i?.seatNumber)return i.seatNumber;let t=i?.displayLabel??e,n=o=>{!o||!t.startsWith(o)||t.length<=o.length||(t=t.slice(o.length).replace(/^[\s·\-\/_]+/,""))};return n(i?.sectionLabel),n(X(i)),t}var fa=require("@seatlayer/core/core/seatConfidence");function ga(i){return i.buyerView}function ba(i,e,t){if(e==="map"){i.exit3d();return}let n=t?.flyToSeatId;if(i.buyerView==="venue3d"){n?(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:n}),i.view3dHandle?.flyToSeat(n)):t?.resetView&&i.view3dHandle?.focusOverview();return}i.enter3d(n)}function ya(i,e){switch(i.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return i.priceBandKeys!=null&&!i.priceBandKeys.has(e.categoryKey)||i.controller.accessibilityFilterDims?.(e)||i.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}function va(i){if(!i.view3dHandle)return;let e=i.allSeats().map(t=>({seatId:t.id,state:i.seatState3dFor(t)}));i.view3dHandle.setAvailability(e)}function wa(i){i.view3dHandle&&i.view3dHandle.setSelection(i.controller.getSelection().map(e=>e.id))}async function xa(i,e){let t=i.allSeats().find(n=>n.id===e);if(!t)return null;if(t.viewUrl)try{let n=t.viewMeta?.previewUrl,o=!!n&&n!==t.viewUrl,s=o?await i.buyerAssetUrls.resolve(n):null,r=o?t.viewUrl:await i.buyerAssetUrls.resolve(t.viewUrl);return!r||o&&!s?null:{url:r,...s?{previewUrl:s}:{},...o?{resolveUrl:a=>i.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(n){return i.opts.onError?.(n),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:i.tf("picker.chartDerivedModel","Chart-derived model")}}function Sa(i,e){if(i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),i.syncSelectionTo3d();return}let t=i.allSeats().find(a=>a.id===e);if(!t)return;let n=i.controller.tableSelection(e);if(i.committedSelection().some(a=>n?a.label===n.label:a.id===e)){i.controller.deselect([e]),i.dismissConfirm(),i.syncSelectionTo3d();return}let s=i.controller.getStatus(t.id);if(s==="held"||s==="booked"||s==="not_for_sale"){i.syncSelectionTo3d();return}if(!i.controller.select([e]).length){i.syncSelectionTo3d(),i.dismissConfirm();return}if(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),i.flashPickedSeat(e),n){i.showTableDialog(n,!1),i.syncSelectionTo3d();return}i.opts.confirmSelection!==!1?i.showConfirm(t):i.syncTray(),i.syncSelectionTo3d()}function ka(i,e){let t=i.allSeats().find(n=>n.id===e);return ua(i.controller.seatDetails(e),t?.displayLabel??t?.label??e,i.tf("picker.viewFromYourSeat","view from your seat"),{narrow:i.root?.dataset.layout==="narrow",shortTail:i.tf("picker.fromYourSeat","from your seat")})}function Ta(i,e){if(i.buyerView!=="venue3d")return;let t=i.view3dCompareSeatIds;t.includes(e.id)||(i.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),i.confirmSeat?.id===e.id&&(i.controller.deselect([e.id]),i.dismissConfirm(),i.syncSelectionTo3d(),i.syncTray()),i.view3dCompareChip.sync(),i.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:i.view3dCompareSeatIds.length}),i.view3dCompareSeatIds.length>1?i.openView3dComparison():i.toast(i.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}function Ea(i){i.closeView3dComparison(!1),i.view3dCompareSeatIds=[],i.view3dCompareChip.remove(),i.emit3dAnalytics("3d_comparison_cleared")}function Ca(i,e){let t=i.allSeats().find(f=>f.id===e);if(!t)return null;let n=i.controller.seatDetails(t.id),o=i.controller.doc?.categories.find(f=>f.key===t.categoryKey),s=n?.price??(o?.tiers?.length?o.tiers[0].price:o?.price),r=s!=null?i.paidPrice(t.categoryKey,n?.tierId??o?.tiers?.[0]?.id??null,s,t.label):void 0,a=i.controller.getStatus(t.id),l=a==="held"?i.tf("picker.temporarilyHeld","Temporarily held"):a==="booked"?i.tf("picker.sold","Sold"):a==="not_for_sale"?i.tf("picker.notForSale","Not for sale"):i.tf("picker.available","Available"),c=t.viewUrl?(0,ma.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}:{}}):i.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),h=Pi(t.commercial).join(" \xB7 ")||i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),d=Yo({...t.accessibility?.length?{accessibility:t.accessibility}:{},...n?.wheelchairSpaceType?{wheelchairSpaceType:n.wheelchairSpaceType}:{}}),u=d.length?`${d.join(" \xB7 ")} \xB7 metadata, not access certification`:i.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),p=(0,fa.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:n?.displayLabel??t.displayLabel??t.label,section:n?.sectionLabel??t.sectionId??"\u2014",row:X(n)??n?.rowLabel??"\u2014",category:n?.categoryLabel??o?.label??t.categoryKey,price:i.suppressPricing||r==null?"":i.money(r),availability:l,selectable:a==null||a==="free",viewSource:c,limited:h,accessibility:u,confidence:p}}async function Aa(i,e){if(i.view3dEl||!i.canOffer3d()||!i.els.map)return;let t=i.controller.doc;if(!t)return;i.buyerView="venue3d",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),i.root?.setAttribute("data-view3d","on"),i.dismissConfirm(),i.syncProjection(),i.syncTray();let n=document.createElement("div");n.className="sl-view3d sl-mo-zoom",n.setAttribute("role","group"),n.setAttribute("aria-label",i.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let o=document.createElement("button");o.type="button",o.className="sl-view3d-back",o.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${i.tf("picker.backToMap","Back to map")}</span>`;let s=o.querySelector("span"),r=c=>{i.view3dTargetSeatId=c;let h=!!c;n.classList.toggle("is-seat-focused",h),i.root&&(i.root.dataset.view3dSeat=h?"on":"off");let d=h?i.tf("picker.backToVenue","Back to venue"):i.tf("picker.backToMap","Back to map");s&&(s.textContent=d),o.setAttribute("aria-label",d)};if(o.addEventListener("click",()=>{if(i.view3dTargetSeatId&&i.view3dHandle){i.view3dHandle.focusOverview();return}i.exit3d()}),i.regions["top-left"]?.prepend(o),i.view3dBack=o,i.publish3dTopInset(),Qr(i.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6";let h=i.tf("picker.fullScreen","Full screen");c.setAttribute("aria-label",h),c.title=h,c.setAttribute("aria-pressed",String(!!document.fullscreenElement||i.fsFallback||i.framedFs)),c.addEventListener("click",()=>i.toggleFullscreen()),n.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=i.tf("picker.loading3d","Building the 3D venue\u2026"),n.appendChild(a),i.els.map.appendChild(n),i.view3dEl=n,i.view3dCompareChip.sync(),requestAnimationFrame(()=>{n.style.opacity="1"});let l=++i.view3dGen;try{let c=i.allSeats(),[h,d]=await Promise.all([Zt(),i.controller.loadEventConfiguration()]),u=d?await $i(d,v=>i.buyerAssetUrls.resolve(v)):null,p=t.theme?.venue3d?.shellAssetUrl,f=await ji(p,v=>i.buyerAssetUrls.resolve(v));if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let b={doc:t,seats:c,...u?{eventConfigurationId:u.id,eventConfiguration:u}:{},...f?{registeredShellGlb:f}:{}};a.textContent=i.tf("picker.building3d","Building venue geometry\u2026");let k=await h.prepareVenue3D(b);if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let x=h.mountVenue3D(n,{...b,prepared:k},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:Qe(),navLabels:Si(),seatViewActionLabel:v=>i.allSeats().find(A=>A.id===v)?.viewUrl?i.tf("picker.openAuthored360","Open venue 360\xB0"):i.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:v=>i.seatViewCaption(v),onSeatViewStopChange:v=>i.view3dSeatViewChrome?.onStopChange(v),onSeatPick:v=>i.onView3dSeatPick(v),onSeatInspect:v=>i.onView3dSeatPick(v),onSectionFocusChange:v=>{let A=n.querySelector('select[data-locator="section"]'),y=v??"";!A||A.value===y||(A.value=y,A.dispatchEvent(new Event("change")))},onViewTargetChange:v=>{n.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!v),r(v),i.opts.onBuyerViewChange?.({view:"venue3d",...v?{seatId:v}:{}})},...i.seatViewEnabled()?{getSeatView:v=>new Promise((A,y)=>{let H=()=>{i.seatViewFor3d(v).then(N=>{N?A(N):y(new Error("seat_view_unavailable"))})},C=globalThis.requestIdleCallback;typeof C=="function"?C(H,{timeout:1500}):setTimeout(H,50)})}:{},onAnalytics:(v,A)=>i.emit3dAnalytics(v,A)});i.view3dHandle=x,i.view3dSeatViewChrome=ha(n,{handle:()=>i.view3dHandle}),requestAnimationFrame(()=>a.remove()),i.pushAvailabilityTo3d(),i.syncSelectionTo3d(),i.view3dNav=Zr(i.regions["bottom-left"]??n,x),e&&x.flyToSeat(e)}catch(c){if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;i.opts.onError?.(c),i.toast(i.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),i.exit3d()}}function Pa(i){let e=i.regions["top-left"];if(!i.root||!e)return;let t=()=>{!i.root||i.root.dataset.view3d!=="on"||i.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}function Ma(i){if(i.buyerView!=="venue3d"&&!i.view3dEl)return;i.view3dGen++,i.buyerView="map",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"map"}),i.root?.removeAttribute("data-view3d"),i.closeSeatConfidencePassport(!1),i.closeView3dComparison(!1),i.view3dCompareChip.remove(),i.view3dSeatViewChrome?.dispose(),i.view3dSeatViewChrome=null,i.view3dBack?.remove(),i.view3dBack=null,i.view3dNav?.remove(),i.view3dNav=null,i.root?.removeAttribute("data-view3d-seat"),i.root?.style.removeProperty("--sl-3d-top-inset");try{i.view3dHandle?.dispose()}catch{}i.view3dHandle=null;let e=i.view3dEl;i.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),i.syncProjection(),i.syncTray();let t=i.view3dReturnSeat;i.view3dReturnSeat=null,t&&i.committedSelection().some(n=>n.id===t.id)&&i.opts.confirmSelection!==!1&&i.showConfirm(t)}var Da=require("@seatlayer/core");var ci=require("@seatlayer/core");function La(i){return Array.isArray(i)?i.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function bn(i,e,t=!1){let n=i.violations[0];return n==="numberOfPlacesToSelect"?i.remaining>0?(0,ci.t)("picker.selectExactMore",{count:i.remaining}):(0,ci.t)("picker.selectExactCount",{count:i.required}):n==="minimumSelectedPlaces"?(0,ci.t)("picker.selectMinimumMore",{count:i.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):n==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):(0,ci.t)("picker.orphanHint")}var di=require("@seatlayer/core");function Ha(i){let e=Math.max(0,i),t=Math.floor(e/6e4),n=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${n}`}function Ra(i){let e=i.performanceLabel?`<div class="sl-chip-when">${B(i.performanceLabel)}</div>`:"",t=i.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${B(i.performanceDates.summary)}</span><span class="sl-chip-date-list">${i.performanceDates.labels.map(n=>`<span class="sl-chip-date">${B(n)}</span>`).join("")}</span></div>`:"";return e+hp(i)+t}function hp(i){let{d:e,area:t,label:n,objectType:o,quantity:s=1,identity:r}=i,a=A=>String(A??"\u2014").replace(/[&<>"]/g,y=>({"&":"&","<":"<",">":">",'"':"""})[y]),l=o==="ga"?"ga":e?.objectType??o,c=r?.displayType?.trim()||e?.displayType?.trim()||t?.displayType?.trim()||(l==="table"?g("picker.table","Table"):l==="booth"?g("picker.booth","Booth"):l==="ga"?g("picker.generalAdmission","General admission"):g("picker.row","Row")),h=r?.rowLabel??r?.displayLabel??e?.rowLabel??e?.displayLabel??t?.label??n,d=i.categoryLabel?.trim()??"",u="",p=[];l==="table"&&r?.bookingMode?(u=`${c} ${h}`,p.push([g("picker.guests","Guests"),String(s)])):l==="ga"?(u=String(t?.displayLabel??h),s>1&&p.push([g("picker.tickets","Tickets"),String(s)])):l==="booth"?(u=e?.sectionLabel??`${c} ${h}`,e?.sectionLabel&&p.push([c,String(h)])):!e?.sectionLabel&&!e?.rowLabel&&!e?.seatNumber?u=String(h):(u=e.sectionLabel??"",e.rowLabel&&p.push([c,String(X(e)??e.rowLabel)]),e.seatNumber&&p.push([g("picker.seat","Seat"),String(e.seatNumber)]));let f=!u&&!!d,b=u||d||String(h),k=!!d&&!f&&d!==b,x=p.map(([A,y])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(A)}</span> <b>${a(y)}</b></span>`);k&&x.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(d)}</span></span>`);let v=[b,...p.map(([A,y])=>`${A} ${y}`),k?d:""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(v)}</span><span class="sl-chip-name" aria-hidden="true">${a(b)}</span>`+(x.length?`<span class="sl-chip-pos" aria-hidden="true">${x.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function up(i){let e=B;return` data-key="${e(i.key)}"`+(i.heldLabels.length?` data-held="${e(encodeURIComponent(i.heldLabels.join(`
|
|
2916
|
-
`)))}"`:"")+(i.seatIds.length?` data-seat="${e(i.seatIds.join(" "))}"`:"")+(i.locateId?` data-locate="${e(i.locateId)}"`:"")}function Ia(i){let e=B;return`<div class="sl-chip${i.held?" sl-held":""}${i.fresh?" sl-enter":""}"`+up(i)+">"+(i.held?i.stateHtml:`<span class="sl-chip-dot" style="background:${E(i.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${i.identityHtml}`+(i.extrasHtml?`<div class="sl-chip-sub">${i.extrasHtml}</div>`:"")+`${i.noteHtml}</div>`+(i.amountText?`<span class="amt">${e(i.amountText)}</span>`:"")+i.railHtml+"</div>"}function co(i,e){let t=B(i),n=e?B(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${n}" aria-label="${B((0,di.t)("picker.viewFromSeat",{label:e}))}"><svg viewBox="0 0 24 24"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z"/><circle cx="12" cy="12" r="3"/></svg></button>`:"")+`<button type="button" class="rm" aria-label="${t}"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function Oa(i){return i.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${g("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,di.t)("picker.willFindSeatsTogether",{count:i.quantity})}</b><span>${g("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>${g("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${g("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="sl-ba-title-t">${g("picker.findSeatsTogether","Find seats together")}</span>`+St({id:"sl-info-best-seats",label:g("picker.aboutBestSeats","About finding seats together"),text:g("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")})+(i.offerPremium?`<button type="button" class="sl-ba-premium${i.premium?" on":""}" data-ba-premium aria-pressed="${i.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${g("picker.bestSeatsPremium","Best seats")}</button>`:"")+`</div><div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${g("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${i.quantity}</span><button type="button" data-ba="1" aria-label="${g("picker.moreSeats","More seats")}">+</button></div>`+(i.categories.length>1?`<select class="sl-ba-cat" aria-label="${B(g("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${B(g("picker.anyTicketType","Any ticket type"))}</option>`+i.categories.map(e=>`<option value="${B(e.key)}"${i.selectedCategory===e.key?" selected":""}>${B(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(i.zones.length?`<select class="sl-ba-zone" aria-label="${g("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${g("picker.anyVenueZone","Any venue zone")}</option>`+i.zones.map(e=>`<option value="${B(e.id)}"${i.selectedZone===e.id?" selected":""}>${B(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${i.busy?" sl-busy":""}"${i.busy?" disabled":""}>`+(i.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${g("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,di.tCount)("picker.findBestSeatsCount",i.quantity))+"</button>"+(i.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${g("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function _a(i){if(i.salesClosed&&!i.hasPicks){let e=i.whenText?`<span class="when">${B(i.whenText)}</span>`:"";return`<div class="sl-closed-note" role="status"><b>${g("picker.salesClosedPill","Sales are closed")}</b><span>${g("picker.salesClosedCopy","Ticket sales for this event have ended.")}${e}</span></div>`}return""}function Na(i){return i.hasGaAreas?i.seated?i.venue3d?g("picker.trayHintChoose3dOrStanding","Choose a seat in the 3D venue \u2014 or grab standing tickets below."):g("picker.trayHintTapOrStanding","Tap a seat on the map \u2014 or grab standing tickets below."):i.venue3d?g("picker.gaTrayHintChoose3dArea","Choose an area in the 3D venue to select tickets."):g("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets."):i.groupMode==="per_performance"?g("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):i.groupMode?g("picker.groupTrayHint","Choose seats once \u2014 the same seats will be held for every performance."):i.venue3d?g("picker.trayHintChoose3dOrBest","Choose a seat in the 3D venue, or let us pick the best available for you."):g("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}var po=6e4,Ba=5*6e4,mp=String(Math.round(Ba/6e4));function Fa(i){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(i.regions["bottom-center"]??i.els.map).appendChild(e),i.extendEl=e,i.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),i.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),i.els.extendBtn.textContent=Va(i),i.els.extendDismiss.setAttribute("aria-label",i.tf("picker.close","Close")),i.els.extendBtn.addEventListener("click",()=>{i.handleExtend()}),i.els.extendDismiss.addEventListener("click",()=>{i.extendDismissed=!0,i.setExtendPrompt(!1,0)})}function Va(i){return i.tf("picker.addMinutes","+{count} min").replace("{count}",mp)}function za(i){let e=i.hold?.items??[],t=new Set(e.map(o=>o.label));return i.committedSelection().filter(o=>!t.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0)+Ve(i.gaQty,i.hold?.items??[])}function $a(i){return(i.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function ja(i){let e=new Set((i.hold?.items??[]).map(n=>n.label)),t=i.committedSelection().filter(n=>!e.has(n.label)).reduce((n,o)=>n+(o.quantity??1),0);return i.heldTicketCount()+t+Ve(i.gaQty,i.hold?.items??[])}function Ga(i){let e=new Set((i.hold?.items??[]).map(o=>o.label)),t=i.committedSelection().filter(o=>e.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0),n=Math.max(0,i.maxTickets-i.heldTicketCount()-Ve(i.gaQty,i.hold?.items??[]));i.controller.setMaxSelection(t+n)}function Ua(i,e=i.lastTrayCount,t=i.pendingSelectionCount()){let n=i.els.cta;if(!n)return;if(delete n.dataset.act,i.salesClosed){n.disabled=!0,n.textContent=i.tf("picker.salesClosedCta","Sales closed");return}if(i.confirmSeat||i.tableDialog&&!i.tableDialogHeld){n.disabled=!0,n.textContent=i.tableDialog?i.tf("picker.confirmYourTable","Confirm your table"):i.tf("picker.confirmOrCancelSeat","Confirm or cancel this seat");return}if(i.ctaPhase==="holding"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(i.ctaPhase==="checkout"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let o=!i.hold&&i.performanceGroup?.selectionMode==="per_performance"?i.performanceGroup.submissionState?.():null;if(o&&!o.ready){n.disabled=!0,n.textContent=i.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(o.complete)).replace("{total}",String(o.total));return}let s=i.controller.getSelectionValidity(e);if(s&&!s.isValid){n.disabled=!0,n.textContent=bn(s,(r,a)=>i.tf(r,a),!0);return}if(!e&&i.root?.dataset.layout==="narrow"&&!i.performanceGroup&&!i.hold){n.disabled=!1,n.dataset.act="find",n.textContent=i.tf("picker.findBestSeats","Find best seats");return}n.disabled=e===0,n.textContent=i.hold?t?(0,Da.t)("picker.secureMoreAndCheckout",{count:t}):i.tf("picker.continueToCheckout","Continue to checkout"):e?i.performanceGroup?i.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(i.performanceGroup.performanceCount)):i.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):i.tf("picker.selectSeats","Select seats")}function qa(i,e){i.ctaPhase=e,i.syncCta()}async function Ka(i,e,t){i.setCtaPhase("checkout");try{await i.checkoutHandoff(e,t)}finally{i.ctaPhase==="checkout"&&!i.bookedShown&&i.setCtaPhase("idle")}}function Wa(i){return`@seatlayer/hold/v1/${encodeURIComponent(i.apiBase)}/${encodeURIComponent(i.opts.event)}`}function Ya(i){if(i.opts.initialHoldId)return i.opts.initialHoldId;if(i.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(i.holdStorageKey())}catch{return null}}function Xa(i,e){if(!(i.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(i.holdStorageKey(),e.holdId)}catch{}}function Za(i){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(i.holdStorageKey())}catch{}}async function Qa(i,e){try{let t=await i.controller.resumeHold(e);if(!t||i.destroyed)return null;let n={holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items};return i.hold=n,i.handedOff=!0,i.bookedShown=!1,i.ctaPhase="idle",i.startHoldTimer(n.expiresAt),i.rememberHold(n),i.syncTray(),i.emitHoldChange(),i.opts.onHoldRestored?.(n,n.seats??[],i.buildHandoff(n)),n}catch(t){let n=t?.status;return n===404||n===409?i.forgetHold():i.opts.onError?.(t),null}}async function Ja(i){let e=i.rememberedHoldId();e&&await i.resumeHoldFromServer(e)}function el(i,e){i.stopHoldTimer(),i.holdExpiresAt=e,i.extendDismissed=!1,i.extendUsed=!1,i.hold&&i.rememberHold(i.hold);let t=i.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${i.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let n=t.querySelector('[data-ref="holdTime"]'),o=()=>{let s=Math.max(0,i.holdExpiresAt-Date.now());n&&(n.textContent=Ha(s)),t.classList.add("on"),t.classList.toggle("is-expiring",s>0&&s<=po),i.setExtendPrompt(s>0&&s<=po,s),(s<=0||!i.controller.currentHold())&&i.stopHoldTimer()};i.holdTimer=setInterval(o,500),o()}function tl(i){i.holdTimer&&clearInterval(i.holdTimer),i.holdTimer=null,i.els.hold?.classList.remove("on","is-expiring"),i.setExtendPrompt(!1,0)}function il(i,e,t){if(!i.extendEl)return;let n=e&&t>0&&i.root?.dataset.layout!=="narrow"&&!i.extendDismissed&&!i.extendUsed&&!!i.controller.currentHold()&&!i.bookedShown;i.extendEl.classList.toggle("on",n)}function nl(i){if(!i.holdTimer)return;let e=Math.max(0,i.holdExpiresAt-Date.now());i.setExtendPrompt(e>0&&e<=po,e)}async function ol(i){let e=i.els.extendBtn,t=i.controller.currentHold();if(!(!t||!i.api.extend||i.extendUsed)){e.disabled=!0,e.textContent=i.tf("picker.addingEllipsis","Adding\u2026");try{let n=await i.api.extend(i.controller.key,t.holdId,Ba);if(i.controller.currentHold()?.holdId!==t.holdId)return;i.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:n.expiresAt,items:t.items});let o=i.controller.currentHold();if(!o)return;i.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},i.holdExpiresAt=o.expiresAt,i.extendUsed=!0,i.extendEl?.classList.remove("on"),i.rememberHold(i.hold),i.emitHoldChange(),i.toast(i.tf("picker.moreTimeAdded","More time added \u2014 your seats are still held."),"success")}catch(n){if(n?.reason==="extend_limit"){i.extendUsed=!0,i.setExtendPrompt(!1,0);return}i.opts.onError?.(n),i.toast(i.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=Va(i)}}}var uo=require("@seatlayer/core");function sl(i){return i?.previousPrice!=null&&i.previousPrice>i.price?i.previousPrice:null}function rl(i){return gp(i)+(i.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!i.collapsed}">${i.esc(i.moreLabel)}</button>`:"")+bp(i.status)}function gp(i){let{esc:e,money:t}=i;return i.categories.map(n=>{let o=i.priceOf(n),s=i.rangeOf(n),r=i.offerOf(n.key),a=sl(r),l=i.activeKey===n.key;return`<div class="sl-price-row${i.bandKeys!=null&&!i.bandKeys.has(n.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(n.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(i.titleFor(n,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(i.colorOf(n))}"></span><span class="sl-price-label">${e(n.label)}`+(r?.offerName?`<small class="sl-price-offer">${e(r.offerName)}</small>`:"")+"</span>"+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(s!=null?`<span class="sl-price-amt">${s.min===s.max?e(t(s.min)):`${e(t(s.min))}\u2013${e(t(s.max))}`}</span>`:o!=null?`<span class="sl-price-amt">${e(t(o))}</span>`:"")+"</div>"}).join("")}function bp(i){let e=t=>t.replace(/[&<>"']/g,n=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[n]);return`<div class="sl-status-key" aria-label="${e(i.legend)}"><span class="sl-status-item"><i class="sl-status-icon unavailable" aria-hidden="true"></i>${e(i.unavailable)}</span></div>`}function ho(i){let e=Math.abs(i.scrollLeft),t=e>2,n=e+i.clientWidth<i.scrollWidth-2;return i.dataset.fadeStart=String(t),i.dataset.fadeEnd=String(n),{start:t,end:n}}function al(i){let{esc:e,money:t}=i;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${i.allActive}" title="${e(i.allWord)}"><span class="sl-rc-t">${e(i.allWord)}</span></button>`+i.categories.map(o=>{let s=i.rangeOf(o),r=i.priceOf(o),a=s?s.min===s.max?t(s.min):`${t(s.min)}+`:r!=null?t(r):null,l=Object.prototype.hasOwnProperty.call(i.left,o.key)&&i.left[o.key]<=0,c=sl(i.offerOf(o.key)),h=a?`${o.label} \u2014 ${a}${l?` (${i.soldOutWord})`:""}`:o.label;return`<button type="button" class="sl-rc" data-cat="${e(o.key)}" aria-pressed="${i.activeKey===o.key}" aria-label="${e(h)}" title="${e(h)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(i.colorOf(o))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??o.label)}</span></button>`}).join("")}function ll(i,e){let t=i.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let n=[...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(n.length<=5)return n.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let o=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),s=Math.ceil(o.length/4),r=[];for(let a=0;a<o.length;a+=s){let l=o.slice(a,a+s),c=Math.min(...l.map(d=>d.range.min)),h=Math.max(...l.map(d=>d.range.max));r.push({id:`b${a}`,label:c===h?e.money(c):`${e.money(c)}\u2013${e.money(h)}`,keys:l.map(d=>d.key),min:c,max:h})}return r}function cl(i){if(i.suppressPricing||!i.els.prices||!i.els.pricesSec)return;let e=ll(i.controller.doc?.categories??[],i.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",i.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let n=document.createElement("option");n.value="all",n.textContent=i.tf("picker.allPrices","All prices"),t.appendChild(n);for(let o of e){let s=document.createElement("option");s.value=o.id,s.textContent=o.label,t.appendChild(s)}i.els.pricesSec.appendChild(t),i.priceSelect=t,t.addEventListener("change",()=>{i.applyPriceBand(e.find(o=>o.id===t.value)?.keys??null)})}function dl(i,e){if(i.focusedCatKey=null,i.priceBandKeys=e?new Set(e):null,i.priceSelect){let t=e?i.priceSelect.value:"all";i.priceSelect.value!==t&&(i.priceSelect.value=t)}i.controller.setCategoryFilter(e),i.controller.focusCategoryFilter(e),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}function pl(i){return{colorOf:e=>i.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>i.catPriceRange(e),priceOf:e=>i.catPrice(e),offerOf:e=>i.offerPrice(e),money:e=>i.money(e),esc:B}}function hl(i,e,t,n=i.legendDeps()){let o=i.els.railScroll,s=e.length>1;if(i.els.rail?.classList.toggle("has",s),!o)return;o.innerHTML=s?al({...n,categories:e,left:t,activeKey:i.focusedCatKey,soldOutWord:i.tf("picker.soldOut","Sold out"),allWord:i.tf("picker.allPrices","All prices"),allActive:!i.focusedCatKey&&!i.priceBandKeys}):"";let r=e.map(a=>a.key).join("|");i.lastRailSignature!==r&&(i.lastRailSignature=r,o.scrollLeft=0),o.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){i.applyPriceBand(null);return}i.focusCategory(a.dataset.cat??"")})}),i.railEdgesBound||(i.railEdgesBound=!0,o.addEventListener("scroll",()=>ho(o),{passive:!0})),requestAnimationFrame(()=>ho(o))}function ul(i){let e=i.controller.doc;if(!e||!i.els.prices)return;let t=i.controller.categoryAvailability(),n=e.categories.filter(d=>!d.notForSale);i.syncSoldout(n,t);let o=i.legendDeps(),s=i.suppressPricing,r=s?{...o,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:o;s&&(i.els.pricesSec?.querySelector("span")?.replaceChildren(i.tf("picker.seatCategories","Seat categories")),i.els.pricesInfo?.remove()),i.syncPriceRail(n,t,r);let a=5,l=n.length-a,c=l>1&&!i.pricesExpanded,h=c?n.slice(0,a):n;i.els.prices.classList.toggle("sl-expanded",l>1&&i.pricesExpanded),i.els.prices.innerHTML=rl({...r,categories:h,left:t,collapsed:c,activeKey:i.focusedCatKey,bandKeys:i.priceBandKeys,titleFor:(d,u)=>u?i.tf("picker.showAllSeats","Show all seats"):(0,uo.t)("picker.showLabelSeatsOnMap",{label:d.label}),moreLabel:l>1?c?s?i.tf("picker.showAllCategories","Show all categories"):(0,uo.t)("picker.showAllTicketTypes",{count:n.length}):i.tf("picker.showFewer","Show fewer"):null,status:{legend:i.tf("picker.seatStatusLegend","Seat status legend"),unavailable:i.tf("picker.notAvailable","Not available")}}),i.els.prices.querySelectorAll(".sl-price-row").forEach(d=>{d.addEventListener("mouseenter",()=>i.controller.getRenderer()?.setCategoryHighlight?.(d.dataset.cat??null)),d.addEventListener("mouseleave",()=>i.controller.getRenderer()?.setCategoryHighlight?.(null));let u=()=>i.focusCategory(d.dataset.cat??"");d.addEventListener("click",u),d.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),u())})}),i.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{i.pricesExpanded=!i.pricesExpanded,i.syncPrices()})}function ml(i,e){if(!e)return;let t=i.focusedCatKey===e?null:e;i.focusedCatKey=t,i.priceBandKeys=t?new Set([t]):null;let n=i.els.pricesSec?.querySelector(".sl-price-select");n&&(n.value="all"),i.controller.setCategoryFilter(t?[t]:null),i.controller.focusCategoryFilter(t?[t]:null),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}var Nt=require("@seatlayer/core");function be(i,e,t){let n=(0,Nt.t)(i,t);return n&&n!==i?n:t?e.replace(/\{(\w+)\}/g,(o,s)=>s in t?String(t[s]):o):e}function vp(i){let e=(0,Nt.tCount)("picker.seatCount",i);return e.includes("picker.seatCount")?`${i} ${i===1?"seat":"seats"}`:e}function wp(i){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(i)}catch{}return i.join(", ")}function xp(i){if(i.length<2)return!1;let e=[...i].sort((t,n)=>t-n);return new Set(e).size!==e.length?!1:e[e.length-1]-e[0]===e.length-1}function Sp(i){let e=i.filter(o=>o.objectType==="ga"),t=i.filter(o=>o.objectType!=="ga"),n=[];if(t.length){let o=vp(t.length),s=[...new Set(t.map(l=>l.sectionLabel).filter(Boolean))],r=[...new Set(t.map(l=>l.rowLabel).filter(Boolean))],a=t.map(l=>Number(l.seatNumber)).filter(l=>Number.isFinite(l));if(s.length===1&&r.length===1&&a.length===t.length){let l=t.length===1?be("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:s[0],row:r[0],seat:String(t[0].seatNumber??"")}):xp(a)?be("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:s[0],row:r[0],from:Math.min(...a),to:Math.max(...a)}):"";n.push(l?be("picker.releasedPair","{first} \xB7 {second}",{first:o,second:l}):be("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]}))}else s.length===1?n.push(be("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]})):s.length>1?n.push(be("picker.releasedInSections","{seats} in Sections {sections}",{seats:o,sections:wp(s)})):n.push(o)}for(let o of e)n.push(be("picker.releasedGa","{quantity} \xD7 {area}",{quantity:o.quantity??1,area:o.label}));return n.length?n.reduce((o,s)=>be("picker.releasedPair","{first} \xB7 {second}",{first:o,second:s})):""}function fl(i){if(!i)return[];let e=new Map((i.seats??[]).map(o=>[o.label,o])),t=i.items??[];return(t.length?t.map(o=>({label:o.label,objectType:o.objectType,quantity:o.quantity})):[...e.keys()].map(o=>({label:o}))).map(o=>{let s=e.get(o.label);return{label:o.label,...o.objectType?{objectType:o.objectType}:{},...o.quantity==null?{}:{quantity:o.quantity},...s?.sectionLabel?{sectionLabel:s.sectionLabel}:{},...s?.rowLabel?{rowLabel:X(s)??s.rowLabel}:{},...s?.seatNumber?{seatNumber:s.seatNumber}:{}}})}function gl(i,e){if(!i.reducedMotion)for(let t of e.slice(0,10)){if(t.objectType==="ga")continue;let n=i.seatByLabel(t.label);!n||i.statusOf(n.id)!=="free"||i.flash(n.id,i.accent)}}function bl(i,e){if(!e.recoverable.length||!i.isConnected)return;let t=i.querySelector(".sl-hold-expired-next");t&&(e.taken.length?t.textContent=e.taken.slice(0,3).map(r=>(0,Nt.t)("picker.seatJustTakenByAnother",{label:r})).join(" "):t.remove());let n=i.querySelector(".sl-interrupt-actions"),o=n?.querySelector(".sl-interrupt-act");if(!n||!o)return;o.classList.add("sl-interrupt-act-secondary");let s=document.createElement("button");s.type="button",s.className="sl-interrupt-act sl-hold-expired-recover",s.textContent=(0,Nt.tCount)("picker.holdLapsedSelectAgain",e.recoverable.length),s.addEventListener("click",()=>e.onRecover([...e.recoverable])),n.insertBefore(s,o),i.classList.add("has-recovery"),s.focus()}function yl(i,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let n=document.createElement("div");n.className="sl-interrupt-card sl-mo-in";let o=document.createElement("div");o.className="sl-interrupt-title",o.id="sl-hold-expired-title";let s=document.createElement("span");s.className="sl-interrupt-glyph",s.setAttribute("aria-hidden","true"),s.textContent="\u23F1";let r=document.createElement("span");r.textContent=be("picker.holdExpiredTitle","Your seats were released"),o.append(s,r);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=be("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),n.append(o,a);let l=Sp(e);if(l){let u=document.createElement("div");u.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",u.textContent=l,n.appendChild(u)}let c=document.createElement("div");c.className="sl-interrupt-body sl-hold-expired-next",c.textContent=be("picker.holdExpiredPickAgain","Pick your seats again to continue \u2014 they may already be taken."),n.appendChild(c),t.setAttribute("aria-labelledby",o.id),t.setAttribute("aria-describedby",a.id);let h=document.createElement("div");h.className="sl-interrupt-actions";let d=document.createElement("button");return d.type="button",d.className="sl-interrupt-act sl-hold-expired-restart",d.textContent=be("picker.holdExpiredRestart","Choose seats again"),d.addEventListener("click",()=>i.restart()),h.appendChild(d),n.appendChild(h),t.appendChild(n),t.addEventListener("pointerdown",u=>{u.target===t&&i.restart()}),t}var Ie=require("@seatlayer/core");var vl={wheelchair:"Wheelchair space",companion:"Companion seat","semi-ambulatory":"Limited mobility","designated-aisle":"Aisle / transfer","step-free":"Step-free",hearing:"Assistive listening",cart:"Live captions","sign-language":"Sign language","low-vision":"Low vision","sensory-friendly":"Sensory-friendly","plus-size":"Plus-size","lift-armrest":"Lift-up armrest"},kp='<svg viewBox="0 0 20 20" width="17" height="17" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="10" cy="10" r="7.5" /><path d="M10 2.5a7.5 7.5 0 0 1 0 15Z" fill="currentColor" stroke="none" /></svg>',Tp='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="13" cy="4.4" r="1.9"/><path d="M11 8.2v5.1h5.1"/><path d="M16.6 13.3l1.9 6.3"/><path d="M15.4 14.9a5.6 5.6 0 1 1-5.9-3.4"/></svg>',Ep='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="8.4"/><circle cx="8.6" cy="10.2" r="1.15"/><circle cx="12" cy="8.2" r="1.15"/><circle cx="15.4" cy="10.2" r="1.15"/><path d="M12 20.4a2.6 2.6 0 0 1 0-5.2 2.2 2.2 0 0 0 0-4.4"/></svg>',Cp=8,Ap=8,Pp=88;function Mp(i){let e=i.gap??Cp,t=i.margin??Ap,n=i.min??Pp,o=Math.max(i.boundsTop,0);return Math.max(Math.round(i.buttonTop-o-e-t),n)}var yn=class{constructor(e,t){this.active=new Set;this.deps=t,this.root=document.createElement("div"),this.root.className="sl-a11y",this.button=document.createElement("button"),this.button.type="button",this.button.className="sl-a11ybtn",this.button.setAttribute("aria-haspopup","true"),this.button.setAttribute("aria-expanded","false");let n=this.offered().length>0,o=n?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options");this.button.setAttribute("aria-label",o),this.button.innerHTML=n?Tp:Ep,this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let s of this.stored())this.offeredFree().has(s)&&this.active.add(s);if(this.menu.innerHTML=ps(o,t.tf("picker.close","Close"))+hs(this.rows()),this.root.append(this.menu,this.button),e.prepend(this.root),this.button.addEventListener("pointerdown",s=>s.stopPropagation()),this.button.addEventListener("click",s=>{s.stopPropagation(),this.open(this.menu.hidden)}),this.menu.querySelector("[data-a11y-close]")?.addEventListener("click",s=>{s.stopPropagation(),this.open(!1),this.button.focus({preventScroll:!0})}),this.menu.addEventListener("pointerdown",s=>s.stopPropagation()),this.menu.addEventListener("click",s=>s.stopPropagation()),this.menu.addEventListener("focusin",s=>{let r=s.target;r&&typeof r.scrollIntoView=="function"&&r.scrollIntoView({block:"nearest"})}),this.dismiss=()=>this.open(!1),this.escape=s=>{s.key==="Escape"&&this.open(!1)},this.reflow=()=>{this.menu.hidden||this.fit()},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),window.addEventListener("resize",this.reflow),this.promoteCounts(),this.wire(),this.active.size){this.applyFilter({focus:!1});let s=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:n,count:o})=>[n,o])),t=!1;for(let n of this.menu.querySelectorAll("[data-a11y-row]")){let o=n.dataset.a11yRow??"";if(!o.startsWith("a11y:"))continue;let s=o.slice(5),r=e.get(s);if(r===void 0)continue;let a=this.countNode(n),l=r==null?"":this.countText(r);a&&(a.textContent=l);let c=r===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(s,l))),n.disabled=c,c?n.setAttribute("aria-disabled","true"):n.removeAttribute("aria-disabled"),c&&this.active.delete(s)&&(this.paint(n,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let n=t.dataset.a11yRow??"";n.startsWith("a11y:")&&this.paint(t,this.active.has(n.slice(5)))}}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),window.removeEventListener("resize",this.reflow),this.root.remove()}fit(){this.menu.style.setProperty("--sl-a11ymenu-max",`${Mp({boundsTop:this.boundsTop(),buttonTop:this.button.getBoundingClientRect().top})}px`)}boundsTop(){let e=this.root.closest(".sl-map")??this.root.closest(".sl-picker");return e instanceof HTMLElement?e.getBoundingClientRect().top:0}open(e){if(e===!this.menu.hidden)return;if(this.button.setAttribute("aria-expanded",String(e)),!e){this.menu.hidden=!0,this.menu.classList.remove("sl-mo-in","sl-mo-stagger");return}this.menu.hidden=!1,this.fit(),this.menu.scrollTop=0;let t=this.button.getBoundingClientRect();Bn(this.menu,{x:t.left+t.width/2,y:t.top}),Cs(this.menu),Es(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:(0,Ie.seatTypeIconSvg)("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:kp,className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:n,count:o})=>({key:n,count:o}));let t=this.deps.present;return t?Ie.ACCESSIBILITY_TYPES.filter(({key:n})=>t.has(n)).map(({key:n})=>({key:n,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(Ie.ACCESSIBILITY_TYPES.map(n=>[n.key,n]));return this.offered().flatMap(({key:n,count:o})=>{let s=t.get(n);return s?[{key:`a11y:${n}`,iconHtml:(0,Ie.seatTypeIconSvg)(n,{size:17}),label:this.deps.tf(`picker.accessShort.${n}`,vl[n]??s.label),...n==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...o==null?{}:{count:this.countText(o),disabled:o===0},on:this.active.has(n)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-sl-info]"))e.addEventListener("click",()=>{let t=e.closest(".sl-info"),n=!t?.classList.contains("open");for(let o of this.menu.querySelectorAll(".sl-info.open"))o.classList.remove("open"),o.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false");t?.classList.toggle("open",n),e.setAttribute("aria-expanded",String(n))});for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let s=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(s),this.paint(e,s);return}if(t==="limited"){let s=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(s),s&&this.deps.focusSeatsForFilter(),this.paint(e,s);return}let n=t.slice(5),o=!this.active.has(n);o?this.active.add(n):this.active.delete(n),this.paint(e,o),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let n=(e.dataset.a11yRow??"").slice(5),o=e.parentElement;o?.classList.contains("sl-a11yrow-w")||(o=document.createElement("div"),o.className="sl-a11yrow-w",e.replaceWith(o),o.appendChild(e));let s=document.createElement("button");s.type="button",s.className="sl-a11yrow-c sl-a11yjump",s.dataset.a11yJump=n,s.textContent=t.textContent,s.disabled=e.disabled,s.setAttribute("aria-label",this.jumpLabel(n,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(n,s.textContent??"")),e.after(s),s.addEventListener("click",r=>{r.stopPropagation(),this.active.has(n)||(this.active.add(n),this.paint(e,!0),this.applyFilter({focus:!1}));let a=this.deps.stepToAccessibleSection?.(n);a&&s.setAttribute("aria-label",this.jumpLabel(n,s.textContent??"",a.label))})}}countText(e){return e>0?(0,Ie.t)("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=vl[e]??Ie.ACCESSIBILITY_TYPES.find(n=>n.key===e)?.label??e;return this.deps.tf(`picker.accessShort.${e}`,t)}jumpLabel(e,t,n){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...n?[`${this.deps.tf("picker.section","Section")} ${n}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};var wl=require("@seatlayer/core"),Lp=250;function xl(i,e=Lp){let t=null,n=()=>{t===null&&(t=setTimeout(()=>{t=null,i()},e))},o=(0,wl.attachVisibilityCatchUp)(n),s=typeof window<"u"&&typeof window.addEventListener=="function";return s&&window.addEventListener("focus",n),()=>{t!==null&&(clearTimeout(t),t=null),o(),s&&window.removeEventListener("focus",n)}}var rt=require("@seatlayer/core");var vn=class{constructor(e){this.note=null;this.told=!1;this.deps=e}deferExpiryToast(e){this.told=!1,queueMicrotask(()=>{this.told||e()})}handle(e){if(!e.holdLapsed)return;this.told=!0;let t=(0,rt.holdRecoveryShape)(e),n=e.lapsedLabels.length,o=n-e.recoverable.length,s=t==="all"?(0,rt.tCount)("picker.holdLapsedStillFree",n):t==="partial"?(0,rt.tCount)("picker.holdLapsedSomeTaken",o):(0,rt.tCount)("picker.holdLapsedAllTaken",n);this.note={message:s,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(s,t==="none"?"error":"warning",t==="none"?void 0:{label:this.actionLabel(),onClick:()=>this.recover()}),this.deps.syncTray()}noteHtml(){if(!this.note)return"";let e=this.note.recoverable.length?`<button type="button" data-lapse-again>${B(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${B(this.note.message)}</span>${e}</div>`}wire(e){e?.querySelector("[data-lapse-again]")?.addEventListener("click",()=>this.recover())}clear(){this.note&&(this.note=null,this.deps.syncTray())}actionLabel(){return(0,rt.tCount)("picker.holdLapsedSelectAgain",this.note?.recoverable.length??0)}recover(){let e=this.note?.recoverable??[];this.note=null,this.deps.syncTray(),e.length&&this.deps.reselect(e)}};var Sl=Symbol("seatlayer.performance-group-picker");function wn(i,e){return Object.defineProperty(i,Sl,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),i}function kl(i){return i[Sl]??null}var Tl="@seatlayer/pending-checkout/v1";function Hp(i){return typeof i=="string"&&i.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(i)}function xn(i){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let n=null;try{let o=window.sessionStorage.getItem(Tl);if(o){let s=null;try{s=JSON.parse(o)}catch{}if(s&&Hp(s.orderId)){let r=Date.now()-Number(s.storedAt);if(r>=0&&r<=144e5){if(s.eventKey&&s.eventKey!==i)return null;n=s.orderId}}}window.sessionStorage.removeItem(Tl)}catch{}e.delete("seatlayer_checkout");try{let o=e.toString();history.replaceState(history.state,"",`${location.pathname}${o?`?${o}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:n}}function El(i){if(!i.framed)return null;let e=i.ancestorOrigins?.length?i.ancestorOrigins[0]:null;for(let t of[e,i.referrer])if(t)try{return new URL(t).origin}catch{}return null}var Rp="https://api.seatlayer.io",Ip=10,Op=250,Cl=6e4,Al=4,_p=10,Np=40,Dp=220,Pl="seatmap.a11y.cb";function Bp(){try{if(typeof window>"u")return null;let i=window.localStorage.getItem(Pl);return i==null?null:i==="1"}catch{return null}}function Fp(i){try{window.localStorage.setItem(Pl,i?"1":"0")}catch{}}var Ue=class i{constructor(e){this.realtime=null;this.accessEl=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.els={};this.regions={};this.ro=null;this.viewportResizeHandler=null;this.holdTimer=null;this.toastTimer=null;this.offerReadInFlight=null;this.offerReadSettledAt=0;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.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.extendDismissed=!1;this.extendUsed=!1;this.bookedEl=null;this.holdExpiredEl=null;this.holdExpiredFresh=!1;this.holdExpiredUnits=[];this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedReport=null;this.confirmCardCache=null;this.suppressConfirmationSeatId=null;this.tableDialogEl=null;this.tableDialog=null;this.tableDialogHeld=!1;this.tableDialogReturnFocus=null;this.srEl=null;this.baQty=2;this.baCat="";this.baZone="";this.baPremium=!1;this.bestAvailableConfirm=!1;this.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 hn({overlay:()=>this.view3dEl,savedSeatIds:()=>this.view3dCompareSeatIds,openComparison:()=>this.openView3dComparison(),clearComparison:()=>this.clearView3dComparison(),toast:(e,t)=>this.toast(e,t)});this.view3dCompareEl=null;this.view3dCompareCleanup=null;this.view3dSeatViewChrome=null;this.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.arenaViewportInsets={top:0,right:0,bottom:0,left:0};this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.view3dBack=null;this.view3dNav=null;this.lastRailSignature="";this.priceSelect=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.fullscreenAffordanceSize={rootWidth:-1,rootHeight:-1,viewportWidth:-1,viewportHeight:-1};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.sectionCardCache=null;this.lastTrayCount=0;this.langSel=null;this.lastTrayTotal=0;this.lastTrayKeys=new Set;this.bestAvailableBusy=!1;this.releasingLabels=new Set;this.holdingLabels=new Set;this.ctaPhase="idle";this.a11yMenu=null;this.detachAttention=null;this.lapse=new vn({toast:(e,t,n)=>this.toast(e,t,n),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalScrim=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.fitScheduled=!1;this.perspectiveWarned=!1;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");if(!e.container)throw new Error("seatmap: `container` is required (or use SeatPicker.open())");this.performanceGroup=kl(e),this.suppressPricing=!!this.performanceGroup?.suppressPricing,this.opts={...e,confirmSelection:e.confirmSelection??!0},this.eventDetailsHidden=!!e.hideEventDetails,this.hostPricing=e.pricing,this.apiBase=(e.apiBase??Rp).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},n=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?Ni({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:n?.access??Lt(e,t),this.pubApi=e.transport?null:n?.api??new Be(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=e.transport??this.pubApi,this.buyerAssetUrls=new Rt(e.event,this.api.asset?(a,l)=>this.api.asset(a,l):void 0),e.checkout==="hosted"&&!this.pubApi&&console.warn('seatlayer: checkout: "hosted" needs the widget\'s own transport \u2014 a custom `transport` owns its backend, so the picker is staying on onCheckout for this mount.'),this.checkoutMode=e.checkout==="hosted"&&this.pubApi?"hosted":"handoff";let o=e.numberOfPlacesToSelect;if(o!=null&&(!Number.isInteger(o)||o<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=o??null;let s=La(e.selectionValidators);if(this.exactTickets!=null&&s>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let r=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(Ip,s)));if(this.exactTickets!=null&&r<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&r<s)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??r,this.cbSafe=Bp()??!!e.colorblindSafe,this.controller=this.wireController(e)}get confirmEl(){return this.confirmCard.element}set confirmEl(e){this.confirmCard.element=e}get confirmSeat(){return this.confirmCard.candidate}set confirmSeat(e){this.confirmCard.candidate=e}get lastSection(){return this.sectionCard.summary}set lastSection(e){this.sectionCard.adopt(e)}deliverableViewReference(e){return Ot(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=El({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let n=t<640?1.2:.62;return Math.max(420,Math.round(t*n))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!document.fullscreenElement||this.fsFallback||this.framedFs?document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.framedFs?this.setFramedFs(!1):this.setFsFallback(!1):e.requestFullscreen?e.requestFullscreen().catch(()=>this.enterFsFallback()):this.enterFsFallback()}fillsViewport(){let e=this.root;if(!e||typeof window>"u")return!1;let t=e.getBoundingClientRect();return t.height>=window.innerHeight-Al&&t.width>=window.innerWidth-Al}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let n=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=n,e.tabIndex=n?-1:0,e.setAttribute("aria-hidden",String(n))}fullscreenMeasurementChanged(e,t){let n=typeof window>"u"?0:window.innerWidth,o=typeof window>"u"?0:window.innerHeight,s=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||n!==this.fullscreenAffordanceSize.viewportWidth||o!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:n,viewportHeight:o},s}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),this.root?.setAttribute("data-fs",String(e)),this.els.zfs?.setAttribute("aria-pressed",String(e)),this.els.zfs?.setAttribute("title",e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));let n=this.els.zfs?.querySelector(".sl-zfs-lbl");n&&(n.textContent=e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),this.view3dEl?.querySelector(".sl-view3d-fs")?.setAttribute("aria-pressed",String(e)),this.syncFullscreenAffordance()}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e,background:this.cssVar("--sl-bg")||void 0}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){It();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.createElement("div");n.className="sl-modal-scrim";let o=document.createElement("div");o.className="sl-modal-frame",o.style.setProperty("--sl-bg",Tt(void 0,e.theme)["--sl-bg"]),o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label",g("picker.seatSelection","Seat selection")),o.tabIndex=-1,n.appendChild(o),document.body.appendChild(n);let s=document.body.style.overflow;document.body.style.overflow="hidden";let r=new i({...e,container:o});r.modalScrim=n,r.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 f=[...o.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(b=>b.isConnected&&!b.closest('[hidden], [aria-hidden="true"], [inert]'));return f[f.length-1]??o},c=(f,b)=>{let k=f;for(;k;){let x=window.getComputedStyle(k);if(k.hidden||k.getAttribute("aria-hidden")==="true"||k.hasAttribute("inert")||x.display==="none"||x.visibility==="hidden"||x.visibility==="collapse")return!0;if(k===b)return!1;k=k.parentElement}return!0},h=f=>[...f.querySelectorAll(a)].filter(b=>b.tabIndex>=0&&!b.matches(":disabled")&&!c(b,f)),d=(f,b)=>{let k=h(f),x=b?k[k.length-1]:k[0];x?x.focus({preventScroll:!0}):(f.hasAttribute("tabindex")||(f.tabIndex=-1),f.focus({preventScroll:!0}))},u=!1,p=()=>{if(u)return;u=!0,document.body.style.overflow=s,r.escHandler&&document.removeEventListener("keydown",r.escHandler),n.remove(),r.modalScrim=null;let f=r.prevFocus;r.prevFocus=null,f?.isConnected&&f.focus({preventScroll:!0});let b=()=>{r.destroy(),e.onClose?.()};r.hold&&!r.handedOff?r.release().finally(b):b()};return r.closeModal=p,n.addEventListener("mousedown",f=>{f.target===n&&p()}),r.escHandler=f=>{if(f.key==="Tab"){if(f.defaultPrevented)return;let b=l(),k=h(b),x=k[0],v=k[k.length-1],A=document.activeElement;!x||!v?(f.preventDefault(),d(b,f.shiftKey)):A===b||!A||!b.contains(A)?(f.preventDefault(),(f.shiftKey?v:x).focus({preventScroll:!0})):f.shiftKey&&A===x?(f.preventDefault(),v.focus({preventScroll:!0})):!f.shiftKey&&A===v&&(f.preventDefault(),x.focus({preventScroll:!0}));return}f.key==="Escape"&&(r.tableDialog?(f.preventDefault(),r.cancelTableDialog()):r.confirmSeat?(f.preventDefault(),r.cancelConfirm()):r.bestAvailableConfirm?(f.preventDefault(),r.bestAvailableConfirm=!1,r.syncTray()):(f.preventDefault(),p()))},document.addEventListener("keydown",r.escHandler),await r.render(),r.els.close?.classList.add("on"),r.els.close?.addEventListener("click",p),d(l(),!1),r}wireController(e){return new I.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,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:kt(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let n=this.controller.getGAAreas().find(o=>o.id===t);n&&(this.collapseSheet(),zn(this,n,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),mr(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,n=this.holdConflicted;this.holdExpiredUnits=fl(this.hold),this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.holdConflicted=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.lapse.deferExpiryToast(()=>{if(t||n){this.toast((0,I.t)("picker.holdExpired",void 0)||"Your hold expired \u2014 seats released. Pick again.","warning");return}this.showHoldExpired()}),this.syncTray(),this.emitHoldChange(),this.opts.onHoldExpired?.()},onAvailabilityRefresh:t=>this.lapse.handle(t),confirmSelection:this.opts.confirmSelection,onSelect:t=>{if(this.salesClosed){this.controller.deselect([t.id]),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){this.removeHeldLabels([t.label]);return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}if(this.tableDialog?.physicalSeatIds.includes(t.id)){this.dismissTableDialog();return}this.opts.confirmSelection===!1||this.salesClosed||this.controller.tableSelection(t.id)||(this.controller.select([t.id]),this.showConfirm(t,"remove"))},onSelectionLimit:()=>{this.toast((0,I.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),hostCardOpen:()=>this.tipPinned||!!this.confirmSeat,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={},n=P=>Math.round((performance.now()-P)*100)/100;this.rendered=!0,It();let o=performance.now(),s=Ii(this.opts.locale,this.opts.messages),r=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=Go(this.opts.container),{root:c,els:h,mapHost:d}=vs(l,(P,_)=>this.tf(P,_),this.opts.theme);this.root=c,this.els=h,this.mapHost=d,Oi(c,s,P=>{t.loadLocale=n(o),this.destroyed||this.applyActiveLocale(P,r)}),ta(c,()=>[{open:()=>!!this.holdExpiredEl,close:()=>this.restartAfterHoldExpiry()},{open:()=>this.tipPinned,close:()=>this.unpinTooltip()},{open:()=>!!this.tableDialog,close:()=>this.cancelTableDialog()},{open:()=>!!this.confirmSeat,close:()=>this.cancelConfirm()},{open:()=>this.bestAvailableConfirm,close:()=>{this.bestAvailableConfirm=!1,this.syncTray()}}]),this.syncFullscreenButtons(),this.wireBuyerShell(c);let u=document.createElement("div");u.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(u),t.mountBuyerShell=n(a),t.skeletonPaint=n(e),this.startRealtime();let p=await this.loadChart(u,t,n);if(!p)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=n(e);let f=performance.now();if(this.salesClosed=!!p.salesClosed||!!this.opts.readOnly,c.dataset.eventMode=p.mode==="test"?"test":"live",!this.opts.locale&&p.locale&&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 P=document.createElement("div");P.className="sl-testbadge",P.textContent=jo((0,I.t)("picker.testMode"),(0,I.getLocale)()),P.setAttribute("aria-label",(0,I.t)("picker.testMode")),P.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"),this.regions["top-left"].appendChild(P)}let b=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(c),this.watchThemeMode(),this.currency=p.currency??this.opts.currency??"USD",this.eventTimezone=p.timezone??null,Uo(this.els.logo,[this.opts.theme?.logoUrl,b?.logoUrl,p.posterUrl],this.opts.theme?.brandName??b?.brandName??p.eventName??"?"),this.els.name.textContent=p.eventName??"";let k=p.startsAt?Ai(p.startsAt,p.timezone??null,this.opts.locale):"";this.eventWhenText=k||null,this.els.meta.textContent=[p.venue,k].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(b);let x=!!this.controller.doc&&this.controller.getExpandedSeats().some(P=>P.commercial?.restrictedView||P.commercial?.obstructedView);this.buildAccessibilityMenu(x),this.buildLanguageSwitcher(this.els.zoom??this.regions["bottom-right"]),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),c.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=n(f);let v=performance.now();if(await this.restoreRememberedHold(),t.restoreHold=n(v),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let A=this.controller.doc,y=Wi(this.opts.event),H=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),C=H??"event",N={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:C,surface:H==="season"?"season_picker":H==="performance_group"?"performance_group_picker":"seat_picker",ms:n(e),performanceProfile:t,chartDelivery:p.chartDelivery,seatCount:this.allSeats().length,objectCount:A?.objects.length??0,sectionCount:A?.objects.filter(P=>P.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:A?.name,view:this.buyerView,load:y,transport:this.opts.transport?"custom":"pubapi"};aa(N,(P,_)=>this.emitAnalytics(P,_));let M=p.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",ro({...N,performanceProfile:{...N.performanceProfile,...M}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=p,await this.registerAgentTools(),this}registerAgentTools(){return ra(this)}webMcpHost(e){return so(this,e)}wireBuyerShell(e){this.refreshOfferAvailability(!1),this.api.availability&&(this.offerVisibilityHandler=()=>{!document.hidden&&!this.destroyed&&this.refreshOfferAvailability(!1)},document.addEventListener("visibilitychange",this.offerVisibilityHandler)),this.detachAttention=xl(()=>{this.destroyed||this.controller.refreshAvailability()}),this.observeLayout(e),this.els.zin.addEventListener("click",()=>this.controller.zoomIn()),this.els.zout.addEventListener("click",()=>this.controller.zoomOut()),this.els.zfit?.addEventListener("click",()=>this.controller.overview()),this.els.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let o=this.els.sheetToggle,s=h=>this.setSheetOpen(h);s(e.dataset.sheet==="open");let r=0,a=!1,l=!1,c=!1;o?.addEventListener("click",h=>{h.stopPropagation(),!a&&s(e.dataset.sheet!=="open")}),t.addEventListener("pointerdown",h=>{if(h.target.closest?.(".sl-seccard")){l=!1;return}c=!!h.target.closest?.(".sl-sheet-toggle"),l=!0,a=!1,r=h.clientY,t.setPointerCapture?.(h.pointerId)}),t.addEventListener("pointermove",h=>{if(!l||a)return;let d=h.clientY-r;d<-18?(s(!0),a=!0):d>18&&(s(!1),a=!0)}),t.addEventListener("pointerup",h=>{l&&!a&&!c&&Math.abs(h.clientY-r)<6&&s(e.dataset.sheet!=="open"),l=!1,c=!1,t.releasePointerCapture?.(h.pointerId)})}let n=()=>{if(this.root?.dataset.layout!=="narrow")return;let o=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!o)),this.els.pricesSec?.setAttribute("aria-expanded",String(!o)),!o&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",o=>{o.target.closest("select,button")||n()}),this.els.pricesSec?.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||o.target.closest("select,button")||(o.preventDefault(),n())}),e.addEventListener("click",o=>{let s=o.target.closest("[data-sl-info]");if(!s||!e.contains(s))return;o.stopPropagation();let r=s.closest(".sl-info"),a=!r?.classList.contains("open");this.closeInfoPops(r),r?.classList.toggle("open",a),s.setAttribute("aria-expanded",String(a))}),e.addEventListener("pointerdown",o=>{o.target.closest(".sl-info")||this.closeInfoPops()}),this.tipEl=document.createElement("div"),this.tipEl.setAttribute("role","tooltip"),this.tipEl.className="sl-tip",this.els.map.appendChild(this.tipEl),this.els.map.addEventListener("pointerdown",o=>{this.handleMapPointerDown(o)},!0),this.els.map.addEventListener("mousemove",o=>{if(this.tipPinned)return;let s=this.els.map.getBoundingClientRect();this.tipPos={x:o.clientX-s.left,y:o.clientY-s.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.els.cta.dataset.act==="find"?this.openBestSeatsForm():this.handleCta()})}setSheetOpen(e){let t=this.root;if(!t)return;t.dataset.sheet=e?"open":"peek";let n=this.els.sheetToggle;n?.setAttribute("aria-expanded",String(e)),n?.setAttribute("aria-label",e?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))}openBestSeatsForm(){this.setSheetOpen(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||(e.dataset.sheet="peek",this.els.sheetToggle?.setAttribute("aria-expanded","false"),this.els.sheetToggle?.setAttribute("aria-label",this.tf("picker.openTicketPanel","Open ticket panel")))}observeLayout(e){let t=()=>{let n=e.clientWidth;if(n<=0)return;let o=e.clientHeight,s=n!==this.pickerLayoutSize.width||o!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:n,height:o};let r=this.fullscreenMeasurementChanged(n,o);this.reportFramedHeight();let a=n<640?"narrow":"wide",l=o<560?"compact":"comfortable",c=e.dataset.layout!==a||e.dataset.density!==l;c&&(e.dataset.layout=a,e.dataset.density=l,this.controller.getRenderer()?.setSectionFocusDim?.(a!=="narrow"),a==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray(),this.syncMapStepBack(),this.refreshExtendPrompt()),(r||c)&&this.syncFullscreenAffordance(),this.syncArenaViewportInsets(),s&&(this.minimap?.refreshMinimap(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),this.viewportResizeHandler=()=>{this.fullscreenMeasurementChanged(e.clientWidth,e.clientHeight)&&this.syncFullscreenAffordance()},window.addEventListener("resize",this.viewportResizeHandler),t(),requestAnimationFrame(t)}async loadChart(e,t,n){let o=performance.now(),s=await this.controller.render(e);return t.loadChartAndStatuses=n(o),this.destroyed?null:s?(Object.assign(t,s.performanceProfile),s):(Re({apiBase:this.apiBase,event:this.opts.event,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:$e(this.opts.event),transport:this.opts.transport?"custom":"pubapi"}),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 r=this.opts.container,a=this.opts;this.destroy(),new i({...a,container:r}).render()}),null)}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=xn(this.opts.event);e?.outcome!=="success"||!e.orderId||this.openCheckoutPanel({kind:"resume",orderId:e.orderId})}buildPanelToggle(){if(!this.regions["top-right"])return;let e=document.createElement("button");e.type="button",e.className="sl-side-toggle",e.addEventListener("click",()=>this.setPanelCollapsed(!this.sideCollapsed)),this.sideToggleEl=e,this.regions["top-right"].appendChild(e),this.syncPanelToggle()}syncPanelToggle(){let e=this.sideToggleEl;if(!e)return;let t=this.sideCollapsed;e.setAttribute("aria-expanded",String(!t)),e.setAttribute("aria-label",t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel")),e.title=t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel"),e.innerHTML=t?`<svg viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg><span>${this.tf("picker.tickets","Tickets")}</span>`:'<svg viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></svg>'}setPanelCollapsed(e){this.destroyed||(this.sideCollapsed=e,this.applyPanelCollapsed(),this.scheduleMotion(()=>this.controller.refitCurrentView(),340))}applyPanelCollapsed(){let e=this.root?.dataset.layout!=="narrow";this.root?.setAttribute("data-side-collapsed",String(this.sideCollapsed)),this.els.side?.toggleAttribute("inert",this.sideCollapsed&&e),this.syncPanelToggle()}buildAccessibilityMenu(e){let t=this.els.zoom??this.regions["bottom-right"]??this.els.map;t&&(this.a11yMenu=new yn(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(n,o)=>this.tf(n,o),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:n=>this.setColorblindSafe(n),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:n=>{this.limitedViewFilter=n,this.controller.setCommercialLimitedFilter(n),this.pushAvailabilityTo3d()},applyAccessibilityFilter:n=>this.applyAccessibilityFilter(n),focusSeatsForFilter:()=>this.focusSeatsForFilter(),stepToAccessibleSection:n=>this.controller.focusNextAccessibleSection?.([n])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast((0,I.t)("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,n=this.els.headInfo?.parentElement;t&&n&&t.parentElement!==n&&(t.classList.add("sl-fs-pill"),n.insertBefore(t,this.els.hold??null));let o=this.extendEl;if(o){let r=e?this.regions["bottom-center"]??this.els.map:n;r&&o.parentElement!==r&&(o.dataset.dock=e?"map":"head",r===n?r.insertBefore(o,this.els.close??null):r.appendChild(o))}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.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){Fa(this)}buildBookedOverlay(){let e=document.createElement("div");e.className="sl-booked",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<div class="sl-booked-badge"><svg viewBox="0 0 24 24"><path d="M20 6L9 17l-5-5"/></svg></div><div class="sl-booked-title">${this.tf("picker.allSetTitle","You're all set")}</div><div class="sl-booked-sub" data-ref="bookedSub"></div><ul class="sl-booked-list" data-ref="bookedList"></ul><button type="button" class="sl-booked-back" data-ref="bookedBack"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${B(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}tf(e,t){return g(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(),n=document.createElement("div");n.className="sl-soldout-eyebrow",n.textContent=t;let o=document.createElement("div");o.className="sl-soldout-title",o.textContent=this.tf("picker.soldOutTitle","Sold out");let s=document.createElement("p");s.className="sl-soldout-copy",s.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(n,o,s),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let n=this.controller.getGAAreas().length>0,o=this.isSoldOut(e,t,n);o!==this.soldOut&&(this.soldOut=o,this.soldoutEl?.classList.toggle("on",o))}isSoldOut(e,t,n){return!n&&e.length>0&&e.every(o=>(t[o.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog();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!!e?.hideBadge}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let n=document.createElement("a");n.className="sl-powered",n.href="https://seatlayer.io/?ref=picker",n.target="_blank",n.rel="noopener noreferrer",n.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer"));let o=document.createElement("span");o.className="sl-powered-mark",o.setAttribute("aria-hidden","true"),o.innerHTML=zi;let s=document.createElement("span");s.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),n.append(o,s),t.appendChild(n)}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 n=document.createElement("div");n.className="sl-anchor",n.dataset.region=t,this.els.map.appendChild(n),this.regions[t]=n}}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 n=setTimeout(()=>{this.motionTimers.delete(n),this.destroyed||e()},t);this.motionTimers.add(n)}animateOnce(e,t,n=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),n))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){let t=this.reducedMotion(),n=(e.items??[]).filter(o=>o.objectType!=="ga").slice(0,10).map(o=>this.controller.seatByLabel(o.label)).filter(o=>!!o);Zs({regions:this.els,categories:this.controller.doc?.categories,pop:o=>this.controller.flashSeat(o,this.cssVar("--sl-accent")||"#f4b740"),focus:(o,s)=>this.controller.focusSection(o,s),focusSeats:o=>this.controller.focusSeats?.(o,{animate:!t})===!0,reducedMotion:t,screenPoint:o=>this.controller.worldToScreen(o),schedule:(o,s)=>this.scheduleMotion(o,s)},n)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(n=>n.id!==e&&n.id!==t)}pendingSelectionCount(){return za(this)}heldTicketCount(){return $a(this)}totalTicketCount(){return ja(this)}updateSelectionCapacity(){Ga(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){Ua(this,e,t)}setCtaPhase(e){qa(this,e)}runCheckoutHandoff(e,t){return Ka(this,e,t)}holdStorageKey(){return Wa(this)}rememberedHoldId(){return Ya(this)}rememberHold(e){Xa(this,e)}forgetHold(){Za(this)}resumeHoldFromServer(e){return Qa(this,e)}restoreRememberedHold(){return Ja(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let n=this.controller.getActiveFloorId();return(t.find(o=>o.id===n)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=Xr({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return mn(this,e)}catPriceRange(e){return fn(this,e)}buildPriceFilter(){cl(this)}applyPriceBand(e){dl(this,e)}buildArenaChrome(){let e=this.controller.doc;if(this.rungsEl=null,this.projectionEl=null,this.floorsEl=null,!e||!this.els.map){this.syncArenaViewportInsets();return}let t=e.objects.some(n=>n.type==="section")||(e.floors??[]).some(n=>n.objects.some(o=>o.type==="section"));if(this.canOffer3d()){let n=document.createElement("div");n.className="sl-projection",n.setAttribute("role","group"),n.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),n.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>`,n.querySelectorAll("button").forEach(o=>{if(o.dataset.view==="venue3d")for(let s of["pointerenter","focus","pointerdown"])o.addEventListener(s,Ti,{once:!0});o.addEventListener("click",()=>{this.setBuyerView(o.dataset.view)})}),this.regions["top-right"].appendChild(n),this.projectionEl=n,this.syncProjection()}if(t){let n=[...e.objects,...(e.floors??[]).flatMap(d=>d.objects)],o=new Set((e.zones??[]).map(d=>d.id)),a=e.floorOverview==="combined"&&(e.floors?.length??0)>1&&o.size===0||n.some(d=>d.type==="section"&&typeof d.zone=="string"&&o.has(d.zone))?["zones","sections","seats"]:["sections","seats"],l=document.createElement("div");l.className="sl-rungs on sl-mo-indicator",l.setAttribute("role","group"),l.setAttribute("aria-label",(0,I.t)("picker.zoomLevel"));let c={zones:(0,I.t)("picker.rungLabel.zones"),sections:(0,I.t)("picker.rungLabel.sections"),seats:(0,I.t)("picker.rungLabel.seats")},h={zones:(0,I.t)("picker.rungTip.zones"),sections:(0,I.t)("picker.rungTip.sections"),seats:(0,I.t)("picker.rungTip.seats")};l.innerHTML=a.map(d=>`<button type="button" data-rung="${d}" title="${h[d]}" aria-pressed="false">${c[d]}</button>`).join(""),l.querySelectorAll("button").forEach(d=>{d.addEventListener("click",()=>{let u=d.dataset.rung;this.controller.setRung(u),u==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(l),this.rungsEl=l,this.syncRung()}if(this.controller.isMultiFloor()){let n=yr({floors:this.controller.getFloors(),tf:(o,s)=>this.tf(o,s),onChoose:o=>{o===""?this.controller.setFloorOverview(!0):this.controller.setFloor(o),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});this.regions["top-left"].appendChild(n),this.floorsEl=n,this.syncFloors()}this.syncArenaViewportInsets()}syncArenaViewportInsets(){let e=this.els.map,t=e?br(e.getBoundingClientRect(),[this.floorsEl,this.rungsEl,this.projectionEl].map(n=>n?.isConnected?n.getBoundingClientRect():null),this.root?.dataset.layout==="narrow"&&this.els.zoom?.isConnected?[this.els.zoom.getBoundingClientRect()]:[]):{top:0,right:0,bottom:0,left:0};Object.keys(t).every(n=>t[n]===this.arenaViewportInsets[n])||(this.arenaViewportInsets=t,this.controller.setViewportInsets(t))}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.syncMapStepBack(),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(n=>{let o=n.dataset.rung===e;n.classList.toggle("on",o),n.setAttribute("aria-pressed",String(o))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit;if(!e||!this.root)return;if(this.root.dataset.layout!=="narrow"){e.disabled&&(e.disabled=!1),t?.disabled&&(t.disabled=!1);return}let n=gr({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0,atVenueFit:this.controller.atVenueFit?.()})==="none";e.disabled=n,t&&(t.disabled=n)}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?this.tf("picker.priceHint3d","Colours in the venue are ticket types \u2014 choose one below to show just those seats."):this.tf("picker.priceHint","Colours on the map are ticket types \u2014 tap one below to show just those seats.")),this.projectionEl&&this.projectionEl.querySelectorAll("button").forEach(e=>{let t=e.dataset.view===this.buyerView;e.classList.toggle("on",t),e.setAttribute("aria-pressed",String(t))})}canOffer3d(){return this.opts.enable3D===!1||!this.controller.doc||!ki()?!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)?Cl/2:Cl}syncFloors(){vr(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new rn({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(o=>o.type==="section"&&!this.controller.isSectionClosed(o.id)&&this.controller.getSectionSeatCount(o.id)>0);if(t.length<2)return null;let n=t.findIndex(o=>o.id===e);return n<0?null:{previous:t[(n-1+t.length)%t.length],next:t[(n+1)%t.length]}}markedSeatAnnouncement(e){let t=Jn(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return Lr(t,e.displayLabel??e.label,this.opts.locale)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.markedSeatAnnouncement(e);if(t){this.srEl.textContent=t;return}let n=this.controller.doc?.categories.find(p=>p.key===e.categoryKey),o=this.controller.getStatus(e.id)??"free",s=o==="free"?this.tf("picker.statusAvailable","available"):o==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),r=n?this.catPriceRange(n):void 0,a=!this.suppressPricing&&r?r.min===r.max?this.money(r.min):`${this.money(r.min)}\u2013${this.money(r.max)}`:void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),h=nt(c),d=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,u=l?`${h} ${d}, ${l.bookingMode==="variable"?(0,I.t)("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):(0,I.t)("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${h} ${d}`:c?.objectType==="table"?`${h} ${d}, ${(0,I.t)("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:(0,I.t)("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${u}, ${n?.label??e.categoryKey}${a?`, ${a}`:""}, ${s}`}showTableDialog(e,t,n){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=n??document.activeElement;let o=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),s=e.bookingMode==="variable",r=document.createElement("div");r.className="sl-table-scrim",r.innerHTML=cs(e,{variable:s,held:t,typeWord:nt(e),categoryLabel:o?.label??e.categoryKey,suppressPricing:this.suppressPricing,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(r),this.tableDialogEl=r,this.renderTableDialogState(),r.querySelectorAll("[data-table-step]").forEach(a=>{a.addEventListener("click",()=>{if(!this.tableDialog)return;let l=Math.max(this.tableDialog.minOccupancy,Math.min(this.tableDialog.maxOccupancy,this.tableDialog.quantity+Number(a.dataset.tableStep)));this.tableDialog={...this.tableDialog,quantity:l},this.renderTableDialogState()})}),r.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),r.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),r.addEventListener("mousedown",a=>{a.target===r&&this.cancelTableDialog()}),r.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...r.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!l.length)return;let c=l[0],h=l[l.length-1];a.shiftKey&&document.activeElement===c?(a.preventDefault(),h.focus()):!a.shiftKey&&document.activeElement===h&&(a.preventDefault(),c.focus())}),requestAnimationFrame(()=>r.querySelector(s?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let n=t.querySelector("output[data-table-qty]");n&&(n.value=String(e.quantity));let o=t.querySelector("input[data-table-qty]");o&&(o.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let s=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),r=t.querySelector("[data-table-total]");r&&(r.textContent=this.money(s*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let n=this.tableDialogEl?.querySelector(".sl-table-confirm");if(n&&(n.disabled=!0,n.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let o=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!o){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},this.startHoldTimer(o.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,I.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(o){this.opts.onError?.(o),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){n&&(n.disabled=!1,n.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new dn({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),paidPrice:(e,t,n,o)=>this.paidPrice(e,t,n,o),suppressPricing:()=>this.suppressPricing,reducedMotion:()=>this.reducedMotion(),scheduleMotion:(e,t)=>this.scheduleMotion(e,t),canOffer3d:()=>this.canOffer3d(),buyerView:()=>this.buyerView,view3dHandle:()=>this.view3dHandle,view3dCompareSeatIds:()=>this.view3dCompareSeatIds,rememberView3dReturnSeat:e=>{this.view3dReturnSeat=e},enter3d:e=>{this.enter3d(e)},performanceGroup:()=>this.performanceGroup,seatViewEnabled:()=>this.seatViewEnabled(),openSeatView:e=>{this.openSeatView(e)},openSeatConfidencePassport:(e,t)=>this.openSeatConfidencePassport(e,t),saveView3dComparisonSeat:e=>this.saveView3dComparisonSeat(e),resolveAssetUrl:e=>this.buyerAssetUrls.resolve(e),onError:e=>this.opts.onError?.(e),liftToastOverConfirm:()=>this.liftToastOverConfirm(),fitTranslatedRows:()=>this.fitTranslatedRows(),syncTray:()=>this.syncTray(),syncSelectionTo3d:()=>this.syncSelectionTo3d(),collapseSectionCard:()=>this.collapseSectionCard(),applyPanelCollapsed:()=>this.applyPanelCollapsed(),dismiss:()=>this.dismissConfirm(),reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e)})),this.confirmCardCache}showConfirm(e,t="add"){this.confirmCard.show(e,t)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){Kr(e,t,this.reducedMotion())}addSeatLabel(e){return Wr(e,(t,n)=>this.tf(t,n))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,n=this.controller.doc,o=this.controller.getActiveFloorId(),s=e.focalPoint??n?.floors?.find(d=>d.id===o)?.focalPoint??n?.focalPoint??{x:0,y:0},r,a,l=!1;if(e.viewUrl){let d,u=null;try{let f=e.viewMeta?.previewUrl;f&&f!==e.viewUrl?(u=await this.buyerAssetUrls.resolve(f),d=e.viewUrl):d=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(f){t===this.seatViewGen&&this.opts.onError?.(f);return}if(t!==this.seatViewGen||!d||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!u||!this.root||!this.seatViewEnabled())return;let p={url:d,...u?{previewUrl:u}:{},...e.viewMeta?.sourceWidth!==void 0?{sourceWidth:e.viewMeta.sourceWidth}:{},...e.viewMeta?.sourceHeight!==void 0?{sourceHeight:e.viewMeta.sourceHeight}:{},...e.viewMeta?.previewWidth!==void 0?{previewWidth:e.viewMeta.previewWidth}:{},...e.viewMeta?.previewHeight!==void 0?{previewHeight:e.viewMeta.previewHeight}:{},...e.viewMeta?.variants?.length?{variants:e.viewMeta.variants}:{},...e.viewMeta?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};r=p,a=(0,Sn.seatViewDisclosure)(p),l=(0,Sn.isAuthoredSeatView)(p)}else{let d;try{let{generateSeatPanorama:u}=await Ei();d=u(e,s,this.allSeats())}catch(u){t===this.seatViewGen&&this.opts.onError?.(u);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;r={url:d.url,generated:!0},a=(0,I.t)("picker.illustrationCaption",{m:d.distanceM})}this.closeSeatView(!1);let c=(0,I.t)("picker.viewFromSeat",{label:e.label}),h=Gi({root:this.root,source:r,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:Qe(),viewFromSeatLabel:c,real360Label:(0,I.t)("picker.real360"),previewLabel:(0,I.t)("picker.preview"),resolveAsset:d=>this.buyerAssetUrls.resolve(d),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 n=Number.isInteger(e);return(0,I.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(o,s)=>`${o} ${s}`,...n?{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(),n=fr(e,t);if(n==null)return;let o=6*36e5,s=Math.min(Math.max(n-t+1e3,1e3),o);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},s)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<Op}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||this.offerReadIsCurrent()||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}refreshOfferAvailability(e){if(!this.api.availability||this.destroyed)return Promise.resolve();if(this.offerReadInFlight)return this.offerReadInFlight;if(this.offerReadIsCurrent())return Promise.resolve();let t=this.readOfferAvailability(e).finally(()=>{this.offerReadInFlight===t&&(this.offerReadInFlight=null)});return this.offerReadInFlight=t,t}async readOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;this.offerReadSettledAt=Date.now();let n=on(t);if(!n)return;this.offerAvailability=n,this.applyChannelPricing(n.channelPricing),this.scheduleOfferBoundary(n);let o=sn(n),s={...this.hostPricing?.prices??{},...o},r=Object.keys(s).length>0||this.hostPricing?.formatter?{prices:s,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(r),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(n)}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;if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,n=t?.release??null,o=n?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!n&&!o){e.classList.remove("has"),e.replaceChildren();return}let s=n??o,r=document.createElement("div");r.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=n?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=s.name||(n?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));let h=document.createElement("span");h.className="sl-offer-line";let d=[];n&&t.fromPrice!=null&&d.push(this.money(t.fromPrice/100)),n&&s.remaining!=null&&d.push((0,I.t)("picker.offerRemainingAvailable",{count:s.remaining})),n&&s.endsAt!=null&&d.push((0,I.t)("picker.offerUntil",{time:Ai(s.endsAt,this.eventTimezone,this.opts.locale)})),o?.startsAt!=null&&d.push((0,I.t)("picker.offerStarts",{time:Ai(o.startsAt,this.eventTimezone,this.opts.locale)})),h.textContent=d.join(" \xB7 "),a.append(l,c,h);let u=document.createElement("details");u.className="sl-offer-info";let p=document.createElement("summary");p.setAttribute("aria-label",(0,I.t)("picker.howOfferWorks",{name:c.textContent??""})),p.textContent="i";let f=document.createElement("div");f.className="sl-offer-detail",f.textContent=n?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."),u.append(p,f),r.append(a,u),e.replaceChildren(r),e.classList.add("has")}paidPrice(e,t,n,o){let s=o?this.channelByObject.get(o):void 0;if(s&&e){let a=this.pricesByChannel.get(s)?.find(l=>l.categoryKey===e&&l.tierId===(t??null));if(a)return a.price}let r=e?this.opts.pricing?.prices?.[e]:void 0;return r===void 0?n:typeof r=="number"?r:t&&r.tiers?.[t]!==void 0?r.tiers[t]:r.base??n}legendDeps(){return pl(this)}syncPriceRail(e,t,n=this.legendDeps()){hl(this,e,t,n)}syncPrices(){ul(this)}focusCategory(e){ml(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(n=>!e.has(n.label)&&(this.controller.getStatus(n.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(n=>n.id)),this.toast((0,I.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:n,heldLabels:o,total:s,count:r}=un(this),a=[],l=new Set;if(!this.salesClosed){let y=this.performanceGroup?.nightSummary?.()??[];y.length&&a.push(Tr(y,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let H=this.performanceGroup?.selectionModeSwitch;H&&a.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${B(H.label)}</button>`)}let c={salesClosed:this.salesClosed,hasPicks:e.length>0||n.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(y=>y.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(_a(c)),this.els.trayHint&&(this.els.trayHint.textContent=Na(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed);let h=!e.length&&!n.length&&!Ve(this.gaQty,this.hold?.items??[]);if(!this.performanceGroup&&!this.salesClosed&&!this.hold&&(h||this.bestAvailableBusy||this.bestAvailableConfirm)){let y=(this.controller.doc?.categories??[]).filter(C=>!C.notForSale),H=this.controller.getBestAvailableZones();this.baZone&&!H.some(C=>C.id===this.baZone)&&(this.baZone=""),a.push(Oa({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:!1,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:y,zones:H,selectedCategory:this.baCat,selectedZone:this.baZone}))}let d=(y,H,C,N=1,M,P,_)=>Ra({categoryLabel:_,d:y?this.controller.seatDetails(y):null,area:C==="ga"?t.find(D=>D.id===M):void 0,label:H,objectType:C,quantity:N,identity:P,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),u=B,p=[];for(let y of Rs(n)){let H=y.objectType==="ga"?`held:ga:${y.objectId}:${y.tierId??""}`:`held:${y.label}`;l.add(H);let C=this.controller.doc?.categories.find(W=>W.key===y.categoryKey),N=y.tierId?C?.tiers?.find(W=>W.id===y.tierId)?.name:void 0,M=y.objectType!=="ga"?this.controller.seatByLabel(y.label):null,P=y.objectType==="table"?this.controller.tableSelection(y.label):null,_=M?this.controller.seatDetails(M.id):null,D=this.seatViewEnabled()&&!!M&&y.objectType!=="table"&&!!this.deliverableViewReference(M),V=u(this.tf("picker.heldForYou","Held for you")),ne=P?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(y.label))}">${u((0,I.t)("picker.guestsCountEdit",{count:y.quantity??1}))}</button>`:"",ee=this.paidPrice(y.categoryKey,y.tierId,y.unitPrice,y.label)*(y.quantity??1);p.push({key:H,fresh:!this.lastTrayKeys.has(H),held:!0,seatIds:[],heldLabels:y.labels,removeAria:(0,I.t)("picker.removeHeldTicketLabel",{label:Vn(y,t)}),locateId:M?.id??null,section:_?.sectionLabel??"",rowLabel:_&&X(_)||"",seatLabel:_?.seatNumber??y.label,categoryLabel:`${C?.label??y.categoryKey}${N?` \xB7 ${N}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(y.categoryKey)??C?.color??"",identityHtml:d(M?.id??null,y.label,y.objectType,y.quantity??1,y.objectId,P??void 0,`${C?.label??y.categoryKey}${N?` \xB7 ${N}`:""}`),stateHtml:`<span class="sl-ticket-state held" aria-label="${V}" title="${V}"><svg viewBox="0 0 24 24"><rect x="5" y="10" width="14" height="10" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg></span>`,extrasHtml:ne,amount:ee,amountText:this.suppressPricing?"":this.money(ee),noteHtml:Je(M??void 0),railHtml:this.performanceGroup?"":co((0,I.t)("picker.removeHeldTicketLabel",{label:Vn(y,t)}),D?y.label:null)})}let f=this.seatViewEnabled();for(let y of e.filter(H=>!o.has(H.label))){let H=`seat:${y.id}`;l.add(H);let C=this.controller.doc?.categories.find(W=>W.key===y.categoryKey),N=y.tiers&&y.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${u(y.id)}" aria-label="${u((0,I.t)("picker.ticketTierFor",{label:y.label}))}">`+y.tiers.map(W=>`<option value="${u(W.id)}"${W.id===y.tierId?" selected":""}>${u(W.name)} \xB7 ${u(this.money(this.paidPrice(y.categoryKey,W.id,W.price,y.label)))}</option>`).join("")+"</select>":"",M=y.tiers?.find(W=>W.id===y.tierId)??y.tiers?.[0],P=M?.buyerMessage?.trim()||(M?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),_=this.controller.seatDetails(y.id),D=u(this.tf("picker.selected","Selected")),V=(0,I.t)("picker.removeSeatLabel",{label:y.label}),ne=(y.objectType==="table"&&y.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(y.label))}">${u((0,I.t)("picker.guestsCountEdit",{count:y.quantity??1}))}</button>`:"")+N,ee=this.paidPrice(y.categoryKey,y.tierId??null,y.price,y.label)*(y.quantity??1);p.push({key:H,fresh:!this.lastTrayKeys.has(H),held:!1,seatIds:[y.id],heldLabels:[],locateId:y.id,section:_?.sectionLabel??"",rowLabel:_&&X(_)||"",seatLabel:_?.seatNumber??y.label,categoryLabel:C?.label??y.categoryKey,identityHtml:d(y.id,y.label,y.objectType,y.quantity??1,y.objectId,y,C?.label??y.categoryKey),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(y.categoryKey)??C?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${D}" title="${D}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:ne,amount:ee,amountText:this.suppressPricing?"":this.money(ee),removeAria:V,noteHtml:Je(y)+(P?`<small class="sl-tier-note">${u(P)}</small>`:""),railHtml:co(V,f&&y.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(y.label)??{})?y.label:null)})}p.length&&a.push(p.map(Ia).join("")),t.length&&a.push(Ds(this,t,n)),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let b=this.performanceGroup?.selectNight;b&&_r(this.els.tray,y=>b(y)),this.els.tray.querySelectorAll("[data-ba]").forEach(y=>{y.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(y.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",y=>{this.baCat=y.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",y=>{this.baZone=y.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelectorAll(".sl-chip .rm").forEach(y=>{y.addEventListener("click",()=>{let H=y.closest(".sl-chip");if(H.dataset.held){this.removeHeldLabels(decodeURIComponent(H.dataset.held).split(`
|
|
2917
|
-
`),H);return}let C=H.dataset.seat.split(" "),N=()=>{this.controller.deselect(C)};if(this.reducedMotion()){N();return}H.classList.remove("sl-enter"),H.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(N,Q.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(y=>{y.addEventListener("click",H=>{H.stopPropagation();let C=decodeURIComponent(y.dataset.tableEdit??""),N=this.controller.tableSelection(C);if(!N)return;let M=n.find(P=>P.label===C&&P.objectType==="table");this.showTableDialog({...N,quantity:M?.quantity??N.quantity},!!M,y)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(y=>{y.addEventListener("change",()=>this.controller.setSeatTier(y.dataset.tier,y.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(y=>{y.addEventListener("click",()=>{let H=this.controller.seatByLabel(y.dataset.viewLabel);H&&this.openSeatView(H)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(y=>{let H=()=>this.controller.flashSeat(y.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");y.addEventListener("mouseenter",H),y.addEventListener("focusin",H)}),Bs(this,this.els.tray,t),this.controller.setGASelection(Ms(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(y=>{y.disabled=!0});let k=this.pendingSelectionCount(),x=this.lastTrayCount,v=this.lastTrayTotal,A=Or(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");this.els.count.textContent=A||(r?(0,I.tCount)("picker.ticketsCount",r):this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=r&&!this.suppressPricing?this.money(s):"",this.root?.setAttribute("data-has-selection",String(r>0)),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy)),this.els.seatSummary&&(this.els.seatSummary.textContent=A||(r?(0,I.tCount)("picker.seatsSelectedCount",r):"")),this.syncCta(r,k),r!==x&&this.animateOnce(this.els.count,"sl-value-pop",380),s!==v&&this.animateOnce(this.els.total,"sl-value-pop",380),x===0&&r>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.lastTrayCount=r,this.lastTrayTotal=s,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(r,e),this.scheduleFit()}scheduleFit(){if(this.fitScheduled||this.destroyed)return;this.fitScheduled=!0;let e=()=>{this.fitScheduled=!1,this.destroyed||this.fitTranslatedRows()};typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}fitTranslatedRows(){cr(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(dr),this.els.tray?.querySelectorAll(".sl-ba-go").forEach(pr)}emitSelectionValidity(e,t){let n=this.controller.getSelectionValidity(e);n&&(n.seats=t,this.opts.onSelectionValidityChange?.(n),n.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(n),this.lastSelectionValidity=n.isValid)}async removeHeldLabels(e,t){let n=e.filter(r=>r&&!this.releasingLabels.has(r));if(!n.length)return!1;let o=n[0];n.forEach(r=>this.releasingLabels.add(r)),t?.setAttribute("aria-busy","true");let s=t?.querySelector(".rm");s&&(s.disabled=!0);try{let r=this.handedOff;if(!await this.controller.releaseLabels(n))return this.toast((0,I.t)("picker.couldNotRemoveLabel",{label:o}),"error"),!1;Is(this.gaQty,this.hold?.items??[],n);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&&r,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),!0}finally{n.forEach(r=>this.releasingLabels.delete(r)),t?.removeAttribute("aria-busy"),s?.isConnected&&(s.disabled=!1)}}async handleCta(){if(this.salesClosed)return;let e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(bn(e,(n,o)=>this.tf(n,o)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast((0,I.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(n=>!(this.hold.items??[]).some(o=>o.label===n.label))){let n=this.hold.seats??t;this.handedOff=!0,this.holdConflicted=!1,await this.runCheckoutHandoff(this.hold,n);return}this.holdingLabels=new Set(t.map(n=>n.label)),this.setCtaPhase("holding");try{let n=null,o=Ps(this.gaQty),s=this.committedSelection();if(s.length){let r=await this.controller.hold(void 0,this.opts.holdTtlMs);n=r?{holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items}:null}for(let{areaId:r,tierId:a,qty:l}of o){let c=await this.controller.holdGA(r,l,{tierId:a,ttlMs:this.opts.holdTtlMs});n=c?{holdId:c.holdId,expiresAt:c.expiresAt,seats:c.seats,items:c.items}:n}if(!n){this.raiseHoldConflict(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.")),this.setCtaPhase("idle"),this.syncTray();return}this.hold=n,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(n.expiresAt),this.flashHeldSeats(n),this.emitHoldChange(),this.performanceGroup?this.setCtaPhase("idle"):await this.runCheckoutHandoff(n,n.seats??s)}catch(n){this.opts.onError?.(n);let o=n,s=(o.conflicts??[]).map(a=>a.label).filter(Boolean).slice(0,3);o.reason==="event_closed"&&this.setSalesClosed(!0);let r=o.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):o.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):o.reason==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s.length?s.length===1?(0,I.t)("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):(0,I.t)("picker.labelsNoLongerAvailable.other",{labels:s.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(r),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){el(this,e)}stopHoldTimer(){tl(this)}setExtendPrompt(e,t){il(this,e,t)}refreshExtendPrompt(){nl(this)}handleExtend(){return ol(this)}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.controller.currentHold()===null&&(this.holdConflicted||this.showBooked())}raiseHoldConflict(e){this.holdConflicted=!0,this.bookedShown&&(this.bookedShown=!1,this.bookedEl?.classList.remove("on")),this.toast(e,"error")}showBooked(){if(this.bookedShown||!this.hold||this.holdConflicted)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((o,s)=>o+s.quantity,0),n=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=n?.seats?`<span class="sl-booked-seats">${(0,I.tCount)("picker.group.ticketsConfirmedAcross",n.seats,{performances:n.performances})}</span>`:`<span class="sl-booked-seats">${(0,I.tCount)("picker.ticketsCount",t)}</span> ${this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way.")}`),this.els.bookedList&&(this.els.bookedList.innerHTML=e.lineItems.map(o=>{let r=[o.sectionLabel,o.rowLabel&&`${this.tf("picker.row","Row")} ${o.rowLabel}`,o.seatNumber&&`${this.tf("picker.seat","Seat")} ${o.seatNumber}`].filter(Boolean).join(" \xB7 ")||o.displayLabel||o.label,a=o.quantity>1?` <span class="sl-booked-qty">\xD7${o.quantity}</span>`:"";return`<li>${B(r)}${a}</li>`}).join(""),this.els.bookedList.hidden=e.lineItems.length===0),this.bookedEl?.classList.add("on"),requestAnimationFrame(()=>this.bookedEl?.querySelector(".sl-booked-back")?.focus()),this.opts.onBooked?.(e)}dismissBooked(){this.bookedEl?.classList.remove("on"),this.resetAfterBooking(),this.root?.focus({preventScroll:!0})}resetAfterBooking(){this.bookedShown=!1,this.hold=null,this.handedOff=!1,this.holdConflicted=!1,this.holdingLabels.clear(),this.gaQty.clear(),this.stopHoldTimer(),this.forgetHold(),this.clearSelection(),this.setCtaPhase("idle"),this.setSheetOpen(!1),this.syncTray(),this.syncCta(),this.emitHoldChange()}notifyGroupSettled(e){e==="booked"?this.showBooked():this.dismissConfirm(),this.hold=null,this.handedOff=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.forgetHold(),this.syncTray(),this.syncCta()}async checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){await this.startHostedCheckout(e,t);return}await this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let n=this.buildHandoff(e),o=null;try{o=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(r){this.opts.onError?.(r)}if(this.destroyed)return;let s=o?.providers?.[0];if(!s){let r=qo(o?.reason),a=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:r,handoff:n}),this.opts.onCheckout?.(e,t,n),a||this.openCheckoutPanel({kind:"unavailable",reason:r,seatCount:n.lineItems.reduce((l,c)=>l+c.quantity,0)});return}await this.openCheckoutPanel({kind:"pay",provider:s,order:{holdId:n.holdId,expiresAt:n.expiresAt,currency:n.currency,total:n.total,labels:n.lineItems.map(r=>r.displayLabel??r.label)}})}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await Ci())}catch(n){this.opts.onError?.(n),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,eventKey:this.opts.event,formatMoney:n=>this.money(n),startSession:n=>this.pubApi.startCheckout(this.opts.event,{...n,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:n=>this.pubApi.orderStatus(n),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:n=>{this.opts.onOrderConfirmed?.(n),this.controller.refresh()},onError:n=>this.opts.onError?.(n)}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let n=(e.items??[]).map(r=>{let a=this.controller.lineItemDisplay(r);return{label:r.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},objectId:r.objectId,objectType:r.objectType,categoryKey:r.categoryKey,tierId:r.tierId,unitPrice:this.paidPrice(r.categoryKey,r.tierId,r.unitPrice,r.label),currency:r.currency??this.currency,quantity:r.quantity??1}}),o=n[0]?.currency??this.currency,s=n.reduce((r,a)=>r+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:o,lineItems:n,total:s}}emitHoldChange(){let e=this.hold;this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",n){let o=this.els.toast;if(!o)return;o.replaceChildren();let s=document.createElement("span");if(s.textContent=e,o.appendChild(s),o.classList.toggle("has-action",!!n),n){let r=document.createElement("button");r.type="button",r.className="sl-toast-action",r.textContent=n.label,r.addEventListener("click",n.onClick,{once:!0}),o.appendChild(r)}o.dataset.tone=t,o.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{o.classList.remove("on","sl-mo-rise"),o.classList.remove("has-action"),o.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),n=this.confirmEl;if(!t||!n?.isConnected){e.style.removeProperty("bottom");return}let o=this.els.map.clientHeight;if(o<=0)return;let s=n.getBoundingClientRect(),r=s.height||n.offsetHeight||Dp,a=s.height?s.top-this.els.map.getBoundingClientRect().top:o-to-r,l=Math.round(o-a+_p);if(l+Np>o){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){ea({boot:this.els.boot,map:this.els.map,rail:this.els.rail,root:this.root,reducedMotion:this.reducedMotion()})}placeTooltip(){if(!this.tipEl)return;let e={width:this.els.map.clientWidth,height:this.els.map.clientHeight},t={width:this.tipEl.offsetWidth,height:this.tipEl.offsetHeight},n=this.tipPinned?Fr(this.tipPos,e,t):null,o=n??Br(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${o.left}px`,this.tipEl.style.top=`${o.top}px`,n?this.tipEl.dataset.placement=n.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let n=this.performanceGroup,o=Jn(e.mark,n?.nights?.()),s=o?.states.filter(r=>r.free).length??0;return Er(o,{locale:this.opts.locale,switchLabel:n?.selectionModeSwitch?.label??null,selectPartialLabel:n?.partialSeatSelection?.label(s)??null,pinned:t})}unpinTooltip(){this.tipPinned&&(this.tipPinned=!1,this.tipEl?.classList.remove("sl-tip-pinned"),this.tipEl&&(this.tipEl.style.display="none"))}handleMapPointerDown(e){if(this.tipEl?.contains(e.target))return;this.lastMapPoint={x:e.clientX,y:e.clientY},this.lastPointerType=e.pointerType||"mouse";let t=this.els.map.getBoundingClientRect();this.tipPos={x:e.clientX-t.left,y:e.clientY-t.top},this.unpinTooltip()}closeInfoPops(e){this.root?.querySelectorAll(".sl-info.open").forEach(t=>{t!==e&&(t.classList.remove("open"),t.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false"))})}updateTooltip(e){if(!this.tipEl)return;if(this.confirmSeat){this.tipEl.style.display="none";return}if(this.tipPinned&&e?.interaction!=="press")return;if(!e){this.tipPinned||(this.tipEl.style.display="none",this.tipMarkedHoverLabel=null);return}let t=e.mark?.kind==="partial"&&this.tipMarkedHoverLabel===e.label;if(e.interaction!=="press"&&this.lastPointerType==="mouse"&&!e.mark&&!this.tipPinned){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}if(e.unavailable&&e.status==="free"&&e.interaction==="press"){this.toast(this.tf("picker.turnOffAccessibilityFilter","Turn off the wheelchair filter to pick this seat"),"neutral"),this.tipEl.style.display="none";return}if(e.unavailable&&!e.mark){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}let n=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t);this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let o=this.nightStripFor(e,n);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=Dr(e,{price:this.suppressPricing?"":this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label)),priceNote:this.suppressPricing?this.performanceGroup?.surface==="season"?this.tf("picker.season.includedInPackage","Included in the Season package"):this.tf("picker.group.pricesPerPerformance","Prices shown per performance"):"",rowTypeWord:nt(e),extra:o+(n?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${B(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=n,this.tipEl.classList.toggle("sl-tip-pinned",n),this.tipEl.querySelector("[data-pg-tip-close]")?.addEventListener("click",()=>this.unpinTooltip()),this.tipEl.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>{this.unpinTooltip(),this.performanceGroup?.selectionModeSwitch?.activate()}),$r(this.tipEl,this.performanceGroup?.partialSeatSelection?.label,s=>{this.unpinTooltip(),this.performanceGroup?.partialSeatSelection?.activate(e.id,s)}),this.tipEl.style.display="block",this.placeTooltip()}syncSeatMarks(){let e=this.performanceGroup?.seatMarks,t=this.controller.getRenderer();if(!e||!t?.setSeatMarks)return;let n={};for(let[o,s]of Object.entries(e())){let r=this.controller.idForLabel(o);r&&(n[r]=s)}Object.keys(n).length&&t.setSeatMarks(n)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),n=this.controller.getSelection().filter(o=>t.has(o.id)||t.has(o.label));if(n.length===t.size)return n;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){let e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e),this.applyMapChromeTokens(),this.minimap?.refreshMinimap())}applyThemeTokens(e){let t=Qt(this.themeMode),n=Tt(this.controller.doc?.theme,this.opts.theme,t);for(let[o,s]of Object.entries(n))e.style.setProperty(o,s);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=Ri(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(kt(this.opts.theme,this.themeMode)),this.applyMapChromeTokens(),this.minimap?.refreshMinimap(),this.syncPrices())}setThemeMode(e){this.destroyed||e===this.themeMode||(this.themeMode=e,this.opts.theme={...this.opts.theme??{},...e?{mode:e}:{mode:void 0}},this.watchThemeMode(),this.repaintForThemeMode(),this.emitAnalytics("theme_mode_changed",{mode:e,resolved:Qt(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Qt(this.themeMode),n=Tt(this.controller.doc?.theme,this.opts.theme,t),o=kt(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,s=bs(n,o);for(let r of gs)s?e.style.setProperty(r,s[r]):e.style.removeProperty(r)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){let t=JSON.stringify(this.opts.pricing??null),n=JSON.stringify(e??null);t!==n&&(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){this.langSel=xs(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=(0,I.getLocale)(),n=this.localeGeneration+=1,o=await(0,I.loadLocale)(e);return this.opts.messages&&(0,I.setStringOverrides)(this.opts.messages),o===t||this.applyActiveLocale(o,n),o}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(Ss(e,{root:this.root,painters:[()=>this.syncTray(),()=>this.syncPrices(),()=>this.syncOffer(),()=>this.syncRung(),()=>this.syncFloors(),()=>this.syncPanelToggle(),()=>this.syncFullscreenButtons()],refreshMapCopy:()=>this.controller.refreshMapCopy(),languageSelect:this.langSel}),this.scheduleFit())}isColorblindSafe(){return this.cbSafe}setColorblindSafe(e){e!==this.cbSafe&&(this.cbSafe=e,this.cbEl?.setAttribute("aria-pressed",String(e)),this.controller.setColorblindSafe(e),this.syncPrices(),this.minimap?.refreshMinimap(),Fp(e))}setViewMode(e){this.controller.setViewMode(this.normalizeInitialView(e)),this.syncProjection(),this.dismissConfirm()}getViewMode(){return this.controller.getViewMode()}normalizeInitialView(e){return e==="perspective"?(this.perspectiveWarned||(this.perspectiveWarned=!0,console.warn("[seatlayer] initialView:'perspective' (2.5D) is deprecated for the buyer picker and was coerced to 'flat'. Use the Map | 3D control for the immersive view.")),"flat"):e??"flat"}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,t??{})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}getBuyerView(){return ga(this)}setBuyerView(e,t){ba(this,e,t)}seatState3dFor(e){return ya(this,e)}pushAvailabilityTo3d(){va(this)}syncSelectionTo3d(){wa(this)}seatViewFor3d(e){return xa(this,e)}onView3dSeatPick(e){Sa(this,e)}seatViewCaption(e){return ka(this,e)}saveView3dComparisonSeat(e){Ta(this,e)}clearView3dComparison(){Ea(this)}view3dComparisonSnapshot(e){return Ca(this,e)}enter3d(e){return Aa(this,e)}publish3dTopInset(){Pa(this)}exit3d(){Ma(this)}openSeatConfidencePassport(e,t=null){ao(this,e,t)}closeSeatConfidencePassport(e=!0){li(this,e)}openView3dComparison(){pa(this)}closeView3dComparison(e=!0){st(this,e)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e)}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,n={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,n)}catch(o){this.opts.onError?.(o);let s=o?.reason,r=s==="not_enough_together"?(0,I.t)("picker.couldNotFindSeatsTogether",{count:e}):s==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):s==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):s==="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(r,"error"),null}}async bestAvailableOrThrow(e,t,n={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let o=this.els.tray?.querySelector(".sl-ba-go");o&&(o.disabled=!0,o.classList.add("sl-busy"),o.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let s=await this.controller.bestAvailable(e,t,{...n,ttlMs:this.opts.holdTtlMs});return s?(this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(s.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),n.preferPremium&&s.seats.length&&!s.seats.every(r=>r.commercial?.premium)&&this.toast((0,I.t)("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),n=!0;if(t)n=await this.controller.release();else if(e){let o=[...new Set([...(e.items??[]).map(s=>s.label),...(e.seats??[]).map(s=>s.label)])];if(o.length)try{await this.api.release(this.opts.event,o,e.holdId)}catch(s){this.opts.onError?.(s),n=!1}}if(!n){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 ke({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:vt(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,n)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:n}),this.syncTray(),this.toast(n==="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)}clearDecisionSurfaces(){this.dismissConfirm(),this.dismissTableDialog(!1),Te(this,!1)}showAccessPanel(e){if(this.destroyed||!this.root)return;this.dismissAccessPanel(),this.clearDecisionSurfaces();let t=ds(e.reason,()=>this.recoverAccess());(this.root.querySelector(".sl-body")??this.root).appendChild(t),this.accessEl=t}async recoverAccess(){return await this.refreshAccess()?!0:(this.opts.onAccessUnavailable||typeof window>"u"||window.location.reload(),!1)}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}showHoldExpired(){if(this.destroyed||!this.root||this.holdExpiredEl)return;this.clearDecisionSurfaces();let e=yl({restart:()=>this.restartAfterHoldExpiry()},this.holdExpiredUnits);this.root.appendChild(e),this.holdExpiredEl=e,requestAnimationFrame(()=>e.querySelector(".sl-interrupt-act")?.focus());let t=this.holdExpiredUnits;this.holdExpiredFresh=!1,this.refreshAvailability().then(()=>{if(this.destroyed||this.holdExpiredEl!==e)return;this.holdExpiredFresh=!0;let n=t.filter(r=>r.objectType!=="ga"),o=[],s=[];for(let r of n){let a=this.controller.seatByLabel(r.label);(a&&this.controller.getStatus(a.id)==="free"?o:s).push(r.label)}bl(e,{recoverable:o,taken:s,onRecover:r=>this.recoverAfterHoldExpiry(r)})}).catch(()=>{})}recoverAfterHoldExpiry(e){this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.select(e),this.syncTray(),this.handleCta()}dismissHoldExpired(){this.holdExpiredEl?.remove(),this.holdExpiredEl=null}restartAfterHoldExpiry(){let e=this.holdExpiredUnits;this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.overview(),this.syncTray(),this.syncCta(),this.root?.focus({preventScroll:!0});let t=this.holdExpiredFresh;this.holdExpiredFresh=!1,(t?Promise.resolve():this.refreshAvailability()).then(()=>{this.destroyed||gl({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:n=>this.controller.seatByLabel(n),statusOf:n=>this.controller.getStatus(n),flash:(n,o)=>this.controller.flashSeat(n,o)},e)}).catch(()=>{})}destroy(){this.destroyed=!0,oo(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.dismissAccessPanel(),this.dismissHoldExpired(),this.access?.clear(),this.hold&&!this.handedOff&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),Te(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.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.viewportResizeHandler&&window.removeEventListener("resize",this.viewportResizeHandler),this.viewportResizeHandler=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,this.root?.remove(),this.root=null,this.modalScrim&&(this.modalScrim.remove(),this.modalScrim=null,this.prevFocus?.isConnected&&this.prevFocus.focus({preventScroll:!0}),this.prevFocus=null)}};var qe=require("@seatlayer/core");var Ml="seatlayer-performance-group-picker-style";function Ll(){if(document.getElementById(Ml))return;let i=document.createElement("style");i.id=Ml,i.textContent=`
|
|
3144
|
+
}`,e.append(t);let n="linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.04) 63%)",o=document.createElement("div");Object.assign(o.style,{position:"absolute",inset:"0",display:"flex",flexDirection:"column",padding:"16px",gap:"14px",opacity:"0.9"});let s=c=>{let h=document.createElement("div");return h.className="sl-shimmer",Object.assign(h.style,{background:n,borderRadius:"8px"}),Object.assign(h.style,c),h};o.append(s({height:"40px",width:"100%",flex:"0 0 auto"}));let r=document.createElement("div");Object.assign(r.style,{display:"flex",gap:"14px",flex:"1 1 auto",minHeight:"0"}),r.append(s({width:"220px",height:"100%",flex:"0 0 auto"})),r.append(s({flex:"1 1 auto",height:"100%"})),o.append(r),e.append(o);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:n,flex:"0 0 auto"}),a.append(l),a.append(document.createTextNode("Loading designer\u2026")),e.append(a)}buildErrorCard(e,t){let n=gd[t],o=document.createElement("div");Object.assign(o.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 s=document.createElement("h2");s.textContent=n.title,Object.assign(s.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let r=document.createElement("p");r.textContent=n.body,Object.assign(r.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let a=document.createElement("button");a.type="button",a.textContent="Try again",Object.assign(a.style,{appearance:"none",cursor:"pointer",border:"0",borderRadius:"10px",padding:"10px 22px",fontSize:"14px",fontWeight:"600",color:"#101625",background:"#7aa2ff"}),a.addEventListener("click",()=>this.handleTryAgain()),o.append(s,r,a),e.append(o)}};var R=require("@seatlayer/core"),xn=require("@seatlayer/core/view3d/crossfade/panorama");function or(i){return!!i&&i.clientWidth>0&&i.scrollWidth>i.clientWidth+1}function bd(i){return i.some(e=>or(e))}var tn="data-fit-gone",yd=12;function Xn(i,e,t=or){if(!i)return 0;for(let n of e)i.classList.remove(n.cls);if(i.querySelectorAll(`[${tn}]`).forEach(n=>{n.removeAttribute(tn),n.hidden=!1}),i.dataset.fit="0",i.clientWidth<=0||!t(i))return 0;for(let n=0;n<e.length;n+=1){let o=e[n];n>0&&i.classList.remove(e[n-1].cls),i.classList.add(o.cls),i.dataset.fit=String(n+1);let s=o.give?o.give(i):!0;if(!t(i))return n+1;if(o.repeat&&o.give){for(let r=1;s&&r<yd;r+=1)if(s=o.give(i),!t(i))return n+1}}return e.length}function vd(i,e="[data-fit-seg]"){let t=[...i.querySelectorAll(e)].filter(n=>!n.hidden);return t.length<2?!1:sr(t[t.length-1])}function wd(i,e){let t=i.querySelector(e);return t&&!t.hidden?sr(t):!1}function sr(i){let e=i.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(tn,""),e.hidden=!0),i.setAttribute(tn,""),i.hidden=!0,!0}function xd(i){if(!i)return!1;let e=(i.getAttribute("aria-label")||i.textContent||"").trim();return e?(i.setAttribute("aria-label",e),i.setAttribute("title",e),!0):!1}function rr(i){if(!i)return 0;let e=i.querySelector(".sl-confirm-cancel"),t=i.querySelector(".sl-confirm-add-t");return Xn(i,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>xd(e)}],()=>bd([e,t]))}function ar(i){return Xn(i,[{cls:"sl-fit-notype",give:e=>wd(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>vd(e),repeat:!0}])}function lr(i){return i?(i.classList.add("sl-fitpill"),Xn(i,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var Sd=["on-sale","low","sold-out","presale","closed"];function si(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function dr(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function cr(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i,t=e.count,n=e.index;if(typeof n!="number"||!Number.isInteger(n)||n<1||typeof t!="number"||!Number.isInteger(t)||t<n)return;let o=e.remaining;if(o!=null&&(typeof o!="number"||!Number.isInteger(o)||o<0))return;let s={index:n,count:t,remaining:o??null};if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;s.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;s.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;s.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let r of["startsAt","endsAt"]){if(e[r]===void 0)continue;let a=dr(e[r]);if(a===void 0)return;s[r]=a}return s}function kd(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],n=new Set;for(let r of e.channels){if(!r||typeof r!="object"||Array.isArray(r))return;let a=r,l=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||n.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],h=new Set;for(let d of a.priceOverrides){if(!d||typeof d!="object"||Array.isArray(d))return;let u=d,p=typeof u.categoryKey=="string"?u.categoryKey.trim():"",g=u.tierId===null?null:typeof u.tierId=="string"&&u.tierId.trim()?u.tierId.trim():void 0,y=si(u.price);if(!p||g===void 0||y===void 0||y===null)return;let T=`${p}\0${g??""}`;if(h.has(T))return;h.add(T),c.push({categoryKey:p,tierId:g,price:y})}n.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let o=[],s=new Set;for(let r of e.objects){if(!r||typeof r!="object"||Array.isArray(r))return;let a=r,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||s.has(l)||!n.has(c))return;s.add(l),o.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:o}}function nn(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i,t=Sd.find(h=>h===e.state);if(!t)return null;let n=si(e.fromPrice),o=si(e.previousPrice);if(n===void 0||o===void 0)return null;let s=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(s===void 0)return null;let r=cr(e.release);if(r===void 0)return null;let a=e.upcoming===void 0?null:cr(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 d of e.prices){if(!d||typeof d!="object"||Array.isArray(d))return null;let u=d,p=typeof u.categoryKey=="string"?u.categoryKey.trim():"";if(!p)return null;let g=si(u.price),y=si(u.previousPrice);if(g==null||y===void 0)return null;let T={categoryKey:p,price:g,previousPrice:y};if(u.offerId!==void 0){if(typeof u.offerId!="string"||!u.offerId.trim())return null;T.offerId=u.offerId.trim()}if(u.offerName!==void 0){if(typeof u.offerName!="string"||!u.offerName.trim())return null;T.offerName=u.offerName.trim()}if(u.remaining!==void 0){if(u.remaining!==null&&(typeof u.remaining!="number"||!Number.isInteger(u.remaining)||u.remaining<0))return null;T.remaining=u.remaining==null?null:u.remaining}for(let S of["startsAt","endsAt"]){if(u[S]===void 0)continue;let v=dr(u[S]);if(v===void 0)return null;T[S]=v}h.push(T)}l=h}let c=kd(e.channelPricing);return c===void 0?null:{state:t,fromPrice:n,previousPrice:o,currency:s,release:r,upcoming:a,prices:l,channelPricing:c}}function pr(i){return i?.changed!==!1}function hr(i,e){if(!i)return null;let t=null,n=o=>{o!=null&&o>e&&(t===null||o<t)&&(t=o)};for(let o of[i.release,i.upcoming])n(o?.startsAt),n(o?.endsAt);for(let o of i.prices)n(o.startsAt),n(o.endsAt);return t}function on(i){let e={};for(let t of i?.prices??[])e[t.categoryKey]=t.price;return e}function ur(i){return i.focusedSection!==null?i.deeperThanSectionFrame===!1?"venue":"section":i.atVenueFit!==void 0?i.atVenueFit?"none":"venue":i.seatsRevealed?"venue":"none"}function mr(i,e,t=[],n=8){let o=e.reduce((r,a)=>!a||a.width<=0||a.height<=0?r:Math.max(r,a.bottom-i.top+n),0),s=t.reduce((r,a)=>!a||a.width<=0||a.height<=0?r:Math.max(r,i.bottom-a.top+n),o>0?n:0);return{top:Math.max(0,Math.ceil(o)),right:0,bottom:Math.max(0,Math.ceil(s)),left:0}}function fr(i){let e=document.createElement("div");e.className="sl-floors on",e.setAttribute("role","group"),e.setAttribute("aria-label",i.tf("picker.chooseLevel","Choose level"));let t=[{id:"",name:i.tf("picker.allLevels","All levels")},...i.floors.map(r=>({id:r.id,name:r.name}))],n=document.createElement("span");n.className="sl-floor-label",n.textContent=`${i.tf("picker.levels","Level")}:`,e.appendChild(n);let o=document.createElement("select");o.className="sl-floor-select",o.setAttribute("aria-label",i.tf("picker.chooseLevel","Choose level"));for(let r of t){let a=document.createElement("option");a.value=r.id,a.textContent=r.name,o.appendChild(a)}let s=i.tf("picker.floorHelp","All levels shows the complete venue. Choose one level to inspect and select its seats.");return o.title=s,o.addEventListener("change",()=>i.onChoose(o.value)),e.appendChild(o),e}function gr(i,e,t){if(!i)return;let n=t?"":e,o=i.querySelector(".sl-floor-select");o&&(o.value=n)}var sn=class{constructor(e){this.el=null;this.current=null;this.collapsed=!1;this.shownAt=0;this.host=e}get summary(){return this.current}adopt(e){this.current=e}get element(){return this.el}show(e){if(e&&e.id!==this.current?.id&&this.host.collapseSheet(),this.current=e,!e){this.el?.remove(),this.el=null,this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}render(e){this.el?.remove(),this.el=null}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,n=this.host.map();if(!e||!t||!n)return 0;let o=this.host.activeFloorObjects().find(v=>v.type==="section"&&v.id===t.id)?.outline;if(!o||o.length<3)return 0;let s=o.map(v=>this.host.controller.worldToScreen(v)),r=s.map(v=>v.x),a=s.map(v=>v.y),l=Math.min(...r),c=Math.min(...a),h=Math.max(...r)-l,d=Math.max(...a)-c;if(h<=0||d<=0)return 0;let u=n.getBoundingClientRect(),p=e.getBoundingClientRect(),g=p.left-u.left,y=p.top-u.top,T=Math.max(0,Math.min(g+p.width,l+h)-Math.max(g,l)),S=Math.max(0,Math.min(y+p.height,c+d)-Math.max(y,c));return T*S/(h*d)}};var st=require("@seatlayer/core"),$r=require("@seatlayer/core/core/color");var Ge=require("@seatlayer/core");function Zn(i,e,t){try{return new Intl.DateTimeFormat(e,{...t,...i.timezone?{timeZone:i.timezone}:{}}).format(new Date(i.startsAt))}catch{return new Date(i.startsAt).toLocaleString(e)}}var rn=(i,e)=>Zn(i,e,{dateStyle:"medium"}),an=(i,e)=>Zn(i,e,{timeStyle:"short"}),ln=(i,e)=>Zn(i,e,{weekday:"short",day:"numeric",month:"short"});function br(i,e,t,n){return!i.length||i.length>=e?null:{summary:n,labels:i.map(o=>`${rn(o,t)} \xB7 ${an(o,t)}`)}}function Td(i,e){let t=new Set(e);return i.map(n=>({...n,free:!t.has(n.eventKey)}))}function yr(i,e){let t=[...i];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function Ed(i,e,t="",n=!1){if(!i.length)return"";let o=i.map(s=>{let r=s.free?e.free:e.blocked,a=n&&s.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${C(s.eventKey)}" aria-label="${C(`${s.shortDate}: ${r}`)}" checked>`:"";return`<li class="sl-night${s.free?" ok":" no"}" aria-label="${C(`${s.shortDate}: ${r}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${C(s.shortDate)}</span><span class="st">${C(r)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${C(e.title)}</div><ul class="sl-nightstrip">${o}</ul><p class="sl-tip-nights-note">${C(e.notAvailableOn)}</p>`+t+"</div>"}function Cd(i){return i.selectPartialLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${C(i.selectPartialLabel)}</button>`:i.switchLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${C(i.switchLabel)}</button>`:i.switchLabel||i.selectPartialLabel?"":`<p class="sl-tip-advice">${C(i.advice)}</p>`}function Ad(i){return Number(i.available)+Number(i.selected)+Number(i.partial)+Number(i.unavailable)}function vr(i,e,t){if(Ad(i)<2)return"";let n=(s,r,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${s}"${a}></i>${C(r)}</li>`,o=[];return i.available&&o.push(n("sl-pg-sw-free",e.available,` style="background:${C(t)}"`)),i.selected&&o.push(n("sl-pg-sw-sel",e.selected)),i.partial&&o.push(n("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${C(t)}"`)),i.unavailable&&o.push(n("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${C(e.title)}">${o.join("")}</ul>`}function wr(i,e){if(!i.length)return"";let t=i.map(n=>{let o=n.labels.length?n.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${n.labels.length?"":" empty"}${n.active?" active":""}" role="button" tabindex="0"${n.active?' aria-current="true"':""} data-event-key="${C(n.eventKey)}"><span class="n">${C(n.name)}</span><span class="s">${C(o)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${C(e.title)}"><div class="sl-pg-nights-title">${C(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function Qn(i,e){if(i?.kind!=="partial"||!e?.length)return null;let t=i.data?.blockedEventKeys??[],n=Td(e,t);return{states:n,missing:n.filter(o=>!o.free).map(o=>o.shortDate)}}function xr(i,e){return i?Ed(i.states,{title:b("picker.group.partlyAvailableTitle","Free on some nights only"),free:b("picker.group.nightFree","Free"),blocked:b("picker.group.nightBlocked","Not available"),notAvailableOn:(0,Ge.t)("picker.group.notAvailableOn",{dates:yr(i.missing,e.locale)})},Cd({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:b("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function Pd(i,e,t,n){if(!i.length)return"";let o=new Set(e),s=new Set(t),r=i.map(a=>{let l=o.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${C(a.eventKey)}" aria-label="${C(`${a.shortDate}: ${l?n.available:n.unavailable}`)}"${l&&s.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${C(a.shortDate)}</span><span class="sl-confirm-date-state">${C(l?n.available:n.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${C(n.title)}</legend><p class="sl-confirm-dates-copy">${C(n.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${C(n.selectAll)}</span></label><ul>${r}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function Sr(i,e,t,n){let o=e.availableEventKeys(t);return Pd(i,o,e.includedEventKeys(),{title:n("picker.group.confirmDatesTitle","Choose performance dates"),copy:o.length===i.length?n("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(i.length)):n("picker.group.confirmPartialDatesCopy","This seat is available for {available} of {total} dates. Choose one date or keep every available date.").replace("{available}",String(o.length)).replace("{total}",String(i.length)),selectAll:n("picker.group.confirmSelectAll","Select all available dates"),available:n("picker.group.nightFree","Available"),unavailable:n("picker.group.nightBlocked","Unavailable")})}function kr(i){return[...i.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function Tr(i,e,t,n){let o=[...i.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!o.length)return;let s=i.querySelector(".sl-confirm-add"),r=i.querySelector("[data-pg-confirm-all]"),a=()=>{let l=o.filter(d=>!d.disabled),c=kr(i).length;r&&(r.checked=c===l.length,r.indeterminate=c>0&&c<l.length);let h=i.querySelector("[data-pg-confirm-summary]");h&&(h.textContent=c===l.length?t("picker.group.confirmAllSelected","All {count} available dates are selected.").replace("{count}",String(c)):t("picker.group.confirmSelectedOfAvailable","{selected} of {available} available dates selected.").replace("{selected}",String(c)).replace("{available}",String(l.length))),s.disabled=c===0,s.textContent=c?e.label(c):t("picker.group.confirmChooseOne","Choose at least 1 date"),n()};o.forEach(l=>l.addEventListener("change",a)),r?.addEventListener("change",()=>{o.filter(l=>!l.disabled).forEach(l=>{l.checked=r.checked}),a()}),a()}async function Er(i,e,t){if(!i||!t||!i.querySelector("[data-pg-confirm-event-key]"))return!0;let n=kr(i);if(!n.length)return!1;let o=i.querySelector(".sl-confirm-add");return o?.setAttribute("aria-busy","true"),o&&(o.disabled=!0),await t.apply(e,n)?!0:(o?.removeAttribute("aria-busy"),o?.isConnected&&(o.disabled=!1),!1)}function Cr(i,e,t){return i?(0,Ge.t)("picker.group.seatPartlyAvailable",{label:e,free:i.states.length-i.missing.length,total:i.states.length,dates:yr(i.missing,t)}):""}function Ar(i,e){let t=i.map((n,o)=>{let s=n.state==="done"?e.done:n.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${C(n.id)}" data-state="${C(n.state)}"${n.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${n.state==="done"?"\u2713":String(o+1)}</span><span class="l">${C(n.label)}</span><span class="sl-pg-sr">${C(s)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${C(e.label)}">${t}</ol>`}function Jn(i,e){return`<ul class="sl-pg-cards">${i.map(n=>`<li class="sl-pg-card" data-event-key="${C(n.eventKey)}"><span class="n">${C(n.name)}</span><time datetime="${C(n.iso)}"><span class="d">${C(n.date)}</span><span class="t">${C(n.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${C(e)}</p>`}function Pr(i){let e=i.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${C(t.eventKey)}"><span class="n">${C(t.name)}</span><span class="s">${C(t.labels.length?t.labels.join(", "):i.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${C(i.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(i.note?`<p class="sl-pg-pane-note">${C(i.note)}</p>`:"")+(i.total?`<div class="sl-pg-pane-total"><span>${C(i.total.label)}</span><b>${C(i.total.amount)}</b></div>`:"")+(i.holdStatus?`<p class="sl-pg-hold-status" role="status">${C(i.holdStatus)}</p>`:"")}function Lr(i){let e=Math.max(0,i);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function Mr(i,e){if(!i||i.seats<=0)return"";if(e==="same_seat"){let t=i.perPerformance??i.seats;return i.totalPerformances&&i.performances<i.totalPerformances?(0,Ge.tCount)("picker.group.performancesChosenOf",t,{chosen:i.performances,total:i.totalPerformances}):(0,Ge.tCount)("picker.group.seatsEveryPerformance",t)}return i.perPerformance!=null&&i.performancesChosen===i.performances?(0,Ge.tCount)("picker.group.seatsPerPerformance",i.seats,{per:i.perPerformance}):(0,Ge.tCount)("picker.group.performancesChosenOf",i.seats,{chosen:i.performancesChosen,total:i.performances})}function Hr(i,e){i.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let n=()=>e(t.dataset.eventKey);t.addEventListener("click",n),t.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),n())})})}var Rr=require("@seatlayer/core");function Ue(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function Ld(i,e){let t=i.objectType==="table"&&!!i.bookingMode,n=i.objectType==="booth",o=t||n||!i.seatNumber,s=o?i.rowLabel??i.displayLabel??i.label:i.seatNumber,r=t?`${b("picker.guests","Guests")} ${i.bookingMode==="variable"?`${i.minOccupancy}\u2013${i.maxOccupancy}`:i.capacity}`:!n&&i.rowLabel?`${e} ${Z(i)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${o?" name":""}">${Ue(s)}</span>`+(r?`<span class="sl-tip-row">${Ue(r)}</span>`:"")+"</div>"+(i.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${b("picker.section","Section")}</span><span class="sl-tip-secname">${Ue(i.sectionLabel)}</span></div>`:"")+"</div>"}function Ir(i,e){let t=i.status==="not_for_sale",n=i.mark?.kind==="partial",o=i.status==="free"||n?"":`<span class="sl-tip-tag">${t?b("picker.notAvailable","Not available"):i.status==="held"?(0,Rr.t)("map.statusHeld"):b("picker.sold","Sold")}</span>`,s=t?"":e.price,r=s?`<span class="sl-tip-amt">${Ue(s)}</span>`:"",a=!s&&e.priceNote?`<div class="sl-tip-note">${Ue(e.priceNote)}</div>`:"",l=et(i,{compact:!0}),c=e.reason?`<div class="sl-tip-reason">${Ue(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+Ld(i,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${Ue(i.categoryColor)}"></span><span class="sl-tip-name">${Ue(i.categoryLabel)}</span>`+o+r+"</div>"+a+c+l+(e.extra??"")}function Or(i,e,t,n){let o=i.x+14,s=i.y-n.height-12,r=i.y+18,a=s;o+n.width>e-8&&(o=i.x-n.width-14),s<8&&r+n.height<=t-8&&(a=r);let l=Math.max(8,t-n.height-8);return{left:Math.max(8,Math.min(o,Math.max(8,e-n.width-8))),top:Math.max(8,Math.min(a,l))}}function _r(i,e,t,n=22){let o=Math.max(8,Math.min(i.x-t.width/2,Math.max(8,e.width-t.width-8))),s=i.y-n-t.height,r=i.y+n;return s>=8?{left:o,top:s,placement:"above"}:r+t.height<=e.height-8?{left:o,top:r,placement:"below"}:{left:o,top:Math.max(8,Math.min(s<8?r:s,Math.max(8,e.height-t.height-8))),placement:s<8?"below":"above"}}var eo=14,Md=12,Hd=12,Rd=8;function Nr(i,e,t,n=Md){let o=e.height-eo-t.height,s=Hd,r=o-n;if(r<=s)return{placement:"sheet",nudgeY:0};let a=(s+r)/2-i;return Math.abs(a)<=Rd?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function Dr(i,e,t,n,o=0){let s=t.width/2+12,r=Math.max(s,Math.min(e.width-s,i.x)),a=i.y+o+t.height+24<=e.height,l=i.y-o<t.height+24&&a?"below":"above",c=l==="above"?i.y-o:i.y+o,h=n&&l==="above"?Math.max(t.height+24,c):c;return{left:r,top:Math.max(8,Math.min(e.height-8,h)),placement:l}}function Br(i,e,t){let n=i.querySelector("[data-pg-select-partial]"),o=[...i.querySelectorAll("[data-pg-event-key]")],s=()=>o.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),r=()=>{if(!n)return;let a=s().length;n.disabled=a===0,n.textContent=e?.(a)??n.textContent};o.forEach(a=>{a.addEventListener("change",r);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,r())})}),n?.addEventListener("click",()=>{let a=s();a.length&&t?.(a)})}function ot(i){let e=i?.displayType?.trim()||i?.rowType?.trim();return e||(i?.objectType==="table"?b("picker.table","Table"):i?.objectType==="booth"?b("picker.booth","Booth"):b("picker.row","Row"))}var Id="sl-confirm-scrim",Od="--sl-scrim-mask";function _d(i){let e=Math.round(i.x),t=Math.round(i.y);return`radial-gradient(circle at ${e}px ${t}px, transparent 0 56px, #000 88px)`}function Fr(i,e,t,n){let o=i??document.createElement("div");return i||(o.className=Id),o.style.setProperty(Od,_d(n)),t.parentNode===e?o.nextSibling!==t&&e.insertBefore(o,t):o.parentNode!==e&&e.appendChild(o),o}function to(i){return i?.remove(),null}var Nd=360,Dd=160,Bd=700,Vr=450;function zr(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function Fd(i){return(0,$r.contrastRatio)("#ffffff",i)>=3?"#ffffff":"#0b0f19"}var cn=class{constructor(e){this.el=null;this.seat=null;this.outsideTap=null;this.scrim=null;this.shownAt=0;this.lift=null;this.framing=null;this.mode="add";this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let n=Ot(e)?e.viewUrl??"":"",o=Zi(t);if(!n&&!o)return"";let s=n?null:Qi(e,e.focalPoint??t.focalPoint);if(!n&&s==null)return"";let r=o&&s!=null?`<div class="sl-confirm-sight">${D((0,st.t)("picker.sightline",{m:s}))}</div>`:"";if(!n)return r;let a=D((0,st.t)("picker.viewFromSeat",{label:e.label})),l=D(this.host.tf("picker.viewFromHere","View from here"));return`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${a}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${l}</span></button>`+r}show(e,t="add"){let n=this.host;this.mode=t;let o=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,n.root()?.setAttribute("data-confirming","true"),n.els().side?.toggleAttribute("inert",!0),Object.values(n.regions()).forEach(A=>A.toggleAttribute("inert",!0)),n.controller.setSelectionFocus(e.id),o&&o!==e.id&&n.controller.deselect([o]),n.hideTooltip();let s=n.controller.seatDetails(e.id),r=n.controller.doc?.categories.find(A=>A.key===e.categoryKey),a=s?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),l=a!=null?n.paidPrice(e.categoryKey,s?.tierId??r?.tiers?.[0]?.id??null,a,e.label):void 0,c=Jo(s,e.displayLabel??e.label,ot(s)),h=s?.tiers??r?.tiers??[],d=s?.tierId??h[0]?.id,u=n.suppressPricing()?"":ns(h,d,A=>n.money(n.paidPrice(e.categoryKey,A.id,A.price,e.label))),p=n.buyerView()==="venue3d",g=n.performanceGroup()?.confirmDateSelection??void 0,y=g?n.performanceGroup()?.nights?.()??[]:[],T=g?Sr(y,g,e.id,(A,E)=>n.tf(A,E)):"";this.shownAt=performance.now();let S=document.createElement("div");S.className="sl-confirm sl-mo-in",t==="remove"&&S.classList.add("sl-confirm-removing"),T&&S.classList.add("sl-confirm-group-dates"),S.setAttribute("role","dialog"),S.setAttribute("aria-label",(0,st.t)("picker.confirmSeatLabel",{label:e.label}));let v=n.controller.getRenderer?.()?.categoryDisplayColor?.(e.categoryKey)??r?.color??"#6e7bff";S.style.setProperty("--sl-cat",v),S.style.setProperty("--sl-cat-ink",Fd(v));let P=String(s?.categoryLabel??r?.label??e.categoryKey),B=n.controller.categoryAvailability()[e.categoryKey],U=typeof B=="number"&&B>0?(0,st.tCount)("picker.leftCount",B):"";S.innerHTML=os({identityFields:c,identity:es(s,e.displayLabel??e.label,ot(s)),marker:Xo({...s?.wheelchairSpaceType?{wheelchairSpaceType:s.wheelchairSpaceType}:{}}),see3dPill:ts(n.canOffer3d(),p),categoryColor:v,categoryLabel:P,priceLabel:!n.suppressPricing()&&l!=null?n.money(l):"",categoryLeftLabel:U,tierChoices:u,groupDates:T,wheelchair:"",commercial:et({...e.accessibility?.length?{accessibility:e.accessibility}:{},...s?.wheelchairSpaceType?{wheelchairSpaceType:s.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{}}),thumb:n.seatViewEnabled()&&n.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:p?`<div class="sl-confirm-inspect-row">${Qo(e,n.suppressPricing()?`${s?.displayLabel??e.displayLabel??e.label}`:`${s?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?n.tf("picker.priceNotSupplied","Price not supplied"):n.money(l)}`,p)}${Zo(e,p?n.view3dCompareSeatIds():null)}${Rn(n.canOffer3d(),p)}</div>`:Rn(n.canOffer3d(),p),see3dRow:is(n.canOffer3d(),p),cancelLabel:(0,st.t)("common.cancel"),selectLabel:t==="remove"?n.tf("picker.removeSeat","Remove seat"):n.addSeatLabel(s?.objectType)}),t==="remove"&&S.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),n.els().map.appendChild(S),this.el=S;let f=S.querySelector(".sl-confirm-thumb"),L=f?.closest(".sl-confirm-thumbwrap")??null;if(f&&L){let A=!1,E=()=>{if(A||!L.isConnected)return;A=!0;let _=()=>{L.remove(),this.el===S&&n.reanchor()};if(n.reducedMotion()||typeof requestAnimationFrame!="function"){_();return}L.style.height=`${L.offsetHeight}px`,L.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{L.style.height="0px",L.style.opacity="0"}),setTimeout(_,Dd)};f.addEventListener("error",E),f.addEventListener("load",()=>{f.naturalWidth||E()});let I=e.viewMeta?.previewUrl??e.viewUrl;I?n.resolveAssetUrl(I).then(_=>{if(!(!S.isConnected||this.el!==S)){if(!_){E();return}f.src=_}}).catch(_=>{E(),n.onError(_)}):E()}n.reanchor(),this.liftSeatClearOfSheet(e),S.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{n.openSeatView(e)}),S.querySelector(".sl-confirm-confidence")?.addEventListener("click",A=>{n.openSeatConfidencePassport(e,A.currentTarget instanceof HTMLElement?A.currentTarget:null)}),S.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>n.saveView3dComparisonSeat(e)),S.querySelectorAll("[data-confirm-tier]").forEach(A=>{A.addEventListener("click",()=>{let E=A.dataset.confirmTier,I=h.find(N=>N.id===E);if(!I)return;n.controller.setSeatTier(e.id,I.id),S.querySelectorAll("[data-confirm-tier]").forEach(N=>{N.setAttribute("aria-pressed",String(N===A))});let _=S.querySelector(".sl-confirm-price");_&&(_.textContent=n.money(n.paidPrice(e.categoryKey,I.id,I.price,e.label))),n.reanchor()})}),S.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(A=>{A.addEventListener("pointerdown",ki,{once:!0}),A.addEventListener("click",()=>{n.buyerView()==="venue3d"?(n.dismiss(),n.view3dHandle()?.flyToSeat(e.id)):(n.rememberView3dReturnSeat(e),n.dismiss(),n.enter3d(e.id))})}),Tr(S,g,(A,E)=>n.tf(A,E),()=>n.reanchor()),S.querySelector(".sl-confirm-add").addEventListener("click",()=>{if(!this.ghostActivation()){if(this.mode==="remove"){this.removeCommitted();return}this.commit()}}),S.querySelector(".sl-confirm-cancel").addEventListener("click",()=>{this.ghostActivation()||this.cancel()}),this.armOutsideTap(S),requestAnimationFrame(()=>{let A=S.querySelector(".sl-confirm-add");A?.focus(),n.liftToastOverConfirm(),n.fitTranslatedRows(),n.inviteCommit(S,A)})}liftSeatClearOfSheet(e){let t=this.host.controller.getRenderer();this.framing={gestures:t?.getCameraGestureCount?.()??0,quietUntil:0},this.frameSeatForSheet(e)}frameSeatForSheet(e){let t=this.host,n=t.root();if(!this.el||n?.dataset.layout!=="narrow"||n?.dataset.view3d==="on")return;let o=t.els().map;if(!o)return;let s=t.controller.worldToScreen({x:e.x,y:e.y}),r=t.controller.getRenderer(),a=r?.getCameraGestureCount?.()??0,{nudgeY:l}=Nr(s.y,{height:o.clientHeight},{height:this.el.offsetHeight||230}),c=this.lift&&this.lift.gestures===a?this.lift.dy:0;if(!l){this.lift=c?{dy:c,gestures:a}:null;return}let h=!t.reducedMotion();r?.panScreenBy?.({x:0,y:l},{animate:h}),this.lift={dy:c+l,gestures:a},this.framing&&(this.framing.gestures=a,this.framing.quietUntil=h?this.now()+Bd:0)}reframeSeatForSheet(){let e=this.framing,t=this.seat;!e||!t||e.quietUntil&&this.now()<e.quietUntil||(this.host.controller.getRenderer()?.getCameraGestureCount?.()??e.gestures)!==e.gestures||this.frameSeatForSheet(t)}now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}settleLift(){let e=this.lift;if(this.lift=null,this.framing=null,!e)return;let t=this.host.controller.getRenderer();(t?.getCameraGestureCount?.()??e.gestures)===e.gestures&&t?.panScreenBy?.({x:0,y:-e.dy},{animate:!this.host.reducedMotion()})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),n=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=Fr(this.scrim,n,this.el,t),ws(this.el,t,n),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=to(this.scrim);let o=n.clientWidth,s=n.clientHeight,r=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=e.controller.seatScreenRadius()*1.5,h=Dr(t,{width:o,height:s},{width:r,height:a},l,c);this.el.dataset.placement=h.placement,this.el.style.left=`${h.left}px`,this.el.style.top=`${h.top}px`,Di(this.el,t,{left:h.left,top:h.top,width:r,height:a})}ghostActivation(){return zr()?performance.now()-this.shownAt<Vr:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,n=s=>{if(this.el!==e){this.disarmOutsideTap();return}let r=s.target;!r||e.contains(r)||t.els().tray?.contains(r)||this.cancel()};this.outsideTap=n;let o=t.root();setTimeout(()=>{this.outsideTap===n&&(o??document).addEventListener("pointerdown",n,!0)},zr()?Vr:0)}disarmOutsideTap(){if(!this.outsideTap)return;let e=this.outsideTap;this.outsideTap=null,(this.host.root()??document).removeEventListener("pointerdown",e,!0),document.removeEventListener("pointerdown",e,!0)}dismiss(){let e=this.host;this.disarmOutsideTap(),this.scrim=to(this.scrim),this.settleLift(),this.el&&Bi(this.el),this.el=null,this.seat=null,e.liftToastOverConfirm(),e.root()?.removeAttribute("data-confirming"),Object.values(e.regions()).forEach(t=>t.toggleAttribute("inert",!1)),e.applyPanelCollapsed(),e.controller.setSelectionFocus(null)}async commit(){let e=this.host,t=this.seat;if(!t)return;let o=this.el?.querySelector(".sl-confirm-add")??null;if(o?.classList.contains("is-adding")||!await Er(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let s=()=>{let l=e.root()?.dataset.layout==="narrow"?this.lift:null;l&&(this.lift=null),e.dismiss();let c=e.controller.worldToScreen(t);Gn(e.els(),c,t,e.controller.doc?.categories,()=>{e.cartLanded?.(),l&&(this.lift=l,this.settleLift())})};if(!o||e.reducedMotion()){s();return}o.classList.remove("sl-confirm-add-invite"),o.classList.add("is-adding"),o.setAttribute("aria-disabled","true");let r=o.querySelector(".sl-confirm-add-t");r&&(r.textContent=e.tf("picker.added","Added")),e.scheduleMotion(s,Nd)}cancel(){let e=this.host,t=this.seat;t&&(this.mode!=="remove"&&e.controller.deselect([t.id]),this.seat&&e.dismiss(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}removeCommitted(){let e=this.host,t=this.seat;t&&(e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}};function jr(i,e,t){if(!e||t||i.classList.contains("sl-confirm-removing"))return;e.classList.add("sl-confirm-add-invite");let n=()=>e.classList.remove("sl-confirm-add-invite");i.addEventListener("pointerdown",n,{once:!0}),i.addEventListener("keydown",n,{once:!0}),e.addEventListener("focus",n,{once:!0})}function Gr(i,e){return i&&i!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}var Ur=require("@seatlayer/core"),_t=require("@seatlayer/core/picker/minimapGeometry");function Vd(i){let e={inactive:0,available:1,selected:2},t=new Map;for(let o of i){let s=t.get(o.id);(!s||e[o.state]>e[s])&&t.set(o.id,o.state)}let n={selected:0,available:0,inactive:0};for(let o of t.values())n[o]+=1;return n}function zd(i,e){return i.x<=e.x&&i.y<=e.y&&i.x+i.width>=e.x+e.width&&i.y+i.height>=e.y+e.height}function qr(i,e){let t=new io(i);return t.build(e),t}var io=class{constructor(e){this.host=e;this.miniCanvas=null;this.miniBase=null;this.miniWrap=null;this.miniToggle=null;this.miniLabel=null;this.miniTf=null;this.miniDrag=null;this.miniSuppressClick=!1;this.userClosed=!1}dispose(){this.miniToggle?.remove(),this.miniWrap?.remove(),this.miniToggle=null,this.miniWrap=null,this.miniCanvas=null,this.miniBase=null,this.miniLabel=null,this.miniTf=null,this.miniDrag=null,this.host.root()?.removeAttribute("data-minimap-open")}build(e){if(!this.host.controller.getViewport())return;let n=document.createElement("button");n.type="button",n.className="sl-minimap-toggle",n.setAttribute("aria-label",b("picker.openVenueMap","Open venue overview map")),n.setAttribute("aria-expanded","false"),n.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(n),this.miniToggle=n;let o=document.createElement("div");o.className="sl-minimap",o.setAttribute("role","group");let s=document.createElement("div");s.className="sl-minimap-bar";let r=document.createElement("span");r.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",b("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",b("picker.closeVenueMap","Close venue overview map")),l.textContent="\xD7",s.append(r,a,l);let c=document.createElement("canvas");c.tabIndex=0,c.setAttribute("role","application"),c.setAttribute("aria-label",b("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),o.append(s,c),e.appendChild(o),this.miniWrap=o,this.miniLabel=r,this.miniCanvas=c;let h=document.createElement("canvas");this.miniBase=h,n.addEventListener("click",()=>{let d=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=d,this.setMinimapOpen(!d)}),l.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),c.addEventListener("click",d=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(d)}),c.addEventListener("pointerdown",d=>this.minimapPointerDown(d)),c.addEventListener("pointermove",d=>this.minimapPointerMove(d)),c.addEventListener("pointerup",d=>this.minimapPointerUp(d)),c.addEventListener("pointercancel",d=>this.minimapPointerUp(d)),c.addEventListener("keydown",d=>this.minimapKeydown(d)),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,n=this.host.controller.getViewport()?.bounds;if(!e||!t||!n||!(n.width>0&&n.height>0))return;let o=196,s=146,r=6,a=n.width/Math.max(1,n.height),l=o,c=Math.round(o/a);c>s&&(c=s,l=Math.round(s*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,_t.createMinimapTransform)(n,e.width,e.height,h,r)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),t=this.host.controller.isFloorOverview()?b("picker.allFloors","All floors"):e.find(h=>h.id===this.host.controller.getActiveFloorId())?.name??b("picker.venueOverview","Venue overview"),n=this.host.controller.getMinimapSnapshot().sections,s=n.find(h=>h.active)?.label??this.host.focusedSectionLabel(),r=s?`${t} \xB7 ${s}`:t;this.miniLabel.textContent=r;let{selected:a,available:l,inactive:c}=Vd(n);this.miniWrap.setAttribute("aria-label",n.length?`${r}. ${a} selected, ${l} available, ${c} inactive sections.`:r),this.miniCanvas?.setAttribute("aria-label",n.length?`${r}. ${a} selected, ${l} available, ${c} inactive sections. ${b("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${r}. ${b("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 n=e.getContext("2d");if(!n)return;n.clearRect(0,0,e.width,e.height);let o=d=>d*t.scale+t.offX,s=d=>d*t.scale+t.offY,r=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 d of h.sections){if(d.outline.length<3)continue;n.beginPath(),d.outline.forEach((p,g)=>g===0?n.moveTo(o(p.x),s(p.y)):n.lineTo(o(p.x),s(p.y))),n.closePath();let u=d.paint;if(n.globalAlpha=d.state==="inactive"?.5:.92,u?n.fillStyle=u.fill:(n.globalAlpha=d.state==="inactive"?.18:d.state==="selected"?.72:.34,n.fillStyle=d.state==="inactive"?a:d.state==="selected"?l:c),n.fill(),n.globalAlpha=.82,n.lineWidth=Math.max(1,t.dpr),n.strokeStyle=u?.stroke||r,n.stroke(),d.owned){n.globalAlpha=1,n.lineWidth=Math.max(2,t.dpr*1.5),n.strokeStyle=l,n.stroke();let p=d.outline.reduce((g,y)=>({x:g.x+y.x,y:g.y+y.y}),{x:0,y:0});n.beginPath(),n.arc(o(p.x/d.outline.length),s(p.y/d.outline.length),Math.max(1.5,t.dpr*1.6),0,Math.PI*2),n.fillStyle=l,n.fill(),n.beginPath(),d.outline.forEach((g,y)=>y===0?n.moveTo(o(g.x),s(g.y)):n.lineTo(o(g.x),s(g.y))),n.closePath()}d.active&&(n.globalAlpha=1,n.lineJoin="round",n.lineWidth=Math.max(4,t.dpr*3.5),n.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",n.stroke(),n.lineWidth=Math.max(2,t.dpr*1.75),n.strokeStyle=l,n.stroke())}if(n.globalAlpha=1,!h.sections.length){let d=Math.max(1,t.dpr),u=this.host.controller.getRenderer?.(),p=new Map,g=y=>{let T=p.get(y);if(T)return T;let S=u?.categoryDisplayColor?.(y)||c;return p.set(y,S),S};for(let y of h.seats)n.globalAlpha=y.state==="inactive"?.22:.78,n.fillStyle=y.state==="inactive"?a:y.state==="selected"?l:g(y.categoryKey),n.beginPath(),n.arc(o(y.x),s(y.y),d,0,Math.PI*2),n.fill();n.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,t=this.miniBase,n=this.miniTf;if(!e||!t||!n)return;let o=e.getContext("2d");if(!o)return;o.clearRect(0,0,e.width,e.height),o.drawImage(t,0,0);let s=this.host.controller.getViewport();if(!s||zd(s.visible,s.bounds))return;let r=(0,_t.minimapViewportPlan)(s.visible,n,e.width,e.height,Math.max(2,n.dpr*2)),a=this.host.cssVar("--sl-text")||"#12151c",l=this.host.cssVar("--sl-surface")||"#fff";o.save(),o.globalAlpha=.1,o.fillStyle=a,o.fillRect(r.raw.x,r.raw.y,r.raw.width,r.raw.height),o.globalAlpha=.9,o.lineJoin="round",o.lineWidth=Math.max(4,n.dpr*3.25),o.strokeStyle=l,o.strokeRect(r.raw.x,r.raw.y,r.raw.width,r.raw.height),o.globalAlpha=1,o.lineWidth=Math.max(2,n.dpr*1.75),o.strokeStyle=a,o.strokeRect(r.raw.x,r.raw.y,r.raw.width,r.raw.height),r.clipped&&Object.values(r.clippedEdges).some(Boolean)&&(o.setLineDash([Math.max(3,n.dpr*3),Math.max(2,n.dpr*2)]),o.strokeRect(r.clipped.x,r.clipped.y,r.clipped.width,r.clipped.height)),o.restore()}minimapWorldPoint(e){let t=this.miniCanvas,n=this.miniTf;if(!t||!n)return null;let o=t.getBoundingClientRect(),s=(e.clientX-o.left)*(t.width/Math.max(1,o.width)),r=(e.clientY-o.top)*(t.height/Math.max(1,o.height));return{...(0,_t.minimapPointToWorld)({x:s,y:r},n),px:s,py:r}}minimapPointerDown(e){let t=this.minimapWorldPoint(e),n=this.host.controller.getViewport()?.visible;!t||!n||!(t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:t.x-(n.x+n.width/2),offsetY:t.y-(n.y+n.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 n=this.minimapWorldPoint(e);n&&(!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:n.x-t.offsetX,y:n.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 n=e.key==="ArrowLeft"?-t.width*.2:e.key==="ArrowRight"?t.width*.2:0,o=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!n&&!o||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+n,y:t.y+t.height/2+o}),e.preventDefault())}minimapJump(e){let t=this.minimapWorldPoint(e);if(t){for(let n of this.host.controller.getMinimapSnapshot().sections)if(!(n.state==="inactive"||n.outline.length<3)&&(0,Ur.pointInPolygon)(t,n.outline)){this.host.controller.focusSection(n.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var dn=require("@seatlayer/core");var $d=12;function Kr(i,e){let t=e.floors(),n=new Set(t.map(f=>f.label.trim().toLocaleLowerCase())),o=e.zones().filter(f=>f.seatCount>0&&!n.has(f.label.trim().toLocaleLowerCase())),s=e.sections().filter(f=>f.seatCount>0&&!n.has(f.label.trim().toLocaleLowerCase())),r=o.length>1?[]:s,a=t.length>1,l=o.length>1,c=r.length>1;if(!a&&!l&&!c)return null;let h=document.createElement("div");h.className="sl-view3d-nav";let d=null,u=document.createElement("button");u.type="button",u.className="sl-view3d-nav-toggle",u.setAttribute("aria-expanded","false");let p='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M15.5 8.5l-2 5-5 2 2-5z"/></svg>',g=document.createElement("span");u.innerHTML=p,u.appendChild(g);let y=()=>{for(let f of h.querySelectorAll(":scope > div")){let L=f.querySelector('[aria-pressed="true"]');!L||f.scrollWidth<=f.clientWidth||L.scrollIntoView({block:"nearest",inline:"nearest"})}},T=()=>{if(d)return d;for(let f of h.querySelectorAll(":scope > div")){let L=f.querySelector('button[aria-pressed="true"]'),A=L?.textContent?.trim();if(A&&L?.dataset.floor!=="")return A}return a&&(l||c)?b("picker.levelsAndAreas","Levels & areas"):a?b("picker.levels","Levels"):b("picker.areas","Areas")},S=f=>{h.classList.toggle("is-open",f),u.setAttribute("aria-expanded",String(f)),f&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(y),g.textContent=T()};u.addEventListener("click",()=>S(!h.classList.contains("is-open"))),h.addEventListener("keydown",f=>{f.key!=="Escape"||!h.classList.contains("is-open")||(f.preventDefault(),f.stopPropagation(),S(!1),u.focus())});let v=document.createElement("button");v.type="button",v.className="sl-view3d-nav-close",v.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let P=b("picker.closeVenueNavigation","Close venue navigation");v.setAttribute("aria-label",P),v.title=P,v.addEventListener("click",()=>{S(!1),u.focus()}),S(!1),h.appendChild(u);let B=f=>{},U=f=>{};if(a){let f=document.createElement("div");f.setAttribute("role","group"),f.setAttribute("aria-label",b("picker.levels","Levels"));let L=[];U=I=>{L.forEach(_=>{_.setAttribute("aria-pressed",String((_.dataset.floor===""?null:Number(_.dataset.floor))===I))})};let A=I=>{e.focusFloor(I)&&(U(I),B(I))},E=(I,_)=>{let N=document.createElement("button");N.type="button",N.textContent=I,N.dataset.floor=_===null?"":String(_),N.setAttribute("aria-pressed",String(_===null)),N.addEventListener("click",()=>{A(_),S(!1)}),L.push(N),f.appendChild(N)};E(b("picker.allLevels","All levels"),null);for(let I of t)E(I.label||(0,dn.t)("picker.levelNumber",{number:I.index+1}),I.index);h.appendChild(f)}if(l||c){let f=document.createElement("div");f.setAttribute("role","group"),f.setAttribute("aria-label",b("picker.areas","Areas"));let L=l?o.map(E=>({id:E.id,label:E.label||E.id,go:()=>{e.focusZone(E.id)}})):r.map(E=>({id:E.id,label:E.label||E.id,floorIndex:E.floorIndex,go:()=>{e.focusSection(E.id),Number.isFinite(E.floorIndex)&&U(E.floorIndex)}})),A=E=>{let I=l||E===null?L:L.filter(_=>_.floorIndex===void 0||_.floorIndex===E);if(f.replaceChildren(),!I.length){f.remove();return}if(f.isConnected||h.insertBefore(f,v.isConnected?v:null),!l&&I.length>$d){let _=document.createElement("select");_.setAttribute("aria-label",b("picker.jumpToSection","Jump to section"));let N=document.createElement("option");N.value="",N.textContent=b("picker.jumpToSection","Jump to section"),_.appendChild(N);for(let W of I){let te=document.createElement("option");te.value=W.id,te.textContent=W.label,_.appendChild(te)}_.addEventListener("change",()=>{I.find(W=>W.id===_.value)?.go()}),f.appendChild(_);return}for(let _ of I){let N=document.createElement("button");N.type="button",N.textContent=_.label,N.dataset.area=_.id,N.addEventListener("click",()=>{d=_.label,_.go(),S(!1)}),f.appendChild(N)}};B=A,A(null)}return h.appendChild(v),i.appendChild(h),h}var pn=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",b("picker.savedSeatComparison","Saved seat comparison"));let s=document.createElement("button");s.type="button",s.className="main",s.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(b("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let r=document.createElement("button");r.type="button",r.className="clear",r.textContent="\xD7",r.setAttribute("aria-label",b("picker.clearSavedSeatComparison","Clear saved seat comparison")),r.addEventListener("click",()=>this.host.clearComparison()),t.append(s,r),e.appendChild(t),this.chip=t}let n=this.host.savedSeatIds().length,o=t.querySelector(".main");o&&(o.textContent=n>1?(0,dn.t)("picker.compareCount",{count:n}):b("picker.oneSeatSaved","1 seat saved"),o.setAttribute("aria-label",n>1?(0,dn.t)("picker.openComparisonOfSeats",{count:n}):b("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function Wr(i){return!i?.querySelector('[data-ref="zfs"]')}var Yr="sl:sheet-hint";function Xr(i){let e=i.boot;if(!e?.isConnected)return;if(i.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),i.map?.appendChild(t),setTimeout(()=>t.remove(),650),i.rail?.classList.add("is-in"),i.root?.classList.add("is-arriving"),setTimeout(()=>{i.rail?.classList.remove("is-in"),i.root?.classList.remove("is-arriving"),jd(i.root)},900)}function jd(i){if(!i||i.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(Yr))return;window.sessionStorage.setItem(Yr,"1")}catch{}let e=i.querySelector(".sl-sheet-toggle");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function Zr(i,e){i.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let n of e())if(n.open()){t.preventDefault(),t.stopPropagation(),n.close();return}}})}function hn(i){let e=i.committedSelection(),t=i.controller.getGAAreas(),n=i.hold?.items??[],o=new Set(n.map(u=>u.label)),s=As(i,t,n),r=ze(i.gaQty,n),a=n.reduce((u,p)=>u+i.paidPrice(p.categoryKey,p.tierId,p.unitPrice,p.label)*(p.quantity??1),0),l=n.reduce((u,p)=>u+(p.quantity??1),0),c=e.filter(u=>!o.has(u.label)),h=c.reduce((u,p)=>u+i.paidPrice(p.categoryKey,p.tierId??null,p.price,p.label)*(p.quantity??1),0)+s+a,d=c.reduce((u,p)=>u+(p.quantity??1),0)+r+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:n,heldLabels:o,heldCount:l,total:h,count:d}}function un(i,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:i.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function mn(i,e){let t=e.tiers?.length?e.tiers.map(n=>i.paidPrice(e.key,n.id??null,n.price)):e.price==null?[]:[i.paidPrice(e.key,null,e.price)];if(e.key)for(let n of i.pricesByChannel.values())for(let o of n)o.categoryKey===e.key&&t.push(o.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var ri="seatlayer_";function Gd(){let i=globalThis;return i.document?.modelContext??i.navigator?.modelContext??null}function be(i,e){return e?{ok:!1,reason:i,message:e}:{ok:!1,reason:i}}function Ud(i){return Array.isArray(i)?i.filter(e=>typeof e=="string"&&!!e):[]}function qd(i,e){let t=i.event();if(!t)return be("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits();return{ok:!0,event:t,selection:{max:n.max,...n.required!=null?{required:n.required}:{}},categories:i.categories(),zones:i.zones(),hasPremiumSeats:i.hasPremiumSeats(),holdsAllowed:e}}function Qr(i,e){let t=o=>!!o&&o.toLowerCase()===e.toLowerCase(),n=i.find(o=>t(o.key??o.id))??i.find(o=>t(o.label));return n?.key??n?.id??null}function Jr(i,e){let t=e.map(n=>i.describeSeat(n.id));return{seatIds:e.map(n=>n.id),labels:e.map(n=>n.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((n,o)=>t[o]?.seat||n.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((n,o)=>n+o.price,0)}}function Kd(i,e,t){let n=new Map;for(let s of e){let r=n.get(s.rowKey);r?r.push(s):n.set(s.rowKey,[s])}let o=[];for(let s of n.values()){let r=[...s].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=r.length;l++)if(l===r.length||r[l].index!==r[l-1].index+1||r[l].categoryKey!==r[l-1].categoryKey){for(let h=a;h+t<=l;h+=t)o.push(Jr(i,r.slice(h,h+t)));a=l}}return o}function Wd(i,e,t){let n=new Map;for(let s of e){let r=n.get(s.sectionKey);r?r.push(s):n.set(s.sectionKey,[s])}let o=[];for(let s of n.values()){if(s.length<t)continue;let r=[...s].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);o.push(Jr(i,r.slice(0,t)))}return o}function Yd(i,e){if(!i.event())return be("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits(),o=Math.floor(Number(e.count));if(!Number.isInteger(o)||o<1||o>n.max)return be("bad_count",`count must be a whole number between 1 and ${n.max}.`);let s=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,r=e.together===void 0?!0:!!e.together,a=typeof e.max_price=="number"&&Number.isFinite(e.max_price)?e.max_price:null,l=typeof e.category=="string"&&e.category?e.category:null,c=typeof e.zone=="string"&&e.zone?e.zone:null,h=l?Qr(i.categories(),l):null;if(l&&!h)return be("no_match",`No ticket type called "${l}".`);let d=c?Qr(i.zones(),c):null;if(c&&!d)return be("no_match",`No zone called "${c}".`);let u=i.seats().filter(y=>y.available);if(!u.length)return be("sold_out");let p=u.filter(y=>(!h||y.categoryKey===h)&&(!d||y.zoneId===d)&&(a==null||y.price<=a));if(!p.length)return be("no_match");let g=r?Kd(i,p,o):Wd(i,p,o);return g.length?(g.sort((y,T)=>T.unitPrice!==y.unitPrice?T.unitPrice-y.unitPrice:y.row.localeCompare(T.row)||y.labels[0].localeCompare(T.labels[0])),{ok:!0,groups:g.slice(0,s),searched:{count:o,filters:{...a!=null?{max_price:a}:{},...h?{category:h}:{},...d?{zone:d}:{},together:r}}}):be(r?"not_enough_together":"no_match")}function ea(i){return{ok:!0,...i.selection()}}function Xd(i,e){let t=i.event();if(!t)return be("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return be("event_closed","Sales are closed for this event.");let n=Ud(e.seat_ids);return n.length?(i.clearSelection(),i.selectObjects(n),ea(i)):be("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function Zd(i,e){let t=async o=>{try{return await o()}catch(s){return be("error",s instanceof Error?s.message:String(s))}},n=[{name:`${ri}describe_event`,title:"Describe this seated event",description:"Read the event, its ticket types with live availability and prices, its zones, and how many seats this buyer may select. Call this first.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>qd(i,e))},{name:`${ri}find_seats`,title:"Find available seats",description:"Search the seat map for groups of available seats. Read-only: it never selects, holds or reserves anything. Returns candidate groups with their seat ids, prices and location.",inputSchema:{type:"object",properties:{count:{type:"integer",minimum:1,description:"How many seats are needed."},max_price:{type:"number",description:"Highest acceptable price per seat."},category:{type:"string",description:"Ticket type key or label to restrict the search to."},zone:{type:"string",description:"Zone id or label to restrict the search to."},together:{type:"boolean",description:"Require the seats to be side by side in one row (default true)."},limit:{type:"integer",minimum:1,maximum:20,description:"How many candidate groups to return (default 5)."}},required:["count"],additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:o=>t(()=>Yd(i,o))},{name:`${ri}select_seats`,title:"Select seats on the map",description:"Replace the current selection with the given seats, exactly as tapping them would. The buyer sees the seats light up and the basket update. No reservation is made.",inputSchema:{type:"object",properties:{seat_ids:{type:"array",items:{type:"string"},description:"Seat ids or labels, e.g. from find_seats."}},required:["seat_ids"],additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:o=>t(()=>Xd(i,o))},{name:`${ri}get_selection`,title:"Read the current selection",description:"Read the seats currently selected in the basket, their total, any open reservation, and whether the selection satisfies this event\u2019s rules.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>ea(i))}];return e&&n.push({name:`${ri}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>i.hold())}),n}async function ta(i,e={}){let t=Gd();if(!t||typeof t.registerTool!="function")return null;let n=new AbortController,o=Zd(i,!!e.holds),s=[],r=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of o)await t.registerTool(a,{signal:n.signal,...r?{exposedTo:r}:{}}),s.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return s.length?{names:s,dispose:()=>{if(n.abort(),typeof t.unregisterTool=="function")for(let a of s)try{t.unregisterTool(a)}catch{}}}:null}async function ia(i){let e=i.opts.webMcp;if(!e||i.destroyed)return;let t=typeof e=="object"&&!!e.holds,n=typeof e=="object"?e.exposedTo:void 0;try{i.webMcp=await ta(oo(i,t),{holds:t,exposedTo:n}),i.destroyed&&no(i)}catch(o){console.warn("seatmap: WebMCP registration failed",o)}}function no(i){i.webMcp?.dispose(),i.webMcp=null}function oo(i,e){let t=(n,o)=>{if(Number.isInteger(n.logicalSeatIndex))return n.logicalSeatIndex;let s=n.id.lastIndexOf(":"),r=s<0?NaN:Number(n.id.slice(s+1));return Number.isFinite(r)?r:o};return{event:()=>{let n=i.renderInfo;return n?{name:n.eventName??"",venue:n.venue??null,startsAt:n.startsAt??null,timezone:n.timezone??null,currency:i.currency,salesClosed:i.salesClosed}:null},selectionLimits:()=>({max:i.maxTickets,required:i.exactTickets}),categories:()=>{let n=i.controller.categoryAvailability();return(i.controller.doc?.categories??[]).filter(o=>!o.notForSale).map(o=>{let s=mn(i,o),r=un(i,o);return{key:o.key,label:o.label??o.key,...r===void 0?{}:{price:r},...s&&s.min!==s.max?{priceRange:s}:{},available:n[o.key]??0}})},zones:()=>i.controller.getBestAvailableZones(),hasPremiumSeats:()=>i.controller.hasPremiumSeats(),seats:()=>{let n=i.controller.getActiveFloorId(),o=[];return i.allSeats().forEach((s,r)=>{if(s.floorId&&n&&s.floorId!==n)return;let a=i.controller.getStatus(s.id)??"free",l=i.controller.doc?.categories.find(h=>h.key===s.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;o.push({id:s.id,label:s.label,rowKey:s.logicalRowId??s.rowId,sectionKey:s.sectionId??s.rowId,index:t(s,r),categoryKey:s.categoryKey,price:i.paidPrice(s.categoryKey,l?.tiers?.[0]?.id??null,c,s.label),...s.zoneId?{zoneId:s.zoneId}:{},available:a==="free"&&!l?.notForSale})}),o},describeSeat:n=>{let o=i.controller.seatDetails(n);return o?{section:o.sectionLabel??"",row:Z(o)??"",seat:o.seatNumber??o.label,category:o.categoryLabel??o.categoryKey}:null},selection:()=>{let{freshSeats:n,total:o,count:s}=hn(i);return{seats:n.map(r=>({id:r.id,label:r.label,section:r.sectionLabel??"",row:Z(r)??"",seat:r.seatNumber??r.label,category:r.categoryKey,price:i.paidPrice(r.categoryKey,r.tierId??null,r.price,r.label)})),count:s,total:o,currency:i.currency,hold:i.hold?{id:i.hold.holdId,expiresAt:i.hold.expiresAt}:null,validity:i.getSelectionValidity()}},clearSelection:()=>i.clearSelection(),selectObjects:n=>{i.selectObjects(n)},hold:()=>e?Qd(i):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function Qd(i){if(i.salesClosed)return{ok:!1,reason:"event_closed"};if(!i.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=i.controller.getSelectionValidity(i.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await i.handleCta(),i.hold?{ok:!0,hold:{id:i.hold.holdId,expiresAt:i.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function so(i){return{renderingTimeMillis:i.ms,performanceProfile:i.performanceProfile,seatCount:i.seatCount,objectCount:i.objectCount,sectionCount:i.sectionCount,view:i.view,eventKey:i.eventKey,chartName:i.chartName,floorCount:i.floorCount,transport:i.transport,load:i.load,metricScope:i.metricScope,operationalTelemetryReporter:"sdk"}}function na(i,e){Ie({apiBase:i.apiBase,event:i.eventKey,scope:i.metricScope,surface:i.surface,outcome:"success",ms:i.ms,performanceProfile:i.performanceProfile,chartDelivery:i.chartDelivery,seats:i.seatCount,floors:i.floorCount,view:i.view,load:i.load,transport:i.transport}),e("chart_rendered",so(i))}var oa=require("@seatlayer/core/core/seatConfidence");function re(i){return String(i??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function sa(i){let e=(0,oa.seatConfidenceDisclosure)(i.seat.confidenceEvidence),t=i.seat.confidenceEvidence,n=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${re(c)}</li>`).join("")}</ul>`:"",o=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${re(e.modeledTarget)}</dd></div>`:"",s=t?`<div><dt>Evidence ID</dt><dd>${re(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${re(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${re(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${re(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${re(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",r=Ai(i.seat.commercial).join(" \xB7 ")||i.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${re(r)}</dd></div>`+(i.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${re(i.seat.commercial.note)}</dd></div>`:""),l=i.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${re(i.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${re(e.headline)}</strong><span>${re(e.coverage)} \xB7 ${re(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${re(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${re(e.reality)}</dd></div><div><dt>Source</dt><dd>${re(e.provenance)}</dd></div>`+a+o+s+`</dl>${n}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function ra(i){return i?i.closest("[data-report]")?"report":i.closest("[data-close]")||i.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function fn(i,e,t){let n=i?.querySelector("[data-report]"),o=i?.querySelector("[data-report-status]");n&&(n.disabled=e!=="failed",n.textContent=e==="received"?"Report received":"Report this view"),o&&(o.setAttribute("role",e==="failed"?"alert":"status"),o.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function ro(i,e,t=null){let n=i.view3dEl;if(!n)return;ai(i,!1);let o=e.confidenceEvidence,s=i.controller.seatDetails(e.id),r=document.createElement("div");r.className="sl-view3d-passport-shell",r.innerHTML=sa({seat:e,title:s?.displayLabel??e.displayLabel??e.label,restrictionFallback:i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof i.api.reportViewEvidence=="function"});let a=[...new Set([...n.children,...[...i.els.map.children].filter(u=>u!==n)])].filter(u=>u instanceof HTMLElement),l=a.map(u=>({element:u,inert:u.inert,ariaHidden:u.getAttribute("aria-hidden")}));for(let u of a)u.inert=!0,u.setAttribute("aria-hidden","true");n.appendChild(r),n.classList.add("has-passport"),i.view3dPassportEl=r;let c=r.querySelector(".sl-view3d-passport"),h=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],d=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),ai(i);return}if(u.key!=="Tab")return;let p=h();if(!p.length)return;let g=p[0],y=p[p.length-1];u.shiftKey&&document.activeElement===g?(u.preventDefault(),y.focus()):!u.shiftKey&&document.activeElement===y&&(u.preventDefault(),g.focus())};window.addEventListener("keydown",d,!0),i.view3dPassportCleanup=()=>{window.removeEventListener("keydown",d,!0);for(let y of l)y.element.inert=y.inert,y.ariaHidden===null?y.element.removeAttribute("aria-hidden"):y.element.setAttribute("aria-hidden",y.ariaHidden);let u=t?.isConnected?t:i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareEl?.querySelector("[data-passport-seat]")??null,p=u?.closest(".sl-confirm,.sl-view3d-compare");p?.isConnected&&(p.inert=!1,p.removeAttribute("aria-hidden")),r.remove(),n.classList.remove("has-passport"),i.view3dPassportEl===r&&(i.view3dPassportEl=null);let g=u??i.view3dCompareEl?.querySelector("[data-passport-seat]")??i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareChip.mainButton();(t?.isConnected?t:g)?.focus()},r.addEventListener("click",u=>{let p=ra(u.target instanceof HTMLElement?u.target:null);p==="close"&&ai(i),p==="report"&&Jd(i,e)}),requestAnimationFrame(()=>h()[0]?.focus()),i.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:o?.evidenceId??null,eventConfigurationId:o?.eventConfigurationId??null,modelLevel:o?.modelLevel??"unverified",realityLevel:o?.realityLevel??"none"})}async function Jd(i,e){if(i.api.reportViewEvidence){fn(i.view3dPassportEl,"sending");try{let t=await i.api.reportViewEvidence(i.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});i.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),fn(i.view3dPassportEl,"received",t.report.id)}catch{fn(i.view3dPassportEl,"failed")}}}function ai(i,e=!0){let t=i.view3dPassportCleanup;if(i.view3dPassportCleanup=null,!t){i.view3dPassportEl?.remove(),i.view3dPassportEl=null,i.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function aa(i){let e=i.view3dEl;if(!e||i.view3dCompareSeatIds.length<2)return;rt(i,!1);let t=i.view3dCompareSeatIds.map(p=>i.view3dComparisonSnapshot(p)).filter(p=>!!p);if(t.length<2){i.clearView3dComparison();return}let n=p=>C(p),o=t.some(p=>!!p.price),s=document.createElement("div");s.className="sl-view3d-compare-shell";let r=t.map((p,g)=>`<article><span>Seat ${g===0?"A":"B"}</span><strong>${n(p.label)}</strong><small>Section ${n(p.section)} \xB7 Row ${n(p.row)}</small><dl>`+(o?`<div><dt>Current price</dt><dd>${n(p.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${n(p.category)}</dd></div><div><dt>Availability</dt><dd>${n(p.availability)}</dd></div><div><dt>View source</dt><dd>${n(p.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${n(p.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${n(p.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${n(p.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${n(p.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${n(p.seat.id)}">Passport</button><button type="button" data-view-seat="${n(p.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${n(p.seat.id)}"${p.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">${o?"Current price and availability":"Availability"} comes from this picker. Modeled views are chart-derived unless organizer media is labeled.</p><div class="sl-view3d-compare-grid">${r}</div></section>`;let a=document.activeElement instanceof HTMLElement?document.activeElement:null,l=[...e.children].filter(p=>p instanceof HTMLElement),c=l.map(p=>({element:p,inert:p.inert,ariaHidden:p.getAttribute("aria-hidden")}));for(let p of l)p.inert=!0,p.setAttribute("aria-hidden","true");e.appendChild(s),e.classList.add("has-comparison"),i.view3dCompareEl=s;let h=s.querySelector(".sl-view3d-compare"),d=()=>[...h.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],u=p=>{if(p.key==="Escape"){p.preventDefault(),rt(i);return}if(p.key!=="Tab")return;let g=d();if(!g.length)return;let y=g[0],T=g[g.length-1];p.shiftKey&&document.activeElement===y?(p.preventDefault(),T.focus()):!p.shiftKey&&document.activeElement===T&&(p.preventDefault(),y.focus())};window.addEventListener("keydown",u),i.view3dCompareCleanup=()=>{window.removeEventListener("keydown",u);for(let p of c)p.element.inert=p.inert,p.ariaHidden===null?p.element.removeAttribute("aria-hidden"):p.element.setAttribute("aria-hidden",p.ariaHidden);s.remove(),e.classList.remove("has-comparison"),i.view3dCompareEl===s&&(i.view3dCompareEl=null),a?.isConnected?a.focus():i.view3dCompareChip.mainButton()?.focus()},s.querySelector("[data-close]")?.addEventListener("click",()=>rt(i)),s.querySelectorAll("[data-passport-seat]").forEach(p=>p.addEventListener("click",()=>{let g=p.dataset.passportSeat,y=g?i.allSeats().find(T=>T.id===g):void 0;y&&ro(i,y,p)})),s.querySelectorAll("[data-view-seat]").forEach(p=>p.addEventListener("click",()=>{let g=p.dataset.viewSeat;rt(i,!1),g&&i.view3dHandle?.flyToSeat(g)})),s.querySelectorAll("[data-select-seat]").forEach(p=>p.addEventListener("click",()=>{let g=p.dataset.selectSeat;g&&ep(i,g)})),requestAnimationFrame(()=>d()[0]?.focus()),i.emit3dAnalytics("3d_comparison_opened",{seatIds:i.view3dCompareSeatIds.slice()})}function rt(i,e=!0){let t=i.view3dCompareCleanup;if(i.view3dCompareCleanup=null,!t){i.view3dCompareEl?.remove(),i.view3dCompareEl=null,i.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function ep(i,e){if(i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=i.allSeats().find(o=>o.id===e);if(!t)return;if(rt(i,!1),!i.controller.select([e]).length){i.syncSelectionTo3d(),i.toast(i.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}i.syncSelectionTo3d(),i.showConfirm(t),i.emit3dAnalytics("3d_comparison_selected",{seatId:e})}var da=require("@seatlayer/core/view3d/crossfade/panorama");var ao=require("@seatlayer/core");var tp=900,ip=450;function np(i){switch(i){case"seat":return b("picker.stopYourSeat","Your seat");case"row":return b("picker.stopYourRow","Your row");case"section":return b("picker.stopYourSection","Your section");default:return b("picker.stopWholeVenue","Whole venue")}}function la(i,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let n=b("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",n),t.title=n,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let o=document.createElement("div");o.className="sl-view3d-stop",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),i.append(t,o);let s=null,r=null;return{onStopChange(a){if(s&&(clearTimeout(s),s=null),r&&(clearTimeout(r),r=null),!a){o.classList.remove("is-shown"),o.textContent="",r=setTimeout(()=>{r=null,i.classList.remove("is-seat-view")},ip);return}i.classList.add("is-seat-view"),o.textContent=np(a),o.classList.add("is-shown"),s=setTimeout(()=>{s=null,o.classList.remove("is-shown")},tp)},dispose(){s&&(clearTimeout(s),s=null),r&&(clearTimeout(r),r=null),t.remove(),o.remove(),i.classList.remove("is-seat-view")}}}var op=44,sp=92;function ca(i,e,t,n={}){let o=i?.sectionLabel,s=Z(i),r=rp(i,e),a=[o,s?(0,ao.t)("picker.rowLabel",{label:s}):null,r?(0,ao.t)("picker.seatLabel",{label:r}):null].filter(Boolean).join(" \xB7 "),l=n.maxChars??(n.narrow?op:sp);for(let c of[t,n.shortTail??t,null]){let h=[a,c].filter(Boolean).join(" \xB7 ");if(h.length<=l||c==null)return h}return a}function rp(i,e){if(i?.seatNumber)return i.seatNumber;let t=i?.displayLabel??e,n=o=>{!o||!t.startsWith(o)||t.length<=o.length||(t=t.slice(o.length).replace(/^[\s·\-\/_]+/,""))};return n(i?.sectionLabel),n(Z(i)),t}var pa=require("@seatlayer/core/core/seatConfidence");function ha(i){return i.buyerView}function ua(i,e,t){if(e==="map"){i.exit3d();return}let n=t?.flyToSeatId;if(i.buyerView==="venue3d"){n?(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:n}),i.view3dHandle?.flyToSeat(n)):t?.resetView&&i.view3dHandle?.focusOverview();return}i.enter3d(n)}function ma(i,e){switch(i.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return i.priceBandKeys!=null&&!i.priceBandKeys.has(e.categoryKey)||i.controller.accessibilityFilterDims?.(e)||i.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}function fa(i){if(!i.view3dHandle)return;let e=i.allSeats().map(t=>({seatId:t.id,state:i.seatState3dFor(t)}));i.view3dHandle.setAvailability(e)}function ga(i){i.view3dHandle&&i.view3dHandle.setSelection(i.controller.getSelection().map(e=>e.id))}async function ba(i,e){let t=i.allSeats().find(n=>n.id===e);if(!t)return null;if(t.viewUrl)try{let n=t.viewMeta?.previewUrl,o=!!n&&n!==t.viewUrl,s=o?await i.buyerAssetUrls.resolve(n):null,r=o?t.viewUrl:await i.buyerAssetUrls.resolve(t.viewUrl);return!r||o&&!s?null:{url:r,...s?{previewUrl:s}:{},...o?{resolveUrl:a=>i.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(n){return i.opts.onError?.(n),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:i.tf("picker.chartDerivedModel","Chart-derived model")}}function ya(i,e){if(i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),i.syncSelectionTo3d();return}let t=i.allSeats().find(a=>a.id===e);if(!t)return;let n=i.controller.tableSelection(e);if(i.committedSelection().some(a=>n?a.label===n.label:a.id===e)){i.controller.deselect([e]),i.dismissConfirm(),i.syncSelectionTo3d();return}let s=i.controller.getStatus(t.id);if(s==="held"||s==="booked"||s==="not_for_sale"){i.syncSelectionTo3d();return}if(!i.controller.select([e]).length){i.syncSelectionTo3d(),i.dismissConfirm();return}if(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),i.flashPickedSeat(e),n){i.showTableDialog(n,!1),i.syncSelectionTo3d();return}i.opts.confirmSelection!==!1?i.showConfirm(t):i.syncTray(),i.syncSelectionTo3d()}function va(i,e){let t=i.allSeats().find(n=>n.id===e);return ca(i.controller.seatDetails(e),t?.displayLabel??t?.label??e,i.tf("picker.viewFromYourSeat","view from your seat"),{narrow:i.root?.dataset.layout==="narrow",shortTail:i.tf("picker.fromYourSeat","from your seat")})}function wa(i,e){if(i.buyerView!=="venue3d")return;let t=i.view3dCompareSeatIds;t.includes(e.id)||(i.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),i.confirmSeat?.id===e.id&&(i.controller.deselect([e.id]),i.dismissConfirm(),i.syncSelectionTo3d(),i.syncTray()),i.view3dCompareChip.sync(),i.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:i.view3dCompareSeatIds.length}),i.view3dCompareSeatIds.length>1?i.openView3dComparison():i.toast(i.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}function xa(i){i.closeView3dComparison(!1),i.view3dCompareSeatIds=[],i.view3dCompareChip.remove(),i.emit3dAnalytics("3d_comparison_cleared")}function Sa(i,e){let t=i.allSeats().find(g=>g.id===e);if(!t)return null;let n=i.controller.seatDetails(t.id),o=i.controller.doc?.categories.find(g=>g.key===t.categoryKey),s=n?.price??(o?.tiers?.length?o.tiers[0].price:o?.price),r=s!=null?i.paidPrice(t.categoryKey,n?.tierId??o?.tiers?.[0]?.id??null,s,t.label):void 0,a=i.controller.getStatus(t.id),l=a==="held"?i.tf("picker.temporarilyHeld","Temporarily held"):a==="booked"?i.tf("picker.sold","Sold"):a==="not_for_sale"?i.tf("picker.notForSale","Not for sale"):i.tf("picker.available","Available"),c=t.viewUrl?(0,da.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}:{}}):i.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),h=Ai(t.commercial).join(" \xB7 ")||i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),d=Yo({...t.accessibility?.length?{accessibility:t.accessibility}:{},...n?.wheelchairSpaceType?{wheelchairSpaceType:n.wheelchairSpaceType}:{}}),u=d.length?`${d.join(" \xB7 ")} \xB7 metadata, not access certification`:i.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),p=(0,pa.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:n?.displayLabel??t.displayLabel??t.label,section:n?.sectionLabel??t.sectionId??"\u2014",row:Z(n)??n?.rowLabel??"\u2014",category:n?.categoryLabel??o?.label??t.categoryKey,price:i.suppressPricing||r==null?"":i.money(r),availability:l,selectable:a==null||a==="free",viewSource:c,limited:h,accessibility:u,confidence:p}}async function ka(i,e){if(i.view3dEl||!i.canOffer3d()||!i.els.map)return;let t=i.controller.doc;if(!t)return;i.buyerView="venue3d",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),i.root?.setAttribute("data-view3d","on"),i.dismissConfirm(),i.syncProjection(),i.syncTray();let n=document.createElement("div");n.className="sl-view3d sl-mo-zoom",n.setAttribute("role","group"),n.setAttribute("aria-label",i.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let o=document.createElement("button");o.type="button",o.className="sl-view3d-back",o.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${i.tf("picker.backToMap","Back to map")}</span>`;let s=o.querySelector("span"),r=c=>{i.view3dTargetSeatId=c;let h=!!c;n.classList.toggle("is-seat-focused",h),i.root&&(i.root.dataset.view3dSeat=h?"on":"off");let d=h?i.tf("picker.backToVenue","Back to venue"):i.tf("picker.backToMap","Back to map");s&&(s.textContent=d),o.setAttribute("aria-label",d)};if(o.addEventListener("click",()=>{if(i.view3dTargetSeatId&&i.view3dHandle){i.view3dHandle.focusOverview();return}i.exit3d()}),i.regions["top-left"]?.prepend(o),i.view3dBack=o,i.publish3dTopInset(),Wr(i.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6";let h=i.tf("picker.fullScreen","Full screen");c.setAttribute("aria-label",h),c.title=h,c.setAttribute("aria-pressed",String(!!document.fullscreenElement||i.fsFallback||i.framedFs)),c.addEventListener("click",()=>i.toggleFullscreen()),n.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=i.tf("picker.loading3d","Building the 3D venue\u2026"),n.appendChild(a),i.els.map.appendChild(n),i.view3dEl=n,i.view3dCompareChip.sync(),requestAnimationFrame(()=>{n.style.opacity="1"});let l=++i.view3dGen;try{let c=i.allSeats(),[h,d]=await Promise.all([Xt(),i.controller.loadEventConfiguration()]),u=d?await zi(d,v=>i.buyerAssetUrls.resolve(v)):null,p=t.theme?.venue3d?.shellAssetUrl,g=await $i(p,v=>i.buyerAssetUrls.resolve(v));if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let y={doc:t,seats:c,...u?{eventConfigurationId:u.id,eventConfiguration:u}:{},...g?{registeredShellGlb:g}:{}};a.textContent=i.tf("picker.building3d","Building venue geometry\u2026");let T=await h.prepareVenue3D(y);if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let S=h.mountVenue3D(n,{...y,prepared:T},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:Je(),navLabels:xi(),seatViewActionLabel:v=>i.allSeats().find(P=>P.id===v)?.viewUrl?i.tf("picker.openAuthored360","Open venue 360\xB0"):i.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:v=>i.seatViewCaption(v),onSeatViewStopChange:v=>i.view3dSeatViewChrome?.onStopChange(v),onSeatPick:v=>i.onView3dSeatPick(v),onSeatInspect:v=>i.onView3dSeatPick(v),onSectionFocusChange:v=>{let P=n.querySelector('select[data-locator="section"]'),B=v??"";!P||P.value===B||(P.value=B,P.dispatchEvent(new Event("change")))},onViewTargetChange:v=>{n.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!v),r(v),i.opts.onBuyerViewChange?.({view:"venue3d",...v?{seatId:v}:{}})},...i.seatViewEnabled()?{getSeatView:v=>new Promise((P,B)=>{let U=()=>{i.seatViewFor3d(v).then(L=>{L?P(L):B(new Error("seat_view_unavailable"))})},f=globalThis.requestIdleCallback;typeof f=="function"?f(U,{timeout:1500}):setTimeout(U,50)})}:{},onAnalytics:(v,P)=>i.emit3dAnalytics(v,P)});i.view3dHandle=S,i.view3dSeatViewChrome=la(n,{handle:()=>i.view3dHandle}),requestAnimationFrame(()=>a.remove()),i.pushAvailabilityTo3d(),i.syncSelectionTo3d(),i.view3dNav=Kr(i.regions["bottom-left"]??n,S),e&&S.flyToSeat(e)}catch(c){if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;i.opts.onError?.(c),i.toast(i.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),i.exit3d()}}function Ta(i){let e=i.regions["top-left"];if(!i.root||!e)return;let t=()=>{!i.root||i.root.dataset.view3d!=="on"||i.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}function Ea(i){if(i.buyerView!=="venue3d"&&!i.view3dEl)return;i.view3dGen++,i.buyerView="map",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"map"}),i.root?.removeAttribute("data-view3d"),i.closeSeatConfidencePassport(!1),i.closeView3dComparison(!1),i.view3dCompareChip.remove(),i.view3dSeatViewChrome?.dispose(),i.view3dSeatViewChrome=null,i.view3dBack?.remove(),i.view3dBack=null,i.view3dNav?.remove(),i.view3dNav=null,i.root?.removeAttribute("data-view3d-seat"),i.root?.style.removeProperty("--sl-3d-top-inset");try{i.view3dHandle?.dispose()}catch{}i.view3dHandle=null;let e=i.view3dEl;i.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),i.syncProjection(),i.syncTray();let t=i.view3dReturnSeat;i.view3dReturnSeat=null,t&&i.committedSelection().some(n=>n.id===t.id)&&i.opts.confirmSelection!==!1&&i.showConfirm(t)}var Ia=require("@seatlayer/core");var li=require("@seatlayer/core");function Ca(i){return Array.isArray(i)?i.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function gn(i,e,t=!1){let n=i.violations[0];return n==="numberOfPlacesToSelect"?i.remaining>0?(0,li.t)("picker.selectExactMore",{count:i.remaining}):(0,li.t)("picker.selectExactCount",{count:i.required}):n==="minimumSelectedPlaces"?(0,li.t)("picker.selectMinimumMore",{count:i.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):n==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):(0,li.t)("picker.orphanHint")}var ci=require("@seatlayer/core");function Aa(i){let e=Math.max(0,i),t=Math.floor(e/6e4),n=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${n}`}function Pa(i){let e=i.performanceLabel?`<div class="sl-chip-when">${D(i.performanceLabel)}</div>`:"",t=i.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${D(i.performanceDates.summary)}</span><span class="sl-chip-date-list">${i.performanceDates.labels.map(n=>`<span class="sl-chip-date">${D(n)}</span>`).join("")}</span></div>`:"";return e+lp(i)+t}function lp(i){let{d:e,area:t,label:n,objectType:o,quantity:s=1,identity:r}=i,a=P=>String(P??"\u2014").replace(/[&<>"]/g,B=>({"&":"&","<":"<",">":">",'"':"""})[B]),l=o==="ga"?"ga":e?.objectType??o,c=r?.displayType?.trim()||e?.displayType?.trim()||t?.displayType?.trim()||(l==="table"?b("picker.table","Table"):l==="booth"?b("picker.booth","Booth"):l==="ga"?b("picker.generalAdmission","General admission"):b("picker.row","Row")),h=r?.rowLabel??r?.displayLabel??e?.rowLabel??e?.displayLabel??t?.label??n,d=i.categoryLabel?.trim()??"",u="",p=[];l==="table"&&r?.bookingMode?(u=`${c} ${h}`,p.push([b("picker.guests","Guests"),String(s)])):l==="ga"?(u=String(t?.displayLabel??h),s>1&&p.push([b("picker.tickets","Tickets"),String(s)])):l==="booth"?(u=e?.sectionLabel??`${c} ${h}`,e?.sectionLabel&&p.push([c,String(h)])):!e?.sectionLabel&&!e?.rowLabel&&!e?.seatNumber?u=String(h):(u=e.sectionLabel??"",e.rowLabel&&p.push([c,String(Z(e)??e.rowLabel)]),e.seatNumber&&p.push([b("picker.seat","Seat"),String(e.seatNumber)]));let g=!u&&!!d,y=u||d||String(h),T=!!d&&!g&&d!==y,S=p.map(([P,B])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(P)}</span> <b>${a(B)}</b></span>`);T&&S.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(d)}</span></span>`);let v=[y,...p.map(([P,B])=>`${P} ${B}`),T?d:""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(v)}</span><span class="sl-chip-name" aria-hidden="true">${a(y)}</span>`+(S.length?`<span class="sl-chip-pos" aria-hidden="true">${S.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function cp(i){let e=D;return` data-key="${e(i.key)}"`+(i.heldLabels.length?` data-held="${e(encodeURIComponent(i.heldLabels.join(`
|
|
3145
|
+
`)))}"`:"")+(i.seatIds.length?` data-seat="${e(i.seatIds.join(" "))}"`:"")+(i.locateId?` data-locate="${e(i.locateId)}"`:"")}function La(i){let e=D;return`<div class="sl-chip${i.held?" sl-held":""}${i.fresh?" sl-enter":""}"`+cp(i)+">"+(i.held?i.stateHtml:`<span class="sl-chip-dot" style="background:${C(i.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${i.identityHtml}`+(i.extrasHtml?`<div class="sl-chip-sub">${i.extrasHtml}</div>`:"")+`${i.noteHtml}</div>`+(i.amountText?`<span class="amt">${e(i.amountText)}</span>`:"")+i.railHtml+"</div>"}function lo(i,e){let t=D(i),n=e?D(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${n}" aria-label="${D((0,ci.t)("picker.viewFromSeat",{label:e}))}"><svg viewBox="0 0 24 24"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z"/><circle cx="12" cy="12" r="3"/></svg></button>`:"")+`<button type="button" class="rm" aria-label="${t}"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function Ma(i){return i.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${b("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,ci.t)("picker.willFindSeatsTogether",{count:i.quantity})}</b><span>${b("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>${b("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${b("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="sl-ba-title-t">${b("picker.findSeatsTogether","Find seats together")}</span>`+St({id:"sl-info-best-seats",label:b("picker.aboutBestSeats","About finding seats together"),text:b("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")})+(i.offerPremium?`<button type="button" class="sl-ba-premium${i.premium?" on":""}" data-ba-premium aria-pressed="${i.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${b("picker.bestSeatsPremium","Best seats")}</button>`:"")+`</div><div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${b("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${i.quantity}</span><button type="button" data-ba="1" aria-label="${b("picker.moreSeats","More seats")}">+</button></div>`+(i.categories.length>1?`<select class="sl-ba-cat" aria-label="${D(b("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${D(b("picker.anyTicketType","Any ticket type"))}</option>`+i.categories.map(e=>`<option value="${D(e.key)}"${i.selectedCategory===e.key?" selected":""}>${D(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(i.zones.length?`<select class="sl-ba-zone" aria-label="${b("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${b("picker.anyVenueZone","Any venue zone")}</option>`+i.zones.map(e=>`<option value="${D(e.id)}"${i.selectedZone===e.id?" selected":""}>${D(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${i.busy?" sl-busy":""}"${i.busy?" disabled":""}>`+(i.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${b("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,ci.tCount)("picker.findBestSeatsCount",i.quantity))+"</button>"+(i.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${b("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function Ha(i){if(i.salesClosed&&!i.hasPicks){let e=i.whenText?`<span class="when">${D(i.whenText)}</span>`:"";return`<div class="sl-closed-note" role="status"><b>${b("picker.salesClosedPill","Sales are closed")}</b><span>${b("picker.salesClosedCopy","Ticket sales for this event have ended.")}${e}</span></div>`}return""}function Ra(i){return i.hasGaAreas?i.seated?i.venue3d?b("picker.trayHintChoose3dOrStanding","Choose a seat in the 3D venue \u2014 or grab standing tickets below."):b("picker.trayHintTapOrStanding","Tap a seat on the map \u2014 or grab standing tickets below."):i.venue3d?b("picker.gaTrayHintChoose3dArea","Choose an area in the 3D venue to select tickets."):b("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets."):i.groupMode==="per_performance"?b("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):i.groupMode?b("picker.groupTrayHint","Choose seats once \u2014 the same seats will be held for every performance."):i.venue3d?b("picker.trayHintChoose3dOrBest","Choose a seat in the 3D venue, or let us pick the best available for you."):b("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}var co=6e4,Oa=5*6e4,dp=String(Math.round(Oa/6e4));function _a(i){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(i.regions["bottom-center"]??i.els.map).appendChild(e),i.extendEl=e,i.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),i.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),i.els.extendBtn.textContent=Na(i),i.els.extendDismiss.setAttribute("aria-label",i.tf("picker.close","Close")),i.els.extendBtn.addEventListener("click",()=>{i.handleExtend()}),i.els.extendDismiss.addEventListener("click",()=>{i.extendDismissed=!0,i.setExtendPrompt(!1,0)})}function Na(i){return i.tf("picker.addMinutes","+{count} min").replace("{count}",dp)}function Da(i){let e=i.hold?.items??[],t=new Set(e.map(o=>o.label));return i.committedSelection().filter(o=>!t.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0)+ze(i.gaQty,i.hold?.items??[])}function Ba(i){return(i.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function Fa(i){let e=new Set((i.hold?.items??[]).map(n=>n.label)),t=i.committedSelection().filter(n=>!e.has(n.label)).reduce((n,o)=>n+(o.quantity??1),0);return i.heldTicketCount()+t+ze(i.gaQty,i.hold?.items??[])}function Va(i){let e=new Set((i.hold?.items??[]).map(o=>o.label)),t=i.committedSelection().filter(o=>e.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0),n=Math.max(0,i.maxTickets-i.heldTicketCount()-ze(i.gaQty,i.hold?.items??[]));i.controller.setMaxSelection(t+n)}function za(i,e=i.lastTrayCount,t=i.pendingSelectionCount()){let n=i.els.cta;if(!n)return;if(delete n.dataset.act,i.salesClosed){n.disabled=!0,n.textContent=i.tf("picker.salesClosedCta","Sales closed");return}if(i.confirmSeat||i.tableDialog&&!i.tableDialogHeld){n.disabled=!0,n.textContent=i.tableDialog?i.tf("picker.confirmYourTable","Confirm your table"):i.tf("picker.confirmOrCancelSeat","Confirm or cancel this seat");return}if(i.ctaPhase==="holding"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(i.ctaPhase==="checkout"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let o=!i.hold&&i.performanceGroup?.selectionMode==="per_performance"?i.performanceGroup.submissionState?.():null;if(o&&!o.ready){n.disabled=!0,n.textContent=i.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(o.complete)).replace("{total}",String(o.total));return}let s=i.controller.getSelectionValidity(e);if(s&&!s.isValid){n.disabled=!0,n.textContent=gn(s,(r,a)=>i.tf(r,a),!0);return}if(!e&&i.root?.dataset.layout==="narrow"&&!i.performanceGroup&&!i.hold){n.disabled=!1,n.dataset.act="find",n.textContent=i.tf("picker.findBestSeats","Find best seats");return}n.disabled=e===0,n.textContent=i.hold?t?(0,Ia.t)("picker.secureMoreAndCheckout",{count:t}):i.tf("picker.continueToCheckout","Continue to checkout"):e?i.performanceGroup?i.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(i.performanceGroup.performanceCount)):i.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):i.tf("picker.selectSeats","Select seats")}function $a(i,e){i.ctaPhase=e,i.syncCta()}async function ja(i,e,t){i.setCtaPhase("checkout");try{await i.checkoutHandoff(e,t)}finally{i.ctaPhase==="checkout"&&!i.bookedShown&&i.setCtaPhase("idle")}}function Ga(i){return`@seatlayer/hold/v1/${encodeURIComponent(i.apiBase)}/${encodeURIComponent(i.opts.event)}`}function Ua(i){if(i.opts.initialHoldId)return i.opts.initialHoldId;if(i.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(i.holdStorageKey())}catch{return null}}function qa(i,e){if(!(i.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(i.holdStorageKey(),e.holdId)}catch{}}function Ka(i){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(i.holdStorageKey())}catch{}}async function Wa(i,e){try{let t=await i.controller.resumeHold(e);if(!t||i.destroyed)return null;let n={holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items};return i.hold=n,i.handedOff=!0,i.bookedShown=!1,i.ctaPhase="idle",i.startHoldTimer(n.expiresAt),i.rememberHold(n),i.syncTray(),i.emitHoldChange(),i.opts.onHoldRestored?.(n,n.seats??[],i.buildHandoff(n)),n}catch(t){let n=t?.status;return n===404||n===409?i.forgetHold():i.opts.onError?.(t),null}}async function Ya(i){let e=i.rememberedHoldId();e&&await i.resumeHoldFromServer(e)}function Xa(i,e){i.stopHoldTimer(),i.holdExpiresAt=e,i.extendDismissed=!1,i.extendUsed=!1,i.hold&&i.rememberHold(i.hold);let t=i.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${i.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let n=t.querySelector('[data-ref="holdTime"]'),o=()=>{let s=Math.max(0,i.holdExpiresAt-Date.now());n&&(n.textContent=Aa(s)),t.classList.add("on"),t.classList.toggle("is-expiring",s>0&&s<=co),i.setExtendPrompt(s>0&&s<=co,s),(s<=0||!i.controller.currentHold())&&i.stopHoldTimer()};i.holdTimer=setInterval(o,500),o()}function Za(i){i.holdTimer&&clearInterval(i.holdTimer),i.holdTimer=null,i.els.hold?.classList.remove("on","is-expiring"),i.setExtendPrompt(!1,0)}function Qa(i,e,t){if(!i.extendEl)return;let n=e&&t>0&&i.root?.dataset.layout!=="narrow"&&!i.extendDismissed&&!i.extendUsed&&!!i.controller.currentHold()&&!i.bookedShown;i.extendEl.classList.toggle("on",n)}function Ja(i){if(!i.holdTimer)return;let e=Math.max(0,i.holdExpiresAt-Date.now());i.setExtendPrompt(e>0&&e<=co,e)}async function el(i){let e=i.els.extendBtn,t=i.controller.currentHold();if(!(!t||!i.api.extend||i.extendUsed)){e.disabled=!0,e.textContent=i.tf("picker.addingEllipsis","Adding\u2026");try{let n=await i.api.extend(i.controller.key,t.holdId,Oa);if(i.controller.currentHold()?.holdId!==t.holdId)return;i.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:n.expiresAt,items:t.items});let o=i.controller.currentHold();if(!o)return;i.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},i.holdExpiresAt=o.expiresAt,i.extendUsed=!0,i.extendEl?.classList.remove("on"),i.rememberHold(i.hold),i.emitHoldChange(),i.toast(i.tf("picker.moreTimeAdded","More time added \u2014 your seats are still held."),"success")}catch(n){if(n?.reason==="extend_limit"){i.extendUsed=!0,i.setExtendPrompt(!1,0);return}i.opts.onError?.(n),i.toast(i.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=Na(i)}}}var ho=require("@seatlayer/core");function tl(i){return i?.previousPrice!=null&&i.previousPrice>i.price?i.previousPrice:null}function il(i){return hp(i)+(i.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!i.collapsed}">${i.esc(i.moreLabel)}</button>`:"")+up(i.status)}function hp(i){let{esc:e,money:t}=i;return i.categories.map(n=>{let o=i.priceOf(n),s=i.rangeOf(n),r=i.offerOf(n.key),a=tl(r),l=i.activeKey===n.key;return`<div class="sl-price-row${i.bandKeys!=null&&!i.bandKeys.has(n.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(n.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(i.titleFor(n,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(i.colorOf(n))}"></span><span class="sl-price-label">${e(n.label)}`+(r?.offerName?`<small class="sl-price-offer">${e(r.offerName)}</small>`:"")+"</span>"+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(s!=null?`<span class="sl-price-amt">${s.min===s.max?e(t(s.min)):`${e(t(s.min))}\u2013${e(t(s.max))}`}</span>`:o!=null?`<span class="sl-price-amt">${e(t(o))}</span>`:"")+"</div>"}).join("")}function up(i){let e=t=>t.replace(/[&<>"']/g,n=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[n]);return`<div class="sl-status-key" aria-label="${e(i.legend)}"><span class="sl-status-item"><i class="sl-status-icon unavailable" aria-hidden="true"></i>${e(i.unavailable)}</span></div>`}function po(i){let e=Math.abs(i.scrollLeft),t=e>2,n=e+i.clientWidth<i.scrollWidth-2;return i.dataset.fadeStart=String(t),i.dataset.fadeEnd=String(n),{start:t,end:n}}function nl(i){let{esc:e,money:t}=i;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${i.allActive}" title="${e(i.allWord)}"><span class="sl-rc-t">${e(i.allWord)}</span></button>`+i.categories.map(o=>{let s=i.rangeOf(o),r=i.priceOf(o),a=s?s.min===s.max?t(s.min):`${t(s.min)}+`:r!=null?t(r):null,l=Object.prototype.hasOwnProperty.call(i.left,o.key)&&i.left[o.key]<=0,c=tl(i.offerOf(o.key)),h=a?`${o.label} \u2014 ${a}${l?` (${i.soldOutWord})`:""}`:o.label;return`<button type="button" class="sl-rc" data-cat="${e(o.key)}" aria-pressed="${i.activeKey===o.key}" aria-label="${e(h)}" title="${e(h)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(i.colorOf(o))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??o.label)}</span></button>`}).join("")}function ol(i,e){let t=i.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let n=[...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(n.length<=5)return n.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let o=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),s=Math.ceil(o.length/4),r=[];for(let a=0;a<o.length;a+=s){let l=o.slice(a,a+s),c=Math.min(...l.map(d=>d.range.min)),h=Math.max(...l.map(d=>d.range.max));r.push({id:`b${a}`,label:c===h?e.money(c):`${e.money(c)}\u2013${e.money(h)}`,keys:l.map(d=>d.key),min:c,max:h})}return r}function sl(i){if(i.suppressPricing||!i.els.prices||!i.els.pricesSec)return;let e=ol(i.controller.doc?.categories??[],i.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",i.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let n=document.createElement("option");n.value="all",n.textContent=i.tf("picker.allPrices","All prices"),t.appendChild(n);for(let o of e){let s=document.createElement("option");s.value=o.id,s.textContent=o.label,t.appendChild(s)}i.els.pricesSec.appendChild(t),i.priceSelect=t,t.addEventListener("change",()=>{i.applyPriceBand(e.find(o=>o.id===t.value)?.keys??null)})}function rl(i,e){if(i.focusedCatKey=null,i.priceBandKeys=e?new Set(e):null,i.priceSelect){let t=e?i.priceSelect.value:"all";i.priceSelect.value!==t&&(i.priceSelect.value=t)}i.controller.setCategoryFilter(e),i.controller.focusCategoryFilter(e),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}function al(i){return{colorOf:e=>i.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>i.catPriceRange(e),priceOf:e=>i.catPrice(e),offerOf:e=>i.offerPrice(e),money:e=>i.money(e),esc:D}}function ll(i,e,t,n=i.legendDeps()){let o=i.els.railScroll,s=e.length>1;if(i.els.rail?.classList.toggle("has",s),!o)return;o.innerHTML=s?nl({...n,categories:e,left:t,activeKey:i.focusedCatKey,soldOutWord:i.tf("picker.soldOut","Sold out"),allWord:i.tf("picker.allPrices","All prices"),allActive:!i.focusedCatKey&&!i.priceBandKeys}):"";let r=e.map(a=>a.key).join("|");i.lastRailSignature!==r&&(i.lastRailSignature=r,o.scrollLeft=0),o.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){i.applyPriceBand(null);return}i.focusCategory(a.dataset.cat??"")})}),i.railEdgesBound||(i.railEdgesBound=!0,o.addEventListener("scroll",()=>po(o),{passive:!0})),requestAnimationFrame(()=>po(o))}function cl(i){let e=i.controller.doc;if(!e||!i.els.prices)return;let t=i.controller.categoryAvailability(),n=e.categories.filter(d=>!d.notForSale);i.syncSoldout(n,t);let o=i.legendDeps(),s=i.suppressPricing,r=s?{...o,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:o;s&&(i.els.pricesSec?.querySelector("span")?.replaceChildren(i.tf("picker.seatCategories","Seat categories")),i.els.pricesInfo?.remove()),i.syncPriceRail(n,t,r);let a=5,l=n.length-a,c=l>1&&!i.pricesExpanded,h=c?n.slice(0,a):n;i.els.prices.classList.toggle("sl-expanded",l>1&&i.pricesExpanded),i.els.prices.innerHTML=il({...r,categories:h,left:t,collapsed:c,activeKey:i.focusedCatKey,bandKeys:i.priceBandKeys,titleFor:(d,u)=>u?i.tf("picker.showAllSeats","Show all seats"):(0,ho.t)("picker.showLabelSeatsOnMap",{label:d.label}),moreLabel:l>1?c?s?i.tf("picker.showAllCategories","Show all categories"):(0,ho.t)("picker.showAllTicketTypes",{count:n.length}):i.tf("picker.showFewer","Show fewer"):null,status:{legend:i.tf("picker.seatStatusLegend","Seat status legend"),unavailable:i.tf("picker.notAvailable","Not available")}}),i.els.prices.querySelectorAll(".sl-price-row").forEach(d=>{d.addEventListener("mouseenter",()=>i.controller.getRenderer()?.setCategoryHighlight?.(d.dataset.cat??null)),d.addEventListener("mouseleave",()=>i.controller.getRenderer()?.setCategoryHighlight?.(null));let u=()=>i.focusCategory(d.dataset.cat??"");d.addEventListener("click",u),d.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),u())})}),i.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{i.pricesExpanded=!i.pricesExpanded,i.syncPrices()})}function dl(i,e){if(!e)return;let t=i.focusedCatKey===e?null:e;i.focusedCatKey=t,i.priceBandKeys=t?new Set([t]):null;let n=i.els.pricesSec?.querySelector(".sl-price-select");n&&(n.value="all"),i.controller.setCategoryFilter(t?[t]:null),i.controller.focusCategoryFilter(t?[t]:null),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}var Nt=require("@seatlayer/core");function ye(i,e,t){let n=(0,Nt.t)(i,t);return n&&n!==i?n:t?e.replace(/\{(\w+)\}/g,(o,s)=>s in t?String(t[s]):o):e}function fp(i){let e=(0,Nt.tCount)("picker.seatCount",i);return e.includes("picker.seatCount")?`${i} ${i===1?"seat":"seats"}`:e}function gp(i){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(i)}catch{}return i.join(", ")}function bp(i){if(i.length<2)return!1;let e=[...i].sort((t,n)=>t-n);return new Set(e).size!==e.length?!1:e[e.length-1]-e[0]===e.length-1}function yp(i){let e=i.filter(o=>o.objectType==="ga"),t=i.filter(o=>o.objectType!=="ga"),n=[];if(t.length){let o=fp(t.length),s=[...new Set(t.map(l=>l.sectionLabel).filter(Boolean))],r=[...new Set(t.map(l=>l.rowLabel).filter(Boolean))],a=t.map(l=>Number(l.seatNumber)).filter(l=>Number.isFinite(l));if(s.length===1&&r.length===1&&a.length===t.length){let l=t.length===1?ye("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:s[0],row:r[0],seat:String(t[0].seatNumber??"")}):bp(a)?ye("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:s[0],row:r[0],from:Math.min(...a),to:Math.max(...a)}):"";n.push(l?ye("picker.releasedPair","{first} \xB7 {second}",{first:o,second:l}):ye("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]}))}else s.length===1?n.push(ye("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]})):s.length>1?n.push(ye("picker.releasedInSections","{seats} in Sections {sections}",{seats:o,sections:gp(s)})):n.push(o)}for(let o of e)n.push(ye("picker.releasedGa","{quantity} \xD7 {area}",{quantity:o.quantity??1,area:o.label}));return n.length?n.reduce((o,s)=>ye("picker.releasedPair","{first} \xB7 {second}",{first:o,second:s})):""}function pl(i){if(!i)return[];let e=new Map((i.seats??[]).map(o=>[o.label,o])),t=i.items??[];return(t.length?t.map(o=>({label:o.label,objectType:o.objectType,quantity:o.quantity})):[...e.keys()].map(o=>({label:o}))).map(o=>{let s=e.get(o.label);return{label:o.label,...o.objectType?{objectType:o.objectType}:{},...o.quantity==null?{}:{quantity:o.quantity},...s?.sectionLabel?{sectionLabel:s.sectionLabel}:{},...s?.rowLabel?{rowLabel:Z(s)??s.rowLabel}:{},...s?.seatNumber?{seatNumber:s.seatNumber}:{}}})}function hl(i,e){if(!i.reducedMotion)for(let t of e.slice(0,10)){if(t.objectType==="ga")continue;let n=i.seatByLabel(t.label);!n||i.statusOf(n.id)!=="free"||i.flash(n.id,i.accent)}}function ul(i,e){if(!e.recoverable.length||!i.isConnected)return;let t=i.querySelector(".sl-hold-expired-next");t&&(e.taken.length?t.textContent=e.taken.slice(0,3).map(r=>(0,Nt.t)("picker.seatJustTakenByAnother",{label:r})).join(" "):t.remove());let n=i.querySelector(".sl-interrupt-actions"),o=n?.querySelector(".sl-interrupt-act");if(!n||!o)return;o.classList.add("sl-interrupt-act-secondary");let s=document.createElement("button");s.type="button",s.className="sl-interrupt-act sl-hold-expired-recover",s.textContent=(0,Nt.tCount)("picker.holdLapsedSelectAgain",e.recoverable.length),s.addEventListener("click",()=>e.onRecover([...e.recoverable])),n.insertBefore(s,o),i.classList.add("has-recovery"),s.focus()}function ml(i,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let n=document.createElement("div");n.className="sl-interrupt-card sl-mo-in";let o=document.createElement("div");o.className="sl-interrupt-title",o.id="sl-hold-expired-title";let s=document.createElement("span");s.className="sl-interrupt-glyph",s.setAttribute("aria-hidden","true"),s.textContent="\u23F1";let r=document.createElement("span");r.textContent=ye("picker.holdExpiredTitle","Your seats were released"),o.append(s,r);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=ye("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),n.append(o,a);let l=yp(e);if(l){let u=document.createElement("div");u.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",u.textContent=l,n.appendChild(u)}let c=document.createElement("div");c.className="sl-interrupt-body sl-hold-expired-next",c.textContent=ye("picker.holdExpiredPickAgain","Pick your seats again to continue \u2014 they may already be taken."),n.appendChild(c),t.setAttribute("aria-labelledby",o.id),t.setAttribute("aria-describedby",a.id);let h=document.createElement("div");h.className="sl-interrupt-actions";let d=document.createElement("button");return d.type="button",d.className="sl-interrupt-act sl-hold-expired-restart",d.textContent=ye("picker.holdExpiredRestart","Choose seats again"),d.addEventListener("click",()=>i.restart()),h.appendChild(d),n.appendChild(h),t.appendChild(n),t.addEventListener("pointerdown",u=>{u.target===t&&i.restart()}),t}var Oe=require("@seatlayer/core");var fl={wheelchair:"Wheelchair space",companion:"Companion seat","semi-ambulatory":"Limited mobility","designated-aisle":"Aisle / transfer","step-free":"Step-free",hearing:"Assistive listening",cart:"Live captions","sign-language":"Sign language","low-vision":"Low vision","sensory-friendly":"Sensory-friendly","plus-size":"Plus-size","lift-armrest":"Lift-up armrest"},vp='<svg viewBox="0 0 20 20" width="17" height="17" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="10" cy="10" r="7.5" /><path d="M10 2.5a7.5 7.5 0 0 1 0 15Z" fill="currentColor" stroke="none" /></svg>',wp='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="13" cy="4.4" r="1.9"/><path d="M11 8.2v5.1h5.1"/><path d="M16.6 13.3l1.9 6.3"/><path d="M15.4 14.9a5.6 5.6 0 1 1-5.9-3.4"/></svg>',xp='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="8.4"/><circle cx="8.6" cy="10.2" r="1.15"/><circle cx="12" cy="8.2" r="1.15"/><circle cx="15.4" cy="10.2" r="1.15"/><path d="M12 20.4a2.6 2.6 0 0 1 0-5.2 2.2 2.2 0 0 0 0-4.4"/></svg>',Sp=8,kp=8,Tp=88;function Ep(i){let e=i.gap??Sp,t=i.margin??kp,n=i.min??Tp,o=Math.max(i.boundsTop,0);return Math.max(Math.round(i.buttonTop-o-e-t),n)}var bn=class{constructor(e,t){this.active=new Set;this.deps=t,this.root=document.createElement("div"),this.root.className="sl-a11y",this.button=document.createElement("button"),this.button.type="button",this.button.className="sl-a11ybtn",this.button.setAttribute("aria-haspopup","true"),this.button.setAttribute("aria-expanded","false");let n=this.offered().length>0,o=n?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options");this.button.setAttribute("aria-label",o),this.button.innerHTML=n?wp:xp,this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let s of this.stored())this.offeredFree().has(s)&&this.active.add(s);if(this.menu.innerHTML=as(o,t.tf("picker.close","Close"))+ls(this.rows()),this.root.append(this.menu,this.button),e.prepend(this.root),this.button.addEventListener("pointerdown",s=>s.stopPropagation()),this.button.addEventListener("click",s=>{s.stopPropagation(),this.open(this.menu.hidden)}),this.menu.querySelector("[data-a11y-close]")?.addEventListener("click",s=>{s.stopPropagation(),this.open(!1),this.button.focus({preventScroll:!0})}),this.menu.addEventListener("pointerdown",s=>s.stopPropagation()),this.menu.addEventListener("click",s=>s.stopPropagation()),this.menu.addEventListener("focusin",s=>{let r=s.target;r&&typeof r.scrollIntoView=="function"&&r.scrollIntoView({block:"nearest"})}),this.dismiss=()=>this.open(!1),this.escape=s=>{s.key==="Escape"&&this.open(!1)},this.reflow=()=>{this.menu.hidden||this.fit()},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),window.addEventListener("resize",this.reflow),this.promoteCounts(),this.wire(),this.active.size){this.applyFilter({focus:!1});let s=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:n,count:o})=>[n,o])),t=!1;for(let n of this.menu.querySelectorAll("[data-a11y-row]")){let o=n.dataset.a11yRow??"";if(!o.startsWith("a11y:"))continue;let s=o.slice(5),r=e.get(s);if(r===void 0)continue;let a=this.countNode(n),l=r==null?"":this.countText(r);a&&(a.textContent=l);let c=r===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(s,l))),n.disabled=c,c?n.setAttribute("aria-disabled","true"):n.removeAttribute("aria-disabled"),c&&this.active.delete(s)&&(this.paint(n,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let n=t.dataset.a11yRow??"";n.startsWith("a11y:")&&this.paint(t,this.active.has(n.slice(5)))}}refit(){this.menu.hidden||this.fit()}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),window.removeEventListener("resize",this.reflow),this.root.remove()}fit(){this.menu.style.setProperty("--sl-a11ymenu-max",`${Ep({boundsTop:this.boundsTop(),buttonTop:this.button.getBoundingClientRect().top})}px`)}boundsTop(){let e=this.root.closest(".sl-map")??this.root.closest(".sl-picker");return e instanceof HTMLElement?e.getBoundingClientRect().top:0}open(e){if(e===!this.menu.hidden)return;if(this.button.setAttribute("aria-expanded",String(e)),!e){this.menu.hidden=!0,this.menu.classList.remove("sl-mo-in","sl-mo-stagger");return}this.menu.hidden=!1,this.fit(),this.menu.scrollTop=0;let t=this.button.getBoundingClientRect();Dn(this.menu,{x:t.left+t.width/2,y:t.top}),Ss(this.menu),xs(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:(0,Oe.seatTypeIconSvg)("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:vp,className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:n,count:o})=>({key:n,count:o}));let t=this.deps.present;return t?Oe.ACCESSIBILITY_TYPES.filter(({key:n})=>t.has(n)).map(({key:n})=>({key:n,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(Oe.ACCESSIBILITY_TYPES.map(n=>[n.key,n]));return this.offered().flatMap(({key:n,count:o})=>{let s=t.get(n);return s?[{key:`a11y:${n}`,iconHtml:(0,Oe.seatTypeIconSvg)(n,{size:17}),label:this.deps.tf(`picker.accessShort.${n}`,fl[n]??s.label),...n==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...o==null?{}:{count:this.countText(o),disabled:o===0},on:this.active.has(n)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-sl-info]"))e.addEventListener("click",()=>{let t=e.closest(".sl-info"),n=!t?.classList.contains("open");for(let o of this.menu.querySelectorAll(".sl-info.open"))o.classList.remove("open"),o.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false");t?.classList.toggle("open",n),e.setAttribute("aria-expanded",String(n))});for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let s=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(s),this.paint(e,s);return}if(t==="limited"){let s=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(s),s&&this.deps.focusSeatsForFilter(),this.paint(e,s);return}let n=t.slice(5),o=!this.active.has(n);o?this.active.add(n):this.active.delete(n),this.paint(e,o),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let n=(e.dataset.a11yRow??"").slice(5),o=e.parentElement;o?.classList.contains("sl-a11yrow-w")||(o=document.createElement("div"),o.className="sl-a11yrow-w",e.replaceWith(o),o.appendChild(e));let s=document.createElement("button");s.type="button",s.className="sl-a11yrow-c sl-a11yjump",s.dataset.a11yJump=n,s.textContent=t.textContent,s.disabled=e.disabled,s.setAttribute("aria-label",this.jumpLabel(n,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(n,s.textContent??""));let r=o.querySelector(".sl-info");r?r.after(s):e.after(s),o.dataset.a11yTapThrough||(o.dataset.a11yTapThrough="true",o.addEventListener("click",a=>{a.target===o&&!e.disabled&&e.click()})),s.addEventListener("click",a=>{a.stopPropagation(),this.active.has(n)||(this.active.add(n),this.paint(e,!0),this.applyFilter({focus:!1}));let l=this.deps.stepToAccessibleSection?.(n);l&&s.setAttribute("aria-label",this.jumpLabel(n,s.textContent??"",l.label))})}}countText(e){return e>0?(0,Oe.t)("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=fl[e]??Oe.ACCESSIBILITY_TYPES.find(n=>n.key===e)?.label??e;return this.deps.tf(`picker.accessShort.${e}`,t)}jumpLabel(e,t,n){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...n?[`${this.deps.tf("picker.section","Section")} ${n}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};var gl=require("@seatlayer/core"),Cp=250;function bl(i,e=Cp){let t=null,n=()=>{t===null&&(t=setTimeout(()=>{t=null,i()},e))},o=(0,gl.attachVisibilityCatchUp)(n),s=typeof window<"u"&&typeof window.addEventListener=="function";return s&&window.addEventListener("focus",n),()=>{t!==null&&(clearTimeout(t),t=null),o(),s&&window.removeEventListener("focus",n)}}var at=require("@seatlayer/core");var yn=class{constructor(e){this.note=null;this.told=!1;this.deps=e}deferExpiryToast(e){this.told=!1,queueMicrotask(()=>{this.told||e()})}handle(e){if(!e.holdLapsed)return;this.told=!0;let t=(0,at.holdRecoveryShape)(e),n=e.lapsedLabels.length,o=n-e.recoverable.length,s=t==="all"?(0,at.tCount)("picker.holdLapsedStillFree",n):t==="partial"?(0,at.tCount)("picker.holdLapsedSomeTaken",o):(0,at.tCount)("picker.holdLapsedAllTaken",n);this.note={message:s,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(s,t==="none"?"error":"warning",t==="none"?void 0:{label:this.actionLabel(),onClick:()=>this.recover()}),this.deps.syncTray()}noteHtml(){if(!this.note)return"";let e=this.note.recoverable.length?`<button type="button" data-lapse-again>${D(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${D(this.note.message)}</span>${e}</div>`}wire(e){e?.querySelector("[data-lapse-again]")?.addEventListener("click",()=>this.recover())}clear(){this.note&&(this.note=null,this.deps.syncTray())}actionLabel(){return(0,at.tCount)("picker.holdLapsedSelectAgain",this.note?.recoverable.length??0)}recover(){let e=this.note?.recoverable??[];this.note=null,this.deps.syncTray(),e.length&&this.deps.reselect(e)}};var yl=Symbol("seatlayer.performance-group-picker");function vn(i,e){return Object.defineProperty(i,yl,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),i}function vl(i){return i[yl]??null}var wl="@seatlayer/pending-checkout/v1";function Ap(i){return typeof i=="string"&&i.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(i)}function wn(i){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let n=null;try{let o=window.sessionStorage.getItem(wl);if(o){let s=null;try{s=JSON.parse(o)}catch{}if(s&&Ap(s.orderId)){let r=Date.now()-Number(s.storedAt);if(r>=0&&r<=144e5){if(s.eventKey&&s.eventKey!==i)return null;n=s.orderId}}}window.sessionStorage.removeItem(wl)}catch{}e.delete("seatlayer_checkout");try{let o=e.toString();history.replaceState(history.state,"",`${location.pathname}${o?`?${o}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:n}}function xl(i){if(!i.framed)return null;let e=i.ancestorOrigins?.length?i.ancestorOrigins[0]:null;for(let t of[e,i.referrer])if(t)try{return new URL(t).origin}catch{}return null}var Pp="https://api.seatlayer.io",Lp=10,Mp=250,Sl=6e4,kl=4,Hp=10,Rp=40,Ip=220,uo=["mini","peek","open"],Tl="seatmap.a11y.cb";function Op(){try{if(typeof window>"u")return null;let i=window.localStorage.getItem(Tl);return i==null?null:i==="1"}catch{return null}}function _p(i){try{window.localStorage.setItem(Tl,i?"1":"0")}catch{}}var qe=class i{constructor(e){this.realtime=null;this.accessEl=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.els={};this.regions={};this.ro=null;this.viewportResizeHandler=null;this.holdTimer=null;this.toastTimer=null;this.offerReadInFlight=null;this.offerReadSettledAt=0;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.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.extendDismissed=!1;this.extendUsed=!1;this.bookedEl=null;this.holdExpiredEl=null;this.holdExpiredFresh=!1;this.holdExpiredUnits=[];this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedReport=null;this.confirmCardCache=null;this.suppressConfirmationSeatId=null;this.tableDialogEl=null;this.tableDialog=null;this.tableDialogHeld=!1;this.tableDialogReturnFocus=null;this.srEl=null;this.baQty=2;this.baCat="";this.baZone="";this.baPremium=!1;this.bestAvailableConfirm=!1;this.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 pn({overlay:()=>this.view3dEl,savedSeatIds:()=>this.view3dCompareSeatIds,openComparison:()=>this.openView3dComparison(),clearComparison:()=>this.clearView3dComparison(),toast:(e,t)=>this.toast(e,t)});this.view3dCompareEl=null;this.view3dCompareCleanup=null;this.view3dSeatViewChrome=null;this.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.arenaViewportInsets={top:0,right:0,bottom:0,left:0};this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.view3dBack=null;this.view3dNav=null;this.lastRailSignature="";this.priceSelect=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.fullscreenAffordanceSize={rootWidth:-1,rootHeight:-1,viewportWidth:-1,viewportHeight:-1};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.sectionCardCache=null;this.lastTrayCount=0;this.langSel=null;this.lastTrayTotal=0;this.lastTrayKeys=new Set;this.bestAvailableBusy=!1;this.releasingLabels=new Set;this.holdingLabels=new Set;this.ctaPhase="idle";this.a11yMenu=null;this.detachAttention=null;this.lapse=new yn({toast:(e,t,n)=>this.toast(e,t,n),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalScrim=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.fitScheduled=!1;this.perspectiveWarned=!1;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");if(!e.container)throw new Error("seatmap: `container` is required (or use SeatPicker.open())");this.performanceGroup=vl(e),this.suppressPricing=!!this.performanceGroup?.suppressPricing,this.opts={...e,confirmSelection:e.confirmSelection??!0},this.eventDetailsHidden=!!e.hideEventDetails,this.hostPricing=e.pricing,this.apiBase=(e.apiBase??Pp).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},n=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?_i({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:n?.access??Mt(e,t),this.pubApi=e.transport?null:n?.api??new Fe(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=e.transport??this.pubApi,this.buyerAssetUrls=new Rt(e.event,this.api.asset?(a,l)=>this.api.asset(a,l):void 0),e.checkout==="hosted"&&!this.pubApi&&console.warn('seatlayer: checkout: "hosted" needs the widget\'s own transport \u2014 a custom `transport` owns its backend, so the picker is staying on onCheckout for this mount.'),this.checkoutMode=e.checkout==="hosted"&&this.pubApi?"hosted":"handoff";let o=e.numberOfPlacesToSelect;if(o!=null&&(!Number.isInteger(o)||o<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=o??null;let s=Ca(e.selectionValidators);if(this.exactTickets!=null&&s>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let r=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(Lp,s)));if(this.exactTickets!=null&&r<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&r<s)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??r,this.cbSafe=Op()??!!e.colorblindSafe,this.controller=this.wireController(e)}get confirmEl(){return this.confirmCard.element}set confirmEl(e){this.confirmCard.element=e}get confirmSeat(){return this.confirmCard.candidate}set confirmSeat(e){this.confirmCard.candidate=e}get lastSection(){return this.sectionCard.summary}set lastSection(e){this.sectionCard.adopt(e)}deliverableViewReference(e){return Ot(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=xl({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let n=t<640?1.2:.62;return Math.max(420,Math.round(t*n))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!document.fullscreenElement||this.fsFallback||this.framedFs?document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.framedFs?this.setFramedFs(!1):this.setFsFallback(!1):e.requestFullscreen?e.requestFullscreen().catch(()=>this.enterFsFallback()):this.enterFsFallback()}fillsViewport(){let e=this.root;if(!e||typeof window>"u")return!1;let t=e.getBoundingClientRect();return t.height>=window.innerHeight-kl&&t.width>=window.innerWidth-kl}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let n=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=n,e.tabIndex=n?-1:0,e.setAttribute("aria-hidden",String(n))}fullscreenMeasurementChanged(e,t){let n=typeof window>"u"?0:window.innerWidth,o=typeof window>"u"?0:window.innerHeight,s=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||n!==this.fullscreenAffordanceSize.viewportWidth||o!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:n,viewportHeight:o},s}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),this.root?.setAttribute("data-fs",String(e)),this.els.zfs?.setAttribute("aria-pressed",String(e)),this.els.zfs?.setAttribute("title",e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));let n=this.els.zfs?.querySelector(".sl-zfs-lbl");n&&(n.textContent=e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),this.view3dEl?.querySelector(".sl-view3d-fs")?.setAttribute("aria-pressed",String(e)),this.syncFullscreenAffordance()}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e,background:this.cssVar("--sl-bg")||void 0}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){It();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.createElement("div");n.className="sl-modal-scrim";let o=document.createElement("div");o.className="sl-modal-frame",o.style.setProperty("--sl-bg",Tt(void 0,e.theme)["--sl-bg"]),o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label",b("picker.seatSelection","Seat selection")),o.tabIndex=-1,n.appendChild(o),document.body.appendChild(n);let s=document.body.style.overflow;document.body.style.overflow="hidden";let r=new i({...e,container:o});r.modalScrim=n,r.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 g=[...o.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(y=>y.isConnected&&!y.closest('[hidden], [aria-hidden="true"], [inert]'));return g[g.length-1]??o},c=(g,y)=>{let T=g;for(;T;){let S=window.getComputedStyle(T);if(T.hidden||T.getAttribute("aria-hidden")==="true"||T.hasAttribute("inert")||S.display==="none"||S.visibility==="hidden"||S.visibility==="collapse")return!0;if(T===y)return!1;T=T.parentElement}return!0},h=g=>[...g.querySelectorAll(a)].filter(y=>y.tabIndex>=0&&!y.matches(":disabled")&&!c(y,g)),d=(g,y)=>{let T=h(g),S=y?T[T.length-1]:T[0];S?S.focus({preventScroll:!0}):(g.hasAttribute("tabindex")||(g.tabIndex=-1),g.focus({preventScroll:!0}))},u=!1,p=()=>{if(u)return;u=!0,document.body.style.overflow=s,r.escHandler&&document.removeEventListener("keydown",r.escHandler),n.remove(),r.modalScrim=null;let g=r.prevFocus;r.prevFocus=null,g?.isConnected&&g.focus({preventScroll:!0});let y=()=>{r.destroy(),e.onClose?.()};r.hold&&!r.handedOff?r.release().finally(y):y()};return r.closeModal=p,n.addEventListener("mousedown",g=>{g.target===n&&p()}),r.escHandler=g=>{if(g.key==="Tab"){if(g.defaultPrevented)return;let y=l(),T=h(y),S=T[0],v=T[T.length-1],P=document.activeElement;!S||!v?(g.preventDefault(),d(y,g.shiftKey)):P===y||!P||!y.contains(P)?(g.preventDefault(),(g.shiftKey?v:S).focus({preventScroll:!0})):g.shiftKey&&P===S?(g.preventDefault(),v.focus({preventScroll:!0})):!g.shiftKey&&P===v&&(g.preventDefault(),S.focus({preventScroll:!0}));return}g.key==="Escape"&&(r.tableDialog?(g.preventDefault(),r.cancelTableDialog()):r.confirmSeat?(g.preventDefault(),r.cancelConfirm()):r.bestAvailableConfirm?(g.preventDefault(),r.bestAvailableConfirm=!1,r.syncTray()):(g.preventDefault(),p()))},document.addEventListener("keydown",r.escHandler),await r.render(),r.els.close?.classList.add("on"),r.els.close?.addEventListener("click",p),d(l(),!1),r}wireController(e){return new R.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,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:kt(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let n=this.controller.getGAAreas().find(o=>o.id===t);n&&(this.collapseSheet(),Vn(this,n,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),pr(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,n=this.holdConflicted;this.holdExpiredUnits=pl(this.hold),this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.holdConflicted=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.lapse.deferExpiryToast(()=>{if(t||n){this.toast((0,R.t)("picker.holdExpired",void 0)||"Your hold expired \u2014 seats released. Pick again.","warning");return}this.showHoldExpired()}),this.syncTray(),this.emitHoldChange(),this.opts.onHoldExpired?.()},onAvailabilityRefresh:t=>this.lapse.handle(t),confirmSelection:this.opts.confirmSelection,onSelect:t=>{if(this.salesClosed){this.controller.deselect([t.id]),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){this.removeHeldLabels([t.label]);return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}if(this.tableDialog?.physicalSeatIds.includes(t.id)){this.dismissTableDialog();return}this.opts.confirmSelection===!1||this.salesClosed||this.controller.tableSelection(t.id)||(this.controller.select([t.id]),this.showConfirm(t,"remove"))},onSelectionLimit:()=>{this.toast((0,R.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),hostCardOpen:()=>this.tipPinned||!!this.confirmSeat,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={},n=E=>Math.round((performance.now()-E)*100)/100;this.rendered=!0,It();let o=performance.now(),s=Ri(this.opts.locale,this.opts.messages),r=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=Go(this.opts.container),{root:c,els:h,mapHost:d}=fs(l,(E,I)=>this.tf(E,I),this.opts.theme);this.root=c,this.els=h,this.mapHost=d,Ii(c,s,E=>{t.loadLocale=n(o),this.destroyed||this.applyActiveLocale(E,r)}),Zr(c,()=>[{open:()=>!!this.holdExpiredEl,close:()=>this.restartAfterHoldExpiry()},{open:()=>this.tipPinned,close:()=>this.unpinTooltip()},{open:()=>!!this.tableDialog,close:()=>this.cancelTableDialog()},{open:()=>!!this.confirmSeat,close:()=>this.cancelConfirm()},{open:()=>this.bestAvailableConfirm,close:()=>{this.bestAvailableConfirm=!1,this.syncTray()}}]),this.syncFullscreenButtons(),this.wireBuyerShell(c);let u=document.createElement("div");u.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(u),t.mountBuyerShell=n(a),t.skeletonPaint=n(e),this.startRealtime();let p=await this.loadChart(u,t,n);if(!p)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=n(e);let g=performance.now();if(this.salesClosed=!!p.salesClosed||!!this.opts.readOnly,c.dataset.eventMode=p.mode==="test"?"test":"live",!this.opts.locale&&p.locale&&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 E=document.createElement("div");E.className="sl-testbadge",E.textContent=jo((0,R.t)("picker.testMode"),(0,R.getLocale)()),E.setAttribute("aria-label",(0,R.t)("picker.testMode")),E.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"),this.regions["top-left"].appendChild(E)}let y=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(c),this.watchThemeMode(),this.currency=p.currency??this.opts.currency??"USD",this.eventTimezone=p.timezone??null,Uo(this.els.logo,[this.opts.theme?.logoUrl,y?.logoUrl,p.posterUrl],this.opts.theme?.brandName??y?.brandName??p.eventName??"?"),this.els.name.textContent=p.eventName??"";let T=p.startsAt?Ci(p.startsAt,p.timezone??null,this.opts.locale):"";this.eventWhenText=T||null,this.els.meta.textContent=[p.venue,T].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(y);let S=!!this.controller.doc&&this.controller.getExpandedSeats().some(E=>E.commercial?.restrictedView||E.commercial?.obstructedView);this.buildAccessibilityMenu(S),this.buildLanguageSwitcher(this.els.zoom??this.regions["bottom-right"]),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),c.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=n(g);let v=performance.now();if(await this.restoreRememberedHold(),t.restoreHold=n(v),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let P=this.controller.doc,B=Ki(this.opts.event),U=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),f=U??"event",L={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:f,surface:U==="season"?"season_picker":U==="performance_group"?"performance_group_picker":"seat_picker",ms:n(e),performanceProfile:t,chartDelivery:p.chartDelivery,seatCount:this.allSeats().length,objectCount:P?.objects.length??0,sectionCount:P?.objects.filter(E=>E.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:P?.name,view:this.buyerView,load:B,transport:this.opts.transport?"custom":"pubapi"};na(L,(E,I)=>this.emitAnalytics(E,I));let A=p.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",so({...L,performanceProfile:{...L.performanceProfile,...A}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=p,await this.registerAgentTools(),this}registerAgentTools(){return ia(this)}webMcpHost(e){return oo(this,e)}wireBuyerShell(e){this.refreshOfferAvailability(!1),this.api.availability&&(this.offerVisibilityHandler=()=>{!document.hidden&&!this.destroyed&&this.refreshOfferAvailability(!1)},document.addEventListener("visibilitychange",this.offerVisibilityHandler)),this.detachAttention=bl(()=>{this.destroyed||this.controller.refreshAvailability()}),this.observeLayout(e),this.els.zin.addEventListener("click",()=>this.controller.zoomIn()),this.els.zout.addEventListener("click",()=>this.controller.zoomOut()),this.els.zfit?.addEventListener("click",()=>this.controller.overview()),this.els.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let o=this.els.sheetToggle;this.syncSheetAffordance();let s=0,r=!1,a=!1,l=!1;o?.addEventListener("click",c=>{c.stopPropagation(),!r&&this.cycleSheet()}),t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard")){a=!1;return}l=!!c.target.closest?.(".sl-sheet-toggle"),a=!0,r=!1,s=c.clientY,t.setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!a||r)return;let h=c.clientY-s;h<-18?(this.stepSheet(1),r=!0):h>18&&(this.stepSheet(-1),r=!0)}),t.addEventListener("pointerup",c=>{a&&!r&&!l&&Math.abs(c.clientY-s)<6&&this.cycleSheet(),a=!1,l=!1,t.releasePointerCapture?.(c.pointerId)})}this.els.foot?.addEventListener("click",o=>{this.root?.dataset.layout==="narrow"&&(o.target.closest?.('button,a,input,select,label,[role="button"]')||this.cycleSheet())});let n=()=>{if(this.root?.dataset.layout!=="narrow")return;let o=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!o)),this.els.pricesSec?.setAttribute("aria-expanded",String(!o)),!o&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",o=>{o.target.closest("select,button")||n()}),this.els.pricesSec?.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||o.target.closest("select,button")||(o.preventDefault(),n())}),e.addEventListener("click",o=>{let s=o.target.closest("[data-sl-info]");if(!s||!e.contains(s))return;o.stopPropagation();let r=s.closest(".sl-info"),a=!r?.classList.contains("open");this.closeInfoPops(r),r?.classList.toggle("open",a),s.setAttribute("aria-expanded",String(a))}),e.addEventListener("pointerdown",o=>{o.target.closest(".sl-info")||this.closeInfoPops()}),this.tipEl=document.createElement("div"),this.tipEl.setAttribute("role","tooltip"),this.tipEl.className="sl-tip",this.els.map.appendChild(this.tipEl),this.els.map.addEventListener("pointerdown",o=>{this.handleMapPointerDown(o)},!0),this.els.map.addEventListener("mousemove",o=>{if(this.tipPinned)return;let s=this.els.map.getBoundingClientRect();this.tipPos={x:o.clientX-s.left,y:o.clientY-s.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.els.cta.dataset.act==="find"?this.openBestSeatsForm():this.handleCta()})}sheetState(){let e=this.root?.dataset.sheet;return e==="mini"||e==="open"?e:"peek"}sheetHasCards(){return this.root?.getAttribute("data-has-selection")==="true"}setSheetState(e){let t=this.root;if(!t)return;let n=t.dataset.sheet;t.dataset.sheet=e==="mini"&&!this.sheetHasCards()?"peek":e,this.syncSheetAffordance(),n==="mini"&&t.dataset.sheet!=="mini"&&this.scheduleFit()}syncSheetAffordance(){let e=this.sheetState(),t=e==="open"||e==="peek"&&this.sheetHasCards(),n=this.els.sheetToggle;n?.setAttribute("aria-expanded",String(e==="open")),n?.setAttribute("aria-label",t?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))}cycleSheet(){let e=this.sheetState();e==="open"||e==="mini"?this.setSheetState("peek"):this.setSheetState(this.sheetHasCards()?"mini":"open")}stepSheet(e){let t=uo.indexOf(this.sheetState()),n=Math.min(uo.length-1,Math.max(0,t+e));this.setSheetState(uo[n])}setSheetOpen(e){this.setSheetState(e?"open":"peek")}openBestSeatsForm(){this.setSheetOpen(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||this.setSheetState("peek")}observeLayout(e){let t=()=>{let n=e.clientWidth;if(n<=0)return;let o=e.clientHeight,s=n!==this.pickerLayoutSize.width||o!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:n,height:o};let r=this.fullscreenMeasurementChanged(n,o);this.reportFramedHeight();let a=n<640?"narrow":"wide",l=o<560?"compact":"comfortable",c=e.dataset.layout!==a||e.dataset.density!==l;c&&(e.dataset.layout=a,e.dataset.density=l,this.controller.getRenderer()?.setSectionFocusDim?.(a!=="narrow"),a==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray(),this.syncMapStepBack(),this.refreshExtendPrompt()),(r||c)&&this.syncFullscreenAffordance(),this.syncArenaViewportInsets(),s&&(this.minimap?.refreshMinimap(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),this.viewportResizeHandler=()=>{this.fullscreenMeasurementChanged(e.clientWidth,e.clientHeight)&&this.syncFullscreenAffordance()},window.addEventListener("resize",this.viewportResizeHandler),t(),requestAnimationFrame(t)}async loadChart(e,t,n){let o=performance.now(),s=await this.controller.render(e);return t.loadChartAndStatuses=n(o),this.destroyed?null:s?(Object.assign(t,s.performanceProfile),s):(Ie({apiBase:this.apiBase,event:this.opts.event,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:je(this.opts.event),transport:this.opts.transport?"custom":"pubapi"}),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 r=this.opts.container,a=this.opts;this.destroy(),new i({...a,container:r}).render()}),null)}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=wn(this.opts.event);e?.outcome!=="success"||!e.orderId||this.openCheckoutPanel({kind:"resume",orderId:e.orderId})}buildPanelToggle(){if(!this.regions["top-right"])return;let e=document.createElement("button");e.type="button",e.className="sl-side-toggle",e.addEventListener("click",()=>this.setPanelCollapsed(!this.sideCollapsed)),this.sideToggleEl=e,this.regions["top-right"].appendChild(e),this.syncPanelToggle()}syncPanelToggle(){let e=this.sideToggleEl;if(!e)return;let t=this.sideCollapsed;e.setAttribute("aria-expanded",String(!t)),e.setAttribute("aria-label",t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel")),e.title=t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel"),e.innerHTML=t?`<svg viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg><span>${this.tf("picker.tickets","Tickets")}</span>`:'<svg viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></svg>'}setPanelCollapsed(e){this.destroyed||(this.sideCollapsed=e,this.applyPanelCollapsed(),this.scheduleMotion(()=>this.controller.refitCurrentView(),340))}applyPanelCollapsed(){let e=this.root?.dataset.layout!=="narrow";this.root?.setAttribute("data-side-collapsed",String(this.sideCollapsed)),this.els.side?.toggleAttribute("inert",this.sideCollapsed&&e),this.syncPanelToggle()}buildAccessibilityMenu(e){let t=this.els.zoom??this.regions["bottom-right"]??this.els.map;t&&(this.a11yMenu=new bn(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(n,o)=>this.tf(n,o),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:n=>this.setColorblindSafe(n),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:n=>{this.limitedViewFilter=n,this.controller.setCommercialLimitedFilter(n),this.pushAvailabilityTo3d()},applyAccessibilityFilter:n=>this.applyAccessibilityFilter(n),focusSeatsForFilter:()=>this.focusSeatsForFilter(),stepToAccessibleSection:n=>this.controller.focusNextAccessibleSection?.([n])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast((0,R.t)("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,n=this.els.headInfo?.parentElement;t&&n&&t.parentElement!==n&&(t.classList.add("sl-fs-pill"),n.insertBefore(t,this.els.hold??null));let o=this.extendEl;if(o){let r=e?this.regions["bottom-center"]??this.els.map:n;r&&o.parentElement!==r&&(o.dataset.dock=e?"map":"head",r===n?r.insertBefore(o,this.els.close??null):r.appendChild(o))}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.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){_a(this)}buildBookedOverlay(){let e=document.createElement("div");e.className="sl-booked",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<div class="sl-booked-badge"><svg viewBox="0 0 24 24"><path d="M20 6L9 17l-5-5"/></svg></div><div class="sl-booked-title">${this.tf("picker.allSetTitle","You're all set")}</div><div class="sl-booked-sub" data-ref="bookedSub"></div><ul class="sl-booked-list" data-ref="bookedList"></ul><button type="button" class="sl-booked-back" data-ref="bookedBack"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${D(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}tf(e,t){return b(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(),n=document.createElement("div");n.className="sl-soldout-eyebrow",n.textContent=t;let o=document.createElement("div");o.className="sl-soldout-title",o.textContent=this.tf("picker.soldOutTitle","Sold out");let s=document.createElement("p");s.className="sl-soldout-copy",s.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(n,o,s),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let n=this.controller.getGAAreas().length>0,o=this.isSoldOut(e,t,n);o!==this.soldOut&&(this.soldOut=o,this.soldoutEl?.classList.toggle("on",o))}isSoldOut(e,t,n){return!n&&e.length>0&&e.every(o=>(t[o.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog();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!!e?.hideBadge}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let n=document.createElement("a");n.className="sl-powered",n.href="https://seatlayer.io/?ref=picker",n.target="_blank",n.rel="noopener noreferrer",n.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer"));let o=document.createElement("span");o.className="sl-powered-mark",o.setAttribute("aria-hidden","true"),o.innerHTML=Vi;let s=document.createElement("span");s.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),n.append(o,s),t.appendChild(n)}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 n=document.createElement("div");n.className="sl-anchor",n.dataset.region=t,this.els.map.appendChild(n),this.regions[t]=n}}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 n=setTimeout(()=>{this.motionTimers.delete(n),this.destroyed||e()},t);this.motionTimers.add(n)}animateOnce(e,t,n=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),n))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){let t=this.reducedMotion(),n=(e.items??[]).filter(o=>o.objectType!=="ga").slice(0,10).map(o=>this.controller.seatByLabel(o.label)).filter(o=>!!o);Ws({regions:this.els,categories:this.controller.doc?.categories,pop:o=>this.controller.flashSeat(o,this.cssVar("--sl-accent")||"#f4b740"),focus:(o,s)=>this.controller.focusSection(o,s),focusSeats:o=>this.controller.focusSeats?.(o,{animate:!t})===!0,reducedMotion:t,screenPoint:o=>this.controller.worldToScreen(o),schedule:(o,s)=>this.scheduleMotion(o,s)},n)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(n=>n.id!==e&&n.id!==t)}pendingSelectionCount(){return Da(this)}heldTicketCount(){return Ba(this)}totalTicketCount(){return Fa(this)}updateSelectionCapacity(){Va(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){za(this,e,t)}setCtaPhase(e){$a(this,e)}runCheckoutHandoff(e,t){return ja(this,e,t)}holdStorageKey(){return Ga(this)}rememberedHoldId(){return Ua(this)}rememberHold(e){qa(this,e)}forgetHold(){Ka(this)}resumeHoldFromServer(e){return Wa(this,e)}restoreRememberedHold(){return Ya(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let n=this.controller.getActiveFloorId();return(t.find(o=>o.id===n)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=qr({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return un(this,e)}catPriceRange(e){return mn(this,e)}buildPriceFilter(){sl(this)}applyPriceBand(e){rl(this,e)}buildArenaChrome(){let e=this.controller.doc;if(this.rungsEl=null,this.projectionEl=null,this.floorsEl=null,!e||!this.els.map){this.syncArenaViewportInsets();return}let t=e.objects.some(n=>n.type==="section")||(e.floors??[]).some(n=>n.objects.some(o=>o.type==="section"));if(this.canOffer3d()){let n=document.createElement("div");n.className="sl-projection",n.setAttribute("role","group"),n.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),n.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>`,n.querySelectorAll("button").forEach(o=>{if(o.dataset.view==="venue3d")for(let s of["pointerenter","focus","pointerdown"])o.addEventListener(s,ki,{once:!0});o.addEventListener("click",()=>{this.setBuyerView(o.dataset.view)})}),this.regions["top-right"].appendChild(n),this.projectionEl=n,this.syncProjection()}if(t){let n=[...e.objects,...(e.floors??[]).flatMap(d=>d.objects)],o=new Set((e.zones??[]).map(d=>d.id)),a=e.floorOverview==="combined"&&(e.floors?.length??0)>1&&o.size===0||n.some(d=>d.type==="section"&&typeof d.zone=="string"&&o.has(d.zone))?["zones","sections","seats"]:["sections","seats"],l=document.createElement("div");l.className="sl-rungs on sl-mo-indicator",l.setAttribute("role","group"),l.setAttribute("aria-label",(0,R.t)("picker.zoomLevel"));let c={zones:(0,R.t)("picker.rungLabel.zones"),sections:(0,R.t)("picker.rungLabel.sections"),seats:(0,R.t)("picker.rungLabel.seats")},h={zones:(0,R.t)("picker.rungTip.zones"),sections:(0,R.t)("picker.rungTip.sections"),seats:(0,R.t)("picker.rungTip.seats")};l.innerHTML=a.map(d=>`<button type="button" data-rung="${d}" title="${h[d]}" aria-pressed="false">${c[d]}</button>`).join(""),l.querySelectorAll("button").forEach(d=>{d.addEventListener("click",()=>{let u=d.dataset.rung;this.controller.setRung(u),u==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(l),this.rungsEl=l,this.syncRung()}if(this.controller.isMultiFloor()){let n=fr({floors:this.controller.getFloors(),tf:(o,s)=>this.tf(o,s),onChoose:o=>{o===""?this.controller.setFloorOverview(!0):this.controller.setFloor(o),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});this.regions["top-left"].appendChild(n),this.floorsEl=n,this.syncFloors()}this.syncArenaViewportInsets()}syncArenaViewportInsets(){let e=this.els.map,t=e?mr(e.getBoundingClientRect(),[this.floorsEl,this.rungsEl,this.projectionEl].map(n=>n?.isConnected?n.getBoundingClientRect():null),this.root?.dataset.layout==="narrow"&&this.els.zoom?.isConnected?[this.els.zoom.getBoundingClientRect()]:[]):{top:0,right:0,bottom:0,left:0};Object.keys(t).every(n=>t[n]===this.arenaViewportInsets[n])||(this.arenaViewportInsets=t,this.controller.setViewportInsets(t))}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.syncMapStepBack(),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(n=>{let o=n.dataset.rung===e;n.classList.toggle("on",o),n.setAttribute("aria-pressed",String(o))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit,n=this.els?.zin;if(!e||!this.root)return;let o=this.controller.getRenderer?.(),s=this.controller.canZoomIn?.()===!1||o?.seatsPickable?.()===!0,r=ur({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0,atVenueFit:this.controller.atVenueFit?.()})==="none",a=e.hidden!==r||!!t&&t.hidden!==r||!!n&&n.hidden!==s;e.hidden=r,n&&(n.hidden=s),t&&(t.hidden=r),e.disabled&&(e.disabled=!1),t?.disabled&&(t.disabled=!1),a&&this.a11yMenu?.refit()}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?this.tf("picker.priceHint3d","Colours in the venue are ticket types \u2014 choose one below to show just those seats."):this.tf("picker.priceHint","Colours on the map are ticket types \u2014 tap one below to show just those seats.")),this.projectionEl&&this.projectionEl.querySelectorAll("button").forEach(e=>{let t=e.dataset.view===this.buyerView;e.classList.toggle("on",t),e.setAttribute("aria-pressed",String(t))})}canOffer3d(){return this.opts.enable3D===!1||!this.controller.doc||!Si()?!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)?Sl/2:Sl}syncFloors(){gr(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new sn({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(o=>o.type==="section"&&!this.controller.isSectionClosed(o.id)&&this.controller.getSectionSeatCount(o.id)>0);if(t.length<2)return null;let n=t.findIndex(o=>o.id===e);return n<0?null:{previous:t[(n-1+t.length)%t.length],next:t[(n+1)%t.length]}}markedSeatAnnouncement(e){let t=Qn(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return Cr(t,e.displayLabel??e.label,this.opts.locale)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.markedSeatAnnouncement(e);if(t){this.srEl.textContent=t;return}let n=this.controller.doc?.categories.find(p=>p.key===e.categoryKey),o=this.controller.getStatus(e.id)??"free",s=o==="free"?this.tf("picker.statusAvailable","available"):o==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),r=n?this.catPriceRange(n):void 0,a=!this.suppressPricing&&r?r.min===r.max?this.money(r.min):`${this.money(r.min)}\u2013${this.money(r.max)}`:void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),h=ot(c),d=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,u=l?`${h} ${d}, ${l.bookingMode==="variable"?(0,R.t)("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):(0,R.t)("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${h} ${d}`:c?.objectType==="table"?`${h} ${d}, ${(0,R.t)("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:(0,R.t)("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${u}, ${n?.label??e.categoryKey}${a?`, ${a}`:""}, ${s}`}showTableDialog(e,t,n){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=n??document.activeElement;let o=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),s=e.bookingMode==="variable",r=document.createElement("div");r.className="sl-table-scrim",r.innerHTML=ss(e,{variable:s,held:t,typeWord:ot(e),categoryLabel:o?.label??e.categoryKey,suppressPricing:this.suppressPricing,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(r),this.tableDialogEl=r,this.renderTableDialogState(),r.querySelectorAll("[data-table-step]").forEach(a=>{a.addEventListener("click",()=>{if(!this.tableDialog)return;let l=Math.max(this.tableDialog.minOccupancy,Math.min(this.tableDialog.maxOccupancy,this.tableDialog.quantity+Number(a.dataset.tableStep)));this.tableDialog={...this.tableDialog,quantity:l},this.renderTableDialogState()})}),r.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),r.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),r.addEventListener("mousedown",a=>{a.target===r&&this.cancelTableDialog()}),r.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...r.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!l.length)return;let c=l[0],h=l[l.length-1];a.shiftKey&&document.activeElement===c?(a.preventDefault(),h.focus()):!a.shiftKey&&document.activeElement===h&&(a.preventDefault(),c.focus())}),requestAnimationFrame(()=>r.querySelector(s?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let n=t.querySelector("output[data-table-qty]");n&&(n.value=String(e.quantity));let o=t.querySelector("input[data-table-qty]");o&&(o.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let s=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),r=t.querySelector("[data-table-total]");r&&(r.textContent=this.money(s*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let n=this.tableDialogEl?.querySelector(".sl-table-confirm");if(n&&(n.disabled=!0,n.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let o=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!o){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},this.startHoldTimer(o.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,R.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(o){this.opts.onError?.(o),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){n&&(n.disabled=!1,n.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new cn({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),paidPrice:(e,t,n,o)=>this.paidPrice(e,t,n,o),suppressPricing:()=>this.suppressPricing,reducedMotion:()=>this.reducedMotion(),scheduleMotion:(e,t)=>this.scheduleMotion(e,t),canOffer3d:()=>this.canOffer3d(),buyerView:()=>this.buyerView,view3dHandle:()=>this.view3dHandle,view3dCompareSeatIds:()=>this.view3dCompareSeatIds,rememberView3dReturnSeat:e=>{this.view3dReturnSeat=e},enter3d:e=>{this.enter3d(e)},performanceGroup:()=>this.performanceGroup,seatViewEnabled:()=>this.seatViewEnabled(),openSeatView:e=>{this.openSeatView(e)},openSeatConfidencePassport:(e,t)=>this.openSeatConfidencePassport(e,t),saveView3dComparisonSeat:e=>this.saveView3dComparisonSeat(e),resolveAssetUrl:e=>this.buyerAssetUrls.resolve(e),onError:e=>this.opts.onError?.(e),liftToastOverConfirm:()=>this.liftToastOverConfirm(),fitTranslatedRows:()=>this.fitTranslatedRows(),syncTray:()=>this.syncTray(),syncSelectionTo3d:()=>this.syncSelectionTo3d(),collapseSectionCard:()=>this.collapseSectionCard(),applyPanelCollapsed:()=>this.applyPanelCollapsed(),dismiss:()=>this.dismissConfirm(),reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e),cartLanded:()=>this.cartLanded()})),this.confirmCardCache}showConfirm(e,t="add"){this.confirmCard.show(e,t)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}cartLanded(){this.animateOnce(this.els.count,"sl-value-pop",380),this.animateOnce(this.els.total,"sl-value-pop",380)}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){jr(e,t,this.reducedMotion())}addSeatLabel(e){return Gr(e,(t,n)=>this.tf(t,n))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,n=this.controller.doc,o=this.controller.getActiveFloorId(),s=e.focalPoint??n?.floors?.find(d=>d.id===o)?.focalPoint??n?.focalPoint??{x:0,y:0},r,a,l=!1;if(e.viewUrl){let d,u=null;try{let g=e.viewMeta?.previewUrl;g&&g!==e.viewUrl?(u=await this.buyerAssetUrls.resolve(g),d=e.viewUrl):d=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(g){t===this.seatViewGen&&this.opts.onError?.(g);return}if(t!==this.seatViewGen||!d||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!u||!this.root||!this.seatViewEnabled())return;let p={url:d,...u?{previewUrl:u}:{},...e.viewMeta?.sourceWidth!==void 0?{sourceWidth:e.viewMeta.sourceWidth}:{},...e.viewMeta?.sourceHeight!==void 0?{sourceHeight:e.viewMeta.sourceHeight}:{},...e.viewMeta?.previewWidth!==void 0?{previewWidth:e.viewMeta.previewWidth}:{},...e.viewMeta?.previewHeight!==void 0?{previewHeight:e.viewMeta.previewHeight}:{},...e.viewMeta?.variants?.length?{variants:e.viewMeta.variants}:{},...e.viewMeta?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};r=p,a=(0,xn.seatViewDisclosure)(p),l=(0,xn.isAuthoredSeatView)(p)}else{let d;try{let{generateSeatPanorama:u}=await Ti();d=u(e,s,this.allSeats())}catch(u){t===this.seatViewGen&&this.opts.onError?.(u);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;r={url:d.url,generated:!0},a=(0,R.t)("picker.illustrationCaption",{m:d.distanceM})}this.closeSeatView(!1);let c=(0,R.t)("picker.viewFromSeat",{label:e.label}),h=ji({root:this.root,source:r,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:Je(),viewFromSeatLabel:c,real360Label:(0,R.t)("picker.real360"),previewLabel:(0,R.t)("picker.preview"),resolveAsset:d=>this.buyerAssetUrls.resolve(d),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 n=Number.isInteger(e);return(0,R.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(o,s)=>`${o} ${s}`,...n?{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(),n=hr(e,t);if(n==null)return;let o=6*36e5,s=Math.min(Math.max(n-t+1e3,1e3),o);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},s)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<Mp}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||this.offerReadIsCurrent()||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}refreshOfferAvailability(e){if(!this.api.availability||this.destroyed)return Promise.resolve();if(this.offerReadInFlight)return this.offerReadInFlight;if(this.offerReadIsCurrent())return Promise.resolve();let t=this.readOfferAvailability(e).finally(()=>{this.offerReadInFlight===t&&(this.offerReadInFlight=null)});return this.offerReadInFlight=t,t}async readOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;this.offerReadSettledAt=Date.now();let n=nn(t);if(!n)return;this.offerAvailability=n,this.applyChannelPricing(n.channelPricing),this.scheduleOfferBoundary(n);let o=on(n),s={...this.hostPricing?.prices??{},...o},r=Object.keys(s).length>0||this.hostPricing?.formatter?{prices:s,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(r),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(n)}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;if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,n=t?.release??null,o=n?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!n&&!o){e.classList.remove("has"),e.replaceChildren();return}let s=n??o,r=document.createElement("div");r.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=n?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=s.name||(n?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));let h=document.createElement("span");h.className="sl-offer-line";let d=[];n&&t.fromPrice!=null&&d.push(this.money(t.fromPrice/100)),n&&s.remaining!=null&&d.push((0,R.t)("picker.offerRemainingAvailable",{count:s.remaining})),n&&s.endsAt!=null&&d.push((0,R.t)("picker.offerUntil",{time:Ci(s.endsAt,this.eventTimezone,this.opts.locale)})),o?.startsAt!=null&&d.push((0,R.t)("picker.offerStarts",{time:Ci(o.startsAt,this.eventTimezone,this.opts.locale)})),h.textContent=d.join(" \xB7 "),a.append(l,c,h);let u=document.createElement("details");u.className="sl-offer-info";let p=document.createElement("summary");p.setAttribute("aria-label",(0,R.t)("picker.howOfferWorks",{name:c.textContent??""})),p.textContent="i";let g=document.createElement("div");g.className="sl-offer-detail",g.textContent=n?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."),u.append(p,g),r.append(a,u),e.replaceChildren(r),e.classList.add("has")}paidPrice(e,t,n,o){let s=o?this.channelByObject.get(o):void 0;if(s&&e){let a=this.pricesByChannel.get(s)?.find(l=>l.categoryKey===e&&l.tierId===(t??null));if(a)return a.price}let r=e?this.opts.pricing?.prices?.[e]:void 0;return r===void 0?n:typeof r=="number"?r:t&&r.tiers?.[t]!==void 0?r.tiers[t]:r.base??n}legendDeps(){return al(this)}syncPriceRail(e,t,n=this.legendDeps()){ll(this,e,t,n)}syncPrices(){cl(this)}focusCategory(e){dl(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(n=>!e.has(n.label)&&(this.controller.getStatus(n.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(n=>n.id)),this.toast((0,R.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:n,heldLabels:o,total:s,count:r}=hn(this),a=[],l=new Set;if(!this.salesClosed){let f=this.performanceGroup?.nightSummary?.()??[];f.length&&a.push(wr(f,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let L=this.performanceGroup?.selectionModeSwitch;L&&a.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${D(L.label)}</button>`)}let c={salesClosed:this.salesClosed,hasPicks:e.length>0||n.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(f=>f.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(Ha(c)),this.els.trayHint&&(this.els.trayHint.textContent=Ra(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed);let h=!e.length&&!n.length&&!ze(this.gaQty,this.hold?.items??[]);if(!this.performanceGroup&&!this.salesClosed&&!this.hold&&(h||this.bestAvailableBusy||this.bestAvailableConfirm)){let f=(this.controller.doc?.categories??[]).filter(A=>!A.notForSale),L=this.controller.getBestAvailableZones();this.baZone&&!L.some(A=>A.id===this.baZone)&&(this.baZone=""),a.push(Ma({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:!1,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:f,zones:L,selectedCategory:this.baCat,selectedZone:this.baZone}))}let d=(f,L,A,E=1,I,_,N)=>Pa({categoryLabel:N,d:f?this.controller.seatDetails(f):null,area:A==="ga"?t.find(W=>W.id===I):void 0,label:L,objectType:A,quantity:E,identity:_,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),u=D,p=[];for(let f of Ps(n)){let L=f.objectType==="ga"?`held:ga:${f.objectId}:${f.tierId??""}`:`held:${f.label}`;l.add(L);let A=this.controller.doc?.categories.find(Y=>Y.key===f.categoryKey),E=f.tierId?A?.tiers?.find(Y=>Y.id===f.tierId)?.name:void 0,I=f.objectType!=="ga"?this.controller.seatByLabel(f.label):null,_=f.objectType==="table"?this.controller.tableSelection(f.label):null,N=I?this.controller.seatDetails(I.id):null,W=this.seatViewEnabled()&&!!I&&f.objectType!=="table"&&!!this.deliverableViewReference(I),te=u(this.tf("picker.heldForYou","Held for you")),Te=_?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(f.label))}">${u((0,R.t)("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"",fe=this.paidPrice(f.categoryKey,f.tierId,f.unitPrice,f.label)*(f.quantity??1);p.push({key:L,fresh:!this.lastTrayKeys.has(L),held:!0,seatIds:[],heldLabels:f.labels,removeAria:(0,R.t)("picker.removeHeldTicketLabel",{label:Fn(f,t)}),locateId:I?.id??null,section:N?.sectionLabel??"",rowLabel:N&&Z(N)||"",seatLabel:N?.seatNumber??f.label,categoryLabel:`${A?.label??f.categoryKey}${E?` \xB7 ${E}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??A?.color??"",identityHtml:d(I?.id??null,f.label,f.objectType,f.quantity??1,f.objectId,_??void 0,`${A?.label??f.categoryKey}${E?` \xB7 ${E}`:""}`),stateHtml:`<span class="sl-ticket-state held" aria-label="${te}" title="${te}"><svg viewBox="0 0 24 24"><rect x="5" y="10" width="14" height="10" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg></span>`,extrasHtml:Te,amount:fe,amountText:this.suppressPricing?"":this.money(fe),noteHtml:et(I??void 0),railHtml:this.performanceGroup?"":lo((0,R.t)("picker.removeHeldTicketLabel",{label:Fn(f,t)}),W?f.label:null)})}let g=this.seatViewEnabled();for(let f of e.filter(L=>!o.has(L.label))){let L=`seat:${f.id}`;l.add(L);let A=this.controller.doc?.categories.find(Y=>Y.key===f.categoryKey),E=f.tiers&&f.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${u(f.id)}" aria-label="${u((0,R.t)("picker.ticketTierFor",{label:f.label}))}">`+f.tiers.map(Y=>`<option value="${u(Y.id)}"${Y.id===f.tierId?" selected":""}>${u(Y.name)} \xB7 ${u(this.money(this.paidPrice(f.categoryKey,Y.id,Y.price,f.label)))}</option>`).join("")+"</select>":"",I=f.tiers?.find(Y=>Y.id===f.tierId)??f.tiers?.[0],_=I?.buyerMessage?.trim()||(I?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),N=this.controller.seatDetails(f.id),W=u(this.tf("picker.selected","Selected")),te=(0,R.t)("picker.removeSeatLabel",{label:f.label}),Te=(f.objectType==="table"&&f.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(f.label))}">${u((0,R.t)("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"")+E,fe=this.paidPrice(f.categoryKey,f.tierId??null,f.price,f.label)*(f.quantity??1);p.push({key:L,fresh:!this.lastTrayKeys.has(L),held:!1,seatIds:[f.id],heldLabels:[],locateId:f.id,section:N?.sectionLabel??"",rowLabel:N&&Z(N)||"",seatLabel:N?.seatNumber??f.label,categoryLabel:A?.label??f.categoryKey,identityHtml:d(f.id,f.label,f.objectType,f.quantity??1,f.objectId,f,A?.label??f.categoryKey),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??A?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${W}" title="${W}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:Te,amount:fe,amountText:this.suppressPricing?"":this.money(fe),removeAria:te,noteHtml:et(f)+(_?`<small class="sl-tier-note">${u(_)}</small>`:""),railHtml:lo(te,g&&f.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(f.label)??{})?f.label:null)})}p.length&&a.push(p.map(La).join("")),t.length&&a.push(Is(this,t,n)),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let y=this.performanceGroup?.selectNight;y&&Hr(this.els.tray,f=>y(f)),this.els.tray.querySelectorAll("[data-ba]").forEach(f=>{f.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(f.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",f=>{this.baCat=f.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",f=>{this.baZone=f.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelectorAll(".sl-chip .rm").forEach(f=>{f.addEventListener("click",()=>{let L=f.closest(".sl-chip");if(L.dataset.held){this.removeHeldLabels(decodeURIComponent(L.dataset.held).split(`
|
|
3146
|
+
`),L);return}let A=L.dataset.seat.split(" "),E=()=>{this.controller.deselect(A)};if(this.reducedMotion()){E();return}L.classList.remove("sl-enter"),L.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(E,J.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(f=>{f.addEventListener("click",L=>{L.stopPropagation();let A=decodeURIComponent(f.dataset.tableEdit??""),E=this.controller.tableSelection(A);if(!E)return;let I=n.find(_=>_.label===A&&_.objectType==="table");this.showTableDialog({...E,quantity:I?.quantity??E.quantity},!!I,f)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(f=>{f.addEventListener("change",()=>this.controller.setSeatTier(f.dataset.tier,f.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(f=>{f.addEventListener("click",()=>{let L=this.controller.seatByLabel(f.dataset.viewLabel);L&&this.openSeatView(L)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(f=>{let L=()=>this.controller.flashSeat(f.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");f.addEventListener("mouseenter",L),f.addEventListener("focusin",L),f.addEventListener("click",A=>{A.target.closest?.('button,a,select,[role="button"],input')||!this.controller.focusSeats?.([f.dataset.locate],{animate:!this.reducedMotion()})||(L(),this.root?.dataset.layout==="narrow"&&this.setSheetState("mini"))})}),Os(this,this.els.tray,t),this.controller.setGASelection(Es(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(f=>{f.disabled=!0});let T=this.pendingSelectionCount(),S=this.lastTrayCount,v=this.lastTrayTotal,P=Mr(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");this.els.count.textContent=P||(r?(0,R.tCount)("picker.ticketsCount",r):this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=r&&!this.suppressPricing?this.money(s):"",this.root?.setAttribute("data-has-selection",String(r>0)),this.sheetState()==="mini"&&r===0?this.setSheetState("mini"):r>S&&this.root?.dataset.layout==="narrow"?this.setSheetState("mini"):this.syncSheetAffordance(),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy)),this.els.seatSummary&&(this.els.seatSummary.textContent=P||(r?(0,R.tCount)("picker.seatsSelectedCount",r):"")),this.syncCta(r,T);let U=this.root?.dataset.layout==="narrow"&&this.root?.dataset.confirming==="true";r!==S&&!U&&this.animateOnce(this.els.count,"sl-value-pop",380),s!==v&&!U&&this.animateOnce(this.els.total,"sl-value-pop",380),S===0&&r>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.lastTrayCount=r,this.lastTrayTotal=s,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(r,e),this.scheduleFit()}scheduleFit(){if(this.fitScheduled||this.destroyed)return;this.fitScheduled=!0;let e=()=>{this.fitScheduled=!1,this.destroyed||this.fitTranslatedRows()};typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}fitTranslatedRows(){rr(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(ar),this.els.tray?.querySelectorAll(".sl-ba-go").forEach(lr)}emitSelectionValidity(e,t){let n=this.controller.getSelectionValidity(e);n&&(n.seats=t,this.opts.onSelectionValidityChange?.(n),n.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(n),this.lastSelectionValidity=n.isValid)}async removeHeldLabels(e,t){let n=e.filter(r=>r&&!this.releasingLabels.has(r));if(!n.length)return!1;let o=n[0];n.forEach(r=>this.releasingLabels.add(r)),t?.setAttribute("aria-busy","true");let s=t?.querySelector(".rm");s&&(s.disabled=!0);try{let r=this.handedOff;if(!await this.controller.releaseLabels(n))return this.toast((0,R.t)("picker.couldNotRemoveLabel",{label:o}),"error"),!1;Ls(this.gaQty,this.hold?.items??[],n);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&&r,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),!0}finally{n.forEach(r=>this.releasingLabels.delete(r)),t?.removeAttribute("aria-busy"),s?.isConnected&&(s.disabled=!1)}}async handleCta(){if(this.salesClosed)return;let e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(gn(e,(n,o)=>this.tf(n,o)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast((0,R.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(n=>!(this.hold.items??[]).some(o=>o.label===n.label))){let n=this.hold.seats??t;this.handedOff=!0,this.holdConflicted=!1,await this.runCheckoutHandoff(this.hold,n);return}this.holdingLabels=new Set(t.map(n=>n.label)),this.setCtaPhase("holding");try{let n=null,o=Ts(this.gaQty),s=this.committedSelection();if(s.length){let r=await this.controller.hold(void 0,this.opts.holdTtlMs);n=r?{holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items}:null}for(let{areaId:r,tierId:a,qty:l}of o){let c=await this.controller.holdGA(r,l,{tierId:a,ttlMs:this.opts.holdTtlMs});n=c?{holdId:c.holdId,expiresAt:c.expiresAt,seats:c.seats,items:c.items}:n}if(!n){this.raiseHoldConflict(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.")),this.setCtaPhase("idle"),this.syncTray();return}this.hold=n,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(n.expiresAt),this.flashHeldSeats(n),this.emitHoldChange(),this.performanceGroup?this.setCtaPhase("idle"):await this.runCheckoutHandoff(n,n.seats??s)}catch(n){this.opts.onError?.(n);let o=n,s=(o.conflicts??[]).map(a=>a.label).filter(Boolean).slice(0,3);o.reason==="event_closed"&&this.setSalesClosed(!0);let r=o.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):o.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):o.reason==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s.length?s.length===1?(0,R.t)("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):(0,R.t)("picker.labelsNoLongerAvailable.other",{labels:s.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(r),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){Xa(this,e)}stopHoldTimer(){Za(this)}setExtendPrompt(e,t){Qa(this,e,t)}refreshExtendPrompt(){Ja(this)}handleExtend(){return el(this)}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.controller.currentHold()===null&&(this.holdConflicted||this.showBooked())}raiseHoldConflict(e){this.holdConflicted=!0,this.bookedShown&&(this.bookedShown=!1,this.bookedEl?.classList.remove("on")),this.toast(e,"error")}showBooked(){if(this.bookedShown||!this.hold||this.holdConflicted)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((o,s)=>o+s.quantity,0),n=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=n?.seats?`<span class="sl-booked-seats">${(0,R.tCount)("picker.group.ticketsConfirmedAcross",n.seats,{performances:n.performances})}</span>`:`<span class="sl-booked-seats">${(0,R.tCount)("picker.ticketsCount",t)}</span> ${this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way.")}`),this.els.bookedList&&(this.els.bookedList.innerHTML=e.lineItems.map(o=>{let r=[o.sectionLabel,o.rowLabel&&`${this.tf("picker.row","Row")} ${o.rowLabel}`,o.seatNumber&&`${this.tf("picker.seat","Seat")} ${o.seatNumber}`].filter(Boolean).join(" \xB7 ")||o.displayLabel||o.label,a=o.quantity>1?` <span class="sl-booked-qty">\xD7${o.quantity}</span>`:"";return`<li>${D(r)}${a}</li>`}).join(""),this.els.bookedList.hidden=e.lineItems.length===0),this.bookedEl?.classList.add("on"),requestAnimationFrame(()=>this.bookedEl?.querySelector(".sl-booked-back")?.focus()),this.opts.onBooked?.(e)}dismissBooked(){this.bookedEl?.classList.remove("on"),this.resetAfterBooking(),this.root?.focus({preventScroll:!0})}resetAfterBooking(){this.bookedShown=!1,this.hold=null,this.handedOff=!1,this.holdConflicted=!1,this.holdingLabels.clear(),this.gaQty.clear(),this.stopHoldTimer(),this.forgetHold(),this.clearSelection(),this.setCtaPhase("idle"),this.setSheetOpen(!1),this.syncTray(),this.syncCta(),this.emitHoldChange()}notifyGroupSettled(e){e==="booked"?this.showBooked():this.dismissConfirm(),this.hold=null,this.handedOff=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.forgetHold(),this.syncTray(),this.syncCta()}async checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){await this.startHostedCheckout(e,t);return}await this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let n=this.buildHandoff(e),o=null;try{o=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(r){this.opts.onError?.(r)}if(this.destroyed)return;let s=o?.providers?.[0];if(!s){let r=qo(o?.reason),a=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:r,handoff:n}),this.opts.onCheckout?.(e,t,n),a||this.openCheckoutPanel({kind:"unavailable",reason:r,seatCount:n.lineItems.reduce((l,c)=>l+c.quantity,0)});return}await this.openCheckoutPanel({kind:"pay",provider:s,order:{holdId:n.holdId,expiresAt:n.expiresAt,currency:n.currency,total:n.total,labels:n.lineItems.map(r=>r.displayLabel??r.label)}})}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await Ei())}catch(n){this.opts.onError?.(n),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,eventKey:this.opts.event,formatMoney:n=>this.money(n),startSession:n=>this.pubApi.startCheckout(this.opts.event,{...n,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:n=>this.pubApi.orderStatus(n),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:n=>{this.opts.onOrderConfirmed?.(n),this.controller.refresh()},onError:n=>this.opts.onError?.(n)}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let n=(e.items??[]).map(r=>{let a=this.controller.lineItemDisplay(r);return{label:r.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},objectId:r.objectId,objectType:r.objectType,categoryKey:r.categoryKey,tierId:r.tierId,unitPrice:this.paidPrice(r.categoryKey,r.tierId,r.unitPrice,r.label),currency:r.currency??this.currency,quantity:r.quantity??1}}),o=n[0]?.currency??this.currency,s=n.reduce((r,a)=>r+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:o,lineItems:n,total:s}}emitHoldChange(){let e=this.hold;this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",n){let o=this.els.toast;if(!o)return;o.replaceChildren();let s=document.createElement("span");if(s.textContent=e,o.appendChild(s),o.classList.toggle("has-action",!!n),n){let r=document.createElement("button");r.type="button",r.className="sl-toast-action",r.textContent=n.label,r.addEventListener("click",n.onClick,{once:!0}),o.appendChild(r)}o.dataset.tone=t,o.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{o.classList.remove("on","sl-mo-rise"),o.classList.remove("has-action"),o.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),n=this.confirmEl;if(!t||!n?.isConnected){e.style.removeProperty("bottom");return}let o=this.els.map.clientHeight;if(o<=0)return;let s=n.getBoundingClientRect(),r=s.height||n.offsetHeight||Ip,a=s.height?s.top-this.els.map.getBoundingClientRect().top:o-eo-r,l=Math.round(o-a+Hp);if(l+Rp>o){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){Xr({boot:this.els.boot,map:this.els.map,rail:this.els.rail,root:this.root,reducedMotion:this.reducedMotion()})}placeTooltip(){if(!this.tipEl)return;let e={width:this.els.map.clientWidth,height:this.els.map.clientHeight},t={width:this.tipEl.offsetWidth,height:this.tipEl.offsetHeight},n=this.tipPinned?_r(this.tipPos,e,t):null,o=n??Or(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${o.left}px`,this.tipEl.style.top=`${o.top}px`,n?this.tipEl.dataset.placement=n.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let n=this.performanceGroup,o=Qn(e.mark,n?.nights?.()),s=o?.states.filter(r=>r.free).length??0;return xr(o,{locale:this.opts.locale,switchLabel:n?.selectionModeSwitch?.label??null,selectPartialLabel:n?.partialSeatSelection?.label(s)??null,pinned:t})}unpinTooltip(){this.tipPinned&&(this.tipPinned=!1,this.tipEl?.classList.remove("sl-tip-pinned"),this.tipEl&&(this.tipEl.style.display="none"))}handleMapPointerDown(e){if(this.tipEl?.contains(e.target))return;this.lastMapPoint={x:e.clientX,y:e.clientY},this.lastPointerType=e.pointerType||"mouse";let t=this.els.map.getBoundingClientRect();this.tipPos={x:e.clientX-t.left,y:e.clientY-t.top},this.unpinTooltip()}closeInfoPops(e){this.root?.querySelectorAll(".sl-info.open").forEach(t=>{t!==e&&(t.classList.remove("open"),t.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false"))})}updateTooltip(e){if(!this.tipEl)return;if(this.confirmSeat){this.tipEl.style.display="none";return}if(this.tipPinned&&e?.interaction!=="press")return;if(!e){this.tipPinned||(this.tipEl.style.display="none",this.tipMarkedHoverLabel=null);return}let t=e.mark?.kind==="partial"&&this.tipMarkedHoverLabel===e.label;if(e.interaction!=="press"&&this.lastPointerType==="mouse"&&!e.mark&&!this.tipPinned){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}if(e.unavailable&&e.status==="free"&&e.interaction==="press"){this.toast(this.tf("picker.turnOffAccessibilityFilter","Turn off the wheelchair filter to pick this seat"),"neutral"),this.tipEl.style.display="none";return}if(e.unavailable&&!e.mark){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}let n=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t);this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let o=this.nightStripFor(e,n);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=Ir(e,{price:this.suppressPricing?"":this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label)),priceNote:this.suppressPricing?this.performanceGroup?.surface==="season"?this.tf("picker.season.includedInPackage","Included in the Season package"):this.tf("picker.group.pricesPerPerformance","Prices shown per performance"):"",rowTypeWord:ot(e),extra:o+(n?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${D(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=n,this.tipEl.classList.toggle("sl-tip-pinned",n),this.tipEl.querySelector("[data-pg-tip-close]")?.addEventListener("click",()=>this.unpinTooltip()),this.tipEl.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>{this.unpinTooltip(),this.performanceGroup?.selectionModeSwitch?.activate()}),Br(this.tipEl,this.performanceGroup?.partialSeatSelection?.label,s=>{this.unpinTooltip(),this.performanceGroup?.partialSeatSelection?.activate(e.id,s)}),this.tipEl.style.display="block",this.placeTooltip()}syncSeatMarks(){let e=this.performanceGroup?.seatMarks,t=this.controller.getRenderer();if(!e||!t?.setSeatMarks)return;let n={};for(let[o,s]of Object.entries(e())){let r=this.controller.idForLabel(o);r&&(n[r]=s)}Object.keys(n).length&&t.setSeatMarks(n)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),n=this.controller.getSelection().filter(o=>t.has(o.id)||t.has(o.label));if(n.length===t.size)return n;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){let e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e),this.applyMapChromeTokens(),this.minimap?.refreshMinimap())}applyThemeTokens(e){let t=Zt(this.themeMode),n=Tt(this.controller.doc?.theme,this.opts.theme,t);for(let[o,s]of Object.entries(n))e.style.setProperty(o,s);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=Hi(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(kt(this.opts.theme,this.themeMode)),this.applyMapChromeTokens(),this.minimap?.refreshMinimap(),this.syncPrices())}setThemeMode(e){this.destroyed||e===this.themeMode||(this.themeMode=e,this.opts.theme={...this.opts.theme??{},...e?{mode:e}:{mode:void 0}},this.watchThemeMode(),this.repaintForThemeMode(),this.emitAnalytics("theme_mode_changed",{mode:e,resolved:Zt(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Zt(this.themeMode),n=Tt(this.controller.doc?.theme,this.opts.theme,t),o=kt(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,s=us(n,o);for(let r of hs)s?e.style.setProperty(r,s[r]):e.style.removeProperty(r)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){let t=JSON.stringify(this.opts.pricing??null),n=JSON.stringify(e??null);t!==n&&(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){this.langSel=bs(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=(0,R.getLocale)(),n=this.localeGeneration+=1,o=await(0,R.loadLocale)(e);return this.opts.messages&&(0,R.setStringOverrides)(this.opts.messages),o===t||this.applyActiveLocale(o,n),o}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(ys(e,{root:this.root,painters:[()=>this.syncTray(),()=>this.syncPrices(),()=>this.syncOffer(),()=>this.syncRung(),()=>this.syncFloors(),()=>this.syncPanelToggle(),()=>this.syncFullscreenButtons()],refreshMapCopy:()=>this.controller.refreshMapCopy(),languageSelect:this.langSel}),this.scheduleFit())}isColorblindSafe(){return this.cbSafe}setColorblindSafe(e){e!==this.cbSafe&&(this.cbSafe=e,this.cbEl?.setAttribute("aria-pressed",String(e)),this.controller.setColorblindSafe(e),this.syncPrices(),this.minimap?.refreshMinimap(),_p(e))}setViewMode(e){this.controller.setViewMode(this.normalizeInitialView(e)),this.syncProjection(),this.dismissConfirm()}getViewMode(){return this.controller.getViewMode()}normalizeInitialView(e){return e==="perspective"?(this.perspectiveWarned||(this.perspectiveWarned=!0,console.warn("[seatlayer] initialView:'perspective' (2.5D) is deprecated for the buyer picker and was coerced to 'flat'. Use the Map | 3D control for the immersive view.")),"flat"):e??"flat"}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,t??{})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}getBuyerView(){return ha(this)}setBuyerView(e,t){ua(this,e,t)}seatState3dFor(e){return ma(this,e)}pushAvailabilityTo3d(){fa(this)}syncSelectionTo3d(){ga(this)}seatViewFor3d(e){return ba(this,e)}onView3dSeatPick(e){ya(this,e)}seatViewCaption(e){return va(this,e)}saveView3dComparisonSeat(e){wa(this,e)}clearView3dComparison(){xa(this)}view3dComparisonSnapshot(e){return Sa(this,e)}enter3d(e){return ka(this,e)}publish3dTopInset(){Ta(this)}exit3d(){Ea(this)}openSeatConfidencePassport(e,t=null){ro(this,e,t)}closeSeatConfidencePassport(e=!0){ai(this,e)}openView3dComparison(){aa(this)}closeView3dComparison(e=!0){rt(this,e)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e)}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,n={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,n)}catch(o){this.opts.onError?.(o);let s=o?.reason,r=s==="not_enough_together"?(0,R.t)("picker.couldNotFindSeatsTogether",{count:e}):s==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):s==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):s==="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(r,"error"),null}}async bestAvailableOrThrow(e,t,n={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let o=this.els.tray?.querySelector(".sl-ba-go");o&&(o.disabled=!0,o.classList.add("sl-busy"),o.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let s=await this.controller.bestAvailable(e,t,{...n,ttlMs:this.opts.holdTtlMs});return s?(this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(s.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),n.preferPremium&&s.seats.length&&!s.seats.every(r=>r.commercial?.premium)&&this.toast((0,R.t)("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),n=!0;if(t)n=await this.controller.release();else if(e){let o=[...new Set([...(e.items??[]).map(s=>s.label),...(e.seats??[]).map(s=>s.label)])];if(o.length)try{await this.api.release(this.opts.event,o,e.holdId)}catch(s){this.opts.onError?.(s),n=!1}}if(!n){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 Ee({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:vt(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,n)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:n}),this.syncTray(),this.toast(n==="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)}clearDecisionSurfaces(){this.dismissConfirm(),this.dismissTableDialog(!1),Ce(this,!1)}showAccessPanel(e){if(this.destroyed||!this.root)return;this.dismissAccessPanel(),this.clearDecisionSurfaces();let t=rs(e.reason,()=>this.recoverAccess());(this.root.querySelector(".sl-body")??this.root).appendChild(t),this.accessEl=t}async recoverAccess(){return await this.refreshAccess()?!0:(this.opts.onAccessUnavailable||typeof window>"u"||window.location.reload(),!1)}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}showHoldExpired(){if(this.destroyed||!this.root||this.holdExpiredEl)return;this.clearDecisionSurfaces();let e=ml({restart:()=>this.restartAfterHoldExpiry()},this.holdExpiredUnits);this.root.appendChild(e),this.holdExpiredEl=e,requestAnimationFrame(()=>e.querySelector(".sl-interrupt-act")?.focus());let t=this.holdExpiredUnits;this.holdExpiredFresh=!1,this.refreshAvailability().then(()=>{if(this.destroyed||this.holdExpiredEl!==e)return;this.holdExpiredFresh=!0;let n=t.filter(r=>r.objectType!=="ga"),o=[],s=[];for(let r of n){let a=this.controller.seatByLabel(r.label);(a&&this.controller.getStatus(a.id)==="free"?o:s).push(r.label)}ul(e,{recoverable:o,taken:s,onRecover:r=>this.recoverAfterHoldExpiry(r)})}).catch(()=>{})}recoverAfterHoldExpiry(e){this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.select(e),this.syncTray(),this.handleCta()}dismissHoldExpired(){this.holdExpiredEl?.remove(),this.holdExpiredEl=null}restartAfterHoldExpiry(){let e=this.holdExpiredUnits;this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.overview(),this.syncTray(),this.syncCta(),this.root?.focus({preventScroll:!0});let t=this.holdExpiredFresh;this.holdExpiredFresh=!1,(t?Promise.resolve():this.refreshAvailability()).then(()=>{this.destroyed||hl({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:n=>this.controller.seatByLabel(n),statusOf:n=>this.controller.getStatus(n),flash:(n,o)=>this.controller.flashSeat(n,o)},e)}).catch(()=>{})}destroy(){this.destroyed=!0,no(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.dismissAccessPanel(),this.dismissHoldExpired(),this.access?.clear(),this.hold&&!this.handedOff&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),Ce(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.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.viewportResizeHandler&&window.removeEventListener("resize",this.viewportResizeHandler),this.viewportResizeHandler=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,this.root?.remove(),this.root=null,this.modalScrim&&(this.modalScrim.remove(),this.modalScrim=null,this.prevFocus?.isConnected&&this.prevFocus.focus({preventScroll:!0}),this.prevFocus=null)}};var Ke=require("@seatlayer/core");var El="seatlayer-performance-group-picker-style";function Cl(){if(document.getElementById(El))return;let i=document.createElement("style");i.id=El,i.textContent=`
|
|
2918
3147
|
.sl-pg-root{display:grid;gap:12px;min-width:0;color:var(--sl-text,#18202b);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
|
|
2919
3148
|
.sl-pg-head{display:grid;gap:8px;padding:16px 18px;border:1px solid var(--sl-line,#dde3ea);border-radius:14px;background:var(--sl-surface,#fff)}
|
|
2920
3149
|
.sl-pg-head h2{font:700 20px/1.25 inherit;margin:0}.sl-pg-summary{margin:0;color:var(--sl-muted,#627081);font-size:14px}
|
|
@@ -2974,7 +3203,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
2974
3203
|
@media(min-width:900px){.sl-pg-legend-list{justify-content:flex-start}}
|
|
2975
3204
|
.sl-pg-live{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
|
|
2976
3205
|
@media(max-width:640px){.sl-pg-head{padding:13px 14px}.sl-pg-head h2{font-size:18px}.sl-pg-inner{min-height:590px}}
|
|
2977
|
-
`,document.head.appendChild(i)}var Vp="https://api.seatlayer.io",zp=6e4,$p=2e3,jp=1e3,Gp=36e5,Up=5e3,qp=5e3,Kp=15e3,Wp=12e4,Yp=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),Z=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function Xp(i){return new Promise(e=>setTimeout(e,i))}function mo(i){let e=Number(i.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(Up,e*1e3)):1e3}function Dt(i,e){return`/pub/performance-groups/${encodeURIComponent(i)}/operations/${encodeURIComponent(e)}`}function Bt(i){return i.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var fo=class{constructor(e,t,n){this.api=e;this.sink=t;this.intervalMs=n;this.stopped=!0;this.timer=null;this.prior=new Map}start(){this.stopped&&(this.stopped=!1,this.tick())}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){try{let e=await this.api.objects(this.api.groupKey);if(this.stopped)return;let t=new Map(Object.entries(e.seats)),o=[...new Set([...this.prior.keys(),...t.keys()])].filter(s=>this.prior.get(s)!==t.get(s)).map(s=>({label:s,status:t.get(s)??"blocked"}));this.prior=t,o.length&&this.sink.applyStatuses(o),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof Z){this.stop();return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},kn=class{constructor(e,t){this.descriptorCache=null;this.chartRequest=null;this.objectsCache=null;this.activePerformanceKey=null;this.includedEventKeys=new Set;this.reuseObjectsCacheOnce=!1;this.selectionsByEvent=new Map;this.allocationsByHold=new Map;this.pendingOperationId=null;this.operationByHold=new Map;this.knownRevision=null;this.destroyed=!1;this.aborter=new AbortController;this.adoptFailure=null;this.settleTimer=null;this.settleOperationId=null;this.settleStartedAt=0;this.settleState=null;this.settleVisibility=null;this.lastRecovery={kind:"idle"};if(!e)throw new Error("seatlayer: `performanceGroup` key is required");this.groupKey=e,this.base=(t.apiBase??Vp).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??zp,this.realtimePollMs=Math.max(500,t.realtimePollMs??$p),this.selectionMode=t.selectionMode??"same_seat",this.partySize=t.partySize??null,this.onOperationState=t.onOperationState,this.onRecoveryState=t.onRecoveryState,this.onAvailability=t.onAvailability,this.access.onRenewed(o=>this.adoptSession(o));let n=this.readOperationRecord();n&&this.storedIsUndecided(n)&&(this.pendingOperationId=n.operationId)}get pendingOperation(){return this.pendingOperationId}get holdBlocked(){return!!this.adoptFailure||!!this.pendingOperationId&&this.lastRecovery.kind!=="idle"}async descriptor(){let e=await this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/descriptor`);return this.descriptorCache=e.performanceGroup,this.includedEventKeys.size||(this.includedEventKeys=new Set(e.performanceGroup.performances.map(t=>t.eventKey))),e.performanceGroup.revision&&(this.knownRevision=e.performanceGroup.revision),this.activePerformanceKey??=e.performanceGroup.performances[0]?.eventKey??null,e.performanceGroup}async chart(e){this.chartRequest??=this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/chart`).catch(o=>{throw this.chartRequest=null,o});let[t,n]=await Promise.all([this.descriptorCache?Promise.resolve(this.descriptorCache):this.descriptor(),this.chartRequest]);return{doc:n,event:{key:t.key,name:t.name,salesClosed:t.state!=="active",venue:t.venue,startsAt:t.performances[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.blob(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/assets/${encodeURIComponent(t)}`):Promise.reject(new G(404,"not_found","not_found"))}async objects(e){let t=this.descriptorCache?.inclusionMode==="flexible_dates",n=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/objects`+(this.selectionMode==="per_performance"||t?"?view=per-performance":"");if(this.reuseObjectsCacheOnce&&this.objectsCache)this.reuseObjectsCacheOnce=!1;else{let r=await this.authorized(n,this.objectsCache?.revision?{headers:{"If-None-Match":`"${this.objectsCache.revision}"`}}:{});if(r.status!==304){if(!r.ok)return this.throwResponse(r);this.objectsCache=await this.responseJson(r)}}if(!this.objectsCache)throw new G(502,"group_projection_unavailable","group_projection_unavailable");if(this.selectionMode==="same_seat"&&!t){let r=this.objectsCache;return this.noteAvailability(r,r.salesClosed,r),r}let o=this.objectsCache;if(this.selectionMode==="same_seat"){let r=o.performances.filter(d=>this.includedEventKeys.has(d.eventKey));if(!r.length)throw new G(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(r[0]?.seats??{}),l=Object.fromEntries(a.map(d=>[d,r.every(u=>u.seats[d]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(d=>{let u=r.filter(p=>p.seats[d]!=="free").map(p=>p.eventKey);return u.length>0&&u.length<r.length?[[d,u]]:[]})),h={seats:l,partial:c,hidden:[...new Set(r.flatMap(d=>d.hidden??[]))],closed:[...new Set(r.flatMap(d=>d.closed??[]))],revision:o.revision,state:o.state,salesClosed:r.some(d=>d.salesClosed)};return this.noteAvailability(o,h.salesClosed,h),h}let s=o.performances.find(r=>r.eventKey===this.activePerformanceKey);if(!s)throw new G(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(o,o.salesClosed||o.performances.some(r=>r.salesClosed),s),s}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new G(409,"group_operation_pending","group_operation_pending");e!==this.selectionMode&&(this.selectionMode=e,t!=null&&(this.partySize=t),this.objectsCache=null,this.selectionsByEvent.clear(),this.activePerformanceKey=this.descriptorCache?.performances[0]?.eventKey??this.activePerformanceKey)}setActivePerformance(e){if(this.descriptorCache&&!this.descriptorCache.performances.some(t=>t.eventKey===e))throw new G(404,"group_performance_not_found","group_performance_not_found");this.activePerformanceKey=e}setIncludedEventKeys(e){let t=new Set(this.descriptorCache?.performances.map(n=>n.eventKey)??[]);if(!e.length||new Set(e).size!==e.length||e.some(n=>!t.has(n)))throw new G(422,"invalid_event_keys","invalid_event_keys");this.includedEventKeys=new Set(e),this.reuseObjectsCacheOnce=!!this.objectsCache}includedPerformanceKeys(){return(this.descriptorCache?.performances??[]).map(e=>e.eventKey).filter(e=>this.includedEventKeys.has(e))}setPerformanceSelections(e,t){this.selectionsByEvent.set(e,t.map(n=>({...n})))}allocationsForHold(e){return(this.allocationsByHold.get(e)??[]).map(t=>({eventKey:t.eventKey,items:t.items.map(n=>({...n}))}))}async hold(e,t,n,o){if(this.assertUsable(),o)throw new G(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let s=t.map(c=>c.label),r={labels:s};if(this.descriptorCache?.inclusionMode==="flexible_dates"&&(r.eventKeys=this.includedPerformanceKeys()),this.selectionMode==="per_performance"){if(!this.activePerformanceKey||!this.descriptorCache||!this.partySize)throw new G(409,"group_selection_incomplete","group_selection_incomplete");this.setPerformanceSelections(this.activePerformanceKey,t);let c=this.descriptorCache.performances.filter(h=>this.includedEventKeys.has(h.eventKey)).map(h=>({eventKey:h.eventKey,selections:this.selectionsByEvent.get(h.eventKey)??[]}));if(c.some(h=>h.selections.length!==this.partySize))throw new G(409,"group_selection_incomplete","group_selection_incomplete");r={selectionMode:"per_performance",allocations:c,...this.descriptorCache.inclusionMode==="flexible_dates"?{eventKeys:this.includedPerformanceKeys()}:{}}}let a=this.pendingOperationId??`pghop_${crypto.randomUUID()}`;this.beginOperation(a),this.onOperationState?.({operationId:a,state:"preparing",decision:null});let l;try{l=await this.authorized(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/hold`,{method:"POST",body:JSON.stringify({operationId:a,...r,...n?{ttlMs:n}:{}})})}catch(c){if(c instanceof Z)throw c;if(c instanceof se)throw this.failOperation(a),c;return this.recover(a,s,Date.now()+this.recoveryTimeoutMs)}if(l.status===201||l.status===202||l.status===504){let c=await this.responseJson(l);return this.emit(c.operation),l.status===201?this.complete(c.operation):this.recover(a,s,Date.now()+this.recoveryTimeoutMs,mo(l))}if(l.status===503){let c=await l.clone().json().catch(()=>null);if((c?.code??c?.error)==="performance_group_abort_pending"){let h=c?.operation?.operationId??a;return this.beginOperation(h),c?.operation&&this.emit(c.operation),this.recover(h,s,Date.now()+this.recoveryTimeoutMs,mo(l))}}try{return await this.throwResponse(l,s)}catch(c){throw this.failOperation(a),c}}async release(e,t,n){this.assertUsable();let o=this.operationForHold(n),s=await this.json(`${Dt(this.groupKey,o)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(n),this.allocationsByHold.delete(n),this.clearOperationRecord(),s}async resume(e,t){this.assertUsable();let n=this.operationForHold(t),o=await this.json(Dt(this.groupKey,n));return this.complete(o.operation)}async extend(e,t,n=12e4){this.assertUsable();let o=this.operationForHold(t),s=Math.max(jp,Math.min(Gp,Math.round(n))),r=await this.json(`${Dt(this.groupKey,o)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:s})}),a=this.complete(r.operation);return{holdId:a.holdId,expiresAt:a.expiresAt}}bestAvailable(){return Promise.reject(new G(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new fo(this,t,this.realtimePollMs)}operationIdForHold(e){return this.operationByHold.get(e)??this.readMapping(e)}rememberOperation(e,t){!e||!t||(this.operationByHold.set(e,t),this.writeMapping(e,t))}async restoreOperation(){let e=this.readOperationRecord();if(!e)return null;if(!this.storedIsUndecided(e)&&e.state!=="committed"&&e.state!=="booked")return this.clearOperationRecord(),null;this.pendingOperationId=e.operationId,this.emitRecovery({kind:"pending",operationId:e.operationId,phase:e.state==="undecided"?"unknown":e.state,longRunning:!1,reference:Bt(e.operationId)});let t;try{t=await this.authorized(Dt(this.groupKey,e.operationId))}catch(s){return s instanceof Z||this.recoveryFailed(e.operationId,"request_failed"),null}if(t.status===404)return this.failOperation(e.operationId),null;if(!t.ok)return this.recoveryFailed(e.operationId,"request_failed"),null;let n=await this.responseJson(t);this.emit(n.operation);let o=n.operation.state;return o==="committed"||o==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(n.operation)):o==="aborted"||o==="expired"?(this.failOperation(e.operationId),null):this.recover(e.operationId,[],Date.now()+this.recoveryTimeoutMs)}async retryRecovery(){this.assertUsable();let e=this.pendingOperationId??this.readOperationRecord()?.operationId??null;return e?(this.pendingOperationId=e,this.recover(e,[],Date.now()+this.recoveryTimeoutMs)):null}watchSettlement(e){if(this.destroyed)return;let t=this.operationIdForHold(e);!t||t===this.settleOperationId||(this.stopSettlementWatch(),this.settleOperationId=t,this.settleStartedAt=Date.now(),this.settleState="committed",typeof document<"u"&&(this.settleVisibility=()=>{document.hidden||!this.settleOperationId||this.pollSettlement()},document.addEventListener("visibilitychange",this.settleVisibility)),this.scheduleSettlementPoll())}stopSettlementWatch(){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null,this.settleOperationId=null,this.settleState=null,this.settleVisibility&&typeof document<"u"&&document.removeEventListener("visibilitychange",this.settleVisibility),this.settleVisibility=null}scheduleSettlementPoll(){if(this.destroyed||!this.settleOperationId)return;if(this.settleTimer&&clearTimeout(this.settleTimer),typeof document<"u"&&document.hidden){this.settleTimer=null;return}let t=Date.now()-this.settleStartedAt>=Wp?Kp:qp;this.settleTimer=setTimeout(()=>{this.pollSettlement()},t)}settled(e){return e==="booked"||e==="expired"||e==="aborted"}async pollSettlement(){let e=this.settleOperationId;if(this.destroyed||!e)return;if(typeof document<"u"&&document.hidden){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null;return}let t;try{let o=await this.authorized(Dt(this.groupKey,e));if(!o.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(o)).operation}catch(o){return o instanceof Z?this.stopSettlementWatch():this.scheduleSettlementPoll()}if(this.destroyed||this.settleOperationId!==e)return;let n=t.state!==this.settleState;if(this.settleState=t.state,n&&this.noteOperationState(e,t.state),this.settled(t.state)){this.stopSettlementWatch(),t.state!=="booked"&&this.clearOperationRecord(),this.emit(t);return}n&&this.emit(t),this.scheduleSettlementPoll()}destroy(){if(!this.destroyed){this.destroyed=!0,this.stopSettlementWatch(),this.access.onRenewed(void 0);try{this.aborter.abort()}catch{}}}operationRecordKey(){return`@seatlayer/performance-group-operation/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}`}readOperationRecord(){try{let e=window.sessionStorage.getItem(this.operationRecordKey());if(!e)return null;let t=JSON.parse(e);return!t?.operationId||t.groupKey!==this.groupKey?null:t}catch{return null}}storedIsUndecided(e){return e.state==="undecided"||Yp.has(e.state)}writeOperationRecord(e){try{window.sessionStorage.setItem(this.operationRecordKey(),JSON.stringify(e))}catch{}}clearOperationRecord(){try{window.sessionStorage.removeItem(this.operationRecordKey())}catch{}}beginOperation(e){this.pendingOperationId=e;let t=this.readOperationRecord();this.writeOperationRecord({operationId:e,groupKey:this.groupKey,state:"undecided",createdAt:t?.operationId===e?t.createdAt:Date.now()})}noteOperationState(e,t){let n=this.readOperationRecord();!n||n.operationId!==e||this.writeOperationRecord({...n,state:t})}failOperation(e){this.pendingOperationId=null,this.clearOperationRecord(),this.emitRecovery({kind:"idle"}),this.onOperationState?.({operationId:e,state:"aborted",decision:"abort"})}async adoptSession(e){if(this.destroyed)return;let t=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/session/adopt`;for(let o=0;o<2;o++){if(this.destroyed)return;try{if((await this.fetcher(`${this.base}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit",signal:this.aborter.signal})).ok){this.adoptFailure=null;return}}catch{}}if(this.destroyed)return;this.adoptFailure=new G(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let n=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:n,reference:n?Bt(n):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,n,o=100){let s=o,r=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=n;){if(this.destroyed)throw new Z;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=r,reference:Bt(e)}),await Xp(s),this.destroyed)throw new Z;let l;try{l=await this.authorized(Dt(this.groupKey,e))}catch(d){if(d instanceof Z)throw d;if(d instanceof se)throw this.recoveryFailed(e,"request_failed"),d;s=Math.min(2e3,Math.max(100,s*2));continue}if(l.status===404){s=Math.min(1e3,Math.max(100,s*2));continue}if(!l.ok){this.recoveryFailed(e,"request_failed");try{return await this.throwResponse(l,t)}finally{this.pendingOperationId=null,this.clearOperationRecord()}}let h=(await this.responseJson(l)).operation;if(a=h.state,this.noteOperationState(e,h.state),this.emit(h),h.state==="committed"||h.state==="booked")return this.emitRecovery({kind:"idle"}),this.complete(h);if(h.state==="aborted"||h.state==="expired")throw this.failOperation(e),new G(409,"conflict","conflict",t.map(d=>({label:d,status:"held"})));s=mo(l)}throw this.recoveryFailed(e,"deadline"),new G(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:Bt(e),reason:t,retryable:!0})}emitRecovery(e){if(this.destroyed)return;let t=this.lastRecovery.kind===e.kind&&JSON.stringify(this.lastRecovery)===JSON.stringify(e);this.lastRecovery=e,t||this.onRecoveryState?.(e)}noteAvailability(e,t,n){if(this.destroyed||!this.onAvailability)return;let o=e.state??this.descriptorCache?.state??"active",s=e.revision??null,r=!!s&&!!this.knownRevision&&s!==this.knownRevision;s&&!this.knownRevision&&(this.knownRevision=s);let a=n?.partial??{},l=Object.values(n?.seats??{});this.onAvailability({partial:a,freeCount:l.filter(c=>c==="free").length,blockedCount:Object.keys(n?.seats??{}).filter(c=>n.seats[c]!=="free"&&!(c in a)).length,state:o,salesClosed:!!t||o!=="active",revision:s,revisionChanged:r})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new G(409,"group_hold_not_active","group_hold_not_active");this.pendingOperationId=null,this.noteOperationState(e.operationId,e.state),this.operationByHold.set(e.hold.id,e.operationId),this.writeMapping(e.hold.id,e.operationId);let t=e.hold.allocations??[];this.allocationsByHold.set(e.hold.id,t);let n=t.find(o=>o.eventKey===this.activePerformanceKey)?.items;return{holdId:e.hold.id,expiresAt:e.hold.expiresAt,items:n??e.hold.items??[]}}emit(e){this.destroyed||this.onOperationState?.({operationId:e.operationId,state:e.state,decision:e.decision})}operationForHold(e){let t=this.operationIdForHold(e);if(!t)throw new G(404,"group_hold_not_found","group_hold_not_found");return t}mappingKey(e){return`@seatlayer/performance-group-hold/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}/${encodeURIComponent(e)}`}readMapping(e){try{return window.sessionStorage.getItem(this.mappingKey(e))}catch{return null}}writeMapping(e,t){try{window.sessionStorage.setItem(this.mappingKey(e),t)}catch{}}assertUsable(){if(this.destroyed)throw new Z;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},n=!1){if(this.destroyed)throw new Z;if(this.adoptFailure)throw this.adoptFailure;let o={...t.headers};t.body!==void 0&&(o["Content-Type"]="application/json");let s=await this.access.authorization(n?"unauthorized":"initial");if(this.destroyed)throw new Z;if(this.adoptFailure)throw this.adoptFailure;if(!s)throw new Error("performance_group_buyer_access_required");o.Authorization=s;let r=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:o,body:t.body,credentials:"omit",signal:this.aborter.signal});if(!n&&(r.status===401||r.status===403||r.status===422)){let a=await r.clone().json().catch(()=>null);if(await this.access.handleFailure(r.status,a?.code??a?.error))return this.authorized(e,t,!0)}return r}async json(e,t={}){let n=await this.authorized(e,t);return n.ok?this.responseJson(n):this.throwResponse(n)}async blob(e){let t=await this.authorized(e);return t.ok?t.blob():this.throwResponse(t)}async responseJson(e){return e.json()}async throwResponse(e,t=[]){let o=await e.json().catch(()=>null)??{},s=o.code??o.error??`request_failed_${e.status}`;throw e.status===409&&!o.conflicts?.length&&t.length&&(o.conflicts=t.map(r=>({label:r,status:"held"}))),new G(e.status,o.error??s,s,o.conflicts)}};var Zp="https://api.seatlayer.io";function Hl(i){let e=typeof i=="string"?document.querySelector(i):i;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var Tn=class{constructor(e){this.descriptorValue=null;this.picker=null;this.root=null;this.innerHost=null;this.tabsHost=null;this.prevButton=null;this.nextButton=null;this.heldSummary=null;this.live=null;this.statusHost=null;this.statusCopy=null;this.statusAction=null;this.rendered=!1;this.destroyed=!1;this.continued=!1;this.switchingPerformance=!1;this.operationPending=!1;this.recovery={kind:"idle"};this.availability=null;this.activePerformanceKey=null;this.selectionsByEvent=new Map;this.validByEvent=new Map;this.refreshingComposition=!1;this.activeHandoff=null;this.selectionModeValue="same_seat";this.progressHost=null;this.legendHost=null;this.paneHost=null;this.datesSummaryHost=null;this.datesCardsHost=null;this.resettingFlexibleSelection=!1;this.selectingPartialSeat=!1;this.partialSeatDates=new Map;this.markedLabels=new Set;this.holdTicker=null;this.switchingMode=!1;this.booked=!1;if(!e||typeof e!="object")throw new Error("seatlayer: options object is required");if(!e.performanceGroup)throw new Error("seatlayer: `performanceGroup` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if(!e.buyerAccessToken&&!e.buyerAccessTokenProvider)throw new Error("seatlayer: Performance Group buyer access is required");if(!!e.initialHoldId!=!!e.initialOperationId)throw new Error("seatlayer: `initialHoldId` and `initialOperationId` must be supplied together");if((e.selectionMode==="per_performance"||e.allowSelectionModeSwitch)&&(!Number.isSafeInteger(e.numberOfPlacesToSelect)||(e.numberOfPlacesToSelect??0)<1))throw new Error("seatlayer: `numberOfPlacesToSelect` is required for per-performance selection");this.selectionModeValue=e.selectionMode??"same_seat",this.options=e,this.panelId=`sl-pg-panel-${e.performanceGroup}`,this.access=new ue({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable}),this.api=new kn(e.performanceGroup,{apiBase:e.apiBase,access:this.access,selectionMode:e.selectionMode,partySize:e.selectionMode==="per_performance"?e.numberOfPlacesToSelect:void 0,onOperationState:t=>this.operationChanged(t),onRecoveryState:t=>this.recoveryChanged(t),onAvailability:t=>this.availabilityChanged(t)}),e.initialHoldId&&e.initialOperationId&&this.api.rememberOperation(e.initialHoldId,e.initialOperationId)}get mode(){return this.selectionModeValue}get selectionMode(){return this.selectionModeValue}get descriptor(){return this.descriptorValue}get currentHold(){return this.activeHandoff}async render(){if(this.rendered)return this;let e=performance.now();if(this.rendered=!0,Ll(),await(0,qe.loadLocale)(this.options.locale),this.options.messages&&(0,qe.setStringOverrides)(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(n){throw Re({apiBase:this.options.apiBase??Zp,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:$e(this.options.performanceGroup),transport:"pubapi"}),n}return this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(Hl(this.options.container),t),this.announce(this.copy("picker.group.checkingAvailability")),await this.mountPicker(t),this.destroyed?this:(await this.restoreOperation(),this))}buildChrome(e,t){e.replaceChildren();let n=document.createElement("div");n.className="sl-pg-root",n.dataset.performanceGroup=t.key,n.dataset.selectionMode=this.mode;let o=document.createElement("div");o.className="sl-pg-progress";let s=document.createElement("section");s.className="sl-pg-head",s.setAttribute("aria-labelledby",`sl-pg-title-${t.key}`);let r=document.createElement("h2");r.id=`sl-pg-title-${t.key}`,r.textContent=t.name;let a=document.createElement("p");a.className="sl-pg-summary",a.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceSummary":"picker.group.sameSeatSummary",{count:t.performanceCount});let l=document.createElement("p");l.className="sl-pg-help",l.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceMapHelp":"picker.group.sameSeatMapHelp");let c=document.createElement("details");c.className="sl-pg-dates",c.open=t.performanceCount<=3;let h=document.createElement("summary");h.textContent=this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:t.performanceCount});let d=document.createElement("div");d.innerHTML=eo(this.performanceCards(t),this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.performanceCount})),c.append(h,d);let u=document.createElement("div");u.className="sl-pg-held-summary",u.hidden=!0,s.append(r,a,l,c,u);let p=document.createElement("div");p.className="sl-pg-legend";let f=document.createElement("div");f.className="sl-pg-pane",f.setAttribute("role","group"),f.setAttribute("aria-label",this.copy("picker.group.yourSelection")),f.hidden=!0;let b=this.mode==="per_performance"?this.performanceTabs(t):null,k=document.createElement("div");k.className="sl-pg-inner",k.id=this.panelId,k.setAttribute("aria-busy","false"),k.dataset.locked="false",this.mode==="per_performance"&&(k.setAttribute("role","tabpanel"),k.tabIndex=-1);let x=document.createElement("div");x.className="sl-pg-status",x.setAttribute("role","status"),x.setAttribute("aria-live","polite"),x.hidden=!0;let v=document.createElement("p"),A=document.createElement("button");A.type="button",A.hidden=!0,A.textContent=this.copy("picker.group.retry"),A.addEventListener("click",()=>{this.retryRecovery()}),x.append(v,A),k.appendChild(x);let y=document.createElement("div");y.className="sl-pg-live",y.setAttribute("role","status"),y.setAttribute("aria-live","polite"),n.append(o,s),b&&n.append(b),n.append(p,k,f,y),e.appendChild(n),this.root=n,this.progressHost=o,this.legendHost=p,this.paneHost=f,this.datesSummaryHost=h,this.datesCardsHost=d,this.innerHost=k,this.heldSummary=u,this.live=y,this.statusHost=x,this.statusCopy=v,this.statusAction=A,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new Ue(wn({container:this.innerHost,event:e.key,apiBase:this.options.apiBase,transport:this.api,hideEventDetails:!0,maxSelection:this.options.maxSelection,selectedObjects:this.options.selectedObjects,selectableObjects:this.options.selectableObjects,numberOfPlacesToSelect:this.options.numberOfPlacesToSelect,selectionValidators:this.options.selectionValidators,locale:this.options.locale,messages:this.options.messages,languages:this.options.languages,colorblindSafe:this.options.colorblindSafe,initialView:this.options.initialView,enable3D:this.options.enable3D,max3DSeats:this.options.max3DSeats,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(n,o)=>{try{this.options.onAnalytics?.(n,{...o,metricScope:"performance_group",performanceGroupKey:e.key,performanceCount:e.performanceCount,selectionMode:this.mode})}catch{}},hideBadge:this.options.hideBadge,theme:this.options.theme,holdTtlMs:this.options.holdTtlMs,initialHoldId:this.options.initialHoldId,restoreHold:this.options.restoreHold,confirmSelection:this.options.confirmSelection,seatView:this.options.seatView,onSelectionChange:n=>this.selectionChanged(n),onSelectionValidityChange:n=>this.selectionValidityChanged(n),onSelectionValid:this.options.onSelectionValid,onSelectionInvalid:this.options.onSelectionInvalid,onSelectionLimit:this.options.onSelectionLimit,onHoldChange:(n,o)=>this.holdChanged(n,o),onCheckout:(n,o)=>this.checkout(n,o),onHoldExpired:()=>{this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()},onError:this.options.onError},{performanceCount:e.performanceCount,selectionMode:this.mode,submissionState:()=>this.submissionState(),suppressPricing:!0,nights:()=>this.nights(),seatMarks:()=>this.seatMarks(),nightSummary:()=>this.nightSummary(),groupSelectionSummary:()=>this.groupSelectionSummary(),activePerformanceLabel:()=>this.activePerformanceLabel(),selectedPerformanceDates:()=>this.mode==="same_seat"&&e.inclusionMode==="flexible_dates"?xr(this.includedPerformances(),e.performanceCount,this.options.locale,this.copy("picker.group.flexibleSelectedNote",{count:this.includedPerformances().length})):null,selectNight:n=>{this.switchPerformance(n)},selectionModeSwitch:this.options.allowSelectionModeSwitch&&this.mode==="same_seat"?{label:this.copy("picker.group.chooseNightByNight"),activate:()=>{this.switchSelectionMode("per_performance")}}:null,partialSeatSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{label:n=>this.copy("picker.group.selectAvailableDates",{count:n}),activate:(n,o)=>{this.selectPartialSeat(n,o)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:n=>this.partialSeatDates.get(n)??this.nights().map(o=>o.eventKey),label:n=>this.copy("picker.group.selectAvailableDates",{count:n}),apply:(n,o)=>this.applySeatDates(n,o,!0)}:null}));this.picker=t,await t.render(),!this.destroyed&&this.updateTabs()}performanceCards(e){return e.performances.map(t=>({eventKey:t.eventKey,name:t.name,iso:new Date(t.startsAt).toISOString(),date:an(t,this.options.locale),time:ln(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:cn(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,n=!!t?.salesClosed||!!t&&t.state!=="active",o=this.mode==="same_seat"&&!n?t?.partial??{}:{},s={};for(let r of this.markedLabels)s[r]=null;if(this.markedLabels.clear(),e>0)for(let[r,a]of Object.entries(o))!a.length||a.length>=e||(s[r]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(r));return s}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!e)return null;let t=cn(e,this.options.locale),n=e.name?.trim();return n&&n!==t?`${n} \xB7 ${t}`:t}nightSummary(){return this.mode!=="per_performance"?[]:(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:cn(e,this.options.locale),labels:(this.selectionsByEvent.get(e.eventKey)??[]).map(t=>t.label),active:e.eventKey===this.activePerformanceKey}))}groupSelectionSummary(){let e=this.includedPerformances();if(!e.length)return null;if(this.mode==="same_seat"){let s=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:s*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:s?e.length:0,perPerformance:s}}let t=e.map(s=>this.selectionsByEvent.get(s.eventKey)?.length??0),n=t.filter(s=>s>0),o=n.length===t.length&&n.every(s=>s===n[0]);return{seats:t.reduce((s,r)=>s+r,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:n.length,perPerformance:o&&n.length?n[0]:null}}syncProgress(){if(!this.progressHost)return;let e=!!this.activeHandoff,t=[{id:"performances",label:this.copy("picker.group.stepPerformances"),state:"done"},{id:"seats",label:this.copy("picker.group.stepSeats"),state:e?"done":"current"},{id:"review",label:this.copy("picker.group.stepReview"),state:this.booked?"done":e?"current":"upcoming"}];this.progressHost.innerHTML=Hr(t,{label:this.copy("picker.group.progressLabel"),done:this.copy("picker.group.stepDone"),current:this.copy("picker.group.stepCurrent"),upcoming:this.copy("picker.group.notStarted")})}syncLegend(){if(!this.legendHost)return;let e=this.availability,t=!!e?.salesClosed||e&&e.state!=="active";if(!e||t){this.legendHost.replaceChildren();return}this.legendHost.innerHTML=kr({available:e.freeCount>0,selected:(this.picker?.getSelection().length??0)>0,partial:Object.keys(e.partial).length>0,unavailable:e.blockedCount>0},{title:this.copy("picker.group.legendTitle"),available:this.copy("picker.group.legendAvailable"),selected:this.copy("picker.group.legendSelected"),partial:this.copy("picker.group.legendNotEveryDate"),unavailable:this.copy("picker.group.legendUnavailable")},this.categoryColor())}categoryColor(){return this.picker?.categoryLegendColor()??"#2563eb"}syncPane(){let e=this.paneHost;if(!e)return;let t=this.includedPerformances();if(this.mode!=="same_seat"||!t.length){e.hidden=!0,e.replaceChildren();return}let n=this.activeHandoff?.seatLabels??this.picker?.getSelection().map(s=>s.label)??[],o=this.heldTotal();e.hidden=!1,e.innerHTML=Rr({title:this.copy("picker.group.yourSelection"),rows:t.map(s=>({eventKey:s.eventKey,name:`${an(s,this.options.locale)} ${ln(s,this.options.locale)}`,labels:n})),empty:this.copy("picker.group.noSeatsChosenYet"),note:o?null:this.copy("picker.group.pricesPerPerformance"),total:o?{label:this.copy("picker.group.total"),amount:o}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:Ir(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let o=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!o.length)return null;let s=o.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),r=o[0]?.currency??t.currency;try{return(0,qe.formatMoney)(s,r,void 0,this.options.locale)}catch{return`${r} ${s.toFixed(2)}`}}includedPerformances(){let e=this.descriptorValue?.performances??[];if(this.descriptorValue?.inclusionMode!=="flexible_dates")return e;let t=new Set(this.api.includedPerformanceKeys());return e.filter(n=>t.has(n.eventKey))}syncIncludedDates(){let e=this.descriptorValue;if(!e||!this.datesSummaryHost||!this.datesCardsHost)return;let t=this.includedPerformances(),n=e.inclusionMode==="flexible_dates";this.datesSummaryHost.textContent=n&&t.length<e.performanceCount?this.copy("picker.group.flexibleDatesSelected",{selected:t.length,total:e.performanceCount}):this.copy(n?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:e.performanceCount}),this.datesCardsHost.innerHTML=eo(this.performanceCards({...e,performances:t}),this.copy(n&&t.length<e.performanceCount?"picker.group.flexibleSelectedNote":n?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.length}))}async selectPartialSeat(e,t){if(!(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)){if((this.picker?.getSelection().length??0)>0){this.announce(this.copy("picker.group.clearBeforePartial"));return}this.partialSeatDates.set(e,[...t]),await this.applySeatDates(e,t,!1)}}async applySeatDates(e,t,n){if(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)return!1;let o=this.api.includedPerformanceKeys();if(o.length===t.length&&o.every(s=>t.includes(s)))return!0;this.selectingPartialSeat=!0;try{if(this.api.setIncludedEventKeys(t),this.syncIncludedDates(),await this.picker?.refreshAvailability(),!(n?this.picker?.selectObjectsWithoutConfirmation([e])??[]:this.picker?.selectObjects([e])??[]).length)throw new Error("performance_group_partial_seat_unavailable");return this.announce(this.copy("picker.group.selectedAvailableDates",{count:t.length})),this.syncPane(),this.syncLegend(),!0}catch(s){return o.length&&(this.api.setIncludedEventKeys(o),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(s),!1}finally{this.selectingPartialSeat=!1}}syncHoldTicker(){this.booked||(this.activeHandoff&&!this.holdTicker?this.holdTicker=setInterval(()=>this.syncPane(),1e3):!this.activeHandoff&&this.holdTicker&&(clearInterval(this.holdTicker),this.holdTicker=null))}async switchSelectionMode(e){if(!(this.destroyed||this.switchingMode||e===this.mode)&&!(this.activeHandoff||this.holdBlocked())){this.switchingMode=!0;try{this.api.setSelectionMode(e,this.options.numberOfPlacesToSelect),this.selectionModeValue=e,this.picker?.destroy(),this.picker=null,this.selectionsByEvent.clear(),this.validByEvent.clear(),this.markedLabels.clear(),this.availability=null;let t=this.descriptorValue;if(this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(Hl(this.options.container),t),await this.mountPicker(t),this.destroyed)return;this.announce(this.copy("picker.group.nightByNightStarted")),this.options.onSelectionModeChange?.(e)}catch(t){if(t instanceof Z)return;this.options.onError?.(t)}finally{this.switchingMode=!1}}}async release(){await this.picker?.release()}close(){this.destroy()}destroy(){if(this.destroyed)return;this.destroyed=!0,this.api.destroy(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.picker;this.root?.setAttribute("hidden","");let t=()=>{e?.destroy(),this.access.clear(),this.root?.remove(),this.root=null,this.picker=null,this.innerHost=null,this.tabsHost=null,this.statusHost=null,this.statusCopy=null,this.statusAction=null,this.live=null};e?.getCurrentHold()&&!this.continued?e.release().catch(()=>{}).finally(t):t()}copy(e,t){let n=this.options.messages?.[e];return n!==void 0?t?n.replace(/\{(\w+)\}/g,(o,s)=>String(t[s]??`{${s}}`)):n:(0,qe.t)(e,t)}performanceTabs(e){let t=document.createElement("div");t.className="sl-pg-tabsbar";let n=document.createElement("button");n.type="button",n.className="sl-pg-step",n.dataset.step="previous",n.setAttribute("aria-label",this.copy("picker.group.previousPerformance")),n.textContent="\u2039",n.addEventListener("click",()=>{this.stepPerformance(-1)});let o=document.createElement("button");o.type="button",o.className="sl-pg-step",o.dataset.step="next",o.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),o.textContent="\u203A",o.addEventListener("click",()=>{this.stepPerformance(1)});let s=document.createElement("div");return s.className="sl-pg-tabs",s.setAttribute("role","tablist"),s.setAttribute("aria-label",this.copy("picker.group.performances")),e.performances.forEach((r,a)=>{let l=document.createElement("button");l.type="button",l.className="sl-pg-tab",l.id=`sl-pg-tab-${e.key}-${r.eventKey}`,l.dataset.eventKey=r.eventKey,l.dataset.state="not-started",l.setAttribute("role","tab"),l.setAttribute("aria-selected",String(a===0)),l.setAttribute("aria-controls",this.panelId),l.tabIndex=a===0?0:-1;let c=document.createElement("span");c.className="sl-pg-tab-name",c.textContent=r.name;let h=document.createElement("span");h.className="sl-pg-tab-state",h.textContent=this.copy("picker.group.stillNeedsSeat");let d=document.createElement("span");d.className="sl-pg-tab-badge",d.textContent=this.copy("picker.group.chosenOfTotal",{chosen:0,total:this.options.numberOfPlacesToSelect??1}),l.append(c,d,h),l.addEventListener("click",()=>{this.switchPerformance(r.eventKey)}),l.addEventListener("keydown",u=>this.tabKeydown(u)),s.appendChild(l)}),t.append(n,s,o),this.tabsHost=s,this.prevButton=n,this.nextButton=o,t}tabButtons(){return[...this.tabsHost?.querySelectorAll(".sl-pg-tab")??[]]}tabKeydown(e){let t=this.tabButtons(),n=t.findIndex(a=>a===e.target);if(n<0)return;let o=getComputedStyle(this.tabsHost??document.body).direction==="rtl",s=-1;switch(e.key){case"ArrowRight":s=n+(o?-1:1);break;case"ArrowLeft":s=n+(o?1:-1);break;case"ArrowDown":s=n+1;break;case"ArrowUp":s=n-1;break;case"Home":s=0;break;case"End":s=t.length-1;break;default:return}if(s<0||s>=t.length)return;e.preventDefault();let r=t[s];r.focus({preventScroll:!0}),r.disabled||this.switchPerformance(r.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),n=t.findIndex(s=>s.dataset.eventKey===this.activePerformanceKey),o=t[n+e];!o||o.disabled||(o.focus({preventScroll:!0}),this.switchPerformance(o.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let o=!this.holdBlocked();return{complete:e.length,total:e.length,ready:o}}let t=this.options.numberOfPlacesToSelect,n=e.filter(o=>this.selectionsByEvent.get(o.eventKey)?.length===t&&this.validByEvent.get(o.eventKey)!==!1).length;return{complete:n,total:e.length,ready:n===e.length&&!this.holdBlocked()}}holdBlocked(){return this.operationPending||this.recovery.kind!=="idle"||!!this.availability?.salesClosed}selectionChanged(e){if(this.mode!=="per_performance"){this.options.onSelectionChange?.(e),this.syncPane(),this.syncLegend(),!e.length&&!this.activeHandoff&&!this.resettingFlexibleSelection&&!this.selectingPartialSeat&&this.descriptorValue?.inclusionMode==="flexible_dates"&&this.api.includedPerformanceKeys().length<this.descriptorValue.performanceCount&&(this.resettingFlexibleSelection=!0,this.api.setIncludedEventKeys(this.descriptorValue.performances.map(n=>n.eventKey)),this.syncIncludedDates(),this.picker?.refreshAvailability().catch(n=>this.options.onError?.(n)).finally(()=>{this.resettingFlexibleSelection=!1}));return}if(this.refreshingComposition||this.switchingPerformance||!this.activePerformanceKey)return;let t=e.map(n=>({...n}));this.selectionsByEvent.set(this.activePerformanceKey,t),this.api.setPerformanceSelections(this.activePerformanceKey,t.map(n=>({label:n.label}))),t.length!==this.options.numberOfPlacesToSelect?this.validByEvent.set(this.activePerformanceKey,!1):this.validByEvent.has(this.activePerformanceKey)||this.validByEvent.set(this.activePerformanceKey,!0),this.updateTabs(),this.options.onSelectionChange?.(e),this.refreshComposition(),this.syncLegend()}selectionValidityChanged(e){if(this.mode==="per_performance"&&!this.switchingPerformance&&this.activePerformanceKey){let t=this.validByEvent.get(this.activePerformanceKey);this.validByEvent.set(this.activePerformanceKey,e.isValid),this.updateTabs(),!this.refreshingComposition&&t!==e.isValid&&this.refreshComposition()}this.options.onSelectionValidityChange?.(e)}refreshComposition(){if(this.refreshingComposition||!this.picker)return;let e=this.submissionState();this.refreshingComposition=!0;try{this.picker.refreshPerformanceGroupComposition();let t=this.submissionState();(e.complete!==t.complete||e.ready!==t.ready)&&this.picker.refreshPerformanceGroupComposition()}finally{this.refreshingComposition=!1}}tabState(e){let t=this.options.numberOfPlacesToSelect??1,n=(this.selectionsByEvent.get(e)??[]).map(s=>s.label),o=this.copy("picker.group.chosenOfTotal",{chosen:n.length,total:t});return n.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:o}:n.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:n.join(", ")}),badge:o}:n.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:o}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-n.length}),badge:o}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(o=>{let s=o.dataset.eventKey,r=this.tabState(s),a=s===this.activePerformanceKey;o.dataset.state=r.key,o.disabled=t,o.setAttribute("aria-selected",String(a)),o.tabIndex=a?0:-1;let l=o.querySelector(".sl-pg-tab-state");l&&(l.textContent=r.label);let c=o.querySelector(".sl-pg-tab-badge");c&&(c.textContent=r.badge);let h=o.querySelector(".sl-pg-tab-name")?.textContent??s;o.setAttribute("aria-label",`${h}: ${r.badge} \xB7 ${r.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",o.id)});let n=e.findIndex(o=>o.dataset.eventKey===this.activePerformanceKey);this.prevButton&&(this.prevButton.disabled=t||n<=0),this.nextButton&&(this.nextButton.disabled=t||n<0||n>=e.length-1)}async switchPerformance(e){if(this.mode!=="per_performance"||this.switchingPerformance||this.holdBlocked()||this.activeHandoff||e===this.activePerformanceKey||!this.picker)return;this.activePerformanceKey&&this.selectionChanged(this.picker.getSelection());let t=this.selectionsByEvent.get(e)?.map(n=>n.label)??[];this.switchingPerformance=!0,this.activePerformanceKey=e,this.updateTabs(),this.setInteractionLocked(!0);try{this.picker.clearSelection(),this.api.setActivePerformance(e),await this.picker.refreshAvailability();let n=this.picker.selectObjects(t);this.switchingPerformance=!1,this.selectionChanged(n),n.length!==t.length&&this.validByEvent.set(e,!1),this.options.onSelectionChange?.(n);let o=this.descriptorValue?.performances.find(s=>s.eventKey===e);o&&this.announce(this.copy("picker.group.performanceOpened",{performance:o.name}))}catch(n){this.options.onError?.(n)}finally{this.switchingPerformance=!1,!this.operationPending&&this.recovery.kind==="idle"&&this.setInteractionLocked(!1),this.updateTabs(),this.picker.refreshPerformanceGroupComposition()}}setInteractionLocked(e){let t=this.innerHost;t&&(t.dataset.locked=String(e),t.setAttribute("aria-busy",String(e)),t.setAttribute("aria-disabled",String(e)))}announce(e){this.live&&(this.live.textContent=e)}showStatus(e,t,n={}){this.statusHost&&this.statusCopy&&this.statusAction&&(this.statusCopy.textContent=t,this.statusHost.hidden=!t,this.statusAction.hidden=!n.retry),this.announce(t),this.options.onStatusChange?.({kind:e,message:t,...n.reference?{reference:n.reference}:{}})}clearStatus(){this.statusHost&&(this.statusHost.hidden=!0),this.statusAction&&(this.statusAction.hidden=!0),this.options.onStatusChange?.({kind:"idle",message:""})}operationChanged(e){if(this.destroyed)return;let t=e.state==="preparing"||e.state==="commit_pending"||e.state==="abort_pending"||e.state==="expire_pending";if(this.operationPending=t,this.setInteractionLocked(t||this.recovery.kind!=="idle"),this.updateTabs(),t){this.showStatus("pending",this.copy(e.state==="commit_pending"?"picker.group.commitPending":e.state==="abort_pending"||e.state==="expire_pending"?"picker.group.abortPending":"picker.group.securing"));return}if(e.state==="booked"){this.bookingSettled();return}if(e.state==="expired"||e.state==="aborted"){this.activeHandoff&&this.holdLost();return}if(e.state==="committed"){this.clearStatus(),this.announce(this.copy("picker.group.secured")),queueMicrotask(()=>this.innerHost?.querySelector('[data-ref="cta"]')?.focus({preventScroll:!0}));return}e.decision==="abort"&&this.recovery.kind==="idle"&&(this.clearStatus(),this.announce(this.copy("picker.group.notSecured")))}bookingSettled(){if(this.booked)return;this.booked=!0,this.root&&(this.root.dataset.booking="booked"),this.clearStatus(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.activeHandoff?{...this.activeHandoff,bookingState:"booked"}:null;e&&(this.activeHandoff=e),this.syncProgress(),this.syncPane(),this.updateTabs(),this.picker?.notifyGroupSettled("booked"),this.announce(this.copy("picker.group.bookedAll",{count:this.descriptorValue?.performanceCount??0})),e&&this.options.onBooked?.(e)}holdLost(){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.picker?.notifyGroupSettled("lost"),this.announce(this.copy("picker.group.notSecured")),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()}recoveryChanged(e){if(!this.destroyed){if(this.recovery=e,this.setInteractionLocked(this.operationPending||e.kind!=="idle"),this.updateTabs(),this.refreshComposition(),e.kind==="idle"){this.operationPending||this.clearStatus();return}if(e.kind==="pending"){this.showStatus("pending",e.longRunning?this.copy("picker.group.longRunning",{reference:e.reference}):this.copy("picker.group.outcomeUnknown"),{reference:e.reference});return}this.showStatus("recovery_failed",this.copy("picker.group.longRunning",{reference:e.reference}),{retry:e.retryable,reference:e.reference}),this.setInteractionLocked(!1)}}async retryRecovery(){if(!(this.destroyed||this.recovery.kind!=="failed"||!this.recovery.retryable))try{await this.api.retryRecovery()}catch(e){if(e instanceof Z)return;this.options.onError?.(e)}}async restoreOperation(){try{let e=await this.api.restoreOperation();e&&!this.destroyed&&await this.picker?.adoptRestoredHold(e.holdId)}catch(e){if(e instanceof Z)return;this.options.onError?.(e)}}availabilityChanged(e){if(this.destroyed)return;let t=this.availability;if(this.availability=e,e.revisionChanged){this.showStatus("revision_changed",this.copy("picker.group.revisionChanged")),this.reloadDescriptor(e.revision);return}e.salesClosed?this.showStatus("sales_closed",this.copy("picker.group.salesClosed")):t?.salesClosed&&this.clearStatus(),this.updateTabs(),this.refreshComposition(),this.syncLegend()}async reloadDescriptor(e){this.api.acceptRevision(e);try{let t=await this.api.descriptor();if(this.destroyed)return;this.descriptorValue=t,await this.picker?.refreshAvailability()}catch(t){if(t instanceof Z)return;this.options.onError?.(t)}}handoff(e,t){let n=this.descriptorValue,o=this.api.operationIdForHold(e.holdId);if(!n||!o)throw new Error("seatlayer: Performance Group hold identity is unavailable");let s=this.api.allocationsForHold(e.holdId);return{operationId:o,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:n,selectionMode:this.mode,performanceKeys:s.map(r=>r.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(r=>r.label),...this.mode==="per_performance"?{allocations:s.map(r=>({eventKey:r.eventKey,seatLabels:r.items.map(a=>a.label)}))}:{}}}renderHeldAllocations(e){if(!(!this.heldSummary||this.mode!=="per_performance")){this.heldSummary.replaceChildren();for(let t of e){let n=this.descriptorValue?.performances.find(r=>r.eventKey===t.eventKey),o=document.createElement("p"),s=document.createElement("strong");s.textContent=n?.name??t.eventKey,o.append(s,document.createTextNode(t.items.map(r=>r.label).join(", "))),this.heldSummary.appendChild(o)}this.heldSummary.hidden=e.length===0}}resetPerPerformanceSelection(){this.mode==="per_performance"&&(this.selectionsByEvent.clear(),this.validByEvent.clear(),this.heldSummary?.replaceChildren(),this.heldSummary&&(this.heldSummary.hidden=!0),this.updateTabs(),this.picker?.refreshPerformanceGroupComposition())}holdChanged(e,t){if(!e){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null);return}let n=this.handoff(e,t),o=this.activeHandoff?.holdId!==n.holdId;this.activeHandoff=n,this.renderHeldAllocations(this.api.allocationsForHold(e.holdId)),this.updateTabs(),this.api.watchSettlement(e.holdId),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),o&&this.options.onHold?.(n),this.options.onHoldChange?.(n)}checkout(e,t){let n=this.handoff(e,t);this.continued=!0,this.activeHandoff=n,this.options.onCheckout?.(n)}};var Kt=require("@seatlayer/core");var Rl="seatlayer-season-picker-style";function Il(){if(document.getElementById(Rl))return;let i=document.createElement("style");i.id=Rl,i.textContent=`
|
|
3206
|
+
`,document.head.appendChild(i)}var Np="https://api.seatlayer.io",Dp=6e4,Bp=2e3,Fp=1e3,Vp=36e5,zp=5e3,$p=5e3,jp=15e3,Gp=12e4,Up=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),Q=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function qp(i){return new Promise(e=>setTimeout(e,i))}function mo(i){let e=Number(i.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(zp,e*1e3)):1e3}function Dt(i,e){return`/pub/performance-groups/${encodeURIComponent(i)}/operations/${encodeURIComponent(e)}`}function Bt(i){return i.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var fo=class{constructor(e,t,n){this.api=e;this.sink=t;this.intervalMs=n;this.stopped=!0;this.timer=null;this.prior=new Map}start(){this.stopped&&(this.stopped=!1,this.tick())}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){try{let e=await this.api.objects(this.api.groupKey);if(this.stopped)return;let t=new Map(Object.entries(e.seats)),o=[...new Set([...this.prior.keys(),...t.keys()])].filter(s=>this.prior.get(s)!==t.get(s)).map(s=>({label:s,status:t.get(s)??"blocked"}));this.prior=t,o.length&&this.sink.applyStatuses(o),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof Q){this.stop();return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Sn=class{constructor(e,t){this.descriptorCache=null;this.chartRequest=null;this.objectsCache=null;this.activePerformanceKey=null;this.includedEventKeys=new Set;this.reuseObjectsCacheOnce=!1;this.selectionsByEvent=new Map;this.allocationsByHold=new Map;this.pendingOperationId=null;this.operationByHold=new Map;this.knownRevision=null;this.destroyed=!1;this.aborter=new AbortController;this.adoptFailure=null;this.settleTimer=null;this.settleOperationId=null;this.settleStartedAt=0;this.settleState=null;this.settleVisibility=null;this.lastRecovery={kind:"idle"};if(!e)throw new Error("seatlayer: `performanceGroup` key is required");this.groupKey=e,this.base=(t.apiBase??Np).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??Dp,this.realtimePollMs=Math.max(500,t.realtimePollMs??Bp),this.selectionMode=t.selectionMode??"same_seat",this.partySize=t.partySize??null,this.onOperationState=t.onOperationState,this.onRecoveryState=t.onRecoveryState,this.onAvailability=t.onAvailability,this.access.onRenewed(o=>this.adoptSession(o));let n=this.readOperationRecord();n&&this.storedIsUndecided(n)&&(this.pendingOperationId=n.operationId)}get pendingOperation(){return this.pendingOperationId}get holdBlocked(){return!!this.adoptFailure||!!this.pendingOperationId&&this.lastRecovery.kind!=="idle"}async descriptor(){let e=await this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/descriptor`);return this.descriptorCache=e.performanceGroup,this.includedEventKeys.size||(this.includedEventKeys=new Set(e.performanceGroup.performances.map(t=>t.eventKey))),e.performanceGroup.revision&&(this.knownRevision=e.performanceGroup.revision),this.activePerformanceKey??=e.performanceGroup.performances[0]?.eventKey??null,e.performanceGroup}async chart(e){this.chartRequest??=this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/chart`).catch(o=>{throw this.chartRequest=null,o});let[t,n]=await Promise.all([this.descriptorCache?Promise.resolve(this.descriptorCache):this.descriptor(),this.chartRequest]);return{doc:n,event:{key:t.key,name:t.name,salesClosed:t.state!=="active",venue:t.venue,startsAt:t.performances[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.blob(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/assets/${encodeURIComponent(t)}`):Promise.reject(new j(404,"not_found","not_found"))}async objects(e){let t=this.descriptorCache?.inclusionMode==="flexible_dates",n=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/objects`+(this.selectionMode==="per_performance"||t?"?view=per-performance":"");if(this.reuseObjectsCacheOnce&&this.objectsCache)this.reuseObjectsCacheOnce=!1;else{let r=await this.authorized(n,this.objectsCache?.revision?{headers:{"If-None-Match":`"${this.objectsCache.revision}"`}}:{});if(r.status!==304){if(!r.ok)return this.throwResponse(r);this.objectsCache=await this.responseJson(r)}}if(!this.objectsCache)throw new j(502,"group_projection_unavailable","group_projection_unavailable");if(this.selectionMode==="same_seat"&&!t){let r=this.objectsCache;return this.noteAvailability(r,r.salesClosed,r),r}let o=this.objectsCache;if(this.selectionMode==="same_seat"){let r=o.performances.filter(d=>this.includedEventKeys.has(d.eventKey));if(!r.length)throw new j(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(r[0]?.seats??{}),l=Object.fromEntries(a.map(d=>[d,r.every(u=>u.seats[d]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(d=>{let u=r.filter(p=>p.seats[d]!=="free").map(p=>p.eventKey);return u.length>0&&u.length<r.length?[[d,u]]:[]})),h={seats:l,partial:c,hidden:[...new Set(r.flatMap(d=>d.hidden??[]))],closed:[...new Set(r.flatMap(d=>d.closed??[]))],revision:o.revision,state:o.state,salesClosed:r.some(d=>d.salesClosed)};return this.noteAvailability(o,h.salesClosed,h),h}let s=o.performances.find(r=>r.eventKey===this.activePerformanceKey);if(!s)throw new j(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(o,o.salesClosed||o.performances.some(r=>r.salesClosed),s),s}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new j(409,"group_operation_pending","group_operation_pending");e!==this.selectionMode&&(this.selectionMode=e,t!=null&&(this.partySize=t),this.objectsCache=null,this.selectionsByEvent.clear(),this.activePerformanceKey=this.descriptorCache?.performances[0]?.eventKey??this.activePerformanceKey)}setActivePerformance(e){if(this.descriptorCache&&!this.descriptorCache.performances.some(t=>t.eventKey===e))throw new j(404,"group_performance_not_found","group_performance_not_found");this.activePerformanceKey=e}setIncludedEventKeys(e){let t=new Set(this.descriptorCache?.performances.map(n=>n.eventKey)??[]);if(!e.length||new Set(e).size!==e.length||e.some(n=>!t.has(n)))throw new j(422,"invalid_event_keys","invalid_event_keys");this.includedEventKeys=new Set(e),this.reuseObjectsCacheOnce=!!this.objectsCache}includedPerformanceKeys(){return(this.descriptorCache?.performances??[]).map(e=>e.eventKey).filter(e=>this.includedEventKeys.has(e))}setPerformanceSelections(e,t){this.selectionsByEvent.set(e,t.map(n=>({...n})))}allocationsForHold(e){return(this.allocationsByHold.get(e)??[]).map(t=>({eventKey:t.eventKey,items:t.items.map(n=>({...n}))}))}async hold(e,t,n,o){if(this.assertUsable(),o)throw new j(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let s=t.map(c=>c.label),r={labels:s};if(this.descriptorCache?.inclusionMode==="flexible_dates"&&(r.eventKeys=this.includedPerformanceKeys()),this.selectionMode==="per_performance"){if(!this.activePerformanceKey||!this.descriptorCache||!this.partySize)throw new j(409,"group_selection_incomplete","group_selection_incomplete");this.setPerformanceSelections(this.activePerformanceKey,t);let c=this.descriptorCache.performances.filter(h=>this.includedEventKeys.has(h.eventKey)).map(h=>({eventKey:h.eventKey,selections:this.selectionsByEvent.get(h.eventKey)??[]}));if(c.some(h=>h.selections.length!==this.partySize))throw new j(409,"group_selection_incomplete","group_selection_incomplete");r={selectionMode:"per_performance",allocations:c,...this.descriptorCache.inclusionMode==="flexible_dates"?{eventKeys:this.includedPerformanceKeys()}:{}}}let a=this.pendingOperationId??`pghop_${crypto.randomUUID()}`;this.beginOperation(a),this.onOperationState?.({operationId:a,state:"preparing",decision:null});let l;try{l=await this.authorized(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/hold`,{method:"POST",body:JSON.stringify({operationId:a,...r,...n?{ttlMs:n}:{}})})}catch(c){if(c instanceof Q)throw c;if(c instanceof se)throw this.failOperation(a),c;return this.recover(a,s,Date.now()+this.recoveryTimeoutMs)}if(l.status===201||l.status===202||l.status===504){let c=await this.responseJson(l);return this.emit(c.operation),l.status===201?this.complete(c.operation):this.recover(a,s,Date.now()+this.recoveryTimeoutMs,mo(l))}if(l.status===503){let c=await l.clone().json().catch(()=>null);if((c?.code??c?.error)==="performance_group_abort_pending"){let h=c?.operation?.operationId??a;return this.beginOperation(h),c?.operation&&this.emit(c.operation),this.recover(h,s,Date.now()+this.recoveryTimeoutMs,mo(l))}}try{return await this.throwResponse(l,s)}catch(c){throw this.failOperation(a),c}}async release(e,t,n){this.assertUsable();let o=this.operationForHold(n),s=await this.json(`${Dt(this.groupKey,o)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(n),this.allocationsByHold.delete(n),this.clearOperationRecord(),s}async resume(e,t){this.assertUsable();let n=this.operationForHold(t),o=await this.json(Dt(this.groupKey,n));return this.complete(o.operation)}async extend(e,t,n=12e4){this.assertUsable();let o=this.operationForHold(t),s=Math.max(Fp,Math.min(Vp,Math.round(n))),r=await this.json(`${Dt(this.groupKey,o)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:s})}),a=this.complete(r.operation);return{holdId:a.holdId,expiresAt:a.expiresAt}}bestAvailable(){return Promise.reject(new j(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new fo(this,t,this.realtimePollMs)}operationIdForHold(e){return this.operationByHold.get(e)??this.readMapping(e)}rememberOperation(e,t){!e||!t||(this.operationByHold.set(e,t),this.writeMapping(e,t))}async restoreOperation(){let e=this.readOperationRecord();if(!e)return null;if(!this.storedIsUndecided(e)&&e.state!=="committed"&&e.state!=="booked")return this.clearOperationRecord(),null;this.pendingOperationId=e.operationId,this.emitRecovery({kind:"pending",operationId:e.operationId,phase:e.state==="undecided"?"unknown":e.state,longRunning:!1,reference:Bt(e.operationId)});let t;try{t=await this.authorized(Dt(this.groupKey,e.operationId))}catch(s){return s instanceof Q||this.recoveryFailed(e.operationId,"request_failed"),null}if(t.status===404)return this.failOperation(e.operationId),null;if(!t.ok)return this.recoveryFailed(e.operationId,"request_failed"),null;let n=await this.responseJson(t);this.emit(n.operation);let o=n.operation.state;return o==="committed"||o==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(n.operation)):o==="aborted"||o==="expired"?(this.failOperation(e.operationId),null):this.recover(e.operationId,[],Date.now()+this.recoveryTimeoutMs)}async retryRecovery(){this.assertUsable();let e=this.pendingOperationId??this.readOperationRecord()?.operationId??null;return e?(this.pendingOperationId=e,this.recover(e,[],Date.now()+this.recoveryTimeoutMs)):null}watchSettlement(e){if(this.destroyed)return;let t=this.operationIdForHold(e);!t||t===this.settleOperationId||(this.stopSettlementWatch(),this.settleOperationId=t,this.settleStartedAt=Date.now(),this.settleState="committed",typeof document<"u"&&(this.settleVisibility=()=>{document.hidden||!this.settleOperationId||this.pollSettlement()},document.addEventListener("visibilitychange",this.settleVisibility)),this.scheduleSettlementPoll())}stopSettlementWatch(){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null,this.settleOperationId=null,this.settleState=null,this.settleVisibility&&typeof document<"u"&&document.removeEventListener("visibilitychange",this.settleVisibility),this.settleVisibility=null}scheduleSettlementPoll(){if(this.destroyed||!this.settleOperationId)return;if(this.settleTimer&&clearTimeout(this.settleTimer),typeof document<"u"&&document.hidden){this.settleTimer=null;return}let t=Date.now()-this.settleStartedAt>=Gp?jp:$p;this.settleTimer=setTimeout(()=>{this.pollSettlement()},t)}settled(e){return e==="booked"||e==="expired"||e==="aborted"}async pollSettlement(){let e=this.settleOperationId;if(this.destroyed||!e)return;if(typeof document<"u"&&document.hidden){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null;return}let t;try{let o=await this.authorized(Dt(this.groupKey,e));if(!o.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(o)).operation}catch(o){return o instanceof Q?this.stopSettlementWatch():this.scheduleSettlementPoll()}if(this.destroyed||this.settleOperationId!==e)return;let n=t.state!==this.settleState;if(this.settleState=t.state,n&&this.noteOperationState(e,t.state),this.settled(t.state)){this.stopSettlementWatch(),t.state!=="booked"&&this.clearOperationRecord(),this.emit(t);return}n&&this.emit(t),this.scheduleSettlementPoll()}destroy(){if(!this.destroyed){this.destroyed=!0,this.stopSettlementWatch(),this.access.onRenewed(void 0);try{this.aborter.abort()}catch{}}}operationRecordKey(){return`@seatlayer/performance-group-operation/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}`}readOperationRecord(){try{let e=window.sessionStorage.getItem(this.operationRecordKey());if(!e)return null;let t=JSON.parse(e);return!t?.operationId||t.groupKey!==this.groupKey?null:t}catch{return null}}storedIsUndecided(e){return e.state==="undecided"||Up.has(e.state)}writeOperationRecord(e){try{window.sessionStorage.setItem(this.operationRecordKey(),JSON.stringify(e))}catch{}}clearOperationRecord(){try{window.sessionStorage.removeItem(this.operationRecordKey())}catch{}}beginOperation(e){this.pendingOperationId=e;let t=this.readOperationRecord();this.writeOperationRecord({operationId:e,groupKey:this.groupKey,state:"undecided",createdAt:t?.operationId===e?t.createdAt:Date.now()})}noteOperationState(e,t){let n=this.readOperationRecord();!n||n.operationId!==e||this.writeOperationRecord({...n,state:t})}failOperation(e){this.pendingOperationId=null,this.clearOperationRecord(),this.emitRecovery({kind:"idle"}),this.onOperationState?.({operationId:e,state:"aborted",decision:"abort"})}async adoptSession(e){if(this.destroyed)return;let t=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/session/adopt`;for(let o=0;o<2;o++){if(this.destroyed)return;try{if((await this.fetcher(`${this.base}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit",signal:this.aborter.signal})).ok){this.adoptFailure=null;return}}catch{}}if(this.destroyed)return;this.adoptFailure=new j(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let n=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:n,reference:n?Bt(n):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,n,o=100){let s=o,r=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=n;){if(this.destroyed)throw new Q;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=r,reference:Bt(e)}),await qp(s),this.destroyed)throw new Q;let l;try{l=await this.authorized(Dt(this.groupKey,e))}catch(d){if(d instanceof Q)throw d;if(d instanceof se)throw this.recoveryFailed(e,"request_failed"),d;s=Math.min(2e3,Math.max(100,s*2));continue}if(l.status===404){s=Math.min(1e3,Math.max(100,s*2));continue}if(!l.ok){this.recoveryFailed(e,"request_failed");try{return await this.throwResponse(l,t)}finally{this.pendingOperationId=null,this.clearOperationRecord()}}let h=(await this.responseJson(l)).operation;if(a=h.state,this.noteOperationState(e,h.state),this.emit(h),h.state==="committed"||h.state==="booked")return this.emitRecovery({kind:"idle"}),this.complete(h);if(h.state==="aborted"||h.state==="expired")throw this.failOperation(e),new j(409,"conflict","conflict",t.map(d=>({label:d,status:"held"})));s=mo(l)}throw this.recoveryFailed(e,"deadline"),new j(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:Bt(e),reason:t,retryable:!0})}emitRecovery(e){if(this.destroyed)return;let t=this.lastRecovery.kind===e.kind&&JSON.stringify(this.lastRecovery)===JSON.stringify(e);this.lastRecovery=e,t||this.onRecoveryState?.(e)}noteAvailability(e,t,n){if(this.destroyed||!this.onAvailability)return;let o=e.state??this.descriptorCache?.state??"active",s=e.revision??null,r=!!s&&!!this.knownRevision&&s!==this.knownRevision;s&&!this.knownRevision&&(this.knownRevision=s);let a=n?.partial??{},l=Object.values(n?.seats??{});this.onAvailability({partial:a,freeCount:l.filter(c=>c==="free").length,blockedCount:Object.keys(n?.seats??{}).filter(c=>n.seats[c]!=="free"&&!(c in a)).length,state:o,salesClosed:!!t||o!=="active",revision:s,revisionChanged:r})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new j(409,"group_hold_not_active","group_hold_not_active");this.pendingOperationId=null,this.noteOperationState(e.operationId,e.state),this.operationByHold.set(e.hold.id,e.operationId),this.writeMapping(e.hold.id,e.operationId);let t=e.hold.allocations??[];this.allocationsByHold.set(e.hold.id,t);let n=t.find(o=>o.eventKey===this.activePerformanceKey)?.items;return{holdId:e.hold.id,expiresAt:e.hold.expiresAt,items:n??e.hold.items??[]}}emit(e){this.destroyed||this.onOperationState?.({operationId:e.operationId,state:e.state,decision:e.decision})}operationForHold(e){let t=this.operationIdForHold(e);if(!t)throw new j(404,"group_hold_not_found","group_hold_not_found");return t}mappingKey(e){return`@seatlayer/performance-group-hold/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}/${encodeURIComponent(e)}`}readMapping(e){try{return window.sessionStorage.getItem(this.mappingKey(e))}catch{return null}}writeMapping(e,t){try{window.sessionStorage.setItem(this.mappingKey(e),t)}catch{}}assertUsable(){if(this.destroyed)throw new Q;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},n=!1){if(this.destroyed)throw new Q;if(this.adoptFailure)throw this.adoptFailure;let o={...t.headers};t.body!==void 0&&(o["Content-Type"]="application/json");let s=await this.access.authorization(n?"unauthorized":"initial");if(this.destroyed)throw new Q;if(this.adoptFailure)throw this.adoptFailure;if(!s)throw new Error("performance_group_buyer_access_required");o.Authorization=s;let r=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:o,body:t.body,credentials:"omit",signal:this.aborter.signal});if(!n&&(r.status===401||r.status===403||r.status===422)){let a=await r.clone().json().catch(()=>null);if(await this.access.handleFailure(r.status,a?.code??a?.error))return this.authorized(e,t,!0)}return r}async json(e,t={}){let n=await this.authorized(e,t);return n.ok?this.responseJson(n):this.throwResponse(n)}async blob(e){let t=await this.authorized(e);return t.ok?t.blob():this.throwResponse(t)}async responseJson(e){return e.json()}async throwResponse(e,t=[]){let o=await e.json().catch(()=>null)??{},s=o.code??o.error??`request_failed_${e.status}`;throw e.status===409&&!o.conflicts?.length&&t.length&&(o.conflicts=t.map(r=>({label:r,status:"held"}))),new j(e.status,o.error??s,s,o.conflicts)}};var Kp="https://api.seatlayer.io";function Al(i){let e=typeof i=="string"?document.querySelector(i):i;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var kn=class{constructor(e){this.descriptorValue=null;this.picker=null;this.root=null;this.innerHost=null;this.tabsHost=null;this.prevButton=null;this.nextButton=null;this.heldSummary=null;this.live=null;this.statusHost=null;this.statusCopy=null;this.statusAction=null;this.rendered=!1;this.destroyed=!1;this.continued=!1;this.switchingPerformance=!1;this.operationPending=!1;this.recovery={kind:"idle"};this.availability=null;this.activePerformanceKey=null;this.selectionsByEvent=new Map;this.validByEvent=new Map;this.refreshingComposition=!1;this.activeHandoff=null;this.selectionModeValue="same_seat";this.progressHost=null;this.legendHost=null;this.paneHost=null;this.datesSummaryHost=null;this.datesCardsHost=null;this.resettingFlexibleSelection=!1;this.selectingPartialSeat=!1;this.partialSeatDates=new Map;this.markedLabels=new Set;this.holdTicker=null;this.switchingMode=!1;this.booked=!1;if(!e||typeof e!="object")throw new Error("seatlayer: options object is required");if(!e.performanceGroup)throw new Error("seatlayer: `performanceGroup` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if(!e.buyerAccessToken&&!e.buyerAccessTokenProvider)throw new Error("seatlayer: Performance Group buyer access is required");if(!!e.initialHoldId!=!!e.initialOperationId)throw new Error("seatlayer: `initialHoldId` and `initialOperationId` must be supplied together");if((e.selectionMode==="per_performance"||e.allowSelectionModeSwitch)&&(!Number.isSafeInteger(e.numberOfPlacesToSelect)||(e.numberOfPlacesToSelect??0)<1))throw new Error("seatlayer: `numberOfPlacesToSelect` is required for per-performance selection");this.selectionModeValue=e.selectionMode??"same_seat",this.options=e,this.panelId=`sl-pg-panel-${e.performanceGroup}`,this.access=new ue({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable}),this.api=new Sn(e.performanceGroup,{apiBase:e.apiBase,access:this.access,selectionMode:e.selectionMode,partySize:e.selectionMode==="per_performance"?e.numberOfPlacesToSelect:void 0,onOperationState:t=>this.operationChanged(t),onRecoveryState:t=>this.recoveryChanged(t),onAvailability:t=>this.availabilityChanged(t)}),e.initialHoldId&&e.initialOperationId&&this.api.rememberOperation(e.initialHoldId,e.initialOperationId)}get mode(){return this.selectionModeValue}get selectionMode(){return this.selectionModeValue}get descriptor(){return this.descriptorValue}get currentHold(){return this.activeHandoff}async render(){if(this.rendered)return this;let e=performance.now();if(this.rendered=!0,Cl(),await(0,Ke.loadLocale)(this.options.locale),this.options.messages&&(0,Ke.setStringOverrides)(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(n){throw Ie({apiBase:this.options.apiBase??Kp,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:je(this.options.performanceGroup),transport:"pubapi"}),n}return this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(Al(this.options.container),t),this.announce(this.copy("picker.group.checkingAvailability")),await this.mountPicker(t),this.destroyed?this:(await this.restoreOperation(),this))}buildChrome(e,t){e.replaceChildren();let n=document.createElement("div");n.className="sl-pg-root",n.dataset.performanceGroup=t.key,n.dataset.selectionMode=this.mode;let o=document.createElement("div");o.className="sl-pg-progress";let s=document.createElement("section");s.className="sl-pg-head",s.setAttribute("aria-labelledby",`sl-pg-title-${t.key}`);let r=document.createElement("h2");r.id=`sl-pg-title-${t.key}`,r.textContent=t.name;let a=document.createElement("p");a.className="sl-pg-summary",a.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceSummary":"picker.group.sameSeatSummary",{count:t.performanceCount});let l=document.createElement("p");l.className="sl-pg-help",l.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceMapHelp":"picker.group.sameSeatMapHelp");let c=document.createElement("details");c.className="sl-pg-dates",c.open=t.performanceCount<=3;let h=document.createElement("summary");h.textContent=this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:t.performanceCount});let d=document.createElement("div");d.innerHTML=Jn(this.performanceCards(t),this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.performanceCount})),c.append(h,d);let u=document.createElement("div");u.className="sl-pg-held-summary",u.hidden=!0,s.append(r,a,l,c,u);let p=document.createElement("div");p.className="sl-pg-legend";let g=document.createElement("div");g.className="sl-pg-pane",g.setAttribute("role","group"),g.setAttribute("aria-label",this.copy("picker.group.yourSelection")),g.hidden=!0;let y=this.mode==="per_performance"?this.performanceTabs(t):null,T=document.createElement("div");T.className="sl-pg-inner",T.id=this.panelId,T.setAttribute("aria-busy","false"),T.dataset.locked="false",this.mode==="per_performance"&&(T.setAttribute("role","tabpanel"),T.tabIndex=-1);let S=document.createElement("div");S.className="sl-pg-status",S.setAttribute("role","status"),S.setAttribute("aria-live","polite"),S.hidden=!0;let v=document.createElement("p"),P=document.createElement("button");P.type="button",P.hidden=!0,P.textContent=this.copy("picker.group.retry"),P.addEventListener("click",()=>{this.retryRecovery()}),S.append(v,P),T.appendChild(S);let B=document.createElement("div");B.className="sl-pg-live",B.setAttribute("role","status"),B.setAttribute("aria-live","polite"),n.append(o,s),y&&n.append(y),n.append(p,T,g,B),e.appendChild(n),this.root=n,this.progressHost=o,this.legendHost=p,this.paneHost=g,this.datesSummaryHost=h,this.datesCardsHost=d,this.innerHost=T,this.heldSummary=u,this.live=B,this.statusHost=S,this.statusCopy=v,this.statusAction=P,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new qe(vn({container:this.innerHost,event:e.key,apiBase:this.options.apiBase,transport:this.api,hideEventDetails:!0,maxSelection:this.options.maxSelection,selectedObjects:this.options.selectedObjects,selectableObjects:this.options.selectableObjects,numberOfPlacesToSelect:this.options.numberOfPlacesToSelect,selectionValidators:this.options.selectionValidators,locale:this.options.locale,messages:this.options.messages,languages:this.options.languages,colorblindSafe:this.options.colorblindSafe,initialView:this.options.initialView,enable3D:this.options.enable3D,max3DSeats:this.options.max3DSeats,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(n,o)=>{try{this.options.onAnalytics?.(n,{...o,metricScope:"performance_group",performanceGroupKey:e.key,performanceCount:e.performanceCount,selectionMode:this.mode})}catch{}},hideBadge:this.options.hideBadge,theme:this.options.theme,holdTtlMs:this.options.holdTtlMs,initialHoldId:this.options.initialHoldId,restoreHold:this.options.restoreHold,confirmSelection:this.options.confirmSelection,seatView:this.options.seatView,onSelectionChange:n=>this.selectionChanged(n),onSelectionValidityChange:n=>this.selectionValidityChanged(n),onSelectionValid:this.options.onSelectionValid,onSelectionInvalid:this.options.onSelectionInvalid,onSelectionLimit:this.options.onSelectionLimit,onHoldChange:(n,o)=>this.holdChanged(n,o),onCheckout:(n,o)=>this.checkout(n,o),onHoldExpired:()=>{this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()},onError:this.options.onError},{performanceCount:e.performanceCount,selectionMode:this.mode,submissionState:()=>this.submissionState(),suppressPricing:!0,nights:()=>this.nights(),seatMarks:()=>this.seatMarks(),nightSummary:()=>this.nightSummary(),groupSelectionSummary:()=>this.groupSelectionSummary(),activePerformanceLabel:()=>this.activePerformanceLabel(),selectedPerformanceDates:()=>this.mode==="same_seat"&&e.inclusionMode==="flexible_dates"?br(this.includedPerformances(),e.performanceCount,this.options.locale,this.copy("picker.group.flexibleSelectedNote",{count:this.includedPerformances().length})):null,selectNight:n=>{this.switchPerformance(n)},selectionModeSwitch:this.options.allowSelectionModeSwitch&&this.mode==="same_seat"?{label:this.copy("picker.group.chooseNightByNight"),activate:()=>{this.switchSelectionMode("per_performance")}}:null,partialSeatSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{label:n=>this.copy("picker.group.selectAvailableDates",{count:n}),activate:(n,o)=>{this.selectPartialSeat(n,o)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:n=>this.partialSeatDates.get(n)??this.nights().map(o=>o.eventKey),label:n=>this.copy("picker.group.selectAvailableDates",{count:n}),apply:(n,o)=>this.applySeatDates(n,o,!0)}:null}));this.picker=t,await t.render(),!this.destroyed&&this.updateTabs()}performanceCards(e){return e.performances.map(t=>({eventKey:t.eventKey,name:t.name,iso:new Date(t.startsAt).toISOString(),date:rn(t,this.options.locale),time:an(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:ln(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,n=!!t?.salesClosed||!!t&&t.state!=="active",o=this.mode==="same_seat"&&!n?t?.partial??{}:{},s={};for(let r of this.markedLabels)s[r]=null;if(this.markedLabels.clear(),e>0)for(let[r,a]of Object.entries(o))!a.length||a.length>=e||(s[r]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(r));return s}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!e)return null;let t=ln(e,this.options.locale),n=e.name?.trim();return n&&n!==t?`${n} \xB7 ${t}`:t}nightSummary(){return this.mode!=="per_performance"?[]:(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:ln(e,this.options.locale),labels:(this.selectionsByEvent.get(e.eventKey)??[]).map(t=>t.label),active:e.eventKey===this.activePerformanceKey}))}groupSelectionSummary(){let e=this.includedPerformances();if(!e.length)return null;if(this.mode==="same_seat"){let s=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:s*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:s?e.length:0,perPerformance:s}}let t=e.map(s=>this.selectionsByEvent.get(s.eventKey)?.length??0),n=t.filter(s=>s>0),o=n.length===t.length&&n.every(s=>s===n[0]);return{seats:t.reduce((s,r)=>s+r,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:n.length,perPerformance:o&&n.length?n[0]:null}}syncProgress(){if(!this.progressHost)return;let e=!!this.activeHandoff,t=[{id:"performances",label:this.copy("picker.group.stepPerformances"),state:"done"},{id:"seats",label:this.copy("picker.group.stepSeats"),state:e?"done":"current"},{id:"review",label:this.copy("picker.group.stepReview"),state:this.booked?"done":e?"current":"upcoming"}];this.progressHost.innerHTML=Ar(t,{label:this.copy("picker.group.progressLabel"),done:this.copy("picker.group.stepDone"),current:this.copy("picker.group.stepCurrent"),upcoming:this.copy("picker.group.notStarted")})}syncLegend(){if(!this.legendHost)return;let e=this.availability,t=!!e?.salesClosed||e&&e.state!=="active";if(!e||t){this.legendHost.replaceChildren();return}this.legendHost.innerHTML=vr({available:e.freeCount>0,selected:(this.picker?.getSelection().length??0)>0,partial:Object.keys(e.partial).length>0,unavailable:e.blockedCount>0},{title:this.copy("picker.group.legendTitle"),available:this.copy("picker.group.legendAvailable"),selected:this.copy("picker.group.legendSelected"),partial:this.copy("picker.group.legendNotEveryDate"),unavailable:this.copy("picker.group.legendUnavailable")},this.categoryColor())}categoryColor(){return this.picker?.categoryLegendColor()??"#2563eb"}syncPane(){let e=this.paneHost;if(!e)return;let t=this.includedPerformances();if(this.mode!=="same_seat"||!t.length){e.hidden=!0,e.replaceChildren();return}let n=this.activeHandoff?.seatLabels??this.picker?.getSelection().map(s=>s.label)??[],o=this.heldTotal();e.hidden=!1,e.innerHTML=Pr({title:this.copy("picker.group.yourSelection"),rows:t.map(s=>({eventKey:s.eventKey,name:`${rn(s,this.options.locale)} ${an(s,this.options.locale)}`,labels:n})),empty:this.copy("picker.group.noSeatsChosenYet"),note:o?null:this.copy("picker.group.pricesPerPerformance"),total:o?{label:this.copy("picker.group.total"),amount:o}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:Lr(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let o=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!o.length)return null;let s=o.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),r=o[0]?.currency??t.currency;try{return(0,Ke.formatMoney)(s,r,void 0,this.options.locale)}catch{return`${r} ${s.toFixed(2)}`}}includedPerformances(){let e=this.descriptorValue?.performances??[];if(this.descriptorValue?.inclusionMode!=="flexible_dates")return e;let t=new Set(this.api.includedPerformanceKeys());return e.filter(n=>t.has(n.eventKey))}syncIncludedDates(){let e=this.descriptorValue;if(!e||!this.datesSummaryHost||!this.datesCardsHost)return;let t=this.includedPerformances(),n=e.inclusionMode==="flexible_dates";this.datesSummaryHost.textContent=n&&t.length<e.performanceCount?this.copy("picker.group.flexibleDatesSelected",{selected:t.length,total:e.performanceCount}):this.copy(n?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:e.performanceCount}),this.datesCardsHost.innerHTML=Jn(this.performanceCards({...e,performances:t}),this.copy(n&&t.length<e.performanceCount?"picker.group.flexibleSelectedNote":n?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.length}))}async selectPartialSeat(e,t){if(!(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)){if((this.picker?.getSelection().length??0)>0){this.announce(this.copy("picker.group.clearBeforePartial"));return}this.partialSeatDates.set(e,[...t]),await this.applySeatDates(e,t,!1)}}async applySeatDates(e,t,n){if(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)return!1;let o=this.api.includedPerformanceKeys();if(o.length===t.length&&o.every(s=>t.includes(s)))return!0;this.selectingPartialSeat=!0;try{if(this.api.setIncludedEventKeys(t),this.syncIncludedDates(),await this.picker?.refreshAvailability(),!(n?this.picker?.selectObjectsWithoutConfirmation([e])??[]:this.picker?.selectObjects([e])??[]).length)throw new Error("performance_group_partial_seat_unavailable");return this.announce(this.copy("picker.group.selectedAvailableDates",{count:t.length})),this.syncPane(),this.syncLegend(),!0}catch(s){return o.length&&(this.api.setIncludedEventKeys(o),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(s),!1}finally{this.selectingPartialSeat=!1}}syncHoldTicker(){this.booked||(this.activeHandoff&&!this.holdTicker?this.holdTicker=setInterval(()=>this.syncPane(),1e3):!this.activeHandoff&&this.holdTicker&&(clearInterval(this.holdTicker),this.holdTicker=null))}async switchSelectionMode(e){if(!(this.destroyed||this.switchingMode||e===this.mode)&&!(this.activeHandoff||this.holdBlocked())){this.switchingMode=!0;try{this.api.setSelectionMode(e,this.options.numberOfPlacesToSelect),this.selectionModeValue=e,this.picker?.destroy(),this.picker=null,this.selectionsByEvent.clear(),this.validByEvent.clear(),this.markedLabels.clear(),this.availability=null;let t=this.descriptorValue;if(this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(Al(this.options.container),t),await this.mountPicker(t),this.destroyed)return;this.announce(this.copy("picker.group.nightByNightStarted")),this.options.onSelectionModeChange?.(e)}catch(t){if(t instanceof Q)return;this.options.onError?.(t)}finally{this.switchingMode=!1}}}async release(){await this.picker?.release()}close(){this.destroy()}destroy(){if(this.destroyed)return;this.destroyed=!0,this.api.destroy(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.picker;this.root?.setAttribute("hidden","");let t=()=>{e?.destroy(),this.access.clear(),this.root?.remove(),this.root=null,this.picker=null,this.innerHost=null,this.tabsHost=null,this.statusHost=null,this.statusCopy=null,this.statusAction=null,this.live=null};e?.getCurrentHold()&&!this.continued?e.release().catch(()=>{}).finally(t):t()}copy(e,t){let n=this.options.messages?.[e];return n!==void 0?t?n.replace(/\{(\w+)\}/g,(o,s)=>String(t[s]??`{${s}}`)):n:(0,Ke.t)(e,t)}performanceTabs(e){let t=document.createElement("div");t.className="sl-pg-tabsbar";let n=document.createElement("button");n.type="button",n.className="sl-pg-step",n.dataset.step="previous",n.setAttribute("aria-label",this.copy("picker.group.previousPerformance")),n.textContent="\u2039",n.addEventListener("click",()=>{this.stepPerformance(-1)});let o=document.createElement("button");o.type="button",o.className="sl-pg-step",o.dataset.step="next",o.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),o.textContent="\u203A",o.addEventListener("click",()=>{this.stepPerformance(1)});let s=document.createElement("div");return s.className="sl-pg-tabs",s.setAttribute("role","tablist"),s.setAttribute("aria-label",this.copy("picker.group.performances")),e.performances.forEach((r,a)=>{let l=document.createElement("button");l.type="button",l.className="sl-pg-tab",l.id=`sl-pg-tab-${e.key}-${r.eventKey}`,l.dataset.eventKey=r.eventKey,l.dataset.state="not-started",l.setAttribute("role","tab"),l.setAttribute("aria-selected",String(a===0)),l.setAttribute("aria-controls",this.panelId),l.tabIndex=a===0?0:-1;let c=document.createElement("span");c.className="sl-pg-tab-name",c.textContent=r.name;let h=document.createElement("span");h.className="sl-pg-tab-state",h.textContent=this.copy("picker.group.stillNeedsSeat");let d=document.createElement("span");d.className="sl-pg-tab-badge",d.textContent=this.copy("picker.group.chosenOfTotal",{chosen:0,total:this.options.numberOfPlacesToSelect??1}),l.append(c,d,h),l.addEventListener("click",()=>{this.switchPerformance(r.eventKey)}),l.addEventListener("keydown",u=>this.tabKeydown(u)),s.appendChild(l)}),t.append(n,s,o),this.tabsHost=s,this.prevButton=n,this.nextButton=o,t}tabButtons(){return[...this.tabsHost?.querySelectorAll(".sl-pg-tab")??[]]}tabKeydown(e){let t=this.tabButtons(),n=t.findIndex(a=>a===e.target);if(n<0)return;let o=getComputedStyle(this.tabsHost??document.body).direction==="rtl",s=-1;switch(e.key){case"ArrowRight":s=n+(o?-1:1);break;case"ArrowLeft":s=n+(o?1:-1);break;case"ArrowDown":s=n+1;break;case"ArrowUp":s=n-1;break;case"Home":s=0;break;case"End":s=t.length-1;break;default:return}if(s<0||s>=t.length)return;e.preventDefault();let r=t[s];r.focus({preventScroll:!0}),r.disabled||this.switchPerformance(r.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),n=t.findIndex(s=>s.dataset.eventKey===this.activePerformanceKey),o=t[n+e];!o||o.disabled||(o.focus({preventScroll:!0}),this.switchPerformance(o.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let o=!this.holdBlocked();return{complete:e.length,total:e.length,ready:o}}let t=this.options.numberOfPlacesToSelect,n=e.filter(o=>this.selectionsByEvent.get(o.eventKey)?.length===t&&this.validByEvent.get(o.eventKey)!==!1).length;return{complete:n,total:e.length,ready:n===e.length&&!this.holdBlocked()}}holdBlocked(){return this.operationPending||this.recovery.kind!=="idle"||!!this.availability?.salesClosed}selectionChanged(e){if(this.mode!=="per_performance"){this.options.onSelectionChange?.(e),this.syncPane(),this.syncLegend(),!e.length&&!this.activeHandoff&&!this.resettingFlexibleSelection&&!this.selectingPartialSeat&&this.descriptorValue?.inclusionMode==="flexible_dates"&&this.api.includedPerformanceKeys().length<this.descriptorValue.performanceCount&&(this.resettingFlexibleSelection=!0,this.api.setIncludedEventKeys(this.descriptorValue.performances.map(n=>n.eventKey)),this.syncIncludedDates(),this.picker?.refreshAvailability().catch(n=>this.options.onError?.(n)).finally(()=>{this.resettingFlexibleSelection=!1}));return}if(this.refreshingComposition||this.switchingPerformance||!this.activePerformanceKey)return;let t=e.map(n=>({...n}));this.selectionsByEvent.set(this.activePerformanceKey,t),this.api.setPerformanceSelections(this.activePerformanceKey,t.map(n=>({label:n.label}))),t.length!==this.options.numberOfPlacesToSelect?this.validByEvent.set(this.activePerformanceKey,!1):this.validByEvent.has(this.activePerformanceKey)||this.validByEvent.set(this.activePerformanceKey,!0),this.updateTabs(),this.options.onSelectionChange?.(e),this.refreshComposition(),this.syncLegend()}selectionValidityChanged(e){if(this.mode==="per_performance"&&!this.switchingPerformance&&this.activePerformanceKey){let t=this.validByEvent.get(this.activePerformanceKey);this.validByEvent.set(this.activePerformanceKey,e.isValid),this.updateTabs(),!this.refreshingComposition&&t!==e.isValid&&this.refreshComposition()}this.options.onSelectionValidityChange?.(e)}refreshComposition(){if(this.refreshingComposition||!this.picker)return;let e=this.submissionState();this.refreshingComposition=!0;try{this.picker.refreshPerformanceGroupComposition();let t=this.submissionState();(e.complete!==t.complete||e.ready!==t.ready)&&this.picker.refreshPerformanceGroupComposition()}finally{this.refreshingComposition=!1}}tabState(e){let t=this.options.numberOfPlacesToSelect??1,n=(this.selectionsByEvent.get(e)??[]).map(s=>s.label),o=this.copy("picker.group.chosenOfTotal",{chosen:n.length,total:t});return n.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:o}:n.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:n.join(", ")}),badge:o}:n.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:o}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-n.length}),badge:o}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(o=>{let s=o.dataset.eventKey,r=this.tabState(s),a=s===this.activePerformanceKey;o.dataset.state=r.key,o.disabled=t,o.setAttribute("aria-selected",String(a)),o.tabIndex=a?0:-1;let l=o.querySelector(".sl-pg-tab-state");l&&(l.textContent=r.label);let c=o.querySelector(".sl-pg-tab-badge");c&&(c.textContent=r.badge);let h=o.querySelector(".sl-pg-tab-name")?.textContent??s;o.setAttribute("aria-label",`${h}: ${r.badge} \xB7 ${r.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",o.id)});let n=e.findIndex(o=>o.dataset.eventKey===this.activePerformanceKey);this.prevButton&&(this.prevButton.disabled=t||n<=0),this.nextButton&&(this.nextButton.disabled=t||n<0||n>=e.length-1)}async switchPerformance(e){if(this.mode!=="per_performance"||this.switchingPerformance||this.holdBlocked()||this.activeHandoff||e===this.activePerformanceKey||!this.picker)return;this.activePerformanceKey&&this.selectionChanged(this.picker.getSelection());let t=this.selectionsByEvent.get(e)?.map(n=>n.label)??[];this.switchingPerformance=!0,this.activePerformanceKey=e,this.updateTabs(),this.setInteractionLocked(!0);try{this.picker.clearSelection(),this.api.setActivePerformance(e),await this.picker.refreshAvailability();let n=this.picker.selectObjects(t);this.switchingPerformance=!1,this.selectionChanged(n),n.length!==t.length&&this.validByEvent.set(e,!1),this.options.onSelectionChange?.(n);let o=this.descriptorValue?.performances.find(s=>s.eventKey===e);o&&this.announce(this.copy("picker.group.performanceOpened",{performance:o.name}))}catch(n){this.options.onError?.(n)}finally{this.switchingPerformance=!1,!this.operationPending&&this.recovery.kind==="idle"&&this.setInteractionLocked(!1),this.updateTabs(),this.picker.refreshPerformanceGroupComposition()}}setInteractionLocked(e){let t=this.innerHost;t&&(t.dataset.locked=String(e),t.setAttribute("aria-busy",String(e)),t.setAttribute("aria-disabled",String(e)))}announce(e){this.live&&(this.live.textContent=e)}showStatus(e,t,n={}){this.statusHost&&this.statusCopy&&this.statusAction&&(this.statusCopy.textContent=t,this.statusHost.hidden=!t,this.statusAction.hidden=!n.retry),this.announce(t),this.options.onStatusChange?.({kind:e,message:t,...n.reference?{reference:n.reference}:{}})}clearStatus(){this.statusHost&&(this.statusHost.hidden=!0),this.statusAction&&(this.statusAction.hidden=!0),this.options.onStatusChange?.({kind:"idle",message:""})}operationChanged(e){if(this.destroyed)return;let t=e.state==="preparing"||e.state==="commit_pending"||e.state==="abort_pending"||e.state==="expire_pending";if(this.operationPending=t,this.setInteractionLocked(t||this.recovery.kind!=="idle"),this.updateTabs(),t){this.showStatus("pending",this.copy(e.state==="commit_pending"?"picker.group.commitPending":e.state==="abort_pending"||e.state==="expire_pending"?"picker.group.abortPending":"picker.group.securing"));return}if(e.state==="booked"){this.bookingSettled();return}if(e.state==="expired"||e.state==="aborted"){this.activeHandoff&&this.holdLost();return}if(e.state==="committed"){this.clearStatus(),this.announce(this.copy("picker.group.secured")),queueMicrotask(()=>this.innerHost?.querySelector('[data-ref="cta"]')?.focus({preventScroll:!0}));return}e.decision==="abort"&&this.recovery.kind==="idle"&&(this.clearStatus(),this.announce(this.copy("picker.group.notSecured")))}bookingSettled(){if(this.booked)return;this.booked=!0,this.root&&(this.root.dataset.booking="booked"),this.clearStatus(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.activeHandoff?{...this.activeHandoff,bookingState:"booked"}:null;e&&(this.activeHandoff=e),this.syncProgress(),this.syncPane(),this.updateTabs(),this.picker?.notifyGroupSettled("booked"),this.announce(this.copy("picker.group.bookedAll",{count:this.descriptorValue?.performanceCount??0})),e&&this.options.onBooked?.(e)}holdLost(){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.picker?.notifyGroupSettled("lost"),this.announce(this.copy("picker.group.notSecured")),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()}recoveryChanged(e){if(!this.destroyed){if(this.recovery=e,this.setInteractionLocked(this.operationPending||e.kind!=="idle"),this.updateTabs(),this.refreshComposition(),e.kind==="idle"){this.operationPending||this.clearStatus();return}if(e.kind==="pending"){this.showStatus("pending",e.longRunning?this.copy("picker.group.longRunning",{reference:e.reference}):this.copy("picker.group.outcomeUnknown"),{reference:e.reference});return}this.showStatus("recovery_failed",this.copy("picker.group.longRunning",{reference:e.reference}),{retry:e.retryable,reference:e.reference}),this.setInteractionLocked(!1)}}async retryRecovery(){if(!(this.destroyed||this.recovery.kind!=="failed"||!this.recovery.retryable))try{await this.api.retryRecovery()}catch(e){if(e instanceof Q)return;this.options.onError?.(e)}}async restoreOperation(){try{let e=await this.api.restoreOperation();e&&!this.destroyed&&await this.picker?.adoptRestoredHold(e.holdId)}catch(e){if(e instanceof Q)return;this.options.onError?.(e)}}availabilityChanged(e){if(this.destroyed)return;let t=this.availability;if(this.availability=e,e.revisionChanged){this.showStatus("revision_changed",this.copy("picker.group.revisionChanged")),this.reloadDescriptor(e.revision);return}e.salesClosed?this.showStatus("sales_closed",this.copy("picker.group.salesClosed")):t?.salesClosed&&this.clearStatus(),this.updateTabs(),this.refreshComposition(),this.syncLegend()}async reloadDescriptor(e){this.api.acceptRevision(e);try{let t=await this.api.descriptor();if(this.destroyed)return;this.descriptorValue=t,await this.picker?.refreshAvailability()}catch(t){if(t instanceof Q)return;this.options.onError?.(t)}}handoff(e,t){let n=this.descriptorValue,o=this.api.operationIdForHold(e.holdId);if(!n||!o)throw new Error("seatlayer: Performance Group hold identity is unavailable");let s=this.api.allocationsForHold(e.holdId);return{operationId:o,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:n,selectionMode:this.mode,performanceKeys:s.map(r=>r.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(r=>r.label),...this.mode==="per_performance"?{allocations:s.map(r=>({eventKey:r.eventKey,seatLabels:r.items.map(a=>a.label)}))}:{}}}renderHeldAllocations(e){if(!(!this.heldSummary||this.mode!=="per_performance")){this.heldSummary.replaceChildren();for(let t of e){let n=this.descriptorValue?.performances.find(r=>r.eventKey===t.eventKey),o=document.createElement("p"),s=document.createElement("strong");s.textContent=n?.name??t.eventKey,o.append(s,document.createTextNode(t.items.map(r=>r.label).join(", "))),this.heldSummary.appendChild(o)}this.heldSummary.hidden=e.length===0}}resetPerPerformanceSelection(){this.mode==="per_performance"&&(this.selectionsByEvent.clear(),this.validByEvent.clear(),this.heldSummary?.replaceChildren(),this.heldSummary&&(this.heldSummary.hidden=!0),this.updateTabs(),this.picker?.refreshPerformanceGroupComposition())}holdChanged(e,t){if(!e){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null);return}let n=this.handoff(e,t),o=this.activeHandoff?.holdId!==n.holdId;this.activeHandoff=n,this.renderHeldAllocations(this.api.allocationsForHold(e.holdId)),this.updateTabs(),this.api.watchSettlement(e.holdId),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),o&&this.options.onHold?.(n),this.options.onHoldChange?.(n)}checkout(e,t){let n=this.handoff(e,t);this.continued=!0,this.activeHandoff=n,this.options.onCheckout?.(n)}};var Kt=require("@seatlayer/core");var Pl="seatlayer-season-picker-style";function Ll(){if(document.getElementById(Pl))return;let i=document.createElement("style");i.id=Pl,i.textContent=`
|
|
2978
3207
|
.sl-season-root{--sl-season-accent:var(--sl-accent,#7357d8);box-sizing:border-box;display:grid;gap:12px;min-width:0;max-width:100%;color:var(--sl-text,#18202b);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
|
|
2979
3208
|
.sl-season-root *{box-sizing:border-box}.sl-season-root button,.sl-season-root summary{font:inherit}
|
|
2980
3209
|
.sl-season-hero{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;padding:20px;border:1px solid var(--sl-line,#dde3ea);border-radius:18px;background:linear-gradient(135deg,color-mix(in srgb,var(--sl-season-accent) 10%,var(--sl-surface,#fff)),var(--sl-surface,#fff) 58%);box-shadow:0 10px 30px #18202b0a}
|
|
@@ -2990,4 +3219,4 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
2990
3219
|
.sl-season-status{min-height:20px;margin:0;padding:0 4px;color:var(--sl-muted,#627081);font-size:13px}.sl-season-status[data-kind=ready]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sl-season-status[data-kind=failed],.sl-season-status[data-kind=partial_terminal]{position:static;width:auto;height:auto;margin:0;padding:10px 12px;overflow:visible;clip:auto;border-radius:10px;background:#fff1f0;color:var(--sl-danger,#b42318);font-weight:700}.sl-season-root[data-busy=true] .sl-season-map{opacity:.82;pointer-events:none}
|
|
2991
3220
|
@media(max-width:820px){.sl-season-stage{grid-template-columns:1fr}.sl-season-summary-card{position:static;order:-1}.sl-season-map{min-height:590px}}
|
|
2992
3221
|
@media(max-width:560px){.sl-season-root{gap:9px}.sl-season-hero{grid-template-columns:1fr;padding:15px;border-radius:14px}.sl-season-offer{min-width:0}.sl-season-progress{grid-template-columns:1fr}.sl-season-progress li+li{border-inline-start:0;border-top:1px solid var(--sl-line,#dde3ea)}.sl-season-progress li[data-state=upcoming]{display:none}.sl-season-date-list{grid-template-columns:1fr}.sl-season-map{min-height:560px}.sl-season-summary-card{padding:13px}.sl-season-benefits{display:grid;grid-template-columns:1fr}}
|
|
2993
|
-
`,document.head.appendChild(i)}var Qp=new Set(["audience_not_public","sales_not_open","origin_not_allowed"]),Jp=3e4;function eh(i,e){if(!i||typeof i!="object"||Array.isArray(i))return!1;let t=i;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.seasonKey===e&&Array.isArray(t.planActivationIds)&&t.planActivationIds.every(n=>typeof n=="string"&&!!n)}var pi=class extends Error{constructor(t,n){super(`season_public_session_refused:${t}`);this.reason=t;this.status=n;this.name="SeasonPublicSessionRefused"}},Oe,Ke,hi,Ft,go=class{constructor(e){this.options=e;L(this,Oe,null);L(this,Ke,null);L(this,hi);L(this,Ft);T(this,hi,e.fetch??globalThis.fetch.bind(globalThis)),T(this,Ft,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return m(this,Oe)}async mint(e=!1){if(e&&T(this,Oe,null),m(this,Oe)&&m(this,Oe).expiresAt-Jp>Date.now())return m(this,Oe);if(m(this,Ke))return m(this,Ke);let t=(async()=>{let n=await m(this,hi).call(this,`${this.options.base}/pub/seasons/${encodeURIComponent(this.options.season)}/sessions`,{method:"POST",body:JSON.stringify(m(this,Ft)?{origin:m(this,Ft)}:{}),credentials:"omit"}),o=await n.json().catch(()=>null);if(!n.ok){let s=o?.code??o?.error;if(n.status===403&&s&&Qp.has(s)){let r=s;throw this.options.onRefused?.({reason:r,code:s,status:n.status,retryable:r==="sales_not_open"}),new pi(r,n.status)}throw new Error(`season_public_session_failed_${n.status}`)}if(!eh(o,this.options.season))throw new Error("season_public_session_invalid");return T(this,Oe,o),o})();T(this,Ke,t);try{return await t}finally{m(this,Ke)===t&&T(this,Ke,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",n=await this.mint(t);return{token:n.token,expiresAt:n.expiresAt}}};Oe=new WeakMap,Ke=new WeakMap,hi=new WeakMap,Ft=new WeakMap;function Ol(i){let e=new go(i);return{access:new ue({provider:({reason:n})=>e.token(n),...i.accessHooks}),loader:e}}var th="https://api.seatlayer.io",ih=6e4,nh=5e3,$=class extends Error{constructor(t,n){super(`season_request_failed:${t}`);this.code=t;this.status=n;this.name="SeasonApiError"}},mi=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}};function oh(i,e){let t=Number(i.headers.get("Retry-After")),n=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(nh,n*1e3))}function sh(i,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,n)=>{let o=setTimeout(t,i);e?.addEventListener("abort",()=>{clearTimeout(o),n(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function _l(i){if(!i||typeof i!="object")return"unknown";let e=i;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}var rh=/^shc_[a-f0-9]{40}$/,ah=/^shh_[a-f0-9]{40}$/,lh=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),ch=new Set(["pending","prepared","refused","applied","expired","booked","aborted"]);function bo(i){return Array.isArray(i)?i.some(bo):!i||typeof i!="object"?!1:Object.entries(i).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&rh.test(t)||bo(t))}function ui(i,e,t="invalid_operation_response"){if(!i||typeof i!="object"||Array.isArray(i))throw new $(t,502);if(bo(i))throw new $("unsafe_operation_response",502);let n=i,o=n.allocations,s=new Set,r=Array.isArray(o)&&o.length>0&&o.every(d=>{if(!d||typeof d!="object")return!1;let u=d.eventId,p=d.state;return typeof u!="string"||!u||typeof p!="string"||!ch.has(p)||s.has(u)?!1:(s.add(u),!0)}),a=n.bookingRef===null||typeof n.bookingRef=="string"&&n.bookingRef.length>0,l=n.state!=="booked"||typeof n.bookingRef=="string"&&r&&o.every(d=>d.state==="booked"),c=n.state!=="booking_pending"||typeof n.bookingRef=="string"&&r&&o.some(d=>d.state!=="booked"),h=n.state!=="committed"||n.bookingRef===null;if(n.operationId!==e.operationId||n.seasonId!==e.seasonId||n.kind!=="HOLD"||typeof n.holdId!="string"||!ah.test(n.holdId)||n.policy!=="fixed_inclusion_same_seat"||typeof n.state!="string"||!lh.has(n.state)||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)||n.expiresAt<0||!a||typeof n.location!="string"||!n.location||typeof n.retryAfterSeconds!="number"||!Number.isFinite(n.retryAfterSeconds)||n.retryAfterSeconds<0||!r||!l||!c||!h||n.pricingAuthority!==void 0&&n.pricingAuthority!=="host"||n.authoritativeAmountIncluded!==void 0&&n.authoritativeAmountIncluded!==!1)throw new $(t,502);return{operationId:n.operationId,seasonId:n.seasonId,kind:n.kind,holdId:n.holdId,expiresAt:n.expiresAt,policy:n.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:n.state,bookingRef:n.bookingRef,location:n.location,retryAfterSeconds:n.retryAfterSeconds,allocations:o.map(d=>({eventId:d.eventId,state:d.state}))}}function dh(i,e,t){if(!Array.isArray(i)||i.length!==t||i.some(r=>typeof r!="string"||!r)||new Set(i).size!==i.length||!Array.isArray(e)||e.length!==i.length)throw new $("invalid_best_available_response",502);let n=i,o=new Set(n),s=new Map;for(let r of e){if(!r||typeof r!="object")throw new $("invalid_best_available_response",502);let a=r;if(typeof a.label!="string"||!o.has(a.label)||s.has(a.label)||typeof a.objectId!="string"||!a.objectId||a.objectType!=="seat"||typeof a.categoryKey!="string"||!a.categoryKey||a.tierId!==null&&(typeof a.tierId!="string"||!a.tierId)||a.quantity!==void 0&&a.quantity!==1)throw new $("invalid_best_available_response",502);s.set(a.label,{label:a.label,objectId:a.objectId,objectType:"seat",categoryKey:a.categoryKey,tierId:a.tierId,...a.quantity===void 0?{}:{quantity:a.quantity}})}return{labels:n,items:n.map(r=>s.get(r))}}function ph(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i;if(typeof e.currency!="string"||!e.currency||!Array.isArray(e.packages))return null;let t=[];for(let n of e.packages){if(!n||typeof n!="object")continue;let o=n;if(typeof o.planKey!="string"||!o.planKey||!Array.isArray(o.prices))continue;let s=[],r=new Set;for(let a of o.prices){if(!a||typeof a!="object")continue;let l=a;typeof l.categoryKey!="string"||!l.categoryKey||r.has(l.categoryKey)||typeof l.unitPrice!="number"||!Number.isInteger(l.unitPrice)||l.unitPrice<0||(r.add(l.categoryKey),s.push({categoryKey:l.categoryKey,unitPrice:l.unitPrice}))}s.length&&t.push({planKey:o.planKey,name:typeof o.name=="string"&&o.name?o.name:o.planKey,prices:s})}return t.length?{currency:e.currency,packages:t}:null}function hh(i){if(!i||typeof i!="object"||Array.isArray(i))throw new $("invalid_checkout_response",502);let e=i,t=typeof e.redirectUrl=="string"&&!!e.redirectUrl,n=!!e.clientPayload&&typeof e.clientPayload=="object"&&!Array.isArray(e.clientPayload);if(typeof e.orderId!="string"||!e.orderId||typeof e.currency!="string"||!e.currency||typeof e.totalMinor!="number"||!Number.isFinite(e.totalMinor)||typeof e.expiresAt!="number"||!Number.isFinite(e.expiresAt)||t===n)throw new $("invalid_checkout_response",502);return{orderId:e.orderId,totalMinor:e.totalMinor,currency:e.currency,expiresAt:e.expiresAt,...t?{redirectUrl:e.redirectUrl}:{},...n?{clientPayload:e.clientPayload}:{}}}function Nl(i,e){return{seasonKey:i.key,planActivationId:i.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:e.state,allocations:e.allocations.map(({eventId:t,state:n})=>({eventKey:t,state:n}))}}var xe,at,Ce,lt,fi,Ae,Pe,ae,ye,Dl,En=class{constructor(e,t){L(this,ae);L(this,xe);L(this,at);L(this,Ce);L(this,lt);L(this,fi);L(this,Ae,!1);L(this,Pe,null);T(this,xe,e),T(this,at,(t.apiBase??th).replace(/\/$/,"")),T(this,Ce,t.access),T(this,lt,t.fetch??globalThis.fetch.bind(globalThis)),T(this,fi,t.recoveryTimeoutMs??ih),m(this,Ce).onRenewed(n=>S(this,ae,Dl).call(this,n))}async descriptor(){let{body:e}=await S(this,ae,ye).call(this,"GET","");return e.season}async chart(){let{body:e}=await S(this,ae,ye).call(this,"GET","/chart");return e}async availability(){let{body:e}=await S(this,ae,ye).call(this,"GET","/availability"),t=Object.values(e.seats??{});return{...e,freeCount:t.filter(n=>n==="free").length,blockedCount:t.filter(n=>n!=="free").length}}async hold(e,t){let{body:n,response:o}=await S(this,ae,ye).call(this,"POST","/holds",{operationId:t,labels:[...e]});return{operation:ui(n.operation,{seasonId:m(this,xe),operationId:t}),response:o}}async bestAvailable(e){let{body:t,response:n}=await S(this,ae,ye).call(this,"POST","/best-available",{operationId:e.operationId,qty:e.qty,...e.categoryKey?{categoryKey:e.categoryKey}:{},...e.zoneId?{zoneId:e.zoneId}:{},...e.accessibility?.length?{accessibility:[...e.accessibility]}:{},...e.requireContiguous===!0?{requireContiguous:!0}:{}}),o=ui(t.operation,{seasonId:m(this,xe),operationId:e.operationId},"invalid_best_available_response"),{labels:s,items:r}=dh(t.labels,t.items,e.qty);return{operation:o,labels:s,items:r,response:n}}async operation(e){let{body:t,response:n}=await S(this,ae,ye).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:ui(t.operation,{seasonId:m(this,xe),operationId:e}),response:n}}async release(e,t){let{body:n,response:o}=await S(this,ae,ye).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:ui(n.operation,{seasonId:m(this,xe),operationId:e}),response:o}}async prices(){let e;try{({body:e}=await S(this,ae,ye).call(this,"GET","/prices"))}catch(t){if(t instanceof $&&t.status===404)return null;throw t}return ph(e)}async checkout(e){let{body:t}=await S(this,ae,ye).call(this,"POST","/checkout",{operationId:e.operationId,buyerEmail:e.buyerEmail,...e.buyerName?{buyerName:e.buyerName}:{},...e.provider?{provider:e.provider}:{},...e.returnUrl?{returnUrl:e.returnUrl}:{}});return hh(t)}async orderStatus(e){let t=await m(this,lt).call(this,`${m(this,at)}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit"}),n=await t.json().catch(()=>null);if(!t.ok)throw new $(_l(n),t.status);if(n===null)throw new $("invalid_json_response",502);return n}async renewalIntent(e){let{body:t}=await S(this,ae,ye).call(this,"POST","/renewal-intents",{offerId:e}),n=t.intent;if(!n||n.offerId!==e||n.state!=="intent_received"||!n.intentId||!Number.isFinite(n.receivedAt))throw new $("invalid_renewal_intent_response",502);return n}async waitForTerminal(e,t,n){let o=Date.now(),s=t?{operation:ui(t.operation,{seasonId:m(this,xe),operationId:e}),response:t.response}:await this.operation(e);for(;s.operation.state==="preparing"||s.operation.state==="commit_pending"||s.operation.state==="expire_pending"||s.operation.state==="booking_pending"||s.operation.state==="abort_pending";){if(Date.now()-o>=m(this,fi))throw new mi(e);await sh(oh(s.response,s.operation),n),s=await this.operation(e)}return s.operation}destroy(){m(this,Ae)||(T(this,Ae,!0),m(this,Ce).onRenewed(void 0),m(this,Ce).clear())}};xe=new WeakMap,at=new WeakMap,Ce=new WeakMap,lt=new WeakMap,fi=new WeakMap,Ae=new WeakMap,Pe=new WeakMap,ae=new WeakSet,ye=async function(e,t,n,o=!0){if(m(this,Ae))throw new $("season_api_destroyed",409);if(m(this,Pe))throw m(this,Pe);let s=await m(this,Ce).authorization();if(m(this,Ae))throw new $("season_api_destroyed",409);if(m(this,Pe))throw m(this,Pe);if(!s)throw new se({reason:"no_token",retryable:!1});let r=await m(this,lt).call(this,`${m(this,at)}/pub/seasons/${encodeURIComponent(m(this,xe))}${t}`,{method:e,headers:{Authorization:s,...n===void 0?{}:{"Content-Type":"application/json"}},body:n===void 0?void 0:JSON.stringify(n)}),a=await r.json().catch(()=>null);if(!r.ok){let l=_l(a);if(o&&await m(this,Ce).handleFailure(r.status,l))return S(this,ae,ye).call(this,e,t,n,!1);let c=m(this,Ce).unavailable;throw c?new se(c):new $(l,r.status)}if(a===null)throw new $("invalid_json_response",502);return{body:a,response:r}},Dl=async function(e){if(m(this,Ae))return;let t=`/pub/seasons/${encodeURIComponent(m(this,xe))}/session/adopt`;for(let n=0;n<2;n++){if(m(this,Ae))return;try{if((await m(this,lt).call(this,`${m(this,at)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){T(this,Pe,null);return}}catch{}}if(!m(this,Ae))throw T(this,Pe,new $("season_session_adopt_failed",409)),m(this,Pe)};var uh=2500;function mh(i){let e=typeof i=="string"?document.querySelector(i):i;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}function fh(i,e,t){if(i.startsAt==null)return{date:"Date to be announced",time:null};try{let n=new Date(i.startsAt),o=e?{timeZone:e}:{};return{date:new Intl.DateTimeFormat(t,{dateStyle:"medium",...o}).format(n),time:new Intl.DateTimeFormat(t,{timeStyle:"short",...o}).format(n)}}catch{return{date:"Date to be announced",time:null}}}function Bl(i){return i.state==="committed"||i.state==="booked"}var yo=class{constructor(e,t,n){this.transport=e;this.sink=t;this.intervalMs=n;this.timer=null;this.stopped=!0;this.prior={}}start(){this.stopped&&(this.stopped=!1,this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){if(!this.stopped)try{let e=await this.transport.objects(""),t=Object.entries(e.seats).filter(([n,o])=>this.prior[n]!==o).map(([n,o])=>({label:n,status:o}));this.prior={...e.seats},t.length&&this.sink.applyStatuses(t)}catch{this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},vo=class{constructor(e,t){this.api=e;this.realtimePollMs=t;this.descriptorValue=null;this.availabilityValue=null;this.categoryLabels=new Map;this.reuseAvailabilityOnce=!1;this.nextOperationId=null;this.nextBestAvailable=null;this.nextReleaseActionId=null;this.operationByHold=new Map}prime(e,t){this.descriptorValue=e,this.availabilityValue=t,this.reuseAvailabilityOnce=!0}queueOperation(e){this.nextOperationId=e}queueBestAvailable(e,t){if(this.nextBestAvailable)throw new $("season_best_available_in_progress",409);let n={operationId:e,...t.accessibility?.length?{accessibility:[...t.accessibility]}:{},...t.requireContiguous===!0?{requireContiguous:!0}:{}};return this.nextBestAvailable=n,n}clearBestAvailable(e){this.nextBestAvailable===e&&(this.nextBestAvailable=null)}queueRelease(e){this.nextReleaseActionId=e}operationForHold(e){return this.operationByHold.get(e)??null}remember(e){this.operationByHold.set(e.holdId,e)}forget(e){this.operationByHold.delete(e)}async chart(e){let[t,n]=await Promise.all([this.descriptorValue?Promise.resolve(this.descriptorValue):this.api.descriptor(),this.api.chart()]);this.descriptorValue=t;for(let o of n.categories??[])typeof o?.key=="string"&&typeof o.label=="string"&&this.categoryLabels.set(o.key,o.label);return{doc:n,event:{key:t.key,name:t.name,venue:t.venue,startsAt:t.occurrences[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}async objects(e){let t;return this.reuseAvailabilityOnce&&this.availabilityValue?(this.reuseAvailabilityOnce=!1,t=this.availabilityValue):(t=await this.api.availability(),this.availabilityValue=t),{seats:{...t.seats}}}async hold(e,t,n,o){if(o)throw new $("season_hold_replace_unsupported",409);let s=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let r=await this.api.hold(t.map(l=>l.label),s),a=await this.api.waitForTerminal(s,r);if(!Bl(a))throw new $(`season_operation_${a.state}`,409);return this.remember(a),{holdId:a.holdId,expiresAt:a.expiresAt,items:t.map(l=>({label:l.label,objectId:l.label,objectType:"seat",categoryKey:"",tierId:l.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...l.quantity==null?{}:{quantity:l.quantity}}))}}async release(e,t,n){let o=this.operationForHold(n);if(!o)throw new $("season_hold_not_found",404);let s=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let r=await this.api.release(o.operationId,s),a=await this.api.waitForTerminal(o.operationId,r);if(a.state==="partial_terminal")throw this.remember(a),new $("season_operation_partial_terminal",409);this.forget(n)}async bestAvailable(e,t,n,o){let s=this.nextBestAvailable;this.nextBestAvailable=null;let r=s?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:r,qty:t,...n?{categoryKey:n}:{},...o?{zoneId:o}:{},...s?.accessibility?.length?{accessibility:s.accessibility}:{},...s?.requireContiguous===!0?{requireContiguous:!0}:{}}),l=await this.api.waitForTerminal(r,a);if(!Bl(l))throw new $(`season_operation_${l.state}`,409);this.remember(l);let c=new Map(a.items.map(h=>[h.label,h]));return{holdId:l.holdId,expiresAt:l.expiresAt,labels:[...a.labels],items:a.labels.map(h=>{let d=c.get(h);return{label:h,objectId:d?.objectId??h,objectType:"seat",categoryKey:d?.categoryKey??n??"",tierId:d?.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...d?.quantity==null?{}:{quantity:d.quantity}}})}}categoryLabel(e){return this.categoryLabels.get(e)??e}socketUrl(){return""}createRealtime(e,t){return new yo(this,t,this.realtimePollMs)}},O,pt,zt,me,te,bi,ie,Ne,K,le,Se,$t,We,De,ht,ve,yi,Me,jt,Gt,ut,Ut,Ye,mt,ft,qt,w,Fl,Vl,wo,xo,So,ko,Cn,ct,zl,$l,_e,gi,jl,Gl,To,Eo,Ul,ql,Kl,Co,Ao,q,dt,Po,Vt,An=class{constructor(e){L(this,w);L(this,O);L(this,pt);L(this,zt);L(this,me);L(this,te);L(this,bi,new AbortController);L(this,ie,null);L(this,Ne,null);L(this,K,null);L(this,le,null);L(this,Se,null);L(this,$t,null);L(this,We,null);L(this,De,null);L(this,ht,null);L(this,ve,[]);L(this,yi,new Map);L(this,Me,!1);L(this,jt,!1);L(this,Gt);L(this,ut,null);L(this,Ut,null);L(this,Ye,null);L(this,mt,"handoff");L(this,ft,null);L(this,qt,!1);if(!e?.season)throw new Error("seatlayer: `season` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if("event"in e||"performanceGroup"in e)throw new Error("seatlayer: SeasonPicker is not SeatPicker or PerformanceGroupPicker");T(this,O,e),T(this,pt,mh(e.container));let t={onExpired:o=>e.onAccessExpired?.(o),onUnavailable:o=>{let s=m(this,ut)&&o.reason==="provider_failed"?m(this,ut):o;T(this,ut,null),T(this,Ut,s.reason==="provider_failed"?null:s),e.onAccessUnavailable?.(s),S(this,w,Ul).call(this,s)}};if(!e.buyerAccessToken&&!e.buyerAccessTokenProvider){let{access:o,loader:s}=Ol({base:(e.apiBase??"https://api.seatlayer.io").replace(/\/$/,""),season:e.season,fetch:e.fetch,onRefused:r=>{T(this,ut,r)},accessHooks:t});T(this,zt,o),T(this,Gt,s)}else T(this,Gt,null),T(this,zt,new ue({token:e.buyerAccessToken,provider:e.buyerAccessTokenProvider,...t}));T(this,me,new En(e.season,{apiBase:e.apiBase,access:m(this,zt),fetch:e.fetch,recoveryTimeoutMs:e.recoveryTimeoutMs})),T(this,te,new vo(m(this,me),Math.max(750,e.realtimePollMs??uh)))}async render(){S(this,w,Po).call(this),Il(),S(this,w,Vl).call(this),S(this,w,q).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{let[e,t,n]=await Promise.all([m(this,me).descriptor(),m(this,me).availability(),m(this,me).prices().catch(()=>null)]);return m(this,Me)?this:(T(this,ie,e),T(this,Ne,t),T(this,Ye,n),T(this,mt,m(this,O).checkout==="hosted"&&e.checkoutMode!=="server"&&n?"hosted":"handoff"),m(this,te).prime(e,t),S(this,w,wo).call(this),await S(this,w,Fl).call(this,e),m(this,Me)?this:(n&&S(this,w,wo).call(this),S(this,w,Kl).call(this),S(this,w,q).call(this,{kind:"ready",message:`${t.freeCount} seat${t.freeCount===1?"":"s"} available for every included performance.`}),m(this,O).initialOperationId&&await this.restoreOperation(m(this,O).initialOperationId),this))}catch(e){if(m(this,Me))return this;throw S(this,w,dt).call(this,e)}}async holdSameSeat(e,t){if(S(this,w,Vt).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!e.length)throw new Error("seatlayer: select at least one seat");if(m(this,te).queueOperation(t),m(this,le).selectObjectsWithoutConfirmation([...e]),S(this,w,q).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await m(this,le).handleCta(),!m(this,K))throw new $("season_hold_not_created",409);return m(this,K)}async holdBestAvailable(e,t,n={}){if(S(this,w,Vt).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: positive Best Available quantity is required");let o=m(this,le).maxTickets;if(e>o)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${o})`);if(m(this,jt))throw new $("season_best_available_in_progress",409);T(this,jt,!0);let s=null;try{if(s=m(this,te).queueBestAvailable(t,n),S(this,w,q).call(this,{kind:"pending",message:`Finding ${e} Season seat${e===1?"":"s"} available for every performance.`,operationId:t},!0),!await m(this,le).bestAvailableOrThrow(e,n.categoryKey,{zoneId:n.zoneId})||!m(this,K))throw new $("season_hold_not_created",409);return m(this,K)}catch(r){throw S(this,w,dt).call(this,r,t)}finally{s&&m(this,te).clearBestAvailable(s),T(this,jt,!1)}}async restoreOperation(e){S(this,w,Vt).call(this),S(this,w,q).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await m(this,me).waitForTerminal(e,void 0,m(this,bi).signal);return t.state==="aborted"||t.state==="expired"?(T(this,K,null),m(this,O).onHoldChange?.(null),S(this,w,q).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(m(this,te).remember(t),S(this,w,ko).call(this,t,!1))}catch(t){throw S(this,w,dt).call(this,t,e)}}async release(e){S(this,w,Vt).call(this);let t=m(this,K);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");m(this,te).queueRelease(e),S(this,w,q).call(this,{kind:"pending",message:"Releasing the Season seats.",operationId:t.operationId},!0);try{m(this,le)?.getCurrentHold()?.holdId===t.holdId?await m(this,le).release():(await m(this,te).release("",[],t.holdId),S(this,w,Cn).call(this)),S(this,w,q).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(n){throw S(this,w,dt).call(this,n,t.operationId)}}}async createRenewalIntent(e){if(S(this,w,Vt).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");S(this,w,q).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await m(this,me).renewalIntent(e);return S(this,w,q).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),m(this,O).onRenewalIntent?.(t),t}catch(t){throw S(this,w,dt).call(this,t)}}getDescriptor(){return m(this,ie)}getAvailability(){return m(this,Ne)}getHandoff(){return m(this,K)}destroy(){m(this,Me)||(T(this,Me,!0),m(this,bi).abort(),S(this,w,Ao).call(this),m(this,le)?.destroy(),m(this,me).destroy(),m(this,pt).replaceChildren(),T(this,Se,null),T(this,$t,null),T(this,We,null),T(this,De,null),T(this,ht,null),T(this,ie,null),T(this,Ne,null),T(this,K,null))}};O=new WeakMap,pt=new WeakMap,zt=new WeakMap,me=new WeakMap,te=new WeakMap,bi=new WeakMap,ie=new WeakMap,Ne=new WeakMap,K=new WeakMap,le=new WeakMap,Se=new WeakMap,$t=new WeakMap,We=new WeakMap,De=new WeakMap,ht=new WeakMap,ve=new WeakMap,yi=new WeakMap,Me=new WeakMap,jt=new WeakMap,Gt=new WeakMap,ut=new WeakMap,Ut=new WeakMap,Ye=new WeakMap,mt=new WeakMap,ft=new WeakMap,qt=new WeakMap,w=new WeakSet,Fl=async function(e){let t=new Ue(wn({container:m(this,$t),event:e.key,apiBase:m(this,O).apiBase,transport:m(this,te),hideEventDetails:!0,maxSelection:m(this,O).maxSelection,selectedObjects:m(this,O).selectedObjects,selectableObjects:m(this,O).selectableObjects,numberOfPlacesToSelect:m(this,O).numberOfPlacesToSelect,selectionValidators:m(this,O).selectionValidators,locale:m(this,O).locale,messages:m(this,O).messages,languages:m(this,O).languages,colorblindSafe:m(this,O).colorblindSafe,initialView:m(this,O).initialView,enable3D:m(this,O).enable3D,max3DSeats:m(this,O).max3DSeats,hideBadge:m(this,O).hideBadge,theme:m(this,O).theme,confirmSelection:m(this,O).confirmSelection,seatView:m(this,O).seatView,onBuyerViewChange:m(this,O).onBuyerViewChange,onAnalytics:(n,o)=>{try{m(this,O).onAnalytics?.(n,{...o,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:e.occurrenceCount})}catch{}},onSelectionChange:n=>{T(this,ve,n.map(o=>o.label)),T(this,yi,new Map(n.filter(o=>!!o.categoryKey).map(o=>[o.label,o.categoryKey]))),S(this,w,ct).call(this),m(this,O).onSelectionChange?.(n)},onSelectionValidityChange:m(this,O).onSelectionValidityChange,onHoldChange:n=>{if(!n){S(this,w,Cn).call(this);return}let o=m(this,te).operationForHold(n.holdId);o&&S(this,w,ko).call(this,o,!0)},onCheckout:()=>{m(this,K)&&(S(this,w,_e).call(this,"checkout"),m(this,O).onContinue?.(m(this,K)),m(this,mt)==="hosted"&&S(this,w,ql).call(this,m(this,K)))},onHoldExpired:()=>{S(this,w,Cn).call(this),S(this,w,q).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),m(this,O).onHoldExpired?.()},onError:n=>S(this,w,dt).call(this,n)},{surface:"season",performanceCount:e.occurrenceCount,selectionMode:"same_seat",suppressPricing:!0,groupSelectionSummary:()=>{let n=m(this,ve).length;return n?{seats:n,performances:e.occurrenceCount,performancesChosen:e.occurrenceCount,perPerformance:n}:null}}));T(this,le,t),await t.render()},Vl=function(){m(this,pt).replaceChildren();let e=document.createElement("section");e.className="sl-season-root",e.setAttribute("aria-label","Season ticket selection");let t=document.createElement("header");t.className="sl-season-hero";let n=document.createElement("ol");n.className="sl-season-progress",n.setAttribute("aria-label","Season checkout progress");for(let[b,k]of["Choose seats","Review package","Checkout"].entries()){let x=document.createElement("li");x.dataset.state=b===0?"current":"upcoming";let v=document.createElement("span");v.textContent=String(b+1),x.append(v,k),n.append(x)}let o=document.createElement("div");o.className="sl-season-stage";let s=document.createElement("div");s.className="sl-season-map";let r=document.createElement("aside");r.className="sl-season-summary-card",r.setAttribute("aria-label","Your Season selection");let a=document.createElement("h3");a.textContent="Your Season seats";let l=document.createElement("p");l.className="sl-season-selection",l.textContent="Choose a seat on the map.";let c=document.createElement("p");c.className="sl-season-rule";let h=document.createElement("i");h.textContent="1\xD7";let d=document.createElement("span");d.textContent="Each seat you choose is reserved for every included performance.",c.append(h,d);let u=document.createElement("p");u.className="sl-season-availability";let p=document.createElement("p");p.className="sl-season-checkout-note",p.textContent="Your ticketing platform confirms package price, payment, admission passes, and member benefits.",r.append(a,l,c,u,p),o.append(s,r);let f=document.createElement("p");f.className="sl-season-status",f.setAttribute("role","status"),f.setAttribute("aria-live","polite"),e.append(t,n,o,f),m(this,pt).append(e),T(this,Se,e),T(this,$t,s),T(this,We,f),T(this,De,l),T(this,ht,u)},wo=function(){let e=m(this,ie),t=m(this,O).offer,n=m(this,Se).querySelector(".sl-season-hero");n.replaceChildren();let o=document.createElement("div");o.className="sl-season-copy";let s=document.createElement("p");s.className="sl-season-eyebrow",s.textContent=t?.eyebrow??"Season ticket";let r=document.createElement("h2");r.textContent=e.edition?`${e.name} \xB7 ${e.edition}`:e.name;let a=document.createElement("p");a.className="sl-season-promise",a.textContent=`Choose once and keep the same seat for all ${e.occurrenceCount} included performances.`;let l=document.createElement("div");l.className="sl-season-facts";for(let p of[`${e.occurrenceCount} performances`,e.venue,t?.renewalLabel??"Same-seat package"].filter(Boolean)){let f=document.createElement("span");f.className="sl-season-fact",f.textContent=p,l.append(f)}o.append(s,r,a,l),n.append(o);let c=document.createElement("div");c.className="sl-season-offer";let h=document.createElement("span");h.className="sl-season-offer-label";let d=S(this,w,gi).call(this);if(d){h.textContent=g("season.packagePriceLabel","Package price"),c.append(h,S(this,w,Gl).call(this,d,e.occurrenceCount));let p=document.createElement("span");p.className="sl-season-price-note",p.textContent=g("season.packagePricePerSeat","Per seat, for the whole package."),c.append(p),n.append(c),S(this,w,xo).call(this,n,t),S(this,w,So).call(this,n,e),S(this,w,ct).call(this);return}h.textContent=t?.priceLabel?"Season package":"Package price";let u=document.createElement(t?.priceLabel?"strong":"span");if(u.className=t?.priceLabel?"sl-season-price":"sl-season-price-note",u.textContent=t?.priceLabel??"Confirmed by your ticketing platform at checkout",c.append(h,u),t?.compareAtPriceLabel){let p=document.createElement("span");p.className="sl-season-was",p.textContent=t.compareAtPriceLabel,c.append(p)}if(t?.savingsLabel){let p=document.createElement("span");p.className="sl-season-saving",p.textContent=t.savingsLabel,c.append(p)}if(t?.priceNote){let p=document.createElement("span");p.className="sl-season-price-note",p.textContent=t.priceNote,c.append(p)}n.append(c),S(this,w,xo).call(this,n,t),S(this,w,So).call(this,n,e),S(this,w,ct).call(this)},xo=function(e,t){if(!t?.benefits?.length)return;let n=document.createElement("ul");n.className="sl-season-benefits";for(let o of t.benefits.slice(0,6)){let s=document.createElement("li");s.textContent=o,n.append(s)}e.append(n)},So=function(e,t){let n=document.createElement("details");n.className="sl-season-dates";let o=document.createElement("summary");o.textContent=`All ${t.occurrenceCount} performances included`;let s=document.createElement("ol");s.className="sl-season-date-list";for(let r of t.occurrences){let a=document.createElement("li");a.className="sl-season-date";let l=document.createElement("b");l.textContent=r.name;let c=fh(r,t.timezone,m(this,O).locale),h=document.createElement("time");r.startsAt!=null&&(h.dateTime=new Date(r.startsAt).toISOString()),h.textContent=c.time?`${c.date} \xB7 ${c.time}`:c.date,a.append(l,h),s.append(a)}n.append(o,s),e.append(n)},ko=function(e,t){if(e.state==="booked")return T(this,K,null),m(this,te).forget(e.holdId),m(this,le)?.notifyGroupSettled("booked"),S(this,w,_e).call(this,"complete"),S(this,w,q).call(this,{kind:"booked",message:`Your Season booking is complete for all ${m(this,ie).occurrenceCount} performances. No further checkout action is needed.`,operationId:e.operationId}),m(this,O).onHoldChange?.(null),null;if(e.state==="partial_terminal")return T(this,K,null),T(this,ve,[]),m(this,te).forget(e.holdId),m(this,le)?.notifyGroupSettled("lost"),S(this,w,ct).call(this),S(this,w,_e).call(this,"review"),S(this,w,q).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),m(this,O).onHoldChange?.(null),null;if(e.state!=="committed")return T(this,K,null),m(this,te).forget(e.holdId),m(this,le)?.notifyGroupSettled("lost"),S(this,w,q).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),m(this,O).onHoldChange?.(null),null;let n=Nl(m(this,ie),e),o=m(this,K)?.holdId!==n.holdId;return T(this,K,n),S(this,w,ct).call(this),S(this,w,_e).call(this,"review"),m(this,O).onHoldChange?.(n),S(this,w,q).call(this,{kind:"held",message:`Your seats are held for all ${m(this,ie).occurrenceCount} performances. Review and continue to checkout.`,operationId:e.operationId}),o&&t&&m(this,O).onHold?.(n),n},Cn=function(){T(this,K,null),T(this,ve,[]),S(this,w,ct).call(this),S(this,w,_e).call(this,"choose"),m(this,O).onHoldChange?.(null)},ct=function(){if(!m(this,De))return;let e=m(this,ve).length;if(!e)m(this,De).textContent="Choose a seat on the map. Unavailable seats are already booked on at least one included performance.";else{m(this,De).replaceChildren();let t=document.createElement("strong");t.textContent=m(this,ve).join(", "),m(this,De).append(t,` \xB7 ${e} Season seat${e===1?"":"s"} across all ${m(this,ie)?.occurrenceCount??0} performances`)}m(this,ht)&&m(this,Ne)&&(m(this,ht).textContent=`${m(this,Ne).freeCount} seat${m(this,Ne).freeCount===1?"":"s"} currently available for the complete Season`),S(this,w,zl).call(this),S(this,w,$l).call(this)},zl=function(){let e=m(this,Se)?.querySelector(".sl-season-summary-card");if(!e)return;e.querySelector(".sl-season-package-total")?.remove();let t=S(this,w,To).call(this);if(t==null)return;let n=m(this,Ye)?.currency??m(this,ie)?.currency??"USD",o=m(this,ie)?.occurrenceCount??0,s=document.createElement("p");s.className="sl-season-package-total";let r=document.createElement("span");r.textContent=g("season.packageTotal","Package total");let a=document.createElement("strong");a.textContent=S(this,w,Eo).call(this,t,n);let l=document.createElement("span");l.className="sl-season-package-total-scope",l.textContent=g("season.priceForAllDates","for all {count} dates").replace("{count}",String(o)),s.append(r,a,l);let c=e.querySelector(".sl-season-checkout-note");c?e.insertBefore(s,c):e.append(s)},$l=function(){let e=m(this,Se)?.querySelector(".sl-season-checkout-note");if(e){if(m(this,mt)==="hosted"){e.textContent=g("season.hostedCheckoutNote","You pay for the whole package here. Your tickets for every performance arrive by email.");return}if(S(this,w,gi).call(this)){e.textContent=g("season.serverCheckoutPricedNote","Payment and admission passes are completed in the checkout on this page.");return}e.textContent="Your ticketing platform confirms package price, payment, admission passes, and member benefits."}},_e=function(e){let t=e==="choose"?0:e==="review"?1:e==="checkout"?2:3;m(this,Se)?.querySelectorAll(".sl-season-progress li").forEach((n,o)=>{n.dataset.state=o<t?"done":o===t?"current":"upcoming";let s=n.querySelector("span");s&&(s.textContent=o<t?"\u2713":String(o+1))})},gi=function(){let e=m(this,Ye)?.packages;if(!e?.length)return null;let t=m(this,ie)?.planActivationId,n=e.find(r=>r.planKey===t);if(n)return n;let o=m(this,Gt)?.session?.planActivationIds;return(o?.length?e.filter(r=>o.includes(r.planKey)):[])[0]??e[0]},jl=function(e){let t=S(this,w,gi).call(this)?.prices.find(n=>n.categoryKey===e);return t?t.unitPrice:null},Gl=function(e,t){let n=document.createElement("ul");n.className="sl-season-price-lines";let o=m(this,Ye)?.currency??m(this,ie)?.currency??"USD";for(let s of e.prices){let r=document.createElement("li"),a=document.createElement("span");a.className="sl-season-price-category",a.textContent=m(this,te).categoryLabel(s.categoryKey);let l=document.createElement("strong");l.className="sl-season-price",l.textContent=S(this,w,Eo).call(this,s.unitPrice,o);let c=document.createElement("span");c.className="sl-season-price-scope",c.textContent=g("season.priceForAllDates","for all {count} dates").replace("{count}",String(t)),r.append(a,l,c),n.append(r)}return n},To=function(){if(!m(this,ve).length||!S(this,w,gi).call(this))return null;let e=0;for(let t of m(this,ve)){let n=m(this,yi).get(t),o=n?S(this,w,jl).call(this,n):null;if(o==null)return null;e+=o}return e},Eo=function(e,t){let n=(0,Kt.fromMinorUnits)(e,t),o=Number.isInteger(n);return(0,Kt.formatMoney)(n,t,{locale:m(this,O).locale,fallback:(s,r)=>`${s} ${r}`,...o?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})},Ul=function(e){let t=e.reason==="audience_not_public"?g("season.accessNotPublic","This season isn't open for online booking yet."):e.reason==="sales_not_open"?g("season.accessSalesNotOpen","Season tickets aren't on sale right now. Check back when sales open."):e.reason==="origin_not_allowed"?g("season.accessOriginNotAllowed","This season can't be booked from this page."):g("season.accessUnavailable","Season tickets can't be loaded right now. Please try again later.");S(this,w,q).call(this,{kind:"failed",message:t})},ql=async function(e){if(!m(this,qt)){T(this,qt,!0);try{let t=m(this,Ye)?.currency??m(this,ie)?.currency??"USD",n=S(this,w,To).call(this);if(n==null){S(this,w,q).call(this,{kind:"failed",message:g("season.checkoutNotPriced","We can\u2019t price this package here. Your seats are still held \u2014 please continue in the checkout on this page."),operationId:e.operationId});return}await S(this,w,Co).call(this,{kind:"pay",provider:null,order:{holdId:e.operationId,expiresAt:e.expiresAt,currency:t,total:(0,Kt.fromMinorUnits)(n,t),labels:[...m(this,ve)]}})}finally{T(this,qt,!1)}}},Kl=function(){if(m(this,mt)!=="hosted")return;let e=xn(m(this,O).season);e?.outcome!=="success"||!e.orderId||(S(this,w,_e).call(this,"checkout"),S(this,w,Co).call(this,{kind:"resume",orderId:e.orderId}))},Co=async function(e){let t;try{({mountCheckout:t}=await Ci())}catch(o){m(this,O).onError?.(o),S(this,w,q).call(this,{kind:"failed",message:g("season.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held \u2014 please try again.")});return}let n=m(this,le)?.root;m(this,Me)||!n||(S(this,w,Ao).call(this),T(this,ft,t({root:n,state:e,eventKey:m(this,O).season,formatMoney:(o,s)=>(0,Kt.formatMoney)(o,s,{locale:m(this,O).locale,fallback:(r,a)=>`${r} ${a}`,...Number.isInteger(o)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:o=>m(this,me).checkout({operationId:o.holdId,buyerEmail:o.buyerEmail,...o.buyerName?{buyerName:o.buyerName}:{},...m(this,O).returnUrl?{returnUrl:m(this,O).returnUrl}:{}}),orderStatus:o=>m(this,me).orderStatus(o),onCancel:()=>{T(this,ft,null),m(this,K)&&S(this,w,_e).call(this,"review")},onConfirmed:o=>{m(this,O).onOrderConfirmed?.(o),S(this,w,_e).call(this,"complete"),S(this,w,q).call(this,{kind:"booked",message:g("season.orderConfirmed","Your season tickets are confirmed for every included performance.")})},onError:o=>m(this,O).onError?.(o)})))},Ao=function(){m(this,ft)?.destroy(),T(this,ft,null)},q=function(e,t=!1){m(this,We)&&(m(this,We).textContent=e.message,m(this,We).dataset.kind=e.kind),m(this,Se)&&(m(this,Se).dataset.busy=String(t)),m(this,O).onStatusChange?.(e)},dt=function(e,t){let n=e instanceof se&&e.reason==="provider_failed"&&m(this,Ut)?new se(m(this,Ut)):e;if(n instanceof se)return m(this,O).onError?.(n),n;let o=n instanceof $?`Season selection unavailable (${n.code}).`:"Season selection could not be completed.";return S(this,w,q).call(this,{kind:"failed",message:o,operationId:t}),m(this,O).onError?.(n),n},Po=function(){if(m(this,Me))throw new Error("seatlayer: SeasonPicker was destroyed")},Vt=function(){if(S(this,w,Po).call(this),!m(this,ie)||!m(this,le))throw new Error("seatlayer: render SeasonPicker before using it")};function Wl(i,e={}){let t=e.origin??"";if(!t)try{t=new URL(i.src,window.location.href).origin}catch{t=""}let n=!1,o=null,s=null,r=null,a="",l=null,c="",h=()=>{if(n)return;n=!0,o=i.getAttribute("style"),Object.assign(i.style,{position:"fixed",inset:"0",margin:"0",border:"0",zIndex:"2147483000",background:c||"transparent"}),i.style.width="100vw",i.style.height="100vh",i.style.width="100dvw",i.style.height="100dvh";let p=document.documentElement;s=p.style.overflow,p.style.overflow="hidden",document.body&&(r=document.body.style.overflow,document.body.style.overflow="hidden"),l=f=>{f.key==="Escape"&&d()},window.addEventListener("keydown",l)},d=()=>{n&&(n=!1,o===null?i.removeAttribute("style"):i.setAttribute("style",o),o=null,a&&(i.style.height=a),s!==null&&(document.documentElement.style.overflow=s,s=null),r!==null&&document.body&&(document.body.style.overflow=r,r=null),l&&(window.removeEventListener("keydown",l),l=null))},u=p=>{if(p.source!==i.contentWindow||t&&p.origin!==t||!p.data||typeof p.data!="object")return;let f=p.data;if(f.type==="seatlayer:height"){typeof f.px=="number"&&Number.isFinite(f.px)&&f.px>0&&(a=`${Math.round(f.px)}px`,n||(i.style.height=a));return}f.type==="seatlayer:fullscreen"&&(typeof f.background=="string"&&/^[#a-zA-Z0-9(),.%\s-]{1,64}$/.test(f.background)&&(c=f.background,n&&(i.style.background=c)),f.on===!0?h():f.on===!1&&d())};return window.addEventListener("message",u),()=>{window.removeEventListener("message",u),d()}}0&&(module.exports={ApiError,BuyerAccessContext,BuyerAccessUnavailableError,BuyerRealtimeClient,EmbeddedDesigner,PerformanceGroupDestroyedError,PerformanceGroupPicker,SEATING_CHART_CALLBACK_PROPS,SEATING_CHART_HANDLE_METHODS,SEATING_CHART_IDENTITY_PROPS,SEATING_CHART_VALUE_PROPS,SeasonApiError,SeasonPicker,SeasonPublicSessionRefused,SeasonRecoveryTimeoutError,SeatPicker,SeatingChart,attachPickerFrame,bindSeatingChartHandle,buildSeatingChartOptions,createBuyerAccessContext,createControllerSink,parseTicketOfferAvailability,shortOperationReference,ticketOfferPrices});
|
|
3222
|
+
`,document.head.appendChild(i)}var Wp=new Set(["audience_not_public","sales_not_open","origin_not_allowed"]),Yp=3e4;function Xp(i,e){if(!i||typeof i!="object"||Array.isArray(i))return!1;let t=i;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.seasonKey===e&&Array.isArray(t.planActivationIds)&&t.planActivationIds.every(n=>typeof n=="string"&&!!n)}var di=class extends Error{constructor(t,n){super(`season_public_session_refused:${t}`);this.reason=t;this.status=n;this.name="SeasonPublicSessionRefused"}},_e,We,pi,Ft,go=class{constructor(e){this.options=e;M(this,_e,null);M(this,We,null);M(this,pi);M(this,Ft);k(this,pi,e.fetch??globalThis.fetch.bind(globalThis)),k(this,Ft,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return m(this,_e)}async mint(e=!1){if(e&&k(this,_e,null),m(this,_e)&&m(this,_e).expiresAt-Yp>Date.now())return m(this,_e);if(m(this,We))return m(this,We);let t=(async()=>{let n=await m(this,pi).call(this,`${this.options.base}/pub/seasons/${encodeURIComponent(this.options.season)}/sessions`,{method:"POST",body:JSON.stringify(m(this,Ft)?{origin:m(this,Ft)}:{}),credentials:"omit"}),o=await n.json().catch(()=>null);if(!n.ok){let s=o?.code??o?.error;if(n.status===403&&s&&Wp.has(s)){let r=s;throw this.options.onRefused?.({reason:r,code:s,status:n.status,retryable:r==="sales_not_open"}),new di(r,n.status)}throw new Error(`season_public_session_failed_${n.status}`)}if(!Xp(o,this.options.season))throw new Error("season_public_session_invalid");return k(this,_e,o),o})();k(this,We,t);try{return await t}finally{m(this,We)===t&&k(this,We,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",n=await this.mint(t);return{token:n.token,expiresAt:n.expiresAt}}};_e=new WeakMap,We=new WeakMap,pi=new WeakMap,Ft=new WeakMap;function Ml(i){let e=new go(i);return{access:new ue({provider:({reason:n})=>e.token(n),...i.accessHooks}),loader:e}}var Zp="https://api.seatlayer.io",Qp=6e4,Jp=5e3,z=class extends Error{constructor(t,n){super(`season_request_failed:${t}`);this.code=t;this.status=n;this.name="SeasonApiError"}},ui=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}};function eh(i,e){let t=Number(i.headers.get("Retry-After")),n=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(Jp,n*1e3))}function th(i,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,n)=>{let o=setTimeout(t,i);e?.addEventListener("abort",()=>{clearTimeout(o),n(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function Hl(i){if(!i||typeof i!="object")return"unknown";let e=i;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}var ih=/^shc_[a-f0-9]{40}$/,nh=/^shh_[a-f0-9]{40}$/,oh=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),sh=new Set(["pending","prepared","refused","applied","expired","booked","aborted"]);function bo(i){return Array.isArray(i)?i.some(bo):!i||typeof i!="object"?!1:Object.entries(i).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&ih.test(t)||bo(t))}function hi(i,e,t="invalid_operation_response"){if(!i||typeof i!="object"||Array.isArray(i))throw new z(t,502);if(bo(i))throw new z("unsafe_operation_response",502);let n=i,o=n.allocations,s=new Set,r=Array.isArray(o)&&o.length>0&&o.every(d=>{if(!d||typeof d!="object")return!1;let u=d.eventId,p=d.state;return typeof u!="string"||!u||typeof p!="string"||!sh.has(p)||s.has(u)?!1:(s.add(u),!0)}),a=n.bookingRef===null||typeof n.bookingRef=="string"&&n.bookingRef.length>0,l=n.state!=="booked"||typeof n.bookingRef=="string"&&r&&o.every(d=>d.state==="booked"),c=n.state!=="booking_pending"||typeof n.bookingRef=="string"&&r&&o.some(d=>d.state!=="booked"),h=n.state!=="committed"||n.bookingRef===null;if(n.operationId!==e.operationId||n.seasonId!==e.seasonId||n.kind!=="HOLD"||typeof n.holdId!="string"||!nh.test(n.holdId)||n.policy!=="fixed_inclusion_same_seat"||typeof n.state!="string"||!oh.has(n.state)||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)||n.expiresAt<0||!a||typeof n.location!="string"||!n.location||typeof n.retryAfterSeconds!="number"||!Number.isFinite(n.retryAfterSeconds)||n.retryAfterSeconds<0||!r||!l||!c||!h||n.pricingAuthority!==void 0&&n.pricingAuthority!=="host"||n.authoritativeAmountIncluded!==void 0&&n.authoritativeAmountIncluded!==!1)throw new z(t,502);return{operationId:n.operationId,seasonId:n.seasonId,kind:n.kind,holdId:n.holdId,expiresAt:n.expiresAt,policy:n.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:n.state,bookingRef:n.bookingRef,location:n.location,retryAfterSeconds:n.retryAfterSeconds,allocations:o.map(d=>({eventId:d.eventId,state:d.state}))}}function rh(i,e,t){if(!Array.isArray(i)||i.length!==t||i.some(r=>typeof r!="string"||!r)||new Set(i).size!==i.length||!Array.isArray(e)||e.length!==i.length)throw new z("invalid_best_available_response",502);let n=i,o=new Set(n),s=new Map;for(let r of e){if(!r||typeof r!="object")throw new z("invalid_best_available_response",502);let a=r;if(typeof a.label!="string"||!o.has(a.label)||s.has(a.label)||typeof a.objectId!="string"||!a.objectId||a.objectType!=="seat"||typeof a.categoryKey!="string"||!a.categoryKey||a.tierId!==null&&(typeof a.tierId!="string"||!a.tierId)||a.quantity!==void 0&&a.quantity!==1)throw new z("invalid_best_available_response",502);s.set(a.label,{label:a.label,objectId:a.objectId,objectType:"seat",categoryKey:a.categoryKey,tierId:a.tierId,...a.quantity===void 0?{}:{quantity:a.quantity}})}return{labels:n,items:n.map(r=>s.get(r))}}function ah(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i;if(typeof e.currency!="string"||!e.currency||!Array.isArray(e.packages))return null;let t=[];for(let n of e.packages){if(!n||typeof n!="object")continue;let o=n;if(typeof o.planKey!="string"||!o.planKey||!Array.isArray(o.prices))continue;let s=[],r=new Set;for(let a of o.prices){if(!a||typeof a!="object")continue;let l=a;typeof l.categoryKey!="string"||!l.categoryKey||r.has(l.categoryKey)||typeof l.unitPrice!="number"||!Number.isInteger(l.unitPrice)||l.unitPrice<0||(r.add(l.categoryKey),s.push({categoryKey:l.categoryKey,unitPrice:l.unitPrice}))}s.length&&t.push({planKey:o.planKey,name:typeof o.name=="string"&&o.name?o.name:o.planKey,prices:s})}return t.length?{currency:e.currency,packages:t}:null}function lh(i){if(!i||typeof i!="object"||Array.isArray(i))throw new z("invalid_checkout_response",502);let e=i,t=typeof e.redirectUrl=="string"&&!!e.redirectUrl,n=!!e.clientPayload&&typeof e.clientPayload=="object"&&!Array.isArray(e.clientPayload);if(typeof e.orderId!="string"||!e.orderId||typeof e.currency!="string"||!e.currency||typeof e.totalMinor!="number"||!Number.isFinite(e.totalMinor)||typeof e.expiresAt!="number"||!Number.isFinite(e.expiresAt)||t===n)throw new z("invalid_checkout_response",502);return{orderId:e.orderId,totalMinor:e.totalMinor,currency:e.currency,expiresAt:e.expiresAt,...t?{redirectUrl:e.redirectUrl}:{},...n?{clientPayload:e.clientPayload}:{}}}function Rl(i,e){return{seasonKey:i.key,planActivationId:i.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:e.state,allocations:e.allocations.map(({eventId:t,state:n})=>({eventKey:t,state:n}))}}var Se,lt,Ae,ct,mi,Pe,Le,ae,ve,Il,Tn=class{constructor(e,t){M(this,ae);M(this,Se);M(this,lt);M(this,Ae);M(this,ct);M(this,mi);M(this,Pe,!1);M(this,Le,null);k(this,Se,e),k(this,lt,(t.apiBase??Zp).replace(/\/$/,"")),k(this,Ae,t.access),k(this,ct,t.fetch??globalThis.fetch.bind(globalThis)),k(this,mi,t.recoveryTimeoutMs??Qp),m(this,Ae).onRenewed(n=>x(this,ae,Il).call(this,n))}async descriptor(){let{body:e}=await x(this,ae,ve).call(this,"GET","");return e.season}async chart(){let{body:e}=await x(this,ae,ve).call(this,"GET","/chart");return e}async availability(){let{body:e}=await x(this,ae,ve).call(this,"GET","/availability"),t=Object.values(e.seats??{});return{...e,freeCount:t.filter(n=>n==="free").length,blockedCount:t.filter(n=>n!=="free").length}}async hold(e,t){let{body:n,response:o}=await x(this,ae,ve).call(this,"POST","/holds",{operationId:t,labels:[...e]});return{operation:hi(n.operation,{seasonId:m(this,Se),operationId:t}),response:o}}async bestAvailable(e){let{body:t,response:n}=await x(this,ae,ve).call(this,"POST","/best-available",{operationId:e.operationId,qty:e.qty,...e.categoryKey?{categoryKey:e.categoryKey}:{},...e.zoneId?{zoneId:e.zoneId}:{},...e.accessibility?.length?{accessibility:[...e.accessibility]}:{},...e.requireContiguous===!0?{requireContiguous:!0}:{}}),o=hi(t.operation,{seasonId:m(this,Se),operationId:e.operationId},"invalid_best_available_response"),{labels:s,items:r}=rh(t.labels,t.items,e.qty);return{operation:o,labels:s,items:r,response:n}}async operation(e){let{body:t,response:n}=await x(this,ae,ve).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:hi(t.operation,{seasonId:m(this,Se),operationId:e}),response:n}}async release(e,t){let{body:n,response:o}=await x(this,ae,ve).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:hi(n.operation,{seasonId:m(this,Se),operationId:e}),response:o}}async prices(){let e;try{({body:e}=await x(this,ae,ve).call(this,"GET","/prices"))}catch(t){if(t instanceof z&&t.status===404)return null;throw t}return ah(e)}async checkout(e){let{body:t}=await x(this,ae,ve).call(this,"POST","/checkout",{operationId:e.operationId,buyerEmail:e.buyerEmail,...e.buyerName?{buyerName:e.buyerName}:{},...e.provider?{provider:e.provider}:{},...e.returnUrl?{returnUrl:e.returnUrl}:{}});return lh(t)}async orderStatus(e){let t=await m(this,ct).call(this,`${m(this,lt)}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit"}),n=await t.json().catch(()=>null);if(!t.ok)throw new z(Hl(n),t.status);if(n===null)throw new z("invalid_json_response",502);return n}async renewalIntent(e){let{body:t}=await x(this,ae,ve).call(this,"POST","/renewal-intents",{offerId:e}),n=t.intent;if(!n||n.offerId!==e||n.state!=="intent_received"||!n.intentId||!Number.isFinite(n.receivedAt))throw new z("invalid_renewal_intent_response",502);return n}async waitForTerminal(e,t,n){let o=Date.now(),s=t?{operation:hi(t.operation,{seasonId:m(this,Se),operationId:e}),response:t.response}:await this.operation(e);for(;s.operation.state==="preparing"||s.operation.state==="commit_pending"||s.operation.state==="expire_pending"||s.operation.state==="booking_pending"||s.operation.state==="abort_pending";){if(Date.now()-o>=m(this,mi))throw new ui(e);await th(eh(s.response,s.operation),n),s=await this.operation(e)}return s.operation}destroy(){m(this,Pe)||(k(this,Pe,!0),m(this,Ae).onRenewed(void 0),m(this,Ae).clear())}};Se=new WeakMap,lt=new WeakMap,Ae=new WeakMap,ct=new WeakMap,mi=new WeakMap,Pe=new WeakMap,Le=new WeakMap,ae=new WeakSet,ve=async function(e,t,n,o=!0){if(m(this,Pe))throw new z("season_api_destroyed",409);if(m(this,Le))throw m(this,Le);let s=await m(this,Ae).authorization();if(m(this,Pe))throw new z("season_api_destroyed",409);if(m(this,Le))throw m(this,Le);if(!s)throw new se({reason:"no_token",retryable:!1});let r=await m(this,ct).call(this,`${m(this,lt)}/pub/seasons/${encodeURIComponent(m(this,Se))}${t}`,{method:e,headers:{Authorization:s,...n===void 0?{}:{"Content-Type":"application/json"}},body:n===void 0?void 0:JSON.stringify(n)}),a=await r.json().catch(()=>null);if(!r.ok){let l=Hl(a);if(o&&await m(this,Ae).handleFailure(r.status,l))return x(this,ae,ve).call(this,e,t,n,!1);let c=m(this,Ae).unavailable;throw c?new se(c):new z(l,r.status)}if(a===null)throw new z("invalid_json_response",502);return{body:a,response:r}},Il=async function(e){if(m(this,Pe))return;let t=`/pub/seasons/${encodeURIComponent(m(this,Se))}/session/adopt`;for(let n=0;n<2;n++){if(m(this,Pe))return;try{if((await m(this,ct).call(this,`${m(this,lt)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){k(this,Le,null);return}}catch{}}if(!m(this,Pe))throw k(this,Le,new z("season_session_adopt_failed",409)),m(this,Le)};var ch=2500;function dh(i){let e=typeof i=="string"?document.querySelector(i):i;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}function ph(i,e,t){if(i.startsAt==null)return{date:"Date to be announced",time:null};try{let n=new Date(i.startsAt),o=e?{timeZone:e}:{};return{date:new Intl.DateTimeFormat(t,{dateStyle:"medium",...o}).format(n),time:new Intl.DateTimeFormat(t,{timeStyle:"short",...o}).format(n)}}catch{return{date:"Date to be announced",time:null}}}function Ol(i){return i.state==="committed"||i.state==="booked"}var yo=class{constructor(e,t,n){this.transport=e;this.sink=t;this.intervalMs=n;this.timer=null;this.stopped=!0;this.prior={}}start(){this.stopped&&(this.stopped=!1,this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){if(!this.stopped)try{let e=await this.transport.objects(""),t=Object.entries(e.seats).filter(([n,o])=>this.prior[n]!==o).map(([n,o])=>({label:n,status:o}));this.prior={...e.seats},t.length&&this.sink.applyStatuses(t)}catch{this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},vo=class{constructor(e,t){this.api=e;this.realtimePollMs=t;this.descriptorValue=null;this.availabilityValue=null;this.categoryLabels=new Map;this.reuseAvailabilityOnce=!1;this.nextOperationId=null;this.nextBestAvailable=null;this.nextReleaseActionId=null;this.operationByHold=new Map}prime(e,t){this.descriptorValue=e,this.availabilityValue=t,this.reuseAvailabilityOnce=!0}queueOperation(e){this.nextOperationId=e}queueBestAvailable(e,t){if(this.nextBestAvailable)throw new z("season_best_available_in_progress",409);let n={operationId:e,...t.accessibility?.length?{accessibility:[...t.accessibility]}:{},...t.requireContiguous===!0?{requireContiguous:!0}:{}};return this.nextBestAvailable=n,n}clearBestAvailable(e){this.nextBestAvailable===e&&(this.nextBestAvailable=null)}queueRelease(e){this.nextReleaseActionId=e}operationForHold(e){return this.operationByHold.get(e)??null}remember(e){this.operationByHold.set(e.holdId,e)}forget(e){this.operationByHold.delete(e)}async chart(e){let[t,n]=await Promise.all([this.descriptorValue?Promise.resolve(this.descriptorValue):this.api.descriptor(),this.api.chart()]);this.descriptorValue=t;for(let o of n.categories??[])typeof o?.key=="string"&&typeof o.label=="string"&&this.categoryLabels.set(o.key,o.label);return{doc:n,event:{key:t.key,name:t.name,venue:t.venue,startsAt:t.occurrences[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}async objects(e){let t;return this.reuseAvailabilityOnce&&this.availabilityValue?(this.reuseAvailabilityOnce=!1,t=this.availabilityValue):(t=await this.api.availability(),this.availabilityValue=t),{seats:{...t.seats}}}async hold(e,t,n,o){if(o)throw new z("season_hold_replace_unsupported",409);let s=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let r=await this.api.hold(t.map(l=>l.label),s),a=await this.api.waitForTerminal(s,r);if(!Ol(a))throw new z(`season_operation_${a.state}`,409);return this.remember(a),{holdId:a.holdId,expiresAt:a.expiresAt,items:t.map(l=>({label:l.label,objectId:l.label,objectType:"seat",categoryKey:"",tierId:l.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...l.quantity==null?{}:{quantity:l.quantity}}))}}async release(e,t,n){let o=this.operationForHold(n);if(!o)throw new z("season_hold_not_found",404);let s=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let r=await this.api.release(o.operationId,s),a=await this.api.waitForTerminal(o.operationId,r);if(a.state==="partial_terminal")throw this.remember(a),new z("season_operation_partial_terminal",409);this.forget(n)}async bestAvailable(e,t,n,o){let s=this.nextBestAvailable;this.nextBestAvailable=null;let r=s?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:r,qty:t,...n?{categoryKey:n}:{},...o?{zoneId:o}:{},...s?.accessibility?.length?{accessibility:s.accessibility}:{},...s?.requireContiguous===!0?{requireContiguous:!0}:{}}),l=await this.api.waitForTerminal(r,a);if(!Ol(l))throw new z(`season_operation_${l.state}`,409);this.remember(l);let c=new Map(a.items.map(h=>[h.label,h]));return{holdId:l.holdId,expiresAt:l.expiresAt,labels:[...a.labels],items:a.labels.map(h=>{let d=c.get(h);return{label:h,objectId:d?.objectId??h,objectType:"seat",categoryKey:d?.categoryKey??n??"",tierId:d?.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...d?.quantity==null?{}:{quantity:d.quantity}}})}}categoryLabel(e){return this.categoryLabels.get(e)??e}socketUrl(){return""}createRealtime(e,t){return new yo(this,t,this.realtimePollMs)}},O,ht,zt,me,ie,gi,ne,De,K,le,ke,$t,Ye,Be,ut,we,bi,Me,jt,Gt,mt,Ut,Xe,ft,gt,qt,w,_l,Nl,wo,xo,So,ko,En,dt,Dl,Bl,Ne,fi,Fl,Vl,To,Eo,zl,$l,jl,Co,Ao,q,pt,Po,Vt,Cn=class{constructor(e){M(this,w);M(this,O);M(this,ht);M(this,zt);M(this,me);M(this,ie);M(this,gi,new AbortController);M(this,ne,null);M(this,De,null);M(this,K,null);M(this,le,null);M(this,ke,null);M(this,$t,null);M(this,Ye,null);M(this,Be,null);M(this,ut,null);M(this,we,[]);M(this,bi,new Map);M(this,Me,!1);M(this,jt,!1);M(this,Gt);M(this,mt,null);M(this,Ut,null);M(this,Xe,null);M(this,ft,"handoff");M(this,gt,null);M(this,qt,!1);if(!e?.season)throw new Error("seatlayer: `season` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if("event"in e||"performanceGroup"in e)throw new Error("seatlayer: SeasonPicker is not SeatPicker or PerformanceGroupPicker");k(this,O,e),k(this,ht,dh(e.container));let t={onExpired:o=>e.onAccessExpired?.(o),onUnavailable:o=>{let s=m(this,mt)&&o.reason==="provider_failed"?m(this,mt):o;k(this,mt,null),k(this,Ut,s.reason==="provider_failed"?null:s),e.onAccessUnavailable?.(s),x(this,w,zl).call(this,s)}};if(!e.buyerAccessToken&&!e.buyerAccessTokenProvider){let{access:o,loader:s}=Ml({base:(e.apiBase??"https://api.seatlayer.io").replace(/\/$/,""),season:e.season,fetch:e.fetch,onRefused:r=>{k(this,mt,r)},accessHooks:t});k(this,zt,o),k(this,Gt,s)}else k(this,Gt,null),k(this,zt,new ue({token:e.buyerAccessToken,provider:e.buyerAccessTokenProvider,...t}));k(this,me,new Tn(e.season,{apiBase:e.apiBase,access:m(this,zt),fetch:e.fetch,recoveryTimeoutMs:e.recoveryTimeoutMs})),k(this,ie,new vo(m(this,me),Math.max(750,e.realtimePollMs??ch)))}async render(){x(this,w,Po).call(this),Ll(),x(this,w,Nl).call(this),x(this,w,q).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{let[e,t,n]=await Promise.all([m(this,me).descriptor(),m(this,me).availability(),m(this,me).prices().catch(()=>null)]);return m(this,Me)?this:(k(this,ne,e),k(this,De,t),k(this,Xe,n),k(this,ft,m(this,O).checkout==="hosted"&&e.checkoutMode!=="server"&&n?"hosted":"handoff"),m(this,ie).prime(e,t),x(this,w,wo).call(this),await x(this,w,_l).call(this,e),m(this,Me)?this:(n&&x(this,w,wo).call(this),x(this,w,jl).call(this),x(this,w,q).call(this,{kind:"ready",message:`${t.freeCount} seat${t.freeCount===1?"":"s"} available for every included performance.`}),m(this,O).initialOperationId&&await this.restoreOperation(m(this,O).initialOperationId),this))}catch(e){if(m(this,Me))return this;throw x(this,w,pt).call(this,e)}}async holdSameSeat(e,t){if(x(this,w,Vt).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!e.length)throw new Error("seatlayer: select at least one seat");if(m(this,ie).queueOperation(t),m(this,le).selectObjectsWithoutConfirmation([...e]),x(this,w,q).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await m(this,le).handleCta(),!m(this,K))throw new z("season_hold_not_created",409);return m(this,K)}async holdBestAvailable(e,t,n={}){if(x(this,w,Vt).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: positive Best Available quantity is required");let o=m(this,le).maxTickets;if(e>o)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${o})`);if(m(this,jt))throw new z("season_best_available_in_progress",409);k(this,jt,!0);let s=null;try{if(s=m(this,ie).queueBestAvailable(t,n),x(this,w,q).call(this,{kind:"pending",message:`Finding ${e} Season seat${e===1?"":"s"} available for every performance.`,operationId:t},!0),!await m(this,le).bestAvailableOrThrow(e,n.categoryKey,{zoneId:n.zoneId})||!m(this,K))throw new z("season_hold_not_created",409);return m(this,K)}catch(r){throw x(this,w,pt).call(this,r,t)}finally{s&&m(this,ie).clearBestAvailable(s),k(this,jt,!1)}}async restoreOperation(e){x(this,w,Vt).call(this),x(this,w,q).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await m(this,me).waitForTerminal(e,void 0,m(this,gi).signal);return t.state==="aborted"||t.state==="expired"?(k(this,K,null),m(this,O).onHoldChange?.(null),x(this,w,q).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(m(this,ie).remember(t),x(this,w,ko).call(this,t,!1))}catch(t){throw x(this,w,pt).call(this,t,e)}}async release(e){x(this,w,Vt).call(this);let t=m(this,K);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");m(this,ie).queueRelease(e),x(this,w,q).call(this,{kind:"pending",message:"Releasing the Season seats.",operationId:t.operationId},!0);try{m(this,le)?.getCurrentHold()?.holdId===t.holdId?await m(this,le).release():(await m(this,ie).release("",[],t.holdId),x(this,w,En).call(this)),x(this,w,q).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(n){throw x(this,w,pt).call(this,n,t.operationId)}}}async createRenewalIntent(e){if(x(this,w,Vt).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");x(this,w,q).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await m(this,me).renewalIntent(e);return x(this,w,q).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),m(this,O).onRenewalIntent?.(t),t}catch(t){throw x(this,w,pt).call(this,t)}}getDescriptor(){return m(this,ne)}getAvailability(){return m(this,De)}getHandoff(){return m(this,K)}destroy(){m(this,Me)||(k(this,Me,!0),m(this,gi).abort(),x(this,w,Ao).call(this),m(this,le)?.destroy(),m(this,me).destroy(),m(this,ht).replaceChildren(),k(this,ke,null),k(this,$t,null),k(this,Ye,null),k(this,Be,null),k(this,ut,null),k(this,ne,null),k(this,De,null),k(this,K,null))}};O=new WeakMap,ht=new WeakMap,zt=new WeakMap,me=new WeakMap,ie=new WeakMap,gi=new WeakMap,ne=new WeakMap,De=new WeakMap,K=new WeakMap,le=new WeakMap,ke=new WeakMap,$t=new WeakMap,Ye=new WeakMap,Be=new WeakMap,ut=new WeakMap,we=new WeakMap,bi=new WeakMap,Me=new WeakMap,jt=new WeakMap,Gt=new WeakMap,mt=new WeakMap,Ut=new WeakMap,Xe=new WeakMap,ft=new WeakMap,gt=new WeakMap,qt=new WeakMap,w=new WeakSet,_l=async function(e){let t=new qe(vn({container:m(this,$t),event:e.key,apiBase:m(this,O).apiBase,transport:m(this,ie),hideEventDetails:!0,maxSelection:m(this,O).maxSelection,selectedObjects:m(this,O).selectedObjects,selectableObjects:m(this,O).selectableObjects,numberOfPlacesToSelect:m(this,O).numberOfPlacesToSelect,selectionValidators:m(this,O).selectionValidators,locale:m(this,O).locale,messages:m(this,O).messages,languages:m(this,O).languages,colorblindSafe:m(this,O).colorblindSafe,initialView:m(this,O).initialView,enable3D:m(this,O).enable3D,max3DSeats:m(this,O).max3DSeats,hideBadge:m(this,O).hideBadge,theme:m(this,O).theme,confirmSelection:m(this,O).confirmSelection,seatView:m(this,O).seatView,onBuyerViewChange:m(this,O).onBuyerViewChange,onAnalytics:(n,o)=>{try{m(this,O).onAnalytics?.(n,{...o,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:e.occurrenceCount})}catch{}},onSelectionChange:n=>{k(this,we,n.map(o=>o.label)),k(this,bi,new Map(n.filter(o=>!!o.categoryKey).map(o=>[o.label,o.categoryKey]))),x(this,w,dt).call(this),m(this,O).onSelectionChange?.(n)},onSelectionValidityChange:m(this,O).onSelectionValidityChange,onHoldChange:n=>{if(!n){x(this,w,En).call(this);return}let o=m(this,ie).operationForHold(n.holdId);o&&x(this,w,ko).call(this,o,!0)},onCheckout:()=>{m(this,K)&&(x(this,w,Ne).call(this,"checkout"),m(this,O).onContinue?.(m(this,K)),m(this,ft)==="hosted"&&x(this,w,$l).call(this,m(this,K)))},onHoldExpired:()=>{x(this,w,En).call(this),x(this,w,q).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),m(this,O).onHoldExpired?.()},onError:n=>x(this,w,pt).call(this,n)},{surface:"season",performanceCount:e.occurrenceCount,selectionMode:"same_seat",suppressPricing:!0,groupSelectionSummary:()=>{let n=m(this,we).length;return n?{seats:n,performances:e.occurrenceCount,performancesChosen:e.occurrenceCount,perPerformance:n}:null}}));k(this,le,t),await t.render()},Nl=function(){m(this,ht).replaceChildren();let e=document.createElement("section");e.className="sl-season-root",e.setAttribute("aria-label","Season ticket selection");let t=document.createElement("header");t.className="sl-season-hero";let n=document.createElement("ol");n.className="sl-season-progress",n.setAttribute("aria-label","Season checkout progress");for(let[y,T]of["Choose seats","Review package","Checkout"].entries()){let S=document.createElement("li");S.dataset.state=y===0?"current":"upcoming";let v=document.createElement("span");v.textContent=String(y+1),S.append(v,T),n.append(S)}let o=document.createElement("div");o.className="sl-season-stage";let s=document.createElement("div");s.className="sl-season-map";let r=document.createElement("aside");r.className="sl-season-summary-card",r.setAttribute("aria-label","Your Season selection");let a=document.createElement("h3");a.textContent="Your Season seats";let l=document.createElement("p");l.className="sl-season-selection",l.textContent="Choose a seat on the map.";let c=document.createElement("p");c.className="sl-season-rule";let h=document.createElement("i");h.textContent="1\xD7";let d=document.createElement("span");d.textContent="Each seat you choose is reserved for every included performance.",c.append(h,d);let u=document.createElement("p");u.className="sl-season-availability";let p=document.createElement("p");p.className="sl-season-checkout-note",p.textContent="Your ticketing platform confirms package price, payment, admission passes, and member benefits.",r.append(a,l,c,u,p),o.append(s,r);let g=document.createElement("p");g.className="sl-season-status",g.setAttribute("role","status"),g.setAttribute("aria-live","polite"),e.append(t,n,o,g),m(this,ht).append(e),k(this,ke,e),k(this,$t,s),k(this,Ye,g),k(this,Be,l),k(this,ut,u)},wo=function(){let e=m(this,ne),t=m(this,O).offer,n=m(this,ke).querySelector(".sl-season-hero");n.replaceChildren();let o=document.createElement("div");o.className="sl-season-copy";let s=document.createElement("p");s.className="sl-season-eyebrow",s.textContent=t?.eyebrow??"Season ticket";let r=document.createElement("h2");r.textContent=e.edition?`${e.name} \xB7 ${e.edition}`:e.name;let a=document.createElement("p");a.className="sl-season-promise",a.textContent=`Choose once and keep the same seat for all ${e.occurrenceCount} included performances.`;let l=document.createElement("div");l.className="sl-season-facts";for(let p of[`${e.occurrenceCount} performances`,e.venue,t?.renewalLabel??"Same-seat package"].filter(Boolean)){let g=document.createElement("span");g.className="sl-season-fact",g.textContent=p,l.append(g)}o.append(s,r,a,l),n.append(o);let c=document.createElement("div");c.className="sl-season-offer";let h=document.createElement("span");h.className="sl-season-offer-label";let d=x(this,w,fi).call(this);if(d){h.textContent=b("season.packagePriceLabel","Package price"),c.append(h,x(this,w,Vl).call(this,d,e.occurrenceCount));let p=document.createElement("span");p.className="sl-season-price-note",p.textContent=b("season.packagePricePerSeat","Per seat, for the whole package."),c.append(p),n.append(c),x(this,w,xo).call(this,n,t),x(this,w,So).call(this,n,e),x(this,w,dt).call(this);return}h.textContent=t?.priceLabel?"Season package":"Package price";let u=document.createElement(t?.priceLabel?"strong":"span");if(u.className=t?.priceLabel?"sl-season-price":"sl-season-price-note",u.textContent=t?.priceLabel??"Confirmed by your ticketing platform at checkout",c.append(h,u),t?.compareAtPriceLabel){let p=document.createElement("span");p.className="sl-season-was",p.textContent=t.compareAtPriceLabel,c.append(p)}if(t?.savingsLabel){let p=document.createElement("span");p.className="sl-season-saving",p.textContent=t.savingsLabel,c.append(p)}if(t?.priceNote){let p=document.createElement("span");p.className="sl-season-price-note",p.textContent=t.priceNote,c.append(p)}n.append(c),x(this,w,xo).call(this,n,t),x(this,w,So).call(this,n,e),x(this,w,dt).call(this)},xo=function(e,t){if(!t?.benefits?.length)return;let n=document.createElement("ul");n.className="sl-season-benefits";for(let o of t.benefits.slice(0,6)){let s=document.createElement("li");s.textContent=o,n.append(s)}e.append(n)},So=function(e,t){let n=document.createElement("details");n.className="sl-season-dates";let o=document.createElement("summary");o.textContent=`All ${t.occurrenceCount} performances included`;let s=document.createElement("ol");s.className="sl-season-date-list";for(let r of t.occurrences){let a=document.createElement("li");a.className="sl-season-date";let l=document.createElement("b");l.textContent=r.name;let c=ph(r,t.timezone,m(this,O).locale),h=document.createElement("time");r.startsAt!=null&&(h.dateTime=new Date(r.startsAt).toISOString()),h.textContent=c.time?`${c.date} \xB7 ${c.time}`:c.date,a.append(l,h),s.append(a)}n.append(o,s),e.append(n)},ko=function(e,t){if(e.state==="booked")return k(this,K,null),m(this,ie).forget(e.holdId),m(this,le)?.notifyGroupSettled("booked"),x(this,w,Ne).call(this,"complete"),x(this,w,q).call(this,{kind:"booked",message:`Your Season booking is complete for all ${m(this,ne).occurrenceCount} performances. No further checkout action is needed.`,operationId:e.operationId}),m(this,O).onHoldChange?.(null),null;if(e.state==="partial_terminal")return k(this,K,null),k(this,we,[]),m(this,ie).forget(e.holdId),m(this,le)?.notifyGroupSettled("lost"),x(this,w,dt).call(this),x(this,w,Ne).call(this,"review"),x(this,w,q).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),m(this,O).onHoldChange?.(null),null;if(e.state!=="committed")return k(this,K,null),m(this,ie).forget(e.holdId),m(this,le)?.notifyGroupSettled("lost"),x(this,w,q).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),m(this,O).onHoldChange?.(null),null;let n=Rl(m(this,ne),e),o=m(this,K)?.holdId!==n.holdId;return k(this,K,n),x(this,w,dt).call(this),x(this,w,Ne).call(this,"review"),m(this,O).onHoldChange?.(n),x(this,w,q).call(this,{kind:"held",message:`Your seats are held for all ${m(this,ne).occurrenceCount} performances. Review and continue to checkout.`,operationId:e.operationId}),o&&t&&m(this,O).onHold?.(n),n},En=function(){k(this,K,null),k(this,we,[]),x(this,w,dt).call(this),x(this,w,Ne).call(this,"choose"),m(this,O).onHoldChange?.(null)},dt=function(){if(!m(this,Be))return;let e=m(this,we).length;if(!e)m(this,Be).textContent="Choose a seat on the map. Unavailable seats are already booked on at least one included performance.";else{m(this,Be).replaceChildren();let t=document.createElement("strong");t.textContent=m(this,we).join(", "),m(this,Be).append(t,` \xB7 ${e} Season seat${e===1?"":"s"} across all ${m(this,ne)?.occurrenceCount??0} performances`)}m(this,ut)&&m(this,De)&&(m(this,ut).textContent=`${m(this,De).freeCount} seat${m(this,De).freeCount===1?"":"s"} currently available for the complete Season`),x(this,w,Dl).call(this),x(this,w,Bl).call(this)},Dl=function(){let e=m(this,ke)?.querySelector(".sl-season-summary-card");if(!e)return;e.querySelector(".sl-season-package-total")?.remove();let t=x(this,w,To).call(this);if(t==null)return;let n=m(this,Xe)?.currency??m(this,ne)?.currency??"USD",o=m(this,ne)?.occurrenceCount??0,s=document.createElement("p");s.className="sl-season-package-total";let r=document.createElement("span");r.textContent=b("season.packageTotal","Package total");let a=document.createElement("strong");a.textContent=x(this,w,Eo).call(this,t,n);let l=document.createElement("span");l.className="sl-season-package-total-scope",l.textContent=b("season.priceForAllDates","for all {count} dates").replace("{count}",String(o)),s.append(r,a,l);let c=e.querySelector(".sl-season-checkout-note");c?e.insertBefore(s,c):e.append(s)},Bl=function(){let e=m(this,ke)?.querySelector(".sl-season-checkout-note");if(e){if(m(this,ft)==="hosted"){e.textContent=b("season.hostedCheckoutNote","You pay for the whole package here. Your tickets for every performance arrive by email.");return}if(x(this,w,fi).call(this)){e.textContent=b("season.serverCheckoutPricedNote","Payment and admission passes are completed in the checkout on this page.");return}e.textContent="Your ticketing platform confirms package price, payment, admission passes, and member benefits."}},Ne=function(e){let t=e==="choose"?0:e==="review"?1:e==="checkout"?2:3;m(this,ke)?.querySelectorAll(".sl-season-progress li").forEach((n,o)=>{n.dataset.state=o<t?"done":o===t?"current":"upcoming";let s=n.querySelector("span");s&&(s.textContent=o<t?"\u2713":String(o+1))})},fi=function(){let e=m(this,Xe)?.packages;if(!e?.length)return null;let t=m(this,ne)?.planActivationId,n=e.find(r=>r.planKey===t);if(n)return n;let o=m(this,Gt)?.session?.planActivationIds;return(o?.length?e.filter(r=>o.includes(r.planKey)):[])[0]??e[0]},Fl=function(e){let t=x(this,w,fi).call(this)?.prices.find(n=>n.categoryKey===e);return t?t.unitPrice:null},Vl=function(e,t){let n=document.createElement("ul");n.className="sl-season-price-lines";let o=m(this,Xe)?.currency??m(this,ne)?.currency??"USD";for(let s of e.prices){let r=document.createElement("li"),a=document.createElement("span");a.className="sl-season-price-category",a.textContent=m(this,ie).categoryLabel(s.categoryKey);let l=document.createElement("strong");l.className="sl-season-price",l.textContent=x(this,w,Eo).call(this,s.unitPrice,o);let c=document.createElement("span");c.className="sl-season-price-scope",c.textContent=b("season.priceForAllDates","for all {count} dates").replace("{count}",String(t)),r.append(a,l,c),n.append(r)}return n},To=function(){if(!m(this,we).length||!x(this,w,fi).call(this))return null;let e=0;for(let t of m(this,we)){let n=m(this,bi).get(t),o=n?x(this,w,Fl).call(this,n):null;if(o==null)return null;e+=o}return e},Eo=function(e,t){let n=(0,Kt.fromMinorUnits)(e,t),o=Number.isInteger(n);return(0,Kt.formatMoney)(n,t,{locale:m(this,O).locale,fallback:(s,r)=>`${s} ${r}`,...o?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})},zl=function(e){let t=e.reason==="audience_not_public"?b("season.accessNotPublic","This season isn't open for online booking yet."):e.reason==="sales_not_open"?b("season.accessSalesNotOpen","Season tickets aren't on sale right now. Check back when sales open."):e.reason==="origin_not_allowed"?b("season.accessOriginNotAllowed","This season can't be booked from this page."):b("season.accessUnavailable","Season tickets can't be loaded right now. Please try again later.");x(this,w,q).call(this,{kind:"failed",message:t})},$l=async function(e){if(!m(this,qt)){k(this,qt,!0);try{let t=m(this,Xe)?.currency??m(this,ne)?.currency??"USD",n=x(this,w,To).call(this);if(n==null){x(this,w,q).call(this,{kind:"failed",message:b("season.checkoutNotPriced","We can\u2019t price this package here. Your seats are still held \u2014 please continue in the checkout on this page."),operationId:e.operationId});return}await x(this,w,Co).call(this,{kind:"pay",provider:null,order:{holdId:e.operationId,expiresAt:e.expiresAt,currency:t,total:(0,Kt.fromMinorUnits)(n,t),labels:[...m(this,we)]}})}finally{k(this,qt,!1)}}},jl=function(){if(m(this,ft)!=="hosted")return;let e=wn(m(this,O).season);e?.outcome!=="success"||!e.orderId||(x(this,w,Ne).call(this,"checkout"),x(this,w,Co).call(this,{kind:"resume",orderId:e.orderId}))},Co=async function(e){let t;try{({mountCheckout:t}=await Ei())}catch(o){m(this,O).onError?.(o),x(this,w,q).call(this,{kind:"failed",message:b("season.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held \u2014 please try again.")});return}let n=m(this,le)?.root;m(this,Me)||!n||(x(this,w,Ao).call(this),k(this,gt,t({root:n,state:e,eventKey:m(this,O).season,formatMoney:(o,s)=>(0,Kt.formatMoney)(o,s,{locale:m(this,O).locale,fallback:(r,a)=>`${r} ${a}`,...Number.isInteger(o)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:o=>m(this,me).checkout({operationId:o.holdId,buyerEmail:o.buyerEmail,...o.buyerName?{buyerName:o.buyerName}:{},...m(this,O).returnUrl?{returnUrl:m(this,O).returnUrl}:{}}),orderStatus:o=>m(this,me).orderStatus(o),onCancel:()=>{k(this,gt,null),m(this,K)&&x(this,w,Ne).call(this,"review")},onConfirmed:o=>{m(this,O).onOrderConfirmed?.(o),x(this,w,Ne).call(this,"complete"),x(this,w,q).call(this,{kind:"booked",message:b("season.orderConfirmed","Your season tickets are confirmed for every included performance.")})},onError:o=>m(this,O).onError?.(o)})))},Ao=function(){m(this,gt)?.destroy(),k(this,gt,null)},q=function(e,t=!1){m(this,Ye)&&(m(this,Ye).textContent=e.message,m(this,Ye).dataset.kind=e.kind),m(this,ke)&&(m(this,ke).dataset.busy=String(t)),m(this,O).onStatusChange?.(e)},pt=function(e,t){let n=e instanceof se&&e.reason==="provider_failed"&&m(this,Ut)?new se(m(this,Ut)):e;if(n instanceof se)return m(this,O).onError?.(n),n;let o=n instanceof z?`Season selection unavailable (${n.code}).`:"Season selection could not be completed.";return x(this,w,q).call(this,{kind:"failed",message:o,operationId:t}),m(this,O).onError?.(n),n},Po=function(){if(m(this,Me))throw new Error("seatlayer: SeasonPicker was destroyed")},Vt=function(){if(x(this,w,Po).call(this),!m(this,ne)||!m(this,le))throw new Error("seatlayer: render SeasonPicker before using it")};function Gl(i,e={}){let t=e.origin??"";if(!t)try{t=new URL(i.src,window.location.href).origin}catch{t=""}let n=!1,o=null,s=null,r=null,a="",l=null,c="",h=()=>{if(n)return;n=!0,o=i.getAttribute("style"),Object.assign(i.style,{position:"fixed",inset:"0",margin:"0",border:"0",zIndex:"2147483000",background:c||"transparent"}),i.style.width="100vw",i.style.height="100vh",i.style.width="100dvw",i.style.height="100dvh";let p=document.documentElement;s=p.style.overflow,p.style.overflow="hidden",document.body&&(r=document.body.style.overflow,document.body.style.overflow="hidden"),l=g=>{g.key==="Escape"&&d()},window.addEventListener("keydown",l)},d=()=>{n&&(n=!1,o===null?i.removeAttribute("style"):i.setAttribute("style",o),o=null,a&&(i.style.height=a),s!==null&&(document.documentElement.style.overflow=s,s=null),r!==null&&document.body&&(document.body.style.overflow=r,r=null),l&&(window.removeEventListener("keydown",l),l=null))},u=p=>{if(p.source!==i.contentWindow||t&&p.origin!==t||!p.data||typeof p.data!="object")return;let g=p.data;if(g.type==="seatlayer:height"){typeof g.px=="number"&&Number.isFinite(g.px)&&g.px>0&&(a=`${Math.round(g.px)}px`,n||(i.style.height=a));return}g.type==="seatlayer:fullscreen"&&(typeof g.background=="string"&&/^[#a-zA-Z0-9(),.%\s-]{1,64}$/.test(g.background)&&(c=g.background,n&&(i.style.background=c)),g.on===!0?h():g.on===!1&&d())};return window.addEventListener("message",u),()=>{window.removeEventListener("message",u),d()}}0&&(module.exports={ApiError,BuyerAccessContext,BuyerAccessUnavailableError,BuyerRealtimeClient,EmbeddedDesigner,PerformanceGroupDestroyedError,PerformanceGroupPicker,SEATING_CHART_CALLBACK_PROPS,SEATING_CHART_HANDLE_METHODS,SEATING_CHART_IDENTITY_PROPS,SEATING_CHART_VALUE_PROPS,SeasonApiError,SeasonPicker,SeasonPublicSessionRefused,SeasonRecoveryTimeoutError,SeatPicker,SeatingChart,attachPickerFrame,bindSeatingChartHandle,buildSeatingChartOptions,createBuyerAccessContext,createControllerSink,parseTicketOfferAvailability,shortOperationReference,ticketOfferPrices});
|