@seatlayer/core 0.110.1 → 0.111.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/ar-IOQUWTKM.js +1 -0
  2. package/dist/be-XLR5WTXS.js +1 -0
  3. package/dist/bg-AVCWLASZ.js +1 -0
  4. package/dist/ca-TKG35ICB.js +1 -0
  5. package/dist/{chunk-5IADCFUU.js → chunk-5FIX35HN.js} +1 -1
  6. package/dist/{chunk-6CBJBESS.js → chunk-5GHPGPWE.js} +1 -1
  7. package/dist/{chunk-GWGWNBGU.js → chunk-AZWAP4OE.js} +1 -1
  8. package/dist/chunk-BXQQKDIX.js +1 -0
  9. package/dist/{chunk-NVAF2E7Q.js → chunk-FZ74MVKY.js} +1 -1
  10. package/dist/{chunk-GVVZR3YS.js → chunk-MN4M5QZ4.js} +1 -1
  11. package/dist/chunk-N6K5NQYG.js +1 -0
  12. package/dist/{chunk-2VYFNNYC.js → chunk-NQLQNJV2.js} +1 -1
  13. package/dist/{chunk-ZY6WTPTI.js → chunk-NXS6JFBI.js} +1 -1
  14. package/dist/{chunk-DLHW3UDD.js → chunk-XWTAFHYQ.js} +1 -1
  15. package/dist/{chunk-YRDOE3N7.js → chunk-Z6YGWTT3.js} +1 -1
  16. package/dist/core/chart-ops/index.cjs +1 -1
  17. package/dist/core/chart-ops/index.d.cts +1 -1
  18. package/dist/core/chart-ops/index.d.ts +1 -1
  19. package/dist/core/chart-ops/index.js +1 -1
  20. package/dist/core/inventory/index.cjs +1 -1
  21. package/dist/core/inventory/index.js +1 -1
  22. package/dist/core/layout/index.cjs +1 -1
  23. package/dist/core/layout/index.js +1 -1
  24. package/dist/core/sections/index.js +1 -1
  25. package/dist/cs-JRLKXXM5.js +1 -0
  26. package/dist/cy-W3CYXTOV.js +1 -0
  27. package/dist/da-HG4PFYWH.js +1 -0
  28. package/dist/de-KOM2AXXJ.js +1 -0
  29. package/dist/el-NBRQ66EQ.js +1 -0
  30. package/dist/es-AVEG4ZNM.js +1 -0
  31. package/dist/et-33PIOTI4.js +1 -0
  32. package/dist/fa-CDV2VTXV.js +1 -0
  33. package/dist/fi-TKATIOE6.js +1 -0
  34. package/dist/fr-TMDNSR5N.js +1 -0
  35. package/dist/he-4G7OVLJX.js +1 -0
  36. package/dist/hi-XKXNYPYF.js +1 -0
  37. package/dist/hr-BX444QNM.js +1 -0
  38. package/dist/hu-FM46JMDP.js +1 -0
  39. package/dist/id-CBVTYGFP.js +1 -0
  40. package/dist/index.cjs +1 -1
  41. package/dist/index.d.cts +33 -25
  42. package/dist/index.d.ts +33 -25
  43. package/dist/index.js +1 -1
  44. package/dist/it-ZOFOAG6E.js +1 -0
  45. package/dist/ja-NKEBMXTO.js +1 -0
  46. package/dist/ko-RUCELYV7.js +1 -0
  47. package/dist/ku-KKYBDVSA.js +1 -0
  48. package/dist/localeLoaders-YQXZZVNH.js +1 -0
  49. package/dist/lt-3CJ37W7A.js +1 -0
  50. package/dist/lv-H37RDMRX.js +1 -0
  51. package/dist/ms-E5RVBRE6.js +1 -0
  52. package/dist/nl-QHEOTQ7U.js +1 -0
  53. package/dist/no-43HJQ5MK.js +1 -0
  54. package/dist/pl-4LKJHMFJ.js +1 -0
  55. package/dist/pt-LSSE5QHE.js +1 -0
  56. package/dist/ro-U2QASPIY.js +1 -0
  57. package/dist/ru-PTMWREXY.js +1 -0
  58. package/dist/sk-AY2N2ORA.js +1 -0
  59. package/dist/sl-5MQJVNB7.js +1 -0
  60. package/dist/sr-25FTJPUA.js +1 -0
  61. package/dist/{stage-CKb7aNoH.d.cts → stage-BtqKu5aX.d.cts} +1 -1
  62. package/dist/{stage-CKb7aNoH.d.ts → stage-BtqKu5aX.d.ts} +1 -1
  63. package/dist/sv-7VQX4BFH.js +1 -0
  64. package/dist/th-E53HQMDC.js +1 -0
  65. package/dist/tr-IIR6E7OD.js +1 -0
  66. package/dist/uk-HBINQ4XE.js +1 -0
  67. package/dist/vi-TX6I5RWN.js +1 -0
  68. package/dist/view3d/index.cjs +195 -77
  69. package/dist/view3d/index.d.cts +259 -78
  70. package/dist/view3d/index.d.ts +259 -78
  71. package/dist/view3d/index.js +193 -75
  72. package/dist/view3d/scene/scene.worker.cjs +1 -1
  73. package/dist/view3d/scene/scene.worker.js +1 -1
  74. package/dist/zh-Hans-7QNBTEYC.js +1 -0
  75. package/dist/zh-Hant-6KK3D42X.js +1 -0
  76. package/package.json +1 -1
  77. package/dist/ar-C5PA2DVE.js +0 -1
  78. package/dist/be-TMKSMYPN.js +0 -1
  79. package/dist/bg-V6HTEDUB.js +0 -1
  80. package/dist/ca-CTZMHWW4.js +0 -1
  81. package/dist/chunk-3V32MDJI.js +0 -1
  82. package/dist/chunk-4AGC7B64.js +0 -1
  83. package/dist/cs-FUDGOUFL.js +0 -1
  84. package/dist/cy-5RRARIAP.js +0 -1
  85. package/dist/da-PONPPWKY.js +0 -1
  86. package/dist/de-PKG7AAB5.js +0 -1
  87. package/dist/el-H7OFU4QQ.js +0 -1
  88. package/dist/es-QSW5IZ6U.js +0 -1
  89. package/dist/et-GTMPSS72.js +0 -1
  90. package/dist/fa-SGLTFGJF.js +0 -1
  91. package/dist/fi-7YTEAVDM.js +0 -1
  92. package/dist/fr-ECCQ24MZ.js +0 -1
  93. package/dist/he-YHMMDOX7.js +0 -1
  94. package/dist/hi-GRAQX2E6.js +0 -1
  95. package/dist/hr-MN33LRIJ.js +0 -1
  96. package/dist/hu-NW3SMQVM.js +0 -1
  97. package/dist/id-3OPRAUF7.js +0 -1
  98. package/dist/it-RYM74YWO.js +0 -1
  99. package/dist/ja-4NI6DG5D.js +0 -1
  100. package/dist/ko-C4F6UEMK.js +0 -1
  101. package/dist/ku-DMSBMWTC.js +0 -1
  102. package/dist/localeLoaders-G3GCGLPW.js +0 -1
  103. package/dist/lt-3EXKKZFG.js +0 -1
  104. package/dist/lv-4EWNRDCG.js +0 -1
  105. package/dist/ms-7LJBSAEJ.js +0 -1
  106. package/dist/nl-GWTIWXRW.js +0 -1
  107. package/dist/no-T3FW2WLX.js +0 -1
  108. package/dist/pl-OG5OBRHR.js +0 -1
  109. package/dist/pt-YQ6VES5R.js +0 -1
  110. package/dist/ro-VK5MASYF.js +0 -1
  111. package/dist/ru-YU5CYR6T.js +0 -1
  112. package/dist/sk-CE7PXAYL.js +0 -1
  113. package/dist/sl-EYUPV4BG.js +0 -1
  114. package/dist/sr-PPXCN4IK.js +0 -1
  115. package/dist/sv-WR2BJBCJ.js +0 -1
  116. package/dist/th-JUB2DODR.js +0 -1
  117. package/dist/tr-GFHA7FT6.js +0 -1
  118. package/dist/uk-3FTS2SRK.js +0 -1
  119. package/dist/vi-7OTXPOQV.js +0 -1
  120. package/dist/zh-Hans-FD4XNYUA.js +0 -1
  121. package/dist/zh-Hant-7TXVJKJQ.js +0 -1
@@ -1 +1 @@
1
- "use strict";var Nt=Object.defineProperty;var yi=Object.getOwnPropertyDescriptor;var xi=Object.getOwnPropertyNames;var vi=Object.prototype.hasOwnProperty;var Si=(e,t)=>{for(var n in t)Nt(e,n,{get:t[n],enumerable:!0})},Ii=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of xi(t))!vi.call(e,r)&&r!==n&&Nt(e,r,{get:()=>t[r],enumerable:!(o=yi(t,r))||o.enumerable});return e};var wi=e=>Ii(Nt({},"__esModule",{value:!0}),e);var jc={};Si(jc,{CATEGORY_INVENTORY_FAMILIES:()=>It,DEFAULT_EVENT_INVENTORY_LIMIT:()=>gt,GA_UNIT_LABEL_PREFIX:()=>vt,GroupedTableProjectionError:()=>Be,LARGE_VENUE_INVENTORY_MODULE:()=>qt,MAX_DIRECT_ROW_SWEEP:()=>jn,MAX_EVENT_INVENTORY:()=>So,MAX_GA_CAPACITY:()=>he,MAX_ONE_PARTY_GUESTS:()=>ye,MAX_ROW_BLOCK_ROWS:()=>_n,MAX_ROW_SEATS:()=>we,MIN_ROW_BLOCK_ROWS:()=>Tn,MIN_ROW_SEATS:()=>Ie,ONE_PARTY_LIMIT_MESSAGE:()=>za,applicableTicketTiers:()=>Rc,behindStageLabels:()=>Kn,capacityControl:()=>ri,categoryCapacity:()=>Sc,chartCapacity:()=>Rn,companionSelectionIssue:()=>gi,describeCategoryInventoryConflict:()=>mn,effectiveSeatOwnerCategoryCounts:()=>Qe,eventInventoryLimitFor:()=>Io,gaAreasOf:()=>Za,gaBoxBounds:()=>Xa,gaBoxMode:()=>fe,gaInventorySegments:()=>on,gaUnitLabel:()=>_o,gaUnitLabels:()=>rn,gaUnitLabelsForModel:()=>an,gaWheelchairPlaceCount:()=>jo,gaWheelchairUnitLabels:()=>Ya,groupedTableInventory:()=>Ec,growJoinedGAInventory:()=>Wa,inspectCategoryInventoryConflicts:()=>qe,intactRowBlockMembers:()=>Cc,isFullChartDoc:()=>pi,isGaUnitLabel:()=>de,pickBestAvailable:()=>Vn,pickBestAvailableInventory:()=>ki,remediateCategoryInventoryConflicts:()=>bn,resizeChartCapacity:()=>Ic,resolveRowBlockCount:()=>Mc,resolveRowStartCapacity:()=>Ac,resolveRowTerminalCapacity:()=>kc,resolveTicketTierForSeat:()=>Nn,rowBlockEdgePoint:()=>Ln,rowBlockPreviewRows:()=>ii,rowStartEndpoint:()=>di,rowTerminalEndpoint:()=>ui,rowWithStartCapacity:()=>li,rowWithTerminalCapacity:()=>ci,strandedSingles:()=>wc,ticketOptionNotApplicableIssue:()=>bi,ticketSelectionIssue:()=>_c,ticketTierAppliesToSeat:()=>Rt,validGAInventorySegments:()=>St});module.exports=wi(jc);function Gn(e){return e.sectionId?`s:${e.sectionId}`:`r:${e.logicalRowId??e.rowId}`}function Kn(e,t){let n=new Set,o=new Map;for(let r of e){let i=r.focalPoint??t,s=`${i.x},${i.y}`,u=o.get(s);u||(u={focal:i,seats:[]},o.set(s,u)),u.seats.push(r)}for(let{focal:r,seats:i}of o.values()){let s=Dt(i),u=s.x-r.x,l=s.y-r.y,d=Math.hypot(u,l),c=0;for(let v of i)c=Math.max(c,Math.abs(v.x-r.x),Math.abs(v.y-r.y));let f=Math.max(c,1)*1e-6;if(!(d>f))continue;let b=0,m=new Set;for(let v of i)((v.x-r.x)*u+(v.y-r.y)*l)/d<-f&&(b+=1,m.add(Gn(v)));if(!m.size||b*10>i.length)continue;let g=i.filter(v=>m.has(Gn(v)));if(!(g.length*4>i.length))for(let v of g)n.add(v.label)}return n}function Ft(e,t){if(Number.isInteger(e.logicalSeatIndex))return e.logicalSeatIndex;let n=e.id.lastIndexOf(":");if(n<0)return t;let o=Number(e.id.slice(n+1));return Number.isFinite(o)?o:t}function Ue(e,t){let n=e.x-t.x,o=e.y-t.y;return n*n+o*o}function Dt(e){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 Mi(e,t){return e.find(n=>n.focalPoint)?.focalPoint??t}function $t(e){return e.commercial?.premium===!0}var Un=new WeakMap;function Ci(e){let t=Un.get(e);if(t&&t.length===e.length&&t.first===e[0]&&t.last===e[e.length-1])return t;let n=new Map;e.forEach((s,u)=>{let l=s.logicalRowId??s.rowId,d=n.get(l);d||(d=[],n.set(l,d)),d.push({seat:s,index:Ft(s,u),order:u})});let o=new Map([...n].map(([s,u])=>[s,Dt(u.map(l=>l.seat))])),r=[...n].map(([s,u])=>({rowId:s,slots:[...u].sort((l,d)=>l.index-d.index)})),i={length:e.length,first:e[0],last:e[e.length-1],rows:r,rowCentres:o,behind:new Map};return Un.set(e,i),i}function Oi(e,t,n){let o=`${n.x},${n.y}`,r=e.behind.get(o);return r||(r=Kn(t,n),e.behind.set(o,r)),r}function Vn(e,t,n){let o=Math.floor(n.qty);if(!Number.isFinite(o)||o<=0)return{labels:[],reason:"sold_out"};let{categoryKey:r,zoneId:i,focal:s,preferPremium:u,preferNearest:l,preferredRowIds:d,accessibility:c,requireContiguous:f}=n,b=n.preferAisle&&n.aisleLabels?.size?n.aisleLabels:null,m=Ci(e),g=new Uint8Array(e.length),v=0;for(let C=0;C<e.length;C++){let R=e[C];t.has(R.label)&&(!r||R.categoryKey===r)&&(!i||R.zoneId===i)&&(!c||c.some(j=>R.accessibility?.includes(j)))&&(g[C]=1,v+=1)}if(v===0)return{labels:[],reason:"sold_out"};let S=!r&&!i&&!l?Oi(m,e,s):new Set,{rowCentres:A}=m,E=(d??[]).map(C=>A.get(C)).filter(C=>!!C),L=C=>{let R=A.get(C);return!R||!E.length?0:Math.min(...E.map(j=>Ue(R,j)))},I=!1,M=[],y=0,w="",k=0,O=0,a=0,_=0,p=0,h=0,x=0;for(let{rowId:C,slots:R}of m.rows){let j=L(C),G=0;for(;G<R.length;){if(!g[R[G].order]){G++;continue}let Z=G;for(;Z<R.length&&g[R[Z].order]&&(Z===G||R[Z].index===R[Z-1].index+1);)Z++;let F=Z-G;for(let q=0;q+o<=F;q++){let Lt=q,hi=F-(q+o),Tt=Lt===1||hi===1?1:0,it=G+q,at=0,st=0,$n=!1,Fn=0,Dn=0,_t;for(let Me=it;Me<it+o;Me++){let be=R[Me].seat;u&&!$t(be)&&(at+=1),S.size&&S.has(be.label)&&(st+=1),b&&b.has(be.label)&&($n=!0),Fn+=be.x,Dn+=be.y,!_t&&be.focalPoint&&(_t=be.focalPoint)}let jt=b&&!$n?1:0,Ge=Ue({x:Fn/o,y:Dn/o},l?s:_t??s),Bn=R[it].index,ae;if(!I)ae=!0;else if(u&&at!==a)ae=at<a;else if(l&&j!==h)ae=j<h;else if(l&&Ge!==x)ae=Ge<x;else if(st!==_)ae=st<_;else if(jt!==p)ae=jt<p;else if(Tt!==O)ae=Tt<O;else if(Ge!==x)ae=Ge<x;else{let Me=C.localeCompare(w);ae=Me!==0?Me<0:Bn<k}ae&&(I=!0,M=R,y=it,w=C,k=Bn,O=Tt,a=at,_=st,p=jt,h=j,x=Ge)}G=Z}}if(I)return{labels:M.slice(y,y+o).map(C=>C.seat.label)};if(f)return{labels:[],reason:"not_enough_together"};if(v<o)return{labels:[],reason:"not_enough_together"};let T=[];for(let C=0;C<e.length;C++)g[C]&&T.push(e[C]);return{labels:T.map((C,R)=>({seat:C,i:R,rowD2:L(C.logicalRowId??C.rowId),d2:Ue(C,l?s:C.focalPoint??s)})).sort((C,R)=>{if(u){let F=$t(C.seat)?0:1,q=$t(R.seat)?0:1;if(F!==q)return F-q}if(l&&C.rowD2!==R.rowD2)return C.rowD2-R.rowD2;let j=S.has(C.seat.label)?1:0,G=S.has(R.seat.label)?1:0;if(j!==G)return j-G;if(b){let F=b.has(C.seat.label)?0:1,q=b.has(R.seat.label)?0:1;if(F!==q)return F-q}if(C.d2!==R.d2)return C.d2-R.d2;let Z=(C.seat.logicalRowId??C.seat.rowId).localeCompare(R.seat.logicalRowId??R.seat.rowId);return Z!==0?Z:Ft(C.seat,C.i)-Ft(R.seat,R.i)}).slice(0,o).map(C=>C.seat.label)}}function ki(e,t,n,o){let r=Math.floor(o.qty),i=Vn(e,n,o),u=t.filter(f=>f.bookingMode==="whole"&&f.capacity===r&&n.has(f.label)&&(!o.categoryKey||f.categoryKey===o.categoryKey)&&(!o.zoneId||f.zoneId===o.zoneId)&&!o.accessibility).map(f=>({table:f,d2:Ue(f.center,o.preferNearest?o.focal:f.focalPoint??o.focal)})).sort((f,b)=>f.d2-b.d2||f.table.label.localeCompare(b.table.label))[0];if(!u)return i;if(!i.labels.length)return{labels:[u.table.label]};if(o.preferAisle&&o.aisleLabels&&i.labels.some(f=>o.aisleLabels.has(f)))return i;let l=new Map(e.map(f=>[f.label,f])),d=i.labels.map(f=>l.get(f)).filter(f=>!!f),c=d.length?Ue(Dt(d),Mi(d,o.focal)):Number.POSITIVE_INFINITY;return u.d2<c?{labels:[u.table.label]}:i}var Hn=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function Ai(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/Hn(e))),r=0;for(let i of n){if(!i.length){r+=1;continue}let s=0;for(let u of i.split(/\s+/)){let l=u.length;s&&s+1+l<=o?s+=1+l:(r+=Math.max(1,Math.ceil(l/o)),s=l%o)}}return Math.max(1,r)}function zn(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),o=Math.max(1,...n.map(u=>u.length))*Hn(e),r=e.width??o+t*2,i=Math.max(1,r-t*2),s=Ai(e,i);return{width:r,height:s*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:s,padding:t}}var Pi=Math.PI/180;function W(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Ei(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 ct(e,t){return Ei(e,{x:0,y:0},t*Pi)}function Bt(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Ke(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 Xn(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 Yn(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[Xn(e,.5)];let o=Array.from({length:n+1},(l,d)=>Xn(e,d/n)),r=new Float64Array(o.length);for(let l=1;l<o.length;l+=1){let d=o[l].x-o[l-1].x,c=o[l].y-o[l-1].y;r[l]=r[l-1]+Math.hypot(d,c)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let s=[],u=1;for(let l=0;l<t;l+=1){let d=i*l/(t-1);for(;u<r.length-1&&r[u]<d;)u+=1;let c=r[u-1],f=r[u],b=f===c?0:(d-c)/(f-c);s.push({x:o[u-1].x+(o[u].x-o[u-1].x)*b,y:o[u-1].y+(o[u].y-o[u-1].y)*b})}return s}function ee(e,t,n){return Math.max(t,Math.min(n,e))}function Ri(e){return ee(e,0,1)}function Wn(e){let t=Ri(e);return t*t*(3-2*t)}var Ce=Math.PI*2;function Oe(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function Li(e,t,n){let o=t-e;if(n){for(;o<0;)o+=Ce;for(;o>=Ce;)o-=Ce}else{for(;o>0;)o-=Ce;for(;o<=-Ce;)o+=Ce}return o}function lt(e){if(e.version!==1||e.closed!==!0||!Oe(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||!Oe(n.end))return!1;if(n.kind==="line"){if(W(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!Oe(n.control1)||!Oe(n.control2)||W(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!Oe(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(W(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(W(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||W(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return W(t,e.start)<=1e-4}function Ti(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 ut(e,t=2){if(!lt(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),u=Math.atan2(i.end.y-i.center.y,i.end.x-i.center.x),l=Li(s,u,i.clockwise),d=Math.max(2,Math.ceil(Math.abs(l)*i.radius/n));for(let c=1;c<=d;c+=1){let f=s+l*c/d;o.push({x:i.center.x+Math.cos(f)*i.radius,y:i.center.y+Math.sin(f)*i.radius})}}else{let s=W(r,i.control1)+W(i.control1,i.control2)+W(i.control2,i.end),u=Math.max(2,Math.ceil(s/n));for(let l=1;l<=u;l+=1)o.push(Ti(r,i,l/u))}r=i.end}return W(o[o.length-1],o[0])<=1e-4&&o.pop(),o}var _i=45,Gt=150,ji=60;function Ni(e){let t=_i/100;if(e<=t)return Gt;let n=Math.min(1,(e-t)/(1-t));return Gt-n*(Gt-ji)}var Zn=.5523;function qn(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function $i(e){let t=[],n=[];for(e.forEach((o,r)=>{Oe(o)&&(t.length&&qn(t[t.length-1],o)||(t.push({x:o.x,y:o.y}),n.push(r)))});t.length>1&&qn(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}var Fi=.5,Di=4/3;function Bi(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,u=o/i,l=n*Di;return{kind:"bezier",control1:{x:e.x+o/3+s*l,y:e.y+r/3+u*l},control2:{x:e.x+o*2/3+s*l,y:e.y+r*2/3+u*l},end:{...t}}}function Qn(e,t){let{points:n,sourceIndex:o}=$i(e),r=n.length;if(r<3)return null;let i=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,s=t.edgeCurvature,u=new Array(r).fill(0);if(s?.length)for(let I=0;I<r;I+=1){let M=s[o[I]];u[I]=Number.isFinite(M)?Math.min(100,Math.max(-100,M))/100:0}let l=u.some(I=>Math.abs(I)>1e-6);if(i<=0&&!l)return null;let d=t.wideAngleThresholdDeg??Ni(i),c=[];for(let I=0;I<r;I+=1)c[I]=W(n[I],n[(I+1)%r]);let f=new Array(r).fill(0);for(let I=0;I<r;I+=1){let M=n[(I-1+r)%r],y=n[I],w=n[(I+1)%r],k={x:M.x-y.x,y:M.y-y.y},O={x:w.x-y.x,y:w.y-y.y},a=Math.hypot(k.x,k.y),_=Math.hypot(O.x,O.y);if(a<=1e-9||_<=1e-9)continue;let p=Math.min(1,Math.max(-1,(k.x*O.x+k.y*O.y)/(a*_))),h=Math.acos(p)*180/Math.PI;if(h<d)continue;let x=Wn((h-d)/(180-d));f[I]=i*x*.5*Math.min(a,_)}for(let I=0;I<r;I+=1){let M=(I+1)%r,y=f[I]+f[M];if(y>c[I]&&y>1e-9){let w=c[I]/y;f[I]*=w,f[M]*=w}}let b=new Array(r),m=new Array(r);for(let I=0;I<r;I+=1){let M=n[(I-1+r)%r],y=n[I],w=n[(I+1)%r];if(f[I]<=1e-6){b[I]={...y},m[I]={...y};continue}let k=W(y,M)||1,O=W(y,w)||1;b[I]={x:y.x+(M.x-y.x)/k*f[I],y:y.y+(M.y-y.y)/k*f[I]},m[I]={x:y.x+(w.x-y.x)/O*f[I],y:y.y+(w.y-y.y)/O*f[I]}}if(f.every(I=>I<=1e-6)&&!l)return null;let g=[],v={...m[0]},S=v,A=(I,M)=>{if(W(S,I)<=1e-9)return;let y=u[M];Math.abs(y)>1e-6?g.push(Bi(S,I,y*Fi*c[M])):g.push({kind:"line",end:{...I}}),S=I};for(let I=1;I<=r;I+=1){let M=I%r,y=n[M];A(b[M],(I-1)%r),f[M]>1e-6&&W(b[M],m[M])>1e-9&&(g.push({kind:"bezier",control1:Bt(b[M],y,Zn),control2:Bt(m[M],y,Zn),end:{...m[M]}}),S=m[M])}if(!g.length)return null;let E=g[g.length-1];W(E.end,v)>1e-9&&(E.kind==="line"?E.end={...v}:g.push({kind:"line",end:{...v}}));let L={version:1,closed:!0,start:v,segments:g};return lt(L)?L:null}function Gi(e,t){return Math.abs(e.x-t.x)<=1e-7&&Math.abs(e.y-t.y)<=1e-7}function Ve(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function dt(e,t,n){let o=Ve(t,n,e);return Math.abs(o)>1e-7?!1:e.x>=Math.min(t.x,n.x)-1e-7&&e.x<=Math.max(t.x,n.x)+1e-7&&e.y>=Math.min(t.y,n.y)-1e-7&&e.y<=Math.max(t.y,n.y)+1e-7}function Ui(e,t,n,o){let r=Ve(e,t,n),i=Ve(e,t,o),s=Ve(n,o,e),u=Ve(n,o,t);return(r>1e-7&&i<-1e-7||r<-1e-7&&i>1e-7)&&(s>1e-7&&u<-1e-7||s<-1e-7&&u>1e-7)?!0:Math.abs(r)<=1e-7&&dt(n,e,t)||Math.abs(i)<=1e-7&&dt(o,e,t)||Math.abs(s)<=1e-7&&dt(e,n,o)||Math.abs(u)<=1e-7&&dt(t,n,o)}function Ki(e){return e.reduce((t,n,o)=>{let r=e[(o+1)%e.length];return t+n.x*r.y-r.x*n.y},0)}function Vi(e){for(let t=0;t<e.length;t+=1){let n=(t+1)%e.length;for(let o=t+1;o<e.length;o+=1){let r=(o+1)%e.length;if(!(t===o||n===o||r===t)&&Ui(e[t],e[n],e[o],e[r]))return!0}}return!1}function Jn(e){return e.length<3?{ok:!1,code:"too_few_vertices",message:"Add at least three vertices to create a polygon."}:e.length>256?{ok:!1,code:"too_many_vertices",message:"A polygon can contain at most 256 vertices."}:e.some(t=>!Number.isFinite(t.x)||!Number.isFinite(t.y)||Math.abs(t.x)>1e7||Math.abs(t.y)>1e7)?{ok:!1,code:"invalid_coordinate",message:"Every polygon vertex must use a finite coordinate inside the safe chart range."}:e.some((t,n)=>Gi(t,e[(n+1)%e.length]))?{ok:!1,code:"duplicate_vertex",message:"Move or remove duplicate neighbouring vertices."}:Math.abs(Ki(e))<2?{ok:!1,code:"degenerate_polygon",message:"The polygon needs a visible enclosed area."}:Vi(e)?{ok:!1,code:"self_intersection",message:"Polygon edges cannot cross or touch each other."}:{ok:!0}}var eo=64;function Hi(e){let t=e.points??[];if(e.kind!=="polygon"||t.length<3||!Array.isArray(e.edgeCurvature))return[];let n=t.map((o,r)=>{let i=e.edgeCurvature[r];return Number.isFinite(i)?Math.min(100,Math.max(-100,i)):0});return n.some(o=>Math.abs(o)>.5)?n:[]}function zi(e){let t=Hi(e);return t.length?Qn(e.points,{edgeCurvature:t}):null}function Ut(e,t=2){let n=zi(e);return n?ut(n,t):e.points??[]}function to(e,t){let n=Ut(e);return n.length<3||t.length<3||!t.flatMap((r,i)=>{let s=t[(i+1)%t.length];return[r,{x:(r.x+s.x)/2,y:(r.y+s.y)/2}]}).every(r=>le(r,n)||Kt(r,n))?!1:!t.some((r,i)=>{let s=t[(i+1)%t.length];return n.some((u,l)=>no(r,s,u,n[(l+1)%n.length]))})}function no(e,t,n,o){let r=(d,c,f)=>(c.x-d.x)*(f.y-d.y)-(c.y-d.y)*(f.x-d.x),i=r(e,t,n),s=r(e,t,o),u=r(n,o,e),l=r(n,o,t);return i*s<-1e-9&&u*l<-1e-9}function oo(e,t){return le(e[0],t)||le(t[0],e)?!0:e.some((n,o)=>{let r=e[(o+1)%e.length];return t.some((i,s)=>no(n,r,i,t[(s+1)%t.length]))})}function ro(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((b,m)=>b.segmentedRow.componentIndex-m.segmentedRow.componentIndex),s=i[0]?.segmentedRow?.componentCount??0,u=i[0]?.segmentedRow;if(!u||!(s>=2&&i.length===s&&u?.boundaryBefore==="start"&&i.every((b,m)=>b.segmentedRow?.kind==="segmented-row-v1"&&b.segmentedRow.groupId===o&&b.segmentedRow.componentCount===s&&b.segmentedRow.componentIndex===m&&b.segmentedRow.repeatLabelOnComponents===u.repeatLabelOnComponents&&(m===0?b.segmentedRow.boundaryBefore==="start":b.segmentedRow.boundaryBefore!=="start")&&b.segmentedRow.displayLabel===u.displayLabel)))continue;let d=i.reduce((b,m)=>b+m.seatCount,0),c=0,f=0;for(let b of i)b.segmentedRow.boundaryBefore==="break"&&(c+=1),t.set(b.id,{groupId:o,adjacencyOffset:c,displayOffset:f,displayLabel:u.displayLabel,totalSeats:d,canonical:i[0],viewFromSeatUrl:u.viewFromSeatUrl,viewFromSeatMeta:u.viewFromSeatMeta,confidenceEvidence:u.confidenceEvidence}),c+=b.seatCount,f+=b.seatCount}return t}var Xi="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var Yi="abcdefghijklmnopqrstuvwxyz";function Wi(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 He(e,t=!1){let n=t?Yi:Xi;return Wi(Math.max(0,Math.floor(e)-1),n)}var Zi=[[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 io(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of Zi)for(;t>=o;)n+=r,t-=o;return n}function qi(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 Vt(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??"",u=e.seatNumbering?.endAt,l=e.seatCount;if(i==="updown"||i==="updown-descending"){let m=Math.ceil(l/2),g=i==="updown"?t<m?n+2*t:n-1+2*(l-t):t<m?n+2*(m-1-t):n+1+2*(t-m);return`${s}${g}`}let d=i==="odd"||i==="even"?2:r,c=u!=null&&Number.isFinite(u)?u-(l-1)*d:n,f=o==="center"?qi(l)[t]:o==="rtl"?l-1-t:t,b;switch(i){case"odd":{let m=c%2===1?c:c+1;b=String(m+f*2);break}case"even":{let m=c%2===0?c:c+1;b=String(m+f*2);break}case"roman":b=io(c+f*r);break;case"letters-upper":b=He(c+f*r,!1);break;case"letters-lower":b=He(c+f*r,!0);break;default:b=String(c+f*r);break}return`${s}${b}`}function Qi(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function pt(e,t,n){return n?.label??`${e.seatLabelBase??e.label}-${Vt(e,t)}`}function Ji(e,t,n,o){if(o?.displayLabel)return null;if(e.seatDisplayLabelMode==="number"||!n)return{row:e.displayLabel||e.label,seat:Vt(e,t)};let r=Qi(n);return{row:n.displayLabel,seat:Vt(r,n.displayOffset+t)}}function Ht(e,t,n,o){let r=Ji(e,t,n,o);return r?e.seatDisplayLabelMode==="number"?r.seat:`${r.row}-${r.seat}`:o.displayLabel}var ao=999,ea=["clockwise","anticlockwise"],ta=["table-number","number","letter"];function so(e,t){return`${e.label}-${t+1}`}function na(e,t,n){return e?.direction==="anticlockwise"?Math.max(0,t-1-n):n}function oa(e,t){let n=e.chairNumbering,o=n?.start??1,r=na(n,Math.max(0,Math.round(e.seatCount)),t);return n?.format==="letter"?He(Math.max(1,o)+r):String(o+r)}function co(e,t){let n=oa(e,t);return(e.chairNumbering?.format??"table-number")==="table-number"?`${e.displayLabel??e.label}-${n}`:n}function lo(e){if(e===void 0)return null;if(!e||typeof e!="object"||Array.isArray(e))return"chairNumbering must be an object";let t=e,n=Object.keys(t).filter(o=>!["start","direction","format"].includes(o));return n.length?`chairNumbering has unsupported field(s): ${n.join(", ")}`:t.start!==void 0&&(!Number.isInteger(t.start)||t.start<0||t.start>ao)?`chairNumbering.start must be a whole number from 0 to ${ao}`:t.direction!==void 0&&!ea.includes(t.direction)?"chairNumbering.direction must be clockwise or anticlockwise":t.format!==void 0&&!ta.includes(t.format)?"chairNumbering.format must be table-number, number or letter":null}var ke=.02291666666666667,ze=1/ke,ra=58,uo=ra*ke,Xt=0,Ae=3,ge=0,ue=120,mt=0,bt=45,Yt=7,Pe=1.2;function zt(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function ia(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Yt?e:Ae}function Xe(e,t={}){let n=zt(t.floorBaseHeightM,ge,ue,0),o=Math.min(ue,n+ia(e.elevation)*uo),r=e.height===void 0?o:zt(e.height,ge,ue,o),i=zt(e.rake,mt,bt,0);return{height:r,rake:i}}function fo(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 po(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],u=s.x-i.x,l=s.y-i.y,d=u*u+l*l,c=d>1e-12?((t-i.x)*u+(n-i.y)*l)/d:0;c<0?c=0:c>1&&(c=1);let f=t-(i.x+c*u),b=n-(i.y+c*l);if(Math.abs(f)>=o||Math.abs(b)>=o)continue;let m=Math.hypot(f,b);m<o&&(o=m)}return o}function aa(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 mo(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function Wt(e,t){let n=1/0;for(let o of fo(e)){let r=po(t,o.x,o.y);r<n&&(n=r)}for(let o of fo(t)){let r=po(e,o.x,o.y);r<n&&(n=r)}return n}function sa(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let c of e)n+=c.x,o+=c.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let c of e){let f=Math.hypot(c.x-n,c.y-o);f>r&&(r=f,i=c)}let s=i.x-n,u=i.y-o,l=Math.hypot(s,u);l>1e-9?(s/=l,u/=l):(s=1,u=0);let d=e.map((c,f)=>({p:c,i:f,t:(c.x-n)*s+(c.y-o)*u})).sort((c,f)=>c.t-f.t);return{pts:d.map(c=>c.p),seatIndices:d.map(c=>t[c.i])}}function ca(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let E of e)n+=E.x,o+=E.y;n/=t,o/=t;let r=0,i=0,s=0,u=0,l=0,d=0,c=0;for(let E of e){let L=E.x-n,I=E.y-o;r+=L*L,s+=I*I,i+=L*I,u+=L*L*L,l+=I*I*I,d+=L*I*I,c+=I*L*L}let f=r*s-i*i;if(Math.abs(f)<1e-9)return null;let b=(u+d)/2,m=(l+c)/2,g=(b*s-m*i)/f,v=(m*r-b*i)/f,S=g+n,A=v+o;return!Number.isFinite(S)||!Number.isFinite(A)?null:{cx:S,cy:A}}var la=.15,ua=.001;function da(e){let t=e[0],n=e[e.length-1],o=n.x-t.x,r=n.y-t.y,i=Math.hypot(o,r);if(!(i>1e-9))return 0;let s=0;for(let u of e){let l=Math.abs((u.x-t.x)*r-(u.y-t.y)*o)/i;l>s&&(s=l)}return s/i}function fa(e){if(e.length<2)return null;let t=e.map(M=>{let y=0,w=0;for(let k of M.pts)y+=k.x,w+=k.y;return{x:y/M.pts.length,y:w/M.pts.length}}),n=0,o=0;for(let M of t)n+=M.x,o+=M.y;n/=t.length,o/=t.length;let r=0,i=0,s=0;for(let M of t){let y=M.x-n,w=M.y-o;r+=y*y,i+=y*w,s+=w*w}let u=r+s,l=r*s-i*i,d=u/2+Math.sqrt(Math.max(0,u*u/4-l)),c,f;Math.abs(i)>1e-12?(c=d-s,f=i):r>=s?(c=1,f=0):(c=0,f=1);let b=Math.hypot(c,f);if(!(b>1e-12))return null;c/=b,f/=b;let m=0,g=0,v=0;for(let M of e){if(M.pts.length<2)continue;let y=M.pts[0],w=M.pts[M.pts.length-1],k=w.x-y.x,O=w.y-y.y,a=Math.hypot(k,O);if(!(a>1e-9))continue;let _=k/a,p=O/a;m+=(_*_-p*p)*a,g+=2*_*p*a,v+=a}if(v>0&&Math.hypot(m,g)>=ma*v){let M=Math.atan2(g,m)/2;c=-Math.sin(M),f=Math.cos(M)}let S=1/0,A=-1/0,E=[];for(let M of e){let y=1/0,w=-1/0;for(let k of M.pts){let O=k.x*c+k.y*f;O<y&&(y=O),O>w&&(w=O),O<S&&(S=O),O>A&&(A=O)}E.push(w-y)}let L=A-S;return L>1e-9?(E.sort((M,y)=>M-y),E[Math.min(E.length-1,Math.floor(E.length*.9))]/L<=pa?{x:c,y:f}:null):null}var pa=.35,ma=.8;function bo(e,t,n,o){let r=new Map;for(let y of n){let w=t[y],k=w.rowId||`__seat-${y}`,O=r.get(k);O||(O={pts:[],idx:[]},r.set(k,O)),O.pts.push({x:w.x,y:w.y}),O.idx.push(y)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[y,w]of r){let k=sa(w.pts,w.idx),O=0;for(let a of k.pts)O+=Math.hypot(a.x-o.x,a.y-o.y);i.push({id:y,pts:k.pts,seatIndices:k.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:O/k.pts.length})}let s=i.map(y=>aa(y.pts)),u=i.length<=256?i.length*(i.length-1)/2:0,l=u?new Float64Array(u):null;l?.fill(Number.NaN);let d=l?new Map(i.map((y,w)=>[y,w])):null,c=(y,w)=>(y>w&&([y,w]=[w,y]),y*(2*i.length-y-1)/2+(w-y-1)),f=(y,w)=>{if(!l)return Wt(i[y].pts,i[w].pts);let k=c(y,w),O=l[k];if(!Number.isNaN(O))return O;let a=Wt(i[y].pts,i[w].pts);return l[k]=a,a},b=(y,w)=>d?f(d.get(y),d.get(w)):Wt(y.pts,w.pts),m=[];for(let y=0;y<i.length;y++){let w=1/0;for(let k=0;k<i.length;k++){if(y===k||mo(s[y],s[k])>=w)continue;let O=f(y,k);O<w&&(w=O)}Number.isFinite(w)&&m.push(w)}m.sort((y,w)=>y-w);let g=m.length?m[Math.floor(m.length/2)]:1,v=Math.max(g*1.8,1e-6),S=i.map(()=>[]);for(let y=0;y<i.length;y++)for(let w=y+1;w<i.length;w++)mo(s[y],s[w])>v||f(y,w)<=v&&(S[y].push(w),S[w].push(y));let A=0;for(let y=0;y<i.length;y++){if(i[y].blockId!==-1)continue;let w=A++,k=[y];for(i[y].blockId=w;k.length;){let O=k.pop();for(let a of S[O])i[a].blockId===-1&&(i[a].blockId=w,k.push(a))}}let E=new Map;for(let y of i){let w=E.get(y.blockId)??[];w.push(y),E.set(y.blockId,w)}let L=[];for(let y of i){if(y.pts.length<4||da(y.pts)<ua)continue;let w=ca(y.pts);w&&(!Number.isFinite(w.cx)||!Number.isFinite(w.cy)||L.push({x:w.cx,y:w.cy}))}let I=L.length>=2?(()=>{let y=L.map(O=>O.x).sort((O,a)=>O-a),w=L.map(O=>O.y).sort((O,a)=>O-a),k=Math.floor(L.length/2);return{cx:y[k],cy:w[k]}})():null;if(I){let y=p=>Math.hypot(p.x-I.cx,p.y-I.cy),w=1/0,k=-1/0,O=[];for(let p of i){let h=1/0,x=-1/0;for(let T of p.pts){let P=y(T);P<h&&(h=P),P>x&&(x=P)}O.push(x-h),h<w&&(w=h),x>k&&(k=x)}let a=k-w;O.sort((p,h)=>p-h);let _=O[Math.min(O.length-1,Math.floor(O.length*.9))];if(a>1e-9&&_/a<=la){let p=i.map(F=>{let q=0;for(let Lt of F.pts)q+=y(Lt);return{row:F,radius:q/F.pts.length}}),h=0,x=0;for(let F of p)h+=F.radius,x+=F.row.focalDistance;h/=p.length,x/=p.length;let T=0;for(let F of p)T+=(F.radius-h)*(F.row.focalDistance-x);if(T<0)for(let F of p)F.radius=-F.radius;let C=1/0;for(let F of p)F.radius<C&&(C=F.radius);p.sort((F,q)=>F.radius-q.radius);let R=-1,j=-1/0,G=a/Math.max(1,p.length)*.5,Z=[];for(let F of p)F.radius-j>G&&(R++,j=F.radius),F.row.ordinal=R,F.row.blockDepth=F.radius-C,Z.push(F.row);return{sectionId:e,rows:Z,blockCount:A}}}let M=[];for(let[,y]of E){let w=fa(y);if(w){let k=p=>{let h=0;for(let x of p.pts)h+=x.x*w.x+x.y*w.y;return h/p.pts.length};y.sort((p,h)=>k(p)-k(h)),y.length>=2&&y[0].focalDistance>y[y.length-1].focalDistance&&y.reverse();let O=[],a=g*.5;for(let p of y){let h=O[O.length-1];h&&Math.abs(k(p)-k(h[0]))<a?h.push(p):O.push([p])}let _=0;for(let p=0;p<O.length;p++){if(p>0){let h=1/0;for(let x of O[p-1])for(let T of O[p])h=Math.min(h,b(x,T));h=Math.min(h,Math.abs(k(O[p][0])-k(O[p-1][0]))),_+=h}for(let h of O[p])h.ordinal=p,h.blockDepth=_,M.push(h)}}else{let k=1/0;for(let O of y)O.focalDistance<k&&(k=O.focalDistance);y.sort((O,a)=>O.focalDistance-a.focalDistance);for(let O=0;O<y.length;O++)y[O].ordinal=O,y[O].blockDepth=Math.max(0,y[O].focalDistance-k),M.push(y[O])}}return{sectionId:e,rows:M,blockCount:A}}var ba=/^\d{4}-\d{2}-\d{2}$/;function ga(e){let t=Date.parse(e);return Number.isFinite(t)?ba.test(e)?t+864e5:t:null}function ha(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let o=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(o)&&(t instanceof Date?t.getTime():t)<=o+366*864e5}let n=ga(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function ya(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function xa(e){return e.status!=="draft"&&e.status!=="retracted"}function va(e,t){return e.status===void 0?t===void 0:e.status!=="approved"?!0:typeof t=="string"&&typeof e.basisSha256=="string"&&e.basisSha256===t}function go(e,t={}){return!!e&&xa(e)&&ya(e,t.activeConfigurationId,t.activeConfigurationVersion)&&va(e,t.activeBasisSha256)&&ha(e,t.now)}function ho(e){return!!e.referenceImage?.assetId&&!!e.backgroundImage?.assetId&&e.referenceImage.assetId!==e.backgroundImage.assetId}var Sa=36,Ia=160;function yo(e,t=360){let n=ee(Math.round(Number.isFinite(e)?e:1),1,40),o=ee(Number.isFinite(t)?t:360,120,360);return Math.round(ee(n*4*(360/o),Sa,Ia))}var wa=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing"]);function Ma(e){return!!e&&wa.has(e)}var xo=1.1;var sl=Math.PI*2;var cl=(()=>{let t={x:0,y:52},n=25,o={x:70,y:t.y-70},r=(o.x*o.x+o.y*o.y-4900)/(2*(o.y+70)),i=r+70,s=[],u=Math.atan2(o.y-r,o.x),l=Math.atan2(o.y-r,-o.x);for(let d=0;d<=24;d++){let c=u+(l-u)*d/24;s.push({x:i*Math.cos(c),y:r+i*Math.sin(c)})}return{half:70,home:t,backstop:n,fence:s}})();function vo(e){return Ma(e)}var Ca=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Oa=/[\s"'<>`\\]/;function Zt(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return Ca.test(e);if(Oa.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}var So=2e5,gt=1e5,qt="large_venue_inventory";function Io(e){return e?.includes(qt)?2e5:1e5}function ka(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.kind==="polygon"?Ut(e,6):e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,o=e.width,r=e.height;return[{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r},{x:t,y:n+r}]}function Aa(e,t,n){let o=n*Math.PI/180,r=Math.cos(o),i=Math.sin(o),s=e.x-t.x,u=e.y-t.y;return{x:t.x+s*r-u*i,y:t.y+s*i+u*r}}function wo(e){let t=ka(e);if(!t||t.length<2)return null;let n=e.rotation??0,o=Math.abs(n)<1e-6?t:t.map(l=>Aa(l,{x:t.reduce((d,c)=>d+c.x,0)/t.length,y:t.reduce((d,c)=>d+c.y,0)/t.length},n)),r=1/0,i=1/0,s=-1/0,u=-1/0;for(let l of o)r=Math.min(r,l.x),i=Math.min(i,l.y),s=Math.max(s,l.x),u=Math.max(u,l.y);return!Number.isFinite(r)||s-r<1e-6||u-i<1e-6?null:{minX:r,minY:i,maxX:s,maxY:u}}var Pa=5,Ea=3,Ra=.92,La=1.9,Ta=2,_a=.6,ja=1,Na=.06;function $a(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?xo:vo(e.stageKind)?Na:ja}function Mo(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=-1/0;for(let s of ne(e)){let u=s.baseHeightM??0;for(let l of s.objects){if(l.type!=="shape"||l.role!=="stage")continue;let d=wo(l);d&&(t=Math.min(t,d.minX),n=Math.min(n,d.minY),o=Math.max(o,d.maxX),r=Math.max(r,d.maxY),i=Math.max(i,u+$a(l)))}}return!Number.isFinite(t)||!Number.isFinite(i)?null:{minX:t,minY:n,maxX:o,maxY:r,deckTopM:i}}function Fa(e,t,n,o){let r=1/0,i=1/0,s=-1/0,u=-1/0;for(let m of e)Number.isFinite(m.eyeHeightM)&&(r=Math.min(r,m.x),s=Math.max(s,m.x),i=Math.min(i,m.y),u=Math.max(u,m.y));if(!Number.isFinite(r))return null;let l=r*t,d=i*t,c=Math.max(1,Math.ceil((s-r)*t/n)+1),f=Math.max(1,Math.ceil((u-i)*t/n)+1),b=new Float64Array(c*f).fill(-1/0);for(let m of e){if(!Number.isFinite(m.eyeHeightM))continue;let g=m.eyeHeightM-Pe,v=Math.min(c-1,Math.max(0,Math.floor((m.x*t-l)/n))),A=Math.min(f-1,Math.max(0,Math.floor((m.y*t-d)/n)))*c+v,E=g+o;E>b[A]&&(b[A]=E)}return{cellM:n,minX:l,minY:d,cols:c,rows:f,top:b}}function Da(e,t,n){let o=Math.floor((t-e.minX)/e.cellM),r=Math.floor((n-e.minY)/e.cellM);return o<0||r<0||o>=e.cols||r>=e.rows?-1/0:e.top[r*e.cols+o]}function Co(e,t,n={}){let o=new Map;if(!t||!e.length)return o;let r=n.metresPerChartUnit??ke,i=n.cellM??_a,s=n.chairBackM??Ra,u=n.selfRowSkipM??Ta,l=n.clearThreshold??.9,d=n.partialThreshold??.25,c=Math.max(1,n.columns??Pa),f=Math.max(1,n.rows??Ea),b=Fa(e,r,i,s);if(!b)return o;let m=(t.maxX-t.minX)*r,g=(t.maxY-t.minY)*r,v=m>=g,S=(t.minX+t.maxX)/2*r,A=(t.minY+t.maxY)/2*r,E=[];for(let I=0;I<c;I++){let M=(I+.5)/c-.5,y=v?S+M*m:S,w=v?A:A+M*g;for(let k=0;k<f;k++){let O=t.deckTopM+(f===1?0:k/(f-1)*La);E.push({x:y,y:w,z:O})}}let L=i/2;for(let I of e){if(!Number.isFinite(I.eyeHeightM))continue;let M=I.x*r,y=I.y*r,w=I.eyeHeightM,k=0,O=1/0;for(let _ of E){let p=_.x-M,h=_.y-y,x=Math.hypot(p,h);if(!(x>u)){k++;continue}let T=p/x,P=h/x,C=0;for(let R=u;R<x;R+=L){let j=Da(b,M+T*R,y+P*R);if(!(!Number.isFinite(j)||j>=w)&&j>w+(_.z-w)*R/x){C=R;break}}C?O=Math.min(O,C):k++}let a=k/E.length;a>=l||o.set(I.id,{seatId:I.id,mark:a<d?"obstructedView":"restrictedView",visibleFraction:a,totalRays:E.length,atDistanceM:Number.isFinite(O)?O:0})}return o}function Oo(e,t){if(!t.size)return 0;let n=0;for(let o of e){let r=t.get(o.id);if(!r)continue;let i=o.commercial;i?.restrictedView!==void 0||i?.obstructedView!==void 0||(o.commercial={...i,[r.mark]:!0},n++)}return n}function Qt(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var yt=Math.PI/180;var Ye=16;function Jt(e,t,n,o){let r=n*yt,i=Math.cos(r),s=Math.sin(r);return{x:o.x+e*i-t*s,y:o.y+e*s+t*i}}function en(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,s=[];if(e.path)return Yn(e.path,t);if(t<=1)return t===1&&s.push({x:i.x,y:i.y}),s;if(o===0){for(let d=0;d<t;d++)s.push(Jt(d*n,0,r,i));return s}let u=o/(t-1)*yt,l=n/(2*Math.sin(Math.abs(u)/2));for(let d=0;d<t;d++){let c=d*u,f=l*Math.sin(c),b=-l+l*Math.cos(c);s.push(Jt(f,b,r,i))}return s}function tn(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function xt(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 Ba(e,t){let n=tn(e);return en(e).map((o,r)=>{let i=n.get(r),s=Qt(i),u=pt(e,r,i),l={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:u,displayLabel:Ht(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:s.length>0,accessibility:s,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(l).some(d=>d!==void 0&&d!==!1&&d!=="")?l:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle??e.seatLabelStyle}})}function Q(e){let t=[];for(let n of Ba(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 We(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 Eo(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(c=>[c.index,c])),r=(c,f,b,m)=>{let g=o.get(c),v=Qt(g),S=g?.label??so(e,c);return{index:c,label:S,displayLabel:g?.displayLabel??co(e,c),x:f+(g?.dx??0),y:b+(g?.dy??0),categoryKey:g?.categoryKey??e.categoryKey,skipped:!!g?.skip,accessible:v.length>0,accessibility:v,wheelchairSpaceType:g?.wheelchairSpaceType,commercial:g?.commercial,glyph:g?.glyph,viewUrl:g?.viewFromSeatUrl,viewMeta:g?.viewFromSeatUrl?g.viewFromSeatMeta:void 0,labelStyle:g?.labelStyle,...m?{side:m}:{}}};if(e.shape==="round"){let c=(e.radius??40)+Ye,f=e.rotation*yt,b=Math.max(0,Math.min(360,e.seatArc??360));if(b>=360||n===1){for(let S=0;S<n;S++){let A=f+S/n*2*Math.PI;t.push(r(S,e.center.x+c*Math.cos(A),e.center.y+c*Math.sin(A)))}return t}let m=b*yt,g=(2*Math.PI-m)/2,v=f+g;for(let S=0;S<n;S++){let A=v+S/(n-1)*m;t.push(r(S,e.center.x+c*Math.cos(A),e.center.y+c*Math.sin(A)))}return t}let i=e.width??80,s=e.height??50,u=We(e),l=["top","bottom","left","right"],d=0;for(let c of l){let f=u[c];for(let b=0;b<f;b++){let m,g;c==="top"?(m=-i/2+(b+.5)*i/f,g=-s/2-Ye):c==="bottom"?(m=-i/2+(b+.5)*i/f,g=s/2+Ye):c==="left"?(m=-i/2-Ye,g=-s/2+(b+.5)*s/f):(m=i/2+Ye,g=-s/2+(b+.5)*s/f);let v=Jt(m,g,e.rotation,e.center);t.push(r(d++,v.x,v.y,c))}}return t}function Ro(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):Eo(e).filter(t=>!t.skipped).length}function re(e){return Eo(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 Lo(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth",...e.commercial?.note?{commercial:{note:e.commercial.note}}:{}}]}function le(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,u=t[r].x,l=t[r].y;s>e.y!=l>e.y&&e.x<(u-i)*(e.y-s)/(l-s)+i&&(n=!n)}return n}function Kt(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),u=(r.x-n.x)**2+(r.y-n.y)**2;return s>=-1e-7&&s<=u+1e-7})}function ft(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function oe(e,t,n){return le(e,t)&&!ft(n).some(o=>le(e,o)||Kt(e,o))}function ht(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 ce(e){switch(e.type){case"row":{let t=en(e),n=tn(e),o=0,r=0,i=0;for(let s=0;s<t.length;s++){let u=n.get(s);u?.skip||(o+=t[s].x+(u?.dx??0),r+=t[s].y+(u?.dy??0),i++)}return i?{x:o/i,y:r/i}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return ht(e.points);case"section":return ht(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?ht(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 ko(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function Ga(e,t){if(e.type!=="gaArea"||!ko(e.points,t.outline))return!1;let n=ft(e.holes),o=ft(t.holes);return n.length===o.length&&n.every((r,i)=>ko(r,o[i]))}function nn(e,t,n=e.filter(r=>r.type==="section"),o=ce(t)){let r="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(r?n.find(s=>(s.logicalSectionId??s.id)===r&&(Ga(t,s)||oe(o,s.outline,s.holes))):void 0)??n.find(s=>oe(o,s.outline,s.holes))??(t.type==="row"&&Ua(t)?Ka(t,n):void 0)}function Ua(e){return(e.overrides??[]).some(t=>t.skip===!0)}function Ka(e,t){let n=en(e),o=tn(e),r,i=0;for(let s of t){let u=0;for(let l=0;l<n.length;l++){let d=o.get(l);if(d?.skip)continue;let c={x:n[l].x+(d?.dx??0),y:n[l].y+(d?.dy??0)};oe(c,s.outline,s.holes)&&u++}u>i&&(r=s,i=u)}return r}function ne(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 Ze(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function Ao(e,t,n,o,r,i,s,u,l){let d=[],c=e.filter(v=>v.type==="section"),f=ro(e),b=v=>!v?.eventConfigurationId||v.eventConfigurationId===o&&(v.eventConfigurationVersion===void 0||v.eventConfigurationVersion===l),m=v=>go(v,{activeConfigurationId:o,activeConfigurationVersion:l,activeBasisSha256:r,now:u}),g=(v,S)=>m(v)?{...v,coverage:S}:void 0;for(let v of e){let S=[];if(v.type==="row"?S=Q(v):v.type==="table"?S=re(v):v.type==="booth"&&(S=Lo(v)),!S.length)continue;for(let M of S)M.viewUrl&&!b(M.viewMeta)&&(M.viewUrl=void 0,M.viewMeta=void 0);if(v.type==="row"){let M=f.get(v.id);if(M){let y=new Map((v.overrides??[]).map(w=>[w.index,w]));for(let w of S){let k=Number(w.id.slice(w.id.lastIndexOf(":")+1));if(!Number.isInteger(k))continue;w.logicalRowId=M.groupId,w.logicalSeatIndex=M.adjacencyOffset+k,y.get(k)?.displayLabel||(w.displayLabel=Ht(v,k,M)),!w.viewUrl&&M.viewFromSeatUrl&&b(M.viewFromSeatMeta)&&(w.viewUrl=M.viewFromSeatUrl,w.viewMeta=M.viewFromSeatMeta);let O=y.get(k)?.confidenceEvidence;w.confidenceEvidence=g(O,"exact-seat")??g(v.confidenceEvidence,"row-representative")??g(M.confidenceEvidence,"row-representative")}}}let A=nn(e,v,c,v.type==="row"?ht(S):ce(v)),E=A?.viewFromSeatUrl,I=(A?.zone?t?.find(M=>M.id===A.zone):void 0)?.focalPoint??n;for(let M of S){if(!M.confidenceEvidence){let y=Number(M.id.slice(M.id.lastIndexOf(":")+1)),w=(v.type==="row"||v.type==="table")&&Number.isInteger(y)?v.overrides?.find(k=>k.index===y)?.confidenceEvidence:void 0;M.confidenceEvidence=g(w,"exact-seat")??(v.type==="row"?g(v.confidenceEvidence,"row-representative"):void 0)}M.confidenceEvidence??=g(A?.confidenceEvidence,"section-representative")??(s?g(s.evidence,s.coverage):void 0),!M.viewUrl&&E&&b(A?.viewFromSeatMeta)&&(M.viewUrl=E,M.viewMeta=A?.viewFromSeatMeta),!M.viewUrl&&i&&b(i.meta)&&(M.viewUrl=i.url,M.viewMeta=i.meta),A&&(M.sectionId=A.logicalSectionId??A.id),A?.zone&&(M.zoneId=A.zone),I&&(M.focalPoint={...I})}d.push(...S)}return d}function To(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,u=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,l=Ao(r.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,s,u,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&Po(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,l);for(let d of l)d.floorId=r.id;for(let d of l)o.push(d)}return o}let n=Ao(e.objects,e.zones,e.focalPoint,e.eventConfigurationId,e.confidenceBasisSha256,e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);return t.resolveEyeHeights!==!1&&Po(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),Va(e,n,t)}function Va(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||Oo(t,Co(t,Mo(e))),t}function Po(e,t,n,o){let r=e.filter(f=>f.type==="section"),i=n>0||r.some(f=>f.height!==void 0||f.rake!==void 0||(f.elevation??0)>0);if(!r.length||!i||!t){for(let f of o)f.eyeHeightM=n+Pe;return}let s=new Array(o.length),u=new Map;for(let f of r)u.has(f.id)||u.set(f.id,f);let l=new Map,d=new Map;for(let f=0;f<o.length;f++){let b=o[f],g=(b.sectionId?u.get(b.sectionId)??r.find(S=>S.logicalSectionId===b.sectionId&&oe({x:b.x,y:b.y},S.outline,S.holes)):void 0)??r.find(S=>oe({x:b.x,y:b.y},S.outline,S.holes))??null;if(s[f]=g,!g)continue;l.has(g.id)||l.set(g.id,Xe(g,{floorBaseHeightM:n}));let v=d.get(g.id);v?v.push(f):d.set(g.id,[f])}let c=new Array(o.length).fill(void 0);for(let[f,b]of d){let m=l.get(f);if(!m)continue;let g=m.rake>0?Math.tan(m.rake*Math.PI/180):0,v=bo(f,o,b,t);for(let S of v.rows){let A=S.blockDepth*ke*g,E=m.height+A;for(let L of S.seatIndices)c[L]=E}}for(let f=0;f<o.length;f++){let b=o[f],m=s[f];if(!m){b.eyeHeightM=n+Pe;continue}let g=l.get(m.id);b.eyeHeightM=(c[f]??g.height)+Pe}}var vt="__sl_ga__";function de(e){return e.startsWith(vt)}var Ha=vt,he=1e5;function _o(e,t){return`${Ha}${encodeURIComponent(e)}__${t+1}`}function St(e){let t=e.inventorySegments;if(t===void 0)return!0;if(!Array.isArray(t)||t.length<1||t.length>256)return!1;let n=0,o=new Map;for(let r of t){if(!r||typeof r.sourceAreaId!="string"||!r.sourceAreaId.trim()||r.sourceAreaId.length>160||!Number.isInteger(r.startIndex)||r.startIndex<0||!Number.isInteger(r.count)||r.count<1||r.startIndex+r.count>he||(n+=r.count,n>he))return!1;let i=o.get(r.sourceAreaId)??[],s=r.startIndex+r.count;if(i.some(u=>r.startIndex<u.end&&s>u.start))return!1;i.push({start:r.startIndex,end:s}),o.set(r.sourceAreaId,i)}return n===e.capacity}function on(e){let t=Math.min(he,Math.max(0,Math.floor(e.capacity)));return e.inventorySegments===void 0?t?[{sourceAreaId:e.id,startIndex:0,count:t}]:[]:St(e)?e.inventorySegments.map(n=>({...n})):[]}var ye=100,za=`An area sold to one party holds at most ${ye} guests.`;function fe(e){return e.variableOccupancy?"variable":e.bookAsWhole?"whole":null}function Xa(e){return fe(e)==="variable"?{min:e.minOccupancy??1,max:e.maxOccupancy??e.capacity}:{min:e.capacity,max:e.capacity}}function rn(e){return an(e,2)}function an(e,t){return t===2&&fe(e)&&e.inventorySegments===void 0?e.label.trim()?[e.label]:[]:on(e).flatMap(n=>Array.from({length:n.count},(o,r)=>_o(n.sourceAreaId,n.startIndex+r)))}function jo(e){let t=e.wheelchairPlaces;return!Number.isInteger(t)||t<=0?0:Math.min(t,Math.max(0,Math.floor(e.capacity)))}function Ya(e,t=2){let n=jo(e);if(!n)return new Set;let o=an(e,t);return o.length===1&&fe(e)&&t===2?new Set(o):new Set(o.slice(Math.max(0,o.length-n)))}function Wa(e,t){if(e.inventorySegments===void 0||t===e.capacity)return e.inventorySegments;if(t<e.capacity)return;let n=on(e);if(!n.length)return;let o=t-e.capacity;if(!o)return n;let i=n.filter(u=>u.sourceAreaId===e.id).reduce((u,l)=>Math.max(u,l.startIndex+l.count),0),s=n[n.length-1];if(s?.sourceAreaId===e.id&&s.startIndex+s.count===i)s.count+=o;else{if(n.length>=256)return;n.push({sourceAreaId:e.id,startIndex:i,count:o})}return n}function Za(e){return Ze(e).filter(t=>t.type==="gaArea")}function qa(e){return e.type==="row"||e.type==="table"||e.type==="booth"||e.type==="gaArea"}function No(e){let t=new Map;for(let n of ne(e)){let o=n.objects.filter(r=>r.type==="section");if(o.length)for(let r of n.objects){if(!qa(r))continue;let i=nn(n.objects,r,o);i&&t.set(r.id,i.logicalSectionId??i.id)}}return t}var Qa=.15,Ja=1.6;function $o(e){return ee(e??1,Qa,Ja)}var es=/^#[0-9a-fA-F]{6}$/,ts=/^#?([\da-f]{3}|[\da-f]{6})$/i;function Fo(e){return typeof e=="string"&&es.test(e)}function Ee(e){let t=ts.exec((e??"").trim());if(!t)return null;let n=t[1].length===3?t[1].split("").map(r=>r+r).join(""):t[1],o=parseInt(n,16);return[o>>16&255,o>>8&255,o&255]}function Do(e,t){let n=i=>{let s=Ee(i);if(!s)return null;let u=E=>{let L=E/255;return L<=.04045?L/12.92:((L+.055)/1.055)**2.4},l=u(s[0]),d=u(s[1]),c=u(s[2]),f=(.4124*l+.3576*d+.1805*c)/.95047,b=.2126*l+.7152*d+.0722*c,m=(.0193*l+.1192*d+.9505*c)/1.08883,g=E=>E>.008856?Math.cbrt(E):7.787*E+16/116,v=g(f),S=g(b),A=g(m);return[116*S-16,500*(v-S),200*(S-A)]},o=n(e),r=n(t);return o&&r?Math.hypot(o[0]-r[0],o[1]-r[1],o[2]-r[2]):null}function sn(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function cn(e){return .2126*sn(e[0])+.7152*sn(e[1])+.0722*sn(e[2])}function te(e,t){let n=Ee(e),o=Ee(t);if(!n||!o)return null;let r=cn(n),i=cn(o);return(Math.max(r,i)+.05)/(Math.min(r,i)+.05)}function ns(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=!1;for(let s of e)!Number.isFinite(s.x)||!Number.isFinite(s.y)||(i=!0,s.x<t&&(t=s.x),s.y<n&&(n=s.y),s.x>o&&(o=s.x),s.y>r&&(r=s.y));return i?{minX:t,minY:n,maxX:o,maxY:r}:null}function Bo(e){let t=ns(e);return t?os(t):null}function os(e){return{x:e.minX,y:e.minY,width:e.maxX-e.minX,height:e.maxY-e.minY}}var Re=[{key:"wheelchair",label:"Wheelchair space",short:"Wheelchair",icon:"\u267F"},{key:"companion",label:"Companion seat",short:"Companion",icon:"\u{1F9D1}\u200D\u{1F91D}\u200D\u{1F9D1}"},{key:"semi-ambulatory",label:"Semi-ambulatory (limited mobility)",short:"Limited mobility",icon:"\u{1F9AF}"},{key:"designated-aisle",label:"Designated aisle / transfer seat",short:"Aisle transfer",icon:"AS"},{key:"step-free",label:"Step-free accessible seat",short:"Step-free",icon:"SF"},{key:"hearing",label:"Assistive listening",short:"Hearing",icon:"\u{1F9BB}"},{key:"cart",label:"CART live-caption view",short:"CART captions",icon:"CC"},{key:"sign-language",label:"Sign-language view",short:"Sign language",icon:"\u{1F91F}"},{key:"low-vision",label:"Blind / low-vision viewing",short:"Low vision",icon:"LV"},{key:"sensory-friendly",label:"Quiet / sensory-friendly seating",short:"Sensory-friendly",icon:"QS"},{key:"plus-size",label:"Plus-size seat",short:"Plus-size",icon:"\u{1F4BA}"},{key:"lift-armrest",label:"Lift-up armrest",short:"Lift armrest",icon:"\u2195\uFE0F"}],Vl=new Map(Re.map(e=>[e.key,e]));var rs=[{key:"obstructedView",label:"Obstructed view",short:"Obstructed",icon:"\u26D4"},{key:"restrictedView",label:"Restricted view",short:"Restricted",icon:"\u{1F441}"},{key:"premium",label:"Premium seat",short:"Premium",icon:"\u2605"}],Hl=new Map(rs.map(e=>[e.key,e]));var ln=8,un=24,Go=["start","end","both","none"],Uo=["inline","corner","peninsula","island"],is=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],zl=new Set(is);var Ho=7;var zo=10;var fn=.85,Xo=12,Yo=4.5;var as=3,Ko="#000000",Vo="#ffffff",ss=24,cs=18.67;function Wo(e,t=400){return e>=ss||t>=700&&e>=cs?as:Yo}var ls={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"},Ql=ls.wheelchair;var dn=te;function pn(e,t,n){let o=Ee(e),r=Ee(t);if(!o||!r)return t;let i=Math.max(0,Math.min(1,n));return`#${o.map((u,l)=>Math.round(u*i+r[l]*(1-i))).map(u=>u.toString(16).padStart(2,"0")).join("")}`}function Zo(e,t,n=Yo){let o=dn(t,e);if(o!=null&&o>=n)return t;let r=dn(Ko,e)??0,i=dn(Vo,e)??0;return r===0&&i===0?t:r>=i?Ko:Vo}function qo(e){return e.notForSale===!0?!0:e.tiers?.length?e.tiers.every(t=>Number.isFinite(t.price)&&t.price>=0):e.price!=null}function us(e){let t=0;for(let n=0,o=e.length;n<o;n+=1){let r=e[n],i=e[(n+1)%o];t+=r.x*i.y-i.x*r.y}return t/2}function xe(e){return us(e)*2}var It=[{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 Qo(e){return e.floors?.length?e.floors:[{id:"floor-0",objects:e.objects}]}function ds(e){return It.find(t=>t.key===e)}function Qe(e){let t=new Map,n=Math.max(0,Math.floor(e.seatCount)),o=new Map((e.overrides??[]).filter(i=>Number.isInteger(i.index)&&i.index>=0&&i.index<e.seatCount).map(i=>[i.index,i])),r=(i,s=1)=>{i&&s>0&&t.set(i,(t.get(i)??0)+s)};r(e.categoryKey,n-o.size);for(let i of o.values())i.skip||r(i.categoryKey??e.categoryKey);return t}function fs(e){return e.type==="row"||e.type==="table"?[...Qe(e).keys()]:e.type==="booth"?e.categoryKey?[e.categoryKey]:[]:e.type==="gaArea"?e.capacity>0&&e.categoryKey?[e.categoryKey]:[]:[]}function Jo(e){return It.find(t=>t.objectType===e.type)??null}function er(e){return e.type==="row"||e.type==="table"||e.type==="booth"||e.type==="gaArea"}function qe(e){let t=new Map;for(let r of Qo(e))for(let i of r.objects){if(!er(i))continue;let s=Jo(i);for(let u of fs(i)){let l=t.get(u)??new Map,d=l.get(s.key)??[];if(!d.some(c=>c.id===i.id)){let c=i.displayLabel||i.label||i.id;d.push({id:i.id,label:c,type:s.objectType,floorId:r.id})}l.set(s.key,d),t.set(u,l)}}let n=new Map(e.categories.map(r=>[r.key,r.label]));return[...e.categories.map(r=>r.key),...[...t.keys()].filter(r=>!n.has(r)).sort()].flatMap(r=>{let i=t.get(r);if(!i||i.size<2)return[];let s=It.flatMap(u=>{let l=i.get(u.key);return l?.length?[{family:u.key,label:u.label,objectType:u.objectType,targets:l}]:[]});return[{categoryKey:r,categoryLabel:n.get(r)??r,families:s,objectIds:[...new Set(s.flatMap(u=>u.targets.map(l=>l.id)))]}]})}function mn(e){let t=e.families.map(n=>`${n.label} (${n.targets.map(o=>o.label).join(", ")})`).join(" and ");return`Category \u201C${e.categoryLabel}\u201D is used by more than one kind of inventory: ${t}. Each category can belong to only one kind. Use the safe split to separate them (prices, ticket tiers, accessibility, and provenance are preserved).`}function tr(e){return e.normalize("NFKC").trim().toLocaleLowerCase("en")}function ps(e,t,n){for(let o=1;o<=1e4;o+=1){let r=o===1?`--${t}`:`--${t}-${o}`,s=`${e.slice(0,Math.max(1,160-r.length))}${r}`;if(!n.has(s))return n.add(s),s}throw new Error(`Unable to allocate a category key for ${e} (${t})`)}function ms(e,t,n){for(let o=1;o<=1e4;o+=1){let r=o===1?` (${t})`:` (${t} ${o})`,s=`${e.normalize("NFKC").trim().slice(0,Math.max(1,80-r.length)).trimEnd()}${r}`,u=tr(s);if(!n.has(u))return n.add(u),s}throw new Error(`Unable to allocate a category label for ${e} (${t})`)}function bs(e,t,n,o){let r=ds(t);return{...structuredClone(e),key:ps(e.key,r.suffix,n),label:ms(e.label,r.labelSuffix,o)}}function gs(e,t,n){let o=[];for(let r of Qo(e))for(let i of r.objects){if(!er(i))continue;let s=Jo(i),u=n.get(s.key);if(!(!u||u===t))if(i.type==="row"||i.type==="table"){let l=[];i.categoryKey===t&&(i.categoryKey=u);for(let d of i.overrides??[])d.categoryKey===t&&(d.categoryKey=u,l.push(d.index));(i.categoryKey===u||l.length)&&o.push({family:s.key,floorId:r.id,objectId:i.id,objectType:s.objectType,fromCategoryKey:t,toCategoryKey:u,...l.length?{seatOverrideIndices:l.sort((d,c)=>d-c)}:{}})}else i.categoryKey===t&&(i.categoryKey=u,o.push({family:s.key,floorId:r.id,objectId:i.id,objectType:s.objectType,fromCategoryKey:t,toCategoryKey:u}))}return o}function bn(e){let t=structuredClone(e),n=qe(t);if(!n.length)return{doc:t,changed:!1,changes:[],before:n,after:n};let o=new Set(t.categories.map(u=>u.key)),r=new Set(t.categories.map(u=>tr(u.label))),i=[];for(let u of n){let l=t.categories.findIndex(g=>g.key===u.categoryKey);if(l<0)continue;let d=t.categories[l],c=u.families[0].family,f=new Map([[c,d.key]]),b=u.families.slice(1).map(g=>{let v=bs(d,g.family,o,r);return f.set(g.family,v.key),{family:g.family,key:v.key,label:v.label,category:v}});t.categories.splice(l+1,0,...b.map(g=>g.category));let m=gs(t,d.key,f);i.push({categoryKey:d.key,categoryLabel:d.label,retainedFamily:c,clones:b.map(({family:g,key:v,label:S})=>({family:g,key:v,label:S})),reassignments:m})}t.floors?.length&&(t.objects=t.floors[0].objects);let s=qe(t);return{doc:t,changed:i.length>0,changes:i,before:n,after:s}}function nr(e){return typeof e=="string"&&Go.includes(e)}var wt=["#e69f00","#56b4e9","#009e73","#f0e442","#0072b2","#d55e00","#cc79a7"],or="#a4508b";var su={facilities:or,"food-drink":wt[5],navigation:wt[2],accessibility:wt[4]};var cu={minDiameterPx:12,glyphScale:.66,ringRatio:1/14,largeFromPx:24};var K=e=>{let t=Math.round(e*100)/100;return Object.is(t,-0)?"0":String(t)},je=e=>`${K(e[0])} ${K(e[1])}`,_e=(e,t,n,o)=>[e+n*Math.cos(o*Math.PI/180),t+n*Math.sin(o*Math.PI/180)];function gr(e){let t=`M${je(e.from)}`;for(let n of e.segs)t+=n.arc?`A${K(n.arc.r)} ${K(n.arc.r)} 0 ${n.arc.large} ${n.arc.sweep} ${je(n.to)}`:`L${je(n.to)}`;return`${t}Z`}function V(e){let t=[e.from,...e.segs.map(o=>o.to)],n=[];for(let o=e.segs.length-1;o>=0;o--){let r=e.segs[o].arc;n.push({to:t[o],arc:r&&{...r,sweep:r.sweep?0:1}})}return{from:t[t.length-1],segs:n}}function H(e,t,n){let o={r:n,large:0,sweep:1};return{from:[e-n,t],segs:[{to:[e+n,t],arc:o},{to:[e-n,t],arc:o}]}}function N(e,t,n,o,r){let i=Math.min(r,n/2,o/2),s={r:i,large:0,sweep:1};return i<=0?Y([[e,t],[e+n,t],[e+n,t+o],[e,t+o]]):{from:[e+i,t],segs:[{to:[e+n-i,t]},{to:[e+n,t+i],arc:s},{to:[e+n,t+o-i]},{to:[e+n-i,t+o],arc:s},{to:[e+i,t+o]},{to:[e,t+o-i],arc:s},{to:[e,t+i]},{to:[e+i,t],arc:s}]}}function Y(e){let t=0;for(let o=0;o<e.length;o++){let[r,i]=e[o],[s,u]=e[(o+1)%e.length];t+=r*u-s*i}let n=t>0?e:[...e].reverse();return{from:n[0],segs:[...n.slice(1).map(o=>({to:o})),{to:n[0]}]}}function B(e,t,n){let o=n/2,r=t[0]-e[0],i=t[1]-e[1],s=Math.hypot(r,i);if(s<1e-6)return H(e[0],e[1],o);let u=[i/s*o,-r/s*o],l={r:o,large:0,sweep:1},d=[e[0]+u[0],e[1]+u[1]];return{from:d,segs:[{to:[t[0]+u[0],t[1]+u[1]]},{to:[t[0]-u[0],t[1]-u[1]],arc:l},{to:[e[0]-u[0],e[1]-u[1]]},{to:d,arc:l}]}}function X(e,t,n=!1){let o=[],r=n?e.length:e.length-1;for(let i=0;i<r;i++)o.push(B(e[i],e[(i+1)%e.length],t));return o}function ie(e,t,n,o,r,i){let s=i/2,u=r-o>180?1:0,l={r:s,large:0,sweep:1},d=_e(e,t,n+s,o);return{from:d,segs:[{to:_e(e,t,n+s,r),arc:{r:n+s,large:u,sweep:1}},{to:_e(e,t,n-s,r),arc:l},{to:_e(e,t,n-s,o),arc:{r:n-s,large:u,sweep:0}},{to:d,arc:l}]}}var $=(...e)=>e.flat().map(gr).join(" "),J=(e,t,n)=>`M${K(e-n)} ${K(t)}a${K(n)} ${K(n)} 0 1 0 ${K(2*n)} 0a${K(n)} ${K(n)} 0 1 0 ${K(-2*n)} 0`,se=(e,t,n,o,r)=>gr(N(e,t,n,o,r)),Ct=e=>`M${e.map(je).join("L")}`,Mt=(e,t,n,o,r)=>`M${je(_e(e,t,n,o))}A${K(n)} ${K(n)} 0 ${r-o>180?1:0} 1 ${je(_e(e,t,n,r))}`;function Le(e,t,n,o=1){let r=i=>[i[0]*o+t,i[1]*o+n];return{head:[e.head[0]*o+t,e.head[1]*o+n,e.head[2]*o],limbs:e.limbs.map(i=>i.map(r)),arcs:e.arcs?.map(([i,s,u,l,d])=>[i*o+t,s*o+n,u*o,l,d])}}function Je(e){return[J(e.head[0],e.head[1],e.head[2]),...e.limbs.map(Ct),...(e.arcs??[]).map(([t,n,o,r,i])=>Mt(t,n,o,r,i))].join(" ")}function Te(e,t=2.6){return[H(e.head[0],e.head[1],e.head[2]+1),...e.limbs.flatMap(n=>X(n,t)),...(e.arcs??[]).map(([n,o,r,i,s])=>ie(n,o,r,i,s,t-.2))]}var ve={head:[10,4,2],limbs:[[[10,8.2],[10,14],[15.5,14],[18,19.5],[20.5,19.5]],[[10,10.6],[14.5,10.6]]],arcs:[[9.5,16,5.5,35,235]]},rr={head:[10.6,3.9,1.9],limbs:[[[9.6,7.8],[7.6,12]],[[5.4,8.2],[9.4,8.4],[12.8,10]],[[4,15.6],[7.6,12],[11,13.6],[10.6,16.4]]]},ir={cx:12,hr:1.9,arm:5,leg:3,r:2},ar={cx:12,hr:1.9,sh:2.2,hem:6,leg:3},sr={cx:6.2,hr:1.8,arm:3.6,leg:2.2,r:1.4},cr={cx:17.8,hr:1.8,sh:1.4,hem:4.1,leg:2.2};function lr({cx:e,hr:t,arm:n,leg:o,r}){return[J(e,2+t,t),`M${K(e-n+r)} 8.5H${K(e+n-r)}a${r} ${r} 0 0 1 ${r} ${r}V15H${K(e+o)}V22H${K(e-o)}V15H${K(e-n)}V${K(8.5+r)}a${r} ${r} 0 0 1 ${r} ${-r}Z`,`M${K(e)} 15V22`].join(" ")}function ur({cx:e,hr:t,arm:n,leg:o,r}){return[H(e,2+t,t+1),N(e-n-.5,7.8,2*n+1,7.7,r+.5),N(e-o-.5,13,o,9.5,1),N(e+.5,13,o,9.5,1)]}function dr({cx:e,hr:t,sh:n,hem:o,leg:r}){return[J(e,2+t,t),Ct([[e-n,8.5],[e+n,8.5],[e+o,16],[e+r,16],[e+r,22],[e-r,22],[e-r,16],[e-o,16]])+"Z",`M${K(e)} 16V22`].join(" ")}function fr({cx:e,hr:t,sh:n,hem:o,leg:r}){return[H(e,2+t,t+1),Y([[e-n-.6,7.8],[e+n+.6,7.8],[e+o+.9,16.8],[e-o-.9,16.8]]),N(e-r-.1,15,r-.4,7.5,.9),N(e+.5,15,r-.4,7.5,.9)]}var hs=[[14.6,1.5],[5.2,13.6],[11,13.6],[9.4,22.5],[18.8,10.4],[13,10.4]],ys="M8.5 3.5 4 5.5l-1.5 5 3 1 1-2v11h11v-11l1 2 3-1-1.5-5-4.5-2c-.5 1.5-1.8 2.5-3.5 2.5s-3-1-3.5-2.5Z",xs="M12 2.5S5 9.5 5 14.5a7 7 0 0 0 14 0c0-5-7-12-7-12Z",vs="M2.5 21.5h19V3h-6v6.2H9.2v6.2H2.5Z",pr=[[9,3],[15,3],[15,9],[21,9],[21,15],[15,15],[15,21],[9,21],[9,15],[3,15],[3,9],[9,9]],Ss={from:[3.8,5.2],segs:[{to:[20.2,5.2]},{to:[22,7],arc:{r:1.8,large:0,sweep:1}},{to:[22,9.7]},{to:[22,14.3],arc:{r:2.3,large:0,sweep:0}},{to:[22,17]},{to:[20.2,18.8],arc:{r:1.8,large:0,sweep:1}},{to:[3.8,18.8]},{to:[2,17],arc:{r:1.8,large:0,sweep:1}},{to:[2,14.3]},{to:[2,9.7],arc:{r:2.3,large:0,sweep:0}},{to:[2,7]},{to:[3.8,5.2],arc:{r:1.8,large:0,sweep:1}}]},Is={from:[12,1.6],segs:[{to:[20.4,4.9]},{to:[20.4,11.2]},{to:[12,22.4],arc:{r:13,large:0,sweep:1}},{to:[3.6,11.2],arc:{r:13,large:0,sweep:1}},{to:[3.6,4.9]},{to:[12,1.6]}]};function mr(e,t,n){return{from:[e-n,t],segs:[{to:[e+n,t],arc:{r:n,large:0,sweep:1}},{to:[e-n,t]}]}}var br={head:[13.2,4.3,2.2],limbs:[[[12.6,8.6],[11.2,15],[17.8,18.4],[9.4,18.4]],[[12.4,9.8],[16,14.4]]]},ws=[[6,10.5],[15,10.5],[16.5,7],[18.5,5.5],[20,6.5],[21.5,8.5],[19.5,10],[18,12],[18,19],[16.5,19],[15.5,14],[9.5,14],[8.5,19],[7,19],[6.5,13]],Ms=[[5.4,9.8],[14.6,9.8],[16.1,6.4],[18.4,4.6],[20.5,5.9],[22.4,8.6],[19.9,10.6],[18.8,12.3],[18.8,19.8],[15.8,19.8],[15,14.8],[10.1,14.8],[9.2,19.8],[6.2,19.8],[5.6,13.2]],gn=[{key:"restroom-men",label:"Men's restroom",group:"facilities",path:lr(ir),solid:$(ur(ir))},{key:"restroom-women",label:"Women's restroom",group:"facilities",path:dr(ar),solid:$(fr(ar))},{key:"restroom-accessible",label:"Accessible restroom",group:"facilities",path:[se(2.5,2.5,19,19,3.5),Je(Le(ve,4.6,4.3,.66))].join(" "),solid:$(Te(ve)),solidLarge:$(N(1.5,1.5,21,21,4.5),V(N(3.9,3.9,16.2,16.2,2.6)),Te(Le(ve,4.9,4.7,.62),2.2))},{key:"first-aid",label:"First aid",group:"facilities",path:Ct(pr)+"Z",solid:$(Y(pr.map(([e,t])=>[e+(e-12)*.08,t+(t-12)*.08])))},{key:"coat-check",label:"Coat check",group:"facilities",path:"M10 6.5a2 2 0 1 1 2 2V10 M12 10 3.4 16.9a1.4 1.4 0 0 0 .9 2.6h15.4a1.4 1.4 0 0 0 .9-2.6Z",solid:$(ie(12,6.2,2.2,180,450,2.3),B([12,8.4],[12,10.5],2.3),X([[12,10.2],[3.2,18.8],[20.8,18.8]],2.8,!0))},{key:"atm",label:"ATM / cash",group:"facilities",path:[se(2,6,20,12,2),J(12,12,2.75),"M6 12h.01 M18 12h.01"].join(" "),solid:$(N(1.5,5.5,21,13,2.4),V(H(12,12,3.2)))},{key:"info",label:"Info point",group:"facilities",path:[J(12,12,9.5),"M10.8 11H12v5.8 M12 7.6h.01"].join(" "),solid:$(H(12,4.9,2.4),N(10.3,9.2,3.4,12.3,1),N(8.2,9.2,4,3,1),N(8.2,18.5,7.6,3,1))},{key:"lost-found",label:"Lost & found",group:"facilities",path:[J(10.5,10.5,7.5),"M16 16l5.5 5.5","M8.4 8.4a2.1 2.1 0 1 1 3 1.9c-.6.4-.9.8-.9 1.6 M10.5 14.6h.01"].join(" "),solid:$(ie(12,7.6,4.2,180,405,3.4),X([[14.97,10.57],[12,13],[12,15]],3.4),H(12,20,2.1))},{key:"restrooms",label:"Toilets",group:"facilities",path:[lr(sr),dr(cr)].join(" "),solid:$(ur(sr),fr(cr))},{key:"charging",label:"Charging point",group:"facilities",path:[se(6,2,12,20,2.5),"M13.2 6.2 9.6 12h4.8l-3.6 5.8"].join(" "),solid:$(Y(hs))},{key:"smoking",label:"Smoking area",group:"facilities",path:[se(2,14.5,14.5,4,1),"M6.5 14.5v4","M15.5 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4 M19 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4"].join(" "),solid:$(N(1.5,14,4.2,5,1.2),N(6.8,14,10.4,5,1.2),X([[15.9,11.4],[17.3,8.9],[15.9,6.4],[17.1,3.9]],2.2),X([[19.6,11.4],[21,8.9],[19.6,6.4],[20.8,3.9]],2.2))},{key:"no-smoking",label:"No smoking",group:"facilities",path:[J(12,12,9.5),"M5.3 5.3l13.4 13.4","M5.5 10.5h13v3h-13Z"].join(" "),solid:$(H(12,12,10.6),V(H(12,12,8)),B([6,6],[18,18],2.8),N(5,10.4,3,3.2,.6),N(16,10.4,3,3.2,.6))},{key:"food",label:"Food",group:"food-drink",path:"M5 2.5V8a2.5 2.5 0 0 0 5 0V2.5 M7.5 2.5v19 M18.5 13.5h-2c-1.3 0-2-1-2-2.5 0-4 1.5-7 4-8.5v19",solid:$(X([[4.9,2.6],[4.9,8]],2.2),X([[10.1,2.6],[10.1,8]],2.2),X([[7.5,2.6],[7.5,8]],2.2),ie(7.5,8,2.6,0,180,2.2),B([7.5,10],[7.5,21.4],3),Y([[19.4,2.2],[19.4,14.2],[16.2,14.2],[14.1,12],[14.1,9.4],[15.2,5.8],[17.3,3.3]]),B([18,13],[18,21.4],3))},{key:"bar",label:"Bar",group:"food-drink",path:"M3.5 3.5h17L12 13Z M6.2 6.5h11.6 M12 13v7.5 M8 20.5h8",solid:$(Y([[2.8,3],[21.2,3],[12,13.6]]),B([12,12],[12,20.6],2.8),B([7.4,21],[16.6,21],2.8))},{key:"coffee",label:"Caf\xE9 / coffee",group:"food-drink",path:"M4 9h12v4.5a5.5 5.5 0 0 1-5.5 5.5h-1A5.5 5.5 0 0 1 4 13.5Z M16 10.5h1.2a2.75 2.75 0 0 1 0 5.5H16 M8 3v3 M12 3v3 M3 21.5h14",solid:$({from:[3.4,8.4],segs:[{to:[16.6,8.4]},{to:[16.6,13.4]},{to:[11,19.4],arc:{r:5.8,large:0,sweep:1}},{to:[9,19.4]},{to:[3.4,13.4],arc:{r:5.8,large:0,sweep:1}},{to:[3.4,8.4]}]},ie(17.2,13.25,2.5,270,450,2.4),B([7.8,2.6],[7.8,5.6],2.4),B([12.2,2.6],[12.2,5.6],2.4),B([2.6,21.6],[17.4,21.6],2.6))},{key:"water",label:"Water / drinks",group:"food-drink",path:xs,solid:"M12 1.2S4 8.9 4 14.5a8 8 0 0 0 16 0c0-5.6-8-13.3-8-13.3Z"},{key:"merch",label:"Merch / shop",group:"food-drink",path:ys,solid:"M8.4 2.8 3.5 5l-1.9 6 4.2 1.4.4-.8v9.4h11.6v-9.4l.4.8 4.2-1.4-1.9-6-4.9-2.2c-.4 1.5-1.8 2.6-3.6 2.6s-3.2-1.1-3.6-2.6Z"},{key:"screen",label:"Screen",group:"facilities",path:[se(2,3.5,20,13.5,2),"M12 17v3.5 M8 20.5h8","M10 7.8v5.9l5-2.95Z"].join(" "),solid:$(N(1.5,3,21,14.4,2.4),V(Y([[9.6,6.7],[16,10.2],[9.6,13.7]])),N(10.6,16.5,2.8,4,0),B([7.4,21],[16.6,21],2.8))},{key:"sound-booth",label:"Sound booth",group:"facilities",path:["M6 3v9 M6 16v5 M12 3v3 M12 10v11 M18 3v10 M18 17v4",J(6,14,2),J(12,8,2),J(18,15,2)].join(" "),solid:$(B([6,2.8],[6,21.2],1.8),B([12,2.8],[12,21.2],1.8),B([18,2.8],[18,21.2],1.8),N(3.2,11.6,5.6,4.8,1.4),N(9.2,5.6,5.6,4.8,1.4),N(15.2,12.6,5.6,4.8,1.4))},{key:"entrance",label:"Entrance",group:"navigation",path:"M11 7V3.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v17a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V17 M2.5 12h13.5 M12.5 8.5 16 12l-3.5 3.5",solid:$(X([[11,6.5],[11,2.6],[21,2.6],[21,21.4],[11,21.4],[11,17.5]],2.6),B([2.8,12],[13.5,12],3.2),Y([[12.6,7.8],[18,12],[12.6,16.2]]))},{key:"exit",label:"Exit",group:"navigation",path:"M13 7V3.5a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v17a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V17 M8 12h13.5 M18 8.5l3.5 3.5-3.5 3.5",solid:$(X([[13,6.5],[13,2.6],[3,2.6],[3,21.4],[13,21.4],[13,17.5]],2.6),B([7.2,12],[17,12],3.2),Y([[16.2,7.8],[21.6,12],[16.2,16.2]]))},{key:"emergency-exit",label:"Emergency exit",group:"navigation",path:[Je(Le(rr,-2,1.4,1.15)),"M15.5 13h6 M19 10.5l2.5 2.5-2.5 2.5"].join(" "),solid:$(Te(Le(rr,-2,1.4,1.15),2.7),B([15.6,13],[19.5,13],2.8),Y([[18.4,9.4],[22.4,13],[18.4,16.6]]))},{key:"stairs",label:"Stairs",group:"navigation",path:vs,solid:"M1.5 22.5h21V2h-7.8v6.4H8.4v6.4H1.5Z"},{key:"elevator",label:"Elevator",group:"navigation",path:[se(3.5,2.5,17,19,2.5),"M8.5 9.5 12 5.5l3.5 4Z M8.5 14.5l3.5 4 3.5-4Z"].join(" "),solid:$(Y([[12,1.6],[19.6,10.2],[4.4,10.2]]),Y([[4.4,13.8],[19.6,13.8],[12,22.4]]))},{key:"parking",label:"Parking",group:"navigation",path:[se(3,3,18,18,3),"M9.5 17V7h3.75a3 3 0 0 1 0 6H9.5"].join(" "),solid:"M6.5 21V3H12a5.5 5.5 0 0 1 0 11h-1.9v7Z M10.1 6.6v3.8H12a1.9 1.9 0 0 0 0-3.8Z"},{key:"wheelchair",label:"Wheelchair access",group:"accessibility",path:Je(ve),solid:$(Te(ve))},{key:"hearing",label:"Hearing assistance",group:"accessibility",path:["M4 9a6 6 0 1 1 12 0c0 3-1.8 4.3-3 5.2-1.1.8-1.6 1.7-1.6 3.1a3.6 3.6 0 0 1-6.2 2.1","M7.5 9a2.5 2.5 0 0 1 5 0c0 1.2-.7 1.9-1.6 2.5","M18.5 5.5a6.5 6.5 0 0 1 0 8"].join(" "),solid:$(ie(10,9,6,180,380,3),X([[15.64,11.05],[12.8,14.3],[11.5,17.2]],3),ie(8.2,17.2,3.3,0,150,3),ie(10,9,2.2,180,400,2.4),ie(13.38,9.5,6.5,322,398,2.6))},{key:"box-office",label:"Box office / tickets",group:"navigation",path:"M3 7.5A1.5 1.5 0 0 1 4.5 6h15A1.5 1.5 0 0 1 21 7.5V10a2 2 0 0 0 0 4v2.5a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 16.5V14a2 2 0 0 0 0-4Z M15 6v2 M15 11v2 M15 16v2",solid:$(Ss,V(N(14.1,7,1.8,2.2,.9)),V(N(14.1,10.9,1.8,2.2,.9)),V(N(14.1,14.8,1.8,2.2,.9)))},{key:"escalator",label:"Escalator",group:"navigation",path:"M2.5 17H7l9-9h5.5v4h-4l-9 9h-6Z M11 4.5h.01 M11 8.2v3.3",solid:$(Y([[2,16.4],[6.8,16.4],[15.8,7.4],[22,7.4],[22,12.6],[17.8,12.6],[8.8,21.6],[2,21.6]]),H(11,4.3,2.3),B([11,8],[11,11],2.6))},{key:"ramp",label:"Ramp",group:"navigation",path:"M2.5 19.5h19v-10Z M4.5 13.2 14 8.2 M10.53 7.76 14 8.2l-1.6 3.11",solid:$(Y([[1.6,20.4],[22.4,20.4],[22.4,8.6]]),B([4.2,13.4],[13.2,8.6],2.6),Y([[15.4,7.5],[13.16,11.84],[10.56,6.88]]))},{key:"taxi",label:"Taxi / rideshare",group:"navigation",path:["M9.5 2.5h5V5h-5Z M6.5 11 8 7h8l1.5 4",se(3.5,11,17,6,2),"M6.5 17v2.5 M17.5 17v2.5 M7 14h.01 M17 14h.01"].join(" "),solid:$(N(9,1.8,6,3.4,.8),Y([[6,11.4],[7.6,6.4],[16.4,6.4],[18,11.4]]),N(2.8,10.6,18.4,7,2.2),V(H(6.8,14,1.3)),V(H(17.2,14,1.3)),N(4.8,16,3.6,5.2,1.2),N(15.6,16,3.6,5.2,1.2))},{key:"transit",label:"Bus / transit",group:"navigation",path:[se(4.5,2.5,15,16,3),"M4.5 10.5h15 M9 5.5h6 M7.5 18.5V21 M16.5 18.5V21 M8 14.5h.01 M16 14.5h.01"].join(" "),solid:$(N(4,2,16,17,3.2),V(N(6.2,5.8,11.6,5,1)),V(H(8,14.5,1.3)),V(H(16,14.5,1.3)),N(6,17,3.4,5,1.2),N(14.6,17,3.4,5,1.2))},{key:"bike-parking",label:"Bike parking",group:"navigation",path:[J(6,14.5,4),J(18,14.5,4),"M6 14.5 9 7.5h6.5L18 14.5 M9 7.5l2.5 7H6 M11.5 14.5l4-7 M7.5 6h3 M15.5 7.5 15 5.5h2"].join(" "),solid:$(H(6,14.5,4.9),V(H(6,14.5,2.7)),H(18,14.5,4.9),V(H(18,14.5,2.7)),X([[6,14.5],[9,7.5],[15.5,7.5],[18,14.5]],2.2),X([[9,7.5],[11.5,14.5],[15.5,7.5]],2.2),B([6,14.5],[11.5,14.5],2.2),B([7.2,5.8],[10.6,5.8],2.2),X([[15.4,7.3],[15,5.4],[17.2,5.4]],2.2))},{key:"meeting-point",label:"Meeting point",group:"navigation",path:["M9.5 2.5 12 5l2.5-2.5 M9.5 21.5 12 19l2.5 2.5 M2.5 9.5 5 12l-2.5 2.5 M21.5 9.5 19 12l2.5 2.5",J(10,9.6,1.5),J(14,9.6,1.5),"M7.5 15.5a2.5 2.5 0 0 1 5 0 M11.5 15.5a2.5 2.5 0 0 1 5 0"].join(" "),solid:$(X([[9.4,2.4],[12,5],[14.6,2.4]],2.6),X([[9.4,21.6],[12,19],[14.6,21.6]],2.6),X([[2.4,9.4],[5,12],[2.4,14.6]],2.6),X([[21.6,9.4],[19,12],[21.6,14.6]],2.6),H(9.7,9.3,2.2),H(14.3,9.3,2.2),mr(9.7,16,3),mr(14.3,16,3))},{key:"security",label:"Security / bag check",group:"facilities",path:"M12 2.5 19.5 5.5v6c0 4.6-3.2 8.4-7.5 10-4.3-1.6-7.5-5.4-7.5-10v-6Z M8.5 12l2.5 2.5 4.5-5",solid:$(Is,V(Y([[7.4,12.2],[9,10.6],[10.9,12.5],[15,8.4],[16.6,10],[10.9,15.7]])))},{key:"lockers",label:"Lockers",group:"facilities",path:[se(3.5,2.5,17,19,1.5),"M12 2.5v19 M6 6h3 M15 6h3 M9.5 11.5v2.5 M14.5 11.5v2.5"].join(" "),solid:$(N(3,2,8.4,20,1.4),V(N(5,5,4.4,1.7,.8)),V(N(8.6,10.8,1.5,3.8,.7)),N(12.6,2,8.4,20,1.4),V(N(14.6,5,4.4,1.7,.8)),V(N(13.9,10.8,1.5,3.8,.7)))},{key:"baby-change",label:"Baby change",group:"facilities",path:"M10 6.5l.8-3.3a1.2 1.2 0 0 1 2.4 0l.8 3.3 M8.5 6.5h7 M9.5 6.5l-.9 2.2a3 3 0 0 0-.1.9V19a2.5 2.5 0 0 0 2.5 2.5h2a2.5 2.5 0 0 0 2.5-2.5V9.6a3 3 0 0 0-.1-.9l-.9-2.2 M8.5 12.5h3 M8.5 16h3",solid:$(Y([[9.6,6.2],[10.6,1.8],[13.4,1.8],[14.4,6.2]]),N(7.6,5.4,8.8,2.6,1),N(7.8,7.4,8.4,15,2.6),V(N(7.8,11.8,3.4,1.5,0)),V(N(7.8,15.4,3.4,1.5,0)))},{key:"prayer-room",label:"Prayer room",group:"facilities",path:[Je(br),"M3 21.5h18"].join(" "),solid:$(Te(br),N(2.4,20.2,19.2,2.6,1.3))},{key:"quiet-room",label:"Quiet room",group:"facilities",path:"M4 9h3.5l5-4v14l-5-4H4Z M15.5 9.5l5 5 M20.5 9.5l-5 5",solid:$(Y([[2.6,8.4],[7.2,8.4],[13,3.6],[13,20.4],[7.2,15.6],[2.6,15.6]]),B([15.4,9.2],[20.8,14.8],2.8),B([20.8,9.2],[15.4,14.8],2.8))},{key:"wifi",label:"Wi-Fi",group:"facilities",path:[Mt(12,19,11.5,218,322),Mt(12,19,7.5,218,322),Mt(12,19,3.5,218,322),"M12 19h.01"].join(" "),solid:$(ie(12,19.2,11,218,322,2.8),ie(12,19.2,6.9,218,322,2.8),H(12,19.2,2.2))},{key:"vip-lounge",label:"VIP lounge",group:"facilities",path:["M6.5 11V7a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v4","M3.5 11.5a1.5 1.5 0 0 1 3 0V14h11v-2.5a1.5 1.5 0 0 1 3 0v6h-17Z","M5.5 17.5V20 M18.5 17.5V20"].join(" "),solid:$(N(6,4,12,8.5,2.2),N(2.4,9.6,4.6,9,2.2),N(17,9.6,4.6,9,2.2),N(6,13.2,12,5.4,.6),B([5,18],[5,20.6],2.4),B([19,18],[19,20.6],2.4))},{key:"accessible-entrance",label:"Accessible entrance",group:"accessibility",path:[Je(Le(ve,.3,5,.62)),"M12.5 3.5H20a1 1 0 0 1 1 1v15a1 1 0 0 1-1 1h-7.5"].join(" "),solid:$(Te(Le(ve,.3,5,.62),2.2),X([[13,2.8],[21.2,2.8],[21.2,21.2],[13,21.2]],2.6))},{key:"assistance-dog",label:"Assistance-dog area",group:"accessibility",path:[Ct(ws)+"Z","M6 10.8 3.5 7.5","M10.5 10.5V6h4.5l1 2.5"].join(" "),solid:$(Y(Ms),B([6.2,11],[3.2,7.2],2.4),X([[10.5,11],[10.5,5.6],[15.2,5.6],[16.2,8.2]],2.2))}],lu=new Map(gn.map(e=>[e.key,e]));var hr=gn;var Cs=new Map(hr.map(e=>[e.key,e]));function Ot(e){return typeof e=="string"&&Cs.has(e)}var fu=hr.map(e=>e.key);var yr=["butt","round","square"],xr=["miter","round","bevel"],hn=["none","arrow"];function yn(e){return e==="line"||e==="polyline"}function me(e){return e.length>=3&&e.every(t=>Number.isFinite(t.x)&&Number.isFinite(t.y))}function Ne(e,t,n){let o=(e.y-t.y)*(n.x-t.x)-(e.x-t.x)*(n.y-t.y);if(Math.abs(o)>1e-7)return!1;let r=(e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y);if(r<-1e-7)return!1;let i=(n.x-t.x)**2+(n.y-t.y)**2;return r<=i+1e-7}function $e(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[r],s=t[o];if(Ne(e,i,s))return!0;i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n}function pe(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function Sr(e,t,n,o){let r=pe(e,t,n),i=pe(e,t,o),s=pe(n,o,e),u=pe(n,o,t);return(r>1e-7&&i<-1e-7||r<-1e-7&&i>1e-7)&&(s>1e-7&&u<-1e-7||s<-1e-7&&u>1e-7)?!0:Math.abs(r)<=1e-7&&Ne(n,e,t)||Math.abs(i)<=1e-7&&Ne(o,e,t)||Math.abs(s)<=1e-7&&Ne(e,n,o)||Math.abs(u)<=1e-7&&Ne(t,n,o)}function Se(e){for(let t=0;t<e.length;t+=1){let n=(t+1)%e.length;for(let o=t+1;o<e.length;o+=1){let r=(o+1)%e.length;if(!(t===o||n===o||r===t)&&Sr(e[t],e[n],e[o],e[r]))return!0}}return!1}function et(e,t){for(let n=0;n<e.length;n+=1)for(let o=0;o<t.length;o+=1)if(Sr(e[n],e[(n+1)%e.length],t[o],t[(o+1)%t.length]))return!0;return $e(e[0],t)||$e(t[0],e)}function vr(e,t){return!t.some((n,o)=>Ne(e,n,t[(o+1)%t.length]))&&$e(e,t)}function Ir(e){let t=e.outlinePath;if(!t?.segments.length)return;let n=i=>Number.isFinite(i.x)&&Number.isFinite(i.y),o=(i,s)=>Math.hypot(i.x-s.x,i.y-s.y);if(!n(t.start))return 0;let r=t.start;for(let i=0;i<t.segments.length;i++){let s=t.segments[i];if(!s||!n(s.end)||o(r,s.end)<=1e-9||s.kind==="bezier"&&(!n(s.control1)||!n(s.control2)))return i;if(s.kind==="arc"){if(!n(s.center)||!Number.isFinite(s.radius)||s.radius<=1e-6)return i;let u=Math.max(1e-4,s.radius*1e-4);if(Math.abs(o(r,s.center)-s.radius)>u||Math.abs(o(s.end,s.center)-s.radius)>u)return i}r=s.end}return o(r,t.start)>1e-4,t.segments.length-1}function Os(e,t,n,o){let r=pe(e,t,n),i=pe(e,t,o),s=pe(n,o,e),u=pe(n,o,t);return(r>1e-7&&i<-1e-7||r<-1e-7&&i>1e-7)&&(s>1e-7&&u<-1e-7||s<-1e-7&&u>1e-7)}function wr(e,t){for(let n=0;n<e.length;n+=1)for(let o=0;o<t.length;o+=1)if(Os(e[n],e[(n+1)%e.length],t[o],t[(o+1)%t.length]))return!0;return e.some(n=>vr(n,t))||t.some(n=>vr(n,e))}function Mr(e){return e.role!=="reference-focal"||!e.points||!me(e.points)?null:e.points}var Cr=["in","out","both"];function ks(e){return e?.type==="shape"&&e.gate!=null&&typeof e.gate=="object"}function Or(e){return e.type==="row"||e.type==="section"||e.type==="table"||e.type==="booth"||e.type==="gaArea"}function kr(e){return e==="out"?"exit":"entrance"}function As(e){return e.floors?.length?e.floors.flatMap(t=>t.objects):e.objects}function Ar(e){let t=new Map;for(let n of As(e))ks(n)&&t.set(n.id,n);return t}var xn=(e,t)=>typeof e=="string"&&e===e.normalize("NFKC").trim()&&e.length>=1&&e.length<=t,vn=e=>e===void 0||typeof e=="boolean";function Ps(e){let t=e.gate;if(!t||typeof t!="object")return"has an unreadable gate record";let n=t;return Cr.includes(n.use)?e.kind==="line"||e.kind==="polyline"?"must be a closed shape":e.role!==kr(n.use)?"must be an entrance (in, both) or an exit (out)":xn(e.label,40)?n.opens!==void 0&&!xn(n.opens,40)?`must say when it opens in 1 to ${40} characters`:!vn(n.stepFree)||!vn(n.hideFromBuyers)?"has a step-free or buyer setting that is not on or off":null:`needs a name of 1 to ${40} characters`:"must be used for in, out or both"}function Es(e){let t=e.route;return!t||typeof t!="object"?"has an unreadable route record":e.kind!=="line"&&e.kind!=="polyline"?"must be a line or path":xn(e.label,40)?vn(t.stepFree)?null:"has a step-free setting that is not on or off":`needs a name of 1 to ${40} characters`}function Sn(e,t,n){let o=ne(e).flatMap(i=>i.objects),r=new Set;for(let i of o)if(i.type==="shape"){if(i.gate!==void 0){r.add(i.id);let s=Ps(i);s&&t.push({severity:"error",code:"invalid-gate",message:`Gate "${i.label??i.id}" ${s}`,objectId:i.id})}if(i.route!==void 0){let s=Es(i);s&&t.push({severity:"error",code:"invalid-route",message:`Route "${i.label??i.id}" ${s}`,objectId:i.id})}}for(let i of o){if(!Or(i)||i.entranceGateId===void 0)continue;let s=i.entranceGateId;typeof s!="string"||!s.trim()?t.push({severity:"error",code:"invalid-entrance-gate",message:`"${i.label}" has an empty entrance gate`,objectId:i.id}):r.has(s)||n.push({severity:"warning",code:"unknown-entrance-gate",message:`"${i.label}" enters by a gate that is no longer on the map`,objectId:i.id})}}function _r(e,t){if(e.displayLabel!==void 0){let n=e.displayLabel.normalize("NFKC").trim();!(e.type==="row"&&e.displayLabel==="")&&(!n||n!==e.displayLabel||n.length>80)&&t.push({severity:"error",code:"invalid-display-label",message:`${e.type==="gaArea"?"GA area":e.type} "${e.label}" must use a normalized buyer label of 1 to 80 characters`,objectId:e.id})}if(e.displayType!==void 0){let n=e.displayType.normalize("NFKC").trim();(!n||n!==e.displayType||n.length>24)&&t.push({severity:"error",code:"invalid-display-type",message:`${e.type==="gaArea"?"GA area":e.type} "${e.label}" must use a normalized buyer type of 1 to 24 characters`,objectId:e.id})}e.type!=="row"&&Rs(e,t)}var Lr=(e,t)=>typeof e=="string"&&e===e.normalize("NFKC").trim()&&e.length>=1&&e.length<=t;function Rs(e,t){let n=e.type==="gaArea"?"GA area":e.type==="table"?"Table":"Booth",o=(i,s)=>t.push({severity:"error",code:i,message:`${n} "${e.label}" ${s}`,objectId:e.id});e.entrance!==void 0&&!Lr(e.entrance,40)&&o("invalid-entrance","must use a normalized entrance of 1 to 40 characters");let r=e.labelPresentation;if(r!==void 0){let i=r?.labelStyle?.size,s=i!==void 0&&(!Number.isFinite(i)||i<ln||i>un);(!r||typeof r!="object"||r.visible!==void 0&&typeof r.visible!="boolean"||s)&&o("invalid-label-presentation",`has an invalid name-on-map setting (size ${ln}\u2013${un})`)}if(e.type==="table"){let i=lo(e.chairNumbering);i&&o("invalid-chair-numbering",`has invalid chair numbering: ${i}`)}e.type==="booth"&&(e.boothType!==void 0&&!Uo.includes(e.boothType)&&o("invalid-booth-type","must use inline, corner, peninsula or island as its booth type"),e.commercial!==void 0&&(!e.commercial||typeof e.commercial!="object"||Object.keys(e.commercial).some(i=>i!=="note")||e.commercial.note!==void 0&&!Lr(e.commercial.note,160))&&o("invalid-booth-note","must use a normalized buyer note of 1 to 160 characters"))}function Tr(e,t,n,o){let r=e.crop,i=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(e.center?.x)||!Number.isFinite(e.center?.y)||!Number.isFinite(e.width)||e.width<=0||!Number.isFinite(e.opacity)||e.opacity<0||e.opacity>1||e.rotation!==void 0&&!Number.isFinite(e.rotation)||i)&&n.push({severity:"error",code:"invalid-background-placement",message:`The ${t} image has an invalid position, size, opacity, rotation, or crop`,...o?{floorId:o}:{}})}function In(e,t,n,o){let r=e.referenceImage,i=e.backgroundImage;r&&(Tr(r,"reference",t,o),!r.assetId&&!r.url&&t.push({severity:"error",code:"invalid-reference-image",message:"A trace reference must identify a private asset or self-contained image",...o?{floorId:o}:{}})),i&&(Tr(i,i.assetId?"legacy reference":"buyer background",t,o),!i.assetId&&!i.url&&t.push({severity:"error",code:"invalid-buyer-background",message:"A buyer background must contain a renderable image URL",...o?{floorId:o}:{}}),i.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",...o?{floorId:o}:{}})),ho(e)&&t.push({severity:"error",code:"conflicting-reference-images",message:"The canonical reference and legacy asset-backed background identify different private sources",...o?{floorId:o}:{}})}function tt(e){let t=new Set(Re.map(n=>n.key));return!e||/^ref_[0-9a-f-]{36}$/.test(e.assetId)&&!!e.logicalSectionId.trim()&&["user-confirmed","authoritative-source"].includes(e.evidence)&&!!e.sourceDescription.trim()&&(e.derivation===void 0||["explicit-inventory","server-synthesized-from-aggregate"].includes(e.derivation))&&(e.aggregateEvidence===void 0||["user-confirmed","authoritative-source"].includes(e.aggregateEvidence))&&(e.derivation!=="server-synthesized-from-aggregate"||e.evidence==="user-confirmed")&&(e.sectionAssignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(e.sectionAssignmentEvidence))&&e.sectionAssignmentEvidence===void 0==!e.sectionAssignmentSourceDescription?.trim()&&(e.sectionAssignmentSourceDescription?.trim().length??0)<=240&&(e.numberingEvidence===void 0||e.numberingEvidence==="user-confirmed")&&e.numberingEvidence===void 0==!e.numberingSourceDescription?.trim()&&(e.numberingSourceDescription?.trim().length??0)<=240&&(!e.accessibility||e.accessibility.placementDerivation==="server-synthesized-row-edges"&&e.accessibility.groupLogicalSectionIds.length>0&&e.accessibility.groupLogicalSectionIds.length<=100&&new Set(e.accessibility.groupLogicalSectionIds).size===e.accessibility.groupLogicalSectionIds.length&&e.accessibility.groupLogicalSectionIds.includes(e.logicalSectionId)&&e.accessibility.groupLogicalSectionIds.every(n=>!!n.trim()&&n.length<=160)&&["user-confirmed","authoritative-source"].includes(e.accessibility.assignmentEvidence)&&!!e.accessibility.assignmentSourceDescription.trim()&&e.accessibility.assignmentSourceDescription.trim().length<=240&&e.accessibility.counts.length>0&&e.accessibility.counts.length<=Re.length&&new Set(e.accessibility.counts.map(n=>n.type)).size===e.accessibility.counts.length&&e.accessibility.counts.every(n=>t.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 jr(e){let t=e.referenceInventoryExclusion;return!t||typeof t.assetId=="string"&&/^ref_[0-9a-f-]{36}$/.test(t.assetId)&&t.assetId===e.referenceSource?.assetId&&typeof t.logicalSectionId=="string"&&t.logicalSectionId===(e.logicalSectionId??e.id)&&typeof t.reason=="string"&&!!t.reason.trim()&&t.reason.trim().length<=80&&["user-confirmed","authoritative-source"].includes(t.evidence)&&typeof t.sourceDescription=="string"&&!!t.sourceDescription.trim()&&t.sourceDescription.trim().length<=240}function Nr(e){let t=e.referenceCategorySource;return!t||/^ref_[0-9a-f-]{36}$/.test(t.assetId)&&/^#[0-9a-f]{6}$/i.test(t.sourceColor)&&(t.sourceColors===void 0||t.sourceColors.length>0&&t.sourceColors.includes(t.sourceColor)&&new Set(t.sourceColors).size===t.sourceColors.length&&t.sourceColors.every(n=>/^#[0-9a-f]{6}$/i.test(n)&&`${n[1]}${n[3]}${n[5]}`.toLowerCase()===`${t.sourceColor[1]}${t.sourceColor[3]}${t.sourceColor[5]}`.toLowerCase()))&&(t.logicalSectionIds===void 0||t.logicalSectionIds.length>0&&new Set(t.logicalSectionIds).size===t.logicalSectionIds.length&&t.logicalSectionIds.every(n=>!!n.trim()&&n.length<=160))&&(t.assignmentDerivation===void 0||["source-color-class","confirmed-logical-sections"].includes(t.assignmentDerivation))&&t.assignmentEvidence===void 0==!t.assignmentSourceDescription?.trim()&&(t.assignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.assignmentEvidence))&&(t.assignmentSourceDescription?.trim().length??0)<=240&&(t.assignmentDerivation!=="confirmed-logical-sections"||t.assignmentEvidence!==void 0&&!!t.assignmentSourceDescription?.trim())&&t.sourcePaletteColor===void 0==(t.sourcePaletteColorEvidence===void 0)&&t.sourcePaletteColorEvidence===void 0==!t.sourcePaletteColorSourceDescription?.trim()&&(t.sourcePaletteColor===void 0||/^#[0-9a-f]{6}$/i.test(t.sourcePaletteColor))&&(t.sourcePaletteColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.sourcePaletteColorEvidence))&&(t.sourcePaletteColorSourceDescription?.trim().length??0)<=240&&["user-confirmed","authoritative-source"].includes(t.labelEvidence)&&!!t.labelSourceDescription.trim()&&t.labelSourceDescription.trim().length<=240&&e.price!==void 0&&["user-confirmed","authoritative-source"].includes(t.priceEvidence)&&!!t.priceSourceDescription.trim()&&t.priceSourceDescription.trim().length<=240&&t.outputColorEvidence===void 0==!t.outputColorSourceDescription?.trim()&&(t.outputColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.outputColorEvidence))&&(t.outputColorSourceDescription?.trim().length??0)<=240&&(e.color.toLowerCase()===(t.sourcePaletteColor??t.sourceColor).toLowerCase()&&new Set((t.sourceColors??[t.sourceColor]).map(n=>`${n[1]}${n[3]}${n[5]}`.toLowerCase())).size===1||t.outputColorEvidence!==void 0&&["user-confirmed","authoritative-source"].includes(t.outputColorEvidence))}function $r(e){let t=e.referenceDirectSeatImport;return!t||/^ref_[0-9a-f-]{36}$/.test(t.assetId)&&/^source-color:(?:#[0-9a-f]{6}(?:\+#[0-9a-f]{6})*|unclassified)$/i.test(t.familyId)}function Fr(e,t){let n=e.floors?.length?e.floors.map(i=>({id:i.id,objects:i.objects})):[{id:"floor-0",objects:e.objects}],o=new Map,r=new Map;for(let i of n){let s=i.objects.filter(d=>d.type==="row"),u=new Map,l=new Map;for(let d of s){if(d.segmentedRow){let c=u.get(d.segmentedRow.groupId)??[];c.push(d),u.set(d.segmentedRow.groupId,c)}if(d.rowBlockGeneration){let c=l.get(d.rowBlockGeneration.groupId)??[];c.push(d),l.set(d.rowBlockGeneration.groupId,c)}d.segmentedRow&&d.rowBlockGeneration&&t.push({severity:"error",code:"invalid-row-group-membership",message:`Row "${d.label}" cannot be both a segmented-row component and a generated row-block member`,objectId:d.id,floorId:i.id})}for(let[d,c]of u){let f=o.get(d);f&&f!==i.id&&t.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${d}" cannot span multiple floors`,objectId:c[0].id,floorId:i.id}),o.set(d,i.id);let b=c.slice().sort((A,E)=>A.segmentedRow.componentIndex-E.segmentedRow.componentIndex),m=b[0]?.segmentedRow,g=m?.componentCount??0,v=m?JSON.stringify({displayLabel:m.displayLabel,repeatLabelOnComponents:m.repeatLabelOnComponents,displayType:m.displayType,labelPresentation:m.labelPresentation,viewFromSeatUrl:m.viewFromSeatUrl,viewFromSeatMeta:m.viewFromSeatMeta,confidenceEvidence:m.confidenceEvidence,smoothing:m.smoothing}):"";m&&g>=2&&g<=64&&b.length===g&&m.boundaryBefore==="start"&&b.every((A,E)=>{let L=A.segmentedRow;return L.kind==="segmented-row-v1"&&L.groupId===d&&L.componentCount===g&&L.componentIndex===E&&(E===0?L.boundaryBefore==="start":L.boundaryBefore!=="start")&&L.displayLabel.normalize("NFKC").trim()===L.displayLabel&&L.displayLabel.length>0&&L.displayLabel.length<=80&&JSON.stringify({displayLabel:L.displayLabel,repeatLabelOnComponents:L.repeatLabelOnComponents,displayType:L.displayType,labelPresentation:L.labelPresentation,viewFromSeatUrl:L.viewFromSeatUrl,viewFromSeatMeta:L.viewFromSeatMeta,confidenceEvidence:L.confidenceEvidence,smoothing:L.smoothing})===v})||t.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${d}" has missing, duplicated, cyclic, or inconsistent component metadata`,objectId:c[0]?.id,floorId:i.id})}for(let[d,c]of l){let f=r.get(d);f&&f!==i.id&&t.push({severity:"error",code:"invalid-row-block-generation",message:"A generated row block cannot span multiple floors",objectId:c[0].id,floorId:i.id}),r.set(d,i.id)}}}function Dr(e,t){let n=(i,s)=>t.push({severity:"error",code:i,message:`GA area "${e.label}" ${s}`,objectId:e.id});e.bookAsWhole!==void 0&&typeof e.bookAsWhole!="boolean"&&n("invalid-ga-booking","has an invalid whole-area setting"),e.variableOccupancy!==void 0&&typeof e.variableOccupancy!="boolean"&&n("invalid-ga-booking","has an invalid party-size setting"),e.bookAsWhole===!0&&e.variableOccupancy===!0&&n("invalid-ga-booking","cannot be sold whole and by party size at the same time");let o=fe(e);if(o&&e.inventorySegments!==void 0&&n("invalid-ga-booking","was joined from other areas and must be sold per person, not as one box"),o&&e.capacity>ye&&n("invalid-ga-booking",`is sold to one party but holds ${e.capacity} guests; at most ${ye} can book in one go`),o&&de(e.label)&&n("reserved-seat-label",`uses SeatLayer's reserved GA namespace for its box label "${e.label}"`),o==="variable"){let i=e.minOccupancy,s=e.maxOccupancy;(!Number.isInteger(i)||!Number.isInteger(s)||i<1||s<i||s>e.capacity)&&n("invalid-ga-occupancy",`needs whole-number fewest and most guests from 1 to its ${e.capacity}-person capacity`)}else(e.minOccupancy!==void 0||e.maxOccupancy!==void 0)&&n("invalid-ga-occupancy","has guest bounds without party-size selling");let r=e.wheelchairPlaces;r!==void 0&&(!Number.isInteger(r)||r<0||r>e.capacity)&&n("invalid-ga-wheelchair-places",`must have from 0 to ${e.capacity} wheelchair places`)}function Br(e){return e==="m"||e==="ft"}function Ls(e){return e==="ft"?.3048:1}function kt(e,t){return e/Ls(t)}var Ts=e=>Math.abs(e)<1e-9?0:e;function At(e,t="m"){let n=Ts(kt(e,t)),o=Math.abs(n);return t==="ft"?o<100?`${n.toFixed(1)} ft`:`${Math.round(n)} ft`:o<1?`${n.toFixed(2)} m`:o<100?`${n.toFixed(1)} m`:`${Math.round(n)} m`}var _s=.5,js=5e3,Ns=e=>typeof e=="number"&&Number.isFinite(e),$s=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Gr(e){let t=e?.designerSettings;return $s(t)?t:null}function Pt(e){let t=Gr(e)?.units;return Br(t)?t:"m"}function nt(e){let t=Gr(e)?.unitsPerMetre;return Ns(t)&&t>=_s&&t<=js?t:null}function wn(e,t){let n=t/(nt(e)??ze),o=Pt(e);return o==="ft"&&kt(n,"ft")<.1?`${kt(n,"ft").toFixed(2)} ft`:At(n,o)}function Ds(e){return e.type==="row"||e.type==="table"||e.type==="booth"}function Bs(e){let t=[],n=new Map((e.overrides??[]).map(o=>[o.index,o]));for(let o=0;o<e.seatCount;o++){let r=n.get(o);r?.skip||t.push({label:pt(e,o,r),index:o})}return t}function Ur(e){let t=[],n=new Map((e.overrides??[]).map(o=>[o.index,o]));for(let o=0;o<e.seatCount;o++){let r=n.get(o);r?.skip||t.push({label:r?.label??`${e.label}-${o+1}`,index:o})}return t}function Mn(e){return Array.isArray(e)&&e.every(t=>!!t&&typeof t=="object")}function Cn(e){return Array.isArray(e)&&e.every(t=>Array.isArray(t)&&t.every(n=>!!n&&typeof n=="object"))}function Kr(e,t={}){let n=t.maxInventory??1e5,o=[];e.floorOverview!==void 0&&e.floorOverview!=="combined"&&e.floorOverview!=="separated"&&o.push({severity:"error",code:"invalid-floor-overview",message:"Whole venue view must be Combined plan or Separate levels"}),e.eventConfigurationId!==void 0&&(typeof e.eventConfigurationId!="string"||e.eventConfigurationId.normalize("NFKC").trim()!==e.eventConfigurationId||e.eventConfigurationId.length<1||e.eventConfigurationId.length>100)&&o.push({severity:"error",code:"invalid-event-configuration",message:"Active event configuration must contain 1 to 100 normalized characters"});let r=[],i=new Set(e.categories.map(a=>a.key)),s=new Set(Re.map(a=>a.key)),u=new Map(e.categories.map(a=>[a.key,qo(a)])),l=new Set;In(e,o,r),Sn(e,o,r),e.theme?.sectionDetail!==void 0&&!["rows","seats"].includes(e.theme.sectionDetail)&&o.push({severity:"error",code:"invalid-section-detail",message:"Section detail must be rows or seats"}),e.theme?.logoUrl!==void 0&&!Zt(e.theme.logoUrl)&&o.push({severity:"error",code:"invalid-theme-logo-url",message:"The buyer-facing theme logo URL is invalid"});let d=Zt,c=(a,_,p,h={})=>{if(_===void 0)return;if(!_||typeof _!="object"||Array.isArray(_)){o.push({severity:"error",code:"invalid-seat-view-metadata",message:`${p} view metadata is invalid`,...h});return}let x=_;a||r.push({severity:"warning",code:"orphaned-seat-view-metadata",message:`${p} view metadata has no image`,...h});let T=new Set(["exact-seat","row-representative","section-representative","floor-representative","venue-representative"]);x.projection!==void 0&&x.projection!=="equirectangular"&&o.push({severity:"error",code:"invalid-seat-view-projection",message:`${p} view projection must be equirectangular`,...h}),x.coverage!==void 0&&!T.has(x.coverage)&&o.push({severity:"error",code:"invalid-seat-view-coverage",message:`${p} view coverage is invalid`,...h});let P=(C,R,j)=>typeof C=="number"&&Number.isFinite(C)&&C>=R&&C<=j;if(x.initialBearingDeg!==void 0&&!P(x.initialBearingDeg,-360,360)&&o.push({severity:"error",code:"invalid-seat-view-bearing",message:`${p} view bearing must be between -360\xB0 and 360\xB0`,...h}),x.initialPitchDeg!==void 0&&!P(x.initialPitchDeg,-90,90)&&o.push({severity:"error",code:"invalid-seat-view-pitch",message:`${p} view pitch must be between -90\xB0 and 90\xB0`,...h}),x.capturedAt!==void 0&&(typeof x.capturedAt!="string"||x.capturedAt.length>40||!Number.isFinite(Date.parse(x.capturedAt)))&&o.push({severity:"error",code:"invalid-seat-view-capture-date",message:`${p} view capture date is invalid`,...h}),x.sourceLabel!==void 0&&(typeof x.sourceLabel!="string"||x.sourceLabel.trim().length>100)&&o.push({severity:"error",code:"invalid-seat-view-source",message:`${p} view source label is invalid`,...h}),x.previewUrl!==void 0&&!d(x.previewUrl)&&o.push({severity:"error",code:"invalid-seat-view-preview-url",message:`${p} view preview URL is invalid`,...h}),x.variants!==void 0){let C=Array.isArray(x.variants)?x.variants:[];if(!Array.isArray(x.variants)||C.length<1||C.length>4)o.push({severity:"error",code:"invalid-seat-view-variants",message:`${p} view variants must contain between 1 and 4 tiers`,...h});else{let R=new Set;for(let j of C){if(!j||typeof j!="object"||!d(j.url)||!Number.isInteger(j.width)||j.width<1||j.width>12e3||!Number.isInteger(j.height)||j.height<1||j.height>12e3||j.width!==j.height*2||typeof j.sha256!="string"||!/^[a-f0-9]{64}$/.test(j.sha256)||R.has(j.width)){o.push({severity:"error",code:"invalid-seat-view-variant",message:`${p} view variant is not a unique immutable 2:1 equirectangular tier`,...h});break}R.add(j.width)}}}for(let[C,R]of[["width",x.sourceWidth],["height",x.sourceHeight],["preview width",x.previewWidth],["preview height",x.previewHeight]])R!==void 0&&(!Number.isInteger(R)||R<1||R>32768)&&o.push({severity:"error",code:"invalid-seat-view-dimensions",message:`${p} view source ${C} is invalid`,...h});x.captureEyeHeightM!==void 0&&!P(x.captureEyeHeightM,.5,3)&&o.push({severity:"error",code:"invalid-seat-view-eye-height",message:`${p} capture eye height must be between 0.5 m and 3 m`,...h}),x.eventConfigurationId!==void 0&&(typeof x.eventConfigurationId!="string"||!x.eventConfigurationId.trim()||x.eventConfigurationId.length>100)&&o.push({severity:"error",code:"invalid-seat-view-configuration",message:`${p} event configuration id is invalid`,...h}),x.eventConfigurationVersion!==void 0&&(!Number.isInteger(x.eventConfigurationVersion)||x.eventConfigurationVersion<1)&&o.push({severity:"error",code:"invalid-seat-view-configuration-version",message:`${p} event configuration version is invalid`,...h}),x.eventConfigurationVersion!==void 0&&!x.eventConfigurationId&&o.push({severity:"error",code:"invalid-seat-view-configuration-pin",message:`${p} event configuration version requires an id`,...h})},f=(a,_,p={})=>{if(a===void 0)return;let h=R=>{o.push({severity:"error",code:"invalid-seat-confidence-evidence",message:`${_} confidence evidence ${R}`,...p})};if(!a||typeof a!="object"||Array.isArray(a)){h("is invalid");return}let x=a;x.schema!=="seatlayer.seat-confidence/1"&&h("has an unsupported schema");let T=(R,j)=>typeof R=="string"&&R.normalize("NFKC").trim()===R&&R.length>0&&R.length<=j;T(x.evidenceId,120)||h("has an invalid evidence id"),T(x.modelVersion,120)||h("has an invalid model version"),new Set(["synthetic-model","organizer-approved","calibrated-provider"]).has(x.evidenceKind)||h("has an invalid evidence kind"),new Set(["generated","geometry-verified","configuration-verified"]).has(x.modelLevel)||h("has an invalid model level");let P=x.realityLevel??"none";new Set(["none","comparable-build-reference","actual-build-checked"]).has(P)||h("has an invalid reality level"),x.eventConfigurationId!==void 0&&!T(x.eventConfigurationId,100)&&h("has an invalid event configuration id"),x.eventConfigurationVersion!==void 0&&(!Number.isInteger(x.eventConfigurationVersion)||x.eventConfigurationVersion<1)&&h("has an invalid event configuration version"),x.status!==void 0&&!new Set(["draft","approved","retracted"]).has(x.status)&&h("has an invalid publication status"),x.basisSha256!==void 0&&!/^[a-f0-9]{64}$/.test(x.basisSha256)&&h("has an invalid venue basis SHA-256"),x.basisSha256!==void 0&&x.status!=="approved"&&h("can carry a venue basis SHA-256 only after approval");for(let[R,j]of[["assessment",x.assessedAt],["expiry",x.validUntil]])j!==void 0&&(!T(j,40)||!Number.isFinite(Date.parse(j)))&&h(`has an invalid ${R} date`);x.approvedByRole!==void 0&&!T(x.approvedByRole,100)&&h("has an invalid approving organization or role"),x.sourceLabel!==void 0&&!T(x.sourceLabel,120)&&h("has an invalid source label"),x.limitations!==void 0&&(!Array.isArray(x.limitations)||x.limitations.length>6||x.limitations.some(R=>!T(R,160)))&&h("has invalid limitations"),x.evidenceKind==="synthetic-model"&&(x.modelLevel!=="generated"||P!=="none")&&h("cannot describe synthetic data as verified or reality checked"),x.modelLevel!=="generated"&&(!x.assessedAt||!x.approvedByRole)&&h("requires an assessment date and approving organization or role for verified model levels"),x.modelLevel==="configuration-verified"&&!x.eventConfigurationId&&h("requires an event configuration id for configuration verification"),P!=="none"&&(!x.assessedAt||!x.sourceLabel)&&h("requires an assessment date and source for reality evidence"),P==="actual-build-checked"&&(x.modelLevel!=="configuration-verified"||!x.eventConfigurationId)&&h("requires a configuration-verified model and event configuration for an actual-build check");let C=x.modeledTarget;C!==void 0&&(!C||typeof C!="object"||Array.isArray(C)?h("has an invalid modeled target"):((!T(C.label,80)||!T(C.methodLabel,100))&&h("has invalid modeled-target labels"),(!Number.isInteger(C.totalRayCount)||C.totalRayCount<1||C.totalRayCount>1e3||!Number.isInteger(C.clearRayCount)||C.clearRayCount<0||C.clearRayCount>C.totalRayCount)&&h("has invalid modeled-target ray counts"),new Set(["clear","partial","obstructed"]).has(C.classification)||h("has an invalid modeled-target classification"),C.occluderLabels!==void 0&&(!Array.isArray(C.occluderLabels)||C.occluderLabels.length>10||C.occluderLabels.some(R=>!T(R,100)))&&h("has invalid modeled-target occluders")))};c(e.viewFromSeatUrl,e.viewFromSeatMeta,"Venue"),f(e.confidenceEvidence,"Venue"),e.viewFromSeatUrl!==void 0&&!d(e.viewFromSeatUrl)&&o.push({severity:"error",code:"invalid-venue-view-url",message:"The whole-venue view-from-seat image URL is invalid"});for(let a of e.floors??[])a.viewFromSeatUrl!==void 0&&!d(a.viewFromSeatUrl)&&o.push({severity:"error",code:"invalid-floor-view-url",message:`Floor "${a.name}" has an invalid view-from-seat image URL`}),c(a.viewFromSeatUrl,a.viewFromSeatMeta,`Floor "${a.name}"`,{floorId:a.id}),f(a.confidenceEvidence,`Floor "${a.name}"`,{floorId:a.id});let b=e.floors?.length?e.floors.flatMap(a=>a.objects):e.objects;for(let a of b)if((a.type==="row"||a.type==="section")&&(a.viewFromSeatUrl!==void 0&&!d(a.viewFromSeatUrl)&&o.push({severity:"error",code:a.type==="row"?"invalid-row-view-url":"invalid-section-view-url",message:`${a.type==="row"?"Row":"Section"} "${a.label}" has an invalid view-from-seat image URL`,objectId:a.id}),c(a.viewFromSeatUrl,a.viewFromSeatMeta,`${a.type==="row"?"Row":"Section"} "${a.label}"`,{objectId:a.id}),f(a.confidenceEvidence,`${a.type==="row"?"Row":"Section"} "${a.label}"`,{objectId:a.id})),a.type==="row"&&a.segmentedRow&&(a.segmentedRow.viewFromSeatUrl!==void 0&&!d(a.segmentedRow.viewFromSeatUrl)&&o.push({severity:"error",code:"invalid-segmented-row-view-url",message:`Segmented row "${a.segmentedRow.displayLabel}" has an invalid view-from-seat image URL`,objectId:a.id}),c(a.segmentedRow.viewFromSeatUrl,a.segmentedRow.viewFromSeatMeta,`Segmented row "${a.segmentedRow.displayLabel}"`,{objectId:a.id}),f(a.segmentedRow.confidenceEvidence,`Segmented row "${a.segmentedRow.displayLabel}"`,{objectId:a.id})),a.type==="row"||a.type==="table")for(let _ of a.overrides??[])_.viewFromSeatUrl!==void 0&&!d(_.viewFromSeatUrl)&&o.push({severity:"error",code:"invalid-seat-view-url",message:`Seat ${_.index+1} has an invalid view-from-seat image URL`,objectId:a.id,seatIndices:[_.index]}),c(_.viewFromSeatUrl,_.viewFromSeatMeta,`Seat ${_.index+1}`,{objectId:a.id,seatIndices:[_.index]}),f(_.confidenceEvidence,`Seat ${_.index+1}`,{objectId:a.id,seatIndices:[_.index]});let m=new Set;for(let a of e.categories){m.has(a.key)&&o.push({severity:"error",code:"duplicate-category-key",message:`Category key "${a.key}" is used more than once`,categoryKey:a.key}),m.add(a.key);let _=new Set;for(let p of a.tiers??[]){if(_.has(p.id)&&o.push({severity:"error",code:"duplicate-category-tier-id",message:`Ticket tier id "${p.id}" is used more than once in category "${a.key}"`,categoryKey:a.key}),p.restriction!=null&&!["companion","child","senior","student","membership","custom"].includes(p.restriction)&&o.push({severity:"error",code:"invalid-category-tier-restriction",message:`Ticket tier "${p.name}" has an unknown restriction`,categoryKey:a.key}),p.buyerMessage!=null&&(!p.buyerMessage.trim()||p.buyerMessage.length>240)&&o.push({severity:"error",code:"invalid-category-tier-buyer-message",message:`Ticket tier "${p.name}" buyer guidance must contain 1 to 240 characters`,categoryKey:a.key}),p.currency!=null&&!/^[A-Z]{3}$/.test(p.currency)&&o.push({severity:"error",code:"invalid-category-tier-currency",message:`Ticket tier "${p.name}" must use a three-letter ISO currency`,categoryKey:a.key}),p.applicability!=null){let h=p.applicability.seatLabels,x=p.applicability.accessibility;(h!==void 0&&(!Array.isArray(h)||!h.length||h.length>1e4||h.some(T=>typeof T!="string"||!T.trim()||T.length>160)||new Set(h).size!==h.length)||x!==void 0&&(!Array.isArray(x)||!x.length||x.some(T=>!s.has(T))||new Set(x).size!==x.length))&&o.push({severity:"error",code:"invalid-category-tier-applicability",message:`Ticket tier "${p.name}" has invalid seat applicability`,categoryKey:a.key})}p.evidence!=null&&(!["public-host","public-event","user-confirmed"].includes(p.evidence.provenance)||!p.evidence.sourceDescription.trim()||p.evidence.sourceDescription.length>240||p.evidence.capturedAt!==void 0&&(p.evidence.capturedAt.length>40||!Number.isFinite(Date.parse(p.evidence.capturedAt))))&&o.push({severity:"error",code:"invalid-category-tier-evidence",message:`Ticket tier "${p.name}" has invalid evidence provenance`,categoryKey:a.key}),_.add(p.id)}Nr(a)||o.push({severity:"error",code:"invalid-reference-category-source",message:`Category ${a.label||a.key} has incomplete or invalid reference evidence`,categoryKey:a.key}),$r(a)||o.push({severity:"error",code:"invalid-reference-direct-seat-import",message:`Category ${a.label||a.key} has invalid direct-seat import provenance`,categoryKey:a.key})}let g=new Map,v=new Map,S=[],A=new Map,E=0,L=0,I=new Set;for(let a of e.floors??[])In(a,o,r,a.id),I.has(a.id)&&o.push({severity:"error",code:"duplicate-floor-id",message:`Floor id "${a.id}" is used more than once`,floorId:a.id}),I.add(a.id),a.baseHeightM!==void 0&&(!Number.isFinite(a.baseHeightM)||a.baseHeightM<ge||a.baseHeightM>ue)&&o.push({severity:"error",code:"invalid-floor-base-height",message:`Floor "${a.name}" base height must be between ${ge} and ${ue} metres`,floorId:a.id});let M=e.floors&&e.floors.length?e.floors.flatMap(a=>a.objects):e.objects;Fr(e,o);let y=new Set;for(let a of M)y.has(a.id)&&o.push({severity:"error",code:"duplicate-object-id",message:`Object id "${a.id}" is used more than once`,objectId:a.id}),y.add(a.id);let w=new Set;for(let a of e.zones??[])w.has(a.id)&&o.push({severity:"error",code:"duplicate-zone-id",message:`Zone id "${a.id}" is used more than once`}),w.add(a.id),a.focalPoint!==void 0&&(!Number.isFinite(a.focalPoint.x)||!Number.isFinite(a.focalPoint.y))&&o.push({severity:"error",code:"invalid-zone-focal-point",message:`Zone "${a.label}" must use a finite focal point`});let k=new Map;for(let a of M)if(!(a.type!=="section"||!a.zone)){if(e.zones?.length&&!w.has(a.zone)){o.push({severity:"error",code:"unknown-section-zone",message:`Section "${a.displayLabel??a.label}" references unknown zone "${a.zone}"`,objectId:a.id});continue}k.has(a.zone)||k.set(a.zone,a)}for(let[a,_]of k){let p=e.zones?.find(h=>h.id===a);p&&(p?.focalPoint||r.push({severity:"warning",code:"missing-zone-focal-point",message:`Zone "${p?.label??a}" uses the legacy floor focal; set its own focal point before publishing`,objectId:_.id}))}for(let a of M)if((a.type==="row"||a.type==="table"||a.type==="booth"||a.type==="gaArea")&&_r(a,o),Ds(a)){if(E++,L+=a.type==="booth"?1:a.type==="row"?xt(a):a.bookAsWhole||a.variableOccupancy?a.seatCount:Ur(a).length,g.get(a.label)!==void 0?a.type!=="row"&&o.push({severity:"error",code:"duplicate-object-label",message:`Label "${a.label}" is used by more than one object`,objectId:a.id}):g.set(a.label,a.id),i.has(a.categoryKey)?l.add(a.categoryKey):o.push({severity:"error",code:"unknown-category",message:`"${a.label}" references unknown category "${a.categoryKey}"`,objectId:a.id,categoryKey:a.categoryKey}),a.type==="row"){tt(a.referenceInventorySource)||o.push({severity:"error",code:"invalid-reference-inventory-source",message:`Row "${a.label}" has invalid reference-inventory provenance`,objectId:a.id}),a.seatCount<1&&o.push({severity:"error",code:"empty-row",message:`Row "${a.label}" has no seats`,objectId:a.id}),a.aisleSeats!==void 0&&!nr(a.aisleSeats)&&o.push({severity:"error",code:"invalid-row-aisle-seats",message:`Row "${a.label}" must mark its aisle seats at the start, end, both or none`,objectId:a.id});let p=new Set;for(let h of a.overrides??[]){(h.accessibility??[]).filter(C=>!s.has(C)).length&&o.push({severity:"error",code:"invalid-accessibility-type",message:`Row "${a.label}" seat ${h.index+1} uses an unknown accessibility type`,objectId:a.id,seatIndices:[h.index]}),(!Number.isInteger(h.index)||h.index<0||h.index>=a.seatCount||p.has(h.index))&&o.push({severity:"error",code:"invalid-seat-override",message:`Row "${a.label}" has a duplicated or out-of-range seat override`,objectId:a.id,...Number.isInteger(h.index)?{seatIndices:[h.index]}:{}}),p.add(h.index);let T=h.wheelchairSpaceType,P=h.accessible===!0||h.accessibility?.includes("wheelchair");T!==void 0&&T!=="seat-present"&&T!=="no-seat"?o.push({severity:"error",code:"invalid-wheelchair-space",message:`Row "${a.label}" seat ${h.index+1} has an invalid wheelchair-space type`,objectId:a.id,seatIndices:[h.index]}):T&&(!P||h.skip)&&o.push({severity:"error",code:"invalid-wheelchair-space",message:h.skip?`Row "${a.label}" seat ${h.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Row "${a.label}" seat ${h.index+1} must include wheelchair accessibility for its physical-space type`,objectId:a.id,seatIndices:[h.index]})}for(let h of Bs(a))de(h.label)&&o.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${h.label}" uses SeatLayer's reserved GA namespace`,objectId:a.id,seatIndices:[h.index]}),v.get(h.label)!==void 0?S.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${h.label}" is used more than once`,objectId:a.id,seatIndices:[h.index]}):v.set(h.label,a.id)}else if(a.type==="table"){let p=a.bookAsWhole===!0||a.variableOccupancy===!0;if(a.fill!==void 0&&!Fo(a.fill)&&o.push({severity:"error",code:"invalid-table-fill",message:`Table "${a.label}" has an invalid surface color`,objectId:a.id}),a.automaticRadius!==void 0&&typeof a.automaticRadius!="boolean"?o.push({severity:"error",code:"invalid-table-automatic-radius",message:`Table "${a.label}" has an invalid automatic-radius setting`,objectId:a.id}):a.automaticRadius===!0&&(a.shape!=="round"||a.radius!==yo(a.seatCount,a.seatArc))&&o.push({severity:"error",code:"invalid-table-automatic-radius",message:`Table "${a.label}" needs a radius that matches its automatic chair spacing`,objectId:a.id}),a.seatCountsBySide){let P=["top","bottom","left","right"],C=Object.keys(a.seatCountsBySide),R=P.every(G=>Number.isInteger(a.seatCountsBySide[G])&&a.seatCountsBySide[G]>=0&&a.seatCountsBySide[G]<=40),j=R?P.reduce((G,Z)=>G+a.seatCountsBySide[Z],0):Number.NaN;(a.shape!=="rect"||C.length!==P.length||C.some(G=>!P.includes(G))||!R||j!==a.seatCount||j<1||j>40)&&o.push({severity:"error",code:"invalid-table-side-counts",message:`Table "${a.label}" needs top, bottom, left, and right whole-number chair counts totaling its ${a.seatCount}-chair capacity`,objectId:a.id})}p&&a.overrides?.length&&o.push({severity:"error",code:"grouped-table-chair-overrides",message:`Grouped table "${a.label}" cannot carry individual-chair overrides`,objectId:a.id,seatIndices:a.overrides.map(P=>P.index)});let h=new Set;for(let P of a.overrides??[]){(P.accessibility??[]).filter(G=>!s.has(G)).length&&o.push({severity:"error",code:"invalid-accessibility-type",message:`Table "${a.label}" chair ${P.index+1} uses an unknown accessibility type`,objectId:a.id,seatIndices:[P.index]}),(!Number.isInteger(P.index)||P.index<0||P.index>=a.seatCount||h.has(P.index))&&o.push({severity:"error",code:"invalid-seat-override",message:`Table "${a.label}" has a duplicated or out-of-range chair override`,objectId:a.id,...Number.isInteger(P.index)?{seatIndices:[P.index]}:{}}),h.add(P.index),P.categoryKey&&!i.has(P.categoryKey)?o.push({severity:"error",code:"unknown-category",message:`Table "${a.label}" chair ${P.index+1} references unknown category "${P.categoryKey}"`,objectId:a.id,seatIndices:[P.index],categoryKey:P.categoryKey}):P.categoryKey&&l.add(P.categoryKey);let R=P.wheelchairSpaceType,j=P.accessible===!0||P.accessibility?.includes("wheelchair");R!==void 0&&R!=="seat-present"&&R!=="no-seat"?o.push({severity:"error",code:"invalid-wheelchair-space",message:`Table "${a.label}" chair ${P.index+1} has an invalid wheelchair-space type`,objectId:a.id,seatIndices:[P.index]}):R&&(!j||P.skip)&&o.push({severity:"error",code:"invalid-wheelchair-space",message:P.skip?`Table "${a.label}" chair ${P.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Table "${a.label}" chair ${P.index+1} must include wheelchair accessibility for its physical-space type`,objectId:a.id,seatIndices:[P.index]})}a.bookAsWhole&&a.variableOccupancy?o.push({severity:"error",code:"invalid-table-booking-mode",message:`Table "${a.label}" cannot be sold both as a whole table and with variable occupancy`,objectId:a.id}):a.variableOccupancy?(!Number.isInteger(a.minOccupancy)||!Number.isInteger(a.maxOccupancy)||a.minOccupancy<1||a.maxOccupancy<a.minOccupancy||a.maxOccupancy>a.seatCount)&&o.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${a.label}" needs whole-number minimum and maximum guests from 1 to its ${a.seatCount}-chair capacity`,objectId:a.id}):(a.minOccupancy!=null||a.maxOccupancy!=null)&&o.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${a.label}" has guest bounds without variable-occupancy selling`,objectId:a.id}),tt(a.referenceInventorySource)||o.push({severity:"error",code:"invalid-reference-inventory-source",message:`Table "${a.label}" has invalid reference-inventory provenance`,objectId:a.id}),(a.shape==="round"&&a.radius==null||a.shape==="rect"&&(a.width==null||a.height==null)||a.seatCount<1)&&o.push({severity:"error",code:"bad-table",message:`Table "${a.label}" is missing required dimensions or seats`,objectId:a.id});let T=p?[{label:a.label,index:void 0}]:Ur(a);for(let P of T)de(P.label)&&o.push({severity:"error",code:"reserved-seat-label",message:`Inventory label "${P.label}" uses SeatLayer's reserved GA namespace`,objectId:a.id}),v.get(P.label)!==void 0?S.push({severity:"error",code:"duplicate-seat-label",message:`Inventory label "${P.label}" is used more than once; grouped table labels must be unique`,objectId:a.id,...P.index===void 0?{}:{seatIndices:[P.index]}}):v.set(P.label,a.id)}else if(a.type==="booth"){tt(a.referenceInventorySource)||o.push({severity:"error",code:"invalid-reference-inventory-source",message:`Booth "${a.label}" has invalid reference-inventory provenance`,objectId:a.id});let p=a.label;de(p)&&o.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${p}" uses SeatLayer's reserved GA namespace`,objectId:a.id}),v.get(p)!==void 0?S.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${p}" is used more than once`,objectId:a.id}):v.set(p,a.id)}}else if(a.type==="gaArea"){if(Dr(a,o),!St(a))o.push({severity:"error",code:"invalid-ga-inventory-segments",message:`GA area "${a.label}" has invalid joined-area inventory provenance`,objectId:a.id});else for(let h of rn(a))v.get(h)!==void 0?S.push({severity:"error",code:"duplicate-seat-label",message:`GA inventory label "${h}" is used more than once`,objectId:a.id}):v.set(h,a.id);if(tt(a.referenceInventorySource)||o.push({severity:"error",code:"invalid-reference-inventory-source",message:`GA area "${a.label}" has invalid reference-inventory provenance`,objectId:a.id}),!Mn(a.points)){o.push({severity:"error",code:"invalid-polygon-points",message:`GA area "${a.label}" outline must be a list of points`,objectId:a.id});continue}(!me(a.points)||Math.abs(xe(a.points))<=1e-7||Se(a.points))&&o.push({severity:"error",code:"invalid-ga-outline",message:`GA area "${a.label}" must have a finite, non-self-intersecting polygon outline`,objectId:a.id});let p=a.holes??[];if(!Cn(p))o.push({severity:"error",code:"invalid-hole-collection",message:`GA area "${a.label}" cutouts must be a list of point lists`,objectId:a.id});else{let h=p.length<=64?p.findIndex(x=>x.length>512||!me(x)||Math.abs(xe(x))<=1e-7||Se(x)?!0:!x.flatMap((P,C)=>{let R=x[(C+1)%x.length];return[P,{x:(P.x+R.x)/2,y:(P.y+R.y)/2}]}).every(P=>$e(P,a.points))):0;if(h>=0)o.push({severity:"error",code:"invalid-ga-hole",message:`GA area "${a.label}" has a cutout outside its outline or with invalid geometry`,objectId:a.id,holeIndex:h});else if(p.some((x,T)=>p.slice(T+1).some(P=>et(x,P)))){let x=p.findIndex((T,P)=>p.slice(P+1).some(C=>et(T,C)));o.push({severity:"error",code:"overlapping-ga-holes",message:`GA area "${a.label}" has overlapping cutout polygons`,objectId:a.id,holeIndex:x})}}i.has(a.categoryKey)?l.add(a.categoryKey):o.push({severity:"error",code:"unknown-category",message:`"${a.label}" references unknown category "${a.categoryKey}"`,objectId:a.id,categoryKey:a.categoryKey}),a.capacity<1&&o.push({severity:"error",code:"empty-ga",message:`GA area "${a.label}" has zero capacity`,objectId:a.id}),(!Number.isInteger(a.capacity)||a.capacity>he)&&o.push({severity:"error",code:"invalid-ga-capacity",message:`GA area "${a.label}" capacity must be a whole number from 1 to ${he}`,objectId:a.id}),E++,L+=Math.max(0,Math.floor(a.capacity))}else if(a.type==="section"){if(a.displayLabel!==void 0){let h=a.displayLabel.normalize("NFKC").trim();h?(h!==a.displayLabel||h.length>80)&&o.push({severity:"error",code:"invalid-display-label",message:`Section "${a.label}" must use a normalized buyer label of 1 to 80 characters`,objectId:a.id}):o.push({severity:"error",code:"unnamed-section",message:`${a.label} has no buyer name`,objectId:a.id})}if(a.editor?.defaultCategoryKey&&!i.has(a.editor.defaultCategoryKey)&&o.push({severity:"error",code:"unknown-category",message:`Section "${a.label}" references unknown future-seat category "${a.editor.defaultCategoryKey}"`,objectId:a.id}),a.elevation!==void 0&&(!Number.isInteger(a.elevation)||a.elevation<Xt||a.elevation>Ae)){let h=Number.isInteger(a.elevation)&&a.elevation>Ae&&a.elevation<=Yt;r.push({severity:"warning",code:h?"legacy-section-elevation":"invalid-section-elevation",message:h?`Section "${a.label}" uses legacy tier ${a.elevation}; set an exact height before normalizing it to tier ${Ae}`:`Section "${a.label}" elevation must be a whole-number tier from ${Xt} to ${Ae}`,objectId:a.id})}if(a.height!==void 0&&(!Number.isFinite(a.height)||a.height<ge||a.height>ue)&&o.push({severity:"error",code:"invalid-section-height",message:`Section "${a.label}" exact height must be between ${ge} and ${ue} metres`,objectId:a.id}),a.rake!==void 0&&(!Number.isFinite(a.rake)||a.rake<mt||a.rake>bt)&&o.push({severity:"error",code:"invalid-section-rake",message:`Section "${a.label}" rake must be between ${mt}\xB0 and ${bt}\xB0`,objectId:a.id}),a.surfaceKind!==void 0&&a.surfaceKind!=="flat"&&a.surfaceKind!=="rakedRows"&&o.push({severity:"error",code:"invalid-section-surface-kind",message:`Section "${a.label}" surfaceKind must be 'flat' or 'rakedRows'`,objectId:a.id}),!Mn(a.outline)){o.push({severity:"error",code:"invalid-polygon-points",message:`Section "${a.label}" outline must be a list of points`,objectId:a.id});continue}if(!me(a.outline)||Math.abs(xe(a.outline))<=1e-7||Se(a.outline)){o.push({severity:"error",code:"invalid-section-outline",message:`Section "${a.label}" must have a finite, non-self-intersecting polygon outline`,objectId:a.id});continue}if(a.outlinePath){let h=[];try{h=ut(a.outlinePath)}catch{}(!lt(a.outlinePath)||!h.length||Math.hypot(a.outlinePath.start.x-a.outline[0].x,a.outlinePath.start.y-a.outline[0].y)>1e-4||!me(h)||Math.abs(xe(h))<=1e-7||Se(h))&&o.push({severity:"error",code:"invalid-section-outline-path",message:`Section "${a.label}" has an invalid or inconsistent curved outline path`,objectId:a.id,edgeIndex:Ir(a)})}if(a.referenceSource&&(!/^ref_[0-9a-f-]{36}$/.test(a.referenceSource.assetId)||!/^(?:reg|ai)_[0-9a-f]{16}$/.test(a.referenceSource.regionId))&&o.push({severity:"error",code:"invalid-section-reference-source",message:`Section "${a.label}" has invalid opaque reference provenance`,objectId:a.id}),jr(a)||o.push({severity:"error",code:"invalid-section-inventory-exclusion",message:`Section "${a.label}" has incomplete or mismatched non-sellable evidence`,objectId:a.id}),a.logicalSectionId!==void 0&&!a.logicalSectionId.trim())o.push({severity:"error",code:"invalid-logical-section-id",message:`Section "${a.label}" has an empty logical section id`,objectId:a.id});else if(a.logicalSectionId){let h=JSON.stringify({displayLabel:a.displayLabel??null,entrance:a.entrance??null,viewFromSeatUrl:a.viewFromSeatUrl??null,viewFromSeatMeta:a.viewFromSeatMeta??null,confidenceEvidence:a.confidenceEvidence??null,zone:a.zone??null,labelStyle:a.labelPresentation?.labelStyle??null,labelVisible:a.labelPresentation?.visible!==!1}),x=A.get(a.logicalSectionId);x&&(x.label!==a.label||x.semanticSignature!==h)?o.push({severity:"error",code:"inconsistent-logical-section",message:`Logical section "${a.logicalSectionId}" must use one technical label and buyer-facing presentation across every component`,objectId:a.id}):x||A.set(a.logicalSectionId,{label:a.label,semanticSignature:h})}let _=a.holes??[];if(!Cn(_)){o.push({severity:"error",code:"invalid-hole-collection",message:`Section "${a.label}" openings must be a list of point lists`,objectId:a.id});continue}if(_.length>64){o.push({severity:"error",code:"invalid-section-hole",message:`Section "${a.label}" has an invalid opening collection`,objectId:a.id});continue}let p=-1;for(let h=0;h<_.length;h++){let x=_[h];if(x.length>512||!me(x)||Math.abs(xe(x))<=1e-7||Se(x)){p=h;break}if(!x.flatMap((P,C)=>{let R=x[(C+1)%x.length];return[P,{x:(P.x+R.x)/2,y:(P.y+R.y)/2}]}).every(P=>$e(P,a.outline))){p=h;break}}if(p>=0)o.push({severity:"error",code:"invalid-section-hole",message:`Section "${a.label}" has an opening outside its outline or with an invalid shape`,objectId:a.id,holeIndex:p});else if(_.some((h,x)=>_.slice(x+1).some(T=>et(h,T)))){let h=_.findIndex((x,T)=>_.slice(T+1).some(P=>et(x,P)));o.push({severity:"error",code:"overlapping-section-holes",message:`Section "${a.label}" has overlapping openings`,objectId:a.id,holeIndex:h})}}let O=e.floors?.length?e.floors.map(a=>a.objects):[e.objects];for(let a of O){let _=a.filter(p=>p.type==="section");for(let p of a.filter(h=>h.type==="text")){let h=p.iconKey;h!==void 0&&!Ot(h)&&o.push({severity:"error",code:"invalid-icon-key",message:`Venue icon "${p.text||p.id}" references an unknown symbol`,objectId:p.id});let x=p.fontFamily;x!==void 0&&(typeof x!="string"||x.normalize("NFKC").trim()!==x||x.length<1||x.length>120)&&o.push({severity:"error",code:"invalid-text-font-family",message:`Text "${p.text||p.id}" font family must contain 1 to 120 normalized characters`,objectId:p.id});let T=p.background;(p.width!==void 0&&(!Number.isFinite(p.width)||p.width<40||p.width>1200)||p.align!==void 0&&!["left","center","right"].includes(p.align)||p.lineHeight!==void 0&&(!Number.isFinite(p.lineHeight)||p.lineHeight<.8||p.lineHeight>3)||p.letterSpacing!==void 0&&(!Number.isFinite(p.letterSpacing)||p.letterSpacing<-2||p.letterSpacing>20)||p.opacity!==void 0&&(!Number.isFinite(p.opacity)||p.opacity<.1||p.opacity>1)||T!==void 0&&(!/^#[0-9a-f]{6}$/i.test(T.color)||T.padding!==void 0&&(!Number.isFinite(T.padding)||T.padding<0||T.padding>40)||T.cornerRadius!==void 0&&(!Number.isFinite(T.cornerRadius)||T.cornerRadius<0||T.cornerRadius>40)||T.opacity!==void 0&&(!Number.isFinite(T.opacity)||T.opacity<.1||T.opacity>1)))&&o.push({severity:"error",code:"invalid-text-layout",message:`Text "${p.text||p.id}" has invalid width, spacing, opacity, alignment, or background layout`,objectId:p.id})}for(let p of a.filter(h=>h.type==="shape")){if(p.eventConfigurationIds!==void 0){let T=p.eventConfigurationIds;Array.isArray(T)&&T.length>0&&T.length<=20&&T.every(C=>typeof C=="string"&&C.normalize("NFKC").trim()===C&&C.length>=1&&C.length<=100)&&new Set(T).size===T.length||o.push({severity:"error",code:"invalid-shape-configurations",message:`Shape "${p.label||p.id}" must reference 1 to 20 unique event configuration ids`,objectId:p.id})}if(p.heightM!==void 0&&(!Number.isFinite(p.heightM)||p.heightM<.05||p.heightM>50)&&o.push({severity:"error",code:"invalid-shape-height",message:`Shape "${p.label||p.id}" height must be between 0.05 m and 50 m`,objectId:p.id}),p.stroke!==void 0&&(!p.stroke||typeof p.stroke.color!="string"||!/^#[0-9a-f]{6}$/i.test(p.stroke.color)||!Number.isFinite(p.stroke.width)||p.stroke.width<.5||p.stroke.width>40)&&o.push({severity:"error",code:"invalid-shape-stroke",objectId:p.id,message:`Shape "${p.label||p.id}" stroke must use a six-digit colour and a width from ${wn(e,.5)} to ${wn(e,40)}`}),(p.lineCap!==void 0||p.lineJoin!==void 0||p.startEnding!==void 0||p.endEnding!==void 0)&&!yn(p.kind)?o.push({severity:"error",code:"invalid-shape-line-style-applicability",message:`Shape "${p.label||p.id}" may use line caps, joins, and end decorations only when it is an open line or polyline`,objectId:p.id}):yn(p.kind)&&(p.lineCap!==void 0&&!yr.includes(p.lineCap)||p.lineJoin!==void 0&&!xr.includes(p.lineJoin)||p.startEnding!==void 0&&!hn.includes(p.startEnding)||p.endEnding!==void 0&&!hn.includes(p.endEnding))&&o.push({severity:"error",code:"invalid-shape-line-style",message:`Shape "${p.label||p.id}" has an unsupported line cap, join, or ending`,objectId:p.id}),p.points!==void 0&&!Mn(p.points)){o.push({severity:"error",code:"invalid-polygon-points",message:`Shape "${p.label||p.id}" points must be a list of points`,objectId:p.id});continue}if(p.kind==="polygon"){let T=Jn(p.points??[]);if(!T.ok)o.push({severity:"error",code:"invalid-shape-polygon",message:`Shape "${p.label||p.id}" has invalid polygon geometry: ${T.message}`,objectId:p.id});else{let P=Gs(p);P&&o.push({severity:"error",code:"invalid-shape-outline",message:`Shape "${p.label||p.id}" ${P}`,objectId:p.id})}}else(p.edgeCurvature!==void 0||p.holes!==void 0)&&o.push({severity:"error",code:"invalid-shape-outline",message:`Shape "${p.label||p.id}" has curved sides or cut-outs, which only a custom outline can have`,objectId:p.id});let x=Mr(p);if(x){for(let T of _)if(wr(x,T.outline)){o.push({severity:"error",code:"reference-focal-overlaps-section",message:`Reference focal area "${p.label??p.id}" overlaps section "${T.label}"`,objectId:p.id});break}}}}L>n&&o.push({severity:"error",code:"inventory-capacity-exceeded",message:`Chart has ${L} bookable units; the maximum is ${n}`}),o.push(...S.slice(0,5)),S.length>5&&o.push({severity:"error",code:"duplicate-seat-label",message:`${S.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 a of qe(e)){let _=a.families[0]?.targets[0];r.push({severity:"warning",code:"category-inventory-family-conflict",message:mn(a),categoryKey:a.categoryKey,..._?{objectId:_.id,floorId:_.floorId}:{},relatedObjectIds:a.objectIds,categoryInventoryFamilies:a.families})}e.focalPoint||r.push({severity:"warning",code:"missing-focal-point",message:"Chart has no focal point set"}),E===0&&r.push({severity:"warning",code:"no-bookables",message:"Chart has no rows, tables, booths, or GA areas"});for(let a of l)if(u.get(a)===!1){let _=e.categories.find(p=>p.key===a);r.push({severity:"warning",code:"unpriced-category",message:`Category "${_?.label??a}" has no default price. Each event sets its price before it goes on sale`,categoryKey:a})}return[...o,...r]}function Gs(e){let t=e.points??[];if(e.edgeCurvature!==void 0&&(!Array.isArray(e.edgeCurvature)||e.edgeCurvature.length!==t.length||e.edgeCurvature.some(n=>typeof n!="number"||!Number.isFinite(n)||n<-100||n>100)))return"needs one side curve from -100 to 100 for each side";if(e.holes===void 0)return null;if(!Cn(e.holes)||e.holes.length>eo)return"has an invalid cut-out collection";for(let n=0;n<e.holes.length;n+=1){let o=e.holes[n];if(o.length<3||o.length>512||!me(o)||Math.abs(xe(o))<=1e-7||Se(o))return`has an invalid cut-out ${n+1}`;if(!to(e,o))return`has cut-out ${n+1} outside its outline`;for(let r=0;r<n;r+=1){let i=e.holes[r];if(oo(o,i))return`has cut-outs ${r+1} and ${n+1} overlapping`}}return null}var Vr=e=>!!("entrance"in e&&e.entrance?.trim()||"entranceGateId"in e&&e.entranceGateId);function Us(e){return e.type==="row"||e.type==="table"?e.seatCount:e.type==="booth"?1:e.type==="gaArea"?e.capacity??0:0}function Ks(e){let t=Ar(e).size,n=[];if(!t)return{gates:t,gaps:n,missingAreas:0,missingPlaces:0};let o=No(e);for(let r of ne(e)){let i=new Map;for(let l of r.objects){if(l.type!=="section")continue;let d=l.logicalSectionId??l.id;i.set(d,[...i.get(d)??[],l])}let s={floorId:r.id,selectIds:[],names:[],places:0},u=new Set;for(let l of r.objects){if(l.type!=="row"&&l.type!=="table"&&l.type!=="booth"&&l.type!=="gaArea"||Vr(l))continue;let d=o.get(l.id),c=d?i.get(d):void 0;if(!c?.some(Vr))if(s.places+=Us(l),c){if(u.has(d))continue;u.add(d),s.selectIds.push(...c.map(f=>f.id)),s.names.push(c[0].displayLabel??c[0].label)}else s.selectIds.push(l.id),s.names.push(l.label||l.id)}s.names.length&&n.push(s)}return{gates:t,gaps:n,missingAreas:n.reduce((r,i)=>r+i.names.length,0),missingPlaces:n.reduce((r,i)=>r+i.places,0)}}function Vs(e){let t=e.slice(0,3).map(o=>`\u201C${o}\u201D`),n=e.length-t.length;return n>0?`${t.join(", ")} and ${n} more`:t.join(t.length===2?" and ":", ")}function Hr(e,t){for(let n of Ks(e).gaps){let o=n.names.length;t.push({severity:"warning",code:"entrance-missing",dimension:"navigation",source:"quality",title:`${o} ${o===1?"area has":"areas have"} no entrance`,message:`Buyers in ${Vs(n.names)} are not told which gate to use.`,action:"Select them, then choose a gate for them in the Gate panel, or use Pick on the map there.",objectId:n.selectIds[0],relatedObjectIds:n.selectIds,floorId:n.floorId,autoFixable:!1})}}var Hs=.9;function zr(e){return(e??1)>=Hs}function zs(e,t){if(e.kind==="rect"||e.kind==="ellipse"){if(e.x==null||e.y==null||e.width==null||e.height==null)return!1;let n={x:e.x+e.width/2,y:e.y+e.height/2},o=ct({x:t.x-n.x,y:t.y-n.y},-(e.rotation??0)),r=e.width/2,i=e.height/2;return e.kind==="rect"?Math.abs(o.x)<=r&&Math.abs(o.y)<=i:r>0&&i>0&&(o.x/r)**2+(o.y/i)**2<=1}return e.kind==="polygon"&&!!e.points&&e.points.length>=3&&le(t,e.points)}function On(e,t,n,o){if(e.background?.color&&zr(e.background.opacity))return e.background.color;for(let r=n.length-1;r>=0;r--){let i=n[r];if(!(i.type!=="shape"||!i.fill||!zr(i.opacity))&&zs(i,t))return i.fill}return o}var Xs=9,qr="#f7f8fb",Ys="#f5f6f8",Qr="#8b93a7",Ws="#0b1220",Zs="#0b1220",qs="#ffffff",Qs=100,Pn=e=>e.semanticKind==="icon"&&Ot(e.iconKey);function D(e,t=2){let n=10**t;return Math.round(e*n)/n}function U(e){return{source:"quality",...e}}function Js(e){return e.code==="missing-focal-point"||e.code==="missing-zone-focal-point"?"navigation":"structure"}function En(e){return Xs*$o(e.theme?.seatScale)}function Jr(e){let t=[];for(let n of e.objects)n.type==="row"?t.push(...Q(n)):n.type==="table"&&t.push(...re(n));return t}function ec(e){let t={rowSeats:0,tableSeats:0,booths:0,gaCapacity:0};for(let n of e)for(let o of n.objects)o.type==="row"?t.rowSeats+=Q(o).length:o.type==="table"?t.tableSeats+=re(o).length:o.type==="booth"?t.booths+=1:o.type==="gaArea"&&(t.gaCapacity+=Math.max(0,Math.floor(o.capacity)));return{inventoryByKind:t,bookableUnits:t.rowSeats+t.tableSeats+t.booths+t.gaCapacity}}function z(e,t){e.filter(n=>n.code===t.code).length<Qs&&e.push(t)}function tc(e,t,n){let o=En(e),r=2*o,i=2.3*o,s=0,u=0,l=1/0;for(let d of t){let c=new Map(d.objects.filter(S=>S.type==="row").map(S=>[S.id,S])),f=S=>{let A=d.objects.find(y=>y.id===S);if(!A||A.type!=="row"&&A.type!=="table")return"another seating object";let E=A.type==="row"?Q(A):re(A),L=E.length?{x:E.reduce((y,w)=>y+w.x,0)/E.length,y:E.reduce((y,w)=>y+w.y,0)/E.length}:A.type==="row"?A.origin:A.center,I=d.objects.find(y=>y.type==="section"&&oe(L,y.outline,y.holes)),M=A.type==="row"?`Row \u201C${A.label}\u201D`:`Table \u201C${A.label}\u201D`;return I?.type==="section"?`${M} in \u201C${I.label}\u201D`:M},b=Jr(d);s+=b.length;let m=i,g=new Map,v=new Map;for(let S of b){let A=Math.floor(S.x/m),E=Math.floor(S.y/m);for(let M=-1;M<=1;M++)for(let y=-1;y<=1;y++){let w=g.get(`${A+M}:${E+y}`)??[];for(let k of w){u++;let O=Math.hypot(S.x-k.x,S.y-k.y);if(l=Math.min(l,O),O>=i)continue;let _=(S.rowId<k.rowId?[S.rowId,k.rowId]:[k.rowId,S.rowId]).join("|"),p=v.get(_);(!p||O<p.distance)&&v.set(_,{a:S,b:k,distance:O})}}let L=`${A}:${E}`,I=g.get(L)??[];I.push(S),g.set(L,I)}for(let S of v.values()){let A=S.a.rowId===S.b.rowId,E=c.get(S.a.rowId),L=c.get(S.b.rowId),I=!A&&E?.segmentedRow?.repeatLabelOnComponents===!0&&L?.segmentedRow?.repeatLabelOnComponents===!0&&E.segmentedRow.groupId===L.segmentedRow.groupId,M=!!E?.referenceScan&&!!L?.referenceScan&&E.referenceScan.assetId===L.referenceScan.assetId&&E.referenceScan.sectionId===L.referenceScan.sectionId,y=S.distance<r;if((I||M)&&!y)continue;let w=y?"seat-overlap":"seat-cramped",k=f(S.a.rowId),O=f(S.b.rowId),a=D(y?r:i);z(n,U({severity:"warning",code:w,dimension:"geometry",title:y?A?`${k} has overlapping seats`:`${k} and ${O} overlap`:A?`${k} has seats too close together`:`${k} and ${O} are too close together`,message:y?`The closest seats are ${Fe(e,S.distance)} apart, so their markers overlap on the buyer map; at least ${Fe(e,a)} keeps them apart.`:`The closest seats are ${Fe(e,S.distance)} apart; at least ${Fe(e,a)} is needed.`,action:A?`Increase the seat spacing for ${k}, or use Review safe fixes.`:`Move ${k} or ${O} until they no longer overlap.`,objectId:S.a.rowId,relatedObjectIds:A?[S.a.rowId]:[S.a.rowId,S.b.rowId],floorId:d.id,measured:D(S.distance),minimum:a,autoFixable:A}))}}return{seats:s,checkedSeatPairs:u,minimumSeatDistance:Number.isFinite(l)?D(l):null}}function ot(e){let{width:t,height:n}=Pn(e)?{width:e.fontSize,height:e.fontSize}:zn(e);if(!e.rotation)return{x:e.position.x,y:e.position.y,width:t,height:n};let o=[{x:0,y:0},{x:t,y:0},{x:t,y:n},{x:0,y:n}].map(r=>{let i=ct(r,e.rotation);return{x:e.position.x+i.x,y:e.position.y+i.y}});return Bo(o)}function ei(e){let t=ot(e);return{x:t.x+t.width/2,y:t.y+t.height/2}}function ti(e,t,n=0){return e.x<t.x+t.width+n&&e.x+e.width+n>t.x&&e.y<t.y+t.height+n&&e.y+e.height+n>t.y}function An(e,t,n){let o=ee(t.x,e.x,e.x+e.width),r=ee(t.y,e.y,e.y+e.height);return(t.x-o)**2+(t.y-r)**2<n**2}function nc(e,t,n){let o=En(e),r=0;for(let i of t){let s=i.objects.filter(l=>l.type==="text"),u=Jr(i);r+=s.length;for(let l=0;l<s.length;l++){let d=s[l],c=ot(d),f=u.find(b=>An(c,b,o));f&&z(n,U({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${d.text}\u201D overlaps seat ${f.label}`,objectId:d.id,relatedObjectIds:[d.id,f.rowId],floorId:i.id,autoFixable:!0}));for(let b=0;b<l;b++){let m=s[b];ti(c,ot(m),2)&&z(n,U({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${d.text}\u201D overlaps text \u201C${m.text}\u201D`,objectId:d.id,relatedObjectIds:[d.id,m.id],floorId:i.id,autoFixable:!0}))}}}return r}function oc(e,t){let n=!e.categoryKey.trim();if(e.type==="booth")return{places:n?1:0};if(e.type==="gaArea")return{places:n?Math.max(1,Math.floor(e.capacity)):0};if(e.type==="table"&&(e.bookAsWhole||e.variableOccupancy))return{places:n?e.seatCount:0};let o=new Map((e.overrides??[]).map(s=>[s.index,s])),r=[],i=0;for(let s=0;s<e.seatCount;s+=1){let u=o.get(s);if(u?.skip)continue;i+=1;let l=u?.categoryKey;(l===void 0?n:!l.trim()||!t.has(l))&&r.push(s)}return r.length?r.length===i?{places:i}:{places:r.length,seatIndices:r}:{places:0}}function kn(e){return e.normalize("NFKC").trim().toLowerCase().replace(/\s+/g," ")}function rc(e,t,n){let o=new Map,r=new Set(e.categories.map(l=>l.key));for(let l of t)for(let d of l.objects){let c=d.type,f=c==="row"||c==="table"||c==="booth"||c==="gaArea",b=f||c==="section",m=f?oc(d,r):null;if(f&&m&&m.places>0){let v=`${c==="gaArea"?"GA area":c==="row"?"Row":c==="table"?"Table":"Booth"} \u201C${d.label||d.id}\u201D`,S=c==="gaArea"?"place":c==="table"?"chair":c==="booth"?"booth":"seat",A=`${m.places} ${S}${m.places===1?"":"s"}`;z(n,U({severity:"warning",code:"object-uncategorized",dimension:"structure",title:m.seatIndices?`${v} has ${A} with no category`:`${v} has no category`,message:m.seatIndices?`${A} in ${v} have no category, so buyers see no price or colour for them.`:`${v} is not assigned to any category (${A}), so buyers see no price or colour for it.`,action:"Select it and pick a category on the Categories bar, or create one there first.",objectId:d.id,floorId:l.id,autoFixable:!1,...m.seatIndices?{seatIndices:m.seatIndices}:{}}))}if(b){let g=(d.type==="section"?d.displayLabel??d.label:d.label)??"";if(g.trim()){if(c==="table"||c==="booth"||c==="gaArea"){let v=kn(g),S=o.get(v);S&&S.raw!==g?z(n,U({severity:"warning",code:"duplicate-object-label-normalized",dimension:"labels",title:`\u201C${g}\u201D and \u201C${S.raw}\u201D read as the same label`,message:`Labels \u201C${g}\u201D and \u201C${S.raw}\u201D differ only by case, spacing, or accents, so buyers cannot tell them apart.`,action:"Make the two labels visibly distinct.",objectId:d.id,relatedObjectIds:[d.id,S.id],floorId:l.id,autoFixable:!1})):S||o.set(v,{id:d.id,raw:g})}}else{let v=c==="gaArea"?"A GA area":c==="section"?"A section":c==="row"?"A row":c==="table"?"A table":"A booth";z(n,U({severity:"warning",code:"object-unlabeled",dimension:"labels",title:`${v} has no label`,message:`${v} 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:d.id,floorId:l.id,autoFixable:!1}))}}}let i=[];for(let l of t){let d=l.objects.filter(c=>c.type==="row"||c.type==="table"||c.type==="booth"||c.type==="gaArea");for(let c of l.objects)if(!(c.type!=="section"||c.referenceInventoryExclusion||d.some(b=>oe(ce(b),c.outline,c.holes)))){if(c.referenceSource){i.push({id:c.id,floorId:l.id});continue}z(n,U({severity:"warning",code:"empty-section",dimension:"structure",title:`Section \u201C${c.displayLabel??c.label}\u201D is empty`,message:`Section \u201C${c.displayLabel??c.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:c.id,floorId:l.id,autoFixable:!1}))}}i.length&&z(n,U({severity:"warning",code:"empty-section",dimension:"structure",title:i.length===1?"1 traced section has no seating yet":`${i.length} traced sections have no seating yet`,message:`${i.length} section${i.length===1?"":"s"} traced from the reference image contain${i.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:i[0].id,relatedObjectIds:i.map(l=>l.id),floorId:i[0].floorId,autoFixable:!1}));let s=new Map,u=new Map;for(let l of t){let d=[];for(let c of l.objects)c.type!=="section"||c.outline.length<3||d.push({id:c.logicalSectionId??c.id,outline:c.outline,...c.holes?{holes:c.holes}:{},bounds:lc(c.outline)});for(let c of l.objects){if(c.type!=="row")continue;let f=(c.segmentedRow?.displayLabel??c.displayLabel??c.label??"").trim(),b=(c.displayType??"").trim(),m=f&&b&&kn(b)!=="row"?`${b} ${f}`:f,g="";if(d.length){let E=ce(c),L=d.find(I=>E.x>=I.bounds.minX&&E.x<=I.bounds.maxX&&E.y>=I.bounds.minY&&E.y<=I.bounds.maxY&&oe(E,I.outline,I.holes));L&&(g=L.id)}let v=`${l.id}\0${g}\0${kn(m)}`,S=c.segmentedRow?.groupId??c.id;if(!m){let E=`${l.id}\0${g}`,L=u.get(E);L?(L.ids.push(c.id),L.logical.set(S,[...L.logical.get(S)??[],c])):u.set(E,{ids:[c.id],logical:new Map([[S,[c]]]),floorId:l.id});continue}let A=s.get(v);A?(A.ids.push(c.id),A.logical.set(S,[...A.logical.get(S)??[],c])):s.set(v,{ids:[c.id],logical:new Map([[S,[c]]]),floorId:l.id,raw:m})}}for(let{ids:l,logical:d,floorId:c,raw:f}of s.values()){let b=d.size;b<2||Xr([...d.values()])&&z(n,U({severity:"warning",code:"duplicate-row-label",dimension:"labels",title:`${b} rows share the name \u201C${f}\u201D`,message:`${b} rows share the label \u201C${f}\u201D, so buyers cannot tell which row a seat belongs to.`,action:"Rename them so each row reads differently: for example the section or box each belongs to.",objectId:l[0],relatedObjectIds:l,floorId:c,autoFixable:!1}))}for(let{ids:l,logical:d,floorId:c}of u.values()){let f=d.size;f<2||Xr([...d.values()])&&z(n,U({severity:"warning",code:"unnamed-row-collision",dimension:"labels",title:`${f} rows have no name`,message:`${f} rows in the same area have no name and repeat each other\u2019s seat numbers, so buyers cannot tell which row a seat belongs to.`,action:"Give each of these rows a name, for example the box each belongs to, so a ticket can say which row a seat is in.",objectId:l[0],relatedObjectIds:l,floorId:c,autoFixable:!1}))}if(e.floors&&e.floors.length>1)for(let l of e.floors)l.objects.length===0&&z(n,U({severity:"warning",code:"unused-floor",dimension:"structure",title:`${Zr(l.name)} is empty`,message:`${Zr(l.name)} has nothing on it yet.`,action:"Add seating to this floor, copy the floor below, or remove it in Structure.",floorId:l.id,autoFixable:!1}))}var ic=5,ac=16;function sc(e,t,n){for(let o of t){let r=o.focalPoint??e.focalPoint;if(r)for(let i of o.objects){if(i.type!=="section"||i.outline.length<3)continue;let{rake:s}=Xe(i);if(s<ic)continue;let u=i.outline.map(b=>Math.hypot(b.x-r.x,b.y-r.y)),l=Math.max(...u);if(l<=0)continue;let d=(l-Math.min(...u))/l;if(s*d<=ac)continue;let f=i.displayLabel??i.label;z(n,U({severity:"warning",code:"section-rake-inconsistent",dimension:"geometry",title:`Section \u201C${f}\u201D is too deep for a single rake`,message:`Section \u201C${f}\u201D spans ${Math.round(d*100)}% of its distance to the stage at a ${Math.round(s)}\xB0 rake, so one rake can't represent its sightlines faithfully: 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:i.id,floorId:o.id,autoFixable:!1}))}}}function cc(e,t,n){let o=e.theme?.background??qr,r=Ys,i=new Map;for(let d of t)for(let c of d.objects){if(c.type!=="gaArea")continue;let f=i.get(c.categoryKey)??[];f.push({id:c.id,floorId:d.id}),i.set(c.categoryKey,f)}for(let d of e.categories){let c=te(d.color,o),f=te(d.color,r);if(c==null||f==null){z(n,U({severity:"error",code:"invalid-category-color",dimension:"contrast",message:`Category \u201C${d.label}\u201D does not use a supported hex color`,categoryKey:d.key}));continue}let b=Math.min(c,f);b<3&&z(n,U({severity:"warning",code:"category-contrast-low",dimension:"contrast",title:`Category \u201C${d.label}\u201D is hard to see`,message:`Its colour is too close to light or dark chart backgrounds (${D(b)}:1, needs 3:1). Pick a stronger colour.`,action:`Choose a lighter or darker color for \u201C${d.label}\u201D until this warning clears.`,categoryKey:d.key,measured:D(b),minimum:3,autoFixable:!1}));let m=i.get(d.key)??[];if(m.length){let g=pn(d.color,o,fn),v=pn(d.color,r,fn),S=Math.min(te(g,o)??0,te(v,r)??0);S<3&&z(n,U({severity:"warning",code:"ga-contrast-low",dimension:"contrast",title:`Standing areas in \u201C${d.label}\u201D are hard to see`,message:`Their pale fill is too close to the chart background (${D(S)}:1, needs 3:1). Pick a stronger colour for \u201C${d.label}\u201D.`,objectId:m[0].id,categoryKey:d.key,floorId:m[0].floorId,relatedObjectIds:m.map(A=>A.id),measured:D(S),minimum:3,autoFixable:!1}))}}for(let d=0;d<e.categories.length;d++)for(let c=0;c<d;c++){let f=e.categories[d],b=e.categories[c],m=Do(f.color,b.color);m!=null&&m<25&&z(n,U({severity:"warning",code:"category-colors-too-similar",dimension:"contrast",title:`\u201C${f.label}\u201D and \u201C${b.label}\u201D look too similar`,message:`Categories \u201C${f.label}\u201D and \u201C${b.label}\u201D are only \u0394E ${D(m)} apart; 25 is required`,action:"Pick a visibly different color for either category so buyers can tell them apart.",categoryKey:f.key,measured:D(m),minimum:25,autoFixable:!1}))}for(let d of t){let c=d.objects.filter(f=>f.type==="text");for(let f of c){if(Pn(f))continue;let b=f.color??e.theme?.textColor??Qr,m=On(f,ei(f),d.objects,o),g=te(b,m),v=f.fontSize>=18?3:4.5;if(g==null||g<v){let S=m===o?"the chart background":"what it sits on";z(n,U({severity:"warning",code:"text-contrast-low",dimension:"contrast",message:`Text \u201C${f.text}\u201D has ${D(g??0)}:1 contrast against ${S}; ${v}:1 is required`,objectId:f.id,floorId:d.id,measured:D(g??0),minimum:v,autoFixable:!0}))}}}if(e.theme?.selectionColor){let d=te(e.theme.selectionColor,o);(d==null||d<3)&&z(n,U({severity:"warning",code:"selection-contrast-low",dimension:"contrast",title:"The selection color is hard to see",message:`Selection rings have ${D(d??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:D(d??0),minimum:3,autoFixable:!1}))}if(e.theme?.textColor){let d=te(e.theme.textColor,o);(d==null||d<3)&&z(n,U({severity:"warning",code:"theme-text-contrast-low",dimension:"contrast",title:"The theme text color is hard to read",message:`Theme text has ${D(d??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:D(d??0),minimum:3,autoFixable:!1}))}let s=e.theme?.seatLabelColor??Ws,u=new Map,l=(d,c,f)=>{let b=u.get(d)??new Map,m=b.get(c)??[];m.push(f),b.set(c,m),u.set(d,b)};for(let d of t)for(let c of d.objects)if(c.type==="row")for(let f of Qe(c).keys())l(f,"seat",c.id);else if(c.type==="table")for(let f of Qe(c).keys())l(f,"table seat",c.id);else c.type==="booth"&&l(c.categoryKey,"booth",c.id);for(let d of e.categories){let c=u.get(d.key);if(c)for(let[f,b]of c){let m=f==="booth"?zo:Ho,g=Wo(Xo,600),v=Zo(d.color,s),S=te(v,d.color);(S==null||S<g)&&z(n,U({severity:"warning",code:"bookable-label-contrast-low",dimension:"contrast",message:`${f==="booth"?"Booth":f==="seat"?"Seat":"Table-seat"} labels use ${m}u type and have ${D(S??0)}:1 contrast on category \u201C${d.label}\u201D; ${g}:1 is required for small text`,objectId:b[0],relatedObjectIds:b,measured:D(S??0),minimum:g,autoFixable:!0}))}}}function Xr(e){if(e.length>24)return!0;let t=new Set;for(let n of e){let o=new Set;for(let r of n)for(let i of Q(r)){let s=i.label,u=s.lastIndexOf("-");o.add(u>=0?s.slice(u+1):s)}if(!o.size)return!0;for(let r of o)if(t.has(r))return!0;for(let r of o)t.add(r)}return!1}function lc(e){let t=1/0,n=1/0,o=-1/0,r=-1/0;for(let i of e)i.x<t&&(t=i.x),i.y<n&&(n=i.y),i.x>o&&(o=i.x),i.y>r&&(r=i.y);return{minX:t,minY:n,maxX:o,maxY:r}}var uc=2;function dc(e,t,n){let o=uc*(nt(e)??ze);for(let r of t){let i=[];for(let c of r.objects){if(c.type!=="row")continue;let f=Q(c);if(f.length<4)continue;let b=f.slice(1).map((g,v)=>Math.hypot(g.x-f[v].x,g.y-f[v].y)).sort((g,v)=>g-v),m=b[Math.floor(b.length/2)];m>o&&i.push({row:c,gap:m})}if(!i.length)continue;let s=i.reduce((c,f)=>f.gap>c.gap?f:c),u=r.objects.find(c=>c.type==="section"&&oe(ce(s.row),c.outline,c.holes)),l=`Row \u201C${s.row.label}\u201D${u?.type==="section"?` in \u201C${u.label}\u201D`:""}`,d=i.length===1?"1 row has":`${i.length} rows have`;n.push(U({severity:"warning",code:"seat-sparse",dimension:"geometry",title:i.length===1?`${l} has seats far apart`:`${i.length} rows have seats far apart`,message:`${d} seats more than ${Fe(e,o)} apart, up to ${Fe(e,s.gap)} in ${l}; seats in a row usually sit about half a metre apart.`,action:"Advice only: the chart can still be published. To tighten it, reduce these rows\u2019 seat spacing or give them more seats; in a Venue Spec, a smaller spreadDegrees, or leave it out so the fan fits its seats.",objectId:s.row.id,relatedObjectIds:i.map(c=>c.row.id),floorId:r.id,measured:D(s.gap),autoFixable:!1}))}}function fc(e,t){for(let n of e){let o=n.objects.filter(r=>r.type==="section");if(!(o.length<2))for(let r of n.objects){if(!(r.type==="row"||r.type==="table"||r.type==="booth"||r.type==="gaArea"))continue;let s=ce(r),u=o.filter(m=>oe(s,m.outline,m.holes)),l=new Map;for(let m of u){let g=m.logicalSectionId??m.id,v=l.get(g)??[];v.push(m),l.set(g,v)}if(l.size<2)continue;let d=[...l.values()],c=d.map(m=>`Section \u201C${m[0].displayLabel??m[0].label}\u201D`),f=c.length===2?c.join(" and "):`${c.slice(0,-1).join(", ")}, and ${c[c.length-1]}`,b=r.type==="gaArea"?"GA area":r.type==="row"?"Row":r.type==="table"?"Table":"Booth";z(t,U({severity:"warning",code:"ambiguous-section-ownership",dimension:"structure",title:`${b} \u201C${r.label}\u201D belongs to more than one section`,message:`${b} \u201C${r.label}\u201D has its center inside ${f}, 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,...d.flatMap(m=>m.map(g=>g.id))],floorId:n.id,autoFixable:!1}))}}}var pc={structure:20,geometry:30,contrast:25,labels:15,navigation:10},mc={"seat-overlap":15,"seat-cramped":4,"seat-sparse":6,"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 bc(e){let t={...pc};for(let r of e){let i=r.severity==="error"?10:2;t[r.dimension]=Math.max(0,t[r.dimension]-(mc[r.code]??i))}let n=Object.values(t).reduce((r,i)=>r+i,0),o=n>=95?"A":n>=85?"B":n>=70?"C":n>=55?"D":"F";return{overall:n,dimensions:t,errorFree:e.every(r=>r.severity!=="error"),grade:o}}var gc=new Set(["object-uncategorized"]);function Yr(e,t={}){let n=ne(e),o=Kr(e,{maxInventory:t.maxInventory}).filter(c=>c.code!=="missing-zone-focal-point"||t.requireExplicitZoneFocals).map(c=>{let f=c.objectId?n.find(g=>g.objects.some(v=>v.id===c.objectId))?.id:void 0,b=c.code==="category-inventory-family-conflict",m=b?e.categories.find(g=>g.key===c.categoryKey):void 0;return U({...c,...b?{severity:"error",title:`Category \u201C${m?.label??c.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."}:{},...t.requireExplicitZoneFocals&&c.code==="missing-zone-focal-point"?{severity:"error"}:{},...f?{floorId:f}:{},source:"structural",dimension:Js(c),autoFixable:b})}),r=tc(e,n,o),i=ec(n),s=nc(e,n,o);if(rc(e,n,o),dc(e,n,o),fc(n,o),sc(e,n,o),cc(e,n,o),Hr(e,o),n.reduce((c,f)=>c+f.objects.filter(b=>b.type==="row"||b.type==="table"||b.type==="booth"||b.type==="gaArea").length,0)===0){let c=new Set(["missing-focal-point","no-bookables"]);for(let f=o.length-1;f>=0;f--)c.has(o[f].code)&&o.splice(f,1)}if(t.requirePricedInventory)for(let c=0;c<o.length;c++)gc.has(o[c].code)&&(o[c]={...o[c],severity:"error"});let l=o.filter(c=>c.severity==="error"),d=o.filter(c=>c.severity==="warning");return{issues:o,errors:l,warnings:d,metrics:{floors:n.length,objects:n.reduce((c,f)=>c+f.objects.length,0),seats:r.seats,bookableUnits:i.bookableUnits,inventoryByKind:i.inventoryByKind,categories:e.categories.length,freeTextLabels:s,checkedSeatPairs:r.checkedSeatPairs,minimumSeatDistance:r.minimumSeatDistance},score:bc(o),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 hc(e,t){if(e.seatCount<2||e.seatSpacing>=t)return!1;let n=Ke(Q(e));e.seatSpacing=D(t,3);let o=Ke(Q(e));return e.origin.x=D(e.origin.x+n.x-o.x,3),e.origin.y=D(e.origin.y+n.y-o.y,3),!0}function yc(e,t){if(e.seatCount<2)return!1;let n=!1;if(e.shape==="round"){let o=ee(e.seatArc??360,0,360),r=(o>=360?360/e.seatCount:o/(e.seatCount-1))*Math.PI/180;if(r>0){let i=t/(2*Math.sin(r/2)),s=Math.max(1,i-16);(e.radius??40)<s&&(e.radius=D(s,3),n=!0)}}else{let o=We(e),r=Math.max(o.top,o.bottom),i=Math.max(o.left,o.right);r>1&&(e.width??80)/r<t&&(e.width=D(r*t,3),n=!0),i>1&&(e.height??50)/i<t&&(e.height=D(i*t,3),n=!0)}return n}function xc(e){return[Zs,qs].map(n=>({color:n,minimum:Math.min(...e.map(o=>te(n,o)??0))})).sort((n,o)=>o.minimum-n.minimum)[0].color}function Wr(e,t,n){let o=ot(e),r=0;for(let i of t)i.type==="row"?r+=Q(i).filter(s=>An(o,s,n)).length:i.type==="table"?r+=re(i).filter(s=>An(o,s,n)).length:i.type==="text"&&i.id!==e.id&&ti(o,ot(i),2)&&r++;return r}function vc(e,t,n){if(Wr(e,t,n)===0)return!1;let r={...e.position},i=Math.max(12,e.fontSize*1.25),s=[[0,-1],[1,0],[0,1],[-1,0],[1,-1],[1,1],[-1,1],[-1,-1]];for(let u=1;u<=12;u++)for(let[l,d]of s)if(e.position={x:D(r.x+l*i*u,3),y:D(r.y+d*i*u,3)},Wr(e,t,n)===0)return!0;return e.position=r,!1}function ni(e,t={}){let n=JSON.parse(JSON.stringify(e)),o=Yr(n,t),r=[],i=bn(n);if(i.changed){n=i.doc;for(let f of i.changes){let b=i.before.find(g=>g.categoryKey===f.categoryKey),m=b?.families.map(g=>g.label).join(", ")??"inventory families";r.push({code:"category-inventory-family-conflict",objectId:b?.objectIds[0],message:`Split category \u201C${f.categoryLabel}\u201D across ${m}; preserved its commercial metadata and reassigned ${f.reassignments.length} affected object${f.reassignments.length===1?"":"s"}`})}}let s=En(n),u=2.5*s,l=ne(n);for(let f of l)for(let b of f.objects)if(b.type==="row"){let m=b.seatSpacing;hc(b,u)&&r.push({code:m<2*s?"seat-overlap":"seat-cramped",objectId:b.id,message:`Expanded ${b.id} to the ${D(u)}u target pitch while preserving its centre`})}else b.type==="table"&&yc(b,u)&&r.push({code:"seat-cramped",objectId:b.id,message:`Expanded ${b.id} so its perimeter seats meet the ${D(u)}u target pitch`});for(let f of l){let b=f.objects.filter(m=>m.type==="text");for(let m of b)vc(m,f.objects,s)&&r.push({code:"label-collision",objectId:m.id,message:`Moved ${m.id} to the nearest collision-free deterministic label position`})}let d=n.theme?.background??qr;for(let f of l)for(let b of f.objects){if(b.type!=="text"||Pn(b))continue;let m=b.color??n.theme?.textColor??Qr,g=b.fontSize>=18?3:4.5,v=On(b,ei(b),f.objects,d);(te(m,v)??0)<g&&(b.color=xc([v]),r.push({code:"text-contrast-low",objectId:b.id,message:`Changed ${b.id} to the highest-contrast black/white ink`}))}n.floors?.length&&(n.objects=n.floors[0].objects);let c=Yr(n,t);return{doc:n,changed:r.length>0,fixes:r,before:o,after:c}}function Zr(e){let t=e.trim();return/^\d+( copy)?$/.test(t)?`Floor ${t}`:`\u201C${t}\u201D`}function Fe(e,t){return At(t/(nt(e)??ze),Pt(e))}function Et(e){return e.floors?.length?e.floors.flatMap(t=>t.objects):e.objects}function Rn(e){return Et(e).reduce((t,n)=>n.type==="row"?t+xt(n):n.type==="table"?t+Ro(n):n.type==="gaArea"?t+Math.max(0,Math.floor(n.capacity)):n.type==="booth"?t+1:t,0)}function Sc(e){let t={};for(let o of e.categories??[])t[o.key]=0;let n=(o,r)=>{r>0&&(t[o]=(t[o]??0)+r)};for(let o of Et(e))if(o.type==="row")for(let r of Q(o))n(r.categoryKey,1);else if(o.type==="table")if(o.bookAsWhole||o.variableOccupancy)n(o.categoryKey,Math.max(0,Math.round(o.seatCount)));else for(let r of re(o))n(r.categoryKey,1);else o.type==="gaArea"?n(o.categoryKey,Math.max(0,Math.floor(o.capacity))):o.type==="booth"&&n(o.categoryKey,1);return t}function ri(e){if(!e.template)return null;let t=Et(e),n=t.filter(l=>l.type==="row"||l.type==="table"||l.type==="gaArea");if(!n.length)return null;let r=t.filter(l=>l.type==="booth").length+n.reduce((l,d)=>l+(d.type==="table"?2:1),0),i=Rn(e),s=Math.max(r+1,Math.min(5e4,i*4)),u=[.5,1,1.5,2].map(l=>ee(Math.round(i*l),r,s));return{family:e.template.family,display:e.template.family.replace(/-/g," ").replace(/\b\w/g,l=>l.toUpperCase()),min:r,max:s,presets:["S","M","L","XL"].map((l,d)=>({size:l,seats:u[d]}))}}function oi(e){let t=Q(e);return t.length?Ke(t):{...e.origin}}function Ic(e,t){let n=ri(e);if(!n)return structuredClone(e);let o=structuredClone(e),r=Et(o),i=r.filter(m=>m.type==="row"||m.type==="table"||m.type==="gaArea"),s=r.filter(m=>m.type==="booth").length,u=Math.max(n.min,Math.min(n.max,Math.round(t))),l=u-s,d=i.map((m,g)=>{let v=m.type==="gaArea"?Math.max(0,Math.floor(m.capacity)):m.seatCount,S=m.type==="table"?2:1;return{object:m,index:g,current:v,minimum:S,value:S,fraction:0}}),c=d.reduce((m,g)=>m+g.minimum,0),f=Math.max(0,l-c),b=d.reduce((m,g)=>m+Math.max(1,g.current-g.minimum),0);for(let m of d){let g=f*Math.max(1,m.current-m.minimum)/b,v=Math.floor(g);m.value+=v,m.fraction=g-v}f=l-d.reduce((m,g)=>m+g.value,0),d.sort((m,g)=>g.fraction-m.fraction||m.index-g.index);for(let m=0;m<f;m++)d[m%d.length].value++;d.sort((m,g)=>m.index-g.index);for(let m of d)if(m.object.type==="row"){let g=oi(m.object);m.object.seatCount=m.value;let v=oi(m.object);m.object.origin.x+=g.x-v.x,m.object.origin.y+=g.y-v.y}else if(m.object.type==="table"){let g=m.object;if(g.seatCountsBySide){let v=["top","bottom","left","right"],S=We(g),A=v.reduce((I,M)=>I+S[M],0)||1,E=v.map((I,M)=>{let y=m.value*S[I]/A;return{side:I,index:M,value:Math.floor(y),fraction:y-Math.floor(y)}}),L=m.value-E.reduce((I,M)=>I+M.value,0);E.sort((I,M)=>M.fraction-I.fraction||I.index-M.index);for(let I=0;I<L;I++)E[I%E.length].value+=1;E.sort((I,M)=>I.index-M.index),g.seatCountsBySide={top:E[0].value,bottom:E[1].value,left:E[2].value,right:E[3].value},g.sides=v.filter(I=>g.seatCountsBySide[I]>0)}g.seatCount=m.value,g.overrides&&(g.overrides=g.overrides.filter(v=>v.index<m.value),g.overrides.length||delete g.overrides)}else{let g=m.object;g.capacity=fe(g)?Math.min(m.value,ye):m.value,g.variableOccupancy&&(g.maxOccupancy=Math.min(g.maxOccupancy??g.capacity,g.capacity),g.minOccupancy=Math.min(g.minOccupancy??1,g.maxOccupancy)),g.wheelchairPlaces&&(g.wheelchairPlaces=Math.min(g.wheelchairPlaces,g.capacity))}return o.floors?.length&&(o.objects=o.floors[0].objects),o.template={family:o.template.family,targetSeats:u},o=ni(o).doc,o.template={family:e.template.family,targetSeats:Rn(o)},o}function De(e){let t=Number(e.slice(e.lastIndexOf(":")+1));return Number.isFinite(t)?t:-1}function wc(e,t,n){let o=new Map;for(let s of e){if(s.kind==="booth")continue;let u=o.get(s.rowId);u?u.push(s):o.set(s.rowId,[s])}let r=s=>n.has(s.id)||t(s.id)!=="free",i=[];for(let s of o.values())if(!(s.length<3)){s.sort((u,l)=>De(u.id)-De(l.id));for(let u=1;u<s.length-1;u++){let l=s[u];if(r(l))continue;let d=s[u-1],c=s[u+1];De(l.id)-De(d.id)!==1||De(c.id)-De(l.id)!==1||!r(d)||!r(c)||!n.has(d.id)&&!n.has(c.id)||i.push(l)}}return i}var Tn=1,_n=100;function ii(e,t){if(!Number.isInteger(t)||t<Tn||t>_n)return null;let n=e.rotation*Math.PI/180,o={x:Math.cos(n),y:Math.sin(n)},r={x:-o.y,y:o.x};return Array.from({length:t},(i,s)=>{let u=e.style==="intertwined"&&s%2===1?e.seatSpacing/2:0;return{type:"row",id:`__block_preview_${s}`,label:"",origin:{x:e.origin.x+r.x*s*e.rowGap+o.x*u,y:e.origin.y+r.y*s*e.rowGap+o.y*u},rotation:e.rotation,curve:e.curve,seatCount:e.seatsPerRow,seatSpacing:e.seatSpacing,categoryKey:"__preview__"}})}function Ln(e,t=e.rowCount){let n=ii(e,t);return n?.length?ce(n[n.length-1]):null}function Mc(e,t){if(!Number.isFinite(t.x)||!Number.isFinite(t.y)||e.rowGap<=0)return null;let n=Ln(e,1);if(!n)return null;let o=e.rotation*Math.PI/180,r={x:-Math.sin(o),y:Math.cos(o)},i=(t.x-n.x)*r.x+(t.y-n.y)*r.y,s=Math.max(Tn,Math.min(_n,Math.round(i/e.rowGap)+1)),u=Ln(e,s);return u?{rowCount:s,edgePoint:u}:null}function Cc(e,t){return e.length!==t.rowCount?!1:[...e].sort((o,r)=>(o.rowBlockGeneration?.rowIndex??1/0)-(r.rowBlockGeneration?.rowIndex??1/0)).every((o,r)=>{let i=o.rowBlockGeneration;return i?.kind==="row-block-v1"&&i.groupId===t.groupId&&i.rowIndex===r&&i.signature===t.signature&&JSON.stringify(i)===JSON.stringify({...t,rowIndex:r})})}function ai(e){let t=(e%360+360)%360,n=t>=180?t-360:t;return Object.is(n,-0)||Math.abs(n)<1e-9?0:n}var Ie=1,we=300,jn=330;function rt(e){return e.seatCount>1?e.curve/(e.seatCount-1):0}function si(e,t){let n=e.rotation*Math.PI/180,o=rt(e)*Math.PI/180,r,i;if(Math.abs(o)<1e-9)r=t*e.seatSpacing,i=0;else{let s=e.seatSpacing/(2*Math.sin(Math.abs(o)/2)),u=o*t;r=s*Math.sin(u),i=-s+s*Math.cos(u)}return{x:e.origin.x+r*Math.cos(n)-i*Math.sin(n),y:e.origin.y+r*Math.sin(n)+i*Math.cos(n)}}function Oc(e,t,n){let o=(e??[]).map(r=>({...r,index:r.index+t})).filter(r=>r.index>=0&&r.index<n);return o.length?o:void 0}function ci(e,t){if(e.path||!Number.isInteger(t)||t<Ie||t>we)return null;let n=rt(e);return{...e,seatCount:t,curve:n*(t-1)}}function li(e,t){if(e.path||!Number.isInteger(t)||t<Ie||t>we)return null;let n=rt(e),o=e.seatCount-t,r=-o;return{...e,origin:si(e,o),rotation:ai(e.rotation-n*o),seatCount:t,curve:n*(t-1),overrides:Oc(e.overrides,r,t)}}function ui(e,t=e.seatCount){let n=ci(e,t);return n?si(n,t-1):null}function di(e,t=e.seatCount){return li(e,t)?.origin??null}function kc(e,t){if(e.path||!Number.isFinite(t.x)||!Number.isFinite(t.y))return null;let n=rt(e),o=Math.abs(n)<1e-9?we:Math.min(we,Math.floor(jn/Math.abs(n))+1),r=null;for(let i=Ie;i<=Math.max(Ie,o);i+=1){let s=ui(e,i);if(!s)continue;let u=Math.hypot(s.x-t.x,s.y-t.y),l=n*(i-1);(!r||u<r.distance||u===r.distance&&i<r.seatCount)&&(r={seatCount:i,curve:l,endpoint:s,distance:u})}return r}function Ac(e,t){if(e.path||!Number.isFinite(t.x)||!Number.isFinite(t.y))return null;let n=rt(e),o=Math.abs(n)<1e-9?we:Math.min(we,Math.floor(jn/Math.abs(n))+1),r=null;for(let i=Ie;i<=Math.max(Ie,o);i+=1){let s=di(e,i);if(!s)continue;let u=Math.hypot(s.x-t.x,s.y-t.y),l=n*(i-1);(!r||u<r.distance||u===r.distance&&i<r.seatCount)&&(r={seatCount:i,curve:l,endpoint:s,distance:u})}return r}var Be=class extends Error{constructor(n,o){super(o);this.objectId=n;this.name="GroupedTableProjectionError"}};function Pc(e){let t=e.minOccupancy,n=e.maxOccupancy;if(!Number.isInteger(t)||!Number.isInteger(n)||t<1||n<t||n>e.seatCount)throw new Be(e.id,`Table "${e.label}" has invalid variable-occupancy bounds`);return{min:t,max:n}}function Ec(e,t){if(t!==2)return[];let n=[];for(let o of Ze(e)){if(o.type!=="table"||!o.bookAsWhole&&!o.variableOccupancy)continue;if(o.bookAsWhole&&o.variableOccupancy)throw new Be(o.id,`Table "${o.label}" cannot be whole-table and variable-occupancy inventory`);if(!Number.isInteger(o.seatCount)||o.seatCount<1||!o.label.trim())throw new Be(o.id,"Grouped tables require a label and at least one chair");let r=o.variableOccupancy?"variable":"whole",i=r==="variable"?Pc(o):{min:o.seatCount,max:o.seatCount};n.push({objectId:o.id,label:o.label,...o.displayLabel?{displayLabel:o.displayLabel}:{},...o.displayType?{displayType:o.displayType}:{},categoryKey:o.categoryKey,mode:r,capacity:o.seatCount,minOccupancy:i.min,maxOccupancy:i.max,chairs:re(o)})}return n}function pi(e){return Array.isArray(e.objects)}function mi(e,t){if(t.seatsByLabel)return t.seatsByLabel;if(!pi(e))throw new Error("ticketRestrictions: a categories-only chart document requires options.seatsByLabel");return new Map(To(e,{resolveEyeHeights:!1}).map(n=>[n.label,n]))}function bi(e){return{code:"ticket_option_not_applicable",labels:e,message:"That ticket choice is not available for the selected seat."}}function Rt(e,t){let n=e.applicability;return n?!(n.seatLabels?.length&&!n.seatLabels.includes(t.label)||n.accessibility?.length&&!n.accessibility.some(o=>t.accessibility?.includes(o))):!0}function Rc(e,t){return(e.categories.find(n=>n.key===t.categoryKey)?.tiers??[]).filter(n=>Rt(n,t))}function Nn(e,t,n){let o=e.categories.find(i=>i.key===t.categoryKey)?.tiers;if(!o?.length)return{kind:"none"};let r=n==null?o.find(i=>Rt(i,t)):o.find(i=>i.id===n&&Rt(i,t));return r?{kind:"resolved",tier:r}:{kind:"invalid"}}function Lc(e,t){return(e.logicalRowId??e.rowId)===(t.logicalRowId??t.rowId)}function fi(e){if(Number.isInteger(e.logicalSeatIndex))return e.logicalSeatIndex;let t=e.id.slice(e.id.lastIndexOf(":")+1),n=Number(t);return Number.isInteger(n)?n:void 0}function Tc(e,t){if(!Lc(e,t))return!1;let n=fi(e),o=fi(t);return n!=null&&o!=null&&Math.abs(n-o)===1}function gi(e,t,n={}){if(!t.length)return null;let o=mi(e,n),r=t.flatMap(u=>{let l=o.get(u.label);return l?[{selection:u,seat:l}]:[]}),i=r.map(({seat:u})=>u).filter(u=>u.accessibility?.includes("wheelchair")),s=[];for(let{selection:u,seat:l}of r){let d=Nn(e,l,u.tierId),c=d.kind==="resolved"?d.tier:void 0;(l.accessibility?.includes("companion")||c?.restriction==="companion")&&!i.some(b=>b.id!==l.id&&Tc(l,b))&&s.push(l.label)}return s.length?{code:"companion_pair_required",labels:s,message:"Select the adjacent wheelchair place with each companion ticket."}:null}function _c(e,t,n={}){if(!t.length)return null;let o=mi(e,n),r=new Set(e.categories.filter(u=>u.notForSale).map(u=>u.key)),i=[],s=[];for(let u of t){let l=o.get(u.label);if(!l)continue;if(r.has(l.categoryKey)){i.push(l.label);continue}Nn(e,l,u.tierId).kind==="invalid"&&s.push(l.label)}return i.length?{code:"not_for_sale",labels:i,message:"These seats are not for sale."}:s.length?bi(s):gi(e,t,{seatsByLabel:o})}0&&(module.exports={CATEGORY_INVENTORY_FAMILIES,DEFAULT_EVENT_INVENTORY_LIMIT,GA_UNIT_LABEL_PREFIX,GroupedTableProjectionError,LARGE_VENUE_INVENTORY_MODULE,MAX_DIRECT_ROW_SWEEP,MAX_EVENT_INVENTORY,MAX_GA_CAPACITY,MAX_ONE_PARTY_GUESTS,MAX_ROW_BLOCK_ROWS,MAX_ROW_SEATS,MIN_ROW_BLOCK_ROWS,MIN_ROW_SEATS,ONE_PARTY_LIMIT_MESSAGE,applicableTicketTiers,behindStageLabels,capacityControl,categoryCapacity,chartCapacity,companionSelectionIssue,describeCategoryInventoryConflict,effectiveSeatOwnerCategoryCounts,eventInventoryLimitFor,gaAreasOf,gaBoxBounds,gaBoxMode,gaInventorySegments,gaUnitLabel,gaUnitLabels,gaUnitLabelsForModel,gaWheelchairPlaceCount,gaWheelchairUnitLabels,groupedTableInventory,growJoinedGAInventory,inspectCategoryInventoryConflicts,intactRowBlockMembers,isFullChartDoc,isGaUnitLabel,pickBestAvailable,pickBestAvailableInventory,remediateCategoryInventoryConflicts,resizeChartCapacity,resolveRowBlockCount,resolveRowStartCapacity,resolveRowTerminalCapacity,resolveTicketTierForSeat,rowBlockEdgePoint,rowBlockPreviewRows,rowStartEndpoint,rowTerminalEndpoint,rowWithStartCapacity,rowWithTerminalCapacity,strandedSingles,ticketOptionNotApplicableIssue,ticketSelectionIssue,ticketTierAppliesToSeat,validGAInventorySegments});
1
+ "use strict";var Nt=Object.defineProperty;var yi=Object.getOwnPropertyDescriptor;var xi=Object.getOwnPropertyNames;var vi=Object.prototype.hasOwnProperty;var Si=(e,t)=>{for(var n in t)Nt(e,n,{get:t[n],enumerable:!0})},Ii=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of xi(t))!vi.call(e,r)&&r!==n&&Nt(e,r,{get:()=>t[r],enumerable:!(o=yi(t,r))||o.enumerable});return e};var wi=e=>Ii(Nt({},"__esModule",{value:!0}),e);var $c={};Si($c,{CATEGORY_INVENTORY_FAMILIES:()=>It,DEFAULT_EVENT_INVENTORY_LIMIT:()=>gt,GA_UNIT_LABEL_PREFIX:()=>vt,GroupedTableProjectionError:()=>Be,LARGE_VENUE_INVENTORY_MODULE:()=>qt,MAX_DIRECT_ROW_SWEEP:()=>jn,MAX_EVENT_INVENTORY:()=>So,MAX_GA_CAPACITY:()=>he,MAX_ONE_PARTY_GUESTS:()=>ye,MAX_ROW_BLOCK_ROWS:()=>_n,MAX_ROW_SEATS:()=>we,MIN_ROW_BLOCK_ROWS:()=>Tn,MIN_ROW_SEATS:()=>Ie,ONE_PARTY_LIMIT_MESSAGE:()=>Ya,applicableTicketTiers:()=>Tc,behindStageLabels:()=>Kn,capacityControl:()=>ri,categoryCapacity:()=>wc,chartCapacity:()=>Rn,companionSelectionIssue:()=>gi,describeCategoryInventoryConflict:()=>mn,effectiveSeatOwnerCategoryCounts:()=>Qe,eventInventoryLimitFor:()=>Io,gaAreasOf:()=>Qa,gaBoxBounds:()=>Wa,gaBoxMode:()=>fe,gaInventorySegments:()=>on,gaUnitLabel:()=>_o,gaUnitLabels:()=>rn,gaUnitLabelsForModel:()=>an,gaWheelchairPlaceCount:()=>jo,gaWheelchairUnitLabels:()=>Za,groupedTableInventory:()=>Lc,growJoinedGAInventory:()=>qa,inspectCategoryInventoryConflicts:()=>qe,intactRowBlockMembers:()=>Oc,isFullChartDoc:()=>pi,isGaUnitLabel:()=>de,pickBestAvailable:()=>Vn,pickBestAvailableInventory:()=>Oi,remediateCategoryInventoryConflicts:()=>bn,resizeChartCapacity:()=>Mc,resolveRowBlockCount:()=>kc,resolveRowStartCapacity:()=>Pc,resolveRowTerminalCapacity:()=>Ec,resolveTicketTierForSeat:()=>Nn,rowBlockEdgePoint:()=>Ln,rowBlockPreviewRows:()=>ii,rowStartEndpoint:()=>di,rowTerminalEndpoint:()=>ui,rowWithStartCapacity:()=>li,rowWithTerminalCapacity:()=>ci,strandedSingles:()=>Cc,ticketOptionNotApplicableIssue:()=>bi,ticketSelectionIssue:()=>Nc,ticketTierAppliesToSeat:()=>Rt,validGAInventorySegments:()=>St});module.exports=wi($c);function Gn(e){return e.sectionId?`s:${e.sectionId}`:`r:${e.logicalRowId??e.rowId}`}function Kn(e,t){let n=new Set,o=new Map;for(let r of e){let i=r.focalPoint??t,s=`${i.x},${i.y}`,u=o.get(s);u||(u={focal:i,seats:[]},o.set(s,u)),u.seats.push(r)}for(let{focal:r,seats:i}of o.values()){let s=Dt(i),u=s.x-r.x,l=s.y-r.y,d=Math.hypot(u,l),c=0;for(let v of i)c=Math.max(c,Math.abs(v.x-r.x),Math.abs(v.y-r.y));let f=Math.max(c,1)*1e-6;if(!(d>f))continue;let b=0,m=new Set;for(let v of i)((v.x-r.x)*u+(v.y-r.y)*l)/d<-f&&(b+=1,m.add(Gn(v)));if(!m.size||b*10>i.length)continue;let g=i.filter(v=>m.has(Gn(v)));if(!(g.length*4>i.length))for(let v of g)n.add(v.label)}return n}function Ft(e,t){if(Number.isInteger(e.logicalSeatIndex))return e.logicalSeatIndex;let n=e.id.lastIndexOf(":");if(n<0)return t;let o=Number(e.id.slice(n+1));return Number.isFinite(o)?o:t}function Ue(e,t){let n=e.x-t.x,o=e.y-t.y;return n*n+o*o}function Dt(e){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 Mi(e,t){return e.find(n=>n.focalPoint)?.focalPoint??t}function $t(e){return e.commercial?.premium===!0}var Un=new WeakMap;function Ci(e){let t=Un.get(e);if(t&&t.length===e.length&&t.first===e[0]&&t.last===e[e.length-1])return t;let n=new Map;e.forEach((s,u)=>{let l=s.logicalRowId??s.rowId,d=n.get(l);d||(d=[],n.set(l,d)),d.push({seat:s,index:Ft(s,u),order:u})});let o=new Map([...n].map(([s,u])=>[s,Dt(u.map(l=>l.seat))])),r=[...n].map(([s,u])=>({rowId:s,slots:[...u].sort((l,d)=>l.index-d.index)})),i={length:e.length,first:e[0],last:e[e.length-1],rows:r,rowCentres:o,behind:new Map};return Un.set(e,i),i}function ki(e,t,n){let o=`${n.x},${n.y}`,r=e.behind.get(o);return r||(r=Kn(t,n),e.behind.set(o,r)),r}function Vn(e,t,n){let o=Math.floor(n.qty);if(!Number.isFinite(o)||o<=0)return{labels:[],reason:"sold_out"};let{categoryKey:r,zoneId:i,focal:s,preferPremium:u,preferNearest:l,preferredRowIds:d,accessibility:c,requireContiguous:f}=n,b=n.preferAisle&&n.aisleLabels?.size?n.aisleLabels:null,m=Ci(e),g=new Uint8Array(e.length),v=0;for(let C=0;C<e.length;C++){let R=e[C];t.has(R.label)&&(!r||R.categoryKey===r)&&(!i||R.zoneId===i)&&(!c||c.some(j=>R.accessibility?.includes(j)))&&(g[C]=1,v+=1)}if(v===0)return{labels:[],reason:"sold_out"};let S=!r&&!i&&!l?ki(m,e,s):new Set,{rowCentres:A}=m,P=(d??[]).map(C=>A.get(C)).filter(C=>!!C),L=C=>{let R=A.get(C);return!R||!P.length?0:Math.min(...P.map(j=>Ue(R,j)))},I=!1,M=[],y=0,w="",O=0,k=0,a=0,_=0,p=0,h=0,x=0;for(let{rowId:C,slots:R}of m.rows){let j=L(C),G=0;for(;G<R.length;){if(!g[R[G].order]){G++;continue}let Z=G;for(;Z<R.length&&g[R[Z].order]&&(Z===G||R[Z].index===R[Z-1].index+1);)Z++;let F=Z-G;for(let q=0;q+o<=F;q++){let Lt=q,hi=F-(q+o),Tt=Lt===1||hi===1?1:0,it=G+q,at=0,st=0,$n=!1,Fn=0,Dn=0,_t;for(let Me=it;Me<it+o;Me++){let be=R[Me].seat;u&&!$t(be)&&(at+=1),S.size&&S.has(be.label)&&(st+=1),b&&b.has(be.label)&&($n=!0),Fn+=be.x,Dn+=be.y,!_t&&be.focalPoint&&(_t=be.focalPoint)}let jt=b&&!$n?1:0,Ge=Ue({x:Fn/o,y:Dn/o},l?s:_t??s),Bn=R[it].index,ae;if(!I)ae=!0;else if(u&&at!==a)ae=at<a;else if(l&&j!==h)ae=j<h;else if(l&&Ge!==x)ae=Ge<x;else if(st!==_)ae=st<_;else if(jt!==p)ae=jt<p;else if(Tt!==k)ae=Tt<k;else if(Ge!==x)ae=Ge<x;else{let Me=C.localeCompare(w);ae=Me!==0?Me<0:Bn<O}ae&&(I=!0,M=R,y=it,w=C,O=Bn,k=Tt,a=at,_=st,p=jt,h=j,x=Ge)}G=Z}}if(I)return{labels:M.slice(y,y+o).map(C=>C.seat.label)};if(f)return{labels:[],reason:"not_enough_together"};if(v<o)return{labels:[],reason:"not_enough_together"};let T=[];for(let C=0;C<e.length;C++)g[C]&&T.push(e[C]);return{labels:T.map((C,R)=>({seat:C,i:R,rowD2:L(C.logicalRowId??C.rowId),d2:Ue(C,l?s:C.focalPoint??s)})).sort((C,R)=>{if(u){let F=$t(C.seat)?0:1,q=$t(R.seat)?0:1;if(F!==q)return F-q}if(l&&C.rowD2!==R.rowD2)return C.rowD2-R.rowD2;let j=S.has(C.seat.label)?1:0,G=S.has(R.seat.label)?1:0;if(j!==G)return j-G;if(b){let F=b.has(C.seat.label)?0:1,q=b.has(R.seat.label)?0:1;if(F!==q)return F-q}if(C.d2!==R.d2)return C.d2-R.d2;let Z=(C.seat.logicalRowId??C.seat.rowId).localeCompare(R.seat.logicalRowId??R.seat.rowId);return Z!==0?Z:Ft(C.seat,C.i)-Ft(R.seat,R.i)}).slice(0,o).map(C=>C.seat.label)}}function Oi(e,t,n,o){let r=Math.floor(o.qty),i=Vn(e,n,o),u=t.filter(f=>f.bookingMode==="whole"&&f.capacity===r&&n.has(f.label)&&(!o.categoryKey||f.categoryKey===o.categoryKey)&&(!o.zoneId||f.zoneId===o.zoneId)&&!o.accessibility).map(f=>({table:f,d2:Ue(f.center,o.preferNearest?o.focal:f.focalPoint??o.focal)})).sort((f,b)=>f.d2-b.d2||f.table.label.localeCompare(b.table.label))[0];if(!u)return i;if(!i.labels.length)return{labels:[u.table.label]};if(o.preferAisle&&o.aisleLabels&&i.labels.some(f=>o.aisleLabels.has(f)))return i;let l=new Map(e.map(f=>[f.label,f])),d=i.labels.map(f=>l.get(f)).filter(f=>!!f),c=d.length?Ue(Dt(d),Mi(d,o.focal)):Number.POSITIVE_INFINITY;return u.d2<c?{labels:[u.table.label]}:i}var Hn=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function Ai(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/Hn(e))),r=0;for(let i of n){if(!i.length){r+=1;continue}let s=0;for(let u of i.split(/\s+/)){let l=u.length;s&&s+1+l<=o?s+=1+l:(r+=Math.max(1,Math.ceil(l/o)),s=l%o)}}return Math.max(1,r)}function zn(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),o=Math.max(1,...n.map(u=>u.length))*Hn(e),r=e.width??o+t*2,i=Math.max(1,r-t*2),s=Ai(e,i);return{width:r,height:s*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:s,padding:t}}var Ei=Math.PI/180;function W(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Pi(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 ct(e,t){return Pi(e,{x:0,y:0},t*Ei)}function Bt(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Ke(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 Xn(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 Yn(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[Xn(e,.5)];let o=Array.from({length:n+1},(l,d)=>Xn(e,d/n)),r=new Float64Array(o.length);for(let l=1;l<o.length;l+=1){let d=o[l].x-o[l-1].x,c=o[l].y-o[l-1].y;r[l]=r[l-1]+Math.hypot(d,c)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let s=[],u=1;for(let l=0;l<t;l+=1){let d=i*l/(t-1);for(;u<r.length-1&&r[u]<d;)u+=1;let c=r[u-1],f=r[u],b=f===c?0:(d-c)/(f-c);s.push({x:o[u-1].x+(o[u].x-o[u-1].x)*b,y:o[u-1].y+(o[u].y-o[u-1].y)*b})}return s}function ee(e,t,n){return Math.max(t,Math.min(n,e))}function Ri(e){return ee(e,0,1)}function Wn(e){let t=Ri(e);return t*t*(3-2*t)}var Ce=Math.PI*2;function ke(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function Li(e,t,n){let o=t-e;if(n){for(;o<0;)o+=Ce;for(;o>=Ce;)o-=Ce}else{for(;o>0;)o-=Ce;for(;o<=-Ce;)o+=Ce}return o}function lt(e){if(e.version!==1||e.closed!==!0||!ke(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||!ke(n.end))return!1;if(n.kind==="line"){if(W(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!ke(n.control1)||!ke(n.control2)||W(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!ke(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(W(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(W(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||W(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return W(t,e.start)<=1e-4}function Ti(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 ut(e,t=2){if(!lt(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),u=Math.atan2(i.end.y-i.center.y,i.end.x-i.center.x),l=Li(s,u,i.clockwise),d=Math.max(2,Math.ceil(Math.abs(l)*i.radius/n));for(let c=1;c<=d;c+=1){let f=s+l*c/d;o.push({x:i.center.x+Math.cos(f)*i.radius,y:i.center.y+Math.sin(f)*i.radius})}}else{let s=W(r,i.control1)+W(i.control1,i.control2)+W(i.control2,i.end),u=Math.max(2,Math.ceil(s/n));for(let l=1;l<=u;l+=1)o.push(Ti(r,i,l/u))}r=i.end}return W(o[o.length-1],o[0])<=1e-4&&o.pop(),o}var _i=45,Gt=150,ji=60;function Ni(e){let t=_i/100;if(e<=t)return Gt;let n=Math.min(1,(e-t)/(1-t));return Gt-n*(Gt-ji)}var Zn=.5523;function qn(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function $i(e){let t=[],n=[];for(e.forEach((o,r)=>{ke(o)&&(t.length&&qn(t[t.length-1],o)||(t.push({x:o.x,y:o.y}),n.push(r)))});t.length>1&&qn(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}var Fi=.5,Di=4/3;function Bi(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,u=o/i,l=n*Di;return{kind:"bezier",control1:{x:e.x+o/3+s*l,y:e.y+r/3+u*l},control2:{x:e.x+o*2/3+s*l,y:e.y+r*2/3+u*l},end:{...t}}}function Qn(e,t){let{points:n,sourceIndex:o}=$i(e),r=n.length;if(r<3)return null;let i=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,s=t.edgeCurvature,u=new Array(r).fill(0);if(s?.length)for(let I=0;I<r;I+=1){let M=s[o[I]];u[I]=Number.isFinite(M)?Math.min(100,Math.max(-100,M))/100:0}let l=u.some(I=>Math.abs(I)>1e-6);if(i<=0&&!l)return null;let d=t.wideAngleThresholdDeg??Ni(i),c=[];for(let I=0;I<r;I+=1)c[I]=W(n[I],n[(I+1)%r]);let f=new Array(r).fill(0);for(let I=0;I<r;I+=1){let M=n[(I-1+r)%r],y=n[I],w=n[(I+1)%r],O={x:M.x-y.x,y:M.y-y.y},k={x:w.x-y.x,y:w.y-y.y},a=Math.hypot(O.x,O.y),_=Math.hypot(k.x,k.y);if(a<=1e-9||_<=1e-9)continue;let p=Math.min(1,Math.max(-1,(O.x*k.x+O.y*k.y)/(a*_))),h=Math.acos(p)*180/Math.PI;if(h<d)continue;let x=Wn((h-d)/(180-d));f[I]=i*x*.5*Math.min(a,_)}for(let I=0;I<r;I+=1){let M=(I+1)%r,y=f[I]+f[M];if(y>c[I]&&y>1e-9){let w=c[I]/y;f[I]*=w,f[M]*=w}}let b=new Array(r),m=new Array(r);for(let I=0;I<r;I+=1){let M=n[(I-1+r)%r],y=n[I],w=n[(I+1)%r];if(f[I]<=1e-6){b[I]={...y},m[I]={...y};continue}let O=W(y,M)||1,k=W(y,w)||1;b[I]={x:y.x+(M.x-y.x)/O*f[I],y:y.y+(M.y-y.y)/O*f[I]},m[I]={x:y.x+(w.x-y.x)/k*f[I],y:y.y+(w.y-y.y)/k*f[I]}}if(f.every(I=>I<=1e-6)&&!l)return null;let g=[],v={...m[0]},S=v,A=(I,M)=>{if(W(S,I)<=1e-9)return;let y=u[M];Math.abs(y)>1e-6?g.push(Bi(S,I,y*Fi*c[M])):g.push({kind:"line",end:{...I}}),S=I};for(let I=1;I<=r;I+=1){let M=I%r,y=n[M];A(b[M],(I-1)%r),f[M]>1e-6&&W(b[M],m[M])>1e-9&&(g.push({kind:"bezier",control1:Bt(b[M],y,Zn),control2:Bt(m[M],y,Zn),end:{...m[M]}}),S=m[M])}if(!g.length)return null;let P=g[g.length-1];W(P.end,v)>1e-9&&(P.kind==="line"?P.end={...v}:g.push({kind:"line",end:{...v}}));let L={version:1,closed:!0,start:v,segments:g};return lt(L)?L:null}function Gi(e,t){return Math.abs(e.x-t.x)<=1e-7&&Math.abs(e.y-t.y)<=1e-7}function Ve(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function dt(e,t,n){let o=Ve(t,n,e);return Math.abs(o)>1e-7?!1:e.x>=Math.min(t.x,n.x)-1e-7&&e.x<=Math.max(t.x,n.x)+1e-7&&e.y>=Math.min(t.y,n.y)-1e-7&&e.y<=Math.max(t.y,n.y)+1e-7}function Ui(e,t,n,o){let r=Ve(e,t,n),i=Ve(e,t,o),s=Ve(n,o,e),u=Ve(n,o,t);return(r>1e-7&&i<-1e-7||r<-1e-7&&i>1e-7)&&(s>1e-7&&u<-1e-7||s<-1e-7&&u>1e-7)?!0:Math.abs(r)<=1e-7&&dt(n,e,t)||Math.abs(i)<=1e-7&&dt(o,e,t)||Math.abs(s)<=1e-7&&dt(e,n,o)||Math.abs(u)<=1e-7&&dt(t,n,o)}function Ki(e){return e.reduce((t,n,o)=>{let r=e[(o+1)%e.length];return t+n.x*r.y-r.x*n.y},0)}function Vi(e){for(let t=0;t<e.length;t+=1){let n=(t+1)%e.length;for(let o=t+1;o<e.length;o+=1){let r=(o+1)%e.length;if(!(t===o||n===o||r===t)&&Ui(e[t],e[n],e[o],e[r]))return!0}}return!1}function Jn(e){return e.length<3?{ok:!1,code:"too_few_vertices",message:"Add at least three vertices to create a polygon."}:e.length>256?{ok:!1,code:"too_many_vertices",message:"A polygon can contain at most 256 vertices."}:e.some(t=>!Number.isFinite(t.x)||!Number.isFinite(t.y)||Math.abs(t.x)>1e7||Math.abs(t.y)>1e7)?{ok:!1,code:"invalid_coordinate",message:"Every polygon vertex must use a finite coordinate inside the safe chart range."}:e.some((t,n)=>Gi(t,e[(n+1)%e.length]))?{ok:!1,code:"duplicate_vertex",message:"Move or remove duplicate neighbouring vertices."}:Math.abs(Ki(e))<2?{ok:!1,code:"degenerate_polygon",message:"The polygon needs a visible enclosed area."}:Vi(e)?{ok:!1,code:"self_intersection",message:"Polygon edges cannot cross or touch each other."}:{ok:!0}}var eo=64;function Hi(e){let t=e.points??[];if(e.kind!=="polygon"||t.length<3||!Array.isArray(e.edgeCurvature))return[];let n=t.map((o,r)=>{let i=e.edgeCurvature[r];return Number.isFinite(i)?Math.min(100,Math.max(-100,i)):0});return n.some(o=>Math.abs(o)>.5)?n:[]}function zi(e){let t=Hi(e);return t.length?Qn(e.points,{edgeCurvature:t}):null}function Ut(e,t=2){let n=zi(e);return n?ut(n,t):e.points??[]}function to(e,t){let n=Ut(e);return n.length<3||t.length<3||!t.flatMap((r,i)=>{let s=t[(i+1)%t.length];return[r,{x:(r.x+s.x)/2,y:(r.y+s.y)/2}]}).every(r=>le(r,n)||Kt(r,n))?!1:!t.some((r,i)=>{let s=t[(i+1)%t.length];return n.some((u,l)=>no(r,s,u,n[(l+1)%n.length]))})}function no(e,t,n,o){let r=(d,c,f)=>(c.x-d.x)*(f.y-d.y)-(c.y-d.y)*(f.x-d.x),i=r(e,t,n),s=r(e,t,o),u=r(n,o,e),l=r(n,o,t);return i*s<-1e-9&&u*l<-1e-9}function oo(e,t){return le(e[0],t)||le(t[0],e)?!0:e.some((n,o)=>{let r=e[(o+1)%e.length];return t.some((i,s)=>no(n,r,i,t[(s+1)%t.length]))})}function ro(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((b,m)=>b.segmentedRow.componentIndex-m.segmentedRow.componentIndex),s=i[0]?.segmentedRow?.componentCount??0,u=i[0]?.segmentedRow;if(!u||!(s>=2&&i.length===s&&u?.boundaryBefore==="start"&&i.every((b,m)=>b.segmentedRow?.kind==="segmented-row-v1"&&b.segmentedRow.groupId===o&&b.segmentedRow.componentCount===s&&b.segmentedRow.componentIndex===m&&b.segmentedRow.repeatLabelOnComponents===u.repeatLabelOnComponents&&(m===0?b.segmentedRow.boundaryBefore==="start":b.segmentedRow.boundaryBefore!=="start")&&b.segmentedRow.displayLabel===u.displayLabel)))continue;let d=i.reduce((b,m)=>b+m.seatCount,0),c=0,f=0;for(let b of i)b.segmentedRow.boundaryBefore==="break"&&(c+=1),t.set(b.id,{groupId:o,adjacencyOffset:c,displayOffset:f,displayLabel:u.displayLabel,totalSeats:d,canonical:i[0],viewFromSeatUrl:u.viewFromSeatUrl,viewFromSeatMeta:u.viewFromSeatMeta,confidenceEvidence:u.confidenceEvidence}),c+=b.seatCount,f+=b.seatCount}return t}var Xi="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var Yi="abcdefghijklmnopqrstuvwxyz";function Wi(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 He(e,t=!1){let n=t?Yi:Xi;return Wi(Math.max(0,Math.floor(e)-1),n)}var Zi=[[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 io(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of Zi)for(;t>=o;)n+=r,t-=o;return n}function qi(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 Vt(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??"",u=e.seatNumbering?.endAt,l=e.seatCount;if(i==="updown"||i==="updown-descending"){let m=Math.ceil(l/2),g=i==="updown"?t<m?n+2*t:n-1+2*(l-t):t<m?n+2*(m-1-t):n+1+2*(t-m);return`${s}${g}`}let d=i==="odd"||i==="even"?2:r,c=u!=null&&Number.isFinite(u)?u-(l-1)*d:n,f=o==="center"?qi(l)[t]:o==="rtl"?l-1-t:t,b;switch(i){case"odd":{let m=c%2===1?c:c+1;b=String(m+f*2);break}case"even":{let m=c%2===0?c:c+1;b=String(m+f*2);break}case"roman":b=io(c+f*r);break;case"letters-upper":b=He(c+f*r,!1);break;case"letters-lower":b=He(c+f*r,!0);break;default:b=String(c+f*r);break}return`${s}${b}`}function Qi(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function pt(e,t,n){return n?.label??`${e.seatLabelBase??e.label}-${Vt(e,t)}`}function Ji(e,t,n,o){if(o?.displayLabel)return null;if(e.seatDisplayLabelMode==="number"||!n)return{row:e.displayLabel||e.label,seat:Vt(e,t)};let r=Qi(n);return{row:n.displayLabel,seat:Vt(r,n.displayOffset+t)}}function Ht(e,t,n,o){let r=Ji(e,t,n,o);return r?e.seatDisplayLabelMode==="number"?r.seat:`${r.row}-${r.seat}`:o.displayLabel}var ao=999,ea=["clockwise","anticlockwise"],ta=["table-number","number","letter"];function so(e,t){return`${e.label}-${t+1}`}function na(e,t,n){return e?.direction==="anticlockwise"?Math.max(0,t-1-n):n}function oa(e,t){let n=e.chairNumbering,o=n?.start??1,r=na(n,Math.max(0,Math.round(e.seatCount)),t);return n?.format==="letter"?He(Math.max(1,o)+r):String(o+r)}function co(e,t){let n=oa(e,t);return(e.chairNumbering?.format??"table-number")==="table-number"?`${e.displayLabel??e.label}-${n}`:n}function lo(e){if(e===void 0)return null;if(!e||typeof e!="object"||Array.isArray(e))return"chairNumbering must be an object";let t=e,n=Object.keys(t).filter(o=>!["start","direction","format"].includes(o));return n.length?`chairNumbering has unsupported field(s): ${n.join(", ")}`:t.start!==void 0&&(!Number.isInteger(t.start)||t.start<0||t.start>ao)?`chairNumbering.start must be a whole number from 0 to ${ao}`:t.direction!==void 0&&!ea.includes(t.direction)?"chairNumbering.direction must be clockwise or anticlockwise":t.format!==void 0&&!ta.includes(t.format)?"chairNumbering.format must be table-number, number or letter":null}var Oe=.02291666666666667,ze=1/Oe,ra=58,uo=ra*Oe,Xt=0,Ae=3,ge=0,ue=120,mt=0,bt=45,Yt=7,Ee=1.2;function zt(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function ia(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Yt?e:Ae}function Xe(e,t={}){let n=zt(t.floorBaseHeightM,ge,ue,0),o=Math.min(ue,n+ia(e.elevation)*uo),r=e.height===void 0?o:zt(e.height,ge,ue,o),i=zt(e.rake,mt,bt,0);return{height:r,rake:i}}function fo(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 po(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],u=s.x-i.x,l=s.y-i.y,d=u*u+l*l,c=d>1e-12?((t-i.x)*u+(n-i.y)*l)/d:0;c<0?c=0:c>1&&(c=1);let f=t-(i.x+c*u),b=n-(i.y+c*l);if(Math.abs(f)>=o||Math.abs(b)>=o)continue;let m=Math.hypot(f,b);m<o&&(o=m)}return o}function aa(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 mo(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function Wt(e,t){let n=1/0;for(let o of fo(e)){let r=po(t,o.x,o.y);r<n&&(n=r)}for(let o of fo(t)){let r=po(e,o.x,o.y);r<n&&(n=r)}return n}function sa(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let c of e)n+=c.x,o+=c.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let c of e){let f=Math.hypot(c.x-n,c.y-o);f>r&&(r=f,i=c)}let s=i.x-n,u=i.y-o,l=Math.hypot(s,u);l>1e-9?(s/=l,u/=l):(s=1,u=0);let d=e.map((c,f)=>({p:c,i:f,t:(c.x-n)*s+(c.y-o)*u})).sort((c,f)=>c.t-f.t);return{pts:d.map(c=>c.p),seatIndices:d.map(c=>t[c.i])}}function ca(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let P of e)n+=P.x,o+=P.y;n/=t,o/=t;let r=0,i=0,s=0,u=0,l=0,d=0,c=0;for(let P of e){let L=P.x-n,I=P.y-o;r+=L*L,s+=I*I,i+=L*I,u+=L*L*L,l+=I*I*I,d+=L*I*I,c+=I*L*L}let f=r*s-i*i;if(Math.abs(f)<1e-9)return null;let b=(u+d)/2,m=(l+c)/2,g=(b*s-m*i)/f,v=(m*r-b*i)/f,S=g+n,A=v+o;return!Number.isFinite(S)||!Number.isFinite(A)?null:{cx:S,cy:A}}var la=.15,ua=.001;function da(e){let t=e[0],n=e[e.length-1],o=n.x-t.x,r=n.y-t.y,i=Math.hypot(o,r);if(!(i>1e-9))return 0;let s=0;for(let u of e){let l=Math.abs((u.x-t.x)*r-(u.y-t.y)*o)/i;l>s&&(s=l)}return s/i}function fa(e){if(e.length<2)return null;let t=e.map(M=>{let y=0,w=0;for(let O of M.pts)y+=O.x,w+=O.y;return{x:y/M.pts.length,y:w/M.pts.length}}),n=0,o=0;for(let M of t)n+=M.x,o+=M.y;n/=t.length,o/=t.length;let r=0,i=0,s=0;for(let M of t){let y=M.x-n,w=M.y-o;r+=y*y,i+=y*w,s+=w*w}let u=r+s,l=r*s-i*i,d=u/2+Math.sqrt(Math.max(0,u*u/4-l)),c,f;Math.abs(i)>1e-12?(c=d-s,f=i):r>=s?(c=1,f=0):(c=0,f=1);let b=Math.hypot(c,f);if(!(b>1e-12))return null;c/=b,f/=b;let m=0,g=0,v=0;for(let M of e){if(M.pts.length<2)continue;let y=M.pts[0],w=M.pts[M.pts.length-1],O=w.x-y.x,k=w.y-y.y,a=Math.hypot(O,k);if(!(a>1e-9))continue;let _=O/a,p=k/a;m+=(_*_-p*p)*a,g+=2*_*p*a,v+=a}if(v>0&&Math.hypot(m,g)>=ma*v){let M=Math.atan2(g,m)/2;c=-Math.sin(M),f=Math.cos(M)}let S=1/0,A=-1/0,P=[];for(let M of e){let y=1/0,w=-1/0;for(let O of M.pts){let k=O.x*c+O.y*f;k<y&&(y=k),k>w&&(w=k),k<S&&(S=k),k>A&&(A=k)}P.push(w-y)}let L=A-S;return L>1e-9?(P.sort((M,y)=>M-y),P[Math.min(P.length-1,Math.floor(P.length*.9))]/L<=pa?{x:c,y:f}:null):null}var pa=.35,ma=.8;function bo(e,t,n,o){let r=new Map;for(let y of n){let w=t[y],O=w.rowId||`__seat-${y}`,k=r.get(O);k||(k={pts:[],idx:[]},r.set(O,k)),k.pts.push({x:w.x,y:w.y}),k.idx.push(y)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[y,w]of r){let O=sa(w.pts,w.idx),k=0;for(let a of O.pts)k+=Math.hypot(a.x-o.x,a.y-o.y);i.push({id:y,pts:O.pts,seatIndices:O.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:k/O.pts.length})}let s=i.map(y=>aa(y.pts)),u=i.length<=256?i.length*(i.length-1)/2:0,l=u?new Float64Array(u):null;l?.fill(Number.NaN);let d=l?new Map(i.map((y,w)=>[y,w])):null,c=(y,w)=>(y>w&&([y,w]=[w,y]),y*(2*i.length-y-1)/2+(w-y-1)),f=(y,w)=>{if(!l)return Wt(i[y].pts,i[w].pts);let O=c(y,w),k=l[O];if(!Number.isNaN(k))return k;let a=Wt(i[y].pts,i[w].pts);return l[O]=a,a},b=(y,w)=>d?f(d.get(y),d.get(w)):Wt(y.pts,w.pts),m=[];for(let y=0;y<i.length;y++){let w=1/0;for(let O=0;O<i.length;O++){if(y===O||mo(s[y],s[O])>=w)continue;let k=f(y,O);k<w&&(w=k)}Number.isFinite(w)&&m.push(w)}m.sort((y,w)=>y-w);let g=m.length?m[Math.floor(m.length/2)]:1,v=Math.max(g*1.8,1e-6),S=i.map(()=>[]);for(let y=0;y<i.length;y++)for(let w=y+1;w<i.length;w++)mo(s[y],s[w])>v||f(y,w)<=v&&(S[y].push(w),S[w].push(y));let A=0;for(let y=0;y<i.length;y++){if(i[y].blockId!==-1)continue;let w=A++,O=[y];for(i[y].blockId=w;O.length;){let k=O.pop();for(let a of S[k])i[a].blockId===-1&&(i[a].blockId=w,O.push(a))}}let P=new Map;for(let y of i){let w=P.get(y.blockId)??[];w.push(y),P.set(y.blockId,w)}let L=[];for(let y of i){if(y.pts.length<4||da(y.pts)<ua)continue;let w=ca(y.pts);w&&(!Number.isFinite(w.cx)||!Number.isFinite(w.cy)||L.push({x:w.cx,y:w.cy}))}let I=L.length>=2?(()=>{let y=L.map(k=>k.x).sort((k,a)=>k-a),w=L.map(k=>k.y).sort((k,a)=>k-a),O=Math.floor(L.length/2);return{cx:y[O],cy:w[O]}})():null;if(I){let y=p=>Math.hypot(p.x-I.cx,p.y-I.cy),w=1/0,O=-1/0,k=[];for(let p of i){let h=1/0,x=-1/0;for(let T of p.pts){let E=y(T);E<h&&(h=E),E>x&&(x=E)}k.push(x-h),h<w&&(w=h),x>O&&(O=x)}let a=O-w;k.sort((p,h)=>p-h);let _=k[Math.min(k.length-1,Math.floor(k.length*.9))];if(a>1e-9&&_/a<=la){let p=i.map(F=>{let q=0;for(let Lt of F.pts)q+=y(Lt);return{row:F,radius:q/F.pts.length}}),h=0,x=0;for(let F of p)h+=F.radius,x+=F.row.focalDistance;h/=p.length,x/=p.length;let T=0;for(let F of p)T+=(F.radius-h)*(F.row.focalDistance-x);if(T<0)for(let F of p)F.radius=-F.radius;let C=1/0;for(let F of p)F.radius<C&&(C=F.radius);p.sort((F,q)=>F.radius-q.radius);let R=-1,j=-1/0,G=a/Math.max(1,p.length)*.5,Z=[];for(let F of p)F.radius-j>G&&(R++,j=F.radius),F.row.ordinal=R,F.row.blockDepth=F.radius-C,Z.push(F.row);return{sectionId:e,rows:Z,blockCount:A}}}let M=[];for(let[,y]of P){let w=fa(y);if(w){let O=p=>{let h=0;for(let x of p.pts)h+=x.x*w.x+x.y*w.y;return h/p.pts.length};y.sort((p,h)=>O(p)-O(h)),y.length>=2&&y[0].focalDistance>y[y.length-1].focalDistance&&y.reverse();let k=[],a=g*.5;for(let p of y){let h=k[k.length-1];h&&Math.abs(O(p)-O(h[0]))<a?h.push(p):k.push([p])}let _=0;for(let p=0;p<k.length;p++){if(p>0){let h=1/0;for(let x of k[p-1])for(let T of k[p])h=Math.min(h,b(x,T));h=Math.min(h,Math.abs(O(k[p][0])-O(k[p-1][0]))),_+=h}for(let h of k[p])h.ordinal=p,h.blockDepth=_,M.push(h)}}else{let O=1/0;for(let k of y)k.focalDistance<O&&(O=k.focalDistance);y.sort((k,a)=>k.focalDistance-a.focalDistance);for(let k=0;k<y.length;k++)y[k].ordinal=k,y[k].blockDepth=Math.max(0,y[k].focalDistance-O),M.push(y[k])}}return{sectionId:e,rows:M,blockCount:A}}var ba=/^\d{4}-\d{2}-\d{2}$/;function ga(e){let t=Date.parse(e);return Number.isFinite(t)?ba.test(e)?t+864e5:t:null}function ha(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let o=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(o)&&(t instanceof Date?t.getTime():t)<=o+366*864e5}let n=ga(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function ya(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function xa(e){return e.status!=="draft"&&e.status!=="retracted"}function va(e,t){return e.status===void 0?t===void 0:e.status!=="approved"?!0:typeof t=="string"&&typeof e.basisSha256=="string"&&e.basisSha256===t}function go(e,t={}){return!!e&&xa(e)&&ya(e,t.activeConfigurationId,t.activeConfigurationVersion)&&va(e,t.activeBasisSha256)&&ha(e,t.now)}function ho(e){return!!e.referenceImage?.assetId&&!!e.backgroundImage?.assetId&&e.referenceImage.assetId!==e.backgroundImage.assetId}var Sa=36,Ia=160;function yo(e,t=360){let n=ee(Math.round(Number.isFinite(e)?e:1),1,40),o=ee(Number.isFinite(t)?t:360,120,360);return Math.round(ee(n*4*(360/o),Sa,Ia))}var wa=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing","track-motorsport"]),Ma=new Set(["pitch-football","track-athletics","oval-cricket","pitch-rugby","diamond-baseball"]);function Ca(e){return!!e&&wa.has(e)}var ka="open-air",ll=new Set([...Ma,"court-tennis","track-motorsport",ka]);var xo=1.1;var ul=Math.PI*2;var dl=(()=>{let t={x:0,y:52},n=25,o={x:70,y:t.y-70},r=(o.x*o.x+o.y*o.y-4900)/(2*(o.y+70)),i=r+70,s=[],u=Math.atan2(o.y-r,o.x),l=Math.atan2(o.y-r,-o.x);for(let d=0;d<=24;d++){let c=u+(l-u)*d/24;s.push({x:i*Math.cos(c),y:r+i*Math.sin(c)})}return{half:70,home:t,backstop:n,fence:s}})();function vo(e){return Ca(e)}var Oa=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Aa=/[\s"'<>`\\]/;function Zt(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return Oa.test(e);if(Aa.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}var So=2e5,gt=1e5,qt="large_venue_inventory";function Io(e){return e?.includes(qt)?2e5:1e5}function Ea(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.kind==="polygon"?Ut(e,6):e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,o=e.width,r=e.height;return[{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r},{x:t,y:n+r}]}function Pa(e,t,n){let o=n*Math.PI/180,r=Math.cos(o),i=Math.sin(o),s=e.x-t.x,u=e.y-t.y;return{x:t.x+s*r-u*i,y:t.y+s*i+u*r}}function wo(e){let t=Ea(e);if(!t||t.length<2)return null;let n=e.rotation??0,o=Math.abs(n)<1e-6?t:t.map(l=>Pa(l,{x:t.reduce((d,c)=>d+c.x,0)/t.length,y:t.reduce((d,c)=>d+c.y,0)/t.length},n)),r=1/0,i=1/0,s=-1/0,u=-1/0;for(let l of o)r=Math.min(r,l.x),i=Math.min(i,l.y),s=Math.max(s,l.x),u=Math.max(u,l.y);return!Number.isFinite(r)||s-r<1e-6||u-i<1e-6?null:{minX:r,minY:i,maxX:s,maxY:u}}var Ra=5,La=3,Ta=.92,_a=1.9,ja=2,Na=.6,$a=1,Fa=.06;function Da(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?xo:vo(e.stageKind)?Fa:$a}function Mo(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=-1/0;for(let s of ne(e)){let u=s.baseHeightM??0;for(let l of s.objects){if(l.type!=="shape"||l.role!=="stage")continue;let d=wo(l);d&&(t=Math.min(t,d.minX),n=Math.min(n,d.minY),o=Math.max(o,d.maxX),r=Math.max(r,d.maxY),i=Math.max(i,u+Da(l)))}}return!Number.isFinite(t)||!Number.isFinite(i)?null:{minX:t,minY:n,maxX:o,maxY:r,deckTopM:i}}function Ba(e,t,n,o){let r=1/0,i=1/0,s=-1/0,u=-1/0;for(let m of e)Number.isFinite(m.eyeHeightM)&&(r=Math.min(r,m.x),s=Math.max(s,m.x),i=Math.min(i,m.y),u=Math.max(u,m.y));if(!Number.isFinite(r))return null;let l=r*t,d=i*t,c=Math.max(1,Math.ceil((s-r)*t/n)+1),f=Math.max(1,Math.ceil((u-i)*t/n)+1),b=new Float64Array(c*f).fill(-1/0);for(let m of e){if(!Number.isFinite(m.eyeHeightM))continue;let g=m.eyeHeightM-Ee,v=Math.min(c-1,Math.max(0,Math.floor((m.x*t-l)/n))),A=Math.min(f-1,Math.max(0,Math.floor((m.y*t-d)/n)))*c+v,P=g+o;P>b[A]&&(b[A]=P)}return{cellM:n,minX:l,minY:d,cols:c,rows:f,top:b}}function Ga(e,t,n){let o=Math.floor((t-e.minX)/e.cellM),r=Math.floor((n-e.minY)/e.cellM);return o<0||r<0||o>=e.cols||r>=e.rows?-1/0:e.top[r*e.cols+o]}function Co(e,t,n={}){let o=new Map;if(!t||!e.length)return o;let r=n.metresPerChartUnit??Oe,i=n.cellM??Na,s=n.chairBackM??Ta,u=n.selfRowSkipM??ja,l=n.clearThreshold??.9,d=n.partialThreshold??.25,c=Math.max(1,n.columns??Ra),f=Math.max(1,n.rows??La),b=Ba(e,r,i,s);if(!b)return o;let m=(t.maxX-t.minX)*r,g=(t.maxY-t.minY)*r,v=m>=g,S=(t.minX+t.maxX)/2*r,A=(t.minY+t.maxY)/2*r,P=[];for(let I=0;I<c;I++){let M=(I+.5)/c-.5,y=v?S+M*m:S,w=v?A:A+M*g;for(let O=0;O<f;O++){let k=t.deckTopM+(f===1?0:O/(f-1)*_a);P.push({x:y,y:w,z:k})}}let L=i/2;for(let I of e){if(!Number.isFinite(I.eyeHeightM))continue;let M=I.x*r,y=I.y*r,w=I.eyeHeightM,O=0,k=1/0;for(let _ of P){let p=_.x-M,h=_.y-y,x=Math.hypot(p,h);if(!(x>u)){O++;continue}let T=p/x,E=h/x,C=0;for(let R=u;R<x;R+=L){let j=Ga(b,M+T*R,y+E*R);if(!(!Number.isFinite(j)||j>=w)&&j>w+(_.z-w)*R/x){C=R;break}}C?k=Math.min(k,C):O++}let a=O/P.length;a>=l||o.set(I.id,{seatId:I.id,mark:a<d?"obstructedView":"restrictedView",visibleFraction:a,totalRays:P.length,atDistanceM:Number.isFinite(k)?k:0})}return o}function ko(e,t){if(!t.size)return 0;let n=0;for(let o of e){let r=t.get(o.id);if(!r)continue;let i=o.commercial;i?.restrictedView!==void 0||i?.obstructedView!==void 0||(o.commercial={...i,[r.mark]:!0},n++)}return n}function Qt(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var yt=Math.PI/180;var Ye=16;function Jt(e,t,n,o){let r=n*yt,i=Math.cos(r),s=Math.sin(r);return{x:o.x+e*i-t*s,y:o.y+e*s+t*i}}function en(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,s=[];if(e.path)return Yn(e.path,t);if(t<=1)return t===1&&s.push({x:i.x,y:i.y}),s;if(o===0){for(let d=0;d<t;d++)s.push(Jt(d*n,0,r,i));return s}let u=o/(t-1)*yt,l=n/(2*Math.sin(Math.abs(u)/2));for(let d=0;d<t;d++){let c=d*u,f=l*Math.sin(c),b=-l+l*Math.cos(c);s.push(Jt(f,b,r,i))}return s}function tn(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function xt(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 Ua(e,t){let n=tn(e);return en(e).map((o,r)=>{let i=n.get(r),s=Qt(i),u=pt(e,r,i),l={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:u,displayLabel:Ht(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:s.length>0,accessibility:s,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(l).some(d=>d!==void 0&&d!==!1&&d!=="")?l:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle??e.seatLabelStyle}})}function Q(e){let t=[];for(let n of Ua(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 We(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 Po(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(c=>[c.index,c])),r=(c,f,b,m)=>{let g=o.get(c),v=Qt(g),S=g?.label??so(e,c);return{index:c,label:S,displayLabel:g?.displayLabel??co(e,c),x:f+(g?.dx??0),y:b+(g?.dy??0),categoryKey:g?.categoryKey??e.categoryKey,skipped:!!g?.skip,accessible:v.length>0,accessibility:v,wheelchairSpaceType:g?.wheelchairSpaceType,commercial:g?.commercial,glyph:g?.glyph,viewUrl:g?.viewFromSeatUrl,viewMeta:g?.viewFromSeatUrl?g.viewFromSeatMeta:void 0,labelStyle:g?.labelStyle,...m?{side:m}:{}}};if(e.shape==="round"){let c=(e.radius??40)+Ye,f=e.rotation*yt,b=Math.max(0,Math.min(360,e.seatArc??360));if(b>=360||n===1){for(let S=0;S<n;S++){let A=f+S/n*2*Math.PI;t.push(r(S,e.center.x+c*Math.cos(A),e.center.y+c*Math.sin(A)))}return t}let m=b*yt,g=(2*Math.PI-m)/2,v=f+g;for(let S=0;S<n;S++){let A=v+S/(n-1)*m;t.push(r(S,e.center.x+c*Math.cos(A),e.center.y+c*Math.sin(A)))}return t}let i=e.width??80,s=e.height??50,u=We(e),l=["top","bottom","left","right"],d=0;for(let c of l){let f=u[c];for(let b=0;b<f;b++){let m,g;c==="top"?(m=-i/2+(b+.5)*i/f,g=-s/2-Ye):c==="bottom"?(m=-i/2+(b+.5)*i/f,g=s/2+Ye):c==="left"?(m=-i/2-Ye,g=-s/2+(b+.5)*s/f):(m=i/2+Ye,g=-s/2+(b+.5)*s/f);let v=Jt(m,g,e.rotation,e.center);t.push(r(d++,v.x,v.y,c))}}return t}function Ro(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):Po(e).filter(t=>!t.skipped).length}function re(e){return Po(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 Lo(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth",...e.commercial?.note?{commercial:{note:e.commercial.note}}:{}}]}function le(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,u=t[r].x,l=t[r].y;s>e.y!=l>e.y&&e.x<(u-i)*(e.y-s)/(l-s)+i&&(n=!n)}return n}function Kt(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),u=(r.x-n.x)**2+(r.y-n.y)**2;return s>=-1e-7&&s<=u+1e-7})}function ft(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function oe(e,t,n){return le(e,t)&&!ft(n).some(o=>le(e,o)||Kt(e,o))}function ht(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 ce(e){switch(e.type){case"row":{let t=en(e),n=tn(e),o=0,r=0,i=0;for(let s=0;s<t.length;s++){let u=n.get(s);u?.skip||(o+=t[s].x+(u?.dx??0),r+=t[s].y+(u?.dy??0),i++)}return i?{x:o/i,y:r/i}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return ht(e.points);case"section":return ht(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?ht(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 Oo(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function Ka(e,t){if(e.type!=="gaArea"||!Oo(e.points,t.outline))return!1;let n=ft(e.holes),o=ft(t.holes);return n.length===o.length&&n.every((r,i)=>Oo(r,o[i]))}function nn(e,t,n=e.filter(r=>r.type==="section"),o=ce(t)){let r="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(r?n.find(s=>(s.logicalSectionId??s.id)===r&&(Ka(t,s)||oe(o,s.outline,s.holes))):void 0)??n.find(s=>oe(o,s.outline,s.holes))??(t.type==="row"&&Va(t)?Ha(t,n):void 0)}function Va(e){return(e.overrides??[]).some(t=>t.skip===!0)}function Ha(e,t){let n=en(e),o=tn(e),r,i=0;for(let s of t){let u=0;for(let l=0;l<n.length;l++){let d=o.get(l);if(d?.skip)continue;let c={x:n[l].x+(d?.dx??0),y:n[l].y+(d?.dy??0)};oe(c,s.outline,s.holes)&&u++}u>i&&(r=s,i=u)}return r}function ne(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 Ze(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function Ao(e,t,n,o,r,i,s,u,l){let d=[],c=e.filter(v=>v.type==="section"),f=ro(e),b=v=>!v?.eventConfigurationId||v.eventConfigurationId===o&&(v.eventConfigurationVersion===void 0||v.eventConfigurationVersion===l),m=v=>go(v,{activeConfigurationId:o,activeConfigurationVersion:l,activeBasisSha256:r,now:u}),g=(v,S)=>m(v)?{...v,coverage:S}:void 0;for(let v of e){let S=[];if(v.type==="row"?S=Q(v):v.type==="table"?S=re(v):v.type==="booth"&&(S=Lo(v)),!S.length)continue;for(let M of S)M.viewUrl&&!b(M.viewMeta)&&(M.viewUrl=void 0,M.viewMeta=void 0);if(v.type==="row"){let M=f.get(v.id);if(M){let y=new Map((v.overrides??[]).map(w=>[w.index,w]));for(let w of S){let O=Number(w.id.slice(w.id.lastIndexOf(":")+1));if(!Number.isInteger(O))continue;w.logicalRowId=M.groupId,w.logicalSeatIndex=M.adjacencyOffset+O,y.get(O)?.displayLabel||(w.displayLabel=Ht(v,O,M)),!w.viewUrl&&M.viewFromSeatUrl&&b(M.viewFromSeatMeta)&&(w.viewUrl=M.viewFromSeatUrl,w.viewMeta=M.viewFromSeatMeta);let k=y.get(O)?.confidenceEvidence;w.confidenceEvidence=g(k,"exact-seat")??g(v.confidenceEvidence,"row-representative")??g(M.confidenceEvidence,"row-representative")}}}let A=nn(e,v,c,v.type==="row"?ht(S):ce(v)),P=A?.viewFromSeatUrl,I=(A?.zone?t?.find(M=>M.id===A.zone):void 0)?.focalPoint??n;for(let M of S){if(!M.confidenceEvidence){let y=Number(M.id.slice(M.id.lastIndexOf(":")+1)),w=(v.type==="row"||v.type==="table")&&Number.isInteger(y)?v.overrides?.find(O=>O.index===y)?.confidenceEvidence:void 0;M.confidenceEvidence=g(w,"exact-seat")??(v.type==="row"?g(v.confidenceEvidence,"row-representative"):void 0)}M.confidenceEvidence??=g(A?.confidenceEvidence,"section-representative")??(s?g(s.evidence,s.coverage):void 0),!M.viewUrl&&P&&b(A?.viewFromSeatMeta)&&(M.viewUrl=P,M.viewMeta=A?.viewFromSeatMeta),!M.viewUrl&&i&&b(i.meta)&&(M.viewUrl=i.url,M.viewMeta=i.meta),A&&(M.sectionId=A.logicalSectionId??A.id),A?.zone&&(M.zoneId=A.zone),I&&(M.focalPoint={...I})}d.push(...S)}return d}function To(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,u=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,l=Ao(r.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,s,u,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&Eo(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,l);for(let d of l)d.floorId=r.id;for(let d of l)o.push(d)}return o}let n=Ao(e.objects,e.zones,e.focalPoint,e.eventConfigurationId,e.confidenceBasisSha256,e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);return t.resolveEyeHeights!==!1&&Eo(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),za(e,n,t)}function za(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||ko(t,Co(t,Mo(e))),t}function Eo(e,t,n,o){let r=e.filter(f=>f.type==="section"),i=n>0||r.some(f=>f.height!==void 0||f.rake!==void 0||(f.elevation??0)>0);if(!r.length||!i||!t){for(let f of o)f.eyeHeightM=n+Ee;return}let s=new Array(o.length),u=new Map;for(let f of r)u.has(f.id)||u.set(f.id,f);let l=new Map,d=new Map;for(let f=0;f<o.length;f++){let b=o[f],g=(b.sectionId?u.get(b.sectionId)??r.find(S=>S.logicalSectionId===b.sectionId&&oe({x:b.x,y:b.y},S.outline,S.holes)):void 0)??r.find(S=>oe({x:b.x,y:b.y},S.outline,S.holes))??null;if(s[f]=g,!g)continue;l.has(g.id)||l.set(g.id,Xe(g,{floorBaseHeightM:n}));let v=d.get(g.id);v?v.push(f):d.set(g.id,[f])}let c=new Array(o.length).fill(void 0);for(let[f,b]of d){let m=l.get(f);if(!m)continue;let g=m.rake>0?Math.tan(m.rake*Math.PI/180):0,v=bo(f,o,b,t);for(let S of v.rows){let A=S.blockDepth*Oe*g,P=m.height+A;for(let L of S.seatIndices)c[L]=P}}for(let f=0;f<o.length;f++){let b=o[f],m=s[f];if(!m){b.eyeHeightM=n+Ee;continue}let g=l.get(m.id);b.eyeHeightM=(c[f]??g.height)+Ee}}var vt="__sl_ga__";function de(e){return e.startsWith(vt)}var Xa=vt,he=1e5;function _o(e,t){return`${Xa}${encodeURIComponent(e)}__${t+1}`}function St(e){let t=e.inventorySegments;if(t===void 0)return!0;if(!Array.isArray(t)||t.length<1||t.length>256)return!1;let n=0,o=new Map;for(let r of t){if(!r||typeof r.sourceAreaId!="string"||!r.sourceAreaId.trim()||r.sourceAreaId.length>160||!Number.isInteger(r.startIndex)||r.startIndex<0||!Number.isInteger(r.count)||r.count<1||r.startIndex+r.count>he||(n+=r.count,n>he))return!1;let i=o.get(r.sourceAreaId)??[],s=r.startIndex+r.count;if(i.some(u=>r.startIndex<u.end&&s>u.start))return!1;i.push({start:r.startIndex,end:s}),o.set(r.sourceAreaId,i)}return n===e.capacity}function on(e){let t=Math.min(he,Math.max(0,Math.floor(e.capacity)));return e.inventorySegments===void 0?t?[{sourceAreaId:e.id,startIndex:0,count:t}]:[]:St(e)?e.inventorySegments.map(n=>({...n})):[]}var ye=100,Ya=`An area sold to one party holds at most ${ye} guests.`;function fe(e){return e.variableOccupancy?"variable":e.bookAsWhole?"whole":null}function Wa(e){return fe(e)==="variable"?{min:e.minOccupancy??1,max:e.maxOccupancy??e.capacity}:{min:e.capacity,max:e.capacity}}function rn(e){return an(e,2)}function an(e,t){return t===2&&fe(e)&&e.inventorySegments===void 0?e.label.trim()?[e.label]:[]:on(e).flatMap(n=>Array.from({length:n.count},(o,r)=>_o(n.sourceAreaId,n.startIndex+r)))}function jo(e){let t=e.wheelchairPlaces;return!Number.isInteger(t)||t<=0?0:Math.min(t,Math.max(0,Math.floor(e.capacity)))}function Za(e,t=2){let n=jo(e);if(!n)return new Set;let o=an(e,t);return o.length===1&&fe(e)&&t===2?new Set(o):new Set(o.slice(Math.max(0,o.length-n)))}function qa(e,t){if(e.inventorySegments===void 0||t===e.capacity)return e.inventorySegments;if(t<e.capacity)return;let n=on(e);if(!n.length)return;let o=t-e.capacity;if(!o)return n;let i=n.filter(u=>u.sourceAreaId===e.id).reduce((u,l)=>Math.max(u,l.startIndex+l.count),0),s=n[n.length-1];if(s?.sourceAreaId===e.id&&s.startIndex+s.count===i)s.count+=o;else{if(n.length>=256)return;n.push({sourceAreaId:e.id,startIndex:i,count:o})}return n}function Qa(e){return Ze(e).filter(t=>t.type==="gaArea")}function Ja(e){return e.type==="row"||e.type==="table"||e.type==="booth"||e.type==="gaArea"}function No(e){let t=new Map;for(let n of ne(e)){let o=n.objects.filter(r=>r.type==="section");if(o.length)for(let r of n.objects){if(!Ja(r))continue;let i=nn(n.objects,r,o);i&&t.set(r.id,i.logicalSectionId??i.id)}}return t}var es=.15,ts=1.6;function $o(e){return ee(e??1,es,ts)}var ns=/^#[0-9a-fA-F]{6}$/,os=/^#?([\da-f]{3}|[\da-f]{6})$/i;function Fo(e){return typeof e=="string"&&ns.test(e)}function Pe(e){let t=os.exec((e??"").trim());if(!t)return null;let n=t[1].length===3?t[1].split("").map(r=>r+r).join(""):t[1],o=parseInt(n,16);return[o>>16&255,o>>8&255,o&255]}function Do(e,t){let n=i=>{let s=Pe(i);if(!s)return null;let u=P=>{let L=P/255;return L<=.04045?L/12.92:((L+.055)/1.055)**2.4},l=u(s[0]),d=u(s[1]),c=u(s[2]),f=(.4124*l+.3576*d+.1805*c)/.95047,b=.2126*l+.7152*d+.0722*c,m=(.0193*l+.1192*d+.9505*c)/1.08883,g=P=>P>.008856?Math.cbrt(P):7.787*P+16/116,v=g(f),S=g(b),A=g(m);return[116*S-16,500*(v-S),200*(S-A)]},o=n(e),r=n(t);return o&&r?Math.hypot(o[0]-r[0],o[1]-r[1],o[2]-r[2]):null}function sn(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function cn(e){return .2126*sn(e[0])+.7152*sn(e[1])+.0722*sn(e[2])}function te(e,t){let n=Pe(e),o=Pe(t);if(!n||!o)return null;let r=cn(n),i=cn(o);return(Math.max(r,i)+.05)/(Math.min(r,i)+.05)}function rs(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=!1;for(let s of e)!Number.isFinite(s.x)||!Number.isFinite(s.y)||(i=!0,s.x<t&&(t=s.x),s.y<n&&(n=s.y),s.x>o&&(o=s.x),s.y>r&&(r=s.y));return i?{minX:t,minY:n,maxX:o,maxY:r}:null}function Bo(e){let t=rs(e);return t?is(t):null}function is(e){return{x:e.minX,y:e.minY,width:e.maxX-e.minX,height:e.maxY-e.minY}}var Re=[{key:"wheelchair",label:"Wheelchair space",short:"Wheelchair",icon:"\u267F"},{key:"companion",label:"Companion seat",short:"Companion",icon:"\u{1F9D1}\u200D\u{1F91D}\u200D\u{1F9D1}"},{key:"semi-ambulatory",label:"Semi-ambulatory (limited mobility)",short:"Limited mobility",icon:"\u{1F9AF}"},{key:"designated-aisle",label:"Designated aisle / transfer seat",short:"Aisle transfer",icon:"AS"},{key:"step-free",label:"Step-free accessible seat",short:"Step-free",icon:"SF"},{key:"hearing",label:"Assistive listening",short:"Hearing",icon:"\u{1F9BB}"},{key:"cart",label:"CART live-caption view",short:"CART captions",icon:"CC"},{key:"sign-language",label:"Sign-language view",short:"Sign language",icon:"\u{1F91F}"},{key:"low-vision",label:"Blind / low-vision viewing",short:"Low vision",icon:"LV"},{key:"sensory-friendly",label:"Quiet / sensory-friendly seating",short:"Sensory-friendly",icon:"QS"},{key:"plus-size",label:"Plus-size seat",short:"Plus-size",icon:"\u{1F4BA}"},{key:"lift-armrest",label:"Lift-up armrest",short:"Lift armrest",icon:"\u2195\uFE0F"}],Xl=new Map(Re.map(e=>[e.key,e]));var as=[{key:"obstructedView",label:"Obstructed view",short:"Obstructed",icon:"\u26D4"},{key:"restrictedView",label:"Restricted view",short:"Restricted",icon:"\u{1F441}"},{key:"premium",label:"Premium seat",short:"Premium",icon:"\u2605"}],Yl=new Map(as.map(e=>[e.key,e]));var ln=8,un=24,Go=["start","end","both","none"],Uo=["inline","corner","peninsula","island"],ss=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],Wl=new Set(ss);var Ho=7;var zo=10;var fn=.85,Xo=12,Yo=4.5;var cs=3,Ko="#000000",Vo="#ffffff",ls=24,us=18.67;function Wo(e,t=400){return e>=ls||t>=700&&e>=us?cs:Yo}var ds={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"},tu=ds.wheelchair;var dn=te;function pn(e,t,n){let o=Pe(e),r=Pe(t);if(!o||!r)return t;let i=Math.max(0,Math.min(1,n));return`#${o.map((u,l)=>Math.round(u*i+r[l]*(1-i))).map(u=>u.toString(16).padStart(2,"0")).join("")}`}function Zo(e,t,n=Yo){let o=dn(t,e);if(o!=null&&o>=n)return t;let r=dn(Ko,e)??0,i=dn(Vo,e)??0;return r===0&&i===0?t:r>=i?Ko:Vo}function qo(e){return e.notForSale===!0?!0:e.tiers?.length?e.tiers.every(t=>Number.isFinite(t.price)&&t.price>=0):e.price!=null}function fs(e){let t=0;for(let n=0,o=e.length;n<o;n+=1){let r=e[n],i=e[(n+1)%o];t+=r.x*i.y-i.x*r.y}return t/2}function xe(e){return fs(e)*2}var It=[{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 Qo(e){return e.floors?.length?e.floors:[{id:"floor-0",objects:e.objects}]}function ps(e){return It.find(t=>t.key===e)}function Qe(e){let t=new Map,n=Math.max(0,Math.floor(e.seatCount)),o=new Map((e.overrides??[]).filter(i=>Number.isInteger(i.index)&&i.index>=0&&i.index<e.seatCount).map(i=>[i.index,i])),r=(i,s=1)=>{i&&s>0&&t.set(i,(t.get(i)??0)+s)};r(e.categoryKey,n-o.size);for(let i of o.values())i.skip||r(i.categoryKey??e.categoryKey);return t}function ms(e){return e.type==="row"||e.type==="table"?[...Qe(e).keys()]:e.type==="booth"?e.categoryKey?[e.categoryKey]:[]:e.type==="gaArea"?e.capacity>0&&e.categoryKey?[e.categoryKey]:[]:[]}function Jo(e){return It.find(t=>t.objectType===e.type)??null}function er(e){return e.type==="row"||e.type==="table"||e.type==="booth"||e.type==="gaArea"}function qe(e){let t=new Map;for(let r of Qo(e))for(let i of r.objects){if(!er(i))continue;let s=Jo(i);for(let u of ms(i)){let l=t.get(u)??new Map,d=l.get(s.key)??[];if(!d.some(c=>c.id===i.id)){let c=i.displayLabel||i.label||i.id;d.push({id:i.id,label:c,type:s.objectType,floorId:r.id})}l.set(s.key,d),t.set(u,l)}}let n=new Map(e.categories.map(r=>[r.key,r.label]));return[...e.categories.map(r=>r.key),...[...t.keys()].filter(r=>!n.has(r)).sort()].flatMap(r=>{let i=t.get(r);if(!i||i.size<2)return[];let s=It.flatMap(u=>{let l=i.get(u.key);return l?.length?[{family:u.key,label:u.label,objectType:u.objectType,targets:l}]:[]});return[{categoryKey:r,categoryLabel:n.get(r)??r,families:s,objectIds:[...new Set(s.flatMap(u=>u.targets.map(l=>l.id)))]}]})}function mn(e){let t=e.families.map(n=>`${n.label} (${n.targets.map(o=>o.label).join(", ")})`).join(" and ");return`Category \u201C${e.categoryLabel}\u201D is used by more than one kind of inventory: ${t}. Each category can belong to only one kind. Use the safe split to separate them (prices, ticket tiers, accessibility, and provenance are preserved).`}function tr(e){return e.normalize("NFKC").trim().toLocaleLowerCase("en")}function bs(e,t,n){for(let o=1;o<=1e4;o+=1){let r=o===1?`--${t}`:`--${t}-${o}`,s=`${e.slice(0,Math.max(1,160-r.length))}${r}`;if(!n.has(s))return n.add(s),s}throw new Error(`Unable to allocate a category key for ${e} (${t})`)}function gs(e,t,n){for(let o=1;o<=1e4;o+=1){let r=o===1?` (${t})`:` (${t} ${o})`,s=`${e.normalize("NFKC").trim().slice(0,Math.max(1,80-r.length)).trimEnd()}${r}`,u=tr(s);if(!n.has(u))return n.add(u),s}throw new Error(`Unable to allocate a category label for ${e} (${t})`)}function hs(e,t,n,o){let r=ps(t);return{...structuredClone(e),key:bs(e.key,r.suffix,n),label:gs(e.label,r.labelSuffix,o)}}function ys(e,t,n){let o=[];for(let r of Qo(e))for(let i of r.objects){if(!er(i))continue;let s=Jo(i),u=n.get(s.key);if(!(!u||u===t))if(i.type==="row"||i.type==="table"){let l=[];i.categoryKey===t&&(i.categoryKey=u);for(let d of i.overrides??[])d.categoryKey===t&&(d.categoryKey=u,l.push(d.index));(i.categoryKey===u||l.length)&&o.push({family:s.key,floorId:r.id,objectId:i.id,objectType:s.objectType,fromCategoryKey:t,toCategoryKey:u,...l.length?{seatOverrideIndices:l.sort((d,c)=>d-c)}:{}})}else i.categoryKey===t&&(i.categoryKey=u,o.push({family:s.key,floorId:r.id,objectId:i.id,objectType:s.objectType,fromCategoryKey:t,toCategoryKey:u}))}return o}function bn(e){let t=structuredClone(e),n=qe(t);if(!n.length)return{doc:t,changed:!1,changes:[],before:n,after:n};let o=new Set(t.categories.map(u=>u.key)),r=new Set(t.categories.map(u=>tr(u.label))),i=[];for(let u of n){let l=t.categories.findIndex(g=>g.key===u.categoryKey);if(l<0)continue;let d=t.categories[l],c=u.families[0].family,f=new Map([[c,d.key]]),b=u.families.slice(1).map(g=>{let v=hs(d,g.family,o,r);return f.set(g.family,v.key),{family:g.family,key:v.key,label:v.label,category:v}});t.categories.splice(l+1,0,...b.map(g=>g.category));let m=ys(t,d.key,f);i.push({categoryKey:d.key,categoryLabel:d.label,retainedFamily:c,clones:b.map(({family:g,key:v,label:S})=>({family:g,key:v,label:S})),reassignments:m})}t.floors?.length&&(t.objects=t.floors[0].objects);let s=qe(t);return{doc:t,changed:i.length>0,changes:i,before:n,after:s}}function nr(e){return typeof e=="string"&&Go.includes(e)}var wt=["#e69f00","#56b4e9","#009e73","#f0e442","#0072b2","#d55e00","#cc79a7"],or="#a4508b";var uu={facilities:or,"food-drink":wt[5],navigation:wt[2],accessibility:wt[4]};var du={minDiameterPx:12,glyphScale:.66,ringRatio:1/14,largeFromPx:24};var K=e=>{let t=Math.round(e*100)/100;return Object.is(t,-0)?"0":String(t)},je=e=>`${K(e[0])} ${K(e[1])}`,_e=(e,t,n,o)=>[e+n*Math.cos(o*Math.PI/180),t+n*Math.sin(o*Math.PI/180)];function gr(e){let t=`M${je(e.from)}`;for(let n of e.segs)t+=n.arc?`A${K(n.arc.r)} ${K(n.arc.r)} 0 ${n.arc.large} ${n.arc.sweep} ${je(n.to)}`:`L${je(n.to)}`;return`${t}Z`}function V(e){let t=[e.from,...e.segs.map(o=>o.to)],n=[];for(let o=e.segs.length-1;o>=0;o--){let r=e.segs[o].arc;n.push({to:t[o],arc:r&&{...r,sweep:r.sweep?0:1}})}return{from:t[t.length-1],segs:n}}function H(e,t,n){let o={r:n,large:0,sweep:1};return{from:[e-n,t],segs:[{to:[e+n,t],arc:o},{to:[e-n,t],arc:o}]}}function N(e,t,n,o,r){let i=Math.min(r,n/2,o/2),s={r:i,large:0,sweep:1};return i<=0?Y([[e,t],[e+n,t],[e+n,t+o],[e,t+o]]):{from:[e+i,t],segs:[{to:[e+n-i,t]},{to:[e+n,t+i],arc:s},{to:[e+n,t+o-i]},{to:[e+n-i,t+o],arc:s},{to:[e+i,t+o]},{to:[e,t+o-i],arc:s},{to:[e,t+i]},{to:[e+i,t],arc:s}]}}function Y(e){let t=0;for(let o=0;o<e.length;o++){let[r,i]=e[o],[s,u]=e[(o+1)%e.length];t+=r*u-s*i}let n=t>0?e:[...e].reverse();return{from:n[0],segs:[...n.slice(1).map(o=>({to:o})),{to:n[0]}]}}function B(e,t,n){let o=n/2,r=t[0]-e[0],i=t[1]-e[1],s=Math.hypot(r,i);if(s<1e-6)return H(e[0],e[1],o);let u=[i/s*o,-r/s*o],l={r:o,large:0,sweep:1},d=[e[0]+u[0],e[1]+u[1]];return{from:d,segs:[{to:[t[0]+u[0],t[1]+u[1]]},{to:[t[0]-u[0],t[1]-u[1]],arc:l},{to:[e[0]-u[0],e[1]-u[1]]},{to:d,arc:l}]}}function X(e,t,n=!1){let o=[],r=n?e.length:e.length-1;for(let i=0;i<r;i++)o.push(B(e[i],e[(i+1)%e.length],t));return o}function ie(e,t,n,o,r,i){let s=i/2,u=r-o>180?1:0,l={r:s,large:0,sweep:1},d=_e(e,t,n+s,o);return{from:d,segs:[{to:_e(e,t,n+s,r),arc:{r:n+s,large:u,sweep:1}},{to:_e(e,t,n-s,r),arc:l},{to:_e(e,t,n-s,o),arc:{r:n-s,large:u,sweep:0}},{to:d,arc:l}]}}var $=(...e)=>e.flat().map(gr).join(" "),J=(e,t,n)=>`M${K(e-n)} ${K(t)}a${K(n)} ${K(n)} 0 1 0 ${K(2*n)} 0a${K(n)} ${K(n)} 0 1 0 ${K(-2*n)} 0`,se=(e,t,n,o,r)=>gr(N(e,t,n,o,r)),Ct=e=>`M${e.map(je).join("L")}`,Mt=(e,t,n,o,r)=>`M${je(_e(e,t,n,o))}A${K(n)} ${K(n)} 0 ${r-o>180?1:0} 1 ${je(_e(e,t,n,r))}`;function Le(e,t,n,o=1){let r=i=>[i[0]*o+t,i[1]*o+n];return{head:[e.head[0]*o+t,e.head[1]*o+n,e.head[2]*o],limbs:e.limbs.map(i=>i.map(r)),arcs:e.arcs?.map(([i,s,u,l,d])=>[i*o+t,s*o+n,u*o,l,d])}}function Je(e){return[J(e.head[0],e.head[1],e.head[2]),...e.limbs.map(Ct),...(e.arcs??[]).map(([t,n,o,r,i])=>Mt(t,n,o,r,i))].join(" ")}function Te(e,t=2.6){return[H(e.head[0],e.head[1],e.head[2]+1),...e.limbs.flatMap(n=>X(n,t)),...(e.arcs??[]).map(([n,o,r,i,s])=>ie(n,o,r,i,s,t-.2))]}var ve={head:[10,4,2],limbs:[[[10,8.2],[10,14],[15.5,14],[18,19.5],[20.5,19.5]],[[10,10.6],[14.5,10.6]]],arcs:[[9.5,16,5.5,35,235]]},rr={head:[10.6,3.9,1.9],limbs:[[[9.6,7.8],[7.6,12]],[[5.4,8.2],[9.4,8.4],[12.8,10]],[[4,15.6],[7.6,12],[11,13.6],[10.6,16.4]]]},ir={cx:12,hr:1.9,arm:5,leg:3,r:2},ar={cx:12,hr:1.9,sh:2.2,hem:6,leg:3},sr={cx:6.2,hr:1.8,arm:3.6,leg:2.2,r:1.4},cr={cx:17.8,hr:1.8,sh:1.4,hem:4.1,leg:2.2};function lr({cx:e,hr:t,arm:n,leg:o,r}){return[J(e,2+t,t),`M${K(e-n+r)} 8.5H${K(e+n-r)}a${r} ${r} 0 0 1 ${r} ${r}V15H${K(e+o)}V22H${K(e-o)}V15H${K(e-n)}V${K(8.5+r)}a${r} ${r} 0 0 1 ${r} ${-r}Z`,`M${K(e)} 15V22`].join(" ")}function ur({cx:e,hr:t,arm:n,leg:o,r}){return[H(e,2+t,t+1),N(e-n-.5,7.8,2*n+1,7.7,r+.5),N(e-o-.5,13,o,9.5,1),N(e+.5,13,o,9.5,1)]}function dr({cx:e,hr:t,sh:n,hem:o,leg:r}){return[J(e,2+t,t),Ct([[e-n,8.5],[e+n,8.5],[e+o,16],[e+r,16],[e+r,22],[e-r,22],[e-r,16],[e-o,16]])+"Z",`M${K(e)} 16V22`].join(" ")}function fr({cx:e,hr:t,sh:n,hem:o,leg:r}){return[H(e,2+t,t+1),Y([[e-n-.6,7.8],[e+n+.6,7.8],[e+o+.9,16.8],[e-o-.9,16.8]]),N(e-r-.1,15,r-.4,7.5,.9),N(e+.5,15,r-.4,7.5,.9)]}var xs=[[14.6,1.5],[5.2,13.6],[11,13.6],[9.4,22.5],[18.8,10.4],[13,10.4]],vs="M8.5 3.5 4 5.5l-1.5 5 3 1 1-2v11h11v-11l1 2 3-1-1.5-5-4.5-2c-.5 1.5-1.8 2.5-3.5 2.5s-3-1-3.5-2.5Z",Ss="M12 2.5S5 9.5 5 14.5a7 7 0 0 0 14 0c0-5-7-12-7-12Z",Is="M2.5 21.5h19V3h-6v6.2H9.2v6.2H2.5Z",pr=[[9,3],[15,3],[15,9],[21,9],[21,15],[15,15],[15,21],[9,21],[9,15],[3,15],[3,9],[9,9]],ws={from:[3.8,5.2],segs:[{to:[20.2,5.2]},{to:[22,7],arc:{r:1.8,large:0,sweep:1}},{to:[22,9.7]},{to:[22,14.3],arc:{r:2.3,large:0,sweep:0}},{to:[22,17]},{to:[20.2,18.8],arc:{r:1.8,large:0,sweep:1}},{to:[3.8,18.8]},{to:[2,17],arc:{r:1.8,large:0,sweep:1}},{to:[2,14.3]},{to:[2,9.7],arc:{r:2.3,large:0,sweep:0}},{to:[2,7]},{to:[3.8,5.2],arc:{r:1.8,large:0,sweep:1}}]},Ms={from:[12,1.6],segs:[{to:[20.4,4.9]},{to:[20.4,11.2]},{to:[12,22.4],arc:{r:13,large:0,sweep:1}},{to:[3.6,11.2],arc:{r:13,large:0,sweep:1}},{to:[3.6,4.9]},{to:[12,1.6]}]};function mr(e,t,n){return{from:[e-n,t],segs:[{to:[e+n,t],arc:{r:n,large:0,sweep:1}},{to:[e-n,t]}]}}var br={head:[13.2,4.3,2.2],limbs:[[[12.6,8.6],[11.2,15],[17.8,18.4],[9.4,18.4]],[[12.4,9.8],[16,14.4]]]},Cs=[[6,10.5],[15,10.5],[16.5,7],[18.5,5.5],[20,6.5],[21.5,8.5],[19.5,10],[18,12],[18,19],[16.5,19],[15.5,14],[9.5,14],[8.5,19],[7,19],[6.5,13]],ks=[[5.4,9.8],[14.6,9.8],[16.1,6.4],[18.4,4.6],[20.5,5.9],[22.4,8.6],[19.9,10.6],[18.8,12.3],[18.8,19.8],[15.8,19.8],[15,14.8],[10.1,14.8],[9.2,19.8],[6.2,19.8],[5.6,13.2]],gn=[{key:"restroom-men",label:"Men's restroom",group:"facilities",path:lr(ir),solid:$(ur(ir))},{key:"restroom-women",label:"Women's restroom",group:"facilities",path:dr(ar),solid:$(fr(ar))},{key:"restroom-accessible",label:"Accessible restroom",group:"facilities",path:[se(2.5,2.5,19,19,3.5),Je(Le(ve,4.6,4.3,.66))].join(" "),solid:$(Te(ve)),solidLarge:$(N(1.5,1.5,21,21,4.5),V(N(3.9,3.9,16.2,16.2,2.6)),Te(Le(ve,4.9,4.7,.62),2.2))},{key:"first-aid",label:"First aid",group:"facilities",path:Ct(pr)+"Z",solid:$(Y(pr.map(([e,t])=>[e+(e-12)*.08,t+(t-12)*.08])))},{key:"coat-check",label:"Coat check",group:"facilities",path:"M10 6.5a2 2 0 1 1 2 2V10 M12 10 3.4 16.9a1.4 1.4 0 0 0 .9 2.6h15.4a1.4 1.4 0 0 0 .9-2.6Z",solid:$(ie(12,6.2,2.2,180,450,2.3),B([12,8.4],[12,10.5],2.3),X([[12,10.2],[3.2,18.8],[20.8,18.8]],2.8,!0))},{key:"atm",label:"ATM / cash",group:"facilities",path:[se(2,6,20,12,2),J(12,12,2.75),"M6 12h.01 M18 12h.01"].join(" "),solid:$(N(1.5,5.5,21,13,2.4),V(H(12,12,3.2)))},{key:"info",label:"Info point",group:"facilities",path:[J(12,12,9.5),"M10.8 11H12v5.8 M12 7.6h.01"].join(" "),solid:$(H(12,4.9,2.4),N(10.3,9.2,3.4,12.3,1),N(8.2,9.2,4,3,1),N(8.2,18.5,7.6,3,1))},{key:"lost-found",label:"Lost & found",group:"facilities",path:[J(10.5,10.5,7.5),"M16 16l5.5 5.5","M8.4 8.4a2.1 2.1 0 1 1 3 1.9c-.6.4-.9.8-.9 1.6 M10.5 14.6h.01"].join(" "),solid:$(ie(12,7.6,4.2,180,405,3.4),X([[14.97,10.57],[12,13],[12,15]],3.4),H(12,20,2.1))},{key:"restrooms",label:"Toilets",group:"facilities",path:[lr(sr),dr(cr)].join(" "),solid:$(ur(sr),fr(cr))},{key:"charging",label:"Charging point",group:"facilities",path:[se(6,2,12,20,2.5),"M13.2 6.2 9.6 12h4.8l-3.6 5.8"].join(" "),solid:$(Y(xs))},{key:"smoking",label:"Smoking area",group:"facilities",path:[se(2,14.5,14.5,4,1),"M6.5 14.5v4","M15.5 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4 M19 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4"].join(" "),solid:$(N(1.5,14,4.2,5,1.2),N(6.8,14,10.4,5,1.2),X([[15.9,11.4],[17.3,8.9],[15.9,6.4],[17.1,3.9]],2.2),X([[19.6,11.4],[21,8.9],[19.6,6.4],[20.8,3.9]],2.2))},{key:"no-smoking",label:"No smoking",group:"facilities",path:[J(12,12,9.5),"M5.3 5.3l13.4 13.4","M5.5 10.5h13v3h-13Z"].join(" "),solid:$(H(12,12,10.6),V(H(12,12,8)),B([6,6],[18,18],2.8),N(5,10.4,3,3.2,.6),N(16,10.4,3,3.2,.6))},{key:"food",label:"Food",group:"food-drink",path:"M5 2.5V8a2.5 2.5 0 0 0 5 0V2.5 M7.5 2.5v19 M18.5 13.5h-2c-1.3 0-2-1-2-2.5 0-4 1.5-7 4-8.5v19",solid:$(X([[4.9,2.6],[4.9,8]],2.2),X([[10.1,2.6],[10.1,8]],2.2),X([[7.5,2.6],[7.5,8]],2.2),ie(7.5,8,2.6,0,180,2.2),B([7.5,10],[7.5,21.4],3),Y([[19.4,2.2],[19.4,14.2],[16.2,14.2],[14.1,12],[14.1,9.4],[15.2,5.8],[17.3,3.3]]),B([18,13],[18,21.4],3))},{key:"bar",label:"Bar",group:"food-drink",path:"M3.5 3.5h17L12 13Z M6.2 6.5h11.6 M12 13v7.5 M8 20.5h8",solid:$(Y([[2.8,3],[21.2,3],[12,13.6]]),B([12,12],[12,20.6],2.8),B([7.4,21],[16.6,21],2.8))},{key:"coffee",label:"Caf\xE9 / coffee",group:"food-drink",path:"M4 9h12v4.5a5.5 5.5 0 0 1-5.5 5.5h-1A5.5 5.5 0 0 1 4 13.5Z M16 10.5h1.2a2.75 2.75 0 0 1 0 5.5H16 M8 3v3 M12 3v3 M3 21.5h14",solid:$({from:[3.4,8.4],segs:[{to:[16.6,8.4]},{to:[16.6,13.4]},{to:[11,19.4],arc:{r:5.8,large:0,sweep:1}},{to:[9,19.4]},{to:[3.4,13.4],arc:{r:5.8,large:0,sweep:1}},{to:[3.4,8.4]}]},ie(17.2,13.25,2.5,270,450,2.4),B([7.8,2.6],[7.8,5.6],2.4),B([12.2,2.6],[12.2,5.6],2.4),B([2.6,21.6],[17.4,21.6],2.6))},{key:"water",label:"Water / drinks",group:"food-drink",path:Ss,solid:"M12 1.2S4 8.9 4 14.5a8 8 0 0 0 16 0c0-5.6-8-13.3-8-13.3Z"},{key:"merch",label:"Merch / shop",group:"food-drink",path:vs,solid:"M8.4 2.8 3.5 5l-1.9 6 4.2 1.4.4-.8v9.4h11.6v-9.4l.4.8 4.2-1.4-1.9-6-4.9-2.2c-.4 1.5-1.8 2.6-3.6 2.6s-3.2-1.1-3.6-2.6Z"},{key:"screen",label:"Screen",group:"facilities",path:[se(2,3.5,20,13.5,2),"M12 17v3.5 M8 20.5h8","M10 7.8v5.9l5-2.95Z"].join(" "),solid:$(N(1.5,3,21,14.4,2.4),V(Y([[9.6,6.7],[16,10.2],[9.6,13.7]])),N(10.6,16.5,2.8,4,0),B([7.4,21],[16.6,21],2.8))},{key:"sound-booth",label:"Sound booth",group:"facilities",path:["M6 3v9 M6 16v5 M12 3v3 M12 10v11 M18 3v10 M18 17v4",J(6,14,2),J(12,8,2),J(18,15,2)].join(" "),solid:$(B([6,2.8],[6,21.2],1.8),B([12,2.8],[12,21.2],1.8),B([18,2.8],[18,21.2],1.8),N(3.2,11.6,5.6,4.8,1.4),N(9.2,5.6,5.6,4.8,1.4),N(15.2,12.6,5.6,4.8,1.4))},{key:"entrance",label:"Entrance",group:"navigation",path:"M11 7V3.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v17a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V17 M2.5 12h13.5 M12.5 8.5 16 12l-3.5 3.5",solid:$(X([[11,6.5],[11,2.6],[21,2.6],[21,21.4],[11,21.4],[11,17.5]],2.6),B([2.8,12],[13.5,12],3.2),Y([[12.6,7.8],[18,12],[12.6,16.2]]))},{key:"exit",label:"Exit",group:"navigation",path:"M13 7V3.5a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v17a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V17 M8 12h13.5 M18 8.5l3.5 3.5-3.5 3.5",solid:$(X([[13,6.5],[13,2.6],[3,2.6],[3,21.4],[13,21.4],[13,17.5]],2.6),B([7.2,12],[17,12],3.2),Y([[16.2,7.8],[21.6,12],[16.2,16.2]]))},{key:"emergency-exit",label:"Emergency exit",group:"navigation",path:[Je(Le(rr,-2,1.4,1.15)),"M15.5 13h6 M19 10.5l2.5 2.5-2.5 2.5"].join(" "),solid:$(Te(Le(rr,-2,1.4,1.15),2.7),B([15.6,13],[19.5,13],2.8),Y([[18.4,9.4],[22.4,13],[18.4,16.6]]))},{key:"stairs",label:"Stairs",group:"navigation",path:Is,solid:"M1.5 22.5h21V2h-7.8v6.4H8.4v6.4H1.5Z"},{key:"elevator",label:"Elevator",group:"navigation",path:[se(3.5,2.5,17,19,2.5),"M8.5 9.5 12 5.5l3.5 4Z M8.5 14.5l3.5 4 3.5-4Z"].join(" "),solid:$(Y([[12,1.6],[19.6,10.2],[4.4,10.2]]),Y([[4.4,13.8],[19.6,13.8],[12,22.4]]))},{key:"parking",label:"Parking",group:"navigation",path:[se(3,3,18,18,3),"M9.5 17V7h3.75a3 3 0 0 1 0 6H9.5"].join(" "),solid:"M6.5 21V3H12a5.5 5.5 0 0 1 0 11h-1.9v7Z M10.1 6.6v3.8H12a1.9 1.9 0 0 0 0-3.8Z"},{key:"wheelchair",label:"Wheelchair access",group:"accessibility",path:Je(ve),solid:$(Te(ve))},{key:"hearing",label:"Hearing assistance",group:"accessibility",path:["M4 9a6 6 0 1 1 12 0c0 3-1.8 4.3-3 5.2-1.1.8-1.6 1.7-1.6 3.1a3.6 3.6 0 0 1-6.2 2.1","M7.5 9a2.5 2.5 0 0 1 5 0c0 1.2-.7 1.9-1.6 2.5","M18.5 5.5a6.5 6.5 0 0 1 0 8"].join(" "),solid:$(ie(10,9,6,180,380,3),X([[15.64,11.05],[12.8,14.3],[11.5,17.2]],3),ie(8.2,17.2,3.3,0,150,3),ie(10,9,2.2,180,400,2.4),ie(13.38,9.5,6.5,322,398,2.6))},{key:"box-office",label:"Box office / tickets",group:"navigation",path:"M3 7.5A1.5 1.5 0 0 1 4.5 6h15A1.5 1.5 0 0 1 21 7.5V10a2 2 0 0 0 0 4v2.5a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 16.5V14a2 2 0 0 0 0-4Z M15 6v2 M15 11v2 M15 16v2",solid:$(ws,V(N(14.1,7,1.8,2.2,.9)),V(N(14.1,10.9,1.8,2.2,.9)),V(N(14.1,14.8,1.8,2.2,.9)))},{key:"escalator",label:"Escalator",group:"navigation",path:"M2.5 17H7l9-9h5.5v4h-4l-9 9h-6Z M11 4.5h.01 M11 8.2v3.3",solid:$(Y([[2,16.4],[6.8,16.4],[15.8,7.4],[22,7.4],[22,12.6],[17.8,12.6],[8.8,21.6],[2,21.6]]),H(11,4.3,2.3),B([11,8],[11,11],2.6))},{key:"ramp",label:"Ramp",group:"navigation",path:"M2.5 19.5h19v-10Z M4.5 13.2 14 8.2 M10.53 7.76 14 8.2l-1.6 3.11",solid:$(Y([[1.6,20.4],[22.4,20.4],[22.4,8.6]]),B([4.2,13.4],[13.2,8.6],2.6),Y([[15.4,7.5],[13.16,11.84],[10.56,6.88]]))},{key:"taxi",label:"Taxi / rideshare",group:"navigation",path:["M9.5 2.5h5V5h-5Z M6.5 11 8 7h8l1.5 4",se(3.5,11,17,6,2),"M6.5 17v2.5 M17.5 17v2.5 M7 14h.01 M17 14h.01"].join(" "),solid:$(N(9,1.8,6,3.4,.8),Y([[6,11.4],[7.6,6.4],[16.4,6.4],[18,11.4]]),N(2.8,10.6,18.4,7,2.2),V(H(6.8,14,1.3)),V(H(17.2,14,1.3)),N(4.8,16,3.6,5.2,1.2),N(15.6,16,3.6,5.2,1.2))},{key:"transit",label:"Bus / transit",group:"navigation",path:[se(4.5,2.5,15,16,3),"M4.5 10.5h15 M9 5.5h6 M7.5 18.5V21 M16.5 18.5V21 M8 14.5h.01 M16 14.5h.01"].join(" "),solid:$(N(4,2,16,17,3.2),V(N(6.2,5.8,11.6,5,1)),V(H(8,14.5,1.3)),V(H(16,14.5,1.3)),N(6,17,3.4,5,1.2),N(14.6,17,3.4,5,1.2))},{key:"bike-parking",label:"Bike parking",group:"navigation",path:[J(6,14.5,4),J(18,14.5,4),"M6 14.5 9 7.5h6.5L18 14.5 M9 7.5l2.5 7H6 M11.5 14.5l4-7 M7.5 6h3 M15.5 7.5 15 5.5h2"].join(" "),solid:$(H(6,14.5,4.9),V(H(6,14.5,2.7)),H(18,14.5,4.9),V(H(18,14.5,2.7)),X([[6,14.5],[9,7.5],[15.5,7.5],[18,14.5]],2.2),X([[9,7.5],[11.5,14.5],[15.5,7.5]],2.2),B([6,14.5],[11.5,14.5],2.2),B([7.2,5.8],[10.6,5.8],2.2),X([[15.4,7.3],[15,5.4],[17.2,5.4]],2.2))},{key:"meeting-point",label:"Meeting point",group:"navigation",path:["M9.5 2.5 12 5l2.5-2.5 M9.5 21.5 12 19l2.5 2.5 M2.5 9.5 5 12l-2.5 2.5 M21.5 9.5 19 12l2.5 2.5",J(10,9.6,1.5),J(14,9.6,1.5),"M7.5 15.5a2.5 2.5 0 0 1 5 0 M11.5 15.5a2.5 2.5 0 0 1 5 0"].join(" "),solid:$(X([[9.4,2.4],[12,5],[14.6,2.4]],2.6),X([[9.4,21.6],[12,19],[14.6,21.6]],2.6),X([[2.4,9.4],[5,12],[2.4,14.6]],2.6),X([[21.6,9.4],[19,12],[21.6,14.6]],2.6),H(9.7,9.3,2.2),H(14.3,9.3,2.2),mr(9.7,16,3),mr(14.3,16,3))},{key:"security",label:"Security / bag check",group:"facilities",path:"M12 2.5 19.5 5.5v6c0 4.6-3.2 8.4-7.5 10-4.3-1.6-7.5-5.4-7.5-10v-6Z M8.5 12l2.5 2.5 4.5-5",solid:$(Ms,V(Y([[7.4,12.2],[9,10.6],[10.9,12.5],[15,8.4],[16.6,10],[10.9,15.7]])))},{key:"lockers",label:"Lockers",group:"facilities",path:[se(3.5,2.5,17,19,1.5),"M12 2.5v19 M6 6h3 M15 6h3 M9.5 11.5v2.5 M14.5 11.5v2.5"].join(" "),solid:$(N(3,2,8.4,20,1.4),V(N(5,5,4.4,1.7,.8)),V(N(8.6,10.8,1.5,3.8,.7)),N(12.6,2,8.4,20,1.4),V(N(14.6,5,4.4,1.7,.8)),V(N(13.9,10.8,1.5,3.8,.7)))},{key:"baby-change",label:"Baby change",group:"facilities",path:"M10 6.5l.8-3.3a1.2 1.2 0 0 1 2.4 0l.8 3.3 M8.5 6.5h7 M9.5 6.5l-.9 2.2a3 3 0 0 0-.1.9V19a2.5 2.5 0 0 0 2.5 2.5h2a2.5 2.5 0 0 0 2.5-2.5V9.6a3 3 0 0 0-.1-.9l-.9-2.2 M8.5 12.5h3 M8.5 16h3",solid:$(Y([[9.6,6.2],[10.6,1.8],[13.4,1.8],[14.4,6.2]]),N(7.6,5.4,8.8,2.6,1),N(7.8,7.4,8.4,15,2.6),V(N(7.8,11.8,3.4,1.5,0)),V(N(7.8,15.4,3.4,1.5,0)))},{key:"prayer-room",label:"Prayer room",group:"facilities",path:[Je(br),"M3 21.5h18"].join(" "),solid:$(Te(br),N(2.4,20.2,19.2,2.6,1.3))},{key:"quiet-room",label:"Quiet room",group:"facilities",path:"M4 9h3.5l5-4v14l-5-4H4Z M15.5 9.5l5 5 M20.5 9.5l-5 5",solid:$(Y([[2.6,8.4],[7.2,8.4],[13,3.6],[13,20.4],[7.2,15.6],[2.6,15.6]]),B([15.4,9.2],[20.8,14.8],2.8),B([20.8,9.2],[15.4,14.8],2.8))},{key:"wifi",label:"Wi-Fi",group:"facilities",path:[Mt(12,19,11.5,218,322),Mt(12,19,7.5,218,322),Mt(12,19,3.5,218,322),"M12 19h.01"].join(" "),solid:$(ie(12,19.2,11,218,322,2.8),ie(12,19.2,6.9,218,322,2.8),H(12,19.2,2.2))},{key:"vip-lounge",label:"VIP lounge",group:"facilities",path:["M6.5 11V7a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v4","M3.5 11.5a1.5 1.5 0 0 1 3 0V14h11v-2.5a1.5 1.5 0 0 1 3 0v6h-17Z","M5.5 17.5V20 M18.5 17.5V20"].join(" "),solid:$(N(6,4,12,8.5,2.2),N(2.4,9.6,4.6,9,2.2),N(17,9.6,4.6,9,2.2),N(6,13.2,12,5.4,.6),B([5,18],[5,20.6],2.4),B([19,18],[19,20.6],2.4))},{key:"accessible-entrance",label:"Accessible entrance",group:"accessibility",path:[Je(Le(ve,.3,5,.62)),"M12.5 3.5H20a1 1 0 0 1 1 1v15a1 1 0 0 1-1 1h-7.5"].join(" "),solid:$(Te(Le(ve,.3,5,.62),2.2),X([[13,2.8],[21.2,2.8],[21.2,21.2],[13,21.2]],2.6))},{key:"assistance-dog",label:"Assistance-dog area",group:"accessibility",path:[Ct(Cs)+"Z","M6 10.8 3.5 7.5","M10.5 10.5V6h4.5l1 2.5"].join(" "),solid:$(Y(ks),B([6.2,11],[3.2,7.2],2.4),X([[10.5,11],[10.5,5.6],[15.2,5.6],[16.2,8.2]],2.2))}],fu=new Map(gn.map(e=>[e.key,e]));var hr=gn;var Os=new Map(hr.map(e=>[e.key,e]));function kt(e){return typeof e=="string"&&Os.has(e)}var bu=hr.map(e=>e.key);var yr=["butt","round","square"],xr=["miter","round","bevel"],hn=["none","arrow"];function yn(e){return e==="line"||e==="polyline"}function me(e){return e.length>=3&&e.every(t=>Number.isFinite(t.x)&&Number.isFinite(t.y))}function Ne(e,t,n){let o=(e.y-t.y)*(n.x-t.x)-(e.x-t.x)*(n.y-t.y);if(Math.abs(o)>1e-7)return!1;let r=(e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y);if(r<-1e-7)return!1;let i=(n.x-t.x)**2+(n.y-t.y)**2;return r<=i+1e-7}function $e(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[r],s=t[o];if(Ne(e,i,s))return!0;i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n}function pe(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function Sr(e,t,n,o){let r=pe(e,t,n),i=pe(e,t,o),s=pe(n,o,e),u=pe(n,o,t);return(r>1e-7&&i<-1e-7||r<-1e-7&&i>1e-7)&&(s>1e-7&&u<-1e-7||s<-1e-7&&u>1e-7)?!0:Math.abs(r)<=1e-7&&Ne(n,e,t)||Math.abs(i)<=1e-7&&Ne(o,e,t)||Math.abs(s)<=1e-7&&Ne(e,n,o)||Math.abs(u)<=1e-7&&Ne(t,n,o)}function Se(e){for(let t=0;t<e.length;t+=1){let n=(t+1)%e.length;for(let o=t+1;o<e.length;o+=1){let r=(o+1)%e.length;if(!(t===o||n===o||r===t)&&Sr(e[t],e[n],e[o],e[r]))return!0}}return!1}function et(e,t){for(let n=0;n<e.length;n+=1)for(let o=0;o<t.length;o+=1)if(Sr(e[n],e[(n+1)%e.length],t[o],t[(o+1)%t.length]))return!0;return $e(e[0],t)||$e(t[0],e)}function vr(e,t){return!t.some((n,o)=>Ne(e,n,t[(o+1)%t.length]))&&$e(e,t)}function Ir(e){let t=e.outlinePath;if(!t?.segments.length)return;let n=i=>Number.isFinite(i.x)&&Number.isFinite(i.y),o=(i,s)=>Math.hypot(i.x-s.x,i.y-s.y);if(!n(t.start))return 0;let r=t.start;for(let i=0;i<t.segments.length;i++){let s=t.segments[i];if(!s||!n(s.end)||o(r,s.end)<=1e-9||s.kind==="bezier"&&(!n(s.control1)||!n(s.control2)))return i;if(s.kind==="arc"){if(!n(s.center)||!Number.isFinite(s.radius)||s.radius<=1e-6)return i;let u=Math.max(1e-4,s.radius*1e-4);if(Math.abs(o(r,s.center)-s.radius)>u||Math.abs(o(s.end,s.center)-s.radius)>u)return i}r=s.end}return o(r,t.start)>1e-4,t.segments.length-1}function As(e,t,n,o){let r=pe(e,t,n),i=pe(e,t,o),s=pe(n,o,e),u=pe(n,o,t);return(r>1e-7&&i<-1e-7||r<-1e-7&&i>1e-7)&&(s>1e-7&&u<-1e-7||s<-1e-7&&u>1e-7)}function wr(e,t){for(let n=0;n<e.length;n+=1)for(let o=0;o<t.length;o+=1)if(As(e[n],e[(n+1)%e.length],t[o],t[(o+1)%t.length]))return!0;return e.some(n=>vr(n,t))||t.some(n=>vr(n,e))}function Mr(e){return e.role!=="reference-focal"||!e.points||!me(e.points)?null:e.points}var Cr=["in","out","both"];function Es(e){return e?.type==="shape"&&e.gate!=null&&typeof e.gate=="object"}function kr(e){return e.type==="row"||e.type==="section"||e.type==="table"||e.type==="booth"||e.type==="gaArea"}function Or(e){return e==="out"?"exit":"entrance"}function Ps(e){return e.floors?.length?e.floors.flatMap(t=>t.objects):e.objects}function Ar(e){let t=new Map;for(let n of Ps(e))Es(n)&&t.set(n.id,n);return t}var xn=(e,t)=>typeof e=="string"&&e===e.normalize("NFKC").trim()&&e.length>=1&&e.length<=t,vn=e=>e===void 0||typeof e=="boolean";function Rs(e){let t=e.gate;if(!t||typeof t!="object")return"has an unreadable gate record";let n=t;return Cr.includes(n.use)?e.kind==="line"||e.kind==="polyline"?"must be a closed shape":e.role!==Or(n.use)?"must be an entrance (in, both) or an exit (out)":xn(e.label,40)?n.opens!==void 0&&!xn(n.opens,40)?`must say when it opens in 1 to ${40} characters`:!vn(n.stepFree)||!vn(n.hideFromBuyers)?"has a step-free or buyer setting that is not on or off":null:`needs a name of 1 to ${40} characters`:"must be used for in, out or both"}function Ls(e){let t=e.route;return!t||typeof t!="object"?"has an unreadable route record":e.kind!=="line"&&e.kind!=="polyline"?"must be a line or path":xn(e.label,40)?vn(t.stepFree)?null:"has a step-free setting that is not on or off":`needs a name of 1 to ${40} characters`}function Sn(e,t,n){let o=ne(e).flatMap(i=>i.objects),r=new Set;for(let i of o)if(i.type==="shape"){if(i.gate!==void 0){r.add(i.id);let s=Rs(i);s&&t.push({severity:"error",code:"invalid-gate",message:`Gate "${i.label??i.id}" ${s}`,objectId:i.id})}if(i.route!==void 0){let s=Ls(i);s&&t.push({severity:"error",code:"invalid-route",message:`Route "${i.label??i.id}" ${s}`,objectId:i.id})}}for(let i of o){if(!kr(i)||i.entranceGateId===void 0)continue;let s=i.entranceGateId;typeof s!="string"||!s.trim()?t.push({severity:"error",code:"invalid-entrance-gate",message:`"${i.label}" has an empty entrance gate`,objectId:i.id}):r.has(s)||n.push({severity:"warning",code:"unknown-entrance-gate",message:`"${i.label}" enters by a gate that is no longer on the map`,objectId:i.id})}}function _r(e,t){if(e.displayLabel!==void 0){let n=e.displayLabel.normalize("NFKC").trim();!(e.type==="row"&&e.displayLabel==="")&&(!n||n!==e.displayLabel||n.length>80)&&t.push({severity:"error",code:"invalid-display-label",message:`${e.type==="gaArea"?"GA area":e.type} "${e.label}" must use a normalized buyer label of 1 to 80 characters`,objectId:e.id})}if(e.displayType!==void 0){let n=e.displayType.normalize("NFKC").trim();(!n||n!==e.displayType||n.length>24)&&t.push({severity:"error",code:"invalid-display-type",message:`${e.type==="gaArea"?"GA area":e.type} "${e.label}" must use a normalized buyer type of 1 to 24 characters`,objectId:e.id})}e.type!=="row"&&Ts(e,t)}var Lr=(e,t)=>typeof e=="string"&&e===e.normalize("NFKC").trim()&&e.length>=1&&e.length<=t;function Ts(e,t){let n=e.type==="gaArea"?"GA area":e.type==="table"?"Table":"Booth",o=(i,s)=>t.push({severity:"error",code:i,message:`${n} "${e.label}" ${s}`,objectId:e.id});e.entrance!==void 0&&!Lr(e.entrance,40)&&o("invalid-entrance","must use a normalized entrance of 1 to 40 characters");let r=e.labelPresentation;if(r!==void 0){let i=r?.labelStyle?.size,s=i!==void 0&&(!Number.isFinite(i)||i<ln||i>un);(!r||typeof r!="object"||r.visible!==void 0&&typeof r.visible!="boolean"||s)&&o("invalid-label-presentation",`has an invalid name-on-map setting (size ${ln}\u2013${un})`)}if(e.type==="table"){let i=lo(e.chairNumbering);i&&o("invalid-chair-numbering",`has invalid chair numbering: ${i}`)}e.type==="booth"&&(e.boothType!==void 0&&!Uo.includes(e.boothType)&&o("invalid-booth-type","must use inline, corner, peninsula or island as its booth type"),e.commercial!==void 0&&(!e.commercial||typeof e.commercial!="object"||Object.keys(e.commercial).some(i=>i!=="note")||e.commercial.note!==void 0&&!Lr(e.commercial.note,160))&&o("invalid-booth-note","must use a normalized buyer note of 1 to 160 characters"))}function Tr(e,t,n,o){let r=e.crop,i=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(e.center?.x)||!Number.isFinite(e.center?.y)||!Number.isFinite(e.width)||e.width<=0||!Number.isFinite(e.opacity)||e.opacity<0||e.opacity>1||e.rotation!==void 0&&!Number.isFinite(e.rotation)||i)&&n.push({severity:"error",code:"invalid-background-placement",message:`The ${t} image has an invalid position, size, opacity, rotation, or crop`,...o?{floorId:o}:{}})}function In(e,t,n,o){let r=e.referenceImage,i=e.backgroundImage;r&&(Tr(r,"reference",t,o),!r.assetId&&!r.url&&t.push({severity:"error",code:"invalid-reference-image",message:"A trace reference must identify a private asset or self-contained image",...o?{floorId:o}:{}})),i&&(Tr(i,i.assetId?"legacy reference":"buyer background",t,o),!i.assetId&&!i.url&&t.push({severity:"error",code:"invalid-buyer-background",message:"A buyer background must contain a renderable image URL",...o?{floorId:o}:{}}),i.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",...o?{floorId:o}:{}})),ho(e)&&t.push({severity:"error",code:"conflicting-reference-images",message:"The canonical reference and legacy asset-backed background identify different private sources",...o?{floorId:o}:{}})}function tt(e){let t=new Set(Re.map(n=>n.key));return!e||/^ref_[0-9a-f-]{36}$/.test(e.assetId)&&!!e.logicalSectionId.trim()&&["user-confirmed","authoritative-source"].includes(e.evidence)&&!!e.sourceDescription.trim()&&(e.derivation===void 0||["explicit-inventory","server-synthesized-from-aggregate"].includes(e.derivation))&&(e.aggregateEvidence===void 0||["user-confirmed","authoritative-source"].includes(e.aggregateEvidence))&&(e.derivation!=="server-synthesized-from-aggregate"||e.evidence==="user-confirmed")&&(e.sectionAssignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(e.sectionAssignmentEvidence))&&e.sectionAssignmentEvidence===void 0==!e.sectionAssignmentSourceDescription?.trim()&&(e.sectionAssignmentSourceDescription?.trim().length??0)<=240&&(e.numberingEvidence===void 0||e.numberingEvidence==="user-confirmed")&&e.numberingEvidence===void 0==!e.numberingSourceDescription?.trim()&&(e.numberingSourceDescription?.trim().length??0)<=240&&(!e.accessibility||e.accessibility.placementDerivation==="server-synthesized-row-edges"&&e.accessibility.groupLogicalSectionIds.length>0&&e.accessibility.groupLogicalSectionIds.length<=100&&new Set(e.accessibility.groupLogicalSectionIds).size===e.accessibility.groupLogicalSectionIds.length&&e.accessibility.groupLogicalSectionIds.includes(e.logicalSectionId)&&e.accessibility.groupLogicalSectionIds.every(n=>!!n.trim()&&n.length<=160)&&["user-confirmed","authoritative-source"].includes(e.accessibility.assignmentEvidence)&&!!e.accessibility.assignmentSourceDescription.trim()&&e.accessibility.assignmentSourceDescription.trim().length<=240&&e.accessibility.counts.length>0&&e.accessibility.counts.length<=Re.length&&new Set(e.accessibility.counts.map(n=>n.type)).size===e.accessibility.counts.length&&e.accessibility.counts.every(n=>t.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 jr(e){let t=e.referenceInventoryExclusion;return!t||typeof t.assetId=="string"&&/^ref_[0-9a-f-]{36}$/.test(t.assetId)&&t.assetId===e.referenceSource?.assetId&&typeof t.logicalSectionId=="string"&&t.logicalSectionId===(e.logicalSectionId??e.id)&&typeof t.reason=="string"&&!!t.reason.trim()&&t.reason.trim().length<=80&&["user-confirmed","authoritative-source"].includes(t.evidence)&&typeof t.sourceDescription=="string"&&!!t.sourceDescription.trim()&&t.sourceDescription.trim().length<=240}function Nr(e){let t=e.referenceCategorySource;return!t||/^ref_[0-9a-f-]{36}$/.test(t.assetId)&&/^#[0-9a-f]{6}$/i.test(t.sourceColor)&&(t.sourceColors===void 0||t.sourceColors.length>0&&t.sourceColors.includes(t.sourceColor)&&new Set(t.sourceColors).size===t.sourceColors.length&&t.sourceColors.every(n=>/^#[0-9a-f]{6}$/i.test(n)&&`${n[1]}${n[3]}${n[5]}`.toLowerCase()===`${t.sourceColor[1]}${t.sourceColor[3]}${t.sourceColor[5]}`.toLowerCase()))&&(t.logicalSectionIds===void 0||t.logicalSectionIds.length>0&&new Set(t.logicalSectionIds).size===t.logicalSectionIds.length&&t.logicalSectionIds.every(n=>!!n.trim()&&n.length<=160))&&(t.assignmentDerivation===void 0||["source-color-class","confirmed-logical-sections"].includes(t.assignmentDerivation))&&t.assignmentEvidence===void 0==!t.assignmentSourceDescription?.trim()&&(t.assignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.assignmentEvidence))&&(t.assignmentSourceDescription?.trim().length??0)<=240&&(t.assignmentDerivation!=="confirmed-logical-sections"||t.assignmentEvidence!==void 0&&!!t.assignmentSourceDescription?.trim())&&t.sourcePaletteColor===void 0==(t.sourcePaletteColorEvidence===void 0)&&t.sourcePaletteColorEvidence===void 0==!t.sourcePaletteColorSourceDescription?.trim()&&(t.sourcePaletteColor===void 0||/^#[0-9a-f]{6}$/i.test(t.sourcePaletteColor))&&(t.sourcePaletteColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.sourcePaletteColorEvidence))&&(t.sourcePaletteColorSourceDescription?.trim().length??0)<=240&&["user-confirmed","authoritative-source"].includes(t.labelEvidence)&&!!t.labelSourceDescription.trim()&&t.labelSourceDescription.trim().length<=240&&e.price!==void 0&&["user-confirmed","authoritative-source"].includes(t.priceEvidence)&&!!t.priceSourceDescription.trim()&&t.priceSourceDescription.trim().length<=240&&t.outputColorEvidence===void 0==!t.outputColorSourceDescription?.trim()&&(t.outputColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.outputColorEvidence))&&(t.outputColorSourceDescription?.trim().length??0)<=240&&(e.color.toLowerCase()===(t.sourcePaletteColor??t.sourceColor).toLowerCase()&&new Set((t.sourceColors??[t.sourceColor]).map(n=>`${n[1]}${n[3]}${n[5]}`.toLowerCase())).size===1||t.outputColorEvidence!==void 0&&["user-confirmed","authoritative-source"].includes(t.outputColorEvidence))}function $r(e){let t=e.referenceDirectSeatImport;return!t||/^ref_[0-9a-f-]{36}$/.test(t.assetId)&&/^source-color:(?:#[0-9a-f]{6}(?:\+#[0-9a-f]{6})*|unclassified)$/i.test(t.familyId)}function Fr(e,t){let n=e.floors?.length?e.floors.map(i=>({id:i.id,objects:i.objects})):[{id:"floor-0",objects:e.objects}],o=new Map,r=new Map;for(let i of n){let s=i.objects.filter(d=>d.type==="row"),u=new Map,l=new Map;for(let d of s){if(d.segmentedRow){let c=u.get(d.segmentedRow.groupId)??[];c.push(d),u.set(d.segmentedRow.groupId,c)}if(d.rowBlockGeneration){let c=l.get(d.rowBlockGeneration.groupId)??[];c.push(d),l.set(d.rowBlockGeneration.groupId,c)}d.segmentedRow&&d.rowBlockGeneration&&t.push({severity:"error",code:"invalid-row-group-membership",message:`Row "${d.label}" cannot be both a segmented-row component and a generated row-block member`,objectId:d.id,floorId:i.id})}for(let[d,c]of u){let f=o.get(d);f&&f!==i.id&&t.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${d}" cannot span multiple floors`,objectId:c[0].id,floorId:i.id}),o.set(d,i.id);let b=c.slice().sort((A,P)=>A.segmentedRow.componentIndex-P.segmentedRow.componentIndex),m=b[0]?.segmentedRow,g=m?.componentCount??0,v=m?JSON.stringify({displayLabel:m.displayLabel,repeatLabelOnComponents:m.repeatLabelOnComponents,displayType:m.displayType,labelPresentation:m.labelPresentation,viewFromSeatUrl:m.viewFromSeatUrl,viewFromSeatMeta:m.viewFromSeatMeta,confidenceEvidence:m.confidenceEvidence,smoothing:m.smoothing}):"";m&&g>=2&&g<=64&&b.length===g&&m.boundaryBefore==="start"&&b.every((A,P)=>{let L=A.segmentedRow;return L.kind==="segmented-row-v1"&&L.groupId===d&&L.componentCount===g&&L.componentIndex===P&&(P===0?L.boundaryBefore==="start":L.boundaryBefore!=="start")&&L.displayLabel.normalize("NFKC").trim()===L.displayLabel&&L.displayLabel.length>0&&L.displayLabel.length<=80&&JSON.stringify({displayLabel:L.displayLabel,repeatLabelOnComponents:L.repeatLabelOnComponents,displayType:L.displayType,labelPresentation:L.labelPresentation,viewFromSeatUrl:L.viewFromSeatUrl,viewFromSeatMeta:L.viewFromSeatMeta,confidenceEvidence:L.confidenceEvidence,smoothing:L.smoothing})===v})||t.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${d}" has missing, duplicated, cyclic, or inconsistent component metadata`,objectId:c[0]?.id,floorId:i.id})}for(let[d,c]of l){let f=r.get(d);f&&f!==i.id&&t.push({severity:"error",code:"invalid-row-block-generation",message:"A generated row block cannot span multiple floors",objectId:c[0].id,floorId:i.id}),r.set(d,i.id)}}}function Dr(e,t){let n=(i,s)=>t.push({severity:"error",code:i,message:`GA area "${e.label}" ${s}`,objectId:e.id});e.bookAsWhole!==void 0&&typeof e.bookAsWhole!="boolean"&&n("invalid-ga-booking","has an invalid whole-area setting"),e.variableOccupancy!==void 0&&typeof e.variableOccupancy!="boolean"&&n("invalid-ga-booking","has an invalid party-size setting"),e.bookAsWhole===!0&&e.variableOccupancy===!0&&n("invalid-ga-booking","cannot be sold whole and by party size at the same time");let o=fe(e);if(o&&e.inventorySegments!==void 0&&n("invalid-ga-booking","was joined from other areas and must be sold per person, not as one box"),o&&e.capacity>ye&&n("invalid-ga-booking",`is sold to one party but holds ${e.capacity} guests; at most ${ye} can book in one go`),o&&de(e.label)&&n("reserved-seat-label",`uses SeatLayer's reserved GA namespace for its box label "${e.label}"`),o==="variable"){let i=e.minOccupancy,s=e.maxOccupancy;(!Number.isInteger(i)||!Number.isInteger(s)||i<1||s<i||s>e.capacity)&&n("invalid-ga-occupancy",`needs whole-number fewest and most guests from 1 to its ${e.capacity}-person capacity`)}else(e.minOccupancy!==void 0||e.maxOccupancy!==void 0)&&n("invalid-ga-occupancy","has guest bounds without party-size selling");let r=e.wheelchairPlaces;r!==void 0&&(!Number.isInteger(r)||r<0||r>e.capacity)&&n("invalid-ga-wheelchair-places",`must have from 0 to ${e.capacity} wheelchair places`)}function Br(e){return e==="m"||e==="ft"}function _s(e){return e==="ft"?.3048:1}function Ot(e,t){return e/_s(t)}var js=e=>Math.abs(e)<1e-9?0:e;function At(e,t="m"){let n=js(Ot(e,t)),o=Math.abs(n);return t==="ft"?o<100?`${n.toFixed(1)} ft`:`${Math.round(n)} ft`:o<1?`${n.toFixed(2)} m`:o<100?`${n.toFixed(1)} m`:`${Math.round(n)} m`}var Ns=.5,$s=5e3,Fs=e=>typeof e=="number"&&Number.isFinite(e),Ds=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Gr(e){let t=e?.designerSettings;return Ds(t)?t:null}function Et(e){let t=Gr(e)?.units;return Br(t)?t:"m"}function nt(e){let t=Gr(e)?.unitsPerMetre;return Fs(t)&&t>=Ns&&t<=$s?t:null}function wn(e,t){let n=t/(nt(e)??ze),o=Et(e);return o==="ft"&&Ot(n,"ft")<.1?`${Ot(n,"ft").toFixed(2)} ft`:At(n,o)}function Gs(e){return e.type==="row"||e.type==="table"||e.type==="booth"}function Us(e){let t=[],n=new Map((e.overrides??[]).map(o=>[o.index,o]));for(let o=0;o<e.seatCount;o++){let r=n.get(o);r?.skip||t.push({label:pt(e,o,r),index:o})}return t}function Ur(e){let t=[],n=new Map((e.overrides??[]).map(o=>[o.index,o]));for(let o=0;o<e.seatCount;o++){let r=n.get(o);r?.skip||t.push({label:r?.label??`${e.label}-${o+1}`,index:o})}return t}function Mn(e){return Array.isArray(e)&&e.every(t=>!!t&&typeof t=="object")}function Cn(e){return Array.isArray(e)&&e.every(t=>Array.isArray(t)&&t.every(n=>!!n&&typeof n=="object"))}function Kr(e,t={}){let n=t.maxInventory??1e5,o=[];e.floorOverview!==void 0&&e.floorOverview!=="combined"&&e.floorOverview!=="separated"&&o.push({severity:"error",code:"invalid-floor-overview",message:"Whole venue view must be Combined plan or Separate levels"}),e.eventConfigurationId!==void 0&&(typeof e.eventConfigurationId!="string"||e.eventConfigurationId.normalize("NFKC").trim()!==e.eventConfigurationId||e.eventConfigurationId.length<1||e.eventConfigurationId.length>100)&&o.push({severity:"error",code:"invalid-event-configuration",message:"Active event configuration must contain 1 to 100 normalized characters"});let r=[],i=new Set(e.categories.map(a=>a.key)),s=new Set(Re.map(a=>a.key)),u=new Map(e.categories.map(a=>[a.key,qo(a)])),l=new Set;In(e,o,r),Sn(e,o,r),e.theme?.sectionDetail!==void 0&&!["rows","seats"].includes(e.theme.sectionDetail)&&o.push({severity:"error",code:"invalid-section-detail",message:"Section detail must be rows or seats"}),e.theme?.logoUrl!==void 0&&!Zt(e.theme.logoUrl)&&o.push({severity:"error",code:"invalid-theme-logo-url",message:"The buyer-facing theme logo URL is invalid"});let d=Zt,c=(a,_,p,h={})=>{if(_===void 0)return;if(!_||typeof _!="object"||Array.isArray(_)){o.push({severity:"error",code:"invalid-seat-view-metadata",message:`${p} view metadata is invalid`,...h});return}let x=_;a||r.push({severity:"warning",code:"orphaned-seat-view-metadata",message:`${p} view metadata has no image`,...h});let T=new Set(["exact-seat","row-representative","section-representative","floor-representative","venue-representative"]);x.projection!==void 0&&x.projection!=="equirectangular"&&o.push({severity:"error",code:"invalid-seat-view-projection",message:`${p} view projection must be equirectangular`,...h}),x.coverage!==void 0&&!T.has(x.coverage)&&o.push({severity:"error",code:"invalid-seat-view-coverage",message:`${p} view coverage is invalid`,...h});let E=(C,R,j)=>typeof C=="number"&&Number.isFinite(C)&&C>=R&&C<=j;if(x.initialBearingDeg!==void 0&&!E(x.initialBearingDeg,-360,360)&&o.push({severity:"error",code:"invalid-seat-view-bearing",message:`${p} view bearing must be between -360\xB0 and 360\xB0`,...h}),x.initialPitchDeg!==void 0&&!E(x.initialPitchDeg,-90,90)&&o.push({severity:"error",code:"invalid-seat-view-pitch",message:`${p} view pitch must be between -90\xB0 and 90\xB0`,...h}),x.capturedAt!==void 0&&(typeof x.capturedAt!="string"||x.capturedAt.length>40||!Number.isFinite(Date.parse(x.capturedAt)))&&o.push({severity:"error",code:"invalid-seat-view-capture-date",message:`${p} view capture date is invalid`,...h}),x.sourceLabel!==void 0&&(typeof x.sourceLabel!="string"||x.sourceLabel.trim().length>100)&&o.push({severity:"error",code:"invalid-seat-view-source",message:`${p} view source label is invalid`,...h}),x.previewUrl!==void 0&&!d(x.previewUrl)&&o.push({severity:"error",code:"invalid-seat-view-preview-url",message:`${p} view preview URL is invalid`,...h}),x.variants!==void 0){let C=Array.isArray(x.variants)?x.variants:[];if(!Array.isArray(x.variants)||C.length<1||C.length>4)o.push({severity:"error",code:"invalid-seat-view-variants",message:`${p} view variants must contain between 1 and 4 tiers`,...h});else{let R=new Set;for(let j of C){if(!j||typeof j!="object"||!d(j.url)||!Number.isInteger(j.width)||j.width<1||j.width>12e3||!Number.isInteger(j.height)||j.height<1||j.height>12e3||j.width!==j.height*2||typeof j.sha256!="string"||!/^[a-f0-9]{64}$/.test(j.sha256)||R.has(j.width)){o.push({severity:"error",code:"invalid-seat-view-variant",message:`${p} view variant is not a unique immutable 2:1 equirectangular tier`,...h});break}R.add(j.width)}}}for(let[C,R]of[["width",x.sourceWidth],["height",x.sourceHeight],["preview width",x.previewWidth],["preview height",x.previewHeight]])R!==void 0&&(!Number.isInteger(R)||R<1||R>32768)&&o.push({severity:"error",code:"invalid-seat-view-dimensions",message:`${p} view source ${C} is invalid`,...h});x.captureEyeHeightM!==void 0&&!E(x.captureEyeHeightM,.5,3)&&o.push({severity:"error",code:"invalid-seat-view-eye-height",message:`${p} capture eye height must be between 0.5 m and 3 m`,...h}),x.eventConfigurationId!==void 0&&(typeof x.eventConfigurationId!="string"||!x.eventConfigurationId.trim()||x.eventConfigurationId.length>100)&&o.push({severity:"error",code:"invalid-seat-view-configuration",message:`${p} event configuration id is invalid`,...h}),x.eventConfigurationVersion!==void 0&&(!Number.isInteger(x.eventConfigurationVersion)||x.eventConfigurationVersion<1)&&o.push({severity:"error",code:"invalid-seat-view-configuration-version",message:`${p} event configuration version is invalid`,...h}),x.eventConfigurationVersion!==void 0&&!x.eventConfigurationId&&o.push({severity:"error",code:"invalid-seat-view-configuration-pin",message:`${p} event configuration version requires an id`,...h})},f=(a,_,p={})=>{if(a===void 0)return;let h=R=>{o.push({severity:"error",code:"invalid-seat-confidence-evidence",message:`${_} confidence evidence ${R}`,...p})};if(!a||typeof a!="object"||Array.isArray(a)){h("is invalid");return}let x=a;x.schema!=="seatlayer.seat-confidence/1"&&h("has an unsupported schema");let T=(R,j)=>typeof R=="string"&&R.normalize("NFKC").trim()===R&&R.length>0&&R.length<=j;T(x.evidenceId,120)||h("has an invalid evidence id"),T(x.modelVersion,120)||h("has an invalid model version"),new Set(["synthetic-model","organizer-approved","calibrated-provider"]).has(x.evidenceKind)||h("has an invalid evidence kind"),new Set(["generated","geometry-verified","configuration-verified"]).has(x.modelLevel)||h("has an invalid model level");let E=x.realityLevel??"none";new Set(["none","comparable-build-reference","actual-build-checked"]).has(E)||h("has an invalid reality level"),x.eventConfigurationId!==void 0&&!T(x.eventConfigurationId,100)&&h("has an invalid event configuration id"),x.eventConfigurationVersion!==void 0&&(!Number.isInteger(x.eventConfigurationVersion)||x.eventConfigurationVersion<1)&&h("has an invalid event configuration version"),x.status!==void 0&&!new Set(["draft","approved","retracted"]).has(x.status)&&h("has an invalid publication status"),x.basisSha256!==void 0&&!/^[a-f0-9]{64}$/.test(x.basisSha256)&&h("has an invalid venue basis SHA-256"),x.basisSha256!==void 0&&x.status!=="approved"&&h("can carry a venue basis SHA-256 only after approval");for(let[R,j]of[["assessment",x.assessedAt],["expiry",x.validUntil]])j!==void 0&&(!T(j,40)||!Number.isFinite(Date.parse(j)))&&h(`has an invalid ${R} date`);x.approvedByRole!==void 0&&!T(x.approvedByRole,100)&&h("has an invalid approving organization or role"),x.sourceLabel!==void 0&&!T(x.sourceLabel,120)&&h("has an invalid source label"),x.limitations!==void 0&&(!Array.isArray(x.limitations)||x.limitations.length>6||x.limitations.some(R=>!T(R,160)))&&h("has invalid limitations"),x.evidenceKind==="synthetic-model"&&(x.modelLevel!=="generated"||E!=="none")&&h("cannot describe synthetic data as verified or reality checked"),x.modelLevel!=="generated"&&(!x.assessedAt||!x.approvedByRole)&&h("requires an assessment date and approving organization or role for verified model levels"),x.modelLevel==="configuration-verified"&&!x.eventConfigurationId&&h("requires an event configuration id for configuration verification"),E!=="none"&&(!x.assessedAt||!x.sourceLabel)&&h("requires an assessment date and source for reality evidence"),E==="actual-build-checked"&&(x.modelLevel!=="configuration-verified"||!x.eventConfigurationId)&&h("requires a configuration-verified model and event configuration for an actual-build check");let C=x.modeledTarget;C!==void 0&&(!C||typeof C!="object"||Array.isArray(C)?h("has an invalid modeled target"):((!T(C.label,80)||!T(C.methodLabel,100))&&h("has invalid modeled-target labels"),(!Number.isInteger(C.totalRayCount)||C.totalRayCount<1||C.totalRayCount>1e3||!Number.isInteger(C.clearRayCount)||C.clearRayCount<0||C.clearRayCount>C.totalRayCount)&&h("has invalid modeled-target ray counts"),new Set(["clear","partial","obstructed"]).has(C.classification)||h("has an invalid modeled-target classification"),C.occluderLabels!==void 0&&(!Array.isArray(C.occluderLabels)||C.occluderLabels.length>10||C.occluderLabels.some(R=>!T(R,100)))&&h("has invalid modeled-target occluders")))};c(e.viewFromSeatUrl,e.viewFromSeatMeta,"Venue"),f(e.confidenceEvidence,"Venue"),e.viewFromSeatUrl!==void 0&&!d(e.viewFromSeatUrl)&&o.push({severity:"error",code:"invalid-venue-view-url",message:"The whole-venue view-from-seat image URL is invalid"});for(let a of e.floors??[])a.viewFromSeatUrl!==void 0&&!d(a.viewFromSeatUrl)&&o.push({severity:"error",code:"invalid-floor-view-url",message:`Floor "${a.name}" has an invalid view-from-seat image URL`}),c(a.viewFromSeatUrl,a.viewFromSeatMeta,`Floor "${a.name}"`,{floorId:a.id}),f(a.confidenceEvidence,`Floor "${a.name}"`,{floorId:a.id});let b=e.floors?.length?e.floors.flatMap(a=>a.objects):e.objects;for(let a of b)if((a.type==="row"||a.type==="section")&&(a.viewFromSeatUrl!==void 0&&!d(a.viewFromSeatUrl)&&o.push({severity:"error",code:a.type==="row"?"invalid-row-view-url":"invalid-section-view-url",message:`${a.type==="row"?"Row":"Section"} "${a.label}" has an invalid view-from-seat image URL`,objectId:a.id}),c(a.viewFromSeatUrl,a.viewFromSeatMeta,`${a.type==="row"?"Row":"Section"} "${a.label}"`,{objectId:a.id}),f(a.confidenceEvidence,`${a.type==="row"?"Row":"Section"} "${a.label}"`,{objectId:a.id})),a.type==="row"&&a.segmentedRow&&(a.segmentedRow.viewFromSeatUrl!==void 0&&!d(a.segmentedRow.viewFromSeatUrl)&&o.push({severity:"error",code:"invalid-segmented-row-view-url",message:`Segmented row "${a.segmentedRow.displayLabel}" has an invalid view-from-seat image URL`,objectId:a.id}),c(a.segmentedRow.viewFromSeatUrl,a.segmentedRow.viewFromSeatMeta,`Segmented row "${a.segmentedRow.displayLabel}"`,{objectId:a.id}),f(a.segmentedRow.confidenceEvidence,`Segmented row "${a.segmentedRow.displayLabel}"`,{objectId:a.id})),a.type==="row"||a.type==="table")for(let _ of a.overrides??[])_.viewFromSeatUrl!==void 0&&!d(_.viewFromSeatUrl)&&o.push({severity:"error",code:"invalid-seat-view-url",message:`Seat ${_.index+1} has an invalid view-from-seat image URL`,objectId:a.id,seatIndices:[_.index]}),c(_.viewFromSeatUrl,_.viewFromSeatMeta,`Seat ${_.index+1}`,{objectId:a.id,seatIndices:[_.index]}),f(_.confidenceEvidence,`Seat ${_.index+1}`,{objectId:a.id,seatIndices:[_.index]});let m=new Set;for(let a of e.categories){m.has(a.key)&&o.push({severity:"error",code:"duplicate-category-key",message:`Category key "${a.key}" is used more than once`,categoryKey:a.key}),m.add(a.key);let _=new Set;for(let p of a.tiers??[]){if(_.has(p.id)&&o.push({severity:"error",code:"duplicate-category-tier-id",message:`Ticket tier id "${p.id}" is used more than once in category "${a.key}"`,categoryKey:a.key}),p.restriction!=null&&!["companion","child","senior","student","membership","custom"].includes(p.restriction)&&o.push({severity:"error",code:"invalid-category-tier-restriction",message:`Ticket tier "${p.name}" has an unknown restriction`,categoryKey:a.key}),p.buyerMessage!=null&&(!p.buyerMessage.trim()||p.buyerMessage.length>240)&&o.push({severity:"error",code:"invalid-category-tier-buyer-message",message:`Ticket tier "${p.name}" buyer guidance must contain 1 to 240 characters`,categoryKey:a.key}),p.currency!=null&&!/^[A-Z]{3}$/.test(p.currency)&&o.push({severity:"error",code:"invalid-category-tier-currency",message:`Ticket tier "${p.name}" must use a three-letter ISO currency`,categoryKey:a.key}),p.applicability!=null){let h=p.applicability.seatLabels,x=p.applicability.accessibility;(h!==void 0&&(!Array.isArray(h)||!h.length||h.length>1e4||h.some(T=>typeof T!="string"||!T.trim()||T.length>160)||new Set(h).size!==h.length)||x!==void 0&&(!Array.isArray(x)||!x.length||x.some(T=>!s.has(T))||new Set(x).size!==x.length))&&o.push({severity:"error",code:"invalid-category-tier-applicability",message:`Ticket tier "${p.name}" has invalid seat applicability`,categoryKey:a.key})}p.evidence!=null&&(!["public-host","public-event","user-confirmed"].includes(p.evidence.provenance)||!p.evidence.sourceDescription.trim()||p.evidence.sourceDescription.length>240||p.evidence.capturedAt!==void 0&&(p.evidence.capturedAt.length>40||!Number.isFinite(Date.parse(p.evidence.capturedAt))))&&o.push({severity:"error",code:"invalid-category-tier-evidence",message:`Ticket tier "${p.name}" has invalid evidence provenance`,categoryKey:a.key}),_.add(p.id)}Nr(a)||o.push({severity:"error",code:"invalid-reference-category-source",message:`Category ${a.label||a.key} has incomplete or invalid reference evidence`,categoryKey:a.key}),$r(a)||o.push({severity:"error",code:"invalid-reference-direct-seat-import",message:`Category ${a.label||a.key} has invalid direct-seat import provenance`,categoryKey:a.key})}let g=new Map,v=new Map,S=[],A=new Map,P=0,L=0,I=new Set;for(let a of e.floors??[])In(a,o,r,a.id),I.has(a.id)&&o.push({severity:"error",code:"duplicate-floor-id",message:`Floor id "${a.id}" is used more than once`,floorId:a.id}),I.add(a.id),a.baseHeightM!==void 0&&(!Number.isFinite(a.baseHeightM)||a.baseHeightM<ge||a.baseHeightM>ue)&&o.push({severity:"error",code:"invalid-floor-base-height",message:`Floor "${a.name}" base height must be between ${ge} and ${ue} metres`,floorId:a.id});let M=e.floors&&e.floors.length?e.floors.flatMap(a=>a.objects):e.objects;Fr(e,o);let y=new Set;for(let a of M)y.has(a.id)&&o.push({severity:"error",code:"duplicate-object-id",message:`Object id "${a.id}" is used more than once`,objectId:a.id}),y.add(a.id);let w=new Set;for(let a of e.zones??[])w.has(a.id)&&o.push({severity:"error",code:"duplicate-zone-id",message:`Zone id "${a.id}" is used more than once`}),w.add(a.id),a.focalPoint!==void 0&&(!Number.isFinite(a.focalPoint.x)||!Number.isFinite(a.focalPoint.y))&&o.push({severity:"error",code:"invalid-zone-focal-point",message:`Zone "${a.label}" must use a finite focal point`});let O=new Map;for(let a of M)if(!(a.type!=="section"||!a.zone)){if(e.zones?.length&&!w.has(a.zone)){o.push({severity:"error",code:"unknown-section-zone",message:`Section "${a.displayLabel??a.label}" references unknown zone "${a.zone}"`,objectId:a.id});continue}O.has(a.zone)||O.set(a.zone,a)}for(let[a,_]of O){let p=e.zones?.find(h=>h.id===a);p&&(p?.focalPoint||r.push({severity:"warning",code:"missing-zone-focal-point",message:`Zone "${p?.label??a}" uses the legacy floor focal; set its own focal point before publishing`,objectId:_.id}))}for(let a of M)if((a.type==="row"||a.type==="table"||a.type==="booth"||a.type==="gaArea")&&_r(a,o),Gs(a)){if(P++,L+=a.type==="booth"?1:a.type==="row"?xt(a):a.bookAsWhole||a.variableOccupancy?a.seatCount:Ur(a).length,g.get(a.label)!==void 0?a.type!=="row"&&o.push({severity:"error",code:"duplicate-object-label",message:`Label "${a.label}" is used by more than one object`,objectId:a.id}):g.set(a.label,a.id),i.has(a.categoryKey)?l.add(a.categoryKey):o.push({severity:"error",code:"unknown-category",message:`"${a.label}" references unknown category "${a.categoryKey}"`,objectId:a.id,categoryKey:a.categoryKey}),a.type==="row"){tt(a.referenceInventorySource)||o.push({severity:"error",code:"invalid-reference-inventory-source",message:`Row "${a.label}" has invalid reference-inventory provenance`,objectId:a.id}),a.seatCount<1&&o.push({severity:"error",code:"empty-row",message:`Row "${a.label}" has no seats`,objectId:a.id}),a.aisleSeats!==void 0&&!nr(a.aisleSeats)&&o.push({severity:"error",code:"invalid-row-aisle-seats",message:`Row "${a.label}" must mark its aisle seats at the start, end, both or none`,objectId:a.id});let p=new Set;for(let h of a.overrides??[]){(h.accessibility??[]).filter(C=>!s.has(C)).length&&o.push({severity:"error",code:"invalid-accessibility-type",message:`Row "${a.label}" seat ${h.index+1} uses an unknown accessibility type`,objectId:a.id,seatIndices:[h.index]}),(!Number.isInteger(h.index)||h.index<0||h.index>=a.seatCount||p.has(h.index))&&o.push({severity:"error",code:"invalid-seat-override",message:`Row "${a.label}" has a duplicated or out-of-range seat override`,objectId:a.id,...Number.isInteger(h.index)?{seatIndices:[h.index]}:{}}),p.add(h.index);let T=h.wheelchairSpaceType,E=h.accessible===!0||h.accessibility?.includes("wheelchair");T!==void 0&&T!=="seat-present"&&T!=="no-seat"?o.push({severity:"error",code:"invalid-wheelchair-space",message:`Row "${a.label}" seat ${h.index+1} has an invalid wheelchair-space type`,objectId:a.id,seatIndices:[h.index]}):T&&(!E||h.skip)&&o.push({severity:"error",code:"invalid-wheelchair-space",message:h.skip?`Row "${a.label}" seat ${h.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Row "${a.label}" seat ${h.index+1} must include wheelchair accessibility for its physical-space type`,objectId:a.id,seatIndices:[h.index]})}for(let h of Us(a))de(h.label)&&o.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${h.label}" uses SeatLayer's reserved GA namespace`,objectId:a.id,seatIndices:[h.index]}),v.get(h.label)!==void 0?S.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${h.label}" is used more than once`,objectId:a.id,seatIndices:[h.index]}):v.set(h.label,a.id)}else if(a.type==="table"){let p=a.bookAsWhole===!0||a.variableOccupancy===!0;if(a.fill!==void 0&&!Fo(a.fill)&&o.push({severity:"error",code:"invalid-table-fill",message:`Table "${a.label}" has an invalid surface color`,objectId:a.id}),a.automaticRadius!==void 0&&typeof a.automaticRadius!="boolean"?o.push({severity:"error",code:"invalid-table-automatic-radius",message:`Table "${a.label}" has an invalid automatic-radius setting`,objectId:a.id}):a.automaticRadius===!0&&(a.shape!=="round"||a.radius!==yo(a.seatCount,a.seatArc))&&o.push({severity:"error",code:"invalid-table-automatic-radius",message:`Table "${a.label}" needs a radius that matches its automatic chair spacing`,objectId:a.id}),a.seatCountsBySide){let E=["top","bottom","left","right"],C=Object.keys(a.seatCountsBySide),R=E.every(G=>Number.isInteger(a.seatCountsBySide[G])&&a.seatCountsBySide[G]>=0&&a.seatCountsBySide[G]<=40),j=R?E.reduce((G,Z)=>G+a.seatCountsBySide[Z],0):Number.NaN;(a.shape!=="rect"||C.length!==E.length||C.some(G=>!E.includes(G))||!R||j!==a.seatCount||j<1||j>40)&&o.push({severity:"error",code:"invalid-table-side-counts",message:`Table "${a.label}" needs top, bottom, left, and right whole-number chair counts totaling its ${a.seatCount}-chair capacity`,objectId:a.id})}p&&a.overrides?.length&&o.push({severity:"error",code:"grouped-table-chair-overrides",message:`Grouped table "${a.label}" cannot carry individual-chair overrides`,objectId:a.id,seatIndices:a.overrides.map(E=>E.index)});let h=new Set;for(let E of a.overrides??[]){(E.accessibility??[]).filter(G=>!s.has(G)).length&&o.push({severity:"error",code:"invalid-accessibility-type",message:`Table "${a.label}" chair ${E.index+1} uses an unknown accessibility type`,objectId:a.id,seatIndices:[E.index]}),(!Number.isInteger(E.index)||E.index<0||E.index>=a.seatCount||h.has(E.index))&&o.push({severity:"error",code:"invalid-seat-override",message:`Table "${a.label}" has a duplicated or out-of-range chair override`,objectId:a.id,...Number.isInteger(E.index)?{seatIndices:[E.index]}:{}}),h.add(E.index),E.categoryKey&&!i.has(E.categoryKey)?o.push({severity:"error",code:"unknown-category",message:`Table "${a.label}" chair ${E.index+1} references unknown category "${E.categoryKey}"`,objectId:a.id,seatIndices:[E.index],categoryKey:E.categoryKey}):E.categoryKey&&l.add(E.categoryKey);let R=E.wheelchairSpaceType,j=E.accessible===!0||E.accessibility?.includes("wheelchair");R!==void 0&&R!=="seat-present"&&R!=="no-seat"?o.push({severity:"error",code:"invalid-wheelchair-space",message:`Table "${a.label}" chair ${E.index+1} has an invalid wheelchair-space type`,objectId:a.id,seatIndices:[E.index]}):R&&(!j||E.skip)&&o.push({severity:"error",code:"invalid-wheelchair-space",message:E.skip?`Table "${a.label}" chair ${E.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Table "${a.label}" chair ${E.index+1} must include wheelchair accessibility for its physical-space type`,objectId:a.id,seatIndices:[E.index]})}a.bookAsWhole&&a.variableOccupancy?o.push({severity:"error",code:"invalid-table-booking-mode",message:`Table "${a.label}" cannot be sold both as a whole table and with variable occupancy`,objectId:a.id}):a.variableOccupancy?(!Number.isInteger(a.minOccupancy)||!Number.isInteger(a.maxOccupancy)||a.minOccupancy<1||a.maxOccupancy<a.minOccupancy||a.maxOccupancy>a.seatCount)&&o.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${a.label}" needs whole-number minimum and maximum guests from 1 to its ${a.seatCount}-chair capacity`,objectId:a.id}):(a.minOccupancy!=null||a.maxOccupancy!=null)&&o.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${a.label}" has guest bounds without variable-occupancy selling`,objectId:a.id}),tt(a.referenceInventorySource)||o.push({severity:"error",code:"invalid-reference-inventory-source",message:`Table "${a.label}" has invalid reference-inventory provenance`,objectId:a.id}),(a.shape==="round"&&a.radius==null||a.shape==="rect"&&(a.width==null||a.height==null)||a.seatCount<1)&&o.push({severity:"error",code:"bad-table",message:`Table "${a.label}" is missing required dimensions or seats`,objectId:a.id});let T=p?[{label:a.label,index:void 0}]:Ur(a);for(let E of T)de(E.label)&&o.push({severity:"error",code:"reserved-seat-label",message:`Inventory label "${E.label}" uses SeatLayer's reserved GA namespace`,objectId:a.id}),v.get(E.label)!==void 0?S.push({severity:"error",code:"duplicate-seat-label",message:`Inventory label "${E.label}" is used more than once; grouped table labels must be unique`,objectId:a.id,...E.index===void 0?{}:{seatIndices:[E.index]}}):v.set(E.label,a.id)}else if(a.type==="booth"){tt(a.referenceInventorySource)||o.push({severity:"error",code:"invalid-reference-inventory-source",message:`Booth "${a.label}" has invalid reference-inventory provenance`,objectId:a.id});let p=a.label;de(p)&&o.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${p}" uses SeatLayer's reserved GA namespace`,objectId:a.id}),v.get(p)!==void 0?S.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${p}" is used more than once`,objectId:a.id}):v.set(p,a.id)}}else if(a.type==="gaArea"){if(Dr(a,o),!St(a))o.push({severity:"error",code:"invalid-ga-inventory-segments",message:`GA area "${a.label}" has invalid joined-area inventory provenance`,objectId:a.id});else for(let h of rn(a))v.get(h)!==void 0?S.push({severity:"error",code:"duplicate-seat-label",message:`GA inventory label "${h}" is used more than once`,objectId:a.id}):v.set(h,a.id);if(tt(a.referenceInventorySource)||o.push({severity:"error",code:"invalid-reference-inventory-source",message:`GA area "${a.label}" has invalid reference-inventory provenance`,objectId:a.id}),!Mn(a.points)){o.push({severity:"error",code:"invalid-polygon-points",message:`GA area "${a.label}" outline must be a list of points`,objectId:a.id});continue}(!me(a.points)||Math.abs(xe(a.points))<=1e-7||Se(a.points))&&o.push({severity:"error",code:"invalid-ga-outline",message:`GA area "${a.label}" must have a finite, non-self-intersecting polygon outline`,objectId:a.id});let p=a.holes??[];if(!Cn(p))o.push({severity:"error",code:"invalid-hole-collection",message:`GA area "${a.label}" cutouts must be a list of point lists`,objectId:a.id});else{let h=p.length<=64?p.findIndex(x=>x.length>512||!me(x)||Math.abs(xe(x))<=1e-7||Se(x)?!0:!x.flatMap((E,C)=>{let R=x[(C+1)%x.length];return[E,{x:(E.x+R.x)/2,y:(E.y+R.y)/2}]}).every(E=>$e(E,a.points))):0;if(h>=0)o.push({severity:"error",code:"invalid-ga-hole",message:`GA area "${a.label}" has a cutout outside its outline or with invalid geometry`,objectId:a.id,holeIndex:h});else if(p.some((x,T)=>p.slice(T+1).some(E=>et(x,E)))){let x=p.findIndex((T,E)=>p.slice(E+1).some(C=>et(T,C)));o.push({severity:"error",code:"overlapping-ga-holes",message:`GA area "${a.label}" has overlapping cutout polygons`,objectId:a.id,holeIndex:x})}}i.has(a.categoryKey)?l.add(a.categoryKey):o.push({severity:"error",code:"unknown-category",message:`"${a.label}" references unknown category "${a.categoryKey}"`,objectId:a.id,categoryKey:a.categoryKey}),a.capacity<1&&o.push({severity:"error",code:"empty-ga",message:`GA area "${a.label}" has zero capacity`,objectId:a.id}),(!Number.isInteger(a.capacity)||a.capacity>he)&&o.push({severity:"error",code:"invalid-ga-capacity",message:`GA area "${a.label}" capacity must be a whole number from 1 to ${he}`,objectId:a.id}),P++,L+=Math.max(0,Math.floor(a.capacity))}else if(a.type==="section"){if(a.displayLabel!==void 0){let h=a.displayLabel.normalize("NFKC").trim();h?(h!==a.displayLabel||h.length>80)&&o.push({severity:"error",code:"invalid-display-label",message:`Section "${a.label}" must use a normalized buyer label of 1 to 80 characters`,objectId:a.id}):o.push({severity:"error",code:"unnamed-section",message:`${a.label} has no buyer name`,objectId:a.id})}if(a.editor?.defaultCategoryKey&&!i.has(a.editor.defaultCategoryKey)&&o.push({severity:"error",code:"unknown-category",message:`Section "${a.label}" references unknown future-seat category "${a.editor.defaultCategoryKey}"`,objectId:a.id}),a.elevation!==void 0&&(!Number.isInteger(a.elevation)||a.elevation<Xt||a.elevation>Ae)){let h=Number.isInteger(a.elevation)&&a.elevation>Ae&&a.elevation<=Yt;r.push({severity:"warning",code:h?"legacy-section-elevation":"invalid-section-elevation",message:h?`Section "${a.label}" uses legacy tier ${a.elevation}; set an exact height before normalizing it to tier ${Ae}`:`Section "${a.label}" elevation must be a whole-number tier from ${Xt} to ${Ae}`,objectId:a.id})}if(a.height!==void 0&&(!Number.isFinite(a.height)||a.height<ge||a.height>ue)&&o.push({severity:"error",code:"invalid-section-height",message:`Section "${a.label}" exact height must be between ${ge} and ${ue} metres`,objectId:a.id}),a.rake!==void 0&&(!Number.isFinite(a.rake)||a.rake<mt||a.rake>bt)&&o.push({severity:"error",code:"invalid-section-rake",message:`Section "${a.label}" rake must be between ${mt}\xB0 and ${bt}\xB0`,objectId:a.id}),a.surfaceKind!==void 0&&a.surfaceKind!=="flat"&&a.surfaceKind!=="rakedRows"&&o.push({severity:"error",code:"invalid-section-surface-kind",message:`Section "${a.label}" surfaceKind must be 'flat' or 'rakedRows'`,objectId:a.id}),!Mn(a.outline)){o.push({severity:"error",code:"invalid-polygon-points",message:`Section "${a.label}" outline must be a list of points`,objectId:a.id});continue}if(!me(a.outline)||Math.abs(xe(a.outline))<=1e-7||Se(a.outline)){o.push({severity:"error",code:"invalid-section-outline",message:`Section "${a.label}" must have a finite, non-self-intersecting polygon outline`,objectId:a.id});continue}if(a.outlinePath){let h=[];try{h=ut(a.outlinePath)}catch{}(!lt(a.outlinePath)||!h.length||Math.hypot(a.outlinePath.start.x-a.outline[0].x,a.outlinePath.start.y-a.outline[0].y)>1e-4||!me(h)||Math.abs(xe(h))<=1e-7||Se(h))&&o.push({severity:"error",code:"invalid-section-outline-path",message:`Section "${a.label}" has an invalid or inconsistent curved outline path`,objectId:a.id,edgeIndex:Ir(a)})}if(a.referenceSource&&(!/^ref_[0-9a-f-]{36}$/.test(a.referenceSource.assetId)||!/^(?:reg|ai)_[0-9a-f]{16}$/.test(a.referenceSource.regionId))&&o.push({severity:"error",code:"invalid-section-reference-source",message:`Section "${a.label}" has invalid opaque reference provenance`,objectId:a.id}),jr(a)||o.push({severity:"error",code:"invalid-section-inventory-exclusion",message:`Section "${a.label}" has incomplete or mismatched non-sellable evidence`,objectId:a.id}),a.logicalSectionId!==void 0&&!a.logicalSectionId.trim())o.push({severity:"error",code:"invalid-logical-section-id",message:`Section "${a.label}" has an empty logical section id`,objectId:a.id});else if(a.logicalSectionId){let h=JSON.stringify({displayLabel:a.displayLabel??null,entrance:a.entrance??null,viewFromSeatUrl:a.viewFromSeatUrl??null,viewFromSeatMeta:a.viewFromSeatMeta??null,confidenceEvidence:a.confidenceEvidence??null,zone:a.zone??null,labelStyle:a.labelPresentation?.labelStyle??null,labelVisible:a.labelPresentation?.visible!==!1}),x=A.get(a.logicalSectionId);x&&(x.label!==a.label||x.semanticSignature!==h)?o.push({severity:"error",code:"inconsistent-logical-section",message:`Logical section "${a.logicalSectionId}" must use one technical label and buyer-facing presentation across every component`,objectId:a.id}):x||A.set(a.logicalSectionId,{label:a.label,semanticSignature:h})}let _=a.holes??[];if(!Cn(_)){o.push({severity:"error",code:"invalid-hole-collection",message:`Section "${a.label}" openings must be a list of point lists`,objectId:a.id});continue}if(_.length>64){o.push({severity:"error",code:"invalid-section-hole",message:`Section "${a.label}" has an invalid opening collection`,objectId:a.id});continue}let p=-1;for(let h=0;h<_.length;h++){let x=_[h];if(x.length>512||!me(x)||Math.abs(xe(x))<=1e-7||Se(x)){p=h;break}if(!x.flatMap((E,C)=>{let R=x[(C+1)%x.length];return[E,{x:(E.x+R.x)/2,y:(E.y+R.y)/2}]}).every(E=>$e(E,a.outline))){p=h;break}}if(p>=0)o.push({severity:"error",code:"invalid-section-hole",message:`Section "${a.label}" has an opening outside its outline or with an invalid shape`,objectId:a.id,holeIndex:p});else if(_.some((h,x)=>_.slice(x+1).some(T=>et(h,T)))){let h=_.findIndex((x,T)=>_.slice(T+1).some(E=>et(x,E)));o.push({severity:"error",code:"overlapping-section-holes",message:`Section "${a.label}" has overlapping openings`,objectId:a.id,holeIndex:h})}}let k=e.floors?.length?e.floors.map(a=>a.objects):[e.objects];for(let a of k){let _=a.filter(p=>p.type==="section");for(let p of a.filter(h=>h.type==="text")){let h=p.iconKey;h!==void 0&&!kt(h)&&o.push({severity:"error",code:"invalid-icon-key",message:`Venue icon "${p.text||p.id}" references an unknown symbol`,objectId:p.id});let x=p.fontFamily;x!==void 0&&(typeof x!="string"||x.normalize("NFKC").trim()!==x||x.length<1||x.length>120)&&o.push({severity:"error",code:"invalid-text-font-family",message:`Text "${p.text||p.id}" font family must contain 1 to 120 normalized characters`,objectId:p.id});let T=p.background;(p.width!==void 0&&(!Number.isFinite(p.width)||p.width<40||p.width>1200)||p.align!==void 0&&!["left","center","right"].includes(p.align)||p.lineHeight!==void 0&&(!Number.isFinite(p.lineHeight)||p.lineHeight<.8||p.lineHeight>3)||p.letterSpacing!==void 0&&(!Number.isFinite(p.letterSpacing)||p.letterSpacing<-2||p.letterSpacing>20)||p.opacity!==void 0&&(!Number.isFinite(p.opacity)||p.opacity<.1||p.opacity>1)||T!==void 0&&(!/^#[0-9a-f]{6}$/i.test(T.color)||T.padding!==void 0&&(!Number.isFinite(T.padding)||T.padding<0||T.padding>40)||T.cornerRadius!==void 0&&(!Number.isFinite(T.cornerRadius)||T.cornerRadius<0||T.cornerRadius>40)||T.opacity!==void 0&&(!Number.isFinite(T.opacity)||T.opacity<.1||T.opacity>1)))&&o.push({severity:"error",code:"invalid-text-layout",message:`Text "${p.text||p.id}" has invalid width, spacing, opacity, alignment, or background layout`,objectId:p.id})}for(let p of a.filter(h=>h.type==="shape")){if(p.eventConfigurationIds!==void 0){let T=p.eventConfigurationIds;Array.isArray(T)&&T.length>0&&T.length<=20&&T.every(C=>typeof C=="string"&&C.normalize("NFKC").trim()===C&&C.length>=1&&C.length<=100)&&new Set(T).size===T.length||o.push({severity:"error",code:"invalid-shape-configurations",message:`Shape "${p.label||p.id}" must reference 1 to 20 unique event configuration ids`,objectId:p.id})}if(p.heightM!==void 0&&(!Number.isFinite(p.heightM)||p.heightM<.05||p.heightM>50)&&o.push({severity:"error",code:"invalid-shape-height",message:`Shape "${p.label||p.id}" height must be between 0.05 m and 50 m`,objectId:p.id}),p.stroke!==void 0&&(!p.stroke||typeof p.stroke.color!="string"||!/^#[0-9a-f]{6}$/i.test(p.stroke.color)||!Number.isFinite(p.stroke.width)||p.stroke.width<.5||p.stroke.width>40)&&o.push({severity:"error",code:"invalid-shape-stroke",objectId:p.id,message:`Shape "${p.label||p.id}" stroke must use a six-digit colour and a width from ${wn(e,.5)} to ${wn(e,40)}`}),(p.lineCap!==void 0||p.lineJoin!==void 0||p.startEnding!==void 0||p.endEnding!==void 0)&&!yn(p.kind)?o.push({severity:"error",code:"invalid-shape-line-style-applicability",message:`Shape "${p.label||p.id}" may use line caps, joins, and end decorations only when it is an open line or polyline`,objectId:p.id}):yn(p.kind)&&(p.lineCap!==void 0&&!yr.includes(p.lineCap)||p.lineJoin!==void 0&&!xr.includes(p.lineJoin)||p.startEnding!==void 0&&!hn.includes(p.startEnding)||p.endEnding!==void 0&&!hn.includes(p.endEnding))&&o.push({severity:"error",code:"invalid-shape-line-style",message:`Shape "${p.label||p.id}" has an unsupported line cap, join, or ending`,objectId:p.id}),p.points!==void 0&&!Mn(p.points)){o.push({severity:"error",code:"invalid-polygon-points",message:`Shape "${p.label||p.id}" points must be a list of points`,objectId:p.id});continue}if(p.kind==="polygon"){let T=Jn(p.points??[]);if(!T.ok)o.push({severity:"error",code:"invalid-shape-polygon",message:`Shape "${p.label||p.id}" has invalid polygon geometry: ${T.message}`,objectId:p.id});else{let E=Ks(p);E&&o.push({severity:"error",code:"invalid-shape-outline",message:`Shape "${p.label||p.id}" ${E}`,objectId:p.id})}}else(p.edgeCurvature!==void 0||p.holes!==void 0)&&o.push({severity:"error",code:"invalid-shape-outline",message:`Shape "${p.label||p.id}" has curved sides or cut-outs, which only a custom outline can have`,objectId:p.id});let x=Mr(p);if(x){for(let T of _)if(wr(x,T.outline)){o.push({severity:"error",code:"reference-focal-overlaps-section",message:`Reference focal area "${p.label??p.id}" overlaps section "${T.label}"`,objectId:p.id});break}}}}L>n&&o.push({severity:"error",code:"inventory-capacity-exceeded",message:`Chart has ${L} bookable units; the maximum is ${n}`}),o.push(...S.slice(0,5)),S.length>5&&o.push({severity:"error",code:"duplicate-seat-label",message:`${S.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 a of qe(e)){let _=a.families[0]?.targets[0];r.push({severity:"warning",code:"category-inventory-family-conflict",message:mn(a),categoryKey:a.categoryKey,..._?{objectId:_.id,floorId:_.floorId}:{},relatedObjectIds:a.objectIds,categoryInventoryFamilies:a.families})}e.focalPoint||r.push({severity:"warning",code:"missing-focal-point",message:"Chart has no focal point set"}),P===0&&r.push({severity:"warning",code:"no-bookables",message:"Chart has no rows, tables, booths, or GA areas"});for(let a of l)if(u.get(a)===!1){let _=e.categories.find(p=>p.key===a);r.push({severity:"warning",code:"unpriced-category",message:`Category "${_?.label??a}" has no default price. Each event sets its price before it goes on sale`,categoryKey:a})}return[...o,...r]}function Ks(e){let t=e.points??[];if(e.edgeCurvature!==void 0&&(!Array.isArray(e.edgeCurvature)||e.edgeCurvature.length!==t.length||e.edgeCurvature.some(n=>typeof n!="number"||!Number.isFinite(n)||n<-100||n>100)))return"needs one side curve from -100 to 100 for each side";if(e.holes===void 0)return null;if(!Cn(e.holes)||e.holes.length>eo)return"has an invalid cut-out collection";for(let n=0;n<e.holes.length;n+=1){let o=e.holes[n];if(o.length<3||o.length>512||!me(o)||Math.abs(xe(o))<=1e-7||Se(o))return`has an invalid cut-out ${n+1}`;if(!to(e,o))return`has cut-out ${n+1} outside its outline`;for(let r=0;r<n;r+=1){let i=e.holes[r];if(oo(o,i))return`has cut-outs ${r+1} and ${n+1} overlapping`}}return null}var Vr=e=>!!("entrance"in e&&e.entrance?.trim()||"entranceGateId"in e&&e.entranceGateId);function Vs(e){return e.type==="row"||e.type==="table"?e.seatCount:e.type==="booth"?1:e.type==="gaArea"?e.capacity??0:0}function Hs(e){let t=Ar(e).size,n=[];if(!t)return{gates:t,gaps:n,missingAreas:0,missingPlaces:0};let o=No(e);for(let r of ne(e)){let i=new Map;for(let l of r.objects){if(l.type!=="section")continue;let d=l.logicalSectionId??l.id;i.set(d,[...i.get(d)??[],l])}let s={floorId:r.id,selectIds:[],names:[],places:0},u=new Set;for(let l of r.objects){if(l.type!=="row"&&l.type!=="table"&&l.type!=="booth"&&l.type!=="gaArea"||Vr(l))continue;let d=o.get(l.id),c=d?i.get(d):void 0;if(!c?.some(Vr))if(s.places+=Vs(l),c){if(u.has(d))continue;u.add(d),s.selectIds.push(...c.map(f=>f.id)),s.names.push(c[0].displayLabel??c[0].label)}else s.selectIds.push(l.id),s.names.push(l.label||l.id)}s.names.length&&n.push(s)}return{gates:t,gaps:n,missingAreas:n.reduce((r,i)=>r+i.names.length,0),missingPlaces:n.reduce((r,i)=>r+i.places,0)}}function zs(e){let t=e.slice(0,3).map(o=>`\u201C${o}\u201D`),n=e.length-t.length;return n>0?`${t.join(", ")} and ${n} more`:t.join(t.length===2?" and ":", ")}function Hr(e,t){for(let n of Hs(e).gaps){let o=n.names.length;t.push({severity:"warning",code:"entrance-missing",dimension:"navigation",source:"quality",title:`${o} ${o===1?"area has":"areas have"} no entrance`,message:`Buyers in ${zs(n.names)} are not told which gate to use.`,action:"Select them, then choose a gate for them in the Gate panel, or use Pick on the map there.",objectId:n.selectIds[0],relatedObjectIds:n.selectIds,floorId:n.floorId,autoFixable:!1})}}var Xs=.9;function zr(e){return(e??1)>=Xs}function Ys(e,t){if(e.kind==="rect"||e.kind==="ellipse"){if(e.x==null||e.y==null||e.width==null||e.height==null)return!1;let n={x:e.x+e.width/2,y:e.y+e.height/2},o=ct({x:t.x-n.x,y:t.y-n.y},-(e.rotation??0)),r=e.width/2,i=e.height/2;return e.kind==="rect"?Math.abs(o.x)<=r&&Math.abs(o.y)<=i:r>0&&i>0&&(o.x/r)**2+(o.y/i)**2<=1}return e.kind==="polygon"&&!!e.points&&e.points.length>=3&&le(t,e.points)}function kn(e,t,n,o){if(e.background?.color&&zr(e.background.opacity))return e.background.color;for(let r=n.length-1;r>=0;r--){let i=n[r];if(!(i.type!=="shape"||!i.fill||!zr(i.opacity))&&Ys(i,t))return i.fill}return o}var Ws=9,qr="#f7f8fb",Zs="#f5f6f8",Qr="#8b93a7",qs="#0b1220",Qs="#0b1220",Js="#ffffff",ec=100,En=e=>e.semanticKind==="icon"&&kt(e.iconKey);function D(e,t=2){let n=10**t;return Math.round(e*n)/n}function U(e){return{source:"quality",...e}}function tc(e){return e.code==="missing-focal-point"||e.code==="missing-zone-focal-point"?"navigation":"structure"}function Pn(e){return Ws*$o(e.theme?.seatScale)}function Jr(e){let t=[];for(let n of e.objects)n.type==="row"?t.push(...Q(n)):n.type==="table"&&t.push(...re(n));return t}function nc(e){let t={rowSeats:0,tableSeats:0,booths:0,gaCapacity:0};for(let n of e)for(let o of n.objects)o.type==="row"?t.rowSeats+=Q(o).length:o.type==="table"?t.tableSeats+=re(o).length:o.type==="booth"?t.booths+=1:o.type==="gaArea"&&(t.gaCapacity+=Math.max(0,Math.floor(o.capacity)));return{inventoryByKind:t,bookableUnits:t.rowSeats+t.tableSeats+t.booths+t.gaCapacity}}function z(e,t){e.filter(n=>n.code===t.code).length<ec&&e.push(t)}function oc(e,t,n){let o=Pn(e),r=2*o,i=2.3*o,s=0,u=0,l=1/0;for(let d of t){let c=new Map(d.objects.filter(S=>S.type==="row").map(S=>[S.id,S])),f=S=>{let A=d.objects.find(y=>y.id===S);if(!A||A.type!=="row"&&A.type!=="table")return"another seating object";let P=A.type==="row"?Q(A):re(A),L=P.length?{x:P.reduce((y,w)=>y+w.x,0)/P.length,y:P.reduce((y,w)=>y+w.y,0)/P.length}:A.type==="row"?A.origin:A.center,I=d.objects.find(y=>y.type==="section"&&oe(L,y.outline,y.holes)),M=A.type==="row"?`Row \u201C${A.label}\u201D`:`Table \u201C${A.label}\u201D`;return I?.type==="section"?`${M} in \u201C${I.label}\u201D`:M},b=Jr(d);s+=b.length;let m=i,g=new Map,v=new Map;for(let S of b){let A=Math.floor(S.x/m),P=Math.floor(S.y/m);for(let M=-1;M<=1;M++)for(let y=-1;y<=1;y++){let w=g.get(`${A+M}:${P+y}`)??[];for(let O of w){u++;let k=Math.hypot(S.x-O.x,S.y-O.y);if(l=Math.min(l,k),k>=i)continue;let _=(S.rowId<O.rowId?[S.rowId,O.rowId]:[O.rowId,S.rowId]).join("|"),p=v.get(_);(!p||k<p.distance)&&v.set(_,{a:S,b:O,distance:k})}}let L=`${A}:${P}`,I=g.get(L)??[];I.push(S),g.set(L,I)}for(let S of v.values()){let A=S.a.rowId===S.b.rowId,P=c.get(S.a.rowId),L=c.get(S.b.rowId),I=!A&&P?.segmentedRow?.repeatLabelOnComponents===!0&&L?.segmentedRow?.repeatLabelOnComponents===!0&&P.segmentedRow.groupId===L.segmentedRow.groupId,M=!!P?.referenceScan&&!!L?.referenceScan&&P.referenceScan.assetId===L.referenceScan.assetId&&P.referenceScan.sectionId===L.referenceScan.sectionId,y=S.distance<r;if((I||M)&&!y)continue;let w=y?"seat-overlap":"seat-cramped",O=f(S.a.rowId),k=f(S.b.rowId),a=D(y?r:i);z(n,U({severity:"warning",code:w,dimension:"geometry",title:y?A?`${O} has overlapping seats`:`${O} and ${k} overlap`:A?`${O} has seats too close together`:`${O} and ${k} are too close together`,message:y?`The closest seats are ${Fe(e,S.distance)} apart, so their markers overlap on the buyer map; at least ${Fe(e,a)} keeps them apart.`:`The closest seats are ${Fe(e,S.distance)} apart; at least ${Fe(e,a)} is needed.`,action:A?`Increase the seat spacing for ${O}, or use Review safe fixes.`:`Move ${O} or ${k} until they no longer overlap.`,objectId:S.a.rowId,relatedObjectIds:A?[S.a.rowId]:[S.a.rowId,S.b.rowId],floorId:d.id,measured:D(S.distance),minimum:a,autoFixable:A}))}}return{seats:s,checkedSeatPairs:u,minimumSeatDistance:Number.isFinite(l)?D(l):null}}function ot(e){let{width:t,height:n}=En(e)?{width:e.fontSize,height:e.fontSize}:zn(e);if(!e.rotation)return{x:e.position.x,y:e.position.y,width:t,height:n};let o=[{x:0,y:0},{x:t,y:0},{x:t,y:n},{x:0,y:n}].map(r=>{let i=ct(r,e.rotation);return{x:e.position.x+i.x,y:e.position.y+i.y}});return Bo(o)}function ei(e){let t=ot(e);return{x:t.x+t.width/2,y:t.y+t.height/2}}function ti(e,t,n=0){return e.x<t.x+t.width+n&&e.x+e.width+n>t.x&&e.y<t.y+t.height+n&&e.y+e.height+n>t.y}function An(e,t,n){let o=ee(t.x,e.x,e.x+e.width),r=ee(t.y,e.y,e.y+e.height);return(t.x-o)**2+(t.y-r)**2<n**2}function rc(e,t,n){let o=Pn(e),r=0;for(let i of t){let s=i.objects.filter(l=>l.type==="text"),u=Jr(i);r+=s.length;for(let l=0;l<s.length;l++){let d=s[l],c=ot(d),f=u.find(b=>An(c,b,o));f&&z(n,U({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${d.text}\u201D overlaps seat ${f.label}`,objectId:d.id,relatedObjectIds:[d.id,f.rowId],floorId:i.id,autoFixable:!0}));for(let b=0;b<l;b++){let m=s[b];ti(c,ot(m),2)&&z(n,U({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${d.text}\u201D overlaps text \u201C${m.text}\u201D`,objectId:d.id,relatedObjectIds:[d.id,m.id],floorId:i.id,autoFixable:!0}))}}}return r}function ic(e,t){let n=!e.categoryKey.trim();if(e.type==="booth")return{places:n?1:0};if(e.type==="gaArea")return{places:n?Math.max(1,Math.floor(e.capacity)):0};if(e.type==="table"&&(e.bookAsWhole||e.variableOccupancy))return{places:n?e.seatCount:0};let o=new Map((e.overrides??[]).map(s=>[s.index,s])),r=[],i=0;for(let s=0;s<e.seatCount;s+=1){let u=o.get(s);if(u?.skip)continue;i+=1;let l=u?.categoryKey;(l===void 0?n:!l.trim()||!t.has(l))&&r.push(s)}return r.length?r.length===i?{places:i}:{places:r.length,seatIndices:r}:{places:0}}function On(e){return e.normalize("NFKC").trim().toLowerCase().replace(/\s+/g," ")}function ac(e,t,n){let o=new Map,r=new Set(e.categories.map(l=>l.key));for(let l of t)for(let d of l.objects){let c=d.type,f=c==="row"||c==="table"||c==="booth"||c==="gaArea",b=f||c==="section",m=f?ic(d,r):null;if(f&&m&&m.places>0){let v=`${c==="gaArea"?"GA area":c==="row"?"Row":c==="table"?"Table":"Booth"} \u201C${d.label||d.id}\u201D`,S=c==="gaArea"?"place":c==="table"?"chair":c==="booth"?"booth":"seat",A=`${m.places} ${S}${m.places===1?"":"s"}`;z(n,U({severity:"warning",code:"object-uncategorized",dimension:"structure",title:m.seatIndices?`${v} has ${A} with no category`:`${v} has no category`,message:m.seatIndices?`${A} in ${v} have no category, so buyers see no price or colour for them.`:`${v} is not assigned to any category (${A}), so buyers see no price or colour for it.`,action:"Select it and pick a category on the Categories bar, or create one there first.",objectId:d.id,floorId:l.id,autoFixable:!1,...m.seatIndices?{seatIndices:m.seatIndices}:{}}))}if(b){let g=(d.type==="section"?d.displayLabel??d.label:d.label)??"";if(g.trim()){if(c==="table"||c==="booth"||c==="gaArea"){let v=On(g),S=o.get(v);S&&S.raw!==g?z(n,U({severity:"warning",code:"duplicate-object-label-normalized",dimension:"labels",title:`\u201C${g}\u201D and \u201C${S.raw}\u201D read as the same label`,message:`Labels \u201C${g}\u201D and \u201C${S.raw}\u201D differ only by case, spacing, or accents, so buyers cannot tell them apart.`,action:"Make the two labels visibly distinct.",objectId:d.id,relatedObjectIds:[d.id,S.id],floorId:l.id,autoFixable:!1})):S||o.set(v,{id:d.id,raw:g})}}else{let v=c==="gaArea"?"A GA area":c==="section"?"A section":c==="row"?"A row":c==="table"?"A table":"A booth";z(n,U({severity:"warning",code:"object-unlabeled",dimension:"labels",title:`${v} has no label`,message:`${v} 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:d.id,floorId:l.id,autoFixable:!1}))}}}let i=[];for(let l of t){let d=l.objects.filter(c=>c.type==="row"||c.type==="table"||c.type==="booth"||c.type==="gaArea");for(let c of l.objects)if(!(c.type!=="section"||c.referenceInventoryExclusion||d.some(b=>oe(ce(b),c.outline,c.holes)))){if(c.referenceSource){i.push({id:c.id,floorId:l.id});continue}z(n,U({severity:"warning",code:"empty-section",dimension:"structure",title:`Section \u201C${c.displayLabel??c.label}\u201D is empty`,message:`Section \u201C${c.displayLabel??c.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:c.id,floorId:l.id,autoFixable:!1}))}}i.length&&z(n,U({severity:"warning",code:"empty-section",dimension:"structure",title:i.length===1?"1 traced section has no seating yet":`${i.length} traced sections have no seating yet`,message:`${i.length} section${i.length===1?"":"s"} traced from the reference image contain${i.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:i[0].id,relatedObjectIds:i.map(l=>l.id),floorId:i[0].floorId,autoFixable:!1}));let s=new Map,u=new Map;for(let l of t){let d=[];for(let c of l.objects)c.type!=="section"||c.outline.length<3||d.push({id:c.logicalSectionId??c.id,outline:c.outline,...c.holes?{holes:c.holes}:{},bounds:dc(c.outline)});for(let c of l.objects){if(c.type!=="row")continue;let f=(c.segmentedRow?.displayLabel??c.displayLabel??c.label??"").trim(),b=(c.displayType??"").trim(),m=f&&b&&On(b)!=="row"?`${b} ${f}`:f,g="";if(d.length){let P=ce(c),L=d.find(I=>P.x>=I.bounds.minX&&P.x<=I.bounds.maxX&&P.y>=I.bounds.minY&&P.y<=I.bounds.maxY&&oe(P,I.outline,I.holes));L&&(g=L.id)}let v=`${l.id}\0${g}\0${On(m)}`,S=c.segmentedRow?.groupId??c.id;if(!m){let P=`${l.id}\0${g}`,L=u.get(P);L?(L.ids.push(c.id),L.logical.set(S,[...L.logical.get(S)??[],c])):u.set(P,{ids:[c.id],logical:new Map([[S,[c]]]),floorId:l.id});continue}let A=s.get(v);A?(A.ids.push(c.id),A.logical.set(S,[...A.logical.get(S)??[],c])):s.set(v,{ids:[c.id],logical:new Map([[S,[c]]]),floorId:l.id,raw:m})}}for(let{ids:l,logical:d,floorId:c,raw:f}of s.values()){let b=d.size;b<2||Xr([...d.values()])&&z(n,U({severity:"warning",code:"duplicate-row-label",dimension:"labels",title:`${b} rows share the name \u201C${f}\u201D`,message:`${b} rows share the label \u201C${f}\u201D, so buyers cannot tell which row a seat belongs to.`,action:"Rename them so each row reads differently: for example the section or box each belongs to.",objectId:l[0],relatedObjectIds:l,floorId:c,autoFixable:!1}))}for(let{ids:l,logical:d,floorId:c}of u.values()){let f=d.size;f<2||Xr([...d.values()])&&z(n,U({severity:"warning",code:"unnamed-row-collision",dimension:"labels",title:`${f} rows have no name`,message:`${f} rows in the same area have no name and repeat each other\u2019s seat numbers, so buyers cannot tell which row a seat belongs to.`,action:"Give each of these rows a name, for example the box each belongs to, so a ticket can say which row a seat is in.",objectId:l[0],relatedObjectIds:l,floorId:c,autoFixable:!1}))}if(e.floors&&e.floors.length>1)for(let l of e.floors)l.objects.length===0&&z(n,U({severity:"warning",code:"unused-floor",dimension:"structure",title:`${Zr(l.name)} is empty`,message:`${Zr(l.name)} has nothing on it yet.`,action:"Add seating to this floor, copy the floor below, or remove it in Structure.",floorId:l.id,autoFixable:!1}))}var sc=5,cc=16;function lc(e,t,n){for(let o of t){let r=o.focalPoint??e.focalPoint;if(r)for(let i of o.objects){if(i.type!=="section"||i.outline.length<3)continue;let{rake:s}=Xe(i);if(s<sc)continue;let u=i.outline.map(b=>Math.hypot(b.x-r.x,b.y-r.y)),l=Math.max(...u);if(l<=0)continue;let d=(l-Math.min(...u))/l;if(s*d<=cc)continue;let f=i.displayLabel??i.label;z(n,U({severity:"warning",code:"section-rake-inconsistent",dimension:"geometry",title:`Section \u201C${f}\u201D is too deep for a single rake`,message:`Section \u201C${f}\u201D spans ${Math.round(d*100)}% of its distance to the stage at a ${Math.round(s)}\xB0 rake, so one rake can't represent its sightlines faithfully: 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:i.id,floorId:o.id,autoFixable:!1}))}}}function uc(e,t,n){let o=e.theme?.background??qr,r=Zs,i=new Map;for(let d of t)for(let c of d.objects){if(c.type!=="gaArea")continue;let f=i.get(c.categoryKey)??[];f.push({id:c.id,floorId:d.id}),i.set(c.categoryKey,f)}for(let d of e.categories){let c=te(d.color,o),f=te(d.color,r);if(c==null||f==null){z(n,U({severity:"error",code:"invalid-category-color",dimension:"contrast",message:`Category \u201C${d.label}\u201D does not use a supported hex color`,categoryKey:d.key}));continue}let b=Math.min(c,f);b<3&&z(n,U({severity:"warning",code:"category-contrast-low",dimension:"contrast",title:`Category \u201C${d.label}\u201D is hard to see`,message:`Its colour is too close to light or dark chart backgrounds (${D(b)}:1, needs 3:1). Pick a stronger colour.`,action:`Choose a lighter or darker color for \u201C${d.label}\u201D until this warning clears.`,categoryKey:d.key,measured:D(b),minimum:3,autoFixable:!1}));let m=i.get(d.key)??[];if(m.length){let g=pn(d.color,o,fn),v=pn(d.color,r,fn),S=Math.min(te(g,o)??0,te(v,r)??0);S<3&&z(n,U({severity:"warning",code:"ga-contrast-low",dimension:"contrast",title:`Standing areas in \u201C${d.label}\u201D are hard to see`,message:`Their pale fill is too close to the chart background (${D(S)}:1, needs 3:1). Pick a stronger colour for \u201C${d.label}\u201D.`,objectId:m[0].id,categoryKey:d.key,floorId:m[0].floorId,relatedObjectIds:m.map(A=>A.id),measured:D(S),minimum:3,autoFixable:!1}))}}for(let d=0;d<e.categories.length;d++)for(let c=0;c<d;c++){let f=e.categories[d],b=e.categories[c],m=Do(f.color,b.color);m!=null&&m<25&&z(n,U({severity:"warning",code:"category-colors-too-similar",dimension:"contrast",title:`\u201C${f.label}\u201D and \u201C${b.label}\u201D look too similar`,message:`Categories \u201C${f.label}\u201D and \u201C${b.label}\u201D are only \u0394E ${D(m)} apart; 25 is required`,action:"Pick a visibly different color for either category so buyers can tell them apart.",categoryKey:f.key,measured:D(m),minimum:25,autoFixable:!1}))}for(let d of t){let c=d.objects.filter(f=>f.type==="text");for(let f of c){if(En(f))continue;let b=f.color??e.theme?.textColor??Qr,m=kn(f,ei(f),d.objects,o),g=te(b,m),v=f.fontSize>=18?3:4.5;if(g==null||g<v){let S=m===o?"the chart background":"what it sits on";z(n,U({severity:"warning",code:"text-contrast-low",dimension:"contrast",message:`Text \u201C${f.text}\u201D has ${D(g??0)}:1 contrast against ${S}; ${v}:1 is required`,objectId:f.id,floorId:d.id,measured:D(g??0),minimum:v,autoFixable:!0}))}}}if(e.theme?.selectionColor){let d=te(e.theme.selectionColor,o);(d==null||d<3)&&z(n,U({severity:"warning",code:"selection-contrast-low",dimension:"contrast",title:"The selection color is hard to see",message:`Selection rings have ${D(d??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:D(d??0),minimum:3,autoFixable:!1}))}if(e.theme?.textColor){let d=te(e.theme.textColor,o);(d==null||d<3)&&z(n,U({severity:"warning",code:"theme-text-contrast-low",dimension:"contrast",title:"The theme text color is hard to read",message:`Theme text has ${D(d??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:D(d??0),minimum:3,autoFixable:!1}))}let s=e.theme?.seatLabelColor??qs,u=new Map,l=(d,c,f)=>{let b=u.get(d)??new Map,m=b.get(c)??[];m.push(f),b.set(c,m),u.set(d,b)};for(let d of t)for(let c of d.objects)if(c.type==="row")for(let f of Qe(c).keys())l(f,"seat",c.id);else if(c.type==="table")for(let f of Qe(c).keys())l(f,"table seat",c.id);else c.type==="booth"&&l(c.categoryKey,"booth",c.id);for(let d of e.categories){let c=u.get(d.key);if(c)for(let[f,b]of c){let m=f==="booth"?zo:Ho,g=Wo(Xo,600),v=Zo(d.color,s),S=te(v,d.color);(S==null||S<g)&&z(n,U({severity:"warning",code:"bookable-label-contrast-low",dimension:"contrast",message:`${f==="booth"?"Booth":f==="seat"?"Seat":"Table-seat"} labels use ${m}u type and have ${D(S??0)}:1 contrast on category \u201C${d.label}\u201D; ${g}:1 is required for small text`,objectId:b[0],relatedObjectIds:b,measured:D(S??0),minimum:g,autoFixable:!0}))}}}function Xr(e){if(e.length>24)return!0;let t=new Set;for(let n of e){let o=new Set;for(let r of n)for(let i of Q(r)){let s=i.label,u=s.lastIndexOf("-");o.add(u>=0?s.slice(u+1):s)}if(!o.size)return!0;for(let r of o)if(t.has(r))return!0;for(let r of o)t.add(r)}return!1}function dc(e){let t=1/0,n=1/0,o=-1/0,r=-1/0;for(let i of e)i.x<t&&(t=i.x),i.y<n&&(n=i.y),i.x>o&&(o=i.x),i.y>r&&(r=i.y);return{minX:t,minY:n,maxX:o,maxY:r}}var fc=2;function pc(e,t,n){let o=fc*(nt(e)??ze);for(let r of t){let i=[];for(let c of r.objects){if(c.type!=="row")continue;let f=Q(c);if(f.length<4)continue;let b=f.slice(1).map((g,v)=>Math.hypot(g.x-f[v].x,g.y-f[v].y)).sort((g,v)=>g-v),m=b[Math.floor(b.length/2)];m>o&&i.push({row:c,gap:m})}if(!i.length)continue;let s=i.reduce((c,f)=>f.gap>c.gap?f:c),u=r.objects.find(c=>c.type==="section"&&oe(ce(s.row),c.outline,c.holes)),l=`Row \u201C${s.row.label}\u201D${u?.type==="section"?` in \u201C${u.label}\u201D`:""}`,d=i.length===1?"1 row has":`${i.length} rows have`;n.push(U({severity:"warning",code:"seat-sparse",dimension:"geometry",title:i.length===1?`${l} has seats far apart`:`${i.length} rows have seats far apart`,message:`${d} seats more than ${Fe(e,o)} apart, up to ${Fe(e,s.gap)} in ${l}; seats in a row usually sit about half a metre apart.`,action:"Advice only: the chart can still be published. To tighten it, reduce these rows\u2019 seat spacing or give them more seats; in a Venue Spec, a smaller spreadDegrees, or leave it out so the fan fits its seats.",objectId:s.row.id,relatedObjectIds:i.map(c=>c.row.id),floorId:r.id,measured:D(s.gap),autoFixable:!1}))}}function mc(e,t){for(let n of e){let o=n.objects.filter(r=>r.type==="section");if(!(o.length<2))for(let r of n.objects){if(!(r.type==="row"||r.type==="table"||r.type==="booth"||r.type==="gaArea"))continue;let s=ce(r),u=o.filter(m=>oe(s,m.outline,m.holes)),l=new Map;for(let m of u){let g=m.logicalSectionId??m.id,v=l.get(g)??[];v.push(m),l.set(g,v)}if(l.size<2)continue;let d=[...l.values()],c=d.map(m=>`Section \u201C${m[0].displayLabel??m[0].label}\u201D`),f=c.length===2?c.join(" and "):`${c.slice(0,-1).join(", ")}, and ${c[c.length-1]}`,b=r.type==="gaArea"?"GA area":r.type==="row"?"Row":r.type==="table"?"Table":"Booth";z(t,U({severity:"warning",code:"ambiguous-section-ownership",dimension:"structure",title:`${b} \u201C${r.label}\u201D belongs to more than one section`,message:`${b} \u201C${r.label}\u201D has its center inside ${f}, 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,...d.flatMap(m=>m.map(g=>g.id))],floorId:n.id,autoFixable:!1}))}}}var bc={structure:20,geometry:30,contrast:25,labels:15,navigation:10},gc={"seat-overlap":15,"seat-cramped":4,"seat-sparse":6,"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 hc(e){let t={...bc};for(let r of e){let i=r.severity==="error"?10:2;t[r.dimension]=Math.max(0,t[r.dimension]-(gc[r.code]??i))}let n=Object.values(t).reduce((r,i)=>r+i,0),o=n>=95?"A":n>=85?"B":n>=70?"C":n>=55?"D":"F";return{overall:n,dimensions:t,errorFree:e.every(r=>r.severity!=="error"),grade:o}}var yc=new Set(["object-uncategorized"]);function Yr(e,t={}){let n=ne(e),o=Kr(e,{maxInventory:t.maxInventory}).filter(c=>c.code!=="missing-zone-focal-point"||t.requireExplicitZoneFocals).map(c=>{let f=c.objectId?n.find(g=>g.objects.some(v=>v.id===c.objectId))?.id:void 0,b=c.code==="category-inventory-family-conflict",m=b?e.categories.find(g=>g.key===c.categoryKey):void 0;return U({...c,...b?{severity:"error",title:`Category \u201C${m?.label??c.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."}:{},...t.requireExplicitZoneFocals&&c.code==="missing-zone-focal-point"?{severity:"error"}:{},...f?{floorId:f}:{},source:"structural",dimension:tc(c),autoFixable:b})}),r=oc(e,n,o),i=nc(n),s=rc(e,n,o);if(ac(e,n,o),pc(e,n,o),mc(n,o),lc(e,n,o),uc(e,n,o),Hr(e,o),n.reduce((c,f)=>c+f.objects.filter(b=>b.type==="row"||b.type==="table"||b.type==="booth"||b.type==="gaArea").length,0)===0){let c=new Set(["missing-focal-point","no-bookables"]);for(let f=o.length-1;f>=0;f--)c.has(o[f].code)&&o.splice(f,1)}if(t.requirePricedInventory)for(let c=0;c<o.length;c++)yc.has(o[c].code)&&(o[c]={...o[c],severity:"error"});let l=o.filter(c=>c.severity==="error"),d=o.filter(c=>c.severity==="warning");return{issues:o,errors:l,warnings:d,metrics:{floors:n.length,objects:n.reduce((c,f)=>c+f.objects.length,0),seats:r.seats,bookableUnits:i.bookableUnits,inventoryByKind:i.inventoryByKind,categories:e.categories.length,freeTextLabels:s,checkedSeatPairs:r.checkedSeatPairs,minimumSeatDistance:r.minimumSeatDistance},score:hc(o),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 xc(e,t){if(e.seatCount<2||e.seatSpacing>=t)return!1;let n=Ke(Q(e));e.seatSpacing=D(t,3);let o=Ke(Q(e));return e.origin.x=D(e.origin.x+n.x-o.x,3),e.origin.y=D(e.origin.y+n.y-o.y,3),!0}function vc(e,t){if(e.seatCount<2)return!1;let n=!1;if(e.shape==="round"){let o=ee(e.seatArc??360,0,360),r=(o>=360?360/e.seatCount:o/(e.seatCount-1))*Math.PI/180;if(r>0){let i=t/(2*Math.sin(r/2)),s=Math.max(1,i-16);(e.radius??40)<s&&(e.radius=D(s,3),n=!0)}}else{let o=We(e),r=Math.max(o.top,o.bottom),i=Math.max(o.left,o.right);r>1&&(e.width??80)/r<t&&(e.width=D(r*t,3),n=!0),i>1&&(e.height??50)/i<t&&(e.height=D(i*t,3),n=!0)}return n}function Sc(e){return[Qs,Js].map(n=>({color:n,minimum:Math.min(...e.map(o=>te(n,o)??0))})).sort((n,o)=>o.minimum-n.minimum)[0].color}function Wr(e,t,n){let o=ot(e),r=0;for(let i of t)i.type==="row"?r+=Q(i).filter(s=>An(o,s,n)).length:i.type==="table"?r+=re(i).filter(s=>An(o,s,n)).length:i.type==="text"&&i.id!==e.id&&ti(o,ot(i),2)&&r++;return r}function Ic(e,t,n){if(Wr(e,t,n)===0)return!1;let r={...e.position},i=Math.max(12,e.fontSize*1.25),s=[[0,-1],[1,0],[0,1],[-1,0],[1,-1],[1,1],[-1,1],[-1,-1]];for(let u=1;u<=12;u++)for(let[l,d]of s)if(e.position={x:D(r.x+l*i*u,3),y:D(r.y+d*i*u,3)},Wr(e,t,n)===0)return!0;return e.position=r,!1}function ni(e,t={}){let n=JSON.parse(JSON.stringify(e)),o=Yr(n,t),r=[],i=bn(n);if(i.changed){n=i.doc;for(let f of i.changes){let b=i.before.find(g=>g.categoryKey===f.categoryKey),m=b?.families.map(g=>g.label).join(", ")??"inventory families";r.push({code:"category-inventory-family-conflict",objectId:b?.objectIds[0],message:`Split category \u201C${f.categoryLabel}\u201D across ${m}; preserved its commercial metadata and reassigned ${f.reassignments.length} affected object${f.reassignments.length===1?"":"s"}`})}}let s=Pn(n),u=2.5*s,l=ne(n);for(let f of l)for(let b of f.objects)if(b.type==="row"){let m=b.seatSpacing;xc(b,u)&&r.push({code:m<2*s?"seat-overlap":"seat-cramped",objectId:b.id,message:`Expanded ${b.id} to the ${D(u)}u target pitch while preserving its centre`})}else b.type==="table"&&vc(b,u)&&r.push({code:"seat-cramped",objectId:b.id,message:`Expanded ${b.id} so its perimeter seats meet the ${D(u)}u target pitch`});for(let f of l){let b=f.objects.filter(m=>m.type==="text");for(let m of b)Ic(m,f.objects,s)&&r.push({code:"label-collision",objectId:m.id,message:`Moved ${m.id} to the nearest collision-free deterministic label position`})}let d=n.theme?.background??qr;for(let f of l)for(let b of f.objects){if(b.type!=="text"||En(b))continue;let m=b.color??n.theme?.textColor??Qr,g=b.fontSize>=18?3:4.5,v=kn(b,ei(b),f.objects,d);(te(m,v)??0)<g&&(b.color=Sc([v]),r.push({code:"text-contrast-low",objectId:b.id,message:`Changed ${b.id} to the highest-contrast black/white ink`}))}n.floors?.length&&(n.objects=n.floors[0].objects);let c=Yr(n,t);return{doc:n,changed:r.length>0,fixes:r,before:o,after:c}}function Zr(e){let t=e.trim();return/^\d+( copy)?$/.test(t)?`Floor ${t}`:`\u201C${t}\u201D`}function Fe(e,t){return At(t/(nt(e)??ze),Et(e))}function Pt(e){return e.floors?.length?e.floors.flatMap(t=>t.objects):e.objects}function Rn(e){return Pt(e).reduce((t,n)=>n.type==="row"?t+xt(n):n.type==="table"?t+Ro(n):n.type==="gaArea"?t+Math.max(0,Math.floor(n.capacity)):n.type==="booth"?t+1:t,0)}function wc(e){let t={};for(let o of e.categories??[])t[o.key]=0;let n=(o,r)=>{r>0&&(t[o]=(t[o]??0)+r)};for(let o of Pt(e))if(o.type==="row")for(let r of Q(o))n(r.categoryKey,1);else if(o.type==="table")if(o.bookAsWhole||o.variableOccupancy)n(o.categoryKey,Math.max(0,Math.round(o.seatCount)));else for(let r of re(o))n(r.categoryKey,1);else o.type==="gaArea"?n(o.categoryKey,Math.max(0,Math.floor(o.capacity))):o.type==="booth"&&n(o.categoryKey,1);return t}function ri(e){if(!e.template)return null;let t=Pt(e),n=t.filter(l=>l.type==="row"||l.type==="table"||l.type==="gaArea");if(!n.length)return null;let r=t.filter(l=>l.type==="booth").length+n.reduce((l,d)=>l+(d.type==="table"?2:1),0),i=Rn(e),s=Math.max(r+1,Math.min(5e4,i*4)),u=[.5,1,1.5,2].map(l=>ee(Math.round(i*l),r,s));return{family:e.template.family,display:e.template.family.replace(/-/g," ").replace(/\b\w/g,l=>l.toUpperCase()),min:r,max:s,presets:["S","M","L","XL"].map((l,d)=>({size:l,seats:u[d]}))}}function oi(e){let t=Q(e);return t.length?Ke(t):{...e.origin}}function Mc(e,t){let n=ri(e);if(!n)return structuredClone(e);let o=structuredClone(e),r=Pt(o),i=r.filter(m=>m.type==="row"||m.type==="table"||m.type==="gaArea"),s=r.filter(m=>m.type==="booth").length,u=Math.max(n.min,Math.min(n.max,Math.round(t))),l=u-s,d=i.map((m,g)=>{let v=m.type==="gaArea"?Math.max(0,Math.floor(m.capacity)):m.seatCount,S=m.type==="table"?2:1;return{object:m,index:g,current:v,minimum:S,value:S,fraction:0}}),c=d.reduce((m,g)=>m+g.minimum,0),f=Math.max(0,l-c),b=d.reduce((m,g)=>m+Math.max(1,g.current-g.minimum),0);for(let m of d){let g=f*Math.max(1,m.current-m.minimum)/b,v=Math.floor(g);m.value+=v,m.fraction=g-v}f=l-d.reduce((m,g)=>m+g.value,0),d.sort((m,g)=>g.fraction-m.fraction||m.index-g.index);for(let m=0;m<f;m++)d[m%d.length].value++;d.sort((m,g)=>m.index-g.index);for(let m of d)if(m.object.type==="row"){let g=oi(m.object);m.object.seatCount=m.value;let v=oi(m.object);m.object.origin.x+=g.x-v.x,m.object.origin.y+=g.y-v.y}else if(m.object.type==="table"){let g=m.object;if(g.seatCountsBySide){let v=["top","bottom","left","right"],S=We(g),A=v.reduce((I,M)=>I+S[M],0)||1,P=v.map((I,M)=>{let y=m.value*S[I]/A;return{side:I,index:M,value:Math.floor(y),fraction:y-Math.floor(y)}}),L=m.value-P.reduce((I,M)=>I+M.value,0);P.sort((I,M)=>M.fraction-I.fraction||I.index-M.index);for(let I=0;I<L;I++)P[I%P.length].value+=1;P.sort((I,M)=>I.index-M.index),g.seatCountsBySide={top:P[0].value,bottom:P[1].value,left:P[2].value,right:P[3].value},g.sides=v.filter(I=>g.seatCountsBySide[I]>0)}g.seatCount=m.value,g.overrides&&(g.overrides=g.overrides.filter(v=>v.index<m.value),g.overrides.length||delete g.overrides)}else{let g=m.object;g.capacity=fe(g)?Math.min(m.value,ye):m.value,g.variableOccupancy&&(g.maxOccupancy=Math.min(g.maxOccupancy??g.capacity,g.capacity),g.minOccupancy=Math.min(g.minOccupancy??1,g.maxOccupancy)),g.wheelchairPlaces&&(g.wheelchairPlaces=Math.min(g.wheelchairPlaces,g.capacity))}return o.floors?.length&&(o.objects=o.floors[0].objects),o.template={family:o.template.family,targetSeats:u},o=ni(o).doc,o.template={family:e.template.family,targetSeats:Rn(o)},o}function De(e){let t=Number(e.slice(e.lastIndexOf(":")+1));return Number.isFinite(t)?t:-1}function Cc(e,t,n){let o=new Map;for(let s of e){if(s.kind==="booth")continue;let u=o.get(s.rowId);u?u.push(s):o.set(s.rowId,[s])}let r=s=>n.has(s.id)||t(s.id)!=="free",i=[];for(let s of o.values())if(!(s.length<3)){s.sort((u,l)=>De(u.id)-De(l.id));for(let u=1;u<s.length-1;u++){let l=s[u];if(r(l))continue;let d=s[u-1],c=s[u+1];De(l.id)-De(d.id)!==1||De(c.id)-De(l.id)!==1||!r(d)||!r(c)||!n.has(d.id)&&!n.has(c.id)||i.push(l)}}return i}var Tn=1,_n=100;function ii(e,t){if(!Number.isInteger(t)||t<Tn||t>_n)return null;let n=e.rotation*Math.PI/180,o={x:Math.cos(n),y:Math.sin(n)},r={x:-o.y,y:o.x};return Array.from({length:t},(i,s)=>{let u=e.style==="intertwined"&&s%2===1?e.seatSpacing/2:0;return{type:"row",id:`__block_preview_${s}`,label:"",origin:{x:e.origin.x+r.x*s*e.rowGap+o.x*u,y:e.origin.y+r.y*s*e.rowGap+o.y*u},rotation:e.rotation,curve:e.curve,seatCount:e.seatsPerRow,seatSpacing:e.seatSpacing,categoryKey:"__preview__"}})}function Ln(e,t=e.rowCount){let n=ii(e,t);return n?.length?ce(n[n.length-1]):null}function kc(e,t){if(!Number.isFinite(t.x)||!Number.isFinite(t.y)||e.rowGap<=0)return null;let n=Ln(e,1);if(!n)return null;let o=e.rotation*Math.PI/180,r={x:-Math.sin(o),y:Math.cos(o)},i=(t.x-n.x)*r.x+(t.y-n.y)*r.y,s=Math.max(Tn,Math.min(_n,Math.round(i/e.rowGap)+1)),u=Ln(e,s);return u?{rowCount:s,edgePoint:u}:null}function Oc(e,t){return e.length!==t.rowCount?!1:[...e].sort((o,r)=>(o.rowBlockGeneration?.rowIndex??1/0)-(r.rowBlockGeneration?.rowIndex??1/0)).every((o,r)=>{let i=o.rowBlockGeneration;return i?.kind==="row-block-v1"&&i.groupId===t.groupId&&i.rowIndex===r&&i.signature===t.signature&&JSON.stringify(i)===JSON.stringify({...t,rowIndex:r})})}function ai(e){let t=(e%360+360)%360,n=t>=180?t-360:t;return Object.is(n,-0)||Math.abs(n)<1e-9?0:n}var Ie=1,we=300,jn=330;function rt(e){return e.seatCount>1?e.curve/(e.seatCount-1):0}function si(e,t){let n=e.rotation*Math.PI/180,o=rt(e)*Math.PI/180,r,i;if(Math.abs(o)<1e-9)r=t*e.seatSpacing,i=0;else{let s=e.seatSpacing/(2*Math.sin(Math.abs(o)/2)),u=o*t;r=s*Math.sin(u),i=-s+s*Math.cos(u)}return{x:e.origin.x+r*Math.cos(n)-i*Math.sin(n),y:e.origin.y+r*Math.sin(n)+i*Math.cos(n)}}function Ac(e,t,n){let o=(e??[]).map(r=>({...r,index:r.index+t})).filter(r=>r.index>=0&&r.index<n);return o.length?o:void 0}function ci(e,t){if(e.path||!Number.isInteger(t)||t<Ie||t>we)return null;let n=rt(e);return{...e,seatCount:t,curve:n*(t-1)}}function li(e,t){if(e.path||!Number.isInteger(t)||t<Ie||t>we)return null;let n=rt(e),o=e.seatCount-t,r=-o;return{...e,origin:si(e,o),rotation:ai(e.rotation-n*o),seatCount:t,curve:n*(t-1),overrides:Ac(e.overrides,r,t)}}function ui(e,t=e.seatCount){let n=ci(e,t);return n?si(n,t-1):null}function di(e,t=e.seatCount){return li(e,t)?.origin??null}function Ec(e,t){if(e.path||!Number.isFinite(t.x)||!Number.isFinite(t.y))return null;let n=rt(e),o=Math.abs(n)<1e-9?we:Math.min(we,Math.floor(jn/Math.abs(n))+1),r=null;for(let i=Ie;i<=Math.max(Ie,o);i+=1){let s=ui(e,i);if(!s)continue;let u=Math.hypot(s.x-t.x,s.y-t.y),l=n*(i-1);(!r||u<r.distance||u===r.distance&&i<r.seatCount)&&(r={seatCount:i,curve:l,endpoint:s,distance:u})}return r}function Pc(e,t){if(e.path||!Number.isFinite(t.x)||!Number.isFinite(t.y))return null;let n=rt(e),o=Math.abs(n)<1e-9?we:Math.min(we,Math.floor(jn/Math.abs(n))+1),r=null;for(let i=Ie;i<=Math.max(Ie,o);i+=1){let s=di(e,i);if(!s)continue;let u=Math.hypot(s.x-t.x,s.y-t.y),l=n*(i-1);(!r||u<r.distance||u===r.distance&&i<r.seatCount)&&(r={seatCount:i,curve:l,endpoint:s,distance:u})}return r}var Be=class extends Error{constructor(n,o){super(o);this.objectId=n;this.name="GroupedTableProjectionError"}};function Rc(e){let t=e.minOccupancy,n=e.maxOccupancy;if(!Number.isInteger(t)||!Number.isInteger(n)||t<1||n<t||n>e.seatCount)throw new Be(e.id,`Table "${e.label}" has invalid variable-occupancy bounds`);return{min:t,max:n}}function Lc(e,t){if(t!==2)return[];let n=[];for(let o of Ze(e)){if(o.type!=="table"||!o.bookAsWhole&&!o.variableOccupancy)continue;if(o.bookAsWhole&&o.variableOccupancy)throw new Be(o.id,`Table "${o.label}" cannot be whole-table and variable-occupancy inventory`);if(!Number.isInteger(o.seatCount)||o.seatCount<1||!o.label.trim())throw new Be(o.id,"Grouped tables require a label and at least one chair");let r=o.variableOccupancy?"variable":"whole",i=r==="variable"?Rc(o):{min:o.seatCount,max:o.seatCount};n.push({objectId:o.id,label:o.label,...o.displayLabel?{displayLabel:o.displayLabel}:{},...o.displayType?{displayType:o.displayType}:{},categoryKey:o.categoryKey,mode:r,capacity:o.seatCount,minOccupancy:i.min,maxOccupancy:i.max,chairs:re(o)})}return n}function pi(e){return Array.isArray(e.objects)}function mi(e,t){if(t.seatsByLabel)return t.seatsByLabel;if(!pi(e))throw new Error("ticketRestrictions: a categories-only chart document requires options.seatsByLabel");return new Map(To(e,{resolveEyeHeights:!1}).map(n=>[n.label,n]))}function bi(e){return{code:"ticket_option_not_applicable",labels:e,message:"That ticket choice is not available for the selected seat."}}function Rt(e,t){let n=e.applicability;return n?!(n.seatLabels?.length&&!n.seatLabels.includes(t.label)||n.accessibility?.length&&!n.accessibility.some(o=>t.accessibility?.includes(o))):!0}function Tc(e,t){return(e.categories.find(n=>n.key===t.categoryKey)?.tiers??[]).filter(n=>Rt(n,t))}function Nn(e,t,n){let o=e.categories.find(i=>i.key===t.categoryKey)?.tiers;if(!o?.length)return{kind:"none"};let r=n==null?o.find(i=>Rt(i,t)):o.find(i=>i.id===n&&Rt(i,t));return r?{kind:"resolved",tier:r}:{kind:"invalid"}}function _c(e,t){return(e.logicalRowId??e.rowId)===(t.logicalRowId??t.rowId)}function fi(e){if(Number.isInteger(e.logicalSeatIndex))return e.logicalSeatIndex;let t=e.id.slice(e.id.lastIndexOf(":")+1),n=Number(t);return Number.isInteger(n)?n:void 0}function jc(e,t){if(!_c(e,t))return!1;let n=fi(e),o=fi(t);return n!=null&&o!=null&&Math.abs(n-o)===1}function gi(e,t,n={}){if(!t.length)return null;let o=mi(e,n),r=t.flatMap(u=>{let l=o.get(u.label);return l?[{selection:u,seat:l}]:[]}),i=r.map(({seat:u})=>u).filter(u=>u.accessibility?.includes("wheelchair")),s=[];for(let{selection:u,seat:l}of r){let d=Nn(e,l,u.tierId),c=d.kind==="resolved"?d.tier:void 0;(l.accessibility?.includes("companion")||c?.restriction==="companion")&&!i.some(b=>b.id!==l.id&&jc(l,b))&&s.push(l.label)}return s.length?{code:"companion_pair_required",labels:s,message:"Select the adjacent wheelchair place with each companion ticket."}:null}function Nc(e,t,n={}){if(!t.length)return null;let o=mi(e,n),r=new Set(e.categories.filter(u=>u.notForSale).map(u=>u.key)),i=[],s=[];for(let u of t){let l=o.get(u.label);if(!l)continue;if(r.has(l.categoryKey)){i.push(l.label);continue}Nn(e,l,u.tierId).kind==="invalid"&&s.push(l.label)}return i.length?{code:"not_for_sale",labels:i,message:"These seats are not for sale."}:s.length?bi(s):gi(e,t,{seatsByLabel:o})}0&&(module.exports={CATEGORY_INVENTORY_FAMILIES,DEFAULT_EVENT_INVENTORY_LIMIT,GA_UNIT_LABEL_PREFIX,GroupedTableProjectionError,LARGE_VENUE_INVENTORY_MODULE,MAX_DIRECT_ROW_SWEEP,MAX_EVENT_INVENTORY,MAX_GA_CAPACITY,MAX_ONE_PARTY_GUESTS,MAX_ROW_BLOCK_ROWS,MAX_ROW_SEATS,MIN_ROW_BLOCK_ROWS,MIN_ROW_SEATS,ONE_PARTY_LIMIT_MESSAGE,applicableTicketTiers,behindStageLabels,capacityControl,categoryCapacity,chartCapacity,companionSelectionIssue,describeCategoryInventoryConflict,effectiveSeatOwnerCategoryCounts,eventInventoryLimitFor,gaAreasOf,gaBoxBounds,gaBoxMode,gaInventorySegments,gaUnitLabel,gaUnitLabels,gaUnitLabelsForModel,gaWheelchairPlaceCount,gaWheelchairUnitLabels,groupedTableInventory,growJoinedGAInventory,inspectCategoryInventoryConflicts,intactRowBlockMembers,isFullChartDoc,isGaUnitLabel,pickBestAvailable,pickBestAvailableInventory,remediateCategoryInventoryConflicts,resizeChartCapacity,resolveRowBlockCount,resolveRowStartCapacity,resolveRowTerminalCapacity,resolveTicketTierForSeat,rowBlockEdgePoint,rowBlockPreviewRows,rowStartEndpoint,rowTerminalEndpoint,rowWithStartCapacity,rowWithTerminalCapacity,strandedSingles,ticketOptionNotApplicableIssue,ticketSelectionIssue,ticketTierAppliesToSeat,validGAInventorySegments});