@seatlayer/core 0.110.0 → 0.111.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ar-IOQUWTKM.js +1 -0
- package/dist/be-XLR5WTXS.js +1 -0
- package/dist/bg-AVCWLASZ.js +1 -0
- package/dist/ca-TKG35ICB.js +1 -0
- package/dist/{categoryInventory-BfvwE3nC.d.cts → categoryInventory-BE1AThTx.d.cts} +1 -1
- package/dist/{categoryInventory-ClZ-68jI.d.ts → categoryInventory-DxciZQK_.d.ts} +1 -1
- package/dist/{chunk-ZYQXT5JP.js → chunk-5FIX35HN.js} +1 -1
- package/dist/{chunk-2JFCDE27.js → chunk-5GHPGPWE.js} +1 -1
- package/dist/{chunk-MRLWH6RC.js → chunk-AZWAP4OE.js} +1 -1
- package/dist/chunk-BXQQKDIX.js +1 -0
- package/dist/{chunk-OJSGMXJS.js → chunk-FZ74MVKY.js} +1 -1
- package/dist/chunk-JQBJZMLG.js +1 -0
- package/dist/{chunk-UUIZHJYL.js → chunk-MN4M5QZ4.js} +1 -1
- package/dist/chunk-N6K5NQYG.js +1 -0
- package/dist/{chunk-6VOUTNRV.js → chunk-NQLQNJV2.js} +1 -1
- package/dist/{chunk-BNLANXXZ.js → chunk-NXS6JFBI.js} +1 -1
- package/dist/{chunk-WUNZCUE6.js → chunk-XWTAFHYQ.js} +1 -1
- package/dist/{chunk-FBXZWNND.js → chunk-Z6YGWTT3.js} +1 -1
- package/dist/core/chart-ops/index.cjs +1 -1
- package/dist/core/chart-ops/index.d.cts +7 -5
- package/dist/core/chart-ops/index.d.ts +7 -5
- package/dist/core/chart-ops/index.js +1 -1
- package/dist/core/inventory/index.cjs +1 -1
- package/dist/core/inventory/index.d.cts +4 -4
- package/dist/core/inventory/index.d.ts +4 -4
- package/dist/core/inventory/index.js +1 -1
- package/dist/core/layout/index.cjs +1 -1
- package/dist/core/layout/index.d.cts +5 -5
- package/dist/core/layout/index.d.ts +5 -5
- package/dist/core/layout/index.js +1 -1
- package/dist/core/quality/index.cjs +1 -1
- package/dist/core/quality/index.d.cts +3 -3
- package/dist/core/quality/index.d.ts +3 -3
- package/dist/core/render-assets/index.cjs +1 -1
- package/dist/core/render-assets/index.d.cts +2 -2
- package/dist/core/render-assets/index.d.ts +2 -2
- package/dist/core/render-assets/index.js +1 -1
- package/dist/core/seatConfidence.d.cts +1 -1
- package/dist/core/seatConfidence.d.ts +1 -1
- package/dist/core/sections/index.d.cts +5 -5
- package/dist/core/sections/index.d.ts +5 -5
- package/dist/core/sections/index.js +1 -1
- package/dist/cs-JRLKXXM5.js +1 -0
- package/dist/cy-W3CYXTOV.js +1 -0
- package/dist/da-HG4PFYWH.js +1 -0
- package/dist/de-KOM2AXXJ.js +1 -0
- package/dist/el-NBRQ66EQ.js +1 -0
- package/dist/es-AVEG4ZNM.js +1 -0
- package/dist/et-33PIOTI4.js +1 -0
- package/dist/{eventConfigurations-DsW5Mj2e.d.ts → eventConfigurations-Cdt-e0uD.d.ts} +1 -1
- package/dist/{eventConfigurations-dmn9FClw.d.cts → eventConfigurations-D0us5j0K.d.cts} +1 -1
- package/dist/fa-CDV2VTXV.js +1 -0
- package/dist/fi-TKATIOE6.js +1 -0
- package/dist/fr-TMDNSR5N.js +1 -0
- package/dist/he-4G7OVLJX.js +1 -0
- package/dist/hi-XKXNYPYF.js +1 -0
- package/dist/hr-BX444QNM.js +1 -0
- package/dist/hu-FM46JMDP.js +1 -0
- package/dist/id-CBVTYGFP.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +46 -38
- package/dist/index.d.ts +46 -38
- package/dist/index.js +1 -1
- package/dist/it-ZOFOAG6E.js +1 -0
- package/dist/ja-NKEBMXTO.js +1 -0
- package/dist/ko-RUCELYV7.js +1 -0
- package/dist/ku-KKYBDVSA.js +1 -0
- package/dist/{labeling-Bn41ByDd.d.ts → labeling-DXgkxMoi.d.ts} +1 -1
- package/dist/{labeling-BmEjVxFt.d.cts → labeling-eYKVPLMb.d.cts} +1 -1
- package/dist/localeLoaders-YQXZZVNH.js +1 -0
- package/dist/lt-3CJ37W7A.js +1 -0
- package/dist/lv-H37RDMRX.js +1 -0
- package/dist/ms-E5RVBRE6.js +1 -0
- package/dist/nl-QHEOTQ7U.js +1 -0
- package/dist/no-43HJQ5MK.js +1 -0
- package/dist/pl-4LKJHMFJ.js +1 -0
- package/dist/pt-LSSE5QHE.js +1 -0
- package/dist/{renderedQuality-MDkNe8GA.d.ts → renderedQuality-Dzo2_8f4.d.ts} +1 -1
- package/dist/{renderedQuality-Bt2d0uq1.d.cts → renderedQuality-Frgw6jdx.d.cts} +1 -1
- package/dist/{renderer-DH0yI32q.d.cts → renderer-DM2sv1un.d.cts} +1 -1
- package/dist/{renderer-BJrpMV6U.d.ts → renderer-DuieD7jP.d.ts} +1 -1
- package/dist/ro-U2QASPIY.js +1 -0
- package/dist/ru-PTMWREXY.js +1 -0
- package/dist/{seatTypeIcons-CG_Uzpaw.d.ts → seatTypeIcons-Bz0OJtEi.d.ts} +1 -1
- package/dist/{seatTypeIcons-Ck7oEFei.d.cts → seatTypeIcons-Cm8tjLYl.d.cts} +1 -1
- package/dist/{sections-C-UAqr1x.d.ts → sections-Bf_DV0oG.d.ts} +1 -1
- package/dist/{sections-C8HApYxd.d.cts → sections-PbQiqN0i.d.cts} +1 -1
- package/dist/{segmentedRowModel-DR1w9M13.d.ts → segmentedRowModel-CO7DD803.d.ts} +1 -1
- package/dist/{segmentedRowModel-CeoMsBnt.d.cts → segmentedRowModel-Co9LqS4i.d.cts} +1 -1
- package/dist/sk-AY2N2ORA.js +1 -0
- package/dist/sl-5MQJVNB7.js +1 -0
- package/dist/sr-25FTJPUA.js +1 -0
- package/dist/{stage-CKb7aNoH.d.cts → stage-BtqKu5aX.d.cts} +1 -1
- package/dist/{stage-CKb7aNoH.d.ts → stage-BtqKu5aX.d.ts} +1 -1
- package/dist/sv-7VQX4BFH.js +1 -0
- package/dist/{tableSizing-RRmpxOXl.d.ts → tableSizing-BDePQyPD.d.ts} +3 -3
- package/dist/{tableSizing-Bz-hxLza.d.cts → tableSizing-C6EjKNnk.d.cts} +3 -3
- package/dist/th-E53HQMDC.js +1 -0
- package/dist/{ticketRestrictions-lq4dH4k6.d.cts → ticketRestrictions-CgYwHQOf.d.cts} +2 -2
- package/dist/{ticketRestrictions-C7KUrulv.d.ts → ticketRestrictions-D5wgOq4P.d.ts} +2 -2
- package/dist/tr-IIR6E7OD.js +1 -0
- package/dist/{types-DM-OneoD.d.ts → types-CGOr0BpE.d.cts} +40 -16
- package/dist/{types-DM-OneoD.d.cts → types-CGOr0BpE.d.ts} +40 -16
- package/dist/uk-HBINQ4XE.js +1 -0
- package/dist/vi-TX6I5RWN.js +1 -0
- package/dist/view3d/crossfade/panorama.d.cts +1 -1
- package/dist/view3d/crossfade/panorama.d.ts +1 -1
- package/dist/view3d/index.cjs +531 -172
- package/dist/view3d/index.d.cts +350 -73
- package/dist/view3d/index.d.ts +350 -73
- package/dist/view3d/index.js +529 -170
- package/dist/view3d/scene/scene.worker.cjs +1 -1
- package/dist/view3d/scene/scene.worker.js +1 -1
- package/dist/zh-Hans-7QNBTEYC.js +1 -0
- package/dist/zh-Hant-6KK3D42X.js +1 -0
- package/package.json +1 -1
- package/dist/ar-O3RHQRH3.js +0 -1
- package/dist/be-SXFCG3F5.js +0 -1
- package/dist/bg-W7YBNYB2.js +0 -1
- package/dist/ca-FA7WHACR.js +0 -1
- package/dist/chunk-4N5CHKHD.js +0 -1
- package/dist/chunk-4QQG5EEP.js +0 -1
- package/dist/chunk-YE4NP3XB.js +0 -1
- package/dist/cs-RR3VIKRC.js +0 -1
- package/dist/cy-U4JJ5C47.js +0 -1
- package/dist/da-ATULGB2M.js +0 -1
- package/dist/de-VB543CPC.js +0 -1
- package/dist/el-7Y2KXU6N.js +0 -1
- package/dist/es-GUV5XIYC.js +0 -1
- package/dist/et-SZ6I4Z44.js +0 -1
- package/dist/fa-FM6ELEN7.js +0 -1
- package/dist/fi-6QQ2M5JI.js +0 -1
- package/dist/fr-2SEQSVLR.js +0 -1
- package/dist/he-V3EVB7IW.js +0 -1
- package/dist/hi-I4QIBK5Q.js +0 -1
- package/dist/hr-I5DNEVUU.js +0 -1
- package/dist/hu-KTFWBQMF.js +0 -1
- package/dist/id-RZWUH426.js +0 -1
- package/dist/it-CNQP36V4.js +0 -1
- package/dist/ja-JQZOYIHI.js +0 -1
- package/dist/ko-6YCWWHFQ.js +0 -1
- package/dist/ku-33PM4OWG.js +0 -1
- package/dist/localeLoaders-VFQOZMUH.js +0 -1
- package/dist/lt-24JO2B7V.js +0 -1
- package/dist/lv-HTSDEEAB.js +0 -1
- package/dist/ms-PUEZJJ3R.js +0 -1
- package/dist/nl-NQPDRSCW.js +0 -1
- package/dist/no-3N3MUMSA.js +0 -1
- package/dist/pl-YHBEO6ZF.js +0 -1
- package/dist/pt-5RPESNZB.js +0 -1
- package/dist/ro-XDFXIMHX.js +0 -1
- package/dist/ru-BIIALOM5.js +0 -1
- package/dist/sk-LHSFRUFT.js +0 -1
- package/dist/sl-MPE5TPI3.js +0 -1
- package/dist/sr-T3N67KTP.js +0 -1
- package/dist/sv-LJWWYUIY.js +0 -1
- package/dist/th-E5POGG37.js +0 -1
- package/dist/tr-2DCWQ2CY.js +0 -1
- package/dist/uk-C3VJP6EA.js +0 -1
- package/dist/vi-XVMTKCOL.js +0 -1
- package/dist/zh-Hans-RG4CQGBY.js +0 -1
- package/dist/zh-Hant-YHNTYPFS.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{xa as Y}from"./chunk-
|
|
1
|
+
import{xa as Y}from"./chunk-BXQQKDIX.js";function nn(c){return{kind:"radial",rowCount:0,rows:[],nearestRow:()=>-1,depthAt:(l,a)=>Math.hypot(l-c.x,a-c.y),gradientAt:(l,a)=>{let e=l-c.x,f=a-c.y,i=Math.hypot(e,f);return i<1e-9?[0,0]:[e/i,f/i]}}}function tn(c,l){if(!c.length)return null;let a=0,e=0,f=0;for(let n of c)a+=n.x,e+=n.y,f+=Math.hypot(n.x-l.x,n.y-l.y);let i=c.length;a/=i,e/=i,f/=i;let u=c[0],R=-1;for(let n of c){let o=Math.hypot(n.x-a,n.y-e);o>R&&(R=o,u=n)}let b=u.x-a,m=u.y-e,d=Math.hypot(b,m);d>1e-9?(b/=d,m/=d):(b=1,m=0);let y=[...c].sort((n,o)=>(n.x-a)*b+(n.y-e)*m-((o.x-a)*b+(o.y-e)*m)),t=0;for(let n of y){let o=Math.hypot(n.x-a,n.y-e);o>t&&(t=o)}return{pts:y,cx:a,cy:e,radius:t,depth:f}}function Z(c,l,a){let e=c.pts;if(e.length===1)return Math.hypot(l-e[0].x,a-e[0].y);let f=1/0;for(let i=0;i+1<e.length;i++){let u=e[i],R=e[i+1],b=R.x-u.x,m=R.y-u.y,d=b*b+m*m,y=d>1e-12?((l-u.x)*b+(a-u.y)*m)/d:0;y<0?y=0:y>1&&(y=1);let t=Math.hypot(l-(u.x+y*b),a-(u.y+y*m));t<f&&(f=t)}return f}var U=8;function en(c,l,a){let e=new Array(U).fill(1/0),f=new Array(U).fill(-1);for(let d=0;d<c.length;d++){let y=c[d],t=Math.hypot(l-y.cx,a-y.cy)-y.radius;for(let n=0;n<U;n++)if(t<e[n]){for(let o=U-1;o>n;o--)e[o]=e[o-1],f[o]=f[o-1];e[n]=t,f[n]=d;break}}let i=new Array(3).fill(1/0),u=new Array(3).fill(-1);for(let d of f){if(d<0)continue;let y=Z(c[d],l,a);for(let t=0;t<3;t++)if(y<i[t]){for(let n=2;n>t;n--)i[n]=i[n-1],u[n]=u[n-1];i[t]=y,u[t]=d;break}}if(u[0]<0)return 0;if(i[0]<1e-6)return c[u[0]].depth;let R=i[0]*2.2,b=0,m=0;for(let d=0;d<3;d++){let y=u[d];if(y<0||i[d]>R)continue;let t=1/(i[d]*i[d]);b+=t*c[y].depth,m+=t}return m>0?b/m:c[u[0]].depth}function on(c){let l=(e,f)=>en(c,e,f),a=(e,f)=>{let i=1/0,u=-1;for(let R=0;R<c.length;R++){let b=c[R];if(Math.hypot(e-b.cx,f-b.cy)-b.radius>=i)continue;let m=Z(b,e,f);m<i&&(i=m,u=R)}return u};return{kind:"rows",rowCount:c.length,rows:c,nearestRow:a,depthAt:l,gradientAt:(e,f)=>{let i=(l(e+.5,f)-l(e-.5,f))/1,u=(l(e,f+.5)-l(e,f-.5))/(2*.5),R=Math.hypot(i,u);return R<1e-9?[0,0]:[i/R,u/R]}}}function bn(c,l){let a=[];for(let e of c){let f=tn(e.points,l);f&&a.push(f)}return a.length<2?nn(l):(a.sort((e,f)=>e.depth-f.depth),on(a))}var rn=Math.PI/180,h=96,sn=6,ln=60,cn=150,$=.2,an=.35;function fn(c,l){let a=Math.atan2(l.x-c.x,l.y-c.y)/rn;return a<0?a+360:a}function z(c){if(!c.length)return NaN;let l=[...c].sort((a,e)=>a-e);return l[Math.floor(l.length/2)]}function J(c,l,a=2){let e=c.length,f=new Float64Array(e);for(let i=0;i<e;i++){let u=0,R=0;for(let b=-a;b<=a;b++){let m=i+b;if(l)m=(m%e+e)%e;else if(m<0||m>=e)continue;u+=c[m],R++}f[i]=u/R}return f}function hn(c,l){let a=c.filter(t=>t.rows.length>=1);if(a.length<1)return null;let e=[],f=0,i=0,u=0;for(let t of a)for(let n of t.rows){for(let o of n.pts)f+=o.x,i+=o.y,u++;if(n.pts.length>=4){let o=Y(n.pts);o&&Number.isFinite(o.cx)&&Number.isFinite(o.cy)&&e.push({x:o.cx,y:o.cy})}}if(!u)return null;let R={x:f/u,y:i/u},b=R;if(e.length>=8){let t=z(e.map(D=>D.x)),n=z(e.map(D=>D.y)),o=0;for(let D of a)for(let j of D.rows)for(let F of j.pts){let W=Math.hypot(F.x-R.x,F.y-R.y);W>o&&(o=W)}let B=0,S=o*.2;for(let D of a)for(let j of D.rows)for(let F of j.pts)Math.hypot(F.x-t,F.y-n)<S&&B++;Math.hypot(t-R.x,n-R.y)<=o&&B/u<.01&&(b={x:t,y:n})}let m=[];for(let t of a){let n={sectionId:t.sectionId,rMin:1/0,rMax:-1/0,samples:[]};for(let o of t.rows)for(let B of o.pts){let S=Math.hypot(B.x-b.x,B.y-b.y),D=Math.min(h-1,Math.floor(fn(b,B)/(360/h)));n.samples.push({r:S,bin:D,levelM:o.levelM}),S<n.rMin&&(n.rMin=S),S>n.rMax&&(n.rMax=S)}n.samples.length&&m.push(n)}if(!m.length)return null;m.sort((t,n)=>t.rMin+t.rMax-(n.rMin+n.rMax));let d=[];for(let t of m){let n=!1;for(let o of d){let B=Math.min(t.rMax,o.rMax)-Math.max(t.rMin,o.rMin),S=Math.min(t.rMax-t.rMin,o.rMax-o.rMin);if(S>1e-9&&B>=an*S){o.members.push(t),o.rMin=Math.min(o.rMin,t.rMin),o.rMax=Math.max(o.rMax,t.rMax),n=!0;break}}n||d.push({members:[t],rMin:t.rMin,rMax:t.rMax})}let y=[];for(let t of d){let n=new Array(h).fill(null);for(let r of t.members)for(let p of r.samples){let x=n[p.bin];x||(x={samples:[]},n[p.bin]=x),x.samples.push({r:p.r,levelM:p.levelM})}let o=n.map(r=>!!r);if(!o.filter(Boolean).length)continue;let S=[],D=[];for(let r of n){if(!r)continue;let p=1/0,x=-1/0;for(let A of r.samples)A.r<p&&(p=A.r),A.r>x&&(x=A.r);S.push(p),D.push(x)}let j=z(S),F=z(D);if(!(j>=$*F)||!(F>0))continue;let W=[...S].sort((r,p)=>r-p);if(!(W[Math.floor(W.length*.1)]>=$*F))continue;let V=n.map(r=>{if(!r)return null;let p=[...r.samples].sort((w,k)=>w.r-k.r),x=p[0].r,A=p[p.length-1].r,P=p[0].levelM,N=-1/0;for(let w of p)w.levelM>N&&(N=w.levelM);let M=[];for(let w of p){let k={r:w.r,l:w.levelM};for(;M.length&&Math.abs(M[M.length-1].r-k.r)<1e-9;){if(M[M.length-1].l<=k.l){k.skip=!0;break}M.pop()}if(!k.skip){for(;M.length>=2;){let L=M[M.length-2],v=M[M.length-1];if((v.r-L.r)*(k.l-L.l)-(v.l-L.l)*(k.r-L.r)<=0)M.pop();else break}M.push(k)}}let C=M.map(w=>w.r),_=M.map(w=>w.l);return{inner:x,outer:A,front:P,top:N,profile:{rs:C,ls:_}}}),O=o.slice();for(let r=0;r<h;r++){if(O[r])continue;let p=-1,x=-1,A=0;for(let s=1;s<=h;s++){let g=(r-s+h*2)%h;if(O[g]){p=g;break}}for(let s=1;s<=h;s++){let g=(r+s)%h;if(O[g]){x=g,A=s;break}}if(p<0||x<0)continue;let P=0;for(let s=1;s<=h;s++){let g=(r-s+h*2)%h;if(o[g]){P=s;break}}if(P-1+A>sn)continue;let M=V[p],C=V[x],_=P/(P+A),w=M.inner+(C.inner-M.inner)*_,k=M.outer+(C.outer-M.outer)*_,L=M.front+(C.front-M.front)*_,v=M.top+(C.top-M.top)*_;V[r]={inner:w,outer:k,front:L,top:v,profile:{rs:[w,k],ls:[L,v]}}}for(let r=0;r<h;r++)V[r]&&(O[r]=!0);let X=360/h,K=[],q=O.filter(Boolean).length,Q=[];if(q===h)Q.push({start:0,len:h});else{let r=0;for(;O[r];)r=(r+1)%h;let p=-1;for(let x=0;x<=h;x++){let A=(r+x)%h,P=x<h&&O[A];if(P&&p<0)p=A;else if(!P&&p>=0){let N=(A-p+h)%h||h;Q.push({start:p,len:N}),p=-1}}}for(let r of Q){if(r.len*X<ln&&r.len<h)continue;let p=r.len===h,x=new Float64Array(r.len),A=new Float64Array(r.len),P=new Float64Array(r.len),N=new Float64Array(r.len),M=[];for(let s=0;s<r.len;s++){let g=V[(r.start+s)%h];x[s]=g.inner,A[s]=g.outer,P[s]=g.front,N[s]=g.top,M.push(g.profile??{rs:[g.inner,g.outer],ls:[g.front,g.top]})}let C=J(x,p),_=J(A,p),w=J(P,p),k=J(N,p);for(let s=0;s<r.len;s++)C[s]>x[s]&&(C[s]=x[s]),_[s]<A[s]&&(_[s]=A[s]),C[s]>_[s]-1e-6&&(C[s]=Math.max(0,_[s]-1e-6)),k[s]<w[s]&&(k[s]=w[s]);let L={startBin:r.start,binCount:r.len,closed:p,innerR:C,outerR:_,frontLevelM:w,topLevelM:k,profiles:M},v=(s,g,I)=>{let H=M[s],T=H.rs,E=H.ls;if(g<=T[0]){E[0]>I&&(E[0]=I);return}if(g>=T[T.length-1]){E[E.length-1]>I&&(E[E.length-1]=I);return}for(let G=0;G+1<T.length;G++)if(g<=T[G+1]){E[G]>I&&(E[G]=I),E[G+1]>I&&(E[G+1]=I);return}};for(let s=0;s<r.len;s++){let g=n[(r.start+s)%h];if(g)for(let I of g.samples){v(s,I.r,I.levelM);let H=p?(s-1+r.len)%r.len:s-1,T=p?(s+1)%r.len:s+1;H>=0&&v(H,I.r,I.levelM),T<r.len&&v(T,I.r,I.levelM)}}K.push(L)}K.reduce((r,p)=>r+p.binCount*X,0)<cn||y.push({arcs:K,sectionIds:t.members.map(r=>r.sectionId),innerRMedian:j,outerRMedian:F})}if(!y.length)return null;if(y.sort((t,n)=>t.innerRMedian-n.innerRMedian),l){let t=y[y.length-1].outerRMedian;if(Math.hypot(l.x-b.x,l.y-b.y)>.9*t)return null}return{centre:b,binCount:h,binStepDeg:360/h,rings:y}}function dn(c,l,a,e){let f=c.binStepDeg,i=a/f-.5-l.startBin;i=(i%c.binCount+c.binCount)%c.binCount,i>l.binCount-1&&(l.closed?i=i-l.binCount<l.binCount-i?0:l.binCount-1:i=i-(l.binCount-1)<c.binCount-i?l.binCount-1:0);let u=Math.floor(i),R=l.closed?(u+1)%l.binCount:Math.min(l.binCount-1,u+1),b=i-u,m=d=>{let y=l.profiles[d],t=y.rs,n=y.ls;if(e<=t[0])return n[0];if(e>=t[t.length-1])return n[n.length-1];for(let o=0;o+1<t.length;o++)if(e<=t[o+1]){let B=t[o+1]-t[o],S=B>1e-9?(e-t[o])/B:0;return n[o]+(n[o+1]-n[o])*S}return n[n.length-1]};return m(u)*(1-b)+m(R)*b}export{bn as a,fn as b,hn as c,dn as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as X}from"./chunk-M4NGX5NM.js";import{
|
|
1
|
+
import{l as X}from"./chunk-M4NGX5NM.js";import{$a as j,O as _,_a as T,fb as $,hb as B,ib as v}from"./chunk-BXQQKDIX.js";var W=.08,N=.045;function Y(t){return`__floor__:${encodeURIComponent(t)}`}function L(t,n,r){return{...t,objects:n,floors:void 0,...r?{focalPoint:r}:{},referenceImage:void 0,backgroundImage:void 0}}function U(t,n,r){let s=t.focalPoint??n.focalPoint;return s?s.x:r.x+r.width/2}function G(t){let n=t.floors??[];if(!n.length)return[];let r=n.map(e=>v(L(t,e.objects,e.focalPoint),{freeText:"exclude"})),c=Math.max(1,...r.map(e=>e.width))*W,o=0;return n.map((e,i)=>{let a=r[i],l=o-(a.y+a.height);return o-=a.height+c,{floorId:e.id,label:e.name??e.id,level:i,levelBadge:i===0?"G":String(i),translation:{x:-U(e,t,a),y:l},bounds:a}})}function H(t,n,r,s){let c=n==="name"?t.label:t.levelBadge;if(!c)return[];let o=Math.max(1,r*N),e=t.bounds.x+t.translation.x-o*2.4,i=t.bounds.y+t.translation.y+o*.4,a=`floor-level-${t.floorId}`;if(n==="name")return[{type:"text",id:`${a}-text`,text:c,position:{x:e,y:i},fontSize:o,rotation:0,color:s,bold:!0}];let l=o*.95,h={type:"shape",id:`${a}-badge`,kind:"ellipse",x:e-l*.35,y:i-l*.3,width:l*2,height:l*2,fill:"transparent",stroke:{color:s,width:Math.max(1,o*.09)},opacity:.8},p={type:"text",id:`${a}-text`,text:c,position:{x:h.x,y:h.y+l-o/2},width:l*2,align:"center",lineHeight:1,fontSize:o,rotation:0,color:s,bold:!0};return[h,p]}function it(t,n={}){let r=t.floors;if(!r||r.length<2)return t;let s=G(t),c=[];r.forEach((l,h)=>{let{x:p,y:x}=s[h].translation;for(let b of l.objects)h>0&&b.type==="shape"&&b.role==="stage"||c.push($(b,p,x))});let o={...t,objects:c,floors:void 0},e=v(o,{freeText:"exclude"}),i=Math.max(1,e.width,e.height),a=t.theme?.textColor??"#94a3b8";for(let l of s)c.push(...H(l,n.labelStyle??"number",i,a));return{...o,objects:c,referenceImage:void 0,backgroundImage:void 0}}function ct(t){if(!t.floors||t.floors.length<2)return t;let n=!t.zones?.length,r=new Set,s=t.floors.flatMap(o=>o.objects.flatMap(e=>{if(e.type==="shape"&&e.role==="stage"){let i=JSON.stringify([e.kind,e.x,e.y,e.width,e.height,e.points,e.rotation??0,e.label,e.heightM,e.eventConfigurationIds]);if(r.has(i))return[];r.add(i)}return n&&e.type==="section"?[{...e,zone:Y(o.id)}]:[e]})),c=n?t.floors.map(o=>({id:Y(o.id),label:o.name,focalPoint:{...o.focalPoint}})):t.zones;return{...t,objects:s,zones:c,floors:void 0,referenceImage:void 0,backgroundImage:X(t)}}function V(t){return t.floorOverview==="combined"?"combined":"separated"}function lt(t){let n=t.floors??[];if(n.length<2||n.some(c=>!c.objects.some(o=>Z.has(o.type))))return"separated";let r=z.get(t);if(r)return r;let s=K(t)?"separated":"combined";return z.set(t,s),s}var Z=new Set(["row","table","booth","gaArea","section"]),q=.1,D=18,z=new WeakMap;function K(t){let n=t.floors??[],r=(o,e)=>`${Math.floor(o/D)}:${Math.floor(e/D)}`,s=n.map(o=>{let e=B(L(t,o.objects,o.focalPoint)).map(a=>({x:a.x,y:a.y})),i={areas:[],seats:new Map};for(let a of o.objects)a.type==="section"&&a.outline?.length>=3&&i.areas.push({outer:a.outline,holes:a.holes}),a.type==="gaArea"&&a.points?.length>=3&&i.areas.push({outer:a.points,holes:a.holes});for(let a of e){let l=r(a.x,a.y),h=i.seats.get(l);h?h.push(a):i.seats.set(l,[a])}return{seats:e,footprint:i}}),c=(o,e)=>{let i=Math.floor(o.x/D),a=Math.floor(o.y/D);for(let l=-1;l<=1;l+=1)for(let h=-1;h<=1;h+=1)for(let p of e.seats.get(`${i+l}:${a+h}`)??[])if(Math.hypot(p.x-o.x,p.y-o.y)<D)return!0;return!1};return s.some((o,e)=>{if(!o.seats.length)return!1;let i=s.filter((l,h)=>h!==e).map(l=>l.footprint),a=0;for(let l of o.seats)i.some(h=>h.areas.some(p=>T(l,p.outer,p.holes))||c(l,h))&&(a+=1);return a/o.seats.length>q})}var R="level-context:";function ht(t,n){let r=t.floors??[];if(r.length<2||V(t)!=="combined")return[];let s="#8a93a6",c=[],o=r.find(i=>i.id===n),e=o?v(L(t,o.objects,o.focalPoint),{freeText:"exclude"}):null;for(let i of r){if(i.id===n)continue;let a=0;for(let x of i.objects){let b=x.type==="section"?x.outline:x.type==="gaArea"?x.points:null;if(!b||b.length<3)continue;let d={type:"shape",id:`${R}${i.id}:${a++}`,kind:"polygon",label:"",points:b.map(m=>({...m})),fill:"transparent",stroke:{color:s,width:1.5},opacity:.35};c.push(d)}let l=v(L(t,i.objects,i.focalPoint),{freeText:"exclude"});if(!a||!e||!J(l,e))continue;let h=c.filter(x=>x.type==="shape"&&x.id.startsWith(`${R}${i.id}:`)&&!!x.points),p=h.reduce((x,b)=>Q(b.points)>Q(x.points)?b:x,h[0]);c.push({type:"text",id:`${R}${i.id}:name`,text:i.name??i.id,position:j(p.points,void 0),fontSize:Math.max(1,Math.max(e.width,e.height)*.024),rotation:0,color:s,opacity:.6})}return c}function J(t,n){return t.x>=n.x&&t.y>=n.y&&t.x+t.width<=n.x+n.width&&t.y+t.height<=n.y+n.height}function Q(t){let n=t.map(s=>s.x),r=t.map(s=>s.y);return(Math.max(...n)-Math.min(...n))*(Math.max(...r)-Math.min(...r))}function ft(t){let n=t.floors;if(!n?.length)return null;let r=n.find(o=>o.objects.some(e=>e.type==="shape"&&e.role==="stage"));if(r)return r.id;let s=n[0],c=-1;for(let o of n){let e=v(L(t,o.objects,o.focalPoint),{freeText:"exclude"}),i=e.width*e.height;i>c&&(c=i,s=o)}return s.id}var ut=640;function mt(t,n){return(t.floors?.length??0)<2?null:"all"}var tt=9;function et(t){if(t.kind==="circle")return{hx:t.r,hy:t.r};let n=t.width/2,r=t.height/2,s=t.rotation??0;if(!s)return{hx:n,hy:r};let c=s*Math.PI/180,o=Math.abs(Math.cos(c)),e=Math.abs(Math.sin(c));return{hx:n*o+r*e,hy:n*e+r*o}}function nt(t,n,r){let s=n-t.seat.x,c=r-t.seat.y;if(t.shape.kind==="circle")return s*s+c*c<=t.shape.r*t.shape.r;let o=t.shape.rotation??0,e=s,i=c;if(o){let a=-o*Math.PI/180,l=Math.cos(a),h=Math.sin(a);e=s*l-c*h,i=s*h+c*l}return Math.abs(e)<=t.shape.width/2&&Math.abs(i)<=t.shape.height/2}function ot(t,n,r,s,c){if(t.shape.kind==="circle"){let d=Math.min(Math.max(t.seat.x,n),s),m=Math.min(Math.max(t.seat.y,r),c),y=t.seat.x-d,g=t.seat.y-m;return y*y+g*g<=t.shape.r*t.shape.r}let o=t.shape.rotation??0;if(!o)return t.seat.x-t.hx<=s&&t.seat.x+t.hx>=n&&t.seat.y-t.hy<=c&&t.seat.y+t.hy>=r;let e=o*Math.PI/180,i=Math.cos(e),a=Math.sin(e),l=t.shape.width/2,h=t.shape.height/2,p=[[-l,-h],[l,-h],[l,h],[-l,h]].map(([d,m])=>[t.seat.x+d*i-m*a,t.seat.y+d*a+m*i]),x=[[n,r],[s,r],[s,c],[n,c]],b=[[1,0],[0,1],[i,a],[-a,i]];for(let[d,m]of b){let y=1/0,g=-1/0;for(let[O,k]of p){let f=O*d+k*m;f<y&&(y=f),f>g&&(g=f)}let S=1/0,I=-1/0;for(let[O,k]of x){let f=O*d+k*m;f<S&&(S=f),f>I&&(I=f)}if(g<S||I<y)return!1}return!0}function yt(t,n={}){let r=n.seatRadius??tt,s=t.length,c=new Array(s),o=1/0,e=1/0,i=-1/0,a=-1/0,l=0;for(let f=0;f<s;f++){let u=t[f],F=n.shapeOf?.(u)??{kind:"circle",r},{hx:w,hy:M}=et(F);c[f]={seat:u,shape:F,hx:w,hy:M},u.x-w<o&&(o=u.x-w),u.y-M<e&&(e=u.y-M),u.x+w>i&&(i=u.x+w),u.y+M>a&&(a=u.y+M),w>l&&(l=w),M>l&&(l=M)}s===0&&(o=0,e=0,i=0,a=0);let h=l>0?l*4:1,p=Math.max(i-o,0),x=Math.max(a-e,0),b=Math.max(64,n.maxCells??s*4),d=h,m=Math.max(1,Math.ceil(p/d)||1),y=Math.max(1,Math.ceil(x/d)||1);for(;m*y>b&&(m>1||y>1);)d*=2,m=Math.max(1,Math.ceil(p/d)||1),y=Math.max(1,Math.ceil(x/d)||1);let g=m*y,S=new Int32Array(g+1),I=0;for(let f=0;f<s;f++){let u=c[f],F=_(Math.floor((u.seat.x-u.hx-o)/d),0,m-1),w=_(Math.floor((u.seat.x+u.hx-o)/d),0,m-1),M=_(Math.floor((u.seat.y-u.hy-e)/d),0,y-1),E=_(Math.floor((u.seat.y+u.hy-e)/d),0,y-1);for(let P=M;P<=E;P++)for(let C=F;C<=w;C++)S[P*m+C+1]++,I++}for(let f=0;f<g;f++)S[f+1]+=S[f];let O=new Int32Array(I),k=S.slice(0,g);for(let f=0;f<s;f++){let u=c[f],F=_(Math.floor((u.seat.x-u.hx-o)/d),0,m-1),w=_(Math.floor((u.seat.x+u.hx-o)/d),0,m-1),M=_(Math.floor((u.seat.y-u.hy-e)/d),0,y-1),E=_(Math.floor((u.seat.y+u.hy-e)/d),0,y-1);for(let P=M;P<=E;P++)for(let C=F;C<=w;C++){let A=P*m+C;O[k[A]++]=f}}return{seats:t,entries:c,minX:o,minY:e,cell:d,cols:m,rows:y,cellStart:S,items:O,stamp:new Int32Array(s),epoch:0}}function pt(t,n,r={}){let{cols:s,rows:c,cell:o,minX:e,minY:i,cellStart:a,items:l,entries:h}=t,p=Math.floor((n.x-e)/o),x=Math.floor((n.y-i)/o);if(p<0||x<0||p>=s||x>=c)return null;let b=x*s+p,d=a[b+1],m=-1,y=1/0;for(let g=a[b];g<d;g++){let S=l[g],I=h[S];if(r.filter&&!r.filter(I.seat.id,I.seat)||!nt(I,n.x,n.y))continue;let O=n.x-I.seat.x,k=n.y-I.seat.y,f=O*O+k*k;(f<y||f===y&&S<m)&&(y=f,m=S)}return m<0?null:h[m].seat.id}function bt(t,n,r,s={}){if(!(r>0))return null;let{cols:c,rows:o,cell:e,minX:i,minY:a,cellStart:l,items:h,entries:p}=t,x=Math.max(0,Math.floor((n.x-r-i)/e)),b=Math.min(c-1,Math.floor((n.x+r-i)/e)),d=Math.max(0,Math.floor((n.y-r-a)/e)),m=Math.min(o-1,Math.floor((n.y+r-a)/e));if(x>b||d>m)return null;let y=-1,g=r*r,S=t.stamp,I=++t.epoch;for(let O=d;O<=m;O++){let k=O*c;for(let f=x;f<=b;f++){let u=k+f,F=l[u+1];for(let w=l[u];w<F;w++){let M=h[w];if(S[M]===I)continue;S[M]=I;let E=p[M];if(s.filter&&!s.filter(E.seat.id,E.seat))continue;let P=n.x-E.seat.x,C=n.y-E.seat.y,A=P*P+C*C;(A<g||A===g&&M<y)&&(g=A,y=M)}}}return y<0?null:p[y].seat.id}function gt(t,n,r={}){let s=Math.min(n.x,n.x+n.width),c=Math.max(n.x,n.x+n.width),o=Math.min(n.y,n.y+n.height),e=Math.max(n.y,n.y+n.height),i=r.mode??"center",{cols:a,rows:l,cell:h,minX:p,minY:x,cellStart:b,items:d,entries:m}=t,y=Math.max(0,Math.floor((s-p)/h)),g=Math.min(a-1,Math.floor((c-p)/h)),S=Math.max(0,Math.floor((o-x)/h)),I=Math.min(l-1,Math.floor((e-x)/h));if(y>g||S>I)return[];let O=[],k=t.stamp,f=++t.epoch;for(let u=S;u<=I;u++){let F=u*a;for(let w=y;w<=g;w++){let M=F+w,E=b[M+1];for(let P=b[M];P<E;P++){let C=d[P];if(k[C]===f)continue;k[C]=f;let A=m[C];if(r.filter&&!r.filter(A.seat.id,A.seat))continue;(i==="center"?A.seat.x>=s&&A.seat.x<=c&&A.seat.y>=o&&A.seat.y<=e:ot(A,s,o,c,e))&&O.push(C)}}}return O.sort((u,F)=>u-F),O.map(u=>m[u].seat.id)}function Mt(t){let n=t.cols*t.rows,r=0,s=0;for(let o=0;o<n;o++){let e=t.cellStart[o+1]-t.cellStart[o];e>0&&r++,e>s&&(s=e)}let c=t.items.length;return{cell:t.cell,cols:t.cols,rows:t.rows,cells:n,occupiedCells:r,refs:c,maxPerCell:s,meanPerOccupiedCell:r?c/r:0}}export{W as a,Y as b,G as c,it as d,ct as e,V as f,lt as g,q as h,R as i,ht as j,ft as k,ut as l,mt as m,tt as n,yt as o,pt as p,bt as q,gt as r,Mt as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as Ne,j as me,n as Le,p as je}from"./chunk-S3VH7IDA.js";import{c as De}from"./chunk-CRCGO52K.js";var bo=2e6,At=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Nt=/[\s"'<>`\\]/;function Lt(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return At.test(e);if(Nt.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}function Fe(e){let t=e.trim();return Lt(t)?t:null}var jt=2e5,xo=1e5,Dt="large_venue_inventory";function So(e){return e?.includes(Dt)?2e5:1e5}var te="seatlayer.event-configuration/1",pe="seatlayer.event-configuration-export/1",K=100,Ft=120,Vt=2e5,Ht=1e4,He=/^[a-f0-9]{64}$/,Ut=new Set(["stage","screen","barrier","camera_platform","sound_desk","rigging_truss"]);function z(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function U(e,t){return typeof e=="string"&&e.length>=1&&e.length<=t&&e.normalize("NFKC").trim()===e}function Ue(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}function Ve(e){return!Array.isArray(e)||e.length>Vt||!e.every(t=>U(t,K))?null:[...new Set(e)].sort()}function Ke(e){return!z(e)||!U(e.chartId,K)||!U(e.version,K)||e.sha256!==void 0&&(typeof e.sha256!="string"||!He.test(e.sha256))?null:{chartId:e.chartId,version:e.version,...typeof e.sha256=="string"?{sha256:e.sha256}:{}}}function ye(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=t&&e<=n}function Kt(e){return z(e)?e.mode==="none"||e.mode==="opaque"?e.opacity===void 0?{mode:e.mode}:null:e.mode==="partial"&&ye(e.opacity,.01,.99)?{mode:"partial",opacity:e.opacity}:null:null}function Gt(e,t){if(e===void 0)return;if(!Array.isArray(e)||e.length>Ht)return null;let n=new Set(t),i=new Set,o=new Set,r=0,s=[];for(let l of e){if(!z(l)||!U(l.id,K)||!U(l.objectId,K)||!n.has(l.objectId)||!Ut.has(String(l.kind))||!ye(l.heightM,.05,50)||l.baseElevationM!==void 0&&!ye(l.baseElevationM,-10,100))return null;let h=Kt(l.occlusion);if(!h||i.has(l.id)||o.has(l.objectId))return null;let a=l.contentImageUrl===void 0?void 0:typeof l.contentImageUrl=="string"?Fe(l.contentImageUrl):null;if(l.contentImageUrl!==void 0&&(!a||l.kind!=="screen"||++r>1))return null;i.add(l.id),o.add(l.objectId),s.push({id:l.id,objectId:l.objectId,kind:l.kind,heightM:l.heightM,...l.baseElevationM!==void 0?{baseElevationM:l.baseElevationM}:{},occlusion:h,...a?{contentImageUrl:a}:{}})}return s.sort((l,h)=>l.id.localeCompare(h.id))}function Ge(e){let t=[];if(!z(e))return{issues:[{code:"invalid_export",path:"configuration",message:"Configuration must be an object"}]};e.schema!==te&&t.push({code:"unsupported_schema",path:"configuration.schema",message:`Configuration schema must be ${te}`}),U(e.id,K)||t.push({code:"invalid_id",path:"configuration.id",message:"Configuration id must contain 1 to 100 normalized characters"}),U(e.label,Ft)||t.push({code:"invalid_label",path:"configuration.label",message:"Configuration label must contain 1 to 120 normalized characters"}),Ue(e.version)||t.push({code:"invalid_version",path:"configuration.version",message:"Configuration version must be a positive integer"});let n=Ke(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 i=z(e.overlay)?e.overlay:null,o=Ve(i?.objectIds),r=Ve(i?.productionKillSeatIds),s=o?Gt(i?.productionElements,o):null;return(!i||!o||!r)&&t.push({code:"invalid_overlay",path:"configuration.overlay",message:"Overlay ids must be bounded arrays of normalized stable ids"}),s===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||!o||!r||s===null?{issues:t}:{issues:t,value:{schema:te,id:e.id,label:e.label,version:e.version,baseVenue:n,overlay:{objectIds:o,productionKillSeatIds:r,...s!==void 0?{productionElements:s}:{}}}}}function vo(e){let t=Ge(e);return t.value?{ok:!0,value:t.value}:{ok:!1,issues:t.issues}}function Eo(e){if(!z(e))return{ok:!1,issues:[{code:"invalid_export",path:"",message:"Export must be an object"}]};let t=[];e.schema!==pe&&t.push({code:"unsupported_schema",path:"schema",message:`Export schema must be ${pe}`}),(typeof e.contentSha256!="string"||!He.test(e.contentSha256))&&t.push({code:"invalid_checksum",path:"contentSha256",message:"Export checksum must be a lowercase SHA-256 digest"});let n=Ge(e.configuration);return t.push(...n.issues),t.length||!n.value||typeof e.contentSha256!="string"?{ok:!1,issues:t}:{ok:!0,value:{schema:pe,configuration:n.value,contentSha256:e.contentSha256}}}function Io(e){return JSON.stringify({schema:te,id:e.id,label:e.label,version:e.version,baseVenue:{chartId:e.baseVenue.chartId,version:e.baseVenue.version,...e.baseVenue.sha256?{sha256:e.baseVenue.sha256}:{}},overlay:{objectIds:[...new Set(e.overlay.objectIds)].sort(),productionKillSeatIds:[...new Set(e.overlay.productionKillSeatIds)].sort(),...e.overlay.productionElements!==void 0?{productionElements:[...e.overlay.productionElements].sort((t,n)=>t.id.localeCompare(n.id)).map(t=>({id:t.id,objectId:t.objectId,kind:t.kind,heightM:t.heightM,...t.baseElevationM!==void 0?{baseElevationM:t.baseElevationM}:{},occlusion:t.occlusion,...t.contentImageUrl?{contentImageUrl:t.contentImageUrl}:{}}))}:{}}})}function wo(e,t){let n=[];e.baseVenue.chartId!==t.chartId&&n.push({code:"base_venue_mismatch",message:"Configuration belongs to a different base venue"}),e.baseVenue.version!==t.version&&n.push({code:"base_venue_version_mismatch",message:"Configuration was authored against a different venue version"}),e.baseVenue.sha256&&!t.sha256?n.push({code:"base_venue_checksum_missing",message:"Venue checksum is required for this configuration"}):e.baseVenue.sha256&&e.baseVenue.sha256!==t.sha256&&n.push({code:"base_venue_checksum_mismatch",message:"Venue bytes do not match the configuration base"});let i=new Set(t.objectIds);for(let r of e.overlay.objectIds)i.has(r)||n.push({code:"overlay_object_missing",message:`Production object ${r} is missing from the base venue`,targetId:r});if(t.objectTypes)for(let r of e.overlay.productionElements??[])t.objectTypes.get(r.objectId)!=="shape"&&n.push({code:"production_element_not_shape",message:`Production element ${r.id} must reference base-venue shape geometry`,targetId:r.objectId});let o=new Set(t.seatIds);for(let r of e.overlay.productionKillSeatIds)o.has(r)||n.push({code:"production_kill_seat_missing",message:`Production-kill seat ${r} is missing from the base venue`,targetId:r});return{compatible:n.length===0,issues:n}}var Xt={draft:new Set(["review","archived"]),review:new Set(["draft","approved","archived"]),approved:new Set(["published","archived"]),published:new Set(["archived"]),archived:new Set};function Co(e,t){return e===t||Xt[e].has(t)}function _o(e,t,n){return!Ue(n)||n>=t.version?null:e.find(i=>i.id===t.id&&i.version===n&&i.status==="published")??null}function Bt(e){return e.floors?.length?e.floors.flatMap(t=>t.objects):e.objects}function be(e,t,n){if(!(!e||typeof e!="object")){if(Array.isArray(e)){for(let i of e)be(i,t,n);return}for(let[i,o]of Object.entries(e)){if(i==="eventConfigurationId"){U(o,K)?t.add(o):o!==void 0&&n.add(String(o));continue}if(i==="eventConfigurationIds"){if(!Array.isArray(o))n.add(String(o));else for(let r of o)U(r,K)?t.add(r):n.add(String(r));continue}be(o,t,n)}}}function ko(e,t){let n=Ke(t);if(!n)return{ok:!1,invalidIds:["baseVenue"]};let i=new Set,o=new Set;if(be(e,i,o),o.size)return{ok:!1,invalidIds:[...o].sort()};let r=Bt(e);return{ok:!0,configurations:[...i].sort().map(s=>({schema:te,id:s,label:s,version:1,baseVenue:n,overlay:{objectIds:r.filter(l=>l.type==="shape"&&l.eventConfigurationIds?.includes(s)).map(l=>l.id).sort(),productionKillSeatIds:[]}}))}}var Ro=40,To=1200,Ao=.8,No=3,Lo=-2,jo=20,Do=.1,Fo=40,Vo=40,Xe=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function Yt(e,t){let n=e.text.split(/\r?\n/);if(!e.width)return Math.max(1,n.length);let i=Math.max(1,Math.floor(t/Xe(e))),o=0;for(let r of n){if(!r.length){o+=1;continue}let s=0;for(let l of r.split(/\s+/)){let h=l.length;s&&s+1+h<=i?s+=1+h:(o+=Math.max(1,Math.ceil(h/i)),s=h%i)}}return Math.max(1,o)}function Be(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),i=Math.max(1,...n.map(l=>l.length))*Xe(e),o=e.width??i+t*2,r=Math.max(1,o-t*2),s=Yt(e,r);return{width:o,height:s*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:s,padding:t}}var Ye=Math.PI/180;function R(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function ze(e,t,n){let i=Math.cos(n),o=Math.sin(n),r=e.x-t.x,s=e.y-t.y;return{x:t.x+r*i-s*o,y:t.y+r*o+s*i}}function Uo(e,t,n){return n?ze(e,t,n*Ye):e}function Ko(e,t){return ze(e,{x:0,y:0},t*Ye)}function j(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function zt(e){let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;let i=e.length||1;return{x:t/i,y:n/i}}function Go(e){return e.length?zt(e):null}function ge(e,t){let n=1-t,i=n*n*n,o=3*n*n*t,r=3*n*t*t,s=t*t*t;return{x:i*e.start.x+o*e.control1.x+r*e.control2.x+s*e.end.x,y:i*e.start.y+o*e.control1.y+r*e.control2.y+s*e.end.y}}function Yo(e,t,n){let i={x:(e.x+t.x)/2,y:(e.y+t.y)/2},o={x:(n.x-i.x)*4/3,y:(n.y-i.y)*4/3};return{start:{...e},control1:{x:e.x+(t.x-e.x)/3+o.x,y:e.y+(t.y-e.y)/3+o.y},control2:{x:e.x+(t.x-e.x)*2/3+o.x,y:e.y+(t.y-e.y)*2/3+o.y},end:{...t}}}function qe(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[ge(e,.5)];let i=Array.from({length:n+1},(h,a)=>ge(e,a/n)),o=new Float64Array(i.length);for(let h=1;h<i.length;h+=1){let a=i[h].x-i[h-1].x,c=i[h].y-i[h-1].y;o[h]=o[h-1]+Math.hypot(a,c)}let r=o[o.length-1];if(r<=1e-9)return Array.from({length:t},()=>({...e.start}));let s=[],l=1;for(let h=0;h<t;h+=1){let a=r*h/(t-1);for(;l<o.length-1&&o[l]<a;)l+=1;let c=o[l-1],u=o[l],m=u===c?0:(a-c)/(u-c);s.push({x:i[l-1].x+(i[l].x-i[l-1].x)*m,y:i[l-1].y+(i[l].y-i[l-1].y)*m})}return s}function D(e,t){return{x:e.x+t.x,y:e.y+t.y}}function ne(e,t){return{x:e.x-t.x,y:e.y-t.y}}function F(e,t){return{x:e.x*t,y:e.y*t}}function ae(e,t=13){return Array.from({length:t},(n,i)=>ge(e,i/(t-1)))}function We(e,t){let n=Math.max(0,Math.min(1,t))*(e.length-1),i=Math.min(e.length-2,Math.floor(n));return j(e[i],e[i+1],n-i)}function $e(e,t,n){let i=Math.max(0,Math.min(1,t)),o=Math.max(i,Math.min(1,n)),r=[We(e,i)];for(let s=1;s<e.length-1;s+=1){let l=s/(e.length-1);l>i+1e-9&&l<o-1e-9&&r.push(e[s])}return r.push(We(e,o)),r}function Qe(e,t){let n=[[0,1],[1,2],[2,3],[3,0]],i=0,o=Number.POSITIVE_INFINITY;n.forEach(([m,d],p)=>{let f=R(j(e[m],e[d],.5),t);f<o&&(o=f,i=p)});let r=e[i],s=e[(i+1)%4],l=e[(i+2)%4],h=e[(i+3)%4],a=j(r,s,.5),c=ne(t,a),u=Math.max(1e-9,Math.hypot(c.x,c.y));return{p0:r,p1:s,p2:l,p3:h,normal:F(c,1/u),depth:(R(r,h)+R(s,l))/2}}function Je(e){let{p0:t,p1:n,p2:i,p3:o,normal:r,depth:s}=e,l=ne(n,t),h=ne(i,o),a=s*.22,c=s*.12;return{nearPath:{start:t,control1:D(D(t,F(l,1/3)),F(r,a)),control2:D(D(t,F(l,2/3)),F(r,a)),end:n},farPath:{start:i,control1:D(D(o,F(h,2/3)),F(r,c)),control2:D(D(o,F(h,1/3)),F(r,c)),end:o}}}function zo(e,t,n){if(e.length!==4)throw new Error("A section shell requires four mapped bounds corners");let i=e.reduce((p,f)=>D(p,f),{x:0,y:0});i.x/=4,i.y/=4;let o=R(e[0],e[1]),r=R(e[0],e[3]),s=n==="auto"?o>r*1.25&&R(i,t)>r?"bezier":"tapered":n;if(s==="rectangle")return{mode:s,outline:e.map(p=>({...p}))};let l=Qe(e,t),{p0:h,p1:a,p2:c,p3:u}=l;if(s==="tapered")return{mode:s,outline:[D(h,F(ne(a,h),.14)),D(h,F(ne(a,h),1-.14)),c,u]};let{nearPath:m,farPath:d}=Je(l);return{mode:s,outline:[...ae(m),...ae(d).slice(1)]}}function Wo(e,t,n,i){if(e.length!==4)throw new Error("Aisle generation requires four mapped bounds corners");if(!Number.isInteger(n)||n<0||n>3)throw new Error("Aisle count must be an integer from 0 to 3");if(n===0)return[];let o=Qe(e,t),{p0:r,p1:s,p2:l,p3:h}=o,a=i==="bezier"?Je(o):null,c=a?ae(a.nearPath):null,u=a?ae(a.farPath).reverse():null,m=Math.min(.055,.18/(n+1));return Array.from({length:n},(d,p)=>{let f=(p+1)/(n+1),b=f-m/2,P=f+m/2;return c&&u?[...$e(c,b,P),...$e(u,b,P).reverse()]:[j(r,s,b),j(r,s,P),j(h,l,P),j(h,l,b)]})}function Wt(e,t,n){let i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,s=r?Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)):0;return Math.hypot(e.x-(t.x+s*i),e.y-(t.y+s*o))}function $t(e,t){let n=1/0;for(let i of t)if(!(i.length<2))for(let o=0,r=i.length-1;o<i.length;r=o++){let s=Wt(e,i[r],i[o]);s<n&&(n=s)}return n}function Ze(e,t){let n=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){let r=t[i].x,s=t[i].y,l=t[o].x,h=t[o].y;s>e.y!=h>e.y&&e.x<(l-r)*(e.y-s)/(h-s)+r&&(n=!n)}return n}function tt(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function qt(e,t,n){let i=Ze(e,t)&&!n.some(r=>Ze(e,r)),o=$t(e,[t,...n]);return i?o:-o}function W(e,t,n,i,o){let r=qt({x:e,y:t},i,o);return{x:e,y:t,h:n,d:r,max:r+n*Math.SQRT2}}var xe=class{constructor(){this.items=[]}get size(){return this.items.length}push(t){let n=this.items;n.push(t);let i=n.length-1;for(;i>0;){let o=i-1>>1;if(n[o].max>=n[i].max)break;[n[o],n[i]]=[n[i],n[o]],i=o}}pop(){let t=this.items,n=t[0],i=t.pop();if(t.length&&i){t[0]=i;let o=0;for(;;){let r=o*2+1,s=r+1,l=o;if(r<t.length&&t[r].max>t[l].max&&(l=r),s<t.length&&t[s].max>t[l].max&&(l=s),l===o)break;[t[l],t[o]]=[t[o],t[l]],o=l}}return n}};function et(e){if(e.length<3)return 0;let t=0;for(let n=0,i=e.length-1;n<e.length;i=n++)t+=(e[i].x+e[n].x)*(e[i].y-e[n].y);return Math.abs(t)/2}function qo(e,t){return Math.max(0,et(e)-tt(t).reduce((n,i)=>n+et(i),0))}function nt(e,t){let n=tt(t);if(!e.length)return{point:{x:0,y:0},radius:0};if(e.length<3){let f=e.reduce((P,E)=>P+E.x,0)/e.length,b=e.reduce((P,E)=>P+E.y,0)/e.length;return{point:{x:f,y:b},radius:0}}let i=1/0,o=1/0,r=-1/0,s=-1/0;for(let f of e)f.x<i&&(i=f.x),f.y<o&&(o=f.y),f.x>r&&(r=f.x),f.y>s&&(s=f.y);let l=r-i,h=s-o,a=Math.min(l,h);if(!(a>0))return{point:{x:(i+r)/2,y:(o+s)/2},radius:0};let c=Math.max(l,h)/150,u=new xe,m=a/2;for(let f=i;f<r;f+=a)for(let b=o;b<s;b+=a)u.push(W(f+m,b+m,m,e,n));let d=W(i+l/2,o+h/2,0,e,n),p=0;for(;u.size;){let f=u.pop();if(!f)break;f.d>d.d&&(d=f),!(f.max-d.d<=c)&&(p>=4e3||(p+=1,m=f.h/2,u.push(W(f.x-m,f.y-m,m,e,n)),u.push(W(f.x+m,f.y-m,m,e,n)),u.push(W(f.x-m,f.y+m,m,e,n)),u.push(W(f.x+m,f.y+m,m,e,n))))}return{point:{x:d.x,y:d.y},radius:Math.max(0,d.d)}}function Qt(e,t,n){return Math.max(t,Math.min(n,e))}function Jo(e,t,n){return e<t?t:e>n?n:e}function Jt(e){return Qt(e,0,1)}function ot(e){let t=Jt(e);return t*t*(3-2*t)}var $=Math.PI*2;function q(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function Zt(e,t,n){let i=t-e;if(n){for(;i<0;)i+=$;for(;i>=$;)i-=$}else{for(;i>0;)i-=$;for(;i<=-$;)i+=$}return i}function ni(e){return e.end}function st(e){if(e.version!==1||e.closed!==!0||!q(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||!q(n.end))return!1;if(n.kind==="line"){if(R(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!q(n.control1)||!q(n.control2)||R(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!q(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(R(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(R(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||R(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return R(t,e.start)<=1e-4}function en(e,t,n){let i=1-n;return{x:i**3*e.x+3*i**2*n*t.control1.x+3*i*n**2*t.control2.x+n**3*t.end.x,y:i**3*e.y+3*i**2*n*t.control1.y+3*i*n**2*t.control2.y+n**3*t.end.y}}function at(e,t=2){if(!st(e))throw new Error("Section outline path is invalid");let n=Math.max(.25,t),i=[{...e.start}],o=e.start;for(let r of e.segments){if(r.kind==="line")i.push({...r.end});else if(r.kind==="arc"){let s=Math.atan2(o.y-r.center.y,o.x-r.center.x),l=Math.atan2(r.end.y-r.center.y,r.end.x-r.center.x),h=Zt(s,l,r.clockwise),a=Math.max(2,Math.ceil(Math.abs(h)*r.radius/n));for(let c=1;c<=a;c+=1){let u=s+h*c/a;i.push({x:r.center.x+Math.cos(u)*r.radius,y:r.center.y+Math.sin(u)*r.radius})}}else{let s=R(o,r.control1)+R(r.control1,r.control2)+R(r.control2,r.end),l=Math.max(2,Math.ceil(s/n));for(let h=1;h<=l;h+=1)i.push(en(o,r,h/l))}o=r.end}return R(i[i.length-1],i[0])<=1e-4&&i.pop(),i}function ct(e,t,n){return tn(e,o=>({x:o.x+t,y:o.y+n}))}function tn(e,t,n=1,i=!1){return{...e,start:t(e.start),segments:e.segments.map(o=>o.kind==="line"?{...o,end:t(o.end)}:o.kind==="arc"?{...o,center:t(o.center),radius:o.radius*Math.abs(n),clockwise:i?!o.clockwise:o.clockwise,end:t(o.end)}:{...o,control1:t(o.control1),control2:t(o.control2),end:t(o.end)})}}function oi(e){return e.map(t=>t===0?0:-t)}var nn=45,Se=150,on=60;function rn(e){let t=nn/100;if(e<=t)return Se;let n=Math.min(1,(e-t)/(1-t));return Se-n*(Se-on)}var it=.5523;function rt(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function sn(e){let t=[],n=[];for(e.forEach((i,o)=>{q(i)&&(t.length&&rt(t[t.length-1],i)||(t.push({x:i.x,y:i.y}),n.push(o)))});t.length>1&&rt(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}function ii(e,t,n){return Me(e,{cornerSmoothing:t,...n})}var an=.5,cn=4/3;function ln(e,t,n){let i=t.x-e.x,o=t.y-e.y,r=Math.hypot(i,o);if(r<=1e-9)return{kind:"line",end:{...t}};let s=-o/r,l=i/r,h=n*cn;return{kind:"bezier",control1:{x:e.x+i/3+s*h,y:e.y+o/3+l*h},control2:{x:e.x+i*2/3+s*h,y:e.y+o*2/3+l*h},end:{...t}}}function Me(e,t){let{points:n,sourceIndex:i}=sn(e),o=n.length;if(o<3)return null;let r=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,s=t.edgeCurvature,l=new Array(o).fill(0);if(s?.length)for(let x=0;x<o;x+=1){let S=s[i[x]];l[x]=Number.isFinite(S)?Math.min(100,Math.max(-100,S))/100:0}let h=l.some(x=>Math.abs(x)>1e-6);if(r<=0&&!h)return null;let a=t.wideAngleThresholdDeg??rn(r),c=[];for(let x=0;x<o;x+=1)c[x]=R(n[x],n[(x+1)%o]);let u=new Array(o).fill(0);for(let x=0;x<o;x+=1){let S=n[(x-1+o)%o],y=n[x],g=n[(x+1)%o],v={x:S.x-y.x,y:S.y-y.y},M={x:g.x-y.x,y:g.y-y.y},_=Math.hypot(v.x,v.y),T=Math.hypot(M.x,M.y);if(_<=1e-9||T<=1e-9)continue;let I=Math.min(1,Math.max(-1,(v.x*M.x+v.y*M.y)/(_*T))),C=Math.acos(I)*180/Math.PI;if(C<a)continue;let k=ot((C-a)/(180-a));u[x]=r*k*.5*Math.min(_,T)}for(let x=0;x<o;x+=1){let S=(x+1)%o,y=u[x]+u[S];if(y>c[x]&&y>1e-9){let g=c[x]/y;u[x]*=g,u[S]*=g}}let m=new Array(o),d=new Array(o);for(let x=0;x<o;x+=1){let S=n[(x-1+o)%o],y=n[x],g=n[(x+1)%o];if(u[x]<=1e-6){m[x]={...y},d[x]={...y};continue}let v=R(y,S)||1,M=R(y,g)||1;m[x]={x:y.x+(S.x-y.x)/v*u[x],y:y.y+(S.y-y.y)/v*u[x]},d[x]={x:y.x+(g.x-y.x)/M*u[x],y:y.y+(g.y-y.y)/M*u[x]}}if(u.every(x=>x<=1e-6)&&!h)return null;let p=[],f={...d[0]},b=f,P=(x,S)=>{if(R(b,x)<=1e-9)return;let y=l[S];Math.abs(y)>1e-6?p.push(ln(b,x,y*an*c[S])):p.push({kind:"line",end:{...x}}),b=x};for(let x=1;x<=o;x+=1){let S=x%o,y=n[S];P(m[S],(x-1)%o),u[S]>1e-6&&R(m[S],d[S])>1e-9&&(p.push({kind:"bezier",control1:j(m[S],y,it),control2:j(d[S],y,it),end:{...d[S]}}),b=d[S])}if(!p.length)return null;let E=p[p.length-1];R(E.end,f)>1e-9&&(E.kind==="line"?E.end={...f}:p.push({kind:"line",end:{...f}}));let w={version:1,closed:!0,start:f,segments:p};return st(w)?w:null}function ri(e){let t=[],n=e.start;for(let o of e.segments)t.push(n),n=o.end;let i=[];for(let o=e.segments.length-1;o>=0;o-=1){let r=e.segments[o],s=t[o];r.kind==="line"?i.push({kind:"line",end:{...s}}):r.kind==="arc"?i.push({kind:"arc",center:{...r.center},radius:r.radius,clockwise:!r.clockwise,end:{...s}}):i.push({kind:"bezier",control1:{...r.control2},control2:{...r.control1},end:{...s}})}return{version:1,closed:!0,start:{...e.start},segments:i}}function ai(e,t,n){let i=[];for(let o=0;o<e.length-1;o+=1){let r=e[o],s=e[o+1],l=Math.hypot(s.x-r.x,s.y-r.y);if(l<=0)continue;let h=Math.max(1,Math.round(l/n)),a=l/h,c=Math.atan2(s.y-r.y,s.x-r.x),u=o===0,d=(o>0?t[o-1]:void 0)==="break"?2:1,p=u?{...r}:{x:r.x+Math.cos(c)*a*d,y:r.y+Math.sin(c)*a*d},f=u?h+1:Math.max(1,h-(d-1));i.push({origin:p,rotation:c*180/Math.PI,seatCount:f,seatSpacing:a})}return i}function ci(e){let t=e.rotation*Math.PI/180,n={x:Math.cos(t),y:Math.sin(t)};return Array.from({length:e.seatCount},(i,o)=>({x:e.origin.x+n.x*o*e.seatSpacing,y:e.origin.y+n.y*o*e.seatSpacing}))}function li(e){return e.reduce((t,n)=>t+n.seatCount,0)}function lt(e){let t=new Map,n=new Map;for(let i of e){if(i.type!=="row"||!i.segmentedRow)continue;let o=n.get(i.segmentedRow.groupId)??[];o.push(i),n.set(i.segmentedRow.groupId,o)}for(let[i,o]of n){let r=o.slice().sort((m,d)=>m.segmentedRow.componentIndex-d.segmentedRow.componentIndex),s=r[0]?.segmentedRow?.componentCount??0,l=r[0]?.segmentedRow;if(!l||!(s>=2&&r.length===s&&l?.boundaryBefore==="start"&&r.every((m,d)=>m.segmentedRow?.kind==="segmented-row-v1"&&m.segmentedRow.groupId===i&&m.segmentedRow.componentCount===s&&m.segmentedRow.componentIndex===d&&m.segmentedRow.repeatLabelOnComponents===l.repeatLabelOnComponents&&(d===0?m.segmentedRow.boundaryBefore==="start":m.segmentedRow.boundaryBefore!=="start")&&m.segmentedRow.displayLabel===l.displayLabel)))continue;let a=r.reduce((m,d)=>m+d.seatCount,0),c=0,u=0;for(let m of r)m.segmentedRow.boundaryBefore==="break"&&(c+=1),t.set(m.id,{groupId:i,adjacencyOffset:c,displayOffset:u,displayLabel:l.displayLabel,totalSeats:a,canonical:r[0],viewFromSeatUrl:l.viewFromSeatUrl,viewFromSeatMeta:l.viewFromSeatMeta,confidenceEvidence:l.confidenceEvidence}),c+=m.seatCount,u+=m.seatCount}return t}var Q=.02291666666666667,Ee=1/Q,un=58,dn=un*Q,di=0,fn=3,ut=0,Pe=120,hn=0,mn=45,pn=7,J=1.2;function ve(e,t,n,i){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):i}function yn(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=pn?e:fn}function dt(e,t={}){let n=ve(t.floorBaseHeightM,ut,Pe,0),i=Math.min(Pe,n+yn(e.elevation)*dn),o=e.height===void 0?i:ve(e.height,ut,Pe,i),r=ve(e.rake,hn,mn,0);return{height:o,rake:r}}function ft(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 ht(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 i=1/0;for(let o=0;o+1<e.length;o++){let r=e[o],s=e[o+1],l=s.x-r.x,h=s.y-r.y,a=l*l+h*h,c=a>1e-12?((t-r.x)*l+(n-r.y)*h)/a:0;c<0?c=0:c>1&&(c=1);let u=t-(r.x+c*l),m=n-(r.y+c*h);if(Math.abs(u)>=i||Math.abs(m)>=i)continue;let d=Math.hypot(u,m);d<i&&(i=d)}return i}function bn(e){let t=0,n=0;for(let r of e)t+=r.x,n+=r.y;let i=e.length||1;t/=i,n/=i;let o=0;for(let r of e){let s=Math.hypot(r.x-t,r.y-n);s>o&&(o=s)}return{cx:t,cy:n,r:o}}function mt(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function Ie(e,t){let n=1/0;for(let i of ft(e)){let o=ht(t,i.x,i.y);o<n&&(n=o)}for(let i of ft(t)){let o=ht(e,i.x,i.y);o<n&&(n=o)}return n}function gn(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,i=0;for(let c of e)n+=c.x,i+=c.y;n/=e.length,i/=e.length;let o=-1,r=e[0];for(let c of e){let u=Math.hypot(c.x-n,c.y-i);u>o&&(o=u,r=c)}let s=r.x-n,l=r.y-i,h=Math.hypot(s,l);h>1e-9?(s/=h,l/=h):(s=1,l=0);let a=e.map((c,u)=>({p:c,i:u,t:(c.x-n)*s+(c.y-i)*l})).sort((c,u)=>c.t-u.t);return{pts:a.map(c=>c.p),seatIndices:a.map(c=>t[c.i])}}function xn(e){let t=e.length;if(t<3)return null;let n=0,i=0;for(let E of e)n+=E.x,i+=E.y;n/=t,i/=t;let o=0,r=0,s=0,l=0,h=0,a=0,c=0;for(let E of e){let w=E.x-n,x=E.y-i;o+=w*w,s+=x*x,r+=w*x,l+=w*w*w,h+=x*x*x,a+=w*x*x,c+=x*w*w}let u=o*s-r*r;if(Math.abs(u)<1e-9)return null;let m=(l+a)/2,d=(h+c)/2,p=(m*s-d*r)/u,f=(d*o-m*r)/u,b=p+n,P=f+i;return!Number.isFinite(b)||!Number.isFinite(P)?null:{cx:b,cy:P}}var Sn=.15,Mn=.001;function Pn(e){let t=e[0],n=e[e.length-1],i=n.x-t.x,o=n.y-t.y,r=Math.hypot(i,o);if(!(r>1e-9))return 0;let s=0;for(let l of e){let h=Math.abs((l.x-t.x)*o-(l.y-t.y)*i)/r;h>s&&(s=h)}return s/r}function vn(e){if(e.length<2)return null;let t=e.map(S=>{let y=0,g=0;for(let v of S.pts)y+=v.x,g+=v.y;return{x:y/S.pts.length,y:g/S.pts.length}}),n=0,i=0;for(let S of t)n+=S.x,i+=S.y;n/=t.length,i/=t.length;let o=0,r=0,s=0;for(let S of t){let y=S.x-n,g=S.y-i;o+=y*y,r+=y*g,s+=g*g}let l=o+s,h=o*s-r*r,a=l/2+Math.sqrt(Math.max(0,l*l/4-h)),c,u;Math.abs(r)>1e-12?(c=a-s,u=r):o>=s?(c=1,u=0):(c=0,u=1);let m=Math.hypot(c,u);if(!(m>1e-12))return null;c/=m,u/=m;let d=0,p=0,f=0;for(let S of e){if(S.pts.length<2)continue;let y=S.pts[0],g=S.pts[S.pts.length-1],v=g.x-y.x,M=g.y-y.y,_=Math.hypot(v,M);if(!(_>1e-9))continue;let T=v/_,I=M/_;d+=(T*T-I*I)*_,p+=2*T*I*_,f+=_}if(f>0&&Math.hypot(d,p)>=In*f){let S=Math.atan2(p,d)/2;c=-Math.sin(S),u=Math.cos(S)}let b=1/0,P=-1/0,E=[];for(let S of e){let y=1/0,g=-1/0;for(let v of S.pts){let M=v.x*c+v.y*u;M<y&&(y=M),M>g&&(g=M),M<b&&(b=M),M>P&&(P=M)}E.push(g-y)}let w=P-b;return w>1e-9?(E.sort((S,y)=>S-y),E[Math.min(E.length-1,Math.floor(E.length*.9))]/w<=En?{x:c,y:u}:null):null}var En=.35,In=.8;function pt(e,t,n,i){let o=new Map;for(let y of n){let g=t[y],v=g.rowId||`__seat-${y}`,M=o.get(v);M||(M={pts:[],idx:[]},o.set(v,M)),M.pts.push({x:g.x,y:g.y}),M.idx.push(y)}if(!o.size)return{sectionId:e,rows:[],blockCount:0};let r=[];for(let[y,g]of o){let v=gn(g.pts,g.idx),M=0;for(let _ of v.pts)M+=Math.hypot(_.x-i.x,_.y-i.y);r.push({id:y,pts:v.pts,seatIndices:v.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:M/v.pts.length})}let s=r.map(y=>bn(y.pts)),l=r.length<=256?r.length*(r.length-1)/2:0,h=l?new Float64Array(l):null;h?.fill(Number.NaN);let a=h?new Map(r.map((y,g)=>[y,g])):null,c=(y,g)=>(y>g&&([y,g]=[g,y]),y*(2*r.length-y-1)/2+(g-y-1)),u=(y,g)=>{if(!h)return Ie(r[y].pts,r[g].pts);let v=c(y,g),M=h[v];if(!Number.isNaN(M))return M;let _=Ie(r[y].pts,r[g].pts);return h[v]=_,_},m=(y,g)=>a?u(a.get(y),a.get(g)):Ie(y.pts,g.pts),d=[];for(let y=0;y<r.length;y++){let g=1/0;for(let v=0;v<r.length;v++){if(y===v||mt(s[y],s[v])>=g)continue;let M=u(y,v);M<g&&(g=M)}Number.isFinite(g)&&d.push(g)}d.sort((y,g)=>y-g);let p=d.length?d[Math.floor(d.length/2)]:1,f=Math.max(p*1.8,1e-6),b=r.map(()=>[]);for(let y=0;y<r.length;y++)for(let g=y+1;g<r.length;g++)mt(s[y],s[g])>f||u(y,g)<=f&&(b[y].push(g),b[g].push(y));let P=0;for(let y=0;y<r.length;y++){if(r[y].blockId!==-1)continue;let g=P++,v=[y];for(r[y].blockId=g;v.length;){let M=v.pop();for(let _ of b[M])r[_].blockId===-1&&(r[_].blockId=g,v.push(_))}}let E=new Map;for(let y of r){let g=E.get(y.blockId)??[];g.push(y),E.set(y.blockId,g)}let w=[];for(let y of r){if(y.pts.length<4||Pn(y.pts)<Mn)continue;let g=xn(y.pts);g&&(!Number.isFinite(g.cx)||!Number.isFinite(g.cy)||w.push({x:g.cx,y:g.cy}))}let x=w.length>=2?(()=>{let y=w.map(M=>M.x).sort((M,_)=>M-_),g=w.map(M=>M.y).sort((M,_)=>M-_),v=Math.floor(w.length/2);return{cx:y[v],cy:g[v]}})():null;if(x){let y=I=>Math.hypot(I.x-x.cx,I.y-x.cy),g=1/0,v=-1/0,M=[];for(let I of r){let C=1/0,k=-1/0;for(let N of I.pts){let A=y(N);A<C&&(C=A),A>k&&(k=A)}M.push(k-C),C<g&&(g=C),k>v&&(v=k)}let _=v-g;M.sort((I,C)=>I-C);let T=M[Math.min(M.length-1,Math.floor(M.length*.9))];if(_>1e-9&&T/_<=Sn){let I=r.map(O=>{let se=0;for(let Tt of O.pts)se+=y(Tt);return{row:O,radius:se/O.pts.length}}),C=0,k=0;for(let O of I)C+=O.radius,k+=O.row.focalDistance;C/=I.length,k/=I.length;let N=0;for(let O of I)N+=(O.radius-C)*(O.row.focalDistance-k);if(N<0)for(let O of I)O.radius=-O.radius;let L=1/0;for(let O of I)O.radius<L&&(L=O.radius);I.sort((O,se)=>O.radius-se.radius);let H=-1,Y=-1/0,Rt=_/Math.max(1,I.length)*.5,Ae=[];for(let O of I)O.radius-Y>Rt&&(H++,Y=O.radius),O.row.ordinal=H,O.row.blockDepth=O.radius-L,Ae.push(O.row);return{sectionId:e,rows:Ae,blockCount:P}}}let S=[];for(let[,y]of E){let g=vn(y);if(g){let v=I=>{let C=0;for(let k of I.pts)C+=k.x*g.x+k.y*g.y;return C/I.pts.length};y.sort((I,C)=>v(I)-v(C)),y.length>=2&&y[0].focalDistance>y[y.length-1].focalDistance&&y.reverse();let M=[],_=p*.5;for(let I of y){let C=M[M.length-1];C&&Math.abs(v(I)-v(C[0]))<_?C.push(I):M.push([I])}let T=0;for(let I=0;I<M.length;I++){if(I>0){let C=1/0;for(let k of M[I-1])for(let N of M[I])C=Math.min(C,m(k,N));C=Math.min(C,Math.abs(v(M[I][0])-v(M[I-1][0]))),T+=C}for(let C of M[I])C.ordinal=I,C.blockDepth=T,S.push(C)}}else{let v=1/0;for(let M of y)M.focalDistance<v&&(v=M.focalDistance);y.sort((M,_)=>M.focalDistance-_.focalDistance);for(let M=0;M<y.length;M++)y[M].ordinal=M,y[M].blockDepth=Math.max(0,y[M].focalDistance-v),S.push(y[M])}}return{sectionId:e,rows:S,blockCount:P}}function wn(e,t){return Math.abs(e.x-t.x)<=1e-7&&Math.abs(e.y-t.y)<=1e-7}function oe(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function ce(e,t,n){let i=oe(t,n,e);return Math.abs(i)>1e-7?!1:e.x>=Math.min(t.x,n.x)-1e-7&&e.x<=Math.max(t.x,n.x)+1e-7&&e.y>=Math.min(t.y,n.y)-1e-7&&e.y<=Math.max(t.y,n.y)+1e-7}function Cn(e,t,n,i){let o=oe(e,t,n),r=oe(e,t,i),s=oe(n,i,e),l=oe(n,i,t);return(o>1e-7&&r<-1e-7||o<-1e-7&&r>1e-7)&&(s>1e-7&&l<-1e-7||s<-1e-7&&l>1e-7)?!0:Math.abs(o)<=1e-7&&ce(n,e,t)||Math.abs(r)<=1e-7&&ce(i,e,t)||Math.abs(s)<=1e-7&&ce(e,n,i)||Math.abs(l)<=1e-7&&ce(t,n,i)}function _n(e){return e.reduce((t,n,i)=>{let o=e[(i+1)%e.length];return t+n.x*o.y-o.x*n.y},0)}function kn(e){for(let t=0;t<e.length;t+=1){let n=(t+1)%e.length;for(let i=t+1;i<e.length;i+=1){let o=(i+1)%e.length;if(!(t===i||n===i||o===t)&&Cn(e[t],e[n],e[i],e[o]))return!0}}return!1}function mi(e){return e.length<3?{ok:!1,code:"too_few_vertices",message:"Add at least three vertices to create a polygon."}:e.length>256?{ok:!1,code:"too_many_vertices",message:"A polygon can contain at most 256 vertices."}:e.some(t=>!Number.isFinite(t.x)||!Number.isFinite(t.y)||Math.abs(t.x)>1e7||Math.abs(t.y)>1e7)?{ok:!1,code:"invalid_coordinate",message:"Every polygon vertex must use a finite coordinate inside the safe chart range."}:e.some((t,n)=>wn(t,e[(n+1)%e.length]))?{ok:!1,code:"duplicate_vertex",message:"Move or remove duplicate neighbouring vertices."}:Math.abs(_n(e))<2?{ok:!1,code:"degenerate_polygon",message:"The polygon needs a visible enclosed area."}:kn(e)?{ok:!1,code:"self_intersection",message:"Polygon edges cannot cross or touch each other."}:{ok:!0}}var gi=64;function On(e){let t=e.points??[];if(e.kind!=="polygon"||t.length<3||!Array.isArray(e.edgeCurvature))return[];let n=t.map((i,o)=>{let r=e.edgeCurvature[o];return Number.isFinite(r)?Math.min(100,Math.max(-100,r)):0});return n.some(i=>Math.abs(i)>.5)?n:[]}function Rn(e){let t=On(e);return t.length?Me(e.points,{edgeCurvature:t}):null}function ie(e,t=2){let n=Rn(e);return n?at(n,t):e.points??[]}function xi(e){return e.kind==="polygon"?G(e.holes):[]}function Si(e,t){let n=ie(e);return n.length<3||t.length<3||!t.flatMap((o,r)=>{let s=t[(r+1)%t.length];return[o,{x:(o.x+s.x)/2,y:(o.y+s.y)/2}]}).every(o=>Z(o,n)||we(o,n))?!1:!t.some((o,r)=>{let s=t[(r+1)%t.length];return n.some((l,h)=>yt(o,s,l,n[(h+1)%n.length]))})}function yt(e,t,n,i){let o=(a,c,u)=>(c.x-a.x)*(u.y-a.y)-(c.y-a.y)*(u.x-a.x),r=o(e,t,n),s=o(e,t,i),l=o(n,i,e),h=o(n,i,t);return r*s<-1e-9&&l*h<-1e-9}function Mi(e,t){return Z(e[0],t)||Z(t[0],e)?!0:e.some((n,i)=>{let o=e[(i+1)%e.length];return t.some((r,s)=>yt(n,o,r,t[(s+1)%t.length]))})}var Ei=[{key:"rect",label:"Flat stage",blurb:"Classic proscenium box."},{key:"rounded",label:"Rounded",blurb:"Softened corners."},{key:"arc",label:"Curved front",blurb:"Front edge bows toward the audience."},{key:"proscenium",label:"Theatre stage",blurb:"Curved apron. In 3D: an arch, the house curtain and a timber floor."},{key:"open-air",label:"Open-air stage",blurb:"For a festival or an amphitheatre. In 3D: the venue stands under the sky."},{key:"thrust",label:"Thrust (T)",blurb:"Central tongue projects into the crowd."},{key:"runway",label:"Runway",blurb:"Long catwalk into the audience."},{key:"round",label:"In the round",blurb:"Central platform, audience all around."},{key:"pitch-football",label:"Football pitch",blurb:"105 \xD7 68 m pitch with centre circle and penalty boxes."},{key:"rink-hockey",label:"Hockey rink",blurb:"60 \xD7 30 m ice rink with blue lines and faceoff circles."},{key:"track-athletics",label:"Athletics track",blurb:"400 m track: two straights, two semicircles, eight lanes."},{key:"oval-cricket",label:"Cricket oval",blurb:"~150 \xD7 140 m oval with boundary rope and pitch strip."},{key:"pitch-rugby",label:"Rugby pitch",blurb:"100 \xD7 70 m field of play with in-goal areas, 22 m and 10 m lines."},{key:"diamond-baseball",label:"Baseball field",blurb:"Diamond, infield, mound and foul lines out to 99 m poles."},{key:"court-basketball",label:"Basketball court",blurb:"28 \xD7 15 m court with keys and three-point lines."},{key:"court-tennis",label:"Tennis court",blurb:"23.77 \xD7 10.97 m doubles court with run-off and net."},{key:"ring-boxing",label:"Boxing ring",blurb:"Raised ring, 6.1 m inside the ropes, coloured corners."},{key:"track-motorsport",label:"Race track",blurb:"300 \xD7 15 m start straight with a grid and a finish line. In 3D: under the sky."}],Tn=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing","track-motorsport"]),bt=new Set(["pitch-football","track-athletics","oval-cricket","pitch-rugby","diamond-baseball"]);function An(e){return!!e&&Tn.has(e)}function Ii(e){return!!e&&bt.has(e)}var Nn="open-air",Ln=new Set([...bt,"court-tennis","track-motorsport",Nn]);function wi(e){return!!e&&Ln.has(e)}var jn=new Set(["court-basketball","rink-hockey","ring-boxing"]);function Ci(e){return!!e&&jn.has(e)}var _e=1.1;function _i(e){return le(e)?e==="ring-boxing"?_e:.06:1}var gt={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},"track-motorsport":{width:300,height:15}},xt={"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","track-motorsport":"#3b4048"};function ki(e){let t=gt[e];return t?{width:t.width*Ee,height:t.height*Ee}:{width:300,height:70}}var Oi="proscenium",Dn=.84,Fn="#232c40",St=Math.PI*2;function Mt(e,t,n,i,o,r){return{x:o+e*n-t*i,y:r+e*i+t*n}}function Vn(e){let{kind:t,cx:n,cy:i,width:o,height:r}=e,s=(e.rotation??0)*Math.PI/180,l=Math.cos(s),h=Math.sin(s),a=o/2,c=r/2,u=[],m=(d,p)=>{u.push({x:d,y:p})};switch(t){case"rect":case"open-air":{m(-a,-c),m(a,-c),m(a,c),m(-a,c);break}case"rounded":{let d=Math.min(o,r)*.18,p=5,f=(b,P,E)=>{for(let w=0;w<=p;w++){let x=E+w/p*(Math.PI/2);m(b+d*Math.cos(x),P+d*Math.sin(x))}};f(a-d,-c+d,-Math.PI/2),f(a-d,c-d,0),f(-a+d,c-d,Math.PI/2),f(-a+d,-c+d,Math.PI);break}case"arc":{let d=r*.45;m(-a,-c),m(a,-c);let p=24;for(let f=0;f<=p;f++){let b=f/p,P=a-b*o,E=c+d*(1-Math.pow(2*P/o,2));m(P,E)}break}case"proscenium":{let d=a*Dn,p=r*.4;m(-a,-c),m(a,-c),m(a,c);let f=20;for(let b=0;b<=f;b++){let P=d-b/f*2*d;m(P,c+p*(1-Math.pow(P/d,2)))}m(-a,c);break}case"thrust":{let d=o*.18,p=r*1.1;m(-a,-c),m(a,-c),m(a,c),m(d,c),m(d,c+p),m(-d,c+p),m(-d,c),m(-a,c);break}case"runway":{let d=o*.1,p=r*3;m(-a,-c),m(a,-c),m(a,c),m(d,c),m(d,c+p),m(-d,c+p),m(-d,c),m(-a,c);break}case"round":case"oval-cricket":{for(let p=0;p<40;p++){let f=p/40*St;m(a*Math.cos(f),c*Math.sin(f))}break}case"pitch-football":case"pitch-rugby":case"court-basketball":case"court-tennis":case"ring-boxing":case"track-motorsport":{m(-a,-c),m(a,-c),m(a,c),m(-a,c);break}case"diamond-baseball":{for(let d of Un(a,c))m(d.x,d.y);break}case"rink-hockey":{for(let d of Hn(a,c,a*(8.5/60),c*(8.5/30)))m(d.x,d.y);break}case"track-athletics":{for(let d of Ce(a,c))m(d.x,d.y);break}}return u.map(d=>Mt(d.x,d.y,l,h,n,i))}function Ri(e,t="stage"){return{type:"shape",id:t,kind:"polygon",points:Vn(e),fill:e.fill??xt[e.kind]??Fn,label:e.label??"STAGE",role:"stage",stageKind:e.kind}}function Hn(e,t,n,i){let o=[],s=(l,h,a)=>{for(let c=0;c<=8;c++){let u=a+c/8*(Math.PI/2);o.push({x:l+n*Math.cos(u),y:h+i*Math.sin(u)})}};return s(e-n,-t+i,-Math.PI/2),s(e-n,t-i,0),s(-e+n,t-i,Math.PI/2),s(-e+n,-t+i,Math.PI),o}function Ce(e,t){let n=Math.max(0,e-t),i=[],o=20;for(let r=0;r<=o;r++){let s=-Math.PI/2+r/o*Math.PI;i.push({x:n+t*Math.cos(s),y:t*Math.sin(s)})}for(let r=0;r<=o;r++){let s=Math.PI/2+r/o*Math.PI;i.push({x:-n+t*Math.cos(s),y:t*Math.sin(s)})}return i}var B=(()=>{let t={x:0,y:52},n=25,i={x:70,y:t.y-70},o=(i.x*i.x+i.y*i.y-4900)/(2*(i.y+70)),r=o+70,s=[],l=Math.atan2(i.y-o,i.x),h=Math.atan2(i.y-o,-i.x);for(let a=0;a<=24;a++){let c=l+(h-l)*a/24;s.push({x:r*Math.cos(c),y:o+r*Math.sin(c)})}return{half:70,home:t,backstop:n,fence:s}})();function Un(e,t){let n=e/B.half,i=t/B.half;return[{x:-B.backstop*n,y:t},{x:B.backstop*n,y:t},...B.fence.map(o=>({x:o.x*n,y:o.y*i}))]}var Kn="#f1f5f9";function Ti(e){switch(e){case"pitch-football":return"PITCH";case"rink-hockey":return"RINK";case"track-athletics":case"track-motorsport":return"TRACK";case"oval-cricket":return"OVAL";case"pitch-rugby":return"PITCH";case"diamond-baseball":return"FIELD";case"court-basketball":case"court-tennis":return"COURT";case"ring-boxing":return"RING";default:return"STAGE"}}function le(e){return An(e)}function X(e,t,n,i,o=32){let r=[];for(let s=0;s<o;s++){let l=s/o*St;r.push({x:e+n*Math.cos(l),y:t+i*Math.sin(l)})}return r}function V(e,t,n,i){return[{x:e-n,y:t-i},{x:e+n,y:t-i},{x:e+n,y:t+i},{x:e-n,y:t+i}]}function Gn(e){let{kind:t,cx:n,cy:i,width:o,height:r}=e,s=(e.rotation??0)*Math.PI/180,l=Math.cos(s),h=Math.sin(s),a=o/2,c=r/2,u=[],m=gt[t],d=f=>m?f/m.width*o:0,p=f=>m?f/m.height*r:0;switch(t){case"pitch-football":{u.push({points:[{x:0,y:-c},{x:0,y:c}],closed:!1}),u.push({points:X(0,0,d(9.15),p(9.15)),closed:!0});for(let f of[-1,1])u.push({points:V(f*(a-d(16.5)/2),0,d(16.5)/2,p(40.32)/2),closed:!0}),u.push({points:V(f*(a-d(5.5)/2),0,d(5.5)/2,p(18.32)/2),closed:!0});break}case"rink-hockey":{u.push({points:[{x:0,y:-c},{x:0,y:c}],closed:!1,ink:"#d63b3b"});for(let f of[-1,1]){u.push({points:[{x:f*d(7.5),y:-c},{x:f*d(7.5),y:c}],closed:!1,ink:"#2f6ecb"}),u.push({points:[{x:f*(a-d(4)),y:-p(11)},{x:f*(a-d(4)),y:p(11)}],closed:!1,ink:"#d63b3b"});for(let b of[-1,1])u.push({points:X(f*d(20.5),b*p(7),d(4.5),p(4.5)),closed:!0,ink:"#2f6ecb"})}u.push({points:X(0,0,d(4.5),p(4.5)),closed:!0,ink:"#2f6ecb"});break}case"track-athletics":{let b=c-p(1.22)*8;b>0&&u.push({points:Ce(a-d(1.22)*8,b),closed:!0,fill:"#2f7d4f"});for(let P=1;P<8;P++){let E=p(1.22)*P,w=c-E;if(w<=0)break;u.push({points:Ce(a-d(1.22)*P,w),closed:!0})}break}case"oval-cricket":{u.push({points:X(0,0,d(27.4),p(27.4+20.12/2),40),closed:!0}),u.push({points:V(0,0,d(3.05)/2,p(20.12)/2),closed:!0,ink:"#d8cfae"});break}case"pitch-rugby":{let f=b=>({points:[{x:d(b),y:-c},{x:d(b),y:c}],closed:!1});u.push(f(0));for(let b of[-1,1]){u.push(f(b*50),f(b*28));for(let P=-35;P<35;P+=4)u.push({points:[{x:d(b*10),y:p(P)},{x:d(b*10),y:p(Math.min(35,P+2))}],closed:!1})}break}case"diamond-baseball":{let f=(A,L)=>({x:d(A),y:p(L)}),{home:b}=B,P=27.43,E=P/Math.SQRT2,w={x:b.x+E,y:b.y-E},x={x:b.x,y:b.y-2*E},S={x:b.x-E,y:b.y-E},y={x:b.x,y:b.y-18.44},g="#b98a59",v=xt["diamond-baseball"],M=38.94,_=[f(b.x,b.y)],T=Math.atan2(b.y-M/Math.SQRT2-y.y,M/Math.SQRT2),I=Math.PI-T;for(let A=0;A<=16;A++){let L=T-(T+Math.PI*2-I)%(Math.PI*2)*(A/16);_.push(f(y.x+29*Math.cos(L),y.y+29*Math.sin(L)))}u.push({points:_,closed:!0,fill:g,ink:g});let C={x:b.x,y:b.y-E},k=[{x:b.x,y:b.y},w,x,S].map(A=>f(C.x+(A.x-C.x)*.84,C.y+(A.y-C.y)*.84));u.push({points:k,closed:!0,fill:v,ink:v}),u.push({points:X(d(y.x),p(y.y),d(2.74),p(2.74),20),closed:!0,fill:g,ink:g}),u.push({points:X(d(b.x),p(b.y),d(3.96),p(3.96),20),closed:!0,fill:g,ink:g});let N=B.fence;u.push({points:[f(b.x,b.y),f(N[0].x,N[0].y)],closed:!1}),u.push({points:[f(b.x,b.y),f(N[N.length-1].x,N[N.length-1].y)],closed:!1});for(let A of[w,x,S])u.push({points:V(d(A.x),p(A.y),d(.3),p(.3)),closed:!0,fill:Kn});break}case"court-basketball":{u.push({points:V(0,0,d(14),p(7.5)),closed:!0}),u.push({points:[{x:0,y:-p(7.5)},{x:0,y:p(7.5)}],closed:!1}),u.push({points:X(0,0,d(1.8),p(1.8),24),closed:!0});for(let f of[-1,1]){let b=f*14,P=f*(14-5.8),E=f*(14-1.575);u.push({points:V(d((b+P)/2),0,d(2.9),p(2.45)),closed:!0,fill:"#2f5d8a"}),u.push({points:X(d(P),0,d(1.8),p(1.8),24),closed:!0});let w=Math.sqrt(6.75*6.75-6.6*6.6),x=[{x:d(b),y:-p(6.6)}],S=Math.atan2(-6.6,-f*w),y=2*Math.atan2(6.6,w);for(let g=0;g<=16;g++){let v=S-f*y*(g/16);x.push({x:d(E+6.75*Math.cos(v)),y:p(6.75*Math.sin(v))})}x.push({x:d(b),y:p(6.6)}),u.push({points:x,closed:!1})}break}case"court-tennis":{u.push({points:V(0,0,d(11.885),p(5.485)),closed:!0,fill:"#2b5f99"});for(let f of[-1,1])u.push({points:[{x:-d(11.885),y:f*p(4.115)},{x:d(11.885),y:f*p(4.115)}],closed:!1}),u.push({points:[{x:f*d(6.4),y:-p(4.115)},{x:f*d(6.4),y:p(4.115)}],closed:!1});u.push({points:[{x:-d(6.4),y:0},{x:d(6.4),y:0}],closed:!1}),u.push({points:[{x:0,y:-p(6.4)},{x:0,y:p(6.4)}],closed:!1,ink:"#d1d5db"});break}case"ring-boxing":{u.push({points:V(0,0,d(3.05),p(3.05)),closed:!0});let P=[[-1,-1,"#c53030"],[1,1,"#2b6cb0"],[1,-1,"#e2e8f0"],[-1,1,"#e2e8f0"]];for(let[E,w,x]of P)u.push({points:V(E*d(3.05),w*p(3.05),d(.3),p(.3)),closed:!0,fill:x,ink:x});break}case"track-motorsport":{for(let P of[-1,1])u.push({points:[{x:-a,y:P*p(7)},{x:a,y:P*p(7)}],closed:!1});let b=90;u.push({points:V(d(b),0,d(.6),p(7)),closed:!0,fill:"#f1f5f9"});for(let P=0;P<10;P++){let E=b-8*(P+1),w=P%2?2.6:-2.6;u.push({points:[{x:d(E),y:p(w-1.3)},{x:d(E),y:p(w+1.3)}],closed:!1})}break}default:return[]}return u.map(f=>({...f,points:f.points.map(b=>Mt(b.x,b.y,l,h,n,i))}))}function Ai(e){if(e.role!=="stage"||!le(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(c=>c.x),i=e.points.map(c=>c.y),o=Math.min(...n),r=Math.max(...n),s=Math.min(...i),l=Math.max(...i),h=Math.max(1,r-o),a=Math.max(1,l-s);t={cx:o+h/2,cy:s+a/2,width:h,height:a}}return t?Gn({kind:e.stageKind,...t}):[]}function Xn(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.kind==="polygon"?ie(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,i=e.width,o=e.height;return[{x:t,y:n},{x:t+i,y:n},{x:t+i,y:n+o},{x:t,y:n+o}]}function Bn(e,t,n){let i=n*Math.PI/180,o=Math.cos(i),r=Math.sin(i),s=e.x-t.x,l=e.y-t.y;return{x:t.x+s*o-l*r,y:t.y+s*r+l*o}}function Pt(e){let t=Xn(e);if(!t||t.length<2)return null;let n=e.rotation??0,i=Math.abs(n)<1e-6?t:t.map(h=>Bn(h,{x:t.reduce((a,c)=>a+c.x,0)/t.length,y:t.reduce((a,c)=>a+c.y,0)/t.length},n)),o=1/0,r=1/0,s=-1/0,l=-1/0;for(let h of i)o=Math.min(o,h.x),r=Math.min(r,h.y),s=Math.max(s,h.x),l=Math.max(l,h.y);return!Number.isFinite(o)||s-o<1e-6||l-r<1e-6?null:{minX:o,minY:r,maxX:s,maxY:l}}var Yn=5,zn=3,Wn=.92,$n=1.9,qn=2,Qn=.6,Jn=1,Zn=.06;function eo(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?_e:le(e.stageKind)?Zn:Jn}function vt(e){let t=1/0,n=1/0,i=-1/0,o=-1/0,r=-1/0;for(let s of ke(e)){let l=s.baseHeightM??0;for(let h of s.objects){if(h.type!=="shape"||h.role!=="stage")continue;let a=Pt(h);a&&(t=Math.min(t,a.minX),n=Math.min(n,a.minY),i=Math.max(i,a.maxX),o=Math.max(o,a.maxY),r=Math.max(r,l+eo(h)))}}return!Number.isFinite(t)||!Number.isFinite(r)?null:{minX:t,minY:n,maxX:i,maxY:o,deckTopM:r}}function to(e,t,n,i){let o=1/0,r=1/0,s=-1/0,l=-1/0;for(let d of e)Number.isFinite(d.eyeHeightM)&&(o=Math.min(o,d.x),s=Math.max(s,d.x),r=Math.min(r,d.y),l=Math.max(l,d.y));if(!Number.isFinite(o))return null;let h=o*t,a=r*t,c=Math.max(1,Math.ceil((s-o)*t/n)+1),u=Math.max(1,Math.ceil((l-r)*t/n)+1),m=new Float64Array(c*u).fill(-1/0);for(let d of e){if(!Number.isFinite(d.eyeHeightM))continue;let p=d.eyeHeightM-J,f=Math.min(c-1,Math.max(0,Math.floor((d.x*t-h)/n))),P=Math.min(u-1,Math.max(0,Math.floor((d.y*t-a)/n)))*c+f,E=p+i;E>m[P]&&(m[P]=E)}return{cellM:n,minX:h,minY:a,cols:c,rows:u,top:m}}function no(e,t,n){let i=Math.floor((t-e.minX)/e.cellM),o=Math.floor((n-e.minY)/e.cellM);return i<0||o<0||i>=e.cols||o>=e.rows?-1/0:e.top[o*e.cols+i]}function Et(e,t,n={}){let i=new Map;if(!t||!e.length)return i;let o=n.metresPerChartUnit??Q,r=n.cellM??Qn,s=n.chairBackM??Wn,l=n.selfRowSkipM??qn,h=n.clearThreshold??.9,a=n.partialThreshold??.25,c=Math.max(1,n.columns??Yn),u=Math.max(1,n.rows??zn),m=to(e,o,r,s);if(!m)return i;let d=(t.maxX-t.minX)*o,p=(t.maxY-t.minY)*o,f=d>=p,b=(t.minX+t.maxX)/2*o,P=(t.minY+t.maxY)/2*o,E=[];for(let x=0;x<c;x++){let S=(x+.5)/c-.5,y=f?b+S*d:b,g=f?P:P+S*p;for(let v=0;v<u;v++){let M=t.deckTopM+(u===1?0:v/(u-1)*$n);E.push({x:y,y:g,z:M})}}let w=r/2;for(let x of e){if(!Number.isFinite(x.eyeHeightM))continue;let S=x.x*o,y=x.y*o,g=x.eyeHeightM,v=0,M=1/0;for(let T of E){let I=T.x-S,C=T.y-y,k=Math.hypot(I,C);if(!(k>l)){v++;continue}let N=I/k,A=C/k,L=0;for(let H=l;H<k;H+=w){let Y=no(m,S+N*H,y+A*H);if(!(!Number.isFinite(Y)||Y>=g)&&Y>g+(T.z-g)*H/k){L=H;break}}L?M=Math.min(M,L):v++}let _=v/E.length;_>=h||i.set(x.id,{seatId:x.id,mark:_<a?"obstructedView":"restrictedView",visibleFraction:_,totalRays:E.length,atDistanceM:Number.isFinite(M)?M:0})}return i}function It(e,t){if(!t.size)return 0;let n=0;for(let i of e){let o=t.get(i.id);if(!o)continue;let r=i.commercial;r?.restrictedView!==void 0||r?.obstructedView!==void 0||(i.commercial={...r,[o.mark]:!0},n++)}return n}function Oe(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var fe=Math.PI/180,oo=9,ee=16;function Re(e,t,n,i){let o=n*fe,r=Math.cos(o),s=Math.sin(o);return{x:i.x+e*r-t*s,y:i.y+e*s+t*r}}function he(e){let{seatCount:t,seatSpacing:n,curve:i,rotation:o,origin:r}=e,s=[];if(e.path)return qe(e.path,t);if(t<=1)return t===1&&s.push({x:r.x,y:r.y}),s;if(i===0){for(let a=0;a<t;a++)s.push(Re(a*n,0,o,r));return s}let l=i/(t-1)*fe,h=n/(2*Math.sin(Math.abs(l)/2));for(let a=0;a<t;a++){let c=a*l,u=h*Math.sin(c),m=-h+h*Math.cos(c);s.push(Re(u,m,o,r))}return s}function Te(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function ir(e){let t=new Set((e.overrides??[]).filter(n=>n.skip&&Number.isInteger(n.index)&&n.index>=0&&n.index<e.seatCount).map(n=>n.index));return Math.max(0,e.seatCount-t.size)}function io(e,t){let n=Te(e);return he(e).map((i,o)=>{let r=n.get(o),s=Oe(r),l=Ne(e,o,r),h={...e.commercial,...r?.commercial};return{index:o,x:i.x+(r?.dx??0),y:i.y+(r?.dy??0),label:l,displayLabel:me(e,o,t,r),categoryKey:r?.categoryKey??e.categoryKey,skipped:!!r?.skip,accessible:s.length>0,accessibility:s,wheelchairSpaceType:r?.wheelchairSpaceType,commercial:Object.values(h).some(a=>a!==void 0&&a!==!1&&a!=="")?h:void 0,glyph:r?.glyph,viewUrl:r?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:r?.viewFromSeatUrl?r.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:r?.labelStyle??e.seatLabelStyle}})}function ro(e){let t=[];for(let n of io(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 so(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(r=>t.includes(r)),i={top:0,bottom:0,left:0,right:0};if(!n.length)return i;let o=Math.max(0,Math.round(e.seatCount));for(let r=0;r<o;r++)i[n[r%n.length]]+=1;return i}function kt(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let i=new Map((e.overrides??[]).map(c=>[c.index,c])),o=(c,u,m,d)=>{let p=i.get(c),f=Oe(p),b=p?.label??Le(e,c);return{index:c,label:b,displayLabel:p?.displayLabel??je(e,c),x:u+(p?.dx??0),y:m+(p?.dy??0),categoryKey:p?.categoryKey??e.categoryKey,skipped:!!p?.skip,accessible:f.length>0,accessibility:f,wheelchairSpaceType:p?.wheelchairSpaceType,commercial:p?.commercial,glyph:p?.glyph,viewUrl:p?.viewFromSeatUrl,viewMeta:p?.viewFromSeatUrl?p.viewFromSeatMeta:void 0,labelStyle:p?.labelStyle,...d?{side:d}:{}}};if(e.shape==="round"){let c=(e.radius??40)+ee,u=e.rotation*fe,m=Math.max(0,Math.min(360,e.seatArc??360));if(m>=360||n===1){for(let b=0;b<n;b++){let P=u+b/n*2*Math.PI;t.push(o(b,e.center.x+c*Math.cos(P),e.center.y+c*Math.sin(P)))}return t}let d=m*fe,p=(2*Math.PI-d)/2,f=u+p;for(let b=0;b<n;b++){let P=f+b/(n-1)*d;t.push(o(b,e.center.x+c*Math.cos(P),e.center.y+c*Math.sin(P)))}return t}let r=e.width??80,s=e.height??50,l=so(e),h=["top","bottom","left","right"],a=0;for(let c of h){let u=l[c];for(let m=0;m<u;m++){let d,p;c==="top"?(d=-r/2+(m+.5)*r/u,p=-s/2-ee):c==="bottom"?(d=-r/2+(m+.5)*r/u,p=s/2+ee):c==="left"?(d=-r/2-ee,p=-s/2+(m+.5)*s/u):(d=r/2+ee,p=-s/2+(m+.5)*s/u);let f=Re(d,p,e.rotation,e.center);t.push(o(a++,f.x,f.y,c))}}return t}function rr(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):kt(e).filter(t=>!t.skipped).length}function ao(e){return kt(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 co(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 Z(e,t){let n=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){let r=t[i].x,s=t[i].y,l=t[o].x,h=t[o].y;s>e.y!=h>e.y&&e.x<(l-r)*(e.y-s)/(h-s)+r&&(n=!n)}return n}function we(e,t){return t.some((n,i)=>{let o=t[(i+1)%t.length],r=(e.y-n.y)*(o.x-n.x)-(e.x-n.x)*(o.y-n.y);if(Math.abs(r)>1e-7)return!1;let s=(e.x-n.x)*(o.x-n.x)+(e.y-n.y)*(o.y-n.y),l=(o.x-n.x)**2+(o.y-n.y)**2;return s>=-1e-7&&s<=l+1e-7})}function G(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function re(e,t,n){return Z(e,t)&&!G(n).some(i=>Z(e,i)||we(e,i))}function sr(e,t){return nt(e,t).point}function de(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;return{x:t/e.length,y:n/e.length}}function Ot(e){switch(e.type){case"row":{let t=he(e),n=Te(e),i=0,o=0,r=0;for(let s=0;s<t.length;s++){let l=n.get(s);l?.skip||(i+=t[s].x+(l?.dx??0),o+=t[s].y+(l?.dy??0),r++)}return r?{x:i/r,y:o/r}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return de(e.points);case"section":return de(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?de(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 wt(e,t){return e.length===t.length&&e.every((n,i)=>n.x===t[i].x&&n.y===t[i].y)}function lo(e,t){if(e.type!=="gaArea"||!wt(e.points,t.outline))return!1;let n=G(e.holes),i=G(t.holes);return n.length===i.length&&n.every((o,r)=>wt(o,i[r]))}function uo(e,t,n=e.filter(o=>o.type==="section"),i=Ot(t)){let o="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(o?n.find(s=>(s.logicalSectionId??s.id)===o&&(lo(t,s)||re(i,s.outline,s.holes))):void 0)??n.find(s=>re(i,s.outline,s.holes))??(t.type==="row"&&fo(t)?ho(t,n):void 0)}function fo(e){return(e.overrides??[]).some(t=>t.skip===!0)}function ho(e,t){let n=he(e),i=Te(e),o,r=0;for(let s of t){let l=0;for(let h=0;h<n.length;h++){let a=i.get(h);if(a?.skip)continue;let c={x:n[h].x+(a?.dx??0),y:n[h].y+(a?.dy??0)};re(c,s.outline,s.holes)&&l++}l>r&&(o=s,r=l)}return o}function ke(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 ar(e,t){let n=ke(e);return(t?n.find(i=>i.id===t):n[0])?.objects??[]}function mo(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function po(e,t,n){let i=r=>({x:r.x+t,y:r.y+n}),o=r=>r.map(i);switch(e.type){case"row":return{...e,origin:i(e.origin)};case"table":case"booth":return{...e,center:i(e.center)};case"gaArea":return{...e,points:o(e.points),...e.holes?{holes:G(e.holes).map(o)}:{}};case"section":return{...e,outline:o(e.outline),...e.outlinePath?{outlinePath:ct(e.outlinePath,t,n)}:{},...e.holes?{holes:G(e.holes).map(o)}:{}};case"text":return{...e,position:i(e.position)};case"shape":return{...e,...e.points?{points:o(e.points)}:{},...e.holes?{holes:G(e.holes).map(o)}:{},...e.x!=null?{x:e.x+t}:{},...e.y!=null?{y:e.y+n}:{}};case"decorImage":return{...e,x:e.x+t,y:e.y+n}}}function cr(e,t=900){if(!e.floors||e.floors.length<2)return e;let n=[];return e.floors.forEach((i,o)=>{let r=-o*t;for(let s of i.objects)n.push(r===0?s:po(s,0,r))}),{...e,objects:n,floors:void 0}}function Ct(e,t,n,i,o,r,s,l,h){let a=[],c=e.filter(f=>f.type==="section"),u=lt(e),m=f=>!f?.eventConfigurationId||f.eventConfigurationId===i&&(f.eventConfigurationVersion===void 0||f.eventConfigurationVersion===h),d=f=>De(f,{activeConfigurationId:i,activeConfigurationVersion:h,activeBasisSha256:o,now:l}),p=(f,b)=>d(f)?{...f,coverage:b}:void 0;for(let f of e){let b=[];if(f.type==="row"?b=ro(f):f.type==="table"?b=ao(f):f.type==="booth"&&(b=co(f)),!b.length)continue;for(let S of b)S.viewUrl&&!m(S.viewMeta)&&(S.viewUrl=void 0,S.viewMeta=void 0);if(f.type==="row"){let S=u.get(f.id);if(S){let y=new Map((f.overrides??[]).map(g=>[g.index,g]));for(let g of b){let v=Number(g.id.slice(g.id.lastIndexOf(":")+1));if(!Number.isInteger(v))continue;g.logicalRowId=S.groupId,g.logicalSeatIndex=S.adjacencyOffset+v,y.get(v)?.displayLabel||(g.displayLabel=me(f,v,S)),!g.viewUrl&&S.viewFromSeatUrl&&m(S.viewFromSeatMeta)&&(g.viewUrl=S.viewFromSeatUrl,g.viewMeta=S.viewFromSeatMeta);let M=y.get(v)?.confidenceEvidence;g.confidenceEvidence=p(M,"exact-seat")??p(f.confidenceEvidence,"row-representative")??p(S.confidenceEvidence,"row-representative")}}}let P=uo(e,f,c,f.type==="row"?de(b):Ot(f)),E=P?.viewFromSeatUrl,x=(P?.zone?t?.find(S=>S.id===P.zone):void 0)?.focalPoint??n;for(let S of b){if(!S.confidenceEvidence){let y=Number(S.id.slice(S.id.lastIndexOf(":")+1)),g=(f.type==="row"||f.type==="table")&&Number.isInteger(y)?f.overrides?.find(v=>v.index===y)?.confidenceEvidence:void 0;S.confidenceEvidence=p(g,"exact-seat")??(f.type==="row"?p(f.confidenceEvidence,"row-representative"):void 0)}S.confidenceEvidence??=p(P?.confidenceEvidence,"section-representative")??(s?p(s.evidence,s.coverage):void 0),!S.viewUrl&&E&&m(P?.viewFromSeatMeta)&&(S.viewUrl=E,S.viewMeta=P?.viewFromSeatMeta),!S.viewUrl&&r&&m(r.meta)&&(S.viewUrl=r.url,S.viewMeta=r.meta),P&&(S.sectionId=P.logicalSectionId??P.id),P?.zone&&(S.zoneId=P.zone),x&&(S.focalPoint={...x})}a.push(...b)}return a}function lr(e,t={}){if(e.floors?.length){let i=[];for(let o of e.floors){let r=o.focalPoint??e.focalPoint,s=o.viewFromSeatUrl?{url:o.viewFromSeatUrl,meta:o.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,l=o.confidenceEvidence?{evidence:o.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,h=Ct(o.objects,e.zones,r,e.eventConfigurationId,e.confidenceBasisSha256,s,l,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&_t(o.objects,o.focalPoint??e.focalPoint,o.baseHeightM??0,h);for(let a of h)a.floorId=o.id;for(let a of h)i.push(a)}return i}let n=Ct(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&&_t(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),yo(e,n,t)}function yo(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||It(t,Et(t,vt(e))),t}function _t(e,t,n,i){let o=e.filter(u=>u.type==="section"),r=n>0||o.some(u=>u.height!==void 0||u.rake!==void 0||(u.elevation??0)>0);if(!o.length||!r||!t){for(let u of i)u.eyeHeightM=n+J;return}let s=new Array(i.length),l=new Map;for(let u of o)l.has(u.id)||l.set(u.id,u);let h=new Map,a=new Map;for(let u=0;u<i.length;u++){let m=i[u],p=(m.sectionId?l.get(m.sectionId)??o.find(b=>b.logicalSectionId===m.sectionId&&re({x:m.x,y:m.y},b.outline,b.holes)):void 0)??o.find(b=>re({x:m.x,y:m.y},b.outline,b.holes))??null;if(s[u]=p,!p)continue;h.has(p.id)||h.set(p.id,dt(p,{floorBaseHeightM:n}));let f=a.get(p.id);f?f.push(u):a.set(p.id,[u])}let c=new Array(i.length).fill(void 0);for(let[u,m]of a){let d=h.get(u);if(!d)continue;let p=d.rake>0?Math.tan(d.rake*Math.PI/180):0,f=pt(u,i,m,t);for(let b of f.rows){let P=b.blockDepth*Q*p,E=d.height+P;for(let w of b.seatIndices)c[w]=E}}for(let u=0;u<i.length;u++){let m=i[u],d=s[u];if(!d){m.eyeHeightM=n+J;continue}let p=h.get(d.id);m.eyeHeightM=(c[u]??p.height)+J}}var ue=40;function ur(e,t){let n=t?.freeText==="exclude",i=1/0,o=1/0,r=-1/0,s=-1/0,l=(a,c)=>{a<i&&(i=a),c<o&&(o=c),a>r&&(r=a),c>s&&(s=c)},h=a=>{if(Array.isArray(a))for(let c of a)!c||typeof c!="object"||l(c.x,c.y)};for(let a of mo(e))if(a.type==="row"){let c=new Map((a.overrides??[]).map(u=>[u.index,u]));he(a).forEach((u,m)=>{let d=c.get(m);d?.skip||l(u.x+(d?.dx??0),u.y+(d?.dy??0))})}else if(a.type==="gaArea")h(a.points);else if(a.type==="section")h(a.outline);else if(a.type==="decorImage")l(a.x,a.y),l(a.x+a.width,a.y+a.height);else if(a.type==="shape")a.points&&a.points.length?h(ie(a)):a.x!=null&&a.y!=null&&a.width!=null&&a.height!=null&&(l(a.x,a.y),l(a.x+a.width,a.y+a.height));else if(a.type==="table"){let c=ee+oo,u=a.shape==="round"?(a.radius??40)+c:Math.max((a.width??80)/2,(a.height??50)/2)+c;l(a.center.x-u,a.center.y-u),l(a.center.x+u,a.center.y+u)}else if(a.type==="booth"){let c=Math.max(a.width,a.height)/2;l(a.center.x-c,a.center.y-c),l(a.center.x+c,a.center.y+c)}else if(a.type==="text"){if(n)continue;let c=Be(a);l(a.position.x,a.position.y),l(a.position.x+c.width,a.position.y+c.height)}for(let a of[e.referenceImage,e.backgroundImage]){if(!a)continue;let{center:c,width:u}=a;if(!c||!Number.isFinite(c.x)||!Number.isFinite(c.y)||!Number.isFinite(u))continue;let m=u*3/4;l(c.x-u/2,c.y-m/2),l(c.x+u/2,c.y+m/2)}if(!isFinite(i)){let a=e.focalPoint??{x:0,y:0};return{x:a.x-200,y:a.y-200,width:400,height:400}}return{x:i-ue,y:o-ue,width:r-i+ue*2,height:s-o+ue*2}}export{bo as a,Lt as b,Fe as c,jt as d,xo as e,Dt as f,So as g,te as h,pe as i,vo as j,Eo as k,Io as l,wo as m,Co as n,_o as o,ko as p,Ro as q,To as r,Ao as s,No as t,Lo as u,jo as v,Do as w,Fo as x,Vo as y,Be as z,Uo as A,Ko as B,zt as C,Go as D,ge as E,Yo as F,qe as G,zo as H,Wo as I,$t as J,et as K,qo as L,nt as M,Qt as N,Jo as O,ni as P,st as Q,at as R,ct as S,tn as T,oi as U,nn as V,rn as W,ii as X,an as Y,Me as Z,ri as _,mi as $,gi as aa,Rn as ba,ie as ca,xi as da,Si as ea,Mi as fa,ai as ga,ci as ha,li as ia,lt as ja,Q as ka,Ee as la,dn as ma,di as na,fn as oa,ut as pa,Pe as qa,hn as ra,mn as sa,pn as ta,J as ua,dt as va,ht as wa,xn as xa,pt as ya,Ei as za,An as Aa,Ii as Ba,wi as Ca,Ci as Da,_i as Ea,ki as Fa,Oi as Ga,Vn as Ha,Ri as Ia,Kn as Ja,Ti as Ka,Ai as La,Oe as Ma,ee as Na,he as Oa,ir as Pa,io as Qa,ro as Ra,so as Sa,kt as Ta,rr as Ua,ao as Va,co as Wa,Z as Xa,we as Ya,G as Za,re as _a,sr as $a,Ot as ab,uo as bb,ke as cb,ar as db,mo as eb,po as fb,cr as gb,lr as hb,ur as ib};
|