@ahrowe/ui 0.4.1 → 0.4.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"floatingMenu.module.mjs","names":[],"sources":["../../../../package/common/floatingMenu/floatingMenu.module.pcss"],"sourcesContent":[".floatingMenu {\n position: relative;\n\n &-content {\n cursor: pointer;\n }\n\n &-container {\n color: var(--text-color);\n box-shadow: var(--card-shadow);\n position: absolute;\n margin-top: 10px;\n background: var(--background-modal);\n padding: 8px;\n border-radius: calc(var(--default-border-radius) + 4px);\n\n .floatingMenu-anim-flip & {\n top: auto;\n bottom: 0;\n margin-top: 0;\n margin-bottom: 10px;\n }\n\n &-align {\n &-left {\n left: 0px;\n }\n\n &-right {\n right: 0px;\n }\n\n &-center {\n left: 50%;\n transform: translateX(-50%);\n }\n }\n\n &-flag {\n box-shadow: var(--card-shadow);\n background: var(--background-modal);\n height: 10px;\n width: 10px;\n position: absolute;\n margin-top: 5px;\n transform: rotate(45deg);\n\n .floatingMenu-anim-flip & {\n top: auto;\n bottom: 0;\n margin-top: 0;\n margin-bottom: 5px;\n }\n\n &-align-right {\n right: 8px;\n }\n\n &-align-left {\n left: 8px;\n }\n\n &-align-center {\n left: 50%;\n transform: translateX(-50%) rotate(45deg);\n }\n }\n }\n\n &-anim {\n transform: scale(0.7);\n opacity: 0.7;\n animation: showMenu 0.1s forwards;\n position: fixed;\n z-index: 1;\n }\n\n @keyframes showMenu {\n to {\n transform: scale(1);\n opacity: 1;\n }\n }\n}\n"],"mappings":""}
1
+ {"version":3,"file":"floatingMenu.module.mjs","names":[],"sources":["../../../../package/common/floatingMenu/floatingMenu.module.pcss"],"sourcesContent":[".floatingMenu {\n position: relative;\n\n &-content {\n cursor: pointer;\n }\n\n &-container {\n color: var(--text-color);\n font-family: var(--default-font);\n font-size: var(--default-font-size);\n box-shadow: var(--card-shadow);\n position: absolute;\n margin-top: 10px;\n background: var(--background-modal);\n padding: 8px;\n border-radius: calc(var(--default-border-radius) + 4px);\n\n .floatingMenu-anim-flip & {\n top: auto;\n bottom: 0;\n margin-top: 0;\n margin-bottom: 10px;\n }\n\n &-align {\n &-left {\n left: 0px;\n }\n\n &-right {\n right: 0px;\n }\n\n &-center {\n left: 50%;\n transform: translateX(-50%);\n }\n }\n\n &-flag {\n box-shadow: var(--card-shadow);\n background: var(--background-modal);\n height: 10px;\n width: 10px;\n position: absolute;\n margin-top: 5px;\n transform: rotate(45deg);\n\n .floatingMenu-anim-flip & {\n top: auto;\n bottom: 0;\n margin-top: 0;\n margin-bottom: 5px;\n }\n\n &-align-right {\n right: 8px;\n }\n\n &-align-left {\n left: 8px;\n }\n\n &-align-center {\n left: 50%;\n transform: translateX(-50%) rotate(45deg);\n }\n }\n }\n\n &-anim {\n transform: scale(0.7);\n opacity: 0.7;\n animation: showMenu 0.1s forwards;\n position: fixed;\n z-index: 1;\n }\n\n @keyframes showMenu {\n to {\n transform: scale(1);\n opacity: 1;\n }\n }\n}\n"],"mappings":""}
@@ -1,2 +1,2 @@
1
- var e={colorFade:`colorFade_eLv2g`};export{e as default};
1
+ var e={themeRoot:`themeRoot_oegLp`,colorFade:`colorFade_eLv2g`};export{e as default};
2
2
  //# sourceMappingURL=theme.module.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme.module.mjs","names":[],"sources":["../../../../package/common/themeProvider/theme.module.pcss"],"sourcesContent":[".colorFade * {\n transition: background 0.3s ease-in-out;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"theme.module.mjs","names":[],"sources":["../../../../package/common/themeProvider/theme.module.pcss"],"sourcesContent":[".themeRoot {\n font-family: var(--default-font);\n font-size: var(--default-font-size);\n font-weight: var(--default-font-weight);\n color: var(--text-color);\n}\n\n.colorFade * {\n transition: background 0.3s ease-in-out;\n}\n"],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{defaultTheme as e}from"./defaultTheme.mjs";import t from"./theme.module.mjs";import n,{Component as r}from"react";import{jsx as i}from"react/jsx-runtime";var a=class extends r{constructor(...t){super(...t),this.state={resolvedVariables:{},colorFadeActive:!1,currentThemeColor:null},this.colorFadeTimeout=null,this.wrapperRef=n.createRef(),this.themeColorMeta=null,this.createdThemeColorMeta=!1,this.applyTheme=t=>{let n=this.props.themes??[e],r=n.find(e=>!e.baseThemeId)??n[0],i=r?r.variables:{},a=n.find(e=>e.id===t),o=a?this.resolveChain(a.id):[],s=Object.assign({},i,...o);this.setState({resolvedVariables:s,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(t){let n=(this.props.themes??[e]).find(e=>e.id===t);return n?[...n.baseThemeId?this.resolveChain(n.baseThemeId):[],n.variables]:[]}render(){let{children:e}=this.props,{resolvedVariables:n,colorFadeActive:r}=this.state;return i(`div`,{ref:this.wrapperRef,id:`themeProvider`,className:r?t.colorFade:void 0,style:n,children:e})}};export{a as default};
