@seatlayer/core 0.73.0 → 0.75.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/README.md +3 -2
  2. package/dist/ar-JOSU54ZZ.js +1 -0
  3. package/dist/be-UDIVAZGH.js +1 -0
  4. package/dist/bg-AJX2SNK4.js +1 -0
  5. package/dist/ca-MC23KMQH.js +1 -0
  6. package/dist/{categoryInventory-Bcmnr6ZH.d.ts → categoryInventory-C5I2U-EM.d.ts} +1 -1
  7. package/dist/{categoryInventory-DueSAIBX.d.cts → categoryInventory-DFp26meo.d.cts} +1 -1
  8. package/dist/chunk-KHFCTR3V.js +1 -0
  9. package/dist/{chunk-UX67GDLV.js → chunk-N3DPHRJ3.js} +1 -1
  10. package/dist/{chunk-JLYR66MT.js → chunk-OGIAQX62.js} +1 -1
  11. package/dist/chunk-QUOAQQMP.js +1 -0
  12. package/dist/chunk-SPM2LMKI.js +1 -0
  13. package/dist/{chunk-N5NRM4NW.js → chunk-TN6DFYEV.js} +1 -1
  14. package/dist/{chunk-ZMYRXJOA.js → chunk-UVAV3E7K.js} +1 -1
  15. package/dist/chunk-X2GZ5O7C.js +1 -0
  16. package/dist/{chunk-BAWUBGWY.js → chunk-YACNGDTE.js} +1 -1
  17. package/dist/core/chart-ops/index.cjs +1 -1
  18. package/dist/core/chart-ops/index.d.cts +4 -4
  19. package/dist/core/chart-ops/index.d.ts +4 -4
  20. package/dist/core/chart-ops/index.js +1 -1
  21. package/dist/core/inventory/index.cjs +1 -1
  22. package/dist/core/inventory/index.d.cts +4 -4
  23. package/dist/core/inventory/index.d.ts +4 -4
  24. package/dist/core/inventory/index.js +1 -1
  25. package/dist/core/layout/index.cjs +1 -1
  26. package/dist/core/layout/index.d.cts +5 -5
  27. package/dist/core/layout/index.d.ts +5 -5
  28. package/dist/core/layout/index.js +1 -1
  29. package/dist/core/quality/index.d.cts +3 -3
  30. package/dist/core/quality/index.d.ts +3 -3
  31. package/dist/core/render-assets/index.d.cts +1 -1
  32. package/dist/core/render-assets/index.d.ts +1 -1
  33. package/dist/core/render-assets/index.js +1 -1
  34. package/dist/core/seatConfidence.d.cts +1 -1
  35. package/dist/core/seatConfidence.d.ts +1 -1
  36. package/dist/core/sections/index.cjs +1 -1
  37. package/dist/core/sections/index.d.cts +5 -5
  38. package/dist/core/sections/index.d.ts +5 -5
  39. package/dist/core/sections/index.js +1 -1
  40. package/dist/cs-Q4OEV3NE.js +1 -0
  41. package/dist/cy-TPDRMPTK.js +1 -0
  42. package/dist/da-U6XXTCII.js +1 -0
  43. package/dist/de-ZV54ZWHR.js +1 -0
  44. package/dist/el-5VQKNNQV.js +1 -0
  45. package/dist/es-Y3BNIAEW.js +1 -0
  46. package/dist/et-HCCA6TE3.js +1 -0
  47. package/dist/{eventConfigurations-C7YAqkFR.d.ts → eventConfigurations-BQGuLLv0.d.ts} +1 -1
  48. package/dist/{eventConfigurations-DwXdrjqj.d.cts → eventConfigurations-DAaOaKJK.d.cts} +1 -1
  49. package/dist/fa-SZ3EAODM.js +1 -0
  50. package/dist/fi-S34TMT35.js +1 -0
  51. package/dist/fr-RQIXNHQ5.js +1 -0
  52. package/dist/he-PPNABESI.js +1 -0
  53. package/dist/hr-IZOGRWC5.js +1 -0
  54. package/dist/hu-K7EOGFAB.js +1 -0
  55. package/dist/index.cjs +1 -1
  56. package/dist/index.d.cts +148 -14
  57. package/dist/index.d.ts +148 -14
  58. package/dist/index.js +1 -1
  59. package/dist/it-PD5WJDNR.js +1 -0
  60. package/dist/ja-3CFZ2KK6.js +1 -0
  61. package/dist/ku-MQJTRLDV.js +1 -0
  62. package/dist/{labeling-iugoy25P.d.cts → labeling-BZp91HiS.d.cts} +1 -1
  63. package/dist/{labeling-BUCj-kHU.d.ts → labeling-Duul2sao.d.ts} +1 -1
  64. package/dist/{layout-Dv3R0Mpw.d.ts → layout-DGbWo5fV.d.ts} +12 -3
  65. package/dist/{layout-DPJX6D9k.d.cts → layout-Gkx3fo5_.d.cts} +12 -3
  66. package/dist/localeLoaders-ETY2H7H3.js +1 -0
  67. package/dist/lt-6Q5DJHXR.js +1 -0
  68. package/dist/lv-BQ3LWGW6.js +1 -0
  69. package/dist/nl-ZPVH2YGT.js +1 -0
  70. package/dist/no-R7I6YW7N.js +1 -0
  71. package/dist/openPanorama-6FMXAJ6O.js +20 -0
  72. package/dist/pl-EU2O5DYI.js +1 -0
  73. package/dist/pt-UMSFOY5P.js +1 -0
  74. package/dist/{renderedQuality-CfonzUpl.d.ts → renderedQuality-BYhJ3Cer.d.ts} +1 -1
  75. package/dist/{renderedQuality-CSHrmnHf.d.cts → renderedQuality-CEPse8ir.d.cts} +1 -1
  76. package/dist/{renderer-Dn4Plcv9.d.cts → renderer-BlLKrW-U.d.ts} +17 -1
  77. package/dist/{renderer-C5avrVLy.d.ts → renderer-Cv_gzYvT.d.cts} +17 -1
  78. package/dist/ro-GR35LU2L.js +1 -0
  79. package/dist/ru-CXYAZQEV.js +1 -0
  80. package/dist/{sections-DhJ7TukF.d.cts → sections-CRSGPI3T.d.cts} +1 -1
  81. package/dist/{sections-uV7vqDHj.d.ts → sections-DIVvr8QN.d.ts} +1 -1
  82. package/dist/{segmentedRowModel-DgSEzAYd.d.ts → segmentedRowModel-CD-YT9bT.d.ts} +1 -1
  83. package/dist/{segmentedRowModel-DWOjcPrU.d.cts → segmentedRowModel-CvyOS6Bx.d.cts} +1 -1
  84. package/dist/sk-GUB52YMC.js +1 -0
  85. package/dist/sl-J7N6LDON.js +1 -0
  86. package/dist/sr-A7GQEH7K.js +1 -0
  87. package/dist/sv-ARLHHSPZ.js +1 -0
  88. package/dist/{ticketRestrictions-JT87K45q.d.cts → ticketRestrictions-C31mrE97.d.cts} +2 -2
  89. package/dist/{ticketRestrictions-DIh61MqE.d.ts → ticketRestrictions-DXO2eckD.d.ts} +2 -2
  90. package/dist/tr-6TE3U7WM.js +1 -0
  91. package/dist/{types-Dx4jA8aI.d.cts → types-BVRza86Q.d.cts} +15 -0
  92. package/dist/{types-Dx4jA8aI.d.ts → types-BVRza86Q.d.ts} +15 -0
  93. package/dist/uk-RMVPSRMH.js +1 -0
  94. package/dist/view3d/crossfade/panorama.cjs +1 -1
  95. package/dist/view3d/crossfade/panorama.d.cts +20 -2
  96. package/dist/view3d/crossfade/panorama.d.ts +20 -2
  97. package/dist/view3d/crossfade/panorama.js +1 -1
  98. package/dist/view3d/index.cjs +31 -31
  99. package/dist/view3d/index.d.cts +30 -3
  100. package/dist/view3d/index.d.ts +30 -3
  101. package/dist/view3d/index.js +25 -25
  102. package/dist/view3d/scene/scene.worker.cjs +1 -1
  103. package/dist/view3d/scene/scene.worker.js +1 -1
  104. package/dist/zh-Hans-SNO4DA32.js +1 -0
  105. package/dist/zh-Hant-TVIKBD5S.js +1 -0
  106. package/package.json +2 -2
  107. package/dist/ar-JP4VPYJ2.js +0 -1
  108. package/dist/be-ROTFZNMH.js +0 -1
  109. package/dist/bg-YMQ3B5NS.js +0 -1
  110. package/dist/ca-L2OMCHWL.js +0 -1
  111. package/dist/chunk-52MZJZMW.js +0 -1
  112. package/dist/chunk-5JB4VW6B.js +0 -1
  113. package/dist/chunk-BLPBTW6I.js +0 -1
  114. package/dist/chunk-HDY2MYYH.js +0 -1
  115. package/dist/chunk-KN7GLEAI.js +0 -1
  116. package/dist/chunk-YFV4DSSX.js +0 -1
  117. package/dist/cs-CHBOZAYY.js +0 -1
  118. package/dist/cy-ZIVBYZBX.js +0 -1
  119. package/dist/da-PUY5IIER.js +0 -1
  120. package/dist/de-ILFIEU77.js +0 -1
  121. package/dist/el-5EG3QS5T.js +0 -1
  122. package/dist/es-YXZQB5VZ.js +0 -1
  123. package/dist/et-FZIUC4FC.js +0 -1
  124. package/dist/fa-KKBNUDRE.js +0 -1
  125. package/dist/fi-B6JSP5Z5.js +0 -1
  126. package/dist/fr-T5LHFRKG.js +0 -1
  127. package/dist/he-JF4HU75D.js +0 -1
  128. package/dist/hr-S5OXZ3NI.js +0 -1
  129. package/dist/hu-ZZDYG6ZF.js +0 -1
  130. package/dist/it-A5VCFTQP.js +0 -1
  131. package/dist/ja-PAJD5HFJ.js +0 -1
  132. package/dist/ku-KV2AIB6I.js +0 -1
  133. package/dist/localeLoaders-VULFUGJH.js +0 -1
  134. package/dist/lt-OSFNYQ2L.js +0 -1
  135. package/dist/lv-5INNWEN5.js +0 -1
  136. package/dist/nl-YOLY3DXM.js +0 -1
  137. package/dist/no-C5MG5NPH.js +0 -1
  138. package/dist/openPanorama-HGRYMWKC.js +0 -20
  139. package/dist/pl-ERGM2HA3.js +0 -1
  140. package/dist/pt-S6SBTHES.js +0 -1
  141. package/dist/ro-NQ4LIATX.js +0 -1
  142. package/dist/ru-ICFP6U3S.js +0 -1
  143. package/dist/sk-VYH6WIZ2.js +0 -1
  144. package/dist/sl-AA54VE5P.js +0 -1
  145. package/dist/sr-Z27ZL5ZE.js +0 -1
  146. package/dist/sv-BT4MNMB5.js +0 -1
  147. package/dist/tr-3TSE3BBR.js +0 -1
  148. package/dist/uk-YD2PBENU.js +0 -1
  149. package/dist/zh-Hans-VPQE6LWU.js +0 -1
  150. package/dist/zh-Hant-PUKPX45I.js +0 -1
