@modern-admin/web 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/index.js.map +1 -1
- package/dist/standalone/assets/ai-assistant-widget-D2wY2KOL.js +2 -0
- package/dist/standalone/assets/ai-assistant-widget-D2wY2KOL.js.br +0 -0
- package/dist/standalone/assets/ai-assistant-widget-D2wY2KOL.js.gz +0 -0
- package/dist/standalone/assets/ai-assistant-widget-D2wY2KOL.js.map +1 -0
- package/dist/standalone/assets/audit-log-page-BGeo-dZh.js +2 -0
- package/dist/standalone/assets/audit-log-page-BGeo-dZh.js.br +0 -0
- package/dist/standalone/assets/audit-log-page-BGeo-dZh.js.gz +0 -0
- package/dist/standalone/assets/audit-log-page-BGeo-dZh.js.map +1 -0
- package/dist/standalone/assets/badge-6nyM5Jft.js +2 -0
- package/dist/standalone/assets/badge-6nyM5Jft.js.map +1 -0
- package/dist/standalone/assets/bot-DFDgGfNj.js +2 -0
- package/dist/standalone/assets/bot-DFDgGfNj.js.map +1 -0
- package/dist/standalone/assets/card-4cS4uWCP.js +2 -0
- package/dist/standalone/assets/card-4cS4uWCP.js.br +0 -0
- package/dist/standalone/assets/card-4cS4uWCP.js.gz +0 -0
- package/dist/standalone/assets/card-4cS4uWCP.js.map +1 -0
- package/dist/standalone/assets/clock-OCmX6DtA.js +2 -0
- package/dist/standalone/assets/clock-OCmX6DtA.js.map +1 -0
- package/dist/standalone/assets/command-D6MN0l5a.js +2 -0
- package/dist/standalone/assets/command-D6MN0l5a.js.br +0 -0
- package/dist/standalone/assets/command-D6MN0l5a.js.gz +0 -0
- package/dist/standalone/assets/command-D6MN0l5a.js.map +1 -0
- package/dist/standalone/assets/createLucideIcon-CUopU_LC.js +2 -0
- package/dist/standalone/assets/createLucideIcon-CUopU_LC.js.br +0 -0
- package/dist/standalone/assets/createLucideIcon-CUopU_LC.js.gz +0 -0
- package/dist/standalone/assets/createLucideIcon-CUopU_LC.js.map +1 -0
- package/dist/standalone/assets/dist-ByGEq5Uu.js +2 -0
- package/dist/standalone/assets/dist-ByGEq5Uu.js.br +0 -0
- package/dist/standalone/assets/dist-ByGEq5Uu.js.gz +0 -0
- package/dist/standalone/assets/dist-ByGEq5Uu.js.map +1 -0
- package/dist/standalone/assets/dist-Dpg8xy_r.js +2 -0
- package/dist/standalone/assets/dist-Dpg8xy_r.js.br +0 -0
- package/dist/standalone/assets/dist-Dpg8xy_r.js.gz +0 -0
- package/dist/standalone/assets/dist-Dpg8xy_r.js.map +1 -0
- package/dist/standalone/assets/edit-page-CYRW56vh.js +2 -0
- package/dist/standalone/assets/edit-page-CYRW56vh.js.br +0 -0
- package/dist/standalone/assets/edit-page-CYRW56vh.js.gz +0 -0
- package/dist/standalone/assets/edit-page-CYRW56vh.js.map +1 -0
- package/dist/standalone/assets/empty-6O1hDBF_.js +2 -0
- package/dist/standalone/assets/empty-6O1hDBF_.js.br +0 -0
- package/dist/standalone/assets/empty-6O1hDBF_.js.gz +0 -0
- package/dist/standalone/assets/empty-6O1hDBF_.js.map +1 -0
- package/dist/standalone/assets/file-text-CcLZq8HA.js +2 -0
- package/dist/standalone/assets/file-text-CcLZq8HA.js.map +1 -0
- package/dist/standalone/assets/folder-symlink-7nZ69llY.js +2 -0
- package/dist/standalone/assets/folder-symlink-7nZ69llY.js.br +0 -0
- package/dist/standalone/assets/folder-symlink-7nZ69llY.js.gz +0 -0
- package/dist/standalone/assets/folder-symlink-7nZ69llY.js.map +1 -0
- package/dist/standalone/assets/global-search-dialog-CTNjBSqC.js +2 -0
- package/dist/standalone/assets/global-search-dialog-CTNjBSqC.js.br +0 -0
- package/dist/standalone/assets/global-search-dialog-CTNjBSqC.js.gz +0 -0
- package/dist/standalone/assets/global-search-dialog-CTNjBSqC.js.map +1 -0
- package/dist/standalone/assets/heavy-fields-D1eCRvg3.js +181 -0
- package/dist/standalone/assets/heavy-fields-D1eCRvg3.js.br +0 -0
- package/dist/standalone/assets/heavy-fields-D1eCRvg3.js.gz +0 -0
- package/dist/standalone/assets/heavy-fields-D1eCRvg3.js.map +1 -0
- package/dist/standalone/assets/home-page-DMm-R675.js +60 -0
- package/dist/standalone/assets/home-page-DMm-R675.js.br +0 -0
- package/dist/standalone/assets/home-page-DMm-R675.js.gz +0 -0
- package/dist/standalone/assets/home-page-DMm-R675.js.map +1 -0
- package/dist/standalone/assets/icon-registry-y57AnfBQ.js +2 -0
- package/dist/standalone/assets/icon-registry-y57AnfBQ.js.br +0 -0
- package/dist/standalone/assets/icon-registry-y57AnfBQ.js.gz +0 -0
- package/dist/standalone/assets/icon-registry-y57AnfBQ.js.map +1 -0
- package/dist/standalone/assets/index-7FvUVXwS.js +15 -0
- package/dist/standalone/assets/index-7FvUVXwS.js.br +0 -0
- package/dist/standalone/assets/index-7FvUVXwS.js.gz +0 -0
- package/dist/standalone/assets/index-7FvUVXwS.js.map +1 -0
- package/dist/standalone/assets/index-DzW3oJ8_.css +2 -0
- package/dist/standalone/assets/index-DzW3oJ8_.css.br +0 -0
- package/dist/standalone/assets/index-DzW3oJ8_.css.gz +0 -0
- package/dist/standalone/assets/info-Bg70Pm3J.js +2 -0
- package/dist/standalone/assets/info-Bg70Pm3J.js.map +1 -0
- package/dist/standalone/assets/json-editor-B6CA7o0q.js +2 -0
- package/dist/standalone/assets/json-editor-B6CA7o0q.js.br +0 -0
- package/dist/standalone/assets/json-editor-B6CA7o0q.js.gz +0 -0
- package/dist/standalone/assets/json-editor-B6CA7o0q.js.map +1 -0
- package/dist/standalone/assets/key-lbuX0yk_.js +2 -0
- package/dist/standalone/assets/key-lbuX0yk_.js.map +1 -0
- package/dist/standalone/assets/key-round-CQLp1Ua9.js +2 -0
- package/dist/standalone/assets/key-round-CQLp1Ua9.js.map +1 -0
- package/dist/standalone/assets/minimize-2-Bx2cH_WS.js +2 -0
- package/dist/standalone/assets/minimize-2-Bx2cH_WS.js.map +1 -0
- package/dist/standalone/assets/pencil-BO-k3yTG.js +2 -0
- package/dist/standalone/assets/pencil-BO-k3yTG.js.map +1 -0
- package/dist/standalone/assets/plus-Dk-FzitW.js +2 -0
- package/dist/standalone/assets/plus-Dk-FzitW.js.map +1 -0
- package/dist/standalone/assets/property-renderer-9Lp1FUJh.js +7 -0
- package/dist/standalone/assets/property-renderer-9Lp1FUJh.js.br +0 -0
- package/dist/standalone/assets/property-renderer-9Lp1FUJh.js.gz +0 -0
- package/dist/standalone/assets/property-renderer-9Lp1FUJh.js.map +1 -0
- package/dist/standalone/assets/reference-BJl0yFxb.js +2 -0
- package/dist/standalone/assets/reference-BJl0yFxb.js.br +0 -0
- package/dist/standalone/assets/reference-BJl0yFxb.js.gz +0 -0
- package/dist/standalone/assets/reference-BJl0yFxb.js.map +1 -0
- package/dist/standalone/assets/refresh-cw-DGaIDN-w.js +2 -0
- package/dist/standalone/assets/refresh-cw-DGaIDN-w.js.map +1 -0
- package/dist/standalone/assets/revisions-button-BMOia5su.js +2 -0
- package/dist/standalone/assets/revisions-button-BMOia5su.js.br +0 -0
- package/dist/standalone/assets/revisions-button-BMOia5su.js.gz +0 -0
- package/dist/standalone/assets/revisions-button-BMOia5su.js.map +1 -0
- package/dist/standalone/assets/richtext-render-DnVcQ34I.js +67 -0
- package/dist/standalone/assets/richtext-render-DnVcQ34I.js.br +0 -0
- package/dist/standalone/assets/richtext-render-DnVcQ34I.js.gz +0 -0
- package/dist/standalone/assets/richtext-render-DnVcQ34I.js.map +1 -0
- package/dist/standalone/assets/rotate-ccw-BLr0QLAg.js +2 -0
- package/dist/standalone/assets/rotate-ccw-BLr0QLAg.js.map +1 -0
- package/dist/standalone/assets/router-CdkN982X.js +186 -0
- package/dist/standalone/assets/router-CdkN982X.js.br +0 -0
- package/dist/standalone/assets/router-CdkN982X.js.gz +0 -0
- package/dist/standalone/assets/router-CdkN982X.js.map +1 -0
- package/dist/standalone/assets/save-Cd3oR3Sj.js +2 -0
- package/dist/standalone/assets/save-Cd3oR3Sj.js.map +1 -0
- package/dist/standalone/assets/select-CYOkMz1v.js +2 -0
- package/dist/standalone/assets/select-CYOkMz1v.js.br +0 -0
- package/dist/standalone/assets/select-CYOkMz1v.js.gz +0 -0
- package/dist/standalone/assets/select-CYOkMz1v.js.map +1 -0
- package/dist/standalone/assets/send-D4KHQGYj.js +2 -0
- package/dist/standalone/assets/send-D4KHQGYj.js.map +1 -0
- package/dist/standalone/assets/settings-page-D_QQH4SM.js +2 -0
- package/dist/standalone/assets/settings-page-D_QQH4SM.js.br +0 -0
- package/dist/standalone/assets/settings-page-D_QQH4SM.js.gz +0 -0
- package/dist/standalone/assets/settings-page-D_QQH4SM.js.map +1 -0
- package/dist/standalone/assets/show-page-B4UVcMHh.js +2 -0
- package/dist/standalone/assets/show-page-B4UVcMHh.js.br +0 -0
- package/dist/standalone/assets/show-page-B4UVcMHh.js.gz +0 -0
- package/dist/standalone/assets/show-page-B4UVcMHh.js.map +1 -0
- package/dist/standalone/assets/sparkles-CqF0zjrF.js +2 -0
- package/dist/standalone/assets/sparkles-CqF0zjrF.js.map +1 -0
- package/dist/standalone/assets/src-WCKJSOko.js +65 -0
- package/dist/standalone/assets/src-WCKJSOko.js.br +0 -0
- package/dist/standalone/assets/src-WCKJSOko.js.gz +0 -0
- package/dist/standalone/assets/src-WCKJSOko.js.map +1 -0
- package/dist/standalone/assets/tabs-jKq6LSSb.js +2 -0
- package/dist/standalone/assets/tabs-jKq6LSSb.js.br +0 -0
- package/dist/standalone/assets/tabs-jKq6LSSb.js.gz +0 -0
- package/dist/standalone/assets/tabs-jKq6LSSb.js.map +1 -0
- package/dist/standalone/assets/textarea-CX_0QVSz.js +2 -0
- package/dist/standalone/assets/textarea-CX_0QVSz.js.map +1 -0
- package/dist/standalone/assets/trash-2-DhyKQCKv.js +2 -0
- package/dist/standalone/assets/trash-2-DhyKQCKv.js.map +1 -0
- package/dist/standalone/assets/triangle-alert-V-AHRhC-.js +2 -0
- package/dist/standalone/assets/triangle-alert-V-AHRhC-.js.map +1 -0
- package/dist/standalone/assets/undo-2-DlSB-5DM.js +2 -0
- package/dist/standalone/assets/undo-2-DlSB-5DM.js.br +0 -0
- package/dist/standalone/assets/undo-2-DlSB-5DM.js.gz +0 -0
- package/dist/standalone/assets/undo-2-DlSB-5DM.js.map +1 -0
- package/dist/standalone/assets/use-dashboard-charts-BnzZ8FtR.js +2 -0
- package/dist/standalone/assets/use-dashboard-charts-BnzZ8FtR.js.br +0 -0
- package/dist/standalone/assets/use-dashboard-charts-BnzZ8FtR.js.gz +0 -0
- package/dist/standalone/assets/use-dashboard-charts-BnzZ8FtR.js.map +1 -0
- package/dist/standalone/assets/useQueries-CG9WO2ym.js +2 -0
- package/dist/standalone/assets/useQueries-CG9WO2ym.js.br +0 -0
- package/dist/standalone/assets/useQueries-CG9WO2ym.js.gz +0 -0
- package/dist/standalone/assets/useQueries-CG9WO2ym.js.map +1 -0
- package/dist/standalone/assets/useQueries-Chw94eNX.css +1 -0
- package/dist/standalone/assets/useQueries-Chw94eNX.css.br +0 -0
- package/dist/standalone/assets/useQueries-Chw94eNX.css.gz +0 -0
- package/dist/standalone/assets/user-directory-B84RcWhn.js +5 -0
- package/dist/standalone/assets/user-directory-B84RcWhn.js.br +0 -0
- package/dist/standalone/assets/user-directory-B84RcWhn.js.gz +0 -0
- package/dist/standalone/assets/user-directory-B84RcWhn.js.map +1 -0
- package/dist/standalone/assets/uuid-DLSnbsz2.js +2 -0
- package/dist/standalone/assets/uuid-DLSnbsz2.js.map +1 -0
- package/dist/standalone/assets/wand-sparkles-BDM69Lk9.js +2 -0
- package/dist/standalone/assets/wand-sparkles-BDM69Lk9.js.map +1 -0
- package/dist/standalone/assets/with-selector-NDLhu4dT.js +2 -0
- package/dist/standalone/assets/with-selector-NDLhu4dT.js.br +0 -0
- package/dist/standalone/assets/with-selector-NDLhu4dT.js.gz +0 -0
- package/dist/standalone/assets/with-selector-NDLhu4dT.js.map +1 -0
- package/dist/standalone/assets/wizard-create-page-BybrbRRx.js +2 -0
- package/dist/standalone/assets/wizard-create-page-BybrbRRx.js.br +0 -0
- package/dist/standalone/assets/wizard-create-page-BybrbRRx.js.gz +0 -0
- package/dist/standalone/assets/wizard-create-page-BybrbRRx.js.map +1 -0
- package/dist/standalone/assets/x-C3kLunD6.js +2 -0
- package/dist/standalone/assets/x-C3kLunD6.js.map +1 -0
- package/dist/standalone/assets/zap-DIzIW2MP.js +2 -0
- package/dist/standalone/assets/zap-DIzIW2MP.js.br +0 -0
- package/dist/standalone/assets/zap-DIzIW2MP.js.gz +0 -0
- package/dist/standalone/assets/zap-DIzIW2MP.js.map +1 -0
- package/dist/standalone/assets/zod-zGqwQYFX.js +2 -0
- package/dist/standalone/assets/zod-zGqwQYFX.js.br +0 -0
- package/dist/standalone/assets/zod-zGqwQYFX.js.gz +0 -0
- package/dist/standalone/assets/zod-zGqwQYFX.js.map +1 -0
- package/dist/standalone/index.html +11 -2
- package/dist/standalone/index.html.br +0 -0
- package/dist/standalone/index.html.gz +0 -0
- package/package.json +6 -6
- package/vite.config.ts +77 -2
- package/dist/standalone/assets/index-Bq7jl8a_.css +0 -1
- package/dist/standalone/assets/index-COc2pxJ6.js +0 -546
- package/dist/standalone/assets/index-COc2pxJ6.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dist-Dpg8xy_r.js","names":["computePosition","arrow","flip","hide","offset","shift","limitShift","size","getComputedStyle","offset","offset$1","shift","shift$1","flip","flip$1","size","size$1","hide","hide$1","arrow","arrow$1","limitShift","limitShift$1","useLayoutEffect","Arrow","arrow","floatingUIarrow","ArrowPrimitive.Root"],"sources":["../../../../../node_modules/.bun/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs","../../../../ui/src/components/button.tsx","../../../../../node_modules/.bun/@radix-ui+react-use-size@1.1.2+93dbe784b8baa420/node_modules/@radix-ui/react-use-size/dist/index.mjs","../../../../../node_modules/.bun/@floating-ui+utils@0.2.11/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../../../../node_modules/.bun/@floating-ui+core@1.7.5/node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../../../../node_modules/.bun/@floating-ui+utils@0.2.11/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../../../../node_modules/.bun/@floating-ui+dom@1.7.6/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../../../../../node_modules/.bun/@floating-ui+react-dom@2.1.8+7492c01c6988791b/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs","../../../../../node_modules/.bun/@radix-ui+react-arrow@1.1.11+ae2b4604ef263bc9/node_modules/@radix-ui/react-arrow/dist/index.mjs","../../../../../node_modules/.bun/@radix-ui+react-popper@1.3.3+ae2b4604ef263bc9/node_modules/@radix-ui/react-popper/dist/index.mjs"],"sourcesContent":["/**\n * Copyright 2022 Joe Bell. All rights reserved.\n *\n * This file is licensed to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with the\n * License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */ import { clsx } from \"clsx\";\nconst falsyToString = (value)=>typeof value === \"boolean\" ? `${value}` : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>(props)=>{\n var _config_compoundVariants;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants, defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{\n let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n\n","import * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cn } from '../lib/utils.js'\n\nconst buttonVariants = cva(\n 'inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground hover:bg-primary/90',\n destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',\n outline: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',\n // Colored outline variants — same chrome as `outline` (border +\n // transparent background, height comes from the size token) but\n // with a semantic tint applied to border, text and hover. Use\n // when grouping a row of action buttons so they share a single\n // visual silhouette while still encoding intent through color.\n 'outline-primary':\n 'border border-primary/40 bg-background text-primary hover:bg-primary/10 hover:border-primary/60',\n 'outline-destructive':\n 'border border-destructive/40 bg-background text-destructive hover:bg-destructive/10 hover:border-destructive/60',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',\n ghost: 'hover:bg-accent hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2',\n sm: 'h-8 rounded-md px-3 text-xs',\n lg: 'h-10 rounded-md px-6',\n icon: 'h-9 w-9',\n },\n },\n defaultVariants: { variant: 'default', size: 'default' },\n },\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button'\n return (\n <Comp\n ref={ref}\n className={cn(buttonVariants({ variant, size }), className)}\n {...props}\n />\n )\n },\n)\nButton.displayName = 'Button'\n\nexport { buttonVariants }\n","// src/use-size.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nfunction useSize(element) {\n const [size, setSize] = React.useState(void 0);\n useLayoutEffect(() => {\n if (element) {\n setSize({ width: element.offsetWidth, height: element.offsetHeight });\n const resizeObserver = new ResizeObserver((entries) => {\n if (!Array.isArray(entries)) {\n return;\n }\n if (!entries.length) {\n return;\n }\n const entry = entries[0];\n let width;\n let height;\n if (\"borderBoxSize\" in entry) {\n const borderSizeEntry = entry[\"borderBoxSize\"];\n const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;\n width = borderSize[\"inlineSize\"];\n height = borderSize[\"blockSize\"];\n } else {\n width = element.offsetWidth;\n height = element.offsetHeight;\n }\n setSize({ width, height });\n });\n resizeObserver.observe(element, { box: \"border-box\" });\n return () => resizeObserver.unobserve(element);\n } else {\n setSize(void 0);\n }\n }, [element]);\n return size;\n}\nexport {\n useSize\n};\n//# sourceMappingURL=index.mjs.map\n","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n const firstChar = placement[0];\n return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');\n}\nconst lrPlacement = ['left', 'right'];\nconst rlPlacement = ['right', 'left'];\nconst tbPlacement = ['top', 'bottom'];\nconst btPlacement = ['bottom', 'top'];\nfunction getSideList(side, isStart, rtl) {\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rlPlacement : lrPlacement;\n return isStart ? lrPlacement : rlPlacement;\n case 'left':\n case 'right':\n return isStart ? tbPlacement : btPlacement;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n const side = getSide(placement);\n return oppositeSideMap[side] + placement.slice(side.length);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n// Maximum number of resets that can occur before bailing to avoid infinite reset loops.\nconst MAX_RESET_COUNT = 50;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const platformWithDetectOverflow = platform.detectOverflow ? platform : {\n ...platform,\n detectOverflow\n };\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let resetCount = 0;\n const middlewareData = {};\n for (let i = 0; i < middleware.length; i++) {\n const currentMiddleware = middleware[i];\n if (!currentMiddleware) {\n continue;\n }\n const {\n name,\n fn\n } = currentMiddleware;\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform: platformWithDetectOverflow,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData[name] = {\n ...middlewareData[name],\n ...data\n };\n if (reset && resetCount < MAX_RESET_COUNT) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;\n if (!ignoreCrossAxisOverflow ||\n // We leave the current main axis only if every placement on that axis\n // overflows the main axis.\n overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects,\n platform\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\nconst originSides = /*#__PURE__*/new Set(['left', 'top']);\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = originSides.has(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n platform\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = originSides.has(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n var _state$middlewareData, _state$middlewareData2;\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';\n}\nfunction isTableElement(element) {\n return /^(table|td|th)$/.test(getNodeName(element));\n}\nfunction isTopLayer(element) {\n try {\n if (element.matches(':popover-open')) {\n return true;\n }\n } catch (_e) {\n // no-op\n }\n try {\n return element.matches(':modal');\n } catch (_e) {\n return false;\n }\n}\nconst willChangeRe = /transform|translate|scale|rotate|perspective|filter/;\nconst containRe = /paint|layout|strict|content/;\nconst isNotNone = value => !!value && value !== 'none';\nlet isWebKitValue;\nfunction isContainingBlock(elementOrCss) {\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (isWebKitValue == null) {\n isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');\n }\n return isWebKitValue;\n}\nfunction isLastTraversableNode(node) {\n return /^(html|body|#document)$/.test(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n } else {\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n }\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle as getComputedStyle$1, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle$1(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle$1(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll) {\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle$1(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Safety check: ensure the scrollbar space is reasonable in case this\n// calculation is affected by unusual styles.\n// Most scrollbars leave 15-18px of space.\nconst SCROLLBAR_MAX = 25;\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n const windowScrollbarX = getWindowScrollBarX(html);\n // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the\n // visual width of the <html> but this is not considered in the size\n // of `html.clientWidth`.\n if (windowScrollbarX <= 0) {\n const doc = html.ownerDocument;\n const body = doc.body;\n const bodyStyles = getComputedStyle(body);\n const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;\n const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);\n if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {\n width -= clippingStableScrollbarWidth;\n }\n } else if (windowScrollbarX <= SCROLLBAR_MAX) {\n // If the <body> scrollbar is on the left, the width needs to be extended\n // by the scrollbar amount so there isn't extra space on the right.\n width += windowScrollbarX;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle$1(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle$1(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === 'absolute' || currentContainingBlockComputedStyle.position === 'fixed') || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);\n let top = firstRect.top;\n let right = firstRect.right;\n let bottom = firstRect.bottom;\n let left = firstRect.left;\n for (let i = 1; i < clippingAncestors.length; i++) {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);\n top = max(rect.top, top);\n right = min(rect.right, right);\n bottom = min(rect.bottom, bottom);\n left = max(rect.left, left);\n }\n return {\n width: right - left,\n height: bottom - top,\n x: left,\n y: top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n\n // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n function setLeftRTLScrollbarOffset() {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n setLeftRTLScrollbarOffset();\n }\n }\n if (isFixed && !isOffsetParentAnElement && documentElement) {\n setLeftRTLScrollbarOffset();\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle$1(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the <html> element as the offsetParent if it's non-static,\n // while Chrome and Safari return the <body> element. The <body> element must\n // be used to perform the correct calculations even if the <html> element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle$1(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n // It's possible that even though the ratio is reported as 1, the\n // element is not actually fully within the IntersectionObserver's root\n // area anymore. This can happen under performance constraints. This may\n // be a bug in the browser's IntersectionObserver implementation. To\n // work around this, we compare the element's bounding rect now with\n // what it was at the time we created the IntersectionObserver. If they\n // are not equal then the element moved, so we refresh.\n refresh();\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (_e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n refresh(true);\n return cleanup;\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update, {\n passive: true\n });\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n if (floating) {\n resizeObserver.observe(floating);\n }\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = {\n platform,\n ...options\n };\n const platformWithCache = {\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n","import { computePosition, arrow as arrow$2, autoPlacement as autoPlacement$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1 } from '@floating-ui/dom';\nexport { autoUpdate, computePosition, detectOverflow, getOverflowAncestors, platform } from '@floating-ui/dom';\nimport * as React from 'react';\nimport { useLayoutEffect } from 'react';\nimport * as ReactDOM from 'react-dom';\n\nvar isClient = typeof document !== 'undefined';\n\nvar noop = function noop() {};\nvar index = isClient ? useLayoutEffect : noop;\n\n// Fork of `fast-deep-equal` that only does the comparisons we need and compares\n// functions\nfunction deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (typeof a === 'function' && a.toString() === b.toString()) {\n return true;\n }\n let length;\n let i;\n let keys;\n if (a && b && typeof a === 'object') {\n if (Array.isArray(a)) {\n length = a.length;\n if (length !== b.length) return false;\n for (i = length; i-- !== 0;) {\n if (!deepEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) {\n return false;\n }\n for (i = length; i-- !== 0;) {\n if (!{}.hasOwnProperty.call(b, keys[i])) {\n return false;\n }\n }\n for (i = length; i-- !== 0;) {\n const key = keys[i];\n if (key === '_owner' && a.$$typeof) {\n continue;\n }\n if (!deepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n return a !== a && b !== b;\n}\n\nfunction getDPR(element) {\n if (typeof window === 'undefined') {\n return 1;\n }\n const win = element.ownerDocument.defaultView || window;\n return win.devicePixelRatio || 1;\n}\n\nfunction roundByDPR(element, value) {\n const dpr = getDPR(element);\n return Math.round(value * dpr) / dpr;\n}\n\nfunction useLatestRef(value) {\n const ref = React.useRef(value);\n index(() => {\n ref.current = value;\n });\n return ref;\n}\n\n/**\n * Provides data to position a floating element.\n * @see https://floating-ui.com/docs/useFloating\n */\nfunction useFloating(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform,\n elements: {\n reference: externalReference,\n floating: externalFloating\n } = {},\n transform = true,\n whileElementsMounted,\n open\n } = options;\n const [data, setData] = React.useState({\n x: 0,\n y: 0,\n strategy,\n placement,\n middlewareData: {},\n isPositioned: false\n });\n const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);\n if (!deepEqual(latestMiddleware, middleware)) {\n setLatestMiddleware(middleware);\n }\n const [_reference, _setReference] = React.useState(null);\n const [_floating, _setFloating] = React.useState(null);\n const setReference = React.useCallback(node => {\n if (node !== referenceRef.current) {\n referenceRef.current = node;\n _setReference(node);\n }\n }, []);\n const setFloating = React.useCallback(node => {\n if (node !== floatingRef.current) {\n floatingRef.current = node;\n _setFloating(node);\n }\n }, []);\n const referenceEl = externalReference || _reference;\n const floatingEl = externalFloating || _floating;\n const referenceRef = React.useRef(null);\n const floatingRef = React.useRef(null);\n const dataRef = React.useRef(data);\n const hasWhileElementsMounted = whileElementsMounted != null;\n const whileElementsMountedRef = useLatestRef(whileElementsMounted);\n const platformRef = useLatestRef(platform);\n const openRef = useLatestRef(open);\n const update = React.useCallback(() => {\n if (!referenceRef.current || !floatingRef.current) {\n return;\n }\n const config = {\n placement,\n strategy,\n middleware: latestMiddleware\n };\n if (platformRef.current) {\n config.platform = platformRef.current;\n }\n computePosition(referenceRef.current, floatingRef.current, config).then(data => {\n const fullData = {\n ...data,\n // The floating element's position may be recomputed while it's closed\n // but still mounted (such as when transitioning out). To ensure\n // `isPositioned` will be `false` initially on the next open, avoid\n // setting it to `true` when `open === false` (must be specified).\n isPositioned: openRef.current !== false\n };\n if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {\n dataRef.current = fullData;\n ReactDOM.flushSync(() => {\n setData(fullData);\n });\n }\n });\n }, [latestMiddleware, placement, strategy, platformRef, openRef]);\n index(() => {\n if (open === false && dataRef.current.isPositioned) {\n dataRef.current.isPositioned = false;\n setData(data => ({\n ...data,\n isPositioned: false\n }));\n }\n }, [open]);\n const isMountedRef = React.useRef(false);\n index(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n index(() => {\n if (referenceEl) referenceRef.current = referenceEl;\n if (floatingEl) floatingRef.current = floatingEl;\n if (referenceEl && floatingEl) {\n if (whileElementsMountedRef.current) {\n return whileElementsMountedRef.current(referenceEl, floatingEl, update);\n }\n update();\n }\n }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);\n const refs = React.useMemo(() => ({\n reference: referenceRef,\n floating: floatingRef,\n setReference,\n setFloating\n }), [setReference, setFloating]);\n const elements = React.useMemo(() => ({\n reference: referenceEl,\n floating: floatingEl\n }), [referenceEl, floatingEl]);\n const floatingStyles = React.useMemo(() => {\n const initialStyles = {\n position: strategy,\n left: 0,\n top: 0\n };\n if (!elements.floating) {\n return initialStyles;\n }\n const x = roundByDPR(elements.floating, data.x);\n const y = roundByDPR(elements.floating, data.y);\n if (transform) {\n return {\n ...initialStyles,\n transform: \"translate(\" + x + \"px, \" + y + \"px)\",\n ...(getDPR(elements.floating) >= 1.5 && {\n willChange: 'transform'\n })\n };\n }\n return {\n position: strategy,\n left: x,\n top: y\n };\n }, [strategy, transform, elements.floating, data.x, data.y]);\n return React.useMemo(() => ({\n ...data,\n update,\n refs,\n elements,\n floatingStyles\n }), [data, update, refs, elements, floatingStyles]);\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow$1 = options => {\n function isRef(value) {\n return {}.hasOwnProperty.call(value, 'current');\n }\n return {\n name: 'arrow',\n options,\n fn(state) {\n const {\n element,\n padding\n } = typeof options === 'function' ? options(state) : options;\n if (element && isRef(element)) {\n if (element.current != null) {\n return arrow$2({\n element: element.current,\n padding\n }).fn(state);\n }\n return {};\n }\n if (element) {\n return arrow$2({\n element,\n padding\n }).fn(state);\n }\n return {};\n }\n };\n};\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = (options, deps) => {\n const result = offset$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = (options, deps) => {\n const result = shift$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = (options, deps) => {\n const result = limitShift$1(options);\n return {\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = (options, deps) => {\n const result = flip$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = (options, deps) => {\n const result = size$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = (options, deps) => {\n const result = autoPlacement$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = (options, deps) => {\n const result = hide$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = (options, deps) => {\n const result = inline$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = (options, deps) => {\n const result = arrow$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\nexport { arrow, autoPlacement, flip, hide, inline, limitShift, offset, shift, size, useFloating };\n","// src/arrow.tsx\nimport * as React from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NAME = \"Arrow\";\nvar Arrow = React.forwardRef((props, forwardedRef) => {\n const { children, width = 10, height = 5, ...arrowProps } = props;\n return /* @__PURE__ */ jsx(\n Primitive.svg,\n {\n ...arrowProps,\n ref: forwardedRef,\n width,\n height,\n viewBox: \"0 0 30 10\",\n preserveAspectRatio: \"none\",\n children: props.asChild ? children : /* @__PURE__ */ jsx(\"polygon\", { points: \"0,0 30,0 15,10\" })\n }\n );\n});\nArrow.displayName = NAME;\nvar Root = Arrow;\nexport {\n Arrow,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// src/popper.tsx\nimport * as React from \"react\";\nimport {\n useFloating,\n autoUpdate,\n offset,\n shift,\n limitShift,\n hide,\n arrow as floatingUIarrow,\n flip,\n size\n} from \"@floating-ui/react-dom\";\nimport * as ArrowPrimitive from \"@radix-ui/react-arrow\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { useSize } from \"@radix-ui/react-use-size\";\nimport { jsx } from \"react/jsx-runtime\";\nvar SIDE_OPTIONS = [\"top\", \"right\", \"bottom\", \"left\"];\nvar ALIGN_OPTIONS = [\"start\", \"center\", \"end\"];\nvar POPPER_NAME = \"Popper\";\nvar [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);\nvar [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);\nvar Popper = (props) => {\n const { __scopePopper, children } = props;\n const [anchor, setAnchor] = React.useState(null);\n const [placementState, setPlacementState] = React.useState(void 0);\n return /* @__PURE__ */ jsx(\n PopperProvider,\n {\n scope: __scopePopper,\n anchor,\n onAnchorChange: setAnchor,\n placementState,\n setPlacementState,\n children\n }\n );\n};\nPopper.displayName = POPPER_NAME;\nvar ANCHOR_NAME = \"PopperAnchor\";\nvar PopperAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopper, virtualRef, ...anchorProps } = props;\n const context = usePopperContext(ANCHOR_NAME, __scopePopper);\n const ref = React.useRef(null);\n const onAnchorChange = context.onAnchorChange;\n const callbackRef = React.useCallback(\n (node) => {\n ref.current = node;\n if (node) {\n onAnchorChange(node);\n }\n },\n [onAnchorChange]\n );\n const composedRefs = useComposedRefs(forwardedRef, callbackRef);\n const anchorRef = React.useRef(null);\n React.useEffect(() => {\n if (!virtualRef) {\n return;\n }\n const previousAnchor = anchorRef.current;\n anchorRef.current = virtualRef.current;\n if (previousAnchor !== anchorRef.current) {\n onAnchorChange(anchorRef.current);\n }\n });\n const sideAndAlign = context.placementState && getSideAndAlignFromPlacement(context.placementState);\n const placedSide = sideAndAlign?.[0];\n const placedAlign = sideAndAlign?.[1];\n return virtualRef ? null : /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-radix-popper-side\": placedSide,\n \"data-radix-popper-align\": placedAlign,\n ...anchorProps,\n ref: composedRefs\n }\n );\n }\n);\nPopperAnchor.displayName = ANCHOR_NAME;\nvar CONTENT_NAME = \"PopperContent\";\nvar [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);\nvar PopperContent = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopePopper,\n side = \"bottom\",\n sideOffset = 0,\n align = \"center\",\n alignOffset = 0,\n arrowPadding = 0,\n avoidCollisions = true,\n collisionBoundary = [],\n collisionPadding: collisionPaddingProp = 0,\n sticky = \"partial\",\n hideWhenDetached = false,\n updatePositionStrategy = \"optimized\",\n onPlaced,\n ...contentProps\n } = props;\n const context = usePopperContext(CONTENT_NAME, __scopePopper);\n const [content, setContent] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, setContent);\n const [arrow, setArrow] = React.useState(null);\n const arrowSize = useSize(arrow);\n const arrowWidth = arrowSize?.width ?? 0;\n const arrowHeight = arrowSize?.height ?? 0;\n const desiredPlacement = side + (align !== \"center\" ? \"-\" + align : \"\");\n const collisionPadding = typeof collisionPaddingProp === \"number\" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };\n const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];\n const hasExplicitBoundaries = boundary.length > 0;\n const detectOverflowOptions = {\n padding: collisionPadding,\n boundary: boundary.filter(isNotNull),\n // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries\n altBoundary: hasExplicitBoundaries\n };\n const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({\n // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues\n strategy: \"fixed\",\n placement: desiredPlacement,\n whileElementsMounted: (...args) => {\n const cleanup = autoUpdate(...args, {\n animationFrame: updatePositionStrategy === \"always\"\n });\n return cleanup;\n },\n elements: {\n reference: context.anchor\n },\n middleware: [\n offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),\n avoidCollisions && shift({\n mainAxis: true,\n crossAxis: false,\n limiter: sticky === \"partial\" ? limitShift() : void 0,\n ...detectOverflowOptions\n }),\n avoidCollisions && flip({ ...detectOverflowOptions }),\n size({\n ...detectOverflowOptions,\n apply: ({ elements, rects, availableWidth, availableHeight }) => {\n const { width: anchorWidth, height: anchorHeight } = rects.reference;\n const contentStyle = elements.floating.style;\n contentStyle.setProperty(\"--radix-popper-available-width\", `${availableWidth}px`);\n contentStyle.setProperty(\"--radix-popper-available-height\", `${availableHeight}px`);\n contentStyle.setProperty(\"--radix-popper-anchor-width\", `${anchorWidth}px`);\n contentStyle.setProperty(\"--radix-popper-anchor-height\", `${anchorHeight}px`);\n }\n }),\n arrow && floatingUIarrow({ element: arrow, padding: arrowPadding }),\n transformOrigin({ arrowWidth, arrowHeight }),\n hideWhenDetached && hide({\n strategy: \"referenceHidden\",\n ...detectOverflowOptions,\n // `hide` detects whether the anchor (reference) is clipped, so when\n // no explicit `collisionBoundary` is set we fall back to Floating\n // UI's default clipping ancestors (e.g. a scrollable menu). This\n // lets an occluded submenu hide once its anchor scrolls out of view\n // (#3237). The collision/size middlewares deliberately keep the\n // viewport-based default to avoid clamping content rendered inside\n // transformed or overflow-clipping portal containers.\n boundary: hasExplicitBoundaries ? detectOverflowOptions.boundary : void 0\n })\n ]\n });\n const setPlacementState = context.setPlacementState;\n useLayoutEffect(() => {\n setPlacementState(placement);\n return () => {\n setPlacementState(void 0);\n };\n }, [placement, setPlacementState]);\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const handlePlaced = useCallbackRef(onPlaced);\n useLayoutEffect(() => {\n if (isPositioned) {\n handlePlaced?.();\n }\n }, [isPositioned, handlePlaced]);\n const arrowX = middlewareData.arrow?.x;\n const arrowY = middlewareData.arrow?.y;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const [contentZIndex, setContentZIndex] = React.useState();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n return /* @__PURE__ */ jsx(\n \"div\",\n {\n ref: refs.setFloating,\n \"data-radix-popper-content-wrapper\": \"\",\n style: {\n ...floatingStyles,\n transform: isPositioned ? floatingStyles.transform : \"translate(0, -200%)\",\n // keep off the page when measuring\n minWidth: \"max-content\",\n zIndex: contentZIndex,\n \"--radix-popper-transform-origin\": [\n middlewareData.transformOrigin?.x,\n middlewareData.transformOrigin?.y\n ].join(\" \"),\n // hide the content if using the hide middleware and should be hidden\n // set visibility to hidden and disable pointer events so the UI behaves\n // as if the PopperContent isn't there at all\n ...middlewareData.hide?.referenceHidden && {\n visibility: \"hidden\",\n pointerEvents: \"none\"\n }\n },\n dir: props.dir,\n children: /* @__PURE__ */ jsx(\n PopperContentProvider,\n {\n scope: __scopePopper,\n placedSide,\n placedAlign,\n onArrowChange: setArrow,\n arrowX,\n arrowY,\n shouldHideArrow: cannotCenterArrow,\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-side\": placedSide,\n \"data-align\": placedAlign,\n ...contentProps,\n ref: composedRefs,\n style: {\n ...contentProps.style,\n // if the PopperContent hasn't been placed yet (not all measurements done)\n // we prevent animations so that users's animation don't kick in too early referring wrong sides\n animation: !isPositioned ? \"none\" : void 0\n }\n }\n )\n }\n )\n }\n );\n }\n);\nPopperContent.displayName = CONTENT_NAME;\nvar ARROW_NAME = \"PopperArrow\";\nvar OPPOSITE_SIDE = {\n top: \"bottom\",\n right: \"left\",\n bottom: \"top\",\n left: \"right\"\n};\nvar PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {\n const { __scopePopper, ...arrowProps } = props;\n const contentContext = useContentContext(ARROW_NAME, __scopePopper);\n const baseSide = OPPOSITE_SIDE[contentContext.placedSide];\n return (\n // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)\n // doesn't report size as we'd expect on SVG elements.\n // it reports their bounding box which is effectively the largest path inside the SVG.\n /* @__PURE__ */ jsx(\n \"span\",\n {\n ref: contentContext.onArrowChange,\n style: {\n position: \"absolute\",\n left: contentContext.arrowX,\n top: contentContext.arrowY,\n [baseSide]: 0,\n transformOrigin: {\n top: \"\",\n right: \"0 0\",\n bottom: \"center 0\",\n left: \"100% 0\"\n }[contentContext.placedSide],\n transform: {\n top: \"translateY(100%)\",\n right: \"translateY(50%) rotate(90deg) translateX(-50%)\",\n bottom: `rotate(180deg)`,\n left: \"translateY(50%) rotate(-90deg) translateX(50%)\"\n }[contentContext.placedSide],\n visibility: contentContext.shouldHideArrow ? \"hidden\" : void 0\n },\n children: /* @__PURE__ */ jsx(\n ArrowPrimitive.Root,\n {\n ...arrowProps,\n ref: forwardedRef,\n style: {\n ...arrowProps.style,\n // ensures the element can be measured correctly (mostly for if SVG)\n display: \"block\"\n }\n }\n )\n }\n )\n );\n});\nPopperArrow.displayName = ARROW_NAME;\nfunction isNotNull(value) {\n return value !== null;\n}\nvar transformOrigin = (options) => ({\n name: \"transformOrigin\",\n options,\n fn(data) {\n const { placement, rects, middlewareData } = data;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const isArrowHidden = cannotCenterArrow;\n const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;\n const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const noArrowAlign = { start: \"0%\", center: \"50%\", end: \"100%\" }[placedAlign];\n const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;\n const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;\n let x = \"\";\n let y = \"\";\n if (placedSide === \"bottom\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${-arrowHeight}px`;\n } else if (placedSide === \"top\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${rects.floating.height + arrowHeight}px`;\n } else if (placedSide === \"right\") {\n x = `${-arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n } else if (placedSide === \"left\") {\n x = `${rects.floating.width + arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n }\n return { data: { x, y } };\n }\n});\nfunction getSideAndAlignFromPlacement(placement) {\n const [side, align = \"center\"] = placement.split(\"-\");\n return [side, align];\n}\nvar Root2 = Popper;\nvar Anchor = PopperAnchor;\nvar Content = PopperContent;\nvar Arrow = PopperArrow;\nexport {\n ALIGN_OPTIONS,\n Anchor,\n Arrow,\n Content,\n Popper,\n PopperAnchor,\n PopperArrow,\n PopperContent,\n Root2 as Root,\n SIDE_OPTIONS,\n createPopperScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"x_google_ignoreList":[0,2,3,4,5,6,7,8,9],"mappings":"wLAeM,EAAiB,GAAQ,OAAO,GAAU,UAAY,GAAG,IAAU,IAAU,EAAI,IAAM,EAChF,EAAK,EACL,GAAO,EAAM,IAAU,GAAQ,CAEpC,GAAK,GAAuD,UAAa,KAAM,OAAO,EAAG,EAAM,GAAoD,MAAO,GAAoD,SAAS,EACv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C.js";import{S as n}from"./with-selector-NDLhu4dT.js";import{t as r}from"./trash-2-DhyKQCKv.js";import{n as i}from"./wand-sparkles-BDM69Lk9.js";import{t as a}from"./plus-Dk-FzitW.js";import{t as o}from"./save-Cd3oR3Sj.js";import{t as s}from"./sparkles-CqF0zjrF.js";import{t as c}from"./x-C3kLunD6.js";import{s as l}from"./dist-Dpg8xy_r.js";import{s as u}from"./empty-6O1hDBF_.js";import{$ as d,A as f,G as p,H as m,M as h,P as g,St as _,Z as v,i as ee,n as y,nt as b}from"./router-CdkN982X.js";import{d as te,l as x,n as ne,s as re,u as S}from"./property-renderer-9Lp1FUJh.js";import{a as C,i as w,n as T,t as E}from"./card-4cS4uWCP.js";import{a as ie,c as D,i as O,n as ae,o as oe,r as k,s as se,t as ce}from"./zod-zGqwQYFX.js";import{t as le}from"./revisions-button-BMOia5su.js";import{F as A,I as j,L as M,N,P,R as F,_ as I,b as ue,ft as de,g as fe,h as pe,i as L,m as me,n as he,ot as R,r as ge,v as _e,x as ve,y as ye}from"./index-7FvUVXwS.js";var z=e(t(),1),B=n();function be({resourceId:e,onClose:t,onFilled:n}){let{t:r}=d(),i=b(),a=L(),[o,c]=z.useState(null),[u,f]=z.useState(!1),p=z.useRef(null),[m,h]=z.useState(null);z.useEffect(()=>{if(!o){h(null);return}let e=URL.createObjectURL(o);return h(e),()=>URL.revokeObjectURL(e)},[o]),z.useEffect(()=>()=>{p.current?.abort(`dialog unmounted`)},[]);let g=async()=>{if(!o||u)return;let r=new AbortController;p.current=r,f(!0);try{let{values:s}=await i.aiFillFromImage(e,o,{signal:r.signal});if(Object.keys(s).length===0){a.error({key:`aiFill:noValues`});return}n(s),t()}catch(e){if(r.signal.aborted)return;let{message:t}=_(e);a.error({key:`aiFill:errorGeneric`,params:{message:t}},{description:t})}finally{f(!1),p.current=null}},v=()=>{u&&p.current?.abort(`dialog closed`),t()};return(0,B.jsx)(N,{open:!0,onOpenChange:e=>{e||v()},children:(0,B.jsxs)(P,{className:`w-full max-w-md`,children:[(0,B.jsxs)(M,{children:[(0,B.jsxs)(F,{className:`flex items-center gap-2`,children:[(0,B.jsx)(s,{className:`size-4`}),r(`aiFill:dialogTitle`)]}),(0,B.jsx)(A,{children:r(`aiFill:dialogDescription`)})]}),(0,B.jsx)(te,{accept:`image/*`,value:o?o.name:null,displayName:o?.name??null,previewUrl:m,uploading:u,uploadingName:o?.name,disabled:u,onFileSelect:e=>c(e),onRemove:()=>c(null),labels:{chooseFile:r(`common:chooseFile`),dragAndDrop:r(`common:dragAndDrop`),chooseAFile:r(`common:chooseAFile`),uploading:r(`aiFill:processing`),uploadingFile:r(`aiFill:processing`),removeFile:r(`common:removeFile`)}}),(0,B.jsxs)(j,{children:[(0,B.jsx)(l,{variant:`outline`,onClick:v,children:r(`common:cancel`)}),(0,B.jsxs)(l,{onClick:()=>void g(),disabled:!o||u,children:[u?(0,B.jsx)(R,{className:`size-4 animate-spin`}):(0,B.jsx)(s,{className:`size-4`}),r(`aiFill:fillButton`)]})]})]})})}function xe(e,t){if(t!=null){if(e.availableValues?.length){if(typeof t!=`string`)return;let n=t.trim();if(n===``)return;let r=n.toLowerCase();return(e.availableValues.find(e=>e.value===n)??e.availableValues.find(e=>e.value.toLowerCase()===r)??e.availableValues.find(e=>e.label.toLowerCase()===r))?.value}if(e.reference)return typeof t==`string`||typeof t==`number`?t:void 0;switch(e.type){case`bigint`:case`biginteger`:{if(typeof t==`bigint`)return t.toString();if(typeof t==`number`)return!Number.isFinite(t)||!Number.isInteger(t)?void 0:String(t);if(typeof t!=`string`)return;let e=t.trim().replace(/[\s_]/g,``);return/^-?\d+$/.test(e)?e:void 0}case`number`:case`float`:case`currency`:case`money`:case`decimal`:case`integer`:{if(typeof t==`number`)return Number.isFinite(t)?t:void 0;if(typeof t!=`string`)return;let n=t.trim().replace(/[^\d.,\-+eE]/g,``);if(n===``||n===`-`||n===`+`)return;let r=n.lastIndexOf(`.`)>=n.lastIndexOf(`,`)?n.replace(/,/g,``):n.replace(/\./g,``).replace(`,`,`.`),i=Number(r);return Number.isFinite(i)?e.type===`integer`?Math.trunc(i):i:void 0}case`boolean`:if(typeof t==`boolean`)return t;if(typeof t==`number`)return t!==0;if(typeof t==`string`){let e=t.trim().toLowerCase();if([`true`,`yes`,`y`,`1`,`on`].includes(e))return!0;if([`false`,`no`,`n`,`0`,`off`].includes(e))return!1}return;case`date`:case`datetime`:case`datetime-local`:return typeof t==`string`&&/^\d{4}-\d{2}-\d{2}/.test(t.trim())?t.trim():void 0;default:return t}}}function V({resourceId:e,recordId:t}){let n=p(e),b=m(e,t),te=f(e),D=v(e),O=h(e),A=g(),j=ee(),{t:M,locale:N}=d(),P=L(),F=ge(),R=z.useMemo(()=>n?re(n.properties,`edit`).filter(e=>!e.isDisabled):[],[n]),V=z.useRef(()=>({})),we=z.useMemo(()=>ae(R,M,()=>V.current()),[R,N]),H=z.useMemo(()=>{let e={};for(let t of R)e[t.path]=k(t);return e},[R]),U=se({resolver:ce(we),defaultValues:H});V.current=U.getValues;let W=z.useRef(void 0),G=!t,K=G?`modern-admin:draft:${e}`:null,q=z.useRef(void 0),J=z.useRef(!1),Y=z.useRef(!1);z.useEffect(()=>{if(!t){if(W.current=void 0,q.current===e||R.length===0)return;q.current=e,Y.current=!1;let t=null;if(K&&typeof window<`u`)try{let e=window.localStorage.getItem(K);e&&(t=JSON.parse(e))}catch{}if(t&&typeof t==`object`){let e={...H};for(let n of R)Object.prototype.hasOwnProperty.call(t,n.path)&&(e[n.path]=t[n.path]);J.current=!0,U.reset(e),P.raw(M(`common:draftRestored`),{position:`bottom-center`,duration:8e3,action:{label:M(`common:undoDraftRestore`),onClick:()=>{J.current=!0,U.reset(H);try{K&&window.localStorage.removeItem(K)}catch{}}}})}else U.reset(H);return}if(R.length===0||!b.data||W.current===t)return;W.current=t,q.current=void 0;let n=b.data.record.params,r={...H};for(let e of R){let t=n[e.path];e.type===`boolean`?r[e.path]=!!t:t==null?r[e.path]=k(e):r[e.path]=t}U.reset(r)},[t,b.data,R,H,U,K,e,P,M]),z.useEffect(()=>{if(!G||!K||R.length===0||typeof window>`u`)return;let e=U.watch(e=>{if(Y.current)return;if(J.current){J.current=!1;return}let t=!1,n={};for(let r of R){let i=e[r.path];i instanceof File||Array.isArray(i)&&i.some(e=>e instanceof File)||(n[r.path]=i,Ce(i,H[r.path])||(t=!0))}try{t?window.localStorage.setItem(K,JSON.stringify(n)):window.localStorage.removeItem(K)}catch{}});return()=>e.unsubscribe()},[G,K,R,H,U]);let Te=z.useCallback(()=>{if(q.current=void 0,Y.current=!0,!(!K||typeof window>`u`))try{window.localStorage.removeItem(K)}catch{}},[K]),[X,Z]=z.useState(null),[Ee,Q]=z.useState(!1),De=z.useMemo(()=>!!n?.actions.find(e=>e.custom?.aiFill===!0),[n]),Oe=z.useCallback(e=>{let t=new Map(R.map(e=>[e.path,e])),n={},r=U.getValues(),i=[];for(let[a,o]of Object.entries(e)){let e=t.get(a);if(!e)continue;let s=xe(e,o);s!==void 0&&(i.push([a,s]),n[a]=r[a])}for(let[e,t]of i)U.setValue(e,t,{shouldDirty:!0,shouldValidate:!0});if(i.length===0){P.error({key:`aiFill:noValues`});return}P.raw(M(`aiFill:applied`,{count:i.length}),{position:`bottom-center`,duration:8e3,action:{label:M(`common:undoDraftRestore`),onClick:()=>{for(let[e,t]of Object.entries(n))U.setValue(e,t,{shouldDirty:!0,shouldValidate:!0})}}})},[R,U,P,M]),ke=async n=>{Z(null);try{let r=G?await te.mutateAsync(n):await D.mutateAsync({id:t,payload:n}),i=r.record.errors;if(i&&Object.keys(i).length>0){for(let[e,t]of Object.entries(i)){let n=typeof t==`string`?t:t?.message??`Invalid value`;U.setError(e,{type:`server`,message:n})}r.record.baseError&&Z(String(r.record.baseError)),P.error({key:`toast:validationFailed`});return}G&&Te(),P.success({key:G?`toast:created`:`toast:saved`}),j({name:`show`,resourceId:e,recordId:String(r.record.id)})}catch(e){let t=e instanceof Error?e.message:String(e);Z(t),P.error({key:G?`toast:createFailed`:`toast:saveFailed`},{description:t})}},Ae=()=>{P.error({key:`toast:validationFailed`})},je=async()=>{t&&await F.confirm({title:M(`common:confirmDelete`),confirmLabel:M(`common:delete`),destructive:!0})&&(await O.mutateAsync(t),j({name:`list`,resourceId:e}))},$=!G&&(b.isLoading||W.current!==t);if(he(`mod+s`,()=>{U.formState.isSubmitting||$||U.handleSubmit(ke,Ae)()},{description:M(G?`common:create`:`common:save`)}),!n)return(0,B.jsx)(`div`,{className:`p-6`,children:M(`common:loading`)});if(!G&&b.isError){let{status:r,message:a}=_(b.error),o=M(r===404?`errors:notFound`:r===403?`errors:forbidden`:`errors:server`);return(0,B.jsxs)(`div`,{className:`flex min-h-full flex-col gap-4`,children:[(0,B.jsx)(x,{items:[S(M(`common:home`)),{label:n.name,to:{name:`list`,resourceId:e}},{label:t??``}]}),(0,B.jsxs)(E,{children:[(0,B.jsxs)(w,{className:`flex flex-row items-center justify-between gap-3`,children:[(0,B.jsxs)(C,{className:`truncate`,children:[n.name,` #`,t]}),(0,B.jsx)(y,{to:{name:`list`,resourceId:e},children:(0,B.jsx)(l,{variant:`ghost`,size:`sm`,children:M(`common:back`)})})]}),(0,B.jsx)(T,{children:(0,B.jsxs)(`div`,{className:`flex items-start gap-3 rounded-lg border border-destructive/50 bg-destructive/10 p-4 dark:bg-destructive/15`,children:[(0,B.jsx)(i,{className:`mt-0.5 size-5 shrink-0 text-destructive`}),(0,B.jsxs)(`div`,{className:`space-y-1 text-sm`,children:[(0,B.jsx)(`p`,{className:`font-semibold text-destructive`,children:o}),(0,B.jsx)(`p`,{className:`text-destructive/90`,children:a})]})]})})]})]})}let Me=_e(),Ne=b.data?.record.title||t;return(0,B.jsxs)(`div`,{className:`flex min-h-full flex-col gap-4`,children:[(0,B.jsx)(x,{items:[S(M(`common:home`)),{label:n.name,to:{name:`list`,resourceId:e}},...G?[{label:M(`common:new`)}]:[{label:Ne??``,to:{name:`show`,resourceId:e,recordId:t}},{label:M(`common:edit`)}]]}),(0,B.jsxs)(E,{className:`flex-1`,children:[(0,B.jsxs)(w,{className:`flex flex-row items-center justify-between gap-3`,children:[(0,B.jsx)(C,{className:`truncate`,children:G?M(`common:newRecord`,{name:n.name}):M(`common:editRecord`,{name:n.name,id:t??``})}),(0,B.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[De&&(0,B.jsxs)(l,{type:`button`,variant:`outline`,size:`sm`,disabled:U.formState.isSubmitting||$,onClick:()=>Q(!0),children:[(0,B.jsx)(s,{className:`size-4`}),(0,B.jsx)(`span`,{className:`hidden sm:inline`,children:M(`aiFill:button`)})]}),!G&&(0,B.jsxs)(B.Fragment,{children:[A.history&&(0,B.jsx)(le,{resourceId:e,recordId:t}),(0,B.jsx)(y,{to:{name:`show`,resourceId:e,recordId:t},children:(0,B.jsxs)(l,{variant:`outline`,size:`sm`,"aria-label":M(`common:show`),children:[(0,B.jsx)(de,{className:`size-4`}),(0,B.jsx)(`span`,{className:`hidden sm:inline`,children:M(`common:show`)})]})}),(0,B.jsxs)(l,{variant:`destructive`,size:`sm`,disabled:O.isPending||U.formState.isSubmitting||$,onClick:()=>void je(),"aria-label":M(`common:delete`),children:[(0,B.jsx)(r,{className:`size-4`}),(0,B.jsx)(`span`,{className:`hidden sm:inline`,children:M(`common:delete`)})]})]})]})]}),(0,B.jsx)(ie,{...U,children:(0,B.jsx)(`form`,{id:`edit-record-form`,onSubmit:U.handleSubmit(ke,Ae),children:(0,B.jsx)(T,{className:`gap-4 pb-6 [column-fill:_balance] md:columns-2`,children:R.map(t=>(0,B.jsx)(Se,{control:U.control,property:t,children:(0,B.jsx)(oe,{control:U.control,name:t.path,render:({field:n,fieldState:r})=>(0,B.jsxs)(me,{"data-invalid":r.error?!0:void 0,className:`mb-8 break-inside-avoid`,children:[(0,B.jsxs)(fe,{htmlFor:n.name,children:[t.label,t.description?(0,B.jsx)(u,{content:t.description,ariaLabel:t.description}):null,t.isRequired&&(0,B.jsx)(`span`,{className:`ml-1 text-destructive`,children:`*`})]}),(0,B.jsx)(ne,{property:t,value:n.value,onChange:n.onChange,disabled:U.formState.isSubmitting,resourceId:e}),r.error?.message&&(0,B.jsx)(pe,{children:r.error.message})]})})},t.path))})})})]}),Ee&&(0,B.jsx)(be,{resourceId:e,onClose:()=>Q(!1),onFilled:Oe}),(0,B.jsx)(`div`,{className:`sticky bottom-0 -mb-px z-20 -mx-2 border-t border-border bg-card px-2 py-3 pr-14 sm:-mx-6 sm:px-6 sm:pr-16`,children:(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(`div`,{children:X&&(0,B.jsx)(`span`,{className:`text-sm text-destructive`,children:X})}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsxs)(l,{type:`button`,variant:`ghost`,onClick:()=>j(G?{name:`list`,resourceId:e}:{name:`show`,resourceId:e,recordId:t}),"aria-label":M(`common:cancel`),children:[(0,B.jsx)(c,{className:`size-4`}),(0,B.jsx)(`span`,{className:`hidden sm:inline`,children:M(`common:cancel`)})]}),(0,B.jsxs)(ye,{children:[(0,B.jsx)(ve,{asChild:!0,children:(0,B.jsxs)(l,{type:`submit`,form:`edit-record-form`,disabled:U.formState.isSubmitting||$,"aria-label":M(G?`common:create`:`common:save`),children:[G?(0,B.jsx)(a,{className:`size-4`}):(0,B.jsx)(o,{className:`size-4`}),(0,B.jsx)(`span`,{className:`hidden sm:inline`,children:M(G?`common:create`:`common:save`)})]})}),(0,B.jsxs)(ue,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(`span`,{children:M(G?`common:create`:`common:save`)}),(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,B.jsx)(I,{children:Me}),(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`+`}),(0,B.jsx)(I,{children:`S`})]})]})]})]})]})})]})}function Se({control:e,property:t,children:n}){let r=t.showWhen,i=D({control:e,name:r?.field??t.path});return r?O(r,{[r.field]:i})?(0,B.jsx)(B.Fragment,{children:n}):null:(0,B.jsx)(B.Fragment,{children:n})}function Ce(e,t){if(e===t)return!0;let n=e==null||e===``,r=t==null||t===``;if(n&&r)return!0;if(n||r||typeof e!=typeof t)return!1;if(typeof e==`object`)try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}return!1}export{V as ResourceEditPage};
|
|
2
|
+
//# sourceMappingURL=edit-page-CYRW56vh.js.map
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-page-CYRW56vh.js","names":[],"sources":["../../../../react/src/components/ai-fill-dialog.tsx","../../../../react/src/pages/edit-page.tsx"],"sourcesContent":["// AiFillDialog — dropzone + \"Recognize\" button that sends a single image to\n// the resource's `aiFill` action and forwards the extracted values to the\n// caller. The dialog is purely presentational regarding form state; the\n// edit page handles merging the returned values into the live form.\n\nimport * as React from 'react'\nimport { Sparkles, Loader2 } from 'lucide-react'\nimport {\n Button,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n FileInput,\n} from '@modern-admin/ui'\nimport { useAdminClient } from '../provider.js'\nimport { useI18n } from '../i18n.js'\nimport { useNotify } from '../notify.js'\nimport { parseApiError } from '../client.js'\n\nexport interface AiFillDialogProps {\n resourceId: string\n onClose(): void\n /** Called with the extracted values map. Caller merges into form state. */\n onFilled(values: Record<string, unknown>): void\n}\n\nexport function AiFillDialog({\n resourceId,\n onClose,\n onFilled,\n}: AiFillDialogProps): React.ReactElement {\n const { t } = useI18n()\n const client = useAdminClient()\n const notify = useNotify()\n const [file, setFile] = React.useState<File | null>(null)\n const [busy, setBusy] = React.useState(false)\n const abortRef = React.useRef<AbortController | null>(null)\n\n // Use useEffect for createObjectURL to ensure cleanup is always paired with\n // creation and happens at the right time (avoiding the side-effect-in-useMemo\n // anti-pattern).\n const [previewUrl, setPreviewUrl] = React.useState<string | null>(null)\n React.useEffect(() => {\n if (!file) {\n setPreviewUrl(null)\n return\n }\n const url = URL.createObjectURL(file)\n setPreviewUrl(url)\n return () => URL.revokeObjectURL(url)\n }, [file])\n\n // Abort any in-flight request when the dialog unmounts.\n React.useEffect(() => {\n return () => {\n abortRef.current?.abort('dialog unmounted')\n }\n }, [])\n\n const handleFill = async (): Promise<void> => {\n if (!file || busy) return\n\n const ac = new AbortController()\n abortRef.current = ac\n setBusy(true)\n try {\n const { values } = await client.aiFillFromImage(resourceId, file, { signal: ac.signal })\n const count = Object.keys(values).length\n if (count === 0) {\n notify.error({ key: 'aiFill:noValues' })\n return\n }\n onFilled(values)\n // The undo toast is surfaced by the edit-page (applyAiFillValues); the\n // dialog only needs to close cleanly after handing off the values.\n onClose()\n } catch (err) {\n if (ac.signal.aborted) return // user-initiated close — silently ignore\n const { message } = parseApiError(err)\n notify.error(\n { key: 'aiFill:errorGeneric', params: { message } },\n { description: message },\n )\n } finally {\n setBusy(false)\n abortRef.current = null\n }\n }\n\n const handleClose = (): void => {\n if (busy) {\n abortRef.current?.abort('dialog closed')\n }\n onClose()\n }\n\n return (\n <Dialog open onOpenChange={(open) => { if (!open) handleClose() }}>\n <DialogContent className=\"w-full max-w-md\">\n <DialogHeader>\n <DialogTitle className=\"flex items-center gap-2\">\n <Sparkles className=\"size-4\" />\n {t('aiFill:dialogTitle')}\n </DialogTitle>\n <DialogDescription>{t('aiFill:dialogDescription')}</DialogDescription>\n </DialogHeader>\n\n <FileInput\n accept=\"image/*\"\n value={file ? file.name : null}\n displayName={file?.name ?? null}\n previewUrl={previewUrl}\n uploading={busy}\n uploadingName={file?.name}\n disabled={busy}\n onFileSelect={(f) => setFile(f)}\n onRemove={() => setFile(null)}\n labels={{\n chooseFile: t('common:chooseFile'),\n dragAndDrop: t('common:dragAndDrop'),\n chooseAFile: t('common:chooseAFile'),\n uploading: t('aiFill:processing'),\n uploadingFile: t('aiFill:processing'),\n removeFile: t('common:removeFile'),\n }}\n />\n\n <DialogFooter>\n <Button variant=\"outline\" onClick={handleClose}>\n {t('common:cancel')}\n </Button>\n <Button onClick={() => void handleFill()} disabled={!file || busy}>\n {busy ? <Loader2 className=\"size-4 animate-spin\" /> : <Sparkles className=\"size-4\" />}\n {t('aiFill:fillButton')}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n )\n}\n","// Edit / new page driven by react-hook-form + zodResolver. The Zod schema\n// is derived dynamically from the resource's editable PropertyJSON list via\n// `buildValidationSchema()` — every property type maps to the right runtime\n// check, with localized error messages. Field-level server errors from\n// `record.errors` are projected back onto the form via setError, and global\n// success/failure messages surface as toasts.\n\nimport * as React from 'react'\nimport { useForm, useWatch, type Control, type SubmitHandler } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n Button,\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n Field,\n FieldError,\n FieldLabel,\n Form,\n FormField,\n InfoTooltip,\n Kbd,\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n getModKeyLabel,\n} from '@modern-admin/ui'\nimport { AlertCircle, Eye, Plus, Save, Sparkles, Trash2, X } from 'lucide-react'\nimport { useCreateRecord, useDeleteRecord, useFeatures, useRecord, useResource, useUpdateRecord } from '../hooks.js'\nimport { parseApiError } from '../client.js'\nimport { PropertyEditor } from '../property-renderer.js'\nimport { Link, useNavigate } from '../router.js'\nimport { useI18n } from '../i18n.js'\nimport { useNotify } from '../notify.js'\nimport { useHotkey } from '../use-hotkey.js'\nimport { PageBreadcrumbs, homeCrumb } from '../breadcrumbs.js'\nimport type { BreadcrumbItemSpec } from '../breadcrumbs.js'\nimport { buildValidationSchema, defaultValueFor } from '../validation.js'\nimport { evaluateShowWhen } from '../show-when.js'\nimport type { PropertyJSON } from '../types.js'\nimport { useDialogs } from '../dialogs.js'\nimport { RevisionsButton } from '../components/revisions-button.js'\nimport { AiFillDialog } from '../components/ai-fill-dialog.js'\nimport { visibleRecordProperties } from '../relations.js'\n\nexport interface ResourceEditPageProps {\n resourceId: string\n recordId?: string\n}\n\n/**\n * Defensive coercion applied to values returned by `aiFillFromImage` before\n * they reach `form.setValue`. The backend already normalises numbers/dates/\n * enums/references; this is a last-line check so an unexpected stringy\n * number does not poison a numeric field's state and so out-of-domain enum\n * values are dropped rather than silently committed. Returns `undefined` to\n * mean \"drop this value, keep the existing form state\".\n */\nfunction coerceAiFillValue(property: PropertyJSON, value: unknown): unknown {\n if (value === null || value === undefined) return undefined\n // Enum-style: snap by exact / case-insensitive value or label.\n if (property.availableValues?.length) {\n if (typeof value !== 'string') return undefined\n const trimmed = value.trim()\n if (trimmed === '') return undefined\n const lower = trimmed.toLowerCase()\n const match = property.availableValues.find((v) => v.value === trimmed)\n ?? property.availableValues.find((v) => v.value.toLowerCase() === lower)\n ?? property.availableValues.find((v) => v.label.toLowerCase() === lower)\n return match?.value\n }\n // References: keep id-shaped scalars only (string or number).\n if (property.reference) {\n if (typeof value === 'string' || typeof value === 'number') return value\n return undefined\n }\n switch (property.type) {\n case 'bigint':\n case 'biginteger': {\n // BigInt values are transported as digit strings end-to-end (matches\n // BaseRecord.toJSON + the Prisma adapter's accept-string write path).\n // Never round-trip via Number() — values >2^53 would lose precision.\n if (typeof value === 'bigint') return value.toString()\n if (typeof value === 'number') {\n if (!Number.isFinite(value) || !Number.isInteger(value)) return undefined\n return String(value)\n }\n if (typeof value !== 'string') return undefined\n const trimmed = value.trim().replace(/[\\s_]/g, '')\n return /^-?\\d+$/.test(trimmed) ? trimmed : undefined\n }\n case 'number':\n case 'float':\n case 'currency':\n case 'money':\n case 'decimal':\n case 'integer': {\n if (typeof value === 'number') return Number.isFinite(value) ? value : undefined\n if (typeof value !== 'string') return undefined\n const trimmed = value.trim().replace(/[^\\d.,\\-+eE]/g, '')\n if (trimmed === '' || trimmed === '-' || trimmed === '+') return undefined\n const lastDot = trimmed.lastIndexOf('.')\n const lastComma = trimmed.lastIndexOf(',')\n const normalised = lastDot >= lastComma\n ? trimmed.replace(/,/g, '')\n : trimmed.replace(/\\./g, '').replace(',', '.')\n const n = Number(normalised)\n if (!Number.isFinite(n)) return undefined\n return property.type === 'integer' ? Math.trunc(n) : n\n }\n case 'boolean':\n if (typeof value === 'boolean') return value\n if (typeof value === 'number') return value !== 0\n if (typeof value === 'string') {\n const t = value.trim().toLowerCase()\n if (['true', 'yes', 'y', '1', 'on'].includes(t)) return true\n if (['false', 'no', 'n', '0', 'off'].includes(t)) return false\n }\n return undefined\n case 'date':\n case 'datetime':\n case 'datetime-local':\n // Keep ISO-ish strings; date pickers cope with both YYYY-MM-DD and full\n // ISO. Reject anything that doesn't at least look year-prefixed so we\n // don't push \"12 March 2026\" into a <DatePicker>.\n if (typeof value !== 'string') return undefined\n return /^\\d{4}-\\d{2}-\\d{2}/.test(value.trim()) ? value.trim() : undefined\n default:\n return value\n }\n}\n\ntype FormValues = Record<string, unknown>\n\nexport function ResourceEditPage({\n resourceId,\n recordId,\n}: ResourceEditPageProps): React.ReactElement {\n const resource = useResource(resourceId)\n const existing = useRecord(resourceId, recordId)\n const create = useCreateRecord(resourceId)\n const update = useUpdateRecord(resourceId)\n const remove = useDeleteRecord(resourceId)\n const features = useFeatures()\n const navigate = useNavigate()\n const { t, locale } = useI18n()\n const notify = useNotify()\n const dialogs = useDialogs()\n\n const editable = React.useMemo<PropertyJSON[]>(\n () =>\n resource\n ? visibleRecordProperties(resource.properties, 'edit').filter((p) => !p.isDisabled)\n : [],\n [resource],\n )\n\n // The validation schema needs to consult the live form values so it can\n // skip required/format checks for fields hidden by `showWhen`. We can't\n // call `form.getValues` here (the form isn't built yet), so we route\n // through a ref filled in below — the schema closure reads from the ref\n // at validation time, not at build time.\n const getValuesRef = React.useRef<() => Record<string, unknown>>(() => ({}))\n\n // Re-build the schema when locale changes so error messages re-translate.\n const schema = React.useMemo(\n () => buildValidationSchema(editable, t, () => getValuesRef.current()),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [editable, locale],\n )\n const defaults = React.useMemo<FormValues>(() => {\n const out: FormValues = {}\n for (const p of editable) out[p.path] = defaultValueFor(p)\n return out\n }, [editable])\n\n const form = useForm<FormValues>({\n resolver: zodResolver(schema),\n defaultValues: defaults,\n })\n\n // Keep the ref pointing at the latest getValues so the schema closure\n // always sees the current form snapshot.\n getValuesRef.current = form.getValues\n\n // Track which recordId has already been hydrated so background refetches\n // don't overwrite user edits after the initial load.\n const hydratedRecordIdRef = React.useRef<string | undefined>(undefined)\n\n const isNew = !recordId\n\n // localStorage key for the per-resource new-record draft. We persist the\n // form snapshot here whenever the user has typed anything but not yet\n // submitted, so that closing the tab / navigating away doesn't lose work.\n const draftKey = isNew ? `modern-admin:draft:${resourceId}` : null\n\n // Once-per-resource init flag for the new-record form. Gates the whole\n // initialisation block — without this, every dep change in the hydration\n // effect (e.g. a background `useResource` refetch bumping the `defaults`\n // reference) would re-run `form.reset(defaults)` and wipe the user's\n // in-progress input (and any draft we just restored).\n const newFormInitForRef = React.useRef<string | undefined>(undefined)\n\n // When we programmatically reset the form (draft restore / undo), we don't\n // want that synthetic change to trigger the persistence watcher and re-save\n // a draft that we just decided not to keep.\n const skipNextPersistRef = React.useRef(false)\n\n // Hard off-switch for draft persistence, set by `clearDraft` after a\n // successful submit. Between the submit and the unmount of this form,\n // cache invalidations (mutation fan-out, the realtime bridge echoing the\n // just-created record back to this tab) can re-render the page and fire\n // the watch subscription with the submitted values still in the form —\n // re-saving the draft that was just cleared. The flag stays on until the\n // hydration effect re-initialises the form for the next `/new` visit.\n const draftPersistDisabledRef = React.useRef(false)\n\n // Hydrate when the existing record arrives (edit mode) or after the resource\n // schema settles (new mode).\n React.useEffect(() => {\n if (!recordId) {\n // New-record form: initialise exactly once per resource. Second and\n // later runs (triggered by background refetches changing `editable` /\n // `defaults` references) must NOT touch the form — `form.reset(...)`\n // would wipe the user's in-progress input.\n hydratedRecordIdRef.current = undefined\n if (newFormInitForRef.current === resourceId) return\n // Defer until the schema has loaded — otherwise we'd \"initialise\"\n // against an empty defaults map and then refuse to ever re-init.\n if (editable.length === 0) return\n newFormInitForRef.current = resourceId\n draftPersistDisabledRef.current = false\n\n // Attempt to restore a saved draft. If we find one, reset to the\n // merged snapshot and surface a bottom-center toast with an Undo\n // action. If not, fall back to a single reset to defaults.\n let draft: FormValues | null = null\n if (draftKey && typeof window !== 'undefined') {\n try {\n const stored = window.localStorage.getItem(draftKey)\n if (stored) draft = JSON.parse(stored) as FormValues\n } catch {\n /* corrupted JSON — ignore */\n }\n }\n\n if (draft && typeof draft === 'object') {\n const merged: FormValues = { ...defaults }\n for (const p of editable) {\n if (Object.prototype.hasOwnProperty.call(draft, p.path)) {\n merged[p.path] = (draft as FormValues)[p.path]\n }\n }\n skipNextPersistRef.current = true\n form.reset(merged)\n notify.raw(t('common:draftRestored'), {\n position: 'bottom-center',\n duration: 8000,\n action: {\n label: t('common:undoDraftRestore'),\n onClick: () => {\n skipNextPersistRef.current = true\n form.reset(defaults)\n try {\n if (draftKey) window.localStorage.removeItem(draftKey)\n } catch {\n /* ignore */\n }\n },\n },\n })\n } else {\n form.reset(defaults)\n }\n return\n }\n // Wait until both the resource schema and the record data are ready.\n // Without this guard an early fire with editable=[] would wipe the form.\n if (editable.length === 0 || !existing.data) return\n // Hydrate only once per record — prevents background refetches from\n // overwriting in-progress user edits.\n if (hydratedRecordIdRef.current === recordId) return\n hydratedRecordIdRef.current = recordId\n // Switching into edit mode invalidates any prior new-form init — so the\n // next visit to `/new` (potentially in a reused component instance)\n // restores the draft / resets to defaults instead of keeping the edit\n // record's values.\n newFormInitForRef.current = undefined\n\n const params = existing.data.record.params\n const merged: FormValues = { ...defaults }\n for (const p of editable) {\n const v = params[p.path]\n if (p.type === 'boolean') merged[p.path] = Boolean(v)\n else if (v == null) merged[p.path] = defaultValueFor(p)\n else merged[p.path] = v\n }\n form.reset(merged)\n }, [recordId, existing.data, editable, defaults, form, draftKey, resourceId, notify, t])\n\n // Persist the form snapshot to localStorage on every change in new mode.\n // We only write when at least one field deviates from defaults; when the\n // form is back to pristine state we delete the key so the user isn't\n // greeted with an \"empty draft\" toast on reopen.\n React.useEffect(() => {\n if (!isNew || !draftKey || editable.length === 0 || typeof window === 'undefined') return\n const subscription = form.watch((values) => {\n if (draftPersistDisabledRef.current) return\n if (skipNextPersistRef.current) {\n skipNextPersistRef.current = false\n return\n }\n let isDirty = false\n const sanitized: FormValues = {}\n for (const p of editable) {\n const v = (values as FormValues)[p.path]\n // Skip non-serializable values (File objects from file inputs).\n if (v instanceof File) continue\n if (Array.isArray(v) && v.some((x) => x instanceof File)) continue\n sanitized[p.path] = v\n if (!valuesEqual(v, defaults[p.path])) isDirty = true\n }\n try {\n if (isDirty) {\n window.localStorage.setItem(draftKey, JSON.stringify(sanitized))\n } else {\n window.localStorage.removeItem(draftKey)\n }\n } catch {\n /* quota / disabled storage — ignore */\n }\n })\n return () => subscription.unsubscribe()\n }, [isNew, draftKey, editable, defaults, form])\n\n const clearDraft = React.useCallback((): void => {\n // After a successful submit we navigate to the show page, but the\n // component might be reused if the user clicks \"back\" or follows a\n // Create link again. Clearing the init flag forces the next /new visit\n // to fall back to defaults instead of retaining the just-submitted\n // values.\n newFormInitForRef.current = undefined\n // Stop persisting until the next new-form init — post-submit re-renders\n // must not resurrect the draft we're about to remove.\n draftPersistDisabledRef.current = true\n if (!draftKey || typeof window === 'undefined') return\n try {\n window.localStorage.removeItem(draftKey)\n } catch {\n /* ignore */\n }\n }, [draftKey])\n\n const [submitError, setSubmitError] = React.useState<string | null>(null)\n const [aiFillOpen, setAiFillOpen] = React.useState(false)\n\n // The `aiFill` feature plugin (packages/feature-ai-fill) registers a\n // resource-scoped action whose `custom.aiFill === true` flag tells us\n // the resource opts in. Absent the action, the button is hidden.\n // Detect the aiFill plugin by the `custom.aiFill === true` marker, not by\n // action name, so renaming the action in the future can't silently break this.\n const aiFillEnabled = React.useMemo(\n () =>\n Boolean(\n resource?.actions.find(\n (a) => (a.custom as { aiFill?: boolean } | undefined)?.aiFill === true,\n ),\n ),\n [resource],\n )\n\n const applyAiFillValues = React.useCallback(\n (values: Record<string, unknown>): void => {\n // Snapshot the current values of the fields that will be overwritten so\n // the user can undo with a single toast action. Only fields we actually\n // applied are snapshotted — fields skipped due to unknown path or\n // failed coercion must not be \"undone\" to undefined.\n const known = new Map(editable.map((p) => [p.path, p]))\n const snapshot: Record<string, unknown> = {}\n const current = form.getValues()\n const applied: Array<[string, unknown]> = []\n for (const [path, value] of Object.entries(values)) {\n const property = known.get(path)\n if (!property) continue\n const coerced = coerceAiFillValue(property, value)\n if (coerced === undefined) continue\n applied.push([path, coerced])\n snapshot[path] = current[path]\n }\n\n for (const [path, value] of applied) {\n // shouldValidate: true so any value the model returned that does not\n // pass the form schema is highlighted to the user immediately rather\n // than discovered on submit.\n form.setValue(path, value as never, { shouldDirty: true, shouldValidate: true })\n }\n\n if (applied.length === 0) {\n notify.error({ key: 'aiFill:noValues' })\n return\n }\n\n // Offer a quick undo via a bottom-center toast — same pattern as draft restore.\n notify.raw(t('aiFill:applied', { count: applied.length }), {\n position: 'bottom-center',\n duration: 8000,\n action: {\n label: t('common:undoDraftRestore'),\n onClick: () => {\n for (const [path, prev] of Object.entries(snapshot)) {\n form.setValue(path, prev as never, { shouldDirty: true, shouldValidate: true })\n }\n },\n },\n })\n },\n [editable, form, notify, t],\n )\n\n const onSubmit: SubmitHandler<FormValues> = async (values) => {\n setSubmitError(null)\n try {\n const result = isNew\n ? await create.mutateAsync(values)\n : await update.mutateAsync({ id: recordId!, payload: values })\n // Field-level errors come back as 200 with `record.errors`.\n const errors = result.record.errors as Record<string, { message?: string } | string>\n if (errors && Object.keys(errors).length > 0) {\n for (const [path, err] of Object.entries(errors)) {\n const message = typeof err === 'string' ? err : (err?.message ?? 'Invalid value')\n form.setError(path, { type: 'server', message })\n }\n if (result.record.baseError) {\n setSubmitError(String(result.record.baseError))\n }\n notify.error({ key: 'toast:validationFailed' })\n return\n }\n // Successful submit — drop the saved draft so we don't restore it on\n // the next visit to the new-form route.\n if (isNew) clearDraft()\n notify.success({ key: isNew ? 'toast:created' : 'toast:saved' })\n navigate({ name: 'show', resourceId, recordId: String(result.record.id) })\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n setSubmitError(message)\n notify.error({ key: isNew ? 'toast:createFailed' : 'toast:saveFailed' }, { description: message })\n }\n }\n\n const onInvalid = (): void => {\n notify.error({ key: 'toast:validationFailed' })\n }\n\n const handleDelete = async (): Promise<void> => {\n if (!recordId) return\n const ok = await dialogs.confirm({\n title: t('common:confirmDelete'),\n confirmLabel: t('common:delete'),\n destructive: true,\n })\n if (!ok) return\n await remove.mutateAsync(recordId)\n navigate({ name: 'list', resourceId })\n }\n\n // While editing an existing record, block submit/delete until the record\n // has been hydrated. Otherwise the form submits with empty defaults and\n // wipes server-side fields (e.g. enums coerce '' → null).\n const isHydrating = !isNew && (existing.isLoading || hydratedRecordIdRef.current !== recordId)\n\n // ── Keyboard shortcuts ──\n // Ctrl/Cmd+S submits the form. Submit-on-Ctrl+S works even when focus is\n // in an input — that's the standard \"save\" gesture across editors.\n useHotkey(\n 'mod+s',\n () => {\n if (form.formState.isSubmitting || isHydrating) return\n void form.handleSubmit(onSubmit, onInvalid)()\n },\n { description: isNew ? t('common:create') : t('common:save') },\n )\n\n if (!resource) return <div className=\"p-6\">{t('common:loading')}</div>\n\n // When editing an existing record that failed to load (e.g. 404), bail out\n // before rendering the form — there's nothing to edit.\n if (!isNew && existing.isError) {\n const { status, message } = parseApiError(existing.error)\n const title =\n status === 404\n ? t('errors:notFound')\n : status === 403\n ? t('errors:forbidden')\n : t('errors:server')\n return (\n <div className=\"flex min-h-full flex-col gap-4\">\n <PageBreadcrumbs\n items={[\n homeCrumb(t('common:home')),\n { label: resource.name, to: { name: 'list', resourceId } },\n { label: recordId ?? '' },\n ]}\n />\n <Card>\n <CardHeader className=\"flex flex-row items-center justify-between gap-3\">\n <CardTitle className=\"truncate\">\n {resource.name} #{recordId}\n </CardTitle>\n <Link to={{ name: 'list', resourceId }}>\n <Button variant=\"ghost\" size=\"sm\">\n {t('common:back')}\n </Button>\n </Link>\n </CardHeader>\n <CardContent>\n <div className=\"flex items-start gap-3 rounded-lg border border-destructive/50 bg-destructive/10 p-4 dark:bg-destructive/15\">\n <AlertCircle className=\"mt-0.5 size-5 shrink-0 text-destructive\" />\n <div className=\"space-y-1 text-sm\">\n <p className=\"font-semibold text-destructive\">{title}</p>\n <p className=\"text-destructive/90\">{message}</p>\n </div>\n </div>\n </CardContent>\n </Card>\n </div>\n )\n }\n\n const modLabel = getModKeyLabel()\n\n const recordLabel = existing.data?.record.title || recordId\n const crumbs: BreadcrumbItemSpec[] = [\n homeCrumb(t('common:home')),\n { label: resource.name, to: { name: 'list', resourceId } },\n ...(isNew\n ? [{ label: t('common:new') }]\n : [\n {\n label: recordLabel ?? '',\n to: { name: 'show' as const, resourceId, recordId: recordId! },\n },\n { label: t('common:edit') },\n ]),\n ]\n\n return (\n <div className=\"flex min-h-full flex-col gap-4\">\n <PageBreadcrumbs items={crumbs} />\n <Card className=\"flex-1\">\n <CardHeader className=\"flex flex-row items-center justify-between gap-3\">\n <CardTitle className=\"truncate\">\n {isNew\n ? t('common:newRecord', { name: resource.name })\n : t('common:editRecord', { name: resource.name, id: recordId ?? '' })}\n </CardTitle>\n <div className=\"flex shrink-0 gap-2\">\n {aiFillEnabled && (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n disabled={form.formState.isSubmitting || isHydrating}\n onClick={() => setAiFillOpen(true)}\n >\n <Sparkles className=\"size-4\" />\n <span className=\"hidden sm:inline\">{t('aiFill:button')}</span>\n </Button>\n )}\n {!isNew && (\n <>\n {features.history && (\n <RevisionsButton resourceId={resourceId} recordId={recordId!} />\n )}\n <Link to={{ name: 'show', resourceId, recordId: recordId! }}>\n <Button variant=\"outline\" size=\"sm\" aria-label={t('common:show')}>\n <Eye className=\"size-4\" />\n <span className=\"hidden sm:inline\">{t('common:show')}</span>\n </Button>\n </Link>\n <Button\n variant=\"destructive\"\n size=\"sm\"\n disabled={remove.isPending || form.formState.isSubmitting || isHydrating}\n onClick={() => void handleDelete()}\n aria-label={t('common:delete')}\n >\n <Trash2 className=\"size-4\" />\n <span className=\"hidden sm:inline\">{t('common:delete')}</span>\n </Button>\n </>\n )}\n </div>\n </CardHeader>\n <Form {...form}>\n <form id=\"edit-record-form\" onSubmit={form.handleSubmit(onSubmit, onInvalid)}>\n <CardContent className=\"gap-4 pb-6 [column-fill:_balance] md:columns-2\">\n {editable.map((property) => (\n <ConditionalField\n key={property.path}\n control={form.control}\n property={property}\n >\n <FormField\n control={form.control}\n name={property.path}\n render={({ field, fieldState }) => (\n <Field\n data-invalid={fieldState.error ? true : undefined}\n className=\"mb-8 break-inside-avoid\"\n >\n <FieldLabel htmlFor={field.name}>\n {property.label}\n {property.description ? (\n <InfoTooltip\n content={property.description}\n ariaLabel={property.description}\n />\n ) : null}\n {property.isRequired && (\n <span className=\"ml-1 text-destructive\">*</span>\n )}\n </FieldLabel>\n <PropertyEditor\n property={property}\n value={field.value}\n onChange={field.onChange}\n disabled={form.formState.isSubmitting}\n resourceId={resourceId}\n />\n {fieldState.error?.message && (\n <FieldError>{fieldState.error.message}</FieldError>\n )}\n </Field>\n )}\n />\n </ConditionalField>\n ))}\n </CardContent>\n </form>\n </Form>\n </Card>\n {/* Sticky action bar — sibling of Card, same pattern as the list-page\n paginator. Pinned to the viewport bottom while the user scrolls.\n `form=\"edit-record-form\"` ties the submit button to the <form> above\n even though it's not a descendant of that element. */}\n {aiFillOpen && (\n <AiFillDialog\n resourceId={resourceId}\n onClose={() => setAiFillOpen(false)}\n onFilled={applyAiFillValues}\n />\n )}\n <div className=\"sticky bottom-0 -mb-px z-20 -mx-2 border-t border-border bg-card px-2 py-3 pr-14 sm:-mx-6 sm:px-6 sm:pr-16\">\n <div className=\"flex items-center justify-between\">\n <div>\n {submitError && (\n <span className=\"text-sm text-destructive\">{submitError}</span>\n )}\n </div>\n <div className=\"flex gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() =>\n navigate(\n isNew\n ? { name: 'list', resourceId }\n : { name: 'show', resourceId, recordId: recordId! },\n )\n }\n aria-label={t('common:cancel')}\n >\n <X className=\"size-4\" />\n <span className=\"hidden sm:inline\">{t('common:cancel')}</span>\n </Button>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"submit\"\n form=\"edit-record-form\"\n disabled={form.formState.isSubmitting || isHydrating}\n aria-label={isNew ? t('common:create') : t('common:save')}\n >\n {isNew ? <Plus className=\"size-4\" /> : <Save className=\"size-4\" />}\n <span className=\"hidden sm:inline\">\n {isNew ? t('common:create') : t('common:save')}\n </span>\n </Button>\n </TooltipTrigger>\n <TooltipContent className=\"flex items-center gap-1.5\">\n <span>{isNew ? t('common:create') : t('common:save')}</span>\n <span className=\"inline-flex items-center gap-0.5\">\n <Kbd>{modLabel}</Kbd>\n <span className=\"text-muted-foreground\">+</span>\n <Kbd>S</Kbd>\n </span>\n </TooltipContent>\n </Tooltip>\n </div>\n </div>\n </div>\n </div>\n )\n}\n\n// ── ConditionalField ──────────────────────────────────────────────────────────\n// Wraps a FormField with `showWhen` evaluation. Subscribes only to the named\n// control field via `useWatch` so unrelated form changes do not re-render the\n// branch. When the rule does not match, the entire FormField subtree (label,\n// editor, description, error) is unmounted — and crucially, the schema's\n// matching `superRefine` skips required/format checks for the same field, so\n// hidden branches cannot block submission.\n\ninterface ConditionalFieldProps {\n control: Control<FormValues>\n property: PropertyJSON\n children: React.ReactNode\n}\n\nfunction ConditionalField({\n control,\n property,\n children,\n}: ConditionalFieldProps): React.ReactElement | null {\n const rule = property.showWhen\n // useWatch with `name: undefined` would subscribe to every field, defeating\n // the purpose. Always pass a string when there's no rule we still want a\n // stable hook order, so we subscribe to the property's own path.\n const watched = useWatch({ control, name: rule?.field ?? property.path })\n if (!rule) return <>{children}</>\n const visible = evaluateShowWhen(rule, { [rule.field]: watched })\n if (!visible) return null\n return <>{children}</>\n}\n\n// Cheap structural equality for form values. Empty-ish primitives are treated\n// as equal (`''` ≈ `null` ≈ `undefined`) so the persistence watcher does not\n// store a draft for an untouched form whose defaults happen to be `''` vs\n// `undefined`. Falls back to JSON stringify for objects/arrays.\nfunction valuesEqual(a: unknown, b: unknown): boolean {\n if (a === b) return true\n const aEmpty = a == null || a === ''\n const bEmpty = b == null || b === ''\n if (aEmpty && bEmpty) return true\n if (aEmpty || bEmpty) return false\n if (typeof a !== typeof b) return false\n if (typeof a === 'object') {\n try {\n return JSON.stringify(a) === JSON.stringify(b)\n } catch {\n return false\n }\n }\n return false\n}\n"],"mappings":"8/BA6BA,SAAgB,GAAa,CAC3B,aACA,UACA,YACwC,CACxC,GAAM,CAAE,KAAM,EAAQ,EAChB,EAAS,EAAe,EACxB,EAAS,EAAU,EACnB,CAAC,EAAM,GAAA,EAAiB,SAAsB,IAAI,EAClD,CAAC,EAAM,GAAA,EAAiB,SAAS,EAAK,EACtC,EAAA,EAAiB,OAA+B,IAAI,EAKpD,CAAC,EAAY,GAAA,EAAuB,SAAwB,IAAI,EACtE,EAAM,cAAgB,CACpB,GAAI,CAAC,EAAM,CACT,EAAc,IAAI,EAClB,MACF,CACA,IAAM,EAAM,IAAI,gBAAgB,CAAI,EAEpC,OADA,EAAc,CAAG,MACJ,IAAI,gBAAgB,CAAG,CACtC,EAAG,CAAC,CAAI,CAAC,EAGT,EAAM,kBACS,CACX,EAAS,SAAS,MAAM,kBAAkB,CAC5C,EACC,CAAC,CAAC,EAEL,IAAM,EAAa,SAA2B,CAC5C,GAAI,CAAC,GAAQ,EAAM,OAEnB,IAAM,EAAK,IAAI,gBACf,EAAS,QAAU,EACnB,EAAQ,EAAI,EACZ,GAAI,CACF,GAAM,CAAE,UAAW,MAAM,EAAO,gBAAgB,EAAY,EAAM,CAAE,OAAQ,EAAG,MAAO,CAAC,EAEvF,GADc,OAAO,KAAK,CAAM,CAAC,CAAC,SACpB,EAAG,CACf,EAAO,MAAM,CAAE,IAAK,iBAAkB,CAAC,EACvC,MACF,CACA,EAAS,CAAM,EAGf,EAAQ,CACV,OAAS,EAAK,CACZ,GAAI,EAAG,OAAO,QAAS,OACvB,GAAM,CAAE,WAAY,EAAc,CA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A,GAC/C,EAAA,EAAA,IAAA,CAAC,EAAD,CAAA,SAAK,GAAM,CAAA,CACP,GACQ,GACT,CAAA,CAAA,CACN,GACF,GACF,CAAA,CACF,GAET,CAgBA,SAAS,GAAiB,CACxB,UACA,WACA,YACmD,CACnD,IAAM,EAAO,EAAS,SAIhB,EAAU,EAAS,CAAE,UAAS,KAAM,GAAM,OAAS,EAAS,IAAK,CAAC,EAIxE,OAHK,EACW,EAAiB,EAAM,EAAG,EAAK,OAAQ,CAAQ,CAC1D,GACE,EAAA,EAAA,IAAA,CAAA,EAAA,SAAA,CAAG,UAAW,CAAA,EADA,MAFH,EAAA,EAAA,IAAA,CAAA,EAAA,SAAA,CAAG,UAAW,CAAA,CAIlC,CAMA,SAAS,GAAY,EAAY,EAAqB,CACpD,GAAI,IAAM,EAAG,MAAO,GACpB,IAAM,EAAS,GAAK,MAAQ,IAAM,GAC5B,EAAS,GAAK,MAAQ,IAAM,GAClC,GAAI,GAAU,EAAQ,MAAO,GAE7B,GADI,GAAU,GACV,OAAO,GAAM,OAAO,EAAG,MAAO,GAClC,GAAI,OAAO,GAAM,SACf,GAAI,CACF,OAAO,KAAK,UAAU,CAAC,IAAM,KAAK,UAAU,CAAC,CAC/C,MAAQ,CACN,MAAO,EACT,CAEF,MAAO,EACT"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,n as t}from"./createLucideIcon-CUopU_LC.js";import{S as n,b as r,d as i,h as a,p as o,s,x as c}from"./with-selector-NDLhu4dT.js";import{t as l}from"./info-Bg70Pm3J.js";import{l as u,o as d}from"./dist-Dpg8xy_r.js";import{o as f}from"./select-CYOkMz1v.js";import{b as p,x as m,y as h}from"./index-7FvUVXwS.js";var g=e(t(),1),_=n(),v=`Switch`,[y,b]=c(v),[x,S]=y(v);function C(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:s,name:c,onCheckedChange:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=o({prop:n,defaultProp:i??!1,onChange:l,caller:v}),[h,y]=g.useState(null),[b,S]=g.useState(null),C={checked:p,setChecked:m,disabled:a,control:h,setControl:y,name:c,form:s,value:d,hasConsumerStoppedPropagationRef:g.useRef(!1),required:u,defaultChecked:i,isFormControl:!h||!!s||!!h.closest(`form`),bubbleInput:b,setBubbleInput:S};return(0,_.jsx)(x,{scope:t,...C,children:j(f)?f(C):r})}var w=`SwitchTrigger`,T=g.forwardRef(({__scopeSwitch:e,onClick:t,...n},o)=>{let{control:s,form:c,value:l,disabled:u,checked:d,required:f,setControl:p,setChecked:m,hasConsumerStoppedPropagationRef:h,isFormControl:v,bubbleInput:y}=S(w,e),b=r(o,p),x=g.useRef(d);return g.useEffect(()=>{let e=c?s?.ownerDocument.getElementById(c):s?.form;if(e instanceof HTMLFormElement){let t=()=>m(x.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[s,c,m]),(0,_.jsx)(i.button,{type:`button`,role:`switch`,"aria-checked":d,"aria-required":f,"data-state":M(d),"data-disabled":u?``:void 0,disabled:u,value:l,...n,ref:b,onClick:a(t,e=>{m(e=>!e),y&&v&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})})});T.displayName=w;var E=g.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,_.jsx)(C,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(T,{...d,ref:t,__scopeSwitch:n}),e&&(0,_.jsx)(A,{__scopeSwitch:n})]})})});E.displayName=v;var D=`SwitchThumb`,O=g.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,a=S(D,n);return(0,_.jsx)(i.span,{"data-state":M(a.checked),"data-disabled":a.disabled?``:void 0,...r,ref:t})});O.displayName=D;var k=`SwitchBubbleInput`,A=g.forwardRef(({__scopeSwitch:e,...t},n)=>{let{control:a,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:c,required:l,disabled:u,name:p,value:m,form:h,bubbleInput:v,setBubbleInput:y}=S(k,e),b=r(n,y),x=f(s),C=d(a);g.useEffect(()=>{let e=v;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!o.current;if(x!==s&&n){let t=new Event(`click`,{bubbles:r});n.call(e,s),e.dispatchEvent(t)}},[v,x,s,o]);let w=g.useRef(s);return(0,_.jsx)(i.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??w.current,required:l,disabled:u,name:p,value:m,form:h,...t,tabIndex:-1,ref:b,style:{...t.style,...C,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});A.displayName=k;function j(e){return typeof e==`function`}function M(e){return e?`checked`:`unchecked`}var N=g.forwardRef(({className:e,...t},n)=>(0,_.jsx)(E,{ref:n,className:s(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,e),...t,children:(0,_.jsx)(O,{className:s(`pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0`)})}));N.displayName=E.displayName;function P({content:e,ariaLabel:t,className:n,iconClassName:r,side:i=`top`}){return(0,_.jsxs)(h,{children:[(0,_.jsx)(m,{asChild:!0,children:(0,_.jsx)(`button`,{type:`button`,"aria-label":t,className:s(`inline-flex size-4 shrink-0 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,n),children:(0,_.jsx)(l,{className:s(`size-3.5`,r)})})}),(0,_.jsx)(p,{side:i,className:`max-w-80 whitespace-pre-wrap text-left leading-relaxed`,children:e})]})}var F=g.forwardRef(({className:e,...t},n)=>(0,_.jsx)(`div`,{ref:n,"data-slot":`empty`,className:s(`flex w-full flex-col items-center justify-center gap-6 rounded-lg border border-dashed border-border bg-card/40 p-8 text-center`,e),...t}));F.displayName=`Empty`;var I=g.forwardRef(({className:e,...t},n)=>(0,_.jsx)(`div`,{ref:n,"data-slot":`empty-header`,className:s(`flex flex-col items-center gap-3 text-center`,e),...t}));I.displayName=`EmptyHeader`;var L=u(`flex shrink-0 items-center justify-center [&>svg]:size-6`,{variants:{variant:{default:`text-muted-foreground`,icon:`flex size-12 items-center justify-center rounded-full bg-muted text-muted-foreground [&>svg]:size-6`}},defaultVariants:{variant:`icon`}}),R=g.forwardRef(({className:e,variant:t,...n},r)=>(0,_.jsx)(`div`,{ref:r,"data-slot":`empty-media`,className:s(L({variant:t}),e),...n}));R.displayName=`EmptyMedia`;var z=g.forwardRef(({className:e,...t},n)=>(0,_.jsx)(`h3`,{ref:n,"data-slot":`empty-title`,className:s(`text-base font-semibold tracking-tight`,e),...t}));z.displayName=`EmptyTitle`;var B=g.forwardRef(({className:e,...t},n)=>(0,_.jsx)(`p`,{ref:n,"data-slot":`empty-description`,className:s(`max-w-sm text-sm text-muted-foreground`,e),...t}));B.displayName=`EmptyDescription`;var V=g.forwardRef(({className:e,...t},n)=>(0,_.jsx)(`div`,{ref:n,"data-slot":`empty-content`,className:s(`flex flex-wrap items-center justify-center gap-2`,e),...t}));V.displayName=`EmptyContent`;export{R as a,N as c,I as i,V as n,z as o,B as r,P as s,F as t};
|
|
2
|
+
//# sourceMappingURL=empty-6O1hDBF_.js.map
|
|
Binary file
|
|
Binary file
|