1
+ import{defaultTheme as e}from"./defaultTheme.mjs";import t from"./theme.module.mjs";import n,{Component as r}from"react";import i from"classnames";import{jsx as a}from"react/jsx-runtime";var o=class extends r{constructor(...t){super(...t),this.state={resolvedVariables:{},colorFadeActive:!1,currentThemeColor:null},this.colorFadeTimeout=null,this.wrapperRef=n.createRef(),this.themeColorMeta=null,this.createdThemeColorMeta=!1,this.applyTheme=t=>{let n=this.props.themes??[e],r=n.find(e=>!e.baseThemeId)??n[0],i=r?r.variables:{},a=n.find(e=>e.id===t),o=a?this.resolveChain(a.id):[],s=Object.assign({},i,...o);this.setState({resolvedVariables:s,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(t){let n=(this.props.themes??[e]).find(e=>e.id===t);return n?[...n.baseThemeId?this.resolveChain(n.baseThemeId):[],n.variables]:[]}render(){let{children:e}=this.props,{resolvedVariables:n,colorFadeActive:r}=this.state;return a(`div`,{ref:this.wrapperRef,id:`themeProvider`,className:i(t.themeRoot,r&&t.colorFade),style:n,children:e})}};export{o as default};
2
2
  //# sourceMappingURL=themeProvider.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"themeProvider.mjs","names":[],"sources":["../../../../package/common/themeProvider/themeProvider.tsx"],"sourcesContent":["import React, { Component } from 'react';\n\nimport type { Theme } from './theme.types';\nimport { defaultTheme } from './defaultTheme';\nimport styles from './theme.module.pcss';\n\ninterface Props {\n children: React.ReactNode;\n themes?: Theme[];\n currentThemeId?: string;\n}\n\ninterface State {\n resolvedVariables: Record<string, string>;\n colorFadeActive: boolean;\n currentThemeColor: string | null;\n}\n\nclass ThemeProvider extends Component<Props, State> {\n state: State = {\n resolvedVariables: {},\n colorFadeActive: false,\n currentThemeColor: null,\n };\n\n private colorFadeTimeout: ReturnType<typeof setTimeout> | null = null;\n private wrapperRef = React.createRef<HTMLDivElement>();\n private themeColorMeta: HTMLMetaElement | null = null;\n private createdThemeColorMeta = false;\n\n componentDidMount() {\n this.applyTheme(this.props.currentThemeId);\n this.syncThemeColorMeta(this.state.currentThemeColor ?? '');\n }\n\n componentDidUpdate(prevProps: Props, prevState: State) {\n if (prevState.currentThemeColor !== this.state.currentThemeColor) {\n this.syncThemeColorMeta(this.state.currentThemeColor ?? '');\n }\n if (\n prevProps.currentThemeId !== this.props.currentThemeId ||\n prevProps.themes !== this.props.themes\n ) {\n this.applyTheme(this.props.currentThemeId);\n }\n }\n\n componentWillUnmount() {\n if (this.colorFadeTimeout) clearTimeout(this.colorFadeTimeout);\n // Only remove the meta tag if we created it; leave a host-app tag intact.\n if (this.createdThemeColorMeta) this.themeColorMeta?.remove();\n }\n\n /**\n * Replaces the former react-helmet usage: keep a single\n * <meta name=\"theme-color\"> in sync with the active theme's primary colour.\n * Reuses a tag the host app already declares; otherwise creates its own\n * (and removes it again on unmount).\n */\n private syncThemeColorMeta(color: string) {\n if (typeof document === 'undefined') return;\n\n if (!this.themeColorMeta) {\n const existing = document.head.querySelector<HTMLMetaElement>(\n 'meta[name=\"theme-color\"]',\n );\n if (existing) {\n this.themeColorMeta = existing;\n } else {\n const meta = document.createElement('meta');\n meta.setAttribute('name', 'theme-color');\n document.head.appendChild(meta);\n this.themeColorMeta = meta;\n this.createdThemeColorMeta = true;\n }\n }\n\n this.themeColorMeta.setAttribute('content', color);\n }\n\n /**\n * Resolves the full variable set for a given theme ID by walking up the\n * baseThemeId chain. Returns variables ordered from deepest ancestor to\n * the requested theme so callers can merge in order (later entries win).\n */\n private resolveChain(id: string): Record<string, string>[] {\n const themes = this.props.themes ?? [defaultTheme];\n const theme = themes.find((t) => t.id === id);\n if (!theme) return [];\n\n const parentVars = theme.baseThemeId ? this.resolveChain(theme.baseThemeId) : [];\n\n return [...parentVars, theme.variables as Record<string, string>];\n }\n\n private applyTheme = (currentThemeId: string | undefined) => {\n const themes = this.props.themes ?? [defaultTheme];\n\n // The root theme is the first theme without a baseThemeId.\n // It is always applied as the variable foundation.\n const rootTheme = themes.find((t) => !t.baseThemeId) ?? themes[0];\n const rootVars: Record<string, string> = rootTheme\n ? (rootTheme.variables as Record<string, string>)\n : {};\n\n // Resolve the selected theme's full inheritance chain.\n const selectedTheme = themes.find((t) => t.id === currentThemeId);\n const chainVars = selectedTheme ? this.resolveChain(selectedTheme.id) : [];\n\n // Merge: root foundation → ancestor chain → selected theme (each step overrides)\n const resolvedVariables = Object.assign({}, rootVars, ...chainVars);\n\n this.setState({ resolvedVariables, colorFadeActive: true });\n\n if (this.colorFadeTimeout) clearTimeout(this.colorFadeTimeout);\n this.colorFadeTimeout = setTimeout(() => {\n this.setState({ colorFadeActive: false });\n this.colorFadeTimeout = null;\n }, 500);\n\n // Read --primary-color after the new style is painted for the theme-color meta tag.\n setTimeout(() => {\n if (this.wrapperRef.current) {\n this.setState({\n currentThemeColor: getComputedStyle(this.wrapperRef.current)\n .getPropertyValue('--primary-color')\n .trim(),\n });\n }\n }, 1);\n };\n\n render() {\n const { children } = this.props;\n const { resolvedVariables, colorFadeActive } = this.state;\n\n return (\n <div\n ref={this.wrapperRef}\n id=\"themeProvider\"\n className={colorFadeActive ? styles.colorFade : undefined}\n style={resolvedVariables as React.CSSProperties}\n >\n {children}\n </div>\n );\n }\n}\n\nexport default ThemeProvider;\n"],"mappings":"iKAkBA,IAAM,EAAN,cAA4B,CAAwB,0CACnC,CACb,kBAAmB,CAAC,EACpB,gBAAiB,GACjB,kBAAmB,IACrB,wBAEiE,qBAC5C,EAAM,UAA0B,sBACJ,gCACjB,mBAmEV,GAAuC,CAC3D,IAAM,EAAS,KAAK,MAAM,QAAU,CAAC,CAAY,EAI3C,EAAY,EAAO,KAAM,GAAM,CAAC,EAAE,WAAW,GAAK,EAAO,GACzD,EAAmC,EACpC,EAAU,UACX,CAAC,EAGC,EAAgB,EAAO,KAAM,GAAM,EAAE,KAAO,CAAc,EAC1D,EAAY,EAAgB,KAAK,aAAa,EAAc,EAAE,EAAI,CAAC,EAGnE,EAAoB,OAAO,OAAO,CAAC,EAAG,EAAU,GAAG,CAAS,EAElE,KAAK,SAAS,CAAE,oBAAmB,gBAAiB,EAAK,CAAC,EAEtD,KAAK,kBAAkB,aAAa,KAAK,gBAAgB,EAC7D,KAAK,iBAAmB,eAAiB,CACvC,KAAK,SAAS,CAAE,gBAAiB,EAAM,CAAC,EACxC,KAAK,iBAAmB,IAC1B,EAAG,GAAG,EAGN,eAAiB,CACX,KAAK,WAAW,SAClB,KAAK,SAAS,CACZ,kBAAmB,iBAAiB,KAAK,WAAW,OAAO,EACxD,iBAAiB,iBAAiB,EAClC,KAAK,CACV,CAAC,CAEL,EAAG,CAAC,CACN,EApGA,mBAAoB,CAClB,KAAK,WAAW,KAAK,MAAM,cAAc,EACzC,KAAK,mBAAmB,KAAK,MAAM,mBAAqB,EAAE,CAC5D,CAEA,mBAAmB,EAAkB,EAAkB,CACjD,EAAU,oBAAsB,KAAK,MAAM,mBAC7C,KAAK,mBAAmB,KAAK,MAAM,mBAAqB,EAAE,GAG1D,EAAU,iBAAmB,KAAK,MAAM,gBACxC,EAAU,SAAW,KAAK,MAAM,SAEhC,KAAK,WAAW,KAAK,MAAM,cAAc,CAE7C,CAEA,sBAAuB,CACjB,KAAK,kBAAkB,aAAa,KAAK,gBAAgB,EAEzD,KAAK,uBAAuB,KAAK,gBAAgB,OAAO,CAC9D,CAQA,mBAA2B,EAAe,CACpC,YAAO,SAAa,KAExB,IAAI,CAAC,KAAK,eAAgB,CACxB,IAAM,EAAW,SAAS,KAAK,cAC7B,0BACF,EACA,GAAI,EACF,KAAK,eAAiB,MACjB,CACL,IAAM,EAAO,SAAS,cAAc,MAAM,EAC1C,EAAK,aAAa,OAAQ,aAAa,EACvC,SAAS,KAAK,YAAY,CAAI,EAC9B,KAAK,eAAiB,EACtB,KAAK,sBAAwB,EAC/B,CACF,CAEA,KAAK,eAAe,aAAa,UAAW,CAAK,CAFjD,CAGF,CAOA,aAAqB,EAAsC,CAEzD,IAAM,GADS,KAAK,MAAM,QAAU,CAAC,CAAY,GAC5B,KAAM,GAAM,EAAE,KAAO,CAAE,EAK5C,OAJK,EAIE,CAAC,GAFW,EAAM,YAAc,KAAK,aAAa,EAAM,WAAW,EAAI,CAAC,EAExD,EAAM,SAAmC,EAJ7C,CAAC,CAKtB,CAuCA,QAAS,CACP,GAAM,CAAE,YAAa,KAAK,MACpB,CAAE,oBAAmB,mBAAoB,KAAK,MAEpD,OACE,EAAC,MAAD,CACE,IAAK,KAAK,WACV,GAAG,gBACH,UAAW,EAAkB,EAAO,UAAY,IAAA,GAChD,MAAO,EAEN,UACE,CAAA,CAET,CACF"}
1
+ {"version":3,"file":"themeProvider.mjs","names":[],"sources":["../../../../package/common/themeProvider/themeProvider.tsx"],"sourcesContent":["import React, { Component } from 'react';\nimport cx from 'classnames';\n\nimport type { Theme } from './theme.types';\nimport { defaultTheme } from './defaultTheme';\nimport styles from './theme.module.pcss';\n\ninterface Props {\n children: React.ReactNode;\n themes?: Theme[];\n currentThemeId?: string;\n}\n\ninterface State {\n resolvedVariables: Record<string, string>;\n colorFadeActive: boolean;\n currentThemeColor: string | null;\n}\n\nclass ThemeProvider extends Component<Props, State> {\n state: State = {\n resolvedVariables: {},\n colorFadeActive: false,\n currentThemeColor: null,\n };\n\n private colorFadeTimeout: ReturnType<typeof setTimeout> | null = null;\n private wrapperRef = React.createRef<HTMLDivElement>();\n private themeColorMeta: HTMLMetaElement | null = null;\n private createdThemeColorMeta = false;\n\n componentDidMount() {\n this.applyTheme(this.props.currentThemeId);\n this.syncThemeColorMeta(this.state.currentThemeColor ?? '');\n }\n\n componentDidUpdate(prevProps: Props, prevState: State) {\n if (prevState.currentThemeColor !== this.state.currentThemeColor) {\n this.syncThemeColorMeta(this.state.currentThemeColor ?? '');\n }\n if (\n prevProps.currentThemeId !== this.props.currentThemeId ||\n prevProps.themes !== this.props.themes\n ) {\n this.applyTheme(this.props.currentThemeId);\n }\n }\n\n componentWillUnmount() {\n if (this.colorFadeTimeout) clearTimeout(this.colorFadeTimeout);\n // Only remove the meta tag if we created it; leave a host-app tag intact.\n if (this.createdThemeColorMeta) this.themeColorMeta?.remove();\n }\n\n /**\n * Replaces the former react-helmet usage: keep a single\n * <meta name=\"theme-color\"> in sync with the active theme's primary colour.\n * Reuses a tag the host app already declares; otherwise creates its own\n * (and removes it again on unmount).\n */\n private syncThemeColorMeta(color: string) {\n if (typeof document === 'undefined') return;\n\n if (!this.themeColorMeta) {\n const existing = document.head.querySelector<HTMLMetaElement>(\n 'meta[name=\"theme-color\"]',\n );\n if (existing) {\n this.themeColorMeta = existing;\n } else {\n const meta = document.createElement('meta');\n meta.setAttribute('name', 'theme-color');\n document.head.appendChild(meta);\n this.themeColorMeta = meta;\n this.createdThemeColorMeta = true;\n }\n }\n\n this.themeColorMeta.setAttribute('content', color);\n }\n\n /**\n * Resolves the full variable set for a given theme ID by walking up the\n * baseThemeId chain. Returns variables ordered from deepest ancestor to\n * the requested theme so callers can merge in order (later entries win).\n */\n private resolveChain(id: string): Record<string, string>[] {\n const themes = this.props.themes ?? [defaultTheme];\n const theme = themes.find((t) => t.id === id);\n if (!theme) return [];\n\n const parentVars = theme.baseThemeId ? this.resolveChain(theme.baseThemeId) : [];\n\n return [...parentVars, theme.variables as Record<string, string>];\n }\n\n private applyTheme = (currentThemeId: string | undefined) => {\n const themes = this.props.themes ?? [defaultTheme];\n\n // The root theme is the first theme without a baseThemeId.\n // It is always applied as the variable foundation.\n const rootTheme = themes.find((t) => !t.baseThemeId) ?? themes[0];\n const rootVars: Record<string, string> = rootTheme\n ? (rootTheme.variables as Record<string, string>)\n : {};\n\n // Resolve the selected theme's full inheritance chain.\n const selectedTheme = themes.find((t) => t.id === currentThemeId);\n const chainVars = selectedTheme ? this.resolveChain(selectedTheme.id) : [];\n\n // Merge: root foundation → ancestor chain → selected theme (each step overrides)\n const resolvedVariables = Object.assign({}, rootVars, ...chainVars);\n\n this.setState({ resolvedVariables, colorFadeActive: true });\n\n if (this.colorFadeTimeout) clearTimeout(this.colorFadeTimeout);\n this.colorFadeTimeout = setTimeout(() => {\n this.setState({ colorFadeActive: false });\n this.colorFadeTimeout = null;\n }, 500);\n\n // Read --primary-color after the new style is painted for the theme-color meta tag.\n setTimeout(() => {\n if (this.wrapperRef.current) {\n this.setState({\n currentThemeColor: getComputedStyle(this.wrapperRef.current)\n .getPropertyValue('--primary-color')\n .trim(),\n });\n }\n }, 1);\n };\n\n render() {\n const { children } = this.props;\n const { resolvedVariables, colorFadeActive } = this.state;\n\n return (\n <div\n ref={this.wrapperRef}\n id=\"themeProvider\"\n className={cx(styles.themeRoot, colorFadeActive && styles.colorFade)}\n style={resolvedVariables as React.CSSProperties}\n >\n {children}\n </div>\n );\n }\n}\n\nexport default ThemeProvider;\n"],"mappings":"2LAmBA,IAAM,EAAN,cAA4B,CAAwB,0CACnC,CACb,kBAAmB,CAAC,EACpB,gBAAiB,GACjB,kBAAmB,IACrB,wBAEiE,qBAC5C,EAAM,UAA0B,sBACJ,gCACjB,mBAmEV,GAAuC,CAC3D,IAAM,EAAS,KAAK,MAAM,QAAU,CAAC,CAAY,EAI3C,EAAY,EAAO,KAAM,GAAM,CAAC,EAAE,WAAW,GAAK,EAAO,GACzD,EAAmC,EACpC,EAAU,UACX,CAAC,EAGC,EAAgB,EAAO,KAAM,GAAM,EAAE,KAAO,CAAc,EAC1D,EAAY,EAAgB,KAAK,aAAa,EAAc,EAAE,EAAI,CAAC,EAGnE,EAAoB,OAAO,OAAO,CAAC,EAAG,EAAU,GAAG,CAAS,EAElE,KAAK,SAAS,CAAE,oBAAmB,gBAAiB,EAAK,CAAC,EAEtD,KAAK,kBAAkB,aAAa,KAAK,gBAAgB,EAC7D,KAAK,iBAAmB,eAAiB,CACvC,KAAK,SAAS,CAAE,gBAAiB,EAAM,CAAC,EACxC,KAAK,iBAAmB,IAC1B,EAAG,GAAG,EAGN,eAAiB,CACX,KAAK,WAAW,SAClB,KAAK,SAAS,CACZ,kBAAmB,iBAAiB,KAAK,WAAW,OAAO,EACxD,iBAAiB,iBAAiB,EAClC,KAAK,CACV,CAAC,CAEL,EAAG,CAAC,CACN,EApGA,mBAAoB,CAClB,KAAK,WAAW,KAAK,MAAM,cAAc,EACzC,KAAK,mBAAmB,KAAK,MAAM,mBAAqB,EAAE,CAC5D,CAEA,mBAAmB,EAAkB,EAAkB,CACjD,EAAU,oBAAsB,KAAK,MAAM,mBAC7C,KAAK,mBAAmB,KAAK,MAAM,mBAAqB,EAAE,GAG1D,EAAU,iBAAmB,KAAK,MAAM,gBACxC,EAAU,SAAW,KAAK,MAAM,SAEhC,KAAK,WAAW,KAAK,MAAM,cAAc,CAE7C,CAEA,sBAAuB,CACjB,KAAK,kBAAkB,aAAa,KAAK,gBAAgB,EAEzD,KAAK,uBAAuB,KAAK,gBAAgB,OAAO,CAC9D,CAQA,mBAA2B,EAAe,CACpC,YAAO,SAAa,KAExB,IAAI,CAAC,KAAK,eAAgB,CACxB,IAAM,EAAW,SAAS,KAAK,cAC7B,0BACF,EACA,GAAI,EACF,KAAK,eAAiB,MACjB,CACL,IAAM,EAAO,SAAS,cAAc,MAAM,EAC1C,EAAK,aAAa,OAAQ,aAAa,EACvC,SAAS,KAAK,YAAY,CAAI,EAC9B,KAAK,eAAiB,EACtB,KAAK,sBAAwB,EAC/B,CACF,CAEA,KAAK,eAAe,aAAa,UAAW,CAAK,CAFjD,CAGF,CAOA,aAAqB,EAAsC,CAEzD,IAAM,GADS,KAAK,MAAM,QAAU,CAAC,CAAY,GAC5B,KAAM,GAAM,EAAE,KAAO,CAAE,EAK5C,OAJK,EAIE,CAAC,GAFW,EAAM,YAAc,KAAK,aAAa,EAAM,WAAW,EAAI,CAAC,EAExD,EAAM,SAAmC,EAJ7C,CAAC,CAKtB,CAuCA,QAAS,CACP,GAAM,CAAE,YAAa,KAAK,MACpB,CAAE,oBAAmB,mBAAoB,KAAK,MAEpD,OACE,EAAC,MAAD,CACE,IAAK,KAAK,WACV,GAAG,gBACH,UAAW,EAAG,EAAO,UAAW,GAAmB,EAAO,SAAS,EACnE,MAAO,EAEN,UACE,CAAA,CAET,CACF"}
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=Ln(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)}">${Pn(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 zn(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 Bn(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=zn(r);if(i.length<3)return;let a=e.querySelector(`text`)?.textContent?.trim()??``;n.push({id:e.id,name:a,points:i})}),n}function Vn(e,t){let n=Rn(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`},Hn=6,Un=5,Wn=1.25,Gn=.25,Kn=12,qn=0;function Jn(e){return qn+=1,`${e}${qn}`}var Yn={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 Xn({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:Jn(`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=En(e.clientX,e.clientY,j.current);if(!r)return;let i=e.deltaY<0?Wn:1/Wn,a=Math.max(Gn,Math.min(Kn,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(Gn,Math.min(Kn,s*Wn)),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(Gn,Math.min(Kn,s/Wn)),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(Gn,Math.min(Kn,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 I(e){return j.current?En(e.clientX,e.clientY,j.current):null}function ee(e,t){let n=null;for(let r=0;r<t.points.length;r++){let i=Dn(e,t.points[r]);i<=Hn&&(!n||i<n.d)&&(n={index:r,d:i})}return n}function L(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}=On(e,i,a);o<=Un&&(!n||o<n.d)&&(n={index:r,t:s,d:o})}return n}function te(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 R(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 z(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=I(e);if(n){if(m){let e=t.find(e=>e.id===m);if(e){let t=kn(n,[e]);t&&i(e=>[...e,{id:Jn(`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&&Dn(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=ee(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=L(n,e);if(t){let r=e.points[t.index],i=e.points[(t.index+1)%e.points.length],a=Tn({x:r.x+(i.x-r.x)*t.t,y:r.y+(i.y-r.y)*t.t}),o=te(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=>An(n,e.points));if(r){p(r.id),O.current={type:`room`,roomId:r.id,start:n,origPoints:[...r.points]};return}p(null)}}}function B(e){if(a!==`select`||m)return;let n=I(e);if(!n)return;let r=t.find(e=>e.id===s);if(!r)return;let i=ee(n,r);i&&(e.preventDefault(),R(r.id,i.index))}function ne(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=I(e);if(r){if(k.current&&m){let e=t.find(e=>e.id===m);if(e){let t=kn(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=Tn({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 V(e){if(A.current){A.current=null;return}let t=I(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:Jn(`room`),name:`Room ${t.length+1}`,points:Mn(e,r,i,a)}]),_(null),y(null)}k.current=null,O.current=null}}function H(e){s&&n(t=>t.map(t=>t.id===s?{...t,name:e}:t))}function U(e,t){let n=parseFloat(t);isNaN(n)||n<=0||i(t=>t.map(t=>t.id===e?{...t,width:n}:t))}function W(){s&&(n(e=>e.filter(e=>e.id!==s)),i(e=>e.filter(e=>e.roomId!==s)),h(null),p(null))}function re(e){i(t=>t.filter(t=>t.id!==e))}function G(e){o(e),h(null),x([]),C(null),_(null),y(null)}function ie(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=Bn(t);r.length!==0&&(n(r.map(e=>({...e,id:Jn(`room`)}))),i([]),p(null),h(null),T(1),D({x:0,y:0}))},r.readAsText(t)}let K=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,ae=s?t.find(e=>e.id===s)??null:null,q=m?t.find(e=>e.id===m)??null:null,oe=m?r.filter(e=>e.roomId===m):[],se=[{t:`select`,icon:d.faHandPointer,label:`Select & edit`},{t:`rect`,icon:d.faSquare,label:`Rectangle room`},{t:`polygon`,icon:d.faDrawPolygon,label:`Polygon room`}],ce=400/w,le=300/w,J=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:[se.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:()=>G(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(Wn),disabled:w>=Kn,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/Wn),disabled:w<=Gn,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:()=>Vn(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:ie})]}),(0,f.jsxs)(`svg`,{ref:j,className:(0,l.default)(Q.roomDrawerCanvas,J),viewBox:`${E.x} ${E.y} ${ce} ${le}`,onMouseDown:z,onMouseMove:ne,onMouseUp:V,onDoubleClick:B,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:ce,height:le,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=In(t,r.filter(t=>t.roomId===e.id)),a=jn(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=Nn(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&&oe.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=Nn(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&&ae&&ae.points.map((e,t)=>(0,f.jsx)(`circle`,{cx:e.x,cy:e.y,r:3.5,className:Q.vertexHandle},t)),K&&(0,f.jsx)(`rect`,{x:K.x,y:K.y,width:K.w,height:K.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))]})]}),ae&&!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:ae.name,onChange:e=>H(e.target.value),placeholder:`Room name`}),(0,f.jsxs)(`button`,{className:Q.roomDrawerInfoDoorsBtn,onClick:()=>h(ae.id),title:`Edit doors`,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDoorOpen}),(0,f.jsx)(`span`,{children:r.filter(e=>e.roomId===ae.id).length})]}),(0,f.jsx)(`button`,{className:Q.roomDrawerInfoDelete,onClick:W,title:`Delete room`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faTrash})})]}),m&&q&&(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:q.name?`Doors · ${q.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:[oe.length===0&&(0,f.jsx)(`span`,{className:Q.roomDrawerDoorPanelEmpty,children:`Click on a wall to add a door`}),oe.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=>U(e.id,t.target.value)}),(0,f.jsx)(`button`,{className:Q.roomDrawerInfoDelete,onClick:()=>re(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`:`${Yn[a]} · Scroll to zoom · Middle-drag to pan · 0 to reset`})]})}var Zn={"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 Qn({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(Zn.roomViewerSelected,Zn.roomViewerTint);let[t]=e.querySelectorAll(`[id="background"]`);t&&t.classList.remove(Zn.roomViewerTint)}}if(a){a.classList.add(Zn.roomViewerSelected);let[e]=a.querySelectorAll(`[id="background"]`);(e??a).classList.add(Zn.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:Zn.roomViewer,ref:t,children:[(0,f.jsx)(`h3`,{className:Zn.roomViewerHeader,children:e[r]?.label??``}),(0,f.jsx)(`div`,{className:(0,l.default)(Zn.roomViewerContainer,a&&Zn.roomViewerContainerLoading),children:m},r),e.length>1&&(0,f.jsxs)(`div`,{className:Zn.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 $n={scrollbarProvider:`scrollbarProvider_IMBFu`};function er({className:e=void 0,children:t=void 0}){return(0,f.jsx)(`div`,{className:(0,l.default)($n.scrollbarProvider,e),children:t})}var tr=er,nr=function(e){return e.Text=`text`,e.Circle=`circle`,e.Rectangular=`rectangular`,e}({}),rr=function(e){return e.Shimmer=`shimmer`,e.Pulse=`pulse`,e.None=`none`,e}({}),ir={skeleton:`skeleton_TSg1y`,"skeleton-lines":`skeleton-lines_-Z-gf`,skeletonLines:`skeleton-lines_-Z-gf`,"skeleton-line-last":`skeleton-line-last_UFw21`,skeletonLineLast:`skeleton-line-last_UFw21`,"skeleton-text":`skeleton-text_Jlefj`,skeletonText:`skeleton-text_Jlefj`,"skeleton-circle":`skeleton-circle_t0bbj`,skeletonCircle:`skeleton-circle_t0bbj`,"skeleton-rectangular":`skeleton-rectangular_UtIyN`,skeletonRectangular:`skeleton-rectangular_UtIyN`,"skeleton-animation-pulse":`skeleton-animation-pulse_wGbPg`,skeletonAnimationPulse:`skeleton-animation-pulse_wGbPg`,skeletonPulse:`skeletonPulse_06yjn`,"skeleton-animation-shimmer":`skeleton-animation-shimmer_a0nwc`,skeletonAnimationShimmer:`skeleton-animation-shimmer_a0nwc`,skeletonShimmer:`skeletonShimmer_wLPXR`},ar={[nr.Text]:ir.skeletonText,[nr.Circle]:ir.skeletonCircle,[nr.Rectangular]:ir.skeletonRectangular},or={[rr.Shimmer]:ir.skeletonAnimationShimmer,[rr.Pulse]:ir.skeletonAnimationPulse,[rr.None]:void 0};function sr({variant:e=nr.Text,animation:t=rr.Shimmer,lines:n=1,className:r,style:i,classNames:a,styles:o,...s}){let c=ar[e],u=or[t];return e!==nr.Text||n<=1?(0,f.jsx)(`span`,{...s,className:(0,l.default)(ir.skeleton,c,u,r),style:i}):(0,f.jsx)(`span`,{...s,className:(0,l.default)(ir.skeletonLines,r),style:i,children:Array.from({length:n},(e,t)=>(0,f.jsx)(`span`,{className:(0,l.default)(ir.skeleton,c,u,t===n-1&&ir.skeletonLineLast,a?.line),style:o?.line},t))})}var cr={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 lr(){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 ur({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)(cr.stepper,{[cr.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)(cr.stepperEntry,{[cr.stepperEntryActive]:p},{[cr.stepperEntryDone]:s},{[cr.stepperClickable]:h},u?.entry),_=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`div`,{className:(0,l.default)(cr.stepperEntryNumber,{[cr.stepperEntryNumberDone]:s},u?.entryNumber),style:d?.entryNumber,children:s?(0,f.jsx)(lr,{}):o+1}),!a&&(0,f.jsx)(`div`,{className:(0,l.default)(cr.stepperEntryLabel,{[cr.stepperEntryLabelVertical]:m},u?.entryLabel),style:d?.entryLabel,children:n.label})]});return(0,f.jsxs)(c.default.Fragment,{children:[h?(0,f.jsx)(B,{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)(cr.stepperConnector,{[cr.stepperConnectorFilled]:s},{[cr.stepperConnectorVertical]:m},u?.connector),style:d?.connector})]},o)})})}var dr={sticky:`sticky_L6zO2`,"sticky-content":`sticky-content_ZaXTD`,stickyContent:`sticky-content_ZaXTD`,"sticky-content-stuck":`sticky-content-stuck_w-gRW`,stickyContentStuck:`sticky-content-stuck_w-gRW`,"sticky-placeholder":`sticky-placeholder_aJ3Sb`,stickyPlaceholder:`sticky-placeholder_aJ3Sb`};function fr({children:e,offsetTop:t=0,zIndex:n=20,disabled:r=!1,onStuckChange:i,className:a,style:o,classNames:s,styles:u,...d}){let p=(0,c.useRef)(null),m=(0,c.useRef)(null),[h,g]=(0,c.useState)(!1),[_,v]=(0,c.useState)({width:0,left:0,height:0}),y=(0,c.useRef)(i);(0,c.useEffect)(()=>{y.current=i},[i]);let b=(0,c.useCallback)(()=>{let e=p.current,n=m.current;if(!e||!n)return;let i=e.getBoundingClientRect();v({width:e.clientWidth,left:i.left,height:n.offsetHeight}),g(!r&&i.top<=t)},[r,t]);(0,c.useLayoutEffect)(()=>{b()},[b,e]),(0,c.useEffect)(()=>{let e=0,t=()=>{cancelAnimationFrame(e),e=requestAnimationFrame(b)};window.addEventListener(`scroll`,t,{passive:!0,capture:!0}),window.addEventListener(`resize`,t);let n=new ResizeObserver(t);return p.current&&n.observe(p.current),m.current&&n.observe(m.current),()=>{cancelAnimationFrame(e),window.removeEventListener(`scroll`,t,{capture:!0}),window.removeEventListener(`resize`,t),n.disconnect()}},[b]);let x=(0,c.useRef)(!0);(0,c.useEffect)(()=>{if(x.current){x.current=!1;return}y.current?.(h)},[h]);let S=h?{position:`fixed`,top:t,left:_.left,width:_.width,zIndex:n,...u?.content}:u?.content;return(0,f.jsxs)(`div`,{ref:p,className:(0,l.default)(dr.sticky,a,s?.root),style:{...u?.root,...o},...d,children:[h&&(0,f.jsx)(`div`,{"aria-hidden":!0,className:(0,l.default)(dr.stickyPlaceholder,s?.placeholder),style:{height:_.height,...u?.placeholder}}),(0,f.jsx)(`div`,{ref:m,className:(0,l.default)(dr.stickyContent,h&&dr.stickyContentStuck,s?.content),style:S,children:e})]})}var pr={switch:`switch_9TG2Y`,"switch-disabled":`switch-disabled_UL-F-`,switchDisabled:`switch-disabled_UL-F-`,"switch-track":`switch-track_awA-t`,switchTrack:`switch-track_awA-t`,"switch-track-checked":`switch-track-checked_boZKe`,switchTrackChecked:`switch-track-checked_boZKe`,"switch-thumb":`switch-thumb_4fUTo`,switchThumb:`switch-thumb_4fUTo`,"switch-thumb-checked":`switch-thumb-checked_GU--w`,switchThumbChecked:`switch-thumb-checked_GU--w`,"switch-label":`switch-label_3pLBQ`,switchLabel:`switch-label_3pLBQ`};function mr({label:e=``,selected:t=!1,onToggle:n=()=>{},className:r=``,style:i,disabled:a=!1,title:o=``,tabIndex:s=0,formValidator:u=null,children:d=null,classNames:p,styles:m,...h}){let[,g]=(0,c.useState)(0);(0,c.useEffect)(()=>{if(!u)return;let e=()=>g(e=>e+1);return u.registerOnUpdateListener(e),()=>u.removeOnUpdateListener(e)},[u]);function _(e){a||(u&&u.set(!u.value),n(!v,e))}let v=u?u.value:t;return(0,f.jsxs)(`div`,{...h,title:o,className:(0,l.default)(pr.switch,{[pr.switchDisabled]:a},r),style:i,onClick:_,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),_(e))},role:`switch`,"aria-checked":v,tabIndex:a?-1:s,children:[(0,f.jsx)(`div`,{className:(0,l.default)(pr.switchTrack,v&&pr.switchTrackChecked,p?.track),style:m?.track,children:(0,f.jsx)(`div`,{className:(0,l.default)(pr.switchThumb,v&&pr.switchThumbChecked,p?.thumb),style:m?.thumb})}),(d||e)&&(0,f.jsx)(`div`,{className:(0,l.default)(pr.switchLabel,p?.label),style:m?.label,children:d||e})]})}var hr={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 gr({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)(hr.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)(B,{role:`tab`,"aria-selected":r,"aria-disabled":e.disabled||void 0,tabIndex:e.disabled?-1:0,className:(0,l.default)(hr.tabHeaderTab,{[hr.tabHeaderTabActive]:r},{[hr.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)(hr.tabHeaderIcon,a?.icon),style:o?.icon}),i&&(0,f.jsxs)(`div`,{className:(0,l.default)(hr.tabHeaderLabels,a?.labels),style:o?.labels,children:[e.title&&(0,f.jsx)(`span`,{className:(0,l.default)(hr.tabHeaderTitle,a?.title),style:o?.title,children:e.title}),e.subtitle&&(0,f.jsx)(`span`,{className:(0,l.default)(hr.tabHeaderSubtitle,a?.subtitle),style:o?.subtitle,children:e.subtitle})]})]},e.id)})})}function _r(e){return(0,f.jsx)(Ne,{...e,multiline:!0})}var vr={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)`,"--button-default-color":`var(--primary-color)`,"--button-default-border":`1px solid var(--primary-color)`,"--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%)`,"--background-card-elevated":`var(--background-accent-light)`,"--background-card-outlined":`transparent`,"--background-card-filled":`var(--background-accent)`,"--spacing-s":`4px`,"--spacing-m":`8px`,"--spacing-l":`16px`}},yr={colorFade:`colorFade_eLv2g`},br=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??[vr],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??[vr]).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?yr.colorFade:void 0,style:t,children:e})}};function xr(e=`default`){let[t,n]=(0,c.useState)(localStorage.getItem(`theme`)||e);return{currentThemeId:t,setCurrentThemeId:e=>{n(e),localStorage.setItem(`theme`,e)}}}var Sr=e=>(Math.trunc(e)%24+24)%24,Cr=e=>(Math.trunc(e)%60+60)%60;function wr(e){if(!e)return null;let t=e.match(/^(\d{1,2}):(\d{1,2})$/);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);return n>23||r>59?null:{hours:n,minutes:r}}function Tr(e){return e?`${String(Sr(e.hours)).padStart(2,`0`)}:${String(Cr(e.minutes)).padStart(2,`0`)}`:``}function Er(e,t){return Cr(!t||t<=1?e:Math.round(Cr(e)/t)*t)}var Dr=e=>e.hours*60+e.minutes;function Or(e,t,n){let r=Dr(e),i=wr(t),a=wr(n);return i&&(r=Math.max(r,Dr(i))),a&&(r=Math.min(r,Dr(a))),{hours:Math.floor(r/60),minutes:r%60}}function kr(e,t,n,r,i){let a=r*i*Math.PI/180;return{x:e+n*Math.sin(a),y:t-n*Math.cos(a)}}function Ar(e,t){return(Math.atan2(e,-t)*180/Math.PI+360)%360}var jr=(e,t)=>Math.sqrt(e*e+t*t),Mr={clockFace:`clockFace_LbXIa`,clockHand:`clockHand_E9nTw`,"clockHand-line":`clockHand-line_iOipC`,clockHandLine:`clockHand-line_iOipC`,"clockHand-center":`clockHand-center_VElxx`,clockHandCenter:`clockHand-center_VElxx`,"clockHand-knob":`clockHand-knob_Mb2Fx`,clockHandKnob:`clockHand-knob_Mb2Fx`,clockNumber:`clockNumber_qHDO8`,"clockNumber-inner":`clockNumber-inner_x2XR1`,clockNumberInner:`clockNumber-inner_x2XR1`,"clockNumber-selected":`clockNumber-selected_rPVlV`,clockNumberSelected:`clockNumber-selected_rPVlV`},Nr=50,Pr=40,Fr=25.5,Ir=65.5/2,Lr=30,Rr=6,zr=e=>(e+11)%12+1;function Br(e,t){if(e===`minutes`)return Array.from({length:12},(e,t)=>{let n=t*5;return{label:String(n).padStart(2,`0`),slot:t,value:n,ring:`outer`}});if(!t)return Array.from({length:12},(e,t)=>{let n=t===0?12:t;return{label:String(n),slot:t,value:n,ring:`outer`}});let n=Array.from({length:12},(e,t)=>{let n=t===0?12:t;return{label:String(n),slot:t,value:n,ring:`outer`}}),r=Array.from({length:12},(e,t)=>{let n=t===0?0:t+12;return{label:String(n).padStart(2,`0`),slot:t,value:n,ring:`inner`}});return[...n,...r]}function Vr({time:e,mode:t,use24Hour:n,minuteStep:r,onChange:i,onCommit:a,classNames:o,styles:s}){let u=(0,c.useRef)(null),d=(0,c.useRef)(!1),p=Br(t,n),m=e.hours>=12,h=zr(e.hours),g=t===`minutes`?{slot:e.minutes,radius:Pr}:n?e.hours===0?{slot:0,radius:Fr}:e.hours<=12?{slot:e.hours%12,radius:Pr}:{slot:(e.hours-12)%12,radius:Fr}:{slot:h%12,radius:Pr},_=kr(Nr,Nr,g.radius,g.slot,t===`minutes`?Rr:Lr),v=i=>t===`minutes`?Er(e.minutes,r)===i.value||e.minutes===i.value:n?e.hours===i.value:h===i.value,y=(i,a)=>{let o=u.current?.getBoundingClientRect();if(!o)return e;let s=i-(o.left+o.width/2),c=a-(o.top+o.height/2),l=Ar(s,c);if(t===`minutes`){let t=Er(Math.round(l/Rr),r);return{hours:e.hours,minutes:t}}let d=Math.round(l/Lr)%12;if(!n){let t=d===0?12:d;return{hours:Sr(m?t%12+12:t%12),minutes:e.minutes}}return{hours:Sr(jr(s,c)/(o.width/2)*Nr<Ir?d===0?0:d+12:d===0?12:d),minutes:e.minutes}};return(0,f.jsxs)(`div`,{ref:u,className:(0,l.default)(Mr.clockFace,o?.clockFace),style:s?.clockFace,onPointerDown:e=>{d.current=!0,e.currentTarget.setPointerCapture?.(e.pointerId),i(y(e.clientX,e.clientY))},onPointerMove:e=>{d.current&&i(y(e.clientX,e.clientY))},onPointerUp:e=>{d.current&&(d.current=!1,a(y(e.clientX,e.clientY)))},role:`slider`,"aria-label":t===`minutes`?`Minutes`:`Hours`,"aria-valuetext":t===`minutes`?`${e.minutes} minutes`:`${e.hours} hours`,children:[(0,f.jsxs)(`svg`,{className:Mr.clockHand,viewBox:`0 0 100 100`,"aria-hidden":!0,children:[(0,f.jsx)(`circle`,{cx:Nr,cy:Nr,r:1.8,className:Mr.clockHandCenter}),(0,f.jsx)(`line`,{x1:Nr,y1:Nr,x2:_.x,y2:_.y,className:Mr.clockHandLine}),(0,f.jsx)(`circle`,{cx:_.x,cy:_.y,r:7,className:(0,l.default)(Mr.clockHandKnob,o?.clockHand),style:s?.clockHand})]}),p.map(e=>{let t=kr(Nr,Nr,e.ring===`inner`?Fr:Pr,e.slot,Lr),n=v(e);return(0,f.jsx)(`div`,{className:(0,l.default)(Mr.clockNumber,e.ring===`inner`&&Mr.clockNumberInner,n&&Mr.clockNumberSelected,o?.clockNumber),style:{left:`${t.x}%`,top:`${t.y}%`,...s?.clockNumber},children:e.label},`${e.ring}-${e.value}`)})]})}var Hr={timeInput:`timeInput_EbsZN`,"timeInput-clock":`timeInput-clock_D1-dk`,timeInputClock:`timeInput-clock_D1-dk`,"timeInput-clockHeader":`timeInput-clockHeader_bsYNW`,timeInputClockHeader:`timeInput-clockHeader_bsYNW`,"timeInput-headerSegment":`timeInput-headerSegment_Oiu7e`,timeInputHeaderSegment:`timeInput-headerSegment_Oiu7e`,"timeInput-headerSegment-active":`timeInput-headerSegment-active_-Funz`,timeInputHeaderSegmentActive:`timeInput-headerSegment-active_-Funz`,"timeInput-headerColon":`timeInput-headerColon_LwyQH`,timeInputHeaderColon:`timeInput-headerColon_LwyQH`,"timeInput-meridiem":`timeInput-meridiem_tk9km`,timeInputMeridiem:`timeInput-meridiem_tk9km`,"timeInput-meridiem-active":`timeInput-meridiem-active_40uHm`,timeInputMeridiemActive:`timeInput-meridiem-active_40uHm`,"timeInput-footer":`timeInput-footer_NCXsB`,timeInputFooter:`timeInput-footer_NCXsB`};function Ur({value:e,selected:t,onChange:n=()=>null,onSelect:r=()=>null,formValidator:i=null,isInline:a=!1,isModal:o=!1,noInput:s=!1,noHeader:p=!1,showClearButton:m=!1,showNowButton:g=!1,minuteStep:_=1,use24Hour:v=!0,minTime:y=null,maxTime:b=null,label:x=``,isValid:S=!0,errorMessage:C=``,isRequired:w=!1,disabled:T=!1,className:E=``,style:D,classNames:O,styles:k,...A}){let M=()=>i?i.value||``:e??t??``,[N,P]=(0,c.useState)(M),[F,I]=(0,c.useState)(!1),[ee,te]=(0,c.useState)(`hours`),[R,z]=(0,c.useState)(!1),[B,ne]=(0,c.useState)(!1),[,V]=(0,c.useState)(0),H=M(),[U,W]=(0,c.useState)(H),re=(0,c.useRef)(i);!i&&U!==H&&(W(H),P(H)),(0,c.useEffect)(()=>{if(re.current=i,!i)return;let e=()=>{P(i.value||``),V(e=>e+1)};return i.registerOnUpdateListener(e),()=>i.removeOnUpdateListener(e)},[i]);let G=()=>i?i.touched&&i.hasError():!S||!!C,ie=()=>!!(w||i?.validators.find(e=>e.validatorId===`required`)),K=e=>{let t=e?Tr(e):null;i&&i.set(t),n?.(t)},ae=e=>{P(e?Tr(e):``),K(e)},q=wr(N),oe=q??{hours:12,minutes:0},se=e=>{ae(Or({hours:e.hours,minutes:Er(e.minutes,_)},y,b))},ce=e=>{let t=Or({hours:e.hours,minutes:Er(e.minutes,_)},y,b);if(ae(t),ee===`hours`){te(`minutes`);return}r?.(Tr(t)),a||I(!1)},le=()=>{T||(te(`hours`),I(!0))},J=({previousState:e,nextState:t})=>{if(!e||t.value===e.value)return t;let n=t.value,r=n.slice(0,2);/^\d\d$/.test(r)&&Number(r)>23&&(n=`23${n.slice(2)}`);let i=n.slice(3,5);return/^\d\d$/.test(i)&&Number(i)>59&&(n=`${n.slice(0,3)}59`),n===t.value?t:{...t,value:n}},ue=e=>{P(e);let t=wr(e);t&&K(t)},de=()=>{re.current&&(re.current.touched=!0),z(!1),K(wr(N))},fe=e=>{e!==oe.hours>=12&&ae({hours:Sr(oe.hours+(e?12:-12)),minutes:oe.minutes})},pe=G(),me=q?String(v?q.hours:(q.hours+11)%12+1).padStart(2,`0`):`--`,he=q?String(q.minutes).padStart(2,`0`):`--`,ge=p?null:(0,f.jsxs)(`div`,{className:(0,l.default)(Hr.timeInputClockHeader,O?.clockHeader),style:k?.clockHeader,children:[(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(Hr.timeInputHeaderSegment,ee===`hours`&&Hr.timeInputHeaderSegmentActive,O?.headerSegment),style:k?.headerSegment,onClick:()=>te(`hours`),children:me}),(0,f.jsx)(`span`,{className:Hr.timeInputHeaderColon,children:`:`}),(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(Hr.timeInputHeaderSegment,ee===`minutes`&&Hr.timeInputHeaderSegmentActive,O?.headerSegment),style:k?.headerSegment,onClick:()=>te(`minutes`),children:he}),!v&&(0,f.jsxs)(`div`,{className:(0,l.default)(Hr.timeInputMeridiem,O?.meridiem),style:k?.meridiem,children:[(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(oe.hours<12&&Hr.timeInputMeridiemActive),onClick:()=>fe(!1),children:`AM`}),(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(oe.hours>=12&&Hr.timeInputMeridiemActive),onClick:()=>fe(!0),children:`PM`})]})]}),_e=m||g?(0,f.jsxs)(`div`,{className:(0,l.default)(Hr.timeInputFooter,O?.footer),style:k?.footer,children:[g&&(0,f.jsx)(L,{styleType:j.Default,onClick:()=>{let e=new Date;se({hours:e.getHours(),minutes:e.getMinutes()})},children:`Now`}),m&&(0,f.jsx)(L,{styleType:j.Default,onClick:()=>{ae(null),r?.(null)},children:`Clear`})]}):null,ve=(0,f.jsxs)(`div`,{className:(0,l.default)(Hr.timeInputClock,O?.clock),style:k?.clock,children:[ge,(0,f.jsx)(Vr,{time:oe,mode:ee,use24Hour:v,minuteStep:_,onChange:se,onCommit:ce,classNames:O,styles:k}),_e]}),ye=s?null:(0,f.jsx)(Ne,{label:`${x}${ie()?` *`:``}`,value:N,icon:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faClock}),onIconClick:le,onClick:le,readOnly:o,disabled:T,isValid:!pe,customInput:(0,f.jsx)(h.default,{mask:`99:99`,maskPlaceholder:`_`,beforeMaskedStateChange:J}),onChange:e=>ue(e),onBlur:de,onFocus:()=>z(!0),onMouseEnter:()=>ne(!0),onMouseLeave:()=>ne(!1)}),be=a?ve:o?(0,f.jsx)(Ke,{hideHeader:!0,isOpen:F,onClose:()=>I(!1),children:ve}):(0,f.jsx)(ke,{isOpen:F,onOpenChange:I,content:ve,align:De.Left,dontCloseOnChildClick:!0,children:ye});return(0,f.jsxs)(`div`,{className:(0,l.default)(Hr.timeInput,O?.root,E),style:{...k?.root,...D},...A,children:[(o||a)&&ye,be,(0,f.jsx)(je,{variant:`error`,message:i?i.getCurrentErrorMessage()??``:C||``,isVisible:pe&&(R||B)})]})}var Wr={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-paused":`toast-paused_NPmT4`,toastPaused:`toast-paused_NPmT4`,toastProgressBar:`toastProgressBar_6vBs6`,"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`,toastShrink:`toastShrink_h89HS`},Gr={info:d.faCircleInfo,success:d.faCircleCheck,error:d.faCircleXmark,warn:d.faTriangleExclamation,default:d.faBell};function Kr({item:e,isBottom:t,onDismiss:n}){let{id:r,content:i,options:a,dismissing:o}=e,{duration:s,showRemainingTime:p,showCloseButton:m,pauseOnHover:h,type:g,classNames:_,styles:v}=a,[y,b]=(0,c.useState)(!1),[x,S]=(0,c.useState)(!1),C=h&&(y||x),w=(0,c.useRef)(s);return(0,c.useEffect)(()=>{if(s===0||C)return;let e=Date.now(),t=setTimeout(()=>n(r),w.current);return()=>{clearTimeout(t),w.current-=Date.now()-e}},[r,s,n,C]),(0,f.jsxs)(`div`,{className:(0,l.default)(Wr.toast,t?Wr.toastBottom:null,Wr[`toast-${g}`],o&&Wr.toastDismissing,C&&Wr.toastPaused,_?.root),style:v?.root,onMouseEnter:h?()=>b(!0):void 0,onMouseLeave:h?()=>b(!1):void 0,onFocus:h?()=>S(!0):void 0,onBlur:h?()=>S(!1):void 0,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:Gr[g],className:(0,l.default)(Wr.toastIcon,_?.icon),style:v?.icon}),(0,f.jsx)(`div`,{className:(0,l.default)(Wr.toastContent,_?.content),style:v?.content,children:i}),m&&(0,f.jsx)(V,{icon:d.faXmark,onClick:()=>n(r),className:(0,l.default)(Wr.toastCloseButton,_?.closeButton),style:v?.closeButton,"aria-label":`Close`}),p&&s>0&&(0,f.jsx)(`div`,{className:(0,l.default)(Wr.toastProgressBar,_?.progressBar),style:{"--toast-duration":`${s}ms`,...v?.progressBar}})]})}var qr=null;function Jr(e){qr=e}function Yr(){qr=null}function Xr(e,t){if(!qr){console.error(`[Toast] No ToastProvider found. Wrap your app with <ToastProvider>.`);return}qr(e,t)}var Zr={position:`top-right`,duration:4e3,showRemainingTime:!0,showCloseButton:!0,allowStacking:!0,pauseOnHover:!0},Qr=220;function $r(e){return Wr[`container-${e}`]}function ei({children:e,position:t=Zr.position,duration:n=Zr.duration,showRemainingTime:r=Zr.showRemainingTime,showCloseButton:i=Zr.showCloseButton,allowStacking:a=Zr.allowStacking,pauseOnHover:o=Zr.pauseOnHover}){let[s,u]=(0,c.useState)([]),d=(0,c.useRef)(0),p=(0,c.useCallback)(e=>{u(t=>t.map(t=>t.id===e?{...t,dismissing:!0}:t)),setTimeout(()=>{u(t=>t.filter(t=>t.id!==e))},Qr)},[]),m=(0,c.useCallback)((e,s)=>{let c={position:s?.position??t,duration:s?.duration??n,showRemainingTime:s?.showRemainingTime??r,showCloseButton:s?.showCloseButton??i,pauseOnHover:s?.pauseOnHover??o,type:s?.type??`default`,classNames:s?.classNames,styles:s?.styles};d.current+=1;let l={id:`toast-${d.current}`,content:e,options:c,dismissing:!1};u(e=>!a&&e.length>0?(setTimeout(()=>{u([l])},Qr),e.map(e=>({...e,dismissing:!0}))):[...e,l])},[t,n,r,i,a,o]);(0,c.useEffect)(()=>(Jr(m),()=>Yr()),[m]);let h=s.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)(ce,{children:Object.entries(h).map(([e,t])=>(0,f.jsx)(`div`,{className:(0,l.default)(Wr.container,$r(e)),children:t.map(t=>(0,f.jsx)(Kr,{item:t,isBottom:e.startsWith(`bottom`),onDismiss:p},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 ti({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 ni(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 ri(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 ii(e,t,n,r,i){if(i===0)return{startIndex:0,endIndex:-1};let a=ri(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 ai(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 oi(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 si(e,t){let n=t[e],r=e+1;for(;r<t.length&&t[r]>n;)r++;return r-1}function ci(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 li=`ahroweui:virtuallist:columns:`;function ui(e){if(!e||typeof window>`u`)return null;try{let t=window.localStorage.getItem(li+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 di(e,t){return t&&t.known.includes(e.key)?t.visible.includes(e.key):!e.defaultHidden}function fi(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 pi({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)(()=>fi(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=fi(i,S.current);g(t=>t===e?t:e)},[i,p,d]);let{offsets:A,totalHeight:j}=(0,c.useMemo)(()=>ni(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=ri(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)(()=>ii(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 mi({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 hi({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=ui(a);return new Set((e??[]).filter(e=>di(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=ui(a);b(e=>{let n=new Set;for(let i of t)r.has(i.key)?e.has(i.key)&&n.add(i.key):di(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(li+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 `:``}${ci(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 I=(0,c.useCallback)(()=>v({}),[]);function ee(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:ee,recalculateColumns:I}}function gi({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),[I]=(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 ee(e){w.current=!!e.target.closest(`[data-drag-handle]`)}function L(e,n){if(a&&!w.current){n.preventDefault();return}p.current=e,h(e),t&&_(null)}function te(e,t,n){let r=p.current;if(r==null)return null;let i=s.indexOf(r);if(i!==-1&&e>=i&&e<=si(i,l))return null;let a=oi(t,n.top,n.height,u(e));return{key:s[e],position:a}}function R(e,t){t.preventDefault();let n=t.currentTarget.getBoundingClientRect(),r=te(e,t.clientY,n);_(e=>e?.key===r?.key&&e?.position===r?.position?e:r)}function z(){let e=p.current,t=v.current;e!=null&&t&&t.key!==e&&r?.(e,t)}function B(e){e.preventDefault(),z(),_(null),p.current=null,h(null)}function ne(){_(null),p.current=null,h(null)}function V(e,t){t.preventDefault();let r=p.current;if(r==null)return;let i=s.indexOf(r),a=t.currentTarget.getBoundingClientRect(),o=ai(i,e,t.clientY,a.top,a.height);o!=null&&n?.(i,o)}function H(){p.current=null,h(null)}let U=(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<=si(s,t)){_(null);return}let n=oi(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=ai(s,o,r,c.top,c.height);l!=null&&y.current?.(s,l)},[d,f]),W=(0,c.useCallback)(()=>{let e=M.current;e&&(e.style.transform=`translate(${P.current}px, ${k.current-N.current}px)`)},[]),re=(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,U(n)),A.current=requestAnimationFrame(re)},[U,d]),G=(0,c.useCallback)(()=>{if(T.current!=null&&(clearTimeout(T.current),T.current=null),window.removeEventListener(`touchmove`,ie),window.removeEventListener(`touchend`,G),window.removeEventListener(`touchcancel`,G),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)},[]),ie=(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(),W(),U(t.clientX)}},[U,W]);function K(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`,ie,{passive:!1}),window.addEventListener(`touchend`,G),window.addEventListener(`touchcancel`,G),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`,ae(n),A.current??=requestAnimationFrame(re)},i))}function ae(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:`3`,background:`var(--background)`,boxShadow:`var(--card-shadow)`,borderRadius:`var(--default-border-radius)`}),t.appendChild(a),M.current=a,W()}(0,c.useEffect)(()=>G,[G]);let q=e||t;function oe(n,r){let i=t&&g?.key===r?g.position:void 0;return{reorderable:q&&!a,draggable:q&&!I||void 0,isDragging:q&&r===m,onMouseDown:q&&a?ee:void 0,onDragStart:q?e=>L(r,e):void 0,onDragOver:t?e=>R(n,e):e?e=>V(n,e):void 0,onDragEnd:t?ne:e?H:void 0,onDrop:t?B:void 0,onTouchStart:q?e=>K(r,e):void 0,dropPosition:i,dropIndentPx:i?(l[n]??0)*o:void 0}}function se(){return j.current?(j.current=!1,!0):!1}return{draggingKey:m,dragEnabled:q,getRowDragProps:oe,consumeSuppressedClick:se}}function _i({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:I=!0,rowHover:ee=!0,className:L,style:te,classNames:R,styles:z,...B},ne){let V=(0,c.useCallback)((e,t)=>m?m(e,t):t,[m]),H=(0,c.useMemo)(()=>e.map((e,t)=>V(e,t)),[e,V]),U=(0,c.useMemo)(()=>j?e.map((e,t)=>j(e,t)):[],[e,j]),W=(0,c.useCallback)(t=>M?M(e[t],t):!1,[M,e]),re=pi({items:e,keys:H,getItemKey:m,estimatedRowHeight:i,rowGap:o,overscan:a,onLoadMore:b,loadMoreThreshold:x}),{rootRef:G,headerRef:ie,rowObserver:K,keysRef:ae,offsets:q,totalHeight:oe,startIndex:se,endIndex:ce}=re,le=mi({items:e,getKey:V,multiSelect:C,selectedKeys:w,onSelectionChange:T}),{effectiveSelectedKeys:J}=le,{hasColumns:ue,visibleColumns:de,columnTemplate:fe,shouldShowToggle:pe,effectiveVisible:me,manuallyHiddenCount:he,toggleOpen:ge,setToggleOpen:ve,toggleRef:ye,handleToggleColumn:be,recalculateColumns:xe}=hi({columns:n,items:e,multiSelect:C,visibleColumnKeys:g,onVisibleColumnsChange:_,persistColumnsKey:v,showColumnToggle:y,rootRef:G,startIndex:se,endIndex:ce,containerHeight:re.containerHeight,containerWidth:re.containerWidth});(0,c.useImperativeHandle)(ne,()=>({...re.scrollApi,recalculateColumns:xe}),[re.scrollApi,xe]);let Se=gi({reorderable:E,treeReorder:k,onReorder:D,onTreeDrop:N,longPressDelay:O,dragHandle:F,treeIndentPx:P,keys:H,depths:U,isGroupAt:W,rootRef:G,keysRef:ae}),Ce=typeof s==`number`?`${s}px`:s,we=n=>{let r=e[n],i=V(r,n),a=p!=null&&i===p||J.has(i),o=Se.getRowDragProps(n,i);return(0,f.jsx)(ti,{index:n,top:q[n],padding:Ce,columnTemplate:fe,isSelected:a,showDivider:I,hover:ee,onClick:()=>{Se.consumeSuppressedClick()||h?.(r,n)},observer:K,ariaRowIndex:ue?n+2:void 0,ariaPosInSet:ue?void 0:n+1,ariaSetSize:ue?void 0:e.length,rowRole:ue?`row`:`listitem`,reserveToggleGutter:pe,...o,dropIndicatorClassName:R?.dropIndicator,dropIndicatorStyle:z?.dropIndicator,rowClassName:R?.row,rowStyle:z?.row,children:ue?(0,f.jsxs)(f.Fragment,{children:[C&&(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListSelectCell,R?.selectCell),style:z?.selectCell,role:`gridcell`,onClick:e=>e.stopPropagation(),children:(0,f.jsx)(_e,{selected:J.has(i),onToggle:()=>le.handleRowSelect(i),"aria-label":`Select row`})}),de.map(e=>(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListCell,R?.cell),style:z?.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)},Te=[];for(let e=se;e<=ce;e++)Te.push(we(e));let Ee=Se.draggingKey==null?-1:H.indexOf(Se.draggingKey);return Ee>=0&&(Ee<se||Ee>ce)&&Te.push(we(Ee)),(0,f.jsxs)(`div`,{...B,ref:G,className:(0,l.default)($.virtualList,Se.draggingKey!=null&&$.virtualListReordering,L,R?.root),style:{height:r,...te,...z?.root},onScroll:re.handleScroll,role:ue?`grid`:`list`,"aria-rowcount":ue?e.length+1:void 0,children:[ue&&(0,f.jsxs)(`div`,{ref:ie,className:(0,l.default)($.virtualListHeader,R?.header),style:{gridTemplateColumns:fe,...pe?{paddingRight:32}:{},...z?.header},role:`row`,"aria-rowindex":1,children:[C&&(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListSelectCell,R?.selectCell),style:z?.selectCell,role:`columnheader`,children:(0,f.jsx)(_e,{selected:le.allSelected||le.someSelected,onToggle:le.handleSelectAll,"aria-label":`Select all rows`})}),de.map(e=>(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListHeaderCell,R?.headerCell),style:z?.headerCell,role:`columnheader`,"data-fit-key":e.width.type===`fit`?e.key:void 0,children:e.label},e.key)),pe&&(0,f.jsxs)(`div`,{ref:ye,className:$.virtualListToggleWrapper,children:[(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)($.virtualListHeaderToggle,R?.headerToggle),style:z?.headerToggle,onClick:()=>ve(e=>!e),"aria-label":`Toggle column visibility`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faGear,style:z?.headerToggle})}),he>0&&(0,f.jsx)(`span`,{className:(0,l.default)($.virtualListColumnChip,R?.columnChip),style:z?.columnChip,"data-column-hidden-count":he,"aria-label":`${he} columns hidden`,children:he}),ge&&(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListTogglePopover,R?.togglePopover),style:z?.togglePopover,children:n.map(e=>(0,f.jsx)(_e,{className:(0,l.default)($.virtualListToggleItem,R?.toggleItem),style:z?.toggleItem,selected:me.has(e.key),onToggle:()=>be(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,R?.body),style:{height:oe,...z?.body},children:Te}),re.showLoadMoreSpinner&&(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListLoadingIndicator,R?.loadingIndicator),style:z?.loadingIndicator,children:(0,f.jsx)(A,{className:$.virtualListSpinner})})]})}var vi=c.default.forwardRef(_i),yi={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 bi({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)(yi.wizard,a?.root,r),style:y,children:(0,f.jsx)(`div`,{className:(0,l.default)(yi.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)(yi.wizardContent,a?.step),style:{width:`${100/t}%`,marginLeft:`${100/t*i}%`,...o?.step},children:(0,f.jsx)(`div`,{className:(0,l.default)({[yi.wizardContentOutOfFrame]:e!==i&&!p},a?.stepContent),style:o?.stepContent,inert:e===i?void 0:!0,children:n(i)})},`wizardStep${i}`))})})}function xi(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 Si=class{#e;#t;#n;#r;#i;constructor(e,t=null,{initialValues:n,onSubmit:r=()=>void 0,onValidate:i=()=>void 0,errorParser:a=xi,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 Ci(e){return function({children:t,...n}){return(0,f.jsx)(`form`,{onSubmit:e.submit,noValidate:!0,...n,children:t})}}var wi=e=>{Xr(e[0].message,{type:`error`})},Ti=class extends Si{constructor(e,t=null,n){super(e,t,{...n,onSubmitError:n?.onSubmitError??wi}),this.Form=Ci(this)}},Ei=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}};Ei.prototype.toString=function(){return`${this.value}`};function Di(e){return/^[0-9]+$/.test(e)}function Oi(e){return/^[0-9]{2}.[0-9]{2}.[0-9]{4}$/.test(e)}function ki(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 Ai(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 ji(e){return/^[A-Z]{6}[A-Z\d]{2}([A-Z\d]{3})?$/.test(e)}function Mi(e){return/[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}(\/[-a-zA-Z0-9@:%_+.~#?&//=]*)?$/.test(e)}function Ni(e){return/^[\w!@#$%^&*?±§~`'"/\\[\]{}\-,.();:><+=|öäüÖÄÜß €μ]{8,}$/.test(e)}function Pi(e){return/^(?=.*[a-zöäüA-ZÖÄÜß])/.test(e)}function Fi(e){return/^(?=.*\d)/.test(e)}function Ii(e){return Ni(e)&&Pi(e)&&Fi(e)}var Li={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},Ri=class e{static{this.minLength=(e,t)=>n=>!n||n.length<e?{id:`minLength`,message:t||Li.t(`formValidators.minLength`,{min:e})}:null}static{this.maxLength=(e,t)=>n=>n&&n.length>e?{id:`maxLength`,message:t||Li.t(`formValidators.maxLength`,{max:e})}:null}static{this.email=e=>t=>t&&!Ai(t)?{id:`email`,message:e||Li.t(`formValidators.email`)}:null}static{this.required=e=>{function t(t,n){return!t&&t!==0?{id:`required`,message:e||Li.t(`formValidators.required`,{label:n||Li.t(`formValidators.value`)})}:null}return t.validatorId=`required`,t}}static{this.mustBeNumber=e=>t=>t&&Number.isNaN(+t)?{id:`mustBeNumber`,message:e||Li.t(`formValidators.mustBeNumber`)}:null}static{this.oneOf=(e,t)=>n=>n&&!e.includes(n)?{id:`oneOf`,message:t||Li.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(!Ai(n[t]))return{id:`multiEmail`,message:e||Li.t(`formValidators.multiEmail`)}}return null}}static{this.date=e=>t=>t&&!Oi(t)&&!ki(t)?{id:`date`,message:e||Li.t(`formValidators.date`)}:null}static{this.dateObject=e=>t=>t&&!t.isValid?{id:`date`,message:e||Li.t(`formValidators.date`)}:null}static{this.website=e=>t=>t&&!Mi(t)?{id:`website`,message:e||Li.t(`garages.errors.website`)}:null}static{this.bic=e=>t=>t&&!ji(t)?{id:`bic`,message:e||Li.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||Li.t(`formValidators.minLetters`,{smart_count:e})}:null}static{this.minDigits=(e,t)=>n=>n&&n.replace(/[\D]/g,``).length<e?{id:`minDigits`,message:t||Li.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}}},zi=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)(je,{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 Bi(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 Vi(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 Ti(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=te,exports.ActionIcon=V,exports.Align=De,exports.Avatar=oe,exports.AvatarGroup=se,exports.Badge=ie,exports.BadgePosition=U,exports.BadgeStyleType=H,exports.BodyEnd=ce,exports.Button=L,exports.ButtonSize=M,exports.ButtonStyleType=j,exports.ButtonType=N,exports.Card=de,exports.CardActions=he,exports.CardContent=me,exports.CardHeader=fe,exports.CardMedia=pe,exports.CardStyleType=le,exports.Checkbox=_e,exports.Chip=xe,exports.ChipContainer=Se,exports.ChipStyleType=ve,exports.ColorPicker=We,exports.ConfirmModal=qe,exports.DatePicker=xt,exports.Drawer=Ct,exports.DropZone=At,exports.DropZoneReturnType=wt,exports.DropZoneStatus=Z,exports.Dropdown=yt,exports.EmptyState=Mt,exports.Fab=Lt,exports.FloatingMenu=ke,exports.FormValidator=Ei,exports.FormValidatorGroup=Ti,exports.IconLoading=dn,exports.IconPicker=Vt,exports.IdleManager=Ut,exports.InfiniteBlock=vt,exports.Input=Ne,exports.InputDropdown=qt,exports.InputType=Me,exports.InteractableDiv=B,exports.KanbanBoard=Zt,exports.KanbanColumn=Xt,exports.KlipyPicker=cn,exports.Modal=Ke,exports.NumberInput=mn,exports.OptionPicker=gn,exports.Overscroll=bn,exports.ProgressBar=Cn,exports.Ripple=F,exports.RoomDrawer=Xn,exports.RoomViewer=Qn,exports.ScrollbarProvider=tr,exports.SearchInput=tn,exports.Skeleton=sr,exports.SkeletonAnimation=rr,exports.SkeletonVariant=nr,exports.SpinnerLoading=A,exports.Stepper=ur,exports.Sticky=fr,exports.Switch=mr,exports.TabHeader=gr,exports.Textarea=_r,exports.ThemeProvider=br,exports.TimeInput=Ur,exports.ToastProvider=ei,exports.Tooltip=je,exports.ValidatableComponent=zi,exports.Validators=Ri,exports.VirtualList=vi,exports.Wizard=bi,exports.defaultTheme=vr,exports.getLocale=tt,exports.hasEightPasswordChars=Ni,exports.hasOnePasswordDigit=Fi,exports.hasOnePasswordLetter=Pi,exports.isBic=ji,exports.isDate=Oi,exports.isEmail=Ai,exports.isISODate=ki,exports.isNumber=Di,exports.isPassword=Ii,exports.isURL=Mi,exports.mapLocale=Qe,exports.setLocale=et,exports.showToast=Xr,exports.useFormValidator=Bi,exports.useFormValidatorGroup=Vi,exports.useTheme=xr;
5
+ `)}function zn(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 Bn(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=zn(r);if(i.length<3)return;let a=e.querySelector(`text`)?.textContent?.trim()??``;n.push({id:e.id,name:a,points:i})}),n}function Vn(e,t){let n=Rn(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`},Hn=6,Un=5,Wn=1.25,Gn=.25,Kn=12,qn=0;function Jn(e){return qn+=1,`${e}${qn}`}var Yn={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 Xn({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:Jn(`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=En(e.clientX,e.clientY,j.current);if(!r)return;let i=e.deltaY<0?Wn:1/Wn,a=Math.max(Gn,Math.min(Kn,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(Gn,Math.min(Kn,s*Wn)),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(Gn,Math.min(Kn,s/Wn)),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(Gn,Math.min(Kn,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 I(e){return j.current?En(e.clientX,e.clientY,j.current):null}function ee(e,t){let n=null;for(let r=0;r<t.points.length;r++){let i=Dn(e,t.points[r]);i<=Hn&&(!n||i<n.d)&&(n={index:r,d:i})}return n}function L(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}=On(e,i,a);o<=Un&&(!n||o<n.d)&&(n={index:r,t:s,d:o})}return n}function te(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 R(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 z(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=I(e);if(n){if(m){let e=t.find(e=>e.id===m);if(e){let t=kn(n,[e]);t&&i(e=>[...e,{id:Jn(`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&&Dn(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=ee(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=L(n,e);if(t){let r=e.points[t.index],i=e.points[(t.index+1)%e.points.length],a=Tn({x:r.x+(i.x-r.x)*t.t,y:r.y+(i.y-r.y)*t.t}),o=te(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=>An(n,e.points));if(r){p(r.id),O.current={type:`room`,roomId:r.id,start:n,origPoints:[...r.points]};return}p(null)}}}function B(e){if(a!==`select`||m)return;let n=I(e);if(!n)return;let r=t.find(e=>e.id===s);if(!r)return;let i=ee(n,r);i&&(e.preventDefault(),R(r.id,i.index))}function ne(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=I(e);if(r){if(k.current&&m){let e=t.find(e=>e.id===m);if(e){let t=kn(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=Tn({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 V(e){if(A.current){A.current=null;return}let t=I(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:Jn(`room`),name:`Room ${t.length+1}`,points:Mn(e,r,i,a)}]),_(null),y(null)}k.current=null,O.current=null}}function H(e){s&&n(t=>t.map(t=>t.id===s?{...t,name:e}:t))}function U(e,t){let n=parseFloat(t);isNaN(n)||n<=0||i(t=>t.map(t=>t.id===e?{...t,width:n}:t))}function W(){s&&(n(e=>e.filter(e=>e.id!==s)),i(e=>e.filter(e=>e.roomId!==s)),h(null),p(null))}function re(e){i(t=>t.filter(t=>t.id!==e))}function G(e){o(e),h(null),x([]),C(null),_(null),y(null)}function ie(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=Bn(t);r.length!==0&&(n(r.map(e=>({...e,id:Jn(`room`)}))),i([]),p(null),h(null),T(1),D({x:0,y:0}))},r.readAsText(t)}let K=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,ae=s?t.find(e=>e.id===s)??null:null,q=m?t.find(e=>e.id===m)??null:null,oe=m?r.filter(e=>e.roomId===m):[],se=[{t:`select`,icon:d.faHandPointer,label:`Select & edit`},{t:`rect`,icon:d.faSquare,label:`Rectangle room`},{t:`polygon`,icon:d.faDrawPolygon,label:`Polygon room`}],ce=400/w,le=300/w,J=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:[se.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:()=>G(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(Wn),disabled:w>=Kn,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/Wn),disabled:w<=Gn,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:()=>Vn(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:ie})]}),(0,f.jsxs)(`svg`,{ref:j,className:(0,l.default)(Q.roomDrawerCanvas,J),viewBox:`${E.x} ${E.y} ${ce} ${le}`,onMouseDown:z,onMouseMove:ne,onMouseUp:V,onDoubleClick:B,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:ce,height:le,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=In(t,r.filter(t=>t.roomId===e.id)),a=jn(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=Nn(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&&oe.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=Nn(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&&ae&&ae.points.map((e,t)=>(0,f.jsx)(`circle`,{cx:e.x,cy:e.y,r:3.5,className:Q.vertexHandle},t)),K&&(0,f.jsx)(`rect`,{x:K.x,y:K.y,width:K.w,height:K.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))]})]}),ae&&!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:ae.name,onChange:e=>H(e.target.value),placeholder:`Room name`}),(0,f.jsxs)(`button`,{className:Q.roomDrawerInfoDoorsBtn,onClick:()=>h(ae.id),title:`Edit doors`,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDoorOpen}),(0,f.jsx)(`span`,{children:r.filter(e=>e.roomId===ae.id).length})]}),(0,f.jsx)(`button`,{className:Q.roomDrawerInfoDelete,onClick:W,title:`Delete room`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faTrash})})]}),m&&q&&(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:q.name?`Doors · ${q.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:[oe.length===0&&(0,f.jsx)(`span`,{className:Q.roomDrawerDoorPanelEmpty,children:`Click on a wall to add a door`}),oe.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=>U(e.id,t.target.value)}),(0,f.jsx)(`button`,{className:Q.roomDrawerInfoDelete,onClick:()=>re(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`:`${Yn[a]} · Scroll to zoom · Middle-drag to pan · 0 to reset`})]})}var Zn={"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 Qn({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(Zn.roomViewerSelected,Zn.roomViewerTint);let[t]=e.querySelectorAll(`[id="background"]`);t&&t.classList.remove(Zn.roomViewerTint)}}if(a){a.classList.add(Zn.roomViewerSelected);let[e]=a.querySelectorAll(`[id="background"]`);(e??a).classList.add(Zn.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:Zn.roomViewer,ref:t,children:[(0,f.jsx)(`h3`,{className:Zn.roomViewerHeader,children:e[r]?.label??``}),(0,f.jsx)(`div`,{className:(0,l.default)(Zn.roomViewerContainer,a&&Zn.roomViewerContainerLoading),children:m},r),e.length>1&&(0,f.jsxs)(`div`,{className:Zn.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 $n={scrollbarProvider:`scrollbarProvider_IMBFu`};function er({className:e=void 0,children:t=void 0}){return(0,f.jsx)(`div`,{className:(0,l.default)($n.scrollbarProvider,e),children:t})}var tr=er,nr=function(e){return e.Text=`text`,e.Circle=`circle`,e.Rectangular=`rectangular`,e}({}),rr=function(e){return e.Shimmer=`shimmer`,e.Pulse=`pulse`,e.None=`none`,e}({}),ir={skeleton:`skeleton_TSg1y`,"skeleton-lines":`skeleton-lines_-Z-gf`,skeletonLines:`skeleton-lines_-Z-gf`,"skeleton-line-last":`skeleton-line-last_UFw21`,skeletonLineLast:`skeleton-line-last_UFw21`,"skeleton-text":`skeleton-text_Jlefj`,skeletonText:`skeleton-text_Jlefj`,"skeleton-circle":`skeleton-circle_t0bbj`,skeletonCircle:`skeleton-circle_t0bbj`,"skeleton-rectangular":`skeleton-rectangular_UtIyN`,skeletonRectangular:`skeleton-rectangular_UtIyN`,"skeleton-animation-pulse":`skeleton-animation-pulse_wGbPg`,skeletonAnimationPulse:`skeleton-animation-pulse_wGbPg`,skeletonPulse:`skeletonPulse_06yjn`,"skeleton-animation-shimmer":`skeleton-animation-shimmer_a0nwc`,skeletonAnimationShimmer:`skeleton-animation-shimmer_a0nwc`,skeletonShimmer:`skeletonShimmer_wLPXR`},ar={[nr.Text]:ir.skeletonText,[nr.Circle]:ir.skeletonCircle,[nr.Rectangular]:ir.skeletonRectangular},or={[rr.Shimmer]:ir.skeletonAnimationShimmer,[rr.Pulse]:ir.skeletonAnimationPulse,[rr.None]:void 0};function sr({variant:e=nr.Text,animation:t=rr.Shimmer,lines:n=1,className:r,style:i,classNames:a,styles:o,...s}){let c=ar[e],u=or[t];return e!==nr.Text||n<=1?(0,f.jsx)(`span`,{...s,className:(0,l.default)(ir.skeleton,c,u,r),style:i}):(0,f.jsx)(`span`,{...s,className:(0,l.default)(ir.skeletonLines,r),style:i,children:Array.from({length:n},(e,t)=>(0,f.jsx)(`span`,{className:(0,l.default)(ir.skeleton,c,u,t===n-1&&ir.skeletonLineLast,a?.line),style:o?.line},t))})}var cr={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 lr(){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 ur({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)(cr.stepper,{[cr.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)(cr.stepperEntry,{[cr.stepperEntryActive]:p},{[cr.stepperEntryDone]:s},{[cr.stepperClickable]:h},u?.entry),_=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`div`,{className:(0,l.default)(cr.stepperEntryNumber,{[cr.stepperEntryNumberDone]:s},u?.entryNumber),style:d?.entryNumber,children:s?(0,f.jsx)(lr,{}):o+1}),!a&&(0,f.jsx)(`div`,{className:(0,l.default)(cr.stepperEntryLabel,{[cr.stepperEntryLabelVertical]:m},u?.entryLabel),style:d?.entryLabel,children:n.label})]});return(0,f.jsxs)(c.default.Fragment,{children:[h?(0,f.jsx)(B,{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)(cr.stepperConnector,{[cr.stepperConnectorFilled]:s},{[cr.stepperConnectorVertical]:m},u?.connector),style:d?.connector})]},o)})})}var dr={sticky:`sticky_L6zO2`,"sticky-content":`sticky-content_ZaXTD`,stickyContent:`sticky-content_ZaXTD`,"sticky-content-stuck":`sticky-content-stuck_w-gRW`,stickyContentStuck:`sticky-content-stuck_w-gRW`,"sticky-placeholder":`sticky-placeholder_aJ3Sb`,stickyPlaceholder:`sticky-placeholder_aJ3Sb`};function fr({children:e,offsetTop:t=0,zIndex:n=20,disabled:r=!1,onStuckChange:i,className:a,style:o,classNames:s,styles:u,...d}){let p=(0,c.useRef)(null),m=(0,c.useRef)(null),[h,g]=(0,c.useState)(!1),[_,v]=(0,c.useState)({width:0,left:0,height:0}),y=(0,c.useRef)(i);(0,c.useEffect)(()=>{y.current=i},[i]);let b=(0,c.useCallback)(()=>{let e=p.current,n=m.current;if(!e||!n)return;let i=e.getBoundingClientRect();v({width:e.clientWidth,left:i.left,height:n.offsetHeight}),g(!r&&i.top<=t)},[r,t]);(0,c.useLayoutEffect)(()=>{b()},[b,e]),(0,c.useEffect)(()=>{let e=0,t=()=>{cancelAnimationFrame(e),e=requestAnimationFrame(b)};window.addEventListener(`scroll`,t,{passive:!0,capture:!0}),window.addEventListener(`resize`,t);let n=new ResizeObserver(t);return p.current&&n.observe(p.current),m.current&&n.observe(m.current),()=>{cancelAnimationFrame(e),window.removeEventListener(`scroll`,t,{capture:!0}),window.removeEventListener(`resize`,t),n.disconnect()}},[b]);let x=(0,c.useRef)(!0);(0,c.useEffect)(()=>{if(x.current){x.current=!1;return}y.current?.(h)},[h]);let S=h?{position:`fixed`,top:t,left:_.left,width:_.width,zIndex:n,...u?.content}:u?.content;return(0,f.jsxs)(`div`,{ref:p,className:(0,l.default)(dr.sticky,a,s?.root),style:{...u?.root,...o},...d,children:[h&&(0,f.jsx)(`div`,{"aria-hidden":!0,className:(0,l.default)(dr.stickyPlaceholder,s?.placeholder),style:{height:_.height,...u?.placeholder}}),(0,f.jsx)(`div`,{ref:m,className:(0,l.default)(dr.stickyContent,h&&dr.stickyContentStuck,s?.content),style:S,children:e})]})}var pr={switch:`switch_9TG2Y`,"switch-disabled":`switch-disabled_UL-F-`,switchDisabled:`switch-disabled_UL-F-`,"switch-track":`switch-track_awA-t`,switchTrack:`switch-track_awA-t`,"switch-track-checked":`switch-track-checked_boZKe`,switchTrackChecked:`switch-track-checked_boZKe`,"switch-thumb":`switch-thumb_4fUTo`,switchThumb:`switch-thumb_4fUTo`,"switch-thumb-checked":`switch-thumb-checked_GU--w`,switchThumbChecked:`switch-thumb-checked_GU--w`,"switch-label":`switch-label_3pLBQ`,switchLabel:`switch-label_3pLBQ`};function mr({label:e=``,selected:t=!1,onToggle:n=()=>{},className:r=``,style:i,disabled:a=!1,title:o=``,tabIndex:s=0,formValidator:u=null,children:d=null,classNames:p,styles:m,...h}){let[,g]=(0,c.useState)(0);(0,c.useEffect)(()=>{if(!u)return;let e=()=>g(e=>e+1);return u.registerOnUpdateListener(e),()=>u.removeOnUpdateListener(e)},[u]);function _(e){a||(u&&u.set(!u.value),n(!v,e))}let v=u?u.value:t;return(0,f.jsxs)(`div`,{...h,title:o,className:(0,l.default)(pr.switch,{[pr.switchDisabled]:a},r),style:i,onClick:_,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),_(e))},role:`switch`,"aria-checked":v,tabIndex:a?-1:s,children:[(0,f.jsx)(`div`,{className:(0,l.default)(pr.switchTrack,v&&pr.switchTrackChecked,p?.track),style:m?.track,children:(0,f.jsx)(`div`,{className:(0,l.default)(pr.switchThumb,v&&pr.switchThumbChecked,p?.thumb),style:m?.thumb})}),(d||e)&&(0,f.jsx)(`div`,{className:(0,l.default)(pr.switchLabel,p?.label),style:m?.label,children:d||e})]})}var hr={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 gr({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)(hr.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)(B,{role:`tab`,"aria-selected":r,"aria-disabled":e.disabled||void 0,tabIndex:e.disabled?-1:0,className:(0,l.default)(hr.tabHeaderTab,{[hr.tabHeaderTabActive]:r},{[hr.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)(hr.tabHeaderIcon,a?.icon),style:o?.icon}),i&&(0,f.jsxs)(`div`,{className:(0,l.default)(hr.tabHeaderLabels,a?.labels),style:o?.labels,children:[e.title&&(0,f.jsx)(`span`,{className:(0,l.default)(hr.tabHeaderTitle,a?.title),style:o?.title,children:e.title}),e.subtitle&&(0,f.jsx)(`span`,{className:(0,l.default)(hr.tabHeaderSubtitle,a?.subtitle),style:o?.subtitle,children:e.subtitle})]})]},e.id)})})}function _r(e){return(0,f.jsx)(Ne,{...e,multiline:!0})}var vr={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)`,"--button-default-color":`var(--primary-color)`,"--button-default-border":`1px solid var(--primary-color)`,"--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%)`,"--background-card-elevated":`var(--background-accent-light)`,"--background-card-outlined":`transparent`,"--background-card-filled":`var(--background-accent)`,"--spacing-s":`4px`,"--spacing-m":`8px`,"--spacing-l":`16px`}},yr={themeRoot:`themeRoot_oegLp`,colorFade:`colorFade_eLv2g`},br=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??[vr],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??[vr]).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:(0,l.default)(yr.themeRoot,n&&yr.colorFade),style:t,children:e})}};function xr(e=`default`){let[t,n]=(0,c.useState)(localStorage.getItem(`theme`)||e);return{currentThemeId:t,setCurrentThemeId:e=>{n(e),localStorage.setItem(`theme`,e)}}}var Sr=e=>(Math.trunc(e)%24+24)%24,Cr=e=>(Math.trunc(e)%60+60)%60;function wr(e){if(!e)return null;let t=e.match(/^(\d{1,2}):(\d{1,2})$/);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);return n>23||r>59?null:{hours:n,minutes:r}}function Tr(e){return e?`${String(Sr(e.hours)).padStart(2,`0`)}:${String(Cr(e.minutes)).padStart(2,`0`)}`:``}function Er(e,t){return Cr(!t||t<=1?e:Math.round(Cr(e)/t)*t)}var Dr=e=>e.hours*60+e.minutes;function Or(e,t,n){let r=Dr(e),i=wr(t),a=wr(n);return i&&(r=Math.max(r,Dr(i))),a&&(r=Math.min(r,Dr(a))),{hours:Math.floor(r/60),minutes:r%60}}function kr(e,t,n,r,i){let a=r*i*Math.PI/180;return{x:e+n*Math.sin(a),y:t-n*Math.cos(a)}}function Ar(e,t){return(Math.atan2(e,-t)*180/Math.PI+360)%360}var jr=(e,t)=>Math.sqrt(e*e+t*t),Mr={clockFace:`clockFace_LbXIa`,clockHand:`clockHand_E9nTw`,"clockHand-line":`clockHand-line_iOipC`,clockHandLine:`clockHand-line_iOipC`,"clockHand-center":`clockHand-center_VElxx`,clockHandCenter:`clockHand-center_VElxx`,"clockHand-knob":`clockHand-knob_Mb2Fx`,clockHandKnob:`clockHand-knob_Mb2Fx`,clockNumber:`clockNumber_qHDO8`,"clockNumber-inner":`clockNumber-inner_x2XR1`,clockNumberInner:`clockNumber-inner_x2XR1`,"clockNumber-selected":`clockNumber-selected_rPVlV`,clockNumberSelected:`clockNumber-selected_rPVlV`},Nr=50,Pr=40,Fr=25.5,Ir=65.5/2,Lr=30,Rr=6,zr=e=>(e+11)%12+1;function Br(e,t){if(e===`minutes`)return Array.from({length:12},(e,t)=>{let n=t*5;return{label:String(n).padStart(2,`0`),slot:t,value:n,ring:`outer`}});if(!t)return Array.from({length:12},(e,t)=>{let n=t===0?12:t;return{label:String(n),slot:t,value:n,ring:`outer`}});let n=Array.from({length:12},(e,t)=>{let n=t===0?12:t;return{label:String(n),slot:t,value:n,ring:`outer`}}),r=Array.from({length:12},(e,t)=>{let n=t===0?0:t+12;return{label:String(n).padStart(2,`0`),slot:t,value:n,ring:`inner`}});return[...n,...r]}function Vr({time:e,mode:t,use24Hour:n,minuteStep:r,onChange:i,onCommit:a,classNames:o,styles:s}){let u=(0,c.useRef)(null),d=(0,c.useRef)(!1),p=Br(t,n),m=e.hours>=12,h=zr(e.hours),g=t===`minutes`?{slot:e.minutes,radius:Pr}:n?e.hours===0?{slot:0,radius:Fr}:e.hours<=12?{slot:e.hours%12,radius:Pr}:{slot:(e.hours-12)%12,radius:Fr}:{slot:h%12,radius:Pr},_=kr(Nr,Nr,g.radius,g.slot,t===`minutes`?Rr:Lr),v=i=>t===`minutes`?Er(e.minutes,r)===i.value||e.minutes===i.value:n?e.hours===i.value:h===i.value,y=(i,a)=>{let o=u.current?.getBoundingClientRect();if(!o)return e;let s=i-(o.left+o.width/2),c=a-(o.top+o.height/2),l=Ar(s,c);if(t===`minutes`){let t=Er(Math.round(l/Rr),r);return{hours:e.hours,minutes:t}}let d=Math.round(l/Lr)%12;if(!n){let t=d===0?12:d;return{hours:Sr(m?t%12+12:t%12),minutes:e.minutes}}return{hours:Sr(jr(s,c)/(o.width/2)*Nr<Ir?d===0?0:d+12:d===0?12:d),minutes:e.minutes}};return(0,f.jsxs)(`div`,{ref:u,className:(0,l.default)(Mr.clockFace,o?.clockFace),style:s?.clockFace,onPointerDown:e=>{d.current=!0,e.currentTarget.setPointerCapture?.(e.pointerId),i(y(e.clientX,e.clientY))},onPointerMove:e=>{d.current&&i(y(e.clientX,e.clientY))},onPointerUp:e=>{d.current&&(d.current=!1,a(y(e.clientX,e.clientY)))},role:`slider`,"aria-label":t===`minutes`?`Minutes`:`Hours`,"aria-valuetext":t===`minutes`?`${e.minutes} minutes`:`${e.hours} hours`,children:[(0,f.jsxs)(`svg`,{className:Mr.clockHand,viewBox:`0 0 100 100`,"aria-hidden":!0,children:[(0,f.jsx)(`circle`,{cx:Nr,cy:Nr,r:1.8,className:Mr.clockHandCenter}),(0,f.jsx)(`line`,{x1:Nr,y1:Nr,x2:_.x,y2:_.y,className:Mr.clockHandLine}),(0,f.jsx)(`circle`,{cx:_.x,cy:_.y,r:7,className:(0,l.default)(Mr.clockHandKnob,o?.clockHand),style:s?.clockHand})]}),p.map(e=>{let t=kr(Nr,Nr,e.ring===`inner`?Fr:Pr,e.slot,Lr),n=v(e);return(0,f.jsx)(`div`,{className:(0,l.default)(Mr.clockNumber,e.ring===`inner`&&Mr.clockNumberInner,n&&Mr.clockNumberSelected,o?.clockNumber),style:{left:`${t.x}%`,top:`${t.y}%`,...s?.clockNumber},children:e.label},`${e.ring}-${e.value}`)})]})}var Hr={timeInput:`timeInput_EbsZN`,"timeInput-clock":`timeInput-clock_D1-dk`,timeInputClock:`timeInput-clock_D1-dk`,"timeInput-clockHeader":`timeInput-clockHeader_bsYNW`,timeInputClockHeader:`timeInput-clockHeader_bsYNW`,"timeInput-headerSegment":`timeInput-headerSegment_Oiu7e`,timeInputHeaderSegment:`timeInput-headerSegment_Oiu7e`,"timeInput-headerSegment-active":`timeInput-headerSegment-active_-Funz`,timeInputHeaderSegmentActive:`timeInput-headerSegment-active_-Funz`,"timeInput-headerColon":`timeInput-headerColon_LwyQH`,timeInputHeaderColon:`timeInput-headerColon_LwyQH`,"timeInput-meridiem":`timeInput-meridiem_tk9km`,timeInputMeridiem:`timeInput-meridiem_tk9km`,"timeInput-meridiem-active":`timeInput-meridiem-active_40uHm`,timeInputMeridiemActive:`timeInput-meridiem-active_40uHm`,"timeInput-footer":`timeInput-footer_NCXsB`,timeInputFooter:`timeInput-footer_NCXsB`};function Ur({value:e,selected:t,onChange:n=()=>null,onSelect:r=()=>null,formValidator:i=null,isInline:a=!1,isModal:o=!1,noInput:s=!1,noHeader:p=!1,showClearButton:m=!1,showNowButton:g=!1,minuteStep:_=1,use24Hour:v=!0,minTime:y=null,maxTime:b=null,label:x=``,isValid:S=!0,errorMessage:C=``,isRequired:w=!1,disabled:T=!1,className:E=``,style:D,classNames:O,styles:k,...A}){let M=()=>i?i.value||``:e??t??``,[N,P]=(0,c.useState)(M),[F,I]=(0,c.useState)(!1),[ee,te]=(0,c.useState)(`hours`),[R,z]=(0,c.useState)(!1),[B,ne]=(0,c.useState)(!1),[,V]=(0,c.useState)(0),H=M(),[U,W]=(0,c.useState)(H),re=(0,c.useRef)(i);!i&&U!==H&&(W(H),P(H)),(0,c.useEffect)(()=>{if(re.current=i,!i)return;let e=()=>{P(i.value||``),V(e=>e+1)};return i.registerOnUpdateListener(e),()=>i.removeOnUpdateListener(e)},[i]);let G=()=>i?i.touched&&i.hasError():!S||!!C,ie=()=>!!(w||i?.validators.find(e=>e.validatorId===`required`)),K=e=>{let t=e?Tr(e):null;i&&i.set(t),n?.(t)},ae=e=>{P(e?Tr(e):``),K(e)},q=wr(N),oe=q??{hours:12,minutes:0},se=e=>{ae(Or({hours:e.hours,minutes:Er(e.minutes,_)},y,b))},ce=e=>{let t=Or({hours:e.hours,minutes:Er(e.minutes,_)},y,b);if(ae(t),ee===`hours`){te(`minutes`);return}r?.(Tr(t)),a||I(!1)},le=()=>{T||(te(`hours`),I(!0))},J=({previousState:e,nextState:t})=>{if(!e||t.value===e.value)return t;let n=t.value,r=n.slice(0,2);/^\d\d$/.test(r)&&Number(r)>23&&(n=`23${n.slice(2)}`);let i=n.slice(3,5);return/^\d\d$/.test(i)&&Number(i)>59&&(n=`${n.slice(0,3)}59`),n===t.value?t:{...t,value:n}},ue=e=>{P(e);let t=wr(e);t&&K(t)},de=()=>{re.current&&(re.current.touched=!0),z(!1),K(wr(N))},fe=e=>{e!==oe.hours>=12&&ae({hours:Sr(oe.hours+(e?12:-12)),minutes:oe.minutes})},pe=G(),me=q?String(v?q.hours:(q.hours+11)%12+1).padStart(2,`0`):`--`,he=q?String(q.minutes).padStart(2,`0`):`--`,ge=p?null:(0,f.jsxs)(`div`,{className:(0,l.default)(Hr.timeInputClockHeader,O?.clockHeader),style:k?.clockHeader,children:[(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(Hr.timeInputHeaderSegment,ee===`hours`&&Hr.timeInputHeaderSegmentActive,O?.headerSegment),style:k?.headerSegment,onClick:()=>te(`hours`),children:me}),(0,f.jsx)(`span`,{className:Hr.timeInputHeaderColon,children:`:`}),(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(Hr.timeInputHeaderSegment,ee===`minutes`&&Hr.timeInputHeaderSegmentActive,O?.headerSegment),style:k?.headerSegment,onClick:()=>te(`minutes`),children:he}),!v&&(0,f.jsxs)(`div`,{className:(0,l.default)(Hr.timeInputMeridiem,O?.meridiem),style:k?.meridiem,children:[(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(oe.hours<12&&Hr.timeInputMeridiemActive),onClick:()=>fe(!1),children:`AM`}),(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(oe.hours>=12&&Hr.timeInputMeridiemActive),onClick:()=>fe(!0),children:`PM`})]})]}),_e=m||g?(0,f.jsxs)(`div`,{className:(0,l.default)(Hr.timeInputFooter,O?.footer),style:k?.footer,children:[g&&(0,f.jsx)(L,{styleType:j.Default,onClick:()=>{let e=new Date;se({hours:e.getHours(),minutes:e.getMinutes()})},children:`Now`}),m&&(0,f.jsx)(L,{styleType:j.Default,onClick:()=>{ae(null),r?.(null)},children:`Clear`})]}):null,ve=(0,f.jsxs)(`div`,{className:(0,l.default)(Hr.timeInputClock,O?.clock),style:k?.clock,children:[ge,(0,f.jsx)(Vr,{time:oe,mode:ee,use24Hour:v,minuteStep:_,onChange:se,onCommit:ce,classNames:O,styles:k}),_e]}),ye=s?null:(0,f.jsx)(Ne,{label:`${x}${ie()?` *`:``}`,value:N,icon:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faClock}),onIconClick:le,onClick:le,readOnly:o,disabled:T,isValid:!pe,customInput:(0,f.jsx)(h.default,{mask:`99:99`,maskPlaceholder:`_`,beforeMaskedStateChange:J}),onChange:e=>ue(e),onBlur:de,onFocus:()=>z(!0),onMouseEnter:()=>ne(!0),onMouseLeave:()=>ne(!1)}),be=a?ve:o?(0,f.jsx)(Ke,{hideHeader:!0,isOpen:F,onClose:()=>I(!1),children:ve}):(0,f.jsx)(ke,{isOpen:F,onOpenChange:I,content:ve,align:De.Left,dontCloseOnChildClick:!0,children:ye});return(0,f.jsxs)(`div`,{className:(0,l.default)(Hr.timeInput,O?.root,E),style:{...k?.root,...D},...A,children:[(o||a)&&ye,be,(0,f.jsx)(je,{variant:`error`,message:i?i.getCurrentErrorMessage()??``:C||``,isVisible:pe&&(R||B)})]})}var Wr={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-paused":`toast-paused_NPmT4`,toastPaused:`toast-paused_NPmT4`,toastProgressBar:`toastProgressBar_6vBs6`,"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`,toastShrink:`toastShrink_h89HS`},Gr={info:d.faCircleInfo,success:d.faCircleCheck,error:d.faCircleXmark,warn:d.faTriangleExclamation,default:d.faBell};function Kr({item:e,isBottom:t,onDismiss:n}){let{id:r,content:i,options:a,dismissing:o}=e,{duration:s,showRemainingTime:p,showCloseButton:m,pauseOnHover:h,type:g,classNames:_,styles:v}=a,[y,b]=(0,c.useState)(!1),[x,S]=(0,c.useState)(!1),C=h&&(y||x),w=(0,c.useRef)(s);return(0,c.useEffect)(()=>{if(s===0||C)return;let e=Date.now(),t=setTimeout(()=>n(r),w.current);return()=>{clearTimeout(t),w.current-=Date.now()-e}},[r,s,n,C]),(0,f.jsxs)(`div`,{className:(0,l.default)(Wr.toast,t?Wr.toastBottom:null,Wr[`toast-${g}`],o&&Wr.toastDismissing,C&&Wr.toastPaused,_?.root),style:v?.root,onMouseEnter:h?()=>b(!0):void 0,onMouseLeave:h?()=>b(!1):void 0,onFocus:h?()=>S(!0):void 0,onBlur:h?()=>S(!1):void 0,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:Gr[g],className:(0,l.default)(Wr.toastIcon,_?.icon),style:v?.icon}),(0,f.jsx)(`div`,{className:(0,l.default)(Wr.toastContent,_?.content),style:v?.content,children:i}),m&&(0,f.jsx)(V,{icon:d.faXmark,onClick:()=>n(r),className:(0,l.default)(Wr.toastCloseButton,_?.closeButton),style:v?.closeButton,"aria-label":`Close`}),p&&s>0&&(0,f.jsx)(`div`,{className:(0,l.default)(Wr.toastProgressBar,_?.progressBar),style:{"--toast-duration":`${s}ms`,...v?.progressBar}})]})}var qr=null;function Jr(e){qr=e}function Yr(){qr=null}function Xr(e,t){if(!qr){console.error(`[Toast] No ToastProvider found. Wrap your app with <ToastProvider>.`);return}qr(e,t)}var Zr={position:`top-right`,duration:4e3,showRemainingTime:!0,showCloseButton:!0,allowStacking:!0,pauseOnHover:!0},Qr=220;function $r(e){return Wr[`container-${e}`]}function ei({children:e,position:t=Zr.position,duration:n=Zr.duration,showRemainingTime:r=Zr.showRemainingTime,showCloseButton:i=Zr.showCloseButton,allowStacking:a=Zr.allowStacking,pauseOnHover:o=Zr.pauseOnHover}){let[s,u]=(0,c.useState)([]),d=(0,c.useRef)(0),p=(0,c.useCallback)(e=>{u(t=>t.map(t=>t.id===e?{...t,dismissing:!0}:t)),setTimeout(()=>{u(t=>t.filter(t=>t.id!==e))},Qr)},[]),m=(0,c.useCallback)((e,s)=>{let c={position:s?.position??t,duration:s?.duration??n,showRemainingTime:s?.showRemainingTime??r,showCloseButton:s?.showCloseButton??i,pauseOnHover:s?.pauseOnHover??o,type:s?.type??`default`,classNames:s?.classNames,styles:s?.styles};d.current+=1;let l={id:`toast-${d.current}`,content:e,options:c,dismissing:!1};u(e=>!a&&e.length>0?(setTimeout(()=>{u([l])},Qr),e.map(e=>({...e,dismissing:!0}))):[...e,l])},[t,n,r,i,a,o]);(0,c.useEffect)(()=>(Jr(m),()=>Yr()),[m]);let h=s.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)(ce,{children:Object.entries(h).map(([e,t])=>(0,f.jsx)(`div`,{className:(0,l.default)(Wr.container,$r(e)),children:t.map(t=>(0,f.jsx)(Kr,{item:t,isBottom:e.startsWith(`bottom`),onDismiss:p},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 ti({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 ni(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 ri(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 ii(e,t,n,r,i){if(i===0)return{startIndex:0,endIndex:-1};let a=ri(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 ai(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 oi(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 si(e,t){let n=t[e],r=e+1;for(;r<t.length&&t[r]>n;)r++;return r-1}function ci(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 li=`ahroweui:virtuallist:columns:`;function ui(e){if(!e||typeof window>`u`)return null;try{let t=window.localStorage.getItem(li+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 di(e,t){return t&&t.known.includes(e.key)?t.visible.includes(e.key):!e.defaultHidden}function fi(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 pi({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)(()=>fi(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=fi(i,S.current);g(t=>t===e?t:e)},[i,p,d]);let{offsets:A,totalHeight:j}=(0,c.useMemo)(()=>ni(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=ri(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)(()=>ii(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 mi({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 hi({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=ui(a);return new Set((e??[]).filter(e=>di(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=ui(a);b(e=>{let n=new Set;for(let i of t)r.has(i.key)?e.has(i.key)&&n.add(i.key):di(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(li+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 `:``}${ci(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 I=(0,c.useCallback)(()=>v({}),[]);function ee(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:ee,recalculateColumns:I}}function gi({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),[I]=(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 ee(e){w.current=!!e.target.closest(`[data-drag-handle]`)}function L(e,n){if(a&&!w.current){n.preventDefault();return}p.current=e,h(e),t&&_(null)}function te(e,t,n){let r=p.current;if(r==null)return null;let i=s.indexOf(r);if(i!==-1&&e>=i&&e<=si(i,l))return null;let a=oi(t,n.top,n.height,u(e));return{key:s[e],position:a}}function R(e,t){t.preventDefault();let n=t.currentTarget.getBoundingClientRect(),r=te(e,t.clientY,n);_(e=>e?.key===r?.key&&e?.position===r?.position?e:r)}function z(){let e=p.current,t=v.current;e!=null&&t&&t.key!==e&&r?.(e,t)}function B(e){e.preventDefault(),z(),_(null),p.current=null,h(null)}function ne(){_(null),p.current=null,h(null)}function V(e,t){t.preventDefault();let r=p.current;if(r==null)return;let i=s.indexOf(r),a=t.currentTarget.getBoundingClientRect(),o=ai(i,e,t.clientY,a.top,a.height);o!=null&&n?.(i,o)}function H(){p.current=null,h(null)}let U=(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<=si(s,t)){_(null);return}let n=oi(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=ai(s,o,r,c.top,c.height);l!=null&&y.current?.(s,l)},[d,f]),W=(0,c.useCallback)(()=>{let e=M.current;e&&(e.style.transform=`translate(${P.current}px, ${k.current-N.current}px)`)},[]),re=(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,U(n)),A.current=requestAnimationFrame(re)},[U,d]),G=(0,c.useCallback)(()=>{if(T.current!=null&&(clearTimeout(T.current),T.current=null),window.removeEventListener(`touchmove`,ie),window.removeEventListener(`touchend`,G),window.removeEventListener(`touchcancel`,G),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)},[]),ie=(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(),W(),U(t.clientX)}},[U,W]);function K(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`,ie,{passive:!1}),window.addEventListener(`touchend`,G),window.addEventListener(`touchcancel`,G),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`,ae(n),A.current??=requestAnimationFrame(re)},i))}function ae(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:`3`,background:`var(--background)`,boxShadow:`var(--card-shadow)`,borderRadius:`var(--default-border-radius)`}),t.appendChild(a),M.current=a,W()}(0,c.useEffect)(()=>G,[G]);let q=e||t;function oe(n,r){let i=t&&g?.key===r?g.position:void 0;return{reorderable:q&&!a,draggable:q&&!I||void 0,isDragging:q&&r===m,onMouseDown:q&&a?ee:void 0,onDragStart:q?e=>L(r,e):void 0,onDragOver:t?e=>R(n,e):e?e=>V(n,e):void 0,onDragEnd:t?ne:e?H:void 0,onDrop:t?B:void 0,onTouchStart:q?e=>K(r,e):void 0,dropPosition:i,dropIndentPx:i?(l[n]??0)*o:void 0}}function se(){return j.current?(j.current=!1,!0):!1}return{draggingKey:m,dragEnabled:q,getRowDragProps:oe,consumeSuppressedClick:se}}function _i({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:I=!0,rowHover:ee=!0,className:L,style:te,classNames:R,styles:z,...B},ne){let V=(0,c.useCallback)((e,t)=>m?m(e,t):t,[m]),H=(0,c.useMemo)(()=>e.map((e,t)=>V(e,t)),[e,V]),U=(0,c.useMemo)(()=>j?e.map((e,t)=>j(e,t)):[],[e,j]),W=(0,c.useCallback)(t=>M?M(e[t],t):!1,[M,e]),re=pi({items:e,keys:H,getItemKey:m,estimatedRowHeight:i,rowGap:o,overscan:a,onLoadMore:b,loadMoreThreshold:x}),{rootRef:G,headerRef:ie,rowObserver:K,keysRef:ae,offsets:q,totalHeight:oe,startIndex:se,endIndex:ce}=re,le=mi({items:e,getKey:V,multiSelect:C,selectedKeys:w,onSelectionChange:T}),{effectiveSelectedKeys:J}=le,{hasColumns:ue,visibleColumns:de,columnTemplate:fe,shouldShowToggle:pe,effectiveVisible:me,manuallyHiddenCount:he,toggleOpen:ge,setToggleOpen:ve,toggleRef:ye,handleToggleColumn:be,recalculateColumns:xe}=hi({columns:n,items:e,multiSelect:C,visibleColumnKeys:g,onVisibleColumnsChange:_,persistColumnsKey:v,showColumnToggle:y,rootRef:G,startIndex:se,endIndex:ce,containerHeight:re.containerHeight,containerWidth:re.containerWidth});(0,c.useImperativeHandle)(ne,()=>({...re.scrollApi,recalculateColumns:xe}),[re.scrollApi,xe]);let Se=gi({reorderable:E,treeReorder:k,onReorder:D,onTreeDrop:N,longPressDelay:O,dragHandle:F,treeIndentPx:P,keys:H,depths:U,isGroupAt:W,rootRef:G,keysRef:ae}),Ce=typeof s==`number`?`${s}px`:s,we=n=>{let r=e[n],i=V(r,n),a=p!=null&&i===p||J.has(i),o=Se.getRowDragProps(n,i);return(0,f.jsx)(ti,{index:n,top:q[n],padding:Ce,columnTemplate:fe,isSelected:a,showDivider:I,hover:ee,onClick:()=>{Se.consumeSuppressedClick()||h?.(r,n)},observer:K,ariaRowIndex:ue?n+2:void 0,ariaPosInSet:ue?void 0:n+1,ariaSetSize:ue?void 0:e.length,rowRole:ue?`row`:`listitem`,reserveToggleGutter:pe,...o,dropIndicatorClassName:R?.dropIndicator,dropIndicatorStyle:z?.dropIndicator,rowClassName:R?.row,rowStyle:z?.row,children:ue?(0,f.jsxs)(f.Fragment,{children:[C&&(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListSelectCell,R?.selectCell),style:z?.selectCell,role:`gridcell`,onClick:e=>e.stopPropagation(),children:(0,f.jsx)(_e,{selected:J.has(i),onToggle:()=>le.handleRowSelect(i),"aria-label":`Select row`})}),de.map(e=>(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListCell,R?.cell),style:z?.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)},Te=[];for(let e=se;e<=ce;e++)Te.push(we(e));let Ee=Se.draggingKey==null?-1:H.indexOf(Se.draggingKey);return Ee>=0&&(Ee<se||Ee>ce)&&Te.push(we(Ee)),(0,f.jsxs)(`div`,{...B,ref:G,className:(0,l.default)($.virtualList,Se.draggingKey!=null&&$.virtualListReordering,L,R?.root),style:{height:r,...te,...z?.root},onScroll:re.handleScroll,role:ue?`grid`:`list`,"aria-rowcount":ue?e.length+1:void 0,children:[ue&&(0,f.jsxs)(`div`,{ref:ie,className:(0,l.default)($.virtualListHeader,R?.header),style:{gridTemplateColumns:fe,...pe?{paddingRight:32}:{},...z?.header},role:`row`,"aria-rowindex":1,children:[C&&(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListSelectCell,R?.selectCell),style:z?.selectCell,role:`columnheader`,children:(0,f.jsx)(_e,{selected:le.allSelected||le.someSelected,onToggle:le.handleSelectAll,"aria-label":`Select all rows`})}),de.map(e=>(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListHeaderCell,R?.headerCell),style:z?.headerCell,role:`columnheader`,"data-fit-key":e.width.type===`fit`?e.key:void 0,children:e.label},e.key)),pe&&(0,f.jsxs)(`div`,{ref:ye,className:$.virtualListToggleWrapper,children:[(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)($.virtualListHeaderToggle,R?.headerToggle),style:z?.headerToggle,onClick:()=>ve(e=>!e),"aria-label":`Toggle column visibility`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faGear,style:z?.headerToggle})}),he>0&&(0,f.jsx)(`span`,{className:(0,l.default)($.virtualListColumnChip,R?.columnChip),style:z?.columnChip,"data-column-hidden-count":he,"aria-label":`${he} columns hidden`,children:he}),ge&&(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListTogglePopover,R?.togglePopover),style:z?.togglePopover,children:n.map(e=>(0,f.jsx)(_e,{className:(0,l.default)($.virtualListToggleItem,R?.toggleItem),style:z?.toggleItem,selected:me.has(e.key),onToggle:()=>be(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,R?.body),style:{height:oe,...z?.body},children:Te}),re.showLoadMoreSpinner&&(0,f.jsx)(`div`,{className:(0,l.default)($.virtualListLoadingIndicator,R?.loadingIndicator),style:z?.loadingIndicator,children:(0,f.jsx)(A,{className:$.virtualListSpinner})})]})}var vi=c.default.forwardRef(_i),yi={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 bi({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)(yi.wizard,a?.root,r),style:y,children:(0,f.jsx)(`div`,{className:(0,l.default)(yi.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)(yi.wizardContent,a?.step),style:{width:`${100/t}%`,marginLeft:`${100/t*i}%`,...o?.step},children:(0,f.jsx)(`div`,{className:(0,l.default)({[yi.wizardContentOutOfFrame]:e!==i&&!p},a?.stepContent),style:o?.stepContent,inert:e===i?void 0:!0,children:n(i)})},`wizardStep${i}`))})})}function xi(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 Si=class{#e;#t;#n;#r;#i;constructor(e,t=null,{initialValues:n,onSubmit:r=()=>void 0,onValidate:i=()=>void 0,errorParser:a=xi,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 Ci(e){return function({children:t,...n}){return(0,f.jsx)(`form`,{onSubmit:e.submit,noValidate:!0,...n,children:t})}}var wi=e=>{Xr(e[0].message,{type:`error`})},Ti=class extends Si{constructor(e,t=null,n){super(e,t,{...n,onSubmitError:n?.onSubmitError??wi}),this.Form=Ci(this)}},Ei=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}};Ei.prototype.toString=function(){return`${this.value}`};function Di(e){return/^[0-9]+$/.test(e)}function Oi(e){return/^[0-9]{2}.[0-9]{2}.[0-9]{4}$/.test(e)}function ki(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 Ai(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 ji(e){return/^[A-Z]{6}[A-Z\d]{2}([A-Z\d]{3})?$/.test(e)}function Mi(e){return/[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}(\/[-a-zA-Z0-9@:%_+.~#?&//=]*)?$/.test(e)}function Ni(e){return/^[\w!@#$%^&*?±§~`'"/\\[\]{}\-,.();:><+=|öäüÖÄÜß €μ]{8,}$/.test(e)}function Pi(e){return/^(?=.*[a-zöäüA-ZÖÄÜß])/.test(e)}function Fi(e){return/^(?=.*\d)/.test(e)}function Ii(e){return Ni(e)&&Pi(e)&&Fi(e)}var Li={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},Ri=class e{static{this.minLength=(e,t)=>n=>!n||n.length<e?{id:`minLength`,message:t||Li.t(`formValidators.minLength`,{min:e})}:null}static{this.maxLength=(e,t)=>n=>n&&n.length>e?{id:`maxLength`,message:t||Li.t(`formValidators.maxLength`,{max:e})}:null}static{this.email=e=>t=>t&&!Ai(t)?{id:`email`,message:e||Li.t(`formValidators.email`)}:null}static{this.required=e=>{function t(t,n){return!t&&t!==0?{id:`required`,message:e||Li.t(`formValidators.required`,{label:n||Li.t(`formValidators.value`)})}:null}return t.validatorId=`required`,t}}static{this.mustBeNumber=e=>t=>t&&Number.isNaN(+t)?{id:`mustBeNumber`,message:e||Li.t(`formValidators.mustBeNumber`)}:null}static{this.oneOf=(e,t)=>n=>n&&!e.includes(n)?{id:`oneOf`,message:t||Li.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(!Ai(n[t]))return{id:`multiEmail`,message:e||Li.t(`formValidators.multiEmail`)}}return null}}static{this.date=e=>t=>t&&!Oi(t)&&!ki(t)?{id:`date`,message:e||Li.t(`formValidators.date`)}:null}static{this.dateObject=e=>t=>t&&!t.isValid?{id:`date`,message:e||Li.t(`formValidators.date`)}:null}static{this.website=e=>t=>t&&!Mi(t)?{id:`website`,message:e||Li.t(`garages.errors.website`)}:null}static{this.bic=e=>t=>t&&!ji(t)?{id:`bic`,message:e||Li.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||Li.t(`formValidators.minLetters`,{smart_count:e})}:null}static{this.minDigits=(e,t)=>n=>n&&n.replace(/[\D]/g,``).length<e?{id:`minDigits`,message:t||Li.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}}},zi=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)(je,{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 Bi(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 Vi(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 Ti(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=te,exports.ActionIcon=V,exports.Align=De,exports.Avatar=oe,exports.AvatarGroup=se,exports.Badge=ie,exports.BadgePosition=U,exports.BadgeStyleType=H,exports.BodyEnd=ce,exports.Button=L,exports.ButtonSize=M,exports.ButtonStyleType=j,exports.ButtonType=N,exports.Card=de,exports.CardActions=he,exports.CardContent=me,exports.CardHeader=fe,exports.CardMedia=pe,exports.CardStyleType=le,exports.Checkbox=_e,exports.Chip=xe,exports.ChipContainer=Se,exports.ChipStyleType=ve,exports.ColorPicker=We,exports.ConfirmModal=qe,exports.DatePicker=xt,exports.Drawer=Ct,exports.DropZone=At,exports.DropZoneReturnType=wt,exports.DropZoneStatus=Z,exports.Dropdown=yt,exports.EmptyState=Mt,exports.Fab=Lt,exports.FloatingMenu=ke,exports.FormValidator=Ei,exports.FormValidatorGroup=Ti,exports.IconLoading=dn,exports.IconPicker=Vt,exports.IdleManager=Ut,exports.InfiniteBlock=vt,exports.Input=Ne,exports.InputDropdown=qt,exports.InputType=Me,exports.InteractableDiv=B,exports.KanbanBoard=Zt,exports.KanbanColumn=Xt,exports.KlipyPicker=cn,exports.Modal=Ke,exports.NumberInput=mn,exports.OptionPicker=gn,exports.Overscroll=bn,exports.ProgressBar=Cn,exports.Ripple=F,exports.RoomDrawer=Xn,exports.RoomViewer=Qn,exports.ScrollbarProvider=tr,exports.SearchInput=tn,exports.Skeleton=sr,exports.SkeletonAnimation=rr,exports.SkeletonVariant=nr,exports.SpinnerLoading=A,exports.Stepper=ur,exports.Sticky=fr,exports.Switch=mr,exports.TabHeader=gr,exports.Textarea=_r,exports.ThemeProvider=br,exports.TimeInput=Ur,exports.ToastProvider=ei,exports.Tooltip=je,exports.ValidatableComponent=zi,exports.Validators=Ri,exports.VirtualList=vi,exports.Wizard=bi,exports.defaultTheme=vr,exports.getLocale=tt,exports.hasEightPasswordChars=Ni,exports.hasOnePasswordDigit=Fi,exports.hasOnePasswordLetter=Pi,exports.isBic=ji,exports.isDate=Oi,exports.isEmail=Ai,exports.isISODate=ki,exports.isNumber=Di,exports.isPassword=Ii,exports.isURL=Mi,exports.mapLocale=Qe,exports.setLocale=et,exports.showToast=Xr,exports.useFormValidator=Bi,exports.useFormValidatorGroup=Vi,exports.useTheme=xr;
6
6
  //# sourceMappingURL=index.cjs.map