@@ -1,12 +1,12 @@
1
- import{a as xe,b as Ht,c as Wt,d as qe,e as we,f as mt,g as ht,h as Ut,i as Ie,j as Yt,k as ft,l as qt,m as Xt,n as jt,o as Qt,p as pe,q as Kt,r as $t,s as Zt,t as Jt,u as vt,v as Te}from"../chunk-HDY2MYYH.js";import"../chunk-N5NRM4NW.js";import"../chunk-YFV4DSSX.js";import"../chunk-BLPBTW6I.js";import"../chunk-UL5OIGIF.js";import"../chunk-BAWUBGWY.js";import{Ea as Nt}from"../chunk-KN7GLEAI.js";import{d as Gt,l as Bt}from"../chunk-JBOTRSMY.js";import"../chunk-CRCGO52K.js";import{Renderer as wn}from"ogl";function Sn(){let t=typeof window<"u"&&window.devicePixelRatio||1,e=navigator.deviceMemory,o=typeof e=="number"&&e<=4?1.5:2;return Math.min(t,o)}var Xe=class{constructor(e,o){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 wn({canvas:this.canvas,dpr:Sn(),alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[qe.top[0],qe.top[1],qe.top[2]],this.gl.clearColor(this.clearRgb[0],this.clearRgb[1],this.clearRgb[2],1),e.appendChild(this.canvas),this.lostHandler=r=>{r.preventDefault(),o.onContextLost()},this.restoredHandler=()=>o.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),o=Math.max(1,this.container.clientHeight||this.canvas.clientHeight||1);return this.renderer.setSize(e,o),{width:e,height:o}}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 Mn,Vec3 as gt}from"ogl";var oe=Math.PI/180,bt=15*oe,yt=80*oe,Se=.12,eo=35,to=1.25,je=class{constructor(e,o,r,n){this.fovY=eo;this.target=new gt;this.azimuth=-30*oe;this.polar=55*oe;this.distance=10;this.azT=-30*oe;this.polT=55*oe;this.distT=10;this.minDist=1;this.maxDist=100;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 gt;this.panAnchor=new gt;this.panLimit=0;this.primaryDragMode="orbit";this.camera=new Mn(e,{fov:eo,near:.1,far:5e3,aspect:1}),this.canvas=o,this.requestRender=r,this.onGesture=n,this.onPointerDown=a=>{if(this.interactionEnabled){try{this.canvas.setPointerCapture?.(a.pointerId)}catch{}if(this.activePointers.set(a.pointerId,{x:a.clientX,y:a.clientY}),this.activePointers.size===1){let s=a.button===2||a.button===1,i=a.button===0&&(a.shiftKey?this.primaryDragMode==="orbit":this.primaryDragMode==="pan");this.panning=s||i,this.dragging=!this.panning,this.lastX=a.clientX,this.lastY=a.clientY}else if(this.activePointers.size===2){this.dragging=!1,this.panning=!1,this.pinchDist=this.currentPinchDistance();let s=this.pinchCentroid();this.pinchCx=s.x,this.pinchCy=s.y}}},this.onPointerMove=a=>{if(!this.interactionEnabled||!this.activePointers.has(a.pointerId))return;if(this.activePointers.set(a.pointerId,{x:a.clientX,y:a.clientY}),this.activePointers.size>=2){let l=this.currentPinchDistance();this.pinchDist>0&&(this.dollyBy(Math.exp((this.pinchDist-l)*.005)),this.fireGesture()),this.pinchDist=l;let p=this.pinchCentroid();this.panBy(p.x-this.pinchCx,p.y-this.pinchCy),this.pinchCx=p.x,this.pinchCy=p.y;return}let s=a.clientX-this.lastX,i=a.clientY-this.lastY;if(this.panning){this.lastX=a.clientX,this.lastY=a.clientY,(s!==0||i!==0)&&(this.panBy(s,i),this.fireGesture());return}this.dragging&&(this.lastX=a.clientX,this.lastY=a.clientY,(s!==0||i!==0)&&this.fireGesture(),this.azT-=s*.006,this.polT=Math.max(bt,Math.min(yt,this.polT-i*.006)),this.requestRender())},this.onPointerUp=a=>{this.activePointers.delete(a.pointerId);try{this.canvas.releasePointerCapture?.(a.pointerId)}catch{}this.activePointers.size<2&&(this.pinchDist=0),this.activePointers.size===0&&(this.dragging=!1,this.panning=!1)},this.onContextMenu=a=>{a.preventDefault()},this.onWheel=a=>{if(a.preventDefault(),!this.interactionEnabled)return;let s=a.deltaMode===1?16:a.deltaMode===2?100:1,i=Math.max(-2,Math.min(2,a.deltaY*s/100));this.dollyBy(Math.exp(i*.22)),this.fireGesture()},this.onKeyDown=a=>{if(!this.interactionEnabled)return;let s=7*oe;if(a.shiftKey&&(a.key==="ArrowLeft"||a.key==="ArrowRight"||a.key==="ArrowUp"||a.key==="ArrowDown"))this.panBy(a.key==="ArrowLeft"?-32:a.key==="ArrowRight"?32:0,a.key==="ArrowUp"?-32:a.key==="ArrowDown"?32:0);else if(a.key==="ArrowLeft"||a.key==="ArrowRight")this.azT+=a.key==="ArrowLeft"?-s:s;else if(a.key==="ArrowUp"||a.key==="ArrowDown")this.polT=Math.max(bt,Math.min(yt,this.polT+(a.key==="ArrowUp"?-s:s)));else if(a.key==="+"||a.key==="=")this.dollyBy(.82);else if(a.key==="-"||a.key==="_")this.dollyBy(1.22);else return;a.preventDefault(),this.fireGesture(),this.requestRender()},o.addEventListener("pointerdown",this.onPointerDown),o.addEventListener("pointermove",this.onPointerMove),o.addEventListener("pointerup",this.onPointerUp),o.addEventListener("pointercancel",this.onPointerUp),o.addEventListener("wheel",this.onWheel,{passive:!1}),o.addEventListener("keydown",this.onKeyDown),o.addEventListener("contextmenu",this.onContextMenu)}pinchCentroid(){let e=[...this.activePointers.values()];if(!e.length)return{x:0,y:0};let o=0,r=0;for(let n of e)o+=n.x,r+=n.y;return{x:o/e.length,y:r/e.length}}panBy(e,o){let r=this.canvas.clientHeight||1,n=2*this.distance*Math.tan(this.fovY*oe/2)/r,a=Math.sin(this.azimuth),s=Math.cos(this.azimuth),i=s,l=-a,p=Math.cos(this.polar),v=Math.sin(this.polar),c=-a*p,f=-s*p;this.targetT.x+=(-e*i+o*c)*n,this.targetT.z+=(-e*l+o*f)*n,this.targetT.y+=o*v*n,this.clampPan(),this.requestRender()}clampPan(){if(this.panLimit<=0)return;let e=this.panLimit,o=this.panAnchor.x,r=this.panAnchor.y,n=this.panAnchor.z;this.targetT.x=Math.max(o-e,Math.min(o+e,this.targetT.x)),this.targetT.z=Math.max(n-e,Math.min(n+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?.())}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()}zoomBy(e){this.interactionEnabled&&(this.dollyBy(e),this.fireGesture())}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,o=!1,r,n=!1,a){this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.panAnchor.copy(this.target),this.panLimit=Math.max(1,e.radius)*1.5;let s=Math.max(1,e.radius),i=this.fovY*oe/2,l=n?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,p=Math.atan(Math.tan(i)*l);this.azT=r??-30*oe,this.polT=Math.max(15,Math.min(80,a?.polarDeg??55))*oe;let v=this.fitDistance(e,i,p,this.azT,this.polT);this.distT=v*Math.max(1.05,Math.min(2,a?.margin??to)),this.minDist=Math.max(2,s*.12),this.maxDist=v*4,o?(this.azimuth=this.azT,this.polar=12*oe,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(e){this.camera.perspective({aspect:e})}frameSoft(e,o,r=!1,n){this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.panAnchor.copy(this.target),this.panLimit=Math.max(1,e.radius)*1.5,this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect});let a=this.fovY*oe/2,s=r?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,i=Math.atan(Math.tan(a)*s);this.azT=o??this.azimuth,this.polT=Math.max(15,Math.min(80,n?.polarDeg??55))*oe;let l=this.fitDistance(e,a,i,this.azT,this.polT);this.distT=l*Math.max(1.05,Math.min(2,n?.margin??to))}fitDistance(e,o,r,n,a){let s=Math.max(1,e.radius),i=Math.max(s/Math.tan(o),s/Math.tan(r)),l=e.box;if(!l)return i;let p=Math.sin(a),v=-p*Math.sin(n),c=-Math.cos(a),f=-p*Math.cos(n);if(Math.abs(c)>.999)return i;let m=-f,u=v,M=Math.hypot(m,u);m/=M,u/=M;let S=-u*c,P=u*v-m*f,R=m*c,y=Math.tan(r),A=Math.tan(o),g=1;for(let C=0;C<8;C++){let V=(C&1?l.max[0]:l.min[0])-e.center[0],D=(C&2?l.max[1]:l.min[1])-e.center[1],L=(C&4?l.max[2]:l.min[2])-e.center[2],N=V*v+D*c+L*f,E=Math.abs(V*m+L*u),G=Math.abs(V*S+D*P+L*R);g=Math.max(g,E/y-N,G/A-N)}return Math.min(i,Math.max(g,s*.35))}updateClipping(e){let o=this.camera.position.x-e.center[0],r=this.camera.position.y-e.center[1],n=this.camera.position.z-e.center[2],a=Math.hypot(o,r,n),s=Math.max(1,e.radius)*1.18,i=Math.max(.05,a-s),l=Math.max(i+10,a+s);this.camera.perspective({near:i,far:l,aspect:this.camera.aspect})}update(){let e=this.azT-this.azimuth,o=this.polT-this.polar,r=this.distT-this.distance,n=this.targetT.x-this.target.x,a=this.targetT.y-this.target.y,s=this.targetT.z-this.target.z,i=Math.max(1e-4,this.distance*1e-4),l=Math.abs(e)>1e-4||Math.abs(o)>1e-4||Math.abs(r)>1e-4||Math.abs(n)>i||Math.abs(a)>i||Math.abs(s)>i;return this.azimuth+=e*Se,this.polar+=o*Se,this.distance+=r*Se,this.target.x+=n*Se,this.target.y+=a*Se,this.target.z+=s*Se,l&&this.applyPosition(),l}get currentDistance(){return this.distance}syncFromCamera(){let e=this.camera.position.x-this.target.x,o=this.camera.position.y-this.target.y,r=this.camera.position.z-this.target.z,n=Math.hypot(e,o,r)||1,a=Math.max(bt,Math.min(yt,Math.acos(Math.max(-1,Math.min(1,o/n)))));this.distance=this.distT=n,this.polar=this.polT=a,this.azimuth=this.azT=Math.atan2(e,r)}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),o=this.target.x+this.distance*e*Math.sin(this.azimuth),r=this.target.y+this.distance*Math.cos(this.polar),n=this.target.z+this.distance*e*Math.cos(this.azimuth);this.camera.position.set(o,r,n),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()}};var Qe=class{constructor(e){this.rafId=0;this.running=!1;this.lastTime=0;this.fpsEma=0;this.rendered=0;this.tick=e=>{let o=this.lastTime?(e-this.lastTime)/1e3:.016666666666666666;if(this.lastTime=e,o>0){let n=1/o;this.fpsEma=this.fpsEma?this.fpsEma*.9+n*.1:n}this.rendered++,this.frame(o)?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}};var Me=2.5,Pn=1.15,ke=6,Pe=10,oo=6,no=9.5,ro=.9,ao=2.2,xt=30,wt=4,Ke=8192;var Br=Pe+wt;function io(t,e){let o=e*1.4,r=e*3.2;if(t<=o)return{scale:1,fade:0,minPixels:Me};let n=Math.min(1,(t-o)/Math.max(.001,r-o));return{scale:1-n*.4,fade:n*.55,minPixels:Me+n*(Pn-Me)}}function so(t,e,o){return!(t>0)||!(e>0)||!(o>0)?!1:e*o/t>=64}function lo(t,e,o,r,n){if(!(t>0)||!(e>0)||!(o>0)||!(r>0)||!(n>0))return!1;let a=Math.tan(r/2*Math.PI/180);if(!(a>0))return!1;let s=e/(o*a)*(n/2);return Math.PI*s*s/t>=64}var Cn=88,An=20,St={floor:{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},booth:{size:11,weight:"500",opacity:.85},annotation:{size:11,weight:"400",opacity:.75},row:{size:10.5,weight:"600",opacity:.8},seat:{size:9.5,weight:"500",opacity:.72}},_e=new Set(["row","seat"]),co={floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},$e={row:{x:62,y:16},seat:{x:46,y:18}},uo=Gt,Mt=t=>Bt(t);function po(t,e){let o=Mt(t),r=Mt(e);return(Math.max(o,r)+.05)/(Math.min(o,r)+.05)}function Pt(t,e){let o=/rgba\((\d+),(\d+),(\d+),([\d.]+)\)/.exec(t.replace(/\s/g,""));if(!o)return e;let r=Math.max(0,Math.min(1,Number(o[4])));return[1,2,3].map(n=>Number(o[n])/255*r+e[n-1]*(1-r))}function Fn(t,e=[.04,.06,.1],o=!0){let r=Mt(e)<.42,n=r?"#f4f7fb":"#0b1220",a=r?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",s=o?Pt(a,e):e,i=uo(t),l=o?7:4.5,p=i&&po(i,s)>=l?t:n;return r?{ink:p,backing:a,border:"rgba(210,222,245,.24)"}:{ink:p,backing:a,border:"rgba(11,18,32,.22)"}}var Ze=class{constructor(e,o={}){this.nodes=new Map;this.labels=[];this.forcedDense=!1;this.selectedSeatLabelIds=new Set;this.opts=o,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",o.fontFamily&&(r.fontFamily=o.fontFamily),e.appendChild(this.root)}setVisible(e){this.root.style.visibility=e?"":"hidden"}setLabels(e){this.labels=e;for(let[o,r]of this.nodes)e.some(n=>n.id===o)||(r.remove(),this.nodes.delete(o))}setForcedDense(e){this.forcedDense=e}setSelectedSeatIds(e){this.selectedSeatLabelIds=new Set(Array.from(e,o=>`seat:${o}`))}qualityEvidence(){let e=this.root.getBoundingClientRect(),o=this.root.style.visibility!=="hidden";return this.labels.map(r=>{let n=this.nodes.get(r.id),a=n?.getBoundingClientRect(),s=!!(o&&n&&n.style.display!=="none"&&a&&a.width>0&&a.height>0);return{id:r.id,kind:r.kind,text:r.text,visible:s,renderedFontPx:n&&Number.parseFloat(n.style.fontSize)||0,contrast:n?Number(n.dataset.qualityContrast??0):0,...s&&a?{screenBox:{x:a.x-e.x,y:a.y-e.y,width:a.width,height:a.height}}:{}}})}update(e,o,r,n,a,s){if(!this.labels.length)return;let i=jt(n,a,{hasZoneLabels:this.labels.some(y=>y.kind==="zone")});this.forcedDense&&(i.add("row"),i.add("seat"));let l=[];for(let y of this.labels){if(!i.has(y.kind))continue;let A=pe(e,y.anchor,o,r);if(!A.visible)continue;let g=$t(y.text,St[y.kind].size,!_e.has(y.kind)),C=!_e.has(y.kind),V=Qt(A,g/2,St[y.kind].size/2+(C?4:1),o,r),D=s?Math.hypot(y.anchor[0]-s[0],y.anchor[1]-s[1],y.anchor[2]-s[2]):1;l.push({label:y,screen:V,focus:Jt(V,D,o,r),halfWidth:g/2,...this.selectedSeatLabelIds.has(y.id)?{priority:1}:{}})}let p=Xt(l.filter(y=>y.label.kind==="floor"),o),v=[...l.filter(y=>!_e.has(y.label.kind)&&y.label.kind!=="floor"),...p],c=Kt(v,Cn,An),f=Zt(o),m=vt(l.filter(y=>y.label.kind==="row"),$e.row.x,$e.row.y,f.row,c),u=vt(l.filter(y=>y.label.kind==="seat"),$e.seat.x,$e.seat.y,f.seat,[...c,...m]),M=[...c,...m,...u],S=new Set(M.map(y=>y.label.id));for(let{label:y,screen:A}of M){let C=this.nodeFor(y).style;C.display="",C.transform=`translate(-50%, -50%) translate(${A.x.toFixed(1)}px, ${A.y.toFixed(1)}px)`}let P=M.filter(({label:y})=>!_e.has(y.kind)).sort((y,A)=>co[A.label.kind]-co[y.label.kind]||y.screen.depth-A.screen.depth||y.focus-A.focus),R=[];for(let{label:y}of P){let A=this.nodes.get(y.id);if(!A||A.style.display==="none")continue;let g=A.getBoundingClientRect();R.some(V=>g.left<V.right+3&&g.right+3>V.left&&g.top<V.bottom+3&&g.bottom+3>V.top)?A.style.display="none":R.push(g)}for(let[y,A]of this.nodes)S.has(y)||(A.style.display="none")}nodeFor(e){let o=this.nodes.get(e.id);if(!o){o=document.createElement("div");let c=o.style;c.position="absolute",c.left="0",c.top="0",c.whiteSpace="nowrap",c.textShadow="0 1px 3px rgba(0,0,0,0.85), 0 0 8px rgba(0,0,0,0.55)",c.display="none",this.root.appendChild(o),this.nodes.set(e.id,o)}o.textContent=e.text,o.setAttribute("data-label-kind",e.kind);let r=this.selectedSeatLabelIds.has(e.id);o.toggleAttribute("data-selected-seat",r);let n=St[e.kind],a=o.style;a.fontSize=`${n.size}px`,a.fontWeight=r?"800":n.weight,a.opacity=r?"1":String(n.opacity);let s=!_e.has(e.kind),i=Fn(e.color??this.opts.ink,this.opts.backgroundRgb,s);a.color=r?"#ecf8ff":i.ink,a.background=r?"rgba(10,28,45,.9)":s?i.backing:"",a.border=r?"1px solid rgba(89,199,255,.92)":s?`1px solid ${i.border}`:"",a.borderRadius=r||s?"999px":"",a.padding=r||s?"3px 7px":"",a.boxShadow=r?"0 0 0 2px rgba(41,176,255,.18), 0 5px 14px rgba(0,0,0,.35)":s?"0 3px 10px rgba(0,0,0,.24)":"",a.letterSpacing=e.kind==="zone"||e.kind==="floor"?"0.08em":"0.02em";let l=this.opts.backgroundRgb??[.04,.06,.1],p=uo(r?"#ecf8ff":i.ink)??[1,1,1],v=r?Pt("rgba(10,28,45,.9)",l):s?Pt(i.backing,l):l;return o.dataset.qualityContrast=po(p,v).toFixed(3),(e.kind==="zone"||e.kind==="floor")&&(a.textTransform="uppercase"),o}dispose(){this.root.remove(),this.nodes.clear()}};var En=1;var Rn=new Set(["floor","zone","section","ga","booth","annotation"]);function Dn(t){return t.every(e=>Number.isFinite(e))}function Vn(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 mo(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function ve(t){return Math.round(t*1e4)/1e4}function In(t){if(t)return{box:{x:ve(t.box.x),y:ve(t.box.y),width:ve(t.box.width),height:ve(t.box.height)},horizontalFillRatio:ve(t.horizontalFillRatio),verticalFillRatio:ve(t.verticalFillRatio),visibleAreaRatio:ve(t.visibleAreaRatio),clippedEdges:[...t.clippedEdges]}}function ce(t,e,o){return o.length?{code:t,message:e,count:o.length,samples:o.slice(0,20)}:null}function Ct(t){let e=t.labels.filter(i=>i.visible&&i.screenBox),o=e.filter(i=>Rn.has(i.kind)),r=t.scene.floorCount>1?t.scene.floorCount:t.scene.zoneCount||t.scene.sectionCount,n=[];for(let i=0;i<o.length;i+=1)for(let l=0;l<i;l+=1)Vn(o[i].screenBox,o[l].screenBox)&&n.push({primaryId:o[i].id,primaryLabel:o[i].text,secondaryId:o[l].id});let a=[...t.camera.position,t.camera.distance,t.camera.verticalFovDeg],s=[ce("webgl2-unavailable","The venue scene must render through WebGL2",t.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),ce("context-lost","The WebGL context must be live at capture",t.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),ce("frame-not-stable","The captured 3D frame must be rendered and parked",t.frame.rendered>0&&t.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),ce("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}`}]),ce("camera-invalid","The capture camera must have a finite physical pose",Dn(a)&&t.camera.distance>0&&t.camera.verticalFovDeg>0&&t.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),ce("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}]),ce("hierarchy-label-missing","A venue with authored hierarchy must show at least one structural label",r===0||o.length>0?[]:[{primaryId:"labels",primaryLabel:`${r} expected hierarchy labels`}]),ce("hierarchy-label-undersized","Visible 3D hierarchy labels must remain readable",o.filter(i=>i.renderedFontPx<11).map(i=>({primaryId:i.id,primaryLabel:i.text,measured:i.renderedFontPx,minimum:11}))),ce("hierarchy-label-contrast-low","Visible 3D hierarchy labels must meet text contrast",o.filter(i=>i.contrast<4.5).map(i=>({primaryId:i.id,primaryLabel:i.text,measured:i.contrast,minimum:4.5}))),ce("hierarchy-label-collision","Visible 3D hierarchy labels must not overlap",n)].filter(i=>!!i);return{version:1,state:"venue3d",passed:s.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:i,kind:l,text:p})=>({id:i,kind:l,text:p})).sort((i,l)=>i.kind.localeCompare(l.kind)||i.id.localeCompare(l.id)),framing:In(t.framing)},metrics:{minimumHierarchyFontPx:mo(o.map(i=>i.renderedFontPx)),minimumHierarchyContrast:mo(o.map(i=>i.contrast)),projectedReliefPx:Math.round(t.scene.projectedReliefPx*100)/100},findings:s}}import{Geometry as Le,Mesh as ze,Program as Xn,Texture as jn,Transform as Mo}from"ogl";import{Program as ge}from"ogl";var Je=`
1
+ import{a as me,b as qt,c as jt,d as Xe,e as Se,f as vt,g as bt,h as Kt,i as Qt,j as Ie,k as $t,l as gt,m as Zt,n as Jt,o as eo,p as to,q as fe,r as oo,s as no,t as ro,u as io,v as yt,w as Te}from"../chunk-KHFCTR3V.js";import"../chunk-TN6DFYEV.js";import"../chunk-YACNGDTE.js";import"../chunk-UL5OIGIF.js";import{Va as Ut}from"../chunk-QUOAQQMP.js";import{d as Yt,l as Xt}from"../chunk-JBOTRSMY.js";import"../chunk-CRCGO52K.js";import{Renderer as Tn}from"ogl";function Vn(){let t=typeof window<"u"&&window.devicePixelRatio||1,e=navigator.deviceMemory,o=typeof e=="number"&&e<=4?1.5:2;return Math.min(t,o)}var qe=class{constructor(e,o){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 Tn({canvas:this.canvas,dpr:Vn(),alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[Xe.top[0],Xe.top[1],Xe.top[2]],this.gl.clearColor(this.clearRgb[0],this.clearRgb[1],this.clearRgb[2],1),e.appendChild(this.canvas),this.lostHandler=r=>{r.preventDefault(),o.onContextLost()},this.restoredHandler=()=>o.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),o=Math.max(1,this.container.clientHeight||this.canvas.clientHeight||1);return this.renderer.setSize(e,o),{width:e,height:o}}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 _n,Vec3 as xt}from"ogl";var re=Math.PI/180,wt=15*re,St=80*re,Me=.12,ao=35,so=1.25,je=class{constructor(e,o,r,n){this.fovY=ao;this.target=new xt;this.azimuth=-30*re;this.polar=55*re;this.distance=10;this.azT=-30*re;this.polT=55*re;this.distT=10;this.minDist=1;this.maxDist=100;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 xt;this.panAnchor=new xt;this.panLimit=0;this.primaryDragMode="orbit";this.camera=new _n(e,{fov:ao,near:.1,far:5e3,aspect:1}),this.canvas=o,this.requestRender=r,this.onGesture=n,this.onPointerDown=i=>{if(this.interactionEnabled){try{this.canvas.setPointerCapture?.(i.pointerId)}catch{}if(this.activePointers.set(i.pointerId,{x:i.clientX,y:i.clientY}),this.activePointers.size===1){let s=i.button===2||i.button===1,a=i.button===0&&(i.shiftKey?this.primaryDragMode==="orbit":this.primaryDragMode==="pan");this.panning=s||a,this.dragging=!this.panning,this.lastX=i.clientX,this.lastY=i.clientY}else if(this.activePointers.size===2){this.dragging=!1,this.panning=!1,this.pinchDist=this.currentPinchDistance();let s=this.pinchCentroid();this.pinchCx=s.x,this.pinchCy=s.y}}},this.onPointerMove=i=>{if(!this.interactionEnabled||!this.activePointers.has(i.pointerId))return;if(this.activePointers.set(i.pointerId,{x:i.clientX,y:i.clientY}),this.activePointers.size>=2){let l=this.currentPinchDistance();this.pinchDist>0&&(this.dollyBy(Math.exp((this.pinchDist-l)*.005)),this.fireGesture()),this.pinchDist=l;let u=this.pinchCentroid();this.panBy(u.x-this.pinchCx,u.y-this.pinchCy),this.pinchCx=u.x,this.pinchCy=u.y;return}let s=i.clientX-this.lastX,a=i.clientY-this.lastY;if(this.panning){this.lastX=i.clientX,this.lastY=i.clientY,(s!==0||a!==0)&&(this.panBy(s,a),this.fireGesture());return}this.dragging&&(this.lastX=i.clientX,this.lastY=i.clientY,(s!==0||a!==0)&&this.fireGesture(),this.azT-=s*.006,this.polT=Math.max(wt,Math.min(St,this.polT-a*.006)),this.requestRender())},this.onPointerUp=i=>{this.activePointers.delete(i.pointerId);try{this.canvas.releasePointerCapture?.(i.pointerId)}catch{}this.activePointers.size<2&&(this.pinchDist=0),this.activePointers.size===0&&(this.dragging=!1,this.panning=!1)},this.onContextMenu=i=>{i.preventDefault()},this.onWheel=i=>{if(i.preventDefault(),!this.interactionEnabled)return;let s=i.deltaMode===1?16:i.deltaMode===2?100:1,a=Math.max(-2,Math.min(2,i.deltaY*s/100));this.dollyBy(Math.exp(a*.22)),this.fireGesture()},this.onKeyDown=i=>{if(!this.interactionEnabled)return;let s=7*re;if(i.shiftKey&&(i.key==="ArrowLeft"||i.key==="ArrowRight"||i.key==="ArrowUp"||i.key==="ArrowDown"))this.panBy(i.key==="ArrowLeft"?-32:i.key==="ArrowRight"?32:0,i.key==="ArrowUp"?-32:i.key==="ArrowDown"?32:0);else if(i.key==="ArrowLeft"||i.key==="ArrowRight")this.azT+=i.key==="ArrowLeft"?-s:s;else if(i.key==="ArrowUp"||i.key==="ArrowDown")this.polT=Math.max(wt,Math.min(St,this.polT+(i.key==="ArrowUp"?-s:s)));else if(i.key==="+"||i.key==="=")this.dollyBy(.82);else if(i.key==="-"||i.key==="_")this.dollyBy(1.22);else return;i.preventDefault(),this.fireGesture(),this.requestRender()},o.addEventListener("pointerdown",this.onPointerDown),o.addEventListener("pointermove",this.onPointerMove),o.addEventListener("pointerup",this.onPointerUp),o.addEventListener("pointercancel",this.onPointerUp),o.addEventListener("wheel",this.onWheel,{passive:!1}),o.addEventListener("keydown",this.onKeyDown),o.addEventListener("contextmenu",this.onContextMenu)}pinchCentroid(){let e=[...this.activePointers.values()];if(!e.length)return{x:0,y:0};let o=0,r=0;for(let n of e)o+=n.x,r+=n.y;return{x:o/e.length,y:r/e.length}}panBy(e,o){let r=this.canvas.clientHeight||1,n=2*this.distance*Math.tan(this.fovY*re/2)/r,i=Math.sin(this.azimuth),s=Math.cos(this.azimuth),a=s,l=-i,u=Math.cos(this.polar),f=Math.sin(this.polar),p=-i*u,b=-s*u;this.targetT.x+=(-e*a+o*p)*n,this.targetT.z+=(-e*l+o*b)*n,this.targetT.y+=o*f*n,this.clampPan(),this.requestRender()}clampPan(){if(this.panLimit<=0)return;let e=this.panLimit,o=this.panAnchor.x,r=this.panAnchor.y,n=this.panAnchor.z;this.targetT.x=Math.max(o-e,Math.min(o+e,this.targetT.x)),this.targetT.z=Math.max(n-e,Math.min(n+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?.())}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()}zoomBy(e){this.interactionEnabled&&(this.dollyBy(e),this.fireGesture())}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,o=!1,r,n=!1,i){this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.panAnchor.copy(this.target),this.panLimit=Math.max(1,e.radius)*1.5;let s=Math.max(1,e.radius),a=this.fovY*re/2,l=n?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,u=Math.atan(Math.tan(a)*l);this.azT=r??-30*re,this.polT=Math.max(15,Math.min(80,i?.polarDeg??55))*re;let f=this.fitDistance(e,a,u,this.azT,this.polT);this.distT=f*Math.max(1.05,Math.min(2,i?.margin??so)),this.minDist=Math.max(2,s*.12),this.maxDist=f*4,o?(this.azimuth=this.azT,this.polar=12*re,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(e){this.camera.perspective({aspect:e})}frameSoft(e,o,r=!1,n){this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.panAnchor.copy(this.target),this.panLimit=Math.max(1,e.radius)*1.5,this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect});let i=this.fovY*re/2,s=r?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,a=Math.atan(Math.tan(i)*s);this.azT=o??this.azimuth,this.polT=Math.max(15,Math.min(80,n?.polarDeg??55))*re;let l=this.fitDistance(e,i,a,this.azT,this.polT);this.distT=l*Math.max(1.05,Math.min(2,n?.margin??so))}fitDistance(e,o,r,n,i){let s=Math.max(1,e.radius),a=Math.max(s/Math.tan(o),s/Math.tan(r)),l=e.box;if(!l)return a;let u=Math.sin(i),f=-u*Math.sin(n),p=-Math.cos(i),b=-u*Math.cos(n);if(Math.abs(p)>.999)return a;let c=-b,d=f,E=Math.hypot(c,d);c/=E,d/=E;let P=-d*p,M=d*f-c*b,k=c*p,y=Math.tan(r),F=Math.tan(o),v=1;for(let w=0;w<8;w++){let D=(w&1?l.max[0]:l.min[0])-e.center[0],T=(w&2?l.max[1]:l.min[1])-e.center[1],L=(w&4?l.max[2]:l.min[2])-e.center[2],z=D*f+T*p+L*b,C=Math.abs(D*c+L*d),Q=Math.abs(D*P+T*M+L*k);v=Math.max(v,C/y-z,Q/F-z)}return Math.min(a,Math.max(v,s*.35))}updateClipping(e){let o=this.camera.position.x-e.center[0],r=this.camera.position.y-e.center[1],n=this.camera.position.z-e.center[2],i=Math.hypot(o,r,n),s=Math.max(1,e.radius)*1.18,a=Math.max(.05,i-s),l=Math.max(a+10,i+s);this.camera.perspective({near:a,far:l,aspect:this.camera.aspect})}update(){let e=this.azT-this.azimuth,o=this.polT-this.polar,r=this.distT-this.distance,n=this.targetT.x-this.target.x,i=this.targetT.y-this.target.y,s=this.targetT.z-this.target.z,a=Math.max(1e-4,this.distance*1e-4),l=Math.abs(e)>1e-4||Math.abs(o)>1e-4||Math.abs(r)>1e-4||Math.abs(n)>a||Math.abs(i)>a||Math.abs(s)>a;return this.azimuth+=e*Me,this.polar+=o*Me,this.distance+=r*Me,this.target.x+=n*Me,this.target.y+=i*Me,this.target.z+=s*Me,l&&this.applyPosition(),l}get currentDistance(){return this.distance}syncFromCamera(){let e=this.camera.position.x-this.target.x,o=this.camera.position.y-this.target.y,r=this.camera.position.z-this.target.z,n=Math.hypot(e,o,r)||1,i=Math.max(wt,Math.min(St,Math.acos(Math.max(-1,Math.min(1,o/n)))));this.distance=this.distT=n,this.polar=this.polT=i,this.azimuth=this.azT=Math.atan2(e,r)}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),o=this.target.x+this.distance*e*Math.sin(this.azimuth),r=this.target.y+this.distance*Math.cos(this.polar),n=this.target.z+this.distance*e*Math.cos(this.azimuth);this.camera.position.set(o,r,n),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()}};var Ke=class{constructor(e){this.rafId=0;this.running=!1;this.lastTime=0;this.fpsEma=0;this.rendered=0;this.tick=e=>{let o=this.lastTime?(e-this.lastTime)/1e3:.016666666666666666;if(this.lastTime=e,o>0){let n=1/o;this.fpsEma=this.fpsEma?this.fpsEma*.9+n*.1:n}this.rendered++,this.frame(o)?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}};var Pe=2.5,kn=1.15,Ve=6,Ce=10,lo=6,co=9.5,uo=.9,mo=2.2,Mt=30,Pt=4,Qe=8192;var ii=Ce+Pt;function po(t,e){let o=e*1.4,r=e*3.2;if(t<=o)return{scale:1,fade:0,minPixels:Pe};let n=Math.min(1,(t-o)/Math.max(.001,r-o));return{scale:1-n*.4,fade:n*.55,minPixels:Pe+n*(kn-Pe)}}function ho(t,e,o){return!(t>0)||!(e>0)||!(o>0)?!1:e*o/t>=64}function fo(t,e,o,r,n){if(!(t>0)||!(e>0)||!(o>0)||!(r>0)||!(n>0))return!1;let i=Math.tan(r/2*Math.PI/180);if(!(i>0))return!1;let s=e/(o*i)*(n/2);return Math.PI*s*s/t>=64}var Ln=88,On=20,Ct={floor:{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},booth:{size:11,weight:"500",opacity:.85},annotation:{size:11,weight:"400",opacity:.75},row:{size:10.5,weight:"600",opacity:.8},seat:{size:9.5,weight:"500",opacity:.72}},_e=new Set(["row","seat"]),vo={floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},$e={row:{x:62,y:16},seat:{x:46,y:18}},bo=Yt,At=t=>Xt(t);function go(t,e){let o=At(t),r=At(e);return(Math.max(o,r)+.05)/(Math.min(o,r)+.05)}function Et(t,e){let o=/rgba\((\d+),(\d+),(\d+),([\d.]+)\)/.exec(t.replace(/\s/g,""));if(!o)return e;let r=Math.max(0,Math.min(1,Number(o[4])));return[1,2,3].map(n=>Number(o[n])/255*r+e[n-1]*(1-r))}function zn(t,e=[.04,.06,.1],o=!0){let r=At(e)<.42,n=r?"#f4f7fb":"#0b1220",i=r?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",s=o?Et(i,e):e,a=bo(t),l=o?7:4.5,u=a&&go(a,s)>=l?t:n;return r?{ink:u,backing:i,border:"rgba(210,222,245,.24)"}:{ink:u,backing:i,border:"rgba(11,18,32,.22)"}}var Nn='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Ze=class{constructor(e,o={}){this.nodes=new Map;this.labels=[];this.forcedDense=!1;this.selectedSeatLabelIds=new Set;this.opts=o,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=o.fontFamily||Nn,e.appendChild(this.root)}setVisible(e){this.root.style.visibility=e?"":"hidden"}setLabels(e){this.labels=e;for(let[o,r]of this.nodes)e.some(n=>n.id===o)||(r.remove(),this.nodes.delete(o))}setForcedDense(e){this.forcedDense=e}setSelectedSeatIds(e){this.selectedSeatLabelIds=new Set(Array.from(e,o=>`seat:${o}`))}qualityEvidence(){let e=this.root.getBoundingClientRect(),o=this.root.style.visibility!=="hidden";return this.labels.map(r=>{let n=this.nodes.get(r.id),i=n?.getBoundingClientRect(),s=!!(o&&n&&n.style.display!=="none"&&i&&i.width>0&&i.height>0);return{id:r.id,kind:r.kind,text:r.text,visible:s,renderedFontPx:n&&Number.parseFloat(n.style.fontSize)||0,contrast:n?Number(n.dataset.qualityContrast??0):0,...s&&i?{screenBox:{x:i.x-e.x,y:i.y-e.y,width:i.width,height:i.height}}:{}}})}update(e,o,r,n,i,s){if(!this.labels.length)return;let a=eo(n,i,{hasZoneLabels:this.labels.some(y=>y.kind==="zone")});this.forcedDense&&(a.add("row"),a.add("seat"));let l=[];for(let y of this.labels){if(!a.has(y.kind))continue;let F=fe(e,y.anchor,o,r);if(!F.visible)continue;let v=no(y.text,Ct[y.kind].size,!_e.has(y.kind)),w=!_e.has(y.kind),D=to(F,v/2,Ct[y.kind].size/2+(w?4:1),o,r),T=s?Math.hypot(y.anchor[0]-s[0],y.anchor[1]-s[1],y.anchor[2]-s[2]):1;l.push({label:y,screen:D,focus:io(D,T,o,r),halfWidth:v/2,...this.selectedSeatLabelIds.has(y.id)?{priority:1}:{}})}let u=Jt(l.filter(y=>y.label.kind==="floor"),o),f=[...l.filter(y=>!_e.has(y.label.kind)&&y.label.kind!=="floor"),...u],p=oo(f,Ln,On),b=ro(o),c=yt(l.filter(y=>y.label.kind==="row"),$e.row.x,$e.row.y,b.row,p),d=yt(l.filter(y=>y.label.kind==="seat"),$e.seat.x,$e.seat.y,b.seat,[...p,...c]),E=[...p,...c,...d],P=new Set(E.map(y=>y.label.id));for(let{label:y,screen:F}of E){let w=this.nodeFor(y).style;w.display="",w.transform=`translate(-50%, -50%) translate(${F.x.toFixed(1)}px, ${F.y.toFixed(1)}px)`}let M=E.filter(({label:y})=>!_e.has(y.kind)).sort((y,F)=>vo[F.label.kind]-vo[y.label.kind]||y.screen.depth-F.screen.depth||y.focus-F.focus),k=[];for(let{label:y}of M){let F=this.nodes.get(y.id);if(!F||F.style.display==="none")continue;let v=F.getBoundingClientRect();k.some(D=>v.left<D.right+3&&v.right+3>D.left&&v.top<D.bottom+3&&v.bottom+3>D.top)?F.style.display="none":k.push(v)}for(let[y,F]of this.nodes)P.has(y)||(F.style.display="none")}nodeFor(e){let o=this.nodes.get(e.id);if(!o){o=document.createElement("div");let p=o.style;p.position="absolute",p.left="0",p.top="0",p.whiteSpace="nowrap",p.textShadow="0 1px 3px rgba(0,0,0,0.85), 0 0 8px rgba(0,0,0,0.55)",p.display="none",this.root.appendChild(o),this.nodes.set(e.id,o)}o.textContent=e.text,o.setAttribute("data-label-kind",e.kind);let r=this.selectedSeatLabelIds.has(e.id);o.toggleAttribute("data-selected-seat",r);let n=Ct[e.kind],i=o.style;i.fontSize=`${n.size}px`,i.fontWeight=r?"800":n.weight,i.opacity=r?"1":String(n.opacity);let s=!_e.has(e.kind),a=zn(e.color??this.opts.ink,this.opts.backgroundRgb,s);i.color=r?"#ecf8ff":a.ink,i.background=r?"rgba(10,28,45,.9)":s?a.backing:"",i.border=r?"1px solid rgba(89,199,255,.92)":s?`1px solid ${a.border}`:"",i.borderRadius=r||s?"999px":"",i.padding=r||s?"3px 7px":"",i.boxShadow=r?"0 0 0 2px rgba(41,176,255,.18), 0 5px 14px rgba(0,0,0,.35)":s?"0 3px 10px rgba(0,0,0,.24)":"",i.letterSpacing=e.kind==="zone"||e.kind==="floor"?"0.08em":"0.02em";let l=this.opts.backgroundRgb??[.04,.06,.1],u=bo(r?"#ecf8ff":a.ink)??[1,1,1],f=r?Et("rgba(10,28,45,.9)",l):s?Et(a.backing,l):l;return o.dataset.qualityContrast=go(u,f).toFixed(3),(e.kind==="zone"||e.kind==="floor")&&(i.textTransform="uppercase"),o}dispose(){this.root.remove(),this.nodes.clear()}};var Bn=1;var Gn=new Set(["floor","zone","section","ga","booth","annotation"]);function Hn(t){return t.every(e=>Number.isFinite(e))}function Wn(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 yo(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function ge(t){return Math.round(t*1e4)/1e4}function Un(t){if(t)return{box:{x:ge(t.box.x),y:ge(t.box.y),width:ge(t.box.width),height:ge(t.box.height)},horizontalFillRatio:ge(t.horizontalFillRatio),verticalFillRatio:ge(t.verticalFillRatio),visibleAreaRatio:ge(t.visibleAreaRatio),clippedEdges:[...t.clippedEdges]}}function de(t,e,o){return o.length?{code:t,message:e,count:o.length,samples:o.slice(0,20)}:null}function Rt(t){let e=t.labels.filter(a=>a.visible&&a.screenBox),o=e.filter(a=>Gn.has(a.kind)),r=t.scene.floorCount>1?t.scene.floorCount:t.scene.zoneCount||t.scene.sectionCount,n=[];for(let a=0;a<o.length;a+=1)for(let l=0;l<a;l+=1)Wn(o[a].screenBox,o[l].screenBox)&&n.push({primaryId:o[a].id,primaryLabel:o[a].text,secondaryId:o[l].id});let i=[...t.camera.position,t.camera.distance,t.camera.verticalFovDeg],s=[de("webgl2-unavailable","The venue scene must render through WebGL2",t.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),de("context-lost","The WebGL context must be live at capture",t.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),de("frame-not-stable","The captured 3D frame must be rendered and parked",t.frame.rendered>0&&t.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),de("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}`}]),de("camera-invalid","The capture camera must have a finite physical pose",Hn(i)&&t.camera.distance>0&&t.camera.verticalFovDeg>0&&t.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),de("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}]),de("hierarchy-label-missing","A venue with authored hierarchy must show at least one structural label",r===0||o.length>0?[]:[{primaryId:"labels",primaryLabel:`${r} expected hierarchy labels`}]),de("hierarchy-label-undersized","Visible 3D hierarchy labels must remain readable",o.filter(a=>a.renderedFontPx<11).map(a=>({primaryId:a.id,primaryLabel:a.text,measured:a.renderedFontPx,minimum:11}))),de("hierarchy-label-contrast-low","Visible 3D hierarchy labels must meet text contrast",o.filter(a=>a.contrast<4.5).map(a=>({primaryId:a.id,primaryLabel:a.text,measured:a.contrast,minimum:4.5}))),de("hierarchy-label-collision","Visible 3D hierarchy labels must not overlap",n)].filter(a=>!!a);return{version:1,state:"venue3d",passed:s.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:a,kind:l,text:u})=>({id:a,kind:l,text:u})).sort((a,l)=>a.kind.localeCompare(l.kind)||a.id.localeCompare(l.id)),framing:Un(t.framing)},metrics:{minimumHierarchyFontPx:yo(o.map(a=>a.renderedFontPx)),minimumHierarchyContrast:yo(o.map(a=>a.contrast)),projectedReliefPx:Math.round(t.scene.projectedReliefPx*100)/100},findings:s}}import{Geometry as ke,Mesh as Le,Program as lr,Texture as cr,Transform as Io}from"ogl";import{Program as ye}from"ogl";var Je=`
2
2
  float chairWeight(float depth) {
3
3
  return 1.0 - smoothstep(uChairFull, uChairNone, depth);
4
- }`,ho=`
4
+ }`,xo=`
5
5
  float occupantWeight(float depth) {
6
- float nearWeight = smoothstep(${ro.toFixed(1)}, ${ao.toFixed(1)}, depth);
7
- float farWeight = 1.0 - smoothstep(${oo.toFixed(1)}, ${no.toFixed(1)}, depth);
6
+ float nearWeight = smoothstep(${uo.toFixed(1)}, ${mo.toFixed(1)}, depth);
7
+ float farWeight = 1.0 - smoothstep(${lo.toFixed(1)}, ${co.toFixed(1)}, depth);
8
8
  return nearWeight * farWeight;
9
- }`,fo=`
9
+ }`,wo=`
10
10
  float glyphEq(float glyph, float expected) {
11
11
  return 1.0 - step(0.25, abs(glyph - expected));
12
12
  }
