@seatlayer/js 0.86.10 → 0.86.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -3258,7 +3258,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
3258
3258
|
background-size: 640px 100%;
|
|
3259
3259
|
}
|
|
3260
3260
|
}`,e.append(t);let n="linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.04) 63%)",o=document.createElement("div");Object.assign(o.style,{position:"absolute",inset:"0",display:"flex",flexDirection:"column",padding:"16px",gap:"14px",opacity:"0.9"});let s=c=>{let d=document.createElement("div");return d.className="sl-shimmer",Object.assign(d.style,{background:n,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:n,flex:"0 0 auto"}),a.append(l),a.append(document.createTextNode("Loading designer\u2026")),e.append(a)}buildErrorCard(e,t){let n=Ld[t],o=document.createElement("div");Object.assign(o.style,{maxWidth:"420px",margin:"0 24px",padding:"28px",textAlign:"center",background:"rgba(255, 255, 255, 0.03)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"16px",boxShadow:"0 12px 40px rgba(0, 0, 0, 0.35)"});let s=document.createElement("h2");s.textContent=n.title,Object.assign(s.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let r=document.createElement("p");r.textContent=n.body,Object.assign(r.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let a=document.createElement("button");a.type="button",a.textContent="Try again",Object.assign(a.style,{appearance:"none",cursor:"pointer",border:"0",borderRadius:"10px",padding:"10px 22px",fontSize:"14px",fontWeight:"600",color:"#101625",background:"#7aa2ff"}),a.addEventListener("click",()=>this.handleTryAgain()),o.append(s,r,a),e.append(o)}};function li(i,e){let t=document.createElement("div");t.className="sl-loading-state";let n=document.createElement("div");if(n.setAttribute("role",e.busy?"status":"alert"),n.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,n.append(o),e.description){let r=document.createElement("p");r.className="sl-loading-description",r.textContent=e.description,n.append(r)}t.append(n);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)),i.replaceChildren(t),s}function Md(i){let{viewportWidth:e,viewportHeight:t,offsetTop:n,offsetLeft:o,clientWidth:s,clientHeight:r,innerHeight:a,largeViewportHeight:l}=i;if(![e,t,n,o].every(Number.isFinite)||e<=0||t<=0)return null;let c=Number.isFinite(s)&&s>0?s:e,d=Number.isFinite(r)&&r>0?r:t,p=n;return Number.isFinite(l)&&a>l+1&&d<l-1&&(p=Math.max(p,l-d)),{width:Math.min(e,c),height:Math.min(t,d),top:p,left:o}}function hr(i){let e=window.visualViewport;if(!e)return()=>{};let t=document.createElement("div");t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",visibility:"hidden",pointerEvents:"none",width:"0",height:"100lvh",overflow:"hidden"}),document.body.appendChild(t);let n=()=>{let c=Md({viewportWidth:e.width,viewportHeight:e.height,offsetTop:e.offsetTop,offsetLeft:e.offsetLeft,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight,innerHeight:window.innerHeight,largeViewportHeight:t.getBoundingClientRect().height});c&&Object.assign(i.style,{right:"auto",bottom:"auto",top:`${c.top}px`,left:`${c.left}px`,width:`${c.width}px`,height:`${c.height}px`})},o=0,s=0,r=0,a=()=>{o&&window.cancelAnimationFrame(o),s&&window.cancelAnimationFrame(s),r&&window.clearTimeout(r),o=window.requestAnimationFrame(()=>{o=0,s=window.requestAnimationFrame(()=>{s=0,n()})}),r=window.setTimeout(()=>{r=0,n()},250)},l=()=>{n(),a()};return l(),e.addEventListener("resize",l),e.addEventListener("scroll",l),window.addEventListener("resize",l),window.addEventListener("orientationchange",l),window.addEventListener("pageshow",l),()=>{o&&window.cancelAnimationFrame(o),s&&window.cancelAnimationFrame(s),r&&window.clearTimeout(r),e.removeEventListener("resize",l),e.removeEventListener("scroll",l),window.removeEventListener("resize",l),window.removeEventListener("orientationchange",l),window.removeEventListener("pageshow",l),t.remove()}}function ur(i,e){let t=new Set(["chart","objects","resume","availability"]),n=new Map;return new Proxy(Object.create(i),{get(o,s){let r=i,a=Reflect.get(r,s,r);return typeof a!="function"?a:(n.has(s)||n.set(s,t.has(String(s))?async(...l)=>{let c=await Pt(()=>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)),n.get(s))}})}var H=require("@seatlayer/core"),En=require("@seatlayer/core/view3d/crossfade/panorama");function mr(i){return!!i&&i.clientWidth>0&&i.scrollWidth>i.clientWidth+1}function Hd(i){return i.some(e=>mr(e))}var an="data-fit-gone",Rd=12;function eo(i,e,t=mr){if(!i)return 0;for(let n of e)i.classList.remove(n.cls);if(i.querySelectorAll(`[${an}]`).forEach(n=>{n.removeAttribute(an),n.hidden=!1}),i.dataset.fit="0",i.clientWidth<=0||!t(i))return 0;for(let n=0;n<e.length;n+=1){let o=e[n];n>0&&i.classList.remove(e[n-1].cls),i.classList.add(o.cls),i.dataset.fit=String(n+1);let s=o.give?o.give(i):!0;if(!t(i))return n+1;if(o.repeat&&o.give){for(let r=1;s&&r<Rd;r+=1)if(s=o.give(i),!t(i))return n+1}}return e.length}function Id(i,e="[data-fit-seg]"){let t=[...i.querySelectorAll(e)].filter(n=>!n.hidden);return t.length<2?!1:fr(t[t.length-1])}function Od(i,e){let t=i.querySelector(e);return t&&!t.hidden?fr(t):!1}function fr(i){let e=i.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(an,""),e.hidden=!0),i.setAttribute(an,""),i.hidden=!0,!0}function _d(i){if(!i)return!1;let e=(i.getAttribute("aria-label")||i.textContent||"").trim();return e?(i.setAttribute("aria-label",e),i.setAttribute("title",e),!0):!1}function gr(i){if(!i)return 0;let e=i.querySelector(".sl-confirm-cancel"),t=i.querySelector(".sl-confirm-add-t");return eo(i,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>_d(e)}],()=>Hd([e,t]))}function br(i){return eo(i,[{cls:"sl-fit-notype",give:e=>Od(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>Id(e),repeat:!0}])}function yr(i){return i?(i.classList.add("sl-fitpill"),eo(i,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var Nd=["on-sale","low","sold-out","presale","closed"];function ci(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function to(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function vr(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i,t=e.count,n=e.index;if(typeof n!="number"||!Number.isInteger(n)||n<1||typeof t!="number"||!Number.isInteger(t)||t<n)return;let o=e.remaining;if(o!=null&&(typeof o!="number"||!Number.isInteger(o)||o<0))return;let s={index:n,count:t,remaining:o??null};if(e.pricingMode!==void 0){if(e.pricingMode!=="matrix")return;s.pricingMode="matrix"}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=to(e[r]);if(a===void 0)return;s[r]=a}return s}function Dd(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],n=new Set;for(let r of e.channels){if(!r||typeof r!="object"||Array.isArray(r))return;let a=r,l=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||n.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],d=new Set;for(let p of a.priceOverrides){if(!p||typeof p!="object"||Array.isArray(p))return;let m=p,h=typeof m.categoryKey=="string"?m.categoryKey.trim():"",y=m.tierId===null?null:typeof m.tierId=="string"&&m.tierId.trim()?m.tierId.trim():void 0,f=ci(m.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})}n.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let o=[],s=new Set;for(let r of e.objects){if(!r||typeof r!="object"||Array.isArray(r))return;let a=r,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||s.has(l)||!n.has(c))return;s.add(l),o.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:o}}function ln(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i,t=Nd.find(p=>p===e.state);if(!t)return null;let n=ci(e.fromPrice),o=ci(e.previousPrice);if(n===void 0||o===void 0)return null;let s=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(s===void 0)return null;let r=vr(e.release);if(r===void 0)return null;let a=e.upcoming===void 0?null:vr(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let p=[];for(let m of e.prices){if(!m||typeof m!="object"||Array.isArray(m))return null;let h=m,y=typeof h.categoryKey=="string"?h.categoryKey.trim():"";if(!y)return null;let f=ci(h.price),T=ci(h.previousPrice);if(f==null||T===void 0)return null;let w={categoryKey:y,price:f,previousPrice:T};if(h.tierId!==void 0){if(h.tierId!==null&&(typeof h.tierId!="string"||!h.tierId.trim()))return null;w.tierId=h.tierId===null?null:h.tierId.trim()}if(h.offerId!==void 0){if(typeof h.offerId!="string"||!h.offerId.trim())return null;w.offerId=h.offerId.trim()}if(h.offerName!==void 0){if(typeof h.offerName!="string"||!h.offerName.trim())return null;w.offerName=h.offerName.trim()}if(h.remaining!==void 0){if(h.remaining!==null&&(typeof h.remaining!="number"||!Number.isInteger(h.remaining)||h.remaining<0))return null;w.remaining=h.remaining==null?null:h.remaining}for(let v of["startsAt","endsAt"]){if(h[v]===void 0)continue;let A=to(h[v]);if(A===void 0)return null;w[v]=A}p.push(w)}l=p}let c=Dd(e.channelPricing);if(c===void 0)return null;let d=to(e.nextPriceChangeAt);return d===void 0?null:{state:t,fromPrice:n,previousPrice:o,currency:s,release:r,upcoming:a,prices:l,channelPricing:c,...e.nextPriceChangeAt!==void 0?{nextPriceChangeAt:d}:{}}}function wr(i){return i?.changed!==!1}function xr(i,e){if(!i)return null;let t=null,n=o=>{o!=null&&o>e&&(t===null||o<t)&&(t=o)};for(let o of[i.release,i.upcoming])n(o?.startsAt),n(o?.endsAt);for(let o of i.prices)n(o.startsAt),n(o.endsAt);return n(i.nextPriceChangeAt),t}function io(i){let e={};for(let t of i?.prices??[])if(t.tierId==null)e[t.categoryKey]=t.price;else{let n=e[t.categoryKey],o=typeof n=="number"?{base:n}:n??{};e[t.categoryKey]={...o,tiers:{...o.tiers,[t.tierId]:t.price}}}return e}function Sr(i,e){let t={...i};for(let[n,o]of Object.entries(io(e))){let s=t[n];t[n]=typeof o=="number"?o:{...typeof s=="number"?{base:s}:s,...o,tiers:{...typeof s=="object"?s.tiers:{},...o.tiers}}}return t}function kr(i){return i.focusedSection!==null?i.deeperThanSectionFrame===!1?"venue":"section":i.atVenueFit!==void 0?i.atVenueFit?"none":"venue":i.seatsRevealed?"venue":"none"}function Tr(i,e,t=[],n=8){let o=e.reduce((r,a)=>!a||a.width<=0||a.height<=0?r:Math.max(r,a.bottom-i.top+n),0),s=t.reduce((r,a)=>!a||a.width<=0||a.height<=0?r:Math.max(r,i.bottom-a.top+n),o>0?n:0);return{top:Math.max(0,Math.ceil(o)),right:0,bottom:Math.max(0,Math.ceil(s)),left:0}}function Er(i){let e=document.createElement("div");e.className="sl-floors on",e.setAttribute("role","group"),e.setAttribute("aria-label",i.tf("picker.chooseLevel","Choose level"));let t=[{id:"",name:i.tf("picker.allLevels","All levels")},...i.floors.map(r=>({id:r.id,name:r.name}))],n=document.createElement("span");n.className="sl-floor-label",n.textContent=`${i.tf("picker.levels","Level")}:`,e.appendChild(n);let o=document.createElement("select");o.className="sl-floor-select",o.setAttribute("aria-label",i.tf("picker.chooseLevel","Choose level"));for(let r of t){let a=document.createElement("option");a.value=r.id,a.textContent=r.name,o.appendChild(a)}let s=i.tf("picker.floorHelp","All levels shows the complete venue. Choose one level to inspect and select its seats.");return o.title=s,o.addEventListener("change",()=>i.onChoose(o.value)),e.appendChild(o),e}function Cr(i,e,t){if(!i)return;let n=t?"":e,o=i.querySelector(".sl-floor-select");o&&(o.value=n)}var cn=class{constructor(e){this.el=null;this.current=null;this.collapsed=!1;this.shownAt=0;this.host=e}get summary(){return this.current}adopt(e){this.current=e}get element(){return this.el}show(e){if(e&&e.id!==this.current?.id&&this.host.collapseSheet(),this.current=e,!e){this.el?.remove(),this.el=null,this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}render(e){this.el?.remove(),this.el=null}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,n=this.host.map();if(!e||!t||!n)return 0;let o=this.host.activeFloorObjects().find(v=>v.type==="section"&&v.id===t.id)?.outline;if(!o||o.length<3)return 0;let s=o.map(v=>this.host.controller.worldToScreen(v)),r=s.map(v=>v.x),a=s.map(v=>v.y),l=Math.min(...r),c=Math.min(...a),d=Math.max(...r)-l,p=Math.max(...a)-c;if(d<=0||p<=0)return 0;let m=n.getBoundingClientRect(),h=e.getBoundingClientRect(),y=h.left-m.left,f=h.top-m.top,T=Math.max(0,Math.min(y+h.width,l+d)-Math.max(y,l)),w=Math.max(0,Math.min(f+h.height,c+p)-Math.max(f,c));return T*w/(d*p)}};var Dt=require("@seatlayer/core"),Jr=require("@seatlayer/core/core/color");var Ue=require("@seatlayer/core");function no(i,e,t){try{return new Intl.DateTimeFormat(e,{...t,...i.timezone?{timeZone:i.timezone}:{}}).format(new Date(i.startsAt))}catch{return new Date(i.startsAt).toLocaleString(e)}}var dn=(i,e)=>no(i,e,{dateStyle:"medium"}),pn=(i,e)=>no(i,e,{timeStyle:"short"}),hn=(i,e)=>no(i,e,{weekday:"short",day:"numeric",month:"short"});function Ar(i,e,t,n){return!i.length||i.length>=e?null:{summary:n,labels:i.map(o=>`${dn(o,t)} \xB7 ${pn(o,t)}`)}}function Bd(i,e){let t=new Set(e);return i.map(n=>({...n,free:!t.has(n.eventKey)}))}function Pr(i,e){let t=[...i];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function Fd(i,e,t="",n=!1){if(!i.length)return"";let o=i.map(s=>{let r=s.free?e.free:e.blocked,a=n&&s.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${C(s.eventKey)}" aria-label="${C(`${s.shortDate}: ${r}`)}" checked>`:"";return`<li class="sl-night${s.free?" ok":" no"}" aria-label="${C(`${s.shortDate}: ${r}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${C(s.shortDate)}</span><span class="st">${C(r)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${C(e.title)}</div><ul class="sl-nightstrip">${o}</ul><p class="sl-tip-nights-note">${C(e.notAvailableOn)}</p>`+t+"</div>"}function Vd(i){return i.selectPartialLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${C(i.selectPartialLabel)}</button>`:i.switchLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${C(i.switchLabel)}</button>`:i.switchLabel||i.selectPartialLabel?"":`<p class="sl-tip-advice">${C(i.advice)}</p>`}function zd(i){return Number(i.available)+Number(i.selected)+Number(i.partial)+Number(i.unavailable)}function Lr(i,e,t){if(zd(i)<2)return"";let n=(s,r,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${s}"${a}></i>${C(r)}</li>`,o=[];return i.available&&o.push(n("sl-pg-sw-free",e.available,` style="background:${C(t)}"`)),i.selected&&o.push(n("sl-pg-sw-sel",e.selected)),i.partial&&o.push(n("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${C(t)}"`)),i.unavailable&&o.push(n("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${C(e.title)}">${o.join("")}</ul>`}function Mr(i,e){if(!i.length)return"";let t=i.map(n=>{let o=n.labels.length?n.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${n.labels.length?"":" empty"}${n.active?" active":""}" role="button" tabindex="0"${n.active?' aria-current="true"':""} data-event-key="${C(n.eventKey)}"><span class="n">${C(n.name)}</span><span class="s">${C(o)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${C(e.title)}"><div class="sl-pg-nights-title">${C(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function oo(i,e){if(i?.kind!=="partial"||!e?.length)return null;let t=i.data?.blockedEventKeys??[],n=Bd(e,t);return{states:n,missing:n.filter(o=>!o.free).map(o=>o.shortDate)}}function Hr(i,e){return i?Fd(i.states,{title:b("picker.group.partlyAvailableTitle","Free on some nights only"),free:b("picker.group.nightFree","Free"),blocked:b("picker.group.nightBlocked","Not available"),notAvailableOn:(0,Ue.t)("picker.group.notAvailableOn",{dates:Pr(i.missing,e.locale)})},Vd({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 $d(i,e,t,n){if(!i.length)return"";let o=new Set(e),s=new Set(t),r=i.map(a=>{let l=o.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${C(a.eventKey)}" aria-label="${C(`${a.shortDate}: ${l?n.available:n.unavailable}`)}"${l&&s.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${C(a.shortDate)}</span><span class="sl-confirm-date-state">${C(l?n.available:n.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${C(n.title)}</legend><p class="sl-confirm-dates-copy">${C(n.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${C(n.selectAll)}</span></label><ul>${r}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function Rr(i,e,t,n){let o=e.availableEventKeys(t);return $d(i,o,e.includedEventKeys(),{title:n("picker.group.confirmDatesTitle","Choose performance dates"),copy:o.length===i.length?n("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(i.length)):n("picker.group.confirmPartialDatesCopy","This seat is available for {available} of {total} dates. Choose one date or keep every available date.").replace("{available}",String(o.length)).replace("{total}",String(i.length)),selectAll:n("picker.group.confirmSelectAll","Select all available dates"),available:n("picker.group.nightFree","Available"),unavailable:n("picker.group.nightBlocked","Unavailable")})}function Ir(i){return[...i.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function Or(i,e,t,n){let o=[...i.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!o.length)return;let s=i.querySelector(".sl-confirm-add"),r=i.querySelector("[data-pg-confirm-all]"),a=()=>{let l=o.filter(p=>!p.disabled),c=Ir(i).length;r&&(r.checked=c===l.length,r.indeterminate=c>0&&c<l.length);let d=i.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"),n()};o.forEach(l=>l.addEventListener("change",a)),r?.addEventListener("change",()=>{o.filter(l=>!l.disabled).forEach(l=>{l.checked=r.checked}),a()}),a()}async function _r(i,e,t){if(!i||!t||!i.querySelector("[data-pg-confirm-event-key]"))return!0;let n=Ir(i);if(!n.length)return!1;let o=i.querySelector(".sl-confirm-add");return o?.setAttribute("aria-busy","true"),o&&(o.disabled=!0),await t.apply(e,n)?!0:(o?.removeAttribute("aria-busy"),o?.isConnected&&(o.disabled=!1),!1)}function Nr(i,e,t){return i?(0,Ue.t)("picker.group.seatPartlyAvailable",{label:e,free:i.states.length-i.missing.length,total:i.states.length,dates:Pr(i.missing,t)}):""}function Dr(i,e){let t=i.map((n,o)=>{let s=n.state==="done"?e.done:n.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${C(n.id)}" data-state="${C(n.state)}"${n.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${n.state==="done"?"\u2713":String(o+1)}</span><span class="l">${C(n.label)}</span><span class="sl-pg-sr">${C(s)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${C(e.label)}">${t}</ol>`}function so(i,e){return`<ul class="sl-pg-cards">${i.map(n=>`<li class="sl-pg-card" data-event-key="${C(n.eventKey)}"><span class="n">${C(n.name)}</span><time datetime="${C(n.iso)}"><span class="d">${C(n.date)}</span><span class="t">${C(n.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${C(e)}</p>`}function Br(i){let e=i.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${C(t.eventKey)}"><span class="n">${C(t.name)}</span><span class="s">${C(t.labels.length?t.labels.join(", "):i.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${C(i.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(i.note?`<p class="sl-pg-pane-note">${C(i.note)}</p>`:"")+(i.total?`<div class="sl-pg-pane-total"><span>${C(i.total.label)}</span><b>${C(i.total.amount)}</b></div>`:"")+(i.holdStatus?`<p class="sl-pg-hold-status" role="status">${C(i.holdStatus)}</p>`:"")}function Fr(i){let e=Math.max(0,i);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function Vr(i,e){if(!i||i.seats<=0)return"";if(e==="same_seat"){let t=i.perPerformance??i.seats;return i.totalPerformances&&i.performances<i.totalPerformances?(0,Ue.tCount)("picker.group.performancesChosenOf",t,{chosen:i.performances,total:i.totalPerformances}):(0,Ue.tCount)("picker.group.seatsEveryPerformance",t)}return i.perPerformance!=null&&i.performancesChosen===i.performances?(0,Ue.tCount)("picker.group.seatsPerPerformance",i.seats,{per:i.perPerformance}):(0,Ue.tCount)("picker.group.performancesChosenOf",i.seats,{chosen:i.performancesChosen,total:i.performances})}function zr(i,e){i.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let n=()=>e(t.dataset.eventKey);t.addEventListener("click",n),t.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),n())})})}var $r=require("@seatlayer/core");function qe(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function jd(i,e){let t=i.objectType==="table"&&!!i.bookingMode,n=i.objectType==="booth",o=t||n||!i.seatNumber,s=o?i.rowLabel??i.displayLabel??i.label:i.seatNumber,r=t?`${b("picker.guests","Guests")} ${i.bookingMode==="variable"?`${i.minOccupancy}\u2013${i.maxOccupancy}`:i.capacity}`:!n&&i.rowLabel?`${e} ${Q(i)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${o?" name":""}">${qe(s)}</span>`+(r?`<span class="sl-tip-row">${qe(r)}</span>`:"")+"</div>"+(i.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${b("picker.section","Section")}</span><span class="sl-tip-secname">${qe(i.sectionLabel)}</span></div>`:"")+"</div>"}function jr(i,e){let t=i.status==="not_for_sale",n=i.mark?.kind==="partial",o=i.status==="free"||n?"":`<span class="sl-tip-tag">${t?b("picker.notAvailable","Not available"):i.status==="held"?(0,$r.t)("map.statusHeld"):b("picker.sold","Sold")}</span>`,s=t?"":e.price,r=s?`<span class="sl-tip-amt">${qe(s)}</span>`:"",a=!s&&e.priceNote?`<div class="sl-tip-note">${qe(e.priceNote)}</div>`:"",l=tt(i,{compact:!0}),c=e.reason?`<div class="sl-tip-reason">${qe(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+jd(i,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${qe(i.categoryColor)}"></span><span class="sl-tip-name">${qe(i.categoryLabel)}</span>`+o+r+"</div>"+a+c+l+(e.extra??"")}function Gr(i,e,t,n){let o=i.x+14,s=i.y-n.height-12,r=i.y+18,a=s;o+n.width>e-8&&(o=i.x-n.width-14),s<8&&r+n.height<=t-8&&(a=r);let l=Math.max(8,t-n.height-8);return{left:Math.max(8,Math.min(o,Math.max(8,e-n.width-8))),top:Math.max(8,Math.min(a,l))}}function Ur(i,e,t,n=22){let o=Math.max(8,Math.min(i.x-t.width/2,Math.max(8,e.width-t.width-8))),s=i.y-n-t.height,r=i.y+n;return s>=8?{left:o,top:s,placement:"above"}:r+t.height<=e.height-8?{left:o,top:r,placement:"below"}:{left:o,top:Math.max(8,Math.min(s<8?r:s,Math.max(8,e.height-t.height-8))),placement:s<8?"below":"above"}}var ro=14,Gd=12,Ud=12,qd=8;function qr(i,e,t,n=Gd){let o=e.height-ro-t.height,s=Ud,r=o-n;if(r<=s)return{placement:"sheet",nudgeY:0};let a=(s+r)/2-i;return Math.abs(a)<=qd?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function Kr(i,e,t,n,o=0){let s=t.width/2+12,r=Math.max(s,Math.min(e.width-s,i.x)),a=i.y+o+t.height+24<=e.height,l=i.y-o<t.height+24&&a?"below":"above",c=l==="above"?i.y-o:i.y+o,d=n&&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 Wr(i,e,t){let n=i.querySelector("[data-pg-select-partial]"),o=[...i.querySelectorAll("[data-pg-event-key]")],s=()=>o.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),r=()=>{if(!n)return;let a=s().length;n.disabled=a===0,n.textContent=e?.(a)??n.textContent};o.forEach(a=>{a.addEventListener("change",r);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,r())})}),n?.addEventListener("click",()=>{let a=s();a.length&&t?.(a)})}function rt(i){let e=i?.displayType?.trim()||i?.rowType?.trim();return e||(i?.objectType==="table"?b("picker.table","Table"):i?.objectType==="booth"?b("picker.booth","Booth"):b("picker.row","Row"))}var Kd="sl-confirm-scrim",Wd="--sl-scrim-mask";function Yd(i){let e=Math.round(i.x),t=Math.round(i.y);return`radial-gradient(circle at ${e}px ${t}px, transparent 0 56px, #000 88px)`}function Yr(i,e,t,n){let o=i??document.createElement("div");return i||(o.className=Kd),o.style.setProperty(Wd,Yd(n)),t.parentNode===e?o.nextSibling!==t&&e.insertBefore(o,t):o.parentNode!==e&&e.appendChild(o),o}function ao(i){return i?.remove(),null}var Xr={passport:!1,compare:!1},Xd=360,Zd=160,Qd=700,Zr=450;function Qr(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function Jd(i){return(0,Jr.contrastRatio)("#ffffff",i)>=3?"#ffffff":"#0b0f19"}var un=class{constructor(e){this.el=null;this.seat=null;this.outsideTap=null;this.scrim=null;this.shownAt=0;this.lift=null;this.framing=null;this.mode="add";this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let n=Nt(e)?e.viewUrl??"":"",o=nn(t);if(!n&&!o)return"";let s=n?null:on(e,e.focalPoint??t.focalPoint);if(!n&&s==null)return"";let r="";if(!n)return r;let a=F((0,Dt.t)("picker.viewFromSeat",{label:e.label})),l=F(this.host.tf("picker.viewFromHere","View from here"));return`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${a}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${l}</span></button>`+r}show(e,t="add"){let n=this.host;this.mode=t;let o=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,n.root()?.setAttribute("data-confirming","true"),n.els().side?.toggleAttribute("inert",!0),Object.values(n.regions()).forEach(E=>E.toggleAttribute("inert",!0)),n.controller.setSelectionFocus(e.id),o&&o!==e.id&&n.controller.deselect([o]),n.hideTooltip();let s=n.controller.seatDetails(e.id),r=n.controller.doc?.categories.find(E=>E.key===e.categoryKey),a=s?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),l=a!=null?n.paidPrice(e.categoryKey,s?.tierId??r?.tiers?.[0]?.id??null,a,e.label):void 0,c=as(s,e.displayLabel??e.label,rt(s)),d=s?.tiers??r?.tiers??[],p=s?.tierId??d[0]?.id,m=n.suppressPricing()?"":ps(d,p,E=>n.money(n.paidPrice(e.categoryKey,E.id,E.price,e.label)),E=>n.offerName(e.categoryKey,E.id)),h=n.buyerView()==="venue3d",y=n.performanceGroup()?.confirmDateSelection??void 0,f=y?n.performanceGroup()?.nights?.()??[]:[],T=y?Rr(f,y,e.id,(E,D)=>n.tf(E,D)):"";this.shownAt=performance.now();let w=document.createElement("div");w.className="sl-confirm sl-mo-in",t==="remove"&&w.classList.add("sl-confirm-removing"),T&&w.classList.add("sl-confirm-group-dates"),w.setAttribute("role","dialog"),w.setAttribute("aria-label",(0,Dt.t)("picker.confirmSeatLabel",{label:e.label}));let v=n.controller.getRenderer?.()?.categoryDisplayColor?.(e.categoryKey)??r?.color??"#6e7bff";w.style.setProperty("--sl-cat",v),w.style.setProperty("--sl-cat-ink",Jd(v));let A=String(s?.categoryLabel??r?.label??e.categoryKey),_=n.controller.categoryAvailability()[e.categoryKey],q=typeof _=="number"&&_>0?(0,Dt.tCount)("picker.leftCount",_):"",g=n.suppressPricing()?`${s?.displayLabel??e.displayLabel??e.label}`:`${s?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?n.tf("picker.priceNotSupplied","Price not supplied"):n.money(l)}`,L=Xr.passport?rs(e,g,h):"",N=Xr.compare?ss(e,h?n.view3dCompareSeatIds():null):"";w.innerHTML=hs({identityFields:c,identity:ls(s,e.displayLabel??e.label,rt(s)),marker:os({...s?.wheelchairSpaceType?{wheelchairSpaceType:s.wheelchairSpaceType}:{}}),see3dPill:cs(n.canOffer3d(),h),categoryColor:v,categoryLabel:A,priceLabel:!n.suppressPricing()&&l!=null?n.money(l):"",categoryLeftLabel:q,tierChoices:m,groupDates:T,wheelchair:"",commercial:tt({...e.accessibility?.length?{accessibility:e.accessibility}:{},...s?.wheelchairSpaceType?{wheelchairSpaceType:s.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{}}),thumb:n.seatViewEnabled()&&n.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:h?`<div class="sl-confirm-inspect-row">${L}${N}${Nn(n.canOffer3d(),h)}</div>`:Nn(n.canOffer3d(),h),see3dRow:ds(n.canOffer3d(),h),cancelLabel:(0,Dt.t)("common.cancel"),selectLabel:t==="remove"?n.tf("picker.removeSeat","Remove seat"):n.addSeatLabel(s?.objectType)}),t==="remove"&&w.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),n.els().map.appendChild(w),this.el=w;let R=w.querySelector(".sl-confirm-thumb"),O=R?.closest(".sl-confirm-thumbwrap")??null;if(R&&O){let E=!1,D=()=>{if(E||!O.isConnected)return;E=!0;let j=()=>{O.remove(),this.el===w&&n.reanchor()};if(n.reducedMotion()||typeof requestAnimationFrame!="function"){j();return}O.style.height=`${O.offsetHeight}px`,O.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{O.style.height="0px",O.style.opacity="0"}),setTimeout(j,Zd)};R.addEventListener("error",D),R.addEventListener("load",()=>{R.naturalWidth||D()});let z=e.viewMeta?.previewUrl??e.viewUrl;z?n.resolveAssetUrl(z).then(j=>{if(!(!w.isConnected||this.el!==w)){if(!j){D();return}R.src=j}}).catch(j=>{D(),n.onError(j)}):D()}n.reanchor(),this.liftSeatClearOfSheet(e),w.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{n.openSeatView(e)}),w.querySelector(".sl-confirm-confidence")?.addEventListener("click",E=>{n.openSeatConfidencePassport(e,E.currentTarget instanceof HTMLElement?E.currentTarget:null)}),w.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>n.saveView3dComparisonSeat(e)),w.querySelectorAll("[data-confirm-tier]").forEach(E=>{E.addEventListener("click",()=>{let D=E.dataset.confirmTier,z=d.find(X=>X.id===D);if(!z)return;n.controller.setSeatTier(e.id,z.id),w.querySelectorAll("[data-confirm-tier]").forEach(X=>{X.setAttribute("aria-pressed",String(X===E))});let j=w.querySelector("[data-confirm-offer]");if(j){let X=E.dataset.offerName;j.hidden=!X,j.innerHTML=X?kt(X,F):""}let de=w.querySelector(".sl-confirm-price");de&&(de.textContent=n.money(n.paidPrice(e.categoryKey,z.id,z.price,e.label))),n.reanchor()})}),w.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(E=>{E.addEventListener("pointerdown",Ai,{once:!0}),E.addEventListener("click",()=>{n.buyerView()==="venue3d"?(n.dismiss(),n.view3dHandle()?.flyToSeat(e.id)):(n.rememberView3dReturnSeat(e),n.dismiss(),n.enter3d(e.id))})}),Or(w,y,(E,D)=>n.tf(E,D),()=>n.reanchor()),w.querySelector(".sl-confirm-add").addEventListener("click",()=>{if(!this.ghostActivation()){if(this.mode==="remove"){this.removeCommitted();return}this.commit()}}),w.querySelector(".sl-confirm-cancel").addEventListener("click",()=>{this.ghostActivation()||this.cancel()}),this.armOutsideTap(w),requestAnimationFrame(()=>{let E=w.querySelector(".sl-confirm-add");E?.focus(),n.liftToastOverConfirm(),n.fitTranslatedRows(),n.inviteCommit(w,E)})}liftSeatClearOfSheet(e){let t=this.host.controller.getRenderer();this.framing={gestures:t?.getCameraGestureCount?.()??0,quietUntil:0},this.frameSeatForSheet(e)}frameSeatForSheet(e){let t=this.host,n=t.root();if(!this.el||n?.dataset.layout!=="narrow"||n?.dataset.view3d==="on")return;let o=t.els().map;if(!o)return;let s=t.controller.worldToScreen({x:e.x,y:e.y}),r=t.controller.getRenderer(),a=r?.getCameraGestureCount?.()??0,{nudgeY:l}=qr(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()+Qd:0)}reframeSeatForSheet(){let e=this.framing,t=this.seat;!e||!t||e.quietUntil&&this.now()<e.quietUntil||(this.host.controller.getRenderer()?.getCameraGestureCount?.()??e.gestures)!==e.gestures||this.frameSeatForSheet(t)}now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}settleLift(){let e=this.lift;if(this.lift=null,this.framing=null,!e)return;let t=this.host.controller.getRenderer();(t?.getCameraGestureCount?.()??e.gestures)===e.gestures&&t?.panScreenBy?.({x:0,y:-e.dy},{animate:!this.host.reducedMotion()})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),n=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=Yr(this.scrim,n,this.el,t),Ps(this.el,t,n),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=ao(this.scrim);let o=n.clientWidth,s=n.clientHeight,r=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=e.controller.seatScreenRadius()*1.5,d=Kr(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`,$i(this.el,t,{left:d.left,top:d.top,width:r,height:a})}ghostActivation(){return Qr()?performance.now()-this.shownAt<Zr:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,n=s=>{if(this.el!==e){this.disarmOutsideTap();return}let r=s.target;!r||e.contains(r)||t.els().tray?.contains(r)||this.cancel()};this.outsideTap=n;let o=t.root();setTimeout(()=>{this.outsideTap===n&&(o??document).addEventListener("pointerdown",n,!0)},Qr()?Zr: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=ao(this.scrim),this.settleLift(),this.el&&ji(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 _r(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);Wn(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,Xd)}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 n=e.releaseHeldSeat(t);n||e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0})}};function ea(i,e,t){if(!e||t||i.classList.contains("sl-confirm-removing"))return;e.classList.add("sl-confirm-add-invite");let n=()=>e.classList.remove("sl-confirm-add-invite");i.addEventListener("pointerdown",n,{once:!0}),i.addEventListener("keydown",n,{once:!0}),e.addEventListener("focus",n,{once:!0})}function ta(i,e){return i&&i!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}var ia=require("@seatlayer/core"),Bt=require("@seatlayer/core/picker/minimapGeometry");function ep(i){let e={inactive:0,available:1,selected:2},t=new Map;for(let o of i){let s=t.get(o.id);(!s||e[o.state]>e[s])&&t.set(o.id,o.state)}let n={selected:0,available:0,inactive:0};for(let o of t.values())n[o]+=1;return n}function tp(i,e){return i.x<=e.x&&i.y<=e.y&&i.x+i.width>=e.x+e.width&&i.y+i.height>=e.y+e.height}function na(i,e){let t=new lo(i);return t.build(e),t}var lo=class{constructor(e){this.host=e;this.miniCanvas=null;this.miniBase=null;this.miniWrap=null;this.miniToggle=null;this.miniLabel=null;this.miniTf=null;this.miniDrag=null;this.miniSuppressClick=!1;this.userClosed=!1}dispose(){this.miniToggle?.remove(),this.miniWrap?.remove(),this.miniToggle=null,this.miniWrap=null,this.miniCanvas=null,this.miniBase=null,this.miniLabel=null,this.miniTf=null,this.miniDrag=null,this.host.root()?.removeAttribute("data-minimap-open")}build(e){if(!this.host.controller.getViewport())return;let n=document.createElement("button");n.type="button",n.className="sl-minimap-toggle",n.setAttribute("aria-label",b("picker.openVenueMap","Open venue overview map")),n.setAttribute("aria-expanded","false"),n.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 6l5-2 8 3 5-2v13l-5 2-8-3-5 2zM8 4v13M16 7v13"/></svg>',e.appendChild(n),this.miniToggle=n;let o=document.createElement("div");o.className="sl-minimap",o.setAttribute("role","group");let s=document.createElement("div");s.className="sl-minimap-bar";let r=document.createElement("span");r.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",b("picker.minimapStateKey","Focused, selected, available, and inactive sections")),a.innerHTML='<i class="focused" title="Focused"></i><i class="selected" title="Selected"></i><i title="Available"></i><i class="inactive" title="Inactive"></i>';let l=document.createElement("button");l.type="button",l.className="sl-minimap-close",l.setAttribute("aria-label",b("picker.closeVenueMap","Close venue overview map")),l.textContent="\xD7",s.append(r,a,l);let c=document.createElement("canvas");c.tabIndex=0,c.setAttribute("role","application"),c.setAttribute("aria-label",b("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),o.append(s,c),e.appendChild(o),this.miniWrap=o,this.miniLabel=r,this.miniCanvas=c;let d=document.createElement("canvas");this.miniBase=d,n.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,n=this.host.controller.getViewport()?.bounds;if(!e||!t||!n||!(n.width>0&&n.height>0))return;let o=196,s=146,r=6,a=n.width/Math.max(1,n.height),l=o,c=Math.round(o/a);c>s&&(c=s,l=Math.round(s*a)),l=Math.max(64,l),c=Math.max(48,c);let d=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*d),e.height=Math.round(c*d),e.style.width=`${l}px`,e.style.height=`${c}px`,t.width=e.width,t.height=e.height,this.miniTf=(0,Bt.createMinimapTransform)(n,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"),n=this.host.controller.getMinimapSnapshot().sections,s=n.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}=ep(n);this.miniWrap.setAttribute("aria-label",n.length?`${r}. ${a} selected, ${l} available, ${c} inactive sections.`:r),this.miniCanvas?.setAttribute("aria-label",n.length?`${r}. ${a} selected, ${l} available, ${c} inactive sections. ${b("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${r}. ${b("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click elsewhere, or use arrow keys to pan.")}`)}refreshMinimap(){this.miniBase&&(this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect())}drawMinimapStatic(){let e=this.miniBase,t=this.miniTf;if(!e||!t)return;let n=e.getContext("2d");if(!n)return;n.clearRect(0,0,e.width,e.height);let o=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;n.beginPath(),p.outline.forEach((h,y)=>y===0?n.moveTo(o(h.x),s(h.y)):n.lineTo(o(h.x),s(h.y))),n.closePath();let m=p.paint;if(n.globalAlpha=p.state==="inactive"?.5:.92,m?n.fillStyle=m.fill:(n.globalAlpha=p.state==="inactive"?.18:p.state==="selected"?.72:.34,n.fillStyle=p.state==="inactive"?a:p.state==="selected"?l:c),n.fill(),n.globalAlpha=.82,n.lineWidth=Math.max(1,t.dpr),n.strokeStyle=m?.stroke||r,n.stroke(),p.owned){n.globalAlpha=1,n.lineWidth=Math.max(2,t.dpr*1.5),n.strokeStyle=l,n.stroke();let h=p.outline.reduce((y,f)=>({x:y.x+f.x,y:y.y+f.y}),{x:0,y:0});n.beginPath(),n.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),n.fillStyle=l,n.fill(),n.beginPath(),p.outline.forEach((y,f)=>f===0?n.moveTo(o(y.x),s(y.y)):n.lineTo(o(y.x),s(y.y))),n.closePath()}p.active&&(n.globalAlpha=1,n.lineJoin="round",n.lineWidth=Math.max(4,t.dpr*3.5),n.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",n.stroke(),n.lineWidth=Math.max(2,t.dpr*1.75),n.strokeStyle=l,n.stroke())}if(n.globalAlpha=1,!d.sections.length){let p=Math.max(1,t.dpr),m=this.host.controller.getRenderer?.(),h=new Map,y=f=>{let T=h.get(f);if(T)return T;let w=m?.categoryDisplayColor?.(f)||c;return h.set(f,w),w};for(let f of d.seats)n.globalAlpha=f.state==="inactive"?.22:.78,n.fillStyle=f.state==="inactive"?a:f.state==="selected"?l:y(f.categoryKey),n.beginPath(),n.arc(o(f.x),s(f.y),p,0,Math.PI*2),n.fill();n.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,t=this.miniBase,n=this.miniTf;if(!e||!t||!n)return;let o=e.getContext("2d");if(!o)return;o.clearRect(0,0,e.width,e.height),o.drawImage(t,0,0);let s=this.host.controller.getViewport();if(!s||tp(s.visible,s.bounds))return;let r=(0,Bt.minimapViewportPlan)(s.visible,n,e.width,e.height,Math.max(2,n.dpr*2)),a=this.host.cssVar("--sl-text")||"#12151c",l=this.host.cssVar("--sl-surface")||"#fff";o.save(),o.globalAlpha=.1,o.fillStyle=a,o.fillRect(r.raw.x,r.raw.y,r.raw.width,r.raw.height),o.globalAlpha=.9,o.lineJoin="round",o.lineWidth=Math.max(4,n.dpr*3.25),o.strokeStyle=l,o.strokeRect(r.raw.x,r.raw.y,r.raw.width,r.raw.height),o.globalAlpha=1,o.lineWidth=Math.max(2,n.dpr*1.75),o.strokeStyle=a,o.strokeRect(r.raw.x,r.raw.y,r.raw.width,r.raw.height),r.clipped&&Object.values(r.clippedEdges).some(Boolean)&&(o.setLineDash([Math.max(3,n.dpr*3),Math.max(2,n.dpr*2)]),o.strokeRect(r.clipped.x,r.clipped.y,r.clipped.width,r.clipped.height)),o.restore()}minimapWorldPoint(e){let t=this.miniCanvas,n=this.miniTf;if(!t||!n)return null;let o=t.getBoundingClientRect(),s=(e.clientX-o.left)*(t.width/Math.max(1,o.width)),r=(e.clientY-o.top)*(t.height/Math.max(1,o.height));return{...(0,Bt.minimapPointToWorld)({x:s,y:r},n),px:s,py:r}}minimapPointerDown(e){let t=this.minimapWorldPoint(e),n=this.host.controller.getViewport()?.visible;!t||!n||!(t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:t.x-(n.x+n.width/2),offsetY:t.y-(n.y+n.height/2),startX:e.clientX,startY:e.clientY,moved:!1},this.miniCanvas?.setPointerCapture(e.pointerId),this.miniCanvas?.classList.add("sl-dragging"),e.preventDefault())}minimapPointerMove(e){let t=this.miniDrag;if(!t||t.pointerId!==e.pointerId)return;let n=this.minimapWorldPoint(e);n&&(!t.moved&&Math.hypot(e.clientX-t.startX,e.clientY-t.startY)>2&&(t.moved=!0,this.host.controller.clearSectionFocus()),this.host.controller.panToWorld({x:n.x-t.offsetX,y:n.y-t.offsetY}),e.preventDefault())}minimapPointerUp(e){let t=this.miniDrag;!t||t.pointerId!==e.pointerId||(this.miniSuppressClick=t.moved,this.miniDrag=null,this.miniCanvas?.classList.remove("sl-dragging"),this.miniCanvas?.hasPointerCapture(e.pointerId)&&this.miniCanvas.releasePointerCapture(e.pointerId))}minimapKeydown(e){let t=this.host.controller.getViewport()?.visible;if(!t)return;if(e.key==="Home"){this.host.controller.overview(),e.preventDefault();return}let n=e.key==="ArrowLeft"?-t.width*.2:e.key==="ArrowRight"?t.width*.2:0,o=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!n&&!o||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+n,y:t.y+t.height/2+o}),e.preventDefault())}minimapJump(e){let t=this.minimapWorldPoint(e);if(t){for(let n of this.host.controller.getMinimapSnapshot().sections)if(!(n.state==="inactive"||n.outline.length<3)&&(0,ia.pointInPolygon)(t,n.outline)){this.host.controller.focusSection(n.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var mn=require("@seatlayer/core");var ip=12;function oa(i,e){let t=e.floors(),n=new Set(t.map(g=>g.label.trim().toLocaleLowerCase())),o=e.zones().filter(g=>g.seatCount>0&&!n.has(g.label.trim().toLocaleLowerCase())),s=e.sections().filter(g=>g.seatCount>0&&!n.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,m=document.createElement("button");m.type="button",m.className="sl-view3d-nav-toggle",m.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");m.innerHTML=h,m.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"]'),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")},w=g=>{d.classList.toggle("is-open",g),m.setAttribute("aria-expanded",String(g)),g&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(f),y.textContent=T()};m.addEventListener("click",()=>w(!d.classList.contains("is-open"))),d.addEventListener("keydown",g=>{g.key!=="Escape"||!d.classList.contains("is-open")||(g.preventDefault(),g.stopPropagation(),w(!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",()=>{w(!1),m.focus()}),w(!1),d.appendChild(m);let _=g=>{},q=g=>{};if(a){let g=document.createElement("div");g.setAttribute("role","group"),g.setAttribute("aria-label",b("picker.levels","Levels"));let L=[];q=O=>{L.forEach(E=>{E.setAttribute("aria-pressed",String((E.dataset.floor===""?null:Number(E.dataset.floor))===O))})};let N=O=>{e.focusFloor(O)&&(q(O),_(O))},R=(O,E)=>{let D=document.createElement("button");D.type="button",D.textContent=O,D.dataset.floor=E===null?"":String(E),D.setAttribute("aria-pressed",String(E===null)),D.addEventListener("click",()=>{N(E),w(!1)}),L.push(D),g.appendChild(D)};R(b("picker.allLevels","All levels"),null);for(let O of t)R(O.label||(0,mn.t)("picker.levelNumber",{number:O.index+1}),O.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(R=>({id:R.id,label:R.label||R.id,go:()=>{e.focusZone(R.id)}})):r.map(R=>({id:R.id,label:R.label||R.id,floorIndex:R.floorIndex,go:()=>{e.focusSection(R.id),Number.isFinite(R.floorIndex)&&q(R.floorIndex)}})),N=R=>{let O=l||R===null?L:L.filter(E=>E.floorIndex===void 0||E.floorIndex===R);if(g.replaceChildren(),!O.length){g.remove();return}if(g.isConnected||d.insertBefore(g,v.isConnected?v:null),!l&&O.length>ip){let E=document.createElement("select");E.setAttribute("aria-label",b("picker.jumpToSection","Jump to section"));let D=document.createElement("option");D.value="",D.textContent=b("picker.jumpToSection","Jump to section"),E.appendChild(D);for(let z of O){let j=document.createElement("option");j.value=z.id,j.textContent=z.label,E.appendChild(j)}E.addEventListener("change",()=>{O.find(z=>z.id===E.value)?.go()}),g.appendChild(E);return}for(let E of O){let D=document.createElement("button");D.type="button",D.textContent=E.label,D.dataset.area=E.id,D.addEventListener("click",()=>{p=E.label,E.go(),w(!1)}),g.appendChild(D)}};_=N,N(null)}return d.appendChild(v),i.appendChild(d),d}var fn=class{constructor(e){this.host=e;this.chip=null}sync(){let e=this.host.overlay();if(!e||this.host.savedSeatIds().length===0){this.chip?.remove(),this.chip=null;return}let t=this.chip;if(!t){t=document.createElement("div"),t.className="sl-view3d-compare-saved",t.setAttribute("role","group"),t.setAttribute("aria-label",b("picker.savedSeatComparison","Saved seat comparison"));let s=document.createElement("button");s.type="button",s.className="main",s.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(b("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let r=document.createElement("button");r.type="button",r.className="clear",r.textContent="\xD7",r.setAttribute("aria-label",b("picker.clearSavedSeatComparison","Clear saved seat comparison")),r.addEventListener("click",()=>this.host.clearComparison()),t.append(s,r),e.appendChild(t),this.chip=t}let n=this.host.savedSeatIds().length,o=t.querySelector(".main");o&&(o.textContent=n>1?(0,mn.t)("picker.compareCount",{count:n}):b("picker.oneSeatSaved","1 seat saved"),o.setAttribute("aria-label",n>1?(0,mn.t)("picker.openComparisonOfSeats",{count:n}):b("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function sa(i){return!i?.querySelector('[data-ref="zfs"]')}var ra="sl:sheet-hint";function aa(i){let e=i.boot;if(!e?.isConnected)return;if(i.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),i.map?.appendChild(t),setTimeout(()=>t.remove(),650),i.rail?.classList.add("is-in"),i.root?.classList.add("is-arriving"),setTimeout(()=>{i.rail?.classList.remove("is-in"),i.root?.classList.remove("is-arriving"),np(i.root)},900)}function np(i){if(!i||i.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(ra))return;window.sessionStorage.setItem(ra,"1")}catch{}let e=i.querySelector(".sl-sheet-toggle");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function la(i,e){i.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let n of e())if(n.open()){t.preventDefault(),t.stopPropagation(),n.close();return}}})}function gn(i){let e=i.committedSelection(),t=i.controller.getGAAreas(),n=i.hold?.items??[],o=new Set(n.map(m=>m.label)),s=_s(i,t,n),r=je(i.gaQty,n),a=n.reduce((m,h)=>m+i.paidPrice(h.categoryKey,h.tierId,h.unitPrice,h.label)*(h.quantity??1),0),l=n.reduce((m,h)=>m+(h.quantity??1),0),c=e.filter(m=>!o.has(m.label)),d=c.reduce((m,h)=>m+i.paidPrice(h.categoryKey,h.tierId??null,h.price,h.label)*(h.quantity??1),0)+s+a,p=c.reduce((m,h)=>m+(h.quantity??1),0)+r+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:n,heldLabels:o,heldCount:l,total:d,count:p}}function bn(i,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:i.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function yn(i,e){let t=e.tiers?.length?e.tiers.map(n=>i.paidPrice(e.key,n.id??null,n.price)):e.price==null?[]:[i.paidPrice(e.key,null,e.price)];if(e.key)for(let n of i.pricesByChannel.values())for(let o of n)o.categoryKey===e.key&&t.push(o.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var di="seatlayer_";function op(){let i=globalThis;return i.document?.modelContext??i.navigator?.modelContext??null}function ge(i,e){return e?{ok:!1,reason:i,message:e}:{ok:!1,reason:i}}function sp(i){return Array.isArray(i)?i.filter(e=>typeof e=="string"&&!!e):[]}function rp(i,e){let t=i.event();if(!t)return ge("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits();return{ok:!0,event:t,selection:{max:n.max,...n.required!=null?{required:n.required}:{}},categories:i.categories(),zones:i.zones(),hasPremiumSeats:i.hasPremiumSeats(),holdsAllowed:e}}function ca(i,e){let t=o=>!!o&&o.toLowerCase()===e.toLowerCase(),n=i.find(o=>t(o.key??o.id))??i.find(o=>t(o.label));return n?.key??n?.id??null}function da(i,e){let t=e.map(n=>i.describeSeat(n.id));return{seatIds:e.map(n=>n.id),labels:e.map(n=>n.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((n,o)=>t[o]?.seat||n.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((n,o)=>n+o.price,0)}}function ap(i,e,t){let n=new Map;for(let s of e){let r=n.get(s.rowKey);r?r.push(s):n.set(s.rowKey,[s])}let o=[];for(let s of n.values()){let r=[...s].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=r.length;l++)if(l===r.length||r[l].index!==r[l-1].index+1||r[l].categoryKey!==r[l-1].categoryKey){for(let d=a;d+t<=l;d+=t)o.push(da(i,r.slice(d,d+t)));a=l}}return o}function lp(i,e,t){let n=new Map;for(let s of e){let r=n.get(s.sectionKey);r?r.push(s):n.set(s.sectionKey,[s])}let o=[];for(let s of n.values()){if(s.length<t)continue;let r=[...s].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);o.push(da(i,r.slice(0,t)))}return o}function cp(i,e){if(!i.event())return ge("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits(),o=Math.floor(Number(e.count));if(!Number.isInteger(o)||o<1||o>n.max)return ge("bad_count",`count must be a whole number between 1 and ${n.max}.`);let s=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,r=e.together===void 0?!0:!!e.together,a=typeof e.max_price=="number"&&Number.isFinite(e.max_price)?e.max_price:null,l=typeof e.category=="string"&&e.category?e.category:null,c=typeof e.zone=="string"&&e.zone?e.zone:null,d=l?ca(i.categories(),l):null;if(l&&!d)return ge("no_match",`No ticket type called "${l}".`);let p=c?ca(i.zones(),c):null;if(c&&!p)return ge("no_match",`No zone called "${c}".`);let m=i.seats().filter(f=>f.available);if(!m.length)return ge("sold_out");let h=m.filter(f=>(!d||f.categoryKey===d)&&(!p||f.zoneId===p)&&(a==null||f.price<=a));if(!h.length)return ge("no_match");let y=r?ap(i,h,o):lp(i,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}}}):ge(r?"not_enough_together":"no_match")}function pa(i){return{ok:!0,...i.selection()}}function dp(i,e){let t=i.event();if(!t)return ge("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return ge("event_closed","Sales are closed for this event.");let n=sp(e.seat_ids);return n.length?(i.clearSelection(),i.selectObjects(n),pa(i)):ge("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function pp(i,e){let t=async o=>{try{return await o()}catch(s){return ge("error",s instanceof Error?s.message:String(s))}},n=[{name:`${di}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(()=>rp(i,e))},{name:`${di}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(()=>cp(i,o))},{name:`${di}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(()=>dp(i,o))},{name:`${di}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(()=>pa(i))}];return e&&n.push({name:`${di}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>i.hold())}),n}async function ha(i,e={}){let t=op();if(!t||typeof t.registerTool!="function")return null;let n=new AbortController,o=pp(i,!!e.holds),s=[],r=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of o)await t.registerTool(a,{signal:n.signal,...r?{exposedTo:r}:{}}),s.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return s.length?{names:s,dispose:()=>{if(n.abort(),typeof t.unregisterTool=="function")for(let a of s)try{t.unregisterTool(a)}catch{}}}:null}async function ua(i){let e=i.opts.webMcp;if(!e||i.destroyed)return;let t=typeof e=="object"&&!!e.holds,n=typeof e=="object"?e.exposedTo:void 0;try{i.webMcp=await ha(po(i,t),{holds:t,exposedTo:n}),i.destroyed&&co(i)}catch(o){console.warn("seatmap: WebMCP registration failed",o)}}function co(i){i.webMcp?.dispose(),i.webMcp=null}function po(i,e){let t=(n,o)=>{if(Number.isInteger(n.logicalSeatIndex))return n.logicalSeatIndex;let s=n.id.lastIndexOf(":"),r=s<0?NaN:Number(n.id.slice(s+1));return Number.isFinite(r)?r:o};return{event:()=>{let n=i.renderInfo;return n?{name:n.eventName??"",venue:n.venue??null,startsAt:n.startsAt??null,timezone:n.timezone??null,currency:i.currency,salesClosed:i.salesClosed}:null},selectionLimits:()=>({max:i.maxTickets,required:i.exactTickets}),categories:()=>{let n=i.controller.categoryAvailability();return(i.controller.doc?.categories??[]).filter(o=>!o.notForSale).map(o=>{let s=yn(i,o),r=bn(i,o);return{key:o.key,label:o.label??o.key,...r===void 0?{}:{price:r},...s&&s.min!==s.max?{priceRange:s}:{},available:n[o.key]??0}})},zones:()=>i.controller.getBestAvailableZones(),hasPremiumSeats:()=>i.controller.hasPremiumSeats(),seats:()=>{let n=i.controller.getActiveFloorId(),o=[];return i.allSeats().forEach((s,r)=>{if(s.floorId&&n&&s.floorId!==n)return;let a=i.controller.getStatus(s.id)??"free",l=i.controller.doc?.categories.find(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:i.paidPrice(s.categoryKey,l?.tiers?.[0]?.id??null,c,s.label),...s.zoneId?{zoneId:s.zoneId}:{},available:a==="free"&&!l?.notForSale})}),o},describeSeat:n=>{let o=i.controller.seatDetails(n);return o?{section:o.sectionLabel??"",row:Q(o)??"",seat:o.seatNumber??o.label,category:o.categoryLabel??o.categoryKey}:null},selection:()=>{let{freshSeats:n,total:o,count:s}=gn(i);return{seats:n.map(r=>({id:r.id,label:r.label,section:r.sectionLabel??"",row:Q(r)??"",seat:r.seatNumber??r.label,category:r.categoryKey,price:i.paidPrice(r.categoryKey,r.tierId??null,r.price,r.label)})),count:s,total:o,currency:i.currency,hold:i.hold?{id:i.hold.holdId,expiresAt:i.hold.expiresAt}:null,validity:i.getSelectionValidity()}},clearSelection:()=>i.clearSelection(),selectObjects:n=>{i.selectObjects(n)},hold:()=>e?hp(i):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function hp(i){if(i.salesClosed)return{ok:!1,reason:"event_closed"};if(!i.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=i.controller.getSelectionValidity(i.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await i.handleCta(),i.hold?{ok:!0,hold:{id:i.hold.holdId,expiresAt:i.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function ho(i){return{renderingTimeMillis:i.ms,performanceProfile:i.performanceProfile,seatCount:i.seatCount,objectCount:i.objectCount,sectionCount:i.sectionCount,view:i.view,eventKey:i.eventKey,chartName:i.chartName,floorCount:i.floorCount,transport:i.transport,load:i.load,metricScope:i.metricScope,operationalTelemetryReporter:"sdk"}}function ma(i,e){Ae({apiBase:i.apiBase,event:i.eventKey,scope:i.metricScope,surface:i.surface,outcome:"success",ms:i.ms,performanceProfile:i.performanceProfile,seats:i.seatCount,floors:i.floorCount,view:i.view,load:i.load,transport:i.transport}),e("chart_rendered",ho(i))}var fa=require("@seatlayer/core/core/seatConfidence");function ae(i){return String(i??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function ga(i){let e=(0,fa.seatConfidenceDisclosure)(i.seat.confidenceEvidence),t=i.seat.confidenceEvidence,n=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${ae(c)}</li>`).join("")}</ul>`:"",o=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${ae(e.modeledTarget)}</dd></div>`:"",s=t?`<div><dt>Evidence ID</dt><dd>${ae(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${ae(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${ae(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${ae(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${ae(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",r=Ri(i.seat.commercial).join(" \xB7 ")||i.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${ae(r)}</dd></div>`+(i.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${ae(i.seat.commercial.note)}</dd></div>`:""),l=i.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${ae(i.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${ae(e.headline)}</strong><span>${ae(e.coverage)} \xB7 ${ae(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${ae(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${ae(e.reality)}</dd></div><div><dt>Source</dt><dd>${ae(e.provenance)}</dd></div>`+a+o+s+`</dl>${n}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function ba(i){return i?i.closest("[data-report]")?"report":i.closest("[data-close]")||i.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function vn(i,e,t){let n=i?.querySelector("[data-report]"),o=i?.querySelector("[data-report-status]");n&&(n.disabled=e!=="failed",n.textContent=e==="received"?"Report received":"Report this view"),o&&(o.setAttribute("role",e==="failed"?"alert":"status"),o.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function uo(i,e,t=null){let n=i.view3dEl;if(!n)return;pi(i,!1);let o=e.confidenceEvidence,s=i.controller.seatDetails(e.id),r=document.createElement("div");r.className="sl-view3d-passport-shell",r.innerHTML=ga({seat:e,title:s?.displayLabel??e.displayLabel??e.label,restrictionFallback:i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof i.api.reportViewEvidence=="function"});let a=[...new Set([...n.children,...[...i.els.map.children].filter(m=>m!==n)])].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");n.appendChild(r),n.classList.add("has-passport"),i.view3dPassportEl=r;let c=r.querySelector(".sl-view3d-passport"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],p=m=>{if(m.key==="Escape"){m.preventDefault(),m.stopPropagation(),m.stopImmediatePropagation(),pi(i);return}if(m.key!=="Tab")return;let h=d();if(!h.length)return;let y=h[0],f=h[h.length-1];m.shiftKey&&document.activeElement===y?(m.preventDefault(),f.focus()):!m.shiftKey&&document.activeElement===f&&(m.preventDefault(),y.focus())};window.addEventListener("keydown",p,!0),i.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 m=t?.isConnected?t:i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareEl?.querySelector("[data-passport-seat]")??null,h=m?.closest(".sl-confirm,.sl-view3d-compare");h?.isConnected&&(h.inert=!1,h.removeAttribute("aria-hidden")),r.remove(),n.classList.remove("has-passport"),i.view3dPassportEl===r&&(i.view3dPassportEl=null);let y=m??i.view3dCompareEl?.querySelector("[data-passport-seat]")??i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareChip.mainButton();(t?.isConnected?t:y)?.focus()},r.addEventListener("click",m=>{let h=ba(m.target instanceof HTMLElement?m.target:null);h==="close"&&pi(i),h==="report"&&up(i,e)}),requestAnimationFrame(()=>d()[0]?.focus()),i.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:o?.evidenceId??null,eventConfigurationId:o?.eventConfigurationId??null,modelLevel:o?.modelLevel??"unverified",realityLevel:o?.realityLevel??"none"})}async function up(i,e){if(i.api.reportViewEvidence){vn(i.view3dPassportEl,"sending");try{let t=await i.api.reportViewEvidence(i.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});i.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),vn(i.view3dPassportEl,"received",t.report.id)}catch{vn(i.view3dPassportEl,"failed")}}}function pi(i,e=!0){let t=i.view3dPassportCleanup;if(i.view3dPassportCleanup=null,!t){i.view3dPassportEl?.remove(),i.view3dPassportEl=null,i.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function ya(i){let e=i.view3dEl;if(!e||i.view3dCompareSeatIds.length<2)return;at(i,!1);let t=i.view3dCompareSeatIds.map(h=>i.view3dComparisonSnapshot(h)).filter(h=>!!h);if(t.length<2){i.clearView3dComparison();return}let n=h=>C(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>${n(h.label)}</strong><small>Section ${n(h.section)} \xB7 Row ${n(h.row)}</small><dl>`+(o?`<div><dt>Current price</dt><dd>${n(h.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${n(h.category)}</dd></div><div><dt>Availability</dt><dd>${n(h.availability)}</dd></div><div><dt>View source</dt><dd>${n(h.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${n(h.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${n(h.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${n(h.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${n(h.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${n(h.seat.id)}">Passport</button><button type="button" data-view-seat="${n(h.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${n(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"),i.view3dCompareEl=s;let d=s.querySelector(".sl-view3d-compare"),p=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],m=h=>{if(h.key==="Escape"){h.preventDefault(),at(i);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",m),i.view3dCompareCleanup=()=>{window.removeEventListener("keydown",m);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"),i.view3dCompareEl===s&&(i.view3dCompareEl=null),a?.isConnected?a.focus():i.view3dCompareChip.mainButton()?.focus()},s.querySelector("[data-close]")?.addEventListener("click",()=>at(i)),s.querySelectorAll("[data-passport-seat]").forEach(h=>h.addEventListener("click",()=>{let y=h.dataset.passportSeat,f=y?i.allSeats().find(T=>T.id===y):void 0;f&&uo(i,f,h)})),s.querySelectorAll("[data-view-seat]").forEach(h=>h.addEventListener("click",()=>{let y=h.dataset.viewSeat;at(i,!1),y&&i.view3dHandle?.flyToSeat(y)})),s.querySelectorAll("[data-select-seat]").forEach(h=>h.addEventListener("click",()=>{let y=h.dataset.selectSeat;y&&mp(i,y)})),requestAnimationFrame(()=>p()[0]?.focus()),i.emit3dAnalytics("3d_comparison_opened",{seatIds:i.view3dCompareSeatIds.slice()})}function at(i,e=!0){let t=i.view3dCompareCleanup;if(i.view3dCompareCleanup=null,!t){i.view3dCompareEl?.remove(),i.view3dCompareEl=null,i.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function mp(i,e){if(i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=i.allSeats().find(o=>o.id===e);if(!t)return;if(at(i,!1),!i.controller.select([e]).length){i.syncSelectionTo3d(),i.toast(i.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}i.syncSelectionTo3d(),i.showConfirm(t),i.emit3dAnalytics("3d_comparison_selected",{seatId:e})}var xa=require("@seatlayer/core/view3d/crossfade/panorama");var mo=require("@seatlayer/core");var fp=900,gp=450;function bp(i){switch(i){case"seat":return b("picker.stopYourSeat","Your seat");case"row":return b("picker.stopYourRow","Your row");case"section":return b("picker.stopYourSection","Your section");default:return b("picker.stopWholeVenue","Whole venue")}}function va(i,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let n=b("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",n),t.title=n,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let o=document.createElement("div");o.className="sl-view3d-stop",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),i.append(t,o);let s=null,r=null;return{onStopChange(a){if(s&&(clearTimeout(s),s=null),r&&(clearTimeout(r),r=null),!a){o.classList.remove("is-shown"),o.textContent="",r=setTimeout(()=>{r=null,i.classList.remove("is-seat-view")},gp);return}i.classList.add("is-seat-view"),o.textContent=bp(a),o.classList.add("is-shown"),s=setTimeout(()=>{s=null,o.classList.remove("is-shown")},fp)},dispose(){s&&(clearTimeout(s),s=null),r&&(clearTimeout(r),r=null),t.remove(),o.remove(),i.classList.remove("is-seat-view")}}}var yp=44,vp=92;function wa(i,e,t,n={}){let o=i?.sectionLabel,s=Q(i),r=wp(i,e),a=[o,s?(0,mo.t)("picker.rowLabel",{label:s}):null,r?(0,mo.t)("picker.seatLabel",{label:r}):null].filter(Boolean).join(" \xB7 "),l=n.maxChars??(n.narrow?yp:vp);for(let c of[t,n.shortTail??t,null]){let d=[a,c].filter(Boolean).join(" \xB7 ");if(d.length<=l||c==null)return d}return a}function wp(i,e){if(i?.seatNumber)return i.seatNumber;let t=i?.displayLabel??e,n=o=>{!o||!t.startsWith(o)||t.length<=o.length||(t=t.slice(o.length).replace(/^[\s·\-\/_]+/,""))};return n(i?.sectionLabel),n(Q(i)),t}var Sa=require("@seatlayer/core/core/seatConfidence");function ka(i){return i.buyerView}function Ta(i,e,t){if(e==="map"){i.exit3d();return}let n=t?.flyToSeatId;if(i.buyerView==="venue3d"){n?(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:n}),i.view3dHandle?.flyToSeat(n)):t?.resetView&&i.view3dHandle?.focusOverview();return}i.enter3d(n)}function Ea(i,e){switch(i.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return i.priceBandKeys!=null&&!i.priceBandKeys.has(e.categoryKey)||i.controller.accessibilityFilterDims?.(e)||i.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}function Ca(i){if(!i.view3dHandle)return;let e=i.allSeats().map(t=>({seatId:t.id,state:i.seatState3dFor(t)}));i.view3dHandle.setAvailability(e)}function Aa(i){i.view3dHandle&&i.view3dHandle.setSelection(i.controller.getSelection().map(e=>e.id))}async function Pa(i,e){let t=i.allSeats().find(n=>n.id===e);if(!t)return null;if(t.viewUrl)try{let n=t.viewMeta?.previewUrl,o=!!n&&n!==t.viewUrl,s=o?await i.buyerAssetUrls.resolve(n):null,r=o?t.viewUrl:await i.buyerAssetUrls.resolve(t.viewUrl);return!r||o&&!s?null:{url:r,...s?{previewUrl:s}:{},...o?{resolveUrl:a=>i.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(n){return i.opts.onError?.(n),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:i.tf("picker.chartDerivedModel","Chart-derived model")}}function La(i,e){if(i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),i.syncSelectionTo3d();return}let t=i.allSeats().find(a=>a.id===e);if(!t)return;let n=i.controller.tableSelection(e);if(i.committedSelection().some(a=>n?a.label===n.label:a.id===e)){i.controller.deselect([e]),i.dismissConfirm(),i.syncSelectionTo3d();return}let s=i.controller.getStatus(t.id);if(s==="held"||s==="booked"||s==="not_for_sale"){i.syncSelectionTo3d();return}if(!i.controller.select([e]).length){i.syncSelectionTo3d(),i.dismissConfirm();return}if(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),i.flashPickedSeat(e),n){i.showTableDialog(n,!1),i.syncSelectionTo3d();return}i.opts.confirmSelection!==!1?i.showConfirm(t):i.syncTray(),i.syncSelectionTo3d()}function Ma(i,e){let t=i.allSeats().find(n=>n.id===e);return wa(i.controller.seatDetails(e),t?.displayLabel??t?.label??e,i.tf("picker.viewFromYourSeat","view from your seat"),{narrow:i.root?.dataset.layout==="narrow",shortTail:i.tf("picker.fromYourSeat","from your seat")})}function Ha(i,e){if(i.buyerView!=="venue3d")return;let t=i.view3dCompareSeatIds;t.includes(e.id)||(i.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),i.confirmSeat?.id===e.id&&(i.controller.deselect([e.id]),i.dismissConfirm(),i.syncSelectionTo3d(),i.syncTray()),i.view3dCompareChip.sync(),i.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:i.view3dCompareSeatIds.length}),i.view3dCompareSeatIds.length>1?i.openView3dComparison():i.toast(i.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}function Ra(i){i.closeView3dComparison(!1),i.view3dCompareSeatIds=[],i.view3dCompareChip.remove(),i.emit3dAnalytics("3d_comparison_cleared")}function Ia(i,e){let t=i.allSeats().find(y=>y.id===e);if(!t)return null;let n=i.controller.seatDetails(t.id),o=i.controller.doc?.categories.find(y=>y.key===t.categoryKey),s=n?.price??(o?.tiers?.length?o.tiers[0].price:o?.price),r=s!=null?i.paidPrice(t.categoryKey,n?.tierId??o?.tiers?.[0]?.id??null,s,t.label):void 0,a=i.controller.getStatus(t.id),l=a==="held"?i.tf("picker.temporarilyHeld","Temporarily held"):a==="booked"?i.tf("picker.sold","Sold"):a==="not_for_sale"?i.tf("picker.notForSale","Not for sale"):i.tf("picker.available","Available"),c=t.viewUrl?(0,xa.seatViewDisclosure)({url:t.viewUrl,...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}):i.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),d=Ri(t.commercial).join(" \xB7 ")||i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),p=ns({...t.accessibility?.length?{accessibility:t.accessibility}:{},...n?.wheelchairSpaceType?{wheelchairSpaceType:n.wheelchairSpaceType}:{}}),m=p.length?`${p.join(" \xB7 ")} \xB7 metadata, not access certification`:i.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),h=(0,Sa.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:n?.displayLabel??t.displayLabel??t.label,section:n?.sectionLabel??t.sectionId??"\u2014",row:Q(n)??n?.rowLabel??"\u2014",category:n?.categoryLabel??o?.label??t.categoryKey,price:i.suppressPricing||r==null?"":i.money(r),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:m,confidence:h}}async function Oa(i,e){if(i.view3dEl||!i.canOffer3d()||!i.els.map)return;let t=i.controller.doc;if(!t)return;i.buyerView="venue3d",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),i.root?.setAttribute("data-view3d","on"),i.dismissConfirm(),i.syncProjection(),i.syncTray();let n=document.createElement("div");n.className="sl-view3d sl-mo-zoom",n.setAttribute("role","group"),n.setAttribute("aria-label",i.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let o=document.createElement("button");o.type="button",o.className="sl-view3d-back",o.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${i.tf("picker.backToMap","Back to map")}</span>`;let s=o.querySelector("span"),r=c=>{i.view3dTargetSeatId=c;let d=!!c;n.classList.toggle("is-seat-focused",d),i.root&&(i.root.dataset.view3dSeat=d?"on":"off");let p=d?i.tf("picker.backToVenue","Back to venue"):i.tf("picker.backToMap","Back to map");s&&(s.textContent=p),o.setAttribute("aria-label",p)};if(o.addEventListener("click",()=>{if(i.view3dTargetSeatId&&i.view3dHandle){i.view3dHandle.focusOverview();return}i.exit3d()}),i.regions["top-left"]?.prepend(o),i.view3dBack=o,i.publish3dTopInset(),sa(i.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6";let d=i.tf("picker.fullScreen","Full screen");c.setAttribute("aria-label",d),c.title=d,c.setAttribute("aria-pressed",String(!!document.fullscreenElement||i.fsFallback||i.framedFs)),c.addEventListener("click",()=>i.toggleFullscreen()),n.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=i.tf("picker.loading3d","Building the 3D venue\u2026"),n.appendChild(a),i.els.map.appendChild(n),i.view3dEl=n,i.view3dCompareChip.sync(),requestAnimationFrame(()=>{n.style.opacity="1"});let l=++i.view3dGen;try{let c=i.allSeats(),[d,p]=await Promise.all([Jt(),i.controller.loadEventConfiguration()]),m=p?await qi(p,v=>i.buyerAssetUrls.resolve(v)):null,h=t.theme?.venue3d?.shellAssetUrl,y=await Ki(h,v=>i.buyerAssetUrls.resolve(v));if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let f={doc:t,seats:c,...m?{eventConfigurationId:m.id,eventConfiguration:m}:{},...y?{registeredShellGlb:y}:{}};a.textContent=i.tf("picker.building3d","Building venue geometry\u2026");let T=await d.prepareVenue3D(f);if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let w=d.mountVenue3D(n,{...f,prepared:T},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:et(),navLabels:Ei(),seatViewActionLabel:v=>i.allSeats().find(A=>A.id===v)?.viewUrl?i.tf("picker.openAuthored360","Open venue 360\xB0"):i.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:v=>i.seatViewCaption(v),onSeatViewStopChange:v=>i.view3dSeatViewChrome?.onStopChange(v),onSeatPick:v=>i.onView3dSeatPick(v),onSeatInspect:v=>i.onView3dSeatPick(v),onSectionFocusChange:v=>{let A=n.querySelector('select[data-locator="section"]'),_=v??"";!A||A.value===_||(A.value=_,A.dispatchEvent(new Event("change")))},onViewTargetChange:v=>{n.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!v),r(v),i.opts.onBuyerViewChange?.({view:"venue3d",...v?{seatId:v}:{}})},...i.seatViewEnabled()?{getSeatView:v=>new Promise((A,_)=>{let q=()=>{i.seatViewFor3d(v).then(L=>{L?A(L):_(new Error("seat_view_unavailable"))})},g=globalThis.requestIdleCallback;typeof g=="function"?g(q,{timeout:1500}):setTimeout(q,50)})}:{},onAnalytics:(v,A)=>i.emit3dAnalytics(v,A)});i.view3dHandle=w,i.view3dSeatViewChrome=va(n,{handle:()=>i.view3dHandle}),requestAnimationFrame(()=>a.remove()),i.pushAvailabilityTo3d(),i.syncSelectionTo3d(),i.view3dNav=oa(i.regions["bottom-left"]??n,w),e&&w.flyToSeat(e)}catch(c){if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;i.opts.onError?.(c),i.toast(i.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),i.exit3d()}}function _a(i){let e=i.regions["top-left"];if(!i.root||!e)return;let t=()=>{!i.root||i.root.dataset.view3d!=="on"||i.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}function Na(i){if(i.buyerView!=="venue3d"&&!i.view3dEl)return;i.view3dGen++,i.buyerView="map",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"map"}),i.root?.removeAttribute("data-view3d"),i.closeSeatConfidencePassport(!1),i.closeView3dComparison(!1),i.view3dCompareChip.remove(),i.view3dSeatViewChrome?.dispose(),i.view3dSeatViewChrome=null,i.view3dBack?.remove(),i.view3dBack=null,i.view3dNav?.remove(),i.view3dNav=null,i.root?.removeAttribute("data-view3d-seat"),i.root?.style.removeProperty("--sl-3d-top-inset");try{i.view3dHandle?.dispose()}catch{}i.view3dHandle=null;let e=i.view3dEl;i.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),i.syncProjection(),i.syncTray();let t=i.view3dReturnSeat;i.view3dReturnSeat=null,t&&i.committedSelection().some(n=>n.id===t.id)&&i.opts.confirmSelection!==!1&&i.showConfirm(t)}var Ua=require("@seatlayer/core");var hi=require("@seatlayer/core");function Da(i){return Array.isArray(i)?i.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function wn(i,e,t=!1){let n=i.violations[0];return n==="numberOfPlacesToSelect"?i.remaining>0?(0,hi.t)("picker.selectExactMore",{count:i.remaining}):(0,hi.t)("picker.selectExactCount",{count:i.required}):n==="minimumSelectedPlaces"?(0,hi.t)("picker.selectMinimumMore",{count:i.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):n==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):(0,hi.t)("picker.orphanHint")}var ui=require("@seatlayer/core");function Ba(i){let e=Math.max(0,i),t=Math.floor(e/6e4),n=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${n}`}function Fa(i){let e=i.performanceLabel?`<div class="sl-chip-when">${F(i.performanceLabel)}</div>`:"",t=i.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${F(i.performanceDates.summary)}</span><span class="sl-chip-date-list">${i.performanceDates.labels.map(n=>`<span class="sl-chip-date">${F(n)}</span>`).join("")}</span></div>`:"";return e+Sp(i)+t}function Sp(i){let{d:e,area:t,label:n,objectType:o,quantity:s=1,identity:r}=i,a=_=>String(_??"\u2014").replace(/[&<>"]/g,q=>({"&":"&","<":"<",">":">",'"':"""})[q]),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??n,p=i.categoryLabel?.trim()??"",m="",h=[];l==="table"&&r?.bookingMode?(m=`${c} ${d}`,h.push([b("picker.guests","Guests"),String(s)])):l==="ga"?(m=String(t?.displayLabel??d),s>1&&h.push([b("picker.tickets","Tickets"),String(s)])):l==="booth"?(m=e?.sectionLabel??`${c} ${d}`,e?.sectionLabel&&h.push([c,String(d)])):!e?.sectionLabel&&!e?.rowLabel&&!e?.seatNumber?m=String(d):(m=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=!m&&!!p,f=m||p||String(d),T=!!p&&!y&&p!==f,w=i.offerName?Hi(i.offerName,a):"",v=h.map(([_,q])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(_)}</span> <b>${a(q)}</b></span>`);T&&v.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(p)}</span>${w}</span>`);let A=[f,...h.map(([_,q])=>`${_} ${q}`),T?p:"",i.offerName??""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(A)}</span><span class="sl-chip-name" aria-hidden="true">${a(f)}${T?"":w}</span>`+(v.length?`<span class="sl-chip-pos" aria-hidden="true">${v.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function Va(i,e,t){return i.map(n=>`<option value="${t(n.id)}"${n.id===e?" selected":""}>${t(n.name)}</option>`).join("")}function kp(i){let e=F;return` data-key="${e(i.key)}"`+(i.heldLabels.length?` data-held="${e(encodeURIComponent(i.heldLabels.join(`
|
|
3261
|
-
`)))}"`:"")+(i.seatIds.length?` data-seat="${e(i.seatIds.join(" "))}"`:"")+(i.locateId?` data-locate="${e(i.locateId)}"`:"")}function za(i){let e=F;return`<div class="sl-chip${i.held?" sl-held":""}${i.fresh?" sl-enter":""}"`+kp(i)+">"+(i.held?i.stateHtml:`<span class="sl-chip-dot" style="background:${C(i.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${i.identityHtml}`+(i.extrasHtml?`<div class="sl-chip-sub">${i.extrasHtml}</div>`:"")+`${i.noteHtml}</div>`+(i.amountText?`<span class="amt">${e(i.amountText)}</span>`:"")+i.railHtml+"</div>"}function fo(i,e){let t=F(i),n=e?F(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${n}" aria-label="${F((0,ui.t)("picker.viewFromSeat",{label:e}))}"><svg viewBox="0 0 24 24"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z"/><circle cx="12" cy="12" r="3"/></svg></button>`:"")+`<button type="button" class="rm" aria-label="${t}"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function $a(i){return i.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${b("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,ui.t)("picker.willFindSeatsTogether",{count:i.quantity})}</b><span>${b("picker.manualTicketsRemovedNote","Your manually selected tickets will be removed only after a new group is secured.")}</span></div><div class="sl-ba-actions"><button type="button" data-ba-cancel>${b("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${b("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="sl-ba-title-t">${b("picker.findSeatsTogether","Find seats together")}</span>`+Tt({id:"sl-info-best-seats",label:b("picker.aboutBestSeats","About finding seats together"),text:b("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")})+(i.offerPremium?`<button type="button" class="sl-ba-premium${i.premium?" on":""}" data-ba-premium aria-pressed="${i.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${b("picker.bestSeatsPremium","Best seats")}</button>`:"")+`</div><div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${b("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${i.quantity}</span><button type="button" data-ba="1" aria-label="${b("picker.moreSeats","More seats")}">+</button></div>`+(i.categories.length>1?`<select class="sl-ba-cat" aria-label="${F(b("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${F(b("picker.anyTicketType","Any ticket type"))}</option>`+i.categories.map(e=>`<option value="${F(e.key)}"${i.selectedCategory===e.key?" selected":""}>${F(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(i.zones.length?`<select class="sl-ba-zone" aria-label="${b("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${b("picker.anyVenueZone","Any venue zone")}</option>`+i.zones.map(e=>`<option value="${F(e.id)}"${i.selectedZone===e.id?" selected":""}>${F(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${i.busy?" sl-busy":""}"${i.busy?" disabled":""}>`+(i.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${b("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,ui.tCount)("picker.findBestSeatsCount",i.quantity))+"</button>"+(i.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${b("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function ja(i){if(i.salesClosed&&!i.hasPicks){let e=i.whenText?`<span class="when">${F(i.whenText)}</span>`:"";return`<div class="sl-closed-note" role="status"><b>${b("picker.salesClosedPill","Sales are closed")}</b><span>${b("picker.salesClosedCopy","Ticket sales for this event have ended.")}${e}</span></div>`}return""}function Ga(i){return i.hasGaAreas?i.seated?i.venue3d?b("picker.trayHintChoose3dOrStanding","Choose a seat in the 3D venue \u2014 or grab standing tickets below."):b("picker.trayHintTapOrStanding","Tap a seat on the map \u2014 or grab standing tickets below."):i.venue3d?b("picker.gaTrayHintChoose3dArea","Choose an area in the 3D venue to select tickets."):b("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets."):i.groupMode==="per_performance"?b("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):i.groupMode?b("picker.groupTrayHint","Choose seats once \u2014 the same seats will be held for every performance."):i.venue3d?b("picker.trayHintChoose3dOrBest","Choose a seat in the 3D venue, or let us pick the best available for you."):b("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}var go=6e4,qa=5*6e4,Tp=String(Math.round(qa/6e4));function Ka(i){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(i.regions["bottom-center"]??i.els.map).appendChild(e),i.extendEl=e,i.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),i.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),i.els.extendBtn.textContent=Wa(i),i.els.extendDismiss.setAttribute("aria-label",i.tf("picker.close","Close")),i.els.extendBtn.addEventListener("click",()=>{i.handleExtend()}),i.els.extendDismiss.addEventListener("click",()=>{i.extendDismissed=!0,i.setExtendPrompt(!1,0)})}function Wa(i){return i.tf("picker.addMinutes","+{count} min").replace("{count}",Tp)}function Ya(i){let e=i.hold?.items??[],t=new Set(e.map(o=>o.label));return i.committedSelection().filter(o=>!t.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0)+je(i.gaQty,i.hold?.items??[])}function Xa(i){return(i.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function Za(i){let e=new Set((i.hold?.items??[]).map(n=>n.label)),t=i.committedSelection().filter(n=>!e.has(n.label)).reduce((n,o)=>n+(o.quantity??1),0);return i.heldTicketCount()+t+je(i.gaQty,i.hold?.items??[])}function Qa(i){let e=new Set((i.hold?.items??[]).map(o=>o.label)),t=i.committedSelection().filter(o=>e.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0),n=Math.max(0,i.maxTickets-i.heldTicketCount()-je(i.gaQty,i.hold?.items??[]));i.controller.setMaxSelection(t+n)}function Ja(i,e=i.lastTrayCount,t=i.pendingSelectionCount()){let n=i.els.cta;if(!n)return;if(delete n.dataset.act,i.salesClosed){n.disabled=!0,n.textContent=i.tf("picker.salesClosedCta","Sales closed");return}if(i.ctaPhase==="holding"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(i.ctaPhase==="checkout"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let o=!i.hold&&i.performanceGroup?.selectionMode==="per_performance"?i.performanceGroup.submissionState?.():null;if(o&&!o.ready){n.disabled=!0,n.textContent=i.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(o.complete)).replace("{total}",String(o.total));return}let s=i.controller.getSelectionValidity(e);if(s&&!s.isValid){n.disabled=!0,n.textContent=wn(s,(r,a)=>i.tf(r,a),!0);return}if(!e&&i.root?.dataset.layout==="narrow"&&!i.performanceGroup&&!i.hold){n.disabled=!1,n.dataset.act="find",n.textContent=i.tf("picker.findBestSeats","Find best seats");return}n.disabled=e===0,n.textContent=i.hold?t?(0,Ua.t)("picker.secureMoreAndCheckout",{count:t}):i.tf("picker.continueToCheckout","Continue to checkout"):e?i.performanceGroup?i.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(i.performanceGroup.performanceCount)):i.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):i.tf("picker.selectSeats","Select seats")}function el(i,e){i.ctaPhase=e,i.syncCta()}async function tl(i,e,t){i.setCtaPhase("checkout");try{await i.checkoutHandoff(e,t)}finally{i.ctaPhase==="checkout"&&!i.bookedShown&&i.setCtaPhase("idle")}}function il(i){return`@seatlayer/hold/v1/${encodeURIComponent(i.apiBase)}/${encodeURIComponent(i.opts.event)}`}function nl(i){if(i.opts.initialHoldId)return i.opts.initialHoldId;if(i.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(i.holdStorageKey())}catch{return null}}function ol(i,e){if(!(i.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(i.holdStorageKey(),e.holdId)}catch{}}function sl(i){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(i.holdStorageKey())}catch{}}async function rl(i,e,t=!1){try{let n=await i.controller.resumeHold(e);if(!n||i.destroyed)return null;let o={holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items};return i.hold=o,i.handedOff=!0,i.bookedShown=!1,i.ctaPhase="idle",i.startHoldTimer(o.expiresAt),i.rememberHold(o),i.syncTray(),i.emitHoldChange(),i.opts.onHoldRestored?.(o,o.seats??[],i.buildHandoff(o)),o}catch(n){let o=n?.status;if(o===404||o===409)i.forgetHold();else if(i.opts.onError?.(n),t)throw n;return null}}async function al(i){let e=i.rememberedHoldId();e&&await i.resumeHoldFromServer(e,!0)}function ll(i,e){i.stopHoldTimer(),i.holdExpiresAt=e,i.extendDismissed=!1,i.extendUsed=!1,i.hold&&i.rememberHold(i.hold);let t=i.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${i.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let n=t.querySelector('[data-ref="holdTime"]'),o=()=>{let s=Math.max(0,i.holdExpiresAt-Date.now());n&&(n.textContent=Ba(s)),t.classList.add("on"),t.classList.toggle("is-expiring",s>0&&s<=go),i.setExtendPrompt(s>0&&s<=go,s),(s<=0||!i.controller.currentHold())&&i.stopHoldTimer()};i.holdTimer=setInterval(o,500),o()}function cl(i){i.holdTimer&&clearInterval(i.holdTimer),i.holdTimer=null,i.els.hold?.classList.remove("on","is-expiring"),i.setExtendPrompt(!1,0)}function dl(i,e,t){if(!i.extendEl)return;let n=e&&t>0&&i.root?.dataset.layout!=="narrow"&&!i.extendDismissed&&!i.extendUsed&&!!i.controller.currentHold()&&!i.bookedShown;i.extendEl.classList.toggle("on",n)}function pl(i){if(!i.holdTimer)return;let e=Math.max(0,i.holdExpiresAt-Date.now());i.setExtendPrompt(e>0&&e<=go,e)}async function hl(i){let e=i.els.extendBtn,t=i.controller.currentHold();if(!(!t||!i.api.extend||i.extendUsed)){e.disabled=!0,e.textContent=i.tf("picker.addingEllipsis","Adding\u2026");try{let n=await i.api.extend(i.controller.key,t.holdId,qa);if(i.controller.currentHold()?.holdId!==t.holdId)return;i.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:n.expiresAt,items:t.items});let o=i.controller.currentHold();if(!o)return;i.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},i.holdExpiresAt=o.expiresAt,i.extendUsed=!0,i.extendEl?.classList.remove("on"),i.rememberHold(i.hold),i.emitHoldChange(),i.toast(i.tf("picker.moreTimeAdded","More time added \u2014 your seats are still held."),"success")}catch(n){if(n?.reason==="extend_limit"){i.extendUsed=!0,i.setExtendPrompt(!1,0);return}i.opts.onError?.(n),i.toast(i.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=Wa(i)}}}var yo=require("@seatlayer/core");function ul(i){return i?.previousPrice!=null&&i.previousPrice>i.price?i.previousPrice:null}function ml(i){return Cp(i)+(i.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!i.collapsed}">${i.esc(i.moreLabel)}</button>`:"")+Ap(i.status)}function Cp(i){let{esc:e,money:t}=i;return i.categories.map(n=>{let o=i.priceOf(n),s=i.rangeOf(n),r=i.offerOf(n.key),a=ul(r),l=i.activeKey===n.key;return`<div class="sl-price-row${i.bandKeys!=null&&!i.bandKeys.has(n.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(n.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(i.titleFor(n,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(i.colorOf(n))}"></span><span class="sl-price-label"><span class="sl-price-name">${e(n.label)}</span>`+(r?.offerName?Hi(r.offerName,e):"")+"</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 Ap(i){let e=t=>t.replace(/[&<>"']/g,n=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[n]);return`<div class="sl-status-key" aria-label="${e(i.legend)}"><span class="sl-status-item"><i class="sl-status-icon unavailable" aria-hidden="true"></i>${e(i.unavailable)}</span></div>`}function bo(i){let e=Math.abs(i.scrollLeft),t=e>2,n=e+i.clientWidth<i.scrollWidth-2;return i.dataset.fadeStart=String(t),i.dataset.fadeEnd=String(n),{start:t,end:n}}function fl(i){let{esc:e,money:t}=i;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${i.allActive}" title="${e(i.allWord)}"><span class="sl-rc-t">${e(i.allWord)}</span></button>`+i.categories.map(o=>{let s=i.rangeOf(o),r=i.priceOf(o),a=s?s.min===s.max?t(s.min):`${t(s.min)}+`:r!=null?t(r):null,l=Object.prototype.hasOwnProperty.call(i.left,o.key)&&i.left[o.key]<=0,c=ul(i.offerOf(o.key)),d=a?`${o.label} \u2014 ${a}${l?` (${i.soldOutWord})`:""}`:o.label;return`<button type="button" class="sl-rc" data-cat="${e(o.key)}" aria-pressed="${i.activeKey===o.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(i.colorOf(o))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??o.label)}</span></button>`}).join("")}function gl(i,e){let t=i.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let n=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(n.length<=5)return n.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let o=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),s=Math.ceil(o.length/4),r=[];for(let a=0;a<o.length;a+=s){let l=o.slice(a,a+s),c=Math.min(...l.map(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 bl(i){if(i.els.pricesSec?.querySelectorAll(".sl-price-select").forEach(o=>o.remove()),i.priceSelect=null,i.suppressPricing||!i.els.prices||!i.els.pricesSec)return;let e=gl(i.controller.doc?.categories??[],i.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",i.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let n=document.createElement("option");n.value="all",n.textContent=i.tf("picker.allPrices","All prices"),t.appendChild(n);for(let o of e){let s=document.createElement("option");s.value=o.id,s.textContent=o.label,t.appendChild(s)}i.els.pricesSec.appendChild(t),i.priceSelect=t,t.addEventListener("change",()=>{i.applyPriceBand(e.find(o=>o.id===t.value)?.keys??null)})}function yl(i,e){if(i.focusedCatKey=null,i.priceBandKeys=e?new Set(e):null,i.priceSelect){let t=e?i.priceSelect.value:"all";i.priceSelect.value!==t&&(i.priceSelect.value=t)}i.controller.setCategoryFilter(e),i.controller.focusCategoryFilter(e),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}function vl(i){return{colorOf:e=>i.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>i.catPriceRange(e),priceOf:e=>i.catPrice(e),offerOf:e=>i.offerPrice(e),money:e=>i.money(e),esc:F}}function wl(i,e,t,n=i.legendDeps()){let o=i.els.railScroll,s=e.length>1;if(i.els.rail?.classList.toggle("has",s),!o)return;o.innerHTML=s?fl({...n,categories:e,left:t,activeKey:i.focusedCatKey,soldOutWord:i.tf("picker.soldOut","Sold out"),allWord:i.tf("picker.allPrices","All prices"),allActive:!i.focusedCatKey&&!i.priceBandKeys}):"";let r=e.map(a=>a.key).join("|");i.lastRailSignature!==r&&(i.lastRailSignature=r,o.scrollLeft=0),o.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){i.applyPriceBand(null);return}i.focusCategory(a.dataset.cat??"")})}),i.railEdgesBound||(i.railEdgesBound=!0,o.addEventListener("scroll",()=>bo(o),{passive:!0})),requestAnimationFrame(()=>bo(o))}function xl(i){let e=i.controller.doc;if(!e||!i.els.prices)return;let t=i.controller.categoryAvailability(),n=e.categories.filter(p=>!p.notForSale);i.syncSoldout(n,t);let o=i.legendDeps(),s=i.suppressPricing,r=s?{...o,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:o;s&&(i.els.pricesSec?.querySelector("span")?.replaceChildren(i.tf("picker.seatCategories","Seat categories")),i.els.pricesInfo?.remove()),i.syncPriceRail(n,t,r);let a=5,l=n.length-a,c=l>1&&!i.pricesExpanded,d=c?n.slice(0,a):n;i.els.prices.classList.toggle("sl-expanded",l>1&&i.pricesExpanded),i.els.prices.innerHTML=ml({...r,categories:d,left:t,collapsed:c,activeKey:i.focusedCatKey,bandKeys:i.priceBandKeys,titleFor:(p,m)=>m?i.tf("picker.showAllSeats","Show all seats"):(0,yo.t)("picker.showLabelSeatsOnMap",{label:p.label}),moreLabel:l>1?c?s?i.tf("picker.showAllCategories","Show all categories"):(0,yo.t)("picker.showAllTicketTypes",{count:n.length}):i.tf("picker.showFewer","Show fewer"):null,status:{legend:i.tf("picker.seatStatusLegend","Seat status legend"),unavailable:i.tf("picker.notAvailable","Not available")}}),i.els.prices.querySelectorAll(".sl-price-row").forEach(p=>{p.addEventListener("mouseenter",()=>i.controller.getRenderer()?.setCategoryHighlight?.(p.dataset.cat??null)),p.addEventListener("mouseleave",()=>i.controller.getRenderer()?.setCategoryHighlight?.(null));let m=()=>i.focusCategory(p.dataset.cat??"");p.addEventListener("click",m),p.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),m())})}),i.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{i.pricesExpanded=!i.pricesExpanded,i.syncPrices()})}function Sl(i,e){if(!e)return;let t=i.focusedCatKey===e?null:e;i.focusedCatKey=t,i.priceBandKeys=t?new Set([t]):null;let n=i.els.pricesSec?.querySelector(".sl-price-select");n&&(n.value="all"),i.controller.setCategoryFilter(t?[t]:null),i.controller.focusCategoryFilter(t?[t]:null),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}var Ft=require("@seatlayer/core");function be(i,e,t){let n=(0,Ft.t)(i,t);return n&&n!==i?n:t?e.replace(/\{(\w+)\}/g,(o,s)=>s in t?String(t[s]):o):e}function Lp(i){let e=(0,Ft.tCount)("picker.seatCount",i);return e.includes("picker.seatCount")?`${i} ${i===1?"seat":"seats"}`:e}function Mp(i){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(i)}catch{}return i.join(", ")}function Hp(i){if(i.length<2)return!1;let e=[...i].sort((t,n)=>t-n);return new Set(e).size!==e.length?!1:e[e.length-1]-e[0]===e.length-1}function Rp(i){let e=i.filter(o=>o.objectType==="ga"),t=i.filter(o=>o.objectType!=="ga"),n=[];if(t.length){let o=Lp(t.length),s=[...new Set(t.map(l=>l.sectionLabel).filter(Boolean))],r=[...new Set(t.map(l=>l.rowLabel).filter(Boolean))],a=t.map(l=>Number(l.seatNumber)).filter(l=>Number.isFinite(l));if(s.length===1&&r.length===1&&a.length===t.length){let l=t.length===1?be("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:s[0],row:r[0],seat:String(t[0].seatNumber??"")}):Hp(a)?be("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:s[0],row:r[0],from:Math.min(...a),to:Math.max(...a)}):"";n.push(l?be("picker.releasedPair","{first} \xB7 {second}",{first:o,second:l}):be("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]}))}else s.length===1?n.push(be("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]})):s.length>1?n.push(be("picker.releasedInSections","{seats} in Sections {sections}",{seats:o,sections:Mp(s)})):n.push(o)}for(let o of e)n.push(be("picker.releasedGa","{quantity} \xD7 {area}",{quantity:o.quantity??1,area:o.label}));return n.length?n.reduce((o,s)=>be("picker.releasedPair","{first} \xB7 {second}",{first:o,second:s})):""}function kl(i){if(!i)return[];let e=new Map((i.seats??[]).map(o=>[o.label,o])),t=i.items??[];return(t.length?t.map(o=>({label:o.label,objectType:o.objectType,quantity:o.quantity})):[...e.keys()].map(o=>({label:o}))).map(o=>{let s=e.get(o.label);return{label:o.label,...o.objectType?{objectType:o.objectType}:{},...o.quantity==null?{}:{quantity:o.quantity},...s?.sectionLabel?{sectionLabel:s.sectionLabel}:{},...s?.rowLabel?{rowLabel:Q(s)??s.rowLabel}:{},...s?.seatNumber?{seatNumber:s.seatNumber}:{}}})}function Tl(i,e){if(!i.reducedMotion)for(let t of e.slice(0,10)){if(t.objectType==="ga")continue;let n=i.seatByLabel(t.label);!n||i.statusOf(n.id)!=="free"||i.flash(n.id,i.accent)}}function El(i,e){if(!e.recoverable.length||!i.isConnected)return;let t=i.querySelector(".sl-hold-expired-next");t&&(e.taken.length?t.textContent=e.taken.slice(0,3).map(r=>(0,Ft.t)("picker.seatJustTakenByAnother",{label:r})).join(" "):t.remove());let n=i.querySelector(".sl-interrupt-actions"),o=n?.querySelector(".sl-interrupt-act");if(!n||!o)return;o.classList.add("sl-interrupt-act-secondary");let s=document.createElement("button");s.type="button",s.className="sl-interrupt-act sl-hold-expired-recover",s.textContent=(0,Ft.tCount)("picker.holdLapsedSelectAgain",e.recoverable.length),s.addEventListener("click",()=>e.onRecover([...e.recoverable])),n.insertBefore(s,o),i.classList.add("has-recovery"),s.focus()}function Cl(i,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let n=document.createElement("div");n.className="sl-interrupt-card sl-mo-in";let o=document.createElement("div");o.className="sl-interrupt-title",o.id="sl-hold-expired-title";let s=document.createElement("span");s.className="sl-interrupt-glyph",s.setAttribute("aria-hidden","true"),s.textContent="\u23F1";let r=document.createElement("span");r.textContent=be("picker.holdExpiredTitle","Your seats were released"),o.append(s,r);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=be("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),n.append(o,a);let l=Rp(e);if(l){let m=document.createElement("div");m.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",m.textContent=l,n.appendChild(m)}let c=document.createElement("div");c.className="sl-interrupt-body sl-hold-expired-next",c.textContent=be("picker.holdExpiredPickAgain","Pick your seats again to continue \u2014 they may already be taken."),n.appendChild(c),t.setAttribute("aria-labelledby",o.id),t.setAttribute("aria-describedby",a.id);let 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=be("picker.holdExpiredRestart","Choose seats again"),p.addEventListener("click",()=>i.restart()),d.appendChild(p),n.appendChild(d),t.appendChild(n),t.addEventListener("pointerdown",m=>{m.target===t&&i.restart()}),t}var _e=require("@seatlayer/core");var Al={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"},Ip='<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>',Op='<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>',_p=8,Np=8,Dp=88;function Bp(i){let e=i.gap??_p,t=i.margin??Np,n=i.min??Dp,o=Math.max(i.boundsTop,0);return Math.max(Math.round(i.buttonTop-o-e-t),n)}var xn=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=Op,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=fs(o,t.tf("picker.close","Close"))+gs(this.rows()),this.root.append(this.menu,this.button),e.prepend(this.root),this.button.addEventListener("pointerdown",s=>s.stopPropagation()),this.button.addEventListener("click",s=>{s.stopPropagation(),this.open(this.menu.hidden)}),this.menu.querySelector("[data-a11y-close]")?.addEventListener("click",s=>{s.stopPropagation(),this.open(!1),this.button.focus({preventScroll:!0})}),this.menu.addEventListener("pointerdown",s=>s.stopPropagation()),this.menu.addEventListener("click",s=>s.stopPropagation()),this.menu.addEventListener("focusin",s=>{let r=s.target;r&&typeof r.scrollIntoView=="function"&&r.scrollIntoView({block:"nearest"})}),this.dismiss=()=>this.open(!1),this.escape=s=>{s.key==="Escape"&&this.open(!1)},this.reflow=()=>{this.menu.hidden||this.fit()},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),window.addEventListener("resize",this.reflow),this.promoteCounts(),this.wire(),this.active.size){this.applyFilter({focus:!1});let s=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:n,count:o})=>[n,o])),t=!1;for(let n of this.menu.querySelectorAll("[data-a11y-row]")){let o=n.dataset.a11yRow??"";if(!o.startsWith("a11y:"))continue;let s=o.slice(5),r=e.get(s);if(r===void 0)continue;let a=this.countNode(n),l=r==null?"":this.countText(r);a&&(a.textContent=l);let c=r===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(s,l))),n.disabled=c,c?n.setAttribute("aria-disabled","true"):n.removeAttribute("aria-disabled"),c&&this.active.delete(s)&&(this.paint(n,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let n=t.dataset.a11yRow??"";n.startsWith("a11y:")&&this.paint(t,this.active.has(n.slice(5)))}}refit(){this.menu.hidden||this.fit()}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),window.removeEventListener("resize",this.reflow),this.root.remove()}fit(){this.menu.style.setProperty("--sl-a11ymenu-max",`${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();zn(this.menu,{x:t.left+t.width/2,y:t.top}),Ms(this.menu),Ls(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:(0,_e.seatTypeIconSvg)("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:Ip,className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:n,count:o})=>({key:n,count:o}));let t=this.deps.present;return t?_e.ACCESSIBILITY_TYPES.filter(({key:n})=>t.has(n)).map(({key:n})=>({key:n,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(_e.ACCESSIBILITY_TYPES.map(n=>[n.key,n]));return this.offered().flatMap(({key:n,count:o})=>{let s=t.get(n);return s?[{key:`a11y:${n}`,iconHtml:(0,_e.seatTypeIconSvg)(n,{size:17}),label:this.deps.tf(`picker.accessShort.${n}`,Al[n]??s.label),...n==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...o==null?{}:{count:this.countText(o),disabled:o===0},on:this.active.has(n)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-sl-info]"))e.addEventListener("click",()=>{let t=e.closest(".sl-info"),n=!t?.classList.contains("open");for(let o of this.menu.querySelectorAll(".sl-info.open"))o.classList.remove("open"),o.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false");t?.classList.toggle("open",n),e.setAttribute("aria-expanded",String(n))});for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let s=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(s),this.paint(e,s);return}if(t==="limited"){let s=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(s),s&&this.deps.focusSeatsForFilter(),this.paint(e,s);return}let n=t.slice(5),o=!this.active.has(n);o?this.active.add(n):this.active.delete(n),this.paint(e,o),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let n=(e.dataset.a11yRow??"").slice(5),o=e.parentElement;o?.classList.contains("sl-a11yrow-w")||(o=document.createElement("div"),o.className="sl-a11yrow-w",e.replaceWith(o),o.appendChild(e));let s=document.createElement("button");s.type="button",s.className="sl-a11yrow-c sl-a11yjump",s.dataset.a11yJump=n,s.textContent=t.textContent,s.disabled=e.disabled,s.setAttribute("aria-label",this.jumpLabel(n,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(n,s.textContent??""));let r=o.querySelector(".sl-info");r?r.after(s):e.after(s),o.dataset.a11yTapThrough||(o.dataset.a11yTapThrough="true",o.addEventListener("click",a=>{a.target===o&&!e.disabled&&e.click()})),s.addEventListener("click",a=>{a.stopPropagation(),this.active.has(n)||(this.active.add(n),this.paint(e,!0),this.applyFilter({focus:!1}));let l=this.deps.stepToAccessibleSection?.(n);l&&s.setAttribute("aria-label",this.jumpLabel(n,s.textContent??"",l.label))})}}countText(e){return e>0?(0,_e.t)("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=Al[e]??_e.ACCESSIBILITY_TYPES.find(n=>n.key===e)?.label??e;return this.deps.tf(`picker.accessShort.${e}`,t)}jumpLabel(e,t,n){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...n?[`${this.deps.tf("picker.section","Section")} ${n}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};var Pl=require("@seatlayer/core"),Fp=250;function Ll(i,e=Fp){let t=null,n=()=>{t===null&&(t=setTimeout(()=>{t=null,i()},e))},o=(0,Pl.attachVisibilityCatchUp)(n),s=typeof window<"u"&&typeof window.addEventListener=="function";return s&&window.addEventListener("focus",n),()=>{t!==null&&(clearTimeout(t),t=null),o(),s&&window.removeEventListener("focus",n)}}var lt=require("@seatlayer/core");var Sn=class{constructor(e){this.note=null;this.told=!1;this.deps=e}deferExpiryToast(e){this.told=!1,queueMicrotask(()=>{this.told||e()})}handle(e){if(!e.holdLapsed)return;this.told=!0;let t=(0,lt.holdRecoveryShape)(e),n=e.lapsedLabels.length,o=n-e.recoverable.length,s=t==="all"?(0,lt.tCount)("picker.holdLapsedStillFree",n):t==="partial"?(0,lt.tCount)("picker.holdLapsedSomeTaken",o):(0,lt.tCount)("picker.holdLapsedAllTaken",n);this.note={message:s,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(s,t==="none"?"error":"warning",t==="none"?void 0:{label:this.actionLabel(),onClick:()=>this.recover()}),this.deps.syncTray()}noteHtml(){if(!this.note)return"";let e=this.note.recoverable.length?`<button type="button" data-lapse-again>${F(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${F(this.note.message)}</span>${e}</div>`}wire(e){e?.querySelector("[data-lapse-again]")?.addEventListener("click",()=>this.recover())}clear(){this.note&&(this.note=null,this.deps.syncTray())}actionLabel(){return(0,lt.tCount)("picker.holdLapsedSelectAgain",this.note?.recoverable.length??0)}recover(){let e=this.note?.recoverable??[];this.note=null,this.deps.syncTray(),e.length&&this.deps.reselect(e)}};var Ml=Symbol("seatlayer.performance-group-picker");function kn(i,e){return Object.defineProperty(i,Ml,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),i}function Hl(i){return i[Ml]??null}var Rl="@seatlayer/pending-checkout/v1";function Vp(i){return typeof i=="string"&&i.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(i)}function Tn(i){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let n=null;try{let o=window.sessionStorage.getItem(Rl);if(o){let s=null;try{s=JSON.parse(o)}catch{}if(s&&Vp(s.orderId)){let r=Date.now()-Number(s.storedAt);if(r>=0&&r<=144e5){if(s.eventKey&&s.eventKey!==i)return null;n=s.orderId}}}window.sessionStorage.removeItem(Rl)}catch{}e.delete("seatlayer_checkout");try{let o=e.toString();history.replaceState(history.state,"",`${location.pathname}${o?`?${o}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:n}}function Il(i){if(!i.framed)return null;let e=i.ancestorOrigins?.length?i.ancestorOrigins[0]:null;for(let t of[e,i.referrer])if(t)try{return new URL(t).origin}catch{}return null}var zp="https://api.seatlayer.io",$p=10,jp=250,Ol=6e4,_l=4,Gp=10,Up=40,qp=220,vo=["mini","peek","open"],Nl="seatmap.a11y.cb";function Kp(){try{if(typeof window>"u")return null;let i=window.localStorage.getItem(Nl);return i==null?null:i==="1"}catch{return null}}function Wp(i){try{window.localStorage.setItem(Nl,i?"1":"0")}catch{}}var Ke=class i{constructor(e){this.realtime=null;this.accessEl=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.els={};this.regions={};this.ro=null;this.viewportResizeHandler=null;this.holdTimer=null;this.loadAbort=null;this.transportAbort=new AbortController;this.toastTimer=null;this.offerReadInFlight=null;this.offerReadSettledAt=0;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerCountdownTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.currencyResolved=!1;this.eventTimezone=null;this.eventWhenText=null;this.offerAvailability=null;this.channelByObject=new Map;this.pricesByChannel=new Map;this.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.extendDismissed=!1;this.extendUsed=!1;this.bookedEl=null;this.holdExpiredEl=null;this.holdExpiredFresh=!1;this.holdExpiredUnits=[];this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsReadyResolve=null;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 fn({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 Sn({toast:(e,t,n)=>this.toast(e,t,n),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalCleanup=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=Hl(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??zp).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},n=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?Vi({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:n?.access??Rt(e,t),this.pubApi=e.transport?null:n?.api??new Ve(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=ur(e.transport??this.pubApi,this.transportAbort.signal),this.buyerAssetUrls=new Ot(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=Da(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($p,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=Kp()??!!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 Nt(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=Il({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let n=t<640?1.2:.62;return Math.max(420,Math.round(t*n))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!document.fullscreenElement||this.fsFallback||this.framedFs?document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.framedFs?this.setFramedFs(!1):this.setFsFallback(!1):e.requestFullscreen?e.requestFullscreen().catch(()=>this.enterFsFallback()):this.enterFsFallback()}fillsViewport(){let e=this.root;if(!e||typeof window>"u")return!1;let t=e.getBoundingClientRect();return t.height>=window.innerHeight-_l&&t.width>=window.innerWidth-_l}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let n=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=n,e.tabIndex=n?-1:0,e.setAttribute("aria-hidden",String(n))}fullscreenMeasurementChanged(e,t){let n=typeof window>"u"?0:window.innerWidth,o=typeof window>"u"?0:window.innerHeight,s=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||n!==this.fullscreenAffordanceSize.viewportWidth||o!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:n,viewportHeight:o},s}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),this.root?.setAttribute("data-fs",String(e)),this.els.zfs?.setAttribute("aria-pressed",String(e)),this.els.zfs?.setAttribute("title",e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));let n=this.els.zfs?.querySelector(".sl-zfs-lbl");n&&(n.textContent=e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),this.view3dEl?.querySelector(".sl-view3d-fs")?.setAttribute("aria-pressed",String(e)),this.syncFullscreenAffordance()}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e,background:this.cssVar("--sl-bg")||void 0}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){_t();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.createElement("div");n.className="sl-modal-scrim";let o=document.createElement("div");o.className="sl-modal-frame",o.style.setProperty("--sl-bg",Ct(void 0,e.theme)["--sl-bg"]),o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label",b("picker.seatSelection","Seat selection")),o.tabIndex=-1,n.appendChild(o),document.body.appendChild(n);let s=document.body.style.overflow;document.body.style.overflow="hidden";let r=hr(n),a;try{a=new i({...e,container:o})}catch(f){throw r(),n.remove(),document.body.style.overflow=s,f}a.prevFocus=t,a.modalCleanup=()=>{a.modalCleanup=null,r(),document.body.style.overflow=s,a.escHandler&&document.removeEventListener("keydown",a.escHandler),n.remove();let f=a.prevFocus;a.prevFocus=null,f?.isConnected&&f.focus({preventScroll:!0})};let l=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),c=()=>{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},d=(f,T)=>{let w=f;for(;w;){let v=window.getComputedStyle(w);if(w.hidden||w.getAttribute("aria-hidden")==="true"||w.hasAttribute("inert")||v.display==="none"||v.visibility==="hidden"||v.visibility==="collapse")return!0;if(w===T)return!1;w=w.parentElement}return!0},p=f=>[...f.querySelectorAll(l)].filter(T=>T.tabIndex>=0&&!T.matches(":disabled")&&!d(T,f)),m=(f,T)=>{let w=p(f),v=T?w[w.length-1]:w[0];v?v.focus({preventScroll:!0}):(f.hasAttribute("tabindex")||(f.tabIndex=-1),f.focus({preventScroll:!0}))},h=!1,y=()=>{if(h)return;h=!0,a.modalCleanup?.();let f=()=>{a.destroy(),e.onClose?.()};a.hold&&!a.handedOff?a.release().finally(f):f()};a.closeModal=y,n.addEventListener("mousedown",f=>{f.target===n&&y()}),a.escHandler=f=>{if(f.key==="Tab"){if(f.defaultPrevented)return;let T=c(),w=p(T),v=w[0],A=w[w.length-1],_=document.activeElement;!v||!A?(f.preventDefault(),m(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"&&(a.tableDialog?(f.preventDefault(),a.cancelTableDialog()):a.confirmSeat?(f.preventDefault(),a.cancelConfirm()):a.bestAvailableConfirm?(f.preventDefault(),a.bestAvailableConfirm=!1,a.syncTray()):(f.preventDefault(),y()))},document.addEventListener("keydown",a.escHandler);try{let f=a.render();a.els.close?.classList.add("on"),a.els.close?.addEventListener("click",y),await f}catch(f){throw a.destroy(),f}return a.destroyed||m(c(),!1),a}wireController(e){return new H.PickerController({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,categoryPriceRanges:()=>this.mapPriceRanges(),flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:Et(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,this.seatsReadyResolve?.(),this.seatsReadyResolve=null,e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let n=this.controller.getGAAreas().find(o=>o.id===t);n&&(this.collapseSheet(),Gn(this,n,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),wr(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,n=this.holdConflicted;this.holdExpiredUnits=kl(this.hold),this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.holdConflicted=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.lapse.deferExpiryToast(()=>{if(t||n){this.toast((0,H.t)("picker.holdExpired",void 0)||"Your hold expired \u2014 seats released. Pick again.","warning");return}this.showHoldExpired()}),this.syncTray(),this.emitHoldChange(),this.opts.onHoldExpired?.()},onAvailabilityRefresh:t=>this.lapse.handle(t),confirmSelection:this.opts.confirmSelection,onSelect:t=>{if(this.salesClosed){this.controller.deselect([t.id]),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){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((0,H.t)("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),hostCardOpen:()=>this.tipPinned||!!this.confirmSeat,onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onError:t=>this.opts.onError?.(t)})}async render(){if(this.rendered)return this;let e=performance.now(),t={},n=h=>Math.round((performance.now()-h)*100)/100;this.rendered=!0,_t();let o=performance.now(),s=Di(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=Xo(this.opts.container),{root:c,els:d,mapHost:p}=ks(l,(h,y)=>this.tf(h,y),this.opts.theme);this.root=c,this.els=d,this.mapHost=p,Bi(c,s,h=>{t.loadLocale=n(o),this.destroyed||this.applyActiveLocale(h,r)}),la(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");return m.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(m),t.mountBuyerShell=n(a),t.skeletonPaint=n(e),this.loadAndFinishChart(m,t,n,e,c)}async loadAndFinishChart(e,t,n,o,s){this.startRealtime();let r=await this.loadChart(e,t,n);if(!r)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=n(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=Yo((0,H.t)("picker.testMode"),(0,H.getLocale)()),v.setAttribute("aria-label",(0,H.t)("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.currencyResolved=!0,this.eventTimezone=r.timezone??null,Zo(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?Mi(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=n(a);let p=performance.now();if(!await this.restoreHoldForFirstPaint(t))return this;if(t.restoreHold=n(p),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncOffer(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let m=this.controller.doc,h=Qi(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:n(o),performanceProfile:t,seatCount:this.allSeats().length,objectCount:m?.objects.length??0,sectionCount:m?.objects.filter(v=>v.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:m?.name,view:this.buyerView,load:h,transport:this.opts.transport?"custom":"pubapi"};ma(T,(v,A)=>this.emitAnalytics(v,A));let w=r.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",ho({...T,performanceProfile:{...T.performanceProfile,...w}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=r,await this.registerAgentTools(),this}registerAgentTools(){return ua(this)}webMcpHost(e){return po(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=Ll(()=>{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 n=()=>{if(this.root?.dataset.layout!=="narrow")return;let o=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!o)),this.els.pricesSec?.setAttribute("aria-expanded",String(!o)),!o&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",o=>{o.target.closest("select,button")||n()}),this.els.pricesSec?.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||o.target.closest("select,button")||(o.preventDefault(),n())}),e.addEventListener("click",o=>{let s=o.target.closest("[data-sl-info]");if(!s||!e.contains(s))return;o.stopPropagation();let r=s.closest(".sl-info"),a=!r?.classList.contains("open");this.closeInfoPops(r),r?.classList.toggle("open",a),s.setAttribute("aria-expanded",String(a))}),e.addEventListener("pointerdown",o=>{o.target.closest(".sl-info")||this.closeInfoPops()}),this.tipEl=document.createElement("div"),this.tipEl.setAttribute("role","tooltip"),this.tipEl.className="sl-tip",this.els.map.appendChild(this.tipEl),this.els.map.addEventListener("pointerdown",o=>{this.handleMapPointerDown(o)},!0),this.els.map.addEventListener("mousemove",o=>{if(this.tipPinned)return;let s=this.els.map.getBoundingClientRect();this.tipPos={x:o.clientX-s.left,y:o.clientY-s.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.els.cta.dataset.act==="find"?this.openBestSeatsForm():this.handleCta()})}sheetState(){let e=this.root?.dataset.sheet;return e==="mini"||e==="open"?e:"peek"}sheetHasCards(){return this.root?.getAttribute("data-has-selection")==="true"}setSheetState(e){let t=this.root;if(!t)return;let n=t.dataset.sheet;t.dataset.sheet=e==="mini"&&!this.sheetHasCards()?"peek":e,this.syncSheetAffordance(),n==="mini"&&t.dataset.sheet!=="mini"&&this.scheduleFit()}syncSheetAffordance(){let e=this.sheetState(),t=e==="open"||e==="peek"&&this.sheetHasCards(),n=this.els.sheetToggle;n?.setAttribute("aria-expanded",String(e==="open")),n?.setAttribute("aria-label",t?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))}cycleSheet(){let e=this.sheetState();e==="open"||e==="mini"?this.setSheetState("peek"):this.setSheetState(this.sheetHasCards()?"mini":"open")}stepSheet(e){let t=vo.indexOf(this.sheetState()),n=Math.min(vo.length-1,Math.max(0,t+e));this.setSheetState(vo[n])}setSheetOpen(e){this.setSheetState(e?"open":"peek")}openBestSeatsForm(){this.setSheetOpen(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||this.setSheetState("peek")}observeLayout(e){let t=()=>{let n=e.clientWidth;if(n<=0)return;let o=e.clientHeight,s=n!==this.pickerLayoutSize.width||o!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:n,height:o};let r=this.fullscreenMeasurementChanged(n,o);this.reportFramedHeight();let a=n<640?"narrow":"wide",l=o<560?"compact":"comfortable",c=e.dataset.layout!==a||e.dataset.density!==l;c&&(e.dataset.layout=a,e.dataset.density=l,this.controller.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,n){let o=performance.now();this.loadAbort=new AbortController;let s=await Pt(async()=>{let a=await this.controller.render(e);return a&&this.controller.getRenderer()?.isSeatRevealPending?.()&&await new Promise(l=>{this.seatsReadyResolve=l}),a},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.seatsReadyResolve?.(),this.seatsReadyResolve=null,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=n(o),this.destroyed?null:r?(Object.assign(t,r.performanceProfile),r):(Ae({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:Oe(this.opts.event),transport:this.opts.transport?"custom":"pubapi"}),li(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),li(this.els.boot,{title:this.tf("picker.loadingSeatMap","Loading seat map\u2026"),busy:!0});let a=performance.now();this.loadAndFinishChart(e,{},n,a,this.root)},{once:!0}),null)}async restoreHoldForFirstPaint(e){let t=[this.els.side,this.els.rail].filter(Boolean),n=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;Ae({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:Oe(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let r=li(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;li(this.els.boot,{title:this.tf("picker.restoringSeats","Checking your saved seats\u2026"),busy:!0})}}return!1}finally{t.forEach((o,s)=>{n[s]||o.removeAttribute("inert")})}}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=Tn(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 xn(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(n,o)=>this.tf(n,o),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:n=>this.setColorblindSafe(n),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:n=>{this.limitedViewFilter=n,this.controller.setCommercialLimitedFilter(n),this.pushAvailabilityTo3d()},applyAccessibilityFilter:n=>this.applyAccessibilityFilter(n),focusSeatsForFilter:()=>this.focusSeatsForFilter(),stepToAccessibleSection:n=>this.controller.focusNextAccessibleSection?.([n])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast((0,H.t)("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,n=this.els.headInfo?.parentElement;t&&n&&t.parentElement!==n&&(t.classList.add("sl-fs-pill"),n.insertBefore(t,this.els.hold??null));let o=this.extendEl;if(o){let r=e?this.regions["bottom-center"]??this.els.map:n;r&&o.parentElement!==r&&(o.dataset.dock=e?"map":"head",r===n?r.insertBefore(o,this.els.close??null):r.appendChild(o))}let s=this.els.pricesSec;s&&(e?(s.setAttribute("role","button"),s.tabIndex=0,s.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(s.removeAttribute("role"),s.removeAttribute("aria-expanded"),s.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){Ka(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>${F(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}tf(e,t){return b(e,t)}buildSoldoutOverlay(){if(!this.els.map)return;let e=document.createElement("div");e.className="sl-soldout",e.setAttribute("role","status");let t=(this.controller.doc?.theme?.brandName??this.opts.theme?.brandName??this.els.name?.textContent??this.tf("picker.soldOutEyebrow","This event")).toUpperCase(),n=document.createElement("div");n.className="sl-soldout-eyebrow",n.textContent=t;let o=document.createElement("div");o.className="sl-soldout-title",o.textContent=this.tf("picker.soldOutTitle","Sold out");let s=document.createElement("p");s.className="sl-soldout-copy",s.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(n,o,s),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let n=this.controller.getGAAreas().length>0,o=this.isSoldOut(e,t,n);o!==this.soldOut&&(this.soldOut=o,this.soldoutEl?.classList.toggle("on",o))}isSoldOut(e,t,n){return!n&&e.length>0&&e.every(o=>(t[o.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed);let t=this.els.closedPillText??e;t.textContent=this.tf("picker.salesClosedPill","Sales are closed")}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.tf("picker.salesClosedToast","Sales are closed for this event.")),this.syncCta(),this.syncTray()}badgeHidden(e){return!!e?.hideBadge}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let n=document.createElement("a");n.className="sl-powered",n.href="https://seatlayer.io/?ref=picker",n.target="_blank",n.rel="noopener noreferrer",n.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer"));let o=document.createElement("span");o.className="sl-powered-mark",o.setAttribute("aria-hidden","true"),o.innerHTML=Ui;let s=document.createElement("span");s.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),n.append(o,s),t.appendChild(n)}buildRegions(){if(!this.els.map)return;let e=["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"];for(let t of e){let n=document.createElement("div");n.className="sl-anchor",n.dataset.region=t,this.els.map.appendChild(n),this.regions[t]=n}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,t){let n=setTimeout(()=>{this.motionTimers.delete(n),this.destroyed||e()},t);this.motionTimers.add(n)}animateOnce(e,t,n=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),n))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){let t=this.reducedMotion(),n=(e.items??[]).filter(o=>o.objectType!=="ga").slice(0,10).map(o=>this.controller.seatByLabel(o.label)).filter(o=>!!o);ir({regions:this.els,categories:this.controller.doc?.categories,pop:o=>this.controller.flashSeat(o,this.cssVar("--sl-accent")||"#f4b740"),focus:(o,s)=>this.controller.focusSection(o,s),focusSeats:o=>this.controller.focusSeats?.(o,{animate:!t})===!0,reducedMotion:t,screenPoint:o=>this.controller.worldToScreen(o),schedule:(o,s)=>this.scheduleMotion(o,s)},n)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(n=>n.id!==e&&n.id!==t)}pendingSelectionCount(){return Ya(this)}heldTicketCount(){return Xa(this)}totalTicketCount(){return Za(this)}updateSelectionCapacity(){Qa(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){Ja(this,e,t)}setCtaPhase(e){el(this,e)}runCheckoutHandoff(e,t){return tl(this,e,t)}holdStorageKey(){return il(this)}rememberedHoldId(){return nl(this)}rememberHold(e){ol(this,e)}forgetHold(){sl(this)}resumeHoldFromServer(e,t=!1){return rl(this,e,t)}restoreRememberedHold(){return al(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let n=this.controller.getActiveFloorId();return(t.find(o=>o.id===n)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=na({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 bn(this,e)}catPriceRange(e){return yn(this,e)}buildPriceFilter(){bl(this)}applyPriceBand(e){yl(this,e)}buildArenaChrome(){let e=this.controller.doc;if(this.rungsEl=null,this.projectionEl=null,this.floorsEl=null,!e||!this.els.map){this.syncArenaViewportInsets();return}let t=e.objects.some(n=>n.type==="section")||(e.floors??[]).some(n=>n.objects.some(o=>o.type==="section"));if(this.canOffer3d()){let n=document.createElement("div");n.className="sl-projection",n.setAttribute("role","group"),n.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),n.innerHTML=`<button type="button" data-view="map" aria-pressed="true" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,n.querySelectorAll("button").forEach(o=>{if(o.dataset.view==="venue3d")for(let s of["pointerenter","focus","pointerdown"])o.addEventListener(s,Ai,{once:!0});o.addEventListener("click",()=>{this.setBuyerView(o.dataset.view)})}),this.regions["top-right"].appendChild(n),this.projectionEl=n,this.syncProjection()}if(t){let n=[...e.objects,...(e.floors??[]).flatMap(p=>p.objects)],o=new Set((e.zones??[]).map(p=>p.id)),a=e.floorOverview==="combined"&&(e.floors?.length??0)>1&&o.size===0||n.some(p=>p.type==="section"&&typeof p.zone=="string"&&o.has(p.zone))?["zones","sections","seats"]:["sections","seats"],l=document.createElement("div");l.className="sl-rungs on sl-mo-indicator",l.setAttribute("role","group"),l.setAttribute("aria-label",(0,H.t)("picker.zoomLevel"));let c={zones:(0,H.t)("picker.rungLabel.zones"),sections:(0,H.t)("picker.rungLabel.sections"),seats:(0,H.t)("picker.rungLabel.seats")},d={zones:(0,H.t)("picker.rungTip.zones"),sections:(0,H.t)("picker.rungTip.sections"),seats:(0,H.t)("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 m=p.dataset.rung;this.controller.setRung(m),m==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(l),this.rungsEl=l,this.syncRung()}if(this.controller.isMultiFloor()){let n=Er({floors:this.controller.getFloors(),tf:(o,s)=>this.tf(o,s),onChoose:o=>{o===""?this.controller.setFloorOverview(!0):this.controller.setFloor(o),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});this.regions["top-left"].appendChild(n),this.floorsEl=n,this.syncFloors()}this.syncArenaViewportInsets()}syncArenaViewportInsets(){let e=this.els.map,t=e?Tr(e.getBoundingClientRect(),[this.floorsEl,this.rungsEl,this.projectionEl].map(n=>n?.isConnected?n.getBoundingClientRect():null),[]):{top:0,right:0,bottom:0,left:0};Object.keys(t).every(n=>t[n]===this.arenaViewportInsets[n])||(this.arenaViewportInsets=t,this.controller.setViewportInsets(t),this.syncFitClearance())}syncFitClearance(){let e=this.els.map,t=this.els.zoom,n=this.root?.dataset.layout==="narrow",o=0;if(n&&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(n=>{let o=n.dataset.rung===e;n.classList.toggle("on",o),n.setAttribute("aria-pressed",String(o))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit,n=this.els?.zin;if(!e||!this.root)return;let o=this.controller.getRenderer?.(),s=this.controller.canZoomIn?.()===!1||o?.seatsPickable?.()===!0,r=kr({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0,atVenueFit:this.controller.atVenueFit?.()})==="none",a=e.disabled!==r||!!t&&t.disabled!==r||!!n&&n.disabled!==s||e.hidden||!!n?.hidden||!!t?.hidden;e.disabled=r,e.hidden=!1,n&&(n.disabled=s,n.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||!Ci()?!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)?Ol/2:Ol}syncFloors(){Cr(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new cn({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(o=>o.type==="section"&&!this.controller.isSectionClosed(o.id)&&this.controller.getSectionSeatCount(o.id)>0);if(t.length<2)return null;let n=t.findIndex(o=>o.id===e);return n<0?null:{previous:t[(n-1+t.length)%t.length],next:t[(n+1)%t.length]}}markedSeatAnnouncement(e){let t=oo(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return Nr(t,e.displayLabel??e.label,this.opts.locale)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.markedSeatAnnouncement(e);if(t){this.srEl.textContent=t;return}let n=this.controller.doc?.categories.find(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=n?this.catPriceRange(n):void 0,a=!this.suppressPricing&&r?r.min===r.max?this.money(r.min):`${this.money(r.min)}\u2013${this.money(r.max)}`:void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),d=rt(c),p=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,m=l?`${d} ${p}, ${l.bookingMode==="variable"?(0,H.t)("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):(0,H.t)("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${p}`:c?.objectType==="table"?`${d} ${p}, ${(0,H.t)("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:(0,H.t)("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${m}, ${n?.label??e.categoryKey}${a?`, ${a}`:""}, ${s}`}showTableDialog(e,t,n){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=n??document.activeElement;let o=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),s=e.bookingMode==="variable",r=document.createElement("div");r.className="sl-table-scrim",r.innerHTML=us(e,{variable:s,held:t,typeWord:rt(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 n=t.querySelector("output[data-table-qty]");n&&(n.value=String(e.quantity));let o=t.querySelector("input[data-table-qty]");o&&(o.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let s=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),r=t.querySelector("[data-table-total]");r&&(r.textContent=this.money(s*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let n=this.tableDialogEl?.querySelector(".sl-table-confirm");if(n&&(n.disabled=!0,n.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let o=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!o){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},this.startHoldTimer(o.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,H.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(o){this.opts.onError?.(o),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){n&&(n.disabled=!1,n.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new un({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),paidPrice:(e,t,n,o)=>this.paidPrice(e,t,n,o),offerName:(e,t)=>this.offerPrice(e,t)?.offerName,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){ea(e,t,this.reducedMotion())}addSeatLabel(e){return ta(e,(t,n)=>this.tf(t,n))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,n=this.controller.doc,o=this.controller.getActiveFloorId(),s=e.focalPoint??n?.floors?.find(p=>p.id===o)?.focalPoint??n?.focalPoint??{x:0,y:0},r,a,l=!1;if(e.viewUrl){let p,m=null;try{let y=e.viewMeta?.previewUrl;y&&y!==e.viewUrl?(m=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&&!m||!this.root||!this.seatViewEnabled())return;let h={url:p,...m?{previewUrl:m}:{},...e.viewMeta?.sourceWidth!==void 0?{sourceWidth:e.viewMeta.sourceWidth}:{},...e.viewMeta?.sourceHeight!==void 0?{sourceHeight:e.viewMeta.sourceHeight}:{},...e.viewMeta?.previewWidth!==void 0?{previewWidth:e.viewMeta.previewWidth}:{},...e.viewMeta?.previewHeight!==void 0?{previewHeight:e.viewMeta.previewHeight}:{},...e.viewMeta?.variants?.length?{variants:e.viewMeta.variants}:{},...e.viewMeta?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};r=h,a=(0,En.seatViewDisclosure)(h),l=(0,En.isAuthoredSeatView)(h)}else{let p;try{let{generateSeatPanorama:m}=await Pi();p=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:p.url,generated:!0},a=(0,H.t)("picker.illustrationCaption",{m:p.distanceM})}this.closeSeatView(!1);let c=(0,H.t)("picker.viewFromSeat",{label:e.label}),d=Wi({root:this.root,source:r,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:et(),viewFromSeatLabel:c,real360Label:(0,H.t)("picker.real360"),previewLabel:(0,H.t)("picker.preview"),resolveAsset:p=>this.buyerAssetUrls.resolve(p),onClose:()=>this.closeSeatView()});this.viewEl=d.element,this.viewCleanup=()=>d.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let n=Number.isInteger(e);return(0,H.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(o,s)=>`${o} ${s}`,...n?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),n=xr(e,t);if(n==null)return;let o=6*36e5,s=Math.min(Math.max(n-t+1e3,1e3),o);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},s)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<jp}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||this.offerReadIsCurrent()||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}refreshOfferAvailability(e){if(!this.api.availability||this.destroyed)return Promise.resolve();if(this.offerReadInFlight)return this.offerReadInFlight;if(this.offerReadIsCurrent())return Promise.resolve();let t=this.readOfferAvailability(e).finally(()=>{this.offerReadInFlight===t&&(this.offerReadInFlight=null)});return this.offerReadInFlight=t,t}async readOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;this.offerReadSettledAt=Date.now();let n=ln(t);if(!n)return;this.offerAvailability=n,this.applyChannelPricing(n.channelPricing),this.scheduleOfferBoundary(n);let o=Sr(this.hostPricing?.prices,n),s=Object.keys(o).length>0||this.hostPricing?.formatter?{prices:o,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(s),this.syncMapPriceRanges(),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(n)}catch{!this.destroyed&&!this.offerBoundaryTimer&&!document.hidden&&(this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},3e4))}}offerPrice(e,t){if(!e)return null;let n=this.offerAvailability?.prices.filter(o=>o.categoryKey===e)??[];return t!==void 0?n.find(o=>(o.tierId??null)===t)??n.find(o=>o.tierId==null)??null:n[0]??null}mapPriceRanges(){if(this.api.availability&&!this.offerAvailability)return null;if(this.offerAvailability?.prices.some(e=>e.tierId!==void 0))return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(e=>{let t=this.catPriceRange(e);return t?[[e.key,t]]:[]}))}syncMapPriceRanges(){this.controller.getRenderer()?.setCategoryPriceRanges?.(this.mapPriceRanges())}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerCountdownTimer=null,e.classList.remove("sl-offer-compact"),!this.currencyResolved){e.classList.remove("has"),e.replaceChildren();return}if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,n=t?.release??null,o=!n&&t?.upcoming?.pricingMode!=="matrix"?t?.upcoming??null:null;if(!t||t.state==="closed"||t.state==="sold-out"||!n&&!o){e.classList.remove("has"),e.replaceChildren();return}let s=n??o,r=s.pricingMode==="matrix",a=document.createElement("div");a.className="sl-offer-main";let l=document.createElement("div");l.className="sl-offer-copy";let c=document.createElement("span");c.className="sl-offer-kicker",c.textContent=n?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let d=document.createElement("strong");d.className="sl-offer-name";let p=s.name||(n?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));d.innerHTML=kt(p,F);let m=document.createElement("span");m.className="sl-offer-line";let h=[];if(!r&&n&&t.fromPrice!=null&&h.push(this.money(t.fromPrice/100)),!r&&n&&s.remaining!=null&&h.push((0,H.t)("picker.offerRemainingAvailable",{count:s.remaining})),n&&s.endsAt!=null){let v=!this.opts.locale||/^en(?:-|$)/i.test(this.opts.locale)?es(s.endsAt):null;if(h.push(v??(0,H.t)("picker.offerUntil",{time:Mi(s.endsAt,this.eventTimezone,this.opts.locale)})),v){let A=Math.max(1e3,s.endsAt-Date.now()),_=A%6e4||6e4;this.offerCountdownTimer=setTimeout(()=>{this.offerCountdownTimer=null,Date.now()>=s.endsAt?this.refreshOfferAvailability(!1):this.syncOffer()},Math.min(_+25,A+25))}}if(o?.startsAt!=null&&h.push((0,H.t)("picker.offerStarts",{time:Mi(o.startsAt,this.eventTimezone,this.opts.locale)})),m.textContent=h.join(" \xB7 "),r||l.append(c),l.append(d,m),r){e.classList.add("sl-offer-compact"),a.append(l),e.replaceChildren(a),e.classList.add("has");return}let y=document.createElement("details");y.className="sl-offer-info";let f=document.createElement("summary");f.setAttribute("aria-label",(0,H.t)("picker.howOfferWorks",{name:d.textContent??""})),f.textContent="i";let T=document.createElement("div");T.className="sl-offer-detail",T.textContent=n?this.tf("picker.offerDetailActive","This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over."):this.tf("picker.offerDetailUpcoming","Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts."),y.append(f,T),a.append(l,y),e.replaceChildren(a),e.classList.add("has")}paidPrice(e,t,n,o){let s=o?this.channelByObject.get(o):void 0;if(s&&e){let a=this.pricesByChannel.get(s)?.find(l=>l.categoryKey===e&&l.tierId===(t??null));if(a)return a.price}let r=e?this.opts.pricing?.prices?.[e]:void 0;return r===void 0?n:typeof r=="number"?r:t&&r.tiers?.[t]!==void 0?r.tiers[t]:r.base??n}legendDeps(){return vl(this)}syncPriceRail(e,t,n=this.legendDeps()){wl(this,e,t,n)}syncPrices(){this.currencyResolved&&xl(this)}focusCategory(e){Sl(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(n=>!e.has(n.label)&&(this.controller.getStatus(n.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(n=>n.id)),this.toast((0,H.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:n,heldLabels:o,total:s,count:r}=gn(this),a=[],l=new Set;if(!this.salesClosed){let g=this.performanceGroup?.nightSummary?.()??[];g.length&&a.push(Mr(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>${F(L.label)}</button>`)}let c={salesClosed:this.salesClosed,hasPicks:e.length>0||n.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(g=>g.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(ja(c)),this.els.trayHint&&(this.els.trayHint.textContent=Ga(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed);let d=!e.length&&!n.length&&!je(this.gaQty,this.hold?.items??[]);if(!this.performanceGroup&&!this.salesClosed&&!this.hold&&(d||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($a({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,N,R=1,O,E,D,z)=>Fa({categoryLabel:D,offerName:z,d:g?this.controller.seatDetails(g):null,area:N==="ga"?t.find(j=>j.id===O):void 0,label:L,objectType:N,quantity:R,identity:E,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),m=F,h=[];for(let g of Ns(n)){let L=g.objectType==="ga"?`held:ga:${g.objectId}:${g.tierId??""}`:`held:${g.label}`;l.add(L);let N=this.controller.doc?.categories.find(B=>B.key===g.categoryKey),R=g.tierId?N?.tiers?.find(B=>B.id===g.tierId)?.name:void 0,O=this.offerPrice(g.categoryKey,g.tierId??null)?.offerName,E=g.objectType!=="ga"?this.controller.seatByLabel(g.label):null,D=g.objectType==="table"?this.controller.tableSelection(g.label):null,z=E?this.controller.seatDetails(E.id):null,j=this.seatViewEnabled()&&!!E&&g.objectType!=="table"&&!!this.deliverableViewReference(E),de=m(this.tf("picker.heldForYou","Held for you")),X=D?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(g.label))}">${m((0,H.t)("picker.guestsCountEdit",{count:g.quantity??1}))}</button>`:"",we=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:(0,H.t)("picker.removeHeldTicketLabel",{label:jn(g,t)}),locateId:E?.id??null,section:z?.sectionLabel??"",rowLabel:z&&Q(z)||"",seatLabel:z?.seatNumber??g.label,categoryLabel:`${N?.label??g.categoryKey}${R?` \xB7 ${R}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(g.categoryKey)??N?.color??"",identityHtml:p(E?.id??null,g.label,g.objectType,g.quantity??1,g.objectId,D??void 0,`${N?.label??g.categoryKey}${R?` \xB7 ${R}`:""}`,O),stateHtml:`<span class="sl-ticket-state held" aria-label="${de}" title="${de}"><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:X,amount:we,amountText:this.suppressPricing?"":this.money(we),noteHtml:tt(E??void 0),railHtml:this.performanceGroup?"":fo((0,H.t)("picker.removeHeldTicketLabel",{label:jn(g,t)}),j?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 N=this.controller.doc?.categories.find(B=>B.key===g.categoryKey),R=g.tiers&&g.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${m(g.id)}" aria-label="${m((0,H.t)("picker.ticketTierFor",{label:g.label}))}">`+Va(g.tiers,g.tierId,m)+"</select>":"",O=g.tiers?.find(B=>B.id===g.tierId)??g.tiers?.[0],E=this.offerPrice(g.categoryKey,O?.id??null)?.offerName,D=O?.buyerMessage?.trim()||(O?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),z=this.controller.seatDetails(g.id),j=m(this.tf("picker.selected","Selected")),de=(0,H.t)("picker.removeSeatLabel",{label:g.label}),X=(g.objectType==="table"&&g.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(g.label))}">${m((0,H.t)("picker.guestsCountEdit",{count:g.quantity??1}))}</button>`:"")+R,we=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:z?.sectionLabel??"",rowLabel:z&&Q(z)||"",seatLabel:z?.seatNumber??g.label,categoryLabel:N?.label??g.categoryKey,identityHtml:p(g.id,g.label,g.objectType,g.quantity??1,g.objectId,g,N?.label??g.categoryKey,E),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(g.categoryKey)??N?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${j}" title="${j}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:X,amount:we,amountText:this.suppressPricing?"":this.money(we),removeAria:de,noteHtml:tt(g)+(D?`<small class="sl-tier-note">${m(D)}</small>`:""),railHtml:fo(de,y&&g.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(g.label)??{})?g.label:null)})}h.length&&a.push(h.map(za).join("")),t.length&&a.push(zs(this,t,n)),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let f=this.performanceGroup?.selectNight;f&&zr(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(`
|
|
3261
|
+
`)))}"`:"")+(i.seatIds.length?` data-seat="${e(i.seatIds.join(" "))}"`:"")+(i.locateId?` data-locate="${e(i.locateId)}"`:"")}function za(i){let e=F;return`<div class="sl-chip${i.held?" sl-held":""}${i.fresh?" sl-enter":""}"`+kp(i)+">"+(i.held?i.stateHtml:`<span class="sl-chip-dot" style="background:${C(i.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${i.identityHtml}`+(i.extrasHtml?`<div class="sl-chip-sub">${i.extrasHtml}</div>`:"")+`${i.noteHtml}</div>`+(i.amountText?`<span class="amt">${e(i.amountText)}</span>`:"")+i.railHtml+"</div>"}function fo(i,e){let t=F(i),n=e?F(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${n}" aria-label="${F((0,ui.t)("picker.viewFromSeat",{label:e}))}"><svg viewBox="0 0 24 24"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z"/><circle cx="12" cy="12" r="3"/></svg></button>`:"")+`<button type="button" class="rm" aria-label="${t}"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function $a(i){return i.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${b("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,ui.t)("picker.willFindSeatsTogether",{count:i.quantity})}</b><span>${b("picker.manualTicketsRemovedNote","Your manually selected tickets will be removed only after a new group is secured.")}</span></div><div class="sl-ba-actions"><button type="button" data-ba-cancel>${b("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${b("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="sl-ba-title-t">${b("picker.findSeatsTogether","Find seats together")}</span>`+Tt({id:"sl-info-best-seats",label:b("picker.aboutBestSeats","About finding seats together"),text:b("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")})+(i.offerPremium?`<button type="button" class="sl-ba-premium${i.premium?" on":""}" data-ba-premium aria-pressed="${i.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${b("picker.bestSeatsPremium","Best seats")}</button>`:"")+`</div><div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${b("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${i.quantity}</span><button type="button" data-ba="1" aria-label="${b("picker.moreSeats","More seats")}">+</button></div>`+(i.categories.length>1?`<select class="sl-ba-cat" aria-label="${F(b("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${F(b("picker.anyTicketType","Any ticket type"))}</option>`+i.categories.map(e=>`<option value="${F(e.key)}"${i.selectedCategory===e.key?" selected":""}>${F(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(i.zones.length?`<select class="sl-ba-zone" aria-label="${b("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${b("picker.anyVenueZone","Any venue zone")}</option>`+i.zones.map(e=>`<option value="${F(e.id)}"${i.selectedZone===e.id?" selected":""}>${F(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${i.busy?" sl-busy":""}"${i.busy?" disabled":""}>`+(i.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${b("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,ui.tCount)("picker.findBestSeatsCount",i.quantity))+"</button>"+(i.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${b("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function ja(i){if(i.salesClosed&&!i.hasPicks){let e=i.whenText?`<span class="when">${F(i.whenText)}</span>`:"";return`<div class="sl-closed-note" role="status"><b>${b("picker.salesClosedPill","Sales are closed")}</b><span>${b("picker.salesClosedCopy","Ticket sales for this event have ended.")}${e}</span></div>`}return""}function Ga(i){return i.hasGaAreas?i.seated?i.venue3d?b("picker.trayHintChoose3dOrStanding","Choose a seat in the 3D venue \u2014 or grab standing tickets below."):b("picker.trayHintTapOrStanding","Tap a seat on the map \u2014 or grab standing tickets below."):i.venue3d?b("picker.gaTrayHintChoose3dArea","Choose an area in the 3D venue to select tickets."):b("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets."):i.groupMode==="per_performance"?b("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):i.groupMode?b("picker.groupTrayHint","Choose seats once \u2014 the same seats will be held for every performance."):i.venue3d?b("picker.trayHintChoose3dOrBest","Choose a seat in the 3D venue, or let us pick the best available for you."):b("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}var go=6e4,qa=5*6e4,Tp=String(Math.round(qa/6e4));function Ka(i){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(i.regions["bottom-center"]??i.els.map).appendChild(e),i.extendEl=e,i.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),i.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),i.els.extendBtn.textContent=Wa(i),i.els.extendDismiss.setAttribute("aria-label",i.tf("picker.close","Close")),i.els.extendBtn.addEventListener("click",()=>{i.handleExtend()}),i.els.extendDismiss.addEventListener("click",()=>{i.extendDismissed=!0,i.setExtendPrompt(!1,0)})}function Wa(i){return i.tf("picker.addMinutes","+{count} min").replace("{count}",Tp)}function Ya(i){let e=i.hold?.items??[],t=new Set(e.map(o=>o.label));return i.committedSelection().filter(o=>!t.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0)+je(i.gaQty,i.hold?.items??[])}function Xa(i){return(i.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function Za(i){let e=new Set((i.hold?.items??[]).map(n=>n.label)),t=i.committedSelection().filter(n=>!e.has(n.label)).reduce((n,o)=>n+(o.quantity??1),0);return i.heldTicketCount()+t+je(i.gaQty,i.hold?.items??[])}function Qa(i){let e=new Set((i.hold?.items??[]).map(o=>o.label)),t=i.committedSelection().filter(o=>e.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0),n=Math.max(0,i.maxTickets-i.heldTicketCount()-je(i.gaQty,i.hold?.items??[]));i.controller.setMaxSelection(t+n)}function Ja(i,e=i.lastTrayCount,t=i.pendingSelectionCount()){let n=i.els.cta;if(!n)return;if(delete n.dataset.act,i.salesClosed){n.disabled=!0,n.textContent=i.tf("picker.salesClosedCta","Sales closed");return}if(i.ctaPhase==="holding"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(i.ctaPhase==="checkout"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let o=!i.hold&&i.performanceGroup?.selectionMode==="per_performance"?i.performanceGroup.submissionState?.():null;if(o&&!o.ready){n.disabled=!0,n.textContent=i.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(o.complete)).replace("{total}",String(o.total));return}let s=i.controller.getSelectionValidity(e);if(s&&!s.isValid){n.disabled=!0,n.textContent=wn(s,(r,a)=>i.tf(r,a),!0);return}if(!e&&i.root?.dataset.layout==="narrow"&&!i.performanceGroup&&!i.hold){n.disabled=!1,n.dataset.act="find",n.textContent=i.tf("picker.findBestSeats","Find best seats");return}n.disabled=e===0,n.textContent=i.hold?t?(0,Ua.t)("picker.secureMoreAndCheckout",{count:t}):i.tf("picker.continueToCheckout","Continue to checkout"):e?i.performanceGroup?i.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(i.performanceGroup.performanceCount)):i.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):i.tf("picker.selectSeats","Select seats")}function el(i,e){i.ctaPhase=e,i.syncCta()}async function tl(i,e,t){i.setCtaPhase("checkout");try{await i.checkoutHandoff(e,t)}finally{i.ctaPhase==="checkout"&&!i.bookedShown&&i.setCtaPhase("idle")}}function il(i){return`@seatlayer/hold/v1/${encodeURIComponent(i.apiBase)}/${encodeURIComponent(i.opts.event)}`}function nl(i){if(i.opts.initialHoldId)return i.opts.initialHoldId;if(i.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(i.holdStorageKey())}catch{return null}}function ol(i,e){if(!(i.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(i.holdStorageKey(),e.holdId)}catch{}}function sl(i){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(i.holdStorageKey())}catch{}}async function rl(i,e,t=!1){try{let n=await i.controller.resumeHold(e);if(!n||i.destroyed)return null;let o={holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items};return i.hold=o,i.handedOff=!0,i.bookedShown=!1,i.ctaPhase="idle",i.startHoldTimer(o.expiresAt),i.rememberHold(o),i.syncTray(),i.emitHoldChange(),i.opts.onHoldRestored?.(o,o.seats??[],i.buildHandoff(o)),o}catch(n){let o=n?.status;if(o===404||o===409)i.forgetHold();else if(i.opts.onError?.(n),t)throw n;return null}}async function al(i){let e=i.rememberedHoldId();e&&await i.resumeHoldFromServer(e,!0)}function ll(i,e){i.stopHoldTimer(),i.holdExpiresAt=e,i.extendDismissed=!1,i.extendUsed=!1,i.hold&&i.rememberHold(i.hold);let t=i.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${i.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let n=t.querySelector('[data-ref="holdTime"]'),o=()=>{let s=Math.max(0,i.holdExpiresAt-Date.now());n&&(n.textContent=Ba(s)),t.classList.add("on"),t.classList.toggle("is-expiring",s>0&&s<=go),i.setExtendPrompt(s>0&&s<=go,s),(s<=0||!i.controller.currentHold())&&i.stopHoldTimer()};i.holdTimer=setInterval(o,500),o()}function cl(i){i.holdTimer&&clearInterval(i.holdTimer),i.holdTimer=null,i.els.hold?.classList.remove("on","is-expiring"),i.setExtendPrompt(!1,0)}function dl(i,e,t){if(!i.extendEl)return;let n=e&&t>0&&i.root?.dataset.layout!=="narrow"&&!i.extendDismissed&&!i.extendUsed&&!!i.controller.currentHold()&&!i.bookedShown;i.extendEl.classList.toggle("on",n)}function pl(i){if(!i.holdTimer)return;let e=Math.max(0,i.holdExpiresAt-Date.now());i.setExtendPrompt(e>0&&e<=go,e)}async function hl(i){let e=i.els.extendBtn,t=i.controller.currentHold();if(!(!t||!i.api.extend||i.extendUsed)){e.disabled=!0,e.textContent=i.tf("picker.addingEllipsis","Adding\u2026");try{let n=await i.api.extend(i.controller.key,t.holdId,qa);if(i.controller.currentHold()?.holdId!==t.holdId)return;i.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:n.expiresAt,items:t.items});let o=i.controller.currentHold();if(!o)return;i.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},i.holdExpiresAt=o.expiresAt,i.extendUsed=!0,i.extendEl?.classList.remove("on"),i.rememberHold(i.hold),i.emitHoldChange(),i.toast(i.tf("picker.moreTimeAdded","More time added \u2014 your seats are still held."),"success")}catch(n){if(n?.reason==="extend_limit"){i.extendUsed=!0,i.setExtendPrompt(!1,0);return}i.opts.onError?.(n),i.toast(i.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=Wa(i)}}}var yo=require("@seatlayer/core");function ul(i){return i?.previousPrice!=null&&i.previousPrice>i.price?i.previousPrice:null}function ml(i){return Cp(i)+(i.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!i.collapsed}">${i.esc(i.moreLabel)}</button>`:"")+Ap(i.status)}function Cp(i){let{esc:e,money:t}=i;return i.categories.map(n=>{let o=i.priceOf(n),s=i.rangeOf(n),r=i.offerOf(n.key),a=ul(r),l=i.activeKey===n.key;return`<div class="sl-price-row${i.bandKeys!=null&&!i.bandKeys.has(n.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(n.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(i.titleFor(n,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(i.colorOf(n))}"></span><span class="sl-price-label"><span class="sl-price-name">${e(n.label)}</span>`+(r?.offerName?Hi(r.offerName,e):"")+"</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 Ap(i){let e=t=>t.replace(/[&<>"']/g,n=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[n]);return`<div class="sl-status-key" aria-label="${e(i.legend)}"><span class="sl-status-item"><i class="sl-status-icon unavailable" aria-hidden="true"></i>${e(i.unavailable)}</span></div>`}function bo(i){let e=Math.abs(i.scrollLeft),t=e>2,n=e+i.clientWidth<i.scrollWidth-2;return i.dataset.fadeStart=String(t),i.dataset.fadeEnd=String(n),{start:t,end:n}}function fl(i){let{esc:e,money:t}=i;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${i.allActive}" title="${e(i.allWord)}"><span class="sl-rc-t">${e(i.allWord)}</span></button>`+i.categories.map(o=>{let s=i.rangeOf(o),r=i.priceOf(o),a=s?s.min===s.max?t(s.min):`${t(s.min)}+`:r!=null?t(r):null,l=Object.prototype.hasOwnProperty.call(i.left,o.key)&&i.left[o.key]<=0,c=ul(i.offerOf(o.key)),d=a?`${o.label} \u2014 ${a}${l?` (${i.soldOutWord})`:""}`:o.label;return`<button type="button" class="sl-rc" data-cat="${e(o.key)}" aria-pressed="${i.activeKey===o.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(i.colorOf(o))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??o.label)}</span></button>`}).join("")}function gl(i,e){let t=i.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let n=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(n.length<=5)return n.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let o=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),s=Math.ceil(o.length/4),r=[];for(let a=0;a<o.length;a+=s){let l=o.slice(a,a+s),c=Math.min(...l.map(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 bl(i){if(i.els.pricesSec?.querySelectorAll(".sl-price-select").forEach(o=>o.remove()),i.priceSelect=null,i.suppressPricing||!i.els.prices||!i.els.pricesSec)return;let e=gl((i.controller.doc?.categories??[]).filter(o=>!o.notForSale),i.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",i.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let n=document.createElement("option");n.value="all",n.textContent=i.tf("picker.allPrices","All prices"),t.appendChild(n);for(let o of e){let s=document.createElement("option");s.value=o.id,s.textContent=o.label,t.appendChild(s)}i.els.pricesSec.appendChild(t),i.priceSelect=t,t.addEventListener("change",()=>{i.applyPriceBand(e.find(o=>o.id===t.value)?.keys??null)})}function yl(i,e){if(i.focusedCatKey=null,i.priceBandKeys=e?new Set(e):null,i.priceSelect){let t=e?i.priceSelect.value:"all";i.priceSelect.value!==t&&(i.priceSelect.value=t)}i.controller.setCategoryFilter(e),i.controller.focusCategoryFilter(e),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}function vl(i){return{colorOf:e=>i.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>i.catPriceRange(e),priceOf:e=>i.catPrice(e),offerOf:e=>i.offerPrice(e),money:e=>i.money(e),esc:F}}function wl(i,e,t,n=i.legendDeps()){let o=i.els.railScroll,s=e.length>1;if(i.els.rail?.classList.toggle("has",s),!o)return;o.innerHTML=s?fl({...n,categories:e,left:t,activeKey:i.focusedCatKey,soldOutWord:i.tf("picker.soldOut","Sold out"),allWord:i.tf("picker.allPrices","All prices"),allActive:!i.focusedCatKey&&!i.priceBandKeys}):"";let r=e.map(a=>a.key).join("|");i.lastRailSignature!==r&&(i.lastRailSignature=r,o.scrollLeft=0),o.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){i.applyPriceBand(null);return}i.focusCategory(a.dataset.cat??"")})}),i.railEdgesBound||(i.railEdgesBound=!0,o.addEventListener("scroll",()=>bo(o),{passive:!0})),requestAnimationFrame(()=>bo(o))}function xl(i){let e=i.controller.doc;if(!e||!i.els.prices)return;let t=i.controller.categoryAvailability(),n=e.categories.filter(p=>!p.notForSale);i.syncSoldout(n,t);let o=i.legendDeps(),s=i.suppressPricing,r=s?{...o,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:o;s&&(i.els.pricesSec?.querySelector("span")?.replaceChildren(i.tf("picker.seatCategories","Seat categories")),i.els.pricesInfo?.remove()),i.syncPriceRail(n,t,r);let a=5,l=n.length-a,c=l>1&&!i.pricesExpanded,d=c?n.slice(0,a):n;i.els.prices.classList.toggle("sl-expanded",l>1&&i.pricesExpanded),i.els.prices.innerHTML=ml({...r,categories:d,left:t,collapsed:c,activeKey:i.focusedCatKey,bandKeys:i.priceBandKeys,titleFor:(p,m)=>m?i.tf("picker.showAllSeats","Show all seats"):(0,yo.t)("picker.showLabelSeatsOnMap",{label:p.label}),moreLabel:l>1?c?s?i.tf("picker.showAllCategories","Show all categories"):(0,yo.t)("picker.showAllTicketTypes",{count:n.length}):i.tf("picker.showFewer","Show fewer"):null,status:{legend:i.tf("picker.seatStatusLegend","Seat status legend"),unavailable:i.tf("picker.notAvailable","Not available")}}),i.els.prices.querySelectorAll(".sl-price-row").forEach(p=>{p.addEventListener("mouseenter",()=>i.controller.getRenderer()?.setCategoryHighlight?.(p.dataset.cat??null)),p.addEventListener("mouseleave",()=>i.controller.getRenderer()?.setCategoryHighlight?.(null));let m=()=>i.focusCategory(p.dataset.cat??"");p.addEventListener("click",m),p.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),m())})}),i.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{i.pricesExpanded=!i.pricesExpanded,i.syncPrices()})}function Sl(i,e){if(!e)return;let t=i.focusedCatKey===e?null:e;i.focusedCatKey=t,i.priceBandKeys=t?new Set([t]):null;let n=i.els.pricesSec?.querySelector(".sl-price-select");n&&(n.value="all"),i.controller.setCategoryFilter(t?[t]:null),i.controller.focusCategoryFilter(t?[t]:null),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}var Ft=require("@seatlayer/core");function be(i,e,t){let n=(0,Ft.t)(i,t);return n&&n!==i?n:t?e.replace(/\{(\w+)\}/g,(o,s)=>s in t?String(t[s]):o):e}function Lp(i){let e=(0,Ft.tCount)("picker.seatCount",i);return e.includes("picker.seatCount")?`${i} ${i===1?"seat":"seats"}`:e}function Mp(i){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(i)}catch{}return i.join(", ")}function Hp(i){if(i.length<2)return!1;let e=[...i].sort((t,n)=>t-n);return new Set(e).size!==e.length?!1:e[e.length-1]-e[0]===e.length-1}function Rp(i){let e=i.filter(o=>o.objectType==="ga"),t=i.filter(o=>o.objectType!=="ga"),n=[];if(t.length){let o=Lp(t.length),s=[...new Set(t.map(l=>l.sectionLabel).filter(Boolean))],r=[...new Set(t.map(l=>l.rowLabel).filter(Boolean))],a=t.map(l=>Number(l.seatNumber)).filter(l=>Number.isFinite(l));if(s.length===1&&r.length===1&&a.length===t.length){let l=t.length===1?be("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:s[0],row:r[0],seat:String(t[0].seatNumber??"")}):Hp(a)?be("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:s[0],row:r[0],from:Math.min(...a),to:Math.max(...a)}):"";n.push(l?be("picker.releasedPair","{first} \xB7 {second}",{first:o,second:l}):be("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]}))}else s.length===1?n.push(be("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]})):s.length>1?n.push(be("picker.releasedInSections","{seats} in Sections {sections}",{seats:o,sections:Mp(s)})):n.push(o)}for(let o of e)n.push(be("picker.releasedGa","{quantity} \xD7 {area}",{quantity:o.quantity??1,area:o.label}));return n.length?n.reduce((o,s)=>be("picker.releasedPair","{first} \xB7 {second}",{first:o,second:s})):""}function kl(i){if(!i)return[];let e=new Map((i.seats??[]).map(o=>[o.label,o])),t=i.items??[];return(t.length?t.map(o=>({label:o.label,objectType:o.objectType,quantity:o.quantity})):[...e.keys()].map(o=>({label:o}))).map(o=>{let s=e.get(o.label);return{label:o.label,...o.objectType?{objectType:o.objectType}:{},...o.quantity==null?{}:{quantity:o.quantity},...s?.sectionLabel?{sectionLabel:s.sectionLabel}:{},...s?.rowLabel?{rowLabel:Q(s)??s.rowLabel}:{},...s?.seatNumber?{seatNumber:s.seatNumber}:{}}})}function Tl(i,e){if(!i.reducedMotion)for(let t of e.slice(0,10)){if(t.objectType==="ga")continue;let n=i.seatByLabel(t.label);!n||i.statusOf(n.id)!=="free"||i.flash(n.id,i.accent)}}function El(i,e){if(!e.recoverable.length||!i.isConnected)return;let t=i.querySelector(".sl-hold-expired-next");t&&(e.taken.length?t.textContent=e.taken.slice(0,3).map(r=>(0,Ft.t)("picker.seatJustTakenByAnother",{label:r})).join(" "):t.remove());let n=i.querySelector(".sl-interrupt-actions"),o=n?.querySelector(".sl-interrupt-act");if(!n||!o)return;o.classList.add("sl-interrupt-act-secondary");let s=document.createElement("button");s.type="button",s.className="sl-interrupt-act sl-hold-expired-recover",s.textContent=(0,Ft.tCount)("picker.holdLapsedSelectAgain",e.recoverable.length),s.addEventListener("click",()=>e.onRecover([...e.recoverable])),n.insertBefore(s,o),i.classList.add("has-recovery"),s.focus()}function Cl(i,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let n=document.createElement("div");n.className="sl-interrupt-card sl-mo-in";let o=document.createElement("div");o.className="sl-interrupt-title",o.id="sl-hold-expired-title";let s=document.createElement("span");s.className="sl-interrupt-glyph",s.setAttribute("aria-hidden","true"),s.textContent="\u23F1";let r=document.createElement("span");r.textContent=be("picker.holdExpiredTitle","Your seats were released"),o.append(s,r);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=be("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),n.append(o,a);let l=Rp(e);if(l){let m=document.createElement("div");m.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",m.textContent=l,n.appendChild(m)}let c=document.createElement("div");c.className="sl-interrupt-body sl-hold-expired-next",c.textContent=be("picker.holdExpiredPickAgain","Pick your seats again to continue \u2014 they may already be taken."),n.appendChild(c),t.setAttribute("aria-labelledby",o.id),t.setAttribute("aria-describedby",a.id);let 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=be("picker.holdExpiredRestart","Choose seats again"),p.addEventListener("click",()=>i.restart()),d.appendChild(p),n.appendChild(d),t.appendChild(n),t.addEventListener("pointerdown",m=>{m.target===t&&i.restart()}),t}var _e=require("@seatlayer/core");var Al={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"},Ip='<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>',Op='<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>',_p=8,Np=8,Dp=88;function Bp(i){let e=i.gap??_p,t=i.margin??Np,n=i.min??Dp,o=Math.max(i.boundsTop,0);return Math.max(Math.round(i.buttonTop-o-e-t),n)}var xn=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=Op,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=fs(o,t.tf("picker.close","Close"))+gs(this.rows()),this.root.append(this.menu,this.button),e.prepend(this.root),this.button.addEventListener("pointerdown",s=>s.stopPropagation()),this.button.addEventListener("click",s=>{s.stopPropagation(),this.open(this.menu.hidden)}),this.menu.querySelector("[data-a11y-close]")?.addEventListener("click",s=>{s.stopPropagation(),this.open(!1),this.button.focus({preventScroll:!0})}),this.menu.addEventListener("pointerdown",s=>s.stopPropagation()),this.menu.addEventListener("click",s=>s.stopPropagation()),this.menu.addEventListener("focusin",s=>{let r=s.target;r&&typeof r.scrollIntoView=="function"&&r.scrollIntoView({block:"nearest"})}),this.dismiss=()=>this.open(!1),this.escape=s=>{s.key==="Escape"&&this.open(!1)},this.reflow=()=>{this.menu.hidden||this.fit()},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),window.addEventListener("resize",this.reflow),this.promoteCounts(),this.wire(),this.active.size){this.applyFilter({focus:!1});let s=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:n,count:o})=>[n,o])),t=!1;for(let n of this.menu.querySelectorAll("[data-a11y-row]")){let o=n.dataset.a11yRow??"";if(!o.startsWith("a11y:"))continue;let s=o.slice(5),r=e.get(s);if(r===void 0)continue;let a=this.countNode(n),l=r==null?"":this.countText(r);a&&(a.textContent=l);let c=r===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(s,l))),n.disabled=c,c?n.setAttribute("aria-disabled","true"):n.removeAttribute("aria-disabled"),c&&this.active.delete(s)&&(this.paint(n,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let n=t.dataset.a11yRow??"";n.startsWith("a11y:")&&this.paint(t,this.active.has(n.slice(5)))}}refit(){this.menu.hidden||this.fit()}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),window.removeEventListener("resize",this.reflow),this.root.remove()}fit(){this.menu.style.setProperty("--sl-a11ymenu-max",`${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();zn(this.menu,{x:t.left+t.width/2,y:t.top}),Ms(this.menu),Ls(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:(0,_e.seatTypeIconSvg)("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:Ip,className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:n,count:o})=>({key:n,count:o}));let t=this.deps.present;return t?_e.ACCESSIBILITY_TYPES.filter(({key:n})=>t.has(n)).map(({key:n})=>({key:n,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(_e.ACCESSIBILITY_TYPES.map(n=>[n.key,n]));return this.offered().flatMap(({key:n,count:o})=>{let s=t.get(n);return s?[{key:`a11y:${n}`,iconHtml:(0,_e.seatTypeIconSvg)(n,{size:17}),label:this.deps.tf(`picker.accessShort.${n}`,Al[n]??s.label),...n==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...o==null?{}:{count:this.countText(o),disabled:o===0},on:this.active.has(n)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-sl-info]"))e.addEventListener("click",()=>{let t=e.closest(".sl-info"),n=!t?.classList.contains("open");for(let o of this.menu.querySelectorAll(".sl-info.open"))o.classList.remove("open"),o.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false");t?.classList.toggle("open",n),e.setAttribute("aria-expanded",String(n))});for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let s=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(s),this.paint(e,s);return}if(t==="limited"){let s=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(s),s&&this.deps.focusSeatsForFilter(),this.paint(e,s);return}let n=t.slice(5),o=!this.active.has(n);o?this.active.add(n):this.active.delete(n),this.paint(e,o),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let n=(e.dataset.a11yRow??"").slice(5),o=e.parentElement;o?.classList.contains("sl-a11yrow-w")||(o=document.createElement("div"),o.className="sl-a11yrow-w",e.replaceWith(o),o.appendChild(e));let s=document.createElement("button");s.type="button",s.className="sl-a11yrow-c sl-a11yjump",s.dataset.a11yJump=n,s.textContent=t.textContent,s.disabled=e.disabled,s.setAttribute("aria-label",this.jumpLabel(n,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(n,s.textContent??""));let r=o.querySelector(".sl-info");r?r.after(s):e.after(s),o.dataset.a11yTapThrough||(o.dataset.a11yTapThrough="true",o.addEventListener("click",a=>{a.target===o&&!e.disabled&&e.click()})),s.addEventListener("click",a=>{a.stopPropagation(),this.active.has(n)||(this.active.add(n),this.paint(e,!0),this.applyFilter({focus:!1}));let l=this.deps.stepToAccessibleSection?.(n);l&&s.setAttribute("aria-label",this.jumpLabel(n,s.textContent??"",l.label))})}}countText(e){return e>0?(0,_e.t)("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=Al[e]??_e.ACCESSIBILITY_TYPES.find(n=>n.key===e)?.label??e;return this.deps.tf(`picker.accessShort.${e}`,t)}jumpLabel(e,t,n){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...n?[`${this.deps.tf("picker.section","Section")} ${n}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};var Pl=require("@seatlayer/core"),Fp=250;function Ll(i,e=Fp){let t=null,n=()=>{t===null&&(t=setTimeout(()=>{t=null,i()},e))},o=(0,Pl.attachVisibilityCatchUp)(n),s=typeof window<"u"&&typeof window.addEventListener=="function";return s&&window.addEventListener("focus",n),()=>{t!==null&&(clearTimeout(t),t=null),o(),s&&window.removeEventListener("focus",n)}}var lt=require("@seatlayer/core");var Sn=class{constructor(e){this.note=null;this.told=!1;this.deps=e}deferExpiryToast(e){this.told=!1,queueMicrotask(()=>{this.told||e()})}handle(e){if(!e.holdLapsed)return;this.told=!0;let t=(0,lt.holdRecoveryShape)(e),n=e.lapsedLabels.length,o=n-e.recoverable.length,s=t==="all"?(0,lt.tCount)("picker.holdLapsedStillFree",n):t==="partial"?(0,lt.tCount)("picker.holdLapsedSomeTaken",o):(0,lt.tCount)("picker.holdLapsedAllTaken",n);this.note={message:s,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(s,t==="none"?"error":"warning",t==="none"?void 0:{label:this.actionLabel(),onClick:()=>this.recover()}),this.deps.syncTray()}noteHtml(){if(!this.note)return"";let e=this.note.recoverable.length?`<button type="button" data-lapse-again>${F(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${F(this.note.message)}</span>${e}</div>`}wire(e){e?.querySelector("[data-lapse-again]")?.addEventListener("click",()=>this.recover())}clear(){this.note&&(this.note=null,this.deps.syncTray())}actionLabel(){return(0,lt.tCount)("picker.holdLapsedSelectAgain",this.note?.recoverable.length??0)}recover(){let e=this.note?.recoverable??[];this.note=null,this.deps.syncTray(),e.length&&this.deps.reselect(e)}};var Ml=Symbol("seatlayer.performance-group-picker");function kn(i,e){return Object.defineProperty(i,Ml,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),i}function Hl(i){return i[Ml]??null}var Rl="@seatlayer/pending-checkout/v1";function Vp(i){return typeof i=="string"&&i.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(i)}function Tn(i){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let n=null;try{let o=window.sessionStorage.getItem(Rl);if(o){let s=null;try{s=JSON.parse(o)}catch{}if(s&&Vp(s.orderId)){let r=Date.now()-Number(s.storedAt);if(r>=0&&r<=144e5){if(s.eventKey&&s.eventKey!==i)return null;n=s.orderId}}}window.sessionStorage.removeItem(Rl)}catch{}e.delete("seatlayer_checkout");try{let o=e.toString();history.replaceState(history.state,"",`${location.pathname}${o?`?${o}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:n}}function Il(i){if(!i.framed)return null;let e=i.ancestorOrigins?.length?i.ancestorOrigins[0]:null;for(let t of[e,i.referrer])if(t)try{return new URL(t).origin}catch{}return null}var zp="https://api.seatlayer.io",$p=10,jp=250,Ol=6e4,_l=4,Gp=10,Up=40,qp=220,vo=["mini","peek","open"],Nl="seatmap.a11y.cb";function Kp(){try{if(typeof window>"u")return null;let i=window.localStorage.getItem(Nl);return i==null?null:i==="1"}catch{return null}}function Wp(i){try{window.localStorage.setItem(Nl,i?"1":"0")}catch{}}var Ke=class i{constructor(e){this.realtime=null;this.accessEl=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.els={};this.regions={};this.ro=null;this.viewportResizeHandler=null;this.holdTimer=null;this.loadAbort=null;this.transportAbort=new AbortController;this.toastTimer=null;this.offerReadInFlight=null;this.offerReadSettledAt=0;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerCountdownTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.currencyResolved=!1;this.eventTimezone=null;this.eventWhenText=null;this.offerAvailability=null;this.channelByObject=new Map;this.pricesByChannel=new Map;this.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.extendDismissed=!1;this.extendUsed=!1;this.bookedEl=null;this.holdExpiredEl=null;this.holdExpiredFresh=!1;this.holdExpiredUnits=[];this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsReadyResolve=null;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 fn({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 Sn({toast:(e,t,n)=>this.toast(e,t,n),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalCleanup=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=Hl(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??zp).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},n=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?Vi({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:n?.access??Rt(e,t),this.pubApi=e.transport?null:n?.api??new Ve(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=ur(e.transport??this.pubApi,this.transportAbort.signal),this.buyerAssetUrls=new Ot(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=Da(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($p,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=Kp()??!!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 Nt(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=Il({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let n=t<640?1.2:.62;return Math.max(420,Math.round(t*n))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!document.fullscreenElement||this.fsFallback||this.framedFs?document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.framedFs?this.setFramedFs(!1):this.setFsFallback(!1):e.requestFullscreen?e.requestFullscreen().catch(()=>this.enterFsFallback()):this.enterFsFallback()}fillsViewport(){let e=this.root;if(!e||typeof window>"u")return!1;let t=e.getBoundingClientRect();return t.height>=window.innerHeight-_l&&t.width>=window.innerWidth-_l}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let n=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=n,e.tabIndex=n?-1:0,e.setAttribute("aria-hidden",String(n))}fullscreenMeasurementChanged(e,t){let n=typeof window>"u"?0:window.innerWidth,o=typeof window>"u"?0:window.innerHeight,s=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||n!==this.fullscreenAffordanceSize.viewportWidth||o!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:n,viewportHeight:o},s}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),this.root?.setAttribute("data-fs",String(e)),this.els.zfs?.setAttribute("aria-pressed",String(e)),this.els.zfs?.setAttribute("title",e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));let n=this.els.zfs?.querySelector(".sl-zfs-lbl");n&&(n.textContent=e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),this.view3dEl?.querySelector(".sl-view3d-fs")?.setAttribute("aria-pressed",String(e)),this.syncFullscreenAffordance()}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e,background:this.cssVar("--sl-bg")||void 0}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){_t();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.createElement("div");n.className="sl-modal-scrim";let o=document.createElement("div");o.className="sl-modal-frame",o.style.setProperty("--sl-bg",Ct(void 0,e.theme)["--sl-bg"]),o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label",b("picker.seatSelection","Seat selection")),o.tabIndex=-1,n.appendChild(o),document.body.appendChild(n);let s=document.body.style.overflow;document.body.style.overflow="hidden";let r=hr(n),a;try{a=new i({...e,container:o})}catch(f){throw r(),n.remove(),document.body.style.overflow=s,f}a.prevFocus=t,a.modalCleanup=()=>{a.modalCleanup=null,r(),document.body.style.overflow=s,a.escHandler&&document.removeEventListener("keydown",a.escHandler),n.remove();let f=a.prevFocus;a.prevFocus=null,f?.isConnected&&f.focus({preventScroll:!0})};let l=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),c=()=>{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},d=(f,T)=>{let w=f;for(;w;){let v=window.getComputedStyle(w);if(w.hidden||w.getAttribute("aria-hidden")==="true"||w.hasAttribute("inert")||v.display==="none"||v.visibility==="hidden"||v.visibility==="collapse")return!0;if(w===T)return!1;w=w.parentElement}return!0},p=f=>[...f.querySelectorAll(l)].filter(T=>T.tabIndex>=0&&!T.matches(":disabled")&&!d(T,f)),m=(f,T)=>{let w=p(f),v=T?w[w.length-1]:w[0];v?v.focus({preventScroll:!0}):(f.hasAttribute("tabindex")||(f.tabIndex=-1),f.focus({preventScroll:!0}))},h=!1,y=()=>{if(h)return;h=!0,a.modalCleanup?.();let f=()=>{a.destroy(),e.onClose?.()};a.hold&&!a.handedOff?a.release().finally(f):f()};a.closeModal=y,n.addEventListener("mousedown",f=>{f.target===n&&y()}),a.escHandler=f=>{if(f.key==="Tab"){if(f.defaultPrevented)return;let T=c(),w=p(T),v=w[0],A=w[w.length-1],_=document.activeElement;!v||!A?(f.preventDefault(),m(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"&&(a.tableDialog?(f.preventDefault(),a.cancelTableDialog()):a.confirmSeat?(f.preventDefault(),a.cancelConfirm()):a.bestAvailableConfirm?(f.preventDefault(),a.bestAvailableConfirm=!1,a.syncTray()):(f.preventDefault(),y()))},document.addEventListener("keydown",a.escHandler);try{let f=a.render();a.els.close?.classList.add("on"),a.els.close?.addEventListener("click",y),await f}catch(f){throw a.destroy(),f}return a.destroyed||m(c(),!1),a}wireController(e){return new H.PickerController({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,categoryPriceRanges:()=>this.mapPriceRanges(),flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:Et(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,this.seatsReadyResolve?.(),this.seatsReadyResolve=null,e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let n=this.controller.getGAAreas().find(o=>o.id===t);n&&(this.collapseSheet(),Gn(this,n,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),wr(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,n=this.holdConflicted;this.holdExpiredUnits=kl(this.hold),this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.holdConflicted=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.lapse.deferExpiryToast(()=>{if(t||n){this.toast((0,H.t)("picker.holdExpired",void 0)||"Your hold expired \u2014 seats released. Pick again.","warning");return}this.showHoldExpired()}),this.syncTray(),this.emitHoldChange(),this.opts.onHoldExpired?.()},onAvailabilityRefresh:t=>this.lapse.handle(t),confirmSelection:this.opts.confirmSelection,onSelect:t=>{if(this.salesClosed){this.controller.deselect([t.id]),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){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((0,H.t)("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),hostCardOpen:()=>this.tipPinned||!!this.confirmSeat,onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onError:t=>this.opts.onError?.(t)})}async render(){if(this.rendered)return this;let e=performance.now(),t={},n=h=>Math.round((performance.now()-h)*100)/100;this.rendered=!0,_t();let o=performance.now(),s=Di(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=Xo(this.opts.container),{root:c,els:d,mapHost:p}=ks(l,(h,y)=>this.tf(h,y),this.opts.theme);this.root=c,this.els=d,this.mapHost=p,Bi(c,s,h=>{t.loadLocale=n(o),this.destroyed||this.applyActiveLocale(h,r)}),la(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");return m.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(m),t.mountBuyerShell=n(a),t.skeletonPaint=n(e),this.loadAndFinishChart(m,t,n,e,c)}async loadAndFinishChart(e,t,n,o,s){this.startRealtime();let r=await this.loadChart(e,t,n);if(!r)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=n(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=Yo((0,H.t)("picker.testMode"),(0,H.getLocale)()),v.setAttribute("aria-label",(0,H.t)("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.currencyResolved=!0,this.eventTimezone=r.timezone??null,Zo(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?Mi(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=n(a);let p=performance.now();if(!await this.restoreHoldForFirstPaint(t))return this;if(t.restoreHold=n(p),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncOffer(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let m=this.controller.doc,h=Qi(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:n(o),performanceProfile:t,seatCount:this.allSeats().length,objectCount:m?.objects.length??0,sectionCount:m?.objects.filter(v=>v.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:m?.name,view:this.buyerView,load:h,transport:this.opts.transport?"custom":"pubapi"};ma(T,(v,A)=>this.emitAnalytics(v,A));let w=r.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",ho({...T,performanceProfile:{...T.performanceProfile,...w}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=r,await this.registerAgentTools(),this}registerAgentTools(){return ua(this)}webMcpHost(e){return po(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=Ll(()=>{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 n=()=>{if(this.root?.dataset.layout!=="narrow")return;let o=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!o)),this.els.pricesSec?.setAttribute("aria-expanded",String(!o)),!o&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",o=>{o.target.closest("select,button")||n()}),this.els.pricesSec?.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||o.target.closest("select,button")||(o.preventDefault(),n())}),e.addEventListener("click",o=>{let s=o.target.closest("[data-sl-info]");if(!s||!e.contains(s))return;o.stopPropagation();let r=s.closest(".sl-info"),a=!r?.classList.contains("open");this.closeInfoPops(r),r?.classList.toggle("open",a),s.setAttribute("aria-expanded",String(a))}),e.addEventListener("pointerdown",o=>{o.target.closest(".sl-info")||this.closeInfoPops()}),this.tipEl=document.createElement("div"),this.tipEl.setAttribute("role","tooltip"),this.tipEl.className="sl-tip",this.els.map.appendChild(this.tipEl),this.els.map.addEventListener("pointerdown",o=>{this.handleMapPointerDown(o)},!0),this.els.map.addEventListener("mousemove",o=>{if(this.tipPinned)return;let s=this.els.map.getBoundingClientRect();this.tipPos={x:o.clientX-s.left,y:o.clientY-s.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.els.cta.dataset.act==="find"?this.openBestSeatsForm():this.handleCta()})}sheetState(){let e=this.root?.dataset.sheet;return e==="mini"||e==="open"?e:"peek"}sheetHasCards(){return this.root?.getAttribute("data-has-selection")==="true"}setSheetState(e){let t=this.root;if(!t)return;let n=t.dataset.sheet;t.dataset.sheet=e==="mini"&&!this.sheetHasCards()?"peek":e,this.syncSheetAffordance(),n==="mini"&&t.dataset.sheet!=="mini"&&this.scheduleFit()}syncSheetAffordance(){let e=this.sheetState(),t=e==="open"||e==="peek"&&this.sheetHasCards(),n=this.els.sheetToggle;n?.setAttribute("aria-expanded",String(e==="open")),n?.setAttribute("aria-label",t?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))}cycleSheet(){let e=this.sheetState();e==="open"||e==="mini"?this.setSheetState("peek"):this.setSheetState(this.sheetHasCards()?"mini":"open")}stepSheet(e){let t=vo.indexOf(this.sheetState()),n=Math.min(vo.length-1,Math.max(0,t+e));this.setSheetState(vo[n])}setSheetOpen(e){this.setSheetState(e?"open":"peek")}openBestSeatsForm(){this.setSheetOpen(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||this.setSheetState("peek")}observeLayout(e){let t=()=>{let n=e.clientWidth;if(n<=0)return;let o=e.clientHeight,s=n!==this.pickerLayoutSize.width||o!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:n,height:o};let r=this.fullscreenMeasurementChanged(n,o);this.reportFramedHeight();let a=n<640?"narrow":"wide",l=o<560?"compact":"comfortable",c=e.dataset.layout!==a||e.dataset.density!==l;c&&(e.dataset.layout=a,e.dataset.density=l,this.controller.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,n){let o=performance.now();this.loadAbort=new AbortController;let s=await Pt(async()=>{let a=await this.controller.render(e);return a&&this.controller.getRenderer()?.isSeatRevealPending?.()&&await new Promise(l=>{this.seatsReadyResolve=l}),a},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.seatsReadyResolve?.(),this.seatsReadyResolve=null,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=n(o),this.destroyed?null:r?(Object.assign(t,r.performanceProfile),r):(Ae({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:Oe(this.opts.event),transport:this.opts.transport?"custom":"pubapi"}),li(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),li(this.els.boot,{title:this.tf("picker.loadingSeatMap","Loading seat map\u2026"),busy:!0});let a=performance.now();this.loadAndFinishChart(e,{},n,a,this.root)},{once:!0}),null)}async restoreHoldForFirstPaint(e){let t=[this.els.side,this.els.rail].filter(Boolean),n=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;Ae({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:Oe(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let r=li(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;li(this.els.boot,{title:this.tf("picker.restoringSeats","Checking your saved seats\u2026"),busy:!0})}}return!1}finally{t.forEach((o,s)=>{n[s]||o.removeAttribute("inert")})}}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=Tn(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 xn(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(n,o)=>this.tf(n,o),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:n=>this.setColorblindSafe(n),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:n=>{this.limitedViewFilter=n,this.controller.setCommercialLimitedFilter(n),this.pushAvailabilityTo3d()},applyAccessibilityFilter:n=>this.applyAccessibilityFilter(n),focusSeatsForFilter:()=>this.focusSeatsForFilter(),stepToAccessibleSection:n=>this.controller.focusNextAccessibleSection?.([n])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast((0,H.t)("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,n=this.els.headInfo?.parentElement;t&&n&&t.parentElement!==n&&(t.classList.add("sl-fs-pill"),n.insertBefore(t,this.els.hold??null));let o=this.extendEl;if(o){let r=e?this.regions["bottom-center"]??this.els.map:n;r&&o.parentElement!==r&&(o.dataset.dock=e?"map":"head",r===n?r.insertBefore(o,this.els.close??null):r.appendChild(o))}let s=this.els.pricesSec;s&&(e?(s.setAttribute("role","button"),s.tabIndex=0,s.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(s.removeAttribute("role"),s.removeAttribute("aria-expanded"),s.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){Ka(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>${F(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}tf(e,t){return b(e,t)}buildSoldoutOverlay(){if(!this.els.map)return;let e=document.createElement("div");e.className="sl-soldout",e.setAttribute("role","status");let t=(this.controller.doc?.theme?.brandName??this.opts.theme?.brandName??this.els.name?.textContent??this.tf("picker.soldOutEyebrow","This event")).toUpperCase(),n=document.createElement("div");n.className="sl-soldout-eyebrow",n.textContent=t;let o=document.createElement("div");o.className="sl-soldout-title",o.textContent=this.tf("picker.soldOutTitle","Sold out");let s=document.createElement("p");s.className="sl-soldout-copy",s.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(n,o,s),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let n=this.controller.getGAAreas().length>0,o=this.isSoldOut(e,t,n);o!==this.soldOut&&(this.soldOut=o,this.soldoutEl?.classList.toggle("on",o))}isSoldOut(e,t,n){return!n&&e.length>0&&e.every(o=>(t[o.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed);let t=this.els.closedPillText??e;t.textContent=this.tf("picker.salesClosedPill","Sales are closed")}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.tf("picker.salesClosedToast","Sales are closed for this event.")),this.syncCta(),this.syncTray()}badgeHidden(e){return!!e?.hideBadge}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let n=document.createElement("a");n.className="sl-powered",n.href="https://seatlayer.io/?ref=picker",n.target="_blank",n.rel="noopener noreferrer",n.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer"));let o=document.createElement("span");o.className="sl-powered-mark",o.setAttribute("aria-hidden","true"),o.innerHTML=Ui;let s=document.createElement("span");s.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),n.append(o,s),t.appendChild(n)}buildRegions(){if(!this.els.map)return;let e=["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"];for(let t of e){let n=document.createElement("div");n.className="sl-anchor",n.dataset.region=t,this.els.map.appendChild(n),this.regions[t]=n}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,t){let n=setTimeout(()=>{this.motionTimers.delete(n),this.destroyed||e()},t);this.motionTimers.add(n)}animateOnce(e,t,n=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),n))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){let t=this.reducedMotion(),n=(e.items??[]).filter(o=>o.objectType!=="ga").slice(0,10).map(o=>this.controller.seatByLabel(o.label)).filter(o=>!!o);ir({regions:this.els,categories:this.controller.doc?.categories,pop:o=>this.controller.flashSeat(o,this.cssVar("--sl-accent")||"#f4b740"),focus:(o,s)=>this.controller.focusSection(o,s),focusSeats:o=>this.controller.focusSeats?.(o,{animate:!t})===!0,reducedMotion:t,screenPoint:o=>this.controller.worldToScreen(o),schedule:(o,s)=>this.scheduleMotion(o,s)},n)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(n=>n.id!==e&&n.id!==t)}pendingSelectionCount(){return Ya(this)}heldTicketCount(){return Xa(this)}totalTicketCount(){return Za(this)}updateSelectionCapacity(){Qa(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){Ja(this,e,t)}setCtaPhase(e){el(this,e)}runCheckoutHandoff(e,t){return tl(this,e,t)}holdStorageKey(){return il(this)}rememberedHoldId(){return nl(this)}rememberHold(e){ol(this,e)}forgetHold(){sl(this)}resumeHoldFromServer(e,t=!1){return rl(this,e,t)}restoreRememberedHold(){return al(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let n=this.controller.getActiveFloorId();return(t.find(o=>o.id===n)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=na({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 bn(this,e)}catPriceRange(e){return yn(this,e)}buildPriceFilter(){bl(this)}applyPriceBand(e){yl(this,e)}buildArenaChrome(){let e=this.controller.doc;if(this.rungsEl=null,this.projectionEl=null,this.floorsEl=null,!e||!this.els.map){this.syncArenaViewportInsets();return}let t=e.objects.some(n=>n.type==="section")||(e.floors??[]).some(n=>n.objects.some(o=>o.type==="section"));if(this.canOffer3d()){let n=document.createElement("div");n.className="sl-projection",n.setAttribute("role","group"),n.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),n.innerHTML=`<button type="button" data-view="map" aria-pressed="true" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,n.querySelectorAll("button").forEach(o=>{if(o.dataset.view==="venue3d")for(let s of["pointerenter","focus","pointerdown"])o.addEventListener(s,Ai,{once:!0});o.addEventListener("click",()=>{this.setBuyerView(o.dataset.view)})}),this.regions["top-right"].appendChild(n),this.projectionEl=n,this.syncProjection()}if(t){let n=[...e.objects,...(e.floors??[]).flatMap(p=>p.objects)],o=new Set((e.zones??[]).map(p=>p.id)),a=e.floorOverview==="combined"&&(e.floors?.length??0)>1&&o.size===0||n.some(p=>p.type==="section"&&typeof p.zone=="string"&&o.has(p.zone))?["zones","sections","seats"]:["sections","seats"],l=document.createElement("div");l.className="sl-rungs on sl-mo-indicator",l.setAttribute("role","group"),l.setAttribute("aria-label",(0,H.t)("picker.zoomLevel"));let c={zones:(0,H.t)("picker.rungLabel.zones"),sections:(0,H.t)("picker.rungLabel.sections"),seats:(0,H.t)("picker.rungLabel.seats")},d={zones:(0,H.t)("picker.rungTip.zones"),sections:(0,H.t)("picker.rungTip.sections"),seats:(0,H.t)("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 m=p.dataset.rung;this.controller.setRung(m),m==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(l),this.rungsEl=l,this.syncRung()}if(this.controller.isMultiFloor()){let n=Er({floors:this.controller.getFloors(),tf:(o,s)=>this.tf(o,s),onChoose:o=>{o===""?this.controller.setFloorOverview(!0):this.controller.setFloor(o),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});this.regions["top-left"].appendChild(n),this.floorsEl=n,this.syncFloors()}this.syncArenaViewportInsets()}syncArenaViewportInsets(){let e=this.els.map,t=e?Tr(e.getBoundingClientRect(),[this.floorsEl,this.rungsEl,this.projectionEl].map(n=>n?.isConnected?n.getBoundingClientRect():null),[]):{top:0,right:0,bottom:0,left:0};Object.keys(t).every(n=>t[n]===this.arenaViewportInsets[n])||(this.arenaViewportInsets=t,this.controller.setViewportInsets(t),this.syncFitClearance())}syncFitClearance(){let e=this.els.map,t=this.els.zoom,n=this.root?.dataset.layout==="narrow",o=0;if(n&&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(n=>{let o=n.dataset.rung===e;n.classList.toggle("on",o),n.setAttribute("aria-pressed",String(o))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit,n=this.els?.zin;if(!e||!this.root)return;let o=this.controller.getRenderer?.(),s=this.controller.canZoomIn?.()===!1||o?.seatsPickable?.()===!0,r=kr({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0,atVenueFit:this.controller.atVenueFit?.()})==="none",a=e.disabled!==r||!!t&&t.disabled!==r||!!n&&n.disabled!==s||e.hidden||!!n?.hidden||!!t?.hidden;e.disabled=r,e.hidden=!1,n&&(n.disabled=s,n.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||!Ci()?!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)?Ol/2:Ol}syncFloors(){Cr(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new cn({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(o=>o.type==="section"&&!this.controller.isSectionClosed(o.id)&&this.controller.getSectionSeatCount(o.id)>0);if(t.length<2)return null;let n=t.findIndex(o=>o.id===e);return n<0?null:{previous:t[(n-1+t.length)%t.length],next:t[(n+1)%t.length]}}markedSeatAnnouncement(e){let t=oo(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return Nr(t,e.displayLabel??e.label,this.opts.locale)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.markedSeatAnnouncement(e);if(t){this.srEl.textContent=t;return}let n=this.controller.doc?.categories.find(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=n?this.catPriceRange(n):void 0,a=!this.suppressPricing&&r?r.min===r.max?this.money(r.min):`${this.money(r.min)}\u2013${this.money(r.max)}`:void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),d=rt(c),p=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,m=l?`${d} ${p}, ${l.bookingMode==="variable"?(0,H.t)("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):(0,H.t)("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${p}`:c?.objectType==="table"?`${d} ${p}, ${(0,H.t)("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:(0,H.t)("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${m}, ${n?.label??e.categoryKey}${a?`, ${a}`:""}, ${s}`}showTableDialog(e,t,n){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=n??document.activeElement;let o=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),s=e.bookingMode==="variable",r=document.createElement("div");r.className="sl-table-scrim",r.innerHTML=us(e,{variable:s,held:t,typeWord:rt(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 n=t.querySelector("output[data-table-qty]");n&&(n.value=String(e.quantity));let o=t.querySelector("input[data-table-qty]");o&&(o.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let s=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),r=t.querySelector("[data-table-total]");r&&(r.textContent=this.money(s*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let n=this.tableDialogEl?.querySelector(".sl-table-confirm");if(n&&(n.disabled=!0,n.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let o=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!o){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},this.startHoldTimer(o.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,H.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(o){this.opts.onError?.(o),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){n&&(n.disabled=!1,n.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new un({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),paidPrice:(e,t,n,o)=>this.paidPrice(e,t,n,o),offerName:(e,t)=>this.offerPrice(e,t)?.offerName,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){ea(e,t,this.reducedMotion())}addSeatLabel(e){return ta(e,(t,n)=>this.tf(t,n))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,n=this.controller.doc,o=this.controller.getActiveFloorId(),s=e.focalPoint??n?.floors?.find(p=>p.id===o)?.focalPoint??n?.focalPoint??{x:0,y:0},r,a,l=!1;if(e.viewUrl){let p,m=null;try{let y=e.viewMeta?.previewUrl;y&&y!==e.viewUrl?(m=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&&!m||!this.root||!this.seatViewEnabled())return;let h={url:p,...m?{previewUrl:m}:{},...e.viewMeta?.sourceWidth!==void 0?{sourceWidth:e.viewMeta.sourceWidth}:{},...e.viewMeta?.sourceHeight!==void 0?{sourceHeight:e.viewMeta.sourceHeight}:{},...e.viewMeta?.previewWidth!==void 0?{previewWidth:e.viewMeta.previewWidth}:{},...e.viewMeta?.previewHeight!==void 0?{previewHeight:e.viewMeta.previewHeight}:{},...e.viewMeta?.variants?.length?{variants:e.viewMeta.variants}:{},...e.viewMeta?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};r=h,a=(0,En.seatViewDisclosure)(h),l=(0,En.isAuthoredSeatView)(h)}else{let p;try{let{generateSeatPanorama:m}=await Pi();p=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:p.url,generated:!0},a=(0,H.t)("picker.illustrationCaption",{m:p.distanceM})}this.closeSeatView(!1);let c=(0,H.t)("picker.viewFromSeat",{label:e.label}),d=Wi({root:this.root,source:r,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:et(),viewFromSeatLabel:c,real360Label:(0,H.t)("picker.real360"),previewLabel:(0,H.t)("picker.preview"),resolveAsset:p=>this.buyerAssetUrls.resolve(p),onClose:()=>this.closeSeatView()});this.viewEl=d.element,this.viewCleanup=()=>d.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let n=Number.isInteger(e);return(0,H.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(o,s)=>`${o} ${s}`,...n?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),n=xr(e,t);if(n==null)return;let o=6*36e5,s=Math.min(Math.max(n-t+1e3,1e3),o);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},s)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<jp}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||this.offerReadIsCurrent()||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}refreshOfferAvailability(e){if(!this.api.availability||this.destroyed)return Promise.resolve();if(this.offerReadInFlight)return this.offerReadInFlight;if(this.offerReadIsCurrent())return Promise.resolve();let t=this.readOfferAvailability(e).finally(()=>{this.offerReadInFlight===t&&(this.offerReadInFlight=null)});return this.offerReadInFlight=t,t}async readOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;this.offerReadSettledAt=Date.now();let n=ln(t);if(!n)return;this.offerAvailability=n,this.applyChannelPricing(n.channelPricing),this.scheduleOfferBoundary(n);let o=Sr(this.hostPricing?.prices,n),s=Object.keys(o).length>0||this.hostPricing?.formatter?{prices:o,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(s),this.syncMapPriceRanges(),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(n)}catch{!this.destroyed&&!this.offerBoundaryTimer&&!document.hidden&&(this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},3e4))}}offerPrice(e,t){if(!e)return null;let n=this.offerAvailability?.prices.filter(o=>o.categoryKey===e)??[];return t!==void 0?n.find(o=>(o.tierId??null)===t)??n.find(o=>o.tierId==null)??null:n[0]??null}mapPriceRanges(){if(this.api.availability&&!this.offerAvailability)return null;if(this.offerAvailability?.prices.some(e=>e.tierId!==void 0))return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(e=>{let t=this.catPriceRange(e);return t?[[e.key,t]]:[]}))}syncMapPriceRanges(){this.controller.getRenderer()?.setCategoryPriceRanges?.(this.mapPriceRanges())}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerCountdownTimer=null,e.classList.remove("sl-offer-compact"),!this.currencyResolved){e.classList.remove("has"),e.replaceChildren();return}if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,n=t?.release??null,o=!n&&t?.upcoming?.pricingMode!=="matrix"?t?.upcoming??null:null;if(!t||t.state==="closed"||t.state==="sold-out"||!n&&!o){e.classList.remove("has"),e.replaceChildren();return}let s=n??o,r=s.pricingMode==="matrix",a=document.createElement("div");a.className="sl-offer-main";let l=document.createElement("div");l.className="sl-offer-copy";let c=document.createElement("span");c.className="sl-offer-kicker",c.textContent=n?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let d=document.createElement("strong");d.className="sl-offer-name";let p=s.name||(n?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));d.innerHTML=kt(p,F);let m=document.createElement("span");m.className="sl-offer-line";let h=[];if(!r&&n&&t.fromPrice!=null&&h.push(this.money(t.fromPrice/100)),!r&&n&&s.remaining!=null&&h.push((0,H.t)("picker.offerRemainingAvailable",{count:s.remaining})),n&&s.endsAt!=null){let v=!this.opts.locale||/^en(?:-|$)/i.test(this.opts.locale)?es(s.endsAt):null;if(h.push(v??(0,H.t)("picker.offerUntil",{time:Mi(s.endsAt,this.eventTimezone,this.opts.locale)})),v){let A=Math.max(1e3,s.endsAt-Date.now()),_=A%6e4||6e4;this.offerCountdownTimer=setTimeout(()=>{this.offerCountdownTimer=null,Date.now()>=s.endsAt?this.refreshOfferAvailability(!1):this.syncOffer()},Math.min(_+25,A+25))}}if(o?.startsAt!=null&&h.push((0,H.t)("picker.offerStarts",{time:Mi(o.startsAt,this.eventTimezone,this.opts.locale)})),m.textContent=h.join(" \xB7 "),r||l.append(c),l.append(d,m),r){e.classList.add("sl-offer-compact"),a.append(l),e.replaceChildren(a),e.classList.add("has");return}let y=document.createElement("details");y.className="sl-offer-info";let f=document.createElement("summary");f.setAttribute("aria-label",(0,H.t)("picker.howOfferWorks",{name:d.textContent??""})),f.textContent="i";let T=document.createElement("div");T.className="sl-offer-detail",T.textContent=n?this.tf("picker.offerDetailActive","This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over."):this.tf("picker.offerDetailUpcoming","Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts."),y.append(f,T),a.append(l,y),e.replaceChildren(a),e.classList.add("has")}paidPrice(e,t,n,o){let s=o?this.channelByObject.get(o):void 0;if(s&&e){let a=this.pricesByChannel.get(s)?.find(l=>l.categoryKey===e&&l.tierId===(t??null));if(a)return a.price}let r=e?this.opts.pricing?.prices?.[e]:void 0;return r===void 0?n:typeof r=="number"?r:t&&r.tiers?.[t]!==void 0?r.tiers[t]:r.base??n}legendDeps(){return vl(this)}syncPriceRail(e,t,n=this.legendDeps()){wl(this,e,t,n)}syncPrices(){this.currencyResolved&&xl(this)}focusCategory(e){Sl(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(n=>!e.has(n.label)&&(this.controller.getStatus(n.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(n=>n.id)),this.toast((0,H.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:n,heldLabels:o,total:s,count:r}=gn(this),a=[],l=new Set;if(!this.salesClosed){let g=this.performanceGroup?.nightSummary?.()??[];g.length&&a.push(Mr(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>${F(L.label)}</button>`)}let c={salesClosed:this.salesClosed,hasPicks:e.length>0||n.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(g=>g.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(ja(c)),this.els.trayHint&&(this.els.trayHint.textContent=Ga(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed);let d=!e.length&&!n.length&&!je(this.gaQty,this.hold?.items??[]);if(!this.performanceGroup&&!this.salesClosed&&!this.hold&&(d||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($a({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,N,R=1,O,E,D,z)=>Fa({categoryLabel:D,offerName:z,d:g?this.controller.seatDetails(g):null,area:N==="ga"?t.find(j=>j.id===O):void 0,label:L,objectType:N,quantity:R,identity:E,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),m=F,h=[];for(let g of Ns(n)){let L=g.objectType==="ga"?`held:ga:${g.objectId}:${g.tierId??""}`:`held:${g.label}`;l.add(L);let N=this.controller.doc?.categories.find(B=>B.key===g.categoryKey),R=g.tierId?N?.tiers?.find(B=>B.id===g.tierId)?.name:void 0,O=this.offerPrice(g.categoryKey,g.tierId??null)?.offerName,E=g.objectType!=="ga"?this.controller.seatByLabel(g.label):null,D=g.objectType==="table"?this.controller.tableSelection(g.label):null,z=E?this.controller.seatDetails(E.id):null,j=this.seatViewEnabled()&&!!E&&g.objectType!=="table"&&!!this.deliverableViewReference(E),de=m(this.tf("picker.heldForYou","Held for you")),X=D?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(g.label))}">${m((0,H.t)("picker.guestsCountEdit",{count:g.quantity??1}))}</button>`:"",we=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:(0,H.t)("picker.removeHeldTicketLabel",{label:jn(g,t)}),locateId:E?.id??null,section:z?.sectionLabel??"",rowLabel:z&&Q(z)||"",seatLabel:z?.seatNumber??g.label,categoryLabel:`${N?.label??g.categoryKey}${R?` \xB7 ${R}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(g.categoryKey)??N?.color??"",identityHtml:p(E?.id??null,g.label,g.objectType,g.quantity??1,g.objectId,D??void 0,`${N?.label??g.categoryKey}${R?` \xB7 ${R}`:""}`,O),stateHtml:`<span class="sl-ticket-state held" aria-label="${de}" title="${de}"><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:X,amount:we,amountText:this.suppressPricing?"":this.money(we),noteHtml:tt(E??void 0),railHtml:this.performanceGroup?"":fo((0,H.t)("picker.removeHeldTicketLabel",{label:jn(g,t)}),j?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 N=this.controller.doc?.categories.find(B=>B.key===g.categoryKey),R=g.tiers&&g.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${m(g.id)}" aria-label="${m((0,H.t)("picker.ticketTierFor",{label:g.label}))}">`+Va(g.tiers,g.tierId,m)+"</select>":"",O=g.tiers?.find(B=>B.id===g.tierId)??g.tiers?.[0],E=this.offerPrice(g.categoryKey,O?.id??null)?.offerName,D=O?.buyerMessage?.trim()||(O?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),z=this.controller.seatDetails(g.id),j=m(this.tf("picker.selected","Selected")),de=(0,H.t)("picker.removeSeatLabel",{label:g.label}),X=(g.objectType==="table"&&g.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(g.label))}">${m((0,H.t)("picker.guestsCountEdit",{count:g.quantity??1}))}</button>`:"")+R,we=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:z?.sectionLabel??"",rowLabel:z&&Q(z)||"",seatLabel:z?.seatNumber??g.label,categoryLabel:N?.label??g.categoryKey,identityHtml:p(g.id,g.label,g.objectType,g.quantity??1,g.objectId,g,N?.label??g.categoryKey,E),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(g.categoryKey)??N?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${j}" title="${j}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:X,amount:we,amountText:this.suppressPricing?"":this.money(we),removeAria:de,noteHtml:tt(g)+(D?`<small class="sl-tier-note">${m(D)}</small>`:""),railHtml:fo(de,y&&g.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(g.label)??{})?g.label:null)})}h.length&&a.push(h.map(za).join("")),t.length&&a.push(zs(this,t,n)),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let f=this.performanceGroup?.selectNight;f&&zr(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(`
|
|
3262
3262
|
`),L);return}let N=L.dataset.seat.split(" "),R=()=>{this.controller.deselect(N)};if(this.reducedMotion()){R();return}L.classList.remove("sl-enter"),L.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(R,ee.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(g=>{g.addEventListener("click",L=>{L.stopPropagation();let N=decodeURIComponent(g.dataset.tableEdit??""),R=this.controller.tableSelection(N);if(!R)return;let O=n.find(E=>E.label===N&&E.objectType==="table");this.showTableDialog({...R,quantity:O?.quantity??R.quantity},!!O,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()})}),$s(this,this.els.tray,t),this.controller.setGASelection(Is(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(),w=this.lastTrayCount,v=this.lastTrayTotal,A=Vr(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");this.els.count.textContent=A||(r?(0,H.tCount)("picker.ticketsCount",r):this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=r&&!this.suppressPricing?this.money(s):"",this.root?.setAttribute("data-has-selection",String(r>0)),this.sheetState()==="mini"&&r===0?this.setSheetState("mini"):r>w&&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?(0,H.tCount)("picker.seatsSelectedCount",r):"")),this.syncCta(r,T);let q=this.root?.dataset.layout==="narrow"&&this.root?.dataset.confirming==="true";r!==w&&!q&&this.animateOnce(this.els.count,"sl-value-pop",380),s!==v&&!q&&this.animateOnce(this.els.total,"sl-value-pop",380),w===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(){gr(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(br),this.els.tray?.querySelectorAll(".sl-ba-go").forEach(yr)}emitSelectionValidity(e,t){let n=this.controller.getSelectionValidity(e);n&&(n.seats=t,this.opts.onSelectionValidityChange?.(n),n.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(n),this.lastSelectionValidity=n.isValid)}async removeHeldLabels(e,t){let n=e.filter(r=>r&&!this.releasingLabels.has(r));if(!n.length)return!1;let o=n[0];n.forEach(r=>this.releasingLabels.add(r)),t?.setAttribute("aria-busy","true");let s=t?.querySelector(".rm");s&&(s.disabled=!0);try{let r=this.handedOff;if(!await this.controller.releaseLabels(n))return this.toast((0,H.t)("picker.couldNotRemoveLabel",{label:o}),"error"),!1;Ds(this.gaQty,this.hold?.items??[],n);let l=this.controller.currentHold();return this.hold=l?{holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items}:null,this.handedOff=!!this.hold&&r,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),!0}finally{n.forEach(r=>this.releasingLabels.delete(r)),t?.removeAttribute("aria-busy"),s?.isConnected&&(s.disabled=!1)}}async handleCta(){if(this.salesClosed)return;let e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(wn(e,(n,o)=>this.tf(n,o)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast((0,H.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(n=>!(this.hold.items??[]).some(o=>o.label===n.label))){let n=this.hold.seats??t;this.handedOff=!0,this.holdConflicted=!1,await this.runCheckoutHandoff(this.hold,n);return}this.holdingLabels=new Set(t.map(n=>n.label)),this.setCtaPhase("holding");try{let n=null,o=Rs(this.gaQty),s=this.committedSelection();if(s.length){let r=await this.controller.hold(void 0,this.opts.holdTtlMs);n=r?{holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items}:null}for(let{areaId:r,tierId:a,qty:l}of o){let c=await this.controller.holdGA(r,l,{tierId:a,ttlMs:this.opts.holdTtlMs});n=c?{holdId:c.holdId,expiresAt:c.expiresAt,seats:c.seats,items:c.items}:n}if(!n){this.raiseHoldConflict(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.")),this.setCtaPhase("idle"),this.syncTray();return}this.hold=n,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(n.expiresAt),this.flashHeldSeats(n),this.emitHoldChange(),this.performanceGroup?this.setCtaPhase("idle"):await this.runCheckoutHandoff(n,n.seats??s)}catch(n){this.opts.onError?.(n);let o=n,s=(o.conflicts??[]).map(a=>a.label).filter(Boolean).slice(0,3);o.reason==="event_closed"&&this.setSalesClosed(!0);let r=o.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):o.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):o.reason==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s.length?s.length===1?(0,H.t)("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):(0,H.t)("picker.labelsNoLongerAvailable.other",{labels:s.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(r),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){ll(this,e)}stopHoldTimer(){cl(this)}setExtendPrompt(e,t){dl(this,e,t)}refreshExtendPrompt(){pl(this)}handleExtend(){return hl(this)}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.controller.currentHold()===null&&(this.holdConflicted||this.showBooked())}raiseHoldConflict(e){this.holdConflicted=!0,this.bookedShown&&(this.bookedShown=!1,this.bookedEl?.classList.remove("on")),this.toast(e,"error")}showBooked(){if(this.bookedShown||!this.hold||this.holdConflicted)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((o,s)=>o+s.quantity,0),n=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=n?.seats?`<span class="sl-booked-seats">${(0,H.tCount)("picker.group.ticketsConfirmedAcross",n.seats,{performances:n.performances})}</span>`:`<span class="sl-booked-seats">${(0,H.tCount)("picker.ticketsCount",t)}</span> ${this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way.")}`),this.els.bookedList&&(this.els.bookedList.innerHTML=e.lineItems.map(o=>{let r=[o.sectionLabel,o.rowLabel&&`${this.tf("picker.row","Row")} ${o.rowLabel}`,o.seatNumber&&`${this.tf("picker.seat","Seat")} ${o.seatNumber}`].filter(Boolean).join(" \xB7 ")||o.displayLabel||o.label,a=o.quantity>1?` <span class="sl-booked-qty">\xD7${o.quantity}</span>`:"";return`<li>${F(r)}${a}</li>`}).join(""),this.els.bookedList.hidden=e.lineItems.length===0),this.bookedEl?.classList.add("on"),requestAnimationFrame(()=>this.bookedEl?.querySelector(".sl-booked-back")?.focus()),this.opts.onBooked?.(e)}dismissBooked(){this.bookedEl?.classList.remove("on"),this.resetAfterBooking(),this.root?.focus({preventScroll:!0})}resetAfterBooking(){this.bookedShown=!1,this.hold=null,this.handedOff=!1,this.holdConflicted=!1,this.holdingLabels.clear(),this.gaQty.clear(),this.stopHoldTimer(),this.forgetHold(),this.clearSelection(),this.setCtaPhase("idle"),this.setSheetOpen(!1),this.syncTray(),this.syncCta(),this.emitHoldChange()}notifyGroupSettled(e){e==="booked"?this.showBooked():this.dismissConfirm(),this.hold=null,this.handedOff=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.forgetHold(),this.syncTray(),this.syncCta()}async checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){await this.startHostedCheckout(e,t);return}await this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let n=this.buildHandoff(e),o=null;try{o=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(r){this.opts.onError?.(r)}if(this.destroyed)return;let s=o?.providers?.[0];if(!s){let r=Qo(o?.reason),a=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:r,handoff:n}),this.opts.onCheckout?.(e,t,n),a||this.openCheckoutPanel({kind:"unavailable",reason:r,seatCount:n.lineItems.reduce((l,c)=>l+c.quantity,0)});return}await this.openCheckoutPanel({kind:"pay",provider:s,order:{holdId:n.holdId,expiresAt:n.expiresAt,currency:n.currency,total:n.total,labels:n.lineItems.map(r=>r.displayLabel??r.label)}})}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await Li())}catch(n){this.opts.onError?.(n),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held \u2014 please try again."),"error"),this.setCtaPhase("idle");return}this.destroyed||!this.root||(this.closeCheckoutPanel(),this.checkoutPanel=t({root:this.root,state:e,eventKey:this.opts.event,formatMoney:n=>this.money(n),startSession:n=>this.pubApi.startCheckout(this.opts.event,{...n,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:n=>this.pubApi.orderStatus(n),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:n=>{this.opts.onOrderConfirmed?.(n),this.controller.refresh()},onError:n=>this.opts.onError?.(n)}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let n=(e.items??[]).map(r=>{let a=this.controller.lineItemDisplay(r);return{label:r.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},objectId:r.objectId,objectType:r.objectType,categoryKey:r.categoryKey,tierId:r.tierId,unitPrice:this.paidPrice(r.categoryKey,r.tierId,r.unitPrice,r.label),currency:r.currency??this.currency,quantity:r.quantity??1}}),o=n[0]?.currency??this.currency,s=n.reduce((r,a)=>r+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:o,lineItems:n,total:s}}emitHoldChange(){let e=this.hold;this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",n){let o=this.els.toast;if(!o)return;o.replaceChildren();let s=document.createElement("span");if(s.textContent=e,o.appendChild(s),o.classList.toggle("has-action",!!n),n){let r=document.createElement("button");r.type="button",r.className="sl-toast-action",r.textContent=n.label,r.addEventListener("click",n.onClick,{once:!0}),o.appendChild(r)}o.dataset.tone=t,o.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{o.classList.remove("on","sl-mo-rise"),o.classList.remove("has-action"),o.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),n=this.confirmEl;if(!t||!n?.isConnected){e.style.removeProperty("bottom");return}let o=this.els.map.clientHeight;if(o<=0)return;let s=n.getBoundingClientRect(),r=s.height||n.offsetHeight||qp,a=s.height?s.top-this.els.map.getBoundingClientRect().top:o-ro-r,l=Math.round(o-a+Gp);if(l+Up>o){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){aa({boot:this.els.boot,map:this.els.map,rail:this.els.rail,root:this.root,reducedMotion:this.reducedMotion()})}placeTooltip(){if(!this.tipEl)return;let e={width:this.els.map.clientWidth,height:this.els.map.clientHeight},t={width:this.tipEl.offsetWidth,height:this.tipEl.offsetHeight},n=this.tipPinned?Ur(this.tipPos,e,t):null,o=n??Gr(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${o.left}px`,this.tipEl.style.top=`${o.top}px`,n?this.tipEl.dataset.placement=n.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let n=this.performanceGroup,o=oo(e.mark,n?.nights?.()),s=o?.states.filter(r=>r.free).length??0;return Hr(o,{locale:this.opts.locale,switchLabel:n?.selectionModeSwitch?.label??null,selectPartialLabel:n?.partialSeatSelection?.label(s)??null,pinned:t})}unpinTooltip(){this.tipPinned&&(this.tipPinned=!1,this.tipEl?.classList.remove("sl-tip-pinned"),this.tipEl&&(this.tipEl.style.display="none"))}handleMapPointerDown(e){if(this.tipEl?.contains(e.target))return;this.lastMapPoint={x:e.clientX,y:e.clientY},this.lastPointerType=e.pointerType||"mouse";let t=this.els.map.getBoundingClientRect();this.tipPos={x:e.clientX-t.left,y:e.clientY-t.top},this.unpinTooltip()}closeInfoPops(e){this.root?.querySelectorAll(".sl-info.open").forEach(t=>{t!==e&&(t.classList.remove("open"),t.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false"))})}updateTooltip(e){if(!this.tipEl)return;if(this.confirmSeat){this.tipEl.style.display="none";return}if(this.tipPinned&&e?.interaction!=="press")return;if(!e){this.tipPinned||(this.tipEl.style.display="none",this.tipMarkedHoverLabel=null);return}let t=e.mark?.kind==="partial"&&this.tipMarkedHoverLabel===e.label;if(e.interaction!=="press"&&this.lastPointerType==="mouse"&&!e.mark&&!this.tipPinned){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}if(e.unavailable&&e.status==="free"&&e.interaction==="press"){this.toast(this.tf("picker.turnOffAccessibilityFilter","Turn off the wheelchair filter to pick this seat"),"neutral"),this.tipEl.style.display="none";return}if(e.unavailable&&!e.mark){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}let n=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t);this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let o=this.nightStripFor(e,n);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=jr(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:rt(e),extra:o+(n?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${F(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=n,this.tipEl.classList.toggle("sl-tip-pinned",n),this.tipEl.querySelector("[data-pg-tip-close]")?.addEventListener("click",()=>this.unpinTooltip()),this.tipEl.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>{this.unpinTooltip(),this.performanceGroup?.selectionModeSwitch?.activate()}),Wr(this.tipEl,this.performanceGroup?.partialSeatSelection?.label,s=>{this.unpinTooltip(),this.performanceGroup?.partialSeatSelection?.activate(e.id,s)}),this.tipEl.style.display="block",this.placeTooltip()}syncSeatMarks(){let e=this.performanceGroup?.seatMarks,t=this.controller.getRenderer();if(!e||!t?.setSeatMarks)return;let n={};for(let[o,s]of Object.entries(e())){let r=this.controller.idForLabel(o);r&&(n[r]=s)}Object.keys(n).length&&t.setSeatMarks(n)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),n=this.controller.getSelection().filter(o=>t.has(o.id)||t.has(o.label));if(n.length===t.size)return n;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){let e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e),this.applyMapChromeTokens(),this.minimap?.refreshMinimap())}applyThemeTokens(e){let t=ei(this.themeMode),n=Ct(this.controller.doc?.theme,this.opts.theme,t);for(let[o,s]of Object.entries(n))e.style.setProperty(o,s);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=Ni(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(Et(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:ei(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=ei(this.themeMode),n=Ct(this.controller.doc?.theme,this.opts.theme,t),o=Et(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,s=xs(n,o);for(let r of ws)s?e.style.setProperty(r,s[r]):e.style.removeProperty(r)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){let t=JSON.stringify(this.opts.pricing??null),n=JSON.stringify(e??null);t!==n&&(this.opts.pricing=e,!(this.destroyed||!this.els.prices||!this.currencyResolved)&&(this.syncMapPriceRanges(),this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=Es(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=(0,H.getLocale)(),n=this.localeGeneration+=1,o=await(0,H.loadLocale)(e);return this.opts.messages&&(0,H.setStringOverrides)(this.opts.messages),o===t||this.applyActiveLocale(o,n),o}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(Cs(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(),Wp(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 ka(this)}setBuyerView(e,t){Ta(this,e,t)}seatState3dFor(e){return Ea(this,e)}pushAvailabilityTo3d(){Ca(this)}syncSelectionTo3d(){Aa(this)}seatViewFor3d(e){return Pa(this,e)}onView3dSeatPick(e){La(this,e)}seatViewCaption(e){return Ma(this,e)}saveView3dComparisonSeat(e){Ha(this,e)}clearView3dComparison(){Ra(this)}view3dComparisonSnapshot(e){return Ia(this,e)}enter3d(e){return Oa(this,e)}publish3dTopInset(){_a(this)}exit3d(){Na(this)}openSeatConfidencePassport(e,t=null){uo(this,e,t)}closeSeatConfidencePassport(e=!0){pi(this,e)}openView3dComparison(){ya(this)}closeView3dComparison(e=!0){at(this,e)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e)}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,n={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,n)}catch(o){this.opts.onError?.(o);let s=o?.reason,r=s==="not_enough_together"?(0,H.t)("picker.couldNotFindSeatsTogether",{count:e}):s==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):s==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):s==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):this.tf("picker.seatsNoLongerAvailableTryAnother","Those seats are no longer available. Try another quantity or ticket type.");return this.toast(r,"error"),null}}async bestAvailableOrThrow(e,t,n={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let o=this.els.tray?.querySelector(".sl-ba-go");o&&(o.disabled=!0,o.classList.add("sl-busy"),o.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let s=await this.controller.bestAvailable(e,t,{...n,ttlMs:this.opts.holdTtlMs});return s?(this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(s.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),n.preferPremium&&s.seats.length&&!s.seats.every(r=>r.commercial?.premium)&&this.toast((0,H.t)("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),n=!0;if(t)n=await this.controller.release();else if(e){let o=[...new Set([...(e.items??[]).map(s=>s.label),...(e.seats??[]).map(s=>s.label)])];if(o.length)try{await this.api.release(this.opts.event,o,e.holdId)}catch(s){this.opts.onError?.(s),n=!1}}if(!n){this.toast(this.tf("picker.couldNotReleaseTickets","Couldn't release your tickets. Your hold is unchanged."),"error");return}this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.syncTray(),this.emitHoldChange()}startRealtime(){if(!this.access?.configured||!this.pubApi||this.realtime)return;let e=this.opts.event;this.realtime=new Ee({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:wt(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,n)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:n}),this.syncTray(),this.toast(n==="ineligible"?this.tf("picker.seatNoLongerYours","Some seats are no longer available to you. They have been removed from your order."):this.tf("picker.seatTaken","Someone else took a seat you had picked. It has been removed from your order."),"warning")}})}),this.realtime.start()}async refreshAccess(){return!this.access?.configured||!await this.access.refresh("manual")?!1:(this.dismissAccessPanel(),await this.controller.refresh(),this.realtime?this.realtime.restart():this.startRealtime(),!0)}clearDecisionSurfaces(){this.dismissConfirm(),this.dismissTableDialog(!1),Ce(this,!1)}showAccessPanel(e){if(this.loadAbort&&e.reason==="provider_failed"||this.destroyed||!this.root)return;this.dismissAccessPanel(),this.clearDecisionSurfaces();let t=ms(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=Cl({restart:()=>this.restartAfterHoldExpiry()},this.holdExpiredUnits);this.root.appendChild(e),this.holdExpiredEl=e,requestAnimationFrame(()=>e.querySelector(".sl-interrupt-act")?.focus());let t=this.holdExpiredUnits;this.holdExpiredFresh=!1,this.refreshAvailability().then(()=>{if(this.destroyed||this.holdExpiredEl!==e)return;this.holdExpiredFresh=!0;let n=t.filter(r=>r.objectType!=="ga"),o=[],s=[];for(let r of n){let a=this.controller.seatByLabel(r.label);(a&&this.controller.getStatus(a.id)==="free"?o:s).push(r.label)}El(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||Tl({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:n=>this.controller.seatByLabel(n),statusOf:n=>this.controller.getStatus(n),flash:(n,o)=>this.controller.flashSeat(n,o)},e)}).catch(()=>{})}destroy(){this.transportAbort.abort(),this.loadAbort?.abort(),this.loadAbort=null,this.destroyed=!0,co(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.dismissAccessPanel(),this.dismissHoldExpired(),this.access?.clear(),this.hold&&!this.handedOff&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),Ce(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerCountdownTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(let e of this.motionTimers)clearTimeout(e);this.motionTimers.clear(),this.ro?.disconnect(),this.ro=null,this.viewportResizeHandler&&window.removeEventListener("resize",this.viewportResizeHandler),this.viewportResizeHandler=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,this.root?.remove(),this.root=null,this.modalCleanup?.(),this.closeModal=null}};var We=require("@seatlayer/core");var Dl="seatlayer-performance-group-picker-style";function Bl(){if(document.getElementById(Dl))return;let i=document.createElement("style");i.id=Dl,i.textContent=`
|
|
3263
3263
|
.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)}
|
|
3264
3264
|
.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)}
|