@seatlayer/core 0.61.0 → 0.63.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.
Files changed (67) hide show
  1. package/dist/{categoryInventory-B-0p5PBr.d.ts → categoryInventory-C3RogGHF.d.ts} +1 -1
  2. package/dist/{categoryInventory-DjFHXtp6.d.cts → categoryInventory-DEgsjxCC.d.cts} +1 -1
  3. package/dist/{chunk-IZTHA3X2.js → chunk-DFNYIQY3.js} +1 -1
  4. package/dist/chunk-GXMGOWKB.js +1 -0
  5. package/dist/chunk-K7GN3IOW.js +1 -0
  6. package/dist/{chunk-HHM3PB66.js → chunk-LVUGIKHG.js} +1 -1
  7. package/dist/{chunk-VOJMGPDK.js → chunk-QHWOX6PN.js} +1 -1
  8. package/dist/chunk-RZLIIQDP.js +1 -0
  9. package/dist/{chunk-XU73MULJ.js → chunk-UCLIUNHN.js} +1 -1
  10. package/dist/chunk-UL5OIGIF.js +1 -0
  11. package/dist/{chunk-ATFAQDPR.js → chunk-YPVY3Z5S.js} +1 -1
  12. package/dist/core/chart-ops/index.cjs +1 -1
  13. package/dist/core/chart-ops/index.d.cts +9 -5
  14. package/dist/core/chart-ops/index.d.ts +9 -5
  15. package/dist/core/chart-ops/index.js +1 -1
  16. package/dist/core/inventory/index.cjs +1 -1
  17. package/dist/core/inventory/index.d.cts +4 -4
  18. package/dist/core/inventory/index.d.ts +4 -4
  19. package/dist/core/inventory/index.js +1 -1
  20. package/dist/core/layout/index.cjs +1 -1
  21. package/dist/core/layout/index.d.cts +4 -4
  22. package/dist/core/layout/index.d.ts +4 -4
  23. package/dist/core/layout/index.js +1 -1
  24. package/dist/core/quality/index.cjs +1 -1
  25. package/dist/core/quality/index.d.cts +12 -5
  26. package/dist/core/quality/index.d.ts +12 -5
  27. package/dist/core/quality/index.js +1 -1
  28. package/dist/core/render-assets/index.cjs +1 -1
  29. package/dist/core/render-assets/index.d.cts +88 -2
  30. package/dist/core/render-assets/index.d.ts +88 -2
  31. package/dist/core/render-assets/index.js +1 -1
  32. package/dist/core/seatConfidence.d.cts +1 -1
  33. package/dist/core/seatConfidence.d.ts +1 -1
  34. package/dist/core/sections/index.cjs +1 -1
  35. package/dist/core/sections/index.d.cts +5 -5
  36. package/dist/core/sections/index.d.ts +5 -5
  37. package/dist/core/sections/index.js +1 -1
  38. package/dist/index.cjs +1 -1
  39. package/dist/index.d.cts +34 -10
  40. package/dist/index.d.ts +34 -10
  41. package/dist/index.js +1 -1
  42. package/dist/{labeling-iVwhgoip.d.cts → labeling-DRFC35VK.d.cts} +5 -2
  43. package/dist/{labeling-BPCTQfDG.d.ts → labeling-DTHo03rf.d.ts} +5 -2
  44. package/dist/{layout-D-R46h1m.d.ts → layout-BXB8Rf4n.d.ts} +10 -4
  45. package/dist/{layout-Vk2ZGdMS.d.cts → layout-DRB0-NGc.d.cts} +10 -4
  46. package/dist/{renderedQuality-CsXNQCCH.d.ts → renderedQuality-BjSBiqkN.d.ts} +1 -1
  47. package/dist/{renderedQuality-h9RvUWMo.d.cts → renderedQuality-DK7IGCju.d.cts} +1 -1
  48. package/dist/{renderer-QnB3a1yh.d.cts → renderer-BNzVBOBW.d.cts} +11 -1
  49. package/dist/{renderer-Bo9JzqMA.d.ts → renderer-Bhc5CgOS.d.ts} +11 -1
  50. package/dist/{sections-9_Ka3i-z.d.ts → sections-BrQV1WzI.d.ts} +1 -1
  51. package/dist/{sections-Dmjtj1BQ.d.cts → sections-D2bxgVgg.d.cts} +1 -1
  52. package/dist/{segmentedRowModel-s157HmRp.d.cts → segmentedRowModel-BQYSdf7k.d.cts} +1 -1
  53. package/dist/{segmentedRowModel-CO6Jogaa.d.ts → segmentedRowModel-Cl3X8SKt.d.ts} +1 -1
  54. package/dist/{ticketRestrictions-EJTEWPGN.d.ts → ticketRestrictions-B9WkJ6YG.d.ts} +2 -2
  55. package/dist/{ticketRestrictions-DetdPbsL.d.cts → ticketRestrictions-QBvY3Zi7.d.cts} +2 -2
  56. package/dist/{types-Db9rXT14.d.cts → types-DmgX-iuD.d.cts} +48 -1
  57. package/dist/{types-Db9rXT14.d.ts → types-DmgX-iuD.d.ts} +48 -1
  58. package/dist/view3d/crossfade/panorama.d.cts +1 -1
  59. package/dist/view3d/crossfade/panorama.d.ts +1 -1
  60. package/dist/view3d/index.cjs +102 -38
  61. package/dist/view3d/index.d.cts +4 -2
  62. package/dist/view3d/index.d.ts +4 -2
  63. package/dist/view3d/index.js +106 -42
  64. package/package.json +1 -1
  65. package/dist/chunk-CNCFI5RT.js +0 -1
  66. package/dist/chunk-P2NJ6UO6.js +0 -1
  67. package/dist/chunk-VI2CLV3Y.js +0 -1
@@ -1,4 +1,4 @@
1
- import { C as ChartDoc, R as RowObject, T as TableObject } from './types-Db9rXT14.js';
1
+ import { C as ChartDoc, R as RowObject, T as TableObject } from './types-DmgX-iuD.js';
2
2
 