@@ -55,7 +55,7 @@ vec3 glyphChairPosition(vec3 p, float partId, float glyph) {
55
55
  p.y += 0.16;
56
56
  }
57
57
  return p;
58
- }`,Tn=`#version 300 es
58
+ }`,Yn=`#version 300 es
59
59
  precision highp float;
60
60
  in vec3 position;
61
61
  in vec3 normal;
@@ -93,7 +93,7 @@ void main() {
93
93
  vNormalWorld = normalize(mat3(modelMatrix) * normal);
94
94
  vColor = color;
95
95
  gl_Position = projectionMatrix * mv;
96
- }`,kn=`#version 300 es
96
+ }`,Xn=`#version 300 es
97
97
  precision highp float;
98
98
  in vec3 vColor;
99
99
  in vec3 vNormalWorld;
@@ -166,7 +166,7 @@ void main() {
166
166
  + vec3(0.20, 0.10, 0.34) * focalHalo;
167
167
  base = mix(base, display, poweredDisplay * verticalFace * 0.92);
168
168
  fragColor = vec4(base, 1.0);
169
- }`,_n=`#version 300 es
169
+ }`,qn=`#version 300 es
170
170
  precision highp float;
171
171
  in vec2 position; // quad corner in [-1,1]
172
172
  in vec3 iOffset; // per-instance world position
@@ -225,7 +225,7 @@ void main() {
225
225
  vPhysicalSeat = iPhysicalSeat;
226
226
  vDim = (uFocusFloor < -0.5 || abs(iFloor - uFocusFloor) < 0.5) ? 0.0 : 1.0;
227
227
  gl_Position = projectionMatrix * mv;
228
- }`,Ln=`#version 300 es
228
+ }`,jn=`#version 300 es
229
229
  precision highp float;
230
230
  in vec2 vUv;
231
231
  in vec3 vColor;
@@ -284,7 +284,7 @@ void main() {
284
284
  alpha *= vDotWeight;
285
285
  if (alpha <= 0.0) discard;
286
286
  fragColor = vec4(c, alpha);
287
- }`,zn=`#version 300 es
287
+ }`,Kn=`#version 300 es
288
288
  precision highp float;
289
289
  in vec3 position; // local: x/z in units of the seat radius, y in METRES
290
290
  in vec3 normal;
@@ -316,8 +316,8 @@ out float vDim;
316
316
  out float vOccupant; // 1 = this vertex belongs to a person, not to the chair
317
317
  out vec3 vOccupantTint;
318
318
  ${Je}
319
- ${ho}
320
- ${fo}
319
+ ${xo}
320
+ ${wo}
321
321
  void main() {
322
322
  vec4 anchor = modelViewMatrix * vec4(iOffset, 1.0);
323
323
  float viewDepth = -anchor.z;
@@ -403,7 +403,7 @@ void main() {
403
403
  vRing = iRing;
404
404
  vDim = (uFocusFloor < -0.5 || abs(iFloor - uFocusFloor) < 0.5) ? 0.0 : 1.0;
405
405
  gl_Position = projectionMatrix * mv;
406
- }`,On=`#version 300 es
406
+ }`,Qn=`#version 300 es
407
407
  precision highp float;
408
408
  in vec3 vColor;
409
409
  in vec3 vNormalWorld;
@@ -460,14 +460,14 @@ void main() {
460
460
  float sheen = clamp((1.0 - uRoughness) / 0.22, 0.15, 2.0);
461
461
  base += vec3(0.26, 0.31, 0.38) * fres * 0.55 * mix(sheen, 1.0, vOccupant);
462
462
  fragColor = vec4(base, 1.0);
463
- }`,Nn=`#version 300 es
463
+ }`,$n=`#version 300 es
464
464
  precision highp float;
465
465
  in vec2 position;
466
466
  out vec2 vUv;
467
467
  void main() {
468
468
  vUv = position * 0.5 + 0.5;
469
469
  gl_Position = vec4(position, 0.999, 1.0);
470
- }`,Gn=`#version 300 es
470
+ }`,Zn=`#version 300 es
471
471
  precision highp float;
472
472
  in vec2 vUv;
473
473
  uniform vec3 uTop;
@@ -478,7 +478,7 @@ void main() {
478
478
  vec2 c = vUv - 0.5;
479
479
  float vig = 1.0 - dot(c, c) * 0.85; // soft vignette
480
480
  fragColor = vec4(col * vig, 1.0);
481
- }`,Bn=`#version 300 es
481
+ }`,Jn=`#version 300 es
482
482
  precision highp float;
483
483
  in vec2 position;
484
484
  in vec3 iOffset;
@@ -515,7 +515,7 @@ void main() {
515
515
  vPhysicalSeat = iPhysicalSeat;
516
516
  vHidden = (uFocusFloor > -0.5 && abs(iFloor - uFocusFloor) > 0.5) ? 1.0 : 0.0;
517
517
  gl_Position = projectionMatrix * mv;
518
- }`,Hn=`#version 300 es
518
+ }`,er=`#version 300 es
519
519
  precision highp float;
520
520
  in vec2 vUv;
521
521
  in float vPhysicalSeat;
@@ -529,7 +529,7 @@ void main() {
529
529
  float d = mix(max(abs(vUv.x), abs(vUv.y)), length(vUv), vPhysicalSeat);
530
530
  if (d > 1.0) discard; // hit-mask matches chair/bay shape
531
531
  fragColor = vec4(vPick, 1.0);
532
- }`,Wn=`#version 300 es
532
+ }`,tr=`#version 300 es
533
533
  precision highp float;
534
534
  in vec3 position;
535
535
  in float part;
@@ -551,8 +551,8 @@ uniform float uFocusFloor;
551
551
  flat out vec3 vPick;
552
552
  out float vHidden;
553
553
  ${Je}
554
- ${ho}
555
- ${fo}
554
+ ${xo}
555
+ ${wo}
556
556
  void main() {
557
557
  int id = int(iPickIndex + 0.5); // already global index + 1
558
558
  vPick = vec3(float(id & 255), float((id >> 8) & 255), float((id >> 16) & 255)) / 255.0;
@@ -585,7 +585,7 @@ void main() {
585
585
  float c = cos(iYaw), s = sin(iYaw);
586
586
  vec3 rp = vec3(p.x * c + p.z * s, p.y, -p.x * s + p.z * c);
587
587
  gl_Position = projectionMatrix * modelViewMatrix * vec4(iOffset + rp, 1.0);
588
- }`,Un=`#version 300 es
588
+ }`,or=`#version 300 es
589
589
  precision highp float;
590
590
  flat in vec3 vPick;
591
591
  in float vHidden;
@@ -593,7 +593,7 @@ out vec4 fragColor;
593
593
  void main() {
594
594
  if (vHidden > 0.5) discard;
595
595
  fragColor = vec4(vPick, 1.0);
596
- }`,Yn=`#version 300 es
596
+ }`,nr=`#version 300 es
597
597
  precision highp float;
598
598
  in vec3 position;
599
599
  in float floorIndex;
@@ -604,14 +604,14 @@ out float vHidden;
604
604
  void main() {
605
605
  vHidden = (uFocusFloor > -0.5 && abs(floorIndex - uFocusFloor) > 0.5) ? 1.0 : 0.0;
606
606
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
607
- }`,qn=`#version 300 es
607
+ }`,rr=`#version 300 es
608
608
  precision highp float;
609
609
  in float vHidden;
610
610
  out vec4 fragColor;
611
611
  void main() {
612
612
  if (vHidden > 0.5) discard;
613
613
  fragColor = vec4(0.0, 0.0, 0.0, 1.0);
614
- }`;function vo(t){return new ge(t,{vertex:Bn,fragment:Hn,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeatRadius:{value:Ie},uSeatScale:{value:1},uMinPixels:{value:Me},uPixelToWorld:{value:.002},uChairFull:{value:ke},uChairNone:{value:Pe},uFocusFloor:{value:-1}}})}function go(t){return new ge(t,{vertex:Wn,fragment:Un,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uChairFull:{value:ke},uChairNone:{value:Pe},uBackRake:{value:mt},uBackBase:{value:ht},uFocusFloor:{value:-1}}})}function bo(t){return new ge(t,{vertex:Yn,fragment:qn,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uFocusFloor:{value:-1}}})}function yo(t,e=.78){return new ge(t,{vertex:Tn,fragment:kn,cullFace:!1,depthTest:!0,depthWrite:!0,uniforms:{uKeyDir:{value:new Float32Array([.38,.86,.34])},uFocusFloor:{value:-1},uStructureDetail:{value:0},uRoughness:{value:e}}})}function xo(t){return new ge(t,{vertex:_n,fragment:Ln,transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1,uniforms:{uSeatRadius:{value:Ie},uSeatScale:{value:1},uMinPixels:{value:Me},uPixelToWorld:{value:.002},uSeatFade:{value:0},uSeatDetail:{value:0},uFocusFloor:{value:-1},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:ke},uChairNone:{value:Pe}}})}function wo(t,e=.78){return new ge(t,{vertex:zn,fragment:On,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uKeyDir:{value:new Float32Array([.38,.86,.34])},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:ke},uChairNone:{value:Pe},uBackRake:{value:mt},uBackBase:{value:ht},uFocusFloor:{value:-1},uRoughness:{value:e}}})}function So(t,e,o){return new ge(t,{vertex:Nn,fragment:Gn,depthTest:!1,depthWrite:!1,cullFace:!1,uniforms:{uTop:{value:new Float32Array(e)},uBottom:{value:new Float32Array(o)}}})}function Po(t,e,o,r,n,a){for(let s=o;s<o+r;s++){let l=a&&e[s]===0?null:n[e[s]]??n[0];t[s*3]=l?l[0]:a[s*3],t[s*3+1]=l?l[1]:a[s*3+1],t[s*3+2]=l?l[2]:a[s*3+2]}}var Qn=new Float32Array([-1,-1,1,-1,1,1,-1,-1,1,1,-1,1]),Kn=new Float32Array([-1,-1,3,-1,-1,3]);function Co(t,e){let o=new Mo,r=new Mo,n=new Le(t,{position:{size:2,data:Kn}}),a=So(t,e.theme.background.top,e.theme.background.bottom),s=new ze(t,{geometry:n,program:a});s.frustumCulled=!1,s.setParent(r);let i=new Le(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=yo(t,e.theme.materials.roughness),p=new ze(t,{geometry:i,program:l});p.frustumCulled=!1,p.setParent(o);let v=xo(t),c=new Float32Array(e.seats.count*3),f=xe.map(z=>e.theme.seatStates[z]);Po(c,e.seats.iState,0,e.seats.count,f,e.seats.iCategory);let m=new Le(t,{position:{size:2,data:Qn},iOffset:{size:3,data:e.seats.iPosition,instanced:1},iColor:{size:3,data:c,instanced:1},iMaxRadius:{size:1,data:e.seats.iMaxRadius,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}}),u=new ze(t,{geometry:m,program:v});u.frustumCulled=!1,e.seats.count>0&&u.setParent(o);let M=m.attributes.iColor,S=Ut(),P=wo(t,e.theme.materials.roughness),R=Ke,y=new Float32Array(R*3),A=new Float32Array(R*3),g=new Float32Array(R),C=new Float32Array(R),V=new Float32Array(R),D=new Float32Array(R*3),L=new Float32Array(R),N=new Float32Array(R),E=new Float32Array(R),G=new Float32Array(R),O=new Le(t,{position:{size:3,data:S.position},normal:{size:3,data:S.normal},part:{size:1,data:S.part},index:{data:S.index},iOffset:{size:3,data:y,instanced:1},iColor:{size:3,data:A,instanced:1},iRadius:{size:1,data:g,instanced:1},iYaw:{size:1,data:C,instanced:1},iGlyph:{size:1,data:V,instanced:1},iRing:{size:3,data:D,instanced:1},iFloor:{size:1,data:L,instanced:1},iPhysicalSeat:{size:1,data:N,instanced:1},iSeed:{size:1,data:G,instanced:1},iPickIndex:{size:1,data:E,instanced:1}}),w=new ze(t,{geometry:O,program:P});w.frustumCulled=!1;let b=0,W=!1,K=!1,q=null,x=null,T=null,J=new Int32Array(0),H=()=>{let z=e.seats;for(let B=0;B<b;B++){let k=J[B];G[B]=Yt(z.iState[k],k);let Y=z.iCategory&&z.iState[k]===0?null:f[z.iState[k]]??f[0];if(Y)A[B*3]=Y[0],A[B*3+1]=Y[1],A[B*3+2]=Y[2];else{let Q=e.theme.materials.seat??Wt([z.iCategory[k*3],z.iCategory[k*3+1],z.iCategory[k*3+2]]);A[B*3]=Q[0],A[B*3+1]=Q[1],A[B*3+2]=Q[2]}}O.attributes.iColor.needsUpdate=!0,O.attributes.iSeed.needsUpdate=!0},$={main:o,background:r,seatProgram:v,solidProgram:l,chairProgram:P,seatGeometry:m,chairGeometry:O,solidGeometry:i,drawCalls:3,setNearSeats(z,B){let k=Math.min(B,R);if(J=z,b=k,k===0){w.parent&&w.setParent(null),O.instancedCount=0,$.drawCalls=3+(W?1:0);return}let I=e.seats;for(let Y=0;Y<k;Y++){let Q=z[Y];y[Y*3]=I.iPosition[Q*3],y[Y*3+1]=I.iPosition[Q*3+1],y[Y*3+2]=I.iPosition[Q*3+2],g[Y]=I.iChairWidth[Q],C[Y]=I.iYaw[Q],V[Y]=I.iGlyph[Q],D[Y*3]=I.iRing[Q*3],D[Y*3+1]=I.iRing[Q*3+1],D[Y*3+2]=I.iRing[Q*3+2],L[Y]=I.iFloor[Q],N[Y]=I.iPhysicalSeat[Q],E[Y]=Q+1}H(),O.attributes.iOffset.needsUpdate=!0,O.attributes.iRadius.needsUpdate=!0,O.attributes.iYaw.needsUpdate=!0,O.attributes.iGlyph.needsUpdate=!0,O.attributes.iRing.needsUpdate=!0,O.attributes.iFloor.needsUpdate=!0,O.attributes.iPhysicalSeat.needsUpdate=!0,O.attributes.iSeed.needsUpdate=!0,O.attributes.iPickIndex.needsUpdate=!0,O.instancedCount=k,w.parent||w.setParent(o),$.drawCalls=4+(W?1:0)},nearSeatCount(){return b},uploadSeatStateRuns(z){if(!z.length)return;b&&H();for(let k of z)Po(c,e.seats.iState,k.start,k.length,f,e.seats.iCategory);let B=M.buffer;if(!B){M.needsUpdate=!0;return}t.bindBuffer(t.ARRAY_BUFFER,B);for(let k of z){let I=c.subarray(k.start*3,(k.start+k.length)*3);t.bufferSubData(t.ARRAY_BUFFER,k.start*3*Float32Array.BYTES_PER_ELEMENT,I)}},dispose(){K=!0,n.remove(),a.remove(),i.remove(),l.remove(),m.remove(),v.remove(),O.remove(),P.remove(),q?.remove(),x?.remove(),T?.texture&&t.deleteTexture(T.texture)}},ee=e.productionElements.find(z=>z.contentImageUrl&&z.contentPlane);if(ee?.contentImageUrl&&ee.contentPlane?.length===4&&typeof Image<"u"){let z=new Image;z.crossOrigin="anonymous",z.onload=()=>{if(K)return;let B=ee.contentPlane;q=new Le(t,{position:{size:3,data:new Float32Array(B.flat())},uv:{size:2,data:new Float32Array([0,1,1,1,0,0,1,0])},floorIndex:{size:1,data:new Float32Array(4).fill(ee.floorIndex)},index:{data:new Uint16Array([0,1,2,2,1,3])}}),T=new jn(t,{image:z,generateMipmaps:!0,wrapS:t.CLAMP_TO_EDGE,wrapT:t.CLAMP_TO_EDGE,flipY:!1}),x=new Xn(t,{vertex:`#version 300 es
614
+ }`;function So(t){return new ye(t,{vertex:Jn,fragment:er,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeatRadius:{value:Ie},uSeatScale:{value:1},uMinPixels:{value:Pe},uPixelToWorld:{value:.002},uChairFull:{value:Ve},uChairNone:{value:Ce},uFocusFloor:{value:-1}}})}function Mo(t){return new ye(t,{vertex:tr,fragment:or,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uChairFull:{value:Ve},uChairNone:{value:Ce},uBackRake:{value:vt},uBackBase:{value:bt},uFocusFloor:{value:-1}}})}function Po(t){return new ye(t,{vertex:nr,fragment:rr,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uFocusFloor:{value:-1}}})}function Co(t,e=.78){return new ye(t,{vertex:Yn,fragment:Xn,cullFace:!1,depthTest:!0,depthWrite:!0,uniforms:{uKeyDir:{value:new Float32Array([.38,.86,.34])},uFocusFloor:{value:-1},uStructureDetail:{value:0},uRoughness:{value:e}}})}function Ao(t){return new ye(t,{vertex:qn,fragment:jn,transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1,uniforms:{uSeatRadius:{value:Ie},uSeatScale:{value:1},uMinPixels:{value:Pe},uPixelToWorld:{value:.002},uSeatFade:{value:0},uSeatDetail:{value:0},uFocusFloor:{value:-1},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:Ve},uChairNone:{value:Ce}}})}function Eo(t,e=.78){return new ye(t,{vertex:Kn,fragment:Qn,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uKeyDir:{value:new Float32Array([.38,.86,.34])},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:Ve},uChairNone:{value:Ce},uBackRake:{value:vt},uBackBase:{value:bt},uFocusFloor:{value:-1},uRoughness:{value:e}}})}function Ro(t,e,o){return new ye(t,{vertex:$n,fragment:Zn,depthTest:!1,depthWrite:!1,cullFace:!1,uniforms:{uTop:{value:new Float32Array(e)},uBottom:{value:new Float32Array(o)}}})}var ir=.65,ar=new Set(["dimmed","sold"]),sr=new Set(["dimmed","sold","held"]);function Fo(t,e,o){let r=new Set,n=!1,i=me.indexOf("dimmed"),s=!1;for(let l=0;l<o.length;l+=1)if(o[l]===i){s=!0;break}let a=s?sr:ar;for(let l of t){let u=e.get(l.sectionId);if(!u||!u.length){r.add(l.sectionId);continue}let f=!1;for(let p of u){let b=me[o[p]]??"available";if(!a.has(b)){f=!0;break}}f?r.add(l.sectionId):n=!0}return{lit:r,anyUnlit:n}}function Do(t,e,o,r,n,i){let s=[];for(let a of t){let l=n===null||n.has(a.sectionId);if(r.get(a.sectionId)===l)continue;r.set(a.sectionId,l);let u=(a.start+a.count)*3;for(let f=a.start*3;f<u;f++)e[f]=l?o[f]:o[f]+(i[f%3]-o[f])*ir;s.push(a)}return s}function To(t,e,o,r,n,i){for(let s=o;s<o+r;s++){let l=i&&e[s]===0?null:n[e[s]]??n[0];t[s*3]=l?l[0]:i[s*3],t[s*3+1]=l?l[1]:i[s*3+1],t[s*3+2]=l?l[2]:i[s*3+2]}}var ur=new Float32Array([-1,-1,1,-1,1,1,-1,-1,1,1,-1,1]),dr=new Float32Array([-1,-1,3,-1,-1,3]);function Vo(t,e){let o=new Io,r=new Io,n=new ke(t,{position:{size:2,data:dr}}),i=Ro(t,e.theme.background.top,e.theme.background.bottom),s=new Le(t,{geometry:n,program:i});s.frustumCulled=!1,s.setParent(r);let a=new ke(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=Co(t,e.theme.materials.roughness),u=new Le(t,{geometry:a,program:l});u.frustumCulled=!1,u.setParent(o);let f=Ao(t),p=new Float32Array(e.seats.count*3),b=me.map(I=>e.theme.seatStates[I]);To(p,e.seats.iState,0,e.seats.count,b,e.seats.iCategory);let c=new ke(t,{position:{size:2,data:ur},iOffset:{size:3,data:e.seats.iPosition,instanced:1},iColor:{size:3,data:p,instanced:1},iMaxRadius:{size:1,data:e.seats.iMaxRadius,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}}),d=new Le(t,{geometry:c,program:f});d.frustumCulled=!1,e.seats.count>0&&d.setParent(o);let E=c.attributes.iColor,P=e.solids.color.slice(),M=e.theme.structure.ground,k=new Map(e.sectionSolidRanges.map(I=>[I.sectionId,!0])),y=Qt(),F=Eo(t,e.theme.materials.roughness),v=Qe,w=new Float32Array(v*3),D=new Float32Array(v*3),T=new Float32Array(v),L=new Float32Array(v),z=new Float32Array(v),C=new Float32Array(v*3),Q=new Float32Array(v),K=new Float32Array(v),V=new Float32Array(v),G=new Float32Array(v),x=new ke(t,{position:{size:3,data:y.position},normal:{size:3,data:y.normal},part:{size:1,data:y.part},index:{data:y.index},iOffset:{size:3,data:w,instanced:1},iColor:{size:3,data:D,instanced:1},iRadius:{size:1,data:T,instanced:1},iYaw:{size:1,data:L,instanced:1},iGlyph:{size:1,data:z,instanced:1},iRing:{size:3,data:C,instanced:1},iFloor:{size:1,data:Q,instanced:1},iPhysicalSeat:{size:1,data:K,instanced:1},iSeed:{size:1,data:G,instanced:1},iPickIndex:{size:1,data:V,instanced:1}}),S=new Le(t,{geometry:x,program:F});S.frustumCulled=!1;let X=0,g=!1,O=!1,J=null,W=null,ee=null,$=new Int32Array(0),le=()=>{let I=e.seats;for(let N=0;N<X;N++){let R=$[N];G[N]=$t(I.iState[R],R);let B=I.iCategory&&I.iState[R]===0?null:b[I.iState[R]]??b[0];if(B)D[N*3]=B[0],D[N*3+1]=B[1],D[N*3+2]=B[2];else{let q=e.theme.materials.seat??jt([I.iCategory[R*3],I.iCategory[R*3+1],I.iCategory[R*3+2]]);D[N*3]=q[0],D[N*3+1]=q[1],D[N*3+2]=q[2]}}x.attributes.iColor.needsUpdate=!0,x.attributes.iSeed.needsUpdate=!0},oe={main:o,background:r,seatProgram:f,solidProgram:l,chairProgram:F,seatGeometry:c,chairGeometry:x,solidGeometry:a,drawCalls:3,setNearSeats(I,N){let R=Math.min(N,v);if($=I,X=R,R===0){S.parent&&S.setParent(null),x.instancedCount=0,oe.drawCalls=3+(g?1:0);return}let U=e.seats;for(let B=0;B<R;B++){let q=I[B];w[B*3]=U.iPosition[q*3],w[B*3+1]=U.iPosition[q*3+1],w[B*3+2]=U.iPosition[q*3+2],T[B]=U.iChairWidth[q],L[B]=U.iYaw[q],z[B]=U.iGlyph[q],C[B*3]=U.iRing[q*3],C[B*3+1]=U.iRing[q*3+1],C[B*3+2]=U.iRing[q*3+2],Q[B]=U.iFloor[q],K[B]=U.iPhysicalSeat[q],V[B]=q+1}le(),x.attributes.iOffset.needsUpdate=!0,x.attributes.iRadius.needsUpdate=!0,x.attributes.iYaw.needsUpdate=!0,x.attributes.iGlyph.needsUpdate=!0,x.attributes.iRing.needsUpdate=!0,x.attributes.iFloor.needsUpdate=!0,x.attributes.iPhysicalSeat.needsUpdate=!0,x.attributes.iSeed.needsUpdate=!0,x.attributes.iPickIndex.needsUpdate=!0,x.instancedCount=R,S.parent||S.setParent(o),oe.drawCalls=4+(g?1:0)},nearSeatCount(){return X},setSectionShellLit(I){let N=Do(e.sectionSolidRanges,e.solids.color,P,k,I,M);if(!N.length)return;let R=a.attributes.color,U=R.buffer;if(!U){R.needsUpdate=!0;return}t.bindBuffer(t.ARRAY_BUFFER,U);for(let B of N){let q=e.solids.color.subarray(B.start*3,(B.start+B.count)*3);t.bufferSubData(t.ARRAY_BUFFER,B.start*3*Float32Array.BYTES_PER_ELEMENT,q)}},uploadSeatStateRuns(I){if(!I.length)return;X&&le();for(let R of I)To(p,e.seats.iState,R.start,R.length,b,e.seats.iCategory);let N=E.buffer;if(!N){E.needsUpdate=!0;return}t.bindBuffer(t.ARRAY_BUFFER,N);for(let R of I){let U=p.subarray(R.start*3,(R.start+R.length)*3);t.bufferSubData(t.ARRAY_BUFFER,R.start*3*Float32Array.BYTES_PER_ELEMENT,U)}},dispose(){O=!0,n.remove(),i.remove(),a.remove(),l.remove(),c.remove(),f.remove(),x.remove(),F.remove(),J?.remove(),W?.remove(),ee?.texture&&t.deleteTexture(ee.texture)}},Z=e.productionElements.find(I=>I.contentImageUrl&&I.contentPlane);if(Z?.contentImageUrl&&Z.contentPlane?.length===4&&typeof Image<"u"){let I=new Image;I.crossOrigin="anonymous",I.onload=()=>{if(O)return;let N=Z.contentPlane;J=new ke(t,{position:{size:3,data:new Float32Array(N.flat())},uv:{size:2,data:new Float32Array([0,1,1,1,0,0,1,0])},floorIndex:{size:1,data:new Float32Array(4).fill(Z.floorIndex)},index:{data:new Uint16Array([0,1,2,2,1,3])}}),ee=new cr(t,{image:I,generateMipmaps:!0,wrapS:t.CLAMP_TO_EDGE,wrapT:t.CLAMP_TO_EDGE,flipY:!1}),W=new lr(t,{vertex:`#version 300 es
615
615
  precision highp float;
