@seatlayer/core 0.85.2 → 0.86.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-HEYENCES.js → chunk-D5M3SNMM.js} +1 -1
- package/dist/chunk-GI7ZTQ7C.js +1 -0
- package/dist/chunk-W53J4FJS.js +1 -0
- package/dist/core/chart-ops/index.js +1 -1
- package/dist/core/inventory/index.cjs +1 -1
- package/dist/core/inventory/index.d.cts +2 -2
- package/dist/core/inventory/index.d.ts +2 -2
- package/dist/core/inventory/index.js +1 -1
- package/dist/core/layout/index.d.cts +2 -2
- package/dist/core/layout/index.d.ts +2 -2
- package/dist/core/quality/index.cjs +1 -1
- package/dist/core/quality/index.d.cts +11 -3
- package/dist/core/quality/index.d.ts +11 -3
- package/dist/core/quality/index.js +1 -1
- package/dist/core/sections/index.d.cts +1 -1
- package/dist/core/sections/index.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +66 -7
- package/dist/index.d.ts +66 -7
- package/dist/index.js +1 -1
- package/dist/{renderedQuality-CkrbA7iV.d.ts → renderedQuality-Dy7LBzNF.d.ts} +1 -1
- package/dist/{renderedQuality-DL9Nfka1.d.cts → renderedQuality-yRjbcxVe.d.cts} +1 -1
- package/dist/{renderer-D9kIJYmd.d.cts → renderer-DbDQtwIH.d.cts} +2 -0
- package/dist/{renderer-DUko-vky.d.ts → renderer-xE1rZCGy.d.ts} +2 -0
- package/dist/{tableSizing-BGl1e6Bi.d.ts → tableSizing-B3SHwhya.d.ts} +1 -1
- package/dist/{tableSizing-CJbozzMS.d.cts → tableSizing-sUnI2XGD.d.cts} +1 -1
- package/dist/{ticketRestrictions-BD5hvqtL.d.ts → ticketRestrictions-7N9PC4Q6.d.ts} +1 -1
- package/dist/{ticketRestrictions-BEkiPPYg.d.cts → ticketRestrictions-Dtybkrpp.d.cts} +1 -1
- package/dist/view3d/index.cjs +21 -21
- package/dist/view3d/index.d.cts +1 -1
- package/dist/view3d/index.d.ts +1 -1
- package/dist/view3d/index.js +19 -19
- package/package.json +1 -1
- package/dist/chunk-APMDM2YC.js +0 -1
- package/dist/chunk-FQ2MMJMH.js +0 -1
package/dist/view3d/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { C as ChartDoc } from '../types-B97dNRwl.cjs';
|
|
2
2
|
import { E as EventConfigurationProductionElementKind, a as EventConfigurationOcclusion, b as EventConfigurationVersion } from '../eventConfigurations-C-LVnEGg.cjs';
|
|
3
|
-
import { E as ExpandedSeat } from '../renderer-
|
|
3
|
+
import { E as ExpandedSeat } from '../renderer-DbDQtwIH.cjs';
|
|
4
4
|
import { SeatView } from './crossfade/panorama.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/view3d/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { C as ChartDoc } from '../types-B97dNRwl.js';
|
|
2
2
|
import { E as EventConfigurationProductionElementKind, a as EventConfigurationOcclusion, b as EventConfigurationVersion } from '../eventConfigurations-CSuSanij.js';
|
|
3
|
-
import { E as ExpandedSeat } from '../renderer-
|
|
3
|
+
import { E as ExpandedSeat } from '../renderer-xE1rZCGy.js';
|
|
4
4
|
import { SeatView } from './crossfade/panorama.js';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/view3d/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{a as me,b as Zt,c as Jt,d as Xe,e as Me,f as gt,g as yt,h as eo,i as to,j as _e,k as oo,l as xt,m as no,n as ro,o as io,p as ao,q as fe,r as so,s as lo,t as co,u as uo,v as St,w as mo,x as Ve}from"../chunk-4ABXX5PL.js";import"../chunk-PRED5KHO.js";import"../chunk-QJXSZT3H.js";import"../chunk-BS37TGPX.js";import"../chunk-4I2VWFJY.js";import"../chunk-UL5OIGIF.js";import{Wa as Kt}from"../chunk-24O23MNB.js";import{d as Qt,l as $t}from"../chunk-JBOTRSMY.js";import"../chunk-CRCGO52K.js";import{Renderer as Hn}from"ogl";function Un(){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 Hn({canvas:this.canvas,dpr:Un(),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 Wn,Vec3 as wt}from"ogl";var ie=Math.PI/180,Mt=15*ie,Pt=80*ie,Pe=.12,po=35,ho=1.25,fo=.006,Yn=4,Ce=.82,Le=1/Ce,Xn=.12,qn=2;function jn(t,e){return{azimuth:t*fo,polar:-e*fo}}function Kn(t,e,o){let r=Math.max(qn,Math.max(1,e)*Xn),n=o*Yn;return{minDist:t?Math.min(t.minDist,r):r,maxDist:t?Math.max(t.maxDist,n):n}}var je=class{constructor(e,o,r,n){this.fovY=po;this.target=new wt;this.azimuth=-30*ie;this.polar=55*ie;this.distance=10;this.azT=-30*ie;this.polT=55*ie;this.distT=10;this.minDist=1;this.maxDist=100;this.envelope=null;this.gestureFired=!1;this.interactionEnabled=!0;this.dragging=!1;this.panning=!1;this.lastX=0;this.lastY=0;this.activePointers=new Map;this.pinchDist=0;this.pinchCx=0;this.pinchCy=0;this.targetT=new wt;this.panAnchor=new wt;this.panLimit=0;this.primaryDragMode="orbit";this.camera=new Wn(e,{fov:po,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 d=this.currentPinchDistance();this.pinchDist>0&&(this.dollyBy(Math.exp((this.pinchDist-d)*.005)),this.fireGesture()),this.pinchDist=d;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=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}if(!this.dragging)return;this.lastX=i.clientX,this.lastY=i.clientY,(s!==0||a!==0)&&this.fireGesture();let l=jn(s,a);this.azT+=l.azimuth,this.polT=Math.max(Mt,Math.min(Pt,this.polT+l.polar)),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*ie;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(Mt,Math.min(Pt,this.polT+(i.key==="ArrowUp"?-s:s)));else if(i.key==="+"||i.key==="=")this.dollyBy(Ce);else if(i.key==="-"||i.key==="_")this.dollyBy(Le);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*ie/2)/r,i=Math.sin(this.azimuth),s=Math.cos(this.azimuth),a=s,l=-i,d=Math.cos(this.polar),p=Math.sin(this.polar),h=-i*d,b=-s*d;this.targetT.x+=(-e*a+o*h)*n,this.targetT.z+=(-e*l+o*b)*n,this.targetT.y+=o*p*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())}dollyLimitState(){return{atMin:this.distT<=this.minDist+1e-6,atMax:this.distT>=this.maxDist-1e-6}}setPrimaryDragMode(e){this.primaryDragMode=e}setInteractionEnabled(e){this.interactionEnabled=e,!e&&(this.activePointers.clear(),this.dragging=!1,this.panning=!1,this.pinchDist=0)}frame(e,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*ie/2,l=n?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,d=Math.atan(Math.tan(a)*l);this.azT=r??-30*ie,this.polT=Math.max(15,Math.min(80,i?.polarDeg??55))*ie;let p=this.fitDistance(e,a,d,this.azT,this.polT);this.distT=p*Math.max(1.05,Math.min(2,i?.margin??ho)),this.envelope=Kn(this.envelope,s,p),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,o?(this.azimuth=this.azT,this.polar=12*ie,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*ie/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))*ie;let l=this.fitDistance(e,i,a,this.azT,this.polT);this.distT=l*Math.max(1.05,Math.min(2,n?.margin??ho))}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 d=Math.sin(i),p=-d*Math.sin(n),h=-Math.cos(i),b=-d*Math.cos(n);if(Math.abs(h)>.999)return a;let c=-b,u=p,P=Math.hypot(c,u);c/=P,u/=P;let D=-u*h,A=u*p-c*b,k=c*h,f=Math.tan(r),M=Math.tan(o),C=1;for(let O=0;O<8;O++){let x=(O&1?l.max[0]:l.min[0])-e.center[0],w=(O&2?l.max[1]:l.min[1])-e.center[1],T=(O&4?l.max[2]:l.min[2])-e.center[2],L=x*p+w*h+T*b,R=Math.abs(x*c+T*u),K=Math.abs(x*D+w*A+T*k);C=Math.max(C,R/f-L,K/M-L)}return Math.min(a,Math.max(C,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*Pe,this.polar+=o*Pe,this.distance+=r*Pe,this.target.x+=n*Pe,this.target.y+=i*Pe,this.target.z+=s*Pe,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(Mt,Math.min(Pt,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 Ae=2.5,Qn=1.15,ke=6,Ee=10,vo=6,bo=9.5,go=.9,yo=2.2,Ct=30,At=4,Qe=8192;var Ai=Ee+At;function xo(t,e){let o=e*1.4,r=e*3.2;if(t<=o)return{scale:1,fade:0,minPixels:Ae};let n=Math.min(1,(t-o)/Math.max(.001,r-o));return{scale:1-n*.4,fade:n*.55,minPixels:Ae+n*(Qn-Ae)}}function So(t,e,o){return!(t>0)||!(e>0)||!(o>0)?!1:e*o/t>=64}function wo(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 $n=88,Zn=20,Et={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:11.5,weight:"700",opacity:.94},seat:{size:12.5,weight:"800",opacity:1}},Mo="rgba(10,14,22,.62)",Jn="#f4f7fb",Po=5,Co=2,er=6,$e=new Set(["row","seat"]),Ao={floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},Ze={row:{x:66,y:20},seat:{x:52,y:22}},Dt=Qt,Rt=t=>$t(t);function Ft(t,e){let o=Rt(t),r=Rt(e);return(Math.max(o,r)+.05)/(Math.min(o,r)+.05)}function Tt(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 tr(t,e=[.04,.06,.1],o=!0){let r=Rt(e)<.42,n=r?"#f4f7fb":"#0b1220",i=r?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",s=o?Tt(i,e):e,a=Dt(t),l=o?7:4.5,d=a&&Ft(a,s)>=l?t:n;return r?{ink:d,backing:i,border:"rgba(210,222,245,.24)"}:{ink:d,backing:i,border:"rgba(11,18,32,.22)"}}function or(t,e=[.04,.06,.1]){let o=Tt(Mo,e),r=Dt(t);return{ink:r&&Ft(r,o)>=4.5?t:Jn,backing:Mo}}var nr='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Je=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||nr,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=io(n,i,{hasZoneLabels:this.labels.some(f=>f.kind==="zone")});this.forcedDense&&(a.add("row"),a.add("seat"));let l=[];for(let f of this.labels){if(!a.has(f.kind))continue;let M=fe(e,f.anchor,o,r);if(!M.visible)continue;let C=$e.has(f.kind),O=lo(f.text,Et[f.kind].size,!C)+(C?Po*2:0),x=ao(M,O/2,Et[f.kind].size/2+(C?Co:4),o,r),w=s?Math.hypot(f.anchor[0]-s[0],f.anchor[1]-s[1],f.anchor[2]-s[2]):1;l.push({label:f,screen:x,focus:uo(x,w,o,r),halfWidth:O/2,...this.selectedSeatLabelIds.has(f.id)?{priority:1}:{}})}let d=ro(l.filter(f=>f.label.kind==="floor"),o),p=[...l.filter(f=>!$e.has(f.label.kind)&&f.label.kind!=="floor"),...d],h=so(p,$n,Zn),b=co(o),c=St(l.filter(f=>f.label.kind==="row"),Ze.row.x,Ze.row.y,b.row,h),u=St(l.filter(f=>f.label.kind==="seat"),Ze.seat.x,Ze.seat.y,b.seat,[...h,...c]),P=[...h,...c,...u],D=new Set(P.map(f=>f.label.id));for(let{label:f,screen:M}of P){let O=this.nodeFor(f).style;O.display="",O.transform=`translate(-50%, -50%) translate(${M.x.toFixed(1)}px, ${M.y.toFixed(1)}px)`}let A=P.filter(({label:f})=>!$e.has(f.kind)).sort((f,M)=>Ao[M.label.kind]-Ao[f.label.kind]||f.screen.depth-M.screen.depth||f.focus-M.focus),k=[];for(let{label:f}of A){let M=this.nodes.get(f.id);if(!M||M.style.display==="none")continue;let C=M.getBoundingClientRect();k.some(x=>C.left<x.right+3&&C.right+3>x.left&&C.top<x.bottom+3&&C.bottom+3>x.top)?M.style.display="none":k.push(C)}for(let[f,M]of this.nodes)D.has(f)||(M.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=Et[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=!s,l=tr(e.color??this.opts.ink,this.opts.backgroundRgb,!0),d=s?or(e.color??this.opts.ink,this.opts.backgroundRgb):l;i.color=r?"#ecf8ff":d.ink,i.background=r?"rgba(10,28,45,.9)":d.backing,i.border=r?"1px solid rgba(89,199,255,.92)":a?`1px solid ${l.border}`:"",i.borderRadius=r||a?"999px":`${er}px`,i.padding=r||a?"3px 7px":`${Co}px ${Po}px`,i.lineHeight=s?"1.1":"",i.boxShadow=r?"0 0 0 2px rgba(41,176,255,.18), 0 5px 14px rgba(0,0,0,.35)":a?"0 3px 10px rgba(0,0,0,.24)":"0 1px 4px rgba(0,0,0,.28)",i.letterSpacing=e.kind==="zone"||e.kind==="floor"?"0.08em":"0.02em";let p=this.opts.backgroundRgb??[.04,.06,.1],h=Dt(r?"#ecf8ff":d.ink)??[1,1,1],b=Tt(r?"rgba(10,28,45,.9)":d.backing,p);return o.dataset.qualityContrast=Ft(h,b).toFixed(3),(e.kind==="zone"||e.kind==="floor")&&(i.textTransform="uppercase"),o}dispose(){this.root.remove(),this.nodes.clear()}};var rr=1;var ir=new Set(["floor","zone","section","ga","booth","annotation"]);function ar(t){return t.every(e=>Number.isFinite(e))}function sr(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 Eo(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function xe(t){return Math.round(t*1e4)/1e4}function lr(t){if(t)return{box:{x:xe(t.box.x),y:xe(t.box.y),width:xe(t.box.width),height:xe(t.box.height)},horizontalFillRatio:xe(t.horizontalFillRatio),verticalFillRatio:xe(t.verticalFillRatio),visibleAreaRatio:xe(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 It(t){let e=t.labels.filter(a=>a.visible&&a.screenBox),o=e.filter(a=>ir.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)sr(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",ar(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:d})=>({id:a,kind:l,text:d})).sort((a,l)=>a.kind.localeCompare(l.kind)||a.id.localeCompare(l.id)),framing:lr(t.framing)},metrics:{minimumHierarchyFontPx:Eo(o.map(a=>a.renderedFontPx)),minimumHierarchyContrast:Eo(o.map(a=>a.contrast)),projectedReliefPx:Math.round(t.scene.projectedReliefPx*100)/100},findings:s}}import{Geometry as Oe,Mesh as ze,Program as Ar,Texture as Er,Transform as No}from"ogl";import{Program as Se}from"ogl";var et=`
|
|
1
|
+
import{a as me,b as $t,c as Zt,d as qe,e as Me,f as gt,g as yt,h as Jt,i as eo,j as _e,k as to,l as xt,m as oo,n as no,o as ro,p as io,q as fe,r as ao,s as so,t as lo,u as co,v as St,w as uo,x as Ve}from"../chunk-4ABXX5PL.js";import"../chunk-PRED5KHO.js";import"../chunk-QJXSZT3H.js";import"../chunk-BS37TGPX.js";import"../chunk-4I2VWFJY.js";import"../chunk-UL5OIGIF.js";import{Wa as jt}from"../chunk-24O23MNB.js";import{d as Kt,l as Qt}from"../chunk-JBOTRSMY.js";import"../chunk-CRCGO52K.js";import{Renderer as Hn}from"ogl";function Un(){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 je=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 Hn({canvas:this.canvas,dpr:Un(),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 Wn,Vec3 as wt}from"ogl";var ie=Math.PI/180,Mt=15*ie,Pt=80*ie,Pe=.12,mo=35,po=1.25,ho=.006,Yn=4,Ce=.82,Le=1/Ce,Xn=.12,qn=2;function jn(t,e){return{azimuth:t*ho,polar:-e*ho}}function Kn(t,e,o){let r=Math.max(qn,Math.max(1,e)*Xn),n=o*Yn;return{minDist:t?Math.min(t.minDist,r):r,maxDist:t?Math.max(t.maxDist,n):n}}var Ke=class{constructor(e,o,r,n){this.fovY=mo;this.target=new wt;this.azimuth=-30*ie;this.polar=55*ie;this.distance=10;this.azT=-30*ie;this.polT=55*ie;this.distT=10;this.minDist=1;this.maxDist=100;this.envelope=null;this.gestureFired=!1;this.interactionEnabled=!0;this.dragging=!1;this.panning=!1;this.lastX=0;this.lastY=0;this.activePointers=new Map;this.pinchDist=0;this.pinchCx=0;this.pinchCy=0;this.targetT=new wt;this.panAnchor=new wt;this.panLimit=0;this.primaryDragMode="orbit";this.camera=new Wn(e,{fov:mo,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 d=this.currentPinchDistance();this.pinchDist>0&&(this.dollyBy(Math.exp((this.pinchDist-d)*.005)),this.fireGesture()),this.pinchDist=d;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=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}if(!this.dragging)return;this.lastX=i.clientX,this.lastY=i.clientY,(s!==0||a!==0)&&this.fireGesture();let l=jn(s,a);this.azT+=l.azimuth,this.polT=Math.max(Mt,Math.min(Pt,this.polT+l.polar)),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*ie;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(Mt,Math.min(Pt,this.polT+(i.key==="ArrowUp"?-s:s)));else if(i.key==="+"||i.key==="=")this.dollyBy(Ce);else if(i.key==="-"||i.key==="_")this.dollyBy(Le);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*ie/2)/r,i=Math.sin(this.azimuth),s=Math.cos(this.azimuth),a=s,l=-i,d=Math.cos(this.polar),p=Math.sin(this.polar),h=-i*d,b=-s*d;this.targetT.x+=(-e*a+o*h)*n,this.targetT.z+=(-e*l+o*b)*n,this.targetT.y+=o*p*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())}dollyLimitState(){return{atMin:this.distT<=this.minDist+1e-6,atMax:this.distT>=this.maxDist-1e-6}}setPrimaryDragMode(e){this.primaryDragMode=e}setInteractionEnabled(e){this.interactionEnabled=e,!e&&(this.activePointers.clear(),this.dragging=!1,this.panning=!1,this.pinchDist=0)}frame(e,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*ie/2,l=n?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,d=Math.atan(Math.tan(a)*l);this.azT=r??-30*ie,this.polT=Math.max(15,Math.min(80,i?.polarDeg??55))*ie;let p=this.fitDistance(e,a,d,this.azT,this.polT);this.distT=p*Math.max(1.05,Math.min(2,i?.margin??po)),this.envelope=Kn(this.envelope,s,p),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,o?(this.azimuth=this.azT,this.polar=12*ie,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*ie/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))*ie;let l=this.fitDistance(e,i,a,this.azT,this.polT);this.distT=l*Math.max(1.05,Math.min(2,n?.margin??po))}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 d=Math.sin(i),p=-d*Math.sin(n),h=-Math.cos(i),b=-d*Math.cos(n);if(Math.abs(h)>.999)return a;let c=-b,u=p,P=Math.hypot(c,u);c/=P,u/=P;let F=-u*h,A=u*p-c*b,k=c*h,f=Math.tan(r),M=Math.tan(o),C=1;for(let O=0;O<8;O++){let x=(O&1?l.max[0]:l.min[0])-e.center[0],w=(O&2?l.max[1]:l.min[1])-e.center[1],D=(O&4?l.max[2]:l.min[2])-e.center[2],L=x*p+w*h+D*b,R=Math.abs(x*c+D*u),K=Math.abs(x*F+w*A+D*k);C=Math.max(C,R/f-L,K/M-L)}return Math.min(a,Math.max(C,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*Pe,this.polar+=o*Pe,this.distance+=r*Pe,this.target.x+=n*Pe,this.target.y+=i*Pe,this.target.z+=s*Pe,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(Mt,Math.min(Pt,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 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 Ae=2.5,Qn=1.15,ke=6,Ee=10,fo=6,vo=9.5,bo=.9,go=2.2,Ct=30,At=4,$e=8192;var Ti=Ee+At;function yo(t,e){let o=e*1.4,r=e*3.2;if(t<=o)return{scale:1,fade:0,minPixels:Ae};let n=Math.min(1,(t-o)/Math.max(.001,r-o));return{scale:1-n*.4,fade:n*.55,minPixels:Ae+n*(Qn-Ae)}}function xo(t,e,o){return!(t>0)||!(e>0)||!(o>0)?!1:e*o/t>=64}function So(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 $n=88,Zn=20,wo={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:11.5,weight:"700",opacity:.94},seat:{size:12.5,weight:"800",opacity:1}},Jn=640,er=.8,tr=11,or="3px 7px",nr="2px 5px",Mo="rgba(10,14,22,.62)",rr="#f4f7fb",Po=5,Co=2,ir=6,Oe=new Set(["row","seat"]),Ao={floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},Ze={row:{x:66,y:20},seat:{x:52,y:22}},Rt=Kt,Et=t=>Qt(t);function Dt(t,e){let o=Et(t),r=Et(e);return(Math.max(o,r)+.05)/(Math.min(o,r)+.05)}function Ft(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 ar(t,e=[.04,.06,.1],o=!0){let r=Et(e)<.42,n=r?"#f4f7fb":"#0b1220",i=r?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",s=o?Ft(i,e):e,a=Rt(t),l=o?7:4.5,d=a&&Dt(a,s)>=l?t:n;return r?{ink:d,backing:i,border:"rgba(210,222,245,.24)"}:{ink:d,backing:i,border:"rgba(11,18,32,.22)"}}function sr(t,e=[.04,.06,.1]){let o=Ft(Mo,e),r=Rt(t);return{ink:r&&Dt(r,o)>=4.5?t:rr,backing:Mo}}var lr='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Je=class{constructor(e,o={}){this.nodes=new Map;this.labels=[];this.forcedDense=!1;this.selectedSeatLabelIds=new Set;this.narrowStage=!1;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||lr,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}`))}sizeFor(e){let o=wo[e].size;return!this.narrowStage||Oe.has(e)?o:Math.max(tr,o*er)}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;this.narrowStage=o>0&&o<Jn;let a=ro(n,i,{hasZoneLabels:this.labels.some(f=>f.kind==="zone")});this.forcedDense&&(a.add("row"),a.add("seat"));let l=[];for(let f of this.labels){if(!a.has(f.kind))continue;let M=fe(e,f.anchor,o,r);if(!M.visible)continue;let C=Oe.has(f.kind),O=this.sizeFor(f.kind),x=so(f.text,O,!C)+(C?Po*2:0),w=io(M,x/2,O/2+(C?Co:4),o,r),D=s?Math.hypot(f.anchor[0]-s[0],f.anchor[1]-s[1],f.anchor[2]-s[2]):1;l.push({label:f,screen:w,focus:co(w,D,o,r),halfWidth:x/2,...this.selectedSeatLabelIds.has(f.id)?{priority:1}:{}})}let d=no(l.filter(f=>f.label.kind==="floor"),o),p=[...l.filter(f=>!Oe.has(f.label.kind)&&f.label.kind!=="floor"),...d],h=ao(p,$n,Zn),b=lo(o),c=St(l.filter(f=>f.label.kind==="row"),Ze.row.x,Ze.row.y,b.row,h),u=St(l.filter(f=>f.label.kind==="seat"),Ze.seat.x,Ze.seat.y,b.seat,[...h,...c]),P=[...h,...c,...u],F=new Set(P.map(f=>f.label.id));for(let{label:f,screen:M}of P){let O=this.nodeFor(f).style;O.display="",O.transform=`translate(-50%, -50%) translate(${M.x.toFixed(1)}px, ${M.y.toFixed(1)}px)`}let A=P.filter(({label:f})=>!Oe.has(f.kind)).sort((f,M)=>Ao[M.label.kind]-Ao[f.label.kind]||f.screen.depth-M.screen.depth||f.focus-M.focus),k=[];for(let{label:f}of A){let M=this.nodes.get(f.id);if(!M||M.style.display==="none")continue;let C=M.getBoundingClientRect();k.some(x=>C.left<x.right+3&&C.right+3>x.left&&C.top<x.bottom+3&&C.bottom+3>x.top)?M.style.display="none":k.push(C)}for(let[f,M]of this.nodes)F.has(f)||(M.style.display="none")}nodeFor(e){let o=this.nodes.get(e.id);if(!o){o=document.createElement("div");let u=o.style;u.position="absolute",u.left="0",u.top="0",u.whiteSpace="nowrap",u.textShadow="0 1px 3px rgba(0,0,0,0.85), 0 0 8px rgba(0,0,0,0.55)",u.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=wo[e.kind],i=o.style;i.fontSize=`${this.sizeFor(e.kind)}px`,i.fontWeight=r?"800":n.weight,i.opacity=r?"1":String(n.opacity);let s=Oe.has(e.kind),a=!s,l=ar(e.color??this.opts.ink,this.opts.backgroundRgb,!0),d=s?sr(e.color??this.opts.ink,this.opts.backgroundRgb):l;i.color=r?"#ecf8ff":d.ink,i.background=r?"rgba(10,28,45,.9)":d.backing,i.border=r?"1px solid rgba(89,199,255,.92)":a?`1px solid ${l.border}`:"",i.borderRadius=r||a?"999px":`${ir}px`;let p=this.narrowStage?nr:or;i.padding=r||a?p:`${Co}px ${Po}px`,i.lineHeight=s?"1.1":"",i.boxShadow=r?"0 0 0 2px rgba(41,176,255,.18), 0 5px 14px rgba(0,0,0,.35)":a?"0 3px 10px rgba(0,0,0,.24)":"0 1px 4px rgba(0,0,0,.28)",i.letterSpacing=e.kind==="zone"||e.kind==="floor"?"0.08em":"0.02em";let h=this.opts.backgroundRgb??[.04,.06,.1],b=Rt(r?"#ecf8ff":d.ink)??[1,1,1],c=Ft(r?"rgba(10,28,45,.9)":d.backing,h);return o.dataset.qualityContrast=Dt(b,c).toFixed(3),(e.kind==="zone"||e.kind==="floor")&&(i.textTransform="uppercase"),o}dispose(){this.root.remove(),this.nodes.clear()}};var cr=1;var ur=new Set(["floor","zone","section","ga","booth","annotation"]);function dr(t){return t.every(e=>Number.isFinite(e))}function mr(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 Eo(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function xe(t){return Math.round(t*1e4)/1e4}function pr(t){if(t)return{box:{x:xe(t.box.x),y:xe(t.box.y),width:xe(t.box.width),height:xe(t.box.height)},horizontalFillRatio:xe(t.horizontalFillRatio),verticalFillRatio:xe(t.verticalFillRatio),visibleAreaRatio:xe(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 Tt(t){let e=t.labels.filter(a=>a.visible&&a.screenBox),o=e.filter(a=>ur.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)mr(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",dr(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:d})=>({id:a,kind:l,text:d})).sort((a,l)=>a.kind.localeCompare(l.kind)||a.id.localeCompare(l.id)),framing:pr(t.framing)},metrics:{minimumHierarchyFontPx:Eo(o.map(a=>a.renderedFontPx)),minimumHierarchyContrast:Eo(o.map(a=>a.contrast)),projectedReliefPx:Math.round(t.scene.projectedReliefPx*100)/100},findings:s}}import{Geometry as ze,Mesh as Ne,Program as Tr,Texture as Ir,Transform as No}from"ogl";import{Program as Se}from"ogl";var et=`
|
|
2
2
|
float chairWeight(float depth) {
|
|
3
3
|
return 1.0 - smoothstep(uChairFull, uChairNone, depth);
|
|
4
4
|
}`,Ro=`
|
|
5
5
|
float occupantWeight(float depth) {
|
|
6
|
-
float nearWeight = smoothstep(${
|
|
7
|
-
float farWeight = 1.0 - smoothstep(${
|
|
6
|
+
float nearWeight = smoothstep(${bo.toFixed(1)}, ${go.toFixed(1)}, depth);
|
|
7
|
+
float farWeight = 1.0 - smoothstep(${fo.toFixed(1)}, ${vo.toFixed(1)}, depth);
|
|
8
8
|
return nearWeight * farWeight;
|
|
9
9
|
}`,Do=`
|
|
10
10
|
float glyphEq(float glyph, float expected) {
|
|
@@ -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
|
-
}`,
|
|
58
|
+
}`,hr=`#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
|
-
}`,
|
|
96
|
+
}`,fr=`#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
|
-
}`,
|
|
169
|
+
}`,vr=`#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
|
-
}`,
|
|
228
|
+
}`,br=`#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
|
-
}`,
|
|
287
|
+
}`,gr=`#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;
|
|
@@ -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
|
-
}`,
|
|
406
|
+
}`,yr=`#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
|
-
}`,
|
|
463
|
+
}`,xr=`#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
|
-
}`,
|
|
470
|
+
}`,Sr=`#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
|
-
}`,
|
|
481
|
+
}`,wr=`#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
|
-
}`,
|
|
518
|
+
}`,Mr=`#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
|
-
}`,
|
|
532
|
+
}`,Pr=`#version 300 es
|
|
533
533
|
precision highp float;
|
|
534
534
|
in vec3 position;
|
|
535
535
|
in float part;
|
|
@@ -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
|
-
}`,
|
|
588
|
+
}`,Cr=`#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
|
-
}`,
|
|
596
|
+
}`,Ar=`#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
|
-
}`,
|
|
607
|
+
}`,Er=`#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 Fo(t){return new Se(t,{vertex:
|
|
614
|
+
}`;function Fo(t){return new Se(t,{vertex:wr,fragment:Mr,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeatRadius:{value:_e},uSeatScale:{value:1},uMinPixels:{value:Ae},uPixelToWorld:{value:.002},uChairFull:{value:ke},uChairNone:{value:Ee},uFocusFloor:{value:-1}}})}function To(t){return new Se(t,{vertex:Pr,fragment:Cr,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uChairFull:{value:ke},uChairNone:{value:Ee},uBackRake:{value:gt},uBackBase:{value:yt},uFocusFloor:{value:-1}}})}function Io(t){return new Se(t,{vertex:Ar,fragment:Er,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uFocusFloor:{value:-1}}})}function _o(t,e=.78){return new Se(t,{vertex:hr,fragment:fr,cullFace:!1,depthTest:!0,depthWrite:!0,uniforms:{uKeyDir:{value:new Float32Array([.38,.86,.34])},uFocusFloor:{value:-1},uStructureDetail:{value:0},uRoughness:{value:e}}})}function Vo(t){return new Se(t,{vertex:vr,fragment:br,transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1,uniforms:{uSeatRadius:{value:_e},uSeatScale:{value:1},uMinPixels:{value:Ae},uPixelToWorld:{value:.002},uSeatFade:{value:0},uSeatDetail:{value:0},uFocusFloor:{value:-1},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:ke},uChairNone:{value:Ee}}})}function Lo(t,e=.78){return new Se(t,{vertex:gr,fragment:yr,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:Ee},uBackRake:{value:gt},uBackBase:{value:yt},uFocusFloor:{value:-1},uRoughness:{value:e}}})}function ko(t,e,o){return new Se(t,{vertex:xr,fragment:Sr,depthTest:!1,depthWrite:!1,cullFace:!1,uniforms:{uTop:{value:new Float32Array(e)},uBottom:{value:new Float32Array(o)}}})}var Rr=.65,Dr=new Set(["dimmed","sold"]),Fr=new Set(["dimmed","sold","held"]);function Oo(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?Fr:Dr;for(let l of t){let d=e.get(l.sectionId);if(!d||!d.length){r.add(l.sectionId);continue}let p=!1;for(let h of d){let b=me[o[h]]??"available";if(!a.has(b)){p=!0;break}}p?r.add(l.sectionId):n=!0}return{lit:r,anyUnlit:n}}function zo(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 d=(a.start+a.count)*3;for(let p=a.start*3;p<d;p++)e[p]=l?o[p]:o[p]+(i[p%3]-o[p])*Rr;s.push(a)}return s}function Bo(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 _r=new Float32Array([-1,-1,1,-1,1,1,-1,-1,1,1,-1,1]),Vr=new Float32Array([-1,-1,3,-1,-1,3]);function Go(t,e){let o=new No,r=new No,n=new ze(t,{position:{size:2,data:Vr}}),i=ko(t,e.theme.background.top,e.theme.background.bottom),s=new Ne(t,{geometry:n,program:i});s.frustumCulled=!1,s.setParent(r);let a=new ze(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=_o(t,e.theme.materials.roughness),d=new Ne(t,{geometry:a,program:l});d.frustumCulled=!1,d.setParent(o);let p=Vo(t),h=new Float32Array(e.seats.count*3),b=me.map(I=>e.theme.seatStates[I]);Bo(h,e.seats.iState,0,e.seats.count,b,e.seats.iCategory);let c=new ze(t,{position:{size:2,data:_r},iOffset:{size:3,data:e.seats.iPosition,instanced:1},iColor:{size:3,data:h,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 Ne(t,{geometry:c,program:p});u.frustumCulled=!1,e.seats.count>0&&u.setParent(o);let P=c.attributes.iColor,F=e.solids.color.slice(),A=e.theme.structure.ground,k=new Map(e.sectionSolidRanges.map(I=>[I.sectionId,!0])),f=eo(),M=Lo(t,e.theme.materials.roughness),C=$e,O=new Float32Array(C*3),x=new Float32Array(C*3),w=new Float32Array(C),D=new Float32Array(C),L=new Float32Array(C),R=new Float32Array(C*3),K=new Float32Array(C),H=new Float32Array(C),V=new Float32Array(C),Y=new Float32Array(C),y=new ze(t,{position:{size:3,data:f.position},normal:{size:3,data:f.normal},part:{size:1,data:f.part},index:{data:f.index},iOffset:{size:3,data:O,instanced:1},iColor:{size:3,data:x,instanced:1},iRadius:{size:1,data:w,instanced:1},iYaw:{size:1,data:D,instanced:1},iGlyph:{size:1,data:L,instanced:1},iRing:{size:3,data:R,instanced:1},iFloor:{size:1,data:K,instanced:1},iPhysicalSeat:{size:1,data:H,instanced:1},iSeed:{size:1,data:Y,instanced:1},iPickIndex:{size:1,data:V,instanced:1}}),S=new Ne(t,{geometry:y,program:M});S.frustumCulled=!1;let X=0,g=!1,z=!1,$=null,U=null,ee=null,Z=new Int32Array(0),le=()=>{let I=e.seats;for(let N=0;N<X;N++){let B=Z[N];Y[N]=to(I.iState[B],B);let G=I.iCategory&&I.iState[B]===0?null:b[I.iState[B]]??b[0];if(G)x[N*3]=G[0],x[N*3+1]=G[1],x[N*3+2]=G[2];else{let Q=e.theme.materials.seat??Zt([I.iCategory[B*3],I.iCategory[B*3+1],I.iCategory[B*3+2]]);x[N*3]=Q[0],x[N*3+1]=Q[1],x[N*3+2]=Q[2]}}y.attributes.iColor.needsUpdate=!0,y.attributes.iSeed.needsUpdate=!0},oe={main:o,background:r,seatProgram:p,solidProgram:l,chairProgram:M,seatGeometry:c,chairGeometry:y,solidGeometry:a,drawCalls:3,setNearSeats(I,N){let B=Math.min(N,C);if(Z=I,X=B,B===0){S.parent&&S.setParent(null),y.instancedCount=0,oe.drawCalls=3+(g?1:0);return}let _=e.seats;for(let G=0;G<B;G++){let Q=I[G];O[G*3]=_.iPosition[Q*3],O[G*3+1]=_.iPosition[Q*3+1],O[G*3+2]=_.iPosition[Q*3+2],w[G]=_.iChairWidth[Q],D[G]=_.iYaw[Q],L[G]=_.iGlyph[Q],R[G*3]=_.iRing[Q*3],R[G*3+1]=_.iRing[Q*3+1],R[G*3+2]=_.iRing[Q*3+2],K[G]=_.iFloor[Q],H[G]=_.iPhysicalSeat[Q],V[G]=Q+1}le(),y.attributes.iOffset.needsUpdate=!0,y.attributes.iRadius.needsUpdate=!0,y.attributes.iYaw.needsUpdate=!0,y.attributes.iGlyph.needsUpdate=!0,y.attributes.iRing.needsUpdate=!0,y.attributes.iFloor.needsUpdate=!0,y.attributes.iPhysicalSeat.needsUpdate=!0,y.attributes.iSeed.needsUpdate=!0,y.attributes.iPickIndex.needsUpdate=!0,y.instancedCount=B,S.parent||S.setParent(o),oe.drawCalls=4+(g?1:0)},nearSeatCount(){return X},setSectionShellLit(I){let N=zo(e.sectionSolidRanges,e.solids.color,F,k,I,A);if(!N.length)return;let B=a.attributes.color,_=B.buffer;if(!_){B.needsUpdate=!0;return}t.bindBuffer(t.ARRAY_BUFFER,_);for(let G of N){let Q=e.solids.color.subarray(G.start*3,(G.start+G.count)*3);t.bufferSubData(t.ARRAY_BUFFER,G.start*3*Float32Array.BYTES_PER_ELEMENT,Q)}},uploadSeatStateRuns(I){if(!I.length)return;X&&le();for(let B of I)Bo(h,e.seats.iState,B.start,B.length,b,e.seats.iCategory);let N=P.buffer;if(!N){P.needsUpdate=!0;return}t.bindBuffer(t.ARRAY_BUFFER,N);for(let B of I){let _=h.subarray(B.start*3,(B.start+B.length)*3);t.bufferSubData(t.ARRAY_BUFFER,B.start*3*Float32Array.BYTES_PER_ELEMENT,_)}},dispose(){z=!0,n.remove(),i.remove(),a.remove(),l.remove(),c.remove(),p.remove(),y.remove(),M.remove(),$?.remove(),U?.remove(),ee?.texture&&t.deleteTexture(ee.texture)}},J=e.productionElements.find(I=>I.contentImageUrl&&I.contentPlane);if(J?.contentImageUrl&&J.contentPlane?.length===4&&typeof Image<"u"){let I=new Image;I.crossOrigin="anonymous",I.onload=()=>{if(z)return;let N=J.contentPlane;$=new ze(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(J.floorIndex)},index:{data:new Uint16Array([0,1,2,2,1,3])}}),ee=new Ir(t,{image:I,generateMipmaps:!0,wrapS:t.CLAMP_TO_EDGE,wrapT:t.CLAMP_TO_EDGE,flipY:!1}),U=new Tr(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:ee},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let B=new ze(t,{geometry:$,program:U});B.frustumCulled=!1,B.setParent(o),oe.screenProgram=U,g=!0,oe.drawCalls=3+(X?1:0)+1},I.src=J.contentImageUrl}return oe}import{Mesh as _t,RenderTarget as Tr,Transform as Vt}from"ogl";function Fr(t,e,o){let r=t+(e<<8)+(o<<16);return r===0?-1:r-1}function Ho(t,e,o,r,n,i){let s=-1,a=1/0;for(let l=0;l<o;l++)for(let d=0;d<e;d++){let p=(l*e+d)*4,h=Fr(t[p],t[p+1],t[p+2]);if(h<0||h>=i)continue;let b=d-r,c=l-n,u=b*b+c*c;u<a&&(a=u,s=h)}return s}function Uo(t,e,o,r,n,i){let s=t-o.left,a=e-o.top,l=Math.round(s*r),d=Math.round((o.height-a)*r);return{x:Math.max(0,Math.min(n-1,l)),y:Math.max(0,Math.min(i-1,d))}}var Ir=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],tt=class{constructor(e,o,r,n,i){this.seatScene=new Vt;this.chairScene=new Vt;this.solidScene=new Vt;this.target=null;this.restoreClear=[0,0,0];this.renderer=e,this.gl=e.gl,this.maxIndex=i,this.seatProg=Fo(this.gl),this.chairProg=To(this.gl),this.depthProg=Io(this.gl);let s=new _t(this.gl,{geometry:o,program:this.seatProg});s.frustumCulled=!1,s.setParent(this.seatScene);let a=new _t(this.gl,{geometry:r,program:this.chairProg});a.frustumCulled=!1,a.setParent(this.chairScene);let l=new _t(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 Ir)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 Tr(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,d=Math.max(0,o-n),p=Math.max(0,r-n),h=Math.max(1,Math.min(a,o+n+1)-d),b=Math.max(1,Math.min(l,r+n+1)-p);i.enable(i.SCISSOR_TEST),i.scissor(d,p,h,b);let[c,u,P]=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,u,P,1),i.disable(i.SCISSOR_TEST);let D=new Uint8Array(h*b*4);return this.renderer.bindFramebuffer(s),i.readPixels(d,p,h,b,i.RGBA,i.UNSIGNED_BYTE,D),this.renderer.bindFramebuffer(),Ho(D,h,b,o-d,r-p,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function Wo(t,e){let o=[];for(let r of e)t.has(r.seatId)?t.set(r.seatId,Zt(r.state)):o.push(r);return o}function Yo(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 Ne,Vec3 as Lr}from"ogl";function _r(t,e){return[t[0]-e[0],t[1]-e[1],t[2]-e[2]]}function Xo(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 qo(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 Lt(t){let e=Math.max(0,Math.min(1,t));return e*e*e*(e*(e*6-15)+10)}function kt(t,e){return Math.max(0,Math.min(1,t+e))}function jo(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],d=t[i+1],p=t[Math.min(o-1,i+2)],h=s*s,b=h*s,c=[0,0,0];for(let u=0;u<3;u++)c[u]=.5*(2*l[u]+(-a[u]+d[u])*s+(2*a[u]-5*l[u]+4*d[u]-p[u])*h+(-a[u]+3*l[u]-3*d[u]+p[u])*b);return c}function Ot(t,e,o,r,n){let i=qo(_r(e,o));i[0]===0&&i[1]===0&&i[2]===0&&(i=[0,0,1]);let s=Xo(Xo(e,Vr(i,2.5)),[0,1.5,0]),a=[e[0]-r[0],0,e[2]-r[2]],l=qo(a);l[0]===0&&l[2]===0&&(l=[i[0],0,i[2]]);let d=Math.max(1,n),p=[r[0]+l[0]*d*1.3,r[1]+d*.75,r[2]+l[2]*d*1.3];return{waypoints:[t,p,s],finalPos:s}}function zt(t,e,o=35,r=28){let n=Lt(e),i=jo(t,n),s=Lt(Math.max(0,Math.min(1,(e-.66)/.34)));return{pos:i,fov:o+(r-o)*s,eased:n}}function Zo(t,e,o){let r=t.position.clone(),n=new Ne().copy(t.quaternion);t.position.set(e[0],e[1],e[2]),t.lookAt(new Lr(o[0],o[1],o[2]));let i=new Ne().copy(t.quaternion);return t.position.copy(r),t.quaternion.copy(n),i}var ot=class{constructor(e){this.active=!1;this.waypoints=[];this.startQuat=new Ne;this.endQuat=new Ne;this.outQuat=new Ne;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}=zt(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,kt(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 Jo=eo,kr=.12,Or=.25,zr=1.5;function en(t,e,o=0,r,n){let i=[e.x*Me,o+zr,e.y*Me],s=n?[n[0],n[1],n[2]]:i,a=t[1],l=Number.isFinite(a)?a+Jo:Number.isFinite(r)?o+r:o+Jo,d=i[0]-t[0],p=i[2]-t[2],h=Math.hypot(d,p),b=h>.001?Math.min(kr,h*Or):0,c=h>.001?d/h:0,u=h>.001?p/h:0;return{eye:[t[0]+c*b,l,t[2]+u*b],focal:s}}var we=Math.PI/180,Nr=45,tn=80,nt=70,Br=1,Gr=.99;function Hr(t,e){if(!(t<Br))return tn;if(!(Number.isFinite(e)&&e>0))return nt;let o=2*Math.atan(e/(2*rt*Gr)/Math.max(.05,t))/we;return Math.max(nt,Math.min(tn,o))}var Ur=.25,rt=1,Wr=.25,Yr=12*we,Xr=.2,qr=1.5,on=.8,nn=6,ln=1.9,jr=2/3,Kr=.12,Qr=.9,$r=1.2,Zr=2,cn=.05,Jr=6;function un(t,e,o=0){if(!t.length)return{min:[e[0]-6,o,e[2]-6],max:[e[0]+6,Math.max(o+on,e[1]),e[2]+6]};let r=1/0,n=-1/0,i=1/0,s=-1/0,a=o;for(let u of t)r=Math.min(r,u.cx-u.halfX),n=Math.max(n,u.cx+u.halfX),i=Math.min(i,u.cz-u.halfZ),s=Math.max(s,u.cz+u.halfZ),a=Math.max(a,u.y);let l=n-r,d=s-i,p=Math.max(l,Math.min(d,nn))/2,h=Math.max(d,Math.min(l,nn))/2,b=(r+n)/2,c=(i+s)/2;return{min:[b-p,o,c-h],max:[b+p,Math.max(o+on,a),c+h]}}function ei(t){return{min:[t.min[0],t.min[1],t.min[2]],max:[t.max[0],t.max[1]+ln,t.max[2]]}}function Nt(t){let e=t.max[1];return[(t.min[0]+t.max[0])/2,Math.max(t.min[1]+qr,e+Xr,e+ln*jr),(t.min[2]+t.max[2])/2]}function dn(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 rn(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,d=Math.hypot(a,l);if(d<1e-6)return 1/0;a/=d,l/=d;let p=1/0,h=-1/0;for(let b=0;b<8;b++){let c=(b&1?o.max[0]:o.min[0])-t[0],u=(b&2?o.max[1]:o.min[1])-t[1],P=(b&4?o.max[2]:o.min[2])-t[2],D=Math.max(cn,c*r+u*n+P*i),A=(c*a+P*l)/D;A<p&&(p=A),A>h&&(h=A)}return h-p}function an(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,d=Math.hypot(a,l);if(d<1e-6)return 1/0;a/=d,l/=d;let p=-l*n,h=l*r-a*i,b=a*n,c=1/0,u=-1/0;for(let P=0;P<8;P++){let D=(P&1?o.max[0]:o.min[0])-t[0],A=(P&2?o.max[1]:o.min[1])-t[1],k=(P&4?o.max[2]:o.min[2])-t[2],f=Math.max(cn,D*r+A*n+k*i),M=(D*p+A*h+k*b)/f;M<c&&(c=M),M>u&&(u=M)}return u-c}function it(t,e){return Math.tan(t*we/2)*Math.max(.05,e)}function sn(t,e,o){let r=Hr(o,t),n=l=>Math.max(Nr,Math.min(r,l)),i=l=>2*Math.atan(l)/we,s=Number.isFinite(t)&&t>0?n(i(t/(2*Ur)/Math.max(.05,o))):r;if(!(Number.isFinite(e)&&e>0))return s;let a=Math.min(s,n(i(e/(2*Kr))));return t/(2*it(a,o))>rt?s:a}function mn(t,e,o){let r=Nt(e),n=[t[0],t[1],t[2]],i=0,s=0,a=c=>{if(!(c>0))return;let u=dn(n,r);n[0]+=u.x*c,n[2]+=u.z*c,s+=c},l=e.max[1]+Wr-n[1];l>0&&(n[1]+=l,i=l,a(l/Math.tan(Yr)));let d=ei(e),p=rn(n,r,e),h=sn(p,an(n,r,d),o),b=p/(2*it(h,o));for(let c=0;c<Jr&&b>rt;c++){let u=Math.max(1,Math.hypot(n[0]-r[0],n[2]-r[2])),P=Number.isFinite(b)?b/rt:2;a(Math.min(60,u*(Math.min(4,P)-1)+.5)),p=rn(n,r,e),h=sn(p,an(n,r,d),o),b=p/(2*it(h,o))}return{eye:n,focal:r,fov:h,raisedM:i,pulledBackM:s,stageFrameWidth:b}}function ti(t,e,o){let r=Math.tan(e*we/2),n=it(e,o);return Math.max(1,t/Math.max(.05,Math.min(r,n)))}function pn(t,e){let{aspect:o,venue:r}=e,n=t.focal,i=dn(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=Zr*(e.rowDepthM??Qr);a.push({name:"row",eye:[t.eye[0]+i.x*l,t.eye[1]+$r,t.eye[2]+i.z*l],focal:n,fov:t.fov});let d=(b,c,u,P)=>{let D=ti(u,t.fov,o)*1.08,A=D*Math.sin(P*we),k=D*Math.cos(P*we);return{name:b,eye:[c[0]+i.x*k,c[1]+A,c[2]+i.z*k],focal:c,fov:t.fov}};e.section&&e.section.radius>0&&a.push(d("section",e.section.center,e.section.radius,14)),a.push(d("venue",r.center,Math.max(1,r.radius),26));let p=[],h=-1/0;for(let b of a){let c=s(b.eye);p.length&&c<=h+.5||(p.push(b),h=c)}return p}import{Vec3 as oi}from"ogl";var Ge=Math.PI/180,hn=320,fn=70*Ge,ni=32*Ge,ri=24*Ge,vn=.0026,ii=.22,ai=.006,si=180,li=4,se=(t,e,o)=>Math.max(e,Math.min(o,t)),bn=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2;function gn(t){let{canvas:e,camera:o}=t,r=[],n=!1,i=0,s=0,a=0,l=0,d=0,p=0,h=!1,b=[0,0],c=0,u=!1,P=null,D=null,A=new Map,k=!1,f=0,M=0,C=0,O=0,x=()=>n&&r.length?r[se(Math.round(i),0,r.length-1)].name:null,w=()=>{let g=x();g!==P&&(P=g,t.onStopChange?.(g))},T=()=>{if(!n||!r.length)return;let g=r[se(Math.floor(i),0,r.length-1)],z=r[se(Math.ceil(i),0,r.length-1)],$=se(i-Math.floor(i),0,1),U=(ve,ct)=>ve+(ct-ve)*$,ee=[U(g.eye[0],z.eye[0]),U(g.eye[1],z.eye[1]),U(g.eye[2],z.eye[2])],Z=[U(g.focal[0],z.focal[0]),U(g.focal[1],z.focal[1]),U(g.focal[2],z.focal[2])],le=Z[0]-ee[0],oe=Z[1]-ee[1],J=Z[2]-ee[2],I=Math.hypot(le,oe,J)||1,N=Math.atan2(le,J),B=Math.asin(se(oe/I,-1,1)),_=N+s,G=se(B+a,-80*Ge,80*Ge),Q=Math.cos(G)*I;le=Math.sin(_)*Q,oe=Math.sin(G)*I,J=Math.cos(_)*Q,o.position.set(ee[0],ee[1],ee[2]),o.fov=U(g.fov,z.fov),o.updateProjectionMatrix(),o.lookAt(new oi(ee[0]+le,ee[1]+oe,ee[2]+J)),t.onApplied?.()},L=()=>{if(!n||!r.length)return;let g=se(Math.round(i),0,r.length-1);if(t.reducedMotion()){h=!1,i=g,T(),w(),t.requestRender();return}if(Math.abs(g-i)<.001){h=!1,w();return}l=i,d=g,p=performance.now(),h=!0,t.requestRender()},R=g=>{!n||r.length<2||(h=!1,i=se(i+g,0,r.length-1),T(),w(),t.requestRender())},K=(g,z)=>{n&&(h=!1,u=!1,s=se(s-g*vn,-fn,fn),a=se(a-z*vn,-ri,ni),T(),t.requestRender())},H=g=>{n&&(A.set(g.pointerId,{x:g.clientX,y:g.clientY}),A.size===1?(k=!0,O=0,f=g.clientX,M=g.clientY):A.size===2&&(k=!1,C=V()))},V=()=>{let g=[...A.values()];return g.length<2?0:Math.hypot(g[0].x-g[1].x,g[0].y-g[1].y)},Y=g=>{if(!n||!A.has(g.pointerId))return;if(A.set(g.pointerId,{x:g.clientX,y:g.clientY}),A.size>=2){let U=V();C>0&&R((C-U)*ai),C=U;return}if(!k)return;let z=g.clientX-f,$=g.clientY-M;f=g.clientX,M=g.clientY,O+=Math.abs(z)+Math.abs($),!(O<=li)&&K(z,$)},y=g=>{A.delete(g.pointerId)&&(A.size<2&&(C=0),A.size===0&&(k=!1,L()))},S=g=>{if(!n)return;g.preventDefault();let z=g.deltaMode===1?16:g.deltaMode===2?100:1,$=se(g.deltaY*z/100,-2,2);R($*ii),D&&clearTimeout(D),D=setTimeout(()=>{D=null,L()},si)},X=()=>{n&&(n=!1,h=!1,u=!1,r=[],A.clear(),k=!1,D&&(clearTimeout(D),D=null),P!==null&&(P=null,t.onStopChange?.(null)))};return e.addEventListener("pointerdown",H),e.addEventListener("pointermove",Y),e.addEventListener("pointerup",y),e.addEventListener("pointercancel",y),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,h=!1,u=!1,P=null,T(),w(),t.requestRender()},exit:X,recentre(){return n?Math.abs(s)<1e-4&&Math.abs(a)<1e-4?!0:t.reducedMotion()?(u=!1,s=0,a=0,T(),t.requestRender(),!0):(b=[s,a],c=performance.now(),u=!0,t.requestRender(),!0):!1},update(g){if(!n)return!1;let z=!1;if(u){let $=se((g-c)/hn,0,1),U=1-bn($);s=b[0]*U,a=b[1]*U,$>=1?(u=!1,s=0,a=0):z=!0}if(h){let $=se((g-p)/hn,0,1);i=l+(d-l)*bn($),$>=1?(h=!1,i=d,w()):z=!0}return T(),z},currentStop:x,dispose(){X(),e.removeEventListener("pointerdown",H),e.removeEventListener("pointermove",Y),e.removeEventListener("pointerup",y),e.removeEventListener("pointercancel",y),e.removeEventListener("wheel",S)}}}function yn(t){return t.flying?"cinematic":t.panoramaMounted?"panorama":t.seatViewActive?"seatView":"orbit"}var Bt=null;function xn(){return Bt??=import("../openPanorama-6FMXAJ6O.js").catch(t=>{throw Bt=null,t}),Bt}var Sn=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),at=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=Sn(),this.emit("3d_panorama_opened")}panoramaClosed(){let e=this.panoramaOpenedAt?Math.round(Sn()-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 wn(t){let e=t.style.position;return getComputedStyle(t).position!=="static"?()=>{}:(t.style.position="relative",()=>{t.style.position==="relative"&&(t.style.position=e)})}function Mn(t){let{container:e,model:o,opts:r,expandedSeatById:n,seatIdsByRow:i,isNarrow:s}=t,a=null,l=()=>{if(!a)return;let h=s();Object.assign(a.style,h?{left:"12px",right:"12px",bottom:"70px",transform:"none",justifyContent:"center"}:{left:"50%",right:"auto",bottom:"18px",transform:"translateX(-50%)",justifyContent:"initial"})},d=()=>{a?.remove(),a=null};return{show:(h,b,c=!1)=>{if(d(),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 P=r.chrome?.caption!==!1,D=r.chrome?.seatStepper!==!1;if(!P&&!D)return null;let A=n.get(h),k=A?.sectionId?o.sections.find(L=>L.id===A.sectionId):void 0,f=A?.label??h;u.setAttribute("aria-label",`Explore views near ${k?.label?`${k.label}, `:""}seat ${f}`);let M=document.createElement("span");M.textContent=r.seatViewCaption?.(h)??["Live 3D seat view",k?.label,f].filter(Boolean).join(" \xB7 "),Object.assign(M.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)"}),P&&u.appendChild(M);let C=document.createElement("div");Object.assign(C.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),u.appendChild(C);let O=A?.rowId?i.get(A.rowId):void 0,x=O?.indexOf(h)??-1,w=x>=0?[O?.[x-1],O?.[x+1]]:[void 0,void 0],T=(L,R,K,H=!1)=>{let V=document.createElement("button");V.type="button",V.textContent=L,V.setAttribute("aria-label",R),Object.assign(V.style,{minHeight:"44px",padding:H?"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"}),H||(V.style.minWidth="44px"),H&&(V.dataset.panoramaTrigger=""),V.addEventListener("click",K),C.appendChild(V)};if(D&&w[0]){let L=n.get(w[0])?.label??w[0];T("\u2039",`View previous seat ${L}`,()=>{t.flyToSeat(w[0])})}if(D&&r.getSeatView){let L=r.seatViewActionLabel?.(h)??"Open 360\xB0 panorama";T(c?`\u21BB Retry ${L}`:`\u25C9 ${L}`,`${c?"Retry":L} from seat ${f}`,()=>{if(t.isDisposed()||b!==t.flightGen()){d();return}d(),t.openPanorama(h,400,b)},!0)}if(D&&w[1]){let L=n.get(w[1])?.label??w[1];T("\u203A",`View next seat ${L}`,()=>{t.flyToSeat(w[1])})}return!C.childElementCount&&!P?null:(e.appendChild(u),a=u,l(),u)},remove:d,layout:l}}var ci={rotate:"Drag to rotate the venue",move:"Drag to move the venue",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Show whole venue"};function Pn(t){let{container:e,orbit:o,isNarrow:r}=t,n={...ci,...t.labels??{}},i=(f,M)=>{f.setAttribute("aria-label",M),f.title=M},s=document.createElement("div"),a=!1;s.className="sl-3d-navigation-controls",Object.assign(s.style,{position:"absolute",right:"14px",bottom:"14px",display:"flex",zIndex:"4",flexDirection:"column",alignItems:"flex-end",gap:"7px"});let l=document.createElement("div");l.setAttribute("role","group"),l.setAttribute("aria-label","3D drag mode"),Object.assign(l.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let d=document.createElement("div");d.setAttribute("role","group"),d.setAttribute("aria-label","3D view controls"),Object.assign(d.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let p=document.createElement("button");p.type="button",p.textContent="\u21BB",i(p,n.rotate);let h=document.createElement("button");h.type="button",h.textContent="\u2725",i(h,n.move);let b=document.createElement("button");b.type="button",b.textContent="\u2212",i(b,n.zoomOut);let c=document.createElement("button");c.type="button",c.textContent="+",i(c,n.zoomIn);for(let f of[p,h,b,c])f.className="sl-3d-icon-control",Object.assign(f.style,{width:"44px",minWidth:"44px",minHeight:"44px",padding:"9px",border:"1px solid rgba(150,165,205,0.35)",borderRadius:"999px",color:"#c9d4ea",background:"rgba(12,18,32,0.82)",font:"600 17px/1 inherit",backdropFilter:"blur(6px)",cursor:"pointer",whiteSpace:"nowrap"});l.append(p,h),d.append(c,b);let u=f=>{o.setPrimaryDragMode(f);let M=f==="orbit";p.setAttribute("aria-pressed",String(M)),h.setAttribute("aria-pressed",String(!M)),p.style.background=M?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",h.style.background=M?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",s.title=M?`${n.rotate} \xB7 ${n.move} with Shift`:`${n.move} \xB7 ${n.rotate} with Shift`};p.addEventListener("click",()=>u("orbit")),h.addEventListener("click",()=>u("pan"));let P=()=>{let{atMin:f,atMax:M}=o.dollyLimitState();c.disabled!==f&&(c.disabled=f),b.disabled!==M&&(b.disabled=M)};b.addEventListener("click",()=>{o.zoomBy(Le),P()}),c.addEventListener("click",()=>{o.zoomBy(Ce),P()}),s.append(l,d),u("orbit"),e.appendChild(s);let D=t.enabled!==!1,A=()=>{let f=r();s.style.display=a||!D?"none":"flex",s.style.right=f?"12px":"14px",s.style.bottom=f?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",l.style.display=f?"none":"flex",c.style.display=f?"none":"",b.style.display=f?"none":""};return A(),{element:s,utilityControls:d,setNavigationMode:u,syncZoomLimits:P,setSeatViewLocked:f=>{a=f,o.setInteractionEnabled(!f),A()},seatViewLocked:()=>a,layout:A}}var ui=12;function di(t,e){if(!t)return!1;let o=t.x-e[0],r=t.y-e[1],n=t.z-e[2];return Math.hypot(o,r,n)>ui}function Cn(t){let{glctx:e,orbit:o,model:r,seats:n,opts:i,cinematic:s,analytics:a,seatIdByIndex:l,sectionIdBySeatId:d,tapSlop:p,tapMs:h,cancelFlight:b,focusSectionCamera:c,setSelection:u,ensureSeatView:P}=t,D=0,A=0,k=0,f=-1,M=!1,C=!1,O=R=>{t.seatViewLocked()||f===-1&&(f=R.pointerId,D=R.clientX,A=R.clientY,k=performance.now(),M=!1,C=s.active,s.active&&(a.cinematicCancelled(),b(),i.onViewTargetChange?.(null)))},x=R=>{R.pointerId===f&&Math.hypot(R.clientX-D,R.clientY-A)>p&&(M=!0)},w=(R,K,H,V,Y)=>{let y=e.canvas.getBoundingClientRect(),S=e.canvas.clientWidth||y.width||1,X=e.canvas.clientHeight||y.height||1,g=R-y.left,z=K-y.top,$=V*V,U=-1,ee=$,Z=1/0;for(let le of n){if(H&&le.sectionId!==H)continue;let oe=r.seats.idToIndex.get(le.id);if(oe===void 0)continue;if(Y){let G=Math.round(r.seats.iState[oe]??0);if(G!==0&&G!==3)continue}let J=oe*3,I=fe(o.camera.projectionViewMatrix,[r.seats.iPosition[J],r.seats.iPosition[J+1]+.55,r.seats.iPosition[J+2]],S,X);if(!I.visible)continue;let N=I.x-g,B=I.y-z,_=N*N+B*B;(_<ee||Math.abs(_-ee)<1&&I.depth<Z)&&(U=oe,ee=_,Z=I.depth)}return U},T=(R,K)=>{let H=t.gpu(),V=t.pick();if(!H||!V)return-1;V.syncFromSeatProgram(H.seatProgram);let Y=e.canvas.getBoundingClientRect(),y=e.renderer.dpr,{x:S,y:X}=Uo(R,K,Y,y,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),g=Math.max(2,Math.round(8*y));return V.pick(o.camera,S,X,g)};return{onDown:O,onMove:x,onUp:R=>{if(R.pointerId!==f)return;let K=!M&&performance.now()-k<h;if(f=-1,C){C=!1;return}let H=t.gpu(),V=t.pick();if(!K||!H||!V)return;let Y=T(R.clientX,R.clientY);if(t.focusedSectionId()&&Y>=0){let X=l[Y],g=X?d.get(X):void 0;if(g&&g!==t.focusedSectionId()&&c(g))return}if(t.focusedSectionId()&&Y<0&&(Y=w(R.clientX,R.clientY,t.focusedSectionId(),44,!1)),t.focusedSectionId()&&Y<0){let X=w(R.clientX,R.clientY,null,72,!1),g=X>=0?l[X]:void 0,z=g?d.get(g):void 0;if(z&&z!==t.focusedSectionId()&&c(z))return}if(!t.focusedSectionId()){Y<0&&(Y=w(R.clientX,R.clientY,null,42,!1));let X=Y>=0?l[Y]:void 0,g=X?d.get(X):void 0;if(g&&c(g))return}if(Y<0||Y>=l.length){t.selection().size&&(u([]),i.onViewTargetChange?.(null));return}let y=l[Y],S=me[Math.round(r.seats.iState[Y]??0)]??"available";if(S!=="available"&&S!=="selected"){i.onSeatInspect?.(y,S);return}if(t.selection().has(y)&&t.selection().size===1){u([]),i.onViewTargetChange?.(null),i.onSeatPick?.(y);return}if(u([y]),P(y),a.seatPicked(y,d.get(y)),i.onSeatPick?.(y),t.focusedSectionId()){let X=Y*3,g=[r.seats.iPosition[X],r.seats.iPosition[X+1],r.seats.iPosition[X+2]];di(o.camera?.position,g)&&t.focusSeatCamera(y)}}}}var st=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 u=e[c*3],P=e[c*3+2];u<o&&(o=u),u>n&&(n=u),P<r&&(r=P),P>i&&(i=P)}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,d=new Int32Array(l+1),p=c=>{let u=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+u};for(let c=0;c<this.count;c++)d[p(c)+1]++;for(let c=0;c<l;c++)d[c+1]+=d[c];let h=new Int32Array(this.count),b=d.slice(0,l);for(let c=0;c<this.count;c++)h[b[p(c)]++]=c;this.cellStart=d,this.cellItems=h}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,d=Math.floor((e-this.minX)/this.cell),p=Math.floor((o-this.minZ)/this.cell),h=Math.ceil(r/this.cell)+1,b=this.iPosition,c=0;for(let u=0;u<=h&&c<a;u++){let P=p-u,D=p+u,A=d-u,k=d+u;for(let f=P;f<=D&&c<a;f++){if(f<0||f>=this.rows)continue;let M=f===P||f===D;for(let C=A;C<=k&&c<a;C++){if(!M&&C!==A&&C!==k){C=k-1;continue}if(C<0||C>=this.cols)continue;let O=f*this.cols+C;for(let x=i[O],w=i[O+1];x<w&&c<a;x++){let T=s[x],L=b[T*3]-e,R=b[T*3+2]-o;L*L+R*R<=l&&(n[c++]=T)}}}}return c}};var lt=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 st(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)<At)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>Ct){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let a=this.nearIndex.gather(n.x,n.z,Ct,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 mi,Vec3 as pi}from"ogl";function An(){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 Dn(t){let{container:e,model:o,opts:r,orbit:n,cinematic:i,analytics:s,loop:a,labelOverlay:l,stageAzimuth:d,overviewFraming:p}=t,h=0,b=-1,c=(x,w,T=28)=>{n.camera.position.set(x[0],x[1],x[2]),n.camera.lookAt(new pi(w[0],w[1],w[2])),n.camera.fov=T,n.camera.updateProjectionMatrix()},u=document.createElement("button");u.className="sl-3d-overview-control sl-3d-icon-control",u.type="button",u.replaceChildren(An());let P=r.navLabels?.fitView??"Show whole venue";u.setAttribute("aria-label",P),u.title=P,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 D=()=>{u.firstElementChild||u.replaceChildren(An())};D();let A=x=>{b=x;let w=t.gpu();w&&(w.seatProgram.uniforms.uFocusFloor.value=x,w.solidProgram.uniforms.uFocusFloor.value=x,w.chairProgram.uniforms.uFocusFloor.value=x),t.showSectionSeatLabels(null)},k=()=>{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 x=b>=0?o.floors[b]:null;if(t.setNearFieldDetailEnabled(!!x),t.setSeatViewLocked(!1),f(),t.removeArriveChip(),t.setNavigationMode("orbit"),x){let w=x.focalWorld[0]-x.center[0],T=x.focalWorld[2]-x.center[2],L=Math.hypot(w,T)>x.radius*.12?Math.atan2(w,T):d,R={center:x.center,radius:x.radius,box:x.box},K={polarDeg:58,margin:1.12};t.reducedMotion()?n.frame(R,!1,L,!1,K):n.frameSoft(R,L,!1,K)}else t.reducedMotion()?n.frame(o.bounds,!1,d,r.portraitOverviewCrop===!0,p):n.frameSoft(o.bounds,d,r.portraitOverviewCrop===!0,p);t.showSectionSeatLabels(null),a.requestRender()},f=()=>{h++,t.setSeatStepping(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),i.active&&(i.cancel(),n.resumeAfterFlight(o.focalWorld))},M=x=>{if(t.isDisposed()||!t.gpu())return Promise.resolve();let w=o.seats.idToIndex.get(x);if(w===void 0)return Promise.resolve();t.setNearFieldDetailEnabled(!0),r.onViewTargetChange?.(x),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 T=t.inSeatView()&&r.arriveAtSeatEye===!0;t.setSeatStepping(T),t.setSeatViewLocked(!1);let L=++h;T?t.showArriveChip(x,L):t.removeArriveChip();let{eye:R,focal:K}=t.resolvedSeatViewPose(x,w),H=r.arriveAtSeatEye?t.seatViewArrival(x,w):null,V=H?H.focal:K,Y=[n.camera.position.x,n.camera.position.y,n.camera.position.z],y=Ot(Y,H?.eye??R,V,o.bounds.center,o.bounds.radius),S=H?H.eye:r.arriveAtSeatEye?R:y.finalPos,X=H?H.fov:r.arriveAtSeatEye?e.clientWidth/Math.max(1,e.clientHeight)<.7?nt:65:28,g=[y.waypoints[0],y.waypoints[1],S];if(l.setVisible(!1),t.reducedMotion())return t.setSeatStepping(!1),c(S,V,X),a.requestRender(),s.cinematicSkipped(),t.isDisposed()||n.syncFromCamera(),t.setSeatViewLocked(r.arriveAtSeatEye===!0),H&&t.enterSeatView(H.stops),t.showArriveChip(x,L),Promise.resolve();let z=new mi().copy(n.camera.quaternion),$=Zo(n.camera,S,V);a.requestRender();let U=T?700:2500;return i.start(g,z,$,U,X).then(()=>{t.isDisposed()||L!==h||(t.setSeatStepping(!1),s.cinematicPlayed(U),n.resumeAfterFlight(V),t.setSeatViewLocked(r.arriveAtSeatEye===!0),H&&t.enterSeatView(H.stops),a.requestRender(),t.showArriveChip(x,L))})},C=x=>{let w=o.sections.find(K=>K.id===x);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&&A(w.floorIndex),t.setNavigationMode("pan"),t.showSectionSeatLabels(x);let T=w.focalWorld[0]-w.center[0],L=w.focalWorld[2]-w.center[2],R=Math.hypot(T,L)>w.radius*.12?Math.atan2(T,L):void 0;return n.frame({center:w.center,radius:Math.max(5,w.radius*.5)},!1,R),r.onSectionFocusChange?.(x),a.requestRender(),!0},O=x=>{if(t.isDisposed()||!t.gpu())return!1;let w=o.seats.idToIndex.get(x);if(w===void 0)return!1;let T=w*3,L=[o.seats.iPosition[T],o.seats.iPosition[T+1]+.55,o.seats.iPosition[T+2]];return t.reducedMotion()?n.frame({center:L,radius:En},!1,void 0,!1,Rn):n.frameSoft({center:L,radius:En},void 0,!1,Rn),a.requestRender(),!0};return u.addEventListener("click",k),{overviewChip:u,layoutOverviewChip:D,flightGen:()=>h,focusedFloor:()=>b,applyFloorFocus:A,placeCameraFinal:c,cancelFlight:f,focusOverview:k,flyToSeat:M,focusSectionCamera:C,focusSeatCamera:O}}var En=4.5,Rn={polarDeg:48,margin:1.25};function Fn(t){let e=performance.now();return{model:Ve(t),buildMs:performance.now()-e,source:"main"}}function hi(t){let e=Kt(t.doc);return{...Fn({...t,seats:e}),seats:e}}function Tn(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=d=>{i||(i=!0,clearTimeout(l),r.terminate(),n(d))},a=()=>s(e()),l=window.setTimeout(a,15e3);r.onerror=a,r.onmessage=d=>{let p=o(d.data);p?s(p):a()},r.postMessage(t)})}function fi(t){return Tn(t,()=>Fn(t),({model:e,buildMs:o})=>({model:e,buildMs:o,source:"worker"}))}function vi(t){return Tn(t,()=>hi(t),({model:e,buildMs:o,seats:r})=>r?{model:e,buildMs:o,seats:r,source:"worker"}:null)}var bi=Math.PI/180,gi=6,yi=500;function vs(t,e,o={}){let r=performance.now(),n=e.prepared?.model??Ve(e),i=new at(o.onAnalytics),s=new Array(n.seats.count);for(let[m,v]of n.seats.idToIndex)s[v]=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 v=l.get(m.rowId);v?v.push(m.id):l.set(m.rowId,[m.id])}let d=new Map;for(let m of e.seats)d.set(m.id,m.sectionId);let p=new Map;for(let[m,v]of n.seats.idToIndex){let E=d.get(m);if(!E)continue;let W=p.get(E);W?W.push(v):p.set(E,[v])}let h=()=>{if(!c||!n.sectionSolidRanges.length)return;let{lit:m,anyUnlit:v}=Oo(n.sectionSolidRanges,p,n.seats.iState);c.setSectionShellLit(v?m:null)},b=e.doc.floors?.some(v=>(v.baseHeightM??0)>0)?!0:(e.doc.floors?.flatMap(v=>v.objects)??e.doc.objects).some(v=>v.type==="section"&&((v.height??0)>0||(v.rake??0)>0)),c=null,u=null,P=!1,D=!1,A=!1,k=new Map,f=null,M=null,C=null,O=new Map,x=null,w=()=>{C===null&&(C=t.style.zIndex,t.style.zIndex="20")},T=()=>{C!==null&&(t.style.zIndex==="20"&&(t.style.zIndex=C),C=null)},L=!1,R=()=>L?re.focusedFloor():-1,K=()=>{c=Go(y.gl,n),h(),u=new tt(y.renderer,c.seatGeometry,c.chairGeometry,c.solidGeometry,n.seats.count),y.setClearColor(n.theme.background.top),u.setRestoreClear(n.theme.background.top),c.seatProgram.uniforms.uSeatRadius.value=_e*n.theme.seatScale,c.seatProgram.uniforms.uFocusFloor.value=R(),c.solidProgram.uniforms.uFocusFloor.value=R(),c.chairProgram.uniforms.uFocusFloor.value=R(),c.screenProgram&&(c.screenProgram.uniforms.uFocusFloor.value=R()),V.forceRegather()},H=!1,V=new lt({model:n,orbit:()=>S,gpu:()=>c}),Y=m=>V.setDetailEnabled(m),y=new qe(t,{onContextLost:()=>{A||i.contextLost(),P=!0,_.stop(),c=null,u=null},onContextRestored:()=>{K(),P=!1,A||i.contextRestored(),_.requestRender()}}),S=new je(y.gl,y.canvas,()=>_.requestRender(),()=>i.orbitEngaged());S.setAspect(y.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],v=n.focalWorld[2]-n.bounds.center[2];return Math.hypot(m,v)>n.bounds.radius*.12?Math.atan2(m,v):void 0})(),z=n.floors.length>1?{polarDeg:48,margin:1.1}:{margin:1.1},$=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;S.frame(n.bounds,!$&&o.skipInitialOverviewAnimation!==!0,g,o.portraitOverviewCrop===!0,z);let U=new ot(S.camera),ee=wn(t),Z=new Je(t,{fontFamily:e.doc.theme?.fontFamily,ink:e.doc.theme?.textColor,backgroundRgb:n.theme.background.top}),le=n.labels,oe=()=>no(le,n.floors.length,R());Z.setLabels(oe());let J=null,I=m=>{if(J=m,Z.setForcedDense(!!m),!m){Z.setLabels(oe());return}let v=e.seats.filter(F=>F.sectionId===m),E=new Set(v.map(F=>F.id)),W=new Set(v.map(F=>F.rowId)),q=new Set(k.keys()),j=new Set(v.filter(F=>q.has(F.id)).map(F=>F.id)),te=oe().filter(F=>F.kind!=="row"&&F.kind!=="seat"||(F.kind==="row"?W.has(F.id.slice(4)):E.has(F.id.slice(5))&&(j.size===0||j.has(F.id.slice(5)))));if(n.seatCount<=6e3&&j.size===0){Z.setLabels(te);return}let ne=j.size?v.filter(F=>j.has(F.id)):v,ge=new Set(ne.map(F=>`seat:${F.id}`)),he=ne.flatMap(F=>{let ae=n.seats.idToIndex.get(F.id);if(ae===void 0)return[];let ce=ae*3;return[{id:`seat:${F.id}`,kind:"seat",text:q.has(F.id)?F.displayLabel||F.label:mo(F.displayLabel||F.label),anchor:[n.seats.iPosition[ce],n.seats.iPosition[ce+1]+(q.has(F.id)?1.05:.55),n.seats.iPosition[ce+2]]}]});Z.setLabels([...te.filter(F=>!ge.has(F.id)),...he])};K();let N=null,B=null,_=new Ke(m=>{if(P||!c||D)return!1;let v=yn({flying:U.active,panoramaMounted:f!==null,seatViewActive:N?.active===!0}),E=v==="cinematic"?U.update(performance.now()):v==="seatView"?N.update(performance.now()):v==="orbit"?S.update():!1;B?.syncZoomLimits();let W=R()>=0?n.floors[R()]:null,q=W?.radius??n.bounds.radius,j=xo(S.currentDistance,q),te=H?{center:[S.camera.position.x,S.camera.position.y,S.camera.position.z],radius:520}:n.renderBounds;S.updateClipping(te);let ne=W?.center??n.renderBounds.center,ge=W?.radius??n.renderBounds.radius,he=(ue,Ie)=>Math.hypot(S.camera.position.x-ue[0],S.camera.position.y-ue[1],S.camera.position.z-ue[2])<=Ie*(V.detailVisible?1.8:1.55),F=he(ne,ge);if(!F&&J){let ue=n.sections.find(Ie=>Ie.id===J);ue&&(F=he(ue.center,Math.max(12,ue.radius*2)))}V.detailVisible=F;let ae=c.seatProgram.uniforms;ae.uSeatScale.value=j.scale,ae.uSeatFade.value=j.fade;let ce=!!W&&So(W.seatCount,y.canvas.clientWidth||1,y.canvas.clientHeight||1),Ue=wo(n.seats.count,q,S.currentDistance,S.camera.fov,y.canvas.clientHeight||1),Te=V.detailVisible||ce||Ue?1:0,We=V.detailVisible||R()>=0||n.floors.length>1?1:0;return V.ease(m,Te,We),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*bi/2)/Math.max(1,y.pixelHeight),V.update(V.detailVisible),y.renderer.render({scene:c.background,clear:!0}),y.renderer.render({scene:c.main,camera:S.camera,clear:!1}),Z.update(S.camera.projectionViewMatrix,y.canvas.clientWidth||1,y.canvas.clientHeight||1,S.currentDistance,q,[S.camera.position.x,S.camera.position.y,S.camera.position.z]),E||V.seatDetailMix!==Te||V.structureDetailMix!==We}),G=typeof ResizeObserver<"u"?new ResizeObserver(()=>vt.resize()):null;G?.observe(t);let Q=m=>{let v=q=>{let j=n.seats.idToIndex.get(q);return j===void 0?void 0:n.seats.iState[j]},{updates:E,next:W}=Yo(k,m,v);if(k=W,Z.setSelectedSeatIds(k.keys()),J&&I(J),E.length){let q=xt(n.seats,E);c&&c.uploadSeatStateRuns(q),h(),_.requestRender()}},ve=()=>x!==null?x:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,ct=8,Gt=m=>{if(!o.getSeatView)return null;let v=O.get(m);if(!v)for(v=Promise.resolve(o.getSeatView(m)),O.set(m,v),v.catch(()=>{O.get(m)===v&&O.delete(m)});O.size>ct;){let E=O.keys().next().value;if(E===void 0)break;O.delete(E)}return v},Ht=un(n.stages,n.focalWorld,n.bounds.groundY??0),In=Nt(Ht),ut=(m,v)=>{let E=a.get(m),W=Math.max(0,Math.round(n.seats.iFloor[v]??0)),q=e.doc.floors?.[W],j=n.floors[W],te=q?.focalPoint??e.doc.focalPoint,ne=j?{x:j.focalWorld[0]/Me,y:j.focalWorld[2]/Me}:te,ge=E?.focalPoint?{x:E.focalPoint.x+ne.x-te.x,y:E.focalPoint.y+ne.y-te.y}:ne,he=[n.seats.iPosition[v*3],n.seats.iPosition[v*3+1],n.seats.iPosition[v*3+2]];return en(he,ge,q?.baseHeightM??0,E?.eyeHeightM,In)},Ut=()=>(t.clientWidth||y.canvas.clientWidth)<=520,dt=null,Wt=null,_n=async(m,v,E)=>{if(!o.getSeatView||A||E!==re.flightGen())return;let W;try{W=await xn()}catch{if(i.panoramaFailed(m,"mount"),!A&&E===re.flightGen()){let q=pt(m,E,!0);requestAnimationFrame(()=>q?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(A||E!==re.flightGen()||!dt))return Wt??=W.createOpenPanorama(dt),Wt(m,v,E)},mt=Mn({container:t,model:n,opts:o,expandedSeatById:a,seatIdsByRow:l,isNarrow:Ut,isDisposed:()=>A,flightGen:()=>re.flightGen(),flyToSeat:m=>qt(m),openPanorama:(m,v,E)=>_n(m,v,E)}),pt=mt.show,ht=mt.remove,Vn=mt.layout,be=Pn({container:t,orbit:S,isNarrow:Ut,enabled:o.chrome?.controlDock!==!1,...o.navLabels?{labels:o.navLabels}:{}});B=be;let Ln=be.element,De=be.setNavigationMode,kn=be.layout,On=be.utilityControls,Fe=null,Yt=!1,He=m=>{be.setSeatViewLocked(m),m||N?.exit()};N=gn({canvas:y.canvas,camera:S.camera,requestRender:()=>_.requestRender(),reducedMotion:ve,onStopChange:m=>{let v=m??(Yt?"seat":null);Fe=v;try{o.onSeatViewStopChange?.(v)}catch{}},onApplied:()=>{A||S.syncFromCamera()}});let zn=(m,v)=>{let{eye:E}=ut(m,v),W=(t.clientWidth||y.canvas.clientWidth||1)/Math.max(1,t.clientHeight||y.canvas.clientHeight||1),q=mn(E,Ht,W);if(o.seatViewStops===!1)return{...q,stops:[]};let j=d.get(m),te=j?n.sections.find(ne=>ne.id===j):void 0;return{...q,stops:pn(q,{aspect:W,section:te&&te.seatCount>0?{center:te.center,radius:te.radius}:null,venue:{center:n.bounds.center,radius:n.bounds.radius}})}},re=Dn({container:t,model:n,opts:o,orbit:S,cinematic:U,analytics:i,loop:_,labelOverlay:Z,stageAzimuth:g,overviewFraming:z,gpu:()=>c,isDisposed:()=>A,panorama:()=>f,setPanorama:m=>{f=m},setPanoramaSphereVisible:m=>{H=m},panoramaLoadAbort:()=>M,setPanoramaLoadAbort:m=>{M=m},setFrozen:m=>{D=m},restorePanoramaLayer:T,reducedMotion:ve,resolvedSeatViewPose:ut,showSectionSeatLabels:I,setNearFieldDetailEnabled:Y,setSeatViewLocked:He,setNavigationMode:De,showArriveChip:pt,removeArriveChip:ht,inSeatView:()=>Fe!==null,setSeatStepping:m=>{Yt=m},seatViewArrival:(m,v)=>o.arriveAtSeatEye?zn(m,v):null,enterSeatView:m=>N?.enter(m)});L=!0;let ft=re.overviewChip,Nn=re.layoutOverviewChip,Bn=re.applyFloorFocus,Gn=re.focusOverview,Xt=re.cancelFlight,qt=re.flyToSeat,jt=re.focusSectionCamera;On.appendChild(ft),dt={container:t,model:n,opts:o,analytics:i,orbit:S,loop:_,seatsById:a,ensureSeatView:Gt,resolvedSeatViewPose:ut,gpu:()=>c,gl:y.gl,isContextLost:()=>P,isDisposed:()=>A,flightGen:()=>re.flightGen(),setPanorama:m=>{f=m},getLoadAbort:()=>M,setLoadAbort:m=>{M=m},setPanoramaSphereVisible:m=>{H=m,m&&N?.exit()},setFrozen:m=>{D=m},raisePanoramaLayer:w,restorePanoramaLayer:T,getOverviewChip:()=>ft,labelOverlay:Z,reducedMotion:ve,removeArriveChip:ht,showArriveChip:pt};let pe=Cn({glctx:y,orbit:S,model:n,seats:e.seats,opts:o,cinematic:U,analytics:i,seatIdByIndex:s,sectionIdBySeatId:d,tapSlop:gi,tapMs:yi,gpu:()=>c,pick:()=>u,seatViewLocked:()=>be.seatViewLocked(),focusedSectionId:()=>J,selection:()=>k,cancelFlight:Xt,focusSectionCamera:jt,focusSeatCamera:re.focusSeatCamera,setSelection:Q,ensureSeatView:Gt});y.canvas.addEventListener("pointerdown",pe.onDown),y.canvas.addEventListener("pointermove",pe.onMove),y.canvas.addEventListener("pointerup",pe.onUp),y.canvas.addEventListener("pointercancel",pe.onUp),_.requestRender();let vt={setAvailability(m){let v=Wo(k,m),E=xt(n.seats,v);E.length&&c&&c.uploadSeatStateRuns(E),h(),_.requestRender()},setSelection:Q,setNavigationMode:De,zoomIn(){S.zoomBy(Ce),_.requestRender()},zoomOut(){S.zoomBy(Le),_.requestRender()},flyToSeat:qt,focusOverview:Gn,seatViewStop:()=>Fe,recentreSeatView:()=>N?.recentre()??!1,resize(){let{width:m,height:v}=y.resize();S.setAspect(m/Math.max(1,v)),Vn(),kn(),Nn(),_.requestRender()},stats(){return{..._.stats(),drawCalls:c?c.drawCalls:0,seatCount:n.seatCount}},getQualityEvidence(){let m=_.stats(),v=y.canvas.clientWidth||1,E=y.canvas.clientHeight||1,W=n.bounds.center,q=fe(S.camera.projectionViewMatrix,[W[0],n.bounds.box.min[1],W[2]],v,E),j=fe(S.camera.projectionViewMatrix,[W[0],n.bounds.box.max[1],W[2]],v,E),te=n.bounds.box,ne=[te.min[0],te.max[0]].flatMap(F=>[te.min[1],te.max[1]].flatMap(ae=>[te.min[2],te.max[2]].map(ce=>fe(S.camera.projectionViewMatrix,[F,ae,ce],v,E)))).filter(F=>Number.isFinite(F.x)&&Number.isFinite(F.y)&&Number.isFinite(F.depth)),ge=ne.length?(()=>{let F=Math.min(...ne.map(ye=>ye.x)),ae=Math.max(...ne.map(ye=>ye.x)),ce=Math.min(...ne.map(ye=>ye.y)),Ue=Math.max(...ne.map(ye=>ye.y)),Te=Math.max(0,F),We=Math.min(v,ae),ue=Math.max(0,ce),Ie=Math.min(E,Ue),Ye=Math.max(0,We-Te),bt=Math.max(0,Ie-ue);return{box:{x:Te,y:ue,width:Ye,height:bt},horizontalFillRatio:Ye/v,verticalFillRatio:bt/E,visibleAreaRatio:Ye*bt/(v*E),clippedEdges:[...ce<0?["top"]:[],...ae>v?["right"]:[],...Ue>E?["bottom"]:[],...F<0?["left"]:[]]}})():void 0,he=String(y.gl.getParameter(y.gl.VERSION)??"");return{viewport:{width:v,height:E},context:{webgl2:/webgl\s*2/i.test(he),lost:P},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:q.visible&&j.visible?Math.abs(q.y-j.y):0},labels:Z.qualityEvidence(),framing:ge,...Fe?{seatView:{fovDeg:S.camera.fov,stop:Fe}}:{}}},getQualityReport(){return It(vt.getQualityEvidence())},loseContextForTest(){y.simulateContextLossCycle()},floors(){return n.floors},focusFloor(m){if(m!==null&&!n.floors.some(E=>E.index===m))return!1;let v=m??-1;if(Y(m!==null),He(!1),Bn(v),De("orbit"),m===null)U.cancel(),ve()?S.frame(n.bounds,!1,g,o.portraitOverviewCrop===!0,z):S.frameSoft(n.bounds,g,o.portraitOverviewCrop===!0,z);else{let E=n.floors[m];if(E.seatCount>0){U.cancel();let W=E.focalWorld[0]-E.center[0],q=E.focalWorld[2]-E.center[2],j=Math.hypot(W,q)>E.radius*.12?Math.atan2(W,q):g;S.frame({center:E.center,radius:E.radius,box:E.box},!1,j,!1,{polarDeg:58,margin:1.12})}}return _.requestRender(),!0},zones(){return n.zones},focusZone(m){let v=n.zones.find(j=>j.id===m);if(!v||v.seatCount===0)return!1;Y(!1),He(!1),U.cancel(),De("orbit"),I(null),o.onSectionFocusChange?.(null);let E=v.focalWorld[0]-v.center[0],W=v.focalWorld[2]-v.center[2],q=Math.hypot(E,W)>v.radius*.12?Math.atan2(E,W):void 0;return S.frame({center:v.center,radius:v.radius*1.25},!1,q),_.requestRender(),!0},sections(){return n.sections},focusSection(m){return jt(m)},rows(m){return m?n.rows.filter(v=>v.sectionId===m):n.rows},seatsInRow(m){return e.seats.filter(v=>v.rowId===m).map(v=>({id:v.id,label:v.displayLabel||v.label}))},focusRow(m){let v=n.rows.find(E=>E.id===m);return!v||v.seatCount===0?!1:(Y(!0),He(!1),U.cancel(),De("pan"),v.sectionId&&(I(v.sectionId),o.onSectionFocusChange?.(v.sectionId)),S.frame({center:v.center,radius:Math.max(2.5,v.radius*.65)}),_.requestRender(),!0)},setReducedMotionForTest(m){x=m},dispose(){A=!0,ht(),ft.remove(),Ln.remove(),Xt(),N?.dispose(),_.stop(),Z.dispose(),G?.disconnect(),f&&(f.dispose(),f=null),T(),ee(),y.canvas.removeEventListener("pointerdown",pe.onDown),y.canvas.removeEventListener("pointermove",pe.onMove),y.canvas.removeEventListener("pointerup",pe.onUp),y.canvas.removeEventListener("pointercancel",pe.onUp),S.dispose(),u&&u.dispose(),c&&c.dispose(),c=null,u=null,y.dispose()}};return i.opened(n.seatCount,b,e.prepared?.buildMs??performance.now()-r,e.prepared?.source??"inline"),vt}export{rr as VENUE3D_QUALITY_REPORT_VERSION,Ve as buildSceneModel,It as inspectVenue3DQualityEvidence,vs as mountVenue3D,fi as prepareVenue3D,vi 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 B=new Ne(t,{geometry:$,program:U});B.frustumCulled=!1,B.setParent(o),oe.screenProgram=U,g=!0,oe.drawCalls=3+(X?1:0)+1},I.src=J.contentImageUrl}return oe}import{Mesh as It,RenderTarget as kr,Transform as _t}from"ogl";function Lr(t,e,o){let r=t+(e<<8)+(o<<16);return r===0?-1:r-1}function Ho(t,e,o,r,n,i){let s=-1,a=1/0;for(let l=0;l<o;l++)for(let d=0;d<e;d++){let p=(l*e+d)*4,h=Lr(t[p],t[p+1],t[p+2]);if(h<0||h>=i)continue;let b=d-r,c=l-n,u=b*b+c*c;u<a&&(a=u,s=h)}return s}function Uo(t,e,o,r,n,i){let s=t-o.left,a=e-o.top,l=Math.round(s*r),d=Math.round((o.height-a)*r);return{x:Math.max(0,Math.min(n-1,l)),y:Math.max(0,Math.min(i-1,d))}}var Or=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],tt=class{constructor(e,o,r,n,i){this.seatScene=new _t;this.chairScene=new _t;this.solidScene=new _t;this.target=null;this.restoreClear=[0,0,0];this.renderer=e,this.gl=e.gl,this.maxIndex=i,this.seatProg=Fo(this.gl),this.chairProg=To(this.gl),this.depthProg=Io(this.gl);let s=new It(this.gl,{geometry:o,program:this.seatProg});s.frustumCulled=!1,s.setParent(this.seatScene);let a=new It(this.gl,{geometry:r,program:this.chairProg});a.frustumCulled=!1,a.setParent(this.chairScene);let l=new It(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 Or)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 kr(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,d=Math.max(0,o-n),p=Math.max(0,r-n),h=Math.max(1,Math.min(a,o+n+1)-d),b=Math.max(1,Math.min(l,r+n+1)-p);i.enable(i.SCISSOR_TEST),i.scissor(d,p,h,b);let[c,u,P]=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,u,P,1),i.disable(i.SCISSOR_TEST);let F=new Uint8Array(h*b*4);return this.renderer.bindFramebuffer(s),i.readPixels(d,p,h,b,i.RGBA,i.UNSIGNED_BYTE,F),this.renderer.bindFramebuffer(),Ho(F,h,b,o-d,r-p,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function Wo(t,e){let o=[];for(let r of e)t.has(r.seatId)?t.set(r.seatId,$t(r.state)):o.push(r);return o}function Yo(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 Be,Vec3 as Br}from"ogl";function zr(t,e){return[t[0]-e[0],t[1]-e[1],t[2]-e[2]]}function Xo(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function Nr(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function qo(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 Vt(t){let e=Math.max(0,Math.min(1,t));return e*e*e*(e*(e*6-15)+10)}function Lt(t,e){return Math.max(0,Math.min(1,t+e))}function jo(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],d=t[i+1],p=t[Math.min(o-1,i+2)],h=s*s,b=h*s,c=[0,0,0];for(let u=0;u<3;u++)c[u]=.5*(2*l[u]+(-a[u]+d[u])*s+(2*a[u]-5*l[u]+4*d[u]-p[u])*h+(-a[u]+3*l[u]-3*d[u]+p[u])*b);return c}function kt(t,e,o,r,n){let i=qo(zr(e,o));i[0]===0&&i[1]===0&&i[2]===0&&(i=[0,0,1]);let s=Xo(Xo(e,Nr(i,2.5)),[0,1.5,0]),a=[e[0]-r[0],0,e[2]-r[2]],l=qo(a);l[0]===0&&l[2]===0&&(l=[i[0],0,i[2]]);let d=Math.max(1,n),p=[r[0]+l[0]*d*1.3,r[1]+d*.75,r[2]+l[2]*d*1.3];return{waypoints:[t,p,s],finalPos:s}}function Ot(t,e,o=35,r=28){let n=Vt(e),i=jo(t,n),s=Vt(Math.max(0,Math.min(1,(e-.66)/.34)));return{pos:i,fov:o+(r-o)*s,eased:n}}function Zo(t,e,o){let r=t.position.clone(),n=new Be().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 Be().copy(t.quaternion);return t.position.copy(r),t.quaternion.copy(n),i}var ot=class{constructor(e){this.active=!1;this.waypoints=[];this.startQuat=new Be;this.endQuat=new Be;this.outQuat=new Be;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}=Ot(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,Lt(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 Jo=Jt,Gr=.12,Hr=.25,Ur=1.5;function en(t,e,o=0,r,n){let i=[e.x*Me,o+Ur,e.y*Me],s=n?[n[0],n[1],n[2]]:i,a=t[1],l=Number.isFinite(a)?a+Jo:Number.isFinite(r)?o+r:o+Jo,d=i[0]-t[0],p=i[2]-t[2],h=Math.hypot(d,p),b=h>.001?Math.min(Gr,h*Hr):0,c=h>.001?d/h:0,u=h>.001?p/h:0;return{eye:[t[0]+c*b,l,t[2]+u*b],focal:s}}var we=Math.PI/180,Wr=45,tn=80,nt=70,Yr=1,Xr=.99;function qr(t,e){if(!(t<Yr))return tn;if(!(Number.isFinite(e)&&e>0))return nt;let o=2*Math.atan(e/(2*rt*Xr)/Math.max(.05,t))/we;return Math.max(nt,Math.min(tn,o))}var jr=.25,rt=1,Kr=.25,Qr=12*we,$r=.2,Zr=1.5,on=.8,nn=6,ln=1.9,Jr=2/3,ei=.12,ti=.9,oi=1.2,ni=2,cn=.05,ri=6;function un(t,e,o=0){if(!t.length)return{min:[e[0]-6,o,e[2]-6],max:[e[0]+6,Math.max(o+on,e[1]),e[2]+6]};let r=1/0,n=-1/0,i=1/0,s=-1/0,a=o;for(let u of t)r=Math.min(r,u.cx-u.halfX),n=Math.max(n,u.cx+u.halfX),i=Math.min(i,u.cz-u.halfZ),s=Math.max(s,u.cz+u.halfZ),a=Math.max(a,u.y);let l=n-r,d=s-i,p=Math.max(l,Math.min(d,nn))/2,h=Math.max(d,Math.min(l,nn))/2,b=(r+n)/2,c=(i+s)/2;return{min:[b-p,o,c-h],max:[b+p,Math.max(o+on,a),c+h]}}function ii(t){return{min:[t.min[0],t.min[1],t.min[2]],max:[t.max[0],t.max[1]+ln,t.max[2]]}}function zt(t){let e=t.max[1];return[(t.min[0]+t.max[0])/2,Math.max(t.min[1]+Zr,e+$r,e+ln*Jr),(t.min[2]+t.max[2])/2]}function dn(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 rn(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,d=Math.hypot(a,l);if(d<1e-6)return 1/0;a/=d,l/=d;let p=1/0,h=-1/0;for(let b=0;b<8;b++){let c=(b&1?o.max[0]:o.min[0])-t[0],u=(b&2?o.max[1]:o.min[1])-t[1],P=(b&4?o.max[2]:o.min[2])-t[2],F=Math.max(cn,c*r+u*n+P*i),A=(c*a+P*l)/F;A<p&&(p=A),A>h&&(h=A)}return h-p}function an(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,d=Math.hypot(a,l);if(d<1e-6)return 1/0;a/=d,l/=d;let p=-l*n,h=l*r-a*i,b=a*n,c=1/0,u=-1/0;for(let P=0;P<8;P++){let F=(P&1?o.max[0]:o.min[0])-t[0],A=(P&2?o.max[1]:o.min[1])-t[1],k=(P&4?o.max[2]:o.min[2])-t[2],f=Math.max(cn,F*r+A*n+k*i),M=(F*p+A*h+k*b)/f;M<c&&(c=M),M>u&&(u=M)}return u-c}function it(t,e){return Math.tan(t*we/2)*Math.max(.05,e)}function sn(t,e,o){let r=qr(o,t),n=l=>Math.max(Wr,Math.min(r,l)),i=l=>2*Math.atan(l)/we,s=Number.isFinite(t)&&t>0?n(i(t/(2*jr)/Math.max(.05,o))):r;if(!(Number.isFinite(e)&&e>0))return s;let a=Math.min(s,n(i(e/(2*ei))));return t/(2*it(a,o))>rt?s:a}function mn(t,e,o){let r=zt(e),n=[t[0],t[1],t[2]],i=0,s=0,a=c=>{if(!(c>0))return;let u=dn(n,r);n[0]+=u.x*c,n[2]+=u.z*c,s+=c},l=e.max[1]+Kr-n[1];l>0&&(n[1]+=l,i=l,a(l/Math.tan(Qr)));let d=ii(e),p=rn(n,r,e),h=sn(p,an(n,r,d),o),b=p/(2*it(h,o));for(let c=0;c<ri&&b>rt;c++){let u=Math.max(1,Math.hypot(n[0]-r[0],n[2]-r[2])),P=Number.isFinite(b)?b/rt:2;a(Math.min(60,u*(Math.min(4,P)-1)+.5)),p=rn(n,r,e),h=sn(p,an(n,r,d),o),b=p/(2*it(h,o))}return{eye:n,focal:r,fov:h,raisedM:i,pulledBackM:s,stageFrameWidth:b}}function ai(t,e,o){let r=Math.tan(e*we/2),n=it(e,o);return Math.max(1,t/Math.max(.05,Math.min(r,n)))}function pn(t,e){let{aspect:o,venue:r}=e,n=t.focal,i=dn(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=ni*(e.rowDepthM??ti);a.push({name:"row",eye:[t.eye[0]+i.x*l,t.eye[1]+oi,t.eye[2]+i.z*l],focal:n,fov:t.fov});let d=(b,c,u,P)=>{let F=ai(u,t.fov,o)*1.08,A=F*Math.sin(P*we),k=F*Math.cos(P*we);return{name:b,eye:[c[0]+i.x*k,c[1]+A,c[2]+i.z*k],focal:c,fov:t.fov}};e.section&&e.section.radius>0&&a.push(d("section",e.section.center,e.section.radius,14)),a.push(d("venue",r.center,Math.max(1,r.radius),26));let p=[],h=-1/0;for(let b of a){let c=s(b.eye);p.length&&c<=h+.5||(p.push(b),h=c)}return p}import{Vec3 as si}from"ogl";var He=Math.PI/180,hn=320,fn=70*He,li=32*He,ci=24*He,vn=.0026,ui=.22,di=.006,mi=180,pi=4,se=(t,e,o)=>Math.max(e,Math.min(o,t)),bn=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2;function gn(t){let{canvas:e,camera:o}=t,r=[],n=!1,i=0,s=0,a=0,l=0,d=0,p=0,h=!1,b=[0,0],c=0,u=!1,P=null,F=null,A=new Map,k=!1,f=0,M=0,C=0,O=0,x=()=>n&&r.length?r[se(Math.round(i),0,r.length-1)].name:null,w=()=>{let g=x();g!==P&&(P=g,t.onStopChange?.(g))},D=()=>{if(!n||!r.length)return;let g=r[se(Math.floor(i),0,r.length-1)],z=r[se(Math.ceil(i),0,r.length-1)],$=se(i-Math.floor(i),0,1),U=(ve,ct)=>ve+(ct-ve)*$,ee=[U(g.eye[0],z.eye[0]),U(g.eye[1],z.eye[1]),U(g.eye[2],z.eye[2])],Z=[U(g.focal[0],z.focal[0]),U(g.focal[1],z.focal[1]),U(g.focal[2],z.focal[2])],le=Z[0]-ee[0],oe=Z[1]-ee[1],J=Z[2]-ee[2],I=Math.hypot(le,oe,J)||1,N=Math.atan2(le,J),B=Math.asin(se(oe/I,-1,1)),_=N+s,G=se(B+a,-80*He,80*He),Q=Math.cos(G)*I;le=Math.sin(_)*Q,oe=Math.sin(G)*I,J=Math.cos(_)*Q,o.position.set(ee[0],ee[1],ee[2]),o.fov=U(g.fov,z.fov),o.updateProjectionMatrix(),o.lookAt(new si(ee[0]+le,ee[1]+oe,ee[2]+J)),t.onApplied?.()},L=()=>{if(!n||!r.length)return;let g=se(Math.round(i),0,r.length-1);if(t.reducedMotion()){h=!1,i=g,D(),w(),t.requestRender();return}if(Math.abs(g-i)<.001){h=!1,w();return}l=i,d=g,p=performance.now(),h=!0,t.requestRender()},R=g=>{!n||r.length<2||(h=!1,i=se(i+g,0,r.length-1),D(),w(),t.requestRender())},K=(g,z)=>{n&&(h=!1,u=!1,s=se(s-g*vn,-fn,fn),a=se(a-z*vn,-ci,li),D(),t.requestRender())},H=g=>{n&&(A.set(g.pointerId,{x:g.clientX,y:g.clientY}),A.size===1?(k=!0,O=0,f=g.clientX,M=g.clientY):A.size===2&&(k=!1,C=V()))},V=()=>{let g=[...A.values()];return g.length<2?0:Math.hypot(g[0].x-g[1].x,g[0].y-g[1].y)},Y=g=>{if(!n||!A.has(g.pointerId))return;if(A.set(g.pointerId,{x:g.clientX,y:g.clientY}),A.size>=2){let U=V();C>0&&R((C-U)*di),C=U;return}if(!k)return;let z=g.clientX-f,$=g.clientY-M;f=g.clientX,M=g.clientY,O+=Math.abs(z)+Math.abs($),!(O<=pi)&&K(z,$)},y=g=>{A.delete(g.pointerId)&&(A.size<2&&(C=0),A.size===0&&(k=!1,L()))},S=g=>{if(!n)return;g.preventDefault();let z=g.deltaMode===1?16:g.deltaMode===2?100:1,$=se(g.deltaY*z/100,-2,2);R($*ui),F&&clearTimeout(F),F=setTimeout(()=>{F=null,L()},mi)},X=()=>{n&&(n=!1,h=!1,u=!1,r=[],A.clear(),k=!1,F&&(clearTimeout(F),F=null),P!==null&&(P=null,t.onStopChange?.(null)))};return e.addEventListener("pointerdown",H),e.addEventListener("pointermove",Y),e.addEventListener("pointerup",y),e.addEventListener("pointercancel",y),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,h=!1,u=!1,P=null,D(),w(),t.requestRender()},exit:X,recentre(){return n?Math.abs(s)<1e-4&&Math.abs(a)<1e-4?!0:t.reducedMotion()?(u=!1,s=0,a=0,D(),t.requestRender(),!0):(b=[s,a],c=performance.now(),u=!0,t.requestRender(),!0):!1},update(g){if(!n)return!1;let z=!1;if(u){let $=se((g-c)/hn,0,1),U=1-bn($);s=b[0]*U,a=b[1]*U,$>=1?(u=!1,s=0,a=0):z=!0}if(h){let $=se((g-p)/hn,0,1);i=l+(d-l)*bn($),$>=1?(h=!1,i=d,w()):z=!0}return D(),z},currentStop:x,dispose(){X(),e.removeEventListener("pointerdown",H),e.removeEventListener("pointermove",Y),e.removeEventListener("pointerup",y),e.removeEventListener("pointercancel",y),e.removeEventListener("wheel",S)}}}function yn(t){return t.flying?"cinematic":t.panoramaMounted?"panorama":t.seatViewActive?"seatView":"orbit"}var Nt=null;function xn(){return Nt??=import("../openPanorama-6FMXAJ6O.js").catch(t=>{throw Nt=null,t}),Nt}var Sn=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),at=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=Sn(),this.emit("3d_panorama_opened")}panoramaClosed(){let e=this.panoramaOpenedAt?Math.round(Sn()-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 wn(t){let e=t.style.position;return getComputedStyle(t).position!=="static"?()=>{}:(t.style.position="relative",()=>{t.style.position==="relative"&&(t.style.position=e)})}function Mn(t){let{container:e,model:o,opts:r,expandedSeatById:n,seatIdsByRow:i,isNarrow:s}=t,a=null,l=()=>{if(!a)return;let h=s();Object.assign(a.style,h?{left:"12px",right:"12px",bottom:"70px",transform:"none",justifyContent:"center"}:{left:"50%",right:"auto",bottom:"18px",transform:"translateX(-50%)",justifyContent:"initial"})},d=()=>{a?.remove(),a=null};return{show:(h,b,c=!1)=>{if(d(),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 P=r.chrome?.caption!==!1,F=r.chrome?.seatStepper!==!1;if(!P&&!F)return null;let A=n.get(h),k=A?.sectionId?o.sections.find(L=>L.id===A.sectionId):void 0,f=A?.label??h;u.setAttribute("aria-label",`Explore views near ${k?.label?`${k.label}, `:""}seat ${f}`);let M=document.createElement("span");M.textContent=r.seatViewCaption?.(h)??["Live 3D seat view",k?.label,f].filter(Boolean).join(" \xB7 "),Object.assign(M.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)"}),P&&u.appendChild(M);let C=document.createElement("div");Object.assign(C.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),u.appendChild(C);let O=A?.rowId?i.get(A.rowId):void 0,x=O?.indexOf(h)??-1,w=x>=0?[O?.[x-1],O?.[x+1]]:[void 0,void 0],D=(L,R,K,H=!1)=>{let V=document.createElement("button");V.type="button",V.textContent=L,V.setAttribute("aria-label",R),Object.assign(V.style,{minHeight:"44px",padding:H?"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"}),H||(V.style.minWidth="44px"),H&&(V.dataset.panoramaTrigger=""),V.addEventListener("click",K),C.appendChild(V)};if(F&&w[0]){let L=n.get(w[0])?.label??w[0];D("\u2039",`View previous seat ${L}`,()=>{t.flyToSeat(w[0])})}if(F&&r.getSeatView){let L=r.seatViewActionLabel?.(h)??"Open 360\xB0 panorama";D(c?`\u21BB Retry ${L}`:`\u25C9 ${L}`,`${c?"Retry":L} from seat ${f}`,()=>{if(t.isDisposed()||b!==t.flightGen()){d();return}d(),t.openPanorama(h,400,b)},!0)}if(F&&w[1]){let L=n.get(w[1])?.label??w[1];D("\u203A",`View next seat ${L}`,()=>{t.flyToSeat(w[1])})}return!C.childElementCount&&!P?null:(e.appendChild(u),a=u,l(),u)},remove:d,layout:l}}var hi={rotate:"Drag to rotate the venue",move:"Drag to move the venue",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Show whole venue"};function Pn(t){let{container:e,orbit:o,isNarrow:r}=t,n={...hi,...t.labels??{}},i=(f,M)=>{f.setAttribute("aria-label",M),f.title=M},s=document.createElement("div"),a=!1;s.className="sl-3d-navigation-controls",Object.assign(s.style,{position:"absolute",right:"14px",bottom:"14px",display:"flex",zIndex:"4",flexDirection:"column",alignItems:"flex-end",gap:"7px"});let l=document.createElement("div");l.setAttribute("role","group"),l.setAttribute("aria-label","3D drag mode"),Object.assign(l.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let d=document.createElement("div");d.setAttribute("role","group"),d.setAttribute("aria-label","3D view controls"),Object.assign(d.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let p=document.createElement("button");p.type="button",p.textContent="\u21BB",i(p,n.rotate);let h=document.createElement("button");h.type="button",h.textContent="\u2725",i(h,n.move);let b=document.createElement("button");b.type="button",b.textContent="\u2212",i(b,n.zoomOut);let c=document.createElement("button");c.type="button",c.textContent="+",i(c,n.zoomIn);for(let f of[p,h,b,c])f.className="sl-3d-icon-control",Object.assign(f.style,{width:"44px",minWidth:"44px",minHeight:"44px",padding:"9px",border:"1px solid rgba(150,165,205,0.35)",borderRadius:"999px",color:"#c9d4ea",background:"rgba(12,18,32,0.82)",font:"600 17px/1 inherit",backdropFilter:"blur(6px)",cursor:"pointer",whiteSpace:"nowrap"});l.append(p,h),d.append(c,b);let u=f=>{o.setPrimaryDragMode(f);let M=f==="orbit";p.setAttribute("aria-pressed",String(M)),h.setAttribute("aria-pressed",String(!M)),p.style.background=M?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",h.style.background=M?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",s.title=M?`${n.rotate} \xB7 ${n.move} with Shift`:`${n.move} \xB7 ${n.rotate} with Shift`};p.addEventListener("click",()=>u("orbit")),h.addEventListener("click",()=>u("pan"));let P=()=>{let{atMin:f,atMax:M}=o.dollyLimitState();c.disabled!==f&&(c.disabled=f),b.disabled!==M&&(b.disabled=M)};b.addEventListener("click",()=>{o.zoomBy(Le),P()}),c.addEventListener("click",()=>{o.zoomBy(Ce),P()}),s.append(l,d),u("orbit"),e.appendChild(s);let F=t.enabled!==!1,A=()=>{let f=r();s.style.display=a||!F?"none":"flex",s.style.right=f?"12px":"14px",s.style.bottom=f?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",l.style.display=f?"none":"flex",c.style.display=f?"none":"",b.style.display=f?"none":""};return A(),{element:s,utilityControls:d,setNavigationMode:u,syncZoomLimits:P,setSeatViewLocked:f=>{a=f,o.setInteractionEnabled(!f),A()},seatViewLocked:()=>a,layout:A}}var fi=12;function vi(t,e){if(!t)return!1;let o=t.x-e[0],r=t.y-e[1],n=t.z-e[2];return Math.hypot(o,r,n)>fi}function Cn(t){let{glctx:e,orbit:o,model:r,seats:n,opts:i,cinematic:s,analytics:a,seatIdByIndex:l,sectionIdBySeatId:d,tapSlop:p,tapMs:h,cancelFlight:b,focusSectionCamera:c,setSelection:u,ensureSeatView:P}=t,F=0,A=0,k=0,f=-1,M=!1,C=!1,O=R=>{t.seatViewLocked()||f===-1&&(f=R.pointerId,F=R.clientX,A=R.clientY,k=performance.now(),M=!1,C=s.active,s.active&&(a.cinematicCancelled(),b(),i.onViewTargetChange?.(null)))},x=R=>{R.pointerId===f&&Math.hypot(R.clientX-F,R.clientY-A)>p&&(M=!0)},w=(R,K,H,V,Y)=>{let y=e.canvas.getBoundingClientRect(),S=e.canvas.clientWidth||y.width||1,X=e.canvas.clientHeight||y.height||1,g=R-y.left,z=K-y.top,$=V*V,U=-1,ee=$,Z=1/0;for(let le of n){if(H&&le.sectionId!==H)continue;let oe=r.seats.idToIndex.get(le.id);if(oe===void 0)continue;if(Y){let G=Math.round(r.seats.iState[oe]??0);if(G!==0&&G!==3)continue}let J=oe*3,I=fe(o.camera.projectionViewMatrix,[r.seats.iPosition[J],r.seats.iPosition[J+1]+.55,r.seats.iPosition[J+2]],S,X);if(!I.visible)continue;let N=I.x-g,B=I.y-z,_=N*N+B*B;(_<ee||Math.abs(_-ee)<1&&I.depth<Z)&&(U=oe,ee=_,Z=I.depth)}return U},D=(R,K)=>{let H=t.gpu(),V=t.pick();if(!H||!V)return-1;V.syncFromSeatProgram(H.seatProgram);let Y=e.canvas.getBoundingClientRect(),y=e.renderer.dpr,{x:S,y:X}=Uo(R,K,Y,y,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),g=Math.max(2,Math.round(8*y));return V.pick(o.camera,S,X,g)};return{onDown:O,onMove:x,onUp:R=>{if(R.pointerId!==f)return;let K=!M&&performance.now()-k<h;if(f=-1,C){C=!1;return}let H=t.gpu(),V=t.pick();if(!K||!H||!V)return;let Y=D(R.clientX,R.clientY);if(t.focusedSectionId()&&Y>=0){let X=l[Y],g=X?d.get(X):void 0;if(g&&g!==t.focusedSectionId()&&c(g))return}if(t.focusedSectionId()&&Y<0&&(Y=w(R.clientX,R.clientY,t.focusedSectionId(),44,!1)),t.focusedSectionId()&&Y<0){let X=w(R.clientX,R.clientY,null,72,!1),g=X>=0?l[X]:void 0,z=g?d.get(g):void 0;if(z&&z!==t.focusedSectionId()&&c(z))return}if(!t.focusedSectionId()){Y<0&&(Y=w(R.clientX,R.clientY,null,42,!1));let X=Y>=0?l[Y]:void 0,g=X?d.get(X):void 0;if(g&&c(g))return}if(Y<0||Y>=l.length){t.selection().size&&(u([]),i.onViewTargetChange?.(null));return}let y=l[Y],S=me[Math.round(r.seats.iState[Y]??0)]??"available";if(S!=="available"&&S!=="selected"){i.onSeatInspect?.(y,S);return}if(t.selection().has(y)&&t.selection().size===1){u([]),i.onViewTargetChange?.(null),i.onSeatPick?.(y);return}if(u([y]),P(y),a.seatPicked(y,d.get(y)),i.onSeatPick?.(y),t.focusedSectionId()){let X=Y*3,g=[r.seats.iPosition[X],r.seats.iPosition[X+1],r.seats.iPosition[X+2]];vi(o.camera?.position,g)&&t.focusSeatCamera(y)}}}}var st=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 u=e[c*3],P=e[c*3+2];u<o&&(o=u),u>n&&(n=u),P<r&&(r=P),P>i&&(i=P)}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,d=new Int32Array(l+1),p=c=>{let u=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+u};for(let c=0;c<this.count;c++)d[p(c)+1]++;for(let c=0;c<l;c++)d[c+1]+=d[c];let h=new Int32Array(this.count),b=d.slice(0,l);for(let c=0;c<this.count;c++)h[b[p(c)]++]=c;this.cellStart=d,this.cellItems=h}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,d=Math.floor((e-this.minX)/this.cell),p=Math.floor((o-this.minZ)/this.cell),h=Math.ceil(r/this.cell)+1,b=this.iPosition,c=0;for(let u=0;u<=h&&c<a;u++){let P=p-u,F=p+u,A=d-u,k=d+u;for(let f=P;f<=F&&c<a;f++){if(f<0||f>=this.rows)continue;let M=f===P||f===F;for(let C=A;C<=k&&c<a;C++){if(!M&&C!==A&&C!==k){C=k-1;continue}if(C<0||C>=this.cols)continue;let O=f*this.cols+C;for(let x=i[O],w=i[O+1];x<w&&c<a;x++){let D=s[x],L=b[D*3]-e,R=b[D*3+2]-o;L*L+R*R<=l&&(n[c++]=D)}}}}return c}};var lt=class{constructor(e){this.ctx=e;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array($e);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.nearIndex=new st(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)<At)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>Ct){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let a=this.nearIndex.gather(n.x,n.z,Ct,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 bi,Vec3 as gi}from"ogl";function An(){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 Dn(t){let{container:e,model:o,opts:r,orbit:n,cinematic:i,analytics:s,loop:a,labelOverlay:l,stageAzimuth:d,overviewFraming:p}=t,h=0,b=-1,c=(x,w,D=28)=>{n.camera.position.set(x[0],x[1],x[2]),n.camera.lookAt(new gi(w[0],w[1],w[2])),n.camera.fov=D,n.camera.updateProjectionMatrix()},u=document.createElement("button");u.className="sl-3d-overview-control sl-3d-icon-control",u.type="button",u.replaceChildren(An());let P=r.navLabels?.fitView??"Show whole venue";u.setAttribute("aria-label",P),u.title=P,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 F=()=>{u.firstElementChild||u.replaceChildren(An())};F();let A=x=>{b=x;let w=t.gpu();w&&(w.seatProgram.uniforms.uFocusFloor.value=x,w.solidProgram.uniforms.uFocusFloor.value=x,w.chairProgram.uniforms.uFocusFloor.value=x),t.showSectionSeatLabels(null)},k=()=>{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 x=b>=0?o.floors[b]:null;if(t.setNearFieldDetailEnabled(!!x),t.setSeatViewLocked(!1),f(),t.removeArriveChip(),t.setNavigationMode("orbit"),x){let w=x.focalWorld[0]-x.center[0],D=x.focalWorld[2]-x.center[2],L=Math.hypot(w,D)>x.radius*.12?Math.atan2(w,D):d,R={center:x.center,radius:x.radius,box:x.box},K={polarDeg:58,margin:1.12};t.reducedMotion()?n.frame(R,!1,L,!1,K):n.frameSoft(R,L,!1,K)}else t.reducedMotion()?n.frame(o.bounds,!1,d,r.portraitOverviewCrop===!0,p):n.frameSoft(o.bounds,d,r.portraitOverviewCrop===!0,p);t.showSectionSeatLabels(null),a.requestRender()},f=()=>{h++,t.setSeatStepping(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),i.active&&(i.cancel(),n.resumeAfterFlight(o.focalWorld))},M=x=>{if(t.isDisposed()||!t.gpu())return Promise.resolve();let w=o.seats.idToIndex.get(x);if(w===void 0)return Promise.resolve();t.setNearFieldDetailEnabled(!0),r.onViewTargetChange?.(x),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 D=t.inSeatView()&&r.arriveAtSeatEye===!0;t.setSeatStepping(D),t.setSeatViewLocked(!1);let L=++h;D?t.showArriveChip(x,L):t.removeArriveChip();let{eye:R,focal:K}=t.resolvedSeatViewPose(x,w),H=r.arriveAtSeatEye?t.seatViewArrival(x,w):null,V=H?H.focal:K,Y=[n.camera.position.x,n.camera.position.y,n.camera.position.z],y=kt(Y,H?.eye??R,V,o.bounds.center,o.bounds.radius),S=H?H.eye:r.arriveAtSeatEye?R:y.finalPos,X=H?H.fov:r.arriveAtSeatEye?e.clientWidth/Math.max(1,e.clientHeight)<.7?nt:65:28,g=[y.waypoints[0],y.waypoints[1],S];if(l.setVisible(!1),t.reducedMotion())return t.setSeatStepping(!1),c(S,V,X),a.requestRender(),s.cinematicSkipped(),t.isDisposed()||n.syncFromCamera(),t.setSeatViewLocked(r.arriveAtSeatEye===!0),H&&t.enterSeatView(H.stops),t.showArriveChip(x,L),Promise.resolve();let z=new bi().copy(n.camera.quaternion),$=Zo(n.camera,S,V);a.requestRender();let U=D?700:2500;return i.start(g,z,$,U,X).then(()=>{t.isDisposed()||L!==h||(t.setSeatStepping(!1),s.cinematicPlayed(U),n.resumeAfterFlight(V),t.setSeatViewLocked(r.arriveAtSeatEye===!0),H&&t.enterSeatView(H.stops),a.requestRender(),t.showArriveChip(x,L))})},C=x=>{let w=o.sections.find(K=>K.id===x);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&&A(w.floorIndex),t.setNavigationMode("pan"),t.showSectionSeatLabels(x);let D=w.focalWorld[0]-w.center[0],L=w.focalWorld[2]-w.center[2],R=Math.hypot(D,L)>w.radius*.12?Math.atan2(D,L):void 0;return n.frame({center:w.center,radius:Math.max(5,w.radius*.5)},!1,R),r.onSectionFocusChange?.(x),a.requestRender(),!0},O=x=>{if(t.isDisposed()||!t.gpu())return!1;let w=o.seats.idToIndex.get(x);if(w===void 0)return!1;let D=w*3,L=[o.seats.iPosition[D],o.seats.iPosition[D+1]+.55,o.seats.iPosition[D+2]];return t.reducedMotion()?n.frame({center:L,radius:En},!1,void 0,!1,Rn):n.frameSoft({center:L,radius:En},void 0,!1,Rn),a.requestRender(),!0};return u.addEventListener("click",k),{overviewChip:u,layoutOverviewChip:F,flightGen:()=>h,focusedFloor:()=>b,applyFloorFocus:A,placeCameraFinal:c,cancelFlight:f,focusOverview:k,flyToSeat:M,focusSectionCamera:C,focusSeatCamera:O}}var En=4.5,Rn={polarDeg:48,margin:1.25};function Fn(t){let e=performance.now();return{model:Ve(t),buildMs:performance.now()-e,source:"main"}}function yi(t){let e=jt(t.doc);return{...Fn({...t,seats:e}),seats:e}}function Tn(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=d=>{i||(i=!0,clearTimeout(l),r.terminate(),n(d))},a=()=>s(e()),l=window.setTimeout(a,15e3);r.onerror=a,r.onmessage=d=>{let p=o(d.data);p?s(p):a()},r.postMessage(t)})}function xi(t){return Tn(t,()=>Fn(t),({model:e,buildMs:o})=>({model:e,buildMs:o,source:"worker"}))}function Si(t){return Tn(t,()=>yi(t),({model:e,buildMs:o,seats:r})=>r?{model:e,buildMs:o,seats:r,source:"worker"}:null)}var wi=Math.PI/180,Mi=6,Pi=500;function Ss(t,e,o={}){let r=performance.now(),n=e.prepared?.model??Ve(e),i=new at(o.onAnalytics),s=new Array(n.seats.count);for(let[m,v]of n.seats.idToIndex)s[v]=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 v=l.get(m.rowId);v?v.push(m.id):l.set(m.rowId,[m.id])}let d=new Map;for(let m of e.seats)d.set(m.id,m.sectionId);let p=new Map;for(let[m,v]of n.seats.idToIndex){let E=d.get(m);if(!E)continue;let W=p.get(E);W?W.push(v):p.set(E,[v])}let h=()=>{if(!c||!n.sectionSolidRanges.length)return;let{lit:m,anyUnlit:v}=Oo(n.sectionSolidRanges,p,n.seats.iState);c.setSectionShellLit(v?m:null)},b=e.doc.floors?.some(v=>(v.baseHeightM??0)>0)?!0:(e.doc.floors?.flatMap(v=>v.objects)??e.doc.objects).some(v=>v.type==="section"&&((v.height??0)>0||(v.rake??0)>0)),c=null,u=null,P=!1,F=!1,A=!1,k=new Map,f=null,M=null,C=null,O=new Map,x=null,w=()=>{C===null&&(C=t.style.zIndex,t.style.zIndex="20")},D=()=>{C!==null&&(t.style.zIndex==="20"&&(t.style.zIndex=C),C=null)},L=!1,R=()=>L?re.focusedFloor():-1,K=()=>{c=Go(y.gl,n),h(),u=new tt(y.renderer,c.seatGeometry,c.chairGeometry,c.solidGeometry,n.seats.count),y.setClearColor(n.theme.background.top),u.setRestoreClear(n.theme.background.top),c.seatProgram.uniforms.uSeatRadius.value=_e*n.theme.seatScale,c.seatProgram.uniforms.uFocusFloor.value=R(),c.solidProgram.uniforms.uFocusFloor.value=R(),c.chairProgram.uniforms.uFocusFloor.value=R(),c.screenProgram&&(c.screenProgram.uniforms.uFocusFloor.value=R()),V.forceRegather()},H=!1,V=new lt({model:n,orbit:()=>S,gpu:()=>c}),Y=m=>V.setDetailEnabled(m),y=new je(t,{onContextLost:()=>{A||i.contextLost(),P=!0,_.stop(),c=null,u=null},onContextRestored:()=>{K(),P=!1,A||i.contextRestored(),_.requestRender()}}),S=new Ke(y.gl,y.canvas,()=>_.requestRender(),()=>i.orbitEngaged());S.setAspect(y.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],v=n.focalWorld[2]-n.bounds.center[2];return Math.hypot(m,v)>n.bounds.radius*.12?Math.atan2(m,v):void 0})(),z=n.floors.length>1?{polarDeg:48,margin:1.1}:{margin:1.1},$=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;S.frame(n.bounds,!$&&o.skipInitialOverviewAnimation!==!0,g,o.portraitOverviewCrop===!0,z);let U=new ot(S.camera),ee=wn(t),Z=new Je(t,{fontFamily:e.doc.theme?.fontFamily,ink:e.doc.theme?.textColor,backgroundRgb:n.theme.background.top}),le=n.labels,oe=()=>oo(le,n.floors.length,R());Z.setLabels(oe());let J=null,I=m=>{if(J=m,Z.setForcedDense(!!m),!m){Z.setLabels(oe());return}let v=e.seats.filter(T=>T.sectionId===m),E=new Set(v.map(T=>T.id)),W=new Set(v.map(T=>T.rowId)),q=new Set(k.keys()),j=new Set(v.filter(T=>q.has(T.id)).map(T=>T.id)),te=oe().filter(T=>T.kind!=="row"&&T.kind!=="seat"||(T.kind==="row"?W.has(T.id.slice(4)):E.has(T.id.slice(5))&&(j.size===0||j.has(T.id.slice(5)))));if(n.seatCount<=6e3&&j.size===0){Z.setLabels(te);return}let ne=j.size?v.filter(T=>j.has(T.id)):v,ge=new Set(ne.map(T=>`seat:${T.id}`)),he=ne.flatMap(T=>{let ae=n.seats.idToIndex.get(T.id);if(ae===void 0)return[];let ce=ae*3;return[{id:`seat:${T.id}`,kind:"seat",text:q.has(T.id)?T.displayLabel||T.label:uo(T.displayLabel||T.label),anchor:[n.seats.iPosition[ce],n.seats.iPosition[ce+1]+(q.has(T.id)?1.05:.55),n.seats.iPosition[ce+2]]}]});Z.setLabels([...te.filter(T=>!ge.has(T.id)),...he])};K();let N=null,B=null,_=new Qe(m=>{if(P||!c||F)return!1;let v=yn({flying:U.active,panoramaMounted:f!==null,seatViewActive:N?.active===!0}),E=v==="cinematic"?U.update(performance.now()):v==="seatView"?N.update(performance.now()):v==="orbit"?S.update():!1;B?.syncZoomLimits();let W=R()>=0?n.floors[R()]:null,q=W?.radius??n.bounds.radius,j=yo(S.currentDistance,q),te=H?{center:[S.camera.position.x,S.camera.position.y,S.camera.position.z],radius:520}:n.renderBounds;S.updateClipping(te);let ne=W?.center??n.renderBounds.center,ge=W?.radius??n.renderBounds.radius,he=(ue,Ie)=>Math.hypot(S.camera.position.x-ue[0],S.camera.position.y-ue[1],S.camera.position.z-ue[2])<=Ie*(V.detailVisible?1.8:1.55),T=he(ne,ge);if(!T&&J){let ue=n.sections.find(Ie=>Ie.id===J);ue&&(T=he(ue.center,Math.max(12,ue.radius*2)))}V.detailVisible=T;let ae=c.seatProgram.uniforms;ae.uSeatScale.value=j.scale,ae.uSeatFade.value=j.fade;let ce=!!W&&xo(W.seatCount,y.canvas.clientWidth||1,y.canvas.clientHeight||1),We=So(n.seats.count,q,S.currentDistance,S.camera.fov,y.canvas.clientHeight||1),Te=V.detailVisible||ce||We?1:0,Ye=V.detailVisible||R()>=0||n.floors.length>1?1:0;return V.ease(m,Te,Ye),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*wi/2)/Math.max(1,y.pixelHeight),V.update(V.detailVisible),y.renderer.render({scene:c.background,clear:!0}),y.renderer.render({scene:c.main,camera:S.camera,clear:!1}),Z.update(S.camera.projectionViewMatrix,y.canvas.clientWidth||1,y.canvas.clientHeight||1,S.currentDistance,q,[S.camera.position.x,S.camera.position.y,S.camera.position.z]),E||V.seatDetailMix!==Te||V.structureDetailMix!==Ye}),G=typeof ResizeObserver<"u"?new ResizeObserver(()=>vt.resize()):null;G?.observe(t);let Q=m=>{let v=q=>{let j=n.seats.idToIndex.get(q);return j===void 0?void 0:n.seats.iState[j]},{updates:E,next:W}=Yo(k,m,v);if(k=W,Z.setSelectedSeatIds(k.keys()),J&&I(J),E.length){let q=xt(n.seats,E);c&&c.uploadSeatStateRuns(q),h(),_.requestRender()}},ve=()=>x!==null?x:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,ct=8,Bt=m=>{if(!o.getSeatView)return null;let v=O.get(m);if(!v)for(v=Promise.resolve(o.getSeatView(m)),O.set(m,v),v.catch(()=>{O.get(m)===v&&O.delete(m)});O.size>ct;){let E=O.keys().next().value;if(E===void 0)break;O.delete(E)}return v},Gt=un(n.stages,n.focalWorld,n.bounds.groundY??0),In=zt(Gt),ut=(m,v)=>{let E=a.get(m),W=Math.max(0,Math.round(n.seats.iFloor[v]??0)),q=e.doc.floors?.[W],j=n.floors[W],te=q?.focalPoint??e.doc.focalPoint,ne=j?{x:j.focalWorld[0]/Me,y:j.focalWorld[2]/Me}:te,ge=E?.focalPoint?{x:E.focalPoint.x+ne.x-te.x,y:E.focalPoint.y+ne.y-te.y}:ne,he=[n.seats.iPosition[v*3],n.seats.iPosition[v*3+1],n.seats.iPosition[v*3+2]];return en(he,ge,q?.baseHeightM??0,E?.eyeHeightM,In)},Ht=()=>(t.clientWidth||y.canvas.clientWidth)<=520,dt=null,Ut=null,_n=async(m,v,E)=>{if(!o.getSeatView||A||E!==re.flightGen())return;let W;try{W=await xn()}catch{if(i.panoramaFailed(m,"mount"),!A&&E===re.flightGen()){let q=pt(m,E,!0);requestAnimationFrame(()=>q?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(A||E!==re.flightGen()||!dt))return Ut??=W.createOpenPanorama(dt),Ut(m,v,E)},mt=Mn({container:t,model:n,opts:o,expandedSeatById:a,seatIdsByRow:l,isNarrow:Ht,isDisposed:()=>A,flightGen:()=>re.flightGen(),flyToSeat:m=>Xt(m),openPanorama:(m,v,E)=>_n(m,v,E)}),pt=mt.show,ht=mt.remove,Vn=mt.layout,be=Pn({container:t,orbit:S,isNarrow:Ht,enabled:o.chrome?.controlDock!==!1,...o.navLabels?{labels:o.navLabels}:{}});B=be;let Ln=be.element,De=be.setNavigationMode,kn=be.layout,On=be.utilityControls,Fe=null,Wt=!1,Ue=m=>{be.setSeatViewLocked(m),m||N?.exit()};N=gn({canvas:y.canvas,camera:S.camera,requestRender:()=>_.requestRender(),reducedMotion:ve,onStopChange:m=>{let v=m??(Wt?"seat":null);Fe=v;try{o.onSeatViewStopChange?.(v)}catch{}},onApplied:()=>{A||S.syncFromCamera()}});let zn=(m,v)=>{let{eye:E}=ut(m,v),W=(t.clientWidth||y.canvas.clientWidth||1)/Math.max(1,t.clientHeight||y.canvas.clientHeight||1),q=mn(E,Gt,W);if(o.seatViewStops===!1)return{...q,stops:[]};let j=d.get(m),te=j?n.sections.find(ne=>ne.id===j):void 0;return{...q,stops:pn(q,{aspect:W,section:te&&te.seatCount>0?{center:te.center,radius:te.radius}:null,venue:{center:n.bounds.center,radius:n.bounds.radius}})}},re=Dn({container:t,model:n,opts:o,orbit:S,cinematic:U,analytics:i,loop:_,labelOverlay:Z,stageAzimuth:g,overviewFraming:z,gpu:()=>c,isDisposed:()=>A,panorama:()=>f,setPanorama:m=>{f=m},setPanoramaSphereVisible:m=>{H=m},panoramaLoadAbort:()=>M,setPanoramaLoadAbort:m=>{M=m},setFrozen:m=>{F=m},restorePanoramaLayer:D,reducedMotion:ve,resolvedSeatViewPose:ut,showSectionSeatLabels:I,setNearFieldDetailEnabled:Y,setSeatViewLocked:Ue,setNavigationMode:De,showArriveChip:pt,removeArriveChip:ht,inSeatView:()=>Fe!==null,setSeatStepping:m=>{Wt=m},seatViewArrival:(m,v)=>o.arriveAtSeatEye?zn(m,v):null,enterSeatView:m=>N?.enter(m)});L=!0;let ft=re.overviewChip,Nn=re.layoutOverviewChip,Bn=re.applyFloorFocus,Gn=re.focusOverview,Yt=re.cancelFlight,Xt=re.flyToSeat,qt=re.focusSectionCamera;On.appendChild(ft),dt={container:t,model:n,opts:o,analytics:i,orbit:S,loop:_,seatsById:a,ensureSeatView:Bt,resolvedSeatViewPose:ut,gpu:()=>c,gl:y.gl,isContextLost:()=>P,isDisposed:()=>A,flightGen:()=>re.flightGen(),setPanorama:m=>{f=m},getLoadAbort:()=>M,setLoadAbort:m=>{M=m},setPanoramaSphereVisible:m=>{H=m,m&&N?.exit()},setFrozen:m=>{F=m},raisePanoramaLayer:w,restorePanoramaLayer:D,getOverviewChip:()=>ft,labelOverlay:Z,reducedMotion:ve,removeArriveChip:ht,showArriveChip:pt};let pe=Cn({glctx:y,orbit:S,model:n,seats:e.seats,opts:o,cinematic:U,analytics:i,seatIdByIndex:s,sectionIdBySeatId:d,tapSlop:Mi,tapMs:Pi,gpu:()=>c,pick:()=>u,seatViewLocked:()=>be.seatViewLocked(),focusedSectionId:()=>J,selection:()=>k,cancelFlight:Yt,focusSectionCamera:qt,focusSeatCamera:re.focusSeatCamera,setSelection:Q,ensureSeatView:Bt});y.canvas.addEventListener("pointerdown",pe.onDown),y.canvas.addEventListener("pointermove",pe.onMove),y.canvas.addEventListener("pointerup",pe.onUp),y.canvas.addEventListener("pointercancel",pe.onUp),_.requestRender();let vt={setAvailability(m){let v=Wo(k,m),E=xt(n.seats,v);E.length&&c&&c.uploadSeatStateRuns(E),h(),_.requestRender()},setSelection:Q,setNavigationMode:De,zoomIn(){S.zoomBy(Ce),_.requestRender()},zoomOut(){S.zoomBy(Le),_.requestRender()},flyToSeat:Xt,focusOverview:Gn,seatViewStop:()=>Fe,recentreSeatView:()=>N?.recentre()??!1,resize(){let{width:m,height:v}=y.resize();S.setAspect(m/Math.max(1,v)),Vn(),kn(),Nn(),_.requestRender()},stats(){return{..._.stats(),drawCalls:c?c.drawCalls:0,seatCount:n.seatCount}},getQualityEvidence(){let m=_.stats(),v=y.canvas.clientWidth||1,E=y.canvas.clientHeight||1,W=n.bounds.center,q=fe(S.camera.projectionViewMatrix,[W[0],n.bounds.box.min[1],W[2]],v,E),j=fe(S.camera.projectionViewMatrix,[W[0],n.bounds.box.max[1],W[2]],v,E),te=n.bounds.box,ne=[te.min[0],te.max[0]].flatMap(T=>[te.min[1],te.max[1]].flatMap(ae=>[te.min[2],te.max[2]].map(ce=>fe(S.camera.projectionViewMatrix,[T,ae,ce],v,E)))).filter(T=>Number.isFinite(T.x)&&Number.isFinite(T.y)&&Number.isFinite(T.depth)),ge=ne.length?(()=>{let T=Math.min(...ne.map(ye=>ye.x)),ae=Math.max(...ne.map(ye=>ye.x)),ce=Math.min(...ne.map(ye=>ye.y)),We=Math.max(...ne.map(ye=>ye.y)),Te=Math.max(0,T),Ye=Math.min(v,ae),ue=Math.max(0,ce),Ie=Math.min(E,We),Xe=Math.max(0,Ye-Te),bt=Math.max(0,Ie-ue);return{box:{x:Te,y:ue,width:Xe,height:bt},horizontalFillRatio:Xe/v,verticalFillRatio:bt/E,visibleAreaRatio:Xe*bt/(v*E),clippedEdges:[...ce<0?["top"]:[],...ae>v?["right"]:[],...We>E?["bottom"]:[],...T<0?["left"]:[]]}})():void 0,he=String(y.gl.getParameter(y.gl.VERSION)??"");return{viewport:{width:v,height:E},context:{webgl2:/webgl\s*2/i.test(he),lost:P},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:q.visible&&j.visible?Math.abs(q.y-j.y):0},labels:Z.qualityEvidence(),framing:ge,...Fe?{seatView:{fovDeg:S.camera.fov,stop:Fe}}:{}}},getQualityReport(){return Tt(vt.getQualityEvidence())},loseContextForTest(){y.simulateContextLossCycle()},floors(){return n.floors},focusFloor(m){if(m!==null&&!n.floors.some(E=>E.index===m))return!1;let v=m??-1;if(Y(m!==null),Ue(!1),Bn(v),De("orbit"),m===null)U.cancel(),ve()?S.frame(n.bounds,!1,g,o.portraitOverviewCrop===!0,z):S.frameSoft(n.bounds,g,o.portraitOverviewCrop===!0,z);else{let E=n.floors[m];if(E.seatCount>0){U.cancel();let W=E.focalWorld[0]-E.center[0],q=E.focalWorld[2]-E.center[2],j=Math.hypot(W,q)>E.radius*.12?Math.atan2(W,q):g;S.frame({center:E.center,radius:E.radius,box:E.box},!1,j,!1,{polarDeg:58,margin:1.12})}}return _.requestRender(),!0},zones(){return n.zones},focusZone(m){let v=n.zones.find(j=>j.id===m);if(!v||v.seatCount===0)return!1;Y(!1),Ue(!1),U.cancel(),De("orbit"),I(null),o.onSectionFocusChange?.(null);let E=v.focalWorld[0]-v.center[0],W=v.focalWorld[2]-v.center[2],q=Math.hypot(E,W)>v.radius*.12?Math.atan2(E,W):void 0;return S.frame({center:v.center,radius:v.radius*1.25},!1,q),_.requestRender(),!0},sections(){return n.sections},focusSection(m){return qt(m)},rows(m){return m?n.rows.filter(v=>v.sectionId===m):n.rows},seatsInRow(m){return e.seats.filter(v=>v.rowId===m).map(v=>({id:v.id,label:v.displayLabel||v.label}))},focusRow(m){let v=n.rows.find(E=>E.id===m);return!v||v.seatCount===0?!1:(Y(!0),Ue(!1),U.cancel(),De("pan"),v.sectionId&&(I(v.sectionId),o.onSectionFocusChange?.(v.sectionId)),S.frame({center:v.center,radius:Math.max(2.5,v.radius*.65)}),_.requestRender(),!0)},setReducedMotionForTest(m){x=m},dispose(){A=!0,ht(),ft.remove(),Ln.remove(),Yt(),N?.dispose(),_.stop(),Z.dispose(),G?.disconnect(),f&&(f.dispose(),f=null),D(),ee(),y.canvas.removeEventListener("pointerdown",pe.onDown),y.canvas.removeEventListener("pointermove",pe.onMove),y.canvas.removeEventListener("pointerup",pe.onUp),y.canvas.removeEventListener("pointercancel",pe.onUp),S.dispose(),u&&u.dispose(),c&&c.dispose(),c=null,u=null,y.dispose()}};return i.opened(n.seatCount,b,e.prepared?.buildMs??performance.now()-r,e.prepared?.source??"inline"),vt}export{cr as VENUE3D_QUALITY_REPORT_VERSION,Ve as buildSceneModel,Tt as inspectVenue3DQualityEvidence,Ss as mountVenue3D,xi as prepareVenue3D,Si as prepareVenue3DFromChart};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seatlayer/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.86.0",
|
|
4
4
|
"description": "SeatLayer's seat map rendering engine — the seating chart runtime behind @seatlayer/js and the React, Vue, and Angular SDKs.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": {
|
package/dist/chunk-APMDM2YC.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as V,t as m}from"./chunk-FQ2MMJMH.js";var te=3,I=4.5,T=3,O=24,ie=20;function F(t){return t.filter(a=>a.visible&&!!a.screenBox)}function y(t,a){return t.x<a.x+a.width&&t.x+t.width>a.x&&t.y<a.y+a.height&&t.y+t.height>a.y}function p(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function o(t,a,s){return s.length?{code:t,message:a,count:s.length,samples:s.slice(0,ie)}:null}function B(t,a,s){return{primaryId:t.seatId,primaryLabel:t.label,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function A(t,a,s){return{primaryId:t.id,primaryLabel:t.label,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function $(t,a,s){return{primaryId:t.objectId,primaryLabel:t.text,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function g(t,a,s,l){return{primaryId:t,primaryLabel:a,secondaryId:s,secondaryLabel:l}}function ne(t,a="overview",s=null){let l=F(t.labels),c=F(t.hierarchyLabels),d=F(t.freeTextLabels),f=F(t.rowLabels),P=t.gaAreas.filter(e=>e.visible),D=l.map(e=>m(e.ink,e.fill)??0),W=c.map(e=>m(e.ink,e.fill)??0),X=d.map(e=>m(e.ink,e.background)??0),Y=P.map(e=>m(e.effectiveBackground,t.canvasBackground)??0),u=s?t.labels.filter(e=>e.categoryKey===s):t.labels,v=s?t.gaAreas.filter(e=>e.categoryKey===s):t.gaAreas,h=u.filter(e=>e.selected),x=u.filter(e=>e.status==="held"),w=u.filter(e=>e.status==="booked"),R=u.filter(e=>e.pointerTarget.active),M=new Set([...t.labels.filter(e=>e.visible&&(e.opacity>.25||e.selected||e.status!=="free")).map(e=>e.categoryKey),...t.gaAreas.filter(e=>e.visible&&e.opacity>.1).map(e=>e.categoryKey)]),S=h.length?p(h.map(e=>m(e.selectionRingColor??t.selectionRingColor,e.fill)??0)):null,n=[],k=(e,i)=>Array.from({length:e},(b,L)=>({primaryId:`overview:${L+1}`,primaryLabel:i}));a==="overview"&&t.rung==="sections"&&(n.push(o("overview-section-category-paint","Section overview shells must use the neutral hierarchy palette, not category paint",k(t.overviewStyle.categoryPaintedSectionShells,"category-painted section shell"))),n.push(o("overview-category-detail-visible","Category-tinted section detail must wait until section focus or seat zoom",k(t.overviewStyle.visibleCategoryDetailOutlines,"category detail outline"))),n.push(o("overview-row-hints-visible","Row and seat patterns must not clutter the section overview",k(t.overviewStyle.visibleSectionRowHints,"section row hint"))),n.push(o("overview-availability-clutter","Live availability counts belong in focused detail, not on section overview shells",k(t.overviewStyle.visibleSectionAvailabilityLabels,"section availability label"))),n.push(o("overview-ga-detail-visible","Section-contained standing paint belongs in focused detail, not on section overview shells",k(t.overviewStyle.visibleSectionGADetails,"section-contained GA detail")))),n.push(o("bookable-label-undersized","Visible bookable labels must meet the rendered small-text size floor",l.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>B(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),n.push(o("bookable-label-viewport-clipped","Visible interaction labels must remain fully inside the buyer viewport",a==="interaction"?l.filter(e=>e.screenBox.x<0||e.screenBox.y<0||e.screenBox.x+e.screenBox.width>t.viewport.width||e.screenBox.y+e.screenBox.height>t.viewport.height).map(e=>B(e)):[])),n.push(o("row-label-viewport-clipped","Visible interaction row labels must remain fully inside the buyer viewport",a==="interaction"?f.flatMap((e,i)=>{let b=e.screenBox;return b.x<0||b.y<0||b.x+b.width>t.viewport.width||b.y+b.height>t.viewport.height?[{primaryId:`row-label-${i}`,primaryLabel:e.text}]:[]}):[]));let z=[];if(a==="interaction")for(let e=0;e<f.length;e+=1)for(let i=0;i<e;i+=1)y(f[e].screenBox,f[i].screenBox)&&z.push(g(`row-label-${i}`,f[i].text,`row-label-${e}`,f[e].text));if(n.push(o("row-label-collision","Visible interaction row labels must not overlap",z)),a==="interaction"){let e=u.length>0,i=v.length>0,b=e||i,L=v.filter(r=>r.visible),q=new Set([...u.flatMap(r=>r.sectionId?[r.sectionId]:[]),...v.flatMap(r=>r.sectionId?[r.sectionId]:[])]),J=new Set([...t.labels.map(r=>r.categoryKey),...t.gaAreas.map(r=>r.categoryKey)]),C=r=>r.screenCenter.x>=0&&r.screenCenter.x<=t.viewport.width&&r.screenCenter.y>=0&&r.screenCenter.y<=t.viewport.height;n.push(o("detail-rung-missing","Interaction evidence with bookable inventory must render the seat-detail rung",b&&t.rung!=="seats"?[{primaryId:"renderer",primaryLabel:t.rung}]:[])),n.push(o("detail-inventory-not-visible","Interaction evidence must frame at least one real bookable unit",b&&!u.some(C)&&!L.length?[{primaryId:"renderer",primaryLabel:"no target inventory in viewport"}]:[])),n.push(o("pointer-target-inactive","Interaction evidence must expose a live production pointer target",e&&!R.some(C)||!e&&i&&!L.some(r=>r.interactive)?[{primaryId:"renderer",primaryLabel:"no active pointer target in viewport"}]:[])),n.push(o("pointer-target-undersized","Every active production pointer target must reach at least 24 CSS pixels",R.filter(r=>C(r)&&r.pointerTarget.effectiveMinimumPx<O).map(r=>B(r,r.pointerTarget.effectiveMinimumPx,O)))),n.push(o("selected-state-missing","Interaction evidence must paint a selected unit and its renderer-owned ring",e&&(!h.length||!h.some(r=>t.selectionRingSeatIds.includes(r.seatId)))?[{primaryId:"renderer",primaryLabel:"selected state"}]:[])),n.push(o("selected-state-contrast-low","The selected-state ring must maintain 3:1 graphical contrast with the seat paint",h.length&&(S??0)<T?[{primaryId:h[0].seatId,primaryLabel:h[0].label,measured:Math.round((S??0)*100)/100,minimum:T}]:[])),n.push(o("held-state-missing","Interaction evidence must paint a held state when the floor has at least two status-managed units",u.length>=2&&!x.length?[{primaryId:"renderer",primaryLabel:"held state"}]:[])),n.push(o("booked-state-missing","Interaction evidence must paint a taken state when the floor has at least three status-managed units",u.length>=3&&!w.length?[{primaryId:"renderer",primaryLabel:"booked state"}]:[]));let Z=new Set(x.map(r=>`${r.fill.toLowerCase()}:${r.opacity}`)),ee=new Set(w.map(r=>`${r.fill.toLowerCase()}:${r.opacity}`));n.push(o("status-state-indistinct","Held and taken evidence must resolve to distinct renderer paint",x.length&&w.length&&[...Z].some(r=>ee.has(r))?[{primaryId:x[0].seatId,primaryLabel:x[0].label,secondaryId:w[0].seatId,secondaryLabel:w[0].label}]:[])),n.push(o("section-focus-missing","Interaction evidence must exercise section focus and its backdrop when section membership exists",q.size&&(!t.focusedSectionId||!t.focusBackdropVisible)?[{primaryId:"renderer",primaryLabel:"section focus"}]:[])),n.push(o("category-filter-missing","Interaction evidence must exercise a category filter when multiple categories exist",J.size>=2&&(!t.categoryFilterKeys||!t.categoryFilterKeys.length)?[{primaryId:"renderer",primaryLabel:"category filter"}]:[]));let E=t.labels.filter(r=>r.status==="free"&&!r.selected&&t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(r.categoryKey)),Q=t.gaAreas.filter(r=>t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(r.categoryKey));n.push(o("category-filter-ineffective","The active category filter must visibly dim excluded free inventory",(E.length||Q.length)&&!E.some(r=>r.opacity<=.25)&&!Q.some(r=>r.opacity<=.1)?[...E.map(r=>B(r,r.opacity)),...Q.map(r=>({primaryId:r.areaId,primaryLabel:r.label,measured:r.opacity}))]:[])),n.push(o("target-category-not-visible","A category-specific interaction scene must visibly paint its exact target category",s&&!M.has(s)?[{primaryId:s,primaryLabel:s}]:[])),n.push(o("target-category-filter-mismatch","A category-specific interaction scene must bind its filter to only the exact target category",s&&(t.categoryFilterKeys?.length!==1||t.categoryFilterKeys[0]!==s)?[{primaryId:s,primaryLabel:s}]:[]))}n.push(o("bookable-label-contrast-low","Visible bookable labels must meet 4.5:1 contrast against their actual paint",l.flatMap(e=>{let i=m(e.ink,e.fill)??0;return i<I?[B(e,i,I)]:[]})));let K=[];for(let e=0;e<l.length;e+=1)for(let i=0;i<e;i+=1)y(l[e].screenBox,l[i].screenBox)&&K.push(g(l[i].seatId,l[i].label,l[e].seatId,l[e].label));n.push(o("bookable-label-collision","Visible bookable labels must not overlap",K)),n.push(o("hierarchy-label-undersized","Visible section and zone labels must meet the rendered small-text size floor",c.filter(e=>e.renderedFontPx<(e.sizeFloorPx??V)).map(e=>A(e,e.renderedFontPx,e.sizeFloorPx??V)))),n.push(o("hierarchy-label-contrast-low","Visible section and zone labels must meet 4.5:1 contrast against their backing paint",c.flatMap(e=>{let i=m(e.ink,e.fill)??0;return i<I?[A(e,i,I)]:[]}))),n.push(o("hierarchy-label-viewport-clipped","Visible overview hierarchy labels must remain fully inside the buyer viewport",a==="overview"?c.filter(e=>e.screenBox.x<0||e.screenBox.y<0||e.screenBox.x+e.screenBox.width>t.viewport.width||e.screenBox.y+e.screenBox.height>t.viewport.height).map(e=>A(e)):[])),n.push(o("hierarchy-label-outside-section","Visible section labels must remain inside the filled section surface and outside holes",c.filter(e=>e.kind==="section"&&e.fitsContainer===!1).map(e=>A(e))));let _=[];for(let e=0;e<c.length;e+=1)for(let i=0;i<e;i+=1)y(c[e].screenBox,c[i].screenBox)&&_.push(g(c[i].id,c[i].label,c[e].id,c[e].label));n.push(o("hierarchy-label-collision","Visible hierarchy labels must not overlap each other",_));let G=[];for(let e of c)for(let i of l)y(e.screenBox,i.screenBox)&&G.push(g(e.id,e.label,i.seatId,i.label));n.push(o("hierarchy-bookable-collision","Visible hierarchy labels must not overlap bookable labels",G)),n.push(o("free-text-undersized","Visible chart text must meet the rendered small-text size floor",d.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>$(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),n.push(o("free-text-contrast-low","Visible chart text must meet 4.5:1 contrast against its measured background",d.flatMap(e=>{let i=m(e.ink,e.background)??0;return i<I?[$(e,i,I)]:[]})));let U=[];for(let e=0;e<d.length;e+=1)for(let i=0;i<e;i+=1)y(d[e].screenBox,d[i].screenBox)&&U.push(g(d[i].objectId,d[i].text,d[e].objectId,d[e].text));n.push(o("free-text-collision","Visible chart text labels must not overlap each other",U));let N=[];for(let e of d)for(let i of l)y(e.screenBox,i.screenBox)&&N.push(g(e.objectId,e.text,i.seatId,i.label));n.push(o("free-text-bookable-collision","Visible chart text must not overlap bookable labels",N));let j=[];for(let e of d)for(let i of c)y(e.screenBox,i.screenBox)&&j.push(g(e.objectId,e.text,i.id,i.label));n.push(o("free-text-hierarchy-collision","Visible chart text must not overlap hierarchy labels",j)),n.push(o("ga-contrast-low","Visible GA surfaces must maintain 3:1 graphical contrast with the canvas",P.flatMap(e=>{let i=m(e.effectiveBackground,t.canvasBackground)??0;return i<T?[{primaryId:e.areaId,primaryLabel:e.label,measured:Math.round(i*100)/100,minimum:T}]:[]})));let H=n.filter(e=>!!e);return{version:te,passed:H.length===0,state:a,targetCategoryKey:s,resolvedRules:["rendered-overview-label-size","rendered-overview-label-contrast","rendered-overview-label-collision","rendered-overview-hierarchy-viewport","rendered-overview-hierarchy-containment","rendered-overview-section-first-style","rendered-overview-ga-contrast",...a==="interaction"?["rendered-detail-label-viewport","rendered-detail-inventory","rendered-pointer-target","rendered-selected-held-taken-states","rendered-section-focus","rendered-category-filter"]:[]],viewport:t.viewport,canvasBackground:t.canvasBackground,effectiveScale:t.effectiveScale,rung:t.rung,inventory:{totalBookableUnits:t.totalBookableUnits,totalLabelledBookableUnits:t.totalLabelledBookableUnits,visibleBookableLabels:l.length,hiddenBookableLabels:t.hiddenLabels,visibleHierarchyLabels:c.length,visibleFreeTextLabels:d.length,visibleGAAreas:P.length},overviewStyle:t.overviewStyle,composition:{hierarchy:t.hierarchyLabels.filter(e=>e.role==="name").map(e=>({id:e.id,kind:e.kind,label:e.label,visible:e.visible})).sort((e,i)=>e.kind.localeCompare(i.kind)||e.id.localeCompare(i.id)),labelledObjects:t.freeTextLabels.map(e=>({objectId:e.objectId,kind:e.kind,text:e.text,visible:e.visible})).sort((e,i)=>e.objectId.localeCompare(i.objectId)||e.kind.localeCompare(i.kind)),gaAreas:t.gaAreas.map(e=>({areaId:e.areaId,label:e.label,categoryKey:e.categoryKey,...e.sectionId?{sectionId:e.sectionId}:{},visible:e.visible})).sort((e,i)=>e.areaId.localeCompare(i.areaId)),bookableSectionIds:[...new Set(t.labels.flatMap(e=>e.sectionId?[e.sectionId]:[]))].sort(),categoryKeys:[...new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)])].sort(),activeCategoryKeys:[...M].sort()},metrics:{minimumRenderedBookableLabelPx:p(l.map(e=>e.renderedFontPx)),minimumBookableLabelContrast:p(D),minimumRenderedHierarchyLabelPx:p(c.map(e=>e.renderedFontPx)),minimumHierarchyLabelContrast:p(W),minimumRenderedFreeTextPx:p(d.map(e=>e.renderedFontPx)),minimumFreeTextContrast:p(X),minimumGAContrast:p(Y),minimumEffectivePointerTargetPx:p(R.map(e=>e.pointerTarget.effectiveMinimumPx)),selectedRingContrast:S==null?null:Math.round(S*100)/100},interaction:{applicable:{detail:u.length>0||v.length>0,pointer:u.length>0||v.length>0,held:u.length>=2,booked:u.length>=3,sectionFocus:u.some(e=>!!e.sectionId)||v.some(e=>!!e.sectionId),categoryFilter:new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)]).size>=2},selectedUnits:h.length,heldUnits:x.length,bookedUnits:w.length,activePointerTargets:R.length,focusedSectionId:t.focusedSectionId,focusBackdropVisible:t.focusBackdropVisible,categoryFilterKeys:t.categoryFilterKeys},findings:H}}export{te as a,O as b,ne as c};
|
package/dist/chunk-FQ2MMJMH.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as A}from"./chunk-4I2VWFJY.js";import{c as p,k as x,n as T,t as M}from"./chunk-JBOTRSMY.js";var y=7,N=10,G=10,H=15,P=11,v=.85,b=12,u=4.5,I=3,o="#000000",i="#ffffff",Z=24,d=18.67;function w(t,n=400){return t>=Z||n>=700&&t>=d?I:u}function F(t,n){return t*n>=b}var X=24,m={wheelchair:"M7.8 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM8 7L10.5 7L10.5 15L8 15ZM8 12.5L18 12.5L18 15L8 15ZM16 15L18 15L18 18L16 18ZM5.5 16a5.5 5.5 0 1 0 11 0a5.5 5.5 0 1 0 -11 0zM8 16a3 3 0 1 1 6 0a3 3 0 1 1 -6 0z",companion:"M5.5 6.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM4.5 18.5L6 11.5L11 11.5L12.5 18.5ZM12.5 7.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM11.5 19L13 12.5L18 12.5L19.5 19Z","semi-ambulatory":"M8.3 3.8a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM9 6.2L12 6.6L11 13.5L8.6 13L9 6.2ZM8.6 13L11 13L9.5 21L7 21ZM10.4 13L12.6 13L13.6 21L11.2 21ZM11.2 7.2L14 8L14.6 9.6L11.9 8.9ZM14.4 6.8L15.9 6.8L16.4 21L14.8 21Z","designated-aisle":"M3 5L6 5L6 14L3 14ZM3 12L13 12L13 15L3 15ZM5 15L7 15L7 20L5 20ZM11 15L13 15L13 20L11 20ZM13 7L20 7L17 4L19 4L23 8.5L19 13L17 13L20 10L13 10Z","step-free":"M4 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM4.4 7L7.5 7L7.5 13L11 15L9.5 17L5 14L4.4 7ZM2 19L8 19L17 10L22 10L22 13L18 13L10 21L2 21Z",hearing:"M15.5 3.5C9 2.2 5.5 6 5.5 11.5C5.5 16 8 19.5 10.5 21C13.2 22.6 16.4 20.8 15.4 18C14.8 16.4 12.9 16.1 13 14C13.1 11.9 15.8 11.4 15.8 8.5C15.8 5.4 13 4 15.5 3.5Z",cart:"M5.5 6L18.5 6a2.5 2.5 0 0 1 2.5 2.5L21 15.5a2.5 2.5 0 0 1 -2.5 2.5L11 18L7 20.5L7.5 18L5.5 18a2.5 2.5 0 0 1 -2.5 -2.5L3 8.5a2.5 2.5 0 0 1 2.5 -2.5zM6.5 11L17.5 11L17.5 12.6L6.5 12.6zM6.5 14L17.5 14L17.5 15.6L6.5 15.6z","sign-language":"M7 11L17 11L17 18a2 2 0 0 1 -2 2L9 20a2 2 0 0 1 -2 -2zM7.6 5L9.4 5L9.4 12L7.6 12zM9.9 3.5L11.7 3.5L11.7 12L9.9 12zM12.3 3.5L14.1 3.5L14.1 12L12.3 12zM14.6 5L16.4 5L16.4 12L14.6 12zM7.2 12.5L5 10.2L6.4 8.9L8.6 11.2Z","low-vision":"M2.5 12C6 6 18 6 21.5 12C18 18 6 18 2.5 12ZM9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM17.5 3L19 3L19 6L17.5 6ZM19 4L22 4L22 5.5L19 5.5Z","sensory-friendly":"M4 11C4 5 7 2.5 12 2.5S20 5 20 11L17 11C17 7 15.5 5.5 12 5.5S7 7 7 11ZM3 10L8 10L8 19L5 19a2 2 0 0 1 -2 -2ZM16 10L21 10L21 17a2 2 0 0 1 -2 2L16 19ZM9 12L15 12L15 14L9 14ZM10 16L14 16L14 18L10 18Z","plus-size":"M9.4 4.3a2.6 2.6 0 1 0 5.2 0a2.6 2.6 0 1 0 -5.2 0zM5 20L4 13C4 10.5 7 9.5 12 9.5C17 9.5 20 10.5 20 13L19 20Z","lift-armrest":"M5 6L8 6L8 19L5 19zM5 16L18 16L18 19L5 19zM8 12L17 12L17 14.5L8 14.5zM14 7L16 7L16 12L14 12zM12 7L18 7L15 3Z"},K=m.wheelchair;function Y(t){if(!t?.length)return null;let n=t.includes("wheelchair")?"wheelchair":t[0];return m[n]??null}function D(t,n){return n.colorblind?O(n.canvasBackground):A(t)}function U(t){return/-(\d{1,5})$/.exec(t)?.[1]??t}var s=T;function V(t,n,r){let L=p(t),a=p(n);if(!L||!a)return n;let e=Math.max(0,Math.min(1,r));return`#${L.map((c,_)=>Math.round(c*e+a[_]*(1-e))).map(c=>c.toString(16).padStart(2,"0")).join("")}`}var $=3;function W(t){let n=s(i,t)??0,r=s(o,t)??0;return n>=u?i:r>=u&&M(t)||M(t)?o:i}function O(t){return M(t)?o:i}function E(t,n,r=u){let L=s(n,t);if(L!=null&&L>=r)return n;let a=s(o,t)??0,e=s(i,t)??0;return a===0&&e===0?n:a>=e?o:i}function j(t,n,r,L=u){return n??E(t,r,L)}var S=3;function Q(t){let n=s("#ffffff",t);if(n!=null&&n>=S)return"#ffffff";let r=s(o,t)??0,L=s(i,t)??0;return r===0&&L===0?"#ffffff":r>=L?o:i}var C=/^#[0-9a-f]{6}$/i;function h(t){let n=p(t);return n!=null&&x(n)>.5}var B="#e5e7eb",k="#273142";function q(t){return h(t)?B:k}function J(t,n,r=u){let L=C.test(t.trim()),a=t.trim().toLowerCase(),e=0,l=0,c=null;for(let f of n){if(!L||!C.test(f.trim()))continue;e+=1;let g=E(f,t,r);g.toLowerCase()!==a&&(l+=1,c=g)}return{total:e,overridden:l,status:e===0?"none":l===0?"applies":l===e?"overridden":"mixed",overrideInk:c}}export{y as a,N as b,G as c,H as d,P as e,v as f,b as g,u as h,I as i,o as j,i as k,w as l,F as m,X as n,m as o,K as p,Y as q,D as r,U as s,s as t,V as u,$ as v,W as w,O as x,E as y,j as z,Q as A,h as B,B as C,k as D,q as E,J as F};
|