3
3
  /**
4
4
  * A category is a commercial definition for exactly one kind of inventory.
@@ -1,4 +1,4 @@
1
- import { C as ChartDoc, R as RowObject, T as TableObject } from './types-Db9rXT14.cjs';
1
+ import { C as ChartDoc, R as RowObject, T as TableObject } from './types-DmgX-iuD.cjs';
2
2
 
3
3
  /**
4
4
  * A category is a commercial definition for exactly one kind of inventory.
@@ -1 +1 @@
1
- import{x as X}from"./chunk-CNCFI5RT.js";var Y=9;function E(t){if(t.kind==="circle")return{hx:t.r,hy:t.r};let e=t.width/2,o=t.height/2,n=t.rotation??0;if(!n)return{hx:e,hy:o};let r=n*Math.PI/180,s=Math.abs(Math.cos(r)),c=Math.abs(Math.sin(r));return{hx:e*s+o*c,hy:e*c+o*s}}function B(t,e,o){let n=e-t.seat.x,r=o-t.seat.y;if(t.shape.kind==="circle")return n*n+r*r<=t.shape.r*t.shape.r;let s=t.shape.rotation??0,c=n,d=r;if(s){let u=-s*Math.PI/180,m=Math.cos(u),y=Math.sin(u);c=n*m-r*y,d=n*y+r*m}return Math.abs(c)<=t.shape.width/2&&Math.abs(d)<=t.shape.height/2}function L(t,e,o,n,r){if(t.shape.kind==="circle"){let h=Math.min(Math.max(t.seat.x,e),n),l=Math.min(Math.max(t.seat.y,o),r),x=t.seat.x-h,p=t.seat.y-l;return x*x+p*p<=t.shape.r*t.shape.r}let s=t.shape.rotation??0;if(!s)return t.seat.x-t.hx<=n&&t.seat.x+t.hx>=e&&t.seat.y-t.hy<=r&&t.seat.y+t.hy>=o;let c=s*Math.PI/180,d=Math.cos(c),u=Math.sin(c),m=t.shape.width/2,y=t.shape.height/2,f=[[-m,-y],[m,-y],[m,y],[-m,y]].map(([h,l])=>[t.seat.x+h*d-l*u,t.seat.y+h*u+l*d]),P=[[e,o],[n,o],[n,r],[e,r]],A=[[1,0],[0,1],[d,u],[-u,d]];for(let[h,l]of A){let x=1/0,p=-1/0;for(let[I,D]of f){let a=I*h+D*l;a<x&&(x=a),a>p&&(p=a)}let M=1/0,S=-1/0;for(let[I,D]of P){let a=I*h+D*l;a<M&&(M=a),a>S&&(S=a)}if(p<M||S<x)return!1}return!0}function j(t,e={}){let o=e.seatRadius??Y,n=t.length,r=new Array(n),s=1/0,c=1/0,d=-1/0,u=-1/0,m=0;for(let a=0;a<n;a++){let i=t[a],R=e.shapeOf?.(i)??{kind:"circle",r:o},{hx:w,hy:b}=E(R);r[a]={seat:i,shape:R,hx:w,hy:b},i.x-w<s&&(s=i.x-w),i.y-b<c&&(c=i.y-b),i.x+w>d&&(d=i.x+w),i.y+b>u&&(u=i.y+b),w>m&&(m=w),b>m&&(m=b)}n===0&&(s=0,c=0,d=0,u=0);let y=m>0?m*4:1,f=Math.max(d-s,0),P=Math.max(u-c,0),A=Math.max(64,e.maxCells??n*4),h=y,l=Math.max(1,Math.ceil(f/h)||1),x=Math.max(1,Math.ceil(P/h)||1);for(;l*x>A&&(l>1||x>1);)h*=2,l=Math.max(1,Math.ceil(f/h)||1),x=Math.max(1,Math.ceil(P/h)||1);let p=l*x,M=new Int32Array(p+1),S=0;for(let a=0;a<n;a++){let i=r[a],R=X(Math.floor((i.seat.x-i.hx-s)/h),0,l-1),w=X(Math.floor((i.seat.x+i.hx-s)/h),0,l-1),b=X(Math.floor((i.seat.y-i.hy-c)/h),0,x-1),k=X(Math.floor((i.seat.y+i.hy-c)/h),0,x-1);for(let C=b;C<=k;C++)for(let g=R;g<=w;g++)M[C*l+g+1]++,S++}for(let a=0;a<p;a++)M[a+1]+=M[a];let I=new Int32Array(S),D=M.slice(0,p);for(let a=0;a<n;a++){let i=r[a],R=X(Math.floor((i.seat.x-i.hx-s)/h),0,l-1),w=X(Math.floor((i.seat.x+i.hx-s)/h),0,l-1),b=X(Math.floor((i.seat.y-i.hy-c)/h),0,x-1),k=X(Math.floor((i.seat.y+i.hy-c)/h),0,x-1);for(let C=b;C<=k;C++)for(let g=R;g<=w;g++){let v=C*l+g;I[D[v]++]=a}}return{seats:t,entries:r,minX:s,minY:c,cell:h,cols:l,rows:x,cellStart:M,items:I,stamp:new Int32Array(n),epoch:0}}function q(t,e,o={}){let{cols:n,rows:r,cell:s,minX:c,minY:d,cellStart:u,items:m,entries:y}=t,f=Math.floor((e.x-c)/s),P=Math.floor((e.y-d)/s);if(f<0||P<0||f>=n||P>=r)return null;let A=P*n+f,h=u[A+1],l=-1,x=1/0;for(let p=u[A];p<h;p++){let M=m[p],S=y[M];if(o.filter&&!o.filter(S.seat.id,S.seat)||!B(S,e.x,e.y))continue;let I=e.x-S.seat.x,D=e.y-S.seat.y,a=I*I+D*D;(a<x||a===x&&M<l)&&(x=a,l=M)}return l<0?null:y[l].seat.id}function F(t,e,o,n={}){if(!(o>0))return null;let{cols:r,rows:s,cell:c,minX:d,minY:u,cellStart:m,items:y,entries:f}=t,P=Math.max(0,Math.floor((e.x-o-d)/c)),A=Math.min(r-1,Math.floor((e.x+o-d)/c)),h=Math.max(0,Math.floor((e.y-o-u)/c)),l=Math.min(s-1,Math.floor((e.y+o-u)/c));if(P>A||h>l)return null;let x=-1,p=o*o,M=t.stamp,S=++t.epoch;for(let I=h;I<=l;I++){let D=I*r;for(let a=P;a<=A;a++){let i=D+a,R=m[i+1];for(let w=m[i];w<R;w++){let b=y[w];if(M[b]===S)continue;M[b]=S;let k=f[b];if(n.filter&&!n.filter(k.seat.id,k.seat))continue;let C=e.x-k.seat.x,g=e.y-k.seat.y,v=C*C+g*g;(v<p||v===p&&b<x)&&(p=v,x=b)}}}return x<0?null:f[x].seat.id}function U(t,e,o={}){let n=Math.min(e.x,e.x+e.width),r=Math.max(e.x,e.x+e.width),s=Math.min(e.y,e.y+e.height),c=Math.max(e.y,e.y+e.height),d=o.mode??"center",{cols:u,rows:m,cell:y,minX:f,minY:P,cellStart:A,items:h,entries:l}=t,x=Math.max(0,Math.floor((n-f)/y)),p=Math.min(u-1,Math.floor((r-f)/y)),M=Math.max(0,Math.floor((s-P)/y)),S=Math.min(m-1,Math.floor((c-P)/y));if(x>p||M>S)return[];let I=[],D=t.stamp,a=++t.epoch;for(let i=M;i<=S;i++){let R=i*u;for(let w=x;w<=p;w++){let b=R+w,k=A[b+1];for(let C=A[b];C<k;C++){let g=h[C];if(D[g]===a)continue;D[g]=a;let v=l[g];if(o.filter&&!o.filter(v.seat.id,v.seat))continue;(d==="center"?v.seat.x>=n&&v.seat.x<=r&&v.seat.y>=s&&v.seat.y<=c:L(v,n,s,r,c))&&I.push(g)}}}return I.sort((i,R)=>i-R),I.map(i=>l[i].seat.id)}function _(t){let e=t.cols*t.rows,o=0,n=0;for(let s=0;s<e;s++){let c=t.cellStart[s+1]-t.cellStart[s];c>0&&o++,c>n&&(n=c)}let r=t.items.length;return{cell:t.cell,cols:t.cols,rows:t.rows,cells:e,occupiedCells:o,refs:r,maxPerCell:n,meanPerOccupiedCell:o?r/o:0}}function N(t,e=0){let o=Math.max(1,t.width,t.height),n={x:t.x+t.width/2,y:t.y+t.height/2},r=o*1.55,s=Math.max(o*.82,Math.max(0,e)+o*.45);return{target:n,distance:r,height:s,focalLength:Math.hypot(r,s),yawRad:-8*Math.PI/180}}function O(t,e,o=0){let n=e.x-t.target.x,r=e.y-t.target.y,s=Math.cos(t.yawRad),c=Math.sin(t.yawRad),d=n*s-r*c,m=n*c+r*s-t.distance,y=o-t.height,f=Math.hypot(t.distance,t.height),P=(-t.distance*m-t.height*y)/f,A=(-t.height*m+t.distance*y)/f,h=Math.max(f*.08,P),l=t.focalLength/h;return{x:t.target.x+d*l,y:t.target.y-A*l,depth:h,scale:l}}function W(t,e){return{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function Z(t){let e=t.a*t.d-t.b*t.c;if(!Number.isFinite(e)||Math.abs(e)<1e-9)throw new Error("perspective projection produced a singular affine");let o=t.d/e,n=-t.b/e,r=-t.c/e,s=t.a/e;return{a:o,b:n,c:r,d:s,e:-(o*t.e+r*t.f),f:-(n*t.e+s*t.f)}}function z(t,e){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}function G(t,e,o=()=>0){let n=O(t,e,o(e)),r={x:e.x+1,y:e.y},s={x:e.x,y:e.y+1},c=O(t,r,o(r)),d=O(t,s,o(s)),u=c.x-n.x,m=c.y-n.y,y=d.x-n.x,f=d.y-n.y;return{a:u,b:m,c:y,d:f,e:n.x-u*e.x-y*e.y,f:n.y-m*e.x-f*e.y}}function J(t){let e=Math.hypot(t.a,t.b),o=t.a*t.d-t.b*t.c;return{rotationDeg:Math.atan2(t.b,t.a)*180/Math.PI,scaleX:e,scaleY:o/Math.max(e,1e-9),skewX:(t.a*t.c+t.b*t.d)/Math.max(o,1e-9)}}export{Y as a,j as b,q as c,F as d,U as e,_ as f,N as g,O as h,W as i,Z as j,z as k,G as l,J as m};
1
+ import{x as X}from"./chunk-RZLIIQDP.js";var Y=9;function E(t){if(t.kind==="circle")return{hx:t.r,hy:t.r};let e=t.width/2,o=t.height/2,n=t.rotation??0;if(!n)return{hx:e,hy:o};let r=n*Math.PI/180,s=Math.abs(Math.cos(r)),c=Math.abs(Math.sin(r));return{hx:e*s+o*c,hy:e*c+o*s}}function B(t,e,o){let n=e-t.seat.x,r=o-t.seat.y;if(t.shape.kind==="circle")return n*n+r*r<=t.shape.r*t.shape.r;let s=t.shape.rotation??0,c=n,d=r;if(s){let u=-s*Math.PI/180,m=Math.cos(u),y=Math.sin(u);c=n*m-r*y,d=n*y+r*m}return Math.abs(c)<=t.shape.width/2&&Math.abs(d)<=t.shape.height/2}function L(t,e,o,n,r){if(t.shape.kind==="circle"){let h=Math.min(Math.max(t.seat.x,e),n),l=Math.min(Math.max(t.seat.y,o),r),x=t.seat.x-h,p=t.seat.y-l;return x*x+p*p<=t.shape.r*t.shape.r}let s=t.shape.rotation??0;if(!s)return t.seat.x-t.hx<=n&&t.seat.x+t.hx>=e&&t.seat.y-t.hy<=r&&t.seat.y+t.hy>=o;let c=s*Math.PI/180,d=Math.cos(c),u=Math.sin(c),m=t.shape.width/2,y=t.shape.height/2,f=[[-m,-y],[m,-y],[m,y],[-m,y]].map(([h,l])=>[t.seat.x+h*d-l*u,t.seat.y+h*u+l*d]),P=[[e,o],[n,o],[n,r],[e,r]],A=[[1,0],[0,1],[d,u],[-u,d]];for(let[h,l]of A){let x=1/0,p=-1/0;for(let[I,D]of f){let a=I*h+D*l;a<x&&(x=a),a>p&&(p=a)}let M=1/0,S=-1/0;for(let[I,D]of P){let a=I*h+D*l;a<M&&(M=a),a>S&&(S=a)}if(p<M||S<x)return!1}return!0}function j(t,e={}){let o=e.seatRadius??Y,n=t.length,r=new Array(n),s=1/0,c=1/0,d=-1/0,u=-1/0,m=0;for(let a=0;a<n;a++){let i=t[a],R=e.shapeOf?.(i)??{kind:"circle",r:o},{hx:w,hy:b}=E(R);r[a]={seat:i,shape:R,hx:w,hy:b},i.x-w<s&&(s=i.x-w),i.y-b<c&&(c=i.y-b),i.x+w>d&&(d=i.x+w),i.y+b>u&&(u=i.y+b),w>m&&(m=w),b>m&&(m=b)}n===0&&(s=0,c=0,d=0,u=0);let y=m>0?m*4:1,f=Math.max(d-s,0),P=Math.max(u-c,0),A=Math.max(64,e.maxCells??n*4),h=y,l=Math.max(1,Math.ceil(f/h)||1),x=Math.max(1,Math.ceil(P/h)||1);for(;l*x>A&&(l>1||x>1);)h*=2,l=Math.max(1,Math.ceil(f/h)||1),x=Math.max(1,Math.ceil(P/h)||1);let p=l*x,M=new Int32Array(p+1),S=0;for(let a=0;a<n;a++){let i=r[a],R=X(Math.floor((i.seat.x-i.hx-s)/h),0,l-1),w=X(Math.floor((i.seat.x+i.hx-s)/h),0,l-1),b=X(Math.floor((i.seat.y-i.hy-c)/h),0,x-1),k=X(Math.floor((i.seat.y+i.hy-c)/h),0,x-1);for(let C=b;C<=k;C++)for(let g=R;g<=w;g++)M[C*l+g+1]++,S++}for(let a=0;a<p;a++)M[a+1]+=M[a];let I=new Int32Array(S),D=M.slice(0,p);for(let a=0;a<n;a++){let i=r[a],R=X(Math.floor((i.seat.x-i.hx-s)/h),0,l-1),w=X(Math.floor((i.seat.x+i.hx-s)/h),0,l-1),b=X(Math.floor((i.seat.y-i.hy-c)/h),0,x-1),k=X(Math.floor((i.seat.y+i.hy-c)/h),0,x-1);for(let C=b;C<=k;C++)for(let g=R;g<=w;g++){let v=C*l+g;I[D[v]++]=a}}return{seats:t,entries:r,minX:s,minY:c,cell:h,cols:l,rows:x,cellStart:M,items:I,stamp:new Int32Array(n),epoch:0}}function q(t,e,o={}){let{cols:n,rows:r,cell:s,minX:c,minY:d,cellStart:u,items:m,entries:y}=t,f=Math.floor((e.x-c)/s),P=Math.floor((e.y-d)/s);if(f<0||P<0||f>=n||P>=r)return null;let A=P*n+f,h=u[A+1],l=-1,x=1/0;for(let p=u[A];p<h;p++){let M=m[p],S=y[M];if(o.filter&&!o.filter(S.seat.id,S.seat)||!B(S,e.x,e.y))continue;let I=e.x-S.seat.x,D=e.y-S.seat.y,a=I*I+D*D;(a<x||a===x&&M<l)&&(x=a,l=M)}return l<0?null:y[l].seat.id}function F(t,e,o,n={}){if(!(o>0))return null;let{cols:r,rows:s,cell:c,minX:d,minY:u,cellStart:m,items:y,entries:f}=t,P=Math.max(0,Math.floor((e.x-o-d)/c)),A=Math.min(r-1,Math.floor((e.x+o-d)/c)),h=Math.max(0,Math.floor((e.y-o-u)/c)),l=Math.min(s-1,Math.floor((e.y+o-u)/c));if(P>A||h>l)return null;let x=-1,p=o*o,M=t.stamp,S=++t.epoch;for(let I=h;I<=l;I++){let D=I*r;for(let a=P;a<=A;a++){let i=D+a,R=m[i+1];for(let w=m[i];w<R;w++){let b=y[w];if(M[b]===S)continue;M[b]=S;let k=f[b];if(n.filter&&!n.filter(k.seat.id,k.seat))continue;let C=e.x-k.seat.x,g=e.y-k.seat.y,v=C*C+g*g;(v<p||v===p&&b<x)&&(p=v,x=b)}}}return x<0?null:f[x].seat.id}function U(t,e,o={}){let n=Math.min(e.x,e.x+e.width),r=Math.max(e.x,e.x+e.width),s=Math.min(e.y,e.y+e.height),c=Math.max(e.y,e.y+e.height),d=o.mode??"center",{cols:u,rows:m,cell:y,minX:f,minY:P,cellStart:A,items:h,entries:l}=t,x=Math.max(0,Math.floor((n-f)/y)),p=Math.min(u-1,Math.floor((r-f)/y)),M=Math.max(0,Math.floor((s-P)/y)),S=Math.min(m-1,Math.floor((c-P)/y));if(x>p||M>S)return[];let I=[],D=t.stamp,a=++t.epoch;for(let i=M;i<=S;i++){let R=i*u;for(let w=x;w<=p;w++){let b=R+w,k=A[b+1];for(let C=A[b];C<k;C++){let g=h[C];if(D[g]===a)continue;D[g]=a;let v=l[g];if(o.filter&&!o.filter(v.seat.id,v.seat))continue;(d==="center"?v.seat.x>=n&&v.seat.x<=r&&v.seat.y>=s&&v.seat.y<=c:L(v,n,s,r,c))&&I.push(g)}}}return I.sort((i,R)=>i-R),I.map(i=>l[i].seat.id)}function _(t){let e=t.cols*t.rows,o=0,n=0;for(let s=0;s<e;s++){let c=t.cellStart[s+1]-t.cellStart[s];c>0&&o++,c>n&&(n=c)}let r=t.items.length;return{cell:t.cell,cols:t.cols,rows:t.rows,cells:e,occupiedCells:o,refs:r,maxPerCell:n,meanPerOccupiedCell:o?r/o:0}}function N(t,e=0){let o=Math.max(1,t.width,t.height),n={x:t.x+t.width/2,y:t.y+t.height/2},r=o*1.55,s=Math.max(o*.82,Math.max(0,e)+o*.45);return{target:n,distance:r,height:s,focalLength:Math.hypot(r,s),yawRad:-8*Math.PI/180}}function O(t,e,o=0){let n=e.x-t.target.x,r=e.y-t.target.y,s=Math.cos(t.yawRad),c=Math.sin(t.yawRad),d=n*s-r*c,m=n*c+r*s-t.distance,y=o-t.height,f=Math.hypot(t.distance,t.height),P=(-t.distance*m-t.height*y)/f,A=(-t.height*m+t.distance*y)/f,h=Math.max(f*.08,P),l=t.focalLength/h;return{x:t.target.x+d*l,y:t.target.y-A*l,depth:h,scale:l}}function W(t,e){return{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function Z(t){let e=t.a*t.d-t.b*t.c;if(!Number.isFinite(e)||Math.abs(e)<1e-9)throw new Error("perspective projection produced a singular affine");let o=t.d/e,n=-t.b/e,r=-t.c/e,s=t.a/e;return{a:o,b:n,c:r,d:s,e:-(o*t.e+r*t.f),f:-(n*t.e+s*t.f)}}function z(t,e){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}function G(t,e,o=()=>0){let n=O(t,e,o(e)),r={x:e.x+1,y:e.y},s={x:e.x,y:e.y+1},c=O(t,r,o(r)),d=O(t,s,o(s)),u=c.x-n.x,m=c.y-n.y,y=d.x-n.x,f=d.y-n.y;return{a:u,b:m,c:y,d:f,e:n.x-u*e.x-y*e.y,f:n.y-m*e.x-f*e.y}}function J(t){let e=Math.hypot(t.a,t.b),o=t.a*t.d-t.b*t.c;return{rotationDeg:Math.atan2(t.b,t.a)*180/Math.PI,scaleX:e,scaleY:o/Math.max(e,1e-9),skewX:(t.a*t.c+t.b*t.d)/Math.max(o,1e-9)}}export{Y as a,j as b,q as c,F as d,U as e,_ as f,N as g,O as h,W as i,Z as j,z as k,G as l,J as m};
@@ -0,0 +1 @@
1
+ import{c,j as A,m as T}from"./chunk-CXF32VPG.js";var d=7,B=10,N=10,R=15,k=11,y=.85,E=12,M=4.5,x=3,l="#000000",u="#ffffff",Z=24,g=18.67;function G(t,L=400){return t>=Z||L>=700&&t>=g?x:M}function H(t,L){return t*L>=E}var P=24,m={wheelchair:"M7.8 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM8 7L10.5 7L10.5 15L8 15ZM8 12.5L18 12.5L18 15L8 15ZM16 15L18 15L18 18L16 18ZM5.5 16a5.5 5.5 0 1 0 11 0a5.5 5.5 0 1 0 -11 0zM8 16a3 3 0 1 1 6 0a3 3 0 1 1 -6 0z",companion:"M5.5 6.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM4.5 18.5L6 11.5L11 11.5L12.5 18.5ZM12.5 7.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM11.5 19L13 12.5L18 12.5L19.5 19Z","semi-ambulatory":"M8.3 3.8a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM9 6.2L12 6.6L11 13.5L8.6 13L9 6.2ZM8.6 13L11 13L9.5 21L7 21ZM10.4 13L12.6 13L13.6 21L11.2 21ZM11.2 7.2L14 8L14.6 9.6L11.9 8.9ZM14.4 6.8L15.9 6.8L16.4 21L14.8 21Z","designated-aisle":"M3 5L6 5L6 14L3 14ZM3 12L13 12L13 15L3 15ZM5 15L7 15L7 20L5 20ZM11 15L13 15L13 20L11 20ZM13 7L20 7L17 4L19 4L23 8.5L19 13L17 13L20 10L13 10Z","step-free":"M4 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM4.4 7L7.5 7L7.5 13L11 15L9.5 17L5 14L4.4 7ZM2 19L8 19L17 10L22 10L22 13L18 13L10 21L2 21Z",hearing:"M15.5 3.5C9 2.2 5.5 6 5.5 11.5C5.5 16 8 19.5 10.5 21C13.2 22.6 16.4 20.8 15.4 18C14.8 16.4 12.9 16.1 13 14C13.1 11.9 15.8 11.4 15.8 8.5C15.8 5.4 13 4 15.5 3.5Z",cart:"M5.5 6L18.5 6a2.5 2.5 0 0 1 2.5 2.5L21 15.5a2.5 2.5 0 0 1 -2.5 2.5L11 18L7 20.5L7.5 18L5.5 18a2.5 2.5 0 0 1 -2.5 -2.5L3 8.5a2.5 2.5 0 0 1 2.5 -2.5zM6.5 11L17.5 11L17.5 12.6L6.5 12.6zM6.5 14L17.5 14L17.5 15.6L6.5 15.6z","sign-language":"M7 11L17 11L17 18a2 2 0 0 1 -2 2L9 20a2 2 0 0 1 -2 -2zM7.6 5L9.4 5L9.4 12L7.6 12zM9.9 3.5L11.7 3.5L11.7 12L9.9 12zM12.3 3.5L14.1 3.5L14.1 12L12.3 12zM14.6 5L16.4 5L16.4 12L14.6 12zM7.2 12.5L5 10.2L6.4 8.9L8.6 11.2Z","low-vision":"M2.5 12C6 6 18 6 21.5 12C18 18 6 18 2.5 12ZM9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM17.5 3L19 3L19 6L17.5 6ZM19 4L22 4L22 5.5L19 5.5Z","sensory-friendly":"M4 11C4 5 7 2.5 12 2.5S20 5 20 11L17 11C17 7 15.5 5.5 12 5.5S7 7 7 11ZM3 10L8 10L8 19L5 19a2 2 0 0 1 -2 -2ZM16 10L21 10L21 17a2 2 0 0 1 -2 2L16 19ZM9 12L15 12L15 14L9 14ZM10 16L14 16L14 18L10 18Z","plus-size":"M9.4 4.3a2.6 2.6 0 1 0 5.2 0a2.6 2.6 0 1 0 -5.2 0zM5 20L4 13C4 10.5 7 9.5 12 9.5C17 9.5 20 10.5 20 13L19 20Z","lift-armrest":"M5 6L8 6L8 19L5 19zM5 16L18 16L18 19L5 19zM8 12L17 12L17 14.5L8 14.5zM14 7L16 7L16 12L14 12zM12 7L18 7L15 3Z"},v=m.wheelchair;function w(t){if(!t?.length)return null;let L=t.includes("wheelchair")?"wheelchair":t[0];return m[L]??null}function F(t){return/-(\d{1,5})$/.exec(t)?.[1]??t}var a=T;function X(t,L,r){let n=c(t),o=c(L);if(!n||!o)return L;let e=Math.max(0,Math.min(1,r));return`#${n.map((s,_)=>Math.round(s*e+o[_]*(1-e))).map(s=>s.toString(16).padStart(2,"0")).join("")}`}var K=3;function I(t,L,r=M){let n=a(L,t);if(n!=null&&n>=r)return L;let o=a(l,t)??0,e=a(u,t)??0;return o===0&&e===0?L:o>=e?l:u}var S=3;function Y(t){let L=a("#ffffff",t);if(L!=null&&L>=S)return"#ffffff";let r=a(l,t)??0,n=a(u,t)??0;return r===0&&n===0?"#ffffff":r>=n?l:u}var C=/^#[0-9a-f]{6}$/i;function O(t){let L=c(t);return L!=null&&A(L)>.5}var b="#e5e7eb",h="#273142";function D(t){return O(t)?b:h}function U(t,L,r=M){let n=C.test(t.trim()),o=t.trim().toLowerCase(),e=0,i=0,s=null;for(let p of L){if(!n||!C.test(p.trim()))continue;e+=1;let f=I(p,t,r);f.toLowerCase()!==o&&(i+=1,s=f)}return{total:e,overridden:i,status:e===0?"none":i===0?"applies":i===e?"overridden":"mixed",overrideInk:s}}export{d as a,B as b,N as c,R as d,k as e,y as f,E as g,M as h,x as i,l as j,u as k,G as l,H as m,P as n,m as o,v as p,w as q,F as r,a as s,X as t,K as u,I as v,Y as w,O as x,b as y,h as z,D as A,U as B};
@@ -0,0 +1 @@
1
+ import{a as Re,c as Ne,f as be,g as _e,l as De,t as me,v as Ke}from"./chunk-GXMGOWKB.js";import{e as Be,n as Ge,p as Ue,q as Ve,r as pe,v as he}from"./chunk-DNGP2HDT.js";import{a as fe,b as ge,d as Le,f as Pe,i as oe}from"./chunk-YPVY3Z5S.js";import{b as Q,m as z,p as ze}from"./chunk-VI3IZS2B.js";import{$ as X,A as ke,U as Oe,Z as ce,_ as H,a as vt,aa as Y,b as It,ba as le,c as wt,ca as de,d as St,da as Ee,e as xt,f as Ct,g as xe,ga as Ae,h as jt,i as $t,j as Ce,k as je,l as se,ma as Te,oa as K,pa as Me,sa as W,va as te,w as q,xa as ue,z as $e,za as ye}from"./chunk-RZLIIQDP.js";import{c as Fe,m as R}from"./chunk-CXF32VPG.js";var ve=[{key:"row-seats",label:"row seats",suffix:"rows",labelSuffix:"Rows",creationWord:"Seats",objectType:"row"},{key:"table-chairs",label:"table chairs",suffix:"tables",labelSuffix:"Tables",creationWord:"Tables",objectType:"table"},{key:"booth-units",label:"booth units",suffix:"booths",labelSuffix:"Booths",creationWord:"Booths",objectType:"booth"},{key:"ga-capacity",label:"GA capacity",suffix:"ga",labelSuffix:"GA",creationWord:"Standing",objectType:"gaArea"}];function Qe(t){return t.floors?.length?t.floors:[{id:"floor-0",objects:t.objects}]}function kt(t){return ve.find(e=>e.key===t)}function ie(t){let e=new Map,n=Math.max(0,Math.floor(t.seatCount)),i=new Map((t.overrides??[]).filter(a=>Number.isInteger(a.index)&&a.index>=0&&a.index<t.seatCount).map(a=>[a.index,a])),r=(a,l=1)=>{a&&l>0&&e.set(a,(e.get(a)??0)+l)};r(t.categoryKey,n-i.size);for(let a of i.values())a.skip||r(a.categoryKey??t.categoryKey);return e}function Ot(t){return t.type==="row"||t.type==="table"?[...ie(t).keys()]:t.type==="booth"?t.categoryKey?[t.categoryKey]:[]:t.type==="gaArea"?t.capacity>0&&t.categoryKey?[t.categoryKey]:[]:[]}function qe(t){return ve.find(e=>e.objectType===t.type)??null}function He(t){return t.type==="row"||t.type==="table"||t.type==="booth"||t.type==="gaArea"}function ne(t){let e=new Map;for(let r of Qe(t))for(let a of r.objects){if(!He(a))continue;let l=qe(a);for(let f of Ot(a)){let h=e.get(f)??new Map,c=h.get(l.key)??[];if(!c.some(d=>d.id===a.id)){let d=a.displayLabel||a.label||a.id;c.push({id:a.id,label:d,type:l.objectType,floorId:r.id})}h.set(l.key,c),e.set(f,h)}}let n=new Map(t.categories.map(r=>[r.key,r.label]));return[...t.categories.map(r=>r.key),...[...e.keys()].filter(r=>!n.has(r)).sort()].flatMap(r=>{let a=e.get(r);if(!a||a.size<2)return[];let l=ve.flatMap(f=>{let h=a.get(f.key);return h?.length?[{family:f.key,label:f.label,objectType:f.objectType,targets:h}]:[]});return[{categoryKey:r,categoryLabel:n.get(r)??r,families:l,objectIds:[...new Set(l.flatMap(f=>f.targets.map(h=>h.id)))]}]})}function Xe(t){let e=t.families.map(n=>`${n.label} (${n.targets.map(i=>i.label).join(", ")})`).join(" and ");return`Category \u201C${t.categoryLabel}\u201D is used by more than one kind of inventory \u2014 ${e}. Each category can belong to only one kind \u2014 use the safe split to separate them (prices, ticket tiers, accessibility, and provenance are preserved).`}function Ye(t){return t.normalize("NFKC").trim().toLocaleLowerCase("en")}function Et(t,e,n){for(let i=1;i<=1e4;i+=1){let r=i===1?`--${e}`:`--${e}-${i}`,l=`${t.slice(0,Math.max(1,160-r.length))}${r}`;if(!n.has(l))return n.add(l),l}throw new Error(`Unable to allocate a category key for ${t} (${e})`)}function At(t,e,n){for(let i=1;i<=1e4;i+=1){let r=i===1?` (${e})`:` (${e} ${i})`,l=`${t.normalize("NFKC").trim().slice(0,Math.max(1,80-r.length)).trimEnd()}${r}`,f=Ye(l);if(!n.has(f))return n.add(f),l}throw new Error(`Unable to allocate a category label for ${t} (${e})`)}function Tt(t,e,n,i){let r=kt(e);return{...structuredClone(t),key:Et(t.key,r.suffix,n),label:At(t.label,r.labelSuffix,i)}}function Mt(t,e,n){let i=[];for(let r of Qe(t))for(let a of r.objects){if(!He(a))continue;let l=qe(a),f=n.get(l.key);if(!(!f||f===e))if(a.type==="row"||a.type==="table"){let h=[];a.categoryKey===e&&(a.categoryKey=f);for(let c of a.overrides??[])c.categoryKey===e&&(c.categoryKey=f,h.push(c.index));(a.categoryKey===f||h.length)&&i.push({family:l.key,floorId:r.id,objectId:a.id,objectType:l.objectType,fromCategoryKey:e,toCategoryKey:f,...h.length?{seatOverrideIndices:h.sort((c,d)=>c-d)}:{}})}else a.categoryKey===e&&(a.categoryKey=f,i.push({family:l.key,floorId:r.id,objectId:a.id,objectType:l.objectType,fromCategoryKey:e,toCategoryKey:f}))}return i}function We(t){let e=structuredClone(t),n=ne(e);if(!n.length)return{doc:e,changed:!1,changes:[],before:n,after:n};let i=new Set(e.categories.map(f=>f.key)),r=new Set(e.categories.map(f=>Ye(f.label))),a=[];for(let f of n){let h=e.categories.findIndex(I=>I.key===f.categoryKey);if(h<0)continue;let c=e.categories[h],d=f.families[0].family,g=new Map([[d,c.key]]),p=f.families.slice(1).map(I=>{let O=Tt(c,I.family,i,r);return g.set(I.family,O.key),{family:I.family,key:O.key,label:O.label,category:O}});e.categories.splice(h+1,0,...p.map(I=>I.category));let b=Mt(e,c.key,g);a.push({categoryKey:c.key,categoryLabel:c.label,retainedFamily:d,clones:p.map(({family:I,key:O,label:w})=>({family:I,key:O,label:w})),reassignments:b})}e.floors?.length&&(e.objects=e.floors[0].objects);let l=ne(e);return{doc:e,changed:a.length>0,changes:a,before:n,after:l}}function Lt(t,e){return Math.abs(t.x-e.x)<=1e-7&&Math.abs(t.y-e.y)<=1e-7}function Z(t,e,n){return(e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x)}function re(t,e,n){let i=Z(e,n,t);return Math.abs(i)>1e-7?!1:t.x>=Math.min(e.x,n.x)-1e-7&&t.x<=Math.max(e.x,n.x)+1e-7&&t.y>=Math.min(e.y,n.y)-1e-7&&t.y<=Math.max(e.y,n.y)+1e-7}function Pt(t,e,n,i){let r=Z(t,e,n),a=Z(t,e,i),l=Z(n,i,t),f=Z(n,i,e);return(r>1e-7&&a<-1e-7||r<-1e-7&&a>1e-7)&&(l>1e-7&&f<-1e-7||l<-1e-7&&f>1e-7)?!0:Math.abs(r)<=1e-7&&re(n,t,e)||Math.abs(a)<=1e-7&&re(i,t,e)||Math.abs(l)<=1e-7&&re(t,n,i)||Math.abs(f)<=1e-7&&re(e,n,i)}function Ft(t){return t.reduce((e,n,i)=>{let r=t[(i+1)%t.length];return e+n.x*r.y-r.x*n.y},0)}function Rt(t){for(let e=0;e<t.length;e+=1){let n=(e+1)%t.length;for(let i=e+1;i<t.length;i+=1){let r=(i+1)%t.length;if(!(e===i||n===i||r===e)&&Pt(t[e],t[n],t[i],t[r]))return!0}}return!1}function Ze(t){return t.length<3?{ok:!1,code:"too_few_vertices",message:"Add at least three vertices to create a polygon."}:t.length>256?{ok:!1,code:"too_many_vertices",message:"A polygon can contain at most 256 vertices."}:t.some(e=>!Number.isFinite(e.x)||!Number.isFinite(e.y)||Math.abs(e.x)>1e7||Math.abs(e.y)>1e7)?{ok:!1,code:"invalid_coordinate",message:"Every polygon vertex must use a finite coordinate inside the safe chart range."}:t.some((e,n)=>Lt(e,t[(n+1)%t.length]))?{ok:!1,code:"duplicate_vertex",message:"Move or remove duplicate neighbouring vertices."}:Math.abs(Ft(t))<2?{ok:!1,code:"degenerate_polygon",message:"The polygon needs a visible enclosed area."}:Rt(t)?{ok:!1,code:"self_intersection",message:"Polygon edges cannot cross or touch each other."}:{ok:!0}}function B(t){return t.length>=3&&t.every(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}function G(t,e,n){let i=(t.y-e.y)*(n.x-e.x)-(t.x-e.x)*(n.y-e.y);if(Math.abs(i)>1e-7)return!1;let r=(t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y);if(r<-1e-7)return!1;let a=(n.x-e.x)**2+(n.y-e.y)**2;return r<=a+1e-7}function U(t,e){let n=!1;for(let i=0,r=e.length-1;i<e.length;r=i++){let a=e[r],l=e[i];if(G(t,a,l))return!0;a.y>t.y!=l.y>t.y&&t.x<(l.x-a.x)*(t.y-a.y)/(l.y-a.y)+a.x&&(n=!n)}return n}function D(t,e,n){return(e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x)}function et(t,e,n,i){let r=D(t,e,n),a=D(t,e,i),l=D(n,i,t),f=D(n,i,e);return(r>1e-7&&a<-1e-7||r<-1e-7&&a>1e-7)&&(l>1e-7&&f<-1e-7||l<-1e-7&&f>1e-7)?!0:Math.abs(r)<=1e-7&&G(n,t,e)||Math.abs(a)<=1e-7&&G(i,t,e)||Math.abs(l)<=1e-7&&G(t,n,i)||Math.abs(f)<=1e-7&&G(e,n,i)}function V(t){for(let e=0;e<t.length;e+=1){let n=(e+1)%t.length;for(let i=e+1;i<t.length;i+=1){let r=(i+1)%t.length;if(!(e===i||n===i||r===e)&&et(t[e],t[n],t[i],t[r]))return!0}}return!1}function J(t,e){for(let n=0;n<t.length;n+=1)for(let i=0;i<e.length;i+=1)if(et(t[n],t[(n+1)%t.length],e[i],e[(i+1)%e.length]))return!0;return U(t[0],e)||U(e[0],t)}function Je(t,e){return!e.some((n,i)=>G(t,n,e[(i+1)%e.length]))&&U(t,e)}function tt(t){let e=t.outlinePath;if(!e?.segments.length)return;let n=a=>Number.isFinite(a.x)&&Number.isFinite(a.y),i=(a,l)=>Math.hypot(a.x-l.x,a.y-l.y);if(!n(e.start))return 0;let r=e.start;for(let a=0;a<e.segments.length;a++){let l=e.segments[a];if(!l||!n(l.end)||i(r,l.end)<=1e-9||l.kind==="bezier"&&(!n(l.control1)||!n(l.control2)))return a;if(l.kind==="arc"){if(!n(l.center)||!Number.isFinite(l.radius)||l.radius<=1e-6)return a;let f=Math.max(1e-4,l.radius*1e-4);if(Math.abs(i(r,l.center)-l.radius)>f||Math.abs(i(l.end,l.center)-l.radius)>f)return a}r=l.end}return i(r,e.start)>1e-4,e.segments.length-1}function Nt(t,e,n,i){let r=D(t,e,n),a=D(t,e,i),l=D(n,i,t),f=D(n,i,e);return(r>1e-7&&a<-1e-7||r<-1e-7&&a>1e-7)&&(l>1e-7&&f<-1e-7||l<-1e-7&&f>1e-7)}function ot(t,e){for(let n=0;n<t.length;n+=1)for(let i=0;i<e.length;i+=1)if(Nt(t[n],t[(n+1)%t.length],e[i],e[(i+1)%e.length]))return!0;return t.some(n=>Je(n,e))||e.some(n=>Je(n,t))}function nt(t){return t.role!=="reference-focal"||!t.points||!B(t.points)?null:t.points}function rt(t,e){if(t.displayLabel!==void 0){let n=t.displayLabel.normalize("NFKC").trim();(!n||n!==t.displayLabel||n.length>80)&&e.push({severity:"error",code:"invalid-display-label",message:`${t.type==="gaArea"?"GA area":t.type} "${t.label}" must use a normalized buyer label of 1 to 80 characters`,objectId:t.id})}if(t.displayType!==void 0){let n=t.displayType.normalize("NFKC").trim();(!n||n!==t.displayType||n.length>24)&&e.push({severity:"error",code:"invalid-display-type",message:`${t.type==="gaArea"?"GA area":t.type} "${t.label}" must use a normalized buyer type of 1 to 24 characters`,objectId:t.id})}}function it(t,e,n,i){let r=t.crop,a=r&&(!Number.isFinite(r.x)||!Number.isFinite(r.y)||!Number.isFinite(r.width)||!Number.isFinite(r.height)||r.x<0||r.y<0||r.width<=0||r.height<=0||r.x+r.width>1.000001||r.y+r.height>1.000001);(!Number.isFinite(t.center?.x)||!Number.isFinite(t.center?.y)||!Number.isFinite(t.width)||t.width<=0||!Number.isFinite(t.opacity)||t.opacity<0||t.opacity>1||t.rotation!==void 0&&!Number.isFinite(t.rotation)||a)&&n.push({severity:"error",code:"invalid-background-placement",message:`The ${e} image has an invalid position, size, opacity, rotation, or crop`,...i?{floorId:i}:{}})}function Ie(t,e,n,i){let r=t.referenceImage,a=t.backgroundImage;r&&(it(r,"reference",e,i),!r.assetId&&!r.url&&e.push({severity:"error",code:"invalid-reference-image",message:"A trace reference must identify a private asset or self-contained image",...i?{floorId:i}:{}})),a&&(it(a,a.assetId?"legacy reference":"buyer background",e,i),!a.assetId&&!a.url&&e.push({severity:"error",code:"invalid-buyer-background",message:"A buyer background must contain a renderable image URL",...i?{floorId:i}:{}}),a.assetId&&n.push({severity:"warning",code:"legacy-reference-background",message:"This legacy asset-backed background is trace-only and will migrate to the private reference layer when edited",...i?{floorId:i}:{}})),Be(t)&&e.push({severity:"error",code:"conflicting-reference-images",message:"The canonical reference and legacy asset-backed background identify different private sources",...i?{floorId:i}:{}})}function ee(t){let e=new Set(Q.map(n=>n.key));return!t||/^ref_[0-9a-f-]{36}$/.test(t.assetId)&&!!t.logicalSectionId.trim()&&["user-confirmed","authoritative-source"].includes(t.evidence)&&!!t.sourceDescription.trim()&&(t.derivation===void 0||["explicit-inventory","server-synthesized-from-aggregate"].includes(t.derivation))&&(t.aggregateEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.aggregateEvidence))&&(t.derivation!=="server-synthesized-from-aggregate"||t.evidence==="user-confirmed")&&(t.sectionAssignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.sectionAssignmentEvidence))&&t.sectionAssignmentEvidence===void 0==!t.sectionAssignmentSourceDescription?.trim()&&(t.sectionAssignmentSourceDescription?.trim().length??0)<=240&&(t.numberingEvidence===void 0||t.numberingEvidence==="user-confirmed")&&t.numberingEvidence===void 0==!t.numberingSourceDescription?.trim()&&(t.numberingSourceDescription?.trim().length??0)<=240&&(!t.accessibility||t.accessibility.placementDerivation==="server-synthesized-row-edges"&&t.accessibility.groupLogicalSectionIds.length>0&&t.accessibility.groupLogicalSectionIds.length<=100&&new Set(t.accessibility.groupLogicalSectionIds).size===t.accessibility.groupLogicalSectionIds.length&&t.accessibility.groupLogicalSectionIds.includes(t.logicalSectionId)&&t.accessibility.groupLogicalSectionIds.every(n=>!!n.trim()&&n.length<=160)&&["user-confirmed","authoritative-source"].includes(t.accessibility.assignmentEvidence)&&!!t.accessibility.assignmentSourceDescription.trim()&&t.accessibility.assignmentSourceDescription.trim().length<=240&&t.accessibility.counts.length>0&&t.accessibility.counts.length<=Q.length&&new Set(t.accessibility.counts.map(n=>n.type)).size===t.accessibility.counts.length&&t.accessibility.counts.every(n=>e.has(n.type)&&Number.isInteger(n.count)&&n.count>0&&["user-confirmed","authoritative-source"].includes(n.evidence)&&!!n.sourceDescription.trim()&&n.sourceDescription.trim().length<=240))}function at(t){let e=t.referenceInventoryExclusion;return!e||typeof e.assetId=="string"&&/^ref_[0-9a-f-]{36}$/.test(e.assetId)&&e.assetId===t.referenceSource?.assetId&&typeof e.logicalSectionId=="string"&&e.logicalSectionId===(t.logicalSectionId??t.id)&&typeof e.reason=="string"&&!!e.reason.trim()&&e.reason.trim().length<=80&&["user-confirmed","authoritative-source"].includes(e.evidence)&&typeof e.sourceDescription=="string"&&!!e.sourceDescription.trim()&&e.sourceDescription.trim().length<=240}function st(t){let e=t.referenceCategorySource;return!e||/^ref_[0-9a-f-]{36}$/.test(e.assetId)&&/^#[0-9a-f]{6}$/i.test(e.sourceColor)&&(e.sourceColors===void 0||e.sourceColors.length>0&&e.sourceColors.includes(e.sourceColor)&&new Set(e.sourceColors).size===e.sourceColors.length&&e.sourceColors.every(n=>/^#[0-9a-f]{6}$/i.test(n)&&`${n[1]}${n[3]}${n[5]}`.toLowerCase()===`${e.sourceColor[1]}${e.sourceColor[3]}${e.sourceColor[5]}`.toLowerCase()))&&(e.logicalSectionIds===void 0||e.logicalSectionIds.length>0&&new Set(e.logicalSectionIds).size===e.logicalSectionIds.length&&e.logicalSectionIds.every(n=>!!n.trim()&&n.length<=160))&&(e.assignmentDerivation===void 0||["source-color-class","confirmed-logical-sections"].includes(e.assignmentDerivation))&&e.assignmentEvidence===void 0==!e.assignmentSourceDescription?.trim()&&(e.assignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(e.assignmentEvidence))&&(e.assignmentSourceDescription?.trim().length??0)<=240&&(e.assignmentDerivation!=="confirmed-logical-sections"||e.assignmentEvidence!==void 0&&!!e.assignmentSourceDescription?.trim())&&e.sourcePaletteColor===void 0==(e.sourcePaletteColorEvidence===void 0)&&e.sourcePaletteColorEvidence===void 0==!e.sourcePaletteColorSourceDescription?.trim()&&(e.sourcePaletteColor===void 0||/^#[0-9a-f]{6}$/i.test(e.sourcePaletteColor))&&(e.sourcePaletteColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(e.sourcePaletteColorEvidence))&&(e.sourcePaletteColorSourceDescription?.trim().length??0)<=240&&["user-confirmed","authoritative-source"].includes(e.labelEvidence)&&!!e.labelSourceDescription.trim()&&e.labelSourceDescription.trim().length<=240&&t.price!==void 0&&["user-confirmed","authoritative-source"].includes(e.priceEvidence)&&!!e.priceSourceDescription.trim()&&e.priceSourceDescription.trim().length<=240&&e.outputColorEvidence===void 0==!e.outputColorSourceDescription?.trim()&&(e.outputColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(e.outputColorEvidence))&&(e.outputColorSourceDescription?.trim().length??0)<=240&&(t.color.toLowerCase()===(e.sourcePaletteColor??e.sourceColor).toLowerCase()&&new Set((e.sourceColors??[e.sourceColor]).map(n=>`${n[1]}${n[3]}${n[5]}`.toLowerCase())).size===1||e.outputColorEvidence!==void 0&&["user-confirmed","authoritative-source"].includes(e.outputColorEvidence))}function ct(t,e){let n=t.floors?.length?t.floors.map(a=>({id:a.id,objects:a.objects})):[{id:"floor-0",objects:t.objects}],i=new Map,r=new Map;for(let a of n){let l=a.objects.filter(c=>c.type==="row"),f=new Map,h=new Map;for(let c of l){if(c.segmentedRow){let d=f.get(c.segmentedRow.groupId)??[];d.push(c),f.set(c.segmentedRow.groupId,d)}if(c.rowBlockGeneration){let d=h.get(c.rowBlockGeneration.groupId)??[];d.push(c),h.set(c.rowBlockGeneration.groupId,d)}c.segmentedRow&&c.rowBlockGeneration&&e.push({severity:"error",code:"invalid-row-group-membership",message:`Row "${c.label}" cannot be both a segmented-row component and a generated row-block member`,objectId:c.id,floorId:a.id})}for(let[c,d]of f){let g=i.get(c);g&&g!==a.id&&e.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${c}" cannot span multiple floors`,objectId:d[0].id,floorId:a.id}),i.set(c,a.id);let p=d.slice().sort((j,A)=>j.segmentedRow.componentIndex-A.segmentedRow.componentIndex),b=p[0]?.segmentedRow,I=b?.componentCount??0,O=b?JSON.stringify({displayLabel:b.displayLabel,repeatLabelOnComponents:b.repeatLabelOnComponents,displayType:b.displayType,labelPresentation:b.labelPresentation,viewFromSeatUrl:b.viewFromSeatUrl,viewFromSeatMeta:b.viewFromSeatMeta,confidenceEvidence:b.confidenceEvidence,smoothing:b.smoothing}):"";b&&I>=2&&I<=64&&p.length===I&&b.boundaryBefore==="start"&&p.every((j,A)=>{let $=j.segmentedRow;return $.kind==="segmented-row-v1"&&$.groupId===c&&$.componentCount===I&&$.componentIndex===A&&(A===0?$.boundaryBefore==="start":$.boundaryBefore!=="start")&&$.displayLabel.normalize("NFKC").trim()===$.displayLabel&&$.displayLabel.length>0&&$.displayLabel.length<=80&&JSON.stringify({displayLabel:$.displayLabel,repeatLabelOnComponents:$.repeatLabelOnComponents,displayType:$.displayType,labelPresentation:$.labelPresentation,viewFromSeatUrl:$.viewFromSeatUrl,viewFromSeatMeta:$.viewFromSeatMeta,confidenceEvidence:$.confidenceEvidence,smoothing:$.smoothing})===O})||e.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${c}" has missing, duplicated, cyclic, or inconsistent component metadata`,objectId:d[0]?.id,floorId:a.id})}for(let[c,d]of h){let g=r.get(c);g&&g!==a.id&&e.push({severity:"error",code:"invalid-row-block-generation",message:"A generated row block cannot span multiple floors",objectId:d[0].id,floorId:a.id}),r.set(c,a.id)}}}function _t(t){return t.type==="row"||t.type==="table"||t.type==="booth"}function Dt(t){let e=[],n=new Map((t.overrides??[]).map(i=>[i.index,i]));for(let i=0;i<t.seatCount;i++){let r=n.get(i);r?.skip||e.push({label:Oe(t,i,r),index:i})}return e}function lt(t){let e=[],n=new Map((t.overrides??[]).map(i=>[i.index,i]));for(let i=0;i<t.seatCount;i++){let r=n.get(i);r?.skip||e.push({label:r?.label??`${t.label}-${i+1}`,index:i})}return e}function dt(t){let e=[];t.eventConfigurationId!==void 0&&(typeof t.eventConfigurationId!="string"||t.eventConfigurationId.normalize("NFKC").trim()!==t.eventConfigurationId||t.eventConfigurationId.length<1||t.eventConfigurationId.length>100)&&e.push({severity:"error",code:"invalid-event-configuration",message:"Active event configuration must contain 1 to 100 normalized characters"});let n=[],i=new Set(t.categories.map(o=>o.key)),r=new Set(Q.map(o=>o.key)),a=new Map(t.categories.map(o=>[o.key,o.price!=null||o.notForSale===!0])),l=new Set;Ie(t,e,n);let f=o=>o.length<=2e6&&/^(https:\/\/|data:image\/)/.test(o),h=(o,S,s,y={})=>{if(S===void 0)return;if(!S||typeof S!="object"||Array.isArray(S)){e.push({severity:"error",code:"invalid-seat-view-metadata",message:`${s} view metadata is invalid`,...y});return}let u=S;o||n.push({severity:"warning",code:"orphaned-seat-view-metadata",message:`${s} view metadata has no image`,...y});let v=new Set(["exact-seat","row-representative","section-representative","venue-representative"]);u.projection!==void 0&&u.projection!=="equirectangular"&&e.push({severity:"error",code:"invalid-seat-view-projection",message:`${s} view projection must be equirectangular`,...y}),u.coverage!==void 0&&!v.has(u.coverage)&&e.push({severity:"error",code:"invalid-seat-view-coverage",message:`${s} view coverage is invalid`,...y});let m=(x,C,P)=>typeof x=="number"&&Number.isFinite(x)&&x>=C&&x<=P;u.initialBearingDeg!==void 0&&!m(u.initialBearingDeg,-360,360)&&e.push({severity:"error",code:"invalid-seat-view-bearing",message:`${s} view bearing must be between -360\xB0 and 360\xB0`,...y}),u.initialPitchDeg!==void 0&&!m(u.initialPitchDeg,-90,90)&&e.push({severity:"error",code:"invalid-seat-view-pitch",message:`${s} view pitch must be between -90\xB0 and 90\xB0`,...y}),u.capturedAt!==void 0&&(typeof u.capturedAt!="string"||u.capturedAt.length>40||!Number.isFinite(Date.parse(u.capturedAt)))&&e.push({severity:"error",code:"invalid-seat-view-capture-date",message:`${s} view capture date is invalid`,...y}),u.sourceLabel!==void 0&&(typeof u.sourceLabel!="string"||u.sourceLabel.trim().length>100)&&e.push({severity:"error",code:"invalid-seat-view-source",message:`${s} view source label is invalid`,...y}),u.previewUrl!==void 0&&!f(u.previewUrl)&&e.push({severity:"error",code:"invalid-seat-view-preview-url",message:`${s} view preview URL is invalid`,...y});for(let[x,C]of[["width",u.sourceWidth],["height",u.sourceHeight],["preview width",u.previewWidth],["preview height",u.previewHeight]])C!==void 0&&(!Number.isInteger(C)||C<1||C>32768)&&e.push({severity:"error",code:"invalid-seat-view-dimensions",message:`${s} view source ${x} is invalid`,...y});u.captureEyeHeightM!==void 0&&!m(u.captureEyeHeightM,.5,2.5)&&e.push({severity:"error",code:"invalid-seat-view-eye-height",message:`${s} capture eye height must be between 0.5 m and 2.5 m`,...y}),u.eventConfigurationId!==void 0&&(typeof u.eventConfigurationId!="string"||!u.eventConfigurationId.trim()||u.eventConfigurationId.length>100)&&e.push({severity:"error",code:"invalid-seat-view-configuration",message:`${s} event configuration id is invalid`,...y})},c=(o,S,s={})=>{if(o===void 0)return;let y=C=>{e.push({severity:"error",code:"invalid-seat-confidence-evidence",message:`${S} confidence evidence ${C}`,...s})};if(!o||typeof o!="object"||Array.isArray(o)){y("is invalid");return}let u=o;u.schema!=="seatlayer.seat-confidence/1"&&y("has an unsupported schema");let v=(C,P)=>typeof C=="string"&&C.normalize("NFKC").trim()===C&&C.length>0&&C.length<=P;v(u.evidenceId,120)||y("has an invalid evidence id"),v(u.modelVersion,120)||y("has an invalid model version"),new Set(["synthetic-model","organizer-approved","calibrated-provider"]).has(u.evidenceKind)||y("has an invalid evidence kind"),new Set(["generated","geometry-verified","configuration-verified"]).has(u.modelLevel)||y("has an invalid model level");let m=u.realityLevel??"none";new Set(["none","comparable-build-reference","actual-build-checked"]).has(m)||y("has an invalid reality level"),u.eventConfigurationId!==void 0&&!v(u.eventConfigurationId,100)&&y("has an invalid event configuration id");for(let[C,P]of[["assessment",u.assessedAt],["expiry",u.validUntil]])P!==void 0&&(!v(P,40)||!Number.isFinite(Date.parse(P)))&&y(`has an invalid ${C} date`);u.approvedByRole!==void 0&&!v(u.approvedByRole,100)&&y("has an invalid approving organization or role"),u.sourceLabel!==void 0&&!v(u.sourceLabel,120)&&y("has an invalid source label"),u.limitations!==void 0&&(!Array.isArray(u.limitations)||u.limitations.length>6||u.limitations.some(C=>!v(C,160)))&&y("has invalid limitations"),u.evidenceKind==="synthetic-model"&&(u.modelLevel!=="generated"||m!=="none")&&y("cannot describe synthetic data as verified or reality checked"),u.modelLevel!=="generated"&&(!u.assessedAt||!u.approvedByRole)&&y("requires an assessment date and approving organization or role for verified model levels"),u.modelLevel==="configuration-verified"&&!u.eventConfigurationId&&y("requires an event configuration id for configuration verification"),m!=="none"&&(!u.assessedAt||!u.sourceLabel)&&y("requires an assessment date and source for reality evidence"),m==="actual-build-checked"&&(u.modelLevel!=="configuration-verified"||!u.eventConfigurationId)&&y("requires a configuration-verified model and event configuration for an actual-build check");let x=u.modeledTarget;x!==void 0&&(!x||typeof x!="object"||Array.isArray(x)?y("has an invalid modeled target"):((!v(x.label,80)||!v(x.methodLabel,100))&&y("has invalid modeled-target labels"),(!Number.isInteger(x.totalRayCount)||x.totalRayCount<1||x.totalRayCount>1e3||!Number.isInteger(x.clearRayCount)||x.clearRayCount<0||x.clearRayCount>x.totalRayCount)&&y("has invalid modeled-target ray counts"),new Set(["clear","partial","obstructed"]).has(x.classification)||y("has an invalid modeled-target classification"),x.occluderLabels!==void 0&&(!Array.isArray(x.occluderLabels)||x.occluderLabels.length>10||x.occluderLabels.some(C=>!v(C,100)))&&y("has invalid modeled-target occluders")))};h(t.viewFromSeatUrl,t.viewFromSeatMeta,"Venue"),c(t.confidenceEvidence,"Venue"),t.viewFromSeatUrl!==void 0&&!f(t.viewFromSeatUrl)&&e.push({severity:"error",code:"invalid-venue-view-url",message:"The whole-venue view-from-seat image URL is invalid"});for(let o of t.floors??[])o.viewFromSeatUrl!==void 0&&!f(o.viewFromSeatUrl)&&e.push({severity:"error",code:"invalid-floor-view-url",message:`Floor "${o.name}" has an invalid view-from-seat image URL`}),h(o.viewFromSeatUrl,o.viewFromSeatMeta,`Floor "${o.name}"`,{floorId:o.id}),c(o.confidenceEvidence,`Floor "${o.name}"`,{floorId:o.id});let d=t.floors?.length?t.floors.flatMap(o=>o.objects):t.objects;for(let o of d)if((o.type==="row"||o.type==="section")&&(h(o.viewFromSeatUrl,o.viewFromSeatMeta,`${o.type==="row"?"Row":"Section"} "${o.label}"`,{objectId:o.id}),c(o.confidenceEvidence,`${o.type==="row"?"Row":"Section"} "${o.label}"`,{objectId:o.id})),o.type==="row"&&o.segmentedRow&&(h(o.segmentedRow.viewFromSeatUrl,o.segmentedRow.viewFromSeatMeta,`Segmented row "${o.segmentedRow.displayLabel}"`,{objectId:o.id}),c(o.segmentedRow.confidenceEvidence,`Segmented row "${o.segmentedRow.displayLabel}"`,{objectId:o.id})),o.type==="row"||o.type==="table")for(let S of o.overrides??[])h(S.viewFromSeatUrl,S.viewFromSeatMeta,`Seat ${S.index+1}`,{objectId:o.id,seatIndices:[S.index]}),c(S.confidenceEvidence,`Seat ${S.index+1}`,{objectId:o.id,seatIndices:[S.index]});let g=new Set;for(let o of t.categories){g.has(o.key)&&e.push({severity:"error",code:"duplicate-category-key",message:`Category key "${o.key}" is used more than once`,categoryKey:o.key}),g.add(o.key);let S=new Set;for(let s of o.tiers??[]){if(S.has(s.id)&&e.push({severity:"error",code:"duplicate-category-tier-id",message:`Ticket tier id "${s.id}" is used more than once in category "${o.key}"`,categoryKey:o.key}),s.restriction!=null&&!["companion","child","senior","student","membership","custom"].includes(s.restriction)&&e.push({severity:"error",code:"invalid-category-tier-restriction",message:`Ticket tier "${s.name}" has an unknown restriction`,categoryKey:o.key}),s.buyerMessage!=null&&(!s.buyerMessage.trim()||s.buyerMessage.length>240)&&e.push({severity:"error",code:"invalid-category-tier-buyer-message",message:`Ticket tier "${s.name}" buyer guidance must contain 1 to 240 characters`,categoryKey:o.key}),s.currency!=null&&!/^[A-Z]{3}$/.test(s.currency)&&e.push({severity:"error",code:"invalid-category-tier-currency",message:`Ticket tier "${s.name}" must use a three-letter ISO currency`,categoryKey:o.key}),s.applicability!=null){let y=s.applicability.seatLabels,u=s.applicability.accessibility;(y!==void 0&&(!Array.isArray(y)||!y.length||y.length>1e4||y.some(v=>typeof v!="string"||!v.trim()||v.length>160)||new Set(y).size!==y.length)||u!==void 0&&(!Array.isArray(u)||!u.length||u.some(v=>!r.has(v))||new Set(u).size!==u.length))&&e.push({severity:"error",code:"invalid-category-tier-applicability",message:`Ticket tier "${s.name}" has invalid seat applicability`,categoryKey:o.key})}s.evidence!=null&&(!["public-host","public-event","user-confirmed"].includes(s.evidence.provenance)||!s.evidence.sourceDescription.trim()||s.evidence.sourceDescription.length>240||s.evidence.capturedAt!==void 0&&(s.evidence.capturedAt.length>40||!Number.isFinite(Date.parse(s.evidence.capturedAt))))&&e.push({severity:"error",code:"invalid-category-tier-evidence",message:`Ticket tier "${s.name}" has invalid evidence provenance`,categoryKey:o.key}),S.add(s.id)}st(o)||e.push({severity:"error",code:"invalid-reference-category-source",message:`Category ${o.label||o.key} has incomplete or invalid reference evidence`,categoryKey:o.key})}let p=new Map,b=new Map,I=[],O=new Map,w=0,j=0,A=new Set;for(let o of t.floors??[])Ie(o,e,n,o.id),A.has(o.id)&&e.push({severity:"error",code:"duplicate-floor-id",message:`Floor id "${o.id}" is used more than once`,floorId:o.id}),A.add(o.id),o.baseHeightM!==void 0&&(!Number.isFinite(o.baseHeightM)||o.baseHeightM<X||o.baseHeightM>Y)&&e.push({severity:"error",code:"invalid-floor-base-height",message:`Floor "${o.name}" base height must be between ${X} and ${Y} metres`,floorId:o.id});let $=t.floors&&t.floors.length?t.floors.flatMap(o=>o.objects):t.objects;ct(t,e);let N=new Set;for(let o of $)N.has(o.id)&&e.push({severity:"error",code:"duplicate-object-id",message:`Object id "${o.id}" is used more than once`,objectId:o.id}),N.add(o.id);let L=new Set;for(let o of t.zones??[])L.has(o.id)&&e.push({severity:"error",code:"duplicate-zone-id",message:`Zone id "${o.id}" is used more than once`}),L.add(o.id),o.focalPoint!==void 0&&(!Number.isFinite(o.focalPoint.x)||!Number.isFinite(o.focalPoint.y))&&e.push({severity:"error",code:"invalid-zone-focal-point",message:`Zone "${o.label}" must use a finite focal point`});let T=new Map;for(let o of $)if(!(o.type!=="section"||!o.zone)){if(t.zones?.length&&!L.has(o.zone)){e.push({severity:"error",code:"unknown-section-zone",message:`Section "${o.displayLabel??o.label}" references unknown zone "${o.zone}"`,objectId:o.id});continue}T.has(o.zone)||T.set(o.zone,o)}for(let[o,S]of T){let s=t.zones?.find(y=>y.id===o);s&&(s?.focalPoint||n.push({severity:"warning",code:"missing-zone-focal-point",message:`Zone "${s?.label??o}" uses the legacy floor focal; set its own focal point before publishing`,objectId:S.id}))}for(let o of $)if((o.type==="row"||o.type==="table"||o.type==="booth"||o.type==="gaArea")&&rt(o,e),_t(o)){if(w++,j+=o.type==="booth"?1:o.type==="row"?Te(o):o.bookAsWhole||o.variableOccupancy?o.seatCount:lt(o).length,p.get(o.label)!==void 0?o.type!=="row"&&e.push({severity:"error",code:"duplicate-object-label",message:`Label "${o.label}" is used by more than one object`,objectId:o.id}):p.set(o.label,o.id),i.has(o.categoryKey)?l.add(o.categoryKey):e.push({severity:"error",code:"unknown-category",message:`"${o.label}" references unknown category "${o.categoryKey}"`,objectId:o.id,categoryKey:o.categoryKey}),o.type==="row"){ee(o.referenceInventorySource)||e.push({severity:"error",code:"invalid-reference-inventory-source",message:`Row "${o.label}" has invalid reference-inventory provenance`,objectId:o.id}),o.seatCount<1&&e.push({severity:"error",code:"empty-row",message:`Row "${o.label}" has no seats`,objectId:o.id});let s=new Set;for(let y of o.overrides??[]){(y.accessibility??[]).filter(x=>!r.has(x)).length&&e.push({severity:"error",code:"invalid-accessibility-type",message:`Row "${o.label}" seat ${y.index+1} uses an unknown accessibility type`,objectId:o.id,seatIndices:[y.index]}),(!Number.isInteger(y.index)||y.index<0||y.index>=o.seatCount||s.has(y.index))&&e.push({severity:"error",code:"invalid-seat-override",message:`Row "${o.label}" has a duplicated or out-of-range seat override`,objectId:o.id,...Number.isInteger(y.index)?{seatIndices:[y.index]}:{}}),s.add(y.index);let v=y.wheelchairSpaceType,m=y.accessible===!0||y.accessibility?.includes("wheelchair");v!==void 0&&v!=="seat-present"&&v!=="no-seat"?e.push({severity:"error",code:"invalid-wheelchair-space",message:`Row "${o.label}" seat ${y.index+1} has an invalid wheelchair-space type`,objectId:o.id,seatIndices:[y.index]}):v&&(!m||y.skip)&&e.push({severity:"error",code:"invalid-wheelchair-space",message:y.skip?`Row "${o.label}" seat ${y.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Row "${o.label}" seat ${y.index+1} must include wheelchair accessibility for its physical-space type`,objectId:o.id,seatIndices:[y.index]})}for(let y of Dt(o))oe(y.label)&&e.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${y.label}" uses SeatLayer's reserved GA namespace`,objectId:o.id,seatIndices:[y.index]}),b.get(y.label)!==void 0?I.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${y.label}" is used more than once`,objectId:o.id,seatIndices:[y.index]}):b.set(y.label,o.id)}else if(o.type==="table"){let s=o.bookAsWhole===!0||o.variableOccupancy===!0;if(o.seatCountsBySide){let m=["top","bottom","left","right"],x=Object.keys(o.seatCountsBySide),C=m.every(_=>Number.isInteger(o.seatCountsBySide[_])&&o.seatCountsBySide[_]>=0&&o.seatCountsBySide[_]<=40),P=C?m.reduce((_,ht)=>_+o.seatCountsBySide[ht],0):Number.NaN;(o.shape!=="rect"||x.length!==m.length||x.some(_=>!m.includes(_))||!C||P!==o.seatCount||P<1||P>40)&&e.push({severity:"error",code:"invalid-table-side-counts",message:`Table "${o.label}" needs top, bottom, left, and right whole-number chair counts totaling its ${o.seatCount}-chair capacity`,objectId:o.id})}s&&o.overrides?.length&&e.push({severity:"error",code:"grouped-table-chair-overrides",message:`Grouped table "${o.label}" cannot carry individual-chair overrides`,objectId:o.id,seatIndices:o.overrides.map(m=>m.index)});let y=new Set;for(let m of o.overrides??[]){(m.accessibility??[]).filter(_=>!r.has(_)).length&&e.push({severity:"error",code:"invalid-accessibility-type",message:`Table "${o.label}" chair ${m.index+1} uses an unknown accessibility type`,objectId:o.id,seatIndices:[m.index]}),(!Number.isInteger(m.index)||m.index<0||m.index>=o.seatCount||y.has(m.index))&&e.push({severity:"error",code:"invalid-seat-override",message:`Table "${o.label}" has a duplicated or out-of-range chair override`,objectId:o.id,...Number.isInteger(m.index)?{seatIndices:[m.index]}:{}}),y.add(m.index),m.categoryKey&&!i.has(m.categoryKey)?e.push({severity:"error",code:"unknown-category",message:`Table "${o.label}" chair ${m.index+1} references unknown category "${m.categoryKey}"`,objectId:o.id,seatIndices:[m.index],categoryKey:m.categoryKey}):m.categoryKey&&l.add(m.categoryKey);let C=m.wheelchairSpaceType,P=m.accessible===!0||m.accessibility?.includes("wheelchair");C!==void 0&&C!=="seat-present"&&C!=="no-seat"?e.push({severity:"error",code:"invalid-wheelchair-space",message:`Table "${o.label}" chair ${m.index+1} has an invalid wheelchair-space type`,objectId:o.id,seatIndices:[m.index]}):C&&(!P||m.skip)&&e.push({severity:"error",code:"invalid-wheelchair-space",message:m.skip?`Table "${o.label}" chair ${m.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Table "${o.label}" chair ${m.index+1} must include wheelchair accessibility for its physical-space type`,objectId:o.id,seatIndices:[m.index]})}o.bookAsWhole&&o.variableOccupancy?e.push({severity:"error",code:"invalid-table-booking-mode",message:`Table "${o.label}" cannot be sold both as a whole table and with variable occupancy`,objectId:o.id}):o.variableOccupancy?(!Number.isInteger(o.minOccupancy)||!Number.isInteger(o.maxOccupancy)||o.minOccupancy<1||o.maxOccupancy<o.minOccupancy||o.maxOccupancy>o.seatCount)&&e.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${o.label}" needs whole-number minimum and maximum guests from 1 to its ${o.seatCount}-chair capacity`,objectId:o.id}):(o.minOccupancy!=null||o.maxOccupancy!=null)&&e.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${o.label}" has guest bounds without variable-occupancy selling`,objectId:o.id}),ee(o.referenceInventorySource)||e.push({severity:"error",code:"invalid-reference-inventory-source",message:`Table "${o.label}" has invalid reference-inventory provenance`,objectId:o.id}),(o.shape==="round"&&o.radius==null||o.shape==="rect"&&(o.width==null||o.height==null)||o.seatCount<1)&&e.push({severity:"error",code:"bad-table",message:`Table "${o.label}" is missing required dimensions or seats`,objectId:o.id});let v=s?[{label:o.label,index:void 0}]:lt(o);for(let m of v)oe(m.label)&&e.push({severity:"error",code:"reserved-seat-label",message:`Inventory label "${m.label}" uses SeatLayer's reserved GA namespace`,objectId:o.id}),b.get(m.label)!==void 0?I.push({severity:"error",code:"duplicate-seat-label",message:`Inventory label "${m.label}" is used more than once; grouped table labels must be unique`,objectId:o.id,...m.index===void 0?{}:{seatIndices:[m.index]}}):b.set(m.label,o.id)}else if(o.type==="booth"){ee(o.referenceInventorySource)||e.push({severity:"error",code:"invalid-reference-inventory-source",message:`Booth "${o.label}" has invalid reference-inventory provenance`,objectId:o.id});let s=o.label;oe(s)&&e.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${s}" uses SeatLayer's reserved GA namespace`,objectId:o.id}),b.get(s)!==void 0?I.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${s}" is used more than once`,objectId:o.id}):b.set(s,o.id)}}else if(o.type==="gaArea"){if(!Le(o))e.push({severity:"error",code:"invalid-ga-inventory-segments",message:`GA area "${o.label}" has invalid joined-area inventory provenance`,objectId:o.id});else for(let u of Pe(o))b.get(u)!==void 0?I.push({severity:"error",code:"duplicate-seat-label",message:`GA inventory label "${u}" is used more than once`,objectId:o.id}):b.set(u,o.id);ee(o.referenceInventorySource)||e.push({severity:"error",code:"invalid-reference-inventory-source",message:`GA area "${o.label}" has invalid reference-inventory provenance`,objectId:o.id}),(!B(o.points)||Math.abs(z(o.points))<=1e-7||V(o.points))&&e.push({severity:"error",code:"invalid-ga-outline",message:`GA area "${o.label}" must have a finite, non-self-intersecting polygon outline`,objectId:o.id});let s=o.holes??[],y=Array.isArray(s)&&s.length<=64?s.findIndex(u=>!Array.isArray(u)||u.length>512||!B(u)||Math.abs(z(u))<=1e-7||V(u)?!0:!u.flatMap((m,x)=>{let C=u[(x+1)%u.length];return[m,{x:(m.x+C.x)/2,y:(m.y+C.y)/2}]}).every(m=>U(m,o.points))):0;if(y>=0)e.push({severity:"error",code:"invalid-ga-hole",message:`GA area "${o.label}" has a cutout outside its outline or with invalid geometry`,objectId:o.id,holeIndex:y});else if(s.some((u,v)=>s.slice(v+1).some(m=>J(u,m)))){let u=s.findIndex((v,m)=>s.slice(m+1).some(x=>J(v,x)));e.push({severity:"error",code:"overlapping-ga-holes",message:`GA area "${o.label}" has overlapping cutout polygons`,objectId:o.id,holeIndex:u})}i.has(o.categoryKey)?l.add(o.categoryKey):e.push({severity:"error",code:"unknown-category",message:`"${o.label}" references unknown category "${o.categoryKey}"`,objectId:o.id,categoryKey:o.categoryKey}),o.capacity<1&&e.push({severity:"error",code:"empty-ga",message:`GA area "${o.label}" has zero capacity`,objectId:o.id}),(!Number.isInteger(o.capacity)||o.capacity>fe)&&e.push({severity:"error",code:"invalid-ga-capacity",message:`GA area "${o.label}" capacity must be a whole number from 1 to ${fe}`,objectId:o.id}),w++,j+=Math.max(0,Math.floor(o.capacity))}else if(o.type==="section"){if(o.elevation!==void 0&&(!Number.isInteger(o.elevation)||o.elevation<ce||o.elevation>H)){let y=Number.isInteger(o.elevation)&&o.elevation>H&&o.elevation<=Ee;n.push({severity:"warning",code:y?"legacy-section-elevation":"invalid-section-elevation",message:y?`Section "${o.label}" uses legacy tier ${o.elevation}; set an exact height before normalizing it to tier ${H}`:`Section "${o.label}" elevation must be a whole-number tier from ${ce} to ${H}`,objectId:o.id})}if(o.height!==void 0&&(!Number.isFinite(o.height)||o.height<X||o.height>Y)&&e.push({severity:"error",code:"invalid-section-height",message:`Section "${o.label}" exact height must be between ${X} and ${Y} metres`,objectId:o.id}),o.rake!==void 0&&(!Number.isFinite(o.rake)||o.rake<le||o.rake>de)&&e.push({severity:"error",code:"invalid-section-rake",message:`Section "${o.label}" rake must be between ${le}\xB0 and ${de}\xB0`,objectId:o.id}),o.surfaceKind!==void 0&&o.surfaceKind!=="flat"&&o.surfaceKind!=="rakedRows"&&e.push({severity:"error",code:"invalid-section-surface-kind",message:`Section "${o.label}" surfaceKind must be 'flat' or 'rakedRows'`,objectId:o.id}),!B(o.outline)||Math.abs(z(o.outline))<=1e-7||V(o.outline)){e.push({severity:"error",code:"invalid-section-outline",message:`Section "${o.label}" must have a finite, non-self-intersecting polygon outline`,objectId:o.id});continue}if(o.outlinePath){let y=[];try{y=ke(o.outlinePath)}catch{}(!$e(o.outlinePath)||!y.length||Math.hypot(o.outlinePath.start.x-o.outline[0].x,o.outlinePath.start.y-o.outline[0].y)>1e-4||!B(y)||Math.abs(z(y))<=1e-7||V(y))&&e.push({severity:"error",code:"invalid-section-outline-path",message:`Section "${o.label}" has an invalid or inconsistent curved outline path`,objectId:o.id,edgeIndex:tt(o)})}if(o.referenceSource&&(!/^ref_[0-9a-f-]{36}$/.test(o.referenceSource.assetId)||!/^(?:reg|ai)_[0-9a-f]{16}$/.test(o.referenceSource.regionId))&&e.push({severity:"error",code:"invalid-section-reference-source",message:`Section "${o.label}" has invalid opaque reference provenance`,objectId:o.id}),at(o)||e.push({severity:"error",code:"invalid-section-inventory-exclusion",message:`Section "${o.label}" has incomplete or mismatched non-sellable evidence`,objectId:o.id}),o.logicalSectionId!==void 0&&!o.logicalSectionId.trim())e.push({severity:"error",code:"invalid-logical-section-id",message:`Section "${o.label}" has an empty logical section id`,objectId:o.id});else if(o.logicalSectionId){let y=JSON.stringify({displayLabel:o.displayLabel??null,entrance:o.entrance??null,viewFromSeatUrl:o.viewFromSeatUrl??null,viewFromSeatMeta:o.viewFromSeatMeta??null,confidenceEvidence:o.confidenceEvidence??null,zone:o.zone??null,labelStyle:o.labelPresentation?.labelStyle??null,labelVisible:o.labelPresentation?.visible!==!1}),u=O.get(o.logicalSectionId);u&&(u.label!==o.label||u.semanticSignature!==y)?e.push({severity:"error",code:"inconsistent-logical-section",message:`Logical section "${o.logicalSectionId}" must use one technical label and buyer-facing presentation across every component`,objectId:o.id}):u||O.set(o.logicalSectionId,{label:o.label,semanticSignature:y})}o.viewFromSeatUrl!==void 0&&(o.viewFromSeatUrl.length>2e6||!/^(https:\/\/|data:image\/)/.test(o.viewFromSeatUrl))&&e.push({severity:"error",code:"invalid-section-view-url",message:`Section "${o.label}" has an invalid view-from-seat image URL`,objectId:o.id});let S=o.holes??[];if(!Array.isArray(S)||S.length>64){e.push({severity:"error",code:"invalid-section-hole",message:`Section "${o.label}" has an invalid opening collection`,objectId:o.id});continue}let s=-1;for(let y=0;y<S.length;y++){let u=S[y];if(!Array.isArray(u)||u.length>512||!B(u)||Math.abs(z(u))<=1e-7||V(u)){s=y;break}if(!u.flatMap((m,x)=>{let C=u[(x+1)%u.length];return[m,{x:(m.x+C.x)/2,y:(m.y+C.y)/2}]}).every(m=>U(m,o.outline))){s=y;break}}if(s>=0)e.push({severity:"error",code:"invalid-section-hole",message:`Section "${o.label}" has an opening outside its outline or with an invalid shape`,objectId:o.id,holeIndex:s});else if(S.some((y,u)=>S.slice(u+1).some(v=>J(y,v)))){let y=S.findIndex((u,v)=>S.slice(v+1).some(m=>J(u,m)));e.push({severity:"error",code:"overlapping-section-holes",message:`Section "${o.label}" has overlapping openings`,objectId:o.id,holeIndex:y})}}let F=t.floors?.length?t.floors.map(o=>o.objects):[t.objects];for(let o of F){let S=o.filter(s=>s.type==="section");for(let s of o.filter(y=>y.type==="text")){let y=s.iconKey;y!==void 0&&!Ge(y)&&e.push({severity:"error",code:"invalid-icon-key",message:`Venue icon "${s.text||s.id}" references an unknown symbol`,objectId:s.id});let u=s.fontFamily;u!==void 0&&(typeof u!="string"||u.normalize("NFKC").trim()!==u||u.length<1||u.length>120)&&e.push({severity:"error",code:"invalid-text-font-family",message:`Text "${s.text||s.id}" font family must contain 1 to 120 normalized characters`,objectId:s.id});let v=s.background;(s.width!==void 0&&(!Number.isFinite(s.width)||s.width<40||s.width>1200)||s.align!==void 0&&!["left","center","right"].includes(s.align)||s.lineHeight!==void 0&&(!Number.isFinite(s.lineHeight)||s.lineHeight<.8||s.lineHeight>3)||s.letterSpacing!==void 0&&(!Number.isFinite(s.letterSpacing)||s.letterSpacing<-2||s.letterSpacing>20)||s.opacity!==void 0&&(!Number.isFinite(s.opacity)||s.opacity<.1||s.opacity>1)||v!==void 0&&(!/^#[0-9a-f]{6}$/i.test(v.color)||v.padding!==void 0&&(!Number.isFinite(v.padding)||v.padding<0||v.padding>40)||v.cornerRadius!==void 0&&(!Number.isFinite(v.cornerRadius)||v.cornerRadius<0||v.cornerRadius>40)||v.opacity!==void 0&&(!Number.isFinite(v.opacity)||v.opacity<.1||v.opacity>1)))&&e.push({severity:"error",code:"invalid-text-layout",message:`Text "${s.text||s.id}" has invalid width, spacing, opacity, alignment, or background layout`,objectId:s.id})}for(let s of o.filter(y=>y.type==="shape")){if(s.eventConfigurationIds!==void 0){let v=s.eventConfigurationIds;Array.isArray(v)&&v.length>0&&v.length<=20&&v.every(x=>typeof x=="string"&&x.normalize("NFKC").trim()===x&&x.length>=1&&x.length<=100)&&new Set(v).size===v.length||e.push({severity:"error",code:"invalid-shape-configurations",message:`Shape "${s.label||s.id}" must reference 1 to 20 unique event configuration ids`,objectId:s.id})}if(s.heightM!==void 0&&(!Number.isFinite(s.heightM)||s.heightM<.05||s.heightM>50)&&e.push({severity:"error",code:"invalid-shape-height",message:`Shape "${s.label||s.id}" height must be between 0.05 m and 50 m`,objectId:s.id}),s.stroke!==void 0&&(!s.stroke||typeof s.stroke.color!="string"||!/^#[0-9a-f]{6}$/i.test(s.stroke.color)||!Number.isFinite(s.stroke.width)||s.stroke.width<.5||s.stroke.width>40)&&e.push({severity:"error",code:"invalid-shape-stroke",message:`Shape "${s.label||s.id}" stroke must use a six-digit color and width from 0.5 to 40 chart units`,objectId:s.id}),(s.lineCap!==void 0||s.lineJoin!==void 0||s.startEnding!==void 0||s.endEnding!==void 0)&&!he(s.kind)?e.push({severity:"error",code:"invalid-shape-line-style-applicability",message:`Shape "${s.label||s.id}" may use line caps, joins, and end decorations only when it is an open line or polyline`,objectId:s.id}):he(s.kind)&&(s.lineCap!==void 0&&!Ue.includes(s.lineCap)||s.lineJoin!==void 0&&!Ve.includes(s.lineJoin)||s.startEnding!==void 0&&!pe.includes(s.startEnding)||s.endEnding!==void 0&&!pe.includes(s.endEnding))&&e.push({severity:"error",code:"invalid-shape-line-style",message:`Shape "${s.label||s.id}" has an unsupported line cap, join, or ending`,objectId:s.id}),s.kind==="polygon"){let v=Ze(s.points??[]);v.ok||e.push({severity:"error",code:"invalid-shape-polygon",message:`Shape "${s.label||s.id}" has invalid polygon geometry: ${v.message}`,objectId:s.id})}let u=nt(s);if(u){for(let v of S)if(ot(u,v.outline)){e.push({severity:"error",code:"reference-focal-overlaps-section",message:`Reference focal area "${s.label??s.id}" overlaps section "${v.label}"`,objectId:s.id});break}}}}j>ge&&e.push({severity:"error",code:"inventory-capacity-exceeded",message:`Chart has ${j} bookable units; the maximum is ${ge}`}),e.push(...I.slice(0,5)),I.length>5&&e.push({severity:"error",code:"duplicate-seat-label",message:`${I.length} seats share a label with another seat; the first 5 are listed above. Seat labels must be unique across the whole chart.`});for(let o of ne(t)){let S=o.families[0]?.targets[0];n.push({severity:"warning",code:"category-inventory-family-conflict",message:Xe(o),categoryKey:o.categoryKey,...S?{objectId:S.id,floorId:S.floorId}:{},relatedObjectIds:o.objectIds,categoryInventoryFamilies:o.families})}t.focalPoint||n.push({severity:"warning",code:"missing-focal-point",message:"Chart has no focal point set"}),w===0&&n.push({severity:"warning",code:"no-bookables",message:"Chart has no rows, tables, booths, or GA areas"});for(let o of l)if(a.get(o)===!1){let S=t.categories.find(s=>s.key===o);n.push({severity:"warning",code:"unpriced-category",message:`Category "${S?.label??o}" is used but has no price`,categoryKey:o})}return[...e,...n]}var Kt=9,gt="#0e1117",Bt="#f5f6f8",bt="#8b93a7",zt="#0b1220",Gt="#0b1220",Ut="#ffffff",Vt=100;function k(t,e=2){let n=10**e;return Math.round(t*n)/n}function ut(t){let e=Fe(t);if(!e)return null;let n=b=>{let I=b/255;return I<=.04045?I/12.92:((I+.055)/1.055)**2.4},i=n(e[0]),r=n(e[1]),a=n(e[2]),l=(.4124*i+.3576*r+.1805*a)/.95047,f=(.2126*i+.7152*r+.0722*a)/1,h=(.0193*i+.1192*r+.9505*a)/1.08883,c=b=>b>.008856?Math.cbrt(b):7.787*b+16/116,d=c(l),g=c(f),p=c(h);return[116*g-16,500*(d-g),200*(g-p)]}function Qt(t,e){let n=ut(t),i=ut(e);return!n||!i?null:Math.hypot(n[0]-i[0],n[1]-i[1],n[2]-i[2])}function E(t){return{source:"quality",...t}}function qt(t){return t.code==="missing-focal-point"||t.code==="missing-zone-focal-point"?"navigation":"structure"}function Se(t){return Kt*q(t.theme?.seatScale??1,.7,1.6)}function mt(t){let e=[];for(let n of t.objects)n.type==="row"?e.push(...K(n)):n.type==="table"&&e.push(...W(n));return e}function Ht(t){let e={rowSeats:0,tableSeats:0,booths:0,gaCapacity:0};for(let n of t)for(let i of n.objects)i.type==="row"?e.rowSeats+=K(i).length:i.type==="table"?e.tableSeats+=W(i).length:i.type==="booth"?e.booths+=1:i.type==="gaArea"&&(e.gaCapacity+=Math.max(0,Math.floor(i.capacity)));return{inventoryByKind:e,bookableUnits:e.rowSeats+e.tableSeats+e.booths+e.gaCapacity}}function M(t,e){t.filter(n=>n.code===e.code).length<Vt&&t.push(e)}function Xt(t,e,n){let i=Se(t),r=2*i,a=2.3*i,l=0,f=0,h=1/0;for(let c of e){let d=new Map(c.objects.filter(w=>w.type==="row").map(w=>[w.id,w])),g=w=>{let j=c.objects.find(T=>T.id===w);if(!j||j.type!=="row"&&j.type!=="table")return"another seating object";let A=j.type==="row"?K(j):W(j),$=A.length?{x:A.reduce((T,F)=>T+F.x,0)/A.length,y:A.reduce((T,F)=>T+F.y,0)/A.length}:j.type==="row"?j.origin:j.center,N=c.objects.find(T=>T.type==="section"&&te($,T.outline,T.holes)),L=j.type==="row"?`Row \u201C${j.label}\u201D`:`Table \u201C${j.label}\u201D`;return N?.type==="section"?`${L} in \u201C${N.label}\u201D`:L},p=mt(c);l+=p.length;let b=a,I=new Map,O=new Map;for(let w of p){let j=Math.floor(w.x/b),A=Math.floor(w.y/b);for(let L=-1;L<=1;L++)for(let T=-1;T<=1;T++){let F=I.get(`${j+L}:${A+T}`)??[];for(let o of F){f++;let S=Math.hypot(w.x-o.x,w.y-o.y);if(h=Math.min(h,S),S>=a)continue;let y=(w.rowId<o.rowId?[w.rowId,o.rowId]:[o.rowId,w.rowId]).join("|"),u=O.get(y);(!u||S<u.distance)&&O.set(y,{a:w,b:o,distance:S})}}let $=`${j}:${A}`,N=I.get($)??[];N.push(w),I.set($,N)}for(let w of O.values()){let j=w.a.rowId===w.b.rowId,A=d.get(w.a.rowId),$=d.get(w.b.rowId),N=!j&&A?.segmentedRow?.repeatLabelOnComponents===!0&&$?.segmentedRow?.repeatLabelOnComponents===!0&&A.segmentedRow.groupId===$.segmentedRow.groupId,L=w.distance<r?"error":"warning";if(N&&L==="warning")continue;let T=L==="error"?"seat-overlap":"seat-cramped",F=g(w.a.rowId),o=g(w.b.rowId),S=k(L==="error"?r:a);M(n,E({severity:L,code:T,dimension:"geometry",title:j?`${F} has seats too close together`:`${F} and ${o} are too close together`,message:`The closest seats are ${k(w.distance)} chart units apart; at least ${S} are required.`,action:j?`Increase the seat spacing for ${F}, or use Review safe fixes.`:`Move ${F} or ${o} until they no longer overlap.`,objectId:w.a.rowId,relatedObjectIds:j?[w.a.rowId]:[w.a.rowId,w.b.rowId],floorId:c.id,measured:k(w.distance),minimum:k(L==="error"?r:a),autoFixable:j}))}}return{seats:l,checkedSeatPairs:f,minimumSeatDistance:Number.isFinite(h)?k(h):null}}function ae(t){let{width:e,height:n}=Ce(t);if(!t.rotation)return{x:t.position.x,y:t.position.y,width:e,height:n};let i=[{x:0,y:0},{x:e,y:0},{x:e,y:n},{x:0,y:n}].map(r=>{let a=je(r,t.rotation);return{x:t.position.x+a.x,y:t.position.y+a.y}});return ze(i)}function pt(t,e,n=0){return t.x<e.x+e.width+n&&t.x+t.width+n>e.x&&t.y<e.y+e.height+n&&t.y+t.height+n>e.y}function we(t,e,n){let i=q(e.x,t.x,t.x+t.width),r=q(e.y,t.y,t.y+t.height);return(e.x-i)**2+(e.y-r)**2<n**2}function Yt(t,e,n){let i=Se(t),r=0;for(let a of e){let l=a.objects.filter(h=>h.type==="text"),f=mt(a);r+=l.length;for(let h=0;h<l.length;h++){let c=l[h],d=ae(c),g=f.find(p=>we(d,p,i));g&&M(n,E({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${c.text}\u201D overlaps seat ${g.label}`,objectId:c.id,relatedObjectIds:[c.id,g.rowId],floorId:a.id,autoFixable:!0}));for(let p=0;p<h;p++){let b=l[p];pt(d,ae(b),2)&&M(n,E({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${c.text}\u201D overlaps text \u201C${b.text}\u201D`,objectId:c.id,relatedObjectIds:[c.id,b.id],floorId:a.id,autoFixable:!0}))}}}return r}function Wt(t){return t.normalize("NFKC").trim().toLowerCase().replace(/\s+/g," ")}function Zt(t,e,n){let i=new Map;for(let a of e)for(let l of a.objects){let f=l.type,h=f==="row"||f==="table"||f==="booth"||f==="gaArea",c=h||f==="section";if(h&&!l.categoryKey.trim()){let d=f==="gaArea"?"GA area":f==="row"?"Row":f==="table"?"Table":"Booth";M(n,E({severity:"warning",code:"object-uncategorized",dimension:"structure",title:`${d} \u201C${l.label||l.id}\u201D has no category`,message:`${d} \u201C${l.label||l.id}\u201D is not assigned to any category, so buyers see no price or colour for it.`,action:"Assign a category to this object in the inspector, or create one in the Categories tab first.",objectId:l.id,floorId:a.id,autoFixable:!1}))}if(c){let d=(l.type==="section"?l.displayLabel??l.label:l.label)??"";if(d.trim()){if(f==="table"||f==="booth"||f==="gaArea"){let g=Wt(d),p=i.get(g);p&&p.raw!==d?M(n,E({severity:"warning",code:"duplicate-object-label-normalized",dimension:"labels",title:`\u201C${d}\u201D and \u201C${p.raw}\u201D read as the same label`,message:`Labels \u201C${d}\u201D and \u201C${p.raw}\u201D differ only by case, spacing, or accents, so buyers cannot tell them apart.`,action:"Make the two labels visibly distinct.",objectId:l.id,relatedObjectIds:[l.id,p.id],floorId:a.id,autoFixable:!1})):p||i.set(g,{id:l.id,raw:d})}}else{let g=f==="gaArea"?"A GA area":f==="section"?"A section":f==="row"?"A row":f==="table"?"A table":"A booth";M(n,E({severity:"warning",code:"object-unlabeled",dimension:"labels",title:`${g} has no label`,message:`${g} has an empty label; buyers rely on labels to identify what they are booking.`,action:"Give this object a short, unique label in the inspector.",objectId:l.id,floorId:a.id,autoFixable:!1}))}}}let r=[];for(let a of e){let l=a.objects.filter(f=>f.type==="row"||f.type==="table"||f.type==="booth"||f.type==="gaArea");for(let f of a.objects)if(!(f.type!=="section"||f.referenceInventoryExclusion||l.some(c=>te(ue(c),f.outline,f.holes)))){if(f.referenceSource){r.push({id:f.id,floorId:a.id});continue}M(n,E({severity:"warning",code:"empty-section",dimension:"structure",title:`Section \u201C${f.displayLabel??f.label}\u201D is empty`,message:`Section \u201C${f.displayLabel??f.label}\u201D contains no rows, tables, booths, or GA areas.`,action:"Add seating inside this section (Fill with rows), or remove the empty section.",objectId:f.id,floorId:a.id,autoFixable:!1}))}}if(r.length&&M(n,E({severity:"warning",code:"empty-section",dimension:"structure",title:r.length===1?"1 traced section has no seating yet":`${r.length} traced sections have no seating yet`,message:`${r.length} section${r.length===1?"":"s"} traced from the reference image contain${r.length===1?"s":""} no rows, tables, booths, or GA areas.`,action:"Fill them with rows, or remove the ones the venue does not sell.",objectId:r[0].id,relatedObjectIds:r.map(a=>a.id),floorId:r[0].floorId,autoFixable:!1})),t.floors&&t.floors.length>1)for(let a of t.floors)a.objects.length===0&&M(n,E({severity:"warning",code:"unused-floor",dimension:"structure",title:`Floor \u201C${a.name}\u201D is empty`,message:`Floor \u201C${a.name}\u201D has no objects on it.`,action:"Add seating to this floor, or delete it from the floor list below the canvas.",floorId:a.id,autoFixable:!1}))}var Jt=5,eo=16;function to(t,e,n){for(let i of e){let r=i.focalPoint??t.focalPoint;if(r)for(let a of i.objects){if(a.type!=="section"||a.outline.length<3)continue;let{rake:l}=Ae(a);if(l<Jt)continue;let f=a.outline.map(p=>Math.hypot(p.x-r.x,p.y-r.y)),h=Math.max(...f);if(h<=0)continue;let c=(h-Math.min(...f))/h;if(l*c<=eo)continue;let g=a.displayLabel??a.label;M(n,E({severity:"warning",code:"section-rake-inconsistent",dimension:"geometry",title:`Section \u201C${g}\u201D is too deep for a single rake`,message:`Section \u201C${g}\u201D spans ${Math.round(c*100)}% of its distance to the stage at a ${Math.round(l)}\xB0 rake, so one rake can't represent its sightlines faithfully \u2014 a real tier this deep changes slope at a cross-aisle.`,action:"Split this section at the cross-aisle into two sections, each with its own rake.",objectId:a.id,floorId:i.id,autoFixable:!1}))}}}function oo(t,e,n){let i=t.theme?.background??gt,r=Bt,a=new Map;for(let c of e)for(let d of c.objects){if(d.type!=="gaArea")continue;let g=a.get(d.categoryKey)??[];g.push({id:d.id,floorId:c.id}),a.set(d.categoryKey,g)}for(let c of t.categories){let d=R(c.color,i),g=R(c.color,r);if(d==null||g==null){M(n,E({severity:"error",code:"invalid-category-color",dimension:"contrast",message:`Category \u201C${c.label}\u201D does not use a supported hex color`,categoryKey:c.key}));continue}let p=Math.min(d,g);p<3&&M(n,E({severity:"warning",code:"category-contrast-low",dimension:"contrast",title:`Category \u201C${c.label}\u201D is hard to see`,message:`Category \u201C${c.label}\u201D reaches only ${k(p)}:1 across dark and light chart backgrounds; 3:1 is required`,action:`Choose a lighter or darker color for \u201C${c.label}\u201D until this warning clears.`,categoryKey:c.key,measured:k(p),minimum:3,autoFixable:!1}));let b=a.get(c.key)??[];if(b.length){let I=me(c.color,i,be),O=me(c.color,r,be),w=Math.min(R(I,i)??0,R(O,r)??0);w<3&&M(n,E({severity:"warning",code:"ga-contrast-low",dimension:"contrast",message:`GA category \u201C${c.label}\u201D reaches only ${k(w)}:1 after its rendered opacity is composited; 3:1 is required`,objectId:b[0].id,categoryKey:c.key,floorId:b[0].floorId,relatedObjectIds:b.map(j=>j.id),measured:k(w),minimum:3,autoFixable:!1}))}}for(let c=0;c<t.categories.length;c++)for(let d=0;d<c;d++){let g=t.categories[c],p=t.categories[d],b=Qt(g.color,p.color);b!=null&&b<25&&M(n,E({severity:"warning",code:"category-colors-too-similar",dimension:"contrast",title:`\u201C${g.label}\u201D and \u201C${p.label}\u201D look too similar`,message:`Categories \u201C${g.label}\u201D and \u201C${p.label}\u201D are only \u0394E ${k(b)} apart; 25 is required`,action:"Pick a visibly different color for either category so buyers can tell them apart.",categoryKey:g.key,measured:k(b),minimum:25,autoFixable:!1}))}for(let c of e){let d=c.objects.filter(g=>g.type==="text");for(let g of d){let p=g.color??t.theme?.textColor??bt,b=R(p,i),I=g.fontSize>=18?3:4.5;(b==null||b<I)&&M(n,E({severity:"warning",code:"text-contrast-low",dimension:"contrast",message:`Text \u201C${g.text}\u201D has ${k(b??0)}:1 contrast against the chart background; ${I}:1 is required`,objectId:g.id,floorId:c.id,measured:k(b??0),minimum:I,autoFixable:!0}))}}if(t.theme?.selectionColor){let c=R(t.theme.selectionColor,i);(c==null||c<3)&&M(n,E({severity:"warning",code:"selection-contrast-low",dimension:"contrast",title:"The selection color is hard to see",message:`Selection rings have ${k(c??0)}:1 contrast against the chart background; 3:1 is required.`,action:"In Theme, choose a Selection color that stands out clearly from the Background color.",measured:k(c??0),minimum:3,autoFixable:!1}))}if(t.theme?.textColor){let c=R(t.theme.textColor,i);(c==null||c<3)&&M(n,E({severity:"warning",code:"theme-text-contrast-low",dimension:"contrast",title:"The theme text color is hard to read",message:`Theme text has ${k(c??0)}:1 contrast against the chart background; 3:1 is required.`,action:"In Theme, choose a Text color with stronger contrast against the Background color.",measured:k(c??0),minimum:3,autoFixable:!1}))}let l=t.theme?.seatLabelColor??zt,f=new Map,h=(c,d,g)=>{let p=f.get(c)??new Map,b=p.get(d)??[];b.push(g),p.set(d,b),f.set(c,p)};for(let c of e)for(let d of c.objects)if(d.type==="row")for(let g of ie(d).keys())h(g,"seat",d.id);else if(d.type==="table")for(let g of ie(d).keys())h(g,"table seat",d.id);else d.type==="booth"&&h(d.categoryKey,"booth",d.id);for(let c of t.categories){let d=f.get(c.key);if(d)for(let[g,p]of d){let b=g==="booth"?Ne:Re,I=De(_e,600),O=Ke(c.color,l),w=R(O,c.color);(w==null||w<I)&&M(n,E({severity:"warning",code:"bookable-label-contrast-low",dimension:"contrast",message:`${g==="booth"?"Booth":g==="seat"?"Seat":"Table-seat"} labels use ${b}u type and have ${k(w??0)}:1 contrast on category \u201C${c.label}\u201D; ${I}:1 is required for small text`,objectId:p[0],relatedObjectIds:p,measured:k(w??0),minimum:I,autoFixable:!0}))}}}function no(t,e){for(let n of t){let i=n.objects.filter(r=>r.type==="section");if(!(i.length<2))for(let r of n.objects){if(!(r.type==="row"||r.type==="table"||r.type==="booth"||r.type==="gaArea"))continue;let l=ue(r),f=i.filter(b=>te(l,b.outline,b.holes)),h=new Map;for(let b of f){let I=b.logicalSectionId??b.id,O=h.get(I)??[];O.push(b),h.set(I,O)}if(h.size<2)continue;let c=[...h.values()],d=c.map(b=>`Section \u201C${b[0].displayLabel??b[0].label}\u201D`),g=d.length===2?d.join(" and "):`${d.slice(0,-1).join(", ")}, and ${d[d.length-1]}`,p=r.type==="gaArea"?"GA area":r.type==="row"?"Row":r.type==="table"?"Table":"Booth";M(e,E({severity:"warning",code:"ambiguous-section-ownership",dimension:"structure",title:`${p} \u201C${r.label}\u201D belongs to more than one section`,message:`${p} \u201C${r.label}\u201D has its center inside ${g}, so its buyer section is unclear.`,action:"Adjust the boundaries until this object sits in one Section. If the overlapping shapes are meant to form one Section, combine them first.",objectId:r.id,relatedObjectIds:[r.id,...c.flatMap(b=>b.map(I=>I.id))],floorId:n.id,autoFixable:!1}))}}}var io={structure:20,geometry:30,contrast:25,labels:15,navigation:10},ro={"seat-overlap":15,"seat-cramped":4,"label-collision":4,"category-contrast-low":3,"ga-contrast-low":3,"category-colors-too-similar":3,"invalid-category-color":10,"text-contrast-low":4,"bookable-label-contrast-low":3,"selection-contrast-low":3,"theme-text-contrast-low":3,"missing-focal-point":10,"object-uncategorized":3,"object-unlabeled":3,"duplicate-object-label-normalized":2,"empty-section":2,"unused-floor":2,"ambiguous-section-ownership":4,"category-inventory-family-conflict":10};function ao(t){let e={...io};for(let r of t){let a=r.severity==="error"?10:2;e[r.dimension]=Math.max(0,e[r.dimension]-(ro[r.code]??a))}let n=Object.values(e).reduce((r,a)=>r+a,0),i=n>=95?"A":n>=85?"B":n>=70?"C":n>=55?"D":"F";return{overall:n,dimensions:e,errorFree:t.every(r=>r.severity!=="error"),grade:i}}var so=new Set(["unpriced-category","object-uncategorized"]);function yt(t,e={}){let n=ye(t),i=dt(t).filter(d=>d.code!=="missing-zone-focal-point"||e.requireExplicitZoneFocals).map(d=>{let g=d.objectId?n.find(I=>I.objects.some(O=>O.id===d.objectId))?.id:void 0,p=d.code==="category-inventory-family-conflict",b=p?t.categories.find(I=>I.key===d.categoryKey):void 0;return E({...d,...p?{severity:"error",title:`Category \u201C${b?.label??d.categoryKey??"Unknown"}\u201D spans incompatible inventory types`,action:"Show the affected objects, then review the safe category split. The repair preserves price, ticket tiers, accessibility assignments, and source provenance."}:{},...e.requireExplicitZoneFocals&&d.code==="missing-zone-focal-point"?{severity:"error"}:{},...g?{floorId:g}:{},source:"structural",dimension:qt(d),autoFixable:p})}),r=Xt(t,n,i),a=Ht(n),l=Yt(t,n,i);if(Zt(t,n,i),no(n,i),to(t,n,i),oo(t,n,i),n.reduce((d,g)=>d+g.objects.filter(p=>p.type==="row"||p.type==="table"||p.type==="booth"||p.type==="gaArea").length,0)===0){let d=new Set(["missing-focal-point","no-bookables"]);for(let g=i.length-1;g>=0;g--)d.has(i[g].code)&&i.splice(g,1)}if(e.requirePricedInventory)for(let d=0;d<i.length;d++)so.has(i[d].code)&&(i[d]={...i[d],severity:"error"});let h=i.filter(d=>d.severity==="error"),c=i.filter(d=>d.severity==="warning");return{issues:i,errors:h,warnings:c,metrics:{floors:n.length,objects:n.reduce((d,g)=>d+g.objects.length,0),seats:r.seats,bookableUnits:a.bookableUnits,inventoryByKind:a.inventoryByKind,categories:t.categories.length,freeTextLabels:l,checkedSeatPairs:r.checkedSeatPairs,minimumSeatDistance:r.minimumSeatDistance},score:ao(i),deferredRules:["rendered-row-label-decollision","rendered-bookable-state-contrast","section-focus-opacity-and-backdrop","24px-pointer-hit-target","reference-image-diff","sightline-blocked","ga-density-high"]}}function co(t,e){if(t.seatCount<2||t.seatSpacing>=e)return!1;let n=se(K(t));t.seatSpacing=k(e,3);let i=se(K(t));return t.origin.x=k(t.origin.x+n.x-i.x,3),t.origin.y=k(t.origin.y+n.y-i.y,3),!0}function lo(t,e){if(t.seatCount<2)return!1;let n=!1;if(t.shape==="round"){let i=q(t.seatArc??360,0,360),r=(i>=360?360/t.seatCount:i/(t.seatCount-1))*Math.PI/180;if(r>0){let a=e/(2*Math.sin(r/2)),l=Math.max(1,a-16);(t.radius??40)<l&&(t.radius=k(l,3),n=!0)}}else{let i=Me(t),r=Math.max(i.top,i.bottom),a=Math.max(i.left,i.right);r>1&&(t.width??80)/r<e&&(t.width=k(r*e,3),n=!0),a>1&&(t.height??50)/a<e&&(t.height=k(a*e,3),n=!0)}return n}function uo(t){return[Gt,Ut].map(n=>({color:n,minimum:Math.min(...t.map(i=>R(n,i)??0))})).sort((n,i)=>i.minimum-n.minimum)[0].color}function ft(t,e,n){let i=ae(t),r=0;for(let a of e)a.type==="row"?r+=K(a).filter(l=>we(i,l,n)).length:a.type==="table"?r+=W(a).filter(l=>we(i,l,n)).length:a.type==="text"&&a.id!==t.id&&pt(i,ae(a),2)&&r++;return r}function yo(t,e,n){if(ft(t,e,n)===0)return!1;let r={...t.position},a=Math.max(12,t.fontSize*1.25),l=[[0,-1],[1,0],[0,1],[-1,0],[1,-1],[1,1],[-1,1],[-1,-1]];for(let f=1;f<=12;f++)for(let[h,c]of l)if(t.position={x:k(r.x+h*a*f,3),y:k(r.y+c*a*f,3)},ft(t,e,n)===0)return!0;return t.position=r,!1}function Vo(t){let e=JSON.parse(JSON.stringify(t)),n=yt(e),i=[],r=We(e);if(r.changed){e=r.doc;for(let d of r.changes){let g=r.before.find(b=>b.categoryKey===d.categoryKey),p=g?.families.map(b=>b.label).join(", ")??"inventory families";i.push({code:"category-inventory-family-conflict",objectId:g?.objectIds[0],message:`Split category \u201C${d.categoryLabel}\u201D across ${p}; preserved its commercial metadata and reassigned ${d.reassignments.length} affected object${d.reassignments.length===1?"":"s"}`})}}let a=Se(e),l=2.5*a,f=ye(e);for(let d of f)for(let g of d.objects)if(g.type==="row"){let p=g.seatSpacing;co(g,l)&&i.push({code:p<2*a?"seat-overlap":"seat-cramped",objectId:g.id,message:`Expanded ${g.id} to the ${k(l)}u target pitch while preserving its centre`})}else g.type==="table"&&lo(g,l)&&i.push({code:"seat-cramped",objectId:g.id,message:`Expanded ${g.id} so its perimeter seats meet the ${k(l)}u target pitch`});let h=e.theme?.background??gt;for(let d of f)for(let g of d.objects){if(g.type!=="text")continue;let p=g.color??e.theme?.textColor??bt,b=g.fontSize>=18?3:4.5;(R(p,h)??0)<b&&(g.color=uo([h]),i.push({code:"text-contrast-low",objectId:g.id,message:`Changed ${g.id} to the highest-contrast black/white ink`}))}for(let d of f){let g=d.objects.filter(p=>p.type==="text");for(let p of g)yo(p,d.objects,a)&&i.push({code:"label-collision",objectId:p.id,message:`Moved ${p.id} to the nearest collision-free deterministic label position`})}e.floors?.length&&(e.objects=e.floors[0].objects);let c=yt(e);return{doc:e,changed:i.length>0,fixes:i,before:n,after:c}}export{ve as a,ie as b,ne as c,Xe as d,We as e,Ze as f,Qt as g,Vo as h};
@@ -1 +1 @@
1
- import{f as P,r as b}from"./chunk-VI2CLV3Y.js";var Z=3,f=4.5,S=3,j=24,ee=20;function E(t){return t.filter(s=>s.visible&&!!s.screenBox)}function v(t,s){return t.x<s.x+s.width&&t.x+t.width>s.x&&t.y<s.y+s.height&&t.y+t.height>s.y}function m(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function o(t,s,a){return a.length?{code:t,message:s,count:a.length,samples:a.slice(0,ee)}:null}function L(t,s,a){return{primaryId:t.seatId,primaryLabel:t.label,...s==null?{}:{measured:Math.round(s*100)/100},...a==null?{}:{minimum:a}}}function Q(t,s,a){return{primaryId:t.id,primaryLabel:t.label,...s==null?{}:{measured:Math.round(s*100)/100},...a==null?{}:{minimum:a}}}function H(t,s,a){return{primaryId:t.objectId,primaryLabel:t.text,...s==null?{}:{measured:Math.round(s*100)/100},...a==null?{}:{minimum:a}}}function x(t,s,a,l){return{primaryId:t,primaryLabel:s,secondaryId:a,secondaryLabel:l}}function ie(t,s="overview",a=null){let l=E(t.labels),c=E(t.hierarchyLabels),d=E(t.freeTextLabels),B=t.gaAreas.filter(e=>e.visible),O=l.map(e=>b(e.ink,e.fill)??0),D=c.map(e=>b(e.ink,e.fill)??0),$=d.map(e=>b(e.ink,e.background)??0),W=B.map(e=>b(e.effectiveBackground,t.canvasBackground)??0),u=a?t.labels.filter(e=>e.categoryKey===a):t.labels,y=a?t.gaAreas.filter(e=>e.categoryKey===a):t.gaAreas,p=u.filter(e=>e.selected),h=u.filter(e=>e.status==="held"),g=u.filter(e=>e.status==="booked"),k=u.filter(e=>e.pointerTarget.active),V=new Set([...t.labels.filter(e=>e.visible&&(e.opacity>.25||e.selected||e.status!=="free")).map(e=>e.categoryKey),...t.gaAreas.filter(e=>e.visible&&e.opacity>.1).map(e=>e.categoryKey)]),w=p.length?m(p.flatMap(e=>[b(t.selectionRingColor,t.canvasBackground)??0,b(t.selectionRingColor,e.fill)??0])):null,n=[],I=(e,i)=>Array.from({length:e},(T,R)=>({primaryId:`overview:${R+1}`,primaryLabel:i}));if(s==="overview"&&t.rung==="sections"&&(n.push(o("overview-section-category-paint","Section overview shells must use the neutral hierarchy palette, not category paint",I(t.overviewStyle.categoryPaintedSectionShells,"category-painted section shell"))),n.push(o("overview-category-detail-visible","Category-tinted section detail must wait until section focus or seat zoom",I(t.overviewStyle.visibleCategoryDetailOutlines,"category detail outline"))),n.push(o("overview-row-hints-visible","Row and seat patterns must not clutter the section overview",I(t.overviewStyle.visibleSectionRowHints,"section row hint"))),n.push(o("overview-availability-clutter","Live availability counts belong in focused detail, not on section overview shells",I(t.overviewStyle.visibleSectionAvailabilityLabels,"section availability label"))),n.push(o("overview-ga-detail-visible","Section-contained standing paint belongs in focused detail, not on section overview shells",I(t.overviewStyle.visibleSectionGADetails,"section-contained GA detail")))),n.push(o("bookable-label-undersized","Visible bookable labels must meet the rendered small-text size floor",l.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>L(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),s==="interaction"){let e=u.length>0,i=y.length>0,T=e||i,R=y.filter(r=>r.visible),X=new Set([...u.flatMap(r=>r.sectionId?[r.sectionId]:[]),...y.flatMap(r=>r.sectionId?[r.sectionId]:[])]),Y=new Set([...t.labels.map(r=>r.categoryKey),...t.gaAreas.map(r=>r.categoryKey)]),A=r=>r.screenCenter.x>=0&&r.screenCenter.x<=t.viewport.width&&r.screenCenter.y>=0&&r.screenCenter.y<=t.viewport.height;n.push(o("detail-rung-missing","Interaction evidence with bookable inventory must render the seat-detail rung",T&&t.rung!=="seats"?[{primaryId:"renderer",primaryLabel:t.rung}]:[])),n.push(o("detail-inventory-not-visible","Interaction evidence must frame at least one real bookable unit",T&&!u.some(A)&&!R.length?[{primaryId:"renderer",primaryLabel:"no target inventory in viewport"}]:[])),n.push(o("pointer-target-inactive","Interaction evidence must expose a live production pointer target",e&&!k.some(A)||!e&&i&&!R.some(r=>r.interactive)?[{primaryId:"renderer",primaryLabel:"no active pointer target in viewport"}]:[])),n.push(o("pointer-target-undersized","Every active production pointer target must reach at least 24 CSS pixels",k.filter(r=>A(r)&&r.pointerTarget.effectiveMinimumPx<j).map(r=>L(r,r.pointerTarget.effectiveMinimumPx,j)))),n.push(o("selected-state-missing","Interaction evidence must paint a selected unit and its renderer-owned ring",e&&(!p.length||!p.some(r=>t.selectionRingSeatIds.includes(r.seatId)))?[{primaryId:"renderer",primaryLabel:"selected state"}]:[])),n.push(o("selected-state-contrast-low","The selected-state ring must maintain 3:1 graphical contrast with the canvas",p.length&&(w??0)<S?[{primaryId:p[0].seatId,primaryLabel:p[0].label,measured:Math.round((w??0)*100)/100,minimum:S}]:[])),n.push(o("held-state-missing","Interaction evidence must paint a held state when the floor has at least two status-managed units",u.length>=2&&!h.length?[{primaryId:"renderer",primaryLabel:"held state"}]:[])),n.push(o("booked-state-missing","Interaction evidence must paint a taken state when the floor has at least three status-managed units",u.length>=3&&!g.length?[{primaryId:"renderer",primaryLabel:"booked state"}]:[]));let q=new Set(h.map(r=>`${r.fill.toLowerCase()}:${r.opacity}`)),J=new Set(g.map(r=>`${r.fill.toLowerCase()}:${r.opacity}`));n.push(o("status-state-indistinct","Held and taken evidence must resolve to distinct renderer paint",h.length&&g.length&&[...q].some(r=>J.has(r))?[{primaryId:h[0].seatId,primaryLabel:h[0].label,secondaryId:g[0].seatId,secondaryLabel:g[0].label}]:[])),n.push(o("section-focus-missing","Interaction evidence must exercise section focus and its backdrop when section membership exists",X.size&&(!t.focusedSectionId||!t.focusBackdropVisible)?[{primaryId:"renderer",primaryLabel:"section focus"}]:[])),n.push(o("category-filter-missing","Interaction evidence must exercise a category filter when multiple categories exist",Y.size>=2&&(!t.categoryFilterKeys||!t.categoryFilterKeys.length)?[{primaryId:"renderer",primaryLabel:"category filter"}]:[]));let F=t.labels.filter(r=>r.status==="free"&&!r.selected&&t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(r.categoryKey)),C=t.gaAreas.filter(r=>t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(r.categoryKey));n.push(o("category-filter-ineffective","The active category filter must visibly dim excluded free inventory",(F.length||C.length)&&!F.some(r=>r.opacity<=.25)&&!C.some(r=>r.opacity<=.1)?[...F.map(r=>L(r,r.opacity)),...C.map(r=>({primaryId:r.areaId,primaryLabel:r.label,measured:r.opacity}))]:[])),n.push(o("target-category-not-visible","A category-specific interaction scene must visibly paint its exact target category",a&&!V.has(a)?[{primaryId:a,primaryLabel:a}]:[])),n.push(o("target-category-filter-mismatch","A category-specific interaction scene must bind its filter to only the exact target category",a&&(t.categoryFilterKeys?.length!==1||t.categoryFilterKeys[0]!==a)?[{primaryId:a,primaryLabel:a}]:[]))}n.push(o("bookable-label-contrast-low","Visible bookable labels must meet 4.5:1 contrast against their actual paint",l.flatMap(e=>{let i=b(e.ink,e.fill)??0;return i<f?[L(e,i,f)]:[]})));let M=[];for(let e=0;e<l.length;e+=1)for(let i=0;i<e;i+=1)v(l[e].screenBox,l[i].screenBox)&&M.push(x(l[i].seatId,l[i].label,l[e].seatId,l[e].label));n.push(o("bookable-label-collision","Visible bookable labels must not overlap",M)),n.push(o("hierarchy-label-undersized","Visible section and zone labels must meet the rendered small-text size floor",c.filter(e=>e.renderedFontPx<P).map(e=>Q(e,e.renderedFontPx,P)))),n.push(o("hierarchy-label-contrast-low","Visible section and zone labels must meet 4.5:1 contrast against their backing paint",c.flatMap(e=>{let i=b(e.ink,e.fill)??0;return i<f?[Q(e,i,f)]:[]}))),n.push(o("hierarchy-label-outside-section","Visible section labels must remain inside the filled section surface and outside holes",c.filter(e=>e.kind==="section"&&e.fitsContainer===!1).map(e=>Q(e))));let K=[];for(let e=0;e<c.length;e+=1)for(let i=0;i<e;i+=1)v(c[e].screenBox,c[i].screenBox)&&K.push(x(c[i].id,c[i].label,c[e].id,c[e].label));n.push(o("hierarchy-label-collision","Visible hierarchy labels must not overlap each other",K));let _=[];for(let e of c)for(let i of l)v(e.screenBox,i.screenBox)&&_.push(x(e.id,e.label,i.seatId,i.label));n.push(o("hierarchy-bookable-collision","Visible hierarchy labels must not overlap bookable labels",_)),n.push(o("free-text-undersized","Visible chart text must meet the rendered small-text size floor",d.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>H(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),n.push(o("free-text-contrast-low","Visible chart text must meet 4.5:1 contrast against its measured background",d.flatMap(e=>{let i=b(e.ink,e.background)??0;return i<f?[H(e,i,f)]:[]})));let z=[];for(let e=0;e<d.length;e+=1)for(let i=0;i<e;i+=1)v(d[e].screenBox,d[i].screenBox)&&z.push(x(d[i].objectId,d[i].text,d[e].objectId,d[e].text));n.push(o("free-text-collision","Visible chart text labels must not overlap each other",z));let G=[];for(let e of d)for(let i of l)v(e.screenBox,i.screenBox)&&G.push(x(e.objectId,e.text,i.seatId,i.label));n.push(o("free-text-bookable-collision","Visible chart text must not overlap bookable labels",G));let U=[];for(let e of d)for(let i of c)v(e.screenBox,i.screenBox)&&U.push(x(e.objectId,e.text,i.id,i.label));n.push(o("free-text-hierarchy-collision","Visible chart text must not overlap hierarchy labels",U)),n.push(o("ga-contrast-low","Visible GA surfaces must maintain 3:1 graphical contrast with the canvas",B.flatMap(e=>{let i=b(e.effectiveBackground,t.canvasBackground)??0;return i<S?[{primaryId:e.areaId,primaryLabel:e.label,measured:Math.round(i*100)/100,minimum:S}]:[]})));let N=n.filter(e=>!!e);return{version:Z,passed:N.length===0,state:s,targetCategoryKey:a,resolvedRules:["rendered-overview-label-size","rendered-overview-label-contrast","rendered-overview-label-collision","rendered-overview-hierarchy-containment","rendered-overview-section-first-style","rendered-overview-ga-contrast",...s==="interaction"?["rendered-detail-inventory","rendered-pointer-target","rendered-selected-held-taken-states","rendered-section-focus","rendered-category-filter"]:[]],viewport:t.viewport,canvasBackground:t.canvasBackground,effectiveScale:t.effectiveScale,rung:t.rung,inventory:{totalBookableUnits:t.totalBookableUnits,totalLabelledBookableUnits:t.totalLabelledBookableUnits,visibleBookableLabels:l.length,hiddenBookableLabels:t.hiddenLabels,visibleHierarchyLabels:c.length,visibleFreeTextLabels:d.length,visibleGAAreas:B.length},overviewStyle:t.overviewStyle,composition:{hierarchy:t.hierarchyLabels.filter(e=>e.role==="name").map(e=>({id:e.id,kind:e.kind,label:e.label,visible:e.visible})).sort((e,i)=>e.kind.localeCompare(i.kind)||e.id.localeCompare(i.id)),labelledObjects:t.freeTextLabels.map(e=>({objectId:e.objectId,kind:e.kind,text:e.text,visible:e.visible})).sort((e,i)=>e.objectId.localeCompare(i.objectId)||e.kind.localeCompare(i.kind)),gaAreas:t.gaAreas.map(e=>({areaId:e.areaId,label:e.label,categoryKey:e.categoryKey,...e.sectionId?{sectionId:e.sectionId}:{},visible:e.visible})).sort((e,i)=>e.areaId.localeCompare(i.areaId)),bookableSectionIds:[...new Set(t.labels.flatMap(e=>e.sectionId?[e.sectionId]:[]))].sort(),categoryKeys:[...new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)])].sort(),activeCategoryKeys:[...V].sort()},metrics:{minimumRenderedBookableLabelPx:m(l.map(e=>e.renderedFontPx)),minimumBookableLabelContrast:m(O),minimumRenderedHierarchyLabelPx:m(c.map(e=>e.renderedFontPx)),minimumHierarchyLabelContrast:m(D),minimumRenderedFreeTextPx:m(d.map(e=>e.renderedFontPx)),minimumFreeTextContrast:m($),minimumGAContrast:m(W),minimumEffectivePointerTargetPx:m(k.map(e=>e.pointerTarget.effectiveMinimumPx)),selectedRingContrast:w==null?null:Math.round(w*100)/100},interaction:{applicable:{detail:u.length>0||y.length>0,pointer:u.length>0||y.length>0,held:u.length>=2,booked:u.length>=3,sectionFocus:u.some(e=>!!e.sectionId)||y.some(e=>!!e.sectionId),categoryFilter:new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)]).size>=2},selectedUnits:p.length,heldUnits:h.length,bookedUnits:g.length,activePointerTargets:k.length,focusedSectionId:t.focusedSectionId,focusBackdropVisible:t.focusBackdropVisible,categoryFilterKeys:t.categoryFilterKeys},findings:N}}export{Z as a,ie as b};
1
+ import{g as P,s as b}from"./chunk-GXMGOWKB.js";var Z=3,f=4.5,S=3,j=24,ee=20;function E(t){return t.filter(s=>s.visible&&!!s.screenBox)}function v(t,s){return t.x<s.x+s.width&&t.x+t.width>s.x&&t.y<s.y+s.height&&t.y+t.height>s.y}function m(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function o(t,s,a){return a.length?{code:t,message:s,count:a.length,samples:a.slice(0,ee)}:null}function L(t,s,a){return{primaryId:t.seatId,primaryLabel:t.label,...s==null?{}:{measured:Math.round(s*100)/100},...a==null?{}:{minimum:a}}}function Q(t,s,a){return{primaryId:t.id,primaryLabel:t.label,...s==null?{}:{measured:Math.round(s*100)/100},...a==null?{}:{minimum:a}}}function H(t,s,a){return{primaryId:t.objectId,primaryLabel:t.text,...s==null?{}:{measured:Math.round(s*100)/100},...a==null?{}:{minimum:a}}}function x(t,s,a,l){return{primaryId:t,primaryLabel:s,secondaryId:a,secondaryLabel:l}}function ie(t,s="overview",a=null){let l=E(t.labels),c=E(t.hierarchyLabels),d=E(t.freeTextLabels),B=t.gaAreas.filter(e=>e.visible),O=l.map(e=>b(e.ink,e.fill)??0),D=c.map(e=>b(e.ink,e.fill)??0),$=d.map(e=>b(e.ink,e.background)??0),W=B.map(e=>b(e.effectiveBackground,t.canvasBackground)??0),u=a?t.labels.filter(e=>e.categoryKey===a):t.labels,y=a?t.gaAreas.filter(e=>e.categoryKey===a):t.gaAreas,p=u.filter(e=>e.selected),h=u.filter(e=>e.status==="held"),g=u.filter(e=>e.status==="booked"),k=u.filter(e=>e.pointerTarget.active),V=new Set([...t.labels.filter(e=>e.visible&&(e.opacity>.25||e.selected||e.status!=="free")).map(e=>e.categoryKey),...t.gaAreas.filter(e=>e.visible&&e.opacity>.1).map(e=>e.categoryKey)]),w=p.length?m(p.flatMap(e=>[b(t.selectionRingColor,t.canvasBackground)??0,b(t.selectionRingColor,e.fill)??0])):null,n=[],I=(e,i)=>Array.from({length:e},(T,R)=>({primaryId:`overview:${R+1}`,primaryLabel:i}));if(s==="overview"&&t.rung==="sections"&&(n.push(o("overview-section-category-paint","Section overview shells must use the neutral hierarchy palette, not category paint",I(t.overviewStyle.categoryPaintedSectionShells,"category-painted section shell"))),n.push(o("overview-category-detail-visible","Category-tinted section detail must wait until section focus or seat zoom",I(t.overviewStyle.visibleCategoryDetailOutlines,"category detail outline"))),n.push(o("overview-row-hints-visible","Row and seat patterns must not clutter the section overview",I(t.overviewStyle.visibleSectionRowHints,"section row hint"))),n.push(o("overview-availability-clutter","Live availability counts belong in focused detail, not on section overview shells",I(t.overviewStyle.visibleSectionAvailabilityLabels,"section availability label"))),n.push(o("overview-ga-detail-visible","Section-contained standing paint belongs in focused detail, not on section overview shells",I(t.overviewStyle.visibleSectionGADetails,"section-contained GA detail")))),n.push(o("bookable-label-undersized","Visible bookable labels must meet the rendered small-text size floor",l.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>L(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),s==="interaction"){let e=u.length>0,i=y.length>0,T=e||i,R=y.filter(r=>r.visible),X=new Set([...u.flatMap(r=>r.sectionId?[r.sectionId]:[]),...y.flatMap(r=>r.sectionId?[r.sectionId]:[])]),Y=new Set([...t.labels.map(r=>r.categoryKey),...t.gaAreas.map(r=>r.categoryKey)]),A=r=>r.screenCenter.x>=0&&r.screenCenter.x<=t.viewport.width&&r.screenCenter.y>=0&&r.screenCenter.y<=t.viewport.height;n.push(o("detail-rung-missing","Interaction evidence with bookable inventory must render the seat-detail rung",T&&t.rung!=="seats"?[{primaryId:"renderer",primaryLabel:t.rung}]:[])),n.push(o("detail-inventory-not-visible","Interaction evidence must frame at least one real bookable unit",T&&!u.some(A)&&!R.length?[{primaryId:"renderer",primaryLabel:"no target inventory in viewport"}]:[])),n.push(o("pointer-target-inactive","Interaction evidence must expose a live production pointer target",e&&!k.some(A)||!e&&i&&!R.some(r=>r.interactive)?[{primaryId:"renderer",primaryLabel:"no active pointer target in viewport"}]:[])),n.push(o("pointer-target-undersized","Every active production pointer target must reach at least 24 CSS pixels",k.filter(r=>A(r)&&r.pointerTarget.effectiveMinimumPx<j).map(r=>L(r,r.pointerTarget.effectiveMinimumPx,j)))),n.push(o("selected-state-missing","Interaction evidence must paint a selected unit and its renderer-owned ring",e&&(!p.length||!p.some(r=>t.selectionRingSeatIds.includes(r.seatId)))?[{primaryId:"renderer",primaryLabel:"selected state"}]:[])),n.push(o("selected-state-contrast-low","The selected-state ring must maintain 3:1 graphical contrast with the canvas",p.length&&(w??0)<S?[{primaryId:p[0].seatId,primaryLabel:p[0].label,measured:Math.round((w??0)*100)/100,minimum:S}]:[])),n.push(o("held-state-missing","Interaction evidence must paint a held state when the floor has at least two status-managed units",u.length>=2&&!h.length?[{primaryId:"renderer",primaryLabel:"held state"}]:[])),n.push(o("booked-state-missing","Interaction evidence must paint a taken state when the floor has at least three status-managed units",u.length>=3&&!g.length?[{primaryId:"renderer",primaryLabel:"booked state"}]:[]));let q=new Set(h.map(r=>`${r.fill.toLowerCase()}:${r.opacity}`)),J=new Set(g.map(r=>`${r.fill.toLowerCase()}:${r.opacity}`));n.push(o("status-state-indistinct","Held and taken evidence must resolve to distinct renderer paint",h.length&&g.length&&[...q].some(r=>J.has(r))?[{primaryId:h[0].seatId,primaryLabel:h[0].label,secondaryId:g[0].seatId,secondaryLabel:g[0].label}]:[])),n.push(o("section-focus-missing","Interaction evidence must exercise section focus and its backdrop when section membership exists",X.size&&(!t.focusedSectionId||!t.focusBackdropVisible)?[{primaryId:"renderer",primaryLabel:"section focus"}]:[])),n.push(o("category-filter-missing","Interaction evidence must exercise a category filter when multiple categories exist",Y.size>=2&&(!t.categoryFilterKeys||!t.categoryFilterKeys.length)?[{primaryId:"renderer",primaryLabel:"category filter"}]:[]));let F=t.labels.filter(r=>r.status==="free"&&!r.selected&&t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(r.categoryKey)),C=t.gaAreas.filter(r=>t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(r.categoryKey));n.push(o("category-filter-ineffective","The active category filter must visibly dim excluded free inventory",(F.length||C.length)&&!F.some(r=>r.opacity<=.25)&&!C.some(r=>r.opacity<=.1)?[...F.map(r=>L(r,r.opacity)),...C.map(r=>({primaryId:r.areaId,primaryLabel:r.label,measured:r.opacity}))]:[])),n.push(o("target-category-not-visible","A category-specific interaction scene must visibly paint its exact target category",a&&!V.has(a)?[{primaryId:a,primaryLabel:a}]:[])),n.push(o("target-category-filter-mismatch","A category-specific interaction scene must bind its filter to only the exact target category",a&&(t.categoryFilterKeys?.length!==1||t.categoryFilterKeys[0]!==a)?[{primaryId:a,primaryLabel:a}]:[]))}n.push(o("bookable-label-contrast-low","Visible bookable labels must meet 4.5:1 contrast against their actual paint",l.flatMap(e=>{let i=b(e.ink,e.fill)??0;return i<f?[L(e,i,f)]:[]})));let M=[];for(let e=0;e<l.length;e+=1)for(let i=0;i<e;i+=1)v(l[e].screenBox,l[i].screenBox)&&M.push(x(l[i].seatId,l[i].label,l[e].seatId,l[e].label));n.push(o("bookable-label-collision","Visible bookable labels must not overlap",M)),n.push(o("hierarchy-label-undersized","Visible section and zone labels must meet the rendered small-text size floor",c.filter(e=>e.renderedFontPx<P).map(e=>Q(e,e.renderedFontPx,P)))),n.push(o("hierarchy-label-contrast-low","Visible section and zone labels must meet 4.5:1 contrast against their backing paint",c.flatMap(e=>{let i=b(e.ink,e.fill)??0;return i<f?[Q(e,i,f)]:[]}))),n.push(o("hierarchy-label-outside-section","Visible section labels must remain inside the filled section surface and outside holes",c.filter(e=>e.kind==="section"&&e.fitsContainer===!1).map(e=>Q(e))));let K=[];for(let e=0;e<c.length;e+=1)for(let i=0;i<e;i+=1)v(c[e].screenBox,c[i].screenBox)&&K.push(x(c[i].id,c[i].label,c[e].id,c[e].label));n.push(o("hierarchy-label-collision","Visible hierarchy labels must not overlap each other",K));let _=[];for(let e of c)for(let i of l)v(e.screenBox,i.screenBox)&&_.push(x(e.id,e.label,i.seatId,i.label));n.push(o("hierarchy-bookable-collision","Visible hierarchy labels must not overlap bookable labels",_)),n.push(o("free-text-undersized","Visible chart text must meet the rendered small-text size floor",d.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>H(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),n.push(o("free-text-contrast-low","Visible chart text must meet 4.5:1 contrast against its measured background",d.flatMap(e=>{let i=b(e.ink,e.background)??0;return i<f?[H(e,i,f)]:[]})));let z=[];for(let e=0;e<d.length;e+=1)for(let i=0;i<e;i+=1)v(d[e].screenBox,d[i].screenBox)&&z.push(x(d[i].objectId,d[i].text,d[e].objectId,d[e].text));n.push(o("free-text-collision","Visible chart text labels must not overlap each other",z));let G=[];for(let e of d)for(let i of l)v(e.screenBox,i.screenBox)&&G.push(x(e.objectId,e.text,i.seatId,i.label));n.push(o("free-text-bookable-collision","Visible chart text must not overlap bookable labels",G));let U=[];for(let e of d)for(let i of c)v(e.screenBox,i.screenBox)&&U.push(x(e.objectId,e.text,i.id,i.label));n.push(o("free-text-hierarchy-collision","Visible chart text must not overlap hierarchy labels",U)),n.push(o("ga-contrast-low","Visible GA surfaces must maintain 3:1 graphical contrast with the canvas",B.flatMap(e=>{let i=b(e.effectiveBackground,t.canvasBackground)??0;return i<S?[{primaryId:e.areaId,primaryLabel:e.label,measured:Math.round(i*100)/100,minimum:S}]:[]})));let N=n.filter(e=>!!e);return{version:Z,passed:N.length===0,state:s,targetCategoryKey:a,resolvedRules:["rendered-overview-label-size","rendered-overview-label-contrast","rendered-overview-label-collision","rendered-overview-hierarchy-containment","rendered-overview-section-first-style","rendered-overview-ga-contrast",...s==="interaction"?["rendered-detail-inventory","rendered-pointer-target","rendered-selected-held-taken-states","rendered-section-focus","rendered-category-filter"]:[]],viewport:t.viewport,canvasBackground:t.canvasBackground,effectiveScale:t.effectiveScale,rung:t.rung,inventory:{totalBookableUnits:t.totalBookableUnits,totalLabelledBookableUnits:t.totalLabelledBookableUnits,visibleBookableLabels:l.length,hiddenBookableLabels:t.hiddenLabels,visibleHierarchyLabels:c.length,visibleFreeTextLabels:d.length,visibleGAAreas:B.length},overviewStyle:t.overviewStyle,composition:{hierarchy:t.hierarchyLabels.filter(e=>e.role==="name").map(e=>({id:e.id,kind:e.kind,label:e.label,visible:e.visible})).sort((e,i)=>e.kind.localeCompare(i.kind)||e.id.localeCompare(i.id)),labelledObjects:t.freeTextLabels.map(e=>({objectId:e.objectId,kind:e.kind,text:e.text,visible:e.visible})).sort((e,i)=>e.objectId.localeCompare(i.objectId)||e.kind.localeCompare(i.kind)),gaAreas:t.gaAreas.map(e=>({areaId:e.areaId,label:e.label,categoryKey:e.categoryKey,...e.sectionId?{sectionId:e.sectionId}:{},visible:e.visible})).sort((e,i)=>e.areaId.localeCompare(i.areaId)),bookableSectionIds:[...new Set(t.labels.flatMap(e=>e.sectionId?[e.sectionId]:[]))].sort(),categoryKeys:[...new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)])].sort(),activeCategoryKeys:[...V].sort()},metrics:{minimumRenderedBookableLabelPx:m(l.map(e=>e.renderedFontPx)),minimumBookableLabelContrast:m(O),minimumRenderedHierarchyLabelPx:m(c.map(e=>e.renderedFontPx)),minimumHierarchyLabelContrast:m(D),minimumRenderedFreeTextPx:m(d.map(e=>e.renderedFontPx)),minimumFreeTextContrast:m($),minimumGAContrast:m(W),minimumEffectivePointerTargetPx:m(k.map(e=>e.pointerTarget.effectiveMinimumPx)),selectedRingContrast:w==null?null:Math.round(w*100)/100},interaction:{applicable:{detail:u.length>0||y.length>0,pointer:u.length>0||y.length>0,held:u.length>=2,booked:u.length>=3,sectionFocus:u.some(e=>!!e.sectionId)||y.some(e=>!!e.sectionId),categoryFilter:new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)]).size>=2},selectedUnits:p.length,heldUnits:h.length,bookedUnits:g.length,activePointerTargets:k.length,focusedSectionId:t.focusedSectionId,focusBackdropVisible:t.focusBackdropVisible,categoryFilterKeys:t.categoryFilterKeys},findings:N}}export{Z as a,ie as b};
@@ -1 +1 @@
1
- import{ha as Y}from"./chunk-CNCFI5RT.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
+ import{ia as Y}from"./chunk-RZLIIQDP.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};
@@ -0,0 +1 @@
1
+ var Bt=40,Xt=1200,zt=.8,Kt=3,$t=-2,Wt=20,Vt=.1,Yt=40,qt=40,le=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function $e(e,t){let n=e.text.split(/\r?\n/);if(!e.width)return Math.max(1,n.length);let o=Math.max(1,Math.floor(t/le(e))),r=0;for(let i of n){if(!i.length){r+=1;continue}let s=0;for(let c of i.split(/\s+/)){let a=c.length;s&&s+1+a<=o?s+=1+a:(r+=Math.max(1,Math.ceil(a/o)),s=a%o)}}return Math.max(1,r)}function ue(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),o=Math.max(1,...n.map(c=>c.length))*le(e),r=e.width??o+t*2,i=Math.max(1,r-t*2),s=$e(e,i);return{width:r,height:s*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:s,padding:t}}var We=Math.PI/180;function I(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Ve(e,t,n){let o=Math.cos(n),r=Math.sin(n),i=e.x-t.x,s=e.y-t.y;return{x:t.x+i*o-s*r,y:t.y+i*r+s*o}}function Qt(e,t){return Ve(e,{x:0,y:0},t*We)}function O(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Ye(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 Zt(e){return e.length?Ye(e):null}function V(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,s=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+s*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+s*e.end.y}}function nn(e,t,n){let o={x:(e.x+t.x)/2,y:(e.y+t.y)/2},r={x:(n.x-o.x)*4/3,y:(n.y-o.y)*4/3};return{start:{...e},control1:{x:e.x+(t.x-e.x)/3+r.x,y:e.y+(t.y-e.y)/3+r.y},control2:{x:e.x+(t.x-e.x)*2/3+r.x,y:e.y+(t.y-e.y)*2/3+r.y},end:{...t}}}function he(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[V(e,.5)];let o=Array.from({length:n+1},(a,y)=>V(e,y/n)),r=new Float64Array(o.length);for(let a=1;a<o.length;a+=1){let y=o[a].x-o[a-1].x,l=o[a].y-o[a-1].y;r[a]=r[a-1]+Math.hypot(y,l)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let s=[],c=1;for(let a=0;a<t;a+=1){let y=i*a/(t-1);for(;c<r.length-1&&r[c]<y;)c+=1;let l=r[c-1],f=r[c],u=f===l?0:(y-l)/(f-l);s.push({x:o[c-1].x+(o[c].x-o[c-1].x)*u,y:o[c-1].y+(o[c].y-o[c-1].y)*u})}return s}function R(e,t){return{x:e.x+t.x,y:e.y+t.y}}function F(e,t){return{x:e.x-t.x,y:e.y-t.y}}function T(e,t){return{x:e.x*t,y:e.y*t}}function G(e,t=13){return Array.from({length:t},(n,o)=>V(e,o/(t-1)))}function fe(e,t){let n=Math.max(0,Math.min(1,t))*(e.length-1),o=Math.min(e.length-2,Math.floor(n));return O(e[o],e[o+1],n-o)}function de(e,t,n){let o=Math.max(0,Math.min(1,t)),r=Math.max(o,Math.min(1,n)),i=[fe(e,o)];for(let s=1;s<e.length-1;s+=1){let c=s/(e.length-1);c>o+1e-9&&c<r-1e-9&&i.push(e[s])}return i.push(fe(e,r)),i}function me(e,t){let n=[[0,1],[1,2],[2,3],[3,0]],o=0,r=Number.POSITIVE_INFINITY;n.forEach(([u,p],g)=>{let x=I(O(e[u],e[p],.5),t);x<r&&(r=x,o=g)});let i=e[o],s=e[(o+1)%4],c=e[(o+2)%4],a=e[(o+3)%4],y=O(i,s,.5),l=F(t,y),f=Math.max(1e-9,Math.hypot(l.x,l.y));return{p0:i,p1:s,p2:c,p3:a,normal:T(l,1/f),depth:(I(i,a)+I(s,c))/2}}function pe(e){let{p0:t,p1:n,p2:o,p3:r,normal:i,depth:s}=e,c=F(n,t),a=F(o,r),y=s*.22,l=s*.12;return{nearPath:{start:t,control1:R(R(t,T(c,1/3)),T(i,y)),control2:R(R(t,T(c,2/3)),T(i,y)),end:n},farPath:{start:o,control1:R(R(r,T(a,2/3)),T(i,l)),control2:R(R(r,T(a,1/3)),T(i,l)),end:r}}}function on(e,t,n){if(e.length!==4)throw new Error("A section shell requires four mapped bounds corners");let o=e.reduce((g,x)=>R(g,x),{x:0,y:0});o.x/=4,o.y/=4;let r=I(e[0],e[1]),i=I(e[0],e[3]),s=n==="auto"?r>i*1.25&&I(o,t)>i?"bezier":"tapered":n;if(s==="rectangle")return{mode:s,outline:e.map(g=>({...g}))};let c=me(e,t),{p0:a,p1:y,p2:l,p3:f}=c;if(s==="tapered")return{mode:s,outline:[R(a,T(F(y,a),.14)),R(a,T(F(y,a),1-.14)),l,f]};let{nearPath:u,farPath:p}=pe(c);return{mode:s,outline:[...G(u),...G(p).slice(1)]}}function rn(e,t,n,o){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 r=me(e,t),{p0:i,p1:s,p2:c,p3:a}=r,y=o==="bezier"?pe(r):null,l=y?G(y.nearPath):null,f=y?G(y.farPath).reverse():null,u=Math.min(.055,.18/(n+1));return Array.from({length:n},(p,g)=>{let x=(g+1)/(n+1),h=x-u/2,m=x+u/2;return l&&f?[...de(l,h,m),...de(f,h,m).reverse()]:[O(i,s,h),O(i,s,m),O(a,c,m),O(a,c,h)]})}function qe(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,s=i?Math.max(0,Math.min(1,((e.x-t.x)*o+(e.y-t.y)*r)/i)):0;return Math.hypot(e.x-(t.x+s*o),e.y-(t.y+s*r))}function Je(e,t){let n=1/0;for(let o of t)if(!(o.length<2))for(let r=0,i=o.length-1;r<o.length;i=r++){let s=qe(e,o[i],o[r]);s<n&&(n=s)}return n}function ye(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,c=t[r].x,a=t[r].y;s>e.y!=a>e.y&&e.x<(c-i)*(e.y-s)/(a-s)+i&&(n=!n)}return n}function Qe(e,t,n){let o=ye(e,t)&&!n.some(i=>ye(e,i)),r=Je(e,[t,...n]);return o?r:-r}function L(e,t,n,o,r){let i=Qe({x:e,y:t},o,r);return{x:e,y:t,h:n,d:i,max:i+n*Math.SQRT2}}var Y=class{constructor(){this.items=[]}get size(){return this.items.length}push(t){let n=this.items;n.push(t);let o=n.length-1;for(;o>0;){let r=o-1>>1;if(n[r].max>=n[o].max)break;[n[r],n[o]]=[n[o],n[r]],o=r}}pop(){let t=this.items,n=t[0],o=t.pop();if(t.length&&o){t[0]=o;let r=0;for(;;){let i=r*2+1,s=i+1,c=r;if(i<t.length&&t[i].max>t[c].max&&(c=i),s<t.length&&t[s].max>t[c].max&&(c=s),c===r)break;[t[c],t[r]]=[t[r],t[c]],r=c}}return n}};function xe(e){if(e.length<3)return 0;let t=0;for(let n=0,o=e.length-1;n<e.length;o=n++)t+=(e[o].x+e[n].x)*(e[o].y-e[n].y);return Math.abs(t)/2}function cn(e,t){return Math.max(0,xe(e)-(t??[]).reduce((n,o)=>n+xe(o),0))}function be(e,t){let n=t??[];if(!e.length)return{point:{x:0,y:0},radius:0};if(e.length<3){let x=e.reduce((m,w)=>m+w.x,0)/e.length,h=e.reduce((m,w)=>m+w.y,0)/e.length;return{point:{x,y:h},radius:0}}let o=1/0,r=1/0,i=-1/0,s=-1/0;for(let x of e)x.x<o&&(o=x.x),x.y<r&&(r=x.y),x.x>i&&(i=x.x),x.y>s&&(s=x.y);let c=i-o,a=s-r,y=Math.min(c,a);if(!(y>0))return{point:{x:(o+i)/2,y:(r+s)/2},radius:0};let l=Math.max(c,a)/150,f=new Y,u=y/2;for(let x=o;x<i;x+=y)for(let h=r;h<s;h+=y)f.push(L(x+u,h+u,u,e,n));let p=L(o+c/2,r+a/2,0,e,n),g=0;for(;f.size;){let x=f.pop();if(!x)break;x.d>p.d&&(p=x),!(x.max-p.d<=l)&&(g>=4e3||(g+=1,u=x.h/2,f.push(L(x.x-u,x.y-u,u,e,n)),f.push(L(x.x+u,x.y-u,u,e,n)),f.push(L(x.x-u,x.y+u,u,e,n)),f.push(L(x.x+u,x.y+u,u,e,n))))}return{point:{x:p.x,y:p.y},radius:Math.max(0,p.d)}}function Ze(e,t,n){return Math.max(t,Math.min(n,e))}function ln(e,t,n){return e<t?t:e>n?n:e}function et(e){return Ze(e,0,1)}function ge(e){let t=et(e);return t*t*(3-2*t)}var k=Math.PI*2;function j(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function tt(e,t,n){let o=t-e;if(n){for(;o<0;)o+=k;for(;o>=k;)o-=k}else{for(;o>0;)o-=k;for(;o<=-k;)o+=k}return o}function hn(e){return e.end}function Me(e){if(e.version!==1||e.closed!==!0||!j(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||!j(n.end))return!1;if(n.kind==="line"){if(I(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!j(n.control1)||!j(n.control2)||I(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!j(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(I(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(I(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||I(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return I(t,e.start)<=1e-4}function nt(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 mn(e,t=2){if(!Me(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 s=Math.atan2(r.y-i.center.y,r.x-i.center.x),c=Math.atan2(i.end.y-i.center.y,i.end.x-i.center.x),a=tt(s,c,i.clockwise),y=Math.max(2,Math.ceil(Math.abs(a)*i.radius/n));for(let l=1;l<=y;l+=1){let f=s+a*l/y;o.push({x:i.center.x+Math.cos(f)*i.radius,y:i.center.y+Math.sin(f)*i.radius})}}else{let s=I(r,i.control1)+I(i.control1,i.control2)+I(i.control2,i.end),c=Math.max(2,Math.ceil(s/n));for(let a=1;a<=c;a+=1)o.push(nt(r,i,a/c))}r=i.end}return I(o[o.length-1],o[0])<=1e-4&&o.pop(),o}function Pe(e,t,n){return ot(e,r=>({x:r.x+t,y:r.y+n}))}function ot(e,t,n=1,o=!1){return{...e,start:t(e.start),segments:e.segments.map(r=>r.kind==="line"?{...r,end:t(r.end)}:r.kind==="arc"?{...r,center:t(r.center),radius:r.radius*Math.abs(n),clockwise:o?!r.clockwise:r.clockwise,end:t(r.end)}:{...r,control1:t(r.control1),control2:t(r.control2),end:t(r.end)})}}var rt=45,q=150,it=60;function st(e){let t=rt/100;if(e<=t)return q;let n=Math.min(1,(e-t)/(1-t));return q-n*(q-it)}var we=.5523;function Se(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function ct(e){let t=[],n=[];for(e.forEach((o,r)=>{j(o)&&(t.length&&Se(t[t.length-1],o)||(t.push({x:o.x,y:o.y}),n.push(r)))});t.length>1&&Se(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}function pn(e,t,n){return ft(e,{cornerSmoothing:t,...n})}var at=.5,lt=4/3;function ut(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 s=-r/i,c=o/i,a=n*lt;return{kind:"bezier",control1:{x:e.x+o/3+s*a,y:e.y+r/3+c*a},control2:{x:e.x+o*2/3+s*a,y:e.y+r*2/3+c*a},end:{...t}}}function ft(e,t){let{points:n,sourceIndex:o}=ct(e),r=n.length;if(r<3)return null;let i=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,s=t.edgeCurvature,c=new Array(r).fill(0);if(s?.length)for(let d=0;d<r;d+=1){let M=s[o[d]];c[d]=Number.isFinite(M)?Math.min(100,Math.max(-100,M))/100:0}let a=c.some(d=>Math.abs(d)>1e-6);if(i<=0&&!a)return null;let y=t.wideAngleThresholdDeg??st(i),l=[];for(let d=0;d<r;d+=1)l[d]=I(n[d],n[(d+1)%r]);let f=new Array(r).fill(0);for(let d=0;d<r;d+=1){let M=n[(d-1+r)%r],S=n[d],P=n[(d+1)%r],E={x:M.x-S.x,y:M.y-S.y},C={x:P.x-S.x,y:P.y-S.y},A=Math.hypot(E.x,E.y),_=Math.hypot(C.x,C.y);if(A<=1e-9||_<=1e-9)continue;let H=Math.min(1,Math.max(-1,(E.x*C.x+E.y*C.y)/(A*_))),D=Math.acos(H)*180/Math.PI;if(D<y)continue;let W=ge((D-y)/(180-y));f[d]=i*W*.5*Math.min(A,_)}for(let d=0;d<r;d+=1){let M=(d+1)%r,S=f[d]+f[M];if(S>l[d]&&S>1e-9){let P=l[d]/S;f[d]*=P,f[M]*=P}}let u=new Array(r),p=new Array(r);for(let d=0;d<r;d+=1){let M=n[(d-1+r)%r],S=n[d],P=n[(d+1)%r];if(f[d]<=1e-6){u[d]={...S},p[d]={...S};continue}let E=I(S,M)||1,C=I(S,P)||1;u[d]={x:S.x+(M.x-S.x)/E*f[d],y:S.y+(M.y-S.y)/E*f[d]},p[d]={x:S.x+(P.x-S.x)/C*f[d],y:S.y+(P.y-S.y)/C*f[d]}}if(f.every(d=>d<=1e-6)&&!a)return null;let g=[],x={...p[0]},h=x,m=(d,M)=>{if(I(h,d)<=1e-9)return;let S=c[M];Math.abs(S)>1e-6?g.push(ut(h,d,S*at*l[M])):g.push({kind:"line",end:{...d}}),h=d};for(let d=1;d<=r;d+=1){let M=d%r,S=n[M];m(u[M],(d-1)%r),f[M]>1e-6&&I(u[M],p[M])>1e-9&&(g.push({kind:"bezier",control1:O(u[M],S,we),control2:O(p[M],S,we),end:{...p[M]}}),h=p[M])}if(!g.length)return null;let w=g[g.length-1];I(w.end,x)>1e-9&&(w.kind==="line"?w.end={...x}:g.push({kind:"line",end:{...x}}));let b={version:1,closed:!0,start:x,segments:g};return Me(b)?b:null}function yn(e){let t=[],n=e.start;for(let r of e.segments)t.push(n),n=r.end;let o=[];for(let r=e.segments.length-1;r>=0;r-=1){let i=e.segments[r],s=t[r];i.kind==="line"?o.push({kind:"line",end:{...s}}):i.kind==="arc"?o.push({kind:"arc",center:{...i.center},radius:i.radius,clockwise:!i.clockwise,end:{...s}}):o.push({kind:"bezier",control1:{...i.control2},control2:{...i.control1},end:{...s}})}return{version:1,closed:!0,start:{...e.start},segments:o}}function bn(e,t,n){let o=[];for(let r=0;r<e.length-1;r+=1){let i=e[r],s=e[r+1],c=Math.hypot(s.x-i.x,s.y-i.y);if(c<=0)continue;let a=Math.max(1,Math.round(c/n)),y=c/a,l=Math.atan2(s.y-i.y,s.x-i.x),f=r===0,p=(r>0?t[r-1]:void 0)==="break"?2:1,g=f?{...i}:{x:i.x+Math.cos(l)*y*p,y:i.y+Math.sin(l)*y*p},x=f?a+1:Math.max(1,a-(p-1));o.push({origin:g,rotation:l*180/Math.PI,seatCount:x,seatSpacing:y})}return o}function gn(e){let t=e.rotation*Math.PI/180,n={x:Math.cos(t),y:Math.sin(t)};return Array.from({length:e.seatCount},(o,r)=>({x:e.origin.x+n.x*r*e.seatSpacing,y:e.origin.y+n.y*r*e.seatSpacing}))}function wn(e){return e.reduce((t,n)=>t+n.seatCount,0)}function ve(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((u,p)=>u.segmentedRow.componentIndex-p.segmentedRow.componentIndex),s=i[0]?.segmentedRow?.componentCount??0,c=i[0]?.segmentedRow;if(!c||!(s>=2&&i.length===s&&c?.boundaryBefore==="start"&&i.every((u,p)=>u.segmentedRow?.kind==="segmented-row-v1"&&u.segmentedRow.groupId===o&&u.segmentedRow.componentCount===s&&u.segmentedRow.componentIndex===p&&u.segmentedRow.repeatLabelOnComponents===c.repeatLabelOnComponents&&(p===0?u.segmentedRow.boundaryBefore==="start":u.segmentedRow.boundaryBefore!=="start")&&u.segmentedRow.displayLabel===c.displayLabel)))continue;let y=i.reduce((u,p)=>u+p.seatCount,0),l=0,f=0;for(let u of i)u.segmentedRow.boundaryBefore==="break"&&(l+=1),t.set(u.id,{groupId:o,adjacencyOffset:l,displayOffset:f,displayLabel:c.displayLabel,totalSeats:y,canonical:i[0],viewFromSeatUrl:c.viewFromSeatUrl,viewFromSeatMeta:c.viewFromSeatMeta,confidenceEvidence:c.confidenceEvidence}),l+=u.seatCount,f+=u.seatCount}return t}var Ie="ABCDEFGHIJKLMNOPQRSTUVWXYZ",dt="ABCDEFGHJKLMNPQRSTUVWXYZ",ht="abcdefghijklmnopqrstuvwxyz";function Ee(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 mt(e,t){let n=t.startAt-1,o=e+n;if(t.scheme==="numbers")return String(o+1);let r=t.skipAmbiguous?dt:Ie;return Ee(o,r)}function J(e,t=!1){let n=t?ht:Ie;return Ee(Math.max(0,Math.floor(e)-1),n)}var pt=[[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 Ce(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of pt)for(;t>=o;)n+=r,t-=o;return n}function Mn(e,t){let n=e.length;return e.map((o,r)=>{let i=t.reverse?n-1-r:r;return{...o,label:mt(i,t)}})}function yt(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 Q(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",s=e.seatNumbering?.prefix??"",c=e.seatNumbering?.endAt,a=e.seatCount;if(i==="updown"||i==="updown-descending"){let p=Math.ceil(a/2),g=i==="updown"?t<p?n+2*t:n-1+2*(a-t):t<p?n+2*(p-1-t):n+1+2*(t-p);return`${s}${g}`}let y=i==="odd"||i==="even"?2:r,l=c!=null&&Number.isFinite(c)?c-(a-1)*y:n,f=o==="center"?yt(a)[t]:o==="rtl"?a-1-t:t,u;switch(i){case"odd":{let p=l%2===1?l:l+1;u=String(p+f*2);break}case"even":{let p=l%2===0?l:l+1;u=String(p+f*2);break}case"roman":u=Ce(l+f*r);break;case"letters-upper":u=J(l+f*r,!1);break;case"letters-lower":u=J(l+f*r,!0);break;default:u=String(l+f*r);break}return`${s}${u}`}function xt(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function Oe(e,t,n){return n?.label??`${e.label}-${Q(e,t)}`}function Z(e,t,n,o){if(o?.displayLabel)return o.displayLabel;if(!n)return`${e.displayLabel??e.label}-${Q(e,t)}`;let r=xt(n),i=n.displayOffset+t;return`${n.displayLabel}-${Q(r,i)}`}var B=.02291666666666667,En=1/B,bt=58,gt=bt*B,Re=0,Ae=3,Te=0,ee=120,wt=0,St=45,Mt=7,X=1.2;function te(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function Cn(e){return Number.isFinite(e)?Math.max(Re,Math.min(Ae,Math.round(e))):Re}function Pt(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Mt?e:Ae}function _e(e,t={}){let n=te(t.floorBaseHeightM,Te,ee,0),o=Math.min(ee,n+Pt(e.elevation)*gt),r=e.height===void 0?o:te(e.height,Te,ee,o),i=te(e.rake,wt,St,0);return{height:r,rake:i}}function Le(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 ke(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],s=e[r+1],c=s.x-i.x,a=s.y-i.y,y=c*c+a*a,l=y>1e-12?((t-i.x)*c+(n-i.y)*a)/y:0;l<0?l=0:l>1&&(l=1);let f=Math.hypot(t-(i.x+l*c),n-(i.y+l*a));f<o&&(o=f)}return o}function vt(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 s=Math.hypot(i.x-t,i.y-n);s>r&&(r=s)}return{cx:t,cy:n,r}}function je(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function ne(e,t){let n=1/0;for(let o of Le(e)){let r=ke(t,o.x,o.y);r<n&&(n=r)}for(let o of Le(t)){let r=ke(e,o.x,o.y);r<n&&(n=r)}return n}function It(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let l of e)n+=l.x,o+=l.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let l of e){let f=Math.hypot(l.x-n,l.y-o);f>r&&(r=f,i=l)}let s=i.x-n,c=i.y-o,a=Math.hypot(s,c);a>1e-9?(s/=a,c/=a):(s=1,c=0);let y=e.map((l,f)=>({p:l,i:f,t:(l.x-n)*s+(l.y-o)*c})).sort((l,f)=>l.t-f.t);return{pts:y.map(l=>l.p),seatIndices:y.map(l=>t[l.i])}}function Et(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let w of e)n+=w.x,o+=w.y;n/=t,o/=t;let r=0,i=0,s=0,c=0,a=0,y=0,l=0;for(let w of e){let b=w.x-n,d=w.y-o;r+=b*b,s+=d*d,i+=b*d,c+=b*b*b,a+=d*d*d,y+=b*d*d,l+=d*b*b}let f=r*s-i*i;if(Math.abs(f)<1e-9)return null;let u=(c+y)/2,p=(a+l)/2,g=(u*s-p*i)/f,x=(p*r-u*i)/f,h=g+n,m=x+o;return!Number.isFinite(h)||!Number.isFinite(m)?null:{cx:h,cy:m}}var Ct=.15;function Ot(e){if(e.length<2)return null;let t=e.map(w=>{let b=0,d=0;for(let M of w.pts)b+=M.x,d+=M.y;return{x:b/w.pts.length,y:d/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,s=0;for(let w of t){let b=w.x-n,d=w.y-o;r+=b*b,i+=b*d,s+=d*d}let c=r+s,a=r*s-i*i,y=c/2+Math.sqrt(Math.max(0,c*c/4-a)),l,f;Math.abs(i)>1e-12?(l=y-s,f=i):r>=s?(l=1,f=0):(l=0,f=1);let u=Math.hypot(l,f);if(!(u>1e-12))return null;l/=u,f/=u;let p=1/0,g=-1/0,x=[];for(let w of e){let b=1/0,d=-1/0;for(let M of w.pts){let S=M.x*l+M.y*f;S<b&&(b=S),S>d&&(d=S),S<p&&(p=S),S>g&&(g=S)}x.push(d-b)}let h=g-p;return h>1e-9?(x.sort((w,b)=>w-b),x[Math.min(x.length-1,Math.floor(x.length*.9))]/h<=Rt?{x:l,y:f}:null):null}var Rt=.35;function Ne(e,t,n,o){let r=new Map;for(let h of n){let m=t[h],w=m.rowId||`__seat-${h}`,b=r.get(w);b||(b={pts:[],idx:[]},r.set(w,b)),b.pts.push({x:m.x,y:m.y}),b.idx.push(h)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[h,m]of r){let w=It(m.pts,m.idx),b=0;for(let d of w.pts)b+=Math.hypot(d.x-o.x,d.y-o.y);i.push({id:h,pts:w.pts,seatIndices:w.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:b/w.pts.length})}let s=i.map(h=>vt(h.pts)),c=[];for(let h=0;h<i.length;h++){let m=1/0;for(let w=0;w<i.length;w++){if(h===w||je(s[h],s[w])>=m)continue;let b=ne(i[h].pts,i[w].pts);b<m&&(m=b)}Number.isFinite(m)&&c.push(m)}c.sort((h,m)=>h-m);let a=c.length?c[Math.floor(c.length/2)]:1,y=Math.max(a*1.8,1e-6),l=i.map(()=>[]);for(let h=0;h<i.length;h++)for(let m=h+1;m<i.length;m++)je(s[h],s[m])>y||ne(i[h].pts,i[m].pts)<=y&&(l[h].push(m),l[m].push(h));let f=0;for(let h=0;h<i.length;h++){if(i[h].blockId!==-1)continue;let m=f++,w=[h];for(i[h].blockId=m;w.length;){let b=w.pop();for(let d of l[b])i[d].blockId===-1&&(i[d].blockId=m,w.push(d))}}let u=new Map;for(let h of i){let m=u.get(h.blockId)??[];m.push(h),u.set(h.blockId,m)}let p=[];for(let h of i){if(h.pts.length<4)continue;let m=Et(h.pts);m&&(!Number.isFinite(m.cx)||!Number.isFinite(m.cy)||p.push({x:m.cx,y:m.cy}))}let g=p.length>=2?(()=>{let h=p.map(b=>b.x).sort((b,d)=>b-d),m=p.map(b=>b.y).sort((b,d)=>b-d),w=Math.floor(p.length/2);return{cx:h[w],cy:m[w]}})():null;if(g){let h=S=>Math.hypot(S.x-g.cx,S.y-g.cy),m=1/0,w=-1/0,b=[];for(let S of i){let P=1/0,E=-1/0;for(let C of S.pts){let A=h(C);A<P&&(P=A),A>E&&(E=A)}b.push(E-P),P<m&&(m=P),E>w&&(w=E)}let d=w-m;b.sort((S,P)=>S-P);let M=b[Math.min(b.length-1,Math.floor(b.length*.9))];if(d>1e-9&&M/d<=Ct){let S=i.map(v=>{let U=0;for(let Ke of v.pts)U+=h(Ke);return{row:v,radius:U/v.pts.length}}),P=0,E=0;for(let v of S)P+=v.radius,E+=v.row.focalDistance;P/=S.length,E/=S.length;let C=0;for(let v of S)C+=(v.radius-P)*(v.row.focalDistance-E);if(C<0)for(let v of S)v.radius=-v.radius;let _=1/0;for(let v of S)v.radius<_&&(_=v.radius);S.sort((v,U)=>v.radius-U.radius);let H=-1,D=-1/0,W=d/Math.max(1,S.length)*.5,ae=[];for(let v of S)v.radius-D>W&&(H++,D=v.radius),v.row.ordinal=H,v.row.blockDepth=v.radius-_,ae.push(v.row);return{sectionId:e,rows:ae,blockCount:f}}}let x=[];for(let[,h]of u){let m=Ot(h);if(m){let w=d=>{let M=0;for(let S of d.pts)M+=S.x*m.x+S.y*m.y;return M/d.pts.length};h.sort((d,M)=>w(d)-w(M)),h.length>=2&&h[0].focalDistance>h[h.length-1].focalDistance&&h.reverse();let b=0;for(let d=0;d<h.length;d++)d>0&&(b+=ne(h[d-1].pts,h[d].pts)),h[d].ordinal=d,h[d].blockDepth=b,x.push(h[d])}else{let w=1/0;for(let b of h)b.focalDistance<w&&(w=b.focalDistance);h.sort((b,d)=>b.focalDistance-d.focalDistance);for(let b=0;b<h.length;b++)h[b].ordinal=b,h[b].blockDepth=Math.max(0,h[b].focalDistance-w),x.push(h[b])}}return{sectionId:e,rows:x,blockCount:f}}function Ge(e){return e?e.accessibility&&e.accessibility.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var K=Math.PI/180,Tt=9,N=16;function re(e,t,n,o){let r=n*K,i=Math.cos(r),s=Math.sin(r);return{x:o.x+e*i-t*s,y:o.y+e*s+t*i}}function Be(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,s=[];if(e.path)return he(e.path,t);if(t<=1)return t===1&&s.push({x:i.x,y:i.y}),s;if(o===0){for(let y=0;y<t;y++)s.push(re(y*n,0,r,i));return s}let c=o/(t-1)*K,a=n/(2*Math.sin(Math.abs(c)/2));for(let y=0;y<t;y++){let l=y*c,f=a*Math.sin(l),u=-a+a*Math.cos(l);s.push(re(f,u,r,i))}return s}function At(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function Fn(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 _t(e,t){let n=At(e);return Be(e).map((o,r)=>{let i=n.get(r),s=Ge(i),c=Oe(e,r,i),a={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:c,displayLabel:Z(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:s.length>0,accessibility:s,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(a).some(y=>y!==void 0&&y!==!1&&y!=="")?a:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle}})}function Xe(e){let t=[];for(let n of _t(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 Lt(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 ze(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(l=>[l.index,l])),r=(l,f,u,p)=>{let g=o.get(l),x=Ge(g),h=g?.label??`${e.label}-${l+1}`,m=e.displayLabel??e.label;return{index:l,label:h,displayLabel:g?.displayLabel??`${m}-${l+1}`,x:f+(g?.dx??0),y:u+(g?.dy??0),categoryKey:g?.categoryKey??e.categoryKey,skipped:!!g?.skip,accessible:x.length>0,accessibility:x,wheelchairSpaceType:g?.wheelchairSpaceType,commercial:g?.commercial,glyph:g?.glyph,viewUrl:g?.viewFromSeatUrl,viewMeta:g?.viewFromSeatUrl?g.viewFromSeatMeta:void 0,labelStyle:g?.labelStyle,...p?{side:p}:{}}};if(e.shape==="round"){let l=(e.radius??40)+N,f=e.rotation*K,u=Math.max(0,Math.min(360,e.seatArc??360));if(u>=360||n===1){for(let h=0;h<n;h++){let m=f+h/n*2*Math.PI;t.push(r(h,e.center.x+l*Math.cos(m),e.center.y+l*Math.sin(m)))}return t}let p=u*K,g=(2*Math.PI-p)/2,x=f+g;for(let h=0;h<n;h++){let m=x+h/(n-1)*p;t.push(r(h,e.center.x+l*Math.cos(m),e.center.y+l*Math.sin(m)))}return t}let i=e.width??80,s=e.height??50,c=Lt(e),a=["top","bottom","left","right"],y=0;for(let l of a){let f=c[l];for(let u=0;u<f;u++){let p,g;l==="top"?(p=-i/2+(u+.5)*i/f,g=-s/2-N):l==="bottom"?(p=-i/2+(u+.5)*i/f,g=s/2+N):l==="left"?(p=-i/2-N,g=-s/2+(u+.5)*s/f):(p=i/2+N,g=-s/2+(u+.5)*s/f);let x=re(p,g,e.rotation,e.center);t.push(r(y++,x.x,x.y,l))}}return t}function Hn(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):ze(e).filter(t=>!t.skipped).length}function kt(e){return ze(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 jt(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"}]}function De(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,c=t[r].x,a=t[r].y;s>e.y!=a>e.y&&e.x<(c-i)*(e.y-s)/(a-s)+i&&(n=!n)}return n}function Nt(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 s=(e.x-n.x)*(r.x-n.x)+(e.y-n.y)*(r.y-n.y),c=(r.x-n.x)**2+(r.y-n.y)**2;return s>=-1e-7&&s<=c+1e-7})}function ie(e,t,n){return De(e,t)&&!(n??[]).some(o=>De(e,o)||Nt(e,o))}function Un(e,t){return be(e,t).point}function oe(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 $(e){switch(e.type){case"row":{let t=Xe(e);if(!t.length)return{x:e.origin.x,y:e.origin.y};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}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return oe(e.points);case"section":return oe(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?oe(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 Fe(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function Dt(e,t){if(e.type!=="gaArea"||!Fe(e.points,t.outline))return!1;let n=e.holes??[],o=t.holes??[];return n.length===o.length&&n.every((r,i)=>Fe(r,o[i]))}function Ft(e,t){let n=e.filter(s=>s.type==="section"),o="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0,r=$(t);return(o?n.find(s=>(s.logicalSectionId??s.id)===o&&(Dt(t,s)||ie(r,s.outline,s.holes))):void 0)??n.find(s=>ie(r,s.outline,s.holes))}function Ht(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 Gn(e,t){let n=Ht(e);return(t?n.find(o=>o.id===t):n[0])?.objects??[]}function Ut(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function se(e,t,n){let o=i=>({x:i.x+t,y:i.y+n}),r=i=>i.map(o);switch(e.type){case"row":return{...e,origin:o(e.origin)};case"table":case"booth":return{...e,center:o(e.center)};case"gaArea":return{...e,points:r(e.points),...e.holes?{holes:e.holes.map(r)}:{}};case"section":return{...e,outline:r(e.outline),...e.outlinePath?{outlinePath:Pe(e.outlinePath,t,n)}:{},...e.holes?{holes:e.holes.map(r)}:{}};case"text":return{...e,position:o(e.position)};case"shape":return{...e,...e.points?{points:r(e.points)}:{},...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 Bn(e,t=900){if(!e.floors||e.floors.length<2)return e;let n=[];return e.floors.forEach((o,r)=>{let i=-r*t;for(let s of o.objects)n.push(i===0?s:se(s,0,i))}),{...e,objects:n,floors:void 0}}function Xn(e){let t=e.floors;if(!t||t.length<2)return e;let n=Gt(e),o=[];return t.forEach((r,i)=>{let{x:s,y:c}=n[i];for(let a of r.objects)o.push(se(a,s,c))}),{...e,objects:o,floors:void 0,referenceImage:void 0,backgroundImage:void 0}}function zn(e){let t=e.floors;if(!t||t.length<2)return!1;let n=t.map(a=>ce({...e,objects:a.objects,floors:void 0,focalPoint:a.focalPoint,referenceImage:void 0,backgroundImage:void 0}));if(n.some(a=>a.width<=0||a.height<=0))return!1;let[o,...r]=n;if(!r.every(a=>{let y=Math.min(o.x+o.width,a.x+a.width)-Math.max(o.x,a.x),l=Math.min(o.y+o.height,a.y+a.height)-Math.max(o.y,a.y);return y<=0||l<=0?!1:y>=Math.min(o.width,a.width)*.7&&l>=Math.min(o.height,a.height)*.7}))return!1;let s={x:o.x+o.width/2,y:o.y+o.height/2},c=Math.hypot(o.width,o.height)/2;return t.every(a=>a.objects.length?a.objects.filter(l=>{let f=$(l);return Math.hypot(f.x-s.x,f.y-s.y)>=c*.25}).length>=a.objects.length*.6:!1)}function Kn(e){let t=e.floors;if(!t||t.length<2)return e;let n=t.map((a,y)=>({floor:a,index:y,height:a.baseHeightM??0})).sort((a,y)=>a.height-y.height||a.index-y.index),o=ce({...e,objects:n[0].floor.objects,floors:void 0,focalPoint:n[0].floor.focalPoint,referenceImage:void 0,backgroundImage:void 0}),r={x:o.x+o.width/2,y:o.y+o.height/2},i=Math.max(48,Math.min(200,Math.max(o.width,o.height)*.06)),s=[],c=0;return n.forEach((a,y)=>{let l=a.floor.objects.map(x=>{let h=$(x);return Math.hypot(h.x-r.x,h.y-r.y)}),f=l.filter(x=>Number.isFinite(x)),u=f.length?Math.min(...f):0,p=f.length?Math.max(...f):0,g=y===0?0:Math.max(0,c+i-u);c=p+g,a.floor.objects.forEach((x,h)=>{if(y>0&&x.type==="shape"&&x.role==="stage")return;if(g===0){s.push(x);return}let m=l[h];if(!Number.isFinite(m)||m<1e-6){s.push(x);return}let w=$(x);s.push(se(x,(w.x-r.x)/m*g,(w.y-r.y)/m*g))})}),{...e,objects:s,floors:void 0,referenceImage:void 0,backgroundImage:void 0}}function Gt(e){let t=e.floors;if(!t?.length)return[{x:0,y:0}];if(t.length<2)return t.map(()=>({x:0,y:0}));let n=t.map(u=>ce({...e,objects:u.objects,floors:void 0,focalPoint:u.focalPoint,referenceImage:void 0,backgroundImage:void 0})),o=Math.max(1,...n.map(u=>Math.max(u.width,u.height))),r=Math.max(64,Math.min(240,o*.08)),i=16/10,s=null;for(let u=1;u<=t.length;u+=1){let p=Math.ceil(t.length/u),g=new Array(u).fill(0),x=new Array(p).fill(0);n.forEach((d,M)=>{let S=M%u,P=Math.floor(M/u);g[S]=Math.max(g[S],d.width),x[P]=Math.max(x[P],d.height)});let h=g.reduce((d,M)=>d+M,0)+r*(u-1),m=x.reduce((d,M)=>d+M,0)+r*(p-1),w=u*p-t.length,b=Math.abs(Math.log(h/Math.max(1,m)/i))+w*.04;(!s||b<s.score)&&(s={columns:u,columnWidths:g,rowHeights:x,score:b})}let{columns:c,columnWidths:a,rowHeights:y}=s,l=[],f=[];return a.reduce((u,p,g)=>(l[g]=u,u+p+r),0),y.reduce((u,p,g)=>(f[g]=u,u+p+r),0),t.map((u,p)=>{let g=n[p],x=p%c,h=Math.floor(p/c),m=l[x]+(a[x]-g.width)/2,w=f[h]+(y[h]-g.height)/2;return{x:m-g.x,y:w-g.y}})}function He(e,t,n,o,r,i){let s=[],c=ve(e),a=f=>!f?.eventConfigurationId||f.eventConfigurationId===o,y=f=>!!f&&(!f.eventConfigurationId||f.eventConfigurationId===o),l=(f,u)=>y(f)?{...f,coverage:u}:void 0;for(let f of e){let u=[];if(f.type==="row"?u=Xe(f):f.type==="table"?u=kt(f):f.type==="booth"&&(u=jt(f)),!u.length)continue;for(let m of u)m.viewUrl&&!a(m.viewMeta)&&(m.viewUrl=void 0,m.viewMeta=void 0);if(f.type==="row"){let m=c.get(f.id);if(m){let w=new Map((f.overrides??[]).map(b=>[b.index,b]));for(let b of u){let d=Number(b.id.slice(b.id.lastIndexOf(":")+1));if(!Number.isInteger(d))continue;b.logicalRowId=m.groupId,b.logicalSeatIndex=m.adjacencyOffset+d,w.get(d)?.displayLabel||(b.displayLabel=Z(f,d,m)),!b.viewUrl&&m.viewFromSeatUrl&&a(m.viewFromSeatMeta)&&(b.viewUrl=m.viewFromSeatUrl,b.viewMeta=m.viewFromSeatMeta);let M=w.get(d)?.confidenceEvidence;b.confidenceEvidence=l(M,"exact-seat")??l(f.confidenceEvidence,"row-representative")??l(m.confidenceEvidence,"row-representative")}}}let p=Ft(e,f),g=p?.viewFromSeatUrl,h=(p?.zone?t?.find(m=>m.id===p.zone):void 0)?.focalPoint??n;for(let m of u){if(!m.confidenceEvidence){let w=Number(m.id.slice(m.id.lastIndexOf(":")+1)),b=(f.type==="row"||f.type==="table")&&Number.isInteger(w)?f.overrides?.find(d=>d.index===w)?.confidenceEvidence:void 0;m.confidenceEvidence=l(b,"exact-seat")??(f.type==="row"?l(f.confidenceEvidence,"row-representative"):void 0)}m.confidenceEvidence??=l(p?.confidenceEvidence,"section-representative")??(i?l(i.evidence,i.coverage):void 0),!m.viewUrl&&g&&a(p?.viewFromSeatMeta)&&(m.viewUrl=g,m.viewMeta=p?.viewFromSeatMeta),!m.viewUrl&&r&&a(r.meta)&&(m.viewUrl=r.url,m.viewMeta=r.meta),p&&(m.sectionId=p.logicalSectionId??p.id),p?.zone&&(m.zoneId=p.zone),h&&(m.focalPoint={...h})}s.push(...u)}return s}function $n(e,t={}){if(e.floors?.length){let o=[];for(let r of e.floors){let i=r.focalPoint??e.focalPoint,s=r.viewFromSeatUrl?{url:r.viewFromSeatUrl,meta:r.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,c=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,a=He(r.objects,e.zones,i,e.eventConfigurationId,s,c);t.resolveEyeHeights!==!1&&Ue(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,a),o.push(...a)}return o}let n=He(e.objects,e.zones,e.focalPoint,e.eventConfigurationId,e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0);return t.resolveEyeHeights!==!1&&Ue(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),n}function Ue(e,t,n,o){let r=e.filter(l=>l.type==="section"),i=n>0||r.some(l=>l.height!==void 0||l.rake!==void 0||(l.elevation??0)>0);if(!r.length||!i||!t){for(let l of o)l.eyeHeightM=n+X;return}let s=new Array(o.length),c=new Map,a=new Map;for(let l=0;l<o.length;l++){let f=o[l],u=r.find(g=>ie({x:f.x,y:f.y},g.outline,g.holes))??null;if(s[l]=u,!u)continue;c.has(u.id)||c.set(u.id,_e(u,{floorBaseHeightM:n}));let p=a.get(u.id);p?p.push(l):a.set(u.id,[l])}let y=new Array(o.length).fill(void 0);for(let[l,f]of a){let u=c.get(l);if(!u)continue;let p=u.rake>0?Math.tan(u.rake*Math.PI/180):0,g=Ne(l,o,f,t);for(let x of g.rows){let h=x.blockDepth*B*p,m=u.height+h;for(let w of x.seatIndices)y[w]=m}}for(let l=0;l<o.length;l++){let f=o[l],u=s[l];if(!u){f.eyeHeightM=n+X;continue}let p=c.get(u.id);f.eyeHeightM=(y[l]??p.height)+X}}var z=40;function ce(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=(s,c)=>{s<t&&(t=s),c<n&&(n=c),s>o&&(o=s),c>r&&(r=c)};for(let s of Ut(e))if(s.type==="row"){let c=new Map((s.overrides??[]).map(a=>[a.index,a]));Be(s).forEach((a,y)=>{let l=c.get(y);l?.skip||i(a.x+(l?.dx??0),a.y+(l?.dy??0))})}else if(s.type==="gaArea")for(let c of s.points)i(c.x,c.y);else if(s.type==="section")for(let c of s.outline)i(c.x,c.y);else if(s.type==="decorImage")i(s.x,s.y),i(s.x+s.width,s.y+s.height);else if(s.type==="shape")if(s.points&&s.points.length)for(let c of s.points)i(c.x,c.y);else s.x!=null&&s.y!=null&&s.width!=null&&s.height!=null&&(i(s.x,s.y),i(s.x+s.width,s.y+s.height));else if(s.type==="table"){let c=N+Tt,a=s.shape==="round"?(s.radius??40)+c:Math.max((s.width??80)/2,(s.height??50)/2)+c;i(s.center.x-a,s.center.y-a),i(s.center.x+a,s.center.y+a)}else if(s.type==="booth"){let c=Math.max(s.width,s.height)/2;i(s.center.x-c,s.center.y-c),i(s.center.x+c,s.center.y+c)}else if(s.type==="text"){let c=ue(s);i(s.position.x,s.position.y),i(s.position.x+c.width,s.position.y+c.height)}for(let s of[e.referenceImage,e.backgroundImage]){if(!s)continue;let{center:c,width:a}=s,y=a*3/4;i(c.x-a/2,c.y-y/2),i(c.x+a/2,c.y+y/2)}if(!isFinite(t)){let s=e.focalPoint??{x:0,y:0};return{x:s.x-200,y:s.y-200,width:400,height:400}}return{x:t-z,y:n-z,width:o-t+z*2,height:r-n+z*2}}export{Bt as a,Xt as b,zt as c,Kt as d,$t as e,Wt as f,Vt as g,Yt as h,qt as i,ue as j,Qt as k,Ye as l,Zt as m,V as n,nn as o,he as p,on as q,rn as r,Je as s,xe as t,cn as u,be as v,Ze as w,ln as x,hn as y,Me as z,mn as A,Pe as B,ot as C,rt as D,st as E,pn as F,at as G,ft as H,yn as I,bn as J,gn as K,wn as L,ve as M,Ee as N,mt as O,J as P,Ce as Q,Mn as R,Q as S,xt as T,Oe as U,Z as V,B as W,En as X,gt as Y,Re as Z,Ae as _,Te as $,ee as aa,wt as ba,St as ca,Mt as da,X as ea,Cn as fa,_e as ga,ke as ha,Et as ia,Ne as ja,N as ka,Be as la,Fn as ma,_t as na,Xe as oa,Lt as pa,ze as qa,Hn as ra,kt as sa,jt as ta,De as ua,ie as va,Un as wa,$ as xa,Ft as ya,Ht as za,Gn as Aa,Ut as Ba,se as Ca,Bn as Da,Xn as Ea,zn as Fa,Kn as Ga,Gt as Ha,$n as Ia,ce as Ja};
@@ -1 +1 @@
1
- import{Ga as v,qa as _,za as A}from"./chunk-CNCFI5RT.js";function x(t){let n=Number(t.slice(t.lastIndexOf(":")+1));return Number.isFinite(n)?n:-1}function H(t,n,i){let e=new Map;for(let o of t){if(o.kind==="booth")continue;let a=e.get(o.rowId);a?a.push(o):e.set(o.rowId,[o])}let c=o=>i.has(o.id)||n(o.id)!=="free",l=[];for(let o of e.values())if(!(o.length<3)){o.sort((a,p)=>x(a.id)-x(p.id));for(let a=1;a<o.length-1;a++){let p=o[a];if(c(p))continue;let g=o[a-1],d=o[a+1];x(p.id)-x(g.id)!==1||x(d.id)-x(p.id)!==1||!c(g)||!c(d)||!i.has(g.id)&&!i.has(d.id)||l.push(p)}}return l}function C(t,n){if(Number.isInteger(t.logicalSeatIndex))return t.logicalSeatIndex;let i=t.id.lastIndexOf(":");if(i<0)return n;let e=Number(t.id.slice(i+1));return Number.isFinite(e)?e:n}function T(t,n){let i=t.x-n.x,e=t.y-n.y;return i*i+e*e}function N(t){let n=0,i=0;for(let e of t)n+=e.x,i+=e.y;return{x:n/t.length,y:i/t.length}}function M(t,n){return t.find(i=>i.focalPoint)?.focalPoint??n}function E(t){return t.commercial?.premium===!0}function q(t,n,i){let e=Math.floor(i.qty);if(!Number.isFinite(e)||e<=0)return{labels:[],reason:"sold_out"};let{categoryKey:c,zoneId:l,focal:o,preferPremium:a}=i,p=new Map,g=[];if(t.forEach((r,b)=>{let m=n.has(r.label)&&(!c||r.categoryKey===c)&&(!l||r.zoneId===l),f=r.logicalRowId??r.rowId,u=p.get(f);u||(u=[],p.set(f,u)),u.push({seat:r,index:C(r,b),elig:m}),m&&g.push(r)}),g.length===0)return{labels:[],reason:"sold_out"};let d=null,s=r=>{if(!d)return!0;if(a&&r.nonPremium!==d.nonPremium)return r.nonPremium<d.nonPremium;if(r.orphan!==d.orphan)return r.orphan<d.orphan;if(r.d2!==d.d2)return r.d2<d.d2;let b=r.rowId.localeCompare(d.rowId);return b!==0?b<0:r.startIndex<d.startIndex};for(let[r,b]of p){let m=[...b].sort((u,k)=>u.index-k.index),f=0;for(;f<m.length;){if(!m[f].elig){f++;continue}let u=f;for(;u<m.length&&m[u].elig&&(u===f||m[u].index===m[u-1].index+1);)u++;let k=u-f;for(let y=0;y+e<=k;y++){let B=y,j=k-(y+e),F=B===1||j===1?1:0,h=m.slice(f+y,f+y+e).map(I=>I.seat),O={labels:h.map(I=>I.label),seats:h,rowId:r,startIndex:m[f+y].index,orphan:F,nonPremium:a?h.reduce((I,L)=>I+(E(L)?0:1),0):0,d2:T(N(h),M(h,o))};s(O)&&(d=O)}f=u}}return d?{labels:d.labels}:g.length<e?{labels:[],reason:"not_enough_together"}:{labels:g.map((r,b)=>({seat:r,i:b,d2:T(r,r.focalPoint??o)})).sort((r,b)=>{if(a){let f=E(r.seat)?0:1,u=E(b.seat)?0:1;if(f!==u)return f-u}if(r.d2!==b.d2)return r.d2-b.d2;let m=(r.seat.logicalRowId??r.seat.rowId).localeCompare(b.seat.logicalRowId??b.seat.rowId);return m!==0?m:C(r.seat,r.i)-C(b.seat,b.i)}).slice(0,e).map(r=>r.seat.label)}}function $(t,n,i,e){let c=Math.floor(e.qty),l=q(t,i,e),a=n.filter(s=>s.bookingMode==="whole"&&s.capacity===c&&i.has(s.label)&&(!e.categoryKey||s.categoryKey===e.categoryKey)&&(!e.zoneId||s.zoneId===e.zoneId)).map(s=>({table:s,d2:T(s.center,s.focalPoint??e.focal)})).sort((s,w)=>s.d2-w.d2||s.table.label.localeCompare(w.table.label))[0];if(!a)return l;if(!l.labels.length)return{labels:[a.table.label]};let p=new Map(t.map(s=>[s.label,s])),g=l.labels.map(s=>p.get(s)).filter(s=>!!s),d=g.length?T(N(g),M(g,e.focal)):Number.POSITIVE_INFINITY;return a.d2<d?{labels:[a.table.label]}:l}function D(t){return{code:"ticket_option_not_applicable",labels:t,message:"That ticket choice is not available for the selected seat."}}function P(t,n){let i=t.applicability;return i?!(i.seatLabels?.length&&!i.seatLabels.includes(n.label)||i.accessibility?.length&&!i.accessibility.some(e=>n.accessibility?.includes(e))):!0}function Q(t,n){return(t.categories.find(i=>i.key===n.categoryKey)?.tiers??[]).filter(i=>P(i,n))}function K(t,n,i){let e=t.categories.find(l=>l.key===n.categoryKey)?.tiers;if(!e?.length)return{kind:"none"};let c=i==null?e.find(l=>P(l,n)):e.find(l=>l.id===i&&P(l,n));return c?{kind:"resolved",tier:c}:{kind:"invalid"}}function z(t,n){return(t.logicalRowId??t.rowId)===(n.logicalRowId??n.rowId)}function R(t){if(Number.isInteger(t.logicalSeatIndex))return t.logicalSeatIndex;let n=t.id.slice(t.id.lastIndexOf(":")+1),i=Number(n);return Number.isInteger(i)?i:void 0}function G(t,n){if(!z(t,n))return!1;let i=R(t),e=R(n);return i!=null&&e!=null&&Math.abs(i-e)===1}function U(t,n){if(!n.length)return null;let i=new Map(v(t,{resolveEyeHeights:!1}).map(o=>[o.label,o])),e=n.flatMap(o=>{let a=i.get(o.label);return a?[{selection:o,seat:a}]:[]}),c=e.map(({seat:o})=>o).filter(o=>o.accessibility?.includes("wheelchair")),l=[];for(let{selection:o,seat:a}of e){let p=K(t,a,o.tierId),g=p.kind==="resolved"?p.tier:void 0;(a.accessibility?.includes("companion")||g?.restriction==="companion")&&!c.some(s=>s.id!==a.id&&G(a,s))&&l.push(a.label)}return l.length?{code:"companion_pair_required",labels:l,message:"Select the adjacent wheelchair place with each companion ticket."}:null}function X(t,n){if(!n.length)return null;let i=new Map(v(t,{resolveEyeHeights:!1}).map(o=>[o.label,o])),e=new Set(t.categories.filter(o=>o.notForSale).map(o=>o.key)),c=[],l=[];for(let o of n){let a=i.get(o.label);if(!a)continue;if(e.has(a.categoryKey)){c.push(a.label);continue}K(t,a,o.tierId).kind==="invalid"&&l.push(a.label)}return c.length?{code:"not_for_sale",labels:c,message:"These seats are not for sale."}:l.length?D(l):U(t,n)}var S=class extends Error{constructor(i,e){super(e);this.objectId=i;this.name="GroupedTableProjectionError"}};function V(t){let n=t.minOccupancy,i=t.maxOccupancy;if(!Number.isInteger(n)||!Number.isInteger(i)||n<1||i<n||i>t.seatCount)throw new S(t.id,`Table "${t.label}" has invalid variable-occupancy bounds`);return{min:n,max:i}}function te(t,n){if(n!==2)return[];let i=[];for(let e of A(t)){if(e.type!=="table"||!e.bookAsWhole&&!e.variableOccupancy)continue;if(e.bookAsWhole&&e.variableOccupancy)throw new S(e.id,`Table "${e.label}" cannot be whole-table and variable-occupancy inventory`);if(!Number.isInteger(e.seatCount)||e.seatCount<1||!e.label.trim())throw new S(e.id,"Grouped tables require a label and at least one chair");let c=e.variableOccupancy?"variable":"whole",l=c==="variable"?V(e):{min:e.seatCount,max:e.seatCount};i.push({objectId:e.id,label:e.label,...e.displayLabel?{displayLabel:e.displayLabel}:{},...e.displayType?{displayType:e.displayType}:{},categoryKey:e.categoryKey,mode:c,capacity:e.seatCount,minOccupancy:l.min,maxOccupancy:l.max,chairs:_(e)})}return i}export{H as a,q as b,$ as c,D as d,P as e,Q as f,K as g,U as h,X as i,S as j,te as k};
1
+ import{Ba as A,Ia as v,sa as _}from"./chunk-RZLIIQDP.js";function x(t){let n=Number(t.slice(t.lastIndexOf(":")+1));return Number.isFinite(n)?n:-1}function H(t,n,i){let e=new Map;for(let o of t){if(o.kind==="booth")continue;let a=e.get(o.rowId);a?a.push(o):e.set(o.rowId,[o])}let c=o=>i.has(o.id)||n(o.id)!=="free",l=[];for(let o of e.values())if(!(o.length<3)){o.sort((a,p)=>x(a.id)-x(p.id));for(let a=1;a<o.length-1;a++){let p=o[a];if(c(p))continue;let g=o[a-1],d=o[a+1];x(p.id)-x(g.id)!==1||x(d.id)-x(p.id)!==1||!c(g)||!c(d)||!i.has(g.id)&&!i.has(d.id)||l.push(p)}}return l}function C(t,n){if(Number.isInteger(t.logicalSeatIndex))return t.logicalSeatIndex;let i=t.id.lastIndexOf(":");if(i<0)return n;let e=Number(t.id.slice(i+1));return Number.isFinite(e)?e:n}function T(t,n){let i=t.x-n.x,e=t.y-n.y;return i*i+e*e}function N(t){let n=0,i=0;for(let e of t)n+=e.x,i+=e.y;return{x:n/t.length,y:i/t.length}}function M(t,n){return t.find(i=>i.focalPoint)?.focalPoint??n}function E(t){return t.commercial?.premium===!0}function q(t,n,i){let e=Math.floor(i.qty);if(!Number.isFinite(e)||e<=0)return{labels:[],reason:"sold_out"};let{categoryKey:c,zoneId:l,focal:o,preferPremium:a}=i,p=new Map,g=[];if(t.forEach((r,b)=>{let m=n.has(r.label)&&(!c||r.categoryKey===c)&&(!l||r.zoneId===l),f=r.logicalRowId??r.rowId,u=p.get(f);u||(u=[],p.set(f,u)),u.push({seat:r,index:C(r,b),elig:m}),m&&g.push(r)}),g.length===0)return{labels:[],reason:"sold_out"};let d=null,s=r=>{if(!d)return!0;if(a&&r.nonPremium!==d.nonPremium)return r.nonPremium<d.nonPremium;if(r.orphan!==d.orphan)return r.orphan<d.orphan;if(r.d2!==d.d2)return r.d2<d.d2;let b=r.rowId.localeCompare(d.rowId);return b!==0?b<0:r.startIndex<d.startIndex};for(let[r,b]of p){let m=[...b].sort((u,k)=>u.index-k.index),f=0;for(;f<m.length;){if(!m[f].elig){f++;continue}let u=f;for(;u<m.length&&m[u].elig&&(u===f||m[u].index===m[u-1].index+1);)u++;let k=u-f;for(let y=0;y+e<=k;y++){let B=y,j=k-(y+e),F=B===1||j===1?1:0,h=m.slice(f+y,f+y+e).map(I=>I.seat),O={labels:h.map(I=>I.label),seats:h,rowId:r,startIndex:m[f+y].index,orphan:F,nonPremium:a?h.reduce((I,L)=>I+(E(L)?0:1),0):0,d2:T(N(h),M(h,o))};s(O)&&(d=O)}f=u}}return d?{labels:d.labels}:g.length<e?{labels:[],reason:"not_enough_together"}:{labels:g.map((r,b)=>({seat:r,i:b,d2:T(r,r.focalPoint??o)})).sort((r,b)=>{if(a){let f=E(r.seat)?0:1,u=E(b.seat)?0:1;if(f!==u)return f-u}if(r.d2!==b.d2)return r.d2-b.d2;let m=(r.seat.logicalRowId??r.seat.rowId).localeCompare(b.seat.logicalRowId??b.seat.rowId);return m!==0?m:C(r.seat,r.i)-C(b.seat,b.i)}).slice(0,e).map(r=>r.seat.label)}}function $(t,n,i,e){let c=Math.floor(e.qty),l=q(t,i,e),a=n.filter(s=>s.bookingMode==="whole"&&s.capacity===c&&i.has(s.label)&&(!e.categoryKey||s.categoryKey===e.categoryKey)&&(!e.zoneId||s.zoneId===e.zoneId)).map(s=>({table:s,d2:T(s.center,s.focalPoint??e.focal)})).sort((s,w)=>s.d2-w.d2||s.table.label.localeCompare(w.table.label))[0];if(!a)return l;if(!l.labels.length)return{labels:[a.table.label]};let p=new Map(t.map(s=>[s.label,s])),g=l.labels.map(s=>p.get(s)).filter(s=>!!s),d=g.length?T(N(g),M(g,e.focal)):Number.POSITIVE_INFINITY;return a.d2<d?{labels:[a.table.label]}:l}function D(t){return{code:"ticket_option_not_applicable",labels:t,message:"That ticket choice is not available for the selected seat."}}function P(t,n){let i=t.applicability;return i?!(i.seatLabels?.length&&!i.seatLabels.includes(n.label)||i.accessibility?.length&&!i.accessibility.some(e=>n.accessibility?.includes(e))):!0}function Q(t,n){return(t.categories.find(i=>i.key===n.categoryKey)?.tiers??[]).filter(i=>P(i,n))}function K(t,n,i){let e=t.categories.find(l=>l.key===n.categoryKey)?.tiers;if(!e?.length)return{kind:"none"};let c=i==null?e.find(l=>P(l,n)):e.find(l=>l.id===i&&P(l,n));return c?{kind:"resolved",tier:c}:{kind:"invalid"}}function z(t,n){return(t.logicalRowId??t.rowId)===(n.logicalRowId??n.rowId)}function R(t){if(Number.isInteger(t.logicalSeatIndex))return t.logicalSeatIndex;let n=t.id.slice(t.id.lastIndexOf(":")+1),i=Number(n);return Number.isInteger(i)?i:void 0}function G(t,n){if(!z(t,n))return!1;let i=R(t),e=R(n);return i!=null&&e!=null&&Math.abs(i-e)===1}function U(t,n){if(!n.length)return null;let i=new Map(v(t,{resolveEyeHeights:!1}).map(o=>[o.label,o])),e=n.flatMap(o=>{let a=i.get(o.label);return a?[{selection:o,seat:a}]:[]}),c=e.map(({seat:o})=>o).filter(o=>o.accessibility?.includes("wheelchair")),l=[];for(let{selection:o,seat:a}of e){let p=K(t,a,o.tierId),g=p.kind==="resolved"?p.tier:void 0;(a.accessibility?.includes("companion")||g?.restriction==="companion")&&!c.some(s=>s.id!==a.id&&G(a,s))&&l.push(a.label)}return l.length?{code:"companion_pair_required",labels:l,message:"Select the adjacent wheelchair place with each companion ticket."}:null}function X(t,n){if(!n.length)return null;let i=new Map(v(t,{resolveEyeHeights:!1}).map(o=>[o.label,o])),e=new Set(t.categories.filter(o=>o.notForSale).map(o=>o.key)),c=[],l=[];for(let o of n){let a=i.get(o.label);if(!a)continue;if(e.has(a.categoryKey)){c.push(a.label);continue}K(t,a,o.tierId).kind==="invalid"&&l.push(a.label)}return c.length?{code:"not_for_sale",labels:c,message:"These seats are not for sale."}:l.length?D(l):U(t,n)}var S=class extends Error{constructor(i,e){super(e);this.objectId=i;this.name="GroupedTableProjectionError"}};function V(t){let n=t.minOccupancy,i=t.maxOccupancy;if(!Number.isInteger(n)||!Number.isInteger(i)||n<1||i<n||i>t.seatCount)throw new S(t.id,`Table "${t.label}" has invalid variable-occupancy bounds`);return{min:n,max:i}}function te(t,n){if(n!==2)return[];let i=[];for(let e of A(t)){if(e.type!=="table"||!e.bookAsWhole&&!e.variableOccupancy)continue;if(e.bookAsWhole&&e.variableOccupancy)throw new S(e.id,`Table "${e.label}" cannot be whole-table and variable-occupancy inventory`);if(!Number.isInteger(e.seatCount)||e.seatCount<1||!e.label.trim())throw new S(e.id,"Grouped tables require a label and at least one chair");let c=e.variableOccupancy?"variable":"whole",l=c==="variable"?V(e):{min:e.seatCount,max:e.seatCount};i.push({objectId:e.id,label:e.label,...e.displayLabel?{displayLabel:e.displayLabel}:{},...e.displayType?{displayType:e.displayType}:{},categoryKey:e.categoryKey,mode:c,capacity:e.seatCount,minOccupancy:l.min,maxOccupancy:l.max,chairs:_(e)})}return i}export{H as a,q as b,$ as c,D as d,P as e,Q as f,K as g,U as h,X as i,S as j,te as k};
@@ -0,0 +1 @@
1
+ var i=24,l=16,h=.14,r=[{key:"circle",label:"Standard seat",shortLabel:"Standard",useCase:"General assigned seating",group:"general",path:null,bounds: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}},{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}},{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}},{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}},{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}},{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}},{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}}],s=r.map(e=>e.key),a=new Map(r.map(e=>[e.key,e]));function L(e){return a.get(e)??a.get("circle")}function p(e){return L(e).label}function o(e){return L(e).path}function u(e,t){return{scale:t*2*(1-.14)/Math.max(e.width,e.height),centreX:e.x+e.width/2,centreY:e.y+e.height/2}}function n(e){return typeof e=="string"&&a.has(e)}function d(e,t){return n(e)?e:n(t?.seatGlyph)?t.seatGlyph:"circle"}export{i as a,l as b,h as c,r as d,s as e,L as f,p as g,o as h,u as i,n as j,d as k};
@@ -1 +1 @@
1
- import{ma as b,qa as p,ra as h,wa as I,za as d}from"./chunk-CNCFI5RT.js";var m="__sl_ga__",f=1e5,v=1e5;function j(t,e){return`${m}${encodeURIComponent(t)}__${e+1}`}function S(t){let e=t.inventorySegments;if(e===void 0)return!0;if(!Array.isArray(e)||e.length<1||e.length>256)return!1;let r=0,i=new Map;for(let o of e){if(!o||typeof o.sourceAreaId!="string"||!o.sourceAreaId.trim()||o.sourceAreaId.length>160||!Number.isInteger(o.startIndex)||o.startIndex<0||!Number.isInteger(o.count)||o.count<1||o.startIndex+o.count>f||(r+=o.count,r>f))return!1;let u=i.get(o.sourceAreaId)??[],n=o.startIndex+o.count;if(u.some(s=>o.startIndex<s.end&&n>s.start))return!1;u.push({start:o.startIndex,end:n}),i.set(o.sourceAreaId,u)}return r===t.capacity}function A(t){let e=Math.min(f,Math.max(0,Math.floor(t.capacity)));return t.inventorySegments===void 0?e?[{sourceAreaId:t.id,startIndex:0,count:e}]:[]:S(t)?t.inventorySegments.map(r=>({...r})):[]}function y(t){return A(t).flatMap(e=>Array.from({length:e.count},(r,i)=>j(e.sourceAreaId,e.startIndex+i)))}function M(t,e){if(t.inventorySegments===void 0||e===t.capacity)return t.inventorySegments;if(e<t.capacity)return;let r=A(t);if(!r.length)return;let i=e-t.capacity;if(!i)return r;let u=r.filter(s=>s.sourceAreaId===t.id).reduce((s,a)=>Math.max(s,a.startIndex+a.count),0),n=r[r.length-1];if(n?.sourceAreaId===t.id&&n.startIndex+n.count===u)n.count+=i;else{if(r.length>=256)return;r.push({sourceAreaId:t.id,startIndex:u,count:i})}return r}function R(t){return d(t).filter(e=>e.type==="gaArea")}function N(t){return t.startsWith(m)}var g="__ungrouped__";function x(t){return t.type==="row"?b(t).map(e=>e.label):t.type==="table"?p(t).map(e=>e.label):t.type==="booth"?h(t).map(e=>e.label):t.type==="gaArea"?y(t):[]}function O(t){return t.type==="row"||t.type==="table"||t.type==="booth"||t.type==="gaArea"}function _(t){let e=d(t),r=e.filter(n=>n.type==="section"),i=new Map;for(let n of r){let s=n.logicalSectionId??n.id;i.get(s)||i.set(s,{id:s,label:n.displayLabel||n.label||"Section",zone:n.zone,seatCount:0,objectIds:[],seatLabels:[]})}let o={id:g,label:"Other seats",seatCount:0,objectIds:[],seatLabels:[]},u=new Map;for(let n of e){if(!O(n))continue;let s=x(n);if(s.length===0)continue;let a=I(e,n),c=a?i.get(a.logicalSectionId??a.id):o;c.seatCount+=s.length,c.objectIds.push(n.id),c.seatLabels.push(...s),u.set(n.id,c.id)}return{sections:[...i.values()],ungrouped:o.objectIds.length?o:null,objectToSection:u}}function C(t,e){return e.has(t.id)||!!t.logicalSectionId&&e.has(t.logicalSectionId)||!!t.zone&&e.has(t.zone)}function G(t,e){let r=new Set;if(!e.size)return r;let{sections:i,ungrouped:o,objectToSection:u}=_(t),n=new Set,s=new Map(i.map(c=>[c.id,c.zone]));for(let c of i){let l=s.get(c.id);(e.has(c.id)||l&&e.has(l))&&n.add(c.id)}let a=!!o&&e.has(g);for(let[c,l]of u)(n.has(l)||a&&l===g)&&r.add(c);return r}function U(t,e){if(!e.size)return t;let r=G(t,e),i=e instanceof Set?e:new Set(e),o=n=>!(r.has(n.id)||n.type==="section"&&C(n,i));if(t.floors&&t.floors.length){let n=!1,s=t.floors.map(a=>{let c=a.objects.filter(o);return c.length!==a.objects.length&&(n=!0),c.length===a.objects.length?a:{...a,objects:c}});return n?{...t,floors:s,objects:s[0].objects}:t}let u=t.objects.filter(o);return u.length===t.objects.length?t:{...t,objects:u}}export{f as a,v as b,j as c,S as d,A as e,y as f,M as g,R as h,N as i,g as j,_ as k,C as l,G as m,U as n};
1
+ import{Ba as d,oa as b,sa as p,ta as h,ya as I}from"./chunk-RZLIIQDP.js";var m="__sl_ga__",f=1e5,v=1e5;function j(t,e){return`${m}${encodeURIComponent(t)}__${e+1}`}function S(t){let e=t.inventorySegments;if(e===void 0)return!0;if(!Array.isArray(e)||e.length<1||e.length>256)return!1;let r=0,i=new Map;for(let o of e){if(!o||typeof o.sourceAreaId!="string"||!o.sourceAreaId.trim()||o.sourceAreaId.length>160||!Number.isInteger(o.startIndex)||o.startIndex<0||!Number.isInteger(o.count)||o.count<1||o.startIndex+o.count>f||(r+=o.count,r>f))return!1;let u=i.get(o.sourceAreaId)??[],n=o.startIndex+o.count;if(u.some(s=>o.startIndex<s.end&&n>s.start))return!1;u.push({start:o.startIndex,end:n}),i.set(o.sourceAreaId,u)}return r===t.capacity}function A(t){let e=Math.min(f,Math.max(0,Math.floor(t.capacity)));return t.inventorySegments===void 0?e?[{sourceAreaId:t.id,startIndex:0,count:e}]:[]:S(t)?t.inventorySegments.map(r=>({...r})):[]}function y(t){return A(t).flatMap(e=>Array.from({length:e.count},(r,i)=>j(e.sourceAreaId,e.startIndex+i)))}function M(t,e){if(t.inventorySegments===void 0||e===t.capacity)return t.inventorySegments;if(e<t.capacity)return;let r=A(t);if(!r.length)return;let i=e-t.capacity;if(!i)return r;let u=r.filter(s=>s.sourceAreaId===t.id).reduce((s,a)=>Math.max(s,a.startIndex+a.count),0),n=r[r.length-1];if(n?.sourceAreaId===t.id&&n.startIndex+n.count===u)n.count+=i;else{if(r.length>=256)return;r.push({sourceAreaId:t.id,startIndex:u,count:i})}return r}function R(t){return d(t).filter(e=>e.type==="gaArea")}function N(t){return t.startsWith(m)}var g="__ungrouped__";function x(t){return t.type==="row"?b(t).map(e=>e.label):t.type==="table"?p(t).map(e=>e.label):t.type==="booth"?h(t).map(e=>e.label):t.type==="gaArea"?y(t):[]}function O(t){return t.type==="row"||t.type==="table"||t.type==="booth"||t.type==="gaArea"}function _(t){let e=d(t),r=e.filter(n=>n.type==="section"),i=new Map;for(let n of r){let s=n.logicalSectionId??n.id;i.get(s)||i.set(s,{id:s,label:n.displayLabel||n.label||"Section",zone:n.zone,seatCount:0,objectIds:[],seatLabels:[]})}let o={id:g,label:"Other seats",seatCount:0,objectIds:[],seatLabels:[]},u=new Map;for(let n of e){if(!O(n))continue;let s=x(n);if(s.length===0)continue;let a=I(e,n),c=a?i.get(a.logicalSectionId??a.id):o;c.seatCount+=s.length,c.objectIds.push(n.id),c.seatLabels.push(...s),u.set(n.id,c.id)}return{sections:[...i.values()],ungrouped:o.objectIds.length?o:null,objectToSection:u}}function C(t,e){return e.has(t.id)||!!t.logicalSectionId&&e.has(t.logicalSectionId)||!!t.zone&&e.has(t.zone)}function G(t,e){let r=new Set;if(!e.size)return r;let{sections:i,ungrouped:o,objectToSection:u}=_(t),n=new Set,s=new Map(i.map(c=>[c.id,c.zone]));for(let c of i){let l=s.get(c.id);(e.has(c.id)||l&&e.has(l))&&n.add(c.id)}let a=!!o&&e.has(g);for(let[c,l]of u)(n.has(l)||a&&l===g)&&r.add(c);return r}function U(t,e){if(!e.size)return t;let r=G(t,e),i=e instanceof Set?e:new Set(e),o=n=>!(r.has(n.id)||n.type==="section"&&C(n,i));if(t.floors&&t.floors.length){let n=!1,s=t.floors.map(a=>{let c=a.objects.filter(o);return c.length!==a.objects.length&&(n=!0),c.length===a.objects.length?a:{...a,objects:c}});return n?{...t,floors:s,objects:s[0].objects}:t}let u=t.objects.filter(o);return u.length===t.objects.length?t:{...t,objects:u}}export{f as a,v as b,j as c,S as d,A as e,y as f,M as g,R as h,N as i,g as j,_ as k,C as l,G as m,U as n};