@seatlayer/core 0.110.0 → 0.110.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/dist/ar-C5PA2DVE.js +1 -0
  2. package/dist/be-TMKSMYPN.js +1 -0
  3. package/dist/bg-V6HTEDUB.js +1 -0
  4. package/dist/ca-CTZMHWW4.js +1 -0
  5. package/dist/{categoryInventory-BfvwE3nC.d.cts → categoryInventory-BE1AThTx.d.cts} +1 -1
  6. package/dist/{categoryInventory-ClZ-68jI.d.ts → categoryInventory-DxciZQK_.d.ts} +1 -1
  7. package/dist/{chunk-6VOUTNRV.js → chunk-2VYFNNYC.js} +1 -1
  8. package/dist/{chunk-YE4NP3XB.js → chunk-3V32MDJI.js} +1 -1
  9. package/dist/chunk-4AGC7B64.js +1 -0
  10. package/dist/{chunk-ZYQXT5JP.js → chunk-5IADCFUU.js} +1 -1
  11. package/dist/{chunk-2JFCDE27.js → chunk-6CBJBESS.js} +1 -1
  12. package/dist/{chunk-WUNZCUE6.js → chunk-DLHW3UDD.js} +1 -1
  13. package/dist/{chunk-UUIZHJYL.js → chunk-GVVZR3YS.js} +1 -1
  14. package/dist/{chunk-MRLWH6RC.js → chunk-GWGWNBGU.js} +1 -1
  15. package/dist/chunk-JQBJZMLG.js +1 -0
  16. package/dist/{chunk-OJSGMXJS.js → chunk-NVAF2E7Q.js} +1 -1
  17. package/dist/{chunk-FBXZWNND.js → chunk-YRDOE3N7.js} +1 -1
  18. package/dist/{chunk-BNLANXXZ.js → chunk-ZY6WTPTI.js} +1 -1
  19. package/dist/core/chart-ops/index.cjs +1 -1
  20. package/dist/core/chart-ops/index.d.cts +6 -4
  21. package/dist/core/chart-ops/index.d.ts +6 -4
  22. package/dist/core/chart-ops/index.js +1 -1
  23. package/dist/core/inventory/index.d.cts +4 -4
  24. package/dist/core/inventory/index.d.ts +4 -4
  25. package/dist/core/inventory/index.js +1 -1
  26. package/dist/core/layout/index.d.cts +5 -5
  27. package/dist/core/layout/index.d.ts +5 -5
  28. package/dist/core/layout/index.js +1 -1
  29. package/dist/core/quality/index.cjs +1 -1
  30. package/dist/core/quality/index.d.cts +3 -3
  31. package/dist/core/quality/index.d.ts +3 -3
  32. package/dist/core/render-assets/index.cjs +1 -1
  33. package/dist/core/render-assets/index.d.cts +2 -2
  34. package/dist/core/render-assets/index.d.ts +2 -2
  35. package/dist/core/render-assets/index.js +1 -1
  36. package/dist/core/seatConfidence.d.cts +1 -1
  37. package/dist/core/seatConfidence.d.ts +1 -1
  38. package/dist/core/sections/index.d.cts +5 -5
  39. package/dist/core/sections/index.d.ts +5 -5
  40. package/dist/core/sections/index.js +1 -1
  41. package/dist/cs-FUDGOUFL.js +1 -0
  42. package/dist/cy-5RRARIAP.js +1 -0
  43. package/dist/da-PONPPWKY.js +1 -0
  44. package/dist/de-PKG7AAB5.js +1 -0
  45. package/dist/el-H7OFU4QQ.js +1 -0
  46. package/dist/es-QSW5IZ6U.js +1 -0
  47. package/dist/et-GTMPSS72.js +1 -0
  48. package/dist/{eventConfigurations-DsW5Mj2e.d.ts → eventConfigurations-Cdt-e0uD.d.ts} +1 -1
  49. package/dist/{eventConfigurations-dmn9FClw.d.cts → eventConfigurations-D0us5j0K.d.cts} +1 -1
  50. package/dist/fa-SGLTFGJF.js +1 -0
  51. package/dist/fi-7YTEAVDM.js +1 -0
  52. package/dist/fr-ECCQ24MZ.js +1 -0
  53. package/dist/he-YHMMDOX7.js +1 -0
  54. package/dist/hi-GRAQX2E6.js +1 -0
  55. package/dist/hr-MN33LRIJ.js +1 -0
  56. package/dist/hu-NW3SMQVM.js +1 -0
  57. package/dist/id-3OPRAUF7.js +1 -0
  58. package/dist/index.cjs +1 -1
  59. package/dist/index.d.cts +13 -13
  60. package/dist/index.d.ts +13 -13
  61. package/dist/index.js +1 -1
  62. package/dist/it-RYM74YWO.js +1 -0
  63. package/dist/ja-4NI6DG5D.js +1 -0
  64. package/dist/{ko-6YCWWHFQ.js → ko-C4F6UEMK.js} +1 -1
  65. package/dist/ku-DMSBMWTC.js +1 -0
  66. package/dist/{labeling-Bn41ByDd.d.ts → labeling-DXgkxMoi.d.ts} +1 -1
  67. package/dist/{labeling-BmEjVxFt.d.cts → labeling-eYKVPLMb.d.cts} +1 -1
  68. package/dist/localeLoaders-G3GCGLPW.js +1 -0
  69. package/dist/lt-3EXKKZFG.js +1 -0
  70. package/dist/lv-4EWNRDCG.js +1 -0
  71. package/dist/ms-7LJBSAEJ.js +1 -0
  72. package/dist/nl-GWTIWXRW.js +1 -0
  73. package/dist/no-T3FW2WLX.js +1 -0
  74. package/dist/pl-OG5OBRHR.js +1 -0
  75. package/dist/pt-YQ6VES5R.js +1 -0
  76. package/dist/{renderedQuality-MDkNe8GA.d.ts → renderedQuality-Dzo2_8f4.d.ts} +1 -1
  77. package/dist/{renderedQuality-Bt2d0uq1.d.cts → renderedQuality-Frgw6jdx.d.cts} +1 -1
  78. package/dist/{renderer-DH0yI32q.d.cts → renderer-DM2sv1un.d.cts} +1 -1
  79. package/dist/{renderer-BJrpMV6U.d.ts → renderer-DuieD7jP.d.ts} +1 -1
  80. package/dist/ro-VK5MASYF.js +1 -0
  81. package/dist/ru-YU5CYR6T.js +1 -0
  82. package/dist/{seatTypeIcons-CG_Uzpaw.d.ts → seatTypeIcons-Bz0OJtEi.d.ts} +1 -1
  83. package/dist/{seatTypeIcons-Ck7oEFei.d.cts → seatTypeIcons-Cm8tjLYl.d.cts} +1 -1
  84. package/dist/{sections-C-UAqr1x.d.ts → sections-Bf_DV0oG.d.ts} +1 -1
  85. package/dist/{sections-C8HApYxd.d.cts → sections-PbQiqN0i.d.cts} +1 -1
  86. package/dist/{segmentedRowModel-DR1w9M13.d.ts → segmentedRowModel-CO7DD803.d.ts} +1 -1
  87. package/dist/{segmentedRowModel-CeoMsBnt.d.cts → segmentedRowModel-Co9LqS4i.d.cts} +1 -1
  88. package/dist/sk-CE7PXAYL.js +1 -0
  89. package/dist/sl-EYUPV4BG.js +1 -0
  90. package/dist/sr-PPXCN4IK.js +1 -0
  91. package/dist/sv-WR2BJBCJ.js +1 -0
  92. package/dist/{tableSizing-RRmpxOXl.d.ts → tableSizing-BDePQyPD.d.ts} +3 -3
  93. package/dist/{tableSizing-Bz-hxLza.d.cts → tableSizing-C6EjKNnk.d.cts} +3 -3
  94. package/dist/th-JUB2DODR.js +1 -0
  95. package/dist/{ticketRestrictions-lq4dH4k6.d.cts → ticketRestrictions-CgYwHQOf.d.cts} +2 -2
  96. package/dist/{ticketRestrictions-C7KUrulv.d.ts → ticketRestrictions-D5wgOq4P.d.ts} +2 -2
  97. package/dist/tr-GFHA7FT6.js +1 -0
  98. package/dist/{types-DM-OneoD.d.ts → types-CGOr0BpE.d.cts} +40 -16
  99. package/dist/{types-DM-OneoD.d.cts → types-CGOr0BpE.d.ts} +40 -16
  100. package/dist/uk-3FTS2SRK.js +1 -0
  101. package/dist/vi-7OTXPOQV.js +1 -0
  102. package/dist/view3d/crossfade/panorama.d.cts +1 -1
  103. package/dist/view3d/crossfade/panorama.d.ts +1 -1
  104. package/dist/view3d/index.cjs +410 -169
  105. package/dist/view3d/index.d.cts +100 -4
  106. package/dist/view3d/index.d.ts +100 -4
  107. package/dist/view3d/index.js +408 -167
  108. package/dist/view3d/scene/scene.worker.cjs +1 -1
  109. package/dist/view3d/scene/scene.worker.js +1 -1
  110. package/dist/zh-Hans-FD4XNYUA.js +1 -0
  111. package/dist/zh-Hant-7TXVJKJQ.js +1 -0
  112. package/package.json +1 -1
  113. package/dist/ar-O3RHQRH3.js +0 -1
  114. package/dist/be-SXFCG3F5.js +0 -1
  115. package/dist/bg-W7YBNYB2.js +0 -1
  116. package/dist/ca-FA7WHACR.js +0 -1
  117. package/dist/chunk-4N5CHKHD.js +0 -1
  118. package/dist/chunk-4QQG5EEP.js +0 -1
  119. package/dist/cs-RR3VIKRC.js +0 -1
  120. package/dist/cy-U4JJ5C47.js +0 -1
  121. package/dist/da-ATULGB2M.js +0 -1
  122. package/dist/de-VB543CPC.js +0 -1
  123. package/dist/el-7Y2KXU6N.js +0 -1
  124. package/dist/es-GUV5XIYC.js +0 -1
  125. package/dist/et-SZ6I4Z44.js +0 -1
  126. package/dist/fa-FM6ELEN7.js +0 -1
  127. package/dist/fi-6QQ2M5JI.js +0 -1
  128. package/dist/fr-2SEQSVLR.js +0 -1
  129. package/dist/he-V3EVB7IW.js +0 -1
  130. package/dist/hi-I4QIBK5Q.js +0 -1
  131. package/dist/hr-I5DNEVUU.js +0 -1
  132. package/dist/hu-KTFWBQMF.js +0 -1
  133. package/dist/id-RZWUH426.js +0 -1
  134. package/dist/it-CNQP36V4.js +0 -1
  135. package/dist/ja-JQZOYIHI.js +0 -1
  136. package/dist/ku-33PM4OWG.js +0 -1
  137. package/dist/localeLoaders-VFQOZMUH.js +0 -1
  138. package/dist/lt-24JO2B7V.js +0 -1
  139. package/dist/lv-HTSDEEAB.js +0 -1
  140. package/dist/ms-PUEZJJ3R.js +0 -1
  141. package/dist/nl-NQPDRSCW.js +0 -1
  142. package/dist/no-3N3MUMSA.js +0 -1
  143. package/dist/pl-YHBEO6ZF.js +0 -1
  144. package/dist/pt-5RPESNZB.js +0 -1
  145. package/dist/ro-XDFXIMHX.js +0 -1
  146. package/dist/ru-BIIALOM5.js +0 -1
  147. package/dist/sk-LHSFRUFT.js +0 -1
  148. package/dist/sl-MPE5TPI3.js +0 -1
  149. package/dist/sr-T3N67KTP.js +0 -1
  150. package/dist/sv-LJWWYUIY.js +0 -1
  151. package/dist/th-E5POGG37.js +0 -1
  152. package/dist/tr-2DCWQ2CY.js +0 -1
  153. package/dist/uk-C3VJP6EA.js +0 -1
  154. package/dist/vi-XVMTKCOL.js +0 -1
  155. package/dist/zh-Hans-RG4CQGBY.js +0 -1
  156. package/dist/zh-Hant-YHNTYPFS.js +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";var nd=Object.create;var Co=Object.defineProperty;var od=Object.getOwnPropertyDescriptor;var rd=Object.getOwnPropertyNames;var id=Object.getPrototypeOf,ad=Object.prototype.hasOwnProperty;var Un=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(o){throw n=[o],o}};var qa=(e,t)=>{for(var n in t)Co(e,n,{get:t[n],enumerable:!0})},Qa=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of rd(t))!ad.call(e,r)&&r!==n&&Co(e,r,{get:()=>t[r],enumerable:!(o=od(t,r))||o.enumerable});return e};var ft=(e,t,n)=>(n=e!=null?nd(id(e)):{},Qa(t||!e||!e.__esModule?Co(n,"default",{value:e,enumerable:!0}):n,e)),sd=e=>Qa(Co({},"__esModule",{value:!0}),e);function Dx(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0?0:Math.ceil(e*t*4*(4/3))}function Nx(e){return(e!==void 0&&e<=2?32:e!==void 0&&e>=8?192:96)*1024*1024}function Tr(e){let t=typeof navigator>"u"?void 0:navigator;return{saveData:t?.connection?.saveData===!0,maxTextureSize:e,maxDecodedBytes:Nx(t?.deviceMemory)}}function Lr(e,t={}){let n=e.previewUrl?.trim();if(!n||n===e.url)return{initialUrl:e.url,initialWidth:e.sourceWidth,initialHeight:e.sourceHeight,reason:"full-only"};let o={initialUrl:n,initialWidth:e.previewWidth,initialHeight:e.previewHeight};if(t.saveData)return{...o,reason:"save-data"};let r=[...e.variants??[],...e.sourceWidth!==void 0&&e.sourceHeight!==void 0?[{url:e.url,width:e.sourceWidth,height:e.sourceHeight}]:[]].filter(c=>c.url.trim()&&c.url!==n&&Number.isFinite(c.width)&&c.width>0&&Number.isFinite(c.height)&&c.height>0).sort((c,l)=>c.width*c.height-l.width*l.height);if(!r.length)return{...o,upgradeUrl:e.url,reason:"progressive"};let i=r.filter(c=>t.maxTextureSize===void 0||Math.max(c.width,c.height)<=t.maxTextureSize);if(!i.length)return{...o,reason:"texture-limit"};let a=i.filter(c=>t.maxDecodedBytes===void 0||Dx(c.width,c.height)<=t.maxDecodedBytes);if(!a.length)return{...o,reason:"memory-limit"};let s=a[a.length-1];return{...o,upgradeUrl:s.url,reason:"progressive"}}function yf(){return new DOMException("Panorama image load aborted","AbortError")}function Po(e,t){return new Promise((n,o)=>{if(t?.aborted){o(yf());return}let r=new Image;r.crossOrigin="anonymous";let i=!1,a=()=>{r.onload=null,r.onerror=null,t?.removeEventListener("abort",c)},s=l=>{i||(i=!0,a(),l?o(l):n(r))},c=()=>{r.src="",s(yf())};r.onload=()=>{(typeof r.decode=="function"?r.decode():Promise.resolve()).then(()=>s(),()=>s())},r.onerror=()=>s(new Error("panorama_image_failed")),t?.addEventListener("abort",c,{once:!0}),r.src=e})}function kr(e){let t=globalThis;if(t.requestIdleCallback){let o=t.requestIdleCallback(e,{timeout:1200});return()=>t.cancelIdleCallback?.(o)}let n=globalThis.setTimeout(e,32);return()=>globalThis.clearTimeout(n)}var Ca=Un(()=>{"use strict"});function xf(e){if(e.generated||e.mediaKind==="model")return"built from the chart";let t=e.mediaKind==="demo-render",n=t?e.coverage==="exact-seat"?"AI-generated exact-seat demo":e.coverage==="row-representative"?"AI-generated representative row demo":e.coverage==="section-representative"?"AI-generated representative section demo":e.coverage==="floor-representative"?"AI-generated representative floor demo":"AI-generated illustrative venue demo":e.coverage==="exact-seat"?"Exact seat photo":e.coverage==="row-representative"?"Representative row view":e.coverage==="section-representative"?"Representative section view":e.coverage==="floor-representative"?"Representative floor view":e.coverage==="venue-representative"?"Representative venue view":"Venue photo",o=e.capturedAt&&/^\d{4}/.test(e.capturedAt)?e.capturedAt.slice(0,4):"";return[n,o?`${t?"created":"captured"} ${o}`:"",e.sourceLabel??""].filter(Boolean).join(" \xB7 ")}function _a(e){return Math.max(Bx,Math.min(Vx,e))}function Gx(e,t,n){let o=(.5+e/360)*n;return t/2-o}function Hx(e,t=Fr){return e*(180/t)}function gf(e,t,n){return(e-t)/2+Or(n,t)}function Or(e,t){let n=vt/180*t;return Math.max(-n,Math.min(n,e))}function zx(){if(typeof window>"u")return!1;try{if(typeof window.matchMedia=="function"&&window.matchMedia("(pointer: coarse)").matches)return!0}catch{}return"ontouchstart"in window}function Ta(e){return e||(zx()?"Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close":"Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function Mf(e,t,n={}){let o=n.fadeMs??400,r=t.initialBearingDeg??0,i=Lr(t,Tr()),a=new AbortController,s=()=>a.abort();n.signal?.addEventListener("abort",s,{once:!0});let c=document.createElement("div"),l=document.activeElement instanceof HTMLElement?document.activeElement:null;c.setAttribute("role","dialog"),c.setAttribute("aria-modal","true"),c.setAttribute("aria-label",n.seatLabel?`View from ${n.seatLabel}`:"View from seat"),c.tabIndex=-1,Object.assign(c.style,{position:"absolute",inset:"0",zIndex:"10",opacity:"0",transition:`opacity ${o}ms ease`,background:"#05070c",overflow:"hidden",touchAction:"none"});let u=document.createElement("div");Object.assign(u.style,{position:"absolute",inset:"0",backgroundImage:`url("${i.initialUrl}")`,backgroundRepeat:"repeat-x",cursor:"grab"}),c.appendChild(u);let m=document.createElement("button");if(m.type="button",m.setAttribute("aria-label","Close"),m.textContent="\u2715",Object.assign(m.style,{position:"absolute",top:"12px",right:"12px",zIndex:"2",width:"44px",height:"44px",borderRadius:"999px",cursor:"pointer",border:"1px solid rgba(255,255,255,0.25)",background:"rgba(8,12,18,0.6)",color:"#e6edf3",fontSize:"15px",lineHeight:"1"}),c.appendChild(m),n.disclosure){let G=document.createElement("div");G.textContent=`${n.disclosurePrefix??"360\xB0 panorama"} \xB7 ${n.disclosure}`,Object.assign(G.style,{position:"absolute",top:"calc(12px + var(--sl-3d-top-inset, 0px))",left:"12px",zIndex:"2",maxWidth:"calc(100% - 88px)",padding:"8px 11px",borderRadius:"999px",overflow:"hidden",color:"#dce6f8",background:"rgba(8,12,18,0.68)",font:"600 11px/1.2 ui-sans-serif, system-ui, sans-serif",textOverflow:"ellipsis",whiteSpace:"nowrap",pointerEvents:"none",backdropFilter:"blur(6px)"}),c.appendChild(G)}let f=document.createElement("div");f.textContent=Ta(n.lookAroundHint),Object.assign(f.style,{position:"absolute",bottom:"12px",left:"0",right:"0",textAlign:"center",color:"rgba(230,237,243,0.7)",font:"12px ui-sans-serif, system-ui, sans-serif",pointerEvents:"none"}),c.appendChild(f),e.appendChild(c),m.focus({preventScroll:!0});let d=0,h=0,p=0,b=0,y=Fr,M=()=>{let G=c.clientHeight||1,U=c.clientWidth||1,q=x.naturalWidth||U*2,$=x.naturalHeight||G,te=d>0?(U/2-p)/d:0,Q=h>0?b/h:0;h=Hx(G,y),d=h*(q/$),u.style.backgroundSize=`${d}px ${h}px`,S?p=U/2-te*d:(p=Gx(r,U,d),b=Or((t.initialPitchDeg??0)/180*h,h),S=!0),b=Or(Q*h,h),u.style.backgroundPosition=`${p}px ${gf(G,h,b)}px`},S=!1,A=()=>{let G=c.clientHeight||1;b=Or(b,h),u.style.backgroundPosition=`${p}px ${gf(G,h,b)}px`},x=new Image;x.onload=M,x.src=i.initialUrl;let g=()=>{};i.upgradeUrl&&(g=kr(()=>{(t.resolveUrl?t.resolveUrl(i.upgradeUrl):Promise.resolve(i.upgradeUrl)).then(U=>!U||a.signal.aborted?null:Po(U,a.signal).then(q=>({full:q,url:U}))).then(U=>{U&&(H||a.signal.aborted||(x=U.full,u.style.backgroundImage=`url("${U.url}")`,M()))}).catch(()=>{})})),requestAnimationFrame(M);let w=!1,v=0,P=0,R=0,k=new Map,F=()=>{let[G,U]=[...k.values()];return G&&U?Math.hypot(G.x-U.x,G.y-U.y):0},E=G=>{let U=_a(G);U!==y&&(y=U,M())},I=G=>{k.set(G.pointerId,{x:G.clientX,y:G.clientY}),w=k.size===1,v=G.clientX,P=G.clientY,k.size===2&&(R=F()),u.style.cursor="grabbing";try{u.setPointerCapture?.(G.pointerId)}catch{}},C=G=>{if(k.has(G.pointerId)){if(k.set(G.pointerId,{x:G.clientX,y:G.clientY}),k.size>=2){let U=F();R>0&&U>0&&E(y*(R/U)),R=U,w=!1;return}w&&(p+=G.clientX-v,b+=G.clientY-P,v=G.clientX,P=G.clientY,A())}},L=G=>{k.delete(G.pointerId),R=k.size===2?F():0;let U=k.values().next().value;w=k.size===1,U?(v=U.x,P=U.y):u.style.cursor="grab";try{u.releasePointerCapture?.(G.pointerId)}catch{}},N=G=>{G.preventDefault(),E(y+G.deltaY*.04)};u.addEventListener("pointerdown",I),u.addEventListener("pointermove",C),u.addEventListener("pointerup",L),u.addEventListener("pointercancel",L),u.addEventListener("wheel",N,{passive:!1});let O=!1,H=!1,j=0,V=()=>{u.removeEventListener("pointerdown",I),u.removeEventListener("pointermove",C),u.removeEventListener("pointerup",L),u.removeEventListener("pointercancel",L),u.removeEventListener("wheel",N),window.removeEventListener("keydown",D)},T=()=>{g(),a.abort(),n.signal?.removeEventListener("abort",s),j&&(window.clearTimeout(j),j=0),V(),c.parentNode&&c.parentNode.removeChild(c),l?.isConnected&&l.focus({preventScroll:!0})},B=()=>{if(O)return;O=!0,c.style.opacity="0";let G=()=>{j=0,!H&&(T(),n.onClose?.())};j=window.setTimeout(G,o)},D=G=>{if(G.key==="Tab"){G.preventDefault(),m.focus({preventScroll:!0});return}if(G.key==="Escape"){G.stopPropagation(),B();return}if(G.key==="ArrowLeft"||G.key==="ArrowRight")p+=G.key==="ArrowLeft"?-32:32;else if(G.key==="ArrowUp"||G.key==="ArrowDown")b+=(G.key==="ArrowUp"?4:-4)*(h/180);else if(G.key==="+"||G.key==="="){E(y-5),G.preventDefault();return}else if(G.key==="-"){E(y+5),G.preventDefault();return}else return;G.preventDefault(),A()};return window.addEventListener("keydown",D),m.addEventListener("click",B),requestAnimationFrame(()=>{c.style.opacity="1"}),{close:B,dispose(){O=!0,H=!0,T()}}}var Fr,Bx,Vx,vt,Dr=Un(()=>{"use strict";Ca();Fr=70,Bx=35,Vx=90;vt=35});function Xx(e=Ux,t=jx,n=Wx){let o=e+1,r=t+1,i=o*r,a=new Float32Array(i*3),s=new Float32Array(i*2);for(let u=0;u<r;u++){let m=u/t,f=m*Math.PI,d=Math.sin(f),h=Math.cos(f);for(let p=0;p<o;p++){let b=p/e,y=(b-.5)*Math.PI*2,M=u*o+p;a[M*3]=n*d*Math.sin(y),a[M*3+1]=n*h,a[M*3+2]=-n*d*Math.cos(y),s[M*2]=b,s[M*2+1]=m}}let c=new Uint16Array(e*t*6),l=0;for(let u=0;u<t;u++)for(let m=0;m<e;m++){let f=u*o+m,d=f+o;c[l++]=f,c[l++]=d,c[l++]=f+1,c[l++]=f+1,c[l++]=d,c[l++]=d+1}return{position:a,uv:s,index:c}}function vf(e,t){let n=e*Math.PI/180,o=t*Math.PI/180,r=Math.cos(o);return[r*Math.sin(n),Math.sin(o),-r*Math.cos(n)]}function Sf(e,t){let{position:n,uv:o,index:r}=Xx(),i=new Gt.Geometry(e,{position:{size:3,data:n},uv:{size:2,data:o},index:{data:r}}),a=new Gt.Texture(e,{image:t,wrapS:e.CLAMP_TO_EDGE,wrapT:e.CLAMP_TO_EDGE,generateMipmaps:!0,flipY:!1}),s=new Gt.Program(e,{vertex:Yx,fragment:Kx,uniforms:{uPano:{value:a},uOpacity:{value:0}},transparent:!0,depthTest:!1,depthWrite:!1}),c=new Gt.Mesh(e,{geometry:i,program:s});return{mesh:c,setOpacity(l){s.uniforms.uOpacity.value=Math.max(0,Math.min(1,l))},setImage(l){a.image=l,a.needsUpdate=!0},dispose(){c.setParent(null),i.remove(),a.texture&&e.deleteTexture(a.texture),s.remove()}}}var Gt,Ux,jx,Wx,Yx,Kx,wf=Un(()=>{"use strict";Gt=require("ogl"),Ux=64,jx=32,Wx=500;Yx=`#version 300 es
1
+ "use strict";var _d=Object.create;var nr=Object.defineProperty;var Cd=Object.getOwnPropertyDescriptor;var Td=Object.getOwnPropertyNames;var Ld=Object.getPrototypeOf,kd=Object.prototype.hasOwnProperty;var uo=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(o){throw n=[o],o}};var Ws=(e,t)=>{for(var n in t)nr(e,n,{get:t[n],enumerable:!0})},Xs=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Td(t))!kd.call(e,r)&&r!==n&&nr(e,r,{get:()=>t[r],enumerable:!(o=Cd(t,r))||o.enumerable});return e};var Et=(e,t,n)=>(n=e!=null?_d(Ld(e)):{},Xs(t||!e||!e.__esModule?nr(n,"default",{value:e,enumerable:!0}):n,e)),Od=e=>Xs(nr({},"__esModule",{value:!0}),e);function u2(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0?0:Math.ceil(e*t*4*(4/3))}function m2(e){return(e!==void 0&&e<=2?32:e!==void 0&&e>=8?192:96)*1024*1024}function ui(e){let t=typeof navigator>"u"?void 0:navigator;return{saveData:t?.connection?.saveData===!0,maxTextureSize:e,maxDecodedBytes:m2(t?.deviceMemory)}}function mi(e,t={}){let n=e.previewUrl?.trim();if(!n||n===e.url)return{initialUrl:e.url,initialWidth:e.sourceWidth,initialHeight:e.sourceHeight,reason:"full-only"};let o={initialUrl:n,initialWidth:e.previewWidth,initialHeight:e.previewHeight};if(t.saveData)return{...o,reason:"save-data"};let r=[...e.variants??[],...e.sourceWidth!==void 0&&e.sourceHeight!==void 0?[{url:e.url,width:e.sourceWidth,height:e.sourceHeight}]:[]].filter(c=>c.url.trim()&&c.url!==n&&Number.isFinite(c.width)&&c.width>0&&Number.isFinite(c.height)&&c.height>0).sort((c,l)=>c.width*c.height-l.width*l.height);if(!r.length)return{...o,upgradeUrl:e.url,reason:"progressive"};let i=r.filter(c=>t.maxTextureSize===void 0||Math.max(c.width,c.height)<=t.maxTextureSize);if(!i.length)return{...o,reason:"texture-limit"};let a=i.filter(c=>t.maxDecodedBytes===void 0||u2(c.width,c.height)<=t.maxDecodedBytes);if(!a.length)return{...o,reason:"memory-limit"};let s=a[a.length-1];return{...o,upgradeUrl:s.url,reason:"progressive"}}function Uh(){return new DOMException("Panorama image load aborted","AbortError")}function qo(e,t){return new Promise((n,o)=>{if(t?.aborted){o(Uh());return}let r=new Image;r.crossOrigin="anonymous";let i=!1,a=()=>{r.onload=null,r.onerror=null,t?.removeEventListener("abort",c)},s=l=>{i||(i=!0,a(),l?o(l):n(r))},c=()=>{r.src="",s(Uh())};r.onload=()=>{(typeof r.decode=="function"?r.decode():Promise.resolve()).then(()=>s(),()=>s())},r.onerror=()=>s(new Error("panorama_image_failed")),t?.addEventListener("abort",c,{once:!0}),r.src=e})}function fi(e){let t=globalThis;if(t.requestIdleCallback){let o=t.requestIdleCallback(e,{timeout:1200});return()=>t.cancelIdleCallback?.(o)}let n=globalThis.setTimeout(e,32);return()=>globalThis.clearTimeout(n)}var ws=uo(()=>{"use strict"});function Wh(e){if(e.generated||e.mediaKind==="model")return"built from the chart";let t=e.mediaKind==="demo-render",n=t?e.coverage==="exact-seat"?"AI-generated exact-seat demo":e.coverage==="row-representative"?"AI-generated representative row demo":e.coverage==="section-representative"?"AI-generated representative section demo":e.coverage==="floor-representative"?"AI-generated representative floor demo":"AI-generated illustrative venue demo":e.coverage==="exact-seat"?"Exact seat photo":e.coverage==="row-representative"?"Representative row view":e.coverage==="section-representative"?"Representative section view":e.coverage==="floor-representative"?"Representative floor view":e.coverage==="venue-representative"?"Representative venue view":"Venue photo",o=e.capturedAt&&/^\d{4}/.test(e.capturedAt)?e.capturedAt.slice(0,4):"";return[n,o?`${t?"created":"captured"} ${o}`:"",e.sourceLabel??""].filter(Boolean).join(" \xB7 ")}function Ps(e){return Math.max(f2,Math.min(h2,e))}function d2(e,t,n){let o=(.5+e/360)*n;return t/2-o}function p2(e,t=di){return e*(180/t)}function jh(e,t,n){return(e-t)/2+hi(n,t)}function hi(e,t){let n=Nt/180*t;return Math.max(-n,Math.min(n,e))}function b2(){if(typeof window>"u")return!1;try{if(typeof window.matchMedia=="function"&&window.matchMedia("(pointer: coarse)").matches)return!0}catch{}return"ontouchstart"in window}function As(e){return e||(b2()?"Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close":"Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function Xh(e,t,n={}){let o=n.fadeMs??400,r=t.initialBearingDeg??0,i=mi(t,ui()),a=new AbortController,s=()=>a.abort();n.signal?.addEventListener("abort",s,{once:!0});let c=document.createElement("div"),l=document.activeElement instanceof HTMLElement?document.activeElement:null;c.setAttribute("role","dialog"),c.setAttribute("aria-modal","true"),c.setAttribute("aria-label",n.seatLabel?`View from ${n.seatLabel}`:"View from seat"),c.tabIndex=-1,Object.assign(c.style,{position:"absolute",inset:"0",zIndex:"10",opacity:"0",transition:`opacity ${o}ms ease`,background:"#05070c",overflow:"hidden",touchAction:"none"});let u=document.createElement("div");Object.assign(u.style,{position:"absolute",inset:"0",backgroundImage:`url("${i.initialUrl}")`,backgroundRepeat:"repeat-x",cursor:"grab"}),c.appendChild(u);let m=document.createElement("button");if(m.type="button",m.setAttribute("aria-label","Close"),m.textContent="\u2715",Object.assign(m.style,{position:"absolute",top:"12px",right:"12px",zIndex:"2",width:"44px",height:"44px",borderRadius:"999px",cursor:"pointer",border:"1px solid rgba(255,255,255,0.25)",background:"rgba(8,12,18,0.6)",color:"#e6edf3",fontSize:"15px",lineHeight:"1"}),c.appendChild(m),n.disclosure){let H=document.createElement("div");H.textContent=`${n.disclosurePrefix??"360\xB0 panorama"} \xB7 ${n.disclosure}`,Object.assign(H.style,{position:"absolute",top:"calc(12px + var(--sl-3d-top-inset, 0px))",left:"12px",zIndex:"2",maxWidth:"calc(100% - 88px)",padding:"8px 11px",borderRadius:"999px",overflow:"hidden",color:"#dce6f8",background:"rgba(8,12,18,0.68)",font:"600 11px/1.2 ui-sans-serif, system-ui, sans-serif",textOverflow:"ellipsis",whiteSpace:"nowrap",pointerEvents:"none",backdropFilter:"blur(6px)"}),c.appendChild(H)}let f=document.createElement("div");f.textContent=As(n.lookAroundHint),Object.assign(f.style,{position:"absolute",bottom:"12px",left:"0",right:"0",textAlign:"center",color:"rgba(230,237,243,0.7)",font:"12px ui-sans-serif, system-ui, sans-serif",pointerEvents:"none"}),c.appendChild(f),e.appendChild(c),m.focus({preventScroll:!0});let h=0,d=0,p=0,b=0,x=di,y=()=>{let H=c.clientHeight||1,j=c.clientWidth||1,Z=w.naturalWidth||j*2,X=w.naturalHeight||H,ee=h>0?(j/2-p)/h:0,ne=d>0?b/d:0;d=p2(H,x),h=d*(Z/X),u.style.backgroundSize=`${h}px ${d}px`,M?p=j/2-ee*h:(p=d2(r,j,h),b=hi((t.initialPitchDeg??0)/180*d,d),M=!0),b=hi(ne*d,d),u.style.backgroundPosition=`${p}px ${jh(H,d,b)}px`},M=!1,A=()=>{let H=c.clientHeight||1;b=hi(b,d),u.style.backgroundPosition=`${p}px ${jh(H,d,b)}px`},w=new Image;w.onload=y,w.src=i.initialUrl;let g=()=>{};i.upgradeUrl&&(g=fi(()=>{(t.resolveUrl?t.resolveUrl(i.upgradeUrl):Promise.resolve(i.upgradeUrl)).then(j=>!j||a.signal.aborted?null:qo(j,a.signal).then(Z=>({full:Z,url:j}))).then(j=>{j&&(V||a.signal.aborted||(w=j.full,u.style.backgroundImage=`url("${j.url}")`,y()))}).catch(()=>{})})),requestAnimationFrame(y);let S=!1,v=0,P=0,E=0,k=new Map,L=()=>{let[H,j]=[...k.values()];return H&&j?Math.hypot(H.x-j.x,H.y-j.y):0},I=H=>{let j=Ps(H);j!==x&&(x=j,y())},R=H=>{k.set(H.pointerId,{x:H.clientX,y:H.clientY}),S=k.size===1,v=H.clientX,P=H.clientY,k.size===2&&(E=L()),u.style.cursor="grabbing";try{u.setPointerCapture?.(H.pointerId)}catch{}},_=H=>{if(k.has(H.pointerId)){if(k.set(H.pointerId,{x:H.clientX,y:H.clientY}),k.size>=2){let j=L();E>0&&j>0&&I(x*(E/j)),E=j,S=!1;return}S&&(p+=H.clientX-v,b+=H.clientY-P,v=H.clientX,P=H.clientY,A())}},F=H=>{k.delete(H.pointerId),E=k.size===2?L():0;let j=k.values().next().value;S=k.size===1,j?(v=j.x,P=j.y):u.style.cursor="grab";try{u.releasePointerCapture?.(H.pointerId)}catch{}},N=H=>{H.preventDefault(),I(x+H.deltaY*.04)};u.addEventListener("pointerdown",R),u.addEventListener("pointermove",_),u.addEventListener("pointerup",F),u.addEventListener("pointercancel",F),u.addEventListener("wheel",N,{passive:!1});let O=!1,V=!1,z=0,G=()=>{u.removeEventListener("pointerdown",R),u.removeEventListener("pointermove",_),u.removeEventListener("pointerup",F),u.removeEventListener("pointercancel",F),u.removeEventListener("wheel",N),window.removeEventListener("keydown",W)},T=()=>{g(),a.abort(),n.signal?.removeEventListener("abort",s),z&&(window.clearTimeout(z),z=0),G(),c.parentNode&&c.parentNode.removeChild(c),l?.isConnected&&l.focus({preventScroll:!0})},D=()=>{if(O)return;O=!0,c.style.opacity="0";let H=()=>{z=0,!V&&(T(),n.onClose?.())};z=window.setTimeout(H,o)},W=H=>{if(H.key==="Tab"){H.preventDefault(),m.focus({preventScroll:!0});return}if(H.key==="Escape"){H.stopPropagation(),D();return}if(H.key==="ArrowLeft"||H.key==="ArrowRight")p+=H.key==="ArrowLeft"?-32:32;else if(H.key==="ArrowUp"||H.key==="ArrowDown")b+=(H.key==="ArrowUp"?4:-4)*(d/180);else if(H.key==="+"||H.key==="="){I(x-5),H.preventDefault();return}else if(H.key==="-"){I(x+5),H.preventDefault();return}else return;H.preventDefault(),A()};return window.addEventListener("keydown",W),m.addEventListener("click",D),requestAnimationFrame(()=>{c.style.opacity="1"}),{close:D,dispose(){O=!0,V=!0,T()}}}var di,f2,h2,Nt,pi=uo(()=>{"use strict";ws();di=70,f2=35,h2=90;Nt=35});function M2(e=y2,t=g2,n=x2){let o=e+1,r=t+1,i=o*r,a=new Float32Array(i*3),s=new Float32Array(i*2);for(let u=0;u<r;u++){let m=u/t,f=m*Math.PI,h=Math.sin(f),d=Math.cos(f);for(let p=0;p<o;p++){let b=p/e,x=(b-.5)*Math.PI*2,y=u*o+p;a[y*3]=n*h*Math.sin(x),a[y*3+1]=n*d,a[y*3+2]=-n*h*Math.cos(x),s[y*2]=b,s[y*2+1]=m}}let c=new Uint16Array(e*t*6),l=0;for(let u=0;u<t;u++)for(let m=0;m<e;m++){let f=u*o+m,h=f+o;c[l++]=f,c[l++]=h,c[l++]=f+1,c[l++]=f+1,c[l++]=h,c[l++]=h+1}return{position:a,uv:s,index:c}}function Kh(e,t){let n=e*Math.PI/180,o=t*Math.PI/180,r=Math.cos(o);return[r*Math.sin(n),Math.sin(o),-r*Math.cos(n)]}function Yh(e,t){let{position:n,uv:o,index:r}=M2(),i=new sn.Geometry(e,{position:{size:3,data:n},uv:{size:2,data:o},index:{data:r}}),a=new sn.Texture(e,{image:t,wrapS:e.CLAMP_TO_EDGE,wrapT:e.CLAMP_TO_EDGE,generateMipmaps:!0,flipY:!1}),s=new sn.Program(e,{vertex:v2,fragment:S2,uniforms:{uPano:{value:a},uOpacity:{value:0}},transparent:!0,depthTest:!1,depthWrite:!1}),c=new sn.Mesh(e,{geometry:i,program:s});return{mesh:c,setOpacity(l){s.uniforms.uOpacity.value=Math.max(0,Math.min(1,l))},setImage(l){a.image=l,a.needsUpdate=!0},dispose(){c.setParent(null),i.remove(),a.texture&&e.deleteTexture(a.texture),s.remove()}}}var sn,y2,g2,x2,v2,S2,$h=uo(()=>{"use strict";sn=require("ogl"),y2=64,g2=32,x2=500;v2=`#version 300 es
2
2
  precision highp float;
3
3
  in vec3 position;
4
4
  in vec2 uv;
@@ -8,7 +8,7 @@ out vec2 vUv;
8
8
  void main() {
9
9
  vUv = uv;
10
10
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
11
- }`,Kx=`#version 300 es
11
+ }`,S2=`#version 300 es
12
12
  precision highp float;
13
13
  in vec2 vUv;
14
14
  uniform sampler2D uPano;
@@ -17,7 +17,21 @@ out vec4 fragColor;
17
17
  void main() {
18
18
  vec3 rgb = texture(uPano, vUv).rgb;
19
19
  fragColor = vec4(rgb, uOpacity);
20
- }`});async function Af(e,t,n,o={}){let r=o.fadeMs??400,i=t?.initialBearingDeg??0,a=Math.max(-vt,Math.min(vt,t?.initialPitchDeg??0)),s=Fr,c=!1,l=new AbortController,u=()=>l.abort();o.signal?.addEventListener("abort",u,{once:!0});let m=()=>{},f=[n.camera.position.x,n.camera.position.y,n.camera.position.z];if(!t&&n.cameraOriginWorld&&n.camera.position.set(n.cameraOriginWorld[0],n.cameraOriginWorld[1],n.cameraOriginWorld[2]),!t&&n.focalWorld){let V=n.camera.position,T=n.focalWorld[0]-V.x,B=n.focalWorld[1]-V.y,D=n.focalWorld[2]-V.z,G=Math.hypot(T,D);G>.001&&(i=Math.atan2(T,-D)*180/Math.PI,a=Math.max(-vt,Math.min(vt,Math.atan2(B,G)*180/Math.PI)))}let d=null;if(t){let V=n.gl.getParameter(n.gl.MAX_TEXTURE_SIZE),T=Lr(t,Tr(V)),B;try{let D=t.resolveUrl?await t.resolveUrl(T.initialUrl):T.initialUrl;if(!D)throw new Error("panorama_asset_unavailable");B=await Po(D,l.signal)}catch{return o.signal?.removeEventListener("abort",u),null}try{d=Sf(n.gl,B)}catch{return l.abort(),o.signal?.removeEventListener("abort",u),null}d.mesh.renderOrder=999,d.mesh.setParent(n.scene),T.upgradeUrl&&(m=kr(()=>{(t.resolveUrl?t.resolveUrl(T.upgradeUrl):Promise.resolve(T.upgradeUrl)).then(G=>!G||l.signal.aborted?null:Po(G,l.signal)).then(G=>{G&&(c||l.signal.aborted||(d?.setImage(G),n.requestRender()))}).catch(()=>{})}))}let h=n.camera.fov;n.camera.perspective({fov:s,aspect:n.camera.aspect});let p=n.camera.quaternion.slice(),b=()=>{let V=n.camera.position;d?.mesh.position.set(V.x,V.y,V.z);let[T,B,D]=vf(i,a);n.camera.lookAt([V.x+T,V.y+B,V.z+D]),n.requestRender()};b();let y=document.createElement("div"),M=document.activeElement instanceof HTMLElement?document.activeElement:null;y.setAttribute("role","dialog"),y.setAttribute("aria-modal","true"),y.setAttribute("aria-label",o.seatLabel?`View from ${o.seatLabel}`:"View from seat"),y.tabIndex=-1,Object.assign(y.style,{position:"absolute",inset:"0",zIndex:"10",cursor:"grab",touchAction:"none"});let S=document.createElement("button");if(S.type="button",S.setAttribute("aria-label","Close"),S.textContent="\u2715",Object.assign(S.style,{position:"absolute",top:"12px",right:"12px",zIndex:"2",width:"44px",height:"44px",borderRadius:"999px",cursor:"pointer",border:"1px solid rgba(255,255,255,0.25)",background:"rgba(8,12,18,0.6)",color:"#e6edf3",fontSize:"15px",lineHeight:"1"}),y.appendChild(S),o.disclosure){let V=document.createElement("div");V.textContent=`${o.disclosurePrefix??"360\xB0 panorama"} \xB7 ${o.disclosure}`,Object.assign(V.style,{position:"absolute",top:"calc(12px + var(--sl-3d-top-inset, 0px))",left:"12px",zIndex:"2",maxWidth:"calc(100% - 88px)",padding:"8px 11px",borderRadius:"999px",overflow:"hidden",color:"#dce6f8",background:"rgba(8,12,18,0.68)",font:"600 11px/1.2 ui-sans-serif, system-ui, sans-serif",textOverflow:"ellipsis",whiteSpace:"nowrap",pointerEvents:"none",backdropFilter:"blur(6px)"}),y.appendChild(V)}let A=document.createElement("div");A.textContent=Ta(o.lookAroundHint),Object.assign(A.style,{position:"absolute",bottom:"12px",left:"0",right:"0",textAlign:"center",color:"rgba(230,237,243,0.7)",font:"12px ui-sans-serif, system-ui, sans-serif",pointerEvents:"none"}),y.appendChild(A),e.appendChild(y),S.focus({preventScroll:!0});let x=!1,g=0,w=0,v=0,P=new Map,R=()=>{let[V,T]=[...P.values()];return V&&T?Math.hypot(V.x-T.x,V.y-T.y):0},k=V=>{let T=_a(V);T!==s&&(s=T,n.camera.perspective({fov:s,aspect:n.camera.aspect}),b())},F=V=>{V.target!==S&&(P.set(V.pointerId,{x:V.clientX,y:V.clientY}),x=P.size===1,g=V.clientX,w=V.clientY,P.size===2&&(v=R()),y.setPointerCapture?.(V.pointerId),y.style.cursor="grabbing")},E=V=>{if(P.has(V.pointerId)){if(P.set(V.pointerId,{x:V.clientX,y:V.clientY}),P.size>=2){let T=R();v>0&&T>0&&k(s*(v/T)),v=T,x=!1;return}x&&(i+=(V.clientX-g)*Pf,a=Math.max(-vt,Math.min(vt,a+(V.clientY-w)*Pf)),g=V.clientX,w=V.clientY,b())}},I=V=>{P.delete(V.pointerId),v=P.size===2?R():0;let T=P.values().next().value;x=P.size===1,T?(g=T.x,w=T.y):y.style.cursor="grab";try{y.releasePointerCapture?.(V.pointerId)}catch{}},C=V=>{V.preventDefault(),k(s+V.deltaY*.04)};y.addEventListener("pointerdown",F),y.addEventListener("pointermove",E),y.addEventListener("pointerup",I),y.addEventListener("pointercancel",I),y.addEventListener("wheel",C,{passive:!1});let L=V=>{if(!c){if(V.key==="Tab"){V.preventDefault(),S.focus({preventScroll:!0});return}if(V.key==="Escape"){V.stopPropagation(),j.close();return}if(V.key==="ArrowLeft"||V.key==="ArrowRight")i+=V.key==="ArrowLeft"?-4:4;else if(V.key==="ArrowUp"||V.key==="ArrowDown")a=Math.max(-vt,Math.min(vt,a+(V.key==="ArrowUp"?4:-4)));else if(V.key==="+"||V.key==="="){k(s-5),V.preventDefault();return}else if(V.key==="-"){k(s+5),V.preventDefault();return}else return;V.preventDefault(),b()}};window.addEventListener("keydown",L);let N=0,O=(V,T)=>{if(!d){T?.();return}let B=V===1?0:1,D=performance.now(),G=()=>{if(c)return;let U=r<=0?1:Math.min(1,(performance.now()-D)/r);d?.setOpacity(B+(V-B)*U),n.requestRender(),U<1?N=requestAnimationFrame(G):T?.()};N=requestAnimationFrame(G)};O(1);let H=()=>{c||(c=!0,m(),l.abort(),o.signal?.removeEventListener("abort",u),cancelAnimationFrame(N),y.removeEventListener("pointerdown",F),y.removeEventListener("pointermove",E),y.removeEventListener("pointerup",I),y.removeEventListener("pointercancel",I),y.removeEventListener("wheel",C),window.removeEventListener("keydown",L),y.remove(),M?.isConnected&&M.focus({preventScroll:!0}),d?.dispose(),n.camera.position.set(f[0],f[1],f[2]),n.camera.perspective({fov:h,aspect:n.camera.aspect}),n.camera.quaternion.set(p[0],p[1],p[2],p[3]),n.requestRender())},j={close(){if(c)return;let V=()=>{H(),o.onClose?.()};cancelAnimationFrame(N),O(0,V)},dispose:H};return S.addEventListener("click",()=>j.close()),j}var Pf,If=Un(()=>{"use strict";wf();Dr();Dr();Ca();Pf=.15});var Rf={};qa(Rf,{createOpenPanorama:()=>$x});function $x(e){let{container:t,model:n,opts:o,analytics:r,orbit:i,loop:a,seatsById:s,ensureSeatView:c,resolvedSeatViewPose:l,gpu:u,gl:m,isContextLost:f,isDisposed:d,flightGen:h,setPanorama:p,getLoadAbort:b,setLoadAbort:y,setPanoramaSphereVisible:M,setFrozen:S,raisePanoramaLayer:A,restorePanoramaLayer:x,getOverviewChip:g,labelOverlay:w,reducedMotion:v,removeArriveChip:P,showArriveChip:R}=e;return async(k,F,E)=>{b()?.abort();let I=new AbortController;y(I);let C=n.seats.idToIndex.get(k);if(C===void 0){i.syncFromCamera();return}let L=s.get(k)?.label??k,N=l(k,C),O=c(k);if(!O){I.abort(),b()===I&&y(null),i.syncFromCamera();return}S(!0),a.stop();let H;try{H=await O}catch{if(b()===I&&y(null),r.panoramaFailed(k,"source"),!d()&&E===h()){S(!1),i.resumeAfterFlight(N.focal),a.requestRender();let q=R(k,E,!0);requestAnimationFrame(()=>q?.querySelector("[data-panorama-trigger]")?.focus())}return}if(d()||E!==h()){I.abort(),b()===I&&y(null);return}P();let j=g(),V=()=>{I.abort(),b()===I&&y(null),p(null),M(!1),x(),j.style.display="",w.setVisible(!o.arriveAtSeatEye),S(!1),r.panoramaClosed(),i.resumeAfterFlight(N.focal),a.requestRender();let q=R(k,h());requestAnimationFrame(()=>q?.querySelector("[data-panorama-trigger]")?.focus())},T=H.generated===!0,B=xf(H);A(),M(!T),j.style.display="none";let D=v()?0:F,G=u(),U=G&&!f()?await Af(t,T?null:H,{gl:m,scene:G.main,camera:i.camera,requestRender:()=>a.requestRender(),cameraOriginWorld:T?N.eye:void 0,focalWorld:N.focal},{fadeMs:D,seatLabel:L,disclosure:B,disclosurePrefix:T?"Live 3D view":"360\xB0 panorama",lookAroundHint:o.lookAroundHint,onClose:V,signal:I.signal}):null;if(d()||E!==h()){I.abort(),M(!1),b()===I&&y(null),U?.dispose(),j.style.display="",x();return}if(U)i.syncFromCamera(),w.setVisible(!1),S(!1),a.requestRender(),p(U);else if(T){x(),j.style.display="",S(!1),i.resumeAfterFlight(N.focal),a.requestRender(),p(null),M(!1),r.panoramaFailed(k,"mount");let q=R(k,h(),!0);requestAnimationFrame(()=>q?.querySelector("[data-panorama-trigger]")?.focus()),b()===I&&y(null);return}else M(!1),r.panoramaFallback(k),p(Mf(t,H,{fadeMs:D,seatLabel:L,disclosure:B,onClose:V,signal:I.signal,lookAroundHint:o.lookAroundHint}));r.panoramaOpened()}}var Ef=Un(()=>{"use strict";Dr();If()});var fM={};qa(fM,{VENUE3D_QUALITY_REPORT_VERSION:()=>ym,autoVenue3d:()=>xr,buildSceneModel:()=>Ln,estimateVenue3D:()=>Ao,inspectVenue3DQualityEvidence:()=>Pr,mountVenue3D:()=>mM,prepareVenue3D:()=>jf,prepareVenue3DFromChart:()=>Wf});module.exports=sd(fM);function Ja(e,t,n){let o=Math.floor(t.length/3),r=n.center[0],i=n.center[2];if(o>0){let c=Math.max(1,Math.floor(o/4e3)),l=0,u=0,m=0;for(let f=0;f<o;f+=c)l+=t[f*3],u+=t[f*3+2],m++;r=l/m,i=u/m}let a=e[0]-r,s=e[2]-i;return Math.hypot(a,s)>n.radius*.12?Math.atan2(a,s):void 0}var Xf=require("ogl");function es(e,t,n="#ffffff"){let{iPosition:o,count:r}=t.seats;if(r<2||typeof document>"u")return null;let i=1/0,a=-1/0,s=1/0,c=-1/0;for(let x=0;x<r;x++){let g=o[x*3],w=o[x*3+2];g<i&&(i=g),g>a&&(a=g),w<s&&(s=w),w>c&&(c=w)}for(let x of t.stages)i=Math.min(i,x.cx-x.halfX),a=Math.max(a,x.cx+x.halfX),s=Math.min(s,x.cz-x.halfZ),c=Math.max(c,x.cz+x.halfZ);let l=Math.min(130/Math.max(.001,a-i),86/Math.max(.001,c-s)),u=(148-(a-i)*l)/2,m=(104-(c-s)*l)/2,f=x=>u+(x-i)*l,d=x=>m+(x-s)*l,h=Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),p=document.createElement("canvas");p.width=Math.round(148*h),p.height=Math.round(104*h),p.setAttribute("aria-hidden","true"),p.setAttribute("data-seat-locator","");let b=p.style;b.position="absolute",b.left="12px",b.bottom="12px",b.width="148px",b.height="104px",b.borderRadius="10px",b.background="rgba(10,14,22,.72)",b.border="1px solid rgba(255,255,255,.14)",b.boxShadow="0 4px 14px rgba(0,0,0,.35)",b.pointerEvents="none",b.zIndex="3",b.display="none",e.appendChild(p);let y=document.createElement("canvas");y.width=p.width,y.height=p.height;let M=y.getContext("2d");if(M){M.scale(h,h),M.fillStyle="rgba(214,222,234,.28)";let x=Math.max(1,Math.ceil(r/6e3));for(let g=0;g<r;g+=x)M.fillRect(f(o[g*3])-.6,d(o[g*3+2])-.6,1.2,1.2);M.fillStyle="rgba(236,240,246,.16)",M.strokeStyle="rgba(236,240,246,.55)",M.lineWidth=1;for(let g of t.stages){let w=f(g.cx-g.halfX),v=d(g.cz-g.halfZ),P=g.halfX*2*l,R=g.halfZ*2*l;M.fillRect(w,v,P,R),M.strokeRect(w+.5,v+.5,Math.max(0,P-1),Math.max(0,R-1))}}let S=p.getContext("2d"),A="";return{el:p,update(x,g){if(!x||!S||e.clientWidth>0&&e.clientWidth<560){b.display!=="none"&&(b.display="none"),A="";return}let w=f(x[0]),v=d(x[2]),P=g?Math.atan2(g[2],g[0]):0,R=`${w.toFixed(1)},${v.toFixed(1)},${P.toFixed(2)}`;if(R!==A){if(A=R,b.display="block",S.setTransform(1,0,0,1,0,0),S.clearRect(0,0,p.width,p.height),S.drawImage(y,0,0),S.setTransform(h,0,0,h,0,0),g){let k=S.createRadialGradient(w,v,0,w,v,26);k.addColorStop(0,"rgba(255,255,255,.55)"),k.addColorStop(1,"rgba(255,255,255,0)"),S.fillStyle=k,S.beginPath(),S.moveTo(w,v),S.arc(w,v,26,P-.5,P+.5),S.closePath(),S.fill()}S.fillStyle=n,S.strokeStyle="rgba(10,14,22,.9)",S.lineWidth=1.5,S.beginPath(),S.arc(w,v,3.6,0,Math.PI*2),S.fill(),S.stroke()}},dispose(){p.remove()}}}var Pe={pedestal:0,pad:1,back:2,arm:3,footrest:4,leg:5,body:10,head:11},cd=.44,ld=.15,ts=.3,ud=.24;function ns(e){return e===void 0||!Number.isFinite(e)||e<=0?ud:Math.min(ts,Math.max(ld,e*cd))}var Wn=.21,md=.05,Qr=.45,Et=Qr+md,Xn=.92,jn=.66,Jr=1.205,os=-.23,rs=.38,fd=[{part:Pe.pedestal,min:[-.3,0,-.3],max:[.3,.36,.3]},{part:Pe.pad,min:[-1,.36,-.95],max:[1,Qr,1]},{part:Pe.back,min:[-1,Et,-1],max:[1,Xn,-.72]},{part:Pe.arm,min:[-1,.44,-.82],max:[-.78,.65,.78]},{part:Pe.arm,min:[.78,.44,-.82],max:[1,.65,.78]},{part:Pe.footrest,min:[-.9,.18,.78],max:[.9,.31,1.34]},{part:Pe.leg,min:[-.82,0,-.7],max:[-.62,.37,-.48]},{part:Pe.leg,min:[.62,0,-.7],max:[.82,.37,-.48]},{part:Pe.leg,min:[-.82,0,.48],max:[-.62,.37,.7]},{part:Pe.leg,min:[.62,0,.48],max:[.82,.37,.7]}],dd=[{part:Pe.body,min:[-.52,.39,-.08],max:[-.08,.55,.82]},{part:Pe.body,min:[.08,.39,-.08],max:[.52,.55,.82]},{part:Pe.body,min:[-.47,.05,.58],max:[-.13,.43,.82]},{part:Pe.body,min:[.13,.05,.58],max:[.47,.43,.82]},{part:Pe.head,min:[-.16,1.04,-.33],max:[.16,1.1,-.13]}],hd=[{n:[1,0,0],c:[[1,0,0],[1,1,0],[1,1,1],[1,0,1]]},{n:[-1,0,0],c:[[0,0,1],[0,1,1],[0,1,0],[0,0,0]]},{n:[0,1,0],c:[[0,1,0],[0,1,1],[1,1,1],[1,1,0]]},{n:[0,-1,0],c:[[0,0,1],[0,0,0],[1,0,0],[1,0,1]]},{n:[0,0,1],c:[[0,0,1],[1,0,1],[1,1,1],[0,1,1]]},{n:[0,0,-1],c:[[1,0,0],[0,0,0],[0,1,0],[1,1,0]]}];function is(){let e=[],t=[],n=[],o=[],r=(T,B,D)=>{let G=n.length,[U,q,$]=T,te=[q[0]-U[0],q[1]-U[1],q[2]-U[2]],Q=[$[0]-U[0],$[1]-U[1],$[2]-U[2]],X=te[1]*Q[2]-te[2]*Q[1],Y=te[2]*Q[0]-te[0]*Q[2],K=te[0]*Q[1]-te[1]*Q[0],J=Math.hypot(X,Y,K);J>1e-9?(X/=J,Y/=J,K/=J):[X,Y,K]=B,X*B[0]+Y*B[1]+K*B[2]<0&&(X=-X,Y=-Y,K=-K);for(let ce of T)e.push(...ce),t.push(X,Y,K),n.push(D);o.push(G,G+1,G+2,G,G+2,G+3)},i=T=>{for(let B of hd){let D=B.c.map(G=>G.map((U,q)=>U?T.max[q]:T.min[q]));r(D,B.n,T.part)}},a=(T,B)=>{let[D,G,U]=B?[0,1,2]:[0,2,1],q=T.min[D],$=T.max[D],te=T.min[G],Q=T.max[G],X=($-q)*.1,Y=(Q-te)*.1,K=B?[[q+X,te],[$-X,te],[$,te+Y],[$*.94,Q-(Q-te)*.23],[$*jn,Q],[q*jn,Q],[q*.94,Q-(Q-te)*.23],[q,te+Y]]:[[q+X,te],[$-X,te],[$,te+Y],[$,Q-Y],[$-X,Q],[q+X,Q],[q,Q-Y],[q,te+Y]],J=(oe,ee,ne)=>{let he=[0,0,0];return he[D]=oe,he[G]=ee,he[U]=ne,he},ce=[T.min[U],T.max[U]].map(oe=>K.map(([ee,ne])=>J(ee,ne,oe)));for(let oe=0;oe<K.length;oe++){let ee=(oe+1)%K.length,ne=[0,0,0];ne[D]=(K[oe][0]+K[ee][0])/2-(q+$)/2,ne[G]=(K[oe][1]+K[ee][1])/2-(te+Q)/2,r([ce[0][oe],ce[0][ee],ce[1][ee],ce[1][oe]],ne,T.part)}for(let oe=0;oe<2;oe++){let ee=[0,0,0];ee[U]=oe?1:-1;let ne=ce[oe];for(let he=1;he<ne.length-1;he++){let re=n.length;for(let ve of[ne[0],ne[he],ne[he+1]])e.push(...ve),t.push(...ee),n.push(T.part);o.push(re,re+1,re+2)}}};for(let T of fd)T.part===Pe.pad||T.part===Pe.back?a(T,T.part===Pe.back):i(T);for(let T of dd)i(T);let s=Qr,c=1.08,l=.47,u=.69,m=-.55,f=.08,d=-.48,h=.01,p=[-l,s,m],b=[l,s,m],y=[-l,s,f],M=[l,s,f],S=[-u,c,d],A=[u,c,d],x=[-u,c,h],g=[u,c,h];r([b,A,g,M],[1,0,0],Pe.body),r([y,x,S,p],[-1,0,0],Pe.body),r([p,b,M,y],[0,-1,0],Pe.body);let w=c+.07,v=.24,P=[-v,w,d],R=[v,w,d],k=[-v,w,h],F=[v,w,h];r([x,k,P,S],[-.5,1,0],Pe.body),r([k,F,R,P],[0,1,0],Pe.body),r([F,g,A,R],[.5,1,0],Pe.body),r([M,g,x,y],[0,0,1],Pe.body),r([g,F,k,x],[0,0,1],Pe.body),r([p,S,A,b],[0,0,-1],Pe.body),r([S,P,R,A],[0,0,-1],Pe.body);let E=10,I=8,C=[0,Jr,os],L=[.32,.115,rs],N=n.length;for(let T=0;T<=I;T++){let B=Math.PI*T/I,D=Math.cos(B),G=Math.sin(B);for(let U=0;U<=E;U++){let q=Math.PI*2*U/E,$=G*Math.cos(q),te=G*Math.sin(q);e.push(C[0]+L[0]*$,C[1]+L[1]*D,C[2]+L[2]*te);let Q=$/L[0],X=D/L[1],Y=te/L[2],K=Math.hypot(Q,X,Y)||1;Q/=K,X/=K,Y/=K,t.push(Q,X,Y),n.push(Pe.head)}}for(let T=0;T<I;T++)for(let B=0;B<E;B++){let D=N+T*(E+1)+B,G=D+E+1;o.push(D,G,D+1,D+1,G,G+1)}let O=new Float32Array(e),H=new Float32Array(t),j=new Float32Array(n),V=new Uint16Array(o);return{position:O,normal:H,part:j,index:V,vertexCount:n.length,indexCount:o.length}}function as(e,t,n,o){let r=new Float32Array(t),i=l=>e[l*3],a=l=>e[l*3+2],s=0,c=(l,u)=>{let m=u-l;for(let f=l;f<u;f++){let[d,h]=o(f),p=d-i(f),b=h-a(f);if(m>=2){let y=Math.max(l,f-1),M=Math.min(u-1,f+1),S=i(M)-i(y),A=a(M)-a(y),x=Math.hypot(S,A);if(x>1e-6){let g=-A/x,w=S/x;g*p+w*b<0&&(g=-g,w=-w),p=g,b=w}}r[f]=p===0&&b===0?0:Math.atan2(p,b)}};for(let l=1;l<=t;l++)(l===t||n(l)!==n(s))&&(c(s,l),s=l);return r}var ei=78,ss=18;function cs(){let e=[],t=[],n=[],o=[],r=[],i=[{n:[1,0,0],c:[[1,0,0],[1,1,0],[1,1,1],[1,0,1]]},{n:[-1,0,0],c:[[0,0,1],[0,1,1],[0,1,0],[0,0,0]]},{n:[0,1,0],c:[[0,1,0],[0,1,1],[1,1,1],[1,1,0]]},{n:[0,-1,0],c:[[0,0,1],[0,0,0],[1,0,0],[1,0,1]]},{n:[0,0,1],c:[[0,0,1],[1,0,1],[1,1,1],[0,1,1]]},{n:[0,0,-1],c:[[1,0,0],[0,0,0],[0,1,0],[1,1,0]]}];for(let s of[{part:1,min:[-1,.36,-.95],max:[1,.45,1]},{part:2,min:[-1,Et,-1],max:[1,Xn,-.72]}])for(let c of i){let l=e.length/3,u=c.n[1]+(s.part===2?Math.abs(c.n[0])*(1-jn)/(Xn-Et):0),m=Math.hypot(c.n[0],u,c.n[2]),f=[c.n[0]/m,u/m,c.n[2]/m];for(let[d,h]of c.c.entries()){let p=h.map((b,y)=>s.min[y]+b*(s.max[y]-s.min[y]));s.part===2&&(p[0]*=1-h[1]*(1-jn)),e.push(...p),t.push(...f),n.push(s.part),o.push(...[[-1,-1],[1,-1],[1,1],[-1,1]][d])}r.push(l,l+1,l+2,l,l+2,l+3)}let a=e.length/3;for(let[s,c]of[[-1,-1],[1,-1],[1,1],[-1,1]])e.push(s,c,0),t.push(0,1,0),n.push(0),o.push(s,c);return r.push(a,a+1,a+2,a,a+2,a+3),r.push(...r.slice(12,18),...r.slice(60,66),...r.slice(72,78)),{position:new Float32Array(e),normal:new Float32Array(t),surface:new Float32Array(n),uv:new Float32Array(o),index:new Uint16Array(r)}}var bs=require("ogl");var pd=/^#?([\da-f]{3}|[\da-f]{6})$/i;function ls(e){let t=e.replace("#","");return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}}function bd(e){let t=pd.exec((e??"").trim());if(!t)return null;let n=t[1].length===3?t[1].split("").map(r=>r+r).join(""):t[1],o=parseInt(n,16);return[o>>16&255,o>>8&255,o&255]}function ye(e){let t=bd(e);return t?[t[0]/255,t[1]/255,t[2]/255]:null}function ti(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function yd(e){return .2126*ti(e[0])+.7152*ti(e[1])+.0722*ti(e[2])}function us(e){return yd([e[0]*255,e[1]*255,e[2]*255])}function gd(e){return .2126*e[0]+.7152*e[1]+.0722*e[2]}function ge(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n]}function dt(e,t){let n=gd(e);return ge(e,[n,n,n],t)}function ms({r:e,g:t,b:n}){let o=e/255,r=t/255,i=n/255,a=Math.max(o,r,i),s=Math.min(o,r,i),c=(a+s)/2;if(a===s)return{h:0,s:0,l:c};let l=a-s,u=c>.5?l/(2-a-s):l/(a+s),m;return a===o?m=((r-i)/l+(r<i?6:0))/6:a===r?m=((i-o)/l+2)/6:m=((o-r)/l+4)/6,{h:m,s:u,l:c}}var ni=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,oi=e=>e<=.0031308?12.92*e:1.055*Math.max(0,e)**.4166666666666667-.055,ri=e=>Math.min(1,Math.max(0,e));function To(e){let t=ni(e[0]),n=ni(e[1]),o=ni(e[2]),r=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*o),i=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*o),a=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*o);return[.2104542553*r+.793617785*i-.0040720468*a,1.9779984951*r-2.428592205*i+.4505937099*a,.0259040371*r+.7827717662*i-.808675766*a]}function _o([e,t,n]){let o=(e+.3963377774*t+.2158037573*n)**3,r=(e-.1055613458*t-.0638541728*n)**3,i=(e-.0894841775*t-1.291485548*n)**3;return[ri(oi(4.0767416621*o-3.3077115913*r+.2309699292*i)),ri(oi(-1.2684380046*o+2.6097574011*r-.3413193965*i)),ri(oi(-.0041960863*o-.7034186147*r+1.707614701*i))]}var Lo=e=>To(e)[0];function Yn(e){let[,t,n]=To(e);return Math.hypot(t,n)}function Wt(e,t,n){let[,o,r]=To(e);if(n===void 0)return _o([t,o,r]);let i=Math.hypot(o,r),a=i===0?0:n/i;return _o([t,o*a,r*a])}function fs(e,t,n){let[o,r,i]=To(e);return o>=t&&o<=n?e:_o([Math.min(n,Math.max(t,o)),r,i])}function ko(e){return _o([e,-.004,-.008])}var ze=["available","held","sold","selected","dimmed"];function Kn(e){let t=ze.indexOf(e);return t<0?0:t}var hs={available:[.24,.82,.52],held:[.34,.39,.45],sold:[.34,.39,.45],selected:[.24,.74,1],dimmed:[.28,.32,.37]};function xd(e){let t=.2126*e[0]+.7152*e[1]+.0722*e[2],n=.78,o=.86;return[(t+(e[0]-t)*n)*o,(t+(e[1]-t)*n)*o,(t+(e[2]-t)*n)*o]}var ds={day:{ground:.9,deck:.84,fascia:.77,shell:.79,seatMin:.45,seatMax:.58,unavailable:.58,dimmed:.62,sectionDeck:.66,sectionDeckChromaShare:.8,sectionDeckChromaCap:.11,stageTop:.52,stageWall:.42},night:{ground:.26,deck:.34,fascia:.28,shell:.32,seatMin:.64,seatMax:.8,unavailable:.42,dimmed:.39,sectionDeck:.34,sectionDeckChromaShare:.45,sectionDeckChromaCap:.05,stageTop:0,stageWall:0}},Oo=.012;function an(e){return Lo(e.tierTop)>.6}function Xt(e){return e?ds.day:ds.night}function ps(e,t){let n=Xt(t);return fs(xd(e),n.seatMin,n.seatMax)}var ii={ground:[.07,.085,.11],tierTop:[.24,.28,.34],tierWall:[.17,.2,.25],stageTop:[.94,.7,.38],stageWall:[.48,.33,.18],decorTop:[.22,.25,.29],decorWall:[.15,.17,.2],gaTop:[.24,.28,.33],gaWall:[.16,.19,.23],boothTop:[.3,.33,.38],boothWall:[.2,.23,.27],tableTop:[.38,.34,.29],tableWall:[.24,.21,.18]},Yt={top:[.05,.06,.08],bottom:[.1,.12,.15]};function le(e,t){return[Math.min(1,e[0]*t),Math.min(1,e[1]*t),Math.min(1,e[2]*t)]}function Md(){let e=typeof window<"u"&&window.devicePixelRatio||1,t=navigator.deviceMemory,n=typeof t=="number"&&t<=4?1.5:2;return Math.min(e,n)}var Fo=class{constructor(t,n){this.clearRgb=[0,0,0];this.container=t,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 bs.Renderer({canvas:this.canvas,dpr:Md(),alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[Yt.top[0],Yt.top[1],Yt.top[2]],this.gl.clearColor(this.clearRgb[0],this.clearRgb[1],this.clearRgb[2],1),t.appendChild(this.canvas),this.lostHandler=o=>{o.preventDefault(),n.onContextLost()},this.restoredHandler=()=>n.onContextRestored(),this.canvas.addEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.restoredHandler,!1),this.resize()}setClearColor(t){this.clearRgb=[t[0],t[1],t[2]],this.gl.clearColor(t[0],t[1],t[2],1)}get clearColor(){return this.clearRgb}resize(){let t=Math.max(1,this.container.clientWidth||this.canvas.clientWidth||1),n=Math.max(1,this.container.clientHeight||this.canvas.clientHeight||1);return this.renderer.setSize(t,n),{width:t,height:n}}get pixelHeight(){return this.renderer.height*this.renderer.dpr}get aspect(){return this.renderer.width/Math.max(1,this.renderer.height)}dispose(){this.canvas.removeEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.restoredHandler,!1);let t=this.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}simulateContextLossCycle(){let t=this.gl.getExtension("WEBGL_lose_context");t&&(t.loseContext(),setTimeout(()=>{t.restoreContext&&t.restoreContext()},300))}};var cn=require("ogl"),Be=Math.PI/180,ai=15*Be,si=80*Be,sn=.12,ys=35,ci=1.25,gs=.006,vd=4,ln=.82,$n=1/ln,Sd=.12,wd=2;function Pd(e,t){return{azimuth:0-e*gs,polar:-t*gs}}function xs(e,t,n){let o=Math.max(wd,Math.max(1,t)*Sd),r=n*vd;return{minDist:e?Math.min(e.minDist,o):o,maxDist:e?Math.max(e.maxDist,r):r}}var Ad=1.5;function Id(e,t,n){let o=Math.max(1,n)*Ad;if(!e)return{anchor:[t[0],t[1],t[2]],limit:o};let[r,i,a]=e.anchor,s=t[1]-i,c=Math.max(Math.abs(t[0]-r),Math.abs(t[2]-a),s>=0?s:-s*2);return{anchor:e.anchor,limit:Math.max(e.limit,c+o)}}function Rd(e,t,n,o,r,i,a,s){let c=Math.sin(n),l=[c*Math.sin(t),Math.cos(n),c*Math.cos(t)],u=[e[0]+o*l[0],e[1]+o*l[1],e[2]+o*l[2]],m=[-l[0],-l[1],-l[2]],f=[-m[2],0,m[0]],d=Math.hypot(f[0],f[2])||1;f=[f[0]/d,0,f[2]/d];let h=[f[1]*m[2]-f[2]*m[1],f[2]*m[0]-f[0]*m[2],f[0]*m[1]-f[1]*m[0]],p=Math.tan(r*Be/2),b=p*(i>0?i:1),y=[0,1,2].map(A=>m[A]+a*b*f[A]+s*p*h[A]);if(y[1]>=-1e-6)return null;let M=(e[1]-u[1])/y[1],S=Math.hypot(y[0],y[1],y[2]);return!(M>0)||M*S>o*Ed?null:[u[0]+y[0]*M,e[1],u[2]+y[2]*M]}var Ms=3,Ed=4,vs=.72,Cd=.6;function _d(e,t,n){return e!=="auto"?e:n!==null&&t<n*Cd?"pan":"orbit"}function Ss(e,t){let n=Math.sin(t),o=-n*Math.sin(e),r=-Math.cos(t),i=-n*Math.cos(e);if(Math.abs(r)>.999)return null;let a=-i,s=o,c=Math.hypot(a,s);return a/=c,s/=c,{fx:o,fy:r,fz:i,rx:a,rz:s,ux:-s*r,uy:s*o-a*i,uz:a*r}}var Td=.4;function Ld(e,t,n,o,r,i){let a=[e.center[0],e.center[1],e.center[2]],s=i(a),c=e.fitPoints,l=Ss(o,r);if(!c||c.length<9||!l)return{center:a,distance:s};let{fx:u,fy:m,fz:f,rx:d,rz:h,ux:p,uy:b,uz:y}=l,M=Math.hypot(u,f),S=u/M,A=f/M,x=S*p+A*y,g=Td*Math.max(1,e.radius);for(let w=0;w<3;w++){let v=1/0,P=-1/0,R=1/0,k=-1/0;for(let N=0;N+2<c.length;N+=3){let O=c[N]-a[0],H=c[N+1]-a[1],j=c[N+2]-a[2],V=s+O*u+H*m+j*f;if(!(V>.001))continue;let T=(O*d+j*h)/(V*t),B=(O*p+H*b+j*y)/(V*n);T<v&&(v=T),T>P&&(P=T),B<R&&(R=B),B>k&&(k=B)}if(!Number.isFinite(v))break;let F=(v+P)/2*s*t,E=Math.abs(x)>.1?(R+k)/2*s*n/x:0,I=F*d+E*S,C=F*h+E*A;if(Math.hypot(a[0]+I-e.center[0],a[2]+C-e.center[2])>g){let N=a[0]-e.center[0],O=a[2]-e.center[2],H=N+I,j=O+C,V=g/Math.hypot(H,j);I=H*V-N,C=j*V-O}a=[a[0]+I,a[1],a[2]+C],s=i(a)}return{center:a,distance:s}}var Do=class{constructor(t,n,o,r){this.fovY=ys;this.target=new cn.Vec3;this.azimuth=-30*Be;this.polar=55*Be;this.distance=10;this.azT=-30*Be;this.polT=55*Be;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 cn.Vec3;this.panAnchor=new cn.Vec3;this.panLimit=0;this.panBox=null;this.zoomPointResolver=null;this.primaryDragMode="auto";this.overviewDist=null;this.pinchAngle=0;this.camera=new cn.Camera(t,{fov:ys,near:.1,far:5e3,aspect:1}),this.canvas=n,this.requestRender=o,this.onGesture=r,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 a=this.dragAction(),s=a==="orbit"?"pan":"orbit",c=i.button===2||i.button===1||i.shiftKey?s:a;this.panning=c==="pan",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(),this.pinchAngle=this.currentPinchAngle();let a=this.pinchCentroid();this.pinchCx=a.x,this.pinchCy=a.y}}},this.onPointerMove=i=>{if(!this.interactionEnabled||!this.activePointers.has(i.pointerId))return;if(this.activePointers.set(i.pointerId,{x:i.clientX,y:i.clientY}),this.activePointers.size>=2){let l=this.currentPinchDistance(),u=this.pinchCentroid();this.pinchDist>0&&(this.dollyAt(Math.exp((this.pinchDist-l)*.005),u.x,u.y),this.fireGesture()),this.pinchDist=l;let m=this.currentPinchAngle(),f=m-this.pinchAngle;f>Math.PI&&(f-=2*Math.PI),f<-Math.PI&&(f+=2*Math.PI),this.pinchAngle=m,Math.abs(f)>1e-4&&Math.abs(f)<.5&&(this.azT+=f,this.fireGesture()),this.panBy(u.x-this.pinchCx,u.y-this.pinchCy),this.pinchCx=u.x,this.pinchCy=u.y;return}let a=i.clientX-this.lastX,s=i.clientY-this.lastY;if(this.panning){this.lastX=i.clientX,this.lastY=i.clientY,(a!==0||s!==0)&&(this.panBy(a,s),this.fireGesture());return}if(!this.dragging)return;this.lastX=i.clientX,this.lastY=i.clientY,(a!==0||s!==0)&&this.fireGesture();let c=Pd(a,s);this.azT+=c.azimuth,this.polT=Math.max(ai,Math.min(si,this.polT+c.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 a=i.deltaMode===1?16:i.deltaMode===2?100:1,s=Math.max(-2,Math.min(2,i.deltaY*a/100));this.dollyAt(Math.exp(s*.22),i.clientX,i.clientY),this.fireGesture()},this.onKeyDown=i=>{if(!this.interactionEnabled)return;let a=7*Be;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"?a:-a;else if(i.key==="ArrowUp"||i.key==="ArrowDown")this.polT=Math.max(ai,Math.min(si,this.polT+(i.key==="ArrowUp"?-a:a)));else if(i.key==="+"||i.key==="=")this.dollyBy(ln);else if(i.key==="-"||i.key==="_")this.dollyBy($n);else return;i.preventDefault(),this.fireGesture(),this.requestRender()},n.addEventListener("pointerdown",this.onPointerDown),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerup",this.onPointerUp),n.addEventListener("pointercancel",this.onPointerUp),n.addEventListener("wheel",this.onWheel,{passive:!1}),n.addEventListener("keydown",this.onKeyDown),n.addEventListener("contextmenu",this.onContextMenu)}pinchCentroid(){let t=[...this.activePointers.values()];if(!t.length)return{x:0,y:0};let n=0,o=0;for(let r of t)n+=r.x,o+=r.y;return{x:n/t.length,y:o/t.length}}panBy(t,n){let o=this.canvas.clientHeight||1,r=2*this.distance*Math.tan(this.fovY*Be/2)/o,i=Math.sin(this.azimuth),a=Math.cos(this.azimuth),s=a,c=-i,l=Math.cos(this.polar),u=Math.sin(this.polar),m=-i*l,f=-a*l;this.targetT.x+=(-t*s+n*m)*r,this.targetT.z+=(-t*c+n*f)*r,this.targetT.y+=n*u*r,this.clampPan(),this.requestRender()}widenPanBox(t){this.panBox=Id(this.panBox,t.center,t.radius),this.panAnchor.set(this.panBox.anchor[0],this.panBox.anchor[1],this.panBox.anchor[2]),this.panLimit=this.panBox.limit}clampPan(){if(this.panLimit<=0)return;let t=this.panLimit,n=this.panAnchor.x,o=this.panAnchor.y,r=this.panAnchor.z;this.targetT.x=Math.max(n-t,Math.min(n+t,this.targetT.x)),this.targetT.z=Math.max(r-t,Math.min(r+t,this.targetT.z)),this.targetT.y=Math.max(o-t*.5,Math.min(o+t,this.targetT.y))}fireGesture(){this.gestureFired||(this.gestureFired=!0,this.onGesture?.())}currentPinchAngle(){let[t,n]=[...this.activePointers.values()];return t&&n?Math.atan2(n.y-t.y,n.x-t.x):0}dragAction(){return _d(this.primaryDragMode,this.distT,this.overviewDist)}currentPinchDistance(){let t=[...this.activePointers.values()];return t.length<2?0:Math.hypot(t[0].x-t[1].x,t[0].y-t[1].y)}dollyBy(t){this.distT=Math.max(this.minDist,Math.min(this.maxDist,this.distT*t)),this.requestRender()}dollyAt(t,n,o){let r=this.distT,i=this.canvas.getBoundingClientRect?.(),a=this.zoomPointResolver?.(n,o)??null;if(a){this.distT=Math.max(Ms,Math.min(this.maxDist,this.distT*t)),this.minDist=Math.min(this.minDist,Math.max(Ms,this.distT)),this.requestRender(),this.scaleTargetAbout(a,this.distT/r);return}let s=i&&i.width>0&&i.height>0?Rd([this.targetT.x,this.targetT.y,this.targetT.z],this.azT,this.polT,this.distT,this.fovY,this.camera.aspect||i.width/i.height,(n-i.left)/i.width*2-1,1-(o-i.top)/i.height*2):null;this.dollyBy(t),s&&this.scaleTargetAbout(s,this.distT/r)}scaleTargetAbout(t,n){!Number.isFinite(n)||n===1||(this.targetT.x=t[0]+(this.targetT.x-t[0])*n,this.targetT.y=t[1]+(this.targetT.y-t[1])*n,this.targetT.z=t[2]+(this.targetT.z-t[2])*n,this.clampPan())}setZoomPointResolver(t){this.zoomPointResolver=t}zoomBy(t){this.interactionEnabled&&(this.dollyBy(t),this.fireGesture())}dollyLimitState(){return{atMin:this.distT<=this.minDist+1e-6,atMax:this.distT>=this.maxDist-1e-6}}setPrimaryDragMode(t){this.primaryDragMode=t}setInteractionEnabled(t){this.interactionEnabled=t,!t&&(this.activePointers.clear(),this.dragging=!1,this.panning=!1,this.pinchDist=0)}frame(t,n=!1,o,r=!1,i){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.target.set(t.center[0],t.center[1],t.center[2]),this.targetT.copy(this.target),this.widenPanBox(t);let a=Math.max(1,t.radius),s=this.fovY*Be/2,c=r?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,l=Math.atan(Math.tan(s)*c);this.azT=o??-30*Be,this.polT=Math.max(15,Math.min(80,i?.polarDeg??55))*Be;let u=this.framedOn(t,s,l),m=u.distance;this.target.set(u.center[0],u.center[1],u.center[2]),this.targetT.copy(this.target),this.distT=m*Math.max(1.05,Math.min(2,i?.margin??ci)),this.envelope=xs(this.envelope,a,m),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.overviewDist===null&&(this.overviewDist=this.distT),n?(this.azimuth=this.azT,this.polar=12*Be,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(t){if(!(t>0)||!Number.isFinite(t))return;let n=this.camera.aspect;if(this.interactionEnabled&&n>0){let o=Math.min(n,1)/Math.min(t,1);this.distance*=o,this.distT*=o,this.overviewDist!==null&&(this.overviewDist*=o),this.maxDist=Math.max(this.maxDist,this.distance,this.distT),this.applyPosition()}this.camera.perspective({aspect:t})}glideTo(t,n){this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.widenPanBox(t),this.targetT.set(t.center[0],t.center[1],t.center[2]);let o=this.fovY*Be/2,r=Math.atan(Math.tan(o)*(this.camera.aspect||1));this.azT=this.azimuth,this.polT=Math.max(15,Math.min(80,n?.polarDeg??55))*Be;let i=this.framedOn(t,o,r),a=i.distance;this.targetT.set(i.center[0],i.center[1],i.center[2]),this.distT=a*Math.max(1.05,Math.min(2,n?.margin??ci)),this.envelope=xs(this.envelope,Math.max(1,t.radius),a),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.requestRender()}frameSoft(t,n,o=!1,r){this.target.set(t.center[0],t.center[1],t.center[2]),this.targetT.copy(this.target),this.widenPanBox(t),this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect});let i=this.fovY*Be/2,a=o?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,s=Math.atan(Math.tan(i)*a);this.azT=n??this.azimuth,this.polT=Math.max(15,Math.min(80,r?.polarDeg??55))*Be;let c=this.framedOn(t,i,s);this.targetT.set(c.center[0],c.center[1],c.center[2]),this.distT=c.distance*Math.max(1.05,Math.min(2,r?.margin??ci))}framedOn(t,n,o){return Ld(t,Math.tan(o),Math.tan(n),this.azT,this.polT,r=>this.fitDistance({...t,center:r},n,o,this.azT,this.polT))}fitDistance(t,n,o,r,i){let a=Math.max(1,t.radius),s=Math.max(a/Math.tan(n),a/Math.tan(o)),c=t.box;if(!c)return s;let l=Ss(r,i);if(!l)return s;let{fx:u,fy:m,fz:f,rx:d,rz:h,ux:p,uy:b,uz:y}=l,M=Math.tan(o),S=Math.tan(n),A=1;for(let R=0;R<8;R++){let k=(R&1?c.max[0]:c.min[0])-t.center[0],F=(R&2?c.max[1]:c.min[1])-t.center[1],E=(R&4?c.max[2]:c.min[2])-t.center[2],I=k*u+F*m+E*f,C=Math.abs(k*d+E*h),L=Math.abs(k*p+F*b+E*y);A=Math.max(A,C/M-I,L/S-I)}let x=Math.min(s,Math.max(A,a*.35)),g=t.fitPoints;if(!g||g.length<9)return x;let w=0,v=1/(M*vs),P=1/(S*vs);for(let R=0;R+2<g.length;R+=3){let k=g[R]-t.center[0],F=g[R+1]-t.center[1],E=g[R+2]-t.center[2],I=k*u+F*m+E*f,C=Math.abs(k*d+E*h),L=Math.abs(k*p+F*b+E*y);w=Math.max(w,C*v-I,L*P-I)}return Math.min(x*1.5,Math.max(x*.55,w))}updateClipping(t){let n=this.camera.position.x-t.center[0],o=this.camera.position.y-t.center[1],r=this.camera.position.z-t.center[2],i=Math.hypot(this.camera.position.x-this.target.x,this.camera.position.y-this.target.y,this.camera.position.z-this.target.z),a=this.interactionEnabled&&Math.abs(i-this.distance)<=this.distance*.01,{near:s,far:c}=Fd(Math.hypot(n,o,r),t.radius,a?this.distance:null);this.camera.perspective({near:s,far:c,aspect:this.camera.aspect})}update(){let t=this.azT-this.azimuth,n=this.polT-this.polar,o=this.distT-this.distance,r=this.targetT.x-this.target.x,i=this.targetT.y-this.target.y,a=this.targetT.z-this.target.z,s=Math.max(1e-4,this.distance*1e-4),c=Math.abs(t)>1e-4||Math.abs(n)>1e-4||Math.abs(o)>1e-4||Math.abs(r)>s||Math.abs(i)>s||Math.abs(a)>s;return this.azimuth+=t*sn,this.polar+=n*sn,this.distance+=o*sn,this.target.x+=r*sn,this.target.y+=i*sn,this.target.z+=a*sn,c&&this.applyPosition(),c}get currentAzimuth(){return this.azimuth}get currentDistance(){return this.distance}get targetDistance(){return this.distT}syncFromCamera(){let t=this.camera.position.x-this.target.x,n=this.camera.position.y-this.target.y,o=this.camera.position.z-this.target.z,r=Math.hypot(t,n,o)||1,i=Math.max(ai,Math.min(si,Math.acos(Math.max(-1,Math.min(1,n/r)))));this.distance=this.distT=r,this.polar=this.polT=i,this.azimuth=this.azT=Math.atan2(t,o)}snapshot(){let t=this.target.clone(),n=this.targetT.clone(),{azimuth:o,azT:r,polar:i,polT:a,distance:s,distT:c}=this,l=this.camera.position.clone(),u=[...this.camera.quaternion],m=this.camera.fov;return()=>{this.target.copy(t),this.targetT.copy(n),Object.assign(this,{azimuth:o,azT:r,polar:i,polT:a,distance:s,distT:c}),this.camera.position.copy(l),this.camera.quaternion.set(u[0],u[1],u[2],u[3]),this.camera.perspective({fov:m,aspect:this.camera.aspect}),this.camera.updateMatrixWorld()}}setTarget(t){this.target.set(t[0],t[1],t[2]),this.targetT.copy(this.target)}resumeAfterFlight(t){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),t&&this.target.set(t[0],t[1],t[2]),this.targetT.copy(this.target),this.syncFromCamera()}applyPosition(){let t=Math.sin(this.polar),n=this.target.x+this.distance*t*Math.sin(this.azimuth),o=this.target.y+this.distance*Math.cos(this.polar),r=this.target.z+this.distance*t*Math.cos(this.azimuth);this.camera.position.set(n,o,r),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()}},kd=.1,Od=.25;function Fd(e,t,n){let o=Math.max(1,t)*1.18,r=n==null?Od:Math.max(.05,n*kd),i=Math.max(r,e-o),a=Math.max(i+10,e+o);return{near:i,far:a}}var No=class{constructor(t){this.rafId=0;this.running=!1;this.lastTime=0;this.fpsEma=0;this.rendered=0;this.tick=t=>{let n=this.lastTime?(t-this.lastTime)/1e3:.016666666666666666;if(this.lastTime=t,n>0){let r=1/n;this.fpsEma=this.fpsEma?this.fpsEma*.9+r*.1:r}this.rendered++,this.frame(n)?this.rafId=requestAnimationFrame(this.tick):(this.running=!1,this.rafId=0)};this.frame=t}requestRender(){this.running||(this.running=!0,this.lastTime=0,this.rafId=requestAnimationFrame(this.tick))}stats(){return{fps:this.running?Math.round(this.fpsEma):0,rendered:this.rendered,idle:!this.running}}stop(){this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=0,this.running=!1}};function ws(e){let t=!1;return n=>{n!==t&&(t=n,n?e.dataset.slReady="1":delete e.dataset.slReady)}}function li(e,t,n){return Math.max(t,Math.min(n,e))}function Dd(e){return li(e,0,1)}function Ps(e){let t=Dd(e);return t*t*(3-2*t)}var un=2.5,Nd=1.15,Zn=12,mn=22,As=6,Is=9.5,Rs=.9,Es=2.2,ui=30,mi=4,Bo=8192;var TM=mn+mi;function Cs(e,t){let n=t*1.4,o=t*3.2;if(e<=n)return{scale:1,fade:0,minPixels:un};let r=Math.min(1,(e-n)/Math.max(.001,o-n));return{scale:1-r*.4,fade:r*.55,minPixels:un+r*(Nd-un)}}function _s(e,t,n){return!(e>0)||!(t>0)||!(n>0)?!1:t*n/e>=64}var Bd=12;function Ts(e,t,n,o,r){if(!(e>0)||!(t>0)||!(n>0)||!(o>0)||!(r>0))return!1;let i=Math.tan(o/2*Math.PI/180);if(!(i>0))return!1;let a=t/(n*i)*(r/2);return Math.PI*a*a/e>=Bd}var fi=[{key:"wheelchair",label:"Wheelchair space",short:"Wheelchair",icon:"\u267F"},{key:"companion",label:"Companion seat",short:"Companion",icon:"\u{1F9D1}\u200D\u{1F91D}\u200D\u{1F9D1}"},{key:"semi-ambulatory",label:"Semi-ambulatory (limited mobility)",short:"Limited mobility",icon:"\u{1F9AF}"},{key:"designated-aisle",label:"Designated aisle / transfer seat",short:"Aisle transfer",icon:"AS"},{key:"step-free",label:"Step-free accessible seat",short:"Step-free",icon:"SF"},{key:"hearing",label:"Assistive listening",short:"Hearing",icon:"\u{1F9BB}"},{key:"cart",label:"CART live-caption view",short:"CART captions",icon:"CC"},{key:"sign-language",label:"Sign-language view",short:"Sign language",icon:"\u{1F91F}"},{key:"low-vision",label:"Blind / low-vision viewing",short:"Low vision",icon:"LV"},{key:"sensory-friendly",label:"Quiet / sensory-friendly seating",short:"Sensory-friendly",icon:"QS"},{key:"plus-size",label:"Plus-size seat",short:"Plus-size",icon:"\u{1F4BA}"},{key:"lift-armrest",label:"Lift-up armrest",short:"Lift armrest",icon:"\u2195\uFE0F"}],kM=new Map(fi.map(e=>[e.key,e]));var Vd={wheelchair:"#3b82f6",companion:"#8b5cf6","semi-ambulatory":"#0ea5e9","designated-aisle":"#0284c7","step-free":"#16a34a",hearing:"#14b8a6",cart:"#7c3aed","sign-language":"#f59e0b","low-vision":"#d97706","sensory-friendly":"#6366f1","plus-size":"#ec4899","lift-armrest":"#22c55e"};function Vo(e){let t=e?.[0];return t&&Vd[t]||"#3b82f6"}var Gd=[{key:"obstructedView",label:"Obstructed view",short:"Obstructed",icon:"\u26D4"},{key:"restrictedView",label:"Restricted view",short:"Restricted",icon:"\u{1F441}"},{key:"premium",label:"Premium seat",short:"Premium",icon:"\u2605"}],OM=new Map(Gd.map(e=>[e.key,e]));var Hd=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],FM=new Set(Hd);var ks=[{key:"circle",label:"Standard seat",shortLabel:"Standard",useCase:"General assigned seating",group:"general",path:null,bounds:null,mark:null},{key:"theatre",label:"Theatre chair",shortLabel:"Theatre",useCase:"Auditoriums, arenas and stadium stands",group:"fixed",path:"M4.5 3.5 Q4.5 1.5 6.5 1.5 L17.5 1.5 Q19.5 1.5 19.5 3.5 L19.5 13 L4.5 13 Z M3.5 12 L20.5 12 Q22.5 12 22.5 14 L22.5 21 Q22.5 22.5 21 22.5 Q19.5 22.5 19.5 21 L19.5 17.5 L4.5 17.5 L4.5 21 Q4.5 22.5 3 22.5 Q1.5 22.5 1.5 21 L1.5 14 Q1.5 12 3.5 12 Z",bounds:{x:1.5,y:1.5,width:21,height:21},mark:{x:12,y:10,radius:6}},{key:"dining",label:"Dining chair",shortLabel:"Dining",useCase:"Banquets, restaurants and table seating",group:"flexible",path:"M7 1 Q6 1 6 2.5 L6.75 10.5 L5 10.5 Q4 10.5 4 12 L4 14 Q4 15 5.25 15 L6 15 L4 23 L7 23 L9.5 15 L14.5 15 L17 23 L20 23 L18 15 L18.75 15 Q20 15 20 14 L20 12 Q20 10.5 19 10.5 L17.25 10.5 L18 2.5 Q18 1 17 1 Z",bounds:{x:4,y:1,width:16,height:22},mark:{x:12,y:10,radius:4.5}},{key:"folding",label:"Folding chair",shortLabel:"Folding",useCase:"Concert floors, ceremonies and conferences",group:"flexible",path:"M6 2 Q5 2 5 3 L6 8 L18 8 L19 3 Q19 2 18 2 Z M5 9 L19 9 Q20 9 20 10.5 L19 13 L5 13 L4 10.5 Q4 9 5 9 Z M6 12 L9 12 L12 17 L15 12 L18 12 L14 19 L17 23 L14 23 L12 21 L10 23 L7 23 L10 19 Z",bounds:{x:4,y:2,width:16,height:21},mark:{x:12,y:5,radius:3}},{key:"armchair",label:"Premium armchair",shortLabel:"Armchair",useCase:"Boxes, lounges and club seating",group:"premium",path:"M3.5 4 Q3.5 1.5 6 1.5 L18 1.5 Q20.5 1.5 20.5 4 L20.5 13 L3.5 13 Z M1.5 12.5 Q1.5 10 3.25 10 Q5 10 5 12.5 L5 13.5 L19 13.5 L19 12.5 Q19 10 20.75 10 Q22.5 10 22.5 12.5 L22.5 19.5 Q22.5 22 20 22 L4 22 Q1.5 22 1.5 19.5 Z",bounds:{x:1.5,y:1.5,width:21,height:20.5},mark:{x:12,y:7.5,radius:5.5}},{key:"recliner",label:"Recliner",shortLabel:"Recliner",useCase:"Luxury cinemas and premium clubs",group:"premium",path:"M7 2 Q7 1 8.5 1 L15.5 1 Q17 1 17 2 L19 13 L5 13 Z M4 9 Q2 9 2 11.5 L2 16 Q2 18 4 18 L6 18 L6 15 L18 15 L18 18 L20 18 Q22 18 22 16 L22 11.5 Q22 9 20 9 Q18 9 18 11 L18 13 L6 13 L6 11 Q6 9 4 9 Z M7 17 L17 17 Q18 17 18.5 18.5 L19.5 22.5 L4.5 22.5 L5.5 18.5 Q6 17 7 17 Z",bounds:{x:2,y:1,width:20,height:21.5},mark:{x:12,y:8,radius:5}},{key:"stool",label:"Stool",shortLabel:"Stool",useCase:"Bars, high-tops and seating rails",group:"flexible",path:"M6 2.5 L18 2.5 Q22 2.5 22 6.5 L22 12 Q22 16 18 16 L6 16 Q2 16 2 12 L2 6.5 Q2 2.5 6 2.5 Z M6 15.5 L9.5 15.5 L7.5 22.5 L3 22.5 Z M14.5 15.5 L18 15.5 L20.5 22.5 L16 22.5 Z",bounds:{x:2,y:2.5,width:20,height:20},mark:{x:12,y:9.25,radius:6.5}},{key:"bench",label:"Bench place",shortLabel:"Bench",useCase:"Pews, bleachers and terraces",group:"fixed",path:"M2.5 0.5 L21.5 0.5 Q23 0.5 23 2 L23 5 Q23 6.5 21.5 6.5 L2.5 6.5 Q1 6.5 1 5 L1 2 Q1 0.5 2.5 0.5 Z M2 7.5 L22 7.5 Q23.5 7.5 23.5 9 L23.5 15.5 Q23.5 17 22 17 L18 17 L18 21.5 Q18 22.5 16.75 22.5 Q15.5 22.5 15.5 21.5 L15.5 17 L8.5 17 L8.5 21.5 Q8.5 22.5 7.25 22.5 Q6 22.5 6 21.5 L6 17 L2 17 Q0.5 17 0.5 15.5 L0.5 9 Q0.5 7.5 2 7.5 Z",bounds:{x:.5,y:.5,width:23,height:22},mark:{x:12,y:12.25,radius:4.75}}],Os=ks.map(e=>e.key),zd=new Map(ks.map(e=>[e.key,e]));function Ls(e){return typeof e=="string"&&zd.has(e)}function Fs(e,t){return Ls(e)?e:Ls(t?.seatGlyph)?t.seatGlyph:"circle"}var fe=.02291666666666667,et=1/fe,Ud=58,jd=Ud*fe;var Wd=3,Ds=0,di=120,Xd=0,Yd=45,Kd=7,ht=1.2;function hi(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function $d(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Kd?e:Wd}function Ct(e,t={}){let n=hi(t.floorBaseHeightM,Ds,di,0),o=Math.min(di,n+$d(e.elevation)*jd),r=e.height===void 0?o:hi(e.height,Ds,di,o),i=hi(e.rake,Xd,Yd,0);return{height:r,rake:i}}var Bs=ft(require("earcut"),1),yi=ft(require("polygon-clipping"),1);var HM=Math.PI/180;function Ve(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function pi(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function bi(e){let t=0,n=0;for(let r of e)t+=r.x,n+=r.y;let o=e.length||1;return{x:t/o,y:n/o}}function fn(e){return e.length?bi(e):null}function $e(e){let t=0;for(let n=0,o=e.length;n<o;n+=1){let r=e[n],i=e[(n+1)%o];t+=r.x*i.y-i.x*r.y}return t/2}function Ze(e,t,n){let o=!1;for(let r=0,i=e.length-1;r<e.length;i=r++){let a=e[r],s=e[i];a.y>n!=s.y>n&&t<(s.x-a.x)*(n-a.y)/(s.y-a.y)+a.x&&(o=!o)}return o}var _=fe,Zd=.002;function qd(e,t,n){let o=Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2]),r=Math.hypot(n[0]-t[0],n[1]-t[1],n[2]-t[2]),i=Math.hypot(e[0]-n[0],e[1]-n[1],e[2]-n[2]),a=Math.max(o,r,i);if(a<1e-9)return!0;let s=(o+r+i)/2;return 2*Math.sqrt(Math.max(0,s*(s-o)*(s-r)*(s-i)))/a<Zd}var Kt=class{constructor(t=16384){this.len=0;this.buf=new Float32Array(t)}push3(t,n,o){this.len+3>this.buf.length&&this.grow(this.len+3),this.buf[this.len++]=t,this.buf[this.len++]=n,this.buf[this.len++]=o}push1(t){this.len+1>this.buf.length&&this.grow(this.len+1),this.buf[this.len++]=t}grow(t){let n=this.buf.length*2;for(;n<t;)n*=2;let o=new Float32Array(n);o.set(this.buf.subarray(0,this.len)),this.buf=o}get length(){return this.len}toArray(){return this.buf.slice(0,this.len)}},zo=class{constructor(){this.pos=new Kt;this.nor=new Kt;this.col=new Kt;this.flr=new Kt;this.mat=new Kt;this.currentFloor=0;this.currentMaterial=0}setFloor(t){this.currentFloor=t}setMaterial(t){this.currentMaterial=t}tri(t,n,o,r,i,a=i,s=i){qd(t,n,o)||(this.pos.push3(t[0],t[1],t[2]),this.pos.push3(n[0],n[1],n[2]),this.pos.push3(o[0],o[1],o[2]),this.nor.push3(r[0],r[1],r[2]),this.nor.push3(r[0],r[1],r[2]),this.nor.push3(r[0],r[1],r[2]),this.col.push3(i[0],i[1],i[2]),this.col.push3(a[0],a[1],a[2]),this.col.push3(s[0],s[1],s[2]),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial))}triN(t,n,o,r,i,a,s,c=s,l=s){[...t,...n,...o].every(Number.isFinite)&&(this.pos.push3(t[0],t[1],t[2]),this.pos.push3(n[0],n[1],n[2]),this.pos.push3(o[0],o[1],o[2]),this.nor.push3(r[0],r[1],r[2]),this.nor.push3(i[0],i[1],i[2]),this.nor.push3(a[0],a[1],a[2]),this.col.push3(s[0],s[1],s[2]),this.col.push3(c[0],c[1],c[2]),this.col.push3(l[0],l[1],l[2]),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial))}get vertexCount(){return this.pos.length/3}build(){return{position:this.pos.toArray(),normal:this.nor.toArray(),color:this.col.toArray(),floor:this.flr.toArray(),material:this.mat.toArray(),count:this.pos.length/3}}};function Qd(e,t,n){let o=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=n[0]-e[0],s=n[1]-e[1],c=n[2]-e[2],l=r*c-i*s,u=i*a-o*c,m=o*s-r*a,f=Math.hypot(l,u,m)||1;return l/=f,u/=f,m/=f,[l,u,m]}function Jd(e,t){let n=[...e],o=[];for(let a of e)o.push(a.x,a.y);let r=[];if(t){for(let a of t)if(!(a.length<3)){r.push(n.length);for(let s of a)n.push(s),o.push(s.x,s.y)}}let i=(0,Bs.default)(o,r.length?r:void 0,2);return{pts:n,tris:i}}function pt(e){return $e(e)<0?[...e].reverse():e}var eh=3;function th(e,t,n,o){let r=o(e),i=o(t),a=o(n),s=(d,h,p,b)=>Math.abs(o({x:(d.x+h.x)/2,y:(d.y+h.y)/2})-(p+b)/2),c=(e.x+t.x+n.x)/3,l=(e.y+t.y+n.y)/3,u=(r+i+a)/3,m=Math.max(s(e,t,r,i),s(t,n,i,a),s(n,e,a,r),Math.abs(o({x:c,y:l})-u)),f=(d,h,p)=>{let b=Math.abs(o({x:(d+c)/2,y:(h+l)/2})-(p+u)/2);b>m&&(m=b)};return f((e.x+t.x)/2,(e.y+t.y)/2,(r+i)/2),f((t.x+n.x)/2,(t.y+n.y)/2,(i+a)/2),f((n.x+e.x)/2,(n.y+e.y)/2,(a+r)/2),m}function qn(e,t,n,o,r){if(r<=0)return th(e,t,n,o);let i={x:(e.x+t.x)/2,y:(e.y+t.y)/2},a={x:(t.x+n.x)/2,y:(t.y+n.y)/2},s={x:(n.x+e.x)/2,y:(n.y+e.y)/2};return Math.max(qn(e,i,s,o,r-1),qn(i,t,a,o,r-1),qn(s,a,n,o,r-1),qn(i,a,s,o,r-1))}function Qn(e,t,n,o,r,i,a,s){if(a>0){let f={x:(t.x+n.x)/2,y:(t.y+n.y)/2},d={x:(n.x+o.x)/2,y:(n.y+o.y)/2},h={x:(o.x+t.x)/2,y:(o.y+t.y)/2};Qn(e,t,f,h,r,i,a-1,s),Qn(e,f,n,d,r,i,a-1,s),Qn(e,h,d,o,r,i,a-1,s),Qn(e,f,d,h,r,i,a-1,s);return}let c=[t.x*_,r(t),t.y*_],l=[n.x*_,r(n),n.y*_],u=[o.x*_,r(o),o.y*_];if(s){e.triN(c,l,u,s(t),s(n),s(o),i);return}let m=Qd(c,l,u);m[1]<0&&(m=[-m[0],-m[1],-m[2]]),e.tri(c,l,u,m,i)}var nh=8;function Ns(e,t,n){if(!Number.isFinite(n))return e;let o=[],r=(i,a,s,c,l)=>{if(l>0){let u={x:(i.x+a.x)/2,y:(i.y+a.y)/2},m=t(u);if(Math.abs(m-(s+c)/2)>n){r(i,u,s,m,l-1),r(u,a,m,c,l-1);return}}o.push(i)};for(let i=0;i<e.length;i++){let a=e[i],s=e[(i+1)%e.length];r(a,s,t(a),t(s),nh)}return o}function Go(e,t){if(e.length<3)return e;let n=[];for(let r of e){let i=n[n.length-1];i&&Math.hypot(r.x-i.x,r.y-i.y)<t||n.push(r)}for(;n.length>2&&Math.hypot(n[0].x-n[n.length-1].x,n[0].y-n[n.length-1].y)<t;)n.pop();if(n.length<3)return e;let o=[];for(let r=0;r<n.length;r++){let i=o.length?o[o.length-1]:n[(r-1+n.length)%n.length],a=n[r],s=n[(r+1)%n.length],c=s.x-i.x,l=s.y-i.y,u=Math.hypot(c,l);u>t&&Math.abs((a.x-i.x)*l-(a.y-i.y)*c)/u<t||o.push(a)}return o.length>=3?o:n}var Ho=.001*et*.1;function ue(e,t,n,o,r,i,a,s,c=1/0,l){if(!t||t.length<3||(c===void 0&&(c=1/0),Math.abs($e(t))<1e-4))return;let u=Go(Ns(Go(pt(t),Ho),o,c),Ho),m=n?.map(g=>Go(Ns(Go(pt(g),Ho),o,c),Ho)).filter(g=>g.length>=3&&Math.abs($e(g))>=1e-4),{pts:f,tris:d}=Jd(u,m),h=[i[0]*s.top,i[1]*s.top,i[2]*s.top],p=[i[0]*s.bottomCap,i[1]*s.bottomCap,i[2]*s.bottomCap],b=[a[0]*s.top,a[1]*s.top,a[2]*s.top],y=[a[0]*s.wallBottom,a[1]*s.wallBottom,a[2]*s.wallBottom],M=0;if(Number.isFinite(c))for(;M<eh;M++){let g=0;for(let w=0;w<d.length;w+=3){let v=qn(f[d[w]],f[d[w+1]],f[d[w+2]],o,M);v>g&&(g=v)}if(g<=c)break}for(let g=0;g<d.length;g+=3){let w=f[d[g]],v=f[d[g+1]],P=f[d[g+2]];Qn(e,w,v,P,o,h,M,l);let R=[w.x*_,r,w.y*_],k=[v.x*_,r,v.y*_],F=[P.x*_,r,P.y*_];e.tri(R,F,k,[0,-1,0],p)}let S=g=>{if(M<=0)return g;let w=1<<M,v=[];for(let P=0;P<g.length;P++){let R=g[P],k=g[(P+1)%g.length];for(let F=0;F<w;F++){let E=F/w;v.push({x:R.x+(k.x-R.x)*E,y:R.y+(k.y-R.y)*E})}}return v},A=bi(u),x=[{ring:S(u),flip:!1}];if(m)for(let g of m)g.length>=3&&x.push({ring:S(g),flip:!0});for(let{ring:g,flip:w}of x)for(let v=0;v<g.length;v++){let P=g[v],R=g[(v+1)%g.length],k=(R.x-P.x)*_,E=(R.y-P.y)*_,I=-k,C=Math.hypot(E,I)||1;E/=C,I/=C;let L=(P.x+R.x)/2-A.x,N=(P.y+R.y)/2-A.y,O=E*L+I*N;w&&(O=-O),O<0&&(E=-E,I=-I);let H=[E,0,I],j=[P.x*_,o(P),P.y*_],V=[R.x*_,o(R),R.y*_],T=[P.x*_,r,P.y*_],B=[R.x*_,r,R.y*_];e.tri(j,V,B,H,b,b,y),e.tri(j,B,T,H,b,y,y)}}function Vs(e){let t=0;for(let c of e)t+=c.count;let n=new Float32Array(t*3),o=new Float32Array(t*3),r=new Float32Array(t*3),i=new Float32Array(t),a=new Float32Array(t),s=0;for(let c of e)n.set(c.position,s*3),o.set(c.normal,s*3),r.set(c.color,s*3),i.set(c.floor,s),a.set(c.material,s),s+=c.count;return{position:n,normal:o,color:r,floor:i,material:a,count:t}}function at(e,t,n=2.5){if(t<=0||e.length<3)return e;let o=pt(e),r=o.length,i=[];for(let s=0;s<r;s++){let c=o[s],l=o[(s+1)%r],u=l.x-c.x,m=l.y-c.y,f=Math.hypot(u,m)||1;i.push({x:m/f,y:-u/f})}let a=[];for(let s=0;s<r;s++){let c=o[s],l=i[(s-1+r)%r],u=i[s],m=l.x+u.x,f=l.y+u.y,d=Math.hypot(m,f),h=()=>{a.push([c.x+l.x*t,c.y+l.y*t]),a.push([c.x+u.x*t,c.y+u.y*t])};if(d<1e-9){h();continue}m/=d,f/=d;let p=m*l.x+f*l.y,b=1/Math.max(p,1e-6);if(!Number.isFinite(b)||b>n){h();continue}a.push([c.x+m*t*b,c.y+f*t*b])}if(a.length<3)return e;try{let s=yi.default.union([[...a,a[0]]]),c=null,l=-1/0;for(let m of s){let f=Math.abs($e(m[0].map(([d,h])=>({x:d,y:h}))));f>l&&(l=f,c=m[0])}if(!c)return e;let u=c.map(([m,f])=>({x:m,y:f}));if(u.length>1){let m=u[0],f=u[u.length-1];Math.abs(m.x-f.x)<1e-9&&Math.abs(m.y-f.y)<1e-9&&u.pop()}return u.length>=3?u:e}catch{return e}}function _t(e,t,n=2.5){if(e.length<3)return[];if(t<=0)return e;let o=pt(e),r=o.length,i=[];for(let c=0;c<r;c++){let l=o[c],u=o[(c+1)%r],m=Math.hypot(u.x-l.x,u.y-l.y)||1;i.push({x:-(u.y-l.y)/m,y:(u.x-l.x)/m})}let a=[],s=[];for(let c=0;c<r;c++){let l=o[c],u=i[(c-1+r)%r],m=i[c],f=u.x+m.x,d=u.y+m.y,h=Math.hypot(f,d),p=h<1e-9?1/0:1/Math.max(f/h*u.x+d/h*u.y,1e-6);if(!Number.isFinite(p)||p>n){a.push({x:l.x+u.x*t,y:l.y+u.y*t},{x:l.x+m.x*t,y:l.y+m.y*t}),s.push(c,c);continue}f/=h,d/=h,a.push({x:l.x+f*t*p,y:l.y+d*t*p}),s.push(c)}for(let c=0;c<a.length;c++){let l=(c+1)%a.length,u=s[c],m=s[l];if(m!==(u+1)%r)continue;let f=o[u],d=o[m];if((a[l].x-a[c].x)*(d.x-f.x)+(a[l].y-a[c].y)*(d.y-f.y)<=0)return[]}try{let c=yi.default.intersection([[...a.map(h=>[h.x,h.y]),[a[0].x,a[0].y]]],[[...o.map(h=>[h.x,h.y]),[o[0].x,o[0].y]]]),l=null,u=0;for(let h of c){let p=Math.abs($e(h[0].map(([b,y])=>({x:b,y}))));p>u&&(u=p,l=h[0])}if(!l)return[];let m=l.map(([h,p])=>({x:h,y:p})),f=m[0],d=m[m.length-1];return m.length>1&&Math.abs(f.x-d.x)<1e-9&&Math.abs(f.y-d.y)<1e-9&&m.pop(),m.length>=3?pt(m):[]}catch{return[]}}function Uo(e,t,n,o,r=28){let i=[];for(let a=0;a<r;a++){let s=a/r*Math.PI*2;i.push({x:e+n*Math.cos(s),y:t+o*Math.sin(s)})}return i}function Jn(e,t,n,o){return[{x:e,y:t},{x:e+n,y:t},{x:e+n,y:t+o},{x:e,y:t+o}]}var St=.22;function Gs(e,t){let n=ze[e];if(n!=="sold"&&n!=="held")return-1;let o=(t+1)*2654435761;return o^=o>>>15,o=Math.imul(o,2246822519),o^=o>>>13,(o>>>0)%1e5/1e5}var oh=.42;function rh(e){let t=e.length,n=new Float64Array(t);if(t<2)return n.fill(1/0),n;let o=1/0,r=1/0,i=-1/0,a=-1/0;for(let h of e)h.x<o&&(o=h.x),h.y<r&&(r=h.y),h.x>i&&(i=h.x),h.y>a&&(a=h.y);let s=Math.max(i-o,1e-6),c=Math.max(a-r,1e-6),l=Math.max(Math.sqrt(s*c/t),1e-6),u=Math.max(1,Math.ceil(s/l)+1),m=Math.max(1,Math.ceil(c/l)+1),f=new Map,d=(h,p)=>{let b=Math.min(u-1,Math.max(0,Math.floor((h-o)/l)));return Math.min(m-1,Math.max(0,Math.floor((p-r)/l)))*u+b};for(let h=0;h<t;h++){let p=d(e[h].x,e[h].y),b=f.get(p);b?b.push(h):f.set(p,[h])}for(let h=0;h<t;h++){let p=e[h],b=Math.min(u-1,Math.max(0,Math.floor((p.x-o)/l))),y=Math.min(m-1,Math.max(0,Math.floor((p.y-r)/l))),M=1/0;for(let S=1;S<=4;S++){for(let A=y-S;A<=y+S;A++)if(!(A<0||A>=m))for(let x=b-S;x<=b+S;x++){if(x<0||x>=u||S>1&&Math.abs(A-y)<S&&Math.abs(x-b)<S)continue;let g=f.get(A*u+x);if(g)for(let w of g){if(w===h)continue;let v=Math.hypot(e[w].x-p.x,e[w].y-p.y);v<M&&(M=v)}}if(Number.isFinite(M)&&M<=S*l)break}n[h]=M}return n}function ih(e){let t=e.eyeHeightM;return Number.isFinite(t)?Math.max(0,t-ht):0}function Hs(e,t,n,o,r,i){let a=e.length,s=new Float32Array(a*3),c=new Float32Array(a),l=new Float32Array(a*3),u=new Float32Array(a),m=new Float32Array(a),f=new Float32Array(a),d=new Float32Array(a),h=new Float32Array(a*3),p=new Map,b=rh(e);for(let y=0;y<a;y++){let M=e[y],A=(n?.seatPitchU(y)??b[y])*_;u[y]=Number.isFinite(A)?Math.max(.06,Math.min(St,A*oh)):St,m[y]=ns(Number.isFinite(A)?A:void 0);let x=Fs(M.glyph,{seatGlyph:i?.get(M.categoryKey)});f[y]=Os.indexOf(x),d[y]=M.wheelchairSpaceType==="no-seat"?0:1,s[y*3]=M.x*_,s[y*3+1]=n?n.seatDeckY(y):ih(M),s[y*3+2]=M.y*_,c[y]=Kn(t?t(M):"available");let g=ye(r?.get(M.categoryKey)??"#6e7bff")??[.43,.48,1];if(l[y*3]=g[0],l[y*3+1]=g[1],l[y*3+2]=g[2],M.accessibility?.length){let w=ye(Vo(M.accessibility));w&&(h[y*3]=w[0],h[y*3+1]=w[1],h[y*3+2]=w[2])}p.set(M.id,y)}return{count:a,iPosition:s,iState:c,iCategory:l,iMaxRadius:u,iRing:h,idToIndex:p,iChairWidth:m,iGlyph:f,iPhysicalSeat:d,iFloor:o??new Float32Array(a),iSection:new Float32Array(a).fill(-1),iYaw:new Float32Array(a)}}var ah=64;function gi(e,t){let n=[];for(let a of t){let s=e.idToIndex.get(a.seatId);if(s===void 0)continue;let c=Kn(a.state);e.iState[s]!==c&&(e.iState[s]=c,n.push(s))}if(!n.length)return[];n.sort((a,s)=>a-s);let o=[],r=n[0],i=n[0];for(let a=1;a<n.length;a++){let s=n[a];if(s!==i){if(s<=i+ah){i=s;continue}o.push({start:r,length:i-r+1}),r=s,i=s}}return o.push({start:r,length:i-r+1}),o}var eo=3,$t=.38,to=.24;function sh(e){if(e.length<3)return null;let t=e[0],n=e[Math.floor(e.length/2)],o=e[e.length-1],r=(n.x-t.x)*_,i=(n.y-t.y)*_,a=(o.x-t.x)*_,s=(o.y-t.y)*_,c=2*(r*s-i*a);if(Math.abs(c)<1e-7)return null;let l=r*r+i*i,u=a*a+s*s,m=(l*s-u*i)/c+t.x*_,f=(r*u-a*l)/c+t.y*_,d=Math.hypot(t.x*_-m,t.y*_-f);return d<1||d>200||!Number.isFinite(d)||e.some(h=>Math.abs(Math.hypot(h.x*_-m,h.y*_-f)-d)>.03)?null:{x:m,z:f,radius:d}}function zs(e){let t=[],n=new Map,o=(c,l)=>`${Math.floor(c/eo)},${Math.floor(l/eo)}`;for(let c of e)for(let l of c.rows){for(let m of l.pts){let f=m.x*_,d=m.y*_,h=o(f,d),p=n.get(h)??[];p.push({x:f,z:d,y:l.y,floor:c.floorIndex}),n.set(h,p)}if(l.patch||l.pts.length<2)continue;let u=sh(l.pts);for(let m of[0,l.pts.length-1]){let f=l.pts[m],d=l.pts[m===0?1:m-1],h=f.x-d.x,p=f.y-d.y,b=Math.hypot(h,p);b<1e-6||t.push({sectionId:c.sectionId,floorIndex:c.floorIndex,curve:u,row:l,point:f,x:f.x*_,z:f.y*_,dx:h/b,dz:p/b})}}let r=new Map;t.forEach((c,l)=>{let u=o(c.x,c.z),m=r.get(u)??[];m.push(l),r.set(u,m)});let i=(c,l)=>{let u=Math.floor(c/eo),m=Math.floor(l/eo);return[-1,0,1].flatMap(f=>[-1,0,1].map(d=>`${u+f},${m+d}`))},a=new Map;t.forEach((c,l)=>{let u=-1,m=1/0,f=!1;for(let d of i(c.x,c.z))for(let h of r.get(d)??[]){let p=t[h];if(c.sectionId===p.sectionId&&c.row.blockId===p.row.blockId||c.floorIndex!==p.floorIndex||Math.abs(c.row.y-p.row.y)>.05)continue;let b=p.x-c.x,y=p.z-c.z,M=Math.hypot(b,y);if(M<$t*2+.45||M>eo)continue;let S=c.curve&&p.curve&&Math.hypot(c.curve.x-p.curve.x,c.curve.z-p.curve.z)<=.05&&Math.abs(c.curve.radius-p.curve.radius)<=.05,A=Math.min((b*c.dx+y*c.dz)/M,(-b*p.dx-y*p.dz)/M);(S?A<.8:A<.98)||!S&&(Math.abs(b*c.dz-y*c.dx)>.15||Math.abs(b*p.dz-y*p.dx)>.15)||(M<m-.02?(u=h,m=M,f=!1):Math.abs(M-m)<=.02&&(f=!0))}u>=0&&!f&&a.set(l,u)});let s=[];for(let[c,l]of a){if(c>=l||a.get(l)!==c)continue;let u=t[c],m=t[l],f=Math.hypot(m.x-u.x,m.z-u.z),d=(m.x-u.x)/f,h=(m.z-u.z)/f,p=!1;for(let y of i((u.x+m.x)/2,(u.z+m.z)/2))for(let M of n.get(y)??[]){if(M.floor!==u.floorIndex||Math.abs(M.y-u.row.y)>.75)continue;let S=(M.x-u.x)*d+(M.z-u.z)*h,A=Math.abs((M.x-u.x)*h-(M.z-u.z)*d);S>.01&&S<f-.01&&A<to+$t&&(p=!0)}if(p)continue;let b=(y,M)=>({x:(u.x+d*y-h*M)/_,y:(u.z+h*y+d*M)/_});s.push({sections:[u.sectionId,m.sectionId],blocks:[u.row.blockId,m.row.blockId],floorIndex:u.floorIndex,ends:[u.point,m.point],clearWidthM:f-2*$t,heightM:(u.row.y+m.row.y)/2,outline:[b($t,-to),b(f-$t,-to),b(f-$t,to),b($t,to)]})}return s}var ch=.15,lh=1.6;function Us(e){return li(e??1,ch,lh)}var uh=.15,mh=.9,fh=1.76;function js(e){return xi(e)?{zenith:[.36,.58,.84],horizon:[.82,.88,.94]}:{zenith:[.05,.08,.15],horizon:[.3,.38,.5]}}function xi(e){return!!e&&e[0]*.2126+e[1]*.7152+e[2]*.0722>.55}function dh(){return{background:{top:[...Yt.top],bottom:[...Yt.bottom]},sky:js(null),structure:ii,seatStates:{...hs},seatScale:1,materials:{seat:null,shell:null,roughness:.78}}}function hh(e){return xi(e)?{deck:"#c9ccc8",fascia:"#b4bab8",shell:"#c3c9c8",roughness:.87}:{deck:"#69747b",fascia:"#3e4d58",shell:"#526572",roughness:.87}}function Ws(e){let t=dh();e??={};let n=ye(e.background);if(n){t.background={top:le(n,mh),bottom:le(n,fh)},t.sky=js(n);let s={};for(let[l,u]of Object.entries(ii))s[l]=ge(u,n,uh);n[0]*.2126+n[1]*.7152+n[2]*.0722>.55&&(s.ground=le(n,.86)),t.structure=s}let o=ye(e.selectionColor)??ye(e.accent);o&&(t.seatStates={...t.seatStates,selected:o});let r=e.seatScale;typeof r=="number"&&Number.isFinite(r)&&(t.seatScale=Us(r));let i=Object.fromEntries(Object.entries(e.venue3d??{}).filter(([,s])=>s!=null)),a={...hh(n),...i};if(a){let s=ye(a.deck),c=ye(a.fascia);s&&(t.structure={...t.structure,tierTop:s,gaTop:s}),c&&(t.structure={...t.structure,tierWall:c,gaWall:c}),t.materials.seat=ye(a.seat),t.materials.shell=ye(a.shell),typeof a.roughness=="number"&&Number.isFinite(a.roughness)&&(t.materials.roughness=Math.min(1,Math.max(0,a.roughness)))}return ph(t,xi(n)),t}function ph(e,t){let n=Xt(t);e.seatStates={...e.seatStates,held:ko(n.unavailable),sold:ko(n.unavailable),dimmed:ko(n.dimmed)};let o=(i,a)=>Wt(i,a,Math.min(Yn(i),Oo)),r=e.structure;e.structure={...r,ground:o(r.ground,n.ground),tierTop:o(r.tierTop,n.deck),tierWall:o(r.tierWall,n.fascia)},e.materials.shell&&(e.materials.shell=o(e.materials.shell,n.shell))}function Xs(e,t){let n=[];for(let o of t)n.push(...e.seatStates[o]);return n}var bh=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing"]),yh=new Set(["pitch-football","track-athletics","oval-cricket","pitch-rugby","diamond-baseball"]);function Zt(e){return!!e&&bh.has(e)}function jo(e){return!!e&&yh.has(e)}var Mi=1.1;function $s(e){return Xo(e)?e==="ring-boxing"?Mi:.06:1}var gh={round:{width:6,height:6},"pitch-football":{width:105,height:68},"rink-hockey":{width:60,height:30},"track-athletics":{width:176.9,height:92.5},"oval-cricket":{width:150,height:140},"pitch-rugby":{width:120,height:70},"diamond-baseball":{width:140,height:140},"court-basketball":{width:32,height:19},"court-tennis":{width:36.57,height:18.29},"ring-boxing":{width:7.8,height:7.8}},xh={"pitch-football":"#2f7d4f","rink-hockey":"#e8f1f8","track-athletics":"#a4472f","oval-cricket":"#3d8a53","pitch-rugby":"#2f7d4f","diamond-baseball":"#2f7d4f","court-basketball":"#c8894f","court-tennis":"#3f7a5a","ring-boxing":"#2a4d8f"};var Mh=Math.PI*2;function vh(e,t,n,o,r,i){return{x:r+e*n-t*o,y:i+e*o+t*n}}function Ys(e,t){let n=Math.max(0,e-t),o=[],r=20;for(let i=0;i<=r;i++){let a=-Math.PI/2+i/r*Math.PI;o.push({x:n+t*Math.cos(a),y:t*Math.sin(a)})}for(let i=0;i<=r;i++){let a=Math.PI/2+i/r*Math.PI;o.push({x:-n+t*Math.cos(a),y:t*Math.sin(a)})}return o}var Ks=(()=>{let t={x:0,y:52},n=25,o={x:70,y:t.y-70},r=(o.x*o.x+o.y*o.y-4900)/(2*(o.y+70)),i=r+70,a=[],s=Math.atan2(o.y-r,o.x),c=Math.atan2(o.y-r,-o.x);for(let l=0;l<=24;l++){let u=s+(c-s)*l/24;a.push({x:i*Math.cos(u),y:r+i*Math.sin(u)})}return{half:70,home:t,backstop:n,fence:a}})();var Wo="#f1f5f9";function Xo(e){return Zt(e)}function Tt(e,t,n,o,r=32){let i=[];for(let a=0;a<r;a++){let s=a/r*Mh;i.push({x:e+n*Math.cos(s),y:t+o*Math.sin(s)})}return i}function wt(e,t,n,o){return[{x:e-n,y:t-o},{x:e+n,y:t-o},{x:e+n,y:t+o},{x:e-n,y:t+o}]}function Sh(e){let{kind:t,cx:n,cy:o,width:r,height:i}=e,a=(e.rotation??0)*Math.PI/180,s=Math.cos(a),c=Math.sin(a),l=r/2,u=i/2,m=[],f=gh[t],d=p=>f?p/f.width*r:0,h=p=>f?p/f.height*i:0;switch(t){case"pitch-football":{m.push({points:[{x:0,y:-u},{x:0,y:u}],closed:!1}),m.push({points:Tt(0,0,d(9.15),h(9.15)),closed:!0});for(let p of[-1,1])m.push({points:wt(p*(l-d(16.5)/2),0,d(16.5)/2,h(40.32)/2),closed:!0}),m.push({points:wt(p*(l-d(5.5)/2),0,d(5.5)/2,h(18.32)/2),closed:!0});break}case"rink-hockey":{m.push({points:[{x:0,y:-u},{x:0,y:u}],closed:!1,ink:"#d63b3b"});for(let p of[-1,1]){m.push({points:[{x:p*d(7.5),y:-u},{x:p*d(7.5),y:u}],closed:!1,ink:"#2f6ecb"}),m.push({points:[{x:p*(l-d(4)),y:-h(11)},{x:p*(l-d(4)),y:h(11)}],closed:!1,ink:"#d63b3b"});for(let b of[-1,1])m.push({points:Tt(p*d(20.5),b*h(7),d(4.5),h(4.5)),closed:!0,ink:"#2f6ecb"})}m.push({points:Tt(0,0,d(4.5),h(4.5)),closed:!0,ink:"#2f6ecb"});break}case"track-athletics":{let b=u-h(1.22)*8;b>0&&m.push({points:Ys(l-d(1.22)*8,b),closed:!0,fill:"#2f7d4f"});for(let y=1;y<8;y++){let M=h(1.22)*y,S=u-M;if(S<=0)break;m.push({points:Ys(l-d(1.22)*y,S),closed:!0})}break}case"oval-cricket":{m.push({points:Tt(0,0,d(27.4),h(27.4+20.12/2),40),closed:!0}),m.push({points:wt(0,0,d(3.05)/2,h(20.12)/2),closed:!0,ink:"#d8cfae"});break}case"pitch-rugby":{let p=b=>({points:[{x:d(b),y:-u},{x:d(b),y:u}],closed:!1});m.push(p(0));for(let b of[-1,1]){m.push(p(b*50),p(b*28));for(let y=-35;y<35;y+=4)m.push({points:[{x:d(b*10),y:h(y)},{x:d(b*10),y:h(Math.min(35,y+2))}],closed:!1})}break}case"diamond-baseball":{let p=(L,N)=>({x:d(L),y:h(N)}),{home:b}=Ks,y=27.43,M=y/Math.SQRT2,S={x:b.x+M,y:b.y-M},A={x:b.x,y:b.y-2*M},x={x:b.x-M,y:b.y-M},g={x:b.x,y:b.y-18.44},w="#b98a59",v=xh["diamond-baseball"],P=38.94,R=[p(b.x,b.y)],k=Math.atan2(b.y-P/Math.SQRT2-g.y,P/Math.SQRT2),F=Math.PI-k;for(let L=0;L<=16;L++){let N=k-(k+Math.PI*2-F)%(Math.PI*2)*(L/16);R.push(p(g.x+29*Math.cos(N),g.y+29*Math.sin(N)))}m.push({points:R,closed:!0,fill:w,ink:w});let E={x:b.x,y:b.y-M},I=[{x:b.x,y:b.y},S,A,x].map(L=>p(E.x+(L.x-E.x)*.84,E.y+(L.y-E.y)*.84));m.push({points:I,closed:!0,fill:v,ink:v}),m.push({points:Tt(d(g.x),h(g.y),d(2.74),h(2.74),20),closed:!0,fill:w,ink:w}),m.push({points:Tt(d(b.x),h(b.y),d(3.96),h(3.96),20),closed:!0,fill:w,ink:w});let C=Ks.fence;m.push({points:[p(b.x,b.y),p(C[0].x,C[0].y)],closed:!1}),m.push({points:[p(b.x,b.y),p(C[C.length-1].x,C[C.length-1].y)],closed:!1});for(let L of[S,A,x])m.push({points:wt(d(L.x),h(L.y),d(.3),h(.3)),closed:!0,fill:Wo});break}case"court-basketball":{m.push({points:wt(0,0,d(14),h(7.5)),closed:!0}),m.push({points:[{x:0,y:-h(7.5)},{x:0,y:h(7.5)}],closed:!1}),m.push({points:Tt(0,0,d(1.8),h(1.8),24),closed:!0});for(let p of[-1,1]){let b=p*14,y=p*(14-5.8),M=p*(14-1.575);m.push({points:wt(d((b+y)/2),0,d(2.9),h(2.45)),closed:!0,fill:"#2f5d8a"}),m.push({points:Tt(d(y),0,d(1.8),h(1.8),24),closed:!0});let S=Math.sqrt(6.75*6.75-6.6*6.6),A=[{x:d(b),y:-h(6.6)}],x=Math.atan2(-6.6,-p*S),g=2*Math.atan2(6.6,S);for(let w=0;w<=16;w++){let v=x-p*g*(w/16);A.push({x:d(M+6.75*Math.cos(v)),y:h(6.75*Math.sin(v))})}A.push({x:d(b),y:h(6.6)}),m.push({points:A,closed:!1})}break}case"court-tennis":{m.push({points:wt(0,0,d(11.885),h(5.485)),closed:!0,fill:"#2b5f99"});for(let p of[-1,1])m.push({points:[{x:-d(11.885),y:p*h(4.115)},{x:d(11.885),y:p*h(4.115)}],closed:!1}),m.push({points:[{x:p*d(6.4),y:-h(4.115)},{x:p*d(6.4),y:h(4.115)}],closed:!1});m.push({points:[{x:-d(6.4),y:0},{x:d(6.4),y:0}],closed:!1}),m.push({points:[{x:0,y:-h(6.4)},{x:0,y:h(6.4)}],closed:!1,ink:"#d1d5db"});break}case"ring-boxing":{m.push({points:wt(0,0,d(3.05),h(3.05)),closed:!0});let y=[[-1,-1,"#c53030"],[1,1,"#2b6cb0"],[1,-1,"#e2e8f0"],[-1,1,"#e2e8f0"]];for(let[M,S,A]of y)m.push({points:wt(M*d(3.05),S*h(3.05),d(.3),h(.3)),closed:!0,fill:A,ink:A});break}default:return[]}return m.map(p=>({...p,points:p.points.map(b=>vh(b.x,b.y,s,c,n,o))}))}function Zs(e){if(e.role!=="stage"||!Xo(e.stageKind))return[];let t=null;if(e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null&&e.width>0&&e.height>0&&[e.x,e.y,e.width,e.height].every(Number.isFinite))t={cx:e.x+e.width/2,cy:e.y+e.height/2,width:e.width,height:e.height};else if(e.points&&e.points.length>=3&&e.points.every(n=>Number.isFinite(n.x)&&Number.isFinite(n.y))){let n=e.points.map(u=>u.x),o=e.points.map(u=>u.y),r=Math.min(...n),i=Math.max(...n),a=Math.min(...o),s=Math.max(...o),c=Math.max(1,i-r),l=Math.max(1,s-a);t={cx:r+c/2,cy:a+l/2,width:c,height:l}}return t?Sh({kind:e.stageKind,...t}):[]}function qs(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,a=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+a*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+a*e.end.y}}function Qs(e,t,n=192){if(!Number.isInteger(t)||t<1)throw new Error("Path point count must be a positive integer");if(t===1)return[qs(e,.5)];let o=Array.from({length:n+1},(c,l)=>qs(e,l/n)),r=new Float64Array(o.length);for(let c=1;c<o.length;c+=1){let l=o[c].x-o[c-1].x,u=o[c].y-o[c-1].y;r[c]=r[c-1]+Math.hypot(l,u)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let a=[],s=1;for(let c=0;c<t;c+=1){let l=i*c/(t-1);for(;s<r.length-1&&r[s]<l;)s+=1;let u=r[s-1],m=r[s],f=m===u?0:(l-u)/(m-u);a.push({x:o[s-1].x+(o[s].x-o[s-1].x)*f,y:o[s-1].y+(o[s].y-o[s-1].y)*f})}return a}var dn=Math.PI*2;function hn(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function wh(e,t,n){let o=t-e;if(n){for(;o<0;)o+=dn;for(;o>=dn;)o-=dn}else{for(;o>0;)o-=dn;for(;o<=-dn;)o+=dn}return o}function tc(e){if(e.version!==1||e.closed!==!0||!hn(e.start)||!Array.isArray(e.segments)||e.segments.length<2||e.segments.length>512)return!1;let t=e.start;for(let n of e.segments){if(!n||!hn(n.end))return!1;if(n.kind==="line"){if(Ve(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!hn(n.control1)||!hn(n.control2)||Ve(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!hn(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(Ve(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(Ve(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Ve(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return Ve(t,e.start)<=1e-4}function Ph(e,t,n){let o=1-n;return{x:o**3*e.x+3*o**2*n*t.control1.x+3*o*n**2*t.control2.x+n**3*t.end.x,y:o**3*e.y+3*o**2*n*t.control1.y+3*o*n**2*t.control2.y+n**3*t.end.y}}function nc(e,t=2){if(!tc(e))throw new Error("Section outline path is invalid");let n=Math.max(.25,t),o=[{...e.start}],r=e.start;for(let i of e.segments){if(i.kind==="line")o.push({...i.end});else if(i.kind==="arc"){let a=Math.atan2(r.y-i.center.y,r.x-i.center.x),s=Math.atan2(i.end.y-i.center.y,i.end.x-i.center.x),c=wh(a,s,i.clockwise),l=Math.max(2,Math.ceil(Math.abs(c)*i.radius/n));for(let u=1;u<=l;u+=1){let m=a+c*u/l;o.push({x:i.center.x+Math.cos(m)*i.radius,y:i.center.y+Math.sin(m)*i.radius})}}else{let a=Ve(r,i.control1)+Ve(i.control1,i.control2)+Ve(i.control2,i.end),s=Math.max(2,Math.ceil(a/n));for(let c=1;c<=s;c+=1)o.push(Ph(r,i,c/s))}r=i.end}return Ve(o[o.length-1],o[0])<=1e-4&&o.pop(),o}var Ah=45,vi=150,Ih=60;function Rh(e){let t=Ah/100;if(e<=t)return vi;let n=Math.min(1,(e-t)/(1-t));return vi-n*(vi-Ih)}var Js=.5523;function ec(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function Eh(e){let t=[],n=[];for(e.forEach((o,r)=>{hn(o)&&(t.length&&ec(t[t.length-1],o)||(t.push({x:o.x,y:o.y}),n.push(r)))});t.length>1&&ec(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}var Ch=.5,_h=4/3;function Th(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=Math.hypot(o,r);if(i<=1e-9)return{kind:"line",end:{...t}};let a=-r/i,s=o/i,c=n*_h;return{kind:"bezier",control1:{x:e.x+o/3+a*c,y:e.y+r/3+s*c},control2:{x:e.x+o*2/3+a*c,y:e.y+r*2/3+s*c},end:{...t}}}function oc(e,t){let{points:n,sourceIndex:o}=Eh(e),r=n.length;if(r<3)return null;let i=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,a=t.edgeCurvature,s=new Array(r).fill(0);if(a?.length)for(let A=0;A<r;A+=1){let x=a[o[A]];s[A]=Number.isFinite(x)?Math.min(100,Math.max(-100,x))/100:0}let c=s.some(A=>Math.abs(A)>1e-6);if(i<=0&&!c)return null;let l=t.wideAngleThresholdDeg??Rh(i),u=[];for(let A=0;A<r;A+=1)u[A]=Ve(n[A],n[(A+1)%r]);let m=new Array(r).fill(0);for(let A=0;A<r;A+=1){let x=n[(A-1+r)%r],g=n[A],w=n[(A+1)%r],v={x:x.x-g.x,y:x.y-g.y},P={x:w.x-g.x,y:w.y-g.y},R=Math.hypot(v.x,v.y),k=Math.hypot(P.x,P.y);if(R<=1e-9||k<=1e-9)continue;let F=Math.min(1,Math.max(-1,(v.x*P.x+v.y*P.y)/(R*k))),E=Math.acos(F)*180/Math.PI;if(E<l)continue;let I=Ps((E-l)/(180-l));m[A]=i*I*.5*Math.min(R,k)}for(let A=0;A<r;A+=1){let x=(A+1)%r,g=m[A]+m[x];if(g>u[A]&&g>1e-9){let w=u[A]/g;m[A]*=w,m[x]*=w}}let f=new Array(r),d=new Array(r);for(let A=0;A<r;A+=1){let x=n[(A-1+r)%r],g=n[A],w=n[(A+1)%r];if(m[A]<=1e-6){f[A]={...g},d[A]={...g};continue}let v=Ve(g,x)||1,P=Ve(g,w)||1;f[A]={x:g.x+(x.x-g.x)/v*m[A],y:g.y+(x.y-g.y)/v*m[A]},d[A]={x:g.x+(w.x-g.x)/P*m[A],y:g.y+(w.y-g.y)/P*m[A]}}if(m.every(A=>A<=1e-6)&&!c)return null;let h=[],p={...d[0]},b=p,y=(A,x)=>{if(Ve(b,A)<=1e-9)return;let g=s[x];Math.abs(g)>1e-6?h.push(Th(b,A,g*Ch*u[x])):h.push({kind:"line",end:{...A}}),b=A};for(let A=1;A<=r;A+=1){let x=A%r,g=n[x];y(f[x],(A-1)%r),m[x]>1e-6&&Ve(f[x],d[x])>1e-9&&(h.push({kind:"bezier",control1:pi(f[x],g,Js),control2:pi(d[x],g,Js),end:{...d[x]}}),b=d[x])}if(!h.length)return null;let M=h[h.length-1];Ve(M.end,p)>1e-9&&(M.kind==="line"?M.end={...p}:h.push({kind:"line",end:{...p}}));let S={version:1,closed:!0,start:p,segments:h};return tc(S)?S:null}function Lh(e){let t=e.points??[];if(e.kind!=="polygon"||t.length<3||!Array.isArray(e.edgeCurvature))return[];let n=t.map((o,r)=>{let i=e.edgeCurvature[r];return Number.isFinite(i)?Math.min(100,Math.max(-100,i)):0});return n.some(o=>Math.abs(o)>.5)?n:[]}function kh(e){let t=Lh(e);return t.length?oc(e.points,{edgeCurvature:t}):null}function Yo(e,t=2){let n=kh(e);return n?nc(n,t):e.points??[]}function rc(e){return e.kind==="polygon"?no(e.holes):[]}function ac(e){let t=new Map,n=new Map;for(let o of e){if(o.type!=="row"||!o.segmentedRow)continue;let r=n.get(o.segmentedRow.groupId)??[];r.push(o),n.set(o.segmentedRow.groupId,r)}for(let[o,r]of n){let i=r.slice().sort((f,d)=>f.segmentedRow.componentIndex-d.segmentedRow.componentIndex),a=i[0]?.segmentedRow?.componentCount??0,s=i[0]?.segmentedRow;if(!s||!(a>=2&&i.length===a&&s?.boundaryBefore==="start"&&i.every((f,d)=>f.segmentedRow?.kind==="segmented-row-v1"&&f.segmentedRow.groupId===o&&f.segmentedRow.componentCount===a&&f.segmentedRow.componentIndex===d&&f.segmentedRow.repeatLabelOnComponents===s.repeatLabelOnComponents&&(d===0?f.segmentedRow.boundaryBefore==="start":f.segmentedRow.boundaryBefore!=="start")&&f.segmentedRow.displayLabel===s.displayLabel)))continue;let l=i.reduce((f,d)=>f+d.seatCount,0),u=0,m=0;for(let f of i)f.segmentedRow.boundaryBefore==="break"&&(u+=1),t.set(f.id,{groupId:o,adjacencyOffset:u,displayOffset:m,displayLabel:s.displayLabel,totalSeats:l,canonical:i[0],viewFromSeatUrl:s.viewFromSeatUrl,viewFromSeatMeta:s.viewFromSeatMeta,confidenceEvidence:s.confidenceEvidence}),u+=f.seatCount,m+=f.seatCount}return t}var Oh="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var Fh="abcdefghijklmnopqrstuvwxyz";function Dh(e,t){let n=t.length,o=e+1,r="";for(;o>0;){o-=1;let i=o%n;r=t[i]+r,o=Math.floor(o/n)}return r}function oo(e,t=!1){let n=t?Fh:Oh;return Dh(Math.max(0,Math.floor(e)-1),n)}var Nh=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function sc(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of Nh)for(;t>=o;)n+=r,t-=o;return n}function Bh(e){let t=new Array(e);return Array.from({length:e},(n,o)=>o).sort((n,o)=>Math.abs(2*n-(e-1))-Math.abs(2*o-(e-1))||n-o).forEach((n,o)=>t[n]=o),t}function wi(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",a=e.seatNumbering?.prefix??"",s=e.seatNumbering?.endAt,c=e.seatCount;if(i==="updown"||i==="updown-descending"){let d=Math.ceil(c/2),h=i==="updown"?t<d?n+2*t:n-1+2*(c-t):t<d?n+2*(d-1-t):n+1+2*(t-d);return`${a}${h}`}let l=i==="odd"||i==="even"?2:r,u=s!=null&&Number.isFinite(s)?s-(c-1)*l:n,m=o==="center"?Bh(c)[t]:o==="rtl"?c-1-t:t,f;switch(i){case"odd":{let d=u%2===1?u:u+1;f=String(d+m*2);break}case"even":{let d=u%2===0?u:u+1;f=String(d+m*2);break}case"roman":f=sc(u+m*r);break;case"letters-upper":f=oo(u+m*r,!1);break;case"letters-lower":f=oo(u+m*r,!0);break;default:f=String(u+m*r);break}return`${a}${f}`}function Vh(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function cc(e,t,n){return n?.label??`${e.seatLabelBase??e.label}-${wi(e,t)}`}function Gh(e,t,n,o){if(o?.displayLabel)return null;if(e.seatDisplayLabelMode==="number"||!n)return{row:e.displayLabel||e.label,seat:wi(e,t)};let r=Vh(n);return{row:n.displayLabel,seat:wi(r,n.displayOffset+t)}}function Pi(e,t,n,o){let r=Gh(e,t,n,o);return r?e.seatDisplayLabelMode==="number"?r.seat:`${r.row}-${r.seat}`:o.displayLabel}function lc(e,t){return`${e.label}-${t+1}`}function Hh(e,t,n){return e?.direction==="anticlockwise"?Math.max(0,t-1-n):n}function zh(e,t){let n=e.chairNumbering,o=n?.start??1,r=Hh(n,Math.max(0,Math.round(e.seatCount)),t);return n?.format==="letter"?oo(Math.max(1,o)+r):String(o+r)}function uc(e,t){let n=zh(e,t);return(e.chairNumbering?.format??"table-number")==="table-number"?`${e.displayLabel??e.label}-${n}`:n}function mc(e){let t=e.length;return t<=3?[...e]:[e[Math.floor(t*.25)],e[Math.floor(t*.5)],e[Math.floor(t*.75)]]}function pn(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>1e-12?((t-i.x)*s+(n-i.y)*c)/l:0;u<0?u=0:u>1&&(u=1);let m=t-(i.x+u*s),f=n-(i.y+u*c);if(Math.abs(m)>=o||Math.abs(f)>=o)continue;let d=Math.hypot(m,f);d<o&&(o=d)}return o}function Uh(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let o=e.length||1;t/=o,n/=o;let r=0;for(let i of e){let a=Math.hypot(i.x-t,i.y-n);a>r&&(r=a)}return{cx:t,cy:n,r}}function fc(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function Ai(e,t){let n=1/0;for(let o of mc(e)){let r=pn(t,o.x,o.y);r<n&&(n=r)}for(let o of mc(t)){let r=pn(e,o.x,o.y);r<n&&(n=r)}return n}function jh(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let u of e)n+=u.x,o+=u.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let u of e){let m=Math.hypot(u.x-n,u.y-o);m>r&&(r=m,i=u)}let a=i.x-n,s=i.y-o,c=Math.hypot(a,s);c>1e-9?(a/=c,s/=c):(a=1,s=0);let l=e.map((u,m)=>({p:u,i:m,t:(u.x-n)*a+(u.y-o)*s})).sort((u,m)=>u.t-m.t);return{pts:l.map(u=>u.p),seatIndices:l.map(u=>t[u.i])}}function Ii(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let M of e)n+=M.x,o+=M.y;n/=t,o/=t;let r=0,i=0,a=0,s=0,c=0,l=0,u=0;for(let M of e){let S=M.x-n,A=M.y-o;r+=S*S,a+=A*A,i+=S*A,s+=S*S*S,c+=A*A*A,l+=S*A*A,u+=A*S*S}let m=r*a-i*i;if(Math.abs(m)<1e-9)return null;let f=(s+l)/2,d=(c+u)/2,h=(f*a-d*i)/m,p=(d*r-f*i)/m,b=h+n,y=p+o;return!Number.isFinite(b)||!Number.isFinite(y)?null:{cx:b,cy:y}}var Wh=.15,Xh=.001;function Yh(e){let t=e[0],n=e[e.length-1],o=n.x-t.x,r=n.y-t.y,i=Math.hypot(o,r);if(!(i>1e-9))return 0;let a=0;for(let s of e){let c=Math.abs((s.x-t.x)*r-(s.y-t.y)*o)/i;c>a&&(a=c)}return a/i}function Kh(e){if(e.length<2)return null;let t=e.map(x=>{let g=0,w=0;for(let v of x.pts)g+=v.x,w+=v.y;return{x:g/x.pts.length,y:w/x.pts.length}}),n=0,o=0;for(let x of t)n+=x.x,o+=x.y;n/=t.length,o/=t.length;let r=0,i=0,a=0;for(let x of t){let g=x.x-n,w=x.y-o;r+=g*g,i+=g*w,a+=w*w}let s=r+a,c=r*a-i*i,l=s/2+Math.sqrt(Math.max(0,s*s/4-c)),u,m;Math.abs(i)>1e-12?(u=l-a,m=i):r>=a?(u=1,m=0):(u=0,m=1);let f=Math.hypot(u,m);if(!(f>1e-12))return null;u/=f,m/=f;let d=0,h=0,p=0;for(let x of e){if(x.pts.length<2)continue;let g=x.pts[0],w=x.pts[x.pts.length-1],v=w.x-g.x,P=w.y-g.y,R=Math.hypot(v,P);if(!(R>1e-9))continue;let k=v/R,F=P/R;d+=(k*k-F*F)*R,h+=2*k*F*R,p+=R}if(p>0&&Math.hypot(d,h)>=Zh*p){let x=Math.atan2(h,d)/2;u=-Math.sin(x),m=Math.cos(x)}let b=1/0,y=-1/0,M=[];for(let x of e){let g=1/0,w=-1/0;for(let v of x.pts){let P=v.x*u+v.y*m;P<g&&(g=P),P>w&&(w=P),P<b&&(b=P),P>y&&(y=P)}M.push(w-g)}let S=y-b;return S>1e-9?(M.sort((x,g)=>x-g),M[Math.min(M.length-1,Math.floor(M.length*.9))]/S<=$h?{x:u,y:m}:null):null}var $h=.35,Zh=.8;function Ko(e,t,n,o){let r=new Map;for(let g of n){let w=t[g],v=w.rowId||`__seat-${g}`,P=r.get(v);P||(P={pts:[],idx:[]},r.set(v,P)),P.pts.push({x:w.x,y:w.y}),P.idx.push(g)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[g,w]of r){let v=jh(w.pts,w.idx),P=0;for(let R of v.pts)P+=Math.hypot(R.x-o.x,R.y-o.y);i.push({id:g,pts:v.pts,seatIndices:v.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:P/v.pts.length})}let a=i.map(g=>Uh(g.pts)),s=i.length<=256?i.length*(i.length-1)/2:0,c=s?new Float64Array(s):null;c?.fill(Number.NaN);let l=c?new Map(i.map((g,w)=>[g,w])):null,u=(g,w)=>(g>w&&([g,w]=[w,g]),g*(2*i.length-g-1)/2+(w-g-1)),m=(g,w)=>{if(!c)return Ai(i[g].pts,i[w].pts);let v=u(g,w),P=c[v];if(!Number.isNaN(P))return P;let R=Ai(i[g].pts,i[w].pts);return c[v]=R,R},f=(g,w)=>l?m(l.get(g),l.get(w)):Ai(g.pts,w.pts),d=[];for(let g=0;g<i.length;g++){let w=1/0;for(let v=0;v<i.length;v++){if(g===v||fc(a[g],a[v])>=w)continue;let P=m(g,v);P<w&&(w=P)}Number.isFinite(w)&&d.push(w)}d.sort((g,w)=>g-w);let h=d.length?d[Math.floor(d.length/2)]:1,p=Math.max(h*1.8,1e-6),b=i.map(()=>[]);for(let g=0;g<i.length;g++)for(let w=g+1;w<i.length;w++)fc(a[g],a[w])>p||m(g,w)<=p&&(b[g].push(w),b[w].push(g));let y=0;for(let g=0;g<i.length;g++){if(i[g].blockId!==-1)continue;let w=y++,v=[g];for(i[g].blockId=w;v.length;){let P=v.pop();for(let R of b[P])i[R].blockId===-1&&(i[R].blockId=w,v.push(R))}}let M=new Map;for(let g of i){let w=M.get(g.blockId)??[];w.push(g),M.set(g.blockId,w)}let S=[];for(let g of i){if(g.pts.length<4||Yh(g.pts)<Xh)continue;let w=Ii(g.pts);w&&(!Number.isFinite(w.cx)||!Number.isFinite(w.cy)||S.push({x:w.cx,y:w.cy}))}let A=S.length>=2?(()=>{let g=S.map(P=>P.x).sort((P,R)=>P-R),w=S.map(P=>P.y).sort((P,R)=>P-R),v=Math.floor(S.length/2);return{cx:g[v],cy:w[v]}})():null;if(A){let g=F=>Math.hypot(F.x-A.cx,F.y-A.cy),w=1/0,v=-1/0,P=[];for(let F of i){let E=1/0,I=-1/0;for(let C of F.pts){let L=g(C);L<E&&(E=L),L>I&&(I=L)}P.push(I-E),E<w&&(w=E),I>v&&(v=I)}let R=v-w;P.sort((F,E)=>F-E);let k=P[Math.min(P.length-1,Math.floor(P.length*.9))];if(R>1e-9&&k/R<=Wh){let F=i.map(T=>{let B=0;for(let D of T.pts)B+=g(D);return{row:T,radius:B/T.pts.length}}),E=0,I=0;for(let T of F)E+=T.radius,I+=T.row.focalDistance;E/=F.length,I/=F.length;let C=0;for(let T of F)C+=(T.radius-E)*(T.row.focalDistance-I);if(C<0)for(let T of F)T.radius=-T.radius;let N=1/0;for(let T of F)T.radius<N&&(N=T.radius);F.sort((T,B)=>T.radius-B.radius);let O=-1,H=-1/0,j=R/Math.max(1,F.length)*.5,V=[];for(let T of F)T.radius-H>j&&(O++,H=T.radius),T.row.ordinal=O,T.row.blockDepth=T.radius-N,V.push(T.row);return{sectionId:e,rows:V,blockCount:y}}}let x=[];for(let[,g]of M){let w=Kh(g);if(w){let v=F=>{let E=0;for(let I of F.pts)E+=I.x*w.x+I.y*w.y;return E/F.pts.length};g.sort((F,E)=>v(F)-v(E)),g.length>=2&&g[0].focalDistance>g[g.length-1].focalDistance&&g.reverse();let P=[],R=h*.5;for(let F of g){let E=P[P.length-1];E&&Math.abs(v(F)-v(E[0]))<R?E.push(F):P.push([F])}let k=0;for(let F=0;F<P.length;F++){if(F>0){let E=1/0;for(let I of P[F-1])for(let C of P[F])E=Math.min(E,f(I,C));E=Math.min(E,Math.abs(v(P[F][0])-v(P[F-1][0]))),k+=E}for(let E of P[F])E.ordinal=F,E.blockDepth=k,x.push(E)}}else{let v=1/0;for(let P of g)P.focalDistance<v&&(v=P.focalDistance);g.sort((P,R)=>P.focalDistance-R.focalDistance);for(let P=0;P<g.length;P++)g[P].ordinal=P,g[P].blockDepth=Math.max(0,g[P].focalDistance-v),x.push(g[P])}}return{sectionId:e,rows:x,blockCount:y}}var qh=/^\d{4}-\d{2}-\d{2}$/;function Qh(e){let t=Date.parse(e);return Number.isFinite(t)?qh.test(e)?t+864e5:t:null}function Jh(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let o=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(o)&&(t instanceof Date?t.getTime():t)<=o+366*864e5}let n=Qh(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function ep(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function tp(e){return e.status!=="draft"&&e.status!=="retracted"}function np(e,t){return e.status===void 0?t===void 0:e.status!=="approved"?!0:typeof t=="string"&&typeof e.basisSha256=="string"&&e.basisSha256===t}function dc(e,t={}){return!!e&&tp(e)&&ep(e,t.activeConfigurationId,t.activeConfigurationVersion)&&np(e,t.activeBasisSha256)&&Jh(e,t.now)}var op=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,rp=/[\s"'<>`\\]/;function ip(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return op.test(e);if(rp.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}function hc(e){let t=e.trim();return ip(t)?t:null}var Ri="seatlayer.event-configuration/1";var bn=100,ap=120,sp=2e5,cp=1e4,lp=/^[a-f0-9]{64}$/,up=new Set(["stage","screen","barrier","camera_platform","sound_desk","rigging_truss"]);function ro(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function qt(e,t){return typeof e=="string"&&e.length>=1&&e.length<=t&&e.normalize("NFKC").trim()===e}function mp(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}function pc(e){return!Array.isArray(e)||e.length>sp||!e.every(t=>qt(t,bn))?null:[...new Set(e)].sort()}function fp(e){return!ro(e)||!qt(e.chartId,bn)||!qt(e.version,bn)||e.sha256!==void 0&&(typeof e.sha256!="string"||!lp.test(e.sha256))?null:{chartId:e.chartId,version:e.version,...typeof e.sha256=="string"?{sha256:e.sha256}:{}}}function Ei(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=t&&e<=n}function dp(e){return ro(e)?e.mode==="none"||e.mode==="opaque"?e.opacity===void 0?{mode:e.mode}:null:e.mode==="partial"&&Ei(e.opacity,.01,.99)?{mode:"partial",opacity:e.opacity}:null:null}function hp(e,t){if(e===void 0)return;if(!Array.isArray(e)||e.length>cp)return null;let n=new Set(t),o=new Set,r=new Set,i=0,a=[];for(let s of e){if(!ro(s)||!qt(s.id,bn)||!qt(s.objectId,bn)||!n.has(s.objectId)||!up.has(String(s.kind))||!Ei(s.heightM,.05,50)||s.baseElevationM!==void 0&&!Ei(s.baseElevationM,-10,100))return null;let c=dp(s.occlusion);if(!c||o.has(s.id)||r.has(s.objectId))return null;let l=s.contentImageUrl===void 0?void 0:typeof s.contentImageUrl=="string"?hc(s.contentImageUrl):null;if(s.contentImageUrl!==void 0&&(!l||s.kind!=="screen"||++i>1))return null;o.add(s.id),r.add(s.objectId),a.push({id:s.id,objectId:s.objectId,kind:s.kind,heightM:s.heightM,...s.baseElevationM!==void 0?{baseElevationM:s.baseElevationM}:{},occlusion:c,...l?{contentImageUrl:l}:{}})}return a.sort((s,c)=>s.id.localeCompare(c.id))}function pp(e){let t=[];if(!ro(e))return{issues:[{code:"invalid_export",path:"configuration",message:"Configuration must be an object"}]};e.schema!==Ri&&t.push({code:"unsupported_schema",path:"configuration.schema",message:`Configuration schema must be ${Ri}`}),qt(e.id,bn)||t.push({code:"invalid_id",path:"configuration.id",message:"Configuration id must contain 1 to 100 normalized characters"}),qt(e.label,ap)||t.push({code:"invalid_label",path:"configuration.label",message:"Configuration label must contain 1 to 120 normalized characters"}),mp(e.version)||t.push({code:"invalid_version",path:"configuration.version",message:"Configuration version must be a positive integer"});let n=fp(e.baseVenue);n||t.push({code:"invalid_base_venue",path:"configuration.baseVenue",message:"Base venue must identify one normalized chart id and exact version"});let o=ro(e.overlay)?e.overlay:null,r=pc(o?.objectIds),i=pc(o?.productionKillSeatIds),a=r?hp(o?.productionElements,r):null;return(!o||!r||!i)&&t.push({code:"invalid_overlay",path:"configuration.overlay",message:"Overlay ids must be bounded arrays of normalized stable ids"}),a===null&&t.push({code:"invalid_production_element",path:"configuration.overlay.productionElements",message:"Production elements must be unique, bounded semantics over referenced base-venue objects"}),t.length||!n||!r||!i||a===null?{issues:t}:{issues:t,value:{schema:Ri,id:e.id,label:e.label,version:e.version,baseVenue:n,overlay:{objectIds:r,productionKillSeatIds:i,...a!==void 0?{productionElements:a}:{}}}}}function bc(e){let t=pp(e);return t.value?{ok:!0,value:t.value}:{ok:!1,issues:t.issues}}function bp(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.kind==="polygon"?Yo(e,6):e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,o=e.width,r=e.height;return[{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r},{x:t,y:n+r}]}function yp(e,t,n){let o=n*Math.PI/180,r=Math.cos(o),i=Math.sin(o),a=e.x-t.x,s=e.y-t.y;return{x:t.x+a*r-s*i,y:t.y+a*i+s*r}}function yc(e){let t=bp(e);if(!t||t.length<2)return null;let n=e.rotation??0,o=Math.abs(n)<1e-6?t:t.map(c=>yp(c,{x:t.reduce((l,u)=>l+u.x,0)/t.length,y:t.reduce((l,u)=>l+u.y,0)/t.length},n)),r=1/0,i=1/0,a=-1/0,s=-1/0;for(let c of o)r=Math.min(r,c.x),i=Math.min(i,c.y),a=Math.max(a,c.x),s=Math.max(s,c.y);return!Number.isFinite(r)||a-r<1e-6||s-i<1e-6?null:{minX:r,minY:i,maxX:a,maxY:s}}var gp=5,xp=3,Mp=.92,vp=1.9,Sp=2,wp=.6,Pp=1,Ap=.06;function Ip(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?Mi:Xo(e.stageKind)?Ap:Pp}function gc(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=-1/0;for(let a of vc(e)){let s=a.baseHeightM??0;for(let c of a.objects){if(c.type!=="shape"||c.role!=="stage")continue;let l=yc(c);l&&(t=Math.min(t,l.minX),n=Math.min(n,l.minY),o=Math.max(o,l.maxX),r=Math.max(r,l.maxY),i=Math.max(i,s+Ip(c)))}}return!Number.isFinite(t)||!Number.isFinite(i)?null:{minX:t,minY:n,maxX:o,maxY:r,deckTopM:i}}function Rp(e,t,n,o){let r=1/0,i=1/0,a=-1/0,s=-1/0;for(let d of e)Number.isFinite(d.eyeHeightM)&&(r=Math.min(r,d.x),a=Math.max(a,d.x),i=Math.min(i,d.y),s=Math.max(s,d.y));if(!Number.isFinite(r))return null;let c=r*t,l=i*t,u=Math.max(1,Math.ceil((a-r)*t/n)+1),m=Math.max(1,Math.ceil((s-i)*t/n)+1),f=new Float64Array(u*m).fill(-1/0);for(let d of e){if(!Number.isFinite(d.eyeHeightM))continue;let h=d.eyeHeightM-ht,p=Math.min(u-1,Math.max(0,Math.floor((d.x*t-c)/n))),y=Math.min(m-1,Math.max(0,Math.floor((d.y*t-l)/n)))*u+p,M=h+o;M>f[y]&&(f[y]=M)}return{cellM:n,minX:c,minY:l,cols:u,rows:m,top:f}}function Ep(e,t,n){let o=Math.floor((t-e.minX)/e.cellM),r=Math.floor((n-e.minY)/e.cellM);return o<0||r<0||o>=e.cols||r>=e.rows?-1/0:e.top[r*e.cols+o]}function xc(e,t,n={}){let o=new Map;if(!t||!e.length)return o;let r=n.metresPerChartUnit??fe,i=n.cellM??wp,a=n.chairBackM??Mp,s=n.selfRowSkipM??Sp,c=n.clearThreshold??.9,l=n.partialThreshold??.25,u=Math.max(1,n.columns??gp),m=Math.max(1,n.rows??xp),f=Rp(e,r,i,a);if(!f)return o;let d=(t.maxX-t.minX)*r,h=(t.maxY-t.minY)*r,p=d>=h,b=(t.minX+t.maxX)/2*r,y=(t.minY+t.maxY)/2*r,M=[];for(let A=0;A<u;A++){let x=(A+.5)/u-.5,g=p?b+x*d:b,w=p?y:y+x*h;for(let v=0;v<m;v++){let P=t.deckTopM+(m===1?0:v/(m-1)*vp);M.push({x:g,y:w,z:P})}}let S=i/2;for(let A of e){if(!Number.isFinite(A.eyeHeightM))continue;let x=A.x*r,g=A.y*r,w=A.eyeHeightM,v=0,P=1/0;for(let k of M){let F=k.x-x,E=k.y-g,I=Math.hypot(F,E);if(!(I>s)){v++;continue}let C=F/I,L=E/I,N=0;for(let O=s;O<I;O+=S){let H=Ep(f,x+C*O,g+L*O);if(!(!Number.isFinite(H)||H>=w)&&H>w+(k.z-w)*O/I){N=O;break}}N?P=Math.min(P,N):v++}let R=v/M.length;R>=c||o.set(A.id,{seatId:A.id,mark:R<l?"obstructedView":"restrictedView",visibleFraction:R,totalRays:M.length,atDistanceM:Number.isFinite(P)?P:0})}return o}function Mc(e,t){if(!t.size)return 0;let n=0;for(let o of e){let r=t.get(o.id);if(!r)continue;let i=o.commercial;i?.restrictedView!==void 0||i?.obstructedView!==void 0||(o.commercial={...i,[r.mark]:!0},n++)}return n}function Ci(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var Zo=Math.PI/180;var io=16;function _i(e,t,n,o){let r=n*Zo,i=Math.cos(r),a=Math.sin(r);return{x:o.x+e*i-t*a,y:o.y+e*a+t*i}}function Ti(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,a=[];if(e.path)return Qs(e.path,t);if(t<=1)return t===1&&a.push({x:i.x,y:i.y}),a;if(o===0){for(let l=0;l<t;l++)a.push(_i(l*n,0,r,i));return a}let s=o/(t-1)*Zo,c=n/(2*Math.sin(Math.abs(s)/2));for(let l=0;l<t;l++){let u=l*s,m=c*Math.sin(u),f=-c+c*Math.cos(u);a.push(_i(m,f,r,i))}return a}function Li(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function Cp(e,t){let n=Li(e);return Ti(e).map((o,r)=>{let i=n.get(r),a=Ci(i),s=cc(e,r,i),c={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:s,displayLabel:Pi(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:a.length>0,accessibility:a,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(c).some(l=>l!==void 0&&l!==!1&&l!=="")?c:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle??e.seatLabelStyle}})}function _p(e){let t=[];for(let n of Cp(e))n.skipped||t.push({id:`${e.id}:${n.index}`,label:n.label,displayLabel:n.displayLabel===n.label?void 0:n.displayLabel,x:n.x,y:n.y,rowId:e.id,categoryKey:n.categoryKey,accessible:n.accessible||void 0,accessibility:n.accessibility.length?n.accessibility:void 0,wheelchairSpaceType:n.wheelchairSpaceType,commercial:n.commercial,glyph:n.glyph,viewUrl:n.viewUrl,viewMeta:n.viewMeta,labelStyle:n.labelStyle});return t}function Tp(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(i=>t.includes(i)),o={top:0,bottom:0,left:0,right:0};if(!n.length)return o;let r=Math.max(0,Math.round(e.seatCount));for(let i=0;i<r;i++)o[n[i%n.length]]+=1;return o}function Lp(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(u=>[u.index,u])),r=(u,m,f,d)=>{let h=o.get(u),p=Ci(h),b=h?.label??lc(e,u);return{index:u,label:b,displayLabel:h?.displayLabel??uc(e,u),x:m+(h?.dx??0),y:f+(h?.dy??0),categoryKey:h?.categoryKey??e.categoryKey,skipped:!!h?.skip,accessible:p.length>0,accessibility:p,wheelchairSpaceType:h?.wheelchairSpaceType,commercial:h?.commercial,glyph:h?.glyph,viewUrl:h?.viewFromSeatUrl,viewMeta:h?.viewFromSeatUrl?h.viewFromSeatMeta:void 0,labelStyle:h?.labelStyle,...d?{side:d}:{}}};if(e.shape==="round"){let u=(e.radius??40)+io,m=e.rotation*Zo,f=Math.max(0,Math.min(360,e.seatArc??360));if(f>=360||n===1){for(let b=0;b<n;b++){let y=m+b/n*2*Math.PI;t.push(r(b,e.center.x+u*Math.cos(y),e.center.y+u*Math.sin(y)))}return t}let d=f*Zo,h=(2*Math.PI-d)/2,p=m+h;for(let b=0;b<n;b++){let y=p+b/(n-1)*d;t.push(r(b,e.center.x+u*Math.cos(y),e.center.y+u*Math.sin(y)))}return t}let i=e.width??80,a=e.height??50,s=Tp(e),c=["top","bottom","left","right"],l=0;for(let u of c){let m=s[u];for(let f=0;f<m;f++){let d,h;u==="top"?(d=-i/2+(f+.5)*i/m,h=-a/2-io):u==="bottom"?(d=-i/2+(f+.5)*i/m,h=a/2+io):u==="left"?(d=-i/2-io,h=-a/2+(f+.5)*a/m):(d=i/2+io,h=-a/2+(f+.5)*a/m);let p=_i(d,h,e.rotation,e.center);t.push(r(l++,p.x,p.y,u))}}return t}function kp(e){return Lp(e).filter(t=>!t.skipped).map(t=>({id:`${e.id}:${t.index}`,label:t.label,...t.displayLabel!==t.label?{displayLabel:t.displayLabel}:{},x:t.x,y:t.y,rowId:e.id,categoryKey:t.categoryKey,...t.accessible?{accessible:!0}:{},...t.accessibility.length?{accessibility:t.accessibility}:{},...t.wheelchairSpaceType?{wheelchairSpaceType:t.wheelchairSpaceType}:{},...t.commercial?{commercial:t.commercial}:{},...t.glyph?{glyph:t.glyph}:{},...t.viewUrl?{viewUrl:t.viewUrl}:{},...t.viewUrl&&t.viewMeta?{viewMeta:t.viewMeta}:{},...t.labelStyle?{labelStyle:t.labelStyle}:{}}))}function Op(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth",...e.commercial?.note?{commercial:{note:e.commercial.note}}:{}}]}function Si(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,a=t[o].y,s=t[r].x,c=t[r].y;a>e.y!=c>e.y&&e.x<(s-i)*(e.y-a)/(c-a)+i&&(n=!n)}return n}function ic(e,t){return t.some((n,o)=>{let r=t[(o+1)%t.length],i=(e.y-n.y)*(r.x-n.x)-(e.x-n.x)*(r.y-n.y);if(Math.abs(i)>1e-7)return!1;let a=(e.x-n.x)*(r.x-n.x)+(e.y-n.y)*(r.y-n.y),s=(r.x-n.x)**2+(r.y-n.y)**2;return a>=-1e-7&&a<=s+1e-7})}function no(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function Ge(e,t,n){return Si(e,t)&&!no(n).some(o=>Si(e,o)||ic(e,o))}function $o(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function Ac(e){switch(e.type){case"row":{let t=Ti(e),n=Li(e),o=0,r=0,i=0;for(let a=0;a<t.length;a++){let s=n.get(a);s?.skip||(o+=t[a].x+(s?.dx??0),r+=t[a].y+(s?.dy??0),i++)}return i?{x:o/i,y:r/i}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return $o(e.points);case"section":return $o(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?$o(e.points):e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null?{x:e.x+e.width/2,y:e.y+e.height/2}:{x:e.x??0,y:e.y??0};case"decorImage":return{x:e.x+e.width/2,y:e.y+e.height/2}}}function Sc(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function Fp(e,t){if(e.type!=="gaArea"||!Sc(e.points,t.outline))return!1;let n=no(e.holes),o=no(t.holes);return n.length===o.length&&n.every((r,i)=>Sc(r,o[i]))}function Dp(e,t,n=e.filter(r=>r.type==="section"),o=Ac(t)){let r="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(r?n.find(a=>(a.logicalSectionId??a.id)===r&&(Fp(t,a)||Ge(o,a.outline,a.holes))):void 0)??n.find(a=>Ge(o,a.outline,a.holes))??(t.type==="row"&&Np(t)?Bp(t,n):void 0)}function Np(e){return(e.overrides??[]).some(t=>t.skip===!0)}function Bp(e,t){let n=Ti(e),o=Li(e),r,i=0;for(let a of t){let s=0;for(let c=0;c<n.length;c++){let l=o.get(c);if(l?.skip)continue;let u={x:n[c].x+(l?.dx??0),y:n[c].y+(l?.dy??0)};Ge(u,a.outline,a.holes)&&s++}s>i&&(r=a,i=s)}return r}function vc(e){return e.floors&&e.floors.length?e.floors:[{id:"floor-0",name:"Main",objects:e.objects,focalPoint:e.focalPoint,referenceImage:e.referenceImage,backgroundImage:e.backgroundImage}]}function wc(e,t,n,o,r,i,a,s,c){let l=[],u=e.filter(p=>p.type==="section"),m=ac(e),f=p=>!p?.eventConfigurationId||p.eventConfigurationId===o&&(p.eventConfigurationVersion===void 0||p.eventConfigurationVersion===c),d=p=>dc(p,{activeConfigurationId:o,activeConfigurationVersion:c,activeBasisSha256:r,now:s}),h=(p,b)=>d(p)?{...p,coverage:b}:void 0;for(let p of e){let b=[];if(p.type==="row"?b=_p(p):p.type==="table"?b=kp(p):p.type==="booth"&&(b=Op(p)),!b.length)continue;for(let x of b)x.viewUrl&&!f(x.viewMeta)&&(x.viewUrl=void 0,x.viewMeta=void 0);if(p.type==="row"){let x=m.get(p.id);if(x){let g=new Map((p.overrides??[]).map(w=>[w.index,w]));for(let w of b){let v=Number(w.id.slice(w.id.lastIndexOf(":")+1));if(!Number.isInteger(v))continue;w.logicalRowId=x.groupId,w.logicalSeatIndex=x.adjacencyOffset+v,g.get(v)?.displayLabel||(w.displayLabel=Pi(p,v,x)),!w.viewUrl&&x.viewFromSeatUrl&&f(x.viewFromSeatMeta)&&(w.viewUrl=x.viewFromSeatUrl,w.viewMeta=x.viewFromSeatMeta);let P=g.get(v)?.confidenceEvidence;w.confidenceEvidence=h(P,"exact-seat")??h(p.confidenceEvidence,"row-representative")??h(x.confidenceEvidence,"row-representative")}}}let y=Dp(e,p,u,p.type==="row"?$o(b):Ac(p)),M=y?.viewFromSeatUrl,A=(y?.zone?t?.find(x=>x.id===y.zone):void 0)?.focalPoint??n;for(let x of b){if(!x.confidenceEvidence){let g=Number(x.id.slice(x.id.lastIndexOf(":")+1)),w=(p.type==="row"||p.type==="table")&&Number.isInteger(g)?p.overrides?.find(v=>v.index===g)?.confidenceEvidence:void 0;x.confidenceEvidence=h(w,"exact-seat")??(p.type==="row"?h(p.confidenceEvidence,"row-representative"):void 0)}x.confidenceEvidence??=h(y?.confidenceEvidence,"section-representative")??(a?h(a.evidence,a.coverage):void 0),!x.viewUrl&&M&&f(y?.viewFromSeatMeta)&&(x.viewUrl=M,x.viewMeta=y?.viewFromSeatMeta),!x.viewUrl&&i&&f(i.meta)&&(x.viewUrl=i.url,x.viewMeta=i.meta),y&&(x.sectionId=y.logicalSectionId??y.id),y?.zone&&(x.zoneId=y.zone),A&&(x.focalPoint={...A})}l.push(...b)}return l}function yn(e,t={}){if(e.floors?.length){let o=[];for(let r of e.floors){let i=r.focalPoint??e.focalPoint,a=r.viewFromSeatUrl?{url:r.viewFromSeatUrl,meta:r.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,s=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,c=wc(r.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,a,s,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&Pc(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,c);for(let l of c)l.floorId=r.id;for(let l of c)o.push(l)}return o}let n=wc(e.objects,e.zones,e.focalPoint,e.eventConfigurationId,e.confidenceBasisSha256,e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);return t.resolveEyeHeights!==!1&&Pc(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),Vp(e,n,t)}function Vp(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||Mc(t,xc(t,gc(e))),t}function Pc(e,t,n,o){let r=e.filter(m=>m.type==="section"),i=n>0||r.some(m=>m.height!==void 0||m.rake!==void 0||(m.elevation??0)>0);if(!r.length||!i||!t){for(let m of o)m.eyeHeightM=n+ht;return}let a=new Array(o.length),s=new Map;for(let m of r)s.has(m.id)||s.set(m.id,m);let c=new Map,l=new Map;for(let m=0;m<o.length;m++){let f=o[m],h=(f.sectionId?s.get(f.sectionId)??r.find(b=>b.logicalSectionId===f.sectionId&&Ge({x:f.x,y:f.y},b.outline,b.holes)):void 0)??r.find(b=>Ge({x:f.x,y:f.y},b.outline,b.holes))??null;if(a[m]=h,!h)continue;c.has(h.id)||c.set(h.id,Ct(h,{floorBaseHeightM:n}));let p=l.get(h.id);p?p.push(m):l.set(h.id,[m])}let u=new Array(o.length).fill(void 0);for(let[m,f]of l){let d=c.get(m);if(!d)continue;let h=d.rake>0?Math.tan(d.rake*Math.PI/180):0,p=Ko(m,o,f,t);for(let b of p.rows){let y=b.blockDepth*fe*h,M=d.height+y;for(let S of b.seatIndices)u[S]=M}}for(let m=0;m<o.length;m++){let f=o[m],d=a[m];if(!d){f.eyeHeightM=n+ht;continue}let h=c.get(d.id);f.eyeHeightM=(u[m]??h.height)+ht}}function Ic(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=!1;for(let a of e)!Number.isFinite(a.x)||!Number.isFinite(a.y)||(i=!0,a.x<t&&(t=a.x),a.y<n&&(n=a.y),a.x>o&&(o=a.x),a.y>r&&(r=a.y));return i?{minX:t,minY:n,maxX:o,maxY:r}:null}function gn(e,t){return e.minX<=t.maxX&&t.minX<=e.maxX&&e.minY<=t.maxY&&t.minY<=e.maxY}var Rc="#ffffff";var Gp={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"},qv=Gp.wheelchair;var qo=["#e69f00","#56b4e9","#009e73","#f0e442","#0072b2","#d55e00","#cc79a7"],Ec="#a4508b";var ki={facilities:Ec,"food-drink":qo[5],navigation:qo[2],accessibility:qo[4]},er=Rc,Oi={minDiameterPx:12,glyphScale:.66,ringRatio:1/14,largeFromPx:24};var _e=e=>{let t=Math.round(e*100)/100;return Object.is(t,-0)?"0":String(t)},Sn=e=>`${_e(e[0])} ${_e(e[1])}`,vn=(e,t,n,o)=>[e+n*Math.cos(o*Math.PI/180),t+n*Math.sin(o*Math.PI/180)];function Hc(e){let t=`M${Sn(e.from)}`;for(let n of e.segs)t+=n.arc?`A${_e(n.arc.r)} ${_e(n.arc.r)} 0 ${n.arc.large} ${n.arc.sweep} ${Sn(n.to)}`:`L${Sn(n.to)}`;return`${t}Z`}function Te(e){let t=[e.from,...e.segs.map(o=>o.to)],n=[];for(let o=e.segs.length-1;o>=0;o--){let r=e.segs[o].arc;n.push({to:t[o],arc:r&&{...r,sweep:r.sweep?0:1}})}return{from:t[t.length-1],segs:n}}function Le(e,t,n){let o={r:n,large:0,sweep:1};return{from:[e-n,t],segs:[{to:[e+n,t],arc:o},{to:[e-n,t],arc:o}]}}function de(e,t,n,o,r){let i=Math.min(r,n/2,o/2),a={r:i,large:0,sweep:1};return i<=0?Fe([[e,t],[e+n,t],[e+n,t+o],[e,t+o]]):{from:[e+i,t],segs:[{to:[e+n-i,t]},{to:[e+n,t+i],arc:a},{to:[e+n,t+o-i]},{to:[e+n-i,t+o],arc:a},{to:[e+i,t+o]},{to:[e,t+o-i],arc:a},{to:[e,t+i]},{to:[e+i,t],arc:a}]}}function Fe(e){let t=0;for(let o=0;o<e.length;o++){let[r,i]=e[o],[a,s]=e[(o+1)%e.length];t+=r*s-a*i}let n=t>0?e:[...e].reverse();return{from:n[0],segs:[...n.slice(1).map(o=>({to:o})),{to:n[0]}]}}function Re(e,t,n){let o=n/2,r=t[0]-e[0],i=t[1]-e[1],a=Math.hypot(r,i);if(a<1e-6)return Le(e[0],e[1],o);let s=[i/a*o,-r/a*o],c={r:o,large:0,sweep:1},l=[e[0]+s[0],e[1]+s[1]];return{from:l,segs:[{to:[t[0]+s[0],t[1]+s[1]]},{to:[t[0]-s[0],t[1]-s[1]],arc:c},{to:[e[0]-s[0],e[1]-s[1]]},{to:l,arc:c}]}}function Oe(e,t,n=!1){let o=[],r=n?e.length:e.length-1;for(let i=0;i<r;i++)o.push(Re(e[i],e[(i+1)%e.length],t));return o}function st(e,t,n,o,r,i){let a=i/2,s=r-o>180?1:0,c={r:a,large:0,sweep:1},l=vn(e,t,n+a,o);return{from:l,segs:[{to:vn(e,t,n+a,r),arc:{r:n+a,large:s,sweep:1}},{to:vn(e,t,n-a,r),arc:c},{to:vn(e,t,n-a,o),arc:{r:n-a,large:s,sweep:0}},{to:l,arc:c}]}}var pe=(...e)=>e.flat().map(Hc).join(" "),We=(e,t,n)=>`M${_e(e-n)} ${_e(t)}a${_e(n)} ${_e(n)} 0 1 0 ${_e(2*n)} 0a${_e(n)} ${_e(n)} 0 1 0 ${_e(-2*n)} 0`,bt=(e,t,n,o,r)=>Hc(de(e,t,n,o,r)),Jo=e=>`M${e.map(Sn).join("L")}`,Qo=(e,t,n,o,r)=>`M${Sn(vn(e,t,n,o))}A${_e(n)} ${_e(n)} 0 ${r-o>180?1:0} 1 ${Sn(vn(e,t,n,r))}`;function xn(e,t,n,o=1){let r=i=>[i[0]*o+t,i[1]*o+n];return{head:[e.head[0]*o+t,e.head[1]*o+n,e.head[2]*o],limbs:e.limbs.map(i=>i.map(r)),arcs:e.arcs?.map(([i,a,s,c,l])=>[i*o+t,a*o+n,s*o,c,l])}}function ao(e){return[We(e.head[0],e.head[1],e.head[2]),...e.limbs.map(Jo),...(e.arcs??[]).map(([t,n,o,r,i])=>Qo(t,n,o,r,i))].join(" ")}function Mn(e,t=2.6){return[Le(e.head[0],e.head[1],e.head[2]+1),...e.limbs.flatMap(n=>Oe(n,t)),...(e.arcs??[]).map(([n,o,r,i,a])=>st(n,o,r,i,a,t-.2))]}var Qt={head:[10,4,2],limbs:[[[10,8.2],[10,14],[15.5,14],[18,19.5],[20.5,19.5]],[[10,10.6],[14.5,10.6]]],arcs:[[9.5,16,5.5,35,235]]},Cc={head:[10.6,3.9,1.9],limbs:[[[9.6,7.8],[7.6,12]],[[5.4,8.2],[9.4,8.4],[12.8,10]],[[4,15.6],[7.6,12],[11,13.6],[10.6,16.4]]]},_c={cx:12,hr:1.9,arm:5,leg:3,r:2},Tc={cx:12,hr:1.9,sh:2.2,hem:6,leg:3},Lc={cx:6.2,hr:1.8,arm:3.6,leg:2.2,r:1.4},kc={cx:17.8,hr:1.8,sh:1.4,hem:4.1,leg:2.2};function Oc({cx:e,hr:t,arm:n,leg:o,r}){return[We(e,2+t,t),`M${_e(e-n+r)} 8.5H${_e(e+n-r)}a${r} ${r} 0 0 1 ${r} ${r}V15H${_e(e+o)}V22H${_e(e-o)}V15H${_e(e-n)}V${_e(8.5+r)}a${r} ${r} 0 0 1 ${r} ${-r}Z`,`M${_e(e)} 15V22`].join(" ")}function Fc({cx:e,hr:t,arm:n,leg:o,r}){return[Le(e,2+t,t+1),de(e-n-.5,7.8,2*n+1,7.7,r+.5),de(e-o-.5,13,o,9.5,1),de(e+.5,13,o,9.5,1)]}function Dc({cx:e,hr:t,sh:n,hem:o,leg:r}){return[We(e,2+t,t),Jo([[e-n,8.5],[e+n,8.5],[e+o,16],[e+r,16],[e+r,22],[e-r,22],[e-r,16],[e-o,16]])+"Z",`M${_e(e)} 16V22`].join(" ")}function Nc({cx:e,hr:t,sh:n,hem:o,leg:r}){return[Le(e,2+t,t+1),Fe([[e-n-.6,7.8],[e+n+.6,7.8],[e+o+.9,16.8],[e-o-.9,16.8]]),de(e-r-.1,15,r-.4,7.5,.9),de(e+.5,15,r-.4,7.5,.9)]}var Hp=[[14.6,1.5],[5.2,13.6],[11,13.6],[9.4,22.5],[18.8,10.4],[13,10.4]],zp="M8.5 3.5 4 5.5l-1.5 5 3 1 1-2v11h11v-11l1 2 3-1-1.5-5-4.5-2c-.5 1.5-1.8 2.5-3.5 2.5s-3-1-3.5-2.5Z",Up="M12 2.5S5 9.5 5 14.5a7 7 0 0 0 14 0c0-5-7-12-7-12Z",jp="M2.5 21.5h19V3h-6v6.2H9.2v6.2H2.5Z",Bc=[[9,3],[15,3],[15,9],[21,9],[21,15],[15,15],[15,21],[9,21],[9,15],[3,15],[3,9],[9,9]],Wp={from:[3.8,5.2],segs:[{to:[20.2,5.2]},{to:[22,7],arc:{r:1.8,large:0,sweep:1}},{to:[22,9.7]},{to:[22,14.3],arc:{r:2.3,large:0,sweep:0}},{to:[22,17]},{to:[20.2,18.8],arc:{r:1.8,large:0,sweep:1}},{to:[3.8,18.8]},{to:[2,17],arc:{r:1.8,large:0,sweep:1}},{to:[2,14.3]},{to:[2,9.7],arc:{r:2.3,large:0,sweep:0}},{to:[2,7]},{to:[3.8,5.2],arc:{r:1.8,large:0,sweep:1}}]},Xp={from:[12,1.6],segs:[{to:[20.4,4.9]},{to:[20.4,11.2]},{to:[12,22.4],arc:{r:13,large:0,sweep:1}},{to:[3.6,11.2],arc:{r:13,large:0,sweep:1}},{to:[3.6,4.9]},{to:[12,1.6]}]};function Vc(e,t,n){return{from:[e-n,t],segs:[{to:[e+n,t],arc:{r:n,large:0,sweep:1}},{to:[e-n,t]}]}}var Gc={head:[13.2,4.3,2.2],limbs:[[[12.6,8.6],[11.2,15],[17.8,18.4],[9.4,18.4]],[[12.4,9.8],[16,14.4]]]},Yp=[[6,10.5],[15,10.5],[16.5,7],[18.5,5.5],[20,6.5],[21.5,8.5],[19.5,10],[18,12],[18,19],[16.5,19],[15.5,14],[9.5,14],[8.5,19],[7,19],[6.5,13]],Kp=[[5.4,9.8],[14.6,9.8],[16.1,6.4],[18.4,4.6],[20.5,5.9],[22.4,8.6],[19.9,10.6],[18.8,12.3],[18.8,19.8],[15.8,19.8],[15,14.8],[10.1,14.8],[9.2,19.8],[6.2,19.8],[5.6,13.2]],Fi=[{key:"restroom-men",label:"Men's restroom",group:"facilities",path:Oc(_c),solid:pe(Fc(_c))},{key:"restroom-women",label:"Women's restroom",group:"facilities",path:Dc(Tc),solid:pe(Nc(Tc))},{key:"restroom-accessible",label:"Accessible restroom",group:"facilities",path:[bt(2.5,2.5,19,19,3.5),ao(xn(Qt,4.6,4.3,.66))].join(" "),solid:pe(Mn(Qt)),solidLarge:pe(de(1.5,1.5,21,21,4.5),Te(de(3.9,3.9,16.2,16.2,2.6)),Mn(xn(Qt,4.9,4.7,.62),2.2))},{key:"first-aid",label:"First aid",group:"facilities",path:Jo(Bc)+"Z",solid:pe(Fe(Bc.map(([e,t])=>[e+(e-12)*.08,t+(t-12)*.08])))},{key:"coat-check",label:"Coat check",group:"facilities",path:"M10 6.5a2 2 0 1 1 2 2V10 M12 10 3.4 16.9a1.4 1.4 0 0 0 .9 2.6h15.4a1.4 1.4 0 0 0 .9-2.6Z",solid:pe(st(12,6.2,2.2,180,450,2.3),Re([12,8.4],[12,10.5],2.3),Oe([[12,10.2],[3.2,18.8],[20.8,18.8]],2.8,!0))},{key:"atm",label:"ATM / cash",group:"facilities",path:[bt(2,6,20,12,2),We(12,12,2.75),"M6 12h.01 M18 12h.01"].join(" "),solid:pe(de(1.5,5.5,21,13,2.4),Te(Le(12,12,3.2)))},{key:"info",label:"Info point",group:"facilities",path:[We(12,12,9.5),"M10.8 11H12v5.8 M12 7.6h.01"].join(" "),solid:pe(Le(12,4.9,2.4),de(10.3,9.2,3.4,12.3,1),de(8.2,9.2,4,3,1),de(8.2,18.5,7.6,3,1))},{key:"lost-found",label:"Lost & found",group:"facilities",path:[We(10.5,10.5,7.5),"M16 16l5.5 5.5","M8.4 8.4a2.1 2.1 0 1 1 3 1.9c-.6.4-.9.8-.9 1.6 M10.5 14.6h.01"].join(" "),solid:pe(st(12,7.6,4.2,180,405,3.4),Oe([[14.97,10.57],[12,13],[12,15]],3.4),Le(12,20,2.1))},{key:"restrooms",label:"Toilets",group:"facilities",path:[Oc(Lc),Dc(kc)].join(" "),solid:pe(Fc(Lc),Nc(kc))},{key:"charging",label:"Charging point",group:"facilities",path:[bt(6,2,12,20,2.5),"M13.2 6.2 9.6 12h4.8l-3.6 5.8"].join(" "),solid:pe(Fe(Hp))},{key:"smoking",label:"Smoking area",group:"facilities",path:[bt(2,14.5,14.5,4,1),"M6.5 14.5v4","M15.5 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4 M19 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4"].join(" "),solid:pe(de(1.5,14,4.2,5,1.2),de(6.8,14,10.4,5,1.2),Oe([[15.9,11.4],[17.3,8.9],[15.9,6.4],[17.1,3.9]],2.2),Oe([[19.6,11.4],[21,8.9],[19.6,6.4],[20.8,3.9]],2.2))},{key:"no-smoking",label:"No smoking",group:"facilities",path:[We(12,12,9.5),"M5.3 5.3l13.4 13.4","M5.5 10.5h13v3h-13Z"].join(" "),solid:pe(Le(12,12,10.6),Te(Le(12,12,8)),Re([6,6],[18,18],2.8),de(5,10.4,3,3.2,.6),de(16,10.4,3,3.2,.6))},{key:"food",label:"Food",group:"food-drink",path:"M5 2.5V8a2.5 2.5 0 0 0 5 0V2.5 M7.5 2.5v19 M18.5 13.5h-2c-1.3 0-2-1-2-2.5 0-4 1.5-7 4-8.5v19",solid:pe(Oe([[4.9,2.6],[4.9,8]],2.2),Oe([[10.1,2.6],[10.1,8]],2.2),Oe([[7.5,2.6],[7.5,8]],2.2),st(7.5,8,2.6,0,180,2.2),Re([7.5,10],[7.5,21.4],3),Fe([[19.4,2.2],[19.4,14.2],[16.2,14.2],[14.1,12],[14.1,9.4],[15.2,5.8],[17.3,3.3]]),Re([18,13],[18,21.4],3))},{key:"bar",label:"Bar",group:"food-drink",path:"M3.5 3.5h17L12 13Z M6.2 6.5h11.6 M12 13v7.5 M8 20.5h8",solid:pe(Fe([[2.8,3],[21.2,3],[12,13.6]]),Re([12,12],[12,20.6],2.8),Re([7.4,21],[16.6,21],2.8))},{key:"coffee",label:"Caf\xE9 / coffee",group:"food-drink",path:"M4 9h12v4.5a5.5 5.5 0 0 1-5.5 5.5h-1A5.5 5.5 0 0 1 4 13.5Z M16 10.5h1.2a2.75 2.75 0 0 1 0 5.5H16 M8 3v3 M12 3v3 M3 21.5h14",solid:pe({from:[3.4,8.4],segs:[{to:[16.6,8.4]},{to:[16.6,13.4]},{to:[11,19.4],arc:{r:5.8,large:0,sweep:1}},{to:[9,19.4]},{to:[3.4,13.4],arc:{r:5.8,large:0,sweep:1}},{to:[3.4,8.4]}]},st(17.2,13.25,2.5,270,450,2.4),Re([7.8,2.6],[7.8,5.6],2.4),Re([12.2,2.6],[12.2,5.6],2.4),Re([2.6,21.6],[17.4,21.6],2.6))},{key:"water",label:"Water / drinks",group:"food-drink",path:Up,solid:"M12 1.2S4 8.9 4 14.5a8 8 0 0 0 16 0c0-5.6-8-13.3-8-13.3Z"},{key:"merch",label:"Merch / shop",group:"food-drink",path:zp,solid:"M8.4 2.8 3.5 5l-1.9 6 4.2 1.4.4-.8v9.4h11.6v-9.4l.4.8 4.2-1.4-1.9-6-4.9-2.2c-.4 1.5-1.8 2.6-3.6 2.6s-3.2-1.1-3.6-2.6Z"},{key:"screen",label:"Screen",group:"facilities",path:[bt(2,3.5,20,13.5,2),"M12 17v3.5 M8 20.5h8","M10 7.8v5.9l5-2.95Z"].join(" "),solid:pe(de(1.5,3,21,14.4,2.4),Te(Fe([[9.6,6.7],[16,10.2],[9.6,13.7]])),de(10.6,16.5,2.8,4,0),Re([7.4,21],[16.6,21],2.8))},{key:"sound-booth",label:"Sound booth",group:"facilities",path:["M6 3v9 M6 16v5 M12 3v3 M12 10v11 M18 3v10 M18 17v4",We(6,14,2),We(12,8,2),We(18,15,2)].join(" "),solid:pe(Re([6,2.8],[6,21.2],1.8),Re([12,2.8],[12,21.2],1.8),Re([18,2.8],[18,21.2],1.8),de(3.2,11.6,5.6,4.8,1.4),de(9.2,5.6,5.6,4.8,1.4),de(15.2,12.6,5.6,4.8,1.4))},{key:"entrance",label:"Entrance",group:"navigation",path:"M11 7V3.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v17a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V17 M2.5 12h13.5 M12.5 8.5 16 12l-3.5 3.5",solid:pe(Oe([[11,6.5],[11,2.6],[21,2.6],[21,21.4],[11,21.4],[11,17.5]],2.6),Re([2.8,12],[13.5,12],3.2),Fe([[12.6,7.8],[18,12],[12.6,16.2]]))},{key:"exit",label:"Exit",group:"navigation",path:"M13 7V3.5a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v17a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V17 M8 12h13.5 M18 8.5l3.5 3.5-3.5 3.5",solid:pe(Oe([[13,6.5],[13,2.6],[3,2.6],[3,21.4],[13,21.4],[13,17.5]],2.6),Re([7.2,12],[17,12],3.2),Fe([[16.2,7.8],[21.6,12],[16.2,16.2]]))},{key:"emergency-exit",label:"Emergency exit",group:"navigation",path:[ao(xn(Cc,-2,1.4,1.15)),"M15.5 13h6 M19 10.5l2.5 2.5-2.5 2.5"].join(" "),solid:pe(Mn(xn(Cc,-2,1.4,1.15),2.7),Re([15.6,13],[19.5,13],2.8),Fe([[18.4,9.4],[22.4,13],[18.4,16.6]]))},{key:"stairs",label:"Stairs",group:"navigation",path:jp,solid:"M1.5 22.5h21V2h-7.8v6.4H8.4v6.4H1.5Z"},{key:"elevator",label:"Elevator",group:"navigation",path:[bt(3.5,2.5,17,19,2.5),"M8.5 9.5 12 5.5l3.5 4Z M8.5 14.5l3.5 4 3.5-4Z"].join(" "),solid:pe(Fe([[12,1.6],[19.6,10.2],[4.4,10.2]]),Fe([[4.4,13.8],[19.6,13.8],[12,22.4]]))},{key:"parking",label:"Parking",group:"navigation",path:[bt(3,3,18,18,3),"M9.5 17V7h3.75a3 3 0 0 1 0 6H9.5"].join(" "),solid:"M6.5 21V3H12a5.5 5.5 0 0 1 0 11h-1.9v7Z M10.1 6.6v3.8H12a1.9 1.9 0 0 0 0-3.8Z"},{key:"wheelchair",label:"Wheelchair access",group:"accessibility",path:ao(Qt),solid:pe(Mn(Qt))},{key:"hearing",label:"Hearing assistance",group:"accessibility",path:["M4 9a6 6 0 1 1 12 0c0 3-1.8 4.3-3 5.2-1.1.8-1.6 1.7-1.6 3.1a3.6 3.6 0 0 1-6.2 2.1","M7.5 9a2.5 2.5 0 0 1 5 0c0 1.2-.7 1.9-1.6 2.5","M18.5 5.5a6.5 6.5 0 0 1 0 8"].join(" "),solid:pe(st(10,9,6,180,380,3),Oe([[15.64,11.05],[12.8,14.3],[11.5,17.2]],3),st(8.2,17.2,3.3,0,150,3),st(10,9,2.2,180,400,2.4),st(13.38,9.5,6.5,322,398,2.6))},{key:"box-office",label:"Box office / tickets",group:"navigation",path:"M3 7.5A1.5 1.5 0 0 1 4.5 6h15A1.5 1.5 0 0 1 21 7.5V10a2 2 0 0 0 0 4v2.5a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 16.5V14a2 2 0 0 0 0-4Z M15 6v2 M15 11v2 M15 16v2",solid:pe(Wp,Te(de(14.1,7,1.8,2.2,.9)),Te(de(14.1,10.9,1.8,2.2,.9)),Te(de(14.1,14.8,1.8,2.2,.9)))},{key:"escalator",label:"Escalator",group:"navigation",path:"M2.5 17H7l9-9h5.5v4h-4l-9 9h-6Z M11 4.5h.01 M11 8.2v3.3",solid:pe(Fe([[2,16.4],[6.8,16.4],[15.8,7.4],[22,7.4],[22,12.6],[17.8,12.6],[8.8,21.6],[2,21.6]]),Le(11,4.3,2.3),Re([11,8],[11,11],2.6))},{key:"ramp",label:"Ramp",group:"navigation",path:"M2.5 19.5h19v-10Z M4.5 13.2 14 8.2 M10.53 7.76 14 8.2l-1.6 3.11",solid:pe(Fe([[1.6,20.4],[22.4,20.4],[22.4,8.6]]),Re([4.2,13.4],[13.2,8.6],2.6),Fe([[15.4,7.5],[13.16,11.84],[10.56,6.88]]))},{key:"taxi",label:"Taxi / rideshare",group:"navigation",path:["M9.5 2.5h5V5h-5Z M6.5 11 8 7h8l1.5 4",bt(3.5,11,17,6,2),"M6.5 17v2.5 M17.5 17v2.5 M7 14h.01 M17 14h.01"].join(" "),solid:pe(de(9,1.8,6,3.4,.8),Fe([[6,11.4],[7.6,6.4],[16.4,6.4],[18,11.4]]),de(2.8,10.6,18.4,7,2.2),Te(Le(6.8,14,1.3)),Te(Le(17.2,14,1.3)),de(4.8,16,3.6,5.2,1.2),de(15.6,16,3.6,5.2,1.2))},{key:"transit",label:"Bus / transit",group:"navigation",path:[bt(4.5,2.5,15,16,3),"M4.5 10.5h15 M9 5.5h6 M7.5 18.5V21 M16.5 18.5V21 M8 14.5h.01 M16 14.5h.01"].join(" "),solid:pe(de(4,2,16,17,3.2),Te(de(6.2,5.8,11.6,5,1)),Te(Le(8,14.5,1.3)),Te(Le(16,14.5,1.3)),de(6,17,3.4,5,1.2),de(14.6,17,3.4,5,1.2))},{key:"bike-parking",label:"Bike parking",group:"navigation",path:[We(6,14.5,4),We(18,14.5,4),"M6 14.5 9 7.5h6.5L18 14.5 M9 7.5l2.5 7H6 M11.5 14.5l4-7 M7.5 6h3 M15.5 7.5 15 5.5h2"].join(" "),solid:pe(Le(6,14.5,4.9),Te(Le(6,14.5,2.7)),Le(18,14.5,4.9),Te(Le(18,14.5,2.7)),Oe([[6,14.5],[9,7.5],[15.5,7.5],[18,14.5]],2.2),Oe([[9,7.5],[11.5,14.5],[15.5,7.5]],2.2),Re([6,14.5],[11.5,14.5],2.2),Re([7.2,5.8],[10.6,5.8],2.2),Oe([[15.4,7.3],[15,5.4],[17.2,5.4]],2.2))},{key:"meeting-point",label:"Meeting point",group:"navigation",path:["M9.5 2.5 12 5l2.5-2.5 M9.5 21.5 12 19l2.5 2.5 M2.5 9.5 5 12l-2.5 2.5 M21.5 9.5 19 12l2.5 2.5",We(10,9.6,1.5),We(14,9.6,1.5),"M7.5 15.5a2.5 2.5 0 0 1 5 0 M11.5 15.5a2.5 2.5 0 0 1 5 0"].join(" "),solid:pe(Oe([[9.4,2.4],[12,5],[14.6,2.4]],2.6),Oe([[9.4,21.6],[12,19],[14.6,21.6]],2.6),Oe([[2.4,9.4],[5,12],[2.4,14.6]],2.6),Oe([[21.6,9.4],[19,12],[21.6,14.6]],2.6),Le(9.7,9.3,2.2),Le(14.3,9.3,2.2),Vc(9.7,16,3),Vc(14.3,16,3))},{key:"security",label:"Security / bag check",group:"facilities",path:"M12 2.5 19.5 5.5v6c0 4.6-3.2 8.4-7.5 10-4.3-1.6-7.5-5.4-7.5-10v-6Z M8.5 12l2.5 2.5 4.5-5",solid:pe(Xp,Te(Fe([[7.4,12.2],[9,10.6],[10.9,12.5],[15,8.4],[16.6,10],[10.9,15.7]])))},{key:"lockers",label:"Lockers",group:"facilities",path:[bt(3.5,2.5,17,19,1.5),"M12 2.5v19 M6 6h3 M15 6h3 M9.5 11.5v2.5 M14.5 11.5v2.5"].join(" "),solid:pe(de(3,2,8.4,20,1.4),Te(de(5,5,4.4,1.7,.8)),Te(de(8.6,10.8,1.5,3.8,.7)),de(12.6,2,8.4,20,1.4),Te(de(14.6,5,4.4,1.7,.8)),Te(de(13.9,10.8,1.5,3.8,.7)))},{key:"baby-change",label:"Baby change",group:"facilities",path:"M10 6.5l.8-3.3a1.2 1.2 0 0 1 2.4 0l.8 3.3 M8.5 6.5h7 M9.5 6.5l-.9 2.2a3 3 0 0 0-.1.9V19a2.5 2.5 0 0 0 2.5 2.5h2a2.5 2.5 0 0 0 2.5-2.5V9.6a3 3 0 0 0-.1-.9l-.9-2.2 M8.5 12.5h3 M8.5 16h3",solid:pe(Fe([[9.6,6.2],[10.6,1.8],[13.4,1.8],[14.4,6.2]]),de(7.6,5.4,8.8,2.6,1),de(7.8,7.4,8.4,15,2.6),Te(de(7.8,11.8,3.4,1.5,0)),Te(de(7.8,15.4,3.4,1.5,0)))},{key:"prayer-room",label:"Prayer room",group:"facilities",path:[ao(Gc),"M3 21.5h18"].join(" "),solid:pe(Mn(Gc),de(2.4,20.2,19.2,2.6,1.3))},{key:"quiet-room",label:"Quiet room",group:"facilities",path:"M4 9h3.5l5-4v14l-5-4H4Z M15.5 9.5l5 5 M20.5 9.5l-5 5",solid:pe(Fe([[2.6,8.4],[7.2,8.4],[13,3.6],[13,20.4],[7.2,15.6],[2.6,15.6]]),Re([15.4,9.2],[20.8,14.8],2.8),Re([20.8,9.2],[15.4,14.8],2.8))},{key:"wifi",label:"Wi-Fi",group:"facilities",path:[Qo(12,19,11.5,218,322),Qo(12,19,7.5,218,322),Qo(12,19,3.5,218,322),"M12 19h.01"].join(" "),solid:pe(st(12,19.2,11,218,322,2.8),st(12,19.2,6.9,218,322,2.8),Le(12,19.2,2.2))},{key:"vip-lounge",label:"VIP lounge",group:"facilities",path:["M6.5 11V7a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v4","M3.5 11.5a1.5 1.5 0 0 1 3 0V14h11v-2.5a1.5 1.5 0 0 1 3 0v6h-17Z","M5.5 17.5V20 M18.5 17.5V20"].join(" "),solid:pe(de(6,4,12,8.5,2.2),de(2.4,9.6,4.6,9,2.2),de(17,9.6,4.6,9,2.2),de(6,13.2,12,5.4,.6),Re([5,18],[5,20.6],2.4),Re([19,18],[19,20.6],2.4))},{key:"accessible-entrance",label:"Accessible entrance",group:"accessibility",path:[ao(xn(Qt,.3,5,.62)),"M12.5 3.5H20a1 1 0 0 1 1 1v15a1 1 0 0 1-1 1h-7.5"].join(" "),solid:pe(Mn(xn(Qt,.3,5,.62),2.2),Oe([[13,2.8],[21.2,2.8],[21.2,21.2],[13,21.2]],2.6))},{key:"assistance-dog",label:"Assistance-dog area",group:"accessibility",path:[Jo(Yp)+"Z","M6 10.8 3.5 7.5","M10.5 10.5V6h4.5l1 2.5"].join(" "),solid:pe(Fe(Kp),Re([6.2,11],[3.2,7.2],2.4),Oe([[10.5,11],[10.5,5.6],[15.2,5.6],[16.2,8.2]],2.2))}],n2=new Map(Fi.map(e=>[e.key,e]));var zc=Fi;var $p=new Map(zc.map(e=>[e.key,e]));function so(e){return e?$p.get(e):void 0}var a2=zc.map(e=>e.key);var Uc=e=>Math.round(e*1e6)/1e6+0;function wn(e){let t=e.map(r=>({x:Uc(r.x),y:Uc(r.y)})).sort((r,i)=>r.x-i.x||r.y-i.y).filter((r,i,a)=>i===0||r.x!==a[i-1].x||r.y!==a[i-1].y);if(t.length<3)return t;let n=(r,i,a)=>{let s=i.x-r.x,c=i.y-r.y,l=a.x-r.x,u=a.y-r.y;return s*u-c*l>1e-6*Math.hypot(s,c)*Math.hypot(l,u)},o=r=>{let i=[];for(let a of r){for(;i.length>=2&&!n(i[i.length-2],i[i.length-1],a);)i.pop();i.push(a)}return i.pop(),i};return[...o(t),...o([...t].reverse())]}function co(e){if(e.length<3)return e.map(n=>({...n}));let t=wn(e);return t.length>=3?t:[...e].sort((n,o)=>n.x-o.x||n.y-o.y).map(n=>({...n}))}var ll=ft(require("polygon-clipping"),1);var ae={top:1,wallBottom:.58,bottomCap:.4};function Jt(e,t){if(!e)return t;let n=le(dt(e,.4),.62);return ge(t,n,.22)}function jc(e,t){return e?ge(t,le(dt(e,.25),.74),.62):t}function Wc(e,t){let n=Xt(an({tierTop:t}));return e?Wt(e,n.sectionDeck,Math.min(n.sectionDeckChromaShare*Yn(e),n.sectionDeckChromaCap)):Wt(t,n.deck,Math.min(Yn(t),Oo))}function Xc(e,t){let n=new Map;for(let i of e.categories??[])n.set(i.key,i.color);let o=new Map;for(let i of t){if(!i.sectionId)continue;let a=o.get(i.sectionId);a||(a=new Map,o.set(i.sectionId,a)),a.set(i.categoryKey,(a.get(i.categoryKey)??0)+1)}let r=new Map;for(let[i,a]of o){let s=0,c=0,l=0,u=0;for(let[m,f]of a){let d=ye(n.get(m));d&&(s+=d[0]*f,c+=d[1]*f,l+=d[2]*f,u+=f)}u>0&&r.set(i,[s/u,c/u,l/u])}return r}function Yc(e,t){return ye(e.color)??t.get(e.logicalSectionId??e.id)??null}var Vi=ft(require("polygon-clipping"),1);var Bi=ft(require("polygon-clipping"),1);var qc=ft(require("earcut"),1);var Zp=.58,Kc=.01,tt=St*1.5*et,qp=.5,Qp=.6;function Jp(e,t){let n=e.length,o=[];for(let a=0;a<n;a++){let s=e[Math.max(0,a-1)],c=e[Math.min(n-1,a+1)],l=c.x-s.x,u=c.y-s.y,m=Math.hypot(l,u);if(m<1e-9){o.push([0,0]);continue}l/=m,u/=m,o.push([-u,l])}let r=0;for(let a=0;a<n;a++)r+=(e[a].x-t.x)*o[a][0]+(e[a].y-t.y)*o[a][1];return r<0?o.map(([a,s])=>[-a,-s]):o}function eb(e,t){if(e.length<2||t<=0)return[...e];let n=[...e],o=(a,s)=>{let c=s.x-a.x,l=s.y-a.y,u=Math.hypot(c,l)||1;return{x:c/u,y:l/u}},r=o(n[1],n[0]),i=o(n[n.length-2],n[n.length-1]);return n.unshift({x:n[0].x+r.x*t,y:n[0].y+r.y*t}),n.push({x:n[n.length-1].x+i.x*t,y:n[n.length-1].y+i.y*t}),n}var $c=Math.PI/12;function tb(e){if(e.length<3)return[...e];let t=wn(e);return t.length>=3?t:[...e]}function Qc(e,t){if(!e.length||!(t>0))return[];let n=tb(e),o=(s,c,l,u)=>{let m=l-c;for(;m<0;)m+=Math.PI*2;for(;m>Math.PI*2;)m-=Math.PI*2;let f=Math.max(1,Math.ceil(m/$c)),d=t/Math.cos(m/f/2);for(let h=0;h<=f;h++){let p=c+m*h/f;u.push({x:s.x+Math.cos(p)*d,y:s.y+Math.sin(p)*d})}};if(n.length<3){let s=0,c=0;for(let d of n)s+=d.x,c+=d.y;s/=n.length||1,c/=n.length||1;let l=0;for(let d of n)l=Math.max(l,Math.hypot(d.x-s,d.y-c));let u=[],m=Math.max(3,Math.ceil(Math.PI*2/$c)),f=(l+t)/Math.cos(Math.PI/m);for(let d=0;d<m;d++){let h=d/m*Math.PI*2;u.push({x:s+Math.cos(h)*f,y:c+Math.sin(h)*f})}return u}let r=n.length,i=[];for(let s=0;s<r;s++){let c=n[s],l=n[(s+1)%r];i.push(Math.atan2(-(l.x-c.x),l.y-c.y))}let a=[];for(let s=0;s<r;s++)o(n[s],i[(s+r-1)%r],i[s],a);return ol(a)}function nb(e,t,n){if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>1e-12?((t-i.x)*s+(n-i.y)*c)/l:0;u<0?u=0:u>1&&(u=1);let m=Math.hypot(t-(i.x+u*s),n-(i.y+u*c));m<o&&(o=m)}return o}function tr(e){let t=e.map(r=>{let i=0,a=0;for(let l of r.pts)i+=l.x,a+=l.y;let s=r.pts.length||1;i/=s,a/=s;let c=0;for(let l of r.pts){let u=Math.hypot(l.x-i,l.y-a);u>c&&(c=u)}return{cx:i,cy:a,rad:c}}),n=r=>{let i=r.length;return i<=2?[...r]:[r[Math.floor(i*.25)],r[Math.floor(i*.5)],r[Math.floor(i*.75)]]},o=[];for(let r=0;r<e.length;r++){let i=n(e[r].pts),a=[],s=1/0,c=null;for(let u of i){let m=1/0;for(let f=0;f<e.length;f++){if(f===r||Math.abs(e[f].y-e[r].y)<.001)continue;let d=t[f],h=Math.hypot(u.x-d.cx,u.y-d.cy)-d.rad;if(h>=m&&h>=s)continue;let p=nb(e[f].pts,u.x,u.y);p<m&&(m=p),e[f].depth<e[r].depth&&p<s&&(s=p,c=e[f].y)}Number.isFinite(m)&&m>0&&a.push(m)}a.sort((u,m)=>u-m);let l=a.length?a[Math.floor(a.length/2)]:1;o.push({pitch:l,belowY:c})}return o}function Jc(e,t,n,o){let r=e[t],i=r.pts.length>=2?[...r.pts]:r.pts.length===1?(()=>{let u=r.pts[0],m=u.x-o.x,f=u.y-o.y,d=Math.hypot(m,f)||1;m/=d,f/=d;let h=Math.max(n[t].pitch,.001)*.5;return[{x:u.x+f*h,y:u.y-m*h},{x:u.x-f*h,y:u.y+m*h}]})():[];if(i.length<2)return null;let a=0,s=0;for(let u=1;u<i.length;u++){let m=Math.hypot(i[u].x-i[u-1].x,i[u].y-i[u-1].y);m>1e-6&&(a+=m,s++)}let c=s>0?a/s:0,l=eb(i,Math.max(c*Qp,tt));return{pts:l,nrm:Jp(l,o),front:Math.max(n[t].pitch*Zp,tt),back:Math.max(n[t].pitch*qp,tt)}}var Pn=1.5,el=.3;function Di(e,t){if(e.length<3)return e;let n=e[0],o=e[e.length-1],r=o.x-n.x,i=o.y-n.y,a=Math.hypot(r,i),s=-1,c=-1;for(let m=1;m<e.length-1;m++){let f=e[m],d=a>1e-12?Math.abs((f.x-n.x)*i-(f.y-n.y)*r)/a:Math.hypot(f.x-n.x,f.y-n.y);d>s&&(s=d,c=m)}if(s<=t||c<0)return[n,o];let l=Di(e.slice(0,c+1),t),u=Di(e.slice(c),t);return[...l.slice(0,-1),...u]}function tl(e,t){if(e.length<4)return e;let n=Di([...e,e[0]],t);return n.pop(),n.length>=3?n:e}function ob(e){let t=e.map((o,r)=>{let i=e[(r+1)%e.length];return{a:o,b:i,i:r,minX:Math.min(o.x,i.x),maxX:Math.max(o.x,i.x),minY:Math.min(o.y,i.y),maxY:Math.max(o.y,i.y)}}).sort((o,r)=>o.minX-r.minX),n=(o,r,i)=>(r.x-o.x)*(i.y-o.y)-(r.y-o.y)*(i.x-o.x);for(let o=0;o<t.length;o++){let r=t[o];for(let i=o+1;i<t.length&&t[i].minX<=r.maxX;i++){let a=t[i];if(!(Math.abs(r.i-a.i)===1||Math.abs(r.i-a.i)===e.length-1||r.maxY<a.minY||a.maxY<r.minY)&&n(r.a,r.b,a.a)*n(r.a,r.b,a.b)<=0&&n(a.a,a.b,r.a)*n(a.a,a.b,r.b)<=0)return!0}}return!1}function nl(e,t,n){if(e.length<2)return[];let o=n??tr(e),r=new Map;for(let a=0;a<e.length;a++){let s=r.get(e[a].blockId);s?s.push(a):r.set(e[a].blockId,[a])}let i=[];for(let[,a]of r){let s=[];for(let M of a){let S=e[M].patch;S&&S.length>=3?i.push({outline:[...S],holes:[],topY:e[M].y}):s.push(M)}if(!s.length)continue;s.sort((M,S)=>e[M].depth-e[S].depth);let l=s.map(M=>Jc(e,M,o,t)).filter(M=>M!==null);if(!l.length)continue;let u=(M,S)=>({x:M.pts[S].x-M.nrm[S][0]*(M.front+Pn),y:M.pts[S].y-M.nrm[S][1]*(M.front+Pn)}),m=(M,S)=>({x:M.pts[S].x+M.nrm[S][0]*(M.back+Pn),y:M.pts[S].y+M.nrm[S][1]*(M.back+Pn)}),f=l[0],d=l[l.length-1],h=[];for(let M=0;M<f.pts.length;M++)h.push(u(f,M));for(let M of l)h.push(m(M,M.pts.length-1));for(let M=d.pts.length-1;M>=0;M--)h.push(m(d,M));for(let M=l.length-1;M>=0;M--)h.push(u(l[M],0));let p=ol(h),b=1/0;for(let M of s)e[M].y<b&&(b=e[M].y);if(!Number.isFinite(b))continue;if(p.length>=3&&Math.abs($e(p))>1e-6&&l.every(M=>{let S=M.pts[Math.floor(M.pts.length/2)];return Ze(p,S.x,S.y)})&&!ob(p)){i.push({outline:tl(p,el),holes:[],topY:b});continue}for(let M of rb(l))i.push({outline:M,holes:[],topY:b})}return i}function rb(e){let t=[];for(let n of e){let o=[],r=[],i=n.front+Pn,a=n.back+Pn;for(let c=0;c<n.pts.length;c++){let l=n.pts[c],u=n.nrm[c];o.push([l.x-u[0]*i,l.y-u[1]*i]),r.push([l.x+u[0]*a,l.y+u[1]*a])}let s=[...o,...r.reverse()];s.length<3||(s.push(s[0]),t.push([s]))}if(!t.length)return[];try{let n=Bi.default.union(t[0],...t.slice(1)),o=[];for(let r of n){if(!r.length||r[0].length<4)continue;let i=r[0].map(([c,l])=>({x:c,y:l})),a=i[0],s=i[i.length-1];i.length>1&&Math.abs(a.x-s.x)<1e-9&&Math.abs(a.y-s.y)<1e-9&&i.pop(),i.length>=3&&o.push(tl(i,el))}return o}catch{return[]}}function ol(e){let t=[];for(let n of e){let o=t[t.length-1];o&&Math.hypot(n.x-o.x,n.y-o.y)<1e-9||t.push(n)}for(;t.length>2&&Math.hypot(t[0].x-t[t.length-1].x,t[0].y-t[t.length-1].y)<1e-9;)t.pop();return t}var Ni=class{constructor(t){this.minX=1/0;this.minY=1/0;this.maxX=-1/0;this.maxY=-1/0;this.rings=t;for(let n of t)for(let o of n)o.x<this.minX&&(this.minX=o.x),o.y<this.minY&&(this.minY=o.y),o.x>this.maxX&&(this.maxX=o.x),o.y>this.maxY&&(this.maxY=o.y)}containsAll(t){for(let n of t)if(n.x<this.minX||n.x>this.maxX||n.y<this.minY||n.y>this.maxY)return!1;for(let n of this.rings){let o=!0;for(let r of t)if(!Ze(n,r.x,r.y)){o=!1;break}if(o)return!0}return!1}};function Zc(e,t,n,o,r,i){if(o.length<3)return;if(n.containsAll(o)){let l=[0,1,0],u=o[0];for(let m=1;m+1<o.length;m++){let f=o[m],d=o[m+1];e.tri([u.x*_,r,u.y*_],[f.x*_,r,f.y*_],[d.x*_,r,d.y*_],l,i)}return}let a=o.map(l=>[l.x,l.y]);a.push(a[0]);let s;try{s=Bi.default.intersection([a],t)}catch{return}let c=[0,1,0];for(let l of s){if(!l.length||l[0].length<4)continue;let u=l[0],m=[],f=[];for(let h=0;h<u.length-1;h++)m.push(u[h][0],u[h][1]),f.push([u[h][0],u[h][1]]);if(f.length<3)continue;let d=(0,qc.default)(m,void 0,2);for(let h=0;h<d.length;h+=3){let p=f[d[h]],b=f[d[h+1]],y=f[d[h+2]];e.tri([p[0]*_,r,p[1]*_],[b[0]*_,r,b[1]*_],[y[0]*_,r,y[1]*_],c,i)}}}function rl(e,t,n,o,r,i,a){if(t.length<2)return;let s=a??tr(t),c=[0,1,0],l=i&&i.length>=3?[[...i.map(d=>[d.x,d.y]),[i[0].x,i[0].y]]]:null,u=i&&i.length>=3?new Ni([[...i]]):null,m=d=>{e.setMaterial(2),d(),e.setMaterial(0)},f=d=>{e.setMaterial(3),d(),e.setMaterial(0)};for(let d=0;d<t.length;d++){let h=t[d];if(h.patch&&h.patch.length>=3){let x=[...h.patch],g=s[d].belowY??o;if(f(()=>{if(l&&u)Zc(e,l,u,x,h.y,r.tread);else{let w=x[0];for(let v=1;v+1<x.length;v++){let P=x[v],R=x[v+1];e.tri([w.x*_,h.y,w.y*_],[P.x*_,h.y,P.y*_],[R.x*_,h.y,R.y*_],c,r.tread)}}}),h.y>g+Kc){let w=0,v=0;for(let P of x)w+=P.x,v+=P.y;w/=x.length,v/=x.length,m(()=>{for(let P=0;P<x.length;P++){let R=x[P],k=x[(P+1)%x.length],F=k.x-R.x,E=k.y-R.y,I=Math.hypot(F,E);if(I<1e-6)continue;let C=E/I,L=-F/I;(R.x-w)*C+(R.y-v)*L<0&&(C=-C,L=-L);let N=[C,0,L],O=[R.x*_,h.y,R.y*_],H=[k.x*_,h.y,k.y*_],j=[R.x*_,g,R.y*_],V=[k.x*_,g,k.y*_];e.tri(O,H,V,N,r.riser),e.tri(O,V,j,N,r.riser)}})}continue}let p=Jc(t,d,s,n);if(!p)continue;let{pts:b,nrm:y,front:M,back:S}=p,A=s[d].belowY??o;for(let x=0;x+1<b.length;x++){let g=b[x],w=b[x+1],v=y[x],P=y[x+1];if(Math.hypot(w.x-g.x,w.y-g.y)<1e-6||v[0]===0&&v[1]===0||P[0]===0&&P[1]===0)continue;let R=[(g.x-v[0]*M)*_,h.y,(g.y-v[1]*M)*_],k=[(w.x-P[0]*M)*_,h.y,(w.y-P[1]*M)*_],F=[(g.x+v[0]*S)*_,h.y,(g.y+v[1]*S)*_],E=[(w.x+P[0]*S)*_,h.y,(w.y+P[1]*S)*_];if(f(()=>{l&&u?Zc(e,l,u,[{x:g.x-v[0]*M,y:g.y-v[1]*M},{x:w.x-P[0]*M,y:w.y-P[1]*M},{x:w.x+P[0]*S,y:w.y+P[1]*S},{x:g.x+v[0]*S,y:g.y+v[1]*S}],h.y,r.tread):(e.tri(R,k,E,c,r.tread),e.tri(R,E,F,c,r.tread))}),h.y>A+Kc){let I=[R[0],A,R[2]],C=[k[0],A,k[2]],L=[-v[0],0,-v[1]];m(()=>{e.tri(R,k,C,L,r.riser),e.tri(R,C,I,L,r.riser)})}}}}function ib(e,t){let n=e.eventConfigurationIds;return!n?.length||!!t&&n.includes(t)}function il(e,t){return e.filter(n=>n.type!=="shape"||ib(n,t))}function al(e,t){let n=e.focalPoint??{x:0,y:0};return e.floors?.length?e.floors.map((o,r)=>({objects:il(o.objects,t),focal:{x:(o.focalPoint??n).x,y:(o.focalPoint??n).y},baseHeightM:o.baseHeightM??0,index:r})):[{objects:il(e.objects,t),focal:n,baseHeightM:0,index:0}]}var ab={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};function Pt(e){return Ic(e)??ab}function sl(e,t){let n=at(e.outline,tt),o=Pt(n),r=t.filter(a=>a!==e&&a.outline&&a.outline.length>=3&&gn(o,Pt(a.outline)));if(!r.length)return[n];let i=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s};try{let a=Vi.default.difference([i(n)],...r.map(c=>[i(c.outline)])),s=[];for(let c of a){if(!c.length)continue;let l=c[0].map(([u,m])=>({x:u,y:m}));if(l.length>1){let u=l[0],m=l[l.length-1];Math.abs(u.x-m.x)<1e-9&&Math.abs(u.y-m.y)<1e-9&&l.pop()}l.length>=3&&s.push(l)}return s.length?s:[n]}catch{return[n]}}function cl(e,t){if(!t.length)return e;let n=i=>{let a=i.map(s=>[s.x,s.y]);return a.push(a[0]),a},o=t.map(i=>[n(i)]),r=[];for(let i of e){let a;try{a=Vi.default.intersection([n(i.outline)],o.flat())}catch{r.push(i);continue}for(let s of a){if(!s.length)continue;let c=s[0].map(([l,u])=>({x:l,y:u}));if(c.length>1){let l=c[0],u=c[c.length-1];Math.abs(l.x-u.x)<1e-9&&Math.abs(l.y-u.y)<1e-9&&c.pop()}c.length>=3&&r.push({outline:c,holes:[],topY:i.topY})}}return r.length?r:e}function sb(e,t){return e===void 0||t===void 0?!0:Math.abs(e-t)<.001}var nr=class{constructor(){this.rings=[];this.boxes=[];this.levels=[]}subtract(t,n){let o=t.map(c=>[c.x,c.y]);if(o.length<3)return[];o.push(o[0]);let r=Pt(t),i=this.rings.filter((c,l)=>gn(r,this.boxes[l])&&sb(n,this.levels[l])),a=[[o]];if(i.length)try{a=ll.default.difference([o],...i).map(l=>l.map(u=>u.map(([m,f])=>[m,f])))}catch{a=[[o]]}this.rings.push([o]),this.boxes.push(r),this.levels.push(n);let s=[];for(let c of a){if(!c.length)continue;let l=c[0].map(([u,m])=>({x:u,y:m}));if(l.length>1){let u=l[0],m=l[l.length-1];Math.abs(u.x-m.x)<1e-9&&Math.abs(u.y-m.y)<1e-9&&l.pop()}l.length>=3&&s.push(l)}return s}};function An(e,t,n=e){if(!t)return e;let o=1/0,r=-1/0,i=1/0,a=-1/0;for(let f of n)o=Math.min(o,f.x),r=Math.max(r,f.x),i=Math.min(i,f.y),a=Math.max(a,f.y);let s=(o+r)/2,c=(i+a)/2,l=t*Math.PI/180,u=Math.cos(l),m=Math.sin(l);return e.map(f=>{let d=f.x-s,h=f.y-c;return{x:s+d*u-h*m,y:c+d*m+h*u}})}function ul(e){let t=rc(e);return!t.length||!e.points?.length?[]:t.map(n=>An(n,e.rotation,e.points))}function xe(e){let t=null;if(e.kind==="polygon"&&e.points&&e.points.length>=3)return An(Yo(e,4),e.rotation,e.points);if(e.kind==="rect"&&e.width&&e.height&&(t=Jn(e.x??0,e.y??0,e.width,e.height)),e.kind==="ellipse"&&e.width&&e.height){let n=(e.x??0)+e.width/2,o=(e.y??0)+e.height/2;t=Uo(n,o,e.width/2,e.height/2)}return t?An(t,e.rotation):null}function ct(e){let t=e.role??"",o=t==="stage"?{kind:"stage",heightM:$s(e.stageKind)}:{stage:{kind:"stage",heightM:1},entrance:{kind:"portal",heightM:2.7},exit:{kind:"portal",heightM:2.7},screen:{kind:"solid",heightM:6},wall:{kind:"solid",heightM:2.8},rail:{kind:"solid",heightM:1.1},suite:{kind:"suite",heightM:3},obstruction:{kind:"solid",heightM:4.5},sound:{kind:"solid",heightM:1.45},restroom:{kind:"solid",heightM:2.4},bar:{kind:"solid",heightM:1.1},concession:{kind:"solid",heightM:1.1},coat:{kind:"solid",heightM:1.1},goal:{kind:"portal",heightM:1.8}}[t]??{kind:"plate",heightM:.25};return{...o,heightM:e.heightM??o.heightM}}var cb=.08,lb=30,ub=.015;function mb(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],a=t[r];i.y>e.y!=a.y>e.y&&e.x<(a.x-i.x)*(e.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function ml(e,t){let n=xe(e)??(e.points?.length?An(e.points,e.rotation):null),o=ct(e),i=!e.role&&o.kind==="plate"&&e.heightM===void 0&&!!n&&Math.abs($e(n))*fe**2>=lb?ub:o.heightM;if(!n)return{topOffsetM:i,supportOffsetM:0};if(o.kind!=="plate"&&o.kind!=="stage")return{topOffsetM:i,supportOffsetM:0};let a=1/0,s=1/0,c=-1/0,l=-1/0;for(let d of n)a=Math.min(a,d.x),s=Math.min(s,d.y),c=Math.max(c,d.x),l=Math.max(l,d.y);let u=i,m=0,f=1e-6*Math.max(1,c-a,l-s);for(let d of t)c>d.minX&&a<d.maxX&&l>d.minY&&s<d.maxY&&u<=d.topOffsetM+1e-6&&(u=d.topOffsetM+cb),a>=d.minX-f&&c<=d.maxX+f&&s>=d.minY-f&&l<=d.maxY+f&&(!d.poly||n.every(b=>mb(b,d.poly)||fb(b,d.poly,f)))&&(m=Math.max(m,d.topOffsetM));return e.fill&&e.fill!=="none"&&e.fill!=="transparent"&&t.push({minX:a,minY:s,maxX:c,maxY:l,topOffsetM:u,poly:n}),{topOffsetM:u,supportOffsetM:Math.min(m,u)}}function fb(e,t,n){for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[r],a=t[o],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l?Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/l)):0;if(Math.hypot(e.x-(i.x+u*s),e.y-(i.y+u*c))<=n)return!0}return!1}function Lt(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function qe(e){if(e.length!==4)return e;let t=Math.hypot(e[1].x-e[0].x,e[1].y-e[0].y),n=Math.hypot(e[2].x-e[1].x,e[2].y-e[1].y);return t>=n?e:[e[1],e[2],e[3],e[0]]}function Ue(e,t,n){return[Lt(e[0],e[1],t),Lt(e[0],e[1],n),Lt(e[3],e[2],n),Lt(e[3],e[2],t)]}function lo(e,t,n){return[Lt(e[0],e[3],t),Lt(e[1],e[2],t),Lt(e[1],e[2],n),Lt(e[0],e[3],n)]}function be(e,t,n,o,r,i,a){ue(e,t,a?.length?a:void 0,()=>n,o,r,i,ae)}var db=.8,hb=.6,pb=2;function kt(e,t){if(!t.length)return null;let n=[],o=0;for(let a of e.objects){if(a.type!=="shape"||a.role!=="wall")continue;let s=xe(a)??[],c=fl(s)/2;!(c>0)||gb(s)/c*_>pb||(n.push(...s),o+=c)}if(n.length<3)return null;let r=co(n);if(r.length<3||o<fl(r)*hb)return null;let i=0;for(let a of t)xb(a,r)&&(i+=1);return i>=t.length*db?r:null}var or=6,bb=5,yb=8;function dl(e){return Math.max(yb,(Number.isFinite(e)?e:0)+bb)}function In(e){let t=0,n=0,o=0;for(let r=0;r<e.length;r++){let i=e[r],a=e[(r+1)%e.length],s=i.x*a.y-a.x*i.y;t+=s,n+=(i.x+a.x)*s,o+=(i.y+a.y)*s}if(Math.abs(t)<1e-9){let r=0,i=0;for(let a of e)r+=a.x,i+=a.y;return{x:r/Math.max(1,e.length),y:i/Math.max(1,e.length)}}return{x:n/(3*t),y:o/(3*t)}}function gb(e){let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=o.x*r.y-r.x*o.y}return Math.abs(t)/2}function fl(e){let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=Math.hypot(r.x-o.x,r.y-o.y)}return t}function xb(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],a=t[r];i.y>e.y!=a.y>e.y&&e.x<(a.x-i.x)*(e.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function Mb(e){return{kind:"radial",rowCount:0,rows:[],nearestRow:()=>-1,depthAt:(t,n)=>Math.hypot(t-e.x,n-e.y),gradientAt:(t,n)=>{let o=t-e.x,r=n-e.y,i=Math.hypot(o,r);return i<1e-9?[0,0]:[o/i,r/i]}}}function vb(e,t){if(!e.length)return null;let n=0,o=0,r=0;for(let d of e)n+=d.x,o+=d.y,r+=Math.hypot(d.x-t.x,d.y-t.y);let i=e.length;n/=i,o/=i,r/=i;let a=e[0],s=-1;for(let d of e){let h=Math.hypot(d.x-n,d.y-o);h>s&&(s=h,a=d)}let c=a.x-n,l=a.y-o,u=Math.hypot(c,l);u>1e-9?(c/=u,l/=u):(c=1,l=0);let m=[...e].sort((d,h)=>(d.x-n)*c+(d.y-o)*l-((h.x-n)*c+(h.y-o)*l)),f=0;for(let d of m){let h=Math.hypot(d.x-n,d.y-o);h>f&&(f=h)}return{pts:m,cx:n,cy:o,radius:f,depth:r}}function hl(e,t,n){let o=e.pts;if(o.length===1)return Math.hypot(t-o[0].x,n-o[0].y);let r=1/0;for(let i=0;i+1<o.length;i++){let a=o[i],s=o[i+1],c=s.x-a.x,l=s.y-a.y,u=c*c+l*l,m=u>1e-12?((t-a.x)*c+(n-a.y)*l)/u:0;m<0?m=0:m>1&&(m=1);let f=Math.hypot(t-(a.x+m*c),n-(a.y+m*l));f<r&&(r=f)}return r}var rr=8;function Sb(e,t,n){let o=new Array(rr).fill(1/0),r=new Array(rr).fill(-1);for(let u=0;u<e.length;u++){let m=e[u],f=Math.hypot(t-m.cx,n-m.cy)-m.radius;for(let d=0;d<rr;d++)if(f<o[d]){for(let h=rr-1;h>d;h--)o[h]=o[h-1],r[h]=r[h-1];o[d]=f,r[d]=u;break}}let i=new Array(3).fill(1/0),a=new Array(3).fill(-1);for(let u of r){if(u<0)continue;let m=hl(e[u],t,n);for(let f=0;f<3;f++)if(m<i[f]){for(let d=2;d>f;d--)i[d]=i[d-1],a[d]=a[d-1];i[f]=m,a[f]=u;break}}if(a[0]<0)return 0;if(i[0]<1e-6)return e[a[0]].depth;let s=i[0]*2.2,c=0,l=0;for(let u=0;u<3;u++){let m=a[u];if(m<0||i[u]>s)continue;let f=1/(i[u]*i[u]);c+=f*e[m].depth,l+=f}return l>0?c/l:e[a[0]].depth}function wb(e){let t=(o,r)=>Sb(e,o,r),n=(o,r)=>{let i=1/0,a=-1;for(let s=0;s<e.length;s++){let c=e[s];if(Math.hypot(o-c.cx,r-c.cy)-c.radius>=i)continue;let l=hl(c,o,r);l<i&&(i=l,a=s)}return a};return{kind:"rows",rowCount:e.length,rows:e,nearestRow:n,depthAt:t,gradientAt:(o,r)=>{let i=(t(o+.5,r)-t(o-.5,r))/1,a=(t(o,r+.5)-t(o,r-.5))/(2*.5),s=Math.hypot(i,a);return s<1e-9?[0,0]:[i/s,a/s]}}}function pl(e,t){let n=[];for(let o of e){let r=vb(o.points,t);r&&n.push(r)}return n.length<2?Mb(t):(n.sort((o,r)=>o.depth-r.depth),wb(n))}var Ot=.06,Pb=.05,yl=.05,bl=.15,Gi=25;function gl(e,t,n){let o=new Map,r=new Array(t.length).fill(null),i=new Float64Array(t.length),a=new Array(t.length).fill(void 0),s=new Array(t.length).fill(void 0),c=new Map,l=[],u=new Set;for(let f=0;f<e.length;f+=1){let d=e[f];for(let h of d.objects){if(h.type==="table"&&u.add(h.id),h.type!=="section"||!h.outline||h.outline.length<3)continue;let p=at(h.outline,tt);c.set(h.id,{section:h,unit:d,frontU:1/0,hasSeats:!1,rows:new Map,seatIndices:[]}),l.push({id:h.id,floorIndex:f,box:Pt(p),section:h,unit:d,outline:p})}}let m=new Map;for(let f of l){let d=m.get(f.floorIndex);d?d.push(f):m.set(f.floorIndex,[f])}for(let f=0;f<t.length;f++){let d=t[f],h=n?m.get(n[f])??[]:l,p=d.sectionId?h.find(y=>y.id===d.sectionId)??h.find(y=>y.section.logicalSectionId===d.sectionId&&Ge({x:d.x,y:d.y},y.outline,y.section.holes)):void 0,b=p?[p]:h;for(let y of b){if(n&&y.floorIndex!==n[f]||!p&&(d.x<y.box.minX||d.x>y.box.maxX||d.y<y.box.minY||d.y>y.box.maxY||!Ge({x:d.x,y:d.y},y.outline,y.section.holes)))continue;r[f]=y.id;let M=c.get(y.id);M.hasSeats=!0;let S=d.focalPoint??y.unit.focal,A=Math.hypot(d.x-S.x,d.y-S.y);A<M.frontU&&(M.frontU=A),M.seatIndices.push(f);let x=d.rowId||`__seat-${f}`,g=M.rows.get(x);g?g.push({x:d.x,y:d.y}):M.rows.set(x,[{x:d.x,y:d.y}]);break}}for(let[f,d]of c){let h=Ct(d.section,{floorBaseHeightM:d.unit.baseHeightM}),p=d.unit.baseHeightM,b=h.rake>0?Math.tan(h.rake*Math.PI/180):0,y=h.rake<=.01&&h.height<=p+.001,M=d.section.surfaceKind,S=M==="flat"?!0:M==="rakedRows"&&h.rake>.01?!1:y,A=d.hasSeats?Ko(f,t,d.seatIndices,d.unit.focal):{sectionId:f,rows:[],blockCount:0},g=A.rows.length<2?pl([...d.rows.values()].map(O=>({points:O})),d.unit.focal):null,w=1/0;if(g){if(d.hasSeats)for(let O of d.rows.values())for(let H of O){let j=g.depthAt(H.x,H.y);j<w&&(w=j)}if(!d.hasSeats||!Number.isFinite(w)){w=1/0;for(let O of d.section.outline){let H=g.depthAt(O.x,O.y);H<w&&(w=H)}}}let v=p+Pb,P=Math.max(v,h.height),R=O=>{let H=Math.max(0,O-w)*fe,j=Math.min(H*b,Gi);return Math.max(v,h.height+j)},k=O=>{let H=Math.max(0,O)*fe,j=Math.min(H*b,Gi);return Math.max(v,h.height+j)},F=S?[]:A.rows.map(O=>({pts:O.pts,y:k(O.blockDepth),depth:O.blockDepth,blockId:O.blockId,...u.has(O.id)?{patch:Qc(O.pts,tt)}:{}})),E=F.length?F[0].y:P,I=F.map(O=>{let H=O.patch&&O.patch.length>=3?O.patch:O.pts,j=0,V=0;for(let D of H)j+=D.x,V+=D.y;let T=H.length||1;j/=T,V/=T;let B=0;for(let D of H){let G=Math.hypot(D.x-j,D.y-V);G>B&&(B=G)}return{cx:j,cy:V,rad:B}}),C=S?()=>P:F.length>=2?(O,H)=>{let j=1/0,V=E;for(let T=0;T<F.length;T++){let B=I[T];if(Math.hypot(O-B.cx,H-B.cy)-B.rad>=j)continue;let D=F[T].patch,G=D&&D.length>=3?Ze(D,O,H)?0:pn(D,O,H):pn(F[T].pts,O,H);G<j&&(j=G,V=F[T].y)}return V}:(O,H)=>g?R(g.depthAt(O,H)):P,L=[0,1,0],N=F.length>=2||S?()=>L:(O,H)=>{if(!g)return L;let j=g.depthAt(O,H);if(j<=w)return L;let V=(j-w)*fe;if(V*b>=Gi||h.height+V*b<=v)return L;let[T,B]=g.gradientAt(O,H);if(T===0&&B===0)return L;let D=1/Math.hypot(b,1);return[-T*b*D,D,-B*b*D]};if(!S)for(let O of A.rows){let H=k(O.blockDepth);for(let j of O.seatIndices)a[j]=H}for(let O of A.rows){let H=[];for(let D=1;D<O.pts.length;D++){let G=Math.hypot(O.pts[D].x-O.pts[D-1].x,O.pts[D].y-O.pts[D-1].y);G>1e-6&&H.push(G)}H.sort((D,G)=>D-G);let j=H.length?H[Math.floor(H.length/2)]:1/0,V=1/0,T=O.pts[Math.floor(O.pts.length/2)];if(T)for(let D of A.rows){if(D===O||D.blockId!==O.blockId)continue;let G=pn(D.pts,T.x,T.y);G>1e-6&&G<V&&(V=G)}let B=Math.min(j,Math.max(V,j*.5));if(Number.isFinite(B)&&B>0)for(let D of O.seatIndices)s[D]=B}o.set(f,{sectionId:f,deckAt:C,normalAt:N,flat:S,bottomY:p,rowLevels:F,landingY:E})}for(let f=0;f<t.length;f++){let d=r[f],h=t[f];if(d){let y=a[f];i[f]=(y??o.get(d).deckAt(h.x,h.y))+bl;continue}let p=h.eyeHeightM,b=Number.isFinite(p)?Math.max(0,p-ht):0;i[f]=h.kind==="booth"?b+Ot+bl:b}return{bySection:o,seatOwner:r,seatDeckY:f=>i[f],seatPitchU:f=>s[f]}}function Rn(e,t,n){if(e.length!==4||n<=t)return null;let o=qe(e),r=Math.hypot(o[1].x-o[0].x,o[1].y-o[0].y)*_,i=Math.hypot(o[3].x-o[0].x,o[3].y-o[0].y)*_;if(r<1e-6||i<1e-6)return null;let a=Math.min(.22/r,.16),s=Math.min(.28,(n-t)*.13),c=Math.min(.065/i,.2);return{quad:o,side:a,face:c,opening:Ue(o,a,1-a),openingTop:n-s}}function Hi(e,t,n){if(e.length!==4||n-t<=.2)return null;let o=qe(e),r=Math.hypot(o[1].x-o[0].x,o[1].y-o[0].y)*_;if(r<=1e-6)return null;let i=Math.min(.14,(n-t)*.08,r*.08),a=i/r,s=Ue(o,a,1-a);return{quad:o,side:a,trim:i,inner:s,panel:lo(s,.15,.85),bottom:t+i,top:n-i}}function xl(e,t,n,o){let r=Hi(e,t,n);if(!r)return;let{panel:i}=r,a=(M,S)=>({x:(M.x+S.x)/2,y:(M.y+S.y)/2}),s=a(i[0],i[1]),c=a(i[3],i[2]),l=Math.hypot(s.x-o.x,s.y-o.y)<=Math.hypot(c.x-o.x,c.y-o.y),[u,m]=l?[i[0],i[1]]:[i[3],i[2]],f=l?{x:s.x-c.x,y:s.y-c.y}:{x:c.x-s.x,y:c.y-s.y},d=Math.hypot(f.x,f.y);if(d<1e-6)return;-(m.y-u.y)*f.x+(m.x-u.x)*f.y<0&&([u,m]=[m,u]);let h=Math.min(.006,d*_*.05),p=f.x/d*h,b=f.y/d*h,y=(M,S)=>[M.x*_+p,S,M.y*_+b];return[y(u,r.bottom),y(m,r.bottom),y(u,r.top),y(m,r.top)]}var vl=ft(require("polygon-clipping"),1);var Ml=ft(require("polygon-clipping"),1);function At(e,t,n,o,r,i,a,s={}){let c=Pt(t),l=s.ao??ae,u=r.flatMap(p=>{if(p.role!=="entrance"&&p.role!=="exit")return[];let b=xe(p);if(!b||b.length!==4||!gn(c,Pt(b)))return[];let y=s.portalBase??n,M=Rn(b,y,y+ct(p).heightM);if(!M)return[];let S=Math.min(o,M.openingTop);return S<=n?[]:[{poly:M.opening,height:S}]});if(!u.length)return!1;let m=p=>p.map(b=>[b.x,b.y]),f=[m(t),...(s.holes??[]).map(m)],d=[n,...new Set(u.map(p=>p.height)),o].sort((p,b)=>p-b),h=[];try{for(let p=1;p<d.length;p++){let b=d[p-1],y=d[p];if(y-b<1e-6)continue;let M=u.filter(A=>A.height>b+1e-6).map(A=>[m(A.poly)]),S=M.length?Ml.default.difference(f,...M):[f];h.push({low:b,high:y,polys:S})}}catch{return!1}for(let p of h)for(let b of p.polys){let[y,...M]=b.map(A=>A.map(([x,g])=>({x,y:g}))),S=A=>l.wallBottom+(l.top-l.wallBottom)*(A-n)/(o-n);ue(e,y,M,()=>p.high,p.low,i,a,{...l,top:S(p.high),wallBottom:S(p.low)})}return!0}var zi={depthM:1.6,thicknessM:.35,minWallM:6};function ir(e,t,n,o,r,i,a,s,c){let l=o-n;if(l<=0)return;let u=s&&(c??l)>=zi.minWallM?Ab(t,s):null,m=u?o-zi.thicknessM:o,f=m-n,d=f<1.5?[[n,m,1]]:u?[[n,n+Math.min(.9,f*.18),.82],[n+Math.min(.9,f*.18),m,1]]:[[n,n+Math.min(.9,f*.18),.82],[n+Math.min(.9,f*.18),m-.1,1],[m-.1,m,1.1]],h=p=>ae.wallBottom+(ae.top-ae.wallBottom)*(p-n)/l;for(let[p,b,y]of d){let M={...ae,top:h(b),wallBottom:h(p)},S=le(i,y),A=le(a,y);At(e,t,p,b,r,S,A,{portalBase:n,ao:M})||ue(e,t,void 0,()=>b,p,S,A,M)}for(let[p,...b]of u??[])ue(e,p,b.length?b:void 0,()=>o,m,le(i,1.12),le(a,.78),ae)}function Ab(e,t){let n=zi.depthM/_,o=e.map(a=>{let s=t.x-a.x,c=t.y-a.y,l=Math.hypot(s,c)||1;return{x:a.x+s/l*n,y:a.y+c/l*n}}),r=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s},i=[[r(e)],[r(o)]];for(let a=0;a<e.length;a++){let s=(a+1)%e.length;i.push([r([e[a],e[s],o[s],o[a]])])}try{let[a,...s]=i,c=vl.default.union(a,...s);return c.length?c.map(l=>l.map(u=>u.slice(0,-1).map(([m,f])=>({x:m,y:f})))):null}catch{return null}}function Sl(e){return e.route?.stepFree===!0&&(e.kind==="line"||e.kind==="polyline")}function wl(e){let t=Number.isFinite(e)&&e>0?e:4;return[Math.max(6,t*2.6),Math.max(4,t*1.7)]}function Pl(e,t,n){let o=[];if(e.length<2||!(t>0)||!(n>=0))return o;let r=!0,i=t;for(let a=0;a<e.length-1;a+=1){let s=e[a],c=e[a+1],l=Math.hypot(c.x-s.x,c.y-s.y);if(l<1e-9)continue;let u=(c.x-s.x)/l,m=(c.y-s.y)/l,f=0;for(;f<l-1e-9;){let d=Math.min(i,l-f);r&&o.push([{x:s.x+u*f,y:s.y+m*f},{x:s.x+u*(f+d),y:s.y+m*(f+d)}]),f+=d,i-=d,i<=1e-9&&(r=!r,i=r?t:n)}}return o}function uo(e,t,n){let o=ye(t.stroke?.color),r=t.stroke?.width??0;if(!o||!Number.isFinite(r)||r<=0)return;let i=t.kind==="line"||t.kind==="polyline",a=i?An(t.points??[],t.rotation):xe(t);if(!a||a.length<2)return;let s=r*.5,c=Sl(t)?Pl(a,...wl(r)):Array.from({length:i?a.length-1:a.length},(l,u)=>[a[u],a[(u+1)%a.length]]);for(let[l,u]of c){let m=Math.hypot(u.x-l.x,u.y-l.y);if(m<1e-6)continue;let f=-(u.y-l.y)/m*s,d=(u.x-l.x)/m*s,h=[(l.x+f)*_,n,(l.y+d)*_],p=[(u.x+f)*_,n,(u.y+d)*_],b=[(u.x-f)*_,n,(u.y-d)*_],y=[(l.x-f)*_,n,(l.y-d)*_];e.tri(h,p,b,[0,1,0],o),e.tri(h,b,y,[0,1,0],o)}}function Al(e){return e==="bar"||e==="concession"||e==="coat"||e==="restroom"}var En=(e,t,n)=>({x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n});function ar(e,t,n,o){let[r,i,a,s]=t?e:[e[3],e[2],e[1],e[0]];return[En(r,s,n),En(i,a,n),En(i,a,o),En(r,s,o)]}function Il(e,t,n,o,r,i,a,s,c=!1){if(n.length!==4||r-o<.4)return!1;let l=v=>c?Math.min(v,r):v,u=qe(n),m=Math.hypot(u[3].x-u[0].x,u[3].y-u[0].y)*_;if(m<.4)return!1;let f=En(u[0],u[1],.5),d=En(u[3],u[2],.5),h=Math.hypot(f.x-s.x,f.y-s.y)<=Math.hypot(d.x-s.x,d.y-s.y),p=ge(a,[.92,.9,.86],.35),b=le(i,.72),y=r-o;if(t==="restroom"){let v=Math.min(.18,y*.08);return be(e,u,r-v,o,a,i),be(e,u,r,r-v,p,p),!0}let M=o+Math.min(1.1,y),S=t==="coat"?1:Math.min(.5,.75/m),A=ar(u,h,0,S);if(be(e,A,M-.05,o,b,i),be(e,A,M,M-.05,p,p),t==="coat"||m<1.2)return!0;if(t==="bar"){let v=ar(u,h,Math.max(S+.2,1-.45/m),1),P=l(o+Math.max(Math.min(2.2,y*2),M-o+.6));return be(e,v,P,o,a,b),!0}let x=ar(u,h,Math.max(S+.25,.55),1),g=l(o+Math.max(2.6,M-o+1.4));if(g-.14<=M)return!0;be(e,x,g-.14,o,a,i),be(e,u,g,g-.14,p,b);let w=Math.min(.08,.1/Math.max(.1,Math.hypot(u[1].x-u[0].x,u[1].y-u[0].y)*_));for(let[v,P]of[[0,w],[1-w,1]])be(e,ar(Ue(u,v,P),h,0,Math.min(.08,.1/m)),g-.14,M,b,b);return!0}var Ib=[.12,.38,.16],Rb=[.72,.62,.45],Eb=[.88,.93,.96],Rl=[.95,.95,.94],Cb=[.66,.29,.22],Ui={length:20.12,width:3.05},_b=.14,Tb=9.76,It=[.93,.94,.95],sr=[.1,.11,.13],Lb=[.45,.85,1.25],kb=1.45,El=.012,Cl=.004,Ob=1.07,Fb=.15;function _n(e,t,n,o,r,i){e.setMaterial(i),ue(e,t,n?[n.slice().reverse()]:void 0,()=>o,o-.004,r,r,ae)}var _l=(e,t)=>_t(e,t/_);function Tl(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=Math.hypot(o,r);if(i<1e-9)return null;let a=-r/i*n,s=o/i*n;return[{x:e.x+a,y:e.y+s},{x:t.x+a,y:t.y+s},{x:t.x-a,y:t.y-s},{x:e.x-a,y:e.y-s}]}function Db(e,t,n,o){let r=t.map(i=>[i.x*_,n,i.y*_]);e.tri(r[0],r[1],r[2],[0,1,0],o),e.tri(r[0],r[2],r[3],[0,1,0],o)}function cr(e,t,n,o,r,i){let a=n/_,s=[{x:t.x-a,y:t.y-a},{x:t.x+a,y:t.y-a},{x:t.x+a,y:t.y+a},{x:t.x-a,y:t.y+a}];ue(e,s,void 0,()=>r,o,i,le(i,.85),ae)}function Cn(e,t,n,o,r,i,a){let s=Tl(t,n,o/_);s&&ue(e,s,void 0,()=>i,r,a,le(a,.85),ae)}function lr(e){let t=qe(e),n={x:(t[0].x+t[2].x)/2,y:(t[0].y+t[2].y)/2},o=Math.hypot(t[1].x-t[0].x,t[1].y-t[0].y)||1,r=Math.hypot(t[3].x-t[0].x,t[3].y-t[0].y)||1,i={x:(t[1].x-t[0].x)/o,y:(t[1].y-t[0].y)/o},a={x:(t[3].x-t[0].x)/r,y:(t[3].y-t[0].y)/r};return{at:(c,l)=>({x:n.x+(i.x*c+a.x*l)/_,y:n.y+(i.y*c+a.y*l)/_}),lengthM:o*_,widthM:r*_}}function Ll(e,t,n){let o=Zs(t);if(!o.length)return;let r=1/0,i=-1/0,a=1/0,s=-1/0;for(let S of t.points??[])r=Math.min(r,S.x),i=Math.max(i,S.x),a=Math.min(a,S.y),s=Math.max(s,S.y);let c=(t.rotation??0)*Math.PI/180,l=Math.cos(c),u=Math.sin(c),m=(r+i)/2,f=(a+s)/2,d=S=>c?{x:m+(S.x-m)*l-(S.y-f)*u,y:f+(S.x-m)*u+(S.y-f)*l}:S,h=Math.min(i-r,s-a)*_,p=Math.max(.04,Math.min(.3,h*.004))/_,b=0;e.setMaterial(0);for(let S of o){if(!S.fill)continue;let A=S.points.map(d);_n(e,A,null,n+El+b*Cl,ye(S.fill)??It,0),b++}let y=o.filter(S=>!(S.fill&&S.ink===S.fill)),M=[...new Set(y.map(S=>S.ink??Wo))];for(let S of M){let A=n+El+b++*Cl,x=ye(S)??It;for(let g of y){if((g.ink??Wo)!==S)continue;let w=g.points.map(d),v=g.closed?w.length:w.length-1;for(let P=0;P<v;P++){let R=Tl(w[P],w[(P+1)%w.length],p);R&&Db(e,R,A,x)}}}}function kl(e,t,n,o,r){if(t.length<3)return!1;let i=o+.006,a=r??Ib;if(n==="oval-cricket"){let s=t.reduce((x,g)=>x+g.x,0)/t.length,c=t.reduce((x,g)=>x+g.y,0)/t.length,l=x=>t.map(g=>({x:s+(g.x-s)*x,y:c+(g.y-c)*x})),u=8;for(let x=0;x<u;x++){let g=l(1-x/u),w=x===u-1?null:l(1-(x+1)/u);_n(e,g,w,i,le(a,x%2?1.04:.96),4)}let m=t[0];for(let x of t)Math.hypot(x.x-s,x.y-c)>Math.hypot(m.x-s,m.y-c)&&(m=x);let f=Math.hypot(m.x-s,m.y-c)||1,d=(m.x-s)/f,h=(m.y-c)/f,p=-h,b=d,y=Math.min(1,2*f*_*_b/Ui.length),M=Ui.length*y/2/_,S=Ui.width*y/2/_,A=[[-M,-S],[M,-S],[M,S],[-M,S]].map(([x,g])=>({x:s+d*x+p*g,y:c+h*x+b*g}));return _n(e,A,null,i+.004,Rb,0),e.setMaterial(0),!0}if(n==="rink-hockey"){let s=_l(t,Fb);return _n(e,s,null,i,Eb,0),e.setMaterial(0),ue(e,t,[s.slice().reverse()],()=>o+Ob,o,Rl,le(Rl,.9),ae),!0}if(n==="ring-boxing"&&t.length===4){let{at:s}=lr(t),c=[s(-3.05,-3.05),s(3.05,-3.05),s(3.05,3.05),s(-3.05,3.05)],l=[[.77,.19,.19],It,[.17,.42,.69],It];e.setMaterial(0),c.forEach((u,m)=>cr(e,u,.07,o,o+kb,l[m]));for(let u of Lb)for(let m=0;m<4;m++)Cn(e,c[m],c[(m+1)%4],.025,o+u-.025,o+u+.025,It);return!0}if(n==="court-tennis"&&t.length===4){let{at:s}=lr(t);e.setMaterial(0),Cn(e,s(0,-6.4),s(0,6.4),.015,o,o+.95,sr),Cn(e,s(0,-6.4),s(0,6.4),.03,o+.95,o+1,It);for(let c of[-1,1])cr(e,s(0,c*6.4),.05,o,o+1.07,sr);return!0}if(n==="court-basketball"&&t.length===4){let{at:s,lengthM:c}=lr(t),l=Math.min(14,c/2-.5);e.setMaterial(0);for(let u of[-1,1]){let m=s(u*(l+1.2),0),f=s(u*(l-1.2),0);cr(e,m,.12,o,o+3.4,sr),Cn(e,m,f,.06,o+3.25,o+3.4,sr),Cn(e,s(u*(l-1.2),-.9),s(u*(l-1.2),.9),.03,o+2.9,o+3.95,It)}return!0}if(n==="pitch-rugby"&&t.length===4){let{at:s,lengthM:c}=lr(t),l=c*(50/120);e.setMaterial(0);for(let u of[-1,1]){for(let m of[-2.8,2.8])cr(e,s(u*l,m),.07,o,o+12,It);Cn(e,s(u*l,-2.8),s(u*l,2.8),.06,o+2.94,o+3.06,It)}return!0}if(n==="track-athletics"){let s=_l(t,Tb);return s.length<3?!1:(_n(e,t,s,i,Cb,0),_n(e,s,null,i,a,4),e.setMaterial(0),!0)}return!1}var Ol=[.19,.4,.15],Nb=.012,dr=2.4,Bb=1,Vb=.75,Gb=.15;function lt(e){if(e.points&&e.points.length>=3)return e.points;let{center:t,width:n,height:o,rotation:r}=e;if(!n||!o)return null;let i=(r??0)*Math.PI/180,a=Math.cos(i),s=Math.sin(i),c=n/2,l=o/2;return[[-c,-l],[c,-l],[c,l],[-c,l]].map(([u,m])=>({x:t.x+u*a-m*s,y:t.y+u*s+m*a}))}function Hl(e,t,n,o,r,i,a=!1){let s=lt(t);if(s){if(a){let c=Jt(o,r.boothTop),l=pt([...s]);ue(e,at(l,Hb/_),[l.slice().reverse()],()=>n+.03,n,c,le(c,.8),ae);return}if(!(!t.points&&i&&Ub(e,s,n,o,i))){if(!t.points&&i&&s.length===4){zb(e,s,n,o,i);return}ue(e,s,void 0,()=>n+dr,n,Jt(o,r.boothTop),r.boothWall,ae)}}}var ji=1.1,Fl=[.9,.9,.88],Hb=.1,ur=[.87,.87,.85],Dl=.08;function zl(e,t){let n=c=>({x:(e[c].x+e[(c+1)%4].x)/2,y:(e[c].y+e[(c+1)%4].y)/2}),o=0,r=1/0;for(let c=0;c<4;c++){let l=n(c),u=Math.hypot(l.x-t.x,l.y-t.y);u<r&&(r=u,o=c)}let i=[0,1,2,3].map(c=>e[(o+c)%4]),a=(c,l,u)=>({x:c.x+(l.x-c.x)*u,y:c.y+(l.y-c.y)*u});return{q:i,part:(c,l,u,m)=>{let f=a(i[0],i[1],c),d=a(i[0],i[1],l),h=a(i[3],i[2],c),p=a(i[3],i[2],l);return[a(f,h,u),a(d,p,u),a(d,p,m),a(f,h,m)]},depthM:Math.hypot(i[3].x-i[0].x,i[3].y-i[0].y)*_,widthM:Math.hypot(i[1].x-i[0].x,i[1].y-i[0].y)*_}}function zb(e,t,n,o,r){let{q:i,part:a}=zl(t,r),s=o??[.35,.42,.55],c=ge(s,[.78,.78,.77],.62),l=ge(s,[.95,.95,.94],.45);be(e,i,n+Ot,n,c,le(c,.8)),be(e,a(.05,.95,.72,.98),n+ji-.05,n+Ot,l,le(l,.8)),be(e,a(.03,.97,.7,1),n+ji,n+ji-.05,Fl,le(Fl,.9))}function Ub(e,t,n,o,r){if(t.length!==4)return!1;let{q:i,part:a,depthM:s,widthM:c}=zl(t,r);if(s<1||c<1)return!1;let l=o??[.35,.42,.55],u=ge(l,[.78,.78,.77],.62),m=n+dr,f=Dl/c,d=Dl/s;be(e,i,n+Ot,n,u,le(u,.8)),be(e,a(0,1,1-d,1),m,n+Ot,ur,le(ur,.9));for(let[b,y]of[[0,f],[1-f,1]])be(e,a(b,y,0,1-d),m,n+Ot,ur,le(ur,.9));be(e,a(f,1-f,0,Math.min(.5,.06/s)),m,m-.3,l,le(l,.85));let h=Math.min(.4,.6/c),p=Math.min(.12,.3/s);return be(e,a(.5-h,.5+h,.72-p,.72+p),n+Bb,n+Ot,ge(l,[.95,.95,.94],.7),le(l,.75)),!0}function hr(e){if(e.shape==="round"){let u=e.radius;return u?Uo(e.center.x,e.center.y,u,u,24):null}let{width:t,height:n,rotation:o,center:r}=e;if(!t||!n)return null;let i=(o??0)*Math.PI/180,a=Math.cos(i),s=Math.sin(i),c=t/2,l=n/2;return[[-c,-l],[c,-l],[c,l],[-c,l]].map(([u,m])=>({x:r.x+u*a-m*s,y:r.y+u*s+m*a}))}function Ul(e,t,n,o,r,i=!0){let a=hr(t);if(!a)return;let s=a.reduce((f,d)=>f+d.x,0)/a.length,c=a.reduce((f,d)=>f+d.y,0)/a.length,l=f=>a.map(d=>({x:s+(d.x-s)*f,y:c+(d.y-c)*f})),u=i&&o?Jt(o,r.tableTop):jb,m=n+Vb;ue(e,a,void 0,()=>m,n+Wb,u,le(u,.86),ae),ue(e,l(.12),void 0,()=>m+.12,m,Nl,le(Nl,.8),ae)}var jb=[.93,.92,.89],Nl=[.78,.66,.42],Wb=.25,mo={armM:1.1,widthM:.28,insideM:1.4,low:.043,high:.048};function Xb(e,t,n){let o=e.reduce((y,M)=>y+M.x,0)/4,r=e.reduce((y,M)=>y+M.y,0)/4,i=e[3].x-e[0].x,a=e[3].y-e[0].y,s=Math.hypot(i,a)||1;i/=s,a/=s,i*(t.x-o)+a*(t.y-r)<0&&(i=-i,a=-a);let c=-a,l=i,u=mo.armM/_,m=mo.widthM/_,f=s/2+mo.insideM/_,d=n?-1:1,h=o+i*(f+(n?0:u)),p=r+a*(f+(n?0:u)),b=(y,M)=>({x:h+i*y*d+c*M,y:p+a*y*d+l*M});return[b(0,0),b(-u,u),b(-u-m,u),b(-m,0),b(-u-m,-u),b(-u,-u)]}function Yb(e,t,n,o,r){let i=[.94,.95,.96];ue(e,Xb(t,o,r),void 0,()=>n+mo.high,n+mo.low,i,i,ae)}function fr(e,t){let n=ye(e);return n?{top:le(dt(n,.12),.95),wall:le(dt(n,.12),.85)}:{top:t.tierTop,wall:t.tierWall}}function jl(e,t,n,o,r,i,a,s,c=[]){let l=xe(t),u=ul(t);if(!t.role&&(!t.fill||t.fill==="none"||t.fill==="transparent")||!l){uo(e,t,n+o+Nb);return}let f=s?s.kind==="stage":t.role==="stage",d=s?s.kind==="screen":t.role==="screen",h=s?{kind:f?"stage":"solid",heightM:s.topY-s.baseY}:ct(t),p=s?.baseY??n,b=s?.topY??n+o;if(f&&a){let F=1/0,E=-1/0,I=1/0,C=-1/0;for(let L of l)L.x<F&&(F=L.x),L.x>E&&(E=L.x),L.y<I&&(I=L.y),L.y>C&&(C=L.y);a.push({cx:(F+E)/2*_,cz:(I+C)/2*_,y:b,halfX:Math.max((E-F)/2*_,.5),halfZ:Math.max((C-I)/2*_,.5)})}let y=ye(t.fill),M=t.role==="wall"||t.role==="entrance"||t.role==="exit",S=M?fr(t.fill,r).top:f&&y?ge(r.stageTop,le(dt(y,.18),.9),.9):!t.role&&y?y:Jt(y,f?r.stageTop:r.decorTop),A=d?y:null,x=M?fr(t.fill,r).wall:f?y?ge(r.stageWall,le(y,.58),.82):r.stageWall:d?A?ge(le(A,1.42),[.24,.46,.82],.08):[.24,.46,.82]:Jt(ye(t.fill),r.decorWall),g=f&&an(r)?Xt(!0):null,w=g?Gl(S,g.stageTop):S,v=g?Gl(x,g.stageWall):x;if(t.role==="wall"&&!s){ir(e,l,p,b,c,w,v,i),uo(e,t,b+.012);return}if(d&&l.length===4&&b-p>.2){let F=Hi(l,p,b);if(!F)return;let{quad:E,side:I,trim:C,inner:L,panel:N}=F,O=[.12,.15,.18];for(let[H,j]of[[0,I],[1-I,1]])be(e,Ue(E,H,j),b,p,O,O);be(e,L,p+C,p,O,O),be(e,L,b,b-C,O,O),be(e,N,b-C,p+C,v,v),uo(e,t,b+.012);return}let P=y?le(dt(y,.15),.82):v,R=y?le(dt(y,.1),1.02):w;if(Al(t.role)&&!s&&Il(e,t.role,l,p,b,P,R,i,t.heightM!==void 0))return;if((t.role==="sound"||s?.kind==="sound_desk")&&l.length===4&&b-p>.3){let F=qe(l),E=Math.hypot(F[1].x-F[0].x,F[1].y-F[0].y)*_,I=Math.min(.12,.09/Math.max(E,.001)),C=[.18,.21,.24],L=b-Math.min(.12,(b-p)*.15);for(let[N,O]of[[0,I],[1-I,1]])be(e,Ue(F,N,O),L,p,C,C);be(e,F,b,L,w,C);return}if(t.role==="rail"&&l.length===4&&b>p){let F=qe(l),E=Math.hypot(F[1].x-F[0].x,F[1].y-F[0].y)*_,I=Math.max(1,Math.min(128,Math.ceil(E/1.4))),C=Math.min(.08,.055/Math.max(.055,E)),L=[.58,.64,.66];for(let N=0;N<=I;N++){let O=N/I,H=Math.min(1-C,Math.max(0,O-C/2));be(e,Ue(F,H,H+C),b,p,L,le(L,.8))}for(let N of[.52,1]){let O=p+(b-p)*N;be(e,F,O,Math.max(p,O-.055),L,le(L,.8))}return}if(t.role==="goal"&&l.length===4){let F=qe(l),E=Math.hypot(F[1].x-F[0].x,F[1].y-F[0].y)*_,I=Math.min(.12,.1/Math.max(.1,E)),C=[.9,.94,.94];for(let[L,N]of[[0,I],[1-I,1]])be(e,Ue(F,L,N),Math.max(p,b-.1),p,C,C);be(e,F,b,Math.max(p,b-.1),C,C);return}if(h.kind==="portal"&&l.length===4){let F=Rn(l,p,b);if(!F)return;let{quad:E,side:I,face:C,openingTop:L}=F;for(let[N,O,H]of[[0,C,1],[C,1-C,.67],[1-C,1,1]]){let j=lo(E,N,O),V=le(w,H),T=le(v,H);for(let[B,D]of[[0,I],[1-I,1]])be(e,Ue(j,B,D),L,p,V,T);be(e,j,b,L,V,T)}(t.role==="entrance"||t.role==="exit")&&Yb(e,E,p,i,t.role==="exit");return}if(h.kind==="suite"&&l.length===4){let F=l.map((C,L)=>{let N=l[(L+1)%4],O=(C.x+N.x)/2,H=(C.y+N.y)/2;return Math.hypot(O-i.x,H-i.y)}),E=F.indexOf(Math.min(...F)),I=[0,1,2,3].map(C=>l[(E+C)%4]);be(e,Ue(I,0,.08),b,p,w,v),be(e,Ue(I,.92,1),b,p,w,v),be(e,lo(I,.88,1),b,p,w,v),be(e,I,b,Math.max(p,b-.18),w,v);return}if(f&&!t.stageKind?.startsWith("pitch-")&&b-p>.12){let F=b-Math.min(.06,(b-p)*.15);be(e,l,F,p,w,v,u),be(e,l,b,F,w,ge(w,v,.2),u)}else be(e,l,b,p,w,v,u);if((t.stageKind==="pitch-football"||t.stageKind==="pitch-rugby")&&l.length===4){e.setMaterial(4);let F=qe(l),E=ge(y??Ol,Ol,y?.45:0);for(let I=0;I<12;I++){let C=Ue(F,I/12,(I+1)/12),L=le(E,I%2?1.09:.91),N=C.map(O=>[O.x*_,b+.006,O.y*_]);e.tri(N[0],N[1],N[2],[0,1,0],L),e.tri(N[0],N[2],N[3],[0,1,0],L)}}t.stageKind&&t.stageKind!=="pitch-football"&&kl(e,l,t.stageKind,b,y),f&&Zt(t.stageKind)&&Ll(e,t,b),e.setMaterial(d?1:0),uo(e,t,b+.012)}function pr(e){let{x:t,y:n,width:o,height:r}=e;if(!o||!r)return null;let i=t+o/2,a=n+r/2,s=(e.rotation??0)*Math.PI/180,c=Math.cos(s),l=Math.sin(s),u=o/2,m=r/2;return[[-u,-m],[u,-m],[u,m],[-u,m]].map(([f,d])=>({x:i+f*c-d*l,y:a+f*l+d*c}))}function Kb(e){if(!e||!e.startsWith("data:image/svg+xml"))return null;let t=e.slice(e.indexOf(",")+1);if(/;base64/i.test(e.slice(0,e.indexOf(","))))try{t=atob(t)}catch{return null}else try{t=decodeURIComponent(t)}catch{}let n=t.match(/<(?:rect|path)\b[^>]*\bfill="([^"]+)"/i);if(!n)return null;let o=n[1].trim();if(o==="none"||o==="transparent")return null;let r=o.match(/^url\(#([^)]+)\)$/);if(!r)return ye(o);let i=t.match(new RegExp(`<(?:linear|radial)Gradient\\b[^>]*\\bid="${r[1]}"[^>]*>([\\s\\S]*?)</(?:linear|radial)Gradient>`,"i"));if(!i)return null;let a=[];for(let s of i[1].matchAll(/stop-color="([^"]+)"/gi)){let c=ye(s[1].trim());c&&a.push(c)}return a.length?a.reduce((s,c,l)=>ge(s,c,1/(l+1)),a[0]):null}function Wl(e,t,n,o){if(t.layer==="foreground")return;let r=pr(t);if(!r)return;let i=n+Gb,a=Jt(Kb(t.href),o.decorTop),s=Math.max(0,Math.min(1,t.opacity??1));s<1&&(a=ge(o.ground,a,s)),ue(e,r,void 0,()=>i,n,a,ge(a,o.decorWall,.5),ae)}function Xl(e,t,n,o,r){if(!t.points||t.points.length<3)return;let i=jc(o,r.gaTop);ue(e,t.points,t.holes,()=>n+Bl,n,i,r.gaWall,ae),qb(e,t.points,n+Bl)}var Bl=.15,mr=[.72,.74,.76],Wi=1.1,Vl=.12,Xi=.05,$b=.06,Zb=2.4;function qb(e,t,n){let o=pt([...t]),r=_t(o,Vl/_),i=_t(o,(Vl+Xi)/_);if(r.length<3||i.length<3)return;for(let s of[n+Wi,n+Wi*.5])ue(e,r,[i.slice().reverse()],()=>s,s-Xi,mr,le(mr,.85),ae);let a=$b/2/_;for(let s=0;s<r.length;s++){let c=r[s],l=r[(s+1)%r.length],u=Math.hypot(l.x-c.x,l.y-c.y)*_,m=Math.max(1,Math.round(u/Zb));for(let f=0;f<m;f++){let d=f/m,h=c.x+(l.x-c.x)*d,p=c.y+(l.y-c.y)*d,b=[{x:h-a,y:p-a},{x:h+a,y:p-a},{x:h+a,y:p+a},{x:h-a,y:p+a}];ue(e,b,void 0,()=>n+Wi-Xi,n,mr,le(mr,.8),ae)}}}function Gl(e,t){return Lo(e)<t?Wt(e,t):e}var Yi=.6,Yl=3,Qb=.25;function Jb(e,t){if(Ze(t,e.x,e.y))return 0;let n=1/0;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[r],a=t[o],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c||1,u=Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/l));n=Math.min(n,Math.hypot(e.x-(i.x+u*s),e.y-(i.y+u*c)))}return n}function Kl(e,t){let n=e.map(a=>({booth:a,ring:lt(a)})).filter(a=>!!a.ring&&a.ring.length===4&&!a.booth.points),o=n.map(({ring:a})=>({minX:Math.min(...a.map(s=>s.x)),maxX:Math.max(...a.map(s=>s.x)),minY:Math.min(...a.map(s=>s.y)),maxY:Math.max(...a.map(s=>s.y))})),r=(Yl+Yi)/_,i=new Map;return n.forEach(({booth:a,ring:s},c)=>{let l={x:s.reduce((d,h)=>d+h.x,0)/4,y:s.reduce((d,h)=>d+h.y,0)/4},u=[0,1,2,3].map(d=>{let h=s[d],p=s[(d+1)%4],b={x:(h.x+p.x)/2,y:(h.y+p.y)/2},y=b.x-l.x,M=b.y-l.y,S=Math.hypot(y,M)||1,A={x:b.x+y/S*Yi/_,y:b.y+M/S*Yi/_},x=Yl/_;return o.forEach((g,w)=>{w===c||A.x<g.minX-r||A.x>g.maxX+r||A.y<g.minY-r||A.y>g.maxY+r||(x=Math.min(x,Jb(A,n[w].ring)))}),{open:x*_,toward:{x:b.x+y/S*10/_,y:b.y+M/S*10/_},focal:Math.hypot(b.x-t.x,b.y-t.y)}}),m=Math.max(...u.map(d=>d.open)),f=u.filter(d=>d.open>=m-Qb).sort((d,h)=>d.focal-h.focal)[0];i.set(a.id,f.toward)}),i}var $l=ft(require("polygon-clipping"),1);var e0=.45,t0=1500,n0=200;function Zl(e,t){if(e.role!=="stage"||Zt(e.stageKind))return e;let n=xe(e);if(!n||n.length<3||Math.abs($e(n))*_*_>t0)return e;let o=t.filter(a=>Ze(n,a.x,a.y));if(!o.length||o.length>n0)return e;let r=e0/_,i=o.map(a=>[[[a.x-r,a.y-r],[a.x+r,a.y-r],[a.x+r,a.y+r],[a.x-r,a.y+r],[a.x-r,a.y-r]]]);try{let a=$l.default.difference([[...n.map(l=>[l.x,l.y]),[n[0].x,n[0].y]]],...i),s=null,c=0;for(let l of a){let u=l[0].slice(0,-1).map(([f,d])=>({x:f,y:d})),m=Math.abs($e(u));m>c&&(c=m,s=u)}return!s||s.length<3?e:{...e,kind:"polygon",points:s,rotation:0}}catch{return e}}var o0=Math.PI/180,Ae=96,r0=6,i0=60,a0=150,ql=.2,s0=.35;function c0(e,t){let n=Math.atan2(t.x-e.x,t.y-e.y)/o0;return n<0?n+360:n}function br(e){if(!e.length)return NaN;let t=[...e].sort((n,o)=>n-o);return t[Math.floor(t.length/2)]}function yr(e,t,n=2){let o=e.length,r=new Float64Array(o);for(let i=0;i<o;i++){let a=0,s=0;for(let c=-n;c<=n;c++){let l=i+c;if(t)l=(l%o+o)%o;else if(l<0||l>=o)continue;a+=e[l],s++}r[i]=a/s}return r}function Ql(e,t){let n=e.filter(f=>f.rows.length>=1);if(n.length<1)return null;let o=[],r=0,i=0,a=0;for(let f of n)for(let d of f.rows){for(let h of d.pts)r+=h.x,i+=h.y,a++;if(d.pts.length>=4){let h=Ii(d.pts);h&&Number.isFinite(h.cx)&&Number.isFinite(h.cy)&&o.push({x:h.cx,y:h.cy})}}if(!a)return null;let s={x:r/a,y:i/a},c=s;if(o.length>=8){let f=br(o.map(y=>y.x)),d=br(o.map(y=>y.y)),h=0;for(let y of n)for(let M of y.rows)for(let S of M.pts){let A=Math.hypot(S.x-s.x,S.y-s.y);A>h&&(h=A)}let p=0,b=h*.2;for(let y of n)for(let M of y.rows)for(let S of M.pts)Math.hypot(S.x-f,S.y-d)<b&&p++;Math.hypot(f-s.x,d-s.y)<=h&&p/a<.01&&(c={x:f,y:d})}let l=[];for(let f of n){let d={sectionId:f.sectionId,rMin:1/0,rMax:-1/0,samples:[]};for(let h of f.rows)for(let p of h.pts){let b=Math.hypot(p.x-c.x,p.y-c.y),y=Math.min(Ae-1,Math.floor(c0(c,p)/(360/Ae)));d.samples.push({r:b,bin:y,levelM:h.levelM}),b<d.rMin&&(d.rMin=b),b>d.rMax&&(d.rMax=b)}d.samples.length&&l.push(d)}if(!l.length)return null;l.sort((f,d)=>f.rMin+f.rMax-(d.rMin+d.rMax));let u=[];for(let f of l){let d=!1;for(let h of u){let p=Math.min(f.rMax,h.rMax)-Math.max(f.rMin,h.rMin),b=Math.min(f.rMax-f.rMin,h.rMax-h.rMin);if(b>1e-9&&p>=s0*b){h.members.push(f),h.rMin=Math.min(h.rMin,f.rMin),h.rMax=Math.max(h.rMax,f.rMax),d=!0;break}}d||u.push({members:[f],rMin:f.rMin,rMax:f.rMax})}let m=[];for(let f of u){let d=new Array(Ae).fill(null);for(let E of f.members)for(let I of E.samples){let C=d[I.bin];C||(C={samples:[]},d[I.bin]=C),C.samples.push({r:I.r,levelM:I.levelM})}let h=d.map(E=>!!E);if(!h.filter(Boolean).length)continue;let b=[],y=[];for(let E of d){if(!E)continue;let I=1/0,C=-1/0;for(let L of E.samples)L.r<I&&(I=L.r),L.r>C&&(C=L.r);b.push(I),y.push(C)}let M=br(b),S=br(y);if(!(M>=ql*S)||!(S>0))continue;let A=[...b].sort((E,I)=>E-I);if(!(A[Math.floor(A.length*.1)]>=ql*S))continue;let g=d.map(E=>{if(!E)return null;let I=[...E.samples].sort((T,B)=>T.r-B.r),C=I[0].r,L=I[I.length-1].r,N=I[0].levelM,O=-1/0;for(let T of I)T.levelM>O&&(O=T.levelM);let H=[];for(let T of I){let B={r:T.r,l:T.levelM};for(;H.length&&Math.abs(H[H.length-1].r-B.r)<1e-9;){if(H[H.length-1].l<=B.l){B.skip=!0;break}H.pop()}if(!B.skip){for(;H.length>=2;){let D=H[H.length-2],G=H[H.length-1];if((G.r-D.r)*(B.l-D.l)-(G.l-D.l)*(B.r-D.r)<=0)H.pop();else break}H.push(B)}}let j=H.map(T=>T.r),V=H.map(T=>T.l);return{inner:C,outer:L,front:N,top:O,profile:{rs:j,ls:V}}}),w=h.slice();for(let E=0;E<Ae;E++){if(w[E])continue;let I=-1,C=-1,L=0;for(let U=1;U<=Ae;U++){let q=(E-U+Ae*2)%Ae;if(w[q]){I=q;break}}for(let U=1;U<=Ae;U++){let q=(E+U)%Ae;if(w[q]){C=q,L=U;break}}if(I<0||C<0)continue;let N=0;for(let U=1;U<=Ae;U++){let q=(E-U+Ae*2)%Ae;if(h[q]){N=U;break}}if(N-1+L>r0)continue;let H=g[I],j=g[C],V=N/(N+L),T=H.inner+(j.inner-H.inner)*V,B=H.outer+(j.outer-H.outer)*V,D=H.front+(j.front-H.front)*V,G=H.top+(j.top-H.top)*V;g[E]={inner:T,outer:B,front:D,top:G,profile:{rs:[T,B],ls:[D,G]}}}for(let E=0;E<Ae;E++)g[E]&&(w[E]=!0);let v=360/Ae,P=[],R=w.filter(Boolean).length,k=[];if(R===Ae)k.push({start:0,len:Ae});else{let E=0;for(;w[E];)E=(E+1)%Ae;let I=-1;for(let C=0;C<=Ae;C++){let L=(E+C)%Ae,N=C<Ae&&w[L];if(N&&I<0)I=L;else if(!N&&I>=0){let O=(L-I+Ae)%Ae||Ae;k.push({start:I,len:O}),I=-1}}}for(let E of k){if(E.len*v<i0&&E.len<Ae)continue;let I=E.len===Ae,C=new Float64Array(E.len),L=new Float64Array(E.len),N=new Float64Array(E.len),O=new Float64Array(E.len),H=[];for(let U=0;U<E.len;U++){let q=g[(E.start+U)%Ae];C[U]=q.inner,L[U]=q.outer,N[U]=q.front,O[U]=q.top,H.push(q.profile??{rs:[q.inner,q.outer],ls:[q.front,q.top]})}let j=yr(C,I),V=yr(L,I),T=yr(N,I),B=yr(O,I);for(let U=0;U<E.len;U++)j[U]>C[U]&&(j[U]=C[U]),V[U]<L[U]&&(V[U]=L[U]),j[U]>V[U]-1e-6&&(j[U]=Math.max(0,V[U]-1e-6)),B[U]<T[U]&&(B[U]=T[U]);let D={startBin:E.start,binCount:E.len,closed:I,innerR:j,outerR:V,frontLevelM:T,topLevelM:B,profiles:H},G=(U,q,$)=>{let te=H[U],Q=te.rs,X=te.ls;if(q<=Q[0]){X[0]>$&&(X[0]=$);return}if(q>=Q[Q.length-1]){X[X.length-1]>$&&(X[X.length-1]=$);return}for(let Y=0;Y+1<Q.length;Y++)if(q<=Q[Y+1]){X[Y]>$&&(X[Y]=$),X[Y+1]>$&&(X[Y+1]=$);return}};for(let U=0;U<E.len;U++){let q=d[(E.start+U)%Ae];if(q)for(let $ of q.samples){G(U,$.r,$.levelM);let te=I?(U-1+E.len)%E.len:U-1,Q=I?(U+1)%E.len:U+1;te>=0&&G(te,$.r,$.levelM),Q<E.len&&G(Q,$.r,$.levelM)}}P.push(D)}P.reduce((E,I)=>E+I.binCount*v,0)<a0||m.push({arcs:P,sectionIds:f.members.map(E=>E.sectionId),innerRMedian:M,outerRMedian:S})}if(!m.length)return null;if(m.sort((f,d)=>f.innerRMedian-d.innerRMedian),t){let f=m[m.length-1].outerRMedian;if(Math.hypot(t.x-c.x,t.y-c.y)>.9*f)return null}return{centre:c,binCount:Ae,binStepDeg:360/Ae,rings:m}}function Jl(e,t,n,o){let r=e.binStepDeg,i=n/r-.5-t.startBin;i=(i%e.binCount+e.binCount)%e.binCount,i>t.binCount-1&&(t.closed?i=i-t.binCount<t.binCount-i?0:t.binCount-1:i=i-(t.binCount-1)<e.binCount-i?t.binCount-1:0);let a=Math.floor(i),s=t.closed?(a+1)%t.binCount:Math.min(t.binCount-1,a+1),c=i-a,l=u=>{let m=t.profiles[u],f=m.rs,d=m.ls;if(o<=f[0])return d[0];if(o>=f[f.length-1])return d[d.length-1];for(let h=0;h+1<f.length;h++)if(o<=f[h+1]){let p=f[h+1]-f[h],b=p>1e-9?(o-f[h])/p:0;return d[h]+(d[h+1]-d[h])*b}return d[d.length-1]};return l(a)*(1-c)+l(s)*c}function Ki(e,t,n,o,r,i,a,s,c,l=[],u=r){if(t.length!==n.length||t.length<2||i-r<1.5)return;let m=(p,b,y)=>{At(e,p,b,y,l,a,s,{portalBase:u,ao:c})||ue(e,p,void 0,()=>y,b,a,s,c)},f=(p,b,y)=>({x:p.x+(b.x-p.x)*y,y:p.y+(b.y-p.y)*y}),d=o?t.length:t.length-1,h=0;for(let p=0;p<d;p++){let b=(p+1)%t.length,y=Math.hypot(n[b].x-n[p].x,n[b].y-n[p].y)*fe;if(y<1e-5)continue;let M=(g,w)=>[f(t[p],t[b],g),f(t[p],t[b],w),f(n[p],n[b],w),f(n[p],n[b],g)];m(M(0,1),r,r+.95),m(M(0,1),i-.22,i);let S=Math.ceil((h-.32)/6)*6,A=!1,x=!1;for(let g=S;g<h+y;g+=6){let w=Math.max(0,(g-h)/y),v=Math.min(1,(g+.32-h)/y);v<=w||(m(M(w,v),r+.95,i-.22),A||=w<1e-6,x||=v>1-1e-6)}if(!o&&(p===0&&!A||p===d-1&&!x)){let g=Math.min(1,.32/y);m(M(p===0?0:1-g,p===0?g:1),r+.95,i-.22)}h+=y}}var Ft=ft(require("polygon-clipping"),1),ho=.65;function $i(e,t){let n=1/0;for(let o of t)for(let r=0;r<o.length;r++){let i=o[r],a=o[(r+1)%o.length],s=a.x-i.x,c=a.y-i.y,l=Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/(s*s+c*c||1)));n=Math.min(n,Math.hypot(e.x-i.x-l*s,e.y-i.y-l*c))}return n}var Zi=.01;function eu(e,t,n,o,r,i,a,s=[],c=!0,l={bays:[],walls:[]}){if(o-r<=1e-5)return;let u=o-r>=3,m=u?o-ho:r;e.setMaterial(5);let f=u?[]:s.filter(g=>{if(g.role!=="entrance"&&g.role!=="exit")return!1;let w=xe(g);if(!w)return!1;let v=Rn(w,r,r+ct(g).heightM);return v!==null&&v.openingTop<=o-.12});if((!f.length||!At(e,t,m,o,f,i,a,{holes:n,portalBase:r}))&&ue(e,t,n,()=>o,m,i,a,ae,void 0,()=>[0,1,0]),!u){e.setMaterial(0);return}let d=c&&l.bays.length?l0(t,n,_t(t,fo/_),l):null,h=6/_,p=.22/_,b=s.flatMap(g=>{if(g.role!=="entrance"&&g.role!=="exit")return[];let w=xe(g);return w?.length?[{minX:Math.min(...w.map(v=>v.x)),maxX:Math.max(...w.map(v=>v.x)),minY:Math.min(...w.map(v=>v.y)),maxY:Math.max(...w.map(v=>v.y))}]:[]}),y=Math.min(...t.map(g=>g.x)),M=Math.max(...t.map(g=>g.x)),S=Math.min(...t.map(g=>g.y)),A=Math.max(...t.map(g=>g.y));for(let g=y+h/2;g<M;g+=h)for(let w=S+h/2;w<A;w+=h){if(b.some(P=>g+p>=P.minX&&g-p<=P.maxX&&w+p>=P.minY&&w-p<=P.maxY))continue;let v=[{x:g-p,y:w-p},{x:g+p,y:w-p},{x:g+p,y:w+p},{x:g-p,y:w+p}];!Ge({x:g,y:w},t,n)||$i({x:g,y:w},[t,...n??[]])<p*Math.SQRT2+(c?fo/_:0)||d&&$i({x:g,y:w},d.flat())<p*Math.SQRT2+fo/_||ue(e,v,void 0,()=>m,r,i,a,ae)}if(d){for(let[g,...w]of d)ue(e,g,w,()=>m,r-Zi,i,a,ae);e.setMaterial(0);return}let x=_t(t,fo/_);if(c&&x.length>=3){let g=s.filter(P=>{if(P.role!=="entrance"&&P.role!=="exit")return!1;let R=xe(P);return!!R&&R.some(k=>!Ge(k,t,void 0)||$i(k,[t])<=fo/_)}),w=[x.slice().reverse()],v=r-Zi;(!g.length||!At(e,t,v,m,g,i,a,{holes:w,portalBase:r+Zi}))&&ue(e,t,w,()=>m,v,i,a,ae)}e.setMaterial(0)}var qi=.25,fo=qi;function l0(e,t,n,o){if(n.length<3)return null;let r=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s},i=a=>{let[s,...c]=a.map(l=>[r(l)]);return Ft.default.union(s,...c)};try{let a=[r(e),...(t??[]).map(r)],s=Ft.default.difference(a,[r(n)]),c=Ft.default.intersection(a,i(o.bays));if(!c.length)return null;let l=Ft.default.difference(Ft.default.intersection(a,i(o.walls)),c);return Ft.default.union(Ft.default.difference(s,c),l).map(m=>m.map(f=>f.slice(0,-1).map(([d,h])=>({x:d,y:h}))))}catch{return null}}var u0=.02,m0=.25,f0=1.2,d0=.6,h0=.45,p0=2.3,b0=Math.PI/180,tu=.005;function yt(e,t,n){let o=n*b0;return{x:e.x+t*Math.sin(o),y:e.y+t*Math.cos(o)}}function y0(e,t){let n=t.rings[t.rings.length-1];if(!n)return!1;let o=n.outerRMedian*.85;for(let r of e){if(r.role!=="wall")continue;let i=r.points&&r.points.length>=2?r.points:r.x!==void 0&&r.y!==void 0&&r.width!==void 0&&r.height!==void 0?[{x:r.x,y:r.y},{x:r.x+r.width,y:r.y},{x:r.x+r.width,y:r.y+r.height},{x:r.x,y:r.y+r.height}]:[];if(i.length<2)continue;let a=0;for(let s of i)Math.hypot(s.x-t.centre.x,s.y-t.centre.y)>=o&&a++;if(a>=i.length/2)return!0}return!1}var g0=24,x0=.01;function M0(e,t,n,o,r,i,a,s,c){let l=n.binCount,u=g0,m=fe,f=i+.02,d=i-x0,h=[];for(let I=0;I<l;I++){let C=(n.startBin+I+.5)*t.binStepDeg,L=new Float64Array(u+1);for(let N=0;N<=u;N++){let O=o[I]+(r[I]-o[I])*N/u;L[N]=Math.max(f,Jl(t,n,C,O)-m0)}h.push(L)}if(c){let I=0;for(let C=0;C+1<l;C++)for(let L=0;L<u;L++){let N=yt(t.centre,o[C]+(r[C]-o[C])*L/u,(n.startBin+C+.5)*t.binStepDeg),O=yt(t.centre,o[C+1]+(r[C+1]-o[C+1])*(L+1)/u,(n.startBin+C+1.5)*t.binStepDeg);I=Math.max(I,Math.hypot(O.x-N.x,O.y-N.y))}for(let C=0;C<l;C++){let L=(n.startBin+C+.5)*t.binStepDeg;for(let N=0;N<=u;N++){let O=yt(t.centre,o[C]+(r[C]-o[C])*N/u,L),H=c(O.x,O.y,I*1.01);H!==null&&(h[C][N]=Math.min(h[C][N],Math.max(d+tu,H-tu)))}}}let p=[a.bandTop[0]*s.top,a.bandTop[1]*s.top,a.bandTop[2]*s.top],b=[a.bandTop[0]*s.bottomCap,a.bandTop[1]*s.bottomCap,a.bandTop[2]*s.bottomCap],y=[a.bandWall[0]*s.top,a.bandWall[1]*s.top,a.bandWall[2]*s.top],M=[a.bandWall[0]*s.wallBottom,a.bandWall[1]*s.wallBottom,a.bandWall[2]*s.wallBottom],S=(I,C)=>{let L=(n.startBin+I+.5)*t.binStepDeg,N=o[I]+(r[I]-o[I])*C/u,O=yt(t.centre,N,L);return[O.x*m,h[I][C],O.y*m]};{let I=Math.tan(12*Math.PI/180);for(let C=0;C<6;C++){let L=!1;for(let O=0;O<l;O++)for(let H=u-1;H>=0;H--)h[O][H]>h[O][H+1]&&(h[O][H]=h[O][H+1],L=!0);let N=n.closed?l:l-1;for(let O=0;O<N;O++){let H=(O+1)%l;for(let j=0;j<=u;j++){let V=h[H][j]-h[O][j];if(Math.abs(V)>1)continue;let T=o[O]+(r[O]-o[O])*j/u,B=o[H]+(r[H]-o[H])*j/u,D=yt(t.centre,T,(n.startBin+O+.5)*t.binStepDeg),G=yt(t.centre,B,(n.startBin+H+.5)*t.binStepDeg),U=I*Math.hypot(G.x-D.x,G.y-D.y)*m;V>U?(h[H][j]=h[O][j]+U,L=!0):-V>U&&(h[O][j]=h[H][j]+U,L=!0)}}if(!L)break}}let A=1,x=(I,C)=>{for(let L=0;L<=u;L+=4)if(Math.abs(h[I][L]-h[C][L])>A)return!0;return Math.abs(h[I][u]-h[C][u])>A},g=Math.tan(38*Math.PI/180),w=I=>(r[I]-o[I])/u*m,v=(I,C)=>h[I][C+1]-h[I][C]>g*Math.max(1e-6,w(I)),P=(I,C)=>{let L=n.closed?(I-1+l)%l:Math.max(0,I-1),N=n.closed?(I+1)%l:Math.min(l-1,I+1);Math.abs(h[L][C]-h[I][C])>A&&(L=I),Math.abs(h[N][C]-h[I][C])>A&&(N=I);let O=Math.max(0,C-1),H=Math.min(u,C+1);O<C&&v(I,O)&&(O=C),H>C&&v(I,C)&&(H=C);let j=S(L,C),V=S(N,C),T=S(I,O),B=S(I,H),D=V[0]-j[0],G=V[1]-j[1],U=V[2]-j[2],q=B[0]-T[0],$=B[1]-T[1],te=B[2]-T[2],Q=G*te-U*$,X=U*q-D*te,Y=D*$-G*q,K=Math.hypot(Q,X,Y);return K>1e-12?(Q/=K,X/=K,Y/=K,X<0&&(Q=-Q,X=-X,Y=-Y),[Q,X,Y]):[0,1,0]},R=(I,C,L=!1)=>{let N=L&&Math.min(I[1],C[1])-i>=3,O=[I[0],N?I[1]-ho:d,I[2]],H=[C[0],N?C[1]-ho:d,C[2]],j=C[0]-I[0],V=C[2]-I[2],T=Math.hypot(j,V);if(!(T>1e-12))return;let B=[V/T,0,-j/T];e.tri(I,C,H,B,y,y,M),e.tri(I,H,O,B,y,M,M)},k=.05*et,F=I=>r[I]-o[I]<k,E=n.closed?l:l-1;for(let I=0;I<E;I++){let C=(I+1)%l;if(F(I)||F(C))continue;if(x(I,C)){let V=(n.startBin+I+1)*t.binStepDeg,T=($,te)=>{let Q=(o[I]+o[C])/2,X=(r[I]+r[C])/2,Y=Q+(X-Q)*te/u,K=yt(t.centre,Y,V);return[K.x*m,h[$][te],K.y*m]};for(let $=0;$<u;$++){let te=S(I,$),Q=S(I,$+1),X=T(I,$),Y=T(I,$+1),K=P(I,$),J=P(I,$+1);e.triN(te,X,Y,K,K,J,p),e.triN(te,Y,Q,K,J,J,p);let ce=S(C,$),oe=S(C,$+1),ee=T(C,$),ne=T(C,$+1),he=P(C,$),re=P(C,$+1);e.triN(ee,ce,oe,he,he,re,p),e.triN(ee,oe,ne,he,re,re,p);let ve=T(I,$),we=T(I,$+1),ot=T(C,$+1),ut=T(C,$),Ye=we[0]-ve[0],rt=we[2]-ve[2],Ie=Math.hypot(Ye,rt);if(Ie>1e-12){let Ht=[rt/Ie,0,-Ye/Ie];e.tri(ve,we,ot,Ht,y),e.tri(ve,ot,ut,Ht,y)}}let B=S(I,0),D=S(C,0),G=S(C,u),U=S(I,u),q=$=>[$[0],d,$[2]];Math.min(B[1],D[1])-i<3&&(e.tri(q(B),q(G),q(D),[0,-1,0],b),e.tri(q(B),q(U),q(G),[0,-1,0],b)),R(B,D,!0),R(U,G,!0);continue}for(let V=0;V<u;V++){let T=P(I,V),B=P(C,V),D=P(C,V+1),G=P(I,V+1);if(v(I,V)||v(C,V)){let Q=(we,ot)=>{let ut=(n.startBin+we+.5)*t.binStepDeg,Ye=o[we]+(r[we]-o[we])*(V+.5)/u,rt=yt(t.centre,Ye,ut);return[rt.x*m,ot,rt.y*m]},X=S(I,V),Y=S(C,V),K=Q(I,h[I][V]),J=Q(C,h[C][V]);e.triN(X,Y,J,T,B,B,p),e.triN(X,J,K,T,B,T,p);let ce=S(C,V+1),oe=S(I,V+1),ee=Q(I,h[I][V+1]),ne=Q(C,h[C][V+1]);e.triN(ee,ne,ce,G,D,D,p),e.triN(ee,ce,oe,G,D,G,p);let he=J[0]-K[0],re=J[2]-K[2],ve=Math.hypot(he,re);if(ve>1e-12){let we=[-re/ve,0,he/ve];e.tri(K,J,ne,we,y),e.tri(K,ne,ee,we,y)}continue}let U=S(I,V),q=S(C,V),$=S(C,V+1),te=S(I,V+1);e.triN(U,q,$,T,B,D,p),e.triN(U,$,te,T,D,G,p)}let L=S(I,0),N=S(C,0),O=S(C,u),H=S(I,u),j=V=>[V[0],d,V[2]];Math.min(L[1],N[1])-i<3&&(e.tri(j(L),j(O),j(N),[0,-1,0],b),e.tri(j(L),j(H),j(O),[0,-1,0],b)),R(L,N,!0),R(H,O,!0)}if(!n.closed)for(let I of[0,l-1])for(let C=0;C<u;C++)R(S(I,C),S(I,C+1))}function nu(e,t,n){let{bottomY:o,colors:r,ao:i}=n,a=new Float64Array(t.binCount).fill(-1/0);for(let u of t.rings)for(let m of u.arcs){let f=new Float64Array(m.binCount),d=new Float64Array(m.binCount);for(let p=0;p<m.binCount;p++){let b=(m.startBin+p)%t.binCount,y=Math.max(0,m.innerR[p]-tt);f[p]=Math.max(y,a[b]+.001),d[p]=Math.max(f[p]+.001,m.outerR[p]+tt)}let h=0;for(let p=0;p<m.binCount;p++){let b=m.topLevelM[p]-o;b>h&&(h=b)}h>=f0&&M0(e,t,m,f,d,o,r,i,n.standTopNear);for(let p=0;p<m.binCount;p++){let b=(m.startBin+p)%t.binCount;d[p]>a[b]&&(a[b]=d[p])}}if(n.deriveShell===!1||y0(n.shapes,t))return;let s=t.rings[t.rings.length-1],c=d0*et,l=h0*et;for(let u of s.arcs){let m=[],f=[];for(let P=0;P<u.binCount;P++){let R=(u.startBin+P+.5)*t.binStepDeg,k=u.outerR[P]+tt+c;m.push(yt(t.centre,k,R)),f.push(yt(t.centre,k+l,R))}let d=-1/0;for(let P=0;P<u.binCount;P++)u.topLevelM[P]>d&&(d=u.topLevelM[P]);let h=d+p0,p=u.closed?f:[...f,...m.slice().reverse()],b=u.closed?[m.slice().reverse()]:void 0,y=ge(r.shellWall,[.66,.71,.72],.62),M=(P,R,k,F,E)=>{let I=Math.abs(F-d)<1e-6?F-u0:F;At(e,P,k,I,n.shapes,r.shellTop,E,{holes:R,portalBase:o,ao:i})||ue(e,P,R,()=>I,k,r.shellTop,E,i)},S=Math.max(1,Math.ceil((d-o)/4.5)),A=(d-o)/S,x=new Set,g=n.tierFrontLevels??t.rings.map(P=>{let R=P.arcs.flatMap(k=>Array.from(k.frontLevelM)).filter(Number.isFinite).sort((k,F)=>k-F);return R[Math.floor(R.length/2)]});for(let P of g)Number.isFinite(P)&&P-o>=3&&P<d&&x.add(Math.max(0,Math.min(S-1,Math.floor((P-o)/A))));let w=Math.min(...g.filter(P=>Number.isFinite(P)&&P-o>=3&&P<d));for(let P=0;P<S;P++)o+(P+1)*A<=w-ho&&Number.isFinite(w)&&x.add(P);for(let P=0;P<S;P++){let R=o+(d-o)*P/S,k=o+(d-o)*(P+1)/S;x.has(P)&&k-R>=3.2?(M(p,b,R,R+.45,y),Ki(e,m,f,u.closed,R+.45,k-.16,r.shellTop,y,i,n.shapes,o)):M(p,b,R,k-.16,y),M(p,b,k-.16,k,le(y,.62))}Ki(e,m,f,u.closed,d,h,r.shellTop,y,i,n.shapes,o);let v=8;for(let P=1;P<f.length;P++){if(v+=Math.hypot(f[P].x-f[P-1].x,f[P].y-f[P-1].y)*fe,v<8)continue;v=0;let R=f[P],k=f[P-1],F=R.x-k.x,E=R.y-k.y,I=Math.max(1,Math.hypot(F,E)),C=F/I*.16*et,L=E/I*.16*et,N=Math.max(1,Math.hypot(R.x-t.centre.x,R.y-t.centre.y)),O=(R.x-t.centre.x)/N*.24*et,H=(R.y-t.centre.y)/N*.24*et,j=[{x:R.x-C,y:R.y-L},{x:R.x+C,y:R.y+L},{x:R.x+C+O,y:R.y+L+H},{x:R.x-C+O,y:R.y-L+H}];M(j,void 0,o,d,le(y,1.12))}}}var v0=2.5,ou=.65,S0=2,w0=.03;function P0(e,t){let n=()=>{let o=t;for(;e.length>2;){let r=e[0],i=e[1],a=Math.hypot(i.x-r.x,i.y-r.y);if(a>o){e[0]={x:r.x+(i.x-r.x)/a*o,y:r.y+(i.y-r.y)/a*o};return}o-=a,e.shift()}};n(),e.reverse(),n(),e.reverse()}function ea(e,t,n){let o=new Map;for(let i of e){let a=o.get(i.blockId);(!a||i.depth<a.depth)&&o.set(i.blockId,i)}let r=[];for(let[i,a]of o){if(a.y-n<v0||a.pts.length<2)continue;let s=a.pts.map(u=>{let m=u.x-t.x,f=u.y-t.y,d=Math.max(1,Math.hypot(m,f));return{x:u.x-m/d*ou/_,y:u.y-f/d*ou/_}}),c=[],l=[s[0]];for(let u=1;u<s.length;u++){let m=s[u-1],f=s[u];Math.hypot(f.x-m.x,f.y-m.y)*_>S0?(l.length>=2&&c.push(l),l=[f]):l.push(f)}l.length>=2&&c.push(l);for(let u of c)P0(u,w0/_);c.length&&r.push({blockId:i,y:a.y,runs:c})}return r}var ru=.1,A0=1.1,I0=.22,Qi=.95,Ji=.05,iu=1.8;function au(e,t,n,o){let r=[.72,.72,.69],i=[.48,.55,.57];for(let a of ea(t,n,o)){let s=a.y;for(let c of a.runs){let l=iu;for(let u=1;u<c.length;u++){let m=c[u-1],f=c[u],d=f.x-m.x,h=f.y-m.y,p=Math.hypot(d,h);if(p<1e-5)continue;let b=y=>{let M=-h/p*y/_/2,S=d/p*y/_/2;return[{x:m.x+M,y:m.y+S},{x:f.x+M,y:f.y+S},{x:f.x-M,y:f.y-S},{x:m.x-M,y:m.y-S}]};if(ue(e,b(I0),void 0,()=>s+ru,s-A0,r,r,ae),ue(e,b(Ji),void 0,()=>s+Qi,s+Qi-Ji,i,i,ae),l+=p*_,l>=iu||u===c.length-1){l=0;let y=.028/_,M=[{x:m.x-y,y:m.y-y},{x:m.x+y,y:m.y-y},{x:m.x+y,y:m.y+y},{x:m.x-y,y:m.y+y}];ue(e,M,void 0,()=>s+Qi-Ji,s+ru,i,i,ae)}}}}}var R0=.9,E0=1.5,C0=.3;function su(e,t,n){let o=[],r=[],i=R0/_,a=E0/_,s=C0/_;for(let c of e)for(let l of c.runs){if(l.length<2)continue;let u=l.slice(),m=(b,y)=>{let M=u[b],S=u[y],A=Math.hypot(M.x-S.x,M.y-S.y)||1;u[b]={x:M.x+(M.x-S.x)/A*s,y:M.y+(M.y-S.y)/A*s}};m(0,1),m(u.length-1,u.length-2);let f=u.map((b,y)=>{let M=u[Math.max(0,y-1)],S=u[Math.min(u.length-1,y+1)],A=S.x-M.x,x=S.y-M.y,g=Math.hypot(A,x)||1,w=-x/g,v=A/g;return w*(b.x-t.x)+v*(b.y-t.y)<0&&(w=-w,v=-v),{nx:w,ny:v}}),d=u.map((b,y)=>({x:b.x-f[y].nx*a,y:b.y-f[y].ny*a})),h=u.map((b,y)=>({x:b.x+f[y].nx*i,y:b.y+f[y].ny*i})),p=u.map((b,y)=>({x:b.x+f[y].nx*(i+n/_),y:b.y+f[y].ny*(i+n/_)}));o.push([...d,...h.slice().reverse()]),r.push([...h,...p.reverse()])}return{bays:o,walls:r}}var ta=.88,gr=.27,_0=1.2,T0=.01;function cu(e,t,n,o,r){let i=[.67,.71,.68],a=[i[0]*ta,i[1]*ta,i[2]*ta],s=c=>!!r&&r.some((l,u)=>u!==c&&l?.belowY!=null&&Math.abs(l.belowY-t[c].y)<1e-6&&t[u].blockId===t[c].blockId);for(let c=0;c<t.length;c++){let l=t[c];if(!(l.pts.length<2))for(let u of[0,l.pts.length-1]){let m=l.pts[u],f=l.pts[u===0?1:u-1],d=m.x-f.x,h=m.y-f.y,p=Math.hypot(d,h);if(p<1e-5)continue;d/=p,h/=p;let b=1/0;for(let C=0;C<n.length;C++){let L=n[C],N=n[(C+1)%n.length],O=N.x-L.x,H=N.y-L.y,j=d*H-h*O;if(Math.abs(j)<1e-8)continue;let V=L.x-m.x,T=L.y-m.y,B=(V*H-T*O)/j,D=(V*h-T*d)/j;B>0&&D>=0&&D<=1&&(b=Math.min(b,B))}let y=.3/_,M=b-.04/_;if(!Number.isFinite(b)||b*_>2||M-y<.12/_)continue;let S=!!o&&s(c),A=r?.[c]?.pitch,x=S&&A&&Number.isFinite(A)?Math.min(_0/_,Math.max(gr/_,A-gr/_-T0/_)):gr/_,g=-h,w=d;o&&g*(o.x-m.x)+w*(o.y-m.y)<0&&(g=-g,w=-w);let v=gr/_,P=[{x:m.x+d*y+g*v,y:m.y+h*y+w*v},{x:m.x+d*M+g*v,y:m.y+h*M+w*v},{x:m.x+d*M-g*x,y:m.y+h*M-w*x},{x:m.x+d*y-g*x,y:m.y+h*y-w*x}];if(!P.every(C=>Ze(n,C.x,C.y)))continue;let R=r?.[c]?.belowY,k=R==null?0:l.y-R,F=!!o&&k>.03&&k<=.65;if(F&&o){let C=(L,N)=>Math.hypot((L.x+N.x)/2-o.x,(L.y+N.y)/2-o.y);C(P[0],P[1])>C(P[3],P[2])&&(P=[P[3],P[2],P[1],P[0]])}let E=F?Math.ceil((k-1e-8)/.2):1,I=(C,L,N)=>({x:C.x+(L.x-C.x)*N,y:C.y+(L.y-C.y)*N});for(let C=0;C<E;C++){let L=C/E,N=(C+1)/E,O=[I(P[0],P[3],L),I(P[1],P[2],L),I(P[1],P[2],N),I(P[0],P[3],N)],H=l.y+.008-(F?k*(1-N):0);ue(e,O,void 0,()=>H,H-(F?k/E+.1:.16),i,a,ae)}}}}var L0=.02,k0=.012,O0=.01,F0=.3,D0=.5;function N0(e,t,n){if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>1e-12?((t-i.x)*s+(n-i.y)*c)/l:0;u=Math.max(0,Math.min(1,u)),o=Math.min(o,Math.hypot(t-(i.x+u*s),n-(i.y+u*c)))}return o}function B0(e,t,n,o){let r=1/0,i=Number.NaN;for(let a=0;a<e.length;a++){let s=t[a];if(Math.hypot(n-s.cx,o-s.cy)-s.rad>=r)continue;let c=N0(e[a].pts,n,o);c<r&&(r=c,i=e[a].y)}return i}function lu(e,t,n,o,r,i,a){let s=o.filter(f=>f.pts.length>0);if(s.length<2||t.length<3)return;let c=s.map(f=>{let d=0,h=0;for(let b of f.pts)d+=b.x,h+=b.y;d/=f.pts.length,h/=f.pts.length;let p=0;for(let b of f.pts)p=Math.max(p,Math.hypot(b.x-d,b.y-h));return{cx:d,cy:h,rad:p}}),l=[...t],u=n.map(f=>[...f]),m=L0/_;for(let f of[l,...u])for(let d=0;d<f.length;d++){let h=f[d],p=f[(d+1)%f.length],b=p.x-h.x,y=p.y-h.y,M=Math.hypot(b,y);if(M*_<.05)continue;let S=(h.x+p.x)/2,A=(h.y+p.y)/2,x=y/M,g=-b/M;Ge({x:S+x*m,y:A+g*m},l,u)&&(x=-x,g=-g);let w=r.x-S,v=r.y-A,P=Math.hypot(w,v)||1;if((x*w+g*v)/P>D0)continue;let R=1/0;for(let O of[.2,.5,.8]){let H=B0(s,c,h.x+b*O-x*m*2,h.y+y*O-g*m*2);Number.isFinite(H)&&(R=Math.min(R,H))}if(!Number.isFinite(R)||R-i<F0)continue;let k=i-O0,F=R-k0,E={x:(h.x-x*m)*_,z:(h.y-g*m)*_},I={x:(p.x-x*m)*_,z:(p.y-g*m)*_},C=[x,0,g],L=le(a,ae.wallBottom),N=le(a,ae.top);e.tri([E.x,F,E.z],[I.x,F,I.z],[I.x,k,I.z],C,N,N,L),e.tri([E.x,F,E.z],[I.x,k,I.z],[E.x,k,E.z],C,N,L,L)}}function uu(e,t,n,o,r,i,a,s,c=!1){if(!t.outline||t.outline.length<3)return;let l=n.baseHeightM,u=n.objects.filter(M=>M.type==="shape"&&(M.role==="entrance"||M.role==="exit")),m=Wc(o,s.tierTop);if(!r)return;let f=M=>r.deckAt(M.x,M.y),d=sl(t,a),h=d[0]??t.outline;if(r.rowLevels.length>=2){let M=tr(r.rowLevels),S=cl(nl(r.rowLevels,n.focal,M),d),A=su(ea(r.rowLevels,n.focal,l),n.focal,qi);for(let g of S){let w=Math.max(l,g.topY-mu);for(let v of i.subtract(g.outline,w))eu(e,v,g.holes,w,l,s.tierTop,s.tierWall,u,!c,A);e.setMaterial(5),lu(e,g.outline,g.holes,r.rowLevels,n.focal,w,s.tierWall),e.setMaterial(0)}S.length||ue(e,h,t.holes,()=>r.landingY,l,m,s.tierWall,ae);let x={tread:[m[0]*ae.top,m[1]*ae.top,m[2]*ae.top],riser:[m[0]*.72,m[1]*.72,m[2]*.72]};for(let g of d.length?d:[h])rl(e,r.rowLevels,n.focal,r.landingY,x,g,M);au(e,r.rowLevels,n.focal,l),cu(e,r.rowLevels,t.outline,n.focal,M);return}let p=r.flat?1/0:yl,b=M=>r.normalAt(M.x,M.y),y=r.flat?r.landingY:void 0;for(let M of i.subtract(h,y))ue(e,M,t.holes,f,l,m,s.tierWall,ae,p,b)}function V0(e,t,n){let o=new Set;for(let a of e.objects)a.type==="section"&&o.add(a.id);let r=new Map;for(let a=0;a<t.length;a++){let s=n.seatOwner[a];if(!s||!o.has(s))continue;let c=n.bySection.get(s);if(c&&c.rowLevels.length>=2)continue;let l=t[a];if(l.kind==="booth")continue;let u=r.get(s);u||(u=new Map,r.set(s,u));let m=l.rowId||`__seat-${a}`,f=u.get(m);f||(f={pts:[],levelM:0,n:0},u.set(m,f)),f.pts.push({x:l.x,y:l.y}),f.levelM+=n.seatDeckY(a),f.n++}let i=[];for(let a of e.objects){if(a.type!=="section")continue;let s=n.bySection.get(a.id);if(s&&s.rowLevels.length>=2){let l=s.rowLevels.filter(u=>!u.patch).map(u=>({pts:u.pts,levelM:u.y}));l.length>=2&&i.push({sectionId:a.id,rows:l});continue}let c=r.get(a.id);c&&i.push({sectionId:a.id,rows:[...c.values()].map(l=>({pts:l.pts,levelM:l.levelM/l.n}))})}return i}function G0(e,t){let n=1/0;for(let o=0;o<t.length;o++){let r=t[o],i=t[(o+1)%t.length],a=i.x-r.x,s=i.y-r.y,c=Math.max(0,Math.min(1,((e.x-r.x)*a+(e.y-r.y)*s)/(a*a+s*s||1)));n=Math.min(n,Math.hypot(e.x-r.x-c*a,e.y-r.y-c*s))}return n}var mu=.02;function H0(e,t){let n=e.objects.filter(o=>o.type==="section"&&!!o.outline&&o.outline.length>=3).flatMap(o=>{let r=t.bySection.get(o.id);if(!r)return[];let i=1/0,a=-1/0,s=1/0,c=-1/0;for(let u of o.outline)u.x<i&&(i=u.x),u.x>a&&(a=u.x),u.y<s&&(s=u.y),u.y>c&&(c=u.y);let l=r.landingY;for(let u of r.rowLevels)l=Math.min(l,u.y-mu);return[{outline:o.outline,holes:o.holes,surface:r,floorTop:l,minX:i,maxX:a,minY:s,maxY:c}]});return(o,r,i)=>{let a=null;for(let s of n){if(o<s.minX-i||o>s.maxX+i||r<s.minY-i||r>s.maxY+i)continue;let c={x:o,y:r};if(!Ge(c,s.outline,s.holes)&&G0(c,s.outline)>i)continue;let l=Math.min(s.surface.deckAt(o,r),s.floorTop);(a===null||l<a)&&(a=l)}return a}}var z0=3,U0=.4;function fu(e,t,n,o,r,i,a=!0){let s=V0(t,n,o);if(s.length<z0)return;let c=Ql(s,t.focal);if(!c)return;let l=Math.max(0,...c.rings.map(u=>u.arcs.reduce((m,f)=>m+f.binCount,0)))/c.binCount;e.setMaterial(5),nu(e,c,{bottomY:t.baseHeightM,tierFrontLevels:s.map(u=>Math.min(...u.rows.map(m=>m.levelM))),colors:{bandTop:le(r.tierTop,.8),bandWall:r.tierWall,shellTop:i??le(r.tierWall,1.15),shellWall:i??r.tierWall},ao:ae,shapes:t.objects.filter(u=>u.type==="shape"),deriveShell:a&&l>=U0,standTopNear:H0(t,o)}),e.setMaterial(0)}var du=4;var j0=[[/\b(wc|toilets?|restrooms?|washrooms?|lavatory|loo)\b/i,"restroom"],[/\b(bar|drinks|pub|cocktails?)\b/i,"bar"],[/\b(food|concessions?|snacks?|kiosk|caf[eé]|kitchen|catering)\b/i,"concession"],[/\b(coat ?check|cloak ?room|cloakroom|coats)\b/i,"coat"],[/\b(screen|led wall|projection|video wall)\b/i,"screen"],[/\b(sound|foh|mixing desk|control booth)\b/i,"sound"],[/\b(entrance|entry|way in|gate)\b/i,"entrance"],[/\b(exit|way out)\b/i,"exit"],[/\b(pillar|column|obstruction)\b/i,"obstruction"],[/\b(walls?|outline|boundary|perimeter)\b/i,"wall"]],W0=1.2,X0=12;function hu(e){if(e.heightM!==void 0)return!1;let t=xe(e);if(!t||t.length<3)return!1;let n=0;for(let r=0;r<t.length;r++){let i=t[r],a=t[(r+1)%t.length];n+=Math.hypot(a.x-i.x,a.y-i.y)}return n*fe<X0*2?!1:2*po(t)/n*fe<=W0}function na(e){if(!e)return null;for(let[t,n]of j0)if(t.test(e))return n;return null}var bu="auto-rows-";function yu(e){return e.id.startsWith(bu)&&!e.label}var Y0=1.15,K0=.09,gu=6,$0=34,Z0=.35,q0=6,Q0=.35,J0=.75,ey=12,ty=2.5,ny=40,oy=[18,24],ry=[12,16],pu=14,iy=.8,ay=.6,sy=5,cy=.3,xu=.4,Mu=2,ly=400,uy=2.6,my=.8,fy=4,dy=26,hy=.7,py=.5,by=.985,yy=1.5,gy=2.2,xy=3,My=25,vy=.985,Sy=2,wy=6,Py=3,Ay=.1,Iy=1.5,Ry=1.6,Ey=6e3,Cy=.6,_y="#c3c7cd",oa=300,Ty=240;function Ly(e,t,n,o){if(!e.fill||!/^#[0-9a-f]{6}$/i.test(e.fill))return null;let r=ia([...t]),i=new Set;for(let u of o)i.add(Math.floor(Math.atan2(u.y-r.y,u.x-r.x)*180/Math.PI/10));if(i.size*10<Ty)return null;let{h:a,s,l:c}=ms(ls(e.fill));return a<70/360||a>170/360||s<.2||c<.08||c>.75||n.some(u=>u!==e&&u.type==="shape"&&xe(u)?.some(m=>ca(m,t)))?null:e.kind==="ellipse"?"oval-cricket":e.kind==="rect"?"pitch-football":null}var ky="Estimated from the drawing; confirm with the venue.",aa=e=>{if(!e.length)return null;let t=[...e].sort((o,r)=>o-r),n=Math.floor(t.length/2);return t.length%2?t[n]:(t[n-1]+t[n])/2},ia=e=>({x:e.reduce((t,n)=>t+n.x,0)/e.length,y:e.reduce((t,n)=>t+n.y,0)/e.length}),po=e=>{let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=o.x*r.y-r.x*o.y}return Math.abs(t)/2};function Oy(e){return e.height!==void 0||e.rake!==void 0||e.elevation!==void 0||e.surfaceKind!==void 0}function sa(e){let t=new Map;for(let n of e){let o=t.get(n.rowId);o?o.push(n):t.set(n.rowId,[n])}return t}function ca(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],a=t[r];i.y>e.y!=a.y>e.y&&e.x<(a.x-i.x)*(e.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function la(e,t){let n=t[0],o=1/0;for(let r=0;r<t.length;r++){let i=t[r],a=t[(r+1)%t.length],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>0?Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/l)):0,m={x:i.x+s*u,y:i.y+c*u},f=Math.hypot(e.x-m.x,e.y-m.y);f<o&&(o=f,n=m)}return n}function vu(e,t){let n=0,o=0;for(let r of e.values()){if(r.length<3)continue;let i=r[0],a=r[r.length-1],s=a.x-i.x,c=a.y-i.y,l=Math.hypot(s,c);if(l<1e-6)continue;let u={x:(i.x+a.x)/2,y:(i.y+a.y)/2},m=la(u,t),f=m.x-u.x,d=m.y-u.y,h=Math.hypot(f,d);h<1e-6||(o+=Math.abs((-c*f+s*d)/(l*h))*r.length,n+=r.length)}return n?o/n:0}function Fy(e,t,n){let o=e.filter(p=>p.type==="shape"),r=o.find(p=>p.role==="stage");if(r){let p=xe(r);return p?{shape:r,centre:ia(p),outline:p,inferred:!1}:null}if(!n.length)return null;let i=1/0,a=-1/0,s=1/0,c=-1/0;for(let p of n)i=Math.min(i,p.x),a=Math.max(a,p.x),s=Math.min(s,p.y),c=Math.max(c,p.y);let l=(a-i)*(c-s),u=[];for(let p of o){if(p.role)continue;let b=xe(p);if(!b)continue;let y=po(b);if(y*fe*fe<6||y>l)continue;let M=Math.min(...b.map(P=>P.x)),S=Math.max(...b.map(P=>P.x)),A=Math.min(...b.map(P=>P.y)),x=Math.max(...b.map(P=>P.y)),g=0;for(let P of n)P.x>M&&P.x<S&&P.y>A&&P.y<x&&ca(P,b)&&g++;if(g>n.length*.05)continue;let w=ia(b),v=vu(t,b);v>=iy&&u.push({shape:p,centre:w,outline:b,score:v,area:y,box:[M,A,S,x]})}let m=(p,b)=>b!==p&&b.area>p.area&&p.box[0]>=b.box[0]-1e-6&&p.box[1]>=b.box[1]-1e-6&&p.box[2]<=b.box[2]+1e-6&&p.box[3]<=b.box[3]+1e-6,f=u.filter(p=>!u.some(b=>m(p,b))),d=Math.max(0,...f.map(p=>p.score)),h=f.filter(p=>p.score>=d-.03).sort((p,b)=>b.area-p.area)[0]??null;return h?{shape:h.shape,centre:h.centre,outline:h.outline,inferred:!0}:null}function Dy(e,t,n){if(!n||n.length<3)return Math.hypot(e.x-t.x,e.y-t.y);let o=la(e,n);return Math.hypot(e.x-o.x,e.y-o.y)}function Su(e){return e.length<3?[...e].sort((t,n)=>t.x-n.x||t.y-n.y):wn(e)}function Ny(e){if(!e.length||e.length>Ey)return[];let t=[...sa(e).values()],n=t.map((s,c)=>c),o=s=>n[s]===s?s:n[s]=o(n[s]),r=Ry/fe,i=t.map(s=>({minX:Math.min(...s.map(c=>c.x))-r,maxX:Math.max(...s.map(c=>c.x))+r,minY:Math.min(...s.map(c=>c.y))-r,maxY:Math.max(...s.map(c=>c.y))+r}));for(let s=0;s<t.length;s++)for(let c=s+1;c<t.length;c++){let l=i[s],u=i[c];if(l.maxX<u.minX||u.maxX<l.minX||l.maxY<u.minY||u.maxY<l.minY)continue;t[s].some(f=>t[c].some(d=>Math.hypot(f.x-d.x,f.y-d.y)<=r))&&(n[o(s)]=o(c))}let a=new Map;return t.forEach((s,c)=>{let l=o(c),u=a.get(l);u?u.push(...s):a.set(l,[...s])}),[...a.values()].filter(s=>new Set(s.map(c=>c.rowId)).size>=2)}function By(e,t,n){if(!t.length)return null;let o=t.filter(v=>n.tableIds.has(v.rowId)||v.kind==="booth").length>t.length/2,r=sa(t),i=!n.outline||vu(r,n.outline)>=ay,a=0,s=0;for(let v of r.values()){if(v.length<2)continue;let P=v[0],R=v[v.length-1],k=R.x-P.x,F=R.y-P.y,E=Math.hypot(k,F);if(E<1e-6)continue;let I={x:(P.x+R.x)/2,y:(P.y+R.y)/2},C=i?n.outline?la(I,n.outline):n.focal:n.middle,L=-F/E,N=k/E;L*(C.x-I.x)+N*(C.y-I.y)<0&&(L=-L,N=-N),a+=L*v.length,s+=N*v.length}let c={x:t.reduce((v,P)=>v+P.x,0)/t.length,y:t.reduce((v,P)=>v+P.y,0)/t.length};if(Math.hypot(a,s)<1e-9){let v=i?n.focal:n.middle;a=v.x-c.x,s=v.y-c.y}let l=Math.hypot(a,s)||1,u={x:a/l,y:s/l},m=v=>-(v.x*u.x+v.y*u.y),f=v=>-v.x*u.y+v.y*u.x,d=1/0,h=-1/0,p=1/0,b=-1/0,y=1/0,M=new Map;for(let v of t){let P=m(v),R=f(v);d=Math.min(d,P),h=Math.max(h,P),p=Math.min(p,R),b=Math.max(b,R),i&&(y=Math.min(y,Dy(v,n.focal,n.outline)));let k=v.logicalRowId??v.rowId,F=M.get(k);F?F.push(P):M.set(k,[P])}i||(y=Math.max(0,d-m(n.middle)));let S=[...M.values()].map(v=>aa(v)).sort((v,P)=>v-P),A=[];if(!o)for(let v of S)A.length&&v-A[A.length-1]<Q0/fe||A.push(v);let x=Oy(e),g=Ct(e,{floorBaseHeightM:n.baseHeightM}),w={id:e.id,section:e,authored:x,plane:n,facing:u,facesAction:i,hull:Su(t),sample:t.filter((v,P)=>P%Math.ceil(t.length/ly)===0),frontD:d,backD:h,latMin:p,latMax:b,frontDistance:y,rowDepths:A,rowCount:A.length,level:0,height:g.height,rake:x?g.rake:0,backHeight:0};return w.backHeight=w.height+(h-d)*fe*Math.tan(w.rake*Math.PI/180),w}function Vy(e,t,n,o){if(e.length<2)return 0;let r=Math.max(1,t*fe),i=n+Y0-o,a=0,s=0;for(let l=1;l<e.length;l++){let u=Math.max(J0,(e[l]-e[l-1])*fe),m=(i+K0)*(r+u)/r;a+=m-i,s+=u,i=m,r+=u}let c=Math.atan(a/s)*180/Math.PI;return Math.round(Math.max(gu,Math.min($0,c))*10)/10}function Gy(e,t,n=!1){if(!n&&e.facing.x*t.facing.x+e.facing.y*t.facing.y<cy)return null;let o=-1/0,r=1/0,i=-1/0;for(let f of t.hull){o=Math.max(o,-(f.x*e.facing.x+f.y*e.facing.y));let d=-f.x*e.facing.y+f.y*e.facing.x;r=Math.min(r,d),i=Math.max(i,d)}if(Math.min(e.latMax,i)-Math.max(e.latMin,r)<(n?1e-6:xu*(e.latMax-e.latMin)))return null;let s=Mu/fe,c=new Map,l=new Map;for(let f of e.sample){let d=Math.floor((-f.x*e.facing.y+f.y*e.facing.x)/s),h=-(f.x*e.facing.x+f.y*e.facing.y);c.set(d,Math.min(c.get(d)??1/0,h))}for(let f of t.sample){let d=Math.floor((-f.x*e.facing.y+f.y*e.facing.x)/s),h=-(f.x*e.facing.x+f.y*e.facing.y);l.set(d,Math.max(l.get(d)??-1/0,h))}let u=[];for(let[f,d]of c){let h=l.get(f);h!==void 0&&u.push(d-h)}let m=u.length?aa(u):e.frontD-o;return m<-1/fe?null:m}function Hy(e,t){if(t.plane.floorIndex>=e.plane.floorIndex)return!1;let n=-1/0,o=1/0,r=1/0,i=-1/0;for(let c of t.hull){let l=-(c.x*e.facing.x+c.y*e.facing.y);n=Math.max(n,l),o=Math.min(o,l);let u=-c.x*e.facing.y+c.y*e.facing.x;r=Math.min(r,u),i=Math.max(i,u)}let a=Math.min(e.latMax,i)-Math.max(e.latMin,r),s=Math.min(e.backD,n)-Math.max(e.frontD,o);return a>xu*(e.latMax-e.latMin)&&s>1/fe}function zy(e,t){let n=new Set;for(let o of e){let r=(Math.atan2(o.y-t.y,o.x-t.x)*180/Math.PI+360)%360;n.add(Math.floor(r/10))}return n.size/36}function Uy(e,t){let n=1/0,o=-1/0;for(let i of t.hull){let a=-(i.x*e.facing.x+i.y*e.facing.y);n=Math.min(n,a),o=Math.max(o,a)}let r=Math.max(0,Math.min(o-n,e.frontD-n));return t.height+r*fe*Math.tan(t.rake*Math.PI/180)}function jy(e,t){if(!e.facesAction)return!1;let n={x:-e.facing.y,y:e.facing.x},o=Mu/fe,r=Math.max(1,Math.ceil((e.backD-e.frontD)/o)),i={left:new Map,right:new Map};for(let s of t)if(!(s===e||s.plane.floorIndex!==e.plane.floorIndex)&&!(s.facing.x*e.facing.x+s.facing.y*e.facing.y>=by))for(let c of s.sample){let l=-(c.x*e.facing.x+c.y*e.facing.y);if(l<e.frontD||l>e.backD)continue;let u=-c.x*e.facing.y+c.y*e.facing.x,m=u<e.latMin?"left":u>e.latMax?"right":null;if(!m)return!1;let f=Math.min(r-1,Math.floor((l-e.frontD)/o)),d=m==="left"?e.latMin-u:u-e.latMax;d<(i[m].get(f)?.gap??1/0)&&i[m].set(f,{gap:d,other:s})}let a=s=>{let c=s==="left"?e.latMin:e.latMax,l=0;for(let[u,{other:m}]of i[s]){if((m.facing.x*n.x+m.facing.y*n.y)*(s==="left"?1:-1)<hy)continue;let d=e.frontD+(u+.5)*o,h={x:-d*e.facing.x+c*n.x,y:-d*e.facing.y+c*n.y},p=-(h.x*m.facing.x+h.y*m.facing.y),b=-h.x*m.facing.y+h.y*m.facing.x;p<m.frontD&&b>=m.latMin&&b<=m.latMax&&l++}return l/r>=py};return a("left")&&a("right")}function Wy(e,t){if(t.plane.floorIndex!==e.plane.floorIndex||t.facing.x*e.facing.x+t.facing.y*e.facing.y<vy)return!1;let n=1/0,o=-1/0,r=1/0;for(let s of t.hull){let c=-s.x*e.facing.y+s.y*e.facing.x;n=Math.min(n,c),o=Math.max(o,c),r=Math.min(r,-(s.x*e.facing.x+s.y*e.facing.y))}let i=(e.frontD-r)*fe;if(i<-Sy||i>wy)return!1;let a=Math.max(n-e.latMax,e.latMin-o);return a*fe<=Py&&a*fe>=-Ay}function Xy(e,t=!1,n=!1,o){let r=t?ry:oy,i=new Set(n?[]:e.filter(p=>!p.authored&&jy(p,e))),a=[...e].sort((p,b)=>p.plane.floorIndex-b.plane.floorIndex||Number(i.has(b))-Number(i.has(p))||p.frontDistance-b.frontDistance);for(let p of i)o?.add(p.id);let s=(p,b,y)=>{let M=new Map,S=[],A=new Map,x=g=>{if(g.plane.floorIndex===0||g.plane.baseHeightM>0)return g.plane.baseHeightM;let w=A.get(g.plane.floorIndex-1);return w===void 0?g.plane.baseHeightM:w+du};for(let g of a){if(i.has(g))g.height=x(g),g.level=0,g.rake=0,g.backHeight=g.height,M.set(g.id,void 0);else if(!g.authored){let v=x(g),P;for(let I of S){if(I.plane.floorIndex>g.plane.floorIndex)continue;if(Hy(g,I)){let O=Uy(g,I)+uy;O>v&&(v=O,P=I);continue}let C=Gy(g,I,i.has(I));if(C==null)continue;let L=n&&!!g.plane.stageDeck&&I.level===0&&I.plane.floorIndex===g.plane.floorIndex&&Math.max(0,C)*fe<=fy,N=i.has(I)?I.height+yy:L?I.backHeight:I.backHeight+Z0+Math.min(q0,Math.max(0,C)*fe)*Math.tan(I.rake*Math.PI/180);N>v&&(v=N,P=I)}let R=p.get(g);R&&R.height>v+.01?(v=R.height,P=void 0):R=void 0,g.height=Math.round(Math.min(v,g.plane.baseHeightM+ny)*100)/100;let k=!P&&!R&&g.height>g.plane.baseHeightM;if(g.level=P?P.level+1:R?R.level:k?1:0,g.rake=Vy(g.rowDepths,g.frontDistance,g.height,g.plane.focalHeightM),!g.facesAction&&g.rowCount<sy)g.rake=0;else if(g.level===0){let I=Math.max(1e-6,(g.backD-g.frontD)*fe);g.rake=Math.min(g.rake,ey,Math.round(Math.atan(ty/I)*1800/Math.PI)/10)}else g.rowCount>=2&&(g.rake=Math.max(g.rake,r[Math.min(g.level,r.length)-1]));let F=(g.backD-g.frontD)*fe,E=P&&i.has(P)||R&&y?.has(R.id);if(b!==void 0&&E&&g.rowCount>=2&&(g.rake=b),t&&F>0&&g.height+F*Math.tan(g.rake*Math.PI/180)>g.plane.baseHeightM+pu){let I=Math.max(0,g.plane.baseHeightM+pu-g.height);g.rake=Math.max(gu,Math.round(Math.atan(I/F)*1800/Math.PI)/10)}n&&g.plane.stageDeck&&g.level>0&&(g.rake=Math.min(g.rake,dy)),g.backHeight=g.height+F*Math.tan(g.rake*Math.PI/180),M.set(g.id,P?.id??(R?M.get(R.id):void 0))}let w=g.plane.floorIndex;A.set(w,Math.min(A.get(w)??1/0,g.height)),S.push(g)}return M},c=s(new Map),l=new Map,u=p=>l.get(p)?.height??p.height;for(let p=!0,b=0;p&&b<e.length;b++){p=!1;for(let y of e)if(!(y.authored||i.has(y)))for(let M of e){let S=l.get(M)??M;M===y||S.height-S.plane.baseHeightM<Iy||S.height<=u(y)+.01||Wy(y,M)&&(l.set(y,S),p=!0)}}let m=new Map(e.map(p=>[p.id,p])),f=e.filter(p=>!p.authored&&p.rowCount>=2&&i.has(m.get(c.get(p.id)??""))),d=f.length?aa(f.map(p=>p.rake)):void 0;if(!l.size&&d===void 0)return c;let h=new Map([...new Set(l.values())].map(p=>[p,{...p}]));return s(new Map([...l].map(([p,b])=>[p,h.get(b)])),d,new Set(f.map(p=>p.id)))}var ra=(e,t)=>!!e&&e.x===t.x&&e.y===t.y;function xr(e,t={x:0,y:-40}){let n=yn(e),o=new Map;for(let y of n){if(!y.sectionId)continue;let M=o.get(y.sectionId);M?M.push(y):o.set(y.sectionId,[y])}let r={focalInferred:!1,confident:!1,sections:[]},i=e.floors?.length?e.floors.map((y,M)=>({objects:y.objects,floorIndex:M,floorId:y.id,baseHeightM:y.baseHeightM??0,focal:y.focalPoint??e.focalPoint})):[{objects:e.objects,floorIndex:0,floorId:void 0,baseHeightM:0,focal:e.focalPoint}],a=new Set(i.flatMap(y=>y.objects.filter(M=>M.type==="table").map(M=>M.id))),s=[],c,l=new Set,u=i.map(y=>{let M=E=>!e.floors?.length||E.floorId===y.floorId,S=Ny(n.filter(E=>!E.sectionId&&E.kind!=="booth"&&!a.has(E.rowId)&&M(E))),A=[];for(let E of S){let I=at(pt(Su(E)),Cy/fe);if(n.some(L=>!M(L)&&ca(L,I)))continue;let C=`${bu}${y.floorIndex}-${A.length}`;l.add(C),o.set(C,E),A.push({type:"section",id:C,label:"",color:_y,outline:I})}let x=A.length?{...y,objects:[...y.objects,...A]}:y,g=new Set(x.objects.filter(E=>E.type==="section").map(E=>E.logicalSectionId??E.id)),w=[...o.entries()].filter(([E])=>g.has(E)).flatMap(([,E])=>E),v=Fy(x.objects,sa(w),w),P=x.focal;(v||x.focal&&!ra(x.focal,t))&&(r.confident=!0),v&&(r.stage??={id:v.shape.id,inferred:v.inferred,...x.floorId?{floorId:x.floorId}:{}},(v.inferred||ra(x.focal,t))&&(P=v.centre,r.focalInferred=!0));let R=v&&(!v.inferred||po(v.outline)*fe*fe<=oa),k=v?void 0:c,F={tableIds:a,floorIndex:x.floorIndex,floorId:x.floorId,baseHeightM:x.baseHeightM,focal:k?.focal??P,outline:v?.outline??k?.outline,focalHeightM:k?.focalHeightM??x.baseHeightM+(v&&R?ct({...v.shape,role:"stage"}).heightM:0),stageDeck:k?.stageDeck??!!(v&&R&&po(v.outline)*fe*fe<=oa),middle:w.length?{x:w.reduce((E,I)=>E+I.x,0)/w.length,y:w.reduce((E,I)=>E+I.y,0)/w.length}:P};for(let E of x.objects){if(E.type!=="section")continue;let I=By(E,o.get(E.logicalSectionId??E.id)??[],F);I&&s.push(I)}return F.outline&&(c=F),ra(x.focal,F.focal)||(r.focal??=[]).push({...x.floorId?{floorId:x.floorId}:{},point:{...F.focal}}),{unit:x,plane:F,stage:v,planeSeats:w}}),m=i.flatMap(y=>y.objects).map(y=>y.type==="shape"&&!y.role&&(na(y.label)==="wall"||!na(y.label)&&hu(y))?{...y,role:"wall"}:y),f=kt({objects:m},n)!==null;f&&(r.indoor=!0);let d=new Set,h=Xy(s,f,zy(n,u[0]?.plane.focal??t)<my,d),p=new Map(s.filter(y=>!y.authored).map(y=>[y.id,y])),b=u.map(({unit:y,plane:M,stage:S,planeSeats:A})=>y.objects.map(x=>{let g=x.type==="shape"&&!x.role&&x.id!==S?.shape.id?na(x.label):null;if(x.type==="shape"&&!x.role&&x.id!==S?.shape.id&&(g==="wall"||!g&&hu(x))&&x.type==="shape"){(r.roles??=[]).push({id:x.id,...M.floorId?{floorId:M.floorId}:{},role:"wall"});let{fill:I,...C}=x;return{...C,role:"wall"}}if(g&&x.type==="shape")return(r.roles??=[]).push({id:x.id,...M.floorId?{floorId:M.floorId}:{},role:g}),{...x,role:g};let v=S?.inferred&&x.id===S.shape.id&&x.type==="shape"?Ly(x,S.outline,y.objects,A):null;if(v&&x.type==="shape")return r.stage?.id===x.id&&(r.stage.field=v),{...x,role:"stage",stageKind:v};let P=x.type==="shape"&&x.id===S?.shape.id&&x.heightM===void 0&&!x.stageKind&&s.some(I=>I.plane===M&&(d.has(I.id)||I.level===0&&I.facesAction&&I.rake<=xy&&(I.frontDistance+I.backD-I.frontD)*fe>=My)),R=P?{heightM:gy}:{};if(S?.inferred&&x.id===S.shape.id&&x.type==="shape"&&po(S.outline)*fe*fe<=oa)return r.stage?.id===x.id&&(r.stage.deck=!0),{...x,role:"stage",...R};if(P&&x.type==="shape"&&x.role==="stage")return{...x,...R};let k=x.type==="section"?p.get(x.id):void 0;if(!k||x.type!=="section")return x;let F=k.rowCount>=2&&k.rake>0;l.has(k.id)?r.looseRowBlocks=(r.looseRowBlocks??0)+1:r.sections.push({id:k.id,floorId:M.floorId,surfaceKind:F?"rakedRows":"flat",height:k.height,rake:k.rake,stackedOn:h.get(k.id)});let E={status:"inferred",source:"public-2d-topology",note:ky};return{...x,height:k.height,rake:k.rake,surfaceKind:F?"rakedRows":"flat",physical3dProvenance:{height:E,rake:E,surfaceKind:E}}}));if(e.floors?.length){let y=e.floors.map((M,S)=>({...M,objects:b[S],focalPoint:u[S].plane.focal}));return{doc:{...e,floors:y,objects:y[0].objects,focalPoint:y[0].focalPoint},report:r}}return{doc:{...e,objects:b[0],focalPoint:u[0].plane.focal},report:r}}var wu=/^[\p{L}\p{N}]{1,4}$/u,Yy=/^([\p{L}\p{N}]{2,})[\s\-\u2013\u2014\u00b7_./]+(.+)$/u;function Pu(e,t){let n=t?.trim();if(!n)return e;let o=e.toLocaleLowerCase("en-US"),r=n.toLocaleLowerCase("en-US");if(o.startsWith(`${r} `)){let a=e.slice(n.length).trim();if(wu.test(a))return a}let i=Yy.exec(e);if(i){let a=i[1].toLocaleLowerCase("en-US"),s=i[2].trim();if((r.startsWith(a)||a.startsWith(r))&&wu.test(s))return s}return e}var Au={inline:"Inline booth \xB7 1 open side",corner:"Corner booth \xB7 2 open sides",peninsula:"Peninsula booth \xB7 3 open sides",island:"Island booth \xB7 4 open sides"},Ky=new Map(fi.map(e=>[e.key,e.label]));function $y(e){return`picker.access.${e}`}function Iu(e){let t=[],n=e.boothType;n&&Object.prototype.hasOwnProperty.call(Au,n)&&t.push({key:`booth:${n}`,icon:"booth",titleKey:`picker.boothType.${n}`,titleFallback:Au[n],tone:"place"});let o=e.wheelchairSpaceType;for(let s of e.accessibility??[]){if(s==="wheelchair"&&o)continue;let c=Ky.get(s);c&&t.push({key:`access:${s}`,icon:s,titleKey:$y(s),titleFallback:c,tone:"access"})}o==="no-seat"?t.push({key:"wheelchair:no-seat",icon:"wheelchair",titleKey:"picker.emptyWheelchairSpace",titleFallback:"Empty wheelchair space",tone:"access"}):o==="seat-present"&&t.push({key:"wheelchair:seat-present",icon:"wheelchair",titleKey:"picker.accessiblePhysicalSeat",titleFallback:"Accessible physical seat",tone:"access"}),e.aisle===!0&&t.push({key:"place:aisle",icon:"aisle",titleKey:"picker.aisleSeat",titleFallback:"Aisle seat",tone:"place"});let r=e.commercial;r?.restrictedView&&t.push({key:"mark:restrictedView",icon:"restrictedView",titleKey:"picker.restrictedView",titleFallback:"Restricted view",tone:"warn"}),r?.obstructedView&&t.push({key:"mark:obstructedView",icon:"obstructedView",titleKey:"picker.obstructedView",titleFallback:"Obstructed view",tone:"warn"}),r?.premium&&t.push({key:"mark:premium",icon:"premium",titleKey:"picker.premiumSeat",titleFallback:"Premium seat",tone:"premium"});let i=r?.note?.trim();if(i){let s=t.find(c=>c.tone==="warn"||c.tone==="premium");s?s.note=i:t.push({key:"note",icon:"note",titleKey:"picker.organizerNote",titleFallback:"Organizer note",tone:"note",note:i})}let a=typeof e.entrance=="string"?e.entrance.trim():"";return a&&t.push({key:"place:entrance",icon:"entrance",titleKey:"picker.entrance",titleFallback:"Entrance",tone:"place",note:a}),t}function Ru(e,t,n){return n<0?t>1?e.filter(o=>o.kind==="floor"):[...e]:e.filter(o=>o.floorIndex===void 0||o.floorIndex===n)}function Eu(e,t){let n=[...e].sort((r,i)=>r.screen.y-i.screen.y),o=[];for(let r of n){let i=o.find(a=>a.some(s=>Math.abs(s.screen.x-r.screen.x)<104&&Math.abs(s.screen.y-r.screen.y)<34));i?i.push(r):o.push([r])}return o.flatMap(r=>r.length<2?r:r.map((i,a)=>({...i,screen:{...i.screen,x:Math.max(54,Math.min(t-54,i.screen.x+(a-(r.length-1)/2)*104))}})))}var Zy=1.15,qy=2.75,Qy=4.5,Jy=.85,eg=.5,tg=.26;function Cu(e,t,n){let o=Math.max(1e-6,t),r=e/o,i=n?.hasZoneLabels??!0,a=new Set(["stage","gate"]);return r>=.75&&a.add("floor"),r>=Zy&&a.add("zone"),r<=(i?qy:Qy)&&(a.add("section"),a.add("ga")),r<=Jy&&(a.add("annotation"),a.add("booth")),r<=eg&&a.add("row"),r<=tg&&a.add("seat"),a}function _u(e,t,n,o,r,i=6){let a=i+t,s=o-i-t,c=i+n,l=r-i-n;return{...e,x:a>s?o/2:Math.max(a,Math.min(s,e.x)),y:c>l?r/2:Math.max(c,Math.min(l,e.y))}}function gt(e,t,n,o){let r=e,i=t[0],a=t[1],s=t[2],c=r[0]*i+r[4]*a+r[8]*s+r[12],l=r[1]*i+r[5]*a+r[9]*s+r[13],u=r[2]*i+r[6]*a+r[10]*s+r[14],m=r[3]*i+r[7]*a+r[11]*s+r[15];if(!(m>1e-6))return{x:0,y:0,depth:1/0,visible:!1};let f=c/m,d=l/m,h=u/m,p=f>=-1.05&&f<=1.05&&d>=-1.05&&d<=1.05&&h<=1;return{x:(f*.5+.5)*n,y:(1-(d*.5+.5))*o,depth:h,visible:p}}function Tu(e,t,n=t,o=()=>0){let r=[],i=[...e].sort((a,s)=>o(s)-o(a)||a.screen.depth-s.screen.depth);for(let a of i){let s=!1;for(let c of r)if(bo(a,c,t,n)){s=!0;break}s||r.push(a)}return r}var ng=6;function bo(e,t,n,o){let r=Math.abs(e.screen.x-t.screen.x),i=Math.abs(e.screen.y-t.screen.y),a=e.halfWidth!=null&&t.halfWidth!=null?Math.max(n,e.halfWidth+t.halfWidth+ng):n;return r<a&&i<o}function Lu(e,t,n){return e.length*t*.58+(n?14:0)}var og={row:8,seat:14};function ku(e){return e<480?{row:5,seat:8}:e<768?{row:6,seat:10}:og}function Ou(e,t,n,o){let r=Math.max(1,Math.min(n,o)*.5),i=Math.min(2,Math.hypot(e.x-n/2,e.y-o/2)/r);return t*(1+1.5*i)}function yo(e,t,n,o,r=[]){let i=[...e].sort((s,c)=>(c.priority??0)-(s.priority??0)||s.focus-c.focus),a=[];for(let s of i){if(a.length>=o)break;let c=!1;for(let l of r)if(bo(s,l,t,n)){c=!0;break}if(!c){for(let l of a)if(bo(s,l,t,n)){c=!0;break}}c||a.push(s)}return a}function ua(e,t,n,o){let r=e[3]*t[0]+e[7]*t[1]+e[11]*t[2]+e[15];return r<=0||!(n>0)?0:n*Math.hypot(e[0],e[4],e[8])*o/(2*r)}var rg=1.5,ig=30,ag=4,sg=3.6,cg=6,ma=15,lg=3,ug=1;function mg(e){return Math.max(sg,Math.min(cg,2.4+.15*e))}var go=Math.PI*2;function fg(e,t){let n=0,o=0;for(let m of e)n+=m.x,o+=m.y;let r=Math.atan2(o/e.length-t.y,n/e.length-t.x),i=e.map(m=>{let f=Math.atan2(m.y-t.y,m.x-t.x)-r;for(;f>Math.PI;)f-=go;for(;f<-Math.PI;)f+=go;return f+r}),a=i.map((m,f)=>f).sort((m,f)=>i[m]-i[f]),s=i[a[0]],c=i[a[a.length-1]];if(c-s>Math.PI)return null;let l=m=>Math.hypot(m.x-t.x,m.y-t.y),u=m=>{let f=e[m],d=(m+e.length-1)%e.length,h=(m+1)%e.length,p=Math.abs(i[d]-i[m])<=Math.abs(i[h]-i[m])?d:h,b=e[p];return l(f)<=l(b)?[f,b]:[b,f]};return{start:s,end:c,startEdge:u(a[0]),endEdge:u(a[a.length-1])}}function Fu(e){return e.type==="shape"&&e.role==="wall"&&e.heightM===void 0}function fa(e,t,n=()=>!0){let o=[];for(let c of e){if(!Fu(c)||!n(c))continue;let l=xe(c);if(!l||l.length<3)continue;let u=fg(l,t);if(!u)return[];o.push(u)}if(o.length<2)return[];let r=e.flatMap(c=>{if(c.type!=="shape"||c.role!=="entrance"&&c.role!=="exit")return[];let l=xe(c);if(!l?.length)return[];let u=0,m=0;for(let f of l)u+=f.x,m+=f.y;return[{x:u/l.length,y:m/l.length}]}),i=c=>(c%go+go)%go;o.sort((c,l)=>i(c.start)-i(l.start));let a=c=>Math.hypot(c.x-t.x,c.y-t.y),s=[];for(let c=0;c<o.length;c++){let l=o[c],u=o[(c+1)%o.length],m=i(u.start-l.end);if(m<=0||m>=Math.PI/2)continue;let f=g=>i(g-l.end)<m;if(o.some(g=>g!==l&&g!==u&&(f(g.start)||f(g.end)||i(l.end-g.start)<g.end-g.start)))continue;let[h,p]=l.endEdge,[b,y]=u.startEdge,M={x:(h.x+p.x)/2,y:(h.y+p.y)/2},S={x:(b.x+y.x)/2,y:(b.y+y.y)/2},A=Math.hypot(S.x-M.x,S.y-M.y)*_;if(A<rg||A>ig||Math.abs(a(M)-a(S))*_>ag+.2*A)continue;let x={x:(M.x+S.x)/2,y:(M.y+S.y)/2};r.some(g=>f(Math.atan2(g.y-t.y,g.x-t.x))&&Math.abs(a(g)-a(x))*_<=lg)||s.push({quad:[h,p,y,b],mid:x,widthM:A,openingM:mg(A)})}return s}function Du(e,t){let n=[];for(let i of t)if(i.text?.trim())for(let a of e){let s=Math.hypot(i.position.x-a.mid.x,i.position.y-a.mid.y)*_;s<=ma&&n.push({text:i,gate:a,d:s})}n.sort((i,a)=>i.d-a.d);let o=new Map,r=new Set;for(let{text:i,gate:a}of n)o.has(i.id)||r.has(a)||(o.set(i.id,a),r.add(a));return o}function Nu(e,t,n,o,r,i,a,s=()=>!0){let c=fa(t,In(n),s);if(!c.length)return;let l=t.find(m=>Fu(m)&&s(m)),u=fr(l?.fill,a);e.setMaterial(or);for(let m of c)r-m.openingM<ug||ir(e,m.quad,o+m.openingM,o+r,[],u.top,u.wall,i,r);e.setMaterial(0)}var dg=6,hg=2.2,Mr=.1,pg=/^(gate|entrance|entry|exit|way in|way out|door)s?$/i,bg=new Set(["stage","entrance","exit","screen","suite","obstruction","sound","bar","concession","restroom","coat"]),yg=.3,gg=1.8,xg=.9,Mg=.55,vg=1,Bu=4e3,Sg=6,Vu="#d8a425",wg="#e8c15a",da="#1c1608";function Gu(e){let t=Pg(e);if(!t)return null;let n=Iu(e).find(o=>o.icon===t.icon);return{...t,name:n?.titleFallback??t.icon}}function Pg(e){let t=e.accessibility;if(t?.length)return{icon:t.includes("wheelchair")?"wheelchair":t[0],color:Vo(t)};let n=e.commercial;return n?.obstructedView?{icon:"obstructedView",color:Vu,ink:da}:n?.restrictedView?{icon:"restrictedView",color:Vu,ink:da}:n?.premium?{icon:"premium",color:wg,ink:da}:null}function Ag(e,t){if(!e)return;let n,o=0;for(let[i,a]of e)a>o&&(o=a,n=i);let r=t.categories?.find(i=>i.key===n)?.color;return r&&/^#[0-9a-f]{6}$/i.test(r)?r:void 0}var Ig=6e3,Rg=.25,Hu=[-90,90,-135,135,-45,45];function Eg(e,t,n,o){let r=e.flatMap(({id:a,a:s,members:c})=>{let l=(s.minX+s.maxX)/2,u=(s.minY+s.maxY)/2,m=.5*Math.hypot(s.maxX-s.minX,s.maxY-s.minY),f=1/0;for(let d of c)f=Math.min(f,Math.hypot(t[d].x-l,t[d].y-u));return c.length&&f>=m*Rg?[{id:a,cx:l,cy:u,half:m,members:c}]:[]}).sort((a,s)=>a.half-s.half),i=new Map;return r.forEach(({id:a,cx:s,cy:c,members:l},u)=>{let m=o.x-s,f=o.y-c,p=(Math.hypot(m,f)>1e-6?Math.atan2(f,m):0)+Hu[u%Hu.length]*Math.PI/180,b=Math.cos(p),y=Math.sin(p),M=-1,S=-1/0;for(let A of l){let x=(t[A].x-s)*b+(t[A].y-c)*y;x>S&&(S=x,M=A)}i.set(a,[t[M].x*_,n.seatDeckY(M),t[M].y*_])}),i}function Uu(e){let{doc:t,units:n,seats:o,surfaces:r,focal:i}=e,a=t.zones??[],s=[];if(a.length){let c=new Map;for(let f of n)for(let d of f.objects)d.type==="section"&&d.zone&&c.set(d.id,d.zone);let l=new Map,u=new Map;for(let f=0;f<o.length;f++){let d=o[f],h=r.seatOwner[f],p=d.zoneId??(h?c.get(h):void 0);if(!p)continue;let b=l.get(p);b||(b={n:0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,sumY:0},l.set(p,b));let y=u.get(p);y||u.set(p,y=[]),y.push(f),b.n++,d.x<b.minX&&(b.minX=d.x),d.y<b.minY&&(b.minY=d.y),d.x>b.maxX&&(b.maxX=d.x),d.y>b.maxY&&(b.maxY=d.y),b.sumY+=r.seatDeckY(f)}let m=Eg(a.flatMap(f=>{let d=l.get(f.id);return d?[{id:f.id,a:d,members:u.get(f.id)??[]}]:[]}),o,r,i);for(let f of a){let d=l.get(f.id),h=[];for(let[p,b]of c)b===f.id&&h.push(p);if(!d||d.n===0){s.push({id:f.id,label:f.label,color:ye(f.color),sectionIds:h,seatCount:0,center:[0,0,0],radius:0,focalWorld:[(f.focalPoint??i).x*_,1.5,(f.focalPoint??i).y*_]});continue}s.push({id:f.id,label:f.label,color:ye(f.color),sectionIds:h,seatCount:d.n,...m.has(f.id)?{labelAt:m.get(f.id)}:{},center:[(d.minX+d.maxX)/2*_,d.sumY/d.n,(d.minY+d.maxY)/2*_],radius:.5*Math.hypot((d.maxX-d.minX)*_,(d.maxY-d.minY)*_)||1,focalWorld:[(f.focalPoint??i).x*_,1.5,(f.focalPoint??i).y*_]})}}return s}function ju(e){let{doc:t,units:n,seats:o,surfaces:r,seatData:i,hintedSeatFloor:a,zones:s,focal:c}=e,l=[],u=[],m=[],f=new Map;for(let d of n)for(let h of d.objects){if(h.type!=="section"||!h.zone)continue;let p=(h.displayLabel||h.label||"").trim().toLocaleLowerCase();if(!p)continue;let b=t.floors?.[d.index]?.name?.trim().toLocaleLowerCase();if(n.length>1&&b===p)continue;let y=f.get(h.zone);y||f.set(h.zone,y=new Set),y.add(p)}for(let d of s)d.seatCount!==0&&(f.get(d.id)?.has(d.label.trim().toLocaleLowerCase())||l.push({id:`zone:${d.id}`,kind:"zone",text:d.label,anchor:[(d.labelAt??d.center)[0],(d.labelAt??d.center)[1]+dg,(d.labelAt??d.center)[2]],color:t.zones?.find(h=>h.id===d.id)?.color}));{let d=new Map,h=new Map,p=new Map,b=new Map;for(let y=0;y<o.length;y++){let M=r.seatOwner[y];if(!M)continue;let S=d.get(M);S||(S={n:0,x:0,y:0,deck:0},d.set(M,S)),S.n++,S.x+=o[y].x,S.y+=o[y].y,S.deck+=r.seatDeckY(y);let A=o[y].categoryKey;if(A){let g=h.get(M);g||(g=new Map,h.set(M,g)),g.set(A,(g.get(A)??0)+1)}if(o[y].accessibility?.includes("wheelchair")){let g=p.get(M);g?g.push(y):p.set(M,[y])}let x=b.get(M);x||(x={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0,minDeck:1/0,maxDeck:-1/0},b.set(M,x)),x.minDeck=Math.min(x.minDeck,r.seatDeckY(y)),x.maxDeck=Math.max(x.maxDeck,r.seatDeckY(y)),o[y].x<x.minX&&(x.minX=o[y].x),o[y].x>x.maxX&&(x.maxX=o[y].x),o[y].y<x.minY&&(x.minY=o[y].y),o[y].y>x.maxY&&(x.maxY=o[y].y)}for(let y of n)for(let M of y.objects){if(M.type!=="section"||yu(M))continue;let S=d.get(M.id);if(!S||S.n===0)continue;let A=b.get(M.id),x=[S.x/S.n*_,S.deck/S.n,S.y/S.n*_],g=M.displayLabel||M.label||M.id;u.push({id:M.id,floorIndex:y.index,label:g,seatCount:S.n,center:x,radius:Math.max(1,Math.hypot(A.maxX-A.minX,A.maxY-A.minY)*.5*_),box:{min:[A.minX*_-.4,A.minDeck,A.minY*_-.4],max:[A.maxX*_+.4,A.maxDeck+1,A.maxY*_+.4]},focalWorld:[y.focal.x*_,y.baseHeightM+1.5,y.focal.y*_]});let w=t.floors?.[y.index]?.name?.trim().toLocaleLowerCase();if(!(n.length>1&&w===g.trim().toLocaleLowerCase())){let v=Ag(h.get(M.id),t),P=p.get(M.id);l.push({id:`section:${M.id}`,kind:"section",text:g,anchor:[x[0],x[1]+hg,x[2]],floorIndex:y.index,...v?{tint:v}:{},...P?{wheelchairSeats:P}:{}})}}}{for(let x of n)for(let g of x.objects){if(g.type!=="gaArea")continue;let w=fn(g.points);if(!w)continue;let v=g.labelPresentation?.visible===!1?"":g.displayLabel||g.label||g.id,P=g.capacity>0?[v,g.capacity.toLocaleString()].filter(Boolean).join(" \xB7 "):v;P&&l.push({id:`ga:${g.id}`,kind:"ga",text:P,anchor:[w.x*_,x.baseHeightM+gg,w.y*_],floorIndex:x.index})}let d=new Map,h=new Map;for(let x of n)for(let g of x.objects)if(g.type==="section"&&d.set(g.id,g.displayLabel||g.label||g.id),g.type==="row"){let w=g.displayLabel?.trim()||g.segmentedRow?.displayLabel?.trim();w&&h.set(g.id,w)}let p=new Map;for(let x=0;x<o.length;x++){let g=o[x],w=Math.hypot(g.x-c.x,g.y-c.y),v=p.get(g.rowId);(!v||w>v.far)&&p.set(g.rowId,{seat:g,index:x,far:w})}for(let[x,g]of p){let w=r.seatOwner[g.index]??g.seat.sectionId,v=zu(g.seat.label,x,d.get(w??""),h.get(x));v&&l.push({id:`row:${x}`,kind:"row",text:v,anchor:[g.seat.x*_,r.seatDeckY(g.index)+xg,g.seat.y*_],floorIndex:a[g.index]})}let b=new Map;for(let x=0;x<o.length;x++){let g=o[x],w=b.get(g.rowId);w||(w={n:0,x:0,y:0,z:0,minX:1/0,maxX:-1/0,minZ:1/0,maxZ:-1/0,label:zu(g.label,g.rowId,d.get(r.seatOwner[x]??g.sectionId??""),h.get(g.rowId)),sectionId:r.seatOwner[x]??g.sectionId},b.set(g.rowId,w));let v=x*3,P=i.iPosition[v],R=i.iPosition[v+1],k=i.iPosition[v+2];w.n++,w.x+=P,w.y+=R,w.z+=k,w.minX=Math.min(w.minX,P),w.maxX=Math.max(w.maxX,P),w.minZ=Math.min(w.minZ,k),w.maxZ=Math.max(w.maxZ,k)}for(let[x,g]of b)m.push({id:x,label:g.label,sectionId:g.sectionId,seatCount:g.n,center:[g.x/g.n,g.y/g.n,g.z/g.n],radius:Math.max(.8,Math.hypot(g.maxX-g.minX,g.maxZ-g.minZ)*.5)});let y=0,M=(x,g)=>{y++,l.push({id:`access:${o[x].id}`,kind:"access",text:g.name,icon:g.icon,color:g.color,...g.ink?{ink:g.ink}:{},seatWidthM:i.iChairWidth[x]*2,anchor:[o[x].x*_,r.seatDeckY(x)+vg,o[x].y*_],floorIndex:a[x],rowId:o[x].rowId})},S=null,A=()=>{if(S){let x=Gu(o[S.seats[0]]),g=S.seats.length,w=Math.max(1,Math.round(g/Sg));for(let v=0;v<w&&y<Bu;v++)M(S.seats[Math.min(g-1,Math.floor((v+.5)*g/w))],x)}S=null};for(let x=0;x<o.length&&y<Bu;x++){let g=Gu(o[x]);if(g&&o[x].accessibility?.length){A(),M(x,g);continue}if(!g){A();continue}S&&S.rowId===o[x].rowId&&S.icon===g.icon?S.seats.push(x):(A(),S={rowId:o[x].rowId,icon:g.icon,seats:[x]})}if(A(),o.length<=Ig)for(let x=0;x<o.length;x++){let g=o[x],w=ha(g.displayLabel||g.label);w&&l.push({id:`seat:${g.id}`,kind:"seat",seatWidthM:i.iChairWidth[x]*2,text:w,anchor:[g.x*_,r.seatDeckY(x)+Mg,g.y*_],floorIndex:a[x],rowId:g.rowId})}}for(let d of n){let h=kt(d,n.length===1?o:o.filter((y,M)=>a[M]===d.index)),p=h?Du(fa(d.objects,In(h)),d.objects.filter(y=>y.type==="text")):new Map,b=[...p.values()];for(let y of d.objects){let M=y.type==="text"?p.get(y.id):void 0;if(y.type==="shape"&&(y.role==="entrance"||y.role==="exit")&&pg.test(y.label?.trim()??"")){let S=xe(y),A=S?fn(S):null;if(A&&b.some(x=>Math.hypot(A.x-x.mid.x,A.y-x.mid.y)*_<=ma+x.widthM))continue}if(M&&y.type==="text")l.push({id:`text:${y.id}`,kind:"gate",text:y.text,icon:"entrance",anchor:[M.mid.x*_,d.baseHeightM+M.openingM+Mr,M.mid.y*_],color:y.color,floorIndex:d.index});else if(y.type==="shape"&&y.role&&bg.has(y.role)){let S=xe(y),A=S?fn(S):null;if(!A||!y.label||y.gate?.hideFromBuyers)continue;l.push({id:`architecture:${y.id}`,kind:y.role==="stage"?"stage":y.role==="entrance"||y.role==="exit"?"gate":"annotation",text:y.label,...y.role==="entrance"||y.role==="exit"?{icon:y.role}:{},...y.gate?.stepFree?{stepFree:!0}:{},anchor:[A.x*_,d.baseHeightM+ct(y).heightM+Mr,A.y*_],color:y.fill,floorIndex:d.index})}else if(y.type==="text"){let S=y.semanticKind==="icon"?so(y.iconKey)?.key:void 0,A=y.text||(S?so(S).label:"");if(!A)continue;l.push({id:`text:${y.id}`,kind:"annotation",text:A,...S?{venueIcon:S}:{},anchor:S?[(y.position.x+y.fontSize/2)*_,d.baseHeightM+Mr,(y.position.y+y.fontSize/2)*_]:[y.position.x*_,d.baseHeightM+Mr,y.position.y*_],color:y.color,rotation:y.rotation,floorIndex:d.index})}else if(y.type==="booth"){if(y.labelPresentation?.visible===!1)continue;let S=lt(y);if(!S)continue;let A=fn(S);if(!A)continue;l.push({id:`booth:${y.id}`,kind:"booth",text:y.displayLabel||y.label||y.id,anchor:[A.x*_,d.baseHeightM+dr+yg,A.y*_],floorIndex:d.index})}}}return{labels:l,sections:u,rows:m}}function Wu(e,t){if(t.length>1)for(let n of t)e.push({id:`floor:${n.id}`,kind:"floor",text:n.label,anchor:[n.center[0],n.box.max[1]+1.2,n.center[2]],floorIndex:n.index})}function ha(e){let t=e.lastIndexOf("-");return t>=0&&t<e.length-1?e.slice(t+1):e}function zu(e,t,n,o){if(o?.trim())return o.trim();let r=e?e.lastIndexOf("-"):-1,i=r>0?e.slice(0,r):t;return i&&Pu(i,n)}function Xu(e){let{doc:t,units:n,seats:o,surfaces:r,solids:i,hintedSeatFloor:a,seatFloor:s}=e,c=[];{let l=n.map(()=>({minX:1/0,minY:1/0,minZ:1/0,maxX:-1/0,maxY:-1/0,maxZ:-1/0}));for(let f=0;f<i.floor.length;f+=1){let d=Math.max(0,Math.min(n.length-1,Math.round(i.floor[f]))),h=f*3,p=l[d];p.minX=Math.min(p.minX,i.position[h]),p.minY=Math.min(p.minY,i.position[h+1]),p.minZ=Math.min(p.minZ,i.position[h+2]),p.maxX=Math.max(p.maxX,i.position[h]),p.maxY=Math.max(p.maxY,i.position[h+1]),p.maxZ=Math.max(p.maxZ,i.position[h+2])}let u=new Map;for(let f=0;f<n.length;f++)for(let d of n[f].objects)d.type==="section"&&u.set(d.id,f);let m=n.map(()=>({n:0,minX:1/0,minY:1/0,minDeck:1/0,maxX:-1/0,maxY:-1/0,maxDeck:-1/0,sumX:0,sumDeck:0,sumZ:0}));for(let f=0;f<o.length;f++){let d=r.seatOwner[f],h=(d!==null?u.get(d):void 0)??a[f];if(h===void 0)continue;let p=m[h],b=o[f];p.n++,b.x<p.minX&&(p.minX=b.x),b.y<p.minY&&(p.minY=b.y),b.x>p.maxX&&(p.maxX=b.x),b.y>p.maxY&&(p.maxY=b.y);let y=r.seatDeckY(f);p.sumX+=b.x*_,p.sumDeck+=y,p.sumZ+=b.y*_,p.minDeck=Math.min(p.minDeck,y),p.maxDeck=Math.max(p.maxDeck,y+1.6),s[f]=h}for(let f=0;f<n.length;f++){let d=m[f],h=t.floors?.[f],p=l[f],b=Math.min(d.n?d.minX*_:n[f].focal.x*_-1,Number.isFinite(p.minX)?p.minX:1/0),y=Math.max(d.n?d.maxX*_:n[f].focal.x*_+1,Number.isFinite(p.maxX)?p.maxX:-1/0),M=Math.min(d.n?d.minY*_:n[f].focal.y*_-1,Number.isFinite(p.minZ)?p.minZ:1/0),S=Math.max(d.n?d.maxY*_:n[f].focal.y*_+1,Number.isFinite(p.maxZ)?p.maxZ:-1/0),A=Math.min(d.n?Math.min(n[f].baseHeightM,d.minDeck):n[f].baseHeightM,Number.isFinite(p.minY)?p.minY:1/0),x=Math.max(d.n?Math.max(d.maxDeck,A+.5):A+.5,Number.isFinite(p.maxY)?p.maxY:-1/0),g=[d.n?d.sumX/d.n:(b+y)/2,d.n?d.sumDeck/d.n:(A+x)/2,d.n?d.sumZ/d.n:(M+S)/2],w=Math.max(1,.5*Math.hypot(y-b,x-A,S-M));c.push({index:f,id:h?.id??`floor-${f}`,label:h?.name??(n.length>1?`Floor ${f+1}`:"Venue"),seatCount:d.n,center:g,radius:w,box:{min:[b,A,M],max:[y,x,S]},focalWorld:[n[f].focal.x*_,n[f].baseHeightM+1.5,n[f].focal.y*_]})}}return c}function pa(e,t){let n=1/0,o=1/0,r=-1/0,i=-1/0,a=(s,c)=>{s<n&&(n=s),c<o&&(o=c),s>r&&(r=s),c>i&&(i=c)};for(let s of t)a(s.x,s.y);for(let s of e)for(let c of s.objects)if(c.type==="section")for(let l of c.outline)a(l.x,l.y);else if(c.type==="shape"&&c.points)for(let l of c.points)a(l.x,l.y);else if(c.type==="gaArea")for(let l of c.points)a(l.x,l.y);else if(c.type==="booth"){let l=lt(c);if(l)for(let u of l)a(u.x,u.y)}else if(c.type==="table"){let l=hr(c);if(l)for(let u of l)a(u.x,u.y)}else if(c.type==="decorImage"){let l=pr(c);if(l)for(let u of l)a(u.x,u.y)}return Number.isFinite(n)||(n=-100,o=-100,r=100,i=100),{minX:n,minY:o,maxX:r,maxY:i}}function Qu(e,t,n,o,r,i,a){if(t.length===1){let s=n.map(f=>({x:f.x,y:f.y}));for(let f of t[0].objects)f.type==="section"?s.push(...f.outline):f.type==="shape"?s.push(...xe(f)??f.points??[]):f.type==="gaArea"?s.push(...f.points):f.type==="booth"?s.push(...lt(f)??[]):f.type==="table"?s.push(...hr(f)??[]):f.type==="decorImage"&&s.push(...pr(f)??[]);if($u(e,t[0],n,i)||qu(e,t[0],n,s,i))return!1;if(a&&Ku(e,t[0].baseHeightM,s,i,a))return!0;let c=co(s),l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2,m=c.length>=3?c.map(f=>{let d=f.x-l,h=f.y-u,p=Math.max(1,Math.hypot(d,h));return{x:f.x+d/p*80,y:f.y+h/p*80}}):Jn(r.minX-28,r.minY-28,r.maxX-r.minX+56,r.maxY-r.minY+56);return ue(e,m,void 0,()=>-.04,-.22,i.ground,i.ground,ae),!1}else{let s=t.reduce((b,y)=>y.baseHeightM<b.baseHeightM?y:b);e.setFloor(s.index);let c={...s,objects:t.flatMap(b=>b.objects)},l=n.map(b=>({x:b.x,y:b.y}));for(let b of c.objects)b.type==="section"&&l.push(...b.outline);if($u(e,c,n,i)||qu(e,c,n,l,i))return!1;if(a&&Ku(e,s.baseHeightM,l,i,a))return!0;let u=n.filter((b,y)=>o[y]===s.index),m=pa([s],u),f=Math.hypot(m.maxX-m.minX,m.maxY-m.minY),d=Math.max(28,Math.min(80,f*.04)),h=Jn(m.minX-d,m.minY-d,m.maxX-m.minX+d*2,m.maxY-m.minY+d*2),p=s.baseHeightM-.03;return ue(e,h,void 0,()=>p,p-.22,i.ground,i.ground,ae),!1}}function ba(e,t,n,o){let{cx:r,cz:i,radius:a}=n,s=1/0,c=1/0,l=1/0,u=-1/0,m=-1/0,f=-1/0,d=(b,y,M)=>{s=Math.min(s,b),u=Math.max(u,b),c=Math.min(c,y),m=Math.max(m,y),l=Math.min(l,M),f=Math.max(f,M)};for(let b=0;b<e.position.length;b+=3){let y=b/3;o&&y>=o[0]&&y<o[1]||d(e.position[b],e.position[b+1],e.position[b+2])}for(let b=0;b<t.count;b++){let y=b*3,M=t.iPosition[y],S=t.iPosition[y+1],A=t.iPosition[y+2],x=Math.max(.35,t.iMaxRadius[b]??.35);d(M-x,S,A-x),d(M+x,S+1.6,A+x)}Number.isFinite(s)||(s=r-a,u=r+a,c=0,m=a*.16,l=i-a,f=i+a);let h=[(s+u)/2,(c+m)/2,(l+f)/2],p=Math.max(1,.5*Math.hypot(u-s,m-c,f-l));return{center:h,radius:p,minY:c,maxY:m}}var Cg=4096;function Ju(e,t,n=[]){let o=Math.max(1,Math.ceil(e.count/Cg)),r=Math.ceil(e.count/o),i=new Float32Array((r*2+t.length*4+n.length)*3),a=0;for(let s=0;s<e.count;s+=o){let c=e.iPosition[s*3],l=e.iPosition[s*3+1],u=e.iPosition[s*3+2];i[a++]=c,i[a++]=l,i[a++]=u,i[a++]=c,i[a++]=0,i[a++]=u}for(let[s,c,l]of n)i[a++]=s,i[a++]=c,i[a++]=l;for(let s of t)for(let[c,l]of[[-1,-1],[1,-1],[1,1],[-1,1]])i[a++]=s.cx+c*s.halfX,i[a++]=s.y,i[a++]=s.cz+l*s.halfZ;return i.subarray(0,a)}function em(e,t,n,o,r,i,a=[]){let s=1/0,c=1/0,l=-1/0,u=-1/0;for(let x=0;x<e.count;x++){let g=x*3,w=e.iPosition[g],v=e.iPosition[g+2];w<s&&(s=w),w>l&&(l=w),v<c&&(c=v),v>u&&(u=v)}for(let[x,,g]of a)x<s&&(s=x),x>l&&(l=x),g<c&&(c=g),g>u&&(u=g);for(let x of t)s=Math.min(s,x.cx-x.halfX),l=Math.max(l,x.cx+x.halfX),c=Math.min(c,x.cz-x.halfZ),u=Math.max(u,x.cz+x.halfZ);let m=n.minX*_,f=n.maxX*_,d=n.minY*_,h=n.maxY*_,p=m,b=f,y=d,M=h;if(Number.isFinite(s)){let x=Math.max(2,.06*Math.hypot(l-s,u-c));p=Math.max(m,s-x),b=Math.min(f,l+x),y=Math.max(d,c-x),M=Math.min(h,u+x)}let S=Math.min(0,o),A=Math.max(r,i*.05);return{min:[p,S,y],max:[b,A,M]}}var Yu=12,_g=.6,Tg=40;function Ku(e,t,n,o,r){let i=co([...n]);if(i.length<3)return!1;let a=1/0,s=1/0,c=-1/0,l=-1/0;for(let A of i)a=Math.min(a,A.x),c=Math.max(c,A.x),s=Math.min(s,A.y),l=Math.max(l,A.y);let u=Math.hypot(c-a,l-s)*_,m=at(i,Yu/_,1.2),f=Math.max(Tg,u*_g),d=at(i,(Yu+f)/_,1.2);if(m.length!==d.length)return!1;let h=ge(o.ground,[.78,.76,.72],.35),p=ge(o.ground,[.56,.62,.52],.3);ue(e,m,void 0,()=>t-.04,t-.22,h,h,ae);let b=t-.05,y=m.map(A=>[A.x*_,b,A.y*_]),M=d.map(A=>[A.x*_,b,A.y*_]),S=[0,1,0];for(let A=0;A<y.length;A++){let x=(A+1)%y.length;e.tri(y[A],M[x],M[A],S,p,r,r),e.tri(y[A],y[x],M[x],S,p,p,r)}return!0}function $u(e,t,n,o){let r=kt(t,n);if(!r)return!1;let i=t.baseHeightM,a=ge(o.ground,[.62,.55,.47],.4);return ue(e,r,void 0,()=>i-.04,i-.22,a,a,ae),!0}var Lg=3e3,kg=20,Zu=1.5,Og=1.2,Fg=.25;function qu(e,t,n,o,r){if(!n.length||n.length>Lg||o.length<3)return!1;for(let P of t.objects){if(P.type==="shape"&&jo(P.stageKind))return!1;if(P.type==="section"){let{height:R}=Ct(P,{floorBaseHeightM:t.baseHeightM});if(R-t.baseHeightM>kg)return!1}}let i=0,a=0;for(let P of o)i+=P.x,a+=P.y;i/=o.length,a/=o.length;let s=0,c=0,l=0;for(let P of o){let R=P.x-i,k=P.y-a;s+=R*R,c+=k*k,l+=R*k}let u=.5*Math.atan2(2*l,s-c),m=Math.cos(u),f=Math.sin(u),d=-f,h=m,p=1/0,b=-1/0,y=1/0,M=-1/0;for(let P of o){let R=(P.x-i)*m+(P.y-a)*f,k=(P.x-i)*d+(P.y-a)*h;p=Math.min(p,R),b=Math.max(b,R),y=Math.min(y,k),M=Math.max(M,k)}let S=P=>[[p-P,y-P],[b+P,y-P],[b+P,M+P],[p-P,M+P]].map(([R,k])=>({x:i+m*R+d*k,y:a+f*R+h*k})),A=S(Zu/_),x=S((Zu+Fg)/_),g=t.baseHeightM,w=ge(r.ground,[.62,.55,.47],.4),v=ge(r.ground,[.86,.86,.84],.55);return ue(e,x,void 0,()=>g-.04,g-.22,w,w,ae),ue(e,x,[A.slice().reverse()],()=>g+Og,g-.04,ge(v,[1,1,1],.2),v,ae),!0}function tm(e,t,n){let o=()=>({byObjectId:new Map,elements:[]});if(!t||!e)return o();let r=bc(t);if(!r.ok||r.value.id!==e)return o();let i=new Map;for(let m of n)for(let f of m.objects)f.type==="shape"&&i.set(f.id,{shape:f,unit:m});let a=new Set,s=new Set,c=new Map((t.overlay.productionElements??[]).map(m=>{let f=m.runtimeContentImageUrl;return[m.id,typeof f=="string"&&/^(?:blob:|data:image\/|https:\/\/)/.test(f)?f:void 0]})),l=[];for(let m of r.value.overlay.productionElements??[]){let f=i.get(m.objectId),d=f?xe(f.shape):null,h=m.baseElevationM??0;if(!f||!d||d.length<3||!m.id||a.has(m.id)||s.has(m.objectId)||!Number.isFinite(m.heightM)||m.heightM<.05||m.heightM>50||!Number.isFinite(h)||h<-10||h>100)return o();a.add(m.id),s.add(m.objectId);let p=d.map(v=>v.x*_),b=d.map(v=>v.y*_),y=f.unit.baseHeightM+h,M=Math.min(...p),S=Math.max(...p),A=Math.min(...b),x=Math.max(...b),g,w=c.get(m.id)??m.contentImageUrl;if(m.kind==="screen"&&w&&(g=xl(d,y,y+m.heightM,f.unit.focal),!g))if(S-M>=x-A){let v=Math.abs(A-f.unit.focal.y*_)<=Math.abs(x-f.unit.focal.y*_)?A-.006:x+.006;g=[[M,y,v],[S,y,v],[M,y+m.heightM,v],[S,y+m.heightM,v]]}else{let v=Math.abs(M-f.unit.focal.x*_)<=Math.abs(S-f.unit.focal.x*_)?M-.006:S+.006;g=[[v,y,A],[v,y,x],[v,y+m.heightM,A],[v,y+m.heightM,x]]}l.push({id:m.id,objectId:m.objectId,kind:m.kind,floorIndex:f.unit.index,baseY:y,topY:y+m.heightM,bounds:{min:[M,y,A],max:[S,y+m.heightM,x]},occlusion:m.occlusion,...w?{contentImageUrl:w}:{},...g?{contentPlane:g}:{}})}let u=l.sort((m,f)=>m.id.localeCompare(f.id));return{byObjectId:new Map(u.map(m=>[m.objectId,m])),elements:u}}var nm=[.13,.14,.17],Tn=[.4,.43,.47],Dg=.18,Ng=.02,Bg=2.4,Vg=1500,Gg=240,Hg=.25;function om(e,t,n,o){let r=t.stageKind??"";if(Zt(r)||r==="round"||!o.length)return;let i=xe(t);if(!i||i.length<3)return;let a={x:i.reduce((L,N)=>L+N.x,0)/i.length,y:i.reduce((L,N)=>L+N.y,0)/i.length},s=0,c=0,l=new Set;for(let L of o)s+=L.x,c+=L.y,l.add(Math.floor(Math.atan2(L.y-a.y,L.x-a.x)*180/Math.PI/10));let u=a.x-s/o.length,m=a.y-c/o.length,f=Math.hypot(u,m);if(f<1e-6)return;let d=o.reduce((L,N)=>L+Math.hypot(N.x-a.x,N.y-a.y),0)/o.length;if(l.size*10>Gg&&f<Hg*d)return;let h=u/f,p=m/f,b=-p,y=h,M=-1/0,S=1/0,A=1/0,x=-1/0;for(let L of i){let N=(L.x-a.x)*h+(L.y-a.y)*p,O=(L.x-a.x)*b+(L.y-a.y)*y;M=Math.max(M,N),S=Math.min(S,N),A=Math.min(A,O),x=Math.max(x,O)}let g=(x-A)*_,w=(M-S)*_;if(g<3||w<1.5||g*w>Vg)return;let v=Dg/_,P=(L,N)=>({x:a.x+h*L+b*N,y:a.y+p*L+y*N}),R=(L,N,O,H)=>[P(L,O),P(L,H),P(N,H),P(N,O)],k=n+Math.max(3.5,Math.min(8,g*.35)),F=n+Math.min(Bg,k-n-1),E=.2/_,I=S+Math.min(w*.25,1.5)/_,C=Ng/_;ue(e,R(M-2*v+C,M-v-C,A+v+E,x-v-E),void 0,()=>F,n,nm,nm,ae);for(let[L,N]of[[A+v,A+v+E],[x-v-E,x-v]])ue(e,R(M-2*v,M-v,L,N),void 0,()=>k+.3,n,Tn,Tn,ae),ue(e,R(I+E,M-2*v,L,N),void 0,()=>k+.3,k,Tn,Tn,ae);ue(e,R(I,I+E,A+v,x-v),void 0,()=>k+.3,k,Tn,Tn,ae)}function Je(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Qe(e){return Array.isArray(e)?e:[]}function zg(e){let t=[e];for(;t.length;){let n=t.pop();if(Array.isArray(n)){t.push(...n);continue}if(!Je(n))continue;let o=Je(n.extensions)?n.extensions:null;if(o&&Object.prototype.hasOwnProperty.call(o,"KHR_draco_mesh_compression"))return!0;t.push(...Object.values(n))}return!1}function vr(e,t){return!Array.isArray(e)||e.length!==t||!e.every(n=>typeof n=="number"&&Number.isFinite(n))?null:e}function Ug(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function jg(e,t){let n=new Array(16).fill(0);for(let o=0;o<4;o++)for(let r=0;r<4;r++)for(let i=0;i<4;i++)n[o*4+r]+=e[i*4+r]*t[o*4+i];return n}function Wg(e){let t=vr(e.matrix,16);if(t)return t;if(e.matrix!==void 0)return null;let n=e.translation===void 0?[0,0,0]:vr(e.translation,3),o=e.rotation===void 0?[0,0,0,1]:vr(e.rotation,4),r=e.scale===void 0?[1,1,1]:vr(e.scale,3);if(!n||!o||!r)return null;let[i,a,s,c]=o,l=Math.hypot(i,a,s,c);if(!(l>1e-8))return null;let u=i/l,m=a/l,f=s/l,d=c/l,h=u+u,p=m+m,b=f+f,y=u*h,M=u*p,S=u*b,A=m*p,x=m*b,g=f*b,w=d*h,v=d*p,P=d*b;return[(1-(A+g))*r[0],(M+P)*r[0],(S-v)*r[0],0,(M-P)*r[1],(1-(y+g))*r[1],(x+w)*r[1],0,(S+v)*r[2],(x-w)*r[2],(1-(y+A))*r[2],0,n[0],n[1],n[2],1]}function Xg(e,t,n,o){return[e[0]*t+e[4]*n+e[8]*o+e[12],e[1]*t+e[5]*n+e[9]*o+e[13],e[2]*t+e[6]*n+e[10]*o+e[14]]}function Yg(e){let t=e[0],n=e[4],o=e[8],r=e[1],i=e[5],a=e[9],s=e[2],c=e[6],l=e[10],u=i*l-a*c,m=a*s-r*l,f=r*c-i*s,d=t*u+n*m+o*f;if(Math.abs(d)<1e-12)return null;let h=1/d;return[u*h,m*h,f*h,(o*c-n*l)*h,(t*l-o*s)*h,(n*s-t*c)*h,(n*a-o*i)*h,(o*r-t*a)*h,(t*i-n*r)*h]}function rm(e,t,n,o){let r=e[0]*t+e[1]*n+e[2]*o,i=e[3]*t+e[4]*n+e[5]*o,a=e[6]*t+e[7]*n+e[8]*o,s=Math.hypot(r,i,a)||1;return r/=s,i/=s,a/=s,[r,i,a]}function Kg(e){if(e.byteLength<20||e.byteLength>8388608)return null;let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.getUint32(0,!0)!==1179937895||t.getUint32(4,!0)!==2||t.getUint32(8,!0)!==e.byteLength)return null;let n=12,o=null,r=null;for(;n+8<=e.byteLength;){let i=t.getUint32(n,!0),a=t.getUint32(n+4,!0);if(n+=8,i%4!==0||n+i>e.byteLength)return null;let s=e.subarray(n,n+i);if(a===1313821514&&!o)try{let c=JSON.parse(new TextDecoder().decode(s).replace(/[\u0000 ]+$/g,""));if(!Je(c))return null;o=c}catch{return null}else if(a===5130562&&!r)r=s;else return null;n+=i}return n===e.byteLength&&o&&r?{json:o,bin:r}:null}function $g(e){return e===5120||e===5121?1:e===5122||e===5123?2:e===5125||e===5126?4:0}function Zg(e){return e==="SCALAR"?1:e==="VEC2"?2:e==="VEC3"?3:e==="VEC4"?4:0}function qg(e,t,n){return n===5120?e.getInt8(t):n===5121?e.getUint8(t):n===5122?e.getInt16(t,!0):n===5123?e.getUint16(t,!0):n===5125?e.getUint32(t,!0):e.getFloat32(t,!0)}function Qg(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n=Kg(t);if(!n)return{ok:!1,issue:"invalid_glb"};let{json:o,bin:r}=n;if(!Je(o.asset)||o.asset.version!=="2.0")return{ok:!1,issue:"unsupported_glb"};let i=Qe(o.extensionsUsed).filter(A=>typeof A=="string");if(i.includes("KHR_draco_mesh_compression")||zg(o))return{ok:!1,issue:"draco_not_allowed"};if(i.length||Qe(o.extensionsRequired).length)return{ok:!1,issue:"unsupported_glb"};if(Qe(o.images).length||Qe(o.textures).length)return{ok:!1,issue:"external_resource"};let a=Qe(o.buffers);if(a.length!==1||!Je(a[0])||a[0].uri!==void 0||typeof a[0].byteLength!="number"||!Number.isInteger(a[0].byteLength)||a[0].byteLength<0||a[0].byteLength>r.byteLength)return{ok:!1,issue:"external_resource"};let s=Qe(o.accessors),c=Qe(o.bufferViews),l=Qe(o.meshes),u=Qe(o.nodes),m=Qe(o.scenes),f=typeof o.scene=="number"?o.scene:0;if(!Je(m[f]))return{ok:!1,issue:"unsupported_glb"};let d=new DataView(r.buffer,r.byteOffset,r.byteLength),h=(A,x,g)=>{if(typeof A!="number"||!Number.isInteger(A)||!Je(s[A]))return null;let w=s[A];if(w.type!==x||w.sparse!==void 0||w.normalized===!0||typeof w.count!="number"||!Number.isInteger(w.count)||w.count<1||typeof w.componentType!="number"||!g.includes(w.componentType)||typeof w.bufferView!="number")return null;let v=c[w.bufferView];if(!Je(v)||v.buffer!==0||typeof v.byteLength!="number"||!Number.isInteger(v.byteLength)||v.byteLength<0)return null;let P=Zg(w.type),R=$g(w.componentType),k=typeof v.byteStride=="number"?v.byteStride:P*R,F=typeof v.byteOffset=="number"?v.byteOffset:0,E=typeof w.byteOffset=="number"?w.byteOffset:0,I=F+E,C=E+(w.count-1)*k+P*R;if(!Number.isInteger(k)||!Number.isInteger(F)||!Number.isInteger(E)||k<P*R||F<0||E<0||F+v.byteLength>r.byteLength||C>v.byteLength)return null;let L=[];for(let N=0;N<w.count;N++){let O=[];for(let H=0;H<P;H++){let j=qg(d,I+N*k+H*R,w.componentType);if(!Number.isFinite(j))return null;O.push(j)}L.push(O)}return L},p=[],b=[],y=0,M=new Set,S=(A,x)=>{if(typeof A!="number"||!Number.isInteger(A)||!Je(u[A])||M.has(A))return!1;M.add(A);let g=u[A],w=Wg(g);if(!w)return!1;let v=jg(x,w),P=Yg(v);if(!P)return!1;if(g.mesh!==void 0){if(typeof g.mesh!="number")return!1;let R=l[g.mesh];if(!Je(R))return!1;for(let k of Qe(R.primitives)){if(!Je(k)||k.mode!==void 0&&k.mode!==4||!Je(k.attributes))return!1;let F=h(k.attributes.POSITION,"VEC3",[5126]),E=k.attributes.NORMAL===void 0?null:h(k.attributes.NORMAL,"VEC3",[5126]);if(!F||k.attributes.NORMAL!==void 0&&!E)return!1;let I=F.length;if(k.indices!==void 0){let L=typeof k.indices=="number"?s[k.indices]:null;I=Je(L)?L.count:void 0}if(typeof I!="number"||!Number.isInteger(I)||I%3!==0||(y+=I/3,y>1e5))return!1;let C=k.indices===void 0?F.map((L,N)=>[N]):h(k.indices,"SCALAR",[5121,5123,5125]);if(!C||C.length%3!==0||C.length!==I)return!1;for(let L=0;L<C.length;L+=3){let N=[C[L][0],C[L+1][0],C[L+2][0]];if(N.some(j=>!Number.isInteger(j)||j<0||j>=F.length))return!1;let O=N.map(j=>Xg(v,...F[j])),H=null;if(!E){let j=O[1][0]-O[0][0],V=O[1][1]-O[0][1],T=O[1][2]-O[0][2],B=O[2][0]-O[0][0],D=O[2][1]-O[0][1],G=O[2][2]-O[0][2];H=rm([1,0,0,0,1,0,0,0,1],V*G-T*D,T*B-j*G,j*D-V*B)}for(let j=0;j<3;j++)p.push(...O[j]),b.push(...E?rm(P,...E[N[j]]):H)}}}for(let R of Qe(g.children))if(!S(R,v))return!1;return M.delete(A),!0};for(let A of Qe(m[f].nodes))if(!S(A,Ug()))return{ok:!1,issue:y>1e5?"triangle_limit":"unsupported_glb"};return!y||p.length!==y*9||b.length!==p.length?{ok:!1,issue:"unsupported_glb"}:{ok:!0,triangleCount:y,position:new Float32Array(p),normal:new Float32Array(b)}}function im(e){try{return Qg(e)}catch{return{ok:!1,issue:"invalid_glb"}}}function Ln(e){let{doc:t}=e,n=Ws(t.theme),o=n.structure,r=al(t,e.eventConfigurationId??t.eventConfigurationId),i=tm(e.eventConfigurationId,e.eventConfiguration,r),a=e.seats,s=new zo,c=null;if(e.registeredShellGlb){let X=im(e.registeredShellGlb);if(X.ok){let Y=X.position.length/3,K=new Float32Array(X.position.length),J=n.materials.shell??o.tierWall;for(let ce=0;ce<Y;ce++){let oe=X.normal[ce*3+1],ee=oe<-.25?.4:.62+.38*Math.max(0,oe);K[ce*3]=J[0]*ee,K[ce*3+1]=J[1]*ee,K[ce*3+2]=J[2]*ee}c={position:X.position,normal:X.normal,color:K,floor:new Float32Array(Y).fill(-2),material:new Float32Array(Y),count:Y}}}let l=new Map;for(let X of r)for(let Y of X.objects)l.set(Y.id,X.index),Y.type==="section"&&l.set(Y.logicalSectionId??Y.id,X.index);let u=a.map(X=>l.get(X.sectionId??"")??l.get(X.rowId??"")??0),m=pa(r,a),f=s.vertexCount,h=Qu(s,r,a,u,m,o,ge(n.background.top,n.background.bottom,.5))?s.vertexCount:f,p=Xc(t,a),b=new Map,y=new Map;for(let X of t.categories??[])b.set(X.key,X.color),X.seatGlyph&&y.set(X.key,X.seatGlyph);let M=[],S=gl(r,a,u),A=new Map;a.forEach((X,Y)=>{let K=S.seatDeckY(Y);Number.isFinite(K)&&A.set(X.rowId,Math.min(A.get(X.rowId)??1/0,K))});let x=new Float32Array(a.length),g=[],w=new Map((t.floors??[]).map((X,Y)=>[X.id,Y])),v=r.map(()=>[]);for(let X of a){let Y=X.floorId?w.get(X.floorId)??0:0;v[Math.min(Y,v.length-1)]?.push(X)}let P=(X,Y)=>{if(!Y||Y.length<3)return!1;let K=Math.min(...Y.map(ee=>ee.x)),J=Math.max(...Y.map(ee=>ee.x)),ce=Math.min(...Y.map(ee=>ee.y)),oe=Math.max(...Y.map(ee=>ee.y));for(let ee=0;ee<X;ee++)for(let ne of v[ee])if(!(ne.x<K||ne.x>J||ne.y<ce||ne.y>oe)&&Ge(ne,Y,void 0))return!0;return!1},R=null,k=X=>r.length===1?a:a.filter((Y,K)=>u[K]===X),F=(X,Y)=>{let K=lt(X);if(!K)return!1;let J=1/0,ce=1/0,oe=-1/0,ee=-1/0;for(let ne of K)J=Math.min(J,ne.x),oe=Math.max(oe,ne.x),ce=Math.min(ce,ne.y),ee=Math.max(ee,ne.y);return a.some((ne,he)=>ne.kind!=="booth"&&(r.length===1||u[he]===Y)&&ne.x>J&&ne.x<oe&&ne.y>ce&&ne.y<ee&&Ze(K,ne.x,ne.y))},E;for(let X=0;X<r.length;X++){let Y=r[X];s.setFloor(X);let K=kt(Y,k(X)),J=0;if(K){let re=0;for(let ve of Y.objects)if(ve.type==="section")for(let we of S.bySection.get(ve.id)?.rowLevels??[])re=Math.max(re,we.y-Y.baseHeightM);if(J=dl(re),!E){let ve=In(K);E={centre:[ve.x*_,ve.y*_]}}}let ce=new nr,oe=[],ee=Y.objects.filter(re=>re.type==="shape"&&(re.role==="entrance"||re.role==="exit")),ne=Y.objects.filter(re=>re.type==="section"&&!!re.outline&&re.outline.length>=3),he=Kl(Y.objects.filter(re=>re.type==="booth"),Y.focal);for(let re of Y.objects)if(re.type==="section"){let ve=s.vertexCount;uu(s,re,Y,Yc(re,p),S.bySection.get(re.id),ce,ne,o,X>0&&P(X,re.outline));let we=s.vertexCount-ve;we>0&&g.push({sectionId:re.id,start:ve,count:we})}else if(re.type==="shape"){let ve=i.byObjectId.get(re.id),we=M.length,ot=K!==null&&re.role==="wall"&&!ve;s.setMaterial(ot?or:(ve?.kind??re.role)==="screen"?1:0);let ut=re.role==="stage"&&!ve?Zl(re,k(X)):ot&&re.heightM===void 0?{...re,heightM:J}:re,Ye=ml(ut,oe);if(jl(s,ut,Y.baseHeightM+Ye.supportOffsetM,Ye.topOffsetM-Ye.supportOffsetM,o,Y.focal,M,ve,ee),s.setMaterial(0),re.role==="stage"&&!ve&&M.length>we&&(R??X)===X){R=X;let rt=t.floors?.[X]?.id,Ie=r.length>1&&rt?a.filter(Ht=>Ht.floorId===rt):a;om(s,ut,M[M.length-1].y,Ie)}}else re.type==="gaArea"?Xl(s,re,Y.baseHeightM,ye(b.get(re.categoryKey)),o):re.type==="booth"?Hl(s,re,Y.baseHeightM,ye(b.get(re.categoryKey)),o,he.get(re.id)??Y.focal,F(re,X)):re.type==="table"?Ul(s,re,Math.max(Y.baseHeightM,A.get(re.id)??Y.baseHeightM),ye(re.fill??t.theme?.decorFill??"#232c40"),o,!!(re.fill??t.theme?.decorFill)):re.type==="decorImage"&&Wl(s,re,Y.baseHeightM,o);K&&Nu(s,Y.objects,K,Y.baseHeightM,J,Y.focal,o,re=>!i.byObjectId.has(re.id)),fu(s,Y,a,S,o,n.materials.shell,!c)}let I=r.length>1?{x:r.reduce((X,Y)=>X+Y.focal.x,0)/r.length,y:r.reduce((X,Y)=>X+Y.focal.y,0)/r.length}:t.focalPoint??{x:(m.minX+m.maxX)/2,y:(m.minY+m.maxY)/2},C=Vs(c?[s.build(),c]:[s.build()]),L=Hs(a,e.initialState,S,x,b,y),N=Uu({doc:t,units:r,seats:a,surfaces:S,focal:I}),{labels:O,sections:H,rows:j}=ju({doc:t,units:r,seats:a,surfaces:S,seatData:L,hintedSeatFloor:u,zones:N,focal:I}),V=new Map(H.map((X,Y)=>[X.id,Y]));S.seatOwner.forEach((X,Y)=>{L.iSection[Y]=X?V.get(X)??-1:-1});let T=Xu({doc:t,units:r,seats:a,surfaces:S,solids:C,hintedSeatFloor:u,seatFloor:x});Wu(O,T),L.iYaw=as(L.iPosition,a.length,X=>a[X].rowId,X=>{let Y=r[x[X]]?.focal??I;return[Y.x*_,Y.y*_]});let B=(m.minX+m.maxX)/2*_,D=(m.minY+m.maxY)/2*_,G=.5*Math.hypot((m.maxX-m.minX)*_,(m.maxY-m.minY)*_)||10,U=ba(C,L,{cx:B,cz:D,radius:G},[f,h]),q=ba(C,L,{cx:B,cz:D,radius:G}),$=Jg(r),te=em(L,M,m,U.minY,U.maxY,G,$);return{sharedAisles:zs(r.flatMap(X=>X.objects.flatMap(Y=>{if(Y.type!=="section")return[];let K=S.bySection.get(Y.id);return K?[{sectionId:Y.id,floorIndex:X.index,rows:K.rowLevels}]:[]}))),solids:C,sectionSolidRanges:g,seats:L,seatSectionIds:S.seatOwner,bounds:{center:[(te.min[0]+te.max[0])/2,(te.min[1]+te.max[1])/2,(te.min[2]+te.max[2])/2],radius:G,groundY:0,box:te,fitPoints:Ju(L,M,$)},...E?{room:E}:{},...!E&&r.some(X=>X.objects.some(Y=>Y.type==="shape"&&jo(Y.stageKind)))?{outdoor:!0}:{},renderBounds:{center:U.center,radius:U.radius},clipBounds:{center:q.center,radius:q.radius},stateColorLUT:Xs(n,ze),theme:n,seatCount:a.length,focalWorld:[I.x*_,1.5,I.y*_],zones:N,stages:M,productionElements:i.elements,sections:H,rows:j,labels:O,floors:T}}function Jg(e){let t=[];for(let n of e)for(let o of n.objects){let r=o.type==="gaArea"?o.points:o.type==="booth"?lt(o):null;for(let i of r??[])t.push([i.x*_,n.baseHeightM,i.y*_])}return t}var Dt=require("ogl"),e1=.05,t1=.55,n1=12,o1=1.6,r1=1,i1=2.5,a1=650,en={height:6,baseRadius:.16,topRadius:.3,fadeInFromM:16,fullByM:40,nearStrength:.6};function s1(e,t){if(t)return 0;let n=(e-en.fadeInFromM)/(en.fullByM-en.fadeInFromM);return Math.max(en.nearStrength,Math.min(1,n))}var am=24;function c1(e){let t=[],n=[],o=[],r=(m,f,d)=>{t.push(...m),n.push(...f),o.push(d)};for(let m=0;m<16;m++){let f=m/16*Math.PI*2,d=(m+1)/16*Math.PI*2,h=S=>[Math.cos(S),0,Math.sin(S)],p=[Math.cos(f)*.012,0,Math.sin(f)*.012],b=[Math.cos(d)*.012,0,Math.sin(d)*.012],y=[Math.cos(f)*.03,1,Math.sin(f)*.03],M=[Math.cos(d)*.03,1,Math.sin(d)*.03];r(p,h(f),0),r(y,h(f),0),r(M,h(d),0),r(p,h(f),0),r(M,h(d),0),r(b,h(d),0)}let c=.16,l=.24,u=.01;for(let m=0;m<48;m++){let f=m/48*Math.PI*2,d=(m+1)/48*Math.PI*2,h=[Math.cos(f)*c,u,Math.sin(f)*c],p=[Math.cos(f)*l,u,Math.sin(f)*l],b=[Math.cos(d)*l,u,Math.sin(d)*l],y=[Math.cos(d)*c,u,Math.sin(d)*c];for(let M of[h,p,b,h,b,y])r(M,[0,1,0],1)}for(let m=0;m<32;m++){let f=m/32*Math.PI*2,d=(m+1)/32*Math.PI*2,h=en.baseRadius,p=en.topRadius,b=[Math.cos(f)*h,0,Math.sin(f)*h],y=[Math.cos(d)*h,0,Math.sin(d)*h],M=[Math.cos(f)*p,1,Math.sin(f)*p],S=[Math.cos(d)*p,1,Math.sin(d)*p],A=[Math.cos(f),0,Math.sin(f)],x=[Math.cos(d),0,Math.sin(d)];r(b,A,2),r(M,A,2),r(S,x,2),r(b,A,2),r(S,x,2),r(y,x,2)}return new Dt.Geometry(e,{position:{size:3,data:new Float32Array(t)},normal:{size:3,data:new Float32Array(n)},part:{size:1,data:new Float32Array(o)}})}var l1=`#version 300 es
20
+ }`});async function qh(e,t,n,o={}){let r=o.fadeMs??400,i=t?.initialBearingDeg??0,a=Math.max(-Nt,Math.min(Nt,t?.initialPitchDeg??0)),s=di,c=!1,l=new AbortController,u=()=>l.abort();o.signal?.addEventListener("abort",u,{once:!0});let m=()=>{},f=[n.camera.position.x,n.camera.position.y,n.camera.position.z];if(!t&&n.cameraOriginWorld&&n.camera.position.set(n.cameraOriginWorld[0],n.cameraOriginWorld[1],n.cameraOriginWorld[2]),!t&&n.focalWorld){let G=n.camera.position,T=n.focalWorld[0]-G.x,D=n.focalWorld[1]-G.y,W=n.focalWorld[2]-G.z,H=Math.hypot(T,W);H>.001&&(i=Math.atan2(T,-W)*180/Math.PI,a=Math.max(-Nt,Math.min(Nt,Math.atan2(D,H)*180/Math.PI)))}let h=null;if(t){let G=n.gl.getParameter(n.gl.MAX_TEXTURE_SIZE),T=mi(t,ui(G)),D;try{let W=t.resolveUrl?await t.resolveUrl(T.initialUrl):T.initialUrl;if(!W)throw new Error("panorama_asset_unavailable");D=await qo(W,l.signal)}catch{return o.signal?.removeEventListener("abort",u),null}try{h=Yh(n.gl,D)}catch{return l.abort(),o.signal?.removeEventListener("abort",u),null}h.mesh.renderOrder=999,h.mesh.setParent(n.scene),T.upgradeUrl&&(m=fi(()=>{(t.resolveUrl?t.resolveUrl(T.upgradeUrl):Promise.resolve(T.upgradeUrl)).then(H=>!H||l.signal.aborted?null:qo(H,l.signal)).then(H=>{H&&(c||l.signal.aborted||(h?.setImage(H),n.requestRender()))}).catch(()=>{})}))}let d=n.camera.fov;n.camera.perspective({fov:s,aspect:n.camera.aspect});let p=n.camera.quaternion.slice(),b=()=>{let G=n.camera.position;h?.mesh.position.set(G.x,G.y,G.z);let[T,D,W]=Kh(i,a);n.camera.lookAt([G.x+T,G.y+D,G.z+W]),n.requestRender()};b();let x=document.createElement("div"),y=document.activeElement instanceof HTMLElement?document.activeElement:null;x.setAttribute("role","dialog"),x.setAttribute("aria-modal","true"),x.setAttribute("aria-label",o.seatLabel?`View from ${o.seatLabel}`:"View from seat"),x.tabIndex=-1,Object.assign(x.style,{position:"absolute",inset:"0",zIndex:"10",cursor:"grab",touchAction:"none"});let M=document.createElement("button");if(M.type="button",M.setAttribute("aria-label","Close"),M.textContent="\u2715",Object.assign(M.style,{position:"absolute",top:"12px",right:"12px",zIndex:"2",width:"44px",height:"44px",borderRadius:"999px",cursor:"pointer",border:"1px solid rgba(255,255,255,0.25)",background:"rgba(8,12,18,0.6)",color:"#e6edf3",fontSize:"15px",lineHeight:"1"}),x.appendChild(M),o.disclosure){let G=document.createElement("div");G.textContent=`${o.disclosurePrefix??"360\xB0 panorama"} \xB7 ${o.disclosure}`,Object.assign(G.style,{position:"absolute",top:"calc(12px + var(--sl-3d-top-inset, 0px))",left:"12px",zIndex:"2",maxWidth:"calc(100% - 88px)",padding:"8px 11px",borderRadius:"999px",overflow:"hidden",color:"#dce6f8",background:"rgba(8,12,18,0.68)",font:"600 11px/1.2 ui-sans-serif, system-ui, sans-serif",textOverflow:"ellipsis",whiteSpace:"nowrap",pointerEvents:"none",backdropFilter:"blur(6px)"}),x.appendChild(G)}let A=document.createElement("div");A.textContent=As(o.lookAroundHint),Object.assign(A.style,{position:"absolute",bottom:"12px",left:"0",right:"0",textAlign:"center",color:"rgba(230,237,243,0.7)",font:"12px ui-sans-serif, system-ui, sans-serif",pointerEvents:"none"}),x.appendChild(A),e.appendChild(x),M.focus({preventScroll:!0});let w=!1,g=0,S=0,v=0,P=new Map,E=()=>{let[G,T]=[...P.values()];return G&&T?Math.hypot(G.x-T.x,G.y-T.y):0},k=G=>{let T=Ps(G);T!==s&&(s=T,n.camera.perspective({fov:s,aspect:n.camera.aspect}),b())},L=G=>{G.target!==M&&(P.set(G.pointerId,{x:G.clientX,y:G.clientY}),w=P.size===1,g=G.clientX,S=G.clientY,P.size===2&&(v=E()),x.setPointerCapture?.(G.pointerId),x.style.cursor="grabbing")},I=G=>{if(P.has(G.pointerId)){if(P.set(G.pointerId,{x:G.clientX,y:G.clientY}),P.size>=2){let T=E();v>0&&T>0&&k(s*(v/T)),v=T,w=!1;return}w&&(i+=(G.clientX-g)*Zh,a=Math.max(-Nt,Math.min(Nt,a+(G.clientY-S)*Zh)),g=G.clientX,S=G.clientY,b())}},R=G=>{P.delete(G.pointerId),v=P.size===2?E():0;let T=P.values().next().value;w=P.size===1,T?(g=T.x,S=T.y):x.style.cursor="grab";try{x.releasePointerCapture?.(G.pointerId)}catch{}},_=G=>{G.preventDefault(),k(s+G.deltaY*.04)};x.addEventListener("pointerdown",L),x.addEventListener("pointermove",I),x.addEventListener("pointerup",R),x.addEventListener("pointercancel",R),x.addEventListener("wheel",_,{passive:!1});let F=G=>{if(!c){if(G.key==="Tab"){G.preventDefault(),M.focus({preventScroll:!0});return}if(G.key==="Escape"){G.stopPropagation(),z.close();return}if(G.key==="ArrowLeft"||G.key==="ArrowRight")i+=G.key==="ArrowLeft"?-4:4;else if(G.key==="ArrowUp"||G.key==="ArrowDown")a=Math.max(-Nt,Math.min(Nt,a+(G.key==="ArrowUp"?4:-4)));else if(G.key==="+"||G.key==="="){k(s-5),G.preventDefault();return}else if(G.key==="-"){k(s+5),G.preventDefault();return}else return;G.preventDefault(),b()}};window.addEventListener("keydown",F);let N=0,O=(G,T)=>{if(!h){T?.();return}let D=G===1?0:1,W=performance.now(),H=()=>{if(c)return;let j=r<=0?1:Math.min(1,(performance.now()-W)/r);h?.setOpacity(D+(G-D)*j),n.requestRender(),j<1?N=requestAnimationFrame(H):T?.()};N=requestAnimationFrame(H)};O(1);let V=()=>{c||(c=!0,m(),l.abort(),o.signal?.removeEventListener("abort",u),cancelAnimationFrame(N),x.removeEventListener("pointerdown",L),x.removeEventListener("pointermove",I),x.removeEventListener("pointerup",R),x.removeEventListener("pointercancel",R),x.removeEventListener("wheel",_),window.removeEventListener("keydown",F),x.remove(),y?.isConnected&&y.focus({preventScroll:!0}),h?.dispose(),n.camera.position.set(f[0],f[1],f[2]),n.camera.perspective({fov:d,aspect:n.camera.aspect}),n.camera.quaternion.set(p[0],p[1],p[2],p[3]),n.requestRender())},z={close(){if(c)return;let G=()=>{V(),o.onClose?.()};cancelAnimationFrame(N),O(0,G)},dispose:V};return M.addEventListener("click",()=>z.close()),z}var Zh,Qh=uo(()=>{"use strict";$h();pi();pi();ws();Zh=.15});var Jh={};Ws(Jh,{createOpenPanorama:()=>w2});function w2(e){let{container:t,model:n,opts:o,analytics:r,orbit:i,loop:a,seatsById:s,ensureSeatView:c,resolvedSeatViewPose:l,gpu:u,gl:m,isContextLost:f,isDisposed:h,flightGen:d,setPanorama:p,getLoadAbort:b,setLoadAbort:x,setPanoramaSphereVisible:y,setFrozen:M,raisePanoramaLayer:A,restorePanoramaLayer:w,getOverviewChip:g,labelOverlay:S,reducedMotion:v,removeArriveChip:P,showArriveChip:E}=e;return async(k,L,I)=>{b()?.abort();let R=new AbortController;x(R);let _=n.seats.idToIndex.get(k);if(_===void 0){i.syncFromCamera();return}let F=s.get(k)?.label??k,N=l(k,_),O=c(k);if(!O){R.abort(),b()===R&&x(null),i.syncFromCamera();return}M(!0),a.stop();let V;try{V=await O}catch{if(b()===R&&x(null),r.panoramaFailed(k,"source"),!h()&&I===d()){M(!1),i.resumeAfterFlight(N.focal),a.requestRender();let Z=E(k,I,!0);requestAnimationFrame(()=>Z?.querySelector("[data-panorama-trigger]")?.focus())}return}if(h()||I!==d()){R.abort(),b()===R&&x(null);return}P();let z=g(),G=()=>{R.abort(),b()===R&&x(null),p(null),y(!1),w(),z.style.display="",S.setVisible(!o.arriveAtSeatEye),M(!1),r.panoramaClosed(),i.resumeAfterFlight(N.focal),a.requestRender();let Z=E(k,d());requestAnimationFrame(()=>Z?.querySelector("[data-panorama-trigger]")?.focus())},T=V.generated===!0,D=Wh(V);A(),y(!T),z.style.display="none";let W=v()?0:L,H=u(),j=H&&!f()?await qh(t,T?null:V,{gl:m,scene:H.main,camera:i.camera,requestRender:()=>a.requestRender(),cameraOriginWorld:T?N.eye:void 0,focalWorld:N.focal},{fadeMs:W,seatLabel:F,disclosure:D,disclosurePrefix:T?"Live 3D view":"360\xB0 panorama",lookAroundHint:o.lookAroundHint,onClose:G,signal:R.signal}):null;if(h()||I!==d()){R.abort(),y(!1),b()===R&&x(null),j?.dispose(),z.style.display="",w();return}if(j)i.syncFromCamera(),S.setVisible(!1),M(!1),a.requestRender(),p(j);else if(T){w(),z.style.display="",M(!1),i.resumeAfterFlight(N.focal),a.requestRender(),p(null),y(!1),r.panoramaFailed(k,"mount");let Z=E(k,d(),!0);requestAnimationFrame(()=>Z?.querySelector("[data-panorama-trigger]")?.focus()),b()===R&&x(null);return}else y(!1),r.panoramaFallback(k),p(Xh(t,V,{fadeMs:W,seatLabel:F,disclosure:D,onClose:G,signal:R.signal,lookAroundHint:o.lookAroundHint}));r.panoramaOpened()}}var ed=uo(()=>{"use strict";pi();Qh()});var G2={};Ws(G2,{VENUE3D_QUALITY_REPORT_VERSION:()=>Uf,autoVenue3d:()=>Jr,buildSceneModel:()=>no,estimateVenue3D:()=>Qo,inspectVenue3DQualityEvidence:()=>oi,mountVenue3D:()=>V2,prepareVenue3D:()=>bd,prepareVenue3DFromChart:()=>yd});module.exports=Od(G2);function Ks(e,t,n){let o=Math.floor(t.length/3),r=n.center[0],i=n.center[2];if(o>0){let c=Math.max(1,Math.floor(o/4e3)),l=0,u=0,m=0;for(let f=0;f<o;f+=c)l+=t[f*3],u+=t[f*3+2],m++;r=l/m,i=u/m}let a=e[0]-r,s=e[2]-i;return Math.hypot(a,s)>n.radius*.12?Math.atan2(a,s):void 0}var gd=require("ogl");function Ys(e,t,n="#ffffff"){let{iPosition:o,count:r}=t.seats;if(r<2||typeof document>"u")return null;let i=1/0,a=-1/0,s=1/0,c=-1/0;for(let w=0;w<r;w++){let g=o[w*3],S=o[w*3+2];g<i&&(i=g),g>a&&(a=g),S<s&&(s=S),S>c&&(c=S)}for(let w of t.stages)i=Math.min(i,w.cx-w.halfX),a=Math.max(a,w.cx+w.halfX),s=Math.min(s,w.cz-w.halfZ),c=Math.max(c,w.cz+w.halfZ);let l=Math.min(130/Math.max(.001,a-i),86/Math.max(.001,c-s)),u=(148-(a-i)*l)/2,m=(104-(c-s)*l)/2,f=w=>u+(w-i)*l,h=w=>m+(w-s)*l,d=Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),p=document.createElement("canvas");p.width=Math.round(148*d),p.height=Math.round(104*d),p.setAttribute("aria-hidden","true"),p.setAttribute("data-seat-locator","");let b=p.style;b.position="absolute",b.left="12px",b.bottom="12px",b.width="148px",b.height="104px",b.borderRadius="10px",b.background="rgba(10,14,22,.72)",b.border="1px solid rgba(255,255,255,.14)",b.boxShadow="0 4px 14px rgba(0,0,0,.35)",b.pointerEvents="none",b.zIndex="3",b.display="none",e.appendChild(p);let x=document.createElement("canvas");x.width=p.width,x.height=p.height;let y=x.getContext("2d");if(y){y.scale(d,d),y.fillStyle="rgba(214,222,234,.28)";let w=Math.max(1,Math.ceil(r/6e3));for(let g=0;g<r;g+=w)y.fillRect(f(o[g*3])-.6,h(o[g*3+2])-.6,1.2,1.2);y.fillStyle="rgba(236,240,246,.16)",y.strokeStyle="rgba(236,240,246,.55)",y.lineWidth=1;for(let g of t.stages){let S=f(g.cx-g.halfX),v=h(g.cz-g.halfZ),P=g.halfX*2*l,E=g.halfZ*2*l;y.fillRect(S,v,P,E),y.strokeRect(S+.5,v+.5,Math.max(0,P-1),Math.max(0,E-1))}}let M=p.getContext("2d"),A="";return{el:p,update(w,g){if(!w||!M||e.clientWidth>0&&e.clientWidth<560){b.display!=="none"&&(b.display="none"),A="";return}let S=f(w[0]),v=h(w[2]),P=g?Math.atan2(g[2],g[0]):0,E=`${S.toFixed(1)},${v.toFixed(1)},${P.toFixed(2)}`;if(E!==A){if(A=E,b.display="block",M.setTransform(1,0,0,1,0,0),M.clearRect(0,0,p.width,p.height),M.drawImage(x,0,0),M.setTransform(d,0,0,d,0,0),g){let k=M.createRadialGradient(S,v,0,S,v,26);k.addColorStop(0,"rgba(255,255,255,.55)"),k.addColorStop(1,"rgba(255,255,255,0)"),M.fillStyle=k,M.beginPath(),M.moveTo(S,v),M.arc(S,v,26,P-.5,P+.5),M.closePath(),M.fill()}M.fillStyle=n,M.strokeStyle="rgba(10,14,22,.9)",M.lineWidth=1.5,M.beginPath(),M.arc(S,v,3.6,0,Math.PI*2),M.fill(),M.stroke()}},dispose(){p.remove()}}}var Je={pedestal:0,pad:1,back:2,arm:3,footrest:4,leg:5,spine:6,armrest:7},Fd=.44,Dd=.15,$s=.3,Nd=.24;function Zs(e){return e===void 0||!Number.isFinite(e)||e<=0?Nd:Math.min($s,Math.max(Dd,e*Fd))}var mo=.21,Bd=.05,qs=.45,Bt=qs+Bd,Kt=.92,or=.66,Qs=1.205;var rr=.6,Js=.56,ec=.5,tc=-.9,nc=.76,oc=.66;var Ti=.38,rc=-.84,ic=.06,Li=78;var Vd=.28,mn=.15,Gd=[{part:Je.pedestal,min:[-.3,0,-.3],max:[.3,.36,.3]},{part:Je.pad,min:[-1,.36,-.95],max:[1,qs,1]},{part:Je.back,min:[-1,Bt,-1],max:[1,Kt,-.72]},{part:Je.arm,min:[-1,.44,-.82],max:[-.78,.65,.78]},{part:Je.arm,min:[.78,.44,-.82],max:[1,.65,.78]},{part:Je.footrest,min:[-.9,.18,.78],max:[.9,.31,1.34]},{part:Je.leg,min:[-.82,0,-.7],max:[-.62,.37,-.48]},{part:Je.leg,min:[.62,0,-.7],max:[.82,.37,-.48]},{part:Je.leg,min:[-.82,0,.48],max:[-.62,.37,.7]},{part:Je.leg,min:[.62,0,.48],max:[.82,.37,.7]},{part:Je.spine,min:[-.8,.3,-1],max:[.8,.6,-.9]},...[1,-1].flatMap(e=>{let t=a=>{let s=e*(mn-a),c=e*(mn+a);return[Math.min(s,c),Math.max(s,c)]},[n,o]=t(.09),[r,i]=t(Vd/2);return[{part:Je.armrest,min:[n,0,-.5],max:[o,.6,.05],skip:[2,3]},{part:Je.armrest,min:[r,.6,-.74],max:[i,.655,.58],skip:[3]}]})],Hd=[{n:[1,0,0],c:[[1,0,0],[1,1,0],[1,1,1],[1,0,1]]},{n:[-1,0,0],c:[[0,0,1],[0,1,1],[0,1,0],[0,0,0]]},{n:[0,1,0],c:[[0,1,0],[0,1,1],[1,1,1],[1,1,0]]},{n:[0,-1,0],c:[[0,0,1],[0,0,0],[1,0,0],[1,0,1]]},{n:[0,0,1],c:[[0,0,1],[1,0,1],[1,1,1],[0,1,1]]},{n:[0,0,-1],c:[[1,0,0],[0,0,0],[0,1,0],[1,1,0]]}];function ac(){let e=[],t=[],n=[],o=[],r=(h,d,p)=>{let b=n.length,[x,y,M]=h,A=[y[0]-x[0],y[1]-x[1],y[2]-x[2]],w=[M[0]-x[0],M[1]-x[1],M[2]-x[2]],g=A[1]*w[2]-A[2]*w[1],S=A[2]*w[0]-A[0]*w[2],v=A[0]*w[1]-A[1]*w[0],P=Math.hypot(g,S,v);P>1e-9?(g/=P,S/=P,v/=P):[g,S,v]=d,g*d[0]+S*d[1]+v*d[2]<0&&(g=-g,S=-S,v=-v);for(let E of h)e.push(...E),t.push(g,S,v),n.push(p);o.push(b,b+1,b+2,b,b+2,b+3)},i=h=>{for(let[d,p]of Hd.entries()){if(h.skip?.includes(d))continue;let b=p.c.map(x=>x.map((y,M)=>y?h.max[M]:h.min[M]));r(b,p.n,h.part)}},a=h=>{let{part:d,vertical:p,across:b,along:x,alongCoord:y,halfWidth:M,swell:A,base:w}=h,g=(T,D,W)=>p?[T*M(D),y(D),W]:[T*M(D),W,y(D)],S=(T,D)=>g(T,D,A(T,D)),v=p?2:1,P=(T,D)=>{let H=Math.max(-1,T-.001),j=Math.min(1,T+.001),Z=Math.max(0,D-.001),X=Math.min(1,D+.001),ee=S(H,D),ne=S(j,D),ue=S(T,Z),de=S(T,X),me=[ne[0]-ee[0],ne[1]-ee[1],ne[2]-ee[2]],pe=[de[0]-ue[0],de[1]-ue[1],de[2]-ue[2]],Pe=[me[1]*pe[2]-me[2]*pe[1],me[2]*pe[0]-me[0]*pe[2],me[0]*pe[1]-me[1]*pe[0]];Pe[v]<0&&(Pe=[-Pe[0],-Pe[1],-Pe[2]]);let _e=Math.hypot(...Pe)||1;return[Pe[0]/_e,Pe[1]/_e,Pe[2]/_e]},E=(T,D)=>(e.push(...T),t.push(...D),n.push(d),n.length-1),k=x.map(T=>b.map(D=>E(S(D,T),P(D,T))));for(let T=0;T<x.length-1;T++)for(let D=0;D<b.length-1;D++)o.push(k[T][D],k[T][D+1],k[T+1][D+1],k[T][D],k[T+1][D+1],k[T+1][D]);let L=[];for(let T=0;T<b.length-1;T++)L.push([b[T],x[0]]);for(let T=0;T<x.length-1;T++)L.push([b[b.length-1],x[T]]);for(let T=b.length-1;T>0;T--)L.push([b[T],x[x.length-1]]);for(let T=x.length-1;T>0;T--)L.push([b[0],x[T]]);let I=L.map(([T,D])=>g(T,D,w)),R=T=>p?[T[0],T[1]]:[T[0],T[2]],_=T=>{let[D,W]=R(I[T]),[H,j]=R(I[(T+1)%I.length]),Z=Math.hypot(H-D,j-W)||1;return[(j-W)/Z,-(H-D)/Z]},F=I.reduce((T,D)=>{let[W,H]=R(D);return[T[0]+W/I.length,T[1]+H/I.length]},[0,0]),N=T=>{let D=_((T+I.length-1)%I.length),W=_(T),H=D[0]+W[0],j=D[1]+W[1],[Z,X]=R(I[T]);H*(Z-F[0])+j*(X-F[1])<0&&(H=-H,j=-j);let ee=Math.hypot(H,j)||1;return p?[H/ee,j/ee,0]:[H/ee,0,j/ee]},O=L.map(([T,D],W)=>E(S(T,D),N(W))),V=I.map((T,D)=>E(T,N(D)));for(let T=0;T<L.length;T++){let D=(T+1)%L.length;o.push(O[T],O[D],V[D],O[T],V[D],V[T])}let z=p?[0,0,-1]:[0,-1,0],G=I.map(T=>E(T,z));for(let T=1;T<G.length-1;T++)o.push(G[0],G[T],G[T+1])},s=h=>1-h*h*h*h,c=h=>d=>{for(let p=1;p<h.length;p++)if(d<=h[p][0]){let[b,x]=h[p-1],[y,M]=h[p];return x+(M-x)*(d-b)/(y-b)}return h[h.length-1][1]};for(let h of Gd)if(h.part===Je.back){let d=[[0,.8],[.04,.9],[.1,.97],[.25,1],[.77,.94],[.88,.88],[.95,.79],[1,or]],p=h.min[1],b=h.max[1];a({part:h.part,vertical:!0,across:[-1,-.6,0,.6,1],along:d.map(([x])=>x),alongCoord:x=>p+(b-p)*x,halfWidth:c(d),swell:(x,y)=>h.max[2]-.12+.12*s(x)*s(2*y-1),base:h.min[2]})}else if(h.part===Je.pad){let d=[[0,.84],[.1,.92],[.78,.92],[.9,.89],[.97,.82],[1,.72]],p=h.min[2],b=h.max[2],x=h.min[1],y=h.max[1];a({part:h.part,vertical:!1,across:[-1,-.6,0,.6,1],along:d.map(([M])=>M),alongCoord:M=>p+(b-p)*M,halfWidth:c(d),swell:(M,A)=>x+(y-x)*(.45+.55*s(M)*s(2*A-1)),base:x})}else i(h);let l=new Float32Array(e),u=new Float32Array(t),m=new Float32Array(n),f=new Uint16Array(o);return{position:l,normal:u,part:m,index:f,vertexCount:n.length,indexCount:o.length}}var ki=20*Math.PI/180;function sc(e,t,n,o,r){let i=new Float32Array(t),a=m=>e[m*3],s=m=>e[m*3+2],c=Math.cos(ki),l=0,u=(m,f)=>{let h=f-m,d=r?.(m),p=d!==void 0;for(let M=m+1;!p&&M<f-1;M++){let A=a(M)-a(M-1),w=s(M)-s(M-1),g=a(M+1)-a(M),S=s(M+1)-s(M),v=Math.hypot(A,w)*Math.hypot(g,S);v>1e-9&&(A*g+w*S)/v<c&&(p=!0)}let b=0,x=0,y=!1;if(p){if(d)[b,x]=d;else{for(let A=m;A<f;A++)b+=a(A),x+=s(A);b/=h,x/=h}let M=0;for(let A=m+1;A<f;A++)M=Math.max(M,Math.hypot(a(A)-a(A-1),s(A)-s(A-1)));y=h>=3&&Math.hypot(a(f-1)-a(m),s(f-1)-s(m))<=M*1.6}for(let M=m;M<f;M++){let[A,w]=p?[b,x]:o(M),g=A-a(M),S=w-s(M);if(h>=2&&!(d&&h<3)){let v=y?m+(M-1-m+h)%h:Math.max(m,M-1),P=y?m+(M+1-m)%h:Math.min(f-1,M+1),E=a(P)-a(v),k=s(P)-s(v),L=Math.hypot(E,k);if(L>1e-6){let I=-k/L,R=E/L;I*g+R*S<0&&(I=-I,R=-R),g=I,S=R}}i[M]=g===0&&S===0?0:Math.atan2(g,S)}};for(let m=1;m<=t;m++)(m===t||n(m)!==n(l))&&(u(l,m),l=m);return i}var Oi=78,cc=18;function lc(){let e=[],t=[],n=[],o=[],r=[],i=[{n:[1,0,0],c:[[1,0,0],[1,1,0],[1,1,1],[1,0,1]]},{n:[-1,0,0],c:[[0,0,1],[0,1,1],[0,1,0],[0,0,0]]},{n:[0,1,0],c:[[0,1,0],[0,1,1],[1,1,1],[1,1,0]]},{n:[0,-1,0],c:[[0,0,1],[0,0,0],[1,0,0],[1,0,1]]},{n:[0,0,1],c:[[0,0,1],[1,0,1],[1,1,1],[0,1,1]]},{n:[0,0,-1],c:[[1,0,0],[0,0,0],[0,1,0],[1,1,0]]}];for(let s of[{part:1,min:[-1,.36,-.95],max:[1,.45,1]},{part:2,min:[-1,Bt,-1],max:[1,Kt,-.72]}])for(let c of i){let l=e.length/3,u=c.n[1]+(s.part===2?Math.abs(c.n[0])*(1-or)/(Kt-Bt):0),m=Math.hypot(c.n[0],u,c.n[2]),f=[c.n[0]/m,u/m,c.n[2]/m];for(let[h,d]of c.c.entries()){let p=d.map((b,x)=>s.min[x]+b*(s.max[x]-s.min[x]));s.part===2&&(p[0]*=1-d[1]*(1-or)),e.push(...p),t.push(...f),n.push(s.part),o.push(...[[-1,-1],[1,-1],[1,1],[-1,1]][h])}r.push(l,l+1,l+2,l,l+2,l+3)}let a=e.length/3;for(let[s,c]of[[-1,-1],[1,-1],[1,1],[-1,1]])e.push(s,c,0),t.push(0,1,0),n.push(0),o.push(s,c);return r.push(a,a+1,a+2,a,a+2,a+3),r.push(...r.slice(12,18),...r.slice(60,66),...r.slice(72,78)),{position:new Float32Array(e),normal:new Float32Array(t),surface:new Float32Array(n),uv:new Float32Array(o),index:new Uint16Array(r)}}var yc=require("ogl");var zd=/^#?([\da-f]{3}|[\da-f]{6})$/i;function uc(e){let t=e.replace("#","");return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}}function Ud(e){let t=zd.exec((e??"").trim());if(!t)return null;let n=t[1].length===3?t[1].split("").map(r=>r+r).join(""):t[1],o=parseInt(n,16);return[o>>16&255,o>>8&255,o&255]}function ve(e){let t=Ud(e);return t?[t[0]/255,t[1]/255,t[2]/255]:null}function Fi(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function jd(e){return .2126*Fi(e[0])+.7152*Fi(e[1])+.0722*Fi(e[2])}function mc(e){return jd([e[0]*255,e[1]*255,e[2]*255])}function Wd(e){return .2126*e[0]+.7152*e[1]+.0722*e[2]}function Se(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n]}function It(e,t){let n=Wd(e);return Se(e,[n,n,n],t)}function fc({r:e,g:t,b:n}){let o=e/255,r=t/255,i=n/255,a=Math.max(o,r,i),s=Math.min(o,r,i),c=(a+s)/2;if(a===s)return{h:0,s:0,l:c};let l=a-s,u=c>.5?l/(2-a-s):l/(a+s),m;return a===o?m=((r-i)/l+(r<i?6:0))/6:a===r?m=((i-o)/l+2)/6:m=((o-r)/l+4)/6,{h:m,s:u,l:c}}var Di=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,Ni=e=>e<=.0031308?12.92*e:1.055*Math.max(0,e)**.4166666666666667-.055,Bi=e=>Math.min(1,Math.max(0,e));function ar(e){let t=Di(e[0]),n=Di(e[1]),o=Di(e[2]),r=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*o),i=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*o),a=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*o);return[.2104542553*r+.793617785*i-.0040720468*a,1.9779984951*r-2.428592205*i+.4505937099*a,.0259040371*r+.7827717662*i-.808675766*a]}function ir([e,t,n]){let o=(e+.3963377774*t+.2158037573*n)**3,r=(e-.1055613458*t-.0638541728*n)**3,i=(e-.0894841775*t-1.291485548*n)**3;return[Bi(Ni(4.0767416621*o-3.3077115913*r+.2309699292*i)),Bi(Ni(-1.2684380046*o+2.6097574011*r-.3413193965*i)),Bi(Ni(-.0041960863*o-.7034186147*r+1.707614701*i))]}var sr=e=>ar(e)[0];function fo(e){let[,t,n]=ar(e);return Math.hypot(t,n)}function fn(e,t,n){let[,o,r]=ar(e);if(n===void 0)return ir([t,o,r]);let i=Math.hypot(o,r),a=i===0?0:n/i;return ir([t,o*a,r*a])}function hc(e,t,n){let[o,r,i]=ar(e);return o>=t&&o<=n?e:ir([Math.min(n,Math.max(t,o)),r,i])}function cr(e){return ir([e,-.004,-.008])}var je=["available","held","sold","selected","dimmed"];function ho(e){let t=je.indexOf(e);return t<0?0:t}var pc={available:[.24,.82,.52],held:[.34,.39,.45],sold:[.34,.39,.45],selected:[.24,.74,1],dimmed:[.28,.32,.37]};function Xd(e){let t=.2126*e[0]+.7152*e[1]+.0722*e[2],n=.78,o=.86;return[(t+(e[0]-t)*n)*o,(t+(e[1]-t)*n)*o,(t+(e[2]-t)*n)*o]}var dc={day:{ground:.9,deck:.84,fascia:.77,shell:.79,seatMin:.45,seatMax:.58,unavailable:.58,dimmed:.62,sectionDeck:.66,sectionDeckChromaShare:.8,sectionDeckChromaCap:.11,stageTop:.52,stageWall:.42},night:{ground:.26,deck:.34,fascia:.28,shell:.32,seatMin:.64,seatMax:.8,unavailable:.42,dimmed:.39,sectionDeck:.34,sectionDeckChromaShare:.45,sectionDeckChromaCap:.05,stageTop:0,stageWall:0}},lr=.012;function Vt(e){return sr(e.tierTop)>.6}function hn(e){return e?dc.day:dc.night}function bc(e,t){let n=hn(t);return hc(Xd(e),n.seatMin,n.seatMax)}var Vi={ground:[.07,.085,.11],tierTop:[.24,.28,.34],tierWall:[.17,.2,.25],stageTop:[.94,.7,.38],stageWall:[.48,.33,.18],decorTop:[.22,.25,.29],decorWall:[.15,.17,.2],gaTop:[.24,.28,.33],gaWall:[.16,.19,.23],boothTop:[.3,.33,.38],boothWall:[.2,.23,.27],tableTop:[.38,.34,.29],tableWall:[.24,.21,.18]},dn={top:[.05,.06,.08],bottom:[.1,.12,.15]};function re(e,t){return[Math.min(1,e[0]*t),Math.min(1,e[1]*t),Math.min(1,e[2]*t)]}function Kd(){let e=typeof window<"u"&&window.devicePixelRatio||1,t=navigator.deviceMemory,n=typeof t=="number"&&t<=4?1.5:2;return Math.min(e,n)}var gc=1e4;function Yd(e){if(typeof navigator<"u"){let t=navigator.deviceMemory;if(typeof t=="number"&&t<=4)return 0}return e>=1.5?2:4}var ur=class{constructor(t,n){this.clearRgb=[0,0,0];this.container=t,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.");let o=Kd();this.smoothingSamples=Yd(o),this.renderer=new yc.Renderer({canvas:this.canvas,dpr:o,alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[dn.top[0],dn.top[1],dn.top[2]],this.gl.clearColor(this.clearRgb[0],this.clearRgb[1],this.clearRgb[2],1),t.appendChild(this.canvas),this.lostHandler=r=>{r.preventDefault(),n.onContextLost()},this.restoredHandler=()=>n.onContextRestored(),this.canvas.addEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.restoredHandler,!1),this.resize()}setClearColor(t){this.clearRgb=[t[0],t[1],t[2]],this.gl.clearColor(t[0],t[1],t[2],1)}get clearColor(){return this.clearRgb}resize(){let t=Math.max(1,this.container.clientWidth||this.canvas.clientWidth||1),n=Math.max(1,this.container.clientHeight||this.canvas.clientHeight||1);return this.renderer.setSize(t,n),{width:t,height:n}}get pixelHeight(){return this.renderer.height*this.renderer.dpr}get aspect(){return this.renderer.width/Math.max(1,this.renderer.height)}dispose(){this.canvas.removeEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.restoredHandler,!1);let t=this.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}simulateContextLossCycle(){let t=this.gl.getExtension("WEBGL_lose_context");t&&(t.loseContext(),setTimeout(()=>{t.restoreContext&&t.restoreContext()},300))}};var Yt=require("ogl"),$d=`#version 300 es
21
+ in vec2 position;
22
+ in vec2 uv;
23
+ out vec2 vUv;
24
+ void main() {
25
+ vUv = uv;
26
+ gl_Position = vec4(position, 0.0, 1.0);
27
+ }`,Zd=`#version 300 es
28
+ precision highp float;
29
+ uniform sampler2D tFrame;
30
+ in vec2 vUv;
31
+ out vec4 fragColor;
32
+ void main() {
33
+ fragColor = vec4(texture(tFrame, vUv).rgb, 1.0);
34
+ }`,mr=class{constructor(t,n,o){this.gl=t;this.renderer=n;this.samples=o;this.fbo=null;this.colour=null;this.depth=null;this.resolved=null;this.copy=null;this.width=0;this.height=0;this.active=null;this.unavailable=!1}begin(t){if(this.active=null,!t||this.unavailable||this.samples<2)return null;let n=this.gl,o=n.drawingBufferWidth,r=n.drawingBufferHeight;return o<1||r<1?null:(!this.fbo||o!==this.width||r!==this.height)&&(this.release(),!this.allocate(o,r))?(this.unavailable=!0,this.release(),null):(this.active={target:n.FRAMEBUFFER,buffer:this.fbo,width:o,height:r,depth:!0,stencil:!1},this.active)}end(){if(!this.active||!this.resolved||!this.copy)return;let t=this.gl,{width:n,height:o}=this.active;this.active=null,t.bindFramebuffer(t.READ_FRAMEBUFFER,this.fbo),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,this.resolved.buffer),t.blitFramebuffer(0,0,n,o,0,0,n,o,t.COLOR_BUFFER_BIT,t.NEAREST),this.unbind(),this.renderer.render({scene:this.copy,clear:!1})}reset(){this.fbo=null,this.colour=null,this.depth=null,this.resolved=null,this.copy=null,this.active=null,this.width=0,this.height=0}dispose(){this.release()}allocate(t,n){let o=this.gl,r=Math.min(this.samples,o.getParameter(o.MAX_SAMPLES));if(r<2)return!1;this.fbo=o.createFramebuffer(),this.colour=o.createRenderbuffer(),this.depth=o.createRenderbuffer(),o.bindRenderbuffer(o.RENDERBUFFER,this.colour),o.renderbufferStorageMultisample(o.RENDERBUFFER,r,o.RGBA8,t,n),o.bindRenderbuffer(o.RENDERBUFFER,this.depth),o.renderbufferStorageMultisample(o.RENDERBUFFER,r,o.DEPTH_COMPONENT24,t,n),o.bindRenderbuffer(o.RENDERBUFFER,null),o.bindFramebuffer(o.FRAMEBUFFER,this.fbo),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.RENDERBUFFER,this.colour),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.RENDERBUFFER,this.depth);let i=o.checkFramebufferStatus(o.FRAMEBUFFER)===o.FRAMEBUFFER_COMPLETE;if(this.unbind(),!i)return!1;this.resolved=new Yt.RenderTarget(this.gl,{width:t,height:n,depth:!1,minFilter:o.NEAREST,magFilter:o.NEAREST});let a=new Yt.Program(this.gl,{vertex:$d,fragment:Zd,depthTest:!1,depthWrite:!1,cullFace:!1,uniforms:{tFrame:{value:this.resolved.texture}}});return this.copy=new Yt.Mesh(this.gl,{geometry:new Yt.Triangle(this.gl),program:a}),this.copy.frustumCulled=!1,this.width=t,this.height=n,!0}unbind(){let t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null),this.renderer.state.framebuffer=null}release(){let t=this.gl;if(this.fbo&&t.deleteFramebuffer(this.fbo),this.colour&&t.deleteRenderbuffer(this.colour),this.depth&&t.deleteRenderbuffer(this.depth),this.resolved){for(let n of this.resolved.textures)t.deleteTexture(n.texture);t.deleteFramebuffer(this.resolved.buffer)}this.copy&&(this.copy.geometry.remove(),this.copy.program.remove()),this.reset()}};var fr=class{constructor(){this.limit=1/0;this.recent=[];this.slow=0;this.last=null}allows(t){return t<this.limit}frame(t,n,o){if(!t){this.last=null;return}let r=this.last===null?null:o-this.last;if(this.last=o,r===null||r>250)return;let i=r>25;this.recent.push(i),i&&(this.slow+=1),this.recent.length>30&&this.recent.shift()&&(this.slow-=1),this.slow>=8&&(this.limit=Math.min(this.limit,n*.8),this.recent=[],this.slow=0)}};var Tn=require("ogl"),We=Math.PI/180,Gi=15*We,Hi=80*We,Cn=.12,xc=35,zi=1.25,Mc=.006,qd=4,Ln=.82,po=1/Ln,Qd=.12,Jd=2;function ep(e,t){return{azimuth:0-e*Mc,polar:-t*Mc}}function vc(e,t,n){let o=Math.max(Jd,Math.max(1,t)*Qd),r=n*qd;return{minDist:e?Math.min(e.minDist,o):o,maxDist:e?Math.max(e.maxDist,r):r}}var tp=1.5;function np(e,t,n){let o=Math.max(1,n)*tp;if(!e)return{anchor:[t[0],t[1],t[2]],limit:o};let[r,i,a]=e.anchor,s=t[1]-i,c=Math.max(Math.abs(t[0]-r),Math.abs(t[2]-a),s>=0?s:-s*2);return{anchor:e.anchor,limit:Math.max(e.limit,c+o)}}function op(e,t,n,o,r,i,a,s){let c=Math.sin(n),l=[c*Math.sin(t),Math.cos(n),c*Math.cos(t)],u=[e[0]+o*l[0],e[1]+o*l[1],e[2]+o*l[2]],m=[-l[0],-l[1],-l[2]],f=[-m[2],0,m[0]],h=Math.hypot(f[0],f[2])||1;f=[f[0]/h,0,f[2]/h];let d=[f[1]*m[2]-f[2]*m[1],f[2]*m[0]-f[0]*m[2],f[0]*m[1]-f[1]*m[0]],p=Math.tan(r*We/2),b=p*(i>0?i:1),x=[0,1,2].map(A=>m[A]+a*b*f[A]+s*p*d[A]);if(x[1]>=-1e-6)return null;let y=(e[1]-u[1])/x[1],M=Math.hypot(x[0],x[1],x[2]);return!(y>0)||y*M>o*rp?null:[u[0]+x[0]*y,e[1],u[2]+x[2]*y]}var Sc=3,rp=4,wc=.72,ip=.6;function ap(e,t,n){return e!=="auto"?e:n!==null&&t<n*ip?"pan":"orbit"}function Pc(e,t){let n=Math.sin(t),o=-n*Math.sin(e),r=-Math.cos(t),i=-n*Math.cos(e);if(Math.abs(r)>.999)return null;let a=-i,s=o,c=Math.hypot(a,s);return a/=c,s/=c,{fx:o,fy:r,fz:i,rx:a,rz:s,ux:-s*r,uy:s*o-a*i,uz:a*r}}var sp=.4;function cp(e,t,n,o,r,i){let a=[e.center[0],e.center[1],e.center[2]],s=i(a),c=e.fitPoints,l=Pc(o,r);if(!c||c.length<9||!l)return{center:a,distance:s};let{fx:u,fy:m,fz:f,rx:h,rz:d,ux:p,uy:b,uz:x}=l,y=Math.hypot(u,f),M=u/y,A=f/y,w=M*p+A*x,g=sp*Math.max(1,e.radius);for(let S=0;S<3;S++){let v=1/0,P=-1/0,E=1/0,k=-1/0;for(let N=0;N+2<c.length;N+=3){let O=c[N]-a[0],V=c[N+1]-a[1],z=c[N+2]-a[2],G=s+O*u+V*m+z*f;if(!(G>.001))continue;let T=(O*h+z*d)/(G*t),D=(O*p+V*b+z*x)/(G*n);T<v&&(v=T),T>P&&(P=T),D<E&&(E=D),D>k&&(k=D)}if(!Number.isFinite(v))break;let L=(v+P)/2*s*t,I=Math.abs(w)>.1?(E+k)/2*s*n/w:0,R=L*h+I*M,_=L*d+I*A;if(Math.hypot(a[0]+R-e.center[0],a[2]+_-e.center[2])>g){let N=a[0]-e.center[0],O=a[2]-e.center[2],V=N+R,z=O+_,G=g/Math.hypot(V,z);R=V*G-N,_=z*G-O}a=[a[0]+R,a[1],a[2]+_],s=i(a)}return{center:a,distance:s}}var hr=class{constructor(t,n,o,r){this.fovY=xc;this.target=new Tn.Vec3;this.azimuth=-30*We;this.polar=55*We;this.distance=10;this.azT=-30*We;this.polT=55*We;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 Tn.Vec3;this.panAnchor=new Tn.Vec3;this.panLimit=0;this.panBox=null;this.zoomPointResolver=null;this.primaryDragMode="auto";this.overviewDist=null;this.pinchAngle=0;this.camera=new Tn.Camera(t,{fov:xc,near:.1,far:5e3,aspect:1}),this.canvas=n,this.requestRender=o,this.onGesture=r,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 a=this.dragAction(),s=a==="orbit"?"pan":"orbit",c=i.button===2||i.button===1||i.shiftKey?s:a;this.panning=c==="pan",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(),this.pinchAngle=this.currentPinchAngle();let a=this.pinchCentroid();this.pinchCx=a.x,this.pinchCy=a.y}}},this.onPointerMove=i=>{if(!this.interactionEnabled||!this.activePointers.has(i.pointerId))return;if(this.activePointers.set(i.pointerId,{x:i.clientX,y:i.clientY}),this.activePointers.size>=2){let l=this.currentPinchDistance(),u=this.pinchCentroid();this.pinchDist>0&&(this.dollyAt(Math.exp((this.pinchDist-l)*.005),u.x,u.y),this.fireGesture()),this.pinchDist=l;let m=this.currentPinchAngle(),f=m-this.pinchAngle;f>Math.PI&&(f-=2*Math.PI),f<-Math.PI&&(f+=2*Math.PI),this.pinchAngle=m,Math.abs(f)>1e-4&&Math.abs(f)<.5&&(this.azT+=f,this.fireGesture()),this.panBy(u.x-this.pinchCx,u.y-this.pinchCy),this.pinchCx=u.x,this.pinchCy=u.y;return}let a=i.clientX-this.lastX,s=i.clientY-this.lastY;if(this.panning){this.lastX=i.clientX,this.lastY=i.clientY,(a!==0||s!==0)&&(this.panBy(a,s),this.fireGesture());return}if(!this.dragging)return;this.lastX=i.clientX,this.lastY=i.clientY,(a!==0||s!==0)&&this.fireGesture();let c=ep(a,s);this.azT+=c.azimuth,this.polT=Math.max(Gi,Math.min(Hi,this.polT+c.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 a=i.deltaMode===1?16:i.deltaMode===2?100:1,s=Math.max(-2,Math.min(2,i.deltaY*a/100));this.dollyAt(Math.exp(s*.22),i.clientX,i.clientY),this.fireGesture()},this.onKeyDown=i=>{if(!this.interactionEnabled)return;let a=7*We;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"?a:-a;else if(i.key==="ArrowUp"||i.key==="ArrowDown")this.polT=Math.max(Gi,Math.min(Hi,this.polT+(i.key==="ArrowUp"?-a:a)));else if(i.key==="+"||i.key==="=")this.dollyBy(Ln);else if(i.key==="-"||i.key==="_")this.dollyBy(po);else return;i.preventDefault(),this.fireGesture(),this.requestRender()},n.addEventListener("pointerdown",this.onPointerDown),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerup",this.onPointerUp),n.addEventListener("pointercancel",this.onPointerUp),n.addEventListener("wheel",this.onWheel,{passive:!1}),n.addEventListener("keydown",this.onKeyDown),n.addEventListener("contextmenu",this.onContextMenu)}pinchCentroid(){let t=[...this.activePointers.values()];if(!t.length)return{x:0,y:0};let n=0,o=0;for(let r of t)n+=r.x,o+=r.y;return{x:n/t.length,y:o/t.length}}panBy(t,n){let o=this.canvas.clientHeight||1,r=2*this.distance*Math.tan(this.fovY*We/2)/o,i=Math.sin(this.azimuth),a=Math.cos(this.azimuth),s=a,c=-i,l=Math.cos(this.polar),u=Math.sin(this.polar),m=-i*l,f=-a*l;this.targetT.x+=(-t*s+n*m)*r,this.targetT.z+=(-t*c+n*f)*r,this.targetT.y+=n*u*r,this.clampPan(),this.requestRender()}widenPanBox(t){this.panBox=np(this.panBox,t.center,t.radius),this.panAnchor.set(this.panBox.anchor[0],this.panBox.anchor[1],this.panBox.anchor[2]),this.panLimit=this.panBox.limit}clampPan(){if(this.panLimit<=0)return;let t=this.panLimit,n=this.panAnchor.x,o=this.panAnchor.y,r=this.panAnchor.z;this.targetT.x=Math.max(n-t,Math.min(n+t,this.targetT.x)),this.targetT.z=Math.max(r-t,Math.min(r+t,this.targetT.z)),this.targetT.y=Math.max(o-t*.5,Math.min(o+t,this.targetT.y))}fireGesture(){this.gestureFired||(this.gestureFired=!0,this.onGesture?.())}currentPinchAngle(){let[t,n]=[...this.activePointers.values()];return t&&n?Math.atan2(n.y-t.y,n.x-t.x):0}dragAction(){return ap(this.primaryDragMode,this.distT,this.overviewDist)}currentPinchDistance(){let t=[...this.activePointers.values()];return t.length<2?0:Math.hypot(t[0].x-t[1].x,t[0].y-t[1].y)}dollyBy(t){this.distT=Math.max(this.minDist,Math.min(this.maxDist,this.distT*t)),this.requestRender()}dollyAt(t,n,o){let r=this.distT,i=this.canvas.getBoundingClientRect?.(),a=this.zoomPointResolver?.(n,o)??null;if(a){this.distT=Math.max(Sc,Math.min(this.maxDist,this.distT*t)),this.minDist=Math.min(this.minDist,Math.max(Sc,this.distT)),this.requestRender(),this.scaleTargetAbout(a,this.distT/r);return}let s=i&&i.width>0&&i.height>0?op([this.targetT.x,this.targetT.y,this.targetT.z],this.azT,this.polT,this.distT,this.fovY,this.camera.aspect||i.width/i.height,(n-i.left)/i.width*2-1,1-(o-i.top)/i.height*2):null;this.dollyBy(t),s&&this.scaleTargetAbout(s,this.distT/r)}scaleTargetAbout(t,n){!Number.isFinite(n)||n===1||(this.targetT.x=t[0]+(this.targetT.x-t[0])*n,this.targetT.y=t[1]+(this.targetT.y-t[1])*n,this.targetT.z=t[2]+(this.targetT.z-t[2])*n,this.clampPan())}setZoomPointResolver(t){this.zoomPointResolver=t}zoomBy(t){this.interactionEnabled&&(this.dollyBy(t),this.fireGesture())}dollyLimitState(){return{atMin:this.distT<=this.minDist+1e-6,atMax:this.distT>=this.maxDist-1e-6}}setPrimaryDragMode(t){this.primaryDragMode=t}setInteractionEnabled(t){this.interactionEnabled=t,!t&&(this.activePointers.clear(),this.dragging=!1,this.panning=!1,this.pinchDist=0)}frame(t,n=!1,o,r=!1,i){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.target.set(t.center[0],t.center[1],t.center[2]),this.targetT.copy(this.target),this.widenPanBox(t);let a=Math.max(1,t.radius),s=this.fovY*We/2,c=r?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,l=Math.atan(Math.tan(s)*c);this.azT=o??-30*We,this.polT=Math.max(15,Math.min(80,i?.polarDeg??55))*We;let u=this.framedOn(t,s,l),m=u.distance;this.target.set(u.center[0],u.center[1],u.center[2]),this.targetT.copy(this.target),this.distT=m*Math.max(1.05,Math.min(2,i?.margin??zi)),this.envelope=vc(this.envelope,a,m),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.overviewDist===null&&(this.overviewDist=this.distT),n?(this.azimuth=this.azT,this.polar=12*We,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(t){if(!(t>0)||!Number.isFinite(t))return;let n=this.camera.aspect;if(this.interactionEnabled&&n>0){let o=Math.min(n,1)/Math.min(t,1);this.distance*=o,this.distT*=o,this.overviewDist!==null&&(this.overviewDist*=o),this.maxDist=Math.max(this.maxDist,this.distance,this.distT),this.applyPosition()}this.camera.perspective({aspect:t})}glideTo(t,n){this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.widenPanBox(t),this.targetT.set(t.center[0],t.center[1],t.center[2]);let o=this.fovY*We/2,r=Math.atan(Math.tan(o)*(this.camera.aspect||1));this.azT=this.azimuth,this.polT=Math.max(15,Math.min(80,n?.polarDeg??55))*We;let i=this.framedOn(t,o,r),a=i.distance;this.targetT.set(i.center[0],i.center[1],i.center[2]),this.distT=a*Math.max(1.05,Math.min(2,n?.margin??zi)),this.envelope=vc(this.envelope,Math.max(1,t.radius),a),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.requestRender()}frameSoft(t,n,o=!1,r){this.target.set(t.center[0],t.center[1],t.center[2]),this.targetT.copy(this.target),this.widenPanBox(t),this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect});let i=this.fovY*We/2,a=o?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,s=Math.atan(Math.tan(i)*a);this.azT=n??this.azimuth,this.polT=Math.max(15,Math.min(80,r?.polarDeg??55))*We;let c=this.framedOn(t,i,s);this.targetT.set(c.center[0],c.center[1],c.center[2]),this.distT=c.distance*Math.max(1.05,Math.min(2,r?.margin??zi))}framedOn(t,n,o){return cp(t,Math.tan(o),Math.tan(n),this.azT,this.polT,r=>this.fitDistance({...t,center:r},n,o,this.azT,this.polT))}fitDistance(t,n,o,r,i){let a=Math.max(1,t.radius),s=Math.max(a/Math.tan(n),a/Math.tan(o)),c=t.box;if(!c)return s;let l=Pc(r,i);if(!l)return s;let{fx:u,fy:m,fz:f,rx:h,rz:d,ux:p,uy:b,uz:x}=l,y=Math.tan(o),M=Math.tan(n),A=1;for(let E=0;E<8;E++){let k=(E&1?c.max[0]:c.min[0])-t.center[0],L=(E&2?c.max[1]:c.min[1])-t.center[1],I=(E&4?c.max[2]:c.min[2])-t.center[2],R=k*u+L*m+I*f,_=Math.abs(k*h+I*d),F=Math.abs(k*p+L*b+I*x);A=Math.max(A,_/y-R,F/M-R)}let w=Math.min(s,Math.max(A,a*.35)),g=t.fitPoints;if(!g||g.length<9)return w;let S=0,v=1/(y*wc),P=1/(M*wc);for(let E=0;E+2<g.length;E+=3){let k=g[E]-t.center[0],L=g[E+1]-t.center[1],I=g[E+2]-t.center[2],R=k*u+L*m+I*f,_=Math.abs(k*h+I*d),F=Math.abs(k*p+L*b+I*x);S=Math.max(S,_*v-R,F*P-R)}return Math.min(w*1.5,Math.max(w*.55,S))}updateClipping(t){let n=this.camera.position.x-t.center[0],o=this.camera.position.y-t.center[1],r=this.camera.position.z-t.center[2],i=Math.hypot(this.camera.position.x-this.target.x,this.camera.position.y-this.target.y,this.camera.position.z-this.target.z),a=this.interactionEnabled&&Math.abs(i-this.distance)<=this.distance*.01,{near:s,far:c}=mp(Math.hypot(n,o,r),t.radius,a?this.distance:null);this.camera.perspective({near:s,far:c,aspect:this.camera.aspect})}update(){let t=this.azT-this.azimuth,n=this.polT-this.polar,o=this.distT-this.distance,r=this.targetT.x-this.target.x,i=this.targetT.y-this.target.y,a=this.targetT.z-this.target.z,s=Math.max(1e-4,this.distance*1e-4),c=Math.abs(t)>1e-4||Math.abs(n)>1e-4||Math.abs(o)>1e-4||Math.abs(r)>s||Math.abs(i)>s||Math.abs(a)>s;return this.azimuth+=t*Cn,this.polar+=n*Cn,this.distance+=o*Cn,this.target.x+=r*Cn,this.target.y+=i*Cn,this.target.z+=a*Cn,c&&this.applyPosition(),c}get currentAzimuth(){return this.azimuth}get currentDistance(){return this.distance}get targetDistance(){return this.distT}syncFromCamera(){let t=this.camera.position.x-this.target.x,n=this.camera.position.y-this.target.y,o=this.camera.position.z-this.target.z,r=Math.hypot(t,n,o)||1,i=Math.max(Gi,Math.min(Hi,Math.acos(Math.max(-1,Math.min(1,n/r)))));this.distance=this.distT=r,this.polar=this.polT=i,this.azimuth=this.azT=Math.atan2(t,o)}snapshot(){let t=this.target.clone(),n=this.targetT.clone(),{azimuth:o,azT:r,polar:i,polT:a,distance:s,distT:c}=this,l=this.camera.position.clone(),u=[...this.camera.quaternion],m=this.camera.fov;return()=>{this.target.copy(t),this.targetT.copy(n),Object.assign(this,{azimuth:o,azT:r,polar:i,polT:a,distance:s,distT:c}),this.camera.position.copy(l),this.camera.quaternion.set(u[0],u[1],u[2],u[3]),this.camera.perspective({fov:m,aspect:this.camera.aspect}),this.camera.updateMatrixWorld()}}setTarget(t){this.target.set(t[0],t[1],t[2]),this.targetT.copy(this.target)}resumeAfterFlight(t){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),t&&this.target.set(t[0],t[1],t[2]),this.targetT.copy(this.target),this.syncFromCamera()}applyPosition(){let t=Math.sin(this.polar),n=this.target.x+this.distance*t*Math.sin(this.azimuth),o=this.target.y+this.distance*Math.cos(this.polar),r=this.target.z+this.distance*t*Math.cos(this.azimuth);this.camera.position.set(n,o,r),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()}},lp=.1,up=.25;function mp(e,t,n){let o=Math.max(1,t)*1.18,r=n==null?up:Math.max(.05,n*lp),i=Math.max(r,e-o),a=Math.max(i+10,e+o);return{near:i,far:a}}var dr=class{constructor(t){this.rafId=0;this.running=!1;this.lastTime=0;this.fpsEma=0;this.rendered=0;this.tick=t=>{let n=this.lastTime?(t-this.lastTime)/1e3:.016666666666666666;if(this.lastTime=t,n>0){let r=1/n;this.fpsEma=this.fpsEma?this.fpsEma*.9+r*.1:r}this.rendered++,this.frame(n)?this.rafId=requestAnimationFrame(this.tick):(this.running=!1,this.rafId=0)};this.frame=t}requestRender(){this.running||(this.running=!0,this.lastTime=0,this.rafId=requestAnimationFrame(this.tick))}stats(){return{fps:this.running?Math.round(this.fpsEma):0,rendered:this.rendered,idle:!this.running}}stop(){this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=0,this.running=!1}};function Ac(e){let t=!1;return n=>{n!==t&&(t=n,n?e.dataset.slReady="1":delete e.dataset.slReady)}}function Ui(e,t,n){return Math.max(t,Math.min(n,e))}function fp(e){return Ui(e,0,1)}function Rc(e){let t=fp(e);return t*t*(3-2*t)}var kn=2.5,hp=1.15,bo=12,On=22,ji=30,Wi=4,pr=8192;var sS=On+Wi;function Ec(e,t){let n=t*1.4,o=t*3.2;if(e<=n)return{scale:1,fade:0,minPixels:kn};let r=Math.min(1,(e-n)/Math.max(.001,o-n));return{scale:1-r*.4,fade:r*.55,minPixels:kn+r*(hp-kn)}}function Ic(e,t,n){return!(e>0)||!(t>0)||!(n>0)?!1:t*n/e>=64}var dp=12;function _c(e,t,n,o,r){if(!(e>0)||!(t>0)||!(n>0)||!(o>0)||!(r>0))return!1;let i=Math.tan(o/2*Math.PI/180);if(!(i>0))return!1;let a=t/(n*i)*(r/2);return Math.PI*a*a/e>=dp}var Xi=[{key:"wheelchair",label:"Wheelchair space",short:"Wheelchair",icon:"\u267F"},{key:"companion",label:"Companion seat",short:"Companion",icon:"\u{1F9D1}\u200D\u{1F91D}\u200D\u{1F9D1}"},{key:"semi-ambulatory",label:"Semi-ambulatory (limited mobility)",short:"Limited mobility",icon:"\u{1F9AF}"},{key:"designated-aisle",label:"Designated aisle / transfer seat",short:"Aisle transfer",icon:"AS"},{key:"step-free",label:"Step-free accessible seat",short:"Step-free",icon:"SF"},{key:"hearing",label:"Assistive listening",short:"Hearing",icon:"\u{1F9BB}"},{key:"cart",label:"CART live-caption view",short:"CART captions",icon:"CC"},{key:"sign-language",label:"Sign-language view",short:"Sign language",icon:"\u{1F91F}"},{key:"low-vision",label:"Blind / low-vision viewing",short:"Low vision",icon:"LV"},{key:"sensory-friendly",label:"Quiet / sensory-friendly seating",short:"Sensory-friendly",icon:"QS"},{key:"plus-size",label:"Plus-size seat",short:"Plus-size",icon:"\u{1F4BA}"},{key:"lift-armrest",label:"Lift-up armrest",short:"Lift armrest",icon:"\u2195\uFE0F"}],lS=new Map(Xi.map(e=>[e.key,e]));var pp={wheelchair:"#3b82f6",companion:"#8b5cf6","semi-ambulatory":"#0ea5e9","designated-aisle":"#0284c7","step-free":"#16a34a",hearing:"#14b8a6",cart:"#7c3aed","sign-language":"#f59e0b","low-vision":"#d97706","sensory-friendly":"#6366f1","plus-size":"#ec4899","lift-armrest":"#22c55e"};function br(e){let t=e?.[0];return t&&pp[t]||"#3b82f6"}var bp=[{key:"obstructedView",label:"Obstructed view",short:"Obstructed",icon:"\u26D4"},{key:"restrictedView",label:"Restricted view",short:"Restricted",icon:"\u{1F441}"},{key:"premium",label:"Premium seat",short:"Premium",icon:"\u2605"}],uS=new Map(bp.map(e=>[e.key,e]));var yp=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],mS=new Set(yp);var Tc=[{key:"circle",label:"Standard seat",shortLabel:"Standard",useCase:"General assigned seating",group:"general",path:null,bounds:null,mark:null},{key:"theatre",label:"Theatre chair",shortLabel:"Theatre",useCase:"Auditoriums, arenas and stadium stands",group:"fixed",path:"M4.5 3.5 Q4.5 1.5 6.5 1.5 L17.5 1.5 Q19.5 1.5 19.5 3.5 L19.5 13 L4.5 13 Z M3.5 12 L20.5 12 Q22.5 12 22.5 14 L22.5 21 Q22.5 22.5 21 22.5 Q19.5 22.5 19.5 21 L19.5 17.5 L4.5 17.5 L4.5 21 Q4.5 22.5 3 22.5 Q1.5 22.5 1.5 21 L1.5 14 Q1.5 12 3.5 12 Z",bounds:{x:1.5,y:1.5,width:21,height:21},mark:{x:12,y:10,radius:6}},{key:"dining",label:"Dining chair",shortLabel:"Dining",useCase:"Banquets, restaurants and table seating",group:"flexible",path:"M7 1 Q6 1 6 2.5 L6.75 10.5 L5 10.5 Q4 10.5 4 12 L4 14 Q4 15 5.25 15 L6 15 L4 23 L7 23 L9.5 15 L14.5 15 L17 23 L20 23 L18 15 L18.75 15 Q20 15 20 14 L20 12 Q20 10.5 19 10.5 L17.25 10.5 L18 2.5 Q18 1 17 1 Z",bounds:{x:4,y:1,width:16,height:22},mark:{x:12,y:10,radius:4.5}},{key:"folding",label:"Folding chair",shortLabel:"Folding",useCase:"Concert floors, ceremonies and conferences",group:"flexible",path:"M6 2 Q5 2 5 3 L6 8 L18 8 L19 3 Q19 2 18 2 Z M5 9 L19 9 Q20 9 20 10.5 L19 13 L5 13 L4 10.5 Q4 9 5 9 Z M6 12 L18 12 L18.5 23 L16 23 L15.5 13 L8.5 13 L8 23 L5.5 23 Z",bounds:{x:4,y:2,width:16,height:21},mark:{x:12,y:5,radius:3}},{key:"armchair",label:"Premium armchair",shortLabel:"Armchair",useCase:"Boxes, lounges and club seating",group:"premium",path:"M3.5 4 Q3.5 1.5 6 1.5 L18 1.5 Q20.5 1.5 20.5 4 L20.5 13 L3.5 13 Z M1.5 12.5 Q1.5 10 3.25 10 Q5 10 5 12.5 L5 13.5 L19 13.5 L19 12.5 Q19 10 20.75 10 Q22.5 10 22.5 12.5 L22.5 19.5 Q22.5 22 20 22 L4 22 Q1.5 22 1.5 19.5 Z",bounds:{x:1.5,y:1.5,width:21,height:20.5},mark:{x:12,y:7.5,radius:5.5}},{key:"recliner",label:"Recliner",shortLabel:"Recliner",useCase:"Luxury cinemas and premium clubs",group:"premium",path:"M7 2 Q7 1 8.5 1 L15.5 1 Q17 1 17 2 L19 13 L5 13 Z M4 9 Q2 9 2 11.5 L2 16 Q2 18 4 18 L6 18 L6 15 L18 15 L18 18 L20 18 Q22 18 22 16 L22 11.5 Q22 9 20 9 Q18 9 18 11 L18 13 L6 13 L6 11 Q6 9 4 9 Z M7 17 L17 17 Q18 17 18.5 18.5 L19.5 22.5 L4.5 22.5 L5.5 18.5 Q6 17 7 17 Z",bounds:{x:2,y:1,width:20,height:21.5},mark:{x:12,y:8,radius:5}},{key:"stool",label:"Stool",shortLabel:"Stool",useCase:"Bars, high-tops and seating rails",group:"flexible",path:"M6 2.5 L18 2.5 Q22 2.5 22 6.5 L22 12 Q22 16 18 16 L6 16 Q2 16 2 12 L2 6.5 Q2 2.5 6 2.5 Z M6 15.5 L9.5 15.5 L7.5 22.5 L3 22.5 Z M14.5 15.5 L18 15.5 L20.5 22.5 L16 22.5 Z",bounds:{x:2,y:2.5,width:20,height:20},mark:{x:12,y:9.25,radius:6.5}},{key:"bench",label:"Bench place",shortLabel:"Bench",useCase:"Pews, bleachers and terraces",group:"fixed",path:"M2.5 0.5 L21.5 0.5 Q23 0.5 23 2 L23 5 Q23 6.5 21.5 6.5 L2.5 6.5 Q1 6.5 1 5 L1 2 Q1 0.5 2.5 0.5 Z M2 7.5 L22 7.5 Q23.5 7.5 23.5 9 L23.5 15.5 Q23.5 17 22 17 L18 17 L18 21.5 Q18 22.5 16.75 22.5 Q15.5 22.5 15.5 21.5 L15.5 17 L8.5 17 L8.5 21.5 Q8.5 22.5 7.25 22.5 Q6 22.5 6 21.5 L6 17 L2 17 Q0.5 17 0.5 15.5 L0.5 9 Q0.5 7.5 2 7.5 Z",bounds:{x:.5,y:.5,width:23,height:22},mark:{x:12,y:12.25,radius:4.75}}],Lc=Tc.map(e=>e.key),gp=new Map(Tc.map(e=>[e.key,e]));function Cc(e){return typeof e=="string"&&gp.has(e)}function kc(e,t){return Cc(e)?e:Cc(t?.seatGlyph)?t.seatGlyph:"circle"}var he=.02291666666666667,pt=1/he,xp=58,Mp=xp*he;var vp=3,Oc=0,Ki=120,Sp=0,wp=45,Pp=7,_t=1.2;function Yi(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function Ap(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Pp?e:vp}function $t(e,t={}){let n=Yi(t.floorBaseHeightM,Oc,Ki,0),o=Math.min(Ki,n+Ap(e.elevation)*Mp),r=e.height===void 0?o:Yi(e.height,Oc,Ki,o),i=Yi(e.rake,Sp,wp,0);return{height:r,rake:i}}var Dc=Et(require("earcut"),1),qi=Et(require("polygon-clipping"),1);var yS=Math.PI/180;function Xe(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function $i(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Zi(e){let t=0,n=0;for(let r of e)t+=r.x,n+=r.y;let o=e.length||1;return{x:t/o,y:n/o}}function Fn(e){return e.length?Zi(e):null}function mt(e){let t=0;for(let n=0,o=e.length;n<o;n+=1){let r=e[n],i=e[(n+1)%o];t+=r.x*i.y-i.x*r.y}return t/2}function Ze(e,t,n){let o=!1;for(let r=0,i=e.length-1;r<e.length;i=r++){let a=e[r],s=e[i];a.y>n!=s.y>n&&t<(s.x-a.x)*(n-a.y)/(s.y-a.y)+a.x&&(o=!o)}return o}var C=he,Rp=.002;function Ep(e,t,n){let o=Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2]),r=Math.hypot(n[0]-t[0],n[1]-t[1],n[2]-t[2]),i=Math.hypot(e[0]-n[0],e[1]-n[1],e[2]-n[2]),a=Math.max(o,r,i);if(a<1e-9)return!0;let s=(o+r+i)/2;return 2*Math.sqrt(Math.max(0,s*(s-o)*(s-r)*(s-i)))/a<Rp}var pn=class{constructor(t=16384){this.len=0;this.buf=new Float32Array(t)}push3(t,n,o){this.len+3>this.buf.length&&this.grow(this.len+3),this.buf[this.len++]=t,this.buf[this.len++]=n,this.buf[this.len++]=o}push1(t){this.len+1>this.buf.length&&this.grow(this.len+1),this.buf[this.len++]=t}grow(t){let n=this.buf.length*2;for(;n<t;)n*=2;let o=new Float32Array(n);o.set(this.buf.subarray(0,this.len)),this.buf=o}get length(){return this.len}toArray(){return this.buf.slice(0,this.len)}},xr=class{constructor(){this.pos=new pn;this.nor=new pn;this.col=new pn;this.flr=new pn;this.mat=new pn;this.currentFloor=0;this.currentMaterial=0}setFloor(t){this.currentFloor=t}setMaterial(t){this.currentMaterial=t}tri(t,n,o,r,i,a=i,s=i,c){if(Ep(t,n,o))return;this.pos.push3(t[0],t[1],t[2]),this.pos.push3(n[0],n[1],n[2]),this.pos.push3(o[0],o[1],o[2]),this.nor.push3(r[0],r[1],r[2]),this.nor.push3(r[0],r[1],r[2]),this.nor.push3(r[0],r[1],r[2]),this.col.push3(i[0],i[1],i[2]),this.col.push3(a[0],a[1],a[2]),this.col.push3(s[0],s[1],s[2]),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor);let l=this.currentMaterial;this.mat.push1(c?.[0]??l),this.mat.push1(c?.[1]??l),this.mat.push1(c?.[2]??l)}triN(t,n,o,r,i,a,s,c=s,l=s){[...t,...n,...o].every(Number.isFinite)&&(this.pos.push3(t[0],t[1],t[2]),this.pos.push3(n[0],n[1],n[2]),this.pos.push3(o[0],o[1],o[2]),this.nor.push3(r[0],r[1],r[2]),this.nor.push3(i[0],i[1],i[2]),this.nor.push3(a[0],a[1],a[2]),this.col.push3(s[0],s[1],s[2]),this.col.push3(c[0],c[1],c[2]),this.col.push3(l[0],l[1],l[2]),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial))}get vertexCount(){return this.pos.length/3}build(){return{position:this.pos.toArray(),normal:this.nor.toArray(),color:this.col.toArray(),floor:this.flr.toArray(),material:this.mat.toArray(),count:this.pos.length/3}}};function Ip(e,t,n){let o=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=n[0]-e[0],s=n[1]-e[1],c=n[2]-e[2],l=r*c-i*s,u=i*a-o*c,m=o*s-r*a,f=Math.hypot(l,u,m)||1;return l/=f,u/=f,m/=f,[l,u,m]}function _p(e,t){let n=[...e],o=[];for(let a of e)o.push(a.x,a.y);let r=[];if(t){for(let a of t)if(!(a.length<3)){r.push(n.length);for(let s of a)n.push(s),o.push(s.x,s.y)}}let i=(0,Dc.default)(o,r.length?r:void 0,2);return{pts:n,tris:i}}function Ct(e){return mt(e)<0?[...e].reverse():e}var Cp=3;function Tp(e,t,n,o){let r=o(e),i=o(t),a=o(n),s=(h,d,p,b)=>Math.abs(o({x:(h.x+d.x)/2,y:(h.y+d.y)/2})-(p+b)/2),c=(e.x+t.x+n.x)/3,l=(e.y+t.y+n.y)/3,u=(r+i+a)/3,m=Math.max(s(e,t,r,i),s(t,n,i,a),s(n,e,a,r),Math.abs(o({x:c,y:l})-u)),f=(h,d,p)=>{let b=Math.abs(o({x:(h+c)/2,y:(d+l)/2})-(p+u)/2);b>m&&(m=b)};return f((e.x+t.x)/2,(e.y+t.y)/2,(r+i)/2),f((t.x+n.x)/2,(t.y+n.y)/2,(i+a)/2),f((n.x+e.x)/2,(n.y+e.y)/2,(a+r)/2),m}function yo(e,t,n,o,r){if(r<=0)return Tp(e,t,n,o);let i={x:(e.x+t.x)/2,y:(e.y+t.y)/2},a={x:(t.x+n.x)/2,y:(t.y+n.y)/2},s={x:(n.x+e.x)/2,y:(n.y+e.y)/2};return Math.max(yo(e,i,s,o,r-1),yo(i,t,a,o,r-1),yo(s,a,n,o,r-1),yo(i,a,s,o,r-1))}function go(e,t,n,o,r,i,a,s){if(a>0){let f={x:(t.x+n.x)/2,y:(t.y+n.y)/2},h={x:(n.x+o.x)/2,y:(n.y+o.y)/2},d={x:(o.x+t.x)/2,y:(o.y+t.y)/2};go(e,t,f,d,r,i,a-1,s),go(e,f,n,h,r,i,a-1,s),go(e,d,h,o,r,i,a-1,s),go(e,f,h,d,r,i,a-1,s);return}let c=[t.x*C,r(t),t.y*C],l=[n.x*C,r(n),n.y*C],u=[o.x*C,r(o),o.y*C];if(s){e.triN(c,l,u,s(t),s(n),s(o),i);return}let m=Ip(c,l,u);m[1]<0&&(m=[-m[0],-m[1],-m[2]]),e.tri(c,l,u,m,i)}var Lp=8;function Fc(e,t,n){if(!Number.isFinite(n))return e;let o=[],r=(i,a,s,c,l)=>{if(l>0){let u={x:(i.x+a.x)/2,y:(i.y+a.y)/2},m=t(u);if(Math.abs(m-(s+c)/2)>n){r(i,u,s,m,l-1),r(u,a,m,c,l-1);return}}o.push(i)};for(let i=0;i<e.length;i++){let a=e[i],s=e[(i+1)%e.length];r(a,s,t(a),t(s),Lp)}return o}function yr(e,t){if(e.length<3)return e;let n=[];for(let r of e){let i=n[n.length-1];i&&Math.hypot(r.x-i.x,r.y-i.y)<t||n.push(r)}for(;n.length>2&&Math.hypot(n[0].x-n[n.length-1].x,n[0].y-n[n.length-1].y)<t;)n.pop();if(n.length<3)return e;let o=[];for(let r=0;r<n.length;r++){let i=o.length?o[o.length-1]:n[(r-1+n.length)%n.length],a=n[r],s=n[(r+1)%n.length],c=s.x-i.x,l=s.y-i.y,u=Math.hypot(c,l);u>t&&Math.abs((a.x-i.x)*l-(a.y-i.y)*c)/u<t||o.push(a)}return o.length>=3?o:n}var gr=.001*pt*.1;function ie(e,t,n,o,r,i,a,s,c=1/0,l){if(!t||t.length<3||(c===void 0&&(c=1/0),Math.abs(mt(t))<1e-4))return;let u=yr(Fc(yr(Ct(t),gr),o,c),gr),m=n?.map(g=>yr(Fc(yr(Ct(g),gr),o,c),gr)).filter(g=>g.length>=3&&Math.abs(mt(g))>=1e-4),{pts:f,tris:h}=_p(u,m),d=[i[0]*s.top,i[1]*s.top,i[2]*s.top],p=[i[0]*s.bottomCap,i[1]*s.bottomCap,i[2]*s.bottomCap],b=[a[0]*s.top,a[1]*s.top,a[2]*s.top],x=[a[0]*s.wallBottom,a[1]*s.wallBottom,a[2]*s.wallBottom],y=0;if(Number.isFinite(c))for(;y<Cp;y++){let g=0;for(let S=0;S<h.length;S+=3){let v=yo(f[h[S]],f[h[S+1]],f[h[S+2]],o,y);v>g&&(g=v)}if(g<=c)break}for(let g=0;g<h.length;g+=3){let S=f[h[g]],v=f[h[g+1]],P=f[h[g+2]];go(e,S,v,P,o,d,y,l);let E=[S.x*C,r,S.y*C],k=[v.x*C,r,v.y*C],L=[P.x*C,r,P.y*C];e.tri(E,L,k,[0,-1,0],p)}let M=g=>{if(y<=0)return g;let S=1<<y,v=[];for(let P=0;P<g.length;P++){let E=g[P],k=g[(P+1)%g.length];for(let L=0;L<S;L++){let I=L/S;v.push({x:E.x+(k.x-E.x)*I,y:E.y+(k.y-E.y)*I})}}return v},A=Zi(u),w=[{ring:M(u),flip:!1}];if(m)for(let g of m)g.length>=3&&w.push({ring:M(g),flip:!0});for(let{ring:g,flip:S}of w)for(let v=0;v<g.length;v++){let P=g[v],E=g[(v+1)%g.length],k=(E.x-P.x)*C,I=(E.y-P.y)*C,R=-k,_=Math.hypot(I,R)||1;I/=_,R/=_;let F=(P.x+E.x)/2-A.x,N=(P.y+E.y)/2-A.y,O=I*F+R*N;S&&(O=-O),O<0&&(I=-I,R=-R);let V=[I,0,R],z=[P.x*C,o(P),P.y*C],G=[E.x*C,o(E),E.y*C],T=[P.x*C,r,P.y*C],D=[E.x*C,r,E.y*C];e.tri(z,G,D,V,b,b,x),e.tri(z,D,T,V,b,x,x)}}function Nc(e){let t=0;for(let c of e)t+=c.count;let n=new Float32Array(t*3),o=new Float32Array(t*3),r=new Float32Array(t*3),i=new Float32Array(t),a=new Float32Array(t),s=0;for(let c of e)n.set(c.position,s*3),o.set(c.normal,s*3),r.set(c.color,s*3),i.set(c.floor,s),a.set(c.material,s),s+=c.count;return{position:n,normal:o,color:r,floor:i,material:a,count:t}}function Tt(e,t,n=2.5){if(t<=0||e.length<3)return e;let o=Ct(e),r=o.length,i=[];for(let s=0;s<r;s++){let c=o[s],l=o[(s+1)%r],u=l.x-c.x,m=l.y-c.y,f=Math.hypot(u,m)||1;i.push({x:m/f,y:-u/f})}let a=[];for(let s=0;s<r;s++){let c=o[s],l=i[(s-1+r)%r],u=i[s],m=l.x+u.x,f=l.y+u.y,h=Math.hypot(m,f),d=()=>{a.push([c.x+l.x*t,c.y+l.y*t]),a.push([c.x+u.x*t,c.y+u.y*t])};if(h<1e-9){d();continue}m/=h,f/=h;let p=m*l.x+f*l.y,b=1/Math.max(p,1e-6);if(!Number.isFinite(b)||b>n){d();continue}a.push([c.x+m*t*b,c.y+f*t*b])}if(a.length<3)return e;try{let s=qi.default.union([[...a,a[0]]]),c=null,l=-1/0;for(let m of s){let f=Math.abs(mt(m[0].map(([h,d])=>({x:h,y:d}))));f>l&&(l=f,c=m[0])}if(!c)return e;let u=c.map(([m,f])=>({x:m,y:f}));if(u.length>1){let m=u[0],f=u[u.length-1];Math.abs(m.x-f.x)<1e-9&&Math.abs(m.y-f.y)<1e-9&&u.pop()}return u.length>=3?u:e}catch{return e}}function bt(e,t,n=2.5){if(e.length<3)return[];if(t<=0)return e;let o=Ct(e),r=o.length,i=[];for(let c=0;c<r;c++){let l=o[c],u=o[(c+1)%r],m=Math.hypot(u.x-l.x,u.y-l.y)||1;i.push({x:-(u.y-l.y)/m,y:(u.x-l.x)/m})}let a=[],s=[];for(let c=0;c<r;c++){let l=o[c],u=i[(c-1+r)%r],m=i[c],f=u.x+m.x,h=u.y+m.y,d=Math.hypot(f,h),p=d<1e-9?1/0:1/Math.max(f/d*u.x+h/d*u.y,1e-6);if(!Number.isFinite(p)||p>n){a.push({x:l.x+u.x*t,y:l.y+u.y*t},{x:l.x+m.x*t,y:l.y+m.y*t}),s.push(c,c);continue}f/=d,h/=d,a.push({x:l.x+f*t*p,y:l.y+h*t*p}),s.push(c)}for(let c=0;c<a.length;c++){let l=(c+1)%a.length,u=s[c],m=s[l];if(m!==(u+1)%r)continue;let f=o[u],h=o[m];if((a[l].x-a[c].x)*(h.x-f.x)+(a[l].y-a[c].y)*(h.y-f.y)<=0)return[]}try{let c=qi.default.intersection([[...a.map(d=>[d.x,d.y]),[a[0].x,a[0].y]]],[[...o.map(d=>[d.x,d.y]),[o[0].x,o[0].y]]]),l=null,u=0;for(let d of c){let p=Math.abs(mt(d[0].map(([b,x])=>({x:b,y:x}))));p>u&&(u=p,l=d[0])}if(!l)return[];let m=l.map(([d,p])=>({x:d,y:p})),f=m[0],h=m[m.length-1];return m.length>1&&Math.abs(f.x-h.x)<1e-9&&Math.abs(f.y-h.y)<1e-9&&m.pop(),m.length>=3?Ct(m):[]}catch{return[]}}function Mr(e,t,n,o,r=28){let i=[];for(let a=0;a<r;a++){let s=a/r*Math.PI*2;i.push({x:e+n*Math.cos(s),y:t+o*Math.sin(s)})}return i}function xo(e,t,n,o){return[{x:e,y:t},{x:e+n,y:t},{x:e+n,y:t+o},{x:e,y:t+o}]}var Gt=.22;function Vc(e){let t=je[e];return t==="sold"||t==="held"?1:0}var kp=.42,Bc=1.6;function Op(e,t){let n=new Float32Array(e.length*4),o=Math.cos(ki),r=0;for(let i=1;i<=e.length;i++){if(i<e.length&&e[i].rowId===e[r].rowId)continue;let a=i-r>=2&&!t?.has(e[r].rowId);for(let l=r;a&&l<i;l++)e[l].kind==="booth"&&(a=!1);for(let l=r+1;a&&l<i-1;l++){let u=e[l].x-e[l-1].x,m=e[l].y-e[l-1].y,f=e[l+1].x-e[l].x,h=e[l+1].y-e[l].y,d=Math.hypot(u,m)*Math.hypot(f,h);d>1e-9&&(u*f+m*h)/d<o&&(a=!1)}let s=[];for(let l=r+1;a&&l<i;l++){let u=Math.hypot(e[l].x-e[l-1].x,e[l].y-e[l-1].y);u>1e-6&&s.push(u)}s.sort((l,u)=>l-u);let c=s.length?s[Math.floor(s.length/2)]:0;for(let l=r;c>0&&l<i;l++){let u=b=>{let x=l+b;if(x<r||x>=i)return null;let y=e[x].x-e[l].x,M=e[x].y-e[l].y,A=Math.hypot(y,M);return A>1e-6?{x:y/A,y:M/A,gap:A}:null},m=u(1),f=u(-1),h=c/2,d=m??(f?{x:-f.x,y:-f.y,gap:1/0}:null);if(!d)continue;let p=m&&m.gap<c*Bc?m.gap/2:h;if(n[l*4]=d.x*p*C,n[l*4+1]=d.y*p*C,!f||f.gap>=c*Bc){let b=f??{x:-d.x,y:-d.y};n[l*4+2]=b.x*h*C,n[l*4+3]=b.y*h*C}}r=i}return n}function Fp(e){let t=e.length,n=new Float64Array(t);if(t<2)return n.fill(1/0),n;let o=1/0,r=1/0,i=-1/0,a=-1/0;for(let d of e)d.x<o&&(o=d.x),d.y<r&&(r=d.y),d.x>i&&(i=d.x),d.y>a&&(a=d.y);let s=Math.max(i-o,1e-6),c=Math.max(a-r,1e-6),l=Math.max(Math.sqrt(s*c/t),1e-6),u=Math.max(1,Math.ceil(s/l)+1),m=Math.max(1,Math.ceil(c/l)+1),f=new Map,h=(d,p)=>{let b=Math.min(u-1,Math.max(0,Math.floor((d-o)/l)));return Math.min(m-1,Math.max(0,Math.floor((p-r)/l)))*u+b};for(let d=0;d<t;d++){let p=h(e[d].x,e[d].y),b=f.get(p);b?b.push(d):f.set(p,[d])}for(let d=0;d<t;d++){let p=e[d],b=Math.min(u-1,Math.max(0,Math.floor((p.x-o)/l))),x=Math.min(m-1,Math.max(0,Math.floor((p.y-r)/l))),y=1/0;for(let M=1;M<=4;M++){for(let A=x-M;A<=x+M;A++)if(!(A<0||A>=m))for(let w=b-M;w<=b+M;w++){if(w<0||w>=u||M>1&&Math.abs(A-x)<M&&Math.abs(w-b)<M)continue;let g=f.get(A*u+w);if(g)for(let S of g){if(S===d)continue;let v=Math.hypot(e[S].x-p.x,e[S].y-p.y);v<y&&(y=v)}}if(Number.isFinite(y)&&y<=M*l)break}n[d]=y}return n}function Dp(e){let t=e.eyeHeightM;return Number.isFinite(t)?Math.max(0,t-_t):0}function Gc(e,t,n,o,r,i,a){let s=e.length,c=new Float32Array(s*3),l=new Float32Array(s),u=new Float32Array(s*3),m=new Float32Array(s),f=new Float32Array(s),h=new Float32Array(s),d=new Float32Array(s),p=new Float32Array(s*3),b=new Map,x=Fp(e);for(let y=0;y<s;y++){let M=e[y],w=(n?.seatPitchU(y)??x[y])*C;m[y]=Number.isFinite(w)?Math.max(.06,Math.min(Gt,w*kp)):Gt,f[y]=Zs(Number.isFinite(w)?w:void 0);let g=kc(M.glyph,{seatGlyph:i?.get(M.categoryKey)}),S=M.glyph!==void 0||i?.has(M.categoryKey);h[y]=Lc.indexOf(!S&&a?.has(M.rowId)?"dining":g),d[y]=M.wheelchairSpaceType==="no-seat"?0:1,c[y*3]=M.x*C,c[y*3+1]=n?n.seatDeckY(y):Dp(M),c[y*3+2]=M.y*C,l[y]=ho(t?t(M):"available");let v=ve(r?.get(M.categoryKey)??"#6e7bff")??[.43,.48,1];if(u[y*3]=v[0],u[y*3+1]=v[1],u[y*3+2]=v[2],M.accessibility?.length){let P=ve(br(M.accessibility));P&&(p[y*3]=P[0],p[y*3+1]=P[1],p[y*3+2]=P[2])}b.set(M.id,y)}return{count:s,iPosition:c,iState:l,iCategory:u,iMaxRadius:m,iRing:p,idToIndex:b,iChairWidth:f,iGlyph:h,iPhysicalSeat:d,iArmrests:Op(e,a),iFloor:o??new Float32Array(s),iSection:new Float32Array(s).fill(-1),iYaw:new Float32Array(s)}}var Np=64;function Qi(e,t){let n=[];for(let a of t){let s=e.idToIndex.get(a.seatId);if(s===void 0)continue;let c=ho(a.state);e.iState[s]!==c&&(e.iState[s]=c,n.push(s))}if(!n.length)return[];n.sort((a,s)=>a-s);let o=[],r=n[0],i=n[0];for(let a=1;a<n.length;a++){let s=n[a];if(s!==i){if(s<=i+Np){i=s;continue}o.push({start:r,length:i-r+1}),r=s,i=s}}return o.push({start:r,length:i-r+1}),o}var Mo=3,bn=.38,vo=.24;function Bp(e){if(e.length<3)return null;let t=e[0],n=e[Math.floor(e.length/2)],o=e[e.length-1],r=(n.x-t.x)*C,i=(n.y-t.y)*C,a=(o.x-t.x)*C,s=(o.y-t.y)*C,c=2*(r*s-i*a);if(Math.abs(c)<1e-7)return null;let l=r*r+i*i,u=a*a+s*s,m=(l*s-u*i)/c+t.x*C,f=(r*u-a*l)/c+t.y*C,h=Math.hypot(t.x*C-m,t.y*C-f);return h<1||h>200||!Number.isFinite(h)||e.some(d=>Math.abs(Math.hypot(d.x*C-m,d.y*C-f)-h)>.03)?null:{x:m,z:f,radius:h}}function Hc(e){let t=[],n=new Map,o=(c,l)=>`${Math.floor(c/Mo)},${Math.floor(l/Mo)}`;for(let c of e)for(let l of c.rows){for(let m of l.pts){let f=m.x*C,h=m.y*C,d=o(f,h),p=n.get(d)??[];p.push({x:f,z:h,y:l.y,floor:c.floorIndex}),n.set(d,p)}if(l.patch||l.pts.length<2)continue;let u=Bp(l.pts);for(let m of[0,l.pts.length-1]){let f=l.pts[m],h=l.pts[m===0?1:m-1],d=f.x-h.x,p=f.y-h.y,b=Math.hypot(d,p);b<1e-6||t.push({sectionId:c.sectionId,floorIndex:c.floorIndex,curve:u,row:l,point:f,x:f.x*C,z:f.y*C,dx:d/b,dz:p/b})}}let r=new Map;t.forEach((c,l)=>{let u=o(c.x,c.z),m=r.get(u)??[];m.push(l),r.set(u,m)});let i=(c,l)=>{let u=Math.floor(c/Mo),m=Math.floor(l/Mo);return[-1,0,1].flatMap(f=>[-1,0,1].map(h=>`${u+f},${m+h}`))},a=new Map;t.forEach((c,l)=>{let u=-1,m=1/0,f=!1;for(let h of i(c.x,c.z))for(let d of r.get(h)??[]){let p=t[d];if(c.sectionId===p.sectionId&&c.row.blockId===p.row.blockId||c.floorIndex!==p.floorIndex||Math.abs(c.row.y-p.row.y)>.05)continue;let b=p.x-c.x,x=p.z-c.z,y=Math.hypot(b,x);if(y<bn*2+.45||y>Mo)continue;let M=c.curve&&p.curve&&Math.hypot(c.curve.x-p.curve.x,c.curve.z-p.curve.z)<=.05&&Math.abs(c.curve.radius-p.curve.radius)<=.05,A=Math.min((b*c.dx+x*c.dz)/y,(-b*p.dx-x*p.dz)/y);(M?A<.8:A<.98)||!M&&(Math.abs(b*c.dz-x*c.dx)>.15||Math.abs(b*p.dz-x*p.dx)>.15)||(y<m-.02?(u=d,m=y,f=!1):Math.abs(y-m)<=.02&&(f=!0))}u>=0&&!f&&a.set(l,u)});let s=[];for(let[c,l]of a){if(c>=l||a.get(l)!==c)continue;let u=t[c],m=t[l],f=Math.hypot(m.x-u.x,m.z-u.z),h=(m.x-u.x)/f,d=(m.z-u.z)/f,p=!1;for(let x of i((u.x+m.x)/2,(u.z+m.z)/2))for(let y of n.get(x)??[]){if(y.floor!==u.floorIndex||Math.abs(y.y-u.row.y)>.75)continue;let M=(y.x-u.x)*h+(y.z-u.z)*d,A=Math.abs((y.x-u.x)*d-(y.z-u.z)*h);M>.01&&M<f-.01&&A<vo+bn&&(p=!0)}if(p)continue;let b=(x,y)=>({x:(u.x+h*x-d*y)/C,y:(u.z+d*x+h*y)/C});s.push({sections:[u.sectionId,m.sectionId],blocks:[u.row.blockId,m.row.blockId],floorIndex:u.floorIndex,ends:[u.point,m.point],clearWidthM:f-2*bn,heightM:(u.row.y+m.row.y)/2,outline:[b(bn,-vo),b(f-bn,-vo),b(f-bn,vo),b(bn,vo)]})}return s}var Vp=.15,Gp=1.6;function zc(e){return Ui(e??1,Vp,Gp)}var Ji={key:[1,1,1],ambient:[1,1,1]},Uc=.5,Hp=[{id:"daylight",label:"Daylight",description:"Open air by day: pale concrete under a warm sun and a blue sky.",background:"#dce3e8",materials:{deck:"#c9ccc8",fascia:"#b4bab8",shell:"#c3c9c8",roughness:.87},light:{key:[1.05,1,.93],ambient:[.95,.99,1.06]},indoor:!1},{id:"floodlit",label:"Floodlit night",description:"A night match: dark sky, hard cool-white floodlights.",background:"#0c1420",materials:{deck:"#66727c",fascia:"#3a4a58",shell:"#4c6072",roughness:.84},light:{key:[1.08,1.08,1.12],ambient:[.8,.88,1.1]},indoor:!1},{id:"evening",label:"Evening",description:"A quiet dark hall: slate structure in a cool, even light.",background:"#17232e",materials:{deck:"#69747b",fascia:"#3e4d58",shell:"#526572",roughness:.87},light:{key:[1,.99,.96],ambient:[.94,.98,1.06]},indoor:!1},{id:"arena-show",label:"Arena show",description:"House lights down for a show: deep blue room, warm light on the floor.",background:"#10121c",materials:{deck:"#626a7a",fascia:"#383f52",shell:"#484f66",roughness:.82},light:{key:[1.08,.98,.88],ambient:[.8,.84,1.16]},indoor:!0},{id:"theatre",label:"Theatre house lights",description:"A warm auditorium before curtain-up: amber light, dark warm room.",background:"#1c1512",materials:{deck:"#74685c",fascia:"#4c4038",shell:"#5c4e44",roughness:.9},light:{key:[1.14,.98,.78],ambient:[1.04,.94,.84]},indoor:!0},{id:"concert-hall",label:"Concert hall",description:"A bright hall in pale wood and cream, softly warm.",background:"#e9e2d6",materials:{deck:"#d2c8b8",fascia:"#bcb0a0",shell:"#c8beae",roughness:.8},light:{key:[1.06,1,.9],ambient:[1.02,1,.95]},indoor:!0}],zp=new Map(Hp.map(e=>[e.id,e])),jc="plain",Wc=3e3;function Xc(e,t){return e.openField?t?"daylight":"floodlit":e.court||e.inTheRound||e.stage&&e.seatCount>Wc?t?"daylight":"arena-show":e.stage?t?"concert-hall":"theatre":t?"daylight":"evening"}function Kc(e){return e.openField?!1:e.indoorCourt?!0:e.stage&&!e.inTheRound&&!e.court&&e.standing<e.seatCount&&e.seatCount<=Wc}function ea(e){return e&&zp.get(e)||null}var Up=.15,jp=.9,Wp=1.76;function Xp(e,t,n){let o=e??Kp,r=(i,a,s)=>[Math.min(1,i[0]*a*s[0]),Math.min(1,i[1]*a*s[1]),Math.min(1,i[2]*a*s[2])];return So(e)?{indoor:n,ceiling:r(o,1.02,t.light.ambient),wall:r(o,.9,t.light.ambient),lamp:r([.1,.1,.1],1,t.light.key)}:{indoor:n,ceiling:r(o,.7,t.light.ambient),wall:r(o,1.55,t.light.ambient),lamp:r([.92,.86,.74],1,t.light.key)}}var Kp=[.075,.09,.115];function Yc(e){return So(e)?{zenith:[.36,.58,.84],horizon:[.82,.88,.94]}:{zenith:[.05,.08,.15],horizon:[.3,.38,.5]}}function So(e){return!!e&&e[0]*.2126+e[1]*.7152+e[2]*.0722>.55}function Yp(){return{background:{top:[...dn.top],bottom:[...dn.bottom]},sky:Yc(null),structure:Vi,seatStates:{...pc},seatScale:1,materials:{seat:null,shell:null,roughness:.78},light:{key:[...Ji.key],ambient:[...Ji.ambient]},house:null}}function $p(e){return So(e)?{deck:"#c9ccc8",fascia:"#b4bab8",shell:"#c3c9c8",roughness:.87}:{deck:"#69747b",fascia:"#3e4d58",shell:"#526572",roughness:.87}}function $c(e,t){let n=e?.venue3d?.look;if(n===jc)return{look:null,chosen:!0};let o=ea(n);return o?{look:o,chosen:!0}:t?{look:ea(Xc(t,So(ve(e?.background)))),chosen:!1}:{look:null,chosen:!1}}function Zp(e,t){let{look:n,chosen:o}=$c(e,t);return ve(e?.background)??(o?ve(n?.background):null)}function Zc(e,t){let n=Yp();e??={};let{look:o,chosen:r}=$c(e,t);o&&(n.light={key:[...o.light.key],ambient:[...o.light.ambient]});let i=Zp(e,t);if(o&&(n.house=Xp(i,o,r?o.indoor:!!t&&Kc(t))),i){n.background={top:re(i,jp),bottom:re(i,Wp)},n.sky=Yc(i);let u={};for(let[f,h]of Object.entries(Vi))u[f]=Se(h,i,Up);i[0]*.2126+i[1]*.7152+i[2]*.0722>.55&&(u.ground=re(i,.86)),n.structure=u}let a=ve(e.selectionColor)??ve(e.accent);a&&(n.seatStates={...n.seatStates,selected:a});let s=e.seatScale;typeof s=="number"&&Number.isFinite(s)&&(n.seatScale=zc(s));let c=Object.fromEntries(Object.entries(e.venue3d??{}).filter(([u,m])=>m!=null&&u!=="look")),l={...$p(i),...o?.materials,...c};if(l){let u=ve(l.deck),m=ve(l.fascia);u&&(n.structure={...n.structure,tierTop:u,gaTop:u}),m&&(n.structure={...n.structure,tierWall:m,gaWall:m}),n.materials.seat=ve(l.seat),n.materials.shell=ve(l.shell),typeof l.roughness=="number"&&Number.isFinite(l.roughness)&&(n.materials.roughness=Math.min(1,Math.max(0,l.roughness)))}return qp(n,So(i)),n}function qp(e,t){let n=hn(t);e.seatStates={...e.seatStates,held:cr(n.unavailable),sold:cr(n.unavailable),dimmed:cr(n.dimmed)};let o=(i,a)=>fn(i,a,Math.min(fo(i),lr)),r=e.structure;e.structure={...r,ground:o(r.ground,n.ground),tierTop:o(r.tierTop,n.deck),tierWall:o(r.tierWall,n.fascia)},e.materials.shell&&(e.materials.shell=o(e.materials.shell,n.shell))}function qc(e,t){let n=[];for(let o of t)n.push(...e.seatStates[o]);return n}var Qp=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing"]),Jp=new Set(["pitch-football","track-athletics","oval-cricket","pitch-rugby","diamond-baseball"]);function vt(e){return!!e&&Qp.has(e)}function yn(e){return!!e&&Jp.has(e)}var eb=new Set(["court-basketball","rink-hockey","ring-boxing"]);function el(e){return!!e&&eb.has(e)}var ta=1.1;function tl(e){return Sr(e)?e==="ring-boxing"?ta:.06:1}var tb={round:{width:6,height:6},"pitch-football":{width:105,height:68},"rink-hockey":{width:60,height:30},"track-athletics":{width:176.9,height:92.5},"oval-cricket":{width:150,height:140},"pitch-rugby":{width:120,height:70},"diamond-baseball":{width:140,height:140},"court-basketball":{width:32,height:19},"court-tennis":{width:36.57,height:18.29},"ring-boxing":{width:7.8,height:7.8}},nb={"pitch-football":"#2f7d4f","rink-hockey":"#e8f1f8","track-athletics":"#a4472f","oval-cricket":"#3d8a53","pitch-rugby":"#2f7d4f","diamond-baseball":"#2f7d4f","court-basketball":"#c8894f","court-tennis":"#3f7a5a","ring-boxing":"#2a4d8f"};var ob=Math.PI*2;function rb(e,t,n,o,r,i){return{x:r+e*n-t*o,y:i+e*o+t*n}}function Qc(e,t){let n=Math.max(0,e-t),o=[],r=20;for(let i=0;i<=r;i++){let a=-Math.PI/2+i/r*Math.PI;o.push({x:n+t*Math.cos(a),y:t*Math.sin(a)})}for(let i=0;i<=r;i++){let a=Math.PI/2+i/r*Math.PI;o.push({x:-n+t*Math.cos(a),y:t*Math.sin(a)})}return o}var Jc=(()=>{let t={x:0,y:52},n=25,o={x:70,y:t.y-70},r=(o.x*o.x+o.y*o.y-4900)/(2*(o.y+70)),i=r+70,a=[],s=Math.atan2(o.y-r,o.x),c=Math.atan2(o.y-r,-o.x);for(let l=0;l<=24;l++){let u=s+(c-s)*l/24;a.push({x:i*Math.cos(u),y:r+i*Math.sin(u)})}return{half:70,home:t,backstop:n,fence:a}})();var vr="#f1f5f9";function Sr(e){return vt(e)}function Zt(e,t,n,o,r=32){let i=[];for(let a=0;a<r;a++){let s=a/r*ob;i.push({x:e+n*Math.cos(s),y:t+o*Math.sin(s)})}return i}function Ht(e,t,n,o){return[{x:e-n,y:t-o},{x:e+n,y:t-o},{x:e+n,y:t+o},{x:e-n,y:t+o}]}function ib(e){let{kind:t,cx:n,cy:o,width:r,height:i}=e,a=(e.rotation??0)*Math.PI/180,s=Math.cos(a),c=Math.sin(a),l=r/2,u=i/2,m=[],f=tb[t],h=p=>f?p/f.width*r:0,d=p=>f?p/f.height*i:0;switch(t){case"pitch-football":{m.push({points:[{x:0,y:-u},{x:0,y:u}],closed:!1}),m.push({points:Zt(0,0,h(9.15),d(9.15)),closed:!0});for(let p of[-1,1])m.push({points:Ht(p*(l-h(16.5)/2),0,h(16.5)/2,d(40.32)/2),closed:!0}),m.push({points:Ht(p*(l-h(5.5)/2),0,h(5.5)/2,d(18.32)/2),closed:!0});break}case"rink-hockey":{m.push({points:[{x:0,y:-u},{x:0,y:u}],closed:!1,ink:"#d63b3b"});for(let p of[-1,1]){m.push({points:[{x:p*h(7.5),y:-u},{x:p*h(7.5),y:u}],closed:!1,ink:"#2f6ecb"}),m.push({points:[{x:p*(l-h(4)),y:-d(11)},{x:p*(l-h(4)),y:d(11)}],closed:!1,ink:"#d63b3b"});for(let b of[-1,1])m.push({points:Zt(p*h(20.5),b*d(7),h(4.5),d(4.5)),closed:!0,ink:"#2f6ecb"})}m.push({points:Zt(0,0,h(4.5),d(4.5)),closed:!0,ink:"#2f6ecb"});break}case"track-athletics":{let b=u-d(1.22)*8;b>0&&m.push({points:Qc(l-h(1.22)*8,b),closed:!0,fill:"#2f7d4f"});for(let x=1;x<8;x++){let y=d(1.22)*x,M=u-y;if(M<=0)break;m.push({points:Qc(l-h(1.22)*x,M),closed:!0})}break}case"oval-cricket":{m.push({points:Zt(0,0,h(27.4),d(27.4+20.12/2),40),closed:!0}),m.push({points:Ht(0,0,h(3.05)/2,d(20.12)/2),closed:!0,ink:"#d8cfae"});break}case"pitch-rugby":{let p=b=>({points:[{x:h(b),y:-u},{x:h(b),y:u}],closed:!1});m.push(p(0));for(let b of[-1,1]){m.push(p(b*50),p(b*28));for(let x=-35;x<35;x+=4)m.push({points:[{x:h(b*10),y:d(x)},{x:h(b*10),y:d(Math.min(35,x+2))}],closed:!1})}break}case"diamond-baseball":{let p=(F,N)=>({x:h(F),y:d(N)}),{home:b}=Jc,x=27.43,y=x/Math.SQRT2,M={x:b.x+y,y:b.y-y},A={x:b.x,y:b.y-2*y},w={x:b.x-y,y:b.y-y},g={x:b.x,y:b.y-18.44},S="#b98a59",v=nb["diamond-baseball"],P=38.94,E=[p(b.x,b.y)],k=Math.atan2(b.y-P/Math.SQRT2-g.y,P/Math.SQRT2),L=Math.PI-k;for(let F=0;F<=16;F++){let N=k-(k+Math.PI*2-L)%(Math.PI*2)*(F/16);E.push(p(g.x+29*Math.cos(N),g.y+29*Math.sin(N)))}m.push({points:E,closed:!0,fill:S,ink:S});let I={x:b.x,y:b.y-y},R=[{x:b.x,y:b.y},M,A,w].map(F=>p(I.x+(F.x-I.x)*.84,I.y+(F.y-I.y)*.84));m.push({points:R,closed:!0,fill:v,ink:v}),m.push({points:Zt(h(g.x),d(g.y),h(2.74),d(2.74),20),closed:!0,fill:S,ink:S}),m.push({points:Zt(h(b.x),d(b.y),h(3.96),d(3.96),20),closed:!0,fill:S,ink:S});let _=Jc.fence;m.push({points:[p(b.x,b.y),p(_[0].x,_[0].y)],closed:!1}),m.push({points:[p(b.x,b.y),p(_[_.length-1].x,_[_.length-1].y)],closed:!1});for(let F of[M,A,w])m.push({points:Ht(h(F.x),d(F.y),h(.3),d(.3)),closed:!0,fill:vr});break}case"court-basketball":{m.push({points:Ht(0,0,h(14),d(7.5)),closed:!0}),m.push({points:[{x:0,y:-d(7.5)},{x:0,y:d(7.5)}],closed:!1}),m.push({points:Zt(0,0,h(1.8),d(1.8),24),closed:!0});for(let p of[-1,1]){let b=p*14,x=p*(14-5.8),y=p*(14-1.575);m.push({points:Ht(h((b+x)/2),0,h(2.9),d(2.45)),closed:!0,fill:"#2f5d8a"}),m.push({points:Zt(h(x),0,h(1.8),d(1.8),24),closed:!0});let M=Math.sqrt(6.75*6.75-6.6*6.6),A=[{x:h(b),y:-d(6.6)}],w=Math.atan2(-6.6,-p*M),g=2*Math.atan2(6.6,M);for(let S=0;S<=16;S++){let v=w-p*g*(S/16);A.push({x:h(y+6.75*Math.cos(v)),y:d(6.75*Math.sin(v))})}A.push({x:h(b),y:d(6.6)}),m.push({points:A,closed:!1})}break}case"court-tennis":{m.push({points:Ht(0,0,h(11.885),d(5.485)),closed:!0,fill:"#2b5f99"});for(let p of[-1,1])m.push({points:[{x:-h(11.885),y:p*d(4.115)},{x:h(11.885),y:p*d(4.115)}],closed:!1}),m.push({points:[{x:p*h(6.4),y:-d(4.115)},{x:p*h(6.4),y:d(4.115)}],closed:!1});m.push({points:[{x:-h(6.4),y:0},{x:h(6.4),y:0}],closed:!1}),m.push({points:[{x:0,y:-d(6.4)},{x:0,y:d(6.4)}],closed:!1,ink:"#d1d5db"});break}case"ring-boxing":{m.push({points:Ht(0,0,h(3.05),d(3.05)),closed:!0});let x=[[-1,-1,"#c53030"],[1,1,"#2b6cb0"],[1,-1,"#e2e8f0"],[-1,1,"#e2e8f0"]];for(let[y,M,A]of x)m.push({points:Ht(y*h(3.05),M*d(3.05),h(.3),d(.3)),closed:!0,fill:A,ink:A});break}default:return[]}return m.map(p=>({...p,points:p.points.map(b=>rb(b.x,b.y,s,c,n,o))}))}function na(e){if(e.role!=="stage"||!Sr(e.stageKind))return[];let t=null;if(e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null&&e.width>0&&e.height>0&&[e.x,e.y,e.width,e.height].every(Number.isFinite))t={cx:e.x+e.width/2,cy:e.y+e.height/2,width:e.width,height:e.height};else if(e.points&&e.points.length>=3&&e.points.every(n=>Number.isFinite(n.x)&&Number.isFinite(n.y))){let n=e.points.map(u=>u.x),o=e.points.map(u=>u.y),r=Math.min(...n),i=Math.max(...n),a=Math.min(...o),s=Math.max(...o),c=Math.max(1,i-r),l=Math.max(1,s-a);t={cx:r+c/2,cy:a+l/2,width:c,height:l}}return t?ib({kind:e.stageKind,...t}):[]}var Dn=Math.PI*2;function Nn(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function ab(e,t,n){let o=t-e;if(n){for(;o<0;)o+=Dn;for(;o>=Dn;)o-=Dn}else{for(;o>0;)o-=Dn;for(;o<=-Dn;)o+=Dn}return o}function rl(e){if(e.version!==1||e.closed!==!0||!Nn(e.start)||!Array.isArray(e.segments)||e.segments.length<2||e.segments.length>512)return!1;let t=e.start;for(let n of e.segments){if(!n||!Nn(n.end))return!1;if(n.kind==="line"){if(Xe(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!Nn(n.control1)||!Nn(n.control2)||Xe(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!Nn(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(Xe(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(Xe(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Xe(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return Xe(t,e.start)<=1e-4}function sb(e,t,n){let o=1-n;return{x:o**3*e.x+3*o**2*n*t.control1.x+3*o*n**2*t.control2.x+n**3*t.end.x,y:o**3*e.y+3*o**2*n*t.control1.y+3*o*n**2*t.control2.y+n**3*t.end.y}}function il(e,t=2){if(!rl(e))throw new Error("Section outline path is invalid");let n=Math.max(.25,t),o=[{...e.start}],r=e.start;for(let i of e.segments){if(i.kind==="line")o.push({...i.end});else if(i.kind==="arc"){let a=Math.atan2(r.y-i.center.y,r.x-i.center.x),s=Math.atan2(i.end.y-i.center.y,i.end.x-i.center.x),c=ab(a,s,i.clockwise),l=Math.max(2,Math.ceil(Math.abs(c)*i.radius/n));for(let u=1;u<=l;u+=1){let m=a+c*u/l;o.push({x:i.center.x+Math.cos(m)*i.radius,y:i.center.y+Math.sin(m)*i.radius})}}else{let a=Xe(r,i.control1)+Xe(i.control1,i.control2)+Xe(i.control2,i.end),s=Math.max(2,Math.ceil(a/n));for(let c=1;c<=s;c+=1)o.push(sb(r,i,c/s))}r=i.end}return Xe(o[o.length-1],o[0])<=1e-4&&o.pop(),o}var cb=45,oa=150,lb=60;function ub(e){let t=cb/100;if(e<=t)return oa;let n=Math.min(1,(e-t)/(1-t));return oa-n*(oa-lb)}var nl=.5523;function ol(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function mb(e){let t=[],n=[];for(e.forEach((o,r)=>{Nn(o)&&(t.length&&ol(t[t.length-1],o)||(t.push({x:o.x,y:o.y}),n.push(r)))});t.length>1&&ol(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}var fb=.5,hb=4/3;function db(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=Math.hypot(o,r);if(i<=1e-9)return{kind:"line",end:{...t}};let a=-r/i,s=o/i,c=n*hb;return{kind:"bezier",control1:{x:e.x+o/3+a*c,y:e.y+r/3+s*c},control2:{x:e.x+o*2/3+a*c,y:e.y+r*2/3+s*c},end:{...t}}}function al(e,t){let{points:n,sourceIndex:o}=mb(e),r=n.length;if(r<3)return null;let i=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,a=t.edgeCurvature,s=new Array(r).fill(0);if(a?.length)for(let A=0;A<r;A+=1){let w=a[o[A]];s[A]=Number.isFinite(w)?Math.min(100,Math.max(-100,w))/100:0}let c=s.some(A=>Math.abs(A)>1e-6);if(i<=0&&!c)return null;let l=t.wideAngleThresholdDeg??ub(i),u=[];for(let A=0;A<r;A+=1)u[A]=Xe(n[A],n[(A+1)%r]);let m=new Array(r).fill(0);for(let A=0;A<r;A+=1){let w=n[(A-1+r)%r],g=n[A],S=n[(A+1)%r],v={x:w.x-g.x,y:w.y-g.y},P={x:S.x-g.x,y:S.y-g.y},E=Math.hypot(v.x,v.y),k=Math.hypot(P.x,P.y);if(E<=1e-9||k<=1e-9)continue;let L=Math.min(1,Math.max(-1,(v.x*P.x+v.y*P.y)/(E*k))),I=Math.acos(L)*180/Math.PI;if(I<l)continue;let R=Rc((I-l)/(180-l));m[A]=i*R*.5*Math.min(E,k)}for(let A=0;A<r;A+=1){let w=(A+1)%r,g=m[A]+m[w];if(g>u[A]&&g>1e-9){let S=u[A]/g;m[A]*=S,m[w]*=S}}let f=new Array(r),h=new Array(r);for(let A=0;A<r;A+=1){let w=n[(A-1+r)%r],g=n[A],S=n[(A+1)%r];if(m[A]<=1e-6){f[A]={...g},h[A]={...g};continue}let v=Xe(g,w)||1,P=Xe(g,S)||1;f[A]={x:g.x+(w.x-g.x)/v*m[A],y:g.y+(w.y-g.y)/v*m[A]},h[A]={x:g.x+(S.x-g.x)/P*m[A],y:g.y+(S.y-g.y)/P*m[A]}}if(m.every(A=>A<=1e-6)&&!c)return null;let d=[],p={...h[0]},b=p,x=(A,w)=>{if(Xe(b,A)<=1e-9)return;let g=s[w];Math.abs(g)>1e-6?d.push(db(b,A,g*fb*u[w])):d.push({kind:"line",end:{...A}}),b=A};for(let A=1;A<=r;A+=1){let w=A%r,g=n[w];x(f[w],(A-1)%r),m[w]>1e-6&&Xe(f[w],h[w])>1e-9&&(d.push({kind:"bezier",control1:$i(f[w],g,nl),control2:$i(h[w],g,nl),end:{...h[w]}}),b=h[w])}if(!d.length)return null;let y=d[d.length-1];Xe(y.end,p)>1e-9&&(y.kind==="line"?y.end={...p}:d.push({kind:"line",end:{...p}}));let M={version:1,closed:!0,start:p,segments:d};return rl(M)?M:null}function sl(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,a=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+a*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+a*e.end.y}}function cl(e,t,n=192){if(!Number.isInteger(t)||t<1)throw new Error("Path point count must be a positive integer");if(t===1)return[sl(e,.5)];let o=Array.from({length:n+1},(c,l)=>sl(e,l/n)),r=new Float64Array(o.length);for(let c=1;c<o.length;c+=1){let l=o[c].x-o[c-1].x,u=o[c].y-o[c-1].y;r[c]=r[c-1]+Math.hypot(l,u)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let a=[],s=1;for(let c=0;c<t;c+=1){let l=i*c/(t-1);for(;s<r.length-1&&r[s]<l;)s+=1;let u=r[s-1],m=r[s],f=m===u?0:(l-u)/(m-u);a.push({x:o[s-1].x+(o[s].x-o[s-1].x)*f,y:o[s-1].y+(o[s].y-o[s-1].y)*f})}return a}function ll(e){let t=new Map,n=new Map;for(let o of e){if(o.type!=="row"||!o.segmentedRow)continue;let r=n.get(o.segmentedRow.groupId)??[];r.push(o),n.set(o.segmentedRow.groupId,r)}for(let[o,r]of n){let i=r.slice().sort((f,h)=>f.segmentedRow.componentIndex-h.segmentedRow.componentIndex),a=i[0]?.segmentedRow?.componentCount??0,s=i[0]?.segmentedRow;if(!s||!(a>=2&&i.length===a&&s?.boundaryBefore==="start"&&i.every((f,h)=>f.segmentedRow?.kind==="segmented-row-v1"&&f.segmentedRow.groupId===o&&f.segmentedRow.componentCount===a&&f.segmentedRow.componentIndex===h&&f.segmentedRow.repeatLabelOnComponents===s.repeatLabelOnComponents&&(h===0?f.segmentedRow.boundaryBefore==="start":f.segmentedRow.boundaryBefore!=="start")&&f.segmentedRow.displayLabel===s.displayLabel)))continue;let l=i.reduce((f,h)=>f+h.seatCount,0),u=0,m=0;for(let f of i)f.segmentedRow.boundaryBefore==="break"&&(u+=1),t.set(f.id,{groupId:o,adjacencyOffset:u,displayOffset:m,displayLabel:s.displayLabel,totalSeats:l,canonical:i[0],viewFromSeatUrl:s.viewFromSeatUrl,viewFromSeatMeta:s.viewFromSeatMeta,confidenceEvidence:s.confidenceEvidence}),u+=f.seatCount,m+=f.seatCount}return t}var pb="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var bb="abcdefghijklmnopqrstuvwxyz";function yb(e,t){let n=t.length,o=e+1,r="";for(;o>0;){o-=1;let i=o%n;r=t[i]+r,o=Math.floor(o/n)}return r}function wo(e,t=!1){let n=t?bb:pb;return yb(Math.max(0,Math.floor(e)-1),n)}var gb=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function ul(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of gb)for(;t>=o;)n+=r,t-=o;return n}function xb(e){let t=new Array(e);return Array.from({length:e},(n,o)=>o).sort((n,o)=>Math.abs(2*n-(e-1))-Math.abs(2*o-(e-1))||n-o).forEach((n,o)=>t[n]=o),t}function ra(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",a=e.seatNumbering?.prefix??"",s=e.seatNumbering?.endAt,c=e.seatCount;if(i==="updown"||i==="updown-descending"){let h=Math.ceil(c/2),d=i==="updown"?t<h?n+2*t:n-1+2*(c-t):t<h?n+2*(h-1-t):n+1+2*(t-h);return`${a}${d}`}let l=i==="odd"||i==="even"?2:r,u=s!=null&&Number.isFinite(s)?s-(c-1)*l:n,m=o==="center"?xb(c)[t]:o==="rtl"?c-1-t:t,f;switch(i){case"odd":{let h=u%2===1?u:u+1;f=String(h+m*2);break}case"even":{let h=u%2===0?u:u+1;f=String(h+m*2);break}case"roman":f=ul(u+m*r);break;case"letters-upper":f=wo(u+m*r,!1);break;case"letters-lower":f=wo(u+m*r,!0);break;default:f=String(u+m*r);break}return`${a}${f}`}function Mb(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function ml(e,t,n){return n?.label??`${e.seatLabelBase??e.label}-${ra(e,t)}`}function vb(e,t,n,o){if(o?.displayLabel)return null;if(e.seatDisplayLabelMode==="number"||!n)return{row:e.displayLabel||e.label,seat:ra(e,t)};let r=Mb(n);return{row:n.displayLabel,seat:ra(r,n.displayOffset+t)}}function ia(e,t,n,o){let r=vb(e,t,n,o);return r?e.seatDisplayLabelMode==="number"?r.seat:`${r.row}-${r.seat}`:o.displayLabel}function fl(e,t){return`${e.label}-${t+1}`}function Sb(e,t,n){return e?.direction==="anticlockwise"?Math.max(0,t-1-n):n}function wb(e,t){let n=e.chairNumbering,o=n?.start??1,r=Sb(n,Math.max(0,Math.round(e.seatCount)),t);return n?.format==="letter"?wo(Math.max(1,o)+r):String(o+r)}function hl(e,t){let n=wb(e,t);return(e.chairNumbering?.format??"table-number")==="table-number"?`${e.displayLabel??e.label}-${n}`:n}function dl(e){let t=e.length;return t<=3?[...e]:[e[Math.floor(t*.25)],e[Math.floor(t*.5)],e[Math.floor(t*.75)]]}function Bn(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>1e-12?((t-i.x)*s+(n-i.y)*c)/l:0;u<0?u=0:u>1&&(u=1);let m=t-(i.x+u*s),f=n-(i.y+u*c);if(Math.abs(m)>=o||Math.abs(f)>=o)continue;let h=Math.hypot(m,f);h<o&&(o=h)}return o}function Pb(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let o=e.length||1;t/=o,n/=o;let r=0;for(let i of e){let a=Math.hypot(i.x-t,i.y-n);a>r&&(r=a)}return{cx:t,cy:n,r}}function pl(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function aa(e,t){let n=1/0;for(let o of dl(e)){let r=Bn(t,o.x,o.y);r<n&&(n=r)}for(let o of dl(t)){let r=Bn(e,o.x,o.y);r<n&&(n=r)}return n}function Ab(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let u of e)n+=u.x,o+=u.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let u of e){let m=Math.hypot(u.x-n,u.y-o);m>r&&(r=m,i=u)}let a=i.x-n,s=i.y-o,c=Math.hypot(a,s);c>1e-9?(a/=c,s/=c):(a=1,s=0);let l=e.map((u,m)=>({p:u,i:m,t:(u.x-n)*a+(u.y-o)*s})).sort((u,m)=>u.t-m.t);return{pts:l.map(u=>u.p),seatIndices:l.map(u=>t[u.i])}}function sa(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let y of e)n+=y.x,o+=y.y;n/=t,o/=t;let r=0,i=0,a=0,s=0,c=0,l=0,u=0;for(let y of e){let M=y.x-n,A=y.y-o;r+=M*M,a+=A*A,i+=M*A,s+=M*M*M,c+=A*A*A,l+=M*A*A,u+=A*M*M}let m=r*a-i*i;if(Math.abs(m)<1e-9)return null;let f=(s+l)/2,h=(c+u)/2,d=(f*a-h*i)/m,p=(h*r-f*i)/m,b=d+n,x=p+o;return!Number.isFinite(b)||!Number.isFinite(x)?null:{cx:b,cy:x}}var Rb=.15,Eb=.001;function Ib(e){let t=e[0],n=e[e.length-1],o=n.x-t.x,r=n.y-t.y,i=Math.hypot(o,r);if(!(i>1e-9))return 0;let a=0;for(let s of e){let c=Math.abs((s.x-t.x)*r-(s.y-t.y)*o)/i;c>a&&(a=c)}return a/i}function _b(e){if(e.length<2)return null;let t=e.map(w=>{let g=0,S=0;for(let v of w.pts)g+=v.x,S+=v.y;return{x:g/w.pts.length,y:S/w.pts.length}}),n=0,o=0;for(let w of t)n+=w.x,o+=w.y;n/=t.length,o/=t.length;let r=0,i=0,a=0;for(let w of t){let g=w.x-n,S=w.y-o;r+=g*g,i+=g*S,a+=S*S}let s=r+a,c=r*a-i*i,l=s/2+Math.sqrt(Math.max(0,s*s/4-c)),u,m;Math.abs(i)>1e-12?(u=l-a,m=i):r>=a?(u=1,m=0):(u=0,m=1);let f=Math.hypot(u,m);if(!(f>1e-12))return null;u/=f,m/=f;let h=0,d=0,p=0;for(let w of e){if(w.pts.length<2)continue;let g=w.pts[0],S=w.pts[w.pts.length-1],v=S.x-g.x,P=S.y-g.y,E=Math.hypot(v,P);if(!(E>1e-9))continue;let k=v/E,L=P/E;h+=(k*k-L*L)*E,d+=2*k*L*E,p+=E}if(p>0&&Math.hypot(h,d)>=Tb*p){let w=Math.atan2(d,h)/2;u=-Math.sin(w),m=Math.cos(w)}let b=1/0,x=-1/0,y=[];for(let w of e){let g=1/0,S=-1/0;for(let v of w.pts){let P=v.x*u+v.y*m;P<g&&(g=P),P>S&&(S=P),P<b&&(b=P),P>x&&(x=P)}y.push(S-g)}let M=x-b;return M>1e-9?(y.sort((w,g)=>w-g),y[Math.min(y.length-1,Math.floor(y.length*.9))]/M<=Cb?{x:u,y:m}:null):null}var Cb=.35,Tb=.8;function wr(e,t,n,o){let r=new Map;for(let g of n){let S=t[g],v=S.rowId||`__seat-${g}`,P=r.get(v);P||(P={pts:[],idx:[]},r.set(v,P)),P.pts.push({x:S.x,y:S.y}),P.idx.push(g)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[g,S]of r){let v=Ab(S.pts,S.idx),P=0;for(let E of v.pts)P+=Math.hypot(E.x-o.x,E.y-o.y);i.push({id:g,pts:v.pts,seatIndices:v.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:P/v.pts.length})}let a=i.map(g=>Pb(g.pts)),s=i.length<=256?i.length*(i.length-1)/2:0,c=s?new Float64Array(s):null;c?.fill(Number.NaN);let l=c?new Map(i.map((g,S)=>[g,S])):null,u=(g,S)=>(g>S&&([g,S]=[S,g]),g*(2*i.length-g-1)/2+(S-g-1)),m=(g,S)=>{if(!c)return aa(i[g].pts,i[S].pts);let v=u(g,S),P=c[v];if(!Number.isNaN(P))return P;let E=aa(i[g].pts,i[S].pts);return c[v]=E,E},f=(g,S)=>l?m(l.get(g),l.get(S)):aa(g.pts,S.pts),h=[];for(let g=0;g<i.length;g++){let S=1/0;for(let v=0;v<i.length;v++){if(g===v||pl(a[g],a[v])>=S)continue;let P=m(g,v);P<S&&(S=P)}Number.isFinite(S)&&h.push(S)}h.sort((g,S)=>g-S);let d=h.length?h[Math.floor(h.length/2)]:1,p=Math.max(d*1.8,1e-6),b=i.map(()=>[]);for(let g=0;g<i.length;g++)for(let S=g+1;S<i.length;S++)pl(a[g],a[S])>p||m(g,S)<=p&&(b[g].push(S),b[S].push(g));let x=0;for(let g=0;g<i.length;g++){if(i[g].blockId!==-1)continue;let S=x++,v=[g];for(i[g].blockId=S;v.length;){let P=v.pop();for(let E of b[P])i[E].blockId===-1&&(i[E].blockId=S,v.push(E))}}let y=new Map;for(let g of i){let S=y.get(g.blockId)??[];S.push(g),y.set(g.blockId,S)}let M=[];for(let g of i){if(g.pts.length<4||Ib(g.pts)<Eb)continue;let S=sa(g.pts);S&&(!Number.isFinite(S.cx)||!Number.isFinite(S.cy)||M.push({x:S.cx,y:S.cy}))}let A=M.length>=2?(()=>{let g=M.map(P=>P.x).sort((P,E)=>P-E),S=M.map(P=>P.y).sort((P,E)=>P-E),v=Math.floor(M.length/2);return{cx:g[v],cy:S[v]}})():null;if(A){let g=L=>Math.hypot(L.x-A.cx,L.y-A.cy),S=1/0,v=-1/0,P=[];for(let L of i){let I=1/0,R=-1/0;for(let _ of L.pts){let F=g(_);F<I&&(I=F),F>R&&(R=F)}P.push(R-I),I<S&&(S=I),R>v&&(v=R)}let E=v-S;P.sort((L,I)=>L-I);let k=P[Math.min(P.length-1,Math.floor(P.length*.9))];if(E>1e-9&&k/E<=Rb){let L=i.map(T=>{let D=0;for(let W of T.pts)D+=g(W);return{row:T,radius:D/T.pts.length}}),I=0,R=0;for(let T of L)I+=T.radius,R+=T.row.focalDistance;I/=L.length,R/=L.length;let _=0;for(let T of L)_+=(T.radius-I)*(T.row.focalDistance-R);if(_<0)for(let T of L)T.radius=-T.radius;let N=1/0;for(let T of L)T.radius<N&&(N=T.radius);L.sort((T,D)=>T.radius-D.radius);let O=-1,V=-1/0,z=E/Math.max(1,L.length)*.5,G=[];for(let T of L)T.radius-V>z&&(O++,V=T.radius),T.row.ordinal=O,T.row.blockDepth=T.radius-N,G.push(T.row);return{sectionId:e,rows:G,blockCount:x}}}let w=[];for(let[,g]of y){let S=_b(g);if(S){let v=L=>{let I=0;for(let R of L.pts)I+=R.x*S.x+R.y*S.y;return I/L.pts.length};g.sort((L,I)=>v(L)-v(I)),g.length>=2&&g[0].focalDistance>g[g.length-1].focalDistance&&g.reverse();let P=[],E=d*.5;for(let L of g){let I=P[P.length-1];I&&Math.abs(v(L)-v(I[0]))<E?I.push(L):P.push([L])}let k=0;for(let L=0;L<P.length;L++){if(L>0){let I=1/0;for(let R of P[L-1])for(let _ of P[L])I=Math.min(I,f(R,_));I=Math.min(I,Math.abs(v(P[L][0])-v(P[L-1][0]))),k+=I}for(let I of P[L])I.ordinal=L,I.blockDepth=k,w.push(I)}}else{let v=1/0;for(let P of g)P.focalDistance<v&&(v=P.focalDistance);g.sort((P,E)=>P.focalDistance-E.focalDistance);for(let P=0;P<g.length;P++)g[P].ordinal=P,g[P].blockDepth=Math.max(0,g[P].focalDistance-v),w.push(g[P])}}return{sectionId:e,rows:w,blockCount:x}}var Lb=/^\d{4}-\d{2}-\d{2}$/;function kb(e){let t=Date.parse(e);return Number.isFinite(t)?Lb.test(e)?t+864e5:t:null}function Ob(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let o=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(o)&&(t instanceof Date?t.getTime():t)<=o+366*864e5}let n=kb(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function Fb(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function Db(e){return e.status!=="draft"&&e.status!=="retracted"}function Nb(e,t){return e.status===void 0?t===void 0:e.status!=="approved"?!0:typeof t=="string"&&typeof e.basisSha256=="string"&&e.basisSha256===t}function bl(e,t={}){return!!e&&Db(e)&&Fb(e,t.activeConfigurationId,t.activeConfigurationVersion)&&Nb(e,t.activeBasisSha256)&&Ob(e,t.now)}var Bb=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Vb=/[\s"'<>`\\]/;function Gb(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return Bb.test(e);if(Vb.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}function yl(e){let t=e.trim();return Gb(t)?t:null}var ca="seatlayer.event-configuration/1";var Vn=100,Hb=120,zb=2e5,Ub=1e4,jb=/^[a-f0-9]{64}$/,Wb=new Set(["stage","screen","barrier","camera_platform","sound_desk","rigging_truss"]);function Po(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function gn(e,t){return typeof e=="string"&&e.length>=1&&e.length<=t&&e.normalize("NFKC").trim()===e}function Xb(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}function gl(e){return!Array.isArray(e)||e.length>zb||!e.every(t=>gn(t,Vn))?null:[...new Set(e)].sort()}function Kb(e){return!Po(e)||!gn(e.chartId,Vn)||!gn(e.version,Vn)||e.sha256!==void 0&&(typeof e.sha256!="string"||!jb.test(e.sha256))?null:{chartId:e.chartId,version:e.version,...typeof e.sha256=="string"?{sha256:e.sha256}:{}}}function la(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=t&&e<=n}function Yb(e){return Po(e)?e.mode==="none"||e.mode==="opaque"?e.opacity===void 0?{mode:e.mode}:null:e.mode==="partial"&&la(e.opacity,.01,.99)?{mode:"partial",opacity:e.opacity}:null:null}function $b(e,t){if(e===void 0)return;if(!Array.isArray(e)||e.length>Ub)return null;let n=new Set(t),o=new Set,r=new Set,i=0,a=[];for(let s of e){if(!Po(s)||!gn(s.id,Vn)||!gn(s.objectId,Vn)||!n.has(s.objectId)||!Wb.has(String(s.kind))||!la(s.heightM,.05,50)||s.baseElevationM!==void 0&&!la(s.baseElevationM,-10,100))return null;let c=Yb(s.occlusion);if(!c||o.has(s.id)||r.has(s.objectId))return null;let l=s.contentImageUrl===void 0?void 0:typeof s.contentImageUrl=="string"?yl(s.contentImageUrl):null;if(s.contentImageUrl!==void 0&&(!l||s.kind!=="screen"||++i>1))return null;o.add(s.id),r.add(s.objectId),a.push({id:s.id,objectId:s.objectId,kind:s.kind,heightM:s.heightM,...s.baseElevationM!==void 0?{baseElevationM:s.baseElevationM}:{},occlusion:c,...l?{contentImageUrl:l}:{}})}return a.sort((s,c)=>s.id.localeCompare(c.id))}function Zb(e){let t=[];if(!Po(e))return{issues:[{code:"invalid_export",path:"configuration",message:"Configuration must be an object"}]};e.schema!==ca&&t.push({code:"unsupported_schema",path:"configuration.schema",message:`Configuration schema must be ${ca}`}),gn(e.id,Vn)||t.push({code:"invalid_id",path:"configuration.id",message:"Configuration id must contain 1 to 100 normalized characters"}),gn(e.label,Hb)||t.push({code:"invalid_label",path:"configuration.label",message:"Configuration label must contain 1 to 120 normalized characters"}),Xb(e.version)||t.push({code:"invalid_version",path:"configuration.version",message:"Configuration version must be a positive integer"});let n=Kb(e.baseVenue);n||t.push({code:"invalid_base_venue",path:"configuration.baseVenue",message:"Base venue must identify one normalized chart id and exact version"});let o=Po(e.overlay)?e.overlay:null,r=gl(o?.objectIds),i=gl(o?.productionKillSeatIds),a=r?$b(o?.productionElements,r):null;return(!o||!r||!i)&&t.push({code:"invalid_overlay",path:"configuration.overlay",message:"Overlay ids must be bounded arrays of normalized stable ids"}),a===null&&t.push({code:"invalid_production_element",path:"configuration.overlay.productionElements",message:"Production elements must be unique, bounded semantics over referenced base-venue objects"}),t.length||!n||!r||!i||a===null?{issues:t}:{issues:t,value:{schema:ca,id:e.id,label:e.label,version:e.version,baseVenue:n,overlay:{objectIds:r,productionKillSeatIds:i,...a!==void 0?{productionElements:a}:{}}}}}function xl(e){let t=Zb(e);return t.value?{ok:!0,value:t.value}:{ok:!1,issues:t.issues}}function qb(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.kind==="polygon"?Pr(e,6):e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,o=e.width,r=e.height;return[{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r},{x:t,y:n+r}]}function Qb(e,t,n){let o=n*Math.PI/180,r=Math.cos(o),i=Math.sin(o),a=e.x-t.x,s=e.y-t.y;return{x:t.x+a*r-s*i,y:t.y+a*i+s*r}}function Ml(e){let t=qb(e);if(!t||t.length<2)return null;let n=e.rotation??0,o=Math.abs(n)<1e-6?t:t.map(c=>Qb(c,{x:t.reduce((l,u)=>l+u.x,0)/t.length,y:t.reduce((l,u)=>l+u.y,0)/t.length},n)),r=1/0,i=1/0,a=-1/0,s=-1/0;for(let c of o)r=Math.min(r,c.x),i=Math.min(i,c.y),a=Math.max(a,c.x),s=Math.max(s,c.y);return!Number.isFinite(r)||a-r<1e-6||s-i<1e-6?null:{minX:r,minY:i,maxX:a,maxY:s}}var Jb=5,e0=3,t0=.92,n0=1.9,o0=2,r0=.6,i0=1,a0=.06;function s0(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?ta:Sr(e.stageKind)?a0:i0}function vl(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=-1/0;for(let a of Pl(e)){let s=a.baseHeightM??0;for(let c of a.objects){if(c.type!=="shape"||c.role!=="stage")continue;let l=Ml(c);l&&(t=Math.min(t,l.minX),n=Math.min(n,l.minY),o=Math.max(o,l.maxX),r=Math.max(r,l.maxY),i=Math.max(i,s+s0(c)))}}return!Number.isFinite(t)||!Number.isFinite(i)?null:{minX:t,minY:n,maxX:o,maxY:r,deckTopM:i}}function c0(e,t,n,o){let r=1/0,i=1/0,a=-1/0,s=-1/0;for(let h of e)Number.isFinite(h.eyeHeightM)&&(r=Math.min(r,h.x),a=Math.max(a,h.x),i=Math.min(i,h.y),s=Math.max(s,h.y));if(!Number.isFinite(r))return null;let c=r*t,l=i*t,u=Math.max(1,Math.ceil((a-r)*t/n)+1),m=Math.max(1,Math.ceil((s-i)*t/n)+1),f=new Float64Array(u*m).fill(-1/0);for(let h of e){if(!Number.isFinite(h.eyeHeightM))continue;let d=h.eyeHeightM-_t,p=Math.min(u-1,Math.max(0,Math.floor((h.x*t-c)/n))),x=Math.min(m-1,Math.max(0,Math.floor((h.y*t-l)/n)))*u+p,y=d+o;y>f[x]&&(f[x]=y)}return{cellM:n,minX:c,minY:l,cols:u,rows:m,top:f}}function l0(e,t,n){let o=Math.floor((t-e.minX)/e.cellM),r=Math.floor((n-e.minY)/e.cellM);return o<0||r<0||o>=e.cols||r>=e.rows?-1/0:e.top[r*e.cols+o]}function Sl(e,t,n={}){let o=new Map;if(!t||!e.length)return o;let r=n.metresPerChartUnit??he,i=n.cellM??r0,a=n.chairBackM??t0,s=n.selfRowSkipM??o0,c=n.clearThreshold??.9,l=n.partialThreshold??.25,u=Math.max(1,n.columns??Jb),m=Math.max(1,n.rows??e0),f=c0(e,r,i,a);if(!f)return o;let h=(t.maxX-t.minX)*r,d=(t.maxY-t.minY)*r,p=h>=d,b=(t.minX+t.maxX)/2*r,x=(t.minY+t.maxY)/2*r,y=[];for(let A=0;A<u;A++){let w=(A+.5)/u-.5,g=p?b+w*h:b,S=p?x:x+w*d;for(let v=0;v<m;v++){let P=t.deckTopM+(m===1?0:v/(m-1)*n0);y.push({x:g,y:S,z:P})}}let M=i/2;for(let A of e){if(!Number.isFinite(A.eyeHeightM))continue;let w=A.x*r,g=A.y*r,S=A.eyeHeightM,v=0,P=1/0;for(let k of y){let L=k.x-w,I=k.y-g,R=Math.hypot(L,I);if(!(R>s)){v++;continue}let _=L/R,F=I/R,N=0;for(let O=s;O<R;O+=M){let V=l0(f,w+_*O,g+F*O);if(!(!Number.isFinite(V)||V>=S)&&V>S+(k.z-S)*O/R){N=O;break}}N?P=Math.min(P,N):v++}let E=v/y.length;E>=c||o.set(A.id,{seatId:A.id,mark:E<l?"obstructedView":"restrictedView",visibleFraction:E,totalRays:y.length,atDistanceM:Number.isFinite(P)?P:0})}return o}function wl(e,t){if(!t.size)return 0;let n=0;for(let o of e){let r=t.get(o.id);if(!r)continue;let i=o.commercial;i?.restrictedView!==void 0||i?.obstructedView!==void 0||(o.commercial={...i,[r.mark]:!0},n++)}return n}function ua(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var Rr=Math.PI/180;var Ao=16;function ma(e,t,n,o){let r=n*Rr,i=Math.cos(r),a=Math.sin(r);return{x:o.x+e*i-t*a,y:o.y+e*a+t*i}}function ha(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,a=[];if(e.path)return cl(e.path,t);if(t<=1)return t===1&&a.push({x:i.x,y:i.y}),a;if(o===0){for(let l=0;l<t;l++)a.push(ma(l*n,0,r,i));return a}let s=o/(t-1)*Rr,c=n/(2*Math.sin(Math.abs(s)/2));for(let l=0;l<t;l++){let u=l*s,m=c*Math.sin(u),f=-c+c*Math.cos(u);a.push(ma(m,f,r,i))}return a}function da(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function u0(e,t){let n=da(e);return ha(e).map((o,r)=>{let i=n.get(r),a=ua(i),s=ml(e,r,i),c={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:s,displayLabel:ia(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:a.length>0,accessibility:a,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(c).some(l=>l!==void 0&&l!==!1&&l!=="")?c:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle??e.seatLabelStyle}})}function m0(e){let t=[];for(let n of u0(e))n.skipped||t.push({id:`${e.id}:${n.index}`,label:n.label,displayLabel:n.displayLabel===n.label?void 0:n.displayLabel,x:n.x,y:n.y,rowId:e.id,categoryKey:n.categoryKey,accessible:n.accessible||void 0,accessibility:n.accessibility.length?n.accessibility:void 0,wheelchairSpaceType:n.wheelchairSpaceType,commercial:n.commercial,glyph:n.glyph,viewUrl:n.viewUrl,viewMeta:n.viewMeta,labelStyle:n.labelStyle});return t}function f0(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(i=>t.includes(i)),o={top:0,bottom:0,left:0,right:0};if(!n.length)return o;let r=Math.max(0,Math.round(e.seatCount));for(let i=0;i<r;i++)o[n[i%n.length]]+=1;return o}function h0(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(u=>[u.index,u])),r=(u,m,f,h)=>{let d=o.get(u),p=ua(d),b=d?.label??fl(e,u);return{index:u,label:b,displayLabel:d?.displayLabel??hl(e,u),x:m+(d?.dx??0),y:f+(d?.dy??0),categoryKey:d?.categoryKey??e.categoryKey,skipped:!!d?.skip,accessible:p.length>0,accessibility:p,wheelchairSpaceType:d?.wheelchairSpaceType,commercial:d?.commercial,glyph:d?.glyph,viewUrl:d?.viewFromSeatUrl,viewMeta:d?.viewFromSeatUrl?d.viewFromSeatMeta:void 0,labelStyle:d?.labelStyle,...h?{side:h}:{}}};if(e.shape==="round"){let u=(e.radius??40)+Ao,m=e.rotation*Rr,f=Math.max(0,Math.min(360,e.seatArc??360));if(f>=360||n===1){for(let b=0;b<n;b++){let x=m+b/n*2*Math.PI;t.push(r(b,e.center.x+u*Math.cos(x),e.center.y+u*Math.sin(x)))}return t}let h=f*Rr,d=(2*Math.PI-h)/2,p=m+d;for(let b=0;b<n;b++){let x=p+b/(n-1)*h;t.push(r(b,e.center.x+u*Math.cos(x),e.center.y+u*Math.sin(x)))}return t}let i=e.width??80,a=e.height??50,s=f0(e),c=["top","bottom","left","right"],l=0;for(let u of c){let m=s[u];for(let f=0;f<m;f++){let h,d;u==="top"?(h=-i/2+(f+.5)*i/m,d=-a/2-Ao):u==="bottom"?(h=-i/2+(f+.5)*i/m,d=a/2+Ao):u==="left"?(h=-i/2-Ao,d=-a/2+(f+.5)*a/m):(h=i/2+Ao,d=-a/2+(f+.5)*a/m);let p=ma(h,d,e.rotation,e.center);t.push(r(l++,p.x,p.y,u))}}return t}function d0(e){return h0(e).filter(t=>!t.skipped).map(t=>({id:`${e.id}:${t.index}`,label:t.label,...t.displayLabel!==t.label?{displayLabel:t.displayLabel}:{},x:t.x,y:t.y,rowId:e.id,categoryKey:t.categoryKey,...t.accessible?{accessible:!0}:{},...t.accessibility.length?{accessibility:t.accessibility}:{},...t.wheelchairSpaceType?{wheelchairSpaceType:t.wheelchairSpaceType}:{},...t.commercial?{commercial:t.commercial}:{},...t.glyph?{glyph:t.glyph}:{},...t.viewUrl?{viewUrl:t.viewUrl}:{},...t.viewUrl&&t.viewMeta?{viewMeta:t.viewMeta}:{},...t.labelStyle?{labelStyle:t.labelStyle}:{}}))}function p0(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth",...e.commercial?.note?{commercial:{note:e.commercial.note}}:{}}]}function fa(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,a=t[o].y,s=t[r].x,c=t[r].y;a>e.y!=c>e.y&&e.x<(s-i)*(e.y-a)/(c-a)+i&&(n=!n)}return n}function Il(e,t){return t.some((n,o)=>{let r=t[(o+1)%t.length],i=(e.y-n.y)*(r.x-n.x)-(e.x-n.x)*(r.y-n.y);if(Math.abs(i)>1e-7)return!1;let a=(e.x-n.x)*(r.x-n.x)+(e.y-n.y)*(r.y-n.y),s=(r.x-n.x)**2+(r.y-n.y)**2;return a>=-1e-7&&a<=s+1e-7})}function Ro(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function Ke(e,t,n){return fa(e,t)&&!Ro(n).some(o=>fa(e,o)||Il(e,o))}function Ar(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function _l(e){switch(e.type){case"row":{let t=ha(e),n=da(e),o=0,r=0,i=0;for(let a=0;a<t.length;a++){let s=n.get(a);s?.skip||(o+=t[a].x+(s?.dx??0),r+=t[a].y+(s?.dy??0),i++)}return i?{x:o/i,y:r/i}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return Ar(e.points);case"section":return Ar(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?Ar(e.points):e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null?{x:e.x+e.width/2,y:e.y+e.height/2}:{x:e.x??0,y:e.y??0};case"decorImage":return{x:e.x+e.width/2,y:e.y+e.height/2}}}function Al(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function b0(e,t){if(e.type!=="gaArea"||!Al(e.points,t.outline))return!1;let n=Ro(e.holes),o=Ro(t.holes);return n.length===o.length&&n.every((r,i)=>Al(r,o[i]))}function y0(e,t,n=e.filter(r=>r.type==="section"),o=_l(t)){let r="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(r?n.find(a=>(a.logicalSectionId??a.id)===r&&(b0(t,a)||Ke(o,a.outline,a.holes))):void 0)??n.find(a=>Ke(o,a.outline,a.holes))??(t.type==="row"&&g0(t)?x0(t,n):void 0)}function g0(e){return(e.overrides??[]).some(t=>t.skip===!0)}function x0(e,t){let n=ha(e),o=da(e),r,i=0;for(let a of t){let s=0;for(let c=0;c<n.length;c++){let l=o.get(c);if(l?.skip)continue;let u={x:n[c].x+(l?.dx??0),y:n[c].y+(l?.dy??0)};Ke(u,a.outline,a.holes)&&s++}s>i&&(r=a,i=s)}return r}function Pl(e){return e.floors&&e.floors.length?e.floors:[{id:"floor-0",name:"Main",objects:e.objects,focalPoint:e.focalPoint,referenceImage:e.referenceImage,backgroundImage:e.backgroundImage}]}function Rl(e,t,n,o,r,i,a,s,c){let l=[],u=e.filter(p=>p.type==="section"),m=ll(e),f=p=>!p?.eventConfigurationId||p.eventConfigurationId===o&&(p.eventConfigurationVersion===void 0||p.eventConfigurationVersion===c),h=p=>bl(p,{activeConfigurationId:o,activeConfigurationVersion:c,activeBasisSha256:r,now:s}),d=(p,b)=>h(p)?{...p,coverage:b}:void 0;for(let p of e){let b=[];if(p.type==="row"?b=m0(p):p.type==="table"?b=d0(p):p.type==="booth"&&(b=p0(p)),!b.length)continue;for(let w of b)w.viewUrl&&!f(w.viewMeta)&&(w.viewUrl=void 0,w.viewMeta=void 0);if(p.type==="row"){let w=m.get(p.id);if(w){let g=new Map((p.overrides??[]).map(S=>[S.index,S]));for(let S of b){let v=Number(S.id.slice(S.id.lastIndexOf(":")+1));if(!Number.isInteger(v))continue;S.logicalRowId=w.groupId,S.logicalSeatIndex=w.adjacencyOffset+v,g.get(v)?.displayLabel||(S.displayLabel=ia(p,v,w)),!S.viewUrl&&w.viewFromSeatUrl&&f(w.viewFromSeatMeta)&&(S.viewUrl=w.viewFromSeatUrl,S.viewMeta=w.viewFromSeatMeta);let P=g.get(v)?.confidenceEvidence;S.confidenceEvidence=d(P,"exact-seat")??d(p.confidenceEvidence,"row-representative")??d(w.confidenceEvidence,"row-representative")}}}let x=y0(e,p,u,p.type==="row"?Ar(b):_l(p)),y=x?.viewFromSeatUrl,A=(x?.zone?t?.find(w=>w.id===x.zone):void 0)?.focalPoint??n;for(let w of b){if(!w.confidenceEvidence){let g=Number(w.id.slice(w.id.lastIndexOf(":")+1)),S=(p.type==="row"||p.type==="table")&&Number.isInteger(g)?p.overrides?.find(v=>v.index===g)?.confidenceEvidence:void 0;w.confidenceEvidence=d(S,"exact-seat")??(p.type==="row"?d(p.confidenceEvidence,"row-representative"):void 0)}w.confidenceEvidence??=d(x?.confidenceEvidence,"section-representative")??(a?d(a.evidence,a.coverage):void 0),!w.viewUrl&&y&&f(x?.viewFromSeatMeta)&&(w.viewUrl=y,w.viewMeta=x?.viewFromSeatMeta),!w.viewUrl&&i&&f(i.meta)&&(w.viewUrl=i.url,w.viewMeta=i.meta),x&&(w.sectionId=x.logicalSectionId??x.id),x?.zone&&(w.zoneId=x.zone),A&&(w.focalPoint={...A})}l.push(...b)}return l}function Gn(e,t={}){if(e.floors?.length){let o=[];for(let r of e.floors){let i=r.focalPoint??e.focalPoint,a=r.viewFromSeatUrl?{url:r.viewFromSeatUrl,meta:r.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,s=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,c=Rl(r.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,a,s,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&El(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,c);for(let l of c)l.floorId=r.id;for(let l of c)o.push(l)}return o}let n=Rl(e.objects,e.zones,e.focalPoint,e.eventConfigurationId,e.confidenceBasisSha256,e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);return t.resolveEyeHeights!==!1&&El(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),M0(e,n,t)}function M0(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||wl(t,Sl(t,vl(e))),t}function El(e,t,n,o){let r=e.filter(m=>m.type==="section"),i=n>0||r.some(m=>m.height!==void 0||m.rake!==void 0||(m.elevation??0)>0);if(!r.length||!i||!t){for(let m of o)m.eyeHeightM=n+_t;return}let a=new Array(o.length),s=new Map;for(let m of r)s.has(m.id)||s.set(m.id,m);let c=new Map,l=new Map;for(let m=0;m<o.length;m++){let f=o[m],d=(f.sectionId?s.get(f.sectionId)??r.find(b=>b.logicalSectionId===f.sectionId&&Ke({x:f.x,y:f.y},b.outline,b.holes)):void 0)??r.find(b=>Ke({x:f.x,y:f.y},b.outline,b.holes))??null;if(a[m]=d,!d)continue;c.has(d.id)||c.set(d.id,$t(d,{floorBaseHeightM:n}));let p=l.get(d.id);p?p.push(m):l.set(d.id,[m])}let u=new Array(o.length).fill(void 0);for(let[m,f]of l){let h=c.get(m);if(!h)continue;let d=h.rake>0?Math.tan(h.rake*Math.PI/180):0,p=wr(m,o,f,t);for(let b of p.rows){let x=b.blockDepth*he*d,y=h.height+x;for(let M of b.seatIndices)u[M]=y}}for(let m=0;m<o.length;m++){let f=o[m],h=a[m];if(!h){f.eyeHeightM=n+_t;continue}let d=c.get(h.id);f.eyeHeightM=(u[m]??d.height)+_t}}function v0(e){let t=e.points??[];if(e.kind!=="polygon"||t.length<3||!Array.isArray(e.edgeCurvature))return[];let n=t.map((o,r)=>{let i=e.edgeCurvature[r];return Number.isFinite(i)?Math.min(100,Math.max(-100,i)):0});return n.some(o=>Math.abs(o)>.5)?n:[]}function S0(e){let t=v0(e);return t.length?al(e.points,{edgeCurvature:t}):null}function Pr(e,t=2){let n=S0(e);return n?il(n,t):e.points??[]}function Cl(e){return e.kind==="polygon"?Ro(e.holes):[]}function Tl(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=!1;for(let a of e)!Number.isFinite(a.x)||!Number.isFinite(a.y)||(i=!0,a.x<t&&(t=a.x),a.y<n&&(n=a.y),a.x>o&&(o=a.x),a.y>r&&(r=a.y));return i?{minX:t,minY:n,maxX:o,maxY:r}:null}function Hn(e,t){return e.minX<=t.maxX&&t.minX<=e.maxX&&e.minY<=t.maxY&&t.minY<=e.maxY}var Ql=Et(require("polygon-clipping"),1);var oe={top:1,wallBottom:.58,bottomCap:.4};function xn(e,t){if(!e)return t;let n=re(It(e,.4),.62);return Se(t,n,.22)}function Ll(e,t){return e?Se(t,re(It(e,.25),.74),.62):t}function kl(e,t){let n=hn(Vt({tierTop:t}));return e?fn(e,n.sectionDeck,Math.min(n.sectionDeckChromaShare*fo(e),n.sectionDeckChromaCap)):fn(t,n.deck,Math.min(fo(t),lr))}function Ol(e,t){let n=new Map;for(let i of e.categories??[])n.set(i.key,i.color);let o=new Map;for(let i of t){if(!i.sectionId)continue;let a=o.get(i.sectionId);a||(a=new Map,o.set(i.sectionId,a)),a.set(i.categoryKey,(a.get(i.categoryKey)??0)+1)}let r=new Map;for(let[i,a]of o){let s=0,c=0,l=0,u=0;for(let[m,f]of a){let h=ve(n.get(m));h&&(s+=h[0]*f,c+=h[1]*f,l+=h[2]*f,u+=f)}u>0&&r.set(i,[s/u,c/u,l/u])}return r}function Fl(e,t){return ve(e.color)??t.get(e.logicalSectionId??e.id)??null}var ga=Et(require("polygon-clipping"),1);var ya=Et(require("polygon-clipping"),1);var Dl=e=>Math.round(e*1e6)/1e6+0;function zn(e){let t=e.map(r=>({x:Dl(r.x),y:Dl(r.y)})).sort((r,i)=>r.x-i.x||r.y-i.y).filter((r,i,a)=>i===0||r.x!==a[i-1].x||r.y!==a[i-1].y);if(t.length<3)return t;let n=(r,i,a)=>{let s=i.x-r.x,c=i.y-r.y,l=a.x-r.x,u=a.y-r.y;return s*u-c*l>1e-6*Math.hypot(s,c)*Math.hypot(l,u)},o=r=>{let i=[];for(let a of r){for(;i.length>=2&&!n(i[i.length-2],i[i.length-1],a);)i.pop();i.push(a)}return i.pop(),i};return[...o(t),...o([...t].reverse())]}var Gl=Et(require("earcut"),1);var w0=.58,Nl=.01,yt=Gt*1.5*pt,P0=.5,A0=.6;function R0(e,t){let n=e.length,o=[];for(let a=0;a<n;a++){let s=e[Math.max(0,a-1)],c=e[Math.min(n-1,a+1)],l=c.x-s.x,u=c.y-s.y,m=Math.hypot(l,u);if(m<1e-9){o.push([0,0]);continue}l/=m,u/=m,o.push([-u,l])}let r=0;for(let a=0;a<n;a++)r+=(e[a].x-t.x)*o[a][0]+(e[a].y-t.y)*o[a][1];return r<0?o.map(([a,s])=>[-a,-s]):o}function E0(e,t){if(e.length<2||t<=0)return[...e];let n=[...e],o=(a,s)=>{let c=s.x-a.x,l=s.y-a.y,u=Math.hypot(c,l)||1;return{x:c/u,y:l/u}},r=o(n[1],n[0]),i=o(n[n.length-2],n[n.length-1]);return n.unshift({x:n[0].x+r.x*t,y:n[0].y+r.y*t}),n.push({x:n[n.length-1].x+i.x*t,y:n[n.length-1].y+i.y*t}),n}var Bl=Math.PI/12;function I0(e){if(e.length<3)return[...e];let t=zn(e);return t.length>=3?t:[...e]}function Hl(e,t){if(!e.length||!(t>0))return[];let n=I0(e),o=(s,c,l,u)=>{let m=l-c;for(;m<0;)m+=Math.PI*2;for(;m>Math.PI*2;)m-=Math.PI*2;let f=Math.max(1,Math.ceil(m/Bl)),h=t/Math.cos(m/f/2);for(let d=0;d<=f;d++){let p=c+m*d/f;u.push({x:s.x+Math.cos(p)*h,y:s.y+Math.sin(p)*h})}};if(n.length<3){let s=0,c=0;for(let h of n)s+=h.x,c+=h.y;s/=n.length||1,c/=n.length||1;let l=0;for(let h of n)l=Math.max(l,Math.hypot(h.x-s,h.y-c));let u=[],m=Math.max(3,Math.ceil(Math.PI*2/Bl)),f=(l+t)/Math.cos(Math.PI/m);for(let h=0;h<m;h++){let d=h/m*Math.PI*2;u.push({x:s+Math.cos(d)*f,y:c+Math.sin(d)*f})}return u}let r=n.length,i=[];for(let s=0;s<r;s++){let c=n[s],l=n[(s+1)%r];i.push(Math.atan2(-(l.x-c.x),l.y-c.y))}let a=[];for(let s=0;s<r;s++)o(n[s],i[(s+r-1)%r],i[s],a);return Xl(a)}function _0(e,t,n){if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>1e-12?((t-i.x)*s+(n-i.y)*c)/l:0;u<0?u=0:u>1&&(u=1);let m=Math.hypot(t-(i.x+u*s),n-(i.y+u*c));m<o&&(o=m)}return o}function Er(e){let t=e.map(r=>{let i=0,a=0;for(let l of r.pts)i+=l.x,a+=l.y;let s=r.pts.length||1;i/=s,a/=s;let c=0;for(let l of r.pts){let u=Math.hypot(l.x-i,l.y-a);u>c&&(c=u)}return{cx:i,cy:a,rad:c}}),n=r=>{let i=r.length;return i<=2?[...r]:[r[Math.floor(i*.25)],r[Math.floor(i*.5)],r[Math.floor(i*.75)]]},o=[];for(let r=0;r<e.length;r++){let i=n(e[r].pts),a=[],s=1/0,c=null;for(let u of i){let m=1/0;for(let f=0;f<e.length;f++){if(f===r||Math.abs(e[f].y-e[r].y)<.001)continue;let h=t[f],d=Math.hypot(u.x-h.cx,u.y-h.cy)-h.rad;if(d>=m&&d>=s)continue;let p=_0(e[f].pts,u.x,u.y);p<m&&(m=p),e[f].depth<e[r].depth&&p<s&&(s=p,c=e[f].y)}Number.isFinite(m)&&m>0&&a.push(m)}a.sort((u,m)=>u-m);let l=a.length?a[Math.floor(a.length/2)]:1;o.push({pitch:l,belowY:c})}return o}function zl(e,t,n,o){let r=e[t],i=r.pts.length>=2?[...r.pts]:r.pts.length===1?(()=>{let u=r.pts[0],m=u.x-o.x,f=u.y-o.y,h=Math.hypot(m,f)||1;m/=h,f/=h;let d=Math.max(n[t].pitch,.001)*.5;return[{x:u.x+f*d,y:u.y-m*d},{x:u.x-f*d,y:u.y+m*d}]})():[];if(i.length<2)return null;let a=0,s=0;for(let u=1;u<i.length;u++){let m=Math.hypot(i[u].x-i[u-1].x,i[u].y-i[u-1].y);m>1e-6&&(a+=m,s++)}let c=s>0?a/s:0,l=E0(i,Math.max(c*A0,yt));return{pts:l,nrm:R0(l,o),front:Math.max(n[t].pitch*w0,yt),back:Math.max(n[t].pitch*P0,yt)}}var Un=1.5,Ul=.3;function pa(e,t){if(e.length<3)return e;let n=e[0],o=e[e.length-1],r=o.x-n.x,i=o.y-n.y,a=Math.hypot(r,i),s=-1,c=-1;for(let m=1;m<e.length-1;m++){let f=e[m],h=a>1e-12?Math.abs((f.x-n.x)*i-(f.y-n.y)*r)/a:Math.hypot(f.x-n.x,f.y-n.y);h>s&&(s=h,c=m)}if(s<=t||c<0)return[n,o];let l=pa(e.slice(0,c+1),t),u=pa(e.slice(c),t);return[...l.slice(0,-1),...u]}function jl(e,t){if(e.length<4)return e;let n=pa([...e,e[0]],t);return n.pop(),n.length>=3?n:e}function C0(e){let t=e.map((o,r)=>{let i=e[(r+1)%e.length];return{a:o,b:i,i:r,minX:Math.min(o.x,i.x),maxX:Math.max(o.x,i.x),minY:Math.min(o.y,i.y),maxY:Math.max(o.y,i.y)}}).sort((o,r)=>o.minX-r.minX),n=(o,r,i)=>(r.x-o.x)*(i.y-o.y)-(r.y-o.y)*(i.x-o.x);for(let o=0;o<t.length;o++){let r=t[o];for(let i=o+1;i<t.length&&t[i].minX<=r.maxX;i++){let a=t[i];if(!(Math.abs(r.i-a.i)===1||Math.abs(r.i-a.i)===e.length-1||r.maxY<a.minY||a.maxY<r.minY)&&n(r.a,r.b,a.a)*n(r.a,r.b,a.b)<=0&&n(a.a,a.b,r.a)*n(a.a,a.b,r.b)<=0)return!0}}return!1}function Wl(e,t,n){if(e.length<2)return[];let o=n??Er(e),r=new Map;for(let a=0;a<e.length;a++){let s=r.get(e[a].blockId);s?s.push(a):r.set(e[a].blockId,[a])}let i=[];for(let[,a]of r){let s=[];for(let y of a){let M=e[y].patch;M&&M.length>=3?i.push({outline:[...M],holes:[],topY:e[y].y}):s.push(y)}if(!s.length)continue;s.sort((y,M)=>e[y].depth-e[M].depth);let l=s.map(y=>zl(e,y,o,t)).filter(y=>y!==null);if(!l.length)continue;let u=(y,M)=>({x:y.pts[M].x-y.nrm[M][0]*(y.front+Un),y:y.pts[M].y-y.nrm[M][1]*(y.front+Un)}),m=(y,M)=>({x:y.pts[M].x+y.nrm[M][0]*(y.back+Un),y:y.pts[M].y+y.nrm[M][1]*(y.back+Un)}),f=l[0],h=l[l.length-1],d=[];for(let y=0;y<f.pts.length;y++)d.push(u(f,y));for(let y of l)d.push(m(y,y.pts.length-1));for(let y=h.pts.length-1;y>=0;y--)d.push(m(h,y));for(let y=l.length-1;y>=0;y--)d.push(u(l[y],0));let p=Xl(d),b=1/0;for(let y of s)e[y].y<b&&(b=e[y].y);if(!Number.isFinite(b))continue;if(p.length>=3&&Math.abs(mt(p))>1e-6&&l.every(y=>{let M=y.pts[Math.floor(y.pts.length/2)];return Ze(p,M.x,M.y)})&&!C0(p)){i.push({outline:jl(p,Ul),holes:[],topY:b});continue}for(let y of T0(l))i.push({outline:y,holes:[],topY:b})}return i}function T0(e){let t=[];for(let n of e){let o=[],r=[],i=n.front+Un,a=n.back+Un;for(let c=0;c<n.pts.length;c++){let l=n.pts[c],u=n.nrm[c];o.push([l.x-u[0]*i,l.y-u[1]*i]),r.push([l.x+u[0]*a,l.y+u[1]*a])}let s=[...o,...r.reverse()];s.length<3||(s.push(s[0]),t.push([s]))}if(!t.length)return[];try{let n=ya.default.union(t[0],...t.slice(1)),o=[];for(let r of n){if(!r.length||r[0].length<4)continue;let i=r[0].map(([c,l])=>({x:c,y:l})),a=i[0],s=i[i.length-1];i.length>1&&Math.abs(a.x-s.x)<1e-9&&Math.abs(a.y-s.y)<1e-9&&i.pop(),i.length>=3&&o.push(jl(i,Ul))}return o}catch{return[]}}function Xl(e){let t=[];for(let n of e){let o=t[t.length-1];o&&Math.hypot(n.x-o.x,n.y-o.y)<1e-9||t.push(n)}for(;t.length>2&&Math.hypot(t[0].x-t[t.length-1].x,t[0].y-t[t.length-1].y)<1e-9;)t.pop();return t}var ba=class{constructor(t){this.minX=1/0;this.minY=1/0;this.maxX=-1/0;this.maxY=-1/0;this.rings=t;for(let n of t)for(let o of n)o.x<this.minX&&(this.minX=o.x),o.y<this.minY&&(this.minY=o.y),o.x>this.maxX&&(this.maxX=o.x),o.y>this.maxY&&(this.maxY=o.y)}containsAll(t){for(let n of t)if(n.x<this.minX||n.x>this.maxX||n.y<this.minY||n.y>this.maxY)return!1;for(let n of this.rings){let o=!0;for(let r of t)if(!Ze(n,r.x,r.y)){o=!1;break}if(o)return!0}return!1}};function Vl(e,t,n,o,r,i){if(o.length<3)return;if(n.containsAll(o)){let l=[0,1,0],u=o[0];for(let m=1;m+1<o.length;m++){let f=o[m],h=o[m+1];e.tri([u.x*C,r,u.y*C],[f.x*C,r,f.y*C],[h.x*C,r,h.y*C],l,i)}return}let a=o.map(l=>[l.x,l.y]);a.push(a[0]);let s;try{s=ya.default.intersection([a],t)}catch{return}let c=[0,1,0];for(let l of s){if(!l.length||l[0].length<4)continue;let u=l[0],m=[],f=[];for(let d=0;d<u.length-1;d++)m.push(u[d][0],u[d][1]),f.push([u[d][0],u[d][1]]);if(f.length<3)continue;let h=(0,Gl.default)(m,void 0,2);for(let d=0;d<h.length;d+=3){let p=f[h[d]],b=f[h[d+1]],x=f[h[d+2]];e.tri([p[0]*C,r,p[1]*C],[b[0]*C,r,b[1]*C],[x[0]*C,r,x[1]*C],c,i)}}}function Kl(e,t,n,o,r,i,a){if(t.length<2)return;let s=a??Er(t),c=[0,1,0],l=i&&i.length>=3?[[...i.map(h=>[h.x,h.y]),[i[0].x,i[0].y]]]:null,u=i&&i.length>=3?new ba([[...i]]):null,m=h=>{e.setMaterial(2),h(),e.setMaterial(0)},f=h=>{e.setMaterial(3),h(),e.setMaterial(0)};for(let h=0;h<t.length;h++){let d=t[h];if(d.patch&&d.patch.length>=3){let w=[...d.patch],g=s[h].belowY??o;if(f(()=>{if(l&&u)Vl(e,l,u,w,d.y,r.tread);else{let S=w[0];for(let v=1;v+1<w.length;v++){let P=w[v],E=w[v+1];e.tri([S.x*C,d.y,S.y*C],[P.x*C,d.y,P.y*C],[E.x*C,d.y,E.y*C],c,r.tread)}}}),d.y>g+Nl){let S=0,v=0;for(let P of w)S+=P.x,v+=P.y;S/=w.length,v/=w.length,m(()=>{for(let P=0;P<w.length;P++){let E=w[P],k=w[(P+1)%w.length],L=k.x-E.x,I=k.y-E.y,R=Math.hypot(L,I);if(R<1e-6)continue;let _=I/R,F=-L/R;(E.x-S)*_+(E.y-v)*F<0&&(_=-_,F=-F);let N=[_,0,F],O=[E.x*C,d.y,E.y*C],V=[k.x*C,d.y,k.y*C],z=[E.x*C,g,E.y*C],G=[k.x*C,g,k.y*C];e.tri(O,V,G,N,r.riser),e.tri(O,G,z,N,r.riser)}})}continue}let p=zl(t,h,s,n);if(!p)continue;let{pts:b,nrm:x,front:y,back:M}=p,A=s[h].belowY??o;for(let w=0;w+1<b.length;w++){let g=b[w],S=b[w+1],v=x[w],P=x[w+1];if(Math.hypot(S.x-g.x,S.y-g.y)<1e-6||v[0]===0&&v[1]===0||P[0]===0&&P[1]===0)continue;let E=[(g.x-v[0]*y)*C,d.y,(g.y-v[1]*y)*C],k=[(S.x-P[0]*y)*C,d.y,(S.y-P[1]*y)*C],L=[(g.x+v[0]*M)*C,d.y,(g.y+v[1]*M)*C],I=[(S.x+P[0]*M)*C,d.y,(S.y+P[1]*M)*C];if(f(()=>{l&&u?Vl(e,l,u,[{x:g.x-v[0]*y,y:g.y-v[1]*y},{x:S.x-P[0]*y,y:S.y-P[1]*y},{x:S.x+P[0]*M,y:S.y+P[1]*M},{x:g.x+v[0]*M,y:g.y+v[1]*M}],d.y,r.tread):(e.tri(E,k,I,c,r.tread),e.tri(E,I,L,c,r.tread))}),d.y>A+Nl){let R=[E[0],A,E[2]],_=[k[0],A,k[2]],F=[-v[0],0,-v[1]];m(()=>{e.tri(E,k,_,F,r.riser),e.tri(E,_,R,F,r.riser)})}}}}function L0(e,t){let n=e.eventConfigurationIds;return!n?.length||!!t&&n.includes(t)}function Yl(e,t){return e.filter(n=>n.type!=="shape"||L0(n,t))}function $l(e,t){let n=e.focalPoint??{x:0,y:0};return e.floors?.length?e.floors.map((o,r)=>({objects:Yl(o.objects,t),focal:{x:(o.focalPoint??n).x,y:(o.focalPoint??n).y},baseHeightM:o.baseHeightM??0,index:r})):[{objects:Yl(e.objects,t),focal:n,baseHeightM:0,index:0}]}var k0={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};function zt(e){return Tl(e)??k0}function Zl(e,t){let n=Tt(e.outline,yt),o=zt(n),r=t.filter(a=>a!==e&&a.outline&&a.outline.length>=3&&Hn(o,zt(a.outline)));if(!r.length)return[n];let i=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s};try{let a=ga.default.difference([i(n)],...r.map(c=>[i(c.outline)])),s=[];for(let c of a){if(!c.length)continue;let l=c[0].map(([u,m])=>({x:u,y:m}));if(l.length>1){let u=l[0],m=l[l.length-1];Math.abs(u.x-m.x)<1e-9&&Math.abs(u.y-m.y)<1e-9&&l.pop()}l.length>=3&&s.push(l)}return s.length?s:[n]}catch{return[n]}}function ql(e,t){if(!t.length)return e;let n=i=>{let a=i.map(s=>[s.x,s.y]);return a.push(a[0]),a},o=t.map(i=>[n(i)]),r=[];for(let i of e){let a;try{a=ga.default.intersection([n(i.outline)],o.flat())}catch{r.push(i);continue}for(let s of a){if(!s.length)continue;let c=s[0].map(([l,u])=>({x:l,y:u}));if(c.length>1){let l=c[0],u=c[c.length-1];Math.abs(l.x-u.x)<1e-9&&Math.abs(l.y-u.y)<1e-9&&c.pop()}c.length>=3&&r.push({outline:c,holes:[],topY:i.topY})}}return r.length?r:e}function O0(e,t){return e===void 0||t===void 0?!0:Math.abs(e-t)<.001}var Ir=class{constructor(){this.rings=[];this.boxes=[];this.levels=[]}subtract(t,n){let o=t.map(c=>[c.x,c.y]);if(o.length<3)return[];o.push(o[0]);let r=zt(t),i=this.rings.filter((c,l)=>Hn(r,this.boxes[l])&&O0(n,this.levels[l])),a=[[o]];if(i.length)try{a=Ql.default.difference([o],...i).map(l=>l.map(u=>u.map(([m,f])=>[m,f])))}catch{a=[[o]]}this.rings.push([o]),this.boxes.push(r),this.levels.push(n);let s=[];for(let c of a){if(!c.length)continue;let l=c[0].map(([u,m])=>({x:u,y:m}));if(l.length>1){let u=l[0],m=l[l.length-1];Math.abs(u.x-m.x)<1e-9&&Math.abs(u.y-m.y)<1e-9&&l.pop()}l.length>=3&&s.push(l)}return s}};function jn(e,t,n=e){if(!t)return e;let o=1/0,r=-1/0,i=1/0,a=-1/0;for(let f of n)o=Math.min(o,f.x),r=Math.max(r,f.x),i=Math.min(i,f.y),a=Math.max(a,f.y);let s=(o+r)/2,c=(i+a)/2,l=t*Math.PI/180,u=Math.cos(l),m=Math.sin(l);return e.map(f=>{let h=f.x-s,d=f.y-c;return{x:s+h*u-d*m,y:c+h*m+d*u}})}function Jl(e){let t=Cl(e);return!t.length||!e.points?.length?[]:t.map(n=>jn(n,e.rotation,e.points))}function Me(e){let t=null;if(e.kind==="polygon"&&e.points&&e.points.length>=3)return jn(Pr(e,4),e.rotation,e.points);if(e.kind==="rect"&&e.width&&e.height&&(t=xo(e.x??0,e.y??0,e.width,e.height)),e.kind==="ellipse"&&e.width&&e.height){let n=(e.x??0)+e.width/2,o=(e.y??0)+e.height/2;t=Mr(n,o,e.width/2,e.height/2)}return t?jn(t,e.rotation):null}function St(e){let t=e.role??"",o=t==="stage"?{kind:"stage",heightM:tl(e.stageKind)}:{stage:{kind:"stage",heightM:1},entrance:{kind:"portal",heightM:2.7},exit:{kind:"portal",heightM:2.7},screen:{kind:"solid",heightM:6},wall:{kind:"solid",heightM:2.8},rail:{kind:"solid",heightM:1.1},suite:{kind:"suite",heightM:3},obstruction:{kind:"solid",heightM:4.5},sound:{kind:"solid",heightM:1.45},restroom:{kind:"solid",heightM:2.4},bar:{kind:"solid",heightM:1.1},concession:{kind:"solid",heightM:1.1},coat:{kind:"solid",heightM:1.1},goal:{kind:"portal",heightM:1.8}}[t]??{kind:"plate",heightM:.25};return{...o,heightM:e.heightM??o.heightM}}var F0=.08,D0=30,N0=.015;function B0(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],a=t[r];i.y>e.y!=a.y>e.y&&e.x<(a.x-i.x)*(e.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function eu(e,t){let n=Me(e)??(e.points?.length?jn(e.points,e.rotation):null),o=St(e),i=!e.role&&o.kind==="plate"&&e.heightM===void 0&&!!n&&Math.abs(mt(n))*he**2>=D0?N0:o.heightM;if(!n)return{topOffsetM:i,supportOffsetM:0};if(o.kind!=="plate"&&o.kind!=="stage")return{topOffsetM:i,supportOffsetM:0};let a=1/0,s=1/0,c=-1/0,l=-1/0;for(let h of n)a=Math.min(a,h.x),s=Math.min(s,h.y),c=Math.max(c,h.x),l=Math.max(l,h.y);let u=i,m=0,f=1e-6*Math.max(1,c-a,l-s);for(let h of t)c>h.minX&&a<h.maxX&&l>h.minY&&s<h.maxY&&u<=h.topOffsetM+1e-6&&(u=h.topOffsetM+F0),a>=h.minX-f&&c<=h.maxX+f&&s>=h.minY-f&&l<=h.maxY+f&&(!h.poly||n.every(b=>B0(b,h.poly)||V0(b,h.poly,f)))&&(m=Math.max(m,h.topOffsetM));return e.fill&&e.fill!=="none"&&e.fill!=="transparent"&&t.push({minX:a,minY:s,maxX:c,maxY:l,topOffsetM:u,poly:n}),{topOffsetM:u,supportOffsetM:Math.min(m,u)}}function V0(e,t,n){for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[r],a=t[o],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l?Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/l)):0;if(Math.hypot(e.x-(i.x+u*s),e.y-(i.y+u*c))<=n)return!0}return!1}function qt(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function ft(e){if(e.length!==4)return e;let t=Math.hypot(e[1].x-e[0].x,e[1].y-e[0].y),n=Math.hypot(e[2].x-e[1].x,e[2].y-e[1].y);return t>=n?e:[e[1],e[2],e[3],e[0]]}function nt(e,t,n){return[qt(e[0],e[1],t),qt(e[0],e[1],n),qt(e[3],e[2],n),qt(e[3],e[2],t)]}function Eo(e,t,n){return[qt(e[0],e[3],t),qt(e[1],e[2],t),qt(e[1],e[2],n),qt(e[0],e[3],n)]}function we(e,t,n,o,r,i,a){ie(e,t,a?.length?a:void 0,()=>n,o,r,i,oe)}var tu=[.13,.14,.17],Wn=[.4,.43,.47],G0=.18,H0=.02,z0=2.4,U0=1500,j0=240,W0=.25,X0=12,K0=[.055,.06,.075],Y0=[.46,.33,.22],$0=[1,.96,.84],Z0=[.98,.66,.28],q0=[.5,.31,.15],Q0=[1,.87,.64],Ye={lampEvery:1.8,lampsMin:3,lampsMax:14,lampDrop:.45,lampRadius:[.11,.2],poolShare:.44,poolEdge:.9,poolStrength:.5,washByDay:.35,drapeClear:.12,glowClear:.06,coreClear:.12,poolLift:.02};function J0(e,t,n,o){let r=1/0,i=0;for(let a=0;a<e.length;a++){let s=e[a],c=e[(a+1)%e.length],l=c.x-s.x,u=c.y-s.y,m=n*u-o*l;if(Math.abs(m)<1e-12)continue;let f=((s.x-t.x)*u-(s.y-t.y)*l)/m,h=((s.x-t.x)*o-(s.y-t.y)*n)/m;f>0&&h>=0&&h<1&&(i+=1,r=Math.min(r,f))}return i%2===1?r:0}function xa(e,t){if(!t.length)return!1;let n=0,o=0,r=0,i=new Set;for(let s of t)n+=s.x,o+=s.y,r+=Math.hypot(s.x-e.x,s.y-e.y),i.add(Math.floor(Math.atan2(s.y-e.y,s.x-e.x)*180/Math.PI/10));let a=Math.hypot(e.x-n/t.length,e.y-o/t.length);return i.size*10>j0&&a<W0*(r/t.length)}function nu(e,t,n,o,r={}){let i=t.stageKind??"";if(vt(i)||i==="round"||!o.length)return;let a=Me(t);if(!a||a.length<3)return;let s={x:a.reduce((B,Y)=>B+Y.x,0)/a.length,y:a.reduce((B,Y)=>B+Y.y,0)/a.length},c=0,l=0;for(let B of o)c+=B.x,l+=B.y;let u=s.x-c/o.length,m=s.y-l/o.length,f=Math.hypot(u,m);if(f<1e-6||xa(s,o))return;let h=u/f,d=m/f,p=-d,b=h,x=-1/0,y=1/0,M=1/0,A=-1/0;for(let B of a){let Y=(B.x-s.x)*h+(B.y-s.y)*d,q=(B.x-s.x)*p+(B.y-s.y)*b;x=Math.max(x,Y),y=Math.min(y,Y),M=Math.min(M,q),A=Math.max(A,q)}let w=(A-M)*C,g=(x-y)*C;if(w<3||g<1.5||w*g>U0)return;let S=G0/C,v=(B,Y)=>({x:s.x+h*B+p*Y,y:s.y+d*B+b*Y}),P=(B,Y,q,J)=>[v(B,q),v(B,J),v(Y,J),v(Y,q)],E=n+Math.max(3.5,Math.min(8,w*.35)),k=n+Math.min(z0,E-n-1),L=.2/C,I=y+Math.min(g*.25,1.5)/C,R=H0/C;ie(e,P(x-2*S+R,x-S-R,M+S+L,A-S-L),void 0,()=>k,n,tu,tu,oe);for(let[B,Y]of[[M+S,M+S+L],[A-S-L,A-S]])ie(e,P(x-2*S,x-S,B,Y),void 0,()=>E+.3,n,Wn,Wn,oe),ie(e,P(I+L,x-2*S,B,Y),void 0,()=>E+.3,E,Wn,Wn,oe);ie(e,P(I,I+L,M+S,A-S),void 0,()=>E+.3,E,Wn,Wn,oe);let _=(B,Y)=>[B.x*C,Y,B.y*C],F=[-h,0,-d],N=M+S+L,O=A-S-L,V=x-2*S-Ye.drapeClear/C,z=E-n,G=r.night===!1?Ye.washByDay:1,T=(B,Y)=>Se(K0,Y0,G*(1-B*B)*Math.pow(1-Y,1.6)),D=(B,Y,q=0)=>_(v(V-q/C,(N+O)/2+B*(O-N)/2),n+z*Y);e.setMaterial(X0);let W=8,H=5;for(let B=0;B<W;B++)for(let Y=0;Y<H;Y++){let q=B/W*2-1,J=(B+1)/W*2-1,te=Y/H,ae=(Y+1)/H;e.tri(D(q,te),D(J,te),D(J,ae),F,T(q,te),T(J,te),T(J,ae)),e.tri(D(q,te),D(J,ae),D(q,ae),F,T(q,te),T(J,ae),T(q,ae))}let j=Math.max(Ye.lampsMin,Math.min(Ye.lampsMax,Math.round(w/Ye.lampEvery))),Z=Math.max(Ye.lampRadius[0],Math.min(Ye.lampRadius[1],w*.012)),X=(O-N)*C,ee=1-Ye.lampDrop/z,ne=(B,Y,q,J,te)=>{let fe=Y/X*2,Ue=Y/z;for(let se=0;se<10;se++){let Te=2*Math.PI*se/10,ht=2*Math.PI*(se+1)/10,Ee=[Math.cos(Te)*fe,Math.sin(Te)*Ue],qe=[Math.cos(ht)*fe,Math.sin(ht)*Ue];e.tri(D(B,ee,q),D(B+Ee[0],ee+Ee[1],q),D(B+qe[0],ee+qe[1],q),F,J,te(Ee[0],Ee[1]),te(qe[0],qe[1]))}};for(let B=0;B<j;B++){let Y=(B+.5)/j*2-1;ne(Y,Z*3,Ye.glowClear,Se(T(Y,ee),q0,.85),(q,J)=>T(Y+q,ee+J)),ne(Y,Z,Ye.coreClear,$0,()=>Z0)}if(e.setMaterial(0),!r.night||!r.deck)return;let ue=r.deck,de=v((y+x-2*S)/2,(M+A)/2),me=n+Ye.poolLift,pe=[0,1,0],Pe=[{r:.4,k:.72},{r:.72,k:.28},{r:1,k:0}],_e=28,xe=[];for(let B=0;B<_e;B++){let Y=2*Math.PI*B/_e,q=Math.cos(Y)*(x-2*S-y)*Ye.poolShare,J=Math.sin(Y)*(A-M)*Ye.poolShare,te=Math.hypot(q,J),ae=(h*q+p*J)/te,fe=(d*q+b*J)/te;xe.push(Math.min(te,J0(a,de,ae,fe)*Ye.poolEdge))}if(xe.some(B=>!(B>0)))return;let Ce=(B,Y)=>{let q=2*Math.PI*(B%_e)/_e,J=Math.cos(q)*(x-2*S-y)*Ye.poolShare,te=Math.sin(q)*(A-M)*Ye.poolShare,ae=Math.hypot(J,te),fe=xe[B%_e]*Y/ae;return _({x:de.x+(h*J+p*te)*fe,y:de.y+(d*J+b*te)*fe},me)},$=B=>Se(ue,Q0,Ye.poolStrength*B);for(let B=0;B<_e;B++){e.tri(_(de,me),Ce(B,Pe[0].r),Ce(B+1,Pe[0].r),pe,$(1),$(Pe[0].k),$(Pe[0].k));for(let Y=0;Y+1<Pe.length;Y++){let q=Pe[Y],J=Pe[Y+1];e.tri(Ce(B,q.r),Ce(B,J.r),Ce(B+1,J.r),pe,$(q.k),$(J.k),$(J.k)),e.tri(Ce(B,q.r),Ce(B+1,J.r),Ce(B+1,q.r),pe,$(q.k),$(J.k),$(q.k))}}}function ou(e,t){let n={openField:!1,court:!1,indoorCourt:!1,inTheRound:!1,stage:!1,standing:0,seatCount:t.length};for(let o of e)for(let r of o.objects){if(r.type==="gaArea"&&(n.standing+=r.capacity),r.type!=="shape")continue;let i=r.stageKind;if(yn(i)){n.openField=!0;continue}if(vt(i)){n.court=!0,el(i)&&(n.indoorCourt=!0);continue}if(r.role!=="stage")continue;if(n.stage=!0,i==="round"){n.inTheRound=!0;continue}let a=Me(r);if(!a||a.length<3)continue;let s={x:a.reduce((c,l)=>c+l.x,0)/a.length,y:a.reduce((c,l)=>c+l.y,0)/a.length};xa(s,t)&&(n.inTheRound=!0)}return n}var cu=10,Mn=11,Xn=[.93,.94,.95],ey=[.93,.8,.22],ty=[.82,.14,.16],ny=[.78,.1,.12],Ma=[.74,.77,.8],va={width:7.32,height:2.44,depth:2},_r={width:1.83,height:1.22,depth:1,fromEndBoards:3.35},oy=1.5,ry=1.8,Sa=2.4,ot=(e,t)=>[e[0]-t[0],e[1]-t[1],e[2]-t[2]],_o=(e,t)=>[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]],Ut=e=>{let t=Math.hypot(e[0],e[1],e[2])||1;return[e[0]/t,e[1]/t,e[2]/t]};function gt(e,t,n,o,r){let i=Ut(ot(n,t)),a=Ut(_o(i,Math.abs(i[1])<.9?[0,1,0]:[1,0,0])),s=_o(a,i),c=(l,u)=>{let m=u===0||u===3?-o:o,f=u<2?-o:o;return[l[0]+a[0]*m+s[0]*f,l[1]+a[1]*m+s[1]*f,l[2]+a[2]*m+s[2]*f]};for(let l=0;l<4;l++){let u=(l+1)%4,m=c(t,l),f=c(t,u),h=c(n,l),d=c(n,u),p=Ut(_o(ot(f,m),ot(h,m))),b=ot([(m[0]+f[0])/2,(m[1]+f[1])/2,(m[2]+f[2])/2],t);p[0]*b[0]+p[1]*b[1]+p[2]*b[2]<0&&(p=[-p[0],-p[1],-p[2]]);let x=re(r,.86+.14*Math.max(0,p[1]));e.tri(m,f,d,p,x),e.tri(m,d,h,p,x)}}function Io(e,t,n,o,r){let i=Math.hypot(...ot(n,t)),a=Math.hypot(...ot(r,t)),s=Ut(_o(ot(n,t),ot(r,t)));e.tri(t,n,o,s,[0,0,0],[i,0,0],[i,a,0]),e.tri(t,o,r,s,[0,0,0],[i,a,0],[0,a,0])}function Pa(e,t,n,o,r,i,a,s,c){let l=(y,M)=>[y[0],y[1]+M,y[2]],u=y=>[y[0]+o[0]*i,y[1],y[2]+o[2]*i],m=l(t,r),f=l(n,r),h=u(t),d=u(n),p=u(m),b=u(f);e.setMaterial(c),gt(e,t,m,a,s),gt(e,n,f,a,s),gt(e,m,f,a,s),e.setMaterial(Mn);let x=Math.min(a,.03);for(let[y,M]of[[h,p],[d,b],[m,p],[f,b],[p,b],[t,h],[n,d],[h,d]])gt(e,y,M,x,re(s,.92));e.setMaterial(cu),Io(e,h,d,b,p),Io(e,m,f,b,p),Io(e,t,h,p,m),Io(e,n,d,b,f),e.setMaterial(0)}var wa={height:.711,width:.2286,pitchLength:20.12},iy=[.88,.8,.6];function lu(e,t,n){if(t.length!==4)return;let o=a=>Math.hypot(t[(a+1)%4].x-t[a].x,t[(a+1)%4].y-t[a].y),r=o(0)<=o(1)?0:1,i=Math.max(o(0),o(1))*C/wa.pitchLength;if(i>.2){e.setMaterial(Mn);for(let a of[r,r+2]){let s=t[a%4],c=t[(a+1)%4],l=o(a%4)||1,u={x:(s.x+c.x)/2,y:(s.y+c.y)/2},m=(c.x-s.x)/l,f=(c.y-s.y)/l;for(let h of[-1,0,1]){let d=h*wa.width*i/2/C,p=Oe({x:u.x+m*d,y:u.y+f*d},n);gt(e,p,[p[0],p[1]+wa.height*i,p[2]],.019*i,iy)}}e.setMaterial(0)}}var Oe=(e,t)=>[e.x*C,t,e.y*C];function uu(e){if(e.length<3)return null;let t=0,n=0;for(let x of e)t+=x.x,n+=x.y;t/=e.length,n/=e.length;let o=0,r=0,i=0;for(let x of e){let y=x.x-t,M=x.y-n;o+=y*y,r+=M*M,i+=y*M}let a=.5*Math.atan2(2*i,o-r),s=Math.cos(a),c=Math.sin(a),l=1/0,u=-1/0,m=1/0,f=-1/0;for(let x of e){let y=(x.x-t)*s+(x.y-n)*c,M=-(x.x-t)*c+(x.y-n)*s;l=Math.min(l,y),u=Math.max(u,y),m=Math.min(m,M),f=Math.max(f,M)}let h=(u-l)*C,d=(f-m)*C;if(!(h>4)||!(d>2))return null;let p={a:(l+u)/2,b:(m+f)/2};return{at:(x,y)=>{let M=p.a+x/C,A=p.b+y/C;return{x:t+s*M-c*A,y:n+c*M+s*A}},lengthM:h,widthM:d}}function mu(e,t,n,o,r,i){let a=t.map(c=>Oe(c,n)),s=t.map(c=>Oe(c,n+o));e.setMaterial(0);for(let c=0;c<t.length;c++)gt(e,a[c],s[c],r,i);e.setMaterial(Mn);for(let c=0;c+1<t.length;c++)gt(e,s[c],s[c+1],.025,i);e.setMaterial(cu);for(let c=0;c+1<t.length;c++)Io(e,a[c],a[c+1],s[c+1],s[c]);e.setMaterial(0)}var ru=[.66,.29,.22],ay=[.87,.79,.58],iu=[.17,.36,.63],fu=[.56,.59,.63],sy=[.7,.7,.68],cy={length:176.9,trackWidth:9.76,longJump:{runway:40,runwayWidth:1.22,pit:9,pitWidth:2.75,fromKerb:3,start:-25},highJump:{matLength:3,matWidth:5,matHeight:.7,apron:15,intoBend:3.5,bar:2},cage:{radius:3.5,height:7,intoBend:10,pad:1.07,sectorDeg:34.92,sector:60,openDeg:120}};function hu(e,t,n){let o=uu(t);if(!o)return;let{at:r,lengthM:i,widthM:a}=o,s=cy,c=Math.min(1.2,Math.max(.5,i/s.length)),l=a/2,u=i/2-l,m=l-s.trackWidth;if(!(u>30*c)||!(m>22*c))return;let f=n+.03,h=(L,I,R=0)=>{ie(e,L,void 0,()=>f+R,f+R-.004,I,I,oe)},d=(L,I,R,_)=>[r(L,R),r(I,R),r(I,_),r(L,_)];e.setMaterial(0),h(d(u-.08,u+.08,-l+.2,-m-.2),Xn);let p=s.longJump,b=m-p.fromKerb*c,x=(p.start+p.runway)*c;h(d(p.start*c,x,b-p.runwayWidth*c/2,b+p.runwayWidth*c/2),ru),h(d(x,x+p.pit*c,b-p.pitWidth*c/2,b+p.pitWidth*c/2),ay);let y=s.highJump,M=-(u+y.intoBend*c),A=[];for(let L=0;L<=16;L++){let I=-Math.PI/2+Math.PI*L/16;A.push(r(M-.3*c+Math.cos(I)*y.apron*c,Math.sin(I)*y.apron*c))}h(A,ru),ie(e,d(M-y.matLength*c,M,-(y.matWidth*c)/2,y.matWidth*c/2),void 0,()=>n+y.matHeight*c,n,iu,re(iu,.82),oe),e.setMaterial(Mn);let w=[-1,1].map(L=>r(M+.25*c,L*(y.bar+.1)*c));for(let L of w)gt(e,Oe(L,n),Oe(L,n+(y.bar+.3)*c),.02,Xn);gt(e,Oe(w[0],n+y.bar*c),Oe(w[1],n+y.bar*c),.015,Xn),e.setMaterial(0);let g=s.cage,S=u+g.intoBend*c;h(((L,I)=>Array.from({length:I},(R,_)=>{let F=2*Math.PI*_/I;return r(S+Math.cos(F)*L,Math.sin(F)*L)}))(g.pad*c,16),sy);let P=g.sectorDeg/2*Math.PI/180;for(let L of[-1,1]){let I=g.sector*c,R=-Math.cos(P),_=L*Math.sin(P);h([r(S+_*.15,-R*.15),r(S+R*I+_*.15,_*I-R*.15),r(S+R*I-_*.15,_*I+R*.15),r(S-_*.15,R*.15)],Xn,.006)}let E=g.openDeg/2*Math.PI/180,k=[];for(let L=0;L<=6;L++){let I=E+(2*Math.PI-2*E)*L/6;k.push(r(S-Math.cos(I)*g.radius*c,Math.sin(I)*g.radius*c))}mu(e,k,n,g.height*c,.05,fu)}var ly=[.95,.8,.16],au=[.13,.17,.2],su=[.78,.8,.83],uy={backY:70,backHalf:25,pole:{x:70,y:-18},net:{height:9,inset:.5,wing:15},poleHeight:12,dugout:{length:18,depth:2.4,height:1,along:.32,inset:1.9}};function du(e,t,n,o,r,i){let a=uy,s={x:a.pole.x-a.backHalf,y:a.pole.y-a.backY},c=Math.hypot(s.x,s.y),l=s.x/c,u=s.y/c,m=(M,A,w)=>t(M*(a.backHalf+l*A+u*w),a.backY+u*A-l*w),f=a.net,h=a.backY-f.inset,d=a.backHalf-f.inset,p=[m(-1,f.wing,f.inset)];for(let M of[-d,-d/2,d/2,d])p.push(t(M,h));p.push(m(1,f.wing,f.inset)),mu(e,p,n,f.height*o,.05,fu),e.setMaterial(0);for(let M of[-1,1]){let A=Oe(t(M*(a.pole.x-.4),a.pole.y+.4),n);gt(e,A,[A[0],A[1]+a.poleHeight*o,A[2]],.09,ly)}if(!i)return;let b=a.dugout,x=b.along*c-b.length/2,y=x+b.length;for(let M of[-1,1]){let A=[m(M,x,b.inset-b.depth/2),m(M,y,b.inset-b.depth/2)],w=[m(M,x,b.inset+b.depth/2),m(M,y,b.inset+b.depth/2)],g=Math.ceil(b.length),S=!0;for(let k=0;S&&k<=g;k++){let L=k/g;S=r({x:A[0].x+(A[1].x-A[0].x)*L,y:A[0].y+(A[1].y-A[0].y)*L})}if(!S)continue;let v=[A[0],A[1],w[1],w[0]];ie(e,v,void 0,()=>n+(b.height-.1)*o,n,au,re(au,.85),oe);let P=(k,L)=>({x:k.x+(k.x-L.x)*.04,y:k.y+(k.y-L.y)*.04}),E=[P(A[0],w[1]),P(A[1],w[0]),P(w[1],A[0]),P(w[0],A[1])];ie(e,E,void 0,()=>n+b.height*o,n+(b.height-.14)*o,su,re(su,.9),oe)}}function pu(e,t,n,o,r,i){let a=t.lengthM/2,s=t.widthM/2;if(i){let c=va.width/2*o,l=va.depth*o;for(let u of[-1,1]){let m=t.at(u*(a+l),-c),f=t.at(u*(a+l),c);if(!r(m)||!r(f))continue;let h=Oe(t.at(u*a,-c),n),d=Oe(t.at(u*a,c),n),p=Oe(t.at(u*(a+1),0),n),b=Oe(t.at(u*a,0),n);Pa(e,h,d,Ut(ot(p,b)),va.height*o,l,.06,Xn,0)}}e.setMaterial(Mn);for(let c of[-1,1])for(let l of[-1,1]){if(!r(t.at(c*a,l*s)))continue;let u=Oe(t.at(c*a,l*s),n),m=[u[0],u[1]+oy*o,u[2]];gt(e,u,m,.02,ey);let f=Ut(ot(Oe(t.at(c*(a+1),l*(s+1)),n),u)),h=[m[0]+f[0]*.4*o,m[1]-.14*o,m[2]+f[2]*.4*o],d=[m[0],m[1]-.28*o,m[2]];e.tri(m,h,d,Ut(_o(ot(h,m),ot(d,m))),ty)}e.setMaterial(0)}function bu(e,t,n,o,r){let i=uu(t);if(!i)return;let{at:a,lengthM:s}=i,c=Math.min(1.2,Math.max(.5,s/60)),l=s/2-_r.fromEndBoards*c,u=_r.width/2*c;for(let b of[-1,1]){let x=Oe(a(b*l,-u),n),y=Oe(a(b*l,u),n),M=Oe(a(b*(l+1),0),n),A=Oe(a(b*l,0),n);Pa(e,x,y,Ut(ot(M,A)),_r.height*c,_r.depth*c,.03,ny,Mn)}let m=bt(t,r/2/C);if(m.length<3)return;let f=o+ry;e.setMaterial(Mn);let h=Sa;for(let b=0;b<m.length;b++){let x=m[b],y=m[(b+1)%m.length],M=Math.hypot(y.x-x.x,y.y-x.y)*C,A=0;for(;h+(M-A)>=Sa;){A+=Sa-h,h=0;let w=M>0?A/M:0,g={x:x.x+(y.x-x.x)*w,y:x.y+(y.y-x.y)*w};gt(e,Oe(g,o),Oe(g,f),.025,Ma)}h+=M-A}let d=bt(t,(r/2-.03)/C),p=bt(t,(r/2+.03)/C);d.length>=3&&p.length>=3&&ie(e,d,[p.slice().reverse()],()=>f,f-.05,Ma,re(Ma,.9),oe),e.setMaterial(0)}function yu(e,t,n,o,r){if(t.length!==4||!(r-o>.2))return;let i=(d,p)=>({x:(d.x+p.x)/2,y:(d.y+p.y)/2}),a=d=>Math.hypot(d.x-n.x,d.y-n.y),s=a(i(t[0],t[1]))<=a(i(t[3],t[2])),[c,l,u]=s?[t[0],t[1],t[3]]:[t[3],t[2],t[0]],m=Math.hypot(u.x-c.x,u.y-c.y)*C;if(!(m>.05))return;let f=Oe(c,o),h=Oe(l,o);Pa(e,f,h,Ut(ot(Oe(u,o),f)),r-o,m,.06,Xn,0)}var my=[.12,.38,.16],fy=[.72,.62,.45],hy=[.88,.93,.96],gu=[.95,.95,.94],dy=[.66,.29,.22],Aa={length:20.12,width:3.05},py=.14,by=9.76,wt=[.93,.94,.95],Cr=[.1,.11,.13],yy=[.45,.85,1.25],gy=1.45,xu=.012,Mu=.004,vu=1.07,Tr=.15,Su=[.93,.76,.18],Ra={height:.2,proud:.02,buried:.03};function vn(e,t,n,o,r,i){e.setMaterial(i),ie(e,t,n?[n.slice().reverse()]:void 0,()=>o,o-.004,r,r,oe)}var Kn=(e,t)=>bt(e,t/C);function Pu(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=Math.hypot(o,r);if(i<1e-9)return null;let a=-r/i*n,s=o/i*n;return[{x:e.x+a,y:e.y+s},{x:t.x+a,y:t.y+s},{x:t.x-a,y:t.y-s},{x:e.x-a,y:e.y-s}]}function xy(e,t,n,o){let r=t.map(i=>[i.x*C,n,i.y*C]);e.tri(r[0],r[1],r[2],[0,1,0],o),e.tri(r[0],r[2],r[3],[0,1,0],o)}function Yn(e,t,n,o,r,i){let a=n/C,s=[{x:t.x-a,y:t.y-a},{x:t.x+a,y:t.y-a},{x:t.x+a,y:t.y+a},{x:t.x-a,y:t.y+a}];ie(e,s,void 0,()=>r,o,i,re(i,.85),oe)}function rt(e,t,n,o,r,i,a){let s=Pu(t,n,o/C);s&&ie(e,s,void 0,()=>i,r,a,re(a,.85),oe)}function ko(e){let t=ft(e),n={x:(t[0].x+t[2].x)/2,y:(t[0].y+t[2].y)/2},o=Math.hypot(t[1].x-t[0].x,t[1].y-t[0].y)||1,r=Math.hypot(t[3].x-t[0].x,t[3].y-t[0].y)||1,i={x:(t[1].x-t[0].x)/o,y:(t[1].y-t[0].y)/o},a={x:(t[3].x-t[0].x)/r,y:(t[3].y-t[0].y)/r};return{at:(c,l)=>({x:n.x+(i.x*c+a.x*l)/C,y:n.y+(i.y*c+a.y*l)/C}),lengthM:o*C,widthM:r*C}}function Ea(e){let t=1/0,n=-1/0,o=1/0,r=-1/0;for(let f of e.points??[])t=Math.min(t,f.x),n=Math.max(n,f.x),o=Math.min(o,f.y),r=Math.max(r,f.y);let i=(e.rotation??0)*Math.PI/180,a=Math.cos(i),s=Math.sin(i),c=(t+n)/2,l=(o+r)/2,u=f=>i?{x:c+(f.x-c)*a-(f.y-l)*s,y:l+(f.x-c)*s+(f.y-l)*a}:f,m=(f,h,d,p)=>u({x:c+f/d*(n-t),y:l+h/p*(r-o)});return{turn:u,shortSideM:Math.min(n-t,r-o)*C,local:m,widthU:n-t}}function My(e){let t=na(e).find(n=>n.closed&&!n.fill&&n.points.length===4);return t?t.points.map(Ea(e).turn):null}function Au(e,t,n){let o=na(t);if(!o.length)return;let{turn:r,shortSideM:i}=Ea(t),a=Math.max(.04,Math.min(.3,i*.004))/C,s=0;e.setMaterial(0);for(let u of o){if(!u.fill)continue;let m=u.points.map(r);vn(e,m,null,n+xu+s*Mu,ve(u.fill)??wt,0),s++}let c=o.filter(u=>!(u.fill&&u.ink===u.fill)),l=[...new Set(c.map(u=>u.ink??vr))];for(let u of l){let m=n+xu+s++*Mu,f=ve(u)??wt;for(let h of c){if((h.ink??vr)!==u)continue;let d=h.points.map(r),p=h.closed?d.length:d.length-1;for(let b=0;b<p;b++){let x=Pu(d[b],d[(b+1)%d.length],a);x&&xy(e,x,m,f)}}}}function Ru(e,t,n,o,r,i){if(t.length<3)return!1;let a=o+.006,s=r??my;if(n==="oval-cricket"){let c=t.reduce((g,S)=>g+S.x,0)/t.length,l=t.reduce((g,S)=>g+S.y,0)/t.length,u=g=>t.map(S=>({x:c+(S.x-c)*g,y:l+(S.y-l)*g})),m=8;for(let g=0;g<m;g++){let S=u(1-g/m),v=g===m-1?null:u(1-(g+1)/m);vn(e,S,v,a,re(s,g%2?1.04:.96),4)}let f=t[0];for(let g of t)Math.hypot(g.x-c,g.y-l)>Math.hypot(f.x-c,f.y-l)&&(f=g);let h=Math.hypot(f.x-c,f.y-l)||1,d=(f.x-c)/h,p=(f.y-l)/h,b=-p,x=d,y=Math.min(1,2*h*C*py/Aa.length),M=Aa.length*y/2/C,A=Aa.width*y/2/C,w=(i&&My(i))??[[-M,-A],[M,-A],[M,A],[-M,A]].map(([g,S])=>({x:c+d*g+b*S,y:l+p*g+x*S}));return vn(e,w,null,a+.004,fy,0),lu(e,w,a+.004),e.setMaterial(0),!0}if(n==="rink-hockey"){let c=Kn(t,Tr);vn(e,c,null,a,hy,0),e.setMaterial(0),ie(e,t,[c.slice().reverse()],()=>o+vu,o,gu,re(gu,.9),oe);let l=Kn(t,Tr-Ra.buried),u=Kn(t,Tr+Ra.proud);return l.length>=3&&u.length>=3&&ie(e,l,[u.slice().reverse()],()=>o+Ra.height,o,Su,re(Su,.92),oe),bu(e,t,a,o+vu,Tr),!0}if(n==="ring-boxing"&&t.length===4){let{at:c}=ko(t),l=[c(-3.05,-3.05),c(3.05,-3.05),c(3.05,3.05),c(-3.05,3.05)],u=[[.77,.19,.19],wt,[.17,.42,.69],wt];e.setMaterial(0),l.forEach((m,f)=>Yn(e,m,.07,o,o+gy,u[f]));for(let m of yy)for(let f=0;f<4;f++)rt(e,l[f],l[(f+1)%4],.025,o+m-.025,o+m+.025,wt);return!0}if(n==="court-tennis"&&t.length===4){let{at:c}=ko(t);e.setMaterial(0),rt(e,c(0,-6.4),c(0,6.4),.015,o,o+.95,Cr),rt(e,c(0,-6.4),c(0,6.4),.03,o+.95,o+1,wt);for(let l of[-1,1])Yn(e,c(0,l*6.4),.05,o,o+1.07,Cr);return!0}if(n==="court-basketball"&&t.length===4){let{at:c,lengthM:l}=ko(t),u=Math.min(14,l/2-.5);e.setMaterial(0);for(let m of[-1,1]){let f=c(m*(u+1.2),0),h=c(m*(u-1.2),0);Yn(e,f,.12,o,o+3.4,Cr),rt(e,f,h,.06,o+3.25,o+3.4,Cr),rt(e,c(m*(u-1.2),-.9),c(m*(u-1.2),.9),.03,o+2.9,o+3.95,wt)}return!0}if(n==="pitch-rugby"&&t.length===4){let{at:c,lengthM:l}=ko(t),u=l*(50/120);e.setMaterial(0);for(let m of[-1,1]){for(let f of[-2.8,2.8])Yn(e,c(m*u,f),.07,o,o+12,wt);rt(e,c(m*u,-2.8),c(m*u,2.8),.06,o+2.94,o+3.06,wt)}return!0}if(n==="track-athletics"){let c=Kn(t,by);return c.length<3?!1:(vn(e,t,c,a,dy,0),vn(e,c,null,a,s,4),e.setMaterial(0),hu(e,t,o),!0)}return!1}var Co=140,wu=1.6,To=[.9,.91,.93],Lr=[.15,.19,.3],Lo=[.14,.15,.18],vy=[.1,.24,.18],kr=.9,Sy=6,wy={"pitch-football":105,"pitch-rugby":120,"court-tennis":23.77,"court-basketball":32},Py={sidelineShare:15/19,fromSideline:1.35,tableHalfLength:4.5,tableHalfDepth:.38,tableHeight:.76,benchFrom:6,benchTo:12.5,benchHalfDepth:.25,benchHeight:.45,benchBackHeight:.85},Ay=[.13,.15,.2],Ry=[.82,.84,.87];function Eu(e,t,n,o,r,i=!1,a=!1){let s=t.stageKind;if(!s||n.length<3)return;if(e.setMaterial(0),s==="diamond-baseball"){let{local:P,widthU:E}=Ea(t);if(!(E>0))return;let k=P(0,0,Co,Co),L=r.filter(R=>Math.hypot(R.x-k.x,R.y-k.y)<=E),I=Math.min(1.2,Math.max(.5,E*C/Co));du(e,(R,_)=>P(R,_,Co,Co),o,I,R=>L.every(_=>Math.hypot(_.x-R.x,_.y-R.y)*C>=wu),!a),e.setMaterial(0);return}if(s==="oval-cricket"){let P=Kn(n,2.85),E=Kn(n,3.1);P.length>=3&&E.length>=3&&vn(e,P,E,o+.03,wt,0),e.setMaterial(0);return}let c=wy[s];if(!c||n.length!==4)return;let{at:l,lengthM:u,widthM:m}=ko(n),f=Math.min(1.2,Math.max(.5,u/c)),h=u/2,d=m/2,p=Math.max(h,d)+14,b=l(0,0),x=r.filter(P=>Math.hypot(P.x-b.x,P.y-b.y)*C<p),y=P=>x.every(E=>Math.hypot(E.x-P.x,E.y-P.y)*C>=wu),M=(P,E)=>{let k=Math.max(1,Math.ceil(Math.hypot(E.x-P.x,E.y-P.y)*C));for(let L=0;L<=k;L++)if(!y({x:P.x+(E.x-P.x)*(L/k),y:P.y+(E.y-P.y)*(L/k)}))return!1;return!0},A=(P,E,k,L,I)=>{let R=Math.hypot(E[0]-P[0],E[1]-P[1]),_=Math.max(1,Math.round(R/Sy));for(let F=0;F<_;F++){let N=F/_+.012,O=(F+1)/_-.012,V=l(P[0]+(E[0]-P[0])*N,P[1]+(E[1]-P[1])*N),z=l(P[0]+(E[0]-P[0])*O,P[1]+(E[1]-P[1])*O);M(V,z)&&rt(e,V,z,.06,o,o+I,L&&F%2?L:k)}};if(s==="court-basketball"){let P=Py;for(let E of[-1,1]){let k=E*(d*P.sidelineShare+P.fromSideline*f),L=k+E*P.tableHalfDepth*f,I=(N,O)=>M(l(N,k),l(O,k))&&M(l(N,L),l(O,L)),R=P.tableHalfLength*f;if(!I(-R,R))continue;let _=l(-R,k),F=l(R,k);rt(e,_,F,P.tableHalfDepth*f,o,o+P.tableHeight-.04,Ay),rt(e,_,F,P.tableHalfDepth*f+.04,o+P.tableHeight-.06,o+P.tableHeight,Ry);for(let N of[-1,1]){let O=N*P.benchFrom*f,V=N*P.benchTo*f;if(!I(O,V))continue;rt(e,l(O,k),l(V,k),P.benchHalfDepth,o,o+P.benchHeight,Lo);let z=k+E*(P.benchHalfDepth+.04);rt(e,l(O,z),l(V,z),.03,o,o+P.benchBackHeight,Lo)}break}return}if(s==="court-tennis"){let P=h+6.4*f,E=d+3.66*f;for(let L of[-1,1])A([L*P,-E],[L*P,E],vy,null,1);let k=l(0,d+1.2*f);y(k)&&(Yn(e,k,.3,o,o+1.5,Lo),Yn(e,k,.36,o+1.5,o+1.62,wt));return}pu(e,{at:l,lengthM:u,widthM:m},o,f,y,s==="pitch-football"&&!i);let w=d+3.2*f,g=h+4*f,S=3*f,v=15*f;A([-h+S,w],[h-S,w],To,Lr,kr),A([-h+S,-w],[-v,-w],To,Lr,kr),A([v,-w],[h-S,-w],To,Lr,kr);for(let P of[-1,1])A([P*g,-d+S],[P*g,d-S],To,Lr,kr);for(let P of a?[]:[-1,1]){let E=P*2.5*f,k=P*10.5*f,L=-(d+4.4*f),I=l(E,L),R=l(k,L);!M(I,R)||!M(l(E,L-.75*f),l(k,L-.75*f))||(rt(e,I,R,.35,o,o+.45,Lo),rt(e,l(E,L-.75*f),l(k,L-.75*f),.05,o,o+1.9,Lo),rt(e,l(E,L-.2*f),l(k,L-.2*f),.62,o+1.9,o+1.98,To))}}var Qt=72,Ey=1.2,Iy=5,_y=30,Cy=4;function Ty(e,t,n,o){let r=0;for(let i=0;i<e.length;i++){let a=e[i],s=e[(i+1)%e.length],c=s.x-a.x,l=s.y-a.y,u=n*l-o*c;if(Math.abs(u)<1e-12)continue;let m=((a.x-t.x)*l-(a.y-t.y)*c)/u,f=((a.x-t.x)*o-(a.y-t.y)*n)/u;m>r&&f>=-1e-9&&f<=1+1e-9&&(r=m)}return r}function Ly(e,t){if(e.length<3)return null;let n={x:e.reduce((s,c)=>s+c.x,0)/e.length,y:e.reduce((s,c)=>s+c.y,0)/e.length},o=2*Math.PI/Qt,r=new Float64Array(Qt);for(let s=0;s<Qt;s++)if(r[s]=Ty(e,n,Math.cos(s*o),Math.sin(s*o)),!(r[s]>0))return null;let i=new Float64Array(Qt).fill(1/0);for(let s of t){let c=s.x-n.x,l=s.y-n.y,u=Math.hypot(c,l),m=(Math.round(Math.atan2(l,c)/o)%Qt+Qt)%Qt;u>r[m]&&u<i[m]&&(i[m]=u)}let a=[];for(let s=0;s<Qt;s++){let l=Number.isFinite(i[s])&&i[s]-r[s]<=_y/C?i[s]+Ey/C:r[s]+Iy/C;a.push({x:n.x+Math.cos(s*o)*l,y:n.y+Math.sin(s*o)*l})}return a}function ky(e){return Se(re(e,.84),[.33,.36,.31],.22)}function Iu(e,t,n,o,r){let i=Ly(t,o);if(!i)return;let a=n-.015;e.setMaterial(Cy);let s=ky(r);ie(e,i,void 0,()=>a,a-.004,s,s,oe),e.setMaterial(0)}function _u(e){let t=1/0,n=1/0,o=-1/0,r=-1/0;for(let i of e)t=Math.min(t,i.x),o=Math.max(o,i.x),n=Math.min(n,i.y),r=Math.max(r,i.y);return{x:(t+o)/2,y:(n+r)/2}}function Oy(e,t){let n=_u(e),o=_u(t);return Ze(t,n.x,n.y)||Ze(e,o.x,o.y)}function Or(e){let t=new Set;if(e.length<2)return t;let n=[...e].sort((r,i)=>r.baseHeightM-i.baseHeightM||r.index-i.index),o=[];for(let r of n){let i=[];for(let a of r.objects){if(a.type!=="shape"||a.role!=="stage")continue;let s=Me(a);!s||s.length<3||(o.some(c=>Oy(s,c))?t.add(a):i.push(s))}o.push(...i)}return t}var Cu="#ffffff";var Fy={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"},EP=Fy.wheelchair;var Fr=["#e69f00","#56b4e9","#009e73","#f0e442","#0072b2","#d55e00","#cc79a7"],Tu="#a4508b";var Ia={facilities:Tu,"food-drink":Fr[5],navigation:Fr[2],accessibility:Fr[4]},Br=Cu,_a={minDiameterPx:12,glyphScale:.66,ringRatio:1/14,largeFromPx:24};var Fe=e=>{let t=Math.round(e*100)/100;return Object.is(t,-0)?"0":String(t)},Qn=e=>`${Fe(e[0])} ${Fe(e[1])}`,qn=(e,t,n,o)=>[e+n*Math.cos(o*Math.PI/180),t+n*Math.sin(o*Math.PI/180)];function ju(e){let t=`M${Qn(e.from)}`;for(let n of e.segs)t+=n.arc?`A${Fe(n.arc.r)} ${Fe(n.arc.r)} 0 ${n.arc.large} ${n.arc.sweep} ${Qn(n.to)}`:`L${Qn(n.to)}`;return`${t}Z`}function De(e){let t=[e.from,...e.segs.map(o=>o.to)],n=[];for(let o=e.segs.length-1;o>=0;o--){let r=e.segs[o].arc;n.push({to:t[o],arc:r&&{...r,sweep:r.sweep?0:1}})}return{from:t[t.length-1],segs:n}}function Ne(e,t,n){let o={r:n,large:0,sweep:1};return{from:[e-n,t],segs:[{to:[e+n,t],arc:o},{to:[e-n,t],arc:o}]}}function ye(e,t,n,o,r){let i=Math.min(r,n/2,o/2),a={r:i,large:0,sweep:1};return i<=0?Ge([[e,t],[e+n,t],[e+n,t+o],[e,t+o]]):{from:[e+i,t],segs:[{to:[e+n-i,t]},{to:[e+n,t+i],arc:a},{to:[e+n,t+o-i]},{to:[e+n-i,t+o],arc:a},{to:[e+i,t+o]},{to:[e,t+o-i],arc:a},{to:[e,t+i]},{to:[e+i,t],arc:a}]}}function Ge(e){let t=0;for(let o=0;o<e.length;o++){let[r,i]=e[o],[a,s]=e[(o+1)%e.length];t+=r*s-a*i}let n=t>0?e:[...e].reverse();return{from:n[0],segs:[...n.slice(1).map(o=>({to:o})),{to:n[0]}]}}function Le(e,t,n){let o=n/2,r=t[0]-e[0],i=t[1]-e[1],a=Math.hypot(r,i);if(a<1e-6)return Ne(e[0],e[1],o);let s=[i/a*o,-r/a*o],c={r:o,large:0,sweep:1},l=[e[0]+s[0],e[1]+s[1]];return{from:l,segs:[{to:[t[0]+s[0],t[1]+s[1]]},{to:[t[0]-s[0],t[1]-s[1]],arc:c},{to:[e[0]-s[0],e[1]-s[1]]},{to:l,arc:c}]}}function Ve(e,t,n=!1){let o=[],r=n?e.length:e.length-1;for(let i=0;i<r;i++)o.push(Le(e[i],e[(i+1)%e.length],t));return o}function Pt(e,t,n,o,r,i){let a=i/2,s=r-o>180?1:0,c={r:a,large:0,sweep:1},l=qn(e,t,n+a,o);return{from:l,segs:[{to:qn(e,t,n+a,r),arc:{r:n+a,large:s,sweep:1}},{to:qn(e,t,n-a,r),arc:c},{to:qn(e,t,n-a,o),arc:{r:n-a,large:s,sweep:0}},{to:l,arc:c}]}}var ge=(...e)=>e.flat().map(ju).join(" "),it=(e,t,n)=>`M${Fe(e-n)} ${Fe(t)}a${Fe(n)} ${Fe(n)} 0 1 0 ${Fe(2*n)} 0a${Fe(n)} ${Fe(n)} 0 1 0 ${Fe(-2*n)} 0`,Lt=(e,t,n,o,r)=>ju(ye(e,t,n,o,r)),Nr=e=>`M${e.map(Qn).join("L")}`,Dr=(e,t,n,o,r)=>`M${Qn(qn(e,t,n,o))}A${Fe(n)} ${Fe(n)} 0 ${r-o>180?1:0} 1 ${Qn(qn(e,t,n,r))}`;function $n(e,t,n,o=1){let r=i=>[i[0]*o+t,i[1]*o+n];return{head:[e.head[0]*o+t,e.head[1]*o+n,e.head[2]*o],limbs:e.limbs.map(i=>i.map(r)),arcs:e.arcs?.map(([i,a,s,c,l])=>[i*o+t,a*o+n,s*o,c,l])}}function Oo(e){return[it(e.head[0],e.head[1],e.head[2]),...e.limbs.map(Nr),...(e.arcs??[]).map(([t,n,o,r,i])=>Dr(t,n,o,r,i))].join(" ")}function Zn(e,t=2.6){return[Ne(e.head[0],e.head[1],e.head[2]+1),...e.limbs.flatMap(n=>Ve(n,t)),...(e.arcs??[]).map(([n,o,r,i,a])=>Pt(n,o,r,i,a,t-.2))]}var Sn={head:[10,4,2],limbs:[[[10,8.2],[10,14],[15.5,14],[18,19.5],[20.5,19.5]],[[10,10.6],[14.5,10.6]]],arcs:[[9.5,16,5.5,35,235]]},Lu={head:[10.6,3.9,1.9],limbs:[[[9.6,7.8],[7.6,12]],[[5.4,8.2],[9.4,8.4],[12.8,10]],[[4,15.6],[7.6,12],[11,13.6],[10.6,16.4]]]},ku={cx:12,hr:1.9,arm:5,leg:3,r:2},Ou={cx:12,hr:1.9,sh:2.2,hem:6,leg:3},Fu={cx:6.2,hr:1.8,arm:3.6,leg:2.2,r:1.4},Du={cx:17.8,hr:1.8,sh:1.4,hem:4.1,leg:2.2};function Nu({cx:e,hr:t,arm:n,leg:o,r}){return[it(e,2+t,t),`M${Fe(e-n+r)} 8.5H${Fe(e+n-r)}a${r} ${r} 0 0 1 ${r} ${r}V15H${Fe(e+o)}V22H${Fe(e-o)}V15H${Fe(e-n)}V${Fe(8.5+r)}a${r} ${r} 0 0 1 ${r} ${-r}Z`,`M${Fe(e)} 15V22`].join(" ")}function Bu({cx:e,hr:t,arm:n,leg:o,r}){return[Ne(e,2+t,t+1),ye(e-n-.5,7.8,2*n+1,7.7,r+.5),ye(e-o-.5,13,o,9.5,1),ye(e+.5,13,o,9.5,1)]}function Vu({cx:e,hr:t,sh:n,hem:o,leg:r}){return[it(e,2+t,t),Nr([[e-n,8.5],[e+n,8.5],[e+o,16],[e+r,16],[e+r,22],[e-r,22],[e-r,16],[e-o,16]])+"Z",`M${Fe(e)} 16V22`].join(" ")}function Gu({cx:e,hr:t,sh:n,hem:o,leg:r}){return[Ne(e,2+t,t+1),Ge([[e-n-.6,7.8],[e+n+.6,7.8],[e+o+.9,16.8],[e-o-.9,16.8]]),ye(e-r-.1,15,r-.4,7.5,.9),ye(e+.5,15,r-.4,7.5,.9)]}var Dy=[[14.6,1.5],[5.2,13.6],[11,13.6],[9.4,22.5],[18.8,10.4],[13,10.4]],Ny="M8.5 3.5 4 5.5l-1.5 5 3 1 1-2v11h11v-11l1 2 3-1-1.5-5-4.5-2c-.5 1.5-1.8 2.5-3.5 2.5s-3-1-3.5-2.5Z",By="M12 2.5S5 9.5 5 14.5a7 7 0 0 0 14 0c0-5-7-12-7-12Z",Vy="M2.5 21.5h19V3h-6v6.2H9.2v6.2H2.5Z",Hu=[[9,3],[15,3],[15,9],[21,9],[21,15],[15,15],[15,21],[9,21],[9,15],[3,15],[3,9],[9,9]],Gy={from:[3.8,5.2],segs:[{to:[20.2,5.2]},{to:[22,7],arc:{r:1.8,large:0,sweep:1}},{to:[22,9.7]},{to:[22,14.3],arc:{r:2.3,large:0,sweep:0}},{to:[22,17]},{to:[20.2,18.8],arc:{r:1.8,large:0,sweep:1}},{to:[3.8,18.8]},{to:[2,17],arc:{r:1.8,large:0,sweep:1}},{to:[2,14.3]},{to:[2,9.7],arc:{r:2.3,large:0,sweep:0}},{to:[2,7]},{to:[3.8,5.2],arc:{r:1.8,large:0,sweep:1}}]},Hy={from:[12,1.6],segs:[{to:[20.4,4.9]},{to:[20.4,11.2]},{to:[12,22.4],arc:{r:13,large:0,sweep:1}},{to:[3.6,11.2],arc:{r:13,large:0,sweep:1}},{to:[3.6,4.9]},{to:[12,1.6]}]};function zu(e,t,n){return{from:[e-n,t],segs:[{to:[e+n,t],arc:{r:n,large:0,sweep:1}},{to:[e-n,t]}]}}var Uu={head:[13.2,4.3,2.2],limbs:[[[12.6,8.6],[11.2,15],[17.8,18.4],[9.4,18.4]],[[12.4,9.8],[16,14.4]]]},zy=[[6,10.5],[15,10.5],[16.5,7],[18.5,5.5],[20,6.5],[21.5,8.5],[19.5,10],[18,12],[18,19],[16.5,19],[15.5,14],[9.5,14],[8.5,19],[7,19],[6.5,13]],Uy=[[5.4,9.8],[14.6,9.8],[16.1,6.4],[18.4,4.6],[20.5,5.9],[22.4,8.6],[19.9,10.6],[18.8,12.3],[18.8,19.8],[15.8,19.8],[15,14.8],[10.1,14.8],[9.2,19.8],[6.2,19.8],[5.6,13.2]],Ca=[{key:"restroom-men",label:"Men's restroom",group:"facilities",path:Nu(ku),solid:ge(Bu(ku))},{key:"restroom-women",label:"Women's restroom",group:"facilities",path:Vu(Ou),solid:ge(Gu(Ou))},{key:"restroom-accessible",label:"Accessible restroom",group:"facilities",path:[Lt(2.5,2.5,19,19,3.5),Oo($n(Sn,4.6,4.3,.66))].join(" "),solid:ge(Zn(Sn)),solidLarge:ge(ye(1.5,1.5,21,21,4.5),De(ye(3.9,3.9,16.2,16.2,2.6)),Zn($n(Sn,4.9,4.7,.62),2.2))},{key:"first-aid",label:"First aid",group:"facilities",path:Nr(Hu)+"Z",solid:ge(Ge(Hu.map(([e,t])=>[e+(e-12)*.08,t+(t-12)*.08])))},{key:"coat-check",label:"Coat check",group:"facilities",path:"M10 6.5a2 2 0 1 1 2 2V10 M12 10 3.4 16.9a1.4 1.4 0 0 0 .9 2.6h15.4a1.4 1.4 0 0 0 .9-2.6Z",solid:ge(Pt(12,6.2,2.2,180,450,2.3),Le([12,8.4],[12,10.5],2.3),Ve([[12,10.2],[3.2,18.8],[20.8,18.8]],2.8,!0))},{key:"atm",label:"ATM / cash",group:"facilities",path:[Lt(2,6,20,12,2),it(12,12,2.75),"M6 12h.01 M18 12h.01"].join(" "),solid:ge(ye(1.5,5.5,21,13,2.4),De(Ne(12,12,3.2)))},{key:"info",label:"Info point",group:"facilities",path:[it(12,12,9.5),"M10.8 11H12v5.8 M12 7.6h.01"].join(" "),solid:ge(Ne(12,4.9,2.4),ye(10.3,9.2,3.4,12.3,1),ye(8.2,9.2,4,3,1),ye(8.2,18.5,7.6,3,1))},{key:"lost-found",label:"Lost & found",group:"facilities",path:[it(10.5,10.5,7.5),"M16 16l5.5 5.5","M8.4 8.4a2.1 2.1 0 1 1 3 1.9c-.6.4-.9.8-.9 1.6 M10.5 14.6h.01"].join(" "),solid:ge(Pt(12,7.6,4.2,180,405,3.4),Ve([[14.97,10.57],[12,13],[12,15]],3.4),Ne(12,20,2.1))},{key:"restrooms",label:"Toilets",group:"facilities",path:[Nu(Fu),Vu(Du)].join(" "),solid:ge(Bu(Fu),Gu(Du))},{key:"charging",label:"Charging point",group:"facilities",path:[Lt(6,2,12,20,2.5),"M13.2 6.2 9.6 12h4.8l-3.6 5.8"].join(" "),solid:ge(Ge(Dy))},{key:"smoking",label:"Smoking area",group:"facilities",path:[Lt(2,14.5,14.5,4,1),"M6.5 14.5v4","M15.5 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4 M19 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4"].join(" "),solid:ge(ye(1.5,14,4.2,5,1.2),ye(6.8,14,10.4,5,1.2),Ve([[15.9,11.4],[17.3,8.9],[15.9,6.4],[17.1,3.9]],2.2),Ve([[19.6,11.4],[21,8.9],[19.6,6.4],[20.8,3.9]],2.2))},{key:"no-smoking",label:"No smoking",group:"facilities",path:[it(12,12,9.5),"M5.3 5.3l13.4 13.4","M5.5 10.5h13v3h-13Z"].join(" "),solid:ge(Ne(12,12,10.6),De(Ne(12,12,8)),Le([6,6],[18,18],2.8),ye(5,10.4,3,3.2,.6),ye(16,10.4,3,3.2,.6))},{key:"food",label:"Food",group:"food-drink",path:"M5 2.5V8a2.5 2.5 0 0 0 5 0V2.5 M7.5 2.5v19 M18.5 13.5h-2c-1.3 0-2-1-2-2.5 0-4 1.5-7 4-8.5v19",solid:ge(Ve([[4.9,2.6],[4.9,8]],2.2),Ve([[10.1,2.6],[10.1,8]],2.2),Ve([[7.5,2.6],[7.5,8]],2.2),Pt(7.5,8,2.6,0,180,2.2),Le([7.5,10],[7.5,21.4],3),Ge([[19.4,2.2],[19.4,14.2],[16.2,14.2],[14.1,12],[14.1,9.4],[15.2,5.8],[17.3,3.3]]),Le([18,13],[18,21.4],3))},{key:"bar",label:"Bar",group:"food-drink",path:"M3.5 3.5h17L12 13Z M6.2 6.5h11.6 M12 13v7.5 M8 20.5h8",solid:ge(Ge([[2.8,3],[21.2,3],[12,13.6]]),Le([12,12],[12,20.6],2.8),Le([7.4,21],[16.6,21],2.8))},{key:"coffee",label:"Caf\xE9 / coffee",group:"food-drink",path:"M4 9h12v4.5a5.5 5.5 0 0 1-5.5 5.5h-1A5.5 5.5 0 0 1 4 13.5Z M16 10.5h1.2a2.75 2.75 0 0 1 0 5.5H16 M8 3v3 M12 3v3 M3 21.5h14",solid:ge({from:[3.4,8.4],segs:[{to:[16.6,8.4]},{to:[16.6,13.4]},{to:[11,19.4],arc:{r:5.8,large:0,sweep:1}},{to:[9,19.4]},{to:[3.4,13.4],arc:{r:5.8,large:0,sweep:1}},{to:[3.4,8.4]}]},Pt(17.2,13.25,2.5,270,450,2.4),Le([7.8,2.6],[7.8,5.6],2.4),Le([12.2,2.6],[12.2,5.6],2.4),Le([2.6,21.6],[17.4,21.6],2.6))},{key:"water",label:"Water / drinks",group:"food-drink",path:By,solid:"M12 1.2S4 8.9 4 14.5a8 8 0 0 0 16 0c0-5.6-8-13.3-8-13.3Z"},{key:"merch",label:"Merch / shop",group:"food-drink",path:Ny,solid:"M8.4 2.8 3.5 5l-1.9 6 4.2 1.4.4-.8v9.4h11.6v-9.4l.4.8 4.2-1.4-1.9-6-4.9-2.2c-.4 1.5-1.8 2.6-3.6 2.6s-3.2-1.1-3.6-2.6Z"},{key:"screen",label:"Screen",group:"facilities",path:[Lt(2,3.5,20,13.5,2),"M12 17v3.5 M8 20.5h8","M10 7.8v5.9l5-2.95Z"].join(" "),solid:ge(ye(1.5,3,21,14.4,2.4),De(Ge([[9.6,6.7],[16,10.2],[9.6,13.7]])),ye(10.6,16.5,2.8,4,0),Le([7.4,21],[16.6,21],2.8))},{key:"sound-booth",label:"Sound booth",group:"facilities",path:["M6 3v9 M6 16v5 M12 3v3 M12 10v11 M18 3v10 M18 17v4",it(6,14,2),it(12,8,2),it(18,15,2)].join(" "),solid:ge(Le([6,2.8],[6,21.2],1.8),Le([12,2.8],[12,21.2],1.8),Le([18,2.8],[18,21.2],1.8),ye(3.2,11.6,5.6,4.8,1.4),ye(9.2,5.6,5.6,4.8,1.4),ye(15.2,12.6,5.6,4.8,1.4))},{key:"entrance",label:"Entrance",group:"navigation",path:"M11 7V3.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v17a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V17 M2.5 12h13.5 M12.5 8.5 16 12l-3.5 3.5",solid:ge(Ve([[11,6.5],[11,2.6],[21,2.6],[21,21.4],[11,21.4],[11,17.5]],2.6),Le([2.8,12],[13.5,12],3.2),Ge([[12.6,7.8],[18,12],[12.6,16.2]]))},{key:"exit",label:"Exit",group:"navigation",path:"M13 7V3.5a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v17a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V17 M8 12h13.5 M18 8.5l3.5 3.5-3.5 3.5",solid:ge(Ve([[13,6.5],[13,2.6],[3,2.6],[3,21.4],[13,21.4],[13,17.5]],2.6),Le([7.2,12],[17,12],3.2),Ge([[16.2,7.8],[21.6,12],[16.2,16.2]]))},{key:"emergency-exit",label:"Emergency exit",group:"navigation",path:[Oo($n(Lu,-2,1.4,1.15)),"M15.5 13h6 M19 10.5l2.5 2.5-2.5 2.5"].join(" "),solid:ge(Zn($n(Lu,-2,1.4,1.15),2.7),Le([15.6,13],[19.5,13],2.8),Ge([[18.4,9.4],[22.4,13],[18.4,16.6]]))},{key:"stairs",label:"Stairs",group:"navigation",path:Vy,solid:"M1.5 22.5h21V2h-7.8v6.4H8.4v6.4H1.5Z"},{key:"elevator",label:"Elevator",group:"navigation",path:[Lt(3.5,2.5,17,19,2.5),"M8.5 9.5 12 5.5l3.5 4Z M8.5 14.5l3.5 4 3.5-4Z"].join(" "),solid:ge(Ge([[12,1.6],[19.6,10.2],[4.4,10.2]]),Ge([[4.4,13.8],[19.6,13.8],[12,22.4]]))},{key:"parking",label:"Parking",group:"navigation",path:[Lt(3,3,18,18,3),"M9.5 17V7h3.75a3 3 0 0 1 0 6H9.5"].join(" "),solid:"M6.5 21V3H12a5.5 5.5 0 0 1 0 11h-1.9v7Z M10.1 6.6v3.8H12a1.9 1.9 0 0 0 0-3.8Z"},{key:"wheelchair",label:"Wheelchair access",group:"accessibility",path:Oo(Sn),solid:ge(Zn(Sn))},{key:"hearing",label:"Hearing assistance",group:"accessibility",path:["M4 9a6 6 0 1 1 12 0c0 3-1.8 4.3-3 5.2-1.1.8-1.6 1.7-1.6 3.1a3.6 3.6 0 0 1-6.2 2.1","M7.5 9a2.5 2.5 0 0 1 5 0c0 1.2-.7 1.9-1.6 2.5","M18.5 5.5a6.5 6.5 0 0 1 0 8"].join(" "),solid:ge(Pt(10,9,6,180,380,3),Ve([[15.64,11.05],[12.8,14.3],[11.5,17.2]],3),Pt(8.2,17.2,3.3,0,150,3),Pt(10,9,2.2,180,400,2.4),Pt(13.38,9.5,6.5,322,398,2.6))},{key:"box-office",label:"Box office / tickets",group:"navigation",path:"M3 7.5A1.5 1.5 0 0 1 4.5 6h15A1.5 1.5 0 0 1 21 7.5V10a2 2 0 0 0 0 4v2.5a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 16.5V14a2 2 0 0 0 0-4Z M15 6v2 M15 11v2 M15 16v2",solid:ge(Gy,De(ye(14.1,7,1.8,2.2,.9)),De(ye(14.1,10.9,1.8,2.2,.9)),De(ye(14.1,14.8,1.8,2.2,.9)))},{key:"escalator",label:"Escalator",group:"navigation",path:"M2.5 17H7l9-9h5.5v4h-4l-9 9h-6Z M11 4.5h.01 M11 8.2v3.3",solid:ge(Ge([[2,16.4],[6.8,16.4],[15.8,7.4],[22,7.4],[22,12.6],[17.8,12.6],[8.8,21.6],[2,21.6]]),Ne(11,4.3,2.3),Le([11,8],[11,11],2.6))},{key:"ramp",label:"Ramp",group:"navigation",path:"M2.5 19.5h19v-10Z M4.5 13.2 14 8.2 M10.53 7.76 14 8.2l-1.6 3.11",solid:ge(Ge([[1.6,20.4],[22.4,20.4],[22.4,8.6]]),Le([4.2,13.4],[13.2,8.6],2.6),Ge([[15.4,7.5],[13.16,11.84],[10.56,6.88]]))},{key:"taxi",label:"Taxi / rideshare",group:"navigation",path:["M9.5 2.5h5V5h-5Z M6.5 11 8 7h8l1.5 4",Lt(3.5,11,17,6,2),"M6.5 17v2.5 M17.5 17v2.5 M7 14h.01 M17 14h.01"].join(" "),solid:ge(ye(9,1.8,6,3.4,.8),Ge([[6,11.4],[7.6,6.4],[16.4,6.4],[18,11.4]]),ye(2.8,10.6,18.4,7,2.2),De(Ne(6.8,14,1.3)),De(Ne(17.2,14,1.3)),ye(4.8,16,3.6,5.2,1.2),ye(15.6,16,3.6,5.2,1.2))},{key:"transit",label:"Bus / transit",group:"navigation",path:[Lt(4.5,2.5,15,16,3),"M4.5 10.5h15 M9 5.5h6 M7.5 18.5V21 M16.5 18.5V21 M8 14.5h.01 M16 14.5h.01"].join(" "),solid:ge(ye(4,2,16,17,3.2),De(ye(6.2,5.8,11.6,5,1)),De(Ne(8,14.5,1.3)),De(Ne(16,14.5,1.3)),ye(6,17,3.4,5,1.2),ye(14.6,17,3.4,5,1.2))},{key:"bike-parking",label:"Bike parking",group:"navigation",path:[it(6,14.5,4),it(18,14.5,4),"M6 14.5 9 7.5h6.5L18 14.5 M9 7.5l2.5 7H6 M11.5 14.5l4-7 M7.5 6h3 M15.5 7.5 15 5.5h2"].join(" "),solid:ge(Ne(6,14.5,4.9),De(Ne(6,14.5,2.7)),Ne(18,14.5,4.9),De(Ne(18,14.5,2.7)),Ve([[6,14.5],[9,7.5],[15.5,7.5],[18,14.5]],2.2),Ve([[9,7.5],[11.5,14.5],[15.5,7.5]],2.2),Le([6,14.5],[11.5,14.5],2.2),Le([7.2,5.8],[10.6,5.8],2.2),Ve([[15.4,7.3],[15,5.4],[17.2,5.4]],2.2))},{key:"meeting-point",label:"Meeting point",group:"navigation",path:["M9.5 2.5 12 5l2.5-2.5 M9.5 21.5 12 19l2.5 2.5 M2.5 9.5 5 12l-2.5 2.5 M21.5 9.5 19 12l2.5 2.5",it(10,9.6,1.5),it(14,9.6,1.5),"M7.5 15.5a2.5 2.5 0 0 1 5 0 M11.5 15.5a2.5 2.5 0 0 1 5 0"].join(" "),solid:ge(Ve([[9.4,2.4],[12,5],[14.6,2.4]],2.6),Ve([[9.4,21.6],[12,19],[14.6,21.6]],2.6),Ve([[2.4,9.4],[5,12],[2.4,14.6]],2.6),Ve([[21.6,9.4],[19,12],[21.6,14.6]],2.6),Ne(9.7,9.3,2.2),Ne(14.3,9.3,2.2),zu(9.7,16,3),zu(14.3,16,3))},{key:"security",label:"Security / bag check",group:"facilities",path:"M12 2.5 19.5 5.5v6c0 4.6-3.2 8.4-7.5 10-4.3-1.6-7.5-5.4-7.5-10v-6Z M8.5 12l2.5 2.5 4.5-5",solid:ge(Hy,De(Ge([[7.4,12.2],[9,10.6],[10.9,12.5],[15,8.4],[16.6,10],[10.9,15.7]])))},{key:"lockers",label:"Lockers",group:"facilities",path:[Lt(3.5,2.5,17,19,1.5),"M12 2.5v19 M6 6h3 M15 6h3 M9.5 11.5v2.5 M14.5 11.5v2.5"].join(" "),solid:ge(ye(3,2,8.4,20,1.4),De(ye(5,5,4.4,1.7,.8)),De(ye(8.6,10.8,1.5,3.8,.7)),ye(12.6,2,8.4,20,1.4),De(ye(14.6,5,4.4,1.7,.8)),De(ye(13.9,10.8,1.5,3.8,.7)))},{key:"baby-change",label:"Baby change",group:"facilities",path:"M10 6.5l.8-3.3a1.2 1.2 0 0 1 2.4 0l.8 3.3 M8.5 6.5h7 M9.5 6.5l-.9 2.2a3 3 0 0 0-.1.9V19a2.5 2.5 0 0 0 2.5 2.5h2a2.5 2.5 0 0 0 2.5-2.5V9.6a3 3 0 0 0-.1-.9l-.9-2.2 M8.5 12.5h3 M8.5 16h3",solid:ge(Ge([[9.6,6.2],[10.6,1.8],[13.4,1.8],[14.4,6.2]]),ye(7.6,5.4,8.8,2.6,1),ye(7.8,7.4,8.4,15,2.6),De(ye(7.8,11.8,3.4,1.5,0)),De(ye(7.8,15.4,3.4,1.5,0)))},{key:"prayer-room",label:"Prayer room",group:"facilities",path:[Oo(Uu),"M3 21.5h18"].join(" "),solid:ge(Zn(Uu),ye(2.4,20.2,19.2,2.6,1.3))},{key:"quiet-room",label:"Quiet room",group:"facilities",path:"M4 9h3.5l5-4v14l-5-4H4Z M15.5 9.5l5 5 M20.5 9.5l-5 5",solid:ge(Ge([[2.6,8.4],[7.2,8.4],[13,3.6],[13,20.4],[7.2,15.6],[2.6,15.6]]),Le([15.4,9.2],[20.8,14.8],2.8),Le([20.8,9.2],[15.4,14.8],2.8))},{key:"wifi",label:"Wi-Fi",group:"facilities",path:[Dr(12,19,11.5,218,322),Dr(12,19,7.5,218,322),Dr(12,19,3.5,218,322),"M12 19h.01"].join(" "),solid:ge(Pt(12,19.2,11,218,322,2.8),Pt(12,19.2,6.9,218,322,2.8),Ne(12,19.2,2.2))},{key:"vip-lounge",label:"VIP lounge",group:"facilities",path:["M6.5 11V7a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v4","M3.5 11.5a1.5 1.5 0 0 1 3 0V14h11v-2.5a1.5 1.5 0 0 1 3 0v6h-17Z","M5.5 17.5V20 M18.5 17.5V20"].join(" "),solid:ge(ye(6,4,12,8.5,2.2),ye(2.4,9.6,4.6,9,2.2),ye(17,9.6,4.6,9,2.2),ye(6,13.2,12,5.4,.6),Le([5,18],[5,20.6],2.4),Le([19,18],[19,20.6],2.4))},{key:"accessible-entrance",label:"Accessible entrance",group:"accessibility",path:[Oo($n(Sn,.3,5,.62)),"M12.5 3.5H20a1 1 0 0 1 1 1v15a1 1 0 0 1-1 1h-7.5"].join(" "),solid:ge(Zn($n(Sn,.3,5,.62),2.2),Ve([[13,2.8],[21.2,2.8],[21.2,21.2],[13,21.2]],2.6))},{key:"assistance-dog",label:"Assistance-dog area",group:"accessibility",path:[Nr(zy)+"Z","M6 10.8 3.5 7.5","M10.5 10.5V6h4.5l1 2.5"].join(" "),solid:ge(Ge(Uy),Le([6.2,11],[3.2,7.2],2.4),Ve([[10.5,11],[10.5,5.6],[15.2,5.6],[16.2,8.2]],2.2))}],LP=new Map(Ca.map(e=>[e.key,e]));var Wu=Ca;var jy=new Map(Wu.map(e=>[e.key,e]));function Fo(e){return e?jy.get(e):void 0}var DP=Wu.map(e=>e.key);function Do(e){if(e.length<3)return e.map(n=>({...n}));let t=zn(e);return t.length>=3?t:[...e].sort((n,o)=>n.x-o.x||n.y-o.y).map(n=>({...n}))}var Wy=.8,Xy=.6,Ky=2;function Jt(e,t){if(!t.length)return null;let n=[],o=0;for(let a of e.objects){if(a.type!=="shape"||a.role!=="wall")continue;let s=Me(a)??[],c=Xu(s)/2;!(c>0)||Zy(s)/c*C>Ky||(n.push(...s),o+=c)}if(n.length<3)return null;let r=Do(n);if(r.length<3||o<Xu(r)*Xy)return null;let i=0;for(let a of t)qy(a,r)&&(i+=1);return i>=t.length*Wy?r:null}var Vr=6,Yy=5,$y=8;function Ku(e){return Math.max($y,(Number.isFinite(e)?e:0)+Yy)}function Jn(e){let t=0,n=0,o=0;for(let r=0;r<e.length;r++){let i=e[r],a=e[(r+1)%e.length],s=i.x*a.y-a.x*i.y;t+=s,n+=(i.x+a.x)*s,o+=(i.y+a.y)*s}if(Math.abs(t)<1e-9){let r=0,i=0;for(let a of e)r+=a.x,i+=a.y;return{x:r/Math.max(1,e.length),y:i/Math.max(1,e.length)}}return{x:n/(3*t),y:o/(3*t)}}function Zy(e){let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=o.x*r.y-r.x*o.y}return Math.abs(t)/2}function Xu(e){let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=Math.hypot(r.x-o.x,r.y-o.y)}return t}function qy(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],a=t[r];i.y>e.y!=a.y>e.y&&e.x<(a.x-i.x)*(e.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function Yu(e,t,n,o=[],r){if(t<1)return null;let i=1/0,a=-1/0,s=1/0,c=-1/0,l=-1/0,u=(M,A)=>{M<i&&(i=M),M>a&&(a=M),A<s&&(s=A),A>c&&(c=A)};for(let M=0;M<t;M++)u(e[M*3],e[M*3+2]),e[M*3+1]>l&&(l=e[M*3+1]);for(let[M,A]of o)u(M,A);if(!Number.isFinite(i)||!Number.isFinite(l))return null;let m=(i+a)/2,f=(s+c)/2,h=Math.max(4,(a-i)/2),d=Math.max(4,(c-s)/2),p=1,b=(M,A)=>{let w=Math.hypot((M-m)/h,(A-f)/d);w>p&&(p=w)};for(let M=0;M<t;M++)b(e[M*3],e[M*3+2]);for(let[M,A]of o)b(M,A);let x=Math.min(9,Math.max(5,2*Math.max(h,d)*.1)),y=Math.max(n+8,l+x);return{centre:[m,f],radii:[h*p+6,d*p+6],floorY:n,ceilingY:r===void 0?y:Math.max(r,l+5)}}function Qy(e){return{kind:"radial",rowCount:0,rows:[],nearestRow:()=>-1,depthAt:(t,n)=>Math.hypot(t-e.x,n-e.y),gradientAt:(t,n)=>{let o=t-e.x,r=n-e.y,i=Math.hypot(o,r);return i<1e-9?[0,0]:[o/i,r/i]}}}function Jy(e,t){if(!e.length)return null;let n=0,o=0,r=0;for(let h of e)n+=h.x,o+=h.y,r+=Math.hypot(h.x-t.x,h.y-t.y);let i=e.length;n/=i,o/=i,r/=i;let a=e[0],s=-1;for(let h of e){let d=Math.hypot(h.x-n,h.y-o);d>s&&(s=d,a=h)}let c=a.x-n,l=a.y-o,u=Math.hypot(c,l);u>1e-9?(c/=u,l/=u):(c=1,l=0);let m=[...e].sort((h,d)=>(h.x-n)*c+(h.y-o)*l-((d.x-n)*c+(d.y-o)*l)),f=0;for(let h of m){let d=Math.hypot(h.x-n,h.y-o);d>f&&(f=d)}return{pts:m,cx:n,cy:o,radius:f,depth:r}}function $u(e,t,n){let o=e.pts;if(o.length===1)return Math.hypot(t-o[0].x,n-o[0].y);let r=1/0;for(let i=0;i+1<o.length;i++){let a=o[i],s=o[i+1],c=s.x-a.x,l=s.y-a.y,u=c*c+l*l,m=u>1e-12?((t-a.x)*c+(n-a.y)*l)/u:0;m<0?m=0:m>1&&(m=1);let f=Math.hypot(t-(a.x+m*c),n-(a.y+m*l));f<r&&(r=f)}return r}var Gr=8;function eg(e,t,n){let o=new Array(Gr).fill(1/0),r=new Array(Gr).fill(-1);for(let u=0;u<e.length;u++){let m=e[u],f=Math.hypot(t-m.cx,n-m.cy)-m.radius;for(let h=0;h<Gr;h++)if(f<o[h]){for(let d=Gr-1;d>h;d--)o[d]=o[d-1],r[d]=r[d-1];o[h]=f,r[h]=u;break}}let i=new Array(3).fill(1/0),a=new Array(3).fill(-1);for(let u of r){if(u<0)continue;let m=$u(e[u],t,n);for(let f=0;f<3;f++)if(m<i[f]){for(let h=2;h>f;h--)i[h]=i[h-1],a[h]=a[h-1];i[f]=m,a[f]=u;break}}if(a[0]<0)return 0;if(i[0]<1e-6)return e[a[0]].depth;let s=i[0]*2.2,c=0,l=0;for(let u=0;u<3;u++){let m=a[u];if(m<0||i[u]>s)continue;let f=1/(i[u]*i[u]);c+=f*e[m].depth,l+=f}return l>0?c/l:e[a[0]].depth}function tg(e){let t=(o,r)=>eg(e,o,r),n=(o,r)=>{let i=1/0,a=-1;for(let s=0;s<e.length;s++){let c=e[s];if(Math.hypot(o-c.cx,r-c.cy)-c.radius>=i)continue;let l=$u(c,o,r);l<i&&(i=l,a=s)}return a};return{kind:"rows",rowCount:e.length,rows:e,nearestRow:n,depthAt:t,gradientAt:(o,r)=>{let i=(t(o+.5,r)-t(o-.5,r))/1,a=(t(o,r+.5)-t(o,r-.5))/(2*.5),s=Math.hypot(i,a);return s<1e-9?[0,0]:[i/s,a/s]}}}function Zu(e,t){let n=[];for(let o of e){let r=Jy(o.points,t);r&&n.push(r)}return n.length<2?Qy(t):(n.sort((o,r)=>o.depth-r.depth),tg(n))}var en=.06,ng=.05,Qu=.05,qu=.15,Ta=25;function Ju(e,t,n){let o=new Map,r=new Array(t.length).fill(null),i=new Float64Array(t.length),a=new Array(t.length).fill(void 0),s=new Array(t.length).fill(void 0),c=new Map,l=[],u=new Set;for(let f=0;f<e.length;f+=1){let h=e[f];for(let d of h.objects){if(d.type==="table"&&u.add(d.id),d.type!=="section"||!d.outline||d.outline.length<3)continue;let p=Tt(d.outline,yt);c.set(d.id,{section:d,unit:h,frontU:1/0,hasSeats:!1,rows:new Map,seatIndices:[]}),l.push({id:d.id,floorIndex:f,box:zt(p),section:d,unit:h,outline:p})}}let m=new Map;for(let f of l){let h=m.get(f.floorIndex);h?h.push(f):m.set(f.floorIndex,[f])}for(let f=0;f<t.length;f++){let h=t[f],d=n?m.get(n[f])??[]:l,p=h.sectionId?d.find(x=>x.id===h.sectionId)??d.find(x=>x.section.logicalSectionId===h.sectionId&&Ke({x:h.x,y:h.y},x.outline,x.section.holes)):void 0,b=p?[p]:d;for(let x of b){if(n&&x.floorIndex!==n[f]||!p&&(h.x<x.box.minX||h.x>x.box.maxX||h.y<x.box.minY||h.y>x.box.maxY||!Ke({x:h.x,y:h.y},x.outline,x.section.holes)))continue;r[f]=x.id;let y=c.get(x.id);y.hasSeats=!0;let M=h.focalPoint??x.unit.focal,A=Math.hypot(h.x-M.x,h.y-M.y);A<y.frontU&&(y.frontU=A),y.seatIndices.push(f);let w=h.rowId||`__seat-${f}`,g=y.rows.get(w);g?g.push({x:h.x,y:h.y}):y.rows.set(w,[{x:h.x,y:h.y}]);break}}for(let[f,h]of c){let d=$t(h.section,{floorBaseHeightM:h.unit.baseHeightM}),p=h.unit.baseHeightM,b=d.rake>0?Math.tan(d.rake*Math.PI/180):0,x=d.rake<=.01&&d.height<=p+.001,y=h.section.surfaceKind,M=y==="flat"?!0:y==="rakedRows"&&d.rake>.01?!1:x,A=h.hasSeats?wr(f,t,h.seatIndices,h.unit.focal):{sectionId:f,rows:[],blockCount:0},g=A.rows.length<2?Zu([...h.rows.values()].map(O=>({points:O})),h.unit.focal):null,S=1/0;if(g){if(h.hasSeats)for(let O of h.rows.values())for(let V of O){let z=g.depthAt(V.x,V.y);z<S&&(S=z)}if(!h.hasSeats||!Number.isFinite(S)){S=1/0;for(let O of h.section.outline){let V=g.depthAt(O.x,O.y);V<S&&(S=V)}}}let v=p+ng,P=Math.max(v,d.height),E=O=>{let V=Math.max(0,O-S)*he,z=Math.min(V*b,Ta);return Math.max(v,d.height+z)},k=O=>{let V=Math.max(0,O)*he,z=Math.min(V*b,Ta);return Math.max(v,d.height+z)},L=M?[]:A.rows.map(O=>({pts:O.pts,y:k(O.blockDepth),depth:O.blockDepth,blockId:O.blockId,...u.has(O.id)?{patch:Hl(O.pts,yt)}:{}})),I=L.length?L[0].y:P,R=L.map(O=>{let V=O.patch&&O.patch.length>=3?O.patch:O.pts,z=0,G=0;for(let W of V)z+=W.x,G+=W.y;let T=V.length||1;z/=T,G/=T;let D=0;for(let W of V){let H=Math.hypot(W.x-z,W.y-G);H>D&&(D=H)}return{cx:z,cy:G,rad:D}}),_=M?()=>P:L.length>=2?(O,V)=>{let z=1/0,G=I;for(let T=0;T<L.length;T++){let D=R[T];if(Math.hypot(O-D.cx,V-D.cy)-D.rad>=z)continue;let W=L[T].patch,H=W&&W.length>=3?Ze(W,O,V)?0:Bn(W,O,V):Bn(L[T].pts,O,V);H<z&&(z=H,G=L[T].y)}return G}:(O,V)=>g?E(g.depthAt(O,V)):P,F=[0,1,0],N=L.length>=2||M?()=>F:(O,V)=>{if(!g)return F;let z=g.depthAt(O,V);if(z<=S)return F;let G=(z-S)*he;if(G*b>=Ta||d.height+G*b<=v)return F;let[T,D]=g.gradientAt(O,V);if(T===0&&D===0)return F;let W=1/Math.hypot(b,1);return[-T*b*W,W,-D*b*W]};if(!M)for(let O of A.rows){let V=k(O.blockDepth);for(let z of O.seatIndices)a[z]=V}for(let O of A.rows){let V=[];for(let W=1;W<O.pts.length;W++){let H=Math.hypot(O.pts[W].x-O.pts[W-1].x,O.pts[W].y-O.pts[W-1].y);H>1e-6&&V.push(H)}V.sort((W,H)=>W-H);let z=V.length?V[Math.floor(V.length/2)]:1/0,G=1/0,T=O.pts[Math.floor(O.pts.length/2)];if(T)for(let W of A.rows){if(W===O||W.blockId!==O.blockId)continue;let H=Bn(W.pts,T.x,T.y);H>1e-6&&H<G&&(G=H)}let D=Math.min(z,Math.max(G,z*.5));if(Number.isFinite(D)&&D>0)for(let W of O.seatIndices)s[W]=D}o.set(f,{sectionId:f,deckAt:_,normalAt:N,flat:M,bottomY:p,rowLevels:L,landingY:I})}for(let f=0;f<t.length;f++){let h=r[f],d=t[f];if(h){let x=a[f];i[f]=(x??o.get(h).deckAt(d.x,d.y))+qu;continue}let p=d.eyeHeightM,b=Number.isFinite(p)?Math.max(0,p-_t):0;i[f]=d.kind==="booth"?b+en+qu:b}return{bySection:o,seatOwner:r,seatDeckY:f=>i[f],seatPitchU:f=>s[f]}}function eo(e,t,n){if(e.length!==4||n<=t)return null;let o=ft(e),r=Math.hypot(o[1].x-o[0].x,o[1].y-o[0].y)*C,i=Math.hypot(o[3].x-o[0].x,o[3].y-o[0].y)*C;if(r<1e-6||i<1e-6)return null;let a=Math.min(.22/r,.16),s=Math.min(.28,(n-t)*.13),c=Math.min(.065/i,.2);return{quad:o,side:a,face:c,opening:nt(o,a,1-a),openingTop:n-s}}function La(e,t,n){if(e.length!==4||n-t<=.2)return null;let o=ft(e),r=Math.hypot(o[1].x-o[0].x,o[1].y-o[0].y)*C;if(r<=1e-6)return null;let i=Math.min(.14,(n-t)*.08,r*.08),a=i/r,s=nt(o,a,1-a);return{quad:o,side:a,trim:i,inner:s,panel:Eo(s,.15,.85),bottom:t+i,top:n-i}}function em(e,t,n,o){let r=La(e,t,n);if(!r)return;let{panel:i}=r,a=(y,M)=>({x:(y.x+M.x)/2,y:(y.y+M.y)/2}),s=a(i[0],i[1]),c=a(i[3],i[2]),l=Math.hypot(s.x-o.x,s.y-o.y)<=Math.hypot(c.x-o.x,c.y-o.y),[u,m]=l?[i[0],i[1]]:[i[3],i[2]],f=l?{x:s.x-c.x,y:s.y-c.y}:{x:c.x-s.x,y:c.y-s.y},h=Math.hypot(f.x,f.y);if(h<1e-6)return;-(m.y-u.y)*f.x+(m.x-u.x)*f.y<0&&([u,m]=[m,u]);let d=Math.min(.006,h*C*.05),p=f.x/h*d,b=f.y/h*d,x=(y,M)=>[y.x*C+p,M,y.y*C+b];return[x(u,r.bottom),x(m,r.bottom),x(u,r.top),x(m,r.top)]}var nm=Et(require("polygon-clipping"),1);var tm=Et(require("polygon-clipping"),1);function jt(e,t,n,o,r,i,a,s={}){let c=zt(t),l=s.ao??oe,u=r.flatMap(p=>{if(p.role!=="entrance"&&p.role!=="exit")return[];let b=Me(p);if(!b||b.length!==4||!Hn(c,zt(b)))return[];let x=s.portalBase??n,y=eo(b,x,x+St(p).heightM);if(!y)return[];let M=Math.min(o,y.openingTop);return M<=n?[]:[{poly:y.opening,height:M}]});if(!u.length)return!1;let m=p=>p.map(b=>[b.x,b.y]),f=[m(t),...(s.holes??[]).map(m)],h=[n,...new Set(u.map(p=>p.height)),o].sort((p,b)=>p-b),d=[];try{for(let p=1;p<h.length;p++){let b=h[p-1],x=h[p];if(x-b<1e-6)continue;let y=u.filter(A=>A.height>b+1e-6).map(A=>[m(A.poly)]),M=y.length?tm.default.difference(f,...y):[f];d.push({low:b,high:x,polys:M})}}catch{return!1}for(let p of d)for(let b of p.polys){let[x,...y]=b.map(A=>A.map(([w,g])=>({x:w,y:g}))),M=A=>l.wallBottom+(l.top-l.wallBottom)*(A-n)/(o-n);ie(e,x,y,()=>p.high,p.low,i,a,{...l,top:M(p.high),wallBottom:M(p.low)})}return!0}var ka={depthM:1.6,thicknessM:.35,minWallM:6};function Hr(e,t,n,o,r,i,a,s,c){let l=o-n;if(l<=0)return;let u=s&&(c??l)>=ka.minWallM?og(t,s):null,m=u?o-ka.thicknessM:o,f=m-n,h=f<1.5?[[n,m,1]]:u?[[n,n+Math.min(.9,f*.18),.82],[n+Math.min(.9,f*.18),m,1]]:[[n,n+Math.min(.9,f*.18),.82],[n+Math.min(.9,f*.18),m-.1,1],[m-.1,m,1.1]],d=p=>oe.wallBottom+(oe.top-oe.wallBottom)*(p-n)/l;for(let[p,b,x]of h){let y={...oe,top:d(b),wallBottom:d(p)},M=re(i,x),A=re(a,x);jt(e,t,p,b,r,M,A,{portalBase:n,ao:y})||ie(e,t,void 0,()=>b,p,M,A,y)}for(let[p,...b]of u??[])ie(e,p,b.length?b:void 0,()=>o,m,re(i,1.12),re(a,.78),oe)}function og(e,t){let n=ka.depthM/C,o=e.map(a=>{let s=t.x-a.x,c=t.y-a.y,l=Math.hypot(s,c)||1;return{x:a.x+s/l*n,y:a.y+c/l*n}}),r=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s},i=[[r(e)],[r(o)]];for(let a=0;a<e.length;a++){let s=(a+1)%e.length;i.push([r([e[a],e[s],o[s],o[a]])])}try{let[a,...s]=i,c=nm.default.union(a,...s);return c.length?c.map(l=>l.map(u=>u.slice(0,-1).map(([m,f])=>({x:m,y:f})))):null}catch{return null}}function om(e){return e.route?.stepFree===!0&&(e.kind==="line"||e.kind==="polyline")}function rm(e){let t=Number.isFinite(e)&&e>0?e:4;return[Math.max(6,t*2.6),Math.max(4,t*1.7)]}function im(e,t,n){let o=[];if(e.length<2||!(t>0)||!(n>=0))return o;let r=!0,i=t;for(let a=0;a<e.length-1;a+=1){let s=e[a],c=e[a+1],l=Math.hypot(c.x-s.x,c.y-s.y);if(l<1e-9)continue;let u=(c.x-s.x)/l,m=(c.y-s.y)/l,f=0;for(;f<l-1e-9;){let h=Math.min(i,l-f);r&&o.push([{x:s.x+u*f,y:s.y+m*f},{x:s.x+u*(f+h),y:s.y+m*(f+h)}]),f+=h,i-=h,i<=1e-9&&(r=!r,i=r?t:n)}}return o}function No(e,t,n){let o=ve(t.stroke?.color),r=t.stroke?.width??0;if(!o||!Number.isFinite(r)||r<=0)return;let i=t.kind==="line"||t.kind==="polyline",a=i?jn(t.points??[],t.rotation):Me(t);if(!a||a.length<2)return;let s=r*.5,c=om(t)?im(a,...rm(r)):Array.from({length:i?a.length-1:a.length},(l,u)=>[a[u],a[(u+1)%a.length]]);for(let[l,u]of c){let m=Math.hypot(u.x-l.x,u.y-l.y);if(m<1e-6)continue;let f=-(u.y-l.y)/m*s,h=(u.x-l.x)/m*s,d=[(l.x+f)*C,n,(l.y+h)*C],p=[(u.x+f)*C,n,(u.y+h)*C],b=[(u.x-f)*C,n,(u.y-h)*C],x=[(l.x-f)*C,n,(l.y-h)*C];e.tri(d,p,b,[0,1,0],o),e.tri(d,b,x,[0,1,0],o)}}function am(e){return e==="bar"||e==="concession"||e==="coat"||e==="restroom"}var to=(e,t,n)=>({x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n});function zr(e,t,n,o){let[r,i,a,s]=t?e:[e[3],e[2],e[1],e[0]];return[to(r,s,n),to(i,a,n),to(i,a,o),to(r,s,o)]}function sm(e,t,n,o,r,i,a,s,c=!1){if(n.length!==4||r-o<.4)return!1;let l=v=>c?Math.min(v,r):v,u=ft(n),m=Math.hypot(u[3].x-u[0].x,u[3].y-u[0].y)*C;if(m<.4)return!1;let f=to(u[0],u[1],.5),h=to(u[3],u[2],.5),d=Math.hypot(f.x-s.x,f.y-s.y)<=Math.hypot(h.x-s.x,h.y-s.y),p=Se(a,[.92,.9,.86],.35),b=re(i,.72),x=r-o;if(t==="restroom"){let v=Math.min(.18,x*.08);return we(e,u,r-v,o,a,i),we(e,u,r,r-v,p,p),!0}let y=o+Math.min(1.1,x),M=t==="coat"?1:Math.min(.5,.75/m),A=zr(u,d,0,M);if(we(e,A,y-.05,o,b,i),we(e,A,y,y-.05,p,p),t==="coat"||m<1.2)return!0;if(t==="bar"){let v=zr(u,d,Math.max(M+.2,1-.45/m),1),P=l(o+Math.max(Math.min(2.2,x*2),y-o+.6));return we(e,v,P,o,a,b),!0}let w=zr(u,d,Math.max(M+.25,.55),1),g=l(o+Math.max(2.6,y-o+1.4));if(g-.14<=y)return!0;we(e,w,g-.14,o,a,i),we(e,u,g,g-.14,p,b);let S=Math.min(.08,.1/Math.max(.1,Math.hypot(u[1].x-u[0].x,u[1].y-u[0].y)*C));for(let[v,P]of[[0,S],[1-S,1]])we(e,zr(nt(u,v,P),d,0,Math.min(.08,.1/m)),g-.14,y,b,b);return!0}var Wr=[.19,.4,.15],rg=.012,Kr=2.4,ig=1,ag=.75,sg=.15;function At(e){if(e.points&&e.points.length>=3)return e.points;let{center:t,width:n,height:o,rotation:r}=e;if(!n||!o)return null;let i=(r??0)*Math.PI/180,a=Math.cos(i),s=Math.sin(i),c=n/2,l=o/2;return[[-c,-l],[c,-l],[c,l],[-c,l]].map(([u,m])=>({x:t.x+u*a-m*s,y:t.y+u*s+m*a}))}function hm(e,t,n,o,r,i,a=!1){let s=At(t);if(s){if(a){let c=xn(o,r.boothTop),l=Ct([...s]);ie(e,Tt(l,cg/C),[l.slice().reverse()],()=>n+.03,n,c,re(c,.8),oe);return}if(!(!t.points&&i&&ug(e,s,n,o,i))){if(!t.points&&i&&s.length===4){lg(e,s,n,o,i);return}ie(e,s,void 0,()=>n+Kr,n,xn(o,r.boothTop),r.boothWall,oe)}}}var Oa=1.1,cm=[.9,.9,.88],cg=.1,Ur=[.87,.87,.85],lm=.08;function dm(e,t){let n=c=>({x:(e[c].x+e[(c+1)%4].x)/2,y:(e[c].y+e[(c+1)%4].y)/2}),o=0,r=1/0;for(let c=0;c<4;c++){let l=n(c),u=Math.hypot(l.x-t.x,l.y-t.y);u<r&&(r=u,o=c)}let i=[0,1,2,3].map(c=>e[(o+c)%4]),a=(c,l,u)=>({x:c.x+(l.x-c.x)*u,y:c.y+(l.y-c.y)*u});return{q:i,part:(c,l,u,m)=>{let f=a(i[0],i[1],c),h=a(i[0],i[1],l),d=a(i[3],i[2],c),p=a(i[3],i[2],l);return[a(f,d,u),a(h,p,u),a(h,p,m),a(f,d,m)]},depthM:Math.hypot(i[3].x-i[0].x,i[3].y-i[0].y)*C,widthM:Math.hypot(i[1].x-i[0].x,i[1].y-i[0].y)*C}}function lg(e,t,n,o,r){let{q:i,part:a}=dm(t,r),s=o??[.35,.42,.55],c=Se(s,[.78,.78,.77],.62),l=Se(s,[.95,.95,.94],.45);we(e,i,n+en,n,c,re(c,.8)),we(e,a(.05,.95,.72,.98),n+Oa-.05,n+en,l,re(l,.8)),we(e,a(.03,.97,.7,1),n+Oa,n+Oa-.05,cm,re(cm,.9))}function ug(e,t,n,o,r){if(t.length!==4)return!1;let{q:i,part:a,depthM:s,widthM:c}=dm(t,r);if(s<1||c<1)return!1;let l=o??[.35,.42,.55],u=Se(l,[.78,.78,.77],.62),m=n+Kr,f=lm/c,h=lm/s;we(e,i,n+en,n,u,re(u,.8)),we(e,a(0,1,1-h,1),m,n+en,Ur,re(Ur,.9));for(let[b,x]of[[0,f],[1-f,1]])we(e,a(b,x,0,1-h),m,n+en,Ur,re(Ur,.9));we(e,a(f,1-f,0,Math.min(.5,.06/s)),m,m-.3,l,re(l,.85));let d=Math.min(.4,.6/c),p=Math.min(.12,.3/s);return we(e,a(.5-d,.5+d,.72-p,.72+p),n+ig,n+en,Se(l,[.95,.95,.94],.7),re(l,.75)),!0}function Yr(e){if(e.shape==="round"){let u=e.radius;return u?Mr(e.center.x,e.center.y,u,u,24):null}let{width:t,height:n,rotation:o,center:r}=e;if(!t||!n)return null;let i=(o??0)*Math.PI/180,a=Math.cos(i),s=Math.sin(i),c=t/2,l=n/2;return[[-c,-l],[c,-l],[c,l],[-c,l]].map(([u,m])=>({x:r.x+u*a-m*s,y:r.y+u*s+m*a}))}function pm(e,t,n,o,r,i=!0){let a=Yr(t);if(!a)return;let s=a.reduce((d,p)=>d+p.x,0)/a.length,c=a.reduce((d,p)=>d+p.y,0)/a.length,l=d=>a.map(p=>({x:s+(p.x-s)*d,y:c+(p.y-c)*d})),u=Vt(r)?1:hg,m=i&&o?xn(o,r.tableTop):re(mg,u),f=re(fg,u),h=n+ag;ie(e,a,void 0,()=>h,n+dg,m,re(m,.86),oe),ie(e,l(.12),void 0,()=>h+.12,h,f,re(f,.8),oe)}var mg=[.93,.92,.89],fg=[.78,.66,.42],hg=.62,dg=.25,Bo={armM:1.1,widthM:.28,insideM:1.4,low:.043,high:.048};function pg(e,t,n){let o=e.reduce((x,y)=>x+y.x,0)/4,r=e.reduce((x,y)=>x+y.y,0)/4,i=e[3].x-e[0].x,a=e[3].y-e[0].y,s=Math.hypot(i,a)||1;i/=s,a/=s,i*(t.x-o)+a*(t.y-r)<0&&(i=-i,a=-a);let c=-a,l=i,u=Bo.armM/C,m=Bo.widthM/C,f=s/2+Bo.insideM/C,h=n?-1:1,d=o+i*(f+(n?0:u)),p=r+a*(f+(n?0:u)),b=(x,y)=>({x:d+i*x*h+c*y,y:p+a*x*h+l*y});return[b(0,0),b(-u,u),b(-u-m,u),b(-m,0),b(-u-m,-u),b(-u,-u)]}function bg(e,t,n,o,r){let i=[.94,.95,.96];ie(e,pg(t,o,r),void 0,()=>n+Bo.high,n+Bo.low,i,i,oe)}function Xr(e,t){let n=ve(e);return n?{top:re(It(n,.12),.95),wall:re(It(n,.12),.85)}:{top:t.tierTop,wall:t.tierWall}}function bm(e,t,n,o,r,i,a,s,c=[]){let l=Me(t),u=Jl(t);if(!t.role&&(!t.fill||t.fill==="none"||t.fill==="transparent")||!l){No(e,t,n+o+rg);return}let f=s?s.kind==="stage":t.role==="stage",h=s?s.kind==="screen":t.role==="screen",d=s?{kind:f?"stage":"solid",heightM:s.topY-s.baseY}:St(t),p=s?.baseY??n,b=s?.topY??n+o,x=null;if(f&&a){let I=1/0,R=-1/0,_=1/0,F=-1/0;for(let N of l)N.x<I&&(I=N.x),N.x>R&&(R=N.x),N.y<_&&(_=N.y),N.y>F&&(F=N.y);x={cx:(I+R)/2*C,cz:(_+F)/2*C,y:b,halfX:Math.max((R-I)/2*C,.5),halfZ:Math.max((F-_)/2*C,.5)},a.push(x)}let y=ve(t.fill),M=t.role==="wall"||t.role==="entrance"||t.role==="exit",A=M?Xr(t.fill,r).top:f&&y?Se(r.stageTop,re(It(y,.18),.9),.9):!t.role&&y?y:xn(y,f?r.stageTop:r.decorTop),w=h?y:null,g=M?Xr(t.fill,r).wall:f?y?Se(r.stageWall,re(y,.58),.82):r.stageWall:h?w?Se(re(w,1.42),[.24,.46,.82],.08):[.24,.46,.82]:xn(ve(t.fill),r.decorWall),S=f&&Vt(r)?hn(!0):null,v=S?fm(A,S.stageTop):A,P=S?fm(g,S.stageWall):g;if(x&&(x.top=v),t.role==="wall"&&!s){Hr(e,l,p,b,c,v,P,i),No(e,t,b+.012);return}if(h&&l.length===4&&b-p>.2){let I=La(l,p,b);if(!I)return;let{quad:R,side:_,trim:F,inner:N,panel:O}=I,V=[.12,.15,.18];for(let[z,G]of[[0,_],[1-_,1]])we(e,nt(R,z,G),b,p,V,V);we(e,N,p+F,p,V,V),we(e,N,b,b-F,V,V),we(e,O,b-F,p+F,P,P),No(e,t,b+.012);return}let E=y?re(It(y,.15),.82):P,k=y?re(It(y,.1),1.02):v;if(am(t.role)&&!s&&sm(e,t.role,l,p,b,E,k,i,t.heightM!==void 0))return;if((t.role==="sound"||s?.kind==="sound_desk")&&l.length===4&&b-p>.3){let I=ft(l),R=Math.hypot(I[1].x-I[0].x,I[1].y-I[0].y)*C,_=Math.min(.12,.09/Math.max(R,.001)),F=[.18,.21,.24],N=b-Math.min(.12,(b-p)*.15);for(let[O,V]of[[0,_],[1-_,1]])we(e,nt(I,O,V),N,p,F,F);we(e,I,b,N,v,F);return}if(t.role==="rail"&&l.length===4&&b>p){let I=ft(l),R=Math.hypot(I[1].x-I[0].x,I[1].y-I[0].y)*C,_=Math.max(1,Math.min(128,Math.ceil(R/1.4))),F=Math.min(.08,.055/Math.max(.055,R)),N=[.58,.64,.66];for(let O=0;O<=_;O++){let V=O/_,z=Math.min(1-F,Math.max(0,V-F/2));we(e,nt(I,z,z+F),b,p,N,re(N,.8))}for(let O of[.52,1]){let V=p+(b-p)*O;we(e,I,V,Math.max(p,V-.055),N,re(N,.8))}return}if(t.role==="goal"&&l.length===4){yu(e,ft(l),i,p,b),e.setMaterial(0);return}if(d.kind==="portal"&&l.length===4){let I=eo(l,p,b);if(!I)return;let{quad:R,side:_,face:F,openingTop:N}=I;for(let[O,V,z]of[[0,F,1],[F,1-F,.67],[1-F,1,1]]){let G=Eo(R,O,V),T=re(v,z),D=re(P,z);for(let[W,H]of[[0,_],[1-_,1]])we(e,nt(G,W,H),N,p,T,D);we(e,G,b,N,T,D)}(t.role==="entrance"||t.role==="exit")&&bg(e,R,p,i,t.role==="exit");return}if(d.kind==="suite"&&l.length===4){let I=l.map((F,N)=>{let O=l[(N+1)%4],V=(F.x+O.x)/2,z=(F.y+O.y)/2;return Math.hypot(V-i.x,z-i.y)}),R=I.indexOf(Math.min(...I)),_=[0,1,2,3].map(F=>l[(R+F)%4]);we(e,nt(_,0,.08),b,p,v,P),we(e,nt(_,.92,1),b,p,v,P),we(e,Eo(_,.88,1),b,p,v,P),we(e,_,b,Math.max(p,b-.18),v,P);return}if(f&&!t.stageKind?.startsWith("pitch-")&&b-p>.12){let I=b-Math.min(.06,(b-p)*.15);we(e,l,I,p,v,P,u),we(e,l,b,I,v,Se(v,P,.2),u)}else we(e,l,b,p,v,P,u);if((t.stageKind==="pitch-football"||t.stageKind==="pitch-rugby")&&l.length===4){e.setMaterial(4);let I=ft(l),R=Se(y??Wr,Wr,y?.45:0);for(let _=0;_<12;_++){let F=nt(I,_/12,(_+1)/12),N=re(R,_%2?1.09:.91),O=F.map(V=>[V.x*C,b+.006,V.y*C]);e.tri(O[0],O[1],O[2],[0,1,0],N),e.tri(O[0],O[2],O[3],[0,1,0],N)}}t.stageKind&&t.stageKind!=="pitch-football"&&Ru(e,l,t.stageKind,b,y,t),f&&vt(t.stageKind)&&Au(e,t,b),e.setMaterial(h?1:0),No(e,t,b+.012)}function $r(e){let{x:t,y:n,width:o,height:r}=e;if(!o||!r)return null;let i=t+o/2,a=n+r/2,s=(e.rotation??0)*Math.PI/180,c=Math.cos(s),l=Math.sin(s),u=o/2,m=r/2;return[[-u,-m],[u,-m],[u,m],[-u,m]].map(([f,h])=>({x:i+f*c-h*l,y:a+f*l+h*c}))}function yg(e){if(!e||!e.startsWith("data:image/svg+xml"))return null;let t=e.slice(e.indexOf(",")+1);if(/;base64/i.test(e.slice(0,e.indexOf(","))))try{t=atob(t)}catch{return null}else try{t=decodeURIComponent(t)}catch{}let n=t.match(/<(?:rect|path)\b[^>]*\bfill="([^"]+)"/i);if(!n)return null;let o=n[1].trim();if(o==="none"||o==="transparent")return null;let r=o.match(/^url\(#([^)]+)\)$/);if(!r)return ve(o);let i=t.match(new RegExp(`<(?:linear|radial)Gradient\\b[^>]*\\bid="${r[1]}"[^>]*>([\\s\\S]*?)</(?:linear|radial)Gradient>`,"i"));if(!i)return null;let a=[];for(let s of i[1].matchAll(/stop-color="([^"]+)"/gi)){let c=ve(s[1].trim());c&&a.push(c)}return a.length?a.reduce((s,c,l)=>Se(s,c,1/(l+1)),a[0]):null}function ym(e,t,n,o){if(t.layer==="foreground")return;let r=$r(t);if(!r)return;let i=n+sg,a=xn(yg(t.href),o.decorTop),s=Math.max(0,Math.min(1,t.opacity??1));s<1&&(a=Se(o.ground,a,s)),ie(e,r,void 0,()=>i,n,a,Se(a,o.decorWall,.5),oe)}function gm(e,t,n,o,r){if(!t.points||t.points.length<3)return;let i=Ll(o,r.gaTop);ie(e,t.points,t.holes,()=>n+um,n,i,r.gaWall,oe),Mg(e,t.points,n+um)}var um=.15,jr=[.72,.74,.76],Fa=1.1,mm=.12,Da=.05,gg=.06,xg=2.4;function Mg(e,t,n){let o=Ct([...t]),r=bt(o,mm/C),i=bt(o,(mm+Da)/C);if(r.length<3||i.length<3)return;for(let s of[n+Fa,n+Fa*.5])ie(e,r,[i.slice().reverse()],()=>s,s-Da,jr,re(jr,.85),oe);let a=gg/2/C;for(let s=0;s<r.length;s++){let c=r[s],l=r[(s+1)%r.length],u=Math.hypot(l.x-c.x,l.y-c.y)*C,m=Math.max(1,Math.round(u/xg));for(let f=0;f<m;f++){let h=f/m,d=c.x+(l.x-c.x)*h,p=c.y+(l.y-c.y)*h,b=[{x:d-a,y:p-a},{x:d+a,y:p-a},{x:d+a,y:p+a},{x:d-a,y:p+a}];ie(e,b,void 0,()=>n+Fa-Da,n,jr,re(jr,.8),oe)}}}function fm(e,t){return sr(e)<t?fn(e,t):e}var Na=.6,xm=3,vg=.25;function Sg(e,t){if(Ze(t,e.x,e.y))return 0;let n=1/0;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[r],a=t[o],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c||1,u=Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/l));n=Math.min(n,Math.hypot(e.x-(i.x+u*s),e.y-(i.y+u*c)))}return n}function Mm(e,t){let n=e.map(a=>({booth:a,ring:At(a)})).filter(a=>!!a.ring&&a.ring.length===4&&!a.booth.points),o=n.map(({ring:a})=>({minX:Math.min(...a.map(s=>s.x)),maxX:Math.max(...a.map(s=>s.x)),minY:Math.min(...a.map(s=>s.y)),maxY:Math.max(...a.map(s=>s.y))})),r=(xm+Na)/C,i=new Map;return n.forEach(({booth:a,ring:s},c)=>{let l={x:s.reduce((h,d)=>h+d.x,0)/4,y:s.reduce((h,d)=>h+d.y,0)/4},u=[0,1,2,3].map(h=>{let d=s[h],p=s[(h+1)%4],b={x:(d.x+p.x)/2,y:(d.y+p.y)/2},x=b.x-l.x,y=b.y-l.y,M=Math.hypot(x,y)||1,A={x:b.x+x/M*Na/C,y:b.y+y/M*Na/C},w=xm/C;return o.forEach((g,S)=>{S===c||A.x<g.minX-r||A.x>g.maxX+r||A.y<g.minY-r||A.y>g.maxY+r||(w=Math.min(w,Sg(A,n[S].ring)))}),{open:w*C,toward:{x:b.x+x/M*10/C,y:b.y+y/M*10/C},focal:Math.hypot(b.x-t.x,b.y-t.y)}}),m=Math.max(...u.map(h=>h.open)),f=u.filter(h=>h.open>=m-vg).sort((h,d)=>h.focal-d.focal)[0];i.set(a.id,f.toward)}),i}var vm=Et(require("polygon-clipping"),1);var wg=.45,Pg=1500,Ag=200;function Sm(e,t){if(e.role!=="stage"||vt(e.stageKind))return e;let n=Me(e);if(!n||n.length<3||Math.abs(mt(n))*C*C>Pg)return e;let o=t.filter(a=>Ze(n,a.x,a.y));if(!o.length||o.length>Ag)return e;let r=wg/C,i=o.map(a=>[[[a.x-r,a.y-r],[a.x+r,a.y-r],[a.x+r,a.y+r],[a.x-r,a.y+r],[a.x-r,a.y-r]]]);try{let a=vm.default.difference([[...n.map(l=>[l.x,l.y]),[n[0].x,n[0].y]]],...i),s=null,c=0;for(let l of a){let u=l[0].slice(0,-1).map(([f,h])=>({x:f,y:h})),m=Math.abs(mt(u));m>c&&(c=m,s=u)}return!s||s.length<3?e:{...e,kind:"polygon",points:s,rotation:0}}catch{return e}}var Rg=Math.PI/180,Ie=96,Eg=6,Ig=60,_g=150,wm=.2,Cg=.35;function Tg(e,t){let n=Math.atan2(t.x-e.x,t.y-e.y)/Rg;return n<0?n+360:n}function Zr(e){if(!e.length)return NaN;let t=[...e].sort((n,o)=>n-o);return t[Math.floor(t.length/2)]}function qr(e,t,n=2){let o=e.length,r=new Float64Array(o);for(let i=0;i<o;i++){let a=0,s=0;for(let c=-n;c<=n;c++){let l=i+c;if(t)l=(l%o+o)%o;else if(l<0||l>=o)continue;a+=e[l],s++}r[i]=a/s}return r}function Pm(e,t){let n=e.filter(f=>f.rows.length>=1);if(n.length<1)return null;let o=[],r=0,i=0,a=0;for(let f of n)for(let h of f.rows){for(let d of h.pts)r+=d.x,i+=d.y,a++;if(h.pts.length>=4){let d=sa(h.pts);d&&Number.isFinite(d.cx)&&Number.isFinite(d.cy)&&o.push({x:d.cx,y:d.cy})}}if(!a)return null;let s={x:r/a,y:i/a},c=s;if(o.length>=8){let f=Zr(o.map(x=>x.x)),h=Zr(o.map(x=>x.y)),d=0;for(let x of n)for(let y of x.rows)for(let M of y.pts){let A=Math.hypot(M.x-s.x,M.y-s.y);A>d&&(d=A)}let p=0,b=d*.2;for(let x of n)for(let y of x.rows)for(let M of y.pts)Math.hypot(M.x-f,M.y-h)<b&&p++;Math.hypot(f-s.x,h-s.y)<=d&&p/a<.01&&(c={x:f,y:h})}let l=[];for(let f of n){let h={sectionId:f.sectionId,rMin:1/0,rMax:-1/0,samples:[]};for(let d of f.rows)for(let p of d.pts){let b=Math.hypot(p.x-c.x,p.y-c.y),x=Math.min(Ie-1,Math.floor(Tg(c,p)/(360/Ie)));h.samples.push({r:b,bin:x,levelM:d.levelM}),b<h.rMin&&(h.rMin=b),b>h.rMax&&(h.rMax=b)}h.samples.length&&l.push(h)}if(!l.length)return null;l.sort((f,h)=>f.rMin+f.rMax-(h.rMin+h.rMax));let u=[];for(let f of l){let h=!1;for(let d of u){let p=Math.min(f.rMax,d.rMax)-Math.max(f.rMin,d.rMin),b=Math.min(f.rMax-f.rMin,d.rMax-d.rMin);if(b>1e-9&&p>=Cg*b){d.members.push(f),d.rMin=Math.min(d.rMin,f.rMin),d.rMax=Math.max(d.rMax,f.rMax),h=!0;break}}h||u.push({members:[f],rMin:f.rMin,rMax:f.rMax})}let m=[];for(let f of u){let h=new Array(Ie).fill(null);for(let I of f.members)for(let R of I.samples){let _=h[R.bin];_||(_={samples:[]},h[R.bin]=_),_.samples.push({r:R.r,levelM:R.levelM})}let d=h.map(I=>!!I);if(!d.filter(Boolean).length)continue;let b=[],x=[];for(let I of h){if(!I)continue;let R=1/0,_=-1/0;for(let F of I.samples)F.r<R&&(R=F.r),F.r>_&&(_=F.r);b.push(R),x.push(_)}let y=Zr(b),M=Zr(x);if(!(y>=wm*M)||!(M>0))continue;let A=[...b].sort((I,R)=>I-R);if(!(A[Math.floor(A.length*.1)]>=wm*M))continue;let g=h.map(I=>{if(!I)return null;let R=[...I.samples].sort((T,D)=>T.r-D.r),_=R[0].r,F=R[R.length-1].r,N=R[0].levelM,O=-1/0;for(let T of R)T.levelM>O&&(O=T.levelM);let V=[];for(let T of R){let D={r:T.r,l:T.levelM};for(;V.length&&Math.abs(V[V.length-1].r-D.r)<1e-9;){if(V[V.length-1].l<=D.l){D.skip=!0;break}V.pop()}if(!D.skip){for(;V.length>=2;){let W=V[V.length-2],H=V[V.length-1];if((H.r-W.r)*(D.l-W.l)-(H.l-W.l)*(D.r-W.r)<=0)V.pop();else break}V.push(D)}}let z=V.map(T=>T.r),G=V.map(T=>T.l);return{inner:_,outer:F,front:N,top:O,profile:{rs:z,ls:G}}}),S=d.slice();for(let I=0;I<Ie;I++){if(S[I])continue;let R=-1,_=-1,F=0;for(let j=1;j<=Ie;j++){let Z=(I-j+Ie*2)%Ie;if(S[Z]){R=Z;break}}for(let j=1;j<=Ie;j++){let Z=(I+j)%Ie;if(S[Z]){_=Z,F=j;break}}if(R<0||_<0)continue;let N=0;for(let j=1;j<=Ie;j++){let Z=(I-j+Ie*2)%Ie;if(d[Z]){N=j;break}}if(N-1+F>Eg)continue;let V=g[R],z=g[_],G=N/(N+F),T=V.inner+(z.inner-V.inner)*G,D=V.outer+(z.outer-V.outer)*G,W=V.front+(z.front-V.front)*G,H=V.top+(z.top-V.top)*G;g[I]={inner:T,outer:D,front:W,top:H,profile:{rs:[T,D],ls:[W,H]}}}for(let I=0;I<Ie;I++)g[I]&&(S[I]=!0);let v=360/Ie,P=[],E=S.filter(Boolean).length,k=[];if(E===Ie)k.push({start:0,len:Ie});else{let I=0;for(;S[I];)I=(I+1)%Ie;let R=-1;for(let _=0;_<=Ie;_++){let F=(I+_)%Ie,N=_<Ie&&S[F];if(N&&R<0)R=F;else if(!N&&R>=0){let O=(F-R+Ie)%Ie||Ie;k.push({start:R,len:O}),R=-1}}}for(let I of k){if(I.len*v<Ig&&I.len<Ie)continue;let R=I.len===Ie,_=new Float64Array(I.len),F=new Float64Array(I.len),N=new Float64Array(I.len),O=new Float64Array(I.len),V=[];for(let j=0;j<I.len;j++){let Z=g[(I.start+j)%Ie];_[j]=Z.inner,F[j]=Z.outer,N[j]=Z.front,O[j]=Z.top,V.push(Z.profile??{rs:[Z.inner,Z.outer],ls:[Z.front,Z.top]})}let z=qr(_,R),G=qr(F,R),T=qr(N,R),D=qr(O,R);for(let j=0;j<I.len;j++)z[j]>_[j]&&(z[j]=_[j]),G[j]<F[j]&&(G[j]=F[j]),z[j]>G[j]-1e-6&&(z[j]=Math.max(0,G[j]-1e-6)),D[j]<T[j]&&(D[j]=T[j]);let W={startBin:I.start,binCount:I.len,closed:R,innerR:z,outerR:G,frontLevelM:T,topLevelM:D,profiles:V},H=(j,Z,X)=>{let ee=V[j],ne=ee.rs,ue=ee.ls;if(Z<=ne[0]){ue[0]>X&&(ue[0]=X);return}if(Z>=ne[ne.length-1]){ue[ue.length-1]>X&&(ue[ue.length-1]=X);return}for(let de=0;de+1<ne.length;de++)if(Z<=ne[de+1]){ue[de]>X&&(ue[de]=X),ue[de+1]>X&&(ue[de+1]=X);return}};for(let j=0;j<I.len;j++){let Z=h[(I.start+j)%Ie];if(Z)for(let X of Z.samples){H(j,X.r,X.levelM);let ee=R?(j-1+I.len)%I.len:j-1,ne=R?(j+1)%I.len:j+1;ee>=0&&H(ee,X.r,X.levelM),ne<I.len&&H(ne,X.r,X.levelM)}}P.push(W)}P.reduce((I,R)=>I+R.binCount*v,0)<_g||m.push({arcs:P,sectionIds:f.members.map(I=>I.sectionId),innerRMedian:y,outerRMedian:M})}if(!m.length)return null;if(m.sort((f,h)=>f.innerRMedian-h.innerRMedian),t){let f=m[m.length-1].outerRMedian;if(Math.hypot(t.x-c.x,t.y-c.y)>.9*f)return null}return{centre:c,binCount:Ie,binStepDeg:360/Ie,rings:m}}function Am(e,t,n,o){let r=e.binStepDeg,i=n/r-.5-t.startBin;i=(i%e.binCount+e.binCount)%e.binCount,i>t.binCount-1&&(t.closed?i=i-t.binCount<t.binCount-i?0:t.binCount-1:i=i-(t.binCount-1)<e.binCount-i?t.binCount-1:0);let a=Math.floor(i),s=t.closed?(a+1)%t.binCount:Math.min(t.binCount-1,a+1),c=i-a,l=u=>{let m=t.profiles[u],f=m.rs,h=m.ls;if(o<=f[0])return h[0];if(o>=f[f.length-1])return h[h.length-1];for(let d=0;d+1<f.length;d++)if(o<=f[d+1]){let p=f[d+1]-f[d],b=p>1e-9?(o-f[d])/p:0;return h[d]+(h[d+1]-h[d])*b}return h[h.length-1]};return l(a)*(1-c)+l(s)*c}function Ba(e,t,n,o,r,i,a,s,c,l=[],u=r){if(t.length!==n.length||t.length<2||i-r<1.5)return;let m=(p,b,x)=>{jt(e,p,b,x,l,a,s,{portalBase:u,ao:c})||ie(e,p,void 0,()=>x,b,a,s,c)},f=(p,b,x)=>({x:p.x+(b.x-p.x)*x,y:p.y+(b.y-p.y)*x}),h=o?t.length:t.length-1,d=0;for(let p=0;p<h;p++){let b=(p+1)%t.length,x=Math.hypot(n[b].x-n[p].x,n[b].y-n[p].y)*he;if(x<1e-5)continue;let y=(g,S)=>[f(t[p],t[b],g),f(t[p],t[b],S),f(n[p],n[b],S),f(n[p],n[b],g)];m(y(0,1),r,r+.95),m(y(0,1),i-.22,i);let M=Math.ceil((d-.32)/6)*6,A=!1,w=!1;for(let g=M;g<d+x;g+=6){let S=Math.max(0,(g-d)/x),v=Math.min(1,(g+.32-d)/x);v<=S||(m(y(S,v),r+.95,i-.22),A||=S<1e-6,w||=v>1-1e-6)}if(!o&&(p===0&&!A||p===h-1&&!w)){let g=Math.min(1,.32/x);m(y(p===0?0:1-g,p===0?g:1),r+.95,i-.22)}d+=x}}var tn=Et(require("polygon-clipping"),1),Go=.65;function Va(e,t){let n=1/0;for(let o of t)for(let r=0;r<o.length;r++){let i=o[r],a=o[(r+1)%o.length],s=a.x-i.x,c=a.y-i.y,l=Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/(s*s+c*c||1)));n=Math.min(n,Math.hypot(e.x-i.x-l*s,e.y-i.y-l*c))}return n}var Ga=.01;function Rm(e,t,n,o,r,i,a,s=[],c=!0,l={bays:[],walls:[]}){if(o-r<=1e-5)return;let u=o-r>=3,m=u?o-Go:r;e.setMaterial(5);let f=u?[]:s.filter(g=>{if(g.role!=="entrance"&&g.role!=="exit")return!1;let S=Me(g);if(!S)return!1;let v=eo(S,r,r+St(g).heightM);return v!==null&&v.openingTop<=o-.12});if((!f.length||!jt(e,t,m,o,f,i,a,{holes:n,portalBase:r}))&&ie(e,t,n,()=>o,m,i,a,oe,void 0,()=>[0,1,0]),!u){e.setMaterial(0);return}let h=c&&l.bays.length?Lg(t,n,bt(t,Vo/C),l):null,d=6/C,p=.22/C,b=s.flatMap(g=>{if(g.role!=="entrance"&&g.role!=="exit")return[];let S=Me(g);return S?.length?[{minX:Math.min(...S.map(v=>v.x)),maxX:Math.max(...S.map(v=>v.x)),minY:Math.min(...S.map(v=>v.y)),maxY:Math.max(...S.map(v=>v.y))}]:[]}),x=Math.min(...t.map(g=>g.x)),y=Math.max(...t.map(g=>g.x)),M=Math.min(...t.map(g=>g.y)),A=Math.max(...t.map(g=>g.y));for(let g=x+d/2;g<y;g+=d)for(let S=M+d/2;S<A;S+=d){if(b.some(P=>g+p>=P.minX&&g-p<=P.maxX&&S+p>=P.minY&&S-p<=P.maxY))continue;let v=[{x:g-p,y:S-p},{x:g+p,y:S-p},{x:g+p,y:S+p},{x:g-p,y:S+p}];!Ke({x:g,y:S},t,n)||Va({x:g,y:S},[t,...n??[]])<p*Math.SQRT2+(c?Vo/C:0)||h&&Va({x:g,y:S},h.flat())<p*Math.SQRT2+Vo/C||ie(e,v,void 0,()=>m,r,i,a,oe)}if(h){for(let[g,...S]of h)ie(e,g,S,()=>m,r-Ga,i,a,oe);e.setMaterial(0);return}let w=bt(t,Vo/C);if(c&&w.length>=3){let g=s.filter(P=>{if(P.role!=="entrance"&&P.role!=="exit")return!1;let E=Me(P);return!!E&&E.some(k=>!Ke(k,t,void 0)||Va(k,[t])<=Vo/C)}),S=[w.slice().reverse()],v=r-Ga;(!g.length||!jt(e,t,v,m,g,i,a,{holes:S,portalBase:r+Ga}))&&ie(e,t,S,()=>m,v,i,a,oe)}e.setMaterial(0)}var Ha=.25,Vo=Ha;function Lg(e,t,n,o){if(n.length<3)return null;let r=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s},i=a=>{let[s,...c]=a.map(l=>[r(l)]);return tn.default.union(s,...c)};try{let a=[r(e),...(t??[]).map(r)],s=tn.default.difference(a,[r(n)]),c=tn.default.intersection(a,i(o.bays));if(!c.length)return null;let l=tn.default.difference(tn.default.intersection(a,i(o.walls)),c);return tn.default.union(tn.default.difference(s,c),l).map(m=>m.map(f=>f.slice(0,-1).map(([h,d])=>({x:h,y:d}))))}catch{return null}}var kg=.02,Og=.25,Fg=1.2,Dg=.6,Ng=.45,Bg=2.3,Vg=Math.PI/180,Em=.005;function kt(e,t,n){let o=n*Vg;return{x:e.x+t*Math.sin(o),y:e.y+t*Math.cos(o)}}function Gg(e,t){let n=t.rings[t.rings.length-1];if(!n)return!1;let o=n.outerRMedian*.85;for(let r of e){if(r.role!=="wall")continue;let i=r.points&&r.points.length>=2?r.points:r.x!==void 0&&r.y!==void 0&&r.width!==void 0&&r.height!==void 0?[{x:r.x,y:r.y},{x:r.x+r.width,y:r.y},{x:r.x+r.width,y:r.y+r.height},{x:r.x,y:r.y+r.height}]:[];if(i.length<2)continue;let a=0;for(let s of i)Math.hypot(s.x-t.centre.x,s.y-t.centre.y)>=o&&a++;if(a>=i.length/2)return!0}return!1}var Hg=24,zg=.01;function Ug(e,t,n,o,r,i,a,s,c){let l=n.binCount,u=Hg,m=he,f=i+.02,h=i-zg,d=[];for(let R=0;R<l;R++){let _=(n.startBin+R+.5)*t.binStepDeg,F=new Float64Array(u+1);for(let N=0;N<=u;N++){let O=o[R]+(r[R]-o[R])*N/u;F[N]=Math.max(f,Am(t,n,_,O)-Og)}d.push(F)}if(c){let R=0;for(let _=0;_+1<l;_++)for(let F=0;F<u;F++){let N=kt(t.centre,o[_]+(r[_]-o[_])*F/u,(n.startBin+_+.5)*t.binStepDeg),O=kt(t.centre,o[_+1]+(r[_+1]-o[_+1])*(F+1)/u,(n.startBin+_+1.5)*t.binStepDeg);R=Math.max(R,Math.hypot(O.x-N.x,O.y-N.y))}for(let _=0;_<l;_++){let F=(n.startBin+_+.5)*t.binStepDeg;for(let N=0;N<=u;N++){let O=kt(t.centre,o[_]+(r[_]-o[_])*N/u,F),V=c(O.x,O.y,R*1.01);V!==null&&(d[_][N]=Math.min(d[_][N],Math.max(h+Em,V-Em)))}}}let p=[a.bandTop[0]*s.top,a.bandTop[1]*s.top,a.bandTop[2]*s.top],b=[a.bandTop[0]*s.bottomCap,a.bandTop[1]*s.bottomCap,a.bandTop[2]*s.bottomCap],x=[a.bandWall[0]*s.top,a.bandWall[1]*s.top,a.bandWall[2]*s.top],y=[a.bandWall[0]*s.wallBottom,a.bandWall[1]*s.wallBottom,a.bandWall[2]*s.wallBottom],M=(R,_)=>{let F=(n.startBin+R+.5)*t.binStepDeg,N=o[R]+(r[R]-o[R])*_/u,O=kt(t.centre,N,F);return[O.x*m,d[R][_],O.y*m]};{let R=Math.tan(12*Math.PI/180);for(let _=0;_<6;_++){let F=!1;for(let O=0;O<l;O++)for(let V=u-1;V>=0;V--)d[O][V]>d[O][V+1]&&(d[O][V]=d[O][V+1],F=!0);let N=n.closed?l:l-1;for(let O=0;O<N;O++){let V=(O+1)%l;for(let z=0;z<=u;z++){let G=d[V][z]-d[O][z];if(Math.abs(G)>1)continue;let T=o[O]+(r[O]-o[O])*z/u,D=o[V]+(r[V]-o[V])*z/u,W=kt(t.centre,T,(n.startBin+O+.5)*t.binStepDeg),H=kt(t.centre,D,(n.startBin+V+.5)*t.binStepDeg),j=R*Math.hypot(H.x-W.x,H.y-W.y)*m;G>j?(d[V][z]=d[O][z]+j,F=!0):-G>j&&(d[O][z]=d[V][z]+j,F=!0)}}if(!F)break}}let A=1,w=(R,_)=>{for(let F=0;F<=u;F+=4)if(Math.abs(d[R][F]-d[_][F])>A)return!0;return Math.abs(d[R][u]-d[_][u])>A},g=Math.tan(38*Math.PI/180),S=R=>(r[R]-o[R])/u*m,v=(R,_)=>d[R][_+1]-d[R][_]>g*Math.max(1e-6,S(R)),P=(R,_)=>{let F=n.closed?(R-1+l)%l:Math.max(0,R-1),N=n.closed?(R+1)%l:Math.min(l-1,R+1);Math.abs(d[F][_]-d[R][_])>A&&(F=R),Math.abs(d[N][_]-d[R][_])>A&&(N=R);let O=Math.max(0,_-1),V=Math.min(u,_+1);O<_&&v(R,O)&&(O=_),V>_&&v(R,_)&&(V=_);let z=M(F,_),G=M(N,_),T=M(R,O),D=M(R,V),W=G[0]-z[0],H=G[1]-z[1],j=G[2]-z[2],Z=D[0]-T[0],X=D[1]-T[1],ee=D[2]-T[2],ne=H*ee-j*X,ue=j*Z-W*ee,de=W*X-H*Z,me=Math.hypot(ne,ue,de);return me>1e-12?(ne/=me,ue/=me,de/=me,ue<0&&(ne=-ne,ue=-ue,de=-de),[ne,ue,de]):[0,1,0]},E=(R,_,F=!1)=>{let N=F&&Math.min(R[1],_[1])-i>=3,O=[R[0],N?R[1]-Go:h,R[2]],V=[_[0],N?_[1]-Go:h,_[2]],z=_[0]-R[0],G=_[2]-R[2],T=Math.hypot(z,G);if(!(T>1e-12))return;let D=[G/T,0,-z/T];e.tri(R,_,V,D,x,x,y),e.tri(R,V,O,D,x,y,y)},k=.05*pt,L=R=>r[R]-o[R]<k,I=n.closed?l:l-1;for(let R=0;R<I;R++){let _=(R+1)%l;if(L(R)||L(_))continue;if(w(R,_)){let G=(n.startBin+R+1)*t.binStepDeg,T=(X,ee)=>{let ne=(o[R]+o[_])/2,ue=(r[R]+r[_])/2,de=ne+(ue-ne)*ee/u,me=kt(t.centre,de,G);return[me.x*m,d[X][ee],me.y*m]};for(let X=0;X<u;X++){let ee=M(R,X),ne=M(R,X+1),ue=T(R,X),de=T(R,X+1),me=P(R,X),pe=P(R,X+1);e.triN(ee,ue,de,me,me,pe,p),e.triN(ee,de,ne,me,pe,pe,p);let Pe=M(_,X),_e=M(_,X+1),xe=T(_,X),Ce=T(_,X+1),$=P(_,X),B=P(_,X+1);e.triN(xe,Pe,_e,$,$,B,p),e.triN(xe,_e,Ce,$,B,B,p);let Y=T(R,X),q=T(R,X+1),J=T(_,X+1),te=T(_,X),ae=q[0]-Y[0],fe=q[2]-Y[2],Ue=Math.hypot(ae,fe);if(Ue>1e-12){let se=[fe/Ue,0,-ae/Ue];e.tri(Y,q,J,se,x),e.tri(Y,J,te,se,x)}}let D=M(R,0),W=M(_,0),H=M(_,u),j=M(R,u),Z=X=>[X[0],h,X[2]];Math.min(D[1],W[1])-i<3&&(e.tri(Z(D),Z(H),Z(W),[0,-1,0],b),e.tri(Z(D),Z(j),Z(H),[0,-1,0],b)),E(D,W,!0),E(j,H,!0);continue}for(let G=0;G<u;G++){let T=P(R,G),D=P(_,G),W=P(_,G+1),H=P(R,G+1);if(v(R,G)||v(_,G)){let ne=(q,J)=>{let te=(n.startBin+q+.5)*t.binStepDeg,ae=o[q]+(r[q]-o[q])*(G+.5)/u,fe=kt(t.centre,ae,te);return[fe.x*m,J,fe.y*m]},ue=M(R,G),de=M(_,G),me=ne(R,d[R][G]),pe=ne(_,d[_][G]);e.triN(ue,de,pe,T,D,D,p),e.triN(ue,pe,me,T,D,T,p);let Pe=M(_,G+1),_e=M(R,G+1),xe=ne(R,d[R][G+1]),Ce=ne(_,d[_][G+1]);e.triN(xe,Ce,Pe,H,W,W,p),e.triN(xe,Pe,_e,H,W,H,p);let $=pe[0]-me[0],B=pe[2]-me[2],Y=Math.hypot($,B);if(Y>1e-12){let q=[-B/Y,0,$/Y];e.tri(me,pe,Ce,q,x),e.tri(me,Ce,xe,q,x)}continue}let j=M(R,G),Z=M(_,G),X=M(_,G+1),ee=M(R,G+1);e.triN(j,Z,X,T,D,W,p),e.triN(j,X,ee,T,W,H,p)}let F=M(R,0),N=M(_,0),O=M(_,u),V=M(R,u),z=G=>[G[0],h,G[2]];Math.min(F[1],N[1])-i<3&&(e.tri(z(F),z(O),z(N),[0,-1,0],b),e.tri(z(F),z(V),z(O),[0,-1,0],b)),E(F,N,!0),E(V,O,!0)}if(!n.closed)for(let R of[0,l-1])for(let _=0;_<u;_++)E(M(R,_),M(R,_+1))}function Im(e,t,n){let{bottomY:o,colors:r,ao:i}=n,a=new Float64Array(t.binCount).fill(-1/0);for(let u of t.rings)for(let m of u.arcs){let f=new Float64Array(m.binCount),h=new Float64Array(m.binCount);for(let p=0;p<m.binCount;p++){let b=(m.startBin+p)%t.binCount,x=Math.max(0,m.innerR[p]-yt);f[p]=Math.max(x,a[b]+.001),h[p]=Math.max(f[p]+.001,m.outerR[p]+yt)}let d=0;for(let p=0;p<m.binCount;p++){let b=m.topLevelM[p]-o;b>d&&(d=b)}d>=Fg&&Ug(e,t,m,f,h,o,r,i,n.standTopNear);for(let p=0;p<m.binCount;p++){let b=(m.startBin+p)%t.binCount;h[p]>a[b]&&(a[b]=h[p])}}if(n.deriveShell===!1||Gg(n.shapes,t))return;let s=t.rings[t.rings.length-1],c=Dg*pt,l=Ng*pt;for(let u of s.arcs){let m=[],f=[];for(let P=0;P<u.binCount;P++){let E=(u.startBin+P+.5)*t.binStepDeg,k=u.outerR[P]+yt+c;m.push(kt(t.centre,k,E)),f.push(kt(t.centre,k+l,E))}let h=-1/0;for(let P=0;P<u.binCount;P++)u.topLevelM[P]>h&&(h=u.topLevelM[P]);let d=h+Bg,p=u.closed?f:[...f,...m.slice().reverse()],b=u.closed?[m.slice().reverse()]:void 0,x=Se(r.shellWall,[.66,.71,.72],.62),y=(P,E,k,L,I)=>{let R=Math.abs(L-h)<1e-6?L-kg:L;jt(e,P,k,R,n.shapes,r.shellTop,I,{holes:E,portalBase:o,ao:i})||ie(e,P,E,()=>R,k,r.shellTop,I,i)},M=Math.max(1,Math.ceil((h-o)/4.5)),A=(h-o)/M,w=new Set,g=n.tierFrontLevels??t.rings.map(P=>{let E=P.arcs.flatMap(k=>Array.from(k.frontLevelM)).filter(Number.isFinite).sort((k,L)=>k-L);return E[Math.floor(E.length/2)]});for(let P of g)Number.isFinite(P)&&P-o>=3&&P<h&&w.add(Math.max(0,Math.min(M-1,Math.floor((P-o)/A))));let S=Math.min(...g.filter(P=>Number.isFinite(P)&&P-o>=3&&P<h));for(let P=0;P<M;P++)o+(P+1)*A<=S-Go&&Number.isFinite(S)&&w.add(P);for(let P=0;P<M;P++){let E=o+(h-o)*P/M,k=o+(h-o)*(P+1)/M;w.has(P)&&k-E>=3.2?(y(p,b,E,E+.45,x),Ba(e,m,f,u.closed,E+.45,k-.16,r.shellTop,x,i,n.shapes,o)):y(p,b,E,k-.16,x),y(p,b,k-.16,k,re(x,.62))}Ba(e,m,f,u.closed,h,d,r.shellTop,x,i,n.shapes,o);let v=8;for(let P=1;P<f.length;P++){if(v+=Math.hypot(f[P].x-f[P-1].x,f[P].y-f[P-1].y)*he,v<8)continue;v=0;let E=f[P],k=f[P-1],L=E.x-k.x,I=E.y-k.y,R=Math.max(1,Math.hypot(L,I)),_=L/R*.16*pt,F=I/R*.16*pt,N=Math.max(1,Math.hypot(E.x-t.centre.x,E.y-t.centre.y)),O=(E.x-t.centre.x)/N*.24*pt,V=(E.y-t.centre.y)/N*.24*pt,z=[{x:E.x-_,y:E.y-F},{x:E.x+_,y:E.y+F},{x:E.x+_+O,y:E.y+F+V},{x:E.x-_+O,y:E.y-F+V}];y(z,void 0,o,h,re(x,1.12))}}}var jg=2.5,_m=.65,Wg=2,Xg=.03;function Kg(e,t){let n=()=>{let o=t;for(;e.length>2;){let r=e[0],i=e[1],a=Math.hypot(i.x-r.x,i.y-r.y);if(a>o){e[0]={x:r.x+(i.x-r.x)/a*o,y:r.y+(i.y-r.y)/a*o};return}o-=a,e.shift()}};n(),e.reverse(),n(),e.reverse()}function ja(e,t,n){let o=new Map;for(let i of e){let a=o.get(i.blockId);(!a||i.depth<a.depth)&&o.set(i.blockId,i)}let r=[];for(let[i,a]of o){if(a.y-n<jg||a.pts.length<2)continue;let s=a.pts.map(u=>{let m=u.x-t.x,f=u.y-t.y,h=Math.max(1,Math.hypot(m,f));return{x:u.x-m/h*_m/C,y:u.y-f/h*_m/C}}),c=[],l=[s[0]];for(let u=1;u<s.length;u++){let m=s[u-1],f=s[u];Math.hypot(f.x-m.x,f.y-m.y)*C>Wg?(l.length>=2&&c.push(l),l=[f]):l.push(f)}l.length>=2&&c.push(l);for(let u of c)Kg(u,Xg/C);c.length&&r.push({blockId:i,y:a.y,runs:c})}return r}var Cm=.1,Yg=1.1,$g=.22,za=.95,Ua=.05,Tm=1.8;function Lm(e,t,n,o){let r=[.72,.72,.69],i=[.48,.55,.57];for(let a of ja(t,n,o)){let s=a.y;for(let c of a.runs){let l=Tm;for(let u=1;u<c.length;u++){let m=c[u-1],f=c[u],h=f.x-m.x,d=f.y-m.y,p=Math.hypot(h,d);if(p<1e-5)continue;let b=x=>{let y=-d/p*x/C/2,M=h/p*x/C/2;return[{x:m.x+y,y:m.y+M},{x:f.x+y,y:f.y+M},{x:f.x-y,y:f.y-M},{x:m.x-y,y:m.y-M}]};if(ie(e,b($g),void 0,()=>s+Cm,s-Yg,r,r,oe),ie(e,b(Ua),void 0,()=>s+za,s+za-Ua,i,i,oe),l+=p*C,l>=Tm||u===c.length-1){l=0;let x=.028/C,y=[{x:m.x-x,y:m.y-x},{x:m.x+x,y:m.y-x},{x:m.x+x,y:m.y+x},{x:m.x-x,y:m.y+x}];ie(e,y,void 0,()=>s+za-Ua,s+Cm,i,i,oe)}}}}}var Zg=.9,qg=1.5,Qg=.3;function km(e,t,n){let o=[],r=[],i=Zg/C,a=qg/C,s=Qg/C;for(let c of e)for(let l of c.runs){if(l.length<2)continue;let u=l.slice(),m=(b,x)=>{let y=u[b],M=u[x],A=Math.hypot(y.x-M.x,y.y-M.y)||1;u[b]={x:y.x+(y.x-M.x)/A*s,y:y.y+(y.y-M.y)/A*s}};m(0,1),m(u.length-1,u.length-2);let f=u.map((b,x)=>{let y=u[Math.max(0,x-1)],M=u[Math.min(u.length-1,x+1)],A=M.x-y.x,w=M.y-y.y,g=Math.hypot(A,w)||1,S=-w/g,v=A/g;return S*(b.x-t.x)+v*(b.y-t.y)<0&&(S=-S,v=-v),{nx:S,ny:v}}),h=u.map((b,x)=>({x:b.x-f[x].nx*a,y:b.y-f[x].ny*a})),d=u.map((b,x)=>({x:b.x+f[x].nx*i,y:b.y+f[x].ny*i})),p=u.map((b,x)=>({x:b.x+f[x].nx*(i+n/C),y:b.y+f[x].ny*(i+n/C)}));o.push([...h,...d.slice().reverse()]),r.push([...d,...p.reverse()])}return{bays:o,walls:r}}var Wa=.88,Qr=.27,Jg=1.2,e1=.01,t1=7,n1=.05,o1=.25;function Om(e,t,n,o,r){let i=[.67,.71,.68],a=[i[0]*Wa,i[1]*Wa,i[2]*Wa],s=c=>!!r&&r.some((l,u)=>u!==c&&l?.belowY!=null&&Math.abs(l.belowY-t[c].y)<1e-6&&t[u].blockId===t[c].blockId);for(let c=0;c<t.length;c++){let l=t[c];if(!(l.pts.length<2))for(let u of[0,l.pts.length-1]){let m=l.pts[u],f=l.pts[u===0?1:u-1],h=m.x-f.x,d=m.y-f.y,p=Math.hypot(h,d);if(p<1e-5)continue;h/=p,d/=p;let b=1/0;for(let _=0;_<n.length;_++){let F=n[_],N=n[(_+1)%n.length],O=N.x-F.x,V=N.y-F.y,z=h*V-d*O;if(Math.abs(z)<1e-8)continue;let G=F.x-m.x,T=F.y-m.y,D=(G*V-T*O)/z,W=(G*d-T*h)/z;D>0&&W>=0&&W<=1&&(b=Math.min(b,D))}let x=.3/C,y=b-.04/C;if(!Number.isFinite(b)||b*C>2||y-x<.12/C)continue;let M=!!o&&s(c),A=r?.[c]?.pitch,w=M&&A&&Number.isFinite(A)?Math.min(Jg/C,Math.max(Qr/C,A-Qr/C-e1/C)):Qr/C,g=-d,S=h;o&&g*(o.x-m.x)+S*(o.y-m.y)<0&&(g=-g,S=-S);let v=Qr/C,P=[{x:m.x+h*x+g*v,y:m.y+d*x+S*v},{x:m.x+h*y+g*v,y:m.y+d*y+S*v},{x:m.x+h*y-g*w,y:m.y+d*y-S*w},{x:m.x+h*x-g*w,y:m.y+d*x-S*w}];if(!P.every(_=>Ze(n,_.x,_.y)))continue;let E=r?.[c]?.belowY,k=E==null?0:l.y-E,L=!!o&&k>.03&&k<=.65;if(L&&o){let _=(F,N)=>Math.hypot((F.x+N.x)/2-o.x,(F.y+N.y)/2-o.y);_(P[0],P[1])>_(P[3],P[2])&&(P=[P[3],P[2],P[1],P[0]])}let I=L?Math.ceil((k-1e-8)/.2):1,R=(_,F,N)=>({x:_.x+(F.x-_.x)*N,y:_.y+(F.y-_.y)*N});for(let _=0;_<I;_++){let F=_/I,N=(_+1)/I,O=[R(P[0],P[3],F),R(P[1],P[2],F),R(P[1],P[2],N),R(P[0],P[3],N)],V=l.y+.008-(L?k*(1-N):0);if(ie(e,O,void 0,()=>V,V-(L?k/I+.1:.16),i,a,oe),!L)continue;let z=Math.hypot(O[3].x-O[0].x,O[3].y-O[0].y)*C;if(z<1e-4)continue;let G=Math.min(n1/z,o1),T=R(O[0],O[3],G),D=R(O[1],O[2],G),W=j=>[j.x*C,V+.004,j.y*C],H=[.8,.67,.3];e.setMaterial(t1),e.tri(W(O[0]),W(O[1]),W(D),[0,1,0],H),e.tri(W(O[0]),W(D),W(T),[0,1,0],H),e.setMaterial(0)}}}}var r1=.02,i1=.012,a1=.01,s1=.3,c1=.5;function l1(e,t,n){if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>1e-12?((t-i.x)*s+(n-i.y)*c)/l:0;u=Math.max(0,Math.min(1,u)),o=Math.min(o,Math.hypot(t-(i.x+u*s),n-(i.y+u*c)))}return o}function u1(e,t,n,o){let r=1/0,i=Number.NaN;for(let a=0;a<e.length;a++){let s=t[a];if(Math.hypot(n-s.cx,o-s.cy)-s.rad>=r)continue;let c=l1(e[a].pts,n,o);c<r&&(r=c,i=e[a].y)}return i}function Fm(e,t,n,o,r,i,a){let s=o.filter(f=>f.pts.length>0);if(s.length<2||t.length<3)return;let c=s.map(f=>{let h=0,d=0;for(let b of f.pts)h+=b.x,d+=b.y;h/=f.pts.length,d/=f.pts.length;let p=0;for(let b of f.pts)p=Math.max(p,Math.hypot(b.x-h,b.y-d));return{cx:h,cy:d,rad:p}}),l=[...t],u=n.map(f=>[...f]),m=r1/C;for(let f of[l,...u])for(let h=0;h<f.length;h++){let d=f[h],p=f[(h+1)%f.length],b=p.x-d.x,x=p.y-d.y,y=Math.hypot(b,x);if(y*C<.05)continue;let M=(d.x+p.x)/2,A=(d.y+p.y)/2,w=x/y,g=-b/y;Ke({x:M+w*m,y:A+g*m},l,u)&&(w=-w,g=-g);let S=r.x-M,v=r.y-A,P=Math.hypot(S,v)||1;if((w*S+g*v)/P>c1)continue;let E=1/0;for(let O of[.2,.5,.8]){let V=u1(s,c,d.x+b*O-w*m*2,d.y+x*O-g*m*2);Number.isFinite(V)&&(E=Math.min(E,V))}if(!Number.isFinite(E)||E-i<s1)continue;let k=i-a1,L=E-i1,I={x:(d.x-w*m)*C,z:(d.y-g*m)*C},R={x:(p.x-w*m)*C,z:(p.y-g*m)*C},_=[w,0,g],F=re(a,oe.wallBottom),N=re(a,oe.top);e.tri([I.x,L,I.z],[R.x,L,R.z],[R.x,k,R.z],_,N,N,F),e.tri([I.x,L,I.z],[R.x,k,R.z],[I.x,k,I.z],_,N,F,F)}}function Dm(e,t,n,o,r,i,a,s,c=!1){if(!t.outline||t.outline.length<3)return;let l=n.baseHeightM,u=n.objects.filter(y=>y.type==="shape"&&(y.role==="entrance"||y.role==="exit")),m=kl(o,s.tierTop);if(!r)return;let f=y=>r.deckAt(y.x,y.y),h=Zl(t,a),d=h[0]??t.outline;if(r.rowLevels.length>=2){let y=Er(r.rowLevels),M=ql(Wl(r.rowLevels,n.focal,y),h),A=km(ja(r.rowLevels,n.focal,l),n.focal,Ha);for(let g of M){let S=Math.max(l,g.topY-Nm);for(let v of i.subtract(g.outline,S))Rm(e,v,g.holes,S,l,s.tierTop,s.tierWall,u,!c,A);e.setMaterial(5),Fm(e,g.outline,g.holes,r.rowLevels,n.focal,S,s.tierWall),e.setMaterial(0)}M.length||ie(e,d,t.holes,()=>r.landingY,l,m,s.tierWall,oe);let w={tread:[m[0]*oe.top,m[1]*oe.top,m[2]*oe.top],riser:[m[0]*.72,m[1]*.72,m[2]*.72]};for(let g of h.length?h:[d])Kl(e,r.rowLevels,n.focal,r.landingY,w,g,y);Lm(e,r.rowLevels,n.focal,l),Om(e,r.rowLevels,t.outline,n.focal,y);return}let p=r.flat?1/0:Qu,b=y=>r.normalAt(y.x,y.y),x=r.flat?r.landingY:void 0;for(let y of i.subtract(d,x))ie(e,y,t.holes,f,l,m,s.tierWall,oe,p,b)}function m1(e,t,n){let o=new Set;for(let a of e.objects)a.type==="section"&&o.add(a.id);let r=new Map;for(let a=0;a<t.length;a++){let s=n.seatOwner[a];if(!s||!o.has(s))continue;let c=n.bySection.get(s);if(c&&c.rowLevels.length>=2)continue;let l=t[a];if(l.kind==="booth")continue;let u=r.get(s);u||(u=new Map,r.set(s,u));let m=l.rowId||`__seat-${a}`,f=u.get(m);f||(f={pts:[],levelM:0,n:0},u.set(m,f)),f.pts.push({x:l.x,y:l.y}),f.levelM+=n.seatDeckY(a),f.n++}let i=[];for(let a of e.objects){if(a.type!=="section")continue;let s=n.bySection.get(a.id);if(s&&s.rowLevels.length>=2){let l=s.rowLevels.filter(u=>!u.patch).map(u=>({pts:u.pts,levelM:u.y}));l.length>=2&&i.push({sectionId:a.id,rows:l});continue}let c=r.get(a.id);c&&i.push({sectionId:a.id,rows:[...c.values()].map(l=>({pts:l.pts,levelM:l.levelM/l.n}))})}return i}function f1(e,t){let n=1/0;for(let o=0;o<t.length;o++){let r=t[o],i=t[(o+1)%t.length],a=i.x-r.x,s=i.y-r.y,c=Math.max(0,Math.min(1,((e.x-r.x)*a+(e.y-r.y)*s)/(a*a+s*s||1)));n=Math.min(n,Math.hypot(e.x-r.x-c*a,e.y-r.y-c*s))}return n}var Nm=.02;function h1(e,t){let n=e.objects.filter(o=>o.type==="section"&&!!o.outline&&o.outline.length>=3).flatMap(o=>{let r=t.bySection.get(o.id);if(!r)return[];let i=1/0,a=-1/0,s=1/0,c=-1/0;for(let u of o.outline)u.x<i&&(i=u.x),u.x>a&&(a=u.x),u.y<s&&(s=u.y),u.y>c&&(c=u.y);let l=r.landingY;for(let u of r.rowLevels)l=Math.min(l,u.y-Nm);return[{outline:o.outline,holes:o.holes,surface:r,floorTop:l,minX:i,maxX:a,minY:s,maxY:c}]});return(o,r,i)=>{let a=null;for(let s of n){if(o<s.minX-i||o>s.maxX+i||r<s.minY-i||r>s.maxY+i)continue;let c={x:o,y:r};if(!Ke(c,s.outline,s.holes)&&f1(c,s.outline)>i)continue;let l=Math.min(s.surface.deckAt(o,r),s.floorTop);(a===null||l<a)&&(a=l)}return a}}var d1=3,p1=.4;function Bm(e,t,n,o,r,i,a=!0){let s=m1(t,n,o);if(s.length<d1)return;let c=Pm(s,t.focal);if(!c)return;let l=Math.max(0,...c.rings.map(u=>u.arcs.reduce((m,f)=>m+f.binCount,0)))/c.binCount;e.setMaterial(5),Im(e,c,{bottomY:t.baseHeightM,tierFrontLevels:s.map(u=>Math.min(...u.rows.map(m=>m.levelM))),colors:{bandTop:re(r.tierTop,.8),bandWall:r.tierWall,shellTop:i??re(r.tierWall,1.15),shellWall:i??r.tierWall},ao:oe,shapes:t.objects.filter(u=>u.type==="shape"),deriveShell:a&&l>=p1,standTopNear:h1(t,o)}),e.setMaterial(0)}var Vm=4;var b1=[[/\b(wc|toilets?|restrooms?|washrooms?|lavatory|loo)\b/i,"restroom"],[/\b(bar|drinks|pub|cocktails?)\b/i,"bar"],[/\b(food|concessions?|snacks?|kiosk|caf[eé]|kitchen|catering)\b/i,"concession"],[/\b(coat ?check|cloak ?room|cloakroom|coats)\b/i,"coat"],[/\b(screen|led wall|projection|video wall)\b/i,"screen"],[/\b(sound|foh|mixing desk|control booth)\b/i,"sound"],[/\b(entrance|entry|way in|gate)\b/i,"entrance"],[/\b(exit|way out)\b/i,"exit"],[/\b(pillar|column|obstruction)\b/i,"obstruction"],[/\b(walls?|outline|boundary|perimeter)\b/i,"wall"]],y1=1.2,g1=12;function Gm(e){if(e.heightM!==void 0)return!1;let t=Me(e);if(!t||t.length<3)return!1;let n=0;for(let r=0;r<t.length;r++){let i=t[r],a=t[(r+1)%t.length];n+=Math.hypot(a.x-i.x,a.y-i.y)}return n*he<g1*2?!1:2*Ho(t)/n*he<=y1}function Xa(e){if(!e)return null;for(let[t,n]of b1)if(t.test(e))return n;return null}var zm="auto-rows-";function Um(e){return e.id.startsWith(zm)&&!e.label}var x1=1.15,M1=.09,jm=6,v1=34,S1=.35,w1=6,P1=.35,A1=.75,R1=12,E1=2.5,I1=40,_1=[18,24],C1=[12,16],Hm=14,T1=.8,L1=.6,k1=5,O1=.3,Wm=.4,Xm=2,F1=400,D1=2.6,N1=.8,B1=4,V1=26,G1=.7,H1=.5,z1=.985,U1=1.5,j1=2.2,W1=3,X1=25,K1=.985,Y1=2,$1=6,Z1=3,q1=.1,Q1=1.5,J1=1.6,ex=6e3,tx=.6,nx="#c3c7cd",Ka=300,ox=240;function rx(e,t,n,o){if(!e.fill||!/^#[0-9a-f]{6}$/i.test(e.fill))return null;let r=$a([...t]),i=new Set;for(let u of o)i.add(Math.floor(Math.atan2(u.y-r.y,u.x-r.x)*180/Math.PI/10));if(i.size*10<ox)return null;let{h:a,s,l:c}=fc(uc(e.fill));return a<70/360||a>170/360||s<.2||c<.08||c>.75||n.some(u=>u!==e&&u.type==="shape"&&Me(u)?.some(m=>Qa(m,t)))?null:e.kind==="ellipse"?"oval-cricket":e.kind==="rect"?"pitch-football":null}var ix="Estimated from the drawing; confirm with the venue.",Za=e=>{if(!e.length)return null;let t=[...e].sort((o,r)=>o-r),n=Math.floor(t.length/2);return t.length%2?t[n]:(t[n-1]+t[n])/2},$a=e=>({x:e.reduce((t,n)=>t+n.x,0)/e.length,y:e.reduce((t,n)=>t+n.y,0)/e.length}),Ho=e=>{let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=o.x*r.y-r.x*o.y}return Math.abs(t)/2};function ax(e){return e.height!==void 0||e.rake!==void 0||e.elevation!==void 0||e.surfaceKind!==void 0}function qa(e){let t=new Map;for(let n of e){let o=t.get(n.rowId);o?o.push(n):t.set(n.rowId,[n])}return t}function Qa(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],a=t[r];i.y>e.y!=a.y>e.y&&e.x<(a.x-i.x)*(e.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function Ja(e,t){let n=t[0],o=1/0;for(let r=0;r<t.length;r++){let i=t[r],a=t[(r+1)%t.length],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>0?Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/l)):0,m={x:i.x+s*u,y:i.y+c*u},f=Math.hypot(e.x-m.x,e.y-m.y);f<o&&(o=f,n=m)}return n}function Km(e,t){let n=0,o=0;for(let r of e.values()){if(r.length<3)continue;let i=r[0],a=r[r.length-1],s=a.x-i.x,c=a.y-i.y,l=Math.hypot(s,c);if(l<1e-6)continue;let u={x:(i.x+a.x)/2,y:(i.y+a.y)/2},m=Ja(u,t),f=m.x-u.x,h=m.y-u.y,d=Math.hypot(f,h);d<1e-6||(o+=Math.abs((-c*f+s*h)/(l*d))*r.length,n+=r.length)}return n?o/n:0}function sx(e,t,n){let o=e.filter(p=>p.type==="shape"),r=o.find(p=>p.role==="stage");if(r){let p=Me(r);return p?{shape:r,centre:$a(p),outline:p,inferred:!1}:null}if(!n.length)return null;let i=1/0,a=-1/0,s=1/0,c=-1/0;for(let p of n)i=Math.min(i,p.x),a=Math.max(a,p.x),s=Math.min(s,p.y),c=Math.max(c,p.y);let l=(a-i)*(c-s),u=[];for(let p of o){if(p.role)continue;let b=Me(p);if(!b)continue;let x=Ho(b);if(x*he*he<6||x>l)continue;let y=Math.min(...b.map(P=>P.x)),M=Math.max(...b.map(P=>P.x)),A=Math.min(...b.map(P=>P.y)),w=Math.max(...b.map(P=>P.y)),g=0;for(let P of n)P.x>y&&P.x<M&&P.y>A&&P.y<w&&Qa(P,b)&&g++;if(g>n.length*.05)continue;let S=$a(b),v=Km(t,b);v>=T1&&u.push({shape:p,centre:S,outline:b,score:v,area:x,box:[y,A,M,w]})}let m=(p,b)=>b!==p&&b.area>p.area&&p.box[0]>=b.box[0]-1e-6&&p.box[1]>=b.box[1]-1e-6&&p.box[2]<=b.box[2]+1e-6&&p.box[3]<=b.box[3]+1e-6,f=u.filter(p=>!u.some(b=>m(p,b))),h=Math.max(0,...f.map(p=>p.score)),d=f.filter(p=>p.score>=h-.03).sort((p,b)=>b.area-p.area)[0]??null;return d?{shape:d.shape,centre:d.centre,outline:d.outline,inferred:!0}:null}function cx(e,t,n){if(!n||n.length<3)return Math.hypot(e.x-t.x,e.y-t.y);let o=Ja(e,n);return Math.hypot(e.x-o.x,e.y-o.y)}function Ym(e){return e.length<3?[...e].sort((t,n)=>t.x-n.x||t.y-n.y):zn(e)}function lx(e){if(!e.length||e.length>ex)return[];let t=[...qa(e).values()],n=t.map((s,c)=>c),o=s=>n[s]===s?s:n[s]=o(n[s]),r=J1/he,i=t.map(s=>({minX:Math.min(...s.map(c=>c.x))-r,maxX:Math.max(...s.map(c=>c.x))+r,minY:Math.min(...s.map(c=>c.y))-r,maxY:Math.max(...s.map(c=>c.y))+r}));for(let s=0;s<t.length;s++)for(let c=s+1;c<t.length;c++){let l=i[s],u=i[c];if(l.maxX<u.minX||u.maxX<l.minX||l.maxY<u.minY||u.maxY<l.minY)continue;t[s].some(f=>t[c].some(h=>Math.hypot(f.x-h.x,f.y-h.y)<=r))&&(n[o(s)]=o(c))}let a=new Map;return t.forEach((s,c)=>{let l=o(c),u=a.get(l);u?u.push(...s):a.set(l,[...s])}),[...a.values()].filter(s=>new Set(s.map(c=>c.rowId)).size>=2)}function ux(e,t,n){if(!t.length)return null;let o=t.filter(v=>n.tableIds.has(v.rowId)||v.kind==="booth").length>t.length/2,r=qa(t),i=!n.outline||Km(r,n.outline)>=L1,a=0,s=0;for(let v of r.values()){if(v.length<2)continue;let P=v[0],E=v[v.length-1],k=E.x-P.x,L=E.y-P.y,I=Math.hypot(k,L);if(I<1e-6)continue;let R={x:(P.x+E.x)/2,y:(P.y+E.y)/2},_=i?n.outline?Ja(R,n.outline):n.focal:n.middle,F=-L/I,N=k/I;F*(_.x-R.x)+N*(_.y-R.y)<0&&(F=-F,N=-N),a+=F*v.length,s+=N*v.length}let c={x:t.reduce((v,P)=>v+P.x,0)/t.length,y:t.reduce((v,P)=>v+P.y,0)/t.length};if(Math.hypot(a,s)<1e-9){let v=i?n.focal:n.middle;a=v.x-c.x,s=v.y-c.y}let l=Math.hypot(a,s)||1,u={x:a/l,y:s/l},m=v=>-(v.x*u.x+v.y*u.y),f=v=>-v.x*u.y+v.y*u.x,h=1/0,d=-1/0,p=1/0,b=-1/0,x=1/0,y=new Map;for(let v of t){let P=m(v),E=f(v);h=Math.min(h,P),d=Math.max(d,P),p=Math.min(p,E),b=Math.max(b,E),i&&(x=Math.min(x,cx(v,n.focal,n.outline)));let k=v.logicalRowId??v.rowId,L=y.get(k);L?L.push(P):y.set(k,[P])}i||(x=Math.max(0,h-m(n.middle)));let M=[...y.values()].map(v=>Za(v)).sort((v,P)=>v-P),A=[];if(!o)for(let v of M)A.length&&v-A[A.length-1]<P1/he||A.push(v);let w=ax(e),g=$t(e,{floorBaseHeightM:n.baseHeightM}),S={id:e.id,section:e,authored:w,plane:n,facing:u,facesAction:i,hull:Ym(t),sample:t.filter((v,P)=>P%Math.ceil(t.length/F1)===0),frontD:h,backD:d,latMin:p,latMax:b,frontDistance:x,rowDepths:A,rowCount:A.length,level:0,height:g.height,rake:w?g.rake:0,backHeight:0};return S.backHeight=S.height+(d-h)*he*Math.tan(S.rake*Math.PI/180),S}function mx(e,t,n,o){if(e.length<2)return 0;let r=Math.max(1,t*he),i=n+x1-o,a=0,s=0;for(let l=1;l<e.length;l++){let u=Math.max(A1,(e[l]-e[l-1])*he),m=(i+M1)*(r+u)/r;a+=m-i,s+=u,i=m,r+=u}let c=Math.atan(a/s)*180/Math.PI;return Math.round(Math.max(jm,Math.min(v1,c))*10)/10}function fx(e,t,n=!1){if(!n&&e.facing.x*t.facing.x+e.facing.y*t.facing.y<O1)return null;let o=-1/0,r=1/0,i=-1/0;for(let f of t.hull){o=Math.max(o,-(f.x*e.facing.x+f.y*e.facing.y));let h=-f.x*e.facing.y+f.y*e.facing.x;r=Math.min(r,h),i=Math.max(i,h)}if(Math.min(e.latMax,i)-Math.max(e.latMin,r)<(n?1e-6:Wm*(e.latMax-e.latMin)))return null;let s=Xm/he,c=new Map,l=new Map;for(let f of e.sample){let h=Math.floor((-f.x*e.facing.y+f.y*e.facing.x)/s),d=-(f.x*e.facing.x+f.y*e.facing.y);c.set(h,Math.min(c.get(h)??1/0,d))}for(let f of t.sample){let h=Math.floor((-f.x*e.facing.y+f.y*e.facing.x)/s),d=-(f.x*e.facing.x+f.y*e.facing.y);l.set(h,Math.max(l.get(h)??-1/0,d))}let u=[];for(let[f,h]of c){let d=l.get(f);d!==void 0&&u.push(h-d)}let m=u.length?Za(u):e.frontD-o;return m<-1/he?null:m}function hx(e,t){if(t.plane.floorIndex>=e.plane.floorIndex)return!1;let n=-1/0,o=1/0,r=1/0,i=-1/0;for(let c of t.hull){let l=-(c.x*e.facing.x+c.y*e.facing.y);n=Math.max(n,l),o=Math.min(o,l);let u=-c.x*e.facing.y+c.y*e.facing.x;r=Math.min(r,u),i=Math.max(i,u)}let a=Math.min(e.latMax,i)-Math.max(e.latMin,r),s=Math.min(e.backD,n)-Math.max(e.frontD,o);return a>Wm*(e.latMax-e.latMin)&&s>1/he}function dx(e,t){let n=new Set;for(let o of e){let r=(Math.atan2(o.y-t.y,o.x-t.x)*180/Math.PI+360)%360;n.add(Math.floor(r/10))}return n.size/36}function px(e,t){let n=1/0,o=-1/0;for(let i of t.hull){let a=-(i.x*e.facing.x+i.y*e.facing.y);n=Math.min(n,a),o=Math.max(o,a)}let r=Math.max(0,Math.min(o-n,e.frontD-n));return t.height+r*he*Math.tan(t.rake*Math.PI/180)}function bx(e,t){if(!e.facesAction)return!1;let n={x:-e.facing.y,y:e.facing.x},o=Xm/he,r=Math.max(1,Math.ceil((e.backD-e.frontD)/o)),i={left:new Map,right:new Map};for(let s of t)if(!(s===e||s.plane.floorIndex!==e.plane.floorIndex)&&!(s.facing.x*e.facing.x+s.facing.y*e.facing.y>=z1))for(let c of s.sample){let l=-(c.x*e.facing.x+c.y*e.facing.y);if(l<e.frontD||l>e.backD)continue;let u=-c.x*e.facing.y+c.y*e.facing.x,m=u<e.latMin?"left":u>e.latMax?"right":null;if(!m)return!1;let f=Math.min(r-1,Math.floor((l-e.frontD)/o)),h=m==="left"?e.latMin-u:u-e.latMax;h<(i[m].get(f)?.gap??1/0)&&i[m].set(f,{gap:h,other:s})}let a=s=>{let c=s==="left"?e.latMin:e.latMax,l=0;for(let[u,{other:m}]of i[s]){if((m.facing.x*n.x+m.facing.y*n.y)*(s==="left"?1:-1)<G1)continue;let h=e.frontD+(u+.5)*o,d={x:-h*e.facing.x+c*n.x,y:-h*e.facing.y+c*n.y},p=-(d.x*m.facing.x+d.y*m.facing.y),b=-d.x*m.facing.y+d.y*m.facing.x;p<m.frontD&&b>=m.latMin&&b<=m.latMax&&l++}return l/r>=H1};return a("left")&&a("right")}function yx(e,t){if(t.plane.floorIndex!==e.plane.floorIndex||t.facing.x*e.facing.x+t.facing.y*e.facing.y<K1)return!1;let n=1/0,o=-1/0,r=1/0;for(let s of t.hull){let c=-s.x*e.facing.y+s.y*e.facing.x;n=Math.min(n,c),o=Math.max(o,c),r=Math.min(r,-(s.x*e.facing.x+s.y*e.facing.y))}let i=(e.frontD-r)*he;if(i<-Y1||i>$1)return!1;let a=Math.max(n-e.latMax,e.latMin-o);return a*he<=Z1&&a*he>=-q1}function gx(e,t=!1,n=!1,o){let r=t?C1:_1,i=new Set(n?[]:e.filter(p=>!p.authored&&bx(p,e))),a=[...e].sort((p,b)=>p.plane.floorIndex-b.plane.floorIndex||Number(i.has(b))-Number(i.has(p))||p.frontDistance-b.frontDistance);for(let p of i)o?.add(p.id);let s=(p,b,x)=>{let y=new Map,M=[],A=new Map,w=g=>{if(g.plane.floorIndex===0||g.plane.baseHeightM>0)return g.plane.baseHeightM;let S=A.get(g.plane.floorIndex-1);return S===void 0?g.plane.baseHeightM:S+Vm};for(let g of a){if(i.has(g))g.height=w(g),g.level=0,g.rake=0,g.backHeight=g.height,y.set(g.id,void 0);else if(!g.authored){let v=w(g),P;for(let R of M){if(R.plane.floorIndex>g.plane.floorIndex)continue;if(hx(g,R)){let O=px(g,R)+D1;O>v&&(v=O,P=R);continue}let _=fx(g,R,i.has(R));if(_==null)continue;let F=n&&!!g.plane.stageDeck&&R.level===0&&R.plane.floorIndex===g.plane.floorIndex&&Math.max(0,_)*he<=B1,N=i.has(R)?R.height+U1:F?R.backHeight:R.backHeight+S1+Math.min(w1,Math.max(0,_)*he)*Math.tan(R.rake*Math.PI/180);N>v&&(v=N,P=R)}let E=p.get(g);E&&E.height>v+.01?(v=E.height,P=void 0):E=void 0,g.height=Math.round(Math.min(v,g.plane.baseHeightM+I1)*100)/100;let k=!P&&!E&&g.height>g.plane.baseHeightM;if(g.level=P?P.level+1:E?E.level:k?1:0,g.rake=mx(g.rowDepths,g.frontDistance,g.height,g.plane.focalHeightM),!g.facesAction&&g.rowCount<k1)g.rake=0;else if(g.level===0){let R=Math.max(1e-6,(g.backD-g.frontD)*he);g.rake=Math.min(g.rake,R1,Math.round(Math.atan(E1/R)*1800/Math.PI)/10)}else g.rowCount>=2&&(g.rake=Math.max(g.rake,r[Math.min(g.level,r.length)-1]));let L=(g.backD-g.frontD)*he,I=P&&i.has(P)||E&&x?.has(E.id);if(b!==void 0&&I&&g.rowCount>=2&&(g.rake=b),t&&L>0&&g.height+L*Math.tan(g.rake*Math.PI/180)>g.plane.baseHeightM+Hm){let R=Math.max(0,g.plane.baseHeightM+Hm-g.height);g.rake=Math.max(jm,Math.round(Math.atan(R/L)*1800/Math.PI)/10)}n&&g.plane.stageDeck&&g.level>0&&(g.rake=Math.min(g.rake,V1)),g.backHeight=g.height+L*Math.tan(g.rake*Math.PI/180),y.set(g.id,P?.id??(E?y.get(E.id):void 0))}let S=g.plane.floorIndex;A.set(S,Math.min(A.get(S)??1/0,g.height)),M.push(g)}return y},c=s(new Map),l=new Map,u=p=>l.get(p)?.height??p.height;for(let p=!0,b=0;p&&b<e.length;b++){p=!1;for(let x of e)if(!(x.authored||i.has(x)))for(let y of e){let M=l.get(y)??y;y===x||M.height-M.plane.baseHeightM<Q1||M.height<=u(x)+.01||yx(x,y)&&(l.set(x,M),p=!0)}}let m=new Map(e.map(p=>[p.id,p])),f=e.filter(p=>!p.authored&&p.rowCount>=2&&i.has(m.get(c.get(p.id)??""))),h=f.length?Za(f.map(p=>p.rake)):void 0;if(!l.size&&h===void 0)return c;let d=new Map([...new Set(l.values())].map(p=>[p,{...p}]));return s(new Map([...l].map(([p,b])=>[p,d.get(b)])),h,new Set(f.map(p=>p.id)))}var Ya=(e,t)=>!!e&&e.x===t.x&&e.y===t.y;function Jr(e,t={x:0,y:-40}){let n=Gn(e),o=new Map;for(let x of n){if(!x.sectionId)continue;let y=o.get(x.sectionId);y?y.push(x):o.set(x.sectionId,[x])}let r={focalInferred:!1,confident:!1,sections:[]},i=e.floors?.length?e.floors.map((x,y)=>({objects:x.objects,floorIndex:y,floorId:x.id,baseHeightM:x.baseHeightM??0,focal:x.focalPoint??e.focalPoint})):[{objects:e.objects,floorIndex:0,floorId:void 0,baseHeightM:0,focal:e.focalPoint}],a=new Set(i.flatMap(x=>x.objects.filter(y=>y.type==="table").map(y=>y.id))),s=[],c,l=new Set,u=i.map(x=>{let y=I=>!e.floors?.length||I.floorId===x.floorId,M=lx(n.filter(I=>!I.sectionId&&I.kind!=="booth"&&!a.has(I.rowId)&&y(I))),A=[];for(let I of M){let R=Tt(Ct(Ym(I)),tx/he);if(n.some(F=>!y(F)&&Qa(F,R)))continue;let _=`${zm}${x.floorIndex}-${A.length}`;l.add(_),o.set(_,I),A.push({type:"section",id:_,label:"",color:nx,outline:R})}let w=A.length?{...x,objects:[...x.objects,...A]}:x,g=new Set(w.objects.filter(I=>I.type==="section").map(I=>I.logicalSectionId??I.id)),S=[...o.entries()].filter(([I])=>g.has(I)).flatMap(([,I])=>I),v=sx(w.objects,qa(S),S),P=w.focal;(v||w.focal&&!Ya(w.focal,t))&&(r.confident=!0),v&&(r.stage??={id:v.shape.id,inferred:v.inferred,...w.floorId?{floorId:w.floorId}:{}},(v.inferred||Ya(w.focal,t))&&(P=v.centre,r.focalInferred=!0));let E=v&&(!v.inferred||Ho(v.outline)*he*he<=Ka),k=v?void 0:c,L={tableIds:a,floorIndex:w.floorIndex,floorId:w.floorId,baseHeightM:w.baseHeightM,focal:k?.focal??P,outline:v?.outline??k?.outline,focalHeightM:k?.focalHeightM??w.baseHeightM+(v&&E?St({...v.shape,role:"stage"}).heightM:0),stageDeck:k?.stageDeck??!!(v&&E&&Ho(v.outline)*he*he<=Ka),middle:S.length?{x:S.reduce((I,R)=>I+R.x,0)/S.length,y:S.reduce((I,R)=>I+R.y,0)/S.length}:P};for(let I of w.objects){if(I.type!=="section")continue;let R=ux(I,o.get(I.logicalSectionId??I.id)??[],L);R&&s.push(R)}return L.outline&&(c=L),Ya(w.focal,L.focal)||(r.focal??=[]).push({...w.floorId?{floorId:w.floorId}:{},point:{...L.focal}}),{unit:w,plane:L,stage:v,planeSeats:S}}),m=i.flatMap(x=>x.objects).map(x=>x.type==="shape"&&!x.role&&(Xa(x.label)==="wall"||!Xa(x.label)&&Gm(x))?{...x,role:"wall"}:x),f=Jt({objects:m},n)!==null;f&&(r.indoor=!0);let h=new Set,d=gx(s,f,dx(n,u[0]?.plane.focal??t)<N1,h),p=new Map(s.filter(x=>!x.authored).map(x=>[x.id,x])),b=u.map(({unit:x,plane:y,stage:M,planeSeats:A})=>x.objects.map(w=>{let g=w.type==="shape"&&!w.role&&w.id!==M?.shape.id?Xa(w.label):null;if(w.type==="shape"&&!w.role&&w.id!==M?.shape.id&&(g==="wall"||!g&&Gm(w))&&w.type==="shape"){(r.roles??=[]).push({id:w.id,...y.floorId?{floorId:y.floorId}:{},role:"wall"});let{fill:R,..._}=w;return{..._,role:"wall"}}if(g&&w.type==="shape")return(r.roles??=[]).push({id:w.id,...y.floorId?{floorId:y.floorId}:{},role:g}),{...w,role:g};let v=M?.inferred&&w.id===M.shape.id&&w.type==="shape"?rx(w,M.outline,x.objects,A):null;if(v&&w.type==="shape")return r.stage?.id===w.id&&(r.stage.field=v),{...w,role:"stage",stageKind:v};let P=w.type==="shape"&&w.id===M?.shape.id&&w.heightM===void 0&&!w.stageKind&&s.some(R=>R.plane===y&&(h.has(R.id)||R.level===0&&R.facesAction&&R.rake<=W1&&(R.frontDistance+R.backD-R.frontD)*he>=X1)),E=P?{heightM:j1}:{};if(M?.inferred&&w.id===M.shape.id&&w.type==="shape"&&Ho(M.outline)*he*he<=Ka)return r.stage?.id===w.id&&(r.stage.deck=!0),{...w,role:"stage",...E};if(P&&w.type==="shape"&&w.role==="stage")return{...w,...E};let k=w.type==="section"?p.get(w.id):void 0;if(!k||w.type!=="section")return w;let L=k.rowCount>=2&&k.rake>0;l.has(k.id)?r.looseRowBlocks=(r.looseRowBlocks??0)+1:r.sections.push({id:k.id,floorId:y.floorId,surfaceKind:L?"rakedRows":"flat",height:k.height,rake:k.rake,stackedOn:d.get(k.id)});let I={status:"inferred",source:"public-2d-topology",note:ix};return{...w,height:k.height,rake:k.rake,surfaceKind:L?"rakedRows":"flat",physical3dProvenance:{height:I,rake:I,surfaceKind:I}}}));if(e.floors?.length){let x=e.floors.map((y,M)=>({...y,objects:b[M],focalPoint:u[M].plane.focal}));return{doc:{...e,floors:x,objects:x[0].objects,focalPoint:x[0].focalPoint},report:r}}return{doc:{...e,objects:b[0],focalPoint:u[0].plane.focal},report:r}}var $m=/^[\p{L}\p{N}]{1,4}$/u,xx=/^([\p{L}\p{N}]{2,})[\s\-\u2013\u2014\u00b7_./]+(.+)$/u;function Zm(e,t){let n=t?.trim();if(!n)return e;let o=e.toLocaleLowerCase("en-US"),r=n.toLocaleLowerCase("en-US");if(o.startsWith(`${r} `)){let a=e.slice(n.length).trim();if($m.test(a))return a}let i=xx.exec(e);if(i){let a=i[1].toLocaleLowerCase("en-US"),s=i[2].trim();if((r.startsWith(a)||a.startsWith(r))&&$m.test(s))return s}return e}var qm={inline:"Inline booth \xB7 1 open side",corner:"Corner booth \xB7 2 open sides",peninsula:"Peninsula booth \xB7 3 open sides",island:"Island booth \xB7 4 open sides"},Mx=new Map(Xi.map(e=>[e.key,e.label]));function vx(e){return`picker.access.${e}`}function Qm(e){let t=[],n=e.boothType;n&&Object.prototype.hasOwnProperty.call(qm,n)&&t.push({key:`booth:${n}`,icon:"booth",titleKey:`picker.boothType.${n}`,titleFallback:qm[n],tone:"place"});let o=e.wheelchairSpaceType;for(let s of e.accessibility??[]){if(s==="wheelchair"&&o)continue;let c=Mx.get(s);c&&t.push({key:`access:${s}`,icon:s,titleKey:vx(s),titleFallback:c,tone:"access"})}o==="no-seat"?t.push({key:"wheelchair:no-seat",icon:"wheelchair",titleKey:"picker.emptyWheelchairSpace",titleFallback:"Empty wheelchair space",tone:"access"}):o==="seat-present"&&t.push({key:"wheelchair:seat-present",icon:"wheelchair",titleKey:"picker.accessiblePhysicalSeat",titleFallback:"Accessible physical seat",tone:"access"}),e.aisle===!0&&t.push({key:"place:aisle",icon:"aisle",titleKey:"picker.aisleSeat",titleFallback:"Aisle seat",tone:"place"});let r=e.commercial;r?.restrictedView&&t.push({key:"mark:restrictedView",icon:"restrictedView",titleKey:"picker.restrictedView",titleFallback:"Restricted view",tone:"warn"}),r?.obstructedView&&t.push({key:"mark:obstructedView",icon:"obstructedView",titleKey:"picker.obstructedView",titleFallback:"Obstructed view",tone:"warn"}),r?.premium&&t.push({key:"mark:premium",icon:"premium",titleKey:"picker.premiumSeat",titleFallback:"Premium seat",tone:"premium"});let i=r?.note?.trim();if(i){let s=t.find(c=>c.tone==="warn"||c.tone==="premium");s?s.note=i:t.push({key:"note",icon:"note",titleKey:"picker.organizerNote",titleFallback:"Organizer note",tone:"note",note:i})}let a=typeof e.entrance=="string"?e.entrance.trim():"";return a&&t.push({key:"place:entrance",icon:"entrance",titleKey:"picker.entrance",titleFallback:"Entrance",tone:"place",note:a}),t}function Jm(e,t,n){return n<0?t>1?e.filter(o=>o.kind==="floor"):[...e]:e.filter(o=>o.floorIndex===void 0||o.floorIndex===n)}function ef(e,t){let n=[...e].sort((r,i)=>r.screen.y-i.screen.y),o=[];for(let r of n){let i=o.find(a=>a.some(s=>Math.abs(s.screen.x-r.screen.x)<104&&Math.abs(s.screen.y-r.screen.y)<34));i?i.push(r):o.push([r])}return o.flatMap(r=>r.length<2?r:r.map((i,a)=>({...i,screen:{...i.screen,x:Math.max(54,Math.min(t-54,i.screen.x+(a-(r.length-1)/2)*104))}})))}var Sx=1.15,wx=2.75,Px=4.5,Ax=.85,Rx=.5,Ex=.26;function tf(e,t,n){let o=Math.max(1e-6,t),r=e/o,i=n?.hasZoneLabels??!0,a=new Set(["stage","gate"]);return r>=.75&&a.add("floor"),r>=Sx&&a.add("zone"),r<=(i?wx:Px)&&(a.add("section"),a.add("ga")),r<=Ax&&(a.add("annotation"),a.add("booth")),r<=Rx&&a.add("row"),r<=Ex&&a.add("seat"),a}function nf(e,t,n,o,r,i=6){let a=i+t,s=o-i-t,c=i+n,l=r-i-n;return{...e,x:a>s?o/2:Math.max(a,Math.min(s,e.x)),y:c>l?r/2:Math.max(c,Math.min(l,e.y))}}function Ot(e,t,n,o){let r=e,i=t[0],a=t[1],s=t[2],c=r[0]*i+r[4]*a+r[8]*s+r[12],l=r[1]*i+r[5]*a+r[9]*s+r[13],u=r[2]*i+r[6]*a+r[10]*s+r[14],m=r[3]*i+r[7]*a+r[11]*s+r[15];if(!(m>1e-6))return{x:0,y:0,depth:1/0,visible:!1};let f=c/m,h=l/m,d=u/m,p=f>=-1.05&&f<=1.05&&h>=-1.05&&h<=1.05&&d<=1;return{x:(f*.5+.5)*n,y:(1-(h*.5+.5))*o,depth:d,visible:p}}function of(e,t,n=t,o=()=>0){let r=[],i=[...e].sort((a,s)=>o(s)-o(a)||a.screen.depth-s.screen.depth);for(let a of i){let s=!1;for(let c of r)if(zo(a,c,t,n)){s=!0;break}s||r.push(a)}return r}var Ix=6;function zo(e,t,n,o){let r=Math.abs(e.screen.x-t.screen.x),i=Math.abs(e.screen.y-t.screen.y),a=e.halfWidth!=null&&t.halfWidth!=null?Math.max(n,e.halfWidth+t.halfWidth+Ix):n;return r<a&&i<o}function rf(e,t,n){return e.length*t*.58+(n?14:0)}var _x={row:8,seat:14};function af(e){return e<480?{row:5,seat:8}:e<768?{row:6,seat:10}:_x}function sf(e,t,n,o){let r=Math.max(1,Math.min(n,o)*.5),i=Math.min(2,Math.hypot(e.x-n/2,e.y-o/2)/r);return t*(1+1.5*i)}function Uo(e,t,n,o,r=[]){let i=[...e].sort((s,c)=>(c.priority??0)-(s.priority??0)||s.focus-c.focus),a=[];for(let s of i){if(a.length>=o)break;let c=!1;for(let l of r)if(zo(s,l,t,n)){c=!0;break}if(!c){for(let l of a)if(zo(s,l,t,n)){c=!0;break}}c||a.push(s)}return a}function es(e,t,n,o){let r=e[3]*t[0]+e[7]*t[1]+e[11]*t[2]+e[15];return r<=0||!(n>0)?0:n*Math.hypot(e[0],e[4],e[8])*o/(2*r)}var Cx=1.5,Tx=30,Lx=4,kx=3.6,Ox=6,ts=15,Fx=3,Dx=1;function Nx(e){return Math.max(kx,Math.min(Ox,2.4+.15*e))}var jo=Math.PI*2;function Bx(e,t){let n=0,o=0;for(let m of e)n+=m.x,o+=m.y;let r=Math.atan2(o/e.length-t.y,n/e.length-t.x),i=e.map(m=>{let f=Math.atan2(m.y-t.y,m.x-t.x)-r;for(;f>Math.PI;)f-=jo;for(;f<-Math.PI;)f+=jo;return f+r}),a=i.map((m,f)=>f).sort((m,f)=>i[m]-i[f]),s=i[a[0]],c=i[a[a.length-1]];if(c-s>Math.PI)return null;let l=m=>Math.hypot(m.x-t.x,m.y-t.y),u=m=>{let f=e[m],h=(m+e.length-1)%e.length,d=(m+1)%e.length,p=Math.abs(i[h]-i[m])<=Math.abs(i[d]-i[m])?h:d,b=e[p];return l(f)<=l(b)?[f,b]:[b,f]};return{start:s,end:c,startEdge:u(a[0]),endEdge:u(a[a.length-1])}}function cf(e){return e.type==="shape"&&e.role==="wall"&&e.heightM===void 0}function ns(e,t,n=()=>!0){let o=[];for(let c of e){if(!cf(c)||!n(c))continue;let l=Me(c);if(!l||l.length<3)continue;let u=Bx(l,t);if(!u)return[];o.push(u)}if(o.length<2)return[];let r=e.flatMap(c=>{if(c.type!=="shape"||c.role!=="entrance"&&c.role!=="exit")return[];let l=Me(c);if(!l?.length)return[];let u=0,m=0;for(let f of l)u+=f.x,m+=f.y;return[{x:u/l.length,y:m/l.length}]}),i=c=>(c%jo+jo)%jo;o.sort((c,l)=>i(c.start)-i(l.start));let a=c=>Math.hypot(c.x-t.x,c.y-t.y),s=[];for(let c=0;c<o.length;c++){let l=o[c],u=o[(c+1)%o.length],m=i(u.start-l.end);if(m<=0||m>=Math.PI/2)continue;let f=g=>i(g-l.end)<m;if(o.some(g=>g!==l&&g!==u&&(f(g.start)||f(g.end)||i(l.end-g.start)<g.end-g.start)))continue;let[d,p]=l.endEdge,[b,x]=u.startEdge,y={x:(d.x+p.x)/2,y:(d.y+p.y)/2},M={x:(b.x+x.x)/2,y:(b.y+x.y)/2},A=Math.hypot(M.x-y.x,M.y-y.y)*C;if(A<Cx||A>Tx||Math.abs(a(y)-a(M))*C>Lx+.2*A)continue;let w={x:(y.x+M.x)/2,y:(y.y+M.y)/2};r.some(g=>f(Math.atan2(g.y-t.y,g.x-t.x))&&Math.abs(a(g)-a(w))*C<=Fx)||s.push({quad:[d,p,x,b],mid:w,widthM:A,openingM:Nx(A)})}return s}function lf(e,t){let n=[];for(let i of t)if(i.text?.trim())for(let a of e){let s=Math.hypot(i.position.x-a.mid.x,i.position.y-a.mid.y)*C;s<=ts&&n.push({text:i,gate:a,d:s})}n.sort((i,a)=>i.d-a.d);let o=new Map,r=new Set;for(let{text:i,gate:a}of n)o.has(i.id)||r.has(a)||(o.set(i.id,a),r.add(a));return o}function uf(e,t,n,o,r,i,a,s=()=>!0){let c=ns(t,Jn(n),s);if(!c.length)return;let l=t.find(m=>cf(m)&&s(m)),u=Xr(l?.fill,a);e.setMaterial(Vr);for(let m of c)r-m.openingM<Dx||Hr(e,m.quad,o+m.openingM,o+r,[],u.top,u.wall,i,r);e.setMaterial(0)}var Vx=6,Gx=2.2,ei=.1,Hx=/^(gate|entrance|entry|exit|way in|way out|door)s?$/i,zx=new Set(["stage","entrance","exit","screen","suite","obstruction","sound","bar","concession","restroom","coat"]),Ux=.3,jx=1.8,Wx=.9,Xx=.55,Kx=1,mf=4e3,Yx=6,ff="#d8a425",$x="#e8c15a",os="#1c1608";function hf(e){let t=Zx(e);if(!t)return null;let n=Qm(e).find(o=>o.icon===t.icon);return{...t,name:n?.titleFallback??t.icon}}function Zx(e){let t=e.accessibility;if(t?.length)return{icon:t.includes("wheelchair")?"wheelchair":t[0],color:br(t)};let n=e.commercial;return n?.obstructedView?{icon:"obstructedView",color:ff,ink:os}:n?.restrictedView?{icon:"restrictedView",color:ff,ink:os}:n?.premium?{icon:"premium",color:$x,ink:os}:null}function qx(e,t){if(!e)return;let n,o=0;for(let[i,a]of e)a>o&&(o=a,n=i);let r=t.categories?.find(i=>i.key===n)?.color;return r&&/^#[0-9a-f]{6}$/i.test(r)?r:void 0}var Qx=6e3,Jx=.25,df=[-90,90,-135,135,-45,45];function eM(e,t,n,o){let r=e.flatMap(({id:a,a:s,members:c})=>{let l=(s.minX+s.maxX)/2,u=(s.minY+s.maxY)/2,m=.5*Math.hypot(s.maxX-s.minX,s.maxY-s.minY),f=1/0;for(let h of c)f=Math.min(f,Math.hypot(t[h].x-l,t[h].y-u));return c.length&&f>=m*Jx?[{id:a,cx:l,cy:u,half:m,members:c}]:[]}).sort((a,s)=>a.half-s.half),i=new Map;return r.forEach(({id:a,cx:s,cy:c,members:l},u)=>{let m=o.x-s,f=o.y-c,p=(Math.hypot(m,f)>1e-6?Math.atan2(f,m):0)+df[u%df.length]*Math.PI/180,b=Math.cos(p),x=Math.sin(p),y=-1,M=-1/0;for(let A of l){let w=(t[A].x-s)*b+(t[A].y-c)*x;w>M&&(M=w,y=A)}i.set(a,[t[y].x*C,n.seatDeckY(y),t[y].y*C])}),i}function bf(e){let{doc:t,units:n,seats:o,surfaces:r,focal:i}=e,a=t.zones??[],s=[];if(a.length){let c=new Map;for(let f of n)for(let h of f.objects)h.type==="section"&&h.zone&&c.set(h.id,h.zone);let l=new Map,u=new Map;for(let f=0;f<o.length;f++){let h=o[f],d=r.seatOwner[f],p=h.zoneId??(d?c.get(d):void 0);if(!p)continue;let b=l.get(p);b||(b={n:0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,sumY:0},l.set(p,b));let x=u.get(p);x||u.set(p,x=[]),x.push(f),b.n++,h.x<b.minX&&(b.minX=h.x),h.y<b.minY&&(b.minY=h.y),h.x>b.maxX&&(b.maxX=h.x),h.y>b.maxY&&(b.maxY=h.y),b.sumY+=r.seatDeckY(f)}let m=eM(a.flatMap(f=>{let h=l.get(f.id);return h?[{id:f.id,a:h,members:u.get(f.id)??[]}]:[]}),o,r,i);for(let f of a){let h=l.get(f.id),d=[];for(let[p,b]of c)b===f.id&&d.push(p);if(!h||h.n===0){s.push({id:f.id,label:f.label,color:ve(f.color),sectionIds:d,seatCount:0,center:[0,0,0],radius:0,focalWorld:[(f.focalPoint??i).x*C,1.5,(f.focalPoint??i).y*C]});continue}s.push({id:f.id,label:f.label,color:ve(f.color),sectionIds:d,seatCount:h.n,...m.has(f.id)?{labelAt:m.get(f.id)}:{},center:[(h.minX+h.maxX)/2*C,h.sumY/h.n,(h.minY+h.maxY)/2*C],radius:.5*Math.hypot((h.maxX-h.minX)*C,(h.maxY-h.minY)*C)||1,focalWorld:[(f.focalPoint??i).x*C,1.5,(f.focalPoint??i).y*C]})}}return s}function yf(e){let{doc:t,units:n,seats:o,surfaces:r,seatData:i,hintedSeatFloor:a,zones:s,focal:c}=e,l=[],u=[],m=[],f=new Map;for(let d of n)for(let p of d.objects){if(p.type!=="section"||!p.zone)continue;let b=(p.displayLabel||p.label||"").trim().toLocaleLowerCase();if(!b)continue;let x=t.floors?.[d.index]?.name?.trim().toLocaleLowerCase();if(n.length>1&&x===b)continue;let y=f.get(p.zone);y||f.set(p.zone,y=new Set),y.add(b)}for(let d of s)d.seatCount!==0&&(f.get(d.id)?.has(d.label.trim().toLocaleLowerCase())||l.push({id:`zone:${d.id}`,kind:"zone",text:d.label,anchor:[(d.labelAt??d.center)[0],(d.labelAt??d.center)[1]+Vx,(d.labelAt??d.center)[2]],color:t.zones?.find(p=>p.id===d.id)?.color}));{let d=new Map,p=new Map,b=new Map,x=new Map;for(let y=0;y<o.length;y++){let M=r.seatOwner[y];if(!M)continue;let A=d.get(M);A||(A={n:0,x:0,y:0,deck:0},d.set(M,A)),A.n++,A.x+=o[y].x,A.y+=o[y].y,A.deck+=r.seatDeckY(y);let w=o[y].categoryKey;if(w){let S=p.get(M);S||(S=new Map,p.set(M,S)),S.set(w,(S.get(w)??0)+1)}if(o[y].accessibility?.includes("wheelchair")){let S=b.get(M);S?S.push(y):b.set(M,[y])}let g=x.get(M);g||(g={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0,minDeck:1/0,maxDeck:-1/0},x.set(M,g)),g.minDeck=Math.min(g.minDeck,r.seatDeckY(y)),g.maxDeck=Math.max(g.maxDeck,r.seatDeckY(y)),o[y].x<g.minX&&(g.minX=o[y].x),o[y].x>g.maxX&&(g.maxX=o[y].x),o[y].y<g.minY&&(g.minY=o[y].y),o[y].y>g.maxY&&(g.maxY=o[y].y)}for(let y of n)for(let M of y.objects){if(M.type!=="section"||Um(M))continue;let A=d.get(M.id);if(!A||A.n===0)continue;let w=x.get(M.id),g=[A.x/A.n*C,A.deck/A.n,A.y/A.n*C],S=M.displayLabel||M.label||M.id;u.push({id:M.id,floorIndex:y.index,label:S,seatCount:A.n,center:g,radius:Math.max(1,Math.hypot(w.maxX-w.minX,w.maxY-w.minY)*.5*C),box:{min:[w.minX*C-.4,w.minDeck,w.minY*C-.4],max:[w.maxX*C+.4,w.maxDeck+1,w.maxY*C+.4]},focalWorld:[y.focal.x*C,y.baseHeightM+1.5,y.focal.y*C]});let v=t.floors?.[y.index]?.name?.trim().toLocaleLowerCase();if(!(n.length>1&&v===S.trim().toLocaleLowerCase())){let P=qx(p.get(M.id),t),E=b.get(M.id);l.push({id:`section:${M.id}`,kind:"section",text:S,anchor:[g[0],g[1]+Gx,g[2]],floorIndex:y.index,...P?{tint:P}:{},...E?{wheelchairSeats:E}:{}})}}}{for(let g of n)for(let S of g.objects){if(S.type!=="gaArea")continue;let v=Fn(S.points);if(!v)continue;let P=S.labelPresentation?.visible===!1?"":S.displayLabel||S.label||S.id,E=S.capacity>0?[P,S.capacity.toLocaleString()].filter(Boolean).join(" \xB7 "):P;E&&l.push({id:`ga:${S.id}`,kind:"ga",text:E,anchor:[v.x*C,g.baseHeightM+jx,v.y*C],floorIndex:g.index})}let d=new Map,p=new Map;for(let g of n)for(let S of g.objects)if(S.type==="section"&&d.set(S.id,S.displayLabel||S.label||S.id),S.type==="row"){let v=S.displayLabel?.trim()||S.segmentedRow?.displayLabel?.trim();v&&p.set(S.id,v)}let b=new Map;for(let g=0;g<o.length;g++){let S=o[g],v=Math.hypot(S.x-c.x,S.y-c.y),P=b.get(S.rowId);(!P||v>P.far)&&b.set(S.rowId,{seat:S,index:g,far:v})}for(let[g,S]of b){let v=r.seatOwner[S.index]??S.seat.sectionId,P=pf(S.seat.label,g,d.get(v??""),p.get(g));P&&l.push({id:`row:${g}`,kind:"row",text:P,anchor:[S.seat.x*C,r.seatDeckY(S.index)+Wx,S.seat.y*C],floorIndex:a[S.index]})}let x=new Map;for(let g=0;g<o.length;g++){let S=o[g],v=x.get(S.rowId);v||(v={n:0,x:0,y:0,z:0,minX:1/0,maxX:-1/0,minZ:1/0,maxZ:-1/0,label:pf(S.label,S.rowId,d.get(r.seatOwner[g]??S.sectionId??""),p.get(S.rowId)),sectionId:r.seatOwner[g]??S.sectionId},x.set(S.rowId,v));let P=g*3,E=i.iPosition[P],k=i.iPosition[P+1],L=i.iPosition[P+2];v.n++,v.x+=E,v.y+=k,v.z+=L,v.minX=Math.min(v.minX,E),v.maxX=Math.max(v.maxX,E),v.minZ=Math.min(v.minZ,L),v.maxZ=Math.max(v.maxZ,L)}for(let[g,S]of x)m.push({id:g,label:S.label,sectionId:S.sectionId,seatCount:S.n,center:[S.x/S.n,S.y/S.n,S.z/S.n],radius:Math.max(.8,Math.hypot(S.maxX-S.minX,S.maxZ-S.minZ)*.5)});let y=0,M=(g,S)=>{y++,l.push({id:`access:${o[g].id}`,kind:"access",text:S.name,icon:S.icon,color:S.color,...S.ink?{ink:S.ink}:{},seatWidthM:i.iChairWidth[g]*2,anchor:[o[g].x*C,r.seatDeckY(g)+Kx,o[g].y*C],floorIndex:a[g],rowId:o[g].rowId})},A=null,w=()=>{if(A){let g=hf(o[A.seats[0]]),S=A.seats.length,v=Math.max(1,Math.round(S/Yx));for(let P=0;P<v&&y<mf;P++)M(A.seats[Math.min(S-1,Math.floor((P+.5)*S/v))],g)}A=null};for(let g=0;g<o.length&&y<mf;g++){let S=hf(o[g]);if(S&&o[g].accessibility?.length){w(),M(g,S);continue}if(!S){w();continue}A&&A.rowId===o[g].rowId&&A.icon===S.icon?A.seats.push(g):(w(),A={rowId:o[g].rowId,icon:S.icon,seats:[g]})}if(w(),o.length<=Qx)for(let g=0;g<o.length;g++){let S=o[g],v=rs(S.displayLabel||S.label);v&&l.push({id:`seat:${S.id}`,kind:"seat",seatWidthM:i.iChairWidth[g]*2,text:v,anchor:[S.x*C,r.seatDeckY(g)+Xx,S.y*C],floorIndex:a[g],rowId:S.rowId})}}let h=Or(n);for(let d of n){let p=Jt(d,n.length===1?o:o.filter((y,M)=>a[M]===d.index)),b=p?lf(ns(d.objects,Jn(p)),d.objects.filter(y=>y.type==="text")):new Map,x=[...b.values()];for(let y of d.objects){let M=y.type==="text"?b.get(y.id):void 0;if(y.type==="shape"&&(y.role==="entrance"||y.role==="exit")&&Hx.test(y.label?.trim()??"")){let A=Me(y),w=A?Fn(A):null;if(w&&x.some(g=>Math.hypot(w.x-g.mid.x,w.y-g.mid.y)*C<=ts+g.widthM))continue}if(M&&y.type==="text")l.push({id:`text:${y.id}`,kind:"gate",text:y.text,icon:"entrance",anchor:[M.mid.x*C,d.baseHeightM+M.openingM+ei,M.mid.y*C],color:y.color,floorIndex:d.index});else if(y.type==="shape"&&y.role&&zx.has(y.role)){if(h.has(y))continue;let A=Me(y),w=A?Fn(A):null;if(!w||!y.label||y.gate?.hideFromBuyers)continue;l.push({id:`architecture:${y.id}`,kind:y.role==="stage"?"stage":y.role==="entrance"||y.role==="exit"?"gate":"annotation",text:y.label,...y.role==="entrance"||y.role==="exit"?{icon:y.role}:{},...y.gate?.stepFree?{stepFree:!0}:{},anchor:[w.x*C,d.baseHeightM+St(y).heightM+ei,w.y*C],color:y.fill,floorIndex:d.index})}else if(y.type==="text"){let A=y.semanticKind==="icon"?Fo(y.iconKey)?.key:void 0,w=y.text||(A?Fo(A).label:"");if(!w)continue;l.push({id:`text:${y.id}`,kind:"annotation",text:w,...A?{venueIcon:A}:{},anchor:A?[(y.position.x+y.fontSize/2)*C,d.baseHeightM+ei,(y.position.y+y.fontSize/2)*C]:[y.position.x*C,d.baseHeightM+ei,y.position.y*C],color:y.color,rotation:y.rotation,floorIndex:d.index})}else if(y.type==="booth"){if(y.labelPresentation?.visible===!1)continue;let A=At(y);if(!A)continue;let w=Fn(A);if(!w)continue;l.push({id:`booth:${y.id}`,kind:"booth",text:y.displayLabel||y.label||y.id,anchor:[w.x*C,d.baseHeightM+Kr+Ux,w.y*C],floorIndex:d.index})}}}return{labels:l,sections:u,rows:m}}function gf(e,t){if(t.length>1)for(let n of t)e.push({id:`floor:${n.id}`,kind:"floor",text:n.label,anchor:[n.center[0],n.box.max[1]+1.2,n.center[2]],floorIndex:n.index})}function rs(e){let t=e.lastIndexOf("-");return t>=0&&t<e.length-1?e.slice(t+1):e}function pf(e,t,n,o){if(o?.trim())return o.trim();let r=e?e.lastIndexOf("-"):-1,i=r>0?e.slice(0,r):t;return i&&Zm(i,n)}function xf(e){let{doc:t,units:n,seats:o,surfaces:r,solids:i,hintedSeatFloor:a,seatFloor:s}=e,c=[];{let l=n.map(()=>({minX:1/0,minY:1/0,minZ:1/0,maxX:-1/0,maxY:-1/0,maxZ:-1/0}));for(let f=0;f<i.floor.length;f+=1){let h=Math.max(0,Math.min(n.length-1,Math.round(i.floor[f]))),d=f*3,p=l[h];p.minX=Math.min(p.minX,i.position[d]),p.minY=Math.min(p.minY,i.position[d+1]),p.minZ=Math.min(p.minZ,i.position[d+2]),p.maxX=Math.max(p.maxX,i.position[d]),p.maxY=Math.max(p.maxY,i.position[d+1]),p.maxZ=Math.max(p.maxZ,i.position[d+2])}let u=new Map;for(let f=0;f<n.length;f++)for(let h of n[f].objects)h.type==="section"&&u.set(h.id,f);let m=n.map(()=>({n:0,minX:1/0,minY:1/0,minDeck:1/0,maxX:-1/0,maxY:-1/0,maxDeck:-1/0,sumX:0,sumDeck:0,sumZ:0}));for(let f=0;f<o.length;f++){let h=r.seatOwner[f],d=(h!==null?u.get(h):void 0)??a[f];if(d===void 0)continue;let p=m[d],b=o[f];p.n++,b.x<p.minX&&(p.minX=b.x),b.y<p.minY&&(p.minY=b.y),b.x>p.maxX&&(p.maxX=b.x),b.y>p.maxY&&(p.maxY=b.y);let x=r.seatDeckY(f);p.sumX+=b.x*C,p.sumDeck+=x,p.sumZ+=b.y*C,p.minDeck=Math.min(p.minDeck,x),p.maxDeck=Math.max(p.maxDeck,x+1.6),s[f]=d}for(let f=0;f<n.length;f++){let h=m[f],d=t.floors?.[f],p=l[f],b=Math.min(h.n?h.minX*C:n[f].focal.x*C-1,Number.isFinite(p.minX)?p.minX:1/0),x=Math.max(h.n?h.maxX*C:n[f].focal.x*C+1,Number.isFinite(p.maxX)?p.maxX:-1/0),y=Math.min(h.n?h.minY*C:n[f].focal.y*C-1,Number.isFinite(p.minZ)?p.minZ:1/0),M=Math.max(h.n?h.maxY*C:n[f].focal.y*C+1,Number.isFinite(p.maxZ)?p.maxZ:-1/0),A=Math.min(h.n?Math.min(n[f].baseHeightM,h.minDeck):n[f].baseHeightM,Number.isFinite(p.minY)?p.minY:1/0),w=Math.max(h.n?Math.max(h.maxDeck,A+.5):A+.5,Number.isFinite(p.maxY)?p.maxY:-1/0),g=[h.n?h.sumX/h.n:(b+x)/2,h.n?h.sumDeck/h.n:(A+w)/2,h.n?h.sumZ/h.n:(y+M)/2],S=Math.max(1,.5*Math.hypot(x-b,w-A,M-y));c.push({index:f,id:d?.id??`floor-${f}`,label:d?.name??(n.length>1?`Floor ${f+1}`:"Venue"),seatCount:h.n,center:g,radius:S,box:{min:[b,A,y],max:[x,w,M]},focalWorld:[n[f].focal.x*C,n[f].baseHeightM+1.5,n[f].focal.y*C]})}}return c}function cs(e,t){let n=1/0,o=1/0,r=-1/0,i=-1/0,a=(s,c)=>{s<n&&(n=s),c<o&&(o=c),s>r&&(r=s),c>i&&(i=c)};for(let s of t)a(s.x,s.y);for(let s of e)for(let c of s.objects)if(c.type==="section")for(let l of c.outline)a(l.x,l.y);else if(c.type==="shape"&&c.points)for(let l of c.points)a(l.x,l.y);else if(c.type==="gaArea")for(let l of c.points)a(l.x,l.y);else if(c.type==="booth"){let l=At(c);if(l)for(let u of l)a(u.x,u.y)}else if(c.type==="table"){let l=Yr(c);if(l)for(let u of l)a(u.x,u.y)}else if(c.type==="decorImage"){let l=$r(c);if(l)for(let u of l)a(u.x,u.y)}return Number.isFinite(n)||(n=-100,o=-100,r=100,i=100),{minX:n,minY:o,maxX:r,maxY:i}}function Rf(e,t,n,o,r,i){if(t.length===1){let a=n.map(m=>({x:m.x,y:m.y}));for(let m of t[0].objects)m.type==="section"?a.push(...m.outline):m.type==="shape"?a.push(...Me(m)??m.points??[]):m.type==="gaArea"?a.push(...m.points):m.type==="booth"?a.push(...At(m)??[]):m.type==="table"?a.push(...Yr(m)??[]):m.type==="decorImage"&&a.push(...$r(m)??[]);if(wf(e,t[0],n,i)||Af(e,t[0],n,a,i))return!1;if(Sf(e,t[0].baseHeightM,a,i))return!0;let s=Do(a),c=(r.minX+r.maxX)/2,l=(r.minY+r.maxY)/2,u=s.length>=3?s.map(m=>{let f=m.x-c,h=m.y-l,d=Math.max(1,Math.hypot(f,h));return{x:m.x+f/d*80,y:m.y+h/d*80}}):xo(r.minX-28,r.minY-28,r.maxX-r.minX+56,r.maxY-r.minY+56);return ie(e,u,void 0,()=>-.04,-.22,i.ground,i.ground,oe),!1}else{let a=t.reduce((p,b)=>b.baseHeightM<p.baseHeightM?b:p);e.setFloor(a.index);let s={...a,objects:t.flatMap(p=>p.objects)},c=n.map(p=>({x:p.x,y:p.y}));for(let p of s.objects)p.type==="section"&&c.push(...p.outline);if(wf(e,s,n,i)||Af(e,s,n,c,i))return!1;if(Sf(e,a.baseHeightM,c,i))return!0;let l=n.filter((p,b)=>o[b]===a.index),u=cs([a],l),m=Math.hypot(u.maxX-u.minX,u.maxY-u.minY),f=Math.max(28,Math.min(80,m*.04)),h=xo(u.minX-f,u.minY-f,u.maxX-u.minX+f*2,u.maxY-u.minY+f*2),d=a.baseHeightM-.03;return ie(e,h,void 0,()=>d,d-.22,i.ground,i.ground,oe),!1}}function ls(e,t,n,o){let{cx:r,cz:i,radius:a}=n,s=1/0,c=1/0,l=1/0,u=-1/0,m=-1/0,f=-1/0,h=(b,x,y)=>{s=Math.min(s,b),u=Math.max(u,b),c=Math.min(c,x),m=Math.max(m,x),l=Math.min(l,y),f=Math.max(f,y)};for(let b=0;b<e.position.length;b+=3){let x=b/3;o&&x>=o[0]&&x<o[1]||h(e.position[b],e.position[b+1],e.position[b+2])}for(let b=0;b<t.count;b++){let x=b*3,y=t.iPosition[x],M=t.iPosition[x+1],A=t.iPosition[x+2],w=Math.max(.35,t.iMaxRadius[b]??.35);h(y-w,M,A-w),h(y+w,M+1.6,A+w)}Number.isFinite(s)||(s=r-a,u=r+a,c=0,m=a*.16,l=i-a,f=i+a);let d=[(s+u)/2,(c+m)/2,(l+f)/2],p=Math.max(1,.5*Math.hypot(u-s,m-c,f-l));return{center:d,radius:p,minY:c,maxY:m}}var tM=4096;function Ef(e,t,n=[]){let o=Math.max(1,Math.ceil(e.count/tM)),r=Math.ceil(e.count/o),i=new Float32Array((r*2+t.length*4+n.length)*3),a=0;for(let s=0;s<e.count;s+=o){let c=e.iPosition[s*3],l=e.iPosition[s*3+1],u=e.iPosition[s*3+2];i[a++]=c,i[a++]=l,i[a++]=u,i[a++]=c,i[a++]=0,i[a++]=u}for(let[s,c,l]of n)i[a++]=s,i[a++]=c,i[a++]=l;for(let s of t)for(let[c,l]of[[-1,-1],[1,-1],[1,1],[-1,1]])i[a++]=s.cx+c*s.halfX,i[a++]=s.y,i[a++]=s.cz+l*s.halfZ;return i.subarray(0,a)}function If(e,t,n,o,r,i,a=[]){let s=1/0,c=1/0,l=-1/0,u=-1/0;for(let w=0;w<e.count;w++){let g=w*3,S=e.iPosition[g],v=e.iPosition[g+2];S<s&&(s=S),S>l&&(l=S),v<c&&(c=v),v>u&&(u=v)}for(let[w,,g]of a)w<s&&(s=w),w>l&&(l=w),g<c&&(c=g),g>u&&(u=g);for(let w of t)s=Math.min(s,w.cx-w.halfX),l=Math.max(l,w.cx+w.halfX),c=Math.min(c,w.cz-w.halfZ),u=Math.max(u,w.cz+w.halfZ);let m=n.minX*C,f=n.maxX*C,h=n.minY*C,d=n.maxY*C,p=m,b=f,x=h,y=d;if(Number.isFinite(s)){let w=Math.max(2,.06*Math.hypot(l-s,u-c));p=Math.max(m,s-w),b=Math.min(f,l+w),x=Math.max(h,c-w),y=Math.min(d,u+w)}let M=Math.min(0,o),A=Math.max(r,i*.05);return{min:[p,M,x],max:[b,A,y]}}var is=12,nM=.5,oM=6,as=.8,Mf=5,rM=.6,iM=40,ss=0,vf=8;function Sf(e,t,n,o){let r=Do([...n]);if(r.length<3)return!1;let i=1/0,a=1/0,s=-1/0,c=-1/0;for(let w of r)i=Math.min(i,w.x),s=Math.max(s,w.x),a=Math.min(a,w.y),c=Math.max(c,w.y);let l=Math.hypot(s-i,c-a)*C,u=Math.max(iM,l*rM),m=w=>Tt(r,w/C,1.2),f=m(nM),h=[f,m(oM),m(is),m(is+Mf),m(is+Mf+u)];if(h.some(w=>w.length!==f.length))return!1;let d=Se(o.ground,[.78,.76,.72],.35),p=Se(o.ground,[.56,.62,.52],.3),b=[d[0]*as,d[1]*as,d[2]*as],x=t-.04;e.setMaterial(ss),ie(e,f,void 0,()=>x,t-.22,b,b,oe);let y=[0,1,0],M=(w,g,S,v,P)=>{let E=w.map(R=>[R.x*C,x,R.y*C]),k=g.map(R=>[R.x*C,x,R.y*C]),[L,I]=P;for(let R=0;R<E.length;R++){let _=(R+1)%E.length;e.tri(E[R],k[_],k[R],y,S,v,v,[L,I,I]),e.tri(E[R],E[_],k[_],y,S,S,v,[L,L,I])}},A=[ss,ss];return M(h[0],h[1],b,d,A),M(h[1],h[2],d,d,A),M(h[2],h[3],d,p,A),M(h[3],h[4],p,p,[vf,vf+1]),e.setMaterial(0),!0}function wf(e,t,n,o){let r=Jt(t,n);if(!r)return!1;let i=t.baseHeightM,a=Se(o.ground,[.62,.55,.47],.4);return ie(e,r,void 0,()=>i-.04,i-.22,a,a,oe),!0}var aM=3e3,sM=20,Pf=1.5,cM=1.2,lM=.25;function Af(e,t,n,o,r){if(!n.length||n.length>aM||o.length<3)return!1;for(let P of t.objects){if(P.type==="shape"&&yn(P.stageKind))return!1;if(P.type==="section"){let{height:E}=$t(P,{floorBaseHeightM:t.baseHeightM});if(E-t.baseHeightM>sM)return!1}}let i=0,a=0;for(let P of o)i+=P.x,a+=P.y;i/=o.length,a/=o.length;let s=0,c=0,l=0;for(let P of o){let E=P.x-i,k=P.y-a;s+=E*E,c+=k*k,l+=E*k}let u=.5*Math.atan2(2*l,s-c),m=Math.cos(u),f=Math.sin(u),h=-f,d=m,p=1/0,b=-1/0,x=1/0,y=-1/0;for(let P of o){let E=(P.x-i)*m+(P.y-a)*f,k=(P.x-i)*h+(P.y-a)*d;p=Math.min(p,E),b=Math.max(b,E),x=Math.min(x,k),y=Math.max(y,k)}let M=P=>[[p-P,x-P],[b+P,x-P],[b+P,y+P],[p-P,y+P]].map(([E,k])=>({x:i+m*E+h*k,y:a+f*E+d*k})),A=M(Pf/C),w=M((Pf+lM)/C),g=t.baseHeightM,S=Se(r.ground,[.62,.55,.47],.4),v=Se(r.ground,[.86,.86,.84],.55);return ie(e,w,void 0,()=>g-.04,g-.22,S,S,oe),ie(e,w,[A.slice().reverse()],()=>g+cM,g-.04,Se(v,[1,1,1],.2),v,oe),!0}function _f(e,t,n){let o=()=>({byObjectId:new Map,elements:[]});if(!t||!e)return o();let r=xl(t);if(!r.ok||r.value.id!==e)return o();let i=new Map;for(let m of n)for(let f of m.objects)f.type==="shape"&&i.set(f.id,{shape:f,unit:m});let a=new Set,s=new Set,c=new Map((t.overlay.productionElements??[]).map(m=>{let f=m.runtimeContentImageUrl;return[m.id,typeof f=="string"&&/^(?:blob:|data:image\/|https:\/\/)/.test(f)?f:void 0]})),l=[];for(let m of r.value.overlay.productionElements??[]){let f=i.get(m.objectId),h=f?Me(f.shape):null,d=m.baseElevationM??0;if(!f||!h||h.length<3||!m.id||a.has(m.id)||s.has(m.objectId)||!Number.isFinite(m.heightM)||m.heightM<.05||m.heightM>50||!Number.isFinite(d)||d<-10||d>100)return o();a.add(m.id),s.add(m.objectId);let p=h.map(v=>v.x*C),b=h.map(v=>v.y*C),x=f.unit.baseHeightM+d,y=Math.min(...p),M=Math.max(...p),A=Math.min(...b),w=Math.max(...b),g,S=c.get(m.id)??m.contentImageUrl;if(m.kind==="screen"&&S&&(g=em(h,x,x+m.heightM,f.unit.focal),!g))if(M-y>=w-A){let v=Math.abs(A-f.unit.focal.y*C)<=Math.abs(w-f.unit.focal.y*C)?A-.006:w+.006;g=[[y,x,v],[M,x,v],[y,x+m.heightM,v],[M,x+m.heightM,v]]}else{let v=Math.abs(y-f.unit.focal.x*C)<=Math.abs(M-f.unit.focal.x*C)?y-.006:M+.006;g=[[v,x,A],[v,x,w],[v,x+m.heightM,A],[v,x+m.heightM,w]]}l.push({id:m.id,objectId:m.objectId,kind:m.kind,floorIndex:f.unit.index,baseY:x,topY:x+m.heightM,bounds:{min:[y,x,A],max:[M,x+m.heightM,w]},occlusion:m.occlusion,...S?{contentImageUrl:S}:{},...g?{contentPlane:g}:{}})}let u=l.sort((m,f)=>m.id.localeCompare(f.id));return{byObjectId:new Map(u.map(m=>[m.objectId,m])),elements:u}}function uM(e){let t=Math.min(1,Math.max(0,e));return t<=.0031308?t*12.92:1.055*Math.pow(t,1/2.4)-.055}function et(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function at(e){return Array.isArray(e)?e:[]}function mM(e){let t=[e];for(;t.length;){let n=t.pop();if(Array.isArray(n)){t.push(...n);continue}if(!et(n))continue;let o=et(n.extensions)?n.extensions:null;if(o&&Object.prototype.hasOwnProperty.call(o,"KHR_draco_mesh_compression"))return!0;t.push(...Object.values(n))}return!1}function Wo(e,t){return!Array.isArray(e)||e.length!==t||!e.every(n=>typeof n=="number"&&Number.isFinite(n))?null:e}function fM(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function hM(e,t){let n=new Array(16).fill(0);for(let o=0;o<4;o++)for(let r=0;r<4;r++)for(let i=0;i<4;i++)n[o*4+r]+=e[i*4+r]*t[o*4+i];return n}function dM(e){let t=Wo(e.matrix,16);if(t)return t;if(e.matrix!==void 0)return null;let n=e.translation===void 0?[0,0,0]:Wo(e.translation,3),o=e.rotation===void 0?[0,0,0,1]:Wo(e.rotation,4),r=e.scale===void 0?[1,1,1]:Wo(e.scale,3);if(!n||!o||!r)return null;let[i,a,s,c]=o,l=Math.hypot(i,a,s,c);if(!(l>1e-8))return null;let u=i/l,m=a/l,f=s/l,h=c/l,d=u+u,p=m+m,b=f+f,x=u*d,y=u*p,M=u*b,A=m*p,w=m*b,g=f*b,S=h*d,v=h*p,P=h*b;return[(1-(A+g))*r[0],(y+P)*r[0],(M-v)*r[0],0,(y-P)*r[1],(1-(x+g))*r[1],(w+S)*r[1],0,(M+v)*r[2],(w-S)*r[2],(1-(x+A))*r[2],0,n[0],n[1],n[2],1]}function pM(e,t,n,o){return[e[0]*t+e[4]*n+e[8]*o+e[12],e[1]*t+e[5]*n+e[9]*o+e[13],e[2]*t+e[6]*n+e[10]*o+e[14]]}function bM(e){let t=e[0],n=e[4],o=e[8],r=e[1],i=e[5],a=e[9],s=e[2],c=e[6],l=e[10],u=i*l-a*c,m=a*s-r*l,f=r*c-i*s,h=t*u+n*m+o*f;if(Math.abs(h)<1e-12)return null;let d=1/h;return[u*d,m*d,f*d,(o*c-n*l)*d,(t*l-o*s)*d,(n*s-t*c)*d,(n*a-o*i)*d,(o*r-t*a)*d,(t*i-n*r)*d]}function Cf(e,t,n,o){let r=e[0]*t+e[1]*n+e[2]*o,i=e[3]*t+e[4]*n+e[5]*o,a=e[6]*t+e[7]*n+e[8]*o,s=Math.hypot(r,i,a)||1;return r/=s,i/=s,a/=s,[r,i,a]}function yM(e){if(e.byteLength<20||e.byteLength>8388608)return null;let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.getUint32(0,!0)!==1179937895||t.getUint32(4,!0)!==2||t.getUint32(8,!0)!==e.byteLength)return null;let n=12,o=null,r=null;for(;n+8<=e.byteLength;){let i=t.getUint32(n,!0),a=t.getUint32(n+4,!0);if(n+=8,i%4!==0||n+i>e.byteLength)return null;let s=e.subarray(n,n+i);if(a===1313821514&&!o)try{let c=JSON.parse(new TextDecoder().decode(s).replace(/[\u0000 ]+$/g,""));if(!et(c))return null;o=c}catch{return null}else if(a===5130562&&!r)r=s;else return null;n+=i}return n===e.byteLength&&o&&r?{json:o,bin:r}:null}function gM(e){return e===5120||e===5121?1:e===5122||e===5123?2:e===5125||e===5126?4:0}function xM(e){return e==="SCALAR"?1:e==="VEC2"?2:e==="VEC3"?3:e==="VEC4"?4:0}function MM(e,t,n){return n===5120?e.getInt8(t):n===5121?e.getUint8(t):n===5122?e.getInt16(t,!0):n===5123?e.getUint16(t,!0):n===5125?e.getUint32(t,!0):e.getFloat32(t,!0)}function vM(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n=yM(t);if(!n)return{ok:!1,issue:"invalid_glb"};let{json:o,bin:r}=n;if(!et(o.asset)||o.asset.version!=="2.0")return{ok:!1,issue:"unsupported_glb"};let i=at(o.extensionsUsed).filter(v=>typeof v=="string");if(i.includes("KHR_draco_mesh_compression")||mM(o))return{ok:!1,issue:"draco_not_allowed"};if(i.length||at(o.extensionsRequired).length)return{ok:!1,issue:"unsupported_glb"};if(at(o.images).length||at(o.textures).length)return{ok:!1,issue:"external_resource"};let a=at(o.buffers);if(a.length!==1||!et(a[0])||a[0].uri!==void 0||typeof a[0].byteLength!="number"||!Number.isInteger(a[0].byteLength)||a[0].byteLength<0||a[0].byteLength>r.byteLength)return{ok:!1,issue:"external_resource"};let s=at(o.accessors),c=at(o.bufferViews),l=at(o.meshes),u=at(o.nodes),m=at(o.scenes),f=typeof o.scene=="number"?o.scene:0;if(!et(m[f]))return{ok:!1,issue:"unsupported_glb"};let h=new DataView(r.buffer,r.byteOffset,r.byteLength),d=(v,P,E,k=!1)=>{if(typeof v!="number"||!Number.isInteger(v)||!et(s[v]))return null;let L=s[v],I=typeof P=="string"?L.type===P:P.includes(L.type),R=L.componentType!==5126,_=k&&R?L.normalized===!0:L.normalized!==!0;if(!I||L.sparse!==void 0||!_||typeof L.count!="number"||!Number.isInteger(L.count)||L.count<1||typeof L.componentType!="number"||!E.includes(L.componentType)||typeof L.bufferView!="number")return null;let F=c[L.bufferView];if(!et(F)||F.buffer!==0||typeof F.byteLength!="number"||!Number.isInteger(F.byteLength)||F.byteLength<0)return null;let N=xM(L.type),O=gM(L.componentType),V=typeof F.byteStride=="number"?F.byteStride:N*O,z=typeof F.byteOffset=="number"?F.byteOffset:0,G=typeof L.byteOffset=="number"?L.byteOffset:0,T=z+G,D=G+(L.count-1)*V+N*O;if(!Number.isInteger(V)||!Number.isInteger(z)||!Number.isInteger(G)||V<N*O||z<0||G<0||z+F.byteLength>r.byteLength||D>F.byteLength)return null;let W=[];for(let H=0;H<L.count;H++){let j=[];for(let Z=0;Z<N;Z++){let X=MM(h,T+H*V+Z*O,L.componentType);if(!Number.isFinite(X))return null;j.push(X)}W.push(j)}return W},p=[],b=[],x=[],y=!1,M=at(o.materials),A=v=>{if(v===void 0)return null;if(typeof v!="number"||!Number.isInteger(v)||!et(M[v]))return!1;let P=M[v].pbrMetallicRoughness;if(P===void 0)return null;if(!et(P))return!1;if(P.baseColorFactor===void 0)return null;let E=Wo(P.baseColorFactor,4);return!E||E.some(k=>k<0||k>1)?!1:[E[0],E[1],E[2]]},w=0,g=new Set,S=(v,P)=>{if(typeof v!="number"||!Number.isInteger(v)||!et(u[v])||g.has(v))return!1;g.add(v);let E=u[v],k=dM(E);if(!k)return!1;let L=hM(P,k),I=bM(L);if(!I)return!1;if(E.mesh!==void 0){if(typeof E.mesh!="number")return!1;let R=l[E.mesh];if(!et(R))return!1;for(let _ of at(R.primitives)){if(!et(_)||_.mode!==void 0&&_.mode!==4||!et(_.attributes))return!1;let F=d(_.attributes.POSITION,"VEC3",[5126]),N=_.attributes.NORMAL===void 0?null:d(_.attributes.NORMAL,"VEC3",[5126]);if(!F||_.attributes.NORMAL!==void 0&&!N)return!1;let O=A(_.material);if(O===!1)return!1;let V=_.attributes.COLOR_0===void 0?null:d(_.attributes.COLOR_0,["VEC3","VEC4"],[5126,5121,5123],!0);if(_.attributes.COLOR_0!==void 0&&(!V||V.length!==F.length))return!1;let z=V?s[_.attributes.COLOR_0]:null,G=!z||z.componentType===5126?1:z.componentType===5121?1/255:1/65535,T=O!==null||V!==null;T&&(y=!0);let D=F.length;if(_.indices!==void 0){let H=typeof _.indices=="number"?s[_.indices]:null;D=et(H)?H.count:void 0}if(typeof D!="number"||!Number.isInteger(D)||D%3!==0||(w+=D/3,w>1e5))return!1;let W=_.indices===void 0?F.map((H,j)=>[j]):d(_.indices,"SCALAR",[5121,5123,5125]);if(!W||W.length%3!==0||W.length!==D)return!1;for(let H=0;H<W.length;H+=3){let j=[W[H][0],W[H+1][0],W[H+2][0]];if(j.some(ee=>!Number.isInteger(ee)||ee<0||ee>=F.length))return!1;let Z=j.map(ee=>pM(L,...F[ee])),X=null;if(!N){let ee=Z[1][0]-Z[0][0],ne=Z[1][1]-Z[0][1],ue=Z[1][2]-Z[0][2],de=Z[2][0]-Z[0][0],me=Z[2][1]-Z[0][1],pe=Z[2][2]-Z[0][2];X=Cf([1,0,0,0,1,0,0,0,1],ne*pe-ue*me,ue*de-ee*pe,ee*me-ne*de)}for(let ee=0;ee<3;ee++){if(p.push(...Z[ee]),b.push(...N?Cf(I,...N[j[ee]]):X),!T){x.push(-1,-1,-1);continue}let ne=V?V[j[ee]]:null;for(let ue=0;ue<3;ue++)x.push(uM((O?O[ue]:1)*(ne?ne[ue]*G:1)))}}}}for(let R of at(E.children))if(!S(R,L))return!1;return g.delete(v),!0};for(let v of at(m[f].nodes))if(!S(v,fM()))return{ok:!1,issue:w>1e5?"triangle_limit":"unsupported_glb"};return!w||p.length!==w*9||b.length!==p.length?{ok:!1,issue:"unsupported_glb"}:{ok:!0,triangleCount:w,position:new Float32Array(p),normal:new Float32Array(b),color:y?new Float32Array(x):null}}function Tf(e){try{return vM(e)}catch{return{ok:!1,issue:"invalid_glb"}}}function no(e){let{doc:t}=e,n=$l(t,e.eventConfigurationId??t.eventConfigurationId),o=Zc(t.theme,ou(n,e.seats)),r=o.structure,i=_f(e.eventConfigurationId,e.eventConfiguration,n),a=e.seats,s=new xr,c=null;if(e.registeredShellGlb){let $=Tf(e.registeredShellGlb);if($.ok){let B=$.position.length/3,Y=new Float32Array($.position.length),q=o.materials.shell??r.tierWall,J=$.color;for(let te=0;te<B;te++){let ae=$.normal[te*3+1],fe=ae<-.25?.4:.62+.38*Math.max(0,ae),Ue=!!J&&J[te*3]!==-1;Y[te*3]=(Ue?J[te*3]:q[0])*fe,Y[te*3+1]=(Ue?J[te*3+1]:q[1])*fe,Y[te*3+2]=(Ue?J[te*3+2]:q[2])*fe}c={position:$.position,normal:$.normal,color:Y,floor:new Float32Array(B).fill(-2),material:new Float32Array(B),count:B}}}let l=new Map;for(let $ of n)for(let B of $.objects)l.set(B.id,$.index),B.type==="section"&&l.set(B.logicalSectionId??B.id,$.index);let u=a.map($=>l.get($.sectionId??"")??l.get($.rowId??"")??0),m=cs(n,a),f=s.vertexCount,d=Rf(s,n,a,u,m,r)?s.vertexCount:f,p=Ol(t,a),b=new Map,x=new Map;for(let $ of t.categories??[])b.set($.key,$.color),$.seatGlyph&&x.set($.key,$.seatGlyph);let y=[],M=Ju(n,a,u),A=new Map;a.forEach(($,B)=>{let Y=M.seatDeckY(B);Number.isFinite(Y)&&A.set($.rowId,Math.min(A.get($.rowId)??1/0,Y))});let w=new Float32Array(a.length),g=[],S=new Map((t.floors??[]).map(($,B)=>[$.id,B])),v=n.map(()=>[]);for(let $ of a){let B=$.floorId?S.get($.floorId)??0:0;v[Math.min(B,v.length-1)]?.push($)}let P=($,B)=>{if(!B||B.length<3)return!1;let Y=Math.min(...B.map(ae=>ae.x)),q=Math.max(...B.map(ae=>ae.x)),J=Math.min(...B.map(ae=>ae.y)),te=Math.max(...B.map(ae=>ae.y));for(let ae=0;ae<$;ae++)for(let fe of v[ae])if(!(fe.x<Y||fe.x>q||fe.y<J||fe.y>te)&&Ke(fe,B,void 0))return!0;return!1},E=Or(n),k=null,L=$=>n.length===1?a:a.filter((B,Y)=>u[Y]===$),I=($,B)=>{let Y=At($);if(!Y)return!1;let q=1/0,J=1/0,te=-1/0,ae=-1/0;for(let fe of Y)q=Math.min(q,fe.x),te=Math.max(te,fe.x),J=Math.min(J,fe.y),ae=Math.max(ae,fe.y);return a.some((fe,Ue)=>fe.kind!=="booth"&&(n.length===1||u[Ue]===B)&&fe.x>q&&fe.x<te&&fe.y>J&&fe.y<ae&&Ze(Y,fe.x,fe.y))},R,_=[],F;for(let $=0;$<n.length;$++){let B=n[$];s.setFloor($);let Y=Jt(B,L($)),q=0;if(Y){let se=0;for(let Te of B.objects)if(Te.type==="section")for(let ht of M.bySection.get(Te.id)?.rowLevels??[])se=Math.max(se,ht.y-B.baseHeightM);q=Ku(se);for(let Te of Y)_.push([Te.x*C,Te.y*C]);if(F=Math.max(F??-1/0,B.baseHeightM+q),!R){let Te=Jn(Y);R={centre:[Te.x*C,Te.y*C]}}}let J=new Ir,te=[],ae=B.objects.filter(se=>se.type==="shape"&&(se.role==="entrance"||se.role==="exit")),fe=B.objects.filter(se=>se.type==="section"&&!!se.outline&&se.outline.length>=3),Ue=Mm(B.objects.filter(se=>se.type==="booth"),B.focal);for(let se of B.objects)if(se.type==="section"){let Te=s.vertexCount;Dm(s,se,B,Fl(se,p),M.bySection.get(se.id),J,fe,r,$>0&&P($,se.outline));let ht=s.vertexCount-Te;ht>0&&g.push({sectionId:se.id,start:Te,count:ht})}else if(se.type==="shape"){let Te=i.byObjectId.get(se.id);if(E.has(se)&&!Te)continue;let ht=y.length,Ee=Y!==null&&se.role==="wall"&&!Te;s.setMaterial(Ee?Vr:(Te?.kind??se.role)==="screen"?1:0);let qe=se.role==="stage"&&!Te?Sm(se,L($)):Ee&&se.heightM===void 0?{...se,heightM:q}:se,cn=eu(qe,te);if(bm(s,qe,B.baseHeightM+cn.supportOffsetM,cn.topOffsetM-cn.supportOffsetM,r,B.focal,y,Te,ae),s.setMaterial(0),se.role==="stage"&&!Te&&y.length>ht&&(k??$)===$){k=$;let lt=t.floors?.[$]?.id,xt=n.length>1&&lt?a.filter(Rt=>Rt.floorId===lt):a;nu(s,qe,y[y.length-1].y,xt,{deck:y[y.length-1].top,night:!Vt(r)});let Wt=vt(qe.stageKind)?Me(qe):null;Wt&&Eu(s,qe,Wt,y[y.length-1].y,xt,B.objects.some(Rt=>Rt.type==="shape"&&Rt.role==="goal"),B.objects.some(Rt=>Rt.type==="shape"&&Rt.role==="dugout")),Wt&&yn(qe.stageKind)&&Iu(s,Wt,y[y.length-1].y,xt,Wr),s.setMaterial(0)}}else se.type==="gaArea"?gm(s,se,B.baseHeightM,ve(b.get(se.categoryKey)),r):se.type==="booth"?hm(s,se,B.baseHeightM,ve(b.get(se.categoryKey)),r,Ue.get(se.id)??B.focal,I(se,$)):se.type==="table"?pm(s,se,Math.max(B.baseHeightM,A.get(se.id)??B.baseHeightM),ve(se.fill??t.theme?.decorFill??"#232c40"),r,!!(se.fill??t.theme?.decorFill)):se.type==="decorImage"&&ym(s,se,B.baseHeightM,r);Y&&uf(s,B.objects,Y,B.baseHeightM,q,B.focal,r,se=>!i.byObjectId.has(se.id)),Bm(s,B,a,M,r,o.materials.shell,!c)}let N=n.length>1?{x:n.reduce(($,B)=>$+B.focal.x,0)/n.length,y:n.reduce(($,B)=>$+B.focal.y,0)/n.length}:t.focalPoint??{x:(m.minX+m.maxX)/2,y:(m.minY+m.maxY)/2},O=Nc(c?[s.build(),c]:[s.build()]),V=new Map;for(let $ of n)for(let B of $.objects)B.type==="table"&&V.set(B.id,B.center);let z=Gc(a,e.initialState,M,w,b,x,new Set(V.keys())),G=bf({doc:t,units:n,seats:a,surfaces:M,focal:N}),{labels:T,sections:D,rows:W}=yf({doc:t,units:n,seats:a,surfaces:M,seatData:z,hintedSeatFloor:u,zones:G,focal:N}),H=new Map(D.map(($,B)=>[$.id,B]));M.seatOwner.forEach(($,B)=>{z.iSection[B]=$?H.get($)??-1:-1});let j=xf({doc:t,units:n,seats:a,surfaces:M,solids:O,hintedSeatFloor:u,seatFloor:w});gf(T,j),z.iYaw=sc(z.iPosition,a.length,$=>a[$].rowId,$=>{let B=n[w[$]]?.focal??N;return[B.x*C,B.y*C]},$=>{let B=V.get(a[$].rowId);return B?[B.x*C,B.y*C]:void 0});let Z=(m.minX+m.maxX)/2*C,X=(m.minY+m.maxY)/2*C,ee=.5*Math.hypot((m.maxX-m.minX)*C,(m.maxY-m.minY)*C)||10,ne=ls(O,z,{cx:Z,cz:X,radius:ee},[f,d]),ue=ls(O,z,{cx:Z,cz:X,radius:ee}),de=wM(n),me=If(z,y,m,ne.minY,ne.maxY,ee,de),pe=!R&&n.some($=>$.objects.some(B=>B.type==="shape"&&yn(B.stageKind))),Pe=!!o.house&&!pe&&!c&&(!!R||o.house.indoor),_e=y.flatMap($=>[[$.cx-$.halfX,$.cz-$.halfZ],[$.cx+$.halfX,$.cz-$.halfZ],[$.cx+$.halfX,$.cz+$.halfZ],[$.cx-$.halfX,$.cz+$.halfZ]]),xe=Pe?Yu(z.iPosition,a.length,n[0]?.baseHeightM??0,[..._e,..._],F):null;return{sharedAisles:Hc(n.flatMap($=>$.objects.flatMap(B=>{if(B.type!=="section")return[];let Y=M.bySection.get(B.id);return Y?[{sectionId:B.id,floorIndex:$.index,rows:Y.rowLevels}]:[]}))),solids:O,sectionSolidRanges:g,seats:z,seatSectionIds:M.seatOwner,bounds:{center:[(me.min[0]+me.max[0])/2,(me.min[1]+me.max[1])/2,(me.min[2]+me.max[2])/2],radius:ee,groundY:0,box:me,fitPoints:Ef(z,y,de)},...R?{room:R}:{},...pe?{outdoor:!0}:{},...xe?{house:xe}:{},renderBounds:{center:ne.center,radius:ne.radius},clipBounds:{center:ue.center,radius:ue.radius},stateColorLUT:qc(o,je),theme:o,seatCount:a.length,focalWorld:[N.x*C,1.5,N.y*C],zones:G,stages:y,productionElements:i.elements,sections:D,rows:W,labels:T,floors:j}}function wM(e){let t=[];for(let n of e)for(let o of n.objects){let r=o.type==="gaArea"?o.points:o.type==="booth"?At(o):null;for(let i of r??[])t.push([i.x*C,n.baseHeightM,i.y*C])}return t}var nn=require("ogl"),PM=.05,AM=.55,RM=12,EM=1.6,IM=1,_M=2.5,CM=650,wn={height:6,baseRadius:.16,topRadius:.3,fadeInFromM:16,fullByM:40,nearStrength:.6};function TM(e,t){if(t)return 0;let n=(e-wn.fadeInFromM)/(wn.fullByM-wn.fadeInFromM);return Math.max(wn.nearStrength,Math.min(1,n))}var Lf=24;function LM(e){let t=[],n=[],o=[],r=(m,f,h)=>{t.push(...m),n.push(...f),o.push(h)};for(let m=0;m<16;m++){let f=m/16*Math.PI*2,h=(m+1)/16*Math.PI*2,d=M=>[Math.cos(M),0,Math.sin(M)],p=[Math.cos(f)*.012,0,Math.sin(f)*.012],b=[Math.cos(h)*.012,0,Math.sin(h)*.012],x=[Math.cos(f)*.03,1,Math.sin(f)*.03],y=[Math.cos(h)*.03,1,Math.sin(h)*.03];r(p,d(f),0),r(x,d(f),0),r(y,d(h),0),r(p,d(f),0),r(y,d(h),0),r(b,d(h),0)}let c=.16,l=.24,u=.01;for(let m=0;m<48;m++){let f=m/48*Math.PI*2,h=(m+1)/48*Math.PI*2,d=[Math.cos(f)*c,u,Math.sin(f)*c],p=[Math.cos(f)*l,u,Math.sin(f)*l],b=[Math.cos(h)*l,u,Math.sin(h)*l],x=[Math.cos(h)*c,u,Math.sin(h)*c];for(let y of[d,p,b,d,b,x])r(y,[0,1,0],1)}for(let m=0;m<32;m++){let f=m/32*Math.PI*2,h=(m+1)/32*Math.PI*2,d=wn.baseRadius,p=wn.topRadius,b=[Math.cos(f)*d,0,Math.sin(f)*d],x=[Math.cos(h)*d,0,Math.sin(h)*d],y=[Math.cos(f)*p,1,Math.sin(f)*p],M=[Math.cos(h)*p,1,Math.sin(h)*p],A=[Math.cos(f),0,Math.sin(f)],w=[Math.cos(h),0,Math.sin(h)];r(b,A,2),r(y,A,2),r(M,w,2),r(b,A,2),r(M,w,2),r(x,w,2)}return new nn.Geometry(e,{position:{size:3,data:new Float32Array(t)},normal:{size:3,data:new Float32Array(n)},part:{size:1,data:new Float32Array(o)}})}var kM=`#version 300 es
21
35
  precision highp float;
22
36
  in vec3 position; in vec3 normal; in float part;
23
37
  uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform mat3 normalMatrix;
@@ -44,7 +58,7 @@ void main() {
44
58
  float scale = part > 0.5 ? uRingScale : uHeight;
45
59
  vec3 world = uSeat + vec3(position.x, position.y * grow, position.z) * scale;
46
60
  gl_Position = projectionMatrix * modelViewMatrix * vec4(world, 1.0);
47
- }`,u1=`#version 300 es
61
+ }`,OM=`#version 300 es
48
62
  precision highp float;
49
63
  in vec3 vNormal; in float vPart; in float vAlong;
50
64
  uniform vec3 uColor; uniform float uRingAlpha; uniform vec3 uBeamColor; uniform float uBeam;
@@ -62,15 +76,25 @@ void main() {
62
76
  float key = max(dot(normalize(vNormal), normalize(vec3(-0.4, 0.7, 0.6))), 0.0);
63
77
  vec3 c = uColor * (0.55 + 0.5 * key) + vec3(0.12) * pow(key, 12.0);
64
78
  fragColor = vec4(c, 1.0);
65
- }`;function m1(e){if(e>=1)return 1;if(e<.72){let n=e/.72;return 1-(1-n)*(1-n)}let t=(e-.72)/.28;return 1-.08*Math.sin(t*Math.PI)}function ya(e){return Math.max(t1,Math.min(n1,e*e1))}function f1(e){let t=.2126*e[0]+.7152*e[1]+.0722*e[2],n=t>=.25?0:Math.min(.45,(.25-t)*2.2);return e.map(o=>o+(1-o)*n)}function sm(e,t,n=[.24,.74,1]){let o=f1(n),r=new Dt.Transform,i=c1(e),a=new Map,s=(c,l)=>{let u=new Dt.Program(e,{vertex:l1,fragment:u1,uniforms:{uSeat:{value:c},uHeight:{value:1},uLift:{value:0},uRingScale:{value:1},uBeamHeight:{value:en.height},uBeam:{value:0},uBeamColor:{value:o},uColor:{value:t},uRingAlpha:{value:.85}},transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1}),m=new Dt.Mesh(e,{geometry:i,program:u});return m.frustumCulled=!1,m.setParent(r),{mesh:m,program:u,seat:c,start:l}};return{root:r,setSeats(c,l,u){let m=new Set(c.slice(0,am).map(f=>f.id));for(let[f,d]of a)m.has(f)||(d.mesh.setParent(null),a.delete(f));for(let f of c.slice(0,am))a.has(f.id)||a.set(f.id,s(f.position,u?l:-1/0))},update(c,l,u,m=!1){let f=!1;for(let d of a.values()){let h=l[0]-d.seat[0],p=l[1]-d.seat[1],b=l[2]-d.seat[2],y=Math.hypot(h,p,b);d.mesh.visible=!u&&y>(m?r1:i1);let M=ya(y),S=Math.max(0,Math.min(1,(c-d.start)/a1));S<1&&(f=!0),d.program.uniforms.uHeight.value=M,d.program.uniforms.uRingScale.value=Math.min(M,o1),d.program.uniforms.uLift.value=m?1:1-m1(S),d.program.uniforms.uBeam.value=s1(y,m),d.program.uniforms.uRingAlpha.value=.55+.4*(S<1?Math.sin(S*Math.PI):0)}return f},dispose(){for(let c of a.values())c.mesh.setParent(null);a.clear(),i.remove()}}}var d1={wheelchair:'<circle cx="10.6" cy="3.7" r="1.7" /><path d="M8.9 6.3v4.3a1.3 1.3 0 0 0 1.3 1.3h3.4l1.9 4.5h1.9" /><circle cx="9.7" cy="13.3" r="4.7" />',companion:'<circle cx="6" cy="6" r="2" /><circle cx="14" cy="6" r="2" /><path d="M2.5 16v-3.5A3.5 3.5 0 0 1 6 9a3.5 3.5 0 0 1 3.5 3.5V16M10.5 16v-3.5A3.5 3.5 0 0 1 14 9a3.5 3.5 0 0 1 3.5 3.5V16" />',"semi-ambulatory":'<circle cx="8" cy="4" r="1.7" /><path d="m8 6 2 4 3 2M10 10l-2 3-1 4M10 10l2 7M14 7l2 10" />',"designated-aisle":'<path d="M3.5 5.5v7h8.5V10H6.5M5 12.5V17M11 12.5V17" /><path d="M13.5 6.5H19M16.5 4l2.5 2.5L16.5 9" />',"step-free":'<circle cx="5.5" cy="5" r="1.7" /><path d="M5.5 7v4l3 2M2.5 16.5H8l7-7h3M8 16.5h10" />',hearing:'<path d="M7 16c-1-1.2-1.5-2.4-1.5-3.8V9a5 5 0 1 1 10 0c0 2.2-1.2 3.2-2.6 4-1.2.7-1.7 1.4-1.7 2.4A2.6 2.6 0 0 1 8.6 18" />',cart:'<path d="M8 6.5A4 4 0 1 0 8 13M17 6.5a4 4 0 1 0 0 6.5" />',"sign-language":'<path d="M6 16V8.5a1 1 0 0 1 2 0v3M8 11V5.5a1 1 0 0 1 2 0V11M10 11V4.5a1 1 0 0 1 2 0V11M12 11V6a1 1 0 0 1 2 0v6l1-1.5a1.2 1.2 0 0 1 2 1.3L14 17H9.5A3.5 3.5 0 0 1 6 13.5" />',"low-vision":'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><circle cx="10" cy="10" r="2.5" /><path d="m15 4 .5-1.5M17 5l1.5-.8" />',"sensory-friendly":'<path d="M4 11v-1a6 6 0 0 1 12 0v1M4 11h2.5v5H5a1 1 0 0 1-1-1v-4ZM16 11h-2.5v5H15a1 1 0 0 0 1-1v-4Z" /><path d="M8.5 11.5c.8.7 2.2.7 3 0M9 14c.6.4 1.4.4 2 0" />',"plus-size":'<path d="M5 9V6.5A2.5 2.5 0 0 1 7.5 4h5A2.5 2.5 0 0 1 15 6.5V9M3.5 8.5v5h13v-5M6 13.5V17M14 13.5V17" />',"lift-armrest":'<path d="M5 10V6.5A2.5 2.5 0 0 1 7.5 4h4A2.5 2.5 0 0 1 14 6.5V10M4 9v4h11V9M6 13v4M13 13v4" /><path d="M17 11V4M15 6l2-2 2 2" />',obstructedView:'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><path d="m4 17 12-14" />',restrictedView:'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><path d="M10 7.5v3.5M10 13.5h.01" />',premium:'<path d="m10 2.5 2.2 4.6 5 .7-3.6 3.5.9 5-4.5-2.4-4.5 2.4.9-5-3.6-3.5 5-.7Z" />',note:'<circle cx="10" cy="10" r="7.5" /><path d="M10 9.2v4.6M10 6.3h.01" />',aisle:'<path d="M2.5 6v7h6.5v-2.5H4.5M3.5 13v3.5M8 13v3.5" /><path d="M12.5 3v14M17 3v14" />',entrance:'<path d="M10 3.5h6.5v13H10" /><path d="M3 10h8.5M8.5 7l3 3-3 3" />',booth:'<path d="M3.5 8.5h13v8h-13ZM2.5 8.5 4 4h12l1.5 4.5M8 16.5v-4h4v4" />'};function h1(e){return d1[e]??""}function Sr(e,t={}){let n=h1(e);if(!n)return"";let o=t.size??18,r=20;return`<svg viewBox="0 0 ${r} ${r}" width="${o}" height="${o}" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round"`+(t.className?` class="${t.className}"`:"")+` aria-hidden="true" focusable="false">${n}</svg>`}var xo="#ffffff",cm="#0b1220",Mo=6,p1=80,lm=14,um=88,mm=20,fm={floor:{size:14,weight:"700",opacity:.98},stage:{size:14,weight:"700",opacity:.98},zone:{size:15,weight:"600",opacity:.95},section:{size:12,weight:"500",opacity:.88},ga:{size:12,weight:"500",opacity:.88},gate:{size:12,weight:"700",opacity:.98},booth:{size:11,weight:"500",opacity:.85},annotation:{size:11,weight:"400",opacity:.75},row:{size:11.5,weight:"700",opacity:.94},seat:{size:12.5,weight:"800",opacity:1},access:{size:12,weight:"700",opacity:1}},b1=640,y1=.8,g1=11,x1="3px 7px",M1="2px 5px",dm="rgba(10,14,22,.62)",v1="#f4f7fb",hm=5,pm=2,S1=6,vo=new Set(["row","seat","access"]),ga={stage:6,gate:5,floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},kn={row:{x:66,y:20},seat:{x:52,y:22}},tn=ye,xa=e=>us(e);function nn(e,t){let n=xa(e),o=xa(t);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}function w1(e){let t=tn(e);if(!t)return null;let n=i=>`#${i.map(a=>Math.round(Math.max(0,Math.min(1,a))*255).toString(16).padStart(2,"0")).join("")}`,o=t.map(i=>i+(1-i)*.78),r=t.map(i=>i*.62);for(let i=0;i<12&&nn(r,o)<4.5;i++)r=r.map(a=>a*.8);return{fill:n(o),ink:n(r),border:n(t.map(i=>i+(1-i)*.35)),contrast:nn(r,o)}}var P1=30;function Ma(e,t){let n=/rgba\((\d+),(\d+),(\d+),([\d.]+)\)/.exec(e.replace(/\s/g,""));if(!n)return t;let o=Math.max(0,Math.min(1,Number(n[4])));return[1,2,3].map(r=>Number(n[r])/255*o+t[r-1]*(1-o))}function A1(e,t=[.04,.06,.1],n=!0){let o=xa(t)<.42,r=o?"#f4f7fb":"#0b1220",i=o?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",a=n?Ma(i,t):t,s=tn(e),c=n?7:4.5,l=s&&nn(s,a)>=c?e:r;return o?{ink:l,backing:i,border:"rgba(210,222,245,.24)"}:{ink:l,backing:i,border:"rgba(11,18,32,.22)"}}function I1(e,t=[.04,.06,.1]){let n=Ma(dm,t),o=tn(e);return{ink:o&&nn(o,n)>=4.5?e:v1,backing:dm}}var R1=.8,On=20,E1=14,C1=60,_1='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',wr=class{constructor(t,n={}){this.nodes=new Map;this.labels=[];this.wheelchairFree=new Map;this.nodeAppearance=new WeakMap;this.forcedDense=!1;this.overviewDistance=null;this.selectedSeatLabelIds=new Set;this.narrowStage=!1;this.seatNumberRow=void 0;this.seatNumberSeat=null;this.pinHeads=[];this.opts=n,this.root=document.createElement("div"),this.root.setAttribute("data-view3d-labels","");let o=this.root.style;o.position="absolute",o.inset="0",o.pointerEvents="none",o.overflow="hidden",o.fontFamily=n.fontFamily||_1,t.appendChild(this.root)}setVisible(t){this.root.style.visibility=t?"":"hidden"}setLabels(t){this.labels=t;let n=new Set(t.map(o=>o.id));for(let[o,r]of this.nodes)n.has(o)||(r.remove(),this.nodes.delete(o))}setForcedDense(t){this.forcedDense=t}setOverviewDistance(t){this.overviewDistance=t>0?t:null}setSeatNumberRow(t){return t===this.seatNumberRow?!1:(this.seatNumberRow=t,!0)}setSeatNumberSeat(t){let n=t?`seat:${t}`:null;return n===this.seatNumberSeat?!1:(this.seatNumberSeat=n,!0)}setWheelchairFree(t){let n=t.size!==this.wheelchairFree.size;if(!n){for(let[o,r]of t)if(this.wheelchairFree.get(o)!==r){n=!0;break}}return n&&(this.wheelchairFree=new Map(t)),n}setSelectedSeatIds(t){this.selectedSeatLabelIds=new Set(Array.from(t,n=>`seat:${n}`))}sizeFor(t){let n=fm[t].size;return!this.narrowStage||vo.has(t)?n:Math.max(g1,n*y1)}qualityEvidence(){let t=this.root.getBoundingClientRect(),n=this.root.style.visibility!=="hidden";return this.labels.map(o=>{let r=this.nodes.get(o.id),i=r?.getBoundingClientRect(),a=!!(n&&r&&r.style.display!=="none"&&i&&i.width>0&&i.height>0);return{id:o.id,kind:o.kind,text:o.text,visible:a,renderedFontPx:r&&Number.parseFloat(r.style.fontSize)||0,contrast:r?Number(r.dataset.qualityContrast??0):0,...a&&i?{screenBox:{x:i.x-t.x,y:i.y-t.y,width:i.width,height:i.height}}:{}}})}update(t,n,o,r,i,a){if(!this.labels.length)return;this.narrowStage=n>0&&n<b1;let s=Cu(r,i,{hasZoneLabels:this.labels.some(v=>v.kind==="zone")});this.forcedDense&&(s.add("row"),s.add("seat"),s.add("access")),!this.forcedDense&&this.overviewDistance!==null&&r>this.overviewDistance*R1&&(s.delete("section"),s.delete("ga")),s.has("section")&&this.labels.some(v=>v.kind==="section")&&s.delete("zone");let c=[];for(let v of this.labels){let P=v.kind==="annotation"&&!!v.venueIcon;if(!s.has(v.kind)&&!P&&!(v.kind==="seat"&&this.selectedSeatLabelIds.has(v.id)))continue;let R=v.kind==="seat"&&a&&this.selectedSeatLabelIds.has(v.id)?v.pinBase:void 0,k=R&&a?[R[0],R[1]+ya(Math.hypot(R[0]-a[0],R[1]-a[1],R[2]-a[2])),R[2]]:v.anchor,F=gt(t,k,n,o);if(!F.visible)continue;let E=vo.has(v.kind),I=this.sizeFor(v.kind),C=v.kind==="access"?On:Lu(v.text,I,!E)+(E?hm*2:0)+((this.wheelchairFree.get(v.id)??0)>0?P1:0);if(v.kind==="access"&&v.seatWidthM!==void 0&&ua(t,v.anchor,v.seatWidthM,n)<E1||v.kind==="seat"&&v.seatWidthM!==void 0&&!this.selectedSeatLabelIds.has(v.id)&&ua(t,v.anchor,v.seatWidthM,n)<Math.max(22,C))continue;let L=_u(F,C/2,I/2+(E?pm:4),n,o),N=a?Math.hypot(v.anchor[0]-a[0],v.anchor[1]-a[1],v.anchor[2]-a[2]):1;c.push({label:v,screen:L,focus:Ou(L,N,n,o),halfWidth:C/2,...this.selectedSeatLabelIds.has(v.id)?{priority:1}:{}})}let l=Eu(c.filter(v=>v.label.kind==="floor"),n),u=[...c.filter(v=>!vo.has(v.label.kind)&&v.label.kind!=="floor"),...l],m=ku(n),f=c.filter(v=>v.label.kind==="seat"&&this.selectedSeatLabelIds.has(v.label.id)),d=yo(f,kn.seat.x,kn.seat.y,m.seat);this.placePinHeads(f.filter(v=>v.label.pinBase&&!d.includes(v)).map(v=>v.screen));let h=Tu(u,um,mm,v=>ga[v.label.kind]??0).filter(v=>!d.some(P=>bo(v,P,um,mm))),p=yo(c.filter(v=>v.label.kind==="access"),On,On,C1,[...h,...d]),b=yo(c.filter(v=>v.label.kind==="row"),kn.row.x,kn.row.y,m.row,[...h,...d,...p]),y=this.seatNumberRow!==void 0||this.seatNumberSeat!==null,M=yo(c.filter(v=>v.label.kind==="seat"&&!this.selectedSeatLabelIds.has(v.label.id)&&(this.seatNumberSeat!==null?v.label.id===this.seatNumberSeat:!y||this.seatNumberRow!==null&&v.label.rowId===this.seatNumberRow)),kn.seat.x,kn.seat.y,y?p1:m.seat-d.length,[...h,...d,...p,...b]),S=[...h,...p,...b,...d,...M],A=new Set(S.map(v=>v.label.id));for(let{label:v,screen:P}of S){let k=this.nodeFor(v).style;k.display=v.kind==="access"?"flex":v.kind==="gate"?"inline-flex":"";let F=!!v.pinBase&&this.selectedSeatLabelIds.has(v.id);k.transform=F?`translate(-50%, -100%) translate(${P.x.toFixed(1)}px, ${(P.y-Mo).toFixed(1)}px)`:`translate(-50%, -50%) translate(${P.x.toFixed(1)}px, ${P.y.toFixed(1)}px)`}let g=S.filter(({label:v})=>!vo.has(v.kind)).sort((v,P)=>ga[P.label.kind]-ga[v.label.kind]||v.screen.depth-P.screen.depth||v.focus-P.focus).flatMap(({label:v})=>{let P=this.nodes.get(v.id);return P&&P.style.display!=="none"?[{node:P,box:P.getBoundingClientRect()}]:[]}),w=[];for(let{node:v,box:P}of g)w.some(k=>P.left<k.right+3&&P.right+3>k.left&&P.top<k.bottom+3&&P.bottom+3>k.top)?v.style.display="none":w.push(P);for(let[v,P]of this.nodes)A.has(v)||(P.style.display="none")}nodeFor(t){let n=this.nodes.get(t.id);if(!n){n=document.createElement("div");let y=n.style;y.position="absolute",y.left="0",y.top="0",y.whiteSpace="nowrap",y.display="none",this.root.appendChild(n),this.nodes.set(t.id,n)}let o=this.selectedSeatLabelIds.has(t.id),r=this.nodeAppearance.get(n),i=this.wheelchairFree.get(t.id)??0,a=t.text+(t.icon??"")+(t.venueIcon??"")+(t.tint??"")+(i>0?`|${i}`:"");if(r&&r.text===a&&r.kind===t.kind&&r.color===t.color&&r.selected===o&&r.narrow===this.narrowStage)return n;if(this.nodeAppearance.set(n,{text:a,kind:t.kind,color:t.color,selected:o,narrow:this.narrowStage}),t.kind==="access")return this.paintAccessChip(n,t);if(n.textContent=t.text,o){let y=document.createElement("span"),M=y.style;M.position="absolute",M.left="50%",M.bottom=`-${Mo}px`,M.transform="translateX(-50%)",M.borderLeft=`${Mo}px solid transparent`,M.borderRight=`${Mo}px solid transparent`,M.borderTop=`${Mo}px solid ${xo}`,n.appendChild(y)}n.setAttribute("data-label-kind",t.kind),n.toggleAttribute("data-selected-seat",o);let s=fm[t.kind],c=n.style;c.fontSize=`${this.sizeFor(t.kind)}px`,c.fontWeight=o?"800":s.weight,c.opacity=o?"1":String(s.opacity);let l=vo.has(t.kind),u=!l,m=A1(t.color??this.opts.ink,this.opts.backgroundRgb,!0),f=l?I1(t.color??this.opts.ink,this.opts.backgroundRgb):m;c.color=o?cm:f.ink,c.background=o?xo:f.backing,c.border=o?`1px solid ${xo}`:u?`1px solid ${m.border}`:"",c.borderRadius=o||u?"999px":`${S1}px`;let d=this.narrowStage?M1:x1;c.padding=o||u?d:`${pm}px ${hm}px`,c.lineHeight=l?"1.1":"",c.boxShadow=o?"0 0 0 3px rgba(255,255,255,.28), 0 0 18px rgba(255,255,255,.55), 0 5px 14px rgba(0,0,0,.45)":u?"0 3px 10px rgba(0,0,0,.24)":"0 1px 4px rgba(0,0,0,.28)",c.textShadow=o||u?"none":"0 1px 1px rgba(0,0,0,0.4)",c.letterSpacing=t.kind==="zone"||t.kind==="floor"?"0.08em":"0.02em";let h=this.opts.backgroundRgb??[.04,.06,.1],p=tn(o?cm:f.ink)??[1,1,1],b=Ma(o?xo:f.backing,h);return n.dataset.qualityContrast=nn(p,b).toFixed(3),c.textTransform=t.kind==="zone"||t.kind==="floor"?"uppercase":"",t.kind==="section"&&this.dressSectionTag(n,t,i),t.kind==="gate"&&this.dressGateTag(n,t),t.venueIcon&&this.dressVenueIconTag(n,t.venueIcon),n}dressVenueIconTag(t,n){let o=so(n);if(!o)return;let r=t.style;r.display="inline-flex",r.alignItems="center",r.gap="5px";let i=16,a=Oi.glyphScale,s=document.createElement("span");s.setAttribute("aria-hidden","true"),s.setAttribute("data-venue-icon",o.key),s.style.lineHeight="0",s.innerHTML=`<svg width="${i}" height="${i}" viewBox="0 0 24 24"><circle cx="12" cy="12" r="11.25" fill="${ki[o.group]}" stroke="${er}" stroke-width="1.5"/><path transform="translate(${12-12*a} ${12-12*a}) scale(${a})" d="${o.solid}" fill="${er}"/></svg>`,t.prepend(s)}dressGateTag(t,n){let o=t.style;o.background="#0f172a",o.color="#ffffff",o.border="1px solid rgba(255,255,255,0.28)",o.textTransform="uppercase",o.letterSpacing="0.06em",o.display="inline-flex",o.alignItems="center",o.gap="5px";let r=document.createElement("span");if(r.setAttribute("aria-hidden","true"),r.setAttribute("data-gate-arrow",n.icon==="exit"?"out":"in"),r.innerHTML=n.icon==="exit"?'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M5 1.5H2v9h3"/><path d="M5.5 6h5M8.5 3.5 11 6 8.5 8.5"/></svg>':'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M7 1.5h3v9H7"/><path d="M1 6h5.5M4 3.5 6.5 6 4 8.5"/></svg>',t.prepend(r),n.stepFree){let i=document.createElement("span");i.setAttribute("data-gate-step-free","true"),i.setAttribute("aria-label","Step-free"),i.style.lineHeight="0",i.innerHTML=Sr("wheelchair",{size:11}),t.append(i)}t.dataset.qualityContrast=nn([1,1,1],tn("#0f172a")).toFixed(3)}dressSectionTag(t,n,o){let r=n.tint?w1(n.tint):null,i=t.style;if(r&&(i.background=r.fill,i.color=r.ink,i.border=`1px solid ${r.border}`,t.dataset.qualityContrast=r.contrast.toFixed(3)),o<=0)return;let a=document.createElement("span");a.setAttribute("data-wheelchair-free",String(o)),a.setAttribute("aria-label",`${o} wheelchair ${o===1?"place":"places"} free`),a.innerHTML=`${Sr("wheelchair",{size:11})}<span>${o}</span>`;let s=a.style;s.display="inline-flex",s.alignItems="center",s.gap="2px",s.marginLeft="6px",s.padding="1px 5px",s.borderRadius="999px",s.background="#2563eb",s.color="#ffffff",s.fontSize="0.85em",s.lineHeight="1.2",s.verticalAlign="middle",t.appendChild(a)}paintAccessChip(t,n){t.setAttribute("data-label-kind","access"),t.setAttribute("data-access-type",n.icon??""),t.innerHTML=n.icon?Sr(n.icon,{size:On-6}):"",t.setAttribute("role","img"),t.setAttribute("aria-label",n.text);let o=t.style;return o.width=`${On}px`,o.height=`${On}px`,o.alignItems="center",o.justifyContent="center",o.borderRadius="50%",o.background=n.color??"#3b82f6",o.color=n.ink??"#ffffff",o.border="1.5px solid #ffffff",o.boxShadow="0 2px 6px rgba(0,0,0,.35)",o.padding="0",o.lineHeight="0",o.boxSizing="border-box",t.dataset.qualityContrast=nn(tn(n.ink??"#ffffff")??[1,1,1],tn(n.color??"#3b82f6")??[.23,.51,.96]).toFixed(3),t}placePinHeads(t){for(;this.pinHeads.length<t.length;){let n=document.createElement("div");n.setAttribute("data-pin-head",""),n.setAttribute("aria-hidden","true");let o=n.style;o.position="absolute",o.left="0",o.top="0",o.width=`${lm}px`,o.height=`${lm}px`,o.borderRadius="50%",o.background=xo,o.boxShadow="0 0 0 3px rgba(255,255,255,.28), 0 0 14px rgba(255,255,255,.55), 0 3px 8px rgba(0,0,0,.45)",o.pointerEvents="none",this.root.appendChild(n),this.pinHeads.push(n)}this.pinHeads.forEach((n,o)=>{let r=t[o];n.style.display=r?"":"none",r&&(n.style.transform=`translate(-50%, -100%) translate(${r.x.toFixed(1)}px, ${r.y.toFixed(1)}px)`)})}dispose(){this.pinHeads=[],this.root.remove(),this.nodes.clear()}};var ym=1;var T1=new Set(["floor","stage","zone","section","ga","booth","annotation"]);function L1(e){return e.every(t=>Number.isFinite(t))}function k1(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function bm(e){return e.length?Math.round(Math.min(...e)*100)/100:null}function on(e){return Math.round(e*1e4)/1e4}function O1(e){if(e)return{box:{x:on(e.box.x),y:on(e.box.y),width:on(e.box.width),height:on(e.box.height)},horizontalFillRatio:on(e.horizontalFillRatio),verticalFillRatio:on(e.verticalFillRatio),visibleAreaRatio:on(e.visibleAreaRatio),clippedEdges:[...e.clippedEdges]}}function xt(e,t,n){return n.length?{code:e,message:t,count:n.length,samples:n.slice(0,20)}:null}function Pr(e){let t=e.labels.filter(s=>s.visible&&s.screenBox),n=t.filter(s=>T1.has(s.kind)),o=e.scene.floorCount>1?e.scene.floorCount:e.scene.zoneCount||e.scene.sectionCount,r=[];for(let s=0;s<n.length;s+=1)for(let c=0;c<s;c+=1)k1(n[s].screenBox,n[c].screenBox)&&r.push({primaryId:n[s].id,primaryLabel:n[s].text,secondaryId:n[c].id});let i=[...e.camera.position,e.camera.distance,e.camera.verticalFovDeg],a=[xt("webgl2-unavailable","The venue scene must render through WebGL2",e.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),xt("context-lost","The WebGL context must be live at capture",e.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),xt("frame-not-stable","The captured 3D frame must be rendered and parked",e.frame.rendered>0&&e.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),xt("viewport-empty","The 3D viewport must have visible dimensions",e.viewport.width>1&&e.viewport.height>1?[]:[{primaryId:"viewport",primaryLabel:`${e.viewport.width}\xD7${e.viewport.height}`}]),xt("camera-invalid","The capture camera must have a finite physical pose",L1(i)&&e.camera.distance>0&&e.camera.verticalFovDeg>0&&e.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),xt("authored-relief-not-visible","Authored 3D height or rake must produce visible screen-space relief",!e.scene.authoredRelief||e.scene.renderedVerticalSpanM>.05&&e.scene.projectedReliefPx>=2?[]:[{primaryId:"scene",primaryLabel:"authored relief",measured:e.scene.projectedReliefPx,minimum:2}]),xt("hierarchy-label-missing","A venue with authored hierarchy must show at least one structural label",o===0||n.length>0?[]:[{primaryId:"labels",primaryLabel:`${o} expected hierarchy labels`}]),xt("hierarchy-label-undersized","Visible 3D hierarchy labels must remain readable",n.filter(s=>s.renderedFontPx<11).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.renderedFontPx,minimum:11}))),xt("hierarchy-label-contrast-low","Visible 3D hierarchy labels must meet text contrast",n.filter(s=>s.contrast<4.5).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.contrast,minimum:4.5}))),xt("hierarchy-label-collision","Visible 3D hierarchy labels must not overlap",r)].filter(s=>!!s);return{version:1,state:"venue3d",passed:a.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:e.viewport,context:e.context,frame:e.frame,camera:e.camera,scene:e.scene,composition:{visibleLabels:t.map(({id:s,kind:c,text:l})=>({id:s,kind:c,text:l})).sort((s,c)=>s.kind.localeCompare(c.kind)||s.id.localeCompare(c.id)),framing:O1(e.framing)},metrics:{minimumHierarchyFontPx:bm(n.map(s=>s.renderedFontPx)),minimumHierarchyContrast:bm(n.map(s=>s.contrast)),projectedReliefPx:Math.round(e.scene.projectedReliefPx*100)/100},findings:a}}function gm(e,t,n){e.fill(0);for(let o=0;o<Math.min(n,t.length);o++)e[t[o]]=1}var Ne=require("ogl");var Nt=require("ogl");var Ar=`
79
+ }`;function FM(e){if(e>=1)return 1;if(e<.72){let n=e/.72;return 1-(1-n)*(1-n)}let t=(e-.72)/.28;return 1-.08*Math.sin(t*Math.PI)}function us(e){return Math.max(AM,Math.min(RM,e*PM))}function DM(e){let t=.2126*e[0]+.7152*e[1]+.0722*e[2],n=t>=.25?0:Math.min(.45,(.25-t)*2.2);return e.map(o=>o+(1-o)*n)}function kf(e,t,n=[.24,.74,1]){let o=DM(n),r=new nn.Transform,i=LM(e),a=new Map,s=(c,l)=>{let u=new nn.Program(e,{vertex:kM,fragment:OM,uniforms:{uSeat:{value:c},uHeight:{value:1},uLift:{value:0},uRingScale:{value:1},uBeamHeight:{value:wn.height},uBeam:{value:0},uBeamColor:{value:o},uColor:{value:t},uRingAlpha:{value:.85}},transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1}),m=new nn.Mesh(e,{geometry:i,program:u});return m.frustumCulled=!1,m.setParent(r),{mesh:m,program:u,seat:c,start:l}};return{root:r,setSeats(c,l,u){let m=new Set(c.slice(0,Lf).map(f=>f.id));for(let[f,h]of a)m.has(f)||(h.mesh.setParent(null),a.delete(f));for(let f of c.slice(0,Lf))a.has(f.id)||a.set(f.id,s(f.position,u?l:-1/0))},update(c,l,u,m=!1){let f=!1;for(let h of a.values()){let d=l[0]-h.seat[0],p=l[1]-h.seat[1],b=l[2]-h.seat[2],x=Math.hypot(d,p,b);h.mesh.visible=!u&&x>(m?IM:_M);let y=us(x),M=Math.max(0,Math.min(1,(c-h.start)/CM));M<1&&(f=!0),h.program.uniforms.uHeight.value=y,h.program.uniforms.uRingScale.value=Math.min(y,EM),h.program.uniforms.uLift.value=m?1:1-FM(M),h.program.uniforms.uBeam.value=TM(x,m),h.program.uniforms.uRingAlpha.value=.55+.4*(M<1?Math.sin(M*Math.PI):0)}return f},dispose(){for(let c of a.values())c.mesh.setParent(null);a.clear(),i.remove()}}}var NM={wheelchair:'<circle cx="10.6" cy="3.7" r="1.7" /><path d="M8.9 6.3v4.3a1.3 1.3 0 0 0 1.3 1.3h3.4l1.9 4.5h1.9" /><circle cx="9.7" cy="13.3" r="4.7" />',companion:'<circle cx="6" cy="6" r="2" /><circle cx="14" cy="6" r="2" /><path d="M2.5 16v-3.5A3.5 3.5 0 0 1 6 9a3.5 3.5 0 0 1 3.5 3.5V16M10.5 16v-3.5A3.5 3.5 0 0 1 14 9a3.5 3.5 0 0 1 3.5 3.5V16" />',"semi-ambulatory":'<circle cx="8" cy="4" r="1.7" /><path d="m8 6 2 4 3 2M10 10l-2 3-1 4M10 10l2 7M14 7l2 10" />',"designated-aisle":'<path d="M3.5 5.5v7h8.5V10H6.5M5 12.5V17M11 12.5V17" /><path d="M13.5 6.5H19M16.5 4l2.5 2.5L16.5 9" />',"step-free":'<circle cx="5.5" cy="5" r="1.7" /><path d="M5.5 7v4l3 2M2.5 16.5H8l7-7h3M8 16.5h10" />',hearing:'<path d="M7 16c-1-1.2-1.5-2.4-1.5-3.8V9a5 5 0 1 1 10 0c0 2.2-1.2 3.2-2.6 4-1.2.7-1.7 1.4-1.7 2.4A2.6 2.6 0 0 1 8.6 18" />',cart:'<path d="M8 6.5A4 4 0 1 0 8 13M17 6.5a4 4 0 1 0 0 6.5" />',"sign-language":'<path d="M6 16V8.5a1 1 0 0 1 2 0v3M8 11V5.5a1 1 0 0 1 2 0V11M10 11V4.5a1 1 0 0 1 2 0V11M12 11V6a1 1 0 0 1 2 0v6l1-1.5a1.2 1.2 0 0 1 2 1.3L14 17H9.5A3.5 3.5 0 0 1 6 13.5" />',"low-vision":'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><circle cx="10" cy="10" r="2.5" /><path d="m15 4 .5-1.5M17 5l1.5-.8" />',"sensory-friendly":'<path d="M4 11v-1a6 6 0 0 1 12 0v1M4 11h2.5v5H5a1 1 0 0 1-1-1v-4ZM16 11h-2.5v5H15a1 1 0 0 0 1-1v-4Z" /><path d="M8.5 11.5c.8.7 2.2.7 3 0M9 14c.6.4 1.4.4 2 0" />',"plus-size":'<path d="M5 9V6.5A2.5 2.5 0 0 1 7.5 4h5A2.5 2.5 0 0 1 15 6.5V9M3.5 8.5v5h13v-5M6 13.5V17M14 13.5V17" />',"lift-armrest":'<path d="M5 10V6.5A2.5 2.5 0 0 1 7.5 4h4A2.5 2.5 0 0 1 14 6.5V10M4 9v4h11V9M6 13v4M13 13v4" /><path d="M17 11V4M15 6l2-2 2 2" />',obstructedView:'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><path d="m4 17 12-14" />',restrictedView:'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><path d="M10 7.5v3.5M10 13.5h.01" />',premium:'<path d="m10 2.5 2.2 4.6 5 .7-3.6 3.5.9 5-4.5-2.4-4.5 2.4.9-5-3.6-3.5 5-.7Z" />',note:'<circle cx="10" cy="10" r="7.5" /><path d="M10 9.2v4.6M10 6.3h.01" />',aisle:'<path d="M2.5 6v7h6.5v-2.5H4.5M3.5 13v3.5M8 13v3.5" /><path d="M12.5 3v14M17 3v14" />',entrance:'<path d="M10 3.5h6.5v13H10" /><path d="M3 10h8.5M8.5 7l3 3-3 3" />',booth:'<path d="M3.5 8.5h13v8h-13ZM2.5 8.5 4 4h12l1.5 4.5M8 16.5v-4h4v4" />'};function BM(e){return NM[e]??""}function ti(e,t={}){let n=BM(e);if(!n)return"";let o=t.size??18,r=20;return`<svg viewBox="0 0 ${r} ${r}" width="${o}" height="${o}" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round"`+(t.className?` class="${t.className}"`:"")+` aria-hidden="true" focusable="false">${n}</svg>`}var Xo="#ffffff",Of="#0b1220",Ko=6,VM=80,Ff=14,Df=88,Nf=20,Bf={floor:{size:14,weight:"700",opacity:.98},stage:{size:14,weight:"700",opacity:.98},zone:{size:15,weight:"600",opacity:.95},section:{size:12,weight:"500",opacity:.88},ga:{size:12,weight:"500",opacity:.88},gate:{size:12,weight:"700",opacity:.98},booth:{size:11,weight:"500",opacity:.85},annotation:{size:11,weight:"400",opacity:.75},row:{size:11.5,weight:"700",opacity:.94},seat:{size:12.5,weight:"800",opacity:1},access:{size:12,weight:"700",opacity:1}},GM=640,HM=.8,zM=11,UM="3px 7px",jM="2px 5px",Vf="rgba(10,14,22,.62)",WM="#f4f7fb",Gf=5,Hf=2,XM=6,Yo=new Set(["row","seat","access"]),ms={stage:6,gate:5,floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},oo={row:{x:66,y:20},seat:{x:52,y:22}},Pn=ve,fs=e=>mc(e);function An(e,t){let n=fs(e),o=fs(t);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}function KM(e){let t=Pn(e);if(!t)return null;let n=i=>`#${i.map(a=>Math.round(Math.max(0,Math.min(1,a))*255).toString(16).padStart(2,"0")).join("")}`,o=t.map(i=>i+(1-i)*.78),r=t.map(i=>i*.62);for(let i=0;i<12&&An(r,o)<4.5;i++)r=r.map(a=>a*.8);return{fill:n(o),ink:n(r),border:n(t.map(i=>i+(1-i)*.35)),contrast:An(r,o)}}var YM=30;function hs(e,t){let n=/rgba\((\d+),(\d+),(\d+),([\d.]+)\)/.exec(e.replace(/\s/g,""));if(!n)return t;let o=Math.max(0,Math.min(1,Number(n[4])));return[1,2,3].map(r=>Number(n[r])/255*o+t[r-1]*(1-o))}function $M(e,t=[.04,.06,.1],n=!0){let o=fs(t)<.42,r=o?"#f4f7fb":"#0b1220",i=o?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",a=n?hs(i,t):t,s=Pn(e),c=n?7:4.5,l=s&&An(s,a)>=c?e:r;return o?{ink:l,backing:i,border:"rgba(210,222,245,.24)"}:{ink:l,backing:i,border:"rgba(11,18,32,.22)"}}function ZM(e,t=[.04,.06,.1]){let n=hs(Vf,t),o=Pn(e);return{ink:o&&An(o,n)>=4.5?e:WM,backing:Vf}}var qM=.8,ro=20,QM=14,JM=60,ev='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',ni=class{constructor(t,n={}){this.nodes=new Map;this.labels=[];this.wheelchairFree=new Map;this.nodeAppearance=new WeakMap;this.forcedDense=!1;this.overviewDistance=null;this.selectedSeatLabelIds=new Set;this.narrowStage=!1;this.seatNumberRow=void 0;this.seatNumberSeat=null;this.pinHeads=[];this.opts=n,this.root=document.createElement("div"),this.root.setAttribute("data-view3d-labels","");let o=this.root.style;o.position="absolute",o.inset="0",o.pointerEvents="none",o.overflow="hidden",o.fontFamily=n.fontFamily||ev,t.appendChild(this.root)}setVisible(t){this.root.style.visibility=t?"":"hidden"}setLabels(t){this.labels=t;let n=new Set(t.map(o=>o.id));for(let[o,r]of this.nodes)n.has(o)||(r.remove(),this.nodes.delete(o))}setForcedDense(t){this.forcedDense=t}setOverviewDistance(t){this.overviewDistance=t>0?t:null}setSeatNumberRow(t){return t===this.seatNumberRow?!1:(this.seatNumberRow=t,!0)}setSeatNumberSeat(t){let n=t?`seat:${t}`:null;return n===this.seatNumberSeat?!1:(this.seatNumberSeat=n,!0)}setWheelchairFree(t){let n=t.size!==this.wheelchairFree.size;if(!n){for(let[o,r]of t)if(this.wheelchairFree.get(o)!==r){n=!0;break}}return n&&(this.wheelchairFree=new Map(t)),n}setSelectedSeatIds(t){this.selectedSeatLabelIds=new Set(Array.from(t,n=>`seat:${n}`))}sizeFor(t){let n=Bf[t].size;return!this.narrowStage||Yo.has(t)?n:Math.max(zM,n*HM)}qualityEvidence(){let t=this.root.getBoundingClientRect(),n=this.root.style.visibility!=="hidden";return this.labels.map(o=>{let r=this.nodes.get(o.id),i=r?.getBoundingClientRect(),a=!!(n&&r&&r.style.display!=="none"&&i&&i.width>0&&i.height>0);return{id:o.id,kind:o.kind,text:o.text,visible:a,renderedFontPx:r&&Number.parseFloat(r.style.fontSize)||0,contrast:r?Number(r.dataset.qualityContrast??0):0,...a&&i?{screenBox:{x:i.x-t.x,y:i.y-t.y,width:i.width,height:i.height}}:{}}})}update(t,n,o,r,i,a){if(!this.labels.length)return;this.narrowStage=n>0&&n<GM;let s=tf(r,i,{hasZoneLabels:this.labels.some(v=>v.kind==="zone")});this.forcedDense&&(s.add("row"),s.add("seat"),s.add("access")),!this.forcedDense&&this.overviewDistance!==null&&r>this.overviewDistance*qM&&(s.delete("section"),s.delete("ga")),s.has("section")&&this.labels.some(v=>v.kind==="section")&&s.delete("zone");let c=[];for(let v of this.labels){let P=v.kind==="annotation"&&!!v.venueIcon;if(!s.has(v.kind)&&!P&&!(v.kind==="seat"&&this.selectedSeatLabelIds.has(v.id)))continue;let E=v.kind==="seat"&&a&&this.selectedSeatLabelIds.has(v.id)?v.pinBase:void 0,k=E&&a?[E[0],E[1]+us(Math.hypot(E[0]-a[0],E[1]-a[1],E[2]-a[2])),E[2]]:v.anchor,L=Ot(t,k,n,o);if(!L.visible)continue;let I=Yo.has(v.kind),R=this.sizeFor(v.kind),_=v.kind==="access"?ro:rf(v.text,R,!I)+(I?Gf*2:0)+((this.wheelchairFree.get(v.id)??0)>0?YM:0);if(v.kind==="access"&&v.seatWidthM!==void 0&&es(t,v.anchor,v.seatWidthM,n)<QM||v.kind==="seat"&&v.seatWidthM!==void 0&&!this.selectedSeatLabelIds.has(v.id)&&es(t,v.anchor,v.seatWidthM,n)<Math.max(22,_))continue;let F=nf(L,_/2,R/2+(I?Hf:4),n,o),N=a?Math.hypot(v.anchor[0]-a[0],v.anchor[1]-a[1],v.anchor[2]-a[2]):1;c.push({label:v,screen:F,focus:sf(F,N,n,o),halfWidth:_/2,...this.selectedSeatLabelIds.has(v.id)?{priority:1}:{}})}let l=ef(c.filter(v=>v.label.kind==="floor"),n),u=[...c.filter(v=>!Yo.has(v.label.kind)&&v.label.kind!=="floor"),...l],m=af(n),f=c.filter(v=>v.label.kind==="seat"&&this.selectedSeatLabelIds.has(v.label.id)),h=Uo(f,oo.seat.x,oo.seat.y,m.seat);this.placePinHeads(f.filter(v=>v.label.pinBase&&!h.includes(v)).map(v=>v.screen));let d=of(u,Df,Nf,v=>ms[v.label.kind]??0).filter(v=>!h.some(P=>zo(v,P,Df,Nf))),p=Uo(c.filter(v=>v.label.kind==="access"),ro,ro,JM,[...d,...h]),b=Uo(c.filter(v=>v.label.kind==="row"),oo.row.x,oo.row.y,m.row,[...d,...h,...p]),x=this.seatNumberRow!==void 0||this.seatNumberSeat!==null,y=Uo(c.filter(v=>v.label.kind==="seat"&&!this.selectedSeatLabelIds.has(v.label.id)&&(this.seatNumberSeat!==null?v.label.id===this.seatNumberSeat:!x||this.seatNumberRow!==null&&v.label.rowId===this.seatNumberRow)),oo.seat.x,oo.seat.y,x?VM:m.seat-h.length,[...d,...h,...p,...b]),M=[...d,...p,...b,...h,...y],A=new Set(M.map(v=>v.label.id));for(let{label:v,screen:P}of M){let k=this.nodeFor(v).style;k.display=v.kind==="access"?"flex":v.kind==="gate"?"inline-flex":"";let L=!!v.pinBase&&this.selectedSeatLabelIds.has(v.id);k.transform=L?`translate(-50%, -100%) translate(${P.x.toFixed(1)}px, ${(P.y-Ko).toFixed(1)}px)`:`translate(-50%, -50%) translate(${P.x.toFixed(1)}px, ${P.y.toFixed(1)}px)`}let g=M.filter(({label:v})=>!Yo.has(v.kind)).sort((v,P)=>ms[P.label.kind]-ms[v.label.kind]||v.screen.depth-P.screen.depth||v.focus-P.focus).flatMap(({label:v})=>{let P=this.nodes.get(v.id);return P&&P.style.display!=="none"?[{node:P,box:P.getBoundingClientRect()}]:[]}),S=[];for(let{node:v,box:P}of g)S.some(k=>P.left<k.right+3&&P.right+3>k.left&&P.top<k.bottom+3&&P.bottom+3>k.top)?v.style.display="none":S.push(P);for(let[v,P]of this.nodes)A.has(v)||(P.style.display="none")}nodeFor(t){let n=this.nodes.get(t.id);if(!n){n=document.createElement("div");let x=n.style;x.position="absolute",x.left="0",x.top="0",x.whiteSpace="nowrap",x.display="none",this.root.appendChild(n),this.nodes.set(t.id,n)}let o=this.selectedSeatLabelIds.has(t.id),r=this.nodeAppearance.get(n),i=this.wheelchairFree.get(t.id)??0,a=t.text+(t.icon??"")+(t.venueIcon??"")+(t.tint??"")+(i>0?`|${i}`:"");if(r&&r.text===a&&r.kind===t.kind&&r.color===t.color&&r.selected===o&&r.narrow===this.narrowStage)return n;if(this.nodeAppearance.set(n,{text:a,kind:t.kind,color:t.color,selected:o,narrow:this.narrowStage}),t.kind==="access")return this.paintAccessChip(n,t);if(n.textContent=t.text,o){let x=document.createElement("span"),y=x.style;y.position="absolute",y.left="50%",y.bottom=`-${Ko}px`,y.transform="translateX(-50%)",y.borderLeft=`${Ko}px solid transparent`,y.borderRight=`${Ko}px solid transparent`,y.borderTop=`${Ko}px solid ${Xo}`,n.appendChild(x)}n.setAttribute("data-label-kind",t.kind),n.toggleAttribute("data-selected-seat",o);let s=Bf[t.kind],c=n.style;c.fontSize=`${this.sizeFor(t.kind)}px`,c.fontWeight=o?"800":s.weight,c.opacity=o?"1":String(s.opacity);let l=Yo.has(t.kind),u=!l,m=$M(t.color??this.opts.ink,this.opts.backgroundRgb,!0),f=l?ZM(t.color??this.opts.ink,this.opts.backgroundRgb):m;c.color=o?Of:f.ink,c.background=o?Xo:f.backing,c.border=o?`1px solid ${Xo}`:u?`1px solid ${m.border}`:"",c.borderRadius=o||u?"999px":`${XM}px`;let h=this.narrowStage?jM:UM;c.padding=o||u?h:`${Hf}px ${Gf}px`,c.lineHeight=l?"1.1":"",c.boxShadow=o?"0 0 0 3px rgba(255,255,255,.28), 0 0 18px rgba(255,255,255,.55), 0 5px 14px rgba(0,0,0,.45)":u?"0 3px 10px rgba(0,0,0,.24)":"0 1px 4px rgba(0,0,0,.28)",c.textShadow=o||u?"none":"0 1px 1px rgba(0,0,0,0.4)",c.letterSpacing=t.kind==="zone"||t.kind==="floor"?"0.08em":"0.02em";let d=this.opts.backgroundRgb??[.04,.06,.1],p=Pn(o?Of:f.ink)??[1,1,1],b=hs(o?Xo:f.backing,d);return n.dataset.qualityContrast=An(p,b).toFixed(3),c.textTransform=t.kind==="zone"||t.kind==="floor"?"uppercase":"",t.kind==="section"&&this.dressSectionTag(n,t,i),t.kind==="gate"&&this.dressGateTag(n,t),t.venueIcon&&this.dressVenueIconTag(n,t.venueIcon),n}dressVenueIconTag(t,n){let o=Fo(n);if(!o)return;let r=t.style;r.display="inline-flex",r.alignItems="center",r.gap="5px";let i=16,a=_a.glyphScale,s=document.createElement("span");s.setAttribute("aria-hidden","true"),s.setAttribute("data-venue-icon",o.key),s.style.lineHeight="0",s.innerHTML=`<svg width="${i}" height="${i}" viewBox="0 0 24 24"><circle cx="12" cy="12" r="11.25" fill="${Ia[o.group]}" stroke="${Br}" stroke-width="1.5"/><path transform="translate(${12-12*a} ${12-12*a}) scale(${a})" d="${o.solid}" fill="${Br}"/></svg>`,t.prepend(s)}dressGateTag(t,n){let o=t.style;o.background="#0f172a",o.color="#ffffff",o.border="1px solid rgba(255,255,255,0.28)",o.textTransform="uppercase",o.letterSpacing="0.06em",o.display="inline-flex",o.alignItems="center",o.gap="5px";let r=document.createElement("span");if(r.setAttribute("aria-hidden","true"),r.setAttribute("data-gate-arrow",n.icon==="exit"?"out":"in"),r.innerHTML=n.icon==="exit"?'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M5 1.5H2v9h3"/><path d="M5.5 6h5M8.5 3.5 11 6 8.5 8.5"/></svg>':'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M7 1.5h3v9H7"/><path d="M1 6h5.5M4 3.5 6.5 6 4 8.5"/></svg>',t.prepend(r),n.stepFree){let i=document.createElement("span");i.setAttribute("data-gate-step-free","true"),i.setAttribute("aria-label","Step-free"),i.style.lineHeight="0",i.innerHTML=ti("wheelchair",{size:11}),t.append(i)}t.dataset.qualityContrast=An([1,1,1],Pn("#0f172a")).toFixed(3)}dressSectionTag(t,n,o){let r=n.tint?KM(n.tint):null,i=t.style;if(r&&(i.background=r.fill,i.color=r.ink,i.border=`1px solid ${r.border}`,t.dataset.qualityContrast=r.contrast.toFixed(3)),o<=0)return;let a=document.createElement("span");a.setAttribute("data-wheelchair-free",String(o)),a.setAttribute("aria-label",`${o} wheelchair ${o===1?"place":"places"} free`),a.innerHTML=`${ti("wheelchair",{size:11})}<span>${o}</span>`;let s=a.style;s.display="inline-flex",s.alignItems="center",s.gap="2px",s.marginLeft="6px",s.padding="1px 5px",s.borderRadius="999px",s.background="#2563eb",s.color="#ffffff",s.fontSize="0.85em",s.lineHeight="1.2",s.verticalAlign="middle",t.appendChild(a)}paintAccessChip(t,n){t.setAttribute("data-label-kind","access"),t.setAttribute("data-access-type",n.icon??""),t.innerHTML=n.icon?ti(n.icon,{size:ro-6}):"",t.setAttribute("role","img"),t.setAttribute("aria-label",n.text);let o=t.style;return o.width=`${ro}px`,o.height=`${ro}px`,o.alignItems="center",o.justifyContent="center",o.borderRadius="50%",o.background=n.color??"#3b82f6",o.color=n.ink??"#ffffff",o.border="1.5px solid #ffffff",o.boxShadow="0 2px 6px rgba(0,0,0,.35)",o.padding="0",o.lineHeight="0",o.boxSizing="border-box",t.dataset.qualityContrast=An(Pn(n.ink??"#ffffff")??[1,1,1],Pn(n.color??"#3b82f6")??[.23,.51,.96]).toFixed(3),t}placePinHeads(t){for(;this.pinHeads.length<t.length;){let n=document.createElement("div");n.setAttribute("data-pin-head",""),n.setAttribute("aria-hidden","true");let o=n.style;o.position="absolute",o.left="0",o.top="0",o.width=`${Ff}px`,o.height=`${Ff}px`,o.borderRadius="50%",o.background=Xo,o.boxShadow="0 0 0 3px rgba(255,255,255,.28), 0 0 14px rgba(255,255,255,.55), 0 3px 8px rgba(0,0,0,.45)",o.pointerEvents="none",this.root.appendChild(n),this.pinHeads.push(n)}this.pinHeads.forEach((n,o)=>{let r=t[o];n.style.display=r?"":"none",r&&(n.style.transform=`translate(-50%, -100%) translate(${r.x.toFixed(1)}px, ${r.y.toFixed(1)}px)`)})}dispose(){this.pinHeads=[],this.root.remove(),this.nodes.clear()}};var Uf=1;var tv=new Set(["floor","stage","zone","section","ga","booth","annotation"]);function nv(e){return e.every(t=>Number.isFinite(t))}function ov(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function zf(e){return e.length?Math.round(Math.min(...e)*100)/100:null}function Rn(e){return Math.round(e*1e4)/1e4}function rv(e){if(e)return{box:{x:Rn(e.box.x),y:Rn(e.box.y),width:Rn(e.box.width),height:Rn(e.box.height)},horizontalFillRatio:Rn(e.horizontalFillRatio),verticalFillRatio:Rn(e.verticalFillRatio),visibleAreaRatio:Rn(e.visibleAreaRatio),clippedEdges:[...e.clippedEdges]}}function Ft(e,t,n){return n.length?{code:e,message:t,count:n.length,samples:n.slice(0,20)}:null}function oi(e){let t=e.labels.filter(s=>s.visible&&s.screenBox),n=t.filter(s=>tv.has(s.kind)),o=e.scene.floorCount>1?e.scene.floorCount:e.scene.zoneCount||e.scene.sectionCount,r=[];for(let s=0;s<n.length;s+=1)for(let c=0;c<s;c+=1)ov(n[s].screenBox,n[c].screenBox)&&r.push({primaryId:n[s].id,primaryLabel:n[s].text,secondaryId:n[c].id});let i=[...e.camera.position,e.camera.distance,e.camera.verticalFovDeg],a=[Ft("webgl2-unavailable","The venue scene must render through WebGL2",e.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),Ft("context-lost","The WebGL context must be live at capture",e.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),Ft("frame-not-stable","The captured 3D frame must be rendered and parked",e.frame.rendered>0&&e.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),Ft("viewport-empty","The 3D viewport must have visible dimensions",e.viewport.width>1&&e.viewport.height>1?[]:[{primaryId:"viewport",primaryLabel:`${e.viewport.width}\xD7${e.viewport.height}`}]),Ft("camera-invalid","The capture camera must have a finite physical pose",nv(i)&&e.camera.distance>0&&e.camera.verticalFovDeg>0&&e.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),Ft("authored-relief-not-visible","Authored 3D height or rake must produce visible screen-space relief",!e.scene.authoredRelief||e.scene.renderedVerticalSpanM>.05&&e.scene.projectedReliefPx>=2?[]:[{primaryId:"scene",primaryLabel:"authored relief",measured:e.scene.projectedReliefPx,minimum:2}]),Ft("hierarchy-label-missing","A venue with authored hierarchy must show at least one structural label",o===0||n.length>0?[]:[{primaryId:"labels",primaryLabel:`${o} expected hierarchy labels`}]),Ft("hierarchy-label-undersized","Visible 3D hierarchy labels must remain readable",n.filter(s=>s.renderedFontPx<11).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.renderedFontPx,minimum:11}))),Ft("hierarchy-label-contrast-low","Visible 3D hierarchy labels must meet text contrast",n.filter(s=>s.contrast<4.5).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.contrast,minimum:4.5}))),Ft("hierarchy-label-collision","Visible 3D hierarchy labels must not overlap",r)].filter(s=>!!s);return{version:1,state:"venue3d",passed:a.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:e.viewport,context:e.context,frame:e.frame,camera:e.camera,scene:e.scene,composition:{visibleLabels:t.map(({id:s,kind:c,text:l})=>({id:s,kind:c,text:l})).sort((s,c)=>s.kind.localeCompare(c.kind)||s.id.localeCompare(c.id)),framing:rv(e.framing)},metrics:{minimumHierarchyFontPx:zf(n.map(s=>s.renderedFontPx)),minimumHierarchyContrast:zf(n.map(s=>s.contrast)),projectedReliefPx:Math.round(e.scene.projectedReliefPx*100)/100},findings:a}}function jf(e,t,n){e.fill(0);for(let o=0;o<Math.min(n,t.length);o++)e[t[o]]=1}var ze=require("ogl");var on=require("ogl");var ri=`
66
80
  float chairWeight(float depth) {
67
81
  return 1.0 - smoothstep(uChairFull, uChairNone, depth);
68
- }`,xm=`
69
- float occupantWeight(float depth) {
70
- float nearWeight = smoothstep(${Rs.toFixed(1)}, ${Es.toFixed(1)}, depth);
71
- float farWeight = 1.0 - smoothstep(${As.toFixed(1)}, ${Is.toFixed(1)}, depth);
72
- return nearWeight * farWeight;
73
- }`,va=`
82
+ }`,ds=`
83
+ const float TIP_SIN = ${Math.sin(Li*Math.PI/180).toFixed(4)};
84
+ const float TIP_COS = ${Math.cos(Li*Math.PI/180).toFixed(4)};
85
+ vec3 tipUpPad(vec3 p, float halfWidth, float up) {
86
+ if (up < 0.5) return p;
87
+ float hingeZ = (${rc.toFixed(2)}) * halfWidth + ${ic.toFixed(2)};
88
+ float dy = p.y - ${Ti.toFixed(2)};
89
+ float dz = p.z - hingeZ;
90
+ return vec3(p.x,
91
+ ${Ti.toFixed(2)} + dz * TIP_SIN + dy * TIP_COS,
92
+ hingeZ + dz * TIP_COS - dy * TIP_SIN);
93
+ }
94
+ vec3 tipUpNormal(vec3 n, float up) {
95
+ if (up < 0.5) return n;
96
+ return vec3(n.x, n.z * TIP_SIN + n.y * TIP_COS, n.z * TIP_COS - n.y * TIP_SIN);
97
+ }`,ps=`
74
98
  float glyphEq(float glyph, float expected) {
75
99
  return 1.0 - step(0.25, abs(glyph - expected));
76
100
  }
@@ -103,7 +127,9 @@ vec3 glyphChairPosition(vec3 p, float partId, float glyph) {
103
127
  else if (bench > 0.5) { p.x *= 1.10; p.z *= 0.82; }
104
128
  } else if (partId < 2.5) {
105
129
  if (stool > 0.5) return vec3(0.0);
106
- if (dining > 0.5) { p.x *= 0.78; p.y = 0.45 + (p.y - 0.45) * 0.82; }
130
+ // A dining chair's back is a panel held clear of the seat on its two rear
131
+ // legs: open under it, where an auditorium seat is closed to the pad.
132
+ if (dining > 0.5) { p.x *= 0.78; p.y = ${Kt.toFixed(2)} - (${Kt.toFixed(2)} - p.y) * ${nc.toFixed(2)}; }
107
133
  else if (folding > 0.5) { p.x *= 0.90; p.y = 0.45 + (p.y - 0.45) * 0.72; }
108
134
  else if (bench > 0.5) { p.x *= 1.10; p.y = 0.45 + (p.y - 0.45) * 0.62; }
109
135
  } else if (partId < 3.5) {
@@ -115,11 +141,31 @@ vec3 glyphChairPosition(vec3 p, float partId, float glyph) {
115
141
  if (max(max(dining, folding), bench) < 0.5) return vec3(0.0);
116
142
  if (folding > 0.5) p.x *= 0.88;
117
143
  if (bench > 0.5) p.x *= 1.10;
118
- } else if (partId > 9.5 && stool > 0.5) {
119
- p.y += 0.16;
144
+ if (dining > 0.5) {
145
+ // Slim legs set in under the seat. The rear pair stand behind the pad and
146
+ // carry on up into the foot of the back, so the back is held by the
147
+ // chair's own frame and daylight shows between it and the seat.
148
+ p.x = sign(p.x) * (${Js.toFixed(2)} + (abs(p.x) - 0.72) * ${rr.toFixed(2)});
149
+ if (p.z > 0.0) p.z = ${ec.toFixed(2)} + (p.z - 0.59) * ${rr.toFixed(2)};
150
+ else {
151
+ p.z = ${tc.toFixed(2)} + (p.z + 0.59) * ${rr.toFixed(2)};
152
+ if (p.y > 0.2) p.y = ${oc.toFixed(2)};
153
+ }
154
+ }
155
+ } else if (partId < 6.5) {
156
+ // The spine joins the back to the seat, so it goes where the back goes:
157
+ // as wide as that furniture's back, and gone where there is no back.
158
+ // A dining chair's back stands on its rear legs instead (see the legs).
159
+ if (max(stool, dining) > 0.5) return vec3(0.0);
160
+ if (folding > 0.5) p.x *= 0.90;
161
+ else if (bench > 0.5) p.x *= 1.10;
162
+ } else if (partId < 7.5) {
163
+ // Armrest standards are fixed auditorium seating; every other furniture
164
+ // family either has its own arms or has none.
165
+ if (generic < 0.5) return vec3(0.0);
120
166
  }
121
167
  return p;
122
- }`,F1=1.5,Fn=`
168
+ }`,iv=1.5,io=`
123
169
  uniform vec4 uSeeThrough; // xyz = the seats looked at, w = cone radius there; 0 = off
124
170
  bool seeThroughCut(vec3 p, vec3 eye) {
125
171
  if (uSeeThrough.w <= 0.0) return false;
@@ -128,11 +174,11 @@ bool seeThroughCut(vec3 p, vec3 eye) {
128
174
  if (len < 1.0) return false;
129
175
  vec3 dir = axis / len;
130
176
  float t = dot(p - eye, dir);
131
- if (t <= 0.0 || t > len - ${F1.toFixed(2)}) return false;
177
+ if (t <= 0.0 || t > len - ${iv.toFixed(2)}) return false;
132
178
  vec3 onLine = eye + dir * t;
133
179
  if (p.y < onLine.y - 0.25) return false;
134
180
  return length(p - onLine) < uSeeThrough.w * t / len;
135
- }`,D1=`#version 300 es
181
+ }`,av=`#version 300 es
136
182
  precision highp float;
137
183
  in vec3 position;
138
184
  in vec3 normal;
@@ -170,13 +216,60 @@ void main() {
170
216
  vNormalWorld = normalize(mat3(modelMatrix) * normal);
171
217
  vColor = color;
172
218
  gl_Position = projectionMatrix * mv;
173
- }`,Mm=`
219
+ }`,Wf=`
174
220
  bool roomWallHidden(float material, vec3 normalWorld, vec3 posWorld, vec3 eye, vec2 roomCentre) {
175
221
  if (abs(material - 6.0) > 0.5) return false;
176
222
  vec3 n = normalize(normalWorld);
177
223
  if (abs(n.y) > 0.5) return true;
178
224
  return dot(n.xz, eye.xz - posWorld.xz) * dot(n.xz, roomCentre - posWorld.xz) <= 0.0;
179
- }`,N1=`#version 300 es
225
+ }`,Xf=`
226
+ uniform vec3 uTop;
227
+ uniform vec3 uBottom;
228
+ uniform float uSky; // 1 for an open-air venue, see SceneModel.outdoor
229
+ uniform vec3 uZenith;
230
+ uniform vec3 uHorizon;
231
+ // uv: the pixel's place on screen, 0..1. dir: its line of sight, used only under a sky.
232
+ vec3 backdrop(vec2 uv, vec3 dir) {
233
+ vec3 col = mix(uBottom, uTop, uv.y);
234
+ vec2 c = uv - 0.5;
235
+ col *= 1.0 - dot(c, c) * 0.16; // soft vignette
236
+ // Above the horizon an open-air venue has a sky, not the chart's flat
237
+ // backdrop: from a seat, the stands used to meet a black void. Below the
238
+ // horizon (every overview) nothing changes.
239
+ if (uSky > 0.5) {
240
+ vec3 sky = mix(uHorizon, uZenith, pow(clamp(dir.y, 0.0, 1.0), 0.45));
241
+ // Reaching a little below the horizon too: from a low seat the far stands
242
+ // top out right at it, and a sliver of backdrop showed as a dark band.
243
+ // Every overview looks further down than this (at least ~24 degrees).
244
+ col = mix(col, sky, smoothstep(-0.22, 0.03, dir.y));
245
+ }
246
+ return col;
247
+ }`,sv=`
248
+ // A fixed 4 by 4 threshold pattern: a net thinned by it reads as a fine mesh,
249
+ // where random grain would read as dirt.
250
+ float orderedThreshold(vec2 pixel) {
251
+ const float m[16] = float[16](0.0, 8.0, 2.0, 10.0, 12.0, 4.0, 14.0, 6.0, 3.0, 11.0, 1.0, 9.0, 15.0, 7.0, 13.0, 5.0);
252
+ ivec2 i = ivec2(mod(pixel, 4.0));
253
+ return (m[i.x + i.y * 4] + 0.5) / 16.0;
254
+ }
255
+ const float NET_MESH_M = 0.12; // one mesh of a goal net
256
+ const float NET_CORD = 0.07; // half a cord's width, in meshes (drawn heavier than life)
257
+ const float NET_VEIL = 0.3; // how much of a distant net shows
258
+ // place: the point's place on its panel, metres (carried where a colour would be).
259
+ float netShown(vec2 place) {
260
+ vec2 mesh = place / NET_MESH_M;
261
+ vec2 w = fwidth(mesh); // meshes per pixel
262
+ vec2 toCord = 0.5 - abs(fract(mesh) - 0.5);
263
+ vec2 cord = 1.0 - smoothstep(NET_CORD - w, NET_CORD + w, toCord);
264
+ // Cords while a mesh is a dozen pixels or more; a veil once it is under six.
265
+ float crisp = 1.0 - smoothstep(0.08, 0.16, max(w.x, w.y));
266
+ return mix(NET_VEIL, max(cord.x, cord.y), crisp);
267
+ }
268
+ // A part a few centimetres thick: in full while a pixel covers 2.5 cm of it or
269
+ // less, gone by 4.5. pixelM: the world size of this pixel, metres.
270
+ float slenderShown(float pixelM) {
271
+ return 1.0 - smoothstep(0.025, 0.045, pixelM);
272
+ }`,cv=`#version 300 es
180
273
  precision highp float;
181
274
  in vec3 vColor;
182
275
  in vec3 vNormalWorld;
@@ -186,6 +279,8 @@ in vec3 vPosWorld;
186
279
  in float vDim;
187
280
  in float vMaterial;
188
281
  uniform vec3 uKeyDir; // WORLD space, unit, points at the light
282
+ uniform vec3 uKeyColor; // the look's tint of the key light (1 = white)
283
+ uniform vec3 uAmbientColor; // ...and of the ambient and fill
189
284
  uniform float uStructureDetail;
190
285
  uniform float uRoughness;
191
286
  uniform vec3 uDeckColor;
@@ -195,9 +290,12 @@ uniform sampler2D tVenueShadow;
195
290
  uniform mat4 uShadowMatrix;
196
291
  uniform vec3 cameraPosition;
197
292
  uniform vec2 uRoomCentre;
293
+ uniform vec2 uViewport; // drawing buffer size, pixels
198
294
  out vec4 fragColor;
199
- ${Mm}
200
- ${Fn}
295
+ ${Wf}
296
+ ${io}
297
+ ${Xf}
298
+ ${sv}
201
299
  // Stable world-space variation; no textures or per-frame random grain.
202
300
  float turfHash(vec2 p) {
203
301
  vec3 q = fract(vec3(p.xyx) * 0.1031);
@@ -238,6 +336,36 @@ void main() {
238
336
  if (vDim > 0.5) discard;
239
337
  if (roomWallHidden(vMaterial, vNormalWorld, vPosWorld, cameraPosition, uRoomCentre)) discard;
240
338
  if (seeThroughCut(vPosWorld, cameraPosition)) discard;
339
+ // Stage light (material 12, stageDressing.ts): the drape behind a stage and
340
+ // the lamps along it. It is light, not a surface: it is drawn in exactly its
341
+ // own colour, whatever the venue's rig does, and only from the side it faces,
342
+ // so the overview from behind a stage still looks over a low backdrop.
343
+ if (abs(vMaterial - 12.0) < 0.5) {
344
+ if (dot(vNormalWorld, cameraPosition - vPosWorld) <= 0.0) discard;
345
+ fragColor = vec4(vColor, 1.0);
346
+ return;
347
+ }
348
+ // A step nosing (material 7, see sectionAisles.ts) is a 5 cm strip. It is
349
+ // drawn in full only while a pixel covers about a centimetre of it or less,
350
+ // so it is four or five pixels deep, and it is gone by three: a short
351
+ // screen-door band between the two, never a thin line. Drawn at every
352
+ // distance, the first nosing thinned to a dash on every step and made a
353
+ // zig-zag down each section edge. The tread it lies on is underneath, so a
354
+ // dropped fragment shows the plain step.
355
+ if (abs(vMaterial - 7.0) < 0.5) {
356
+ float nosingPixel = max(length(dFdx(vPosWorld)), length(dFdy(vPosWorld)));
357
+ float nosingShown = 1.0 - smoothstep(0.011, 0.016, nosingPixel);
358
+ float nosingStipple = fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453);
359
+ if (nosingStipple >= nosingShown) discard;
360
+ }
361
+ // Sport fittings: a slender part thins out like a nosing, a net is cords up
362
+ // close and a veil further off (see FITTINGS_GLSL).
363
+ bool net = abs(vMaterial - 10.0) < 0.5;
364
+ if (abs(vMaterial - 11.0) < 0.5) {
365
+ float shown = slenderShown(max(length(dFdx(vPosWorld)), length(dFdy(vPosWorld))));
366
+ if (fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453) >= shown) discard;
367
+ }
368
+ if (net && orderedThreshold(gl_FragCoord.xy) >= netShown(vColor.rg)) discard;
241
369
  // Row treads (material 3) and risers (material 2) are chart truth: the
242
370
  // stepped deck IS the stand, at every distance. What must not survive at
243
371
  // whole-venue scale is the risers' darker shade \u2014 hundreds of sub-pixel dark
@@ -255,6 +383,8 @@ void main() {
255
383
  // Risers are baked at 0.72 of their tread (see tiers.ts bandColors); lift
256
384
  // them back to the tread colour as detail fades out.
257
385
  vec3 vColorRung = vColor * mix(mix(1.0 / 0.72, 1.0, uStructureDetail), 1.0, 1.0 - riser);
386
+ // A net's vertex colour is its place on the panel, not a colour.
387
+ if (net) vColorRung = vec3(0.90, 0.92, 0.95);
258
388
  // Concrete remains visible at overview instead of painting the entire
259
389
  // seating deck like upholstery. Keep a category tint for navigation;
260
390
  // filtering retains its existing shell color cues.
@@ -294,7 +424,10 @@ void main() {
294
424
  // The fill keeps the turned faces from going charcoal: at 0.10 a wall facing
295
425
  // away from the sun kept about half its colour, and the walls under every
296
426
  // tier and box read as dark blocks (owner, 2026-09-24).
297
- vec3 base = vColorRung * (0.34 + 0.26 * hemi) * mix(0.72, 1.0, visibility) + vColorRung * key * 0.60 + vColorRung * fill * 0.26;
427
+ // The look tints the light, never the surface: the same concrete under an
428
+ // amber house and under floodlights (see looks.ts). White for no look.
429
+ vec3 base = vColorRung * ((0.34 + 0.26 * hemi) * mix(0.72, 1.0, visibility) * uAmbientColor
430
+ + key * 0.60 * uKeyColor + fill * 0.26 * uAmbientColor);
298
431
  float fres = pow(1.0 - max(dot(normalize(vNormalView), V), 0.0), 3.0);
299
432
  // Material 1 is a powered display and keeps its authored emission treatment.
300
433
  // Every architectural material uses the venue roughness token; 0.78 maps to
@@ -327,9 +460,18 @@ void main() {
327
460
  + vec3(0.62, 0.46, 0.20) * band * 0.28
328
461
  + vec3(0.20, 0.10, 0.34) * focalHalo;
329
462
  base = mix(base, display, poweredDisplay * verticalFace * 0.92);
463
+ // The site's open land (material 8 at the paving, rising to 9 at its outer
464
+ // edge: bounds.ts emitSite) dissolves into the backdrop behind it, so the
465
+ // venue stands on ground that has no rim. Matched to the backdrop pixel for
466
+ // pixel: a rim painted one fixed colour showed as a pale disc.
467
+ if (vMaterial > 7.5 && vMaterial < 9.5) {
468
+ float out_ = smoothstep(0.0, 1.0, clamp(vMaterial - 8.0, 0.0, 1.0));
469
+ base = mix(base, backdrop(gl_FragCoord.xy / uViewport, normalize(vPosWorld - cameraPosition)), out_);
470
+ }
330
471
  fragColor = vec4(base, 1.0);
331
- }`,vm=`
332
- ${va}
472
+ }`,Kf=`
473
+ ${ps}
474
+ ${ds}
333
475
  vec4 seatSurface(vec3 source, float radius) {
334
476
  vec4 origin = modelViewMatrix * vec4(iOffset, 1.0);
335
477
  if (iPhysicalSeat < 0.5) {
@@ -343,12 +485,13 @@ vec4 seatSurface(vec3 source, float radius) {
343
485
  if (surface < 0.5) return origin;
344
486
  vec3 p = glyphChairPosition(source, surface, iGlyph);
345
487
  p.xz *= iChairWidth;
346
- if (surface > 1.5) p.z -= max(p.y - ${Et.toFixed(2)}, 0.0) * ${Wn.toFixed(2)} * glyphBackRake(iGlyph);
488
+ if (surface < 1.5) p = tipUpPad(p, iChairWidth, iTipUp);
489
+ if (surface > 1.5) p.z -= max(p.y - ${Bt.toFixed(2)}, 0.0) * ${mo.toFixed(2)} * glyphBackRake(iGlyph);
347
490
  float c = cos(iYaw), s = sin(iYaw);
348
491
  vec3 rotated = vec3(p.x * c + p.z * s, p.y, -p.x * s + p.z * c);
349
492
  return modelViewMatrix * vec4(iOffset + rotated, 1.0);
350
493
  }
351
- `,B1=`#version 300 es
494
+ `,lv=`#version 300 es
352
495
  precision highp float;
353
496
  in float surface;
354
497
  in float iYaw;
@@ -362,6 +505,7 @@ in vec3 iColor; // per-instance state colour (resolved CPU-side)
362
505
  in float iMaxRadius; // per-instance world-radius ceiling (seat pitch derived)
363
506
  in float iHasChair;
364
507
  in float iPhysicalSeat;// 1 = chair; 0 = empty wheelchair bay
508
+ in float iTipUp; // 1 = an empty tip-up seat, drawn folded against its back
365
509
  in vec3 iRing; // accommodation ring colour; (0,0,0) = not accessible
366
510
  in float iFloor; // owning floor index
367
511
  in float iSection; // owning section index, -1 = none
@@ -388,9 +532,9 @@ out float vDotWeight; // 1 = the dot IS this seat, 0 = the chair has taken over
388
532
  out float vPhysicalSeat;
389
533
  out float vPixelRadius;
390
534
  uniform vec3 cameraPosition;
391
- ${Ar}
392
- ${vm}
393
- ${Fn}
535
+ ${ri}
536
+ ${Kf}
537
+ ${io}
394
538
  void main() {
395
539
  if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
396
540
  vec4 mv = modelViewMatrix * vec4(iOffset, 1.0);
@@ -412,8 +556,9 @@ void main() {
412
556
  mv = seatSurface(position, r);
413
557
  // Match the shell's non-uniform width/depth scale before its back rake.
414
558
  vec3 n = vec3(normal.x / iChairWidth, normal.y, normal.z / iChairWidth);
415
- if (surface > 1.5) n.y += n.z * ${Wn.toFixed(2)} * glyphBackRake(iGlyph);
559
+ if (surface > 1.5) n.y += n.z * ${mo.toFixed(2)} * glyphBackRake(iGlyph);
416
560
  n = normalize(n);
561
+ if (surface > 0.5 && surface < 1.5) n = tipUpNormal(n, iTipUp);
417
562
  vSeatNormal = vec3(n.x * cos(iYaw) + n.z * sin(iYaw), n.y, -n.x * sin(iYaw) + n.z * cos(iYaw));
418
563
  vSeatHeight = position.y;
419
564
  vSeatSurface = step(1.5, surface);
@@ -424,18 +569,20 @@ void main() {
424
569
  vDim = (uFocusFloor < -0.5 || abs(iFloor - uFocusFloor) < 0.5) ? 0.0 : 1.0;
425
570
  vSectionFade = (uFocusSection < -0.5 || abs(iSection - uFocusSection) < 0.5) ? 0.0 : 1.0;
426
571
  gl_Position = projectionMatrix * mv;
427
- }`,Sm=`
572
+ }`,Yf=`
428
573
  float seatSilhouette(vec2 uv, float physical) {
429
574
  // Solid furniture owns its silhouette in geometry. Only empty bays need
430
575
  // a fragment mask; cutting physical faces would open holes in the volume.
431
576
  return mix(max(abs(uv.x), abs(uv.y)), 0.0, physical);
432
577
  }
433
- `,V1=`#version 300 es
578
+ `,uv=`#version 300 es
434
579
  precision highp float;
435
580
  in vec3 vSeatNormal;
436
581
  in float vSeatHeight;
437
582
  in float vSeatSurface;
438
583
  uniform vec3 uKeyDir;
584
+ uniform vec3 uKeyColor; // the look's light, at the seats' share (looks.ts)
585
+ uniform vec3 uAmbientColor;
439
586
  in vec2 vUv;
440
587
  in vec3 vColor;
441
588
  in float vBudget;
@@ -450,7 +597,7 @@ uniform float uSeatDetail; // 0 for venue/area overview; 1 in section/row/sea
450
597
  uniform vec3 uFadeColor;
451
598
  uniform float uRoughness;
452
599
  out vec4 fragColor;
453
- ${Sm}
600
+ ${Yf}
454
601
  void main() {
455
602
  if (vDim > 0.5) discard;
456
603
  // Same screen-door dissolve as the structure rung (uStructureDetail): the
@@ -471,7 +618,15 @@ void main() {
471
618
  float fill = max(dot(N, normalize(vec3(-uKeyDir.x, 0.25, -uKeyDir.z))), 0.0);
472
619
  float ao = mix(0.58, 1.0, clamp(vSeatHeight / 0.92, 0.0, 1.0));
473
620
  float partShade = mix(1.10, 0.80, vSeatSurface);
474
- vec3 c = vColor * (partShade * ao * (0.60 + 0.30 * hemi) + key * 0.28 + fill * 0.16);
621
+ vec3 c = vColor * (partShade * ao * (0.60 + 0.30 * hemi) * uAmbientColor + key * 0.28 * uKeyColor + fill * 0.16 * uAmbientColor);
622
+ // The far seat is two boxes, and a box face is one flat value. Each face
623
+ // darkens toward its own edges instead, so the pad and the back read as
624
+ // cushions and the row matches the rounded near chair it hands over to (see
625
+ // seatChair.ts) without a single extra triangle. Only once a seat is several
626
+ // pixels across: below that the falloff would be sub-pixel noise.
627
+ vec2 edge = vUv * vUv;
628
+ float cushion = (1.0 - edge.x * edge.x) * (1.0 - edge.y * edge.y);
629
+ c *= mix(1.0, mix(0.78, 1.06, cushion), vPhysicalSeat * smoothstep(3.0, 7.0, vPixelRadius));
475
630
  c = mix(c, uFadeColor, uSeatFade);
476
631
  // Accommodation ring \u2014 the 3D echo of the coloured ring 2D draws around every
477
632
  // accessible seat. Painted INSIDE the dot's own radius rather than outside it,
@@ -515,11 +670,11 @@ void main() {
515
670
  c = mix(c, mix(vec3(lum), vec3(0.93), 0.35), 0.45);
516
671
  }
517
672
  fragColor = vec4(c, alpha);
518
- }`,G1=`#version 300 es
673
+ }`,mv=`#version 300 es
519
674
  precision highp float;
520
675
  in vec3 position; // local: x/z in units of the seat radius, y in METRES
521
676
  in vec3 normal;
522
- in float part; // 0..5 furniture modules, 10 body, 11 head
677
+ in float part; // 0..7 furniture modules (see CHAIR_PART)
523
678
  in vec3 iOffset; // per-instance world deck point (identical to the dot's)
524
679
  in vec3 iColor; // per-instance state colour
525
680
  in float iRadius; // per-instance horizontal half-width, world metres
@@ -527,9 +682,11 @@ in float iYaw; // per-instance facing, radians (local +Z -> facing dir)
527
682
  in vec3 iRing; // accommodation ring colour; (0,0,0) = not accessible
528
683
  in float iFloor;
529
684
  in float iSection; // owning section index, -1 = none
530
- in float iSeed; // <0 = seat is empty; else per-person hash in [0,1)
685
+ in float iTaken; // 1 = sold or held: not for sale
531
686
  in float iPhysicalSeat;// 1 = chair; 0 = empty wheelchair bay
532
687
  in float iGlyph; // stable SEAT_GLYPH_ORDER index
688
+ in vec4 iArmrests; // xy / zw = world offsets (x, z) of the two armrests; 0 = none
689
+ in float iTipUp; // 1 = an empty tip-up seat, drawn folded against its back
533
690
  uniform mat4 modelViewMatrix;
534
691
  uniform mat4 projectionMatrix;
535
692
  uniform float uChairFull;
@@ -548,14 +705,14 @@ out float vHeight; // local height in metres, for the vertical occlusion ramp
548
705
  out vec3 vRing;
549
706
  out float vDim;
550
707
  out float vSectionFade;
551
- out float vOccupant; // 1 = this vertex belongs to a person, not to the chair
552
- out vec3 vOccupantTint;
553
708
  out float vTaken; // 1 = sold or held: not for sale
554
- ${Ar}
555
- ${xm}
556
- ${va}
709
+ out vec3 vLocal; // x/z in chair half-widths, y in metres: where on the chair
710
+ out vec3 vViewWorld;// from the surface to the eye, world space (not unit)
711
+ ${ri}
712
+ ${ps}
713
+ ${ds}
557
714
  uniform vec3 cameraPosition;
558
- ${Fn}
715
+ ${io}
559
716
  void main() {
560
717
  if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
561
718
  vec4 anchor = modelViewMatrix * vec4(iOffset, 1.0);
@@ -569,80 +726,68 @@ void main() {
569
726
  // chairs, but nobody gets a short one (people are the same height at every
570
727
  // seat pitch).
571
728
  vec3 p = position;
572
- // The occupant. Parts 10 and 11 are a person; lower ids are furniture modules.
573
- //
574
- // One instanced mesh draws both an empty seat and a taken one, because the
575
- // alternative \u2014 a second geometry and a second draw call gathered per frame \u2014
576
- // would double the near-field cost to show what is already known per instance.
577
- // An unoccupied seat collapses its person to a point at the seat, which the
578
- // rasteriser discards, exactly as the chair itself collapses at w=0.
579
- float occupant = step(9.5, part);
580
- float taken = step(0.0, iSeed);
581
- vTaken = taken;
582
- vOccupant = occupant;
729
+ vTaken = step(0.5, iTaken);
583
730
  p = glyphChairPosition(p, part, iGlyph);
584
- if (iPhysicalSeat < 0.5) {
585
- p = vec3(0.0); // sellable space, but no physical chair/person
586
- } else if (occupant > 0.5) {
587
- if (taken < 0.5) {
588
- p = vec3(0.0); // empty seat: no person
589
- } else {
590
- // Vary the build so a sold-out row is people rather than a rank of
591
- // identical mannequins: +/-6% height and +/-8% width off the hash.
592
- p.y *= 0.94 + 0.12 * iSeed;
593
- p.xz *= 0.92 + 0.16 * fract(iSeed * 7.13);
594
- // People only appear once they are large enough to read as people. At
595
- // section/overview distance their tiny dark geometry aliases into radial
596
- // streaks; seat dots already communicate held/booked state there.
597
- p *= occupantWeight(depth);
598
- }
731
+ // Armrest standards (see fixedRowSeating in seatInstances.ts). The mesh holds
732
+ // two, told apart by the side of x = 0 they are built on; each is recentred
733
+ // on its own axis here and stood at its world offset after the yaw below.
734
+ vec2 armrestAt = vec2(0.0);
735
+ if (part > 6.5 && part < 7.5) {
736
+ bool shared = position.x > 0.0;
737
+ armrestAt = shared ? iArmrests.xy : iArmrests.zw;
738
+ if (dot(armrestAt, armrestAt) <= 0.0) p = vec3(0.0);
739
+ else if (dot(p, p) > 0.0) p.x += shared ? -${mn.toFixed(2)} : ${mn.toFixed(2)};
599
740
  }
741
+ if (iPhysicalSeat < 0.5) p = vec3(0.0); // sellable space, but no physical chair
600
742
  float localHeight = p.y;
743
+ vLocal = p;
601
744
  p.xz *= iRadius;
745
+ // A seat in a fixed row hangs between its armrest standards, as a real
746
+ // tip-up does: no post under the middle of it. An accessible seat keeps the
747
+ // pedestal, which is what carries its ring colour at close range.
748
+ if (part < 0.5 && iGlyph < 1.5 && dot(iArmrests, iArmrests) > 0.0 && dot(iRing, iRing) < 0.001) p = vec3(0.0);
749
+ // The pad of an empty tip-up seat stands folded against the back. Its height
750
+ // for the occlusion ramp is where it now stands, not where it lay.
751
+ bool padPart = part > 0.5 && part < 1.5;
752
+ if (padPart) { p = tipUpPad(p, iRadius, iTipUp); localHeight = p.y; }
602
753
  // 2. Lean the back. Done here rather than in the base mesh so the lean is a
603
754
  // real angle in METRES \u2014 baked into the mesh it would scale with the seat's
604
755
  // width and the same chair would lean 20 degrees on a wide stadium row and
605
756
  // 6 on a tight theatre one.
606
- // Only the BACK panel rakes. The old test (part > 1.5) meant "the back", and
607
- // now also catches the occupant \u2014 leaning a person by the panel's rule would
608
- // translate their head backwards by a rake measured from the panel's base.
757
+ // Only the back and the spine that carries it rake.
609
758
  float resolvedRake = uBackRake * glyphBackRake(iGlyph);
610
- float rake = (part > 1.5 && part < 2.5) ? max(p.y - uBackBase, 0.0) * resolvedRake : 0.0;
759
+ // (And a leg, where it rises past the back's base: a dining chair's rear legs.)
760
+ float rake = ((part > 1.5 && part < 2.5) || (part > 4.5 && part < 6.5)) ? max(p.y - uBackBase, 0.0) * resolvedRake : 0.0;
611
761
  p.z -= rake;
612
762
  // Fixed-size detail swap: no miniature chair inside a larger fallback.
613
763
  p *= step(0.01, w);
614
764
  vChairWeight = w;
615
765
  float c = cos(iYaw), s = sin(iYaw);
616
766
  vec3 rp = vec3(p.x * c + p.z * s, p.y, -p.x * s + p.z * c);
767
+ // A collapsed armrest (p = 0) must stay collapsed, so the offset rides on w.
768
+ rp.xz += armrestAt * step(0.01, w) * step(0.0001, dot(p, p));
617
769
  // Normals under the same two transforms, in reverse and inverted-transposed.
618
770
  // The xz scale is non-uniform, so an axis-aligned normal does NOT survive it
619
771
  // unchanged; and the rake is a shear, whose normal transform adds a y term.
620
772
  // Skipping either lights the raked back as though it were still vertical.
621
773
  vec3 n = vec3(normal.x / iRadius, normal.y, normal.z / iRadius);
622
- if (part > 1.5 && part < 2.5) n.y += resolvedRake * n.z;
774
+ if ((part > 1.5 && part < 2.5) || (part > 5.5 && part < 6.5)) n.y += resolvedRake * n.z;
623
775
  n = normalize(n);
776
+ if (padPart) n = tipUpNormal(n, iTipUp);
624
777
  vec3 rn = vec3(n.x * c + n.z * s, n.y, -n.x * s + n.z * c);
625
778
  vec4 mv = modelViewMatrix * vec4(iOffset + rp, 1.0);
626
779
  vPosView = mv.xyz;
780
+ vViewWorld = cameraPosition - (iOffset + rp);
627
781
  vNormalWorld = rn;
628
782
  vNormalView = normalize(mat3(modelViewMatrix) * rn);
629
783
  vColor = iColor;
630
- // Occupant colour, resolved here so the fragment stage needs no extra
631
- // varyings beyond this one. A person is NOT painted in the seat's state
632
- // colour: a sold seat is red, and a hall of red people reads as a warning,
633
- // not an audience. Hair/clothing for the body, a warm tone for the head,
634
- // both varied by the same per-person hash.
635
- float t = fract(iSeed * 3.71);
636
- vec3 clothes = mix(vec3(0.18, 0.22, 0.30), vec3(0.42, 0.29, 0.34), t);
637
- vec3 skin = mix(vec3(0.52, 0.38, 0.29), vec3(0.86, 0.70, 0.58), fract(iSeed * 11.3));
638
- vOccupantTint = (part > 10.5) ? skin : clothes;
639
784
  vPart = part;
640
785
  vHeight = localHeight;
641
786
  vRing = iRing;
642
787
  vDim = (uFocusFloor < -0.5 || abs(iFloor - uFocusFloor) < 0.5) ? 0.0 : 1.0;
643
788
  vSectionFade = (uFocusSection < -0.5 || abs(iSection - uFocusSection) < 0.5) ? 0.0 : 1.0;
644
789
  gl_Position = projectionMatrix * mv;
645
- }`,H1=`#version 300 es
790
+ }`,fv=`#version 300 es
646
791
  precision highp float;
647
792
  in vec3 vColor;
648
793
  in vec3 vNormalWorld;
@@ -653,10 +798,12 @@ in float vHeight;
653
798
  in vec3 vRing;
654
799
  in float vDim;
655
800
  in float vSectionFade;
656
- in float vOccupant;
657
- in vec3 vOccupantTint;
658
801
  in float vTaken;
802
+ in vec3 vLocal;
803
+ in vec3 vViewWorld;
659
804
  uniform vec3 uKeyDir;
805
+ uniform vec3 uKeyColor; // the look's light, at the seats' share (looks.ts)
806
+ uniform vec3 uAmbientColor;
660
807
  uniform vec3 uFadeColor;
661
808
  uniform float uRoughness;
662
809
  in float vChairWeight;
@@ -672,55 +819,68 @@ void main() {
672
819
  vec3 fillDir = normalize(vec3(-uKeyDir.x, 0.25, -uKeyDir.z));
673
820
  float fill = max(dot(N, fillDir), 0.0);
674
821
  vec3 tint = vColor;
675
- if (vOccupant > 0.5) tint = vOccupantTint;
676
- // The crowd in taken seats is one crisp, dark tone, not the seat's muted
677
- // grey: on a light venue that grey went pale, and the people read as soft
678
- // grey blobs (owner, 2026-09-25: "not crisp"). Dark silhouettes with the rim
679
- // below read as an audience at every distance; the head is a step lighter so
680
- // it separates from the shoulders.
681
- if (vOccupant > 0.5 && vTaken > 0.5) {
682
- // A little per-person variety (the clothing hash), so a full stand reads
683
- // as people and not as one moulded block.
684
- float vary = dot(vOccupantTint, vec3(0.33)) - 0.3;
685
- tint = (vPart > 10.5 ? vec3(0.31, 0.32, 0.36) : vec3(0.19, 0.22, 0.27)) + vary * 0.12;
686
- }
687
822
  // The accommodation ring, kept legible once the dot (which drew it) is gone:
688
823
  // an accessible seat's support is painted in the ring colour, so the marker
689
824
  // survives to close range instead of vanishing exactly when the buyer arrives.
690
825
  float ringMask = step(0.001, dot(vRing, vRing));
691
826
  float supportPart = max(1.0 - step(0.5, vPart),
692
827
  step(4.5, vPart) * (1.0 - step(5.5, vPart)));
828
+ // The frame is a frame. The pedestal and legs were the upholstery's colour at
829
+ // half strength, so a red seat stood on a dark-red post and the whole chair
830
+ // read as one moulded block. Real seating is fabric on a graphite frame; the
831
+ // little tint that stays keeps the frame in the venue's light, not a cut-out.
832
+ // The spine (6) and the armrest standards (7) are frame as well.
833
+ float framePart = step(5.5, vPart) * (1.0 - step(7.5, vPart));
834
+ float frame = max(supportPart, framePart);
835
+ // An armrest takes none of its seat's colour: it is shared with the seat
836
+ // next door, which may be another colour.
837
+ float armrestPart = step(6.5, vPart) * (1.0 - step(7.5, vPart));
838
+ tint = mix(tint, mix(vec3(0.17, 0.18, 0.20), tint, 0.12 * (1.0 - armrestPart)) * 2.0, frame);
693
839
  if (supportPart > 0.5 && ringMask > 0.5) tint = vRing;
694
840
  // Tonal separation keeps the modular silhouettes readable without textures.
695
- // A person is lit as a person, not as upholstery: no part shading, and less
696
- // of the pad's sheen, so a head does not read as a polished box.
697
- float furnitureShade = vPart < 0.5 ? 0.50
841
+ float partShade = vPart < 0.5 ? 0.50
698
842
  : (vPart < 1.5 ? 1.10
699
843
  : (vPart < 2.5 ? 0.80
700
844
  : (vPart < 3.5 ? 0.72
701
845
  : (vPart < 4.5 ? 0.90 : 0.55))));
702
- float partShade = vOccupant > 0.5 ? 0.95 : furnitureShade;
703
846
  // Cheap vertical occlusion: a chair is in a dense row, so the closer a surface
704
847
  // sits to the deck the less sky it can actually see. This is the depth cue \u2014
705
848
  // without it the pad top, the back and the deck all resolve to the same flat
706
849
  // value and the row loses its form entirely.
707
- // Occupants rise above the 0.92 m chair back, so their ramp uses their own
708
- // height or every head would clamp to full brightness and float.
709
- float ao = mix(0.58, 1.0, clamp(vHeight / (vOccupant > 0.5 ? 1.30 : 0.92), 0.0, 1.0));
850
+ float ao = mix(0.58, 1.0, clamp(vHeight / 0.92, 0.0, 1.0));
851
+ // The crease. Where the back meets the pad neither can see the sky: the foot
852
+ // of the back and the rear of the pad darken toward the join. This is the
853
+ // line that makes two cushions read as one chair, and it is what the flat
854
+ // panels were missing most.
855
+ float padPart = step(0.5, vPart) * (1.0 - step(1.5, vPart));
856
+ float backPart = step(1.5, vPart) * (1.0 - step(2.5, vPart));
857
+ float crease = mix(1.0, mix(0.70, 1.0, smoothstep(-0.95, -0.15, vLocal.z)), padPart)
858
+ * mix(1.0, mix(0.74, 1.0, smoothstep(0.0, 0.20, vLocal.y - ${Bt.toFixed(2)})), backPart);
859
+ // The seam. On a tight row neighbouring pads meet edge to edge, and without a
860
+ // line between them the row is one long bench. Each pad darkens toward its
861
+ // own sides, which draws that line whether or not there is a gap to see.
862
+ crease *= mix(1.0, mix(1.0, 0.72, smoothstep(0.58, 0.90, abs(vLocal.x))), padPart);
863
+ ao *= crease;
710
864
  // Chairs follow the structure's balance (see SOLID_FRAG): more sun, less
711
865
  // ambient, so seat pads, backs and arms separate instead of reading as one
712
866
  // coloured mass.
713
- vec3 base = tint * partShade * ao * (0.52 + 0.26 * hemi) + tint * key * 0.40 + tint * fill * 0.14;
867
+ vec3 base = tint * (partShade * ao * (0.52 + 0.26 * hemi) * uAmbientColor + key * 0.40 * uKeyColor + fill * 0.14 * uAmbientColor);
714
868
  float fres = pow(1.0 - max(dot(normalize(vNormalView), V), 0.0), 3.0);
715
869
  // A restrained furniture rim keeps the low-poly edges from looking outlined.
716
- // Occupant silhouettes retain their existing stronger separation.
717
870
  float sheen = clamp((1.0 - uRoughness) / 0.22, 0.15, 2.0);
718
- base += vec3(0.26, 0.31, 0.38) * fres * mix(0.24, 0.55, vOccupant) * mix(sheen, 1.0, vOccupant);
719
- // Not for sale: the chair and the person in it go one muted grey, a step
720
- // toward the venue. Their own clothing and the chair's category tint made a
721
- // taken seat look like any other at a glance (owner report, 2026-09-23);
722
- // now only the seats a buyer can take wear full colour.
723
- if (vTaken > 0.5 && vOccupant < 0.5) {
871
+ base += vec3(0.26, 0.31, 0.38) * fres * 0.24 * sheen;
872
+ // A soft highlight where a cushion turns toward the light. Broad and weak:
873
+ // it is upholstery catching the sun, not a polished shell.
874
+ vec3 halfway = normalize(uKeyDir + normalize(vViewWorld));
875
+ float gloss = pow(max(dot(N, halfway), 0.0), 18.0) * (padPart + backPart);
876
+ base += (tint * 0.35 + vec3(0.10)) * gloss * 0.42 * clamp(sheen, 0.5, 1.5);
877
+ // Not for sale: the chair goes one muted grey, a step toward the venue. The
878
+ // chair's category tint made a taken seat look like any other at a glance
879
+ // (owner report, 2026-09-23); now only the seats a buyer can take wear full
880
+ // colour. With its pad down among folded neighbours, that grey IS the taken
881
+ // seat: no figure sits in it (owner, 2026-11-11).
882
+ // (Not the armrest: it is shared with the seat next door, which may be free.)
883
+ if (vTaken > 0.5 && armrestPart < 0.5) {
724
884
  float takenLum = dot(base, vec3(0.299, 0.587, 0.114));
725
885
  base = mix(vec3(takenLum), uFadeColor, 0.35) * 0.92;
726
886
  }
@@ -731,45 +891,98 @@ void main() {
731
891
  base = mix(base, mix(vec3(lum), vec3(0.93), 0.35), 0.45);
732
892
  }
733
893
  fragColor = vec4(base, 1.0);
734
- }`,z1=`#version 300 es
894
+ }`,hv=`#version 300 es
735
895
  precision highp float;
736
896
  in vec2 position;
737
897
  out vec2 vUv;
738
898
  void main() {
739
899
  vUv = position * 0.5 + 0.5;
740
900
  gl_Position = vec4(position, 0.999, 1.0);
741
- }`,U1=`#version 300 es
901
+ }`,dv=`#version 300 es
742
902
  precision highp float;
743
903
  in vec2 vUv;
744
- uniform vec3 uTop;
745
- uniform vec3 uBottom;
746
- uniform float uSky; // 1 for an open-air venue, see SceneModel.outdoor
747
- uniform vec3 uZenith;
748
- uniform vec3 uHorizon;
904
+ ${Xf}
749
905
  uniform mat4 uInvViewProj;
906
+ uniform float uHouse; // 1 for an indoor venue, see SceneModel.house
907
+ uniform vec4 uHouseShape; // the wall: centre x, centre z, half-width x, half-width z (world metres)
908
+ uniform vec2 uHouseLevels; // floor y, ceiling y
909
+ uniform vec3 uHouseCeiling;
910
+ uniform vec3 uHouseWall;
911
+ uniform vec3 uHouseLamp;
912
+ uniform vec3 uEye; // camera, world metres
750
913
  out vec4 fragColor;
914
+
915
+ // One house light to a bay of the ceiling, and the bay's own width, metres.
916
+ const float HOUSE_BAY_M = 7.0;
917
+ const float HOUSE_LAMP_BAYS = 0.055; // lamp radius, in bays
918
+ const float HOUSE_COURSE_M = 3.2; // height of one course of wall panels
919
+
751
920
  void main() {
752
- vec3 col = mix(uBottom, uTop, vUv.y);
753
- vec2 c = vUv - 0.5;
754
- float vig = 1.0 - dot(c, c) * 0.16; // soft vignette
755
- col *= vig;
756
- // Above the horizon an open-air venue has a sky, not the chart's flat
757
- // backdrop: from a seat, the stands used to meet a black void. Below the
758
- // horizon (every overview) nothing changes.
759
- if (uSky > 0.5) {
921
+ // This pixel's line of sight. A venue with neither a sky nor a room skips
922
+ // it: its backdrop is the flat gradient.
923
+ vec3 dir = vec3(0.0, -1.0, 0.0);
924
+ if (uSky > 0.5 || uHouse > 0.5) {
760
925
  vec2 ndc = vUv * 2.0 - 1.0;
761
926
  vec4 near = uInvViewProj * vec4(ndc, -1.0, 1.0);
762
927
  vec4 far = uInvViewProj * vec4(ndc, 1.0, 1.0);
763
- vec3 dir = normalize(far.xyz / far.w - near.xyz / near.w);
764
- float up = dir.y;
765
- vec3 sky = mix(uHorizon, uZenith, pow(clamp(up, 0.0, 1.0), 0.45));
766
- // Reaching a little below the horizon too: from a low seat the far stands
767
- // top out right at it, and a sliver of backdrop showed as a dark band.
768
- // Every overview looks further down than this (at least ~24 degrees).
769
- col = mix(col, sky, smoothstep(-0.22, 0.03, up));
928
+ dir = normalize(far.xyz / far.w - near.xyz / near.w);
929
+ }
930
+ // The gradient and, for an open-air venue, the sky. A venue never has both
931
+ // a sky and a room, so the room below paints over the plain gradient.
932
+ vec3 col = backdrop(vUv, dir);
933
+ // An indoor venue has a room, not the chart's flat backdrop: from a seat the
934
+ // stands used to end in a void (see scene/model/house.ts). Painted here, so
935
+ // it is behind everything drawn. Only from inside the room and under its
936
+ // ceiling: every overview stands outside or above, and is unchanged.
937
+ if (uHouse > 0.5) {
938
+ // Where the line of sight would meet the ceiling, and where it would leave
939
+ // the elliptical wall. Worked out for every pixel before the branch on
940
+ // what it actually hits, so each pattern's pixel footprint (fwidth) is
941
+ // defined everywhere.
942
+ float headroom = uHouseLevels.y - uEye.y;
943
+ float tCeiling = headroom / max(dir.y, 1e-4);
944
+ vec2 onCeiling = uEye.xz + dir.xz * tCeiling - uHouseShape.xy;
945
+ vec2 bay = onCeiling / HOUSE_BAY_M;
946
+ float bayPixel = max(fwidth(bay.x), fwidth(bay.y)); // bays per pixel
947
+ vec2 eye = (uEye.xz - uHouseShape.xy) / uHouseShape.zw;
948
+ vec2 across = dir.xz / uHouseShape.zw;
949
+ float wa = dot(across, across), wb = dot(eye, across), wk = dot(eye, eye) - 1.0;
950
+ float tWall = wa > 1e-9 ? (-wb + sqrt(max(0.0, wb * wb - wa * wk))) / wa : 1e9;
951
+ float course = (uEye.y + dir.y * tWall - uHouseLevels.x) / HOUSE_COURSE_M;
952
+ float coursePixel = fwidth(course); // courses per pixel
953
+ float inside = smoothstep(0.0, 0.05, -wk) * smoothstep(0.0, 3.0, headroom);
954
+ if (inside > 0.0) {
955
+ if (dir.y > 1e-4 && tCeiling < tWall) {
956
+ // The ceiling: darker into the cove where it meets the wall, a faint
957
+ // line between bays, one house light to a bay. Far away, where a bay
958
+ // is a pixel or less, lamps and lines give way to their average.
959
+ float edge = length(onCeiling / uHouseShape.zw);
960
+ vec3 room = uHouseCeiling * mix(1.0, 0.7, smoothstep(0.5, 1.0, edge));
961
+ float detail = 1.0 - smoothstep(0.06, 0.3, bayPixel);
962
+ vec2 cell = fract(bay) - 0.5;
963
+ float r = length(cell);
964
+ float lamp = 1.0 - smoothstep(HOUSE_LAMP_BAYS - bayPixel, HOUSE_LAMP_BAYS + bayPixel, r);
965
+ float glow = exp(-r * r * 46.0);
966
+ vec2 toLine = 0.5 - abs(cell);
967
+ float line = 1.0 - smoothstep(0.012 - bayPixel, 0.012 + bayPixel, min(toLine.x, toLine.y));
968
+ // A joint is a shadow line: plain on a dark ceiling, slight on a pale one.
969
+ room *= 1.0 - mix(0.16, 0.05, dot(uHouseCeiling, vec3(0.2126, 0.7152, 0.0722))) * line * detail;
970
+ room += uHouseLamp * mix(0.05, lamp + 0.22 * glow, detail);
971
+ col = mix(col, room, inside);
972
+ } else {
973
+ // The wall, floor to ceiling: lit from the floor, darkening toward the
974
+ // cove, with the faint joint of each course of panels. Below the
975
+ // floor there is nothing to paint: the ground is drawn there.
976
+ float h = course * HOUSE_COURSE_M / max(1.0, uHouseLevels.y - uHouseLevels.x);
977
+ vec3 room = uHouseWall * mix(1.06, 0.6, smoothstep(0.3, 1.0, h));
978
+ float joint = 1.0 - smoothstep(0.014 - coursePixel, 0.014 + coursePixel, 0.5 - abs(fract(course) - 0.5));
979
+ room *= 1.0 - 0.14 * joint * (1.0 - smoothstep(0.08, 0.35, coursePixel));
980
+ col = mix(col, room, inside * smoothstep(-0.02, 0.0, h));
981
+ }
982
+ }
770
983
  }
771
984
  fragColor = vec4(col, 1.0);
772
- }`,j1=`#version 300 es
985
+ }`,pv=`#version 300 es
773
986
  precision highp float;
774
987
  in float surface;
775
988
  in float iYaw;
@@ -782,6 +995,7 @@ in vec3 iOffset;
782
995
  in float iMaxRadius;
783
996
  in float iHasChair;
784
997
  in float iPhysicalSeat;
998
+ in float iTipUp;
785
999
  in float iFloor;
786
1000
  uniform mat4 modelViewMatrix;
787
1001
  uniform mat4 projectionMatrix;
@@ -798,9 +1012,9 @@ out float vDotWeight;
798
1012
  out float vHidden;
799
1013
  flat out vec3 vPick;
800
1014
  uniform vec3 cameraPosition;
801
- ${Ar}
802
- ${vm}
803
- ${Fn}
1015
+ ${ri}
1016
+ ${Kf}
1017
+ ${io}
804
1018
  void main() {
805
1019
  if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
806
1020
  int id = gl_InstanceID + 1; // 0 reserved for no-hit
@@ -815,7 +1029,7 @@ void main() {
815
1029
  vPhysicalSeat = iPhysicalSeat;
816
1030
  vHidden = (uFocusFloor > -0.5 && abs(iFloor - uFocusFloor) > 0.5) ? 1.0 : 0.0;
817
1031
  gl_Position = projectionMatrix * mv;
818
- }`,W1=`#version 300 es
1032
+ }`,bv=`#version 300 es
819
1033
  precision highp float;
820
1034
  in vec2 vUv;
821
1035
  in float vPhysicalSeat;
@@ -823,7 +1037,7 @@ in float vDotWeight;
823
1037
  in float vHidden;
824
1038
  flat in vec3 vPick;
825
1039
  out vec4 fragColor;
826
- ${Sm}
1040
+ ${Yf}
827
1041
  void main() {
828
1042
  if (vHidden > 0.5) discard;
829
1043
  if (vDotWeight <= 0.99) discard;
@@ -831,16 +1045,17 @@ void main() {
831
1045
  float d = seatSilhouette(vUv, vPhysicalSeat);
832
1046
  if (d > 1.0) discard; // hit-mask matches chair/bay shape
833
1047
  fragColor = vec4(vPick, 1.0);
834
- }`,X1=`#version 300 es
1048
+ }`,yv=`#version 300 es
835
1049
  precision highp float;
836
1050
  in vec3 position;
837
1051
  in float part;
838
1052
  in vec3 iOffset;
839
1053
  in float iRadius;
840
1054
  in float iYaw;
841
- in float iSeed;
842
1055
  in float iPhysicalSeat;
843
1056
  in float iGlyph;
1057
+ in vec4 iArmrests;
1058
+ in float iTipUp;
844
1059
  in float iPickIndex;
845
1060
  in float iFloor;
846
1061
  uniform mat4 modelViewMatrix;
@@ -854,10 +1069,10 @@ flat out vec3 vPick;
854
1069
  out float vChairWeight;
855
1070
  out float vHidden;
856
1071
  uniform vec3 cameraPosition;
857
- ${Ar}
858
- ${xm}
859
- ${va}
860
- ${Fn}
1072
+ ${ri}
1073
+ ${ps}
1074
+ ${ds}
1075
+ ${io}
861
1076
  void main() {
862
1077
  if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
863
1078
  int id = int(iPickIndex + 0.5); // already global index + 1
@@ -868,22 +1083,21 @@ void main() {
868
1083
  float depth = max(viewDepth, 0.001);
869
1084
  float w = viewDepth > 0.05 ? chairWeight(length(anchor.xyz)) : 0.0;
870
1085
  vec3 p = position;
871
- float occupant = step(9.5, part);
872
- float taken = step(0.0, iSeed);
873
1086
  p = glyphChairPosition(p, part, iGlyph);
874
- if (iPhysicalSeat < 0.5) {
875
- p = vec3(0.0);
876
- } else if (occupant > 0.5) {
877
- if (taken < 0.5) {
878
- p = vec3(0.0);
879
- } else {
880
- p.y *= 0.94 + 0.12 * iSeed;
881
- p.xz *= 0.92 + 0.16 * fract(iSeed * 7.13);
882
- p *= occupantWeight(depth);
883
- }
1087
+ // Armrest standards (see fixedRowSeating in seatInstances.ts). The mesh holds
1088
+ // two, told apart by the side of x = 0 they are built on; each is recentred
1089
+ // on its own axis here and stood at its world offset after the yaw below.
1090
+ vec2 armrestAt = vec2(0.0);
1091
+ if (part > 6.5 && part < 7.5) {
1092
+ bool shared = position.x > 0.0;
1093
+ armrestAt = shared ? iArmrests.xy : iArmrests.zw;
1094
+ if (dot(armrestAt, armrestAt) <= 0.0) p = vec3(0.0);
1095
+ else if (dot(p, p) > 0.0) p.x += shared ? -${mn.toFixed(2)} : ${mn.toFixed(2)};
884
1096
  }
1097
+ if (iPhysicalSeat < 0.5) p = vec3(0.0);
885
1098
  p.xz *= iRadius;
886
- float rake = (part > 1.5 && part < 2.5)
1099
+ if (part > 0.5 && part < 1.5) p = tipUpPad(p, iRadius, iTipUp);
1100
+ float rake = ((part > 1.5 && part < 2.5) || (part > 4.5 && part < 6.5))
887
1101
  ? max(p.y - uBackBase, 0.0) * uBackRake * glyphBackRake(iGlyph)
888
1102
  : 0.0;
889
1103
  p.z -= rake;
@@ -891,8 +1105,10 @@ void main() {
891
1105
  vChairWeight = w;
892
1106
  float c = cos(iYaw), s = sin(iYaw);
893
1107
  vec3 rp = vec3(p.x * c + p.z * s, p.y, -p.x * s + p.z * c);
1108
+ // A collapsed armrest (p = 0) must stay collapsed, so the offset rides on w.
1109
+ rp.xz += armrestAt * step(0.01, w) * step(0.0001, dot(p, p));
894
1110
  gl_Position = projectionMatrix * modelViewMatrix * vec4(iOffset + rp, 1.0);
895
- }`,Y1=`#version 300 es
1111
+ }`,gv=`#version 300 es
896
1112
  precision highp float;
897
1113
  flat in vec3 vPick;
898
1114
  in float vHidden;
@@ -902,7 +1118,7 @@ void main() {
902
1118
  if (vHidden > 0.5) discard;
903
1119
  if (vChairWeight < 0.01) discard;
904
1120
  fragColor = vec4(vPick, 1.0);
905
- }`,K1=`#version 300 es
1121
+ }`,xv=`#version 300 es
906
1122
  precision highp float;
907
1123
  in vec3 position;
908
1124
  in vec3 normal;
@@ -922,7 +1138,7 @@ void main() {
922
1138
  vNormalWorld = mat3(modelMatrix) * normal;
923
1139
  vPosWorld = (modelMatrix * vec4(position, 1.0)).xyz;
924
1140
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
925
- }`,$1=`#version 300 es
1141
+ }`,Mv=`#version 300 es
926
1142
  precision highp float;
927
1143
  in float vHidden;
928
1144
  in float vMaterial;
@@ -931,14 +1147,18 @@ in vec3 vPosWorld;
931
1147
  uniform vec3 cameraPosition;
932
1148
  uniform vec2 uRoomCentre;
933
1149
  out vec4 fragColor;
934
- ${Mm}
935
- ${Fn}
1150
+ ${Wf}
1151
+ ${io}
936
1152
  void main() {
937
1153
  if (vHidden > 0.5) discard;
938
1154
  if (roomWallHidden(vMaterial, vNormalWorld, vPosWorld, cameraPosition, uRoomCentre)) discard;
939
1155
  if (seeThroughCut(vPosWorld, cameraPosition)) discard;
1156
+ // Nets and slender fittings (materials 10 and 11) never swallow a tap: a
1157
+ // buyer behind the goal picks a seat through the net. Nor does stage light
1158
+ // (12), which from behind is not there at all.
1159
+ if (vMaterial > 9.5 && vMaterial < 12.5) discard;
940
1160
  fragColor = vec4(0.0, 0.0, 0.0, 1.0);
941
- }`;function wm(e){return new Nt.Program(e,{vertex:j1,fragment:W1,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uSeatRadius:{value:St},uSeatScale:{value:1},uMinPixels:{value:un},uPixelToWorld:{value:.002},uChairFull:{value:Zn},uChairNone:{value:mn},uFocusFloor:{value:-1}}})}function Pm(e){return new Nt.Program(e,{vertex:X1,fragment:Y1,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uChairFull:{value:Zn},uChairNone:{value:mn},uBackRake:{value:Wn},uBackBase:{value:Et},uFocusFloor:{value:-1}}})}function Am(e){return new Nt.Program(e,{vertex:K1,fragment:$1,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uFocusFloor:{value:-1},uRoomCentre:{value:new Float32Array([0,0])}}})}function Im(e,t=.78,n=[.63,.66,.65]){return new Nt.Program(e,{vertex:D1,fragment:N1,cullFace:!1,depthTest:!0,depthWrite:!0,uniforms:{uSeeThrough:{value:[0,0,0,0]},uKeyDir:{value:new Float32Array([-.48,.78,.4])},uFocusFloor:{value:-1},uStructureDetail:{value:0},uDeckColor:{value:new Float32Array(n)},uSectionFilter:{value:0},uRoughness:{value:t},uRoomCentre:{value:new Float32Array([0,0])}}})}function Rm(e){return new Nt.Program(e,{vertex:B1,fragment:V1,transparent:!0,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uKeyDir:{value:new Float32Array([-.48,.78,.4])},uSeatRadius:{value:St},uSeatScale:{value:1},uMinPixels:{value:un},uPixelToWorld:{value:.002},uSeatFade:{value:0},uSeatDetail:{value:0},uFocusFloor:{value:-1},uFocusSection:{value:-1},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:Zn},uChairNone:{value:mn}}})}function Em(e,t=.78){return new Nt.Program(e,{vertex:G1,fragment:H1,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uKeyDir:{value:new Float32Array([-.48,.78,.4])},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:Zn},uChairNone:{value:mn},uBackRake:{value:Wn},uBackBase:{value:Et},uFocusFloor:{value:-1},uFocusSection:{value:-1},uRoughness:{value:t}}})}function Cm(e,t,n,o){return new Nt.Program(e,{vertex:z1,fragment:U1,depthTest:!1,depthWrite:!1,cullFace:!1,uniforms:{uTop:{value:new Float32Array(t)},uBottom:{value:new Float32Array(n)},uSky:{value:o?1:0},uZenith:{value:new Float32Array(o?.zenith??[0,0,0])},uHorizon:{value:new Float32Array(o?.horizon??[0,0,0])},uInvViewProj:{value:new Float32Array(16)}}})}var nt=require("ogl");function _m(e,t,n){let r=Math.max(3,n.radius*1.04),[i,a,s]=n.center,c=new nt.Camera(e,{left:-r,right:r,bottom:-r,top:r,near:.1,far:r*6});c.position.set(i-r*1.44,a+r*2.34,s+r*1.2),c.lookAt([i,a,s]);let l=new nt.RenderTarget(e,{width:1024,height:1024,depthTexture:!0,minFilter:e.NEAREST,magFilter:e.NEAREST}),u=new nt.Program(e,{cullFace:!1,vertex:`#version 300 es
1161
+ }`;function $f(e){return new on.Program(e,{vertex:pv,fragment:bv,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uSeatRadius:{value:Gt},uSeatScale:{value:1},uMinPixels:{value:kn},uPixelToWorld:{value:.002},uChairFull:{value:bo},uChairNone:{value:On},uFocusFloor:{value:-1}}})}function Zf(e){return new on.Program(e,{vertex:yv,fragment:gv,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uChairFull:{value:bo},uChairNone:{value:On},uBackRake:{value:mo},uBackBase:{value:Bt},uFocusFloor:{value:-1}}})}function qf(e){return new on.Program(e,{vertex:xv,fragment:Mv,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uFocusFloor:{value:-1},uRoomCentre:{value:new Float32Array([0,0])}}})}function Qf(e,t=.78,n=[.63,.66,.65]){return new on.Program(e,{vertex:av,fragment:cv,cullFace:!1,depthTest:!0,depthWrite:!0,uniforms:{uSeeThrough:{value:[0,0,0,0]},uKeyDir:{value:new Float32Array([-.48,.78,.4])},uKeyColor:{value:new Float32Array([1,1,1])},uAmbientColor:{value:new Float32Array([1,1,1])},uFocusFloor:{value:-1},uStructureDetail:{value:0},uDeckColor:{value:new Float32Array(n)},uSectionFilter:{value:0},uRoughness:{value:t},uRoomCentre:{value:new Float32Array([0,0])},uViewport:{value:new Float32Array([1,1])},uTop:{value:new Float32Array([0,0,0])},uBottom:{value:new Float32Array([0,0,0])},uSky:{value:0},uZenith:{value:new Float32Array([0,0,0])},uHorizon:{value:new Float32Array([0,0,0])}}})}function Jf(e){return new on.Program(e,{vertex:lv,fragment:uv,transparent:!0,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uKeyDir:{value:new Float32Array([-.48,.78,.4])},uKeyColor:{value:new Float32Array([1,1,1])},uAmbientColor:{value:new Float32Array([1,1,1])},uSeatRadius:{value:Gt},uSeatScale:{value:1},uMinPixels:{value:kn},uPixelToWorld:{value:.002},uSeatFade:{value:0},uSeatDetail:{value:0},uFocusFloor:{value:-1},uFocusSection:{value:-1},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:bo},uChairNone:{value:On}}})}function eh(e,t=.78){return new on.Program(e,{vertex:mv,fragment:fv,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uKeyDir:{value:new Float32Array([-.48,.78,.4])},uKeyColor:{value:new Float32Array([1,1,1])},uAmbientColor:{value:new Float32Array([1,1,1])},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:bo},uChairNone:{value:On},uBackRake:{value:mo},uBackBase:{value:Bt},uFocusFloor:{value:-1},uFocusSection:{value:-1},uRoughness:{value:t}}})}function th(e,t,n,o,r){return new on.Program(e,{vertex:hv,fragment:dv,depthTest:!1,depthWrite:!1,cullFace:!1,uniforms:{uTop:{value:new Float32Array(t)},uBottom:{value:new Float32Array(n)},uSky:{value:o?1:0},uZenith:{value:new Float32Array(o?.zenith??[0,0,0])},uHorizon:{value:new Float32Array(o?.horizon??[0,0,0])},uInvViewProj:{value:new Float32Array(16)},uHouse:{value:r?1:0},uHouseShape:{value:new Float32Array(r?[...r.centre,...r.radii]:[0,0,1,1])},uHouseLevels:{value:new Float32Array(r?[r.floorY,r.ceilingY]:[0,1])},uHouseCeiling:{value:new Float32Array(r?.ceiling??[0,0,0])},uHouseWall:{value:new Float32Array(r?.wall??[0,0,0])},uHouseLamp:{value:new Float32Array(r?.lamp??[0,0,0])},uEye:{value:new Float32Array(3)}}})}var st=require("ogl"),vv=45,Sv=.16;function nh(e,t,n,o){let r=Math.max(3,n.radius*1.04),i=e.getParameter(e.MAX_TEXTURE_SIZE),a=r<=vv||i<2048?1024:2048,s=!!o&&2*r/a<=Sv,[c,l,u]=n.center,m=new st.Camera(e,{left:-r,right:r,bottom:-r,top:r,near:.1,far:r*6});m.position.set(c-r*1.44,l+r*2.34,u+r*1.2),m.lookAt([c,l,u]);let f=new st.RenderTarget(e,{width:a,height:a,depthTexture:!0,minFilter:e.NEAREST,magFilter:e.NEAREST}),h=new st.Program(e,{cullFace:!1,vertex:`#version 300 es
942
1162
  in vec3 position;
943
1163
  in float materialIndex;
944
1164
  uniform mat4 modelViewMatrix;
@@ -949,9 +1169,30 @@ void main() {
949
1169
  in float vMaterial;
950
1170
  out vec4 fragColor;
951
1171
  void main() {
952
- if (abs(vMaterial - 6.0) < 0.5) discard;
1172
+ // ...nor do nets and slender sport fittings (10, 11): a net is mostly air.
1173
+ if (abs(vMaterial - 6.0) < 0.5 || (vMaterial > 9.5 && vMaterial < 12.5)) discard;
953
1174
  fragColor = vec4(1.0);
954
- }`}),m=new nt.Transform,f=new nt.Mesh(e,{geometry:t,program:u});f.frustumCulled=!1,f.setParent(m);let d=e.getParameter(e.COLOR_CLEAR_VALUE),h=e.isEnabled(e.DITHER);try{e.disable(e.DITHER),e.clearColor(1,1,1,1),e.renderer.render({scene:m,camera:c,target:l})}finally{h&&e.enable(e.DITHER),e.clearColor(d[0],d[1],d[2],d[3]),u.remove()}let p=new nt.Mat4().multiply(c.projectionMatrix,c.viewMatrix);return{texture:l.depthTexture,matrix:p,dispose(){for(let b of l.textures)e.deleteTexture(b.texture);e.deleteTexture(l.depthTexture.texture),e.deleteFramebuffer(l.buffer),l.depthBuffer&&e.deleteRenderbuffer(l.depthBuffer)}}}var Z1=.65,q1=new Set(["dimmed","sold","held"]);function Tm(e,t,n){let o=new Set,r=!1;for(let i of e){let a=t.get(i.sectionId);if(!a||!a.length){o.add(i.sectionId);continue}let s=!1;for(let c of a){let l=ze[n[c]]??"available";if(!q1.has(l)){s=!0;break}}s?o.add(i.sectionId):r=!0}return{lit:o,anyUnlit:r}}function Lm(e,t,n,o,r,i){let a=[];for(let s of e){let c=r===null||r.has(s.sectionId);if(o.get(s.sectionId)===c)continue;o.set(s.sectionId,c);let l=(s.start+s.count)*3;for(let u=s.start*3;u<l;u++)t[u]=c?n[u]:n[u]+(i[u%3]-n[u])*Z1;a.push(s)}return a}var km=ze.indexOf("selected");function Q1(e,t){return[0,1,2].map(n=>e[n]*.15+.75+t[n]*.1)}function Om(e,t,n,o,r,i){for(let a=n;a<n+o;a++){let s=i&&t[a]===0,c=i&&t[a]===km?Q1([i[a*3],i[a*3+1],i[a*3+2]],r[km]??r[0]):s?null:r[t[a]]??r[0];e[a*3]=c?c[0]:i[a*3],e[a*3+1]=c?c[1]:i[a*3+1],e[a*3+2]=c?c[2]:i[a*3+2]}}var J1=new Float32Array([-1,-1,3,-1,-1,3]);function Fm(e,t){let n=new Ne.Transform,o=new Ne.Transform,r=new Ne.Geometry(e,{position:{size:2,data:J1}}),i=Cm(e,t.theme.background.top,t.theme.background.bottom,t.outdoor?t.theme.sky:null),a=new Ne.Mesh(e,{geometry:r,program:i});a.frustumCulled=!1,a.setParent(o);let s=new Ne.Geometry(e,{position:{size:3,data:t.solids.position},normal:{size:3,data:t.solids.normal},color:{size:3,data:t.solids.color},floorIndex:{size:1,data:t.solids.floor},materialIndex:{size:1,data:t.solids.material}}),c=_m(e,s,t.renderBounds),l=Im(e,t.theme.materials.roughness,t.theme.structure.tierTop);l.uniforms.tVenueShadow={value:c.texture},l.uniforms.uShadowMatrix={value:c.matrix},t.room&&l.uniforms.uRoomCentre.value.set(t.room.centre);let u=new Ne.Mesh(e,{geometry:s,program:l});u.frustumCulled=!1,u.setParent(n);let m=Rm(e),f=new Float32Array(t.seats.count*3),d=ze.map(J=>t.theme.seatStates[J]),h=t.seats.iCategory.slice(),p=an(t.theme.structure);for(let J=0;J<t.seats.count;J++){if(t.seats.iPhysicalSeat[J]<.5)continue;let ce=t.theme.materials.seat??ps([h[J*3],h[J*3+1],h[J*3+2]],p);h.set(ce,J*3)}Om(f,t.seats.iState,0,t.seats.count,d,h);let b=cs(),y=new Uint8Array(t.seats.count),M=new Ne.Geometry(e,{position:{size:3,data:b.position},normal:{size:3,data:b.normal},uv:{size:2,data:b.uv},index:{size:1,data:b.index},surface:{size:1,data:b.surface},iYaw:{size:1,data:t.seats.iYaw,instanced:1},iChairWidth:{size:1,data:t.seats.iChairWidth,instanced:1},iGlyph:{size:1,data:t.seats.iGlyph,instanced:1},iOffset:{size:3,data:t.seats.iPosition,instanced:1},iColor:{size:3,data:f,instanced:1},iMaxRadius:{size:1,data:t.seats.iMaxRadius,instanced:1},iHasChair:{size:1,data:y,type:e.UNSIGNED_BYTE,usage:e.DYNAMIC_DRAW,instanced:1},iPhysicalSeat:{size:1,data:t.seats.iPhysicalSeat,instanced:1},iRing:{size:3,data:t.seats.iRing,instanced:1},iFloor:{size:1,data:t.seats.iFloor,instanced:1},iSection:{size:1,data:t.seats.iSection,instanced:1}}),S=new Ne.Mesh(e,{geometry:M,program:m});S.frustumCulled=!1,t.seats.count>0&&S.setParent(n);let A=M.attributes.iColor,x=t.solids.color.slice(),g=t.theme.structure.ground,w=new Map(t.sectionSolidRanges.map(J=>[J.sectionId,!0])),v=is(),P=Em(e,t.theme.materials.roughness),R=Bo,k=new Float32Array(R*3),F=new Float32Array(R*3),E=new Float32Array(R),I=new Float32Array(R),C=new Float32Array(R),L=new Float32Array(R*3),N=new Float32Array(R),O=new Float32Array(R),H=new Float32Array(R),j=new Float32Array(R),V=new Float32Array(R),T=new Ne.Geometry(e,{position:{size:3,data:v.position},normal:{size:3,data:v.normal},part:{size:1,data:v.part},index:{data:v.index},iOffset:{size:3,data:k,instanced:1},iColor:{size:3,data:F,instanced:1},iRadius:{size:1,data:E,instanced:1},iYaw:{size:1,data:I,instanced:1},iGlyph:{size:1,data:C,instanced:1},iRing:{size:3,data:L,instanced:1},iFloor:{size:1,data:N,instanced:1},iSection:{size:1,data:O,instanced:1},iPhysicalSeat:{size:1,data:H,instanced:1},iSeed:{size:1,data:V,instanced:1},iPickIndex:{size:1,data:j,instanced:1}}),B=new Ne.Mesh(e,{geometry:T,program:P});B.frustumCulled=!1;let D=0,G=!1,U=!1,q=null,$=null,te=null,Q=new Int32Array(0),X=()=>{let J=t.seats;for(let ce=0;ce<D;ce++){let oe=Q[ce];V[ce]=Gs(J.iState[oe],oe),F[ce*3]=f[oe*3],F[ce*3+1]=f[oe*3+1],F[ce*3+2]=f[oe*3+2]}T.attributes.iColor.needsUpdate=!0,T.attributes.iSeed.needsUpdate=!0},Y={main:n,background:o,backgroundProgram:i,seatProgram:m,solidProgram:l,chairProgram:P,seatGeometry:M,chairGeometry:T,solidGeometry:s,drawCalls:3,setNearSeats(J,ce){let oe=Math.min(ce,R,J.length);if(gm(y,J,oe),M.attributes.iHasChair.needsUpdate=!0,Q=J,D=oe,oe===0){B.parent&&B.setParent(null),T.instancedCount=0,Y.drawCalls=3+(G?1:0);return}let ee=t.seats;for(let ne=0;ne<oe;ne++){let he=J[ne];k[ne*3]=ee.iPosition[he*3],k[ne*3+1]=ee.iPosition[he*3+1],k[ne*3+2]=ee.iPosition[he*3+2],E[ne]=ee.iChairWidth[he],I[ne]=ee.iYaw[he],C[ne]=ee.iGlyph[he],L[ne*3]=ee.iRing[he*3],L[ne*3+1]=ee.iRing[he*3+1],L[ne*3+2]=ee.iRing[he*3+2],N[ne]=ee.iFloor[he],O[ne]=ee.iSection[he],H[ne]=ee.iPhysicalSeat[he],j[ne]=he+1}X(),T.attributes.iOffset.needsUpdate=!0,T.attributes.iRadius.needsUpdate=!0,T.attributes.iYaw.needsUpdate=!0,T.attributes.iGlyph.needsUpdate=!0,T.attributes.iRing.needsUpdate=!0,T.attributes.iFloor.needsUpdate=!0,T.attributes.iSection.needsUpdate=!0,T.attributes.iPhysicalSeat.needsUpdate=!0,T.attributes.iSeed.needsUpdate=!0,T.attributes.iPickIndex.needsUpdate=!0,T.instancedCount=oe,B.parent||B.setParent(n),Y.drawCalls=4+(G?1:0)},nearSeatCount(){return D},setSectionShellLit(J){l.uniforms.uSectionFilter.value=J===null?0:1;let ce=Lm(t.sectionSolidRanges,t.solids.color,x,w,J,g);if(!ce.length)return;let oe=s.attributes.color,ee=oe.buffer;if(!ee){oe.needsUpdate=!0;return}e.bindBuffer(e.ARRAY_BUFFER,ee);for(let ne of ce){let he=t.solids.color.subarray(ne.start*3,(ne.start+ne.count)*3);e.bufferSubData(e.ARRAY_BUFFER,ne.start*3*Float32Array.BYTES_PER_ELEMENT,he)}},uploadSeatStateRuns(J){if(!J.length)return;D&&X();for(let oe of J)Om(f,t.seats.iState,oe.start,oe.length,d,h);let ce=A.buffer;if(!ce){A.needsUpdate=!0;return}e.bindBuffer(e.ARRAY_BUFFER,ce);for(let oe of J){let ee=f.subarray(oe.start*3,(oe.start+oe.length)*3);e.bufferSubData(e.ARRAY_BUFFER,oe.start*3*Float32Array.BYTES_PER_ELEMENT,ee)}},dispose(){U=!0,c.dispose(),r.remove(),i.remove(),s.remove(),l.remove(),M.remove(),m.remove(),T.remove(),P.remove(),q?.remove(),$?.remove(),te?.texture&&e.deleteTexture(te.texture)}},K=t.productionElements.find(J=>J.contentImageUrl&&J.contentPlane);if(K?.contentImageUrl&&K.contentPlane?.length===4&&typeof Image<"u"){let J=new Image;J.crossOrigin="anonymous",J.onload=()=>{if(U)return;let ce=K.contentPlane;q=new Ne.Geometry(e,{position:{size:3,data:new Float32Array(ce.flat())},uv:{size:2,data:new Float32Array([0,1,1,1,0,0,1,0])},floorIndex:{size:1,data:new Float32Array(4).fill(K.floorIndex)},index:{data:new Uint16Array([0,1,2,2,1,3])}}),te=new Ne.Texture(e,{image:J,generateMipmaps:!0,wrapS:e.CLAMP_TO_EDGE,wrapT:e.CLAMP_TO_EDGE,flipY:!1}),$=new Ne.Program(e,{vertex:`#version 300 es
1175
+ }`}),d=new st.Transform,p=new st.Mesh(e,{geometry:t,program:h});p.frustumCulled=!1,p.setParent(d);let b=s?new st.Program(e,{cullFace:!1,vertex:`#version 300 es
1176
+ in vec3 position;
1177
+ in float surface;
1178
+ in vec3 iOffset;
1179
+ in float iYaw;
1180
+ in float iChairWidth;
1181
+ in float iPhysicalSeat;
1182
+ uniform mat4 modelViewMatrix;
1183
+ uniform mat4 projectionMatrix;
1184
+ void main() {
1185
+ if (iPhysicalSeat < 0.5 || surface < 0.5) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
1186
+ vec3 p = position;
1187
+ if (surface < 1.5 && p.y < 0.40) p.y = 0.02;
1188
+ p.xz *= iChairWidth;
1189
+ float c = cos(iYaw), s = sin(iYaw);
1190
+ vec3 rotated = vec3(p.x * c + p.z * s, p.y, -p.x * s + p.z * c);
1191
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(iOffset + rotated, 1.0);
1192
+ }`,fragment:`#version 300 es
1193
+ precision highp float;
1194
+ out vec4 fragColor;
1195
+ void main() { fragColor = vec4(1.0); }`}):null;if(b&&o){let A=new st.Mesh(e,{geometry:o,program:b});A.frustumCulled=!1,A.setParent(d)}let x=e.getParameter(e.COLOR_CLEAR_VALUE),y=e.isEnabled(e.DITHER);try{e.disable(e.DITHER),e.clearColor(1,1,1,1),e.renderer.render({scene:d,camera:m,target:f})}finally{y&&e.enable(e.DITHER),e.clearColor(x[0],x[1],x[2],x[3]),h.remove(),b?.remove()}let M=new st.Mat4().multiply(m.projectionMatrix,m.viewMatrix);return{texture:f.depthTexture,matrix:M,seatsCast:s,dispose(){for(let A of f.textures)e.deleteTexture(A.texture);e.deleteTexture(f.depthTexture.texture),e.deleteFramebuffer(f.buffer),f.depthBuffer&&e.deleteRenderbuffer(f.depthBuffer)}}}var wv=.65,Pv=new Set(["dimmed","sold","held"]);function oh(e,t,n){let o=new Set,r=!1;for(let i of e){let a=t.get(i.sectionId);if(!a||!a.length){o.add(i.sectionId);continue}let s=!1;for(let c of a){let l=je[n[c]]??"available";if(!Pv.has(l)){s=!0;break}}s?o.add(i.sectionId):r=!0}return{lit:o,anyUnlit:r}}function rh(e,t,n,o,r,i){let a=[];for(let s of e){let c=r===null||r.has(s.sectionId);if(o.get(s.sectionId)===c)continue;o.set(s.sectionId,c);let l=(s.start+s.count)*3;for(let u=s.start*3;u<l;u++)t[u]=c?n[u]:n[u]+(i[u%3]-n[u])*wv;a.push(s)}return a}var Av=je.map(e=>e==="available"||e==="dimmed"),ih=je.indexOf("selected");function Rv(e,t){return[0,1,2].map(n=>e[n]*.15+.75+t[n]*.1)}function ah(e,t,n,o,r,i){for(let a=n;a<n+o;a++){let s=i&&t[a]===0,c=i&&t[a]===ih?Rv([i[a*3],i[a*3+1],i[a*3+2]],r[ih]??r[0]):s?null:r[t[a]]??r[0];e[a*3]=c?c[0]:i[a*3],e[a*3+1]=c?c[1]:i[a*3+1],e[a*3+2]=c?c[2]:i[a*3+2]}}var Ev=new Float32Array([-1,-1,3,-1,-1,3]);function sh(e,t){let n=new ze.Transform,o=new ze.Transform,r=new ze.Geometry(e,{position:{size:2,data:Ev}}),i=th(e,t.theme.background.top,t.theme.background.bottom,t.outdoor?t.theme.sky:null,t.house&&t.theme.house?{...t.house,...t.theme.house}:null),a=new ze.Mesh(e,{geometry:r,program:i});a.frustumCulled=!1,a.setParent(o);let s=new ze.Geometry(e,{position:{size:3,data:t.solids.position},normal:{size:3,data:t.solids.normal},color:{size:3,data:t.solids.color},floorIndex:{size:1,data:t.solids.floor},materialIndex:{size:1,data:t.solids.material}}),c=Qf(e,t.theme.materials.roughness,t.theme.structure.tierTop);t.room&&c.uniforms.uRoomCentre.value.set(t.room.centre);for(let B of["uTop","uBottom","uSky","uZenith","uHorizon"])c.uniforms[B]=i.uniforms[B];let l=new ze.Mesh(e,{geometry:s,program:c});l.frustumCulled=!1,l.setParent(n);let u=Jf(e),m=new Float32Array(t.seats.count*3),f=je.map(B=>t.theme.seatStates[B]),h=t.seats.iCategory.slice(),d=Vt(t.theme.structure);for(let B=0;B<t.seats.count;B++){if(t.seats.iPhysicalSeat[B]<.5)continue;let Y=t.theme.materials.seat??bc([h[B*3],h[B*3+1],h[B*3+2]],d);h.set(Y,B*3)}ah(m,t.seats.iState,0,t.seats.count,f,h);let p=lc(),b=new Uint8Array(t.seats.count),x=new Uint8Array(t.seats.count);for(let B=0;B<t.seats.count;B++){let Y=t.seats.iArmrests[B*4]!==0||t.seats.iArmrests[B*4+1]!==0;x[B]=Y&&t.seats.iPhysicalSeat[B]>=.5&&t.seats.iGlyph[B]<1.5?1:0}let y=new Float32Array(t.seats.count),M=(B,Y)=>{for(let q=B;q<B+Y;q++)y[q]=x[q]&&Av[t.seats.iState[q]]?1:0};M(0,t.seats.count);let A=new ze.Geometry(e,{position:{size:3,data:p.position},normal:{size:3,data:p.normal},uv:{size:2,data:p.uv},index:{size:1,data:p.index},surface:{size:1,data:p.surface},iYaw:{size:1,data:t.seats.iYaw,instanced:1},iChairWidth:{size:1,data:t.seats.iChairWidth,instanced:1},iGlyph:{size:1,data:t.seats.iGlyph,instanced:1},iOffset:{size:3,data:t.seats.iPosition,instanced:1},iColor:{size:3,data:m,instanced:1},iMaxRadius:{size:1,data:t.seats.iMaxRadius,instanced:1},iHasChair:{size:1,data:b,type:e.UNSIGNED_BYTE,usage:e.DYNAMIC_DRAW,instanced:1},iPhysicalSeat:{size:1,data:t.seats.iPhysicalSeat,instanced:1},iTipUp:{size:1,data:y,usage:e.DYNAMIC_DRAW,instanced:1},iRing:{size:3,data:t.seats.iRing,instanced:1},iFloor:{size:1,data:t.seats.iFloor,instanced:1},iSection:{size:1,data:t.seats.iSection,instanced:1}}),w=new ze.Mesh(e,{geometry:A,program:u});w.frustumCulled=!1,t.seats.count>0&&w.setParent(n);let g=nh(e,s,t.renderBounds,t.seats.count>0?A:null);c.uniforms.tVenueShadow={value:g.texture},c.uniforms.uShadowMatrix={value:g.matrix};let S=A.attributes.iColor,v=t.solids.color.slice(),P=t.theme.structure.ground,E=new Map(t.sectionSolidRanges.map(B=>[B.sectionId,!0])),k=ac(),L=eh(e,t.theme.materials.roughness),I=pr,R=new Float32Array(I*3),_=new Float32Array(I*3),F=new Float32Array(I),N=new Float32Array(I),O=new Float32Array(I),V=new Float32Array(I*3),z=new Float32Array(I),G=new Float32Array(I),T=new Float32Array(I),D=new Float32Array(I*4),W=new Float32Array(I),H=new Float32Array(I),j=new Float32Array(I),Z=new ze.Geometry(e,{position:{size:3,data:k.position},normal:{size:3,data:k.normal},part:{size:1,data:k.part},index:{data:k.index},iOffset:{size:3,data:R,instanced:1},iColor:{size:3,data:_,instanced:1},iRadius:{size:1,data:F,instanced:1},iYaw:{size:1,data:N,instanced:1},iGlyph:{size:1,data:O,instanced:1},iRing:{size:3,data:V,instanced:1},iFloor:{size:1,data:z,instanced:1},iSection:{size:1,data:G,instanced:1},iPhysicalSeat:{size:1,data:T,instanced:1},iArmrests:{size:4,data:D,instanced:1},iTipUp:{size:1,data:W,instanced:1},iTaken:{size:1,data:j,instanced:1},iPickIndex:{size:1,data:H,instanced:1}}),X=B=>B.map(Y=>1+(Y-1)*Uc);c.uniforms.uKeyColor.value.set(t.theme.light.key),c.uniforms.uAmbientColor.value.set(t.theme.light.ambient);for(let B of[u,L])B.uniforms.uKeyColor.value.set(X(t.theme.light.key)),B.uniforms.uAmbientColor.value.set(X(t.theme.light.ambient));let ee=new ze.Mesh(e,{geometry:Z,program:L});ee.frustumCulled=!1;let ne=0,ue=!1,de=!1,me=null,pe=null,Pe=null,_e=new Int32Array(0),xe=()=>{let B=t.seats;for(let Y=0;Y<ne;Y++){let q=_e[Y];j[Y]=Vc(B.iState[q]),W[Y]=y[q],_[Y*3]=m[q*3],_[Y*3+1]=m[q*3+1],_[Y*3+2]=m[q*3+2]}Z.attributes.iColor.needsUpdate=!0,Z.attributes.iTipUp.needsUpdate=!0,Z.attributes.iTaken.needsUpdate=!0},Ce={main:n,background:o,backgroundProgram:i,seatProgram:u,solidProgram:c,chairProgram:L,seatGeometry:A,chairGeometry:Z,solidGeometry:s,drawCalls:3,setNearSeats(B,Y){let q=Math.min(Y,I,B.length);if(jf(b,B,q),A.attributes.iHasChair.needsUpdate=!0,_e=B,ne=q,q===0){ee.parent&&ee.setParent(null),Z.instancedCount=0,Ce.drawCalls=3+(ue?1:0);return}let J=t.seats;for(let te=0;te<q;te++){let ae=B[te];R[te*3]=J.iPosition[ae*3],R[te*3+1]=J.iPosition[ae*3+1],R[te*3+2]=J.iPosition[ae*3+2],F[te]=J.iChairWidth[ae],N[te]=J.iYaw[ae],O[te]=J.iGlyph[ae],V[te*3]=J.iRing[ae*3],V[te*3+1]=J.iRing[ae*3+1],V[te*3+2]=J.iRing[ae*3+2],z[te]=J.iFloor[ae],G[te]=J.iSection[ae],T[te]=J.iPhysicalSeat[ae],D.set(J.iArmrests.subarray(ae*4,ae*4+4),te*4),H[te]=ae+1}xe(),Z.attributes.iOffset.needsUpdate=!0,Z.attributes.iRadius.needsUpdate=!0,Z.attributes.iYaw.needsUpdate=!0,Z.attributes.iGlyph.needsUpdate=!0,Z.attributes.iRing.needsUpdate=!0,Z.attributes.iFloor.needsUpdate=!0,Z.attributes.iSection.needsUpdate=!0,Z.attributes.iPhysicalSeat.needsUpdate=!0,Z.attributes.iArmrests.needsUpdate=!0,Z.attributes.iTaken.needsUpdate=!0,Z.attributes.iPickIndex.needsUpdate=!0,Z.instancedCount=q,ee.parent||ee.setParent(n),Ce.drawCalls=4+(ue?1:0)},nearSeatCount(){return ne},setSectionShellLit(B){c.uniforms.uSectionFilter.value=B===null?0:1;let Y=rh(t.sectionSolidRanges,t.solids.color,v,E,B,P);if(!Y.length)return;let q=s.attributes.color,J=q.buffer;if(!J){q.needsUpdate=!0;return}e.bindBuffer(e.ARRAY_BUFFER,J);for(let te of Y){let ae=t.solids.color.subarray(te.start*3,(te.start+te.count)*3);e.bufferSubData(e.ARRAY_BUFFER,te.start*3*Float32Array.BYTES_PER_ELEMENT,ae)}},uploadSeatStateRuns(B){if(!B.length)return;for(let J of B)M(J.start,J.length);let Y=A.attributes.iTipUp;if(!Y.buffer)Y.needsUpdate=!0;else{e.bindBuffer(e.ARRAY_BUFFER,Y.buffer);for(let J of B)e.bufferSubData(e.ARRAY_BUFFER,J.start*Float32Array.BYTES_PER_ELEMENT,y.subarray(J.start,J.start+J.length))}for(let J of B)ah(m,t.seats.iState,J.start,J.length,f,h);ne&&xe();let q=S.buffer;if(!q){S.needsUpdate=!0;return}e.bindBuffer(e.ARRAY_BUFFER,q);for(let J of B){let te=m.subarray(J.start*3,(J.start+J.length)*3);e.bufferSubData(e.ARRAY_BUFFER,J.start*3*Float32Array.BYTES_PER_ELEMENT,te)}},dispose(){de=!0,g.dispose(),r.remove(),i.remove(),s.remove(),c.remove(),A.remove(),u.remove(),Z.remove(),L.remove(),me?.remove(),pe?.remove(),Pe?.texture&&e.deleteTexture(Pe.texture)}},$=t.productionElements.find(B=>B.contentImageUrl&&B.contentPlane);if($?.contentImageUrl&&$.contentPlane?.length===4&&typeof Image<"u"){let B=new Image;B.crossOrigin="anonymous",B.onload=()=>{if(de)return;let Y=$.contentPlane;me=new ze.Geometry(e,{position:{size:3,data:new Float32Array(Y.flat())},uv:{size:2,data:new Float32Array([0,1,1,1,0,0,1,0])},floorIndex:{size:1,data:new Float32Array(4).fill($.floorIndex)},index:{data:new Uint16Array([0,1,2,2,1,3])}}),Pe=new ze.Texture(e,{image:B,generateMipmaps:!0,wrapS:e.CLAMP_TO_EDGE,wrapT:e.CLAMP_TO_EDGE,flipY:!1}),pe=new ze.Program(e,{vertex:`#version 300 es
955
1196
  precision highp float;
956
1197
  in vec3 position; in vec2 uv; in float floorIndex;
957
1198
  uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform float uFocusFloor;
@@ -959,4 +1200,4 @@ void main() {
959
1200
  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
960
1201
  precision highp float;
961
1202
  in vec2 vUv; in float vDim; uniform sampler2D uImage; out vec4 fragColor;
962
- void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:te},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let oe=new Ne.Mesh(e,{geometry:q,program:$});oe.frustumCulled=!1,oe.setParent(n),Y.screenProgram=$,G=!0,Y.drawCalls=3+(D?1:0)+1},J.src=K.contentImageUrl}return Y}var Mt=require("ogl");function ex(e,t,n){let o=e+(t<<8)+(n<<16);return o===0?-1:o-1}function Dm(e,t,n,o,r,i){let a=-1,s=1/0;for(let c=0;c<n;c++)for(let l=0;l<t;l++){let u=(c*t+l)*4,m=ex(e[u],e[u+1],e[u+2]);if(m<0||m>=i)continue;let f=l-o,d=c-r,h=f*f+d*d;h<s&&(s=h,a=m)}return a}function Nm(e,t,n,o,r,i){let a=e-n.left,s=t-n.top,c=Math.round(a*o),l=Math.round((n.height-s)*o);return{x:Math.max(0,Math.min(r-1,c)),y:Math.max(0,Math.min(i-1,l))}}var tx=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],Ir=class{constructor(t,n,o,r,i){this.seatScene=new Mt.Transform;this.chairScene=new Mt.Transform;this.solidScene=new Mt.Transform;this.target=null;this.restoreClear=[0,0,0];this.renderer=t,this.gl=t.gl,this.maxIndex=i,this.seatProg=wm(this.gl),this.chairProg=Pm(this.gl),this.depthProg=Am(this.gl);let a=new Mt.Mesh(this.gl,{geometry:n,program:this.seatProg});a.frustumCulled=!1,a.setParent(this.seatScene);let s=new Mt.Mesh(this.gl,{geometry:o,program:this.chairProg});s.frustumCulled=!1,s.setParent(this.chairScene);let c=new Mt.Mesh(this.gl,{geometry:r,program:this.depthProg});c.frustumCulled=!1,c.setParent(this.solidScene)}setRoomCentre(t){this.depthProg.uniforms.uRoomCentre.value.set(t??[0,0])}setRestoreClear(t){this.restoreClear=[t[0],t[1],t[2]]}syncFromSeatProgram(t){for(let r of tx)this.seatProg.uniforms[r].value=t.uniforms[r].value;let n=t.uniforms.uFocusFloor.value;this.seatProg.uniforms.uFocusFloor.value=n,this.chairProg.uniforms.uFocusFloor.value=n,this.depthProg.uniforms.uFocusFloor.value=n;let o=t.uniforms.uSeeThrough?.value;if(o)for(let r of[this.seatProg,this.chairProg,this.depthProg])r.uniforms.uSeeThrough.value=o}ensureTarget(){let t=this.gl.drawingBufferWidth,n=this.gl.drawingBufferHeight;return this.target&&(this.target.width!==t||this.target.height!==n)&&this.destroyTarget(),this.target||(this.target=new Mt.RenderTarget(this.gl,{width:t,height:n,depth:!0})),this.target}destroyTarget(){if(!this.target)return;let t=this.gl;this.target.buffer&&t.deleteFramebuffer(this.target.buffer);for(let n of this.target.textures??[])n.texture&&t.deleteTexture(n.texture);this.target.depthBuffer&&t.deleteRenderbuffer(this.target.depthBuffer),this.target=null}pick(t,n,o,r){let i=this.gl,a=this.ensureTarget(),s=i.drawingBufferWidth,c=i.drawingBufferHeight,l=Math.max(0,n-r),u=Math.max(0,o-r),m=Math.max(1,Math.min(s,n+r+1)-l),f=Math.max(1,Math.min(c,o+r+1)-u);i.enable(i.SCISSOR_TEST),i.scissor(l,u,m,f);let[d,h,p]=this.restoreClear;i.clearColor(0,0,0,1),this.renderer.render({scene:this.solidScene,camera:t,target:a,clear:!0}),this.renderer.render({scene:this.seatScene,camera:t,target:a,clear:!1}),this.renderer.render({scene:this.chairScene,camera:t,target:a,clear:!1}),i.clearColor(d,h,p,1),i.disable(i.SCISSOR_TEST);let b=new Uint8Array(m*f*4);return this.renderer.bindFramebuffer(a),i.readPixels(l,u,m,f,i.RGBA,i.UNSIGNED_BYTE,b),this.renderer.bindFramebuffer(),Dm(b,m,f,n-l,o-u,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function Bm(e,t){let n=[];for(let o of t)e.has(o.seatId)?e.set(o.seatId,Kn(o.state)):n.push(o);return n}function Vm(e,t,n){let o=new Set;for(let a of t)(e.has(a)||n(a)!==void 0)&&o.add(a);let r=new Map(e),i=[];for(let[a,s]of e)o.has(a)||(i.push({seatId:a,state:ze[s]??"available"}),r.delete(a));for(let a of o){if(r.has(a))continue;let s=n(a);s!==void 0&&(r.set(a,s),i.push({seatId:a,state:"selected"}))}return{updates:i,next:r}}var Bt=require("ogl");function nx(e,t){return[e[0]-t[0],e[1]-t[1],e[2]-t[2]]}function Gm(e,t){return[e[0]+t[0],e[1]+t[1],e[2]+t[2]]}function ox(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Hm(e){let t=Math.hypot(e[0],e[1],e[2]);return t>1e-6?[e[0]/t,e[1]/t,e[2]/t]:[0,0,0]}function Sa(e){let t=Math.max(0,Math.min(1,e));return t*t*t*(t*(t*6-15)+10)}function wa(e,t){return Math.max(0,Math.min(1,e+t))}function zm(e,t){let n=e.length;if(n===0)return[0,0,0];if(n===1)return[...e[0]];let o=Math.max(0,Math.min(1,t)),r=n-1,i=Math.floor(o*r);i>=r&&(i=r-1);let a=o*r-i,s=e[Math.max(0,i-1)],c=e[i],l=e[i+1],u=e[Math.min(n-1,i+2)],m=a*a,f=m*a,d=[0,0,0];for(let h=0;h<3;h++)d[h]=.5*(2*c[h]+(-s[h]+l[h])*a+(2*s[h]-5*c[h]+4*l[h]-u[h])*m+(-s[h]+3*c[h]-3*l[h]+u[h])*f);return d}function Pa(e,t,n,o,r){let i=Hm(nx(t,n));i[0]===0&&i[1]===0&&i[2]===0&&(i=[0,0,1]);let a=Gm(Gm(t,ox(i,2.5)),[0,1.5,0]),s=[t[0]-o[0],0,t[2]-o[2]],c=Hm(s);c[0]===0&&c[2]===0&&(c=[i[0],0,i[2]]);let l=Math.max(1,r),u=[o[0]+c[0]*l*1.3,o[1]+l*.75,o[2]+c[2]*l*1.3];return{waypoints:[e,u,a],finalPos:a}}function Aa(e,t,n=35,o=28){let r=Sa(t),i=zm(e,r),a=Sa(Math.max(0,Math.min(1,(t-.66)/.34)));return{pos:i,fov:n+(o-n)*a,eased:r}}function Xm(e,t,n){let o=e.position.clone(),r=new Bt.Quat().copy(e.quaternion);e.position.set(t[0],t[1],t[2]),e.lookAt(new Bt.Vec3(n[0],n[1],n[2]));let i=new Bt.Quat().copy(e.quaternion);return e.position.copy(o),e.quaternion.copy(r),i}var Rr=class{constructor(t){this.active=!1;this.waypoints=[];this.startQuat=new Bt.Quat;this.endQuat=new Bt.Quat;this.outQuat=new Bt.Quat;this.startTime=0;this.duration=2500;this.endFov=28;this.resolveFn=null;this.camera=t}start(t,n,o,r=2500,i=28){return this.settle(),this.waypoints=t,this.startQuat.copy(n),this.endQuat.copy(o),this.duration=r,this.endFov=i,this.startTime=performance.now(),this.active=!0,new Promise(a=>{this.resolveFn=a})}update(t){if(!this.active)return!1;let n=Math.min(1,(t-this.startTime)/this.duration),{pos:o,fov:r,eased:i}=Aa(this.waypoints,n,35,this.endFov);return this.camera.position.set(o[0],o[1],o[2]),this.outQuat.copy(this.startQuat).slerp(this.endQuat,wa(i,.15)),this.camera.quaternion.copy(this.outQuat),this.camera.fov=r,this.camera.updateProjectionMatrix(),n>=1?(this.settle(),!1):!0}cancel(){this.settle()}settle(){this.active=!1;let t=this.resolveFn;this.resolveFn=null,t&&t()}};var Ym=Jr,rx=.12,ix=1.6,Km=.12;function $m(e,t,n){let o=e[t*3],r=e[t*3+1],i=e[t*3+2],a=n[0]-o,s=n[2]-i,c=Math.hypot(a,s);if(!(c>.001))return null;let l=a/c,u=s/c,m=1/0,f=null;for(let d=0;d*3<e.length;d++){if(d===t)continue;let h=e[d*3]-o,p=e[d*3+2]-i,b=h*l+p*u;b<.3||b>1.6||Math.abs(h*u-p*l)>.6||b<m&&(m=b,f=r-e[d*3+1])}return f}var ax=.25,sx=1.5;function Zm(e,t,n=0,o,r,i=!1){let a=[t.x*_,n+sx,t.y*_],s=r?[r[0],r[1],r[2]]:a,c=e[1],l=Number.isFinite(c)?c+(i?ix:Ym):Number.isFinite(o)?n+o:n+Ym,u=a[0]-e[0],m=a[2]-e[2],f=Math.hypot(u,m),d=f>.001?Math.min(rx,f*ax):0,h=f>.001?u/f:0,p=f>.001?m/f:0;return{eye:[e[0]+h*d,l,e[2]+p*d],focal:s}}var Vt=Math.PI/180,cx=45,Ia=80,Er=70,lx=1,ux=.99;function mx(e,t){if(!(e<lx))return Ia;if(!(Number.isFinite(t)&&t>0))return Er;let n=2*Math.atan(t/(2*Cr*ux)/Math.max(.05,e))/Vt;return Math.max(Er,Math.min(Ia,n))}var fx=.25,Cr=1,dx=.25,hx=12*Vt,px=.2,bx=1.5,qm=.8,Qm=6,rf=1.9,yx=2/3,gx=.12,xx=.9,Mx=1.2,vx=2,af=.05,Sx=6;function sf(e,t,n=0){if(!e.length)return{min:[t[0]-6,n,t[2]-6],max:[t[0]+6,Math.max(n+qm,t[1]),t[2]+6]};let o=1/0,r=-1/0,i=1/0,a=-1/0,s=n;for(let h of e)o=Math.min(o,h.cx-h.halfX),r=Math.max(r,h.cx+h.halfX),i=Math.min(i,h.cz-h.halfZ),a=Math.max(a,h.cz+h.halfZ),s=Math.max(s,h.y);let c=r-o,l=a-i,u=Math.max(c,Math.min(l,Qm))/2,m=Math.max(l,Math.min(c,Qm))/2,f=(o+r)/2,d=(i+a)/2;return{min:[f-u,n,d-m],max:[f+u,Math.max(n+qm,s),d+m]}}function wx(e){return{min:[e.min[0],e.min[1],e.min[2]],max:[e.max[0],e.max[1]+rf,e.max[2]]}}function Ra(e){let t=e.max[1];return[(e.min[0]+e.max[0])/2,Math.max(e.min[1]+bx,t+px,t+rf*yx),(e.min[2]+e.max[2])/2]}function cf(e,t){let n=e[0]-t[0],o=e[2]-t[2],r=Math.hypot(n,o);return r<.001?{x:0,z:1}:{x:n/r,z:o/r}}function Jm(e,t,n){let o=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=Math.hypot(o,r,i)||1;o/=a,r/=a,i/=a;let s=-i,c=o,l=Math.hypot(s,c);if(l<1e-6)return 1/0;s/=l,c/=l;let u=1/0,m=-1/0;for(let f=0;f<8;f++){let d=(f&1?n.max[0]:n.min[0])-e[0],h=(f&2?n.max[1]:n.min[1])-e[1],p=(f&4?n.max[2]:n.min[2])-e[2],b=Math.max(af,d*o+h*r+p*i),y=(d*s+p*c)/b;y<u&&(u=y),y>m&&(m=y)}return m-u}function ef(e,t,n){let o=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=Math.hypot(o,r,i)||1;o/=a,r/=a,i/=a;let s=-i,c=o,l=Math.hypot(s,c);if(l<1e-6)return 1/0;s/=l,c/=l;let u=-c*r,m=c*o-s*i,f=s*r,d=1/0,h=-1/0;for(let p=0;p<8;p++){let b=(p&1?n.max[0]:n.min[0])-e[0],y=(p&2?n.max[1]:n.min[1])-e[1],M=(p&4?n.max[2]:n.min[2])-e[2],S=Math.max(af,b*o+y*r+M*i),A=(b*u+y*m+M*f)/S;A<d&&(d=A),A>h&&(h=A)}return h-d}function _r(e,t){return Math.tan(e*Vt/2)*Math.max(.05,t)}function tf(e,t,n){let o=mx(n,e),r=c=>Math.max(cx,Math.min(o,c)),i=c=>2*Math.atan(c)/Vt,a=Number.isFinite(e)&&e>0?r(i(e/(2*fx)/Math.max(.05,n))):o;if(!(Number.isFinite(t)&&t>0))return a;let s=Math.min(a,r(i(t/(2*gx))));return e/(2*_r(s,n))>Cr?a:s}function lf(e,t,n,o={}){let r=Ra(t),i=[e[0],e[1],e[2]],a=0,s=0,c=h=>{if(!(h>0))return;let p=cf(i,r);i[0]+=p.x*h,i[2]+=p.z*h,s+=h},l=o.preserveEye?0:t.max[1]+dx-i[1];l>0&&(i[1]+=l,a=l,c(l/Math.tan(hx)));let u=wx(t),m=Jm(i,r,t),f=tf(m,ef(i,r,u),n),d=m/(2*_r(f,n));for(let h=0;!o.preserveEye&&h<Sx&&d>Cr;h++){let p=Math.max(1,Math.hypot(i[0]-r[0],i[2]-r[2])),b=Number.isFinite(d)?d/Cr:2;c(Math.min(60,p*(Math.min(4,b)-1)+.5)),m=Jm(i,r,t),f=tf(m,ef(i,r,u),n),d=m/(2*_r(f,n))}return{eye:i,focal:r,fov:f,raisedM:a,pulledBackM:s,stageFrameWidth:d}}function Px(e,t,n){let o=Math.tan(t*Vt/2),r=_r(t,n);return Math.max(1,e/Math.max(.05,Math.min(o,r)))}var Ax=.7,nf=.5,Ix=.8;function of(e,t,n){let o=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],r=[n[0]-e[0],n[1]-e[1],n[2]-e[2]],i=o[0]*r[0]+o[1]*r[1]+o[2]*r[2],a=Math.hypot(o[0],o[1],o[2])*Math.hypot(r[0],r[1],r[2])||1;return Math.acos(Math.max(-1,Math.min(1,i/a)))/Vt}function Rx(e,t,n){let o=l=>{let u=Math.hypot(l[0],l[1],l[2])||1;return[l[0]/u,l[1]/u,l[2]/u]},r=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],i=Math.hypot(r[0],r[1],r[2]),a=o(r),s=o([n[0]-e[0],n[1]-e[1],n[2]-e[2]]),c=o([0,1,2].map(l=>a[l]*(1-nf)+s[l]*nf));return[e[0]+c[0]*i,e[1]+c[1]*i,e[2]+c[2]*i]}function uf(e,t){let{aspect:n,venue:o}=t,r=e.focal,i=cf(e.eye,r),a=p=>(p[0]-r[0])*i.x+(p[2]-r[2])*i.z,s=[{name:"seat",eye:e.eye,focal:r,fov:e.fov}],c=vx*(t.rowDepthM??xx),l=[e.eye[0]+i.x*c,e.eye[1]+Mx,e.eye[2]+i.z*c],u=[e.eye[0],e.eye[1]-Ax,e.eye[2]],m=Rx(l,r,u);s.push({name:"row",eye:l,focal:m,fov:Math.min(Ia,Math.max(e.fov,2*Math.max(of(l,m,u),of(l,m,r))/Ix))});let f=(p,b,y,M)=>{let S=Px(y,e.fov,n)*1.08,A=S*Math.sin(M*Vt),x=Number.isFinite(t.seatingTopY)?t.seatingTopY+2:-1/0,g=Math.max(A,x-b[1]),w=S*Math.cos(M*Vt);return{name:p,eye:[b[0]+i.x*w,b[1]+g,b[2]+i.z*w],focal:b,fov:e.fov}};t.section&&t.section.radius>0&&s.push(f("section",t.section.center,t.section.radius,35)),s.push(f("venue",o.center,Math.max(1,o.radius),40));let d=[],h=-1/0;for(let p of s){let b=a(p.eye);d.length&&b<=h+.5||(d.push(p),h=b)}return d}var hf=require("ogl"),wo=Math.PI/180,Ea=320,mf=70*wo,Ex=32*wo,Cx=24*wo,ff=.0026,_x=.22,Tx=.006,Lx=180,kx=900,Ox=1100,Fx=4,Xe=(e,t,n)=>Math.max(t,Math.min(n,e)),df=e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2;function pf(e){let{canvas:t,camera:n}=e,o=[],r=!1,i=0,a=0,s=0,c=0,l=0,u=0,m=Ea,f=null,d=()=>{f&&(clearTimeout(f),f=null)},h=!1,p=[0,0],b=0,y=!1,M=null,S=null,A=new Map,x=!1,g=0,w=0,v=0,P=0,R=()=>r&&o.length?o[Xe(Math.round(i),0,o.length-1)].name:null,k=()=>{let T=R();T!==M&&(M=T,e.onStopChange?.(T))},F=()=>{if(!r||!o.length)return;let T=o[Xe(Math.floor(i),0,o.length-1)],B=o[Xe(Math.ceil(i),0,o.length-1)],D=Xe(i-Math.floor(i),0,1),G=(ee,ne)=>ee+(ne-ee)*D,U=[G(T.eye[0],B.eye[0]),G(T.eye[1],B.eye[1]),G(T.eye[2],B.eye[2])],q=[G(T.focal[0],B.focal[0]),G(T.focal[1],B.focal[1]),G(T.focal[2],B.focal[2])],$=q[0]-U[0],te=q[1]-U[1],Q=q[2]-U[2],X=Math.hypot($,te,Q)||1,Y=Math.atan2($,Q),K=Math.asin(Xe(te/X,-1,1)),J=Y+a,ce=Xe(K+s,-80*wo,80*wo),oe=Math.cos(ce)*X;$=Math.sin(J)*oe,te=Math.sin(ce)*X,Q=Math.cos(J)*oe,n.position.set(U[0],U[1],U[2]),n.fov=G(T.fov,B.fov),n.updateProjectionMatrix(),n.lookAt(new hf.Vec3(U[0]+$,U[1]+te,U[2]+Q)),e.onApplied?.()},E=()=>{if(!r||!o.length)return;let T=Xe(Math.round(i),0,o.length-1);if(e.reducedMotion()){h=!1,i=T,F(),k(),e.requestRender();return}if(Math.abs(T-i)<.001){h=!1,k();return}c=i,l=T,u=performance.now(),m=Ea,h=!0,e.requestRender()},I=T=>{!r||o.length<2||(d(),h=!1,i=Xe(i+T,0,o.length-1),F(),k(),e.requestRender())},C=(T,B)=>{r&&(d(),h=!1,y=!1,a=Xe(a-T*ff,-mf,mf),s=Xe(s-B*ff,-Cx,Ex),F(),e.requestRender())},L=T=>{r&&(A.set(T.pointerId,{x:T.clientX,y:T.clientY}),A.size===1?(x=!0,P=0,g=T.clientX,w=T.clientY):A.size===2&&(x=!1,v=N()))},N=()=>{let T=[...A.values()];return T.length<2?0:Math.hypot(T[0].x-T[1].x,T[0].y-T[1].y)},O=T=>{if(!r||!A.has(T.pointerId))return;if(A.set(T.pointerId,{x:T.clientX,y:T.clientY}),A.size>=2){let G=N();v>0&&I((v-G)*Tx),v=G;return}if(!x)return;let B=T.clientX-g,D=T.clientY-w;g=T.clientX,w=T.clientY,P+=Math.abs(B)+Math.abs(D),!(P<=Fx)&&C(B,D)},H=T=>{A.delete(T.pointerId)&&(A.size<2&&(v=0),A.size===0&&(x=!1,E()))},j=T=>{if(!r)return;T.preventDefault();let B=T.deltaMode===1?16:T.deltaMode===2?100:1,D=Xe(T.deltaY*B/100,-2,2);I(D*_x),S&&clearTimeout(S),S=setTimeout(()=>{S=null,E()},Lx)},V=()=>{d(),r&&(r=!1,h=!1,y=!1,o=[],A.clear(),x=!1,S&&(clearTimeout(S),S=null),M!==null&&(M=null,e.onStopChange?.(null)))};return t.addEventListener("pointerdown",L),t.addEventListener("pointermove",O),t.addEventListener("pointerup",H),t.addEventListener("pointercancel",H),t.addEventListener("wheel",j,{passive:!1}),{get active(){return r},enter(T,B=0){if(T.length<2){V();return}d(),o=T,r=!0,i=e.reducedMotion()?0:Xe(B,0,T.length-1),i>0&&(f=setTimeout(()=>{f=null,r&&(c=i,l=0,u=performance.now(),m=Ox,h=!0,e.requestRender())},kx)),a=0,s=0,h=!1,y=!1,M=null,F(),k(),e.requestRender()},exit:V,recentre(){return r?Math.abs(a)<1e-4&&Math.abs(s)<1e-4?!0:e.reducedMotion()?(y=!1,a=0,s=0,F(),e.requestRender(),!0):(p=[a,s],b=performance.now(),y=!0,e.requestRender(),!0):!1},update(T){if(!r)return!1;let B=!1;if(y){let D=Xe((T-b)/Ea,0,1),G=1-df(D);a=p[0]*G,s=p[1]*G,D>=1?(y=!1,a=0,s=0):B=!0}if(h){let D=Xe((T-u)/m,0,1);i=c+(l-c)*df(D),D>=1?(h=!1,i=l,k()):B=!0}return F(),B},currentStop:R,dispose(){V(),t.removeEventListener("pointerdown",L),t.removeEventListener("pointermove",O),t.removeEventListener("pointerup",H),t.removeEventListener("pointercancel",H),t.removeEventListener("wheel",j)}}}function bf(e){return e.flying?"cinematic":e.panoramaMounted?"panorama":e.seatViewActive?"seatView":"orbit"}var La=null;function Cf(){return La??=Promise.resolve().then(()=>(Ef(),Rf)).catch(e=>{throw La=null,e}),La}var _f=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),Nr=class{constructor(t){this.orbitLatched=!1;this.panoramaOpenedAt=0;this.cb=t}emit(t,n){if(this.cb)try{this.cb(t,n)}catch{}}opened(t,n,o,r){this.emit("3d_opened",{seats:t,hasHeights:n,...o===void 0?{}:{buildMs:Math.round(o)},...r===void 0?{}:{prepSource:r}})}orbitEngaged(){this.orbitLatched||(this.orbitLatched=!0,this.emit("3d_orbit_engaged"))}seatPicked(t,n){this.emit("3d_seat_picked",{seatId:t,sectionId:n})}cinematicPlayed(t){this.emit("3d_cinematic_played",{durationMs:t,reducedMotion:!1})}cinematicSkipped(){this.emit("3d_cinematic_skipped",{reducedMotion:!0})}cinematicCancelled(){this.emit("3d_cinematic_cancelled")}panoramaOpened(){this.panoramaOpenedAt=_f(),this.emit("3d_panorama_opened")}panoramaClosed(){let t=this.panoramaOpenedAt?Math.round(_f()-this.panoramaOpenedAt):0;this.panoramaOpenedAt=0,this.emit("3d_panorama_closed",{viewMs:t})}panoramaFailed(t,n){this.emit("3d_panorama_failed",{seatId:t,phase:n})}panoramaFallback(t){this.emit("3d_panorama_fallback",{seatId:t})}contextLost(){this.emit("3d_context_lost")}contextRestored(){this.emit("3d_context_restored")}};function Tf(e){let t=e.style.position;return getComputedStyle(e).position!=="static"?()=>{}:(e.style.position="relative",()=>{e.style.position==="relative"&&(e.style.position=t)})}function Lf(e){let{container:t,model:n,opts:o,expandedSeatById:r,seatIdsByRow:i,isNarrow:a}=e,s=null,c=()=>{if(!s)return;let m=a();Object.assign(s.style,m?{left:"12px",right:"12px",bottom:"70px",transform:"none",justifyContent:"center"}:{left:"50%",right:"auto",bottom:"18px",transform:"translateX(-50%)",justifyContent:"initial"})},l=()=>{s?.remove(),s=null};return{show:(m,f,d=!1)=>{if(l(),e.isDisposed())return null;let h=document.createElement("div");h.setAttribute("role","group"),Object.assign(h.style,{position:"absolute",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",zIndex:"4"});let p=o.chrome?.caption!==!1,b=o.chrome?.seatStepper!==!1;if(!p&&!b)return null;let y=r.get(m),M=y?.sectionId?n.sections.find(R=>R.id===y.sectionId):void 0,S=y?.label??m;h.setAttribute("aria-label",`Explore views near ${M?.label?`${M.label}, `:""}seat ${S}`);let A=document.createElement("span");A.textContent=o.seatViewCaption?.(m)??["Live 3D seat view",M?.label,S].filter(Boolean).join(" \xB7 "),Object.assign(A.style,{maxWidth:"min(70vw, 560px)",padding:"5px 10px",borderRadius:"999px",overflow:"hidden",color:"#d9e3f5",background:"rgba(12,18,32,0.72)",font:"600 11px/1.2 inherit",textOverflow:"ellipsis",whiteSpace:"nowrap",backdropFilter:"blur(6px)"}),p&&h.appendChild(A);let x=document.createElement("div");Object.assign(x.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),h.appendChild(x);let g=y?.rowId?i.get(y.rowId):void 0,w=g?.indexOf(m)??-1,v=w>=0?[g?.[w-1],g?.[w+1]]:[void 0,void 0],P=(R,k,F,E=!1)=>{let I=document.createElement("button");I.type="button",I.textContent=R,I.setAttribute("aria-label",k),Object.assign(I.style,{minHeight:"44px",padding:E?"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"}),E||(I.style.minWidth="44px"),E&&(I.dataset.panoramaTrigger=""),I.addEventListener("click",F),x.appendChild(I)};if(b&&v[0]){let R=r.get(v[0])?.label??v[0];P("\u2039",`View previous seat ${R}`,()=>{e.flyToSeat(v[0])})}if(b&&o.getSeatView){let R=o.seatViewActionLabel?.(m)??"Open 360\xB0 panorama";P(d?`\u21BB Retry ${R}`:`\u25C9 ${R}`,`${d?"Retry":R} from seat ${S}`,()=>{if(e.isDisposed()||f!==e.flightGen()){l();return}l(),e.openPanorama(m,400,f)},!0)}if(b&&v[1]){let R=r.get(v[1])?.label??v[1];P("\u203A",`View next seat ${R}`,()=>{e.flyToSeat(v[1])})}return!x.childElementCount&&!p?null:(t.appendChild(h),s=h,c(),h)},remove:l,layout:c}}var Zx={rotate:"Drag to rotate the venue",move:"Drag to move the venue",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Show whole venue"};function kf(e){let{container:t,orbit:n,isNarrow:o}=e,r={...Zx,...e.labels??{}},i=(x,g)=>{x.setAttribute("aria-label",g),x.title=g},a=document.createElement("div"),s=!1;a.className="sl-3d-navigation-controls",Object.assign(a.style,{position:"absolute",right:"14px",bottom:"14px",display:"flex",zIndex:"4",flexDirection:"column",alignItems:"flex-end",gap:"7px"});let c=document.createElement("div");c.setAttribute("role","group"),c.setAttribute("aria-label","3D drag mode"),Object.assign(c.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let l=document.createElement("div");l.setAttribute("role","group"),l.setAttribute("aria-label","3D view controls"),Object.assign(l.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let u=document.createElement("button");u.type="button",u.textContent="\u21BB",i(u,r.rotate);let m=document.createElement("button");m.type="button",m.textContent="\u2725",i(m,r.move);let f=document.createElement("button");f.type="button",f.textContent="\u2212",i(f,r.zoomOut);let d=document.createElement("button");d.type="button",d.textContent="+",i(d,r.zoomIn);for(let x of[u,m,f,d])x.className="sl-3d-icon-control",Object.assign(x.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"});c.append(u,m),l.append(d,f);let h=null,p=()=>{let x=n.dragAction();if(x===h)return;h=x;let g=x==="orbit";u.setAttribute("aria-pressed",String(g)),m.setAttribute("aria-pressed",String(!g)),u.style.background=g?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",m.style.background=g?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",a.title=g?`${r.rotate} \xB7 ${r.move} with Shift`:`${r.move} \xB7 ${r.rotate} with Shift`},b=x=>{n.setPrimaryDragMode(x),p()};u.addEventListener("click",()=>b("orbit")),m.addEventListener("click",()=>b("pan"));let y=()=>{let{atMin:x,atMax:g}=n.dollyLimitState();d.disabled!==x&&(d.disabled=x),f.disabled!==g&&(f.disabled=g)};f.addEventListener("click",()=>{n.zoomBy($n),y()}),d.addEventListener("click",()=>{n.zoomBy(ln),y()}),a.append(c,l),b("auto"),t.appendChild(a);let M=e.enabled!==!1,S=()=>{let x=o();a.style.display=s||!M?"none":"flex",a.style.right=x?"12px":"14px",a.style.bottom=x?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",c.style.display=x?"none":"flex",d.style.display=x?"none":"",f.style.display=x?"none":""};return S(),{element:a,utilityControls:l,setNavigationMode:b,syncNavigationMode:p,syncZoomLimits:y,setSeatViewLocked:x=>{s=x,n.setInteractionEnabled(!x),S()},seatViewLocked:()=>s,layout:S}}var qx=.5,Of=12,Ff=20,Qx=28;function Jx(e,t,n){return!(e>0)||!(n>0)?0:qx*n/(2*e*Math.tan(t*Math.PI/360))}function Df(e){let{glctx:t,orbit:n,model:o,seats:r,opts:i,cinematic:a,analytics:s,seatIdByIndex:c,sectionIdBySeatId:l,tapSlop:u,tapMs:m,cancelFlight:f,focusSectionCamera:d,setSelection:h,ensureSeatView:p}=e,b=0,y=0,M=0,S=-1,A=!1,x=!1,g=E=>{e.seatViewLocked()||S===-1&&(S=E.pointerId,b=E.clientX,y=E.clientY,M=performance.now(),A=!1,x=a.active,a.active&&(s.cinematicCancelled(),f(),i.onViewTargetChange?.(null)))},w=E=>{E.pointerId===S&&Math.hypot(E.clientX-b,E.clientY-y)>u&&(A=!0)},v=(E,I,C,L,N)=>{let O=t.canvas.getBoundingClientRect(),H=t.canvas.clientWidth||O.width||1,j=t.canvas.clientHeight||O.height||1,V=E-O.left,T=I-O.top,B=L*L,D=-1,G=B,U=1/0;for(let q of r){if(C&&q.sectionId!==C)continue;let $=o.seats.idToIndex.get(q.id);if($===void 0)continue;if(N){let J=Math.round(o.seats.iState[$]??0);if(J!==0&&J!==3)continue}let te=$*3,Q=gt(n.camera.projectionViewMatrix,[o.seats.iPosition[te],o.seats.iPosition[te+1]+.55,o.seats.iPosition[te+2]],H,j);if(!Q.visible)continue;let X=Q.x-V,Y=Q.y-T,K=X*X+Y*Y;(K<G||Math.abs(K-G)<1&&Q.depth<U)&&(D=$,G=K,U=Q.depth)}return D},P=(E,I)=>{let C=e.gpu(),L=e.pick();if(!C||!L)return-1;L.syncFromSeatProgram(C.seatProgram);let N=t.canvas.getBoundingClientRect(),O=t.renderer.dpr,{x:H,y:j}=Nm(E,I,N,O,t.gl.drawingBufferWidth,t.gl.drawingBufferHeight),V=Math.max(2,Math.round(8*O));return L.pick(n.camera,H,j,V)},R=()=>t.canvas.clientHeight||t.canvas.getBoundingClientRect().height,k=(E,I=Of)=>{let C=n.camera?.position;if(!C)return!1;let L=E*3,N=Math.hypot(C.x-o.seats.iPosition[L],C.y-o.seats.iPosition[L+1],C.z-o.seats.iPosition[L+2]);return Jx(N,n.fovY,R())>=I};return{onDown:g,onMove:w,onUp:E=>{if(E.pointerId!==S)return;let I=!A&&performance.now()-M<m;if(S=-1,x){x=!1;return}let C=e.gpu(),L=e.pick();if(!I||!C||!L)return;let N=P(E.clientX,E.clientY),O=E.pointerType==="touch"||E.pointerType==="pen",H=O?Ff:Of,j=N>=0&&k(N,H),V=!1;if(e.focusedSectionId()&&N>=0){let D=c[N],G=D?l.get(D):void 0;if(G&&G!==e.focusedSectionId()&&d(G,{keepCamera:j})){if(!j)return;V=!0}}if(e.focusedSectionId()&&N<0&&(N=v(E.clientX,E.clientY,e.focusedSectionId(),44,!1)),e.focusedSectionId()&&N<0){let D=v(E.clientX,E.clientY,null,72,!1),G=D>=0?c[D]:void 0,U=G?l.get(G):void 0;if(U&&U!==e.focusedSectionId()&&d(U))return}if(!e.focusedSectionId()){N<0&&(N=v(E.clientX,E.clientY,null,42,!1));let D=N>=0?c[N]:void 0,G=D?l.get(D):void 0;if(G&&d(G,{keepCamera:j})){if(!j)return;V=!0}}if(N<0||N>=c.length){e.selection().size&&(h([]),i.onViewTargetChange?.(null));return}let T=c[N];if(O&&e.focusedSectionId()&&!V&&!k(N,Ff)){e.focusSeatCamera(T,{seatPx:Qx,viewportHeightPx:R()});return}let B=ze[Math.round(o.seats.iState[N]??0)]??"available";if(B!=="available"&&B!=="selected"){i.onSeatInspect?.(T,B);return}if(e.selection().has(T)&&e.selection().size===1){h([]),i.onViewTargetChange?.(null),i.onSeatPick?.(T);return}h([T]),p(T),s.seatPicked(T,l.get(T)),i.onSeatPick?.(T)}}}var Br=class{constructor(t,n){this.minX=0;this.minZ=0;this.cell=1;this.cols=1;this.rows=1;this.cellStart=null;this.cellItems=null;this.iPosition=t,this.count=n}ensureGrid(){if(this.cellStart||this.count===0)return;let t=this.iPosition,n=1/0,o=1/0,r=-1/0,i=-1/0;for(let d=0;d<this.count;d++){let h=t[d*3],p=t[d*3+2];h<n&&(n=h),h>r&&(r=h),p<o&&(o=p),p>i&&(i=p)}let a=Math.max(r-n,.001),s=Math.max(i-o,.001);this.cell=Math.max(Math.sqrt(a*s*4/this.count),.25),this.cols=Math.max(1,Math.ceil(a/this.cell)+1),this.rows=Math.max(1,Math.ceil(s/this.cell)+1),this.minX=n,this.minZ=o;let c=this.cols*this.rows,l=new Int32Array(c+1),u=d=>{let h=Math.min(this.cols-1,Math.max(0,Math.floor((t[d*3]-n)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((t[d*3+2]-o)/this.cell)))*this.cols+h};for(let d=0;d<this.count;d++)l[u(d)+1]++;for(let d=0;d<c;d++)l[d+1]+=l[d];let m=new Int32Array(this.count),f=l.slice(0,c);for(let d=0;d<this.count;d++)m[f[u(d)]++]=d;this.cellStart=l,this.cellItems=m}gather(t,n,o,r,i){this.ensureGrid();let a=this.cellStart,s=this.cellItems;if(!a||!s)return 0;let c=r.length,l=o*o,u=Math.floor((t-this.minX)/this.cell),m=Math.floor((n-this.minZ)/this.cell),f=Math.ceil(o/this.cell)+1,d=this.iPosition,h=0;for(let p=0;p<=f&&h<c;p++){let b=m-p,y=m+p,M=u-p,S=u+p;for(let A=b;A<=y&&h<c;A++){if(A<0||A>=this.rows)continue;let x=A===b||A===y;for(let g=M;g<=S&&h<c;g++){if(!x&&g!==M&&g!==S){g=S-1;continue}if(g<0||g>=this.cols)continue;let w=A*this.cols+g;for(let v=a[w],P=a[w+1];v<P&&h<c;v++){let R=s[v],k=d[R*3]-t,F=d[R*3+2]-n,E=i===void 0?0:d[R*3+1]-i;k*k+E*E+F*F<=l&&(r[h++]=R)}}}}return h}};var Vr=class{constructor(t){this.ctx=t;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array(Bo);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.lastGatherY=1/0;this.nearIndex=new Br(t.model.seats.iPosition,t.model.seats.count)}forceRegather(){this.lastGatherX=1/0}setDetailEnabled(t){let n=this.ctx.gpu();t||(this.detailVisible=!1),this.lastGatherX=1/0,this.lastGatherZ=1/0,!t&&n?.nearSeatCount()&&n.setNearSeats(this.nearBuf,0)}update(t){let{model:n}=this.ctx,o=this.ctx.gpu();if(!o)return;if(!t){o.nearSeatCount()&&o.setNearSeats(this.nearBuf,0);return}let r=this.ctx.orbit().camera.position;if(Math.hypot(r.x-this.lastGatherX,r.y-this.lastGatherY,r.z-this.lastGatherZ)<mi)return;if(this.lastGatherX=r.x,this.lastGatherY=r.y,this.lastGatherZ=r.z,Math.hypot(r.x-n.bounds.center[0],r.y-n.bounds.center[1],r.z-n.bounds.center[2])-n.bounds.radius>ui){o.nearSeatCount()&&o.setNearSeats(this.nearBuf,0);return}let s=this.nearIndex.gather(r.x,r.z,ui,this.nearBuf,r.y);s===0&&o.nearSeatCount()===0||o.setNearSeats(this.nearBuf,s)}ease(t,n,o){let r=1-Math.exp(-t*9),i=1-Math.exp(-t*20);this.seatDetailMix+=(n-this.seatDetailMix)*(n>this.seatDetailMix?r:i),this.structureDetailMix+=(o-this.structureDetailMix)*(o>this.structureDetailMix?r:i),Math.abs(n-this.seatDetailMix)<.01&&(this.seatDetailMix=n),Math.abs(o-this.structureDetailMix)<.01&&(this.structureDetailMix=o)}};function Nf(e){let t=Math.max(5,e.radius),n=e.focalWorld[0]-e.center[0],o=e.focalWorld[2]-e.center[2],r=Math.hypot(n,o);if(r<t*.12)return{center:e.center,radius:t,polarDeg:48};let i=Math.min(r*.25,t*.2);return{center:[e.center[0]+n/r*i,e.center[1],e.center[2]+o/r*i],radius:t+i,polarDeg:50}}var Gr=require("ogl");function Bf(){let e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round");let n=document.createElementNS(e,"path");return n.setAttribute("d","M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 0 2 2v3M8 21H5a2 2 0 0 0-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3"),t.appendChild(n),t}function Vf(e){let{container:t,model:n,opts:o,orbit:r,cinematic:i,analytics:a,loop:s,labelOverlay:c,stageAzimuth:l,overviewFraming:u}=e,m=0,f=-1,d=(R,k,F=28)=>{r.camera.position.set(R[0],R[1],R[2]),r.camera.lookAt(new Gr.Vec3(k[0],k[1],k[2])),r.camera.fov=F,r.camera.updateProjectionMatrix()},h=document.createElement("button");h.className="sl-3d-overview-control sl-3d-icon-control",h.type="button",h.replaceChildren(Bf());let p=o.navLabels?.fitView??"Show whole venue";h.setAttribute("aria-label",p),h.title=p,Object.assign(h.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 b=()=>{h.firstElementChild||h.replaceChildren(Bf())};b();let y=R=>{f=R;let k=e.gpu();k&&(k.seatProgram.uniforms.uFocusFloor.value=R,k.solidProgram.uniforms.uFocusFloor.value=R,k.chairProgram.uniforms.uFocusFloor.value=R),e.showSectionSeatLabels(null)},M=null,S=!1,A=()=>{if(M=null,S=!1,e.setSeeThrough?.(null),e.isDisposed())return;o.onViewTargetChange?.(null),o.onSectionFocusChange?.(null),e.panorama()&&(e.panorama().dispose(),e.setPanorama(null),a.panoramaClosed()),e.setPanoramaSphereVisible(!1),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),e.restorePanoramaLayer(),h.style.display="",c.setVisible(!0),e.setFrozen(!1);let R=f>=0?n.floors[f]:null;if(e.setNearFieldDetailEnabled(!!R),e.setSeatViewLocked(!1),x(),e.removeArriveChip(),e.setNavigationMode("auto"),R){let k=R.focalWorld[0]-R.center[0],F=R.focalWorld[2]-R.center[2],E=Math.hypot(k,F)>R.radius*.12?Math.atan2(k,F):l,I={center:R.center,radius:R.radius,box:R.box},C={polarDeg:58,margin:1.12};e.reducedMotion()?r.frame(I,!1,E,!1,C):r.frameSoft(I,E,!1,C)}else e.reducedMotion()?r.frame(n.bounds,!1,l,o.portraitOverviewCrop===!0,u):r.frameSoft(n.bounds,l,o.portraitOverviewCrop===!0,u);c.setOverviewDistance(r.targetDistance),e.showSectionSeatLabels(null),s.requestRender()},x=()=>{m++,e.setSeatStepping(!1),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),i.active&&(i.cancel(),r.resumeAfterFlight(n.focalWorld))},g=R=>{if(e.isDisposed()||!e.gpu())return Promise.resolve();let k=n.seats.idToIndex.get(R);if(k===void 0)return Promise.resolve();e.setNearFieldDetailEnabled(!0),o.onViewTargetChange?.(R),e.panorama()&&(e.panorama().dispose(),e.setPanorama(null),e.setPanoramaSphereVisible(!1),h.style.display="",e.restorePanoramaLayer()),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),e.setFrozen(!1);let F=e.inSeatView()&&o.arriveAtSeatEye===!0;e.setSeatStepping(F),e.setSeatViewLocked(!1);let E=++m;F?e.showArriveChip(R,E):e.removeArriveChip();let{eye:I,focal:C}=e.resolvedSeatViewPose(R,k),L=o.arriveAtSeatEye?e.seatViewArrival(R,k):null,N=L&&L.stops.length>1&&L.stops[1].name==="row"?L.stops[1]:null,O=L?L.focal:C,H=[r.camera.position.x,r.camera.position.y,r.camera.position.z],j=Pa(H,L?.eye??I,O,n.bounds.center,n.bounds.radius),V=N?N.eye:L?L.eye:o.arriveAtSeatEye?I:j.finalPos,T=L?L.fov:o.arriveAtSeatEye?t.clientWidth/Math.max(1,t.clientHeight)<.7?Er:65:28,B=[j.waypoints[0],j.waypoints[1],V];if(c.setVisible(!1),e.reducedMotion())return e.setSeatStepping(!1),d(V,O,T),s.requestRender(),a.cinematicSkipped(),e.isDisposed()||r.syncFromCamera(),e.setSeatViewLocked(o.arriveAtSeatEye===!0),L&&e.enterSeatView(L.stops),e.showArriveChip(R,E),Promise.resolve();let D=new Gr.Quat().copy(r.camera.quaternion),G=Xm(r.camera,V,O);s.requestRender();let U=F?700:2500;return i.start(B,D,G,U,T).then(()=>{e.isDisposed()||E!==m||(e.setSeatStepping(!1),a.cinematicPlayed(U),r.resumeAfterFlight(O),e.setSeatViewLocked(o.arriveAtSeatEye===!0),L&&e.enterSeatView(L.stops,N?1:0),s.requestRender(),e.showArriveChip(R,E))})},w=(R,k)=>{let F=n.sections.find(E=>E.id===R);if(!F||F.seatCount===0)return!1;if(M=R,S=!1,e.setSeeThrough?.(null),e.setNearFieldDetailEnabled(!0),e.setSeatStepping(!1),e.setSeatViewLocked(!1),i.cancel(),e.removeArriveChip(),n.floors.length>1&&f!==F.floorIndex&&y(F.floorIndex),e.setNavigationMode("auto"),e.panorama()||c.setVisible(!0),e.showSectionSeatLabels(R),!k?.keepCamera){let E=Nf(F),I={polarDeg:E.polarDeg,margin:1.12};e.reducedMotion()?r.frame({center:E.center,radius:E.radius},!1,r.currentAzimuth,!1,I):r.glideTo({center:E.center,radius:E.radius},I)}return o.onSectionFocusChange?.(R),s.requestRender(),!0},v=(R,k)=>{if(e.isDisposed()||!e.gpu())return!1;let F=n.seats.idToIndex.get(R);if(F===void 0)return!1;let E=F*3,I=[n.seats.iPosition[E],n.seats.iPosition[E+1]+.55,n.seats.iPosition[E+2]],C=k?eM(k,r.fovY,r.camera.aspect||1):Gf;return S=!0,e.setSeeThrough?.(I),e.reducedMotion()?r.frame({center:I,radius:C},!1,void 0,!1,ka):r.frameSoft({center:I,radius:C},void 0,!1,ka),s.requestRender(),!0},P=()=>{if(e.isNarrow?.()&&S&&M&&w(M)){s.requestRender();return}A()};return h.addEventListener("click",P),{overviewChip:h,layoutOverviewChip:b,flightGen:()=>m,focusedFloor:()=>f,applyFloorFocus:y,placeCameraFinal:d,cancelFlight:x,focusOverview:A,flyToSeat:g,focusSectionCamera:w,focusSeatCamera:v}}var Gf=4.5;function eM(e,t,n){let o=Math.tan(t*Math.PI/360),r=o*Math.max(.001,n),a=tM*e.viewportHeightPx/(2*Math.max(1,e.seatPx)*o)*Math.min(o,r)/ka.margin;return Math.max(nM,Math.min(Gf,a))}var tM=.5,nM=1.5,ka={polarDeg:48,margin:1.25};function Ao(e,t){let{doc:n,report:o}=xr(e),r=o.confident&&(o.sections.length>0||!!o.looseRowBlocks);if(!r&&!o.roles?.length)return null;if(!r){let c=new Map(o.roles.map(d=>[d.id,d.role])),l=d=>d.map(h=>h.type==="shape"&&c.has(h.id)?{...h,role:c.get(h.id)}:h),u=e.floors?.map(d=>({...d,objects:l(d.objects)})),m=new Float64Array(t.length).fill(Number.NaN),f=new Float64Array(t.length*2).fill(Number.NaN);return t.forEach((d,h)=>{d.eyeHeightM!==void 0&&(m[h]=d.eyeHeightM),d.focalPoint&&(f[h*2]=d.focalPoint.x,f[h*2+1]=d.focalPoint.y)}),{doc:{...e,objects:u?.[0]?.objects??l(e.objects),...u?{floors:u}:{}},report:o,eyeHeightM:m,focal:f}}let i=new Map(yn(n).map(c=>[c.id,c])),a=new Float64Array(t.length).fill(Number.NaN),s=new Float64Array(t.length*2).fill(Number.NaN);return t.forEach((c,l)=>{let u=i.get(c.id)??c;u.eyeHeightM!==void 0&&(a[l]=u.eyeHeightM),u.focalPoint&&(s[l*2]=u.focalPoint.x,s[l*2+1]=u.focalPoint.y)}),{doc:n,report:o,eyeHeightM:a,focal:s}}function Oa(e,t){return e.map((n,o)=>{let r=t.eyeHeightM[o],i=t.focal[o*2],a=t.focal[o*2+1],s={...n};return Number.isNaN(r)?delete s.eyeHeightM:s.eyeHeightM=r,Number.isNaN(i)?delete s.focalPoint:s.focalPoint={x:i,y:a},s})}function Hf(e){let t=e.estimate===!1?null:Ao(e.doc,e.seats);return t?{input:{...e,doc:t.doc,seats:Oa(e.seats,t)},estimate:t}:{input:e}}function Fa(e,t,n,o,r,i,a,s,c=.5){let l=-1,u=s*s,m=1/0;for(let f=0;f<t;f++){let d=f*3,h=gt(n,[e[d],e[d+1]+c,e[d+2]],o,r);if(!h.visible)continue;let p=h.x-i,b=h.y-a,y=p*p+b*b;(y<u-4||y<u+4&&h.depth<m)&&(l=f,u=Math.min(u,y),m=h.depth)}return l}var rM={};function zf(e){let t=performance.now(),{input:n,estimate:o}=Hf(e);return{model:Ln(n),buildMs:performance.now()-t,source:"main",...o?{estimate:o}:{}}}function oM(e){let t=yn(e.doc);return{...zf({...e,seats:t}),seats:t}}function Uf(e,t,n){let o=i=>({...t(),fallbackReason:i});if(typeof Worker>"u")return Promise.resolve(o("unavailable"));let r;try{r=new Worker(new URL("./scene/scene.worker.js",rM.url),{type:"module"})}catch{return Promise.resolve(o("unavailable"))}return new Promise(i=>{let a=!1,s=u=>{a||(a=!0,clearTimeout(l),r.terminate(),i(u))},c=u=>s(o(u)),l=window.setTimeout(()=>c("timeout"),15e3);r.onerror=()=>c("worker_error"),r.onmessage=u=>{let m=n(u.data);m?s(m):c("bad_response")},r.postMessage(e)})}function jf(e){return Uf(e,()=>zf(e),({model:t,buildMs:n,estimate:o})=>({model:t,buildMs:n,source:"worker",...o?{estimate:o}:{}}))}function Wf(e){return Uf(e,()=>oM(e),({model:t,buildMs:n,seats:o,estimate:r})=>o?{model:t,buildMs:n,seats:o,source:"worker",...r?{estimate:r}:{}}:null)}var iM=40,aM=48,sM=Math.PI/180,cM=6,lM=500,uM=6;function mM(e,t,n={}){let o=performance.now(),r=t.prepared?t.prepared.estimate:t.estimate===!1?null:Ao(t.doc,t.seats);r&&(t={...t,doc:r.doc,seats:Oa(t.seats,r)});let i=t.prepared?.model??Ln(t),a=new Nr(n.onAnalytics),s=new Array(i.seats.count);for(let[z,W]of i.seats.idToIndex)s[W]=z;let c=new Map(t.seats.map(z=>[z.id,z])),l=new Map;for(let z of t.seats){if(!z.rowId)continue;let W=l.get(z.rowId);W?W.push(z.id):l.set(z.rowId,[z.id])}let u=new Map,m=[0,0,0,0];function f(){if(b)for(let z of[b.seatProgram,b.solidProgram,b.chairProgram])z.uniforms.uSeeThrough.value=m}t.seats.forEach((z,W)=>{u.set(z.id,i.seatSectionIds?.[W]??z.sectionId)});let d=new Map;for(let[z,W]of i.seats.idToIndex){let Z=u.get(z);if(!Z)continue;let se=d.get(Z);se?se.push(W):d.set(Z,[W])}let h=()=>{if(!b||!i.sectionSolidRanges.length)return;let{lit:z,anyUnlit:W}=Tm(i.sectionSolidRanges,d,i.seats.iState);b.setSectionShellLit(W?z:null)},p=t.doc.floors?.some(W=>(W.baseHeightM??0)>0)?!0:(t.doc.floors?.flatMap(W=>W.objects)??t.doc.objects).some(W=>W.type==="section"&&((W.height??0)>0||(W.rake??0)>0)),b=null,y=null,M=null,S=!1,A=!1,x=!1,g=new Map,w=null,v=null,P=null,R=new Map,k=null,F=()=>{P===null&&(P=e.style.zIndex,e.style.zIndex="20")},E=()=>{P!==null&&(e.style.zIndex==="20"&&(e.style.zIndex=P),P=null)},I=!1,C=()=>I?je.focusedFloor():-1,L=()=>{b=Fm(B.gl,i),y?.dispose(),y=sm(B.gl,[1,1,1],i.theme.seatStates.selected),Va(!1),h(),re(),M=new Ir(B.renderer,b.seatGeometry,b.chairGeometry,b.solidGeometry,i.seats.count),B.setClearColor(i.theme.background.top),M.setRestoreClear(i.theme.background.top),M.setRoomCentre(i.room?.centre),b.seatProgram.uniforms.uSeatRadius.value=St*i.theme.seatScale,b.seatProgram.uniforms.uFocusFloor.value=C(),b.solidProgram.uniforms.uFocusFloor.value=C(),b.chairProgram.uniforms.uFocusFloor.value=C(),b.screenProgram&&(b.screenProgram.uniforms.uFocusFloor.value=C()),f(),O.forceRegather()},N=!1,O=new Vr({model:i,orbit:()=>D,gpu:()=>b}),H=!1,j=new Map,V=24,T=z=>O.setDetailEnabled(z),B=new Fo(e,{onContextLost:()=>{x||a.contextLost(),S=!0,Ie.stop(),b=null,M=null},onContextRestored:()=>{L(),S=!1,x||a.contextRestored(),Ie.requestRender()}}),D=new Do(B.gl,B.canvas,()=>Ie.requestRender(),()=>a.orbitEngaged());D.setAspect(B.aspect);let G=(t.doc.floors?.flatMap(z=>z.objects)??t.doc.objects).some(z=>z.type==="section"&&z.physical3dProvenance?.surfaceKind?.status==="inferred"),U=(()=>{if(Number.isFinite(n.overviewAzimuthDeg))return n.overviewAzimuthDeg*Math.PI/180;if(!(G&&i.stages.length===0))return Ja(i.focalWorld,i.seats.iPosition,i.bounds)})(),q=(t.doc.floors?.flatMap(z=>z.objects)??t.doc.objects).some(z=>z.type==="shape"&&z.stageKind?.startsWith("pitch-")),$=i.floors.length>1?{polarDeg:48,margin:1.1}:{polarDeg:q?36:48,margin:1.05},te=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;D.frame(i.bounds,!te&&n.skipInitialOverviewAnimation!==!0,U,n.portraitOverviewCrop===!0,$);let Q=new Rr(D.camera),X=Tf(e),Y=es(e,i),K=new wr(e,{fontFamily:t.doc.theme?.fontFamily,ink:t.doc.theme?.textColor,backgroundRgb:i.theme.background.top}),J=i.labels,ce=()=>Ru(J,i.floors.length,C());K.setLabels(ce()),K.setOverviewDistance(D.targetDistance);let oe=()=>{let z=new Map,W=ze.indexOf("available");for(let Z of J){if(!Z.wheelchairSeats)continue;let se=0;for(let me of Z.wheelchairSeats)i.seats.iState[me]===W&&se++;se>0&&z.set(Z.id,se)}return K.setWheelchairFree(z)};oe();let ee=null,ne=()=>[...g.keys()].flatMap(z=>{let W=i.seats.idToIndex.get(z),Z=W===void 0?void 0:t.seats[W];if(W===void 0||Z?.id!==z)return[];let se=W*3;return[{id:`seat:${z}`,kind:"seat",seatWidthM:i.seats.iChairWidth[W]*2,text:Z.displayLabel||Z.label,anchor:[i.seats.iPosition[se],i.seats.iPosition[se+1]+1.05,i.seats.iPosition[se+2]],pinBase:Hr(se)}]}),he=-1,re=()=>{b&&(he=ee?i.sections.findIndex(z=>z.id===ee):-1,b.seatProgram.uniforms.uFocusSection.value=he,b.chairProgram.uniforms.uFocusSection.value=he)},ve=z=>{if(ee=z,re(),K.setForcedDense(!!z),!z){let ie=ne(),ke=new Set(ie.map(Ce=>Ce.id));K.setLabels([...ce().filter(Ce=>!ke.has(Ce.id)),...ie]);return}let W=t.seats.filter(ie=>u.get(ie.id)===z),Z=new Set(W.map(ie=>ie.id)),se=new Set(W.map(ie=>ie.rowId)),me=new Set(g.keys()),Se=new Set(W.filter(ie=>me.has(ie.id)).map(ie=>ie.id)),Me=ce().filter(ie=>ie.kind!=="row"&&ie.kind!=="seat"&&ie.kind!=="access"||ie.kind==="access"&&Z.has(ie.id.slice(7))||(ie.kind==="row"?se.has(ie.id.slice(4)):Z.has(ie.id.slice(5))));if(i.seatCount<=6e3&&Se.size===0){K.setLabels(Me);return}let Ee=W,He=new Set(Ee.map(ie=>`seat:${ie.id}`)),Ke=Ee.flatMap(ie=>{let ke=i.seats.idToIndex.get(ie.id);if(ke===void 0)return[];let Ce=ke*3;return[{id:`seat:${ie.id}`,kind:"seat",seatWidthM:i.seats.iChairWidth[ke]*2,rowId:ie.rowId,text:me.has(ie.id)?ie.displayLabel||ie.label:ha(ie.displayLabel||ie.label),anchor:[i.seats.iPosition[Ce],i.seats.iPosition[Ce+1]+(me.has(ie.id)?1.05:.55),i.seats.iPosition[Ce+2]],...me.has(ie.id)?{pinBase:Hr(Ce)}:{}}]});K.setLabels([...Me.filter(ie=>!He.has(ie.id)),...Ke])};L();let we=null,ot=null,ut=new Xf.Mat4,Ye=z=>{if(S||!b||A)return!1;let W=bf({flying:Q.active,panoramaMounted:w!==null,seatViewActive:we?.active===!0}),Z=W==="orbit"?he:-1;b.seatProgram.uniforms.uFocusSection.value=Z,b.chairProgram.uniforms.uFocusSection.value=Z;let se=H?!1:W==="cinematic"?Q.update(performance.now()):W==="seatView"?we.update(performance.now()):W==="orbit"?D.update():!1;ot?.syncZoomLimits(),ot?.syncNavigationMode();let me=C()>=0?i.floors[C()]:null,Se=me?.radius??i.bounds.radius,Me=Cs(D.currentDistance,Se),Ee=N?{center:[D.camera.position.x,D.camera.position.y,D.camera.position.z],radius:520}:i.clipBounds??i.renderBounds;D.updateClipping(Ee);let He=me?.center??i.renderBounds.center,Ke=me?.radius??i.renderBounds.radius,ie=(De,qr)=>Math.hypot(D.camera.position.x-De[0],D.camera.position.y-De[1],D.camera.position.z-De[2])<=qr*(O.detailVisible?1.8:1.55),ke=ie(He,Ke);if(!ke&&ee){let De=i.sections.find(qr=>qr.id===ee);De&&(ke=ie(De.center,Math.max(12,De.radius*2)))}O.detailVisible=ke;let Ce=b.seatProgram.uniforms;Ce.uSeatScale.value=Me.scale,Ce.uSeatFade.value=Me.fade;let it=!!me&&_s(me.seatCount,B.canvas.clientWidth||1,B.canvas.clientHeight||1),jt=Ts(i.seats.count,Se,D.currentDistance,D.camera.fov,B.canvas.clientHeight||1),Gn=O.detailVisible||it||jt?1:0,Hn=O.detailVisible||C()>=0||i.floors.length>1?1:0;O.ease(z,Gn,Hn),Ce.uSeatDetail.value=O.seatDetailMix;let Eo=Gn===0&&O.seatDetailMix<.01;b.seatGeometry.setDrawRange(Eo?ei:0,Eo?ss:ei),b.solidProgram.uniforms.uStructureDetail.value=O.structureDetailMix,Ce.uMinPixels.value=Me.minPixels,Ce.uPixelToWorld.value=2*Math.tan(D.camera.fov*sM/2)/Math.max(1,B.pixelHeight),O.update(O.detailVisible),i.outdoor&&(ut.copy(D.camera.projectionViewMatrix).inverse(),b.backgroundProgram.uniforms.uInvViewProj.value.set(ut)),B.renderer.render({scene:b.background,clear:!0}),B.renderer.render({scene:b.main,camera:D.camera,clear:!1});let zn=y?y.update(performance.now(),[D.camera.position.x,D.camera.position.y,D.camera.position.z],w!==null,W==="seatView"):!1;if(y&&B.renderer.render({scene:y.root,camera:D.camera,clear:!1}),Y){let De=D.camera.worldMatrix;Y.update(W==="seatView"?[D.camera.position.x,D.camera.position.y,D.camera.position.z]:null,[-De[8],-De[9],-De[10]])}K.update(D.camera.projectionViewMatrix,B.canvas.clientWidth||1,B.canvas.clientHeight||1,D.currentDistance,Se,[D.camera.position.x,D.camera.position.y,D.camera.position.z]);let rn=se||zn||O.seatDetailMix!==Gn||O.structureDetailMix!==Hn;return rt(!rn),rn},rt=ws(e),Ie=new No(Ye),Ht=typeof ResizeObserver<"u"?new ResizeObserver(()=>Zr.resize()):null;Ht?.observe(e),D.setZoomPointResolver((z,W)=>{let Z=B.canvas.getBoundingClientRect(),se=B.canvas.clientWidth||Z.width,me=B.canvas.clientHeight||Z.height;if(!(se>0)||!(me>0))return null;D.camera.updateMatrixWorld();let Se=Fa(i.seats.iPosition,i.seats.count,D.camera.projectionViewMatrix,se,me,z-Z.left,W-Z.top,iM);if(Se<0)return null;let Me=Se*3;return[i.seats.iPosition[Me],i.seats.iPosition[Me+1]+.5,i.seats.iPosition[Me+2]]});function Hr(z){return[i.seats.iPosition[z],i.seats.iPosition[z+1]+.5,i.seats.iPosition[z+2]]}K.setSeatNumberRow(null);let mt=null,zt=0,zr=null,Da=()=>{zt=0;let z=null,W=null;if(mt&&!we?.active&&!Q.active){let me=B.canvas.getBoundingClientRect(),Se=B.canvas.clientWidth||me.width,Me=B.canvas.clientHeight||me.height;if(Se>0&&Me>0){let Ee=Fa(i.seats.iPosition,i.seats.count,D.camera.projectionViewMatrix,Se,Me,mt.x-me.left,mt.y-me.top,aM);z=Ee>=0?t.seats[Ee]?.rowId??null:null;let He=Ee>=0?t.seats[Ee]?.id??null:null;if(W=He,mt.mouse&&!mt.pressing&&!!ee&&!!He&&u.get(He)===ee){let ie=e.getBoundingClientRect();zr=He,n.onSeatHover?.(He,{x:mt.x-ie.left,y:mt.y-ie.top})}else Na()}}else Na();let Z=mt?.mouse?W:null,se=K.setSeatNumberSeat(Z);(K.setSeatNumberRow(z)||se)&&Ie.requestRender()};function Na(){zr!==null&&(zr=null,n.onSeatHover?.(null,null))}let Io=z=>{mt={x:z.clientX,y:z.clientY,mouse:z.pointerType==="mouse",pressing:z.type==="pointerdown"},zt||(zt=requestAnimationFrame(Da))},Ba=z=>{z.pointerType==="mouse"&&(mt=null,zt||(zt=requestAnimationFrame(Da)))};B.canvas.addEventListener("pointermove",Io),B.canvas.addEventListener("pointerdown",Io),B.canvas.addEventListener("pointerleave",Ba);function Va(z){if(!y)return;let W=[];for(let Z of g.keys()){let se=i.seats.idToIndex.get(Z);if(se===void 0)continue;let me=se*3;W.push({id:Z,position:Hr(me)})}y.setSeats(W,performance.now(),z)}let Ga=z=>{let W=me=>{let Se=i.seats.idToIndex.get(me);return Se===void 0?void 0:i.seats.iState[Se]},{updates:Z,next:se}=Vm(g,z,W);if(g=se,K.setSelectedSeatIds(g.keys()),Va(!Nn()),Ie.requestRender(),ve(ee),Z.length){let me=gi(i.seats,Z);b&&b.uploadSeatStateRuns(me),h(),Ie.requestRender()}},Nn=()=>k!==null?k:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Yf=8,Ha=z=>{if(!n.getSeatView)return null;let W=R.get(z);if(!W)for(W=Promise.resolve(n.getSeatView(z)),R.set(z,W),W.catch(()=>{R.get(z)===W&&R.delete(z)});R.size>Yf;){let Z=R.keys().next().value;if(Z===void 0)break;R.delete(Z)}return W},za=sf(i.stages,i.focalWorld,i.bounds.groundY??0),Ua=Ra(za),Ur=(z,W)=>{let Z=c.get(z),se=Math.max(0,Math.round(i.seats.iFloor[W]??0)),me=t.doc.floors?.[se],Se=i.floors[se],Me=me?.focalPoint??t.doc.focalPoint,Ee=Se?{x:Se.focalWorld[0]/_,y:Se.focalWorld[2]/_}:Me,He=Z?.focalPoint?{x:Z.focalPoint.x+Ee.x-Me.x,y:Z.focalPoint.y+Ee.y-Me.y}:Ee,Ke=[i.seats.iPosition[W*3],i.seats.iPosition[W*3+1],i.seats.iPosition[W*3+2]],ie=$m(i.seats.iPosition,W,Ua),ke=ie!==null&&Math.abs(ie)<Km;return Zm(Ke,He,me?.baseHeightM??0,Z?.eyeHeightM,Ua,ke)},jr=()=>(e.clientWidth||B.canvas.clientWidth)<=520,Wr=null,ja=null,Kf=async(z,W,Z)=>{if(!n.getSeatView||x||Z!==je.flightGen())return;let se;try{se=await Cf()}catch{if(a.panoramaFailed(z,"mount"),!x&&Z===je.flightGen()){let me=Yr(z,Z,!0);requestAnimationFrame(()=>me?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(x||Z!==je.flightGen()||!Wr))return ja??=se.createOpenPanorama(Wr),ja(z,W,Z)},Xr=Lf({container:e,model:i,opts:n,expandedSeatById:c,seatIdsByRow:l,isNarrow:jr,isDisposed:()=>x,flightGen:()=>je.flightGen(),flyToSeat:z=>$a(z),openPanorama:(z,W,Z)=>Kf(z,W,Z)}),Yr=Xr.show,Kr=Xr.remove,$f=Xr.layout,Ut=kf({container:e,orbit:D,isNarrow:jr,enabled:n.chrome?.controlDock!==!1,...n.navLabels?{labels:n.navLabels}:{}});ot=Ut;let Zf=Ut.element,Bn=Ut.setNavigationMode,qf=Ut.layout,Qf=Ut.utilityControls,Vn=null,Wa=!1,Ro=z=>{Ut.setSeatViewLocked(z),z||we?.exit()};we=pf({canvas:B.canvas,camera:D.camera,requestRender:()=>Ie.requestRender(),reducedMotion:Nn,onStopChange:z=>{let W=z??(Wa?"seat":null);Vn=W;try{n.onSeatViewStopChange?.(W)}catch{}},onApplied:()=>{x||D.syncFromCamera()}});let Xa=i.sections.reduce((z,W)=>W.seatCount>0&&W.box?Math.max(z,W.box.max[1]):z,-1/0),Ya=(z,W)=>{let{eye:Z}=Ur(z,W),se=(e.clientWidth||B.canvas.clientWidth||1)/Math.max(1,e.clientHeight||B.canvas.clientHeight||1),me=lf(Z,za,se,{preserveEye:!0});if(n.seatViewStops===!1)return{...me,stops:[]};let Se=u.get(z),Me=Se?i.sections.find(Ee=>Ee.id===Se):void 0;return{...me,stops:uf(me,{aspect:se,seatingTopY:Number.isFinite(Xa)?Xa:i.bounds.box.max[1],section:Me&&Me.seatCount>0?{center:Me.center,radius:Me.radius}:null,venue:{center:i.bounds.center,radius:i.bounds.radius}})}},je=Vf({isNarrow:jr,setSeeThrough:z=>{m=z?[z[0],z[1],z[2],uM]:[0,0,0,0],f(),Ie.requestRender()},container:e,model:i,opts:n,orbit:D,cinematic:Q,analytics:a,loop:Ie,labelOverlay:K,stageAzimuth:U,overviewFraming:$,gpu:()=>b,isDisposed:()=>x,panorama:()=>w,setPanorama:z=>{w=z},setPanoramaSphereVisible:z=>{N=z},panoramaLoadAbort:()=>v,setPanoramaLoadAbort:z=>{v=z},setFrozen:z=>{A=z},restorePanoramaLayer:E,reducedMotion:Nn,resolvedSeatViewPose:Ur,showSectionSeatLabels:ve,setNearFieldDetailEnabled:T,setSeatViewLocked:Ro,setNavigationMode:Bn,showArriveChip:Yr,removeArriveChip:Kr,inSeatView:()=>Vn!==null,setSeatStepping:z=>{Wa=z},seatViewArrival:(z,W)=>n.arriveAtSeatEye?Ya(z,W):null,enterSeatView:(z,W)=>we?.enter(z,W)});I=!0;let $r=je.overviewChip,Jf=je.layoutOverviewChip,ed=je.applyFloorFocus,td=je.focusOverview,Ka=je.cancelFlight,$a=je.flyToSeat,Za=je.focusSectionCamera;Qf.appendChild($r),Wr={container:e,model:i,opts:n,analytics:a,orbit:D,loop:Ie,seatsById:c,ensureSeatView:Ha,resolvedSeatViewPose:Ur,gpu:()=>b,gl:B.gl,isContextLost:()=>S,isDisposed:()=>x,flightGen:()=>je.flightGen(),setPanorama:z=>{w=z},getLoadAbort:()=>v,setLoadAbort:z=>{v=z},setPanoramaSphereVisible:z=>{N=z,z&&we?.exit()},setFrozen:z=>{A=z},raisePanoramaLayer:F,restorePanoramaLayer:E,getOverviewChip:()=>$r,labelOverlay:K,reducedMotion:Nn,removeArriveChip:Kr,showArriveChip:Yr};let Rt=Df({glctx:B,orbit:D,model:i,seats:t.seats,opts:n,cinematic:Q,analytics:a,seatIdByIndex:s,sectionIdBySeatId:u,tapSlop:cM,tapMs:lM,gpu:()=>b,pick:()=>M,seatViewLocked:()=>Ut.seatViewLocked(),focusedSectionId:()=>ee,selection:()=>g,cancelFlight:Ka,focusSectionCamera:Za,focusSeatCamera:je.focusSeatCamera,setSelection:Ga,ensureSeatView:Ha});B.canvas.addEventListener("pointerdown",Rt.onDown),B.canvas.addEventListener("pointermove",Rt.onMove),B.canvas.addEventListener("pointerup",Rt.onUp),B.canvas.addEventListener("pointercancel",Rt.onUp),Ie.requestRender();let Zr={setAvailability(z){let W=Bm(g,z),Z=gi(i.seats,W);Z.length&&b&&b.uploadSeatStateRuns(Z),h(),Z.length&&oe(),Ie.requestRender()},setSelection:Ga,setNavigationMode:Bn,zoomIn(){D.zoomBy(ln),Ie.requestRender()},zoomOut(){D.zoomBy($n),Ie.requestRender()},flyToSeat:$a,focusOverview:td,seatViewStop:()=>Vn,recentreSeatView:()=>we?.recentre()??!1,resize(){let{width:z,height:W}=B.resize();D.setAspect(z/Math.max(1,W)),$f(),qf(),Jf(),Ie.requestRender()},stats(){return{...Ie.stats(),drawCalls:b?b.drawCalls:0,fallbackTriangles:b?b.seatGeometry.drawRange.count/3*i.seats.count:0,seatCount:i.seatCount}},captureImage(z=1280){if(S||!b||typeof document>"u")return null;Ye(0);let W=B.canvas,Z=Math.min(1,z/Math.max(W.width,W.height,1)),se=document.createElement("canvas");se.width=Math.max(1,Math.round(W.width*Z)),se.height=Math.max(1,Math.round(W.height*Z));let me=se.getContext("2d");return me?(me.drawImage(W,0,0,se.width,se.height),se.toDataURL("image/jpeg",.82)):null},captureSeatView(z,W=480){if(S||!b||A||typeof document>"u"||Q.active||w!==null||we?.active)return null;let Z=j.get(z);if(Z)return Z;let se=i.seats.idToIndex.get(z);if(se===void 0)return null;let{eye:me,focal:Se,fov:Me}=Ya(z,se),Ee=D.snapshot(),He=[O.seatDetailMix,O.structureDetailMix],Ke=null;try{H=!0,D.camera.position.set(me[0],me[1],me[2]),D.camera.perspective({fov:Me,aspect:D.camera.aspect}),D.camera.lookAt(Se),D.camera.updateMatrixWorld(),D.syncFromCamera(),O.seatDetailMix=1,O.structureDetailMix=1,O.forceRegather(),Ye(0);let ie=B.canvas,ke=Math.min(ie.width,Math.round(ie.height*16/9)),Ce=Math.round(ke*9/16),it=document.createElement("canvas");it.width=Math.max(1,Math.round(W)),it.height=Math.max(1,Math.round(W*9/16));let jt=it.getContext("2d");jt&&(jt.drawImage(ie,(ie.width-ke)/2,(ie.height-Ce)/2,ke,Ce,0,0,it.width,it.height),Ke=it.toDataURL("image/jpeg",.8))}finally{H=!1,Ee(),O.seatDetailMix=He[0],O.structureDetailMix=He[1],O.forceRegather(),Ye(0)}if(Ke)for(j.set(z,Ke);j.size>V;)j.delete(j.keys().next().value);return Ke},getQualityEvidence(){let z=Ie.stats(),W=B.canvas.clientWidth||1,Z=B.canvas.clientHeight||1,se=i.bounds.center,me=gt(D.camera.projectionViewMatrix,[se[0],i.bounds.box.min[1],se[2]],W,Z),Se=gt(D.camera.projectionViewMatrix,[se[0],i.bounds.box.max[1],se[2]],W,Z),Me=i.bounds.box,Ee=[Me.min[0],Me.max[0]].flatMap(ie=>[Me.min[1],Me.max[1]].flatMap(ke=>[Me.min[2],Me.max[2]].map(Ce=>gt(D.camera.projectionViewMatrix,[ie,ke,Ce],W,Z)))).filter(ie=>Number.isFinite(ie.x)&&Number.isFinite(ie.y)&&Number.isFinite(ie.depth)),He=Ee.length?(()=>{let ie=Math.min(...Ee.map(De=>De.x)),ke=Math.max(...Ee.map(De=>De.x)),Ce=Math.min(...Ee.map(De=>De.y)),it=Math.max(...Ee.map(De=>De.y)),jt=Math.max(0,ie),Gn=Math.min(W,ke),Hn=Math.max(0,Ce),Eo=Math.min(Z,it),zn=Math.max(0,Gn-jt),rn=Math.max(0,Eo-Hn);return{box:{x:jt,y:Hn,width:zn,height:rn},horizontalFillRatio:zn/W,verticalFillRatio:rn/Z,visibleAreaRatio:zn*rn/(W*Z),clippedEdges:[...Ce<0?["top"]:[],...ke>W?["right"]:[],...it>Z?["bottom"]:[],...ie<0?["left"]:[]]}})():void 0,Ke=String(B.gl.getParameter(B.gl.VERSION)??"");return{viewport:{width:W,height:Z},context:{webgl2:/webgl\s*2/i.test(Ke),lost:S},frame:{rendered:z.rendered,idle:z.idle},camera:{position:[D.camera.position.x,D.camera.position.y,D.camera.position.z],distance:D.currentDistance,verticalFovDeg:D.fovY},scene:{seatCount:i.seatCount,floorCount:i.floors.length,zoneCount:i.zones.length,sectionCount:i.sections.length,authoredRelief:p,renderedVerticalSpanM:Math.max(0,i.bounds.box.max[1]-i.bounds.box.min[1]),projectedReliefPx:me.visible&&Se.visible?Math.abs(me.y-Se.y):0},labels:K.qualityEvidence(),framing:He,...Vn?{seatView:{fovDeg:D.camera.fov,stop:Vn}}:{}}},getQualityReport(){return Pr(Zr.getQualityEvidence())},loseContextForTest(){B.simulateContextLossCycle()},floors(){return i.floors},focusFloor(z){if(z!==null&&!i.floors.some(Z=>Z.index===z))return!1;let W=z??-1;if(T(z!==null),Ro(!1),ed(W),Bn("orbit"),z===null)Q.cancel(),Nn()?D.frame(i.bounds,!1,U,n.portraitOverviewCrop===!0,$):D.frameSoft(i.bounds,U,n.portraitOverviewCrop===!0,$),K.setOverviewDistance(D.targetDistance);else{let Z=i.floors[z];if(Z.seatCount>0){Q.cancel();let se=Z.focalWorld[0]-Z.center[0],me=Z.focalWorld[2]-Z.center[2],Se=Math.hypot(se,me)>Z.radius*.12?Math.atan2(se,me):U;D.frame({center:Z.center,radius:Z.radius,box:Z.box},!1,Se,!1,{polarDeg:58,margin:1.12}),K.setOverviewDistance(D.targetDistance)}}return Ie.requestRender(),!0},zones(){return i.zones},focusZone(z){let W=i.zones.find(Se=>Se.id===z);if(!W||W.seatCount===0)return!1;T(!1),Ro(!1),Q.cancel(),Bn("orbit"),ve(null),n.onSectionFocusChange?.(null);let Z=W.focalWorld[0]-W.center[0],se=W.focalWorld[2]-W.center[2],me=Math.hypot(Z,se)>W.radius*.12?Math.atan2(Z,se):void 0;return D.frame({center:W.center,radius:W.radius*1.25},!1,me),Ie.requestRender(),!0},sections(){return i.sections},focusSection(z){return Za(z)},rows(z){return z?i.rows.filter(W=>W.sectionId===z):i.rows},seatsInRow(z){return t.seats.filter(W=>W.rowId===z).map(W=>({id:W.id,label:W.displayLabel||W.label}))},focusRow(z){let W=i.rows.find(Z=>Z.id===z);return!W||W.seatCount===0?!1:(T(!0),Ro(!1),Q.cancel(),Bn("pan"),W.sectionId&&(ve(W.sectionId),n.onSectionFocusChange?.(W.sectionId)),D.frame({center:W.center,radius:Math.max(2.5,W.radius*.65)}),Ie.requestRender(),!0)},setReducedMotionForTest(z){k=z},dispose(){x=!0,Y?.dispose(),rt(!1),Kr(),$r.remove(),Zf.remove(),Ka(),we?.dispose(),Ie.stop(),K.dispose(),Ht?.disconnect(),w&&(w.dispose(),w=null),E(),X(),B.canvas.removeEventListener("pointerdown",Rt.onDown),B.canvas.removeEventListener("pointermove",Rt.onMove),B.canvas.removeEventListener("pointerup",Rt.onUp),B.canvas.removeEventListener("pointercancel",Rt.onUp),B.canvas.removeEventListener("pointermove",Io),B.canvas.removeEventListener("pointerdown",Io),B.canvas.removeEventListener("pointerleave",Ba),zt&&cancelAnimationFrame(zt),D.dispose(),M&&M.dispose(),b&&b.dispose(),b=null,y?.dispose(),y=null,M=null,B.dispose()}};return a.opened(i.seatCount,p,t.prepared?.buildMs??performance.now()-o,t.prepared?.source??"inline"),Zr}0&&(module.exports={VENUE3D_QUALITY_REPORT_VERSION,autoVenue3d,buildSceneModel,estimateVenue3D,inspectVenue3DQualityEvidence,mountVenue3D,prepareVenue3D,prepareVenue3DFromChart});
1203
+ void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:Pe},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let q=new ze.Mesh(e,{geometry:me,program:pe});q.frustumCulled=!1,q.setParent(n),Ce.screenProgram=pe,ue=!0,Ce.drawCalls=3+(ne?1:0)+1},B.src=$.contentImageUrl}return Ce}var Dt=require("ogl");function Iv(e,t,n){let o=e+(t<<8)+(n<<16);return o===0?-1:o-1}function ch(e,t,n,o,r,i){let a=-1,s=1/0;for(let c=0;c<n;c++)for(let l=0;l<t;l++){let u=(c*t+l)*4,m=Iv(e[u],e[u+1],e[u+2]);if(m<0||m>=i)continue;let f=l-o,h=c-r,d=f*f+h*h;d<s&&(s=d,a=m)}return a}function lh(e,t,n,o,r,i){let a=e-n.left,s=t-n.top,c=Math.round(a*o),l=Math.round((n.height-s)*o);return{x:Math.max(0,Math.min(r-1,c)),y:Math.max(0,Math.min(i-1,l))}}var _v=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],ii=class{constructor(t,n,o,r,i){this.seatScene=new Dt.Transform;this.chairScene=new Dt.Transform;this.solidScene=new Dt.Transform;this.target=null;this.restoreClear=[0,0,0];this.renderer=t,this.gl=t.gl,this.maxIndex=i,this.seatProg=$f(this.gl),this.chairProg=Zf(this.gl),this.depthProg=qf(this.gl);let a=new Dt.Mesh(this.gl,{geometry:n,program:this.seatProg});a.frustumCulled=!1,a.setParent(this.seatScene);let s=new Dt.Mesh(this.gl,{geometry:o,program:this.chairProg});s.frustumCulled=!1,s.setParent(this.chairScene);let c=new Dt.Mesh(this.gl,{geometry:r,program:this.depthProg});c.frustumCulled=!1,c.setParent(this.solidScene)}setRoomCentre(t){this.depthProg.uniforms.uRoomCentre.value.set(t??[0,0])}setRestoreClear(t){this.restoreClear=[t[0],t[1],t[2]]}syncFromSeatProgram(t){for(let r of _v)this.seatProg.uniforms[r].value=t.uniforms[r].value;let n=t.uniforms.uFocusFloor.value;this.seatProg.uniforms.uFocusFloor.value=n,this.chairProg.uniforms.uFocusFloor.value=n,this.depthProg.uniforms.uFocusFloor.value=n;let o=t.uniforms.uSeeThrough?.value;if(o)for(let r of[this.seatProg,this.chairProg,this.depthProg])r.uniforms.uSeeThrough.value=o}ensureTarget(){let t=this.gl.drawingBufferWidth,n=this.gl.drawingBufferHeight;return this.target&&(this.target.width!==t||this.target.height!==n)&&this.destroyTarget(),this.target||(this.target=new Dt.RenderTarget(this.gl,{width:t,height:n,depth:!0})),this.target}destroyTarget(){if(!this.target)return;let t=this.gl;this.target.buffer&&t.deleteFramebuffer(this.target.buffer);for(let n of this.target.textures??[])n.texture&&t.deleteTexture(n.texture);this.target.depthBuffer&&t.deleteRenderbuffer(this.target.depthBuffer),this.target=null}pick(t,n,o,r){let i=this.gl,a=this.ensureTarget(),s=i.drawingBufferWidth,c=i.drawingBufferHeight,l=Math.max(0,n-r),u=Math.max(0,o-r),m=Math.max(1,Math.min(s,n+r+1)-l),f=Math.max(1,Math.min(c,o+r+1)-u);i.enable(i.SCISSOR_TEST),i.scissor(l,u,m,f);let[h,d,p]=this.restoreClear;i.clearColor(0,0,0,1),this.renderer.render({scene:this.solidScene,camera:t,target:a,clear:!0}),this.renderer.render({scene:this.seatScene,camera:t,target:a,clear:!1}),this.renderer.render({scene:this.chairScene,camera:t,target:a,clear:!1}),i.clearColor(h,d,p,1),i.disable(i.SCISSOR_TEST);let b=new Uint8Array(m*f*4);return this.renderer.bindFramebuffer(a),i.readPixels(l,u,m,f,i.RGBA,i.UNSIGNED_BYTE,b),this.renderer.bindFramebuffer(),ch(b,m,f,n-l,o-u,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function uh(e,t){let n=[];for(let o of t)e.has(o.seatId)?e.set(o.seatId,ho(o.state)):n.push(o);return n}function mh(e,t,n){let o=new Set;for(let a of t)(e.has(a)||n(a)!==void 0)&&o.add(a);let r=new Map(e),i=[];for(let[a,s]of e)o.has(a)||(i.push({seatId:a,state:je[s]??"available"}),r.delete(a));for(let a of o){if(r.has(a))continue;let s=n(a);s!==void 0&&(r.set(a,s),i.push({seatId:a,state:"selected"}))}return{updates:i,next:r}}var rn=require("ogl");function Cv(e,t){return[e[0]-t[0],e[1]-t[1],e[2]-t[2]]}function fh(e,t){return[e[0]+t[0],e[1]+t[1],e[2]+t[2]]}function Tv(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function hh(e){let t=Math.hypot(e[0],e[1],e[2]);return t>1e-6?[e[0]/t,e[1]/t,e[2]/t]:[0,0,0]}function bs(e){let t=Math.max(0,Math.min(1,e));return t*t*t*(t*(t*6-15)+10)}function ys(e,t){return Math.max(0,Math.min(1,e+t))}function dh(e,t){let n=e.length;if(n===0)return[0,0,0];if(n===1)return[...e[0]];let o=Math.max(0,Math.min(1,t)),r=n-1,i=Math.floor(o*r);i>=r&&(i=r-1);let a=o*r-i,s=e[Math.max(0,i-1)],c=e[i],l=e[i+1],u=e[Math.min(n-1,i+2)],m=a*a,f=m*a,h=[0,0,0];for(let d=0;d<3;d++)h[d]=.5*(2*c[d]+(-s[d]+l[d])*a+(2*s[d]-5*c[d]+4*l[d]-u[d])*m+(-s[d]+3*c[d]-3*l[d]+u[d])*f);return h}function gs(e,t,n,o,r){let i=hh(Cv(t,n));i[0]===0&&i[1]===0&&i[2]===0&&(i=[0,0,1]);let a=fh(fh(t,Tv(i,2.5)),[0,1.5,0]),s=[t[0]-o[0],0,t[2]-o[2]],c=hh(s);c[0]===0&&c[2]===0&&(c=[i[0],0,i[2]]);let l=Math.max(1,r),u=[o[0]+c[0]*l*1.3,o[1]+l*.75,o[2]+c[2]*l*1.3];return{waypoints:[e,u,a],finalPos:a}}function xs(e,t,n=35,o=28){let r=bs(t),i=dh(e,r),a=bs(Math.max(0,Math.min(1,(t-.66)/.34)));return{pos:i,fov:n+(o-n)*a,eased:r}}function gh(e,t,n){let o=e.position.clone(),r=new rn.Quat().copy(e.quaternion);e.position.set(t[0],t[1],t[2]),e.lookAt(new rn.Vec3(n[0],n[1],n[2]));let i=new rn.Quat().copy(e.quaternion);return e.position.copy(o),e.quaternion.copy(r),i}var ai=class{constructor(t){this.active=!1;this.waypoints=[];this.startQuat=new rn.Quat;this.endQuat=new rn.Quat;this.outQuat=new rn.Quat;this.startTime=0;this.duration=2500;this.endFov=28;this.resolveFn=null;this.camera=t}start(t,n,o,r=2500,i=28){return this.settle(),this.waypoints=t,this.startQuat.copy(n),this.endQuat.copy(o),this.duration=r,this.endFov=i,this.startTime=performance.now(),this.active=!0,new Promise(a=>{this.resolveFn=a})}update(t){if(!this.active)return!1;let n=Math.min(1,(t-this.startTime)/this.duration),{pos:o,fov:r,eased:i}=xs(this.waypoints,n,35,this.endFov);return this.camera.position.set(o[0],o[1],o[2]),this.outQuat.copy(this.startQuat).slerp(this.endQuat,ys(i,.15)),this.camera.quaternion.copy(this.outQuat),this.camera.fov=r,this.camera.updateProjectionMatrix(),n>=1?(this.settle(),!1):!0}cancel(){this.settle()}settle(){this.active=!1;let t=this.resolveFn;this.resolveFn=null,t&&t()}};var xh=Qs,Lv=.12,kv=1.6,Mh=.12;function vh(e,t,n){let o=e[t*3],r=e[t*3+1],i=e[t*3+2],a=n[0]-o,s=n[2]-i,c=Math.hypot(a,s);if(!(c>.001))return null;let l=a/c,u=s/c,m=1/0,f=null;for(let h=0;h*3<e.length;h++){if(h===t)continue;let d=e[h*3]-o,p=e[h*3+2]-i,b=d*l+p*u;b<.3||b>1.6||Math.abs(d*u-p*l)>.6||b<m&&(m=b,f=r-e[h*3+1])}return f}var Ov=.25,Fv=1.5;function Sh(e,t,n=0,o,r,i=!1){let a=[t.x*C,n+Fv,t.y*C],s=r?[r[0],r[1],r[2]]:a,c=e[1],l=Number.isFinite(c)?c+(i?kv:xh):Number.isFinite(o)?n+o:n+xh,u=a[0]-e[0],m=a[2]-e[2],f=Math.hypot(u,m),h=f>.001?Math.min(Lv,f*Ov):0,d=f>.001?u/f:0,p=f>.001?m/f:0;return{eye:[e[0]+d*h,l,e[2]+p*h],focal:s}}var an=Math.PI/180,Dv=45,Ms=80,si=70,Nv=1,Bv=.99;function Vv(e,t){if(!(e<Nv))return Ms;if(!(Number.isFinite(t)&&t>0))return si;let n=2*Math.atan(t/(2*ci*Bv)/Math.max(.05,e))/an;return Math.max(si,Math.min(Ms,n))}var Gv=.25,ci=1,Hv=.25,zv=12*an,Uv=.2,jv=1.5,wh=.8,Ph=6,Ch=1.9,Wv=2/3,Xv=.12,Kv=.9,Yv=1.2,$v=2,Th=.05,Zv=6;function Lh(e,t,n=0){if(!e.length)return{min:[t[0]-6,n,t[2]-6],max:[t[0]+6,Math.max(n+wh,t[1]),t[2]+6]};let o=1/0,r=-1/0,i=1/0,a=-1/0,s=n;for(let d of e)o=Math.min(o,d.cx-d.halfX),r=Math.max(r,d.cx+d.halfX),i=Math.min(i,d.cz-d.halfZ),a=Math.max(a,d.cz+d.halfZ),s=Math.max(s,d.y);let c=r-o,l=a-i,u=Math.max(c,Math.min(l,Ph))/2,m=Math.max(l,Math.min(c,Ph))/2,f=(o+r)/2,h=(i+a)/2;return{min:[f-u,n,h-m],max:[f+u,Math.max(n+wh,s),h+m]}}function qv(e){return{min:[e.min[0],e.min[1],e.min[2]],max:[e.max[0],e.max[1]+Ch,e.max[2]]}}function vs(e){let t=e.max[1];return[(e.min[0]+e.max[0])/2,Math.max(e.min[1]+jv,t+Uv,t+Ch*Wv),(e.min[2]+e.max[2])/2]}function kh(e,t){let n=e[0]-t[0],o=e[2]-t[2],r=Math.hypot(n,o);return r<.001?{x:0,z:1}:{x:n/r,z:o/r}}function Ah(e,t,n){let o=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=Math.hypot(o,r,i)||1;o/=a,r/=a,i/=a;let s=-i,c=o,l=Math.hypot(s,c);if(l<1e-6)return 1/0;s/=l,c/=l;let u=1/0,m=-1/0;for(let f=0;f<8;f++){let h=(f&1?n.max[0]:n.min[0])-e[0],d=(f&2?n.max[1]:n.min[1])-e[1],p=(f&4?n.max[2]:n.min[2])-e[2],b=Math.max(Th,h*o+d*r+p*i),x=(h*s+p*c)/b;x<u&&(u=x),x>m&&(m=x)}return m-u}function Rh(e,t,n){let o=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=Math.hypot(o,r,i)||1;o/=a,r/=a,i/=a;let s=-i,c=o,l=Math.hypot(s,c);if(l<1e-6)return 1/0;s/=l,c/=l;let u=-c*r,m=c*o-s*i,f=s*r,h=1/0,d=-1/0;for(let p=0;p<8;p++){let b=(p&1?n.max[0]:n.min[0])-e[0],x=(p&2?n.max[1]:n.min[1])-e[1],y=(p&4?n.max[2]:n.min[2])-e[2],M=Math.max(Th,b*o+x*r+y*i),A=(b*u+x*m+y*f)/M;A<h&&(h=A),A>d&&(d=A)}return d-h}function li(e,t){return Math.tan(e*an/2)*Math.max(.05,t)}function Eh(e,t,n){let o=Vv(n,e),r=c=>Math.max(Dv,Math.min(o,c)),i=c=>2*Math.atan(c)/an,a=Number.isFinite(e)&&e>0?r(i(e/(2*Gv)/Math.max(.05,n))):o;if(!(Number.isFinite(t)&&t>0))return a;let s=Math.min(a,r(i(t/(2*Xv))));return e/(2*li(s,n))>ci?a:s}function Oh(e,t,n,o={}){let r=vs(t),i=[e[0],e[1],e[2]],a=0,s=0,c=d=>{if(!(d>0))return;let p=kh(i,r);i[0]+=p.x*d,i[2]+=p.z*d,s+=d},l=o.preserveEye?0:t.max[1]+Hv-i[1];l>0&&(i[1]+=l,a=l,c(l/Math.tan(zv)));let u=qv(t),m=Ah(i,r,t),f=Eh(m,Rh(i,r,u),n),h=m/(2*li(f,n));for(let d=0;!o.preserveEye&&d<Zv&&h>ci;d++){let p=Math.max(1,Math.hypot(i[0]-r[0],i[2]-r[2])),b=Number.isFinite(h)?h/ci:2;c(Math.min(60,p*(Math.min(4,b)-1)+.5)),m=Ah(i,r,t),f=Eh(m,Rh(i,r,u),n),h=m/(2*li(f,n))}return{eye:i,focal:r,fov:f,raisedM:a,pulledBackM:s,stageFrameWidth:h}}function Qv(e,t,n){let o=Math.tan(t*an/2),r=li(t,n);return Math.max(1,e/Math.max(.05,Math.min(o,r)))}var Jv=.7,Ih=.5,e2=.8;function _h(e,t,n){let o=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],r=[n[0]-e[0],n[1]-e[1],n[2]-e[2]],i=o[0]*r[0]+o[1]*r[1]+o[2]*r[2],a=Math.hypot(o[0],o[1],o[2])*Math.hypot(r[0],r[1],r[2])||1;return Math.acos(Math.max(-1,Math.min(1,i/a)))/an}function t2(e,t,n){let o=l=>{let u=Math.hypot(l[0],l[1],l[2])||1;return[l[0]/u,l[1]/u,l[2]/u]},r=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],i=Math.hypot(r[0],r[1],r[2]),a=o(r),s=o([n[0]-e[0],n[1]-e[1],n[2]-e[2]]),c=o([0,1,2].map(l=>a[l]*(1-Ih)+s[l]*Ih));return[e[0]+c[0]*i,e[1]+c[1]*i,e[2]+c[2]*i]}function Fh(e,t){let{aspect:n,venue:o}=t,r=e.focal,i=kh(e.eye,r),a=p=>(p[0]-r[0])*i.x+(p[2]-r[2])*i.z,s=[{name:"seat",eye:e.eye,focal:r,fov:e.fov}],c=$v*(t.rowDepthM??Kv),l=[e.eye[0]+i.x*c,e.eye[1]+Yv,e.eye[2]+i.z*c],u=[e.eye[0],e.eye[1]-Jv,e.eye[2]],m=t2(l,r,u);s.push({name:"row",eye:l,focal:m,fov:Math.min(Ms,Math.max(e.fov,2*Math.max(_h(l,m,u),_h(l,m,r))/e2))});let f=(p,b,x,y)=>{let M=Qv(x,e.fov,n)*1.08,A=M*Math.sin(y*an),w=Number.isFinite(t.seatingTopY)?t.seatingTopY+2:-1/0,g=Math.max(A,w-b[1]),S=M*Math.cos(y*an);return{name:p,eye:[b[0]+i.x*S,b[1]+g,b[2]+i.z*S],focal:b,fov:e.fov}};t.section&&t.section.radius>0&&s.push(f("section",t.section.center,t.section.radius,35)),s.push(f("venue",o.center,Math.max(1,o.radius),40));let h=[],d=-1/0;for(let p of s){let b=a(p.eye);h.length&&b<=d+.5||(h.push(p),d=b)}return h}var Vh=require("ogl"),Zo=Math.PI/180,Ss=320,Dh=70*Zo,n2=32*Zo,o2=24*Zo,Nh=.0026,r2=.22,i2=.006,a2=180,s2=900,c2=1100,l2=4,ct=(e,t,n)=>Math.max(t,Math.min(n,e)),Bh=e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2;function Gh(e){let{canvas:t,camera:n}=e,o=[],r=!1,i=0,a=0,s=0,c=0,l=0,u=0,m=Ss,f=null,h=()=>{f&&(clearTimeout(f),f=null)},d=!1,p=[0,0],b=0,x=!1,y=null,M=null,A=new Map,w=!1,g=0,S=0,v=0,P=0,E=()=>r&&o.length?o[ct(Math.round(i),0,o.length-1)].name:null,k=()=>{let T=E();T!==y&&(y=T,e.onStopChange?.(T))},L=()=>{if(!r||!o.length)return;let T=o[ct(Math.floor(i),0,o.length-1)],D=o[ct(Math.ceil(i),0,o.length-1)],W=ct(i-Math.floor(i),0,1),H=(xe,Ce)=>xe+(Ce-xe)*W,j=[H(T.eye[0],D.eye[0]),H(T.eye[1],D.eye[1]),H(T.eye[2],D.eye[2])],Z=[H(T.focal[0],D.focal[0]),H(T.focal[1],D.focal[1]),H(T.focal[2],D.focal[2])],X=Z[0]-j[0],ee=Z[1]-j[1],ne=Z[2]-j[2],ue=Math.hypot(X,ee,ne)||1,de=Math.atan2(X,ne),me=Math.asin(ct(ee/ue,-1,1)),pe=de+a,Pe=ct(me+s,-80*Zo,80*Zo),_e=Math.cos(Pe)*ue;X=Math.sin(pe)*_e,ee=Math.sin(Pe)*ue,ne=Math.cos(pe)*_e,n.position.set(j[0],j[1],j[2]),n.fov=H(T.fov,D.fov),n.updateProjectionMatrix(),n.lookAt(new Vh.Vec3(j[0]+X,j[1]+ee,j[2]+ne)),e.onApplied?.()},I=()=>{if(!r||!o.length)return;let T=ct(Math.round(i),0,o.length-1);if(e.reducedMotion()){d=!1,i=T,L(),k(),e.requestRender();return}if(Math.abs(T-i)<.001){d=!1,k();return}c=i,l=T,u=performance.now(),m=Ss,d=!0,e.requestRender()},R=T=>{!r||o.length<2||(h(),d=!1,i=ct(i+T,0,o.length-1),L(),k(),e.requestRender())},_=(T,D)=>{r&&(h(),d=!1,x=!1,a=ct(a-T*Nh,-Dh,Dh),s=ct(s-D*Nh,-o2,n2),L(),e.requestRender())},F=T=>{r&&(A.set(T.pointerId,{x:T.clientX,y:T.clientY}),A.size===1?(w=!0,P=0,g=T.clientX,S=T.clientY):A.size===2&&(w=!1,v=N()))},N=()=>{let T=[...A.values()];return T.length<2?0:Math.hypot(T[0].x-T[1].x,T[0].y-T[1].y)},O=T=>{if(!r||!A.has(T.pointerId))return;if(A.set(T.pointerId,{x:T.clientX,y:T.clientY}),A.size>=2){let H=N();v>0&&R((v-H)*i2),v=H;return}if(!w)return;let D=T.clientX-g,W=T.clientY-S;g=T.clientX,S=T.clientY,P+=Math.abs(D)+Math.abs(W),!(P<=l2)&&_(D,W)},V=T=>{A.delete(T.pointerId)&&(A.size<2&&(v=0),A.size===0&&(w=!1,I()))},z=T=>{if(!r)return;T.preventDefault();let D=T.deltaMode===1?16:T.deltaMode===2?100:1,W=ct(T.deltaY*D/100,-2,2);R(W*r2),M&&clearTimeout(M),M=setTimeout(()=>{M=null,I()},a2)},G=()=>{h(),r&&(r=!1,d=!1,x=!1,o=[],A.clear(),w=!1,M&&(clearTimeout(M),M=null),y!==null&&(y=null,e.onStopChange?.(null)))};return t.addEventListener("pointerdown",F),t.addEventListener("pointermove",O),t.addEventListener("pointerup",V),t.addEventListener("pointercancel",V),t.addEventListener("wheel",z,{passive:!1}),{get active(){return r},enter(T,D=0){if(T.length<2){G();return}h(),o=T,r=!0,i=e.reducedMotion()?0:ct(D,0,T.length-1),i>0&&(f=setTimeout(()=>{f=null,r&&(c=i,l=0,u=performance.now(),m=c2,d=!0,e.requestRender())},s2)),a=0,s=0,d=!1,x=!1,y=null,L(),k(),e.requestRender()},exit:G,recentre(){return r?Math.abs(a)<1e-4&&Math.abs(s)<1e-4?!0:e.reducedMotion()?(x=!1,a=0,s=0,L(),e.requestRender(),!0):(p=[a,s],b=performance.now(),x=!0,e.requestRender(),!0):!1},update(T){if(!r)return!1;let D=!1;if(x){let W=ct((T-b)/Ss,0,1),H=1-Bh(W);a=p[0]*H,s=p[1]*H,W>=1?(x=!1,a=0,s=0):D=!0}if(d){let W=ct((T-u)/m,0,1);i=c+(l-c)*Bh(W),W>=1?(d=!1,i=l,k()):D=!0}return L(),D},currentStop:E,dispose(){G(),t.removeEventListener("pointerdown",F),t.removeEventListener("pointermove",O),t.removeEventListener("pointerup",V),t.removeEventListener("pointercancel",V),t.removeEventListener("wheel",z)}}}function Hh(e){return e.flying?"cinematic":e.panoramaMounted?"panorama":e.seatViewActive?"seatView":"orbit"}function zh(e,t){return e?-1:t}var Rs=null;function td(){return Rs??=Promise.resolve().then(()=>(ed(),Jh)).catch(e=>{throw Rs=null,e}),Rs}var nd=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),bi=class{constructor(t){this.orbitLatched=!1;this.panoramaOpenedAt=0;this.cb=t}emit(t,n){if(this.cb)try{this.cb(t,n)}catch{}}opened(t,n,o,r){this.emit("3d_opened",{seats:t,hasHeights:n,...o===void 0?{}:{buildMs:Math.round(o)},...r===void 0?{}:{prepSource:r}})}orbitEngaged(){this.orbitLatched||(this.orbitLatched=!0,this.emit("3d_orbit_engaged"))}seatPicked(t,n){this.emit("3d_seat_picked",{seatId:t,sectionId:n})}cinematicPlayed(t){this.emit("3d_cinematic_played",{durationMs:t,reducedMotion:!1})}cinematicSkipped(){this.emit("3d_cinematic_skipped",{reducedMotion:!0})}cinematicCancelled(){this.emit("3d_cinematic_cancelled")}panoramaOpened(){this.panoramaOpenedAt=nd(),this.emit("3d_panorama_opened")}panoramaClosed(){let t=this.panoramaOpenedAt?Math.round(nd()-this.panoramaOpenedAt):0;this.panoramaOpenedAt=0,this.emit("3d_panorama_closed",{viewMs:t})}panoramaFailed(t,n){this.emit("3d_panorama_failed",{seatId:t,phase:n})}panoramaFallback(t){this.emit("3d_panorama_fallback",{seatId:t})}contextLost(){this.emit("3d_context_lost")}contextRestored(){this.emit("3d_context_restored")}};function od(e){let t=e.style.position;return getComputedStyle(e).position!=="static"?()=>{}:(e.style.position="relative",()=>{e.style.position==="relative"&&(e.style.position=t)})}function rd(e){let{container:t,model:n,opts:o,expandedSeatById:r,seatIdsByRow:i,isNarrow:a}=e,s=null,c=()=>{if(!s)return;let m=a();Object.assign(s.style,m?{left:"12px",right:"12px",bottom:"70px",transform:"none",justifyContent:"center"}:{left:"50%",right:"auto",bottom:"18px",transform:"translateX(-50%)",justifyContent:"initial"})},l=()=>{s?.remove(),s=null};return{show:(m,f,h=!1)=>{if(l(),e.isDisposed())return null;let d=document.createElement("div");d.setAttribute("role","group"),Object.assign(d.style,{position:"absolute",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",zIndex:"4"});let p=o.chrome?.caption!==!1,b=o.chrome?.seatStepper!==!1;if(!p&&!b)return null;let x=r.get(m),y=x?.sectionId?n.sections.find(E=>E.id===x.sectionId):void 0,M=x?.label??m;d.setAttribute("aria-label",`Explore views near ${y?.label?`${y.label}, `:""}seat ${M}`);let A=document.createElement("span");A.textContent=o.seatViewCaption?.(m)??["Live 3D seat view",y?.label,M].filter(Boolean).join(" \xB7 "),Object.assign(A.style,{maxWidth:"min(70vw, 560px)",padding:"5px 10px",borderRadius:"999px",overflow:"hidden",color:"#d9e3f5",background:"rgba(12,18,32,0.72)",font:"600 11px/1.2 inherit",textOverflow:"ellipsis",whiteSpace:"nowrap",backdropFilter:"blur(6px)"}),p&&d.appendChild(A);let w=document.createElement("div");Object.assign(w.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),d.appendChild(w);let g=x?.rowId?i.get(x.rowId):void 0,S=g?.indexOf(m)??-1,v=S>=0?[g?.[S-1],g?.[S+1]]:[void 0,void 0],P=(E,k,L,I=!1)=>{let R=document.createElement("button");R.type="button",R.textContent=E,R.setAttribute("aria-label",k),Object.assign(R.style,{minHeight:"44px",padding:I?"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"}),I||(R.style.minWidth="44px"),I&&(R.dataset.panoramaTrigger=""),R.addEventListener("click",L),w.appendChild(R)};if(b&&v[0]){let E=r.get(v[0])?.label??v[0];P("\u2039",`View previous seat ${E}`,()=>{e.flyToSeat(v[0])})}if(b&&o.getSeatView){let E=o.seatViewActionLabel?.(m)??"Open 360\xB0 panorama";P(h?`\u21BB Retry ${E}`:`\u25C9 ${E}`,`${h?"Retry":E} from seat ${M}`,()=>{if(e.isDisposed()||f!==e.flightGen()){l();return}l(),e.openPanorama(m,400,f)},!0)}if(b&&v[1]){let E=r.get(v[1])?.label??v[1];P("\u203A",`View next seat ${E}`,()=>{e.flyToSeat(v[1])})}return!w.childElementCount&&!p?null:(t.appendChild(d),s=d,c(),d)},remove:l,layout:c}}var P2={rotate:"Drag to rotate the venue",move:"Drag to move the venue",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Show whole venue"};function id(e){let{container:t,orbit:n,isNarrow:o}=e,r={...P2,...e.labels??{}},i=(w,g)=>{w.setAttribute("aria-label",g),w.title=g},a=document.createElement("div"),s=!1;a.className="sl-3d-navigation-controls",Object.assign(a.style,{position:"absolute",right:"14px",bottom:"14px",display:"flex",zIndex:"4",flexDirection:"column",alignItems:"flex-end",gap:"7px"});let c=document.createElement("div");c.setAttribute("role","group"),c.setAttribute("aria-label","3D drag mode"),Object.assign(c.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let l=document.createElement("div");l.setAttribute("role","group"),l.setAttribute("aria-label","3D view controls"),Object.assign(l.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let u=document.createElement("button");u.type="button",u.textContent="\u21BB",i(u,r.rotate);let m=document.createElement("button");m.type="button",m.textContent="\u2725",i(m,r.move);let f=document.createElement("button");f.type="button",f.textContent="\u2212",i(f,r.zoomOut);let h=document.createElement("button");h.type="button",h.textContent="+",i(h,r.zoomIn);for(let w of[u,m,f,h])w.className="sl-3d-icon-control",Object.assign(w.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"});c.append(u,m),l.append(h,f);let d=null,p=()=>{let w=n.dragAction();if(w===d)return;d=w;let g=w==="orbit";u.setAttribute("aria-pressed",String(g)),m.setAttribute("aria-pressed",String(!g)),u.style.background=g?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",m.style.background=g?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",a.title=g?`${r.rotate} \xB7 ${r.move} with Shift`:`${r.move} \xB7 ${r.rotate} with Shift`},b=w=>{n.setPrimaryDragMode(w),p()};u.addEventListener("click",()=>b("orbit")),m.addEventListener("click",()=>b("pan"));let x=()=>{let{atMin:w,atMax:g}=n.dollyLimitState();h.disabled!==w&&(h.disabled=w),f.disabled!==g&&(f.disabled=g)};f.addEventListener("click",()=>{n.zoomBy(po),x()}),h.addEventListener("click",()=>{n.zoomBy(Ln),x()}),a.append(c,l),b("auto"),t.appendChild(a);let y=e.enabled!==!1,M=()=>{let w=o();a.style.display=s||!y?"none":"flex",a.style.right=w?"12px":"14px",a.style.bottom=w?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",c.style.display=w?"none":"flex",h.style.display=w?"none":"",f.style.display=w?"none":""};return M(),{element:a,utilityControls:l,setNavigationMode:b,syncNavigationMode:p,syncZoomLimits:x,setSeatViewLocked:w=>{s=w,n.setInteractionEnabled(!w),M()},seatViewLocked:()=>s,layout:M}}var A2=.5,ad=12,sd=20,R2=28;function E2(e,t,n){return!(e>0)||!(n>0)?0:A2*n/(2*e*Math.tan(t*Math.PI/360))}function cd(e){let{glctx:t,orbit:n,model:o,seats:r,opts:i,cinematic:a,analytics:s,seatIdByIndex:c,sectionIdBySeatId:l,tapSlop:u,tapMs:m,cancelFlight:f,focusSectionCamera:h,setSelection:d,ensureSeatView:p}=e,b=0,x=0,y=0,M=-1,A=!1,w=!1,g=I=>{e.seatViewLocked()||M===-1&&(M=I.pointerId,b=I.clientX,x=I.clientY,y=performance.now(),A=!1,w=a.active,a.active&&(s.cinematicCancelled(),f(),i.onViewTargetChange?.(null)))},S=I=>{I.pointerId===M&&Math.hypot(I.clientX-b,I.clientY-x)>u&&(A=!0)},v=(I,R,_,F,N)=>{let O=t.canvas.getBoundingClientRect(),V=t.canvas.clientWidth||O.width||1,z=t.canvas.clientHeight||O.height||1,G=I-O.left,T=R-O.top,D=F*F,W=-1,H=D,j=1/0;for(let Z of r){if(_&&Z.sectionId!==_)continue;let X=o.seats.idToIndex.get(Z.id);if(X===void 0)continue;if(N){let pe=Math.round(o.seats.iState[X]??0);if(pe!==0&&pe!==3)continue}let ee=X*3,ne=Ot(n.camera.projectionViewMatrix,[o.seats.iPosition[ee],o.seats.iPosition[ee+1]+.55,o.seats.iPosition[ee+2]],V,z);if(!ne.visible)continue;let ue=ne.x-G,de=ne.y-T,me=ue*ue+de*de;(me<H||Math.abs(me-H)<1&&ne.depth<j)&&(W=X,H=me,j=ne.depth)}return W},P=(I,R)=>{let _=e.gpu(),F=e.pick();if(!_||!F)return-1;F.syncFromSeatProgram(_.seatProgram);let N=t.canvas.getBoundingClientRect(),O=t.renderer.dpr,{x:V,y:z}=lh(I,R,N,O,t.gl.drawingBufferWidth,t.gl.drawingBufferHeight),G=Math.max(2,Math.round(8*O));return F.pick(n.camera,V,z,G)},E=()=>t.canvas.clientHeight||t.canvas.getBoundingClientRect().height,k=(I,R=ad)=>{let _=n.camera?.position;if(!_)return!1;let F=I*3,N=Math.hypot(_.x-o.seats.iPosition[F],_.y-o.seats.iPosition[F+1],_.z-o.seats.iPosition[F+2]);return E2(N,n.fovY,E())>=R};return{onDown:g,onMove:S,onUp:I=>{if(I.pointerId!==M)return;let R=!A&&performance.now()-y<m;if(M=-1,w){w=!1;return}let _=e.gpu(),F=e.pick();if(!R||!_||!F)return;let N=P(I.clientX,I.clientY),O=I.pointerType==="touch"||I.pointerType==="pen",V=O?sd:ad,z=N>=0&&k(N,V),G=!1;if(e.focusedSectionId()&&N>=0){let W=c[N],H=W?l.get(W):void 0;if(H&&H!==e.focusedSectionId()&&h(H,{keepCamera:z})){if(!z)return;G=!0}}if(e.focusedSectionId()&&N<0&&(N=v(I.clientX,I.clientY,e.focusedSectionId(),44,!1)),e.focusedSectionId()&&N<0){let W=v(I.clientX,I.clientY,null,72,!1),H=W>=0?c[W]:void 0,j=H?l.get(H):void 0;if(j&&j!==e.focusedSectionId()&&h(j))return}if(!e.focusedSectionId()){N<0&&(N=v(I.clientX,I.clientY,null,42,!1));let W=N>=0?c[N]:void 0,H=W?l.get(W):void 0;if(H&&h(H,{keepCamera:z})){if(!z)return;G=!0}}if(N<0||N>=c.length){e.selection().size&&(d([]),i.onViewTargetChange?.(null));return}let T=c[N];if(O&&e.focusedSectionId()&&!G&&!k(N,sd)){e.focusSeatCamera(T,{seatPx:R2,viewportHeightPx:E()});return}let D=je[Math.round(o.seats.iState[N]??0)]??"available";if(D!=="available"&&D!=="selected"){i.onSeatInspect?.(T,D);return}if(e.selection().has(T)&&e.selection().size===1){d([]),i.onViewTargetChange?.(null),i.onSeatPick?.(T);return}d([T]),p(T),s.seatPicked(T,l.get(T)),i.onSeatPick?.(T)}}}var yi=class{constructor(t,n){this.minX=0;this.minZ=0;this.cell=1;this.cols=1;this.rows=1;this.cellStart=null;this.cellItems=null;this.iPosition=t,this.count=n}ensureGrid(){if(this.cellStart||this.count===0)return;let t=this.iPosition,n=1/0,o=1/0,r=-1/0,i=-1/0;for(let h=0;h<this.count;h++){let d=t[h*3],p=t[h*3+2];d<n&&(n=d),d>r&&(r=d),p<o&&(o=p),p>i&&(i=p)}let a=Math.max(r-n,.001),s=Math.max(i-o,.001);this.cell=Math.max(Math.sqrt(a*s*4/this.count),.25),this.cols=Math.max(1,Math.ceil(a/this.cell)+1),this.rows=Math.max(1,Math.ceil(s/this.cell)+1),this.minX=n,this.minZ=o;let c=this.cols*this.rows,l=new Int32Array(c+1),u=h=>{let d=Math.min(this.cols-1,Math.max(0,Math.floor((t[h*3]-n)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((t[h*3+2]-o)/this.cell)))*this.cols+d};for(let h=0;h<this.count;h++)l[u(h)+1]++;for(let h=0;h<c;h++)l[h+1]+=l[h];let m=new Int32Array(this.count),f=l.slice(0,c);for(let h=0;h<this.count;h++)m[f[u(h)]++]=h;this.cellStart=l,this.cellItems=m}gather(t,n,o,r,i){this.ensureGrid();let a=this.cellStart,s=this.cellItems;if(!a||!s)return 0;let c=r.length,l=o*o,u=Math.floor((t-this.minX)/this.cell),m=Math.floor((n-this.minZ)/this.cell),f=Math.ceil(o/this.cell)+1,h=this.iPosition,d=0;for(let p=0;p<=f&&d<c;p++){let b=m-p,x=m+p,y=u-p,M=u+p;for(let A=b;A<=x&&d<c;A++){if(A<0||A>=this.rows)continue;let w=A===b||A===x;for(let g=y;g<=M&&d<c;g++){if(!w&&g!==y&&g!==M){g=M-1;continue}if(g<0||g>=this.cols)continue;let S=A*this.cols+g;for(let v=a[S],P=a[S+1];v<P&&d<c;v++){let E=s[v],k=h[E*3]-t,L=h[E*3+2]-n,I=i===void 0?0:h[E*3+1]-i;k*k+I*I+L*L<=l&&(r[d++]=E)}}}}return d}};var gi=class{constructor(t){this.ctx=t;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array(pr);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.lastGatherY=1/0;this.nearIndex=new yi(t.model.seats.iPosition,t.model.seats.count)}forceRegather(){this.lastGatherX=1/0}setDetailEnabled(t){let n=this.ctx.gpu();t||(this.detailVisible=!1),this.lastGatherX=1/0,this.lastGatherZ=1/0,!t&&n?.nearSeatCount()&&n.setNearSeats(this.nearBuf,0)}update(t){let{model:n}=this.ctx,o=this.ctx.gpu();if(!o)return;if(!t){o.nearSeatCount()&&o.setNearSeats(this.nearBuf,0);return}let r=this.ctx.orbit().camera.position;if(Math.hypot(r.x-this.lastGatherX,r.y-this.lastGatherY,r.z-this.lastGatherZ)<Wi)return;if(this.lastGatherX=r.x,this.lastGatherY=r.y,this.lastGatherZ=r.z,Math.hypot(r.x-n.bounds.center[0],r.y-n.bounds.center[1],r.z-n.bounds.center[2])-n.bounds.radius>ji){o.nearSeatCount()&&o.setNearSeats(this.nearBuf,0);return}let s=this.nearIndex.gather(r.x,r.z,ji,this.nearBuf,r.y);s===0&&o.nearSeatCount()===0||o.setNearSeats(this.nearBuf,s)}ease(t,n,o){let r=1-Math.exp(-t*9),i=1-Math.exp(-t*20);this.seatDetailMix+=(n-this.seatDetailMix)*(n>this.seatDetailMix?r:i),this.structureDetailMix+=(o-this.structureDetailMix)*(o>this.structureDetailMix?r:i),Math.abs(n-this.seatDetailMix)<.01&&(this.seatDetailMix=n),Math.abs(o-this.structureDetailMix)<.01&&(this.structureDetailMix=o)}};function ld(e){let t=Math.max(5,e.radius),n=e.focalWorld[0]-e.center[0],o=e.focalWorld[2]-e.center[2],r=Math.hypot(n,o);if(r<t*.12)return{center:e.center,radius:t,polarDeg:48};let i=Math.min(r*.25,t*.2);return{center:[e.center[0]+n/r*i,e.center[1],e.center[2]+o/r*i],radius:t+i,polarDeg:50}}var xi=require("ogl");function ud(){let e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round");let n=document.createElementNS(e,"path");return n.setAttribute("d","M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 0 2 2v3M8 21H5a2 2 0 0 0-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3"),t.appendChild(n),t}function md(e){let{container:t,model:n,opts:o,orbit:r,cinematic:i,analytics:a,loop:s,labelOverlay:c,stageAzimuth:l,overviewFraming:u}=e,m=0,f=-1,h=(E,k,L=28)=>{r.camera.position.set(E[0],E[1],E[2]),r.camera.lookAt(new xi.Vec3(k[0],k[1],k[2])),r.camera.fov=L,r.camera.updateProjectionMatrix()},d=document.createElement("button");d.className="sl-3d-overview-control sl-3d-icon-control",d.type="button",d.replaceChildren(ud());let p=o.navLabels?.fitView??"Show whole venue";d.setAttribute("aria-label",p),d.title=p,Object.assign(d.style,{width:"44px",minWidth:"44px",minHeight:"44px",padding:"9px",borderRadius:"999px",background:"rgba(12,18,32,0.72)",color:"#c9d4ea",border:"1px solid rgba(150,165,205,0.35)",backdropFilter:"blur(6px)",font:"600 11px/1 inherit",cursor:"pointer",whiteSpace:"nowrap"});let b=()=>{d.firstElementChild||d.replaceChildren(ud())};b();let x=E=>{f=E;let k=e.gpu();k&&(k.seatProgram.uniforms.uFocusFloor.value=E,k.solidProgram.uniforms.uFocusFloor.value=E,k.chairProgram.uniforms.uFocusFloor.value=E),e.showSectionSeatLabels(null)},y=null,M=!1,A=()=>{if(y=null,M=!1,e.setSeeThrough?.(null),e.isDisposed())return;o.onViewTargetChange?.(null),o.onSectionFocusChange?.(null),e.panorama()&&(e.panorama().dispose(),e.setPanorama(null),a.panoramaClosed()),e.setPanoramaSphereVisible(!1),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),e.restorePanoramaLayer(),d.style.display="",c.setVisible(!0),e.setFrozen(!1);let E=f>=0?n.floors[f]:null;if(e.setNearFieldDetailEnabled(!!E),e.setSeatViewLocked(!1),w(),e.removeArriveChip(),e.setNavigationMode("auto"),E){let k=E.focalWorld[0]-E.center[0],L=E.focalWorld[2]-E.center[2],I=Math.hypot(k,L)>E.radius*.12?Math.atan2(k,L):l,R={center:E.center,radius:E.radius,box:E.box},_={polarDeg:58,margin:1.12};e.reducedMotion()?r.frame(R,!1,I,!1,_):r.frameSoft(R,I,!1,_)}else e.reducedMotion()?r.frame(n.bounds,!1,l,o.portraitOverviewCrop===!0,u):r.frameSoft(n.bounds,l,o.portraitOverviewCrop===!0,u);c.setOverviewDistance(r.targetDistance),e.showSectionSeatLabels(null),s.requestRender()},w=()=>{m++,e.setSeatStepping(!1),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),i.active&&(i.cancel(),r.resumeAfterFlight(n.focalWorld))},g=E=>{if(e.isDisposed()||!e.gpu())return Promise.resolve();let k=n.seats.idToIndex.get(E);if(k===void 0)return Promise.resolve();e.setNearFieldDetailEnabled(!0),o.onViewTargetChange?.(E),e.panorama()&&(e.panorama().dispose(),e.setPanorama(null),e.setPanoramaSphereVisible(!1),d.style.display="",e.restorePanoramaLayer()),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),e.setFrozen(!1);let L=e.inSeatView()&&o.arriveAtSeatEye===!0;e.setSeatStepping(L),e.setSeatViewLocked(!1);let I=++m;L?e.showArriveChip(E,I):e.removeArriveChip();let{eye:R,focal:_}=e.resolvedSeatViewPose(E,k),F=o.arriveAtSeatEye?e.seatViewArrival(E,k):null,N=F&&F.stops.length>1&&F.stops[1].name==="row"?F.stops[1]:null,O=F?F.focal:_,V=[r.camera.position.x,r.camera.position.y,r.camera.position.z],z=gs(V,F?.eye??R,O,n.bounds.center,n.bounds.radius),G=N?N.eye:F?F.eye:o.arriveAtSeatEye?R:z.finalPos,T=F?F.fov:o.arriveAtSeatEye?t.clientWidth/Math.max(1,t.clientHeight)<.7?si:65:28,D=[z.waypoints[0],z.waypoints[1],G];if(c.setVisible(!1),e.reducedMotion())return e.setSeatStepping(!1),h(G,O,T),s.requestRender(),a.cinematicSkipped(),e.isDisposed()||r.syncFromCamera(),e.setSeatViewLocked(o.arriveAtSeatEye===!0),F&&e.enterSeatView(F.stops),e.showArriveChip(E,I),Promise.resolve();let W=new xi.Quat().copy(r.camera.quaternion),H=gh(r.camera,G,O);s.requestRender();let j=L?700:2500;return i.start(D,W,H,j,T).then(()=>{e.isDisposed()||I!==m||(e.setSeatStepping(!1),a.cinematicPlayed(j),r.resumeAfterFlight(O),e.setSeatViewLocked(o.arriveAtSeatEye===!0),F&&e.enterSeatView(F.stops,N?1:0),s.requestRender(),e.showArriveChip(E,I))})},S=(E,k)=>{let L=n.sections.find(I=>I.id===E);if(!L||L.seatCount===0)return!1;if(y=E,M=!1,e.setSeeThrough?.(null),e.setNearFieldDetailEnabled(!0),e.setSeatStepping(!1),e.setSeatViewLocked(!1),i.cancel(),e.removeArriveChip(),n.floors.length>1&&f!==L.floorIndex&&x(L.floorIndex),e.setNavigationMode("auto"),e.panorama()||c.setVisible(!0),e.showSectionSeatLabels(E),!k?.keepCamera){let I=ld(L),R={polarDeg:I.polarDeg,margin:1.12};e.reducedMotion()?r.frame({center:I.center,radius:I.radius},!1,r.currentAzimuth,!1,R):r.glideTo({center:I.center,radius:I.radius},R)}return o.onSectionFocusChange?.(E),s.requestRender(),!0},v=(E,k)=>{if(e.isDisposed()||!e.gpu())return!1;let L=n.seats.idToIndex.get(E);if(L===void 0)return!1;let I=L*3,R=[n.seats.iPosition[I],n.seats.iPosition[I+1]+.55,n.seats.iPosition[I+2]],_=k?I2(k,r.fovY,r.camera.aspect||1):fd;return M=!0,e.setSeeThrough?.(R),e.reducedMotion()?r.frame({center:R,radius:_},!1,void 0,!1,Es):r.frameSoft({center:R,radius:_},void 0,!1,Es),s.requestRender(),!0},P=()=>{if(e.isNarrow?.()&&M&&y&&S(y)){s.requestRender();return}A()};return d.addEventListener("click",P),{overviewChip:d,layoutOverviewChip:b,flightGen:()=>m,focusedFloor:()=>f,applyFloorFocus:x,placeCameraFinal:h,cancelFlight:w,focusOverview:A,flyToSeat:g,focusSectionCamera:S,focusSeatCamera:v}}var fd=4.5;function I2(e,t,n){let o=Math.tan(t*Math.PI/360),r=o*Math.max(.001,n),a=_2*e.viewportHeightPx/(2*Math.max(1,e.seatPx)*o)*Math.min(o,r)/Es.margin;return Math.max(C2,Math.min(fd,a))}var _2=.5,C2=1.5,Es={polarDeg:48,margin:1.25};function Qo(e,t){let{doc:n,report:o}=Jr(e),r=o.confident&&(o.sections.length>0||!!o.looseRowBlocks);if(!r&&!o.roles?.length)return null;if(!r){let c=new Map(o.roles.map(h=>[h.id,h.role])),l=h=>h.map(d=>d.type==="shape"&&c.has(d.id)?{...d,role:c.get(d.id)}:d),u=e.floors?.map(h=>({...h,objects:l(h.objects)})),m=new Float64Array(t.length).fill(Number.NaN),f=new Float64Array(t.length*2).fill(Number.NaN);return t.forEach((h,d)=>{h.eyeHeightM!==void 0&&(m[d]=h.eyeHeightM),h.focalPoint&&(f[d*2]=h.focalPoint.x,f[d*2+1]=h.focalPoint.y)}),{doc:{...e,objects:u?.[0]?.objects??l(e.objects),...u?{floors:u}:{}},report:o,eyeHeightM:m,focal:f}}let i=new Map(Gn(n).map(c=>[c.id,c])),a=new Float64Array(t.length).fill(Number.NaN),s=new Float64Array(t.length*2).fill(Number.NaN);return t.forEach((c,l)=>{let u=i.get(c.id)??c;u.eyeHeightM!==void 0&&(a[l]=u.eyeHeightM),u.focalPoint&&(s[l*2]=u.focalPoint.x,s[l*2+1]=u.focalPoint.y)}),{doc:n,report:o,eyeHeightM:a,focal:s}}function Is(e,t){return e.map((n,o)=>{let r=t.eyeHeightM[o],i=t.focal[o*2],a=t.focal[o*2+1],s={...n};return Number.isNaN(r)?delete s.eyeHeightM:s.eyeHeightM=r,Number.isNaN(i)?delete s.focalPoint:s.focalPoint={x:i,y:a},s})}function hd(e){let t=e.estimate===!1?null:Qo(e.doc,e.seats);return t?{input:{...e,doc:t.doc,seats:Is(e.seats,t)},estimate:t}:{input:e}}function _s(e,t,n,o,r,i,a,s,c=.5){let l=-1,u=s*s,m=1/0;for(let f=0;f<t;f++){let h=f*3,d=Ot(n,[e[h],e[h+1]+c,e[h+2]],o,r);if(!d.visible)continue;let p=d.x-i,b=d.y-a,x=p*p+b*b;(x<u-4||x<u+4&&d.depth<m)&&(l=f,u=Math.min(u,x),m=d.depth)}return l}var L2={};function dd(e){let t=performance.now(),{input:n,estimate:o}=hd(e);return{model:no(n),buildMs:performance.now()-t,source:"main",...o?{estimate:o}:{}}}function T2(e){let t=Gn(e.doc);return{...dd({...e,seats:t}),seats:t}}function pd(e,t,n){let o=i=>({...t(),fallbackReason:i});if(typeof Worker>"u")return Promise.resolve(o("unavailable"));let r;try{r=new Worker(new URL("./scene/scene.worker.js",L2.url),{type:"module"})}catch{return Promise.resolve(o("unavailable"))}return new Promise(i=>{let a=!1,s=u=>{a||(a=!0,clearTimeout(l),r.terminate(),i(u))},c=u=>s(o(u)),l=window.setTimeout(()=>c("timeout"),15e3);r.onerror=()=>c("worker_error"),r.onmessage=u=>{let m=n(u.data);m?s(m):c("bad_response")},r.postMessage(e)})}function bd(e){return pd(e,()=>dd(e),({model:t,buildMs:n,estimate:o})=>({model:t,buildMs:n,source:"worker",...o?{estimate:o}:{}}))}function yd(e){return pd(e,()=>T2(e),({model:t,buildMs:n,seats:o,estimate:r})=>o?{model:t,buildMs:n,seats:o,source:"worker",...r?{estimate:r}:{}}:null)}var k2=40,O2=48,F2=Math.PI/180,D2=6,N2=500,B2=6;function V2(e,t,n={}){let o=performance.now(),r=t.prepared?t.prepared.estimate:t.estimate===!1?null:Qo(t.doc,t.seats);r&&(t={...t,doc:r.doc,seats:Is(t.seats,r)});let i=t.prepared?.model??no(t),a=new bi(n.onAnalytics),s=new Array(i.seats.count);for(let[U,K]of i.seats.idToIndex)s[K]=U;let c=new Map(t.seats.map(U=>[U.id,U])),l=new Map;for(let U of t.seats){if(!U.rowId)continue;let K=l.get(U.rowId);K?K.push(U.id):l.set(U.rowId,[U.id])}let u=new Map,m=[0,0,0,0];function f(){if(b)for(let U of[b.seatProgram,b.solidProgram,b.chairProgram])U.uniforms.uSeeThrough.value=m}t.seats.forEach((U,K)=>{u.set(U.id,i.seatSectionIds?.[K]??U.sectionId)});let h=new Map;for(let[U,K]of i.seats.idToIndex){let Q=u.get(U);if(!Q)continue;let le=h.get(Q);le?le.push(K):h.set(Q,[K])}let d=()=>{if(!b||!i.sectionSolidRanges.length)return;let{lit:U,anyUnlit:K}=oh(i.sectionSolidRanges,h,i.seats.iState);b.setSectionShellLit(K?U:null)},p=t.doc.floors?.some(K=>(K.baseHeightM??0)>0)?!0:(t.doc.floors?.flatMap(K=>K.objects)??t.doc.objects).some(K=>K.type==="section"&&((K.height??0)>0||(K.rake??0)>0)),b=null,x=null,y=null,M=!1,A=!1,w=!1,g=new Map,S=null,v=null,P=null,E=new Map,k=null,L=()=>{P===null&&(P=e.style.zIndex,e.style.zIndex="20")},I=()=>{P!==null&&(e.style.zIndex==="20"&&(e.style.zIndex=P),P=null)},R=!1,_=()=>R?tt.focusedFloor():-1,F=()=>{b=sh(D.gl,i),x?.dispose(),x=kf(D.gl,[1,1,1],i.theme.seatStates.selected),Ls(!1),d(),te(),y=new ii(D.renderer,b.seatGeometry,b.chairGeometry,b.solidGeometry,i.seats.count),D.setClearColor(i.theme.background.top),y.setRestoreClear(i.theme.background.top),y.setRoomCentre(i.room?.centre),b.seatProgram.uniforms.uSeatRadius.value=Gt*i.theme.seatScale,b.seatProgram.uniforms.uFocusFloor.value=_(),b.solidProgram.uniforms.uFocusFloor.value=_(),b.chairProgram.uniforms.uFocusFloor.value=_(),b.screenProgram&&(b.screenProgram.uniforms.uFocusFloor.value=_()),f(),O.forceRegather()},N=!1,O=new gi({model:i,orbit:()=>X,gpu:()=>b}),V=!1,z=new Map,G=24,T=U=>O.setDetailEnabled(U),D=new ur(e,{onContextLost:()=>{w||a.contextLost(),M=!0,Ee.stop(),b=null,y=null,W.reset()},onContextRestored:()=>{F(),M=!1,w||a.contextRestored(),Ee.requestRender()}}),W=new mr(D.gl,D.renderer,D.smoothingSamples),H=new fr,j=!1,Z=(U,K)=>{if(!b)return{smooth:!1,onBudget:!1};if(i.seatCount<=gc||b.nearSeatCount()>0||!U)return{smooth:!0,onBudget:!1};let Q=H.allows(K);return{smooth:Q,onBudget:Q}},X=new hr(D.gl,D.canvas,()=>Ee.requestRender(),()=>a.orbitEngaged());X.setAspect(D.aspect);let ee=(t.doc.floors?.flatMap(U=>U.objects)??t.doc.objects).some(U=>U.type==="section"&&U.physical3dProvenance?.surfaceKind?.status==="inferred"),ne=(()=>{if(Number.isFinite(n.overviewAzimuthDeg))return n.overviewAzimuthDeg*Math.PI/180;if(!(ee&&i.stages.length===0))return Ks(i.focalWorld,i.seats.iPosition,i.bounds)})(),ue=(t.doc.floors?.flatMap(U=>U.objects)??t.doc.objects).some(U=>U.type==="shape"&&U.stageKind?.startsWith("pitch-")),de=i.floors.length>1?{polarDeg:48,margin:1.1}:{polarDeg:ue?36:48,margin:1.05},me=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;X.frame(i.bounds,!me&&n.skipInitialOverviewAnimation!==!0,ne,n.portraitOverviewCrop===!0,de);let pe=new ai(X.camera),Pe=od(e),_e=Ys(e,i),xe=new ni(e,{fontFamily:t.doc.theme?.fontFamily,ink:t.doc.theme?.textColor,backgroundRgb:i.theme.background.top}),Ce=i.labels,$=()=>Jm(Ce,i.floors.length,_());xe.setLabels($()),xe.setOverviewDistance(X.targetDistance);let B=()=>{let U=new Map,K=je.indexOf("available");for(let Q of Ce){if(!Q.wheelchairSeats)continue;let le=0;for(let be of Q.wheelchairSeats)i.seats.iState[be]===K&&le++;le>0&&U.set(Q.id,le)}return xe.setWheelchairFree(U)};B();let Y=null,q=()=>[...g.keys()].flatMap(U=>{let K=i.seats.idToIndex.get(U),Q=K===void 0?void 0:t.seats[K];if(K===void 0||Q?.id!==U)return[];let le=K*3;return[{id:`seat:${U}`,kind:"seat",seatWidthM:i.seats.iChairWidth[K]*2,text:Q.displayLabel||Q.label,anchor:[i.seats.iPosition[le],i.seats.iPosition[le+1]+1.05,i.seats.iPosition[le+2]],pinBase:cn(le)}]}),J=-1,te=()=>{b&&(J=Y?i.sections.findIndex(U=>U.id===Y):-1,b.seatProgram.uniforms.uFocusSection.value=J,b.chairProgram.uniforms.uFocusSection.value=J)},ae=U=>{if(Y=U,te(),xe.setForcedDense(!!U),!U){let ce=q(),He=new Set(ce.map(Be=>Be.id));xe.setLabels([...$().filter(Be=>!He.has(Be.id)),...ce]);return}let K=t.seats.filter(ce=>u.get(ce.id)===U),Q=new Set(K.map(ce=>ce.id)),le=new Set(K.map(ce=>ce.rowId)),be=new Set(g.keys()),Ae=new Set(K.filter(ce=>be.has(ce.id)).map(ce=>ce.id)),Re=$().filter(ce=>ce.kind!=="row"&&ce.kind!=="seat"&&ce.kind!=="access"||ce.kind==="access"&&Q.has(ce.id.slice(7))||(ce.kind==="row"?le.has(ce.id.slice(4)):Q.has(ce.id.slice(5))));if(i.seatCount<=6e3&&Ae.size===0){xe.setLabels(Re);return}let ke=K,$e=new Set(ke.map(ce=>`seat:${ce.id}`)),ut=ke.flatMap(ce=>{let He=i.seats.idToIndex.get(ce.id);if(He===void 0)return[];let Be=He*3;return[{id:`seat:${ce.id}`,kind:"seat",seatWidthM:i.seats.iChairWidth[He]*2,rowId:ce.rowId,text:be.has(ce.id)?ce.displayLabel||ce.label:rs(ce.displayLabel||ce.label),anchor:[i.seats.iPosition[Be],i.seats.iPosition[Be+1]+(be.has(ce.id)?1.05:.55),i.seats.iPosition[Be+2]],...be.has(ce.id)?{pinBase:cn(Be)}:{}}]});xe.setLabels([...Re.filter(ce=>!$e.has(ce.id)),...ut])};F();let fe=null,Ue=null,se=new gd.Mat4,Te=U=>{if(M||!b||A)return!1;let K=Hh({flying:pe.active,panoramaMounted:S!==null,seatViewActive:fe?.active===!0}),Q=zh(fe?.active===!0,_());b.seatProgram.uniforms.uFocusFloor.value=Q,b.solidProgram.uniforms.uFocusFloor.value=Q,b.chairProgram.uniforms.uFocusFloor.value=Q,b.screenProgram&&(b.screenProgram.uniforms.uFocusFloor.value=Q);let le=K==="orbit"?J:-1;b.seatProgram.uniforms.uFocusSection.value=le,b.chairProgram.uniforms.uFocusSection.value=le;let be=V?!1:K==="cinematic"?pe.update(performance.now()):K==="seatView"?fe.update(performance.now()):K==="orbit"?X.update():!1;Ue?.syncZoomLimits(),Ue?.syncNavigationMode();let Ae=_()>=0?i.floors[_()]:null,Re=Ae?.radius??i.bounds.radius,ke=Ec(X.currentDistance,Re),$e=N?{center:[X.camera.position.x,X.camera.position.y,X.camera.position.z],radius:520}:i.clipBounds??i.renderBounds;X.updateClipping($e);let ut=Ae?.center??i.renderBounds.center,ce=Ae?.radius??i.renderBounds.radius,He=(Mt,Ci)=>Math.hypot(X.camera.position.x-Mt[0],X.camera.position.y-Mt[1],X.camera.position.z-Mt[2])<=Ci*(O.detailVisible?1.8:1.55),Be=He(ut,ce);if(!Be&&Y){let Mt=i.sections.find(Ci=>Ci.id===Y);Mt&&(Be=He(Mt.center,Math.max(12,Mt.radius*2)))}O.detailVisible=Be;let Qe=b.seatProgram.uniforms;Qe.uSeatScale.value=ke.scale,Qe.uSeatFade.value=ke.fade;let un=!!Ae&&Ic(Ae.seatCount,D.canvas.clientWidth||1,D.canvas.clientHeight||1),Ii=_c(i.seats.count,Re,X.currentDistance,X.camera.fov,D.canvas.clientHeight||1),En=O.detailVisible||un||Ii?1:0,tr=O.detailVisible||_()>=0||i.floors.length>1?1:0;O.ease(U,En,tr),Qe.uSeatDetail.value=O.seatDetailMix;let In=En===0&&O.seatDetailMix<.01;b.seatGeometry.setDrawRange(In?Oi:0,In?cc:Oi),b.solidProgram.uniforms.uStructureDetail.value=O.structureDetailMix,b.solidProgram.uniforms.uViewport.value.set([D.gl.drawingBufferWidth,D.gl.drawingBufferHeight]),Qe.uMinPixels.value=ke.minPixels,Qe.uPixelToWorld.value=2*Math.tan(X.camera.fov*F2/2)/Math.max(1,D.pixelHeight),O.update(O.detailVisible),(i.outdoor||i.house)&&(se.copy(X.camera.projectionViewMatrix).inverse(),b.backgroundProgram.uniforms.uInvViewProj.value.set(se),b.backgroundProgram.uniforms.uEye.value.set([X.camera.position.x,X.camera.position.y,X.camera.position.z]));let _n=Z(be,X.currentDistance),dt=W.begin(_n.smooth);j=dt!==null,H.frame(_n.onBudget&&dt!==null,X.currentDistance,performance.now());let _i=dt?{target:dt}:{};D.renderer.render({scene:b.background,clear:!0,..._i}),D.renderer.render({scene:b.main,camera:X.camera,clear:!1,..._i});let Id=x?x.update(performance.now(),[X.camera.position.x,X.camera.position.y,X.camera.position.z],S!==null,K==="seatView"):!1;if(x&&D.renderer.render({scene:x.root,camera:X.camera,clear:!1,..._i}),W.end(),_e){let Mt=X.camera.worldMatrix;_e.update(K==="seatView"?[X.camera.position.x,X.camera.position.y,X.camera.position.z]:null,[-Mt[8],-Mt[9],-Mt[10]])}xe.update(X.camera.projectionViewMatrix,D.canvas.clientWidth||1,D.canvas.clientHeight||1,X.currentDistance,Re,[X.camera.position.x,X.camera.position.y,X.camera.position.z]);let js=be||Id||O.seatDetailMix!==En||O.structureDetailMix!==tr;return ht(!js),js},ht=Ac(e),Ee=new dr(Te),qe=typeof ResizeObserver<"u"?new ResizeObserver(()=>Ei.resize()):null;qe?.observe(e),X.setZoomPointResolver((U,K)=>{let Q=D.canvas.getBoundingClientRect(),le=D.canvas.clientWidth||Q.width,be=D.canvas.clientHeight||Q.height;if(!(le>0)||!(be>0))return null;X.camera.updateMatrixWorld();let Ae=_s(i.seats.iPosition,i.seats.count,X.camera.projectionViewMatrix,le,be,U-Q.left,K-Q.top,k2);if(Ae<0)return null;let Re=Ae*3;return[i.seats.iPosition[Re],i.seats.iPosition[Re+1]+.5,i.seats.iPosition[Re+2]]});function cn(U){return[i.seats.iPosition[U],i.seats.iPosition[U+1]+.5,i.seats.iPosition[U+2]]}xe.setSeatNumberRow(null);let lt=null,xt=0,Wt=null,Rt=()=>{xt=0;let U=null,K=null;if(lt&&!fe?.active&&!pe.active){let be=D.canvas.getBoundingClientRect(),Ae=D.canvas.clientWidth||be.width,Re=D.canvas.clientHeight||be.height;if(Ae>0&&Re>0){let ke=_s(i.seats.iPosition,i.seats.count,X.camera.projectionViewMatrix,Ae,Re,lt.x-be.left,lt.y-be.top,O2);U=ke>=0?t.seats[ke]?.rowId??null:null;let $e=ke>=0?t.seats[ke]?.id??null:null;if(K=$e,lt.mouse&&!lt.pressing&&!!Y&&!!$e&&u.get($e)===Y){let ce=e.getBoundingClientRect();Wt=$e,n.onSeatHover?.($e,{x:lt.x-ce.left,y:lt.y-ce.top})}else Cs()}}else Cs();let Q=lt?.mouse?K:null,le=xe.setSeatNumberSeat(Q);(xe.setSeatNumberRow(U)||le)&&Ee.requestRender()};function Cs(){Wt!==null&&(Wt=null,n.onSeatHover?.(null,null))}let Jo=U=>{lt={x:U.clientX,y:U.clientY,mouse:U.pointerType==="mouse",pressing:U.type==="pointerdown"},xt||(xt=requestAnimationFrame(Rt))},Ts=U=>{U.pointerType==="mouse"&&(lt=null,xt||(xt=requestAnimationFrame(Rt)))};D.canvas.addEventListener("pointermove",Jo),D.canvas.addEventListener("pointerdown",Jo),D.canvas.addEventListener("pointerleave",Ts);function Ls(U){if(!x)return;let K=[];for(let Q of g.keys()){let le=i.seats.idToIndex.get(Q);if(le===void 0)continue;let be=le*3;K.push({id:Q,position:cn(be)})}x.setSeats(K,performance.now(),U)}let ks=U=>{let K=be=>{let Ae=i.seats.idToIndex.get(be);return Ae===void 0?void 0:i.seats.iState[Ae]},{updates:Q,next:le}=mh(g,U,K);if(g=le,xe.setSelectedSeatIds(g.keys()),Ls(!so()),Ee.requestRender(),ae(Y),Q.length){let be=Qi(i.seats,Q);b&&b.uploadSeatStateRuns(be),d(),Ee.requestRender()}},so=()=>k!==null?k:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,xd=8,Os=U=>{if(!n.getSeatView)return null;let K=E.get(U);if(!K)for(K=Promise.resolve(n.getSeatView(U)),E.set(U,K),K.catch(()=>{E.get(U)===K&&E.delete(U)});E.size>xd;){let Q=E.keys().next().value;if(Q===void 0)break;E.delete(Q)}return K},Fs=Lh(i.stages,i.focalWorld,i.bounds.groundY??0),Ds=vs(Fs),Mi=(U,K)=>{let Q=c.get(U),le=Math.max(0,Math.round(i.seats.iFloor[K]??0)),be=t.doc.floors?.[le],Ae=i.floors[le],Re=be?.focalPoint??t.doc.focalPoint,ke=Ae?{x:Ae.focalWorld[0]/C,y:Ae.focalWorld[2]/C}:Re,$e=Q?.focalPoint?{x:Q.focalPoint.x+ke.x-Re.x,y:Q.focalPoint.y+ke.y-Re.y}:ke,ut=[i.seats.iPosition[K*3],i.seats.iPosition[K*3+1],i.seats.iPosition[K*3+2]],ce=vh(i.seats.iPosition,K,Ds),He=ce!==null&&Math.abs(ce)<Mh;return Sh(ut,$e,be?.baseHeightM??0,Q?.eyeHeightM,Ds,He)},vi=()=>(e.clientWidth||D.canvas.clientWidth)<=520,Si=null,Ns=null,Md=async(U,K,Q)=>{if(!n.getSeatView||w||Q!==tt.flightGen())return;let le;try{le=await td()}catch{if(a.panoramaFailed(U,"mount"),!w&&Q===tt.flightGen()){let be=Pi(U,Q,!0);requestAnimationFrame(()=>be?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(w||Q!==tt.flightGen()||!Si))return Ns??=le.createOpenPanorama(Si),Ns(U,K,Q)},wi=rd({container:e,model:i,opts:n,expandedSeatById:c,seatIdsByRow:l,isNarrow:vi,isDisposed:()=>w,flightGen:()=>tt.flightGen(),flyToSeat:U=>zs(U),openPanorama:(U,K,Q)=>Md(U,K,Q)}),Pi=wi.show,Ai=wi.remove,vd=wi.layout,ln=id({container:e,orbit:X,isNarrow:vi,enabled:n.chrome?.controlDock!==!1,...n.navLabels?{labels:n.navLabels}:{}});Ue=ln;let Sd=ln.element,co=ln.setNavigationMode,wd=ln.layout,Pd=ln.utilityControls,lo=null,Bs=!1,er=U=>{ln.setSeatViewLocked(U),U||fe?.exit()};fe=Gh({canvas:D.canvas,camera:X.camera,requestRender:()=>Ee.requestRender(),reducedMotion:so,onStopChange:U=>{let K=U??(Bs?"seat":null);lo=K;try{n.onSeatViewStopChange?.(K)}catch{}},onApplied:()=>{w||X.syncFromCamera()}});let Vs=i.sections.reduce((U,K)=>K.seatCount>0&&K.box?Math.max(U,K.box.max[1]):U,-1/0),Gs=(U,K)=>{let{eye:Q}=Mi(U,K),le=(e.clientWidth||D.canvas.clientWidth||1)/Math.max(1,e.clientHeight||D.canvas.clientHeight||1),be=Oh(Q,Fs,le,{preserveEye:!0});if(n.seatViewStops===!1)return{...be,stops:[]};let Ae=u.get(U),Re=Ae?i.sections.find(ke=>ke.id===Ae):void 0;return{...be,stops:Fh(be,{aspect:le,seatingTopY:Number.isFinite(Vs)?Vs:i.bounds.box.max[1],section:Re&&Re.seatCount>0?{center:Re.center,radius:Re.radius}:null,venue:{center:i.bounds.center,radius:i.bounds.radius}})}},tt=md({isNarrow:vi,setSeeThrough:U=>{m=U?[U[0],U[1],U[2],B2]:[0,0,0,0],f(),Ee.requestRender()},container:e,model:i,opts:n,orbit:X,cinematic:pe,analytics:a,loop:Ee,labelOverlay:xe,stageAzimuth:ne,overviewFraming:de,gpu:()=>b,isDisposed:()=>w,panorama:()=>S,setPanorama:U=>{S=U},setPanoramaSphereVisible:U=>{N=U},panoramaLoadAbort:()=>v,setPanoramaLoadAbort:U=>{v=U},setFrozen:U=>{A=U},restorePanoramaLayer:I,reducedMotion:so,resolvedSeatViewPose:Mi,showSectionSeatLabels:ae,setNearFieldDetailEnabled:T,setSeatViewLocked:er,setNavigationMode:co,showArriveChip:Pi,removeArriveChip:Ai,inSeatView:()=>lo!==null,setSeatStepping:U=>{Bs=U},seatViewArrival:(U,K)=>n.arriveAtSeatEye?Gs(U,K):null,enterSeatView:(U,K)=>fe?.enter(U,K)});R=!0;let Ri=tt.overviewChip,Ad=tt.layoutOverviewChip,Rd=tt.applyFloorFocus,Ed=tt.focusOverview,Hs=tt.cancelFlight,zs=tt.flyToSeat,Us=tt.focusSectionCamera;Pd.appendChild(Ri),Si={container:e,model:i,opts:n,analytics:a,orbit:X,loop:Ee,seatsById:c,ensureSeatView:Os,resolvedSeatViewPose:Mi,gpu:()=>b,gl:D.gl,isContextLost:()=>M,isDisposed:()=>w,flightGen:()=>tt.flightGen(),setPanorama:U=>{S=U},getLoadAbort:()=>v,setLoadAbort:U=>{v=U},setPanoramaSphereVisible:U=>{N=U,U&&fe?.exit()},setFrozen:U=>{A=U},raisePanoramaLayer:L,restorePanoramaLayer:I,getOverviewChip:()=>Ri,labelOverlay:xe,reducedMotion:so,removeArriveChip:Ai,showArriveChip:Pi};let Xt=cd({glctx:D,orbit:X,model:i,seats:t.seats,opts:n,cinematic:pe,analytics:a,seatIdByIndex:s,sectionIdBySeatId:u,tapSlop:D2,tapMs:N2,gpu:()=>b,pick:()=>y,seatViewLocked:()=>ln.seatViewLocked(),focusedSectionId:()=>Y,selection:()=>g,cancelFlight:Hs,focusSectionCamera:Us,focusSeatCamera:tt.focusSeatCamera,setSelection:ks,ensureSeatView:Os});D.canvas.addEventListener("pointerdown",Xt.onDown),D.canvas.addEventListener("pointermove",Xt.onMove),D.canvas.addEventListener("pointerup",Xt.onUp),D.canvas.addEventListener("pointercancel",Xt.onUp),Ee.requestRender();let Ei={setAvailability(U){let K=uh(g,U),Q=Qi(i.seats,K);Q.length&&b&&b.uploadSeatStateRuns(Q),d(),Q.length&&B(),Ee.requestRender()},setSelection:ks,setNavigationMode:co,zoomIn(){X.zoomBy(Ln),Ee.requestRender()},zoomOut(){X.zoomBy(po),Ee.requestRender()},flyToSeat:zs,focusOverview:Ed,seatViewStop:()=>lo,recentreSeatView:()=>fe?.recentre()??!1,resize(){let{width:U,height:K}=D.resize();X.setAspect(U/Math.max(1,K)),vd(),wd(),Ad(),Ee.requestRender()},stats(){return{...Ee.stats(),drawCalls:b?b.drawCalls:0,fallbackTriangles:b?b.seatGeometry.drawRange.count/3*i.seats.count:0,seatCount:i.seatCount}},captureImage(U=1280){if(M||!b||typeof document>"u")return null;Te(0);let K=D.canvas,Q=Math.min(1,U/Math.max(K.width,K.height,1)),le=document.createElement("canvas");le.width=Math.max(1,Math.round(K.width*Q)),le.height=Math.max(1,Math.round(K.height*Q));let be=le.getContext("2d");return be?(be.drawImage(K,0,0,le.width,le.height),le.toDataURL("image/jpeg",.82)):null},captureSeatView(U,K=480){if(M||!b||A||typeof document>"u"||pe.active||S!==null||fe?.active)return null;let Q=z.get(U);if(Q)return Q;let le=i.seats.idToIndex.get(U);if(le===void 0)return null;let{eye:be,focal:Ae,fov:Re}=Gs(U,le),ke=X.snapshot(),$e=[O.seatDetailMix,O.structureDetailMix],ut=null;try{V=!0,X.camera.position.set(be[0],be[1],be[2]),X.camera.perspective({fov:Re,aspect:X.camera.aspect}),X.camera.lookAt(Ae),X.camera.updateMatrixWorld(),X.syncFromCamera(),O.seatDetailMix=1,O.structureDetailMix=1,O.forceRegather(),Te(0);let ce=D.canvas,He=Math.min(ce.width,Math.round(ce.height*16/9)),Be=Math.round(He*9/16),Qe=document.createElement("canvas");Qe.width=Math.max(1,Math.round(K)),Qe.height=Math.max(1,Math.round(K*9/16));let un=Qe.getContext("2d");un&&(un.drawImage(ce,(ce.width-He)/2,(ce.height-Be)/2,He,Be,0,0,Qe.width,Qe.height),ut=Qe.toDataURL("image/jpeg",.8))}finally{V=!1,ke(),O.seatDetailMix=$e[0],O.structureDetailMix=$e[1],O.forceRegather(),Te(0)}if(ut)for(z.set(U,ut);z.size>G;)z.delete(z.keys().next().value);return ut},getQualityEvidence(){let U=Ee.stats(),K=D.canvas.clientWidth||1,Q=D.canvas.clientHeight||1,le=i.bounds.center,be=Ot(X.camera.projectionViewMatrix,[le[0],i.bounds.box.min[1],le[2]],K,Q),Ae=Ot(X.camera.projectionViewMatrix,[le[0],i.bounds.box.max[1],le[2]],K,Q),Re=i.bounds.box,ke=[Re.min[0],Re.max[0]].flatMap(ce=>[Re.min[1],Re.max[1]].flatMap(He=>[Re.min[2],Re.max[2]].map(Be=>Ot(X.camera.projectionViewMatrix,[ce,He,Be],K,Q)))).filter(ce=>Number.isFinite(ce.x)&&Number.isFinite(ce.y)&&Number.isFinite(ce.depth)),$e=ke.length?(()=>{let ce=Math.min(...ke.map(dt=>dt.x)),He=Math.max(...ke.map(dt=>dt.x)),Be=Math.min(...ke.map(dt=>dt.y)),Qe=Math.max(...ke.map(dt=>dt.y)),un=Math.max(0,ce),Ii=Math.min(K,He),En=Math.max(0,Be),tr=Math.min(Q,Qe),In=Math.max(0,Ii-un),_n=Math.max(0,tr-En);return{box:{x:un,y:En,width:In,height:_n},horizontalFillRatio:In/K,verticalFillRatio:_n/Q,visibleAreaRatio:In*_n/(K*Q),clippedEdges:[...Be<0?["top"]:[],...He>K?["right"]:[],...Qe>Q?["bottom"]:[],...ce<0?["left"]:[]]}})():void 0,ut=String(D.gl.getParameter(D.gl.VERSION)??"");return{viewport:{width:K,height:Q},context:{webgl2:/webgl\s*2/i.test(ut),lost:M},frame:{rendered:U.rendered,idle:U.idle,smoothed:j},camera:{position:[X.camera.position.x,X.camera.position.y,X.camera.position.z],distance:X.currentDistance,verticalFovDeg:X.fovY},scene:{seatCount:i.seatCount,floorCount:i.floors.length,zoneCount:i.zones.length,sectionCount:i.sections.length,authoredRelief:p,renderedVerticalSpanM:Math.max(0,i.bounds.box.max[1]-i.bounds.box.min[1]),projectedReliefPx:be.visible&&Ae.visible?Math.abs(be.y-Ae.y):0},labels:xe.qualityEvidence(),framing:$e,...lo?{seatView:{fovDeg:X.camera.fov,stop:lo}}:{}}},getQualityReport(){return oi(Ei.getQualityEvidence())},loseContextForTest(){D.simulateContextLossCycle()},floors(){return i.floors},focusFloor(U){if(U!==null&&!i.floors.some(Q=>Q.index===U))return!1;let K=U??-1;if(T(U!==null),er(!1),Rd(K),co("orbit"),U===null)pe.cancel(),so()?X.frame(i.bounds,!1,ne,n.portraitOverviewCrop===!0,de):X.frameSoft(i.bounds,ne,n.portraitOverviewCrop===!0,de),xe.setOverviewDistance(X.targetDistance);else{let Q=i.floors[U];if(Q.seatCount>0){pe.cancel();let le=Q.focalWorld[0]-Q.center[0],be=Q.focalWorld[2]-Q.center[2],Ae=Math.hypot(le,be)>Q.radius*.12?Math.atan2(le,be):ne;X.frame({center:Q.center,radius:Q.radius,box:Q.box},!1,Ae,!1,{polarDeg:58,margin:1.12}),xe.setOverviewDistance(X.targetDistance)}}return Ee.requestRender(),!0},zones(){return i.zones},focusZone(U){let K=i.zones.find(Ae=>Ae.id===U);if(!K||K.seatCount===0)return!1;T(!1),er(!1),pe.cancel(),co("orbit"),ae(null),n.onSectionFocusChange?.(null);let Q=K.focalWorld[0]-K.center[0],le=K.focalWorld[2]-K.center[2],be=Math.hypot(Q,le)>K.radius*.12?Math.atan2(Q,le):void 0;return X.frame({center:K.center,radius:K.radius*1.25},!1,be),Ee.requestRender(),!0},sections(){return i.sections},focusSection(U){return Us(U)},rows(U){return U?i.rows.filter(K=>K.sectionId===U):i.rows},seatsInRow(U){return t.seats.filter(K=>K.rowId===U).map(K=>({id:K.id,label:K.displayLabel||K.label}))},focusRow(U){let K=i.rows.find(Q=>Q.id===U);return!K||K.seatCount===0?!1:(T(!0),er(!1),pe.cancel(),co("pan"),K.sectionId&&(ae(K.sectionId),n.onSectionFocusChange?.(K.sectionId)),X.frame({center:K.center,radius:Math.max(2.5,K.radius*.65)}),Ee.requestRender(),!0)},setReducedMotionForTest(U){k=U},dispose(){w=!0,_e?.dispose(),ht(!1),Ai(),Ri.remove(),Sd.remove(),Hs(),fe?.dispose(),Ee.stop(),xe.dispose(),qe?.disconnect(),S&&(S.dispose(),S=null),I(),Pe(),D.canvas.removeEventListener("pointerdown",Xt.onDown),D.canvas.removeEventListener("pointermove",Xt.onMove),D.canvas.removeEventListener("pointerup",Xt.onUp),D.canvas.removeEventListener("pointercancel",Xt.onUp),D.canvas.removeEventListener("pointermove",Jo),D.canvas.removeEventListener("pointerdown",Jo),D.canvas.removeEventListener("pointerleave",Ts),xt&&cancelAnimationFrame(xt),X.dispose(),y&&y.dispose(),b&&b.dispose(),b=null,x?.dispose(),x=null,y=null,W.dispose(),D.dispose()}};return a.opened(i.seatCount,p,t.prepared?.buildMs??performance.now()-o,t.prepared?.source??"inline"),Ei}0&&(module.exports={VENUE3D_QUALITY_REPORT_VERSION,autoVenue3d,buildSceneModel,estimateVenue3D,inspectVenue3DQualityEvidence,mountVenue3D,prepareVenue3D,prepareVenue3DFromChart});