@seatlayer/js 0.86.2 → 0.86.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{a as io,b as no,d as Kt,e as nt,f as Wt,g as ot}from"./chunk-RZ2VKZ44.js";import{a as u,b as M,c as k,d as x}from"./chunk-OSZ7DOEH.js";import{PickerController as kc,formatMoney as Tc,getLocale as hn,loadLocale as Ec,localeDirection as Cc,LOCALE_NAMES as Ac,resolveLocale as Pc,setStringOverrides as Lc,t as me}from"@seatlayer/core";var Fe="seatlayer.v1";function al(n){let e=typeof n.default=="string"?n.default:"free",t={};if(n.seats&&typeof n.seats=="object")for(let[i,o]of Object.entries(n.seats))typeof o=="string"&&o!==e&&(t[i]=o);return{default:e,exceptions:t}}function ll(n,e){if(!n||n.default!==e.default)return null;let t=[];for(let[i,o]of Object.entries(e.exceptions))n.exceptions[i]!==o&&t.push({label:i,status:o});for(let i of Object.keys(n.exceptions))i in e.exceptions||t.push({label:i,status:e.default});return t}function cl(n,e){for(let t of e)t.status===n.default?delete n.exceptions[t.label]:n.exceptions[t.label]=t.status}function oo(n){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var 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,oo(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=[Fe];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(Fe)||e.unshift(Fe)):s?.ticket&&(e=[Fe,`tkt.${s.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let i=this.useQueryMarker?`${this.opts.url}${this.opts.url.includes("?")?"&":"?"}pv=1`:this.opts.url;oo(i);let o;try{o=(this.opts.socketFactory??((r,a)=>new WebSocket(r,a)))(i,e)}catch{this.scheduleReconnect();return}this.ws=o,o.onopen=()=>{this.ws===o&&(this.attempt=0,this.v1=o.protocol===Fe,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 i=Array.isArray(e.hidden)?e.hidden:[],o=Array.isArray(e.closed)?e.closed:[],s=i.join("\0"),r=o.join("\0");(s!==this.hidden||r!==this.closedSections)&&(this.hidden=s,this.closedSections=r,this.opts.sink.onSections?.(i,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 i=al(e),o=ll(this.projection,i);this.projection=i,o===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(i):this.opts.sink.resync():o.length&&this.opts.sink.applyStatuses(o);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let i=e.changes.filter(o=>typeof o?.label=="string"&&typeof o?.status=="string").map(o=>({label:o.label,status:o.status}));if(!i.length)return;this.projection&&cl(this.projection,i),this.opts.sink.applyStatuses(i)}}}}answered(){this.resumeTimer&&(clearTimeout(this.resumeTimer),this.resumeTimer=null)}reportIfAccessError(e){let t=e?.reason;e?.name==="BuyerAccessUnavailableError"&&(this.stopped=!0,this.opts.onAccessUnavailable?.({reason:t??"invalid",code:e.code,status:e.status,retryable:t==="paused"}))}startKeepalive(e){this.pingTimer=setInterval(()=>{if(this.ws===e){try{e.send(JSON.stringify({type:"ping"}))}catch{return}this.clearPongTimer(),this.pongTimer=setTimeout(()=>{this.pongTimer=null;try{e.close()}catch{}},1e4)}},25e3)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,15e3),i=Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}clearPongTimer(){this.pongTimer&&(clearTimeout(this.pongTimer),this.pongTimer=null)}clearTimers(){this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=null,this.clearPongTimer(),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.resumeTimer&&clearTimeout(this.resumeTimer),this.resumeTimer=null}};function dl(n){return n==="blocked"?"not_for_sale":n==="held"||n==="booked"||n==="free"||n==="not_for_sale"?n:"free"}function Ct(n,e={}){let t=i=>{let o=n.tableSelection(i);if(o)return o.physicalSeatIds;let s=n.idForLabel(i);return s?[s]:[]};return{applyStatuses(i){let o=new Set([...n.currentHold()?.labels??[],...e.ownLabels?.()??[]]),s={free:[],held:[],booked:[],not_for_sale:[]},r=[],a=[],l=new Map(n.getSelection().map(c=>[c.label,c.id]));for(let c of i){let h=t(c.label);if(!h.length)continue;let d=dl(c.status);if(s[d].push(...h),e.flashOnLiveChange&&d!=="free"&&!o.has(c.label)&&h.some(m=>n.getStatus(m)==="free")){let m=d==="held"?"#f4b740":"#f43f5e";for(let p of h)r.push({id:p,color:m})}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&&n.setStatus(s[c],c);for(let c of r)n.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(d=>t(d));c.length&&n.deselect(c);let h=i.some(d=>d.status==="blocked"&&a.includes(d.label));e.onSelectedObjectUnavailable?.(a,h?"ineligible":"taken")}e.onStatusChange?.()},...n.applyProjection?{applyProjection:i=>{n.applyProjection(i)}}:{},async resync(i){await(n.resync?n.resync(i):n.refresh())},onSections(i,o,s){s?.withInventory||(n.resync?n.resync({reason:"frame"}):n.refresh()),e.onSections?.(i,o,s)}}}var V=class extends Error{constructor(e,t,i,o,s,r){super(t),this.name="ApiError",this.status=e,this.code=i,this.conflicts=o,this.reason=s,this.retryAfterS=r}},so=10,ro=1;function Yt(n,e){let t=(n??"").trim();if(t){let i=Number(t);if(Number.isFinite(i)&&i>=0)return Math.ceil(i);let o=Date.parse(t);if(Number.isFinite(o))return Math.max(0,Math.ceil((o-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}var pl={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"},He=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 i=t.referral?.trim();this.referral=i?i.slice(0,120):void 0}get accessScoped(){return!!this.access?.configured}async request(e,t={},i={}){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(i.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,m=d?.code??d?.error;if(this.access?.configured&&(l.status===401||l.status===403||l.status===422)&&await this.access.handleFailure(l.status,m)&&!i.auth)return this.request(e,t,{...i,auth:!0});if(l.status===409){let f=m?pl[m]:void 0,y=d?.conflicts?.map(T=>T.label)??t.labels??[];f&&this.onObjectUnavailable?.({labels:y,reason:f,code:m})}let p;if(l.status===429&&(p=Yt(l.headers.get("Retry-After"),d?.retryAfterSeconds)??ro,o==="GET"&&!i.rateLimit&&p<=so))return await new Promise(f=>setTimeout(f,p*1e3)),this.request(e,t,{...i,rateLimit:!0});throw new V(l.status,d?.error??`request_failed_${l.status}`,m,d?.conflicts,d?.reason,p)}return h}async requestBlob(e,t={}){let i={},o=await this.access?.authorization(t.auth?"unauthorized":"initial");o&&(i.Authorization=o);let s=await fetch(`${this.base}${e}`,{method:"GET",headers:i,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=Yt(s.headers.get("Retry-After"),a?.retryAfterSeconds)??ro,!t.rateLimit&&c<=so))return await new Promise(h=>setTimeout(h,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new V(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 V(404,"not_found","not_found"))}objects(e){return this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1`)}hold(e,t,i,o){return this.request(`/pub/events/${encodeURIComponent(e)}/hold`,{method:"POST",body:{selections:t,...i?{ttlMs:i}:{},...o?{replaceHoldId:o}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(s=>s.label)})}bestAvailable(e,t,i,o,s){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available`,{method:"POST",body:{qty:t,...i?{categoryKey:i}:{},...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,i){return this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:i}})}extend(e,t,i){return this.request(`/pub/events/${encodeURIComponent(e)}/extend`,{method:"POST",body:{holdId:t,...i?{ttlMs:i}:{}}})}paymentOptions(e){return this.request(`/pub/events/${encodeURIComponent(e)}/payment-options`)}availability(e,t=!1){return this.request(`/pub/events/${encodeURIComponent(e)}/availability${t?"?live=1":""}`)}startCheckout(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/checkout`,{method:"POST",body:t})}orderStatus(e){return this.request(`/pub/orders/${encodeURIComponent(e)}/status`)}subscribeTicket(e){return this.request(`/pub/events/${encodeURIComponent(e)}/subscribe-tickets`,{method:"POST",body:{}})}subscribeUrl(e){let t=this.base.replace(/^http/,"ws"),i=new URLSearchParams({surface:"picker",viewerId:this.viewerId});return`${t}/pub/events/${encodeURIComponent(e)}/subscribe?${i}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[Fe]}createRealtime(e,t){return this.accessScoped?null:new ke({url:this.subscribeUrl(e),sink:t})}};import{getLocale as Al,loadLocale as Pl,LOCALE_NAMES as Ll,localeDirection as Mo,resolveLocale as Ho,setStringOverrides as Ml,TRANSLATED_LOCALES as Hl}from"@seatlayer/core";import{getLocale as kl,localeDirection as Tl,t as El}from"@seatlayer/core";import{compactRowLabel as yl,seatNoteRowModel as vl,seatTypeIconSvg as uo,t as ze}from"@seatlayer/core";import{seatConfidenceDisclosure as wl}from"@seatlayer/core/core/seatConfidence";import{t as gl}from"@seatlayer/core";import{cdnAssetUrl as bl}from"@seatlayer/core/core/cdnAsset";var hl=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,ul=/[\s"'<>`\\]/;function ml(n){return n.startsWith("//")?!1:n.startsWith("/")||n.startsWith("./")||n.startsWith("../")}function fl(){try{let n=typeof location>"u"?"":location.origin;return n&&n!=="null"?n:null}catch{return null}}function st(n){if(typeof n!="string"||!n||n.length>2e6||n!==n.trim())return!1;if(n.startsWith("data:"))return hl.test(n);if(ul.test(n))return!1;let e=fl();if(ml(n)){if(!e)return!1;try{let t=new URL(n,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(n);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}import{SEATLAYER_MODULE_URL as Sh}from"@seatlayer/core/core/cdnAsset";function b(n,e){let t=gl(n);return t===n?e:t}function Ve(){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 Xt(){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 ao(n,e){let t=e?n.toLocaleUpperCase(e):n.toLocaleUpperCase(),i=e?n.toLocaleLowerCase(e):n.toLocaleLowerCase();if(n!==t||t===i)return n;let o=[...i][0]??"";return(e?o.toLocaleUpperCase(e):o.toLocaleUpperCase())+i.slice(o.length)}function lo(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}function O(n){return String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}function co(n,e,t){let i=e.find(s=>st(s))??null;if(n.replaceChildren(),!i)return n.textContent=t.slice(0,1).toUpperCase(),null;let o=document.createElement("img");return o.alt="",o.referrerPolicy="no-referrer",o.src=i,n.appendChild(o),i}var rt=null;function Zt(){if(rt!==null)return rt;try{if(typeof document>"u")return rt=!1;rt=!!document.createElement("canvas").getContext("webgl2")}catch{rt=!1}return rt}function Xi(n){return bl(n)}var At=null;function Pt(){return At||(At=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Xi("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")).catch(e=>{throw At=null,e}),At)}function Qt(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||Pt().catch(()=>{})}async function Jt(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Xi("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function ei(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Xi("seatlayer-checkout.mjs")):import("./hostedCheckout-W7QZWSOQ.js")}function po(n){return n==="unavailable_for_event"||n==="payments_off_for_event"?n:"not_configured"}function ti(n,e,t){let i={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},o=new Date(n);if(e)try{return o.toLocaleString(t,{...i,timeZone:e})}catch{}return o.toLocaleString(t,i)}function Zi(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function E(n){return String(n??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function Qi(n){return n?vl(n).map(e=>({...e,title:b(e.titleKey,e.titleFallback)})):[]}function mo(n){return Qi(n).map(e=>e.title)}function $e(n,e={}){let t=Qi(n);if(!t.length)return"";let i=e.compact?15:17,o=t.map(s=>`<div class="sl-note sl-note-${E(s.tone)}"><span class="sl-note-i">${uo(s.icon,{size:i})}</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 fo(n){return Qi(n).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}">${uo(e.icon,{size:13})}</span>`}).join("")}function ii(n){let e=[];return n?.restrictedView&&e.push(b("picker.restrictedView","Restricted view")),n?.obstructedView&&e.push(b("picker.obstructedView","Obstructed view")),e}function Ji(n,e){if(!n)return"";let t=e?b("picker.viewFromThisSeat","View from this seat"):b("picker.seeItIn3d","See it in 3D"),i=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>${i}</span></button>`}function go(n,e){if(!e)return"";let t=e,i=t.includes(n.id),o=i?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"${i&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${E(o)}</span></button>`}function bo(n,e,t){if(!t)return"";let i=wl(n.confidenceEvidence),o=i.modeledTarget??i.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${E(n.displayLabel??n.label)}"><span><em>${E(e)}</em><strong>${E(i.headline)}</strong><small>${E(o)}</small></span><b>Passport</b></button>`}function K(n){let e=n?.rowLabel,t=n?.sectionLabel;if(!e||!t)return e;for(let i of["-"," ","\xB7","/","_"]){let o=`${t}${i}`;if(e.startsWith(o)&&e.length>o.length)return e.slice(o.length)}return yl(e,t)}function xl(n){switch(n){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 Sl=6;function yo(n,e,t){let i=Zi;return[n?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${n.sectionLabel.length>Sl?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${b("picker.section","Section")}</span><span class="sl-confirm-value">${i(n.sectionLabel)}</span></div>`:"",n?.rowLabel||n?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${i(t)}</span><span class="sl-confirm-value">${i(K(n)??n?.displayLabel??e)}</span></div>`:"",n?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${b("picker.seat","Seat")}</span><span class="sl-confirm-value">${i(n?.seatNumber??n?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function vo(n,e,t){let i=Zi,o=n?.objectType==="booth",s=n?.objectType==="table"&&!!n?.bookingMode,r=o||s||!n?.seatNumber,a=n?.sectionLabel??(r?void 0:n?.displayLabel),l=s?`${b("picker.guests","Guests")} ${n?.bookingMode==="variable"?`${n?.minOccupancy}\u2013${n?.maxOccupancy}`:n?.capacity}`:void 0,h=(r?[l,a?n?.rowLabel??n?.displayLabel:void 0]:[n?.rowLabel?`${t} ${K(n)??""}`.trim():void 0,`${b("picker.seat","Seat")} ${n?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${i(a)}</span>`:"")+(h?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${i(h)}</span>`:"")+(a||h?"":`<span class="sl-confirm-pos">${i(e)}</span>`)}function wo(n,e){if(!n)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 xo(n,e){if(!n||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 ho(n){return n.buyerMessage?.trim()||(n.restriction==="companion"?b("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function So(n,e,t){let i=Zi;if(n.length>1)return`<fieldset class="sl-confirm-tiers"><legend>${b("picker.ticketType","Ticket type")}</legend>`+n.map(r=>{let a=ho(r);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${i(r.id)}" aria-pressed="${r.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${i(r.name)}</span>`+(a?`<small class="sl-confirm-tier-note">${i(a)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${i(t(r))}</span></button>`}).join("")+"</fieldset>";let o=n[0],s=o?ho(o):void 0;return s?`<p class="sl-confirm-tier-note">${i(s)}</p>`:""}function ko(n){return'<div class="sl-confirm-grid">'+n.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${E(n.categoryLabel)}</span>`+(n.priceLabel?`<span class="sl-confirm-price">${E(n.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-id">'+n.marker+`<span class="sl-confirm-dot" style="background:${E(n.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${E(n.categoryLabel)}</span><span class="sl-confirm-who">`+n.identity+"</span>"+(n.priceLabel?`<span class="sl-confirm-idprice">${E(n.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+n.commercial+n.tierChoices+n.groupDates+n.wheelchair+(n.thumb||n.see3dPill?`<div class="sl-confirm-strip">${n.thumb}<span class="sl-confirm-pills">${n.see3dPill}</span></div>`:"")+n.inspect+'<div class="sl-confirm-row">'+(n.see3dRow??"")+`<button type="button" class="sl-confirm-cancel">${E(n.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${E(n.selectLabel)}</span></button></div></div>`}function To(n,e){let t=O,{variable:i}=e;return`<section class="sl-table-dialog" role="dialog" aria-modal="true" aria-labelledby="sl-table-title" aria-describedby="sl-table-copy"><div class="sl-table-head"><div class="sl-table-eyebrow">${t(i?ze("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):ze("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(n.displayLabel??n.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(i?b("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):ze("picker.allPlacesBookedTogether",{count:n.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t(ze("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(b("picker.tableCapacity","Table capacity"))}</span><span>${t(ze("picker.guestsCount",{count:n.capacity}))}</span>`+(e.suppressPricing?"":`<span class="muted">${t(b("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(i?`<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>${n.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(ze("picker.chooseMinMaxGuests",{min:n.minOccupancy,max:n.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${n.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t(ze("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?b("picker.updateTable","Update table"):i?b("picker.selectTable","Select table"):b("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function Eo(n,e){let t=xl(n),i=document.createElement("div");i.className="sl-interrupt sl-access",i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let o=document.createElement("div");o.className="sl-interrupt-card";let 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()=>{i.classList.add("is-reloading"),l.disabled=!0;try{await e()}catch{}finally{i.isConnected&&(i.classList.remove("is-reloading"),l.disabled=!1)}}),a.appendChild(l),o.appendChild(a),i.appendChild(o),i}function Co(n,e){return`<div class="sl-a11yhead"><span class="sl-a11yhead-t">${E(n)}</span><button type="button" class="sl-a11yclose" data-a11y-close aria-label="${O(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 Ao(n){return n.map(e=>{let t=`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${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}${at({id:`sl-info-${O(e.key.replace(/[^A-Za-z0-9]+/g,"-"))}`,label:e.note,text:E(e.note)})}</div>`:t}).join("")}function at(n){return`<span class="sl-info"${n.wrapRef?` data-ref="${O(n.wrapRef)}"`:""}><button type="button" class="sl-info-btn" data-sl-info aria-label="${O(n.label)}" aria-describedby="${O(n.id)}" aria-expanded="false"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v5"/><path d="M12 8h.01"/></svg></button><span class="sl-info-pop" role="tooltip" id="${O(n.id)}"${n.ref?` data-ref="${O(n.ref)}"`:""}>${n.text}</span></span>`}function Cl(){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 Po(n,e,t){let i=document.createElement("div");i.className="sl-picker",i.tabIndex=-1,i.lang=kl(),i.dir=Tl(),n.appendChild(i),Object.entries(ot(void 0,t)).forEach(([s,r])=>i.style.setProperty(s,r)),i.innerHTML=`
1
+ import{a as so,b as ro,d as Xt,e as st,f as Zt,g as rt}from"./chunk-RZ2VKZ44.js";import{a as m,b as P,c as k,d as x}from"./chunk-OSZ7DOEH.js";import{PickerController as Ac,formatMoney as Pc,getLocale as fn,loadLocale as Lc,localeDirection as Mc,LOCALE_NAMES as Hc,resolveLocale as Rc,setStringOverrides as Ic,t as me}from"@seatlayer/core";var Ve="seatlayer.v1";function pl(n){let e=typeof n.default=="string"?n.default:"free",t={};if(n.seats&&typeof n.seats=="object")for(let[i,o]of Object.entries(n.seats))typeof o=="string"&&o!==e&&(t[i]=o);return{default:e,exceptions:t}}function hl(n,e){if(!n||n.default!==e.default)return null;let t=[];for(let[i,o]of Object.entries(e.exceptions))n.exceptions[i]!==o&&t.push({label:i,status:o});for(let i of Object.keys(n.exceptions))i in e.exceptions||t.push({label:i,status:e.default});return t}function ul(n,e){for(let t of e)t.status===n.default?delete n.exceptions[t.label]:n.exceptions[t.label]=t.status}function ao(n){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var Te=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,ao(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=[Ve];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(Ve)||e.unshift(Ve)):s?.ticket&&(e=[Ve,`tkt.${s.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let i=this.useQueryMarker?`${this.opts.url}${this.opts.url.includes("?")?"&":"?"}pv=1`:this.opts.url;ao(i);let o;try{o=(this.opts.socketFactory??((r,a)=>new WebSocket(r,a)))(i,e)}catch{this.scheduleReconnect();return}this.ws=o,o.onopen=()=>{this.ws===o&&(this.attempt=0,this.v1=o.protocol===Ve,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 i=Array.isArray(e.hidden)?e.hidden:[],o=Array.isArray(e.closed)?e.closed:[],s=i.join("\0"),r=o.join("\0");(s!==this.hidden||r!==this.closedSections)&&(this.hidden=s,this.closedSections=r,this.opts.sink.onSections?.(i,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 i=pl(e),o=hl(this.projection,i);this.projection=i,o===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(i):this.opts.sink.resync():o.length&&this.opts.sink.applyStatuses(o);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let i=e.changes.filter(o=>typeof o?.label=="string"&&typeof o?.status=="string").map(o=>({label:o.label,status:o.status}));if(!i.length)return;this.projection&&ul(this.projection,i),this.opts.sink.applyStatuses(i)}}}}answered(){this.resumeTimer&&(clearTimeout(this.resumeTimer),this.resumeTimer=null)}reportIfAccessError(e){let t=e?.reason;e?.name==="BuyerAccessUnavailableError"&&(this.stopped=!0,this.opts.onAccessUnavailable?.({reason:t??"invalid",code:e.code,status:e.status,retryable:t==="paused"}))}startKeepalive(e){this.pingTimer=setInterval(()=>{if(this.ws===e){try{e.send(JSON.stringify({type:"ping"}))}catch{return}this.clearPongTimer(),this.pongTimer=setTimeout(()=>{this.pongTimer=null;try{e.close()}catch{}},1e4)}},25e3)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,15e3),i=Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}clearPongTimer(){this.pongTimer&&(clearTimeout(this.pongTimer),this.pongTimer=null)}clearTimers(){this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=null,this.clearPongTimer(),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.resumeTimer&&clearTimeout(this.resumeTimer),this.resumeTimer=null}};function ml(n){return n==="blocked"?"not_for_sale":n==="held"||n==="booked"||n==="free"||n==="not_for_sale"?n:"free"}function Pt(n,e={}){let t=i=>{let o=n.tableSelection(i);if(o)return o.physicalSeatIds;let s=n.idForLabel(i);return s?[s]:[]};return{applyStatuses(i){let o=new Set([...n.currentHold()?.labels??[],...e.ownLabels?.()??[]]),s={free:[],held:[],booked:[],not_for_sale:[]},r=[],a=[],l=new Map(n.getSelection().map(c=>[c.label,c.id]));for(let c of i){let d=t(c.label);if(!d.length)continue;let p=ml(c.status);if(s[p].push(...d),e.flashOnLiveChange&&p!=="free"&&!o.has(c.label)&&d.some(u=>n.getStatus(u)==="free")){let u=p==="held"?"#f4b740":"#f43f5e";for(let h of d)r.push({id:h,color:u})}p!=="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&&n.setStatus(s[c],c);for(let c of r)n.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(p=>t(p));c.length&&n.deselect(c);let d=i.some(p=>p.status==="blocked"&&a.includes(p.label));e.onSelectedObjectUnavailable?.(a,d?"ineligible":"taken")}e.onStatusChange?.()},...n.applyProjection?{applyProjection:i=>{n.applyProjection(i)}}:{},async resync(i){await(n.resync?n.resync(i):n.refresh())},onSections(i,o,s){s?.withInventory||(n.resync?n.resync({reason:"frame"}):n.refresh()),e.onSections?.(i,o,s)}}}var V=class extends Error{constructor(e,t,i,o,s,r){super(t),this.name="ApiError",this.status=e,this.code=i,this.conflicts=o,this.reason=s,this.retryAfterS=r}},lo=10,co=1;function Qt(n,e){let t=(n??"").trim();if(t){let i=Number(t);if(Number.isFinite(i)&&i>=0)return Math.ceil(i);let o=Date.parse(t);if(Number.isFinite(o))return Math.max(0,Math.ceil((o-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}var fl={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"},Re=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 i=t.referral?.trim();this.referral=i?i.slice(0,120):void 0}get accessScoped(){return!!this.access?.configured}async request(e,t={},i={}){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(i.auth?"unauthorized":"initial");a&&(s.Authorization=a);let l=o==="GET"||e.endsWith("/hold/resume")?new AbortController:null,c=l?setTimeout(()=>l.abort(),4e4):null,d,p;try{d=await fetch(`${this.base}${e}`,{method:o,headers:s,body:r,credentials:"omit",...l?{signal:l.signal}:{}}),p=(d.headers.get("content-type")??"").includes("application/json")?await d.json().catch(h=>{if(l?.signal.aborted)throw h;return null}):null}finally{c!==null&&clearTimeout(c)}if(!d.ok){let u=p,h=u?.code??u?.error;if(this.access?.configured&&(d.status===401||d.status===403||d.status===422)&&await this.access.handleFailure(d.status,h)&&!i.auth)return this.request(e,t,{...i,auth:!0});if(d.status===409){let f=h?fl[h]:void 0,T=u?.conflicts?.map(S=>S.label)??t.labels??[];f&&this.onObjectUnavailable?.({labels:T,reason:f,code:h})}let y;if(d.status===429&&(y=Qt(d.headers.get("Retry-After"),u?.retryAfterSeconds)??co,o==="GET"&&!i.rateLimit&&y<=lo))return await new Promise(f=>setTimeout(f,y*1e3)),this.request(e,t,{...i,rateLimit:!0});throw new V(d.status,u?.error??`request_failed_${d.status}`,h,u?.conflicts,u?.reason,y)}return p}async requestBlob(e,t={}){let i={},o=await this.access?.authorization(t.auth?"unauthorized":"initial");o&&(i.Authorization=o);let s=await fetch(`${this.base}${e}`,{method:"GET",headers:i,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=Qt(s.headers.get("Retry-After"),a?.retryAfterSeconds)??co,!t.rateLimit&&c<=lo))return await new Promise(d=>setTimeout(d,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new V(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 V(404,"not_found","not_found"))}objects(e){return this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1`)}hold(e,t,i,o){return this.request(`/pub/events/${encodeURIComponent(e)}/hold`,{method:"POST",body:{selections:t,...i?{ttlMs:i}:{},...o?{replaceHoldId:o}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(s=>s.label)})}bestAvailable(e,t,i,o,s){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available`,{method:"POST",body:{qty:t,...i?{categoryKey:i}:{},...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,i){return this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:i}})}extend(e,t,i){return this.request(`/pub/events/${encodeURIComponent(e)}/extend`,{method:"POST",body:{holdId:t,...i?{ttlMs:i}:{}}})}paymentOptions(e){return this.request(`/pub/events/${encodeURIComponent(e)}/payment-options`)}availability(e,t=!1){return this.request(`/pub/events/${encodeURIComponent(e)}/availability${t?"?live=1":""}`)}startCheckout(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/checkout`,{method:"POST",body:t})}orderStatus(e){return this.request(`/pub/orders/${encodeURIComponent(e)}/status`)}subscribeTicket(e){return this.request(`/pub/events/${encodeURIComponent(e)}/subscribe-tickets`,{method:"POST",body:{}})}subscribeUrl(e){let t=this.base.replace(/^http/,"ws"),i=new URLSearchParams({surface:"picker",viewerId:this.viewerId});return`${t}/pub/events/${encodeURIComponent(e)}/subscribe?${i}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[Ve]}createRealtime(e,t){return this.accessScoped?null:new Te({url:this.subscribeUrl(e),sink:t})}};import{getLocale as Hl,loadLocale as Rl,LOCALE_NAMES as Il,localeDirection as Io,resolveLocale as Oo,setStringOverrides as Ol,TRANSLATED_LOCALES as _l}from"@seatlayer/core";import{getLocale as Al,localeDirection as Pl,t as Ll}from"@seatlayer/core";import{compactRowLabel as Sl,seatNoteRowModel as kl,seatTypeIconSvg as go,t as $e}from"@seatlayer/core";import{seatConfidenceDisclosure as Tl}from"@seatlayer/core/core/seatConfidence";import{t as wl}from"@seatlayer/core";import{cdnAssetUrl as xl}from"@seatlayer/core/core/cdnAsset";var gl=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,bl=/[\s"'<>`\\]/;function yl(n){return n.startsWith("//")?!1:n.startsWith("/")||n.startsWith("./")||n.startsWith("../")}function vl(){try{let n=typeof location>"u"?"":location.origin;return n&&n!=="null"?n:null}catch{return null}}function at(n){if(typeof n!="string"||!n||n.length>2e6||n!==n.trim())return!1;if(n.startsWith("data:"))return gl.test(n);if(bl.test(n))return!1;let e=vl();if(yl(n)){if(!e)return!1;try{let t=new URL(n,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(n);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}import{SEATLAYER_MODULE_URL as Ch}from"@seatlayer/core/core/cdnAsset";function b(n,e){let t=wl(n);return t===n?e:t}function ze(){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 Jt(){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 po(n,e){let t=e?n.toLocaleUpperCase(e):n.toLocaleUpperCase(),i=e?n.toLocaleLowerCase(e):n.toLocaleLowerCase();if(n!==t||t===i)return n;let o=[...i][0]??"";return(e?o.toLocaleUpperCase(e):o.toLocaleUpperCase())+i.slice(o.length)}function ho(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}function O(n){return String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}function uo(n,e,t){let i=e.find(s=>at(s))??null;if(n.replaceChildren(),!i)return n.textContent=t.slice(0,1).toUpperCase(),null;let o=document.createElement("img");return o.alt="",o.referrerPolicy="no-referrer",o.src=i,n.appendChild(o),i}var lt=null;function ei(){if(lt!==null)return lt;try{if(typeof document>"u")return lt=!1;lt=!!document.createElement("canvas").getContext("webgl2")}catch{lt=!1}return lt}function Ji(n){return xl(n)}var Lt=null;function Mt(){return Lt||(Lt=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Ji("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")).catch(e=>{throw Lt=null,e}),Lt)}function ti(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||Mt().catch(()=>{})}async function ii(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Ji("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function ni(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Ji("seatlayer-checkout.mjs")):import("./hostedCheckout-W7QZWSOQ.js")}function mo(n){return n==="unavailable_for_event"||n==="payments_off_for_event"?n:"not_configured"}function oi(n,e,t){let i={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},o=new Date(n);if(e)try{return o.toLocaleString(t,{...i,timeZone:e})}catch{}return o.toLocaleString(t,i)}function en(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function E(n){return String(n??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function tn(n){return n?kl(n).map(e=>({...e,title:b(e.titleKey,e.titleFallback)})):[]}function bo(n){return tn(n).map(e=>e.title)}function je(n,e={}){let t=tn(n);if(!t.length)return"";let i=e.compact?15:17,o=t.map(s=>`<div class="sl-note sl-note-${E(s.tone)}"><span class="sl-note-i">${go(s.icon,{size:i})}</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 yo(n){return tn(n).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}">${go(e.icon,{size:13})}</span>`}).join("")}function si(n){let e=[];return n?.restrictedView&&e.push(b("picker.restrictedView","Restricted view")),n?.obstructedView&&e.push(b("picker.obstructedView","Obstructed view")),e}function nn(n,e){if(!n)return"";let t=e?b("picker.viewFromThisSeat","View from this seat"):b("picker.seeItIn3d","See it in 3D"),i=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>${i}</span></button>`}function vo(n,e){if(!e)return"";let t=e,i=t.includes(n.id),o=i?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"${i&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${E(o)}</span></button>`}function wo(n,e,t){if(!t)return"";let i=Tl(n.confidenceEvidence),o=i.modeledTarget??i.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${E(n.displayLabel??n.label)}"><span><em>${E(e)}</em><strong>${E(i.headline)}</strong><small>${E(o)}</small></span><b>Passport</b></button>`}function q(n){let e=n?.rowLabel,t=n?.sectionLabel;if(!e||!t)return e;for(let i of["-"," ","\xB7","/","_"]){let o=`${t}${i}`;if(e.startsWith(o)&&e.length>o.length)return e.slice(o.length)}return Sl(e,t)}function El(n){switch(n){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 Cl=6;function xo(n,e,t){let i=en;return[n?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${n.sectionLabel.length>Cl?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${b("picker.section","Section")}</span><span class="sl-confirm-value">${i(n.sectionLabel)}</span></div>`:"",n?.rowLabel||n?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${i(t)}</span><span class="sl-confirm-value">${i(q(n)??n?.displayLabel??e)}</span></div>`:"",n?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${b("picker.seat","Seat")}</span><span class="sl-confirm-value">${i(n?.seatNumber??n?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function So(n,e,t){let i=en,o=n?.objectType==="booth",s=n?.objectType==="table"&&!!n?.bookingMode,r=o||s||!n?.seatNumber,a=n?.sectionLabel??(r?void 0:n?.displayLabel),l=s?`${b("picker.guests","Guests")} ${n?.bookingMode==="variable"?`${n?.minOccupancy}\u2013${n?.maxOccupancy}`:n?.capacity}`:void 0,d=(r?[l,a?n?.rowLabel??n?.displayLabel:void 0]:[n?.rowLabel?`${t} ${q(n)??""}`.trim():void 0,`${b("picker.seat","Seat")} ${n?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${i(a)}</span>`:"")+(d?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${i(d)}</span>`:"")+(a||d?"":`<span class="sl-confirm-pos">${i(e)}</span>`)}function ko(n,e){if(!n)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 To(n,e){if(!n||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 fo(n){return n.buyerMessage?.trim()||(n.restriction==="companion"?b("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function Eo(n,e,t){let i=en;if(n.length>1)return`<fieldset class="sl-confirm-tiers"><legend>${b("picker.ticketType","Ticket type")}</legend>`+n.map(r=>{let a=fo(r);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${i(r.id)}" aria-pressed="${r.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${i(r.name)}</span>`+(a?`<small class="sl-confirm-tier-note">${i(a)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${i(t(r))}</span></button>`}).join("")+"</fieldset>";let o=n[0],s=o?fo(o):void 0;return s?`<p class="sl-confirm-tier-note">${i(s)}</p>`:""}function Co(n){return'<div class="sl-confirm-grid">'+n.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${E(n.categoryLabel)}</span>`+(n.priceLabel?`<span class="sl-confirm-price">${E(n.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-id">'+n.marker+`<span class="sl-confirm-dot" style="background:${E(n.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${E(n.categoryLabel)}</span><span class="sl-confirm-who">`+n.identity+"</span>"+(n.priceLabel?`<span class="sl-confirm-idprice">${E(n.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+n.commercial+n.tierChoices+n.groupDates+n.wheelchair+(n.thumb||n.see3dPill?`<div class="sl-confirm-strip">${n.thumb}<span class="sl-confirm-pills">${n.see3dPill}</span></div>`:"")+n.inspect+'<div class="sl-confirm-row">'+(n.see3dRow??"")+`<button type="button" class="sl-confirm-cancel">${E(n.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${E(n.selectLabel)}</span></button></div></div>`}function Ao(n,e){let t=O,{variable:i}=e;return`<section class="sl-table-dialog" role="dialog" aria-modal="true" aria-labelledby="sl-table-title" aria-describedby="sl-table-copy"><div class="sl-table-head"><div class="sl-table-eyebrow">${t(i?$e("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):$e("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(n.displayLabel??n.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(i?b("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):$e("picker.allPlacesBookedTogether",{count:n.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t($e("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(b("picker.tableCapacity","Table capacity"))}</span><span>${t($e("picker.guestsCount",{count:n.capacity}))}</span>`+(e.suppressPricing?"":`<span class="muted">${t(b("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(i?`<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>${n.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($e("picker.chooseMinMaxGuests",{min:n.minOccupancy,max:n.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${n.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t($e("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?b("picker.updateTable","Update table"):i?b("picker.selectTable","Select table"):b("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function Po(n,e){let t=El(n),i=document.createElement("div");i.className="sl-interrupt sl-access",i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let o=document.createElement("div");o.className="sl-interrupt-card";let 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 d=document.createElement("span");return d.textContent=t.action,l.append(c,d),l.addEventListener("click",async()=>{i.classList.add("is-reloading"),l.disabled=!0;try{await e()}catch{}finally{i.isConnected&&(i.classList.remove("is-reloading"),l.disabled=!1)}}),a.appendChild(l),o.appendChild(a),i.appendChild(o),i}function Lo(n,e){return`<div class="sl-a11yhead"><span class="sl-a11yhead-t">${E(n)}</span><button type="button" class="sl-a11yclose" data-a11y-close aria-label="${O(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 Mo(n){return n.map(e=>{let t=`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${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}${ct({id:`sl-info-${O(e.key.replace(/[^A-Za-z0-9]+/g,"-"))}`,label:e.note,text:E(e.note)})}</div>`:t}).join("")}function ct(n){return`<span class="sl-info"${n.wrapRef?` data-ref="${O(n.wrapRef)}"`:""}><button type="button" class="sl-info-btn" data-sl-info aria-label="${O(n.label)}" aria-describedby="${O(n.id)}" aria-expanded="false"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v5"/><path d="M12 8h.01"/></svg></button><span class="sl-info-pop" role="tooltip" id="${O(n.id)}"${n.ref?` data-ref="${O(n.ref)}"`:""}>${n.text}</span></span>`}function Ml(){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 Ho(n,e,t){let i=document.createElement("div");i.className="sl-picker",i.tabIndex=-1,i.lang=Al(),i.dir=Pl(),n.appendChild(i),Object.entries(rt(void 0,t)).forEach(([s,r])=>i.style.setProperty(s,r)),i.innerHTML=`
2
2
  <div class="sl-head">
3
3
  <div class="sl-logo" data-ref="logo"></div>
4
4
  <div class="sl-head-info" data-ref="headInfo">
@@ -49,7 +49,7 @@ import{a as io,b as no,d as Kt,e as nt,f as Wt,g as ot}from"./chunk-RZ2VKZ44.js"
49
49
  </div>
50
50
  <div class="sl-boot" data-ref="boot">
51
51
  <div class="sl-boot-bar" aria-hidden="true"></div>
52
- ${Cl()}
52
+ ${Ml()}
53
53
  <span class="sl-boot-say" role="status" aria-live="polite" data-sl-t="picker.loadingSeatMap">${e("picker.loadingSeatMap","Loading seat map\u2026")}</span>
54
54
  </div>
55
55
  <div class="sl-toast" data-ref="toast" role="status" aria-live="polite"></div>
@@ -63,10 +63,10 @@ import{a as io,b as no,d as Kt,e as nt,f as Wt,g as ot}from"./chunk-RZ2VKZ44.js"
63
63
  <div class="sl-sec sl-filtersec" data-ref="filtersSec" data-sl-t="picker.filters">${e("picker.filters","Filters")}</div>
64
64
  <div class="sl-filters" data-ref="filters"></div>
65
65
  <div class="sl-offer" data-ref="offer" role="status" aria-live="polite"></div>
66
- <div class="sl-sec sl-prices-sec" data-ref="pricesSec"><span data-sl-t="picker.ticketPrices">${e("picker.ticketPrices","Ticket prices")}</span>${at({id:"sl-info-prices",label:e("picker.aboutTicketPrices","About ticket prices"),text:e("picker.priceHint","Colours on the map are ticket types \u2014 tap one below to show just those seats."),ref:"pricesHint",wrapRef:"pricesInfo"})}</div>
66
+ <div class="sl-sec sl-prices-sec" data-ref="pricesSec"><span data-sl-t="picker.ticketPrices">${e("picker.ticketPrices","Ticket prices")}</span>${ct({id:"sl-info-prices",label:e("picker.aboutTicketPrices","About ticket prices"),text:e("picker.priceHint","Colours on the map are ticket types \u2014 tap one below to show just those seats."),ref:"pricesHint",wrapRef:"pricesInfo"})}</div>
67
67
  <div class="sl-prices" data-ref="prices"></div>
68
68
  <div class="sl-sec sl-seats-sec">
69
- <span class="sl-sec-title"><span data-sl-t="picker.yourSeats">${e("picker.yourSeats","Your seats")}</span>${at({id:"sl-info-seats",label:e("picker.aboutYourSeats","How to choose seats"),text:e("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you."),ref:"trayHint",wrapRef:"seatsInfo"})}</span>
69
+ <span class="sl-sec-title"><span data-sl-t="picker.yourSeats">${e("picker.yourSeats","Your seats")}</span>${ct({id:"sl-info-seats",label:e("picker.aboutYourSeats","How to choose seats"),text:e("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you."),ref:"trayHint",wrapRef:"seatsInfo"})}</span>
70
70
  <span class="sl-seat-summary" data-ref="seatSummary"></span>
71
71
  </div>
72
72
  <div class="sl-tray" data-ref="tray"></div>
@@ -75,7 +75,7 @@ import{a as io,b as no,d as Kt,e as nt,f as Wt,g as ot}from"./chunk-RZ2VKZ44.js"
75
75
  <button type="button" class="sl-cta" data-ref="cta" disabled></button>
76
76
  </div>
77
77
  </div>
78
- </div>`;let o={};return i.querySelectorAll("[data-ref]").forEach(s=>{o[s.dataset.ref]=s}),{root:i,mapHost:o.map,els:o}}function Lo(n){let e=(t,i)=>{for(let o of n.querySelectorAll(`[${t}]`)){let s=o.getAttribute(t);if(!s)continue;let r=El(s);r!==s&&i(o,r)}};e("data-sl-t",(t,i)=>{t.textContent=i}),e("data-sl-a",(t,i)=>{t.setAttribute("aria-label",i)}),e("data-sl-ti",(t,i)=>{t.setAttribute("title",i)})}function ni(n,e){let t=Ho(n),i=Hl.includes(t)?t:"en";return e&&Ml(e),{locale:i,direction:Mo(i),ready:Pl(n)}}function oi(n,e,t){n.lang=e.locale,n.dir=e.direction,e.ready.then(t)}function Ro(n,e){if(!n)return null;let t=(e.languages??[]).map(o=>Ho(o)).filter((o,s,r)=>r.indexOf(o)===s);if(t.length<2)return null;let i=document.createElement("select");i.className="sl-langsel",i.setAttribute("aria-label",e.label);for(let o of t){let s=document.createElement("option");s.value=o,s.textContent=Ll[o]??o,s.selected=o===Al(),i.appendChild(s)}return i.addEventListener("change",()=>e.onChange(i.value)),n.appendChild(i),i}function Io(n,e){e.root.lang=n,e.root.dir=Mo(n),Lo(e.root);for(let i of e.painters)try{i()}catch{}e.refreshMapCopy();let t=e.languageSelect;t&&t.value!==n&&(t.value=n)}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}},Rl=new Set(["buyer_access_expired"]),Il=new Set(["paused","provider_failed","channel_denied","sales_not_open"]);function Ol(n,e){switch(e){case"buyer_access_invalid":return"invalid";case"buyer_access_revoked":return"revoked";case"buyer_access_origin_mismatch":return"origin_mismatch";case"buyer_access_event_mismatch":return"event_mismatch";case"buyer_access_group_mismatch":return"group_mismatch";case"buyer_access_mode_mismatch":return"mode_mismatch";case"buyer_access_environment_mismatch":return"environment_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";case"audience_not_public":return"audience_not_public";case"sales_not_open":return"sales_not_open";case"origin_not_allowed":return"origin_not_allowed";default:break}return n===401?"invalid":null}function _l(n,e){return n===401&&!!e&&Rl.has(e)}var Nl=3e4,ie,ne,ct,dt,Lt,Re,Te,pt,Mt,Ht,Rt,je,oe,en,si,lt,ae=class{constructor(e){M(this,oe);M(this,ie,null);M(this,ne,0);M(this,ct,null);M(this,dt);M(this,Lt);M(this,Re,null);M(this,Te,null);M(this,pt,null);M(this,Mt);M(this,Ht);M(this,Rt,!1);M(this,je);if(k(this,dt,e.provider),k(this,Lt,e.skewMs??Nl),k(this,Mt,e.onExpired),k(this,Ht,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;x(this,oe,en).call(this,t)}k(this,Rt,!!u(this,dt)||!!u(this,ie))}get configured(){return u(this,Rt)}onRenewed(e){k(this,je,e)}get unavailable(){return u(this,Te)}get hasToken(){return!!u(this,ie)&&(u(this,ne)===0||u(this,ne)>Date.now())}get expiresAt(){return u(this,ne)}async authorization(e="initial"){if(!this.configured)return null;if(u(this,Te))throw new se(u(this,Te));let t=Date.now();if(!u(this,ie)||u(this,ne)>0&&u(this,ne)-u(this,Lt)<=t){let o=!!u(this,ie)&&u(this,ne)>0&&u(this,ne)<=t,s=u(this,ie)?o?"expired":"expiring":e,r=await x(this,oe,si).call(this,s);if(!r)throw new se(u(this,Te)??u(this,pt)??x(this,oe,lt).call(this,"provider_failed"));return`Bearer ${r}`}return`Bearer ${u(this,ie)}`}async handleFailure(e,t){var o;if(!this.configured)return!1;if(_l(e,t)){k(this,ie,null),k(this,ne,0);let s=await x(this,oe,si).call(this,"unauthorized",t);return(o=u(this,Mt))==null||o.call(this,{reason:"unauthorized",code:t,refreshed:!!s}),!!s}let i=Ol(e,t);return i&&x(this,oe,lt).call(this,i,t,e),!1}async refresh(e="manual"){return k(this,Te,null),k(this,pt,null),k(this,ie,null),k(this,ne,0),!!await x(this,oe,si).call(this,e)}clear(){k(this,ie,null),k(this,ct,null),k(this,ne,0),k(this,Re,null),k(this,je,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};ie=new WeakMap,ne=new WeakMap,ct=new WeakMap,dt=new WeakMap,Lt=new WeakMap,Re=new WeakMap,Te=new WeakMap,pt=new WeakMap,Mt=new WeakMap,Ht=new WeakMap,Rt=new WeakMap,je=new WeakMap,oe=new WeakSet,en=function(e){return!e||typeof e.token!="string"||!e.token?null:(k(this,ct,e.token),k(this,ie,e.token),k(this,ne,typeof e.expiresAt=="number"?e.expiresAt:0),u(this,ie))},si=function(e,t){if(u(this,Re))return u(this,Re);let i=u(this,dt);if(!i)return x(this,oe,lt).call(this,"no_token",t),Promise.resolve(null);let o=u(this,ct),s=(async()=>{try{let r=await i({reason:e}),a=x(this,oe,en).call(this,r);if(!a)return x(this,oe,lt).call(this,"provider_failed",t),null;if(o&&o!==a&&u(this,je))try{await u(this,je).call(this,{previousToken:o,token:a,reason:e})}catch{}return a}catch{return x(this,oe,lt).call(this,"provider_failed",t),null}finally{k(this,Re,null)}})();return k(this,Re,s),s},lt=function(e,t,i){var s;let o={reason:e,code:t,status:i,retryable:e==="paused"||e==="channel_denied"||e==="sales_not_open"};return k(this,pt,o),Il.has(e)||(k(this,Te,o),k(this,ie,null),k(this,ne,0)),(s=u(this,Ht))==null||s.call(this,o),o};function It(n,e={}){return!n.buyerAccessTokenProvider&&!n.buyerAccessToken?null:new ae({provider:n.buyerAccessTokenProvider,token:n.buyerAccessToken,...e})}var Dl=3e4;function Bl(n){if(!n||typeof n!="object"||Array.isArray(n))return!1;let e=n;return typeof e.token=="string"&&e.token.startsWith("bse_")&&typeof e.expiresAt=="number"&&Number.isFinite(e.expiresAt)&&e.expiresAt>Date.now()&&!!e.event&&typeof e.event=="object"&&!!e.doc&&typeof e.doc=="object"&&!!e.objects&&typeof e.objects=="object"&&!Array.isArray(e.objects)&&!!e.objects.seats&&typeof e.objects.seats=="object"}var tn=class{constructor(e,t,i){this.base=e;this.event=t;this.publicKey=i;this.value=null;this.inflight=null}async load(e=!1){if(e&&(this.value=null),this.value&&this.value.expiresAt-Dl>Date.now())return this.value;if(this.inflight)return this.inflight;let t=(async()=>{let i=await fetch(`${this.base}/pub/events/${encodeURIComponent(this.event)}/bootstrap`,{method:"POST",body:JSON.stringify({publicKey:this.publicKey}),credentials:"omit"}),o=await i.json().catch(()=>null);if(!i.ok){let s=i.status===429?Yt(i.headers.get("Retry-After"),o?.retryAfterSeconds):void 0;throw new V(i.status,o?.error??`request_failed_${i.status}`,o?.code??o?.error,void 0,void 0,s)}if(!Bl(o))throw new V(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",i=await this.load(t);return{token:i.token,expiresAt:i.expiresAt}}},nn=class extends He{constructor(t,i,o,s,r){super(t,{...r,access:s});this.event=i;this.loader=o;this.bootstrapAccess=s;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1}assertEvent(t){if(t!==this.event)throw new V(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 i=await this.bundle(t);return this.initialChartDelivered=!0,{event:i.event,doc:i.doc,chartDelivery:i.chartDelivery}}async objects(t){if(this.assertEvent(t),this.initialObjectsDelivered)return super.objects(t);let i=await this.bundle(t);return this.initialObjectsDelivered=!0,i.objects}};function ri(n){let e=new tn(n.base,n.event,n.publicKey),t=new ae({provider:({reason:i})=>e.token(i),...n.accessHooks});return{access:t,api:new nn(n.base,n.event,e,t,n.apiOptions??{})}}import{t as Ee,tCount as Ge}from"@seatlayer/core";var W={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 Fl=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${W.enter}ms;--sl-dur-exit:${W.exit}ms;--sl-dur-spring:${W.spring}ms;--sl-dur-flight:${W.flight}ms;--sl-dur-stagger:${W.stagger}ms;--sl-dur-xfade:${W.crossfade}ms;--sl-dur-collapse:${W.collapse}ms;--sl-dur-rung:${W.rung}ms;--sl-ease-enter:${W.easeEnter};--sl-ease-exit:${W.easeExit};--sl-ease-spring:${W.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,Vl=`@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:${W.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:${W.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}}`,Oo=Fl+`
78
+ </div>`;let o={};return i.querySelectorAll("[data-ref]").forEach(s=>{o[s.dataset.ref]=s}),{root:i,mapHost:o.map,els:o}}function Ro(n){let e=(t,i)=>{for(let o of n.querySelectorAll(`[${t}]`)){let s=o.getAttribute(t);if(!s)continue;let r=Ll(s);r!==s&&i(o,r)}};e("data-sl-t",(t,i)=>{t.textContent=i}),e("data-sl-a",(t,i)=>{t.setAttribute("aria-label",i)}),e("data-sl-ti",(t,i)=>{t.setAttribute("title",i)})}function ri(n,e){let t=Oo(n),i=_l.includes(t)?t:"en";return e&&Ol(e),{locale:i,direction:Io(i),ready:Rl(n)}}function ai(n,e,t){n.lang=e.locale,n.dir=e.direction,e.ready.then(t)}function _o(n,e){if(!n)return null;let t=(e.languages??[]).map(o=>Oo(o)).filter((o,s,r)=>r.indexOf(o)===s);if(t.length<2)return null;let i=document.createElement("select");i.className="sl-langsel",i.setAttribute("aria-label",e.label);for(let o of t){let s=document.createElement("option");s.value=o,s.textContent=Il[o]??o,s.selected=o===Hl(),i.appendChild(s)}return i.addEventListener("change",()=>e.onChange(i.value)),n.appendChild(i),i}function No(n,e){e.root.lang=n,e.root.dir=Io(n),Ro(e.root);for(let i of e.painters)try{i()}catch{}e.refreshMapCopy();let t=e.languageSelect;t&&t.value!==n&&(t.value=n)}function dt(n,e,t,i=45e3){return new Promise(o=>{if(e.aborted){o({outcome:"cancelled"});return}let s=!1,r=d=>{s||(s=!0,clearTimeout(l),clearTimeout(c),e.removeEventListener("abort",a),o(d))},a=()=>r({outcome:"cancelled"}),l=setTimeout(()=>{s||t()},8e3),c=setTimeout(()=>r({outcome:"timeout"}),i);e.addEventListener("abort",a,{once:!0}),Promise.resolve().then(()=>s?void 0:n()).then(d=>{s||r({outcome:"loaded",value:d})},d=>r({outcome:"error",error:d}))})}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}},Nl=new Set(["buyer_access_expired"]),Dl=new Set(["paused","provider_failed","channel_denied","sales_not_open"]);function Bl(n,e){switch(e){case"buyer_access_invalid":return"invalid";case"buyer_access_revoked":return"revoked";case"buyer_access_origin_mismatch":return"origin_mismatch";case"buyer_access_event_mismatch":return"event_mismatch";case"buyer_access_group_mismatch":return"group_mismatch";case"buyer_access_mode_mismatch":return"mode_mismatch";case"buyer_access_environment_mismatch":return"environment_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";case"audience_not_public":return"audience_not_public";case"sales_not_open":return"sales_not_open";case"origin_not_allowed":return"origin_not_allowed";default:break}return n===401?"invalid":null}function Fl(n,e){return n===401&&!!e&&Nl.has(e)}var Vl=3e4,ne,oe,pt,ht,Ht,Ie,Oe,Ee,ut,Rt,It,Ot,Ue,J,on,li,Ge,ae=class{constructor(e){P(this,J);P(this,ne,null);P(this,oe,0);P(this,pt,null);P(this,ht);P(this,Ht);P(this,Ie,null);P(this,Oe,null);P(this,Ee,null);P(this,ut,null);P(this,Rt);P(this,It);P(this,Ot,!1);P(this,Ue);if(k(this,ht,e.provider),k(this,Ht,e.skewMs??Vl),k(this,Rt,e.onExpired),k(this,It,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;x(this,J,on).call(this,t)}k(this,Ot,!!m(this,ht)||!!m(this,ne))}get configured(){return m(this,Ot)}onRenewed(e){k(this,Ue,e)}get unavailable(){return m(this,Ee)}get hasToken(){return!!m(this,ne)&&(m(this,oe)===0||m(this,oe)>Date.now())}get expiresAt(){return m(this,oe)}async authorization(e="initial"){if(!this.configured)return null;if(m(this,Ee))throw new se(m(this,Ee));let t=Date.now();if(!m(this,ne)||m(this,oe)>0&&m(this,oe)-m(this,Ht)<=t){let o=!!m(this,ne)&&m(this,oe)>0&&m(this,oe)<=t,s=m(this,ne)?o?"expired":"expiring":e,r=await x(this,J,li).call(this,s);if(!r)throw new se(m(this,Ee)??m(this,ut)??x(this,J,Ge).call(this,"provider_failed"));return`Bearer ${r}`}return`Bearer ${m(this,ne)}`}async handleFailure(e,t){var o;if(!this.configured)return!1;if(Fl(e,t)){k(this,ne,null),k(this,oe,0);let s=await x(this,J,li).call(this,"unauthorized",t);return(o=m(this,Rt))==null||o.call(this,{reason:"unauthorized",code:t,refreshed:!!s}),!!s}let i=Bl(e,t);return i&&x(this,J,Ge).call(this,i,t,e),!1}async refresh(e="manual"){return k(this,Ee,null),k(this,ut,null),k(this,ne,null),k(this,oe,0),!!await x(this,J,li).call(this,e)}clear(){m(this,Oe)?.abort(),k(this,Oe,null),k(this,ne,null),k(this,pt,null),k(this,oe,0),k(this,Ie,null),k(this,Ue,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};ne=new WeakMap,oe=new WeakMap,pt=new WeakMap,ht=new WeakMap,Ht=new WeakMap,Ie=new WeakMap,Oe=new WeakMap,Ee=new WeakMap,ut=new WeakMap,Rt=new WeakMap,It=new WeakMap,Ot=new WeakMap,Ue=new WeakMap,J=new WeakSet,on=function(e){return!e||typeof e.token!="string"||!e.token?null:(k(this,pt,e.token),k(this,ne,e.token),k(this,oe,typeof e.expiresAt=="number"?e.expiresAt:0),m(this,ne))},li=function(e,t){if(m(this,Ie))return m(this,Ie);let i=m(this,ht);if(!i)return x(this,J,Ge).call(this,"no_token",t),Promise.resolve(null);let o=m(this,pt),s=new AbortController;k(this,Oe,s);let r=(async()=>{try{let a=await dt(()=>Promise.resolve(i({reason:e})),s.signal,()=>{},4e4);if(s.signal.aborted||a.outcome==="cancelled")return null;if(a.outcome!=="loaded")return x(this,J,Ge).call(this,"provider_failed",t),null;let l=a.value,c=x(this,J,on).call(this,l);if(!c)return x(this,J,Ge).call(this,"provider_failed",t),null;if(o&&o!==c&&m(this,Ue))try{await m(this,Ue).call(this,{previousToken:o,token:c,reason:e})}catch{}return s.signal.aborted?null:c}catch{return x(this,J,Ge).call(this,"provider_failed",t),null}finally{m(this,Oe)===s&&(k(this,Ie,null),k(this,Oe,null))}})();return k(this,Ie,r),r},Ge=function(e,t,i){var s;let o={reason:e,code:t,status:i,retryable:e==="paused"||e==="channel_denied"||e==="sales_not_open"};return k(this,ut,o),Dl.has(e)||(k(this,Ee,o),k(this,ne,null),k(this,oe,0)),(s=m(this,It))==null||s.call(this,o),o};function _t(n,e={}){return!n.buyerAccessTokenProvider&&!n.buyerAccessToken?null:new ae({provider:n.buyerAccessTokenProvider,token:n.buyerAccessToken,...e})}var zl=3e4;function $l(n){if(!n||typeof n!="object"||Array.isArray(n))return!1;let e=n;return typeof e.token=="string"&&e.token.startsWith("bse_")&&typeof e.expiresAt=="number"&&Number.isFinite(e.expiresAt)&&e.expiresAt>Date.now()&&!!e.event&&typeof e.event=="object"&&!!e.doc&&typeof e.doc=="object"&&!!e.objects&&typeof e.objects=="object"&&!Array.isArray(e.objects)&&!!e.objects.seats&&typeof e.objects.seats=="object"}var sn=class{constructor(e,t,i){this.base=e;this.event=t;this.publicKey=i;this.value=null;this.inflight=null}async load(e=!1){if(e&&(this.value=null),this.value&&this.value.expiresAt-zl>Date.now())return this.value;if(this.inflight)return this.inflight;let t=(async()=>{let i=new AbortController,o=setTimeout(()=>i.abort(),4e4);try{let s=await fetch(`${this.base}/pub/events/${encodeURIComponent(this.event)}/bootstrap`,{method:"POST",body:JSON.stringify({publicKey:this.publicKey}),credentials:"omit",signal:i.signal}),r=await s.json().catch(()=>null);if(!s.ok){let a=s.status===429?Qt(s.headers.get("Retry-After"),r?.retryAfterSeconds):void 0;throw new V(s.status,r?.error??`request_failed_${s.status}`,r?.code??r?.error,void 0,void 0,a)}if(!$l(r))throw new V(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=r,r}finally{clearTimeout(o)}})();this.inflight=t;try{return await t}finally{this.inflight===t&&(this.inflight=null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",i=await this.load(t);return{token:i.token,expiresAt:i.expiresAt}}},rn=class extends Re{constructor(t,i,o,s,r){super(t,{...r,access:s});this.event=i;this.loader=o;this.bootstrapAccess=s;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1}assertEvent(t){if(t!==this.event)throw new V(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 i=await this.bundle(t);return this.initialChartDelivered=!0,{event:i.event,doc:i.doc,chartDelivery:i.chartDelivery}}async objects(t){if(this.assertEvent(t),this.initialObjectsDelivered)return super.objects(t);let i=await this.bundle(t);return this.initialObjectsDelivered=!0,i.objects}};function ci(n){let e=new sn(n.base,n.event,n.publicKey),t=new ae({provider:({reason:i})=>e.token(i),...n.accessHooks});return{access:t,api:new rn(n.base,n.event,e,t,n.apiOptions??{})}}import{t as Ce,tCount as qe}from"@seatlayer/core";var W={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 jl=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${W.enter}ms;--sl-dur-exit:${W.exit}ms;--sl-dur-spring:${W.spring}ms;--sl-dur-flight:${W.flight}ms;--sl-dur-stagger:${W.stagger}ms;--sl-dur-xfade:${W.crossfade}ms;--sl-dur-collapse:${W.collapse}ms;--sl-dur-rung:${W.rung}ms;--sl-ease-enter:${W.easeEnter};--sl-ease-exit:${W.easeExit};--sl-ease-spring:${W.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,Gl=`@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:${W.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:${W.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}}`,Do=jl+`
79
79
  /* Anchored open/close. The translate is 8px TOWARD the anchor, which is what
80
80
  makes the card look attached to the seat rather than dropped on the map. */
81
81
  .sl-mo-in{transform-origin:var(--sl-mo-ox) var(--sl-mo-oy);
@@ -142,7 +142,7 @@ import{a as io,b as no,d as Kt,e as nt,f as Wt,g as ot}from"./chunk-RZ2VKZ44.js"
142
142
  @keyframes slMoZoom{from{opacity:0;transform:scale(1.02)}to{opacity:1;transform:none}}
143
143
  .sl-mo-rotate-in{animation:slMoSpin var(--sl-dur-spring) var(--sl-ease-spring) 1 both}
144
144
  @keyframes slMoSpin{from{opacity:0;transform:rotate(-140deg) scale(.8)}to{opacity:1;transform:none}}
145
- `+Vl;function ai(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function on(n,e){if(!e){n.style.removeProperty("--sl-mo-ox"),n.style.removeProperty("--sl-mo-oy");return}li(n,e,n.getBoundingClientRect())}function li(n,e,t){let i=t.width||1,o=t.height||1,s=r=>Math.max(0,Math.min(100,r));n.style.setProperty("--sl-mo-ox",`${s((e.x-t.left)/i*100).toFixed(1)}%`),n.style.setProperty("--sl-mo-oy",`${s((e.y-t.top)/o*100).toFixed(1)}%`)}function _o(n,e,t){let i=n.getBoundingClientRect(),o=t.getBoundingClientRect();li(n,e,{left:i.left-o.left,top:i.top-o.top,width:i.width,height:i.height})}function No(n,e){n.classList.remove("sl-mo-out"),e!==void 0&&on(n,e),n.classList.remove("sl-mo-in"),n.offsetWidth,n.classList.add("sl-mo-in")}function Do(n){n.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(n.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function ci(n,e,t={className:"sl-mo-out",duration:W.exit}){let i=()=>{o||(o=!0,!(typeof window>"u")&&(clearTimeout(s),n.removeEventListener("animationend",i),e?e():n.remove()))},o=!1;n.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),n.classList.add(t.className),n.addEventListener("animationend",i);let s=setTimeout(i,ai()?0:t.duration+60)}var Fh={className:"sl-mo-slide-down",duration:W.exit};function Bo(n){if(ai())return n.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=n.label??"",e.style.left=`${n.from.x}px`,e.style.top=`${n.from.y}px`,e.style.background=n.color??"var(--sl-accent,#6e7bff)",e.style.color=n.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(n.to.x-n.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(n.to.y-n.from.y)}px`),document.body.appendChild(e);let t=!1,i=()=>{t||(t=!0,window.clearTimeout(o),e.remove(),n.onArrive?.())};e.addEventListener("animationend",i);let o=window.setTimeout(i,W.flight+80);return e}var z=n=>String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]);function ht(n,e){let t=0;for(let i of n.get(e)?.values()??[])t+=i;return t}function Fo(n){let e=[];for(let[t,i]of n)for(let[o,s]of i)s>0&&e.push({areaId:t,tierId:o,qty:s});return e}function Vo(n){let e=new Map;for(let t of n.keys())e.set(t,ht(n,t));return e}function Ot(n,e,t,i){let o=n.get(e)??new Map;i>0?o.set(t,i):o.delete(t),o.size?n.set(e,o):n.delete(e)}function zo(n){let e=new Map;for(let t of n)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function Ie(n,e){let t=zo(e),i=0;for(let o of n.keys())i+=Math.max(0,ht(n,o)-(t.get(o)??0));return i}function $o(n,e,t){let i=zo(t),o=0;for(let s of e){let r=n.gaQty.get(s.id);if(!r)continue;let a=i.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*n.paidPrice(s.categoryKey,l,zl(s,l),s.id)}}return o}function zl(n,e){return e?n.tiers?.find(t=>t.id===e)?.price??n.price:n.price}function jo(n){let e=[],t=new Map;for(let i of n){if(i.objectType!=="ga"||!i.objectId){e.push({...i,labels:[i.label]});continue}let o=`${i.objectId}\0${i.tierId??""}`,s=t.get(o);if(s){s.quantity=(s.quantity??0)+(i.quantity??1),s.labels.push(i.label);continue}let r={...i,quantity:i.quantity??1,labels:[i.label]};t.set(o,r),e.push(r)}return e}function Go(n,e,t){let i=new Set(t);for(let o of e)o.objectType==="ga"&&o.objectId&&i.has(o.label)&&Ot(n,o.objectId,o.tierId??null,0)}function rn(n,e){if(n.objectType!=="ga")return n.label;let t=e.find(i=>i.id===n.objectId);return t?.displayLabel??t?.label??n.label}function $l(n){let e=new Map;for(let t of n){if(t.objectType!=="ga"||!t.objectId)continue;let i=`${t.objectId}\0${t.tierId??""}`;e.set(i,(e.get(i)??0)+(t.quantity??1))}return e}function di(n){let e=n.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:n.displayType??Ee("picker.generalAdmission"),price:n.price}]}function Uo(n,e){let t=n.totalTicketCount()-ht(n.gaQty,e.id);return Math.max(0,Math.min(e.available,n.maxTickets-t))}function an(n,e,t,i){if(ye(n,!1),n.salesClosed){n.toast(n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let o=di(e),s=n.gaQty.get(e.id),r=ht(n.gaQty,e.id)>0,a=Uo(n,e);if(a<=0&&!r){n.toast(e.available>0?Ee("picker.maxTicketsForOrder",{count:n.maxTickets}):n.tf("picker.soldOutTitle","Sold out"),"warning");return}if(n.onGAPromptHook){let m={};for(let[f,y]of s??[])m[f??""]=y;if(n.onGAPromptHook({area:e,selected:m,min:0,max:a,tiers:o,confirm:f=>{ql(n,e,o,f,a)},cancel:()=>ye(n)})===!0)return}let l=new Map;for(let m of o)l.set(m.id,s?.get(m.id)??0);!r&&a>0&&l.set(o[0].id,1);let c={area:e,tiers:o,draft:l,max:a,reopened:r},h=n.root?.dataset.layout==="narrow",d=document.createElement("div");d.className=h?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",d.innerHTML=jl(n,c,h),n.root?.appendChild(d),n.gaPromptEl=d,n.gaPromptReturnFocus=i??document.activeElement,h||Kl(n,d,t),n.reducedMotion()&&(d.dataset.motion="reduced"),Ko(n,c),Gl(n,d,c),requestAnimationFrame(()=>d.querySelector('[data-ga-step="1"]')?.focus())}function jl(n,e,t){let{area:i,tiers:o}=e,s=o.length>1,r=i.displayLabel??i.label,a=o.map(l=>`<div class="sl-ga-prompt-row" data-ga-tier="${z(l.id??"")}"><div class="sl-ga-prompt-label"><span>${z(s?l.label:n.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(s?`<small>${z(n.money(n.paidPrice(i.categoryKey,l.id,l.price,i.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${z(s?l.label:r)}"><button type="button" data-ga-step="-1" aria-label="${z(n.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${z(n.tf("picker.more","More"))}">+</button></div></div>`).join("");return`<section class="${t?"sl-ga-sheet":"sl-ga-pop"}" role="dialog" aria-modal="true" aria-label="${z(Ee("picker.gaChooseForArea",{area:r}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${z(i.displayType??n.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${z(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="${z(Ee("common.close"))}">\xD7</button></div><div class="sl-ga-prompt-body">${a}`+(o.length>1?`<div class="sl-ga-prompt-total"><span>${z(n.tf("picker.total","Total"))}</span><b data-ga-total></b></div>`:"")+'<p class="sl-ga-prompt-hint" data-ga-hint></p></div><div class="sl-ga-prompt-actions">'+(e.reopened?`<button type="button" class="sl-ga-prompt-remove" data-ga-remove>${z(n.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${z(Ee("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function ln(n){let e=0;for(let t of n.draft.values())e+=t;return e}function qo(n,e){let t=0;for(let i of e.tiers)t+=(e.draft.get(i.id)??0)*n.paidPrice(e.area.categoryKey,i.id,i.price,e.area.id);return t}function Ko(n,e){let t=n.gaPromptEl;if(!t)return;let i=ln(e),o=qo(n,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let h=c.dataset.gaTier?c.dataset.gaTier:null,d=e.draft.get(h)??0,m=c.querySelector("[data-ga-qty]");m&&(m.value=String(d)),c.querySelectorAll("[data-ga-step]").forEach(p=>{p.disabled=Number(p.dataset.gaStep)<0?d<=0:i>=e.max})});let s=t.querySelector("[data-ga-sub]");s&&(s.textContent=`${n.money(n.paidPrice(e.area.categoryKey,e.tiers[0].id,e.tiers[0].price,e.area.id))} \xB7 ${Ge("picker.leftCount",e.area.available)}`);let r=t.querySelector("[data-ga-total]");r&&(r.textContent=n.money(o));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=i>=e.max&&e.max>0?e.area.available<=e.max?Ge("picker.leftCount",e.area.available):Ee("picker.maxTicketsForOrder",{count:n.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");l&&(l.textContent=e.reopened?Ge("picker.gaUpdate",i,{count:i}):Ge("picker.gaAdd",i,{count:i,price:n.money(o)}),l.disabled=i<=0&&!e.reopened)}function Gl(n,e,t){e.querySelectorAll("[data-ga-step]").forEach(i=>{i.addEventListener("click",()=>{let o=i.closest("[data-ga-tier]");if(!o)return;let s=o.dataset.gaTier?o.dataset.gaTier:null,r=Number(i.dataset.gaStep),a=t.draft.get(s)??0,l=t.max-ln(t);t.draft.set(s,Math.max(0,a+(r>0?Math.min(1,l):-1))),Ko(n,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(i=>i.addEventListener("click",()=>ye(n))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{n.gaQty.delete(t.area.id),ye(n),n.syncTray(),sn(n,Ee("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{Ul(n,t)}),e.addEventListener("mousedown",i=>{i.target===e&&ye(n)}),e.addEventListener("keydown",i=>{if(i.key==="Escape"){i.stopPropagation(),ye(n);return}if(i.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];i.shiftKey&&document.activeElement===s?(i.preventDefault(),r.focus()):!i.shiftKey&&document.activeElement===r&&(i.preventDefault(),s.focus())})}function Ul(n,e){let t=ln(e),i=qo(n,e);for(let s of e.tiers)Ot(n.gaQty,e.area.id,s.id,e.draft.get(s.id)??0);ye(n),n.syncTray();let o=e.area.displayLabel??e.area.label;t>0?sn(n,Ge("picker.gaAdded",t,{count:t,area:o,price:n.money(i)})):sn(n,Ee("picker.gaRemoved",{area:o}))}function ql(n,e,t,i,o){if(typeof i=="number")Ot(n.gaQty,e.id,t[0].id,Math.max(0,Math.min(o,Math.floor(i))));else{n.gaQty.delete(e.id);let s=o;for(let r of t){let a=Math.max(0,Math.floor(i[r.id??""]??0)),l=Math.min(a,s);s-=l,Ot(n.gaQty,e.id,r.id,l)}}n.syncTray()}function ye(n,e=!0){let t=n.gaPromptReturnFocus;n.gaPromptEl&&ci(n.gaPromptEl),n.gaPromptEl=null,n.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:n.root)?.focus())}function Kl(n,e,t){let i=n.root,o=e.querySelector(".sl-ga-pop");if(!i||!o||!t)return;let s=i.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,m=d>=8?d:Math.min(s.height-c-8,a+14);o.style.left=`${h}px`,o.style.top=`${Math.max(8,m)}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 sn(n,e){n.srEl&&(n.srEl.textContent=e)}function Wo(n,e,t=[]){let i=[],o=$l(t);for(let r of e){let a=n.gaQty.get(r.id);if(!a)continue;let l=di(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=n.paidPrice(r.categoryKey,c.id,c.price,r.id);i.push(`<div class="sl-ga" data-ga="${z(r.id)}" data-ga-row-tier="${z(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${z(r.displayLabel??r.label)}</div><div class="sl-ga-sub">${z(l.length>1?c.label:r.displayType??n.tf("picker.generalAdmission","General admission"))} \xB7 ${z(n.money(d))} \xB7 ${z(Ge("picker.leftCount",r.available))}</div></div><div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${z(n.tf("picker.fewer","Fewer"))}">\u2212</button><span>${h}</span><button type="button" data-d="1" aria-label="${z(n.tf("picker.more","More"))}">+</button></div></div>`)}}let s=e.filter(r=>ht(n.gaQty,r.id)<=0&&!t.some(a=>a.objectId===r.id));return s.length&&i.push(`<div class="sl-ga-areas" data-ga-areas><button type="button" class="sl-ga-areas-toggle" data-ga-areas-toggle aria-expanded="${n.gaAreasExpanded}"><span>${z(n.tf("picker.gaAreasHeading","Areas"))}</span><small>${s.length}</small></button>`+(n.gaAreasExpanded?`<div class="sl-ga-areas-list">${s.map(r=>`<button type="button" class="sl-ga-area-open" data-ga-open="${z(r.id)}"${r.available<=0?" disabled":""}><span class="name">${z(r.displayLabel??r.label)}<small>${z(r.displayType??n.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${z(n.money(n.paidPrice(r.categoryKey,null,r.price,r.id)))} \xB7 ${z(r.available>0?Ge("picker.leftCount",r.available):n.tf("picker.soldOutTitle","Sold out"))}</span></button>`).join("")}</div>`:"")+"</div>"),i.join("")}function Yo(n,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(i=>{i.addEventListener("click",()=>{let o=i.closest(".sl-ga");if(!o?.dataset.ga)return;let s=t.find(c=>c.id===o.dataset.ga);if(!s)return;let r=o.dataset.gaRowTier?o.dataset.gaRowTier:null,a=Number(i.dataset.d),l=n.gaQty.get(s.id)?.get(r)??0;if(a>0&&Uo(n,s)-ht(n.gaQty,s.id)<=0){n.toast(Ee("picker.maxTicketsForOrder",{count:n.maxTickets}),"warning");return}Ot(n.gaQty,s.id,r,Math.max(0,l+a)),n.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{n.gaAreasExpanded=!n.gaAreasExpanded,n.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(i=>{i.addEventListener("click",()=>{let o=t.find(s=>s.id===i.dataset.gaOpen);o&&an(n,o,null,i)})})}var pi='<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 Wl=/^[a-zA-Z0-9._-]+$/;function cn(n){let e;try{e=new URL(n,"https://seatlayer.invalid")}catch{return null}if(e.search||e.hash)return null;let t=/^\/pub\/events\/([^/]+)\/assets\/([^/]+)$/.exec(e.pathname);if(!t)return null;try{let i=decodeURIComponent(t[1]),o=decodeURIComponent(t[2]);return!i||!Wl.test(o)?null:{eventKey:i,asset:o}}catch{return null}}function Yl(n){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(n,"https://seatlayer.invalid").pathname)}catch{return!1}}var ut=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=cn(e);if(!t)return Promise.resolve(Yl(e)||!st(e)?null:e);if(t.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);let i=this.pending.get(e);if(i)return i;let o=this.load(this.eventKey,t.asset).then(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()}}};import{t as ft}from"@seatlayer/core";import{isAuthoredSeatView as tc,seatViewDisclosure as ic}from"@seatlayer/core/view3d/crossfade/panorama";var Xo=`
145
+ `+Gl;function di(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function an(n,e){if(!e){n.style.removeProperty("--sl-mo-ox"),n.style.removeProperty("--sl-mo-oy");return}pi(n,e,n.getBoundingClientRect())}function pi(n,e,t){let i=t.width||1,o=t.height||1,s=r=>Math.max(0,Math.min(100,r));n.style.setProperty("--sl-mo-ox",`${s((e.x-t.left)/i*100).toFixed(1)}%`),n.style.setProperty("--sl-mo-oy",`${s((e.y-t.top)/o*100).toFixed(1)}%`)}function Bo(n,e,t){let i=n.getBoundingClientRect(),o=t.getBoundingClientRect();pi(n,e,{left:i.left-o.left,top:i.top-o.top,width:i.width,height:i.height})}function Fo(n,e){n.classList.remove("sl-mo-out"),e!==void 0&&an(n,e),n.classList.remove("sl-mo-in"),n.offsetWidth,n.classList.add("sl-mo-in")}function Vo(n){n.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(n.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function hi(n,e,t={className:"sl-mo-out",duration:W.exit}){let i=()=>{o||(o=!0,!(typeof window>"u")&&(clearTimeout(s),n.removeEventListener("animationend",i),e?e():n.remove()))},o=!1;n.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),n.classList.add(t.className),n.addEventListener("animationend",i);let s=setTimeout(i,di()?0:t.duration+60)}var Uh={className:"sl-mo-slide-down",duration:W.exit};function zo(n){if(di())return n.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=n.label??"",e.style.left=`${n.from.x}px`,e.style.top=`${n.from.y}px`,e.style.background=n.color??"var(--sl-accent,#6e7bff)",e.style.color=n.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(n.to.x-n.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(n.to.y-n.from.y)}px`),document.body.appendChild(e);let t=!1,i=()=>{t||(t=!0,window.clearTimeout(o),e.remove(),n.onArrive?.())};e.addEventListener("animationend",i);let o=window.setTimeout(i,W.flight+80);return e}var z=n=>String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]);function mt(n,e){let t=0;for(let i of n.get(e)?.values()??[])t+=i;return t}function $o(n){let e=[];for(let[t,i]of n)for(let[o,s]of i)s>0&&e.push({areaId:t,tierId:o,qty:s});return e}function jo(n){let e=new Map;for(let t of n.keys())e.set(t,mt(n,t));return e}function Nt(n,e,t,i){let o=n.get(e)??new Map;i>0?o.set(t,i):o.delete(t),o.size?n.set(e,o):n.delete(e)}function Go(n){let e=new Map;for(let t of n)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function _e(n,e){let t=Go(e),i=0;for(let o of n.keys())i+=Math.max(0,mt(n,o)-(t.get(o)??0));return i}function Uo(n,e,t){let i=Go(t),o=0;for(let s of e){let r=n.gaQty.get(s.id);if(!r)continue;let a=i.get(s.id)??0;for(let[l,c]of r){let d=Math.max(0,c-a);a=Math.max(0,a-c),o+=d*n.paidPrice(s.categoryKey,l,Ul(s,l),s.id)}}return o}function Ul(n,e){return e?n.tiers?.find(t=>t.id===e)?.price??n.price:n.price}function qo(n){let e=[],t=new Map;for(let i of n){if(i.objectType!=="ga"||!i.objectId){e.push({...i,labels:[i.label]});continue}let o=`${i.objectId}\0${i.tierId??""}`,s=t.get(o);if(s){s.quantity=(s.quantity??0)+(i.quantity??1),s.labels.push(i.label);continue}let r={...i,quantity:i.quantity??1,labels:[i.label]};t.set(o,r),e.push(r)}return e}function Ko(n,e,t){let i=new Set(t);for(let o of e)o.objectType==="ga"&&o.objectId&&i.has(o.label)&&Nt(n,o.objectId,o.tierId??null,0)}function cn(n,e){if(n.objectType!=="ga")return n.label;let t=e.find(i=>i.id===n.objectId);return t?.displayLabel??t?.label??n.label}function ql(n){let e=new Map;for(let t of n){if(t.objectType!=="ga"||!t.objectId)continue;let i=`${t.objectId}\0${t.tierId??""}`;e.set(i,(e.get(i)??0)+(t.quantity??1))}return e}function ui(n){let e=n.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:n.displayType??Ce("picker.generalAdmission"),price:n.price}]}function Wo(n,e){let t=n.totalTicketCount()-mt(n.gaQty,e.id);return Math.max(0,Math.min(e.available,n.maxTickets-t))}function dn(n,e,t,i){if(ye(n,!1),n.salesClosed){n.toast(n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let o=ui(e),s=n.gaQty.get(e.id),r=mt(n.gaQty,e.id)>0,a=Wo(n,e);if(a<=0&&!r){n.toast(e.available>0?Ce("picker.maxTicketsForOrder",{count:n.maxTickets}):n.tf("picker.soldOutTitle","Sold out"),"warning");return}if(n.onGAPromptHook){let u={};for(let[y,f]of s??[])u[y??""]=f;if(n.onGAPromptHook({area:e,selected:u,min:0,max:a,tiers:o,confirm:y=>{Xl(n,e,o,y,a)},cancel:()=>ye(n)})===!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},d=n.root?.dataset.layout==="narrow",p=document.createElement("div");p.className=d?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",p.innerHTML=Kl(n,c,d),n.root?.appendChild(p),n.gaPromptEl=p,n.gaPromptReturnFocus=i??document.activeElement,d||Zl(n,p,t),n.reducedMotion()&&(p.dataset.motion="reduced"),Xo(n,c),Wl(n,p,c),requestAnimationFrame(()=>p.querySelector('[data-ga-step="1"]')?.focus())}function Kl(n,e,t){let{area:i,tiers:o}=e,s=o.length>1,r=i.displayLabel??i.label,a=o.map(l=>`<div class="sl-ga-prompt-row" data-ga-tier="${z(l.id??"")}"><div class="sl-ga-prompt-label"><span>${z(s?l.label:n.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(s?`<small>${z(n.money(n.paidPrice(i.categoryKey,l.id,l.price,i.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${z(s?l.label:r)}"><button type="button" data-ga-step="-1" aria-label="${z(n.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${z(n.tf("picker.more","More"))}">+</button></div></div>`).join("");return`<section class="${t?"sl-ga-sheet":"sl-ga-pop"}" role="dialog" aria-modal="true" aria-label="${z(Ce("picker.gaChooseForArea",{area:r}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${z(i.displayType??n.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${z(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="${z(Ce("common.close"))}">\xD7</button></div><div class="sl-ga-prompt-body">${a}`+(o.length>1?`<div class="sl-ga-prompt-total"><span>${z(n.tf("picker.total","Total"))}</span><b data-ga-total></b></div>`:"")+'<p class="sl-ga-prompt-hint" data-ga-hint></p></div><div class="sl-ga-prompt-actions">'+(e.reopened?`<button type="button" class="sl-ga-prompt-remove" data-ga-remove>${z(n.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${z(Ce("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function pn(n){let e=0;for(let t of n.draft.values())e+=t;return e}function Yo(n,e){let t=0;for(let i of e.tiers)t+=(e.draft.get(i.id)??0)*n.paidPrice(e.area.categoryKey,i.id,i.price,e.area.id);return t}function Xo(n,e){let t=n.gaPromptEl;if(!t)return;let i=pn(e),o=Yo(n,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let d=c.dataset.gaTier?c.dataset.gaTier:null,p=e.draft.get(d)??0,u=c.querySelector("[data-ga-qty]");u&&(u.value=String(p)),c.querySelectorAll("[data-ga-step]").forEach(h=>{h.disabled=Number(h.dataset.gaStep)<0?p<=0:i>=e.max})});let s=t.querySelector("[data-ga-sub]");s&&(s.textContent=`${n.money(n.paidPrice(e.area.categoryKey,e.tiers[0].id,e.tiers[0].price,e.area.id))} \xB7 ${qe("picker.leftCount",e.area.available)}`);let r=t.querySelector("[data-ga-total]");r&&(r.textContent=n.money(o));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=i>=e.max&&e.max>0?e.area.available<=e.max?qe("picker.leftCount",e.area.available):Ce("picker.maxTicketsForOrder",{count:n.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");l&&(l.textContent=e.reopened?qe("picker.gaUpdate",i,{count:i}):qe("picker.gaAdd",i,{count:i,price:n.money(o)}),l.disabled=i<=0&&!e.reopened)}function Wl(n,e,t){e.querySelectorAll("[data-ga-step]").forEach(i=>{i.addEventListener("click",()=>{let o=i.closest("[data-ga-tier]");if(!o)return;let s=o.dataset.gaTier?o.dataset.gaTier:null,r=Number(i.dataset.gaStep),a=t.draft.get(s)??0,l=t.max-pn(t);t.draft.set(s,Math.max(0,a+(r>0?Math.min(1,l):-1))),Xo(n,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(i=>i.addEventListener("click",()=>ye(n))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{n.gaQty.delete(t.area.id),ye(n),n.syncTray(),ln(n,Ce("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{Yl(n,t)}),e.addEventListener("mousedown",i=>{i.target===e&&ye(n)}),e.addEventListener("keydown",i=>{if(i.key==="Escape"){i.stopPropagation(),ye(n);return}if(i.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];i.shiftKey&&document.activeElement===s?(i.preventDefault(),r.focus()):!i.shiftKey&&document.activeElement===r&&(i.preventDefault(),s.focus())})}function Yl(n,e){let t=pn(e),i=Yo(n,e);for(let s of e.tiers)Nt(n.gaQty,e.area.id,s.id,e.draft.get(s.id)??0);ye(n),n.syncTray();let o=e.area.displayLabel??e.area.label;t>0?ln(n,qe("picker.gaAdded",t,{count:t,area:o,price:n.money(i)})):ln(n,Ce("picker.gaRemoved",{area:o}))}function Xl(n,e,t,i,o){if(typeof i=="number")Nt(n.gaQty,e.id,t[0].id,Math.max(0,Math.min(o,Math.floor(i))));else{n.gaQty.delete(e.id);let s=o;for(let r of t){let a=Math.max(0,Math.floor(i[r.id??""]??0)),l=Math.min(a,s);s-=l,Nt(n.gaQty,e.id,r.id,l)}}n.syncTray()}function ye(n,e=!0){let t=n.gaPromptReturnFocus;n.gaPromptEl&&hi(n.gaPromptEl),n.gaPromptEl=null,n.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:n.root)?.focus())}function Zl(n,e,t){let i=n.root,o=e.querySelector(".sl-ga-pop");if(!i||!o||!t)return;let s=i.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,d=Math.max(8,Math.min(s.width-l-8,r-l/2)),p=a-c-14,u=p>=8?p:Math.min(s.height-c-8,a+14);o.style.left=`${d}px`,o.style.top=`${Math.max(8,u)}px`,o.dataset.side=p>=8?"above":"below",o.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(l-12,r-d))}px`)})}function ln(n,e){n.srEl&&(n.srEl.textContent=e)}function Zo(n,e,t=[]){let i=[],o=ql(t);for(let r of e){let a=n.gaQty.get(r.id);if(!a)continue;let l=ui(r);for(let c of l){let d=(a.get(c.id)??0)-(o.get(`${r.id}\0${c.id??""}`)??0);if(d<=0)continue;let p=n.paidPrice(r.categoryKey,c.id,c.price,r.id);i.push(`<div class="sl-ga" data-ga="${z(r.id)}" data-ga-row-tier="${z(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${z(r.displayLabel??r.label)}</div><div class="sl-ga-sub">${z(l.length>1?c.label:r.displayType??n.tf("picker.generalAdmission","General admission"))} \xB7 ${z(n.money(p))} \xB7 ${z(qe("picker.leftCount",r.available))}</div></div><div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${z(n.tf("picker.fewer","Fewer"))}">\u2212</button><span>${d}</span><button type="button" data-d="1" aria-label="${z(n.tf("picker.more","More"))}">+</button></div></div>`)}}let s=e.filter(r=>mt(n.gaQty,r.id)<=0&&!t.some(a=>a.objectId===r.id));return s.length&&i.push(`<div class="sl-ga-areas" data-ga-areas><button type="button" class="sl-ga-areas-toggle" data-ga-areas-toggle aria-expanded="${n.gaAreasExpanded}"><span>${z(n.tf("picker.gaAreasHeading","Areas"))}</span><small>${s.length}</small></button>`+(n.gaAreasExpanded?`<div class="sl-ga-areas-list">${s.map(r=>`<button type="button" class="sl-ga-area-open" data-ga-open="${z(r.id)}"${r.available<=0?" disabled":""}><span class="name">${z(r.displayLabel??r.label)}<small>${z(r.displayType??n.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${z(n.money(n.paidPrice(r.categoryKey,null,r.price,r.id)))} \xB7 ${z(r.available>0?qe("picker.leftCount",r.available):n.tf("picker.soldOutTitle","Sold out"))}</span></button>`).join("")}</div>`:"")+"</div>"),i.join("")}function Qo(n,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(i=>{i.addEventListener("click",()=>{let o=i.closest(".sl-ga");if(!o?.dataset.ga)return;let s=t.find(c=>c.id===o.dataset.ga);if(!s)return;let r=o.dataset.gaRowTier?o.dataset.gaRowTier:null,a=Number(i.dataset.d),l=n.gaQty.get(s.id)?.get(r)??0;if(a>0&&Wo(n,s)-mt(n.gaQty,s.id)<=0){n.toast(Ce("picker.maxTicketsForOrder",{count:n.maxTickets}),"warning");return}Nt(n.gaQty,s.id,r,Math.max(0,l+a)),n.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{n.gaAreasExpanded=!n.gaAreasExpanded,n.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(i=>{i.addEventListener("click",()=>{let o=t.find(s=>s.id===i.dataset.gaOpen);o&&dn(n,o,null,i)})})}var mi='<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 Ql=/^[a-zA-Z0-9._-]+$/;function hn(n){let e;try{e=new URL(n,"https://seatlayer.invalid")}catch{return null}if(e.search||e.hash)return null;let t=/^\/pub\/events\/([^/]+)\/assets\/([^/]+)$/.exec(e.pathname);if(!t)return null;try{let i=decodeURIComponent(t[1]),o=decodeURIComponent(t[2]);return!i||!Ql.test(o)?null:{eventKey:i,asset:o}}catch{return null}}function Jl(n){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(n,"https://seatlayer.invalid").pathname)}catch{return!1}}var ft=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=hn(e);if(!t)return Promise.resolve(Jl(e)||!at(e)?null:e);if(t.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);let i=this.pending.get(e);if(i)return i;let o=this.load(this.eventKey,t.asset).then(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()}}};import{t as bt}from"@seatlayer/core";import{isAuthoredSeatView as sc,seatViewDisclosure as rc}from"@seatlayer/core/view3d/crossfade/panorama";var Jo=`
146
146
  /* confirm card: a candidate is not in the tray until Select. Map gestures and
147
147
  floating chrome pause while the card owns focus, keeping the camera stable. */
148
148
  .sl-picker[data-confirming="true"] .sl-map-host>:not(.sl-confirm){pointer-events:none}
@@ -525,7 +525,7 @@ import{a as io,b as no,d as Kt,e as nt,f as Wt,g as ot}from"./chunk-RZ2VKZ44.js"
525
525
  color:var(--sl-text);font-weight:700;font-size:12px;display:flex;align-items:center;justify-content:center;gap:7px}
526
526
  .sl-confirm-view:hover{border-color:var(--sl-muted)}
527
527
  .sl-confirm-view svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
528
- `;var Zo=`
528
+ `;var es=`
529
529
  /* Test mode is environment context, not an action. The chip flows in the
530
530
  top-left anchor region: the old rotated corner ribbon sat at a negative
531
531
  offset and was clipped by the widget root's rounded overflow:hidden (its
@@ -786,7 +786,7 @@ import{a as io,b as no,d as Kt,e as nt,f as Wt,g as ot}from"./chunk-RZ2VKZ44.js"
786
786
  .sl-pg-switch:hover{border-style:solid;color:var(--sl-text);border-color:var(--sl-accent)}
787
787
  @media(prefers-reduced-motion:reduce){.sl-tip{animation:none!important}.sl-tip,.sl-tip-switch,.sl-pg-switch{transition:none!important}}
788
788
  @media(max-width:639px){.sl-confirm-group-dates{width:min(340px,calc(100% - 20px))}.sl-confirm-date{min-height:32px}}
789
- `;var Qo=`
789
+ `;var ts=`
790
790
  /* 3D venue overlay \u2014 mounts over the (paused) Konva stage inside the map host.
791
791
  Carries its own gradient so it paints instantly before the scene builds, and
792
792
  cross-fades on enter/exit via a compositor-only opacity transition. Sits below
@@ -1167,7 +1167,7 @@ import{a as io,b as no,d as Kt,e as nt,f as Wt,g as ot}from"./chunk-RZ2VKZ44.js"
1167
1167
  .sl-view3d-passport-shell{padding:max(10px,env(safe-area-inset-top)) 10px max(10px,env(safe-area-inset-bottom))}
1168
1168
  .sl-view3d-passport{width:100%;max-height:100%;padding:14px 14px max(24px,calc(14px + env(safe-area-inset-bottom)));border-radius:15px}
1169
1169
  }
1170
- `;var Jo=`
1170
+ `;var is=`
1171
1171
  .sl-notes{display:flex;flex-direction:column;gap:0;margin:0}
1172
1172
  /* No radius, no border, no inset: a band is the card's full width or it is a
1173
1173
  plate again. The hairline lives on the JOIN, so the first band sits flush
@@ -1202,7 +1202,7 @@ import{a as io,b as no,d as Kt,e as nt,f as Wt,g as ot}from"./chunk-RZ2VKZ44.js"
1202
1202
  .sl-notes.compact .sl-note{padding:7px 12px 7px 15px}
1203
1203
  .sl-notes.compact .sl-note-t b{font-size:11.5px;font-weight:750}
1204
1204
  .sl-notes.compact .sl-note-n{font-size:10.5px}
1205
- `;var es=`
1205
+ `;var ns=`
1206
1206
  /* The head is a bare 19.5px strip: the pill's upper half and nothing else. It
1207
1207
  used to reserve 26px (6px of ground above a 20px pill) and the sheet drew a
1208
1208
  border above that, so the chrome between the map and the cart was 33px of
@@ -1321,7 +1321,7 @@ import{a as io,b as no,d as Kt,e as nt,f as Wt,g as ot}from"./chunk-RZ2VKZ44.js"
1321
1321
  above the line. The map now reaches the line, so the column keeps the same
1322
1322
  clearance from the pill's top rather than dropping onto the hairline. */
1323
1323
  .sl-picker[data-layout="narrow"] .sl-anchor[data-region="bottom-right"]{bottom:32px}
1324
- `;var ts=`
1324
+ `;var os=`
1325
1325
  /* THE PHONE SHOWS THE DESKTOP CARD (owner call 2026-09-06: "cards should be
1326
1326
  the same design as desktop"). What used to be here was a second rendering of
1327
1327
  the cart \u2014 a bordered .sl-tlist box of 44px hairline-divided .sl-tline rows,
@@ -1529,7 +1529,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
1529
1529
  .sl-picker .sl-fitpill.sl-fit-p2,.sl-picker .sl-fitpill.sl-fit-p3{font-size:11.5px}
1530
1530
  .sl-picker .sl-fitpill.sl-fit-p3{white-space:normal;text-align:center;
1531
1531
  padding-top:6px;padding-bottom:6px;line-height:1.2}
1532
- `;var is="seatlayer-picker-style",Xl=`
1532
+ `;var ss="seatlayer-picker-style",ec=`
1533
1533
  .sl-picker{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:420px;overflow:hidden;
1534
1534
  background:var(--sl-bg);color:var(--sl-text);font-family:var(--sl-font);border-radius:var(--sl-radius);
1535
1535
  /* iOS INFLATES FIXED-PX TYPE IN A HOST LAYOUT IT DECIDES IS TOO NARROW, and
@@ -2674,6 +2674,19 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
2674
2674
  .sl-boot-retry{margin-top:4px;padding:9px 20px;border-radius:var(--sl-r-sm);background:var(--sl-accent);
2675
2675
  color:var(--sl-accent-ink);font-weight:700;font-size:13px}
2676
2676
 
2677
+ /* Shared loading/recovery card: readable at narrow widths and keyboard reachable. */
2678
+ .sl-loading-state{display:flex;flex-direction:column;align-items:center;gap:20px;
2679
+ width:min(100%,360px);padding:24px;box-sizing:border-box;text-align:center;overflow-wrap:anywhere}
2680
+ .sl-loading-state .sl-boot-title{font-size:20px;line-height:1.4;font-weight:700}
2681
+ .sl-picker[data-layout="narrow"] .sl-loading-state .sl-boot-title{font-size:18px}
2682
+ .sl-loading-description{margin:8px 0 0;color:var(--sl-muted);font-size:14px;line-height:1.55;font-weight:400}
2683
+ .sl-loading-state .sl-boot-retry{min-height:44px;min-width:128px;margin:0;padding:12px 24px;cursor:pointer}
2684
+ .sl-boot-retry:focus-visible{outline:2px solid var(--sl-text);outline-offset:4px}
2685
+ .sl-side[inert],.sl-rail[inert]{opacity:.5}
2686
+ .sl-boot-say.is-visible{position:absolute;inset:auto 24px 24px;width:auto;height:auto;margin:0;
2687
+ clip:auto;clip-path:none;white-space:normal;text-align:center;color:var(--sl-muted);font-size:14px;line-height:1.5}
2688
+ @media(prefers-reduced-motion:reduce){.sl-loading-state .sl-boot-spin{animation:none}}
2689
+
2677
2690
  /* sales-closed pill (header) \u2014 persistent read-only state when the event's sales
2678
2691
  window is closed at load or closes live mid-session. Neutral (not accent) so it
2679
2692
  reads as "unavailable", distinct from the accent hold pill next to it. */
@@ -3175,7 +3188,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3175
3188
  corners, and it is the frame. */
3176
3189
  .sl-modal-frame > .sl-picker{border-radius:0}
3177
3190
  @media(max-width:640px){.sl-modal-scrim{padding:0}.sl-modal-frame{width:100%;height:100%;border-radius:0}}
3178
- `;function mt(){if(document.getElementById(is))return;let n=document.createElement("style");n.id=is,n.textContent=Xl+es+Jo+Xo+ts+Qo+Zo+Oo,document.head.appendChild(n)}async function hi(n,e){let t=n.overlay.productionElements;if(!t?.some(o=>o.contentImageUrl))return n;let i=await Promise.all(t.map(async o=>{if(!o.contentImageUrl)return o;try{let 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{...n,overlay:{...n.overlay,productionElements:i}}}async function ui(n,e){if(n)try{let t=await e(n);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}import{browserPanoramaConstraints as Zl,loadPanoramaImage as Ql,planPanoramaDelivery as Jl,schedulePanoramaUpgrade as ec}from"@seatlayer/core/view/panoramaDelivery";function mi(n){let{root:e,source:t,caption:i,real:o,closeLabel:s,dragHint:r,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:h,onClose:d}=n,m=n.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=F=>p.querySelector(F)?.remove();m.title===!1?f(".sl-view-title"):p.querySelector(".sl-view-title").textContent=a,m.caption===!1?f(".sl-view-cap"):p.querySelector(".sl-view-cap").textContent=i,p.querySelector(".sl-view-x").setAttribute("aria-label",s),m.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 y=p.querySelector(".sl-view-pano"),T=Jl(t,Zl()),S=new AbortController;y.style.backgroundImage=`url(${JSON.stringify(T.initialUrl)})`;let v=()=>{};T.upgradeUrl&&(v=ec(()=>{h(T.upgradeUrl).then(F=>!F||S.signal.aborted?null:Ql(F,S.signal).then(()=>F)).then(F=>{!F||!p.isConnected||S.signal.aborted||(y.style.backgroundImage=`url(${JSON.stringify(F)})`)}).catch(()=>{})}));let A=70,D=35,G=1,g=y.clientHeight||1,L=y.clientWidth||1,N=-(g*(180/A)*2/2-L/2),C=0,R=()=>{let F=y.clientHeight||1,Yi=F*(180/A)*G,eo=Math.max(0,Yi-F),to=Math.min(eo/2,D/180*Yi);C=Math.min(to,Math.max(-to,C)),y.style.backgroundSize=`auto ${Yi}px`,y.style.backgroundPosition=`${N}px ${C-eo/2}px`};R();let P=!1,I=0,$=0,j=F=>{P=!0,I=F.clientX,$=F.clientY,y.classList.add("drag"),y.setPointerCapture?.(F.pointerId)},ue=F=>{P&&(N+=F.clientX-I,C+=F.clientY-$,I=F.clientX,$=F.clientY,R())},be=F=>{P=!1,y.classList.remove("drag"),y.releasePointerCapture?.(F.pointerId)},Q=F=>{F.preventDefault(),G=Math.min(2.4,Math.max(1,G+(F.deltaY<0?.12:-.12))),R()};y.addEventListener("pointerdown",j),y.addEventListener("pointermove",ue),y.addEventListener("pointerup",be),y.addEventListener("pointercancel",be),y.addEventListener("wheel",Q,{passive:!1});let Wi=p.querySelector(".sl-view-x");Wi.addEventListener("click",d);let Jn=F=>{F.key==="Escape"&&(F.stopPropagation(),d())};return p.addEventListener("keydown",Jn),Wi.focus(),{element:p,dispose(){v(),S.abort(),y.removeEventListener("pointerdown",j),y.removeEventListener("pointermove",ue),y.removeEventListener("pointerup",be),y.removeEventListener("pointercancel",be),y.removeEventListener("wheel",Q),p.removeEventListener("keydown",Jn),Wi.removeEventListener("click",d)}}}function nc(n,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=n.find(s=>s.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let i=n.filter(s=>s.rowId===t.rowId),o=i.findIndex(s=>s.id===e);return{targetSeatId:e,previousSeatId:o>0?i[o-1].id:null,nextSeatId:o>=0&&o+1<i.length?i[o+1].id:null}}var ns=6e4,fi=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 nc(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!Zt()?!1:this.options.seats().length<=this.max3DSeats():!1}canOfferSeatView(){return this.options.enableSeatView?this.options.seats().some(e=>!!e.viewUrl)?!0:this.hasStage():!1}async setBuyerView(e,t={}){if(e==="map"){this.exit3D();return}if(!this.canOffer3D())throw new Error("venue_3d_unavailable");if(this.buyerView_==="venue3d"&&this.handle){t.flyToSeatId?(this.targetSeatId_=t.flyToSeatId,this.focusedSectionId_=this.findSeat(t.flyToSeatId)?.sectionId??null,this.options.onViewChange(this.buyerView_,this.targetSeatId_),await this.handle.flyToSeat(t.flyToSeatId)):t.resetView&&this.handle.focusOverview();return}if(this.handle&&this.overlay){await this.restore3D(t);return}await this.enter3D(t.flyToSeatId)}async openSeatView(e){if(!this.canOfferSeatView())throw new Error("seat_view_unavailable");let t=this.findSeat(e),i=this.options.host(),o=this.options.doc();if(!t||!i||!o)throw new Error("seat_view_unavailable");let s=++this.seatViewGeneration,r,a,l=!1;if(t.viewUrl){let f=t.viewMeta?.previewUrl,y=!!f&&f!==t.viewUrl,T=y?await this.options.resolveAsset(f):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=ic(r),l=tc(r)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:f}=await Jt();if(s!==this.seatViewGeneration)return;let y=o.floors?.find(v=>v.objects.some(A=>A.type==="row"&&A.id===t.rowId)),T=t.focalPoint??y?.focalPoint??o.focalPoint,S=f(t,T,[...this.options.seats()]);r={url:S.url,generated:!0},a=ft("picker.illustrationCaption",{m:S.distanceM})}if(s!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(i,o),mt();let c=this.options.chrome??{},h=Ve(),d=ft("picker.viewFromSeat",{label:t.displayLabel||t.label}),m=l?ft("picker.real360"):ft("picker.preview"),p=mi({root:i,source:r,caption:a,real:l,closeLabel:b("picker.close","Close"),dragHint:h,viewFromSeatLabel:d,real360Label:ft("picker.real360"),previewLabel:ft("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:m,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 i=t.floors.findIndex(o=>o.id===e);return i>=0&&this.handle.focusFloor(i)}zoomIn(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomIn(),!0)}zoomOut(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomOut(),!0)}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)?ns/2:ns}async enter3D(e){let t=this.options.host(),i=this.options.doc();if(!t||!i||this.overlay)throw new Error("venue_3d_unavailable");mt(),this.prepareHostTheme(t,i);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([Pt(),this.options.loadEventConfiguration()]),c=l?await hi(l,this.options.resolveAsset):null,h=await ui(i.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(r!==this.generation||this.overlay!==o)return;let d={doc:i,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...h?{registeredShellGlb:h}:{}};s.textContent=b("picker.building3d","Building venue geometry\u2026");let m=await a.prepareVenue3D(d);if(r!==this.generation||this.overlay!==o)return;let p=this.options.chrome??{},f=a.mountVenue3D(o,{...d,prepared:m},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:Ve(),navLabels:Xt(),...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){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 i=this.handle,o=this.overlay;if(this.options.restoreMap(),t&&i&&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{i?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{i?.dispose()}catch{}o.remove(),this.options.restoreMap();return}o.style.pointerEvents="none",requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(()=>{try{i?.dispose()}catch{}o.remove(),this.options.restoreMap()},280)}async restore3D(e){let t=this.overlay,i=this.handle;if(!t||!i)throw new Error("venue_3d_unavailable");this.buyerView_="venue3d",this.targetSeatId_=e.flyToSeatId??null,this.focusedSectionId_=e.flyToSeatId?this.findSeat(e.flyToSeatId)?.sectionId??null:null,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),i.resize(),i.setNavigationMode(this.navigationMode_),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e.flyToSeatId?await i.flyToSeat(e.flyToSeatId):e.resetView&&i.focusOverview()}nextPaint(){return this.reducedMotion()||typeof requestAnimationFrame!="function"?Promise.resolve():new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}toggleSeat(e){if(!this.findSeat(e))return;this.options.selection().some(o=>o.id===e)?this.options.deselect(e):this.options.status(e)==="free"&&this.options.select(e),this.pushLiveState()}seatState(e){switch(this.options.status(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:return"available"}}async seatViewFor3D(e){let t=this.findSeat(e);if(!t)throw new Error("seat_view_unavailable");if(t.viewUrl){let i=t.viewMeta?.previewUrl,o=!!i&&i!==t.viewUrl,s=o?await this.options.resolveAsset(i):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 i=this.seatViewElement;if(this.seatViewDispose?.(),this.seatViewDispose=null,this.seatViewElement=null,!!i){if(this.options.onSeatViewChange?.(null),!t||this.reducedMotion()){i.remove();return}i.classList.add("is-leaving"),setTimeout(()=>i.remove(),190)}}findSeat(e){return this.options.seats().find(t=>t.id===e||t.label===e)}hasStage(){let e=this.options.doc();return e?(e.floors?.flatMap(i=>i.objects)??e.objects).some(i=>i.type==="shape"&&(i.role==="stage"||!!i.stageKind)):!1}prepareHostTheme(e,t){getComputedStyle(e).position==="static"&&(e.style.position="relative");let i=t.theme;e.style.setProperty("--sl-bg",i?.background??"#f6f7fb"),e.style.setProperty("--sl-surface","#ffffff"),e.style.setProperty("--sl-text",i?.textColor??"#10162a"),e.style.setProperty("--sl-muted","#697386"),e.style.setProperty("--sl-line","#d9deea"),e.style.setProperty("--sl-accent",i?.accent??"#ef4056"),e.style.setProperty("--sl-accent-ink",i?.accentInk??"#ffffff")}reducedMotion(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1}};var oc={host:"web",platform:"web",bundle:"",protocol:0,chromeOwner:"web"},sc={...oc},gi=null,os=null;function rc(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function ac(){let n=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:n(rc()),documentMs:gi==null?0:n(gi),handshakeMs:gi==null||os==null?0:n(os-gi)}}function ss(){let{host:n,platform:e,bundle:t,protocol:i,chromeOwner:o}=sc,s=ac();return{host:n,platform:e,...t?{bundle:t}:{},...i?{protocol:i}:{},chromeOwner:o,bootMs:s.bootMs,documentMs:s.documentMs,handshakeMs:s.handshakeMs}}var rs=new Set;function Oe(n){return rs.has(n)?"repeat":"cold"}function bi(n){let e=Oe(n);return rs.add(n),e}function le(n){return typeof n=="number"&&Number.isFinite(n)&&n>=0?Math.round(n):0}function lc(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function cc(n){if(!/^[A-Za-z0-9_-]{1,80}$/.test(n.event))return null;let e=n.performanceProfile??{};return{event:n.event,scope:n.scope,surface:n.surface,outcome:n.outcome,stage:n.stage?.slice(0,32)??"",ms:le(n.ms),api:le(e.loadChartAndStatuses)||le(e.loadChart),scene:le(e.buildScene),panel:le(e.buildBuyerControls),paint:le(e.firstPaint),normalize:le(e.normalizeBuyerModel),renderer:le(e.createRenderer),seats:le(n.seats),floors:le(n.floors),view:n.view??"map",load:n.load??Oe(n.event),transport:n.transport??"pubapi",chartBytes:le(n.chartDelivery?.bytes),chartCache:n.chartDelivery?.cache??"",...ss(),availabilityMs:le(e.loadStatuses)}}var dc=new Set;function Ce(n){let e=cc(n);if(e){for(let t of dc)try{t(e)}catch{}typeof fetch>"u"||lc()||fetch(`${n.apiBase.replace(/\/+$/,"")}/pub/telemetry/chart-load`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify(e),credentials:"omit",keepalive:!0}).catch(()=>{})}}function yi(n){if(!n)return null;let e=n.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function pc(n){return yi(n.foot?.querySelector(".sl-total"))??yi(n.tray)??yi(n.sheetHead)}function pn(n,e,t,i,o){let s=n,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=i?.find(m=>m.key===t.categoryKey)?.color,d=()=>{let m=pc(s);if(!m){o?.();return}Bo({from:l,to:{x:m.left+m.width/2,y:m.top+m.height/2},label:c,color:h,onArrive:o})};s.sheetHead&&yi(s.sheetHead)?requestAnimationFrame(d):d()}var dn=60,hc=650;function as(n,e){if(!e.length||n.focusSeats?.(e.map(o=>o.id)))return;let t=e.find(o=>o.sectionId)?.sectionId;if(!t)return;let i=e.filter(o=>o.sectionId===t);n.focus(t,{x:i.reduce((o,s)=>o+s.x,0)/i.length,y:i.reduce((o,s)=>o+s.y,0)/i.length})}function ls(n,e){let t=!ai();as({focusSeats:i=>n.focusSeats?.(i,{animate:t})===!0,focus:(i,o)=>n.focusSection(i,o)},(e?.items??[]).filter(i=>i.objectType!=="ga").slice(0,10).map(i=>n.seatByLabel(i.label)).filter(i=>!!i))}function cs(n,e){if(!e.length)return;let t=n.reducedMotion===!0;t||e.forEach((r,a)=>{n.schedule(()=>n.pop(r.id),a*dn)});let i=t?0:e.length*dn,o=e.find(r=>r.sectionId)?.sectionId;if(n.schedule(()=>as(n,e),i),t)return;let s=i+(n.focusSeats||o?hc:0);e.forEach((r,a)=>{n.schedule(()=>pn(n.regions,n.screenPoint(r),r,n.categories),s+a*dn)})}function uc(n,e,t){for(let i of n)if(e>=i.x&&t>=i.y&&e<=i.x+i.w&&t<=i.y+i.h)return!0;return!1}var vi=class{constructor(){this.rects=[];this.host=null;this.pointers=new Set;this.touches=new Set;this.mouseDown=!1;this.onPointerDown=e=>{this.inside(e.clientX,e.clientY)&&(this.pointers.add(e.pointerId),this.swallow(e))};this.onPointerFollow=e=>{this.pointers.has(e.pointerId)&&this.swallow(e)};this.onPointerEnd=e=>{this.pointers.delete(e.pointerId)&&this.swallow(e)};this.onTouchStart=e=>{let t=this.changed(e);if(!t.length)return;let i=!0;for(let o of t)this.inside(o.clientX,o.clientY)?this.touches.add(o.identifier):i=!1;i&&this.swallow(e)};this.onTouchFollow=e=>{let t=this.changed(e);t.length&&t.every(i=>this.touches.has(i.identifier))&&this.swallow(e)};this.onTouchEnd=e=>{let t=this.changed(e);if(!t.length)return;let i=t.every(o=>this.touches.has(o.identifier));for(let o of t)this.touches.delete(o.identifier);i&&this.swallow(e)};this.onMouseDown=e=>{this.inside(e.clientX,e.clientY)&&(this.mouseDown=!0,this.swallow(e))};this.onMouseFollow=e=>{this.mouseDown&&this.swallow(e)};this.onMouseUp=e=>{this.mouseDown&&(this.mouseDown=!1,this.swallow(e))};this.onClick=e=>{this.inside(e.clientX,e.clientY)&&this.swallow(e)}}set(e){this.rects=e.map(t=>({x:t.x,y:t.y,w:t.w,h:t.h})),this.rects.length||(this.pointers.clear(),this.touches.clear(),this.mouseDown=!1)}get(){return this.rects}attach(e){if(this.host===e)return;this.detach(),this.host=e;let t={capture:!0,passive:!1};e.addEventListener("pointerdown",this.onPointerDown,t),e.addEventListener("pointermove",this.onPointerFollow,t),e.addEventListener("pointerup",this.onPointerEnd,t),e.addEventListener("pointercancel",this.onPointerEnd,t),e.addEventListener("touchstart",this.onTouchStart,t),e.addEventListener("touchmove",this.onTouchFollow,t),e.addEventListener("touchend",this.onTouchEnd,t),e.addEventListener("touchcancel",this.onTouchEnd,t),e.addEventListener("mousedown",this.onMouseDown,t),e.addEventListener("mousemove",this.onMouseFollow,t),e.addEventListener("mouseup",this.onMouseUp,t),e.addEventListener("click",this.onClick,t),e.addEventListener("dblclick",this.onClick,t)}detach(){let e=this.host;if(!e)return;let t={capture:!0};e.removeEventListener("pointerdown",this.onPointerDown,t),e.removeEventListener("pointermove",this.onPointerFollow,t),e.removeEventListener("pointerup",this.onPointerEnd,t),e.removeEventListener("pointercancel",this.onPointerEnd,t),e.removeEventListener("touchstart",this.onTouchStart,t),e.removeEventListener("touchmove",this.onTouchFollow,t),e.removeEventListener("touchend",this.onTouchEnd,t),e.removeEventListener("touchcancel",this.onTouchEnd,t),e.removeEventListener("mousedown",this.onMouseDown,t),e.removeEventListener("mousemove",this.onMouseFollow,t),e.removeEventListener("mouseup",this.onMouseUp,t),e.removeEventListener("click",this.onClick,t),e.removeEventListener("dblclick",this.onClick,t),this.host=null,this.pointers.clear(),this.touches.clear(),this.mouseDown=!1}inside(e,t){if(!this.rects.length||!this.host)return!1;let i=this.host.getBoundingClientRect();return uc(this.rects,e-i.left,t-i.top)}swallow(e){e.stopImmediatePropagation(),e.stopPropagation(),e.cancelable&&e.preventDefault()}changed(e){let t=e.changedTouches;return t?Array.from(t):[]}},ds=.48,mc=8;function fc(n,e,t,i=ds){let o=Math.max(0,t.top),s=e.height-Math.max(0,t.bottom);if(!(s>o))return 0;let r=Number.isFinite(i)?Math.min(1,Math.max(0,i)):ds,a=o+(s-o)*r-n;return Math.abs(a)<=mc?0:Math.round(a)}function ps(n,e,t={}){let i=n.gestureCount();if(t.gestures!==void 0&&t.gestures!==i)return{dy:0,gestures:i};let o=n.seatPoint(e);if(!o)return{dy:0,gestures:i};let s=fc(o.y,{height:n.mapHeight()},n.insets(),t.fraction);return s?{dy:n.panScreenBy({x:0,y:s},t.animate!==!1)?s:0,gestures:i}:{dy:0,gestures:i}}var _t=class n{constructor(e,t=null){this.seams=e;this.watch=null;this.mode=t,this.watchMode()}themeMode(){return this.mode}setThemeMode(e,t){let i=t!==void 0&&"mapTheme"in t;e===this.mode&&!i||(i&&this.seams.setHostMapTheme(t.mapTheme??void 0),this.mode=e,this.watchMode(),this.applyThemeMode())}static groundFor(e){return nt(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??n.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=Wt(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};import{getLocale as yc}from"@seatlayer/core";import{seatConfidenceDisclosure as vc}from"@seatlayer/core/core/seatConfidence";import{generateSeatThumb as gc}from"@seatlayer/core";function gt(n){let e=n.viewMeta?.previewUrl??n.viewUrl;return e&&(cn(e)||st(e))?e:null}function xi(n){if(!n)return!1;let e=n.floors?.length?n.floors.map(t=>t.objects??[]):[n.objects??[]];for(let t of e)for(let i of t)if(i.type==="shape"&&(i.role==="stage"||i.stageKind))return!0;return!1}var bc=512,wi=new Map;function Si(n,e){if(!e)return null;let t=`${n.id}|${Math.round(e.x)},${Math.round(e.y)}`,i=wi.get(t);if(i!==void 0)return i;let o=null;try{o=gc(n,e).distanceM??null}catch{o=null}return wi.size>=bc&&wi.clear(),wi.set(t,o),o}function Nt(n){return n.getFocusedSection()!==null||n.seatsRevealed()}function wc(n){let e=n.atVenueFit?.(),t=n.canZoomIn?.();return{...typeof e=="boolean"?{atVenueFit:e}:{},...typeof t=="boolean"?{canZoomIn:t}:{}}}function xc(n,e){return{accessibilityFilter:n.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function Sc(n,e,t,i){for(let o of e){if(o.count<=0)continue;let s=n.accessibilitySpread?.([o.key]);for(let r of s?.sections??[]){let a=t.get(r.id)??i.get(r.id);if(!a||r.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[o.key]=r.free}}}function hs(n,e,t){let i=n.doc,o=i?.theme??{},s=n.categoryAvailability(),r=n.getGAAreas(),a=n.getFloors(),l=n.getExpandedSeats(),c=n.getAccessNeeds(),h=xc(c,l),d=e.seatPosition,m=d.targetSeatId?n.seatDetails(d.targetSeatId):null,p=new Map(l.map(v=>[v.id,v])),f=xi(i),y=i?.floors?.flatMap(v=>v.objects)??i?.objects??[],T=new Map,S=new Map;for(let v of y){if(v.type!=="section")continue;let A={id:v.id,label:v.label,...v.displayLabel?{displayLabel:v.displayLabel}:{},...v.zone?{zoneId:v.zone}:{}};T.set(v.id,A);let D=v.logicalSectionId??v.id;S.has(D)||S.set(D,A)}return Sc(n,c,T,S),{event:{key:t.event,name:t.eventInfo?.name??i?.name??t.event,venue:t.eventInfo?.venue??null,startsAt:t.eventInfo?.startsAt??null,timezone:t.eventInfo?.timezone??null,currency:t.eventInfo?.currency??t.currency??"USD",locale:yc()||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:!!i?.categories.some(v=>v.tiers?.length),floors:a.length>1,zones:!!i?.zones?.length,sections:T.size>0,bestAvailable:!0,...h,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(i?.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:(i?.zones??[]).map(v=>({id:v.id,label:v.label,...v.color?{color:v.color}:{}})),sections:[...T.values()],gaAreas:r,bestAvailableZones:n.getBestAvailableZones()},map:{floors:a,activeFloorId:n.getActiveFloorId()||a[0]?.id||null,floorMode:n.isFloorOverview()?"all":"single",floorLabelStyle:n.getRenderer()?.getFloorLabelStyle?.()??"number",rung:n.getRung(),canZoomOut:Nt(n)||t.focusedSection_!==null,...wc(n),focusedSectionId:n.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:n.getViewMode(),buyerView:e.buyerView,view3dTargetSeatId:d.targetSeatId,view3dTargetSeat:m,view3dPreviousSeatId:d.previousSeatId,view3dNextSeatId:d.nextSeatId,view3dFocusedSectionId:e.focusedSectionId,view3dNavigationMode:e.navigationMode,colorblindSafe:t.colorblindSafe_,viewportInsets:n.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:c},selection:{seats:n.getSelection().map(v=>{let A=p.get(v.id);if(!A)return v;let D=n.worldToScreen({x:A.x,y:A.y}),G=gt(A),g=f?Si(A,A.focalPoint??i?.focalPoint):null;return{...v,screenPoint:{x:D.x,y:D.y},...G?{seatViewThumb:{reference:G,kind:"real"}}:{},...g!=null?{sightlineMetres:g}:{},...A.confidenceEvidence?{seatViewConfidence:vc(A.confidenceEvidence)}:{}}}),validity:n.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var Mc="https://api.seatlayer.io",us=10;function Hc(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}var un=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??us,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 i={onExpired:a=>{this.accessState_={configured:!0,status:a.refreshed?"ready":"expired"},this.opts.onAccessExpired?.(a),this.notifyMapStateChange()},onUnavailable:a=>{this.accessState_={configured:!0,status:"unavailable",reason:a.reason},this.opts.onAccessUnavailable?.(a),this.notifyMapStateChange()}},o=(e.apiBase??Mc).replace(/\/+$/,"");this.apiBase=o;let s=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?ri({base:o,event:e.event,publicKey:e.publicKey,accessHooks:i,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=s?.access??It(e,i);let r=s?.api??new He(o,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=r,this.controller=new kc({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??us)-this.controller.getSelection().length)),tiers:di(l),confirm:c=>{let h=typeof c=="number"?c:Object.values(c).reduce((d,m)=>d+m,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??_t.groundFor(e.theme?.mode)??null}),this.hostSurface=new _t({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 ut(e.event,(a,l)=>r.asset(a,l)),this.immersive=new fi({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_=Nt(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=Nt(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_=Nt(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=ni(this.opts.locale,this.opts.messages),i=this.localeGeneration+=1,o=hn();this.mount=Hc(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,i)}),this.applyInteractionState();let r=await this.controller.render(s);if(!r)return Ce({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:Oe(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=me("picker.testMode"),a.setAttribute("aria-label",me("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),Ce({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:bi(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",me("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 i=document.createElement("span");i.setAttribute("aria-hidden","true"),i.style.cssText="width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee",i.innerHTML=pi;let o=document.createElement("span");o.textContent=me("picker.poweredBy"),t.append(i,o),e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,o=this.tipPos.x+14,s=this.tipPos.y-i-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=Tc(e.price,e.currency,{...Number.isInteger(e.price)?{minimumFractionDigits:0,maximumFractionDigits:0}:{},locale:this.opts.locale,fallback:(l,c)=>`${l} ${c}`}),i=document.createElement("div");i.style.cssText="font-weight:700;font-size:13px",i.textContent=e.label;let o=document.createElement("div");o.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let 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(i,o),e.status!=="free"){let l=document.createElement("div");l.style.cssText="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700",l.textContent=e.status==="held"?me("map.statusHeld"):me("map.statusTaken"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(o=>Pc(o)).filter((o,s,r)=>r.indexOf(o)===s);if(t.length<2)return;let i=document.createElement("select");i.setAttribute("aria-label",me("picker.preferredTicketType")),i.style.cssText='position:absolute;bottom:10px;left:12px;z-index:5;appearance:none;padding:5px 9px;border-radius:999px;border:0;cursor:pointer;background:rgba(255,255,255,.92);color:#4a5163;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 2px 8px rgba(0,0,0,.12);';for(let o of t){let s=document.createElement("option");s.value=o,s.textContent=Ac[o]??o,s.selected=o===hn(),i.appendChild(s)}i.addEventListener("change",()=>{this.setLocale(i.value)}),e.appendChild(i),this.languageSelect=i}async setLocale(e){let t=hn(),i=this.localeGeneration+=1,o=await Ec(e);return this.opts.messages&&Lc(this.opts.messages),o===t||this.applyActiveLocale(o,i),o}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let i=this.hostEl;if(i){i.lang=e,i.dir=Cc(e);for(let o of i.querySelectorAll("[data-sl-i18n]"))if(o.dataset.slI18n==="testMode")o.textContent=me("picker.testMode"),o.setAttribute("aria-label",me("picker.testMode"));else if(o.dataset.slI18n==="badge"){o.setAttribute("aria-label",me("picker.poweredBy"));let s=o.querySelector("span:last-child");s&&(s.textContent=me("picker.poweredBy"))}this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy()}}getMode(){return this.mode_}getPickerState(){return hs(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 i=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(i?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:i?"selection_count_mismatch":"selection_invalid",selection:t})}this.holdingLabels=new Set(this.controller.getSelection().map(i=>i.label));try{let i=await this.controller.hold(void 0,e.ttlMs);return i?{holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items}:null}finally{this.holdingLabels.clear()}}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}getCurrentHold(){let e=this.controller.currentHold();return e?{holdId:e.holdId,expiresAt:e.expiresAt,seats:e.seats,items:e.items}:null}getGAAreas(){return this.controller.getGAAreas()}async holdGA(e,t,i={}){try{return await this.holdGAOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async holdGAOrThrow(e,t,i={}){let o=await this.controller.holdGA(e,t,i);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}async bestAvailable(e,t,i={}){try{return await this.bestAvailableOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async bestAvailableOrThrow(e,t,i={}){let o=await this.controller.bestAvailable(e,t,i);return ls(this.controller,o),o?{holdId:o.holdId,expiresAt:o.expiresAt,labels:o.labels,seats:o.seats,items:o.items,...i.zoneId?{zoneId:i.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}setTableQuantity(e,t){return this.controller.setTableQuantity(e,t)}async replaceTableQuantity(e,t,i){try{return await this.replaceTableQuantityOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async replaceTableQuantityOrThrow(e,t,i){let o=await this.controller.replaceTableQuantity(e,t,i);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}getFloors(){return this.controller.getFloors()}setFloor(e){if(this.immersive.buyerView==="venue3d"&&e!=="all"&&this.immersive.focusFloor(e)){this.notifyMapStateChange();return}if(this.controller.getFloors().length<=1){console.warn("seatmap: setFloor() ignored \u2014 this chart has a single floor");return}e==="all"?this.controller.setFloorOverview(!0):this.controller.setFloor(e),this.notifyMapStateChange()}setFloorLabelStyle(e){this.controller.getRenderer()?.setFloorLabelStyle?.(e),this.notifyMapStateChange()}setSectionFocusDim(e){this.controller.setSectionFocusDim(e)}setSelectionFocus(e){this.controller.setSelectionFocus(e)}setBlockedRegions(e){if(!this.blockedRegions){if(!e.length)return;this.blockedRegions=new vi,this.hostEl&&this.blockedRegions.attach(this.hostEl)}this.blockedRegions.set(e)}getBlockedRegions(){return this.blockedRegions?.get()??[]}frameSeat(e,t={}){let i=this.controller.getRenderer();return ps({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:()=>i?.getCameraGestureCount?.()??0,panScreenBy:(o,s)=>i?.panScreenBy?(i.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:Ct(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.immersive.pushLiveState(),this.opts.onStatusChange?.()},onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAvailability(){let e=await this.controller.refreshAvailability();return this.immersive.pushLiveState(),this.opts.onStatusChange?.(),e.lost.length&&this.opts.onSelectedObjectUnavailable?.({labels:e.lost,reason:"taken"}),this.notifyMapStateChange(),e}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(this.accessState_={configured:!0,status:"ready"},await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),this.notifyMapStateChange(),e}showLoadFailure(e){let t=document.createElement("div");t.setAttribute("role","status"),t.style.cssText='display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;min-height:180px;box-sizing:border-box;padding:24px;text-align:center;font:500 14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#3b4256;';let i=document.createElement("div");i.textContent="The seat map didn\u2019t load.",t.appendChild(i);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 ms=["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"],Rc={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 Ic(n){let e={};for(let t of ms)e[t]=(...i)=>{let o=n();return o?o[t](...i):Rc[t]()};return e}var fs=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],gs=[...fs,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],bs=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function Oc(n,e,t){let i={container:n};for(let o of gs)i[o]=e[o];for(let o of bs)i[o]=t[o];return i}var _c=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),Nc=2e4,Dc=480,Bc=180*1e3,Fc=900*1e3,Vc=.8,zc=30*1e3,$c=1e5,jc=4,Gc=50;function mn(n){if(typeof n!="string")return n;let e=document.querySelector(n);if(!e)throw new Error(`EmbeddedDesigner container not found: ${n}`);return e}function Uc(n){let e=(n??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var qc={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."}},fn=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"||!_c.has(t.type))return;let i={type:t.type,chartId:typeof t.chartId=="string"?t.chartId:void 0,workspaceId:typeof t.workspaceId=="string"?t.workspaceId:void 0,expiresAt:typeof t.expiresAt=="number"?t.expiresAt:void 0,code:typeof t.code=="string"?t.code:void 0,message:typeof t.message=="string"?t.message:void 0,meta:t.meta,fatal:typeof t.fatal=="boolean"?t.fatal:void 0,action:typeof t.action=="string"?t.action:void 0},o=this.identityEstablished||i.type==="seatlayer.designer.ready"||i.type==="seatlayer.designer.saved"||i.type==="seatlayer.designer.published"||i.type==="seatlayer.designer.close",s=this.options.expectedChartId!==void 0&&i.chartId!==this.options.expectedChartId&&(o||i.chartId!==void 0),r=this.options.expectedWorkspaceId!==void 0&&i.workspaceId!==this.options.expectedWorkspaceId&&(o||i.workspaceId!==void 0);if(s||r){this.showError("mismatch");return}switch(i.type){case"seatlayer.designer.ready":this.identityEstablished=!0,this.sessionExpiresAt=i.expiresAt,this.phase="ready",this.clearTimeoutTimer(),this.removeOverlay(),this.autoRecoverUsed=!1,this.scheduleRenewal(i.expiresAt),this.options.onReady?.(i);break;case"seatlayer.designer.saved":this.options.onSaved?.(i);break;case"seatlayer.designer.published":this.options.onPublished?.(i);break;case"seatlayer.designer.close":this.options.onClose?.(i);break;case"seatlayer.designer.error":{let a=Uc(i.code);if(a==="expired"&&this.autoRenewEnabled()&&!this.autoRecoverUsed){this.autoRecoverUsed=!0,this.clearRenewTimer(),this.options.onRequestRelaunch();return}(typeof i.fatal=="boolean"?i.fatal:a!=="load"||this.phase!=="ready")&&this.showError(a),this.options.onError?.(i);break}}};this.options=e}mount(){this.destroy();let e=new URL(this.options.designerUrl,window.location.href);if(e.protocol!=="https:"&&e.hostname!=="localhost"&&e.hostname!=="127.0.0.1")throw new Error("EmbeddedDesigner requires an HTTPS designerUrl outside local development.");this.designerOrigin=e.origin;let t=document.createElement("iframe");t.title=this.options.title??"Venue chart Designer",t.allow=this.options.allow??"fullscreen; clipboard-write",t.referrerPolicy=this.options.referrerPolicy??"origin",t.src=e.toString(),t.style.setProperty("width","100%","important"),t.style.setProperty("height",typeof this.options.height=="number"?`${this.options.height}px`:"100%","important"),t.style.border="0",Object.assign(t.style,this.options.style),this.options.className&&(t.className=this.options.className);let i=mn(this.options.container);if(this.containerEl=i,window.addEventListener("message",this.handleMessage),i.append(t),this.frame=t,this.fillEnabled()&&this.startFill(),this.phase="loading",this.loadingStateEnabled()){this.ensureContainerPositioned(i),this.renderOverlay(i,"loading");let o=this.options.loadingTimeoutMs??Nc;o>0&&Number.isFinite(o)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},o))}return t}setDesignerUrl(e){return this.options={...this.options,designerUrl:e},this.mount()}getIframe(){return this.frame}setSizing(e,t){this.options={...this.options,height:e,minHeight:t},this.frame&&(this.stopFill(),this.lastAutoHeight="",this.fillEnabled()?(this.pinned||this.setFrameHeight("100%"),this.startFill()):this.pinned||this.setFrameHeight(`${e}px`))}setRelaunchPolicy(e,t){this.options={...this.options,onRequestRelaunch:e,autoRenewSession:t},this.clearRenewTimer(),this.phase==="ready"&&this.scheduleRenewal(this.sessionExpiresAt)}destroy(){window.removeEventListener("message",this.handleMessage),this.stopFill(),this.unpinFullscreen(),this.clearTimeoutTimer(),this.clearRenewTimer(),this.removeOverlay(),this.restoreContainerStyle(),this.frame?.remove(),this.frame=null,this.containerEl=null,this.fillMode=null,this.designerOrigin="",this.phase="loading",this.identityEstablished=!1,this.sessionExpiresAt=void 0,this.lastAutoHeight=""}loadingStateEnabled(){return this.options.showLoadingState!==!1}autoResizeEnabled(){return this.options.autoResize!==!1}fillEnabled(){return typeof this.options.height!="number"}setFrameHeight(e){this.frame?.style.setProperty("height",e,"important")}detectFillMode(){let e=this.containerEl,t=this.frame;if(this.pinned||!e||!t)return this.fillMode??"viewport";let i=()=>e.getBoundingClientRect().height,o=t.style.getPropertyValue("height"),s=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let r=i();t.style.setProperty("height",`${$c}px`,"important");let a=i();return o?t.style.setProperty("height",o,s):t.style.removeProperty("height"),!(a-r>jc)&&r>=Gc?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??Dc;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,i=Math.max(e,Math.round(window.innerHeight-t));this.setFrameHeight(`${i}px`)}syncContainerObserver(){let e=this.fillMode==="container"&&!!this.containerEl&&typeof ResizeObserver<"u";e&&!this.resizeObs?(this.resizeObs=new ResizeObserver(()=>this.scheduleFill()),this.resizeObs.observe(this.containerEl)):!e&&this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null)}startFill(){this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill(),!this.fillListening&&(this.fillListening=!0,window.addEventListener("resize",this.scheduleReprobe),window.addEventListener("orientationchange",this.scheduleReprobe),window.addEventListener("scroll",this.scheduleFill,{passive:!0}))}stopFill(){this.fillRaf!==null&&(cancelAnimationFrame(this.fillRaf),this.fillRaf=null),this.reprobeRaf!==null&&(cancelAnimationFrame(this.reprobeRaf),this.reprobeRaf=null),this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null),this.fillListening&&(this.fillListening=!1,window.removeEventListener("resize",this.scheduleReprobe),window.removeEventListener("orientationchange",this.scheduleReprobe),window.removeEventListener("scroll",this.scheduleFill))}pinFullscreen(){if(this.pinned||!this.frame)return;this.pinned=!0,this.frameStyleBeforeFs=this.frame.getAttribute("style");let e={position:"fixed",top:"0",right:"0",bottom:"0",left:"0",width:"100vw",height:"100vh",margin:"0",border:"0","z-index":"2147483000",background:"#101625"};for(let[i,o]of Object.entries(e))this.frame.style.setProperty(i,o,"important");let t=document.documentElement;this.docOverflowBeforeFs=t.style.overflow,t.style.overflow="hidden",document.body&&(this.bodyOverflowBeforeFs=document.body.style.overflow,document.body.style.overflow="hidden"),this.fsKeyHandler=i=>{i.key==="Escape"&&this.unpinFullscreen()},window.addEventListener("keydown",this.fsKeyHandler)}unpinFullscreen(){this.pinned&&(this.pinned=!1,this.frame&&(this.frameStyleBeforeFs===null?this.frame.removeAttribute("style"):this.frame.setAttribute("style",this.frameStyleBeforeFs),this.fillEnabled()?this.applyFill():this.autoResizeEnabled()&&this.lastAutoHeight?this.setFrameHeight(this.lastAutoHeight):typeof this.options.height=="number"&&this.setFrameHeight(`${this.options.height}px`)),this.frameStyleBeforeFs=null,this.docOverflowBeforeFs!==null&&(document.documentElement.style.overflow=this.docOverflowBeforeFs,this.docOverflowBeforeFs=null),this.bodyOverflowBeforeFs!==null&&document.body&&(document.body.style.overflow=this.bodyOverflowBeforeFs,this.bodyOverflowBeforeFs=null),this.fsKeyHandler&&(window.removeEventListener("keydown",this.fsKeyHandler),this.fsKeyHandler=null))}clearTimeoutTimer(){this.timeoutTimer!==null&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)}autoRenewEnabled(){return!!this.options.onRequestRelaunch&&this.options.autoRenewSession!==!1}clearRenewTimer(){this.renewTimer!==null&&(clearTimeout(this.renewTimer),this.renewTimer=null)}scheduleRenewal(e){if(this.clearRenewTimer(),!this.autoRenewEnabled()||typeof e!="number"||!Number.isFinite(e))return;let t=e-Date.now();if(t<=0)return;let i=t<Fc?t*Vc:t-Bc,o=Math.max(zc,i);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},o)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{mn(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=mn(this.options.container)}catch{return}this.renderOverlay(t,"error",e)}handleTryAgain(){if(this.options.onRequestRelaunch){this.options.onRequestRelaunch();return}this.mount()}renderOverlay(e,t,i){this.removeOverlay();let o=document.createElement("div");o.setAttribute("data-seatlayer-designer-overlay",t),o.setAttribute("role",t==="error"?"alert":"status"),o.setAttribute("aria-live","polite"),Object.assign(o.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:"#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,i??"load"),e.append(o),this.overlay=o}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
3191
+ `;function gt(){if(document.getElementById(ss))return;let n=document.createElement("style");n.id=ss,n.textContent=ec+ns+is+Jo+os+ts+es+Do,document.head.appendChild(n)}async function fi(n,e){let t=n.overlay.productionElements;if(!t?.some(o=>o.contentImageUrl))return n;let i=await Promise.all(t.map(async o=>{if(!o.contentImageUrl)return o;try{let 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{...n,overlay:{...n.overlay,productionElements:i}}}async function gi(n,e){if(n)try{let t=await e(n);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}import{browserPanoramaConstraints as tc,loadPanoramaImage as ic,planPanoramaDelivery as nc,schedulePanoramaUpgrade as oc}from"@seatlayer/core/view/panoramaDelivery";function bi(n){let{root:e,source:t,caption:i,real:o,closeLabel:s,dragHint:r,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:d,onClose:p}=n,u=n.chrome??{},h=document.createElement("div");h.className="sl-view sl-mo-zoom",h.setAttribute("role","dialog"),h.setAttribute("aria-label",a),h.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 y=F=>h.querySelector(F)?.remove();u.title===!1?y(".sl-view-title"):h.querySelector(".sl-view-title").textContent=a,u.caption===!1?y(".sl-view-cap"):h.querySelector(".sl-view-cap").textContent=i,h.querySelector(".sl-view-x").setAttribute("aria-label",s),u.badge===!1?y(".sl-view-badge"):h.querySelector(".sl-view-badge").textContent=o?l:c,h.querySelector(".sl-view-hint").textContent=r,e.appendChild(h);let f=h.querySelector(".sl-view-pano"),T=nc(t,tc()),S=new AbortController;f.style.backgroundImage=`url(${JSON.stringify(T.initialUrl)})`;let v=()=>{};T.upgradeUrl&&(v=oc(()=>{d(T.upgradeUrl).then(F=>!F||S.signal.aborted?null:ic(F,S.signal).then(()=>F)).then(F=>{!F||!h.isConnected||S.signal.aborted||(f.style.backgroundImage=`url(${JSON.stringify(F)})`)}).catch(()=>{})}));let A=70,_=35,K=1,g=f.clientHeight||1,L=f.clientWidth||1,D=-(g*(180/A)*2/2-L/2),H=0,R=()=>{let F=f.clientHeight||1,Qi=F*(180/A)*K,no=Math.max(0,Qi-F),oo=Math.min(no/2,_/180*Qi);H=Math.min(oo,Math.max(-oo,H)),f.style.backgroundSize=`auto ${Qi}px`,f.style.backgroundPosition=`${D}px ${H-no/2}px`};R();let C=!1,I=0,$=0,j=F=>{C=!0,I=F.clientX,$=F.clientY,f.classList.add("drag"),f.setPointerCapture?.(F.pointerId)},ue=F=>{C&&(D+=F.clientX-I,H+=F.clientY-$,I=F.clientX,$=F.clientY,R())},be=F=>{C=!1,f.classList.remove("drag"),f.releasePointerCapture?.(F.pointerId)},Q=F=>{F.preventDefault(),K=Math.min(2.4,Math.max(1,K+(F.deltaY<0?.12:-.12))),R()};f.addEventListener("pointerdown",j),f.addEventListener("pointermove",ue),f.addEventListener("pointerup",be),f.addEventListener("pointercancel",be),f.addEventListener("wheel",Q,{passive:!1});let Zi=h.querySelector(".sl-view-x");Zi.addEventListener("click",p);let io=F=>{F.key==="Escape"&&(F.stopPropagation(),p())};return h.addEventListener("keydown",io),Zi.focus(),{element:h,dispose(){v(),S.abort(),f.removeEventListener("pointerdown",j),f.removeEventListener("pointermove",ue),f.removeEventListener("pointerup",be),f.removeEventListener("pointercancel",be),f.removeEventListener("wheel",Q),h.removeEventListener("keydown",io),Zi.removeEventListener("click",p)}}}function ac(n,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=n.find(s=>s.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let i=n.filter(s=>s.rowId===t.rowId),o=i.findIndex(s=>s.id===e);return{targetSeatId:e,previousSeatId:o>0?i[o-1].id:null,nextSeatId:o>=0&&o+1<i.length?i[o+1].id:null}}var rs=6e4,yi=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 ac(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!ei()?!1:this.options.seats().length<=this.max3DSeats():!1}canOfferSeatView(){return this.options.enableSeatView?this.options.seats().some(e=>!!e.viewUrl)?!0:this.hasStage():!1}async setBuyerView(e,t={}){if(e==="map"){this.exit3D();return}if(!this.canOffer3D())throw new Error("venue_3d_unavailable");if(this.buyerView_==="venue3d"&&this.handle){t.flyToSeatId?(this.targetSeatId_=t.flyToSeatId,this.focusedSectionId_=this.findSeat(t.flyToSeatId)?.sectionId??null,this.options.onViewChange(this.buyerView_,this.targetSeatId_),await this.handle.flyToSeat(t.flyToSeatId)):t.resetView&&this.handle.focusOverview();return}if(this.handle&&this.overlay){await this.restore3D(t);return}await this.enter3D(t.flyToSeatId)}async openSeatView(e){if(!this.canOfferSeatView())throw new Error("seat_view_unavailable");let t=this.findSeat(e),i=this.options.host(),o=this.options.doc();if(!t||!i||!o)throw new Error("seat_view_unavailable");let s=++this.seatViewGeneration,r,a,l=!1;if(t.viewUrl){let y=t.viewMeta?.previewUrl,f=!!y&&y!==t.viewUrl,T=f?await this.options.resolveAsset(y):null,S=f?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(s!==this.seatViewGeneration||!S||f&&!T)return;r={url:S,...T?{previewUrl:T}:{},...f?{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=rc(r),l=sc(r)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:y}=await ii();if(s!==this.seatViewGeneration)return;let f=o.floors?.find(v=>v.objects.some(A=>A.type==="row"&&A.id===t.rowId)),T=t.focalPoint??f?.focalPoint??o.focalPoint,S=y(t,T,[...this.options.seats()]);r={url:S.url,generated:!0},a=bt("picker.illustrationCaption",{m:S.distanceM})}if(s!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(i,o),gt();let c=this.options.chrome??{},d=ze(),p=bt("picker.viewFromSeat",{label:t.displayLabel||t.label}),u=l?bt("picker.real360"):bt("picker.preview"),h=bi({root:i,source:r,caption:a,real:l,closeLabel:b("picker.close","Close"),dragHint:d,viewFromSeatLabel:p,real360Label:bt("picker.real360"),previewLabel:bt("picker.preview"),chrome:{title:c.seatViewTitle,caption:c.seatViewCaption,badge:c.seatViewBadge},resolveAsset:this.options.resolveAsset,onClose:()=>this.closeSeatView(!0,!0)});this.seatViewElement=h.element,this.seatViewDispose=h.dispose,this.options.onSeatViewChange?.({seatId:t.id,title:p,caption:a,badge:u,real:l,generated:!!r.generated,dragHint:d})}pushLiveState(){this.handle&&(this.handle.setAvailability(this.options.seats().map(e=>({seatId:e.id,state:this.seatState(e)}))),this.handle.setSelection(this.options.selection().map(e=>e.id)))}focusOverview(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.focusOverview(),!0)}focusSection(e){return this.buyerView_==="venue3d"?this.handle?.focusSection(e)??!1:!1}focusFloor(e){let t=this.options.doc();if(this.buyerView_!=="venue3d"||!this.handle||!t?.floors?.length)return!1;let i=t.floors.findIndex(o=>o.id===e);return i>=0&&this.handle.focusFloor(i)}zoomIn(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomIn(),!0)}zoomOut(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomOut(),!0)}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)?rs/2:rs}async enter3D(e){let t=this.options.host(),i=this.options.doc();if(!t||!i||this.overlay)throw new Error("venue_3d_unavailable");gt(),this.prepareHostTheme(t,i);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([Mt(),this.options.loadEventConfiguration()]),c=l?await fi(l,this.options.resolveAsset):null,d=await gi(i.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(r!==this.generation||this.overlay!==o)return;let p={doc:i,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...d?{registeredShellGlb:d}:{}};s.textContent=b("picker.building3d","Building venue geometry\u2026");let u=await a.prepareVenue3D(p);if(r!==this.generation||this.overlay!==o)return;let h=this.options.chrome??{},y=a.mountVenue3D(o,{...p,prepared:u},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:ze(),navLabels:Jt(),...h.view3dCaption===!1||h.view3dSeatStepper===!1||h.view3dControlDock===!1?{chrome:{caption:h.view3dCaption!==!1,seatStepper:h.view3dSeatStepper!==!1,controlDock:h.view3dControlDock!==!1}}:{},seatViewActionLabel:f=>this.findSeat(f)?.viewUrl?b("picker.openAuthored360","Open venue 360\xB0"):b("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:f=>this.toggleSeat(f),onSeatInspect:f=>this.toggleSeat(f),onViewTargetChange:f=>{this.targetSeatId_=f,f&&(this.focusedSectionId_=this.findSeat(f)?.sectionId??null),this.options.onViewChange("venue3d",f)},onSectionFocusChange:f=>{this.focusedSectionId_=f,this.options.onViewChange("venue3d",this.targetSeatId_)},...this.options.enableSeatView?{getSeatView:f=>this.seatViewFor3D(f)}:{}});if(r!==this.generation||this.overlay!==o){y.dispose();return}this.handle=y,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,y.setNavigationMode(this.navigationMode_),requestAnimationFrame(()=>s.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await y.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 i=this.handle,o=this.overlay;if(this.options.restoreMap(),t&&i&&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{i?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{i?.dispose()}catch{}o.remove(),this.options.restoreMap();return}o.style.pointerEvents="none",requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(()=>{try{i?.dispose()}catch{}o.remove(),this.options.restoreMap()},280)}async restore3D(e){let t=this.overlay,i=this.handle;if(!t||!i)throw new Error("venue_3d_unavailable");this.buyerView_="venue3d",this.targetSeatId_=e.flyToSeatId??null,this.focusedSectionId_=e.flyToSeatId?this.findSeat(e.flyToSeatId)?.sectionId??null:null,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),i.resize(),i.setNavigationMode(this.navigationMode_),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e.flyToSeatId?await i.flyToSeat(e.flyToSeatId):e.resetView&&i.focusOverview()}nextPaint(){return this.reducedMotion()||typeof requestAnimationFrame!="function"?Promise.resolve():new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}toggleSeat(e){if(!this.findSeat(e))return;this.options.selection().some(o=>o.id===e)?this.options.deselect(e):this.options.status(e)==="free"&&this.options.select(e),this.pushLiveState()}seatState(e){switch(this.options.status(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:return"available"}}async seatViewFor3D(e){let t=this.findSeat(e);if(!t)throw new Error("seat_view_unavailable");if(t.viewUrl){let i=t.viewMeta?.previewUrl,o=!!i&&i!==t.viewUrl,s=o?await this.options.resolveAsset(i):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 i=this.seatViewElement;if(this.seatViewDispose?.(),this.seatViewDispose=null,this.seatViewElement=null,!!i){if(this.options.onSeatViewChange?.(null),!t||this.reducedMotion()){i.remove();return}i.classList.add("is-leaving"),setTimeout(()=>i.remove(),190)}}findSeat(e){return this.options.seats().find(t=>t.id===e||t.label===e)}hasStage(){let e=this.options.doc();return e?(e.floors?.flatMap(i=>i.objects)??e.objects).some(i=>i.type==="shape"&&(i.role==="stage"||!!i.stageKind)):!1}prepareHostTheme(e,t){getComputedStyle(e).position==="static"&&(e.style.position="relative");let i=t.theme;e.style.setProperty("--sl-bg",i?.background??"#f6f7fb"),e.style.setProperty("--sl-surface","#ffffff"),e.style.setProperty("--sl-text",i?.textColor??"#10162a"),e.style.setProperty("--sl-muted","#697386"),e.style.setProperty("--sl-line","#d9deea"),e.style.setProperty("--sl-accent",i?.accent??"#ef4056"),e.style.setProperty("--sl-accent-ink",i?.accentInk??"#ffffff")}reducedMotion(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1}};var lc={host:"web",platform:"web",bundle:"",protocol:0,chromeOwner:"web"},cc={...lc},vi=null,as=null;function dc(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function pc(){let n=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:n(dc()),documentMs:vi==null?0:n(vi),handshakeMs:vi==null||as==null?0:n(as-vi)}}function ls(){let{host:n,platform:e,bundle:t,protocol:i,chromeOwner:o}=cc,s=pc();return{host:n,platform:e,...t?{bundle:t}:{},...i?{protocol:i}:{},chromeOwner:o,bootMs:s.bootMs,documentMs:s.documentMs,handshakeMs:s.handshakeMs}}var cs=new Set;function Ae(n){return cs.has(n)?"repeat":"cold"}function wi(n){let e=Ae(n);return cs.add(n),e}function le(n){return typeof n=="number"&&Number.isFinite(n)&&n>=0?Math.round(n):0}function hc(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function uc(n){if(!/^[A-Za-z0-9_-]{1,80}$/.test(n.event))return null;let e=n.performanceProfile??{};return{event:n.event,scope:n.scope,surface:n.surface,outcome:n.outcome,stage:n.stage?.slice(0,32)??"",ms:le(n.ms),api:le(e.loadChartAndStatuses)||le(e.loadChart),scene:le(e.buildScene),panel:le(e.buildBuyerControls),paint:le(e.firstPaint),normalize:le(e.normalizeBuyerModel),renderer:le(e.createRenderer),seats:le(n.seats),floors:le(n.floors),view:n.view??"map",load:n.load??Ae(n.event),transport:n.transport??"pubapi",chartBytes:le(n.chartDelivery?.bytes),chartCache:n.chartDelivery?.cache??"",...ls(),availabilityMs:le(e.loadStatuses)}}var mc=new Set;function ve(n){let e=uc(n);if(e){for(let t of mc)try{t(e)}catch{}typeof fetch>"u"||hc()||fetch(`${n.apiBase.replace(/\/+$/,"")}/pub/telemetry/chart-load`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify(e),credentials:"omit",keepalive:!0}).catch(()=>{})}}function xi(n){if(!n)return null;let e=n.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function fc(n){return xi(n.foot?.querySelector(".sl-total"))??xi(n.tray)??xi(n.sheetHead)}function mn(n,e,t,i,o){let s=n,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,d=i?.find(u=>u.key===t.categoryKey)?.color,p=()=>{let u=fc(s);if(!u){o?.();return}zo({from:l,to:{x:u.left+u.width/2,y:u.top+u.height/2},label:c,color:d,onArrive:o})};s.sheetHead&&xi(s.sheetHead)?requestAnimationFrame(p):p()}var un=60,gc=650;function ds(n,e){if(!e.length||n.focusSeats?.(e.map(o=>o.id)))return;let t=e.find(o=>o.sectionId)?.sectionId;if(!t)return;let i=e.filter(o=>o.sectionId===t);n.focus(t,{x:i.reduce((o,s)=>o+s.x,0)/i.length,y:i.reduce((o,s)=>o+s.y,0)/i.length})}function ps(n,e){let t=!di();ds({focusSeats:i=>n.focusSeats?.(i,{animate:t})===!0,focus:(i,o)=>n.focusSection(i,o)},(e?.items??[]).filter(i=>i.objectType!=="ga").slice(0,10).map(i=>n.seatByLabel(i.label)).filter(i=>!!i))}function hs(n,e){if(!e.length)return;let t=n.reducedMotion===!0;t||e.forEach((r,a)=>{n.schedule(()=>n.pop(r.id),a*un)});let i=t?0:e.length*un,o=e.find(r=>r.sectionId)?.sectionId;if(n.schedule(()=>ds(n,e),i),t)return;let s=i+(n.focusSeats||o?gc:0);e.forEach((r,a)=>{n.schedule(()=>mn(n.regions,n.screenPoint(r),r,n.categories),s+a*un)})}function bc(n,e,t){for(let i of n)if(e>=i.x&&t>=i.y&&e<=i.x+i.w&&t<=i.y+i.h)return!0;return!1}var Si=class{constructor(){this.rects=[];this.host=null;this.pointers=new Set;this.touches=new Set;this.mouseDown=!1;this.onPointerDown=e=>{this.inside(e.clientX,e.clientY)&&(this.pointers.add(e.pointerId),this.swallow(e))};this.onPointerFollow=e=>{this.pointers.has(e.pointerId)&&this.swallow(e)};this.onPointerEnd=e=>{this.pointers.delete(e.pointerId)&&this.swallow(e)};this.onTouchStart=e=>{let t=this.changed(e);if(!t.length)return;let i=!0;for(let o of t)this.inside(o.clientX,o.clientY)?this.touches.add(o.identifier):i=!1;i&&this.swallow(e)};this.onTouchFollow=e=>{let t=this.changed(e);t.length&&t.every(i=>this.touches.has(i.identifier))&&this.swallow(e)};this.onTouchEnd=e=>{let t=this.changed(e);if(!t.length)return;let i=t.every(o=>this.touches.has(o.identifier));for(let o of t)this.touches.delete(o.identifier);i&&this.swallow(e)};this.onMouseDown=e=>{this.inside(e.clientX,e.clientY)&&(this.mouseDown=!0,this.swallow(e))};this.onMouseFollow=e=>{this.mouseDown&&this.swallow(e)};this.onMouseUp=e=>{this.mouseDown&&(this.mouseDown=!1,this.swallow(e))};this.onClick=e=>{this.inside(e.clientX,e.clientY)&&this.swallow(e)}}set(e){this.rects=e.map(t=>({x:t.x,y:t.y,w:t.w,h:t.h})),this.rects.length||(this.pointers.clear(),this.touches.clear(),this.mouseDown=!1)}get(){return this.rects}attach(e){if(this.host===e)return;this.detach(),this.host=e;let t={capture:!0,passive:!1};e.addEventListener("pointerdown",this.onPointerDown,t),e.addEventListener("pointermove",this.onPointerFollow,t),e.addEventListener("pointerup",this.onPointerEnd,t),e.addEventListener("pointercancel",this.onPointerEnd,t),e.addEventListener("touchstart",this.onTouchStart,t),e.addEventListener("touchmove",this.onTouchFollow,t),e.addEventListener("touchend",this.onTouchEnd,t),e.addEventListener("touchcancel",this.onTouchEnd,t),e.addEventListener("mousedown",this.onMouseDown,t),e.addEventListener("mousemove",this.onMouseFollow,t),e.addEventListener("mouseup",this.onMouseUp,t),e.addEventListener("click",this.onClick,t),e.addEventListener("dblclick",this.onClick,t)}detach(){let e=this.host;if(!e)return;let t={capture:!0};e.removeEventListener("pointerdown",this.onPointerDown,t),e.removeEventListener("pointermove",this.onPointerFollow,t),e.removeEventListener("pointerup",this.onPointerEnd,t),e.removeEventListener("pointercancel",this.onPointerEnd,t),e.removeEventListener("touchstart",this.onTouchStart,t),e.removeEventListener("touchmove",this.onTouchFollow,t),e.removeEventListener("touchend",this.onTouchEnd,t),e.removeEventListener("touchcancel",this.onTouchEnd,t),e.removeEventListener("mousedown",this.onMouseDown,t),e.removeEventListener("mousemove",this.onMouseFollow,t),e.removeEventListener("mouseup",this.onMouseUp,t),e.removeEventListener("click",this.onClick,t),e.removeEventListener("dblclick",this.onClick,t),this.host=null,this.pointers.clear(),this.touches.clear(),this.mouseDown=!1}inside(e,t){if(!this.rects.length||!this.host)return!1;let i=this.host.getBoundingClientRect();return bc(this.rects,e-i.left,t-i.top)}swallow(e){e.stopImmediatePropagation(),e.stopPropagation(),e.cancelable&&e.preventDefault()}changed(e){let t=e.changedTouches;return t?Array.from(t):[]}},us=.48,yc=8;function vc(n,e,t,i=us){let o=Math.max(0,t.top),s=e.height-Math.max(0,t.bottom);if(!(s>o))return 0;let r=Number.isFinite(i)?Math.min(1,Math.max(0,i)):us,a=o+(s-o)*r-n;return Math.abs(a)<=yc?0:Math.round(a)}function ms(n,e,t={}){let i=n.gestureCount();if(t.gestures!==void 0&&t.gestures!==i)return{dy:0,gestures:i};let o=n.seatPoint(e);if(!o)return{dy:0,gestures:i};let s=vc(o.y,{height:n.mapHeight()},n.insets(),t.fraction);return s?{dy:n.panScreenBy({x:0,y:s},t.animate!==!1)?s:0,gestures:i}:{dy:0,gestures:i}}var Dt=class n{constructor(e,t=null){this.seams=e;this.watch=null;this.mode=t,this.watchMode()}themeMode(){return this.mode}setThemeMode(e,t){let i=t!==void 0&&"mapTheme"in t;e===this.mode&&!i||(i&&this.seams.setHostMapTheme(t.mapTheme??void 0),this.mode=e,this.watchMode(),this.applyThemeMode())}static groundFor(e){return st(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??n.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=Zt(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};import{getLocale as Sc}from"@seatlayer/core";import{seatConfidenceDisclosure as kc}from"@seatlayer/core/core/seatConfidence";import{generateSeatThumb as wc}from"@seatlayer/core";function yt(n){let e=n.viewMeta?.previewUrl??n.viewUrl;return e&&(hn(e)||at(e))?e:null}function Ti(n){if(!n)return!1;let e=n.floors?.length?n.floors.map(t=>t.objects??[]):[n.objects??[]];for(let t of e)for(let i of t)if(i.type==="shape"&&(i.role==="stage"||i.stageKind))return!0;return!1}var xc=512,ki=new Map;function Ei(n,e){if(!e)return null;let t=`${n.id}|${Math.round(e.x)},${Math.round(e.y)}`,i=ki.get(t);if(i!==void 0)return i;let o=null;try{o=wc(n,e).distanceM??null}catch{o=null}return ki.size>=xc&&ki.clear(),ki.set(t,o),o}function Bt(n){return n.getFocusedSection()!==null||n.seatsRevealed()}function Tc(n){let e=n.atVenueFit?.(),t=n.canZoomIn?.();return{...typeof e=="boolean"?{atVenueFit:e}:{},...typeof t=="boolean"?{canZoomIn:t}:{}}}function Ec(n,e){return{accessibilityFilter:n.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function Cc(n,e,t,i){for(let o of e){if(o.count<=0)continue;let s=n.accessibilitySpread?.([o.key]);for(let r of s?.sections??[]){let a=t.get(r.id)??i.get(r.id);if(!a||r.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[o.key]=r.free}}}function fs(n,e,t){let i=n.doc,o=i?.theme??{},s=n.categoryAvailability(),r=n.getGAAreas(),a=n.getFloors(),l=n.getExpandedSeats(),c=n.getAccessNeeds(),d=Ec(c,l),p=e.seatPosition,u=p.targetSeatId?n.seatDetails(p.targetSeatId):null,h=new Map(l.map(v=>[v.id,v])),y=Ti(i),f=i?.floors?.flatMap(v=>v.objects)??i?.objects??[],T=new Map,S=new Map;for(let v of f){if(v.type!=="section")continue;let A={id:v.id,label:v.label,...v.displayLabel?{displayLabel:v.displayLabel}:{},...v.zone?{zoneId:v.zone}:{}};T.set(v.id,A);let _=v.logicalSectionId??v.id;S.has(_)||S.set(_,A)}return Cc(n,c,T,S),{event:{key:t.event,name:t.eventInfo?.name??i?.name??t.event,venue:t.eventInfo?.venue??null,startsAt:t.eventInfo?.startsAt??null,timezone:t.eventInfo?.timezone??null,currency:t.eventInfo?.currency??t.currency??"USD",locale:Sc()||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:!!i?.categories.some(v=>v.tiers?.length),floors:a.length>1,zones:!!i?.zones?.length,sections:T.size>0,bestAvailable:!0,...d,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(i?.categories??[]).filter(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:(i?.zones??[]).map(v=>({id:v.id,label:v.label,...v.color?{color:v.color}:{}})),sections:[...T.values()],gaAreas:r,bestAvailableZones:n.getBestAvailableZones()},map:{floors:a,activeFloorId:n.getActiveFloorId()||a[0]?.id||null,floorMode:n.isFloorOverview()?"all":"single",floorLabelStyle:n.getRenderer()?.getFloorLabelStyle?.()??"number",rung:n.getRung(),canZoomOut:Bt(n)||t.focusedSection_!==null,...Tc(n),focusedSectionId:n.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:n.getViewMode(),buyerView:e.buyerView,view3dTargetSeatId:p.targetSeatId,view3dTargetSeat:u,view3dPreviousSeatId:p.previousSeatId,view3dNextSeatId:p.nextSeatId,view3dFocusedSectionId:e.focusedSectionId,view3dNavigationMode:e.navigationMode,colorblindSafe:t.colorblindSafe_,viewportInsets:n.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:c},selection:{seats:n.getSelection().map(v=>{let A=h.get(v.id);if(!A)return v;let _=n.worldToScreen({x:A.x,y:A.y}),K=yt(A),g=y?Ei(A,A.focalPoint??i?.focalPoint):null;return{...v,screenPoint:{x:_.x,y:_.y},...K?{seatViewThumb:{reference:K,kind:"real"}}:{},...g!=null?{sightlineMetres:g}:{},...A.confidenceEvidence?{seatViewConfidence:kc(A.confidenceEvidence)}:{}}}),validity:n.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var Oc="https://api.seatlayer.io",gs=10;function _c(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}var gn=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??gs,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 i={onExpired:a=>{this.accessState_={configured:!0,status:a.refreshed?"ready":"expired"},this.opts.onAccessExpired?.(a),this.notifyMapStateChange()},onUnavailable:a=>{this.accessState_={configured:!0,status:"unavailable",reason:a.reason},this.opts.onAccessUnavailable?.(a),this.notifyMapStateChange()}},o=(e.apiBase??Oc).replace(/\/+$/,"");this.apiBase=o;let s=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?ci({base:o,event:e.event,publicKey:e.publicKey,accessHooks:i,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=s?.access??_t(e,i);let r=s?.api??new Re(o,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=r,this.controller=new Ac({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??gs)-this.controller.getSelection().length)),tiers:ui(l),confirm:c=>{let d=typeof c=="number"?c:Object.values(c).reduce((p,u)=>p+u,0);this.holdGA(l.id,d)},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??Dt.groundFor(e.theme?.mode)??null}),this.hostSurface=new Dt({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 ft(e.event,(a,l)=>r.asset(a,l)),this.immersive=new yi({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_=Bt(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=Bt(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_=Bt(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),i=this.localeGeneration+=1,o=fn();this.mount=_c(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),ai(s,t,a=>{a!==o&&this.applyActiveLocale(a,i)}),this.applyInteractionState();let r=await this.controller.render(s);if(!r)return ve({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:Ae(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=me("picker.testMode"),a.setAttribute("aria-label",me("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),ve({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",me("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 i=document.createElement("span");i.setAttribute("aria-hidden","true"),i.style.cssText="width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee",i.innerHTML=mi;let o=document.createElement("span");o.textContent=me("picker.poweredBy"),t.append(i,o),e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,o=this.tipPos.x+14,s=this.tipPos.y-i-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=Pc(e.price,e.currency,{...Number.isInteger(e.price)?{minimumFractionDigits:0,maximumFractionDigits:0}:{},locale:this.opts.locale,fallback:(l,c)=>`${l} ${c}`}),i=document.createElement("div");i.style.cssText="font-weight:700;font-size:13px",i.textContent=e.label;let o=document.createElement("div");o.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let 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(i,o),e.status!=="free"){let l=document.createElement("div");l.style.cssText="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700",l.textContent=e.status==="held"?me("map.statusHeld"):me("map.statusTaken"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(o=>Rc(o)).filter((o,s,r)=>r.indexOf(o)===s);if(t.length<2)return;let i=document.createElement("select");i.setAttribute("aria-label",me("picker.preferredTicketType")),i.style.cssText='position:absolute;bottom:10px;left:12px;z-index:5;appearance:none;padding:5px 9px;border-radius:999px;border:0;cursor:pointer;background:rgba(255,255,255,.92);color:#4a5163;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 2px 8px rgba(0,0,0,.12);';for(let o of t){let s=document.createElement("option");s.value=o,s.textContent=Hc[o]??o,s.selected=o===fn(),i.appendChild(s)}i.addEventListener("change",()=>{this.setLocale(i.value)}),e.appendChild(i),this.languageSelect=i}async setLocale(e){let t=fn(),i=this.localeGeneration+=1,o=await Lc(e);return this.opts.messages&&Ic(this.opts.messages),o===t||this.applyActiveLocale(o,i),o}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let i=this.hostEl;if(i){i.lang=e,i.dir=Mc(e);for(let o of i.querySelectorAll("[data-sl-i18n]"))if(o.dataset.slI18n==="testMode")o.textContent=me("picker.testMode"),o.setAttribute("aria-label",me("picker.testMode"));else if(o.dataset.slI18n==="badge"){o.setAttribute("aria-label",me("picker.poweredBy"));let s=o.querySelector("span:last-child");s&&(s.textContent=me("picker.poweredBy"))}this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy()}}getMode(){return this.mode_}getPickerState(){return fs(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 i=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(i?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:i?"selection_count_mismatch":"selection_invalid",selection:t})}this.holdingLabels=new Set(this.controller.getSelection().map(i=>i.label));try{let i=await this.controller.hold(void 0,e.ttlMs);return i?{holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items}:null}finally{this.holdingLabels.clear()}}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}getCurrentHold(){let e=this.controller.currentHold();return e?{holdId:e.holdId,expiresAt:e.expiresAt,seats:e.seats,items:e.items}:null}getGAAreas(){return this.controller.getGAAreas()}async holdGA(e,t,i={}){try{return await this.holdGAOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async holdGAOrThrow(e,t,i={}){let o=await this.controller.holdGA(e,t,i);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}async bestAvailable(e,t,i={}){try{return await this.bestAvailableOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async bestAvailableOrThrow(e,t,i={}){let o=await this.controller.bestAvailable(e,t,i);return ps(this.controller,o),o?{holdId:o.holdId,expiresAt:o.expiresAt,labels:o.labels,seats:o.seats,items:o.items,...i.zoneId?{zoneId:i.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}setTableQuantity(e,t){return this.controller.setTableQuantity(e,t)}async replaceTableQuantity(e,t,i){try{return await this.replaceTableQuantityOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async replaceTableQuantityOrThrow(e,t,i){let o=await this.controller.replaceTableQuantity(e,t,i);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}getFloors(){return this.controller.getFloors()}setFloor(e){if(this.immersive.buyerView==="venue3d"&&e!=="all"&&this.immersive.focusFloor(e)){this.notifyMapStateChange();return}if(this.controller.getFloors().length<=1){console.warn("seatmap: setFloor() ignored \u2014 this chart has a single floor");return}e==="all"?this.controller.setFloorOverview(!0):this.controller.setFloor(e),this.notifyMapStateChange()}setFloorLabelStyle(e){this.controller.getRenderer()?.setFloorLabelStyle?.(e),this.notifyMapStateChange()}setSectionFocusDim(e){this.controller.setSectionFocusDim(e)}setSelectionFocus(e){this.controller.setSelectionFocus(e)}setBlockedRegions(e){if(!this.blockedRegions){if(!e.length)return;this.blockedRegions=new Si,this.hostEl&&this.blockedRegions.attach(this.hostEl)}this.blockedRegions.set(e)}getBlockedRegions(){return this.blockedRegions?.get()??[]}frameSeat(e,t={}){let i=this.controller.getRenderer();return ms({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:()=>i?.getCameraGestureCount?.()??0,panScreenBy:(o,s)=>i?.panScreenBy?(i.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 Te({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:Pt(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.immersive.pushLiveState(),this.opts.onStatusChange?.()},onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAvailability(){let e=await this.controller.refreshAvailability();return this.immersive.pushLiveState(),this.opts.onStatusChange?.(),e.lost.length&&this.opts.onSelectedObjectUnavailable?.({labels:e.lost,reason:"taken"}),this.notifyMapStateChange(),e}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(this.accessState_={configured:!0,status:"ready"},await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),this.notifyMapStateChange(),e}showLoadFailure(e){let t=document.createElement("div");t.setAttribute("role","status"),t.style.cssText='display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;min-height:180px;box-sizing:border-box;padding:24px;text-align:center;font:500 14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#3b4256;';let i=document.createElement("div");i.textContent="The seat map didn\u2019t load.",t.appendChild(i);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 bs=["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"],Nc={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 Dc(n){let e={};for(let t of bs)e[t]=(...i)=>{let o=n();return o?o[t](...i):Nc[t]()};return e}var ys=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],vs=[...ys,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],ws=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function Bc(n,e,t){let i={container:n};for(let o of vs)i[o]=e[o];for(let o of ws)i[o]=t[o];return i}var Fc=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),Vc=2e4,zc=480,$c=180*1e3,jc=900*1e3,Gc=.8,Uc=30*1e3,qc=1e5,Kc=4,Wc=50;function bn(n){if(typeof n!="string")return n;let e=document.querySelector(n);if(!e)throw new Error(`EmbeddedDesigner container not found: ${n}`);return e}function Yc(n){let e=(n??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var Xc={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."}},yn=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"||!Fc.has(t.type))return;let i={type:t.type,chartId:typeof t.chartId=="string"?t.chartId:void 0,workspaceId:typeof t.workspaceId=="string"?t.workspaceId:void 0,expiresAt:typeof t.expiresAt=="number"?t.expiresAt:void 0,code:typeof t.code=="string"?t.code:void 0,message:typeof t.message=="string"?t.message:void 0,meta:t.meta,fatal:typeof t.fatal=="boolean"?t.fatal:void 0,action:typeof t.action=="string"?t.action:void 0},o=this.identityEstablished||i.type==="seatlayer.designer.ready"||i.type==="seatlayer.designer.saved"||i.type==="seatlayer.designer.published"||i.type==="seatlayer.designer.close",s=this.options.expectedChartId!==void 0&&i.chartId!==this.options.expectedChartId&&(o||i.chartId!==void 0),r=this.options.expectedWorkspaceId!==void 0&&i.workspaceId!==this.options.expectedWorkspaceId&&(o||i.workspaceId!==void 0);if(s||r){this.showError("mismatch");return}switch(i.type){case"seatlayer.designer.ready":this.identityEstablished=!0,this.sessionExpiresAt=i.expiresAt,this.phase="ready",this.clearTimeoutTimer(),this.removeOverlay(),this.autoRecoverUsed=!1,this.scheduleRenewal(i.expiresAt),this.options.onReady?.(i);break;case"seatlayer.designer.saved":this.options.onSaved?.(i);break;case"seatlayer.designer.published":this.options.onPublished?.(i);break;case"seatlayer.designer.close":this.options.onClose?.(i);break;case"seatlayer.designer.error":{let a=Yc(i.code);if(a==="expired"&&this.autoRenewEnabled()&&!this.autoRecoverUsed){this.autoRecoverUsed=!0,this.clearRenewTimer(),this.options.onRequestRelaunch();return}(typeof i.fatal=="boolean"?i.fatal:a!=="load"||this.phase!=="ready")&&this.showError(a),this.options.onError?.(i);break}}};this.options=e}mount(){this.destroy();let e=new URL(this.options.designerUrl,window.location.href);if(e.protocol!=="https:"&&e.hostname!=="localhost"&&e.hostname!=="127.0.0.1")throw new Error("EmbeddedDesigner requires an HTTPS designerUrl outside local development.");this.designerOrigin=e.origin;let t=document.createElement("iframe");t.title=this.options.title??"Venue chart Designer",t.allow=this.options.allow??"fullscreen; clipboard-write",t.referrerPolicy=this.options.referrerPolicy??"origin",t.src=e.toString(),t.style.setProperty("width","100%","important"),t.style.setProperty("height",typeof this.options.height=="number"?`${this.options.height}px`:"100%","important"),t.style.border="0",Object.assign(t.style,this.options.style),this.options.className&&(t.className=this.options.className);let i=bn(this.options.container);if(this.containerEl=i,window.addEventListener("message",this.handleMessage),i.append(t),this.frame=t,this.fillEnabled()&&this.startFill(),this.phase="loading",this.loadingStateEnabled()){this.ensureContainerPositioned(i),this.renderOverlay(i,"loading");let o=this.options.loadingTimeoutMs??Vc;o>0&&Number.isFinite(o)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},o))}return t}setDesignerUrl(e){return this.options={...this.options,designerUrl:e},this.mount()}getIframe(){return this.frame}setSizing(e,t){this.options={...this.options,height:e,minHeight:t},this.frame&&(this.stopFill(),this.lastAutoHeight="",this.fillEnabled()?(this.pinned||this.setFrameHeight("100%"),this.startFill()):this.pinned||this.setFrameHeight(`${e}px`))}setRelaunchPolicy(e,t){this.options={...this.options,onRequestRelaunch:e,autoRenewSession:t},this.clearRenewTimer(),this.phase==="ready"&&this.scheduleRenewal(this.sessionExpiresAt)}destroy(){window.removeEventListener("message",this.handleMessage),this.stopFill(),this.unpinFullscreen(),this.clearTimeoutTimer(),this.clearRenewTimer(),this.removeOverlay(),this.restoreContainerStyle(),this.frame?.remove(),this.frame=null,this.containerEl=null,this.fillMode=null,this.designerOrigin="",this.phase="loading",this.identityEstablished=!1,this.sessionExpiresAt=void 0,this.lastAutoHeight=""}loadingStateEnabled(){return this.options.showLoadingState!==!1}autoResizeEnabled(){return this.options.autoResize!==!1}fillEnabled(){return typeof this.options.height!="number"}setFrameHeight(e){this.frame?.style.setProperty("height",e,"important")}detectFillMode(){let e=this.containerEl,t=this.frame;if(this.pinned||!e||!t)return this.fillMode??"viewport";let i=()=>e.getBoundingClientRect().height,o=t.style.getPropertyValue("height"),s=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let r=i();t.style.setProperty("height",`${qc}px`,"important");let a=i();return o?t.style.setProperty("height",o,s):t.style.removeProperty("height"),!(a-r>Kc)&&r>=Wc?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??zc;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,i=Math.max(e,Math.round(window.innerHeight-t));this.setFrameHeight(`${i}px`)}syncContainerObserver(){let e=this.fillMode==="container"&&!!this.containerEl&&typeof ResizeObserver<"u";e&&!this.resizeObs?(this.resizeObs=new ResizeObserver(()=>this.scheduleFill()),this.resizeObs.observe(this.containerEl)):!e&&this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null)}startFill(){this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill(),!this.fillListening&&(this.fillListening=!0,window.addEventListener("resize",this.scheduleReprobe),window.addEventListener("orientationchange",this.scheduleReprobe),window.addEventListener("scroll",this.scheduleFill,{passive:!0}))}stopFill(){this.fillRaf!==null&&(cancelAnimationFrame(this.fillRaf),this.fillRaf=null),this.reprobeRaf!==null&&(cancelAnimationFrame(this.reprobeRaf),this.reprobeRaf=null),this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null),this.fillListening&&(this.fillListening=!1,window.removeEventListener("resize",this.scheduleReprobe),window.removeEventListener("orientationchange",this.scheduleReprobe),window.removeEventListener("scroll",this.scheduleFill))}pinFullscreen(){if(this.pinned||!this.frame)return;this.pinned=!0,this.frameStyleBeforeFs=this.frame.getAttribute("style");let e={position:"fixed",top:"0",right:"0",bottom:"0",left:"0",width:"100vw",height:"100vh",margin:"0",border:"0","z-index":"2147483000",background:"#101625"};for(let[i,o]of Object.entries(e))this.frame.style.setProperty(i,o,"important");let t=document.documentElement;this.docOverflowBeforeFs=t.style.overflow,t.style.overflow="hidden",document.body&&(this.bodyOverflowBeforeFs=document.body.style.overflow,document.body.style.overflow="hidden"),this.fsKeyHandler=i=>{i.key==="Escape"&&this.unpinFullscreen()},window.addEventListener("keydown",this.fsKeyHandler)}unpinFullscreen(){this.pinned&&(this.pinned=!1,this.frame&&(this.frameStyleBeforeFs===null?this.frame.removeAttribute("style"):this.frame.setAttribute("style",this.frameStyleBeforeFs),this.fillEnabled()?this.applyFill():this.autoResizeEnabled()&&this.lastAutoHeight?this.setFrameHeight(this.lastAutoHeight):typeof this.options.height=="number"&&this.setFrameHeight(`${this.options.height}px`)),this.frameStyleBeforeFs=null,this.docOverflowBeforeFs!==null&&(document.documentElement.style.overflow=this.docOverflowBeforeFs,this.docOverflowBeforeFs=null),this.bodyOverflowBeforeFs!==null&&document.body&&(document.body.style.overflow=this.bodyOverflowBeforeFs,this.bodyOverflowBeforeFs=null),this.fsKeyHandler&&(window.removeEventListener("keydown",this.fsKeyHandler),this.fsKeyHandler=null))}clearTimeoutTimer(){this.timeoutTimer!==null&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)}autoRenewEnabled(){return!!this.options.onRequestRelaunch&&this.options.autoRenewSession!==!1}clearRenewTimer(){this.renewTimer!==null&&(clearTimeout(this.renewTimer),this.renewTimer=null)}scheduleRenewal(e){if(this.clearRenewTimer(),!this.autoRenewEnabled()||typeof e!="number"||!Number.isFinite(e))return;let t=e-Date.now();if(t<=0)return;let i=t<jc?t*Gc:t-$c,o=Math.max(Uc,i);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},o)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{bn(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=bn(this.options.container)}catch{return}this.renderOverlay(t,"error",e)}handleTryAgain(){if(this.options.onRequestRelaunch){this.options.onRequestRelaunch();return}this.mount()}renderOverlay(e,t,i){this.removeOverlay();let o=document.createElement("div");o.setAttribute("data-seatlayer-designer-overlay",t),o.setAttribute("role",t==="error"?"alert":"status"),o.setAttribute("aria-live","polite"),Object.assign(o.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:"#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,i??"load"),e.append(o),this.overlay=o}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
3179
3192
  @media (prefers-reduced-motion: no-preference) {
3180
3193
  @keyframes seatlayer-designer-shimmer {
3181
3194
  0% { background-position: -320px 0; }
@@ -3185,9 +3198,9 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3185
3198
  animation: seatlayer-designer-shimmer 1.25s ease-in-out infinite;
3186
3199
  background-size: 640px 100%;
3187
3200
  }
3188
- }`,e.append(t);let i="linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.04) 63%)",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:i,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:i,flex:"0 0 auto"}),a.append(l),a.append(document.createTextNode("Loading designer\u2026")),e.append(a)}buildErrorCard(e,t){let i=qc[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=i.title,Object.assign(s.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let r=document.createElement("p");r.textContent=i.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)}};import{PickerController as yp,formatMoney as vp,getLocale as Na,loadLocale as wp,setStringOverrides as xp,t as _,tCount as $i}from"@seatlayer/core";import{isAuthoredSeatView as Sp,seatViewDisclosure as kp}from"@seatlayer/core/view3d/crossfade/panorama";function ys(n){return!!n&&n.clientWidth>0&&n.scrollWidth>n.clientWidth+1}function Kc(n){return n.some(e=>ys(e))}var ki="data-fit-gone",Wc=12;function gn(n,e,t=ys){if(!n)return 0;for(let i of e)n.classList.remove(i.cls);if(n.querySelectorAll(`[${ki}]`).forEach(i=>{i.removeAttribute(ki),i.hidden=!1}),n.dataset.fit="0",n.clientWidth<=0||!t(n))return 0;for(let i=0;i<e.length;i+=1){let o=e[i];i>0&&n.classList.remove(e[i-1].cls),n.classList.add(o.cls),n.dataset.fit=String(i+1);let s=o.give?o.give(n):!0;if(!t(n))return i+1;if(o.repeat&&o.give){for(let r=1;s&&r<Wc;r+=1)if(s=o.give(n),!t(n))return i+1}}return e.length}function Yc(n,e="[data-fit-seg]"){let t=[...n.querySelectorAll(e)].filter(i=>!i.hidden);return t.length<2?!1:vs(t[t.length-1])}function Xc(n,e){let t=n.querySelector(e);return t&&!t.hidden?vs(t):!1}function vs(n){let e=n.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(ki,""),e.hidden=!0),n.setAttribute(ki,""),n.hidden=!0,!0}function Zc(n){if(!n)return!1;let e=(n.getAttribute("aria-label")||n.textContent||"").trim();return e?(n.setAttribute("aria-label",e),n.setAttribute("title",e),!0):!1}function ws(n){if(!n)return 0;let e=n.querySelector(".sl-confirm-cancel"),t=n.querySelector(".sl-confirm-add-t");return gn(n,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>Zc(e)}],()=>Kc([e,t]))}function xs(n){return gn(n,[{cls:"sl-fit-notype",give:e=>Xc(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>Yc(e),repeat:!0}])}function Ss(n){return n?(n.classList.add("sl-fitpill"),gn(n,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var Qc=["on-sale","low","sold-out","presale","closed"];function Dt(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function Ts(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function ks(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n,t=e.count,i=e.index;if(typeof i!="number"||!Number.isInteger(i)||i<1||typeof t!="number"||!Number.isInteger(t)||t<i)return;let o=e.remaining;if(o!=null&&(typeof o!="number"||!Number.isInteger(o)||o<0))return;let s={index:i,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=Ts(e[r]);if(a===void 0)return;s[r]=a}return s}function Jc(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],i=new Set;for(let 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||i.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 m=d,p=typeof m.categoryKey=="string"?m.categoryKey.trim():"",f=m.tierId===null?null:typeof m.tierId=="string"&&m.tierId.trim()?m.tierId.trim():void 0,y=Dt(m.price);if(!p||f===void 0||y===void 0||y===null)return;let T=`${p}\0${f??""}`;if(h.has(T))return;h.add(T),c.push({categoryKey:p,tierId:f,price:y})}i.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)||!i.has(c))return;s.add(l),o.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:o}}function bn(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=Qc.find(h=>h===e.state);if(!t)return null;let i=Dt(e.fromPrice),o=Dt(e.previousPrice);if(i===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=ks(e.release);if(r===void 0)return null;let a=e.upcoming===void 0?null:ks(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 m=d,p=typeof m.categoryKey=="string"?m.categoryKey.trim():"";if(!p)return null;let f=Dt(m.price),y=Dt(m.previousPrice);if(f==null||y===void 0)return null;let T={categoryKey:p,price:f,previousPrice:y};if(m.offerId!==void 0){if(typeof m.offerId!="string"||!m.offerId.trim())return null;T.offerId=m.offerId.trim()}if(m.offerName!==void 0){if(typeof m.offerName!="string"||!m.offerName.trim())return null;T.offerName=m.offerName.trim()}if(m.remaining!==void 0){if(m.remaining!==null&&(typeof m.remaining!="number"||!Number.isInteger(m.remaining)||m.remaining<0))return null;T.remaining=m.remaining==null?null:m.remaining}for(let S of["startsAt","endsAt"]){if(m[S]===void 0)continue;let v=Ts(m[S]);if(v===void 0)return null;T[S]=v}h.push(T)}l=h}let c=Jc(e.channelPricing);return c===void 0?null:{state:t,fromPrice:i,previousPrice:o,currency:s,release:r,upcoming:a,prices:l,channelPricing:c}}function Es(n){return n?.changed!==!1}function Cs(n,e){if(!n)return null;let t=null,i=o=>{o!=null&&o>e&&(t===null||o<t)&&(t=o)};for(let o of[n.release,n.upcoming])i(o?.startsAt),i(o?.endsAt);for(let o of n.prices)i(o.startsAt),i(o.endsAt);return t}function yn(n){let e={};for(let t of n?.prices??[])e[t.categoryKey]=t.price;return e}function As(n){return n.focusedSection!==null?n.deeperThanSectionFrame===!1?"venue":"section":n.atVenueFit!==void 0?n.atVenueFit?"none":"venue":n.seatsRevealed?"venue":"none"}function Ps(n,e,t=[],i=8){let o=e.reduce((r,a)=>!a||a.width<=0||a.height<=0?r:Math.max(r,a.bottom-n.top+i),0),s=t.reduce((r,a)=>!a||a.width<=0||a.height<=0?r:Math.max(r,n.bottom-a.top+i),o>0?i:0);return{top:Math.max(0,Math.ceil(o)),right:0,bottom:Math.max(0,Math.ceil(s)),left:0}}function Ls(n){let e=document.createElement("div");e.className="sl-floors on",e.setAttribute("role","group"),e.setAttribute("aria-label",n.tf("picker.chooseLevel","Choose level"));let t=[{id:"",name:n.tf("picker.allLevels","All levels")},...n.floors.map(r=>({id:r.id,name:r.name}))],i=document.createElement("span");i.className="sl-floor-label",i.textContent=`${n.tf("picker.levels","Level")}:`,e.appendChild(i);let o=document.createElement("select");o.className="sl-floor-select",o.setAttribute("aria-label",n.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=n.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",()=>n.onChoose(o.value)),e.appendChild(o),e}function Ms(n,e,t){if(!n)return;let i=t?"":e,o=n.querySelector(".sl-floor-select");o&&(o.value=i)}var Ti=class{constructor(e){this.el=null;this.current=null;this.collapsed=!1;this.shownAt=0;this.host=e}get summary(){return this.current}adopt(e){this.current=e}get element(){return this.el}show(e){if(e&&e.id!==this.current?.id&&this.host.collapseSheet(),this.current=e,!e){this.el?.remove(),this.el=null,this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}render(e){this.el?.remove(),this.el=null}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,i=this.host.map();if(!e||!t||!i)return 0;let o=this.host.activeFloorObjects().find(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 m=i.getBoundingClientRect(),p=e.getBoundingClientRect(),f=p.left-m.left,y=p.top-m.top,T=Math.max(0,Math.min(f+p.width,l+h)-Math.max(f,l)),S=Math.max(0,Math.min(y+p.height,c+d)-Math.max(y,c));return T*S/(h*d)}};import{t as Tn,tCount as ud}from"@seatlayer/core";import{contrastRatio as md}from"@seatlayer/core/core/color";import{t as Hs,tCount as Ei}from"@seatlayer/core";function vn(n,e,t){try{return new Intl.DateTimeFormat(e,{...t,...n.timezone?{timeZone:n.timezone}:{}}).format(new Date(n.startsAt))}catch{return new Date(n.startsAt).toLocaleString(e)}}var Ci=(n,e)=>vn(n,e,{dateStyle:"medium"}),Ai=(n,e)=>vn(n,e,{timeStyle:"short"}),Pi=(n,e)=>vn(n,e,{weekday:"short",day:"numeric",month:"short"});function Rs(n,e,t,i){return!n.length||n.length>=e?null:{summary:i,labels:n.map(o=>`${Ci(o,t)} \xB7 ${Ai(o,t)}`)}}function ed(n,e){let t=new Set(e);return n.map(i=>({...i,free:!t.has(i.eventKey)}))}function Is(n,e){let t=[...n];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function td(n,e,t="",i=!1){if(!n.length)return"";let o=n.map(s=>{let r=s.free?e.free:e.blocked,a=i&&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 id(n){return n.selectPartialLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${E(n.selectPartialLabel)}</button>`:n.switchLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${E(n.switchLabel)}</button>`:n.switchLabel||n.selectPartialLabel?"":`<p class="sl-tip-advice">${E(n.advice)}</p>`}function nd(n){return Number(n.available)+Number(n.selected)+Number(n.partial)+Number(n.unavailable)}function Os(n,e,t){if(nd(n)<2)return"";let i=(s,r,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${s}"${a}></i>${E(r)}</li>`,o=[];return n.available&&o.push(i("sl-pg-sw-free",e.available,` style="background:${E(t)}"`)),n.selected&&o.push(i("sl-pg-sw-sel",e.selected)),n.partial&&o.push(i("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${E(t)}"`)),n.unavailable&&o.push(i("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${E(e.title)}">${o.join("")}</ul>`}function _s(n,e){if(!n.length)return"";let t=n.map(i=>{let o=i.labels.length?i.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${i.labels.length?"":" empty"}${i.active?" active":""}" role="button" tabindex="0"${i.active?' aria-current="true"':""} data-event-key="${E(i.eventKey)}"><span class="n">${E(i.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 wn(n,e){if(n?.kind!=="partial"||!e?.length)return null;let t=n.data?.blockedEventKeys??[],i=ed(e,t);return{states:i,missing:i.filter(o=>!o.free).map(o=>o.shortDate)}}function Ns(n,e){return n?td(n.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:Hs("picker.group.notAvailableOn",{dates:Is(n.missing,e.locale)})},id({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 od(n,e,t,i){if(!n.length)return"";let o=new Set(e),s=new Set(t),r=n.map(a=>{let l=o.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${E(a.eventKey)}" aria-label="${E(`${a.shortDate}: ${l?i.available:i.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?i.available:i.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${E(i.title)}</legend><p class="sl-confirm-dates-copy">${E(i.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${E(i.selectAll)}</span></label><ul>${r}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function Ds(n,e,t,i){let o=e.availableEventKeys(t);return od(n,o,e.includedEventKeys(),{title:i("picker.group.confirmDatesTitle","Choose performance dates"),copy:o.length===n.length?i("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(n.length)):i("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(n.length)),selectAll:i("picker.group.confirmSelectAll","Select all available dates"),available:i("picker.group.nightFree","Available"),unavailable:i("picker.group.nightBlocked","Unavailable")})}function Bs(n){return[...n.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function Fs(n,e,t,i){let o=[...n.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!o.length)return;let s=n.querySelector(".sl-confirm-add"),r=n.querySelector("[data-pg-confirm-all]"),a=()=>{let l=o.filter(d=>!d.disabled),c=Bs(n).length;r&&(r.checked=c===l.length,r.indeterminate=c>0&&c<l.length);let h=n.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"),i()};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 Vs(n,e,t){if(!n||!t||!n.querySelector("[data-pg-confirm-event-key]"))return!0;let i=Bs(n);if(!i.length)return!1;let o=n.querySelector(".sl-confirm-add");return o?.setAttribute("aria-busy","true"),o&&(o.disabled=!0),await t.apply(e,i)?!0:(o?.removeAttribute("aria-busy"),o?.isConnected&&(o.disabled=!1),!1)}function zs(n,e,t){return n?Hs("picker.group.seatPartlyAvailable",{label:e,free:n.states.length-n.missing.length,total:n.states.length,dates:Is(n.missing,t)}):""}function $s(n,e){let t=n.map((i,o)=>{let s=i.state==="done"?e.done:i.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${E(i.id)}" data-state="${E(i.state)}"${i.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${i.state==="done"?"\u2713":String(o+1)}</span><span class="l">${E(i.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 xn(n,e){return`<ul class="sl-pg-cards">${n.map(i=>`<li class="sl-pg-card" data-event-key="${E(i.eventKey)}"><span class="n">${E(i.name)}</span><time datetime="${E(i.iso)}"><span class="d">${E(i.date)}</span><span class="t">${E(i.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${E(e)}</p>`}function js(n){let e=n.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(", "):n.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${E(n.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(n.note?`<p class="sl-pg-pane-note">${E(n.note)}</p>`:"")+(n.total?`<div class="sl-pg-pane-total"><span>${E(n.total.label)}</span><b>${E(n.total.amount)}</b></div>`:"")+(n.holdStatus?`<p class="sl-pg-hold-status" role="status">${E(n.holdStatus)}</p>`:"")}function Gs(n){let e=Math.max(0,n);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function Us(n,e){if(!n||n.seats<=0)return"";if(e==="same_seat"){let t=n.perPerformance??n.seats;return n.totalPerformances&&n.performances<n.totalPerformances?Ei("picker.group.performancesChosenOf",t,{chosen:n.performances,total:n.totalPerformances}):Ei("picker.group.seatsEveryPerformance",t)}return n.perPerformance!=null&&n.performancesChosen===n.performances?Ei("picker.group.seatsPerPerformance",n.seats,{per:n.perPerformance}):Ei("picker.group.performancesChosenOf",n.seats,{chosen:n.performancesChosen,total:n.performances})}function qs(n,e){n.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let i=()=>e(t.dataset.eventKey);t.addEventListener("click",i),t.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),i())})})}import{t as sd}from"@seatlayer/core";function _e(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function rd(n,e){let t=n.objectType==="table"&&!!n.bookingMode,i=n.objectType==="booth",o=t||i||!n.seatNumber,s=o?n.rowLabel??n.displayLabel??n.label:n.seatNumber,r=t?`${b("picker.guests","Guests")} ${n.bookingMode==="variable"?`${n.minOccupancy}\u2013${n.maxOccupancy}`:n.capacity}`:!i&&n.rowLabel?`${e} ${K(n)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${o?" name":""}">${_e(s)}</span>`+(r?`<span class="sl-tip-row">${_e(r)}</span>`:"")+"</div>"+(n.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${b("picker.section","Section")}</span><span class="sl-tip-secname">${_e(n.sectionLabel)}</span></div>`:"")+"</div>"}function Ks(n,e){let t=n.status==="not_for_sale",i=n.mark?.kind==="partial",o=n.status==="free"||i?"":`<span class="sl-tip-tag">${t?b("picker.notAvailable","Not available"):n.status==="held"?sd("map.statusHeld"):b("picker.sold","Sold")}</span>`,s=t?"":e.price,r=s?`<span class="sl-tip-amt">${_e(s)}</span>`:"",a=!s&&e.priceNote?`<div class="sl-tip-note">${_e(e.priceNote)}</div>`:"",l=$e(n,{compact:!0}),c=e.reason?`<div class="sl-tip-reason">${_e(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+rd(n,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${_e(n.categoryColor)}"></span><span class="sl-tip-name">${_e(n.categoryLabel)}</span>`+o+r+"</div>"+a+c+l+(e.extra??"")}function Ws(n,e,t,i){let o=n.x+14,s=n.y-i.height-12,r=n.y+18,a=s;o+i.width>e-8&&(o=n.x-i.width-14),s<8&&r+i.height<=t-8&&(a=r);let l=Math.max(8,t-i.height-8);return{left:Math.max(8,Math.min(o,Math.max(8,e-i.width-8))),top:Math.max(8,Math.min(a,l))}}function Ys(n,e,t,i=22){let o=Math.max(8,Math.min(n.x-t.width/2,Math.max(8,e.width-t.width-8))),s=n.y-i-t.height,r=n.y+i;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 Sn=14,ad=12,ld=12,cd=8;function Xs(n,e,t,i=ad){let o=e.height-Sn-t.height,s=ld,r=o-i;if(r<=s)return{placement:"sheet",nudgeY:0};let a=(s+r)/2-n;return Math.abs(a)<=cd?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function Zs(n,e,t,i,o=0){let s=t.width/2+12,r=Math.max(s,Math.min(e.width-s,n.x)),a=n.y+o+t.height+24<=e.height,l=n.y-o<t.height+24&&a?"below":"above",c=l==="above"?n.y-o:n.y+o,h=i&&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 Qs(n,e,t){let i=n.querySelector("[data-pg-select-partial]"),o=[...n.querySelectorAll("[data-pg-event-key]")],s=()=>o.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),r=()=>{if(!i)return;let a=s().length;i.disabled=a===0,i.textContent=e?.(a)??i.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())})}),i?.addEventListener("click",()=>{let a=s();a.length&&t?.(a)})}function Ue(n){let e=n?.displayType?.trim()||n?.rowType?.trim();return e||(n?.objectType==="table"?b("picker.table","Table"):n?.objectType==="booth"?b("picker.booth","Booth"):b("picker.row","Row"))}var dd="sl-confirm-scrim",pd="--sl-scrim-mask";function hd(n){let e=Math.round(n.x),t=Math.round(n.y);return`radial-gradient(circle at ${e}px ${t}px, transparent 0 56px, #000 88px)`}function Js(n,e,t,i){let o=n??document.createElement("div");return n||(o.className=dd),o.style.setProperty(pd,hd(i)),t.parentNode===e?o.nextSibling!==t&&e.insertBefore(o,t):o.parentNode!==e&&e.appendChild(o),o}function kn(n){return n?.remove(),null}var er={passport:!1,compare:!1},fd=360,gd=160,bd=700,tr=450;function ir(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function yd(n){return md("#ffffff",n)>=3?"#ffffff":"#0b0f19"}var Li=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 i=gt(e)?e.viewUrl??"":"",o=xi(t);if(!i&&!o)return"";let s=i?null:Si(e,e.focalPoint??t.focalPoint);if(!i&&s==null)return"";let r="";if(!i)return r;let a=O(Tn("picker.viewFromSeat",{label:e.label})),l=O(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 i=this.host;this.mode=t;let o=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,i.root()?.setAttribute("data-confirming","true"),i.els().side?.toggleAttribute("inert",!0),Object.values(i.regions()).forEach(P=>P.toggleAttribute("inert",!0)),i.controller.setSelectionFocus(e.id),o&&o!==e.id&&i.controller.deselect([o]),i.hideTooltip();let s=i.controller.seatDetails(e.id),r=i.controller.doc?.categories.find(P=>P.key===e.categoryKey),a=s?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),l=a!=null?i.paidPrice(e.categoryKey,s?.tierId??r?.tiers?.[0]?.id??null,a,e.label):void 0,c=yo(s,e.displayLabel??e.label,Ue(s)),h=s?.tiers??r?.tiers??[],d=s?.tierId??h[0]?.id,m=i.suppressPricing()?"":So(h,d,P=>i.money(i.paidPrice(e.categoryKey,P.id,P.price,e.label))),p=i.buyerView()==="venue3d",f=i.performanceGroup()?.confirmDateSelection??void 0,y=f?i.performanceGroup()?.nights?.()??[]:[],T=f?Ds(y,f,e.id,(P,I)=>i.tf(P,I)):"";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",Tn("picker.confirmSeatLabel",{label:e.label}));let v=i.controller.getRenderer?.()?.categoryDisplayColor?.(e.categoryKey)??r?.color??"#6e7bff";S.style.setProperty("--sl-cat",v),S.style.setProperty("--sl-cat-ink",yd(v));let A=String(s?.categoryLabel??r?.label??e.categoryKey),D=i.controller.categoryAvailability()[e.categoryKey],G=typeof D=="number"&&D>0?ud("picker.leftCount",D):"",g=i.suppressPricing()?`${s?.displayLabel??e.displayLabel??e.label}`:`${s?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?i.tf("picker.priceNotSupplied","Price not supplied"):i.money(l)}`,L=er.passport?bo(e,g,p):"",N=er.compare?go(e,p?i.view3dCompareSeatIds():null):"";S.innerHTML=ko({identityFields:c,identity:vo(s,e.displayLabel??e.label,Ue(s)),marker:fo({...s?.wheelchairSpaceType?{wheelchairSpaceType:s.wheelchairSpaceType}:{}}),see3dPill:wo(i.canOffer3d(),p),categoryColor:v,categoryLabel:A,priceLabel:!i.suppressPricing()&&l!=null?i.money(l):"",categoryLeftLabel:G,tierChoices:m,groupDates:T,wheelchair:"",commercial:$e({...e.accessibility?.length?{accessibility:e.accessibility}:{},...s?.wheelchairSpaceType?{wheelchairSpaceType:s.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{}}),thumb:i.seatViewEnabled()&&i.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:p?`<div class="sl-confirm-inspect-row">${L}${N}${Ji(i.canOffer3d(),p)}</div>`:Ji(i.canOffer3d(),p),see3dRow:xo(i.canOffer3d(),p),cancelLabel:Tn("common.cancel"),selectLabel:t==="remove"?i.tf("picker.removeSeat","Remove seat"):i.addSeatLabel(s?.objectType)}),t==="remove"&&S.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),i.els().map.appendChild(S),this.el=S;let C=S.querySelector(".sl-confirm-thumb"),R=C?.closest(".sl-confirm-thumbwrap")??null;if(C&&R){let P=!1,I=()=>{if(P||!R.isConnected)return;P=!0;let j=()=>{R.remove(),this.el===S&&i.reanchor()};if(i.reducedMotion()||typeof requestAnimationFrame!="function"){j();return}R.style.height=`${R.offsetHeight}px`,R.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{R.style.height="0px",R.style.opacity="0"}),setTimeout(j,gd)};C.addEventListener("error",I),C.addEventListener("load",()=>{C.naturalWidth||I()});let $=e.viewMeta?.previewUrl??e.viewUrl;$?i.resolveAssetUrl($).then(j=>{if(!(!S.isConnected||this.el!==S)){if(!j){I();return}C.src=j}}).catch(j=>{I(),i.onError(j)}):I()}i.reanchor(),this.liftSeatClearOfSheet(e),S.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{i.openSeatView(e)}),S.querySelector(".sl-confirm-confidence")?.addEventListener("click",P=>{i.openSeatConfidencePassport(e,P.currentTarget instanceof HTMLElement?P.currentTarget:null)}),S.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>i.saveView3dComparisonSeat(e)),S.querySelectorAll("[data-confirm-tier]").forEach(P=>{P.addEventListener("click",()=>{let I=P.dataset.confirmTier,$=h.find(ue=>ue.id===I);if(!$)return;i.controller.setSeatTier(e.id,$.id),S.querySelectorAll("[data-confirm-tier]").forEach(ue=>{ue.setAttribute("aria-pressed",String(ue===P))});let j=S.querySelector(".sl-confirm-price");j&&(j.textContent=i.money(i.paidPrice(e.categoryKey,$.id,$.price,e.label))),i.reanchor()})}),S.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(P=>{P.addEventListener("pointerdown",Qt,{once:!0}),P.addEventListener("click",()=>{i.buyerView()==="venue3d"?(i.dismiss(),i.view3dHandle()?.flyToSeat(e.id)):(i.rememberView3dReturnSeat(e),i.dismiss(),i.enter3d(e.id))})}),Fs(S,f,(P,I)=>i.tf(P,I),()=>i.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 P=S.querySelector(".sl-confirm-add");P?.focus(),i.liftToastOverConfirm(),i.fitTranslatedRows(),i.inviteCommit(S,P)})}liftSeatClearOfSheet(e){let t=this.host.controller.getRenderer();this.framing={gestures:t?.getCameraGestureCount?.()??0,quietUntil:0},this.frameSeatForSheet(e)}frameSeatForSheet(e){let t=this.host,i=t.root();if(!this.el||i?.dataset.layout!=="narrow"||i?.dataset.view3d==="on")return;let o=t.els().map;if(!o)return;let s=t.controller.worldToScreen({x:e.x,y:e.y}),r=t.controller.getRenderer(),a=r?.getCameraGestureCount?.()??0,{nudgeY:l}=Xs(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}),i=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=Js(this.scrim,i,this.el,t),_o(this.el,t,i),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=kn(this.scrim);let o=i.clientWidth,s=i.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=Zs(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`,li(this.el,t,{left:h.left,top:h.top,width:r,height:a})}ghostActivation(){return ir()?performance.now()-this.shownAt<tr:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,i=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=i;let o=t.root();setTimeout(()=>{this.outsideTap===i&&(o??document).addEventListener("pointerdown",i,!0)},ir()?tr: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=kn(this.scrim),this.settleLift(),this.el&&ci(this.el),this.el=null,this.seat=null,e.liftToastOverConfirm(),e.root()?.removeAttribute("data-confirming"),Object.values(e.regions()).forEach(t=>t.toggleAttribute("inert",!1)),e.applyPanelCollapsed(),e.controller.setSelectionFocus(null),e.syncTray()}async commit(){let e=this.host,t=this.seat;if(!t)return;let o=this.el?.querySelector(".sl-confirm-add")??null;if(o?.classList.contains("is-adding")||!await Vs(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);pn(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,fd)}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;if(!t)return;let i=e.releaseHeldSeat(t);i||e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0})}};function nr(n,e,t){if(!e||t||n.classList.contains("sl-confirm-removing"))return;e.classList.add("sl-confirm-add-invite");let i=()=>e.classList.remove("sl-confirm-add-invite");n.addEventListener("pointerdown",i,{once:!0}),n.addEventListener("keydown",i,{once:!0}),e.addEventListener("focus",i,{once:!0})}function or(n,e){return n&&n!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}import{pointInPolygon as vd}from"@seatlayer/core";import{createMinimapTransform as wd,minimapPointToWorld as xd,minimapViewportPlan as Sd}from"@seatlayer/core/picker/minimapGeometry";function kd(n){let e={inactive:0,available:1,selected:2},t=new Map;for(let o of n){let s=t.get(o.id);(!s||e[o.state]>e[s])&&t.set(o.id,o.state)}let i={selected:0,available:0,inactive:0};for(let o of t.values())i[o]+=1;return i}function Td(n,e){return n.x<=e.x&&n.y<=e.y&&n.x+n.width>=e.x+e.width&&n.y+n.height>=e.y+e.height}function sr(n,e){let t=new En(n);return t.build(e),t}var En=class{constructor(e){this.host=e;this.miniCanvas=null;this.miniBase=null;this.miniWrap=null;this.miniToggle=null;this.miniLabel=null;this.miniTf=null;this.miniDrag=null;this.miniSuppressClick=!1;this.userClosed=!1}dispose(){this.miniToggle?.remove(),this.miniWrap?.remove(),this.miniToggle=null,this.miniWrap=null,this.miniCanvas=null,this.miniBase=null,this.miniLabel=null,this.miniTf=null,this.miniDrag=null,this.host.root()?.removeAttribute("data-minimap-open")}build(e){if(!this.host.controller.getViewport())return;let i=document.createElement("button");i.type="button",i.className="sl-minimap-toggle",i.setAttribute("aria-label",b("picker.openVenueMap","Open venue overview map")),i.setAttribute("aria-expanded","false"),i.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 6l5-2 8 3 5-2v13l-5 2-8-3-5 2zM8 4v13M16 7v13"/></svg>',e.appendChild(i),this.miniToggle=i;let 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,i.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,i=this.host.controller.getViewport()?.bounds;if(!e||!t||!i||!(i.width>0&&i.height>0))return;let o=196,s=146,r=6,a=i.width/Math.max(1,i.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=wd(i,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"),i=this.host.controller.getMinimapSnapshot().sections,s=i.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}=kd(i);this.miniWrap.setAttribute("aria-label",i.length?`${r}. ${a} selected, ${l} available, ${c} inactive sections.`:r),this.miniCanvas?.setAttribute("aria-label",i.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 i=e.getContext("2d");if(!i)return;i.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;i.beginPath(),d.outline.forEach((p,f)=>f===0?i.moveTo(o(p.x),s(p.y)):i.lineTo(o(p.x),s(p.y))),i.closePath();let m=d.paint;if(i.globalAlpha=d.state==="inactive"?.5:.92,m?i.fillStyle=m.fill:(i.globalAlpha=d.state==="inactive"?.18:d.state==="selected"?.72:.34,i.fillStyle=d.state==="inactive"?a:d.state==="selected"?l:c),i.fill(),i.globalAlpha=.82,i.lineWidth=Math.max(1,t.dpr),i.strokeStyle=m?.stroke||r,i.stroke(),d.owned){i.globalAlpha=1,i.lineWidth=Math.max(2,t.dpr*1.5),i.strokeStyle=l,i.stroke();let p=d.outline.reduce((f,y)=>({x:f.x+y.x,y:f.y+y.y}),{x:0,y:0});i.beginPath(),i.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),i.fillStyle=l,i.fill(),i.beginPath(),d.outline.forEach((f,y)=>y===0?i.moveTo(o(f.x),s(f.y)):i.lineTo(o(f.x),s(f.y))),i.closePath()}d.active&&(i.globalAlpha=1,i.lineJoin="round",i.lineWidth=Math.max(4,t.dpr*3.5),i.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",i.stroke(),i.lineWidth=Math.max(2,t.dpr*1.75),i.strokeStyle=l,i.stroke())}if(i.globalAlpha=1,!h.sections.length){let d=Math.max(1,t.dpr),m=this.host.controller.getRenderer?.(),p=new Map,f=y=>{let T=p.get(y);if(T)return T;let S=m?.categoryDisplayColor?.(y)||c;return p.set(y,S),S};for(let y of h.seats)i.globalAlpha=y.state==="inactive"?.22:.78,i.fillStyle=y.state==="inactive"?a:y.state==="selected"?l:f(y.categoryKey),i.beginPath(),i.arc(o(y.x),s(y.y),d,0,Math.PI*2),i.fill();i.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,t=this.miniBase,i=this.miniTf;if(!e||!t||!i)return;let o=e.getContext("2d");if(!o)return;o.clearRect(0,0,e.width,e.height),o.drawImage(t,0,0);let s=this.host.controller.getViewport();if(!s||Td(s.visible,s.bounds))return;let r=Sd(s.visible,i,e.width,e.height,Math.max(2,i.dpr*2)),a=this.host.cssVar("--sl-text")||"#12151c",l=this.host.cssVar("--sl-surface")||"#fff";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,i.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,i.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,i.dpr*3),Math.max(2,i.dpr*2)]),o.strokeRect(r.clipped.x,r.clipped.y,r.clipped.width,r.clipped.height)),o.restore()}minimapWorldPoint(e){let t=this.miniCanvas,i=this.miniTf;if(!t||!i)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{...xd({x:s,y:r},i),px:s,py:r}}minimapPointerDown(e){let t=this.minimapWorldPoint(e),i=this.host.controller.getViewport()?.visible;!t||!i||!(t.x>=i.x&&t.x<=i.x+i.width&&t.y>=i.y&&t.y<=i.y+i.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:t.x-(i.x+i.width/2),offsetY:t.y-(i.y+i.height/2),startX:e.clientX,startY:e.clientY,moved:!1},this.miniCanvas?.setPointerCapture(e.pointerId),this.miniCanvas?.classList.add("sl-dragging"),e.preventDefault())}minimapPointerMove(e){let t=this.miniDrag;if(!t||t.pointerId!==e.pointerId)return;let i=this.minimapWorldPoint(e);i&&(!t.moved&&Math.hypot(e.clientX-t.startX,e.clientY-t.startY)>2&&(t.moved=!0,this.host.controller.clearSectionFocus()),this.host.controller.panToWorld({x:i.x-t.offsetX,y:i.y-t.offsetY}),e.preventDefault())}minimapPointerUp(e){let t=this.miniDrag;!t||t.pointerId!==e.pointerId||(this.miniSuppressClick=t.moved,this.miniDrag=null,this.miniCanvas?.classList.remove("sl-dragging"),this.miniCanvas?.hasPointerCapture(e.pointerId)&&this.miniCanvas.releasePointerCapture(e.pointerId))}minimapKeydown(e){let t=this.host.controller.getViewport()?.visible;if(!t)return;if(e.key==="Home"){this.host.controller.overview(),e.preventDefault();return}let i=e.key==="ArrowLeft"?-t.width*.2:e.key==="ArrowRight"?t.width*.2:0,o=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!i&&!o||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+i,y:t.y+t.height/2+o}),e.preventDefault())}minimapJump(e){let t=this.minimapWorldPoint(e);if(t){for(let i of this.host.controller.getMinimapSnapshot().sections)if(!(i.state==="inactive"||i.outline.length<3)&&vd(t,i.outline)){this.host.controller.focusSection(i.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};import{t as Cn}from"@seatlayer/core";var Ed=12;function rr(n,e){let t=e.floors(),i=new Set(t.map(g=>g.label.trim().toLocaleLowerCase())),o=e.zones().filter(g=>g.seatCount>0&&!i.has(g.label.trim().toLocaleLowerCase())),s=e.sections().filter(g=>g.seatCount>0&&!i.has(g.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,m=document.createElement("button");m.type="button",m.className="sl-view3d-nav-toggle",m.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");m.innerHTML=p,m.appendChild(f);let y=()=>{for(let g of h.querySelectorAll(":scope > div")){let L=g.querySelector('[aria-pressed="true"]');!L||g.scrollWidth<=g.clientWidth||L.scrollIntoView({block:"nearest",inline:"nearest"})}},T=()=>{if(d)return d;for(let g of h.querySelectorAll(":scope > div")){let L=g.querySelector('button[aria-pressed="true"]'),N=L?.textContent?.trim();if(N&&L?.dataset.floor!=="")return N}return a&&(l||c)?b("picker.levelsAndAreas","Levels & areas"):a?b("picker.levels","Levels"):b("picker.areas","Areas")},S=g=>{h.classList.toggle("is-open",g),m.setAttribute("aria-expanded",String(g)),g&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(y),f.textContent=T()};m.addEventListener("click",()=>S(!h.classList.contains("is-open"))),h.addEventListener("keydown",g=>{g.key!=="Escape"||!h.classList.contains("is-open")||(g.preventDefault(),g.stopPropagation(),S(!1),m.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=b("picker.closeVenueNavigation","Close venue navigation");v.setAttribute("aria-label",A),v.title=A,v.addEventListener("click",()=>{S(!1),m.focus()}),S(!1),h.appendChild(m);let D=g=>{},G=g=>{};if(a){let g=document.createElement("div");g.setAttribute("role","group"),g.setAttribute("aria-label",b("picker.levels","Levels"));let L=[];G=R=>{L.forEach(P=>{P.setAttribute("aria-pressed",String((P.dataset.floor===""?null:Number(P.dataset.floor))===R))})};let N=R=>{e.focusFloor(R)&&(G(R),D(R))},C=(R,P)=>{let I=document.createElement("button");I.type="button",I.textContent=R,I.dataset.floor=P===null?"":String(P),I.setAttribute("aria-pressed",String(P===null)),I.addEventListener("click",()=>{N(P),S(!1)}),L.push(I),g.appendChild(I)};C(b("picker.allLevels","All levels"),null);for(let R of t)C(R.label||Cn("picker.levelNumber",{number:R.index+1}),R.index);h.appendChild(g)}if(l||c){let g=document.createElement("div");g.setAttribute("role","group"),g.setAttribute("aria-label",b("picker.areas","Areas"));let L=l?o.map(C=>({id:C.id,label:C.label||C.id,go:()=>{e.focusZone(C.id)}})):r.map(C=>({id:C.id,label:C.label||C.id,floorIndex:C.floorIndex,go:()=>{e.focusSection(C.id),Number.isFinite(C.floorIndex)&&G(C.floorIndex)}})),N=C=>{let R=l||C===null?L:L.filter(P=>P.floorIndex===void 0||P.floorIndex===C);if(g.replaceChildren(),!R.length){g.remove();return}if(g.isConnected||h.insertBefore(g,v.isConnected?v:null),!l&&R.length>Ed){let P=document.createElement("select");P.setAttribute("aria-label",b("picker.jumpToSection","Jump to section"));let I=document.createElement("option");I.value="",I.textContent=b("picker.jumpToSection","Jump to section"),P.appendChild(I);for(let $ of R){let j=document.createElement("option");j.value=$.id,j.textContent=$.label,P.appendChild(j)}P.addEventListener("change",()=>{R.find($=>$.id===P.value)?.go()}),g.appendChild(P);return}for(let P of R){let I=document.createElement("button");I.type="button",I.textContent=P.label,I.dataset.area=P.id,I.addEventListener("click",()=>{d=P.label,P.go(),S(!1)}),g.appendChild(I)}};D=N,N(null)}return h.appendChild(v),n.appendChild(h),h}var Mi=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 i=this.host.savedSeatIds().length,o=t.querySelector(".main");o&&(o.textContent=i>1?Cn("picker.compareCount",{count:i}):b("picker.oneSeatSaved","1 seat saved"),o.setAttribute("aria-label",i>1?Cn("picker.openComparisonOfSeats",{count:i}):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 ar(n){return!n?.querySelector('[data-ref="zfs"]')}var lr="sl:sheet-hint";function cr(n){let e=n.boot;if(!e?.isConnected)return;if(n.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),n.map?.appendChild(t),setTimeout(()=>t.remove(),650),n.rail?.classList.add("is-in"),n.root?.classList.add("is-arriving"),setTimeout(()=>{n.rail?.classList.remove("is-in"),n.root?.classList.remove("is-arriving"),Cd(n.root)},900)}function Cd(n){if(!n||n.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(lr))return;window.sessionStorage.setItem(lr,"1")}catch{}let e=n.querySelector(".sl-sheet-toggle");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function dr(n,e){n.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let i of e())if(i.open()){t.preventDefault(),t.stopPropagation(),i.close();return}}})}function Hi(n){let e=n.committedSelection(),t=n.controller.getGAAreas(),i=n.hold?.items??[],o=new Set(i.map(m=>m.label)),s=$o(n,t,i),r=Ie(n.gaQty,i),a=i.reduce((m,p)=>m+n.paidPrice(p.categoryKey,p.tierId,p.unitPrice,p.label)*(p.quantity??1),0),l=i.reduce((m,p)=>m+(p.quantity??1),0),c=e.filter(m=>!o.has(m.label)),h=c.reduce((m,p)=>m+n.paidPrice(p.categoryKey,p.tierId??null,p.price,p.label)*(p.quantity??1),0)+s+a,d=c.reduce((m,p)=>m+(p.quantity??1),0)+r+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:i,heldLabels:o,heldCount:l,total:h,count:d}}function Ri(n,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:n.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function Ii(n,e){let t=e.tiers?.length?e.tiers.map(i=>n.paidPrice(e.key,i.id??null,i.price)):e.price==null?[]:[n.paidPrice(e.key,null,e.price)];if(e.key)for(let i of n.pricesByChannel.values())for(let o of i)o.categoryKey===e.key&&t.push(o.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var Bt="seatlayer_";function Ad(){let n=globalThis;return n.document?.modelContext??n.navigator?.modelContext??null}function ce(n,e){return e?{ok:!1,reason:n,message:e}:{ok:!1,reason:n}}function Pd(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"&&!!e):[]}function Ld(n,e){let t=n.event();if(!t)return ce("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits();return{ok:!0,event:t,selection:{max:i.max,...i.required!=null?{required:i.required}:{}},categories:n.categories(),zones:n.zones(),hasPremiumSeats:n.hasPremiumSeats(),holdsAllowed:e}}function pr(n,e){let t=o=>!!o&&o.toLowerCase()===e.toLowerCase(),i=n.find(o=>t(o.key??o.id))??n.find(o=>t(o.label));return i?.key??i?.id??null}function hr(n,e){let t=e.map(i=>n.describeSeat(i.id));return{seatIds:e.map(i=>i.id),labels:e.map(i=>i.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((i,o)=>t[o]?.seat||i.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((i,o)=>i+o.price,0)}}function Md(n,e,t){let i=new Map;for(let s of e){let r=i.get(s.rowKey);r?r.push(s):i.set(s.rowKey,[s])}let o=[];for(let s of i.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(hr(n,r.slice(h,h+t)));a=l}}return o}function Hd(n,e,t){let i=new Map;for(let s of e){let r=i.get(s.sectionKey);r?r.push(s):i.set(s.sectionKey,[s])}let o=[];for(let s of i.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(hr(n,r.slice(0,t)))}return o}function Rd(n,e){if(!n.event())return ce("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits(),o=Math.floor(Number(e.count));if(!Number.isInteger(o)||o<1||o>i.max)return ce("bad_count",`count must be a whole number between 1 and ${i.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?pr(n.categories(),l):null;if(l&&!h)return ce("no_match",`No ticket type called "${l}".`);let d=c?pr(n.zones(),c):null;if(c&&!d)return ce("no_match",`No zone called "${c}".`);let m=n.seats().filter(y=>y.available);if(!m.length)return ce("sold_out");let p=m.filter(y=>(!h||y.categoryKey===h)&&(!d||y.zoneId===d)&&(a==null||y.price<=a));if(!p.length)return ce("no_match");let f=r?Md(n,p,o):Hd(n,p,o);return f.length?(f.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:f.slice(0,s),searched:{count:o,filters:{...a!=null?{max_price:a}:{},...h?{category:h}:{},...d?{zone:d}:{},together:r}}}):ce(r?"not_enough_together":"no_match")}function ur(n){return{ok:!0,...n.selection()}}function Id(n,e){let t=n.event();if(!t)return ce("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return ce("event_closed","Sales are closed for this event.");let i=Pd(e.seat_ids);return i.length?(n.clearSelection(),n.selectObjects(i),ur(n)):ce("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function Od(n,e){let t=async o=>{try{return await o()}catch(s){return ce("error",s instanceof Error?s.message:String(s))}},i=[{name:`${Bt}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(()=>Ld(n,e))},{name:`${Bt}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(()=>Rd(n,o))},{name:`${Bt}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(()=>Id(n,o))},{name:`${Bt}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(()=>ur(n))}];return e&&i.push({name:`${Bt}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>n.hold())}),i}async function mr(n,e={}){let t=Ad();if(!t||typeof t.registerTool!="function")return null;let i=new AbortController,o=Od(n,!!e.holds),s=[],r=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of o)await t.registerTool(a,{signal:i.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(i.abort(),typeof t.unregisterTool=="function")for(let a of s)try{t.unregisterTool(a)}catch{}}}:null}async function fr(n){let e=n.opts.webMcp;if(!e||n.destroyed)return;let t=typeof e=="object"&&!!e.holds,i=typeof e=="object"?e.exposedTo:void 0;try{n.webMcp=await mr(Pn(n,t),{holds:t,exposedTo:i}),n.destroyed&&An(n)}catch(o){console.warn("seatmap: WebMCP registration failed",o)}}function An(n){n.webMcp?.dispose(),n.webMcp=null}function Pn(n,e){let t=(i,o)=>{if(Number.isInteger(i.logicalSeatIndex))return i.logicalSeatIndex;let s=i.id.lastIndexOf(":"),r=s<0?NaN:Number(i.id.slice(s+1));return Number.isFinite(r)?r:o};return{event:()=>{let i=n.renderInfo;return i?{name:i.eventName??"",venue:i.venue??null,startsAt:i.startsAt??null,timezone:i.timezone??null,currency:n.currency,salesClosed:n.salesClosed}:null},selectionLimits:()=>({max:n.maxTickets,required:n.exactTickets}),categories:()=>{let i=n.controller.categoryAvailability();return(n.controller.doc?.categories??[]).filter(o=>!o.notForSale).map(o=>{let s=Ii(n,o),r=Ri(n,o);return{key:o.key,label:o.label??o.key,...r===void 0?{}:{price:r},...s&&s.min!==s.max?{priceRange:s}:{},available:i[o.key]??0}})},zones:()=>n.controller.getBestAvailableZones(),hasPremiumSeats:()=>n.controller.hasPremiumSeats(),seats:()=>{let i=n.controller.getActiveFloorId(),o=[];return n.allSeats().forEach((s,r)=>{if(s.floorId&&i&&s.floorId!==i)return;let a=n.controller.getStatus(s.id)??"free",l=n.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:n.paidPrice(s.categoryKey,l?.tiers?.[0]?.id??null,c,s.label),...s.zoneId?{zoneId:s.zoneId}:{},available:a==="free"&&!l?.notForSale})}),o},describeSeat:i=>{let o=n.controller.seatDetails(i);return o?{section:o.sectionLabel??"",row:K(o)??"",seat:o.seatNumber??o.label,category:o.categoryLabel??o.categoryKey}:null},selection:()=>{let{freshSeats:i,total:o,count:s}=Hi(n);return{seats:i.map(r=>({id:r.id,label:r.label,section:r.sectionLabel??"",row:K(r)??"",seat:r.seatNumber??r.label,category:r.categoryKey,price:n.paidPrice(r.categoryKey,r.tierId??null,r.price,r.label)})),count:s,total:o,currency:n.currency,hold:n.hold?{id:n.hold.holdId,expiresAt:n.hold.expiresAt}:null,validity:n.getSelectionValidity()}},clearSelection:()=>n.clearSelection(),selectObjects:i=>{n.selectObjects(i)},hold:()=>e?_d(n):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function _d(n){if(n.salesClosed)return{ok:!1,reason:"event_closed"};if(!n.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=n.controller.getSelectionValidity(n.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await n.handleCta(),n.hold?{ok:!0,hold:{id:n.hold.holdId,expiresAt:n.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function Ln(n){return{renderingTimeMillis:n.ms,performanceProfile:n.performanceProfile,seatCount:n.seatCount,objectCount:n.objectCount,sectionCount:n.sectionCount,view:n.view,eventKey:n.eventKey,chartName:n.chartName,floorCount:n.floorCount,transport:n.transport,load:n.load,metricScope:n.metricScope,operationalTelemetryReporter:"sdk"}}function gr(n,e){Ce({apiBase:n.apiBase,event:n.eventKey,scope:n.metricScope,surface:n.surface,outcome:"success",ms:n.ms,performanceProfile:n.performanceProfile,chartDelivery:n.chartDelivery,seats:n.seatCount,floors:n.floorCount,view:n.view,load:n.load,transport:n.transport}),e("chart_rendered",Ln(n))}import{seatConfidenceDisclosure as Nd}from"@seatlayer/core/core/seatConfidence";function J(n){return String(n??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function br(n){let e=Nd(n.seat.confidenceEvidence),t=n.seat.confidenceEvidence,i=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${J(c)}</li>`).join("")}</ul>`:"",o=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${J(e.modeledTarget)}</dd></div>`:"",s=t?`<div><dt>Evidence ID</dt><dd>${J(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${J(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${J(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${J(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${J(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",r=ii(n.seat.commercial).join(" \xB7 ")||n.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${J(r)}</dd></div>`+(n.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${J(n.seat.commercial.note)}</dd></div>`:""),l=n.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${J(n.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${J(e.headline)}</strong><span>${J(e.coverage)} \xB7 ${J(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${J(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${J(e.reality)}</dd></div><div><dt>Source</dt><dd>${J(e.provenance)}</dd></div>`+a+o+s+`</dl>${i}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function yr(n){return n?n.closest("[data-report]")?"report":n.closest("[data-close]")||n.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function Oi(n,e,t){let i=n?.querySelector("[data-report]"),o=n?.querySelector("[data-report-status]");i&&(i.disabled=e!=="failed",i.textContent=e==="received"?"Report received":"Report this view"),o&&(o.setAttribute("role",e==="failed"?"alert":"status"),o.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function Mn(n,e,t=null){let i=n.view3dEl;if(!i)return;Ft(n,!1);let o=e.confidenceEvidence,s=n.controller.seatDetails(e.id),r=document.createElement("div");r.className="sl-view3d-passport-shell",r.innerHTML=br({seat:e,title:s?.displayLabel??e.displayLabel??e.label,restrictionFallback:n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof n.api.reportViewEvidence=="function"});let a=[...new Set([...i.children,...[...n.els.map.children].filter(m=>m!==i)])].filter(m=>m instanceof HTMLElement),l=a.map(m=>({element:m,inert:m.inert,ariaHidden:m.getAttribute("aria-hidden")}));for(let m of a)m.inert=!0,m.setAttribute("aria-hidden","true");i.appendChild(r),i.classList.add("has-passport"),n.view3dPassportEl=r;let c=r.querySelector(".sl-view3d-passport"),h=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],d=m=>{if(m.key==="Escape"){m.preventDefault(),m.stopPropagation(),m.stopImmediatePropagation(),Ft(n);return}if(m.key!=="Tab")return;let p=h();if(!p.length)return;let f=p[0],y=p[p.length-1];m.shiftKey&&document.activeElement===f?(m.preventDefault(),y.focus()):!m.shiftKey&&document.activeElement===y&&(m.preventDefault(),f.focus())};window.addEventListener("keydown",d,!0),n.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 m=t?.isConnected?t:n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareEl?.querySelector("[data-passport-seat]")??null,p=m?.closest(".sl-confirm,.sl-view3d-compare");p?.isConnected&&(p.inert=!1,p.removeAttribute("aria-hidden")),r.remove(),i.classList.remove("has-passport"),n.view3dPassportEl===r&&(n.view3dPassportEl=null);let f=m??n.view3dCompareEl?.querySelector("[data-passport-seat]")??n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareChip.mainButton();(t?.isConnected?t:f)?.focus()},r.addEventListener("click",m=>{let p=yr(m.target instanceof HTMLElement?m.target:null);p==="close"&&Ft(n),p==="report"&&Dd(n,e)}),requestAnimationFrame(()=>h()[0]?.focus()),n.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:o?.evidenceId??null,eventConfigurationId:o?.eventConfigurationId??null,modelLevel:o?.modelLevel??"unverified",realityLevel:o?.realityLevel??"none"})}async function Dd(n,e){if(n.api.reportViewEvidence){Oi(n.view3dPassportEl,"sending");try{let t=await n.api.reportViewEvidence(n.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});n.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),Oi(n.view3dPassportEl,"received",t.report.id)}catch{Oi(n.view3dPassportEl,"failed")}}}function Ft(n,e=!0){let t=n.view3dPassportCleanup;if(n.view3dPassportCleanup=null,!t){n.view3dPassportEl?.remove(),n.view3dPassportEl=null,n.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function vr(n){let e=n.view3dEl;if(!e||n.view3dCompareSeatIds.length<2)return;qe(n,!1);let t=n.view3dCompareSeatIds.map(p=>n.view3dComparisonSnapshot(p)).filter(p=>!!p);if(t.length<2){n.clearView3dComparison();return}let i=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>${i(p.label)}</strong><small>Section ${i(p.section)} \xB7 Row ${i(p.row)}</small><dl>`+(o?`<div><dt>Current price</dt><dd>${i(p.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${i(p.category)}</dd></div><div><dt>Availability</dt><dd>${i(p.availability)}</dd></div><div><dt>View source</dt><dd>${i(p.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${i(p.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${i(p.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${i(p.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${i(p.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${i(p.seat.id)}">Passport</button><button type="button" data-view-seat="${i(p.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${i(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"),n.view3dCompareEl=s;let h=s.querySelector(".sl-view3d-compare"),d=()=>[...h.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],m=p=>{if(p.key==="Escape"){p.preventDefault(),qe(n);return}if(p.key!=="Tab")return;let f=d();if(!f.length)return;let y=f[0],T=f[f.length-1];p.shiftKey&&document.activeElement===y?(p.preventDefault(),T.focus()):!p.shiftKey&&document.activeElement===T&&(p.preventDefault(),y.focus())};window.addEventListener("keydown",m),n.view3dCompareCleanup=()=>{window.removeEventListener("keydown",m);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"),n.view3dCompareEl===s&&(n.view3dCompareEl=null),a?.isConnected?a.focus():n.view3dCompareChip.mainButton()?.focus()},s.querySelector("[data-close]")?.addEventListener("click",()=>qe(n)),s.querySelectorAll("[data-passport-seat]").forEach(p=>p.addEventListener("click",()=>{let f=p.dataset.passportSeat,y=f?n.allSeats().find(T=>T.id===f):void 0;y&&Mn(n,y,p)})),s.querySelectorAll("[data-view-seat]").forEach(p=>p.addEventListener("click",()=>{let f=p.dataset.viewSeat;qe(n,!1),f&&n.view3dHandle?.flyToSeat(f)})),s.querySelectorAll("[data-select-seat]").forEach(p=>p.addEventListener("click",()=>{let f=p.dataset.selectSeat;f&&Bd(n,f)})),requestAnimationFrame(()=>d()[0]?.focus()),n.emit3dAnalytics("3d_comparison_opened",{seatIds:n.view3dCompareSeatIds.slice()})}function qe(n,e=!0){let t=n.view3dCompareCleanup;if(n.view3dCompareCleanup=null,!t){n.view3dCompareEl?.remove(),n.view3dCompareEl=null,n.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function Bd(n,e){if(n.salesClosed){n.toast(n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=n.allSeats().find(o=>o.id===e);if(!t)return;if(qe(n,!1),!n.controller.select([e]).length){n.syncSelectionTo3d(),n.toast(n.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}n.syncSelectionTo3d(),n.showConfirm(t),n.emit3dAnalytics("3d_comparison_selected",{seatId:e})}import{seatViewDisclosure as Ud}from"@seatlayer/core/view3d/crossfade/panorama";import{t as wr}from"@seatlayer/core";var Fd=900,Vd=450;function zd(n){switch(n){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 xr(n,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let i=b("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",i),t.title=i,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let o=document.createElement("div");o.className="sl-view3d-stop",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),n.append(t,o);let 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,n.classList.remove("is-seat-view")},Vd);return}n.classList.add("is-seat-view"),o.textContent=zd(a),o.classList.add("is-shown"),s=setTimeout(()=>{s=null,o.classList.remove("is-shown")},Fd)},dispose(){s&&(clearTimeout(s),s=null),r&&(clearTimeout(r),r=null),t.remove(),o.remove(),n.classList.remove("is-seat-view")}}}var $d=44,jd=92;function Sr(n,e,t,i={}){let o=n?.sectionLabel,s=K(n),r=Gd(n,e),a=[o,s?wr("picker.rowLabel",{label:s}):null,r?wr("picker.seatLabel",{label:r}):null].filter(Boolean).join(" \xB7 "),l=i.maxChars??(i.narrow?$d:jd);for(let c of[t,i.shortTail??t,null]){let h=[a,c].filter(Boolean).join(" \xB7 ");if(h.length<=l||c==null)return h}return a}function Gd(n,e){if(n?.seatNumber)return n.seatNumber;let t=n?.displayLabel??e,i=o=>{!o||!t.startsWith(o)||t.length<=o.length||(t=t.slice(o.length).replace(/^[\s·\-\/_]+/,""))};return i(n?.sectionLabel),i(K(n)),t}import{seatConfidenceDisclosure as qd}from"@seatlayer/core/core/seatConfidence";function kr(n){return n.buyerView}function Tr(n,e,t){if(e==="map"){n.exit3d();return}let i=t?.flyToSeatId;if(n.buyerView==="venue3d"){i?(n.opts.onBuyerViewChange?.({view:"venue3d",seatId:i}),n.view3dHandle?.flyToSeat(i)):t?.resetView&&n.view3dHandle?.focusOverview();return}n.enter3d(i)}function Er(n,e){switch(n.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return n.priceBandKeys!=null&&!n.priceBandKeys.has(e.categoryKey)||n.controller.accessibilityFilterDims?.(e)||n.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}function Cr(n){if(!n.view3dHandle)return;let e=n.allSeats().map(t=>({seatId:t.id,state:n.seatState3dFor(t)}));n.view3dHandle.setAvailability(e)}function Ar(n){n.view3dHandle&&n.view3dHandle.setSelection(n.controller.getSelection().map(e=>e.id))}async function Pr(n,e){let t=n.allSeats().find(i=>i.id===e);if(!t)return null;if(t.viewUrl)try{let i=t.viewMeta?.previewUrl,o=!!i&&i!==t.viewUrl,s=o?await n.buyerAssetUrls.resolve(i):null,r=o?t.viewUrl:await n.buyerAssetUrls.resolve(t.viewUrl);return!r||o&&!s?null:{url:r,...s?{previewUrl:s}:{},...o?{resolveUrl:a=>n.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(i){return n.opts.onError?.(i),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:n.tf("picker.chartDerivedModel","Chart-derived model")}}function Lr(n,e){if(n.salesClosed){n.toast(n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),n.syncSelectionTo3d();return}let t=n.allSeats().find(a=>a.id===e);if(!t)return;let i=n.controller.tableSelection(e);if(n.committedSelection().some(a=>i?a.label===i.label:a.id===e)){n.controller.deselect([e]),n.dismissConfirm(),n.syncSelectionTo3d();return}let s=n.controller.getStatus(t.id);if(s==="held"||s==="booked"||s==="not_for_sale"){n.syncSelectionTo3d();return}if(!n.controller.select([e]).length){n.syncSelectionTo3d(),n.dismissConfirm();return}if(n.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),n.flashPickedSeat(e),i){n.showTableDialog(i,!1),n.syncSelectionTo3d();return}n.opts.confirmSelection!==!1?n.showConfirm(t):n.syncTray(),n.syncSelectionTo3d()}function Mr(n,e){let t=n.allSeats().find(i=>i.id===e);return Sr(n.controller.seatDetails(e),t?.displayLabel??t?.label??e,n.tf("picker.viewFromYourSeat","view from your seat"),{narrow:n.root?.dataset.layout==="narrow",shortTail:n.tf("picker.fromYourSeat","from your seat")})}function Hr(n,e){if(n.buyerView!=="venue3d")return;let t=n.view3dCompareSeatIds;t.includes(e.id)||(n.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),n.confirmSeat?.id===e.id&&(n.controller.deselect([e.id]),n.dismissConfirm(),n.syncSelectionTo3d(),n.syncTray()),n.view3dCompareChip.sync(),n.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:n.view3dCompareSeatIds.length}),n.view3dCompareSeatIds.length>1?n.openView3dComparison():n.toast(n.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}function Rr(n){n.closeView3dComparison(!1),n.view3dCompareSeatIds=[],n.view3dCompareChip.remove(),n.emit3dAnalytics("3d_comparison_cleared")}function Ir(n,e){let t=n.allSeats().find(f=>f.id===e);if(!t)return null;let i=n.controller.seatDetails(t.id),o=n.controller.doc?.categories.find(f=>f.key===t.categoryKey),s=i?.price??(o?.tiers?.length?o.tiers[0].price:o?.price),r=s!=null?n.paidPrice(t.categoryKey,i?.tierId??o?.tiers?.[0]?.id??null,s,t.label):void 0,a=n.controller.getStatus(t.id),l=a==="held"?n.tf("picker.temporarilyHeld","Temporarily held"):a==="booked"?n.tf("picker.sold","Sold"):a==="not_for_sale"?n.tf("picker.notForSale","Not for sale"):n.tf("picker.available","Available"),c=t.viewUrl?Ud({url:t.viewUrl,...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}):n.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),h=ii(t.commercial).join(" \xB7 ")||n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),d=mo({...t.accessibility?.length?{accessibility:t.accessibility}:{},...i?.wheelchairSpaceType?{wheelchairSpaceType:i.wheelchairSpaceType}:{}}),m=d.length?`${d.join(" \xB7 ")} \xB7 metadata, not access certification`:n.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),p=qd(t.confidenceEvidence);return{seat:t,label:i?.displayLabel??t.displayLabel??t.label,section:i?.sectionLabel??t.sectionId??"\u2014",row:K(i)??i?.rowLabel??"\u2014",category:i?.categoryLabel??o?.label??t.categoryKey,price:n.suppressPricing||r==null?"":n.money(r),availability:l,selectable:a==null||a==="free",viewSource:c,limited:h,accessibility:m,confidence:p}}async function Or(n,e){if(n.view3dEl||!n.canOffer3d()||!n.els.map)return;let t=n.controller.doc;if(!t)return;n.buyerView="venue3d",n.view3dTargetSeatId=null,n.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),n.root?.setAttribute("data-view3d","on"),n.dismissConfirm(),n.syncProjection(),n.syncTray();let i=document.createElement("div");i.className="sl-view3d sl-mo-zoom",i.setAttribute("role","group"),i.setAttribute("aria-label",n.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let o=document.createElement("button");o.type="button",o.className="sl-view3d-back",o.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${n.tf("picker.backToMap","Back to map")}</span>`;let s=o.querySelector("span"),r=c=>{n.view3dTargetSeatId=c;let h=!!c;i.classList.toggle("is-seat-focused",h),n.root&&(n.root.dataset.view3dSeat=h?"on":"off");let d=h?n.tf("picker.backToVenue","Back to venue"):n.tf("picker.backToMap","Back to map");s&&(s.textContent=d),o.setAttribute("aria-label",d)};if(o.addEventListener("click",()=>{if(n.view3dTargetSeatId&&n.view3dHandle){n.view3dHandle.focusOverview();return}n.exit3d()}),n.regions["top-left"]?.prepend(o),n.view3dBack=o,n.publish3dTopInset(),ar(n.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6";let h=n.tf("picker.fullScreen","Full screen");c.setAttribute("aria-label",h),c.title=h,c.setAttribute("aria-pressed",String(!!document.fullscreenElement||n.fsFallback||n.framedFs)),c.addEventListener("click",()=>n.toggleFullscreen()),i.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=n.tf("picker.loading3d","Building the 3D venue\u2026"),i.appendChild(a),n.els.map.appendChild(i),n.view3dEl=i,n.view3dCompareChip.sync(),requestAnimationFrame(()=>{i.style.opacity="1"});let l=++n.view3dGen;try{let c=n.allSeats(),[h,d]=await Promise.all([Pt(),n.controller.loadEventConfiguration()]),m=d?await hi(d,v=>n.buyerAssetUrls.resolve(v)):null,p=t.theme?.venue3d?.shellAssetUrl,f=await ui(p,v=>n.buyerAssetUrls.resolve(v));if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;let y={doc:t,seats:c,...m?{eventConfigurationId:m.id,eventConfiguration:m}:{},...f?{registeredShellGlb:f}:{}};a.textContent=n.tf("picker.building3d","Building venue geometry\u2026");let T=await h.prepareVenue3D(y);if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;let S=h.mountVenue3D(i,{...y,prepared:T},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:Ve(),navLabels:Xt(),seatViewActionLabel:v=>n.allSeats().find(A=>A.id===v)?.viewUrl?n.tf("picker.openAuthored360","Open venue 360\xB0"):n.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:v=>n.seatViewCaption(v),onSeatViewStopChange:v=>n.view3dSeatViewChrome?.onStopChange(v),onSeatPick:v=>n.onView3dSeatPick(v),onSeatInspect:v=>n.onView3dSeatPick(v),onSectionFocusChange:v=>{let A=i.querySelector('select[data-locator="section"]'),D=v??"";!A||A.value===D||(A.value=D,A.dispatchEvent(new Event("change")))},onViewTargetChange:v=>{i.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!v),r(v),n.opts.onBuyerViewChange?.({view:"venue3d",...v?{seatId:v}:{}})},...n.seatViewEnabled()?{getSeatView:v=>new Promise((A,D)=>{let G=()=>{n.seatViewFor3d(v).then(L=>{L?A(L):D(new Error("seat_view_unavailable"))})},g=globalThis.requestIdleCallback;typeof g=="function"?g(G,{timeout:1500}):setTimeout(G,50)})}:{},onAnalytics:(v,A)=>n.emit3dAnalytics(v,A)});n.view3dHandle=S,n.view3dSeatViewChrome=xr(i,{handle:()=>n.view3dHandle}),requestAnimationFrame(()=>a.remove()),n.pushAvailabilityTo3d(),n.syncSelectionTo3d(),n.view3dNav=rr(n.regions["bottom-left"]??i,S),e&&S.flyToSeat(e)}catch(c){if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;n.opts.onError?.(c),n.toast(n.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),n.exit3d()}}function _r(n){let e=n.regions["top-left"];if(!n.root||!e)return;let t=()=>{!n.root||n.root.dataset.view3d!=="on"||n.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}function Nr(n){if(n.buyerView!=="venue3d"&&!n.view3dEl)return;n.view3dGen++,n.buyerView="map",n.view3dTargetSeatId=null,n.opts.onBuyerViewChange?.({view:"map"}),n.root?.removeAttribute("data-view3d"),n.closeSeatConfidencePassport(!1),n.closeView3dComparison(!1),n.view3dCompareChip.remove(),n.view3dSeatViewChrome?.dispose(),n.view3dSeatViewChrome=null,n.view3dBack?.remove(),n.view3dBack=null,n.view3dNav?.remove(),n.view3dNav=null,n.root?.removeAttribute("data-view3d-seat"),n.root?.style.removeProperty("--sl-3d-top-inset");try{n.view3dHandle?.dispose()}catch{}n.view3dHandle=null;let e=n.view3dEl;n.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),n.syncProjection(),n.syncTray();let t=n.view3dReturnSeat;n.view3dReturnSeat=null,t&&n.committedSelection().some(i=>i.id===t.id)&&n.opts.confirmSelection!==!1&&n.showConfirm(t)}import{t as Zd}from"@seatlayer/core";import{t as _i}from"@seatlayer/core";function Dr(n){return Array.isArray(n)?n.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function Ni(n,e,t=!1){let i=n.violations[0];return i==="numberOfPlacesToSelect"?n.remaining>0?_i("picker.selectExactMore",{count:n.remaining}):_i("picker.selectExactCount",{count:n.required}):i==="minimumSelectedPlaces"?_i("picker.selectMinimumMore",{count:n.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):i==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):_i("picker.orphanHint")}import{t as Br,tCount as Wd}from"@seatlayer/core";function Fr(n){let e=Math.max(0,n),t=Math.floor(e/6e4),i=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${i}`}function Vr(n){let e=n.performanceLabel?`<div class="sl-chip-when">${O(n.performanceLabel)}</div>`:"",t=n.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${O(n.performanceDates.summary)}</span><span class="sl-chip-date-list">${n.performanceDates.labels.map(i=>`<span class="sl-chip-date">${O(i)}</span>`).join("")}</span></div>`:"";return e+Yd(n)+t}function Yd(n){let{d:e,area:t,label:i,objectType:o,quantity:s=1,identity:r}=n,a=A=>String(A??"\u2014").replace(/[&<>"]/g,D=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[D]),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??i,d=n.categoryLabel?.trim()??"",m="",p=[];l==="table"&&r?.bookingMode?(m=`${c} ${h}`,p.push([b("picker.guests","Guests"),String(s)])):l==="ga"?(m=String(t?.displayLabel??h),s>1&&p.push([b("picker.tickets","Tickets"),String(s)])):l==="booth"?(m=e?.sectionLabel??`${c} ${h}`,e?.sectionLabel&&p.push([c,String(h)])):!e?.sectionLabel&&!e?.rowLabel&&!e?.seatNumber?m=String(h):(m=e.sectionLabel??"",e.rowLabel&&p.push([c,String(K(e)??e.rowLabel)]),e.seatNumber&&p.push([b("picker.seat","Seat"),String(e.seatNumber)]));let f=!m&&!!d,y=m||d||String(h),T=!!d&&!f&&d!==y,S=p.map(([A,D])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(A)}</span> <b>${a(D)}</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(([A,D])=>`${A} ${D}`),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 Xd(n){let e=O;return` data-key="${e(n.key)}"`+(n.heldLabels.length?` data-held="${e(encodeURIComponent(n.heldLabels.join(`
3189
- `)))}"`:"")+(n.seatIds.length?` data-seat="${e(n.seatIds.join(" "))}"`:"")+(n.locateId?` data-locate="${e(n.locateId)}"`:"")}function zr(n){let e=O;return`<div class="sl-chip${n.held?" sl-held":""}${n.fresh?" sl-enter":""}"`+Xd(n)+">"+(n.held?n.stateHtml:`<span class="sl-chip-dot" style="background:${E(n.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${n.identityHtml}`+(n.extrasHtml?`<div class="sl-chip-sub">${n.extrasHtml}</div>`:"")+`${n.noteHtml}</div>`+(n.amountText?`<span class="amt">${e(n.amountText)}</span>`:"")+n.railHtml+"</div>"}function Hn(n,e){let t=O(n),i=e?O(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${i}" aria-label="${O(Br("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 $r(n){return n.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>${Br("picker.willFindSeatsTogether",{count:n.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>`+at({id:"sl-info-best-seats",label:b("picker.aboutBestSeats","About finding seats together"),text:b("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")})+(n.offerPremium?`<button type="button" class="sl-ba-premium${n.premium?" on":""}" data-ba-premium aria-pressed="${n.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${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>${n.quantity}</span><button type="button" data-ba="1" aria-label="${b("picker.moreSeats","More seats")}">+</button></div>`+(n.categories.length>1?`<select class="sl-ba-cat" aria-label="${O(b("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${O(b("picker.anyTicketType","Any ticket type"))}</option>`+n.categories.map(e=>`<option value="${O(e.key)}"${n.selectedCategory===e.key?" selected":""}>${O(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(n.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>`+n.zones.map(e=>`<option value="${O(e.id)}"${n.selectedZone===e.id?" selected":""}>${O(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${n.busy?" sl-busy":""}"${n.busy?" disabled":""}>`+(n.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${b("picker.findingBestSeats","Finding the best seats\u2026")}`:Wd("picker.findBestSeatsCount",n.quantity))+"</button>"+(n.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${b("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function jr(n){if(n.salesClosed&&!n.hasPicks){let e=n.whenText?`<span class="when">${O(n.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 Gr(n){return n.hasGaAreas?n.seated?n.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."):n.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."):n.groupMode==="per_performance"?b("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):n.groupMode?b("picker.groupTrayHint","Choose seats once \u2014 the same seats will be held for every performance."):n.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 Rn=6e4,Ur=5*6e4,Qd=String(Math.round(Ur/6e4));function qr(n){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(n.regions["bottom-center"]??n.els.map).appendChild(e),n.extendEl=e,n.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),n.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),n.els.extendBtn.textContent=Kr(n),n.els.extendDismiss.setAttribute("aria-label",n.tf("picker.close","Close")),n.els.extendBtn.addEventListener("click",()=>{n.handleExtend()}),n.els.extendDismiss.addEventListener("click",()=>{n.extendDismissed=!0,n.setExtendPrompt(!1,0)})}function Kr(n){return n.tf("picker.addMinutes","+{count} min").replace("{count}",Qd)}function Wr(n){let e=n.hold?.items??[],t=new Set(e.map(o=>o.label));return n.committedSelection().filter(o=>!t.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0)+Ie(n.gaQty,n.hold?.items??[])}function Yr(n){return(n.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function Xr(n){let e=new Set((n.hold?.items??[]).map(i=>i.label)),t=n.committedSelection().filter(i=>!e.has(i.label)).reduce((i,o)=>i+(o.quantity??1),0);return n.heldTicketCount()+t+Ie(n.gaQty,n.hold?.items??[])}function Zr(n){let e=new Set((n.hold?.items??[]).map(o=>o.label)),t=n.committedSelection().filter(o=>e.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0),i=Math.max(0,n.maxTickets-n.heldTicketCount()-Ie(n.gaQty,n.hold?.items??[]));n.controller.setMaxSelection(t+i)}function Qr(n,e=n.lastTrayCount,t=n.pendingSelectionCount()){let i=n.els.cta;if(!i)return;if(delete i.dataset.act,n.salesClosed){i.disabled=!0,i.textContent=n.tf("picker.salesClosedCta","Sales closed");return}if(n.ctaPhase==="holding"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${n.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(n.ctaPhase==="checkout"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${n.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let o=!n.hold&&n.performanceGroup?.selectionMode==="per_performance"?n.performanceGroup.submissionState?.():null;if(o&&!o.ready){i.disabled=!0,i.textContent=n.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(o.complete)).replace("{total}",String(o.total));return}let s=n.controller.getSelectionValidity(e);if(s&&!s.isValid){i.disabled=!0,i.textContent=Ni(s,(r,a)=>n.tf(r,a),!0);return}if(!e&&n.root?.dataset.layout==="narrow"&&!n.performanceGroup&&!n.hold){i.disabled=!1,i.dataset.act="find",i.textContent=n.tf("picker.findBestSeats","Find best seats");return}i.disabled=e===0,i.textContent=n.hold?t?Zd("picker.secureMoreAndCheckout",{count:t}):n.tf("picker.continueToCheckout","Continue to checkout"):e?n.performanceGroup?n.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(n.performanceGroup.performanceCount)):n.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):n.tf("picker.selectSeats","Select seats")}function Jr(n,e){n.ctaPhase=e,n.syncCta()}async function ea(n,e,t){n.setCtaPhase("checkout");try{await n.checkoutHandoff(e,t)}finally{n.ctaPhase==="checkout"&&!n.bookedShown&&n.setCtaPhase("idle")}}function ta(n){return`@seatlayer/hold/v1/${encodeURIComponent(n.apiBase)}/${encodeURIComponent(n.opts.event)}`}function ia(n){if(n.opts.initialHoldId)return n.opts.initialHoldId;if(n.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(n.holdStorageKey())}catch{return null}}function na(n,e){if(!(n.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(n.holdStorageKey(),e.holdId)}catch{}}function oa(n){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(n.holdStorageKey())}catch{}}async function sa(n,e){try{let t=await n.controller.resumeHold(e);if(!t||n.destroyed)return null;let i={holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items};return n.hold=i,n.handedOff=!0,n.bookedShown=!1,n.ctaPhase="idle",n.startHoldTimer(i.expiresAt),n.rememberHold(i),n.syncTray(),n.emitHoldChange(),n.opts.onHoldRestored?.(i,i.seats??[],n.buildHandoff(i)),i}catch(t){let i=t?.status;return i===404||i===409?n.forgetHold():n.opts.onError?.(t),null}}async function ra(n){let e=n.rememberedHoldId();e&&await n.resumeHoldFromServer(e)}function aa(n,e){n.stopHoldTimer(),n.holdExpiresAt=e,n.extendDismissed=!1,n.extendUsed=!1,n.hold&&n.rememberHold(n.hold);let t=n.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${n.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let i=t.querySelector('[data-ref="holdTime"]'),o=()=>{let s=Math.max(0,n.holdExpiresAt-Date.now());i&&(i.textContent=Fr(s)),t.classList.add("on"),t.classList.toggle("is-expiring",s>0&&s<=Rn),n.setExtendPrompt(s>0&&s<=Rn,s),(s<=0||!n.controller.currentHold())&&n.stopHoldTimer()};n.holdTimer=setInterval(o,500),o()}function la(n){n.holdTimer&&clearInterval(n.holdTimer),n.holdTimer=null,n.els.hold?.classList.remove("on","is-expiring"),n.setExtendPrompt(!1,0)}function ca(n,e,t){if(!n.extendEl)return;let i=e&&t>0&&n.root?.dataset.layout!=="narrow"&&!n.extendDismissed&&!n.extendUsed&&!!n.controller.currentHold()&&!n.bookedShown;n.extendEl.classList.toggle("on",i)}function da(n){if(!n.holdTimer)return;let e=Math.max(0,n.holdExpiresAt-Date.now());n.setExtendPrompt(e>0&&e<=Rn,e)}async function pa(n){let e=n.els.extendBtn,t=n.controller.currentHold();if(!(!t||!n.api.extend||n.extendUsed)){e.disabled=!0,e.textContent=n.tf("picker.addingEllipsis","Adding\u2026");try{let i=await n.api.extend(n.controller.key,t.holdId,Ur);if(n.controller.currentHold()?.holdId!==t.holdId)return;n.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:i.expiresAt,items:t.items});let o=n.controller.currentHold();if(!o)return;n.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},n.holdExpiresAt=o.expiresAt,n.extendUsed=!0,n.extendEl?.classList.remove("on"),n.rememberHold(n.hold),n.emitHoldChange(),n.toast(n.tf("picker.moreTimeAdded","More time added \u2014 your seats are still held."),"success")}catch(i){if(i?.reason==="extend_limit"){n.extendUsed=!0,n.setExtendPrompt(!1,0);return}n.opts.onError?.(i),n.toast(n.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=Kr(n)}}}import{t as ga}from"@seatlayer/core";function ha(n){return n?.previousPrice!=null&&n.previousPrice>n.price?n.previousPrice:null}function ua(n){return ep(n)+(n.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!n.collapsed}">${n.esc(n.moreLabel)}</button>`:"")+tp(n.status)}function ep(n){let{esc:e,money:t}=n;return n.categories.map(i=>{let o=n.priceOf(i),s=n.rangeOf(i),r=n.offerOf(i.key),a=ha(r),l=n.activeKey===i.key;return`<div class="sl-price-row${n.bandKeys!=null&&!n.bandKeys.has(i.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(i.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(n.titleFor(i,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(n.colorOf(i))}"></span><span class="sl-price-label">${e(i.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 tp(n){let e=t=>t.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i]);return`<div class="sl-status-key" aria-label="${e(n.legend)}"><span class="sl-status-item"><i class="sl-status-icon unavailable" aria-hidden="true"></i>${e(n.unavailable)}</span></div>`}function In(n){let e=Math.abs(n.scrollLeft),t=e>2,i=e+n.clientWidth<n.scrollWidth-2;return n.dataset.fadeStart=String(t),n.dataset.fadeEnd=String(i),{start:t,end:i}}function ma(n){let{esc:e,money:t}=n;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${n.allActive}" title="${e(n.allWord)}"><span class="sl-rc-t">${e(n.allWord)}</span></button>`+n.categories.map(o=>{let s=n.rangeOf(o),r=n.priceOf(o),a=s?s.min===s.max?t(s.min):`${t(s.min)}+`:r!=null?t(r):null,l=Object.prototype.hasOwnProperty.call(n.left,o.key)&&n.left[o.key]<=0,c=ha(n.offerOf(o.key)),h=a?`${o.label} \u2014 ${a}${l?` (${n.soldOutWord})`:""}`:o.label;return`<button type="button" class="sl-rc" data-cat="${e(o.key)}" aria-pressed="${n.activeKey===o.key}" aria-label="${e(h)}" title="${e(h)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(n.colorOf(o))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??o.label)}</span></button>`}).join("")}function fa(n,e){let t=n.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let i=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(i.length<=5)return i.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let o=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),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 ba(n){if(n.suppressPricing||!n.els.prices||!n.els.pricesSec)return;let e=fa(n.controller.doc?.categories??[],n.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",n.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let i=document.createElement("option");i.value="all",i.textContent=n.tf("picker.allPrices","All prices"),t.appendChild(i);for(let o of e){let s=document.createElement("option");s.value=o.id,s.textContent=o.label,t.appendChild(s)}n.els.pricesSec.appendChild(t),n.priceSelect=t,t.addEventListener("change",()=>{n.applyPriceBand(e.find(o=>o.id===t.value)?.keys??null)})}function ya(n,e){if(n.focusedCatKey=null,n.priceBandKeys=e?new Set(e):null,n.priceSelect){let t=e?n.priceSelect.value:"all";n.priceSelect.value!==t&&(n.priceSelect.value=t)}n.controller.setCategoryFilter(e),n.controller.focusCategoryFilter(e),n.pushAvailabilityTo3d(),n.syncFloors(),n.syncRung(),n.minimap?.refreshMinimap(),n.syncPrices(),n.lastSection&&n.showSectionCard(n.lastSection)}function va(n){return{colorOf:e=>n.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>n.catPriceRange(e),priceOf:e=>n.catPrice(e),offerOf:e=>n.offerPrice(e),money:e=>n.money(e),esc:O}}function wa(n,e,t,i=n.legendDeps()){let o=n.els.railScroll,s=e.length>1;if(n.els.rail?.classList.toggle("has",s),!o)return;o.innerHTML=s?ma({...i,categories:e,left:t,activeKey:n.focusedCatKey,soldOutWord:n.tf("picker.soldOut","Sold out"),allWord:n.tf("picker.allPrices","All prices"),allActive:!n.focusedCatKey&&!n.priceBandKeys}):"";let r=e.map(a=>a.key).join("|");n.lastRailSignature!==r&&(n.lastRailSignature=r,o.scrollLeft=0),o.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){n.applyPriceBand(null);return}n.focusCategory(a.dataset.cat??"")})}),n.railEdgesBound||(n.railEdgesBound=!0,o.addEventListener("scroll",()=>In(o),{passive:!0})),requestAnimationFrame(()=>In(o))}function xa(n){let e=n.controller.doc;if(!e||!n.els.prices)return;let t=n.controller.categoryAvailability(),i=e.categories.filter(d=>!d.notForSale);n.syncSoldout(i,t);let o=n.legendDeps(),s=n.suppressPricing,r=s?{...o,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:o;s&&(n.els.pricesSec?.querySelector("span")?.replaceChildren(n.tf("picker.seatCategories","Seat categories")),n.els.pricesInfo?.remove()),n.syncPriceRail(i,t,r);let a=5,l=i.length-a,c=l>1&&!n.pricesExpanded,h=c?i.slice(0,a):i;n.els.prices.classList.toggle("sl-expanded",l>1&&n.pricesExpanded),n.els.prices.innerHTML=ua({...r,categories:h,left:t,collapsed:c,activeKey:n.focusedCatKey,bandKeys:n.priceBandKeys,titleFor:(d,m)=>m?n.tf("picker.showAllSeats","Show all seats"):ga("picker.showLabelSeatsOnMap",{label:d.label}),moreLabel:l>1?c?s?n.tf("picker.showAllCategories","Show all categories"):ga("picker.showAllTicketTypes",{count:i.length}):n.tf("picker.showFewer","Show fewer"):null,status:{legend:n.tf("picker.seatStatusLegend","Seat status legend"),unavailable:n.tf("picker.notAvailable","Not available")}}),n.els.prices.querySelectorAll(".sl-price-row").forEach(d=>{d.addEventListener("mouseenter",()=>n.controller.getRenderer()?.setCategoryHighlight?.(d.dataset.cat??null)),d.addEventListener("mouseleave",()=>n.controller.getRenderer()?.setCategoryHighlight?.(null));let m=()=>n.focusCategory(d.dataset.cat??"");d.addEventListener("click",m),d.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),m())})}),n.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{n.pricesExpanded=!n.pricesExpanded,n.syncPrices()})}function Sa(n,e){if(!e)return;let t=n.focusedCatKey===e?null:e;n.focusedCatKey=t,n.priceBandKeys=t?new Set([t]):null;let i=n.els.pricesSec?.querySelector(".sl-price-select");i&&(i.value="all"),n.controller.setCategoryFilter(t?[t]:null),n.controller.focusCategoryFilter(t?[t]:null),n.pushAvailabilityTo3d(),n.syncFloors(),n.syncRung(),n.minimap?.refreshMinimap(),n.syncPrices(),n.lastSection&&n.showSectionCard(n.lastSection)}import{t as ka,tCount as Ta}from"@seatlayer/core";function de(n,e,t){let i=ka(n,t);return i&&i!==n?i:t?e.replace(/\{(\w+)\}/g,(o,s)=>s in t?String(t[s]):o):e}function np(n){let e=Ta("picker.seatCount",n);return e.includes("picker.seatCount")?`${n} ${n===1?"seat":"seats"}`:e}function op(n){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(n)}catch{}return n.join(", ")}function sp(n){if(n.length<2)return!1;let e=[...n].sort((t,i)=>t-i);return new Set(e).size!==e.length?!1:e[e.length-1]-e[0]===e.length-1}function rp(n){let e=n.filter(o=>o.objectType==="ga"),t=n.filter(o=>o.objectType!=="ga"),i=[];if(t.length){let o=np(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?de("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:s[0],row:r[0],seat:String(t[0].seatNumber??"")}):sp(a)?de("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:s[0],row:r[0],from:Math.min(...a),to:Math.max(...a)}):"";i.push(l?de("picker.releasedPair","{first} \xB7 {second}",{first:o,second:l}):de("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]}))}else s.length===1?i.push(de("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]})):s.length>1?i.push(de("picker.releasedInSections","{seats} in Sections {sections}",{seats:o,sections:op(s)})):i.push(o)}for(let o of e)i.push(de("picker.releasedGa","{quantity} \xD7 {area}",{quantity:o.quantity??1,area:o.label}));return i.length?i.reduce((o,s)=>de("picker.releasedPair","{first} \xB7 {second}",{first:o,second:s})):""}function Ea(n){if(!n)return[];let e=new Map((n.seats??[]).map(o=>[o.label,o])),t=n.items??[];return(t.length?t.map(o=>({label:o.label,objectType:o.objectType,quantity:o.quantity})):[...e.keys()].map(o=>({label:o}))).map(o=>{let 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:K(s)??s.rowLabel}:{},...s?.seatNumber?{seatNumber:s.seatNumber}:{}}})}function Ca(n,e){if(!n.reducedMotion)for(let t of e.slice(0,10)){if(t.objectType==="ga")continue;let i=n.seatByLabel(t.label);!i||n.statusOf(i.id)!=="free"||n.flash(i.id,n.accent)}}function Aa(n,e){if(!e.recoverable.length||!n.isConnected)return;let t=n.querySelector(".sl-hold-expired-next");t&&(e.taken.length?t.textContent=e.taken.slice(0,3).map(r=>ka("picker.seatJustTakenByAnother",{label:r})).join(" "):t.remove());let i=n.querySelector(".sl-interrupt-actions"),o=i?.querySelector(".sl-interrupt-act");if(!i||!o)return;o.classList.add("sl-interrupt-act-secondary");let s=document.createElement("button");s.type="button",s.className="sl-interrupt-act sl-hold-expired-recover",s.textContent=Ta("picker.holdLapsedSelectAgain",e.recoverable.length),s.addEventListener("click",()=>e.onRecover([...e.recoverable])),i.insertBefore(s,o),n.classList.add("has-recovery"),s.focus()}function Pa(n,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let i=document.createElement("div");i.className="sl-interrupt-card sl-mo-in";let o=document.createElement("div");o.className="sl-interrupt-title",o.id="sl-hold-expired-title";let s=document.createElement("span");s.className="sl-interrupt-glyph",s.setAttribute("aria-hidden","true"),s.textContent="\u23F1";let r=document.createElement("span");r.textContent=de("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=de("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),i.append(o,a);let l=rp(e);if(l){let m=document.createElement("div");m.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",m.textContent=l,i.appendChild(m)}let c=document.createElement("div");c.className="sl-interrupt-body sl-hold-expired-next",c.textContent=de("picker.holdExpiredPickAgain","Pick your seats again to continue \u2014 they may already be taken."),i.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=de("picker.holdExpiredRestart","Choose seats again"),d.addEventListener("click",()=>n.restart()),h.appendChild(d),i.appendChild(h),t.appendChild(i),t.addEventListener("pointerdown",m=>{m.target===t&&n.restart()}),t}import{ACCESSIBILITY_TYPES as On,seatTypeIconSvg as La,t as ap}from"@seatlayer/core";var Ma={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"},lp='<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>',cp='<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>',dp=8,pp=8,hp=88;function up(n){let e=n.gap??dp,t=n.margin??pp,i=n.min??hp,o=Math.max(n.boundsTop,0);return Math.max(Math.round(n.buttonTop-o-e-t),i)}var Di=class{constructor(e,t){this.active=new Set;this.deps=t,this.root=document.createElement("div"),this.root.className="sl-a11y",this.button=document.createElement("button"),this.button.type="button",this.button.className="sl-a11ybtn",this.button.setAttribute("aria-haspopup","true"),this.button.setAttribute("aria-expanded","false");let o=this.offered().length>0?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options");this.button.setAttribute("aria-label",o),this.button.innerHTML=cp,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=Co(o,t.tf("picker.close","Close"))+Ao(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:i,count:o})=>[i,o])),t=!1;for(let i of this.menu.querySelectorAll("[data-a11y-row]")){let o=i.dataset.a11yRow??"";if(!o.startsWith("a11y:"))continue;let s=o.slice(5),r=e.get(s);if(r===void 0)continue;let a=this.countNode(i),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))),i.disabled=c,c?i.setAttribute("aria-disabled","true"):i.removeAttribute("aria-disabled"),c&&this.active.delete(s)&&(this.paint(i,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let i=t.dataset.a11yRow??"";i.startsWith("a11y:")&&this.paint(t,this.active.has(i.slice(5)))}}refit(){this.menu.hidden||this.fit()}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),window.removeEventListener("resize",this.reflow),this.root.remove()}fit(){this.menu.style.setProperty("--sl-a11ymenu-max",`${up({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();on(this.menu,{x:t.left+t.width/2,y:t.top}),Do(this.menu),No(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:La("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:lp,className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:i,count:o})=>({key:i,count:o}));let t=this.deps.present;return t?On.filter(({key:i})=>t.has(i)).map(({key:i})=>({key:i,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(On.map(i=>[i.key,i]));return this.offered().flatMap(({key:i,count:o})=>{let s=t.get(i);return s?[{key:`a11y:${i}`,iconHtml:La(i,{size:17}),label:this.deps.tf(`picker.accessShort.${i}`,Ma[i]??s.label),...i==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...o==null?{}:{count:this.countText(o),disabled:o===0},on:this.active.has(i)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-sl-info]"))e.addEventListener("click",()=>{let t=e.closest(".sl-info"),i=!t?.classList.contains("open");for(let o of this.menu.querySelectorAll(".sl-info.open"))o.classList.remove("open"),o.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false");t?.classList.toggle("open",i),e.setAttribute("aria-expanded",String(i))});for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let 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 i=t.slice(5),o=!this.active.has(i);o?this.active.add(i):this.active.delete(i),this.paint(e,o),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let i=(e.dataset.a11yRow??"").slice(5),o=e.parentElement;o?.classList.contains("sl-a11yrow-w")||(o=document.createElement("div"),o.className="sl-a11yrow-w",e.replaceWith(o),o.appendChild(e));let s=document.createElement("button");s.type="button",s.className="sl-a11yrow-c sl-a11yjump",s.dataset.a11yJump=i,s.textContent=t.textContent,s.disabled=e.disabled,s.setAttribute("aria-label",this.jumpLabel(i,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(i,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(i)||(this.active.add(i),this.paint(e,!0),this.applyFilter({focus:!1}));let l=this.deps.stepToAccessibleSection?.(i);l&&s.setAttribute("aria-label",this.jumpLabel(i,s.textContent??"",l.label))})}}countText(e){return e>0?ap("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=Ma[e]??On.find(i=>i.key===e)?.label??e;return this.deps.tf(`picker.accessShort.${e}`,t)}jumpLabel(e,t,i){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...i?[`${this.deps.tf("picker.section","Section")} ${i}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};import{attachVisibilityCatchUp as mp}from"@seatlayer/core";var fp=250;function Ha(n,e=fp){let t=null,i=()=>{t===null&&(t=setTimeout(()=>{t=null,n()},e))},o=mp(i),s=typeof window<"u"&&typeof window.addEventListener=="function";return s&&window.addEventListener("focus",i),()=>{t!==null&&(clearTimeout(t),t=null),o(),s&&window.removeEventListener("focus",i)}}import{holdRecoveryShape as gp,tCount as Bi}from"@seatlayer/core";var Fi=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=gp(e),i=e.lapsedLabels.length,o=i-e.recoverable.length,s=t==="all"?Bi("picker.holdLapsedStillFree",i):t==="partial"?Bi("picker.holdLapsedSomeTaken",o):Bi("picker.holdLapsedAllTaken",i);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>${O(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${O(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 Bi("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 Ra=Symbol("seatlayer.performance-group-picker");function Vi(n,e){return Object.defineProperty(n,Ra,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),n}function Ia(n){return n[Ra]??null}var Oa="@seatlayer/pending-checkout/v1";function bp(n){return typeof n=="string"&&n.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(n)}function zi(n){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let i=null;try{let o=window.sessionStorage.getItem(Oa);if(o){let s=null;try{s=JSON.parse(o)}catch{}if(s&&bp(s.orderId)){let r=Date.now()-Number(s.storedAt);if(r>=0&&r<=144e5){if(s.eventKey&&s.eventKey!==n)return null;i=s.orderId}}}window.sessionStorage.removeItem(Oa)}catch{}e.delete("seatlayer_checkout");try{let o=e.toString();history.replaceState(history.state,"",`${location.pathname}${o?`?${o}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:i}}function _a(n){if(!n.framed)return null;let e=n.ancestorOrigins?.length?n.ancestorOrigins[0]:null;for(let t of[e,n.referrer])if(t)try{return new URL(t).origin}catch{}return null}var Tp="https://api.seatlayer.io",Ep=10,Cp=250,Da=6e4,Ba=4,Ap=10,Pp=40,Lp=220,_n=["mini","peek","open"],Fa="seatmap.a11y.cb";function Mp(){try{if(typeof window>"u")return null;let n=window.localStorage.getItem(Fa);return n==null?null:n==="1"}catch{return null}}function Hp(n){try{window.localStorage.setItem(Fa,n?"1":"0")}catch{}}var Ke=class n{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 Mi({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 Fi({toast:(e,t,i)=>this.toast(e,t,i),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.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=Ia(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??Tp).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},i=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?ri({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:i?.access??It(e,t),this.pubApi=e.transport?null:i?.api??new He(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 ut(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=Dr(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(Ep,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=Mp()??!!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 gt(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=_a({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let i=t<640?1.2:.62;return Math.max(420,Math.round(t*i))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!document.fullscreenElement||this.fsFallback||this.framedFs?document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.framedFs?this.setFramedFs(!1):this.setFsFallback(!1):e.requestFullscreen?e.requestFullscreen().catch(()=>this.enterFsFallback()):this.enterFsFallback()}fillsViewport(){let e=this.root;if(!e||typeof window>"u")return!1;let t=e.getBoundingClientRect();return t.height>=window.innerHeight-Ba&&t.width>=window.innerWidth-Ba}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let i=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=i,e.tabIndex=i?-1:0,e.setAttribute("aria-hidden",String(i))}fullscreenMeasurementChanged(e,t){let i=typeof window>"u"?0:window.innerWidth,o=typeof window>"u"?0:window.innerHeight,s=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||i!==this.fullscreenAffordanceSize.viewportWidth||o!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:i,viewportHeight:o},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 i=this.els.zfs?.querySelector(".sl-zfs-lbl");i&&(i.textContent=e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),this.view3dEl?.querySelector(".sl-view3d-fs")?.setAttribute("aria-pressed",String(e)),this.syncFullscreenAffordance()}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e,background:this.cssVar("--sl-bg")||void 0}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){mt();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let o=document.createElement("div");o.className="sl-modal-frame",o.style.setProperty("--sl-bg",ot(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,i.appendChild(o),document.body.appendChild(i);let s=document.body.style.overflow;document.body.style.overflow="hidden";let r=new n({...e,container:o});r.modalScrim=i,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(y=>y.isConnected&&!y.closest('[hidden], [aria-hidden="true"], [inert]'));return f[f.length-1]??o},c=(f,y)=>{let T=f;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=f=>[...f.querySelectorAll(a)].filter(y=>y.tabIndex>=0&&!y.matches(":disabled")&&!c(y,f)),d=(f,y)=>{let T=h(f),S=y?T[T.length-1]:T[0];S?S.focus({preventScroll:!0}):(f.hasAttribute("tabindex")||(f.tabIndex=-1),f.focus({preventScroll:!0}))},m=!1,p=()=>{if(m)return;m=!0,document.body.style.overflow=s,r.escHandler&&document.removeEventListener("keydown",r.escHandler),i.remove(),r.modalScrim=null;let f=r.prevFocus;r.prevFocus=null,f?.isConnected&&f.focus({preventScroll:!0});let y=()=>{r.destroy(),e.onClose?.()};r.hold&&!r.handedOff?r.release().finally(y):y()};return r.closeModal=p,i.addEventListener("mousedown",f=>{f.target===i&&p()}),r.escHandler=f=>{if(f.key==="Tab"){if(f.defaultPrevented)return;let y=l(),T=h(y),S=T[0],v=T[T.length-1],A=document.activeElement;!S||!v?(f.preventDefault(),d(y,f.shiftKey)):A===y||!A||!y.contains(A)?(f.preventDefault(),(f.shiftKey?v:S).focus({preventScroll:!0})):f.shiftKey&&A===S?(f.preventDefault(),v.focus({preventScroll:!0})):!f.shiftKey&&A===v&&(f.preventDefault(),S.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 yp({sectionPreview:!0,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:nt(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let i=this.controller.getGAAreas().find(o=>o.id===t);i&&(this.collapseSheet(),an(this,i,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),Es(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,i=this.holdConflicted;this.holdExpiredUnits=Ea(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||i){this.toast(_("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)){if(this.opts.confirmSelection===!1||this.salesClosed){this.removeHeldLabels([t.label]);return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}this.showConfirm(t,"remove");return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}if(this.tableDialog?.physicalSeatIds.includes(t.id)){this.dismissTableDialog();return}this.opts.confirmSelection===!1||this.salesClosed||this.controller.tableSelection(t.id)||(this.controller.select([t.id]),this.showConfirm(t,"remove"))},onSelectionLimit:()=>{this.toast(_("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={},i=C=>Math.round((performance.now()-C)*100)/100;this.rendered=!0,mt();let o=performance.now(),s=ni(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=lo(this.opts.container),{root:c,els:h,mapHost:d}=Po(l,(C,R)=>this.tf(C,R),this.opts.theme);this.root=c,this.els=h,this.mapHost=d,oi(c,s,C=>{t.loadLocale=i(o),this.destroyed||this.applyActiveLocale(C,r)}),dr(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 m=document.createElement("div");m.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(m),t.mountBuyerShell=i(a),t.skeletonPaint=i(e),this.startRealtime();let p=await this.loadChart(m,t,i);if(!p)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=i(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 C=document.createElement("div");C.className="sl-testbadge",C.textContent=ao(_("picker.testMode"),Na()),C.setAttribute("aria-label",_("picker.testMode")),C.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"),this.regions["top-left"].appendChild(C)}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,co(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?ti(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(C=>C.commercial?.restrictedView||C.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=i(f);let v=performance.now();if(await this.restoreRememberedHold(),t.restoreHold=i(v),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let A=this.controller.doc,D=bi(this.opts.event),G=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),g=G??"event",L={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:g,surface:G==="season"?"season_picker":G==="performance_group"?"performance_group_picker":"seat_picker",ms:i(e),performanceProfile:t,chartDelivery:p.chartDelivery,seatCount:this.allSeats().length,objectCount:A?.objects.length??0,sectionCount:A?.objects.filter(C=>C.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:A?.name,view:this.buyerView,load:D,transport:this.opts.transport?"custom":"pubapi"};gr(L,(C,R)=>this.emitAnalytics(C,R));let N=p.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",Ln({...L,performanceProfile:{...L.performanceProfile,...N}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=p,await this.registerAgentTools(),this}registerAgentTools(){return fr(this)}webMcpHost(e){return Pn(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=Ha(()=>{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?.('.sl-chip,button,a,input,select,label,[role="button"]')||this.cycleSheet())});let i=()=>{if(this.root?.dataset.layout!=="narrow")return;let o=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!o)),this.els.pricesSec?.setAttribute("aria-expanded",String(!o)),!o&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",o=>{o.target.closest("select,button")||i()}),this.els.pricesSec?.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||o.target.closest("select,button")||(o.preventDefault(),i())}),e.addEventListener("click",o=>{let 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 i=t.dataset.sheet;t.dataset.sheet=e==="mini"&&!this.sheetHasCards()?"peek":e,this.syncSheetAffordance(),i==="mini"&&t.dataset.sheet!=="mini"&&this.scheduleFit()}syncSheetAffordance(){let e=this.sheetState(),t=e==="open"||e==="peek"&&this.sheetHasCards(),i=this.els.sheetToggle;i?.setAttribute("aria-expanded",String(e==="open")),i?.setAttribute("aria-label",t?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))}cycleSheet(){let e=this.sheetState();e==="open"||e==="mini"?this.setSheetState("peek"):this.setSheetState(this.sheetHasCards()?"mini":"open")}stepSheet(e){let t=_n.indexOf(this.sheetState()),i=Math.min(_n.length-1,Math.max(0,t+e));this.setSheetState(_n[i])}setSheetOpen(e){this.setSheetState(e?"open":"peek")}openBestSeatsForm(){this.setSheetOpen(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||this.setSheetState("peek")}observeLayout(e){let t=()=>{let i=e.clientWidth;if(i<=0)return;let o=e.clientHeight,s=i!==this.pickerLayoutSize.width||o!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:i,height:o};let r=this.fullscreenMeasurementChanged(i,o);this.reportFramedHeight();let a=i<640?"narrow":"wide",l=o<560?"compact":"comfortable",c=e.dataset.layout!==a||e.dataset.density!==l;c&&(e.dataset.layout=a,e.dataset.density=l,this.controller.setNarrowLayout?.(a==="narrow"),queueMicrotask(()=>this.syncFitClearance()),this.controller.getRenderer()?.setSectionFocusDim?.(a!=="narrow"),a==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray(),this.syncMapStepBack(),this.refreshExtendPrompt()),(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,i){let o=performance.now(),s=await this.controller.render(e);return t.loadChartAndStatuses=i(o),this.destroyed?null:s?(Object.assign(t,s.performanceProfile),s):(Ce({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:Oe(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 n({...a,container:r}).render()}),null)}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=zi(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 Di(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(i,o)=>this.tf(i,o),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:i=>this.setColorblindSafe(i),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:i=>{this.limitedViewFilter=i,this.controller.setCommercialLimitedFilter(i),this.pushAvailabilityTo3d()},applyAccessibilityFilter:i=>this.applyAccessibilityFilter(i),focusSeatsForFilter:()=>this.focusSeatsForFilter(),stepToAccessibleSection:i=>this.controller.focusNextAccessibleSection?.([i])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast(_("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,i=this.els.headInfo?.parentElement;t&&i&&t.parentElement!==i&&(t.classList.add("sl-fs-pill"),i.insertBefore(t,this.els.hold??null));let o=this.extendEl;if(o){let r=e?this.regions["bottom-center"]??this.els.map:i;r&&o.parentElement!==r&&(o.dataset.dock=e?"map":"head",r===i?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(){qr(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>${O(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(),i=document.createElement("div");i.className="sl-soldout-eyebrow",i.textContent=t;let o=document.createElement("div");o.className="sl-soldout-title",o.textContent=this.tf("picker.soldOutTitle","Sold out");let 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(i,o,s),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,o=this.isSoldOut(e,t,i);o!==this.soldOut&&(this.soldOut=o,this.soldoutEl?.classList.toggle("on",o))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(o=>(t[o.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog();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 i=document.createElement("a");i.className="sl-powered",i.href="https://seatlayer.io/?ref=picker",i.target="_blank",i.rel="noopener noreferrer",i.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer"));let o=document.createElement("span");o.className="sl-powered-mark",o.setAttribute("aria-hidden","true"),o.innerHTML=pi;let s=document.createElement("span");s.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),i.append(o,s),t.appendChild(i)}buildRegions(){if(!this.els.map)return;let e=["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"];for(let t of e){let i=document.createElement("div");i.className="sl-anchor",i.dataset.region=t,this.els.map.appendChild(i),this.regions[t]=i}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,t){let i=setTimeout(()=>{this.motionTimers.delete(i),this.destroyed||e()},t);this.motionTimers.add(i)}animateOnce(e,t,i=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),i))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){let t=this.reducedMotion(),i=(e.items??[]).filter(o=>o.objectType!=="ga").slice(0,10).map(o=>this.controller.seatByLabel(o.label)).filter(o=>!!o);cs({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)},i)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(i=>i.id!==e&&i.id!==t)}pendingSelectionCount(){return Wr(this)}heldTicketCount(){return Yr(this)}totalTicketCount(){return Xr(this)}updateSelectionCapacity(){Zr(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){Qr(this,e,t)}setCtaPhase(e){Jr(this,e)}runCheckoutHandoff(e,t){return ea(this,e,t)}holdStorageKey(){return ta(this)}rememberedHoldId(){return ia(this)}rememberHold(e){na(this,e)}forgetHold(){oa(this)}resumeHoldFromServer(e){return sa(this,e)}restoreRememberedHold(){return ra(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let i=this.controller.getActiveFloorId();return(t.find(o=>o.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=sr({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 Ri(this,e)}catPriceRange(e){return Ii(this,e)}buildPriceFilter(){ba(this)}applyPriceBand(e){ya(this,e)}buildArenaChrome(){let e=this.controller.doc;if(this.rungsEl=null,this.projectionEl=null,this.floorsEl=null,!e||!this.els.map){this.syncArenaViewportInsets();return}let t=e.objects.some(i=>i.type==="section")||(e.floors??[]).some(i=>i.objects.some(o=>o.type==="section"));if(this.canOffer3d()){let i=document.createElement("div");i.className="sl-projection",i.setAttribute("role","group"),i.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),i.innerHTML=`<button type="button" data-view="map" aria-pressed="true" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,i.querySelectorAll("button").forEach(o=>{if(o.dataset.view==="venue3d")for(let s of["pointerenter","focus","pointerdown"])o.addEventListener(s,Qt,{once:!0});o.addEventListener("click",()=>{this.setBuyerView(o.dataset.view)})}),this.regions["top-right"].appendChild(i),this.projectionEl=i,this.syncProjection()}if(t){let i=[...e.objects,...(e.floors??[]).flatMap(d=>d.objects)],o=new Set((e.zones??[]).map(d=>d.id)),a=e.floorOverview==="combined"&&(e.floors?.length??0)>1&&o.size===0||i.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",_("picker.zoomLevel"));let c={zones:_("picker.rungLabel.zones"),sections:_("picker.rungLabel.sections"),seats:_("picker.rungLabel.seats")},h={zones:_("picker.rungTip.zones"),sections:_("picker.rungTip.sections"),seats:_("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 m=d.dataset.rung;this.controller.setRung(m),m==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(l),this.rungsEl=l,this.syncRung()}if(this.controller.isMultiFloor()){let i=Ls({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(i),this.floorsEl=i,this.syncFloors()}this.syncArenaViewportInsets()}syncArenaViewportInsets(){let e=this.els.map,t=e?Ps(e.getBoundingClientRect(),[this.floorsEl,this.rungsEl,this.projectionEl].map(i=>i?.isConnected?i.getBoundingClientRect():null),[]):{top:0,right:0,bottom:0,left:0};Object.keys(t).every(i=>t[i]===this.arenaViewportInsets[i])||(this.arenaViewportInsets=t,this.controller.setViewportInsets(t),this.syncFitClearance())}syncFitClearance(){let e=this.els.map,t=this.els.zoom,i=this.root?.dataset.layout==="narrow",o=0;if(i&&e&&t?.isConnected){let s=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.height>0&&(o=Math.max(0,s.bottom-r.top+8))}this.controller.setFitClearance?.(o)}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.syncMapStepBack(),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(i=>{let o=i.dataset.rung===e;i.classList.toggle("on",o),i.setAttribute("aria-pressed",String(o))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit,i=this.els?.zin;if(!e||!this.root)return;let o=this.controller.getRenderer?.(),s=this.controller.canZoomIn?.()===!1||o?.seatsPickable?.()===!0,r=As({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0,atVenueFit:this.controller.atVenueFit?.()})==="none",a=e.disabled!==r||!!t&&t.disabled!==r||!!i&&i.disabled!==s||e.hidden||!!i?.hidden||!!t?.hidden;e.disabled=r,e.hidden=!1,i&&(i.disabled=s,i.hidden=!1),t&&(t.disabled=r,t.hidden=!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||!Zt()?!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)?Da/2:Da}syncFloors(){Ms(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new Ti({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(o=>o.type==="section"&&!this.controller.isSectionClosed(o.id)&&this.controller.getSectionSeatCount(o.id)>0);if(t.length<2)return null;let i=t.findIndex(o=>o.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}markedSeatAnnouncement(e){let t=wn(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return zs(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 i=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=i?this.catPriceRange(i):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=Ue(c),d=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,m=l?`${h} ${d}, ${l.bookingMode==="variable"?_("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):_("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${h} ${d}`:c?.objectType==="table"?`${h} ${d}, ${_("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:_("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${m}, ${i?.label??e.categoryKey}${a?`, ${a}`:""}, ${s}`}showTableDialog(e,t,i){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=i??document.activeElement;let 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=To(e,{variable:s,held:t,typeWord:Ue(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 i=t.querySelector("output[data-table-qty]");i&&(i.value=String(e.quantity));let o=t.querySelector("input[data-table-qty]");o&&(o.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let 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 i=this.tableDialogEl?.querySelector(".sl-table-confirm");if(i&&(i.disabled=!0,i.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let o=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!o){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},this.startHoldTimer(o.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast(_("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(o){this.opts.onError?.(o),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){i&&(i.disabled=!1,i.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new Li({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,i,o)=>this.paidPrice(e,t,i,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(),releaseHeldSeat:e=>this.controller.currentHold()?.labels.includes(e.label)?this.removeHeldLabels([e.label]):null,reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e),cartLanded:()=>this.cartLanded()})),this.confirmCardCache}showConfirm(e,t="add"){this.confirmCard.show(e,t)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}cartLanded(){this.animateOnce(this.els.count,"sl-value-pop",380),this.animateOnce(this.els.total,"sl-value-pop",380)}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){nr(e,t,this.reducedMotion())}addSeatLabel(e){return or(e,(t,i)=>this.tf(t,i))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,i=this.controller.doc,o=this.controller.getActiveFloorId(),s=e.focalPoint??i?.floors?.find(d=>d.id===o)?.focalPoint??i?.focalPoint??{x:0,y:0},r,a,l=!1;if(e.viewUrl){let d,m=null;try{let f=e.viewMeta?.previewUrl;f&&f!==e.viewUrl?(m=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&&!m||!this.root||!this.seatViewEnabled())return;let p={url:d,...m?{previewUrl:m}:{},...e.viewMeta?.sourceWidth!==void 0?{sourceWidth:e.viewMeta.sourceWidth}:{},...e.viewMeta?.sourceHeight!==void 0?{sourceHeight:e.viewMeta.sourceHeight}:{},...e.viewMeta?.previewWidth!==void 0?{previewWidth:e.viewMeta.previewWidth}:{},...e.viewMeta?.previewHeight!==void 0?{previewHeight:e.viewMeta.previewHeight}:{},...e.viewMeta?.variants?.length?{variants:e.viewMeta.variants}:{},...e.viewMeta?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};r=p,a=kp(p),l=Sp(p)}else{let d;try{let{generateSeatPanorama:m}=await Jt();d=m(e,s,this.allSeats())}catch(m){t===this.seatViewGen&&this.opts.onError?.(m);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;r={url:d.url,generated:!0},a=_("picker.illustrationCaption",{m:d.distanceM})}this.closeSeatView(!1);let c=_("picker.viewFromSeat",{label:e.label}),h=mi({root:this.root,source:r,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:Ve(),viewFromSeatLabel:c,real360Label:_("picker.real360"),previewLabel:_("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 i=Number.isInteger(e);return vp(e,this.currency,{locale:this.opts.locale,fallback:(o,s)=>`${o} ${s}`,...i?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),i=Cs(e,t);if(i==null)return;let o=6*36e5,s=Math.min(Math.max(i-t+1e3,1e3),o);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},s)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<Cp}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||this.offerReadIsCurrent()||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}refreshOfferAvailability(e){if(!this.api.availability||this.destroyed)return Promise.resolve();if(this.offerReadInFlight)return this.offerReadInFlight;if(this.offerReadIsCurrent())return Promise.resolve();let t=this.readOfferAvailability(e).finally(()=>{this.offerReadInFlight===t&&(this.offerReadInFlight=null)});return this.offerReadInFlight=t,t}async readOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;this.offerReadSettledAt=Date.now();let i=bn(t);if(!i)return;this.offerAvailability=i,this.applyChannelPricing(i.channelPricing),this.scheduleOfferBoundary(i);let o=yn(i),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?.(i)}catch{!this.destroyed&&!this.offerBoundaryTimer&&!document.hidden&&(this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},3e4))}}offerPrice(e){return e?this.offerAvailability?.prices.find(t=>t.categoryKey===e)??null:null}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,i=t?.release??null,o=i?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!o){e.classList.remove("has"),e.replaceChildren();return}let s=i??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=i?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let c=document.createElement("strong");c.className="sl-offer-name",c.textContent=s.name||(i?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));let h=document.createElement("span");h.className="sl-offer-line";let d=[];i&&t.fromPrice!=null&&d.push(this.money(t.fromPrice/100)),i&&s.remaining!=null&&d.push(_("picker.offerRemainingAvailable",{count:s.remaining})),i&&s.endsAt!=null&&d.push(_("picker.offerUntil",{time:ti(s.endsAt,this.eventTimezone,this.opts.locale)})),o?.startsAt!=null&&d.push(_("picker.offerStarts",{time:ti(o.startsAt,this.eventTimezone,this.opts.locale)})),h.textContent=d.join(" \xB7 "),a.append(l,c,h);let m=document.createElement("details");m.className="sl-offer-info";let p=document.createElement("summary");p.setAttribute("aria-label",_("picker.howOfferWorks",{name:c.textContent??""})),p.textContent="i";let f=document.createElement("div");f.className="sl-offer-detail",f.textContent=i?this.tf("picker.offerDetailActive","This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over."):this.tf("picker.offerDetailUpcoming","Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts."),m.append(p,f),r.append(a,m),e.replaceChildren(r),e.classList.add("has")}paidPrice(e,t,i,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?i:typeof r=="number"?r:t&&r.tiers?.[t]!==void 0?r.tiers[t]:r.base??i}legendDeps(){return va(this)}syncPriceRail(e,t,i=this.legendDeps()){wa(this,e,t,i)}syncPrices(){xa(this)}focusCategory(e){Sa(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(i=>!e.has(i.label)&&(this.controller.getStatus(i.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(i=>i.id)),this.toast(_("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:i,heldLabels:o,total:s,count:r}=Hi(this),a=[],l=new Set;if(!this.salesClosed){let g=this.performanceGroup?.nightSummary?.()??[];g.length&&a.push(_s(g,{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>${O(L.label)}</button>`)}let c={salesClosed:this.salesClosed,hasPicks:e.length>0||i.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(g=>g.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(jr(c)),this.els.trayHint&&(this.els.trayHint.textContent=Gr(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed);let h=!e.length&&!i.length&&!Ie(this.gaQty,this.hold?.items??[]);if(!this.performanceGroup&&!this.salesClosed&&!this.hold&&(h||this.bestAvailableBusy||this.bestAvailableConfirm)){let g=(this.controller.doc?.categories??[]).filter(N=>!N.notForSale),L=this.controller.getBestAvailableZones();this.baZone&&!L.some(N=>N.id===this.baZone)&&(this.baZone=""),a.push($r({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:!1,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:g,zones:L,selectedCategory:this.baCat,selectedZone:this.baZone}))}let d=(g,L,N,C=1,R,P,I)=>Vr({categoryLabel:I,d:g?this.controller.seatDetails(g):null,area:N==="ga"?t.find($=>$.id===R):void 0,label:L,objectType:N,quantity:C,identity:P,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),m=O,p=[];for(let g of jo(i)){let L=g.objectType==="ga"?`held:ga:${g.objectId}:${g.tierId??""}`:`held:${g.label}`;l.add(L);let N=this.controller.doc?.categories.find(Q=>Q.key===g.categoryKey),C=g.tierId?N?.tiers?.find(Q=>Q.id===g.tierId)?.name:void 0,R=g.objectType!=="ga"?this.controller.seatByLabel(g.label):null,P=g.objectType==="table"?this.controller.tableSelection(g.label):null,I=R?this.controller.seatDetails(R.id):null,$=this.seatViewEnabled()&&!!R&&g.objectType!=="table"&&!!this.deliverableViewReference(R),j=m(this.tf("picker.heldForYou","Held for you")),ue=P?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(g.label))}">${m(_("picker.guestsCountEdit",{count:g.quantity??1}))}</button>`:"",be=this.paidPrice(g.categoryKey,g.tierId,g.unitPrice,g.label)*(g.quantity??1);p.push({key:L,fresh:!this.lastTrayKeys.has(L),held:!0,seatIds:[],heldLabels:g.labels,removeAria:_("picker.removeHeldTicketLabel",{label:rn(g,t)}),locateId:R?.id??null,section:I?.sectionLabel??"",rowLabel:I&&K(I)||"",seatLabel:I?.seatNumber??g.label,categoryLabel:`${N?.label??g.categoryKey}${C?` \xB7 ${C}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(g.categoryKey)??N?.color??"",identityHtml:d(R?.id??null,g.label,g.objectType,g.quantity??1,g.objectId,P??void 0,`${N?.label??g.categoryKey}${C?` \xB7 ${C}`:""}`),stateHtml:`<span class="sl-ticket-state held" aria-label="${j}" title="${j}"><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:ue,amount:be,amountText:this.suppressPricing?"":this.money(be),noteHtml:$e(R??void 0),railHtml:this.performanceGroup?"":Hn(_("picker.removeHeldTicketLabel",{label:rn(g,t)}),$?g.label:null)})}let f=this.seatViewEnabled();for(let g of e.filter(L=>!o.has(L.label))){let L=`seat:${g.id}`;l.add(L);let N=this.controller.doc?.categories.find(Q=>Q.key===g.categoryKey),C=g.tiers&&g.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${m(g.id)}" aria-label="${m(_("picker.ticketTierFor",{label:g.label}))}">`+g.tiers.map(Q=>`<option value="${m(Q.id)}"${Q.id===g.tierId?" selected":""}>${m(Q.name)} \xB7 ${m(this.money(this.paidPrice(g.categoryKey,Q.id,Q.price,g.label)))}</option>`).join("")+"</select>":"",R=g.tiers?.find(Q=>Q.id===g.tierId)??g.tiers?.[0],P=R?.buyerMessage?.trim()||(R?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),I=this.controller.seatDetails(g.id),$=m(this.tf("picker.selected","Selected")),j=_("picker.removeSeatLabel",{label:g.label}),ue=(g.objectType==="table"&&g.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(g.label))}">${m(_("picker.guestsCountEdit",{count:g.quantity??1}))}</button>`:"")+C,be=this.paidPrice(g.categoryKey,g.tierId??null,g.price,g.label)*(g.quantity??1);p.push({key:L,fresh:!this.lastTrayKeys.has(L),held:!1,seatIds:[g.id],heldLabels:[],locateId:g.id,section:I?.sectionLabel??"",rowLabel:I&&K(I)||"",seatLabel:I?.seatNumber??g.label,categoryLabel:N?.label??g.categoryKey,identityHtml:d(g.id,g.label,g.objectType,g.quantity??1,g.objectId,g,N?.label??g.categoryKey),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(g.categoryKey)??N?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${$}" title="${$}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:ue,amount:be,amountText:this.suppressPricing?"":this.money(be),removeAria:j,noteHtml:$e(g)+(P?`<small class="sl-tier-note">${m(P)}</small>`:""),railHtml:Hn(j,f&&g.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(g.label)??{})?g.label:null)})}p.length&&a.push(p.map(zr).join("")),t.length&&a.push(Wo(this,t,i)),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let y=this.performanceGroup?.selectNight;y&&qs(this.els.tray,g=>y(g)),this.els.tray.querySelectorAll("[data-ba]").forEach(g=>{g.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(g.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",g=>{this.baCat=g.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",g=>{this.baZone=g.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelectorAll(".sl-chip .rm").forEach(g=>{g.addEventListener("click",()=>{let L=g.closest(".sl-chip");if(L.dataset.held){this.removeHeldLabels(decodeURIComponent(L.dataset.held).split(`
3190
- `),L);return}let N=L.dataset.seat.split(" "),C=()=>{this.controller.deselect(N)};if(this.reducedMotion()){C();return}L.classList.remove("sl-enter"),L.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(C,W.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(g=>{g.addEventListener("click",L=>{L.stopPropagation();let N=decodeURIComponent(g.dataset.tableEdit??""),C=this.controller.tableSelection(N);if(!C)return;let R=i.find(P=>P.label===N&&P.objectType==="table");this.showTableDialog({...C,quantity:R?.quantity??C.quantity},!!R,g)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(g=>{g.addEventListener("change",()=>this.controller.setSeatTier(g.dataset.tier,g.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(g=>{g.addEventListener("click",()=>{let L=this.controller.seatByLabel(g.dataset.viewLabel);L&&this.openSeatView(L)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(g=>{let L=()=>this.controller.flashSeat(g.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");g.addEventListener("mouseenter",L),g.addEventListener("focusin",L),g.addEventListener("click",N=>{N.target.closest?.('button,a,select,[role="button"],input')||!this.controller.focusSeats?.([g.dataset.locate],{animate:!this.reducedMotion()})||L()})}),Yo(this,this.els.tray,t),this.controller.setGASelection(Vo(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(g=>{g.disabled=!0});let T=this.pendingSelectionCount(),S=this.lastTrayCount,v=this.lastTrayTotal,A=Us(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");this.els.count.textContent=A||(r?$i("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=A||(r?$i("picker.seatsSelectedCount",r):"")),this.syncCta(r,T);let G=this.root?.dataset.layout==="narrow"&&this.root?.dataset.confirming==="true";r!==S&&!G&&this.animateOnce(this.els.count,"sl-value-pop",380),s!==v&&!G&&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(){ws(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(xs),this.els.tray?.querySelectorAll(".sl-ba-go").forEach(Ss)}emitSelectionValidity(e,t){let i=this.controller.getSelectionValidity(e);i&&(i.seats=t,this.opts.onSelectionValidityChange?.(i),i.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(i),this.lastSelectionValidity=i.isValid)}async removeHeldLabels(e,t){let i=e.filter(r=>r&&!this.releasingLabels.has(r));if(!i.length)return!1;let o=i[0];i.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(i))return this.toast(_("picker.couldNotRemoveLabel",{label:o}),"error"),!1;Go(this.gaQty,this.hold?.items??[],i);let l=this.controller.currentHold();return this.hold=l?{holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items}:null,this.handedOff=!!this.hold&&r,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),!0}finally{i.forEach(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(Ni(e,(i,o)=>this.tf(i,o)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast(_("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(i=>!(this.hold.items??[]).some(o=>o.label===i.label))){let i=this.hold.seats??t;this.handedOff=!0,this.holdConflicted=!1,await this.runCheckoutHandoff(this.hold,i);return}this.holdingLabels=new Set(t.map(i=>i.label)),this.setCtaPhase("holding");try{let i=null,o=Fo(this.gaQty),s=this.committedSelection();if(s.length){let r=await this.controller.hold(void 0,this.opts.holdTtlMs);i=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});i=c?{holdId:c.holdId,expiresAt:c.expiresAt,seats:c.seats,items:c.items}:i}if(!i){this.raiseHoldConflict(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.")),this.setCtaPhase("idle"),this.syncTray();return}this.hold=i,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(i.expiresAt),this.flashHeldSeats(i),this.emitHoldChange(),this.performanceGroup?this.setCtaPhase("idle"):await this.runCheckoutHandoff(i,i.seats??s)}catch(i){this.opts.onError?.(i);let o=i,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?_("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):_("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){aa(this,e)}stopHoldTimer(){la(this)}setExtendPrompt(e,t){ca(this,e,t)}refreshExtendPrompt(){da(this)}handleExtend(){return pa(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),i=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=i?.seats?`<span class="sl-booked-seats">${$i("picker.group.ticketsConfirmedAcross",i.seats,{performances:i.performances})}</span>`:`<span class="sl-booked-seats">${$i("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>${O(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 i=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=po(o?.reason),a=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:r,handoff:i}),this.opts.onCheckout?.(e,t,i),a||this.openCheckoutPanel({kind:"unavailable",reason:r,seatCount:i.lineItems.reduce((l,c)=>l+c.quantity,0)});return}await this.openCheckoutPanel({kind:"pay",provider:s,order:{holdId:i.holdId,expiresAt:i.expiresAt,currency:i.currency,total:i.total,labels:i.lineItems.map(r=>r.displayLabel??r.label)}})}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await ei())}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held \u2014 please try again."),"error"),this.setCtaPhase("idle");return}this.destroyed||!this.root||(this.closeCheckoutPanel(),this.checkoutPanel=t({root:this.root,state:e,eventKey:this.opts.event,formatMoney:i=>this.money(i),startSession:i=>this.pubApi.startCheckout(this.opts.event,{...i,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:i=>this.pubApi.orderStatus(i),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:i=>{this.opts.onOrderConfirmed?.(i),this.controller.refresh()},onError:i=>this.opts.onError?.(i)}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let i=(e.items??[]).map(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=i[0]?.currency??this.currency,s=i.reduce((r,a)=>r+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:o,lineItems:i,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",i){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",!!i),i){let r=document.createElement("button");r.type="button",r.className="sl-toast-action",r.textContent=i.label,r.addEventListener("click",i.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"),i=this.confirmEl;if(!t||!i?.isConnected){e.style.removeProperty("bottom");return}let o=this.els.map.clientHeight;if(o<=0)return;let s=i.getBoundingClientRect(),r=s.height||i.offsetHeight||Lp,a=s.height?s.top-this.els.map.getBoundingClientRect().top:o-Sn-r,l=Math.round(o-a+Ap);if(l+Pp>o){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){cr({boot:this.els.boot,map:this.els.map,rail:this.els.rail,root:this.root,reducedMotion:this.reducedMotion()})}placeTooltip(){if(!this.tipEl)return;let e={width:this.els.map.clientWidth,height:this.els.map.clientHeight},t={width:this.tipEl.offsetWidth,height:this.tipEl.offsetHeight},i=this.tipPinned?Ys(this.tipPos,e,t):null,o=i??Ws(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${o.left}px`,this.tipEl.style.top=`${o.top}px`,i?this.tipEl.dataset.placement=i.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let i=this.performanceGroup,o=wn(e.mark,i?.nights?.()),s=o?.states.filter(r=>r.free).length??0;return Ns(o,{locale:this.opts.locale,switchLabel:i?.selectionModeSwitch?.label??null,selectPartialLabel:i?.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 i=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t);this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let o=this.nightStripFor(e,i);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=Ks(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:Ue(e),extra:o+(i?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${O(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=i,this.tipEl.classList.toggle("sl-tip-pinned",i),this.tipEl.querySelector("[data-pg-tip-close]")?.addEventListener("click",()=>this.unpinTooltip()),this.tipEl.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>{this.unpinTooltip(),this.performanceGroup?.selectionModeSwitch?.activate()}),Qs(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 i={};for(let[o,s]of Object.entries(e())){let r=this.controller.idForLabel(o);r&&(i[r]=s)}Object.keys(i).length&&t.setSeatMarks(i)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),i=this.controller.getSelection().filter(o=>t.has(o.id)||t.has(o.label));if(i.length===t.size)return i;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.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=Kt(this.themeMode),i=ot(this.controller.doc?.theme,this.opts.theme,t);for(let[o,s]of Object.entries(i))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=Wt(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(nt(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:Kt(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Kt(this.themeMode),i=ot(this.controller.doc?.theme,this.opts.theme,t),o=nt(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,s=no(i,o);for(let r of io)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),i=JSON.stringify(e??null);t!==i&&(this.opts.pricing=e,!(this.destroyed||!this.els.prices)&&(this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=Ro(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=Na(),i=this.localeGeneration+=1,o=await wp(e);return this.opts.messages&&xp(this.opts.messages),o===t||this.applyActiveLocale(o,i),o}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(Io(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(),Hp(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 kr(this)}setBuyerView(e,t){Tr(this,e,t)}seatState3dFor(e){return Er(this,e)}pushAvailabilityTo3d(){Cr(this)}syncSelectionTo3d(){Ar(this)}seatViewFor3d(e){return Pr(this,e)}onView3dSeatPick(e){Lr(this,e)}seatViewCaption(e){return Mr(this,e)}saveView3dComparisonSeat(e){Hr(this,e)}clearView3dComparison(){Rr(this)}view3dComparisonSnapshot(e){return Ir(this,e)}enter3d(e){return Or(this,e)}publish3dTopInset(){_r(this)}exit3d(){Nr(this)}openSeatConfidencePassport(e,t=null){Mn(this,e,t)}closeSeatConfidencePassport(e=!0){Ft(this,e)}openView3dComparison(){vr(this)}closeView3dComparison(e=!0){qe(this,e)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e)}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,i={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,i)}catch(o){this.opts.onError?.(o);let s=o?.reason,r=s==="not_enough_together"?_("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,i={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");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,{...i,ttlMs:this.opts.holdTtlMs});return s?(this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(s.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),i.preferPremium&&s.seats.length&&!s.seats.every(r=>r.commercial?.premium)&&this.toast(_("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),i=!0;if(t)i=await this.controller.release();else if(e){let o=[...new Set([...(e.items??[]).map(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),i=!1}}if(!i){this.toast(this.tf("picker.couldNotReleaseTickets","Couldn't release your tickets. Your hold is unchanged."),"error");return}this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.syncTray(),this.emitHoldChange()}startRealtime(){if(!this.access?.configured||!this.pubApi||this.realtime)return;let e=this.opts.event;this.realtime=new ke({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:Ct(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,i)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:i}),this.syncTray(),this.toast(i==="ineligible"?this.tf("picker.seatNoLongerYours","Some seats are no longer available to you. They have been removed from your order."):this.tf("picker.seatTaken","Someone else took a seat you had picked. It has been removed from your order."),"warning")}})}),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),ye(this,!1)}showAccessPanel(e){if(this.destroyed||!this.root)return;this.dismissAccessPanel(),this.clearDecisionSurfaces();let t=Eo(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=Pa({restart:()=>this.restartAfterHoldExpiry()},this.holdExpiredUnits);this.root.appendChild(e),this.holdExpiredEl=e,requestAnimationFrame(()=>e.querySelector(".sl-interrupt-act")?.focus());let t=this.holdExpiredUnits;this.holdExpiredFresh=!1,this.refreshAvailability().then(()=>{if(this.destroyed||this.holdExpiredEl!==e)return;this.holdExpiredFresh=!0;let i=t.filter(r=>r.objectType!=="ga"),o=[],s=[];for(let r of i){let a=this.controller.seatByLabel(r.label);(a&&this.controller.getStatus(a.id)==="free"?o:s).push(r.label)}Aa(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||Ca({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:i=>this.controller.seatByLabel(i),statusOf:i=>this.controller.getStatus(i),flash:(i,o)=>this.controller.flashSeat(i,o)},e)}).catch(()=>{})}destroy(){this.destroyed=!0,An(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),ye(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)}};import{formatMoney as jp,loadLocale as Gp,setStringOverrides as Up,t as qp}from"@seatlayer/core";var Va="seatlayer-performance-group-picker-style";function za(){if(document.getElementById(Va))return;let n=document.createElement("style");n.id=Va,n.textContent=`
3201
+ }`,e.append(t);let i="linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.04) 63%)",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 d=document.createElement("div");return d.className="sl-shimmer",Object.assign(d.style,{background:i,borderRadius:"8px"}),Object.assign(d.style,c),d};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:i,flex:"0 0 auto"}),a.append(l),a.append(document.createTextNode("Loading designer\u2026")),e.append(a)}buildErrorCard(e,t){let i=Xc[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=i.title,Object.assign(s.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let r=document.createElement("p");r.textContent=i.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)}};function Ft(n,e){let t=document.createElement("div");t.className="sl-loading-state";let i=document.createElement("div");if(i.setAttribute("role",e.busy?"status":"alert"),i.setAttribute("aria-atomic","true"),e.busy){let r=document.createElement("div");r.className="sl-boot-spin",r.setAttribute("aria-hidden","true"),t.append(r)}let o=document.createElement("div");if(o.className="sl-boot-title",o.textContent=e.title,i.append(o),e.description){let r=document.createElement("p");r.className="sl-loading-description",r.textContent=e.description,i.append(r)}t.append(i);let s=null;return e.actionLabel&&(s=document.createElement("button"),s.type="button",s.className="sl-boot-retry",s.textContent=e.actionLabel,t.append(s)),n.replaceChildren(t),s}function xs(n,e){let t=new Set(["chart","objects","resume","availability"]),i=new Map;return new Proxy(Object.create(n),{get(o,s){let r=n,a=Reflect.get(r,s,r);return typeof a!="function"?a:(i.has(s)||i.set(s,t.has(String(s))?async(...l)=>{let c=await dt(()=>a.apply(r,l),e,()=>{});if(c.outcome==="loaded")return c.value;if(c.outcome==="error")throw c.error;let d=new Error(c.outcome==="timeout"?"request_timeout":"request_cancelled");throw d.name=c.outcome==="timeout"?"TimeoutError":"AbortError",d}:a.bind(r)),i.get(s))}})}import{PickerController as Sp,formatMoney as kp,getLocale as Va,loadLocale as Tp,setStringOverrides as Ep,t as N,tCount as Ui}from"@seatlayer/core";import{isAuthoredSeatView as Cp,seatViewDisclosure as Ap}from"@seatlayer/core/view3d/crossfade/panorama";function Ss(n){return!!n&&n.clientWidth>0&&n.scrollWidth>n.clientWidth+1}function Zc(n){return n.some(e=>Ss(e))}var Ci="data-fit-gone",Qc=12;function vn(n,e,t=Ss){if(!n)return 0;for(let i of e)n.classList.remove(i.cls);if(n.querySelectorAll(`[${Ci}]`).forEach(i=>{i.removeAttribute(Ci),i.hidden=!1}),n.dataset.fit="0",n.clientWidth<=0||!t(n))return 0;for(let i=0;i<e.length;i+=1){let o=e[i];i>0&&n.classList.remove(e[i-1].cls),n.classList.add(o.cls),n.dataset.fit=String(i+1);let s=o.give?o.give(n):!0;if(!t(n))return i+1;if(o.repeat&&o.give){for(let r=1;s&&r<Qc;r+=1)if(s=o.give(n),!t(n))return i+1}}return e.length}function Jc(n,e="[data-fit-seg]"){let t=[...n.querySelectorAll(e)].filter(i=>!i.hidden);return t.length<2?!1:ks(t[t.length-1])}function ed(n,e){let t=n.querySelector(e);return t&&!t.hidden?ks(t):!1}function ks(n){let e=n.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(Ci,""),e.hidden=!0),n.setAttribute(Ci,""),n.hidden=!0,!0}function td(n){if(!n)return!1;let e=(n.getAttribute("aria-label")||n.textContent||"").trim();return e?(n.setAttribute("aria-label",e),n.setAttribute("title",e),!0):!1}function Ts(n){if(!n)return 0;let e=n.querySelector(".sl-confirm-cancel"),t=n.querySelector(".sl-confirm-add-t");return vn(n,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>td(e)}],()=>Zc([e,t]))}function Es(n){return vn(n,[{cls:"sl-fit-notype",give:e=>ed(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>Jc(e),repeat:!0}])}function Cs(n){return n?(n.classList.add("sl-fitpill"),vn(n,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var id=["on-sale","low","sold-out","presale","closed"];function Vt(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function Ps(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function As(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n,t=e.count,i=e.index;if(typeof i!="number"||!Number.isInteger(i)||i<1||typeof t!="number"||!Number.isInteger(t)||t<i)return;let o=e.remaining;if(o!=null&&(typeof o!="number"||!Number.isInteger(o)||o<0))return;let s={index:i,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=Ps(e[r]);if(a===void 0)return;s[r]=a}return s}function nd(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],i=new Set;for(let 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||i.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],d=new Set;for(let p of a.priceOverrides){if(!p||typeof p!="object"||Array.isArray(p))return;let u=p,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"",y=u.tierId===null?null:typeof u.tierId=="string"&&u.tierId.trim()?u.tierId.trim():void 0,f=Vt(u.price);if(!h||y===void 0||f===void 0||f===null)return;let T=`${h}\0${y??""}`;if(d.has(T))return;d.add(T),c.push({categoryKey:h,tierId:y,price:f})}i.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)||!i.has(c))return;s.add(l),o.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:o}}function wn(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=id.find(d=>d===e.state);if(!t)return null;let i=Vt(e.fromPrice),o=Vt(e.previousPrice);if(i===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=As(e.release);if(r===void 0)return null;let a=e.upcoming===void 0?null:As(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let d=[];for(let p of e.prices){if(!p||typeof p!="object"||Array.isArray(p))return null;let u=p,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"";if(!h)return null;let y=Vt(u.price),f=Vt(u.previousPrice);if(y==null||f===void 0)return null;let T={categoryKey:h,price:y,previousPrice:f};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=Ps(u[S]);if(v===void 0)return null;T[S]=v}d.push(T)}l=d}let c=nd(e.channelPricing);return c===void 0?null:{state:t,fromPrice:i,previousPrice:o,currency:s,release:r,upcoming:a,prices:l,channelPricing:c}}function Ls(n){return n?.changed!==!1}function Ms(n,e){if(!n)return null;let t=null,i=o=>{o!=null&&o>e&&(t===null||o<t)&&(t=o)};for(let o of[n.release,n.upcoming])i(o?.startsAt),i(o?.endsAt);for(let o of n.prices)i(o.startsAt),i(o.endsAt);return t}function xn(n){let e={};for(let t of n?.prices??[])e[t.categoryKey]=t.price;return e}function Hs(n){return n.focusedSection!==null?n.deeperThanSectionFrame===!1?"venue":"section":n.atVenueFit!==void 0?n.atVenueFit?"none":"venue":n.seatsRevealed?"venue":"none"}function Rs(n,e,t=[],i=8){let o=e.reduce((r,a)=>!a||a.width<=0||a.height<=0?r:Math.max(r,a.bottom-n.top+i),0),s=t.reduce((r,a)=>!a||a.width<=0||a.height<=0?r:Math.max(r,n.bottom-a.top+i),o>0?i:0);return{top:Math.max(0,Math.ceil(o)),right:0,bottom:Math.max(0,Math.ceil(s)),left:0}}function Is(n){let e=document.createElement("div");e.className="sl-floors on",e.setAttribute("role","group"),e.setAttribute("aria-label",n.tf("picker.chooseLevel","Choose level"));let t=[{id:"",name:n.tf("picker.allLevels","All levels")},...n.floors.map(r=>({id:r.id,name:r.name}))],i=document.createElement("span");i.className="sl-floor-label",i.textContent=`${n.tf("picker.levels","Level")}:`,e.appendChild(i);let o=document.createElement("select");o.className="sl-floor-select",o.setAttribute("aria-label",n.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=n.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",()=>n.onChoose(o.value)),e.appendChild(o),e}function Os(n,e,t){if(!n)return;let i=t?"":e,o=n.querySelector(".sl-floor-select");o&&(o.value=i)}var Ai=class{constructor(e){this.el=null;this.current=null;this.collapsed=!1;this.shownAt=0;this.host=e}get summary(){return this.current}adopt(e){this.current=e}get element(){return this.el}show(e){if(e&&e.id!==this.current?.id&&this.host.collapseSheet(),this.current=e,!e){this.el?.remove(),this.el=null,this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}render(e){this.el?.remove(),this.el=null}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,i=this.host.map();if(!e||!t||!i)return 0;let o=this.host.activeFloorObjects().find(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),d=Math.max(...r)-l,p=Math.max(...a)-c;if(d<=0||p<=0)return 0;let u=i.getBoundingClientRect(),h=e.getBoundingClientRect(),y=h.left-u.left,f=h.top-u.top,T=Math.max(0,Math.min(y+h.width,l+d)-Math.max(y,l)),S=Math.max(0,Math.min(f+h.height,c+p)-Math.max(f,c));return T*S/(d*p)}};import{t as An,tCount as bd}from"@seatlayer/core";import{contrastRatio as yd}from"@seatlayer/core/core/color";import{t as _s,tCount as Pi}from"@seatlayer/core";function Sn(n,e,t){try{return new Intl.DateTimeFormat(e,{...t,...n.timezone?{timeZone:n.timezone}:{}}).format(new Date(n.startsAt))}catch{return new Date(n.startsAt).toLocaleString(e)}}var Li=(n,e)=>Sn(n,e,{dateStyle:"medium"}),Mi=(n,e)=>Sn(n,e,{timeStyle:"short"}),Hi=(n,e)=>Sn(n,e,{weekday:"short",day:"numeric",month:"short"});function Ns(n,e,t,i){return!n.length||n.length>=e?null:{summary:i,labels:n.map(o=>`${Li(o,t)} \xB7 ${Mi(o,t)}`)}}function od(n,e){let t=new Set(e);return n.map(i=>({...i,free:!t.has(i.eventKey)}))}function Ds(n,e){let t=[...n];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function sd(n,e,t="",i=!1){if(!n.length)return"";let o=n.map(s=>{let r=s.free?e.free:e.blocked,a=i&&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 rd(n){return n.selectPartialLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${E(n.selectPartialLabel)}</button>`:n.switchLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${E(n.switchLabel)}</button>`:n.switchLabel||n.selectPartialLabel?"":`<p class="sl-tip-advice">${E(n.advice)}</p>`}function ad(n){return Number(n.available)+Number(n.selected)+Number(n.partial)+Number(n.unavailable)}function Bs(n,e,t){if(ad(n)<2)return"";let i=(s,r,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${s}"${a}></i>${E(r)}</li>`,o=[];return n.available&&o.push(i("sl-pg-sw-free",e.available,` style="background:${E(t)}"`)),n.selected&&o.push(i("sl-pg-sw-sel",e.selected)),n.partial&&o.push(i("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${E(t)}"`)),n.unavailable&&o.push(i("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${E(e.title)}">${o.join("")}</ul>`}function Fs(n,e){if(!n.length)return"";let t=n.map(i=>{let o=i.labels.length?i.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${i.labels.length?"":" empty"}${i.active?" active":""}" role="button" tabindex="0"${i.active?' aria-current="true"':""} data-event-key="${E(i.eventKey)}"><span class="n">${E(i.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 kn(n,e){if(n?.kind!=="partial"||!e?.length)return null;let t=n.data?.blockedEventKeys??[],i=od(e,t);return{states:i,missing:i.filter(o=>!o.free).map(o=>o.shortDate)}}function Vs(n,e){return n?sd(n.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:_s("picker.group.notAvailableOn",{dates:Ds(n.missing,e.locale)})},rd({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 ld(n,e,t,i){if(!n.length)return"";let o=new Set(e),s=new Set(t),r=n.map(a=>{let l=o.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${E(a.eventKey)}" aria-label="${E(`${a.shortDate}: ${l?i.available:i.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?i.available:i.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${E(i.title)}</legend><p class="sl-confirm-dates-copy">${E(i.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${E(i.selectAll)}</span></label><ul>${r}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function zs(n,e,t,i){let o=e.availableEventKeys(t);return ld(n,o,e.includedEventKeys(),{title:i("picker.group.confirmDatesTitle","Choose performance dates"),copy:o.length===n.length?i("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(n.length)):i("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(n.length)),selectAll:i("picker.group.confirmSelectAll","Select all available dates"),available:i("picker.group.nightFree","Available"),unavailable:i("picker.group.nightBlocked","Unavailable")})}function $s(n){return[...n.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function js(n,e,t,i){let o=[...n.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!o.length)return;let s=n.querySelector(".sl-confirm-add"),r=n.querySelector("[data-pg-confirm-all]"),a=()=>{let l=o.filter(p=>!p.disabled),c=$s(n).length;r&&(r.checked=c===l.length,r.indeterminate=c>0&&c<l.length);let d=n.querySelector("[data-pg-confirm-summary]");d&&(d.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"),i()};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 Gs(n,e,t){if(!n||!t||!n.querySelector("[data-pg-confirm-event-key]"))return!0;let i=$s(n);if(!i.length)return!1;let o=n.querySelector(".sl-confirm-add");return o?.setAttribute("aria-busy","true"),o&&(o.disabled=!0),await t.apply(e,i)?!0:(o?.removeAttribute("aria-busy"),o?.isConnected&&(o.disabled=!1),!1)}function Us(n,e,t){return n?_s("picker.group.seatPartlyAvailable",{label:e,free:n.states.length-n.missing.length,total:n.states.length,dates:Ds(n.missing,t)}):""}function qs(n,e){let t=n.map((i,o)=>{let s=i.state==="done"?e.done:i.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${E(i.id)}" data-state="${E(i.state)}"${i.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${i.state==="done"?"\u2713":String(o+1)}</span><span class="l">${E(i.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 Tn(n,e){return`<ul class="sl-pg-cards">${n.map(i=>`<li class="sl-pg-card" data-event-key="${E(i.eventKey)}"><span class="n">${E(i.name)}</span><time datetime="${E(i.iso)}"><span class="d">${E(i.date)}</span><span class="t">${E(i.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${E(e)}</p>`}function Ks(n){let e=n.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(", "):n.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${E(n.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(n.note?`<p class="sl-pg-pane-note">${E(n.note)}</p>`:"")+(n.total?`<div class="sl-pg-pane-total"><span>${E(n.total.label)}</span><b>${E(n.total.amount)}</b></div>`:"")+(n.holdStatus?`<p class="sl-pg-hold-status" role="status">${E(n.holdStatus)}</p>`:"")}function Ws(n){let e=Math.max(0,n);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function Ys(n,e){if(!n||n.seats<=0)return"";if(e==="same_seat"){let t=n.perPerformance??n.seats;return n.totalPerformances&&n.performances<n.totalPerformances?Pi("picker.group.performancesChosenOf",t,{chosen:n.performances,total:n.totalPerformances}):Pi("picker.group.seatsEveryPerformance",t)}return n.perPerformance!=null&&n.performancesChosen===n.performances?Pi("picker.group.seatsPerPerformance",n.seats,{per:n.perPerformance}):Pi("picker.group.performancesChosenOf",n.seats,{chosen:n.performancesChosen,total:n.performances})}function Xs(n,e){n.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let i=()=>e(t.dataset.eventKey);t.addEventListener("click",i),t.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),i())})})}import{t as cd}from"@seatlayer/core";function Ne(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function dd(n,e){let t=n.objectType==="table"&&!!n.bookingMode,i=n.objectType==="booth",o=t||i||!n.seatNumber,s=o?n.rowLabel??n.displayLabel??n.label:n.seatNumber,r=t?`${b("picker.guests","Guests")} ${n.bookingMode==="variable"?`${n.minOccupancy}\u2013${n.maxOccupancy}`:n.capacity}`:!i&&n.rowLabel?`${e} ${q(n)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${o?" name":""}">${Ne(s)}</span>`+(r?`<span class="sl-tip-row">${Ne(r)}</span>`:"")+"</div>"+(n.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${b("picker.section","Section")}</span><span class="sl-tip-secname">${Ne(n.sectionLabel)}</span></div>`:"")+"</div>"}function Zs(n,e){let t=n.status==="not_for_sale",i=n.mark?.kind==="partial",o=n.status==="free"||i?"":`<span class="sl-tip-tag">${t?b("picker.notAvailable","Not available"):n.status==="held"?cd("map.statusHeld"):b("picker.sold","Sold")}</span>`,s=t?"":e.price,r=s?`<span class="sl-tip-amt">${Ne(s)}</span>`:"",a=!s&&e.priceNote?`<div class="sl-tip-note">${Ne(e.priceNote)}</div>`:"",l=je(n,{compact:!0}),c=e.reason?`<div class="sl-tip-reason">${Ne(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+dd(n,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${Ne(n.categoryColor)}"></span><span class="sl-tip-name">${Ne(n.categoryLabel)}</span>`+o+r+"</div>"+a+c+l+(e.extra??"")}function Qs(n,e,t,i){let o=n.x+14,s=n.y-i.height-12,r=n.y+18,a=s;o+i.width>e-8&&(o=n.x-i.width-14),s<8&&r+i.height<=t-8&&(a=r);let l=Math.max(8,t-i.height-8);return{left:Math.max(8,Math.min(o,Math.max(8,e-i.width-8))),top:Math.max(8,Math.min(a,l))}}function Js(n,e,t,i=22){let o=Math.max(8,Math.min(n.x-t.width/2,Math.max(8,e.width-t.width-8))),s=n.y-i-t.height,r=n.y+i;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 En=14,pd=12,hd=12,ud=8;function er(n,e,t,i=pd){let o=e.height-En-t.height,s=hd,r=o-i;if(r<=s)return{placement:"sheet",nudgeY:0};let a=(s+r)/2-n;return Math.abs(a)<=ud?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function tr(n,e,t,i,o=0){let s=t.width/2+12,r=Math.max(s,Math.min(e.width-s,n.x)),a=n.y+o+t.height+24<=e.height,l=n.y-o<t.height+24&&a?"below":"above",c=l==="above"?n.y-o:n.y+o,d=i&&l==="above"?Math.max(t.height+24,c):c;return{left:r,top:Math.max(8,Math.min(e.height-8,d)),placement:l}}function ir(n,e,t){let i=n.querySelector("[data-pg-select-partial]"),o=[...n.querySelectorAll("[data-pg-event-key]")],s=()=>o.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),r=()=>{if(!i)return;let a=s().length;i.disabled=a===0,i.textContent=e?.(a)??i.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())})}),i?.addEventListener("click",()=>{let a=s();a.length&&t?.(a)})}function Ke(n){let e=n?.displayType?.trim()||n?.rowType?.trim();return e||(n?.objectType==="table"?b("picker.table","Table"):n?.objectType==="booth"?b("picker.booth","Booth"):b("picker.row","Row"))}var md="sl-confirm-scrim",fd="--sl-scrim-mask";function gd(n){let e=Math.round(n.x),t=Math.round(n.y);return`radial-gradient(circle at ${e}px ${t}px, transparent 0 56px, #000 88px)`}function nr(n,e,t,i){let o=n??document.createElement("div");return n||(o.className=md),o.style.setProperty(fd,gd(i)),t.parentNode===e?o.nextSibling!==t&&e.insertBefore(o,t):o.parentNode!==e&&e.appendChild(o),o}function Cn(n){return n?.remove(),null}var or={passport:!1,compare:!1},vd=360,wd=160,xd=700,sr=450;function rr(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function Sd(n){return yd("#ffffff",n)>=3?"#ffffff":"#0b0f19"}var Ri=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 i=yt(e)?e.viewUrl??"":"",o=Ti(t);if(!i&&!o)return"";let s=i?null:Ei(e,e.focalPoint??t.focalPoint);if(!i&&s==null)return"";let r="";if(!i)return r;let a=O(An("picker.viewFromSeat",{label:e.label})),l=O(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 i=this.host;this.mode=t;let o=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,i.root()?.setAttribute("data-confirming","true"),i.els().side?.toggleAttribute("inert",!0),Object.values(i.regions()).forEach(C=>C.toggleAttribute("inert",!0)),i.controller.setSelectionFocus(e.id),o&&o!==e.id&&i.controller.deselect([o]),i.hideTooltip();let s=i.controller.seatDetails(e.id),r=i.controller.doc?.categories.find(C=>C.key===e.categoryKey),a=s?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),l=a!=null?i.paidPrice(e.categoryKey,s?.tierId??r?.tiers?.[0]?.id??null,a,e.label):void 0,c=xo(s,e.displayLabel??e.label,Ke(s)),d=s?.tiers??r?.tiers??[],p=s?.tierId??d[0]?.id,u=i.suppressPricing()?"":Eo(d,p,C=>i.money(i.paidPrice(e.categoryKey,C.id,C.price,e.label))),h=i.buyerView()==="venue3d",y=i.performanceGroup()?.confirmDateSelection??void 0,f=y?i.performanceGroup()?.nights?.()??[]:[],T=y?zs(f,y,e.id,(C,I)=>i.tf(C,I)):"";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",An("picker.confirmSeatLabel",{label:e.label}));let v=i.controller.getRenderer?.()?.categoryDisplayColor?.(e.categoryKey)??r?.color??"#6e7bff";S.style.setProperty("--sl-cat",v),S.style.setProperty("--sl-cat-ink",Sd(v));let A=String(s?.categoryLabel??r?.label??e.categoryKey),_=i.controller.categoryAvailability()[e.categoryKey],K=typeof _=="number"&&_>0?bd("picker.leftCount",_):"",g=i.suppressPricing()?`${s?.displayLabel??e.displayLabel??e.label}`:`${s?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?i.tf("picker.priceNotSupplied","Price not supplied"):i.money(l)}`,L=or.passport?wo(e,g,h):"",D=or.compare?vo(e,h?i.view3dCompareSeatIds():null):"";S.innerHTML=Co({identityFields:c,identity:So(s,e.displayLabel??e.label,Ke(s)),marker:yo({...s?.wheelchairSpaceType?{wheelchairSpaceType:s.wheelchairSpaceType}:{}}),see3dPill:ko(i.canOffer3d(),h),categoryColor:v,categoryLabel:A,priceLabel:!i.suppressPricing()&&l!=null?i.money(l):"",categoryLeftLabel:K,tierChoices:u,groupDates:T,wheelchair:"",commercial:je({...e.accessibility?.length?{accessibility:e.accessibility}:{},...s?.wheelchairSpaceType?{wheelchairSpaceType:s.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{}}),thumb:i.seatViewEnabled()&&i.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:h?`<div class="sl-confirm-inspect-row">${L}${D}${nn(i.canOffer3d(),h)}</div>`:nn(i.canOffer3d(),h),see3dRow:To(i.canOffer3d(),h),cancelLabel:An("common.cancel"),selectLabel:t==="remove"?i.tf("picker.removeSeat","Remove seat"):i.addSeatLabel(s?.objectType)}),t==="remove"&&S.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),i.els().map.appendChild(S),this.el=S;let H=S.querySelector(".sl-confirm-thumb"),R=H?.closest(".sl-confirm-thumbwrap")??null;if(H&&R){let C=!1,I=()=>{if(C||!R.isConnected)return;C=!0;let j=()=>{R.remove(),this.el===S&&i.reanchor()};if(i.reducedMotion()||typeof requestAnimationFrame!="function"){j();return}R.style.height=`${R.offsetHeight}px`,R.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{R.style.height="0px",R.style.opacity="0"}),setTimeout(j,wd)};H.addEventListener("error",I),H.addEventListener("load",()=>{H.naturalWidth||I()});let $=e.viewMeta?.previewUrl??e.viewUrl;$?i.resolveAssetUrl($).then(j=>{if(!(!S.isConnected||this.el!==S)){if(!j){I();return}H.src=j}}).catch(j=>{I(),i.onError(j)}):I()}i.reanchor(),this.liftSeatClearOfSheet(e),S.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{i.openSeatView(e)}),S.querySelector(".sl-confirm-confidence")?.addEventListener("click",C=>{i.openSeatConfidencePassport(e,C.currentTarget instanceof HTMLElement?C.currentTarget:null)}),S.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>i.saveView3dComparisonSeat(e)),S.querySelectorAll("[data-confirm-tier]").forEach(C=>{C.addEventListener("click",()=>{let I=C.dataset.confirmTier,$=d.find(ue=>ue.id===I);if(!$)return;i.controller.setSeatTier(e.id,$.id),S.querySelectorAll("[data-confirm-tier]").forEach(ue=>{ue.setAttribute("aria-pressed",String(ue===C))});let j=S.querySelector(".sl-confirm-price");j&&(j.textContent=i.money(i.paidPrice(e.categoryKey,$.id,$.price,e.label))),i.reanchor()})}),S.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(C=>{C.addEventListener("pointerdown",ti,{once:!0}),C.addEventListener("click",()=>{i.buyerView()==="venue3d"?(i.dismiss(),i.view3dHandle()?.flyToSeat(e.id)):(i.rememberView3dReturnSeat(e),i.dismiss(),i.enter3d(e.id))})}),js(S,y,(C,I)=>i.tf(C,I),()=>i.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 C=S.querySelector(".sl-confirm-add");C?.focus(),i.liftToastOverConfirm(),i.fitTranslatedRows(),i.inviteCommit(S,C)})}liftSeatClearOfSheet(e){let t=this.host.controller.getRenderer();this.framing={gestures:t?.getCameraGestureCount?.()??0,quietUntil:0},this.frameSeatForSheet(e)}frameSeatForSheet(e){let t=this.host,i=t.root();if(!this.el||i?.dataset.layout!=="narrow"||i?.dataset.view3d==="on")return;let o=t.els().map;if(!o)return;let s=t.controller.worldToScreen({x:e.x,y:e.y}),r=t.controller.getRenderer(),a=r?.getCameraGestureCount?.()??0,{nudgeY:l}=er(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 d=!t.reducedMotion();r?.panScreenBy?.({x:0,y:l},{animate:d}),this.lift={dy:c+l,gestures:a},this.framing&&(this.framing.gestures=a,this.framing.quietUntil=d?this.now()+xd:0)}reframeSeatForSheet(){let e=this.framing,t=this.seat;!e||!t||e.quietUntil&&this.now()<e.quietUntil||(this.host.controller.getRenderer()?.getCameraGestureCount?.()??e.gestures)!==e.gestures||this.frameSeatForSheet(t)}now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}settleLift(){let e=this.lift;if(this.lift=null,this.framing=null,!e)return;let t=this.host.controller.getRenderer();(t?.getCameraGestureCount?.()??e.gestures)===e.gestures&&t?.panScreenBy?.({x:0,y:-e.dy},{animate:!this.host.reducedMotion()})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),i=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=nr(this.scrim,i,this.el,t),Bo(this.el,t,i),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=Cn(this.scrim);let o=i.clientWidth,s=i.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,d=tr(t,{width:o,height:s},{width:r,height:a},l,c);this.el.dataset.placement=d.placement,this.el.style.left=`${d.left}px`,this.el.style.top=`${d.top}px`,pi(this.el,t,{left:d.left,top:d.top,width:r,height:a})}ghostActivation(){return rr()?performance.now()-this.shownAt<sr:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,i=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=i;let o=t.root();setTimeout(()=>{this.outsideTap===i&&(o??document).addEventListener("pointerdown",i,!0)},rr()?sr: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=Cn(this.scrim),this.settleLift(),this.el&&hi(this.el),this.el=null,this.seat=null,e.liftToastOverConfirm(),e.root()?.removeAttribute("data-confirming"),Object.values(e.regions()).forEach(t=>t.toggleAttribute("inert",!1)),e.applyPanelCollapsed(),e.controller.setSelectionFocus(null),e.syncTray()}async commit(){let e=this.host,t=this.seat;if(!t)return;let o=this.el?.querySelector(".sl-confirm-add")??null;if(o?.classList.contains("is-adding")||!await Gs(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);mn(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,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;if(!t)return;let i=e.releaseHeldSeat(t);i||e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0})}};function ar(n,e,t){if(!e||t||n.classList.contains("sl-confirm-removing"))return;e.classList.add("sl-confirm-add-invite");let i=()=>e.classList.remove("sl-confirm-add-invite");n.addEventListener("pointerdown",i,{once:!0}),n.addEventListener("keydown",i,{once:!0}),e.addEventListener("focus",i,{once:!0})}function lr(n,e){return n&&n!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}import{pointInPolygon as kd}from"@seatlayer/core";import{createMinimapTransform as Td,minimapPointToWorld as Ed,minimapViewportPlan as Cd}from"@seatlayer/core/picker/minimapGeometry";function Ad(n){let e={inactive:0,available:1,selected:2},t=new Map;for(let o of n){let s=t.get(o.id);(!s||e[o.state]>e[s])&&t.set(o.id,o.state)}let i={selected:0,available:0,inactive:0};for(let o of t.values())i[o]+=1;return i}function Pd(n,e){return n.x<=e.x&&n.y<=e.y&&n.x+n.width>=e.x+e.width&&n.y+n.height>=e.y+e.height}function cr(n,e){let t=new Pn(n);return t.build(e),t}var Pn=class{constructor(e){this.host=e;this.miniCanvas=null;this.miniBase=null;this.miniWrap=null;this.miniToggle=null;this.miniLabel=null;this.miniTf=null;this.miniDrag=null;this.miniSuppressClick=!1;this.userClosed=!1}dispose(){this.miniToggle?.remove(),this.miniWrap?.remove(),this.miniToggle=null,this.miniWrap=null,this.miniCanvas=null,this.miniBase=null,this.miniLabel=null,this.miniTf=null,this.miniDrag=null,this.host.root()?.removeAttribute("data-minimap-open")}build(e){if(!this.host.controller.getViewport())return;let i=document.createElement("button");i.type="button",i.className="sl-minimap-toggle",i.setAttribute("aria-label",b("picker.openVenueMap","Open venue overview map")),i.setAttribute("aria-expanded","false"),i.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 6l5-2 8 3 5-2v13l-5 2-8-3-5 2zM8 4v13M16 7v13"/></svg>',e.appendChild(i),this.miniToggle=i;let 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 d=document.createElement("canvas");this.miniBase=d,i.addEventListener("click",()=>{let p=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=p,this.setMinimapOpen(!p)}),l.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),c.addEventListener("click",p=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(p)}),c.addEventListener("pointerdown",p=>this.minimapPointerDown(p)),c.addEventListener("pointermove",p=>this.minimapPointerMove(p)),c.addEventListener("pointerup",p=>this.minimapPointerUp(p)),c.addEventListener("pointercancel",p=>this.minimapPointerUp(p)),c.addEventListener("keydown",p=>this.minimapKeydown(p)),this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect()}setAutoOpen(e){if(this.miniWrap){if(!e){this.userClosed=!1,this.host.root()?.dataset.minimapOpen==="true"&&this.setMinimapOpen(!1,!1);return}this.userClosed||this.host.root()?.dataset.minimapOpen==="true"||this.setMinimapOpen(!0,!1)}}setMinimapOpen(e,t=!0){this.host.root()?.setAttribute("data-minimap-open",String(e)),this.miniToggle?.setAttribute("aria-expanded",String(e)),t&&(e?this.miniCanvas?.focus():this.miniToggle?.focus())}layoutMinimap(){let e=this.miniCanvas,t=this.miniBase,i=this.host.controller.getViewport()?.bounds;if(!e||!t||!i||!(i.width>0&&i.height>0))return;let o=196,s=146,r=6,a=i.width/Math.max(1,i.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 d=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*d),e.height=Math.round(c*d),e.style.width=`${l}px`,e.style.height=`${c}px`,t.width=e.width,t.height=e.height,this.miniTf=Td(i,e.width,e.height,d,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(d=>d.id===this.host.controller.getActiveFloorId())?.name??b("picker.venueOverview","Venue overview"),i=this.host.controller.getMinimapSnapshot().sections,s=i.find(d=>d.active)?.label??this.host.focusedSectionLabel(),r=s?`${t} \xB7 ${s}`:t;this.miniLabel.textContent=r;let{selected:a,available:l,inactive:c}=Ad(i);this.miniWrap.setAttribute("aria-label",i.length?`${r}. ${a} selected, ${l} available, ${c} inactive sections.`:r),this.miniCanvas?.setAttribute("aria-label",i.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 i=e.getContext("2d");if(!i)return;i.clearRect(0,0,e.width,e.height);let o=p=>p*t.scale+t.offX,s=p=>p*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",d=this.host.controller.getMinimapSnapshot();for(let p of d.sections){if(p.outline.length<3)continue;i.beginPath(),p.outline.forEach((h,y)=>y===0?i.moveTo(o(h.x),s(h.y)):i.lineTo(o(h.x),s(h.y))),i.closePath();let u=p.paint;if(i.globalAlpha=p.state==="inactive"?.5:.92,u?i.fillStyle=u.fill:(i.globalAlpha=p.state==="inactive"?.18:p.state==="selected"?.72:.34,i.fillStyle=p.state==="inactive"?a:p.state==="selected"?l:c),i.fill(),i.globalAlpha=.82,i.lineWidth=Math.max(1,t.dpr),i.strokeStyle=u?.stroke||r,i.stroke(),p.owned){i.globalAlpha=1,i.lineWidth=Math.max(2,t.dpr*1.5),i.strokeStyle=l,i.stroke();let h=p.outline.reduce((y,f)=>({x:y.x+f.x,y:y.y+f.y}),{x:0,y:0});i.beginPath(),i.arc(o(h.x/p.outline.length),s(h.y/p.outline.length),Math.max(1.5,t.dpr*1.6),0,Math.PI*2),i.fillStyle=l,i.fill(),i.beginPath(),p.outline.forEach((y,f)=>f===0?i.moveTo(o(y.x),s(y.y)):i.lineTo(o(y.x),s(y.y))),i.closePath()}p.active&&(i.globalAlpha=1,i.lineJoin="round",i.lineWidth=Math.max(4,t.dpr*3.5),i.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",i.stroke(),i.lineWidth=Math.max(2,t.dpr*1.75),i.strokeStyle=l,i.stroke())}if(i.globalAlpha=1,!d.sections.length){let p=Math.max(1,t.dpr),u=this.host.controller.getRenderer?.(),h=new Map,y=f=>{let T=h.get(f);if(T)return T;let S=u?.categoryDisplayColor?.(f)||c;return h.set(f,S),S};for(let f of d.seats)i.globalAlpha=f.state==="inactive"?.22:.78,i.fillStyle=f.state==="inactive"?a:f.state==="selected"?l:y(f.categoryKey),i.beginPath(),i.arc(o(f.x),s(f.y),p,0,Math.PI*2),i.fill();i.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,t=this.miniBase,i=this.miniTf;if(!e||!t||!i)return;let o=e.getContext("2d");if(!o)return;o.clearRect(0,0,e.width,e.height),o.drawImage(t,0,0);let s=this.host.controller.getViewport();if(!s||Pd(s.visible,s.bounds))return;let r=Cd(s.visible,i,e.width,e.height,Math.max(2,i.dpr*2)),a=this.host.cssVar("--sl-text")||"#12151c",l=this.host.cssVar("--sl-surface")||"#fff";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,i.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,i.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,i.dpr*3),Math.max(2,i.dpr*2)]),o.strokeRect(r.clipped.x,r.clipped.y,r.clipped.width,r.clipped.height)),o.restore()}minimapWorldPoint(e){let t=this.miniCanvas,i=this.miniTf;if(!t||!i)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{...Ed({x:s,y:r},i),px:s,py:r}}minimapPointerDown(e){let t=this.minimapWorldPoint(e),i=this.host.controller.getViewport()?.visible;!t||!i||!(t.x>=i.x&&t.x<=i.x+i.width&&t.y>=i.y&&t.y<=i.y+i.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:t.x-(i.x+i.width/2),offsetY:t.y-(i.y+i.height/2),startX:e.clientX,startY:e.clientY,moved:!1},this.miniCanvas?.setPointerCapture(e.pointerId),this.miniCanvas?.classList.add("sl-dragging"),e.preventDefault())}minimapPointerMove(e){let t=this.miniDrag;if(!t||t.pointerId!==e.pointerId)return;let i=this.minimapWorldPoint(e);i&&(!t.moved&&Math.hypot(e.clientX-t.startX,e.clientY-t.startY)>2&&(t.moved=!0,this.host.controller.clearSectionFocus()),this.host.controller.panToWorld({x:i.x-t.offsetX,y:i.y-t.offsetY}),e.preventDefault())}minimapPointerUp(e){let t=this.miniDrag;!t||t.pointerId!==e.pointerId||(this.miniSuppressClick=t.moved,this.miniDrag=null,this.miniCanvas?.classList.remove("sl-dragging"),this.miniCanvas?.hasPointerCapture(e.pointerId)&&this.miniCanvas.releasePointerCapture(e.pointerId))}minimapKeydown(e){let t=this.host.controller.getViewport()?.visible;if(!t)return;if(e.key==="Home"){this.host.controller.overview(),e.preventDefault();return}let i=e.key==="ArrowLeft"?-t.width*.2:e.key==="ArrowRight"?t.width*.2:0,o=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!i&&!o||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+i,y:t.y+t.height/2+o}),e.preventDefault())}minimapJump(e){let t=this.minimapWorldPoint(e);if(t){for(let i of this.host.controller.getMinimapSnapshot().sections)if(!(i.state==="inactive"||i.outline.length<3)&&kd(t,i.outline)){this.host.controller.focusSection(i.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};import{t as Ln}from"@seatlayer/core";var Ld=12;function dr(n,e){let t=e.floors(),i=new Set(t.map(g=>g.label.trim().toLocaleLowerCase())),o=e.zones().filter(g=>g.seatCount>0&&!i.has(g.label.trim().toLocaleLowerCase())),s=e.sections().filter(g=>g.seatCount>0&&!i.has(g.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 d=document.createElement("div");d.className="sl-view3d-nav";let p=null,u=document.createElement("button");u.type="button",u.className="sl-view3d-nav-toggle",u.setAttribute("aria-expanded","false");let h='<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>',y=document.createElement("span");u.innerHTML=h,u.appendChild(y);let f=()=>{for(let g of d.querySelectorAll(":scope > div")){let L=g.querySelector('[aria-pressed="true"]');!L||g.scrollWidth<=g.clientWidth||L.scrollIntoView({block:"nearest",inline:"nearest"})}},T=()=>{if(p)return p;for(let g of d.querySelectorAll(":scope > div")){let L=g.querySelector('button[aria-pressed="true"]'),D=L?.textContent?.trim();if(D&&L?.dataset.floor!=="")return D}return a&&(l||c)?b("picker.levelsAndAreas","Levels & areas"):a?b("picker.levels","Levels"):b("picker.areas","Areas")},S=g=>{d.classList.toggle("is-open",g),u.setAttribute("aria-expanded",String(g)),g&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(f),y.textContent=T()};u.addEventListener("click",()=>S(!d.classList.contains("is-open"))),d.addEventListener("keydown",g=>{g.key!=="Escape"||!d.classList.contains("is-open")||(g.preventDefault(),g.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 A=b("picker.closeVenueNavigation","Close venue navigation");v.setAttribute("aria-label",A),v.title=A,v.addEventListener("click",()=>{S(!1),u.focus()}),S(!1),d.appendChild(u);let _=g=>{},K=g=>{};if(a){let g=document.createElement("div");g.setAttribute("role","group"),g.setAttribute("aria-label",b("picker.levels","Levels"));let L=[];K=R=>{L.forEach(C=>{C.setAttribute("aria-pressed",String((C.dataset.floor===""?null:Number(C.dataset.floor))===R))})};let D=R=>{e.focusFloor(R)&&(K(R),_(R))},H=(R,C)=>{let I=document.createElement("button");I.type="button",I.textContent=R,I.dataset.floor=C===null?"":String(C),I.setAttribute("aria-pressed",String(C===null)),I.addEventListener("click",()=>{D(C),S(!1)}),L.push(I),g.appendChild(I)};H(b("picker.allLevels","All levels"),null);for(let R of t)H(R.label||Ln("picker.levelNumber",{number:R.index+1}),R.index);d.appendChild(g)}if(l||c){let g=document.createElement("div");g.setAttribute("role","group"),g.setAttribute("aria-label",b("picker.areas","Areas"));let L=l?o.map(H=>({id:H.id,label:H.label||H.id,go:()=>{e.focusZone(H.id)}})):r.map(H=>({id:H.id,label:H.label||H.id,floorIndex:H.floorIndex,go:()=>{e.focusSection(H.id),Number.isFinite(H.floorIndex)&&K(H.floorIndex)}})),D=H=>{let R=l||H===null?L:L.filter(C=>C.floorIndex===void 0||C.floorIndex===H);if(g.replaceChildren(),!R.length){g.remove();return}if(g.isConnected||d.insertBefore(g,v.isConnected?v:null),!l&&R.length>Ld){let C=document.createElement("select");C.setAttribute("aria-label",b("picker.jumpToSection","Jump to section"));let I=document.createElement("option");I.value="",I.textContent=b("picker.jumpToSection","Jump to section"),C.appendChild(I);for(let $ of R){let j=document.createElement("option");j.value=$.id,j.textContent=$.label,C.appendChild(j)}C.addEventListener("change",()=>{R.find($=>$.id===C.value)?.go()}),g.appendChild(C);return}for(let C of R){let I=document.createElement("button");I.type="button",I.textContent=C.label,I.dataset.area=C.id,I.addEventListener("click",()=>{p=C.label,C.go(),S(!1)}),g.appendChild(I)}};_=D,D(null)}return d.appendChild(v),n.appendChild(d),d}var Ii=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 i=this.host.savedSeatIds().length,o=t.querySelector(".main");o&&(o.textContent=i>1?Ln("picker.compareCount",{count:i}):b("picker.oneSeatSaved","1 seat saved"),o.setAttribute("aria-label",i>1?Ln("picker.openComparisonOfSeats",{count:i}):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 pr(n){return!n?.querySelector('[data-ref="zfs"]')}var hr="sl:sheet-hint";function ur(n){let e=n.boot;if(!e?.isConnected)return;if(n.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),n.map?.appendChild(t),setTimeout(()=>t.remove(),650),n.rail?.classList.add("is-in"),n.root?.classList.add("is-arriving"),setTimeout(()=>{n.rail?.classList.remove("is-in"),n.root?.classList.remove("is-arriving"),Md(n.root)},900)}function Md(n){if(!n||n.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(hr))return;window.sessionStorage.setItem(hr,"1")}catch{}let e=n.querySelector(".sl-sheet-toggle");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function mr(n,e){n.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let i of e())if(i.open()){t.preventDefault(),t.stopPropagation(),i.close();return}}})}function Oi(n){let e=n.committedSelection(),t=n.controller.getGAAreas(),i=n.hold?.items??[],o=new Set(i.map(u=>u.label)),s=Uo(n,t,i),r=_e(n.gaQty,i),a=i.reduce((u,h)=>u+n.paidPrice(h.categoryKey,h.tierId,h.unitPrice,h.label)*(h.quantity??1),0),l=i.reduce((u,h)=>u+(h.quantity??1),0),c=e.filter(u=>!o.has(u.label)),d=c.reduce((u,h)=>u+n.paidPrice(h.categoryKey,h.tierId??null,h.price,h.label)*(h.quantity??1),0)+s+a,p=c.reduce((u,h)=>u+(h.quantity??1),0)+r+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:i,heldLabels:o,heldCount:l,total:d,count:p}}function _i(n,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:n.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function Ni(n,e){let t=e.tiers?.length?e.tiers.map(i=>n.paidPrice(e.key,i.id??null,i.price)):e.price==null?[]:[n.paidPrice(e.key,null,e.price)];if(e.key)for(let i of n.pricesByChannel.values())for(let o of i)o.categoryKey===e.key&&t.push(o.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var zt="seatlayer_";function Hd(){let n=globalThis;return n.document?.modelContext??n.navigator?.modelContext??null}function ce(n,e){return e?{ok:!1,reason:n,message:e}:{ok:!1,reason:n}}function Rd(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"&&!!e):[]}function Id(n,e){let t=n.event();if(!t)return ce("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits();return{ok:!0,event:t,selection:{max:i.max,...i.required!=null?{required:i.required}:{}},categories:n.categories(),zones:n.zones(),hasPremiumSeats:n.hasPremiumSeats(),holdsAllowed:e}}function fr(n,e){let t=o=>!!o&&o.toLowerCase()===e.toLowerCase(),i=n.find(o=>t(o.key??o.id))??n.find(o=>t(o.label));return i?.key??i?.id??null}function gr(n,e){let t=e.map(i=>n.describeSeat(i.id));return{seatIds:e.map(i=>i.id),labels:e.map(i=>i.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((i,o)=>t[o]?.seat||i.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((i,o)=>i+o.price,0)}}function Od(n,e,t){let i=new Map;for(let s of e){let r=i.get(s.rowKey);r?r.push(s):i.set(s.rowKey,[s])}let o=[];for(let s of i.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 d=a;d+t<=l;d+=t)o.push(gr(n,r.slice(d,d+t)));a=l}}return o}function _d(n,e,t){let i=new Map;for(let s of e){let r=i.get(s.sectionKey);r?r.push(s):i.set(s.sectionKey,[s])}let o=[];for(let s of i.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(gr(n,r.slice(0,t)))}return o}function Nd(n,e){if(!n.event())return ce("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits(),o=Math.floor(Number(e.count));if(!Number.isInteger(o)||o<1||o>i.max)return ce("bad_count",`count must be a whole number between 1 and ${i.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,d=l?fr(n.categories(),l):null;if(l&&!d)return ce("no_match",`No ticket type called "${l}".`);let p=c?fr(n.zones(),c):null;if(c&&!p)return ce("no_match",`No zone called "${c}".`);let u=n.seats().filter(f=>f.available);if(!u.length)return ce("sold_out");let h=u.filter(f=>(!d||f.categoryKey===d)&&(!p||f.zoneId===p)&&(a==null||f.price<=a));if(!h.length)return ce("no_match");let y=r?Od(n,h,o):_d(n,h,o);return y.length?(y.sort((f,T)=>T.unitPrice!==f.unitPrice?T.unitPrice-f.unitPrice:f.row.localeCompare(T.row)||f.labels[0].localeCompare(T.labels[0])),{ok:!0,groups:y.slice(0,s),searched:{count:o,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...p?{zone:p}:{},together:r}}}):ce(r?"not_enough_together":"no_match")}function br(n){return{ok:!0,...n.selection()}}function Dd(n,e){let t=n.event();if(!t)return ce("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return ce("event_closed","Sales are closed for this event.");let i=Rd(e.seat_ids);return i.length?(n.clearSelection(),n.selectObjects(i),br(n)):ce("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function Bd(n,e){let t=async o=>{try{return await o()}catch(s){return ce("error",s instanceof Error?s.message:String(s))}},i=[{name:`${zt}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(()=>Id(n,e))},{name:`${zt}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(()=>Nd(n,o))},{name:`${zt}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(()=>Dd(n,o))},{name:`${zt}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(()=>br(n))}];return e&&i.push({name:`${zt}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>n.hold())}),i}async function yr(n,e={}){let t=Hd();if(!t||typeof t.registerTool!="function")return null;let i=new AbortController,o=Bd(n,!!e.holds),s=[],r=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of o)await t.registerTool(a,{signal:i.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(i.abort(),typeof t.unregisterTool=="function")for(let a of s)try{t.unregisterTool(a)}catch{}}}:null}async function vr(n){let e=n.opts.webMcp;if(!e||n.destroyed)return;let t=typeof e=="object"&&!!e.holds,i=typeof e=="object"?e.exposedTo:void 0;try{n.webMcp=await yr(Hn(n,t),{holds:t,exposedTo:i}),n.destroyed&&Mn(n)}catch(o){console.warn("seatmap: WebMCP registration failed",o)}}function Mn(n){n.webMcp?.dispose(),n.webMcp=null}function Hn(n,e){let t=(i,o)=>{if(Number.isInteger(i.logicalSeatIndex))return i.logicalSeatIndex;let s=i.id.lastIndexOf(":"),r=s<0?NaN:Number(i.id.slice(s+1));return Number.isFinite(r)?r:o};return{event:()=>{let i=n.renderInfo;return i?{name:i.eventName??"",venue:i.venue??null,startsAt:i.startsAt??null,timezone:i.timezone??null,currency:n.currency,salesClosed:n.salesClosed}:null},selectionLimits:()=>({max:n.maxTickets,required:n.exactTickets}),categories:()=>{let i=n.controller.categoryAvailability();return(n.controller.doc?.categories??[]).filter(o=>!o.notForSale).map(o=>{let s=Ni(n,o),r=_i(n,o);return{key:o.key,label:o.label??o.key,...r===void 0?{}:{price:r},...s&&s.min!==s.max?{priceRange:s}:{},available:i[o.key]??0}})},zones:()=>n.controller.getBestAvailableZones(),hasPremiumSeats:()=>n.controller.hasPremiumSeats(),seats:()=>{let i=n.controller.getActiveFloorId(),o=[];return n.allSeats().forEach((s,r)=>{if(s.floorId&&i&&s.floorId!==i)return;let a=n.controller.getStatus(s.id)??"free",l=n.controller.doc?.categories.find(d=>d.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:n.paidPrice(s.categoryKey,l?.tiers?.[0]?.id??null,c,s.label),...s.zoneId?{zoneId:s.zoneId}:{},available:a==="free"&&!l?.notForSale})}),o},describeSeat:i=>{let o=n.controller.seatDetails(i);return o?{section:o.sectionLabel??"",row:q(o)??"",seat:o.seatNumber??o.label,category:o.categoryLabel??o.categoryKey}:null},selection:()=>{let{freshSeats:i,total:o,count:s}=Oi(n);return{seats:i.map(r=>({id:r.id,label:r.label,section:r.sectionLabel??"",row:q(r)??"",seat:r.seatNumber??r.label,category:r.categoryKey,price:n.paidPrice(r.categoryKey,r.tierId??null,r.price,r.label)})),count:s,total:o,currency:n.currency,hold:n.hold?{id:n.hold.holdId,expiresAt:n.hold.expiresAt}:null,validity:n.getSelectionValidity()}},clearSelection:()=>n.clearSelection(),selectObjects:i=>{n.selectObjects(i)},hold:()=>e?Fd(n):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function Fd(n){if(n.salesClosed)return{ok:!1,reason:"event_closed"};if(!n.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=n.controller.getSelectionValidity(n.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await n.handleCta(),n.hold?{ok:!0,hold:{id:n.hold.holdId,expiresAt:n.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function Rn(n){return{renderingTimeMillis:n.ms,performanceProfile:n.performanceProfile,seatCount:n.seatCount,objectCount:n.objectCount,sectionCount:n.sectionCount,view:n.view,eventKey:n.eventKey,chartName:n.chartName,floorCount:n.floorCount,transport:n.transport,load:n.load,metricScope:n.metricScope,operationalTelemetryReporter:"sdk"}}function wr(n,e){ve({apiBase:n.apiBase,event:n.eventKey,scope:n.metricScope,surface:n.surface,outcome:"success",ms:n.ms,performanceProfile:n.performanceProfile,chartDelivery:n.chartDelivery,seats:n.seatCount,floors:n.floorCount,view:n.view,load:n.load,transport:n.transport}),e("chart_rendered",Rn(n))}import{seatConfidenceDisclosure as Vd}from"@seatlayer/core/core/seatConfidence";function ee(n){return String(n??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function xr(n){let e=Vd(n.seat.confidenceEvidence),t=n.seat.confidenceEvidence,i=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${ee(c)}</li>`).join("")}</ul>`:"",o=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${ee(e.modeledTarget)}</dd></div>`:"",s=t?`<div><dt>Evidence ID</dt><dd>${ee(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${ee(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${ee(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${ee(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${ee(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",r=si(n.seat.commercial).join(" \xB7 ")||n.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${ee(r)}</dd></div>`+(n.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${ee(n.seat.commercial.note)}</dd></div>`:""),l=n.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${ee(n.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${ee(e.headline)}</strong><span>${ee(e.coverage)} \xB7 ${ee(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${ee(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${ee(e.reality)}</dd></div><div><dt>Source</dt><dd>${ee(e.provenance)}</dd></div>`+a+o+s+`</dl>${i}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function Sr(n){return n?n.closest("[data-report]")?"report":n.closest("[data-close]")||n.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function Di(n,e,t){let i=n?.querySelector("[data-report]"),o=n?.querySelector("[data-report-status]");i&&(i.disabled=e!=="failed",i.textContent=e==="received"?"Report received":"Report this view"),o&&(o.setAttribute("role",e==="failed"?"alert":"status"),o.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function In(n,e,t=null){let i=n.view3dEl;if(!i)return;$t(n,!1);let o=e.confidenceEvidence,s=n.controller.seatDetails(e.id),r=document.createElement("div");r.className="sl-view3d-passport-shell",r.innerHTML=xr({seat:e,title:s?.displayLabel??e.displayLabel??e.label,restrictionFallback:n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof n.api.reportViewEvidence=="function"});let a=[...new Set([...i.children,...[...n.els.map.children].filter(u=>u!==i)])].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");i.appendChild(r),i.classList.add("has-passport"),n.view3dPassportEl=r;let c=r.querySelector(".sl-view3d-passport"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],p=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),$t(n);return}if(u.key!=="Tab")return;let h=d();if(!h.length)return;let y=h[0],f=h[h.length-1];u.shiftKey&&document.activeElement===y?(u.preventDefault(),f.focus()):!u.shiftKey&&document.activeElement===f&&(u.preventDefault(),y.focus())};window.addEventListener("keydown",p,!0),n.view3dPassportCleanup=()=>{window.removeEventListener("keydown",p,!0);for(let f of l)f.element.inert=f.inert,f.ariaHidden===null?f.element.removeAttribute("aria-hidden"):f.element.setAttribute("aria-hidden",f.ariaHidden);let u=t?.isConnected?t:n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareEl?.querySelector("[data-passport-seat]")??null,h=u?.closest(".sl-confirm,.sl-view3d-compare");h?.isConnected&&(h.inert=!1,h.removeAttribute("aria-hidden")),r.remove(),i.classList.remove("has-passport"),n.view3dPassportEl===r&&(n.view3dPassportEl=null);let y=u??n.view3dCompareEl?.querySelector("[data-passport-seat]")??n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareChip.mainButton();(t?.isConnected?t:y)?.focus()},r.addEventListener("click",u=>{let h=Sr(u.target instanceof HTMLElement?u.target:null);h==="close"&&$t(n),h==="report"&&zd(n,e)}),requestAnimationFrame(()=>d()[0]?.focus()),n.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:o?.evidenceId??null,eventConfigurationId:o?.eventConfigurationId??null,modelLevel:o?.modelLevel??"unverified",realityLevel:o?.realityLevel??"none"})}async function zd(n,e){if(n.api.reportViewEvidence){Di(n.view3dPassportEl,"sending");try{let t=await n.api.reportViewEvidence(n.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});n.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),Di(n.view3dPassportEl,"received",t.report.id)}catch{Di(n.view3dPassportEl,"failed")}}}function $t(n,e=!0){let t=n.view3dPassportCleanup;if(n.view3dPassportCleanup=null,!t){n.view3dPassportEl?.remove(),n.view3dPassportEl=null,n.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function kr(n){let e=n.view3dEl;if(!e||n.view3dCompareSeatIds.length<2)return;We(n,!1);let t=n.view3dCompareSeatIds.map(h=>n.view3dComparisonSnapshot(h)).filter(h=>!!h);if(t.length<2){n.clearView3dComparison();return}let i=h=>E(h),o=t.some(h=>!!h.price),s=document.createElement("div");s.className="sl-view3d-compare-shell";let r=t.map((h,y)=>`<article><span>Seat ${y===0?"A":"B"}</span><strong>${i(h.label)}</strong><small>Section ${i(h.section)} \xB7 Row ${i(h.row)}</small><dl>`+(o?`<div><dt>Current price</dt><dd>${i(h.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${i(h.category)}</dd></div><div><dt>Availability</dt><dd>${i(h.availability)}</dd></div><div><dt>View source</dt><dd>${i(h.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${i(h.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${i(h.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${i(h.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${i(h.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${i(h.seat.id)}">Passport</button><button type="button" data-view-seat="${i(h.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${i(h.seat.id)}"${h.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(h=>h instanceof HTMLElement),c=l.map(h=>({element:h,inert:h.inert,ariaHidden:h.getAttribute("aria-hidden")}));for(let h of l)h.inert=!0,h.setAttribute("aria-hidden","true");e.appendChild(s),e.classList.add("has-comparison"),n.view3dCompareEl=s;let d=s.querySelector(".sl-view3d-compare"),p=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],u=h=>{if(h.key==="Escape"){h.preventDefault(),We(n);return}if(h.key!=="Tab")return;let y=p();if(!y.length)return;let f=y[0],T=y[y.length-1];h.shiftKey&&document.activeElement===f?(h.preventDefault(),T.focus()):!h.shiftKey&&document.activeElement===T&&(h.preventDefault(),f.focus())};window.addEventListener("keydown",u),n.view3dCompareCleanup=()=>{window.removeEventListener("keydown",u);for(let h of c)h.element.inert=h.inert,h.ariaHidden===null?h.element.removeAttribute("aria-hidden"):h.element.setAttribute("aria-hidden",h.ariaHidden);s.remove(),e.classList.remove("has-comparison"),n.view3dCompareEl===s&&(n.view3dCompareEl=null),a?.isConnected?a.focus():n.view3dCompareChip.mainButton()?.focus()},s.querySelector("[data-close]")?.addEventListener("click",()=>We(n)),s.querySelectorAll("[data-passport-seat]").forEach(h=>h.addEventListener("click",()=>{let y=h.dataset.passportSeat,f=y?n.allSeats().find(T=>T.id===y):void 0;f&&In(n,f,h)})),s.querySelectorAll("[data-view-seat]").forEach(h=>h.addEventListener("click",()=>{let y=h.dataset.viewSeat;We(n,!1),y&&n.view3dHandle?.flyToSeat(y)})),s.querySelectorAll("[data-select-seat]").forEach(h=>h.addEventListener("click",()=>{let y=h.dataset.selectSeat;y&&$d(n,y)})),requestAnimationFrame(()=>p()[0]?.focus()),n.emit3dAnalytics("3d_comparison_opened",{seatIds:n.view3dCompareSeatIds.slice()})}function We(n,e=!0){let t=n.view3dCompareCleanup;if(n.view3dCompareCleanup=null,!t){n.view3dCompareEl?.remove(),n.view3dCompareEl=null,n.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function $d(n,e){if(n.salesClosed){n.toast(n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=n.allSeats().find(o=>o.id===e);if(!t)return;if(We(n,!1),!n.controller.select([e]).length){n.syncSelectionTo3d(),n.toast(n.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}n.syncSelectionTo3d(),n.showConfirm(t),n.emit3dAnalytics("3d_comparison_selected",{seatId:e})}import{seatViewDisclosure as Yd}from"@seatlayer/core/view3d/crossfade/panorama";import{t as Tr}from"@seatlayer/core";var jd=900,Gd=450;function Ud(n){switch(n){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 Er(n,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let i=b("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",i),t.title=i,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let o=document.createElement("div");o.className="sl-view3d-stop",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),n.append(t,o);let 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,n.classList.remove("is-seat-view")},Gd);return}n.classList.add("is-seat-view"),o.textContent=Ud(a),o.classList.add("is-shown"),s=setTimeout(()=>{s=null,o.classList.remove("is-shown")},jd)},dispose(){s&&(clearTimeout(s),s=null),r&&(clearTimeout(r),r=null),t.remove(),o.remove(),n.classList.remove("is-seat-view")}}}var qd=44,Kd=92;function Cr(n,e,t,i={}){let o=n?.sectionLabel,s=q(n),r=Wd(n,e),a=[o,s?Tr("picker.rowLabel",{label:s}):null,r?Tr("picker.seatLabel",{label:r}):null].filter(Boolean).join(" \xB7 "),l=i.maxChars??(i.narrow?qd:Kd);for(let c of[t,i.shortTail??t,null]){let d=[a,c].filter(Boolean).join(" \xB7 ");if(d.length<=l||c==null)return d}return a}function Wd(n,e){if(n?.seatNumber)return n.seatNumber;let t=n?.displayLabel??e,i=o=>{!o||!t.startsWith(o)||t.length<=o.length||(t=t.slice(o.length).replace(/^[\s·\-\/_]+/,""))};return i(n?.sectionLabel),i(q(n)),t}import{seatConfidenceDisclosure as Xd}from"@seatlayer/core/core/seatConfidence";function Ar(n){return n.buyerView}function Pr(n,e,t){if(e==="map"){n.exit3d();return}let i=t?.flyToSeatId;if(n.buyerView==="venue3d"){i?(n.opts.onBuyerViewChange?.({view:"venue3d",seatId:i}),n.view3dHandle?.flyToSeat(i)):t?.resetView&&n.view3dHandle?.focusOverview();return}n.enter3d(i)}function Lr(n,e){switch(n.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return n.priceBandKeys!=null&&!n.priceBandKeys.has(e.categoryKey)||n.controller.accessibilityFilterDims?.(e)||n.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}function Mr(n){if(!n.view3dHandle)return;let e=n.allSeats().map(t=>({seatId:t.id,state:n.seatState3dFor(t)}));n.view3dHandle.setAvailability(e)}function Hr(n){n.view3dHandle&&n.view3dHandle.setSelection(n.controller.getSelection().map(e=>e.id))}async function Rr(n,e){let t=n.allSeats().find(i=>i.id===e);if(!t)return null;if(t.viewUrl)try{let i=t.viewMeta?.previewUrl,o=!!i&&i!==t.viewUrl,s=o?await n.buyerAssetUrls.resolve(i):null,r=o?t.viewUrl:await n.buyerAssetUrls.resolve(t.viewUrl);return!r||o&&!s?null:{url:r,...s?{previewUrl:s}:{},...o?{resolveUrl:a=>n.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(i){return n.opts.onError?.(i),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:n.tf("picker.chartDerivedModel","Chart-derived model")}}function Ir(n,e){if(n.salesClosed){n.toast(n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),n.syncSelectionTo3d();return}let t=n.allSeats().find(a=>a.id===e);if(!t)return;let i=n.controller.tableSelection(e);if(n.committedSelection().some(a=>i?a.label===i.label:a.id===e)){n.controller.deselect([e]),n.dismissConfirm(),n.syncSelectionTo3d();return}let s=n.controller.getStatus(t.id);if(s==="held"||s==="booked"||s==="not_for_sale"){n.syncSelectionTo3d();return}if(!n.controller.select([e]).length){n.syncSelectionTo3d(),n.dismissConfirm();return}if(n.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),n.flashPickedSeat(e),i){n.showTableDialog(i,!1),n.syncSelectionTo3d();return}n.opts.confirmSelection!==!1?n.showConfirm(t):n.syncTray(),n.syncSelectionTo3d()}function Or(n,e){let t=n.allSeats().find(i=>i.id===e);return Cr(n.controller.seatDetails(e),t?.displayLabel??t?.label??e,n.tf("picker.viewFromYourSeat","view from your seat"),{narrow:n.root?.dataset.layout==="narrow",shortTail:n.tf("picker.fromYourSeat","from your seat")})}function _r(n,e){if(n.buyerView!=="venue3d")return;let t=n.view3dCompareSeatIds;t.includes(e.id)||(n.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),n.confirmSeat?.id===e.id&&(n.controller.deselect([e.id]),n.dismissConfirm(),n.syncSelectionTo3d(),n.syncTray()),n.view3dCompareChip.sync(),n.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:n.view3dCompareSeatIds.length}),n.view3dCompareSeatIds.length>1?n.openView3dComparison():n.toast(n.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}function Nr(n){n.closeView3dComparison(!1),n.view3dCompareSeatIds=[],n.view3dCompareChip.remove(),n.emit3dAnalytics("3d_comparison_cleared")}function Dr(n,e){let t=n.allSeats().find(y=>y.id===e);if(!t)return null;let i=n.controller.seatDetails(t.id),o=n.controller.doc?.categories.find(y=>y.key===t.categoryKey),s=i?.price??(o?.tiers?.length?o.tiers[0].price:o?.price),r=s!=null?n.paidPrice(t.categoryKey,i?.tierId??o?.tiers?.[0]?.id??null,s,t.label):void 0,a=n.controller.getStatus(t.id),l=a==="held"?n.tf("picker.temporarilyHeld","Temporarily held"):a==="booked"?n.tf("picker.sold","Sold"):a==="not_for_sale"?n.tf("picker.notForSale","Not for sale"):n.tf("picker.available","Available"),c=t.viewUrl?Yd({url:t.viewUrl,...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}):n.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),d=si(t.commercial).join(" \xB7 ")||n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),p=bo({...t.accessibility?.length?{accessibility:t.accessibility}:{},...i?.wheelchairSpaceType?{wheelchairSpaceType:i.wheelchairSpaceType}:{}}),u=p.length?`${p.join(" \xB7 ")} \xB7 metadata, not access certification`:n.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),h=Xd(t.confidenceEvidence);return{seat:t,label:i?.displayLabel??t.displayLabel??t.label,section:i?.sectionLabel??t.sectionId??"\u2014",row:q(i)??i?.rowLabel??"\u2014",category:i?.categoryLabel??o?.label??t.categoryKey,price:n.suppressPricing||r==null?"":n.money(r),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:u,confidence:h}}async function Br(n,e){if(n.view3dEl||!n.canOffer3d()||!n.els.map)return;let t=n.controller.doc;if(!t)return;n.buyerView="venue3d",n.view3dTargetSeatId=null,n.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),n.root?.setAttribute("data-view3d","on"),n.dismissConfirm(),n.syncProjection(),n.syncTray();let i=document.createElement("div");i.className="sl-view3d sl-mo-zoom",i.setAttribute("role","group"),i.setAttribute("aria-label",n.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let o=document.createElement("button");o.type="button",o.className="sl-view3d-back",o.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${n.tf("picker.backToMap","Back to map")}</span>`;let s=o.querySelector("span"),r=c=>{n.view3dTargetSeatId=c;let d=!!c;i.classList.toggle("is-seat-focused",d),n.root&&(n.root.dataset.view3dSeat=d?"on":"off");let p=d?n.tf("picker.backToVenue","Back to venue"):n.tf("picker.backToMap","Back to map");s&&(s.textContent=p),o.setAttribute("aria-label",p)};if(o.addEventListener("click",()=>{if(n.view3dTargetSeatId&&n.view3dHandle){n.view3dHandle.focusOverview();return}n.exit3d()}),n.regions["top-left"]?.prepend(o),n.view3dBack=o,n.publish3dTopInset(),pr(n.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6";let d=n.tf("picker.fullScreen","Full screen");c.setAttribute("aria-label",d),c.title=d,c.setAttribute("aria-pressed",String(!!document.fullscreenElement||n.fsFallback||n.framedFs)),c.addEventListener("click",()=>n.toggleFullscreen()),i.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=n.tf("picker.loading3d","Building the 3D venue\u2026"),i.appendChild(a),n.els.map.appendChild(i),n.view3dEl=i,n.view3dCompareChip.sync(),requestAnimationFrame(()=>{i.style.opacity="1"});let l=++n.view3dGen;try{let c=n.allSeats(),[d,p]=await Promise.all([Mt(),n.controller.loadEventConfiguration()]),u=p?await fi(p,v=>n.buyerAssetUrls.resolve(v)):null,h=t.theme?.venue3d?.shellAssetUrl,y=await gi(h,v=>n.buyerAssetUrls.resolve(v));if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;let f={doc:t,seats:c,...u?{eventConfigurationId:u.id,eventConfiguration:u}:{},...y?{registeredShellGlb:y}:{}};a.textContent=n.tf("picker.building3d","Building venue geometry\u2026");let T=await d.prepareVenue3D(f);if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;let S=d.mountVenue3D(i,{...f,prepared:T},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:ze(),navLabels:Jt(),seatViewActionLabel:v=>n.allSeats().find(A=>A.id===v)?.viewUrl?n.tf("picker.openAuthored360","Open venue 360\xB0"):n.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:v=>n.seatViewCaption(v),onSeatViewStopChange:v=>n.view3dSeatViewChrome?.onStopChange(v),onSeatPick:v=>n.onView3dSeatPick(v),onSeatInspect:v=>n.onView3dSeatPick(v),onSectionFocusChange:v=>{let A=i.querySelector('select[data-locator="section"]'),_=v??"";!A||A.value===_||(A.value=_,A.dispatchEvent(new Event("change")))},onViewTargetChange:v=>{i.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!v),r(v),n.opts.onBuyerViewChange?.({view:"venue3d",...v?{seatId:v}:{}})},...n.seatViewEnabled()?{getSeatView:v=>new Promise((A,_)=>{let K=()=>{n.seatViewFor3d(v).then(L=>{L?A(L):_(new Error("seat_view_unavailable"))})},g=globalThis.requestIdleCallback;typeof g=="function"?g(K,{timeout:1500}):setTimeout(K,50)})}:{},onAnalytics:(v,A)=>n.emit3dAnalytics(v,A)});n.view3dHandle=S,n.view3dSeatViewChrome=Er(i,{handle:()=>n.view3dHandle}),requestAnimationFrame(()=>a.remove()),n.pushAvailabilityTo3d(),n.syncSelectionTo3d(),n.view3dNav=dr(n.regions["bottom-left"]??i,S),e&&S.flyToSeat(e)}catch(c){if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;n.opts.onError?.(c),n.toast(n.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),n.exit3d()}}function Fr(n){let e=n.regions["top-left"];if(!n.root||!e)return;let t=()=>{!n.root||n.root.dataset.view3d!=="on"||n.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}function Vr(n){if(n.buyerView!=="venue3d"&&!n.view3dEl)return;n.view3dGen++,n.buyerView="map",n.view3dTargetSeatId=null,n.opts.onBuyerViewChange?.({view:"map"}),n.root?.removeAttribute("data-view3d"),n.closeSeatConfidencePassport(!1),n.closeView3dComparison(!1),n.view3dCompareChip.remove(),n.view3dSeatViewChrome?.dispose(),n.view3dSeatViewChrome=null,n.view3dBack?.remove(),n.view3dBack=null,n.view3dNav?.remove(),n.view3dNav=null,n.root?.removeAttribute("data-view3d-seat"),n.root?.style.removeProperty("--sl-3d-top-inset");try{n.view3dHandle?.dispose()}catch{}n.view3dHandle=null;let e=n.view3dEl;n.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),n.syncProjection(),n.syncTray();let t=n.view3dReturnSeat;n.view3dReturnSeat=null,t&&n.committedSelection().some(i=>i.id===t.id)&&n.opts.confirmSelection!==!1&&n.showConfirm(t)}import{t as tp}from"@seatlayer/core";import{t as Bi}from"@seatlayer/core";function zr(n){return Array.isArray(n)?n.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function Fi(n,e,t=!1){let i=n.violations[0];return i==="numberOfPlacesToSelect"?n.remaining>0?Bi("picker.selectExactMore",{count:n.remaining}):Bi("picker.selectExactCount",{count:n.required}):i==="minimumSelectedPlaces"?Bi("picker.selectMinimumMore",{count:n.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):i==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):Bi("picker.orphanHint")}import{t as $r,tCount as Qd}from"@seatlayer/core";function jr(n){let e=Math.max(0,n),t=Math.floor(e/6e4),i=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${i}`}function Gr(n){let e=n.performanceLabel?`<div class="sl-chip-when">${O(n.performanceLabel)}</div>`:"",t=n.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${O(n.performanceDates.summary)}</span><span class="sl-chip-date-list">${n.performanceDates.labels.map(i=>`<span class="sl-chip-date">${O(i)}</span>`).join("")}</span></div>`:"";return e+Jd(n)+t}function Jd(n){let{d:e,area:t,label:i,objectType:o,quantity:s=1,identity:r}=n,a=A=>String(A??"\u2014").replace(/[&<>"]/g,_=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[_]),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")),d=r?.rowLabel??r?.displayLabel??e?.rowLabel??e?.displayLabel??t?.label??i,p=n.categoryLabel?.trim()??"",u="",h=[];l==="table"&&r?.bookingMode?(u=`${c} ${d}`,h.push([b("picker.guests","Guests"),String(s)])):l==="ga"?(u=String(t?.displayLabel??d),s>1&&h.push([b("picker.tickets","Tickets"),String(s)])):l==="booth"?(u=e?.sectionLabel??`${c} ${d}`,e?.sectionLabel&&h.push([c,String(d)])):!e?.sectionLabel&&!e?.rowLabel&&!e?.seatNumber?u=String(d):(u=e.sectionLabel??"",e.rowLabel&&h.push([c,String(q(e)??e.rowLabel)]),e.seatNumber&&h.push([b("picker.seat","Seat"),String(e.seatNumber)]));let y=!u&&!!p,f=u||p||String(d),T=!!p&&!y&&p!==f,S=h.map(([A,_])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(A)}</span> <b>${a(_)}</b></span>`);T&&S.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(p)}</span></span>`);let v=[f,...h.map(([A,_])=>`${A} ${_}`),T?p:""].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(f)}</span>`+(S.length?`<span class="sl-chip-pos" aria-hidden="true">${S.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function ep(n){let e=O;return` data-key="${e(n.key)}"`+(n.heldLabels.length?` data-held="${e(encodeURIComponent(n.heldLabels.join(`
3202
+ `)))}"`:"")+(n.seatIds.length?` data-seat="${e(n.seatIds.join(" "))}"`:"")+(n.locateId?` data-locate="${e(n.locateId)}"`:"")}function Ur(n){let e=O;return`<div class="sl-chip${n.held?" sl-held":""}${n.fresh?" sl-enter":""}"`+ep(n)+">"+(n.held?n.stateHtml:`<span class="sl-chip-dot" style="background:${E(n.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${n.identityHtml}`+(n.extrasHtml?`<div class="sl-chip-sub">${n.extrasHtml}</div>`:"")+`${n.noteHtml}</div>`+(n.amountText?`<span class="amt">${e(n.amountText)}</span>`:"")+n.railHtml+"</div>"}function On(n,e){let t=O(n),i=e?O(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${i}" aria-label="${O($r("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 qr(n){return n.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>${$r("picker.willFindSeatsTogether",{count:n.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>`+ct({id:"sl-info-best-seats",label:b("picker.aboutBestSeats","About finding seats together"),text:b("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")})+(n.offerPremium?`<button type="button" class="sl-ba-premium${n.premium?" on":""}" data-ba-premium aria-pressed="${n.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${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>${n.quantity}</span><button type="button" data-ba="1" aria-label="${b("picker.moreSeats","More seats")}">+</button></div>`+(n.categories.length>1?`<select class="sl-ba-cat" aria-label="${O(b("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${O(b("picker.anyTicketType","Any ticket type"))}</option>`+n.categories.map(e=>`<option value="${O(e.key)}"${n.selectedCategory===e.key?" selected":""}>${O(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(n.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>`+n.zones.map(e=>`<option value="${O(e.id)}"${n.selectedZone===e.id?" selected":""}>${O(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${n.busy?" sl-busy":""}"${n.busy?" disabled":""}>`+(n.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${b("picker.findingBestSeats","Finding the best seats\u2026")}`:Qd("picker.findBestSeatsCount",n.quantity))+"</button>"+(n.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${b("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function Kr(n){if(n.salesClosed&&!n.hasPicks){let e=n.whenText?`<span class="when">${O(n.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 Wr(n){return n.hasGaAreas?n.seated?n.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."):n.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."):n.groupMode==="per_performance"?b("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):n.groupMode?b("picker.groupTrayHint","Choose seats once \u2014 the same seats will be held for every performance."):n.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 _n=6e4,Yr=5*6e4,ip=String(Math.round(Yr/6e4));function Xr(n){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(n.regions["bottom-center"]??n.els.map).appendChild(e),n.extendEl=e,n.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),n.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),n.els.extendBtn.textContent=Zr(n),n.els.extendDismiss.setAttribute("aria-label",n.tf("picker.close","Close")),n.els.extendBtn.addEventListener("click",()=>{n.handleExtend()}),n.els.extendDismiss.addEventListener("click",()=>{n.extendDismissed=!0,n.setExtendPrompt(!1,0)})}function Zr(n){return n.tf("picker.addMinutes","+{count} min").replace("{count}",ip)}function Qr(n){let e=n.hold?.items??[],t=new Set(e.map(o=>o.label));return n.committedSelection().filter(o=>!t.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0)+_e(n.gaQty,n.hold?.items??[])}function Jr(n){return(n.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function ea(n){let e=new Set((n.hold?.items??[]).map(i=>i.label)),t=n.committedSelection().filter(i=>!e.has(i.label)).reduce((i,o)=>i+(o.quantity??1),0);return n.heldTicketCount()+t+_e(n.gaQty,n.hold?.items??[])}function ta(n){let e=new Set((n.hold?.items??[]).map(o=>o.label)),t=n.committedSelection().filter(o=>e.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0),i=Math.max(0,n.maxTickets-n.heldTicketCount()-_e(n.gaQty,n.hold?.items??[]));n.controller.setMaxSelection(t+i)}function ia(n,e=n.lastTrayCount,t=n.pendingSelectionCount()){let i=n.els.cta;if(!i)return;if(delete i.dataset.act,n.salesClosed){i.disabled=!0,i.textContent=n.tf("picker.salesClosedCta","Sales closed");return}if(n.ctaPhase==="holding"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${n.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(n.ctaPhase==="checkout"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${n.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let o=!n.hold&&n.performanceGroup?.selectionMode==="per_performance"?n.performanceGroup.submissionState?.():null;if(o&&!o.ready){i.disabled=!0,i.textContent=n.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(o.complete)).replace("{total}",String(o.total));return}let s=n.controller.getSelectionValidity(e);if(s&&!s.isValid){i.disabled=!0,i.textContent=Fi(s,(r,a)=>n.tf(r,a),!0);return}if(!e&&n.root?.dataset.layout==="narrow"&&!n.performanceGroup&&!n.hold){i.disabled=!1,i.dataset.act="find",i.textContent=n.tf("picker.findBestSeats","Find best seats");return}i.disabled=e===0,i.textContent=n.hold?t?tp("picker.secureMoreAndCheckout",{count:t}):n.tf("picker.continueToCheckout","Continue to checkout"):e?n.performanceGroup?n.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(n.performanceGroup.performanceCount)):n.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):n.tf("picker.selectSeats","Select seats")}function na(n,e){n.ctaPhase=e,n.syncCta()}async function oa(n,e,t){n.setCtaPhase("checkout");try{await n.checkoutHandoff(e,t)}finally{n.ctaPhase==="checkout"&&!n.bookedShown&&n.setCtaPhase("idle")}}function sa(n){return`@seatlayer/hold/v1/${encodeURIComponent(n.apiBase)}/${encodeURIComponent(n.opts.event)}`}function ra(n){if(n.opts.initialHoldId)return n.opts.initialHoldId;if(n.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(n.holdStorageKey())}catch{return null}}function aa(n,e){if(!(n.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(n.holdStorageKey(),e.holdId)}catch{}}function la(n){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(n.holdStorageKey())}catch{}}async function ca(n,e,t=!1){try{let i=await n.controller.resumeHold(e);if(!i||n.destroyed)return null;let o={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items};return n.hold=o,n.handedOff=!0,n.bookedShown=!1,n.ctaPhase="idle",n.startHoldTimer(o.expiresAt),n.rememberHold(o),n.syncTray(),n.emitHoldChange(),n.opts.onHoldRestored?.(o,o.seats??[],n.buildHandoff(o)),o}catch(i){let o=i?.status;if(o===404||o===409)n.forgetHold();else if(n.opts.onError?.(i),t)throw i;return null}}async function da(n){let e=n.rememberedHoldId();e&&await n.resumeHoldFromServer(e,!0)}function pa(n,e){n.stopHoldTimer(),n.holdExpiresAt=e,n.extendDismissed=!1,n.extendUsed=!1,n.hold&&n.rememberHold(n.hold);let t=n.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${n.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let i=t.querySelector('[data-ref="holdTime"]'),o=()=>{let s=Math.max(0,n.holdExpiresAt-Date.now());i&&(i.textContent=jr(s)),t.classList.add("on"),t.classList.toggle("is-expiring",s>0&&s<=_n),n.setExtendPrompt(s>0&&s<=_n,s),(s<=0||!n.controller.currentHold())&&n.stopHoldTimer()};n.holdTimer=setInterval(o,500),o()}function ha(n){n.holdTimer&&clearInterval(n.holdTimer),n.holdTimer=null,n.els.hold?.classList.remove("on","is-expiring"),n.setExtendPrompt(!1,0)}function ua(n,e,t){if(!n.extendEl)return;let i=e&&t>0&&n.root?.dataset.layout!=="narrow"&&!n.extendDismissed&&!n.extendUsed&&!!n.controller.currentHold()&&!n.bookedShown;n.extendEl.classList.toggle("on",i)}function ma(n){if(!n.holdTimer)return;let e=Math.max(0,n.holdExpiresAt-Date.now());n.setExtendPrompt(e>0&&e<=_n,e)}async function fa(n){let e=n.els.extendBtn,t=n.controller.currentHold();if(!(!t||!n.api.extend||n.extendUsed)){e.disabled=!0,e.textContent=n.tf("picker.addingEllipsis","Adding\u2026");try{let i=await n.api.extend(n.controller.key,t.holdId,Yr);if(n.controller.currentHold()?.holdId!==t.holdId)return;n.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:i.expiresAt,items:t.items});let o=n.controller.currentHold();if(!o)return;n.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},n.holdExpiresAt=o.expiresAt,n.extendUsed=!0,n.extendEl?.classList.remove("on"),n.rememberHold(n.hold),n.emitHoldChange(),n.toast(n.tf("picker.moreTimeAdded","More time added \u2014 your seats are still held."),"success")}catch(i){if(i?.reason==="extend_limit"){n.extendUsed=!0,n.setExtendPrompt(!1,0);return}n.opts.onError?.(i),n.toast(n.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=Zr(n)}}}import{t as wa}from"@seatlayer/core";function ga(n){return n?.previousPrice!=null&&n.previousPrice>n.price?n.previousPrice:null}function ba(n){return op(n)+(n.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!n.collapsed}">${n.esc(n.moreLabel)}</button>`:"")+sp(n.status)}function op(n){let{esc:e,money:t}=n;return n.categories.map(i=>{let o=n.priceOf(i),s=n.rangeOf(i),r=n.offerOf(i.key),a=ga(r),l=n.activeKey===i.key;return`<div class="sl-price-row${n.bandKeys!=null&&!n.bandKeys.has(i.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(i.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(n.titleFor(i,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(n.colorOf(i))}"></span><span class="sl-price-label">${e(i.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 sp(n){let e=t=>t.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i]);return`<div class="sl-status-key" aria-label="${e(n.legend)}"><span class="sl-status-item"><i class="sl-status-icon unavailable" aria-hidden="true"></i>${e(n.unavailable)}</span></div>`}function Nn(n){let e=Math.abs(n.scrollLeft),t=e>2,i=e+n.clientWidth<n.scrollWidth-2;return n.dataset.fadeStart=String(t),n.dataset.fadeEnd=String(i),{start:t,end:i}}function ya(n){let{esc:e,money:t}=n;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${n.allActive}" title="${e(n.allWord)}"><span class="sl-rc-t">${e(n.allWord)}</span></button>`+n.categories.map(o=>{let s=n.rangeOf(o),r=n.priceOf(o),a=s?s.min===s.max?t(s.min):`${t(s.min)}+`:r!=null?t(r):null,l=Object.prototype.hasOwnProperty.call(n.left,o.key)&&n.left[o.key]<=0,c=ga(n.offerOf(o.key)),d=a?`${o.label} \u2014 ${a}${l?` (${n.soldOutWord})`:""}`:o.label;return`<button type="button" class="sl-rc" data-cat="${e(o.key)}" aria-pressed="${n.activeKey===o.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(n.colorOf(o))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??o.label)}</span></button>`}).join("")}function va(n,e){let t=n.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let i=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(i.length<=5)return i.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let o=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),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(p=>p.range.min)),d=Math.max(...l.map(p=>p.range.max));r.push({id:`b${a}`,label:c===d?e.money(c):`${e.money(c)}\u2013${e.money(d)}`,keys:l.map(p=>p.key),min:c,max:d})}return r}function xa(n){if(n.suppressPricing||!n.els.prices||!n.els.pricesSec)return;let e=va(n.controller.doc?.categories??[],n.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",n.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let i=document.createElement("option");i.value="all",i.textContent=n.tf("picker.allPrices","All prices"),t.appendChild(i);for(let o of e){let s=document.createElement("option");s.value=o.id,s.textContent=o.label,t.appendChild(s)}n.els.pricesSec.appendChild(t),n.priceSelect=t,t.addEventListener("change",()=>{n.applyPriceBand(e.find(o=>o.id===t.value)?.keys??null)})}function Sa(n,e){if(n.focusedCatKey=null,n.priceBandKeys=e?new Set(e):null,n.priceSelect){let t=e?n.priceSelect.value:"all";n.priceSelect.value!==t&&(n.priceSelect.value=t)}n.controller.setCategoryFilter(e),n.controller.focusCategoryFilter(e),n.pushAvailabilityTo3d(),n.syncFloors(),n.syncRung(),n.minimap?.refreshMinimap(),n.syncPrices(),n.lastSection&&n.showSectionCard(n.lastSection)}function ka(n){return{colorOf:e=>n.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>n.catPriceRange(e),priceOf:e=>n.catPrice(e),offerOf:e=>n.offerPrice(e),money:e=>n.money(e),esc:O}}function Ta(n,e,t,i=n.legendDeps()){let o=n.els.railScroll,s=e.length>1;if(n.els.rail?.classList.toggle("has",s),!o)return;o.innerHTML=s?ya({...i,categories:e,left:t,activeKey:n.focusedCatKey,soldOutWord:n.tf("picker.soldOut","Sold out"),allWord:n.tf("picker.allPrices","All prices"),allActive:!n.focusedCatKey&&!n.priceBandKeys}):"";let r=e.map(a=>a.key).join("|");n.lastRailSignature!==r&&(n.lastRailSignature=r,o.scrollLeft=0),o.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){n.applyPriceBand(null);return}n.focusCategory(a.dataset.cat??"")})}),n.railEdgesBound||(n.railEdgesBound=!0,o.addEventListener("scroll",()=>Nn(o),{passive:!0})),requestAnimationFrame(()=>Nn(o))}function Ea(n){let e=n.controller.doc;if(!e||!n.els.prices)return;let t=n.controller.categoryAvailability(),i=e.categories.filter(p=>!p.notForSale);n.syncSoldout(i,t);let o=n.legendDeps(),s=n.suppressPricing,r=s?{...o,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:o;s&&(n.els.pricesSec?.querySelector("span")?.replaceChildren(n.tf("picker.seatCategories","Seat categories")),n.els.pricesInfo?.remove()),n.syncPriceRail(i,t,r);let a=5,l=i.length-a,c=l>1&&!n.pricesExpanded,d=c?i.slice(0,a):i;n.els.prices.classList.toggle("sl-expanded",l>1&&n.pricesExpanded),n.els.prices.innerHTML=ba({...r,categories:d,left:t,collapsed:c,activeKey:n.focusedCatKey,bandKeys:n.priceBandKeys,titleFor:(p,u)=>u?n.tf("picker.showAllSeats","Show all seats"):wa("picker.showLabelSeatsOnMap",{label:p.label}),moreLabel:l>1?c?s?n.tf("picker.showAllCategories","Show all categories"):wa("picker.showAllTicketTypes",{count:i.length}):n.tf("picker.showFewer","Show fewer"):null,status:{legend:n.tf("picker.seatStatusLegend","Seat status legend"),unavailable:n.tf("picker.notAvailable","Not available")}}),n.els.prices.querySelectorAll(".sl-price-row").forEach(p=>{p.addEventListener("mouseenter",()=>n.controller.getRenderer()?.setCategoryHighlight?.(p.dataset.cat??null)),p.addEventListener("mouseleave",()=>n.controller.getRenderer()?.setCategoryHighlight?.(null));let u=()=>n.focusCategory(p.dataset.cat??"");p.addEventListener("click",u),p.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),u())})}),n.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{n.pricesExpanded=!n.pricesExpanded,n.syncPrices()})}function Ca(n,e){if(!e)return;let t=n.focusedCatKey===e?null:e;n.focusedCatKey=t,n.priceBandKeys=t?new Set([t]):null;let i=n.els.pricesSec?.querySelector(".sl-price-select");i&&(i.value="all"),n.controller.setCategoryFilter(t?[t]:null),n.controller.focusCategoryFilter(t?[t]:null),n.pushAvailabilityTo3d(),n.syncFloors(),n.syncRung(),n.minimap?.refreshMinimap(),n.syncPrices(),n.lastSection&&n.showSectionCard(n.lastSection)}import{t as Aa,tCount as Pa}from"@seatlayer/core";function de(n,e,t){let i=Aa(n,t);return i&&i!==n?i:t?e.replace(/\{(\w+)\}/g,(o,s)=>s in t?String(t[s]):o):e}function ap(n){let e=Pa("picker.seatCount",n);return e.includes("picker.seatCount")?`${n} ${n===1?"seat":"seats"}`:e}function lp(n){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(n)}catch{}return n.join(", ")}function cp(n){if(n.length<2)return!1;let e=[...n].sort((t,i)=>t-i);return new Set(e).size!==e.length?!1:e[e.length-1]-e[0]===e.length-1}function dp(n){let e=n.filter(o=>o.objectType==="ga"),t=n.filter(o=>o.objectType!=="ga"),i=[];if(t.length){let o=ap(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?de("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:s[0],row:r[0],seat:String(t[0].seatNumber??"")}):cp(a)?de("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:s[0],row:r[0],from:Math.min(...a),to:Math.max(...a)}):"";i.push(l?de("picker.releasedPair","{first} \xB7 {second}",{first:o,second:l}):de("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]}))}else s.length===1?i.push(de("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]})):s.length>1?i.push(de("picker.releasedInSections","{seats} in Sections {sections}",{seats:o,sections:lp(s)})):i.push(o)}for(let o of e)i.push(de("picker.releasedGa","{quantity} \xD7 {area}",{quantity:o.quantity??1,area:o.label}));return i.length?i.reduce((o,s)=>de("picker.releasedPair","{first} \xB7 {second}",{first:o,second:s})):""}function La(n){if(!n)return[];let e=new Map((n.seats??[]).map(o=>[o.label,o])),t=n.items??[];return(t.length?t.map(o=>({label:o.label,objectType:o.objectType,quantity:o.quantity})):[...e.keys()].map(o=>({label:o}))).map(o=>{let 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:q(s)??s.rowLabel}:{},...s?.seatNumber?{seatNumber:s.seatNumber}:{}}})}function Ma(n,e){if(!n.reducedMotion)for(let t of e.slice(0,10)){if(t.objectType==="ga")continue;let i=n.seatByLabel(t.label);!i||n.statusOf(i.id)!=="free"||n.flash(i.id,n.accent)}}function Ha(n,e){if(!e.recoverable.length||!n.isConnected)return;let t=n.querySelector(".sl-hold-expired-next");t&&(e.taken.length?t.textContent=e.taken.slice(0,3).map(r=>Aa("picker.seatJustTakenByAnother",{label:r})).join(" "):t.remove());let i=n.querySelector(".sl-interrupt-actions"),o=i?.querySelector(".sl-interrupt-act");if(!i||!o)return;o.classList.add("sl-interrupt-act-secondary");let s=document.createElement("button");s.type="button",s.className="sl-interrupt-act sl-hold-expired-recover",s.textContent=Pa("picker.holdLapsedSelectAgain",e.recoverable.length),s.addEventListener("click",()=>e.onRecover([...e.recoverable])),i.insertBefore(s,o),n.classList.add("has-recovery"),s.focus()}function Ra(n,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let i=document.createElement("div");i.className="sl-interrupt-card sl-mo-in";let o=document.createElement("div");o.className="sl-interrupt-title",o.id="sl-hold-expired-title";let s=document.createElement("span");s.className="sl-interrupt-glyph",s.setAttribute("aria-hidden","true"),s.textContent="\u23F1";let r=document.createElement("span");r.textContent=de("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=de("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),i.append(o,a);let l=dp(e);if(l){let u=document.createElement("div");u.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",u.textContent=l,i.appendChild(u)}let c=document.createElement("div");c.className="sl-interrupt-body sl-hold-expired-next",c.textContent=de("picker.holdExpiredPickAgain","Pick your seats again to continue \u2014 they may already be taken."),i.appendChild(c),t.setAttribute("aria-labelledby",o.id),t.setAttribute("aria-describedby",a.id);let d=document.createElement("div");d.className="sl-interrupt-actions";let p=document.createElement("button");return p.type="button",p.className="sl-interrupt-act sl-hold-expired-restart",p.textContent=de("picker.holdExpiredRestart","Choose seats again"),p.addEventListener("click",()=>n.restart()),d.appendChild(p),i.appendChild(d),t.appendChild(i),t.addEventListener("pointerdown",u=>{u.target===t&&n.restart()}),t}import{ACCESSIBILITY_TYPES as Dn,seatTypeIconSvg as Ia,t as pp}from"@seatlayer/core";var Oa={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"},hp='<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>',up='<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>',mp=8,fp=8,gp=88;function bp(n){let e=n.gap??mp,t=n.margin??fp,i=n.min??gp,o=Math.max(n.boundsTop,0);return Math.max(Math.round(n.buttonTop-o-e-t),i)}var Vi=class{constructor(e,t){this.active=new Set;this.deps=t,this.root=document.createElement("div"),this.root.className="sl-a11y",this.button=document.createElement("button"),this.button.type="button",this.button.className="sl-a11ybtn",this.button.setAttribute("aria-haspopup","true"),this.button.setAttribute("aria-expanded","false");let o=this.offered().length>0?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options");this.button.setAttribute("aria-label",o),this.button.innerHTML=up,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=Lo(o,t.tf("picker.close","Close"))+Mo(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:i,count:o})=>[i,o])),t=!1;for(let i of this.menu.querySelectorAll("[data-a11y-row]")){let o=i.dataset.a11yRow??"";if(!o.startsWith("a11y:"))continue;let s=o.slice(5),r=e.get(s);if(r===void 0)continue;let a=this.countNode(i),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))),i.disabled=c,c?i.setAttribute("aria-disabled","true"):i.removeAttribute("aria-disabled"),c&&this.active.delete(s)&&(this.paint(i,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let i=t.dataset.a11yRow??"";i.startsWith("a11y:")&&this.paint(t,this.active.has(i.slice(5)))}}refit(){this.menu.hidden||this.fit()}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),window.removeEventListener("resize",this.reflow),this.root.remove()}fit(){this.menu.style.setProperty("--sl-a11ymenu-max",`${bp({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();an(this.menu,{x:t.left+t.width/2,y:t.top}),Vo(this.menu),Fo(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:Ia("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:hp,className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:i,count:o})=>({key:i,count:o}));let t=this.deps.present;return t?Dn.filter(({key:i})=>t.has(i)).map(({key:i})=>({key:i,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(Dn.map(i=>[i.key,i]));return this.offered().flatMap(({key:i,count:o})=>{let s=t.get(i);return s?[{key:`a11y:${i}`,iconHtml:Ia(i,{size:17}),label:this.deps.tf(`picker.accessShort.${i}`,Oa[i]??s.label),...i==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...o==null?{}:{count:this.countText(o),disabled:o===0},on:this.active.has(i)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-sl-info]"))e.addEventListener("click",()=>{let t=e.closest(".sl-info"),i=!t?.classList.contains("open");for(let o of this.menu.querySelectorAll(".sl-info.open"))o.classList.remove("open"),o.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false");t?.classList.toggle("open",i),e.setAttribute("aria-expanded",String(i))});for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let 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 i=t.slice(5),o=!this.active.has(i);o?this.active.add(i):this.active.delete(i),this.paint(e,o),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let i=(e.dataset.a11yRow??"").slice(5),o=e.parentElement;o?.classList.contains("sl-a11yrow-w")||(o=document.createElement("div"),o.className="sl-a11yrow-w",e.replaceWith(o),o.appendChild(e));let s=document.createElement("button");s.type="button",s.className="sl-a11yrow-c sl-a11yjump",s.dataset.a11yJump=i,s.textContent=t.textContent,s.disabled=e.disabled,s.setAttribute("aria-label",this.jumpLabel(i,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(i,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(i)||(this.active.add(i),this.paint(e,!0),this.applyFilter({focus:!1}));let l=this.deps.stepToAccessibleSection?.(i);l&&s.setAttribute("aria-label",this.jumpLabel(i,s.textContent??"",l.label))})}}countText(e){return e>0?pp("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=Oa[e]??Dn.find(i=>i.key===e)?.label??e;return this.deps.tf(`picker.accessShort.${e}`,t)}jumpLabel(e,t,i){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...i?[`${this.deps.tf("picker.section","Section")} ${i}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};import{attachVisibilityCatchUp as yp}from"@seatlayer/core";var vp=250;function _a(n,e=vp){let t=null,i=()=>{t===null&&(t=setTimeout(()=>{t=null,n()},e))},o=yp(i),s=typeof window<"u"&&typeof window.addEventListener=="function";return s&&window.addEventListener("focus",i),()=>{t!==null&&(clearTimeout(t),t=null),o(),s&&window.removeEventListener("focus",i)}}import{holdRecoveryShape as wp,tCount as zi}from"@seatlayer/core";var $i=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=wp(e),i=e.lapsedLabels.length,o=i-e.recoverable.length,s=t==="all"?zi("picker.holdLapsedStillFree",i):t==="partial"?zi("picker.holdLapsedSomeTaken",o):zi("picker.holdLapsedAllTaken",i);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>${O(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${O(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 zi("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 Na=Symbol("seatlayer.performance-group-picker");function ji(n,e){return Object.defineProperty(n,Na,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),n}function Da(n){return n[Na]??null}var Ba="@seatlayer/pending-checkout/v1";function xp(n){return typeof n=="string"&&n.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(n)}function Gi(n){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let i=null;try{let o=window.sessionStorage.getItem(Ba);if(o){let s=null;try{s=JSON.parse(o)}catch{}if(s&&xp(s.orderId)){let r=Date.now()-Number(s.storedAt);if(r>=0&&r<=144e5){if(s.eventKey&&s.eventKey!==n)return null;i=s.orderId}}}window.sessionStorage.removeItem(Ba)}catch{}e.delete("seatlayer_checkout");try{let o=e.toString();history.replaceState(history.state,"",`${location.pathname}${o?`?${o}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:i}}function Fa(n){if(!n.framed)return null;let e=n.ancestorOrigins?.length?n.ancestorOrigins[0]:null;for(let t of[e,n.referrer])if(t)try{return new URL(t).origin}catch{}return null}var Pp="https://api.seatlayer.io",Lp=10,Mp=250,za=6e4,$a=4,Hp=10,Rp=40,Ip=220,Bn=["mini","peek","open"],ja="seatmap.a11y.cb";function Op(){try{if(typeof window>"u")return null;let n=window.localStorage.getItem(ja);return n==null?null:n==="1"}catch{return null}}function _p(n){try{window.localStorage.setItem(ja,n?"1":"0")}catch{}}var Ye=class n{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.loadAbort=null;this.transportAbort=new AbortController;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 Ii({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 $i({toast:(e,t,i)=>this.toast(e,t,i),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.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=Da(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)}},i=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?ci({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:i?.access??_t(e,t),this.pubApi=e.transport?null:i?.api??new Re(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=xs(e.transport??this.pubApi,this.transportAbort.signal),this.buyerAssetUrls=new ft(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=zr(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 yt(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=Fa({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let i=t<640?1.2:.62;return Math.max(420,Math.round(t*i))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!document.fullscreenElement||this.fsFallback||this.framedFs?document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.framedFs?this.setFramedFs(!1):this.setFsFallback(!1):e.requestFullscreen?e.requestFullscreen().catch(()=>this.enterFsFallback()):this.enterFsFallback()}fillsViewport(){let e=this.root;if(!e||typeof window>"u")return!1;let t=e.getBoundingClientRect();return t.height>=window.innerHeight-$a&&t.width>=window.innerWidth-$a}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let i=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=i,e.tabIndex=i?-1:0,e.setAttribute("aria-hidden",String(i))}fullscreenMeasurementChanged(e,t){let i=typeof window>"u"?0:window.innerWidth,o=typeof window>"u"?0:window.innerHeight,s=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||i!==this.fullscreenAffordanceSize.viewportWidth||o!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:i,viewportHeight:o},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 i=this.els.zfs?.querySelector(".sl-zfs-lbl");i&&(i.textContent=e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),this.view3dEl?.querySelector(".sl-view3d-fs")?.setAttribute("aria-pressed",String(e)),this.syncFullscreenAffordance()}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e,background:this.cssVar("--sl-bg")||void 0}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){gt();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let o=document.createElement("div");o.className="sl-modal-frame",o.style.setProperty("--sl-bg",rt(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,i.appendChild(o),document.body.appendChild(i);let s=document.body.style.overflow;document.body.style.overflow="hidden";let r=new n({...e,container:o});r.modalScrim=i,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(T=>T.isConnected&&!T.closest('[hidden], [aria-hidden="true"], [inert]'));return f[f.length-1]??o},c=(f,T)=>{let S=f;for(;S;){let v=window.getComputedStyle(S);if(S.hidden||S.getAttribute("aria-hidden")==="true"||S.hasAttribute("inert")||v.display==="none"||v.visibility==="hidden"||v.visibility==="collapse")return!0;if(S===T)return!1;S=S.parentElement}return!0},d=f=>[...f.querySelectorAll(a)].filter(T=>T.tabIndex>=0&&!T.matches(":disabled")&&!c(T,f)),p=(f,T)=>{let S=d(f),v=T?S[S.length-1]:S[0];v?v.focus({preventScroll:!0}):(f.hasAttribute("tabindex")||(f.tabIndex=-1),f.focus({preventScroll:!0}))},u=!1,h=()=>{if(u)return;u=!0,document.body.style.overflow=s,r.escHandler&&document.removeEventListener("keydown",r.escHandler),i.remove(),r.modalScrim=null;let f=r.prevFocus;r.prevFocus=null,f?.isConnected&&f.focus({preventScroll:!0});let T=()=>{r.destroy(),e.onClose?.()};r.hold&&!r.handedOff?r.release().finally(T):T()};r.closeModal=h,i.addEventListener("mousedown",f=>{f.target===i&&h()}),r.escHandler=f=>{if(f.key==="Tab"){if(f.defaultPrevented)return;let T=l(),S=d(T),v=S[0],A=S[S.length-1],_=document.activeElement;!v||!A?(f.preventDefault(),p(T,f.shiftKey)):_===T||!_||!T.contains(_)?(f.preventDefault(),(f.shiftKey?A:v).focus({preventScroll:!0})):f.shiftKey&&_===v?(f.preventDefault(),A.focus({preventScroll:!0})):!f.shiftKey&&_===A&&(f.preventDefault(),v.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(),h()))},document.addEventListener("keydown",r.escHandler);let y=r.render();return r.els.close?.classList.add("on"),r.els.close?.addEventListener("click",h),await y,r.destroyed||p(l(),!1),r}wireController(e){return new Sp({sectionPreview:!0,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:st(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let i=this.controller.getGAAreas().find(o=>o.id===t);i&&(this.collapseSheet(),dn(this,i,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),Ls(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,i=this.holdConflicted;this.holdExpiredUnits=La(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||i){this.toast(N("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)){if(this.opts.confirmSelection===!1||this.salesClosed){this.removeHeldLabels([t.label]);return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}this.showConfirm(t,"remove");return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}if(this.tableDialog?.physicalSeatIds.includes(t.id)){this.dismissTableDialog();return}this.opts.confirmSelection===!1||this.salesClosed||this.controller.tableSelection(t.id)||(this.controller.select([t.id]),this.showConfirm(t,"remove"))},onSelectionLimit:()=>{this.toast(N("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={},i=h=>Math.round((performance.now()-h)*100)/100;this.rendered=!0,gt();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=ho(this.opts.container),{root:c,els:d,mapHost:p}=Ho(l,(h,y)=>this.tf(h,y),this.opts.theme);this.root=c,this.els=d,this.mapHost=p,ai(c,s,h=>{t.loadLocale=i(o),this.destroyed||this.applyActiveLocale(h,r)}),mr(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");return u.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(u),t.mountBuyerShell=i(a),t.skeletonPaint=i(e),this.loadAndFinishChart(u,t,i,e,c)}async loadAndFinishChart(e,t,i,o,s){this.startRealtime();let r=await this.loadChart(e,t,i);if(!r)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=i(o);let a=performance.now();if(this.salesClosed=!!r.salesClosed||!!this.opts.readOnly,s.dataset.eventMode=r.mode==="test"?"test":"live",!this.opts.locale&&r.locale&&this.setLocale(r.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),r.mode==="test"){let v=document.createElement("div");v.className="sl-testbadge",v.textContent=po(N("picker.testMode"),Va()),v.setAttribute("aria-label",N("picker.testMode")),v.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"),this.regions["top-left"].appendChild(v)}let l=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(s),this.watchThemeMode(),this.currency=r.currency??this.opts.currency??"USD",this.eventTimezone=r.timezone??null,uo(this.els.logo,[this.opts.theme?.logoUrl,l?.logoUrl,r.posterUrl],this.opts.theme?.brandName??l?.brandName??r.eventName??"?"),this.els.name.textContent=r.eventName??"";let c=r.startsAt?oi(r.startsAt,r.timezone??null,this.opts.locale):"";this.eventWhenText=c||null,this.els.meta.textContent=[r.venue,c].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(l);let d=!!this.controller.doc&&this.controller.getExpandedSeats().some(v=>v.commercial?.restrictedView||v.commercial?.obstructedView);this.buildAccessibilityMenu(d),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"),s.appendChild(this.srEl),this.buildArenaChrome(),this.buildMinimap(),this.buildPriceFilter(),this.buildExtendPrompt(),this.buildBookedOverlay(),this.buildSoldoutOverlay(),this.buildPanelToggle(),this.opts.panelCollapsed&&this.setPanelCollapsed(!0),this.dockLayoutChrome(),t.buildBuyerControls=i(a);let p=performance.now();if(!await this.restoreHoldForFirstPaint(t))return this;if(t.restoreHold=i(p),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let u=this.controller.doc,h=wi(this.opts.event),y=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),f=y??"event",T={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:f,surface:y==="season"?"season_picker":y==="performance_group"?"performance_group_picker":"seat_picker",ms:i(o),performanceProfile:t,chartDelivery:r.chartDelivery,seatCount:this.allSeats().length,objectCount:u?.objects.length??0,sectionCount:u?.objects.filter(v=>v.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:u?.name,view:this.buyerView,load:h,transport:this.opts.transport?"custom":"pubapi"};wr(T,(v,A)=>this.emitAnalytics(v,A));let S=r.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",Rn({...T,performanceProfile:{...T.performanceProfile,...S}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=r,await this.registerAgentTools(),this}registerAgentTools(){return vr(this)}webMcpHost(e){return Hn(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=_a(()=>{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,(l&&o?o:t).setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!a||r)return;let d=c.clientY-s;d<-18?(this.stepSheet(1),r=!0):d>18&&(this.stepSheet(-1),r=!0)}),t.addEventListener("pointerup",c=>{a&&!r&&!l&&Math.abs(c.clientY-s)<6&&this.cycleSheet(),a=!1,(l&&o?o:t).releasePointerCapture?.(c.pointerId),l=!1})}this.els.foot?.addEventListener("click",o=>{this.root?.dataset.layout==="narrow"&&(o.target.closest?.('.sl-chip,button,a,input,select,label,[role="button"]')||this.cycleSheet())});let i=()=>{if(this.root?.dataset.layout!=="narrow")return;let o=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!o)),this.els.pricesSec?.setAttribute("aria-expanded",String(!o)),!o&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",o=>{o.target.closest("select,button")||i()}),this.els.pricesSec?.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||o.target.closest("select,button")||(o.preventDefault(),i())}),e.addEventListener("click",o=>{let 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 i=t.dataset.sheet;t.dataset.sheet=e==="mini"&&!this.sheetHasCards()?"peek":e,this.syncSheetAffordance(),i==="mini"&&t.dataset.sheet!=="mini"&&this.scheduleFit()}syncSheetAffordance(){let e=this.sheetState(),t=e==="open"||e==="peek"&&this.sheetHasCards(),i=this.els.sheetToggle;i?.setAttribute("aria-expanded",String(e==="open")),i?.setAttribute("aria-label",t?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))}cycleSheet(){let e=this.sheetState();e==="open"||e==="mini"?this.setSheetState("peek"):this.setSheetState(this.sheetHasCards()?"mini":"open")}stepSheet(e){let t=Bn.indexOf(this.sheetState()),i=Math.min(Bn.length-1,Math.max(0,t+e));this.setSheetState(Bn[i])}setSheetOpen(e){this.setSheetState(e?"open":"peek")}openBestSeatsForm(){this.setSheetOpen(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||this.setSheetState("peek")}observeLayout(e){let t=()=>{let i=e.clientWidth;if(i<=0)return;let o=e.clientHeight,s=i!==this.pickerLayoutSize.width||o!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:i,height:o};let r=this.fullscreenMeasurementChanged(i,o);this.reportFramedHeight();let a=i<640?"narrow":"wide",l=o<560?"compact":"comfortable",c=e.dataset.layout!==a||e.dataset.density!==l;c&&(e.dataset.layout=a,e.dataset.density=l,this.controller.setNarrowLayout?.(a==="narrow"),queueMicrotask(()=>this.syncFitClearance()),this.controller.getRenderer()?.setSectionFocusDim?.(a!=="narrow"),a==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray(),this.syncMapStepBack(),this.refreshExtendPrompt()),(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,i){let o=performance.now();this.loadAbort=new AbortController;let s=await dt(()=>this.controller.render(e),this.loadAbort.signal,()=>{let a=this.els.boot.querySelector(".sl-boot-say");a&&(a.classList.add("is-visible"),a.textContent=this.tf("picker.loadingTakingLonger","The seat map is taking longer to load. Please wait\u2026"))});if(this.loadAbort=null,s.outcome==="cancelled"||this.destroyed)return null;let r=s.outcome==="loaded"?s.value:null;return r||this.controller.destroy(),t.loadChartAndStatuses=i(o),this.destroyed?null:r?(Object.assign(t,r.performanceProfile),r):(ve({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:s.outcome==="timeout"?"load_timeout":s.outcome==="error"?"render_error":"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:Ae(this.opts.event),transport:this.opts.transport?"custom":"pubapi"}),Ft(this.els.boot,{title:this.tf("picker.mapDidNotLoad","The seat map didn\u2019t load"),description:this.tf("picker.checkConnection","Check your connection and try again."),actionLabel:this.tf("picker.accessRetry","Try again")}),this.els.boot.querySelector("button").addEventListener("click",()=>{if(this.destroyed||!this.root)return;this.controller=this.wireController(this.opts),Ft(this.els.boot,{title:this.tf("picker.loadingSeatMap","Loading seat map\u2026"),busy:!0});let a=performance.now();this.loadAndFinishChart(e,{},i,a,this.root)},{once:!0}),null)}async restoreHoldForFirstPaint(e){let t=[this.els.side,this.els.rail].filter(Boolean),i=t.map(o=>o.hasAttribute("inert"));t.forEach(o=>o.setAttribute("inert",""));try{for(;!this.destroyed;){let o=performance.now();try{return await this.restoreRememberedHold(),!this.destroyed}catch{if(this.destroyed)return!1;ve({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:"restore_hold",ms:performance.now()-o,performanceProfile:e,view:"map",load:Ae(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let r=Ft(this.els.boot,{title:this.tf("picker.restoreUnavailableTitle","Unable to check saved seats"),description:this.tf("picker.restoreUnavailable","Try again to check whether your saved seats are still held."),actionLabel:this.tf("picker.accessRetry","Try again")}),a=this.transportAbort.signal;if(await new Promise(l=>{let c=()=>{r.removeEventListener("click",c),a.removeEventListener("abort",c),l()};r.addEventListener("click",c,{once:!0}),a.addEventListener("abort",c,{once:!0}),a.aborted&&c()}),this.destroyed||a.aborted)return!1;Ft(this.els.boot,{title:this.tf("picker.restoringSeats","Checking your saved seats\u2026"),busy:!0})}}return!1}finally{t.forEach((o,s)=>{i[s]||o.removeAttribute("inert")})}}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=Gi(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 Vi(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(i,o)=>this.tf(i,o),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:i=>this.setColorblindSafe(i),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:i=>{this.limitedViewFilter=i,this.controller.setCommercialLimitedFilter(i),this.pushAvailabilityTo3d()},applyAccessibilityFilter:i=>this.applyAccessibilityFilter(i),focusSeatsForFilter:()=>this.focusSeatsForFilter(),stepToAccessibleSection:i=>this.controller.focusNextAccessibleSection?.([i])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast(N("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,i=this.els.headInfo?.parentElement;t&&i&&t.parentElement!==i&&(t.classList.add("sl-fs-pill"),i.insertBefore(t,this.els.hold??null));let o=this.extendEl;if(o){let r=e?this.regions["bottom-center"]??this.els.map:i;r&&o.parentElement!==r&&(o.dataset.dock=e?"map":"head",r===i?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(){Xr(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>${O(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(),i=document.createElement("div");i.className="sl-soldout-eyebrow",i.textContent=t;let o=document.createElement("div");o.className="sl-soldout-title",o.textContent=this.tf("picker.soldOutTitle","Sold out");let 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(i,o,s),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,o=this.isSoldOut(e,t,i);o!==this.soldOut&&(this.soldOut=o,this.soldoutEl?.classList.toggle("on",o))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(o=>(t[o.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog();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 i=document.createElement("a");i.className="sl-powered",i.href="https://seatlayer.io/?ref=picker",i.target="_blank",i.rel="noopener noreferrer",i.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer"));let o=document.createElement("span");o.className="sl-powered-mark",o.setAttribute("aria-hidden","true"),o.innerHTML=mi;let s=document.createElement("span");s.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),i.append(o,s),t.appendChild(i)}buildRegions(){if(!this.els.map)return;let e=["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"];for(let t of e){let i=document.createElement("div");i.className="sl-anchor",i.dataset.region=t,this.els.map.appendChild(i),this.regions[t]=i}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,t){let i=setTimeout(()=>{this.motionTimers.delete(i),this.destroyed||e()},t);this.motionTimers.add(i)}animateOnce(e,t,i=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),i))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){let t=this.reducedMotion(),i=(e.items??[]).filter(o=>o.objectType!=="ga").slice(0,10).map(o=>this.controller.seatByLabel(o.label)).filter(o=>!!o);hs({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)},i)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(i=>i.id!==e&&i.id!==t)}pendingSelectionCount(){return Qr(this)}heldTicketCount(){return Jr(this)}totalTicketCount(){return ea(this)}updateSelectionCapacity(){ta(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){ia(this,e,t)}setCtaPhase(e){na(this,e)}runCheckoutHandoff(e,t){return oa(this,e,t)}holdStorageKey(){return sa(this)}rememberedHoldId(){return ra(this)}rememberHold(e){aa(this,e)}forgetHold(){la(this)}resumeHoldFromServer(e,t=!1){return ca(this,e,t)}restoreRememberedHold(){return da(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let i=this.controller.getActiveFloorId();return(t.find(o=>o.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=cr({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 _i(this,e)}catPriceRange(e){return Ni(this,e)}buildPriceFilter(){xa(this)}applyPriceBand(e){Sa(this,e)}buildArenaChrome(){let e=this.controller.doc;if(this.rungsEl=null,this.projectionEl=null,this.floorsEl=null,!e||!this.els.map){this.syncArenaViewportInsets();return}let t=e.objects.some(i=>i.type==="section")||(e.floors??[]).some(i=>i.objects.some(o=>o.type==="section"));if(this.canOffer3d()){let i=document.createElement("div");i.className="sl-projection",i.setAttribute("role","group"),i.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),i.innerHTML=`<button type="button" data-view="map" aria-pressed="true" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,i.querySelectorAll("button").forEach(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(i),this.projectionEl=i,this.syncProjection()}if(t){let i=[...e.objects,...(e.floors??[]).flatMap(p=>p.objects)],o=new Set((e.zones??[]).map(p=>p.id)),a=e.floorOverview==="combined"&&(e.floors?.length??0)>1&&o.size===0||i.some(p=>p.type==="section"&&typeof p.zone=="string"&&o.has(p.zone))?["zones","sections","seats"]:["sections","seats"],l=document.createElement("div");l.className="sl-rungs on sl-mo-indicator",l.setAttribute("role","group"),l.setAttribute("aria-label",N("picker.zoomLevel"));let c={zones:N("picker.rungLabel.zones"),sections:N("picker.rungLabel.sections"),seats:N("picker.rungLabel.seats")},d={zones:N("picker.rungTip.zones"),sections:N("picker.rungTip.sections"),seats:N("picker.rungTip.seats")};l.innerHTML=a.map(p=>`<button type="button" data-rung="${p}" title="${d[p]}" aria-pressed="false">${c[p]}</button>`).join(""),l.querySelectorAll("button").forEach(p=>{p.addEventListener("click",()=>{let u=p.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 i=Is({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(i),this.floorsEl=i,this.syncFloors()}this.syncArenaViewportInsets()}syncArenaViewportInsets(){let e=this.els.map,t=e?Rs(e.getBoundingClientRect(),[this.floorsEl,this.rungsEl,this.projectionEl].map(i=>i?.isConnected?i.getBoundingClientRect():null),[]):{top:0,right:0,bottom:0,left:0};Object.keys(t).every(i=>t[i]===this.arenaViewportInsets[i])||(this.arenaViewportInsets=t,this.controller.setViewportInsets(t),this.syncFitClearance())}syncFitClearance(){let e=this.els.map,t=this.els.zoom,i=this.root?.dataset.layout==="narrow",o=0;if(i&&e&&t?.isConnected){let s=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.height>0&&(o=Math.max(0,s.bottom-r.top+8))}this.controller.setFitClearance?.(o)}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.syncMapStepBack(),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(i=>{let o=i.dataset.rung===e;i.classList.toggle("on",o),i.setAttribute("aria-pressed",String(o))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit,i=this.els?.zin;if(!e||!this.root)return;let o=this.controller.getRenderer?.(),s=this.controller.canZoomIn?.()===!1||o?.seatsPickable?.()===!0,r=Hs({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0,atVenueFit:this.controller.atVenueFit?.()})==="none",a=e.disabled!==r||!!t&&t.disabled!==r||!!i&&i.disabled!==s||e.hidden||!!i?.hidden||!!t?.hidden;e.disabled=r,e.hidden=!1,i&&(i.disabled=s,i.hidden=!1),t&&(t.disabled=r,t.hidden=!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||!ei()?!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)?za/2:za}syncFloors(){Os(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new Ai({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(o=>o.type==="section"&&!this.controller.isSectionClosed(o.id)&&this.controller.getSectionSeatCount(o.id)>0);if(t.length<2)return null;let i=t.findIndex(o=>o.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}markedSeatAnnouncement(e){let t=kn(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return Us(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 i=this.controller.doc?.categories.find(h=>h.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=i?this.catPriceRange(i):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),d=Ke(c),p=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,u=l?`${d} ${p}, ${l.bookingMode==="variable"?N("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):N("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${p}`:c?.objectType==="table"?`${d} ${p}, ${N("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:N("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${u}, ${i?.label??e.categoryKey}${a?`, ${a}`:""}, ${s}`}showTableDialog(e,t,i){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=i??document.activeElement;let 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=Ao(e,{variable:s,held:t,typeWord:Ke(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],d=l[l.length-1];a.shiftKey&&document.activeElement===c?(a.preventDefault(),d.focus()):!a.shiftKey&&document.activeElement===d&&(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 i=t.querySelector("output[data-table-qty]");i&&(i.value=String(e.quantity));let o=t.querySelector("input[data-table-qty]");o&&(o.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let 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 i=this.tableDialogEl?.querySelector(".sl-table-confirm");if(i&&(i.disabled=!0,i.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let o=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!o){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},this.startHoldTimer(o.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast(N("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(o){this.opts.onError?.(o),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){i&&(i.disabled=!1,i.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new Ri({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,i,o)=>this.paidPrice(e,t,i,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(),releaseHeldSeat:e=>this.controller.currentHold()?.labels.includes(e.label)?this.removeHeldLabels([e.label]):null,reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e),cartLanded:()=>this.cartLanded()})),this.confirmCardCache}showConfirm(e,t="add"){this.confirmCard.show(e,t)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}cartLanded(){this.animateOnce(this.els.count,"sl-value-pop",380),this.animateOnce(this.els.total,"sl-value-pop",380)}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){ar(e,t,this.reducedMotion())}addSeatLabel(e){return lr(e,(t,i)=>this.tf(t,i))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,i=this.controller.doc,o=this.controller.getActiveFloorId(),s=e.focalPoint??i?.floors?.find(p=>p.id===o)?.focalPoint??i?.focalPoint??{x:0,y:0},r,a,l=!1;if(e.viewUrl){let p,u=null;try{let y=e.viewMeta?.previewUrl;y&&y!==e.viewUrl?(u=await this.buyerAssetUrls.resolve(y),p=e.viewUrl):p=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(y){t===this.seatViewGen&&this.opts.onError?.(y);return}if(t!==this.seatViewGen||!p||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!u||!this.root||!this.seatViewEnabled())return;let h={url:p,...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=h,a=Ap(h),l=Cp(h)}else{let p;try{let{generateSeatPanorama:u}=await ii();p=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:p.url,generated:!0},a=N("picker.illustrationCaption",{m:p.distanceM})}this.closeSeatView(!1);let c=N("picker.viewFromSeat",{label:e.label}),d=bi({root:this.root,source:r,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:ze(),viewFromSeatLabel:c,real360Label:N("picker.real360"),previewLabel:N("picker.preview"),resolveAsset:p=>this.buyerAssetUrls.resolve(p),onClose:()=>this.closeSeatView()});this.viewEl=d.element,this.viewCleanup=()=>d.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let i=Number.isInteger(e);return kp(e,this.currency,{locale:this.opts.locale,fallback:(o,s)=>`${o} ${s}`,...i?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),i=Ms(e,t);if(i==null)return;let o=6*36e5,s=Math.min(Math.max(i-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 i=wn(t);if(!i)return;this.offerAvailability=i,this.applyChannelPricing(i.channelPricing),this.scheduleOfferBoundary(i);let o=xn(i),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?.(i)}catch{!this.destroyed&&!this.offerBoundaryTimer&&!document.hidden&&(this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},3e4))}}offerPrice(e){return e?this.offerAvailability?.prices.find(t=>t.categoryKey===e)??null:null}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,i=t?.release??null,o=i?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!o){e.classList.remove("has"),e.replaceChildren();return}let s=i??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=i?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let c=document.createElement("strong");c.className="sl-offer-name",c.textContent=s.name||(i?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));let d=document.createElement("span");d.className="sl-offer-line";let p=[];i&&t.fromPrice!=null&&p.push(this.money(t.fromPrice/100)),i&&s.remaining!=null&&p.push(N("picker.offerRemainingAvailable",{count:s.remaining})),i&&s.endsAt!=null&&p.push(N("picker.offerUntil",{time:oi(s.endsAt,this.eventTimezone,this.opts.locale)})),o?.startsAt!=null&&p.push(N("picker.offerStarts",{time:oi(o.startsAt,this.eventTimezone,this.opts.locale)})),d.textContent=p.join(" \xB7 "),a.append(l,c,d);let u=document.createElement("details");u.className="sl-offer-info";let h=document.createElement("summary");h.setAttribute("aria-label",N("picker.howOfferWorks",{name:c.textContent??""})),h.textContent="i";let y=document.createElement("div");y.className="sl-offer-detail",y.textContent=i?this.tf("picker.offerDetailActive","This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over."):this.tf("picker.offerDetailUpcoming","Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts."),u.append(h,y),r.append(a,u),e.replaceChildren(r),e.classList.add("has")}paidPrice(e,t,i,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?i:typeof r=="number"?r:t&&r.tiers?.[t]!==void 0?r.tiers[t]:r.base??i}legendDeps(){return ka(this)}syncPriceRail(e,t,i=this.legendDeps()){Ta(this,e,t,i)}syncPrices(){Ea(this)}focusCategory(e){Ca(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(i=>!e.has(i.label)&&(this.controller.getStatus(i.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(i=>i.id)),this.toast(N("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:i,heldLabels:o,total:s,count:r}=Oi(this),a=[],l=new Set;if(!this.salesClosed){let g=this.performanceGroup?.nightSummary?.()??[];g.length&&a.push(Fs(g,{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>${O(L.label)}</button>`)}let c={salesClosed:this.salesClosed,hasPicks:e.length>0||i.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(g=>g.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(Kr(c)),this.els.trayHint&&(this.els.trayHint.textContent=Wr(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed);let d=!e.length&&!i.length&&!_e(this.gaQty,this.hold?.items??[]);if(!this.performanceGroup&&!this.salesClosed&&!this.hold&&(d||this.bestAvailableBusy||this.bestAvailableConfirm)){let g=(this.controller.doc?.categories??[]).filter(D=>!D.notForSale),L=this.controller.getBestAvailableZones();this.baZone&&!L.some(D=>D.id===this.baZone)&&(this.baZone=""),a.push(qr({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:!1,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:g,zones:L,selectedCategory:this.baCat,selectedZone:this.baZone}))}let p=(g,L,D,H=1,R,C,I)=>Gr({categoryLabel:I,d:g?this.controller.seatDetails(g):null,area:D==="ga"?t.find($=>$.id===R):void 0,label:L,objectType:D,quantity:H,identity:C,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),u=O,h=[];for(let g of qo(i)){let L=g.objectType==="ga"?`held:ga:${g.objectId}:${g.tierId??""}`:`held:${g.label}`;l.add(L);let D=this.controller.doc?.categories.find(Q=>Q.key===g.categoryKey),H=g.tierId?D?.tiers?.find(Q=>Q.id===g.tierId)?.name:void 0,R=g.objectType!=="ga"?this.controller.seatByLabel(g.label):null,C=g.objectType==="table"?this.controller.tableSelection(g.label):null,I=R?this.controller.seatDetails(R.id):null,$=this.seatViewEnabled()&&!!R&&g.objectType!=="table"&&!!this.deliverableViewReference(R),j=u(this.tf("picker.heldForYou","Held for you")),ue=C?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(g.label))}">${u(N("picker.guestsCountEdit",{count:g.quantity??1}))}</button>`:"",be=this.paidPrice(g.categoryKey,g.tierId,g.unitPrice,g.label)*(g.quantity??1);h.push({key:L,fresh:!this.lastTrayKeys.has(L),held:!0,seatIds:[],heldLabels:g.labels,removeAria:N("picker.removeHeldTicketLabel",{label:cn(g,t)}),locateId:R?.id??null,section:I?.sectionLabel??"",rowLabel:I&&q(I)||"",seatLabel:I?.seatNumber??g.label,categoryLabel:`${D?.label??g.categoryKey}${H?` \xB7 ${H}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(g.categoryKey)??D?.color??"",identityHtml:p(R?.id??null,g.label,g.objectType,g.quantity??1,g.objectId,C??void 0,`${D?.label??g.categoryKey}${H?` \xB7 ${H}`:""}`),stateHtml:`<span class="sl-ticket-state held" aria-label="${j}" title="${j}"><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:ue,amount:be,amountText:this.suppressPricing?"":this.money(be),noteHtml:je(R??void 0),railHtml:this.performanceGroup?"":On(N("picker.removeHeldTicketLabel",{label:cn(g,t)}),$?g.label:null)})}let y=this.seatViewEnabled();for(let g of e.filter(L=>!o.has(L.label))){let L=`seat:${g.id}`;l.add(L);let D=this.controller.doc?.categories.find(Q=>Q.key===g.categoryKey),H=g.tiers&&g.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${u(g.id)}" aria-label="${u(N("picker.ticketTierFor",{label:g.label}))}">`+g.tiers.map(Q=>`<option value="${u(Q.id)}"${Q.id===g.tierId?" selected":""}>${u(Q.name)} \xB7 ${u(this.money(this.paidPrice(g.categoryKey,Q.id,Q.price,g.label)))}</option>`).join("")+"</select>":"",R=g.tiers?.find(Q=>Q.id===g.tierId)??g.tiers?.[0],C=R?.buyerMessage?.trim()||(R?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),I=this.controller.seatDetails(g.id),$=u(this.tf("picker.selected","Selected")),j=N("picker.removeSeatLabel",{label:g.label}),ue=(g.objectType==="table"&&g.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(g.label))}">${u(N("picker.guestsCountEdit",{count:g.quantity??1}))}</button>`:"")+H,be=this.paidPrice(g.categoryKey,g.tierId??null,g.price,g.label)*(g.quantity??1);h.push({key:L,fresh:!this.lastTrayKeys.has(L),held:!1,seatIds:[g.id],heldLabels:[],locateId:g.id,section:I?.sectionLabel??"",rowLabel:I&&q(I)||"",seatLabel:I?.seatNumber??g.label,categoryLabel:D?.label??g.categoryKey,identityHtml:p(g.id,g.label,g.objectType,g.quantity??1,g.objectId,g,D?.label??g.categoryKey),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(g.categoryKey)??D?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${$}" title="${$}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:ue,amount:be,amountText:this.suppressPricing?"":this.money(be),removeAria:j,noteHtml:je(g)+(C?`<small class="sl-tier-note">${u(C)}</small>`:""),railHtml:On(j,y&&g.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(g.label)??{})?g.label:null)})}h.length&&a.push(h.map(Ur).join("")),t.length&&a.push(Zo(this,t,i)),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let f=this.performanceGroup?.selectNight;f&&Xs(this.els.tray,g=>f(g)),this.els.tray.querySelectorAll("[data-ba]").forEach(g=>{g.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(g.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",g=>{this.baCat=g.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",g=>{this.baZone=g.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelectorAll(".sl-chip .rm").forEach(g=>{g.addEventListener("click",()=>{let L=g.closest(".sl-chip");if(L.dataset.held){this.removeHeldLabels(decodeURIComponent(L.dataset.held).split(`
3203
+ `),L);return}let D=L.dataset.seat.split(" "),H=()=>{this.controller.deselect(D)};if(this.reducedMotion()){H();return}L.classList.remove("sl-enter"),L.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(H,W.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(g=>{g.addEventListener("click",L=>{L.stopPropagation();let D=decodeURIComponent(g.dataset.tableEdit??""),H=this.controller.tableSelection(D);if(!H)return;let R=i.find(C=>C.label===D&&C.objectType==="table");this.showTableDialog({...H,quantity:R?.quantity??H.quantity},!!R,g)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(g=>{g.addEventListener("change",()=>this.controller.setSeatTier(g.dataset.tier,g.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(g=>{g.addEventListener("click",()=>{let L=this.controller.seatByLabel(g.dataset.viewLabel);L&&this.openSeatView(L)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(g=>{let L=()=>this.controller.flashSeat(g.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");g.addEventListener("mouseenter",L),g.addEventListener("focusin",L),g.addEventListener("click",D=>{D.target.closest?.('button,a,select,[role="button"],input')||!this.controller.focusSeats?.([g.dataset.locate],{animate:!this.reducedMotion()})||L()})}),Qo(this,this.els.tray,t),this.controller.setGASelection(jo(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(g=>{g.disabled=!0});let T=this.pendingSelectionCount(),S=this.lastTrayCount,v=this.lastTrayTotal,A=Ys(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");this.els.count.textContent=A||(r?Ui("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=A||(r?Ui("picker.seatsSelectedCount",r):"")),this.syncCta(r,T);let K=this.root?.dataset.layout==="narrow"&&this.root?.dataset.confirming==="true";r!==S&&!K&&this.animateOnce(this.els.count,"sl-value-pop",380),s!==v&&!K&&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(){Ts(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(Es),this.els.tray?.querySelectorAll(".sl-ba-go").forEach(Cs)}emitSelectionValidity(e,t){let i=this.controller.getSelectionValidity(e);i&&(i.seats=t,this.opts.onSelectionValidityChange?.(i),i.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(i),this.lastSelectionValidity=i.isValid)}async removeHeldLabels(e,t){let i=e.filter(r=>r&&!this.releasingLabels.has(r));if(!i.length)return!1;let o=i[0];i.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(i))return this.toast(N("picker.couldNotRemoveLabel",{label:o}),"error"),!1;Ko(this.gaQty,this.hold?.items??[],i);let l=this.controller.currentHold();return this.hold=l?{holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items}:null,this.handedOff=!!this.hold&&r,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),!0}finally{i.forEach(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(Fi(e,(i,o)=>this.tf(i,o)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast(N("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(i=>!(this.hold.items??[]).some(o=>o.label===i.label))){let i=this.hold.seats??t;this.handedOff=!0,this.holdConflicted=!1,await this.runCheckoutHandoff(this.hold,i);return}this.holdingLabels=new Set(t.map(i=>i.label)),this.setCtaPhase("holding");try{let i=null,o=$o(this.gaQty),s=this.committedSelection();if(s.length){let r=await this.controller.hold(void 0,this.opts.holdTtlMs);i=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});i=c?{holdId:c.holdId,expiresAt:c.expiresAt,seats:c.seats,items:c.items}:i}if(!i){this.raiseHoldConflict(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.")),this.setCtaPhase("idle"),this.syncTray();return}this.hold=i,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(i.expiresAt),this.flashHeldSeats(i),this.emitHoldChange(),this.performanceGroup?this.setCtaPhase("idle"):await this.runCheckoutHandoff(i,i.seats??s)}catch(i){this.opts.onError?.(i);let o=i,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?N("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):N("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){pa(this,e)}stopHoldTimer(){ha(this)}setExtendPrompt(e,t){ua(this,e,t)}refreshExtendPrompt(){ma(this)}handleExtend(){return fa(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),i=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=i?.seats?`<span class="sl-booked-seats">${Ui("picker.group.ticketsConfirmedAcross",i.seats,{performances:i.performances})}</span>`:`<span class="sl-booked-seats">${Ui("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>${O(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 i=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=mo(o?.reason),a=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:r,handoff:i}),this.opts.onCheckout?.(e,t,i),a||this.openCheckoutPanel({kind:"unavailable",reason:r,seatCount:i.lineItems.reduce((l,c)=>l+c.quantity,0)});return}await this.openCheckoutPanel({kind:"pay",provider:s,order:{holdId:i.holdId,expiresAt:i.expiresAt,currency:i.currency,total:i.total,labels:i.lineItems.map(r=>r.displayLabel??r.label)}})}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await ni())}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held \u2014 please try again."),"error"),this.setCtaPhase("idle");return}this.destroyed||!this.root||(this.closeCheckoutPanel(),this.checkoutPanel=t({root:this.root,state:e,eventKey:this.opts.event,formatMoney:i=>this.money(i),startSession:i=>this.pubApi.startCheckout(this.opts.event,{...i,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:i=>this.pubApi.orderStatus(i),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:i=>{this.opts.onOrderConfirmed?.(i),this.controller.refresh()},onError:i=>this.opts.onError?.(i)}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let i=(e.items??[]).map(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=i[0]?.currency??this.currency,s=i.reduce((r,a)=>r+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:o,lineItems:i,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",i){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",!!i),i){let r=document.createElement("button");r.type="button",r.className="sl-toast-action",r.textContent=i.label,r.addEventListener("click",i.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"),i=this.confirmEl;if(!t||!i?.isConnected){e.style.removeProperty("bottom");return}let o=this.els.map.clientHeight;if(o<=0)return;let s=i.getBoundingClientRect(),r=s.height||i.offsetHeight||Ip,a=s.height?s.top-this.els.map.getBoundingClientRect().top:o-En-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(){ur({boot:this.els.boot,map:this.els.map,rail:this.els.rail,root:this.root,reducedMotion:this.reducedMotion()})}placeTooltip(){if(!this.tipEl)return;let e={width:this.els.map.clientWidth,height:this.els.map.clientHeight},t={width:this.tipEl.offsetWidth,height:this.tipEl.offsetHeight},i=this.tipPinned?Js(this.tipPos,e,t):null,o=i??Qs(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${o.left}px`,this.tipEl.style.top=`${o.top}px`,i?this.tipEl.dataset.placement=i.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let i=this.performanceGroup,o=kn(e.mark,i?.nights?.()),s=o?.states.filter(r=>r.free).length??0;return Vs(o,{locale:this.opts.locale,switchLabel:i?.selectionModeSwitch?.label??null,selectPartialLabel:i?.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 i=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t);this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let o=this.nightStripFor(e,i);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=Zs(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:Ke(e),extra:o+(i?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${O(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=i,this.tipEl.classList.toggle("sl-tip-pinned",i),this.tipEl.querySelector("[data-pg-tip-close]")?.addEventListener("click",()=>this.unpinTooltip()),this.tipEl.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>{this.unpinTooltip(),this.performanceGroup?.selectionModeSwitch?.activate()}),ir(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 i={};for(let[o,s]of Object.entries(e())){let r=this.controller.idForLabel(o);r&&(i[r]=s)}Object.keys(i).length&&t.setSeatMarks(i)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),i=this.controller.getSelection().filter(o=>t.has(o.id)||t.has(o.label));if(i.length===t.size)return i;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.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=Xt(this.themeMode),i=rt(this.controller.doc?.theme,this.opts.theme,t);for(let[o,s]of Object.entries(i))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=Zt(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(st(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:Xt(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Xt(this.themeMode),i=rt(this.controller.doc?.theme,this.opts.theme,t),o=st(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,s=ro(i,o);for(let r of so)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),i=JSON.stringify(e??null);t!==i&&(this.opts.pricing=e,!(this.destroyed||!this.els.prices)&&(this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=_o(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=Va(),i=this.localeGeneration+=1,o=await Tp(e);return this.opts.messages&&Ep(this.opts.messages),o===t||this.applyActiveLocale(o,i),o}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(No(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 Ar(this)}setBuyerView(e,t){Pr(this,e,t)}seatState3dFor(e){return Lr(this,e)}pushAvailabilityTo3d(){Mr(this)}syncSelectionTo3d(){Hr(this)}seatViewFor3d(e){return Rr(this,e)}onView3dSeatPick(e){Ir(this,e)}seatViewCaption(e){return Or(this,e)}saveView3dComparisonSeat(e){_r(this,e)}clearView3dComparison(){Nr(this)}view3dComparisonSnapshot(e){return Dr(this,e)}enter3d(e){return Br(this,e)}publish3dTopInset(){Fr(this)}exit3d(){Vr(this)}openSeatConfidencePassport(e,t=null){In(this,e,t)}closeSeatConfidencePassport(e=!0){$t(this,e)}openView3dComparison(){kr(this)}closeView3dComparison(e=!0){We(this,e)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e)}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,i={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,i)}catch(o){this.opts.onError?.(o);let s=o?.reason,r=s==="not_enough_together"?N("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,i={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");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,{...i,ttlMs:this.opts.holdTtlMs});return s?(this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(s.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),i.preferPremium&&s.seats.length&&!s.seats.every(r=>r.commercial?.premium)&&this.toast(N("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),i=!0;if(t)i=await this.controller.release();else if(e){let o=[...new Set([...(e.items??[]).map(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),i=!1}}if(!i){this.toast(this.tf("picker.couldNotReleaseTickets","Couldn't release your tickets. Your hold is unchanged."),"error");return}this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.syncTray(),this.emitHoldChange()}startRealtime(){if(!this.access?.configured||!this.pubApi||this.realtime)return;let e=this.opts.event;this.realtime=new Te({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:Pt(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,i)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:i}),this.syncTray(),this.toast(i==="ineligible"?this.tf("picker.seatNoLongerYours","Some seats are no longer available to you. They have been removed from your order."):this.tf("picker.seatTaken","Someone else took a seat you had picked. It has been removed from your order."),"warning")}})}),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),ye(this,!1)}showAccessPanel(e){if(this.loadAbort&&e.reason==="provider_failed"||this.destroyed||!this.root)return;this.dismissAccessPanel(),this.clearDecisionSurfaces();let t=Po(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=Ra({restart:()=>this.restartAfterHoldExpiry()},this.holdExpiredUnits);this.root.appendChild(e),this.holdExpiredEl=e,requestAnimationFrame(()=>e.querySelector(".sl-interrupt-act")?.focus());let t=this.holdExpiredUnits;this.holdExpiredFresh=!1,this.refreshAvailability().then(()=>{if(this.destroyed||this.holdExpiredEl!==e)return;this.holdExpiredFresh=!0;let i=t.filter(r=>r.objectType!=="ga"),o=[],s=[];for(let r of i){let a=this.controller.seatByLabel(r.label);(a&&this.controller.getStatus(a.id)==="free"?o:s).push(r.label)}Ha(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||Ma({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:i=>this.controller.seatByLabel(i),statusOf:i=>this.controller.getStatus(i),flash:(i,o)=>this.controller.flashSeat(i,o)},e)}).catch(()=>{})}destroy(){this.transportAbort.abort(),this.loadAbort?.abort(),this.loadAbort=null,this.destroyed=!0,Mn(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),ye(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)}};import{formatMoney as Kp,loadLocale as Wp,setStringOverrides as Yp,t as Xp}from"@seatlayer/core";var Ga="seatlayer-performance-group-picker-style";function Ua(){if(document.getElementById(Ga))return;let n=document.createElement("style");n.id=Ga,n.textContent=`
3191
3204
  .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)}
3192
3205
  .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)}
3193
3206
  .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}
@@ -3247,7 +3260,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3247
3260
  @media(min-width:900px){.sl-pg-legend-list{justify-content:flex-start}}
3248
3261
  .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}
3249
3262
  @media(max-width:640px){.sl-pg-head{padding:13px 14px}.sl-pg-head h2{font-size:18px}.sl-pg-inner{min-height:590px}}
3250
- `,document.head.appendChild(n)}var Rp="https://api.seatlayer.io",Ip=6e4,Op=2e3,_p=1e3,Np=36e5,Dp=5e3,Bp=5e3,Fp=15e3,Vp=12e4,zp=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),Y=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function $p(n){return new Promise(e=>setTimeout(e,n))}function Nn(n){let e=Number(n.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(Dp,e*1e3)):1e3}function bt(n,e){return`/pub/performance-groups/${encodeURIComponent(n)}/operations/${encodeURIComponent(e)}`}function Vt(n){return n.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var Dn=class{constructor(e,t,i){this.api=e;this.sink=t;this.intervalMs=i;this.stopped=!0;this.timer=null;this.prior=new Map}start(){this.stopped&&(this.stopped=!1,this.tick())}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){try{let e=await this.api.objects(this.api.groupKey);if(this.stopped)return;let t=new Map(Object.entries(e.seats)),o=[...new Set([...this.prior.keys(),...t.keys()])].filter(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 Y){this.stop();return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},ji=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??Rp).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??Ip,this.realtimePollMs=Math.max(500,t.realtimePollMs??Op),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 i=this.readOperationRecord();i&&this.storedIsUndecided(i)&&(this.pendingOperationId=i.operationId)}get pendingOperation(){return this.pendingOperationId}get holdBlocked(){return!!this.adoptFailure||!!this.pendingOperationId&&this.lastRecovery.kind!=="idle"}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,i]=await Promise.all([this.descriptorCache?Promise.resolve(this.descriptorCache):this.descriptor(),this.chartRequest]);return{doc:i,event:{key:t.key,name:t.name,salesClosed:t.state!=="active",venue:t.venue,startsAt:t.performances[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.blob(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/assets/${encodeURIComponent(t)}`):Promise.reject(new V(404,"not_found","not_found"))}async objects(e){let t=this.descriptorCache?.inclusionMode==="flexible_dates",i=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/objects`+(this.selectionMode==="per_performance"||t?"?view=per-performance":"");if(this.reuseObjectsCacheOnce&&this.objectsCache)this.reuseObjectsCacheOnce=!1;else{let r=await this.authorized(i,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 V(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 V(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(r[0]?.seats??{}),l=Object.fromEntries(a.map(d=>[d,r.every(m=>m.seats[d]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(d=>{let m=r.filter(p=>p.seats[d]!=="free").map(p=>p.eventKey);return m.length>0&&m.length<r.length?[[d,m]]:[]})),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 V(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 V(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 V(404,"group_performance_not_found","group_performance_not_found");this.activePerformanceKey=e}setIncludedEventKeys(e){let t=new Set(this.descriptorCache?.performances.map(i=>i.eventKey)??[]);if(!e.length||new Set(e).size!==e.length||e.some(i=>!t.has(i)))throw new V(422,"invalid_event_keys","invalid_event_keys");this.includedEventKeys=new Set(e),this.reuseObjectsCacheOnce=!!this.objectsCache}includedPerformanceKeys(){return(this.descriptorCache?.performances??[]).map(e=>e.eventKey).filter(e=>this.includedEventKeys.has(e))}setPerformanceSelections(e,t){this.selectionsByEvent.set(e,t.map(i=>({...i})))}allocationsForHold(e){return(this.allocationsByHold.get(e)??[]).map(t=>({eventKey:t.eventKey,items:t.items.map(i=>({...i}))}))}async hold(e,t,i,o){if(this.assertUsable(),o)throw new V(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 V(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 V(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,...i?{ttlMs:i}:{}})})}catch(c){if(c instanceof Y)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,Nn(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,Nn(l))}}try{return await this.throwResponse(l,s)}catch(c){throw this.failOperation(a),c}}async release(e,t,i){this.assertUsable();let o=this.operationForHold(i),s=await this.json(`${bt(this.groupKey,o)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(i),this.allocationsByHold.delete(i),this.clearOperationRecord(),s}async resume(e,t){this.assertUsable();let i=this.operationForHold(t),o=await this.json(bt(this.groupKey,i));return this.complete(o.operation)}async extend(e,t,i=12e4){this.assertUsable();let o=this.operationForHold(t),s=Math.max(_p,Math.min(Np,Math.round(i))),r=await this.json(`${bt(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 V(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new Dn(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:Vt(e.operationId)});let t;try{t=await this.authorized(bt(this.groupKey,e.operationId))}catch(s){return s instanceof Y||this.recoveryFailed(e.operationId,"request_failed"),null}if(t.status===404)return this.failOperation(e.operationId),null;if(!t.ok)return this.recoveryFailed(e.operationId,"request_failed"),null;let i=await this.responseJson(t);this.emit(i.operation);let o=i.operation.state;return o==="committed"||o==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(i.operation)):o==="aborted"||o==="expired"?(this.failOperation(e.operationId),null):this.recover(e.operationId,[],Date.now()+this.recoveryTimeoutMs)}async retryRecovery(){this.assertUsable();let e=this.pendingOperationId??this.readOperationRecord()?.operationId??null;return e?(this.pendingOperationId=e,this.recover(e,[],Date.now()+this.recoveryTimeoutMs)):null}watchSettlement(e){if(this.destroyed)return;let t=this.operationIdForHold(e);!t||t===this.settleOperationId||(this.stopSettlementWatch(),this.settleOperationId=t,this.settleStartedAt=Date.now(),this.settleState="committed",typeof document<"u"&&(this.settleVisibility=()=>{document.hidden||!this.settleOperationId||this.pollSettlement()},document.addEventListener("visibilitychange",this.settleVisibility)),this.scheduleSettlementPoll())}stopSettlementWatch(){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null,this.settleOperationId=null,this.settleState=null,this.settleVisibility&&typeof document<"u"&&document.removeEventListener("visibilitychange",this.settleVisibility),this.settleVisibility=null}scheduleSettlementPoll(){if(this.destroyed||!this.settleOperationId)return;if(this.settleTimer&&clearTimeout(this.settleTimer),typeof document<"u"&&document.hidden){this.settleTimer=null;return}let t=Date.now()-this.settleStartedAt>=Vp?Fp:Bp;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(bt(this.groupKey,e));if(!o.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(o)).operation}catch(o){return o instanceof Y?this.stopSettlementWatch():this.scheduleSettlementPoll()}if(this.destroyed||this.settleOperationId!==e)return;let i=t.state!==this.settleState;if(this.settleState=t.state,i&&this.noteOperationState(e,t.state),this.settled(t.state)){this.stopSettlementWatch(),t.state!=="booked"&&this.clearOperationRecord(),this.emit(t);return}i&&this.emit(t),this.scheduleSettlementPoll()}destroy(){if(!this.destroyed){this.destroyed=!0,this.stopSettlementWatch(),this.access.onRenewed(void 0);try{this.aborter.abort()}catch{}}}operationRecordKey(){return`@seatlayer/performance-group-operation/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}`}readOperationRecord(){try{let e=window.sessionStorage.getItem(this.operationRecordKey());if(!e)return null;let t=JSON.parse(e);return!t?.operationId||t.groupKey!==this.groupKey?null:t}catch{return null}}storedIsUndecided(e){return e.state==="undecided"||zp.has(e.state)}writeOperationRecord(e){try{window.sessionStorage.setItem(this.operationRecordKey(),JSON.stringify(e))}catch{}}clearOperationRecord(){try{window.sessionStorage.removeItem(this.operationRecordKey())}catch{}}beginOperation(e){this.pendingOperationId=e;let t=this.readOperationRecord();this.writeOperationRecord({operationId:e,groupKey:this.groupKey,state:"undecided",createdAt:t?.operationId===e?t.createdAt:Date.now()})}noteOperationState(e,t){let i=this.readOperationRecord();!i||i.operationId!==e||this.writeOperationRecord({...i,state:t})}failOperation(e){this.pendingOperationId=null,this.clearOperationRecord(),this.emitRecovery({kind:"idle"}),this.onOperationState?.({operationId:e,state:"aborted",decision:"abort"})}async adoptSession(e){if(this.destroyed)return;let t=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/session/adopt`;for(let o=0;o<2;o++){if(this.destroyed)return;try{if((await this.fetcher(`${this.base}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit",signal:this.aborter.signal})).ok){this.adoptFailure=null;return}}catch{}}if(this.destroyed)return;this.adoptFailure=new V(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let i=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:i,reference:i?Vt(i):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,i,o=100){let s=o,r=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=i;){if(this.destroyed)throw new Y;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=r,reference:Vt(e)}),await $p(s),this.destroyed)throw new Y;let l;try{l=await this.authorized(bt(this.groupKey,e))}catch(d){if(d instanceof Y)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 V(409,"conflict","conflict",t.map(d=>({label:d,status:"held"})));s=Nn(l)}throw this.recoveryFailed(e,"deadline"),new V(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:Vt(e),reason:t,retryable:!0})}emitRecovery(e){if(this.destroyed)return;let t=this.lastRecovery.kind===e.kind&&JSON.stringify(this.lastRecovery)===JSON.stringify(e);this.lastRecovery=e,t||this.onRecoveryState?.(e)}noteAvailability(e,t,i){if(this.destroyed||!this.onAvailability)return;let o=e.state??this.descriptorCache?.state??"active",s=e.revision??null,r=!!s&&!!this.knownRevision&&s!==this.knownRevision;s&&!this.knownRevision&&(this.knownRevision=s);let a=i?.partial??{},l=Object.values(i?.seats??{});this.onAvailability({partial:a,freeCount:l.filter(c=>c==="free").length,blockedCount:Object.keys(i?.seats??{}).filter(c=>i.seats[c]!=="free"&&!(c in a)).length,state:o,salesClosed:!!t||o!=="active",revision:s,revisionChanged:r})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new V(409,"group_hold_not_active","group_hold_not_active");this.pendingOperationId=null,this.noteOperationState(e.operationId,e.state),this.operationByHold.set(e.hold.id,e.operationId),this.writeMapping(e.hold.id,e.operationId);let t=e.hold.allocations??[];this.allocationsByHold.set(e.hold.id,t);let i=t.find(o=>o.eventKey===this.activePerformanceKey)?.items;return{holdId:e.hold.id,expiresAt:e.hold.expiresAt,items:i??e.hold.items??[]}}emit(e){this.destroyed||this.onOperationState?.({operationId:e.operationId,state:e.state,decision:e.decision})}operationForHold(e){let t=this.operationIdForHold(e);if(!t)throw new V(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 Y;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},i=!1){if(this.destroyed)throw new Y;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(i?"unauthorized":"initial");if(this.destroyed)throw new Y;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(!i&&(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 i=await this.authorized(e,t);return i.ok?this.responseJson(i):this.throwResponse(i)}async blob(e){let t=await this.authorized(e);return t.ok?t.blob():this.throwResponse(t)}async responseJson(e){return e.json()}async throwResponse(e,t=[]){let o=await e.json().catch(()=>null)??{},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 V(e.status,o.error??s,s,o.conflicts)}};var Kp="https://api.seatlayer.io";function $a(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var Bn=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 ae({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable}),this.api=new ji(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,za(),await Gp(this.options.locale),this.options.messages&&Up(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(i){throw Ce({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:Oe(this.options.performanceGroup),transport:"pubapi"}),i}return this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome($a(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 i=document.createElement("div");i.className="sl-pg-root",i.dataset.performanceGroup=t.key,i.dataset.selectionMode=this.mode;let o=document.createElement("div");o.className="sl-pg-progress";let 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=xn(this.performanceCards(t),this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.performanceCount})),c.append(h,d);let m=document.createElement("div");m.className="sl-pg-held-summary",m.hidden=!0,s.append(r,a,l,c,m);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 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"),A=document.createElement("button");A.type="button",A.hidden=!0,A.textContent=this.copy("picker.group.retry"),A.addEventListener("click",()=>{this.retryRecovery()}),S.append(v,A),T.appendChild(S);let D=document.createElement("div");D.className="sl-pg-live",D.setAttribute("role","status"),D.setAttribute("aria-live","polite"),i.append(o,s),y&&i.append(y),i.append(p,T,f,D),e.appendChild(i),this.root=i,this.progressHost=o,this.legendHost=p,this.paneHost=f,this.datesSummaryHost=h,this.datesCardsHost=d,this.innerHost=T,this.heldSummary=m,this.live=D,this.statusHost=S,this.statusCopy=v,this.statusAction=A,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new Ke(Vi({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:(i,o)=>{try{this.options.onAnalytics?.(i,{...o,metricScope:"performance_group",performanceGroupKey:e.key,performanceCount:e.performanceCount,selectionMode:this.mode})}catch{}},hideBadge:this.options.hideBadge,theme:this.options.theme,holdTtlMs:this.options.holdTtlMs,initialHoldId:this.options.initialHoldId,restoreHold:this.options.restoreHold,confirmSelection:this.options.confirmSelection,seatView:this.options.seatView,onSelectionChange:i=>this.selectionChanged(i),onSelectionValidityChange:i=>this.selectionValidityChanged(i),onSelectionValid:this.options.onSelectionValid,onSelectionInvalid:this.options.onSelectionInvalid,onSelectionLimit:this.options.onSelectionLimit,onHoldChange:(i,o)=>this.holdChanged(i,o),onCheckout:(i,o)=>this.checkout(i,o),onHoldExpired:()=>{this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()},onError:this.options.onError},{performanceCount:e.performanceCount,selectionMode:this.mode,submissionState:()=>this.submissionState(),suppressPricing:!0,nights:()=>this.nights(),seatMarks:()=>this.seatMarks(),nightSummary:()=>this.nightSummary(),groupSelectionSummary:()=>this.groupSelectionSummary(),activePerformanceLabel:()=>this.activePerformanceLabel(),selectedPerformanceDates:()=>this.mode==="same_seat"&&e.inclusionMode==="flexible_dates"?Rs(this.includedPerformances(),e.performanceCount,this.options.locale,this.copy("picker.group.flexibleSelectedNote",{count:this.includedPerformances().length})):null,selectNight:i=>{this.switchPerformance(i)},selectionModeSwitch:this.options.allowSelectionModeSwitch&&this.mode==="same_seat"?{label:this.copy("picker.group.chooseNightByNight"),activate:()=>{this.switchSelectionMode("per_performance")}}:null,partialSeatSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),activate:(i,o)=>{this.selectPartialSeat(i,o)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:i=>this.partialSeatDates.get(i)??this.nights().map(o=>o.eventKey),label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),apply:(i,o)=>this.applySeatDates(i,o,!0)}:null}));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:Ci(t,this.options.locale),time:Ai(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:Pi(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,i=!!t?.salesClosed||!!t&&t.state!=="active",o=this.mode==="same_seat"&&!i?t?.partial??{}:{},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=Pi(e,this.options.locale),i=e.name?.trim();return i&&i!==t?`${i} \xB7 ${t}`:t}nightSummary(){return this.mode!=="per_performance"?[]:(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:Pi(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),i=t.filter(s=>s>0),o=i.length===t.length&&i.every(s=>s===i[0]);return{seats:t.reduce((s,r)=>s+r,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:i.length,perPerformance:o&&i.length?i[0]:null}}syncProgress(){if(!this.progressHost)return;let e=!!this.activeHandoff,t=[{id:"performances",label:this.copy("picker.group.stepPerformances"),state:"done"},{id:"seats",label:this.copy("picker.group.stepSeats"),state:e?"done":"current"},{id:"review",label:this.copy("picker.group.stepReview"),state:this.booked?"done":e?"current":"upcoming"}];this.progressHost.innerHTML=$s(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=Os({available:e.freeCount>0,selected:(this.picker?.getSelection().length??0)>0,partial:Object.keys(e.partial).length>0,unavailable:e.blockedCount>0},{title:this.copy("picker.group.legendTitle"),available:this.copy("picker.group.legendAvailable"),selected:this.copy("picker.group.legendSelected"),partial:this.copy("picker.group.legendNotEveryDate"),unavailable:this.copy("picker.group.legendUnavailable")},this.categoryColor())}categoryColor(){return this.picker?.categoryLegendColor()??"#2563eb"}syncPane(){let e=this.paneHost;if(!e)return;let t=this.includedPerformances();if(this.mode!=="same_seat"||!t.length){e.hidden=!0,e.replaceChildren();return}let i=this.activeHandoff?.seatLabels??this.picker?.getSelection().map(s=>s.label)??[],o=this.heldTotal();e.hidden=!1,e.innerHTML=js({title:this.copy("picker.group.yourSelection"),rows:t.map(s=>({eventKey:s.eventKey,name:`${Ci(s,this.options.locale)} ${Ai(s,this.options.locale)}`,labels:i})),empty:this.copy("picker.group.noSeatsChosenYet"),note:o?null:this.copy("picker.group.pricesPerPerformance"),total:o?{label:this.copy("picker.group.total"),amount:o}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:Gs(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 jp(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(i=>t.has(i.eventKey))}syncIncludedDates(){let e=this.descriptorValue;if(!e||!this.datesSummaryHost||!this.datesCardsHost)return;let t=this.includedPerformances(),i=e.inclusionMode==="flexible_dates";this.datesSummaryHost.textContent=i&&t.length<e.performanceCount?this.copy("picker.group.flexibleDatesSelected",{selected:t.length,total:e.performanceCount}):this.copy(i?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:e.performanceCount}),this.datesCardsHost.innerHTML=xn(this.performanceCards({...e,performances:t}),this.copy(i&&t.length<e.performanceCount?"picker.group.flexibleSelectedNote":i?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.length}))}async selectPartialSeat(e,t){if(!(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)){if((this.picker?.getSelection().length??0)>0){this.announce(this.copy("picker.group.clearBeforePartial"));return}this.partialSeatDates.set(e,[...t]),await this.applySeatDates(e,t,!1)}}async applySeatDates(e,t,i){if(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)return!1;let o=this.api.includedPerformanceKeys();if(o.length===t.length&&o.every(s=>t.includes(s)))return!0;this.selectingPartialSeat=!0;try{if(this.api.setIncludedEventKeys(t),this.syncIncludedDates(),await this.picker?.refreshAvailability(),!(i?this.picker?.selectObjectsWithoutConfirmation([e])??[]:this.picker?.selectObjects([e])??[]).length)throw new Error("performance_group_partial_seat_unavailable");return this.announce(this.copy("picker.group.selectedAvailableDates",{count:t.length})),this.syncPane(),this.syncLegend(),!0}catch(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($a(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 Y)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 i=this.options.messages?.[e];return i!==void 0?t?i.replace(/\{(\w+)\}/g,(o,s)=>String(t[s]??`{${s}}`)):i:qp(e,t)}performanceTabs(e){let t=document.createElement("div");t.className="sl-pg-tabsbar";let i=document.createElement("button");i.type="button",i.className="sl-pg-step",i.dataset.step="previous",i.setAttribute("aria-label",this.copy("picker.group.previousPerformance")),i.textContent="\u2039",i.addEventListener("click",()=>{this.stepPerformance(-1)});let o=document.createElement("button");o.type="button",o.className="sl-pg-step",o.dataset.step="next",o.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),o.textContent="\u203A",o.addEventListener("click",()=>{this.stepPerformance(1)});let 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",m=>this.tabKeydown(m)),s.appendChild(l)}),t.append(i,s,o),this.tabsHost=s,this.prevButton=i,this.nextButton=o,t}tabButtons(){return[...this.tabsHost?.querySelectorAll(".sl-pg-tab")??[]]}tabKeydown(e){let t=this.tabButtons(),i=t.findIndex(a=>a===e.target);if(i<0)return;let o=getComputedStyle(this.tabsHost??document.body).direction==="rtl",s=-1;switch(e.key){case"ArrowRight":s=i+(o?-1:1);break;case"ArrowLeft":s=i+(o?1:-1);break;case"ArrowDown":s=i+1;break;case"ArrowUp":s=i-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(),i=t.findIndex(s=>s.dataset.eventKey===this.activePerformanceKey),o=t[i+e];!o||o.disabled||(o.focus({preventScroll:!0}),this.switchPerformance(o.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let o=!this.holdBlocked();return{complete:e.length,total:e.length,ready:o}}let t=this.options.numberOfPlacesToSelect,i=e.filter(o=>this.selectionsByEvent.get(o.eventKey)?.length===t&&this.validByEvent.get(o.eventKey)!==!1).length;return{complete:i,total:e.length,ready:i===e.length&&!this.holdBlocked()}}holdBlocked(){return this.operationPending||this.recovery.kind!=="idle"||!!this.availability?.salesClosed}selectionChanged(e){if(this.mode!=="per_performance"){this.options.onSelectionChange?.(e),this.syncPane(),this.syncLegend(),!e.length&&!this.activeHandoff&&!this.resettingFlexibleSelection&&!this.selectingPartialSeat&&this.descriptorValue?.inclusionMode==="flexible_dates"&&this.api.includedPerformanceKeys().length<this.descriptorValue.performanceCount&&(this.resettingFlexibleSelection=!0,this.api.setIncludedEventKeys(this.descriptorValue.performances.map(i=>i.eventKey)),this.syncIncludedDates(),this.picker?.refreshAvailability().catch(i=>this.options.onError?.(i)).finally(()=>{this.resettingFlexibleSelection=!1}));return}if(this.refreshingComposition||this.switchingPerformance||!this.activePerformanceKey)return;let t=e.map(i=>({...i}));this.selectionsByEvent.set(this.activePerformanceKey,t),this.api.setPerformanceSelections(this.activePerformanceKey,t.map(i=>({label:i.label}))),t.length!==this.options.numberOfPlacesToSelect?this.validByEvent.set(this.activePerformanceKey,!1):this.validByEvent.has(this.activePerformanceKey)||this.validByEvent.set(this.activePerformanceKey,!0),this.updateTabs(),this.options.onSelectionChange?.(e),this.refreshComposition(),this.syncLegend()}selectionValidityChanged(e){if(this.mode==="per_performance"&&!this.switchingPerformance&&this.activePerformanceKey){let t=this.validByEvent.get(this.activePerformanceKey);this.validByEvent.set(this.activePerformanceKey,e.isValid),this.updateTabs(),!this.refreshingComposition&&t!==e.isValid&&this.refreshComposition()}this.options.onSelectionValidityChange?.(e)}refreshComposition(){if(this.refreshingComposition||!this.picker)return;let e=this.submissionState();this.refreshingComposition=!0;try{this.picker.refreshPerformanceGroupComposition();let t=this.submissionState();(e.complete!==t.complete||e.ready!==t.ready)&&this.picker.refreshPerformanceGroupComposition()}finally{this.refreshingComposition=!1}}tabState(e){let t=this.options.numberOfPlacesToSelect??1,i=(this.selectionsByEvent.get(e)??[]).map(s=>s.label),o=this.copy("picker.group.chosenOfTotal",{chosen:i.length,total:t});return i.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:o}:i.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:i.join(", ")}),badge:o}:i.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:o}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-i.length}),badge:o}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(o=>{let 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 i=e.findIndex(o=>o.dataset.eventKey===this.activePerformanceKey);this.prevButton&&(this.prevButton.disabled=t||i<=0),this.nextButton&&(this.nextButton.disabled=t||i<0||i>=e.length-1)}async switchPerformance(e){if(this.mode!=="per_performance"||this.switchingPerformance||this.holdBlocked()||this.activeHandoff||e===this.activePerformanceKey||!this.picker)return;this.activePerformanceKey&&this.selectionChanged(this.picker.getSelection());let t=this.selectionsByEvent.get(e)?.map(i=>i.label)??[];this.switchingPerformance=!0,this.activePerformanceKey=e,this.updateTabs(),this.setInteractionLocked(!0);try{this.picker.clearSelection(),this.api.setActivePerformance(e),await this.picker.refreshAvailability();let i=this.picker.selectObjects(t);this.switchingPerformance=!1,this.selectionChanged(i),i.length!==t.length&&this.validByEvent.set(e,!1),this.options.onSelectionChange?.(i);let o=this.descriptorValue?.performances.find(s=>s.eventKey===e);o&&this.announce(this.copy("picker.group.performanceOpened",{performance:o.name}))}catch(i){this.options.onError?.(i)}finally{this.switchingPerformance=!1,!this.operationPending&&this.recovery.kind==="idle"&&this.setInteractionLocked(!1),this.updateTabs(),this.picker.refreshPerformanceGroupComposition()}}setInteractionLocked(e){let t=this.innerHost;t&&(t.dataset.locked=String(e),t.setAttribute("aria-busy",String(e)),t.setAttribute("aria-disabled",String(e)))}announce(e){this.live&&(this.live.textContent=e)}showStatus(e,t,i={}){this.statusHost&&this.statusCopy&&this.statusAction&&(this.statusCopy.textContent=t,this.statusHost.hidden=!t,this.statusAction.hidden=!i.retry),this.announce(t),this.options.onStatusChange?.({kind:e,message:t,...i.reference?{reference:i.reference}:{}})}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 Y)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 Y)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 Y)return;this.options.onError?.(t)}}handoff(e,t){let i=this.descriptorValue,o=this.api.operationIdForHold(e.holdId);if(!i||!o)throw new Error("seatlayer: Performance Group hold identity is unavailable");let s=this.api.allocationsForHold(e.holdId);return{operationId:o,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:i,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 i=this.descriptorValue?.performances.find(r=>r.eventKey===t.eventKey),o=document.createElement("p"),s=document.createElement("strong");s.textContent=i?.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 i=this.handoff(e,t),o=this.activeHandoff?.holdId!==i.holdId;this.activeHandoff=i,this.renderHeldAllocations(this.api.allocationsForHold(e.holdId)),this.updateTabs(),this.api.watchSettlement(e.holdId),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),o&&this.options.onHold?.(i),this.options.onHoldChange?.(i)}checkout(e,t){let i=this.handoff(e,t);this.continued=!0,this.activeHandoff=i,this.options.onCheckout?.(i)}};import{formatMoney as Ya,fromMinorUnits as Xa}from"@seatlayer/core";var ja="seatlayer-season-picker-style";function Ga(){if(document.getElementById(ja))return;let n=document.createElement("style");n.id=ja,n.textContent=`
3263
+ `,document.head.appendChild(n)}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"]),Y=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function qp(n){return new Promise(e=>setTimeout(e,n))}function Fn(n){let e=Number(n.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(zp,e*1e3)):1e3}function vt(n,e){return`/pub/performance-groups/${encodeURIComponent(n)}/operations/${encodeURIComponent(e)}`}function jt(n){return n.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var Vn=class{constructor(e,t,i){this.api=e;this.sink=t;this.intervalMs=i;this.stopped=!0;this.timer=null;this.prior=new Map}start(){this.stopped&&(this.stopped=!1,this.tick())}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){try{let e=await this.api.objects(this.api.groupKey);if(this.stopped)return;let t=new Map(Object.entries(e.seats)),o=[...new Set([...this.prior.keys(),...t.keys()])].filter(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 Y){this.stop();return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},qi=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 i=this.readOperationRecord();i&&this.storedIsUndecided(i)&&(this.pendingOperationId=i.operationId)}get pendingOperation(){return this.pendingOperationId}get holdBlocked(){return!!this.adoptFailure||!!this.pendingOperationId&&this.lastRecovery.kind!=="idle"}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,i]=await Promise.all([this.descriptorCache?Promise.resolve(this.descriptorCache):this.descriptor(),this.chartRequest]);return{doc:i,event:{key:t.key,name:t.name,salesClosed:t.state!=="active",venue:t.venue,startsAt:t.performances[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.blob(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/assets/${encodeURIComponent(t)}`):Promise.reject(new V(404,"not_found","not_found"))}async objects(e){let t=this.descriptorCache?.inclusionMode==="flexible_dates",i=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/objects`+(this.selectionMode==="per_performance"||t?"?view=per-performance":"");if(this.reuseObjectsCacheOnce&&this.objectsCache)this.reuseObjectsCacheOnce=!1;else{let r=await this.authorized(i,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 V(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(p=>this.includedEventKeys.has(p.eventKey));if(!r.length)throw new V(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(r[0]?.seats??{}),l=Object.fromEntries(a.map(p=>[p,r.every(u=>u.seats[p]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(p=>{let u=r.filter(h=>h.seats[p]!=="free").map(h=>h.eventKey);return u.length>0&&u.length<r.length?[[p,u]]:[]})),d={seats:l,partial:c,hidden:[...new Set(r.flatMap(p=>p.hidden??[]))],closed:[...new Set(r.flatMap(p=>p.closed??[]))],revision:o.revision,state:o.state,salesClosed:r.some(p=>p.salesClosed)};return this.noteAvailability(o,d.salesClosed,d),d}let s=o.performances.find(r=>r.eventKey===this.activePerformanceKey);if(!s)throw new V(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 V(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 V(404,"group_performance_not_found","group_performance_not_found");this.activePerformanceKey=e}setIncludedEventKeys(e){let t=new Set(this.descriptorCache?.performances.map(i=>i.eventKey)??[]);if(!e.length||new Set(e).size!==e.length||e.some(i=>!t.has(i)))throw new V(422,"invalid_event_keys","invalid_event_keys");this.includedEventKeys=new Set(e),this.reuseObjectsCacheOnce=!!this.objectsCache}includedPerformanceKeys(){return(this.descriptorCache?.performances??[]).map(e=>e.eventKey).filter(e=>this.includedEventKeys.has(e))}setPerformanceSelections(e,t){this.selectionsByEvent.set(e,t.map(i=>({...i})))}allocationsForHold(e){return(this.allocationsByHold.get(e)??[]).map(t=>({eventKey:t.eventKey,items:t.items.map(i=>({...i}))}))}async hold(e,t,i,o){if(this.assertUsable(),o)throw new V(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 V(409,"group_selection_incomplete","group_selection_incomplete");this.setPerformanceSelections(this.activePerformanceKey,t);let c=this.descriptorCache.performances.filter(d=>this.includedEventKeys.has(d.eventKey)).map(d=>({eventKey:d.eventKey,selections:this.selectionsByEvent.get(d.eventKey)??[]}));if(c.some(d=>d.selections.length!==this.partySize))throw new V(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,...i?{ttlMs:i}:{}})})}catch(c){if(c instanceof Y)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,Fn(l))}if(l.status===503){let c=await l.clone().json().catch(()=>null);if((c?.code??c?.error)==="performance_group_abort_pending"){let d=c?.operation?.operationId??a;return this.beginOperation(d),c?.operation&&this.emit(c.operation),this.recover(d,s,Date.now()+this.recoveryTimeoutMs,Fn(l))}}try{return await this.throwResponse(l,s)}catch(c){throw this.failOperation(a),c}}async release(e,t,i){this.assertUsable();let o=this.operationForHold(i),s=await this.json(`${vt(this.groupKey,o)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(i),this.allocationsByHold.delete(i),this.clearOperationRecord(),s}async resume(e,t){this.assertUsable();let i=this.operationForHold(t),o=await this.json(vt(this.groupKey,i));return this.complete(o.operation)}async extend(e,t,i=12e4){this.assertUsable();let o=this.operationForHold(t),s=Math.max(Fp,Math.min(Vp,Math.round(i))),r=await this.json(`${vt(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 V(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new Vn(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:jt(e.operationId)});let t;try{t=await this.authorized(vt(this.groupKey,e.operationId))}catch(s){return s instanceof Y||this.recoveryFailed(e.operationId,"request_failed"),null}if(t.status===404)return this.failOperation(e.operationId),null;if(!t.ok)return this.recoveryFailed(e.operationId,"request_failed"),null;let i=await this.responseJson(t);this.emit(i.operation);let o=i.operation.state;return o==="committed"||o==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(i.operation)):o==="aborted"||o==="expired"?(this.failOperation(e.operationId),null):this.recover(e.operationId,[],Date.now()+this.recoveryTimeoutMs)}async retryRecovery(){this.assertUsable();let e=this.pendingOperationId??this.readOperationRecord()?.operationId??null;return e?(this.pendingOperationId=e,this.recover(e,[],Date.now()+this.recoveryTimeoutMs)):null}watchSettlement(e){if(this.destroyed)return;let t=this.operationIdForHold(e);!t||t===this.settleOperationId||(this.stopSettlementWatch(),this.settleOperationId=t,this.settleStartedAt=Date.now(),this.settleState="committed",typeof document<"u"&&(this.settleVisibility=()=>{document.hidden||!this.settleOperationId||this.pollSettlement()},document.addEventListener("visibilitychange",this.settleVisibility)),this.scheduleSettlementPoll())}stopSettlementWatch(){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null,this.settleOperationId=null,this.settleState=null,this.settleVisibility&&typeof document<"u"&&document.removeEventListener("visibilitychange",this.settleVisibility),this.settleVisibility=null}scheduleSettlementPoll(){if(this.destroyed||!this.settleOperationId)return;if(this.settleTimer&&clearTimeout(this.settleTimer),typeof document<"u"&&document.hidden){this.settleTimer=null;return}let t=Date.now()-this.settleStartedAt>=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(vt(this.groupKey,e));if(!o.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(o)).operation}catch(o){return o instanceof Y?this.stopSettlementWatch():this.scheduleSettlementPoll()}if(this.destroyed||this.settleOperationId!==e)return;let i=t.state!==this.settleState;if(this.settleState=t.state,i&&this.noteOperationState(e,t.state),this.settled(t.state)){this.stopSettlementWatch(),t.state!=="booked"&&this.clearOperationRecord(),this.emit(t);return}i&&this.emit(t),this.scheduleSettlementPoll()}destroy(){if(!this.destroyed){this.destroyed=!0,this.stopSettlementWatch(),this.access.onRenewed(void 0);try{this.aborter.abort()}catch{}}}operationRecordKey(){return`@seatlayer/performance-group-operation/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}`}readOperationRecord(){try{let e=window.sessionStorage.getItem(this.operationRecordKey());if(!e)return null;let t=JSON.parse(e);return!t?.operationId||t.groupKey!==this.groupKey?null:t}catch{return null}}storedIsUndecided(e){return e.state==="undecided"||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 i=this.readOperationRecord();!i||i.operationId!==e||this.writeOperationRecord({...i,state:t})}failOperation(e){this.pendingOperationId=null,this.clearOperationRecord(),this.emitRecovery({kind:"idle"}),this.onOperationState?.({operationId:e,state:"aborted",decision:"abort"})}async adoptSession(e){if(this.destroyed)return;let t=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/session/adopt`;for(let o=0;o<2;o++){if(this.destroyed)return;try{if((await this.fetcher(`${this.base}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit",signal:this.aborter.signal})).ok){this.adoptFailure=null;return}}catch{}}if(this.destroyed)return;this.adoptFailure=new V(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let i=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:i,reference:i?jt(i):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,i,o=100){let s=o,r=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=i;){if(this.destroyed)throw new Y;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=r,reference:jt(e)}),await qp(s),this.destroyed)throw new Y;let l;try{l=await this.authorized(vt(this.groupKey,e))}catch(p){if(p instanceof Y)throw p;if(p instanceof se)throw this.recoveryFailed(e,"request_failed"),p;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 d=(await this.responseJson(l)).operation;if(a=d.state,this.noteOperationState(e,d.state),this.emit(d),d.state==="committed"||d.state==="booked")return this.emitRecovery({kind:"idle"}),this.complete(d);if(d.state==="aborted"||d.state==="expired")throw this.failOperation(e),new V(409,"conflict","conflict",t.map(p=>({label:p,status:"held"})));s=Fn(l)}throw this.recoveryFailed(e,"deadline"),new V(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:jt(e),reason:t,retryable:!0})}emitRecovery(e){if(this.destroyed)return;let t=this.lastRecovery.kind===e.kind&&JSON.stringify(this.lastRecovery)===JSON.stringify(e);this.lastRecovery=e,t||this.onRecoveryState?.(e)}noteAvailability(e,t,i){if(this.destroyed||!this.onAvailability)return;let o=e.state??this.descriptorCache?.state??"active",s=e.revision??null,r=!!s&&!!this.knownRevision&&s!==this.knownRevision;s&&!this.knownRevision&&(this.knownRevision=s);let a=i?.partial??{},l=Object.values(i?.seats??{});this.onAvailability({partial:a,freeCount:l.filter(c=>c==="free").length,blockedCount:Object.keys(i?.seats??{}).filter(c=>i.seats[c]!=="free"&&!(c in a)).length,state:o,salesClosed:!!t||o!=="active",revision:s,revisionChanged:r})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new V(409,"group_hold_not_active","group_hold_not_active");this.pendingOperationId=null,this.noteOperationState(e.operationId,e.state),this.operationByHold.set(e.hold.id,e.operationId),this.writeMapping(e.hold.id,e.operationId);let t=e.hold.allocations??[];this.allocationsByHold.set(e.hold.id,t);let i=t.find(o=>o.eventKey===this.activePerformanceKey)?.items;return{holdId:e.hold.id,expiresAt:e.hold.expiresAt,items:i??e.hold.items??[]}}emit(e){this.destroyed||this.onOperationState?.({operationId:e.operationId,state:e.state,decision:e.decision})}operationForHold(e){let t=this.operationIdForHold(e);if(!t)throw new V(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 Y;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},i=!1){if(this.destroyed)throw new Y;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(i?"unauthorized":"initial");if(this.destroyed)throw new Y;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(!i&&(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 i=await this.authorized(e,t);return i.ok?this.responseJson(i):this.throwResponse(i)}async blob(e){let t=await this.authorized(e);return t.ok?t.blob():this.throwResponse(t)}async responseJson(e){return e.json()}async throwResponse(e,t=[]){let o=await e.json().catch(()=>null)??{},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 V(e.status,o.error??s,s,o.conflicts)}};var Zp="https://api.seatlayer.io";function qa(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var zn=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 ae({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable}),this.api=new qi(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,Ua(),await Wp(this.options.locale),this.options.messages&&Yp(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(i){throw ve({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:Ae(this.options.performanceGroup),transport:"pubapi"}),i}return this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(qa(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 i=document.createElement("div");i.className="sl-pg-root",i.dataset.performanceGroup=t.key,i.dataset.selectionMode=this.mode;let o=document.createElement("div");o.className="sl-pg-progress";let 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 d=document.createElement("summary");d.textContent=this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:t.performanceCount});let p=document.createElement("div");p.innerHTML=Tn(this.performanceCards(t),this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.performanceCount})),c.append(d,p);let u=document.createElement("div");u.className="sl-pg-held-summary",u.hidden=!0,s.append(r,a,l,c,u);let h=document.createElement("div");h.className="sl-pg-legend";let y=document.createElement("div");y.className="sl-pg-pane",y.setAttribute("role","group"),y.setAttribute("aria-label",this.copy("picker.group.yourSelection")),y.hidden=!0;let f=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"),A=document.createElement("button");A.type="button",A.hidden=!0,A.textContent=this.copy("picker.group.retry"),A.addEventListener("click",()=>{this.retryRecovery()}),S.append(v,A),T.appendChild(S);let _=document.createElement("div");_.className="sl-pg-live",_.setAttribute("role","status"),_.setAttribute("aria-live","polite"),i.append(o,s),f&&i.append(f),i.append(h,T,y,_),e.appendChild(i),this.root=i,this.progressHost=o,this.legendHost=h,this.paneHost=y,this.datesSummaryHost=d,this.datesCardsHost=p,this.innerHost=T,this.heldSummary=u,this.live=_,this.statusHost=S,this.statusCopy=v,this.statusAction=A,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new Ye(ji({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:(i,o)=>{try{this.options.onAnalytics?.(i,{...o,metricScope:"performance_group",performanceGroupKey:e.key,performanceCount:e.performanceCount,selectionMode:this.mode})}catch{}},hideBadge:this.options.hideBadge,theme:this.options.theme,holdTtlMs:this.options.holdTtlMs,initialHoldId:this.options.initialHoldId,restoreHold:this.options.restoreHold,confirmSelection:this.options.confirmSelection,seatView:this.options.seatView,onSelectionChange:i=>this.selectionChanged(i),onSelectionValidityChange:i=>this.selectionValidityChanged(i),onSelectionValid:this.options.onSelectionValid,onSelectionInvalid:this.options.onSelectionInvalid,onSelectionLimit:this.options.onSelectionLimit,onHoldChange:(i,o)=>this.holdChanged(i,o),onCheckout:(i,o)=>this.checkout(i,o),onHoldExpired:()=>{this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()},onError:this.options.onError},{performanceCount:e.performanceCount,selectionMode:this.mode,submissionState:()=>this.submissionState(),suppressPricing:!0,nights:()=>this.nights(),seatMarks:()=>this.seatMarks(),nightSummary:()=>this.nightSummary(),groupSelectionSummary:()=>this.groupSelectionSummary(),activePerformanceLabel:()=>this.activePerformanceLabel(),selectedPerformanceDates:()=>this.mode==="same_seat"&&e.inclusionMode==="flexible_dates"?Ns(this.includedPerformances(),e.performanceCount,this.options.locale,this.copy("picker.group.flexibleSelectedNote",{count:this.includedPerformances().length})):null,selectNight:i=>{this.switchPerformance(i)},selectionModeSwitch:this.options.allowSelectionModeSwitch&&this.mode==="same_seat"?{label:this.copy("picker.group.chooseNightByNight"),activate:()=>{this.switchSelectionMode("per_performance")}}:null,partialSeatSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),activate:(i,o)=>{this.selectPartialSeat(i,o)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:i=>this.partialSeatDates.get(i)??this.nights().map(o=>o.eventKey),label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),apply:(i,o)=>this.applySeatDates(i,o,!0)}:null}));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:Li(t,this.options.locale),time:Mi(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:Hi(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,i=!!t?.salesClosed||!!t&&t.state!=="active",o=this.mode==="same_seat"&&!i?t?.partial??{}:{},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=Hi(e,this.options.locale),i=e.name?.trim();return i&&i!==t?`${i} \xB7 ${t}`:t}nightSummary(){return this.mode!=="per_performance"?[]:(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:Hi(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),i=t.filter(s=>s>0),o=i.length===t.length&&i.every(s=>s===i[0]);return{seats:t.reduce((s,r)=>s+r,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:i.length,perPerformance:o&&i.length?i[0]:null}}syncProgress(){if(!this.progressHost)return;let e=!!this.activeHandoff,t=[{id:"performances",label:this.copy("picker.group.stepPerformances"),state:"done"},{id:"seats",label:this.copy("picker.group.stepSeats"),state:e?"done":"current"},{id:"review",label:this.copy("picker.group.stepReview"),state:this.booked?"done":e?"current":"upcoming"}];this.progressHost.innerHTML=qs(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=Bs({available:e.freeCount>0,selected:(this.picker?.getSelection().length??0)>0,partial:Object.keys(e.partial).length>0,unavailable:e.blockedCount>0},{title:this.copy("picker.group.legendTitle"),available:this.copy("picker.group.legendAvailable"),selected:this.copy("picker.group.legendSelected"),partial:this.copy("picker.group.legendNotEveryDate"),unavailable:this.copy("picker.group.legendUnavailable")},this.categoryColor())}categoryColor(){return this.picker?.categoryLegendColor()??"#2563eb"}syncPane(){let e=this.paneHost;if(!e)return;let t=this.includedPerformances();if(this.mode!=="same_seat"||!t.length){e.hidden=!0,e.replaceChildren();return}let i=this.activeHandoff?.seatLabels??this.picker?.getSelection().map(s=>s.label)??[],o=this.heldTotal();e.hidden=!1,e.innerHTML=Ks({title:this.copy("picker.group.yourSelection"),rows:t.map(s=>({eventKey:s.eventKey,name:`${Li(s,this.options.locale)} ${Mi(s,this.options.locale)}`,labels:i})),empty:this.copy("picker.group.noSeatsChosenYet"),note:o?null:this.copy("picker.group.pricesPerPerformance"),total:o?{label:this.copy("picker.group.total"),amount:o}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:Ws(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 Kp(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(i=>t.has(i.eventKey))}syncIncludedDates(){let e=this.descriptorValue;if(!e||!this.datesSummaryHost||!this.datesCardsHost)return;let t=this.includedPerformances(),i=e.inclusionMode==="flexible_dates";this.datesSummaryHost.textContent=i&&t.length<e.performanceCount?this.copy("picker.group.flexibleDatesSelected",{selected:t.length,total:e.performanceCount}):this.copy(i?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:e.performanceCount}),this.datesCardsHost.innerHTML=Tn(this.performanceCards({...e,performances:t}),this.copy(i&&t.length<e.performanceCount?"picker.group.flexibleSelectedNote":i?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.length}))}async selectPartialSeat(e,t){if(!(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)){if((this.picker?.getSelection().length??0)>0){this.announce(this.copy("picker.group.clearBeforePartial"));return}this.partialSeatDates.set(e,[...t]),await this.applySeatDates(e,t,!1)}}async applySeatDates(e,t,i){if(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)return!1;let o=this.api.includedPerformanceKeys();if(o.length===t.length&&o.every(s=>t.includes(s)))return!0;this.selectingPartialSeat=!0;try{if(this.api.setIncludedEventKeys(t),this.syncIncludedDates(),await this.picker?.refreshAvailability(),!(i?this.picker?.selectObjectsWithoutConfirmation([e])??[]:this.picker?.selectObjects([e])??[]).length)throw new Error("performance_group_partial_seat_unavailable");return this.announce(this.copy("picker.group.selectedAvailableDates",{count:t.length})),this.syncPane(),this.syncLegend(),!0}catch(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(qa(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 Y)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 i=this.options.messages?.[e];return i!==void 0?t?i.replace(/\{(\w+)\}/g,(o,s)=>String(t[s]??`{${s}}`)):i:Xp(e,t)}performanceTabs(e){let t=document.createElement("div");t.className="sl-pg-tabsbar";let i=document.createElement("button");i.type="button",i.className="sl-pg-step",i.dataset.step="previous",i.setAttribute("aria-label",this.copy("picker.group.previousPerformance")),i.textContent="\u2039",i.addEventListener("click",()=>{this.stepPerformance(-1)});let o=document.createElement("button");o.type="button",o.className="sl-pg-step",o.dataset.step="next",o.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),o.textContent="\u203A",o.addEventListener("click",()=>{this.stepPerformance(1)});let 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 d=document.createElement("span");d.className="sl-pg-tab-state",d.textContent=this.copy("picker.group.stillNeedsSeat");let p=document.createElement("span");p.className="sl-pg-tab-badge",p.textContent=this.copy("picker.group.chosenOfTotal",{chosen:0,total:this.options.numberOfPlacesToSelect??1}),l.append(c,p,d),l.addEventListener("click",()=>{this.switchPerformance(r.eventKey)}),l.addEventListener("keydown",u=>this.tabKeydown(u)),s.appendChild(l)}),t.append(i,s,o),this.tabsHost=s,this.prevButton=i,this.nextButton=o,t}tabButtons(){return[...this.tabsHost?.querySelectorAll(".sl-pg-tab")??[]]}tabKeydown(e){let t=this.tabButtons(),i=t.findIndex(a=>a===e.target);if(i<0)return;let o=getComputedStyle(this.tabsHost??document.body).direction==="rtl",s=-1;switch(e.key){case"ArrowRight":s=i+(o?-1:1);break;case"ArrowLeft":s=i+(o?1:-1);break;case"ArrowDown":s=i+1;break;case"ArrowUp":s=i-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(),i=t.findIndex(s=>s.dataset.eventKey===this.activePerformanceKey),o=t[i+e];!o||o.disabled||(o.focus({preventScroll:!0}),this.switchPerformance(o.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let o=!this.holdBlocked();return{complete:e.length,total:e.length,ready:o}}let t=this.options.numberOfPlacesToSelect,i=e.filter(o=>this.selectionsByEvent.get(o.eventKey)?.length===t&&this.validByEvent.get(o.eventKey)!==!1).length;return{complete:i,total:e.length,ready:i===e.length&&!this.holdBlocked()}}holdBlocked(){return this.operationPending||this.recovery.kind!=="idle"||!!this.availability?.salesClosed}selectionChanged(e){if(this.mode!=="per_performance"){this.options.onSelectionChange?.(e),this.syncPane(),this.syncLegend(),!e.length&&!this.activeHandoff&&!this.resettingFlexibleSelection&&!this.selectingPartialSeat&&this.descriptorValue?.inclusionMode==="flexible_dates"&&this.api.includedPerformanceKeys().length<this.descriptorValue.performanceCount&&(this.resettingFlexibleSelection=!0,this.api.setIncludedEventKeys(this.descriptorValue.performances.map(i=>i.eventKey)),this.syncIncludedDates(),this.picker?.refreshAvailability().catch(i=>this.options.onError?.(i)).finally(()=>{this.resettingFlexibleSelection=!1}));return}if(this.refreshingComposition||this.switchingPerformance||!this.activePerformanceKey)return;let t=e.map(i=>({...i}));this.selectionsByEvent.set(this.activePerformanceKey,t),this.api.setPerformanceSelections(this.activePerformanceKey,t.map(i=>({label:i.label}))),t.length!==this.options.numberOfPlacesToSelect?this.validByEvent.set(this.activePerformanceKey,!1):this.validByEvent.has(this.activePerformanceKey)||this.validByEvent.set(this.activePerformanceKey,!0),this.updateTabs(),this.options.onSelectionChange?.(e),this.refreshComposition(),this.syncLegend()}selectionValidityChanged(e){if(this.mode==="per_performance"&&!this.switchingPerformance&&this.activePerformanceKey){let t=this.validByEvent.get(this.activePerformanceKey);this.validByEvent.set(this.activePerformanceKey,e.isValid),this.updateTabs(),!this.refreshingComposition&&t!==e.isValid&&this.refreshComposition()}this.options.onSelectionValidityChange?.(e)}refreshComposition(){if(this.refreshingComposition||!this.picker)return;let e=this.submissionState();this.refreshingComposition=!0;try{this.picker.refreshPerformanceGroupComposition();let t=this.submissionState();(e.complete!==t.complete||e.ready!==t.ready)&&this.picker.refreshPerformanceGroupComposition()}finally{this.refreshingComposition=!1}}tabState(e){let t=this.options.numberOfPlacesToSelect??1,i=(this.selectionsByEvent.get(e)??[]).map(s=>s.label),o=this.copy("picker.group.chosenOfTotal",{chosen:i.length,total:t});return i.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:o}:i.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:i.join(", ")}),badge:o}:i.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:o}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-i.length}),badge:o}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(o=>{let 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 d=o.querySelector(".sl-pg-tab-name")?.textContent??s;o.setAttribute("aria-label",`${d}: ${r.badge} \xB7 ${r.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",o.id)});let i=e.findIndex(o=>o.dataset.eventKey===this.activePerformanceKey);this.prevButton&&(this.prevButton.disabled=t||i<=0),this.nextButton&&(this.nextButton.disabled=t||i<0||i>=e.length-1)}async switchPerformance(e){if(this.mode!=="per_performance"||this.switchingPerformance||this.holdBlocked()||this.activeHandoff||e===this.activePerformanceKey||!this.picker)return;this.activePerformanceKey&&this.selectionChanged(this.picker.getSelection());let t=this.selectionsByEvent.get(e)?.map(i=>i.label)??[];this.switchingPerformance=!0,this.activePerformanceKey=e,this.updateTabs(),this.setInteractionLocked(!0);try{this.picker.clearSelection(),this.api.setActivePerformance(e),await this.picker.refreshAvailability();let i=this.picker.selectObjects(t);this.switchingPerformance=!1,this.selectionChanged(i),i.length!==t.length&&this.validByEvent.set(e,!1),this.options.onSelectionChange?.(i);let o=this.descriptorValue?.performances.find(s=>s.eventKey===e);o&&this.announce(this.copy("picker.group.performanceOpened",{performance:o.name}))}catch(i){this.options.onError?.(i)}finally{this.switchingPerformance=!1,!this.operationPending&&this.recovery.kind==="idle"&&this.setInteractionLocked(!1),this.updateTabs(),this.picker.refreshPerformanceGroupComposition()}}setInteractionLocked(e){let t=this.innerHost;t&&(t.dataset.locked=String(e),t.setAttribute("aria-busy",String(e)),t.setAttribute("aria-disabled",String(e)))}announce(e){this.live&&(this.live.textContent=e)}showStatus(e,t,i={}){this.statusHost&&this.statusCopy&&this.statusAction&&(this.statusCopy.textContent=t,this.statusHost.hidden=!t,this.statusAction.hidden=!i.retry),this.announce(t),this.options.onStatusChange?.({kind:e,message:t,...i.reference?{reference:i.reference}:{}})}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 Y)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 Y)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 Y)return;this.options.onError?.(t)}}handoff(e,t){let i=this.descriptorValue,o=this.api.operationIdForHold(e.holdId);if(!i||!o)throw new Error("seatlayer: Performance Group hold identity is unavailable");let s=this.api.allocationsForHold(e.holdId);return{operationId:o,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:i,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 i=this.descriptorValue?.performances.find(r=>r.eventKey===t.eventKey),o=document.createElement("p"),s=document.createElement("strong");s.textContent=i?.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 i=this.handoff(e,t),o=this.activeHandoff?.holdId!==i.holdId;this.activeHandoff=i,this.renderHeldAllocations(this.api.allocationsForHold(e.holdId)),this.updateTabs(),this.api.watchSettlement(e.holdId),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),o&&this.options.onHold?.(i),this.options.onHoldChange?.(i)}checkout(e,t){let i=this.handoff(e,t);this.continued=!0,this.activeHandoff=i,this.options.onCheckout?.(i)}};import{formatMoney as Ja,fromMinorUnits as el}from"@seatlayer/core";var Ka="seatlayer-season-picker-style";function Wa(){if(document.getElementById(Ka))return;let n=document.createElement("style");n.id=Ka,n.textContent=`
3251
3264
  .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)}
3252
3265
  .sl-season-root *{box-sizing:border-box}.sl-season-root button,.sl-season-root summary{font:inherit}
3253
3266
  .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}
@@ -3263,4 +3276,4 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3263
3276
  .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}
3264
3277
  @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}}
3265
3278
  @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}}
3266
- `,document.head.appendChild(n)}var Wp=new Set(["audience_not_public","sales_not_open","origin_not_allowed"]),Yp=3e4;function Xp(n,e){if(!n||typeof n!="object"||Array.isArray(n))return!1;let t=n;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.seasonKey===e&&Array.isArray(t.planActivationIds)&&t.planActivationIds.every(i=>typeof i=="string"&&!!i)}var Gi=class extends Error{constructor(t,i){super(`season_public_session_refused:${t}`);this.reason=t;this.status=i;this.name="SeasonPublicSessionRefused"}},Ae,Ne,zt,yt,Fn=class{constructor(e){this.options=e;M(this,Ae,null);M(this,Ne,null);M(this,zt);M(this,yt);k(this,zt,e.fetch??globalThis.fetch.bind(globalThis)),k(this,yt,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return u(this,Ae)}async mint(e=!1){if(e&&k(this,Ae,null),u(this,Ae)&&u(this,Ae).expiresAt-Yp>Date.now())return u(this,Ae);if(u(this,Ne))return u(this,Ne);let t=(async()=>{let i=await u(this,zt).call(this,`${this.options.base}/pub/seasons/${encodeURIComponent(this.options.season)}/sessions`,{method:"POST",body:JSON.stringify(u(this,yt)?{origin:u(this,yt)}:{}),credentials:"omit"}),o=await i.json().catch(()=>null);if(!i.ok){let s=o?.code??o?.error;if(i.status===403&&s&&Wp.has(s)){let r=s;throw this.options.onRefused?.({reason:r,code:s,status:i.status,retryable:r==="sales_not_open"}),new Gi(r,i.status)}throw new Error(`season_public_session_failed_${i.status}`)}if(!Xp(o,this.options.season))throw new Error("season_public_session_invalid");return k(this,Ae,o),o})();k(this,Ne,t);try{return await t}finally{u(this,Ne)===t&&k(this,Ne,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",i=await this.mint(t);return{token:i.token,expiresAt:i.expiresAt}}};Ae=new WeakMap,Ne=new WeakMap,zt=new WeakMap,yt=new WeakMap;function Ua(n){let e=new Fn(n);return{access:new ae({provider:({reason:i})=>e.token(i),...n.accessHooks}),loader:e}}var Zp="https://api.seatlayer.io",Qp=6e4,Jp=5e3,B=class extends Error{constructor(t,i){super(`season_request_failed:${t}`);this.code=t;this.status=i;this.name="SeasonApiError"}},Ui=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}};function eh(n,e){let t=Number(n.headers.get("Retry-After")),i=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(Jp,i*1e3))}function th(n,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,i)=>{let o=setTimeout(t,n);e?.addEventListener("abort",()=>{clearTimeout(o),i(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function qa(n){if(!n||typeof n!="object")return"unknown";let e=n;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}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 Vn(n){return Array.isArray(n)?n.some(Vn):!n||typeof n!="object"?!1:Object.entries(n).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&ih.test(t)||Vn(t))}function $t(n,e,t="invalid_operation_response"){if(!n||typeof n!="object"||Array.isArray(n))throw new B(t,502);if(Vn(n))throw new B("unsafe_operation_response",502);let i=n,o=i.allocations,s=new Set,r=Array.isArray(o)&&o.length>0&&o.every(d=>{if(!d||typeof d!="object")return!1;let m=d.eventId,p=d.state;return typeof m!="string"||!m||typeof p!="string"||!sh.has(p)||s.has(m)?!1:(s.add(m),!0)}),a=i.bookingRef===null||typeof i.bookingRef=="string"&&i.bookingRef.length>0,l=i.state!=="booked"||typeof i.bookingRef=="string"&&r&&o.every(d=>d.state==="booked"),c=i.state!=="booking_pending"||typeof i.bookingRef=="string"&&r&&o.some(d=>d.state!=="booked"),h=i.state!=="committed"||i.bookingRef===null;if(i.operationId!==e.operationId||i.seasonId!==e.seasonId||i.kind!=="HOLD"||typeof i.holdId!="string"||!nh.test(i.holdId)||i.policy!=="fixed_inclusion_same_seat"||typeof i.state!="string"||!oh.has(i.state)||typeof i.expiresAt!="number"||!Number.isFinite(i.expiresAt)||i.expiresAt<0||!a||typeof i.location!="string"||!i.location||typeof i.retryAfterSeconds!="number"||!Number.isFinite(i.retryAfterSeconds)||i.retryAfterSeconds<0||!r||!l||!c||!h||i.pricingAuthority!==void 0&&i.pricingAuthority!=="host"||i.authoritativeAmountIncluded!==void 0&&i.authoritativeAmountIncluded!==!1)throw new B(t,502);return{operationId:i.operationId,seasonId:i.seasonId,kind:i.kind,holdId:i.holdId,expiresAt:i.expiresAt,policy:i.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:i.state,bookingRef:i.bookingRef,location:i.location,retryAfterSeconds:i.retryAfterSeconds,allocations:o.map(d=>({eventId:d.eventId,state:d.state}))}}function rh(n,e,t){if(!Array.isArray(n)||n.length!==t||n.some(r=>typeof r!="string"||!r)||new Set(n).size!==n.length||!Array.isArray(e)||e.length!==n.length)throw new B("invalid_best_available_response",502);let i=n,o=new Set(i),s=new Map;for(let r of e){if(!r||typeof r!="object")throw new B("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 B("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:i,items:i.map(r=>s.get(r))}}function ah(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n;if(typeof e.currency!="string"||!e.currency||!Array.isArray(e.packages))return null;let t=[];for(let i of e.packages){if(!i||typeof i!="object")continue;let o=i;if(typeof o.planKey!="string"||!o.planKey||!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(n){if(!n||typeof n!="object"||Array.isArray(n))throw new B("invalid_checkout_response",502);let e=n,t=typeof e.redirectUrl=="string"&&!!e.redirectUrl,i=!!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===i)throw new B("invalid_checkout_response",502);return{orderId:e.orderId,totalMinor:e.totalMinor,currency:e.currency,expiresAt:e.expiresAt,...t?{redirectUrl:e.redirectUrl}:{},...i?{clientPayload:e.clientPayload}:{}}}function Ka(n,e){return{seasonKey:n.key,planActivationId:n.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:e.state,allocations:e.allocations.map(({eventId:t,state:i})=>({eventKey:t,state:i}))}}var fe,We,ve,Ye,jt,we,xe,ee,pe,Wa,qi=class{constructor(e,t){M(this,ee);M(this,fe);M(this,We);M(this,ve);M(this,Ye);M(this,jt);M(this,we,!1);M(this,xe,null);k(this,fe,e),k(this,We,(t.apiBase??Zp).replace(/\/$/,"")),k(this,ve,t.access),k(this,Ye,t.fetch??globalThis.fetch.bind(globalThis)),k(this,jt,t.recoveryTimeoutMs??Qp),u(this,ve).onRenewed(i=>x(this,ee,Wa).call(this,i))}async descriptor(){let{body:e}=await x(this,ee,pe).call(this,"GET","");return e.season}async chart(){let{body:e}=await x(this,ee,pe).call(this,"GET","/chart");return e}async availability(){let{body:e}=await x(this,ee,pe).call(this,"GET","/availability"),t=Object.values(e.seats??{});return{...e,freeCount:t.filter(i=>i==="free").length,blockedCount:t.filter(i=>i!=="free").length}}async hold(e,t){let{body:i,response:o}=await x(this,ee,pe).call(this,"POST","/holds",{operationId:t,labels:[...e]});return{operation:$t(i.operation,{seasonId:u(this,fe),operationId:t}),response:o}}async bestAvailable(e){let{body:t,response:i}=await x(this,ee,pe).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=$t(t.operation,{seasonId:u(this,fe),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:i}}async operation(e){let{body:t,response:i}=await x(this,ee,pe).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:$t(t.operation,{seasonId:u(this,fe),operationId:e}),response:i}}async release(e,t){let{body:i,response:o}=await x(this,ee,pe).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:$t(i.operation,{seasonId:u(this,fe),operationId:e}),response:o}}async prices(){let e;try{({body:e}=await x(this,ee,pe).call(this,"GET","/prices"))}catch(t){if(t instanceof B&&t.status===404)return null;throw t}return ah(e)}async checkout(e){let{body:t}=await x(this,ee,pe).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 u(this,Ye).call(this,`${u(this,We)}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit"}),i=await t.json().catch(()=>null);if(!t.ok)throw new B(qa(i),t.status);if(i===null)throw new B("invalid_json_response",502);return i}async renewalIntent(e){let{body:t}=await x(this,ee,pe).call(this,"POST","/renewal-intents",{offerId:e}),i=t.intent;if(!i||i.offerId!==e||i.state!=="intent_received"||!i.intentId||!Number.isFinite(i.receivedAt))throw new B("invalid_renewal_intent_response",502);return i}async waitForTerminal(e,t,i){let o=Date.now(),s=t?{operation:$t(t.operation,{seasonId:u(this,fe),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>=u(this,jt))throw new Ui(e);await th(eh(s.response,s.operation),i),s=await this.operation(e)}return s.operation}destroy(){u(this,we)||(k(this,we,!0),u(this,ve).onRenewed(void 0),u(this,ve).clear())}};fe=new WeakMap,We=new WeakMap,ve=new WeakMap,Ye=new WeakMap,jt=new WeakMap,we=new WeakMap,xe=new WeakMap,ee=new WeakSet,pe=async function(e,t,i,o=!0){if(u(this,we))throw new B("season_api_destroyed",409);if(u(this,xe))throw u(this,xe);let s=await u(this,ve).authorization();if(u(this,we))throw new B("season_api_destroyed",409);if(u(this,xe))throw u(this,xe);if(!s)throw new se({reason:"no_token",retryable:!1});let r=await u(this,Ye).call(this,`${u(this,We)}/pub/seasons/${encodeURIComponent(u(this,fe))}${t}`,{method:e,headers:{Authorization:s,...i===void 0?{}:{"Content-Type":"application/json"}},body:i===void 0?void 0:JSON.stringify(i)}),a=await r.json().catch(()=>null);if(!r.ok){let l=qa(a);if(o&&await u(this,ve).handleFailure(r.status,l))return x(this,ee,pe).call(this,e,t,i,!1);let c=u(this,ve).unavailable;throw c?new se(c):new B(l,r.status)}if(a===null)throw new B("invalid_json_response",502);return{body:a,response:r}},Wa=async function(e){if(u(this,we))return;let t=`/pub/seasons/${encodeURIComponent(u(this,fe))}/session/adopt`;for(let i=0;i<2;i++){if(u(this,we))return;try{if((await u(this,Ye).call(this,`${u(this,We)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){k(this,xe,null);return}}catch{}}if(!u(this,we))throw k(this,xe,new B("season_session_adopt_failed",409)),u(this,xe)};var ch=2500;function dh(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}function ph(n,e,t){if(n.startsAt==null)return{date:"Date to be announced",time:null};try{let i=new Date(n.startsAt),o=e?{timeZone:e}:{};return{date:new Intl.DateTimeFormat(t,{dateStyle:"medium",...o}).format(i),time:new Intl.DateTimeFormat(t,{timeStyle:"short",...o}).format(i)}}catch{return{date:"Date to be announced",time:null}}}function Za(n){return n.state==="committed"||n.state==="booked"}var zn=class{constructor(e,t,i){this.transport=e;this.sink=t;this.intervalMs=i;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(([i,o])=>this.prior[i]!==o).map(([i,o])=>({label:i,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))}}},$n=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 B("season_best_available_in_progress",409);let i={operationId:e,...t.accessibility?.length?{accessibility:[...t.accessibility]}:{},...t.requireContiguous===!0?{requireContiguous:!0}:{}};return this.nextBestAvailable=i,i}clearBestAvailable(e){this.nextBestAvailable===e&&(this.nextBestAvailable=null)}queueRelease(e){this.nextReleaseActionId=e}operationForHold(e){return this.operationByHold.get(e)??null}remember(e){this.operationByHold.set(e.holdId,e)}forget(e){this.operationByHold.delete(e)}async chart(e){let[t,i]=await Promise.all([this.descriptorValue?Promise.resolve(this.descriptorValue):this.api.descriptor(),this.api.chart()]);this.descriptorValue=t;for(let o of i.categories??[])typeof o?.key=="string"&&typeof o.label=="string"&&this.categoryLabels.set(o.key,o.label);return{doc:i,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,i,o){if(o)throw new B("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(!Za(a))throw new B(`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,i){let o=this.operationForHold(i);if(!o)throw new B("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 B("season_operation_partial_terminal",409);this.forget(i)}async bestAvailable(e,t,i,o){let s=this.nextBestAvailable;this.nextBestAvailable=null;let r=s?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:r,qty:t,...i?{categoryKey:i}:{},...o?{zoneId:o}:{},...s?.accessibility?.length?{accessibility:s.accessibility}:{},...s?.requireContiguous===!0?{requireContiguous:!0}:{}}),l=await this.api.waitForTerminal(r,a);if(!Za(l))throw new B(`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??i??"",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 zn(this,t,this.realtimePollMs)}},H,Qe,wt,re,X,Ut,Z,Le,q,te,ge,xt,De,Me,Je,he,qt,Se,St,kt,et,Tt,Be,tt,it,Et,w,Qa,Ja,Gn,Un,qn,Kn,Ki,Xe,el,tl,Pe,Gt,il,nl,Wn,Yn,ol,sl,rl,Xn,Zn,U,Ze,Qn,vt,jn=class{constructor(e){M(this,w);M(this,H);M(this,Qe);M(this,wt);M(this,re);M(this,X);M(this,Ut,new AbortController);M(this,Z,null);M(this,Le,null);M(this,q,null);M(this,te,null);M(this,ge,null);M(this,xt,null);M(this,De,null);M(this,Me,null);M(this,Je,null);M(this,he,[]);M(this,qt,new Map);M(this,Se,!1);M(this,St,!1);M(this,kt);M(this,et,null);M(this,Tt,null);M(this,Be,null);M(this,tt,"handoff");M(this,it,null);M(this,Et,!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,H,e),k(this,Qe,dh(e.container));let t={onExpired:o=>e.onAccessExpired?.(o),onUnavailable:o=>{let s=u(this,et)&&o.reason==="provider_failed"?u(this,et):o;k(this,et,null),k(this,Tt,s.reason==="provider_failed"?null:s),e.onAccessUnavailable?.(s),x(this,w,ol).call(this,s)}};if(!e.buyerAccessToken&&!e.buyerAccessTokenProvider){let{access:o,loader:s}=Ua({base:(e.apiBase??"https://api.seatlayer.io").replace(/\/$/,""),season:e.season,fetch:e.fetch,onRefused:r=>{k(this,et,r)},accessHooks:t});k(this,wt,o),k(this,kt,s)}else k(this,kt,null),k(this,wt,new ae({token:e.buyerAccessToken,provider:e.buyerAccessTokenProvider,...t}));k(this,re,new qi(e.season,{apiBase:e.apiBase,access:u(this,wt),fetch:e.fetch,recoveryTimeoutMs:e.recoveryTimeoutMs})),k(this,X,new $n(u(this,re),Math.max(750,e.realtimePollMs??ch)))}async render(){x(this,w,Qn).call(this),Ga(),x(this,w,Ja).call(this),x(this,w,U).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{let[e,t,i]=await Promise.all([u(this,re).descriptor(),u(this,re).availability(),u(this,re).prices().catch(()=>null)]);return u(this,Se)?this:(k(this,Z,e),k(this,Le,t),k(this,Be,i),k(this,tt,u(this,H).checkout==="hosted"&&e.checkoutMode!=="server"&&i?"hosted":"handoff"),u(this,X).prime(e,t),x(this,w,Gn).call(this),await x(this,w,Qa).call(this,e),u(this,Se)?this:(i&&x(this,w,Gn).call(this),x(this,w,rl).call(this),x(this,w,U).call(this,{kind:"ready",message:`${t.freeCount} seat${t.freeCount===1?"":"s"} available for every included performance.`}),u(this,H).initialOperationId&&await this.restoreOperation(u(this,H).initialOperationId),this))}catch(e){if(u(this,Se))return this;throw x(this,w,Ze).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(u(this,X).queueOperation(t),u(this,te).selectObjectsWithoutConfirmation([...e]),x(this,w,U).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await u(this,te).handleCta(),!u(this,q))throw new B("season_hold_not_created",409);return u(this,q)}async holdBestAvailable(e,t,i={}){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=u(this,te).maxTickets;if(e>o)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${o})`);if(u(this,St))throw new B("season_best_available_in_progress",409);k(this,St,!0);let s=null;try{if(s=u(this,X).queueBestAvailable(t,i),x(this,w,U).call(this,{kind:"pending",message:`Finding ${e} Season seat${e===1?"":"s"} available for every performance.`,operationId:t},!0),!await u(this,te).bestAvailableOrThrow(e,i.categoryKey,{zoneId:i.zoneId})||!u(this,q))throw new B("season_hold_not_created",409);return u(this,q)}catch(r){throw x(this,w,Ze).call(this,r,t)}finally{s&&u(this,X).clearBestAvailable(s),k(this,St,!1)}}async restoreOperation(e){x(this,w,vt).call(this),x(this,w,U).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await u(this,re).waitForTerminal(e,void 0,u(this,Ut).signal);return t.state==="aborted"||t.state==="expired"?(k(this,q,null),u(this,H).onHoldChange?.(null),x(this,w,U).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(u(this,X).remember(t),x(this,w,Kn).call(this,t,!1))}catch(t){throw x(this,w,Ze).call(this,t,e)}}async release(e){x(this,w,vt).call(this);let t=u(this,q);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");u(this,X).queueRelease(e),x(this,w,U).call(this,{kind:"pending",message:"Releasing the Season seats.",operationId:t.operationId},!0);try{u(this,te)?.getCurrentHold()?.holdId===t.holdId?await u(this,te).release():(await u(this,X).release("",[],t.holdId),x(this,w,Ki).call(this)),x(this,w,U).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(i){throw x(this,w,Ze).call(this,i,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,U).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await u(this,re).renewalIntent(e);return x(this,w,U).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),u(this,H).onRenewalIntent?.(t),t}catch(t){throw x(this,w,Ze).call(this,t)}}getDescriptor(){return u(this,Z)}getAvailability(){return u(this,Le)}getHandoff(){return u(this,q)}destroy(){u(this,Se)||(k(this,Se,!0),u(this,Ut).abort(),x(this,w,Zn).call(this),u(this,te)?.destroy(),u(this,re).destroy(),u(this,Qe).replaceChildren(),k(this,ge,null),k(this,xt,null),k(this,De,null),k(this,Me,null),k(this,Je,null),k(this,Z,null),k(this,Le,null),k(this,q,null))}};H=new WeakMap,Qe=new WeakMap,wt=new WeakMap,re=new WeakMap,X=new WeakMap,Ut=new WeakMap,Z=new WeakMap,Le=new WeakMap,q=new WeakMap,te=new WeakMap,ge=new WeakMap,xt=new WeakMap,De=new WeakMap,Me=new WeakMap,Je=new WeakMap,he=new WeakMap,qt=new WeakMap,Se=new WeakMap,St=new WeakMap,kt=new WeakMap,et=new WeakMap,Tt=new WeakMap,Be=new WeakMap,tt=new WeakMap,it=new WeakMap,Et=new WeakMap,w=new WeakSet,Qa=async function(e){let t=new Ke(Vi({container:u(this,xt),event:e.key,apiBase:u(this,H).apiBase,transport:u(this,X),hideEventDetails:!0,maxSelection:u(this,H).maxSelection,selectedObjects:u(this,H).selectedObjects,selectableObjects:u(this,H).selectableObjects,numberOfPlacesToSelect:u(this,H).numberOfPlacesToSelect,selectionValidators:u(this,H).selectionValidators,locale:u(this,H).locale,messages:u(this,H).messages,languages:u(this,H).languages,colorblindSafe:u(this,H).colorblindSafe,initialView:u(this,H).initialView,enable3D:u(this,H).enable3D,max3DSeats:u(this,H).max3DSeats,hideBadge:u(this,H).hideBadge,theme:u(this,H).theme,confirmSelection:u(this,H).confirmSelection,seatView:u(this,H).seatView,onBuyerViewChange:u(this,H).onBuyerViewChange,onAnalytics:(i,o)=>{try{u(this,H).onAnalytics?.(i,{...o,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:e.occurrenceCount})}catch{}},onSelectionChange:i=>{k(this,he,i.map(o=>o.label)),k(this,qt,new Map(i.filter(o=>!!o.categoryKey).map(o=>[o.label,o.categoryKey]))),x(this,w,Xe).call(this),u(this,H).onSelectionChange?.(i)},onSelectionValidityChange:u(this,H).onSelectionValidityChange,onHoldChange:i=>{if(!i){x(this,w,Ki).call(this);return}let o=u(this,X).operationForHold(i.holdId);o&&x(this,w,Kn).call(this,o,!0)},onCheckout:()=>{u(this,q)&&(x(this,w,Pe).call(this,"checkout"),u(this,H).onContinue?.(u(this,q)),u(this,tt)==="hosted"&&x(this,w,sl).call(this,u(this,q)))},onHoldExpired:()=>{x(this,w,Ki).call(this),x(this,w,U).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),u(this,H).onHoldExpired?.()},onError:i=>x(this,w,Ze).call(this,i)},{surface:"season",performanceCount:e.occurrenceCount,selectionMode:"same_seat",suppressPricing:!0,groupSelectionSummary:()=>{let i=u(this,he).length;return i?{seats:i,performances:e.occurrenceCount,performancesChosen:e.occurrenceCount,perPerformance:i}:null}}));k(this,te,t),await t.render()},Ja=function(){u(this,Qe).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 i=document.createElement("ol");i.className="sl-season-progress",i.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),i.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 m=document.createElement("p");m.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,m,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,i,o,f),u(this,Qe).append(e),k(this,ge,e),k(this,xt,s),k(this,De,f),k(this,Me,l),k(this,Je,m)},Gn=function(){let e=u(this,Z),t=u(this,H).offer,i=u(this,ge).querySelector(".sl-season-hero");i.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),i.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,Gt).call(this);if(d){h.textContent=b("season.packagePriceLabel","Package price"),c.append(h,x(this,w,nl).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),i.append(c),x(this,w,Un).call(this,i,t),x(this,w,qn).call(this,i,e),x(this,w,Xe).call(this);return}h.textContent=t?.priceLabel?"Season package":"Package price";let m=document.createElement(t?.priceLabel?"strong":"span");if(m.className=t?.priceLabel?"sl-season-price":"sl-season-price-note",m.textContent=t?.priceLabel??"Confirmed by your ticketing platform at checkout",c.append(h,m),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)}i.append(c),x(this,w,Un).call(this,i,t),x(this,w,qn).call(this,i,e),x(this,w,Xe).call(this)},Un=function(e,t){if(!t?.benefits?.length)return;let i=document.createElement("ul");i.className="sl-season-benefits";for(let o of t.benefits.slice(0,6)){let s=document.createElement("li");s.textContent=o,i.append(s)}e.append(i)},qn=function(e,t){let i=document.createElement("details");i.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,u(this,H).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)}i.append(o,s),e.append(i)},Kn=function(e,t){if(e.state==="booked")return k(this,q,null),u(this,X).forget(e.holdId),u(this,te)?.notifyGroupSettled("booked"),x(this,w,Pe).call(this,"complete"),x(this,w,U).call(this,{kind:"booked",message:`Your Season booking is complete for all ${u(this,Z).occurrenceCount} performances. No further checkout action is needed.`,operationId:e.operationId}),u(this,H).onHoldChange?.(null),null;if(e.state==="partial_terminal")return k(this,q,null),k(this,he,[]),u(this,X).forget(e.holdId),u(this,te)?.notifyGroupSettled("lost"),x(this,w,Xe).call(this),x(this,w,Pe).call(this,"review"),x(this,w,U).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),u(this,H).onHoldChange?.(null),null;if(e.state!=="committed")return k(this,q,null),u(this,X).forget(e.holdId),u(this,te)?.notifyGroupSettled("lost"),x(this,w,U).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),u(this,H).onHoldChange?.(null),null;let i=Ka(u(this,Z),e),o=u(this,q)?.holdId!==i.holdId;return k(this,q,i),x(this,w,Xe).call(this),x(this,w,Pe).call(this,"review"),u(this,H).onHoldChange?.(i),x(this,w,U).call(this,{kind:"held",message:`Your seats are held for all ${u(this,Z).occurrenceCount} performances. Review and continue to checkout.`,operationId:e.operationId}),o&&t&&u(this,H).onHold?.(i),i},Ki=function(){k(this,q,null),k(this,he,[]),x(this,w,Xe).call(this),x(this,w,Pe).call(this,"choose"),u(this,H).onHoldChange?.(null)},Xe=function(){if(!u(this,Me))return;let e=u(this,he).length;if(!e)u(this,Me).textContent="Choose a seat on the map. Unavailable seats are already booked on at least one included performance.";else{u(this,Me).replaceChildren();let t=document.createElement("strong");t.textContent=u(this,he).join(", "),u(this,Me).append(t,` \xB7 ${e} Season seat${e===1?"":"s"} across all ${u(this,Z)?.occurrenceCount??0} performances`)}u(this,Je)&&u(this,Le)&&(u(this,Je).textContent=`${u(this,Le).freeCount} seat${u(this,Le).freeCount===1?"":"s"} currently available for the complete Season`),x(this,w,el).call(this),x(this,w,tl).call(this)},el=function(){let e=u(this,ge)?.querySelector(".sl-season-summary-card");if(!e)return;e.querySelector(".sl-season-package-total")?.remove();let t=x(this,w,Wn).call(this);if(t==null)return;let i=u(this,Be)?.currency??u(this,Z)?.currency??"USD",o=u(this,Z)?.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,Yn).call(this,t,i);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)},tl=function(){let e=u(this,ge)?.querySelector(".sl-season-checkout-note");if(e){if(u(this,tt)==="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,Gt).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."}},Pe=function(e){let t=e==="choose"?0:e==="review"?1:e==="checkout"?2:3;u(this,ge)?.querySelectorAll(".sl-season-progress li").forEach((i,o)=>{i.dataset.state=o<t?"done":o===t?"current":"upcoming";let s=i.querySelector("span");s&&(s.textContent=o<t?"\u2713":String(o+1))})},Gt=function(){let e=u(this,Be)?.packages;if(!e?.length)return null;let t=u(this,Z)?.planActivationId,i=e.find(r=>r.planKey===t);if(i)return i;let o=u(this,kt)?.session?.planActivationIds;return(o?.length?e.filter(r=>o.includes(r.planKey)):[])[0]??e[0]},il=function(e){let t=x(this,w,Gt).call(this)?.prices.find(i=>i.categoryKey===e);return t?t.unitPrice:null},nl=function(e,t){let i=document.createElement("ul");i.className="sl-season-price-lines";let o=u(this,Be)?.currency??u(this,Z)?.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=u(this,X).categoryLabel(s.categoryKey);let l=document.createElement("strong");l.className="sl-season-price",l.textContent=x(this,w,Yn).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),i.append(r)}return i},Wn=function(){if(!u(this,he).length||!x(this,w,Gt).call(this))return null;let e=0;for(let t of u(this,he)){let i=u(this,qt).get(t),o=i?x(this,w,il).call(this,i):null;if(o==null)return null;e+=o}return e},Yn=function(e,t){let i=Xa(e,t),o=Number.isInteger(i);return Ya(i,t,{locale:u(this,H).locale,fallback:(s,r)=>`${s} ${r}`,...o?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})},ol=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,U).call(this,{kind:"failed",message:t})},sl=async function(e){if(!u(this,Et)){k(this,Et,!0);try{let t=u(this,Be)?.currency??u(this,Z)?.currency??"USD",i=x(this,w,Wn).call(this);if(i==null){x(this,w,U).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,Xn).call(this,{kind:"pay",provider:null,order:{holdId:e.operationId,expiresAt:e.expiresAt,currency:t,total:Xa(i,t),labels:[...u(this,he)]}})}finally{k(this,Et,!1)}}},rl=function(){if(u(this,tt)!=="hosted")return;let e=zi(u(this,H).season);e?.outcome!=="success"||!e.orderId||(x(this,w,Pe).call(this,"checkout"),x(this,w,Xn).call(this,{kind:"resume",orderId:e.orderId}))},Xn=async function(e){let t;try{({mountCheckout:t}=await ei())}catch(o){u(this,H).onError?.(o),x(this,w,U).call(this,{kind:"failed",message:b("season.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held \u2014 please try again.")});return}let i=u(this,te)?.root;u(this,Se)||!i||(x(this,w,Zn).call(this),k(this,it,t({root:i,state:e,eventKey:u(this,H).season,formatMoney:(o,s)=>Ya(o,s,{locale:u(this,H).locale,fallback:(r,a)=>`${r} ${a}`,...Number.isInteger(o)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:o=>u(this,re).checkout({operationId:o.holdId,buyerEmail:o.buyerEmail,...o.buyerName?{buyerName:o.buyerName}:{},...u(this,H).returnUrl?{returnUrl:u(this,H).returnUrl}:{}}),orderStatus:o=>u(this,re).orderStatus(o),onCancel:()=>{k(this,it,null),u(this,q)&&x(this,w,Pe).call(this,"review")},onConfirmed:o=>{u(this,H).onOrderConfirmed?.(o),x(this,w,Pe).call(this,"complete"),x(this,w,U).call(this,{kind:"booked",message:b("season.orderConfirmed","Your season tickets are confirmed for every included performance.")})},onError:o=>u(this,H).onError?.(o)})))},Zn=function(){u(this,it)?.destroy(),k(this,it,null)},U=function(e,t=!1){u(this,De)&&(u(this,De).textContent=e.message,u(this,De).dataset.kind=e.kind),u(this,ge)&&(u(this,ge).dataset.busy=String(t)),u(this,H).onStatusChange?.(e)},Ze=function(e,t){let i=e instanceof se&&e.reason==="provider_failed"&&u(this,Tt)?new se(u(this,Tt)):e;if(i instanceof se)return u(this,H).onError?.(i),i;let o=i instanceof B?`Season selection unavailable (${i.code}).`:"Season selection could not be completed.";return x(this,w,U).call(this,{kind:"failed",message:o,operationId:t}),u(this,H).onError?.(i),i},Qn=function(){if(u(this,Se))throw new Error("seatlayer: SeasonPicker was destroyed")},vt=function(){if(x(this,w,Qn).call(this),!u(this,Z)||!u(this,te))throw new Error("seatlayer: render SeasonPicker before using it")};function hh(n,e={}){let t=e.origin??"";if(!t)try{t=new URL(n.src,window.location.href).origin}catch{t=""}let i=!1,o=null,s=null,r=null,a="",l=null,c="",h=()=>{if(i)return;i=!0,o=n.getAttribute("style"),Object.assign(n.style,{position:"fixed",inset:"0",margin:"0",border:"0",zIndex:"2147483000",background:c||"transparent"}),n.style.width="100vw",n.style.height="100vh",n.style.width="100dvw",n.style.height="100dvh";let 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=()=>{i&&(i=!1,o===null?n.removeAttribute("style"):n.setAttribute("style",o),o=null,a&&(n.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))},m=p=>{if(p.source!==n.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`,i||(n.style.height=a));return}f.type==="seatlayer:fullscreen"&&(typeof f.background=="string"&&/^[#a-zA-Z0-9(),.%\s-]{1,64}$/.test(f.background)&&(c=f.background,i&&(n.style.background=c)),f.on===!0?h():f.on===!1&&d())};return window.addEventListener("message",m),()=>{window.removeEventListener("message",m),d()}}export{V as ApiError,ae as BuyerAccessContext,se as BuyerAccessUnavailableError,ke as BuyerRealtimeClient,fn as EmbeddedDesigner,Y as PerformanceGroupDestroyedError,Bn as PerformanceGroupPicker,bs as SEATING_CHART_CALLBACK_PROPS,ms as SEATING_CHART_HANDLE_METHODS,fs as SEATING_CHART_IDENTITY_PROPS,gs as SEATING_CHART_VALUE_PROPS,B as SeasonApiError,jn as SeasonPicker,Gi as SeasonPublicSessionRefused,Ui as SeasonRecoveryTimeoutError,Ke as SeatPicker,un as SeatingChart,hh as attachPickerFrame,Ic as bindSeatingChartHandle,Oc as buildSeatingChartOptions,It as createBuyerAccessContext,Ct as createControllerSink,bn as parseTicketOfferAvailability,Vt as shortOperationReference,yn as ticketOfferPrices};
3279
+ `,document.head.appendChild(n)}var Qp=new Set(["audience_not_public","sales_not_open","origin_not_allowed"]),Jp=3e4;function eh(n,e){if(!n||typeof n!="object"||Array.isArray(n))return!1;let t=n;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.seasonKey===e&&Array.isArray(t.planActivationIds)&&t.planActivationIds.every(i=>typeof i=="string"&&!!i)}var Ki=class extends Error{constructor(t,i){super(`season_public_session_refused:${t}`);this.reason=t;this.status=i;this.name="SeasonPublicSessionRefused"}},Pe,De,Gt,wt,$n=class{constructor(e){this.options=e;P(this,Pe,null);P(this,De,null);P(this,Gt);P(this,wt);k(this,Gt,e.fetch??globalThis.fetch.bind(globalThis)),k(this,wt,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return m(this,Pe)}async mint(e=!1){if(e&&k(this,Pe,null),m(this,Pe)&&m(this,Pe).expiresAt-Jp>Date.now())return m(this,Pe);if(m(this,De))return m(this,De);let t=(async()=>{let i=await m(this,Gt).call(this,`${this.options.base}/pub/seasons/${encodeURIComponent(this.options.season)}/sessions`,{method:"POST",body:JSON.stringify(m(this,wt)?{origin:m(this,wt)}:{}),credentials:"omit"}),o=await i.json().catch(()=>null);if(!i.ok){let s=o?.code??o?.error;if(i.status===403&&s&&Qp.has(s)){let r=s;throw this.options.onRefused?.({reason:r,code:s,status:i.status,retryable:r==="sales_not_open"}),new Ki(r,i.status)}throw new Error(`season_public_session_failed_${i.status}`)}if(!eh(o,this.options.season))throw new Error("season_public_session_invalid");return k(this,Pe,o),o})();k(this,De,t);try{return await t}finally{m(this,De)===t&&k(this,De,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",i=await this.mint(t);return{token:i.token,expiresAt:i.expiresAt}}};Pe=new WeakMap,De=new WeakMap,Gt=new WeakMap,wt=new WeakMap;function Ya(n){let e=new $n(n);return{access:new ae({provider:({reason:i})=>e.token(i),...n.accessHooks}),loader:e}}var th="https://api.seatlayer.io",ih=6e4,nh=5e3,B=class extends Error{constructor(t,i){super(`season_request_failed:${t}`);this.code=t;this.status=i;this.name="SeasonApiError"}},Wi=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}};function oh(n,e){let t=Number(n.headers.get("Retry-After")),i=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(nh,i*1e3))}function sh(n,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,i)=>{let o=setTimeout(t,n);e?.addEventListener("abort",()=>{clearTimeout(o),i(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function Xa(n){if(!n||typeof n!="object")return"unknown";let e=n;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}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 jn(n){return Array.isArray(n)?n.some(jn):!n||typeof n!="object"?!1:Object.entries(n).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&rh.test(t)||jn(t))}function Ut(n,e,t="invalid_operation_response"){if(!n||typeof n!="object"||Array.isArray(n))throw new B(t,502);if(jn(n))throw new B("unsafe_operation_response",502);let i=n,o=i.allocations,s=new Set,r=Array.isArray(o)&&o.length>0&&o.every(p=>{if(!p||typeof p!="object")return!1;let u=p.eventId,h=p.state;return typeof u!="string"||!u||typeof h!="string"||!ch.has(h)||s.has(u)?!1:(s.add(u),!0)}),a=i.bookingRef===null||typeof i.bookingRef=="string"&&i.bookingRef.length>0,l=i.state!=="booked"||typeof i.bookingRef=="string"&&r&&o.every(p=>p.state==="booked"),c=i.state!=="booking_pending"||typeof i.bookingRef=="string"&&r&&o.some(p=>p.state!=="booked"),d=i.state!=="committed"||i.bookingRef===null;if(i.operationId!==e.operationId||i.seasonId!==e.seasonId||i.kind!=="HOLD"||typeof i.holdId!="string"||!ah.test(i.holdId)||i.policy!=="fixed_inclusion_same_seat"||typeof i.state!="string"||!lh.has(i.state)||typeof i.expiresAt!="number"||!Number.isFinite(i.expiresAt)||i.expiresAt<0||!a||typeof i.location!="string"||!i.location||typeof i.retryAfterSeconds!="number"||!Number.isFinite(i.retryAfterSeconds)||i.retryAfterSeconds<0||!r||!l||!c||!d||i.pricingAuthority!==void 0&&i.pricingAuthority!=="host"||i.authoritativeAmountIncluded!==void 0&&i.authoritativeAmountIncluded!==!1)throw new B(t,502);return{operationId:i.operationId,seasonId:i.seasonId,kind:i.kind,holdId:i.holdId,expiresAt:i.expiresAt,policy:i.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:i.state,bookingRef:i.bookingRef,location:i.location,retryAfterSeconds:i.retryAfterSeconds,allocations:o.map(p=>({eventId:p.eventId,state:p.state}))}}function dh(n,e,t){if(!Array.isArray(n)||n.length!==t||n.some(r=>typeof r!="string"||!r)||new Set(n).size!==n.length||!Array.isArray(e)||e.length!==n.length)throw new B("invalid_best_available_response",502);let i=n,o=new Set(i),s=new Map;for(let r of e){if(!r||typeof r!="object")throw new B("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 B("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:i,items:i.map(r=>s.get(r))}}function ph(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n;if(typeof e.currency!="string"||!e.currency||!Array.isArray(e.packages))return null;let t=[];for(let i of e.packages){if(!i||typeof i!="object")continue;let o=i;if(typeof o.planKey!="string"||!o.planKey||!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(n){if(!n||typeof n!="object"||Array.isArray(n))throw new B("invalid_checkout_response",502);let e=n,t=typeof e.redirectUrl=="string"&&!!e.redirectUrl,i=!!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===i)throw new B("invalid_checkout_response",502);return{orderId:e.orderId,totalMinor:e.totalMinor,currency:e.currency,expiresAt:e.expiresAt,...t?{redirectUrl:e.redirectUrl}:{},...i?{clientPayload:e.clientPayload}:{}}}function Za(n,e){return{seasonKey:n.key,planActivationId:n.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:e.state,allocations:e.allocations.map(({eventId:t,state:i})=>({eventKey:t,state:i}))}}var fe,Xe,we,Ze,qt,xe,Se,te,pe,Qa,Yi=class{constructor(e,t){P(this,te);P(this,fe);P(this,Xe);P(this,we);P(this,Ze);P(this,qt);P(this,xe,!1);P(this,Se,null);k(this,fe,e),k(this,Xe,(t.apiBase??th).replace(/\/$/,"")),k(this,we,t.access),k(this,Ze,t.fetch??globalThis.fetch.bind(globalThis)),k(this,qt,t.recoveryTimeoutMs??ih),m(this,we).onRenewed(i=>x(this,te,Qa).call(this,i))}async descriptor(){let{body:e}=await x(this,te,pe).call(this,"GET","");return e.season}async chart(){let{body:e}=await x(this,te,pe).call(this,"GET","/chart");return e}async availability(){let{body:e}=await x(this,te,pe).call(this,"GET","/availability"),t=Object.values(e.seats??{});return{...e,freeCount:t.filter(i=>i==="free").length,blockedCount:t.filter(i=>i!=="free").length}}async hold(e,t){let{body:i,response:o}=await x(this,te,pe).call(this,"POST","/holds",{operationId:t,labels:[...e]});return{operation:Ut(i.operation,{seasonId:m(this,fe),operationId:t}),response:o}}async bestAvailable(e){let{body:t,response:i}=await x(this,te,pe).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=Ut(t.operation,{seasonId:m(this,fe),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:i}}async operation(e){let{body:t,response:i}=await x(this,te,pe).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:Ut(t.operation,{seasonId:m(this,fe),operationId:e}),response:i}}async release(e,t){let{body:i,response:o}=await x(this,te,pe).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:Ut(i.operation,{seasonId:m(this,fe),operationId:e}),response:o}}async prices(){let e;try{({body:e}=await x(this,te,pe).call(this,"GET","/prices"))}catch(t){if(t instanceof B&&t.status===404)return null;throw t}return ph(e)}async checkout(e){let{body:t}=await x(this,te,pe).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,Ze).call(this,`${m(this,Xe)}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit"}),i=await t.json().catch(()=>null);if(!t.ok)throw new B(Xa(i),t.status);if(i===null)throw new B("invalid_json_response",502);return i}async renewalIntent(e){let{body:t}=await x(this,te,pe).call(this,"POST","/renewal-intents",{offerId:e}),i=t.intent;if(!i||i.offerId!==e||i.state!=="intent_received"||!i.intentId||!Number.isFinite(i.receivedAt))throw new B("invalid_renewal_intent_response",502);return i}async waitForTerminal(e,t,i){let o=Date.now(),s=t?{operation:Ut(t.operation,{seasonId:m(this,fe),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,qt))throw new Wi(e);await sh(oh(s.response,s.operation),i),s=await this.operation(e)}return s.operation}destroy(){m(this,xe)||(k(this,xe,!0),m(this,we).onRenewed(void 0),m(this,we).clear())}};fe=new WeakMap,Xe=new WeakMap,we=new WeakMap,Ze=new WeakMap,qt=new WeakMap,xe=new WeakMap,Se=new WeakMap,te=new WeakSet,pe=async function(e,t,i,o=!0){if(m(this,xe))throw new B("season_api_destroyed",409);if(m(this,Se))throw m(this,Se);let s=await m(this,we).authorization();if(m(this,xe))throw new B("season_api_destroyed",409);if(m(this,Se))throw m(this,Se);if(!s)throw new se({reason:"no_token",retryable:!1});let r=await m(this,Ze).call(this,`${m(this,Xe)}/pub/seasons/${encodeURIComponent(m(this,fe))}${t}`,{method:e,headers:{Authorization:s,...i===void 0?{}:{"Content-Type":"application/json"}},body:i===void 0?void 0:JSON.stringify(i)}),a=await r.json().catch(()=>null);if(!r.ok){let l=Xa(a);if(o&&await m(this,we).handleFailure(r.status,l))return x(this,te,pe).call(this,e,t,i,!1);let c=m(this,we).unavailable;throw c?new se(c):new B(l,r.status)}if(a===null)throw new B("invalid_json_response",502);return{body:a,response:r}},Qa=async function(e){if(m(this,xe))return;let t=`/pub/seasons/${encodeURIComponent(m(this,fe))}/session/adopt`;for(let i=0;i<2;i++){if(m(this,xe))return;try{if((await m(this,Ze).call(this,`${m(this,Xe)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){k(this,Se,null);return}}catch{}}if(!m(this,xe))throw k(this,Se,new B("season_session_adopt_failed",409)),m(this,Se)};var uh=2500;function mh(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}function fh(n,e,t){if(n.startsAt==null)return{date:"Date to be announced",time:null};try{let i=new Date(n.startsAt),o=e?{timeZone:e}:{};return{date:new Intl.DateTimeFormat(t,{dateStyle:"medium",...o}).format(i),time:new Intl.DateTimeFormat(t,{timeStyle:"short",...o}).format(i)}}catch{return{date:"Date to be announced",time:null}}}function tl(n){return n.state==="committed"||n.state==="booked"}var Gn=class{constructor(e,t,i){this.transport=e;this.sink=t;this.intervalMs=i;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(([i,o])=>this.prior[i]!==o).map(([i,o])=>({label:i,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))}}},Un=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 B("season_best_available_in_progress",409);let i={operationId:e,...t.accessibility?.length?{accessibility:[...t.accessibility]}:{},...t.requireContiguous===!0?{requireContiguous:!0}:{}};return this.nextBestAvailable=i,i}clearBestAvailable(e){this.nextBestAvailable===e&&(this.nextBestAvailable=null)}queueRelease(e){this.nextReleaseActionId=e}operationForHold(e){return this.operationByHold.get(e)??null}remember(e){this.operationByHold.set(e.holdId,e)}forget(e){this.operationByHold.delete(e)}async chart(e){let[t,i]=await Promise.all([this.descriptorValue?Promise.resolve(this.descriptorValue):this.api.descriptor(),this.api.chart()]);this.descriptorValue=t;for(let o of i.categories??[])typeof o?.key=="string"&&typeof o.label=="string"&&this.categoryLabels.set(o.key,o.label);return{doc:i,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,i,o){if(o)throw new B("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(!tl(a))throw new B(`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,i){let o=this.operationForHold(i);if(!o)throw new B("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 B("season_operation_partial_terminal",409);this.forget(i)}async bestAvailable(e,t,i,o){let s=this.nextBestAvailable;this.nextBestAvailable=null;let r=s?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:r,qty:t,...i?{categoryKey:i}:{},...o?{zoneId:o}:{},...s?.accessibility?.length?{accessibility:s.accessibility}:{},...s?.requireContiguous===!0?{requireContiguous:!0}:{}}),l=await this.api.waitForTerminal(r,a);if(!tl(l))throw new B(`season_operation_${l.state}`,409);this.remember(l);let c=new Map(a.items.map(d=>[d.label,d]));return{holdId:l.holdId,expiresAt:l.expiresAt,labels:[...a.labels],items:a.labels.map(d=>{let p=c.get(d);return{label:d,objectId:p?.objectId??d,objectType:"seat",categoryKey:p?.categoryKey??i??"",tierId:p?.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...p?.quantity==null?{}:{quantity:p.quantity}}})}}categoryLabel(e){return this.categoryLabels.get(e)??e}socketUrl(){return""}createRealtime(e,t){return new Gn(this,t,this.realtimePollMs)}},M,et,St,re,X,Wt,Z,Me,U,ie,ge,kt,Be,He,tt,he,Yt,ke,Tt,Et,it,Ct,Fe,nt,ot,At,w,il,nl,Kn,Wn,Yn,Xn,Xi,Qe,ol,sl,Le,Kt,rl,al,Zn,Qn,ll,cl,dl,Jn,eo,G,Je,to,xt,qn=class{constructor(e){P(this,w);P(this,M);P(this,et);P(this,St);P(this,re);P(this,X);P(this,Wt,new AbortController);P(this,Z,null);P(this,Me,null);P(this,U,null);P(this,ie,null);P(this,ge,null);P(this,kt,null);P(this,Be,null);P(this,He,null);P(this,tt,null);P(this,he,[]);P(this,Yt,new Map);P(this,ke,!1);P(this,Tt,!1);P(this,Et);P(this,it,null);P(this,Ct,null);P(this,Fe,null);P(this,nt,"handoff");P(this,ot,null);P(this,At,!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,M,e),k(this,et,mh(e.container));let t={onExpired:o=>e.onAccessExpired?.(o),onUnavailable:o=>{let s=m(this,it)&&o.reason==="provider_failed"?m(this,it):o;k(this,it,null),k(this,Ct,s.reason==="provider_failed"?null:s),e.onAccessUnavailable?.(s),x(this,w,ll).call(this,s)}};if(!e.buyerAccessToken&&!e.buyerAccessTokenProvider){let{access:o,loader:s}=Ya({base:(e.apiBase??"https://api.seatlayer.io").replace(/\/$/,""),season:e.season,fetch:e.fetch,onRefused:r=>{k(this,it,r)},accessHooks:t});k(this,St,o),k(this,Et,s)}else k(this,Et,null),k(this,St,new ae({token:e.buyerAccessToken,provider:e.buyerAccessTokenProvider,...t}));k(this,re,new Yi(e.season,{apiBase:e.apiBase,access:m(this,St),fetch:e.fetch,recoveryTimeoutMs:e.recoveryTimeoutMs})),k(this,X,new Un(m(this,re),Math.max(750,e.realtimePollMs??uh)))}async render(){x(this,w,to).call(this),Wa(),x(this,w,nl).call(this),x(this,w,G).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{let[e,t,i]=await Promise.all([m(this,re).descriptor(),m(this,re).availability(),m(this,re).prices().catch(()=>null)]);return m(this,ke)?this:(k(this,Z,e),k(this,Me,t),k(this,Fe,i),k(this,nt,m(this,M).checkout==="hosted"&&e.checkoutMode!=="server"&&i?"hosted":"handoff"),m(this,X).prime(e,t),x(this,w,Kn).call(this),await x(this,w,il).call(this,e),m(this,ke)?this:(i&&x(this,w,Kn).call(this),x(this,w,dl).call(this),x(this,w,G).call(this,{kind:"ready",message:`${t.freeCount} seat${t.freeCount===1?"":"s"} available for every included performance.`}),m(this,M).initialOperationId&&await this.restoreOperation(m(this,M).initialOperationId),this))}catch(e){if(m(this,ke))return this;throw x(this,w,Je).call(this,e)}}async holdSameSeat(e,t){if(x(this,w,xt).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,X).queueOperation(t),m(this,ie).selectObjectsWithoutConfirmation([...e]),x(this,w,G).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await m(this,ie).handleCta(),!m(this,U))throw new B("season_hold_not_created",409);return m(this,U)}async holdBestAvailable(e,t,i={}){if(x(this,w,xt).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,ie).maxTickets;if(e>o)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${o})`);if(m(this,Tt))throw new B("season_best_available_in_progress",409);k(this,Tt,!0);let s=null;try{if(s=m(this,X).queueBestAvailable(t,i),x(this,w,G).call(this,{kind:"pending",message:`Finding ${e} Season seat${e===1?"":"s"} available for every performance.`,operationId:t},!0),!await m(this,ie).bestAvailableOrThrow(e,i.categoryKey,{zoneId:i.zoneId})||!m(this,U))throw new B("season_hold_not_created",409);return m(this,U)}catch(r){throw x(this,w,Je).call(this,r,t)}finally{s&&m(this,X).clearBestAvailable(s),k(this,Tt,!1)}}async restoreOperation(e){x(this,w,xt).call(this),x(this,w,G).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await m(this,re).waitForTerminal(e,void 0,m(this,Wt).signal);return t.state==="aborted"||t.state==="expired"?(k(this,U,null),m(this,M).onHoldChange?.(null),x(this,w,G).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(m(this,X).remember(t),x(this,w,Xn).call(this,t,!1))}catch(t){throw x(this,w,Je).call(this,t,e)}}async release(e){x(this,w,xt).call(this);let t=m(this,U);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");m(this,X).queueRelease(e),x(this,w,G).call(this,{kind:"pending",message:"Releasing the Season seats.",operationId:t.operationId},!0);try{m(this,ie)?.getCurrentHold()?.holdId===t.holdId?await m(this,ie).release():(await m(this,X).release("",[],t.holdId),x(this,w,Xi).call(this)),x(this,w,G).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(i){throw x(this,w,Je).call(this,i,t.operationId)}}}async createRenewalIntent(e){if(x(this,w,xt).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");x(this,w,G).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await m(this,re).renewalIntent(e);return x(this,w,G).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),m(this,M).onRenewalIntent?.(t),t}catch(t){throw x(this,w,Je).call(this,t)}}getDescriptor(){return m(this,Z)}getAvailability(){return m(this,Me)}getHandoff(){return m(this,U)}destroy(){m(this,ke)||(k(this,ke,!0),m(this,Wt).abort(),x(this,w,eo).call(this),m(this,ie)?.destroy(),m(this,re).destroy(),m(this,et).replaceChildren(),k(this,ge,null),k(this,kt,null),k(this,Be,null),k(this,He,null),k(this,tt,null),k(this,Z,null),k(this,Me,null),k(this,U,null))}};M=new WeakMap,et=new WeakMap,St=new WeakMap,re=new WeakMap,X=new WeakMap,Wt=new WeakMap,Z=new WeakMap,Me=new WeakMap,U=new WeakMap,ie=new WeakMap,ge=new WeakMap,kt=new WeakMap,Be=new WeakMap,He=new WeakMap,tt=new WeakMap,he=new WeakMap,Yt=new WeakMap,ke=new WeakMap,Tt=new WeakMap,Et=new WeakMap,it=new WeakMap,Ct=new WeakMap,Fe=new WeakMap,nt=new WeakMap,ot=new WeakMap,At=new WeakMap,w=new WeakSet,il=async function(e){let t=new Ye(ji({container:m(this,kt),event:e.key,apiBase:m(this,M).apiBase,transport:m(this,X),hideEventDetails:!0,maxSelection:m(this,M).maxSelection,selectedObjects:m(this,M).selectedObjects,selectableObjects:m(this,M).selectableObjects,numberOfPlacesToSelect:m(this,M).numberOfPlacesToSelect,selectionValidators:m(this,M).selectionValidators,locale:m(this,M).locale,messages:m(this,M).messages,languages:m(this,M).languages,colorblindSafe:m(this,M).colorblindSafe,initialView:m(this,M).initialView,enable3D:m(this,M).enable3D,max3DSeats:m(this,M).max3DSeats,hideBadge:m(this,M).hideBadge,theme:m(this,M).theme,confirmSelection:m(this,M).confirmSelection,seatView:m(this,M).seatView,onBuyerViewChange:m(this,M).onBuyerViewChange,onAnalytics:(i,o)=>{try{m(this,M).onAnalytics?.(i,{...o,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:e.occurrenceCount})}catch{}},onSelectionChange:i=>{k(this,he,i.map(o=>o.label)),k(this,Yt,new Map(i.filter(o=>!!o.categoryKey).map(o=>[o.label,o.categoryKey]))),x(this,w,Qe).call(this),m(this,M).onSelectionChange?.(i)},onSelectionValidityChange:m(this,M).onSelectionValidityChange,onHoldChange:i=>{if(!i){x(this,w,Xi).call(this);return}let o=m(this,X).operationForHold(i.holdId);o&&x(this,w,Xn).call(this,o,!0)},onCheckout:()=>{m(this,U)&&(x(this,w,Le).call(this,"checkout"),m(this,M).onContinue?.(m(this,U)),m(this,nt)==="hosted"&&x(this,w,cl).call(this,m(this,U)))},onHoldExpired:()=>{x(this,w,Xi).call(this),x(this,w,G).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),m(this,M).onHoldExpired?.()},onError:i=>x(this,w,Je).call(this,i)},{surface:"season",performanceCount:e.occurrenceCount,selectionMode:"same_seat",suppressPricing:!0,groupSelectionSummary:()=>{let i=m(this,he).length;return i?{seats:i,performances:e.occurrenceCount,performancesChosen:e.occurrenceCount,perPerformance:i}:null}}));k(this,ie,t),await t.render()},nl=function(){m(this,et).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 i=document.createElement("ol");i.className="sl-season-progress",i.setAttribute("aria-label","Season checkout progress");for(let[f,T]of["Choose seats","Review package","Checkout"].entries()){let S=document.createElement("li");S.dataset.state=f===0?"current":"upcoming";let v=document.createElement("span");v.textContent=String(f+1),S.append(v,T),i.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 d=document.createElement("i");d.textContent="1\xD7";let p=document.createElement("span");p.textContent="Each seat you choose is reserved for every included performance.",c.append(d,p);let u=document.createElement("p");u.className="sl-season-availability";let h=document.createElement("p");h.className="sl-season-checkout-note",h.textContent="Your ticketing platform confirms package price, payment, admission passes, and member benefits.",r.append(a,l,c,u,h),o.append(s,r);let y=document.createElement("p");y.className="sl-season-status",y.setAttribute("role","status"),y.setAttribute("aria-live","polite"),e.append(t,i,o,y),m(this,et).append(e),k(this,ge,e),k(this,kt,s),k(this,Be,y),k(this,He,l),k(this,tt,u)},Kn=function(){let e=m(this,Z),t=m(this,M).offer,i=m(this,ge).querySelector(".sl-season-hero");i.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 h of[`${e.occurrenceCount} performances`,e.venue,t?.renewalLabel??"Same-seat package"].filter(Boolean)){let y=document.createElement("span");y.className="sl-season-fact",y.textContent=h,l.append(y)}o.append(s,r,a,l),i.append(o);let c=document.createElement("div");c.className="sl-season-offer";let d=document.createElement("span");d.className="sl-season-offer-label";let p=x(this,w,Kt).call(this);if(p){d.textContent=b("season.packagePriceLabel","Package price"),c.append(d,x(this,w,al).call(this,p,e.occurrenceCount));let h=document.createElement("span");h.className="sl-season-price-note",h.textContent=b("season.packagePricePerSeat","Per seat, for the whole package."),c.append(h),i.append(c),x(this,w,Wn).call(this,i,t),x(this,w,Yn).call(this,i,e),x(this,w,Qe).call(this);return}d.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(d,u),t?.compareAtPriceLabel){let h=document.createElement("span");h.className="sl-season-was",h.textContent=t.compareAtPriceLabel,c.append(h)}if(t?.savingsLabel){let h=document.createElement("span");h.className="sl-season-saving",h.textContent=t.savingsLabel,c.append(h)}if(t?.priceNote){let h=document.createElement("span");h.className="sl-season-price-note",h.textContent=t.priceNote,c.append(h)}i.append(c),x(this,w,Wn).call(this,i,t),x(this,w,Yn).call(this,i,e),x(this,w,Qe).call(this)},Wn=function(e,t){if(!t?.benefits?.length)return;let i=document.createElement("ul");i.className="sl-season-benefits";for(let o of t.benefits.slice(0,6)){let s=document.createElement("li");s.textContent=o,i.append(s)}e.append(i)},Yn=function(e,t){let i=document.createElement("details");i.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,M).locale),d=document.createElement("time");r.startsAt!=null&&(d.dateTime=new Date(r.startsAt).toISOString()),d.textContent=c.time?`${c.date} \xB7 ${c.time}`:c.date,a.append(l,d),s.append(a)}i.append(o,s),e.append(i)},Xn=function(e,t){if(e.state==="booked")return k(this,U,null),m(this,X).forget(e.holdId),m(this,ie)?.notifyGroupSettled("booked"),x(this,w,Le).call(this,"complete"),x(this,w,G).call(this,{kind:"booked",message:`Your Season booking is complete for all ${m(this,Z).occurrenceCount} performances. No further checkout action is needed.`,operationId:e.operationId}),m(this,M).onHoldChange?.(null),null;if(e.state==="partial_terminal")return k(this,U,null),k(this,he,[]),m(this,X).forget(e.holdId),m(this,ie)?.notifyGroupSettled("lost"),x(this,w,Qe).call(this),x(this,w,Le).call(this,"review"),x(this,w,G).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),m(this,M).onHoldChange?.(null),null;if(e.state!=="committed")return k(this,U,null),m(this,X).forget(e.holdId),m(this,ie)?.notifyGroupSettled("lost"),x(this,w,G).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),m(this,M).onHoldChange?.(null),null;let i=Za(m(this,Z),e),o=m(this,U)?.holdId!==i.holdId;return k(this,U,i),x(this,w,Qe).call(this),x(this,w,Le).call(this,"review"),m(this,M).onHoldChange?.(i),x(this,w,G).call(this,{kind:"held",message:`Your seats are held for all ${m(this,Z).occurrenceCount} performances. Review and continue to checkout.`,operationId:e.operationId}),o&&t&&m(this,M).onHold?.(i),i},Xi=function(){k(this,U,null),k(this,he,[]),x(this,w,Qe).call(this),x(this,w,Le).call(this,"choose"),m(this,M).onHoldChange?.(null)},Qe=function(){if(!m(this,He))return;let e=m(this,he).length;if(!e)m(this,He).textContent="Choose a seat on the map. Unavailable seats are already booked on at least one included performance.";else{m(this,He).replaceChildren();let t=document.createElement("strong");t.textContent=m(this,he).join(", "),m(this,He).append(t,` \xB7 ${e} Season seat${e===1?"":"s"} across all ${m(this,Z)?.occurrenceCount??0} performances`)}m(this,tt)&&m(this,Me)&&(m(this,tt).textContent=`${m(this,Me).freeCount} seat${m(this,Me).freeCount===1?"":"s"} currently available for the complete Season`),x(this,w,ol).call(this),x(this,w,sl).call(this)},ol=function(){let e=m(this,ge)?.querySelector(".sl-season-summary-card");if(!e)return;e.querySelector(".sl-season-package-total")?.remove();let t=x(this,w,Zn).call(this);if(t==null)return;let i=m(this,Fe)?.currency??m(this,Z)?.currency??"USD",o=m(this,Z)?.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,Qn).call(this,t,i);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)},sl=function(){let e=m(this,ge)?.querySelector(".sl-season-checkout-note");if(e){if(m(this,nt)==="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,Kt).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."}},Le=function(e){let t=e==="choose"?0:e==="review"?1:e==="checkout"?2:3;m(this,ge)?.querySelectorAll(".sl-season-progress li").forEach((i,o)=>{i.dataset.state=o<t?"done":o===t?"current":"upcoming";let s=i.querySelector("span");s&&(s.textContent=o<t?"\u2713":String(o+1))})},Kt=function(){let e=m(this,Fe)?.packages;if(!e?.length)return null;let t=m(this,Z)?.planActivationId,i=e.find(r=>r.planKey===t);if(i)return i;let o=m(this,Et)?.session?.planActivationIds;return(o?.length?e.filter(r=>o.includes(r.planKey)):[])[0]??e[0]},rl=function(e){let t=x(this,w,Kt).call(this)?.prices.find(i=>i.categoryKey===e);return t?t.unitPrice:null},al=function(e,t){let i=document.createElement("ul");i.className="sl-season-price-lines";let o=m(this,Fe)?.currency??m(this,Z)?.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,X).categoryLabel(s.categoryKey);let l=document.createElement("strong");l.className="sl-season-price",l.textContent=x(this,w,Qn).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),i.append(r)}return i},Zn=function(){if(!m(this,he).length||!x(this,w,Kt).call(this))return null;let e=0;for(let t of m(this,he)){let i=m(this,Yt).get(t),o=i?x(this,w,rl).call(this,i):null;if(o==null)return null;e+=o}return e},Qn=function(e,t){let i=el(e,t),o=Number.isInteger(i);return Ja(i,t,{locale:m(this,M).locale,fallback:(s,r)=>`${s} ${r}`,...o?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})},ll=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,G).call(this,{kind:"failed",message:t})},cl=async function(e){if(!m(this,At)){k(this,At,!0);try{let t=m(this,Fe)?.currency??m(this,Z)?.currency??"USD",i=x(this,w,Zn).call(this);if(i==null){x(this,w,G).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,Jn).call(this,{kind:"pay",provider:null,order:{holdId:e.operationId,expiresAt:e.expiresAt,currency:t,total:el(i,t),labels:[...m(this,he)]}})}finally{k(this,At,!1)}}},dl=function(){if(m(this,nt)!=="hosted")return;let e=Gi(m(this,M).season);e?.outcome!=="success"||!e.orderId||(x(this,w,Le).call(this,"checkout"),x(this,w,Jn).call(this,{kind:"resume",orderId:e.orderId}))},Jn=async function(e){let t;try{({mountCheckout:t}=await ni())}catch(o){m(this,M).onError?.(o),x(this,w,G).call(this,{kind:"failed",message:b("season.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held \u2014 please try again.")});return}let i=m(this,ie)?.root;m(this,ke)||!i||(x(this,w,eo).call(this),k(this,ot,t({root:i,state:e,eventKey:m(this,M).season,formatMoney:(o,s)=>Ja(o,s,{locale:m(this,M).locale,fallback:(r,a)=>`${r} ${a}`,...Number.isInteger(o)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:o=>m(this,re).checkout({operationId:o.holdId,buyerEmail:o.buyerEmail,...o.buyerName?{buyerName:o.buyerName}:{},...m(this,M).returnUrl?{returnUrl:m(this,M).returnUrl}:{}}),orderStatus:o=>m(this,re).orderStatus(o),onCancel:()=>{k(this,ot,null),m(this,U)&&x(this,w,Le).call(this,"review")},onConfirmed:o=>{m(this,M).onOrderConfirmed?.(o),x(this,w,Le).call(this,"complete"),x(this,w,G).call(this,{kind:"booked",message:b("season.orderConfirmed","Your season tickets are confirmed for every included performance.")})},onError:o=>m(this,M).onError?.(o)})))},eo=function(){m(this,ot)?.destroy(),k(this,ot,null)},G=function(e,t=!1){m(this,Be)&&(m(this,Be).textContent=e.message,m(this,Be).dataset.kind=e.kind),m(this,ge)&&(m(this,ge).dataset.busy=String(t)),m(this,M).onStatusChange?.(e)},Je=function(e,t){let i=e instanceof se&&e.reason==="provider_failed"&&m(this,Ct)?new se(m(this,Ct)):e;if(i instanceof se)return m(this,M).onError?.(i),i;let o=i instanceof B?`Season selection unavailable (${i.code}).`:"Season selection could not be completed.";return x(this,w,G).call(this,{kind:"failed",message:o,operationId:t}),m(this,M).onError?.(i),i},to=function(){if(m(this,ke))throw new Error("seatlayer: SeasonPicker was destroyed")},xt=function(){if(x(this,w,to).call(this),!m(this,Z)||!m(this,ie))throw new Error("seatlayer: render SeasonPicker before using it")};function gh(n,e={}){let t=e.origin??"";if(!t)try{t=new URL(n.src,window.location.href).origin}catch{t=""}let i=!1,o=null,s=null,r=null,a="",l=null,c="",d=()=>{if(i)return;i=!0,o=n.getAttribute("style"),Object.assign(n.style,{position:"fixed",inset:"0",margin:"0",border:"0",zIndex:"2147483000",background:c||"transparent"}),n.style.width="100vw",n.style.height="100vh",n.style.width="100dvw",n.style.height="100dvh";let h=document.documentElement;s=h.style.overflow,h.style.overflow="hidden",document.body&&(r=document.body.style.overflow,document.body.style.overflow="hidden"),l=y=>{y.key==="Escape"&&p()},window.addEventListener("keydown",l)},p=()=>{i&&(i=!1,o===null?n.removeAttribute("style"):n.setAttribute("style",o),o=null,a&&(n.style.height=a),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=h=>{if(h.source!==n.contentWindow||t&&h.origin!==t||!h.data||typeof h.data!="object")return;let y=h.data;if(y.type==="seatlayer:height"){typeof y.px=="number"&&Number.isFinite(y.px)&&y.px>0&&(a=`${Math.round(y.px)}px`,i||(n.style.height=a));return}y.type==="seatlayer:fullscreen"&&(typeof y.background=="string"&&/^[#a-zA-Z0-9(),.%\s-]{1,64}$/.test(y.background)&&(c=y.background,i&&(n.style.background=c)),y.on===!0?d():y.on===!1&&p())};return window.addEventListener("message",u),()=>{window.removeEventListener("message",u),p()}}export{V as ApiError,ae as BuyerAccessContext,se as BuyerAccessUnavailableError,Te as BuyerRealtimeClient,yn as EmbeddedDesigner,Y as PerformanceGroupDestroyedError,zn as PerformanceGroupPicker,ws as SEATING_CHART_CALLBACK_PROPS,bs as SEATING_CHART_HANDLE_METHODS,ys as SEATING_CHART_IDENTITY_PROPS,vs as SEATING_CHART_VALUE_PROPS,B as SeasonApiError,qn as SeasonPicker,Ki as SeasonPublicSessionRefused,Wi as SeasonRecoveryTimeoutError,Ye as SeatPicker,gn as SeatingChart,gh as attachPickerFrame,Dc as bindSeatingChartHandle,Bc as buildSeatingChartOptions,_t as createBuyerAccessContext,Pt as createControllerSink,wn as parseTicketOfferAvailability,jt as shortOperationReference,xn as ticketOfferPrices};