@ahrowe/ui 0.1.21 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2,5 +2,5 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.
2
2
  `),s=n.map(t=>{let n=e.points[t.wallIndex],r=e.points[(t.wallIndex+1)%e.points.length],i=pn(n,r,t);return i?` <path d="${i}" fill="none" />`:``}).filter(Boolean).join(`
3
3
  `),c=e.name?` <text fontSize="5" x="${a.x.toFixed(1)}" y="${a.y.toFixed(1)}">${un(e.name)}</text>`:``;return[` <g id="${e.id}">`,o,` <path id="background" d="${i}" />`,s,c,` </g>`].filter(Boolean).join(`
4
4
  `)});return[`<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="${o}">`,` <g id="layer1">`,...s,` </g>`,` <use id="use" href="" />`,`</svg>`].join(`
5
- `)}function hn(e){let t=[];for(let n of e.matchAll(/[ML]\s*([-\d.]+)[,\s]+([-\d.]+)/gi))t.push({x:parseFloat(n[1]),y:parseFloat(n[2])});return t}function gn(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`),n=[];return t.querySelectorAll(`[id^="room"]`).forEach(e=>{let t=e.querySelector(`[id="background"]`);if(!t)return;let r=t.getAttribute(`d`);if(!r)return;let i=hn(r);if(i.length<3)return;let a=e.querySelector(`text`)?.textContent?.trim()??``;n.push({id:e.id,name:a,points:i})}),n}function _n(e,t){let n=mn(e,t),r=new Blob([n],{type:`image/svg+xml`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`room-plan.svg`,a.click(),URL.revokeObjectURL(i)}var Q={roomDrawer:`roomDrawer_SJj4-`,"roomDrawer-toolbar":`roomDrawer-toolbar_55H5p`,roomDrawerToolbar:`roomDrawer-toolbar_55H5p`,"roomDrawer-toolbar-sep":`roomDrawer-toolbar-sep_nJeh8`,roomDrawerToolbarSep:`roomDrawer-toolbar-sep_nJeh8`,"roomDrawer-toolbar-btn":`roomDrawer-toolbar-btn_2qinY`,roomDrawerToolbarBtn:`roomDrawer-toolbar-btn_2qinY`,"roomDrawer-toolbar-btn-active":`roomDrawer-toolbar-btn-active_4XX25`,roomDrawerToolbarBtnActive:`roomDrawer-toolbar-btn-active_4XX25`,"roomDrawer-toolbar-zoomLabel":`roomDrawer-toolbar-zoomLabel_HMkb5`,roomDrawerToolbarZoomLabel:`roomDrawer-toolbar-zoomLabel_HMkb5`,"roomDrawer-canvas":`roomDrawer-canvas_Y18uD`,roomDrawerCanvas:`roomDrawer-canvas_Y18uD`,"roomDrawer-canvas-select":`roomDrawer-canvas-select_M43-x`,roomDrawerCanvasSelect:`roomDrawer-canvas-select_M43-x`,"roomDrawer-info":`roomDrawer-info_qwC6L`,roomDrawerInfo:`roomDrawer-info_qwC6L`,"roomDrawer-info-label":`roomDrawer-info-label_8I9hB`,roomDrawerInfoLabel:`roomDrawer-info-label_8I9hB`,"roomDrawer-info-input":`roomDrawer-info-input_YAl-K`,roomDrawerInfoInput:`roomDrawer-info-input_YAl-K`,"roomDrawer-info-spacer":`roomDrawer-info-spacer_cOj96`,roomDrawerInfoSpacer:`roomDrawer-info-spacer_cOj96`,"roomDrawer-info-delete":`roomDrawer-info-delete_TSBUN`,roomDrawerInfoDelete:`roomDrawer-info-delete_TSBUN`,"roomDrawer-hint":`roomDrawer-hint_3WTFa`,roomDrawerHint:`roomDrawer-hint_3WTFa`,"roomDrawer-info-doorsBtn":`roomDrawer-info-doorsBtn_oK5Uf`,roomDrawerInfoDoorsBtn:`roomDrawer-info-doorsBtn_oK5Uf`,"roomDrawer-doorPanel":`roomDrawer-doorPanel_e-Tl9`,roomDrawerDoorPanel:`roomDrawer-doorPanel_e-Tl9`,"roomDrawer-doorPanel-header":`roomDrawer-doorPanel-header_--iXz`,roomDrawerDoorPanelHeader:`roomDrawer-doorPanel-header_--iXz`,"roomDrawer-doorPanel-icon":`roomDrawer-doorPanel-icon_KxaVY`,roomDrawerDoorPanelIcon:`roomDrawer-doorPanel-icon_KxaVY`,"roomDrawer-doorPanel-title":`roomDrawer-doorPanel-title_8nOZS`,roomDrawerDoorPanelTitle:`roomDrawer-doorPanel-title_8nOZS`,"roomDrawer-doorPanel-done":`roomDrawer-doorPanel-done_ejQkx`,roomDrawerDoorPanelDone:`roomDrawer-doorPanel-done_ejQkx`,"roomDrawer-doorPanel-list":`roomDrawer-doorPanel-list_rDou7`,roomDrawerDoorPanelList:`roomDrawer-doorPanel-list_rDou7`,"roomDrawer-doorPanel-item":`roomDrawer-doorPanel-item_U-3-B`,roomDrawerDoorPanelItem:`roomDrawer-doorPanel-item_U-3-B`,"roomDrawer-doorPanel-label":`roomDrawer-doorPanel-label_qSYqY`,roomDrawerDoorPanelLabel:`roomDrawer-doorPanel-label_qSYqY`,"roomDrawer-doorPanel-widthLabel":`roomDrawer-doorPanel-widthLabel_jXv7D`,roomDrawerDoorPanelWidthLabel:`roomDrawer-doorPanel-widthLabel_jXv7D`,"roomDrawer-doorPanel-empty":`roomDrawer-doorPanel-empty_LcDw0`,roomDrawerDoorPanelEmpty:`roomDrawer-doorPanel-empty_LcDw0`,"roomDrawer-canvas-door":`roomDrawer-canvas-door_qzCIa`,roomDrawerCanvasDoor:`roomDrawer-canvas-door_qzCIa`,doorGap:`doorGap_KrIuB`,doorMarker:`doorMarker_-N63z`,gridLine:`gridLine_V-rxw`,roomFill:`roomFill_JnJ0J`,"roomFill-selected":`roomFill-selected_IfIRr`,roomFillSelected:`roomFill-selected_IfIRr`,roomStroke:`roomStroke_S18UH`,"roomStroke-selected":`roomStroke-selected_fm19u`,roomStrokeSelected:`roomStroke-selected_fm19u`,roomText:`roomText_6fIeU`,doorPanel:`doorPanel_raCv0`,"doorPanel-selected":`doorPanel-selected_5DG7g`,doorPanelSelected:`doorPanel-selected_5DG7g`,doorSwing:`doorSwing_Tbt9D`,"doorSwing-selected":`doorSwing-selected_fFte5`,doorSwingSelected:`doorSwing-selected_fFte5`,preview:`preview_seIZY`,polyCloseTarget:`polyCloseTarget_snjYx`,polyVertex:`polyVertex_fw0nX`,vertexHandle:`vertexHandle_-z7g5`},vn=6,yn=5,bn=1.25,xn=.25,Sn=12,Cn=0;function wn(e){return Cn+=1,`${e}${Cn}`}var Tn={select:`Drag inside to move · Drag corner to reshape · Click wall to add corner · Dbl-click corner to remove · Delete to erase`,rect:`Drag to draw a rectangular room`,polygon:`Click to place corners · Click first point or Enter to close · Esc to cancel`};function En({className:e}){let[t,n]=(0,c.useState)([]),[r,i]=(0,c.useState)([]),[a,o]=(0,c.useState)(`rect`),[s,p]=(0,c.useState)(null),[m,h]=(0,c.useState)(null),[g,_]=(0,c.useState)(null),[v,y]=(0,c.useState)(null),[b,x]=(0,c.useState)([]),[S,C]=(0,c.useState)(null),[w,T]=(0,c.useState)(1),[E,D]=(0,c.useState)({x:0,y:0}),O=(0,c.useRef)(null),k=(0,c.useRef)(null),A=(0,c.useRef)(null),j=(0,c.useRef)(null),M=(0,c.useRef)(null),N=(0,c.useRef)({rooms:t,doors:r,tool:a,selectedId:s,editingDoorsForRoomId:m,polyPoints:b,zoom:w,pan:E});(0,c.useLayoutEffect)(()=>{N.current={rooms:t,doors:r,tool:a,selectedId:s,editingDoorsForRoomId:m,polyPoints:b,zoom:w,pan:E}});function P(e){e.length<3||(n(t=>[...t,{id:wn(`room`),name:`Room ${t.length+1}`,points:e}]),x([]),C(null))}(0,c.useEffect)(()=>{let e=j.current;if(!e)return;function t(e){e.preventDefault();let{zoom:t,pan:n}=N.current,r=tn(e.clientX,e.clientY,j.current);if(!r)return;let i=e.deltaY<0?bn:1/bn,a=Math.max(xn,Math.min(Sn,t*i));D({x:r.x-(r.x-n.x)*(t/a),y:r.y-(r.y-n.y)*(t/a)}),T(a)}return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]),(0,c.useEffect)(()=>{function e(e){let{tool:t,selectedId:r,editingDoorsForRoomId:a,polyPoints:o,zoom:s,pan:c}=N.current;if(e.key===`Escape`){if(a){h(null);return}t===`polygon`&&(x([]),C(null)),p(null);return}if(e.key===`Enter`&&t===`polygon`&&o.length>=3){P(o);return}if((e.key===`+`||e.key===`=`)&&!(e.target instanceof HTMLInputElement)){let e=Math.max(xn,Math.min(Sn,s*bn)),t=c.x+400/s/2,n=c.y+300/s/2;T(e),D({x:t-400/e/2,y:n-300/e/2});return}if(e.key===`-`&&!(e.target instanceof HTMLInputElement)){let e=Math.max(xn,Math.min(Sn,s/bn)),t=c.x+400/s/2,n=c.y+300/s/2;T(e),D({x:t-400/e/2,y:n-300/e/2});return}if(e.key===`0`&&!(e.target instanceof HTMLInputElement)){T(1),D({x:0,y:0});return}(e.key===`Delete`||e.key===`Backspace`)&&r&&!a&&!(e.target instanceof HTMLInputElement)&&(n(e=>e.filter(e=>e.id!==r)),i(e=>e.filter(e=>e.roomId!==r)),p(null))}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);function F(e,t=w,n=E){let r=Math.max(xn,Math.min(Sn,t*e)),i=n.x+400/t/2,a=n.y+300/t/2;D({x:i-400/r/2,y:a-300/r/2}),T(r)}function ee(e){return j.current?tn(e.clientX,e.clientY,j.current):null}function te(e,t){let n=null;for(let r=0;r<t.points.length;r++){let i=nn(e,t.points[r]);i<=vn&&(!n||i<n.d)&&(n={index:r,d:i})}return n}function I(e,t){let n=null;for(let r=0;r<t.points.length;r++){let i=t.points[r],a=t.points[(r+1)%t.points.length],{dist:o,t:s}=rn(e,i,a);o<=yn&&(!n||o<n.d)&&(n={index:r,t:s,d:o})}return n}function ne(e,t,r,a){return n(n=>n.map(n=>{if(n.id!==e)return n;let r=[...n.points];return r.splice(t+1,0,a),{...n,points:r}})),i(n=>n.map(n=>n.roomId===e?n.wallIndex===t?n.t<=r?{...n,t:r>0?n.t/r:0}:{...n,wallIndex:t+1,t:(n.t-r)/(1-r)}:n.wallIndex>t?{...n,wallIndex:n.wallIndex+1}:n:n)),t+1}function L(e,r){let a=t.find(t=>t.id===e);if(!a||a.points.length<=3)return;let o=a.points.length;n(t=>t.map(t=>t.id===e?{...t,points:t.points.filter((e,t)=>t!==r)}:t)),i(t=>t.map(t=>{if(t.roomId!==e)return t;let n=(r-1+o)%o;return t.wallIndex===n||t.wallIndex===r?{...t,wallIndex:-1}:t.wallIndex>r?{...t,wallIndex:t.wallIndex-1}:t}).filter(e=>e.wallIndex!==-1))}function R(e){if(e.button===1){e.preventDefault();let t=j.current;if(t){let n=t.getBoundingClientRect();A.current={startClient:{x:e.clientX,y:e.clientY},origPan:{...E},scaleX:400/w/n.width,scaleY:300/w/n.height}}return}if(e.button!==0)return;e.preventDefault();let n=ee(e);if(n){if(m){let e=t.find(e=>e.id===m);if(e){let t=an(n,[e]);t&&i(e=>[...e,{id:wn(`door`),roomId:t.roomId,wallIndex:t.wallIndex,t:t.t,width:12}])}return}if(a===`rect`){_(n),y(n);return}if(a===`polygon`){b.length>=3&&nn(n,b[0])<=8?P(b):x(e=>[...e,n]);return}if(a===`select`){let e=t.find(e=>e.id===s)??null;if(e){let t=te(n,e);if(t){O.current={type:`vertex`,roomId:e.id,index:t.index,start:n,origPt:e.points[t.index]};return}}if(e){let t=I(n,e);if(t){let r=e.points[t.index],i=e.points[(t.index+1)%e.points.length],a=en({x:r.x+(i.x-r.x)*t.t,y:r.y+(i.y-r.y)*t.t}),o=ne(e.id,t.index,t.t,a);O.current={type:`vertex`,roomId:e.id,index:o,start:n,origPt:a};return}}let r=t.find(e=>on(n,e.points));if(r){p(r.id),O.current={type:`room`,roomId:r.id,start:n,origPoints:[...r.points]};return}p(null)}}}function z(e){if(a!==`select`||m)return;let n=ee(e);if(!n)return;let r=t.find(e=>e.id===s);if(!r)return;let i=te(n,r);i&&(e.preventDefault(),L(r.id,i.index))}function re(e){if(A.current){let{startClient:t,origPan:n,scaleX:r,scaleY:i}=A.current;D({x:n.x-(e.clientX-t.x)*r,y:n.y-(e.clientY-t.y)*i});return}let r=ee(e);if(r){if(k.current&&m){let e=t.find(e=>e.id===m);if(e){let t=an(r,[e]);t&&i(e=>e.map(e=>e.id===k.current?{...e,wallIndex:t.wallIndex,t:t.t}:e))}return}if(a===`rect`&&g){y(r);return}if(a===`polygon`){C(r);return}if(a===`select`&&!m&&O.current){let e=O.current;if(e.type===`vertex`){let t=r.x-e.start.x,i=r.y-e.start.y,a=en({x:e.origPt.x+t,y:e.origPt.y+i});n(t=>t.map(t=>{if(t.id!==e.roomId)return t;let n=[...t.points];return n[e.index]=a,{...t,points:n}}))}else{let t=r.x-e.start.x,i=r.y-e.start.y;n(n=>n.map(n=>n.id===e.roomId?{...n,points:e.origPoints.map(e=>({x:e.x+t,y:e.y+i}))}:n))}}}}function B(e){if(A.current){A.current=null;return}let t=ee(e);if(t){if(a===`rect`&&g){let e=Math.min(g.x,t.x),r=Math.min(g.y,t.y),i=Math.abs(t.x-g.x),a=Math.abs(t.y-g.y);i>=10&&a>=10&&n(t=>[...t,{id:wn(`room`),name:`Room ${t.length+1}`,points:cn(e,r,i,a)}]),_(null),y(null)}k.current=null,O.current=null}}function ie(e){s&&n(t=>t.map(t=>t.id===s?{...t,name:e}:t))}function ae(e,t){let n=parseFloat(t);isNaN(n)||n<=0||i(t=>t.map(t=>t.id===e?{...t,width:n}:t))}function V(){s&&(n(e=>e.filter(e=>e.id!==s)),i(e=>e.filter(e=>e.roomId!==s)),h(null),p(null))}function H(e){i(t=>t.filter(t=>t.id!==e))}function U(e){o(e),h(null),x([]),C(null),_(null),y(null)}function oe(e){let t=e.target.files?.[0];if(!t)return;e.target.value=``;let r=new FileReader;r.onload=e=>{let t=e.target?.result;if(typeof t!=`string`)return;let r=gn(t);r.length!==0&&(n(r.map(e=>({...e,id:wn(`room`)}))),i([]),p(null),h(null),T(1),D({x:0,y:0}))},r.readAsText(t)}let se=a===`rect`&&g&&v?{x:Math.min(g.x,v.x),y:Math.min(g.y,v.y),w:Math.abs(v.x-g.x),h:Math.abs(v.y-g.y)}:null,W=s?t.find(e=>e.id===s)??null:null,G=m?t.find(e=>e.id===m)??null:null,K=m?r.filter(e=>e.roomId===m):[],ce=[{t:`select`,icon:d.faHandPointer,label:`Select & edit`},{t:`rect`,icon:d.faSquare,label:`Rectangle room`},{t:`polygon`,icon:d.faDrawPolygon,label:`Polygon room`}],le=400/w,q=300/w,ue=m?Q.roomDrawerCanvasDoor:a===`select`?Q.roomDrawerCanvasSelect:void 0;return(0,f.jsxs)(`div`,{className:(0,l.default)(Q.roomDrawer,e),children:[(0,f.jsxs)(`div`,{className:Q.roomDrawerToolbar,children:[ce.map(({t:e,icon:t,label:n})=>(0,f.jsx)(`button`,{title:n,className:(0,l.default)(Q.roomDrawerToolbarBtn,e===a&&!m&&Q.roomDrawerToolbarBtnActive),onClick:()=>U(e),children:(0,f.jsx)(u.FontAwesomeIcon,{icon:t})},e)),(0,f.jsx)(`div`,{className:Q.roomDrawerToolbarSep}),(0,f.jsx)(`button`,{title:`Zoom in (+)`,className:Q.roomDrawerToolbarBtn,onClick:()=>F(bn),disabled:w>=Sn,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faMagnifyingGlassPlus})}),(0,f.jsxs)(`button`,{title:`Reset zoom (0) — ${Math.round(w*100)}%`,className:Q.roomDrawerToolbarZoomLabel,onClick:()=>{T(1),D({x:0,y:0})},children:[Math.round(w*100),`%`]}),(0,f.jsx)(`button`,{title:`Zoom out (−)`,className:Q.roomDrawerToolbarBtn,onClick:()=>F(1/bn),disabled:w<=xn,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faMagnifyingGlassMinus})}),(0,f.jsx)(`div`,{className:Q.roomDrawerToolbarSep}),(0,f.jsx)(`button`,{title:`Upload SVG`,className:Q.roomDrawerToolbarBtn,onClick:()=>M.current?.click(),children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faUpload})}),(0,f.jsx)(`button`,{title:`Download SVG`,className:Q.roomDrawerToolbarBtn,onClick:()=>_n(t,r),disabled:t.length===0,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDownload})}),(0,f.jsx)(`input`,{ref:M,type:`file`,accept:`.svg,image/svg+xml`,style:{display:`none`},onChange:oe})]}),(0,f.jsxs)(`svg`,{ref:j,className:(0,l.default)(Q.roomDrawerCanvas,ue),viewBox:`${E.x} ${E.y} ${le} ${q}`,onMouseDown:R,onMouseMove:re,onMouseUp:B,onDoubleClick:z,children:[(0,f.jsx)(`defs`,{children:(0,f.jsx)(`pattern`,{id:`rd-grid`,width:5,height:5,patternUnits:`userSpaceOnUse`,children:(0,f.jsx)(`path`,{d:`M 5 0 L 0 0 0 5`,fill:`none`,className:Q.gridLine})})}),(0,f.jsx)(`rect`,{x:E.x,y:E.y,width:le,height:q,fill:`url(#rd-grid)`}),t.map(e=>{let t=e.points,n=t.map((e,t)=>`${t===0?`M`:`L`} ${e.x},${e.y}`).join(` `)+` Z`,i=fn(t,r.filter(t=>t.roomId===e.id)),a=sn(t),o=s===e.id,c=m===e.id;return(0,f.jsxs)(`g`,{children:[(0,f.jsx)(`path`,{d:n,className:(0,l.default)(Q.roomFill,(o||c)&&Q.roomFillSelected)}),i.map((e,t)=>(0,f.jsx)(`path`,{d:e,className:(0,l.default)(Q.roomStroke,(o||c)&&Q.roomStrokeSelected)},t)),e.name&&(0,f.jsx)(`text`,{x:a.x,y:a.y,className:Q.roomText,textAnchor:`middle`,dominantBaseline:`middle`,children:e.name})]},e.id)}),r.map(e=>{let n=t.find(t=>t.id===e.roomId);if(!n)return null;let r=n.points[e.wallIndex],i=n.points[(e.wallIndex+1)%n.points.length],a=ln(r,i,e.t,e.width);return a?(0,f.jsx)(`line`,{x1:a.p1.x,y1:a.p1.y,x2:a.p2.x,y2:a.p2.y,className:Q.doorGap},e.id):null}),m&&K.map(e=>{let n=t.find(t=>t.id===e.roomId);if(!n)return null;let r=n.points[e.wallIndex],i=n.points[(e.wallIndex+1)%n.points.length],a=ln(r,i,e.t,e.width);if(!a)return null;let o={x:(a.p1.x+a.p2.x)/2,y:(a.p1.y+a.p2.y)/2};return(0,f.jsx)(`circle`,{cx:o.x,cy:o.y,r:2.5,className:Q.doorMarker,onMouseDown:t=>{t.button===0&&(t.preventDefault(),t.stopPropagation(),k.current=e.id)}},e.id)}),a===`select`&&!m&&W&&W.points.map((e,t)=>(0,f.jsx)(`circle`,{cx:e.x,cy:e.y,r:3.5,className:Q.vertexHandle},t)),se&&(0,f.jsx)(`rect`,{x:se.x,y:se.y,width:se.w,height:se.h,className:Q.preview}),a===`polygon`&&b.length>0&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`polyline`,{points:[...b,S??b[b.length-1]].map(e=>`${e.x},${e.y}`).join(` `),className:Q.preview}),b.length>=3&&(0,f.jsx)(`circle`,{cx:b[0].x,cy:b[0].y,r:8/2,className:Q.polyCloseTarget}),b.map((e,t)=>(0,f.jsx)(`circle`,{cx:e.x,cy:e.y,r:2,className:Q.polyVertex},t))]})]}),W&&!m&&(0,f.jsxs)(`div`,{className:Q.roomDrawerInfo,children:[(0,f.jsx)(`span`,{className:Q.roomDrawerInfoLabel,children:`Name`}),(0,f.jsx)(`input`,{className:Q.roomDrawerInfoInput,value:W.name,onChange:e=>ie(e.target.value),placeholder:`Room name`}),(0,f.jsxs)(`button`,{className:Q.roomDrawerInfoDoorsBtn,onClick:()=>h(W.id),title:`Edit doors`,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDoorOpen}),(0,f.jsx)(`span`,{children:r.filter(e=>e.roomId===W.id).length})]}),(0,f.jsx)(`button`,{className:Q.roomDrawerInfoDelete,onClick:V,title:`Delete room`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faTrash})})]}),m&&G&&(0,f.jsxs)(`div`,{className:Q.roomDrawerDoorPanel,children:[(0,f.jsxs)(`div`,{className:Q.roomDrawerDoorPanelHeader,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDoorOpen,className:Q.roomDrawerDoorPanelIcon}),(0,f.jsx)(`span`,{className:Q.roomDrawerDoorPanelTitle,children:G.name?`Doors · ${G.name}`:`Doors`}),(0,f.jsxs)(`button`,{className:Q.roomDrawerDoorPanelDone,onClick:()=>h(null),title:`Done (Esc)`,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faCheck}),`Done`]})]}),(0,f.jsxs)(`div`,{className:Q.roomDrawerDoorPanelList,children:[K.length===0&&(0,f.jsx)(`span`,{className:Q.roomDrawerDoorPanelEmpty,children:`Click on a wall to add a door`}),K.map((e,t)=>(0,f.jsxs)(`div`,{className:Q.roomDrawerDoorPanelItem,children:[(0,f.jsxs)(`span`,{className:Q.roomDrawerDoorPanelLabel,children:[`Door `,t+1]}),(0,f.jsx)(`span`,{className:Q.roomDrawerDoorPanelWidthLabel,children:`Width`}),(0,f.jsx)(`input`,{className:Q.roomDrawerInfoInput,type:`number`,min:1,value:e.width,onChange:t=>ae(e.id,t.target.value)}),(0,f.jsx)(`button`,{className:Q.roomDrawerInfoDelete,onClick:()=>H(e.id),title:`Delete door`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faTrash})})]},e.id))]})]}),(0,f.jsx)(`div`,{className:Q.roomDrawerHint,children:m?`Click a wall to add a door · Adjust width or delete from the list · Done or Esc to finish`:`${Tn[a]} · Scroll to zoom · Middle-drag to pan · 0 to reset`})]})}var Dn={"roomViewer-containerLoading":`roomViewer-containerLoading_BL3M-`,roomViewerContainerLoading:`roomViewer-containerLoading_BL3M-`,"roomViewer-container":`roomViewer-container_YlmB8`,roomViewerContainer:`roomViewer-container_YlmB8`,"roomViewer-active":`roomViewer-active_gG6wf`,roomViewerActive:`roomViewer-active_gG6wf`,"roomViewer-selected":`roomViewer-selected_CpdMj`,roomViewerSelected:`roomViewer-selected_CpdMj`,"roomViewer-tint":`roomViewer-tint_O9JrM`,roomViewerTint:`roomViewer-tint_O9JrM`,"roomViewer-actions":`roomViewer-actions_4cA74`,roomViewerActions:`roomViewer-actions_4cA74`,"roomViewer-header":`roomViewer-header_XEHCO`,roomViewerHeader:`roomViewer-header_XEHCO`};function On({data:e=[]}){let t=(0,c.useRef)(null),[,n]=(0,c.useState)(null),[r,i]=(0,c.useState)(0),[a,o]=(0,c.useState)(!0);(0,c.useEffect)(()=>{let i=new AbortController;n(null);let a=t.current;return r>e.length-1||!a?(o(!1),()=>i.abort()):(a.querySelectorAll(`[id^="room"]`).forEach(e=>{e.addEventListener(`click`,()=>s(e.id,a),{signal:i.signal})}),o(!1),()=>i.abort())},[e,r]);function s(e,t){let r=e.substring(4);n(n=>{if(r===n)return n;let[i]=t.querySelectorAll(`[id="use"]`);i?.setAttribute(`href`,`#${e}`);let[a]=t.querySelectorAll(`[id="${e}"]`);if(n){let[e]=t.querySelectorAll(`[id="room${n}"]`);if(e){e.classList.remove(Dn.roomViewerSelected,Dn.roomViewerTint);let[t]=e.querySelectorAll(`[id="background"]`);t&&t.classList.remove(Dn.roomViewerTint)}}if(a){a.classList.add(Dn.roomViewerSelected);let[e]=a.querySelectorAll(`[id="background"]`);(e??a).classList.add(Dn.roomViewerTint)}return r})}function p(t){i(n=>{let r=n+t;return r<0||r>e.length-1?n:r})}let m=e[r]?.data??null;return(0,f.jsxs)(`div`,{className:Dn.roomViewer,ref:t,children:[(0,f.jsx)(`h3`,{className:Dn.roomViewerHeader,children:e[r]?.label??``}),(0,f.jsx)(`div`,{className:(0,l.default)(Dn.roomViewerContainer,a&&Dn.roomViewerContainerLoading),children:m},r),e.length>1&&(0,f.jsxs)(`div`,{className:Dn.roomViewerActions,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faChevronLeft,onClick:()=>p(-1)}),(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faLayerGroup}),(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faChevronRight,onClick:()=>p(1)})]})]})}var kn={scrollbarProvider:`scrollbarProvider_IMBFu`};function An({className:e=void 0,children:t=void 0}){return(0,f.jsx)(`div`,{className:(0,l.default)(kn.scrollbarProvider,e),children:t})}var jn=An,Mn={resultCount:`resultCount_Sn48Q`};function Nn({value:e,onChange:t,onDebounce:n,placeholder:r,label:i,debounceMs:a=500,totalAmount:o,showAmount:s=!0,className:l,width:u,...d}){let p=(0,c.useRef)(null);(0,c.useEffect)(()=>()=>{p.current!==null&&clearTimeout(p.current)},[]);function m(e){let r=e==null?``:String(e),i=r.trim()===``?``:r;t(i),p.current!==null&&clearTimeout(p.current),p.current=setTimeout(()=>{n?.(i)},a)}let h=s&&typeof o==`number`&&!Number.isNaN(o);return(0,f.jsxs)(`div`,{...d,className:l,style:u==null?void 0:{width:u},children:[(0,f.jsx)(ye,{type:Y.Search,label:i,placeholder:r,value:e,onChange:m}),h&&(0,f.jsxs)(`p`,{className:Mn.resultCount,children:[o,` `,o===1?`result`:`results`]})]})}var Pn={stepper:`stepper_kiS2A`,"stepper-clickable":`stepper-clickable_Nm6fP`,stepperClickable:`stepper-clickable_Nm6fP`,"stepper-vertical":`stepper-vertical_2y9rg`,stepperVertical:`stepper-vertical_2y9rg`,"stepper-connector":`stepper-connector_J2FwZ`,stepperConnector:`stepper-connector_J2FwZ`,"stepper-connector-vertical":`stepper-connector-vertical_vwY38`,stepperConnectorVertical:`stepper-connector-vertical_vwY38`,"stepper-connector-filled":`stepper-connector-filled_W8UZS`,stepperConnectorFilled:`stepper-connector-filled_W8UZS`,"stepper-entry":`stepper-entry_KD4JJ`,stepperEntry:`stepper-entry_KD4JJ`,"stepper-entry-active":`stepper-entry-active_V1aRt`,stepperEntryActive:`stepper-entry-active_V1aRt`,"stepper-entry-done":`stepper-entry-done_M3wb5`,stepperEntryDone:`stepper-entry-done_M3wb5`,"stepper-entry-number":`stepper-entry-number_J168Q`,stepperEntryNumber:`stepper-entry-number_J168Q`,"stepper-entry-number-done":`stepper-entry-number-done_-m7sD`,stepperEntryNumberDone:`stepper-entry-number-done_-m7sD`,showCheckmark:`showCheckmark_Rd0oW`,"stepper-entry-label":`stepper-entry-label_b94eg`,stepperEntryLabel:`stepper-entry-label_b94eg`,"stepper-entry-label-vertical":`stepper-entry-label-vertical_Zm8i4`,stepperEntryLabelVertical:`stepper-entry-label-vertical_Zm8i4`};function Fn(){return(0,f.jsx)(`svg`,{strokeLinejoin:`round`,strokeLinecap:`round`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`-0.2 -1.2 3.4 2`,height:`20px`,width:`20px`,children:(0,f.jsx)(`path`,{d:`M 0 0 l 1 1 l 2 -2`,stroke:`white`,strokeWidth:`0.4`,fill:`none`})})}function In({steps:e=[],currentStep:t=0,alignment:n=`horizontal`,onStepClicked:r=null,nonLinear:i=!1,hideLabels:a=!1,className:o,style:s,classNames:u,styles:d,...p}){let m=n===`vertical`;return(0,f.jsx)(`div`,{...p,className:(0,l.default)(Pn.stepper,{[Pn.stepperVertical]:m},u?.root,o),style:{...d?.root,...s},children:e.map((n,o)=>{let s=o<t,p=o<=t,h=!!r&&(i?o!==t:s),g=(0,l.default)(Pn.stepperEntry,{[Pn.stepperEntryActive]:p},{[Pn.stepperEntryDone]:s},{[Pn.stepperClickable]:h},u?.entry),_=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`div`,{className:(0,l.default)(Pn.stepperEntryNumber,{[Pn.stepperEntryNumberDone]:s},u?.entryNumber),style:d?.entryNumber,children:s?(0,f.jsx)(Fn,{}):o+1}),!a&&(0,f.jsx)(`div`,{className:(0,l.default)(Pn.stepperEntryLabel,{[Pn.stepperEntryLabelVertical]:m},u?.entryLabel),style:d?.entryLabel,children:n.label})]});return(0,f.jsxs)(c.default.Fragment,{children:[h?(0,f.jsx)(z,{className:g,style:d?.entry,onClick:()=>r(o),"aria-current":o===t?`step`:void 0,children:_}):(0,f.jsx)(`div`,{className:g,style:d?.entry,"aria-current":o===t?`step`:void 0,children:_}),o<e.length-1&&(0,f.jsx)(`div`,{className:(0,l.default)(Pn.stepperConnector,{[Pn.stepperConnectorFilled]:s},{[Pn.stepperConnectorVertical]:m},u?.connector),style:d?.connector})]},o)})})}var Ln={tabHeader:`tabHeader_C-b9d`,"tabHeader-tab":`tabHeader-tab_Wbyt-`,tabHeaderTab:`tabHeader-tab_Wbyt-`,"tabHeader-tab-active":`tabHeader-tab-active_IExSo`,tabHeaderTabActive:`tabHeader-tab-active_IExSo`,"tabHeader-tab-disabled":`tabHeader-tab-disabled_yWJxS`,tabHeaderTabDisabled:`tabHeader-tab-disabled_yWJxS`,"tabHeader-icon":`tabHeader-icon_ryEHB`,tabHeaderIcon:`tabHeader-icon_ryEHB`,"tabHeader-labels":`tabHeader-labels_q5Af5`,tabHeaderLabels:`tabHeader-labels_q5Af5`,"tabHeader-title":`tabHeader-title_Jq2Vy`,tabHeaderTitle:`tabHeader-title_Jq2Vy`,"tabHeader-subtitle":`tabHeader-subtitle_4lhSa`,tabHeaderSubtitle:`tabHeader-subtitle_4lhSa`};function Rn({tabs:e=[],currentTab:t,onChange:n,className:r,style:i,classNames:a,styles:o,...s}){return(0,f.jsx)(`div`,{...s,role:`tablist`,className:(0,l.default)(Ln.tabHeader,a?.root,r),style:{...o?.root,...i},children:e.map(e=>{let r=e.id===t,i=!!e.title||!!e.subtitle;return(0,f.jsxs)(z,{role:`tab`,"aria-selected":r,"aria-disabled":e.disabled||void 0,tabIndex:e.disabled?-1:0,className:(0,l.default)(Ln.tabHeaderTab,{[Ln.tabHeaderTabActive]:r},{[Ln.tabHeaderTabDisabled]:e.disabled},a?.tab),style:o?.tab,onClick:()=>{e.disabled||r||n(e.id)},children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:e.icon,className:(0,l.default)(Ln.tabHeaderIcon,a?.icon),style:o?.icon}),i&&(0,f.jsxs)(`div`,{className:(0,l.default)(Ln.tabHeaderLabels,a?.labels),style:o?.labels,children:[e.title&&(0,f.jsx)(`span`,{className:(0,l.default)(Ln.tabHeaderTitle,a?.title),style:o?.title,children:e.title}),e.subtitle&&(0,f.jsx)(`span`,{className:(0,l.default)(Ln.tabHeaderSubtitle,a?.subtitle),style:o?.subtitle,children:e.subtitle})]})]},e.id)})})}var zn=`https://tenor.googleapis.com/v2`,Bn=class{constructor(e){this.key=e}async search(e,t={}){let n=new URLSearchParams({q:e,key:this.key});return t.limit!=null&&n.set(`limit`,String(t.limit)),t.contentfilter!=null&&n.set(`contentfilter`,t.contentfilter),t.pos!=null&&n.set(`pos`,t.pos),(await fetch(`${zn}/search?${n}`)).json()}async searchSuggestions(e){let t=new URLSearchParams({q:e,key:this.key});return(await fetch(`${zn}/search_suggestions?${t}`)).json()}registerShare(e,t){let n=new URLSearchParams({id:t,q:e,key:this.key});fetch(`${zn}/registershare?${n}`).catch(()=>null)}},Vn={gifPreview:`gifPreview_-ECUZ`,"gifPreview-image":`gifPreview-image_Aq7-a`,gifPreviewImage:`gifPreview-image_Aq7-a`,"gifPreview-image-container":`gifPreview-image-container_ycypL`,gifPreviewImageContainer:`gifPreview-image-container_ycypL`,gradientBottomLeftToTopRight:`gradientBottomLeftToTopRight_wo6HB`};function Hn({className:e,previewItems:t=[],onSelect:n,onLoadAdditional:r}){function i(e){let t=e.currentTarget,n=t.scrollHeight-t.clientHeight*1.5;t.scrollTop>=n&&r?.()}return(0,f.jsx)(f.Fragment,{children:t.length>0&&(0,f.jsx)(`div`,{className:(0,l.default)(Vn.gifPreview,e),onScroll:i,children:t.map((e,t)=>(0,f.jsx)(z,{className:Vn.gifPreviewImageContainer,onClick:()=>n?.(e),children:(0,f.jsx)(`div`,{className:Vn.gifPreviewImage,style:{backgroundImage:`url(${e.media_formats.tinygif.url})`}})},`${e.id}_${t}`))})})}var Un={gifView:`gifView_Fa2zj`,"gifView-loading":`gifView-loading_LfNJr`,gifViewLoading:`gifView-loading_LfNJr`,gradientBottomLeftToTopRight:`gradientBottomLeftToTopRight_JR6aS`};function Wn({className:e,src:t=``}){let[n,r]=(0,c.useState)(!0);return(0,c.useEffect)(()=>{r(!0)},[t]),(0,f.jsxs)(`div`,{className:(0,l.default)(Un.gifView,e),children:[(0,f.jsx)(`img`,{className:Un.tenorPickerSelected,src:t,onLoad:()=>r(!1)}),n&&(0,f.jsx)(`div`,{className:Un.gifViewLoading})]})}var Gn={"tenorPicker-selected":`tenorPicker-selected_IfR2z`,tenorPickerSelected:`tenorPicker-selected_IfR2z`,"tenorPicker-modal-content":`tenorPicker-modal-content_Vkolf`,tenorPickerModalContent:`tenorPicker-modal-content_Vkolf`,"tenorPicker-suggestions-container":`tenorPicker-suggestions-container_kJCj5`,tenorPickerSuggestionsContainer:`tenorPicker-suggestions-container_kJCj5`,"tenorPicker-suggestions-item":`tenorPicker-suggestions-item_Rl99M`,tenorPickerSuggestionsItem:`tenorPicker-suggestions-item_Rl99M`};function Kn({className:e,token:t=``,isModal:n=!1,onSelect:r=()=>void 0,selected:i=null}){let a=(0,c.useMemo)(()=>new Bn(t),[t]),[o,s]=(0,c.useState)(``),[u,d]=(0,c.useState)([]),[p,m]=(0,c.useState)([]),[h,g]=(0,c.useState)(null),[_,v]=(0,c.useState)(!1);async function y(e){if(s(e),!e.trim()){d([]),m([]),g(null);return}let[{results:t=[],next:n=null},{results:r=[]}]=await Promise.all([a.search(e,{limit:18,contentfilter:`medium`}),a.searchSuggestions(e)]);d(t),g(n),m(r)}async function b(){let{results:e=[],next:t=null}=await a.search(o,{limit:36,pos:h??void 0,contentfilter:`medium`});g(t),d(t=>[...t,...e])}async function x(e){await r(e),v(!1),e&&a.registerShare(o,e.id)}function S(){return(0,f.jsx)(fe,{inline:!0,className:Gn.tenorPickerSuggestionsContainer,children:p.map(e=>(0,f.jsx)(de,{className:Gn.tenorPickerSuggestionsItem,text:e,onClick:()=>y(e)},e))})}function C(){return(0,f.jsx)(Hn,{previewItems:u,onSelect:x,onLoadAdditional:b})}function w(){return(0,f.jsx)(Nn,{label:`Pick gif`,value:o,onDebounce:y,onChange:s})}return n?(0,f.jsxs)(`div`,{className:(0,l.default)(Gn.tenorPicker,e),children:[(0,f.jsxs)(`div`,{className:E.actionButtons,children:[(0,f.jsx)(I,{onClick:()=>v(!0),children:`Pick gif`}),i&&(0,f.jsx)(I,{styleType:j.Delete,onClick:()=>x(null),children:`Remove gif`})]}),i&&(0,f.jsx)(Wn,{className:Gn.tenorPickerSelected,src:i}),(0,f.jsx)(Me,{isOpen:_,onClose:()=>v(!1),children:(0,f.jsxs)(`div`,{className:Gn.tenorPickerModalContent,children:[w(),S(),C()]})})]}):(0,f.jsxs)(`div`,{className:(0,l.default)(Gn.tenorPicker,e),children:[(0,f.jsx)(ge,{align:me.Left,isOpen:u.length>0&&_,onOpenChange:v,content:(0,f.jsxs)(f.Fragment,{children:[S(),C()]}),children:w()}),i&&(0,f.jsx)(I,{styleType:j.Delete,onClick:()=>x(null),children:`Remove gif`}),i&&(0,f.jsx)(Wn,{className:Gn.tenorPickerSelected,src:i})]})}function qn(e){return(0,f.jsx)(ye,{...e,multiline:!0})}var Jn={id:`default`,variables:{"--grey":`#8A8A8A`,"--lightgrey":`#e0e0e0`,"--lightergrey":`#B1B1B1`,"--white":`#FFFFFF`,"--red":`#D6002A`,"--lighter-red":`#ffeae9`,"--green":`#287626`,"--lighter-green":`#C4FFC9`,"--blue":`#5873d5`,"--lighter-blue":`#C6DBFF`,"--black":`black`,"--orange":`#ff7f50`,"--lighter-orange":`#ffe5d9`,"--primary-color":`#8184d6`,"--primary-accent":`#90CAF9`,"--primary-lighter":`#9a9ce4`,"--accent-color":`var(--grey)`,"--accent-color-light":`var(--lightgrey)`,"--text-color":`var(--white)`,"--text-dark":`var(--lightergrey)`,"--text-light":`var(--lightergrey)`,"--text-on-primary":`var(--white)`,"--text-on-delete":`var(--white)`,"--border-color":`#656574`,"--background":`#393945`,"--background-accent":`#33333c`,"--background-accent-dark":`var(--grey)`,"--background-accent-light":`#484856`,"--background-modal":`#484856`,"--success-color":`var(--green)`,"--success-lighter":`var(--lighter-green)`,"--error-color":`var(--red)`,"--error-lighter":`var(--lighter-red)`,"--info-color":`var(--blue)`,"--info-lighter":`var(--lighter-blue)`,"--warn-color":`var(--orange)`,"--warn-lighter":`var(--lighter-orange)`,"--default-font-size":`14px`,"--text-small-font-size":`12px`,"--header-font-size":`24px`,"--header-medium-font-size":`18px`,"--header-small-font-size":`16px`,"--default-font-weight":`400`,"--header-font-weight":`600`,"--input-background":`transparent`,"--input-icon-color":`var(--text-color)`,"--error-border-color":`var(--red)`,"--default-border-radius":`8px`,"--padding-sides":`15px`,"--margin-top":`10px`,"--default-font":`'Inter', sans-serif`,"--themed-font":`'Inter', sans-serif`,"--card-shadow":`0 3px 1px -2px rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 14%), 0 1px 5px 0 rgb(0 0 0 / 12%)`,"--spacing-s":`4px`,"--spacing-m":`8px`,"--spacing-l":`16px`}},Yn={colorFade:`colorFade_eLv2g`},Xn=class extends c.Component{constructor(...e){super(...e),this.state={resolvedVariables:{},colorFadeActive:!1,currentThemeColor:null},this.colorFadeTimeout=null,this.wrapperRef=c.default.createRef(),this.themeColorMeta=null,this.createdThemeColorMeta=!1,this.applyTheme=e=>{let t=this.props.themes??[Jn],n=t.find(e=>!e.baseThemeId)??t[0],r=n?n.variables:{},i=t.find(t=>t.id===e),a=i?this.resolveChain(i.id):[],o=Object.assign({},r,...a);this.setState({resolvedVariables:o,colorFadeActive:!0}),this.colorFadeTimeout&&clearTimeout(this.colorFadeTimeout),this.colorFadeTimeout=setTimeout(()=>{this.setState({colorFadeActive:!1}),this.colorFadeTimeout=null},500),setTimeout(()=>{this.wrapperRef.current&&this.setState({currentThemeColor:getComputedStyle(this.wrapperRef.current).getPropertyValue(`--primary-color`).trim()})},1)}}componentDidMount(){this.applyTheme(this.props.currentThemeId),this.syncThemeColorMeta(this.state.currentThemeColor??``)}componentDidUpdate(e,t){t.currentThemeColor!==this.state.currentThemeColor&&this.syncThemeColorMeta(this.state.currentThemeColor??``),(e.currentThemeId!==this.props.currentThemeId||e.themes!==this.props.themes)&&this.applyTheme(this.props.currentThemeId)}componentWillUnmount(){this.colorFadeTimeout&&clearTimeout(this.colorFadeTimeout),this.createdThemeColorMeta&&this.themeColorMeta?.remove()}syncThemeColorMeta(e){if(!(typeof document>`u`)){if(!this.themeColorMeta){let e=document.head.querySelector(`meta[name="theme-color"]`);if(e)this.themeColorMeta=e;else{let e=document.createElement(`meta`);e.setAttribute(`name`,`theme-color`),document.head.appendChild(e),this.themeColorMeta=e,this.createdThemeColorMeta=!0}}this.themeColorMeta.setAttribute(`content`,e)}}resolveChain(e){let t=(this.props.themes??[Jn]).find(t=>t.id===e);return t?[...t.baseThemeId?this.resolveChain(t.baseThemeId):[],t.variables]:[]}render(){let{children:e}=this.props,{resolvedVariables:t,colorFadeActive:n}=this.state;return(0,f.jsx)(`div`,{ref:this.wrapperRef,id:`themeProvider`,className:n?Yn.colorFade:void 0,style:t,children:e})}};function Zn(e=`default`){let[t,n]=(0,c.useState)(localStorage.getItem(`theme`)||e);return{currentThemeId:t,setCurrentThemeId:e=>{n(e),localStorage.setItem(`theme`,e)}}}var Qn={container:`container_krdsW`,"container-top-left":`container-top-left_zfDTO`,containerTopLeft:`container-top-left_zfDTO`,"container-top-center":`container-top-center_CUIGc`,containerTopCenter:`container-top-center_CUIGc`,"container-top-right":`container-top-right_sB0KU`,containerTopRight:`container-top-right_sB0KU`,"container-bottom-left":`container-bottom-left_toJdF`,containerBottomLeft:`container-bottom-left_toJdF`,"container-bottom-center":`container-bottom-center_Bkf9m`,containerBottomCenter:`container-bottom-center_Bkf9m`,"container-bottom-right":`container-bottom-right_oRSMc`,containerBottomRight:`container-bottom-right_oRSMc`,toast:`toast_qBi4o`,toastSlideDown:`toastSlideDown_4lKWq`,"toast-bottom":`toast-bottom_X8ZIe`,toastBottom:`toast-bottom_X8ZIe`,toastSlideUp:`toastSlideUp_SGR5X`,"toast-dismissing":`toast-dismissing_xKmB-`,toastDismissing:`toast-dismissing_xKmB-`,toastFadeOut:`toastFadeOut_cvHYp`,"toast-info":`toast-info_RlLli`,toastInfo:`toast-info_RlLli`,toastIcon:`toastIcon_xU1nA`,"toast-success":`toast-success_I1g1B`,toastSuccess:`toast-success_I1g1B`,"toast-error":`toast-error_MloFO`,toastError:`toast-error_MloFO`,"toast-warn":`toast-warn_pP6HB`,toastWarn:`toast-warn_pP6HB`,"toast-default":`toast-default_RTt2L`,toastDefault:`toast-default_RTt2L`,toastContent:`toastContent_gvyIv`,toastCloseButton:`toastCloseButton_n-YST`,toastProgressBar:`toastProgressBar_6vBs6`,toastShrink:`toastShrink_h89HS`},$n={info:d.faCircleInfo,success:d.faCircleCheck,error:d.faCircleXmark,warn:d.faTriangleExclamation,default:d.faBell};function er({item:e,isBottom:t,onDismiss:n}){let{id:r,content:i,options:a,dismissing:o}=e,{duration:s,showRemainingTime:p,showCloseButton:m,type:h,classNames:g,styles:_}=a;return(0,c.useEffect)(()=>{if(s===0)return;let e=setTimeout(()=>n(r),s);return()=>clearTimeout(e)},[r,s,n]),(0,f.jsxs)(`div`,{className:(0,l.default)(Qn.toast,t?Qn.toastBottom:null,Qn[`toast-${h}`],o&&Qn.toastDismissing,g?.root),style:_?.root,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:$n[h],className:(0,l.default)(Qn.toastIcon,g?.icon),style:_?.icon}),(0,f.jsx)(`div`,{className:(0,l.default)(Qn.toastContent,g?.content),style:_?.content,children:i}),m&&(0,f.jsx)(B,{icon:d.faXmark,onClick:()=>n(r),className:(0,l.default)(Qn.toastCloseButton,g?.closeButton),style:_?.closeButton,"aria-label":`Close`}),p&&s>0&&(0,f.jsx)(`div`,{className:(0,l.default)(Qn.toastProgressBar,g?.progressBar),style:{"--toast-duration":`${s}ms`,..._?.progressBar}})]})}var tr=null;function nr(e){tr=e}function rr(){tr=null}function ir(e,t){if(!tr){console.error(`[Toast] No ToastProvider found. Wrap your app with <ToastProvider>.`);return}tr(e,t)}var ar={position:`top-right`,duration:4e3,showRemainingTime:!0,showCloseButton:!0,allowStacking:!0},or=220;function sr(e){return Qn[`container-${e}`]}function cr({children:e,position:t=ar.position,duration:n=ar.duration,showRemainingTime:r=ar.showRemainingTime,showCloseButton:i=ar.showCloseButton,allowStacking:a=ar.allowStacking}){let[o,s]=(0,c.useState)([]),u=(0,c.useRef)(0),d=(0,c.useCallback)(e=>{s(t=>t.map(t=>t.id===e?{...t,dismissing:!0}:t)),setTimeout(()=>{s(t=>t.filter(t=>t.id!==e))},or)},[]),p=(0,c.useCallback)((e,o)=>{let c={position:o?.position??t,duration:o?.duration??n,showRemainingTime:o?.showRemainingTime??r,showCloseButton:o?.showCloseButton??i,type:o?.type??`default`,classNames:o?.classNames,styles:o?.styles};u.current+=1;let l={id:`toast-${u.current}`,content:e,options:c,dismissing:!1};s(e=>!a&&e.length>0?(setTimeout(()=>{s([l])},or),e.map(e=>({...e,dismissing:!0}))):[...e,l])},[t,n,r,i,a]);(0,c.useEffect)(()=>(nr(p),()=>rr()),[p]);let m=o.reduce((e,t)=>{let n=t.options.position;return e[n]||(e[n]=[]),e[n].push(t),e},{});return(0,f.jsxs)(f.Fragment,{children:[e,(0,f.jsx)(ie,{children:Object.entries(m).map(([e,t])=>(0,f.jsx)(`div`,{className:(0,l.default)(Qn.container,sr(e)),children:t.map(t=>(0,f.jsx)(er,{item:t,isBottom:e.startsWith(`bottom`),onDismiss:d},t.id))},e))})]})}var $={virtualList:`virtualList_qBPNc`,"virtualList-drag-clone":`virtualList-drag-clone_artnC`,virtualListDragClone:`virtualList-drag-clone_artnC`,"virtualList-header":`virtualList-header_0Ellb`,virtualListHeader:`virtualList-header_0Ellb`,"virtualList-header-cell":`virtualList-header-cell_c8NGV`,virtualListHeaderCell:`virtualList-header-cell_c8NGV`,"virtualList-header-toggle":`virtualList-header-toggle_pYFxD`,virtualListHeaderToggle:`virtualList-header-toggle_pYFxD`,"virtualList-toggle-wrapper":`virtualList-toggle-wrapper_JP32M`,virtualListToggleWrapper:`virtualList-toggle-wrapper_JP32M`,"virtualList-toggle-popover":`virtualList-toggle-popover_gbpd7`,virtualListTogglePopover:`virtualList-toggle-popover_gbpd7`,"virtualList-toggle-item":`virtualList-toggle-item_5gu5d`,virtualListToggleItem:`virtualList-toggle-item_5gu5d`,"virtualList-column-chip":`virtualList-column-chip_nOqr6`,virtualListColumnChip:`virtualList-column-chip_nOqr6`,"virtualList-select-cell":`virtualList-select-cell_s9kAy`,virtualListSelectCell:`virtualList-select-cell_s9kAy`,"virtualList-body":`virtualList-body_k-fRr`,virtualListBody:`virtualList-body_k-fRr`,"virtualList-row":`virtualList-row_TTY50`,virtualListRow:`virtualList-row_TTY50`,"virtualList-row-no-divider":`virtualList-row-no-divider_Ct0gV`,virtualListRowNoDivider:`virtualList-row-no-divider_Ct0gV`,"virtualList-row-no-hover":`virtualList-row-no-hover_2d3mH`,virtualListRowNoHover:`virtualList-row-no-hover_2d3mH`,"virtualList-row-selected":`virtualList-row-selected_hwEN-`,virtualListRowSelected:`virtualList-row-selected_hwEN-`,"virtualList-row-draggable":`virtualList-row-draggable_I86ha`,virtualListRowDraggable:`virtualList-row-draggable_I86ha`,"virtualList-row-dragging":`virtualList-row-dragging_6T5tQ`,virtualListRowDragging:`virtualList-row-dragging_6T5tQ`,"virtualList-row-drop-inside":`virtualList-row-drop-inside_Uhi9n`,virtualListRowDropInside:`virtualList-row-drop-inside_Uhi9n`,"virtualList-drop-line":`virtualList-drop-line_EM-g4`,virtualListDropLine:`virtualList-drop-line_EM-g4`,"virtualList-drop-line-before":`virtualList-drop-line-before_n-0iZ`,virtualListDropLineBefore:`virtualList-drop-line-before_n-0iZ`,"virtualList-drop-line-after":`virtualList-drop-line-after_2dld-`,virtualListDropLineAfter:`virtualList-drop-line-after_2dld-`,"virtualList-reordering":`virtualList-reordering_Rt9E3`,virtualListReordering:`virtualList-reordering_Rt9E3`,"virtualList-cell":`virtualList-cell_H0zBv`,virtualListCell:`virtualList-cell_H0zBv`,"virtualList-loading-full":`virtualList-loading-full_wzZNM`,virtualListLoadingFull:`virtualList-loading-full_wzZNM`,"virtualList-loading-indicator":`virtualList-loading-indicator_EJced`,virtualListLoadingIndicator:`virtualList-loading-indicator_EJced`,"virtualList-spinner":`virtualList-spinner_apClW`,virtualListSpinner:`virtualList-spinner_apClW`};function lr({index:e,top:t,padding:n,columnTemplate:r,isSelected:i,showDivider:a,hover:o,onClick:s,observer:u,ariaRowIndex:d,ariaPosInSet:p,ariaSetSize:m,rowRole:h,reorderable:g,draggable:_,isDragging:v,reserveToggleGutter:y,onMouseDown:b,onDragStart:x,onDragOver:S,onDragEnd:C,onDrop:w,onTouchStart:T,dropPosition:E,dropIndentPx:D,dropIndicatorClassName:O,dropIndicatorStyle:k,rowClassName:A,rowStyle:j,children:M}){let N=(0,c.useRef)(null);return(0,c.useLayoutEffect)(()=>{let e=N.current;if(!(!e||!u))return u.observe(e),()=>u.unobserve(e)},[u]),(0,f.jsxs)(`div`,{ref:N,"data-index":e,className:(0,l.default)($.virtualListRow,i&&$.virtualListRowSelected,!a&&$.virtualListRowNoDivider,!o&&$.virtualListRowNoHover,g&&$.virtualListRowDraggable,v&&$.virtualListRowDragging,E===`inside`&&$.virtualListRowDropInside,A),style:{position:`absolute`,top:0,left:0,right:0,transform:`translateY(${t}px)`,...n==null?{}:{padding:n},...r?{display:`grid`,gridTemplateColumns:r}:{},...y?{paddingRight:32}:{},...j},onClick:s,draggable:_,onMouseDown:b,onDragStart:x,onDragOver:S,onDragEnd:C,onDrop:w??(_?e=>e.preventDefault():void 0),onTouchStart:T,onContextMenu:_?e=>e.preventDefault():void 0,"aria-selected":i,"aria-rowindex":d,"aria-posinset":p,"aria-setsize":m,role:h,children:[(E===`before`||E===`after`)&&(0,f.jsx)(`div`,{"data-drop-line":E,"aria-hidden":!0,className:(0,l.default)($.virtualListDropLine,E===`before`?$.virtualListDropLineBefore:$.virtualListDropLineAfter,O),style:{left:D??0,...k}}),M]})}function ur(e,t,n,r=0){let i=e.length,a=Array(i+1);a[0]=0;for(let o=0;o<i;o++){let s=o<i-1?r:0;a[o+1]=a[o]+(t.get(e[o])??n)+s}return{offsets:a,totalHeight:a[i]}}function dr(e,t,n){if(n<=0)return 0;let r=0,i=n-1;for(;r<i;){let n=r+i>>1;e[n+1]<=t?r=n+1:i=n}return r}function fr(e,t,n,r,i){if(i===0)return{startIndex:0,endIndex:-1};let a=dr(e,t,i),o=a;for(;o<i&&e[o]<t+n;)o++;return{startIndex:Math.max(0,a-r),endIndex:Math.min(i-1,o+r-1)}}function pr(e,t,n,r,i){if(e===-1||e===t)return null;let a=r+i/2;return(t>e?n>=a:n<=a)?t:null}function mr(e,t,n,r){if(n<=0)return`before`;let i=(e-t)/n;return r?i<1/3?`before`:i>2/3?`after`:`inside`:i<.5?`before`:`after`}function hr(e,t){let n=t[e],r=e+1;for(;r<t.length&&t[r]>n;)r++;return r-1}function gr(e,t){return e.length===0?`1fr`:e.map(e=>{switch(e.width.type){case`fixed`:return`${e.width.px}px`;case`flex`:return`${e.width.weight??1}fr`;case`fit`:{let n=t?.[e.key];return n==null?`fit-content(100%)`:`${n}px`}}}).join(` `)}var _r=`ahroweui:virtuallist:columns:`;function vr(e){if(!e||typeof window>`u`)return null;try{let t=window.localStorage.getItem(_r+e);if(!t)return null;let n=JSON.parse(t);if(n&&Array.isArray(n.visible)&&Array.isArray(n.known))return{visible:n.visible.filter(e=>typeof e==`string`),known:n.known.filter(e=>typeof e==`string`)}}catch{}return null}function yr(e,t){return t&&t.known.includes(e.key)?t.visible.includes(e.key):!e.defaultHidden}function br(e,t){if(typeof e==`number`)return e;let n=e.trim();if(n===``)return 0;let r=Number(n);if(!Number.isNaN(r))return r;let i=/^(-?\d*\.?\d+)px$/.exec(n);if(i)return parseFloat(i[1]);if(typeof document>`u`||!t)return 0;let a=document.createElement(`div`);a.style.cssText=`position:absolute;visibility:hidden;height:${n};`,t.appendChild(a);let o=a.getBoundingClientRect().height;return t.removeChild(a),Number.isFinite(o)?o:0}function xr({items:e,keys:t,getItemKey:n,estimatedRowHeight:r,rowGap:i,overscan:a,onLoadMore:o,loadMoreThreshold:s}){let[l,u]=(0,c.useState)(0),[d,f]=(0,c.useState)(0),[p,m]=(0,c.useState)(0),[h,g]=(0,c.useState)(()=>br(i,null)),[_,v]=(0,c.useState)(new Map),[y,b]=(0,c.useState)(!1),x=(0,c.useRef)(!1),S=(0,c.useRef)(null),C=(0,c.useRef)(null),w=(0,c.useRef)([]),T=(0,c.useRef)(null),E=(0,c.useRef)(0),D=(0,c.useRef)([]),[O]=(0,c.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(e=>{v(t=>{let n=null;for(let r of e){let e=r.target,i=Number(e.dataset.index);if(Number.isNaN(i))continue;let a=D.current[i];if(a===void 0)continue;let o=r.borderBoxSize?.[0],s=o?Math.round(o.blockSize):e.offsetHeight;t.get(a)!==s&&(n||=new Map(t),n.set(a,s))}return n??t})}));(0,c.useEffect)(()=>()=>O?.disconnect(),[O]),(0,c.useLayoutEffect)(()=>{let e=S.current;if(!e)return;f(e.clientHeight),m(e.clientWidth);let t=new ResizeObserver(()=>{f(e.clientHeight),m(e.clientWidth)});return t.observe(e),()=>t.disconnect()},[]);let k=(0,c.useCallback)(e=>{let t=e.currentTarget;E.current=t.scrollTop,T.current??=requestAnimationFrame(()=>{T.current=null,u(E.current)}),o&&!x.current&&t.scrollTop+t.clientHeight>=t.scrollHeight-s&&(x.current=!0,b(!0),o().finally(()=>{x.current=!1,b(!1)}))},[o,s]);(0,c.useEffect)(()=>()=>{T.current!=null&&cancelAnimationFrame(T.current)},[]),(0,c.useLayoutEffect)(()=>{D.current=t}),(0,c.useLayoutEffect)(()=>{let e=br(i,S.current);g(t=>t===e?t:e)},[i,p,d]);let{offsets:A,totalHeight:j}=(0,c.useMemo)(()=>ur(t,_,r,h),[t,_,r,h]);(0,c.useLayoutEffect)(()=>{let t=S.current,n=w.current;if(w.current=A,!t||n.length===0)return;let r=t.scrollTop;if(r<=0)return;let i=dr(n,r,n.length-1);if(i>=e.length)return;let a=r-n[i],o=A[i]+a;Math.abs(o-r)>.5&&(t.scrollTop=o,E.current=o,u(o))},[A,e.length]);let M=(0,c.useMemo)(()=>{function t(e,t){let n=S.current;if(!n)return;let r=Math.max(0,e);typeof n.scrollTo==`function`?n.scrollTo({top:r,behavior:t??`auto`}):n.scrollTop=r}function r(n,r){let i=S.current;if(!i||e.length===0)return;let a=Math.max(0,Math.min(n,e.length-1)),o=A[a]??0,s=(A[a+1]??o)-o,c=C.current?.offsetHeight??0,l=Math.max(0,i.clientHeight-c),u=r?.align??`start`,d=o-c;u===`center`?d-=(l-s)/2:u===`end`&&(d-=l-s),t(d,r?.behavior)}return{scrollToIndex:r,scrollToKey(t,i){let a=e.findIndex((e,r)=>(n?n(e,r):r)===t);a>=0&&r(a,i)},scrollToTop(e){t(0,e?.behavior)},getScrollElement:()=>S.current}},[e,A,n]),{startIndex:N,endIndex:P}=(0,c.useMemo)(()=>fr(A,l,d,a,e.length),[A,l,d,a,e.length]);return{rootRef:S,headerRef:C,rowObserver:O,keysRef:D,offsets:A,totalHeight:j,containerHeight:d,containerWidth:p,startIndex:N,endIndex:P,handleScroll:k,showLoadMoreSpinner:y,scrollApi:M}}function Sr({items:e,getKey:t,multiSelect:n,selectedKeys:r,onSelectionChange:i}){let a=r!==void 0,[o,s]=(0,c.useState)(new Set),l=a?r:o;function u(e){a||s(e),i?.(e)}function d(e){let t=new Set(l);t.has(e)?t.delete(e):t.add(e),u(t)}function f(){let n=e.map((e,n)=>t(e,n));u(n.every(e=>l.has(e))?new Set:new Set(n))}let{allSelected:p,someSelected:m}=(0,c.useMemo)(()=>{if(!n||e.length===0)return{allSelected:!1,someSelected:!1};let r=e.every((e,n)=>l.has(t(e,n)));return{allSelected:r,someSelected:!r&&e.some((e,n)=>l.has(t(e,n)))}},[n,e,l,t]);return{effectiveSelectedKeys:l,handleRowSelect:d,handleSelectAll:f,allSelected:p,someSelected:m}}function Cr({columns:e,items:t,multiSelect:n,visibleColumnKeys:r,onVisibleColumnsChange:i,persistColumnsKey:a,showColumnToggle:o,rootRef:s,startIndex:l,endIndex:u,containerHeight:d,containerWidth:f}){let p=r!==void 0,[m,h]=(0,c.useState)(!1),g=(0,c.useRef)(null),[_,v]=(0,c.useState)({}),[y,b]=(0,c.useState)(()=>{let t=vr(a);return new Set((e??[]).filter(e=>yr(e,t)).map(e=>e.key))}),x=(0,c.useRef)(new Set((e??[]).map(e=>e.key)));(0,c.useEffect)(()=>{if(p)return;let t=e??[],n=new Set(t.map(e=>e.key)),r=x.current,i=n.size===r.size;if(i){for(let e of n)if(!r.has(e)){i=!1;break}}if(i)return;x.current=n;let o=vr(a);b(e=>{let n=new Set;for(let i of t)r.has(i.key)?e.has(i.key)&&n.add(i.key):yr(i,o)&&n.add(i.key);return n})},[e,p,a]),(0,c.useEffect)(()=>{if(p||!a||typeof window>`u`)return;let t=e??[];if(!(t.length===0||y.size===0))try{window.localStorage.setItem(_r+a,JSON.stringify({visible:[...y],known:t.map(e=>e.key)}))}catch{}},[y,e,p,a]);let S=p?new Set(r):y;(0,c.useEffect)(()=>{if(!m)return;function e(e){g.current&&!g.current.contains(e.target)&&h(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[m]);let C=!!e?.length,w=C?e.filter(e=>S.has(e.key)):[],T=C?e.filter(e=>!e.defaultHidden&&!S.has(e.key)).length:0,E=C?`${n&&C?`40px `:``}${gr(w,_)}`:void 0,D=o!==!1&&C,O=w.filter(e=>e.width.type===`fit`),k=O.length>0,A=O.map(e=>e.key).join(`|`),[j,M]=(0,c.useState)({key:A,items:t});(j.key!==A||j.items!==t)&&(M({key:A,items:t}),Object.keys(_).length>0&&v({}));let N=(0,c.useCallback)(()=>{let e=s.current;if(!e)return;let t=new Map;e.querySelectorAll(`[data-fit-key]`).forEach(e=>{let n=e,r=n.getAttribute(`data-fit-key`);if(!r)return;let i=n.scrollWidth>n.clientWidth&&parseFloat(getComputedStyle(n).paddingRight)||0,a=n.scrollWidth+i;a>(t.get(r)??0)&&t.set(r,a)}),t.size!==0&&v(n=>{let r=!1,i={...n};for(let[a,o]of t){if(o<=0)continue;let t=Math.min(Math.ceil(o),e.clientWidth);t>(n[a]??0)&&(i[a]=t,r=!0)}return r?i:n})},[s]),[P]=(0,c.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(()=>N())),F=(0,c.useRef)(new Set);(0,c.useEffect)(()=>()=>{P?.disconnect(),F.current.clear()},[P]),(0,c.useLayoutEffect)(()=>{if(!k)return;let e=s.current;if(!e||(N(),!P))return;let t=new Set(e.querySelectorAll(`[data-fit-key]`)),n=F.current;for(let e of n)t.has(e)||(P.unobserve(e),n.delete(e));for(let e of t)n.has(e)||(P.observe(e),n.add(e))},[k,A,_,l,u,d,f,t,N,P]),(0,c.useEffect)(()=>{if(!k)return;let e=0,t=requestAnimationFrame(()=>{N(),e=requestAnimationFrame(()=>N())});return()=>{cancelAnimationFrame(t),cancelAnimationFrame(e)}},[k,A,t,N]);let ee=(0,c.useCallback)(()=>v({}),[]);function te(e){let t=new Set(S);if(t.has(e)){if(t.size<=1)return;t.delete(e)}else t.add(e);let n=[...t];p||b(t),i?.(n)}return{hasColumns:C,visibleColumns:w,columnTemplate:E,shouldShowToggle:D,effectiveVisible:S,manuallyHiddenCount:T,toggleOpen:m,setToggleOpen:h,toggleRef:g,handleToggleColumn:te,recalculateColumns:ee}}function wr({reorderable:e,treeReorder:t,onReorder:n,onTreeDrop:r,longPressDelay:i,dragHandle:a,treeIndentPx:o,keys:s,depths:l,isGroupAt:u,rootRef:d,keysRef:f}){let p=(0,c.useRef)(null),[m,h]=(0,c.useState)(null),[g,_]=(0,c.useState)(null),v=(0,c.useRef)(null),y=(0,c.useRef)(n),b=(0,c.useRef)(r),x=(0,c.useRef)(t),S=(0,c.useRef)(l),C=(0,c.useRef)(u),w=(0,c.useRef)(!0),T=(0,c.useRef)(null),E=(0,c.useRef)(!1),D=(0,c.useRef)(null),O=(0,c.useRef)(0),k=(0,c.useRef)(0),A=(0,c.useRef)(null),j=(0,c.useRef)(!1),M=(0,c.useRef)(null),N=(0,c.useRef)(0),P=(0,c.useRef)(0),F=(0,c.useRef)(0),[ee]=(0,c.useState)(()=>typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(`(pointer: coarse)`).matches:!1);(0,c.useLayoutEffect)(()=>{y.current=n,b.current=r,x.current=t,S.current=l,v.current=g,C.current=u});function te(e){w.current=!!e.target.closest(`[data-drag-handle]`)}function I(e,n){if(a&&!w.current){n.preventDefault();return}p.current=e,h(e),t&&_(null)}function ne(e,t,n){let r=p.current;if(r==null)return null;let i=s.indexOf(r);if(i!==-1&&e>=i&&e<=hr(i,l))return null;let a=mr(t,n.top,n.height,u(e));return{key:s[e],position:a}}function L(e,t){t.preventDefault();let n=t.currentTarget.getBoundingClientRect(),r=ne(e,t.clientY,n);_(e=>e?.key===r?.key&&e?.position===r?.position?e:r)}function R(){let e=p.current,t=v.current;e!=null&&t&&t.key!==e&&r?.(e,t)}function z(e){e.preventDefault(),R(),_(null),p.current=null,h(null)}function re(){_(null),p.current=null,h(null)}function B(e,t){t.preventDefault();let r=p.current;if(r==null)return;let i=s.indexOf(r),a=t.currentTarget.getBoundingClientRect(),o=pr(i,e,t.clientY,a.top,a.height);o!=null&&n?.(i,o)}function ie(){p.current=null,h(null)}let ae=(0,c.useCallback)(e=>{let t=p.current,n=d.current;if(t==null||!n)return;let r=M.current?k.current-N.current+F.current/2:k.current,i=document.elementFromPoint(e,r),a=i&&n.contains(i)?i.closest(`[data-index]`):null;if(!a)return;let o=Number(a.dataset.index);if(Number.isNaN(o))return;let s=f.current.indexOf(t),c=a.getBoundingClientRect();if(x.current){let e=f.current,t=S.current;if(s!==-1&&o>=s&&o<=hr(s,t)){_(null);return}let n=mr(r,c.top,c.height,C.current(o)),i={key:e[o],position:n};_(e=>e?.key===i.key&&e?.position===i.position?e:i);return}let l=pr(s,o,r,c.top,c.height);l!=null&&y.current?.(s,l)},[d,f]),V=(0,c.useCallback)(()=>{let e=M.current;e&&(e.style.transform=`translate(${P.current}px, ${k.current-N.current}px)`)},[]),H=(0,c.useCallback)(()=>{let e=d.current;if(!e||!E.current){A.current=null;return}let t=e.getBoundingClientRect(),n=O.current,r=k.current,i=0;n>=t.left&&n<=t.right&&r>=t.top&&r<=t.bottom&&(r<t.top+48?i=-Math.min(18,Math.ceil((t.top+48-r)/3)):r>t.bottom-48&&(i=Math.min(18,Math.ceil((r-(t.bottom-48))/3)))),i!==0&&(e.scrollTop+=i,ae(n)),A.current=requestAnimationFrame(H)},[ae,d]),U=(0,c.useCallback)(()=>{if(T.current!=null&&(clearTimeout(T.current),T.current=null),window.removeEventListener(`touchmove`,oe),window.removeEventListener(`touchend`,U),window.removeEventListener(`touchcancel`,U),A.current!=null&&(cancelAnimationFrame(A.current),A.current=null),M.current&&=(M.current.remove(),null),document.body.style.touchAction=``,document.body.style.overscrollBehavior=``,E.current&&(j.current=!0,setTimeout(()=>{j.current=!1},350),x.current)){let e=p.current,t=v.current;e!=null&&t&&t.key!==e&&b.current?.(e,t)}_(null),E.current=!1,D.current=null,p.current=null,h(null)},[]),oe=(0,c.useCallback)(e=>{let t=e.touches[0];if(t){if(O.current=t.clientX,k.current=t.clientY,!E.current){let e=D.current;e!=null&&Math.abs(t.clientY-e)>10&&T.current!=null&&(clearTimeout(T.current),T.current=null);return}e.cancelable&&e.preventDefault(),V(),ae(t.clientX)}},[ae,V]);function se(n,r){if(!e&&!t||a&&!r.target.closest(`[data-drag-handle]`)||T.current!=null||E.current)return;let o=r.touches[0];o&&(D.current=o.clientY,O.current=o.clientX,k.current=o.clientY,window.addEventListener(`touchmove`,oe,{passive:!1}),window.addEventListener(`touchend`,U),window.addEventListener(`touchcancel`,U),T.current=window.setTimeout(()=>{T.current=null,E.current=!0,p.current=n,h(n),navigator.vibrate?.(10),document.body.style.touchAction=`none`,document.body.style.overscrollBehavior=`none`,W(n),A.current??=requestAnimationFrame(H)},i))}function W(e){let t=d.current;if(!t)return;let n=f.current.indexOf(e),r=t.querySelector(`[data-index="${n}"]`);if(!r)return;let i=r.getBoundingClientRect();N.current=k.current-i.top,P.current=i.left,F.current=i.height;let a=r.cloneNode(!0);a.removeAttribute(`data-index`),a.setAttribute(`data-drag-clone`,`true`),a.setAttribute(`aria-hidden`,`true`),a.classList.add($.virtualListDragClone),Object.assign(a.style,{position:`fixed`,left:`0`,top:`0`,width:`${i.width}px`,height:`${i.height}px`,margin:`0`,opacity:`1`,pointerEvents:`none`,zIndex:`2`,background:`var(--background)`,boxShadow:`var(--card-shadow)`,borderRadius:`var(--default-border-radius)`}),t.appendChild(a),M.current=a,V()}(0,c.useEffect)(()=>U,[U]);let G=e||t;function K(n,r){let i=t&&g?.key===r?g.position:void 0;return{reorderable:G,draggable:G&&!ee||void 0,isDragging:G&&r===m,onMouseDown:G&&a?te:void 0,onDragStart:G?e=>I(r,e):void 0,onDragOver:t?e=>L(n,e):e?e=>B(n,e):void 0,onDragEnd:t?re:e?ie:void 0,onDrop:t?z:void 0,onTouchStart:G?e=>se(r,e):void 0,dropPosition:i,dropIndentPx:i?(l[n]??0)*o:void 0}}function ce(){return j.current?(j.current=!1,!0):!1}return{draggingKey:m,dragEnabled:G,getRowDragProps:K,consumeSuppressedClick:ce}}function Tr({items:e,renderRow:t,columns:n,height:r=`100%`,estimatedRowHeight:i=40,overscan:a=3,rowGap:o=0,rowPadding:s,selectedKey:p,getItemKey:m,onRowClick:h,visibleColumnKeys:g,onVisibleColumnsChange:_,persistColumnsKey:v,showColumnToggle:y,onLoadMore:b,loadMoreThreshold:x=100,isLoading:S=!1,multiSelect:C=!1,selectedKeys:w,onSelectionChange:T,reorderable:E=!1,onReorder:D,longPressDelay:O=400,treeReorder:k=!1,getItemDepth:j,isGroup:M,onTreeDrop:N,treeIndentPx:P=24,dragHandle:F=!1,showDivider:ee=!0,rowHover:te=!0,className:I,style:ne,classNames:L,styles:R,...z},re){let B=(0,c.useCallback)((e,t)=>m?m(e,t):t,[m]),ie=(0,c.useMemo)(()=>e.map((e,t)=>B(e,t)),[e,B]),ae=(0,c.useMemo)(()=>j?e.map((e,t)=>j(e,t)):[],[e,j]),V=(0,c.useCallback)(t=>M?M(e[t],t):!1,[M,e]),H=xr({items:e,keys:ie,getItemKey:m,estimatedRowHeight:i,rowGap:o,overscan:a,onLoadMore:b,loadMoreThreshold:x}),{rootRef:U,headerRef:oe,rowObserver:se,keysRef:W,offsets:G,totalHeight:K,startIndex:le,endIndex:q}=H,ue=Sr({items:e,getKey:B,multiSelect:C,selectedKeys:w,onSelectionChange:T}),{effectiveSelectedKeys:de}=ue,{hasColumns:fe,visibleColumns:pe,columnTemplate:me,shouldShowToggle:he,effectiveVisible:ge,manuallyHiddenCount:_e,toggleOpen:ve,setToggleOpen:J,toggleRef:Y,handleToggleColumn:ye,recalculateColumns:be}=Cr({columns:n,items:e,multiSelect:C,visibleColumnKeys:g,onVisibleColumnsChange:_,persistColumnsKey:v,showColumnToggle:y,rootRef:U,startIndex:le,endIndex:q,containerHeight:H.containerHeight,containerWidth:H.containerWidth});(0,c.useImperativeHandle)(re,()=>({...H.scrollApi,recalculateColumns:be}),[H.scrollApi,be]);let xe=wr({reorderable:E,treeReorder:k,onReorder:D,onTreeDrop:N,longPressDelay:O,dragHandle:F,treeIndentPx:P,keys:ie,depths:ae,isGroupAt:V,rootRef:U,keysRef:W}),Se=typeof s==`number`?`${s}px`:s,Ce=n=>{let r=e[n],i=B(r,n),a=p!=null&&i===p||de.has(i),o=xe.getRowDragProps(n,i);return(0,f.jsx)(lr,{index:n,top:G[n],padding:Se,columnTemplate:me,isSelected:a,showDivider:ee,hover:te,onClick:()=>{xe.consumeSuppressedClick()||h?.(r,n)},observer:se,ariaRowIndex:fe?n+2:void 0,ariaPosInSet:fe?void 0:n+1,ariaSetSize:fe?void 0:e.length,rowRole:fe?`row`:`listitem`,reserveToggleGutter:he,...o,dropIndicatorClassName:L?.dropIndicator,dropIndicatorStyle:R?.dropIndicator,rowClassName:L?.row,rowStyle:R?.row,children:fe?(0,f.jsxs)(f.Fragment,{children:[C&&(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListSelectCell,L?.selectCell),style:R?.selectCell,role:`gridcell`,onClick:e=>e.stopPropagation(),children:(0,f.jsx)(ce,{selected:de.has(i),onToggle:()=>ue.handleRowSelect(i),"aria-label":`Select row`})}),pe.map(e=>(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListCell,L?.cell),style:R?.cell,role:`gridcell`,"data-fit-key":e.width.type===`fit`?e.key:void 0,children:e.renderCell(r,n)},e.key))]}):t?.(r,n)},i)},we=[];for(let e=le;e<=q;e++)we.push(Ce(e));let Te=xe.draggingKey==null?-1:ie.indexOf(xe.draggingKey);return Te>=0&&(Te<le||Te>q)&&we.push(Ce(Te)),(0,f.jsxs)(`div`,{...z,ref:U,className:(0,l.default)($.virtualList,xe.draggingKey!=null&&$.virtualListReordering,I,L?.root),style:{height:r,...ne,...R?.root},onScroll:H.handleScroll,role:fe?`grid`:`list`,"aria-rowcount":fe?e.length+1:void 0,children:[fe&&(0,f.jsxs)(`div`,{ref:oe,className:(0,l.default)($.virtualListHeader,L?.header),style:{gridTemplateColumns:me,...he?{paddingRight:32}:{},...R?.header},role:`row`,"aria-rowindex":1,children:[C&&(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListSelectCell,L?.selectCell),style:R?.selectCell,role:`columnheader`,children:(0,f.jsx)(ce,{selected:ue.allSelected||ue.someSelected,onToggle:ue.handleSelectAll,"aria-label":`Select all rows`})}),pe.map(e=>(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListHeaderCell,L?.headerCell),style:R?.headerCell,role:`columnheader`,"data-fit-key":e.width.type===`fit`?e.key:void 0,children:e.label},e.key)),he&&(0,f.jsxs)(`div`,{ref:Y,className:$.virtualListToggleWrapper,children:[(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)($.virtualListHeaderToggle,L?.headerToggle),style:R?.headerToggle,onClick:()=>J(e=>!e),"aria-label":`Toggle column visibility`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faGear,style:R?.headerToggle})}),_e>0&&(0,f.jsx)(`span`,{className:(0,l.default)($.virtualListColumnChip,L?.columnChip),style:R?.columnChip,"data-column-hidden-count":_e,"aria-label":`${_e} columns hidden`,children:_e}),ve&&(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListTogglePopover,L?.togglePopover),style:R?.togglePopover,children:n.map(e=>(0,f.jsx)(ce,{className:(0,l.default)($.virtualListToggleItem,L?.toggleItem),style:R?.toggleItem,selected:ge.has(e.key),onToggle:()=>ye(e.key),cursorDefault:!1,children:e.label},e.key))})]})]}),S?(0,f.jsx)(`div`,{className:$.virtualListLoadingFull,children:(0,f.jsx)(A,{className:$.virtualListSpinner})}):(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListBody,L?.body),style:{height:K,...R?.body},children:we}),H.showLoadMoreSpinner&&(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListLoadingIndicator,L?.loadingIndicator),style:R?.loadingIndicator,children:(0,f.jsx)(A,{className:$.virtualListSpinner})})]})}var Er=c.default.forwardRef(Tr),Dr={wizard:`wizard_uRBAN`,"wizard-content":`wizard-content_lcl4C`,wizardContent:`wizard-content_lcl4C`,"wizard-content-outOfFrame":`wizard-content-outOfFrame_Eks4Y`,wizardContentOutOfFrame:`wizard-content-outOfFrame_Eks4Y`,"wizard-content-container":`wizard-content-container_yxbCJ`,wizardContentContainer:`wizard-content-container_yxbCJ`};function Or({currentStep:e=0,stepCount:t=0,renderStep:n=()=>null,className:r,style:i,classNames:a,styles:o,...s}){let[u,d]=(0,c.useState)(void 0),[p,m]=(0,c.useState)(!1),[h,g]=(0,c.useState)(e),_=(0,c.useRef)([]),v=(0,c.useRef)(null);e!==h&&(g(e),m(!0)),(0,c.useEffect)(()=>{if(!p)return;let e=setTimeout(()=>m(!1),400);return()=>clearTimeout(e)},[p]),(0,c.useEffect)(()=>{v.current?.disconnect();let t=_.current[e];if(t)return d(t.clientHeight),v.current=new ResizeObserver(()=>{d(t.clientHeight)}),v.current.observe(t),()=>v.current?.disconnect()},[e,t]);let y={...u===void 0?{}:{height:`${u}px`},...o?.root,...i};return(0,f.jsx)(`div`,{...s,className:(0,l.default)(Dr.wizard,a?.root,r),style:y,children:(0,f.jsx)(`div`,{className:(0,l.default)(Dr.wizardContentContainer,a?.container),style:{width:`${t*100}%`,marginLeft:`-${e*100}%`,...o?.container},children:Array.from({length:t},(r,i)=>(0,f.jsx)(`div`,{ref:e=>{_.current[i]=e},className:(0,l.default)(Dr.wizardContent,a?.step),style:{width:`${100/t}%`,marginLeft:`${100/t*i}%`,...o?.step},children:(0,f.jsx)(`div`,{className:(0,l.default)({[Dr.wizardContentOutOfFrame]:e!==i&&!p},a?.stepContent),style:o?.stepContent,inert:e===i?void 0:!0,children:n(i)})},`wizardStep${i}`))})})}function kr(e){let t=e;return t?.errors&&Array.isArray(t.errors)?t.errors.flatMap(e=>Object.entries(e).map(([e,t])=>({id:e,message:t}))):[]}var Ar=class{#e;#t;#n;#r;#i;constructor(e,t=null,{initialValues:n,onSubmit:r=()=>void 0,onValidate:i=()=>void 0,errorParser:a=kr,onSubmitError:o=()=>void 0}={}){this.#t=!1,this.#i=[],this.getFormError=()=>{let e=Object.keys(this.group);for(let t=0;t<e.length;t+=1){let n=e[t];if(this.group[n].errors.length>0)return this.group[n].errors[0]}return null},this.set=(e,t)=>(this.group[e].set(t),this),this.reset=(e={})=>{this.submitCount=0;let t=Object.keys(e);Object.keys(this.group).forEach(n=>{this.group[n].set(t.includes(n)?e[n]:this.#r[n],!1)}),this.resetDirtyAndTouched(),this.onReset&&this.onReset(this,this.#r,this.#e)},this.resetDirtyAndTouched=()=>{Object.keys(this.group).forEach(e=>{this.group[e].dirty=!1,this.group[e].touched=!1})},this.parseError=(e,t=!1)=>{let n=this.errorParser(e);n.length>0?(n.forEach(({id:e,message:t})=>{this.group[e]&&this.group[e].addError({id:e,message:t})}),t&&this.onSubmitError(n)):this.onSubmitError([{id:`generic`,message:`An error occurred`}])},this.#a=()=>{this.component&&this.component.forceUpdate(),this.#i.forEach(e=>e())},this.registerOnUpdateListener=e=>{this.#i.push(e)},this.removeOnUpdateListener=e=>{this.#i.splice(this.#i.indexOf(e),1)},this.setSubmitting=e=>{this.#t!==e&&(this.#t=e,this.#a())},this.submit=async e=>{e&&(e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()),this.setSubmitting(!0);let t=null;this.submitCount===0?t=await Promise.resolve(this.validate()):this.onValidateCallback&&(t=await Promise.resolve(this.onValidateCallback(this)));let n=this.getFormError()||t;if(n){this.setSubmitting(!1),this.submitCount>-1&&this.onSubmitError([n]),this.submitCount+=1,this.#a();return}try{await this.onSubmitCallback(this.getValues(),this),this.resetDirtyAndTouched()}catch(e){this.parseError(e,!0)}this.setSubmitting(!1),this.#a(),this.submitCount+=1},this.getValues=()=>{let e={};return Object.keys(this.group).forEach(t=>{e[t]=this.group[t].value}),{...this.#e,...e}},this.validate=()=>{if(Object.keys(this.group).forEach(e=>{this.group[e].validate(),this.group[e].touched=!0}),this.onValidateCallback)return this.onValidateCallback(this)},this.setValidator=(e,t)=>(this.group[e]=t,this),this.group=e,this.#e=n??{},this.#r={},this.submitCount=0,this.onDebounce=()=>{},this.onReset=()=>{},Object.keys(this.group).forEach(e=>{let t=this.group[e],n=this.#e;n[e]!==void 0&&t.set(n[e],!1),this.#r[e]=t.value,this.group[e].registerOnUpdateListener(()=>{this.#a(),this.submitCount=0,this.#n&&clearTimeout(this.#n),this.#n=setTimeout(()=>this.onDebounce(this.getValues()),500)})}),this.component=t,this.onSubmitCallback=r,this.onValidateCallback=i,this.errorParser=a,this.onSubmitError=o,this.setSubmitting(!1)}get isSubmitting(){return this.#t}get wasTouched(){return Object.keys(this.group).some(e=>this.group[e].touched)}get isDirty(){return Object.keys(this.group).some(e=>this.group[e].dirty)}get hasErrors(){return Object.keys(this.group).some(e=>this.group[e].errors.length>0)}get initialValues(){return{...this.#e}}#a};function jr(e){return function({children:t,...n}){return(0,f.jsx)(`form`,{onSubmit:e.submit,noValidate:!0,...n,children:t})}}var Mr=e=>{ir(e[0].message,{type:`error`})},Nr=class extends Ar{constructor(e,t=null,n){super(e,t,{...n,onSubmitError:n?.onSubmitError??Mr}),this.Form=jr(this)}},Pr=class{#e;#t;#n;#r;#i;constructor(e,t){this.addError=e=>{this.#r.push(e),this.onUpdate()},this.removeErrors=e=>{this.#r=this.#r.filter(t=>!e.includes(t.id)),this.onUpdate()},this.clearErrors=()=>{this.#r=[],this.onUpdate()},this.hasError=e=>!e&&this.errors.length>0?!0:!!this.errors.find(t=>t.id===e),this.getCurrentErrorMessage=()=>this.errors.length===0?null:this.errors[0].message,this.validate=()=>{this.clearErrors(),this.validators.forEach(e=>{let t=e(this.value,this.label);t&&this.addError(t)})},this.onUpdate=()=>{this.onUpdateCallbacks.forEach(e=>e(this))},this.registerOnUpdateListener=e=>{this.onUpdateCallbacks.push(e)},this.removeOnUpdateListener=e=>{this.onUpdateCallbacks.splice(this.onUpdateCallbacks.indexOf(e),1)},this.set=(e,t=!0)=>(this.value=e,t&&!this.dirty&&(this.dirty=!0),this.validate(),this),this.#e=e,this.validators=t??[],this.#t=!1,this.#n=!1,this.#r=[],this.#i=``,this.onUpdateCallbacks=[],this.validate()}get touched(){return this.#t}set touched(e){this.#t=e,this.onUpdate()}get label(){return this.#i}set label(e){this.#i=e}get dirty(){return this.#n}set dirty(e){this.#n=e,this.onUpdate()}get value(){return this.#e}set value(e){this.#e=e,this.onUpdate()}get errors(){return this.#r}};Pr.prototype.toString=function(){return`${this.value}`};function Fr(e){return/^[0-9]+$/.test(e)}function Ir(e){return/^[0-9]{2}.[0-9]{2}.[0-9]{4}$/.test(e)}function Lr(e){return/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z$/.test(e)}function Rr(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-ZöäüÜÖÄß\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function zr(e){return/^[A-Z]{6}[A-Z\d]{2}([A-Z\d]{3})?$/.test(e)}function Br(e){return/[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}(\/[-a-zA-Z0-9@:%_+.~#?&//=]*)?$/.test(e)}function Vr(e){return/^[\w!@#$%^&*?±§~`'"/\\[\]{}\-,.();:><+=|öäüÖÄÜß €μ]{8,}$/.test(e)}function Hr(e){return/^(?=.*[a-zöäüA-ZÖÄÜß])/.test(e)}function Ur(e){return/^(?=.*\d)/.test(e)}function Wr(e){return Vr(e)&&Hr(e)&&Ur(e)}var Gr={t:(e,t)=>({"formValidators.minLength":`Must be at least ${t?.min} characters long`,"formValidators.maxLength":`Must be at most ${t?.max} characters long`,"formValidators.email":`Must be a valid email address`,"formValidators.required":`${t?.label||`Value`} is required`,"formValidators.value":`Value`,"formValidators.mustBeNumber":`Must be a number`,"formValidators.oneOf":`Must be one of the following values: ${t?.allowedValues}`,"formValidators.typeOf":`Must have type of ${t?.allowedTypes}`,"formValidators.multiEmail":`Must be a comma or semicolon separated list of valid email addresses`,"formValidators.date":`Must be a valid date`,"garages.errors.website":`Must be a valid URL`,"garages.errors.bic":`Must be a valid BIC`,"formValidators.minLetters":`Must contain at least ${t?.smart_count} letters`,"formValidators.minDigits":`Must contain at least ${t?.smart_count} digits`})[e]||e},Kr=class e{static{this.minLength=(e,t)=>n=>!n||n.length<e?{id:`minLength`,message:t||Gr.t(`formValidators.minLength`,{min:e})}:null}static{this.maxLength=(e,t)=>n=>n&&n.length>e?{id:`maxLength`,message:t||Gr.t(`formValidators.maxLength`,{max:e})}:null}static{this.email=e=>t=>t&&!Rr(t)?{id:`email`,message:e||Gr.t(`formValidators.email`)}:null}static{this.required=e=>{function t(t,n){return!t&&t!==0?{id:`required`,message:e||Gr.t(`formValidators.required`,{label:n||Gr.t(`formValidators.value`)})}:null}return t.validatorId=`required`,t}}static{this.mustBeNumber=e=>t=>t&&Number.isNaN(+t)?{id:`mustBeNumber`,message:e||Gr.t(`formValidators.mustBeNumber`)}:null}static{this.oneOf=(e,t)=>n=>n&&!e.includes(n)?{id:`oneOf`,message:t||Gr.t(`formValidators.oneOf`,{allowedValues:e})}:null}static{this.typeOf=(e,t)=>n=>{if(Array.isArray(e)){for(let t=0;t<e.length;t+=1)if(typeof n===e[t])return null}else if(typeof n===e)return null;return{id:`typeOf`,message:t||`Must have type of ${e}`}}}static{this.multiEmail=e=>t=>{if(t){let n=t.replace(/ /g,``).replace(/,/g,`;`).split(`;`);for(let t=0;t<n.length;t+=1)if(!Rr(n[t]))return{id:`multiEmail`,message:e||Gr.t(`formValidators.multiEmail`)}}return null}}static{this.date=e=>t=>t&&!Ir(t)&&!Lr(t)?{id:`date`,message:e||Gr.t(`formValidators.date`)}:null}static{this.dateObject=e=>t=>t&&!t.isValid?{id:`date`,message:e||Gr.t(`formValidators.date`)}:null}static{this.website=e=>t=>t&&!Br(t)?{id:`website`,message:e||Gr.t(`garages.errors.website`)}:null}static{this.bic=e=>t=>t&&!zr(t)?{id:`bic`,message:e||Gr.t(`garages.errors.bic`)}:null}static{this.minLetters=(e,t)=>n=>n&&n.replace(/[^a-zöäüA-ZÖÄÜß]/g,``).length<e?{id:`minLetters`,message:t||Gr.t(`formValidators.minLetters`,{smart_count:e})}:null}static{this.minDigits=(e,t)=>n=>n&&n.replace(/[\D]/g,``).length<e?{id:`minDigits`,message:t||Gr.t(`formValidators.minDigits`,{smart_count:e})}:null}static{this.password=t=>n=>{let r=e.minLength(8)(n)||e.minLetters(1)(n)||e.minDigits(1)(n);return r?t?{id:`password`,message:t}:r:null}}},qr=class extends c.PureComponent{static{this.defaultProps={formValidator:null,onMouseEnter:null,onMouseLeave:null,onFocus:null,onBlur:null,onChange:null,errorMessage:``,isValid:!1,isRequired:!1,label:``}}constructor(e){super(e);let{formValidator:t}=e;t&&(t.label=e.label??``,t.validate(),t.registerOnUpdateListener(()=>{this.forceUpdate()})),this.state={isFocused:!1,isHovered:!1},this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),this.hasError=this.hasError.bind(this),this.renderTooltip=this.renderTooltip.bind(this),this.onChange=this.onChange.bind(this)}componentDidMount(){setTimeout(()=>this.setState({isFocused:!1,isHovered:!1}),1)}componentDidUpdate(e){let{formValidator:t}=this.props;e.formValidator&&t&&e.formValidator!==t&&t.registerOnUpdateListener(()=>{this.forceUpdate()})}onMouseEnter(e){let{onMouseEnter:t}=this.props;this.setState({isHovered:!0}),t&&t(e)}onMouseLeave(e){let{onMouseLeave:t}=this.props;this.setState({isHovered:!1}),t&&t(e)}onFocus(e){let{onFocus:t}=this.props;this.setState({isFocused:!0}),t&&t(e)}onBlur(e){let{formValidator:t,onBlur:n}=this.props;t&&(t.touched=!0),this.setState({isFocused:!1}),n&&n(e)}hasError(){let{errorMessage:e,isValid:t,formValidator:n}=this.props;return n?n.touched&&n.hasError():!t||!!e}isRequired(){let{isRequired:e,formValidator:t}=this.props;return!!(e||t&&t.validators.find(e=>e.validatorId===`required`))}renderTooltip(){let{errorMessage:e,formValidator:t}=this.props,{isHovered:n,isFocused:r}=this.state;return(0,f.jsx)(ve,{variant:`error`,message:t?t.getCurrentErrorMessage():e||``,isVisible:this.hasError()&&(r||n)})}onChange(e){let{onChange:t,formValidator:n}=this.props;if(n){let t=e;e&&e.target&&(t=e.target.value),n.set(t)}t&&t(e)}};function Jr(e){let[,t]=(0,c.useReducer)(e=>e+1,0);return(0,c.useEffect)(()=>{if(e)return e.registerOnUpdateListener(t),()=>e.removeOnUpdateListener(t)},[e]),e}function Yr(e,{initialValues:t,onSubmit:n,onValidate:r,errorParser:i,onSubmitError:a}={}){let[,o]=(0,c.useReducer)(e=>e+1,0),s=(0,c.useRef)(null);s.current||=new Nr(e,null,{initialValues:t,errorParser:i,onSubmitError:a});let l=s.current,u=(0,c.useRef)(n),d=(0,c.useRef)(r);return u.current=n,d.current=r,(0,c.useEffect)(()=>(n!==void 0&&(l.onSubmitCallback=(...e)=>u.current?.(...e)),r!==void 0&&(l.onValidateCallback=(...e)=>d.current?.(...e)),l.registerOnUpdateListener(o),()=>l.removeOnUpdateListener(o)),[]),l}exports.Accordion=T,exports.AccordionStyleType=b,exports.ActionButtons=ne,exports.ActionIcon=B,exports.Align=me,exports.BodyEnd=ie,exports.Button=I,exports.ButtonSize=M,exports.ButtonStyleType=j,exports.ButtonType=N,exports.Card=U,exports.CardActions=G,exports.CardContent=W,exports.CardHeader=oe,exports.CardMedia=se,exports.CardStyleType=ae,exports.Checkbox=ce,exports.Chip=de,exports.ChipContainer=fe,exports.ChipStyleType=le,exports.ColorPicker=Ae,exports.ConfirmModal=Ne,exports.DatePicker=st,exports.Drawer=lt,exports.DropZone=gt,exports.DropZoneReturnType=ut,exports.DropZoneStatus=Z,exports.Dropdown=at,exports.EmptyState=vt,exports.Fab=Ct,exports.FloatingMenu=ge,exports.FormValidator=Pr,exports.FormValidatorGroup=Nr,exports.IconLoading=Bt,exports.IconPicker=Dt,exports.IdleManager=kt,exports.InfiniteBlock=it,exports.Input=ye,exports.InputDropdown=Nt,exports.InputType=Y,exports.InteractableDiv=z,exports.KanbanBoard=Lt,exports.KanbanColumn=It,exports.Modal=Me,exports.NumberInput=Ut,exports.OptionPicker=Gt,exports.Overscroll=Yt,exports.ProgressBar=Qt,exports.Ripple=F,exports.RoomDrawer=En,exports.RoomViewer=On,exports.ScrollbarProvider=jn,exports.SearchInput=Nn,exports.SpinnerLoading=A,exports.Stepper=In,exports.TabHeader=Rn,exports.TenorPicker=Kn,exports.Textarea=qn,exports.ThemeProvider=Xn,exports.ToastProvider=cr,exports.Tooltip=ve,exports.ValidatableComponent=qr,exports.Validators=Kr,exports.VirtualList=Er,exports.Wizard=Or,exports.defaultTheme=Jn,exports.getLocale=Ve,exports.hasEightPasswordChars=Vr,exports.hasOnePasswordDigit=Ur,exports.hasOnePasswordLetter=Hr,exports.isBic=zr,exports.isDate=Ir,exports.isEmail=Rr,exports.isISODate=Lr,exports.isNumber=Fr,exports.isPassword=Wr,exports.isURL=Br,exports.mapLocale=Re,exports.setLocale=Be,exports.showToast=ir,exports.useFormValidator=Jr,exports.useFormValidatorGroup=Yr,exports.useTheme=Zn;
5
+ `)}function hn(e){let t=[];for(let n of e.matchAll(/[ML]\s*([-\d.]+)[,\s]+([-\d.]+)/gi))t.push({x:parseFloat(n[1]),y:parseFloat(n[2])});return t}function gn(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`),n=[];return t.querySelectorAll(`[id^="room"]`).forEach(e=>{let t=e.querySelector(`[id="background"]`);if(!t)return;let r=t.getAttribute(`d`);if(!r)return;let i=hn(r);if(i.length<3)return;let a=e.querySelector(`text`)?.textContent?.trim()??``;n.push({id:e.id,name:a,points:i})}),n}function _n(e,t){let n=mn(e,t),r=new Blob([n],{type:`image/svg+xml`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`room-plan.svg`,a.click(),URL.revokeObjectURL(i)}var Q={roomDrawer:`roomDrawer_SJj4-`,"roomDrawer-toolbar":`roomDrawer-toolbar_55H5p`,roomDrawerToolbar:`roomDrawer-toolbar_55H5p`,"roomDrawer-toolbar-sep":`roomDrawer-toolbar-sep_nJeh8`,roomDrawerToolbarSep:`roomDrawer-toolbar-sep_nJeh8`,"roomDrawer-toolbar-btn":`roomDrawer-toolbar-btn_2qinY`,roomDrawerToolbarBtn:`roomDrawer-toolbar-btn_2qinY`,"roomDrawer-toolbar-btn-active":`roomDrawer-toolbar-btn-active_4XX25`,roomDrawerToolbarBtnActive:`roomDrawer-toolbar-btn-active_4XX25`,"roomDrawer-toolbar-zoomLabel":`roomDrawer-toolbar-zoomLabel_HMkb5`,roomDrawerToolbarZoomLabel:`roomDrawer-toolbar-zoomLabel_HMkb5`,"roomDrawer-canvas":`roomDrawer-canvas_Y18uD`,roomDrawerCanvas:`roomDrawer-canvas_Y18uD`,"roomDrawer-canvas-select":`roomDrawer-canvas-select_M43-x`,roomDrawerCanvasSelect:`roomDrawer-canvas-select_M43-x`,"roomDrawer-info":`roomDrawer-info_qwC6L`,roomDrawerInfo:`roomDrawer-info_qwC6L`,"roomDrawer-info-label":`roomDrawer-info-label_8I9hB`,roomDrawerInfoLabel:`roomDrawer-info-label_8I9hB`,"roomDrawer-info-input":`roomDrawer-info-input_YAl-K`,roomDrawerInfoInput:`roomDrawer-info-input_YAl-K`,"roomDrawer-info-spacer":`roomDrawer-info-spacer_cOj96`,roomDrawerInfoSpacer:`roomDrawer-info-spacer_cOj96`,"roomDrawer-info-delete":`roomDrawer-info-delete_TSBUN`,roomDrawerInfoDelete:`roomDrawer-info-delete_TSBUN`,"roomDrawer-hint":`roomDrawer-hint_3WTFa`,roomDrawerHint:`roomDrawer-hint_3WTFa`,"roomDrawer-info-doorsBtn":`roomDrawer-info-doorsBtn_oK5Uf`,roomDrawerInfoDoorsBtn:`roomDrawer-info-doorsBtn_oK5Uf`,"roomDrawer-doorPanel":`roomDrawer-doorPanel_e-Tl9`,roomDrawerDoorPanel:`roomDrawer-doorPanel_e-Tl9`,"roomDrawer-doorPanel-header":`roomDrawer-doorPanel-header_--iXz`,roomDrawerDoorPanelHeader:`roomDrawer-doorPanel-header_--iXz`,"roomDrawer-doorPanel-icon":`roomDrawer-doorPanel-icon_KxaVY`,roomDrawerDoorPanelIcon:`roomDrawer-doorPanel-icon_KxaVY`,"roomDrawer-doorPanel-title":`roomDrawer-doorPanel-title_8nOZS`,roomDrawerDoorPanelTitle:`roomDrawer-doorPanel-title_8nOZS`,"roomDrawer-doorPanel-done":`roomDrawer-doorPanel-done_ejQkx`,roomDrawerDoorPanelDone:`roomDrawer-doorPanel-done_ejQkx`,"roomDrawer-doorPanel-list":`roomDrawer-doorPanel-list_rDou7`,roomDrawerDoorPanelList:`roomDrawer-doorPanel-list_rDou7`,"roomDrawer-doorPanel-item":`roomDrawer-doorPanel-item_U-3-B`,roomDrawerDoorPanelItem:`roomDrawer-doorPanel-item_U-3-B`,"roomDrawer-doorPanel-label":`roomDrawer-doorPanel-label_qSYqY`,roomDrawerDoorPanelLabel:`roomDrawer-doorPanel-label_qSYqY`,"roomDrawer-doorPanel-widthLabel":`roomDrawer-doorPanel-widthLabel_jXv7D`,roomDrawerDoorPanelWidthLabel:`roomDrawer-doorPanel-widthLabel_jXv7D`,"roomDrawer-doorPanel-empty":`roomDrawer-doorPanel-empty_LcDw0`,roomDrawerDoorPanelEmpty:`roomDrawer-doorPanel-empty_LcDw0`,"roomDrawer-canvas-door":`roomDrawer-canvas-door_qzCIa`,roomDrawerCanvasDoor:`roomDrawer-canvas-door_qzCIa`,doorGap:`doorGap_KrIuB`,doorMarker:`doorMarker_-N63z`,gridLine:`gridLine_V-rxw`,roomFill:`roomFill_JnJ0J`,"roomFill-selected":`roomFill-selected_IfIRr`,roomFillSelected:`roomFill-selected_IfIRr`,roomStroke:`roomStroke_S18UH`,"roomStroke-selected":`roomStroke-selected_fm19u`,roomStrokeSelected:`roomStroke-selected_fm19u`,roomText:`roomText_6fIeU`,doorPanel:`doorPanel_raCv0`,"doorPanel-selected":`doorPanel-selected_5DG7g`,doorPanelSelected:`doorPanel-selected_5DG7g`,doorSwing:`doorSwing_Tbt9D`,"doorSwing-selected":`doorSwing-selected_fFte5`,doorSwingSelected:`doorSwing-selected_fFte5`,preview:`preview_seIZY`,polyCloseTarget:`polyCloseTarget_snjYx`,polyVertex:`polyVertex_fw0nX`,vertexHandle:`vertexHandle_-z7g5`},vn=6,yn=5,bn=1.25,xn=.25,Sn=12,Cn=0;function wn(e){return Cn+=1,`${e}${Cn}`}var Tn={select:`Drag inside to move · Drag corner to reshape · Click wall to add corner · Dbl-click corner to remove · Delete to erase`,rect:`Drag to draw a rectangular room`,polygon:`Click to place corners · Click first point or Enter to close · Esc to cancel`};function En({className:e}){let[t,n]=(0,c.useState)([]),[r,i]=(0,c.useState)([]),[a,o]=(0,c.useState)(`rect`),[s,p]=(0,c.useState)(null),[m,h]=(0,c.useState)(null),[g,_]=(0,c.useState)(null),[v,y]=(0,c.useState)(null),[b,x]=(0,c.useState)([]),[S,C]=(0,c.useState)(null),[w,T]=(0,c.useState)(1),[E,D]=(0,c.useState)({x:0,y:0}),O=(0,c.useRef)(null),k=(0,c.useRef)(null),A=(0,c.useRef)(null),j=(0,c.useRef)(null),M=(0,c.useRef)(null),N=(0,c.useRef)({rooms:t,doors:r,tool:a,selectedId:s,editingDoorsForRoomId:m,polyPoints:b,zoom:w,pan:E});(0,c.useLayoutEffect)(()=>{N.current={rooms:t,doors:r,tool:a,selectedId:s,editingDoorsForRoomId:m,polyPoints:b,zoom:w,pan:E}});function P(e){e.length<3||(n(t=>[...t,{id:wn(`room`),name:`Room ${t.length+1}`,points:e}]),x([]),C(null))}(0,c.useEffect)(()=>{let e=j.current;if(!e)return;function t(e){e.preventDefault();let{zoom:t,pan:n}=N.current,r=tn(e.clientX,e.clientY,j.current);if(!r)return;let i=e.deltaY<0?bn:1/bn,a=Math.max(xn,Math.min(Sn,t*i));D({x:r.x-(r.x-n.x)*(t/a),y:r.y-(r.y-n.y)*(t/a)}),T(a)}return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]),(0,c.useEffect)(()=>{function e(e){let{tool:t,selectedId:r,editingDoorsForRoomId:a,polyPoints:o,zoom:s,pan:c}=N.current;if(e.key===`Escape`){if(a){h(null);return}t===`polygon`&&(x([]),C(null)),p(null);return}if(e.key===`Enter`&&t===`polygon`&&o.length>=3){P(o);return}if((e.key===`+`||e.key===`=`)&&!(e.target instanceof HTMLInputElement)){let e=Math.max(xn,Math.min(Sn,s*bn)),t=c.x+400/s/2,n=c.y+300/s/2;T(e),D({x:t-400/e/2,y:n-300/e/2});return}if(e.key===`-`&&!(e.target instanceof HTMLInputElement)){let e=Math.max(xn,Math.min(Sn,s/bn)),t=c.x+400/s/2,n=c.y+300/s/2;T(e),D({x:t-400/e/2,y:n-300/e/2});return}if(e.key===`0`&&!(e.target instanceof HTMLInputElement)){T(1),D({x:0,y:0});return}(e.key===`Delete`||e.key===`Backspace`)&&r&&!a&&!(e.target instanceof HTMLInputElement)&&(n(e=>e.filter(e=>e.id!==r)),i(e=>e.filter(e=>e.roomId!==r)),p(null))}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);function F(e,t=w,n=E){let r=Math.max(xn,Math.min(Sn,t*e)),i=n.x+400/t/2,a=n.y+300/t/2;D({x:i-400/r/2,y:a-300/r/2}),T(r)}function ee(e){return j.current?tn(e.clientX,e.clientY,j.current):null}function te(e,t){let n=null;for(let r=0;r<t.points.length;r++){let i=nn(e,t.points[r]);i<=vn&&(!n||i<n.d)&&(n={index:r,d:i})}return n}function I(e,t){let n=null;for(let r=0;r<t.points.length;r++){let i=t.points[r],a=t.points[(r+1)%t.points.length],{dist:o,t:s}=rn(e,i,a);o<=yn&&(!n||o<n.d)&&(n={index:r,t:s,d:o})}return n}function ne(e,t,r,a){return n(n=>n.map(n=>{if(n.id!==e)return n;let r=[...n.points];return r.splice(t+1,0,a),{...n,points:r}})),i(n=>n.map(n=>n.roomId===e?n.wallIndex===t?n.t<=r?{...n,t:r>0?n.t/r:0}:{...n,wallIndex:t+1,t:(n.t-r)/(1-r)}:n.wallIndex>t?{...n,wallIndex:n.wallIndex+1}:n:n)),t+1}function L(e,r){let a=t.find(t=>t.id===e);if(!a||a.points.length<=3)return;let o=a.points.length;n(t=>t.map(t=>t.id===e?{...t,points:t.points.filter((e,t)=>t!==r)}:t)),i(t=>t.map(t=>{if(t.roomId!==e)return t;let n=(r-1+o)%o;return t.wallIndex===n||t.wallIndex===r?{...t,wallIndex:-1}:t.wallIndex>r?{...t,wallIndex:t.wallIndex-1}:t}).filter(e=>e.wallIndex!==-1))}function R(e){if(e.button===1){e.preventDefault();let t=j.current;if(t){let n=t.getBoundingClientRect();A.current={startClient:{x:e.clientX,y:e.clientY},origPan:{...E},scaleX:400/w/n.width,scaleY:300/w/n.height}}return}if(e.button!==0)return;e.preventDefault();let n=ee(e);if(n){if(m){let e=t.find(e=>e.id===m);if(e){let t=an(n,[e]);t&&i(e=>[...e,{id:wn(`door`),roomId:t.roomId,wallIndex:t.wallIndex,t:t.t,width:12}])}return}if(a===`rect`){_(n),y(n);return}if(a===`polygon`){b.length>=3&&nn(n,b[0])<=8?P(b):x(e=>[...e,n]);return}if(a===`select`){let e=t.find(e=>e.id===s)??null;if(e){let t=te(n,e);if(t){O.current={type:`vertex`,roomId:e.id,index:t.index,start:n,origPt:e.points[t.index]};return}}if(e){let t=I(n,e);if(t){let r=e.points[t.index],i=e.points[(t.index+1)%e.points.length],a=en({x:r.x+(i.x-r.x)*t.t,y:r.y+(i.y-r.y)*t.t}),o=ne(e.id,t.index,t.t,a);O.current={type:`vertex`,roomId:e.id,index:o,start:n,origPt:a};return}}let r=t.find(e=>on(n,e.points));if(r){p(r.id),O.current={type:`room`,roomId:r.id,start:n,origPoints:[...r.points]};return}p(null)}}}function z(e){if(a!==`select`||m)return;let n=ee(e);if(!n)return;let r=t.find(e=>e.id===s);if(!r)return;let i=te(n,r);i&&(e.preventDefault(),L(r.id,i.index))}function re(e){if(A.current){let{startClient:t,origPan:n,scaleX:r,scaleY:i}=A.current;D({x:n.x-(e.clientX-t.x)*r,y:n.y-(e.clientY-t.y)*i});return}let r=ee(e);if(r){if(k.current&&m){let e=t.find(e=>e.id===m);if(e){let t=an(r,[e]);t&&i(e=>e.map(e=>e.id===k.current?{...e,wallIndex:t.wallIndex,t:t.t}:e))}return}if(a===`rect`&&g){y(r);return}if(a===`polygon`){C(r);return}if(a===`select`&&!m&&O.current){let e=O.current;if(e.type===`vertex`){let t=r.x-e.start.x,i=r.y-e.start.y,a=en({x:e.origPt.x+t,y:e.origPt.y+i});n(t=>t.map(t=>{if(t.id!==e.roomId)return t;let n=[...t.points];return n[e.index]=a,{...t,points:n}}))}else{let t=r.x-e.start.x,i=r.y-e.start.y;n(n=>n.map(n=>n.id===e.roomId?{...n,points:e.origPoints.map(e=>({x:e.x+t,y:e.y+i}))}:n))}}}}function B(e){if(A.current){A.current=null;return}let t=ee(e);if(t){if(a===`rect`&&g){let e=Math.min(g.x,t.x),r=Math.min(g.y,t.y),i=Math.abs(t.x-g.x),a=Math.abs(t.y-g.y);i>=10&&a>=10&&n(t=>[...t,{id:wn(`room`),name:`Room ${t.length+1}`,points:cn(e,r,i,a)}]),_(null),y(null)}k.current=null,O.current=null}}function ie(e){s&&n(t=>t.map(t=>t.id===s?{...t,name:e}:t))}function ae(e,t){let n=parseFloat(t);isNaN(n)||n<=0||i(t=>t.map(t=>t.id===e?{...t,width:n}:t))}function V(){s&&(n(e=>e.filter(e=>e.id!==s)),i(e=>e.filter(e=>e.roomId!==s)),h(null),p(null))}function H(e){i(t=>t.filter(t=>t.id!==e))}function U(e){o(e),h(null),x([]),C(null),_(null),y(null)}function oe(e){let t=e.target.files?.[0];if(!t)return;e.target.value=``;let r=new FileReader;r.onload=e=>{let t=e.target?.result;if(typeof t!=`string`)return;let r=gn(t);r.length!==0&&(n(r.map(e=>({...e,id:wn(`room`)}))),i([]),p(null),h(null),T(1),D({x:0,y:0}))},r.readAsText(t)}let se=a===`rect`&&g&&v?{x:Math.min(g.x,v.x),y:Math.min(g.y,v.y),w:Math.abs(v.x-g.x),h:Math.abs(v.y-g.y)}:null,W=s?t.find(e=>e.id===s)??null:null,G=m?t.find(e=>e.id===m)??null:null,K=m?r.filter(e=>e.roomId===m):[],ce=[{t:`select`,icon:d.faHandPointer,label:`Select & edit`},{t:`rect`,icon:d.faSquare,label:`Rectangle room`},{t:`polygon`,icon:d.faDrawPolygon,label:`Polygon room`}],le=400/w,q=300/w,ue=m?Q.roomDrawerCanvasDoor:a===`select`?Q.roomDrawerCanvasSelect:void 0;return(0,f.jsxs)(`div`,{className:(0,l.default)(Q.roomDrawer,e),children:[(0,f.jsxs)(`div`,{className:Q.roomDrawerToolbar,children:[ce.map(({t:e,icon:t,label:n})=>(0,f.jsx)(`button`,{title:n,className:(0,l.default)(Q.roomDrawerToolbarBtn,e===a&&!m&&Q.roomDrawerToolbarBtnActive),onClick:()=>U(e),children:(0,f.jsx)(u.FontAwesomeIcon,{icon:t})},e)),(0,f.jsx)(`div`,{className:Q.roomDrawerToolbarSep}),(0,f.jsx)(`button`,{title:`Zoom in (+)`,className:Q.roomDrawerToolbarBtn,onClick:()=>F(bn),disabled:w>=Sn,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faMagnifyingGlassPlus})}),(0,f.jsxs)(`button`,{title:`Reset zoom (0) — ${Math.round(w*100)}%`,className:Q.roomDrawerToolbarZoomLabel,onClick:()=>{T(1),D({x:0,y:0})},children:[Math.round(w*100),`%`]}),(0,f.jsx)(`button`,{title:`Zoom out (−)`,className:Q.roomDrawerToolbarBtn,onClick:()=>F(1/bn),disabled:w<=xn,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faMagnifyingGlassMinus})}),(0,f.jsx)(`div`,{className:Q.roomDrawerToolbarSep}),(0,f.jsx)(`button`,{title:`Upload SVG`,className:Q.roomDrawerToolbarBtn,onClick:()=>M.current?.click(),children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faUpload})}),(0,f.jsx)(`button`,{title:`Download SVG`,className:Q.roomDrawerToolbarBtn,onClick:()=>_n(t,r),disabled:t.length===0,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDownload})}),(0,f.jsx)(`input`,{ref:M,type:`file`,accept:`.svg,image/svg+xml`,style:{display:`none`},onChange:oe})]}),(0,f.jsxs)(`svg`,{ref:j,className:(0,l.default)(Q.roomDrawerCanvas,ue),viewBox:`${E.x} ${E.y} ${le} ${q}`,onMouseDown:R,onMouseMove:re,onMouseUp:B,onDoubleClick:z,children:[(0,f.jsx)(`defs`,{children:(0,f.jsx)(`pattern`,{id:`rd-grid`,width:5,height:5,patternUnits:`userSpaceOnUse`,children:(0,f.jsx)(`path`,{d:`M 5 0 L 0 0 0 5`,fill:`none`,className:Q.gridLine})})}),(0,f.jsx)(`rect`,{x:E.x,y:E.y,width:le,height:q,fill:`url(#rd-grid)`}),t.map(e=>{let t=e.points,n=t.map((e,t)=>`${t===0?`M`:`L`} ${e.x},${e.y}`).join(` `)+` Z`,i=fn(t,r.filter(t=>t.roomId===e.id)),a=sn(t),o=s===e.id,c=m===e.id;return(0,f.jsxs)(`g`,{children:[(0,f.jsx)(`path`,{d:n,className:(0,l.default)(Q.roomFill,(o||c)&&Q.roomFillSelected)}),i.map((e,t)=>(0,f.jsx)(`path`,{d:e,className:(0,l.default)(Q.roomStroke,(o||c)&&Q.roomStrokeSelected)},t)),e.name&&(0,f.jsx)(`text`,{x:a.x,y:a.y,className:Q.roomText,textAnchor:`middle`,dominantBaseline:`middle`,children:e.name})]},e.id)}),r.map(e=>{let n=t.find(t=>t.id===e.roomId);if(!n)return null;let r=n.points[e.wallIndex],i=n.points[(e.wallIndex+1)%n.points.length],a=ln(r,i,e.t,e.width);return a?(0,f.jsx)(`line`,{x1:a.p1.x,y1:a.p1.y,x2:a.p2.x,y2:a.p2.y,className:Q.doorGap},e.id):null}),m&&K.map(e=>{let n=t.find(t=>t.id===e.roomId);if(!n)return null;let r=n.points[e.wallIndex],i=n.points[(e.wallIndex+1)%n.points.length],a=ln(r,i,e.t,e.width);if(!a)return null;let o={x:(a.p1.x+a.p2.x)/2,y:(a.p1.y+a.p2.y)/2};return(0,f.jsx)(`circle`,{cx:o.x,cy:o.y,r:2.5,className:Q.doorMarker,onMouseDown:t=>{t.button===0&&(t.preventDefault(),t.stopPropagation(),k.current=e.id)}},e.id)}),a===`select`&&!m&&W&&W.points.map((e,t)=>(0,f.jsx)(`circle`,{cx:e.x,cy:e.y,r:3.5,className:Q.vertexHandle},t)),se&&(0,f.jsx)(`rect`,{x:se.x,y:se.y,width:se.w,height:se.h,className:Q.preview}),a===`polygon`&&b.length>0&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`polyline`,{points:[...b,S??b[b.length-1]].map(e=>`${e.x},${e.y}`).join(` `),className:Q.preview}),b.length>=3&&(0,f.jsx)(`circle`,{cx:b[0].x,cy:b[0].y,r:8/2,className:Q.polyCloseTarget}),b.map((e,t)=>(0,f.jsx)(`circle`,{cx:e.x,cy:e.y,r:2,className:Q.polyVertex},t))]})]}),W&&!m&&(0,f.jsxs)(`div`,{className:Q.roomDrawerInfo,children:[(0,f.jsx)(`span`,{className:Q.roomDrawerInfoLabel,children:`Name`}),(0,f.jsx)(`input`,{className:Q.roomDrawerInfoInput,value:W.name,onChange:e=>ie(e.target.value),placeholder:`Room name`}),(0,f.jsxs)(`button`,{className:Q.roomDrawerInfoDoorsBtn,onClick:()=>h(W.id),title:`Edit doors`,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDoorOpen}),(0,f.jsx)(`span`,{children:r.filter(e=>e.roomId===W.id).length})]}),(0,f.jsx)(`button`,{className:Q.roomDrawerInfoDelete,onClick:V,title:`Delete room`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faTrash})})]}),m&&G&&(0,f.jsxs)(`div`,{className:Q.roomDrawerDoorPanel,children:[(0,f.jsxs)(`div`,{className:Q.roomDrawerDoorPanelHeader,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDoorOpen,className:Q.roomDrawerDoorPanelIcon}),(0,f.jsx)(`span`,{className:Q.roomDrawerDoorPanelTitle,children:G.name?`Doors · ${G.name}`:`Doors`}),(0,f.jsxs)(`button`,{className:Q.roomDrawerDoorPanelDone,onClick:()=>h(null),title:`Done (Esc)`,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faCheck}),`Done`]})]}),(0,f.jsxs)(`div`,{className:Q.roomDrawerDoorPanelList,children:[K.length===0&&(0,f.jsx)(`span`,{className:Q.roomDrawerDoorPanelEmpty,children:`Click on a wall to add a door`}),K.map((e,t)=>(0,f.jsxs)(`div`,{className:Q.roomDrawerDoorPanelItem,children:[(0,f.jsxs)(`span`,{className:Q.roomDrawerDoorPanelLabel,children:[`Door `,t+1]}),(0,f.jsx)(`span`,{className:Q.roomDrawerDoorPanelWidthLabel,children:`Width`}),(0,f.jsx)(`input`,{className:Q.roomDrawerInfoInput,type:`number`,min:1,value:e.width,onChange:t=>ae(e.id,t.target.value)}),(0,f.jsx)(`button`,{className:Q.roomDrawerInfoDelete,onClick:()=>H(e.id),title:`Delete door`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faTrash})})]},e.id))]})]}),(0,f.jsx)(`div`,{className:Q.roomDrawerHint,children:m?`Click a wall to add a door · Adjust width or delete from the list · Done or Esc to finish`:`${Tn[a]} · Scroll to zoom · Middle-drag to pan · 0 to reset`})]})}var Dn={"roomViewer-containerLoading":`roomViewer-containerLoading_BL3M-`,roomViewerContainerLoading:`roomViewer-containerLoading_BL3M-`,"roomViewer-container":`roomViewer-container_YlmB8`,roomViewerContainer:`roomViewer-container_YlmB8`,"roomViewer-active":`roomViewer-active_gG6wf`,roomViewerActive:`roomViewer-active_gG6wf`,"roomViewer-selected":`roomViewer-selected_CpdMj`,roomViewerSelected:`roomViewer-selected_CpdMj`,"roomViewer-tint":`roomViewer-tint_O9JrM`,roomViewerTint:`roomViewer-tint_O9JrM`,"roomViewer-actions":`roomViewer-actions_4cA74`,roomViewerActions:`roomViewer-actions_4cA74`,"roomViewer-header":`roomViewer-header_XEHCO`,roomViewerHeader:`roomViewer-header_XEHCO`};function On({data:e=[]}){let t=(0,c.useRef)(null),[,n]=(0,c.useState)(null),[r,i]=(0,c.useState)(0),[a,o]=(0,c.useState)(!0);(0,c.useEffect)(()=>{let i=new AbortController;n(null);let a=t.current;return r>e.length-1||!a?(o(!1),()=>i.abort()):(a.querySelectorAll(`[id^="room"]`).forEach(e=>{e.addEventListener(`click`,()=>s(e.id,a),{signal:i.signal})}),o(!1),()=>i.abort())},[e,r]);function s(e,t){let r=e.substring(4);n(n=>{if(r===n)return n;let[i]=t.querySelectorAll(`[id="use"]`);i?.setAttribute(`href`,`#${e}`);let[a]=t.querySelectorAll(`[id="${e}"]`);if(n){let[e]=t.querySelectorAll(`[id="room${n}"]`);if(e){e.classList.remove(Dn.roomViewerSelected,Dn.roomViewerTint);let[t]=e.querySelectorAll(`[id="background"]`);t&&t.classList.remove(Dn.roomViewerTint)}}if(a){a.classList.add(Dn.roomViewerSelected);let[e]=a.querySelectorAll(`[id="background"]`);(e??a).classList.add(Dn.roomViewerTint)}return r})}function p(t){i(n=>{let r=n+t;return r<0||r>e.length-1?n:r})}let m=e[r]?.data??null;return(0,f.jsxs)(`div`,{className:Dn.roomViewer,ref:t,children:[(0,f.jsx)(`h3`,{className:Dn.roomViewerHeader,children:e[r]?.label??``}),(0,f.jsx)(`div`,{className:(0,l.default)(Dn.roomViewerContainer,a&&Dn.roomViewerContainerLoading),children:m},r),e.length>1&&(0,f.jsxs)(`div`,{className:Dn.roomViewerActions,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faChevronLeft,onClick:()=>p(-1)}),(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faLayerGroup}),(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faChevronRight,onClick:()=>p(1)})]})]})}var kn={scrollbarProvider:`scrollbarProvider_IMBFu`};function An({className:e=void 0,children:t=void 0}){return(0,f.jsx)(`div`,{className:(0,l.default)(kn.scrollbarProvider,e),children:t})}var jn=An,Mn={resultCount:`resultCount_Sn48Q`};function Nn({value:e,onChange:t,onDebounce:n,placeholder:r,label:i,debounceMs:a=500,totalAmount:o,showAmount:s=!0,className:l,width:u,...d}){let p=(0,c.useRef)(null);(0,c.useEffect)(()=>()=>{p.current!==null&&clearTimeout(p.current)},[]);function m(e){let r=e==null?``:String(e),i=r.trim()===``?``:r;t(i),p.current!==null&&clearTimeout(p.current),p.current=setTimeout(()=>{n?.(i)},a)}let h=s&&typeof o==`number`&&!Number.isNaN(o);return(0,f.jsxs)(`div`,{...d,className:l,style:u==null?void 0:{width:u},children:[(0,f.jsx)(ye,{type:Y.Search,label:i,placeholder:r,value:e,onChange:m}),h&&(0,f.jsxs)(`p`,{className:Mn.resultCount,children:[o,` `,o===1?`result`:`results`]})]})}var Pn={stepper:`stepper_kiS2A`,"stepper-clickable":`stepper-clickable_Nm6fP`,stepperClickable:`stepper-clickable_Nm6fP`,"stepper-vertical":`stepper-vertical_2y9rg`,stepperVertical:`stepper-vertical_2y9rg`,"stepper-connector":`stepper-connector_J2FwZ`,stepperConnector:`stepper-connector_J2FwZ`,"stepper-connector-vertical":`stepper-connector-vertical_vwY38`,stepperConnectorVertical:`stepper-connector-vertical_vwY38`,"stepper-connector-filled":`stepper-connector-filled_W8UZS`,stepperConnectorFilled:`stepper-connector-filled_W8UZS`,"stepper-entry":`stepper-entry_KD4JJ`,stepperEntry:`stepper-entry_KD4JJ`,"stepper-entry-active":`stepper-entry-active_V1aRt`,stepperEntryActive:`stepper-entry-active_V1aRt`,"stepper-entry-done":`stepper-entry-done_M3wb5`,stepperEntryDone:`stepper-entry-done_M3wb5`,"stepper-entry-number":`stepper-entry-number_J168Q`,stepperEntryNumber:`stepper-entry-number_J168Q`,"stepper-entry-number-done":`stepper-entry-number-done_-m7sD`,stepperEntryNumberDone:`stepper-entry-number-done_-m7sD`,showCheckmark:`showCheckmark_Rd0oW`,"stepper-entry-label":`stepper-entry-label_b94eg`,stepperEntryLabel:`stepper-entry-label_b94eg`,"stepper-entry-label-vertical":`stepper-entry-label-vertical_Zm8i4`,stepperEntryLabelVertical:`stepper-entry-label-vertical_Zm8i4`};function Fn(){return(0,f.jsx)(`svg`,{strokeLinejoin:`round`,strokeLinecap:`round`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`-0.2 -1.2 3.4 2`,height:`20px`,width:`20px`,children:(0,f.jsx)(`path`,{d:`M 0 0 l 1 1 l 2 -2`,stroke:`white`,strokeWidth:`0.4`,fill:`none`})})}function In({steps:e=[],currentStep:t=0,alignment:n=`horizontal`,onStepClicked:r=null,nonLinear:i=!1,hideLabels:a=!1,className:o,style:s,classNames:u,styles:d,...p}){let m=n===`vertical`;return(0,f.jsx)(`div`,{...p,className:(0,l.default)(Pn.stepper,{[Pn.stepperVertical]:m},u?.root,o),style:{...d?.root,...s},children:e.map((n,o)=>{let s=o<t,p=o<=t,h=!!r&&(i?o!==t:s),g=(0,l.default)(Pn.stepperEntry,{[Pn.stepperEntryActive]:p},{[Pn.stepperEntryDone]:s},{[Pn.stepperClickable]:h},u?.entry),_=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`div`,{className:(0,l.default)(Pn.stepperEntryNumber,{[Pn.stepperEntryNumberDone]:s},u?.entryNumber),style:d?.entryNumber,children:s?(0,f.jsx)(Fn,{}):o+1}),!a&&(0,f.jsx)(`div`,{className:(0,l.default)(Pn.stepperEntryLabel,{[Pn.stepperEntryLabelVertical]:m},u?.entryLabel),style:d?.entryLabel,children:n.label})]});return(0,f.jsxs)(c.default.Fragment,{children:[h?(0,f.jsx)(z,{className:g,style:d?.entry,onClick:()=>r(o),"aria-current":o===t?`step`:void 0,children:_}):(0,f.jsx)(`div`,{className:g,style:d?.entry,"aria-current":o===t?`step`:void 0,children:_}),o<e.length-1&&(0,f.jsx)(`div`,{className:(0,l.default)(Pn.stepperConnector,{[Pn.stepperConnectorFilled]:s},{[Pn.stepperConnectorVertical]:m},u?.connector),style:d?.connector})]},o)})})}var Ln={tabHeader:`tabHeader_C-b9d`,"tabHeader-tab":`tabHeader-tab_Wbyt-`,tabHeaderTab:`tabHeader-tab_Wbyt-`,"tabHeader-tab-active":`tabHeader-tab-active_IExSo`,tabHeaderTabActive:`tabHeader-tab-active_IExSo`,"tabHeader-tab-disabled":`tabHeader-tab-disabled_yWJxS`,tabHeaderTabDisabled:`tabHeader-tab-disabled_yWJxS`,"tabHeader-icon":`tabHeader-icon_ryEHB`,tabHeaderIcon:`tabHeader-icon_ryEHB`,"tabHeader-labels":`tabHeader-labels_q5Af5`,tabHeaderLabels:`tabHeader-labels_q5Af5`,"tabHeader-title":`tabHeader-title_Jq2Vy`,tabHeaderTitle:`tabHeader-title_Jq2Vy`,"tabHeader-subtitle":`tabHeader-subtitle_4lhSa`,tabHeaderSubtitle:`tabHeader-subtitle_4lhSa`};function Rn({tabs:e=[],currentTab:t,onChange:n,className:r,style:i,classNames:a,styles:o,...s}){return(0,f.jsx)(`div`,{...s,role:`tablist`,className:(0,l.default)(Ln.tabHeader,a?.root,r),style:{...o?.root,...i},children:e.map(e=>{let r=e.id===t,i=!!e.title||!!e.subtitle;return(0,f.jsxs)(z,{role:`tab`,"aria-selected":r,"aria-disabled":e.disabled||void 0,tabIndex:e.disabled?-1:0,className:(0,l.default)(Ln.tabHeaderTab,{[Ln.tabHeaderTabActive]:r},{[Ln.tabHeaderTabDisabled]:e.disabled},a?.tab),style:o?.tab,onClick:()=>{e.disabled||r||n(e.id)},children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:e.icon,className:(0,l.default)(Ln.tabHeaderIcon,a?.icon),style:o?.icon}),i&&(0,f.jsxs)(`div`,{className:(0,l.default)(Ln.tabHeaderLabels,a?.labels),style:o?.labels,children:[e.title&&(0,f.jsx)(`span`,{className:(0,l.default)(Ln.tabHeaderTitle,a?.title),style:o?.title,children:e.title}),e.subtitle&&(0,f.jsx)(`span`,{className:(0,l.default)(Ln.tabHeaderSubtitle,a?.subtitle),style:o?.subtitle,children:e.subtitle})]})]},e.id)})})}var zn=`https://tenor.googleapis.com/v2`,Bn=class{constructor(e){this.key=e}async search(e,t={}){let n=new URLSearchParams({q:e,key:this.key});return t.limit!=null&&n.set(`limit`,String(t.limit)),t.contentfilter!=null&&n.set(`contentfilter`,t.contentfilter),t.pos!=null&&n.set(`pos`,t.pos),(await fetch(`${zn}/search?${n}`)).json()}async searchSuggestions(e){let t=new URLSearchParams({q:e,key:this.key});return(await fetch(`${zn}/search_suggestions?${t}`)).json()}registerShare(e,t){let n=new URLSearchParams({id:t,q:e,key:this.key});fetch(`${zn}/registershare?${n}`).catch(()=>null)}},Vn={gifPreview:`gifPreview_-ECUZ`,"gifPreview-image":`gifPreview-image_Aq7-a`,gifPreviewImage:`gifPreview-image_Aq7-a`,"gifPreview-image-container":`gifPreview-image-container_ycypL`,gifPreviewImageContainer:`gifPreview-image-container_ycypL`,gradientBottomLeftToTopRight:`gradientBottomLeftToTopRight_wo6HB`};function Hn({className:e,previewItems:t=[],onSelect:n,onLoadAdditional:r}){function i(e){let t=e.currentTarget,n=t.scrollHeight-t.clientHeight*1.5;t.scrollTop>=n&&r?.()}return(0,f.jsx)(f.Fragment,{children:t.length>0&&(0,f.jsx)(`div`,{className:(0,l.default)(Vn.gifPreview,e),onScroll:i,children:t.map((e,t)=>(0,f.jsx)(z,{className:Vn.gifPreviewImageContainer,onClick:()=>n?.(e),children:(0,f.jsx)(`div`,{className:Vn.gifPreviewImage,style:{backgroundImage:`url(${e.media_formats.tinygif.url})`}})},`${e.id}_${t}`))})})}var Un={gifView:`gifView_Fa2zj`,"gifView-loading":`gifView-loading_LfNJr`,gifViewLoading:`gifView-loading_LfNJr`,gradientBottomLeftToTopRight:`gradientBottomLeftToTopRight_JR6aS`};function Wn({className:e,src:t=``}){let[n,r]=(0,c.useState)(!0);return(0,c.useEffect)(()=>{r(!0)},[t]),(0,f.jsxs)(`div`,{className:(0,l.default)(Un.gifView,e),children:[(0,f.jsx)(`img`,{className:Un.tenorPickerSelected,src:t,onLoad:()=>r(!1)}),n&&(0,f.jsx)(`div`,{className:Un.gifViewLoading})]})}var Gn={"tenorPicker-selected":`tenorPicker-selected_IfR2z`,tenorPickerSelected:`tenorPicker-selected_IfR2z`,"tenorPicker-modal-content":`tenorPicker-modal-content_Vkolf`,tenorPickerModalContent:`tenorPicker-modal-content_Vkolf`,"tenorPicker-suggestions-container":`tenorPicker-suggestions-container_kJCj5`,tenorPickerSuggestionsContainer:`tenorPicker-suggestions-container_kJCj5`,"tenorPicker-suggestions-item":`tenorPicker-suggestions-item_Rl99M`,tenorPickerSuggestionsItem:`tenorPicker-suggestions-item_Rl99M`};function Kn({className:e,token:t=``,isModal:n=!1,onSelect:r=()=>void 0,selected:i=null}){let a=(0,c.useMemo)(()=>new Bn(t),[t]),[o,s]=(0,c.useState)(``),[u,d]=(0,c.useState)([]),[p,m]=(0,c.useState)([]),[h,g]=(0,c.useState)(null),[_,v]=(0,c.useState)(!1);async function y(e){if(s(e),!e.trim()){d([]),m([]),g(null);return}let[{results:t=[],next:n=null},{results:r=[]}]=await Promise.all([a.search(e,{limit:18,contentfilter:`medium`}),a.searchSuggestions(e)]);d(t),g(n),m(r)}async function b(){let{results:e=[],next:t=null}=await a.search(o,{limit:36,pos:h??void 0,contentfilter:`medium`});g(t),d(t=>[...t,...e])}async function x(e){await r(e),v(!1),e&&a.registerShare(o,e.id)}function S(){return(0,f.jsx)(fe,{inline:!0,className:Gn.tenorPickerSuggestionsContainer,children:p.map(e=>(0,f.jsx)(de,{className:Gn.tenorPickerSuggestionsItem,text:e,onClick:()=>y(e)},e))})}function C(){return(0,f.jsx)(Hn,{previewItems:u,onSelect:x,onLoadAdditional:b})}function w(){return(0,f.jsx)(Nn,{label:`Pick gif`,value:o,onDebounce:y,onChange:s})}return n?(0,f.jsxs)(`div`,{className:(0,l.default)(Gn.tenorPicker,e),children:[(0,f.jsxs)(`div`,{className:E.actionButtons,children:[(0,f.jsx)(I,{onClick:()=>v(!0),children:`Pick gif`}),i&&(0,f.jsx)(I,{styleType:j.Delete,onClick:()=>x(null),children:`Remove gif`})]}),i&&(0,f.jsx)(Wn,{className:Gn.tenorPickerSelected,src:i}),(0,f.jsx)(Me,{isOpen:_,onClose:()=>v(!1),children:(0,f.jsxs)(`div`,{className:Gn.tenorPickerModalContent,children:[w(),S(),C()]})})]}):(0,f.jsxs)(`div`,{className:(0,l.default)(Gn.tenorPicker,e),children:[(0,f.jsx)(ge,{align:me.Left,isOpen:u.length>0&&_,onOpenChange:v,content:(0,f.jsxs)(f.Fragment,{children:[S(),C()]}),children:w()}),i&&(0,f.jsx)(I,{styleType:j.Delete,onClick:()=>x(null),children:`Remove gif`}),i&&(0,f.jsx)(Wn,{className:Gn.tenorPickerSelected,src:i})]})}function qn(e){return(0,f.jsx)(ye,{...e,multiline:!0})}var Jn={id:`default`,variables:{"--grey":`#8A8A8A`,"--lightgrey":`#e0e0e0`,"--lightergrey":`#B1B1B1`,"--white":`#FFFFFF`,"--red":`#D6002A`,"--lighter-red":`#ffeae9`,"--green":`#287626`,"--lighter-green":`#C4FFC9`,"--blue":`#5873d5`,"--lighter-blue":`#C6DBFF`,"--black":`black`,"--orange":`#ff7f50`,"--lighter-orange":`#ffe5d9`,"--primary-color":`#8184d6`,"--primary-accent":`#90CAF9`,"--primary-lighter":`#9a9ce4`,"--accent-color":`var(--grey)`,"--accent-color-light":`var(--lightgrey)`,"--text-color":`var(--white)`,"--text-dark":`var(--lightergrey)`,"--text-light":`var(--lightergrey)`,"--text-on-primary":`var(--white)`,"--text-on-delete":`var(--white)`,"--border-color":`#656574`,"--background":`#393945`,"--background-accent":`#33333c`,"--background-accent-dark":`var(--grey)`,"--background-accent-light":`#484856`,"--background-modal":`#484856`,"--success-color":`var(--green)`,"--success-lighter":`var(--lighter-green)`,"--error-color":`var(--red)`,"--error-lighter":`var(--lighter-red)`,"--info-color":`var(--blue)`,"--info-lighter":`var(--lighter-blue)`,"--warn-color":`var(--orange)`,"--warn-lighter":`var(--lighter-orange)`,"--default-font-size":`14px`,"--text-small-font-size":`12px`,"--header-font-size":`24px`,"--header-medium-font-size":`18px`,"--header-small-font-size":`16px`,"--default-font-weight":`400`,"--header-font-weight":`600`,"--input-background":`transparent`,"--input-icon-color":`var(--text-color)`,"--error-border-color":`var(--red)`,"--default-border-radius":`8px`,"--padding-sides":`15px`,"--margin-top":`10px`,"--default-font":`'Inter', sans-serif`,"--themed-font":`'Inter', sans-serif`,"--card-shadow":`0 3px 1px -2px rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 14%), 0 1px 5px 0 rgb(0 0 0 / 12%)`,"--spacing-s":`4px`,"--spacing-m":`8px`,"--spacing-l":`16px`}},Yn={colorFade:`colorFade_eLv2g`},Xn=class extends c.Component{constructor(...e){super(...e),this.state={resolvedVariables:{},colorFadeActive:!1,currentThemeColor:null},this.colorFadeTimeout=null,this.wrapperRef=c.default.createRef(),this.themeColorMeta=null,this.createdThemeColorMeta=!1,this.applyTheme=e=>{let t=this.props.themes??[Jn],n=t.find(e=>!e.baseThemeId)??t[0],r=n?n.variables:{},i=t.find(t=>t.id===e),a=i?this.resolveChain(i.id):[],o=Object.assign({},r,...a);this.setState({resolvedVariables:o,colorFadeActive:!0}),this.colorFadeTimeout&&clearTimeout(this.colorFadeTimeout),this.colorFadeTimeout=setTimeout(()=>{this.setState({colorFadeActive:!1}),this.colorFadeTimeout=null},500),setTimeout(()=>{this.wrapperRef.current&&this.setState({currentThemeColor:getComputedStyle(this.wrapperRef.current).getPropertyValue(`--primary-color`).trim()})},1)}}componentDidMount(){this.applyTheme(this.props.currentThemeId),this.syncThemeColorMeta(this.state.currentThemeColor??``)}componentDidUpdate(e,t){t.currentThemeColor!==this.state.currentThemeColor&&this.syncThemeColorMeta(this.state.currentThemeColor??``),(e.currentThemeId!==this.props.currentThemeId||e.themes!==this.props.themes)&&this.applyTheme(this.props.currentThemeId)}componentWillUnmount(){this.colorFadeTimeout&&clearTimeout(this.colorFadeTimeout),this.createdThemeColorMeta&&this.themeColorMeta?.remove()}syncThemeColorMeta(e){if(!(typeof document>`u`)){if(!this.themeColorMeta){let e=document.head.querySelector(`meta[name="theme-color"]`);if(e)this.themeColorMeta=e;else{let e=document.createElement(`meta`);e.setAttribute(`name`,`theme-color`),document.head.appendChild(e),this.themeColorMeta=e,this.createdThemeColorMeta=!0}}this.themeColorMeta.setAttribute(`content`,e)}}resolveChain(e){let t=(this.props.themes??[Jn]).find(t=>t.id===e);return t?[...t.baseThemeId?this.resolveChain(t.baseThemeId):[],t.variables]:[]}render(){let{children:e}=this.props,{resolvedVariables:t,colorFadeActive:n}=this.state;return(0,f.jsx)(`div`,{ref:this.wrapperRef,id:`themeProvider`,className:n?Yn.colorFade:void 0,style:t,children:e})}};function Zn(e=`default`){let[t,n]=(0,c.useState)(localStorage.getItem(`theme`)||e);return{currentThemeId:t,setCurrentThemeId:e=>{n(e),localStorage.setItem(`theme`,e)}}}var Qn={container:`container_krdsW`,"container-top-left":`container-top-left_zfDTO`,containerTopLeft:`container-top-left_zfDTO`,"container-top-center":`container-top-center_CUIGc`,containerTopCenter:`container-top-center_CUIGc`,"container-top-right":`container-top-right_sB0KU`,containerTopRight:`container-top-right_sB0KU`,"container-bottom-left":`container-bottom-left_toJdF`,containerBottomLeft:`container-bottom-left_toJdF`,"container-bottom-center":`container-bottom-center_Bkf9m`,containerBottomCenter:`container-bottom-center_Bkf9m`,"container-bottom-right":`container-bottom-right_oRSMc`,containerBottomRight:`container-bottom-right_oRSMc`,toast:`toast_qBi4o`,toastSlideDown:`toastSlideDown_4lKWq`,"toast-bottom":`toast-bottom_X8ZIe`,toastBottom:`toast-bottom_X8ZIe`,toastSlideUp:`toastSlideUp_SGR5X`,"toast-dismissing":`toast-dismissing_xKmB-`,toastDismissing:`toast-dismissing_xKmB-`,toastFadeOut:`toastFadeOut_cvHYp`,"toast-info":`toast-info_RlLli`,toastInfo:`toast-info_RlLli`,toastIcon:`toastIcon_xU1nA`,"toast-success":`toast-success_I1g1B`,toastSuccess:`toast-success_I1g1B`,"toast-error":`toast-error_MloFO`,toastError:`toast-error_MloFO`,"toast-warn":`toast-warn_pP6HB`,toastWarn:`toast-warn_pP6HB`,"toast-default":`toast-default_RTt2L`,toastDefault:`toast-default_RTt2L`,toastContent:`toastContent_gvyIv`,toastCloseButton:`toastCloseButton_n-YST`,toastProgressBar:`toastProgressBar_6vBs6`,toastShrink:`toastShrink_h89HS`},$n={info:d.faCircleInfo,success:d.faCircleCheck,error:d.faCircleXmark,warn:d.faTriangleExclamation,default:d.faBell};function er({item:e,isBottom:t,onDismiss:n}){let{id:r,content:i,options:a,dismissing:o}=e,{duration:s,showRemainingTime:p,showCloseButton:m,type:h,classNames:g,styles:_}=a;return(0,c.useEffect)(()=>{if(s===0)return;let e=setTimeout(()=>n(r),s);return()=>clearTimeout(e)},[r,s,n]),(0,f.jsxs)(`div`,{className:(0,l.default)(Qn.toast,t?Qn.toastBottom:null,Qn[`toast-${h}`],o&&Qn.toastDismissing,g?.root),style:_?.root,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:$n[h],className:(0,l.default)(Qn.toastIcon,g?.icon),style:_?.icon}),(0,f.jsx)(`div`,{className:(0,l.default)(Qn.toastContent,g?.content),style:_?.content,children:i}),m&&(0,f.jsx)(B,{icon:d.faXmark,onClick:()=>n(r),className:(0,l.default)(Qn.toastCloseButton,g?.closeButton),style:_?.closeButton,"aria-label":`Close`}),p&&s>0&&(0,f.jsx)(`div`,{className:(0,l.default)(Qn.toastProgressBar,g?.progressBar),style:{"--toast-duration":`${s}ms`,..._?.progressBar}})]})}var tr=null;function nr(e){tr=e}function rr(){tr=null}function ir(e,t){if(!tr){console.error(`[Toast] No ToastProvider found. Wrap your app with <ToastProvider>.`);return}tr(e,t)}var ar={position:`top-right`,duration:4e3,showRemainingTime:!0,showCloseButton:!0,allowStacking:!0},or=220;function sr(e){return Qn[`container-${e}`]}function cr({children:e,position:t=ar.position,duration:n=ar.duration,showRemainingTime:r=ar.showRemainingTime,showCloseButton:i=ar.showCloseButton,allowStacking:a=ar.allowStacking}){let[o,s]=(0,c.useState)([]),u=(0,c.useRef)(0),d=(0,c.useCallback)(e=>{s(t=>t.map(t=>t.id===e?{...t,dismissing:!0}:t)),setTimeout(()=>{s(t=>t.filter(t=>t.id!==e))},or)},[]),p=(0,c.useCallback)((e,o)=>{let c={position:o?.position??t,duration:o?.duration??n,showRemainingTime:o?.showRemainingTime??r,showCloseButton:o?.showCloseButton??i,type:o?.type??`default`,classNames:o?.classNames,styles:o?.styles};u.current+=1;let l={id:`toast-${u.current}`,content:e,options:c,dismissing:!1};s(e=>!a&&e.length>0?(setTimeout(()=>{s([l])},or),e.map(e=>({...e,dismissing:!0}))):[...e,l])},[t,n,r,i,a]);(0,c.useEffect)(()=>(nr(p),()=>rr()),[p]);let m=o.reduce((e,t)=>{let n=t.options.position;return e[n]||(e[n]=[]),e[n].push(t),e},{});return(0,f.jsxs)(f.Fragment,{children:[e,(0,f.jsx)(ie,{children:Object.entries(m).map(([e,t])=>(0,f.jsx)(`div`,{className:(0,l.default)(Qn.container,sr(e)),children:t.map(t=>(0,f.jsx)(er,{item:t,isBottom:e.startsWith(`bottom`),onDismiss:d},t.id))},e))})]})}var $={virtualList:`virtualList_qBPNc`,"virtualList-drag-clone":`virtualList-drag-clone_artnC`,virtualListDragClone:`virtualList-drag-clone_artnC`,"virtualList-header":`virtualList-header_0Ellb`,virtualListHeader:`virtualList-header_0Ellb`,"virtualList-header-cell":`virtualList-header-cell_c8NGV`,virtualListHeaderCell:`virtualList-header-cell_c8NGV`,"virtualList-header-toggle":`virtualList-header-toggle_pYFxD`,virtualListHeaderToggle:`virtualList-header-toggle_pYFxD`,"virtualList-toggle-wrapper":`virtualList-toggle-wrapper_JP32M`,virtualListToggleWrapper:`virtualList-toggle-wrapper_JP32M`,"virtualList-toggle-popover":`virtualList-toggle-popover_gbpd7`,virtualListTogglePopover:`virtualList-toggle-popover_gbpd7`,"virtualList-toggle-item":`virtualList-toggle-item_5gu5d`,virtualListToggleItem:`virtualList-toggle-item_5gu5d`,"virtualList-column-chip":`virtualList-column-chip_nOqr6`,virtualListColumnChip:`virtualList-column-chip_nOqr6`,"virtualList-select-cell":`virtualList-select-cell_s9kAy`,virtualListSelectCell:`virtualList-select-cell_s9kAy`,"virtualList-body":`virtualList-body_k-fRr`,virtualListBody:`virtualList-body_k-fRr`,"virtualList-row":`virtualList-row_TTY50`,virtualListRow:`virtualList-row_TTY50`,"virtualList-row-no-divider":`virtualList-row-no-divider_Ct0gV`,virtualListRowNoDivider:`virtualList-row-no-divider_Ct0gV`,"virtualList-row-no-hover":`virtualList-row-no-hover_2d3mH`,virtualListRowNoHover:`virtualList-row-no-hover_2d3mH`,"virtualList-row-selected":`virtualList-row-selected_hwEN-`,virtualListRowSelected:`virtualList-row-selected_hwEN-`,"virtualList-row-draggable":`virtualList-row-draggable_I86ha`,virtualListRowDraggable:`virtualList-row-draggable_I86ha`,"virtualList-row-dragging":`virtualList-row-dragging_6T5tQ`,virtualListRowDragging:`virtualList-row-dragging_6T5tQ`,"virtualList-row-drop-inside":`virtualList-row-drop-inside_Uhi9n`,virtualListRowDropInside:`virtualList-row-drop-inside_Uhi9n`,"virtualList-drop-line":`virtualList-drop-line_EM-g4`,virtualListDropLine:`virtualList-drop-line_EM-g4`,"virtualList-drop-line-before":`virtualList-drop-line-before_n-0iZ`,virtualListDropLineBefore:`virtualList-drop-line-before_n-0iZ`,"virtualList-drop-line-after":`virtualList-drop-line-after_2dld-`,virtualListDropLineAfter:`virtualList-drop-line-after_2dld-`,"virtualList-reordering":`virtualList-reordering_Rt9E3`,virtualListReordering:`virtualList-reordering_Rt9E3`,"virtualList-cell":`virtualList-cell_H0zBv`,virtualListCell:`virtualList-cell_H0zBv`,"virtualList-loading-full":`virtualList-loading-full_wzZNM`,virtualListLoadingFull:`virtualList-loading-full_wzZNM`,"virtualList-loading-indicator":`virtualList-loading-indicator_EJced`,virtualListLoadingIndicator:`virtualList-loading-indicator_EJced`,"virtualList-spinner":`virtualList-spinner_apClW`,virtualListSpinner:`virtualList-spinner_apClW`};function lr({index:e,top:t,padding:n,columnTemplate:r,isSelected:i,showDivider:a,hover:o,onClick:s,observer:u,ariaRowIndex:d,ariaPosInSet:p,ariaSetSize:m,rowRole:h,reorderable:g,draggable:_,isDragging:v,reserveToggleGutter:y,onMouseDown:b,onDragStart:x,onDragOver:S,onDragEnd:C,onDrop:w,onTouchStart:T,dropPosition:E,dropIndentPx:D,dropIndicatorClassName:O,dropIndicatorStyle:k,rowClassName:A,rowStyle:j,children:M}){let N=(0,c.useRef)(null);return(0,c.useLayoutEffect)(()=>{let e=N.current;if(!(!e||!u))return u.observe(e),()=>u.unobserve(e)},[u]),(0,f.jsxs)(`div`,{ref:N,"data-index":e,className:(0,l.default)($.virtualListRow,i&&$.virtualListRowSelected,!a&&$.virtualListRowNoDivider,!o&&$.virtualListRowNoHover,g&&$.virtualListRowDraggable,v&&$.virtualListRowDragging,E===`inside`&&$.virtualListRowDropInside,A),style:{position:`absolute`,top:0,left:0,right:0,transform:`translateY(${t}px)`,...n==null?{}:{padding:n},...r?{display:`grid`,gridTemplateColumns:r}:{},...y?{paddingRight:32}:{},...j},onClick:s,draggable:_,onMouseDown:b,onDragStart:x,onDragOver:S,onDragEnd:C,onDrop:w??(_?e=>e.preventDefault():void 0),onTouchStart:T,onContextMenu:_?e=>e.preventDefault():void 0,"aria-selected":i,"aria-rowindex":d,"aria-posinset":p,"aria-setsize":m,role:h,children:[(E===`before`||E===`after`)&&(0,f.jsx)(`div`,{"data-drop-line":E,"aria-hidden":!0,className:(0,l.default)($.virtualListDropLine,E===`before`?$.virtualListDropLineBefore:$.virtualListDropLineAfter,O),style:{left:D??0,...k}}),M]})}function ur(e,t,n,r=0){let i=e.length,a=Array(i+1);a[0]=0;for(let o=0;o<i;o++){let s=o<i-1?r:0;a[o+1]=a[o]+(t.get(e[o])??n)+s}return{offsets:a,totalHeight:a[i]}}function dr(e,t,n){if(n<=0)return 0;let r=0,i=n-1;for(;r<i;){let n=r+i>>1;e[n+1]<=t?r=n+1:i=n}return r}function fr(e,t,n,r,i){if(i===0)return{startIndex:0,endIndex:-1};let a=dr(e,t,i),o=a;for(;o<i&&e[o]<t+n;)o++;return{startIndex:Math.max(0,a-r),endIndex:Math.min(i-1,o+r-1)}}function pr(e,t,n,r,i){if(e===-1||e===t)return null;let a=r+i/2;return(t>e?n>=a:n<=a)?t:null}function mr(e,t,n,r){if(n<=0)return`before`;let i=(e-t)/n;return r?i<1/3?`before`:i>2/3?`after`:`inside`:i<.5?`before`:`after`}function hr(e,t){let n=t[e],r=e+1;for(;r<t.length&&t[r]>n;)r++;return r-1}function gr(e,t){return e.length===0?`1fr`:e.map(e=>{switch(e.width.type){case`fixed`:return`${e.width.px}px`;case`flex`:return`${e.width.weight??1}fr`;case`fit`:{let n=t?.[e.key];return n==null?`fit-content(100%)`:`${n}px`}}}).join(` `)}var _r=`ahroweui:virtuallist:columns:`;function vr(e){if(!e||typeof window>`u`)return null;try{let t=window.localStorage.getItem(_r+e);if(!t)return null;let n=JSON.parse(t);if(n&&Array.isArray(n.visible)&&Array.isArray(n.known))return{visible:n.visible.filter(e=>typeof e==`string`),known:n.known.filter(e=>typeof e==`string`)}}catch{}return null}function yr(e,t){return t&&t.known.includes(e.key)?t.visible.includes(e.key):!e.defaultHidden}function br(e,t){if(typeof e==`number`)return e;let n=e.trim();if(n===``)return 0;let r=Number(n);if(!Number.isNaN(r))return r;let i=/^(-?\d*\.?\d+)px$/.exec(n);if(i)return parseFloat(i[1]);if(typeof document>`u`||!t)return 0;let a=document.createElement(`div`);a.style.cssText=`position:absolute;visibility:hidden;height:${n};`,t.appendChild(a);let o=a.getBoundingClientRect().height;return t.removeChild(a),Number.isFinite(o)?o:0}function xr({items:e,keys:t,getItemKey:n,estimatedRowHeight:r,rowGap:i,overscan:a,onLoadMore:o,loadMoreThreshold:s}){let[l,u]=(0,c.useState)(0),[d,f]=(0,c.useState)(0),[p,m]=(0,c.useState)(0),[h,g]=(0,c.useState)(()=>br(i,null)),[_,v]=(0,c.useState)(new Map),[y,b]=(0,c.useState)(!1),x=(0,c.useRef)(!1),S=(0,c.useRef)(null),C=(0,c.useRef)(null),w=(0,c.useRef)([]),T=(0,c.useRef)(null),E=(0,c.useRef)(0),D=(0,c.useRef)([]),[O]=(0,c.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(e=>{v(t=>{let n=null;for(let r of e){let e=r.target,i=Number(e.dataset.index);if(Number.isNaN(i))continue;let a=D.current[i];if(a===void 0)continue;let o=r.borderBoxSize?.[0],s=o?Math.round(o.blockSize):e.offsetHeight;t.get(a)!==s&&(n||=new Map(t),n.set(a,s))}return n??t})}));(0,c.useEffect)(()=>()=>O?.disconnect(),[O]),(0,c.useLayoutEffect)(()=>{let e=S.current;if(!e)return;f(e.clientHeight),m(e.clientWidth);let t=new ResizeObserver(()=>{f(e.clientHeight),m(e.clientWidth)});return t.observe(e),()=>t.disconnect()},[]);let k=(0,c.useCallback)(e=>{let t=e.currentTarget;E.current=t.scrollTop,T.current??=requestAnimationFrame(()=>{T.current=null,u(E.current)}),o&&!x.current&&t.scrollTop+t.clientHeight>=t.scrollHeight-s&&(x.current=!0,b(!0),o().finally(()=>{x.current=!1,b(!1)}))},[o,s]);(0,c.useEffect)(()=>()=>{T.current!=null&&cancelAnimationFrame(T.current)},[]),(0,c.useLayoutEffect)(()=>{D.current=t}),(0,c.useLayoutEffect)(()=>{let e=br(i,S.current);g(t=>t===e?t:e)},[i,p,d]);let{offsets:A,totalHeight:j}=(0,c.useMemo)(()=>ur(t,_,r,h),[t,_,r,h]);(0,c.useLayoutEffect)(()=>{let t=S.current,n=w.current;if(w.current=A,!t||n.length===0)return;let r=t.scrollTop;if(r<=0)return;let i=dr(n,r,n.length-1);if(i>=e.length)return;let a=r-n[i],o=A[i]+a;Math.abs(o-r)>.5&&(t.scrollTop=o,E.current=o,u(o))},[A,e.length]);let M=(0,c.useMemo)(()=>{function t(e,t){let n=S.current;if(!n)return;let r=Math.max(0,e);typeof n.scrollTo==`function`?n.scrollTo({top:r,behavior:t??`auto`}):n.scrollTop=r}function r(n,r){let i=S.current;if(!i||e.length===0)return;let a=Math.max(0,Math.min(n,e.length-1)),o=A[a]??0,s=(A[a+1]??o)-o,c=C.current?.offsetHeight??0,l=Math.max(0,i.clientHeight-c),u=r?.align??`start`,d=o-c;u===`center`?d-=(l-s)/2:u===`end`&&(d-=l-s),t(d,r?.behavior)}return{scrollToIndex:r,scrollToKey(t,i){let a=e.findIndex((e,r)=>(n?n(e,r):r)===t);a>=0&&r(a,i)},scrollToTop(e){t(0,e?.behavior)},getScrollElement:()=>S.current}},[e,A,n]),{startIndex:N,endIndex:P}=(0,c.useMemo)(()=>fr(A,l,d,a,e.length),[A,l,d,a,e.length]);return{rootRef:S,headerRef:C,rowObserver:O,keysRef:D,offsets:A,totalHeight:j,containerHeight:d,containerWidth:p,startIndex:N,endIndex:P,handleScroll:k,showLoadMoreSpinner:y,scrollApi:M}}function Sr({items:e,getKey:t,multiSelect:n,selectedKeys:r,onSelectionChange:i}){let a=r!==void 0,[o,s]=(0,c.useState)(new Set),l=a?r:o;function u(e){a||s(e),i?.(e)}function d(e){let t=new Set(l);t.has(e)?t.delete(e):t.add(e),u(t)}function f(){let n=e.map((e,n)=>t(e,n));u(n.every(e=>l.has(e))?new Set:new Set(n))}let{allSelected:p,someSelected:m}=(0,c.useMemo)(()=>{if(!n||e.length===0)return{allSelected:!1,someSelected:!1};let r=e.every((e,n)=>l.has(t(e,n)));return{allSelected:r,someSelected:!r&&e.some((e,n)=>l.has(t(e,n)))}},[n,e,l,t]);return{effectiveSelectedKeys:l,handleRowSelect:d,handleSelectAll:f,allSelected:p,someSelected:m}}function Cr({columns:e,items:t,multiSelect:n,visibleColumnKeys:r,onVisibleColumnsChange:i,persistColumnsKey:a,showColumnToggle:o,rootRef:s,startIndex:l,endIndex:u,containerHeight:d,containerWidth:f}){let p=r!==void 0,[m,h]=(0,c.useState)(!1),g=(0,c.useRef)(null),[_,v]=(0,c.useState)({}),[y,b]=(0,c.useState)(()=>{let t=vr(a);return new Set((e??[]).filter(e=>yr(e,t)).map(e=>e.key))}),x=(0,c.useRef)(new Set((e??[]).map(e=>e.key)));(0,c.useEffect)(()=>{if(p)return;let t=e??[],n=new Set(t.map(e=>e.key)),r=x.current,i=n.size===r.size;if(i){for(let e of n)if(!r.has(e)){i=!1;break}}if(i)return;x.current=n;let o=vr(a);b(e=>{let n=new Set;for(let i of t)r.has(i.key)?e.has(i.key)&&n.add(i.key):yr(i,o)&&n.add(i.key);return n})},[e,p,a]),(0,c.useEffect)(()=>{if(p||!a||typeof window>`u`)return;let t=e??[];if(!(t.length===0||y.size===0))try{window.localStorage.setItem(_r+a,JSON.stringify({visible:[...y],known:t.map(e=>e.key)}))}catch{}},[y,e,p,a]);let S=p?new Set(r):y;(0,c.useEffect)(()=>{if(!m)return;function e(e){g.current&&!g.current.contains(e.target)&&h(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[m]);let C=!!e?.length,w=C?e.filter(e=>S.has(e.key)):[],T=C?e.filter(e=>!e.defaultHidden&&!S.has(e.key)).length:0,E=C?`${n&&C?`40px `:``}${gr(w,_)}`:void 0,D=o!==!1&&C,O=w.filter(e=>e.width.type===`fit`),k=O.length>0,A=O.map(e=>e.key).join(`|`),[j,M]=(0,c.useState)({key:A,items:t});(j.key!==A||j.items!==t)&&(M({key:A,items:t}),Object.keys(_).length>0&&v({}));let N=(0,c.useCallback)(()=>{let e=s.current;if(!e)return;let t=new Map;e.querySelectorAll(`[data-fit-key]`).forEach(e=>{let n=e,r=n.getAttribute(`data-fit-key`);if(!r)return;let i=n.scrollWidth>n.clientWidth,a=n.scrollWidth;if(i||n.firstElementChild){let e=getComputedStyle(n),t=parseFloat(e.paddingLeft)||0,r=parseFloat(e.paddingRight)||0;if(i&&(a+=r),n.firstElementChild&&!i&&n.scrollWidth<=t+r+1){let e=1/0,i=-1/0;if(n.querySelectorAll(`*`).forEach(t=>{let n=t.getBoundingClientRect();n.left<e&&(e=n.left),n.right>i&&(i=n.right)}),i>e){let n=Math.ceil(i-e)+t+r;n>a&&(a=n)}}}a>(t.get(r)??0)&&t.set(r,a)}),t.size!==0&&v(n=>{let r=!1,i={...n};for(let[a,o]of t){if(o<=0)continue;let t=Math.min(Math.ceil(o),e.clientWidth);t>(n[a]??0)&&(i[a]=t,r=!0)}return r?i:n})},[s]),[P]=(0,c.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(()=>N())),F=(0,c.useRef)(new Set);(0,c.useEffect)(()=>()=>{P?.disconnect(),F.current.clear()},[P]),(0,c.useLayoutEffect)(()=>{if(!k)return;let e=s.current;if(!e||(N(),!P))return;let t=new Set(e.querySelectorAll(`[data-fit-key]`)),n=F.current;for(let e of n)t.has(e)||(P.unobserve(e),n.delete(e));for(let e of t)n.has(e)||(P.observe(e),n.add(e))},[k,A,_,l,u,d,f,t,N,P]),(0,c.useEffect)(()=>{if(!k)return;let e=0,t=requestAnimationFrame(()=>{N(),e=requestAnimationFrame(()=>N())});return()=>{cancelAnimationFrame(t),cancelAnimationFrame(e)}},[k,A,t,N]);let ee=(0,c.useCallback)(()=>v({}),[]);function te(e){let t=new Set(S);if(t.has(e)){if(t.size<=1)return;t.delete(e)}else t.add(e);let n=[...t];p||b(t),i?.(n)}return{hasColumns:C,visibleColumns:w,columnTemplate:E,shouldShowToggle:D,effectiveVisible:S,manuallyHiddenCount:T,toggleOpen:m,setToggleOpen:h,toggleRef:g,handleToggleColumn:te,recalculateColumns:ee}}function wr({reorderable:e,treeReorder:t,onReorder:n,onTreeDrop:r,longPressDelay:i,dragHandle:a,treeIndentPx:o,keys:s,depths:l,isGroupAt:u,rootRef:d,keysRef:f}){let p=(0,c.useRef)(null),[m,h]=(0,c.useState)(null),[g,_]=(0,c.useState)(null),v=(0,c.useRef)(null),y=(0,c.useRef)(n),b=(0,c.useRef)(r),x=(0,c.useRef)(t),S=(0,c.useRef)(l),C=(0,c.useRef)(u),w=(0,c.useRef)(!0),T=(0,c.useRef)(null),E=(0,c.useRef)(!1),D=(0,c.useRef)(null),O=(0,c.useRef)(0),k=(0,c.useRef)(0),A=(0,c.useRef)(null),j=(0,c.useRef)(!1),M=(0,c.useRef)(null),N=(0,c.useRef)(0),P=(0,c.useRef)(0),F=(0,c.useRef)(0),[ee]=(0,c.useState)(()=>typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(`(pointer: coarse)`).matches:!1);(0,c.useLayoutEffect)(()=>{y.current=n,b.current=r,x.current=t,S.current=l,v.current=g,C.current=u});function te(e){w.current=!!e.target.closest(`[data-drag-handle]`)}function I(e,n){if(a&&!w.current){n.preventDefault();return}p.current=e,h(e),t&&_(null)}function ne(e,t,n){let r=p.current;if(r==null)return null;let i=s.indexOf(r);if(i!==-1&&e>=i&&e<=hr(i,l))return null;let a=mr(t,n.top,n.height,u(e));return{key:s[e],position:a}}function L(e,t){t.preventDefault();let n=t.currentTarget.getBoundingClientRect(),r=ne(e,t.clientY,n);_(e=>e?.key===r?.key&&e?.position===r?.position?e:r)}function R(){let e=p.current,t=v.current;e!=null&&t&&t.key!==e&&r?.(e,t)}function z(e){e.preventDefault(),R(),_(null),p.current=null,h(null)}function re(){_(null),p.current=null,h(null)}function B(e,t){t.preventDefault();let r=p.current;if(r==null)return;let i=s.indexOf(r),a=t.currentTarget.getBoundingClientRect(),o=pr(i,e,t.clientY,a.top,a.height);o!=null&&n?.(i,o)}function ie(){p.current=null,h(null)}let ae=(0,c.useCallback)(e=>{let t=p.current,n=d.current;if(t==null||!n)return;let r=M.current?k.current-N.current+F.current/2:k.current,i=document.elementFromPoint(e,r),a=i&&n.contains(i)?i.closest(`[data-index]`):null;if(!a)return;let o=Number(a.dataset.index);if(Number.isNaN(o))return;let s=f.current.indexOf(t),c=a.getBoundingClientRect();if(x.current){let e=f.current,t=S.current;if(s!==-1&&o>=s&&o<=hr(s,t)){_(null);return}let n=mr(r,c.top,c.height,C.current(o)),i={key:e[o],position:n};_(e=>e?.key===i.key&&e?.position===i.position?e:i);return}let l=pr(s,o,r,c.top,c.height);l!=null&&y.current?.(s,l)},[d,f]),V=(0,c.useCallback)(()=>{let e=M.current;e&&(e.style.transform=`translate(${P.current}px, ${k.current-N.current}px)`)},[]),H=(0,c.useCallback)(()=>{let e=d.current;if(!e||!E.current){A.current=null;return}let t=e.getBoundingClientRect(),n=O.current,r=k.current,i=0;n>=t.left&&n<=t.right&&r>=t.top&&r<=t.bottom&&(r<t.top+48?i=-Math.min(18,Math.ceil((t.top+48-r)/3)):r>t.bottom-48&&(i=Math.min(18,Math.ceil((r-(t.bottom-48))/3)))),i!==0&&(e.scrollTop+=i,ae(n)),A.current=requestAnimationFrame(H)},[ae,d]),U=(0,c.useCallback)(()=>{if(T.current!=null&&(clearTimeout(T.current),T.current=null),window.removeEventListener(`touchmove`,oe),window.removeEventListener(`touchend`,U),window.removeEventListener(`touchcancel`,U),A.current!=null&&(cancelAnimationFrame(A.current),A.current=null),M.current&&=(M.current.remove(),null),document.body.style.touchAction=``,document.body.style.overscrollBehavior=``,E.current&&(j.current=!0,setTimeout(()=>{j.current=!1},350),x.current)){let e=p.current,t=v.current;e!=null&&t&&t.key!==e&&b.current?.(e,t)}_(null),E.current=!1,D.current=null,p.current=null,h(null)},[]),oe=(0,c.useCallback)(e=>{let t=e.touches[0];if(t){if(O.current=t.clientX,k.current=t.clientY,!E.current){let e=D.current;e!=null&&Math.abs(t.clientY-e)>10&&T.current!=null&&(clearTimeout(T.current),T.current=null);return}e.cancelable&&e.preventDefault(),V(),ae(t.clientX)}},[ae,V]);function se(n,r){if(!e&&!t||a&&!r.target.closest(`[data-drag-handle]`)||T.current!=null||E.current)return;let o=r.touches[0];o&&(D.current=o.clientY,O.current=o.clientX,k.current=o.clientY,window.addEventListener(`touchmove`,oe,{passive:!1}),window.addEventListener(`touchend`,U),window.addEventListener(`touchcancel`,U),T.current=window.setTimeout(()=>{T.current=null,E.current=!0,p.current=n,h(n),navigator.vibrate?.(10),document.body.style.touchAction=`none`,document.body.style.overscrollBehavior=`none`,W(n),A.current??=requestAnimationFrame(H)},i))}function W(e){let t=d.current;if(!t)return;let n=f.current.indexOf(e),r=t.querySelector(`[data-index="${n}"]`);if(!r)return;let i=r.getBoundingClientRect();N.current=k.current-i.top,P.current=i.left,F.current=i.height;let a=r.cloneNode(!0);a.removeAttribute(`data-index`),a.setAttribute(`data-drag-clone`,`true`),a.setAttribute(`aria-hidden`,`true`),a.classList.add($.virtualListDragClone),Object.assign(a.style,{position:`fixed`,left:`0`,top:`0`,width:`${i.width}px`,height:`${i.height}px`,margin:`0`,opacity:`1`,pointerEvents:`none`,zIndex:`2`,background:`var(--background)`,boxShadow:`var(--card-shadow)`,borderRadius:`var(--default-border-radius)`}),t.appendChild(a),M.current=a,V()}(0,c.useEffect)(()=>U,[U]);let G=e||t;function K(n,r){let i=t&&g?.key===r?g.position:void 0;return{reorderable:G,draggable:G&&!ee||void 0,isDragging:G&&r===m,onMouseDown:G&&a?te:void 0,onDragStart:G?e=>I(r,e):void 0,onDragOver:t?e=>L(n,e):e?e=>B(n,e):void 0,onDragEnd:t?re:e?ie:void 0,onDrop:t?z:void 0,onTouchStart:G?e=>se(r,e):void 0,dropPosition:i,dropIndentPx:i?(l[n]??0)*o:void 0}}function ce(){return j.current?(j.current=!1,!0):!1}return{draggingKey:m,dragEnabled:G,getRowDragProps:K,consumeSuppressedClick:ce}}function Tr({items:e,renderRow:t,columns:n,height:r=`100%`,estimatedRowHeight:i=40,overscan:a=3,rowGap:o=0,rowPadding:s,selectedKey:p,getItemKey:m,onRowClick:h,visibleColumnKeys:g,onVisibleColumnsChange:_,persistColumnsKey:v,showColumnToggle:y,onLoadMore:b,loadMoreThreshold:x=100,isLoading:S=!1,multiSelect:C=!1,selectedKeys:w,onSelectionChange:T,reorderable:E=!1,onReorder:D,longPressDelay:O=400,treeReorder:k=!1,getItemDepth:j,isGroup:M,onTreeDrop:N,treeIndentPx:P=24,dragHandle:F=!1,showDivider:ee=!0,rowHover:te=!0,className:I,style:ne,classNames:L,styles:R,...z},re){let B=(0,c.useCallback)((e,t)=>m?m(e,t):t,[m]),ie=(0,c.useMemo)(()=>e.map((e,t)=>B(e,t)),[e,B]),ae=(0,c.useMemo)(()=>j?e.map((e,t)=>j(e,t)):[],[e,j]),V=(0,c.useCallback)(t=>M?M(e[t],t):!1,[M,e]),H=xr({items:e,keys:ie,getItemKey:m,estimatedRowHeight:i,rowGap:o,overscan:a,onLoadMore:b,loadMoreThreshold:x}),{rootRef:U,headerRef:oe,rowObserver:se,keysRef:W,offsets:G,totalHeight:K,startIndex:le,endIndex:q}=H,ue=Sr({items:e,getKey:B,multiSelect:C,selectedKeys:w,onSelectionChange:T}),{effectiveSelectedKeys:de}=ue,{hasColumns:fe,visibleColumns:pe,columnTemplate:me,shouldShowToggle:he,effectiveVisible:ge,manuallyHiddenCount:_e,toggleOpen:ve,setToggleOpen:J,toggleRef:Y,handleToggleColumn:ye,recalculateColumns:be}=Cr({columns:n,items:e,multiSelect:C,visibleColumnKeys:g,onVisibleColumnsChange:_,persistColumnsKey:v,showColumnToggle:y,rootRef:U,startIndex:le,endIndex:q,containerHeight:H.containerHeight,containerWidth:H.containerWidth});(0,c.useImperativeHandle)(re,()=>({...H.scrollApi,recalculateColumns:be}),[H.scrollApi,be]);let xe=wr({reorderable:E,treeReorder:k,onReorder:D,onTreeDrop:N,longPressDelay:O,dragHandle:F,treeIndentPx:P,keys:ie,depths:ae,isGroupAt:V,rootRef:U,keysRef:W}),Se=typeof s==`number`?`${s}px`:s,Ce=n=>{let r=e[n],i=B(r,n),a=p!=null&&i===p||de.has(i),o=xe.getRowDragProps(n,i);return(0,f.jsx)(lr,{index:n,top:G[n],padding:Se,columnTemplate:me,isSelected:a,showDivider:ee,hover:te,onClick:()=>{xe.consumeSuppressedClick()||h?.(r,n)},observer:se,ariaRowIndex:fe?n+2:void 0,ariaPosInSet:fe?void 0:n+1,ariaSetSize:fe?void 0:e.length,rowRole:fe?`row`:`listitem`,reserveToggleGutter:he,...o,dropIndicatorClassName:L?.dropIndicator,dropIndicatorStyle:R?.dropIndicator,rowClassName:L?.row,rowStyle:R?.row,children:fe?(0,f.jsxs)(f.Fragment,{children:[C&&(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListSelectCell,L?.selectCell),style:R?.selectCell,role:`gridcell`,onClick:e=>e.stopPropagation(),children:(0,f.jsx)(ce,{selected:de.has(i),onToggle:()=>ue.handleRowSelect(i),"aria-label":`Select row`})}),pe.map(e=>(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListCell,L?.cell),style:R?.cell,role:`gridcell`,"data-fit-key":e.width.type===`fit`?e.key:void 0,children:e.renderCell(r,n)},e.key))]}):t?.(r,n)},i)},we=[];for(let e=le;e<=q;e++)we.push(Ce(e));let Te=xe.draggingKey==null?-1:ie.indexOf(xe.draggingKey);return Te>=0&&(Te<le||Te>q)&&we.push(Ce(Te)),(0,f.jsxs)(`div`,{...z,ref:U,className:(0,l.default)($.virtualList,xe.draggingKey!=null&&$.virtualListReordering,I,L?.root),style:{height:r,...ne,...R?.root},onScroll:H.handleScroll,role:fe?`grid`:`list`,"aria-rowcount":fe?e.length+1:void 0,children:[fe&&(0,f.jsxs)(`div`,{ref:oe,className:(0,l.default)($.virtualListHeader,L?.header),style:{gridTemplateColumns:me,...he?{paddingRight:32}:{},...R?.header},role:`row`,"aria-rowindex":1,children:[C&&(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListSelectCell,L?.selectCell),style:R?.selectCell,role:`columnheader`,children:(0,f.jsx)(ce,{selected:ue.allSelected||ue.someSelected,onToggle:ue.handleSelectAll,"aria-label":`Select all rows`})}),pe.map(e=>(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListHeaderCell,L?.headerCell),style:R?.headerCell,role:`columnheader`,"data-fit-key":e.width.type===`fit`?e.key:void 0,children:e.label},e.key)),he&&(0,f.jsxs)(`div`,{ref:Y,className:$.virtualListToggleWrapper,children:[(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)($.virtualListHeaderToggle,L?.headerToggle),style:R?.headerToggle,onClick:()=>J(e=>!e),"aria-label":`Toggle column visibility`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faGear,style:R?.headerToggle})}),_e>0&&(0,f.jsx)(`span`,{className:(0,l.default)($.virtualListColumnChip,L?.columnChip),style:R?.columnChip,"data-column-hidden-count":_e,"aria-label":`${_e} columns hidden`,children:_e}),ve&&(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListTogglePopover,L?.togglePopover),style:R?.togglePopover,children:n.map(e=>(0,f.jsx)(ce,{className:(0,l.default)($.virtualListToggleItem,L?.toggleItem),style:R?.toggleItem,selected:ge.has(e.key),onToggle:()=>ye(e.key),cursorDefault:!1,children:e.label},e.key))})]})]}),S?(0,f.jsx)(`div`,{className:$.virtualListLoadingFull,children:(0,f.jsx)(A,{className:$.virtualListSpinner})}):(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListBody,L?.body),style:{height:K,...R?.body},children:we}),H.showLoadMoreSpinner&&(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListLoadingIndicator,L?.loadingIndicator),style:R?.loadingIndicator,children:(0,f.jsx)(A,{className:$.virtualListSpinner})})]})}var Er=c.default.forwardRef(Tr),Dr={wizard:`wizard_uRBAN`,"wizard-content":`wizard-content_lcl4C`,wizardContent:`wizard-content_lcl4C`,"wizard-content-outOfFrame":`wizard-content-outOfFrame_Eks4Y`,wizardContentOutOfFrame:`wizard-content-outOfFrame_Eks4Y`,"wizard-content-container":`wizard-content-container_yxbCJ`,wizardContentContainer:`wizard-content-container_yxbCJ`};function Or({currentStep:e=0,stepCount:t=0,renderStep:n=()=>null,className:r,style:i,classNames:a,styles:o,...s}){let[u,d]=(0,c.useState)(void 0),[p,m]=(0,c.useState)(!1),[h,g]=(0,c.useState)(e),_=(0,c.useRef)([]),v=(0,c.useRef)(null);e!==h&&(g(e),m(!0)),(0,c.useEffect)(()=>{if(!p)return;let e=setTimeout(()=>m(!1),400);return()=>clearTimeout(e)},[p]),(0,c.useEffect)(()=>{v.current?.disconnect();let t=_.current[e];if(t)return d(t.clientHeight),v.current=new ResizeObserver(()=>{d(t.clientHeight)}),v.current.observe(t),()=>v.current?.disconnect()},[e,t]);let y={...u===void 0?{}:{height:`${u}px`},...o?.root,...i};return(0,f.jsx)(`div`,{...s,className:(0,l.default)(Dr.wizard,a?.root,r),style:y,children:(0,f.jsx)(`div`,{className:(0,l.default)(Dr.wizardContentContainer,a?.container),style:{width:`${t*100}%`,marginLeft:`-${e*100}%`,...o?.container},children:Array.from({length:t},(r,i)=>(0,f.jsx)(`div`,{ref:e=>{_.current[i]=e},className:(0,l.default)(Dr.wizardContent,a?.step),style:{width:`${100/t}%`,marginLeft:`${100/t*i}%`,...o?.step},children:(0,f.jsx)(`div`,{className:(0,l.default)({[Dr.wizardContentOutOfFrame]:e!==i&&!p},a?.stepContent),style:o?.stepContent,inert:e===i?void 0:!0,children:n(i)})},`wizardStep${i}`))})})}function kr(e){let t=e;return t?.errors&&Array.isArray(t.errors)?t.errors.flatMap(e=>Object.entries(e).map(([e,t])=>({id:e,message:t}))):[]}var Ar=class{#e;#t;#n;#r;#i;constructor(e,t=null,{initialValues:n,onSubmit:r=()=>void 0,onValidate:i=()=>void 0,errorParser:a=kr,onSubmitError:o=()=>void 0}={}){this.#t=!1,this.#i=[],this.getFormError=()=>{let e=Object.keys(this.group);for(let t=0;t<e.length;t+=1){let n=e[t];if(this.group[n].errors.length>0)return this.group[n].errors[0]}return null},this.set=(e,t)=>(this.group[e].set(t),this),this.reset=(e={})=>{this.submitCount=0;let t=Object.keys(e);Object.keys(this.group).forEach(n=>{this.group[n].set(t.includes(n)?e[n]:this.#r[n],!1)}),this.resetDirtyAndTouched(),this.onReset&&this.onReset(this,this.#r,this.#e)},this.resetDirtyAndTouched=()=>{Object.keys(this.group).forEach(e=>{this.group[e].dirty=!1,this.group[e].touched=!1})},this.parseError=(e,t=!1)=>{let n=this.errorParser(e);n.length>0?(n.forEach(({id:e,message:t})=>{this.group[e]&&this.group[e].addError({id:e,message:t})}),t&&this.onSubmitError(n)):this.onSubmitError([{id:`generic`,message:`An error occurred`}])},this.#a=()=>{this.component&&this.component.forceUpdate(),this.#i.forEach(e=>e())},this.registerOnUpdateListener=e=>{this.#i.push(e)},this.removeOnUpdateListener=e=>{this.#i.splice(this.#i.indexOf(e),1)},this.setSubmitting=e=>{this.#t!==e&&(this.#t=e,this.#a())},this.submit=async e=>{e&&(e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()),this.setSubmitting(!0);let t=null;this.submitCount===0?t=await Promise.resolve(this.validate()):this.onValidateCallback&&(t=await Promise.resolve(this.onValidateCallback(this)));let n=this.getFormError()||t;if(n){this.setSubmitting(!1),this.submitCount>-1&&this.onSubmitError([n]),this.submitCount+=1,this.#a();return}try{await this.onSubmitCallback(this.getValues(),this),this.resetDirtyAndTouched()}catch(e){this.parseError(e,!0)}this.setSubmitting(!1),this.#a(),this.submitCount+=1},this.getValues=()=>{let e={};return Object.keys(this.group).forEach(t=>{e[t]=this.group[t].value}),{...this.#e,...e}},this.validate=()=>{if(Object.keys(this.group).forEach(e=>{this.group[e].validate(),this.group[e].touched=!0}),this.onValidateCallback)return this.onValidateCallback(this)},this.setValidator=(e,t)=>(this.group[e]=t,this),this.group=e,this.#e=n??{},this.#r={},this.submitCount=0,this.onDebounce=()=>{},this.onReset=()=>{},Object.keys(this.group).forEach(e=>{let t=this.group[e],n=this.#e;n[e]!==void 0&&t.set(n[e],!1),this.#r[e]=t.value,this.group[e].registerOnUpdateListener(()=>{this.#a(),this.submitCount=0,this.#n&&clearTimeout(this.#n),this.#n=setTimeout(()=>this.onDebounce(this.getValues()),500)})}),this.component=t,this.onSubmitCallback=r,this.onValidateCallback=i,this.errorParser=a,this.onSubmitError=o,this.setSubmitting(!1)}get isSubmitting(){return this.#t}get wasTouched(){return Object.keys(this.group).some(e=>this.group[e].touched)}get isDirty(){return Object.keys(this.group).some(e=>this.group[e].dirty)}get hasErrors(){return Object.keys(this.group).some(e=>this.group[e].errors.length>0)}get initialValues(){return{...this.#e}}#a};function jr(e){return function({children:t,...n}){return(0,f.jsx)(`form`,{onSubmit:e.submit,noValidate:!0,...n,children:t})}}var Mr=e=>{ir(e[0].message,{type:`error`})},Nr=class extends Ar{constructor(e,t=null,n){super(e,t,{...n,onSubmitError:n?.onSubmitError??Mr}),this.Form=jr(this)}},Pr=class{#e;#t;#n;#r;#i;constructor(e,t){this.addError=e=>{this.#r.push(e),this.onUpdate()},this.removeErrors=e=>{this.#r=this.#r.filter(t=>!e.includes(t.id)),this.onUpdate()},this.clearErrors=()=>{this.#r=[],this.onUpdate()},this.hasError=e=>!e&&this.errors.length>0?!0:!!this.errors.find(t=>t.id===e),this.getCurrentErrorMessage=()=>this.errors.length===0?null:this.errors[0].message,this.validate=()=>{this.clearErrors(),this.validators.forEach(e=>{let t=e(this.value,this.label);t&&this.addError(t)})},this.onUpdate=()=>{this.onUpdateCallbacks.forEach(e=>e(this))},this.registerOnUpdateListener=e=>{this.onUpdateCallbacks.push(e)},this.removeOnUpdateListener=e=>{this.onUpdateCallbacks.splice(this.onUpdateCallbacks.indexOf(e),1)},this.set=(e,t=!0)=>(this.value=e,t&&!this.dirty&&(this.dirty=!0),this.validate(),this),this.#e=e,this.validators=t??[],this.#t=!1,this.#n=!1,this.#r=[],this.#i=``,this.onUpdateCallbacks=[],this.validate()}get touched(){return this.#t}set touched(e){this.#t=e,this.onUpdate()}get label(){return this.#i}set label(e){this.#i=e}get dirty(){return this.#n}set dirty(e){this.#n=e,this.onUpdate()}get value(){return this.#e}set value(e){this.#e=e,this.onUpdate()}get errors(){return this.#r}};Pr.prototype.toString=function(){return`${this.value}`};function Fr(e){return/^[0-9]+$/.test(e)}function Ir(e){return/^[0-9]{2}.[0-9]{2}.[0-9]{4}$/.test(e)}function Lr(e){return/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z$/.test(e)}function Rr(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-ZöäüÜÖÄß\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function zr(e){return/^[A-Z]{6}[A-Z\d]{2}([A-Z\d]{3})?$/.test(e)}function Br(e){return/[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}(\/[-a-zA-Z0-9@:%_+.~#?&//=]*)?$/.test(e)}function Vr(e){return/^[\w!@#$%^&*?±§~`'"/\\[\]{}\-,.();:><+=|öäüÖÄÜß €μ]{8,}$/.test(e)}function Hr(e){return/^(?=.*[a-zöäüA-ZÖÄÜß])/.test(e)}function Ur(e){return/^(?=.*\d)/.test(e)}function Wr(e){return Vr(e)&&Hr(e)&&Ur(e)}var Gr={t:(e,t)=>({"formValidators.minLength":`Must be at least ${t?.min} characters long`,"formValidators.maxLength":`Must be at most ${t?.max} characters long`,"formValidators.email":`Must be a valid email address`,"formValidators.required":`${t?.label||`Value`} is required`,"formValidators.value":`Value`,"formValidators.mustBeNumber":`Must be a number`,"formValidators.oneOf":`Must be one of the following values: ${t?.allowedValues}`,"formValidators.typeOf":`Must have type of ${t?.allowedTypes}`,"formValidators.multiEmail":`Must be a comma or semicolon separated list of valid email addresses`,"formValidators.date":`Must be a valid date`,"garages.errors.website":`Must be a valid URL`,"garages.errors.bic":`Must be a valid BIC`,"formValidators.minLetters":`Must contain at least ${t?.smart_count} letters`,"formValidators.minDigits":`Must contain at least ${t?.smart_count} digits`})[e]||e},Kr=class e{static{this.minLength=(e,t)=>n=>!n||n.length<e?{id:`minLength`,message:t||Gr.t(`formValidators.minLength`,{min:e})}:null}static{this.maxLength=(e,t)=>n=>n&&n.length>e?{id:`maxLength`,message:t||Gr.t(`formValidators.maxLength`,{max:e})}:null}static{this.email=e=>t=>t&&!Rr(t)?{id:`email`,message:e||Gr.t(`formValidators.email`)}:null}static{this.required=e=>{function t(t,n){return!t&&t!==0?{id:`required`,message:e||Gr.t(`formValidators.required`,{label:n||Gr.t(`formValidators.value`)})}:null}return t.validatorId=`required`,t}}static{this.mustBeNumber=e=>t=>t&&Number.isNaN(+t)?{id:`mustBeNumber`,message:e||Gr.t(`formValidators.mustBeNumber`)}:null}static{this.oneOf=(e,t)=>n=>n&&!e.includes(n)?{id:`oneOf`,message:t||Gr.t(`formValidators.oneOf`,{allowedValues:e})}:null}static{this.typeOf=(e,t)=>n=>{if(Array.isArray(e)){for(let t=0;t<e.length;t+=1)if(typeof n===e[t])return null}else if(typeof n===e)return null;return{id:`typeOf`,message:t||`Must have type of ${e}`}}}static{this.multiEmail=e=>t=>{if(t){let n=t.replace(/ /g,``).replace(/,/g,`;`).split(`;`);for(let t=0;t<n.length;t+=1)if(!Rr(n[t]))return{id:`multiEmail`,message:e||Gr.t(`formValidators.multiEmail`)}}return null}}static{this.date=e=>t=>t&&!Ir(t)&&!Lr(t)?{id:`date`,message:e||Gr.t(`formValidators.date`)}:null}static{this.dateObject=e=>t=>t&&!t.isValid?{id:`date`,message:e||Gr.t(`formValidators.date`)}:null}static{this.website=e=>t=>t&&!Br(t)?{id:`website`,message:e||Gr.t(`garages.errors.website`)}:null}static{this.bic=e=>t=>t&&!zr(t)?{id:`bic`,message:e||Gr.t(`garages.errors.bic`)}:null}static{this.minLetters=(e,t)=>n=>n&&n.replace(/[^a-zöäüA-ZÖÄÜß]/g,``).length<e?{id:`minLetters`,message:t||Gr.t(`formValidators.minLetters`,{smart_count:e})}:null}static{this.minDigits=(e,t)=>n=>n&&n.replace(/[\D]/g,``).length<e?{id:`minDigits`,message:t||Gr.t(`formValidators.minDigits`,{smart_count:e})}:null}static{this.password=t=>n=>{let r=e.minLength(8)(n)||e.minLetters(1)(n)||e.minDigits(1)(n);return r?t?{id:`password`,message:t}:r:null}}},qr=class extends c.PureComponent{static{this.defaultProps={formValidator:null,onMouseEnter:null,onMouseLeave:null,onFocus:null,onBlur:null,onChange:null,errorMessage:``,isValid:!1,isRequired:!1,label:``}}constructor(e){super(e);let{formValidator:t}=e;t&&(t.label=e.label??``,t.validate(),t.registerOnUpdateListener(()=>{this.forceUpdate()})),this.state={isFocused:!1,isHovered:!1},this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),this.hasError=this.hasError.bind(this),this.renderTooltip=this.renderTooltip.bind(this),this.onChange=this.onChange.bind(this)}componentDidMount(){setTimeout(()=>this.setState({isFocused:!1,isHovered:!1}),1)}componentDidUpdate(e){let{formValidator:t}=this.props;e.formValidator&&t&&e.formValidator!==t&&t.registerOnUpdateListener(()=>{this.forceUpdate()})}onMouseEnter(e){let{onMouseEnter:t}=this.props;this.setState({isHovered:!0}),t&&t(e)}onMouseLeave(e){let{onMouseLeave:t}=this.props;this.setState({isHovered:!1}),t&&t(e)}onFocus(e){let{onFocus:t}=this.props;this.setState({isFocused:!0}),t&&t(e)}onBlur(e){let{formValidator:t,onBlur:n}=this.props;t&&(t.touched=!0),this.setState({isFocused:!1}),n&&n(e)}hasError(){let{errorMessage:e,isValid:t,formValidator:n}=this.props;return n?n.touched&&n.hasError():!t||!!e}isRequired(){let{isRequired:e,formValidator:t}=this.props;return!!(e||t&&t.validators.find(e=>e.validatorId===`required`))}renderTooltip(){let{errorMessage:e,formValidator:t}=this.props,{isHovered:n,isFocused:r}=this.state;return(0,f.jsx)(ve,{variant:`error`,message:t?t.getCurrentErrorMessage():e||``,isVisible:this.hasError()&&(r||n)})}onChange(e){let{onChange:t,formValidator:n}=this.props;if(n){let t=e;e&&e.target&&(t=e.target.value),n.set(t)}t&&t(e)}};function Jr(e){let[,t]=(0,c.useReducer)(e=>e+1,0);return(0,c.useEffect)(()=>{if(e)return e.registerOnUpdateListener(t),()=>e.removeOnUpdateListener(t)},[e]),e}function Yr(e,{initialValues:t,onSubmit:n,onValidate:r,errorParser:i,onSubmitError:a}={}){let[,o]=(0,c.useReducer)(e=>e+1,0),s=(0,c.useRef)(null);s.current||=new Nr(e,null,{initialValues:t,errorParser:i,onSubmitError:a});let l=s.current,u=(0,c.useRef)(n),d=(0,c.useRef)(r);return u.current=n,d.current=r,(0,c.useEffect)(()=>(n!==void 0&&(l.onSubmitCallback=(...e)=>u.current?.(...e)),r!==void 0&&(l.onValidateCallback=(...e)=>d.current?.(...e)),l.registerOnUpdateListener(o),()=>l.removeOnUpdateListener(o)),[]),l}exports.Accordion=T,exports.AccordionStyleType=b,exports.ActionButtons=ne,exports.ActionIcon=B,exports.Align=me,exports.BodyEnd=ie,exports.Button=I,exports.ButtonSize=M,exports.ButtonStyleType=j,exports.ButtonType=N,exports.Card=U,exports.CardActions=G,exports.CardContent=W,exports.CardHeader=oe,exports.CardMedia=se,exports.CardStyleType=ae,exports.Checkbox=ce,exports.Chip=de,exports.ChipContainer=fe,exports.ChipStyleType=le,exports.ColorPicker=Ae,exports.ConfirmModal=Ne,exports.DatePicker=st,exports.Drawer=lt,exports.DropZone=gt,exports.DropZoneReturnType=ut,exports.DropZoneStatus=Z,exports.Dropdown=at,exports.EmptyState=vt,exports.Fab=Ct,exports.FloatingMenu=ge,exports.FormValidator=Pr,exports.FormValidatorGroup=Nr,exports.IconLoading=Bt,exports.IconPicker=Dt,exports.IdleManager=kt,exports.InfiniteBlock=it,exports.Input=ye,exports.InputDropdown=Nt,exports.InputType=Y,exports.InteractableDiv=z,exports.KanbanBoard=Lt,exports.KanbanColumn=It,exports.Modal=Me,exports.NumberInput=Ut,exports.OptionPicker=Gt,exports.Overscroll=Yt,exports.ProgressBar=Qt,exports.Ripple=F,exports.RoomDrawer=En,exports.RoomViewer=On,exports.ScrollbarProvider=jn,exports.SearchInput=Nn,exports.SpinnerLoading=A,exports.Stepper=In,exports.TabHeader=Rn,exports.TenorPicker=Kn,exports.Textarea=qn,exports.ThemeProvider=Xn,exports.ToastProvider=cr,exports.Tooltip=ve,exports.ValidatableComponent=qr,exports.Validators=Kr,exports.VirtualList=Er,exports.Wizard=Or,exports.defaultTheme=Jn,exports.getLocale=Ve,exports.hasEightPasswordChars=Vr,exports.hasOnePasswordDigit=Ur,exports.hasOnePasswordLetter=Hr,exports.isBic=zr,exports.isDate=Ir,exports.isEmail=Rr,exports.isISODate=Lr,exports.isNumber=Fr,exports.isPassword=Wr,exports.isURL=Br,exports.mapLocale=Re,exports.setLocale=Be,exports.showToast=ir,exports.useFormValidator=Jr,exports.useFormValidatorGroup=Yr,exports.useTheme=Zn;
6
6
  //# sourceMappingURL=index.cjs.map