616
616
  in vec3 position; in vec2 uv; in float floorIndex;
617
617
  uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform float uFocusFloor;
@@ -619,4 +619,4 @@ void main() {
619
619
  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
620
620
  precision highp float;
621
621
  in vec2 vUv; in float vDim; uniform sampler2D uImage; out vec4 fragColor;
622
- void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:T},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let k=new ze(t,{geometry:q,program:x});k.frustumCulled=!1,k.setParent(o),$.screenProgram=x,W=!0,$.drawCalls=3+(b?1:0)+1},z.src=ee.contentImageUrl}return $}import{Mesh as At,RenderTarget as Zn,Transform as Ft}from"ogl";function $n(t,e,o){let r=t+(e<<8)+(o<<16);return r===0?-1:r-1}function Ao(t,e,o,r,n,a){let s=-1,i=1/0;for(let l=0;l<o;l++)for(let p=0;p<e;p++){let v=(l*e+p)*4,c=$n(t[v],t[v+1],t[v+2]);if(c<0||c>=a)continue;let f=p-r,m=l-n,u=f*f+m*m;u<i&&(i=u,s=c)}return s}function Fo(t,e,o,r,n,a){let s=t-o.left,i=e-o.top,l=Math.round(s*r),p=Math.round((o.height-i)*r);return{x:Math.max(0,Math.min(n-1,l)),y:Math.max(0,Math.min(a-1,p))}}var Jn=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],et=class{constructor(e,o,r,n,a){this.seatScene=new Ft;this.chairScene=new Ft;this.solidScene=new Ft;this.target=null;this.restoreClear=[0,0,0];this.renderer=e,this.gl=e.gl,this.maxIndex=a,this.seatProg=vo(this.gl),this.chairProg=go(this.gl),this.depthProg=bo(this.gl);let s=new At(this.gl,{geometry:o,program:this.seatProg});s.frustumCulled=!1,s.setParent(this.seatScene);let i=new At(this.gl,{geometry:r,program:this.chairProg});i.frustumCulled=!1,i.setParent(this.chairScene);let l=new At(this.gl,{geometry:n,program:this.depthProg});l.frustumCulled=!1,l.setParent(this.solidScene)}setRestoreClear(e){this.restoreClear=[e[0],e[1],e[2]]}syncFromSeatProgram(e){for(let r of Jn)this.seatProg.uniforms[r].value=e.uniforms[r].value;let o=e.uniforms.uFocusFloor.value;this.seatProg.uniforms.uFocusFloor.value=o,this.chairProg.uniforms.uFocusFloor.value=o,this.depthProg.uniforms.uFocusFloor.value=o}ensureTarget(){let e=this.gl.drawingBufferWidth,o=this.gl.drawingBufferHeight;return this.target&&(this.target.width!==e||this.target.height!==o)&&this.destroyTarget(),this.target||(this.target=new Zn(this.gl,{width:e,height:o,depth:!0})),this.target}destroyTarget(){if(!this.target)return;let e=this.gl;this.target.buffer&&e.deleteFramebuffer(this.target.buffer);for(let o of this.target.textures??[])o.texture&&e.deleteTexture(o.texture);this.target.depthBuffer&&e.deleteRenderbuffer(this.target.depthBuffer),this.target=null}pick(e,o,r,n){let a=this.gl,s=this.ensureTarget(),i=a.drawingBufferWidth,l=a.drawingBufferHeight,p=Math.max(0,o-n),v=Math.max(0,r-n),c=Math.max(1,Math.min(i,o+n+1)-p),f=Math.max(1,Math.min(l,r+n+1)-v);a.enable(a.SCISSOR_TEST),a.scissor(p,v,c,f);let[m,u,M]=this.restoreClear;a.clearColor(0,0,0,1),this.renderer.render({scene:this.solidScene,camera:e,target:s,clear:!0}),this.renderer.render({scene:this.seatScene,camera:e,target:s,clear:!1}),this.renderer.render({scene:this.chairScene,camera:e,target:s,clear:!1}),a.clearColor(m,u,M,1),a.disable(a.SCISSOR_TEST);let S=new Uint8Array(c*f*4);return this.renderer.bindFramebuffer(s),a.readPixels(p,v,c,f,a.RGBA,a.UNSIGNED_BYTE,S),this.renderer.bindFramebuffer(),Ao(S,c,f,o-p,r-v,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function Eo(t,e){let o=[];for(let r of e)t.has(r.seatId)?t.set(r.seatId,Ht(r.state)):o.push(r);return o}function Ro(t,e,o){let r=new Set;for(let s of e)(t.has(s)||o(s)!==void 0)&&r.add(s);let n=new Map(t),a=[];for(let[s,i]of t)r.has(s)||(a.push({seatId:s,state:xe[i]??"available"}),n.delete(s));for(let s of r){if(n.has(s))continue;let i=o(s);i!==void 0&&(n.set(s,i),a.push({seatId:s,state:"selected"}))}return{updates:a,next:n}}import{Quat as Oe,Vec3 as or}from"ogl";function er(t,e){return[t[0]-e[0],t[1]-e[1],t[2]-e[2]]}function Do(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function tr(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Vo(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 Et(t){let e=Math.max(0,Math.min(1,t));return e*e*e*(e*(e*6-15)+10)}function Rt(t,e){return Math.max(0,Math.min(1,t+e))}function Io(t,e){let o=t.length;if(o===0)return[0,0,0];if(o===1)return[...t[0]];let r=Math.max(0,Math.min(1,e)),n=o-1,a=Math.floor(r*n);a>=n&&(a=n-1);let s=r*n-a,i=t[Math.max(0,a-1)],l=t[a],p=t[a+1],v=t[Math.min(o-1,a+2)],c=s*s,f=c*s,m=[0,0,0];for(let u=0;u<3;u++)m[u]=.5*(2*l[u]+(-i[u]+p[u])*s+(2*i[u]-5*l[u]+4*p[u]-v[u])*c+(-i[u]+3*l[u]-3*p[u]+v[u])*f);return m}function Dt(t,e,o,r,n){let a=Vo(er(e,o));a[0]===0&&a[1]===0&&a[2]===0&&(a=[0,0,1]);let s=Do(Do(e,tr(a,2.5)),[0,1.5,0]),i=[e[0]-r[0],0,e[2]-r[2]],l=Vo(i);l[0]===0&&l[2]===0&&(l=[a[0],0,a[2]]);let p=Math.max(1,n),v=[r[0]+l[0]*p*1.3,r[1]+p*.75,r[2]+l[2]*p*1.3];return{waypoints:[t,v,s],finalPos:s}}function Vt(t,e,o=35,r=28){let n=Et(e),a=Io(t,n),s=Et(Math.max(0,Math.min(1,(e-.66)/.34)));return{pos:a,fov:o+(r-o)*s,eased:n}}function Lo(t,e,o){let r=t.position.clone(),n=new Oe().copy(t.quaternion);t.position.set(e[0],e[1],e[2]),t.lookAt(new or(o[0],o[1],o[2]));let a=new Oe().copy(t.quaternion);return t.position.copy(r),t.quaternion.copy(n),a}var tt=class{constructor(e){this.active=!1;this.waypoints=[];this.startQuat=new Oe;this.endQuat=new Oe;this.outQuat=new Oe;this.startTime=0;this.duration=2500;this.endFov=28;this.resolveFn=null;this.camera=e}start(e,o,r,n=2500,a=28){return this.settle(),this.waypoints=e,this.startQuat.copy(o),this.endQuat.copy(r),this.duration=n,this.endFov=a,this.startTime=performance.now(),this.active=!0,new Promise(s=>{this.resolveFn=s})}update(e){if(!this.active)return!1;let o=Math.min(1,(e-this.startTime)/this.duration),{pos:r,fov:n,eased:a}=Vt(this.waypoints,o,35,this.endFov);return this.camera.position.set(r[0],r[1],r[2]),this.outQuat.copy(this.startQuat).slerp(this.endQuat,Rt(a,.15)),this.camera.quaternion.copy(this.outQuat),this.camera.fov=n,this.camera.updateProjectionMatrix(),o>=1?(this.settle(),!1):!0}cancel(){this.settle()}settle(){this.active=!1;let e=this.resolveFn;this.resolveFn=null,e&&e()}};var nr=1.02,rr=1.5;function zo(t,e,o=0,r){let n=Number.isFinite(r)?o+r:t[1]+nr;return{eye:[t[0],n,t[2]],focal:[e.x*we,o+rr,e.y*we]}}var Ae=Math.PI/180,ar=45,Oo=80,ir=.25,It=1,sr=.25,lr=12*Ae,cr=.2,ur=1.5,No=.8,Go=6,Uo=1.9,dr=2/3,pr=.12,mr=.9,hr=1.2,fr=2,Yo=.05,vr=6;function qo(t,e,o=0){if(!t.length)return{min:[e[0]-6,o,e[2]-6],max:[e[0]+6,Math.max(o+No,e[1]),e[2]+6]};let r=1/0,n=-1/0,a=1/0,s=-1/0,i=o;for(let u of t)r=Math.min(r,u.cx-u.halfX),n=Math.max(n,u.cx+u.halfX),a=Math.min(a,u.cz-u.halfZ),s=Math.max(s,u.cz+u.halfZ),i=Math.max(i,u.y);let l=n-r,p=s-a,v=Math.max(l,Math.min(p,Go))/2,c=Math.max(p,Math.min(l,Go))/2,f=(r+n)/2,m=(a+s)/2;return{min:[f-v,o,m-c],max:[f+v,Math.max(o+No,i),m+c]}}function gr(t){return{min:[t.min[0],t.min[1],t.min[2]],max:[t.max[0],t.max[1]+Uo,t.max[2]]}}function br(t){let e=t.max[1];return[(t.min[0]+t.max[0])/2,Math.max(t.min[1]+ur,e+cr,e+Uo*dr),(t.min[2]+t.max[2])/2]}function Xo(t,e){let o=t[0]-e[0],r=t[2]-e[2],n=Math.hypot(o,r);return n<.001?{x:0,z:1}:{x:o/n,z:r/n}}function Bo(t,e,o){let r=e[0]-t[0],n=e[1]-t[1],a=e[2]-t[2],s=Math.hypot(r,n,a)||1;r/=s,n/=s,a/=s;let i=-a,l=r,p=Math.hypot(i,l);if(p<1e-6)return 1/0;i/=p,l/=p;let v=1/0,c=-1/0;for(let f=0;f<8;f++){let m=(f&1?o.max[0]:o.min[0])-t[0],u=(f&2?o.max[1]:o.min[1])-t[1],M=(f&4?o.max[2]:o.min[2])-t[2],S=Math.max(Yo,m*r+u*n+M*a),P=(m*i+M*l)/S;P<v&&(v=P),P>c&&(c=P)}return c-v}function Ho(t,e,o){let r=e[0]-t[0],n=e[1]-t[1],a=e[2]-t[2],s=Math.hypot(r,n,a)||1;r/=s,n/=s,a/=s;let i=-a,l=r,p=Math.hypot(i,l);if(p<1e-6)return 1/0;i/=p,l/=p;let v=-l*n,c=l*r-i*a,f=i*n,m=1/0,u=-1/0;for(let M=0;M<8;M++){let S=(M&1?o.max[0]:o.min[0])-t[0],P=(M&2?o.max[1]:o.min[1])-t[1],R=(M&4?o.max[2]:o.min[2])-t[2],y=Math.max(Yo,S*r+P*n+R*a),A=(S*v+P*c+R*f)/y;A<m&&(m=A),A>u&&(u=A)}return u-m}function ot(t,e){return Math.tan(t*Ae/2)*Math.max(.05,e)}function Wo(t,e,o){let r=i=>Math.max(ar,Math.min(Oo,i)),n=i=>2*Math.atan(i)/Ae,a=Number.isFinite(t)&&t>0?r(n(t/(2*ir)/Math.max(.05,o))):Oo;if(!(Number.isFinite(e)&&e>0))return a;let s=Math.min(a,r(n(e/(2*pr))));return t/(2*ot(s,o))>It?a:s}function jo(t,e,o){let r=br(e),n=[t[0],t[1],t[2]],a=0,s=0,i=m=>{if(!(m>0))return;let u=Xo(n,r);n[0]+=u.x*m,n[2]+=u.z*m,s+=m},l=e.max[1]+sr-n[1];l>0&&(n[1]+=l,a=l,i(l/Math.tan(lr)));let p=gr(e),v=Bo(n,r,e),c=Wo(v,Ho(n,r,p),o),f=v/(2*ot(c,o));for(let m=0;m<vr&&f>It;m++){let u=Math.max(1,Math.hypot(n[0]-r[0],n[2]-r[2])),M=Number.isFinite(f)?f/It:2;i(Math.min(60,u*(Math.min(4,M)-1)+.5)),v=Bo(n,r,e),c=Wo(v,Ho(n,r,p),o),f=v/(2*ot(c,o))}return{eye:n,focal:r,fov:c,raisedM:a,pulledBackM:s,stageFrameWidth:f}}function yr(t,e,o){let r=Math.tan(e*Ae/2),n=ot(e,o);return Math.max(1,t/Math.max(.05,Math.min(r,n)))}function Qo(t,e){let{aspect:o,venue:r}=e,n=t.focal,a=Xo(t.eye,n),s=f=>(f[0]-n[0])*a.x+(f[2]-n[2])*a.z,i=[{name:"seat",eye:t.eye,focal:n,fov:t.fov}],l=fr*(e.rowDepthM??mr);i.push({name:"row",eye:[t.eye[0]+a.x*l,t.eye[1]+hr,t.eye[2]+a.z*l],focal:n,fov:t.fov});let p=(f,m,u,M)=>{let S=yr(u,t.fov,o)*1.08,P=S*Math.sin(M*Ae),R=S*Math.cos(M*Ae);return{name:f,eye:[m[0]+a.x*R,m[1]+P,m[2]+a.z*R],focal:m,fov:t.fov}};e.section&&e.section.radius>0&&i.push(p("section",e.section.center,e.section.radius,14)),i.push(p("venue",r.center,Math.max(1,r.radius),26));let v=[],c=-1/0;for(let f of i){let m=s(f.eye);v.length&&m<=c+.5||(v.push(f),c=m)}return v}import{Vec3 as xr}from"ogl";var Ge=Math.PI/180,Ko=320,$o=70*Ge,wr=32*Ge,Sr=24*Ge,Zo=.0026,Mr=.22,Pr=.006,Cr=180,Ar=4,ae=(t,e,o)=>Math.max(e,Math.min(o,t)),Jo=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2;function en(t){let{canvas:e,camera:o}=t,r=[],n=!1,a=0,s=0,i=0,l=0,p=0,v=0,c=!1,f=[0,0],m=0,u=!1,M=null,S=null,P=new Map,R=!1,y=0,A=0,g=0,C=0,V=()=>n&&r.length?r[ae(Math.round(a),0,r.length-1)].name:null,D=()=>{let x=V();x!==M&&(M=x,t.onStopChange?.(x))},L=()=>{if(!n||!r.length)return;let x=r[ae(Math.floor(a),0,r.length-1)],T=r[ae(Math.ceil(a),0,r.length-1)],J=ae(a-Math.floor(a),0,1),H=(be,Be)=>be+(Be-be)*J,$=[H(x.eye[0],T.eye[0]),H(x.eye[1],T.eye[1]),H(x.eye[2],T.eye[2])],ee=[H(x.focal[0],T.focal[0]),H(x.focal[1],T.focal[1]),H(x.focal[2],T.focal[2])],z=ee[0]-$[0],B=ee[1]-$[1],k=ee[2]-$[2],I=Math.hypot(z,B,k)||1,Y=Math.atan2(z,k),Q=Math.asin(ae(B/I,-1,1)),ie=Y+s,me=ae(Q+i,-80*Ge,80*Ge),Fe=Math.cos(me)*I;z=Math.sin(ie)*Fe,B=Math.sin(me)*I,k=Math.cos(ie)*Fe,o.position.set($[0],$[1],$[2]),o.fov=H(x.fov,T.fov),o.updateProjectionMatrix(),o.lookAt(new xr($[0]+z,$[1]+B,$[2]+k)),t.onApplied?.()},N=()=>{if(!n||!r.length)return;let x=ae(Math.round(a),0,r.length-1);if(t.reducedMotion()){c=!1,a=x,L(),D(),t.requestRender();return}if(Math.abs(x-a)<.001){c=!1,D();return}l=a,p=x,v=performance.now(),c=!0,t.requestRender()},E=x=>{!n||r.length<2||(c=!1,a=ae(a+x,0,r.length-1),L(),D(),t.requestRender())},G=(x,T)=>{n&&(c=!1,u=!1,s=ae(s-x*Zo,-$o,$o),i=ae(i-T*Zo,-Sr,wr),L(),t.requestRender())},O=x=>{n&&(P.set(x.pointerId,{x:x.clientX,y:x.clientY}),P.size===1?(R=!0,C=0,y=x.clientX,A=x.clientY):P.size===2&&(R=!1,g=w()))},w=()=>{let x=[...P.values()];return x.length<2?0:Math.hypot(x[0].x-x[1].x,x[0].y-x[1].y)},b=x=>{if(!n||!P.has(x.pointerId))return;if(P.set(x.pointerId,{x:x.clientX,y:x.clientY}),P.size>=2){let H=w();g>0&&E((g-H)*Pr),g=H;return}if(!R)return;let T=x.clientX-y,J=x.clientY-A;y=x.clientX,A=x.clientY,C+=Math.abs(T)+Math.abs(J),!(C<=Ar)&&G(T,J)},W=x=>{P.delete(x.pointerId)&&(P.size<2&&(g=0),P.size===0&&(R=!1,N()))},K=x=>{if(!n)return;x.preventDefault();let T=x.deltaMode===1?16:x.deltaMode===2?100:1,J=ae(x.deltaY*T/100,-2,2);E(J*Mr),S&&clearTimeout(S),S=setTimeout(()=>{S=null,N()},Cr)},q=()=>{n&&(n=!1,c=!1,u=!1,r=[],P.clear(),R=!1,S&&(clearTimeout(S),S=null),M!==null&&(M=null,t.onStopChange?.(null)))};return e.addEventListener("pointerdown",O),e.addEventListener("pointermove",b),e.addEventListener("pointerup",W),e.addEventListener("pointercancel",W),e.addEventListener("wheel",K,{passive:!1}),{get active(){return n},enter(x){if(x.length<2){q();return}r=x,n=!0,a=0,s=0,i=0,c=!1,u=!1,M=null,L(),D(),t.requestRender()},exit:q,recentre(){return n?Math.abs(s)<1e-4&&Math.abs(i)<1e-4?!0:t.reducedMotion()?(u=!1,s=0,i=0,L(),t.requestRender(),!0):(f=[s,i],m=performance.now(),u=!0,t.requestRender(),!0):!1},update(x){if(!n)return!1;let T=!1;if(u){let J=ae((x-m)/Ko,0,1),H=1-Jo(J);s=f[0]*H,i=f[1]*H,J>=1?(u=!1,s=0,i=0):T=!0}if(c){let J=ae((x-v)/Ko,0,1);a=l+(p-l)*Jo(J),J>=1?(c=!1,a=p,D()):T=!0}return L(),T},currentStop:V,dispose(){q(),e.removeEventListener("pointerdown",O),e.removeEventListener("pointermove",b),e.removeEventListener("pointerup",W),e.removeEventListener("pointercancel",W),e.removeEventListener("wheel",K)}}}var Tt=null;function tn(){return Tt??=import("../openPanorama-HGRYMWKC.js").catch(t=>{throw Tt=null,t}),Tt}var on=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),nt=class{constructor(e){this.orbitLatched=!1;this.panoramaOpenedAt=0;this.cb=e}emit(e,o){if(this.cb)try{this.cb(e,o)}catch{}}opened(e,o,r,n){this.emit("3d_opened",{seats:e,hasHeights:o,...r===void 0?{}:{buildMs:Math.round(r)},...n===void 0?{}:{prepSource:n}})}orbitEngaged(){this.orbitLatched||(this.orbitLatched=!0,this.emit("3d_orbit_engaged"))}seatPicked(e,o){this.emit("3d_seat_picked",{seatId:e,sectionId:o})}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=on(),this.emit("3d_panorama_opened")}panoramaClosed(){let e=this.panoramaOpenedAt?Math.round(on()-this.panoramaOpenedAt):0;this.panoramaOpenedAt=0,this.emit("3d_panorama_closed",{viewMs:e})}panoramaFailed(e,o){this.emit("3d_panorama_failed",{seatId:e,phase:o})}panoramaFallback(e){this.emit("3d_panorama_fallback",{seatId:e})}contextLost(){this.emit("3d_context_lost")}contextRestored(){this.emit("3d_context_restored")}};function nn(t){let e=t.style.position;return getComputedStyle(t).position!=="static"?()=>{}:(t.style.position="relative",()=>{t.style.position==="relative"&&(t.style.position=e)})}function rn(t){let{container:e,model:o,opts:r,expandedSeatById:n,seatIdsByRow:a,isNarrow:s}=t,i=null,l=()=>{if(!i)return;let c=s();Object.assign(i.style,c?{left:"12px",right:"12px",bottom:"70px",transform:"none",justifyContent:"center"}:{left:"50%",right:"auto",bottom:"18px",transform:"translateX(-50%)",justifyContent:"initial"})},p=()=>{i?.remove(),i=null};return{show:(c,f,m=!1)=>{if(p(),t.isDisposed())return null;let u=document.createElement("div");u.setAttribute("role","group"),Object.assign(u.style,{position:"absolute",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",zIndex:"4"});let M=r.chrome?.caption!==!1,S=r.chrome?.seatStepper!==!1;if(!M&&!S)return null;let P=n.get(c),R=P?.sectionId?o.sections.find(N=>N.id===P.sectionId):void 0,y=P?.label??c;u.setAttribute("aria-label",`Explore views near ${R?.label?`${R.label}, `:""}seat ${y}`);let A=document.createElement("span");A.textContent=r.seatViewCaption?.(c)??["Live 3D seat view",R?.label,y].filter(Boolean).join(" \xB7 "),Object.assign(A.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)"}),M&&u.appendChild(A);let g=document.createElement("div");Object.assign(g.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),u.appendChild(g);let C=P?.rowId?a.get(P.rowId):void 0,V=C?.indexOf(c)??-1,D=V>=0?[C?.[V-1],C?.[V+1]]:[void 0,void 0],L=(N,E,G,O=!1)=>{let w=document.createElement("button");w.type="button",w.textContent=N,w.setAttribute("aria-label",E),Object.assign(w.style,{minHeight:"44px",padding:O?"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||(w.style.minWidth="44px"),O&&(w.dataset.panoramaTrigger=""),w.addEventListener("click",G),g.appendChild(w)};if(S&&D[0]){let N=n.get(D[0])?.label??D[0];L("\u2039",`View previous seat ${N}`,()=>{t.flyToSeat(D[0])})}if(S&&r.getSeatView){let N=r.seatViewActionLabel?.(c)??"Open 360\xB0 panorama";L(m?`\u21BB Retry ${N}`:`\u25C9 ${N}`,`${m?"Retry":N} from seat ${y}`,()=>{if(t.isDisposed()||f!==t.flightGen()){p();return}p(),t.openPanorama(c,400,f)},!0)}if(S&&D[1]){let N=n.get(D[1])?.label??D[1];L("\u203A",`View next seat ${N}`,()=>{t.flyToSeat(D[1])})}return!g.childElementCount&&!M?null:(e.appendChild(u),i=u,l(),u)},remove:p,layout:l}}function an(t){let{container:e,orbit:o,isNarrow:r}=t,n=document.createElement("div"),a=!1;n.className="sl-3d-navigation-controls",Object.assign(n.style,{position:"absolute",right:"14px",bottom:"14px",display:"flex",zIndex:"4",flexDirection:"column",alignItems:"flex-end",gap:"7px"});let s=document.createElement("div");s.setAttribute("role","group"),s.setAttribute("aria-label","3D drag mode"),Object.assign(s.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let i=document.createElement("div");i.setAttribute("role","group"),i.setAttribute("aria-label","3D view controls"),Object.assign(i.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let l=document.createElement("button");l.type="button",l.textContent="\u21BB",l.setAttribute("aria-label","Drag to rotate the 3D venue"),l.dataset.tooltip="Rotate venue";let p=document.createElement("button");p.type="button",p.textContent="\u2725",p.setAttribute("aria-label","Drag to move the 3D venue left, right, up or down"),p.dataset.tooltip="Move venue";let v=document.createElement("button");v.type="button",v.textContent="\u2212",v.setAttribute("aria-label","Zoom out of the 3D venue"),v.dataset.tooltip="Zoom out";let c=document.createElement("button");c.type="button",c.textContent="+",c.setAttribute("aria-label","Zoom into the 3D venue"),c.dataset.tooltip="Zoom in";for(let S of[l,p,v,c])S.className="sl-3d-icon-control",Object.assign(S.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"});s.append(l,p),i.append(c,v);let f=S=>{o.setPrimaryDragMode(S);let P=S==="orbit";l.setAttribute("aria-pressed",String(P)),p.setAttribute("aria-pressed",String(!P)),l.style.background=P?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",p.style.background=P?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",n.title=P?"Drag to rotate \xB7 Shift-drag to move":"Drag to move \xB7 Shift-drag to rotate"};l.addEventListener("click",()=>f("orbit")),p.addEventListener("click",()=>f("pan")),v.addEventListener("click",()=>o.zoomBy(1.22)),c.addEventListener("click",()=>o.zoomBy(.82)),n.append(s,i),f("orbit"),e.appendChild(n);let m=t.enabled!==!1,u=()=>{let S=r();n.style.display=a||!m?"none":"flex",n.style.right=S?"12px":"14px",n.style.bottom=S?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",s.style.display=S?"none":"flex",c.style.display=S?"none":"",v.style.display=S?"none":""};return u(),{element:n,utilityControls:i,setNavigationMode:f,setSeatViewLocked:S=>{a=S,o.setInteractionEnabled(!S),u()},seatViewLocked:()=>a,layout:u}}function sn(t){let{glctx:e,orbit:o,model:r,seats:n,opts:a,cinematic:s,analytics:i,seatIdByIndex:l,sectionIdBySeatId:p,tapSlop:v,tapMs:c,cancelFlight:f,focusSectionCamera:m,setSelection:u,ensureSeatView:M}=t,S=0,P=0,R=0,y=-1,A=!1,g=!1,C=E=>{t.seatViewLocked()||y===-1&&(y=E.pointerId,S=E.clientX,P=E.clientY,R=performance.now(),A=!1,g=s.active,s.active&&(i.cinematicCancelled(),f(),a.onViewTargetChange?.(null)))},V=E=>{E.pointerId===y&&Math.hypot(E.clientX-S,E.clientY-P)>v&&(A=!0)},D=(E,G,O,w,b)=>{let W=e.canvas.getBoundingClientRect(),K=e.canvas.clientWidth||W.width||1,q=e.canvas.clientHeight||W.height||1,x=E-W.left,T=G-W.top,J=w*w,H=-1,$=J,ee=1/0;for(let z of n){if(O&&z.sectionId!==O)continue;let B=r.seats.idToIndex.get(z.id);if(B===void 0)continue;if(b){let me=Math.round(r.seats.iState[B]??0);if(me!==0&&me!==3)continue}let k=B*3,I=pe(o.camera.projectionViewMatrix,[r.seats.iPosition[k],r.seats.iPosition[k+1]+.55,r.seats.iPosition[k+2]],K,q);if(!I.visible)continue;let Y=I.x-x,Q=I.y-T,ie=Y*Y+Q*Q;(ie<$||Math.abs(ie-$)<1&&I.depth<ee)&&(H=B,$=ie,ee=I.depth)}return H},L=(E,G)=>{let O=t.gpu(),w=t.pick();if(!O||!w)return-1;w.syncFromSeatProgram(O.seatProgram);let b=e.canvas.getBoundingClientRect(),W=e.renderer.dpr,{x:K,y:q}=Fo(E,G,b,W,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),x=Math.max(2,Math.round(8*W));return w.pick(o.camera,K,q,x)};return{onDown:C,onMove:V,onUp:E=>{if(E.pointerId!==y)return;let G=!A&&performance.now()-R<c;if(y=-1,g){g=!1;return}let O=t.gpu(),w=t.pick();if(!G||!O||!w)return;let b=L(E.clientX,E.clientY);if(t.focusedSectionId()&&b>=0){let q=l[b],x=q?p.get(q):void 0;if(x&&x!==t.focusedSectionId()&&m(x))return}if(t.focusedSectionId()&&b<0&&(b=D(E.clientX,E.clientY,t.focusedSectionId(),44,!1)),t.focusedSectionId()&&b<0){let q=D(E.clientX,E.clientY,null,72,!1),x=q>=0?l[q]:void 0,T=x?p.get(x):void 0;if(T&&T!==t.focusedSectionId()&&m(T))return}if(!t.focusedSectionId()){b<0&&(b=D(E.clientX,E.clientY,null,42,!1));let q=b>=0?l[b]:void 0,x=q?p.get(q):void 0;if(x&&m(x))return}if(b<0||b>=l.length){t.selection().size&&(u([]),a.onViewTargetChange?.(null));return}let W=l[b],K=xe[Math.round(r.seats.iState[b]??0)]??"available";if(K!=="available"&&K!=="selected"){a.onSeatInspect?.(W,K);return}if(t.selection().has(W)&&t.selection().size===1){u([]),a.onViewTargetChange?.(null),a.onSeatPick?.(W);return}u([W]),M(W),i.seatPicked(W,p.get(W)),a.onSeatPick?.(W)}}}var rt=class{constructor(e,o){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=o}ensureGrid(){if(this.cellStart||this.count===0)return;let e=this.iPosition,o=1/0,r=1/0,n=-1/0,a=-1/0;for(let m=0;m<this.count;m++){let u=e[m*3],M=e[m*3+2];u<o&&(o=u),u>n&&(n=u),M<r&&(r=M),M>a&&(a=M)}let s=Math.max(n-o,.001),i=Math.max(a-r,.001);this.cell=Math.max(Math.sqrt(s*i*4/this.count),.25),this.cols=Math.max(1,Math.ceil(s/this.cell)+1),this.rows=Math.max(1,Math.ceil(i/this.cell)+1),this.minX=o,this.minZ=r;let l=this.cols*this.rows,p=new Int32Array(l+1),v=m=>{let u=Math.min(this.cols-1,Math.max(0,Math.floor((e[m*3]-o)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((e[m*3+2]-r)/this.cell)))*this.cols+u};for(let m=0;m<this.count;m++)p[v(m)+1]++;for(let m=0;m<l;m++)p[m+1]+=p[m];let c=new Int32Array(this.count),f=p.slice(0,l);for(let m=0;m<this.count;m++)c[f[v(m)]++]=m;this.cellStart=p,this.cellItems=c}gather(e,o,r,n){this.ensureGrid();let a=this.cellStart,s=this.cellItems;if(!a||!s)return 0;let i=n.length,l=r*r,p=Math.floor((e-this.minX)/this.cell),v=Math.floor((o-this.minZ)/this.cell),c=Math.ceil(r/this.cell)+1,f=this.iPosition,m=0;for(let u=0;u<=c&&m<i;u++){let M=v-u,S=v+u,P=p-u,R=p+u;for(let y=M;y<=S&&m<i;y++){if(y<0||y>=this.rows)continue;let A=y===M||y===S;for(let g=P;g<=R&&m<i;g++){if(!A&&g!==P&&g!==R){g=R-1;continue}if(g<0||g>=this.cols)continue;let C=y*this.cols+g;for(let V=a[C],D=a[C+1];V<D&&m<i;V++){let L=s[V],N=f[L*3]-e,E=f[L*3+2]-o;N*N+E*E<=l&&(n[m++]=L)}}}}return m}};var at=class{constructor(e){this.ctx=e;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array(Ke);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.nearIndex=new rt(e.model.seats.iPosition,e.model.seats.count)}forceRegather(){this.lastGatherX=1/0}setDetailEnabled(e){let o=this.ctx.gpu();e||(this.detailVisible=!1),this.lastGatherX=1/0,this.lastGatherZ=1/0,!e&&o?.nearSeatCount()&&o.setNearSeats(this.nearBuf,0)}update(e){let{model:o}=this.ctx,r=this.ctx.gpu();if(!r)return;if(!e){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let n=this.ctx.orbit().camera.position;if(Math.hypot(n.x-this.lastGatherX,n.z-this.lastGatherZ)<wt)return;if(this.lastGatherX=n.x,this.lastGatherZ=n.z,Math.hypot(n.x-o.bounds.center[0],n.z-o.bounds.center[2])-o.bounds.radius>xt){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let i=this.nearIndex.gather(n.x,n.z,xt,this.nearBuf);i===0&&r.nearSeatCount()===0||r.setNearSeats(this.nearBuf,i)}ease(e,o,r){let n=1-Math.exp(-e*9),a=1-Math.exp(-e*20);this.seatDetailMix+=(o-this.seatDetailMix)*(o>this.seatDetailMix?n:a),this.structureDetailMix+=(r-this.structureDetailMix)*(r>this.structureDetailMix?n:a),Math.abs(o-this.seatDetailMix)<.01&&(this.seatDetailMix=o),Math.abs(r-this.structureDetailMix)<.01&&(this.structureDetailMix=r)}};import{Quat as Fr,Vec3 as Er}from"ogl";function ln(t){let{container:e,model:o,opts:r,orbit:n,cinematic:a,analytics:s,loop:i,labelOverlay:l,stageAzimuth:p,overviewFraming:v}=t,c=0,f=-1,m=(g,C,V=28)=>{n.camera.position.set(g[0],g[1],g[2]),n.camera.lookAt(new Er(C[0],C[1],C[2])),n.camera.fov=V,n.camera.updateProjectionMatrix()},u=document.createElement("button");u.className="sl-3d-overview-control sl-3d-icon-control",u.type="button",u.textContent="\u2302",u.setAttribute("aria-label","Fit the active level or whole venue in view"),u.dataset.tooltip="Fit view",Object.assign(u.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 M=()=>{u.textContent="\u2302"};M();let S=g=>{f=g;let C=t.gpu();C&&(C.seatProgram.uniforms.uFocusFloor.value=g,C.solidProgram.uniforms.uFocusFloor.value=g,C.chairProgram.uniforms.uFocusFloor.value=g),t.showSectionSeatLabels(null)},P=()=>{if(t.isDisposed())return;r.onViewTargetChange?.(null),r.onSectionFocusChange?.(null),t.panorama()&&(t.panorama().dispose(),t.setPanorama(null),s.panoramaClosed()),t.setPanoramaSphereVisible(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),t.restorePanoramaLayer(),u.style.display="",l.setVisible(!0),t.setFrozen(!1);let g=f>=0?o.floors[f]:null;if(t.setNearFieldDetailEnabled(!!g),t.setSeatViewLocked(!1),R(),t.removeArriveChip(),t.setNavigationMode("orbit"),g){let C=g.focalWorld[0]-g.center[0],V=g.focalWorld[2]-g.center[2],D=Math.hypot(C,V)>g.radius*.12?Math.atan2(C,V):p,L={center:g.center,radius:g.radius,box:g.box},N={polarDeg:58,margin:1.12};t.reducedMotion()?n.frame(L,!1,D,!1,N):n.frameSoft(L,D,!1,N)}else t.reducedMotion()?n.frame(o.bounds,!1,p,r.portraitOverviewCrop===!0,v):n.frameSoft(o.bounds,p,r.portraitOverviewCrop===!0,v);t.showSectionSeatLabels(null),i.requestRender()},R=()=>{c++,t.setSeatStepping(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),a.active&&(a.cancel(),n.resumeAfterFlight(o.focalWorld))},y=g=>{if(t.isDisposed()||!t.gpu())return Promise.resolve();let C=o.seats.idToIndex.get(g);if(C===void 0)return Promise.resolve();t.setNearFieldDetailEnabled(!0),r.onViewTargetChange?.(g),t.panorama()&&(t.panorama().dispose(),t.setPanorama(null),t.setPanoramaSphereVisible(!1),u.style.display="",t.restorePanoramaLayer()),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),t.setFrozen(!1);let V=t.inSeatView()&&r.arriveAtSeatEye===!0;t.setSeatStepping(V),t.setSeatViewLocked(!1);let D=++c;V?t.showArriveChip(g,D):t.removeArriveChip();let{eye:L,focal:N}=t.resolvedSeatViewPose(g,C),E=r.arriveAtSeatEye?t.seatViewArrival(g,C):null,G=E?E.focal:N,O=[n.camera.position.x,n.camera.position.y,n.camera.position.z],w=Dt(O,E?.eye??L,G,o.bounds.center,o.bounds.radius),b=E?E.eye:r.arriveAtSeatEye?L:w.finalPos,W=E?E.fov:r.arriveAtSeatEye?e.clientWidth/Math.max(1,e.clientHeight)<.7?90:65:28,K=[w.waypoints[0],w.waypoints[1],b];if(l.setVisible(!1),t.reducedMotion())return t.setSeatStepping(!1),m(b,G,W),i.requestRender(),s.cinematicSkipped(),t.isDisposed()||n.syncFromCamera(),t.setSeatViewLocked(r.arriveAtSeatEye===!0),E&&t.enterSeatView(E.stops),t.showArriveChip(g,D),Promise.resolve();let q=new Fr().copy(n.camera.quaternion),x=Lo(n.camera,b,G);i.requestRender();let T=V?700:2500;return a.start(K,q,x,T,W).then(()=>{t.isDisposed()||D!==c||(t.setSeatStepping(!1),s.cinematicPlayed(T),n.resumeAfterFlight(G),t.setSeatViewLocked(r.arriveAtSeatEye===!0),E&&t.enterSeatView(E.stops),i.requestRender(),t.showArriveChip(g,D))})},A=g=>{let C=o.sections.find(N=>N.id===g);if(!C||C.seatCount===0)return!1;t.setNearFieldDetailEnabled(!0),t.setSeatStepping(!1),t.setSeatViewLocked(!1),a.cancel(),t.removeArriveChip(),o.floors.length>1&&f!==C.floorIndex&&S(C.floorIndex),t.setNavigationMode("pan"),t.showSectionSeatLabels(g);let V=C.focalWorld[0]-C.center[0],D=C.focalWorld[2]-C.center[2],L=Math.hypot(V,D)>C.radius*.12?Math.atan2(V,D):void 0;return n.frame({center:C.center,radius:Math.max(5,C.radius*.5)},!1,L),r.onSectionFocusChange?.(g),i.requestRender(),!0};return u.addEventListener("click",P),{overviewChip:u,layoutOverviewChip:M,flightGen:()=>c,focusedFloor:()=>f,applyFloorFocus:S,placeCameraFinal:m,cancelFlight:R,focusOverview:P,flyToSeat:y,focusSectionCamera:A}}function cn(t){let e=performance.now();return{model:Te(t),buildMs:performance.now()-e,source:"main"}}function Rr(t){let e=Nt(t.doc);return{...cn({...t,seats:e}),seats:e}}function un(t,e,o){if(typeof Worker>"u")return Promise.resolve(e());let r;try{r=new Worker(new URL("./scene/scene.worker.js",import.meta.url),{type:"module"})}catch{return Promise.resolve(e())}return new Promise(n=>{let a=!1,s=p=>{a||(a=!0,clearTimeout(l),r.terminate(),n(p))},i=()=>s(e()),l=window.setTimeout(i,15e3);r.onerror=i,r.onmessage=p=>{let v=o(p.data);v?s(v):i()},r.postMessage(t)})}function Dr(t){return un(t,()=>cn(t),({model:e,buildMs:o})=>({model:e,buildMs:o,source:"worker"}))}function Vr(t){return un(t,()=>Rr(t),({model:e,buildMs:o,seats:r})=>r?{model:e,buildMs:o,seats:r,source:"worker"}:null)}var Ir=Math.PI/180,Tr=6,kr=500;function gi(t,e,o={}){let r=performance.now(),n=e.prepared?.model??Te(e),a=new nt(o.onAnalytics),s=new Array(n.seats.count);for(let[d,h]of n.seats.idToIndex)s[h]=d;let i=new Map(e.seats.map(d=>[d.id,d])),l=new Map;for(let d of e.seats){if(!d.rowId)continue;let h=l.get(d.rowId);h?h.push(d.id):l.set(d.rowId,[d.id])}let p=new Map;for(let d of e.seats)p.set(d.id,d.sectionId);let v=e.doc.floors?.some(h=>(h.baseHeightM??0)>0)?!0:(e.doc.floors?.flatMap(h=>h.objects)??e.doc.objects).some(h=>h.type==="section"&&((h.height??0)>0||(h.rake??0)>0)),c=null,f=null,m=!1,u=!1,M=!1,S=new Map,P=null,R=null,y=null,A=new Map,g=null,C=()=>{y===null&&(y=t.style.zIndex,t.style.zIndex="20")},V=()=>{y!==null&&(t.style.zIndex==="20"&&(t.style.zIndex=y),y=null)},D=!1,L=()=>D?ne.focusedFloor():-1,N=()=>{c=Co(w.gl,n),f=new et(w.renderer,c.seatGeometry,c.chairGeometry,c.solidGeometry,n.seats.count),w.setClearColor(n.theme.background.top),f.setRestoreClear(n.theme.background.top),c.seatProgram.uniforms.uSeatRadius.value=Ie*n.theme.seatScale,c.seatProgram.uniforms.uFocusFloor.value=L(),c.solidProgram.uniforms.uFocusFloor.value=L(),c.chairProgram.uniforms.uFocusFloor.value=L(),c.screenProgram&&(c.screenProgram.uniforms.uFocusFloor.value=L()),G.forceRegather()},E=!1,G=new at({model:n,orbit:()=>b,gpu:()=>c}),O=d=>G.setDetailEnabled(d),w=new Xe(t,{onContextLost:()=>{M||a.contextLost(),m=!0,I.stop(),c=null,f=null},onContextRestored:()=>{N(),m=!1,M||a.contextRestored(),I.requestRender()}}),b=new je(w.gl,w.canvas,()=>I.requestRender(),()=>a.orbitEngaged());b.setAspect(w.aspect);let W=(e.doc.floors?.flatMap(d=>d.objects)??e.doc.objects).some(d=>d.type==="section"&&d.physical3dProvenance?.surfaceKind?.status==="inferred"),K=(()=>{if(W&&n.stages.length===0)return;let d=n.focalWorld[0]-n.bounds.center[0],h=n.focalWorld[2]-n.bounds.center[2];return Math.hypot(d,h)>n.bounds.radius*.12?Math.atan2(d,h):void 0})(),q=n.floors.length>1?{polarDeg:48,margin:1.1}:{margin:1.1},x=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;b.frame(n.bounds,!x&&o.skipInitialOverviewAnimation!==!0,K,o.portraitOverviewCrop===!0,q);let T=new tt(b.camera),J=nn(t),H=new Ze(t,{fontFamily:e.doc.theme?.fontFamily,ink:e.doc.theme?.textColor,backgroundRgb:n.theme.background.top}),$=n.labels,ee=()=>qt($,n.floors.length,L());H.setLabels(ee());let z=null,B=d=>{if(z=d,H.setForcedDense(!!d),!d){H.setLabels(ee());return}let h=e.seats.filter(_=>_.sectionId===d),F=new Set(h.map(_=>_.id)),U=new Set(h.map(_=>_.rowId)),X=new Set(S.keys()),j=new Set(h.filter(_=>X.has(_.id)).map(_=>_.id)),Z=ee().filter(_=>_.kind!=="row"&&_.kind!=="seat"||(_.kind==="row"?U.has(_.id.slice(4)):F.has(_.id.slice(5))&&(j.size===0||j.has(_.id.slice(5)))));if(n.seatCount<=6e3&&j.size===0){H.setLabels(Z);return}let te=j.size?h.filter(_=>j.has(_.id)):h,he=new Set(te.map(_=>`seat:${_.id}`)),de=te.flatMap(_=>{let re=n.seats.idToIndex.get(_.id);if(re===void 0)return[];let se=re*3;return[{id:`seat:${_.id}`,kind:"seat",text:_.displayLabel||_.label,anchor:[n.seats.iPosition[se],n.seats.iPosition[se+1]+(X.has(_.id)?1.05:.55),n.seats.iPosition[se+2]]}]});H.setLabels([...Z.filter(_=>!he.has(_.id)),...de])};N();let k=null,I=new Qe(d=>{if(m||!c||u)return!1;let F=T.active?T.update(performance.now()):k?.active?k.update(performance.now()):b.update(),U=L()>=0?n.floors[L()]:null,X=U?.radius??n.bounds.radius,j=io(b.currentDistance,X),Z=E?{center:[b.camera.position.x,b.camera.position.y,b.camera.position.z],radius:520}:n.renderBounds;b.updateClipping(Z);let te=U?.center??n.renderBounds.center,he=U?.radius??n.renderBounds.radius,de=(le,Ve)=>Math.hypot(b.camera.position.x-le[0],b.camera.position.y-le[1],b.camera.position.z-le[2])<=Ve*(G.detailVisible?1.8:1.55),_=de(te,he);if(!_&&z){let le=n.sections.find(Ve=>Ve.id===z);le&&(_=de(le.center,Math.max(12,le.radius*2)))}G.detailVisible=_;let re=c.seatProgram.uniforms;re.uSeatScale.value=j.scale,re.uSeatFade.value=j.fade;let se=!!U&&so(U.seatCount,w.canvas.clientWidth||1,w.canvas.clientHeight||1),We=lo(n.seats.count,X,b.currentDistance,b.camera.fov,w.canvas.clientHeight||1),De=G.detailVisible||se||We?1:0,Ue=G.detailVisible||L()>=0||n.floors.length>1?1:0;return G.ease(d,De,Ue),re.uSeatDetail.value=G.seatDetailMix,c.solidProgram.uniforms.uStructureDetail.value=G.structureDetailMix,re.uMinPixels.value=j.minPixels,re.uPixelToWorld.value=2*Math.tan(b.camera.fov*Ir/2)/Math.max(1,w.pixelHeight),G.update(G.detailVisible),w.renderer.render({scene:c.background,clear:!0}),w.renderer.render({scene:c.main,camera:b.camera,clear:!1}),H.update(b.camera.projectionViewMatrix,w.canvas.clientWidth||1,w.canvas.clientHeight||1,b.currentDistance,X,[b.camera.position.x,b.camera.position.y,b.camera.position.z]),F||G.seatDetailMix!==De||G.structureDetailMix!==Ue}),Y=typeof ResizeObserver<"u"?new ResizeObserver(()=>dt.resize()):null;Y?.observe(t);let Q=d=>{let h=X=>{let j=n.seats.idToIndex.get(X);return j===void 0?void 0:n.seats.iState[j]},{updates:F,next:U}=Ro(S,d,h);if(S=U,H.setSelectedSeatIds(S.keys()),z&&B(z),F.length){let X=ft(n.seats,F);c&&c.uploadSeatStateRuns(X),I.requestRender()}},ie=()=>g!==null?g:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,me=8,Fe=d=>{if(!o.getSeatView)return null;let h=A.get(d);if(!h)for(h=Promise.resolve(o.getSeatView(d)),A.set(d,h),h.catch(()=>{A.get(d)===h&&A.delete(d)});A.size>me;){let F=A.keys().next().value;if(F===void 0)break;A.delete(F)}return h},be=(d,h)=>{let F=i.get(d),U=Math.max(0,Math.round(n.seats.iFloor[h]??0)),X=e.doc.floors?.[U],j=n.floors[U],Z=X?.focalPoint??e.doc.focalPoint,te=j?{x:j.focalWorld[0]/we,y:j.focalWorld[2]/we}:Z,he=F?.focalPoint?{x:F.focalPoint.x+te.x-Z.x,y:F.focalPoint.y+te.y-Z.y}:te,de=[n.seats.iPosition[h*3],n.seats.iPosition[h*3+1],n.seats.iPosition[h*3+2]];return zo(de,he,X?.baseHeightM??0,F?.eyeHeightM)},Be=()=>(t.clientWidth||w.canvas.clientWidth)<=520,it=null,kt=null,dn=async(d,h,F)=>{if(!o.getSeatView||M||F!==ne.flightGen())return;let U;try{U=await tn()}catch{if(a.panoramaFailed(d,"mount"),!M&&F===ne.flightGen()){let X=lt(d,F,!0);requestAnimationFrame(()=>X?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(M||F!==ne.flightGen()||!it))return kt??=U.createOpenPanorama(it),kt(d,h,F)},st=rn({container:t,model:n,opts:o,expandedSeatById:i,seatIdsByRow:l,isNarrow:Be,isDisposed:()=>M,flightGen:()=>ne.flightGen(),flyToSeat:d=>zt(d),openPanorama:(d,h,F)=>dn(d,h,F)}),lt=st.show,ct=st.remove,pn=st.layout,ye=an({container:t,orbit:b,isNarrow:Be,enabled:o.chrome?.controlDock!==!1}),mn=ye.element,Ee=ye.setNavigationMode,hn=ye.layout,fn=ye.utilityControls,Re=null,_t=!1,He=d=>{ye.setSeatViewLocked(d),d||k?.exit()};k=en({canvas:w.canvas,camera:b.camera,requestRender:()=>I.requestRender(),reducedMotion:ie,onStopChange:d=>{let h=d??(_t?"seat":null);Re=h;try{o.onSeatViewStopChange?.(h)}catch{}},onApplied:()=>{M||b.syncFromCamera()}});let vn=qo(n.stages,n.focalWorld,n.bounds.groundY??0),gn=(d,h)=>{let{eye:F}=be(d,h),U=(t.clientWidth||w.canvas.clientWidth||1)/Math.max(1,t.clientHeight||w.canvas.clientHeight||1),X=jo(F,vn,U);if(o.seatViewStops===!1)return{...X,stops:[]};let j=p.get(d),Z=j?n.sections.find(te=>te.id===j):void 0;return{...X,stops:Qo(X,{aspect:U,section:Z&&Z.seatCount>0?{center:Z.center,radius:Z.radius}:null,venue:{center:n.bounds.center,radius:n.bounds.radius}})}},ne=ln({container:t,model:n,opts:o,orbit:b,cinematic:T,analytics:a,loop:I,labelOverlay:H,stageAzimuth:K,overviewFraming:q,gpu:()=>c,isDisposed:()=>M,panorama:()=>P,setPanorama:d=>{P=d},setPanoramaSphereVisible:d=>{E=d},panoramaLoadAbort:()=>R,setPanoramaLoadAbort:d=>{R=d},setFrozen:d=>{u=d},restorePanoramaLayer:V,reducedMotion:ie,resolvedSeatViewPose:be,showSectionSeatLabels:B,setNearFieldDetailEnabled:O,setSeatViewLocked:He,setNavigationMode:Ee,showArriveChip:lt,removeArriveChip:ct,inSeatView:()=>Re!==null,setSeatStepping:d=>{_t=d},seatViewArrival:(d,h)=>o.arriveAtSeatEye?gn(d,h):null,enterSeatView:d=>k?.enter(d)});D=!0;let ut=ne.overviewChip,bn=ne.layoutOverviewChip,yn=ne.applyFloorFocus,xn=ne.focusOverview,Lt=ne.cancelFlight,zt=ne.flyToSeat,Ot=ne.focusSectionCamera;fn.appendChild(ut),it={container:t,model:n,opts:o,analytics:a,orbit:b,loop:I,seatsById:i,ensureSeatView:Fe,resolvedSeatViewPose:be,gpu:()=>c,gl:w.gl,isContextLost:()=>m,isDisposed:()=>M,flightGen:()=>ne.flightGen(),setPanorama:d=>{P=d},getLoadAbort:()=>R,setLoadAbort:d=>{R=d},setPanoramaSphereVisible:d=>{E=d,d&&k?.exit()},setFrozen:d=>{u=d},raisePanoramaLayer:C,restorePanoramaLayer:V,getOverviewChip:()=>ut,labelOverlay:H,reducedMotion:ie,removeArriveChip:ct,showArriveChip:lt};let ue=sn({glctx:w,orbit:b,model:n,seats:e.seats,opts:o,cinematic:T,analytics:a,seatIdByIndex:s,sectionIdBySeatId:p,tapSlop:Tr,tapMs:kr,gpu:()=>c,pick:()=>f,seatViewLocked:()=>ye.seatViewLocked(),focusedSectionId:()=>z,selection:()=>S,cancelFlight:Lt,focusSectionCamera:Ot,setSelection:Q,ensureSeatView:Fe});w.canvas.addEventListener("pointerdown",ue.onDown),w.canvas.addEventListener("pointermove",ue.onMove),w.canvas.addEventListener("pointerup",ue.onUp),w.canvas.addEventListener("pointercancel",ue.onUp),I.requestRender();let dt={setAvailability(d){let h=Eo(S,d),F=ft(n.seats,h);F.length&&c&&c.uploadSeatStateRuns(F),I.requestRender()},setSelection:Q,setNavigationMode:Ee,zoomIn(){b.zoomBy(.82),I.requestRender()},zoomOut(){b.zoomBy(1.22),I.requestRender()},flyToSeat:zt,focusOverview:xn,seatViewStop:()=>Re,recentreSeatView:()=>k?.recentre()??!1,resize(){let{width:d,height:h}=w.resize();b.setAspect(d/Math.max(1,h)),pn(),hn(),bn(),I.requestRender()},stats(){return{...I.stats(),drawCalls:c?c.drawCalls:0,seatCount:n.seatCount}},getQualityEvidence(){let d=I.stats(),h=w.canvas.clientWidth||1,F=w.canvas.clientHeight||1,U=n.bounds.center,X=pe(b.camera.projectionViewMatrix,[U[0],n.bounds.box.min[1],U[2]],h,F),j=pe(b.camera.projectionViewMatrix,[U[0],n.bounds.box.max[1],U[2]],h,F),Z=n.bounds.box,te=[Z.min[0],Z.max[0]].flatMap(_=>[Z.min[1],Z.max[1]].flatMap(re=>[Z.min[2],Z.max[2]].map(se=>pe(b.camera.projectionViewMatrix,[_,re,se],h,F)))).filter(_=>Number.isFinite(_.x)&&Number.isFinite(_.y)&&Number.isFinite(_.depth)),he=te.length?(()=>{let _=Math.min(...te.map(fe=>fe.x)),re=Math.max(...te.map(fe=>fe.x)),se=Math.min(...te.map(fe=>fe.y)),We=Math.max(...te.map(fe=>fe.y)),De=Math.max(0,_),Ue=Math.min(h,re),le=Math.max(0,se),Ve=Math.min(F,We),Ye=Math.max(0,Ue-De),pt=Math.max(0,Ve-le);return{box:{x:De,y:le,width:Ye,height:pt},horizontalFillRatio:Ye/h,verticalFillRatio:pt/F,visibleAreaRatio:Ye*pt/(h*F),clippedEdges:[...se<0?["top"]:[],...re>h?["right"]:[],...We>F?["bottom"]:[],..._<0?["left"]:[]]}})():void 0,de=String(w.gl.getParameter(w.gl.VERSION)??"");return{viewport:{width:h,height:F},context:{webgl2:/webgl\s*2/i.test(de),lost:m},frame:{rendered:d.rendered,idle:d.idle},camera:{position:[b.camera.position.x,b.camera.position.y,b.camera.position.z],distance:b.currentDistance,verticalFovDeg:b.fovY},scene:{seatCount:n.seatCount,floorCount:n.floors.length,zoneCount:n.zones.length,sectionCount:n.sections.length,authoredRelief:v,renderedVerticalSpanM:Math.max(0,n.bounds.box.max[1]-n.bounds.box.min[1]),projectedReliefPx:X.visible&&j.visible?Math.abs(X.y-j.y):0},labels:H.qualityEvidence(),framing:he,...Re?{seatView:{fovDeg:b.camera.fov,stop:Re}}:{}}},getQualityReport(){return Ct(dt.getQualityEvidence())},loseContextForTest(){w.simulateContextLossCycle()},floors(){return n.floors},focusFloor(d){if(d!==null&&!n.floors.some(F=>F.index===d))return!1;let h=d??-1;if(O(d!==null),He(!1),yn(h),Ee("orbit"),d===null)T.cancel(),ie()?b.frame(n.bounds,!1,K,o.portraitOverviewCrop===!0,q):b.frameSoft(n.bounds,K,o.portraitOverviewCrop===!0,q);else{let F=n.floors[d];if(F.seatCount>0){T.cancel();let U=F.focalWorld[0]-F.center[0],X=F.focalWorld[2]-F.center[2],j=Math.hypot(U,X)>F.radius*.12?Math.atan2(U,X):K;b.frame({center:F.center,radius:F.radius,box:F.box},!1,j,!1,{polarDeg:58,margin:1.12})}}return I.requestRender(),!0},zones(){return n.zones},focusZone(d){let h=n.zones.find(j=>j.id===d);if(!h||h.seatCount===0)return!1;O(!1),He(!1),T.cancel(),Ee("orbit"),B(null),o.onSectionFocusChange?.(null);let F=h.focalWorld[0]-h.center[0],U=h.focalWorld[2]-h.center[2],X=Math.hypot(F,U)>h.radius*.12?Math.atan2(F,U):void 0;return b.frame({center:h.center,radius:h.radius*1.25},!1,X),I.requestRender(),!0},sections(){return n.sections},focusSection(d){return Ot(d)},rows(d){return d?n.rows.filter(h=>h.sectionId===d):n.rows},seatsInRow(d){return e.seats.filter(h=>h.rowId===d).map(h=>({id:h.id,label:h.displayLabel||h.label}))},focusRow(d){let h=n.rows.find(F=>F.id===d);return!h||h.seatCount===0?!1:(O(!0),He(!1),T.cancel(),Ee("pan"),h.sectionId&&(B(h.sectionId),o.onSectionFocusChange?.(h.sectionId)),b.frame({center:h.center,radius:Math.max(2.5,h.radius*.65)}),I.requestRender(),!0)},setReducedMotionForTest(d){g=d},dispose(){M=!0,ct(),ut.remove(),mn.remove(),Lt(),k?.dispose(),I.stop(),H.dispose(),Y?.disconnect(),P&&(P.dispose(),P=null),V(),J(),w.canvas.removeEventListener("pointerdown",ue.onDown),w.canvas.removeEventListener("pointermove",ue.onMove),w.canvas.removeEventListener("pointerup",ue.onUp),w.canvas.removeEventListener("pointercancel",ue.onUp),b.dispose(),f&&f.dispose(),c&&c.dispose(),c=null,f=null,w.dispose()}};return a.opened(n.seatCount,v,e.prepared?.buildMs??performance.now()-r,e.prepared?.source??"inline"),dt}export{En as VENUE3D_QUALITY_REPORT_VERSION,Te as buildSceneModel,Ct as inspectVenue3DQualityEvidence,gi as mountVenue3D,Dr as prepareVenue3D,Vr as prepareVenue3DFromChart};
622
+ void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:ee},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let R=new Le(t,{geometry:J,program:W});R.frustumCulled=!1,R.setParent(o),oe.screenProgram=W,g=!0,oe.drawCalls=3+(X?1:0)+1},I.src=Z.contentImageUrl}return oe}import{Mesh as Ft,RenderTarget as pr,Transform as Dt}from"ogl";function mr(t,e,o){let r=t+(e<<8)+(o<<16);return r===0?-1:r-1}function _o(t,e,o,r,n,i){let s=-1,a=1/0;for(let l=0;l<o;l++)for(let u=0;u<e;u++){let f=(l*e+u)*4,p=mr(t[f],t[f+1],t[f+2]);if(p<0||p>=i)continue;let b=u-r,c=l-n,d=b*b+c*c;d<a&&(a=d,s=p)}return s}function ko(t,e,o,r,n,i){let s=t-o.left,a=e-o.top,l=Math.round(s*r),u=Math.round((o.height-a)*r);return{x:Math.max(0,Math.min(n-1,l)),y:Math.max(0,Math.min(i-1,u))}}var hr=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],et=class{constructor(e,o,r,n,i){this.seatScene=new Dt;this.chairScene=new Dt;this.solidScene=new Dt;this.target=null;this.restoreClear=[0,0,0];this.renderer=e,this.gl=e.gl,this.maxIndex=i,this.seatProg=So(this.gl),this.chairProg=Mo(this.gl),this.depthProg=Po(this.gl);let s=new Ft(this.gl,{geometry:o,program:this.seatProg});s.frustumCulled=!1,s.setParent(this.seatScene);let a=new Ft(this.gl,{geometry:r,program:this.chairProg});a.frustumCulled=!1,a.setParent(this.chairScene);let l=new Ft(this.gl,{geometry:n,program:this.depthProg});l.frustumCulled=!1,l.setParent(this.solidScene)}setRestoreClear(e){this.restoreClear=[e[0],e[1],e[2]]}syncFromSeatProgram(e){for(let r of hr)this.seatProg.uniforms[r].value=e.uniforms[r].value;let o=e.uniforms.uFocusFloor.value;this.seatProg.uniforms.uFocusFloor.value=o,this.chairProg.uniforms.uFocusFloor.value=o,this.depthProg.uniforms.uFocusFloor.value=o}ensureTarget(){let e=this.gl.drawingBufferWidth,o=this.gl.drawingBufferHeight;return this.target&&(this.target.width!==e||this.target.height!==o)&&this.destroyTarget(),this.target||(this.target=new pr(this.gl,{width:e,height:o,depth:!0})),this.target}destroyTarget(){if(!this.target)return;let e=this.gl;this.target.buffer&&e.deleteFramebuffer(this.target.buffer);for(let o of this.target.textures??[])o.texture&&e.deleteTexture(o.texture);this.target.depthBuffer&&e.deleteRenderbuffer(this.target.depthBuffer),this.target=null}pick(e,o,r,n){let i=this.gl,s=this.ensureTarget(),a=i.drawingBufferWidth,l=i.drawingBufferHeight,u=Math.max(0,o-n),f=Math.max(0,r-n),p=Math.max(1,Math.min(a,o+n+1)-u),b=Math.max(1,Math.min(l,r+n+1)-f);i.enable(i.SCISSOR_TEST),i.scissor(u,f,p,b);let[c,d,E]=this.restoreClear;i.clearColor(0,0,0,1),this.renderer.render({scene:this.solidScene,camera:e,target:s,clear:!0}),this.renderer.render({scene:this.seatScene,camera:e,target:s,clear:!1}),this.renderer.render({scene:this.chairScene,camera:e,target:s,clear:!1}),i.clearColor(c,d,E,1),i.disable(i.SCISSOR_TEST);let P=new Uint8Array(p*b*4);return this.renderer.bindFramebuffer(s),i.readPixels(u,f,p,b,i.RGBA,i.UNSIGNED_BYTE,P),this.renderer.bindFramebuffer(),_o(P,p,b,o-u,r-f,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function Lo(t,e){let o=[];for(let r of e)t.has(r.seatId)?t.set(r.seatId,qt(r.state)):o.push(r);return o}function Oo(t,e,o){let r=new Set;for(let s of e)(t.has(s)||o(s)!==void 0)&&r.add(s);let n=new Map(t),i=[];for(let[s,a]of t)r.has(s)||(i.push({seatId:s,state:me[a]??"available"}),n.delete(s));for(let s of r){if(n.has(s))continue;let a=o(s);a!==void 0&&(n.set(s,a),i.push({seatId:s,state:"selected"}))}return{updates:i,next:n}}import{Quat as Oe,Vec3 as br}from"ogl";function fr(t,e){return[t[0]-e[0],t[1]-e[1],t[2]-e[2]]}function zo(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function vr(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function No(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 It(t){let e=Math.max(0,Math.min(1,t));return e*e*e*(e*(e*6-15)+10)}function Tt(t,e){return Math.max(0,Math.min(1,t+e))}function Bo(t,e){let o=t.length;if(o===0)return[0,0,0];if(o===1)return[...t[0]];let r=Math.max(0,Math.min(1,e)),n=o-1,i=Math.floor(r*n);i>=n&&(i=n-1);let s=r*n-i,a=t[Math.max(0,i-1)],l=t[i],u=t[i+1],f=t[Math.min(o-1,i+2)],p=s*s,b=p*s,c=[0,0,0];for(let d=0;d<3;d++)c[d]=.5*(2*l[d]+(-a[d]+u[d])*s+(2*a[d]-5*l[d]+4*u[d]-f[d])*p+(-a[d]+3*l[d]-3*u[d]+f[d])*b);return c}function Vt(t,e,o,r,n){let i=No(fr(e,o));i[0]===0&&i[1]===0&&i[2]===0&&(i=[0,0,1]);let s=zo(zo(e,vr(i,2.5)),[0,1.5,0]),a=[e[0]-r[0],0,e[2]-r[2]],l=No(a);l[0]===0&&l[2]===0&&(l=[i[0],0,i[2]]);let u=Math.max(1,n),f=[r[0]+l[0]*u*1.3,r[1]+u*.75,r[2]+l[2]*u*1.3];return{waypoints:[t,f,s],finalPos:s}}function _t(t,e,o=35,r=28){let n=It(e),i=Bo(t,n),s=It(Math.max(0,Math.min(1,(e-.66)/.34)));return{pos:i,fov:o+(r-o)*s,eased:n}}function Uo(t,e,o){let r=t.position.clone(),n=new Oe().copy(t.quaternion);t.position.set(e[0],e[1],e[2]),t.lookAt(new br(o[0],o[1],o[2]));let i=new Oe().copy(t.quaternion);return t.position.copy(r),t.quaternion.copy(n),i}var tt=class{constructor(e){this.active=!1;this.waypoints=[];this.startQuat=new Oe;this.endQuat=new Oe;this.outQuat=new Oe;this.startTime=0;this.duration=2500;this.endFov=28;this.resolveFn=null;this.camera=e}start(e,o,r,n=2500,i=28){return this.settle(),this.waypoints=e,this.startQuat.copy(o),this.endQuat.copy(r),this.duration=n,this.endFov=i,this.startTime=performance.now(),this.active=!0,new Promise(s=>{this.resolveFn=s})}update(e){if(!this.active)return!1;let o=Math.min(1,(e-this.startTime)/this.duration),{pos:r,fov:n,eased:i}=_t(this.waypoints,o,35,this.endFov);return this.camera.position.set(r[0],r[1],r[2]),this.outQuat.copy(this.startQuat).slerp(this.endQuat,Tt(i,.15)),this.camera.quaternion.copy(this.outQuat),this.camera.fov=n,this.camera.updateProjectionMatrix(),o>=1?(this.settle(),!1):!0}cancel(){this.settle()}settle(){this.active=!1;let e=this.resolveFn;this.resolveFn=null,e&&e()}};var Yo=Kt,gr=.12,yr=.25,xr=1.5;function Xo(t,e,o=0,r,n){let i=[e.x*Se,o+xr,e.y*Se],s=n?[n[0],n[1],n[2]]:i,a=t[1],l=Number.isFinite(a)?a+Yo:Number.isFinite(r)?o+r:o+Yo,u=i[0]-t[0],f=i[2]-t[2],p=Math.hypot(u,f),b=p>.001?Math.min(gr,p*yr):0,c=p>.001?u/p:0,d=p>.001?f/p:0;return{eye:[t[0]+c*b,l,t[2]+d*b],focal:s}}var xe=Math.PI/180,wr=45,qo=80,ot=70,Sr=1,Mr=.99;function Pr(t,e){if(!(t<Sr))return qo;if(!(Number.isFinite(e)&&e>0))return ot;let o=2*Math.atan(e/(2*nt*Mr)/Math.max(.05,t))/xe;return Math.max(ot,Math.min(qo,o))}var Cr=.25,nt=1,Ar=.25,Er=12*xe,Rr=.2,Fr=1.5,jo=.8,Ko=6,Jo=1.9,Dr=2/3,Ir=.12,Tr=.9,Vr=1.2,_r=2,en=.05,kr=6;function tn(t,e,o=0){if(!t.length)return{min:[e[0]-6,o,e[2]-6],max:[e[0]+6,Math.max(o+jo,e[1]),e[2]+6]};let r=1/0,n=-1/0,i=1/0,s=-1/0,a=o;for(let d of t)r=Math.min(r,d.cx-d.halfX),n=Math.max(n,d.cx+d.halfX),i=Math.min(i,d.cz-d.halfZ),s=Math.max(s,d.cz+d.halfZ),a=Math.max(a,d.y);let l=n-r,u=s-i,f=Math.max(l,Math.min(u,Ko))/2,p=Math.max(u,Math.min(l,Ko))/2,b=(r+n)/2,c=(i+s)/2;return{min:[b-f,o,c-p],max:[b+f,Math.max(o+jo,a),c+p]}}function Lr(t){return{min:[t.min[0],t.min[1],t.min[2]],max:[t.max[0],t.max[1]+Jo,t.max[2]]}}function kt(t){let e=t.max[1];return[(t.min[0]+t.max[0])/2,Math.max(t.min[1]+Fr,e+Rr,e+Jo*Dr),(t.min[2]+t.max[2])/2]}function on(t,e){let o=t[0]-e[0],r=t[2]-e[2],n=Math.hypot(o,r);return n<.001?{x:0,z:1}:{x:o/n,z:r/n}}function Qo(t,e,o){let r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=Math.hypot(r,n,i)||1;r/=s,n/=s,i/=s;let a=-i,l=r,u=Math.hypot(a,l);if(u<1e-6)return 1/0;a/=u,l/=u;let f=1/0,p=-1/0;for(let b=0;b<8;b++){let c=(b&1?o.max[0]:o.min[0])-t[0],d=(b&2?o.max[1]:o.min[1])-t[1],E=(b&4?o.max[2]:o.min[2])-t[2],P=Math.max(en,c*r+d*n+E*i),M=(c*a+E*l)/P;M<f&&(f=M),M>p&&(p=M)}return p-f}function $o(t,e,o){let r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=Math.hypot(r,n,i)||1;r/=s,n/=s,i/=s;let a=-i,l=r,u=Math.hypot(a,l);if(u<1e-6)return 1/0;a/=u,l/=u;let f=-l*n,p=l*r-a*i,b=a*n,c=1/0,d=-1/0;for(let E=0;E<8;E++){let P=(E&1?o.max[0]:o.min[0])-t[0],M=(E&2?o.max[1]:o.min[1])-t[1],k=(E&4?o.max[2]:o.min[2])-t[2],y=Math.max(en,P*r+M*n+k*i),F=(P*f+M*p+k*b)/y;F<c&&(c=F),F>d&&(d=F)}return d-c}function rt(t,e){return Math.tan(t*xe/2)*Math.max(.05,e)}function Zo(t,e,o){let r=Pr(o,t),n=l=>Math.max(wr,Math.min(r,l)),i=l=>2*Math.atan(l)/xe,s=Number.isFinite(t)&&t>0?n(i(t/(2*Cr)/Math.max(.05,o))):r;if(!(Number.isFinite(e)&&e>0))return s;let a=Math.min(s,n(i(e/(2*Ir))));return t/(2*rt(a,o))>nt?s:a}function nn(t,e,o){let r=kt(e),n=[t[0],t[1],t[2]],i=0,s=0,a=c=>{if(!(c>0))return;let d=on(n,r);n[0]+=d.x*c,n[2]+=d.z*c,s+=c},l=e.max[1]+Ar-n[1];l>0&&(n[1]+=l,i=l,a(l/Math.tan(Er)));let u=Lr(e),f=Qo(n,r,e),p=Zo(f,$o(n,r,u),o),b=f/(2*rt(p,o));for(let c=0;c<kr&&b>nt;c++){let d=Math.max(1,Math.hypot(n[0]-r[0],n[2]-r[2])),E=Number.isFinite(b)?b/nt:2;a(Math.min(60,d*(Math.min(4,E)-1)+.5)),f=Qo(n,r,e),p=Zo(f,$o(n,r,u),o),b=f/(2*rt(p,o))}return{eye:n,focal:r,fov:p,raisedM:i,pulledBackM:s,stageFrameWidth:b}}function Or(t,e,o){let r=Math.tan(e*xe/2),n=rt(e,o);return Math.max(1,t/Math.max(.05,Math.min(r,n)))}function rn(t,e){let{aspect:o,venue:r}=e,n=t.focal,i=on(t.eye,n),s=b=>(b[0]-n[0])*i.x+(b[2]-n[2])*i.z,a=[{name:"seat",eye:t.eye,focal:n,fov:t.fov}],l=_r*(e.rowDepthM??Tr);a.push({name:"row",eye:[t.eye[0]+i.x*l,t.eye[1]+Vr,t.eye[2]+i.z*l],focal:n,fov:t.fov});let u=(b,c,d,E)=>{let P=Or(d,t.fov,o)*1.08,M=P*Math.sin(E*xe),k=P*Math.cos(E*xe);return{name:b,eye:[c[0]+i.x*k,c[1]+M,c[2]+i.z*k],focal:c,fov:t.fov}};e.section&&e.section.radius>0&&a.push(u("section",e.section.center,e.section.radius,14)),a.push(u("venue",r.center,Math.max(1,r.radius),26));let f=[],p=-1/0;for(let b of a){let c=s(b.eye);f.length&&c<=p+.5||(f.push(b),p=c)}return f}import{Vec3 as zr}from"ogl";var Ne=Math.PI/180,an=320,sn=70*Ne,Nr=32*Ne,Br=24*Ne,ln=.0026,Gr=.22,Hr=.006,Wr=180,Ur=4,se=(t,e,o)=>Math.max(e,Math.min(o,t)),cn=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2;function un(t){let{canvas:e,camera:o}=t,r=[],n=!1,i=0,s=0,a=0,l=0,u=0,f=0,p=!1,b=[0,0],c=0,d=!1,E=null,P=null,M=new Map,k=!1,y=0,F=0,v=0,w=0,D=()=>n&&r.length?r[se(Math.round(i),0,r.length-1)].name:null,T=()=>{let g=D();g!==E&&(E=g,t.onStopChange?.(g))},L=()=>{if(!n||!r.length)return;let g=r[se(Math.floor(i),0,r.length-1)],O=r[se(Math.ceil(i),0,r.length-1)],J=se(i-Math.floor(i),0,1),W=(Be,Ge)=>Be+(Ge-Be)*J,ee=[W(g.eye[0],O.eye[0]),W(g.eye[1],O.eye[1]),W(g.eye[2],O.eye[2])],$=[W(g.focal[0],O.focal[0]),W(g.focal[1],O.focal[1]),W(g.focal[2],O.focal[2])],le=$[0]-ee[0],oe=$[1]-ee[1],Z=$[2]-ee[2],I=Math.hypot(le,oe,Z)||1,N=Math.atan2(le,Z),R=Math.asin(se(oe/I,-1,1)),U=N+s,B=se(R+a,-80*Ne,80*Ne),q=Math.cos(B)*I;le=Math.sin(U)*q,oe=Math.sin(B)*I,Z=Math.cos(U)*q,o.position.set(ee[0],ee[1],ee[2]),o.fov=W(g.fov,O.fov),o.updateProjectionMatrix(),o.lookAt(new zr(ee[0]+le,ee[1]+oe,ee[2]+Z)),t.onApplied?.()},z=()=>{if(!n||!r.length)return;let g=se(Math.round(i),0,r.length-1);if(t.reducedMotion()){p=!1,i=g,L(),T(),t.requestRender();return}if(Math.abs(g-i)<.001){p=!1,T();return}l=i,u=g,f=performance.now(),p=!0,t.requestRender()},C=g=>{!n||r.length<2||(p=!1,i=se(i+g,0,r.length-1),L(),T(),t.requestRender())},Q=(g,O)=>{n&&(p=!1,d=!1,s=se(s-g*ln,-sn,sn),a=se(a-O*ln,-Br,Nr),L(),t.requestRender())},K=g=>{n&&(M.set(g.pointerId,{x:g.clientX,y:g.clientY}),M.size===1?(k=!0,w=0,y=g.clientX,F=g.clientY):M.size===2&&(k=!1,v=V()))},V=()=>{let g=[...M.values()];return g.length<2?0:Math.hypot(g[0].x-g[1].x,g[0].y-g[1].y)},G=g=>{if(!n||!M.has(g.pointerId))return;if(M.set(g.pointerId,{x:g.clientX,y:g.clientY}),M.size>=2){let W=V();v>0&&C((v-W)*Hr),v=W;return}if(!k)return;let O=g.clientX-y,J=g.clientY-F;y=g.clientX,F=g.clientY,w+=Math.abs(O)+Math.abs(J),!(w<=Ur)&&Q(O,J)},x=g=>{M.delete(g.pointerId)&&(M.size<2&&(v=0),M.size===0&&(k=!1,z()))},S=g=>{if(!n)return;g.preventDefault();let O=g.deltaMode===1?16:g.deltaMode===2?100:1,J=se(g.deltaY*O/100,-2,2);C(J*Gr),P&&clearTimeout(P),P=setTimeout(()=>{P=null,z()},Wr)},X=()=>{n&&(n=!1,p=!1,d=!1,r=[],M.clear(),k=!1,P&&(clearTimeout(P),P=null),E!==null&&(E=null,t.onStopChange?.(null)))};return e.addEventListener("pointerdown",K),e.addEventListener("pointermove",G),e.addEventListener("pointerup",x),e.addEventListener("pointercancel",x),e.addEventListener("wheel",S,{passive:!1}),{get active(){return n},enter(g){if(g.length<2){X();return}r=g,n=!0,i=0,s=0,a=0,p=!1,d=!1,E=null,L(),T(),t.requestRender()},exit:X,recentre(){return n?Math.abs(s)<1e-4&&Math.abs(a)<1e-4?!0:t.reducedMotion()?(d=!1,s=0,a=0,L(),t.requestRender(),!0):(b=[s,a],c=performance.now(),d=!0,t.requestRender(),!0):!1},update(g){if(!n)return!1;let O=!1;if(d){let J=se((g-c)/an,0,1),W=1-cn(J);s=b[0]*W,a=b[1]*W,J>=1?(d=!1,s=0,a=0):O=!0}if(p){let J=se((g-f)/an,0,1);i=l+(u-l)*cn(J),J>=1?(p=!1,i=u,T()):O=!0}return L(),O},currentStop:D,dispose(){X(),e.removeEventListener("pointerdown",K),e.removeEventListener("pointermove",G),e.removeEventListener("pointerup",x),e.removeEventListener("pointercancel",x),e.removeEventListener("wheel",S)}}}function dn(t){return t.flying?"cinematic":t.panoramaMounted?"panorama":t.seatViewActive?"seatView":"orbit"}var Lt=null;function mn(){return Lt??=import("../openPanorama-6FMXAJ6O.js").catch(t=>{throw Lt=null,t}),Lt}var pn=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),it=class{constructor(e){this.orbitLatched=!1;this.panoramaOpenedAt=0;this.cb=e}emit(e,o){if(this.cb)try{this.cb(e,o)}catch{}}opened(e,o,r,n){this.emit("3d_opened",{seats:e,hasHeights:o,...r===void 0?{}:{buildMs:Math.round(r)},...n===void 0?{}:{prepSource:n}})}orbitEngaged(){this.orbitLatched||(this.orbitLatched=!0,this.emit("3d_orbit_engaged"))}seatPicked(e,o){this.emit("3d_seat_picked",{seatId:e,sectionId:o})}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=pn(),this.emit("3d_panorama_opened")}panoramaClosed(){let e=this.panoramaOpenedAt?Math.round(pn()-this.panoramaOpenedAt):0;this.panoramaOpenedAt=0,this.emit("3d_panorama_closed",{viewMs:e})}panoramaFailed(e,o){this.emit("3d_panorama_failed",{seatId:e,phase:o})}panoramaFallback(e){this.emit("3d_panorama_fallback",{seatId:e})}contextLost(){this.emit("3d_context_lost")}contextRestored(){this.emit("3d_context_restored")}};function hn(t){let e=t.style.position;return getComputedStyle(t).position!=="static"?()=>{}:(t.style.position="relative",()=>{t.style.position==="relative"&&(t.style.position=e)})}function fn(t){let{container:e,model:o,opts:r,expandedSeatById:n,seatIdsByRow:i,isNarrow:s}=t,a=null,l=()=>{if(!a)return;let p=s();Object.assign(a.style,p?{left:"12px",right:"12px",bottom:"70px",transform:"none",justifyContent:"center"}:{left:"50%",right:"auto",bottom:"18px",transform:"translateX(-50%)",justifyContent:"initial"})},u=()=>{a?.remove(),a=null};return{show:(p,b,c=!1)=>{if(u(),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 E=r.chrome?.caption!==!1,P=r.chrome?.seatStepper!==!1;if(!E&&!P)return null;let M=n.get(p),k=M?.sectionId?o.sections.find(z=>z.id===M.sectionId):void 0,y=M?.label??p;d.setAttribute("aria-label",`Explore views near ${k?.label?`${k.label}, `:""}seat ${y}`);let F=document.createElement("span");F.textContent=r.seatViewCaption?.(p)??["Live 3D seat view",k?.label,y].filter(Boolean).join(" \xB7 "),Object.assign(F.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)"}),E&&d.appendChild(F);let v=document.createElement("div");Object.assign(v.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),d.appendChild(v);let w=M?.rowId?i.get(M.rowId):void 0,D=w?.indexOf(p)??-1,T=D>=0?[w?.[D-1],w?.[D+1]]:[void 0,void 0],L=(z,C,Q,K=!1)=>{let V=document.createElement("button");V.type="button",V.textContent=z,V.setAttribute("aria-label",C),Object.assign(V.style,{minHeight:"44px",padding:K?"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"}),K||(V.style.minWidth="44px"),K&&(V.dataset.panoramaTrigger=""),V.addEventListener("click",Q),v.appendChild(V)};if(P&&T[0]){let z=n.get(T[0])?.label??T[0];L("\u2039",`View previous seat ${z}`,()=>{t.flyToSeat(T[0])})}if(P&&r.getSeatView){let z=r.seatViewActionLabel?.(p)??"Open 360\xB0 panorama";L(c?`\u21BB Retry ${z}`:`\u25C9 ${z}`,`${c?"Retry":z} from seat ${y}`,()=>{if(t.isDisposed()||b!==t.flightGen()){u();return}u(),t.openPanorama(p,400,b)},!0)}if(P&&T[1]){let z=n.get(T[1])?.label??T[1];L("\u203A",`View next seat ${z}`,()=>{t.flyToSeat(T[1])})}return!v.childElementCount&&!E?null:(e.appendChild(d),a=d,l(),d)},remove:u,layout:l}}function vn(t){let{container:e,orbit:o,isNarrow:r}=t,n=document.createElement("div"),i=!1;n.className="sl-3d-navigation-controls",Object.assign(n.style,{position:"absolute",right:"14px",bottom:"14px",display:"flex",zIndex:"4",flexDirection:"column",alignItems:"flex-end",gap:"7px"});let s=document.createElement("div");s.setAttribute("role","group"),s.setAttribute("aria-label","3D drag mode"),Object.assign(s.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let a=document.createElement("div");a.setAttribute("role","group"),a.setAttribute("aria-label","3D view controls"),Object.assign(a.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let l=document.createElement("button");l.type="button",l.textContent="\u21BB",l.setAttribute("aria-label","Drag to rotate the 3D venue"),l.dataset.tooltip="Rotate venue";let u=document.createElement("button");u.type="button",u.textContent="\u2725",u.setAttribute("aria-label","Drag to move the 3D venue left, right, up or down"),u.dataset.tooltip="Move venue";let f=document.createElement("button");f.type="button",f.textContent="\u2212",f.setAttribute("aria-label","Zoom out of the 3D venue"),f.dataset.tooltip="Zoom out";let p=document.createElement("button");p.type="button",p.textContent="+",p.setAttribute("aria-label","Zoom into the 3D venue"),p.dataset.tooltip="Zoom in";for(let P of[l,u,f,p])P.className="sl-3d-icon-control",Object.assign(P.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"});s.append(l,u),a.append(p,f);let b=P=>{o.setPrimaryDragMode(P);let M=P==="orbit";l.setAttribute("aria-pressed",String(M)),u.setAttribute("aria-pressed",String(!M)),l.style.background=M?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",u.style.background=M?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",n.title=M?"Drag to rotate \xB7 Shift-drag to move":"Drag to move \xB7 Shift-drag to rotate"};l.addEventListener("click",()=>b("orbit")),u.addEventListener("click",()=>b("pan")),f.addEventListener("click",()=>o.zoomBy(1.22)),p.addEventListener("click",()=>o.zoomBy(.82)),n.append(s,a),b("orbit"),e.appendChild(n);let c=t.enabled!==!1,d=()=>{let P=r();n.style.display=i||!c?"none":"flex",n.style.right=P?"12px":"14px",n.style.bottom=P?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",s.style.display=P?"none":"flex",p.style.display=P?"none":"",f.style.display=P?"none":""};return d(),{element:n,utilityControls:a,setNavigationMode:b,setSeatViewLocked:P=>{i=P,o.setInteractionEnabled(!P),d()},seatViewLocked:()=>i,layout:d}}function bn(t){let{glctx:e,orbit:o,model:r,seats:n,opts:i,cinematic:s,analytics:a,seatIdByIndex:l,sectionIdBySeatId:u,tapSlop:f,tapMs:p,cancelFlight:b,focusSectionCamera:c,setSelection:d,ensureSeatView:E}=t,P=0,M=0,k=0,y=-1,F=!1,v=!1,w=C=>{t.seatViewLocked()||y===-1&&(y=C.pointerId,P=C.clientX,M=C.clientY,k=performance.now(),F=!1,v=s.active,s.active&&(a.cinematicCancelled(),b(),i.onViewTargetChange?.(null)))},D=C=>{C.pointerId===y&&Math.hypot(C.clientX-P,C.clientY-M)>f&&(F=!0)},T=(C,Q,K,V,G)=>{let x=e.canvas.getBoundingClientRect(),S=e.canvas.clientWidth||x.width||1,X=e.canvas.clientHeight||x.height||1,g=C-x.left,O=Q-x.top,J=V*V,W=-1,ee=J,$=1/0;for(let le of n){if(K&&le.sectionId!==K)continue;let oe=r.seats.idToIndex.get(le.id);if(oe===void 0)continue;if(G){let B=Math.round(r.seats.iState[oe]??0);if(B!==0&&B!==3)continue}let Z=oe*3,I=fe(o.camera.projectionViewMatrix,[r.seats.iPosition[Z],r.seats.iPosition[Z+1]+.55,r.seats.iPosition[Z+2]],S,X);if(!I.visible)continue;let N=I.x-g,R=I.y-O,U=N*N+R*R;(U<ee||Math.abs(U-ee)<1&&I.depth<$)&&(W=oe,ee=U,$=I.depth)}return W},L=(C,Q)=>{let K=t.gpu(),V=t.pick();if(!K||!V)return-1;V.syncFromSeatProgram(K.seatProgram);let G=e.canvas.getBoundingClientRect(),x=e.renderer.dpr,{x:S,y:X}=ko(C,Q,G,x,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),g=Math.max(2,Math.round(8*x));return V.pick(o.camera,S,X,g)};return{onDown:w,onMove:D,onUp:C=>{if(C.pointerId!==y)return;let Q=!F&&performance.now()-k<p;if(y=-1,v){v=!1;return}let K=t.gpu(),V=t.pick();if(!Q||!K||!V)return;let G=L(C.clientX,C.clientY);if(t.focusedSectionId()&&G>=0){let X=l[G],g=X?u.get(X):void 0;if(g&&g!==t.focusedSectionId()&&c(g))return}if(t.focusedSectionId()&&G<0&&(G=T(C.clientX,C.clientY,t.focusedSectionId(),44,!1)),t.focusedSectionId()&&G<0){let X=T(C.clientX,C.clientY,null,72,!1),g=X>=0?l[X]:void 0,O=g?u.get(g):void 0;if(O&&O!==t.focusedSectionId()&&c(O))return}if(!t.focusedSectionId()){G<0&&(G=T(C.clientX,C.clientY,null,42,!1));let X=G>=0?l[G]:void 0,g=X?u.get(X):void 0;if(g&&c(g))return}if(G<0||G>=l.length){t.selection().size&&(d([]),i.onViewTargetChange?.(null));return}let x=l[G],S=me[Math.round(r.seats.iState[G]??0)]??"available";if(S!=="available"&&S!=="selected"){i.onSeatInspect?.(x,S);return}if(t.selection().has(x)&&t.selection().size===1){d([]),i.onViewTargetChange?.(null),i.onSeatPick?.(x);return}d([x]),E(x),a.seatPicked(x,u.get(x)),i.onSeatPick?.(x)}}}var at=class{constructor(e,o){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=o}ensureGrid(){if(this.cellStart||this.count===0)return;let e=this.iPosition,o=1/0,r=1/0,n=-1/0,i=-1/0;for(let c=0;c<this.count;c++){let d=e[c*3],E=e[c*3+2];d<o&&(o=d),d>n&&(n=d),E<r&&(r=E),E>i&&(i=E)}let s=Math.max(n-o,.001),a=Math.max(i-r,.001);this.cell=Math.max(Math.sqrt(s*a*4/this.count),.25),this.cols=Math.max(1,Math.ceil(s/this.cell)+1),this.rows=Math.max(1,Math.ceil(a/this.cell)+1),this.minX=o,this.minZ=r;let l=this.cols*this.rows,u=new Int32Array(l+1),f=c=>{let d=Math.min(this.cols-1,Math.max(0,Math.floor((e[c*3]-o)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((e[c*3+2]-r)/this.cell)))*this.cols+d};for(let c=0;c<this.count;c++)u[f(c)+1]++;for(let c=0;c<l;c++)u[c+1]+=u[c];let p=new Int32Array(this.count),b=u.slice(0,l);for(let c=0;c<this.count;c++)p[b[f(c)]++]=c;this.cellStart=u,this.cellItems=p}gather(e,o,r,n){this.ensureGrid();let i=this.cellStart,s=this.cellItems;if(!i||!s)return 0;let a=n.length,l=r*r,u=Math.floor((e-this.minX)/this.cell),f=Math.floor((o-this.minZ)/this.cell),p=Math.ceil(r/this.cell)+1,b=this.iPosition,c=0;for(let d=0;d<=p&&c<a;d++){let E=f-d,P=f+d,M=u-d,k=u+d;for(let y=E;y<=P&&c<a;y++){if(y<0||y>=this.rows)continue;let F=y===E||y===P;for(let v=M;v<=k&&c<a;v++){if(!F&&v!==M&&v!==k){v=k-1;continue}if(v<0||v>=this.cols)continue;let w=y*this.cols+v;for(let D=i[w],T=i[w+1];D<T&&c<a;D++){let L=s[D],z=b[L*3]-e,C=b[L*3+2]-o;z*z+C*C<=l&&(n[c++]=L)}}}}return c}};var st=class{constructor(e){this.ctx=e;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array(Qe);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.nearIndex=new at(e.model.seats.iPosition,e.model.seats.count)}forceRegather(){this.lastGatherX=1/0}setDetailEnabled(e){let o=this.ctx.gpu();e||(this.detailVisible=!1),this.lastGatherX=1/0,this.lastGatherZ=1/0,!e&&o?.nearSeatCount()&&o.setNearSeats(this.nearBuf,0)}update(e){let{model:o}=this.ctx,r=this.ctx.gpu();if(!r)return;if(!e){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let n=this.ctx.orbit().camera.position;if(Math.hypot(n.x-this.lastGatherX,n.z-this.lastGatherZ)<Pt)return;if(this.lastGatherX=n.x,this.lastGatherZ=n.z,Math.hypot(n.x-o.bounds.center[0],n.z-o.bounds.center[2])-o.bounds.radius>Mt){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let a=this.nearIndex.gather(n.x,n.z,Mt,this.nearBuf);a===0&&r.nearSeatCount()===0||r.setNearSeats(this.nearBuf,a)}ease(e,o,r){let n=1-Math.exp(-e*9),i=1-Math.exp(-e*20);this.seatDetailMix+=(o-this.seatDetailMix)*(o>this.seatDetailMix?n:i),this.structureDetailMix+=(r-this.structureDetailMix)*(r>this.structureDetailMix?n:i),Math.abs(o-this.seatDetailMix)<.01&&(this.seatDetailMix=o),Math.abs(r-this.structureDetailMix)<.01&&(this.structureDetailMix=r)}};import{Quat as Yr,Vec3 as Xr}from"ogl";function gn(){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 o=document.createElementNS(t,"path");return o.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(o),e}function yn(t){let{container:e,model:o,opts:r,orbit:n,cinematic:i,analytics:s,loop:a,labelOverlay:l,stageAzimuth:u,overviewFraming:f}=t,p=0,b=-1,c=(v,w,D=28)=>{n.camera.position.set(v[0],v[1],v[2]),n.camera.lookAt(new Xr(w[0],w[1],w[2])),n.camera.fov=D,n.camera.updateProjectionMatrix()},d=document.createElement("button");d.className="sl-3d-overview-control sl-3d-icon-control",d.type="button",d.replaceChildren(gn()),d.setAttribute("aria-label","Fit the active level or whole venue in view"),d.dataset.tooltip="Fit view",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 E=()=>{d.firstElementChild||d.replaceChildren(gn())};E();let P=v=>{b=v;let w=t.gpu();w&&(w.seatProgram.uniforms.uFocusFloor.value=v,w.solidProgram.uniforms.uFocusFloor.value=v,w.chairProgram.uniforms.uFocusFloor.value=v),t.showSectionSeatLabels(null)},M=()=>{if(t.isDisposed())return;r.onViewTargetChange?.(null),r.onSectionFocusChange?.(null),t.panorama()&&(t.panorama().dispose(),t.setPanorama(null),s.panoramaClosed()),t.setPanoramaSphereVisible(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),t.restorePanoramaLayer(),d.style.display="",l.setVisible(!0),t.setFrozen(!1);let v=b>=0?o.floors[b]:null;if(t.setNearFieldDetailEnabled(!!v),t.setSeatViewLocked(!1),k(),t.removeArriveChip(),t.setNavigationMode("orbit"),v){let w=v.focalWorld[0]-v.center[0],D=v.focalWorld[2]-v.center[2],T=Math.hypot(w,D)>v.radius*.12?Math.atan2(w,D):u,L={center:v.center,radius:v.radius,box:v.box},z={polarDeg:58,margin:1.12};t.reducedMotion()?n.frame(L,!1,T,!1,z):n.frameSoft(L,T,!1,z)}else t.reducedMotion()?n.frame(o.bounds,!1,u,r.portraitOverviewCrop===!0,f):n.frameSoft(o.bounds,u,r.portraitOverviewCrop===!0,f);t.showSectionSeatLabels(null),a.requestRender()},k=()=>{p++,t.setSeatStepping(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),i.active&&(i.cancel(),n.resumeAfterFlight(o.focalWorld))},y=v=>{if(t.isDisposed()||!t.gpu())return Promise.resolve();let w=o.seats.idToIndex.get(v);if(w===void 0)return Promise.resolve();t.setNearFieldDetailEnabled(!0),r.onViewTargetChange?.(v),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 D=t.inSeatView()&&r.arriveAtSeatEye===!0;t.setSeatStepping(D),t.setSeatViewLocked(!1);let T=++p;D?t.showArriveChip(v,T):t.removeArriveChip();let{eye:L,focal:z}=t.resolvedSeatViewPose(v,w),C=r.arriveAtSeatEye?t.seatViewArrival(v,w):null,Q=C?C.focal:z,K=[n.camera.position.x,n.camera.position.y,n.camera.position.z],V=Vt(K,C?.eye??L,Q,o.bounds.center,o.bounds.radius),G=C?C.eye:r.arriveAtSeatEye?L:V.finalPos,x=C?C.fov:r.arriveAtSeatEye?e.clientWidth/Math.max(1,e.clientHeight)<.7?ot:65:28,S=[V.waypoints[0],V.waypoints[1],G];if(l.setVisible(!1),t.reducedMotion())return t.setSeatStepping(!1),c(G,Q,x),a.requestRender(),s.cinematicSkipped(),t.isDisposed()||n.syncFromCamera(),t.setSeatViewLocked(r.arriveAtSeatEye===!0),C&&t.enterSeatView(C.stops),t.showArriveChip(v,T),Promise.resolve();let X=new Yr().copy(n.camera.quaternion),g=Uo(n.camera,G,Q);a.requestRender();let O=D?700:2500;return i.start(S,X,g,O,x).then(()=>{t.isDisposed()||T!==p||(t.setSeatStepping(!1),s.cinematicPlayed(O),n.resumeAfterFlight(Q),t.setSeatViewLocked(r.arriveAtSeatEye===!0),C&&t.enterSeatView(C.stops),a.requestRender(),t.showArriveChip(v,T))})},F=v=>{let w=o.sections.find(z=>z.id===v);if(!w||w.seatCount===0)return!1;t.setNearFieldDetailEnabled(!0),t.setSeatStepping(!1),t.setSeatViewLocked(!1),i.cancel(),t.removeArriveChip(),o.floors.length>1&&b!==w.floorIndex&&P(w.floorIndex),t.setNavigationMode("pan"),t.showSectionSeatLabels(v);let D=w.focalWorld[0]-w.center[0],T=w.focalWorld[2]-w.center[2],L=Math.hypot(D,T)>w.radius*.12?Math.atan2(D,T):void 0;return n.frame({center:w.center,radius:Math.max(5,w.radius*.5)},!1,L),r.onSectionFocusChange?.(v),a.requestRender(),!0};return d.addEventListener("click",M),{overviewChip:d,layoutOverviewChip:E,flightGen:()=>p,focusedFloor:()=>b,applyFloorFocus:P,placeCameraFinal:c,cancelFlight:k,focusOverview:M,flyToSeat:y,focusSectionCamera:F}}function xn(t){let e=performance.now();return{model:Te(t),buildMs:performance.now()-e,source:"main"}}function qr(t){let e=Ut(t.doc);return{...xn({...t,seats:e}),seats:e}}function wn(t,e,o){if(typeof Worker>"u")return Promise.resolve(e());let r;try{r=new Worker(new URL("./scene/scene.worker.js",import.meta.url),{type:"module"})}catch{return Promise.resolve(e())}return new Promise(n=>{let i=!1,s=u=>{i||(i=!0,clearTimeout(l),r.terminate(),n(u))},a=()=>s(e()),l=window.setTimeout(a,15e3);r.onerror=a,r.onmessage=u=>{let f=o(u.data);f?s(f):a()},r.postMessage(t)})}function jr(t){return wn(t,()=>xn(t),({model:e,buildMs:o})=>({model:e,buildMs:o,source:"worker"}))}function Kr(t){return wn(t,()=>qr(t),({model:e,buildMs:o,seats:r})=>r?{model:e,buildMs:o,seats:r,source:"worker"}:null)}var Qr=Math.PI/180,$r=6,Zr=500;function qa(t,e,o={}){let r=performance.now(),n=e.prepared?.model??Te(e),i=new it(o.onAnalytics),s=new Array(n.seats.count);for(let[m,h]of n.seats.idToIndex)s[h]=m;let a=new Map(e.seats.map(m=>[m.id,m])),l=new Map;for(let m of e.seats){if(!m.rowId)continue;let h=l.get(m.rowId);h?h.push(m.id):l.set(m.rowId,[m.id])}let u=new Map;for(let m of e.seats)u.set(m.id,m.sectionId);let f=new Map;for(let[m,h]of n.seats.idToIndex){let A=u.get(m);if(!A)continue;let H=f.get(A);H?H.push(h):f.set(A,[h])}let p=()=>{if(!c||!n.sectionSolidRanges.length)return;let{lit:m,anyUnlit:h}=Fo(n.sectionSolidRanges,f,n.seats.iState);c.setSectionShellLit(h?m:null)},b=e.doc.floors?.some(h=>(h.baseHeightM??0)>0)?!0:(e.doc.floors?.flatMap(h=>h.objects)??e.doc.objects).some(h=>h.type==="section"&&((h.height??0)>0||(h.rake??0)>0)),c=null,d=null,E=!1,P=!1,M=!1,k=new Map,y=null,F=null,v=null,w=new Map,D=null,T=()=>{v===null&&(v=t.style.zIndex,t.style.zIndex="20")},L=()=>{v!==null&&(t.style.zIndex==="20"&&(t.style.zIndex=v),v=null)},z=!1,C=()=>z?ie.focusedFloor():-1,Q=()=>{c=Vo(x.gl,n),p(),d=new et(x.renderer,c.seatGeometry,c.chairGeometry,c.solidGeometry,n.seats.count),x.setClearColor(n.theme.background.top),d.setRestoreClear(n.theme.background.top),c.seatProgram.uniforms.uSeatRadius.value=Ie*n.theme.seatScale,c.seatProgram.uniforms.uFocusFloor.value=C(),c.solidProgram.uniforms.uFocusFloor.value=C(),c.chairProgram.uniforms.uFocusFloor.value=C(),c.screenProgram&&(c.screenProgram.uniforms.uFocusFloor.value=C()),V.forceRegather()},K=!1,V=new st({model:n,orbit:()=>S,gpu:()=>c}),G=m=>V.setDetailEnabled(m),x=new qe(t,{onContextLost:()=>{M||i.contextLost(),E=!0,R.stop(),c=null,d=null},onContextRestored:()=>{Q(),E=!1,M||i.contextRestored(),R.requestRender()}}),S=new je(x.gl,x.canvas,()=>R.requestRender(),()=>i.orbitEngaged());S.setAspect(x.aspect);let X=(e.doc.floors?.flatMap(m=>m.objects)??e.doc.objects).some(m=>m.type==="section"&&m.physical3dProvenance?.surfaceKind?.status==="inferred"),g=(()=>{if(X&&n.stages.length===0)return;let m=n.focalWorld[0]-n.bounds.center[0],h=n.focalWorld[2]-n.bounds.center[2];return Math.hypot(m,h)>n.bounds.radius*.12?Math.atan2(m,h):void 0})(),O=n.floors.length>1?{polarDeg:48,margin:1.1}:{margin:1.1},J=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;S.frame(n.bounds,!J&&o.skipInitialOverviewAnimation!==!0,g,o.portraitOverviewCrop===!0,O);let W=new tt(S.camera),ee=hn(t),$=new Ze(t,{fontFamily:e.doc.theme?.fontFamily,ink:e.doc.theme?.textColor,backgroundRgb:n.theme.background.top}),le=n.labels,oe=()=>Zt(le,n.floors.length,C());$.setLabels(oe());let Z=null,I=m=>{if(Z=m,$.setForcedDense(!!m),!m){$.setLabels(oe());return}let h=e.seats.filter(_=>_.sectionId===m),A=new Set(h.map(_=>_.id)),H=new Set(h.map(_=>_.rowId)),Y=new Set(k.keys()),j=new Set(h.filter(_=>Y.has(_.id)).map(_=>_.id)),te=oe().filter(_=>_.kind!=="row"&&_.kind!=="seat"||(_.kind==="row"?H.has(_.id.slice(4)):A.has(_.id.slice(5))&&(j.size===0||j.has(_.id.slice(5)))));if(n.seatCount<=6e3&&j.size===0){$.setLabels(te);return}let ne=j.size?h.filter(_=>j.has(_.id)):h,ve=new Set(ne.map(_=>`seat:${_.id}`)),he=ne.flatMap(_=>{let ae=n.seats.idToIndex.get(_.id);if(ae===void 0)return[];let ce=ae*3;return[{id:`seat:${_.id}`,kind:"seat",text:_.displayLabel||_.label,anchor:[n.seats.iPosition[ce],n.seats.iPosition[ce+1]+(Y.has(_.id)?1.05:.55),n.seats.iPosition[ce+2]]}]});$.setLabels([...te.filter(_=>!ve.has(_.id)),...he])};Q();let N=null,R=new Ke(m=>{if(E||!c||P)return!1;let h=dn({flying:W.active,panoramaMounted:y!==null,seatViewActive:N?.active===!0}),A=h==="cinematic"?W.update(performance.now()):h==="seatView"?N.update(performance.now()):h==="orbit"?S.update():!1,H=C()>=0?n.floors[C()]:null,Y=H?.radius??n.bounds.radius,j=po(S.currentDistance,Y),te=K?{center:[S.camera.position.x,S.camera.position.y,S.camera.position.z],radius:520}:n.renderBounds;S.updateClipping(te);let ne=H?.center??n.renderBounds.center,ve=H?.radius??n.renderBounds.radius,he=(ue,De)=>Math.hypot(S.camera.position.x-ue[0],S.camera.position.y-ue[1],S.camera.position.z-ue[2])<=De*(V.detailVisible?1.8:1.55),_=he(ne,ve);if(!_&&Z){let ue=n.sections.find(De=>De.id===Z);ue&&(_=he(ue.center,Math.max(12,ue.radius*2)))}V.detailVisible=_;let ae=c.seatProgram.uniforms;ae.uSeatScale.value=j.scale,ae.uSeatFade.value=j.fade;let ce=!!H&&ho(H.seatCount,x.canvas.clientWidth||1,x.canvas.clientHeight||1),We=fo(n.seats.count,Y,S.currentDistance,S.camera.fov,x.canvas.clientHeight||1),Fe=V.detailVisible||ce||We?1:0,Ue=V.detailVisible||C()>=0||n.floors.length>1?1:0;return V.ease(m,Fe,Ue),ae.uSeatDetail.value=V.seatDetailMix,c.solidProgram.uniforms.uStructureDetail.value=V.structureDetailMix,ae.uMinPixels.value=j.minPixels,ae.uPixelToWorld.value=2*Math.tan(S.camera.fov*Qr/2)/Math.max(1,x.pixelHeight),V.update(V.detailVisible),x.renderer.render({scene:c.background,clear:!0}),x.renderer.render({scene:c.main,camera:S.camera,clear:!1}),$.update(S.camera.projectionViewMatrix,x.canvas.clientWidth||1,x.canvas.clientHeight||1,S.currentDistance,Y,[S.camera.position.x,S.camera.position.y,S.camera.position.z]),A||V.seatDetailMix!==Fe||V.structureDetailMix!==Ue}),U=typeof ResizeObserver<"u"?new ResizeObserver(()=>ht.resize()):null;U?.observe(t);let B=m=>{let h=Y=>{let j=n.seats.idToIndex.get(Y);return j===void 0?void 0:n.seats.iState[j]},{updates:A,next:H}=Oo(k,m,h);if(k=H,$.setSelectedSeatIds(k.keys()),Z&&I(Z),A.length){let Y=gt(n.seats,A);c&&c.uploadSeatStateRuns(Y),p(),R.requestRender()}},q=()=>D!==null?D:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Be=8,Ge=m=>{if(!o.getSeatView)return null;let h=w.get(m);if(!h)for(h=Promise.resolve(o.getSeatView(m)),w.set(m,h),h.catch(()=>{w.get(m)===h&&w.delete(m)});w.size>Be;){let A=w.keys().next().value;if(A===void 0)break;w.delete(A)}return h},Ot=tn(n.stages,n.focalWorld,n.bounds.groundY??0),Sn=kt(Ot),lt=(m,h)=>{let A=a.get(m),H=Math.max(0,Math.round(n.seats.iFloor[h]??0)),Y=e.doc.floors?.[H],j=n.floors[H],te=Y?.focalPoint??e.doc.focalPoint,ne=j?{x:j.focalWorld[0]/Se,y:j.focalWorld[2]/Se}:te,ve=A?.focalPoint?{x:A.focalPoint.x+ne.x-te.x,y:A.focalPoint.y+ne.y-te.y}:ne,he=[n.seats.iPosition[h*3],n.seats.iPosition[h*3+1],n.seats.iPosition[h*3+2]];return Xo(he,ve,Y?.baseHeightM??0,A?.eyeHeightM,Sn)},zt=()=>(t.clientWidth||x.canvas.clientWidth)<=520,ct=null,Nt=null,Mn=async(m,h,A)=>{if(!o.getSeatView||M||A!==ie.flightGen())return;let H;try{H=await mn()}catch{if(i.panoramaFailed(m,"mount"),!M&&A===ie.flightGen()){let Y=dt(m,A,!0);requestAnimationFrame(()=>Y?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(M||A!==ie.flightGen()||!ct))return Nt??=H.createOpenPanorama(ct),Nt(m,h,A)},ut=fn({container:t,model:n,opts:o,expandedSeatById:a,seatIdsByRow:l,isNarrow:zt,isDisposed:()=>M,flightGen:()=>ie.flightGen(),flyToSeat:m=>Ht(m),openPanorama:(m,h,A)=>Mn(m,h,A)}),dt=ut.show,mt=ut.remove,Pn=ut.layout,we=vn({container:t,orbit:S,isNarrow:zt,enabled:o.chrome?.controlDock!==!1}),Cn=we.element,Ee=we.setNavigationMode,An=we.layout,En=we.utilityControls,Re=null,Bt=!1,He=m=>{we.setSeatViewLocked(m),m||N?.exit()};N=un({canvas:x.canvas,camera:S.camera,requestRender:()=>R.requestRender(),reducedMotion:q,onStopChange:m=>{let h=m??(Bt?"seat":null);Re=h;try{o.onSeatViewStopChange?.(h)}catch{}},onApplied:()=>{M||S.syncFromCamera()}});let Rn=(m,h)=>{let{eye:A}=lt(m,h),H=(t.clientWidth||x.canvas.clientWidth||1)/Math.max(1,t.clientHeight||x.canvas.clientHeight||1),Y=nn(A,Ot,H);if(o.seatViewStops===!1)return{...Y,stops:[]};let j=u.get(m),te=j?n.sections.find(ne=>ne.id===j):void 0;return{...Y,stops:rn(Y,{aspect:H,section:te&&te.seatCount>0?{center:te.center,radius:te.radius}:null,venue:{center:n.bounds.center,radius:n.bounds.radius}})}},ie=yn({container:t,model:n,opts:o,orbit:S,cinematic:W,analytics:i,loop:R,labelOverlay:$,stageAzimuth:g,overviewFraming:O,gpu:()=>c,isDisposed:()=>M,panorama:()=>y,setPanorama:m=>{y=m},setPanoramaSphereVisible:m=>{K=m},panoramaLoadAbort:()=>F,setPanoramaLoadAbort:m=>{F=m},setFrozen:m=>{P=m},restorePanoramaLayer:L,reducedMotion:q,resolvedSeatViewPose:lt,showSectionSeatLabels:I,setNearFieldDetailEnabled:G,setSeatViewLocked:He,setNavigationMode:Ee,showArriveChip:dt,removeArriveChip:mt,inSeatView:()=>Re!==null,setSeatStepping:m=>{Bt=m},seatViewArrival:(m,h)=>o.arriveAtSeatEye?Rn(m,h):null,enterSeatView:m=>N?.enter(m)});z=!0;let pt=ie.overviewChip,Fn=ie.layoutOverviewChip,Dn=ie.applyFloorFocus,In=ie.focusOverview,Gt=ie.cancelFlight,Ht=ie.flyToSeat,Wt=ie.focusSectionCamera;En.appendChild(pt),ct={container:t,model:n,opts:o,analytics:i,orbit:S,loop:R,seatsById:a,ensureSeatView:Ge,resolvedSeatViewPose:lt,gpu:()=>c,gl:x.gl,isContextLost:()=>E,isDisposed:()=>M,flightGen:()=>ie.flightGen(),setPanorama:m=>{y=m},getLoadAbort:()=>F,setLoadAbort:m=>{F=m},setPanoramaSphereVisible:m=>{K=m,m&&N?.exit()},setFrozen:m=>{P=m},raisePanoramaLayer:T,restorePanoramaLayer:L,getOverviewChip:()=>pt,labelOverlay:$,reducedMotion:q,removeArriveChip:mt,showArriveChip:dt};let pe=bn({glctx:x,orbit:S,model:n,seats:e.seats,opts:o,cinematic:W,analytics:i,seatIdByIndex:s,sectionIdBySeatId:u,tapSlop:$r,tapMs:Zr,gpu:()=>c,pick:()=>d,seatViewLocked:()=>we.seatViewLocked(),focusedSectionId:()=>Z,selection:()=>k,cancelFlight:Gt,focusSectionCamera:Wt,setSelection:B,ensureSeatView:Ge});x.canvas.addEventListener("pointerdown",pe.onDown),x.canvas.addEventListener("pointermove",pe.onMove),x.canvas.addEventListener("pointerup",pe.onUp),x.canvas.addEventListener("pointercancel",pe.onUp),R.requestRender();let ht={setAvailability(m){let h=Lo(k,m),A=gt(n.seats,h);A.length&&c&&c.uploadSeatStateRuns(A),p(),R.requestRender()},setSelection:B,setNavigationMode:Ee,zoomIn(){S.zoomBy(.82),R.requestRender()},zoomOut(){S.zoomBy(1.22),R.requestRender()},flyToSeat:Ht,focusOverview:In,seatViewStop:()=>Re,recentreSeatView:()=>N?.recentre()??!1,resize(){let{width:m,height:h}=x.resize();S.setAspect(m/Math.max(1,h)),Pn(),An(),Fn(),R.requestRender()},stats(){return{...R.stats(),drawCalls:c?c.drawCalls:0,seatCount:n.seatCount}},getQualityEvidence(){let m=R.stats(),h=x.canvas.clientWidth||1,A=x.canvas.clientHeight||1,H=n.bounds.center,Y=fe(S.camera.projectionViewMatrix,[H[0],n.bounds.box.min[1],H[2]],h,A),j=fe(S.camera.projectionViewMatrix,[H[0],n.bounds.box.max[1],H[2]],h,A),te=n.bounds.box,ne=[te.min[0],te.max[0]].flatMap(_=>[te.min[1],te.max[1]].flatMap(ae=>[te.min[2],te.max[2]].map(ce=>fe(S.camera.projectionViewMatrix,[_,ae,ce],h,A)))).filter(_=>Number.isFinite(_.x)&&Number.isFinite(_.y)&&Number.isFinite(_.depth)),ve=ne.length?(()=>{let _=Math.min(...ne.map(be=>be.x)),ae=Math.max(...ne.map(be=>be.x)),ce=Math.min(...ne.map(be=>be.y)),We=Math.max(...ne.map(be=>be.y)),Fe=Math.max(0,_),Ue=Math.min(h,ae),ue=Math.max(0,ce),De=Math.min(A,We),Ye=Math.max(0,Ue-Fe),ft=Math.max(0,De-ue);return{box:{x:Fe,y:ue,width:Ye,height:ft},horizontalFillRatio:Ye/h,verticalFillRatio:ft/A,visibleAreaRatio:Ye*ft/(h*A),clippedEdges:[...ce<0?["top"]:[],...ae>h?["right"]:[],...We>A?["bottom"]:[],..._<0?["left"]:[]]}})():void 0,he=String(x.gl.getParameter(x.gl.VERSION)??"");return{viewport:{width:h,height:A},context:{webgl2:/webgl\s*2/i.test(he),lost:E},frame:{rendered:m.rendered,idle:m.idle},camera:{position:[S.camera.position.x,S.camera.position.y,S.camera.position.z],distance:S.currentDistance,verticalFovDeg:S.fovY},scene:{seatCount:n.seatCount,floorCount:n.floors.length,zoneCount:n.zones.length,sectionCount:n.sections.length,authoredRelief:b,renderedVerticalSpanM:Math.max(0,n.bounds.box.max[1]-n.bounds.box.min[1]),projectedReliefPx:Y.visible&&j.visible?Math.abs(Y.y-j.y):0},labels:$.qualityEvidence(),framing:ve,...Re?{seatView:{fovDeg:S.camera.fov,stop:Re}}:{}}},getQualityReport(){return Rt(ht.getQualityEvidence())},loseContextForTest(){x.simulateContextLossCycle()},floors(){return n.floors},focusFloor(m){if(m!==null&&!n.floors.some(A=>A.index===m))return!1;let h=m??-1;if(G(m!==null),He(!1),Dn(h),Ee("orbit"),m===null)W.cancel(),q()?S.frame(n.bounds,!1,g,o.portraitOverviewCrop===!0,O):S.frameSoft(n.bounds,g,o.portraitOverviewCrop===!0,O);else{let A=n.floors[m];if(A.seatCount>0){W.cancel();let H=A.focalWorld[0]-A.center[0],Y=A.focalWorld[2]-A.center[2],j=Math.hypot(H,Y)>A.radius*.12?Math.atan2(H,Y):g;S.frame({center:A.center,radius:A.radius,box:A.box},!1,j,!1,{polarDeg:58,margin:1.12})}}return R.requestRender(),!0},zones(){return n.zones},focusZone(m){let h=n.zones.find(j=>j.id===m);if(!h||h.seatCount===0)return!1;G(!1),He(!1),W.cancel(),Ee("orbit"),I(null),o.onSectionFocusChange?.(null);let A=h.focalWorld[0]-h.center[0],H=h.focalWorld[2]-h.center[2],Y=Math.hypot(A,H)>h.radius*.12?Math.atan2(A,H):void 0;return S.frame({center:h.center,radius:h.radius*1.25},!1,Y),R.requestRender(),!0},sections(){return n.sections},focusSection(m){return Wt(m)},rows(m){return m?n.rows.filter(h=>h.sectionId===m):n.rows},seatsInRow(m){return e.seats.filter(h=>h.rowId===m).map(h=>({id:h.id,label:h.displayLabel||h.label}))},focusRow(m){let h=n.rows.find(A=>A.id===m);return!h||h.seatCount===0?!1:(G(!0),He(!1),W.cancel(),Ee("pan"),h.sectionId&&(I(h.sectionId),o.onSectionFocusChange?.(h.sectionId)),S.frame({center:h.center,radius:Math.max(2.5,h.radius*.65)}),R.requestRender(),!0)},setReducedMotionForTest(m){D=m},dispose(){M=!0,mt(),pt.remove(),Cn.remove(),Gt(),N?.dispose(),R.stop(),$.dispose(),U?.disconnect(),y&&(y.dispose(),y=null),L(),ee(),x.canvas.removeEventListener("pointerdown",pe.onDown),x.canvas.removeEventListener("pointermove",pe.onMove),x.canvas.removeEventListener("pointerup",pe.onUp),x.canvas.removeEventListener("pointercancel",pe.onUp),S.dispose(),d&&d.dispose(),c&&c.dispose(),c=null,d=null,x.dispose()}};return i.opened(n.seatCount,b,e.prepared?.buildMs??performance.now()-r,e.prepared?.source??"inline"),ht}export{Bn as VENUE3D_QUALITY_REPORT_VERSION,Te as buildSceneModel,Rt as inspectVenue3DQualityEvidence,qa as mountVenue3D,jr as prepareVenue3D,Kr as prepareVenue3DFromChart};