@seatlayer/core 0.107.0 → 0.109.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ar-TPTLODBK.js +1 -0
- package/dist/be-SX5AJ2EF.js +1 -0
- package/dist/bg-T7FBXPVU.js +1 -0
- package/dist/ca-TTI23CKH.js +1 -0
- package/dist/{categoryInventory-D8g-kaQ4.d.cts → categoryInventory-WNOXm5Il.d.cts} +1 -1
- package/dist/{categoryInventory-BfYSZRQ-.d.ts → categoryInventory-nNbloQGE.d.ts} +1 -1
- package/dist/{chunk-45W3GKPP.js → chunk-2JFCDE27.js} +1 -1
- package/dist/{chunk-JXIX3PNI.js → chunk-33SRM2CP.js} +1 -1
- package/dist/{chunk-T7DQX3MB.js → chunk-FBXZWNND.js} +1 -1
- package/dist/{chunk-WR6VXY5U.js → chunk-GPZFVQXV.js} +1 -1
- package/dist/chunk-GUXENCHS.js +1 -0
- package/dist/{chunk-YPGONGDK.js → chunk-HSEX7LUB.js} +1 -1
- package/dist/{chunk-MADX5HYP.js → chunk-JRZHC75P.js} +1 -1
- package/dist/{chunk-BBPJXOTD.js → chunk-LFV56MPT.js} +1 -1
- package/dist/{chunk-RI4LNRP4.js → chunk-MRLWH6RC.js} +1 -1
- package/dist/{chunk-QXJEN5LV.js → chunk-T2QG47QQ.js} +1 -1
- package/dist/{chunk-R6BN4HDQ.js → chunk-UEDS3HJ3.js} +1 -1
- package/dist/{chunk-VBNOTYBG.js → chunk-UNSAUDO2.js} +1 -1
- package/dist/{chunk-N562FZPD.js → chunk-UUIZHJYL.js} +1 -1
- package/dist/{chunk-LWBTU56C.js → chunk-WKWXU5QM.js} +1 -1
- package/dist/chunk-YE4NP3XB.js +1 -0
- package/dist/{chunk-74TZDIMP.js → chunk-ZYQXT5JP.js} +1 -1
- package/dist/core/chart-ops/index.cjs +1 -1
- package/dist/core/chart-ops/index.d.cts +6 -4
- package/dist/core/chart-ops/index.d.ts +6 -4
- package/dist/core/chart-ops/index.js +1 -1
- package/dist/core/inventory/index.cjs +1 -1
- package/dist/core/inventory/index.d.cts +4 -4
- package/dist/core/inventory/index.d.ts +4 -4
- package/dist/core/inventory/index.js +1 -1
- package/dist/core/layout/index.cjs +1 -1
- package/dist/core/layout/index.d.cts +5 -5
- package/dist/core/layout/index.d.ts +5 -5
- package/dist/core/layout/index.js +1 -1
- package/dist/core/quality/index.d.cts +3 -3
- package/dist/core/quality/index.d.ts +3 -3
- package/dist/core/quality/index.js +1 -1
- package/dist/core/render-assets/index.d.cts +2 -2
- package/dist/core/render-assets/index.d.ts +2 -2
- package/dist/core/render-assets/index.js +1 -1
- package/dist/core/seatConfidence.d.cts +1 -1
- package/dist/core/seatConfidence.d.ts +1 -1
- package/dist/core/sections/index.cjs +1 -1
- package/dist/core/sections/index.d.cts +5 -5
- package/dist/core/sections/index.d.ts +5 -5
- package/dist/core/sections/index.js +1 -1
- package/dist/cs-KEMKTFP3.js +1 -0
- package/dist/cy-EGUWNAAE.js +1 -0
- package/dist/da-AHX4SSIT.js +1 -0
- package/dist/de-U3ISXVMR.js +1 -0
- package/dist/el-NBMJFLGN.js +1 -0
- package/dist/es-IYOV3DZF.js +1 -0
- package/dist/et-QHFQ3BIM.js +1 -0
- package/dist/{eventConfigurations-Bw1zW-6G.d.cts → eventConfigurations-Dp0gQBxf.d.cts} +1 -1
- package/dist/{eventConfigurations-DD1i6TSa.d.ts → eventConfigurations-QwuBqi8E.d.ts} +1 -1
- package/dist/fa-FEFRLXP7.js +1 -0
- package/dist/fi-HB6NGCIV.js +1 -0
- package/dist/fr-5EX7Z5Z5.js +1 -0
- package/dist/he-MEW7GMCW.js +1 -0
- package/dist/hi-V2CICZDC.js +1 -0
- package/dist/hr-SUZYZ3DL.js +1 -0
- package/dist/hu-RJFHJPXB.js +1 -0
- package/dist/id-LEP73A6A.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +107 -14
- package/dist/index.d.ts +107 -14
- package/dist/index.js +1 -1
- package/dist/it-V65UNUVY.js +1 -0
- package/dist/ja-3HISSPHC.js +1 -0
- package/dist/ko-5DFMEYUO.js +1 -0
- package/dist/ku-H3EOMAJX.js +1 -0
- package/dist/{labeling-Bho4KGut.d.cts → labeling-Bzfv743A.d.cts} +1 -1
- package/dist/{labeling-DABtLO2e.d.ts → labeling-CLrYgex2.d.ts} +1 -1
- package/dist/localeLoaders-M2TUVL75.js +1 -0
- package/dist/lt-XHIM3BWS.js +1 -0
- package/dist/lv-P5EQD4YY.js +1 -0
- package/dist/ms-XC3SU4I2.js +1 -0
- package/dist/nl-K2N44NUV.js +1 -0
- package/dist/no-C4MFGLSN.js +1 -0
- package/dist/pl-ADABFEA3.js +1 -0
- package/dist/pt-4AQPHHDG.js +1 -0
- package/dist/{renderedQuality-BHQnbC9M.d.cts → renderedQuality-D7adZpeD.d.cts} +1 -1
- package/dist/{renderedQuality-DFbFLsci.d.ts → renderedQuality-DL_Bwohi.d.ts} +1 -1
- package/dist/{renderer-DiMguwVt.d.ts → renderer-BaX5XS07.d.cts} +34 -9
- package/dist/{renderer-BDdsk9AZ.d.cts → renderer-GIwwPupP.d.ts} +34 -9
- package/dist/ro-PZLP7BEU.js +1 -0
- package/dist/ru-33R4HJF2.js +1 -0
- package/dist/{seatTypeIcons-C_4CKG9D.d.ts → seatTypeIcons-BbHRuAXE.d.ts} +1 -1
- package/dist/{seatTypeIcons-DyJDDsaT.d.cts → seatTypeIcons-CnIsRKIM.d.cts} +1 -1
- package/dist/{sections-BHPs1PT8.d.ts → sections-BOaTNaYG.d.ts} +1 -1
- package/dist/{sections-BVrNW7Ne.d.cts → sections-DRiD7LLT.d.cts} +1 -1
- package/dist/{segmentedRowModel-DPZ8VAbP.d.cts → segmentedRowModel-C0MT2W3h.d.cts} +1 -1
- package/dist/{segmentedRowModel-2c46otTs.d.ts → segmentedRowModel-CDm8wEMA.d.ts} +1 -1
- package/dist/sk-XCXFOU73.js +1 -0
- package/dist/sl-23PMG7BB.js +1 -0
- package/dist/sr-SOPFKPZ5.js +1 -0
- package/dist/sv-PKDMDUS5.js +1 -0
- package/dist/{tableSizing-Dj5yxEn5.d.cts → tableSizing-BvWmV_II.d.cts} +3 -3
- package/dist/{tableSizing-C8A2XC6C.d.ts → tableSizing-CjeVoew4.d.ts} +3 -3
- package/dist/th-NU4K5DFF.js +1 -0
- package/dist/{ticketRestrictions-DsAql5wr.d.cts → ticketRestrictions-Cp_Wkjy9.d.cts} +2 -2
- package/dist/{ticketRestrictions-DE79a54T.d.ts → ticketRestrictions-P3RuwcmT.d.ts} +2 -2
- package/dist/tr-HEDRXONB.js +1 -0
- package/dist/{types-BZQ35nwD.d.cts → types-fSWyPu3f.d.cts} +3 -0
- package/dist/{types-BZQ35nwD.d.ts → types-fSWyPu3f.d.ts} +3 -0
- package/dist/uk-T7JNLCSZ.js +1 -0
- package/dist/vi-EWDKGL2Y.js +1 -0
- package/dist/view3d/crossfade/panorama.d.cts +1 -1
- package/dist/view3d/crossfade/panorama.d.ts +1 -1
- package/dist/view3d/index.cjs +32 -32
- package/dist/view3d/index.d.cts +3 -3
- package/dist/view3d/index.d.ts +3 -3
- package/dist/view3d/index.js +4 -4
- package/dist/view3d/scene/scene.worker.cjs +1 -1
- package/dist/view3d/scene/scene.worker.js +1 -1
- package/dist/zh-Hans-ED7CX2SQ.js +1 -0
- package/dist/zh-Hant-UKJQ2KBS.js +1 -0
- package/package.json +1 -1
- package/dist/ar-D6ASWQBI.js +0 -1
- package/dist/be-T23MSCFC.js +0 -1
- package/dist/bg-2MMSY43I.js +0 -1
- package/dist/ca-HSW3LSXH.js +0 -1
- package/dist/chunk-227OYVC4.js +0 -1
- package/dist/chunk-J33DNOMI.js +0 -1
- package/dist/cs-W36YX555.js +0 -1
- package/dist/cy-6264NCZV.js +0 -1
- package/dist/da-QPYLJUH7.js +0 -1
- package/dist/de-Q5VU4NBN.js +0 -1
- package/dist/el-HYLFHJC3.js +0 -1
- package/dist/es-N35HVHMD.js +0 -1
- package/dist/et-HQUPUM5Y.js +0 -1
- package/dist/fa-JL3HW42Q.js +0 -1
- package/dist/fi-ZFWROLPU.js +0 -1
- package/dist/fr-6EKBGKIT.js +0 -1
- package/dist/he-KSOTIRJW.js +0 -1
- package/dist/hi-72CF2RXB.js +0 -1
- package/dist/hr-2CRBTSQT.js +0 -1
- package/dist/hu-Y33MEJPT.js +0 -1
- package/dist/id-UW2QRTC3.js +0 -1
- package/dist/it-XFIJHKQA.js +0 -1
- package/dist/ja-LHVHSM5J.js +0 -1
- package/dist/ko-MCXETVAQ.js +0 -1
- package/dist/ku-MNPV6BJJ.js +0 -1
- package/dist/localeLoaders-UTZMQJQF.js +0 -1
- package/dist/lt-OVUV42OZ.js +0 -1
- package/dist/lv-3ZE6IM47.js +0 -1
- package/dist/ms-LF5QQTFJ.js +0 -1
- package/dist/nl-D4FX7T7U.js +0 -1
- package/dist/no-JLXHCMSU.js +0 -1
- package/dist/pl-TR5U2EPQ.js +0 -1
- package/dist/pt-HRM4OUMU.js +0 -1
- package/dist/ro-UFIOIOVH.js +0 -1
- package/dist/ru-VMRD53B7.js +0 -1
- package/dist/sk-4DALII6N.js +0 -1
- package/dist/sl-CDZGH6C6.js +0 -1
- package/dist/sr-KMFWIJPY.js +0 -1
- package/dist/sv-2JROBNJB.js +0 -1
- package/dist/th-MF3TSZDL.js +0 -1
- package/dist/tr-76YSRBN3.js +0 -1
- package/dist/uk-JQKEV42K.js +0 -1
- package/dist/vi-KRM5S2Q7.js +0 -1
- package/dist/zh-Hans-FEUYIOYS.js +0 -1
- package/dist/zh-Hant-PK2XOE2G.js +0 -1
package/dist/view3d/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as Point, C as ChartDoc } from '../types-
|
|
2
|
-
import { E as EventConfigurationProductionElementKind, a as EventConfigurationOcclusion, b as EventConfigurationVersion } from '../eventConfigurations-
|
|
3
|
-
import { E as ExpandedSeat } from '../renderer-
|
|
1
|
+
import { P as Point, C as ChartDoc } from '../types-fSWyPu3f.cjs';
|
|
2
|
+
import { E as EventConfigurationProductionElementKind, a as EventConfigurationOcclusion, b as EventConfigurationVersion } from '../eventConfigurations-Dp0gQBxf.cjs';
|
|
3
|
+
import { E as ExpandedSeat } from '../renderer-BaX5XS07.cjs';
|
|
4
4
|
import { S as StageKind } from '../stage-CKb7aNoH.cjs';
|
|
5
5
|
import { SeatView } from './crossfade/panorama.cjs';
|
|
6
6
|
|
package/dist/view3d/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as Point, C as ChartDoc } from '../types-
|
|
2
|
-
import { E as EventConfigurationProductionElementKind, a as EventConfigurationOcclusion, b as EventConfigurationVersion } from '../eventConfigurations-
|
|
3
|
-
import { E as ExpandedSeat } from '../renderer-
|
|
1
|
+
import { P as Point, C as ChartDoc } from '../types-fSWyPu3f.js';
|
|
2
|
+
import { E as EventConfigurationProductionElementKind, a as EventConfigurationOcclusion, b as EventConfigurationVersion } from '../eventConfigurations-QwuBqi8E.js';
|
|
3
|
+
import { E as ExpandedSeat } from '../renderer-GIwwPupP.js';
|
|
4
4
|
import { S as StageKind } from '../stage-CKb7aNoH.js';
|
|
5
5
|
import { SeatView } from './crossfade/panorama.js';
|
|
6
6
|
|
package/dist/view3d/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as tt,B as Kt,C as uo,D as nt,E as Qt,F as mo,G as ho,a as Je,b as Ie,c as yt,d as jt,e as $n,f as Kn,g as ye,h as Qn,i as Zn,j as Jn,k as xt,l as ze,m as et,n as eo,o as $t,p as ua,q as to,r as no,s as oo,t as ro,u as Ae,v as ao,w as io,x as so,y as lo,z as co}from"../chunk-YPGONGDK.js";import"../chunk-BBPJXOTD.js";import"../chunk-45W3GKPP.js";import{d as gt}from"../chunk-YPVYZYMH.js";import"../chunk-LWBTU56C.js";import"../chunk-QXJEN5LV.js";import"../chunk-227OYVC4.js";import"../chunk-T7DQX3MB.js";import"../chunk-VBNOTYBG.js";import"../chunk-4N5CHKHD.js";import{b as Xn,c as qt,d as qn,n as jn}from"../chunk-JXIX3PNI.js";import"../chunk-M4NGX5NM.js";import"../chunk-MADX5HYP.js";import"../chunk-R6BN4HDQ.js";import"../chunk-N562FZPD.js";import{eb as Wn}from"../chunk-J33DNOMI.js";import"../chunk-S3VH7IDA.js";import{d as Un,l as Yn}from"../chunk-JBOTRSMY.js";import"../chunk-CRCGO52K.js";function po(t,e,n){let r=Math.floor(e.length/3),a=n.center[0],o=n.center[2];if(r>0){let l=Math.max(1,Math.floor(r/4e3)),c=0,f=0,h=0;for(let u=0;u<r;u+=l)c+=e[u*3],f+=e[u*3+2],h++;a=c/h,o=f/h}let i=t[0]-a,s=t[2]-o;return Math.hypot(i,s)>n.radius*.12?Math.atan2(i,s):void 0}import{Mat4 as Hs}from"ogl";function fo(t,e,n="#ffffff"){let{iPosition:r,count:a}=e.seats;if(a<2||typeof document>"u")return null;let o=1/0,i=-1/0,s=1/0,l=-1/0;for(let A=0;A<a;A++){let R=r[A*3],L=r[A*3+2];R<o&&(o=R),R>i&&(i=R),L<s&&(s=L),L>l&&(l=L)}for(let A of e.stages)o=Math.min(o,A.cx-A.halfX),i=Math.max(i,A.cx+A.halfX),s=Math.min(s,A.cz-A.halfZ),l=Math.max(l,A.cz+A.halfZ);let c=Math.min(130/Math.max(.001,i-o),86/Math.max(.001,l-s)),f=(148-(i-o)*c)/2,h=(104-(l-s)*c)/2,u=A=>f+(A-o)*c,m=A=>h+(A-s)*c,d=Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),y=document.createElement("canvas");y.width=Math.round(148*d),y.height=Math.round(104*d),y.setAttribute("aria-hidden","true"),y.setAttribute("data-seat-locator","");let v=y.style;v.position="absolute",v.left="12px",v.bottom="12px",v.width="148px",v.height="104px",v.borderRadius="10px",v.background="rgba(10,14,22,.72)",v.border="1px solid rgba(255,255,255,.14)",v.boxShadow="0 4px 14px rgba(0,0,0,.35)",v.pointerEvents="none",v.zIndex="3",v.display="none",t.appendChild(y);let w=document.createElement("canvas");w.width=y.width,w.height=y.height;let E=w.getContext("2d");if(E){E.scale(d,d),E.fillStyle="rgba(214,222,234,.28)";let A=Math.max(1,Math.ceil(a/6e3));for(let R=0;R<a;R+=A)E.fillRect(u(r[R*3])-.6,m(r[R*3+2])-.6,1.2,1.2);E.fillStyle="rgba(236,240,246,.16)",E.strokeStyle="rgba(236,240,246,.55)",E.lineWidth=1;for(let R of e.stages){let L=u(R.cx-R.halfX),b=m(R.cz-R.halfZ),F=R.halfX*2*c,x=R.halfZ*2*c;E.fillRect(L,b,F,x),E.strokeRect(L+.5,b+.5,Math.max(0,F-1),Math.max(0,x-1))}}let C=y.getContext("2d"),D="";return{el:y,update(A,R){if(!A||!C||t.clientWidth>0&&t.clientWidth<560){v.display!=="none"&&(v.display="none"),D="";return}let L=u(A[0]),b=m(A[2]),F=R?Math.atan2(R[2],R[0]):0,x=`${L.toFixed(1)},${b.toFixed(1)},${F.toFixed(2)}`;if(x!==D){if(D=x,v.display="block",C.setTransform(1,0,0,1,0,0),C.clearRect(0,0,y.width,y.height),C.drawImage(w,0,0),C.setTransform(d,0,0,d,0,0),R){let I=C.createRadialGradient(L,b,0,L,b,26);I.addColorStop(0,"rgba(255,255,255,.55)"),I.addColorStop(1,"rgba(255,255,255,0)"),C.fillStyle=I,C.beginPath(),C.moveTo(L,b),C.arc(L,b,26,F-.5,F+.5),C.closePath(),C.fill()}C.fillStyle=n,C.strokeStyle="rgba(10,14,22,.9)",C.lineWidth=1.5,C.beginPath(),C.arc(L,b,3.6,0,Math.PI*2),C.fill(),C.stroke()}},dispose(){y.remove()}}}var Zt=78,vo=18;function bo(){let t=[],e=[],n=[],r=[],a=[],o=[{n:[1,0,0],c:[[1,0,0],[1,1,0],[1,1,1],[1,0,1]]},{n:[-1,0,0],c:[[0,0,1],[0,1,1],[0,1,0],[0,0,0]]},{n:[0,1,0],c:[[0,1,0],[0,1,1],[1,1,1],[1,1,0]]},{n:[0,-1,0],c:[[0,0,1],[0,0,0],[1,0,0],[1,0,1]]},{n:[0,0,1],c:[[0,0,1],[1,0,1],[1,1,1],[0,1,1]]},{n:[0,0,-1],c:[[1,0,0],[0,0,0],[0,1,0],[1,1,0]]}];for(let s of[{part:1,min:[-1,.36,-.95],max:[1,.45,1]},{part:2,min:[-1,Ie,-1],max:[1,yt,-.72]}])for(let l of o){let c=t.length/3,f=l.n[1]+(s.part===2?Math.abs(l.n[0])*(1-jt)/(yt-Ie):0),h=Math.hypot(l.n[0],f,l.n[2]),u=[l.n[0]/h,f/h,l.n[2]/h];for(let[m,d]of l.c.entries()){let y=d.map((v,w)=>s.min[w]+v*(s.max[w]-s.min[w]));s.part===2&&(y[0]*=1-d[1]*(1-jt)),t.push(...y),e.push(...u),n.push(s.part),r.push(...[[-1,-1],[1,-1],[1,1],[-1,1]][m])}a.push(c,c+1,c+2,c,c+2,c+3)}let i=t.length/3;for(let[s,l]of[[-1,-1],[1,-1],[1,1],[-1,1]])t.push(s,l,0),e.push(0,1,0),n.push(0),r.push(s,l);return a.push(i,i+1,i+2,i,i+2,i+3),a.push(...a.slice(12,18),...a.slice(60,66),...a.slice(72,78)),{position:new Float32Array(t),normal:new Float32Array(e),surface:new Float32Array(n),uv:new Float32Array(r),index:new Uint16Array(a)}}import{Renderer as da}from"ogl";function ma(){let t=typeof window<"u"&&window.devicePixelRatio||1,e=navigator.deviceMemory,n=typeof e=="number"&&e<=4?1.5:2;return Math.min(t,n)}var St=class{constructor(e,n){this.clearRgb=[0,0,0];this.container=e,this.canvas=document.createElement("canvas"),this.canvas.style.display="block",this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.touchAction="none",this.canvas.tabIndex=0,this.canvas.setAttribute("role","application"),this.canvas.setAttribute("aria-label","Interactive 3D venue. Drag or use arrow keys to look around; pinch, scroll, plus or minus to zoom."),this.renderer=new da({canvas:this.canvas,dpr:ma(),alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[xt.top[0],xt.top[1],xt.top[2]],this.gl.clearColor(this.clearRgb[0],this.clearRgb[1],this.clearRgb[2],1),e.appendChild(this.canvas),this.lostHandler=r=>{r.preventDefault(),n.onContextLost()},this.restoredHandler=()=>n.onContextRestored(),this.canvas.addEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.restoredHandler,!1),this.resize()}setClearColor(e){this.clearRgb=[e[0],e[1],e[2]],this.gl.clearColor(e[0],e[1],e[2],1)}get clearColor(){return this.clearRgb}resize(){let e=Math.max(1,this.container.clientWidth||this.canvas.clientWidth||1),n=Math.max(1,this.container.clientHeight||this.canvas.clientHeight||1);return this.renderer.setSize(e,n),{width:e,height:n}}get pixelHeight(){return this.renderer.height*this.renderer.dpr}get aspect(){return this.renderer.width/Math.max(1,this.renderer.height)}dispose(){this.canvas.removeEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.restoredHandler,!1);let e=this.gl.getExtension("WEBGL_lose_context");e&&e.loseContext(),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}simulateContextLossCycle(){let e=this.gl.getExtension("WEBGL_lose_context");e&&(e.loseContext(),setTimeout(()=>{e.restoreContext&&e.restoreContext()},300))}};import{Camera as ha,Vec3 as Jt}from"ogl";var de=Math.PI/180,en=15*de,tn=80*de,Ne=.12,go=35,nn=1.25,yo=.006,pa=4,He=.82,ot=1/He,fa=.12,va=2;function ba(t,e){return{azimuth:0-t*yo,polar:-e*yo}}function xo(t,e,n){let r=Math.max(va,Math.max(1,e)*fa),a=n*pa;return{minDist:t?Math.min(t.minDist,r):r,maxDist:t?Math.max(t.maxDist,a):a}}var ga=1.5;function ya(t,e,n){let r=Math.max(1,n)*ga;if(!t)return{anchor:[e[0],e[1],e[2]],limit:r};let[a,o,i]=t.anchor,s=e[1]-o,l=Math.max(Math.abs(e[0]-a),Math.abs(e[2]-i),s>=0?s:-s*2);return{anchor:t.anchor,limit:Math.max(t.limit,l+r)}}function xa(t,e,n,r,a,o,i,s){let l=Math.sin(n),c=[l*Math.sin(e),Math.cos(n),l*Math.cos(e)],f=[t[0]+r*c[0],t[1]+r*c[1],t[2]+r*c[2]],h=[-c[0],-c[1],-c[2]],u=[-h[2],0,h[0]],m=Math.hypot(u[0],u[2])||1;u=[u[0]/m,0,u[2]/m];let d=[u[1]*h[2]-u[2]*h[1],u[2]*h[0]-u[0]*h[2],u[0]*h[1]-u[1]*h[0]],y=Math.tan(a*de/2),v=y*(o>0?o:1),w=[0,1,2].map(D=>h[D]+i*v*u[D]+s*y*d[D]);if(w[1]>=-1e-6)return null;let E=(t[1]-f[1])/w[1],C=Math.hypot(w[0],w[1],w[2]);return!(E>0)||E*C>r*Sa?null:[f[0]+w[0]*E,t[1],f[2]+w[2]*E]}var So=3,Sa=4,wo=.72,wa=.6;function Ma(t,e,n){return t!=="auto"?t:n!==null&&e<n*wa?"pan":"orbit"}function Mo(t,e){let n=Math.sin(e),r=-n*Math.sin(t),a=-Math.cos(e),o=-n*Math.cos(t);if(Math.abs(a)>.999)return null;let i=-o,s=r,l=Math.hypot(i,s);return i/=l,s/=l,{fx:r,fy:a,fz:o,rx:i,rz:s,ux:-s*a,uy:s*r-i*o,uz:i*a}}var Aa=.4;function Pa(t,e,n,r,a,o){let i=[t.center[0],t.center[1],t.center[2]],s=o(i),l=t.fitPoints,c=Mo(r,a);if(!l||l.length<9||!c)return{center:i,distance:s};let{fx:f,fy:h,fz:u,rx:m,rz:d,ux:y,uy:v,uz:w}=c,E=Math.hypot(f,u),C=f/E,D=u/E,A=C*y+D*w,R=Aa*Math.max(1,t.radius);for(let L=0;L<3;L++){let b=1/0,F=-1/0,x=1/0,I=-1/0;for(let W=0;W+2<l.length;W+=3){let N=l[W]-i[0],te=l[W+1]-i[1],X=l[W+2]-i[2],J=s+N*f+te*h+X*u;if(!(J>.001))continue;let M=(N*m+X*d)/(J*e),P=(N*y+te*v+X*w)/(J*n);M<b&&(b=M),M>F&&(F=M),P<x&&(x=P),P>I&&(I=P)}if(!Number.isFinite(b))break;let z=(b+F)/2*s*e,_=Math.abs(A)>.1?(x+I)/2*s*n/A:0,O=z*m+_*C,G=z*d+_*D;if(Math.hypot(i[0]+O-t.center[0],i[2]+G-t.center[2])>R){let W=i[0]-t.center[0],N=i[2]-t.center[2],te=W+O,X=N+G,J=R/Math.hypot(te,X);O=te*J-W,G=X*J-N}i=[i[0]+O,i[1],i[2]+G],s=o(i)}return{center:i,distance:s}}var wt=class{constructor(e,n,r,a){this.fovY=go;this.target=new Jt;this.azimuth=-30*de;this.polar=55*de;this.distance=10;this.azT=-30*de;this.polT=55*de;this.distT=10;this.minDist=1;this.maxDist=100;this.envelope=null;this.gestureFired=!1;this.interactionEnabled=!0;this.dragging=!1;this.panning=!1;this.lastX=0;this.lastY=0;this.activePointers=new Map;this.pinchDist=0;this.pinchCx=0;this.pinchCy=0;this.targetT=new Jt;this.panAnchor=new Jt;this.panLimit=0;this.panBox=null;this.zoomPointResolver=null;this.primaryDragMode="auto";this.overviewDist=null;this.pinchAngle=0;this.camera=new ha(e,{fov:go,near:.1,far:5e3,aspect:1}),this.canvas=n,this.requestRender=r,this.onGesture=a,this.onPointerDown=o=>{if(this.interactionEnabled){try{this.canvas.setPointerCapture?.(o.pointerId)}catch{}if(this.activePointers.set(o.pointerId,{x:o.clientX,y:o.clientY}),this.activePointers.size===1){let i=this.dragAction(),s=i==="orbit"?"pan":"orbit",l=o.button===2||o.button===1||o.shiftKey?s:i;this.panning=l==="pan",this.dragging=!this.panning,this.lastX=o.clientX,this.lastY=o.clientY}else if(this.activePointers.size===2){this.dragging=!1,this.panning=!1,this.pinchDist=this.currentPinchDistance(),this.pinchAngle=this.currentPinchAngle();let i=this.pinchCentroid();this.pinchCx=i.x,this.pinchCy=i.y}}},this.onPointerMove=o=>{if(!this.interactionEnabled||!this.activePointers.has(o.pointerId))return;if(this.activePointers.set(o.pointerId,{x:o.clientX,y:o.clientY}),this.activePointers.size>=2){let c=this.currentPinchDistance(),f=this.pinchCentroid();this.pinchDist>0&&(this.dollyAt(Math.exp((this.pinchDist-c)*.005),f.x,f.y),this.fireGesture()),this.pinchDist=c;let h=this.currentPinchAngle(),u=h-this.pinchAngle;u>Math.PI&&(u-=2*Math.PI),u<-Math.PI&&(u+=2*Math.PI),this.pinchAngle=h,Math.abs(u)>1e-4&&Math.abs(u)<.5&&(this.azT+=u,this.fireGesture()),this.panBy(f.x-this.pinchCx,f.y-this.pinchCy),this.pinchCx=f.x,this.pinchCy=f.y;return}let i=o.clientX-this.lastX,s=o.clientY-this.lastY;if(this.panning){this.lastX=o.clientX,this.lastY=o.clientY,(i!==0||s!==0)&&(this.panBy(i,s),this.fireGesture());return}if(!this.dragging)return;this.lastX=o.clientX,this.lastY=o.clientY,(i!==0||s!==0)&&this.fireGesture();let l=ba(i,s);this.azT+=l.azimuth,this.polT=Math.max(en,Math.min(tn,this.polT+l.polar)),this.requestRender()},this.onPointerUp=o=>{this.activePointers.delete(o.pointerId);try{this.canvas.releasePointerCapture?.(o.pointerId)}catch{}this.activePointers.size<2&&(this.pinchDist=0),this.activePointers.size===0&&(this.dragging=!1,this.panning=!1)},this.onContextMenu=o=>{o.preventDefault()},this.onWheel=o=>{if(o.preventDefault(),!this.interactionEnabled)return;let i=o.deltaMode===1?16:o.deltaMode===2?100:1,s=Math.max(-2,Math.min(2,o.deltaY*i/100));this.dollyAt(Math.exp(s*.22),o.clientX,o.clientY),this.fireGesture()},this.onKeyDown=o=>{if(!this.interactionEnabled)return;let i=7*de;if(o.shiftKey&&(o.key==="ArrowLeft"||o.key==="ArrowRight"||o.key==="ArrowUp"||o.key==="ArrowDown"))this.panBy(o.key==="ArrowLeft"?-32:o.key==="ArrowRight"?32:0,o.key==="ArrowUp"?-32:o.key==="ArrowDown"?32:0);else if(o.key==="ArrowLeft"||o.key==="ArrowRight")this.azT+=o.key==="ArrowLeft"?i:-i;else if(o.key==="ArrowUp"||o.key==="ArrowDown")this.polT=Math.max(en,Math.min(tn,this.polT+(o.key==="ArrowUp"?-i:i)));else if(o.key==="+"||o.key==="=")this.dollyBy(He);else if(o.key==="-"||o.key==="_")this.dollyBy(ot);else return;o.preventDefault(),this.fireGesture(),this.requestRender()},n.addEventListener("pointerdown",this.onPointerDown),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerup",this.onPointerUp),n.addEventListener("pointercancel",this.onPointerUp),n.addEventListener("wheel",this.onWheel,{passive:!1}),n.addEventListener("keydown",this.onKeyDown),n.addEventListener("contextmenu",this.onContextMenu)}pinchCentroid(){let e=[...this.activePointers.values()];if(!e.length)return{x:0,y:0};let n=0,r=0;for(let a of e)n+=a.x,r+=a.y;return{x:n/e.length,y:r/e.length}}panBy(e,n){let r=this.canvas.clientHeight||1,a=2*this.distance*Math.tan(this.fovY*de/2)/r,o=Math.sin(this.azimuth),i=Math.cos(this.azimuth),s=i,l=-o,c=Math.cos(this.polar),f=Math.sin(this.polar),h=-o*c,u=-i*c;this.targetT.x+=(-e*s+n*h)*a,this.targetT.z+=(-e*l+n*u)*a,this.targetT.y+=n*f*a,this.clampPan(),this.requestRender()}widenPanBox(e){this.panBox=ya(this.panBox,e.center,e.radius),this.panAnchor.set(this.panBox.anchor[0],this.panBox.anchor[1],this.panBox.anchor[2]),this.panLimit=this.panBox.limit}clampPan(){if(this.panLimit<=0)return;let e=this.panLimit,n=this.panAnchor.x,r=this.panAnchor.y,a=this.panAnchor.z;this.targetT.x=Math.max(n-e,Math.min(n+e,this.targetT.x)),this.targetT.z=Math.max(a-e,Math.min(a+e,this.targetT.z)),this.targetT.y=Math.max(r-e*.5,Math.min(r+e,this.targetT.y))}fireGesture(){this.gestureFired||(this.gestureFired=!0,this.onGesture?.())}currentPinchAngle(){let[e,n]=[...this.activePointers.values()];return e&&n?Math.atan2(n.y-e.y,n.x-e.x):0}dragAction(){return Ma(this.primaryDragMode,this.distT,this.overviewDist)}currentPinchDistance(){let e=[...this.activePointers.values()];return e.length<2?0:Math.hypot(e[0].x-e[1].x,e[0].y-e[1].y)}dollyBy(e){this.distT=Math.max(this.minDist,Math.min(this.maxDist,this.distT*e)),this.requestRender()}dollyAt(e,n,r){let a=this.distT,o=this.canvas.getBoundingClientRect?.(),i=this.zoomPointResolver?.(n,r)??null;if(i){this.distT=Math.max(So,Math.min(this.maxDist,this.distT*e)),this.minDist=Math.min(this.minDist,Math.max(So,this.distT)),this.requestRender(),this.scaleTargetAbout(i,this.distT/a);return}let s=o&&o.width>0&&o.height>0?xa([this.targetT.x,this.targetT.y,this.targetT.z],this.azT,this.polT,this.distT,this.fovY,this.camera.aspect||o.width/o.height,(n-o.left)/o.width*2-1,1-(r-o.top)/o.height*2):null;this.dollyBy(e),s&&this.scaleTargetAbout(s,this.distT/a)}scaleTargetAbout(e,n){!Number.isFinite(n)||n===1||(this.targetT.x=e[0]+(this.targetT.x-e[0])*n,this.targetT.y=e[1]+(this.targetT.y-e[1])*n,this.targetT.z=e[2]+(this.targetT.z-e[2])*n,this.clampPan())}setZoomPointResolver(e){this.zoomPointResolver=e}zoomBy(e){this.interactionEnabled&&(this.dollyBy(e),this.fireGesture())}dollyLimitState(){return{atMin:this.distT<=this.minDist+1e-6,atMax:this.distT>=this.maxDist-1e-6}}setPrimaryDragMode(e){this.primaryDragMode=e}setInteractionEnabled(e){this.interactionEnabled=e,!e&&(this.activePointers.clear(),this.dragging=!1,this.panning=!1,this.pinchDist=0)}frame(e,n=!1,r,a=!1,o){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.widenPanBox(e);let i=Math.max(1,e.radius),s=this.fovY*de/2,l=a?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,c=Math.atan(Math.tan(s)*l);this.azT=r??-30*de,this.polT=Math.max(15,Math.min(80,o?.polarDeg??55))*de;let f=this.framedOn(e,s,c),h=f.distance;this.target.set(f.center[0],f.center[1],f.center[2]),this.targetT.copy(this.target),this.distT=h*Math.max(1.05,Math.min(2,o?.margin??nn)),this.envelope=xo(this.envelope,i,h),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.overviewDist===null&&(this.overviewDist=this.distT),n?(this.azimuth=this.azT,this.polar=12*de,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(e){if(!(e>0)||!Number.isFinite(e))return;let n=this.camera.aspect;if(this.interactionEnabled&&n>0){let r=Math.min(n,1)/Math.min(e,1);this.distance*=r,this.distT*=r,this.overviewDist!==null&&(this.overviewDist*=r),this.maxDist=Math.max(this.maxDist,this.distance,this.distT),this.applyPosition()}this.camera.perspective({aspect:e})}glideTo(e,n){this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.widenPanBox(e),this.targetT.set(e.center[0],e.center[1],e.center[2]);let r=this.fovY*de/2,a=Math.atan(Math.tan(r)*(this.camera.aspect||1));this.azT=this.azimuth,this.polT=Math.max(15,Math.min(80,n?.polarDeg??55))*de;let o=this.framedOn(e,r,a),i=o.distance;this.targetT.set(o.center[0],o.center[1],o.center[2]),this.distT=i*Math.max(1.05,Math.min(2,n?.margin??nn)),this.envelope=xo(this.envelope,Math.max(1,e.radius),i),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.requestRender()}frameSoft(e,n,r=!1,a){this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.widenPanBox(e),this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect});let o=this.fovY*de/2,i=r?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,s=Math.atan(Math.tan(o)*i);this.azT=n??this.azimuth,this.polT=Math.max(15,Math.min(80,a?.polarDeg??55))*de;let l=this.framedOn(e,o,s);this.targetT.set(l.center[0],l.center[1],l.center[2]),this.distT=l.distance*Math.max(1.05,Math.min(2,a?.margin??nn))}framedOn(e,n,r){return Pa(e,Math.tan(r),Math.tan(n),this.azT,this.polT,a=>this.fitDistance({...e,center:a},n,r,this.azT,this.polT))}fitDistance(e,n,r,a,o){let i=Math.max(1,e.radius),s=Math.max(i/Math.tan(n),i/Math.tan(r)),l=e.box;if(!l)return s;let c=Mo(a,o);if(!c)return s;let{fx:f,fy:h,fz:u,rx:m,rz:d,ux:y,uy:v,uz:w}=c,E=Math.tan(r),C=Math.tan(n),D=1;for(let x=0;x<8;x++){let I=(x&1?l.max[0]:l.min[0])-e.center[0],z=(x&2?l.max[1]:l.min[1])-e.center[1],_=(x&4?l.max[2]:l.min[2])-e.center[2],O=I*f+z*h+_*u,G=Math.abs(I*m+_*d),B=Math.abs(I*y+z*v+_*w);D=Math.max(D,G/E-O,B/C-O)}let A=Math.min(s,Math.max(D,i*.35)),R=e.fitPoints;if(!R||R.length<9)return A;let L=0,b=1/(E*wo),F=1/(C*wo);for(let x=0;x+2<R.length;x+=3){let I=R[x]-e.center[0],z=R[x+1]-e.center[1],_=R[x+2]-e.center[2],O=I*f+z*h+_*u,G=Math.abs(I*m+_*d),B=Math.abs(I*y+z*v+_*w);L=Math.max(L,G*b-O,B*F-O)}return Math.min(A*1.5,Math.max(A*.55,L))}updateClipping(e){let n=this.camera.position.x-e.center[0],r=this.camera.position.y-e.center[1],a=this.camera.position.z-e.center[2],o=Math.hypot(this.camera.position.x-this.target.x,this.camera.position.y-this.target.y,this.camera.position.z-this.target.z),i=this.interactionEnabled&&Math.abs(o-this.distance)<=this.distance*.01,{near:s,far:l}=Ta(Math.hypot(n,r,a),e.radius,i?this.distance:null);this.camera.perspective({near:s,far:l,aspect:this.camera.aspect})}update(){let e=this.azT-this.azimuth,n=this.polT-this.polar,r=this.distT-this.distance,a=this.targetT.x-this.target.x,o=this.targetT.y-this.target.y,i=this.targetT.z-this.target.z,s=Math.max(1e-4,this.distance*1e-4),l=Math.abs(e)>1e-4||Math.abs(n)>1e-4||Math.abs(r)>1e-4||Math.abs(a)>s||Math.abs(o)>s||Math.abs(i)>s;return this.azimuth+=e*Ne,this.polar+=n*Ne,this.distance+=r*Ne,this.target.x+=a*Ne,this.target.y+=o*Ne,this.target.z+=i*Ne,l&&this.applyPosition(),l}get currentAzimuth(){return this.azimuth}get currentDistance(){return this.distance}get targetDistance(){return this.distT}syncFromCamera(){let e=this.camera.position.x-this.target.x,n=this.camera.position.y-this.target.y,r=this.camera.position.z-this.target.z,a=Math.hypot(e,n,r)||1,o=Math.max(en,Math.min(tn,Math.acos(Math.max(-1,Math.min(1,n/a)))));this.distance=this.distT=a,this.polar=this.polT=o,this.azimuth=this.azT=Math.atan2(e,r)}snapshot(){let e=this.target.clone(),n=this.targetT.clone(),{azimuth:r,azT:a,polar:o,polT:i,distance:s,distT:l}=this,c=this.camera.position.clone(),f=[...this.camera.quaternion],h=this.camera.fov;return()=>{this.target.copy(e),this.targetT.copy(n),Object.assign(this,{azimuth:r,azT:a,polar:o,polT:i,distance:s,distT:l}),this.camera.position.copy(c),this.camera.quaternion.set(f[0],f[1],f[2],f[3]),this.camera.perspective({fov:h,aspect:this.camera.aspect}),this.camera.updateMatrixWorld()}}setTarget(e){this.target.set(e[0],e[1],e[2]),this.targetT.copy(this.target)}resumeAfterFlight(e){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),e&&this.target.set(e[0],e[1],e[2]),this.targetT.copy(this.target),this.syncFromCamera()}applyPosition(){let e=Math.sin(this.polar),n=this.target.x+this.distance*e*Math.sin(this.azimuth),r=this.target.y+this.distance*Math.cos(this.polar),a=this.target.z+this.distance*e*Math.cos(this.azimuth);this.camera.position.set(n,r,a),this.camera.lookAt(this.target)}dispose(){this.canvas.removeEventListener("pointerdown",this.onPointerDown),this.canvas.removeEventListener("pointermove",this.onPointerMove),this.canvas.removeEventListener("pointerup",this.onPointerUp),this.canvas.removeEventListener("pointercancel",this.onPointerUp),this.canvas.removeEventListener("wheel",this.onWheel),this.canvas.removeEventListener("keydown",this.onKeyDown),this.canvas.removeEventListener("contextmenu",this.onContextMenu),this.activePointers.clear()}},Ca=.1,Ea=.25;function Ta(t,e,n){let r=Math.max(1,e)*1.18,a=n==null?Ea:Math.max(.05,n*Ca),o=Math.max(a,t-r),i=Math.max(o+10,t+r);return{near:o,far:i}}var Mt=class{constructor(e){this.rafId=0;this.running=!1;this.lastTime=0;this.fpsEma=0;this.rendered=0;this.tick=e=>{let n=this.lastTime?(e-this.lastTime)/1e3:.016666666666666666;if(this.lastTime=e,n>0){let a=1/n;this.fpsEma=this.fpsEma?this.fpsEma*.9+a*.1:a}this.rendered++,this.frame(n)?this.rafId=requestAnimationFrame(this.tick):(this.running=!1,this.rafId=0)};this.frame=e}requestRender(){this.running||(this.running=!0,this.lastTime=0,this.rafId=requestAnimationFrame(this.tick))}stats(){return{fps:this.running?Math.round(this.fpsEma):0,rendered:this.rendered,idle:!this.running}}stop(){this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=0,this.running=!1}};function Ao(t){let e=!1;return n=>{n!==e&&(e=n,n?t.dataset.slReady="1":delete t.dataset.slReady)}}var Ge=2.5,Ra=1.15,rt=12,Be=22,Po=6,Co=9.5,Eo=.9,To=2.2,on=30,rn=4,At=8192;var al=Be+rn;function Ro(t,e){let n=e*1.4,r=e*3.2;if(t<=n)return{scale:1,fade:0,minPixels:Ge};let a=Math.min(1,(t-n)/Math.max(.001,r-n));return{scale:1-a*.4,fade:a*.55,minPixels:Ge+a*(Ra-Ge)}}function _o(t,e,n){return!(t>0)||!(e>0)||!(n>0)?!1:e*n/t>=64}var _a=12;function Io(t,e,n,r,a){if(!(t>0)||!(e>0)||!(n>0)||!(r>0)||!(a>0))return!1;let o=Math.tan(r/2*Math.PI/180);if(!(o>0))return!1;let i=e/(n*o)*(a/2);return Math.PI*i*i/t>=_a}import{Geometry as Ia,Mesh as Da,Program as Fa,Transform as ka}from"ogl";var La=.05,Va=.55,Oa=12,za=1.6,Na=1,Ha=2.5,Ga=650,De={height:6,baseRadius:.16,topRadius:.3,fadeInFromM:16,fullByM:40,nearStrength:.6};function Ba(t,e){if(e)return 0;let n=(t-De.fadeInFromM)/(De.fullByM-De.fadeInFromM);return Math.max(De.nearStrength,Math.min(1,n))}var Do=24;function Wa(t){let e=[],n=[],r=[],a=(h,u,m)=>{e.push(...h),n.push(...u),r.push(m)};for(let h=0;h<16;h++){let u=h/16*Math.PI*2,m=(h+1)/16*Math.PI*2,d=C=>[Math.cos(C),0,Math.sin(C)],y=[Math.cos(u)*.012,0,Math.sin(u)*.012],v=[Math.cos(m)*.012,0,Math.sin(m)*.012],w=[Math.cos(u)*.03,1,Math.sin(u)*.03],E=[Math.cos(m)*.03,1,Math.sin(m)*.03];a(y,d(u),0),a(w,d(u),0),a(E,d(m),0),a(y,d(u),0),a(E,d(m),0),a(v,d(m),0)}let l=.16,c=.24,f=.01;for(let h=0;h<48;h++){let u=h/48*Math.PI*2,m=(h+1)/48*Math.PI*2,d=[Math.cos(u)*l,f,Math.sin(u)*l],y=[Math.cos(u)*c,f,Math.sin(u)*c],v=[Math.cos(m)*c,f,Math.sin(m)*c],w=[Math.cos(m)*l,f,Math.sin(m)*l];for(let E of[d,y,v,d,v,w])a(E,[0,1,0],1)}for(let h=0;h<32;h++){let u=h/32*Math.PI*2,m=(h+1)/32*Math.PI*2,d=De.baseRadius,y=De.topRadius,v=[Math.cos(u)*d,0,Math.sin(u)*d],w=[Math.cos(m)*d,0,Math.sin(m)*d],E=[Math.cos(u)*y,1,Math.sin(u)*y],C=[Math.cos(m)*y,1,Math.sin(m)*y],D=[Math.cos(u),0,Math.sin(u)],A=[Math.cos(m),0,Math.sin(m)];a(v,D,2),a(E,D,2),a(C,A,2),a(v,D,2),a(C,A,2),a(w,A,2)}return new Ia(t,{position:{size:3,data:new Float32Array(e)},normal:{size:3,data:new Float32Array(n)},part:{size:1,data:new Float32Array(r)}})}var Ua=`#version 300 es
|
|
1
|
+
import{A as tt,B as Kt,C as uo,D as nt,E as Qt,F as mo,G as ho,a as Je,b as Ie,c as yt,d as jt,e as $n,f as Kn,g as Se,h as Qn,i as Zn,j as Jn,k as xt,l as ze,m as et,n as eo,o as $t,p as ua,q as to,r as no,s as oo,t as ro,u as Ae,v as ao,w as io,x as so,y as lo,z as co}from"../chunk-HSEX7LUB.js";import"../chunk-LFV56MPT.js";import"../chunk-2JFCDE27.js";import{d as gt}from"../chunk-YPVYZYMH.js";import"../chunk-WKWXU5QM.js";import"../chunk-T2QG47QQ.js";import"../chunk-GUXENCHS.js";import"../chunk-FBXZWNND.js";import"../chunk-UNSAUDO2.js";import"../chunk-4N5CHKHD.js";import{b as Xn,c as qt,d as qn,n as jn}from"../chunk-33SRM2CP.js";import"../chunk-M4NGX5NM.js";import"../chunk-JRZHC75P.js";import"../chunk-UEDS3HJ3.js";import"../chunk-UUIZHJYL.js";import{eb as Wn}from"../chunk-YE4NP3XB.js";import"../chunk-S3VH7IDA.js";import{d as Un,l as Yn}from"../chunk-JBOTRSMY.js";import"../chunk-CRCGO52K.js";function po(t,e,n){let r=Math.floor(e.length/3),a=n.center[0],o=n.center[2];if(r>0){let l=Math.max(1,Math.floor(r/4e3)),c=0,f=0,p=0;for(let u=0;u<r;u+=l)c+=e[u*3],f+=e[u*3+2],p++;a=c/p,o=f/p}let i=t[0]-a,s=t[2]-o;return Math.hypot(i,s)>n.radius*.12?Math.atan2(i,s):void 0}import{Mat4 as Ns}from"ogl";function fo(t,e,n="#ffffff"){let{iPosition:r,count:a}=e.seats;if(a<2||typeof document>"u")return null;let o=1/0,i=-1/0,s=1/0,l=-1/0;for(let A=0;A<a;A++){let R=r[A*3],L=r[A*3+2];R<o&&(o=R),R>i&&(i=R),L<s&&(s=L),L>l&&(l=L)}for(let A of e.stages)o=Math.min(o,A.cx-A.halfX),i=Math.max(i,A.cx+A.halfX),s=Math.min(s,A.cz-A.halfZ),l=Math.max(l,A.cz+A.halfZ);let c=Math.min(130/Math.max(.001,i-o),86/Math.max(.001,l-s)),f=(148-(i-o)*c)/2,p=(104-(l-s)*c)/2,u=A=>f+(A-o)*c,m=A=>p+(A-s)*c,d=Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),y=document.createElement("canvas");y.width=Math.round(148*d),y.height=Math.round(104*d),y.setAttribute("aria-hidden","true"),y.setAttribute("data-seat-locator","");let v=y.style;v.position="absolute",v.left="12px",v.bottom="12px",v.width="148px",v.height="104px",v.borderRadius="10px",v.background="rgba(10,14,22,.72)",v.border="1px solid rgba(255,255,255,.14)",v.boxShadow="0 4px 14px rgba(0,0,0,.35)",v.pointerEvents="none",v.zIndex="3",v.display="none",t.appendChild(y);let w=document.createElement("canvas");w.width=y.width,w.height=y.height;let E=w.getContext("2d");if(E){E.scale(d,d),E.fillStyle="rgba(214,222,234,.28)";let A=Math.max(1,Math.ceil(a/6e3));for(let R=0;R<a;R+=A)E.fillRect(u(r[R*3])-.6,m(r[R*3+2])-.6,1.2,1.2);E.fillStyle="rgba(236,240,246,.16)",E.strokeStyle="rgba(236,240,246,.55)",E.lineWidth=1;for(let R of e.stages){let L=u(R.cx-R.halfX),b=m(R.cz-R.halfZ),F=R.halfX*2*c,x=R.halfZ*2*c;E.fillRect(L,b,F,x),E.strokeRect(L+.5,b+.5,Math.max(0,F-1),Math.max(0,x-1))}}let C=y.getContext("2d"),D="";return{el:y,update(A,R){if(!A||!C||t.clientWidth>0&&t.clientWidth<560){v.display!=="none"&&(v.display="none"),D="";return}let L=u(A[0]),b=m(A[2]),F=R?Math.atan2(R[2],R[0]):0,x=`${L.toFixed(1)},${b.toFixed(1)},${F.toFixed(2)}`;if(x!==D){if(D=x,v.display="block",C.setTransform(1,0,0,1,0,0),C.clearRect(0,0,y.width,y.height),C.drawImage(w,0,0),C.setTransform(d,0,0,d,0,0),R){let I=C.createRadialGradient(L,b,0,L,b,26);I.addColorStop(0,"rgba(255,255,255,.55)"),I.addColorStop(1,"rgba(255,255,255,0)"),C.fillStyle=I,C.beginPath(),C.moveTo(L,b),C.arc(L,b,26,F-.5,F+.5),C.closePath(),C.fill()}C.fillStyle=n,C.strokeStyle="rgba(10,14,22,.9)",C.lineWidth=1.5,C.beginPath(),C.arc(L,b,3.6,0,Math.PI*2),C.fill(),C.stroke()}},dispose(){y.remove()}}}var Zt=78,vo=18;function bo(){let t=[],e=[],n=[],r=[],a=[],o=[{n:[1,0,0],c:[[1,0,0],[1,1,0],[1,1,1],[1,0,1]]},{n:[-1,0,0],c:[[0,0,1],[0,1,1],[0,1,0],[0,0,0]]},{n:[0,1,0],c:[[0,1,0],[0,1,1],[1,1,1],[1,1,0]]},{n:[0,-1,0],c:[[0,0,1],[0,0,0],[1,0,0],[1,0,1]]},{n:[0,0,1],c:[[0,0,1],[1,0,1],[1,1,1],[0,1,1]]},{n:[0,0,-1],c:[[1,0,0],[0,0,0],[0,1,0],[1,1,0]]}];for(let s of[{part:1,min:[-1,.36,-.95],max:[1,.45,1]},{part:2,min:[-1,Ie,-1],max:[1,yt,-.72]}])for(let l of o){let c=t.length/3,f=l.n[1]+(s.part===2?Math.abs(l.n[0])*(1-jt)/(yt-Ie):0),p=Math.hypot(l.n[0],f,l.n[2]),u=[l.n[0]/p,f/p,l.n[2]/p];for(let[m,d]of l.c.entries()){let y=d.map((v,w)=>s.min[w]+v*(s.max[w]-s.min[w]));s.part===2&&(y[0]*=1-d[1]*(1-jt)),t.push(...y),e.push(...u),n.push(s.part),r.push(...[[-1,-1],[1,-1],[1,1],[-1,1]][m])}a.push(c,c+1,c+2,c,c+2,c+3)}let i=t.length/3;for(let[s,l]of[[-1,-1],[1,-1],[1,1],[-1,1]])t.push(s,l,0),e.push(0,1,0),n.push(0),r.push(s,l);return a.push(i,i+1,i+2,i,i+2,i+3),a.push(...a.slice(12,18),...a.slice(60,66),...a.slice(72,78)),{position:new Float32Array(t),normal:new Float32Array(e),surface:new Float32Array(n),uv:new Float32Array(r),index:new Uint16Array(a)}}import{Renderer as da}from"ogl";function ma(){let t=typeof window<"u"&&window.devicePixelRatio||1,e=navigator.deviceMemory,n=typeof e=="number"&&e<=4?1.5:2;return Math.min(t,n)}var St=class{constructor(e,n){this.clearRgb=[0,0,0];this.container=e,this.canvas=document.createElement("canvas"),this.canvas.style.display="block",this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.touchAction="none",this.canvas.tabIndex=0,this.canvas.setAttribute("role","application"),this.canvas.setAttribute("aria-label","Interactive 3D venue. Drag or use arrow keys to look around; pinch, scroll, plus or minus to zoom."),this.renderer=new da({canvas:this.canvas,dpr:ma(),alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[xt.top[0],xt.top[1],xt.top[2]],this.gl.clearColor(this.clearRgb[0],this.clearRgb[1],this.clearRgb[2],1),e.appendChild(this.canvas),this.lostHandler=r=>{r.preventDefault(),n.onContextLost()},this.restoredHandler=()=>n.onContextRestored(),this.canvas.addEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.restoredHandler,!1),this.resize()}setClearColor(e){this.clearRgb=[e[0],e[1],e[2]],this.gl.clearColor(e[0],e[1],e[2],1)}get clearColor(){return this.clearRgb}resize(){let e=Math.max(1,this.container.clientWidth||this.canvas.clientWidth||1),n=Math.max(1,this.container.clientHeight||this.canvas.clientHeight||1);return this.renderer.setSize(e,n),{width:e,height:n}}get pixelHeight(){return this.renderer.height*this.renderer.dpr}get aspect(){return this.renderer.width/Math.max(1,this.renderer.height)}dispose(){this.canvas.removeEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.restoredHandler,!1);let e=this.gl.getExtension("WEBGL_lose_context");e&&e.loseContext(),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}simulateContextLossCycle(){let e=this.gl.getExtension("WEBGL_lose_context");e&&(e.loseContext(),setTimeout(()=>{e.restoreContext&&e.restoreContext()},300))}};import{Camera as ha,Vec3 as Jt}from"ogl";var de=Math.PI/180,en=15*de,tn=80*de,Ne=.12,go=35,nn=1.25,yo=.006,pa=4,He=.82,ot=1/He,fa=.12,va=2;function ba(t,e){return{azimuth:0-t*yo,polar:-e*yo}}function xo(t,e,n){let r=Math.max(va,Math.max(1,e)*fa),a=n*pa;return{minDist:t?Math.min(t.minDist,r):r,maxDist:t?Math.max(t.maxDist,a):a}}var ga=1.5;function ya(t,e,n){let r=Math.max(1,n)*ga;if(!t)return{anchor:[e[0],e[1],e[2]],limit:r};let[a,o,i]=t.anchor,s=e[1]-o,l=Math.max(Math.abs(e[0]-a),Math.abs(e[2]-i),s>=0?s:-s*2);return{anchor:t.anchor,limit:Math.max(t.limit,l+r)}}function xa(t,e,n,r,a,o,i,s){let l=Math.sin(n),c=[l*Math.sin(e),Math.cos(n),l*Math.cos(e)],f=[t[0]+r*c[0],t[1]+r*c[1],t[2]+r*c[2]],p=[-c[0],-c[1],-c[2]],u=[-p[2],0,p[0]],m=Math.hypot(u[0],u[2])||1;u=[u[0]/m,0,u[2]/m];let d=[u[1]*p[2]-u[2]*p[1],u[2]*p[0]-u[0]*p[2],u[0]*p[1]-u[1]*p[0]],y=Math.tan(a*de/2),v=y*(o>0?o:1),w=[0,1,2].map(D=>p[D]+i*v*u[D]+s*y*d[D]);if(w[1]>=-1e-6)return null;let E=(t[1]-f[1])/w[1],C=Math.hypot(w[0],w[1],w[2]);return!(E>0)||E*C>r*Sa?null:[f[0]+w[0]*E,t[1],f[2]+w[2]*E]}var So=3,Sa=4,wo=.72,wa=.6;function Ma(t,e,n){return t!=="auto"?t:n!==null&&e<n*wa?"pan":"orbit"}function Mo(t,e){let n=Math.sin(e),r=-n*Math.sin(t),a=-Math.cos(e),o=-n*Math.cos(t);if(Math.abs(a)>.999)return null;let i=-o,s=r,l=Math.hypot(i,s);return i/=l,s/=l,{fx:r,fy:a,fz:o,rx:i,rz:s,ux:-s*a,uy:s*r-i*o,uz:i*a}}var Aa=.4;function Pa(t,e,n,r,a,o){let i=[t.center[0],t.center[1],t.center[2]],s=o(i),l=t.fitPoints,c=Mo(r,a);if(!l||l.length<9||!c)return{center:i,distance:s};let{fx:f,fy:p,fz:u,rx:m,rz:d,ux:y,uy:v,uz:w}=c,E=Math.hypot(f,u),C=f/E,D=u/E,A=C*y+D*w,R=Aa*Math.max(1,t.radius);for(let L=0;L<3;L++){let b=1/0,F=-1/0,x=1/0,I=-1/0;for(let W=0;W+2<l.length;W+=3){let N=l[W]-i[0],te=l[W+1]-i[1],X=l[W+2]-i[2],J=s+N*f+te*p+X*u;if(!(J>.001))continue;let M=(N*m+X*d)/(J*e),P=(N*y+te*v+X*w)/(J*n);M<b&&(b=M),M>F&&(F=M),P<x&&(x=P),P>I&&(I=P)}if(!Number.isFinite(b))break;let z=(b+F)/2*s*e,_=Math.abs(A)>.1?(x+I)/2*s*n/A:0,O=z*m+_*C,G=z*d+_*D;if(Math.hypot(i[0]+O-t.center[0],i[2]+G-t.center[2])>R){let W=i[0]-t.center[0],N=i[2]-t.center[2],te=W+O,X=N+G,J=R/Math.hypot(te,X);O=te*J-W,G=X*J-N}i=[i[0]+O,i[1],i[2]+G],s=o(i)}return{center:i,distance:s}}var wt=class{constructor(e,n,r,a){this.fovY=go;this.target=new Jt;this.azimuth=-30*de;this.polar=55*de;this.distance=10;this.azT=-30*de;this.polT=55*de;this.distT=10;this.minDist=1;this.maxDist=100;this.envelope=null;this.gestureFired=!1;this.interactionEnabled=!0;this.dragging=!1;this.panning=!1;this.lastX=0;this.lastY=0;this.activePointers=new Map;this.pinchDist=0;this.pinchCx=0;this.pinchCy=0;this.targetT=new Jt;this.panAnchor=new Jt;this.panLimit=0;this.panBox=null;this.zoomPointResolver=null;this.primaryDragMode="auto";this.overviewDist=null;this.pinchAngle=0;this.camera=new ha(e,{fov:go,near:.1,far:5e3,aspect:1}),this.canvas=n,this.requestRender=r,this.onGesture=a,this.onPointerDown=o=>{if(this.interactionEnabled){try{this.canvas.setPointerCapture?.(o.pointerId)}catch{}if(this.activePointers.set(o.pointerId,{x:o.clientX,y:o.clientY}),this.activePointers.size===1){let i=this.dragAction(),s=i==="orbit"?"pan":"orbit",l=o.button===2||o.button===1||o.shiftKey?s:i;this.panning=l==="pan",this.dragging=!this.panning,this.lastX=o.clientX,this.lastY=o.clientY}else if(this.activePointers.size===2){this.dragging=!1,this.panning=!1,this.pinchDist=this.currentPinchDistance(),this.pinchAngle=this.currentPinchAngle();let i=this.pinchCentroid();this.pinchCx=i.x,this.pinchCy=i.y}}},this.onPointerMove=o=>{if(!this.interactionEnabled||!this.activePointers.has(o.pointerId))return;if(this.activePointers.set(o.pointerId,{x:o.clientX,y:o.clientY}),this.activePointers.size>=2){let c=this.currentPinchDistance(),f=this.pinchCentroid();this.pinchDist>0&&(this.dollyAt(Math.exp((this.pinchDist-c)*.005),f.x,f.y),this.fireGesture()),this.pinchDist=c;let p=this.currentPinchAngle(),u=p-this.pinchAngle;u>Math.PI&&(u-=2*Math.PI),u<-Math.PI&&(u+=2*Math.PI),this.pinchAngle=p,Math.abs(u)>1e-4&&Math.abs(u)<.5&&(this.azT+=u,this.fireGesture()),this.panBy(f.x-this.pinchCx,f.y-this.pinchCy),this.pinchCx=f.x,this.pinchCy=f.y;return}let i=o.clientX-this.lastX,s=o.clientY-this.lastY;if(this.panning){this.lastX=o.clientX,this.lastY=o.clientY,(i!==0||s!==0)&&(this.panBy(i,s),this.fireGesture());return}if(!this.dragging)return;this.lastX=o.clientX,this.lastY=o.clientY,(i!==0||s!==0)&&this.fireGesture();let l=ba(i,s);this.azT+=l.azimuth,this.polT=Math.max(en,Math.min(tn,this.polT+l.polar)),this.requestRender()},this.onPointerUp=o=>{this.activePointers.delete(o.pointerId);try{this.canvas.releasePointerCapture?.(o.pointerId)}catch{}this.activePointers.size<2&&(this.pinchDist=0),this.activePointers.size===0&&(this.dragging=!1,this.panning=!1)},this.onContextMenu=o=>{o.preventDefault()},this.onWheel=o=>{if(o.preventDefault(),!this.interactionEnabled)return;let i=o.deltaMode===1?16:o.deltaMode===2?100:1,s=Math.max(-2,Math.min(2,o.deltaY*i/100));this.dollyAt(Math.exp(s*.22),o.clientX,o.clientY),this.fireGesture()},this.onKeyDown=o=>{if(!this.interactionEnabled)return;let i=7*de;if(o.shiftKey&&(o.key==="ArrowLeft"||o.key==="ArrowRight"||o.key==="ArrowUp"||o.key==="ArrowDown"))this.panBy(o.key==="ArrowLeft"?-32:o.key==="ArrowRight"?32:0,o.key==="ArrowUp"?-32:o.key==="ArrowDown"?32:0);else if(o.key==="ArrowLeft"||o.key==="ArrowRight")this.azT+=o.key==="ArrowLeft"?i:-i;else if(o.key==="ArrowUp"||o.key==="ArrowDown")this.polT=Math.max(en,Math.min(tn,this.polT+(o.key==="ArrowUp"?-i:i)));else if(o.key==="+"||o.key==="=")this.dollyBy(He);else if(o.key==="-"||o.key==="_")this.dollyBy(ot);else return;o.preventDefault(),this.fireGesture(),this.requestRender()},n.addEventListener("pointerdown",this.onPointerDown),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerup",this.onPointerUp),n.addEventListener("pointercancel",this.onPointerUp),n.addEventListener("wheel",this.onWheel,{passive:!1}),n.addEventListener("keydown",this.onKeyDown),n.addEventListener("contextmenu",this.onContextMenu)}pinchCentroid(){let e=[...this.activePointers.values()];if(!e.length)return{x:0,y:0};let n=0,r=0;for(let a of e)n+=a.x,r+=a.y;return{x:n/e.length,y:r/e.length}}panBy(e,n){let r=this.canvas.clientHeight||1,a=2*this.distance*Math.tan(this.fovY*de/2)/r,o=Math.sin(this.azimuth),i=Math.cos(this.azimuth),s=i,l=-o,c=Math.cos(this.polar),f=Math.sin(this.polar),p=-o*c,u=-i*c;this.targetT.x+=(-e*s+n*p)*a,this.targetT.z+=(-e*l+n*u)*a,this.targetT.y+=n*f*a,this.clampPan(),this.requestRender()}widenPanBox(e){this.panBox=ya(this.panBox,e.center,e.radius),this.panAnchor.set(this.panBox.anchor[0],this.panBox.anchor[1],this.panBox.anchor[2]),this.panLimit=this.panBox.limit}clampPan(){if(this.panLimit<=0)return;let e=this.panLimit,n=this.panAnchor.x,r=this.panAnchor.y,a=this.panAnchor.z;this.targetT.x=Math.max(n-e,Math.min(n+e,this.targetT.x)),this.targetT.z=Math.max(a-e,Math.min(a+e,this.targetT.z)),this.targetT.y=Math.max(r-e*.5,Math.min(r+e,this.targetT.y))}fireGesture(){this.gestureFired||(this.gestureFired=!0,this.onGesture?.())}currentPinchAngle(){let[e,n]=[...this.activePointers.values()];return e&&n?Math.atan2(n.y-e.y,n.x-e.x):0}dragAction(){return Ma(this.primaryDragMode,this.distT,this.overviewDist)}currentPinchDistance(){let e=[...this.activePointers.values()];return e.length<2?0:Math.hypot(e[0].x-e[1].x,e[0].y-e[1].y)}dollyBy(e){this.distT=Math.max(this.minDist,Math.min(this.maxDist,this.distT*e)),this.requestRender()}dollyAt(e,n,r){let a=this.distT,o=this.canvas.getBoundingClientRect?.(),i=this.zoomPointResolver?.(n,r)??null;if(i){this.distT=Math.max(So,Math.min(this.maxDist,this.distT*e)),this.minDist=Math.min(this.minDist,Math.max(So,this.distT)),this.requestRender(),this.scaleTargetAbout(i,this.distT/a);return}let s=o&&o.width>0&&o.height>0?xa([this.targetT.x,this.targetT.y,this.targetT.z],this.azT,this.polT,this.distT,this.fovY,this.camera.aspect||o.width/o.height,(n-o.left)/o.width*2-1,1-(r-o.top)/o.height*2):null;this.dollyBy(e),s&&this.scaleTargetAbout(s,this.distT/a)}scaleTargetAbout(e,n){!Number.isFinite(n)||n===1||(this.targetT.x=e[0]+(this.targetT.x-e[0])*n,this.targetT.y=e[1]+(this.targetT.y-e[1])*n,this.targetT.z=e[2]+(this.targetT.z-e[2])*n,this.clampPan())}setZoomPointResolver(e){this.zoomPointResolver=e}zoomBy(e){this.interactionEnabled&&(this.dollyBy(e),this.fireGesture())}dollyLimitState(){return{atMin:this.distT<=this.minDist+1e-6,atMax:this.distT>=this.maxDist-1e-6}}setPrimaryDragMode(e){this.primaryDragMode=e}setInteractionEnabled(e){this.interactionEnabled=e,!e&&(this.activePointers.clear(),this.dragging=!1,this.panning=!1,this.pinchDist=0)}frame(e,n=!1,r,a=!1,o){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.widenPanBox(e);let i=Math.max(1,e.radius),s=this.fovY*de/2,l=a?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,c=Math.atan(Math.tan(s)*l);this.azT=r??-30*de,this.polT=Math.max(15,Math.min(80,o?.polarDeg??55))*de;let f=this.framedOn(e,s,c),p=f.distance;this.target.set(f.center[0],f.center[1],f.center[2]),this.targetT.copy(this.target),this.distT=p*Math.max(1.05,Math.min(2,o?.margin??nn)),this.envelope=xo(this.envelope,i,p),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.overviewDist===null&&(this.overviewDist=this.distT),n?(this.azimuth=this.azT,this.polar=12*de,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(e){if(!(e>0)||!Number.isFinite(e))return;let n=this.camera.aspect;if(this.interactionEnabled&&n>0){let r=Math.min(n,1)/Math.min(e,1);this.distance*=r,this.distT*=r,this.overviewDist!==null&&(this.overviewDist*=r),this.maxDist=Math.max(this.maxDist,this.distance,this.distT),this.applyPosition()}this.camera.perspective({aspect:e})}glideTo(e,n){this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.widenPanBox(e),this.targetT.set(e.center[0],e.center[1],e.center[2]);let r=this.fovY*de/2,a=Math.atan(Math.tan(r)*(this.camera.aspect||1));this.azT=this.azimuth,this.polT=Math.max(15,Math.min(80,n?.polarDeg??55))*de;let o=this.framedOn(e,r,a),i=o.distance;this.targetT.set(o.center[0],o.center[1],o.center[2]),this.distT=i*Math.max(1.05,Math.min(2,n?.margin??nn)),this.envelope=xo(this.envelope,Math.max(1,e.radius),i),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.requestRender()}frameSoft(e,n,r=!1,a){this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.widenPanBox(e),this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect});let o=this.fovY*de/2,i=r?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,s=Math.atan(Math.tan(o)*i);this.azT=n??this.azimuth,this.polT=Math.max(15,Math.min(80,a?.polarDeg??55))*de;let l=this.framedOn(e,o,s);this.targetT.set(l.center[0],l.center[1],l.center[2]),this.distT=l.distance*Math.max(1.05,Math.min(2,a?.margin??nn))}framedOn(e,n,r){return Pa(e,Math.tan(r),Math.tan(n),this.azT,this.polT,a=>this.fitDistance({...e,center:a},n,r,this.azT,this.polT))}fitDistance(e,n,r,a,o){let i=Math.max(1,e.radius),s=Math.max(i/Math.tan(n),i/Math.tan(r)),l=e.box;if(!l)return s;let c=Mo(a,o);if(!c)return s;let{fx:f,fy:p,fz:u,rx:m,rz:d,ux:y,uy:v,uz:w}=c,E=Math.tan(r),C=Math.tan(n),D=1;for(let x=0;x<8;x++){let I=(x&1?l.max[0]:l.min[0])-e.center[0],z=(x&2?l.max[1]:l.min[1])-e.center[1],_=(x&4?l.max[2]:l.min[2])-e.center[2],O=I*f+z*p+_*u,G=Math.abs(I*m+_*d),B=Math.abs(I*y+z*v+_*w);D=Math.max(D,G/E-O,B/C-O)}let A=Math.min(s,Math.max(D,i*.35)),R=e.fitPoints;if(!R||R.length<9)return A;let L=0,b=1/(E*wo),F=1/(C*wo);for(let x=0;x+2<R.length;x+=3){let I=R[x]-e.center[0],z=R[x+1]-e.center[1],_=R[x+2]-e.center[2],O=I*f+z*p+_*u,G=Math.abs(I*m+_*d),B=Math.abs(I*y+z*v+_*w);L=Math.max(L,G*b-O,B*F-O)}return Math.min(A*1.5,Math.max(A*.55,L))}updateClipping(e){let n=this.camera.position.x-e.center[0],r=this.camera.position.y-e.center[1],a=this.camera.position.z-e.center[2],o=Math.hypot(this.camera.position.x-this.target.x,this.camera.position.y-this.target.y,this.camera.position.z-this.target.z),i=this.interactionEnabled&&Math.abs(o-this.distance)<=this.distance*.01,{near:s,far:l}=Ta(Math.hypot(n,r,a),e.radius,i?this.distance:null);this.camera.perspective({near:s,far:l,aspect:this.camera.aspect})}update(){let e=this.azT-this.azimuth,n=this.polT-this.polar,r=this.distT-this.distance,a=this.targetT.x-this.target.x,o=this.targetT.y-this.target.y,i=this.targetT.z-this.target.z,s=Math.max(1e-4,this.distance*1e-4),l=Math.abs(e)>1e-4||Math.abs(n)>1e-4||Math.abs(r)>1e-4||Math.abs(a)>s||Math.abs(o)>s||Math.abs(i)>s;return this.azimuth+=e*Ne,this.polar+=n*Ne,this.distance+=r*Ne,this.target.x+=a*Ne,this.target.y+=o*Ne,this.target.z+=i*Ne,l&&this.applyPosition(),l}get currentAzimuth(){return this.azimuth}get currentDistance(){return this.distance}get targetDistance(){return this.distT}syncFromCamera(){let e=this.camera.position.x-this.target.x,n=this.camera.position.y-this.target.y,r=this.camera.position.z-this.target.z,a=Math.hypot(e,n,r)||1,o=Math.max(en,Math.min(tn,Math.acos(Math.max(-1,Math.min(1,n/a)))));this.distance=this.distT=a,this.polar=this.polT=o,this.azimuth=this.azT=Math.atan2(e,r)}snapshot(){let e=this.target.clone(),n=this.targetT.clone(),{azimuth:r,azT:a,polar:o,polT:i,distance:s,distT:l}=this,c=this.camera.position.clone(),f=[...this.camera.quaternion],p=this.camera.fov;return()=>{this.target.copy(e),this.targetT.copy(n),Object.assign(this,{azimuth:r,azT:a,polar:o,polT:i,distance:s,distT:l}),this.camera.position.copy(c),this.camera.quaternion.set(f[0],f[1],f[2],f[3]),this.camera.perspective({fov:p,aspect:this.camera.aspect}),this.camera.updateMatrixWorld()}}setTarget(e){this.target.set(e[0],e[1],e[2]),this.targetT.copy(this.target)}resumeAfterFlight(e){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),e&&this.target.set(e[0],e[1],e[2]),this.targetT.copy(this.target),this.syncFromCamera()}applyPosition(){let e=Math.sin(this.polar),n=this.target.x+this.distance*e*Math.sin(this.azimuth),r=this.target.y+this.distance*Math.cos(this.polar),a=this.target.z+this.distance*e*Math.cos(this.azimuth);this.camera.position.set(n,r,a),this.camera.lookAt(this.target)}dispose(){this.canvas.removeEventListener("pointerdown",this.onPointerDown),this.canvas.removeEventListener("pointermove",this.onPointerMove),this.canvas.removeEventListener("pointerup",this.onPointerUp),this.canvas.removeEventListener("pointercancel",this.onPointerUp),this.canvas.removeEventListener("wheel",this.onWheel),this.canvas.removeEventListener("keydown",this.onKeyDown),this.canvas.removeEventListener("contextmenu",this.onContextMenu),this.activePointers.clear()}},Ca=.1,Ea=.25;function Ta(t,e,n){let r=Math.max(1,e)*1.18,a=n==null?Ea:Math.max(.05,n*Ca),o=Math.max(a,t-r),i=Math.max(o+10,t+r);return{near:o,far:i}}var Mt=class{constructor(e){this.rafId=0;this.running=!1;this.lastTime=0;this.fpsEma=0;this.rendered=0;this.tick=e=>{let n=this.lastTime?(e-this.lastTime)/1e3:.016666666666666666;if(this.lastTime=e,n>0){let a=1/n;this.fpsEma=this.fpsEma?this.fpsEma*.9+a*.1:a}this.rendered++,this.frame(n)?this.rafId=requestAnimationFrame(this.tick):(this.running=!1,this.rafId=0)};this.frame=e}requestRender(){this.running||(this.running=!0,this.lastTime=0,this.rafId=requestAnimationFrame(this.tick))}stats(){return{fps:this.running?Math.round(this.fpsEma):0,rendered:this.rendered,idle:!this.running}}stop(){this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=0,this.running=!1}};function Ao(t){let e=!1;return n=>{n!==e&&(e=n,n?t.dataset.slReady="1":delete t.dataset.slReady)}}var Ge=2.5,Ra=1.15,rt=12,Be=22,Po=6,Co=9.5,Eo=.9,To=2.2,on=30,rn=4,At=8192;var rl=Be+rn;function Ro(t,e){let n=e*1.4,r=e*3.2;if(t<=n)return{scale:1,fade:0,minPixels:Ge};let a=Math.min(1,(t-n)/Math.max(.001,r-n));return{scale:1-a*.4,fade:a*.55,minPixels:Ge+a*(Ra-Ge)}}function _o(t,e,n){return!(t>0)||!(e>0)||!(n>0)?!1:e*n/t>=64}var _a=12;function Io(t,e,n,r,a){if(!(t>0)||!(e>0)||!(n>0)||!(r>0)||!(a>0))return!1;let o=Math.tan(r/2*Math.PI/180);if(!(o>0))return!1;let i=e/(n*o)*(a/2);return Math.PI*i*i/t>=_a}import{Geometry as Ia,Mesh as Da,Program as Fa,Transform as ka}from"ogl";var La=.05,Va=.55,Oa=12,za=1.6,Na=1,Ha=2.5,Ga=650,De={height:6,baseRadius:.16,topRadius:.3,fadeInFromM:16,fullByM:40,nearStrength:.6};function Ba(t,e){if(e)return 0;let n=(t-De.fadeInFromM)/(De.fullByM-De.fadeInFromM);return Math.max(De.nearStrength,Math.min(1,n))}var Do=24;function Wa(t){let e=[],n=[],r=[],a=(p,u,m)=>{e.push(...p),n.push(...u),r.push(m)};for(let p=0;p<16;p++){let u=p/16*Math.PI*2,m=(p+1)/16*Math.PI*2,d=C=>[Math.cos(C),0,Math.sin(C)],y=[Math.cos(u)*.012,0,Math.sin(u)*.012],v=[Math.cos(m)*.012,0,Math.sin(m)*.012],w=[Math.cos(u)*.03,1,Math.sin(u)*.03],E=[Math.cos(m)*.03,1,Math.sin(m)*.03];a(y,d(u),0),a(w,d(u),0),a(E,d(m),0),a(y,d(u),0),a(E,d(m),0),a(v,d(m),0)}let l=.16,c=.24,f=.01;for(let p=0;p<48;p++){let u=p/48*Math.PI*2,m=(p+1)/48*Math.PI*2,d=[Math.cos(u)*l,f,Math.sin(u)*l],y=[Math.cos(u)*c,f,Math.sin(u)*c],v=[Math.cos(m)*c,f,Math.sin(m)*c],w=[Math.cos(m)*l,f,Math.sin(m)*l];for(let E of[d,y,v,d,v,w])a(E,[0,1,0],1)}for(let p=0;p<32;p++){let u=p/32*Math.PI*2,m=(p+1)/32*Math.PI*2,d=De.baseRadius,y=De.topRadius,v=[Math.cos(u)*d,0,Math.sin(u)*d],w=[Math.cos(m)*d,0,Math.sin(m)*d],E=[Math.cos(u)*y,1,Math.sin(u)*y],C=[Math.cos(m)*y,1,Math.sin(m)*y],D=[Math.cos(u),0,Math.sin(u)],A=[Math.cos(m),0,Math.sin(m)];a(v,D,2),a(E,D,2),a(C,A,2),a(v,D,2),a(C,A,2),a(w,A,2)}return new Ia(t,{position:{size:3,data:new Float32Array(e)},normal:{size:3,data:new Float32Array(n)},part:{size:1,data:new Float32Array(r)}})}var Ua=`#version 300 es
|
|
2
2
|
precision highp float;
|
|
3
3
|
in vec3 position; in vec3 normal; in float part;
|
|
4
4
|
uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform mat3 normalMatrix;
|
|
@@ -43,7 +43,7 @@ void main() {
|
|
|
43
43
|
float key = max(dot(normalize(vNormal), normalize(vec3(-0.4, 0.7, 0.6))), 0.0);
|
|
44
44
|
vec3 c = uColor * (0.55 + 0.5 * key) + vec3(0.12) * pow(key, 12.0);
|
|
45
45
|
fragColor = vec4(c, 1.0);
|
|
46
|
-
}`;function Xa(t){if(t>=1)return 1;if(t<.72){let n=t/.72;return 1-(1-n)*(1-n)}let e=(t-.72)/.28;return 1-.08*Math.sin(e*Math.PI)}function an(t){return Math.max(Va,Math.min(Oa,t*La))}function qa(t){let e=.2126*t[0]+.7152*t[1]+.0722*t[2],n=e>=.25?0:Math.min(.45,(.25-e)*2.2);return t.map(r=>r+(1-r)*n)}function Fo(t,e,n=[.24,.74,1]){let r=qa(n),a=new ka,o=Wa(t),i=new Map,s=(l,c)=>{let f=new Fa(t,{vertex:Ua,fragment:Ya,uniforms:{uSeat:{value:l},uHeight:{value:1},uLift:{value:0},uRingScale:{value:1},uBeamHeight:{value:De.height},uBeam:{value:0},uBeamColor:{value:r},uColor:{value:e},uRingAlpha:{value:.85}},transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1}),h=new Da(t,{geometry:o,program:f});return h.frustumCulled=!1,h.setParent(a),{mesh:h,program:f,seat:l,start:c}};return{root:a,setSeats(l,c,f){let h=new Set(l.slice(0,Do).map(u=>u.id));for(let[u,m]of i)h.has(u)||(m.mesh.setParent(null),i.delete(u));for(let u of l.slice(0,Do))i.has(u.id)||i.set(u.id,s(u.position,f?c:-1/0))},update(l,c,f,h=!1){let u=!1;for(let m of i.values()){let d=c[0]-m.seat[0],y=c[1]-m.seat[1],v=c[2]-m.seat[2],w=Math.hypot(d,y,v);m.mesh.visible=!f&&w>(h?Na:Ha);let E=an(w),C=Math.max(0,Math.min(1,(l-m.start)/Ga));C<1&&(u=!0),m.program.uniforms.uHeight.value=E,m.program.uniforms.uRingScale.value=Math.min(E,za),m.program.uniforms.uLift.value=h?1:1-Xa(C),m.program.uniforms.uBeam.value=Ba(w,h),m.program.uniforms.uRingAlpha.value=.55+.4*(C<1?Math.sin(C*Math.PI):0)}return u},dispose(){for(let l of i.values())l.mesh.setParent(null);i.clear(),o.remove()}}}var at="#ffffff",ko="#0b1220",it=6,ja=80,Lo=14,Vo=88,Oo=20,zo={floor:{size:14,weight:"700",opacity:.98},stage:{size:14,weight:"700",opacity:.98},zone:{size:15,weight:"600",opacity:.95},section:{size:12,weight:"500",opacity:.88},ga:{size:12,weight:"500",opacity:.88},gate:{size:12,weight:"700",opacity:.98},booth:{size:11,weight:"500",opacity:.85},annotation:{size:11,weight:"400",opacity:.75},row:{size:11.5,weight:"700",opacity:.94},seat:{size:12.5,weight:"800",opacity:1},access:{size:12,weight:"700",opacity:1}},$a=640,Ka=.8,Qa=11,Za="3px 7px",Ja="2px 5px",No="rgba(10,14,22,.62)",ei="#f4f7fb",Ho=5,Go=2,ti=6,st=new Set(["row","seat","access"]),sn={stage:6,gate:5,floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},We={row:{x:66,y:20},seat:{x:52,y:22}},Fe=Un,ln=t=>Yn(t);function ke(t,e){let n=ln(t),r=ln(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function ni(t){let e=Fe(t);if(!e)return null;let n=o=>`#${o.map(i=>Math.round(Math.max(0,Math.min(1,i))*255).toString(16).padStart(2,"0")).join("")}`,r=e.map(o=>o+(1-o)*.78),a=e.map(o=>o*.62);for(let o=0;o<12&&ke(a,r)<4.5;o++)a=a.map(i=>i*.8);return{fill:n(r),ink:n(a),border:n(e.map(o=>o+(1-o)*.35)),contrast:ke(a,r)}}var oi=30;function cn(t,e){let n=/rgba\((\d+),(\d+),(\d+),([\d.]+)\)/.exec(t.replace(/\s/g,""));if(!n)return e;let r=Math.max(0,Math.min(1,Number(n[4])));return[1,2,3].map(a=>Number(n[a])/255*r+e[a-1]*(1-r))}function ri(t,e=[.04,.06,.1],n=!0){let r=ln(e)<.42,a=r?"#f4f7fb":"#0b1220",o=r?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",i=n?cn(o,e):e,s=Fe(t),l=n?7:4.5,c=s&&ke(s,i)>=l?t:a;return r?{ink:c,backing:o,border:"rgba(210,222,245,.24)"}:{ink:c,backing:o,border:"rgba(11,18,32,.22)"}}function ai(t,e=[.04,.06,.1]){let n=cn(No,e),r=Fe(t);return{ink:r&&ke(r,n)>=4.5?t:ei,backing:No}}var ii=.8,Ue=20,si=14,li=60,ci='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Pt=class{constructor(e,n={}){this.nodes=new Map;this.labels=[];this.wheelchairFree=new Map;this.nodeAppearance=new WeakMap;this.forcedDense=!1;this.overviewDistance=null;this.selectedSeatLabelIds=new Set;this.narrowStage=!1;this.seatNumberRow=void 0;this.seatNumberSeat=null;this.pinHeads=[];this.opts=n,this.root=document.createElement("div"),this.root.setAttribute("data-view3d-labels","");let r=this.root.style;r.position="absolute",r.inset="0",r.pointerEvents="none",r.overflow="hidden",r.fontFamily=n.fontFamily||ci,e.appendChild(this.root)}setVisible(e){this.root.style.visibility=e?"":"hidden"}setLabels(e){this.labels=e;let n=new Set(e.map(r=>r.id));for(let[r,a]of this.nodes)n.has(r)||(a.remove(),this.nodes.delete(r))}setForcedDense(e){this.forcedDense=e}setOverviewDistance(e){this.overviewDistance=e>0?e:null}setSeatNumberRow(e){return e===this.seatNumberRow?!1:(this.seatNumberRow=e,!0)}setSeatNumberSeat(e){let n=e?`seat:${e}`:null;return n===this.seatNumberSeat?!1:(this.seatNumberSeat=n,!0)}setWheelchairFree(e){let n=e.size!==this.wheelchairFree.size;if(!n){for(let[r,a]of e)if(this.wheelchairFree.get(r)!==a){n=!0;break}}return n&&(this.wheelchairFree=new Map(e)),n}setSelectedSeatIds(e){this.selectedSeatLabelIds=new Set(Array.from(e,n=>`seat:${n}`))}sizeFor(e){let n=zo[e].size;return!this.narrowStage||st.has(e)?n:Math.max(Qa,n*Ka)}qualityEvidence(){let e=this.root.getBoundingClientRect(),n=this.root.style.visibility!=="hidden";return this.labels.map(r=>{let a=this.nodes.get(r.id),o=a?.getBoundingClientRect(),i=!!(n&&a&&a.style.display!=="none"&&o&&o.width>0&&o.height>0);return{id:r.id,kind:r.kind,text:r.text,visible:i,renderedFontPx:a&&Number.parseFloat(a.style.fontSize)||0,contrast:a?Number(a.dataset.qualityContrast??0):0,...i&&o?{screenBox:{x:o.x-e.x,y:o.y-e.y,width:o.width,height:o.height}}:{}}})}update(e,n,r,a,o,i){if(!this.labels.length)return;this.narrowStage=n>0&&n<$a;let s=oo(a,o,{hasZoneLabels:this.labels.some(b=>b.kind==="zone")});this.forcedDense&&(s.add("row"),s.add("seat"),s.add("access")),!this.forcedDense&&this.overviewDistance!==null&&a>this.overviewDistance*ii&&(s.delete("section"),s.delete("ga")),s.has("section")&&this.labels.some(b=>b.kind==="section")&&s.delete("zone");let l=[];for(let b of this.labels){let F=b.kind==="annotation"&&!!b.venueIcon;if(!s.has(b.kind)&&!F&&!(b.kind==="seat"&&this.selectedSeatLabelIds.has(b.id)))continue;let x=b.kind==="seat"&&i&&this.selectedSeatLabelIds.has(b.id)?b.pinBase:void 0,I=x&&i?[x[0],x[1]+an(Math.hypot(x[0]-i[0],x[1]-i[1],x[2]-i[2])),x[2]]:b.anchor,z=Ae(e,I,n,r);if(!z.visible)continue;let _=st.has(b.kind),O=this.sizeFor(b.kind),G=b.kind==="access"?Ue:so(b.text,O,!_)+(_?Ho*2:0)+((this.wheelchairFree.get(b.id)??0)>0?oi:0);if(b.kind==="access"&&b.seatWidthM!==void 0&&Kt(e,b.anchor,b.seatWidthM,n)<si||b.kind==="seat"&&b.seatWidthM!==void 0&&!this.selectedSeatLabelIds.has(b.id)&&Kt(e,b.anchor,b.seatWidthM,n)<Math.max(22,G))continue;let B=ro(z,G/2,O/2+(_?Go:4),n,r),W=i?Math.hypot(b.anchor[0]-i[0],b.anchor[1]-i[1],b.anchor[2]-i[2]):1;l.push({label:b,screen:B,focus:co(B,W,n,r),halfWidth:G/2,...this.selectedSeatLabelIds.has(b.id)?{priority:1}:{}})}let c=no(l.filter(b=>b.label.kind==="floor"),n),f=[...l.filter(b=>!st.has(b.label.kind)&&b.label.kind!=="floor"),...c],h=lo(n),u=l.filter(b=>b.label.kind==="seat"&&this.selectedSeatLabelIds.has(b.label.id)),m=tt(u,We.seat.x,We.seat.y,h.seat);this.placePinHeads(u.filter(b=>b.label.pinBase&&!m.includes(b)).map(b=>b.screen));let d=ao(f,Vo,Oo,b=>sn[b.label.kind]??0).filter(b=>!m.some(F=>io(b,F,Vo,Oo))),y=tt(l.filter(b=>b.label.kind==="access"),Ue,Ue,li,[...d,...m]),v=tt(l.filter(b=>b.label.kind==="row"),We.row.x,We.row.y,h.row,[...d,...m,...y]),w=this.seatNumberRow!==void 0||this.seatNumberSeat!==null,E=tt(l.filter(b=>b.label.kind==="seat"&&!this.selectedSeatLabelIds.has(b.label.id)&&(this.seatNumberSeat!==null?b.label.id===this.seatNumberSeat:!w||this.seatNumberRow!==null&&b.label.rowId===this.seatNumberRow)),We.seat.x,We.seat.y,w?ja:h.seat-m.length,[...d,...m,...y,...v]),C=[...d,...y,...v,...m,...E],D=new Set(C.map(b=>b.label.id));for(let{label:b,screen:F}of C){let I=this.nodeFor(b).style;I.display=b.kind==="access"?"flex":b.kind==="gate"?"inline-flex":"";let z=!!b.pinBase&&this.selectedSeatLabelIds.has(b.id);I.transform=z?`translate(-50%, -100%) translate(${F.x.toFixed(1)}px, ${(F.y-it).toFixed(1)}px)`:`translate(-50%, -50%) translate(${F.x.toFixed(1)}px, ${F.y.toFixed(1)}px)`}let R=C.filter(({label:b})=>!st.has(b.kind)).sort((b,F)=>sn[F.label.kind]-sn[b.label.kind]||b.screen.depth-F.screen.depth||b.focus-F.focus).flatMap(({label:b})=>{let F=this.nodes.get(b.id);return F&&F.style.display!=="none"?[{node:F,box:F.getBoundingClientRect()}]:[]}),L=[];for(let{node:b,box:F}of R)L.some(I=>F.left<I.right+3&&F.right+3>I.left&&F.top<I.bottom+3&&F.bottom+3>I.top)?b.style.display="none":L.push(F);for(let[b,F]of this.nodes)D.has(b)||(F.style.display="none")}nodeFor(e){let n=this.nodes.get(e.id);if(!n){n=document.createElement("div");let w=n.style;w.position="absolute",w.left="0",w.top="0",w.whiteSpace="nowrap",w.display="none",this.root.appendChild(n),this.nodes.set(e.id,n)}let r=this.selectedSeatLabelIds.has(e.id),a=this.nodeAppearance.get(n),o=this.wheelchairFree.get(e.id)??0,i=e.text+(e.icon??"")+(e.venueIcon??"")+(e.tint??"")+(o>0?`|${o}`:"");if(a&&a.text===i&&a.kind===e.kind&&a.color===e.color&&a.selected===r&&a.narrow===this.narrowStage)return n;if(this.nodeAppearance.set(n,{text:i,kind:e.kind,color:e.color,selected:r,narrow:this.narrowStage}),e.kind==="access")return this.paintAccessChip(n,e);if(n.textContent=e.text,r){let w=document.createElement("span"),E=w.style;E.position="absolute",E.left="50%",E.bottom=`-${it}px`,E.transform="translateX(-50%)",E.borderLeft=`${it}px solid transparent`,E.borderRight=`${it}px solid transparent`,E.borderTop=`${it}px solid ${at}`,n.appendChild(w)}n.setAttribute("data-label-kind",e.kind),n.toggleAttribute("data-selected-seat",r);let s=zo[e.kind],l=n.style;l.fontSize=`${this.sizeFor(e.kind)}px`,l.fontWeight=r?"800":s.weight,l.opacity=r?"1":String(s.opacity);let c=st.has(e.kind),f=!c,h=ri(e.color??this.opts.ink,this.opts.backgroundRgb,!0),u=c?ai(e.color??this.opts.ink,this.opts.backgroundRgb):h;l.color=r?ko:u.ink,l.background=r?at:u.backing,l.border=r?`1px solid ${at}`:f?`1px solid ${h.border}`:"",l.borderRadius=r||f?"999px":`${ti}px`;let m=this.narrowStage?Ja:Za;l.padding=r||f?m:`${Go}px ${Ho}px`,l.lineHeight=c?"1.1":"",l.boxShadow=r?"0 0 0 3px rgba(255,255,255,.28), 0 0 18px rgba(255,255,255,.55), 0 5px 14px rgba(0,0,0,.45)":f?"0 3px 10px rgba(0,0,0,.24)":"0 1px 4px rgba(0,0,0,.28)",l.textShadow=r||f?"none":"0 1px 1px rgba(0,0,0,0.4)",l.letterSpacing=e.kind==="zone"||e.kind==="floor"?"0.08em":"0.02em";let d=this.opts.backgroundRgb??[.04,.06,.1],y=Fe(r?ko:u.ink)??[1,1,1],v=cn(r?at:u.backing,d);return n.dataset.qualityContrast=ke(y,v).toFixed(3),l.textTransform=e.kind==="zone"||e.kind==="floor"?"uppercase":"",e.kind==="section"&&this.dressSectionTag(n,e,o),e.kind==="gate"&&this.dressGateTag(n,e),e.venueIcon&&this.dressVenueIconTag(n,e.venueIcon),n}dressVenueIconTag(e,n){let r=jn(n);if(!r)return;let a=e.style;a.display="inline-flex",a.alignItems="center",a.gap="5px";let o=16,i=qn.glyphScale,s=document.createElement("span");s.setAttribute("aria-hidden","true"),s.setAttribute("data-venue-icon",r.key),s.style.lineHeight="0",s.innerHTML=`<svg width="${o}" height="${o}" viewBox="0 0 24 24"><circle cx="12" cy="12" r="11.25" fill="${Xn[r.group]}" stroke="${qt}" stroke-width="1.5"/><path transform="translate(${12-12*i} ${12-12*i}) scale(${i})" d="${r.solid}" fill="${qt}"/></svg>`,e.prepend(s)}dressGateTag(e,n){let r=e.style;r.background="#0f172a",r.color="#ffffff",r.border="1px solid rgba(255,255,255,0.28)",r.textTransform="uppercase",r.letterSpacing="0.06em",r.display="inline-flex",r.alignItems="center",r.gap="5px";let a=document.createElement("span");if(a.setAttribute("aria-hidden","true"),a.setAttribute("data-gate-arrow",n.icon==="exit"?"out":"in"),a.innerHTML=n.icon==="exit"?'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M5 1.5H2v9h3"/><path d="M5.5 6h5M8.5 3.5 11 6 8.5 8.5"/></svg>':'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M7 1.5h3v9H7"/><path d="M1 6h5.5M4 3.5 6.5 6 4 8.5"/></svg>',e.prepend(a),n.stepFree){let o=document.createElement("span");o.setAttribute("data-gate-step-free","true"),o.setAttribute("aria-label","Step-free"),o.style.lineHeight="0",o.innerHTML=gt("wheelchair",{size:11}),e.append(o)}e.dataset.qualityContrast=ke([1,1,1],Fe("#0f172a")).toFixed(3)}dressSectionTag(e,n,r){let a=n.tint?ni(n.tint):null,o=e.style;if(a&&(o.background=a.fill,o.color=a.ink,o.border=`1px solid ${a.border}`,e.dataset.qualityContrast=a.contrast.toFixed(3)),r<=0)return;let i=document.createElement("span");i.setAttribute("data-wheelchair-free",String(r)),i.setAttribute("aria-label",`${r} wheelchair ${r===1?"place":"places"} free`),i.innerHTML=`${gt("wheelchair",{size:11})}<span>${r}</span>`;let s=i.style;s.display="inline-flex",s.alignItems="center",s.gap="2px",s.marginLeft="6px",s.padding="1px 5px",s.borderRadius="999px",s.background="#2563eb",s.color="#ffffff",s.fontSize="0.85em",s.lineHeight="1.2",s.verticalAlign="middle",e.appendChild(i)}paintAccessChip(e,n){e.setAttribute("data-label-kind","access"),e.setAttribute("data-access-type",n.icon??""),e.innerHTML=n.icon?gt(n.icon,{size:Ue-6}):"",e.setAttribute("role","img"),e.setAttribute("aria-label",n.text);let r=e.style;return r.width=`${Ue}px`,r.height=`${Ue}px`,r.alignItems="center",r.justifyContent="center",r.borderRadius="50%",r.background=n.color??"#3b82f6",r.color=n.ink??"#ffffff",r.border="1.5px solid #ffffff",r.boxShadow="0 2px 6px rgba(0,0,0,.35)",r.padding="0",r.lineHeight="0",r.boxSizing="border-box",e.dataset.qualityContrast=ke(Fe(n.ink??"#ffffff")??[1,1,1],Fe(n.color??"#3b82f6")??[.23,.51,.96]).toFixed(3),e}placePinHeads(e){for(;this.pinHeads.length<e.length;){let n=document.createElement("div");n.setAttribute("data-pin-head",""),n.setAttribute("aria-hidden","true");let r=n.style;r.position="absolute",r.left="0",r.top="0",r.width=`${Lo}px`,r.height=`${Lo}px`,r.borderRadius="50%",r.background=at,r.boxShadow="0 0 0 3px rgba(255,255,255,.28), 0 0 14px rgba(255,255,255,.55), 0 3px 8px rgba(0,0,0,.45)",r.pointerEvents="none",this.root.appendChild(n),this.pinHeads.push(n)}this.pinHeads.forEach((n,r)=>{let a=e[r];n.style.display=a?"":"none",a&&(n.style.transform=`translate(-50%, -100%) translate(${a.x.toFixed(1)}px, ${a.y.toFixed(1)}px)`)})}dispose(){this.pinHeads=[],this.root.remove(),this.nodes.clear()}};var ui=1;var di=new Set(["floor","stage","zone","section","ga","booth","annotation"]);function mi(t){return t.every(e=>Number.isFinite(e))}function hi(t,e){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function Bo(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function Le(t){return Math.round(t*1e4)/1e4}function pi(t){if(t)return{box:{x:Le(t.box.x),y:Le(t.box.y),width:Le(t.box.width),height:Le(t.box.height)},horizontalFillRatio:Le(t.horizontalFillRatio),verticalFillRatio:Le(t.verticalFillRatio),visibleAreaRatio:Le(t.visibleAreaRatio),clippedEdges:[...t.clippedEdges]}}function Pe(t,e,n){return n.length?{code:t,message:e,count:n.length,samples:n.slice(0,20)}:null}function un(t){let e=t.labels.filter(s=>s.visible&&s.screenBox),n=e.filter(s=>di.has(s.kind)),r=t.scene.floorCount>1?t.scene.floorCount:t.scene.zoneCount||t.scene.sectionCount,a=[];for(let s=0;s<n.length;s+=1)for(let l=0;l<s;l+=1)hi(n[s].screenBox,n[l].screenBox)&&a.push({primaryId:n[s].id,primaryLabel:n[s].text,secondaryId:n[l].id});let o=[...t.camera.position,t.camera.distance,t.camera.verticalFovDeg],i=[Pe("webgl2-unavailable","The venue scene must render through WebGL2",t.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),Pe("context-lost","The WebGL context must be live at capture",t.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),Pe("frame-not-stable","The captured 3D frame must be rendered and parked",t.frame.rendered>0&&t.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),Pe("viewport-empty","The 3D viewport must have visible dimensions",t.viewport.width>1&&t.viewport.height>1?[]:[{primaryId:"viewport",primaryLabel:`${t.viewport.width}\xD7${t.viewport.height}`}]),Pe("camera-invalid","The capture camera must have a finite physical pose",mi(o)&&t.camera.distance>0&&t.camera.verticalFovDeg>0&&t.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),Pe("authored-relief-not-visible","Authored 3D height or rake must produce visible screen-space relief",!t.scene.authoredRelief||t.scene.renderedVerticalSpanM>.05&&t.scene.projectedReliefPx>=2?[]:[{primaryId:"scene",primaryLabel:"authored relief",measured:t.scene.projectedReliefPx,minimum:2}]),Pe("hierarchy-label-missing","A venue with authored hierarchy must show at least one structural label",r===0||n.length>0?[]:[{primaryId:"labels",primaryLabel:`${r} expected hierarchy labels`}]),Pe("hierarchy-label-undersized","Visible 3D hierarchy labels must remain readable",n.filter(s=>s.renderedFontPx<11).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.renderedFontPx,minimum:11}))),Pe("hierarchy-label-contrast-low","Visible 3D hierarchy labels must meet text contrast",n.filter(s=>s.contrast<4.5).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.contrast,minimum:4.5}))),Pe("hierarchy-label-collision","Visible 3D hierarchy labels must not overlap",a)].filter(s=>!!s);return{version:1,state:"venue3d",passed:i.length===0,resolvedRules:["rendered-3d-webgl-context","rendered-3d-stable-frame","rendered-3d-camera-pose","rendered-3d-relief-projection","rendered-3d-label-size","rendered-3d-label-contrast","rendered-3d-label-collision"],viewport:t.viewport,context:t.context,frame:t.frame,camera:t.camera,scene:t.scene,composition:{visibleLabels:e.map(({id:s,kind:l,text:c})=>({id:s,kind:l,text:c})).sort((s,l)=>s.kind.localeCompare(l.kind)||s.id.localeCompare(l.id)),framing:pi(t.framing)},metrics:{minimumHierarchyFontPx:Bo(n.map(s=>s.renderedFontPx)),minimumHierarchyContrast:Bo(n.map(s=>s.contrast)),projectedReliefPx:Math.round(t.scene.projectedReliefPx*100)/100},findings:i}}function Wo(t,e,n){t.fill(0);for(let r=0;r<Math.min(n,e.length);r++)t[e[r]]=1}import{Geometry as lt,Mesh as ct,Program as Ni,Texture as Hi,Transform as rr}from"ogl";import{Program as Ve}from"ogl";var Ct=`
|
|
46
|
+
}`;function Xa(t){if(t>=1)return 1;if(t<.72){let n=t/.72;return 1-(1-n)*(1-n)}let e=(t-.72)/.28;return 1-.08*Math.sin(e*Math.PI)}function an(t){return Math.max(Va,Math.min(Oa,t*La))}function qa(t){let e=.2126*t[0]+.7152*t[1]+.0722*t[2],n=e>=.25?0:Math.min(.45,(.25-e)*2.2);return t.map(r=>r+(1-r)*n)}function Fo(t,e,n=[.24,.74,1]){let r=qa(n),a=new ka,o=Wa(t),i=new Map,s=(l,c)=>{let f=new Fa(t,{vertex:Ua,fragment:Ya,uniforms:{uSeat:{value:l},uHeight:{value:1},uLift:{value:0},uRingScale:{value:1},uBeamHeight:{value:De.height},uBeam:{value:0},uBeamColor:{value:r},uColor:{value:e},uRingAlpha:{value:.85}},transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1}),p=new Da(t,{geometry:o,program:f});return p.frustumCulled=!1,p.setParent(a),{mesh:p,program:f,seat:l,start:c}};return{root:a,setSeats(l,c,f){let p=new Set(l.slice(0,Do).map(u=>u.id));for(let[u,m]of i)p.has(u)||(m.mesh.setParent(null),i.delete(u));for(let u of l.slice(0,Do))i.has(u.id)||i.set(u.id,s(u.position,f?c:-1/0))},update(l,c,f,p=!1){let u=!1;for(let m of i.values()){let d=c[0]-m.seat[0],y=c[1]-m.seat[1],v=c[2]-m.seat[2],w=Math.hypot(d,y,v);m.mesh.visible=!f&&w>(p?Na:Ha);let E=an(w),C=Math.max(0,Math.min(1,(l-m.start)/Ga));C<1&&(u=!0),m.program.uniforms.uHeight.value=E,m.program.uniforms.uRingScale.value=Math.min(E,za),m.program.uniforms.uLift.value=p?1:1-Xa(C),m.program.uniforms.uBeam.value=Ba(w,p),m.program.uniforms.uRingAlpha.value=.55+.4*(C<1?Math.sin(C*Math.PI):0)}return u},dispose(){for(let l of i.values())l.mesh.setParent(null);i.clear(),o.remove()}}}var at="#ffffff",ko="#0b1220",it=6,ja=80,Lo=14,Vo=88,Oo=20,zo={floor:{size:14,weight:"700",opacity:.98},stage:{size:14,weight:"700",opacity:.98},zone:{size:15,weight:"600",opacity:.95},section:{size:12,weight:"500",opacity:.88},ga:{size:12,weight:"500",opacity:.88},gate:{size:12,weight:"700",opacity:.98},booth:{size:11,weight:"500",opacity:.85},annotation:{size:11,weight:"400",opacity:.75},row:{size:11.5,weight:"700",opacity:.94},seat:{size:12.5,weight:"800",opacity:1},access:{size:12,weight:"700",opacity:1}},$a=640,Ka=.8,Qa=11,Za="3px 7px",Ja="2px 5px",No="rgba(10,14,22,.62)",ei="#f4f7fb",Ho=5,Go=2,ti=6,st=new Set(["row","seat","access"]),sn={stage:6,gate:5,floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},We={row:{x:66,y:20},seat:{x:52,y:22}},Fe=Un,ln=t=>Yn(t);function ke(t,e){let n=ln(t),r=ln(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function ni(t){let e=Fe(t);if(!e)return null;let n=o=>`#${o.map(i=>Math.round(Math.max(0,Math.min(1,i))*255).toString(16).padStart(2,"0")).join("")}`,r=e.map(o=>o+(1-o)*.78),a=e.map(o=>o*.62);for(let o=0;o<12&&ke(a,r)<4.5;o++)a=a.map(i=>i*.8);return{fill:n(r),ink:n(a),border:n(e.map(o=>o+(1-o)*.35)),contrast:ke(a,r)}}var oi=30;function cn(t,e){let n=/rgba\((\d+),(\d+),(\d+),([\d.]+)\)/.exec(t.replace(/\s/g,""));if(!n)return e;let r=Math.max(0,Math.min(1,Number(n[4])));return[1,2,3].map(a=>Number(n[a])/255*r+e[a-1]*(1-r))}function ri(t,e=[.04,.06,.1],n=!0){let r=ln(e)<.42,a=r?"#f4f7fb":"#0b1220",o=r?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",i=n?cn(o,e):e,s=Fe(t),l=n?7:4.5,c=s&&ke(s,i)>=l?t:a;return r?{ink:c,backing:o,border:"rgba(210,222,245,.24)"}:{ink:c,backing:o,border:"rgba(11,18,32,.22)"}}function ai(t,e=[.04,.06,.1]){let n=cn(No,e),r=Fe(t);return{ink:r&&ke(r,n)>=4.5?t:ei,backing:No}}var ii=.8,Ue=20,si=14,li=60,ci='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Pt=class{constructor(e,n={}){this.nodes=new Map;this.labels=[];this.wheelchairFree=new Map;this.nodeAppearance=new WeakMap;this.forcedDense=!1;this.overviewDistance=null;this.selectedSeatLabelIds=new Set;this.narrowStage=!1;this.seatNumberRow=void 0;this.seatNumberSeat=null;this.pinHeads=[];this.opts=n,this.root=document.createElement("div"),this.root.setAttribute("data-view3d-labels","");let r=this.root.style;r.position="absolute",r.inset="0",r.pointerEvents="none",r.overflow="hidden",r.fontFamily=n.fontFamily||ci,e.appendChild(this.root)}setVisible(e){this.root.style.visibility=e?"":"hidden"}setLabels(e){this.labels=e;let n=new Set(e.map(r=>r.id));for(let[r,a]of this.nodes)n.has(r)||(a.remove(),this.nodes.delete(r))}setForcedDense(e){this.forcedDense=e}setOverviewDistance(e){this.overviewDistance=e>0?e:null}setSeatNumberRow(e){return e===this.seatNumberRow?!1:(this.seatNumberRow=e,!0)}setSeatNumberSeat(e){let n=e?`seat:${e}`:null;return n===this.seatNumberSeat?!1:(this.seatNumberSeat=n,!0)}setWheelchairFree(e){let n=e.size!==this.wheelchairFree.size;if(!n){for(let[r,a]of e)if(this.wheelchairFree.get(r)!==a){n=!0;break}}return n&&(this.wheelchairFree=new Map(e)),n}setSelectedSeatIds(e){this.selectedSeatLabelIds=new Set(Array.from(e,n=>`seat:${n}`))}sizeFor(e){let n=zo[e].size;return!this.narrowStage||st.has(e)?n:Math.max(Qa,n*Ka)}qualityEvidence(){let e=this.root.getBoundingClientRect(),n=this.root.style.visibility!=="hidden";return this.labels.map(r=>{let a=this.nodes.get(r.id),o=a?.getBoundingClientRect(),i=!!(n&&a&&a.style.display!=="none"&&o&&o.width>0&&o.height>0);return{id:r.id,kind:r.kind,text:r.text,visible:i,renderedFontPx:a&&Number.parseFloat(a.style.fontSize)||0,contrast:a?Number(a.dataset.qualityContrast??0):0,...i&&o?{screenBox:{x:o.x-e.x,y:o.y-e.y,width:o.width,height:o.height}}:{}}})}update(e,n,r,a,o,i){if(!this.labels.length)return;this.narrowStage=n>0&&n<$a;let s=oo(a,o,{hasZoneLabels:this.labels.some(b=>b.kind==="zone")});this.forcedDense&&(s.add("row"),s.add("seat"),s.add("access")),!this.forcedDense&&this.overviewDistance!==null&&a>this.overviewDistance*ii&&(s.delete("section"),s.delete("ga")),s.has("section")&&this.labels.some(b=>b.kind==="section")&&s.delete("zone");let l=[];for(let b of this.labels){let F=b.kind==="annotation"&&!!b.venueIcon;if(!s.has(b.kind)&&!F&&!(b.kind==="seat"&&this.selectedSeatLabelIds.has(b.id)))continue;let x=b.kind==="seat"&&i&&this.selectedSeatLabelIds.has(b.id)?b.pinBase:void 0,I=x&&i?[x[0],x[1]+an(Math.hypot(x[0]-i[0],x[1]-i[1],x[2]-i[2])),x[2]]:b.anchor,z=Ae(e,I,n,r);if(!z.visible)continue;let _=st.has(b.kind),O=this.sizeFor(b.kind),G=b.kind==="access"?Ue:so(b.text,O,!_)+(_?Ho*2:0)+((this.wheelchairFree.get(b.id)??0)>0?oi:0);if(b.kind==="access"&&b.seatWidthM!==void 0&&Kt(e,b.anchor,b.seatWidthM,n)<si||b.kind==="seat"&&b.seatWidthM!==void 0&&!this.selectedSeatLabelIds.has(b.id)&&Kt(e,b.anchor,b.seatWidthM,n)<Math.max(22,G))continue;let B=ro(z,G/2,O/2+(_?Go:4),n,r),W=i?Math.hypot(b.anchor[0]-i[0],b.anchor[1]-i[1],b.anchor[2]-i[2]):1;l.push({label:b,screen:B,focus:co(B,W,n,r),halfWidth:G/2,...this.selectedSeatLabelIds.has(b.id)?{priority:1}:{}})}let c=no(l.filter(b=>b.label.kind==="floor"),n),f=[...l.filter(b=>!st.has(b.label.kind)&&b.label.kind!=="floor"),...c],p=lo(n),u=l.filter(b=>b.label.kind==="seat"&&this.selectedSeatLabelIds.has(b.label.id)),m=tt(u,We.seat.x,We.seat.y,p.seat);this.placePinHeads(u.filter(b=>b.label.pinBase&&!m.includes(b)).map(b=>b.screen));let d=ao(f,Vo,Oo,b=>sn[b.label.kind]??0).filter(b=>!m.some(F=>io(b,F,Vo,Oo))),y=tt(l.filter(b=>b.label.kind==="access"),Ue,Ue,li,[...d,...m]),v=tt(l.filter(b=>b.label.kind==="row"),We.row.x,We.row.y,p.row,[...d,...m,...y]),w=this.seatNumberRow!==void 0||this.seatNumberSeat!==null,E=tt(l.filter(b=>b.label.kind==="seat"&&!this.selectedSeatLabelIds.has(b.label.id)&&(this.seatNumberSeat!==null?b.label.id===this.seatNumberSeat:!w||this.seatNumberRow!==null&&b.label.rowId===this.seatNumberRow)),We.seat.x,We.seat.y,w?ja:p.seat-m.length,[...d,...m,...y,...v]),C=[...d,...y,...v,...m,...E],D=new Set(C.map(b=>b.label.id));for(let{label:b,screen:F}of C){let I=this.nodeFor(b).style;I.display=b.kind==="access"?"flex":b.kind==="gate"?"inline-flex":"";let z=!!b.pinBase&&this.selectedSeatLabelIds.has(b.id);I.transform=z?`translate(-50%, -100%) translate(${F.x.toFixed(1)}px, ${(F.y-it).toFixed(1)}px)`:`translate(-50%, -50%) translate(${F.x.toFixed(1)}px, ${F.y.toFixed(1)}px)`}let R=C.filter(({label:b})=>!st.has(b.kind)).sort((b,F)=>sn[F.label.kind]-sn[b.label.kind]||b.screen.depth-F.screen.depth||b.focus-F.focus).flatMap(({label:b})=>{let F=this.nodes.get(b.id);return F&&F.style.display!=="none"?[{node:F,box:F.getBoundingClientRect()}]:[]}),L=[];for(let{node:b,box:F}of R)L.some(I=>F.left<I.right+3&&F.right+3>I.left&&F.top<I.bottom+3&&F.bottom+3>I.top)?b.style.display="none":L.push(F);for(let[b,F]of this.nodes)D.has(b)||(F.style.display="none")}nodeFor(e){let n=this.nodes.get(e.id);if(!n){n=document.createElement("div");let w=n.style;w.position="absolute",w.left="0",w.top="0",w.whiteSpace="nowrap",w.display="none",this.root.appendChild(n),this.nodes.set(e.id,n)}let r=this.selectedSeatLabelIds.has(e.id),a=this.nodeAppearance.get(n),o=this.wheelchairFree.get(e.id)??0,i=e.text+(e.icon??"")+(e.venueIcon??"")+(e.tint??"")+(o>0?`|${o}`:"");if(a&&a.text===i&&a.kind===e.kind&&a.color===e.color&&a.selected===r&&a.narrow===this.narrowStage)return n;if(this.nodeAppearance.set(n,{text:i,kind:e.kind,color:e.color,selected:r,narrow:this.narrowStage}),e.kind==="access")return this.paintAccessChip(n,e);if(n.textContent=e.text,r){let w=document.createElement("span"),E=w.style;E.position="absolute",E.left="50%",E.bottom=`-${it}px`,E.transform="translateX(-50%)",E.borderLeft=`${it}px solid transparent`,E.borderRight=`${it}px solid transparent`,E.borderTop=`${it}px solid ${at}`,n.appendChild(w)}n.setAttribute("data-label-kind",e.kind),n.toggleAttribute("data-selected-seat",r);let s=zo[e.kind],l=n.style;l.fontSize=`${this.sizeFor(e.kind)}px`,l.fontWeight=r?"800":s.weight,l.opacity=r?"1":String(s.opacity);let c=st.has(e.kind),f=!c,p=ri(e.color??this.opts.ink,this.opts.backgroundRgb,!0),u=c?ai(e.color??this.opts.ink,this.opts.backgroundRgb):p;l.color=r?ko:u.ink,l.background=r?at:u.backing,l.border=r?`1px solid ${at}`:f?`1px solid ${p.border}`:"",l.borderRadius=r||f?"999px":`${ti}px`;let m=this.narrowStage?Ja:Za;l.padding=r||f?m:`${Go}px ${Ho}px`,l.lineHeight=c?"1.1":"",l.boxShadow=r?"0 0 0 3px rgba(255,255,255,.28), 0 0 18px rgba(255,255,255,.55), 0 5px 14px rgba(0,0,0,.45)":f?"0 3px 10px rgba(0,0,0,.24)":"0 1px 4px rgba(0,0,0,.28)",l.textShadow=r||f?"none":"0 1px 1px rgba(0,0,0,0.4)",l.letterSpacing=e.kind==="zone"||e.kind==="floor"?"0.08em":"0.02em";let d=this.opts.backgroundRgb??[.04,.06,.1],y=Fe(r?ko:u.ink)??[1,1,1],v=cn(r?at:u.backing,d);return n.dataset.qualityContrast=ke(y,v).toFixed(3),l.textTransform=e.kind==="zone"||e.kind==="floor"?"uppercase":"",e.kind==="section"&&this.dressSectionTag(n,e,o),e.kind==="gate"&&this.dressGateTag(n,e),e.venueIcon&&this.dressVenueIconTag(n,e.venueIcon),n}dressVenueIconTag(e,n){let r=jn(n);if(!r)return;let a=e.style;a.display="inline-flex",a.alignItems="center",a.gap="5px";let o=16,i=qn.glyphScale,s=document.createElement("span");s.setAttribute("aria-hidden","true"),s.setAttribute("data-venue-icon",r.key),s.style.lineHeight="0",s.innerHTML=`<svg width="${o}" height="${o}" viewBox="0 0 24 24"><circle cx="12" cy="12" r="11.25" fill="${Xn[r.group]}" stroke="${qt}" stroke-width="1.5"/><path transform="translate(${12-12*i} ${12-12*i}) scale(${i})" d="${r.solid}" fill="${qt}"/></svg>`,e.prepend(s)}dressGateTag(e,n){let r=e.style;r.background="#0f172a",r.color="#ffffff",r.border="1px solid rgba(255,255,255,0.28)",r.textTransform="uppercase",r.letterSpacing="0.06em",r.display="inline-flex",r.alignItems="center",r.gap="5px";let a=document.createElement("span");if(a.setAttribute("aria-hidden","true"),a.setAttribute("data-gate-arrow",n.icon==="exit"?"out":"in"),a.innerHTML=n.icon==="exit"?'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M5 1.5H2v9h3"/><path d="M5.5 6h5M8.5 3.5 11 6 8.5 8.5"/></svg>':'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M7 1.5h3v9H7"/><path d="M1 6h5.5M4 3.5 6.5 6 4 8.5"/></svg>',e.prepend(a),n.stepFree){let o=document.createElement("span");o.setAttribute("data-gate-step-free","true"),o.setAttribute("aria-label","Step-free"),o.style.lineHeight="0",o.innerHTML=gt("wheelchair",{size:11}),e.append(o)}e.dataset.qualityContrast=ke([1,1,1],Fe("#0f172a")).toFixed(3)}dressSectionTag(e,n,r){let a=n.tint?ni(n.tint):null,o=e.style;if(a&&(o.background=a.fill,o.color=a.ink,o.border=`1px solid ${a.border}`,e.dataset.qualityContrast=a.contrast.toFixed(3)),r<=0)return;let i=document.createElement("span");i.setAttribute("data-wheelchair-free",String(r)),i.setAttribute("aria-label",`${r} wheelchair ${r===1?"place":"places"} free`),i.innerHTML=`${gt("wheelchair",{size:11})}<span>${r}</span>`;let s=i.style;s.display="inline-flex",s.alignItems="center",s.gap="2px",s.marginLeft="6px",s.padding="1px 5px",s.borderRadius="999px",s.background="#2563eb",s.color="#ffffff",s.fontSize="0.85em",s.lineHeight="1.2",s.verticalAlign="middle",e.appendChild(i)}paintAccessChip(e,n){e.setAttribute("data-label-kind","access"),e.setAttribute("data-access-type",n.icon??""),e.innerHTML=n.icon?gt(n.icon,{size:Ue-6}):"",e.setAttribute("role","img"),e.setAttribute("aria-label",n.text);let r=e.style;return r.width=`${Ue}px`,r.height=`${Ue}px`,r.alignItems="center",r.justifyContent="center",r.borderRadius="50%",r.background=n.color??"#3b82f6",r.color=n.ink??"#ffffff",r.border="1.5px solid #ffffff",r.boxShadow="0 2px 6px rgba(0,0,0,.35)",r.padding="0",r.lineHeight="0",r.boxSizing="border-box",e.dataset.qualityContrast=ke(Fe(n.ink??"#ffffff")??[1,1,1],Fe(n.color??"#3b82f6")??[.23,.51,.96]).toFixed(3),e}placePinHeads(e){for(;this.pinHeads.length<e.length;){let n=document.createElement("div");n.setAttribute("data-pin-head",""),n.setAttribute("aria-hidden","true");let r=n.style;r.position="absolute",r.left="0",r.top="0",r.width=`${Lo}px`,r.height=`${Lo}px`,r.borderRadius="50%",r.background=at,r.boxShadow="0 0 0 3px rgba(255,255,255,.28), 0 0 14px rgba(255,255,255,.55), 0 3px 8px rgba(0,0,0,.45)",r.pointerEvents="none",this.root.appendChild(n),this.pinHeads.push(n)}this.pinHeads.forEach((n,r)=>{let a=e[r];n.style.display=a?"":"none",a&&(n.style.transform=`translate(-50%, -100%) translate(${a.x.toFixed(1)}px, ${a.y.toFixed(1)}px)`)})}dispose(){this.pinHeads=[],this.root.remove(),this.nodes.clear()}};var ui=1;var di=new Set(["floor","stage","zone","section","ga","booth","annotation"]);function mi(t){return t.every(e=>Number.isFinite(e))}function hi(t,e){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function Bo(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function Le(t){return Math.round(t*1e4)/1e4}function pi(t){if(t)return{box:{x:Le(t.box.x),y:Le(t.box.y),width:Le(t.box.width),height:Le(t.box.height)},horizontalFillRatio:Le(t.horizontalFillRatio),verticalFillRatio:Le(t.verticalFillRatio),visibleAreaRatio:Le(t.visibleAreaRatio),clippedEdges:[...t.clippedEdges]}}function Pe(t,e,n){return n.length?{code:t,message:e,count:n.length,samples:n.slice(0,20)}:null}function un(t){let e=t.labels.filter(s=>s.visible&&s.screenBox),n=e.filter(s=>di.has(s.kind)),r=t.scene.floorCount>1?t.scene.floorCount:t.scene.zoneCount||t.scene.sectionCount,a=[];for(let s=0;s<n.length;s+=1)for(let l=0;l<s;l+=1)hi(n[s].screenBox,n[l].screenBox)&&a.push({primaryId:n[s].id,primaryLabel:n[s].text,secondaryId:n[l].id});let o=[...t.camera.position,t.camera.distance,t.camera.verticalFovDeg],i=[Pe("webgl2-unavailable","The venue scene must render through WebGL2",t.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),Pe("context-lost","The WebGL context must be live at capture",t.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),Pe("frame-not-stable","The captured 3D frame must be rendered and parked",t.frame.rendered>0&&t.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),Pe("viewport-empty","The 3D viewport must have visible dimensions",t.viewport.width>1&&t.viewport.height>1?[]:[{primaryId:"viewport",primaryLabel:`${t.viewport.width}\xD7${t.viewport.height}`}]),Pe("camera-invalid","The capture camera must have a finite physical pose",mi(o)&&t.camera.distance>0&&t.camera.verticalFovDeg>0&&t.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),Pe("authored-relief-not-visible","Authored 3D height or rake must produce visible screen-space relief",!t.scene.authoredRelief||t.scene.renderedVerticalSpanM>.05&&t.scene.projectedReliefPx>=2?[]:[{primaryId:"scene",primaryLabel:"authored relief",measured:t.scene.projectedReliefPx,minimum:2}]),Pe("hierarchy-label-missing","A venue with authored hierarchy must show at least one structural label",r===0||n.length>0?[]:[{primaryId:"labels",primaryLabel:`${r} expected hierarchy labels`}]),Pe("hierarchy-label-undersized","Visible 3D hierarchy labels must remain readable",n.filter(s=>s.renderedFontPx<11).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.renderedFontPx,minimum:11}))),Pe("hierarchy-label-contrast-low","Visible 3D hierarchy labels must meet text contrast",n.filter(s=>s.contrast<4.5).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.contrast,minimum:4.5}))),Pe("hierarchy-label-collision","Visible 3D hierarchy labels must not overlap",a)].filter(s=>!!s);return{version:1,state:"venue3d",passed:i.length===0,resolvedRules:["rendered-3d-webgl-context","rendered-3d-stable-frame","rendered-3d-camera-pose","rendered-3d-relief-projection","rendered-3d-label-size","rendered-3d-label-contrast","rendered-3d-label-collision"],viewport:t.viewport,context:t.context,frame:t.frame,camera:t.camera,scene:t.scene,composition:{visibleLabels:e.map(({id:s,kind:l,text:c})=>({id:s,kind:l,text:c})).sort((s,l)=>s.kind.localeCompare(l.kind)||s.id.localeCompare(l.id)),framing:pi(t.framing)},metrics:{minimumHierarchyFontPx:Bo(n.map(s=>s.renderedFontPx)),minimumHierarchyContrast:Bo(n.map(s=>s.contrast)),projectedReliefPx:Math.round(t.scene.projectedReliefPx*100)/100},findings:i}}function Wo(t,e,n){t.fill(0);for(let r=0;r<Math.min(n,e.length);r++)t[e[r]]=1}import{Geometry as lt,Mesh as ct,Program as zi,Texture as Ni,Transform as rr}from"ogl";import{Program as Ve}from"ogl";var Ct=`
|
|
47
47
|
float chairWeight(float depth) {
|
|
48
48
|
return 1.0 - smoothstep(uChairFull, uChairNone, depth);
|
|
49
49
|
}`,Uo=`
|
|
@@ -932,7 +932,7 @@ void main() {
|
|
|
932
932
|
void main() {
|
|
933
933
|
if (abs(vMaterial - 6.0) < 0.5) discard;
|
|
934
934
|
fragColor = vec4(1.0);
|
|
935
|
-
}`}),
|
|
935
|
+
}`}),p=new Li,u=new Di(t,{geometry:e,program:f});u.frustumCulled=!1,u.setParent(p);let m=t.getParameter(t.COLOR_CLEAR_VALUE),d=t.isEnabled(t.DITHER);try{t.disable(t.DITHER),t.clearColor(1,1,1,1),t.renderer.render({scene:p,camera:l,target:c})}finally{d&&t.enable(t.DITHER),t.clearColor(m[0],m[1],m[2],m[3]),f.remove()}let y=new Ii().multiply(l.projectionMatrix,l.viewMatrix);return{texture:c.depthTexture,matrix:y,dispose(){for(let v of c.textures)t.deleteTexture(v.texture);t.deleteTexture(c.depthTexture.texture),t.deleteFramebuffer(c.buffer),c.depthBuffer&&t.deleteRenderbuffer(c.depthBuffer)}}}var Vi=.65,Oi=new Set(["dimmed","sold","held"]);function nr(t,e,n){let r=new Set,a=!1;for(let o of t){let i=e.get(o.sectionId);if(!i||!i.length){r.add(o.sectionId);continue}let s=!1;for(let l of i){let c=Se[n[l]]??"available";if(!Oi.has(c)){s=!0;break}}s?r.add(o.sectionId):a=!0}return{lit:r,anyUnlit:a}}function or(t,e,n,r,a,o){let i=[];for(let s of t){let l=a===null||a.has(s.sectionId);if(r.get(s.sectionId)===l)continue;r.set(s.sectionId,l);let c=(s.start+s.count)*3;for(let f=s.start*3;f<c;f++)e[f]=l?n[f]:n[f]+(o[f%3]-n[f])*Vi;i.push(s)}return i}var ar=Se.indexOf("selected");function Hi(t,e){return[0,1,2].map(n=>t[n]*.15+.75+e[n]*.1)}function ir(t,e,n,r,a,o){for(let i=n;i<n+r;i++){let s=o&&e[i]===0,l=o&&e[i]===ar?Hi([o[i*3],o[i*3+1],o[i*3+2]],a[ar]??a[0]):s?null:a[e[i]]??a[0];t[i*3]=l?l[0]:o[i*3],t[i*3+1]=l?l[1]:o[i*3+1],t[i*3+2]=l?l[2]:o[i*3+2]}}var Gi=new Float32Array([-1,-1,3,-1,-1,3]);function sr(t,e){let n=new rr,r=new rr,a=new lt(t,{position:{size:2,data:Gi}}),o=er(t,e.theme.background.top,e.theme.background.bottom,e.outdoor?e.theme.sky:null),i=new ct(t,{geometry:a,program:o});i.frustumCulled=!1,i.setParent(r);let s=new lt(t,{position:{size:3,data:e.solids.position},normal:{size:3,data:e.solids.normal},color:{size:3,data:e.solids.color},floorIndex:{size:1,data:e.solids.floor},materialIndex:{size:1,data:e.solids.material}}),l=tr(t,s,e.renderBounds),c=Qo(t,e.theme.materials.roughness,e.theme.structure.tierTop);c.uniforms.tVenueShadow={value:l.texture},c.uniforms.uShadowMatrix={value:l.matrix},e.room&&c.uniforms.uRoomCentre.value.set(e.room.centre);let f=new ct(t,{geometry:s,program:c});f.frustumCulled=!1,f.setParent(n);let p=Zo(t),u=new Float32Array(e.seats.count*3),m=Se.map(U=>e.theme.seatStates[U]),d=e.seats.iCategory.slice(),y=Zn(e.theme.structure);for(let U=0;U<e.seats.count;U++){if(e.seats.iPhysicalSeat[U]<.5)continue;let ee=e.theme.materials.seat??Jn([d[U*3],d[U*3+1],d[U*3+2]],y);d.set(ee,U*3)}ir(u,e.seats.iState,0,e.seats.count,m,d);let v=bo(),w=new Uint8Array(e.seats.count),E=new lt(t,{position:{size:3,data:v.position},normal:{size:3,data:v.normal},uv:{size:2,data:v.uv},index:{size:1,data:v.index},surface:{size:1,data:v.surface},iYaw:{size:1,data:e.seats.iYaw,instanced:1},iChairWidth:{size:1,data:e.seats.iChairWidth,instanced:1},iGlyph:{size:1,data:e.seats.iGlyph,instanced:1},iOffset:{size:3,data:e.seats.iPosition,instanced:1},iColor:{size:3,data:u,instanced:1},iMaxRadius:{size:1,data:e.seats.iMaxRadius,instanced:1},iHasChair:{size:1,data:w,type:t.UNSIGNED_BYTE,usage:t.DYNAMIC_DRAW,instanced:1},iPhysicalSeat:{size:1,data:e.seats.iPhysicalSeat,instanced:1},iRing:{size:3,data:e.seats.iRing,instanced:1},iFloor:{size:1,data:e.seats.iFloor,instanced:1},iSection:{size:1,data:e.seats.iSection,instanced:1}}),C=new ct(t,{geometry:E,program:p});C.frustumCulled=!1,e.seats.count>0&&C.setParent(n);let D=E.attributes.iColor,A=e.solids.color.slice(),R=e.theme.structure.ground,L=new Map(e.sectionSolidRanges.map(U=>[U.sectionId,!0])),b=Kn(),F=Jo(t,e.theme.materials.roughness),x=At,I=new Float32Array(x*3),z=new Float32Array(x*3),_=new Float32Array(x),O=new Float32Array(x),G=new Float32Array(x),B=new Float32Array(x*3),W=new Float32Array(x),N=new Float32Array(x),te=new Float32Array(x),X=new Float32Array(x),J=new Float32Array(x),M=new lt(t,{position:{size:3,data:b.position},normal:{size:3,data:b.normal},part:{size:1,data:b.part},index:{data:b.index},iOffset:{size:3,data:I,instanced:1},iColor:{size:3,data:z,instanced:1},iRadius:{size:1,data:_,instanced:1},iYaw:{size:1,data:O,instanced:1},iGlyph:{size:1,data:G,instanced:1},iRing:{size:3,data:B,instanced:1},iFloor:{size:1,data:W,instanced:1},iSection:{size:1,data:N,instanced:1},iPhysicalSeat:{size:1,data:te,instanced:1},iSeed:{size:1,data:J,instanced:1},iPickIndex:{size:1,data:X,instanced:1}}),P=new ct(t,{geometry:M,program:F});P.frustumCulled=!1;let S=0,Y=!1,Z=!1,ge=null,ce=null,he=null,oe=new Int32Array(0),ye=()=>{let U=e.seats;for(let ee=0;ee<S;ee++){let q=oe[ee];J[ee]=eo(U.iState[q],q),z[ee*3]=u[q*3],z[ee*3+1]=u[q*3+1],z[ee*3+2]=u[q*3+2]}M.attributes.iColor.needsUpdate=!0,M.attributes.iSeed.needsUpdate=!0},pe={main:n,background:r,backgroundProgram:o,seatProgram:p,solidProgram:c,chairProgram:F,seatGeometry:E,chairGeometry:M,solidGeometry:s,drawCalls:3,setNearSeats(U,ee){let q=Math.min(ee,x,U.length);if(Wo(w,U,q),E.attributes.iHasChair.needsUpdate=!0,oe=U,S=q,q===0){P.parent&&P.setParent(null),M.instancedCount=0,pe.drawCalls=3+(Y?1:0);return}let K=e.seats;for(let ne=0;ne<q;ne++){let se=U[ne];I[ne*3]=K.iPosition[se*3],I[ne*3+1]=K.iPosition[se*3+1],I[ne*3+2]=K.iPosition[se*3+2],_[ne]=K.iChairWidth[se],O[ne]=K.iYaw[se],G[ne]=K.iGlyph[se],B[ne*3]=K.iRing[se*3],B[ne*3+1]=K.iRing[se*3+1],B[ne*3+2]=K.iRing[se*3+2],W[ne]=K.iFloor[se],N[ne]=K.iSection[se],te[ne]=K.iPhysicalSeat[se],X[ne]=se+1}ye(),M.attributes.iOffset.needsUpdate=!0,M.attributes.iRadius.needsUpdate=!0,M.attributes.iYaw.needsUpdate=!0,M.attributes.iGlyph.needsUpdate=!0,M.attributes.iRing.needsUpdate=!0,M.attributes.iFloor.needsUpdate=!0,M.attributes.iSection.needsUpdate=!0,M.attributes.iPhysicalSeat.needsUpdate=!0,M.attributes.iSeed.needsUpdate=!0,M.attributes.iPickIndex.needsUpdate=!0,M.instancedCount=q,P.parent||P.setParent(n),pe.drawCalls=4+(Y?1:0)},nearSeatCount(){return S},setSectionShellLit(U){c.uniforms.uSectionFilter.value=U===null?0:1;let ee=or(e.sectionSolidRanges,e.solids.color,A,L,U,R);if(!ee.length)return;let q=s.attributes.color,K=q.buffer;if(!K){q.needsUpdate=!0;return}t.bindBuffer(t.ARRAY_BUFFER,K);for(let ne of ee){let se=e.solids.color.subarray(ne.start*3,(ne.start+ne.count)*3);t.bufferSubData(t.ARRAY_BUFFER,ne.start*3*Float32Array.BYTES_PER_ELEMENT,se)}},uploadSeatStateRuns(U){if(!U.length)return;S&&ye();for(let q of U)ir(u,e.seats.iState,q.start,q.length,m,d);let ee=D.buffer;if(!ee){D.needsUpdate=!0;return}t.bindBuffer(t.ARRAY_BUFFER,ee);for(let q of U){let K=u.subarray(q.start*3,(q.start+q.length)*3);t.bufferSubData(t.ARRAY_BUFFER,q.start*3*Float32Array.BYTES_PER_ELEMENT,K)}},dispose(){Z=!0,l.dispose(),a.remove(),o.remove(),s.remove(),c.remove(),E.remove(),p.remove(),M.remove(),F.remove(),ge?.remove(),ce?.remove(),he?.texture&&t.deleteTexture(he.texture)}},$=e.productionElements.find(U=>U.contentImageUrl&&U.contentPlane);if($?.contentImageUrl&&$.contentPlane?.length===4&&typeof Image<"u"){let U=new Image;U.crossOrigin="anonymous",U.onload=()=>{if(Z)return;let ee=$.contentPlane;ge=new lt(t,{position:{size:3,data:new Float32Array(ee.flat())},uv:{size:2,data:new Float32Array([0,1,1,1,0,0,1,0])},floorIndex:{size:1,data:new Float32Array(4).fill($.floorIndex)},index:{data:new Uint16Array([0,1,2,2,1,3])}}),he=new Ni(t,{image:U,generateMipmaps:!0,wrapS:t.CLAMP_TO_EDGE,wrapT:t.CLAMP_TO_EDGE,flipY:!1}),ce=new zi(t,{vertex:`#version 300 es
|
|
936
936
|
precision highp float;
|
|
937
937
|
in vec3 position; in vec2 uv; in float floorIndex;
|
|
938
938
|
uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform float uFocusFloor;
|
|
@@ -940,4 +940,4 @@ void main() {
|
|
|
940
940
|
void main(){ vUv=uv; vDim=(uFocusFloor < -0.5 || abs(floorIndex-uFocusFloor)<0.5)?0.0:1.0; gl_Position=projectionMatrix*modelViewMatrix*vec4(position,1.0); }`,fragment:`#version 300 es
|
|
941
941
|
precision highp float;
|
|
942
942
|
in vec2 vUv; in float vDim; uniform sampler2D uImage; out vec4 fragColor;
|
|
943
|
-
void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:he},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let q=new ct(t,{geometry:ge,program:ce});q.frustumCulled=!1,q.setParent(n),pe.screenProgram=ce,Y=!0,pe.drawCalls=3+(S?1:0)+1},U.src=$.contentImageUrl}return pe}import{Mesh as mn,RenderTarget as Ui,Transform as hn}from"ogl";function Wi(t,e,n){let r=t+(e<<8)+(n<<16);return r===0?-1:r-1}function lr(t,e,n,r,a,o){let i=-1,s=1/0;for(let l=0;l<n;l++)for(let c=0;c<e;c++){let f=(l*e+c)*4,h=Wi(t[f],t[f+1],t[f+2]);if(h<0||h>=o)continue;let u=c-r,m=l-a,d=u*u+m*m;d<s&&(s=d,i=h)}return i}function cr(t,e,n,r,a,o){let i=t-n.left,s=e-n.top,l=Math.round(i*r),c=Math.round((n.height-s)*r);return{x:Math.max(0,Math.min(a-1,l)),y:Math.max(0,Math.min(o-1,c))}}var Yi=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],Et=class{constructor(e,n,r,a,o){this.seatScene=new hn;this.chairScene=new hn;this.solidScene=new hn;this.target=null;this.restoreClear=[0,0,0];this.renderer=e,this.gl=e.gl,this.maxIndex=o,this.seatProg=jo(this.gl),this.chairProg=$o(this.gl),this.depthProg=Ko(this.gl);let i=new mn(this.gl,{geometry:n,program:this.seatProg});i.frustumCulled=!1,i.setParent(this.seatScene);let s=new mn(this.gl,{geometry:r,program:this.chairProg});s.frustumCulled=!1,s.setParent(this.chairScene);let l=new mn(this.gl,{geometry:a,program:this.depthProg});l.frustumCulled=!1,l.setParent(this.solidScene)}setRoomCentre(e){this.depthProg.uniforms.uRoomCentre.value.set(e??[0,0])}setRestoreClear(e){this.restoreClear=[e[0],e[1],e[2]]}syncFromSeatProgram(e){for(let a of Yi)this.seatProg.uniforms[a].value=e.uniforms[a].value;let n=e.uniforms.uFocusFloor.value;this.seatProg.uniforms.uFocusFloor.value=n,this.chairProg.uniforms.uFocusFloor.value=n,this.depthProg.uniforms.uFocusFloor.value=n;let r=e.uniforms.uSeeThrough?.value;if(r)for(let a of[this.seatProg,this.chairProg,this.depthProg])a.uniforms.uSeeThrough.value=r}ensureTarget(){let e=this.gl.drawingBufferWidth,n=this.gl.drawingBufferHeight;return this.target&&(this.target.width!==e||this.target.height!==n)&&this.destroyTarget(),this.target||(this.target=new Ui(this.gl,{width:e,height:n,depth:!0})),this.target}destroyTarget(){if(!this.target)return;let e=this.gl;this.target.buffer&&e.deleteFramebuffer(this.target.buffer);for(let n of this.target.textures??[])n.texture&&e.deleteTexture(n.texture);this.target.depthBuffer&&e.deleteRenderbuffer(this.target.depthBuffer),this.target=null}pick(e,n,r,a){let o=this.gl,i=this.ensureTarget(),s=o.drawingBufferWidth,l=o.drawingBufferHeight,c=Math.max(0,n-a),f=Math.max(0,r-a),h=Math.max(1,Math.min(s,n+a+1)-c),u=Math.max(1,Math.min(l,r+a+1)-f);o.enable(o.SCISSOR_TEST),o.scissor(c,f,h,u);let[m,d,y]=this.restoreClear;o.clearColor(0,0,0,1),this.renderer.render({scene:this.solidScene,camera:e,target:i,clear:!0}),this.renderer.render({scene:this.seatScene,camera:e,target:i,clear:!1}),this.renderer.render({scene:this.chairScene,camera:e,target:i,clear:!1}),o.clearColor(m,d,y,1),o.disable(o.SCISSOR_TEST);let v=new Uint8Array(h*u*4);return this.renderer.bindFramebuffer(i),o.readPixels(c,f,h,u,o.RGBA,o.UNSIGNED_BYTE,v),this.renderer.bindFramebuffer(),lr(v,h,u,n-c,r-f,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function ur(t,e){let n=[];for(let r of e)t.has(r.seatId)?t.set(r.seatId,Qn(r.state)):n.push(r);return n}function dr(t,e,n){let r=new Set;for(let i of e)(t.has(i)||n(i)!==void 0)&&r.add(i);let a=new Map(t),o=[];for(let[i,s]of t)r.has(i)||(o.push({seatId:i,state:ye[s]??"available"}),a.delete(i));for(let i of r){if(a.has(i))continue;let s=n(i);s!==void 0&&(a.set(i,s),o.push({seatId:i,state:"selected"}))}return{updates:o,next:a}}import{Quat as ut,Vec3 as ji}from"ogl";function Xi(t,e){return[t[0]-e[0],t[1]-e[1],t[2]-e[2]]}function mr(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function qi(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function hr(t){let e=Math.hypot(t[0],t[1],t[2]);return e>1e-6?[t[0]/e,t[1]/e,t[2]/e]:[0,0,0]}function pn(t){let e=Math.max(0,Math.min(1,t));return e*e*e*(e*(e*6-15)+10)}function fn(t,e){return Math.max(0,Math.min(1,t+e))}function pr(t,e){let n=t.length;if(n===0)return[0,0,0];if(n===1)return[...t[0]];let r=Math.max(0,Math.min(1,e)),a=n-1,o=Math.floor(r*a);o>=a&&(o=a-1);let i=r*a-o,s=t[Math.max(0,o-1)],l=t[o],c=t[o+1],f=t[Math.min(n-1,o+2)],h=i*i,u=h*i,m=[0,0,0];for(let d=0;d<3;d++)m[d]=.5*(2*l[d]+(-s[d]+c[d])*i+(2*s[d]-5*l[d]+4*c[d]-f[d])*h+(-s[d]+3*l[d]-3*c[d]+f[d])*u);return m}function vn(t,e,n,r,a){let o=hr(Xi(e,n));o[0]===0&&o[1]===0&&o[2]===0&&(o=[0,0,1]);let i=mr(mr(e,qi(o,2.5)),[0,1.5,0]),s=[e[0]-r[0],0,e[2]-r[2]],l=hr(s);l[0]===0&&l[2]===0&&(l=[o[0],0,o[2]]);let c=Math.max(1,a),f=[r[0]+l[0]*c*1.3,r[1]+c*.75,r[2]+l[2]*c*1.3];return{waypoints:[t,f,i],finalPos:i}}function bn(t,e,n=35,r=28){let a=pn(e),o=pr(t,a),i=pn(Math.max(0,Math.min(1,(e-.66)/.34)));return{pos:o,fov:n+(r-n)*i,eased:a}}function gr(t,e,n){let r=t.position.clone(),a=new ut().copy(t.quaternion);t.position.set(e[0],e[1],e[2]),t.lookAt(new ji(n[0],n[1],n[2]));let o=new ut().copy(t.quaternion);return t.position.copy(r),t.quaternion.copy(a),o}var Tt=class{constructor(e){this.active=!1;this.waypoints=[];this.startQuat=new ut;this.endQuat=new ut;this.outQuat=new ut;this.startTime=0;this.duration=2500;this.endFov=28;this.resolveFn=null;this.camera=e}start(e,n,r,a=2500,o=28){return this.settle(),this.waypoints=e,this.startQuat.copy(n),this.endQuat.copy(r),this.duration=a,this.endFov=o,this.startTime=performance.now(),this.active=!0,new Promise(i=>{this.resolveFn=i})}update(e){if(!this.active)return!1;let n=Math.min(1,(e-this.startTime)/this.duration),{pos:r,fov:a,eased:o}=bn(this.waypoints,n,35,this.endFov);return this.camera.position.set(r[0],r[1],r[2]),this.outQuat.copy(this.startQuat).slerp(this.endQuat,fn(o,.15)),this.camera.quaternion.copy(this.outQuat),this.camera.fov=a,this.camera.updateProjectionMatrix(),n>=1?(this.settle(),!1):!0}cancel(){this.settle()}settle(){this.active=!1;let e=this.resolveFn;this.resolveFn=null,e&&e()}};var yr=$n,$i=.12,Ki=1.6,xr=.12;function Sr(t,e,n){let r=t[e*3],a=t[e*3+1],o=t[e*3+2],i=n[0]-r,s=n[2]-o,l=Math.hypot(i,s);if(!(l>.001))return null;let c=i/l,f=s/l,h=1/0,u=null;for(let m=0;m*3<t.length;m++){if(m===e)continue;let d=t[m*3]-r,y=t[m*3+2]-o,v=d*c+y*f;v<.3||v>1.6||Math.abs(d*f-y*c)>.6||v<h&&(h=v,u=a-t[m*3+1])}return u}var Qi=.25,Zi=1.5;function wr(t,e,n=0,r,a,o=!1){let i=[e.x*ze,n+Zi,e.y*ze],s=a?[a[0],a[1],a[2]]:i,l=t[1],c=Number.isFinite(l)?l+(o?Ki:yr):Number.isFinite(r)?n+r:n+yr,f=i[0]-t[0],h=i[2]-t[2],u=Math.hypot(f,h),m=u>.001?Math.min($i,u*Qi):0,d=u>.001?f/u:0,y=u>.001?h/u:0;return{eye:[t[0]+d*m,c,t[2]+y*m],focal:s}}var Ee=Math.PI/180,Ji=45,gn=80,Rt=70,es=1,ts=.99;function ns(t,e){if(!(t<es))return gn;if(!(Number.isFinite(e)&&e>0))return Rt;let n=2*Math.atan(e/(2*_t*ts)/Math.max(.05,t))/Ee;return Math.max(Rt,Math.min(gn,n))}var os=.25,_t=1,rs=.25,as=12*Ee,is=.2,ss=1.5,Mr=.8,Ar=6,_r=1.9,ls=2/3,cs=.12,us=.9,ds=1.2,ms=2,Ir=.05,hs=6;function Dr(t,e,n=0){if(!t.length)return{min:[e[0]-6,n,e[2]-6],max:[e[0]+6,Math.max(n+Mr,e[1]),e[2]+6]};let r=1/0,a=-1/0,o=1/0,i=-1/0,s=n;for(let d of t)r=Math.min(r,d.cx-d.halfX),a=Math.max(a,d.cx+d.halfX),o=Math.min(o,d.cz-d.halfZ),i=Math.max(i,d.cz+d.halfZ),s=Math.max(s,d.y);let l=a-r,c=i-o,f=Math.max(l,Math.min(c,Ar))/2,h=Math.max(c,Math.min(l,Ar))/2,u=(r+a)/2,m=(o+i)/2;return{min:[u-f,n,m-h],max:[u+f,Math.max(n+Mr,s),m+h]}}function ps(t){return{min:[t.min[0],t.min[1],t.min[2]],max:[t.max[0],t.max[1]+_r,t.max[2]]}}function yn(t){let e=t.max[1];return[(t.min[0]+t.max[0])/2,Math.max(t.min[1]+ss,e+is,e+_r*ls),(t.min[2]+t.max[2])/2]}function Fr(t,e){let n=t[0]-e[0],r=t[2]-e[2],a=Math.hypot(n,r);return a<.001?{x:0,z:1}:{x:n/a,z:r/a}}function Pr(t,e,n){let r=e[0]-t[0],a=e[1]-t[1],o=e[2]-t[2],i=Math.hypot(r,a,o)||1;r/=i,a/=i,o/=i;let s=-o,l=r,c=Math.hypot(s,l);if(c<1e-6)return 1/0;s/=c,l/=c;let f=1/0,h=-1/0;for(let u=0;u<8;u++){let m=(u&1?n.max[0]:n.min[0])-t[0],d=(u&2?n.max[1]:n.min[1])-t[1],y=(u&4?n.max[2]:n.min[2])-t[2],v=Math.max(Ir,m*r+d*a+y*o),w=(m*s+y*l)/v;w<f&&(f=w),w>h&&(h=w)}return h-f}function Cr(t,e,n){let r=e[0]-t[0],a=e[1]-t[1],o=e[2]-t[2],i=Math.hypot(r,a,o)||1;r/=i,a/=i,o/=i;let s=-o,l=r,c=Math.hypot(s,l);if(c<1e-6)return 1/0;s/=c,l/=c;let f=-l*a,h=l*r-s*o,u=s*a,m=1/0,d=-1/0;for(let y=0;y<8;y++){let v=(y&1?n.max[0]:n.min[0])-t[0],w=(y&2?n.max[1]:n.min[1])-t[1],E=(y&4?n.max[2]:n.min[2])-t[2],C=Math.max(Ir,v*r+w*a+E*o),D=(v*f+w*h+E*u)/C;D<m&&(m=D),D>d&&(d=D)}return d-m}function It(t,e){return Math.tan(t*Ee/2)*Math.max(.05,e)}function Er(t,e,n){let r=ns(n,t),a=l=>Math.max(Ji,Math.min(r,l)),o=l=>2*Math.atan(l)/Ee,i=Number.isFinite(t)&&t>0?a(o(t/(2*os)/Math.max(.05,n))):r;if(!(Number.isFinite(e)&&e>0))return i;let s=Math.min(i,a(o(e/(2*cs))));return t/(2*It(s,n))>_t?i:s}function kr(t,e,n,r={}){let a=yn(e),o=[t[0],t[1],t[2]],i=0,s=0,l=d=>{if(!(d>0))return;let y=Fr(o,a);o[0]+=y.x*d,o[2]+=y.z*d,s+=d},c=r.preserveEye?0:e.max[1]+rs-o[1];c>0&&(o[1]+=c,i=c,l(c/Math.tan(as)));let f=ps(e),h=Pr(o,a,e),u=Er(h,Cr(o,a,f),n),m=h/(2*It(u,n));for(let d=0;!r.preserveEye&&d<hs&&m>_t;d++){let y=Math.max(1,Math.hypot(o[0]-a[0],o[2]-a[2])),v=Number.isFinite(m)?m/_t:2;l(Math.min(60,y*(Math.min(4,v)-1)+.5)),h=Pr(o,a,e),u=Er(h,Cr(o,a,f),n),m=h/(2*It(u,n))}return{eye:o,focal:a,fov:u,raisedM:i,pulledBackM:s,stageFrameWidth:m}}function fs(t,e,n){let r=Math.tan(e*Ee/2),a=It(e,n);return Math.max(1,t/Math.max(.05,Math.min(r,a)))}var vs=.7,Tr=.5,bs=.8;function Rr(t,e,n){let r=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],a=[n[0]-t[0],n[1]-t[1],n[2]-t[2]],o=r[0]*a[0]+r[1]*a[1]+r[2]*a[2],i=Math.hypot(r[0],r[1],r[2])*Math.hypot(a[0],a[1],a[2])||1;return Math.acos(Math.max(-1,Math.min(1,o/i)))/Ee}function gs(t,e,n){let r=c=>{let f=Math.hypot(c[0],c[1],c[2])||1;return[c[0]/f,c[1]/f,c[2]/f]},a=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],o=Math.hypot(a[0],a[1],a[2]),i=r(a),s=r([n[0]-t[0],n[1]-t[1],n[2]-t[2]]),l=r([0,1,2].map(c=>i[c]*(1-Tr)+s[c]*Tr));return[t[0]+l[0]*o,t[1]+l[1]*o,t[2]+l[2]*o]}function Lr(t,e){let{aspect:n,venue:r}=e,a=t.focal,o=Fr(t.eye,a),i=y=>(y[0]-a[0])*o.x+(y[2]-a[2])*o.z,s=[{name:"seat",eye:t.eye,focal:a,fov:t.fov}],l=ms*(e.rowDepthM??us),c=[t.eye[0]+o.x*l,t.eye[1]+ds,t.eye[2]+o.z*l],f=[t.eye[0],t.eye[1]-vs,t.eye[2]],h=gs(c,a,f);s.push({name:"row",eye:c,focal:h,fov:Math.min(gn,Math.max(t.fov,2*Math.max(Rr(c,h,f),Rr(c,h,a))/bs))});let u=(y,v,w,E)=>{let C=fs(w,t.fov,n)*1.08,D=C*Math.sin(E*Ee),A=Number.isFinite(e.seatingTopY)?e.seatingTopY+2:-1/0,R=Math.max(D,A-v[1]),L=C*Math.cos(E*Ee);return{name:y,eye:[v[0]+o.x*L,v[1]+R,v[2]+o.z*L],focal:v,fov:t.fov}};e.section&&e.section.radius>0&&s.push(u("section",e.section.center,e.section.radius,35)),s.push(u("venue",r.center,Math.max(1,r.radius),40));let m=[],d=-1/0;for(let y of s){let v=i(y.eye);m.length&&v<=d+.5||(m.push(y),d=v)}return m}import{Vec3 as ys}from"ogl";var mt=Math.PI/180,xn=320,Vr=70*mt,xs=32*mt,Ss=24*mt,Or=.0026,ws=.22,Ms=.006,As=180,Ps=900,Cs=1100,Es=4,ve=(t,e,n)=>Math.max(e,Math.min(n,t)),zr=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2;function Nr(t){let{canvas:e,camera:n}=t,r=[],a=!1,o=0,i=0,s=0,l=0,c=0,f=0,h=xn,u=null,m=()=>{u&&(clearTimeout(u),u=null)},d=!1,y=[0,0],v=0,w=!1,E=null,C=null,D=new Map,A=!1,R=0,L=0,b=0,F=0,x=()=>a&&r.length?r[ve(Math.round(o),0,r.length-1)].name:null,I=()=>{let M=x();M!==E&&(E=M,t.onStopChange?.(M))},z=()=>{if(!a||!r.length)return;let M=r[ve(Math.floor(o),0,r.length-1)],P=r[ve(Math.ceil(o),0,r.length-1)],S=ve(o-Math.floor(o),0,1),Y=(K,ne)=>K+(ne-K)*S,Z=[Y(M.eye[0],P.eye[0]),Y(M.eye[1],P.eye[1]),Y(M.eye[2],P.eye[2])],ge=[Y(M.focal[0],P.focal[0]),Y(M.focal[1],P.focal[1]),Y(M.focal[2],P.focal[2])],ce=ge[0]-Z[0],he=ge[1]-Z[1],oe=ge[2]-Z[2],xe=Math.hypot(ce,he,oe)||1,pe=Math.atan2(ce,oe),$=Math.asin(ve(he/xe,-1,1)),U=pe+i,ee=ve($+s,-80*mt,80*mt),q=Math.cos(ee)*xe;ce=Math.sin(U)*q,he=Math.sin(ee)*xe,oe=Math.cos(U)*q,n.position.set(Z[0],Z[1],Z[2]),n.fov=Y(M.fov,P.fov),n.updateProjectionMatrix(),n.lookAt(new ys(Z[0]+ce,Z[1]+he,Z[2]+oe)),t.onApplied?.()},_=()=>{if(!a||!r.length)return;let M=ve(Math.round(o),0,r.length-1);if(t.reducedMotion()){d=!1,o=M,z(),I(),t.requestRender();return}if(Math.abs(M-o)<.001){d=!1,I();return}l=o,c=M,f=performance.now(),h=xn,d=!0,t.requestRender()},O=M=>{!a||r.length<2||(m(),d=!1,o=ve(o+M,0,r.length-1),z(),I(),t.requestRender())},G=(M,P)=>{a&&(m(),d=!1,w=!1,i=ve(i-M*Or,-Vr,Vr),s=ve(s-P*Or,-Ss,xs),z(),t.requestRender())},B=M=>{a&&(D.set(M.pointerId,{x:M.clientX,y:M.clientY}),D.size===1?(A=!0,F=0,R=M.clientX,L=M.clientY):D.size===2&&(A=!1,b=W()))},W=()=>{let M=[...D.values()];return M.length<2?0:Math.hypot(M[0].x-M[1].x,M[0].y-M[1].y)},N=M=>{if(!a||!D.has(M.pointerId))return;if(D.set(M.pointerId,{x:M.clientX,y:M.clientY}),D.size>=2){let Y=W();b>0&&O((b-Y)*Ms),b=Y;return}if(!A)return;let P=M.clientX-R,S=M.clientY-L;R=M.clientX,L=M.clientY,F+=Math.abs(P)+Math.abs(S),!(F<=Es)&&G(P,S)},te=M=>{D.delete(M.pointerId)&&(D.size<2&&(b=0),D.size===0&&(A=!1,_()))},X=M=>{if(!a)return;M.preventDefault();let P=M.deltaMode===1?16:M.deltaMode===2?100:1,S=ve(M.deltaY*P/100,-2,2);O(S*ws),C&&clearTimeout(C),C=setTimeout(()=>{C=null,_()},As)},J=()=>{m(),a&&(a=!1,d=!1,w=!1,r=[],D.clear(),A=!1,C&&(clearTimeout(C),C=null),E!==null&&(E=null,t.onStopChange?.(null)))};return e.addEventListener("pointerdown",B),e.addEventListener("pointermove",N),e.addEventListener("pointerup",te),e.addEventListener("pointercancel",te),e.addEventListener("wheel",X,{passive:!1}),{get active(){return a},enter(M,P=0){if(M.length<2){J();return}m(),r=M,a=!0,o=t.reducedMotion()?0:ve(P,0,M.length-1),o>0&&(u=setTimeout(()=>{u=null,a&&(l=o,c=0,f=performance.now(),h=Cs,d=!0,t.requestRender())},Ps)),i=0,s=0,d=!1,w=!1,E=null,z(),I(),t.requestRender()},exit:J,recentre(){return a?Math.abs(i)<1e-4&&Math.abs(s)<1e-4?!0:t.reducedMotion()?(w=!1,i=0,s=0,z(),t.requestRender(),!0):(y=[i,s],v=performance.now(),w=!0,t.requestRender(),!0):!1},update(M){if(!a)return!1;let P=!1;if(w){let S=ve((M-v)/xn,0,1),Y=1-zr(S);i=y[0]*Y,s=y[1]*Y,S>=1?(w=!1,i=0,s=0):P=!0}if(d){let S=ve((M-f)/h,0,1);o=l+(c-l)*zr(S),S>=1?(d=!1,o=c,I()):P=!0}return z(),P},currentStop:x,dispose(){J(),e.removeEventListener("pointerdown",B),e.removeEventListener("pointermove",N),e.removeEventListener("pointerup",te),e.removeEventListener("pointercancel",te),e.removeEventListener("wheel",X)}}}function Hr(t){return t.flying?"cinematic":t.panoramaMounted?"panorama":t.seatViewActive?"seatView":"orbit"}var Sn=null;function Gr(){return Sn??=import("../openPanorama-VD6PE3YZ.js").catch(t=>{throw Sn=null,t}),Sn}var Br=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),Dt=class{constructor(e){this.orbitLatched=!1;this.panoramaOpenedAt=0;this.cb=e}emit(e,n){if(this.cb)try{this.cb(e,n)}catch{}}opened(e,n,r,a){this.emit("3d_opened",{seats:e,hasHeights:n,...r===void 0?{}:{buildMs:Math.round(r)},...a===void 0?{}:{prepSource:a}})}orbitEngaged(){this.orbitLatched||(this.orbitLatched=!0,this.emit("3d_orbit_engaged"))}seatPicked(e,n){this.emit("3d_seat_picked",{seatId:e,sectionId:n})}cinematicPlayed(e){this.emit("3d_cinematic_played",{durationMs:e,reducedMotion:!1})}cinematicSkipped(){this.emit("3d_cinematic_skipped",{reducedMotion:!0})}cinematicCancelled(){this.emit("3d_cinematic_cancelled")}panoramaOpened(){this.panoramaOpenedAt=Br(),this.emit("3d_panorama_opened")}panoramaClosed(){let e=this.panoramaOpenedAt?Math.round(Br()-this.panoramaOpenedAt):0;this.panoramaOpenedAt=0,this.emit("3d_panorama_closed",{viewMs:e})}panoramaFailed(e,n){this.emit("3d_panorama_failed",{seatId:e,phase:n})}panoramaFallback(e){this.emit("3d_panorama_fallback",{seatId:e})}contextLost(){this.emit("3d_context_lost")}contextRestored(){this.emit("3d_context_restored")}};function Wr(t){let e=t.style.position;return getComputedStyle(t).position!=="static"?()=>{}:(t.style.position="relative",()=>{t.style.position==="relative"&&(t.style.position=e)})}function Ur(t){let{container:e,model:n,opts:r,expandedSeatById:a,seatIdsByRow:o,isNarrow:i}=t,s=null,l=()=>{if(!s)return;let h=i();Object.assign(s.style,h?{left:"12px",right:"12px",bottom:"70px",transform:"none",justifyContent:"center"}:{left:"50%",right:"auto",bottom:"18px",transform:"translateX(-50%)",justifyContent:"initial"})},c=()=>{s?.remove(),s=null};return{show:(h,u,m=!1)=>{if(c(),t.isDisposed())return null;let d=document.createElement("div");d.setAttribute("role","group"),Object.assign(d.style,{position:"absolute",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",zIndex:"4"});let y=r.chrome?.caption!==!1,v=r.chrome?.seatStepper!==!1;if(!y&&!v)return null;let w=a.get(h),E=w?.sectionId?n.sections.find(x=>x.id===w.sectionId):void 0,C=w?.label??h;d.setAttribute("aria-label",`Explore views near ${E?.label?`${E.label}, `:""}seat ${C}`);let D=document.createElement("span");D.textContent=r.seatViewCaption?.(h)??["Live 3D seat view",E?.label,C].filter(Boolean).join(" \xB7 "),Object.assign(D.style,{maxWidth:"min(70vw, 560px)",padding:"5px 10px",borderRadius:"999px",overflow:"hidden",color:"#d9e3f5",background:"rgba(12,18,32,0.72)",font:"600 11px/1.2 inherit",textOverflow:"ellipsis",whiteSpace:"nowrap",backdropFilter:"blur(6px)"}),y&&d.appendChild(D);let A=document.createElement("div");Object.assign(A.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),d.appendChild(A);let R=w?.rowId?o.get(w.rowId):void 0,L=R?.indexOf(h)??-1,b=L>=0?[R?.[L-1],R?.[L+1]]:[void 0,void 0],F=(x,I,z,_=!1)=>{let O=document.createElement("button");O.type="button",O.textContent=x,O.setAttribute("aria-label",I),Object.assign(O.style,{minHeight:"44px",padding:_?"10px 16px":"10px",borderRadius:"999px",background:"rgba(12,18,32,0.78)",color:"#eef1f8",border:"1px solid rgba(150,165,205,0.4)",backdropFilter:"blur(6px)",font:"600 13px/1 inherit",cursor:"pointer",whiteSpace:"nowrap"}),_||(O.style.minWidth="44px"),_&&(O.dataset.panoramaTrigger=""),O.addEventListener("click",z),A.appendChild(O)};if(v&&b[0]){let x=a.get(b[0])?.label??b[0];F("\u2039",`View previous seat ${x}`,()=>{t.flyToSeat(b[0])})}if(v&&r.getSeatView){let x=r.seatViewActionLabel?.(h)??"Open 360\xB0 panorama";F(m?`\u21BB Retry ${x}`:`\u25C9 ${x}`,`${m?"Retry":x} from seat ${C}`,()=>{if(t.isDisposed()||u!==t.flightGen()){c();return}c(),t.openPanorama(h,400,u)},!0)}if(v&&b[1]){let x=a.get(b[1])?.label??b[1];F("\u203A",`View next seat ${x}`,()=>{t.flyToSeat(b[1])})}return!A.childElementCount&&!y?null:(e.appendChild(d),s=d,l(),d)},remove:c,layout:l}}var Ts={rotate:"Drag to rotate the venue",move:"Drag to move the venue",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Show whole venue"};function Yr(t){let{container:e,orbit:n,isNarrow:r}=t,a={...Ts,...t.labels??{}},o=(A,R)=>{A.setAttribute("aria-label",R),A.title=R},i=document.createElement("div"),s=!1;i.className="sl-3d-navigation-controls",Object.assign(i.style,{position:"absolute",right:"14px",bottom:"14px",display:"flex",zIndex:"4",flexDirection:"column",alignItems:"flex-end",gap:"7px"});let l=document.createElement("div");l.setAttribute("role","group"),l.setAttribute("aria-label","3D drag mode"),Object.assign(l.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let c=document.createElement("div");c.setAttribute("role","group"),c.setAttribute("aria-label","3D view controls"),Object.assign(c.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let f=document.createElement("button");f.type="button",f.textContent="\u21BB",o(f,a.rotate);let h=document.createElement("button");h.type="button",h.textContent="\u2725",o(h,a.move);let u=document.createElement("button");u.type="button",u.textContent="\u2212",o(u,a.zoomOut);let m=document.createElement("button");m.type="button",m.textContent="+",o(m,a.zoomIn);for(let A of[f,h,u,m])A.className="sl-3d-icon-control",Object.assign(A.style,{width:"44px",minWidth:"44px",minHeight:"44px",padding:"9px",border:"1px solid rgba(150,165,205,0.35)",borderRadius:"999px",color:"#c9d4ea",background:"rgba(12,18,32,0.82)",font:"600 17px/1 inherit",backdropFilter:"blur(6px)",cursor:"pointer",whiteSpace:"nowrap"});l.append(f,h),c.append(m,u);let d=null,y=()=>{let A=n.dragAction();if(A===d)return;d=A;let R=A==="orbit";f.setAttribute("aria-pressed",String(R)),h.setAttribute("aria-pressed",String(!R)),f.style.background=R?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",h.style.background=R?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",i.title=R?`${a.rotate} \xB7 ${a.move} with Shift`:`${a.move} \xB7 ${a.rotate} with Shift`},v=A=>{n.setPrimaryDragMode(A),y()};f.addEventListener("click",()=>v("orbit")),h.addEventListener("click",()=>v("pan"));let w=()=>{let{atMin:A,atMax:R}=n.dollyLimitState();m.disabled!==A&&(m.disabled=A),u.disabled!==R&&(u.disabled=R)};u.addEventListener("click",()=>{n.zoomBy(ot),w()}),m.addEventListener("click",()=>{n.zoomBy(He),w()}),i.append(l,c),v("auto"),e.appendChild(i);let E=t.enabled!==!1,C=()=>{let A=r();i.style.display=s||!E?"none":"flex",i.style.right=A?"12px":"14px",i.style.bottom=A?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",l.style.display=A?"none":"flex",m.style.display=A?"none":"",u.style.display=A?"none":""};return C(),{element:i,utilityControls:c,setNavigationMode:v,syncNavigationMode:y,syncZoomLimits:w,setSeatViewLocked:A=>{s=A,n.setInteractionEnabled(!A),C()},seatViewLocked:()=>s,layout:C}}var Rs=.5,Xr=12,qr=20,_s=28;function Is(t,e,n){return!(t>0)||!(n>0)?0:Rs*n/(2*t*Math.tan(e*Math.PI/360))}function jr(t){let{glctx:e,orbit:n,model:r,seats:a,opts:o,cinematic:i,analytics:s,seatIdByIndex:l,sectionIdBySeatId:c,tapSlop:f,tapMs:h,cancelFlight:u,focusSectionCamera:m,setSelection:d,ensureSeatView:y}=t,v=0,w=0,E=0,C=-1,D=!1,A=!1,R=_=>{t.seatViewLocked()||C===-1&&(C=_.pointerId,v=_.clientX,w=_.clientY,E=performance.now(),D=!1,A=i.active,i.active&&(s.cinematicCancelled(),u(),o.onViewTargetChange?.(null)))},L=_=>{_.pointerId===C&&Math.hypot(_.clientX-v,_.clientY-w)>f&&(D=!0)},b=(_,O,G,B,W)=>{let N=e.canvas.getBoundingClientRect(),te=e.canvas.clientWidth||N.width||1,X=e.canvas.clientHeight||N.height||1,J=_-N.left,M=O-N.top,P=B*B,S=-1,Y=P,Z=1/0;for(let ge of a){if(G&&ge.sectionId!==G)continue;let ce=r.seats.idToIndex.get(ge.id);if(ce===void 0)continue;if(W){let U=Math.round(r.seats.iState[ce]??0);if(U!==0&&U!==3)continue}let he=ce*3,oe=Ae(n.camera.projectionViewMatrix,[r.seats.iPosition[he],r.seats.iPosition[he+1]+.55,r.seats.iPosition[he+2]],te,X);if(!oe.visible)continue;let xe=oe.x-J,pe=oe.y-M,$=xe*xe+pe*pe;($<Y||Math.abs($-Y)<1&&oe.depth<Z)&&(S=ce,Y=$,Z=oe.depth)}return S},F=(_,O)=>{let G=t.gpu(),B=t.pick();if(!G||!B)return-1;B.syncFromSeatProgram(G.seatProgram);let W=e.canvas.getBoundingClientRect(),N=e.renderer.dpr,{x:te,y:X}=cr(_,O,W,N,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),J=Math.max(2,Math.round(8*N));return B.pick(n.camera,te,X,J)},x=()=>e.canvas.clientHeight||e.canvas.getBoundingClientRect().height,I=(_,O=Xr)=>{let G=n.camera?.position;if(!G)return!1;let B=_*3,W=Math.hypot(G.x-r.seats.iPosition[B],G.y-r.seats.iPosition[B+1],G.z-r.seats.iPosition[B+2]);return Is(W,n.fovY,x())>=O};return{onDown:R,onMove:L,onUp:_=>{if(_.pointerId!==C)return;let O=!D&&performance.now()-E<h;if(C=-1,A){A=!1;return}let G=t.gpu(),B=t.pick();if(!O||!G||!B)return;let W=F(_.clientX,_.clientY),N=_.pointerType==="touch"||_.pointerType==="pen",te=N?qr:Xr,X=W>=0&&I(W,te),J=!1;if(t.focusedSectionId()&&W>=0){let S=l[W],Y=S?c.get(S):void 0;if(Y&&Y!==t.focusedSectionId()&&m(Y,{keepCamera:X})){if(!X)return;J=!0}}if(t.focusedSectionId()&&W<0&&(W=b(_.clientX,_.clientY,t.focusedSectionId(),44,!1)),t.focusedSectionId()&&W<0){let S=b(_.clientX,_.clientY,null,72,!1),Y=S>=0?l[S]:void 0,Z=Y?c.get(Y):void 0;if(Z&&Z!==t.focusedSectionId()&&m(Z))return}if(!t.focusedSectionId()){W<0&&(W=b(_.clientX,_.clientY,null,42,!1));let S=W>=0?l[W]:void 0,Y=S?c.get(S):void 0;if(Y&&m(Y,{keepCamera:X})){if(!X)return;J=!0}}if(W<0||W>=l.length){t.selection().size&&(d([]),o.onViewTargetChange?.(null));return}let M=l[W];if(N&&t.focusedSectionId()&&!J&&!I(W,qr)){t.focusSeatCamera(M,{seatPx:_s,viewportHeightPx:x()});return}let P=ye[Math.round(r.seats.iState[W]??0)]??"available";if(P!=="available"&&P!=="selected"){o.onSeatInspect?.(M,P);return}if(t.selection().has(M)&&t.selection().size===1){d([]),o.onViewTargetChange?.(null),o.onSeatPick?.(M);return}d([M]),y(M),s.seatPicked(M,c.get(M)),o.onSeatPick?.(M)}}}var Ft=class{constructor(e,n){this.minX=0;this.minZ=0;this.cell=1;this.cols=1;this.rows=1;this.cellStart=null;this.cellItems=null;this.iPosition=e,this.count=n}ensureGrid(){if(this.cellStart||this.count===0)return;let e=this.iPosition,n=1/0,r=1/0,a=-1/0,o=-1/0;for(let m=0;m<this.count;m++){let d=e[m*3],y=e[m*3+2];d<n&&(n=d),d>a&&(a=d),y<r&&(r=y),y>o&&(o=y)}let i=Math.max(a-n,.001),s=Math.max(o-r,.001);this.cell=Math.max(Math.sqrt(i*s*4/this.count),.25),this.cols=Math.max(1,Math.ceil(i/this.cell)+1),this.rows=Math.max(1,Math.ceil(s/this.cell)+1),this.minX=n,this.minZ=r;let l=this.cols*this.rows,c=new Int32Array(l+1),f=m=>{let d=Math.min(this.cols-1,Math.max(0,Math.floor((e[m*3]-n)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((e[m*3+2]-r)/this.cell)))*this.cols+d};for(let m=0;m<this.count;m++)c[f(m)+1]++;for(let m=0;m<l;m++)c[m+1]+=c[m];let h=new Int32Array(this.count),u=c.slice(0,l);for(let m=0;m<this.count;m++)h[u[f(m)]++]=m;this.cellStart=c,this.cellItems=h}gather(e,n,r,a,o){this.ensureGrid();let i=this.cellStart,s=this.cellItems;if(!i||!s)return 0;let l=a.length,c=r*r,f=Math.floor((e-this.minX)/this.cell),h=Math.floor((n-this.minZ)/this.cell),u=Math.ceil(r/this.cell)+1,m=this.iPosition,d=0;for(let y=0;y<=u&&d<l;y++){let v=h-y,w=h+y,E=f-y,C=f+y;for(let D=v;D<=w&&d<l;D++){if(D<0||D>=this.rows)continue;let A=D===v||D===w;for(let R=E;R<=C&&d<l;R++){if(!A&&R!==E&&R!==C){R=C-1;continue}if(R<0||R>=this.cols)continue;let L=D*this.cols+R;for(let b=i[L],F=i[L+1];b<F&&d<l;b++){let x=s[b],I=m[x*3]-e,z=m[x*3+2]-n,_=o===void 0?0:m[x*3+1]-o;I*I+_*_+z*z<=c&&(a[d++]=x)}}}}return d}};var kt=class{constructor(e){this.ctx=e;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array(At);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.lastGatherY=1/0;this.nearIndex=new Ft(e.model.seats.iPosition,e.model.seats.count)}forceRegather(){this.lastGatherX=1/0}setDetailEnabled(e){let n=this.ctx.gpu();e||(this.detailVisible=!1),this.lastGatherX=1/0,this.lastGatherZ=1/0,!e&&n?.nearSeatCount()&&n.setNearSeats(this.nearBuf,0)}update(e){let{model:n}=this.ctx,r=this.ctx.gpu();if(!r)return;if(!e){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let a=this.ctx.orbit().camera.position;if(Math.hypot(a.x-this.lastGatherX,a.y-this.lastGatherY,a.z-this.lastGatherZ)<rn)return;if(this.lastGatherX=a.x,this.lastGatherY=a.y,this.lastGatherZ=a.z,Math.hypot(a.x-n.bounds.center[0],a.y-n.bounds.center[1],a.z-n.bounds.center[2])-n.bounds.radius>on){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let s=this.nearIndex.gather(a.x,a.z,on,this.nearBuf,a.y);s===0&&r.nearSeatCount()===0||r.setNearSeats(this.nearBuf,s)}ease(e,n,r){let a=1-Math.exp(-e*9),o=1-Math.exp(-e*20);this.seatDetailMix+=(n-this.seatDetailMix)*(n>this.seatDetailMix?a:o),this.structureDetailMix+=(r-this.structureDetailMix)*(r>this.structureDetailMix?a:o),Math.abs(n-this.seatDetailMix)<.01&&(this.seatDetailMix=n),Math.abs(r-this.structureDetailMix)<.01&&(this.structureDetailMix=r)}};function $r(t){let e=Math.max(5,t.radius),n=t.focalWorld[0]-t.center[0],r=t.focalWorld[2]-t.center[2],a=Math.hypot(n,r);if(a<e*.12)return{center:t.center,radius:e,polarDeg:48};let o=Math.min(a*.25,e*.2);return{center:[t.center[0]+n/a*o,t.center[1],t.center[2]+r/a*o],radius:e+o,polarDeg:50}}import{Quat as Ds,Vec3 as Fs}from"ogl";function Kr(){let t="http://www.w3.org/2000/svg",e=document.createElementNS(t,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("width","18"),e.setAttribute("height","18"),e.setAttribute("aria-hidden","true"),e.setAttribute("focusable","false"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round");let n=document.createElementNS(t,"path");return n.setAttribute("d","M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 0 2 2v3M8 21H5a2 2 0 0 0-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3"),e.appendChild(n),e}function Qr(t){let{container:e,model:n,opts:r,orbit:a,cinematic:o,analytics:i,loop:s,labelOverlay:l,stageAzimuth:c,overviewFraming:f}=t,h=0,u=-1,m=(x,I,z=28)=>{a.camera.position.set(x[0],x[1],x[2]),a.camera.lookAt(new Fs(I[0],I[1],I[2])),a.camera.fov=z,a.camera.updateProjectionMatrix()},d=document.createElement("button");d.className="sl-3d-overview-control sl-3d-icon-control",d.type="button",d.replaceChildren(Kr());let y=r.navLabels?.fitView??"Show whole venue";d.setAttribute("aria-label",y),d.title=y,Object.assign(d.style,{width:"44px",minWidth:"44px",minHeight:"44px",padding:"9px",borderRadius:"999px",background:"rgba(12,18,32,0.72)",color:"#c9d4ea",border:"1px solid rgba(150,165,205,0.35)",backdropFilter:"blur(6px)",font:"600 11px/1 inherit",cursor:"pointer",whiteSpace:"nowrap"});let v=()=>{d.firstElementChild||d.replaceChildren(Kr())};v();let w=x=>{u=x;let I=t.gpu();I&&(I.seatProgram.uniforms.uFocusFloor.value=x,I.solidProgram.uniforms.uFocusFloor.value=x,I.chairProgram.uniforms.uFocusFloor.value=x),t.showSectionSeatLabels(null)},E=null,C=!1,D=()=>{if(E=null,C=!1,t.setSeeThrough?.(null),t.isDisposed())return;r.onViewTargetChange?.(null),r.onSectionFocusChange?.(null),t.panorama()&&(t.panorama().dispose(),t.setPanorama(null),i.panoramaClosed()),t.setPanoramaSphereVisible(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),t.restorePanoramaLayer(),d.style.display="",l.setVisible(!0),t.setFrozen(!1);let x=u>=0?n.floors[u]:null;if(t.setNearFieldDetailEnabled(!!x),t.setSeatViewLocked(!1),A(),t.removeArriveChip(),t.setNavigationMode("auto"),x){let I=x.focalWorld[0]-x.center[0],z=x.focalWorld[2]-x.center[2],_=Math.hypot(I,z)>x.radius*.12?Math.atan2(I,z):c,O={center:x.center,radius:x.radius,box:x.box},G={polarDeg:58,margin:1.12};t.reducedMotion()?a.frame(O,!1,_,!1,G):a.frameSoft(O,_,!1,G)}else t.reducedMotion()?a.frame(n.bounds,!1,c,r.portraitOverviewCrop===!0,f):a.frameSoft(n.bounds,c,r.portraitOverviewCrop===!0,f);l.setOverviewDistance(a.targetDistance),t.showSectionSeatLabels(null),s.requestRender()},A=()=>{h++,t.setSeatStepping(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),o.active&&(o.cancel(),a.resumeAfterFlight(n.focalWorld))},R=x=>{if(t.isDisposed()||!t.gpu())return Promise.resolve();let I=n.seats.idToIndex.get(x);if(I===void 0)return Promise.resolve();t.setNearFieldDetailEnabled(!0),r.onViewTargetChange?.(x),t.panorama()&&(t.panorama().dispose(),t.setPanorama(null),t.setPanoramaSphereVisible(!1),d.style.display="",t.restorePanoramaLayer()),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),t.setFrozen(!1);let z=t.inSeatView()&&r.arriveAtSeatEye===!0;t.setSeatStepping(z),t.setSeatViewLocked(!1);let _=++h;z?t.showArriveChip(x,_):t.removeArriveChip();let{eye:O,focal:G}=t.resolvedSeatViewPose(x,I),B=r.arriveAtSeatEye?t.seatViewArrival(x,I):null,W=B&&B.stops.length>1&&B.stops[1].name==="row"?B.stops[1]:null,N=B?B.focal:G,te=[a.camera.position.x,a.camera.position.y,a.camera.position.z],X=vn(te,B?.eye??O,N,n.bounds.center,n.bounds.radius),J=W?W.eye:B?B.eye:r.arriveAtSeatEye?O:X.finalPos,M=B?B.fov:r.arriveAtSeatEye?e.clientWidth/Math.max(1,e.clientHeight)<.7?Rt:65:28,P=[X.waypoints[0],X.waypoints[1],J];if(l.setVisible(!1),t.reducedMotion())return t.setSeatStepping(!1),m(J,N,M),s.requestRender(),i.cinematicSkipped(),t.isDisposed()||a.syncFromCamera(),t.setSeatViewLocked(r.arriveAtSeatEye===!0),B&&t.enterSeatView(B.stops),t.showArriveChip(x,_),Promise.resolve();let S=new Ds().copy(a.camera.quaternion),Y=gr(a.camera,J,N);s.requestRender();let Z=z?700:2500;return o.start(P,S,Y,Z,M).then(()=>{t.isDisposed()||_!==h||(t.setSeatStepping(!1),i.cinematicPlayed(Z),a.resumeAfterFlight(N),t.setSeatViewLocked(r.arriveAtSeatEye===!0),B&&t.enterSeatView(B.stops,W?1:0),s.requestRender(),t.showArriveChip(x,_))})},L=(x,I)=>{let z=n.sections.find(_=>_.id===x);if(!z||z.seatCount===0)return!1;if(E=x,C=!1,t.setSeeThrough?.(null),t.setNearFieldDetailEnabled(!0),t.setSeatStepping(!1),t.setSeatViewLocked(!1),o.cancel(),t.removeArriveChip(),n.floors.length>1&&u!==z.floorIndex&&w(z.floorIndex),t.setNavigationMode("auto"),t.panorama()||l.setVisible(!0),t.showSectionSeatLabels(x),!I?.keepCamera){let _=$r(z),O={polarDeg:_.polarDeg,margin:1.12};t.reducedMotion()?a.frame({center:_.center,radius:_.radius},!1,a.currentAzimuth,!1,O):a.glideTo({center:_.center,radius:_.radius},O)}return r.onSectionFocusChange?.(x),s.requestRender(),!0},b=(x,I)=>{if(t.isDisposed()||!t.gpu())return!1;let z=n.seats.idToIndex.get(x);if(z===void 0)return!1;let _=z*3,O=[n.seats.iPosition[_],n.seats.iPosition[_+1]+.55,n.seats.iPosition[_+2]],G=I?ks(I,a.fovY,a.camera.aspect||1):Zr;return C=!0,t.setSeeThrough?.(O),t.reducedMotion()?a.frame({center:O,radius:G},!1,void 0,!1,wn):a.frameSoft({center:O,radius:G},void 0,!1,wn),s.requestRender(),!0},F=()=>{if(t.isNarrow?.()&&C&&E&&L(E)){s.requestRender();return}D()};return d.addEventListener("click",F),{overviewChip:d,layoutOverviewChip:v,flightGen:()=>h,focusedFloor:()=>u,applyFloorFocus:w,placeCameraFinal:m,cancelFlight:A,focusOverview:D,flyToSeat:R,focusSectionCamera:L,focusSeatCamera:b}}var Zr=4.5;function ks(t,e,n){let r=Math.tan(e*Math.PI/360),a=r*Math.max(.001,n),i=Ls*t.viewportHeightPx/(2*Math.max(1,t.seatPx)*r)*Math.min(r,a)/wn.margin;return Math.max(Vs,Math.min(Zr,i))}var Ls=.5,Vs=1.5,wn={polarDeg:48,margin:1.25};function Mn(t,e,n,r,a,o,i,s,l=.5){let c=-1,f=s*s,h=1/0;for(let u=0;u<e;u++){let m=u*3,d=Ae(n,[t[m],t[m+1]+l,t[m+2]],r,a);if(!d.visible)continue;let y=d.x-o,v=d.y-i,w=y*y+v*v;(w<f-4||w<f+4&&d.depth<h)&&(c=u,f=Math.min(f,w),h=d.depth)}return c}function Jr(t){let e=performance.now(),{input:n,estimate:r}=ho(t);return{model:nt(n),buildMs:performance.now()-e,source:"main",...r?{estimate:r}:{}}}function Os(t){let e=Wn(t.doc);return{...Jr({...t,seats:e}),seats:e}}function ea(t,e,n){let r=o=>({...e(),fallbackReason:o});if(typeof Worker>"u")return Promise.resolve(r("unavailable"));let a;try{a=new Worker(new URL("./scene/scene.worker.js",import.meta.url),{type:"module"})}catch{return Promise.resolve(r("unavailable"))}return new Promise(o=>{let i=!1,s=f=>{i||(i=!0,clearTimeout(c),a.terminate(),o(f))},l=f=>s(r(f)),c=window.setTimeout(()=>l("timeout"),15e3);a.onerror=()=>l("worker_error"),a.onmessage=f=>{let h=n(f.data);h?s(h):l("bad_response")},a.postMessage(t)})}function zs(t){return ea(t,()=>Jr(t),({model:e,buildMs:n,estimate:r})=>({model:e,buildMs:n,source:"worker",...r?{estimate:r}:{}}))}function Ns(t){return ea(t,()=>Os(t),({model:e,buildMs:n,seats:r,estimate:a})=>r?{model:e,buildMs:n,seats:r,source:"worker",...a?{estimate:a}:{}}:null)}var Gs=40,Bs=48,Ws=Math.PI/180,Us=6,Ys=500,Xs=6;function yu(t,e,n={}){let r=performance.now(),a=e.prepared?e.prepared.estimate:e.estimate===!1?null:Qt(e.doc,e.seats);a&&(e={...e,doc:a.doc,seats:mo(e.seats,a)});let o=e.prepared?.model??nt(e),i=new Dt(n.onAnalytics),s=new Array(o.seats.count);for(let[p,g]of o.seats.idToIndex)s[g]=p;let l=new Map(e.seats.map(p=>[p.id,p])),c=new Map;for(let p of e.seats){if(!p.rowId)continue;let g=c.get(p.rowId);g?g.push(p.id):c.set(p.rowId,[p.id])}let f=new Map,h=[0,0,0,0];function u(){if(v)for(let p of[v.seatProgram,v.solidProgram,v.chairProgram])p.uniforms.uSeeThrough.value=h}e.seats.forEach((p,g)=>{f.set(p.id,o.seatSectionIds?.[g]??p.sectionId)});let m=new Map;for(let[p,g]of o.seats.idToIndex){let T=f.get(p);if(!T)continue;let V=m.get(T);V?V.push(g):m.set(T,[g])}let d=()=>{if(!v||!o.sectionSolidRanges.length)return;let{lit:p,anyUnlit:g}=nr(o.sectionSolidRanges,m,o.seats.iState);v.setSectionShellLit(g?p:null)},y=e.doc.floors?.some(g=>(g.baseHeightM??0)>0)?!0:(e.doc.floors?.flatMap(g=>g.objects)??e.doc.objects).some(g=>g.type==="section"&&((g.height??0)>0||(g.rake??0)>0)),v=null,w=null,E=null,C=!1,D=!1,A=!1,R=new Map,L=null,b=null,F=null,x=new Map,I=null,z=()=>{F===null&&(F=t.style.zIndex,t.style.zIndex="20")},_=()=>{F!==null&&(t.style.zIndex==="20"&&(t.style.zIndex=F),F=null)},O=!1,G=()=>O?fe.focusedFloor():-1,B=()=>{v=sr(P.gl,o),w?.dispose(),w=Fo(P.gl,[1,1,1],o.theme.seatStates.selected),In(!1),d(),An(),E=new Et(P.renderer,v.seatGeometry,v.chairGeometry,v.solidGeometry,o.seats.count),P.setClearColor(o.theme.background.top),E.setRestoreClear(o.theme.background.top),E.setRoomCentre(o.room?.centre),v.seatProgram.uniforms.uSeatRadius.value=et*o.theme.seatScale,v.seatProgram.uniforms.uFocusFloor.value=G(),v.solidProgram.uniforms.uFocusFloor.value=G(),v.chairProgram.uniforms.uFocusFloor.value=G(),v.screenProgram&&(v.screenProgram.uniforms.uFocusFloor.value=G()),u(),N.forceRegather()},W=!1,N=new kt({model:o,orbit:()=>S,gpu:()=>v}),te=!1,X=new Map,J=24,M=p=>N.setDetailEnabled(p),P=new St(t,{onContextLost:()=>{A||i.contextLost(),C=!0,ie.stop(),v=null,E=null},onContextRestored:()=>{B(),C=!1,A||i.contextRestored(),ie.requestRender()}}),S=new wt(P.gl,P.canvas,()=>ie.requestRender(),()=>i.orbitEngaged());S.setAspect(P.aspect);let Y=(e.doc.floors?.flatMap(p=>p.objects)??e.doc.objects).some(p=>p.type==="section"&&p.physical3dProvenance?.surfaceKind?.status==="inferred"),Z=(()=>{if(Number.isFinite(n.overviewAzimuthDeg))return n.overviewAzimuthDeg*Math.PI/180;if(!(Y&&o.stages.length===0))return po(o.focalWorld,o.seats.iPosition,o.bounds)})(),ge=(e.doc.floors?.flatMap(p=>p.objects)??e.doc.objects).some(p=>p.type==="shape"&&p.stageKind?.startsWith("pitch-")),ce=o.floors.length>1?{polarDeg:48,margin:1.1}:{polarDeg:ge?36:48,margin:1.05},he=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;S.frame(o.bounds,!he&&n.skipInitialOverviewAnimation!==!0,Z,n.portraitOverviewCrop===!0,ce);let oe=new Tt(S.camera),xe=Wr(t),pe=fo(t,o),$=new Pt(t,{fontFamily:e.doc.theme?.fontFamily,ink:e.doc.theme?.textColor,backgroundRgb:o.theme.background.top}),U=o.labels,ee=()=>to(U,o.floors.length,G());$.setLabels(ee()),$.setOverviewDistance(S.targetDistance);let q=()=>{let p=new Map,g=ye.indexOf("available");for(let T of U){if(!T.wheelchairSeats)continue;let V=0;for(let H of T.wheelchairSeats)o.seats.iState[H]===g&&V++;V>0&&p.set(T.id,V)}return $.setWheelchairFree(p)};q();let K=null,ne=()=>[...R.keys()].flatMap(p=>{let g=o.seats.idToIndex.get(p),T=g===void 0?void 0:e.seats[g];if(g===void 0||T?.id!==p)return[];let V=g*3;return[{id:`seat:${p}`,kind:"seat",seatWidthM:o.seats.iChairWidth[g]*2,text:T.displayLabel||T.label,anchor:[o.seats.iPosition[V],o.seats.iPosition[V+1]+1.05,o.seats.iPosition[V+2]],pinBase:Vt(V)}]}),se=-1,An=()=>{v&&(se=K?o.sections.findIndex(p=>p.id===K):-1,v.seatProgram.uniforms.uFocusSection.value=se,v.chairProgram.uniforms.uFocusSection.value=se)},ht=p=>{if(K=p,An(),$.setForcedDense(!!p),!p){let k=ne(),le=new Set(k.map(ae=>ae.id));$.setLabels([...ee().filter(ae=>!le.has(ae.id)),...k]);return}let g=e.seats.filter(k=>f.get(k.id)===p),T=new Set(g.map(k=>k.id)),V=new Set(g.map(k=>k.rowId)),H=new Set(R.keys()),Q=new Set(g.filter(k=>H.has(k.id)).map(k=>k.id)),j=ee().filter(k=>k.kind!=="row"&&k.kind!=="seat"&&k.kind!=="access"||k.kind==="access"&&T.has(k.id.slice(7))||(k.kind==="row"?V.has(k.id.slice(4)):T.has(k.id.slice(5))));if(o.seatCount<=6e3&&Q.size===0){$.setLabels(j);return}let re=g,me=new Set(re.map(k=>`seat:${k.id}`)),be=re.flatMap(k=>{let le=o.seats.idToIndex.get(k.id);if(le===void 0)return[];let ae=le*3;return[{id:`seat:${k.id}`,kind:"seat",seatWidthM:o.seats.iChairWidth[le]*2,rowId:k.rowId,text:H.has(k.id)?k.displayLabel||k.label:uo(k.displayLabel||k.label),anchor:[o.seats.iPosition[ae],o.seats.iPosition[ae+1]+(H.has(k.id)?1.05:.55),o.seats.iPosition[ae+2]],...H.has(k.id)?{pinBase:Vt(ae)}:{}}]});$.setLabels([...j.filter(k=>!me.has(k.id)),...be])};B();let we=null,Lt=null,Pn=new Hs,pt=p=>{if(C||!v||D)return!1;let g=Hr({flying:oe.active,panoramaMounted:L!==null,seatViewActive:we?.active===!0}),T=g==="orbit"?se:-1;v.seatProgram.uniforms.uFocusSection.value=T,v.chairProgram.uniforms.uFocusSection.value=T;let V=te?!1:g==="cinematic"?oe.update(performance.now()):g==="seatView"?we.update(performance.now()):g==="orbit"?S.update():!1;Lt?.syncZoomLimits(),Lt?.syncNavigationMode();let H=G()>=0?o.floors[G()]:null,Q=H?.radius??o.bounds.radius,j=Ro(S.currentDistance,Q),re=W?{center:[S.camera.position.x,S.camera.position.y,S.camera.position.z],radius:520}:o.clipBounds??o.renderBounds;S.updateClipping(re);let me=H?.center??o.renderBounds.center,be=H?.radius??o.renderBounds.radius,k=(ue,Xt)=>Math.hypot(S.camera.position.x-ue[0],S.camera.position.y-ue[1],S.camera.position.z-ue[2])<=Xt*(N.detailVisible?1.8:1.55),le=k(me,be);if(!le&&K){let ue=o.sections.find(Xt=>Xt.id===K);ue&&(le=k(ue.center,Math.max(12,ue.radius*2)))}N.detailVisible=le;let ae=v.seatProgram.uniforms;ae.uSeatScale.value=j.scale,ae.uSeatFade.value=j.fade;let Se=!!H&&_o(H.seatCount,P.canvas.clientWidth||1,P.canvas.clientHeight||1),_e=Io(o.seats.count,Q,S.currentDistance,S.camera.fov,P.canvas.clientHeight||1),Ke=N.detailVisible||Se||_e?1:0,Qe=N.detailVisible||G()>=0||o.floors.length>1?1:0;N.ease(p,Ke,Qe),ae.uSeatDetail.value=N.seatDetailMix;let bt=Ke===0&&N.seatDetailMix<.01;v.seatGeometry.setDrawRange(bt?Zt:0,bt?vo:Zt),v.solidProgram.uniforms.uStructureDetail.value=N.structureDetailMix,ae.uMinPixels.value=j.minPixels,ae.uPixelToWorld.value=2*Math.tan(S.camera.fov*Ws/2)/Math.max(1,P.pixelHeight),N.update(N.detailVisible),o.outdoor&&(Pn.copy(S.camera.projectionViewMatrix).inverse(),v.backgroundProgram.uniforms.uInvViewProj.value.set(Pn)),P.renderer.render({scene:v.background,clear:!0}),P.renderer.render({scene:v.main,camera:S.camera,clear:!1});let Ze=w?w.update(performance.now(),[S.camera.position.x,S.camera.position.y,S.camera.position.z],L!==null,g==="seatView"):!1;if(w&&P.renderer.render({scene:w.root,camera:S.camera,clear:!1}),pe){let ue=S.camera.worldMatrix;pe.update(g==="seatView"?[S.camera.position.x,S.camera.position.y,S.camera.position.z]:null,[-ue[8],-ue[9],-ue[10]])}$.update(S.camera.projectionViewMatrix,P.canvas.clientWidth||1,P.canvas.clientHeight||1,S.currentDistance,Q,[S.camera.position.x,S.camera.position.y,S.camera.position.z]);let Oe=V||Ze||N.seatDetailMix!==Ke||N.structureDetailMix!==Qe;return Cn(!Oe),Oe},Cn=Ao(t),ie=new Mt(pt),En=typeof ResizeObserver<"u"?new ResizeObserver(()=>Yt.resize()):null;En?.observe(t),S.setZoomPointResolver((p,g)=>{let T=P.canvas.getBoundingClientRect(),V=P.canvas.clientWidth||T.width,H=P.canvas.clientHeight||T.height;if(!(V>0)||!(H>0))return null;S.camera.updateMatrixWorld();let Q=Mn(o.seats.iPosition,o.seats.count,S.camera.projectionViewMatrix,V,H,p-T.left,g-T.top,Gs);if(Q<0)return null;let j=Q*3;return[o.seats.iPosition[j],o.seats.iPosition[j+1]+.5,o.seats.iPosition[j+2]]});function Vt(p){return[o.seats.iPosition[p],o.seats.iPosition[p+1]+.5,o.seats.iPosition[p+2]]}$.setSeatNumberRow(null);let Me=null,Te=0,Ot=null,Tn=()=>{Te=0;let p=null,g=null;if(Me&&!we?.active&&!oe.active){let H=P.canvas.getBoundingClientRect(),Q=P.canvas.clientWidth||H.width,j=P.canvas.clientHeight||H.height;if(Q>0&&j>0){let re=Mn(o.seats.iPosition,o.seats.count,S.camera.projectionViewMatrix,Q,j,Me.x-H.left,Me.y-H.top,Bs);p=re>=0?e.seats[re]?.rowId??null:null;let me=re>=0?e.seats[re]?.id??null:null;if(g=me,Me.mouse&&!Me.pressing&&!!K&&!!me&&f.get(me)===K){let k=t.getBoundingClientRect();Ot=me,n.onSeatHover?.(me,{x:Me.x-k.left,y:Me.y-k.top})}else Rn()}}else Rn();let T=Me?.mouse?g:null,V=$.setSeatNumberSeat(T);($.setSeatNumberRow(p)||V)&&ie.requestRender()};function Rn(){Ot!==null&&(Ot=null,n.onSeatHover?.(null,null))}let ft=p=>{Me={x:p.clientX,y:p.clientY,mouse:p.pointerType==="mouse",pressing:p.type==="pointerdown"},Te||(Te=requestAnimationFrame(Tn))},_n=p=>{p.pointerType==="mouse"&&(Me=null,Te||(Te=requestAnimationFrame(Tn)))};P.canvas.addEventListener("pointermove",ft),P.canvas.addEventListener("pointerdown",ft),P.canvas.addEventListener("pointerleave",_n);function In(p){if(!w)return;let g=[];for(let T of R.keys()){let V=o.seats.idToIndex.get(T);if(V===void 0)continue;let H=V*3;g.push({id:T,position:Vt(H)})}w.setSeats(g,performance.now(),p)}let Dn=p=>{let g=H=>{let Q=o.seats.idToIndex.get(H);return Q===void 0?void 0:o.seats.iState[Q]},{updates:T,next:V}=dr(R,p,g);if(R=V,$.setSelectedSeatIds(R.keys()),In(!qe()),ie.requestRender(),ht(K),T.length){let H=$t(o.seats,T);v&&v.uploadSeatStateRuns(H),d(),ie.requestRender()}},qe=()=>I!==null?I:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,ta=8,Fn=p=>{if(!n.getSeatView)return null;let g=x.get(p);if(!g)for(g=Promise.resolve(n.getSeatView(p)),x.set(p,g),g.catch(()=>{x.get(p)===g&&x.delete(p)});x.size>ta;){let T=x.keys().next().value;if(T===void 0)break;x.delete(T)}return g},kn=Dr(o.stages,o.focalWorld,o.bounds.groundY??0),Ln=yn(kn),zt=(p,g)=>{let T=l.get(p),V=Math.max(0,Math.round(o.seats.iFloor[g]??0)),H=e.doc.floors?.[V],Q=o.floors[V],j=H?.focalPoint??e.doc.focalPoint,re=Q?{x:Q.focalWorld[0]/ze,y:Q.focalWorld[2]/ze}:j,me=T?.focalPoint?{x:T.focalPoint.x+re.x-j.x,y:T.focalPoint.y+re.y-j.y}:re,be=[o.seats.iPosition[g*3],o.seats.iPosition[g*3+1],o.seats.iPosition[g*3+2]],k=Sr(o.seats.iPosition,g,Ln),le=k!==null&&Math.abs(k)<xr;return wr(be,me,H?.baseHeightM??0,T?.eyeHeightM,Ln,le)},Nt=()=>(t.clientWidth||P.canvas.clientWidth)<=520,Ht=null,Vn=null,na=async(p,g,T)=>{if(!n.getSeatView||A||T!==fe.flightGen())return;let V;try{V=await Gr()}catch{if(i.panoramaFailed(p,"mount"),!A&&T===fe.flightGen()){let H=Bt(p,T,!0);requestAnimationFrame(()=>H?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(A||T!==fe.flightGen()||!Ht))return Vn??=V.createOpenPanorama(Ht),Vn(p,g,T)},Gt=Ur({container:t,model:o,opts:n,expandedSeatById:l,seatIdsByRow:c,isNarrow:Nt,isDisposed:()=>A,flightGen:()=>fe.flightGen(),flyToSeat:p=>Gn(p),openPanorama:(p,g,T)=>na(p,g,T)}),Bt=Gt.show,Wt=Gt.remove,oa=Gt.layout,Re=Yr({container:t,orbit:S,isNarrow:Nt,enabled:n.chrome?.controlDock!==!1,...n.navLabels?{labels:n.navLabels}:{}});Lt=Re;let ra=Re.element,je=Re.setNavigationMode,aa=Re.layout,ia=Re.utilityControls,$e=null,On=!1,vt=p=>{Re.setSeatViewLocked(p),p||we?.exit()};we=Nr({canvas:P.canvas,camera:S.camera,requestRender:()=>ie.requestRender(),reducedMotion:qe,onStopChange:p=>{let g=p??(On?"seat":null);$e=g;try{n.onSeatViewStopChange?.(g)}catch{}},onApplied:()=>{A||S.syncFromCamera()}});let zn=o.sections.reduce((p,g)=>g.seatCount>0&&g.box?Math.max(p,g.box.max[1]):p,-1/0),Nn=(p,g)=>{let{eye:T}=zt(p,g),V=(t.clientWidth||P.canvas.clientWidth||1)/Math.max(1,t.clientHeight||P.canvas.clientHeight||1),H=kr(T,kn,V,{preserveEye:!0});if(n.seatViewStops===!1)return{...H,stops:[]};let Q=f.get(p),j=Q?o.sections.find(re=>re.id===Q):void 0;return{...H,stops:Lr(H,{aspect:V,seatingTopY:Number.isFinite(zn)?zn:o.bounds.box.max[1],section:j&&j.seatCount>0?{center:j.center,radius:j.radius}:null,venue:{center:o.bounds.center,radius:o.bounds.radius}})}},fe=Qr({isNarrow:Nt,setSeeThrough:p=>{h=p?[p[0],p[1],p[2],Xs]:[0,0,0,0],u(),ie.requestRender()},container:t,model:o,opts:n,orbit:S,cinematic:oe,analytics:i,loop:ie,labelOverlay:$,stageAzimuth:Z,overviewFraming:ce,gpu:()=>v,isDisposed:()=>A,panorama:()=>L,setPanorama:p=>{L=p},setPanoramaSphereVisible:p=>{W=p},panoramaLoadAbort:()=>b,setPanoramaLoadAbort:p=>{b=p},setFrozen:p=>{D=p},restorePanoramaLayer:_,reducedMotion:qe,resolvedSeatViewPose:zt,showSectionSeatLabels:ht,setNearFieldDetailEnabled:M,setSeatViewLocked:vt,setNavigationMode:je,showArriveChip:Bt,removeArriveChip:Wt,inSeatView:()=>$e!==null,setSeatStepping:p=>{On=p},seatViewArrival:(p,g)=>n.arriveAtSeatEye?Nn(p,g):null,enterSeatView:(p,g)=>we?.enter(p,g)});O=!0;let Ut=fe.overviewChip,sa=fe.layoutOverviewChip,la=fe.applyFloorFocus,ca=fe.focusOverview,Hn=fe.cancelFlight,Gn=fe.flyToSeat,Bn=fe.focusSectionCamera;ia.appendChild(Ut),Ht={container:t,model:o,opts:n,analytics:i,orbit:S,loop:ie,seatsById:l,ensureSeatView:Fn,resolvedSeatViewPose:zt,gpu:()=>v,gl:P.gl,isContextLost:()=>C,isDisposed:()=>A,flightGen:()=>fe.flightGen(),setPanorama:p=>{L=p},getLoadAbort:()=>b,setLoadAbort:p=>{b=p},setPanoramaSphereVisible:p=>{W=p,p&&we?.exit()},setFrozen:p=>{D=p},raisePanoramaLayer:z,restorePanoramaLayer:_,getOverviewChip:()=>Ut,labelOverlay:$,reducedMotion:qe,removeArriveChip:Wt,showArriveChip:Bt};let Ce=jr({glctx:P,orbit:S,model:o,seats:e.seats,opts:n,cinematic:oe,analytics:i,seatIdByIndex:s,sectionIdBySeatId:f,tapSlop:Us,tapMs:Ys,gpu:()=>v,pick:()=>E,seatViewLocked:()=>Re.seatViewLocked(),focusedSectionId:()=>K,selection:()=>R,cancelFlight:Hn,focusSectionCamera:Bn,focusSeatCamera:fe.focusSeatCamera,setSelection:Dn,ensureSeatView:Fn});P.canvas.addEventListener("pointerdown",Ce.onDown),P.canvas.addEventListener("pointermove",Ce.onMove),P.canvas.addEventListener("pointerup",Ce.onUp),P.canvas.addEventListener("pointercancel",Ce.onUp),ie.requestRender();let Yt={setAvailability(p){let g=ur(R,p),T=$t(o.seats,g);T.length&&v&&v.uploadSeatStateRuns(T),d(),T.length&&q(),ie.requestRender()},setSelection:Dn,setNavigationMode:je,zoomIn(){S.zoomBy(He),ie.requestRender()},zoomOut(){S.zoomBy(ot),ie.requestRender()},flyToSeat:Gn,focusOverview:ca,seatViewStop:()=>$e,recentreSeatView:()=>we?.recentre()??!1,resize(){let{width:p,height:g}=P.resize();S.setAspect(p/Math.max(1,g)),oa(),aa(),sa(),ie.requestRender()},stats(){return{...ie.stats(),drawCalls:v?v.drawCalls:0,fallbackTriangles:v?v.seatGeometry.drawRange.count/3*o.seats.count:0,seatCount:o.seatCount}},captureImage(p=1280){if(C||!v||typeof document>"u")return null;pt(0);let g=P.canvas,T=Math.min(1,p/Math.max(g.width,g.height,1)),V=document.createElement("canvas");V.width=Math.max(1,Math.round(g.width*T)),V.height=Math.max(1,Math.round(g.height*T));let H=V.getContext("2d");return H?(H.drawImage(g,0,0,V.width,V.height),V.toDataURL("image/jpeg",.82)):null},captureSeatView(p,g=480){if(C||!v||D||typeof document>"u"||oe.active||L!==null||we?.active)return null;let T=X.get(p);if(T)return T;let V=o.seats.idToIndex.get(p);if(V===void 0)return null;let{eye:H,focal:Q,fov:j}=Nn(p,V),re=S.snapshot(),me=[N.seatDetailMix,N.structureDetailMix],be=null;try{te=!0,S.camera.position.set(H[0],H[1],H[2]),S.camera.perspective({fov:j,aspect:S.camera.aspect}),S.camera.lookAt(Q),S.camera.updateMatrixWorld(),S.syncFromCamera(),N.seatDetailMix=1,N.structureDetailMix=1,N.forceRegather(),pt(0);let k=P.canvas,le=Math.min(k.width,Math.round(k.height*16/9)),ae=Math.round(le*9/16),Se=document.createElement("canvas");Se.width=Math.max(1,Math.round(g)),Se.height=Math.max(1,Math.round(g*9/16));let _e=Se.getContext("2d");_e&&(_e.drawImage(k,(k.width-le)/2,(k.height-ae)/2,le,ae,0,0,Se.width,Se.height),be=Se.toDataURL("image/jpeg",.8))}finally{te=!1,re(),N.seatDetailMix=me[0],N.structureDetailMix=me[1],N.forceRegather(),pt(0)}if(be)for(X.set(p,be);X.size>J;)X.delete(X.keys().next().value);return be},getQualityEvidence(){let p=ie.stats(),g=P.canvas.clientWidth||1,T=P.canvas.clientHeight||1,V=o.bounds.center,H=Ae(S.camera.projectionViewMatrix,[V[0],o.bounds.box.min[1],V[2]],g,T),Q=Ae(S.camera.projectionViewMatrix,[V[0],o.bounds.box.max[1],V[2]],g,T),j=o.bounds.box,re=[j.min[0],j.max[0]].flatMap(k=>[j.min[1],j.max[1]].flatMap(le=>[j.min[2],j.max[2]].map(ae=>Ae(S.camera.projectionViewMatrix,[k,le,ae],g,T)))).filter(k=>Number.isFinite(k.x)&&Number.isFinite(k.y)&&Number.isFinite(k.depth)),me=re.length?(()=>{let k=Math.min(...re.map(ue=>ue.x)),le=Math.max(...re.map(ue=>ue.x)),ae=Math.min(...re.map(ue=>ue.y)),Se=Math.max(...re.map(ue=>ue.y)),_e=Math.max(0,k),Ke=Math.min(g,le),Qe=Math.max(0,ae),bt=Math.min(T,Se),Ze=Math.max(0,Ke-_e),Oe=Math.max(0,bt-Qe);return{box:{x:_e,y:Qe,width:Ze,height:Oe},horizontalFillRatio:Ze/g,verticalFillRatio:Oe/T,visibleAreaRatio:Ze*Oe/(g*T),clippedEdges:[...ae<0?["top"]:[],...le>g?["right"]:[],...Se>T?["bottom"]:[],...k<0?["left"]:[]]}})():void 0,be=String(P.gl.getParameter(P.gl.VERSION)??"");return{viewport:{width:g,height:T},context:{webgl2:/webgl\s*2/i.test(be),lost:C},frame:{rendered:p.rendered,idle:p.idle},camera:{position:[S.camera.position.x,S.camera.position.y,S.camera.position.z],distance:S.currentDistance,verticalFovDeg:S.fovY},scene:{seatCount:o.seatCount,floorCount:o.floors.length,zoneCount:o.zones.length,sectionCount:o.sections.length,authoredRelief:y,renderedVerticalSpanM:Math.max(0,o.bounds.box.max[1]-o.bounds.box.min[1]),projectedReliefPx:H.visible&&Q.visible?Math.abs(H.y-Q.y):0},labels:$.qualityEvidence(),framing:me,...$e?{seatView:{fovDeg:S.camera.fov,stop:$e}}:{}}},getQualityReport(){return un(Yt.getQualityEvidence())},loseContextForTest(){P.simulateContextLossCycle()},floors(){return o.floors},focusFloor(p){if(p!==null&&!o.floors.some(T=>T.index===p))return!1;let g=p??-1;if(M(p!==null),vt(!1),la(g),je("orbit"),p===null)oe.cancel(),qe()?S.frame(o.bounds,!1,Z,n.portraitOverviewCrop===!0,ce):S.frameSoft(o.bounds,Z,n.portraitOverviewCrop===!0,ce),$.setOverviewDistance(S.targetDistance);else{let T=o.floors[p];if(T.seatCount>0){oe.cancel();let V=T.focalWorld[0]-T.center[0],H=T.focalWorld[2]-T.center[2],Q=Math.hypot(V,H)>T.radius*.12?Math.atan2(V,H):Z;S.frame({center:T.center,radius:T.radius,box:T.box},!1,Q,!1,{polarDeg:58,margin:1.12}),$.setOverviewDistance(S.targetDistance)}}return ie.requestRender(),!0},zones(){return o.zones},focusZone(p){let g=o.zones.find(Q=>Q.id===p);if(!g||g.seatCount===0)return!1;M(!1),vt(!1),oe.cancel(),je("orbit"),ht(null),n.onSectionFocusChange?.(null);let T=g.focalWorld[0]-g.center[0],V=g.focalWorld[2]-g.center[2],H=Math.hypot(T,V)>g.radius*.12?Math.atan2(T,V):void 0;return S.frame({center:g.center,radius:g.radius*1.25},!1,H),ie.requestRender(),!0},sections(){return o.sections},focusSection(p){return Bn(p)},rows(p){return p?o.rows.filter(g=>g.sectionId===p):o.rows},seatsInRow(p){return e.seats.filter(g=>g.rowId===p).map(g=>({id:g.id,label:g.displayLabel||g.label}))},focusRow(p){let g=o.rows.find(T=>T.id===p);return!g||g.seatCount===0?!1:(M(!0),vt(!1),oe.cancel(),je("pan"),g.sectionId&&(ht(g.sectionId),n.onSectionFocusChange?.(g.sectionId)),S.frame({center:g.center,radius:Math.max(2.5,g.radius*.65)}),ie.requestRender(),!0)},setReducedMotionForTest(p){I=p},dispose(){A=!0,pe?.dispose(),Cn(!1),Wt(),Ut.remove(),ra.remove(),Hn(),we?.dispose(),ie.stop(),$.dispose(),En?.disconnect(),L&&(L.dispose(),L=null),_(),xe(),P.canvas.removeEventListener("pointerdown",Ce.onDown),P.canvas.removeEventListener("pointermove",Ce.onMove),P.canvas.removeEventListener("pointerup",Ce.onUp),P.canvas.removeEventListener("pointercancel",Ce.onUp),P.canvas.removeEventListener("pointermove",ft),P.canvas.removeEventListener("pointerdown",ft),P.canvas.removeEventListener("pointerleave",_n),Te&&cancelAnimationFrame(Te),S.dispose(),E&&E.dispose(),v&&v.dispose(),v=null,w?.dispose(),w=null,E=null,P.dispose()}};return i.opened(o.seatCount,y,e.prepared?.buildMs??performance.now()-r,e.prepared?.source??"inline"),Yt}export{ui as VENUE3D_QUALITY_REPORT_VERSION,ua as autoVenue3d,nt as buildSceneModel,Qt as estimateVenue3D,un as inspectVenue3DQualityEvidence,yu as mountVenue3D,zs as prepareVenue3D,Ns as prepareVenue3DFromChart};
|
|
943
|
+
void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:he},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let q=new ct(t,{geometry:ge,program:ce});q.frustumCulled=!1,q.setParent(n),pe.screenProgram=ce,Y=!0,pe.drawCalls=3+(S?1:0)+1},U.src=$.contentImageUrl}return pe}import{Mesh as mn,RenderTarget as Wi,Transform as hn}from"ogl";function Bi(t,e,n){let r=t+(e<<8)+(n<<16);return r===0?-1:r-1}function lr(t,e,n,r,a,o){let i=-1,s=1/0;for(let l=0;l<n;l++)for(let c=0;c<e;c++){let f=(l*e+c)*4,p=Bi(t[f],t[f+1],t[f+2]);if(p<0||p>=o)continue;let u=c-r,m=l-a,d=u*u+m*m;d<s&&(s=d,i=p)}return i}function cr(t,e,n,r,a,o){let i=t-n.left,s=e-n.top,l=Math.round(i*r),c=Math.round((n.height-s)*r);return{x:Math.max(0,Math.min(a-1,l)),y:Math.max(0,Math.min(o-1,c))}}var Ui=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],Et=class{constructor(e,n,r,a,o){this.seatScene=new hn;this.chairScene=new hn;this.solidScene=new hn;this.target=null;this.restoreClear=[0,0,0];this.renderer=e,this.gl=e.gl,this.maxIndex=o,this.seatProg=jo(this.gl),this.chairProg=$o(this.gl),this.depthProg=Ko(this.gl);let i=new mn(this.gl,{geometry:n,program:this.seatProg});i.frustumCulled=!1,i.setParent(this.seatScene);let s=new mn(this.gl,{geometry:r,program:this.chairProg});s.frustumCulled=!1,s.setParent(this.chairScene);let l=new mn(this.gl,{geometry:a,program:this.depthProg});l.frustumCulled=!1,l.setParent(this.solidScene)}setRoomCentre(e){this.depthProg.uniforms.uRoomCentre.value.set(e??[0,0])}setRestoreClear(e){this.restoreClear=[e[0],e[1],e[2]]}syncFromSeatProgram(e){for(let a of Ui)this.seatProg.uniforms[a].value=e.uniforms[a].value;let n=e.uniforms.uFocusFloor.value;this.seatProg.uniforms.uFocusFloor.value=n,this.chairProg.uniforms.uFocusFloor.value=n,this.depthProg.uniforms.uFocusFloor.value=n;let r=e.uniforms.uSeeThrough?.value;if(r)for(let a of[this.seatProg,this.chairProg,this.depthProg])a.uniforms.uSeeThrough.value=r}ensureTarget(){let e=this.gl.drawingBufferWidth,n=this.gl.drawingBufferHeight;return this.target&&(this.target.width!==e||this.target.height!==n)&&this.destroyTarget(),this.target||(this.target=new Wi(this.gl,{width:e,height:n,depth:!0})),this.target}destroyTarget(){if(!this.target)return;let e=this.gl;this.target.buffer&&e.deleteFramebuffer(this.target.buffer);for(let n of this.target.textures??[])n.texture&&e.deleteTexture(n.texture);this.target.depthBuffer&&e.deleteRenderbuffer(this.target.depthBuffer),this.target=null}pick(e,n,r,a){let o=this.gl,i=this.ensureTarget(),s=o.drawingBufferWidth,l=o.drawingBufferHeight,c=Math.max(0,n-a),f=Math.max(0,r-a),p=Math.max(1,Math.min(s,n+a+1)-c),u=Math.max(1,Math.min(l,r+a+1)-f);o.enable(o.SCISSOR_TEST),o.scissor(c,f,p,u);let[m,d,y]=this.restoreClear;o.clearColor(0,0,0,1),this.renderer.render({scene:this.solidScene,camera:e,target:i,clear:!0}),this.renderer.render({scene:this.seatScene,camera:e,target:i,clear:!1}),this.renderer.render({scene:this.chairScene,camera:e,target:i,clear:!1}),o.clearColor(m,d,y,1),o.disable(o.SCISSOR_TEST);let v=new Uint8Array(p*u*4);return this.renderer.bindFramebuffer(i),o.readPixels(c,f,p,u,o.RGBA,o.UNSIGNED_BYTE,v),this.renderer.bindFramebuffer(),lr(v,p,u,n-c,r-f,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function ur(t,e){let n=[];for(let r of e)t.has(r.seatId)?t.set(r.seatId,Qn(r.state)):n.push(r);return n}function dr(t,e,n){let r=new Set;for(let i of e)(t.has(i)||n(i)!==void 0)&&r.add(i);let a=new Map(t),o=[];for(let[i,s]of t)r.has(i)||(o.push({seatId:i,state:Se[s]??"available"}),a.delete(i));for(let i of r){if(a.has(i))continue;let s=n(i);s!==void 0&&(a.set(i,s),o.push({seatId:i,state:"selected"}))}return{updates:o,next:a}}import{Quat as ut,Vec3 as qi}from"ogl";function Yi(t,e){return[t[0]-e[0],t[1]-e[1],t[2]-e[2]]}function mr(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function Xi(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function hr(t){let e=Math.hypot(t[0],t[1],t[2]);return e>1e-6?[t[0]/e,t[1]/e,t[2]/e]:[0,0,0]}function pn(t){let e=Math.max(0,Math.min(1,t));return e*e*e*(e*(e*6-15)+10)}function fn(t,e){return Math.max(0,Math.min(1,t+e))}function pr(t,e){let n=t.length;if(n===0)return[0,0,0];if(n===1)return[...t[0]];let r=Math.max(0,Math.min(1,e)),a=n-1,o=Math.floor(r*a);o>=a&&(o=a-1);let i=r*a-o,s=t[Math.max(0,o-1)],l=t[o],c=t[o+1],f=t[Math.min(n-1,o+2)],p=i*i,u=p*i,m=[0,0,0];for(let d=0;d<3;d++)m[d]=.5*(2*l[d]+(-s[d]+c[d])*i+(2*s[d]-5*l[d]+4*c[d]-f[d])*p+(-s[d]+3*l[d]-3*c[d]+f[d])*u);return m}function vn(t,e,n,r,a){let o=hr(Yi(e,n));o[0]===0&&o[1]===0&&o[2]===0&&(o=[0,0,1]);let i=mr(mr(e,Xi(o,2.5)),[0,1.5,0]),s=[e[0]-r[0],0,e[2]-r[2]],l=hr(s);l[0]===0&&l[2]===0&&(l=[o[0],0,o[2]]);let c=Math.max(1,a),f=[r[0]+l[0]*c*1.3,r[1]+c*.75,r[2]+l[2]*c*1.3];return{waypoints:[t,f,i],finalPos:i}}function bn(t,e,n=35,r=28){let a=pn(e),o=pr(t,a),i=pn(Math.max(0,Math.min(1,(e-.66)/.34)));return{pos:o,fov:n+(r-n)*i,eased:a}}function gr(t,e,n){let r=t.position.clone(),a=new ut().copy(t.quaternion);t.position.set(e[0],e[1],e[2]),t.lookAt(new qi(n[0],n[1],n[2]));let o=new ut().copy(t.quaternion);return t.position.copy(r),t.quaternion.copy(a),o}var Tt=class{constructor(e){this.active=!1;this.waypoints=[];this.startQuat=new ut;this.endQuat=new ut;this.outQuat=new ut;this.startTime=0;this.duration=2500;this.endFov=28;this.resolveFn=null;this.camera=e}start(e,n,r,a=2500,o=28){return this.settle(),this.waypoints=e,this.startQuat.copy(n),this.endQuat.copy(r),this.duration=a,this.endFov=o,this.startTime=performance.now(),this.active=!0,new Promise(i=>{this.resolveFn=i})}update(e){if(!this.active)return!1;let n=Math.min(1,(e-this.startTime)/this.duration),{pos:r,fov:a,eased:o}=bn(this.waypoints,n,35,this.endFov);return this.camera.position.set(r[0],r[1],r[2]),this.outQuat.copy(this.startQuat).slerp(this.endQuat,fn(o,.15)),this.camera.quaternion.copy(this.outQuat),this.camera.fov=a,this.camera.updateProjectionMatrix(),n>=1?(this.settle(),!1):!0}cancel(){this.settle()}settle(){this.active=!1;let e=this.resolveFn;this.resolveFn=null,e&&e()}};var yr=$n,ji=.12,$i=1.6,xr=.12;function Sr(t,e,n){let r=t[e*3],a=t[e*3+1],o=t[e*3+2],i=n[0]-r,s=n[2]-o,l=Math.hypot(i,s);if(!(l>.001))return null;let c=i/l,f=s/l,p=1/0,u=null;for(let m=0;m*3<t.length;m++){if(m===e)continue;let d=t[m*3]-r,y=t[m*3+2]-o,v=d*c+y*f;v<.3||v>1.6||Math.abs(d*f-y*c)>.6||v<p&&(p=v,u=a-t[m*3+1])}return u}var Ki=.25,Qi=1.5;function wr(t,e,n=0,r,a,o=!1){let i=[e.x*ze,n+Qi,e.y*ze],s=a?[a[0],a[1],a[2]]:i,l=t[1],c=Number.isFinite(l)?l+(o?$i:yr):Number.isFinite(r)?n+r:n+yr,f=i[0]-t[0],p=i[2]-t[2],u=Math.hypot(f,p),m=u>.001?Math.min(ji,u*Ki):0,d=u>.001?f/u:0,y=u>.001?p/u:0;return{eye:[t[0]+d*m,c,t[2]+y*m],focal:s}}var Ee=Math.PI/180,Zi=45,gn=80,Rt=70,Ji=1,es=.99;function ts(t,e){if(!(t<Ji))return gn;if(!(Number.isFinite(e)&&e>0))return Rt;let n=2*Math.atan(e/(2*_t*es)/Math.max(.05,t))/Ee;return Math.max(Rt,Math.min(gn,n))}var ns=.25,_t=1,os=.25,rs=12*Ee,as=.2,is=1.5,Mr=.8,Ar=6,_r=1.9,ss=2/3,ls=.12,cs=.9,us=1.2,ds=2,Ir=.05,ms=6;function Dr(t,e,n=0){if(!t.length)return{min:[e[0]-6,n,e[2]-6],max:[e[0]+6,Math.max(n+Mr,e[1]),e[2]+6]};let r=1/0,a=-1/0,o=1/0,i=-1/0,s=n;for(let d of t)r=Math.min(r,d.cx-d.halfX),a=Math.max(a,d.cx+d.halfX),o=Math.min(o,d.cz-d.halfZ),i=Math.max(i,d.cz+d.halfZ),s=Math.max(s,d.y);let l=a-r,c=i-o,f=Math.max(l,Math.min(c,Ar))/2,p=Math.max(c,Math.min(l,Ar))/2,u=(r+a)/2,m=(o+i)/2;return{min:[u-f,n,m-p],max:[u+f,Math.max(n+Mr,s),m+p]}}function hs(t){return{min:[t.min[0],t.min[1],t.min[2]],max:[t.max[0],t.max[1]+_r,t.max[2]]}}function yn(t){let e=t.max[1];return[(t.min[0]+t.max[0])/2,Math.max(t.min[1]+is,e+as,e+_r*ss),(t.min[2]+t.max[2])/2]}function Fr(t,e){let n=t[0]-e[0],r=t[2]-e[2],a=Math.hypot(n,r);return a<.001?{x:0,z:1}:{x:n/a,z:r/a}}function Pr(t,e,n){let r=e[0]-t[0],a=e[1]-t[1],o=e[2]-t[2],i=Math.hypot(r,a,o)||1;r/=i,a/=i,o/=i;let s=-o,l=r,c=Math.hypot(s,l);if(c<1e-6)return 1/0;s/=c,l/=c;let f=1/0,p=-1/0;for(let u=0;u<8;u++){let m=(u&1?n.max[0]:n.min[0])-t[0],d=(u&2?n.max[1]:n.min[1])-t[1],y=(u&4?n.max[2]:n.min[2])-t[2],v=Math.max(Ir,m*r+d*a+y*o),w=(m*s+y*l)/v;w<f&&(f=w),w>p&&(p=w)}return p-f}function Cr(t,e,n){let r=e[0]-t[0],a=e[1]-t[1],o=e[2]-t[2],i=Math.hypot(r,a,o)||1;r/=i,a/=i,o/=i;let s=-o,l=r,c=Math.hypot(s,l);if(c<1e-6)return 1/0;s/=c,l/=c;let f=-l*a,p=l*r-s*o,u=s*a,m=1/0,d=-1/0;for(let y=0;y<8;y++){let v=(y&1?n.max[0]:n.min[0])-t[0],w=(y&2?n.max[1]:n.min[1])-t[1],E=(y&4?n.max[2]:n.min[2])-t[2],C=Math.max(Ir,v*r+w*a+E*o),D=(v*f+w*p+E*u)/C;D<m&&(m=D),D>d&&(d=D)}return d-m}function It(t,e){return Math.tan(t*Ee/2)*Math.max(.05,e)}function Er(t,e,n){let r=ts(n,t),a=l=>Math.max(Zi,Math.min(r,l)),o=l=>2*Math.atan(l)/Ee,i=Number.isFinite(t)&&t>0?a(o(t/(2*ns)/Math.max(.05,n))):r;if(!(Number.isFinite(e)&&e>0))return i;let s=Math.min(i,a(o(e/(2*ls))));return t/(2*It(s,n))>_t?i:s}function kr(t,e,n,r={}){let a=yn(e),o=[t[0],t[1],t[2]],i=0,s=0,l=d=>{if(!(d>0))return;let y=Fr(o,a);o[0]+=y.x*d,o[2]+=y.z*d,s+=d},c=r.preserveEye?0:e.max[1]+os-o[1];c>0&&(o[1]+=c,i=c,l(c/Math.tan(rs)));let f=hs(e),p=Pr(o,a,e),u=Er(p,Cr(o,a,f),n),m=p/(2*It(u,n));for(let d=0;!r.preserveEye&&d<ms&&m>_t;d++){let y=Math.max(1,Math.hypot(o[0]-a[0],o[2]-a[2])),v=Number.isFinite(m)?m/_t:2;l(Math.min(60,y*(Math.min(4,v)-1)+.5)),p=Pr(o,a,e),u=Er(p,Cr(o,a,f),n),m=p/(2*It(u,n))}return{eye:o,focal:a,fov:u,raisedM:i,pulledBackM:s,stageFrameWidth:m}}function ps(t,e,n){let r=Math.tan(e*Ee/2),a=It(e,n);return Math.max(1,t/Math.max(.05,Math.min(r,a)))}var fs=.7,Tr=.5,vs=.8;function Rr(t,e,n){let r=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],a=[n[0]-t[0],n[1]-t[1],n[2]-t[2]],o=r[0]*a[0]+r[1]*a[1]+r[2]*a[2],i=Math.hypot(r[0],r[1],r[2])*Math.hypot(a[0],a[1],a[2])||1;return Math.acos(Math.max(-1,Math.min(1,o/i)))/Ee}function bs(t,e,n){let r=c=>{let f=Math.hypot(c[0],c[1],c[2])||1;return[c[0]/f,c[1]/f,c[2]/f]},a=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],o=Math.hypot(a[0],a[1],a[2]),i=r(a),s=r([n[0]-t[0],n[1]-t[1],n[2]-t[2]]),l=r([0,1,2].map(c=>i[c]*(1-Tr)+s[c]*Tr));return[t[0]+l[0]*o,t[1]+l[1]*o,t[2]+l[2]*o]}function Lr(t,e){let{aspect:n,venue:r}=e,a=t.focal,o=Fr(t.eye,a),i=y=>(y[0]-a[0])*o.x+(y[2]-a[2])*o.z,s=[{name:"seat",eye:t.eye,focal:a,fov:t.fov}],l=ds*(e.rowDepthM??cs),c=[t.eye[0]+o.x*l,t.eye[1]+us,t.eye[2]+o.z*l],f=[t.eye[0],t.eye[1]-fs,t.eye[2]],p=bs(c,a,f);s.push({name:"row",eye:c,focal:p,fov:Math.min(gn,Math.max(t.fov,2*Math.max(Rr(c,p,f),Rr(c,p,a))/vs))});let u=(y,v,w,E)=>{let C=ps(w,t.fov,n)*1.08,D=C*Math.sin(E*Ee),A=Number.isFinite(e.seatingTopY)?e.seatingTopY+2:-1/0,R=Math.max(D,A-v[1]),L=C*Math.cos(E*Ee);return{name:y,eye:[v[0]+o.x*L,v[1]+R,v[2]+o.z*L],focal:v,fov:t.fov}};e.section&&e.section.radius>0&&s.push(u("section",e.section.center,e.section.radius,35)),s.push(u("venue",r.center,Math.max(1,r.radius),40));let m=[],d=-1/0;for(let y of s){let v=i(y.eye);m.length&&v<=d+.5||(m.push(y),d=v)}return m}import{Vec3 as gs}from"ogl";var mt=Math.PI/180,xn=320,Vr=70*mt,ys=32*mt,xs=24*mt,Or=.0026,Ss=.22,ws=.006,Ms=180,As=900,Ps=1100,Cs=4,ve=(t,e,n)=>Math.max(e,Math.min(n,t)),zr=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2;function Nr(t){let{canvas:e,camera:n}=t,r=[],a=!1,o=0,i=0,s=0,l=0,c=0,f=0,p=xn,u=null,m=()=>{u&&(clearTimeout(u),u=null)},d=!1,y=[0,0],v=0,w=!1,E=null,C=null,D=new Map,A=!1,R=0,L=0,b=0,F=0,x=()=>a&&r.length?r[ve(Math.round(o),0,r.length-1)].name:null,I=()=>{let M=x();M!==E&&(E=M,t.onStopChange?.(M))},z=()=>{if(!a||!r.length)return;let M=r[ve(Math.floor(o),0,r.length-1)],P=r[ve(Math.ceil(o),0,r.length-1)],S=ve(o-Math.floor(o),0,1),Y=(K,ne)=>K+(ne-K)*S,Z=[Y(M.eye[0],P.eye[0]),Y(M.eye[1],P.eye[1]),Y(M.eye[2],P.eye[2])],ge=[Y(M.focal[0],P.focal[0]),Y(M.focal[1],P.focal[1]),Y(M.focal[2],P.focal[2])],ce=ge[0]-Z[0],he=ge[1]-Z[1],oe=ge[2]-Z[2],ye=Math.hypot(ce,he,oe)||1,pe=Math.atan2(ce,oe),$=Math.asin(ve(he/ye,-1,1)),U=pe+i,ee=ve($+s,-80*mt,80*mt),q=Math.cos(ee)*ye;ce=Math.sin(U)*q,he=Math.sin(ee)*ye,oe=Math.cos(U)*q,n.position.set(Z[0],Z[1],Z[2]),n.fov=Y(M.fov,P.fov),n.updateProjectionMatrix(),n.lookAt(new gs(Z[0]+ce,Z[1]+he,Z[2]+oe)),t.onApplied?.()},_=()=>{if(!a||!r.length)return;let M=ve(Math.round(o),0,r.length-1);if(t.reducedMotion()){d=!1,o=M,z(),I(),t.requestRender();return}if(Math.abs(M-o)<.001){d=!1,I();return}l=o,c=M,f=performance.now(),p=xn,d=!0,t.requestRender()},O=M=>{!a||r.length<2||(m(),d=!1,o=ve(o+M,0,r.length-1),z(),I(),t.requestRender())},G=(M,P)=>{a&&(m(),d=!1,w=!1,i=ve(i-M*Or,-Vr,Vr),s=ve(s-P*Or,-xs,ys),z(),t.requestRender())},B=M=>{a&&(D.set(M.pointerId,{x:M.clientX,y:M.clientY}),D.size===1?(A=!0,F=0,R=M.clientX,L=M.clientY):D.size===2&&(A=!1,b=W()))},W=()=>{let M=[...D.values()];return M.length<2?0:Math.hypot(M[0].x-M[1].x,M[0].y-M[1].y)},N=M=>{if(!a||!D.has(M.pointerId))return;if(D.set(M.pointerId,{x:M.clientX,y:M.clientY}),D.size>=2){let Y=W();b>0&&O((b-Y)*ws),b=Y;return}if(!A)return;let P=M.clientX-R,S=M.clientY-L;R=M.clientX,L=M.clientY,F+=Math.abs(P)+Math.abs(S),!(F<=Cs)&&G(P,S)},te=M=>{D.delete(M.pointerId)&&(D.size<2&&(b=0),D.size===0&&(A=!1,_()))},X=M=>{if(!a)return;M.preventDefault();let P=M.deltaMode===1?16:M.deltaMode===2?100:1,S=ve(M.deltaY*P/100,-2,2);O(S*Ss),C&&clearTimeout(C),C=setTimeout(()=>{C=null,_()},Ms)},J=()=>{m(),a&&(a=!1,d=!1,w=!1,r=[],D.clear(),A=!1,C&&(clearTimeout(C),C=null),E!==null&&(E=null,t.onStopChange?.(null)))};return e.addEventListener("pointerdown",B),e.addEventListener("pointermove",N),e.addEventListener("pointerup",te),e.addEventListener("pointercancel",te),e.addEventListener("wheel",X,{passive:!1}),{get active(){return a},enter(M,P=0){if(M.length<2){J();return}m(),r=M,a=!0,o=t.reducedMotion()?0:ve(P,0,M.length-1),o>0&&(u=setTimeout(()=>{u=null,a&&(l=o,c=0,f=performance.now(),p=Ps,d=!0,t.requestRender())},As)),i=0,s=0,d=!1,w=!1,E=null,z(),I(),t.requestRender()},exit:J,recentre(){return a?Math.abs(i)<1e-4&&Math.abs(s)<1e-4?!0:t.reducedMotion()?(w=!1,i=0,s=0,z(),t.requestRender(),!0):(y=[i,s],v=performance.now(),w=!0,t.requestRender(),!0):!1},update(M){if(!a)return!1;let P=!1;if(w){let S=ve((M-v)/xn,0,1),Y=1-zr(S);i=y[0]*Y,s=y[1]*Y,S>=1?(w=!1,i=0,s=0):P=!0}if(d){let S=ve((M-f)/p,0,1);o=l+(c-l)*zr(S),S>=1?(d=!1,o=c,I()):P=!0}return z(),P},currentStop:x,dispose(){J(),e.removeEventListener("pointerdown",B),e.removeEventListener("pointermove",N),e.removeEventListener("pointerup",te),e.removeEventListener("pointercancel",te),e.removeEventListener("wheel",X)}}}function Hr(t){return t.flying?"cinematic":t.panoramaMounted?"panorama":t.seatViewActive?"seatView":"orbit"}var Sn=null;function Gr(){return Sn??=import("../openPanorama-VD6PE3YZ.js").catch(t=>{throw Sn=null,t}),Sn}var Br=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),Dt=class{constructor(e){this.orbitLatched=!1;this.panoramaOpenedAt=0;this.cb=e}emit(e,n){if(this.cb)try{this.cb(e,n)}catch{}}opened(e,n,r,a){this.emit("3d_opened",{seats:e,hasHeights:n,...r===void 0?{}:{buildMs:Math.round(r)},...a===void 0?{}:{prepSource:a}})}orbitEngaged(){this.orbitLatched||(this.orbitLatched=!0,this.emit("3d_orbit_engaged"))}seatPicked(e,n){this.emit("3d_seat_picked",{seatId:e,sectionId:n})}cinematicPlayed(e){this.emit("3d_cinematic_played",{durationMs:e,reducedMotion:!1})}cinematicSkipped(){this.emit("3d_cinematic_skipped",{reducedMotion:!0})}cinematicCancelled(){this.emit("3d_cinematic_cancelled")}panoramaOpened(){this.panoramaOpenedAt=Br(),this.emit("3d_panorama_opened")}panoramaClosed(){let e=this.panoramaOpenedAt?Math.round(Br()-this.panoramaOpenedAt):0;this.panoramaOpenedAt=0,this.emit("3d_panorama_closed",{viewMs:e})}panoramaFailed(e,n){this.emit("3d_panorama_failed",{seatId:e,phase:n})}panoramaFallback(e){this.emit("3d_panorama_fallback",{seatId:e})}contextLost(){this.emit("3d_context_lost")}contextRestored(){this.emit("3d_context_restored")}};function Wr(t){let e=t.style.position;return getComputedStyle(t).position!=="static"?()=>{}:(t.style.position="relative",()=>{t.style.position==="relative"&&(t.style.position=e)})}function Ur(t){let{container:e,model:n,opts:r,expandedSeatById:a,seatIdsByRow:o,isNarrow:i}=t,s=null,l=()=>{if(!s)return;let p=i();Object.assign(s.style,p?{left:"12px",right:"12px",bottom:"70px",transform:"none",justifyContent:"center"}:{left:"50%",right:"auto",bottom:"18px",transform:"translateX(-50%)",justifyContent:"initial"})},c=()=>{s?.remove(),s=null};return{show:(p,u,m=!1)=>{if(c(),t.isDisposed())return null;let d=document.createElement("div");d.setAttribute("role","group"),Object.assign(d.style,{position:"absolute",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",zIndex:"4"});let y=r.chrome?.caption!==!1,v=r.chrome?.seatStepper!==!1;if(!y&&!v)return null;let w=a.get(p),E=w?.sectionId?n.sections.find(x=>x.id===w.sectionId):void 0,C=w?.label??p;d.setAttribute("aria-label",`Explore views near ${E?.label?`${E.label}, `:""}seat ${C}`);let D=document.createElement("span");D.textContent=r.seatViewCaption?.(p)??["Live 3D seat view",E?.label,C].filter(Boolean).join(" \xB7 "),Object.assign(D.style,{maxWidth:"min(70vw, 560px)",padding:"5px 10px",borderRadius:"999px",overflow:"hidden",color:"#d9e3f5",background:"rgba(12,18,32,0.72)",font:"600 11px/1.2 inherit",textOverflow:"ellipsis",whiteSpace:"nowrap",backdropFilter:"blur(6px)"}),y&&d.appendChild(D);let A=document.createElement("div");Object.assign(A.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),d.appendChild(A);let R=w?.rowId?o.get(w.rowId):void 0,L=R?.indexOf(p)??-1,b=L>=0?[R?.[L-1],R?.[L+1]]:[void 0,void 0],F=(x,I,z,_=!1)=>{let O=document.createElement("button");O.type="button",O.textContent=x,O.setAttribute("aria-label",I),Object.assign(O.style,{minHeight:"44px",padding:_?"10px 16px":"10px",borderRadius:"999px",background:"rgba(12,18,32,0.78)",color:"#eef1f8",border:"1px solid rgba(150,165,205,0.4)",backdropFilter:"blur(6px)",font:"600 13px/1 inherit",cursor:"pointer",whiteSpace:"nowrap"}),_||(O.style.minWidth="44px"),_&&(O.dataset.panoramaTrigger=""),O.addEventListener("click",z),A.appendChild(O)};if(v&&b[0]){let x=a.get(b[0])?.label??b[0];F("\u2039",`View previous seat ${x}`,()=>{t.flyToSeat(b[0])})}if(v&&r.getSeatView){let x=r.seatViewActionLabel?.(p)??"Open 360\xB0 panorama";F(m?`\u21BB Retry ${x}`:`\u25C9 ${x}`,`${m?"Retry":x} from seat ${C}`,()=>{if(t.isDisposed()||u!==t.flightGen()){c();return}c(),t.openPanorama(p,400,u)},!0)}if(v&&b[1]){let x=a.get(b[1])?.label??b[1];F("\u203A",`View next seat ${x}`,()=>{t.flyToSeat(b[1])})}return!A.childElementCount&&!y?null:(e.appendChild(d),s=d,l(),d)},remove:c,layout:l}}var Es={rotate:"Drag to rotate the venue",move:"Drag to move the venue",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Show whole venue"};function Yr(t){let{container:e,orbit:n,isNarrow:r}=t,a={...Es,...t.labels??{}},o=(A,R)=>{A.setAttribute("aria-label",R),A.title=R},i=document.createElement("div"),s=!1;i.className="sl-3d-navigation-controls",Object.assign(i.style,{position:"absolute",right:"14px",bottom:"14px",display:"flex",zIndex:"4",flexDirection:"column",alignItems:"flex-end",gap:"7px"});let l=document.createElement("div");l.setAttribute("role","group"),l.setAttribute("aria-label","3D drag mode"),Object.assign(l.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let c=document.createElement("div");c.setAttribute("role","group"),c.setAttribute("aria-label","3D view controls"),Object.assign(c.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let f=document.createElement("button");f.type="button",f.textContent="\u21BB",o(f,a.rotate);let p=document.createElement("button");p.type="button",p.textContent="\u2725",o(p,a.move);let u=document.createElement("button");u.type="button",u.textContent="\u2212",o(u,a.zoomOut);let m=document.createElement("button");m.type="button",m.textContent="+",o(m,a.zoomIn);for(let A of[f,p,u,m])A.className="sl-3d-icon-control",Object.assign(A.style,{width:"44px",minWidth:"44px",minHeight:"44px",padding:"9px",border:"1px solid rgba(150,165,205,0.35)",borderRadius:"999px",color:"#c9d4ea",background:"rgba(12,18,32,0.82)",font:"600 17px/1 inherit",backdropFilter:"blur(6px)",cursor:"pointer",whiteSpace:"nowrap"});l.append(f,p),c.append(m,u);let d=null,y=()=>{let A=n.dragAction();if(A===d)return;d=A;let R=A==="orbit";f.setAttribute("aria-pressed",String(R)),p.setAttribute("aria-pressed",String(!R)),f.style.background=R?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",p.style.background=R?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",i.title=R?`${a.rotate} \xB7 ${a.move} with Shift`:`${a.move} \xB7 ${a.rotate} with Shift`},v=A=>{n.setPrimaryDragMode(A),y()};f.addEventListener("click",()=>v("orbit")),p.addEventListener("click",()=>v("pan"));let w=()=>{let{atMin:A,atMax:R}=n.dollyLimitState();m.disabled!==A&&(m.disabled=A),u.disabled!==R&&(u.disabled=R)};u.addEventListener("click",()=>{n.zoomBy(ot),w()}),m.addEventListener("click",()=>{n.zoomBy(He),w()}),i.append(l,c),v("auto"),e.appendChild(i);let E=t.enabled!==!1,C=()=>{let A=r();i.style.display=s||!E?"none":"flex",i.style.right=A?"12px":"14px",i.style.bottom=A?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",l.style.display=A?"none":"flex",m.style.display=A?"none":"",u.style.display=A?"none":""};return C(),{element:i,utilityControls:c,setNavigationMode:v,syncNavigationMode:y,syncZoomLimits:w,setSeatViewLocked:A=>{s=A,n.setInteractionEnabled(!A),C()},seatViewLocked:()=>s,layout:C}}var Ts=.5,Xr=12,qr=20,Rs=28;function _s(t,e,n){return!(t>0)||!(n>0)?0:Ts*n/(2*t*Math.tan(e*Math.PI/360))}function jr(t){let{glctx:e,orbit:n,model:r,seats:a,opts:o,cinematic:i,analytics:s,seatIdByIndex:l,sectionIdBySeatId:c,tapSlop:f,tapMs:p,cancelFlight:u,focusSectionCamera:m,setSelection:d,ensureSeatView:y}=t,v=0,w=0,E=0,C=-1,D=!1,A=!1,R=_=>{t.seatViewLocked()||C===-1&&(C=_.pointerId,v=_.clientX,w=_.clientY,E=performance.now(),D=!1,A=i.active,i.active&&(s.cinematicCancelled(),u(),o.onViewTargetChange?.(null)))},L=_=>{_.pointerId===C&&Math.hypot(_.clientX-v,_.clientY-w)>f&&(D=!0)},b=(_,O,G,B,W)=>{let N=e.canvas.getBoundingClientRect(),te=e.canvas.clientWidth||N.width||1,X=e.canvas.clientHeight||N.height||1,J=_-N.left,M=O-N.top,P=B*B,S=-1,Y=P,Z=1/0;for(let ge of a){if(G&&ge.sectionId!==G)continue;let ce=r.seats.idToIndex.get(ge.id);if(ce===void 0)continue;if(W){let U=Math.round(r.seats.iState[ce]??0);if(U!==0&&U!==3)continue}let he=ce*3,oe=Ae(n.camera.projectionViewMatrix,[r.seats.iPosition[he],r.seats.iPosition[he+1]+.55,r.seats.iPosition[he+2]],te,X);if(!oe.visible)continue;let ye=oe.x-J,pe=oe.y-M,$=ye*ye+pe*pe;($<Y||Math.abs($-Y)<1&&oe.depth<Z)&&(S=ce,Y=$,Z=oe.depth)}return S},F=(_,O)=>{let G=t.gpu(),B=t.pick();if(!G||!B)return-1;B.syncFromSeatProgram(G.seatProgram);let W=e.canvas.getBoundingClientRect(),N=e.renderer.dpr,{x:te,y:X}=cr(_,O,W,N,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),J=Math.max(2,Math.round(8*N));return B.pick(n.camera,te,X,J)},x=()=>e.canvas.clientHeight||e.canvas.getBoundingClientRect().height,I=(_,O=Xr)=>{let G=n.camera?.position;if(!G)return!1;let B=_*3,W=Math.hypot(G.x-r.seats.iPosition[B],G.y-r.seats.iPosition[B+1],G.z-r.seats.iPosition[B+2]);return _s(W,n.fovY,x())>=O};return{onDown:R,onMove:L,onUp:_=>{if(_.pointerId!==C)return;let O=!D&&performance.now()-E<p;if(C=-1,A){A=!1;return}let G=t.gpu(),B=t.pick();if(!O||!G||!B)return;let W=F(_.clientX,_.clientY),N=_.pointerType==="touch"||_.pointerType==="pen",te=N?qr:Xr,X=W>=0&&I(W,te),J=!1;if(t.focusedSectionId()&&W>=0){let S=l[W],Y=S?c.get(S):void 0;if(Y&&Y!==t.focusedSectionId()&&m(Y,{keepCamera:X})){if(!X)return;J=!0}}if(t.focusedSectionId()&&W<0&&(W=b(_.clientX,_.clientY,t.focusedSectionId(),44,!1)),t.focusedSectionId()&&W<0){let S=b(_.clientX,_.clientY,null,72,!1),Y=S>=0?l[S]:void 0,Z=Y?c.get(Y):void 0;if(Z&&Z!==t.focusedSectionId()&&m(Z))return}if(!t.focusedSectionId()){W<0&&(W=b(_.clientX,_.clientY,null,42,!1));let S=W>=0?l[W]:void 0,Y=S?c.get(S):void 0;if(Y&&m(Y,{keepCamera:X})){if(!X)return;J=!0}}if(W<0||W>=l.length){t.selection().size&&(d([]),o.onViewTargetChange?.(null));return}let M=l[W];if(N&&t.focusedSectionId()&&!J&&!I(W,qr)){t.focusSeatCamera(M,{seatPx:Rs,viewportHeightPx:x()});return}let P=Se[Math.round(r.seats.iState[W]??0)]??"available";if(P!=="available"&&P!=="selected"){o.onSeatInspect?.(M,P);return}if(t.selection().has(M)&&t.selection().size===1){d([]),o.onViewTargetChange?.(null),o.onSeatPick?.(M);return}d([M]),y(M),s.seatPicked(M,c.get(M)),o.onSeatPick?.(M)}}}var Ft=class{constructor(e,n){this.minX=0;this.minZ=0;this.cell=1;this.cols=1;this.rows=1;this.cellStart=null;this.cellItems=null;this.iPosition=e,this.count=n}ensureGrid(){if(this.cellStart||this.count===0)return;let e=this.iPosition,n=1/0,r=1/0,a=-1/0,o=-1/0;for(let m=0;m<this.count;m++){let d=e[m*3],y=e[m*3+2];d<n&&(n=d),d>a&&(a=d),y<r&&(r=y),y>o&&(o=y)}let i=Math.max(a-n,.001),s=Math.max(o-r,.001);this.cell=Math.max(Math.sqrt(i*s*4/this.count),.25),this.cols=Math.max(1,Math.ceil(i/this.cell)+1),this.rows=Math.max(1,Math.ceil(s/this.cell)+1),this.minX=n,this.minZ=r;let l=this.cols*this.rows,c=new Int32Array(l+1),f=m=>{let d=Math.min(this.cols-1,Math.max(0,Math.floor((e[m*3]-n)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((e[m*3+2]-r)/this.cell)))*this.cols+d};for(let m=0;m<this.count;m++)c[f(m)+1]++;for(let m=0;m<l;m++)c[m+1]+=c[m];let p=new Int32Array(this.count),u=c.slice(0,l);for(let m=0;m<this.count;m++)p[u[f(m)]++]=m;this.cellStart=c,this.cellItems=p}gather(e,n,r,a,o){this.ensureGrid();let i=this.cellStart,s=this.cellItems;if(!i||!s)return 0;let l=a.length,c=r*r,f=Math.floor((e-this.minX)/this.cell),p=Math.floor((n-this.minZ)/this.cell),u=Math.ceil(r/this.cell)+1,m=this.iPosition,d=0;for(let y=0;y<=u&&d<l;y++){let v=p-y,w=p+y,E=f-y,C=f+y;for(let D=v;D<=w&&d<l;D++){if(D<0||D>=this.rows)continue;let A=D===v||D===w;for(let R=E;R<=C&&d<l;R++){if(!A&&R!==E&&R!==C){R=C-1;continue}if(R<0||R>=this.cols)continue;let L=D*this.cols+R;for(let b=i[L],F=i[L+1];b<F&&d<l;b++){let x=s[b],I=m[x*3]-e,z=m[x*3+2]-n,_=o===void 0?0:m[x*3+1]-o;I*I+_*_+z*z<=c&&(a[d++]=x)}}}}return d}};var kt=class{constructor(e){this.ctx=e;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array(At);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.lastGatherY=1/0;this.nearIndex=new Ft(e.model.seats.iPosition,e.model.seats.count)}forceRegather(){this.lastGatherX=1/0}setDetailEnabled(e){let n=this.ctx.gpu();e||(this.detailVisible=!1),this.lastGatherX=1/0,this.lastGatherZ=1/0,!e&&n?.nearSeatCount()&&n.setNearSeats(this.nearBuf,0)}update(e){let{model:n}=this.ctx,r=this.ctx.gpu();if(!r)return;if(!e){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let a=this.ctx.orbit().camera.position;if(Math.hypot(a.x-this.lastGatherX,a.y-this.lastGatherY,a.z-this.lastGatherZ)<rn)return;if(this.lastGatherX=a.x,this.lastGatherY=a.y,this.lastGatherZ=a.z,Math.hypot(a.x-n.bounds.center[0],a.y-n.bounds.center[1],a.z-n.bounds.center[2])-n.bounds.radius>on){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let s=this.nearIndex.gather(a.x,a.z,on,this.nearBuf,a.y);s===0&&r.nearSeatCount()===0||r.setNearSeats(this.nearBuf,s)}ease(e,n,r){let a=1-Math.exp(-e*9),o=1-Math.exp(-e*20);this.seatDetailMix+=(n-this.seatDetailMix)*(n>this.seatDetailMix?a:o),this.structureDetailMix+=(r-this.structureDetailMix)*(r>this.structureDetailMix?a:o),Math.abs(n-this.seatDetailMix)<.01&&(this.seatDetailMix=n),Math.abs(r-this.structureDetailMix)<.01&&(this.structureDetailMix=r)}};function $r(t){let e=Math.max(5,t.radius),n=t.focalWorld[0]-t.center[0],r=t.focalWorld[2]-t.center[2],a=Math.hypot(n,r);if(a<e*.12)return{center:t.center,radius:e,polarDeg:48};let o=Math.min(a*.25,e*.2);return{center:[t.center[0]+n/a*o,t.center[1],t.center[2]+r/a*o],radius:e+o,polarDeg:50}}import{Quat as Is,Vec3 as Ds}from"ogl";function Kr(){let t="http://www.w3.org/2000/svg",e=document.createElementNS(t,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("width","18"),e.setAttribute("height","18"),e.setAttribute("aria-hidden","true"),e.setAttribute("focusable","false"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round");let n=document.createElementNS(t,"path");return n.setAttribute("d","M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 0 2 2v3M8 21H5a2 2 0 0 0-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3"),e.appendChild(n),e}function Qr(t){let{container:e,model:n,opts:r,orbit:a,cinematic:o,analytics:i,loop:s,labelOverlay:l,stageAzimuth:c,overviewFraming:f}=t,p=0,u=-1,m=(x,I,z=28)=>{a.camera.position.set(x[0],x[1],x[2]),a.camera.lookAt(new Ds(I[0],I[1],I[2])),a.camera.fov=z,a.camera.updateProjectionMatrix()},d=document.createElement("button");d.className="sl-3d-overview-control sl-3d-icon-control",d.type="button",d.replaceChildren(Kr());let y=r.navLabels?.fitView??"Show whole venue";d.setAttribute("aria-label",y),d.title=y,Object.assign(d.style,{width:"44px",minWidth:"44px",minHeight:"44px",padding:"9px",borderRadius:"999px",background:"rgba(12,18,32,0.72)",color:"#c9d4ea",border:"1px solid rgba(150,165,205,0.35)",backdropFilter:"blur(6px)",font:"600 11px/1 inherit",cursor:"pointer",whiteSpace:"nowrap"});let v=()=>{d.firstElementChild||d.replaceChildren(Kr())};v();let w=x=>{u=x;let I=t.gpu();I&&(I.seatProgram.uniforms.uFocusFloor.value=x,I.solidProgram.uniforms.uFocusFloor.value=x,I.chairProgram.uniforms.uFocusFloor.value=x),t.showSectionSeatLabels(null)},E=null,C=!1,D=()=>{if(E=null,C=!1,t.setSeeThrough?.(null),t.isDisposed())return;r.onViewTargetChange?.(null),r.onSectionFocusChange?.(null),t.panorama()&&(t.panorama().dispose(),t.setPanorama(null),i.panoramaClosed()),t.setPanoramaSphereVisible(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),t.restorePanoramaLayer(),d.style.display="",l.setVisible(!0),t.setFrozen(!1);let x=u>=0?n.floors[u]:null;if(t.setNearFieldDetailEnabled(!!x),t.setSeatViewLocked(!1),A(),t.removeArriveChip(),t.setNavigationMode("auto"),x){let I=x.focalWorld[0]-x.center[0],z=x.focalWorld[2]-x.center[2],_=Math.hypot(I,z)>x.radius*.12?Math.atan2(I,z):c,O={center:x.center,radius:x.radius,box:x.box},G={polarDeg:58,margin:1.12};t.reducedMotion()?a.frame(O,!1,_,!1,G):a.frameSoft(O,_,!1,G)}else t.reducedMotion()?a.frame(n.bounds,!1,c,r.portraitOverviewCrop===!0,f):a.frameSoft(n.bounds,c,r.portraitOverviewCrop===!0,f);l.setOverviewDistance(a.targetDistance),t.showSectionSeatLabels(null),s.requestRender()},A=()=>{p++,t.setSeatStepping(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),o.active&&(o.cancel(),a.resumeAfterFlight(n.focalWorld))},R=x=>{if(t.isDisposed()||!t.gpu())return Promise.resolve();let I=n.seats.idToIndex.get(x);if(I===void 0)return Promise.resolve();t.setNearFieldDetailEnabled(!0),r.onViewTargetChange?.(x),t.panorama()&&(t.panorama().dispose(),t.setPanorama(null),t.setPanoramaSphereVisible(!1),d.style.display="",t.restorePanoramaLayer()),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),t.setFrozen(!1);let z=t.inSeatView()&&r.arriveAtSeatEye===!0;t.setSeatStepping(z),t.setSeatViewLocked(!1);let _=++p;z?t.showArriveChip(x,_):t.removeArriveChip();let{eye:O,focal:G}=t.resolvedSeatViewPose(x,I),B=r.arriveAtSeatEye?t.seatViewArrival(x,I):null,W=B&&B.stops.length>1&&B.stops[1].name==="row"?B.stops[1]:null,N=B?B.focal:G,te=[a.camera.position.x,a.camera.position.y,a.camera.position.z],X=vn(te,B?.eye??O,N,n.bounds.center,n.bounds.radius),J=W?W.eye:B?B.eye:r.arriveAtSeatEye?O:X.finalPos,M=B?B.fov:r.arriveAtSeatEye?e.clientWidth/Math.max(1,e.clientHeight)<.7?Rt:65:28,P=[X.waypoints[0],X.waypoints[1],J];if(l.setVisible(!1),t.reducedMotion())return t.setSeatStepping(!1),m(J,N,M),s.requestRender(),i.cinematicSkipped(),t.isDisposed()||a.syncFromCamera(),t.setSeatViewLocked(r.arriveAtSeatEye===!0),B&&t.enterSeatView(B.stops),t.showArriveChip(x,_),Promise.resolve();let S=new Is().copy(a.camera.quaternion),Y=gr(a.camera,J,N);s.requestRender();let Z=z?700:2500;return o.start(P,S,Y,Z,M).then(()=>{t.isDisposed()||_!==p||(t.setSeatStepping(!1),i.cinematicPlayed(Z),a.resumeAfterFlight(N),t.setSeatViewLocked(r.arriveAtSeatEye===!0),B&&t.enterSeatView(B.stops,W?1:0),s.requestRender(),t.showArriveChip(x,_))})},L=(x,I)=>{let z=n.sections.find(_=>_.id===x);if(!z||z.seatCount===0)return!1;if(E=x,C=!1,t.setSeeThrough?.(null),t.setNearFieldDetailEnabled(!0),t.setSeatStepping(!1),t.setSeatViewLocked(!1),o.cancel(),t.removeArriveChip(),n.floors.length>1&&u!==z.floorIndex&&w(z.floorIndex),t.setNavigationMode("auto"),t.panorama()||l.setVisible(!0),t.showSectionSeatLabels(x),!I?.keepCamera){let _=$r(z),O={polarDeg:_.polarDeg,margin:1.12};t.reducedMotion()?a.frame({center:_.center,radius:_.radius},!1,a.currentAzimuth,!1,O):a.glideTo({center:_.center,radius:_.radius},O)}return r.onSectionFocusChange?.(x),s.requestRender(),!0},b=(x,I)=>{if(t.isDisposed()||!t.gpu())return!1;let z=n.seats.idToIndex.get(x);if(z===void 0)return!1;let _=z*3,O=[n.seats.iPosition[_],n.seats.iPosition[_+1]+.55,n.seats.iPosition[_+2]],G=I?Fs(I,a.fovY,a.camera.aspect||1):Zr;return C=!0,t.setSeeThrough?.(O),t.reducedMotion()?a.frame({center:O,radius:G},!1,void 0,!1,wn):a.frameSoft({center:O,radius:G},void 0,!1,wn),s.requestRender(),!0},F=()=>{if(t.isNarrow?.()&&C&&E&&L(E)){s.requestRender();return}D()};return d.addEventListener("click",F),{overviewChip:d,layoutOverviewChip:v,flightGen:()=>p,focusedFloor:()=>u,applyFloorFocus:w,placeCameraFinal:m,cancelFlight:A,focusOverview:D,flyToSeat:R,focusSectionCamera:L,focusSeatCamera:b}}var Zr=4.5;function Fs(t,e,n){let r=Math.tan(e*Math.PI/360),a=r*Math.max(.001,n),i=ks*t.viewportHeightPx/(2*Math.max(1,t.seatPx)*r)*Math.min(r,a)/wn.margin;return Math.max(Ls,Math.min(Zr,i))}var ks=.5,Ls=1.5,wn={polarDeg:48,margin:1.25};function Mn(t,e,n,r,a,o,i,s,l=.5){let c=-1,f=s*s,p=1/0;for(let u=0;u<e;u++){let m=u*3,d=Ae(n,[t[m],t[m+1]+l,t[m+2]],r,a);if(!d.visible)continue;let y=d.x-o,v=d.y-i,w=y*y+v*v;(w<f-4||w<f+4&&d.depth<p)&&(c=u,f=Math.min(f,w),p=d.depth)}return c}function Jr(t){let e=performance.now(),{input:n,estimate:r}=ho(t);return{model:nt(n),buildMs:performance.now()-e,source:"main",...r?{estimate:r}:{}}}function Vs(t){let e=Wn(t.doc);return{...Jr({...t,seats:e}),seats:e}}function ea(t,e,n){let r=o=>({...e(),fallbackReason:o});if(typeof Worker>"u")return Promise.resolve(r("unavailable"));let a;try{a=new Worker(new URL("./scene/scene.worker.js",import.meta.url),{type:"module"})}catch{return Promise.resolve(r("unavailable"))}return new Promise(o=>{let i=!1,s=f=>{i||(i=!0,clearTimeout(c),a.terminate(),o(f))},l=f=>s(r(f)),c=window.setTimeout(()=>l("timeout"),15e3);a.onerror=()=>l("worker_error"),a.onmessage=f=>{let p=n(f.data);p?s(p):l("bad_response")},a.postMessage(t)})}function Os(t){return ea(t,()=>Jr(t),({model:e,buildMs:n,estimate:r})=>({model:e,buildMs:n,source:"worker",...r?{estimate:r}:{}}))}function zs(t){return ea(t,()=>Vs(t),({model:e,buildMs:n,seats:r,estimate:a})=>r?{model:e,buildMs:n,seats:r,source:"worker",...a?{estimate:a}:{}}:null)}var Hs=40,Gs=48,Bs=Math.PI/180,Ws=6,Us=500,Ys=6;function gu(t,e,n={}){let r=performance.now(),a=e.prepared?e.prepared.estimate:e.estimate===!1?null:Qt(e.doc,e.seats);a&&(e={...e,doc:a.doc,seats:mo(e.seats,a)});let o=e.prepared?.model??nt(e),i=new Dt(n.onAnalytics),s=new Array(o.seats.count);for(let[h,g]of o.seats.idToIndex)s[g]=h;let l=new Map(e.seats.map(h=>[h.id,h])),c=new Map;for(let h of e.seats){if(!h.rowId)continue;let g=c.get(h.rowId);g?g.push(h.id):c.set(h.rowId,[h.id])}let f=new Map,p=[0,0,0,0];function u(){if(v)for(let h of[v.seatProgram,v.solidProgram,v.chairProgram])h.uniforms.uSeeThrough.value=p}e.seats.forEach((h,g)=>{f.set(h.id,o.seatSectionIds?.[g]??h.sectionId)});let m=new Map;for(let[h,g]of o.seats.idToIndex){let T=f.get(h);if(!T)continue;let V=m.get(T);V?V.push(g):m.set(T,[g])}let d=()=>{if(!v||!o.sectionSolidRanges.length)return;let{lit:h,anyUnlit:g}=nr(o.sectionSolidRanges,m,o.seats.iState);v.setSectionShellLit(g?h:null)},y=e.doc.floors?.some(g=>(g.baseHeightM??0)>0)?!0:(e.doc.floors?.flatMap(g=>g.objects)??e.doc.objects).some(g=>g.type==="section"&&((g.height??0)>0||(g.rake??0)>0)),v=null,w=null,E=null,C=!1,D=!1,A=!1,R=new Map,L=null,b=null,F=null,x=new Map,I=null,z=()=>{F===null&&(F=t.style.zIndex,t.style.zIndex="20")},_=()=>{F!==null&&(t.style.zIndex==="20"&&(t.style.zIndex=F),F=null)},O=!1,G=()=>O?fe.focusedFloor():-1,B=()=>{v=sr(P.gl,o),w?.dispose(),w=Fo(P.gl,[1,1,1],o.theme.seatStates.selected),In(!1),d(),An(),E=new Et(P.renderer,v.seatGeometry,v.chairGeometry,v.solidGeometry,o.seats.count),P.setClearColor(o.theme.background.top),E.setRestoreClear(o.theme.background.top),E.setRoomCentre(o.room?.centre),v.seatProgram.uniforms.uSeatRadius.value=et*o.theme.seatScale,v.seatProgram.uniforms.uFocusFloor.value=G(),v.solidProgram.uniforms.uFocusFloor.value=G(),v.chairProgram.uniforms.uFocusFloor.value=G(),v.screenProgram&&(v.screenProgram.uniforms.uFocusFloor.value=G()),u(),N.forceRegather()},W=!1,N=new kt({model:o,orbit:()=>S,gpu:()=>v}),te=!1,X=new Map,J=24,M=h=>N.setDetailEnabled(h),P=new St(t,{onContextLost:()=>{A||i.contextLost(),C=!0,ie.stop(),v=null,E=null},onContextRestored:()=>{B(),C=!1,A||i.contextRestored(),ie.requestRender()}}),S=new wt(P.gl,P.canvas,()=>ie.requestRender(),()=>i.orbitEngaged());S.setAspect(P.aspect);let Y=(e.doc.floors?.flatMap(h=>h.objects)??e.doc.objects).some(h=>h.type==="section"&&h.physical3dProvenance?.surfaceKind?.status==="inferred"),Z=(()=>{if(Number.isFinite(n.overviewAzimuthDeg))return n.overviewAzimuthDeg*Math.PI/180;if(!(Y&&o.stages.length===0))return po(o.focalWorld,o.seats.iPosition,o.bounds)})(),ge=(e.doc.floors?.flatMap(h=>h.objects)??e.doc.objects).some(h=>h.type==="shape"&&h.stageKind?.startsWith("pitch-")),ce=o.floors.length>1?{polarDeg:48,margin:1.1}:{polarDeg:ge?36:48,margin:1.05},he=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;S.frame(o.bounds,!he&&n.skipInitialOverviewAnimation!==!0,Z,n.portraitOverviewCrop===!0,ce);let oe=new Tt(S.camera),ye=Wr(t),pe=fo(t,o),$=new Pt(t,{fontFamily:e.doc.theme?.fontFamily,ink:e.doc.theme?.textColor,backgroundRgb:o.theme.background.top}),U=o.labels,ee=()=>to(U,o.floors.length,G());$.setLabels(ee()),$.setOverviewDistance(S.targetDistance);let q=()=>{let h=new Map,g=Se.indexOf("available");for(let T of U){if(!T.wheelchairSeats)continue;let V=0;for(let H of T.wheelchairSeats)o.seats.iState[H]===g&&V++;V>0&&h.set(T.id,V)}return $.setWheelchairFree(h)};q();let K=null,ne=()=>[...R.keys()].flatMap(h=>{let g=o.seats.idToIndex.get(h),T=g===void 0?void 0:e.seats[g];if(g===void 0||T?.id!==h)return[];let V=g*3;return[{id:`seat:${h}`,kind:"seat",seatWidthM:o.seats.iChairWidth[g]*2,text:T.displayLabel||T.label,anchor:[o.seats.iPosition[V],o.seats.iPosition[V+1]+1.05,o.seats.iPosition[V+2]],pinBase:Vt(V)}]}),se=-1,An=()=>{v&&(se=K?o.sections.findIndex(h=>h.id===K):-1,v.seatProgram.uniforms.uFocusSection.value=se,v.chairProgram.uniforms.uFocusSection.value=se)},ht=h=>{if(K=h,An(),$.setForcedDense(!!h),!h){let k=ne(),le=new Set(k.map(ae=>ae.id));$.setLabels([...ee().filter(ae=>!le.has(ae.id)),...k]);return}let g=e.seats.filter(k=>f.get(k.id)===h),T=new Set(g.map(k=>k.id)),V=new Set(g.map(k=>k.rowId)),H=new Set(R.keys()),Q=new Set(g.filter(k=>H.has(k.id)).map(k=>k.id)),j=ee().filter(k=>k.kind!=="row"&&k.kind!=="seat"&&k.kind!=="access"||k.kind==="access"&&T.has(k.id.slice(7))||(k.kind==="row"?V.has(k.id.slice(4)):T.has(k.id.slice(5))));if(o.seatCount<=6e3&&Q.size===0){$.setLabels(j);return}let re=g,me=new Set(re.map(k=>`seat:${k.id}`)),be=re.flatMap(k=>{let le=o.seats.idToIndex.get(k.id);if(le===void 0)return[];let ae=le*3;return[{id:`seat:${k.id}`,kind:"seat",seatWidthM:o.seats.iChairWidth[le]*2,rowId:k.rowId,text:H.has(k.id)?k.displayLabel||k.label:uo(k.displayLabel||k.label),anchor:[o.seats.iPosition[ae],o.seats.iPosition[ae+1]+(H.has(k.id)?1.05:.55),o.seats.iPosition[ae+2]],...H.has(k.id)?{pinBase:Vt(ae)}:{}}]});$.setLabels([...j.filter(k=>!me.has(k.id)),...be])};B();let we=null,Lt=null,Pn=new Ns,pt=h=>{if(C||!v||D)return!1;let g=Hr({flying:oe.active,panoramaMounted:L!==null,seatViewActive:we?.active===!0}),T=g==="orbit"?se:-1;v.seatProgram.uniforms.uFocusSection.value=T,v.chairProgram.uniforms.uFocusSection.value=T;let V=te?!1:g==="cinematic"?oe.update(performance.now()):g==="seatView"?we.update(performance.now()):g==="orbit"?S.update():!1;Lt?.syncZoomLimits(),Lt?.syncNavigationMode();let H=G()>=0?o.floors[G()]:null,Q=H?.radius??o.bounds.radius,j=Ro(S.currentDistance,Q),re=W?{center:[S.camera.position.x,S.camera.position.y,S.camera.position.z],radius:520}:o.clipBounds??o.renderBounds;S.updateClipping(re);let me=H?.center??o.renderBounds.center,be=H?.radius??o.renderBounds.radius,k=(ue,Xt)=>Math.hypot(S.camera.position.x-ue[0],S.camera.position.y-ue[1],S.camera.position.z-ue[2])<=Xt*(N.detailVisible?1.8:1.55),le=k(me,be);if(!le&&K){let ue=o.sections.find(Xt=>Xt.id===K);ue&&(le=k(ue.center,Math.max(12,ue.radius*2)))}N.detailVisible=le;let ae=v.seatProgram.uniforms;ae.uSeatScale.value=j.scale,ae.uSeatFade.value=j.fade;let xe=!!H&&_o(H.seatCount,P.canvas.clientWidth||1,P.canvas.clientHeight||1),_e=Io(o.seats.count,Q,S.currentDistance,S.camera.fov,P.canvas.clientHeight||1),Ke=N.detailVisible||xe||_e?1:0,Qe=N.detailVisible||G()>=0||o.floors.length>1?1:0;N.ease(h,Ke,Qe),ae.uSeatDetail.value=N.seatDetailMix;let bt=Ke===0&&N.seatDetailMix<.01;v.seatGeometry.setDrawRange(bt?Zt:0,bt?vo:Zt),v.solidProgram.uniforms.uStructureDetail.value=N.structureDetailMix,ae.uMinPixels.value=j.minPixels,ae.uPixelToWorld.value=2*Math.tan(S.camera.fov*Bs/2)/Math.max(1,P.pixelHeight),N.update(N.detailVisible),o.outdoor&&(Pn.copy(S.camera.projectionViewMatrix).inverse(),v.backgroundProgram.uniforms.uInvViewProj.value.set(Pn)),P.renderer.render({scene:v.background,clear:!0}),P.renderer.render({scene:v.main,camera:S.camera,clear:!1});let Ze=w?w.update(performance.now(),[S.camera.position.x,S.camera.position.y,S.camera.position.z],L!==null,g==="seatView"):!1;if(w&&P.renderer.render({scene:w.root,camera:S.camera,clear:!1}),pe){let ue=S.camera.worldMatrix;pe.update(g==="seatView"?[S.camera.position.x,S.camera.position.y,S.camera.position.z]:null,[-ue[8],-ue[9],-ue[10]])}$.update(S.camera.projectionViewMatrix,P.canvas.clientWidth||1,P.canvas.clientHeight||1,S.currentDistance,Q,[S.camera.position.x,S.camera.position.y,S.camera.position.z]);let Oe=V||Ze||N.seatDetailMix!==Ke||N.structureDetailMix!==Qe;return Cn(!Oe),Oe},Cn=Ao(t),ie=new Mt(pt),En=typeof ResizeObserver<"u"?new ResizeObserver(()=>Yt.resize()):null;En?.observe(t),S.setZoomPointResolver((h,g)=>{let T=P.canvas.getBoundingClientRect(),V=P.canvas.clientWidth||T.width,H=P.canvas.clientHeight||T.height;if(!(V>0)||!(H>0))return null;S.camera.updateMatrixWorld();let Q=Mn(o.seats.iPosition,o.seats.count,S.camera.projectionViewMatrix,V,H,h-T.left,g-T.top,Hs);if(Q<0)return null;let j=Q*3;return[o.seats.iPosition[j],o.seats.iPosition[j+1]+.5,o.seats.iPosition[j+2]]});function Vt(h){return[o.seats.iPosition[h],o.seats.iPosition[h+1]+.5,o.seats.iPosition[h+2]]}$.setSeatNumberRow(null);let Me=null,Te=0,Ot=null,Tn=()=>{Te=0;let h=null,g=null;if(Me&&!we?.active&&!oe.active){let H=P.canvas.getBoundingClientRect(),Q=P.canvas.clientWidth||H.width,j=P.canvas.clientHeight||H.height;if(Q>0&&j>0){let re=Mn(o.seats.iPosition,o.seats.count,S.camera.projectionViewMatrix,Q,j,Me.x-H.left,Me.y-H.top,Gs);h=re>=0?e.seats[re]?.rowId??null:null;let me=re>=0?e.seats[re]?.id??null:null;if(g=me,Me.mouse&&!Me.pressing&&!!K&&!!me&&f.get(me)===K){let k=t.getBoundingClientRect();Ot=me,n.onSeatHover?.(me,{x:Me.x-k.left,y:Me.y-k.top})}else Rn()}}else Rn();let T=Me?.mouse?g:null,V=$.setSeatNumberSeat(T);($.setSeatNumberRow(h)||V)&&ie.requestRender()};function Rn(){Ot!==null&&(Ot=null,n.onSeatHover?.(null,null))}let ft=h=>{Me={x:h.clientX,y:h.clientY,mouse:h.pointerType==="mouse",pressing:h.type==="pointerdown"},Te||(Te=requestAnimationFrame(Tn))},_n=h=>{h.pointerType==="mouse"&&(Me=null,Te||(Te=requestAnimationFrame(Tn)))};P.canvas.addEventListener("pointermove",ft),P.canvas.addEventListener("pointerdown",ft),P.canvas.addEventListener("pointerleave",_n);function In(h){if(!w)return;let g=[];for(let T of R.keys()){let V=o.seats.idToIndex.get(T);if(V===void 0)continue;let H=V*3;g.push({id:T,position:Vt(H)})}w.setSeats(g,performance.now(),h)}let Dn=h=>{let g=H=>{let Q=o.seats.idToIndex.get(H);return Q===void 0?void 0:o.seats.iState[Q]},{updates:T,next:V}=dr(R,h,g);if(R=V,$.setSelectedSeatIds(R.keys()),In(!qe()),ie.requestRender(),ht(K),T.length){let H=$t(o.seats,T);v&&v.uploadSeatStateRuns(H),d(),ie.requestRender()}},qe=()=>I!==null?I:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,ta=8,Fn=h=>{if(!n.getSeatView)return null;let g=x.get(h);if(!g)for(g=Promise.resolve(n.getSeatView(h)),x.set(h,g),g.catch(()=>{x.get(h)===g&&x.delete(h)});x.size>ta;){let T=x.keys().next().value;if(T===void 0)break;x.delete(T)}return g},kn=Dr(o.stages,o.focalWorld,o.bounds.groundY??0),Ln=yn(kn),zt=(h,g)=>{let T=l.get(h),V=Math.max(0,Math.round(o.seats.iFloor[g]??0)),H=e.doc.floors?.[V],Q=o.floors[V],j=H?.focalPoint??e.doc.focalPoint,re=Q?{x:Q.focalWorld[0]/ze,y:Q.focalWorld[2]/ze}:j,me=T?.focalPoint?{x:T.focalPoint.x+re.x-j.x,y:T.focalPoint.y+re.y-j.y}:re,be=[o.seats.iPosition[g*3],o.seats.iPosition[g*3+1],o.seats.iPosition[g*3+2]],k=Sr(o.seats.iPosition,g,Ln),le=k!==null&&Math.abs(k)<xr;return wr(be,me,H?.baseHeightM??0,T?.eyeHeightM,Ln,le)},Nt=()=>(t.clientWidth||P.canvas.clientWidth)<=520,Ht=null,Vn=null,na=async(h,g,T)=>{if(!n.getSeatView||A||T!==fe.flightGen())return;let V;try{V=await Gr()}catch{if(i.panoramaFailed(h,"mount"),!A&&T===fe.flightGen()){let H=Bt(h,T,!0);requestAnimationFrame(()=>H?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(A||T!==fe.flightGen()||!Ht))return Vn??=V.createOpenPanorama(Ht),Vn(h,g,T)},Gt=Ur({container:t,model:o,opts:n,expandedSeatById:l,seatIdsByRow:c,isNarrow:Nt,isDisposed:()=>A,flightGen:()=>fe.flightGen(),flyToSeat:h=>Gn(h),openPanorama:(h,g,T)=>na(h,g,T)}),Bt=Gt.show,Wt=Gt.remove,oa=Gt.layout,Re=Yr({container:t,orbit:S,isNarrow:Nt,enabled:n.chrome?.controlDock!==!1,...n.navLabels?{labels:n.navLabels}:{}});Lt=Re;let ra=Re.element,je=Re.setNavigationMode,aa=Re.layout,ia=Re.utilityControls,$e=null,On=!1,vt=h=>{Re.setSeatViewLocked(h),h||we?.exit()};we=Nr({canvas:P.canvas,camera:S.camera,requestRender:()=>ie.requestRender(),reducedMotion:qe,onStopChange:h=>{let g=h??(On?"seat":null);$e=g;try{n.onSeatViewStopChange?.(g)}catch{}},onApplied:()=>{A||S.syncFromCamera()}});let zn=o.sections.reduce((h,g)=>g.seatCount>0&&g.box?Math.max(h,g.box.max[1]):h,-1/0),Nn=(h,g)=>{let{eye:T}=zt(h,g),V=(t.clientWidth||P.canvas.clientWidth||1)/Math.max(1,t.clientHeight||P.canvas.clientHeight||1),H=kr(T,kn,V,{preserveEye:!0});if(n.seatViewStops===!1)return{...H,stops:[]};let Q=f.get(h),j=Q?o.sections.find(re=>re.id===Q):void 0;return{...H,stops:Lr(H,{aspect:V,seatingTopY:Number.isFinite(zn)?zn:o.bounds.box.max[1],section:j&&j.seatCount>0?{center:j.center,radius:j.radius}:null,venue:{center:o.bounds.center,radius:o.bounds.radius}})}},fe=Qr({isNarrow:Nt,setSeeThrough:h=>{p=h?[h[0],h[1],h[2],Ys]:[0,0,0,0],u(),ie.requestRender()},container:t,model:o,opts:n,orbit:S,cinematic:oe,analytics:i,loop:ie,labelOverlay:$,stageAzimuth:Z,overviewFraming:ce,gpu:()=>v,isDisposed:()=>A,panorama:()=>L,setPanorama:h=>{L=h},setPanoramaSphereVisible:h=>{W=h},panoramaLoadAbort:()=>b,setPanoramaLoadAbort:h=>{b=h},setFrozen:h=>{D=h},restorePanoramaLayer:_,reducedMotion:qe,resolvedSeatViewPose:zt,showSectionSeatLabels:ht,setNearFieldDetailEnabled:M,setSeatViewLocked:vt,setNavigationMode:je,showArriveChip:Bt,removeArriveChip:Wt,inSeatView:()=>$e!==null,setSeatStepping:h=>{On=h},seatViewArrival:(h,g)=>n.arriveAtSeatEye?Nn(h,g):null,enterSeatView:(h,g)=>we?.enter(h,g)});O=!0;let Ut=fe.overviewChip,sa=fe.layoutOverviewChip,la=fe.applyFloorFocus,ca=fe.focusOverview,Hn=fe.cancelFlight,Gn=fe.flyToSeat,Bn=fe.focusSectionCamera;ia.appendChild(Ut),Ht={container:t,model:o,opts:n,analytics:i,orbit:S,loop:ie,seatsById:l,ensureSeatView:Fn,resolvedSeatViewPose:zt,gpu:()=>v,gl:P.gl,isContextLost:()=>C,isDisposed:()=>A,flightGen:()=>fe.flightGen(),setPanorama:h=>{L=h},getLoadAbort:()=>b,setLoadAbort:h=>{b=h},setPanoramaSphereVisible:h=>{W=h,h&&we?.exit()},setFrozen:h=>{D=h},raisePanoramaLayer:z,restorePanoramaLayer:_,getOverviewChip:()=>Ut,labelOverlay:$,reducedMotion:qe,removeArriveChip:Wt,showArriveChip:Bt};let Ce=jr({glctx:P,orbit:S,model:o,seats:e.seats,opts:n,cinematic:oe,analytics:i,seatIdByIndex:s,sectionIdBySeatId:f,tapSlop:Ws,tapMs:Us,gpu:()=>v,pick:()=>E,seatViewLocked:()=>Re.seatViewLocked(),focusedSectionId:()=>K,selection:()=>R,cancelFlight:Hn,focusSectionCamera:Bn,focusSeatCamera:fe.focusSeatCamera,setSelection:Dn,ensureSeatView:Fn});P.canvas.addEventListener("pointerdown",Ce.onDown),P.canvas.addEventListener("pointermove",Ce.onMove),P.canvas.addEventListener("pointerup",Ce.onUp),P.canvas.addEventListener("pointercancel",Ce.onUp),ie.requestRender();let Yt={setAvailability(h){let g=ur(R,h),T=$t(o.seats,g);T.length&&v&&v.uploadSeatStateRuns(T),d(),T.length&&q(),ie.requestRender()},setSelection:Dn,setNavigationMode:je,zoomIn(){S.zoomBy(He),ie.requestRender()},zoomOut(){S.zoomBy(ot),ie.requestRender()},flyToSeat:Gn,focusOverview:ca,seatViewStop:()=>$e,recentreSeatView:()=>we?.recentre()??!1,resize(){let{width:h,height:g}=P.resize();S.setAspect(h/Math.max(1,g)),oa(),aa(),sa(),ie.requestRender()},stats(){return{...ie.stats(),drawCalls:v?v.drawCalls:0,fallbackTriangles:v?v.seatGeometry.drawRange.count/3*o.seats.count:0,seatCount:o.seatCount}},captureImage(h=1280){if(C||!v||typeof document>"u")return null;pt(0);let g=P.canvas,T=Math.min(1,h/Math.max(g.width,g.height,1)),V=document.createElement("canvas");V.width=Math.max(1,Math.round(g.width*T)),V.height=Math.max(1,Math.round(g.height*T));let H=V.getContext("2d");return H?(H.drawImage(g,0,0,V.width,V.height),V.toDataURL("image/jpeg",.82)):null},captureSeatView(h,g=480){if(C||!v||D||typeof document>"u"||oe.active||L!==null||we?.active)return null;let T=X.get(h);if(T)return T;let V=o.seats.idToIndex.get(h);if(V===void 0)return null;let{eye:H,focal:Q,fov:j}=Nn(h,V),re=S.snapshot(),me=[N.seatDetailMix,N.structureDetailMix],be=null;try{te=!0,S.camera.position.set(H[0],H[1],H[2]),S.camera.perspective({fov:j,aspect:S.camera.aspect}),S.camera.lookAt(Q),S.camera.updateMatrixWorld(),S.syncFromCamera(),N.seatDetailMix=1,N.structureDetailMix=1,N.forceRegather(),pt(0);let k=P.canvas,le=Math.min(k.width,Math.round(k.height*16/9)),ae=Math.round(le*9/16),xe=document.createElement("canvas");xe.width=Math.max(1,Math.round(g)),xe.height=Math.max(1,Math.round(g*9/16));let _e=xe.getContext("2d");_e&&(_e.drawImage(k,(k.width-le)/2,(k.height-ae)/2,le,ae,0,0,xe.width,xe.height),be=xe.toDataURL("image/jpeg",.8))}finally{te=!1,re(),N.seatDetailMix=me[0],N.structureDetailMix=me[1],N.forceRegather(),pt(0)}if(be)for(X.set(h,be);X.size>J;)X.delete(X.keys().next().value);return be},getQualityEvidence(){let h=ie.stats(),g=P.canvas.clientWidth||1,T=P.canvas.clientHeight||1,V=o.bounds.center,H=Ae(S.camera.projectionViewMatrix,[V[0],o.bounds.box.min[1],V[2]],g,T),Q=Ae(S.camera.projectionViewMatrix,[V[0],o.bounds.box.max[1],V[2]],g,T),j=o.bounds.box,re=[j.min[0],j.max[0]].flatMap(k=>[j.min[1],j.max[1]].flatMap(le=>[j.min[2],j.max[2]].map(ae=>Ae(S.camera.projectionViewMatrix,[k,le,ae],g,T)))).filter(k=>Number.isFinite(k.x)&&Number.isFinite(k.y)&&Number.isFinite(k.depth)),me=re.length?(()=>{let k=Math.min(...re.map(ue=>ue.x)),le=Math.max(...re.map(ue=>ue.x)),ae=Math.min(...re.map(ue=>ue.y)),xe=Math.max(...re.map(ue=>ue.y)),_e=Math.max(0,k),Ke=Math.min(g,le),Qe=Math.max(0,ae),bt=Math.min(T,xe),Ze=Math.max(0,Ke-_e),Oe=Math.max(0,bt-Qe);return{box:{x:_e,y:Qe,width:Ze,height:Oe},horizontalFillRatio:Ze/g,verticalFillRatio:Oe/T,visibleAreaRatio:Ze*Oe/(g*T),clippedEdges:[...ae<0?["top"]:[],...le>g?["right"]:[],...xe>T?["bottom"]:[],...k<0?["left"]:[]]}})():void 0,be=String(P.gl.getParameter(P.gl.VERSION)??"");return{viewport:{width:g,height:T},context:{webgl2:/webgl\s*2/i.test(be),lost:C},frame:{rendered:h.rendered,idle:h.idle},camera:{position:[S.camera.position.x,S.camera.position.y,S.camera.position.z],distance:S.currentDistance,verticalFovDeg:S.fovY},scene:{seatCount:o.seatCount,floorCount:o.floors.length,zoneCount:o.zones.length,sectionCount:o.sections.length,authoredRelief:y,renderedVerticalSpanM:Math.max(0,o.bounds.box.max[1]-o.bounds.box.min[1]),projectedReliefPx:H.visible&&Q.visible?Math.abs(H.y-Q.y):0},labels:$.qualityEvidence(),framing:me,...$e?{seatView:{fovDeg:S.camera.fov,stop:$e}}:{}}},getQualityReport(){return un(Yt.getQualityEvidence())},loseContextForTest(){P.simulateContextLossCycle()},floors(){return o.floors},focusFloor(h){if(h!==null&&!o.floors.some(T=>T.index===h))return!1;let g=h??-1;if(M(h!==null),vt(!1),la(g),je("orbit"),h===null)oe.cancel(),qe()?S.frame(o.bounds,!1,Z,n.portraitOverviewCrop===!0,ce):S.frameSoft(o.bounds,Z,n.portraitOverviewCrop===!0,ce),$.setOverviewDistance(S.targetDistance);else{let T=o.floors[h];if(T.seatCount>0){oe.cancel();let V=T.focalWorld[0]-T.center[0],H=T.focalWorld[2]-T.center[2],Q=Math.hypot(V,H)>T.radius*.12?Math.atan2(V,H):Z;S.frame({center:T.center,radius:T.radius,box:T.box},!1,Q,!1,{polarDeg:58,margin:1.12}),$.setOverviewDistance(S.targetDistance)}}return ie.requestRender(),!0},zones(){return o.zones},focusZone(h){let g=o.zones.find(Q=>Q.id===h);if(!g||g.seatCount===0)return!1;M(!1),vt(!1),oe.cancel(),je("orbit"),ht(null),n.onSectionFocusChange?.(null);let T=g.focalWorld[0]-g.center[0],V=g.focalWorld[2]-g.center[2],H=Math.hypot(T,V)>g.radius*.12?Math.atan2(T,V):void 0;return S.frame({center:g.center,radius:g.radius*1.25},!1,H),ie.requestRender(),!0},sections(){return o.sections},focusSection(h){return Bn(h)},rows(h){return h?o.rows.filter(g=>g.sectionId===h):o.rows},seatsInRow(h){return e.seats.filter(g=>g.rowId===h).map(g=>({id:g.id,label:g.displayLabel||g.label}))},focusRow(h){let g=o.rows.find(T=>T.id===h);return!g||g.seatCount===0?!1:(M(!0),vt(!1),oe.cancel(),je("pan"),g.sectionId&&(ht(g.sectionId),n.onSectionFocusChange?.(g.sectionId)),S.frame({center:g.center,radius:Math.max(2.5,g.radius*.65)}),ie.requestRender(),!0)},setReducedMotionForTest(h){I=h},dispose(){A=!0,pe?.dispose(),Cn(!1),Wt(),Ut.remove(),ra.remove(),Hn(),we?.dispose(),ie.stop(),$.dispose(),En?.disconnect(),L&&(L.dispose(),L=null),_(),ye(),P.canvas.removeEventListener("pointerdown",Ce.onDown),P.canvas.removeEventListener("pointermove",Ce.onMove),P.canvas.removeEventListener("pointerup",Ce.onUp),P.canvas.removeEventListener("pointercancel",Ce.onUp),P.canvas.removeEventListener("pointermove",ft),P.canvas.removeEventListener("pointerdown",ft),P.canvas.removeEventListener("pointerleave",_n),Te&&cancelAnimationFrame(Te),S.dispose(),E&&E.dispose(),v&&v.dispose(),v=null,w?.dispose(),w=null,E=null,P.dispose()}};return i.opened(o.seatCount,y,e.prepared?.buildMs??performance.now()-r,e.prepared?.source??"inline"),Yt}export{ui as VENUE3D_QUALITY_REPORT_VERSION,ua as autoVenue3d,nt as buildSceneModel,Qt as estimateVenue3D,un as inspectVenue3DQualityEvidence,gu as mountVenue3D,Os as prepareVenue3D,zs as prepareVenue3DFromChart};
|