@habit.analytics/habit-claims-journey-components 1.0.13 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +75 -70
- package/dist/index.mjs +16007 -15493
- package/package.json +3 -2
- package/src/index.ts +3 -0
- package/src/types/journey.ts +9 -0
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }:root,.jb-widget-root{--claims-journey-background: 0 0% 100%;--claims-journey-foreground: 222.2 84% 4.9%;--claims-journey-card: 0 0% 100%;--claims-journey-card-foreground: 222.2 84% 4.9%;--claims-journey-popover: 0 0% 100%;--claims-journey-popover-foreground: 222.2 84% 4.9%;--claims-journey-primary: 222.2 47.4% 11.2%;--claims-journey-primary-foreground: 210 40% 98%;--claims-journey-secondary: 210 40% 96.1%;--claims-journey-secondary-foreground: 222.2 47.4% 11.2%;--claims-journey-muted: 210 40% 96.1%;--claims-journey-muted-foreground: 215.4 16.3% 46.9%;--claims-journey-accent: 210 40% 96.1%;--claims-journey-accent-foreground: 222.2 47.4% 11.2%;--claims-journey-destructive: 0 84.2% 60.2%;--claims-journey-destructive-foreground: 210 40% 98%;--claims-journey-border: 214.3 31.8% 91.4%;--claims-journey-input: 214.3 31.8% 91.4%;--claims-journey-ring: 222.2 84% 4.9%;--claims-journey-radius: .5rem;--claims-journey-sidebar-background: 0 0% 98%;--claims-journey-sidebar-foreground: 240 5.3% 26.1%;--claims-journey-sidebar-primary: 240 5.9% 10%;--claims-journey-sidebar-primary-foreground: 0 0% 98%;--claims-journey-sidebar-accent: 240 4.8% 95.9%;--claims-journey-sidebar-accent-foreground: 240 5.9% 10%;--claims-journey-sidebar-border: 220 13% 91%;--claims-journey-sidebar-ring: 217.2 91.2% 59.8%}.dark{--claims-journey-background: 222.2 84% 4.9%;--claims-journey-foreground: 210 40% 98%;--claims-journey-card: 222.2 84% 4.9%;--claims-journey-card-foreground: 210 40% 98%;--claims-journey-popover: 222.2 84% 4.9%;--claims-journey-popover-foreground: 210 40% 98%;--claims-journey-primary: 210 40% 98%;--claims-journey-primary-foreground: 222.2 47.4% 11.2%;--claims-journey-secondary: 217.2 32.6% 17.5%;--claims-journey-secondary-foreground: 210 40% 98%;--claims-journey-muted: 217.2 32.6% 17.5%;--claims-journey-muted-foreground: 215 20.2% 65.1%;--claims-journey-accent: 217.2 32.6% 17.5%;--claims-journey-accent-foreground: 210 40% 98%;--claims-journey-destructive: 0 62.8% 30.6%;--claims-journey-destructive-foreground: 210 40% 98%;--claims-journey-border: 217.2 32.6% 17.5%;--claims-journey-input: 217.2 32.6% 17.5%;--claims-journey-ring: 212.7 26.8% 83.9%;--claims-journey-sidebar-background: 240 5.9% 10%;--claims-journey-sidebar-foreground: 240 4.8% 95.9%;--claims-journey-sidebar-primary: 224.3 76.3% 48%;--claims-journey-sidebar-primary-foreground: 0 0% 100%;--claims-journey-sidebar-accent: 240 3.7% 15.9%;--claims-journey-sidebar-accent-foreground: 240 4.8% 95.9%;--claims-journey-sidebar-border: 240 3.7% 15.9%;--claims-journey-sidebar-ring: 217.2 91.2% 59.8%}.jb-widget-root,.jb-widget-root *,.jb-widget-root *:before,.jb-widget-root *:after{border-color:hsl(var(--claims-journey-border));box-sizing:border-box}.jb-widget-root{background-color:hsl(var(--claims-journey-background));color:hsl(var(--claims-journey-foreground))}.cj-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border-width:0!important}.cj-pointer-events-none{pointer-events:none!important}.cj-pointer-events-auto{pointer-events:auto!important}.cj-invisible{visibility:hidden!important}.cj-fixed{position:fixed!important}.cj-absolute{position:absolute!important}.cj-relative{position:relative!important}.cj-inset-0{top:0!important;right:0!important;bottom:0!important;left:0!important}.cj-inset-x-0{left:0!important;right:0!important}.cj-inset-y-0{top:0!important;bottom:0!important}.-cj-bottom-12{bottom:-3rem!important}.-cj-left-12{left:-3rem!important}.-cj-right-1{right:-.25rem!important}.-cj-right-12{right:-3rem!important}.-cj-top-1{top:-.25rem!important}.-cj-top-12{top:-3rem!important}.cj-bottom-0{bottom:0!important}.cj-left-0{left:0!important}.cj-left-1{left:.25rem!important}.cj-left-1\\/2{left:50%!important}.cj-left-2{left:.5rem!important}.cj-left-2\\.5{left:.625rem!important}.cj-left-3{left:.75rem!important}.cj-left-\\[50\\%\\]{left:50%!important}.cj-right-0{right:0!important}.cj-right-1{right:.25rem!important}.cj-right-2{right:.5rem!important}.cj-right-3{right:.75rem!important}.cj-right-4{right:1rem!important}.cj-top-0{top:0!important}.cj-top-1\\.5{top:.375rem!important}.cj-top-1\\/2{top:50%!important}.cj-top-2{top:.5rem!important}.cj-top-2\\.5{top:.625rem!important}.cj-top-3\\.5{top:.875rem!important}.cj-top-4{top:1rem!important}.cj-top-\\[1px\\]{top:1px!important}.cj-top-\\[50\\%\\]{top:50%!important}.cj-top-\\[60\\%\\]{top:60%!important}.cj-top-full{top:100%!important}.cj-z-10{z-index:10!important}.cj-z-20{z-index:20!important}.cj-z-50{z-index:50!important}.cj-z-\\[100\\]{z-index:100!important}.cj-z-\\[1\\]{z-index:1!important}.-cj-mx-1{margin-left:-.25rem!important;margin-right:-.25rem!important}.cj-mx-1{margin-left:.25rem!important;margin-right:.25rem!important}.cj-mx-2{margin-left:.5rem!important;margin-right:.5rem!important}.cj-mx-3\\.5{margin-left:.875rem!important;margin-right:.875rem!important}.cj-mx-auto{margin-left:auto!important;margin-right:auto!important}.cj-my-0\\.5{margin-top:.125rem!important;margin-bottom:.125rem!important}.cj-my-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.-cj-ml-4{margin-left:-1rem!important}.-cj-mt-4{margin-top:-1rem!important}.cj-mb-1{margin-bottom:.25rem!important}.cj-mb-1\\.5{margin-bottom:.375rem!important}.cj-mb-2{margin-bottom:.5rem!important}.cj-mb-3{margin-bottom:.75rem!important}.cj-mb-4{margin-bottom:1rem!important}.cj-ml-1{margin-left:.25rem!important}.cj-ml-1\\.5{margin-left:.375rem!important}.cj-ml-auto{margin-left:auto!important}.cj-mr-1{margin-right:.25rem!important}.cj-mr-2{margin-right:.5rem!important}.cj-mt-0{margin-top:0!important}.cj-mt-0\\.5{margin-top:.125rem!important}.cj-mt-1{margin-top:.25rem!important}.cj-mt-1\\.5{margin-top:.375rem!important}.cj-mt-2{margin-top:.5rem!important}.cj-mt-24{margin-top:6rem!important}.cj-mt-3{margin-top:.75rem!important}.cj-mt-4{margin-top:1rem!important}.cj-mt-auto{margin-top:auto!important}.cj-block{display:block!important}.cj-flex{display:flex!important}.cj-inline-flex{display:inline-flex!important}.cj-grid{display:grid!important}.cj-hidden{display:none!important}.cj-aspect-square{aspect-ratio:1 / 1!important}.cj-aspect-video{aspect-ratio:16 / 9!important}.cj-size-4{width:1rem!important;height:1rem!important}.\\!cj-h-3{height:.75rem!important}.cj-h-1\\.5{height:.375rem!important}.cj-h-10{height:2.5rem!important}.cj-h-11{height:2.75rem!important}.cj-h-12{height:3rem!important}.cj-h-14{height:3.5rem!important}.cj-h-2{height:.5rem!important}.cj-h-2\\.5{height:.625rem!important}.cj-h-3{height:.75rem!important}.cj-h-3\\.5{height:.875rem!important}.cj-h-4{height:1rem!important}.cj-h-5{height:1.25rem!important}.cj-h-6{height:1.5rem!important}.cj-h-7{height:1.75rem!important}.cj-h-8{height:2rem!important}.cj-h-9{height:2.25rem!important}.cj-h-\\[1px\\]{height:1px!important}.cj-h-\\[200px\\]{height:200px!important}.cj-h-\\[var\\(--radix-navigation-menu-viewport-height\\)\\]{height:var(--radix-navigation-menu-viewport-height)!important}.cj-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)!important}.cj-h-auto{height:auto!important}.cj-h-full{height:100%!important}.cj-h-px{height:1px!important}.cj-h-svh{height:100svh!important}.cj-max-h-40{max-height:10rem!important}.cj-max-h-80{max-height:20rem!important}.cj-max-h-96{max-height:24rem!important}.cj-max-h-\\[300px\\]{max-height:300px!important}.cj-max-h-\\[85vh\\]{max-height:85vh!important}.cj-max-h-screen{max-height:100vh!important}.cj-min-h-0{min-height:0px!important}.cj-min-h-\\[100px\\]{min-height:100px!important}.cj-min-h-\\[200px\\]{min-height:200px!important}.cj-min-h-\\[80px\\]{min-height:80px!important}.cj-min-h-screen{min-height:100vh!important}.cj-min-h-svh{min-height:100svh!important}.\\!cj-w-3{width:.75rem!important}.cj-w-0{width:0px!important}.cj-w-1{width:.25rem!important}.cj-w-10{width:2.5rem!important}.cj-w-11{width:2.75rem!important}.cj-w-2{width:.5rem!important}.cj-w-2\\.5{width:.625rem!important}.cj-w-24{width:6rem!important}.cj-w-3{width:.75rem!important}.cj-w-3\\.5{width:.875rem!important}.cj-w-3\\/4{width:75%!important}.cj-w-4{width:1rem!important}.cj-w-5{width:1.25rem!important}.cj-w-64{width:16rem!important}.cj-w-7{width:1.75rem!important}.cj-w-72{width:18rem!important}.cj-w-8{width:2rem!important}.cj-w-9{width:2.25rem!important}.cj-w-96{width:24rem!important}.cj-w-\\[--sidebar-width\\]{width:var(--sidebar-width)!important}.cj-w-\\[100px\\]{width:100px!important}.cj-w-\\[1px\\]{width:1px!important}.cj-w-\\[260px\\]{width:260px!important}.cj-w-\\[calc\\(100\\%-2rem\\)\\]{width:calc(100% - 2rem)!important}.cj-w-auto{width:auto!important}.cj-w-full{width:100%!important}.cj-w-max{width:-moz-max-content!important;width:max-content!important}.cj-w-px{width:1px!important}.cj-min-w-0{min-width:0px!important}.cj-min-w-5{min-width:1.25rem!important}.cj-min-w-\\[12rem\\]{min-width:12rem!important}.cj-min-w-\\[220px\\]{min-width:220px!important}.cj-min-w-\\[8rem\\]{min-width:8rem!important}.cj-min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)!important}.cj-max-w-\\[--skeleton-width\\]{max-width:var(--skeleton-width)!important}.cj-max-w-\\[140px\\]{max-width:140px!important}.cj-max-w-\\[200px\\]{max-width:200px!important}.cj-max-w-\\[240px\\]{max-width:240px!important}.cj-max-w-lg{max-width:32rem!important}.cj-max-w-max{max-width:-moz-max-content!important;max-width:max-content!important}.cj-max-w-md{max-width:28rem!important}.cj-flex-1{flex:1 1 0%!important}.cj-flex-shrink-0,.cj-shrink-0{flex-shrink:0!important}.cj-grow{flex-grow:1!important}.cj-grow-0{flex-grow:0!important}.cj-basis-full{flex-basis:100%!important}.cj-caption-bottom{caption-side:bottom!important}.cj-border-collapse{border-collapse:collapse!important}.-cj-translate-x-1\\/2{--tw-translate-x: -50% !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-cj-translate-x-px{--tw-translate-x: -1px !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-cj-translate-y-1\\/2{--tw-translate-y: -50% !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cj-translate-x-\\[-50\\%\\]{--tw-translate-x: -50% !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cj-translate-x-px{--tw-translate-x: 1px !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cj-translate-y-\\[-50\\%\\]{--tw-translate-y: -50% !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cj-rotate-45{--tw-rotate: 45deg !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cj-rotate-90{--tw-rotate: 90deg !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}@keyframes cj-pulse{50%{opacity:.5}}.cj-animate-pulse{animation:cj-pulse 2s cubic-bezier(.4,0,.6,1) infinite!important}@keyframes cj-spin{to{transform:rotate(360deg)}}.cj-animate-spin{animation:cj-spin 1s linear infinite!important}.cj-cursor-default{cursor:default!important}.cj-cursor-grab{cursor:grab!important}.cj-cursor-pointer{cursor:pointer!important}.cj-cursor-wait{cursor:wait!important}.cj-touch-none{touch-action:none!important}.cj-select-none{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.cj-list-inside{list-style-position:inside!important}.cj-list-disc{list-style-type:disc!important}.cj-list-none{list-style-type:none!important}.cj-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}.cj-flex-row{flex-direction:row!important}.cj-flex-col{flex-direction:column!important}.cj-flex-col-reverse{flex-direction:column-reverse!important}.cj-flex-wrap{flex-wrap:wrap!important}.cj-items-start{align-items:flex-start!important}.cj-items-end{align-items:flex-end!important}.cj-items-center{align-items:center!important}.cj-items-stretch{align-items:stretch!important}.cj-justify-start{justify-content:flex-start!important}.cj-justify-end{justify-content:flex-end!important}.cj-justify-center{justify-content:center!important}.cj-justify-between{justify-content:space-between!important}.cj-gap-1{gap:.25rem!important}.cj-gap-1\\.5{gap:.375rem!important}.cj-gap-2{gap:.5rem!important}.cj-gap-4{gap:1rem!important}.cj-space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0 !important;margin-right:calc(.25rem * var(--tw-space-x-reverse))!important;margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))!important}.cj-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0 !important;margin-right:calc(.5rem * var(--tw-space-x-reverse))!important;margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))!important}.cj-space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0 !important;margin-right:calc(1rem * var(--tw-space-x-reverse))!important;margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))!important}.cj-space-y-0\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(.125rem * var(--tw-space-y-reverse))!important}.cj-space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(.25rem * var(--tw-space-y-reverse))!important}.cj-space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(.375rem * var(--tw-space-y-reverse))!important}.cj-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(.5rem * var(--tw-space-y-reverse))!important}.cj-space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(.75rem * var(--tw-space-y-reverse))!important}.cj-space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(1rem * var(--tw-space-y-reverse))!important}.cj-space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))!important}.cj-divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0 !important;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))!important;border-bottom-width:calc(1px * var(--tw-divide-y-reverse))!important}.cj-overflow-auto{overflow:auto!important}.cj-overflow-hidden{overflow:hidden!important}.cj-overflow-visible{overflow:visible!important}.cj-overflow-y-auto{overflow-y:auto!important}.cj-overflow-x-hidden{overflow-x:hidden!important}.cj-truncate{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.cj-whitespace-nowrap{white-space:nowrap!important}.cj-break-words{overflow-wrap:break-word!important}.cj-break-all{word-break:break-all!important}.cj-rounded{border-radius:.25rem!important}.cj-rounded-\\[2px\\]{border-radius:2px!important}.cj-rounded-\\[inherit\\]{border-radius:inherit!important}.cj-rounded-full{border-radius:9999px!important}.cj-rounded-lg{border-radius:var(--claims-journey-radius)!important}.cj-rounded-md{border-radius:calc(var(--claims-journey-radius) - 2px)!important}.cj-rounded-sm{border-radius:calc(var(--claims-journey-radius) - 4px)!important}.cj-rounded-t-\\[10px\\]{border-top-left-radius:10px!important;border-top-right-radius:10px!important}.cj-rounded-tl-sm{border-top-left-radius:calc(var(--claims-journey-radius) - 4px)!important}.\\!cj-border-2{border-width:2px!important}.cj-border{border-width:1px!important}.cj-border-2{border-width:2px!important}.cj-border-\\[1\\.5px\\]{border-width:1.5px!important}.cj-border-y{border-top-width:1px!important;border-bottom-width:1px!important}.cj-border-b{border-bottom-width:1px!important}.cj-border-l{border-left-width:1px!important}.cj-border-r{border-right-width:1px!important}.cj-border-t{border-top-width:1px!important}.cj-border-dashed{border-style:dashed!important}.\\!cj-border-background{border-color:hsl(var(--claims-journey-background))!important}.\\!cj-border-border{border-color:hsl(var(--claims-journey-border))!important}.cj-border-\\[--color-border\\]{border-color:var(--color-border)!important}.cj-border-background{border-color:hsl(var(--claims-journey-background))!important}.cj-border-border{border-color:hsl(var(--claims-journey-border))!important}.cj-border-border\\/50{border-color:hsl(var(--claims-journey-border) / .5)!important}.cj-border-destructive{border-color:hsl(var(--claims-journey-destructive))!important}.cj-border-destructive\\/30{border-color:hsl(var(--claims-journey-destructive) / .3)!important}.cj-border-destructive\\/50{border-color:hsl(var(--claims-journey-destructive) / .5)!important}.cj-border-input{border-color:hsl(var(--claims-journey-input))!important}.cj-border-muted-foreground\\/25{border-color:hsl(var(--claims-journey-muted-foreground) / .25)!important}.cj-border-primary{border-color:hsl(var(--claims-journey-primary))!important}.cj-border-primary\\/50{border-color:hsl(var(--claims-journey-primary) / .5)!important}.cj-border-sidebar-border{border-color:hsl(var(--claims-journey-sidebar-border))!important}.cj-border-transparent{border-color:transparent!important}.cj-border-yellow-500{--tw-border-opacity: 1 !important;border-color:rgb(234 179 8 / var(--tw-border-opacity, 1))!important}.cj-border-l-transparent{border-left-color:transparent!important}.cj-border-t-transparent{border-top-color:transparent!important}.\\!cj-bg-background{background-color:hsl(var(--claims-journey-background))!important}.\\!cj-bg-primary{background-color:hsl(var(--claims-journey-primary))!important}.cj-bg-\\[--color-bg\\]{background-color:var(--color-bg)!important}.cj-bg-accent{background-color:hsl(var(--claims-journey-accent))!important}.cj-bg-background{background-color:hsl(var(--claims-journey-background))!important}.cj-bg-black\\/80{background-color:#000c!important}.cj-bg-blue-50{--tw-bg-opacity: 1 !important;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))!important}.cj-bg-blue-500{--tw-bg-opacity: 1 !important;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))!important}.cj-bg-border{background-color:hsl(var(--claims-journey-border))!important}.cj-bg-card{background-color:hsl(var(--claims-journey-card))!important}.cj-bg-destructive{background-color:hsl(var(--claims-journey-destructive))!important}.cj-bg-destructive\\/10{background-color:hsl(var(--claims-journey-destructive) / .1)!important}.cj-bg-foreground{background-color:hsl(var(--claims-journey-foreground))!important}.cj-bg-green-500{--tw-bg-opacity: 1 !important;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))!important}.cj-bg-muted{background-color:hsl(var(--claims-journey-muted))!important}.cj-bg-muted\\/30{background-color:hsl(var(--claims-journey-muted) / .3)!important}.cj-bg-muted\\/50{background-color:hsl(var(--claims-journey-muted) / .5)!important}.cj-bg-orange-500{--tw-bg-opacity: 1 !important;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))!important}.cj-bg-popover{background-color:hsl(var(--claims-journey-popover))!important}.cj-bg-primary{background-color:hsl(var(--claims-journey-primary))!important}.cj-bg-purple-500{--tw-bg-opacity: 1 !important;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))!important}.cj-bg-rose-500{--tw-bg-opacity: 1 !important;background-color:rgb(244 63 94 / var(--tw-bg-opacity, 1))!important}.cj-bg-secondary{background-color:hsl(var(--claims-journey-secondary))!important}.cj-bg-sidebar{background-color:hsl(var(--claims-journey-sidebar-background))!important}.cj-bg-sidebar-border{background-color:hsl(var(--claims-journey-sidebar-border))!important}.cj-bg-teal-500{--tw-bg-opacity: 1 !important;background-color:rgb(20 184 166 / var(--tw-bg-opacity, 1))!important}.cj-bg-transparent{background-color:transparent!important}.cj-bg-yellow-500{--tw-bg-opacity: 1 !important;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))!important}.cj-fill-current{fill:currentColor!important}.cj-p-0{padding:0!important}.cj-p-1{padding:.25rem!important}.cj-p-2{padding:.5rem!important}.cj-p-3{padding:.75rem!important}.cj-p-4{padding:1rem!important}.cj-p-6{padding:1.5rem!important}.cj-p-8{padding:2rem!important}.cj-p-\\[1px\\]{padding:1px!important}.cj-px-1{padding-left:.25rem!important;padding-right:.25rem!important}.cj-px-2{padding-left:.5rem!important;padding-right:.5rem!important}.cj-px-2\\.5{padding-left:.625rem!important;padding-right:.625rem!important}.cj-px-3{padding-left:.75rem!important;padding-right:.75rem!important}.cj-px-4{padding-left:1rem!important;padding-right:1rem!important}.cj-px-5{padding-left:1.25rem!important;padding-right:1.25rem!important}.cj-px-8{padding-left:2rem!important;padding-right:2rem!important}.cj-py-0\\.5{padding-top:.125rem!important;padding-bottom:.125rem!important}.cj-py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.cj-py-1\\.5{padding-top:.375rem!important;padding-bottom:.375rem!important}.cj-py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.cj-py-3{padding-top:.75rem!important;padding-bottom:.75rem!important}.cj-py-4{padding-top:1rem!important;padding-bottom:1rem!important}.cj-py-6{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.cj-py-8{padding-top:2rem!important;padding-bottom:2rem!important}.cj-pb-1{padding-bottom:.25rem!important}.cj-pb-3{padding-bottom:.75rem!important}.cj-pb-4{padding-bottom:1rem!important}.cj-pl-1{padding-left:.25rem!important}.cj-pl-2{padding-left:.5rem!important}.cj-pl-2\\.5{padding-left:.625rem!important}.cj-pl-4{padding-left:1rem!important}.cj-pl-8{padding-left:2rem!important}.cj-pl-9{padding-left:2.25rem!important}.cj-pr-1{padding-right:.25rem!important}.cj-pr-2{padding-right:.5rem!important}.cj-pr-2\\.5{padding-right:.625rem!important}.cj-pr-4{padding-right:1rem!important}.cj-pr-8{padding-right:2rem!important}.cj-pt-0{padding-top:0!important}.cj-pt-1{padding-top:.25rem!important}.cj-pt-2{padding-top:.5rem!important}.cj-pt-3{padding-top:.75rem!important}.cj-pt-4{padding-top:1rem!important}.cj-pt-6{padding-top:1.5rem!important}.cj-pt-8{padding-top:2rem!important}.cj-text-left{text-align:left!important}.cj-text-center{text-align:center!important}.cj-align-middle{vertical-align:middle!important}.cj-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace!important}.cj-text-2xl{font-size:1.5rem!important;line-height:2rem!important}.cj-text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.cj-text-\\[0\\.8rem\\]{font-size:.8rem!important}.cj-text-\\[10px\\]{font-size:10px!important}.cj-text-\\[11px\\]{font-size:11px!important}.cj-text-base{font-size:1rem!important;line-height:1.5rem!important}.cj-text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.cj-text-sm{font-size:.875rem!important;line-height:1.25rem!important}.cj-text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.cj-text-xs{font-size:.75rem!important;line-height:1rem!important}.cj-font-bold{font-weight:700!important}.cj-font-medium{font-weight:500!important}.cj-font-normal{font-weight:400!important}.cj-font-semibold{font-weight:600!important}.cj-uppercase{text-transform:uppercase!important}.cj-italic{font-style:italic!important}.cj-tabular-nums{--tw-numeric-spacing: tabular-nums !important;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)!important}.cj-leading-none{line-height:1!important}.cj-leading-tight{line-height:1.25!important}.cj-tracking-tight{letter-spacing:-.025em!important}.cj-tracking-wide{letter-spacing:.025em!important}.cj-tracking-widest{letter-spacing:.1em!important}.cj-text-accent-foreground{color:hsl(var(--claims-journey-accent-foreground))!important}.cj-text-card-foreground{color:hsl(var(--claims-journey-card-foreground))!important}.cj-text-current{color:currentColor!important}.cj-text-destructive{color:hsl(var(--claims-journey-destructive))!important}.cj-text-destructive-foreground{color:hsl(var(--claims-journey-destructive-foreground))!important}.cj-text-destructive\\/80{color:hsl(var(--claims-journey-destructive) / .8)!important}.cj-text-foreground{color:hsl(var(--claims-journey-foreground))!important}.cj-text-foreground\\/50{color:hsl(var(--claims-journey-foreground) / .5)!important}.cj-text-green-500{--tw-text-opacity: 1 !important;color:rgb(34 197 94 / var(--tw-text-opacity, 1))!important}.cj-text-muted-foreground{color:hsl(var(--claims-journey-muted-foreground))!important}.cj-text-popover-foreground{color:hsl(var(--claims-journey-popover-foreground))!important}.cj-text-primary{color:hsl(var(--claims-journey-primary))!important}.cj-text-primary-foreground{color:hsl(var(--claims-journey-primary-foreground))!important}.cj-text-secondary-foreground{color:hsl(var(--claims-journey-secondary-foreground))!important}.cj-text-sidebar-foreground{color:hsl(var(--claims-journey-sidebar-foreground))!important}.cj-text-sidebar-foreground\\/70{color:hsl(var(--claims-journey-sidebar-foreground) / .7)!important}.cj-text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity, 1))!important}.cj-text-yellow-500{--tw-text-opacity: 1 !important;color:rgb(234 179 8 / var(--tw-text-opacity, 1))!important}.cj-text-yellow-600{--tw-text-opacity: 1 !important;color:rgb(202 138 4 / var(--tw-text-opacity, 1))!important}.cj-underline{text-decoration-line:underline!important}.cj-underline-offset-4{text-underline-offset:4px!important}.cj-opacity-0{opacity:0!important}.cj-opacity-50{opacity:.5!important}.cj-opacity-60{opacity:.6!important}.cj-opacity-70{opacity:.7!important}.cj-opacity-90{opacity:.9!important}.cj-shadow-\\[0_0_0_1px_hsl\\(var\\(--claims-journey-sidebar-border\\)\\)\\]{--tw-shadow: 0 0 0 1px hsl(var(--claims-journey-sidebar-border)) !important;--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.cj-shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.cj-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.cj-shadow-none{--tw-shadow: 0 0 #0000 !important;--tw-shadow-colored: 0 0 #0000 !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.cj-shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05) !important;--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.cj-shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.cj-shadow-primary\\/20{--tw-shadow-color: hsl(var(--claims-journey-primary) / .2) !important;--tw-shadow: var(--tw-shadow-colored) !important}.cj-outline-none{outline:2px solid transparent!important;outline-offset:2px!important}.cj-ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.cj-ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.cj-ring-primary\\/20{--tw-ring-color: hsl(var(--claims-journey-primary) / .2) !important}.cj-ring-primary\\/30{--tw-ring-color: hsl(var(--claims-journey-primary) / .3) !important}.cj-ring-ring{--tw-ring-color: hsl(var(--claims-journey-ring)) !important}.cj-ring-sidebar-ring{--tw-ring-color: hsl(var(--claims-journey-sidebar-ring)) !important}.cj-ring-offset-background{--tw-ring-offset-color: hsl(var(--claims-journey-background)) !important}.cj-transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.cj-transition-\\[left\\,right\\,width\\]{transition-property:left,right,width!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.cj-transition-\\[margin\\,opa\\]{transition-property:margin,opa!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.cj-transition-\\[width\\,height\\,padding\\]{transition-property:width,height,padding!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.cj-transition-\\[width\\]{transition-property:width!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.cj-transition-all{transition-property:all!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.cj-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.cj-transition-opacity{transition-property:opacity!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.cj-transition-transform{transition-property:transform!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.cj-duration-1000{transition-duration:1s!important}.cj-duration-150{transition-duration:.15s!important}.cj-duration-200{transition-duration:.2s!important}.cj-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)!important}.cj-ease-linear{transition-timing-function:linear!important}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.cj-animate-in{animation-name:enter!important;animation-duration:.15s!important;--tw-enter-opacity: initial !important;--tw-enter-scale: initial !important;--tw-enter-rotate: initial !important;--tw-enter-translate-x: initial !important;--tw-enter-translate-y: initial !important}.cj-fade-in-0{--tw-enter-opacity: 0 !important}.cj-fade-in-80{--tw-enter-opacity: .8 !important}.cj-zoom-in-95{--tw-enter-scale: .95 !important}.cj-duration-1000{animation-duration:1s!important}.cj-duration-150{animation-duration:.15s!important}.cj-duration-200{animation-duration:.2s!important}.cj-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)!important}.cj-ease-linear{animation-timing-function:linear!important}.file\\:cj-border-0::file-selector-button{border-width:0px!important}.file\\:cj-bg-transparent::file-selector-button{background-color:transparent!important}.file\\:cj-text-sm::file-selector-button{font-size:.875rem!important;line-height:1.25rem!important}.file\\:cj-font-medium::file-selector-button{font-weight:500!important}.file\\:cj-text-foreground::file-selector-button{color:hsl(var(--claims-journey-foreground))!important}.placeholder\\:cj-text-muted-foreground::-moz-placeholder{color:hsl(var(--claims-journey-muted-foreground))!important}.placeholder\\:cj-text-muted-foreground::placeholder{color:hsl(var(--claims-journey-muted-foreground))!important}.after\\:cj-absolute:after{content:var(--tw-content)!important;position:absolute!important}.after\\:-cj-inset-2:after{content:var(--tw-content)!important;top:-.5rem!important;right:-.5rem!important;bottom:-.5rem!important;left:-.5rem!important}.after\\:cj-inset-y-0:after{content:var(--tw-content)!important;top:0!important;bottom:0!important}.after\\:cj-left-1\\/2:after{content:var(--tw-content)!important;left:50%!important}.after\\:cj-w-1:after{content:var(--tw-content)!important;width:.25rem!important}.after\\:cj-w-\\[2px\\]:after{content:var(--tw-content)!important;width:2px!important}.after\\:-cj-translate-x-1\\/2:after{content:var(--tw-content)!important;--tw-translate-x: -50% !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.first\\:cj-rounded-l-md:first-child{border-top-left-radius:calc(var(--claims-journey-radius) - 2px)!important;border-bottom-left-radius:calc(var(--claims-journey-radius) - 2px)!important}.first\\:cj-border-l:first-child{border-left-width:1px!important}.first\\:cj-pt-0:first-child{padding-top:0!important}.last\\:cj-rounded-r-md:last-child{border-top-right-radius:calc(var(--claims-journey-radius) - 2px)!important;border-bottom-right-radius:calc(var(--claims-journey-radius) - 2px)!important}.last\\:cj-pb-0:last-child{padding-bottom:0!important}.focus-within\\:cj-relative:focus-within{position:relative!important}.focus-within\\:cj-z-20:focus-within{z-index:20!important}.hover\\:\\!cj-h-4:hover{height:1rem!important}.hover\\:\\!cj-w-4:hover{width:1rem!important}.hover\\:cj-border-destructive\\/75:hover{border-color:hsl(var(--claims-journey-destructive) / .75)!important}.hover\\:cj-border-muted-foreground\\/50:hover{border-color:hsl(var(--claims-journey-muted-foreground) / .5)!important}.hover\\:cj-border-primary\\/50:hover{border-color:hsl(var(--claims-journey-primary) / .5)!important}.hover\\:\\!cj-bg-primary\\/80:hover{background-color:hsl(var(--claims-journey-primary) / .8)!important}.hover\\:cj-bg-accent:hover{background-color:hsl(var(--claims-journey-accent))!important}.hover\\:cj-bg-accent\\/50:hover{background-color:hsl(var(--claims-journey-accent) / .5)!important}.hover\\:cj-bg-destructive\\/80:hover{background-color:hsl(var(--claims-journey-destructive) / .8)!important}.hover\\:cj-bg-destructive\\/90:hover{background-color:hsl(var(--claims-journey-destructive) / .9)!important}.hover\\:cj-bg-muted:hover{background-color:hsl(var(--claims-journey-muted))!important}.hover\\:cj-bg-muted\\/50:hover{background-color:hsl(var(--claims-journey-muted) / .5)!important}.hover\\:cj-bg-primary:hover{background-color:hsl(var(--claims-journey-primary))!important}.hover\\:cj-bg-primary\\/80:hover{background-color:hsl(var(--claims-journey-primary) / .8)!important}.hover\\:cj-bg-primary\\/90:hover{background-color:hsl(var(--claims-journey-primary) / .9)!important}.hover\\:cj-bg-secondary:hover{background-color:hsl(var(--claims-journey-secondary))!important}.hover\\:cj-bg-secondary\\/80:hover{background-color:hsl(var(--claims-journey-secondary) / .8)!important}.hover\\:cj-bg-sidebar-accent:hover{background-color:hsl(var(--claims-journey-sidebar-accent))!important}.hover\\:cj-text-accent-foreground:hover{color:hsl(var(--claims-journey-accent-foreground))!important}.hover\\:cj-text-destructive:hover{color:hsl(var(--claims-journey-destructive))!important}.hover\\:cj-text-foreground:hover{color:hsl(var(--claims-journey-foreground))!important}.hover\\:cj-text-muted-foreground:hover{color:hsl(var(--claims-journey-muted-foreground))!important}.hover\\:cj-text-primary-foreground:hover{color:hsl(var(--claims-journey-primary-foreground))!important}.hover\\:cj-text-primary\\/90:hover{color:hsl(var(--claims-journey-primary) / .9)!important}.hover\\:cj-text-sidebar-accent-foreground:hover{color:hsl(var(--claims-journey-sidebar-accent-foreground))!important}.hover\\:cj-text-yellow-600:hover{--tw-text-opacity: 1 !important;color:rgb(202 138 4 / var(--tw-text-opacity, 1))!important}.hover\\:cj-underline:hover{text-decoration-line:underline!important}.hover\\:cj-opacity-100:hover{opacity:1!important}.hover\\:cj-shadow-\\[0_0_0_1px_hsl\\(var\\(--claims-journey-sidebar-accent\\)\\)\\]:hover{--tw-shadow: 0 0 0 1px hsl(var(--claims-journey-sidebar-accent)) !important;--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.hover\\:after\\:cj-bg-sidebar-border:hover:after{content:var(--tw-content)!important;background-color:hsl(var(--claims-journey-sidebar-border))!important}.focus\\:cj-bg-accent:focus{background-color:hsl(var(--claims-journey-accent))!important}.focus\\:cj-bg-primary:focus{background-color:hsl(var(--claims-journey-primary))!important}.focus\\:cj-text-accent-foreground:focus{color:hsl(var(--claims-journey-accent-foreground))!important}.focus\\:cj-text-primary-foreground:focus{color:hsl(var(--claims-journey-primary-foreground))!important}.focus\\:cj-opacity-100:focus{opacity:1!important}.focus\\:cj-outline-none:focus{outline:2px solid transparent!important;outline-offset:2px!important}.focus\\:cj-ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.focus\\:cj-ring-ring:focus{--tw-ring-color: hsl(var(--claims-journey-ring)) !important}.focus\\:cj-ring-offset-2:focus{--tw-ring-offset-width: 2px !important}.focus-visible\\:cj-outline-none:focus-visible{outline:2px solid transparent!important;outline-offset:2px!important}.focus-visible\\:cj-ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.focus-visible\\:cj-ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.focus-visible\\:cj-ring-ring:focus-visible{--tw-ring-color: hsl(var(--claims-journey-ring)) !important}.focus-visible\\:cj-ring-sidebar-ring:focus-visible{--tw-ring-color: hsl(var(--claims-journey-sidebar-ring)) !important}.focus-visible\\:cj-ring-offset-1:focus-visible{--tw-ring-offset-width: 1px !important}.focus-visible\\:cj-ring-offset-2:focus-visible{--tw-ring-offset-width: 2px !important}.focus-visible\\:cj-ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--claims-journey-background)) !important}.active\\:cj-cursor-grabbing:active{cursor:grabbing!important}.active\\:cj-bg-sidebar-accent:active{background-color:hsl(var(--claims-journey-sidebar-accent))!important}.active\\:cj-text-sidebar-accent-foreground:active{color:hsl(var(--claims-journey-sidebar-accent-foreground))!important}.disabled\\:cj-pointer-events-none:disabled{pointer-events:none!important}.disabled\\:cj-cursor-not-allowed:disabled{cursor:not-allowed!important}.disabled\\:cj-opacity-50:disabled{opacity:.5!important}.cj-group\\/menu-item:focus-within .group-focus-within\\/menu-item\\:cj-opacity-100{opacity:1!important}.cj-group\\/menu-item:hover .group-hover\\/menu-item\\:cj-opacity-100,.cj-group:hover .group-hover\\:cj-opacity-100{opacity:1!important}.cj-group.destructive .group-\\[\\.destructive\\]\\:cj-border-muted\\/40{border-color:hsl(var(--claims-journey-muted) / .4)!important}.cj-group.toaster .group-\\[\\.toaster\\]\\:cj-border-border{border-color:hsl(var(--claims-journey-border))!important}.cj-group.toast .group-\\[\\.toast\\]\\:cj-bg-muted{background-color:hsl(var(--claims-journey-muted))!important}.cj-group.toast .group-\\[\\.toast\\]\\:cj-bg-primary{background-color:hsl(var(--claims-journey-primary))!important}.cj-group.toaster .group-\\[\\.toaster\\]\\:cj-bg-background{background-color:hsl(var(--claims-journey-background))!important}.cj-group.destructive .group-\\[\\.destructive\\]\\:cj-text-red-300{--tw-text-opacity: 1 !important;color:rgb(252 165 165 / var(--tw-text-opacity, 1))!important}.cj-group.toast .group-\\[\\.toast\\]\\:cj-text-muted-foreground{color:hsl(var(--claims-journey-muted-foreground))!important}.cj-group.toast .group-\\[\\.toast\\]\\:cj-text-primary-foreground{color:hsl(var(--claims-journey-primary-foreground))!important}.cj-group.toaster .group-\\[\\.toaster\\]\\:cj-text-foreground{color:hsl(var(--claims-journey-foreground))!important}.cj-group.toaster .group-\\[\\.toaster\\]\\:cj-shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.cj-group.destructive .group-\\[\\.destructive\\]\\:hover\\:cj-border-destructive\\/30:hover{border-color:hsl(var(--claims-journey-destructive) / .3)!important}.cj-group.destructive .group-\\[\\.destructive\\]\\:hover\\:cj-bg-destructive:hover{background-color:hsl(var(--claims-journey-destructive))!important}.cj-group.destructive .group-\\[\\.destructive\\]\\:hover\\:cj-text-destructive-foreground:hover{color:hsl(var(--claims-journey-destructive-foreground))!important}.cj-group.destructive .group-\\[\\.destructive\\]\\:hover\\:cj-text-red-50:hover{--tw-text-opacity: 1 !important;color:rgb(254 242 242 / var(--tw-text-opacity, 1))!important}.cj-group.destructive .group-\\[\\.destructive\\]\\:focus\\:cj-ring-destructive:focus{--tw-ring-color: hsl(var(--claims-journey-destructive)) !important}.cj-group.destructive .group-\\[\\.destructive\\]\\:focus\\:cj-ring-red-400:focus{--tw-ring-opacity: 1 !important;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity, 1)) !important}.cj-group.destructive .group-\\[\\.destructive\\]\\:focus\\:cj-ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626 !important}.cj-peer\\/menu-button:hover~.peer-hover\\/menu-button\\:cj-text-sidebar-accent-foreground{color:hsl(var(--claims-journey-sidebar-accent-foreground))!important}.cj-peer:disabled~.peer-disabled\\:cj-cursor-not-allowed{cursor:not-allowed!important}.cj-peer:disabled~.peer-disabled\\:cj-opacity-70{opacity:.7!important}.has-\\[\\[data-variant\\=inset\\]\\]\\:cj-bg-sidebar:has([data-variant=inset]){background-color:hsl(var(--claims-journey-sidebar-background))!important}.has-\\[\\:disabled\\]\\:cj-opacity-50:has(:disabled){opacity:.5!important}.cj-group\\/menu-item:has([data-sidebar=menu-action]) .group-has-\\[\\[data-sidebar\\=menu-action\\]\\]\\/menu-item\\:cj-pr-8{padding-right:2rem!important}.aria-disabled\\:cj-pointer-events-none[aria-disabled=true]{pointer-events:none!important}.aria-disabled\\:cj-opacity-50[aria-disabled=true]{opacity:.5!important}.aria-selected\\:cj-bg-accent[aria-selected=true]{background-color:hsl(var(--claims-journey-accent))!important}.aria-selected\\:cj-bg-accent\\/50[aria-selected=true]{background-color:hsl(var(--claims-journey-accent) / .5)!important}.aria-selected\\:cj-text-accent-foreground[aria-selected=true]{color:hsl(var(--claims-journey-accent-foreground))!important}.aria-selected\\:cj-text-muted-foreground[aria-selected=true]{color:hsl(var(--claims-journey-muted-foreground))!important}.aria-selected\\:cj-opacity-100[aria-selected=true]{opacity:1!important}.aria-selected\\:cj-opacity-30[aria-selected=true]{opacity:.3!important}.data-\\[disabled\\=true\\]\\:cj-pointer-events-none[data-disabled=true],.data-\\[disabled\\]\\:cj-pointer-events-none[data-disabled]{pointer-events:none!important}.data-\\[panel-group-direction\\=vertical\\]\\:cj-h-px[data-panel-group-direction=vertical]{height:1px!important}.data-\\[panel-group-direction\\=vertical\\]\\:cj-w-full[data-panel-group-direction=vertical]{width:100%!important}.data-\\[side\\=bottom\\]\\:cj-translate-y-1[data-side=bottom]{--tw-translate-y: .25rem !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.data-\\[side\\=left\\]\\:-cj-translate-x-1[data-side=left]{--tw-translate-x: -.25rem !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.data-\\[side\\=right\\]\\:cj-translate-x-1[data-side=right]{--tw-translate-x: .25rem !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.data-\\[side\\=top\\]\\:-cj-translate-y-1[data-side=top]{--tw-translate-y: -.25rem !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.data-\\[state\\=checked\\]\\:cj-translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.data-\\[state\\=unchecked\\]\\:cj-translate-x-0[data-state=unchecked],.data-\\[swipe\\=cancel\\]\\:cj-translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.data-\\[swipe\\=end\\]\\:cj-translate-x-\\[var\\(--radix-toast-swipe-end-x\\)\\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x) !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.data-\\[swipe\\=move\\]\\:cj-translate-x-\\[var\\(--radix-toast-swipe-move-x\\)\\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x) !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}@keyframes cj-accordion-up{0%{height:var(--radix-accordion-content-height)}to{height:0}}.data-\\[state\\=closed\\]\\:cj-animate-accordion-up[data-state=closed]{animation:cj-accordion-up .2s ease-out!important}@keyframes cj-accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height)}}.data-\\[state\\=open\\]\\:cj-animate-accordion-down[data-state=open]{animation:cj-accordion-down .2s ease-out!important}.data-\\[panel-group-direction\\=vertical\\]\\:cj-flex-col[data-panel-group-direction=vertical]{flex-direction:column!important}.data-\\[active\\=true\\]\\:cj-bg-sidebar-accent[data-active=true]{background-color:hsl(var(--claims-journey-sidebar-accent))!important}.data-\\[active\\]\\:cj-bg-accent\\/50[data-active]{background-color:hsl(var(--claims-journey-accent) / .5)!important}.data-\\[selected\\=\\'true\\'\\]\\:cj-bg-accent[data-selected=true]{background-color:hsl(var(--claims-journey-accent))!important}.data-\\[state\\=active\\]\\:cj-bg-background[data-state=active]{background-color:hsl(var(--claims-journey-background))!important}.data-\\[state\\=checked\\]\\:cj-bg-primary[data-state=checked]{background-color:hsl(var(--claims-journey-primary))!important}.data-\\[state\\=on\\]\\:cj-bg-accent[data-state=on],.data-\\[state\\=open\\]\\:cj-bg-accent[data-state=open]{background-color:hsl(var(--claims-journey-accent))!important}.data-\\[state\\=open\\]\\:cj-bg-accent\\/50[data-state=open]{background-color:hsl(var(--claims-journey-accent) / .5)!important}.data-\\[state\\=open\\]\\:cj-bg-secondary[data-state=open]{background-color:hsl(var(--claims-journey-secondary))!important}.data-\\[state\\=selected\\]\\:cj-bg-muted[data-state=selected]{background-color:hsl(var(--claims-journey-muted))!important}.data-\\[state\\=unchecked\\]\\:cj-bg-input[data-state=unchecked]{background-color:hsl(var(--claims-journey-input))!important}.data-\\[active\\=true\\]\\:cj-font-medium[data-active=true]{font-weight:500!important}.data-\\[active\\=true\\]\\:cj-text-sidebar-accent-foreground[data-active=true]{color:hsl(var(--claims-journey-sidebar-accent-foreground))!important}.data-\\[selected\\=true\\]\\:cj-text-accent-foreground[data-selected=true]{color:hsl(var(--claims-journey-accent-foreground))!important}.data-\\[state\\=active\\]\\:cj-text-foreground[data-state=active]{color:hsl(var(--claims-journey-foreground))!important}.data-\\[state\\=checked\\]\\:cj-text-primary-foreground[data-state=checked]{color:hsl(var(--claims-journey-primary-foreground))!important}.data-\\[state\\=on\\]\\:cj-text-accent-foreground[data-state=on],.data-\\[state\\=open\\]\\:cj-text-accent-foreground[data-state=open]{color:hsl(var(--claims-journey-accent-foreground))!important}.data-\\[state\\=open\\]\\:cj-text-muted-foreground[data-state=open]{color:hsl(var(--claims-journey-muted-foreground))!important}.data-\\[disabled\\=true\\]\\:cj-opacity-50[data-disabled=true],.data-\\[disabled\\]\\:cj-opacity-50[data-disabled]{opacity:.5!important}.data-\\[state\\=open\\]\\:cj-opacity-100[data-state=open]{opacity:1!important}.data-\\[state\\=active\\]\\:cj-shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05) !important;--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.data-\\[swipe\\=move\\]\\:cj-transition-none[data-swipe=move]{transition-property:none!important}.data-\\[state\\=closed\\]\\:cj-duration-300[data-state=closed]{transition-duration:.3s!important}.data-\\[state\\=open\\]\\:cj-duration-500[data-state=open]{transition-duration:.5s!important}.data-\\[motion\\^\\=from-\\]\\:cj-animate-in[data-motion^=from-],.data-\\[state\\=open\\]\\:cj-animate-in[data-state=open],.data-\\[state\\=visible\\]\\:cj-animate-in[data-state=visible]{animation-name:enter!important;animation-duration:.15s!important;--tw-enter-opacity: initial !important;--tw-enter-scale: initial !important;--tw-enter-rotate: initial !important;--tw-enter-translate-x: initial !important;--tw-enter-translate-y: initial !important}.data-\\[motion\\^\\=to-\\]\\:cj-animate-out[data-motion^=to-],.data-\\[state\\=closed\\]\\:cj-animate-out[data-state=closed],.data-\\[state\\=hidden\\]\\:cj-animate-out[data-state=hidden],.data-\\[swipe\\=end\\]\\:cj-animate-out[data-swipe=end]{animation-name:exit!important;animation-duration:.15s!important;--tw-exit-opacity: initial !important;--tw-exit-scale: initial !important;--tw-exit-rotate: initial !important;--tw-exit-translate-x: initial !important;--tw-exit-translate-y: initial !important}.data-\\[motion\\^\\=from-\\]\\:cj-fade-in[data-motion^=from-]{--tw-enter-opacity: 0 !important}.data-\\[motion\\^\\=to-\\]\\:cj-fade-out[data-motion^=to-],.data-\\[state\\=closed\\]\\:cj-fade-out-0[data-state=closed]{--tw-exit-opacity: 0 !important}.data-\\[state\\=closed\\]\\:cj-fade-out-80[data-state=closed]{--tw-exit-opacity: .8 !important}.data-\\[state\\=hidden\\]\\:cj-fade-out[data-state=hidden]{--tw-exit-opacity: 0 !important}.data-\\[state\\=open\\]\\:cj-fade-in-0[data-state=open],.data-\\[state\\=visible\\]\\:cj-fade-in[data-state=visible]{--tw-enter-opacity: 0 !important}.data-\\[state\\=closed\\]\\:cj-zoom-out-95[data-state=closed]{--tw-exit-scale: .95 !important}.data-\\[state\\=open\\]\\:cj-zoom-in-90[data-state=open]{--tw-enter-scale: .9 !important}.data-\\[state\\=open\\]\\:cj-zoom-in-95[data-state=open]{--tw-enter-scale: .95 !important}.data-\\[motion\\=from-end\\]\\:cj-slide-in-from-right-52[data-motion=from-end]{--tw-enter-translate-x: 13rem !important}.data-\\[motion\\=from-start\\]\\:cj-slide-in-from-left-52[data-motion=from-start]{--tw-enter-translate-x: -13rem !important}.data-\\[motion\\=to-end\\]\\:cj-slide-out-to-right-52[data-motion=to-end]{--tw-exit-translate-x: 13rem !important}.data-\\[motion\\=to-start\\]\\:cj-slide-out-to-left-52[data-motion=to-start]{--tw-exit-translate-x: -13rem !important}.data-\\[side\\=bottom\\]\\:cj-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem !important}.data-\\[side\\=left\\]\\:cj-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem !important}.data-\\[side\\=right\\]\\:cj-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem !important}.data-\\[side\\=top\\]\\:cj-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem !important}.data-\\[state\\=closed\\]\\:cj-slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100% !important}.data-\\[state\\=closed\\]\\:cj-slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100% !important}.data-\\[state\\=closed\\]\\:cj-slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x: -50% !important}.data-\\[state\\=closed\\]\\:cj-slide-out-to-right[data-state=closed],.data-\\[state\\=closed\\]\\:cj-slide-out-to-right-full[data-state=closed]{--tw-exit-translate-x: 100% !important}.data-\\[state\\=closed\\]\\:cj-slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100% !important}.data-\\[state\\=closed\\]\\:cj-slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y: -48% !important}.data-\\[state\\=open\\]\\:cj-slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100% !important}.data-\\[state\\=open\\]\\:cj-slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100% !important}.data-\\[state\\=open\\]\\:cj-slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x: -50% !important}.data-\\[state\\=open\\]\\:cj-slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100% !important}.data-\\[state\\=open\\]\\:cj-slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100% !important}.data-\\[state\\=open\\]\\:cj-slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y: -48% !important}.data-\\[state\\=open\\]\\:cj-slide-in-from-top-full[data-state=open]{--tw-enter-translate-y: -100% !important}.data-\\[state\\=closed\\]\\:cj-duration-300[data-state=closed]{animation-duration:.3s!important}.data-\\[state\\=open\\]\\:cj-duration-500[data-state=open]{animation-duration:.5s!important}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:cj-left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content)!important;left:0!important}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:cj-h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content)!important;height:.25rem!important}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:cj-w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content)!important;width:100%!important}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:-cj-translate-y-1\\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content)!important;--tw-translate-y: -50% !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:cj-translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content)!important;--tw-translate-x: 0px !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.data-\\[state\\=open\\]\\:hover\\:cj-bg-sidebar-accent:hover[data-state=open]{background-color:hsl(var(--claims-journey-sidebar-accent))!important}.data-\\[state\\=open\\]\\:hover\\:cj-text-sidebar-accent-foreground:hover[data-state=open]{color:hsl(var(--claims-journey-sidebar-accent-foreground))!important}.cj-group[data-collapsible=offcanvas] .group-data-\\[collapsible\\=offcanvas\\]\\:cj-left-\\[calc\\(var\\(--sidebar-width\\)\\*-1\\)\\]{left:calc(var(--sidebar-width) * -1)!important}.cj-group[data-collapsible=offcanvas] .group-data-\\[collapsible\\=offcanvas\\]\\:cj-right-\\[calc\\(var\\(--sidebar-width\\)\\*-1\\)\\]{right:calc(var(--sidebar-width) * -1)!important}.cj-group[data-side=left] .group-data-\\[side\\=left\\]\\:-cj-right-4{right:-1rem!important}.cj-group[data-side=right] .group-data-\\[side\\=right\\]\\:cj-left-0{left:0!important}.cj-group[data-collapsible=icon] .group-data-\\[collapsible\\=icon\\]\\:-cj-mt-8{margin-top:-2rem!important}.cj-group[data-collapsible=icon] .group-data-\\[collapsible\\=icon\\]\\:cj-hidden{display:none!important}.cj-group[data-collapsible=icon] .group-data-\\[collapsible\\=icon\\]\\:cj-w-\\[--sidebar-width-icon\\]{width:var(--sidebar-width-icon)!important}.cj-group[data-collapsible=icon] .group-data-\\[collapsible\\=icon\\]\\:cj-w-\\[calc\\(var\\(--sidebar-width-icon\\)_\\+_theme\\(spacing\\.4\\)\\)\\]{width:calc(var(--sidebar-width-icon) + 1rem)!important}.cj-group[data-collapsible=icon] .group-data-\\[collapsible\\=icon\\]\\:cj-w-\\[calc\\(var\\(--sidebar-width-icon\\)_\\+_theme\\(spacing\\.4\\)_\\+2px\\)\\]{width:calc(var(--sidebar-width-icon) + 1rem + 2px)!important}.cj-group[data-collapsible=offcanvas] .group-data-\\[collapsible\\=offcanvas\\]\\:cj-w-0{width:0px!important}.cj-group[data-collapsible=offcanvas] .group-data-\\[collapsible\\=offcanvas\\]\\:cj-translate-x-0{--tw-translate-x: 0px !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cj-group[data-side=right] .group-data-\\[side\\=right\\]\\:cj-rotate-180,.cj-group[data-state=open] .group-data-\\[state\\=open\\]\\:cj-rotate-180{--tw-rotate: 180deg !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cj-group[data-collapsible=icon] .group-data-\\[collapsible\\=icon\\]\\:cj-overflow-hidden{overflow:hidden!important}.cj-group[data-variant=floating] .group-data-\\[variant\\=floating\\]\\:cj-rounded-lg{border-radius:var(--claims-journey-radius)!important}.cj-group[data-variant=floating] .group-data-\\[variant\\=floating\\]\\:cj-border{border-width:1px!important}.cj-group[data-side=left] .group-data-\\[side\\=left\\]\\:cj-border-r{border-right-width:1px!important}.cj-group[data-side=right] .group-data-\\[side\\=right\\]\\:cj-border-l{border-left-width:1px!important}.cj-group[data-variant=floating] .group-data-\\[variant\\=floating\\]\\:cj-border-sidebar-border{border-color:hsl(var(--claims-journey-sidebar-border))!important}.cj-group[data-collapsible=icon] .group-data-\\[collapsible\\=icon\\]\\:cj-opacity-0{opacity:0!important}.cj-group[data-variant=floating] .group-data-\\[variant\\=floating\\]\\:cj-shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.cj-group[data-collapsible=offcanvas] .group-data-\\[collapsible\\=offcanvas\\]\\:after\\:cj-left-full:after{content:var(--tw-content)!important;left:100%!important}.cj-group[data-collapsible=offcanvas] .group-data-\\[collapsible\\=offcanvas\\]\\:hover\\:cj-bg-sidebar:hover{background-color:hsl(var(--claims-journey-sidebar-background))!important}.cj-peer\\/menu-button[data-size=default]~.peer-data-\\[size\\=default\\]\\/menu-button\\:cj-top-1\\.5{top:.375rem!important}.cj-peer\\/menu-button[data-size=lg]~.peer-data-\\[size\\=lg\\]\\/menu-button\\:cj-top-2\\.5{top:.625rem!important}.cj-peer\\/menu-button[data-size=sm]~.peer-data-\\[size\\=sm\\]\\/menu-button\\:cj-top-1{top:.25rem!important}.cj-peer[data-variant=inset]~.peer-data-\\[variant\\=inset\\]\\:cj-min-h-\\[calc\\(100svh-theme\\(spacing\\.4\\)\\)\\]{min-height:calc(100svh - 1rem)!important}.cj-peer\\/menu-button[data-active=true]~.peer-data-\\[active\\=true\\]\\/menu-button\\:cj-text-sidebar-accent-foreground{color:hsl(var(--claims-journey-sidebar-accent-foreground))!important}.dark\\:cj-border-destructive:is(.cj-dark *){border-color:hsl(var(--claims-journey-destructive))!important}.dark\\:cj-bg-blue-950:is(.cj-dark *){--tw-bg-opacity: 1 !important;background-color:rgb(23 37 84 / var(--tw-bg-opacity, 1))!important}@media (min-width: 640px){.sm\\:cj-bottom-0{bottom:0!important}.sm\\:cj-right-0{right:0!important}.sm\\:cj-top-auto{top:auto!important}.sm\\:cj-mt-0{margin-top:0!important}.sm\\:cj-flex{display:flex!important}.sm\\:cj-max-w-lg{max-width:32rem!important}.sm\\:cj-max-w-sm{max-width:24rem!important}.sm\\:cj-flex-row{flex-direction:row!important}.sm\\:cj-flex-col{flex-direction:column!important}.sm\\:cj-justify-end{justify-content:flex-end!important}.sm\\:cj-gap-2\\.5{gap:.625rem!important}.sm\\:cj-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0 !important;margin-right:calc(.5rem * var(--tw-space-x-reverse))!important;margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))!important}.sm\\:cj-space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0 !important;margin-right:calc(1rem * var(--tw-space-x-reverse))!important;margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))!important}.sm\\:cj-space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(0px * var(--tw-space-y-reverse))!important}.sm\\:cj-rounded-lg{border-radius:var(--claims-journey-radius)!important}.sm\\:cj-text-left{text-align:left!important}.data-\\[state\\=open\\]\\:sm\\:cj-slide-in-from-bottom-full[data-state=open]{--tw-enter-translate-y: 100% !important}}@media (min-width: 768px){.md\\:cj-absolute{position:absolute!important}.md\\:cj-block{display:block!important}.md\\:cj-flex{display:flex!important}.md\\:cj-w-\\[var\\(--radix-navigation-menu-viewport-width\\)\\]{width:var(--radix-navigation-menu-viewport-width)!important}.md\\:cj-w-auto{width:auto!important}.md\\:cj-max-w-\\[420px\\]{max-width:420px!important}.md\\:cj-text-sm{font-size:.875rem!important;line-height:1.25rem!important}.md\\:cj-opacity-0{opacity:0!important}.after\\:md\\:cj-hidden:after{content:var(--tw-content)!important;display:none!important}.cj-peer[data-variant=inset]~.md\\:peer-data-\\[variant\\=inset\\]\\:cj-m-2{margin:.5rem!important}.cj-peer[data-state=collapsed][data-variant=inset]~.md\\:peer-data-\\[state\\=collapsed\\]\\:peer-data-\\[variant\\=inset\\]\\:cj-ml-2{margin-left:.5rem!important}.cj-peer[data-variant=inset]~.md\\:peer-data-\\[variant\\=inset\\]\\:cj-ml-0{margin-left:0!important}.cj-peer[data-variant=inset]~.md\\:peer-data-\\[variant\\=inset\\]\\:cj-rounded-xl{border-radius:.75rem!important}.cj-peer[data-variant=inset]~.md\\:peer-data-\\[variant\\=inset\\]\\:cj-shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}}.\\[\\&\\:has\\(\\[aria-selected\\]\\)\\]\\:cj-bg-accent:has([aria-selected]){background-color:hsl(var(--claims-journey-accent))!important}.first\\:\\[\\&\\:has\\(\\[aria-selected\\]\\)\\]\\:cj-rounded-l-md:has([aria-selected]):first-child{border-top-left-radius:calc(var(--claims-journey-radius) - 2px)!important;border-bottom-left-radius:calc(var(--claims-journey-radius) - 2px)!important}.last\\:\\[\\&\\:has\\(\\[aria-selected\\]\\)\\]\\:cj-rounded-r-md:has([aria-selected]):last-child{border-top-right-radius:calc(var(--claims-journey-radius) - 2px)!important;border-bottom-right-radius:calc(var(--claims-journey-radius) - 2px)!important}.\\[\\&\\:has\\(\\[aria-selected\\]\\.day-outside\\)\\]\\:cj-bg-accent\\/50:has([aria-selected].day-outside){background-color:hsl(var(--claims-journey-accent) / .5)!important}.\\[\\&\\:has\\(\\[aria-selected\\]\\.day-range-end\\)\\]\\:cj-rounded-r-md:has([aria-selected].day-range-end){border-top-right-radius:calc(var(--claims-journey-radius) - 2px)!important;border-bottom-right-radius:calc(var(--claims-journey-radius) - 2px)!important}.\\[\\&\\:has\\(\\[role\\=checkbox\\]\\)\\]\\:cj-pr-0:has([role=checkbox]){padding-right:0!important}.\\[\\&\\>button\\]\\:cj-hidden>button{display:none!important}.\\[\\&\\>div\\>div\\]\\:\\!cj-block>div>div{display:block!important}.\\[\\&\\>span\\:last-child\\]\\:cj-truncate>span:last-child{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.\\[\\&\\>span\\]\\:cj-line-clamp-1>span{overflow:hidden!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:1!important}.\\[\\&\\>svg\\+div\\]\\:cj-translate-y-\\[-3px\\]>svg+div{--tw-translate-y: -3px !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.\\[\\&\\>svg\\]\\:cj-absolute>svg{position:absolute!important}.\\[\\&\\>svg\\]\\:cj-left-4>svg{left:1rem!important}.\\[\\&\\>svg\\]\\:cj-top-4>svg{top:1rem!important}.\\[\\&\\>svg\\]\\:cj-size-3\\.5>svg{width:.875rem!important;height:.875rem!important}.\\[\\&\\>svg\\]\\:cj-size-4>svg{width:1rem!important;height:1rem!important}.\\[\\&\\>svg\\]\\:cj-h-2\\.5>svg{height:.625rem!important}.\\[\\&\\>svg\\]\\:cj-h-3>svg{height:.75rem!important}.\\[\\&\\>svg\\]\\:cj-w-2\\.5>svg{width:.625rem!important}.\\[\\&\\>svg\\]\\:cj-w-3>svg{width:.75rem!important}.\\[\\&\\>svg\\]\\:cj-shrink-0>svg{flex-shrink:0!important}.\\[\\&\\>svg\\]\\:cj-text-destructive>svg{color:hsl(var(--claims-journey-destructive))!important}.\\[\\&\\>svg\\]\\:cj-text-foreground>svg{color:hsl(var(--claims-journey-foreground))!important}.\\[\\&\\>svg\\]\\:cj-text-muted-foreground>svg{color:hsl(var(--claims-journey-muted-foreground))!important}.\\[\\&\\>svg\\]\\:cj-text-sidebar-accent-foreground>svg{color:hsl(var(--claims-journey-sidebar-accent-foreground))!important}.\\[\\&\\>svg\\~\\*\\]\\:cj-pl-7>svg~*{padding-left:1.75rem!important}.\\[\\&\\>tr\\]\\:last\\:cj-border-b-0:last-child>tr{border-bottom-width:0px!important}.\\[\\&\\[data-panel-group-direction\\=vertical\\]\\>div\\]\\:cj-rotate-90[data-panel-group-direction=vertical]>div{--tw-rotate: 90deg !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.\\[\\&\\[data-state\\=open\\]\\>svg\\]\\:cj-rotate-180[data-state=open]>svg{--tw-rotate: 180deg !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.\\[\\&_\\.recharts-cartesian-axis-tick_text\\]\\:cj-fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--claims-journey-muted-foreground))!important}.\\[\\&_\\.recharts-cartesian-grid_line\\[stroke\\=\\'\\#ccc\\'\\]\\]\\:cj-stroke-border\\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--claims-journey-border) / .5)!important}.\\[\\&_\\.recharts-curve\\.recharts-tooltip-cursor\\]\\:cj-stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--claims-journey-border))!important}.\\[\\&_\\.recharts-dot\\[stroke\\=\\'\\#fff\\'\\]\\]\\:cj-stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent!important}.\\[\\&_\\.recharts-layer\\]\\:cj-outline-none .recharts-layer{outline:2px solid transparent!important;outline-offset:2px!important}.\\[\\&_\\.recharts-polar-grid_\\[stroke\\=\\'\\#ccc\\'\\]\\]\\:cj-stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--claims-journey-border))!important}.\\[\\&_\\.recharts-radial-bar-background-sector\\]\\:cj-fill-muted .recharts-radial-bar-background-sector,.\\[\\&_\\.recharts-rectangle\\.recharts-tooltip-cursor\\]\\:cj-fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--claims-journey-muted))!important}.\\[\\&_\\.recharts-reference-line_\\[stroke\\=\\'\\#ccc\\'\\]\\]\\:cj-stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--claims-journey-border))!important}.\\[\\&_\\.recharts-sector\\[stroke\\=\\'\\#fff\\'\\]\\]\\:cj-stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent!important}.\\[\\&_\\.recharts-sector\\]\\:cj-outline-none .recharts-sector,.\\[\\&_\\.recharts-surface\\]\\:cj-outline-none .recharts-surface{outline:2px solid transparent!important;outline-offset:2px!important}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:cj-px-2 [cmdk-group-heading]{padding-left:.5rem!important;padding-right:.5rem!important}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:cj-py-1\\.5 [cmdk-group-heading]{padding-top:.375rem!important;padding-bottom:.375rem!important}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:cj-text-xs [cmdk-group-heading]{font-size:.75rem!important;line-height:1rem!important}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:cj-font-medium [cmdk-group-heading]{font-weight:500!important}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:cj-text-muted-foreground [cmdk-group-heading]{color:hsl(var(--claims-journey-muted-foreground))!important}.\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:cj-pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0!important}.\\[\\&_\\[cmdk-group\\]\\]\\:cj-px-2 [cmdk-group]{padding-left:.5rem!important;padding-right:.5rem!important}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:cj-h-5 [cmdk-input-wrapper] svg{height:1.25rem!important}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:cj-w-5 [cmdk-input-wrapper] svg{width:1.25rem!important}.\\[\\&_\\[cmdk-input\\]\\]\\:cj-h-12 [cmdk-input]{height:3rem!important}.\\[\\&_\\[cmdk-item\\]\\]\\:cj-px-2 [cmdk-item]{padding-left:.5rem!important;padding-right:.5rem!important}.\\[\\&_\\[cmdk-item\\]\\]\\:cj-py-3 [cmdk-item]{padding-top:.75rem!important;padding-bottom:.75rem!important}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:cj-h-5 [cmdk-item] svg{height:1.25rem!important}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:cj-w-5 [cmdk-item] svg{width:1.25rem!important}.\\[\\&_button\\]\\:cj-ring-offset-0 button,.\\[\\&_input\\]\\:cj-ring-offset-0 input{--tw-ring-offset-width: 0px !important}.\\[\\&_input\\]\\:focus-visible\\:cj-border-ring:focus-visible input{border-color:hsl(var(--claims-journey-ring))!important}.\\[\\&_input\\]\\:focus-visible\\:cj-ring-0:focus-visible input{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.\\[\\&_p\\]\\:cj-leading-relaxed p{line-height:1.625!important}.\\[\\&_svg\\]\\:cj-pointer-events-none svg{pointer-events:none!important}.\\[\\&_svg\\]\\:cj-size-4 svg{width:1rem!important;height:1rem!important}.\\[\\&_svg\\]\\:cj-shrink-0 svg{flex-shrink:0!important}.\\[\\&_tr\\:last-child\\]\\:cj-border-0 tr:last-child{border-width:0px!important}.\\[\\&_tr\\]\\:cj-border-b tr{border-bottom-width:1px!important}[data-side=left][data-collapsible=offcanvas] .\\[\\[data-side\\=left\\]\\[data-collapsible\\=offcanvas\\]_\\&\\]\\:-cj-right-2{right:-.5rem!important}[data-side=left][data-state=collapsed] .\\[\\[data-side\\=left\\]\\[data-state\\=collapsed\\]_\\&\\]\\:cj-cursor-e-resize{cursor:e-resize!important}[data-side=left] .\\[\\[data-side\\=left\\]_\\&\\]\\:cj-cursor-w-resize{cursor:w-resize!important}[data-side=right][data-collapsible=offcanvas] .\\[\\[data-side\\=right\\]\\[data-collapsible\\=offcanvas\\]_\\&\\]\\:-cj-left-2{left:-.5rem!important}[data-side=right][data-state=collapsed] .\\[\\[data-side\\=right\\]\\[data-state\\=collapsed\\]_\\&\\]\\:cj-cursor-w-resize{cursor:w-resize!important}[data-side=right] .\\[\\[data-side\\=right\\]_\\&\\]\\:cj-cursor-e-resize{cursor:e-resize!important}[data-state=closed]>.\\[\\[data-state\\=closed\\]\\>\\&\\]\\:cj-rotate-\\[-90deg\\]{--tw-rotate: -90deg !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}`)),document.head.appendChild(t)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),C=require("react"),Js=require("react-dom");function jf(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const w=jf(C),Zs=jf(Js),Xl=e=>{let t;const n=new Set,r=(l,f)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const h=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(m=>m(t,h))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=t=e(r,o,i);return i},eb=e=>e?Xl(e):Xl,tb=e=>e;function nb(e,t=tb){const n=C.useSyncExternalStore(e.subscribe,C.useCallback(()=>t(e.getState()),[e,t]),C.useCallback(()=>t(e.getInitialState()),[e,t]));return C.useDebugValue(n),n}const Kl=e=>{const t=eb(e),n=r=>nb(t,r);return Object.assign(n,t),n},rb=e=>e?Kl(e):Kl;function Te(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Te(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var ob={value:()=>{}};function Qs(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ps(n)}function ps(e){this._=e}function sb(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ps.prototype=Qs.prototype={constructor:ps,on:function(e,t){var n=this._,r=sb(e+"",n),o,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((o=(e=r[s]).type)&&(o=ab(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(o=(e=r[s]).type)n[o]=Jl(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Jl(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ps(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,s;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,o=s.length;r<o;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,s=r.length;o<s;++o)r[o].value.apply(t,n)}};function ab(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function Jl(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=ob,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Di="http://www.w3.org/1999/xhtml";const Zl={svg:"http://www.w3.org/2000/svg",xhtml:Di,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ea(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Zl.hasOwnProperty(t)?{space:Zl[t],local:e}:e}function ib(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Di&&t.documentElement.namespaceURI===Di?t.createElement(e):t.createElementNS(n,e)}}function cb(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Sf(e){var t=ea(e);return(t.local?cb:ib)(t)}function lb(){}function yc(e){return e==null?lb:function(){return this.querySelector(e)}}function ub(e){typeof e!="function"&&(e=yc(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var s=t[o],a=s.length,i=r[o]=new Array(a),c,l,f=0;f<a;++f)(c=s[f])&&(l=e.call(c,c.__data__,f,s))&&("__data__"in c&&(l.__data__=c.__data__),i[f]=l);return new at(r,this._parents)}function db(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function fb(){return[]}function Cf(e){return e==null?fb:function(){return this.querySelectorAll(e)}}function hb(e){return function(){return db(e.apply(this,arguments))}}function mb(e){typeof e=="function"?e=hb(e):e=Cf(e);for(var t=this._groups,n=t.length,r=[],o=[],s=0;s<n;++s)for(var a=t[s],i=a.length,c,l=0;l<i;++l)(c=a[l])&&(r.push(e.call(c,c.__data__,l,a)),o.push(c));return new at(r,o)}function Nf(e){return function(){return this.matches(e)}}function Ef(e){return function(t){return t.matches(e)}}var pb=Array.prototype.find;function gb(e){return function(){return pb.call(this.children,e)}}function yb(){return this.firstElementChild}function xb(e){return this.select(e==null?yb:gb(typeof e=="function"?e:Ef(e)))}var vb=Array.prototype.filter;function bb(){return Array.from(this.children)}function wb(e){return function(){return vb.call(this.children,e)}}function jb(e){return this.selectAll(e==null?bb:wb(typeof e=="function"?e:Ef(e)))}function Sb(e){typeof e!="function"&&(e=Nf(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var s=t[o],a=s.length,i=r[o]=[],c,l=0;l<a;++l)(c=s[l])&&e.call(c,c.__data__,l,s)&&i.push(c);return new at(r,this._parents)}function _f(e){return new Array(e.length)}function Cb(){return new at(this._enter||this._groups.map(_f),this._parents)}function Ns(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ns.prototype={constructor:Ns,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Nb(e){return function(){return e}}function Eb(e,t,n,r,o,s){for(var a=0,i,c=t.length,l=s.length;a<l;++a)(i=t[a])?(i.__data__=s[a],r[a]=i):n[a]=new Ns(e,s[a]);for(;a<c;++a)(i=t[a])&&(o[a]=i)}function _b(e,t,n,r,o,s,a){var i,c,l=new Map,f=t.length,d=s.length,h=new Array(f),m;for(i=0;i<f;++i)(c=t[i])&&(h[i]=m=a.call(c,c.__data__,i,t)+"",l.has(m)?o[i]=c:l.set(m,c));for(i=0;i<d;++i)m=a.call(e,s[i],i,s)+"",(c=l.get(m))?(r[i]=c,c.__data__=s[i],l.delete(m)):n[i]=new Ns(e,s[i]);for(i=0;i<f;++i)(c=t[i])&&l.get(h[i])===c&&(o[i]=c)}function kb(e){return e.__data__}function Mb(e,t){if(!arguments.length)return Array.from(this,kb);var n=t?_b:Eb,r=this._parents,o=this._groups;typeof e!="function"&&(e=Nb(e));for(var s=o.length,a=new Array(s),i=new Array(s),c=new Array(s),l=0;l<s;++l){var f=r[l],d=o[l],h=d.length,m=Pb(e.call(f,f&&f.__data__,l,r)),g=m.length,p=i[l]=new Array(g),y=a[l]=new Array(g),v=c[l]=new Array(h);n(f,d,p,y,v,m,t);for(var b=0,x=0,j,N;b<g;++b)if(j=p[b]){for(b>=x&&(x=b+1);!(N=y[x])&&++x<g;);j._next=N||null}}return a=new at(a,r),a._enter=i,a._exit=c,a}function Pb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Db(){return new at(this._exit||this._groups.map(_f),this._parents)}function Ob(e,t,n){var r=this.enter(),o=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?s.remove():n(s),r&&o?r.merge(o).order():o}function Rb(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,s=r.length,a=Math.min(o,s),i=new Array(o),c=0;c<a;++c)for(var l=n[c],f=r[c],d=l.length,h=i[c]=new Array(d),m,g=0;g<d;++g)(m=l[g]||f[g])&&(h[g]=m);for(;c<o;++c)i[c]=n[c];return new at(i,this._parents)}function Ab(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,s=r[o],a;--o>=0;)(a=r[o])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function Tb(e){e||(e=Ib);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,r=n.length,o=new Array(r),s=0;s<r;++s){for(var a=n[s],i=a.length,c=o[s]=new Array(i),l,f=0;f<i;++f)(l=a[f])&&(c[f]=l);c.sort(t)}return new at(o,this._parents).order()}function Ib(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function $b(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function zb(){return Array.from(this)}function Lb(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,s=r.length;o<s;++o){var a=r[o];if(a)return a}return null}function Wb(){let e=0;for(const t of this)++e;return e}function Fb(){return!this.node()}function Bb(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],s=0,a=o.length,i;s<a;++s)(i=o[s])&&e.call(i,i.__data__,s,o);return this}function Hb(e){return function(){this.removeAttribute(e)}}function Vb(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Yb(e,t){return function(){this.setAttribute(e,t)}}function qb(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Gb(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Ub(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Xb(e,t){var n=ea(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Vb:Hb:typeof t=="function"?n.local?Ub:Gb:n.local?qb:Yb)(n,t))}function kf(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Kb(e){return function(){this.style.removeProperty(e)}}function Jb(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Zb(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Qb(e,t,n){return arguments.length>1?this.each((t==null?Kb:typeof t=="function"?Zb:Jb)(e,t,n??"")):xr(this.node(),e)}function xr(e,t){return e.style.getPropertyValue(t)||kf(e).getComputedStyle(e,null).getPropertyValue(t)}function e0(e){return function(){delete this[e]}}function t0(e,t){return function(){this[e]=t}}function n0(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function r0(e,t){return arguments.length>1?this.each((t==null?e0:typeof t=="function"?n0:t0)(e,t)):this.node()[e]}function Mf(e){return e.trim().split(/^|\s+/)}function xc(e){return e.classList||new Pf(e)}function Pf(e){this._node=e,this._names=Mf(e.getAttribute("class")||"")}Pf.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Df(e,t){for(var n=xc(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Of(e,t){for(var n=xc(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function o0(e){return function(){Df(this,e)}}function s0(e){return function(){Of(this,e)}}function a0(e,t){return function(){(t.apply(this,arguments)?Df:Of)(this,e)}}function i0(e,t){var n=Mf(e+"");if(arguments.length<2){for(var r=xc(this.node()),o=-1,s=n.length;++o<s;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?a0:t?o0:s0)(n,t))}function c0(){this.textContent=""}function l0(e){return function(){this.textContent=e}}function u0(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function d0(e){return arguments.length?this.each(e==null?c0:(typeof e=="function"?u0:l0)(e)):this.node().textContent}function f0(){this.innerHTML=""}function h0(e){return function(){this.innerHTML=e}}function m0(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function p0(e){return arguments.length?this.each(e==null?f0:(typeof e=="function"?m0:h0)(e)):this.node().innerHTML}function g0(){this.nextSibling&&this.parentNode.appendChild(this)}function y0(){return this.each(g0)}function x0(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function v0(){return this.each(x0)}function b0(e){var t=typeof e=="function"?e:Sf(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function w0(){return null}function j0(e,t){var n=typeof e=="function"?e:Sf(e),r=t==null?w0:typeof t=="function"?t:yc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function S0(){var e=this.parentNode;e&&e.removeChild(this)}function C0(){return this.each(S0)}function N0(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function E0(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function _0(e){return this.select(e?E0:N0)}function k0(e){return arguments.length?this.property("__data__",e):this.node().__data__}function M0(e){return function(t){e.call(this,t,this.__data__)}}function P0(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function D0(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,s;n<o;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function O0(e,t,n){return function(){var r=this.__on,o,s=M0(t);if(r){for(var a=0,i=r.length;a<i;++a)if((o=r[a]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=s,o.options=n),o.value=t;return}}this.addEventListener(e.type,s,n),o={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(o):this.__on=[o]}}function R0(e,t,n){var r=P0(e+""),o,s=r.length,a;if(arguments.length<2){var i=this.node().__on;if(i){for(var c=0,l=i.length,f;c<l;++c)for(o=0,f=i[c];o<s;++o)if((a=r[o]).type===f.type&&a.name===f.name)return f.value}return}for(i=t?O0:D0,o=0;o<s;++o)this.each(i(r[o],t,n));return this}function Rf(e,t,n){var r=kf(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function A0(e,t){return function(){return Rf(this,e,t)}}function T0(e,t){return function(){return Rf(this,e,t.apply(this,arguments))}}function I0(e,t){return this.each((typeof t=="function"?T0:A0)(e,t))}function*$0(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,s=r.length,a;o<s;++o)(a=r[o])&&(yield a)}var Af=[null];function at(e,t){this._groups=e,this._parents=t}function Do(){return new at([[document.documentElement]],Af)}function z0(){return this}at.prototype=Do.prototype={constructor:at,select:ub,selectAll:mb,selectChild:xb,selectChildren:jb,filter:Sb,data:Mb,enter:Cb,exit:Db,join:Ob,merge:Rb,selection:z0,order:Ab,sort:Tb,call:$b,nodes:zb,node:Lb,size:Wb,empty:Fb,each:Bb,attr:Xb,style:Qb,property:r0,classed:i0,text:d0,html:p0,raise:y0,lower:v0,append:b0,insert:j0,remove:C0,clone:_0,datum:k0,on:R0,dispatch:I0,[Symbol.iterator]:$0};function ot(e){return typeof e=="string"?new at([[document.querySelector(e)]],[document.documentElement]):new at([[e]],Af)}function L0(e){let t;for(;t=e.sourceEvent;)e=t;return e}function pt(e,t){if(e=L0(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const W0={passive:!1},fo={capture:!0,passive:!1};function Ga(e){e.stopImmediatePropagation()}function fr(e){e.preventDefault(),e.stopImmediatePropagation()}function Tf(e){var t=e.document.documentElement,n=ot(e).on("dragstart.drag",fr,fo);"onselectstart"in t?n.on("selectstart.drag",fr,fo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function If(e,t){var n=e.document.documentElement,r=ot(e).on("dragstart.drag",null);t&&(r.on("click.drag",fr,fo),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Jo=e=>()=>e;function Oi(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:s,x:a,y:i,dx:c,dy:l,dispatch:f}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:i,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:f}})}Oi.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function F0(e){return!e.ctrlKey&&!e.button}function B0(){return this.parentNode}function H0(e,t){return t??{x:e.x,y:e.y}}function V0(){return navigator.maxTouchPoints||"ontouchstart"in this}function $f(){var e=F0,t=B0,n=H0,r=V0,o={},s=Qs("start","drag","end"),a=0,i,c,l,f,d=0;function h(j){j.on("mousedown.drag",m).filter(r).on("touchstart.drag",y).on("touchmove.drag",v,W0).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(j,N){if(!(f||!e.call(this,j,N))){var S=x(this,t.call(this,j,N),j,N,"mouse");S&&(ot(j.view).on("mousemove.drag",g,fo).on("mouseup.drag",p,fo),Tf(j.view),Ga(j),l=!1,i=j.clientX,c=j.clientY,S("start",j))}}function g(j){if(fr(j),!l){var N=j.clientX-i,S=j.clientY-c;l=N*N+S*S>d}o.mouse("drag",j)}function p(j){ot(j.view).on("mousemove.drag mouseup.drag",null),If(j.view,l),fr(j),o.mouse("end",j)}function y(j,N){if(e.call(this,j,N)){var S=j.changedTouches,E=t.call(this,j,N),O=S.length,P,T;for(P=0;P<O;++P)(T=x(this,E,j,N,S[P].identifier,S[P]))&&(Ga(j),T("start",j,S[P]))}}function v(j){var N=j.changedTouches,S=N.length,E,O;for(E=0;E<S;++E)(O=o[N[E].identifier])&&(fr(j),O("drag",j,N[E]))}function b(j){var N=j.changedTouches,S=N.length,E,O;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),E=0;E<S;++E)(O=o[N[E].identifier])&&(Ga(j),O("end",j,N[E]))}function x(j,N,S,E,O,P){var T=s.copy(),k=pt(P||S,N),M,W,_;if((_=n.call(j,new Oi("beforestart",{sourceEvent:S,target:h,identifier:O,active:a,x:k[0],y:k[1],dx:0,dy:0,dispatch:T}),E))!=null)return M=_.x-k[0]||0,W=_.y-k[1]||0,function I(R,z,A){var D=k,B;switch(R){case"start":o[O]=I,B=a++;break;case"end":delete o[O],--a;case"drag":k=pt(A||z,N),B=a;break}T.call(R,j,new Oi(R,{sourceEvent:z,subject:_,target:h,identifier:O,active:B,x:k[0]+M,y:k[1]+W,dx:k[0]-D[0],dy:k[1]-D[1],dispatch:T}),E)}}return h.filter=function(j){return arguments.length?(e=typeof j=="function"?j:Jo(!!j),h):e},h.container=function(j){return arguments.length?(t=typeof j=="function"?j:Jo(j),h):t},h.subject=function(j){return arguments.length?(n=typeof j=="function"?j:Jo(j),h):n},h.touchable=function(j){return arguments.length?(r=typeof j=="function"?j:Jo(!!j),h):r},h.on=function(){var j=s.on.apply(s,arguments);return j===s?h:j},h.clickDistance=function(j){return arguments.length?(d=(j=+j)*j,h):Math.sqrt(d)},h}function vc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function zf(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Oo(){}var ho=.7,Es=1/ho,hr="\\s*([+-]?\\d+)\\s*",mo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Bt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Y0=/^#([0-9a-f]{3,8})$/,q0=new RegExp(`^rgb\\(${hr},${hr},${hr}\\)$`),G0=new RegExp(`^rgb\\(${Bt},${Bt},${Bt}\\)$`),U0=new RegExp(`^rgba\\(${hr},${hr},${hr},${mo}\\)$`),X0=new RegExp(`^rgba\\(${Bt},${Bt},${Bt},${mo}\\)$`),K0=new RegExp(`^hsl\\(${mo},${Bt},${Bt}\\)$`),J0=new RegExp(`^hsla\\(${mo},${Bt},${Bt},${mo}\\)$`),Ql={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};vc(Oo,zn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:eu,formatHex:eu,formatHex8:Z0,formatHsl:Q0,formatRgb:tu,toString:tu});function eu(){return this.rgb().formatHex()}function Z0(){return this.rgb().formatHex8()}function Q0(){return Lf(this).formatHsl()}function tu(){return this.rgb().formatRgb()}function zn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Y0.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?nu(t):n===3?new Je(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Zo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Zo(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=q0.exec(e))?new Je(t[1],t[2],t[3],1):(t=G0.exec(e))?new Je(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=U0.exec(e))?Zo(t[1],t[2],t[3],t[4]):(t=X0.exec(e))?Zo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=K0.exec(e))?su(t[1],t[2]/100,t[3]/100,1):(t=J0.exec(e))?su(t[1],t[2]/100,t[3]/100,t[4]):Ql.hasOwnProperty(e)?nu(Ql[e]):e==="transparent"?new Je(NaN,NaN,NaN,0):null}function nu(e){return new Je(e>>16&255,e>>8&255,e&255,1)}function Zo(e,t,n,r){return r<=0&&(e=t=n=NaN),new Je(e,t,n,r)}function ew(e){return e instanceof Oo||(e=zn(e)),e?(e=e.rgb(),new Je(e.r,e.g,e.b,e.opacity)):new Je}function Ri(e,t,n,r){return arguments.length===1?ew(e):new Je(e,t,n,r??1)}function Je(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}vc(Je,Ri,zf(Oo,{brighter(e){return e=e==null?Es:Math.pow(Es,e),new Je(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ho:Math.pow(ho,e),new Je(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Je(Tn(this.r),Tn(this.g),Tn(this.b),_s(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ru,formatHex:ru,formatHex8:tw,formatRgb:ou,toString:ou}));function ru(){return`#${Rn(this.r)}${Rn(this.g)}${Rn(this.b)}`}function tw(){return`#${Rn(this.r)}${Rn(this.g)}${Rn(this.b)}${Rn((isNaN(this.opacity)?1:this.opacity)*255)}`}function ou(){const e=_s(this.opacity);return`${e===1?"rgb(":"rgba("}${Tn(this.r)}, ${Tn(this.g)}, ${Tn(this.b)}${e===1?")":`, ${e})`}`}function _s(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Tn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Rn(e){return e=Tn(e),(e<16?"0":"")+e.toString(16)}function su(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new yt(e,t,n,r)}function Lf(e){if(e instanceof yt)return new yt(e.h,e.s,e.l,e.opacity);if(e instanceof Oo||(e=zn(e)),!e)return new yt;if(e instanceof yt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,i=s-o,c=(s+o)/2;return i?(t===s?a=(n-r)/i+(n<r)*6:n===s?a=(r-t)/i+2:a=(t-n)/i+4,i/=c<.5?s+o:2-s-o,a*=60):i=c>0&&c<1?0:a,new yt(a,i,c,e.opacity)}function nw(e,t,n,r){return arguments.length===1?Lf(e):new yt(e,t,n,r??1)}function yt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}vc(yt,nw,zf(Oo,{brighter(e){return e=e==null?Es:Math.pow(Es,e),new yt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ho:Math.pow(ho,e),new yt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Je(Ua(e>=240?e-240:e+120,o,r),Ua(e,o,r),Ua(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new yt(au(this.h),Qo(this.s),Qo(this.l),_s(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=_s(this.opacity);return`${e===1?"hsl(":"hsla("}${au(this.h)}, ${Qo(this.s)*100}%, ${Qo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function au(e){return e=(e||0)%360,e<0?e+360:e}function Qo(e){return Math.max(0,Math.min(1,e||0))}function Ua(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const bc=e=>()=>e;function rw(e,t){return function(n){return e+n*t}}function ow(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function sw(e){return(e=+e)==1?Wf:function(t,n){return n-t?ow(t,n,e):bc(isNaN(t)?n:t)}}function Wf(e,t){var n=t-e;return n?rw(e,n):bc(isNaN(e)?t:e)}const ks=function e(t){var n=sw(t);function r(o,s){var a=n((o=Ri(o)).r,(s=Ri(s)).r),i=n(o.g,s.g),c=n(o.b,s.b),l=Wf(o.opacity,s.opacity);return function(f){return o.r=a(f),o.g=i(f),o.b=c(f),o.opacity=l(f),o+""}}return r.gamma=e,r}(1);function aw(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(s){for(o=0;o<n;++o)r[o]=e[o]*(1-s)+t[o]*s;return r}}function iw(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function cw(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,o=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)o[a]=lo(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(i){for(a=0;a<r;++a)s[a]=o[a](i);return s}}function lw(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Tt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function uw(e,t){var n={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=lo(e[o],t[o]):r[o]=t[o];return function(s){for(o in n)r[o]=n[o](s);return r}}var Ai=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xa=new RegExp(Ai.source,"g");function dw(e){return function(){return e}}function fw(e){return function(t){return e(t)+""}}function Ff(e,t){var n=Ai.lastIndex=Xa.lastIndex=0,r,o,s,a=-1,i=[],c=[];for(e=e+"",t=t+"";(r=Ai.exec(e))&&(o=Xa.exec(t));)(s=o.index)>n&&(s=t.slice(n,s),i[a]?i[a]+=s:i[++a]=s),(r=r[0])===(o=o[0])?i[a]?i[a]+=o:i[++a]=o:(i[++a]=null,c.push({i:a,x:Tt(r,o)})),n=Xa.lastIndex;return n<t.length&&(s=t.slice(n),i[a]?i[a]+=s:i[++a]=s),i.length<2?c[0]?fw(c[0].x):dw(t):(t=c.length,function(l){for(var f=0,d;f<t;++f)i[(d=c[f]).i]=d.x(l);return i.join("")})}function lo(e,t){var n=typeof t,r;return t==null||n==="boolean"?bc(t):(n==="number"?Tt:n==="string"?(r=zn(t))?(t=r,ks):Ff:t instanceof zn?ks:t instanceof Date?lw:iw(t)?aw:Array.isArray(t)?cw:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?uw:Tt)(e,t)}var iu=180/Math.PI,Ti={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Bf(e,t,n,r,o,s){var a,i,c;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(i=Math.sqrt(n*n+r*r))&&(n/=i,r/=i,c/=i),e*r<t*n&&(e=-e,t=-t,c=-c,a=-a),{translateX:o,translateY:s,rotate:Math.atan2(t,e)*iu,skewX:Math.atan(c)*iu,scaleX:a,scaleY:i}}var es;function hw(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ti:Bf(t.a,t.b,t.c,t.d,t.e,t.f)}function mw(e){return e==null||(es||(es=document.createElementNS("http://www.w3.org/2000/svg","g")),es.setAttribute("transform",e),!(e=es.transform.baseVal.consolidate()))?Ti:(e=e.matrix,Bf(e.a,e.b,e.c,e.d,e.e,e.f))}function Hf(e,t,n,r){function o(l){return l.length?l.pop()+" ":""}function s(l,f,d,h,m,g){if(l!==d||f!==h){var p=m.push("translate(",null,t,null,n);g.push({i:p-4,x:Tt(l,d)},{i:p-2,x:Tt(f,h)})}else(d||h)&&m.push("translate("+d+t+h+n)}function a(l,f,d,h){l!==f?(l-f>180?f+=360:f-l>180&&(l+=360),h.push({i:d.push(o(d)+"rotate(",null,r)-2,x:Tt(l,f)})):f&&d.push(o(d)+"rotate("+f+r)}function i(l,f,d,h){l!==f?h.push({i:d.push(o(d)+"skewX(",null,r)-2,x:Tt(l,f)}):f&&d.push(o(d)+"skewX("+f+r)}function c(l,f,d,h,m,g){if(l!==d||f!==h){var p=m.push(o(m)+"scale(",null,",",null,")");g.push({i:p-4,x:Tt(l,d)},{i:p-2,x:Tt(f,h)})}else(d!==1||h!==1)&&m.push(o(m)+"scale("+d+","+h+")")}return function(l,f){var d=[],h=[];return l=e(l),f=e(f),s(l.translateX,l.translateY,f.translateX,f.translateY,d,h),a(l.rotate,f.rotate,d,h),i(l.skewX,f.skewX,d,h),c(l.scaleX,l.scaleY,f.scaleX,f.scaleY,d,h),l=f=null,function(m){for(var g=-1,p=h.length,y;++g<p;)d[(y=h[g]).i]=y.x(m);return d.join("")}}}var pw=Hf(hw,"px, ","px)","deg)"),gw=Hf(mw,", ",")",")"),yw=1e-12;function cu(e){return((e=Math.exp(e))+1/e)/2}function xw(e){return((e=Math.exp(e))-1/e)/2}function vw(e){return((e=Math.exp(2*e))-1)/(e+1)}const gs=function e(t,n,r){function o(s,a){var i=s[0],c=s[1],l=s[2],f=a[0],d=a[1],h=a[2],m=f-i,g=d-c,p=m*m+g*g,y,v;if(p<yw)v=Math.log(h/l)/t,y=function(E){return[i+E*m,c+E*g,l*Math.exp(t*E*v)]};else{var b=Math.sqrt(p),x=(h*h-l*l+r*p)/(2*l*n*b),j=(h*h-l*l-r*p)/(2*h*n*b),N=Math.log(Math.sqrt(x*x+1)-x),S=Math.log(Math.sqrt(j*j+1)-j);v=(S-N)/t,y=function(E){var O=E*v,P=cu(N),T=l/(n*b)*(P*vw(t*O+N)-xw(N));return[i+T*m,c+T*g,l*P/cu(t*O+N)]}}return y.duration=v*1e3*t/Math.SQRT2,y}return o.rho=function(s){var a=Math.max(.001,+s),i=a*a,c=i*i;return e(a,i,c)},o}(Math.SQRT2,2,4);var vr=0,Qr=0,Vr=0,Vf=1e3,Ms,eo,Ps=0,Ln=0,ta=0,po=typeof performance=="object"&&performance.now?performance:Date,Yf=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function wc(){return Ln||(Yf(bw),Ln=po.now()+ta)}function bw(){Ln=0}function Ds(){this._call=this._time=this._next=null}Ds.prototype=qf.prototype={constructor:Ds,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?wc():+n)+(t==null?0:+t),!this._next&&eo!==this&&(eo?eo._next=this:Ms=this,eo=this),this._call=e,this._time=n,Ii()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ii())}};function qf(e,t,n){var r=new Ds;return r.restart(e,t,n),r}function ww(){wc(),++vr;for(var e=Ms,t;e;)(t=Ln-e._time)>=0&&e._call.call(void 0,t),e=e._next;--vr}function lu(){Ln=(Ps=po.now())+ta,vr=Qr=0;try{ww()}finally{vr=0,Sw(),Ln=0}}function jw(){var e=po.now(),t=e-Ps;t>Vf&&(ta-=t,Ps=e)}function Sw(){for(var e,t=Ms,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ms=n);eo=e,Ii(r)}function Ii(e){if(!vr){Qr&&(Qr=clearTimeout(Qr));var t=e-Ln;t>24?(e<1/0&&(Qr=setTimeout(lu,e-po.now()-ta)),Vr&&(Vr=clearInterval(Vr))):(Vr||(Ps=po.now(),Vr=setInterval(jw,Vf)),vr=1,Yf(lu))}}function uu(e,t,n){var r=new Ds;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var Cw=Qs("start","end","cancel","interrupt"),Nw=[],Gf=0,du=1,$i=2,ys=3,fu=4,zi=5,xs=6;function na(e,t,n,r,o,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Ew(e,n,{name:t,index:r,group:o,on:Cw,tween:Nw,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Gf})}function jc(e,t){var n=Et(e,t);if(n.state>Gf)throw new Error("too late; already scheduled");return n}function Yt(e,t){var n=Et(e,t);if(n.state>ys)throw new Error("too late; already running");return n}function Et(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Ew(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=qf(s,0,n.time);function s(l){n.state=du,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var f,d,h,m;if(n.state!==du)return c();for(f in r)if(m=r[f],m.name===n.name){if(m.state===ys)return uu(a);m.state===fu?(m.state=xs,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[f]):+f<t&&(m.state=xs,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete r[f])}if(uu(function(){n.state===ys&&(n.state=fu,n.timer.restart(i,n.delay,n.time),i(l))}),n.state=$i,n.on.call("start",e,e.__data__,n.index,n.group),n.state===$i){for(n.state=ys,o=new Array(h=n.tween.length),f=0,d=-1;f<h;++f)(m=n.tween[f].value.call(e,e.__data__,n.index,n.group))&&(o[++d]=m);o.length=d+1}}function i(l){for(var f=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=zi,1),d=-1,h=o.length;++d<h;)o[d].call(e,f);n.state===zi&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=xs,n.timer.stop(),delete r[t];for(var l in r)return;delete e.__transition}}function vs(e,t){var n=e.__transition,r,o,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}o=r.state>$i&&r.state<zi,r.state=xs,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function _w(e){return this.each(function(){vs(this,e)})}function kw(e,t){var n,r;return function(){var o=Yt(this,e),s=o.tween;if(s!==n){r=n=s;for(var a=0,i=r.length;a<i;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}o.tween=r}}function Mw(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var s=Yt(this,e),a=s.tween;if(a!==r){o=(r=a).slice();for(var i={name:t,value:n},c=0,l=o.length;c<l;++c)if(o[c].name===t){o[c]=i;break}c===l&&o.push(i)}s.tween=o}}function Pw(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Et(this.node(),n).tween,o=0,s=r.length,a;o<s;++o)if((a=r[o]).name===e)return a.value;return null}return this.each((t==null?kw:Mw)(n,e,t))}function Sc(e,t,n){var r=e._id;return e.each(function(){var o=Yt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Et(o,r).value[t]}}function Uf(e,t){var n;return(typeof t=="number"?Tt:t instanceof zn?ks:(n=zn(t))?(t=n,ks):Ff)(e,t)}function Dw(e){return function(){this.removeAttribute(e)}}function Ow(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Rw(e,t,n){var r,o=n+"",s;return function(){var a=this.getAttribute(e);return a===o?null:a===r?s:s=t(r=a,n)}}function Aw(e,t,n){var r,o=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===o?null:a===r?s:s=t(r=a,n)}}function Tw(e,t,n){var r,o,s;return function(){var a,i=n(this),c;return i==null?void this.removeAttribute(e):(a=this.getAttribute(e),c=i+"",a===c?null:a===r&&c===o?s:(o=c,s=t(r=a,i)))}}function Iw(e,t,n){var r,o,s;return function(){var a,i=n(this),c;return i==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),c=i+"",a===c?null:a===r&&c===o?s:(o=c,s=t(r=a,i)))}}function $w(e,t){var n=ea(e),r=n==="transform"?gw:Uf;return this.attrTween(e,typeof t=="function"?(n.local?Iw:Tw)(n,r,Sc(this,"attr."+e,t)):t==null?(n.local?Ow:Dw)(n):(n.local?Aw:Rw)(n,r,t))}function zw(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Lw(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Ww(e,t){var n,r;function o(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&Lw(e,s)),n}return o._value=t,o}function Fw(e,t){var n,r;function o(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&zw(e,s)),n}return o._value=t,o}function Bw(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=ea(e);return this.tween(n,(r.local?Ww:Fw)(r,t))}function Hw(e,t){return function(){jc(this,e).delay=+t.apply(this,arguments)}}function Vw(e,t){return t=+t,function(){jc(this,e).delay=t}}function Yw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Hw:Vw)(t,e)):Et(this.node(),t).delay}function qw(e,t){return function(){Yt(this,e).duration=+t.apply(this,arguments)}}function Gw(e,t){return t=+t,function(){Yt(this,e).duration=t}}function Uw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?qw:Gw)(t,e)):Et(this.node(),t).duration}function Xw(e,t){if(typeof t!="function")throw new Error;return function(){Yt(this,e).ease=t}}function Kw(e){var t=this._id;return arguments.length?this.each(Xw(t,e)):Et(this.node(),t).ease}function Jw(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Yt(this,e).ease=n}}function Zw(e){if(typeof e!="function")throw new Error;return this.each(Jw(this._id,e))}function Qw(e){typeof e!="function"&&(e=Nf(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var s=t[o],a=s.length,i=r[o]=[],c,l=0;l<a;++l)(c=s[l])&&e.call(c,c.__data__,l,s)&&i.push(c);return new sn(r,this._parents,this._name,this._id)}function ej(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,s=Math.min(r,o),a=new Array(r),i=0;i<s;++i)for(var c=t[i],l=n[i],f=c.length,d=a[i]=new Array(f),h,m=0;m<f;++m)(h=c[m]||l[m])&&(d[m]=h);for(;i<r;++i)a[i]=t[i];return new sn(a,this._parents,this._name,this._id)}function tj(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function nj(e,t,n){var r,o,s=tj(t)?jc:Yt;return function(){var a=s(this,e),i=a.on;i!==r&&(o=(r=i).copy()).on(t,n),a.on=o}}function rj(e,t){var n=this._id;return arguments.length<2?Et(this.node(),n).on.on(e):this.each(nj(n,e,t))}function oj(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function sj(){return this.on("end.remove",oj(this._id))}function aj(e){var t=this._name,n=this._id;typeof e!="function"&&(e=yc(e));for(var r=this._groups,o=r.length,s=new Array(o),a=0;a<o;++a)for(var i=r[a],c=i.length,l=s[a]=new Array(c),f,d,h=0;h<c;++h)(f=i[h])&&(d=e.call(f,f.__data__,h,i))&&("__data__"in f&&(d.__data__=f.__data__),l[h]=d,na(l[h],t,n,h,l,Et(f,n)));return new sn(s,this._parents,t,n)}function ij(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Cf(e));for(var r=this._groups,o=r.length,s=[],a=[],i=0;i<o;++i)for(var c=r[i],l=c.length,f,d=0;d<l;++d)if(f=c[d]){for(var h=e.call(f,f.__data__,d,c),m,g=Et(f,n),p=0,y=h.length;p<y;++p)(m=h[p])&&na(m,t,n,p,h,g);s.push(h),a.push(f)}return new sn(s,a,t,n)}var cj=Do.prototype.constructor;function lj(){return new cj(this._groups,this._parents)}function uj(e,t){var n,r,o;return function(){var s=xr(this,e),a=(this.style.removeProperty(e),xr(this,e));return s===a?null:s===n&&a===r?o:o=t(n=s,r=a)}}function Xf(e){return function(){this.style.removeProperty(e)}}function dj(e,t,n){var r,o=n+"",s;return function(){var a=xr(this,e);return a===o?null:a===r?s:s=t(r=a,n)}}function fj(e,t,n){var r,o,s;return function(){var a=xr(this,e),i=n(this),c=i+"";return i==null&&(c=i=(this.style.removeProperty(e),xr(this,e))),a===c?null:a===r&&c===o?s:(o=c,s=t(r=a,i))}}function hj(e,t){var n,r,o,s="style."+t,a="end."+s,i;return function(){var c=Yt(this,e),l=c.on,f=c.value[s]==null?i||(i=Xf(t)):void 0;(l!==n||o!==f)&&(r=(n=l).copy()).on(a,o=f),c.on=r}}function mj(e,t,n){var r=(e+="")=="transform"?pw:Uf;return t==null?this.styleTween(e,uj(e,r)).on("end.style."+e,Xf(e)):typeof t=="function"?this.styleTween(e,fj(e,r,Sc(this,"style."+e,t))).each(hj(this._id,e)):this.styleTween(e,dj(e,r,t),n).on("end.style."+e,null)}function pj(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function gj(e,t,n){var r,o;function s(){var a=t.apply(this,arguments);return a!==o&&(r=(o=a)&&pj(e,a,n)),r}return s._value=t,s}function yj(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,gj(e,t,n??""))}function xj(e){return function(){this.textContent=e}}function vj(e){return function(){var t=e(this);this.textContent=t??""}}function bj(e){return this.tween("text",typeof e=="function"?vj(Sc(this,"text",e)):xj(e==null?"":e+""))}function wj(e){return function(t){this.textContent=e.call(this,t)}}function jj(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&wj(o)),t}return r._value=e,r}function Sj(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,jj(e))}function Cj(){for(var e=this._name,t=this._id,n=Kf(),r=this._groups,o=r.length,s=0;s<o;++s)for(var a=r[s],i=a.length,c,l=0;l<i;++l)if(c=a[l]){var f=Et(c,t);na(c,e,n,l,a,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new sn(r,this._parents,e,n)}function Nj(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(s,a){var i={value:a},c={value:function(){--o===0&&s()}};n.each(function(){var l=Yt(this,r),f=l.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(i),t._.interrupt.push(i),t._.end.push(c)),l.on=t}),o===0&&s()})}var Ej=0;function sn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Kf(){return++Ej}var Jt=Do.prototype;sn.prototype={constructor:sn,select:aj,selectAll:ij,selectChild:Jt.selectChild,selectChildren:Jt.selectChildren,filter:Qw,merge:ej,selection:lj,transition:Cj,call:Jt.call,nodes:Jt.nodes,node:Jt.node,size:Jt.size,empty:Jt.empty,each:Jt.each,on:rj,attr:$w,attrTween:Bw,style:mj,styleTween:yj,text:bj,textTween:Sj,remove:sj,tween:Pw,delay:Yw,duration:Uw,ease:Kw,easeVarying:Zw,end:Nj,[Symbol.iterator]:Jt[Symbol.iterator]};function _j(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var kj={time:null,delay:0,duration:250,ease:_j};function Mj(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Pj(e){var t,n;e instanceof sn?(t=e._id,e=e._name):(t=Kf(),(n=kj).time=wc(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,s=0;s<o;++s)for(var a=r[s],i=a.length,c,l=0;l<i;++l)(c=a[l])&&na(c,e,t,l,a,n||Mj(c,t));return new sn(r,this._parents,e,t)}Do.prototype.interrupt=_w;Do.prototype.transition=Pj;const ts=e=>()=>e;function Dj(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function en(e,t,n){this.k=e,this.x=t,this.y=n}en.prototype={constructor:en,scale:function(e){return e===1?this:new en(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new en(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ra=new en(1,0,0);Jf.prototype=en.prototype;function Jf(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ra;return e.__zoom}function Ka(e){e.stopImmediatePropagation()}function Yr(e){e.preventDefault(),e.stopImmediatePropagation()}function Oj(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Rj(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function hu(){return this.__zoom||ra}function Aj(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Tj(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ij(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function Zf(){var e=Oj,t=Rj,n=Ij,r=Aj,o=Tj,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],i=250,c=gs,l=Qs("start","zoom","end"),f,d,h,m=500,g=150,p=0,y=10;function v(_){_.property("__zoom",hu).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",T).filter(o).on("touchstart.zoom",k).on("touchmove.zoom",M).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}v.transform=function(_,I,R,z){var A=_.selection?_.selection():_;A.property("__zoom",hu),_!==A?N(_,I,R,z):A.interrupt().each(function(){S(this,arguments).event(z).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},v.scaleBy=function(_,I,R,z){v.scaleTo(_,function(){var A=this.__zoom.k,D=typeof I=="function"?I.apply(this,arguments):I;return A*D},R,z)},v.scaleTo=function(_,I,R,z){v.transform(_,function(){var A=t.apply(this,arguments),D=this.__zoom,B=R==null?j(A):typeof R=="function"?R.apply(this,arguments):R,q=D.invert(B),V=typeof I=="function"?I.apply(this,arguments):I;return n(x(b(D,V),B,q),A,a)},R,z)},v.translateBy=function(_,I,R,z){v.transform(_,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof R=="function"?R.apply(this,arguments):R),t.apply(this,arguments),a)},null,z)},v.translateTo=function(_,I,R,z,A){v.transform(_,function(){var D=t.apply(this,arguments),B=this.__zoom,q=z==null?j(D):typeof z=="function"?z.apply(this,arguments):z;return n(ra.translate(q[0],q[1]).scale(B.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof R=="function"?-R.apply(this,arguments):-R),D,a)},z,A)};function b(_,I){return I=Math.max(s[0],Math.min(s[1],I)),I===_.k?_:new en(I,_.x,_.y)}function x(_,I,R){var z=I[0]-R[0]*_.k,A=I[1]-R[1]*_.k;return z===_.x&&A===_.y?_:new en(_.k,z,A)}function j(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function N(_,I,R,z){_.on("start.zoom",function(){S(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(z).end()}).tween("zoom",function(){var A=this,D=arguments,B=S(A,D).event(z),q=t.apply(A,D),V=R==null?j(q):typeof R=="function"?R.apply(A,D):R,H=Math.max(q[1][0]-q[0][0],q[1][1]-q[0][1]),L=A.__zoom,Y=typeof I=="function"?I.apply(A,D):I,G=c(L.invert(V).concat(H/L.k),Y.invert(V).concat(H/Y.k));return function($){if($===1)$=Y;else{var F=G($),U=H/F[2];$=new en(U,V[0]-F[0]*U,V[1]-F[1]*U)}B.zoom(null,$)}})}function S(_,I,R){return!R&&_.__zooming||new E(_,I)}function E(_,I){this.that=_,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(_,I),this.taps=0}E.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,I){return this.mouse&&_!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var I=ot(this.that).datum();l.call(_,this.that,new Dj(_,{sourceEvent:this.sourceEvent,target:v,transform:this.that.__zoom,dispatch:l}),I)}};function O(_,...I){if(!e.apply(this,arguments))return;var R=S(this,I).event(_),z=this.__zoom,A=Math.max(s[0],Math.min(s[1],z.k*Math.pow(2,r.apply(this,arguments)))),D=pt(_);if(R.wheel)(R.mouse[0][0]!==D[0]||R.mouse[0][1]!==D[1])&&(R.mouse[1]=z.invert(R.mouse[0]=D)),clearTimeout(R.wheel);else{if(z.k===A)return;R.mouse=[D,z.invert(D)],vs(this),R.start()}Yr(_),R.wheel=setTimeout(B,g),R.zoom("mouse",n(x(b(z,A),R.mouse[0],R.mouse[1]),R.extent,a));function B(){R.wheel=null,R.end()}}function P(_,...I){if(h||!e.apply(this,arguments))return;var R=_.currentTarget,z=S(this,I,!0).event(_),A=ot(_.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",H,!0),D=pt(_,R),B=_.clientX,q=_.clientY;Tf(_.view),Ka(_),z.mouse=[D,this.__zoom.invert(D)],vs(this),z.start();function V(L){if(Yr(L),!z.moved){var Y=L.clientX-B,G=L.clientY-q;z.moved=Y*Y+G*G>p}z.event(L).zoom("mouse",n(x(z.that.__zoom,z.mouse[0]=pt(L,R),z.mouse[1]),z.extent,a))}function H(L){A.on("mousemove.zoom mouseup.zoom",null),If(L.view,z.moved),Yr(L),z.event(L).end()}}function T(_,...I){if(e.apply(this,arguments)){var R=this.__zoom,z=pt(_.changedTouches?_.changedTouches[0]:_,this),A=R.invert(z),D=R.k*(_.shiftKey?.5:2),B=n(x(b(R,D),z,A),t.apply(this,I),a);Yr(_),i>0?ot(this).transition().duration(i).call(N,B,z,_):ot(this).call(v.transform,B,z,_)}}function k(_,...I){if(e.apply(this,arguments)){var R=_.touches,z=R.length,A=S(this,I,_.changedTouches.length===z).event(_),D,B,q,V;for(Ka(_),B=0;B<z;++B)q=R[B],V=pt(q,this),V=[V,this.__zoom.invert(V),q.identifier],A.touch0?!A.touch1&&A.touch0[2]!==V[2]&&(A.touch1=V,A.taps=0):(A.touch0=V,D=!0,A.taps=1+!!f);f&&(f=clearTimeout(f)),D&&(A.taps<2&&(d=V[0],f=setTimeout(function(){f=null},m)),vs(this),A.start())}}function M(_,...I){if(this.__zooming){var R=S(this,I).event(_),z=_.changedTouches,A=z.length,D,B,q,V;for(Yr(_),D=0;D<A;++D)B=z[D],q=pt(B,this),R.touch0&&R.touch0[2]===B.identifier?R.touch0[0]=q:R.touch1&&R.touch1[2]===B.identifier&&(R.touch1[0]=q);if(B=R.that.__zoom,R.touch1){var H=R.touch0[0],L=R.touch0[1],Y=R.touch1[0],G=R.touch1[1],$=($=Y[0]-H[0])*$+($=Y[1]-H[1])*$,F=(F=G[0]-L[0])*F+(F=G[1]-L[1])*F;B=b(B,Math.sqrt($/F)),q=[(H[0]+Y[0])/2,(H[1]+Y[1])/2],V=[(L[0]+G[0])/2,(L[1]+G[1])/2]}else if(R.touch0)q=R.touch0[0],V=R.touch0[1];else return;R.zoom("touch",n(x(B,q,V),R.extent,a))}}function W(_,...I){if(this.__zooming){var R=S(this,I).event(_),z=_.changedTouches,A=z.length,D,B;for(Ka(_),h&&clearTimeout(h),h=setTimeout(function(){h=null},m),D=0;D<A;++D)B=z[D],R.touch0&&R.touch0[2]===B.identifier?delete R.touch0:R.touch1&&R.touch1[2]===B.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(B=pt(B,this),Math.hypot(d[0]-B[0],d[1]-B[1])<y)){var q=ot(this).on("dblclick.zoom");q&&q.apply(this,arguments)}}}return v.wheelDelta=function(_){return arguments.length?(r=typeof _=="function"?_:ts(+_),v):r},v.filter=function(_){return arguments.length?(e=typeof _=="function"?_:ts(!!_),v):e},v.touchable=function(_){return arguments.length?(o=typeof _=="function"?_:ts(!!_),v):o},v.extent=function(_){return arguments.length?(t=typeof _=="function"?_:ts([[+_[0][0],+_[0][1]],[+_[1][0],+_[1][1]]]),v):t},v.scaleExtent=function(_){return arguments.length?(s[0]=+_[0],s[1]=+_[1],v):[s[0],s[1]]},v.translateExtent=function(_){return arguments.length?(a[0][0]=+_[0][0],a[1][0]=+_[1][0],a[0][1]=+_[0][1],a[1][1]=+_[1][1],v):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},v.constrain=function(_){return arguments.length?(n=_,v):n},v.duration=function(_){return arguments.length?(i=+_,v):i},v.interpolate=function(_){return arguments.length?(c=_,v):c},v.on=function(){var _=l.on.apply(l,arguments);return _===l?v:_},v.clickDistance=function(_){return arguments.length?(p=(_=+_)*_,v):Math.sqrt(p)},v.tapDistance=function(_){return arguments.length?(y=+_,v):y},v}const it={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},go=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Qf=["Enter"," ","Escape"],eh={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var br;(function(e){e.Strict="strict",e.Loose="loose"})(br||(br={}));var In;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(In||(In={}));var yo;(function(e){e.Partial="partial",e.Full="full"})(yo||(yo={}));const th={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var yn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(yn||(yn={}));var Os;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Os||(Os={}));var re;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(re||(re={}));const mu={[re.Left]:re.Right,[re.Right]:re.Left,[re.Top]:re.Bottom,[re.Bottom]:re.Top};function nh(e){return e===null?null:e?"valid":"invalid"}const rh=e=>"id"in e&&"source"in e&&"target"in e,$j=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Cc=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ro=(e,t=[0,0])=>{const{width:n,height:r}=ln(e),o=e.origin??t,s=n*o[0],a=r*o[1];return{x:e.position.x-s,y:e.position.y-a}},zj=(e,t={nodeOrigin:[0,0]})=>{if(process.env.NODE_ENV==="development"&&!t.nodeLookup&&console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."),e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const s=typeof o=="string";let a=!t.nodeLookup&&!s?o:void 0;t.nodeLookup&&(a=s?t.nodeLookup.get(o):Cc(o)?o:t.nodeLookup.get(o.id));const i=a?Rs(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return oa(r,i)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return sa(n)},Ao=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=oa(n,Rs(o)),r=!0)}),r?sa(n):{x:0,y:0,width:0,height:0}},Nc=(e,t,[n,r,o]=[0,0,1],s=!1,a=!1)=>{const i={...Io(t,[n,r,o]),width:t.width/o,height:t.height/o},c=[];for(const l of e.values()){const{measured:f,selectable:d=!0,hidden:h=!1}=l;if(a&&!d||h)continue;const m=f.width??l.width??l.initialWidth??null,g=f.height??l.height??l.initialHeight??null,p=xo(i,jr(l)),y=(m??0)*(g??0),v=s&&p>0;(!l.internals.handleBounds||v||p>=y||l.dragging)&&c.push(l)}return c},Lj=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Wj(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function Fj({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:s},a){if(e.size===0)return Promise.resolve(!0);const i=Wj(e,a),c=Ao(i),l=Ec(c,t,n,(a==null?void 0:a.minZoom)??o,(a==null?void 0:a.maxZoom)??s,(a==null?void 0:a.padding)??.1);return await r.setViewport(l,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),Promise.resolve(!0)}function oh({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:s}){const a=n.get(e),i=a.parentId?n.get(a.parentId):void 0,{x:c,y:l}=i?i.internals.positionAbsolute:{x:0,y:0},f=a.origin??r;let d=a.extent||o;if(a.extent==="parent"&&!a.expandParent)if(!i)s==null||s("005",it.error005());else{const m=i.measured.width,g=i.measured.height;m&&g&&(d=[[c,l],[c+m,l+g]])}else i&&Sr(a.extent)&&(d=[[a.extent[0][0]+c,a.extent[0][1]+l],[a.extent[1][0]+c,a.extent[1][1]+l]]);const h=Sr(d)?Wn(t,d,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(s==null||s("015",it.error015())),{position:{x:h.x-c+(a.measured.width??0)*f[0],y:h.y-l+(a.measured.height??0)*f[1]},positionAbsolute:h}}async function Bj({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const s=new Set(e.map(h=>h.id)),a=[];for(const h of n){if(h.deletable===!1)continue;const m=s.has(h.id),g=!m&&h.parentId&&a.find(p=>p.id===h.parentId);(m||g)&&a.push(h)}const i=new Set(t.map(h=>h.id)),c=r.filter(h=>h.deletable!==!1),f=Lj(a,c);for(const h of c)i.has(h.id)&&!f.find(g=>g.id===h.id)&&f.push(h);if(!o)return{edges:f,nodes:a};const d=await o({nodes:a,edges:f});return typeof d=="boolean"?d?{edges:f,nodes:a}:{edges:[],nodes:[]}:d}const wr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Wn=(e={x:0,y:0},t,n)=>({x:wr(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:wr(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function sh(e,t,n){const{width:r,height:o}=ln(n),{x:s,y:a}=n.internals.positionAbsolute;return Wn(e,[[s,a],[s+r,a+o]],t)}const pu=(e,t,n)=>e<t?wr(Math.abs(e-t),1,t)/t:e>n?-wr(Math.abs(e-n),1,t)/t:0,ah=(e,t,n=15,r=40)=>{const o=pu(e.x,r,t.width-r)*n,s=pu(e.y,r,t.height-r)*n;return[o,s]},oa=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Li=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),sa=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),jr=(e,t=[0,0])=>{var o,s;const{x:n,y:r}=Cc(e)?e.internals.positionAbsolute:Ro(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},Rs=(e,t=[0,0])=>{var o,s;const{x:n,y:r}=Cc(e)?e.internals.positionAbsolute:Ro(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},ih=(e,t)=>sa(oa(Li(e),Li(t))),xo=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},gu=e=>xt(e.width)&&xt(e.height)&&xt(e.x)&&xt(e.y),xt=e=>!isNaN(e)&&isFinite(e),ch=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},To=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Io=({x:e,y:t},[n,r,o],s=!1,a=[1,1])=>{const i={x:(e-n)/o,y:(t-r)/o};return s?To(i,a):i},As=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function Qn(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Hj(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Qn(e,n),o=Qn(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=Qn(e.top??e.y??0,n),o=Qn(e.bottom??e.y??0,n),s=Qn(e.left??e.x??0,t),a=Qn(e.right??e.x??0,t);return{top:r,right:a,bottom:o,left:s,x:s+a,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Vj(e,t,n,r,o,s){const{x:a,y:i}=As(e,[t,n,r]),{x:c,y:l}=As({x:e.x+e.width,y:e.y+e.height},[t,n,r]),f=o-c,d=s-l;return{left:Math.floor(a),top:Math.floor(i),right:Math.floor(f),bottom:Math.floor(d)}}const Ec=(e,t,n,r,o,s)=>{const a=Hj(s,t,n),i=(t-a.x)/e.width,c=(n-a.y)/e.height,l=Math.min(i,c),f=wr(l,r,o),d=e.x+e.width/2,h=e.y+e.height/2,m=t/2-d*f,g=n/2-h*f,p=Vj(e,m,g,f,t,n),y={left:Math.min(p.left-a.left,0),top:Math.min(p.top-a.top,0),right:Math.min(p.right-a.right,0),bottom:Math.min(p.bottom-a.bottom,0)};return{x:m-y.left+y.right,y:g-y.top+y.bottom,zoom:f}},vo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Sr(e){return e!=null&&e!=="parent"}function ln(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function lh(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function uh(e,t={width:0,height:0},n,r,o){const s={...e},a=r.get(n);if(a){const i=a.origin||o;s.x+=a.internals.positionAbsolute.x-(t.width??0)*i[0],s.y+=a.internals.positionAbsolute.y-(t.height??0)*i[1]}return s}function yu(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Yj(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function qj(e){return{...eh,...e||{}}}function uo(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:s,y:a}=vt(e),i=Io({x:s-((o==null?void 0:o.left)??0),y:a-((o==null?void 0:o.top)??0)},r),{x:c,y:l}=n?To(i,t):i;return{xSnapped:c,ySnapped:l,...i}}const _c=e=>({width:e.offsetWidth,height:e.offsetHeight}),dh=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Gj=["INPUT","SELECT","TEXTAREA"];function fh(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:Gj.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const hh=e=>"clientX"in e,vt=(e,t)=>{var s,a;const n=hh(e),r=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,o=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},xu=(e,t,n,r,o)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(a=>{const i=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:o,position:a.getAttribute("data-handlepos"),x:(i.left-n.left)/r,y:(i.top-n.top)/r,..._c(a)}})};function mh({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:s,targetControlX:a,targetControlY:i}){const c=e*.125+o*.375+a*.375+n*.125,l=t*.125+s*.375+i*.375+r*.125,f=Math.abs(c-e),d=Math.abs(l-t);return[c,l,f,d]}function ns(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function vu({pos:e,x1:t,y1:n,x2:r,y2:o,c:s}){switch(e){case re.Left:return[t-ns(t-r,s),n];case re.Right:return[t+ns(r-t,s),n];case re.Top:return[t,n-ns(n-o,s)];case re.Bottom:return[t,n+ns(o-n,s)]}}function kc({sourceX:e,sourceY:t,sourcePosition:n=re.Bottom,targetX:r,targetY:o,targetPosition:s=re.Top,curvature:a=.25}){const[i,c]=vu({pos:n,x1:e,y1:t,x2:r,y2:o,c:a}),[l,f]=vu({pos:s,x1:r,y1:o,x2:e,y2:t,c:a}),[d,h,m,g]=mh({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:i,sourceControlY:c,targetControlX:l,targetControlY:f});return[`M${e},${t} C${i},${c} ${l},${f} ${r},${o}`,d,h,m,g]}function ph({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,s=n<e?n+o:n-o,a=Math.abs(r-t)/2,i=r<t?r+a:r-a;return[s,i,o,a]}function Uj({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:s="basic"}){if(s==="manual")return r;const a=o&&n?r+1e3:r,i=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return a+i}function Xj({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const s=oa(Rs(e),Rs(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const a={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return xo(a,sa(s))>0}const Kj=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Jj=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),gh=(e,t,n={})=>{if(!e.source||!e.target)return ch("006",it.error006()),t;const r=n.getEdgeId||Kj;let o;return rh(e)?o={...e}:o={...e,id:r(e)},Jj(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function yh({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,s,a,i]=ph({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,s,a,i]}const bu={[re.Left]:{x:-1,y:0},[re.Right]:{x:1,y:0},[re.Top]:{x:0,y:-1},[re.Bottom]:{x:0,y:1}},Zj=({source:e,sourcePosition:t=re.Bottom,target:n})=>t===re.Left||t===re.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},wu=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Qj({source:e,sourcePosition:t=re.Bottom,target:n,targetPosition:r=re.Top,center:o,offset:s,stepPosition:a}){const i=bu[t],c=bu[r],l={x:e.x+i.x*s,y:e.y+i.y*s},f={x:n.x+c.x*s,y:n.y+c.y*s},d=Zj({source:l,sourcePosition:t,target:f}),h=d.x!==0?"x":"y",m=d[h];let g=[],p,y;const v={x:0,y:0},b={x:0,y:0},[,,x,j]=ph({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[h]*c[h]===-1){h==="x"?(p=o.x??l.x+(f.x-l.x)*a,y=o.y??(l.y+f.y)/2):(p=o.x??(l.x+f.x)/2,y=o.y??l.y+(f.y-l.y)*a);const S=[{x:p,y:l.y},{x:p,y:f.y}],E=[{x:l.x,y},{x:f.x,y}];i[h]===m?g=h==="x"?S:E:g=h==="x"?E:S}else{const S=[{x:l.x,y:f.y}],E=[{x:f.x,y:l.y}];if(h==="x"?g=i.x===m?E:S:g=i.y===m?S:E,t===r){const M=Math.abs(e[h]-n[h]);if(M<=s){const W=Math.min(s-1,s-M);i[h]===m?v[h]=(l[h]>e[h]?-1:1)*W:b[h]=(f[h]>n[h]?-1:1)*W}}if(t!==r){const M=h==="x"?"y":"x",W=i[h]===c[M],_=l[M]>f[M],I=l[M]<f[M];(i[h]===1&&(!W&&_||W&&I)||i[h]!==1&&(!W&&I||W&&_))&&(g=h==="x"?S:E)}const O={x:l.x+v.x,y:l.y+v.y},P={x:f.x+b.x,y:f.y+b.y},T=Math.max(Math.abs(O.x-g[0].x),Math.abs(P.x-g[0].x)),k=Math.max(Math.abs(O.y-g[0].y),Math.abs(P.y-g[0].y));T>=k?(p=(O.x+P.x)/2,y=g[0].y):(p=g[0].x,y=(O.y+P.y)/2)}return[[e,{x:l.x+v.x,y:l.y+v.y},...g,{x:f.x+b.x,y:f.y+b.y},n],p,y,x,j]}function e1(e,t,n,r){const o=Math.min(wu(e,t)/2,wu(t,n)/2,r),{x:s,y:a}=t;if(e.x===s&&s===n.x||e.y===a&&a===n.y)return`L${s} ${a}`;if(e.y===a){const l=e.x<n.x?-1:1,f=e.y<n.y?1:-1;return`L ${s+o*l},${a}Q ${s},${a} ${s},${a+o*f}`}const i=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${s},${a+o*c}Q ${s},${a} ${s+o*i},${a}`}function Wi({sourceX:e,sourceY:t,sourcePosition:n=re.Bottom,targetX:r,targetY:o,targetPosition:s=re.Top,borderRadius:a=5,centerX:i,centerY:c,offset:l=20,stepPosition:f=.5}){const[d,h,m,g,p]=Qj({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:s,center:{x:i,y:c},offset:l,stepPosition:f});return[d.reduce((v,b,x)=>{let j="";return x>0&&x<d.length-1?j=e1(d[x-1],b,d[x+1],a):j=`${x===0?"M":"L"}${b.x} ${b.y}`,v+=j,v},""),h,m,g,p]}function ju(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function t1(e){var d;const{sourceNode:t,targetNode:n}=e;if(!ju(t)||!ju(n))return null;const r=t.internals.handleBounds||Su(t.handles),o=n.internals.handleBounds||Su(n.handles),s=Cu((r==null?void 0:r.source)??[],e.sourceHandle),a=Cu(e.connectionMode===br.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!s||!a)return(d=e.onError)==null||d.call(e,"008",it.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const i=(s==null?void 0:s.position)||re.Bottom,c=(a==null?void 0:a.position)||re.Top,l=Fn(t,s,i),f=Fn(n,a,c);return{sourceX:l.x,sourceY:l.y,targetX:f.x,targetY:f.y,sourcePosition:i,targetPosition:c}}function Su(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Fn(e,t,n=re.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,s=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:a,height:i}=t??ln(e);if(r)return{x:o+a/2,y:s+i/2};switch((t==null?void 0:t.position)??n){case re.Top:return{x:o+a/2,y:s};case re.Right:return{x:o+a,y:s+i/2};case re.Bottom:return{x:o+a/2,y:s+i};case re.Left:return{x:o,y:s+i/2}}}function Cu(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Fi(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function n1(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const s=new Set;return e.reduce((a,i)=>([i.markerStart||r,i.markerEnd||o].forEach(c=>{if(c&&typeof c=="object"){const l=Fi(c,t);s.has(l)||(a.push({id:l,color:c.color||n,...c}),s.add(l))}}),a),[]).sort((a,i)=>a.id.localeCompare(i.id))}const xh=1e3,r1=10,Mc={nodeOrigin:[0,0],nodeExtent:go,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},o1={...Mc,checkEquality:!0};function Pc(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function s1(e,t,n){const r=Pc(Mc,n);for(const o of e.values())if(o.parentId)Oc(o,e,t,r);else{const s=Ro(o,r.nodeOrigin),a=Sr(o.extent)?o.extent:r.nodeExtent,i=Wn(s,a,ln(o));o.internals.positionAbsolute=i}}function a1(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const s={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(s):o.type==="target"&&r.push(s)}return{source:n,target:r}}function Dc(e){return e==="manual"}function Bi(e,t,n,r={}){var l,f;const o=Pc(o1,r),s={i:0},a=new Map(t),i=o!=null&&o.elevateNodesOnSelect&&!Dc(o.zIndexMode)?xh:0;let c=e.length>0;t.clear(),n.clear();for(const d of e){let h=a.get(d.id);if(o.checkEquality&&d===(h==null?void 0:h.internals.userNode))t.set(d.id,h);else{const m=Ro(d,o.nodeOrigin),g=Sr(d.extent)?d.extent:o.nodeExtent,p=Wn(m,g,ln(d));h={...o.defaults,...d,measured:{width:(l=d.measured)==null?void 0:l.width,height:(f=d.measured)==null?void 0:f.height},internals:{positionAbsolute:p,handleBounds:a1(d,h),z:vh(d,i,o.zIndexMode),userNode:d}},t.set(d.id,h)}(h.measured===void 0||h.measured.width===void 0||h.measured.height===void 0)&&!h.hidden&&(c=!1),d.parentId&&Oc(h,t,n,r,s)}return c}function i1(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Oc(e,t,n,r,o){const{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:i,zIndexMode:c}=Pc(Mc,r),l=e.parentId,f=t.get(l);if(!f){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}i1(e,n),o&&!f.parentId&&f.internals.rootParentIndex===void 0&&c==="auto"&&(f.internals.rootParentIndex=++o.i,f.internals.z=f.internals.z+o.i*r1),o&&f.internals.rootParentIndex!==void 0&&(o.i=f.internals.rootParentIndex);const d=s&&!Dc(c)?xh:0,{x:h,y:m,z:g}=c1(e,f,a,i,d,c),{positionAbsolute:p}=e.internals,y=h!==p.x||m!==p.y;(y||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:y?{x:h,y:m}:p,z:g}})}function vh(e,t,n){const r=xt(e.zIndex)?e.zIndex:0;return Dc(n)?r:r+(e.selected?t:0)}function c1(e,t,n,r,o,s){const{x:a,y:i}=t.internals.positionAbsolute,c=ln(e),l=Ro(e,n),f=Sr(e.extent)?Wn(l,e.extent,c):l;let d=Wn({x:a+f.x,y:i+f.y},r,c);e.extent==="parent"&&(d=sh(d,c,t));const h=vh(e,o,s),m=t.internals.z??0;return{x:d.x,y:d.y,z:m>=h?m+1:h}}function Rc(e,t,n,r=[0,0]){var a;const o=[],s=new Map;for(const i of e){const c=t.get(i.parentId);if(!c)continue;const l=((a=s.get(i.parentId))==null?void 0:a.expandedRect)??jr(c),f=ih(l,i.rect);s.set(i.parentId,{expandedRect:f,parent:c})}return s.size>0&&s.forEach(({expandedRect:i,parent:c},l)=>{var x;const f=c.internals.positionAbsolute,d=ln(c),h=c.origin??r,m=i.x<f.x?Math.round(Math.abs(f.x-i.x)):0,g=i.y<f.y?Math.round(Math.abs(f.y-i.y)):0,p=Math.max(d.width,Math.round(i.width)),y=Math.max(d.height,Math.round(i.height)),v=(p-d.width)*h[0],b=(y-d.height)*h[1];(m>0||g>0||v||b)&&(o.push({id:l,type:"position",position:{x:c.position.x-m+v,y:c.position.y-g+b}}),(x=n.get(l))==null||x.forEach(j=>{e.some(N=>N.id===j.id)||o.push({id:j.id,type:"position",position:{x:j.position.x+m,y:j.position.y+g}})})),(d.width<i.width||d.height<i.height||m||g)&&o.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:p+(m?h[0]*m-v:0),height:y+(g?h[1]*g-b:0)}})}),o}function l1(e,t,n,r,o,s,a){const i=r==null?void 0:r.querySelector(".xyflow__viewport");let c=!1;if(!i)return{changes:[],updatedInternals:c};const l=[],f=window.getComputedStyle(i),{m22:d}=new window.DOMMatrixReadOnly(f.transform),h=[];for(const m of e.values()){const g=t.get(m.id);if(!g)continue;if(g.hidden){t.set(g.id,{...g,internals:{...g.internals,handleBounds:void 0}}),c=!0;continue}const p=_c(m.nodeElement),y=g.measured.width!==p.width||g.measured.height!==p.height;if(!!(p.width&&p.height&&(y||!g.internals.handleBounds||m.force))){const b=m.nodeElement.getBoundingClientRect(),x=Sr(g.extent)?g.extent:s;let{positionAbsolute:j}=g.internals;g.parentId&&g.extent==="parent"?j=sh(j,p,t.get(g.parentId)):x&&(j=Wn(j,x,p));const N={...g,measured:p,internals:{...g.internals,positionAbsolute:j,handleBounds:{source:xu("source",m.nodeElement,b,d,g.id),target:xu("target",m.nodeElement,b,d,g.id)}}};t.set(g.id,N),g.parentId&&Oc(N,t,n,{nodeOrigin:o,zIndexMode:a}),c=!0,y&&(l.push({id:g.id,type:"dimensions",dimensions:p}),g.expandParent&&g.parentId&&h.push({id:g.id,parentId:g.parentId,rect:jr(N,o)}))}}if(h.length>0){const m=Rc(h,t,n,o);l.push(...m)}return{changes:l,updatedInternals:c}}async function u1({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:s}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,s]],r),i=!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]);return Promise.resolve(i)}function Nu(e,t,n,r,o,s){let a=o;const i=r.get(a)||new Map;r.set(a,i.set(n,t)),a=`${o}-${e}`;const c=r.get(a)||new Map;if(r.set(a,c.set(n,t)),s){a=`${o}-${e}-${s}`;const l=r.get(a)||new Map;r.set(a,l.set(n,t))}}function bh(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:s,sourceHandle:a=null,targetHandle:i=null}=r,c={edgeId:r.id,source:o,target:s,sourceHandle:a,targetHandle:i},l=`${o}-${a}--${s}-${i}`,f=`${s}-${i}--${o}-${a}`;Nu("source",c,f,e,o,a),Nu("target",c,l,e,s,i),t.set(r.id,r)}}function wh(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:wh(n,t):!1}function Eu(e,t,n){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function d1(e,t,n,r){const o=new Map;for(const[s,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!wh(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const i=e.get(s);i&&o.set(s,{id:s,position:i.position||{x:0,y:0},distance:{x:n.x-i.internals.positionAbsolute.x,y:n.y-i.internals.positionAbsolute.y},extent:i.extent,parentId:i.parentId,origin:i.origin,expandParent:i.expandParent,internals:{positionAbsolute:i.internals.positionAbsolute||{x:0,y:0}},measured:{width:i.measured.width??0,height:i.measured.height??0}})}return o}function Ja({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,i,c;const o=[];for(const[l,f]of t){const d=(a=n.get(l))==null?void 0:a.internals.userNode;d&&o.push({...d,position:f.position,dragging:r})}if(!e)return[o[0],o];const s=(i=n.get(e))==null?void 0:i.internals.userNode;return[s?{...s,position:((c=t.get(e))==null?void 0:c.position)||s.position,dragging:r}:o[0],o]}function f1({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const s={x:n-o.distance.x,y:r-o.distance.y},a=To(s,t);return{x:a.x-s.x,y:a.y-s.y}}function h1({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let s={x:null,y:null},a=0,i=new Map,c=!1,l={x:0,y:0},f=null,d=!1,h=null,m=!1,g=!1,p=null;function y({noDragClassName:b,handleSelector:x,domNode:j,isSelectable:N,nodeId:S,nodeClickDistance:E=0}){h=ot(j);function O({x:M,y:W}){const{nodeLookup:_,nodeExtent:I,snapGrid:R,snapToGrid:z,nodeOrigin:A,onNodeDrag:D,onSelectionDrag:B,onError:q,updateNodePositions:V}=t();s={x:M,y:W};let H=!1;const L=i.size>1,Y=L&&I?Li(Ao(i)):null,G=L&&z?f1({dragItems:i,snapGrid:R,x:M,y:W}):null;for(const[$,F]of i){if(!_.has($))continue;let U={x:M-F.distance.x,y:W-F.distance.y};z&&(U=G?{x:Math.round(U.x+G.x),y:Math.round(U.y+G.y)}:To(U,R));let X=null;if(L&&I&&!F.extent&&Y){const{positionAbsolute:J}=F.internals,ee=J.x-Y.x+I[0][0],se=J.x+F.measured.width-Y.x2+I[1][0],ae=J.y-Y.y+I[0][1],ue=J.y+F.measured.height-Y.y2+I[1][1];X=[[ee,ae],[se,ue]]}const{position:Z,positionAbsolute:K}=oh({nodeId:$,nextPosition:U,nodeLookup:_,nodeExtent:X||I,nodeOrigin:A,onError:q});H=H||F.position.x!==Z.x||F.position.y!==Z.y,F.position=Z,F.internals.positionAbsolute=K}if(g=g||H,!!H&&(V(i,!0),p&&(r||D||!S&&B))){const[$,F]=Ja({nodeId:S,dragItems:i,nodeLookup:_});r==null||r(p,i,$,F),D==null||D(p,$,F),S||B==null||B(p,F)}}async function P(){if(!f)return;const{transform:M,panBy:W,autoPanSpeed:_,autoPanOnNodeDrag:I}=t();if(!I){c=!1,cancelAnimationFrame(a);return}const[R,z]=ah(l,f,_);(R!==0||z!==0)&&(s.x=(s.x??0)-R/M[2],s.y=(s.y??0)-z/M[2],await W({x:R,y:z})&&O(s)),a=requestAnimationFrame(P)}function T(M){var L;const{nodeLookup:W,multiSelectionActive:_,nodesDraggable:I,transform:R,snapGrid:z,snapToGrid:A,selectNodesOnDrag:D,onNodeDragStart:B,onSelectionDragStart:q,unselectNodesAndEdges:V}=t();d=!0,(!D||!N)&&!_&&S&&((L=W.get(S))!=null&&L.selected||V()),N&&D&&S&&(e==null||e(S));const H=uo(M.sourceEvent,{transform:R,snapGrid:z,snapToGrid:A,containerBounds:f});if(s=H,i=d1(W,I,H,S),i.size>0&&(n||B||!S&&q)){const[Y,G]=Ja({nodeId:S,dragItems:i,nodeLookup:W});n==null||n(M.sourceEvent,i,Y,G),B==null||B(M.sourceEvent,Y,G),S||q==null||q(M.sourceEvent,G)}}const k=$f().clickDistance(E).on("start",M=>{const{domNode:W,nodeDragThreshold:_,transform:I,snapGrid:R,snapToGrid:z}=t();f=(W==null?void 0:W.getBoundingClientRect())||null,m=!1,g=!1,p=M.sourceEvent,_===0&&T(M),s=uo(M.sourceEvent,{transform:I,snapGrid:R,snapToGrid:z,containerBounds:f}),l=vt(M.sourceEvent,f)}).on("drag",M=>{const{autoPanOnNodeDrag:W,transform:_,snapGrid:I,snapToGrid:R,nodeDragThreshold:z,nodeLookup:A}=t(),D=uo(M.sourceEvent,{transform:_,snapGrid:I,snapToGrid:R,containerBounds:f});if(p=M.sourceEvent,(M.sourceEvent.type==="touchmove"&&M.sourceEvent.touches.length>1||S&&!A.has(S))&&(m=!0),!m){if(!c&&W&&d&&(c=!0,P()),!d){const B=vt(M.sourceEvent,f),q=B.x-l.x,V=B.y-l.y;Math.sqrt(q*q+V*V)>z&&T(M)}(s.x!==D.xSnapped||s.y!==D.ySnapped)&&i&&d&&(l=vt(M.sourceEvent,f),O(D))}}).on("end",M=>{if(!(!d||m)&&(c=!1,d=!1,cancelAnimationFrame(a),i.size>0)){const{nodeLookup:W,updateNodePositions:_,onNodeDragStop:I,onSelectionDragStop:R}=t();if(g&&(_(i,!1),g=!1),o||I||!S&&R){const[z,A]=Ja({nodeId:S,dragItems:i,nodeLookup:W,dragging:!1});o==null||o(M.sourceEvent,i,z,A),I==null||I(M.sourceEvent,z,A),S||R==null||R(M.sourceEvent,A)}}}).filter(M=>{const W=M.target;return!M.button&&(!b||!Eu(W,`.${b}`,j))&&(!x||Eu(W,x,j))});h.call(k)}function v(){h==null||h.on(".drag",null)}return{update:y,destroy:v}}function m1(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())xo(o,jr(s))>0&&r.push(s);return r}const p1=250;function g1(e,t,n,r){var i,c;let o=[],s=1/0;const a=m1(e,n,t+p1);for(const l of a){const f=[...((i=l.internals.handleBounds)==null?void 0:i.source)??[],...((c=l.internals.handleBounds)==null?void 0:c.target)??[]];for(const d of f){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:h,y:m}=Fn(l,d,d.position,!0),g=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(m-e.y,2));g>t||(g<s?(o=[{...d,x:h,y:m}],s=g):g===s&&o.push({...d,x:h,y:m}))}}if(!o.length)return null;if(o.length>1){const l=r.type==="source"?"target":"source";return o.find(f=>f.type===l)??o[0]}return o[0]}function jh(e,t,n,r,o,s=!1){var l,f,d;const a=r.get(e);if(!a)return null;const i=o==="strict"?(l=a.internals.handleBounds)==null?void 0:l[t]:[...((f=a.internals.handleBounds)==null?void 0:f.source)??[],...((d=a.internals.handleBounds)==null?void 0:d.target)??[]],c=(n?i==null?void 0:i.find(h=>h.id===n):i==null?void 0:i[0])??null;return c&&s?{...c,...Fn(a,c,c.position,!0)}:c}function Sh(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function y1(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Ch=()=>!0;function x1(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:s,isTarget:a,domNode:i,nodeLookup:c,lib:l,autoPanOnConnect:f,flowId:d,panBy:h,cancelConnection:m,onConnectStart:g,onConnect:p,onConnectEnd:y,isValidConnection:v=Ch,onReconnectEnd:b,updateConnection:x,getTransform:j,getFromHandle:N,autoPanSpeed:S,dragThreshold:E=1,handleDomNode:O}){const P=dh(e.target);let T=0,k;const{x:M,y:W}=vt(e),_=Sh(s,O),I=i==null?void 0:i.getBoundingClientRect();let R=!1;if(!I||!_)return;const z=jh(o,_,r,c,t);if(!z)return;let A=vt(e,I),D=!1,B=null,q=!1,V=null;function H(){if(!f||!I)return;const[Z,K]=ah(A,I,S);h({x:Z,y:K}),T=requestAnimationFrame(H)}const L={...z,nodeId:o,type:_,position:z.position},Y=c.get(o);let $={inProgress:!0,isValid:null,from:Fn(Y,L,re.Left,!0),fromHandle:L,fromPosition:L.position,fromNode:Y,to:A,toHandle:null,toPosition:mu[L.position],toNode:null,pointer:A};function F(){R=!0,x($),g==null||g(e,{nodeId:o,handleId:r,handleType:_})}E===0&&F();function U(Z){if(!R){const{x:ue,y:ve}=vt(Z),ke=ue-M,Fe=ve-W;if(!(ke*ke+Fe*Fe>E*E))return;F()}if(!N()||!L){X(Z);return}const K=j();A=vt(Z,I),k=g1(Io(A,K,!1,[1,1]),n,c,L),D||(H(),D=!0);const J=Nh(Z,{handle:k,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:a?"target":"source",isValidConnection:v,doc:P,lib:l,flowId:d,nodeLookup:c});V=J.handleDomNode,B=J.connection,q=y1(!!k,J.isValid);const ee=c.get(o),se=ee?Fn(ee,L,re.Left,!0):$.from,ae={...$,from:se,isValid:q,to:J.toHandle&&q?As({x:J.toHandle.x,y:J.toHandle.y},K):A,toHandle:J.toHandle,toPosition:q&&J.toHandle?J.toHandle.position:mu[L.position],toNode:J.toHandle?c.get(J.toHandle.nodeId):null,pointer:A};x(ae),$=ae}function X(Z){if(!("touches"in Z&&Z.touches.length>0)){if(R){(k||V)&&B&&q&&(p==null||p(B));const{inProgress:K,...J}=$,ee={...J,toPosition:$.toHandle?$.toPosition:null};y==null||y(Z,ee),s&&(b==null||b(Z,ee))}m(),cancelAnimationFrame(T),D=!1,q=!1,B=null,V=null,P.removeEventListener("mousemove",U),P.removeEventListener("mouseup",X),P.removeEventListener("touchmove",U),P.removeEventListener("touchend",X)}}P.addEventListener("mousemove",U),P.addEventListener("mouseup",X),P.addEventListener("touchmove",U),P.addEventListener("touchend",X)}function Nh(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:s,doc:a,lib:i,flowId:c,isValidConnection:l=Ch,nodeLookup:f}){const d=s==="target",h=t?a.querySelector(`.${i}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:m,y:g}=vt(e),p=a.elementFromPoint(m,g),y=p!=null&&p.classList.contains(`${i}-flow__handle`)?p:h,v={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const b=Sh(void 0,y),x=y.getAttribute("data-nodeid"),j=y.getAttribute("data-handleid"),N=y.classList.contains("connectable"),S=y.classList.contains("connectableend");if(!x||!b)return v;const E={source:d?x:r,sourceHandle:d?j:o,target:d?r:x,targetHandle:d?o:j};v.connection=E;const P=N&&S&&(n===br.Strict?d&&b==="source"||!d&&b==="target":x!==r||j!==o);v.isValid=P&&l(E),v.toHandle=jh(x,b,j,f,n,!0)}return v}const Hi={onPointerDown:x1,isValid:Nh};function v1({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=ot(e);function s({translateExtent:i,width:c,height:l,zoomStep:f=1,pannable:d=!0,zoomable:h=!0,inversePan:m=!1}){const g=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const j=n(),N=x.sourceEvent.ctrlKey&&vo()?10:1,S=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*f,E=j[2]*Math.pow(2,S*N);t.scaleTo(E)};let p=[0,0];const y=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(p=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},v=x=>{const j=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const N=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],S=[N[0]-p[0],N[1]-p[1]];p=N;const E=r()*Math.max(j[2],Math.log(j[2]))*(m?-1:1),O={x:j[0]-S[0]*E,y:j[1]-S[1]*E},P=[[0,0],[c,l]];t.setViewportConstrained({x:O.x,y:O.y,zoom:j[2]},P,i)},b=Zf().on("start",y).on("zoom",d?v:null).on("zoom.wheel",h?g:null);o.call(b,{})}function a(){o.on("zoom",null)}return{update:s,destroy:a,pointer:pt}}const aa=e=>({x:e.x,y:e.y,zoom:e.k}),Za=({x:e,y:t,zoom:n})=>ra.translate(e,t).scale(n),lr=(e,t)=>e.target.closest(`.${t}`),Eh=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),b1=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Qa=(e,t=0,n=b1,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},_h=e=>{const t=e.ctrlKey&&vo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function w1({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:i,onPanZoom:c,onPanZoomEnd:l}){return f=>{if(lr(f,t))return f.ctrlKey&&f.preventDefault(),!1;f.preventDefault(),f.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(f.ctrlKey&&a){const y=pt(f),v=_h(f),b=d*Math.pow(2,v);r.scaleTo(n,b,y,f);return}const h=f.deltaMode===1?20:1;let m=o===In.Vertical?0:f.deltaX*h,g=o===In.Horizontal?0:f.deltaY*h;!vo()&&f.shiftKey&&o!==In.Vertical&&(m=f.deltaY*h,g=0),r.translateBy(n,-(m/d)*s,-(g/d)*s,{internal:!0});const p=aa(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(f,p),e.panScrollTimeout=setTimeout(()=>{l==null||l(f,p),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,i==null||i(f,p))}}function j1({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const s=r.type==="wheel",a=!t&&s&&!r.ctrlKey,i=lr(r,e);if(r.ctrlKey&&s&&i&&r.preventDefault(),a||i)return null;r.preventDefault(),n.call(this,r,o)}}function S1({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var s,a,i;if((s=r.sourceEvent)!=null&&s.internal)return;const o=aa(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((i=r.sourceEvent)==null?void 0:i.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function C1({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return s=>{var a,i;e.usedRightMouseButton=!!(n&&Eh(t,e.mouseButton??0)),(a=s.sourceEvent)!=null&&a.sync||r([s.transform.x,s.transform.y,s.transform.k]),o&&!((i=s.sourceEvent)!=null&&i.internal)&&(o==null||o(s.sourceEvent,aa(s.transform)))}}function N1({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:s}){return a=>{var i;if(!((i=a.sourceEvent)!=null&&i.internal)&&(e.isZoomingOrPanning=!1,s&&Eh(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const c=aa(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(a.sourceEvent,c)},n?150:0)}}}function E1({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:i,noPanClassName:c,lib:l,connectionInProgress:f}){return d=>{var y;const h=e||t,m=n&&d.ctrlKey,g=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(lr(d,`${l}-flow__node`)||lr(d,`${l}-flow__edge`)))return!0;if(!r&&!h&&!o&&!s&&!n||a||f&&!g||lr(d,i)&&g||lr(d,c)&&(!g||o&&g&&!e)||!n&&d.ctrlKey&&g)return!1;if(!n&&d.type==="touchstart"&&((y=d.touches)==null?void 0:y.length)>1)return d.preventDefault(),!1;if(!h&&!o&&!m&&g||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const p=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||g)&&p}}function _1({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:i,onDraggingChange:c}){const l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=e.getBoundingClientRect(),d=Zf().scaleExtent([t,n]).translateExtent(r),h=ot(e).call(d);b({x:o.x,y:o.y,zoom:wr(o.zoom,t,n)},[[0,0],[f.width,f.height]],r);const m=h.on("wheel.zoom"),g=h.on("dblclick.zoom");d.wheelDelta(_h);function p(k,M){return h?new Promise(W=>{d==null||d.interpolate((M==null?void 0:M.interpolate)==="linear"?lo:gs).transform(Qa(h,M==null?void 0:M.duration,M==null?void 0:M.ease,()=>W(!0)),k)}):Promise.resolve(!1)}function y({noWheelClassName:k,noPanClassName:M,onPaneContextMenu:W,userSelectionActive:_,panOnScroll:I,panOnDrag:R,panOnScrollMode:z,panOnScrollSpeed:A,preventScrolling:D,zoomOnPinch:B,zoomOnScroll:q,zoomOnDoubleClick:V,zoomActivationKeyPressed:H,lib:L,onTransformChange:Y,connectionInProgress:G,paneClickDistance:$,selectionOnDrag:F}){_&&!l.isZoomingOrPanning&&v();const U=I&&!H&&!_;d.clickDistance(F?1/0:!xt($)||$<0?0:$);const X=U?w1({zoomPanValues:l,noWheelClassName:k,d3Selection:h,d3Zoom:d,panOnScrollMode:z,panOnScrollSpeed:A,zoomOnPinch:B,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:i}):j1({noWheelClassName:k,preventScrolling:D,d3ZoomHandler:m});if(h.on("wheel.zoom",X,{passive:!1}),!_){const K=S1({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:a});d.on("start",K);const J=C1({zoomPanValues:l,panOnDrag:R,onPaneContextMenu:!!W,onPanZoom:s,onTransformChange:Y});d.on("zoom",J);const ee=N1({zoomPanValues:l,panOnDrag:R,panOnScroll:I,onPaneContextMenu:W,onPanZoomEnd:i,onDraggingChange:c});d.on("end",ee)}const Z=E1({zoomActivationKeyPressed:H,panOnDrag:R,zoomOnScroll:q,panOnScroll:I,zoomOnDoubleClick:V,zoomOnPinch:B,userSelectionActive:_,noPanClassName:M,noWheelClassName:k,lib:L,connectionInProgress:G});d.filter(Z),V?h.on("dblclick.zoom",g):h.on("dblclick.zoom",null)}function v(){d.on("zoom",null)}async function b(k,M,W){const _=Za(k),I=d==null?void 0:d.constrain()(_,M,W);return I&&await p(I),new Promise(R=>R(I))}async function x(k,M){const W=Za(k);return await p(W,M),new Promise(_=>_(W))}function j(k){if(h){const M=Za(k),W=h.property("__zoom");(W.k!==k.zoom||W.x!==k.x||W.y!==k.y)&&(d==null||d.transform(h,M,null,{sync:!0}))}}function N(){const k=h?Jf(h.node()):{x:0,y:0,k:1};return{x:k.x,y:k.y,zoom:k.k}}function S(k,M){return h?new Promise(W=>{d==null||d.interpolate((M==null?void 0:M.interpolate)==="linear"?lo:gs).scaleTo(Qa(h,M==null?void 0:M.duration,M==null?void 0:M.ease,()=>W(!0)),k)}):Promise.resolve(!1)}function E(k,M){return h?new Promise(W=>{d==null||d.interpolate((M==null?void 0:M.interpolate)==="linear"?lo:gs).scaleBy(Qa(h,M==null?void 0:M.duration,M==null?void 0:M.ease,()=>W(!0)),k)}):Promise.resolve(!1)}function O(k){d==null||d.scaleExtent(k)}function P(k){d==null||d.translateExtent(k)}function T(k){const M=!xt(k)||k<0?0:k;d==null||d.clickDistance(M)}return{update:y,destroy:v,setViewport:x,setViewportConstrained:b,getViewport:N,scaleTo:S,scaleBy:E,setScaleExtent:O,setTranslateExtent:P,syncViewport:j,setClickDistance:T}}var Cr;(function(e){e.Line="line",e.Handle="handle"})(Cr||(Cr={}));function k1({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:s}){const a=e-t,i=n-r,c=[a>0?1:a<0?-1:0,i>0?1:i<0?-1:0];return a&&o&&(c[0]=c[0]*-1),i&&s&&(c[1]=c[1]*-1),c}function _u(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:o}}function un(e,t){return Math.max(0,t-e)}function dn(e,t){return Math.max(0,e-t)}function rs(e,t,n){return Math.max(0,t-e,e-n)}function ku(e,t){return e?!t:t}function M1(e,t,n,r,o,s,a,i){let{affectsX:c,affectsY:l}=t;const{isHorizontal:f,isVertical:d}=t,h=f&&d,{xSnapped:m,ySnapped:g}=n,{minWidth:p,maxWidth:y,minHeight:v,maxHeight:b}=r,{x,y:j,width:N,height:S,aspectRatio:E}=e;let O=Math.floor(f?m-e.pointerX:0),P=Math.floor(d?g-e.pointerY:0);const T=N+(c?-O:O),k=S+(l?-P:P),M=-s[0]*N,W=-s[1]*S;let _=rs(T,p,y),I=rs(k,v,b);if(a){let A=0,D=0;c&&O<0?A=un(x+O+M,a[0][0]):!c&&O>0&&(A=dn(x+T+M,a[1][0])),l&&P<0?D=un(j+P+W,a[0][1]):!l&&P>0&&(D=dn(j+k+W,a[1][1])),_=Math.max(_,A),I=Math.max(I,D)}if(i){let A=0,D=0;c&&O>0?A=dn(x+O,i[0][0]):!c&&O<0&&(A=un(x+T,i[1][0])),l&&P>0?D=dn(j+P,i[0][1]):!l&&P<0&&(D=un(j+k,i[1][1])),_=Math.max(_,A),I=Math.max(I,D)}if(o){if(f){const A=rs(T/E,v,b)*E;if(_=Math.max(_,A),a){let D=0;!c&&!l||c&&!l&&h?D=dn(j+W+T/E,a[1][1])*E:D=un(j+W+(c?O:-O)/E,a[0][1])*E,_=Math.max(_,D)}if(i){let D=0;!c&&!l||c&&!l&&h?D=un(j+T/E,i[1][1])*E:D=dn(j+(c?O:-O)/E,i[0][1])*E,_=Math.max(_,D)}}if(d){const A=rs(k*E,p,y)/E;if(I=Math.max(I,A),a){let D=0;!c&&!l||l&&!c&&h?D=dn(x+k*E+M,a[1][0])/E:D=un(x+(l?P:-P)*E+M,a[0][0])/E,I=Math.max(I,D)}if(i){let D=0;!c&&!l||l&&!c&&h?D=un(x+k*E,i[1][0])/E:D=dn(x+(l?P:-P)*E,i[0][0])/E,I=Math.max(I,D)}}}P=P+(P<0?I:-I),O=O+(O<0?_:-_),o&&(h?T>k*E?P=(ku(c,l)?-O:O)/E:O=(ku(c,l)?-P:P)*E:f?(P=O/E,l=c):(O=P*E,c=l));const R=c?x+O:x,z=l?j+P:j;return{width:N+(c?-O:O),height:S+(l?-P:P),x:s[0]*O*(c?-1:1)+R,y:s[1]*P*(l?-1:1)+z}}const kh={width:0,height:0,x:0,y:0},P1={...kh,pointerX:0,pointerY:0,aspectRatio:1};function D1(e){return[[0,0],[e.measured.width,e.measured.height]]}function O1(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,s=e.measured.width??0,a=e.measured.height??0,i=n[0]*s,c=n[1]*a;return[[r-i,o-c],[r+s-i,o+a-c]]}function R1({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const s=ot(e);let a={controlDirection:_u("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function i({controlPosition:l,boundaries:f,keepAspectRatio:d,resizeDirection:h,onResizeStart:m,onResize:g,onResizeEnd:p,shouldResize:y}){let v={...kh},b={...P1};a={boundaries:f,resizeDirection:h,keepAspectRatio:d,controlDirection:_u(l)};let x,j=null,N=[],S,E,O,P=!1;const T=$f().on("start",k=>{const{nodeLookup:M,transform:W,snapGrid:_,snapToGrid:I,nodeOrigin:R,paneDomNode:z}=n();if(x=M.get(t),!x)return;j=(z==null?void 0:z.getBoundingClientRect())??null;const{xSnapped:A,ySnapped:D}=uo(k.sourceEvent,{transform:W,snapGrid:_,snapToGrid:I,containerBounds:j});v={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},b={...v,pointerX:A,pointerY:D,aspectRatio:v.width/v.height},S=void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(S=M.get(x.parentId),E=S&&x.extent==="parent"?D1(S):void 0),N=[],O=void 0;for(const[B,q]of M)if(q.parentId===t&&(N.push({id:B,position:{...q.position},extent:q.extent}),q.extent==="parent"||q.expandParent)){const V=O1(q,x,q.origin??R);O?O=[[Math.min(V[0][0],O[0][0]),Math.min(V[0][1],O[0][1])],[Math.max(V[1][0],O[1][0]),Math.max(V[1][1],O[1][1])]]:O=V}m==null||m(k,{...v})}).on("drag",k=>{const{transform:M,snapGrid:W,snapToGrid:_,nodeOrigin:I}=n(),R=uo(k.sourceEvent,{transform:M,snapGrid:W,snapToGrid:_,containerBounds:j}),z=[];if(!x)return;const{x:A,y:D,width:B,height:q}=v,V={},H=x.origin??I,{width:L,height:Y,x:G,y:$}=M1(b,a.controlDirection,R,a.boundaries,a.keepAspectRatio,H,E,O),F=L!==B,U=Y!==q,X=G!==A&&F,Z=$!==D&&U;if(!X&&!Z&&!F&&!U)return;if((X||Z||H[0]===1||H[1]===1)&&(V.x=X?G:v.x,V.y=Z?$:v.y,v.x=V.x,v.y=V.y,N.length>0)){const se=G-A,ae=$-D;for(const ue of N)ue.position={x:ue.position.x-se+H[0]*(L-B),y:ue.position.y-ae+H[1]*(Y-q)},z.push(ue)}if((F||U)&&(V.width=F&&(!a.resizeDirection||a.resizeDirection==="horizontal")?L:v.width,V.height=U&&(!a.resizeDirection||a.resizeDirection==="vertical")?Y:v.height,v.width=V.width,v.height=V.height),S&&x.expandParent){const se=H[0]*(V.width??0);V.x&&V.x<se&&(v.x=se,b.x=b.x-(V.x-se));const ae=H[1]*(V.height??0);V.y&&V.y<ae&&(v.y=ae,b.y=b.y-(V.y-ae))}const K=k1({width:v.width,prevWidth:B,height:v.height,prevHeight:q,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),J={...v,direction:K};(y==null?void 0:y(k,J))!==!1&&(P=!0,g==null||g(k,J),r(V,z))}).on("end",k=>{P&&(p==null||p(k,{...v}),o==null||o({...v}),P=!1)});s.call(T)}function c(){s.on(".drag",null)}return{update:i,destroy:c}}var A1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Mh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vi={exports:{}},ei={},os={exports:{}},ti={};/**
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),_=require("react"),ts=require("react-dom");function Mf(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const b=Mf(_),ns=Mf(ts),nd=e=>{let t;const n=new Set,r=(l,u)=>{const f=typeof l=="function"?l(t):l;if(!Object.is(f,t)){const h=t;t=u??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(p=>p(t,h))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=t=e(r,o,i);return i},ub=e=>e?nd(e):nd,fb=e=>e;function hb(e,t=fb){const n=_.useSyncExternalStore(e.subscribe,_.useCallback(()=>t(e.getState()),[e,t]),_.useCallback(()=>t(e.getInitialState()),[e,t]));return _.useDebugValue(n),n}const rd=e=>{const t=ub(e),n=r=>hb(t,r);return Object.assign(n,t),n},pb=e=>e?rd(e):rd;function Ie(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Ie(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var mb={value:()=>{}};function rs(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new va(n)}function va(e){this._=e}function gb(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}va.prototype=rs.prototype={constructor:va,on:function(e,t){var n=this._,r=gb(e+"",n),o,a=-1,s=r.length;if(arguments.length<2){for(;++a<s;)if((o=(e=r[a]).type)&&(o=yb(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<s;)if(o=(e=r[a]).type)n[o]=od(n[o],e.name,t);else if(t==null)for(o in n)n[o]=od(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new va(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,a;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],r=0,o=a.length;r<o;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,a=r.length;o<a;++o)r[o].value.apply(t,n)}};function yb(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function od(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=mb,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ii="http://www.w3.org/1999/xhtml";const ad={svg:"http://www.w3.org/2000/svg",xhtml:Ii,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function os(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ad.hasOwnProperty(t)?{space:ad[t],local:e}:e}function xb(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ii&&t.documentElement.namespaceURI===Ii?t.createElement(e):t.createElementNS(n,e)}}function vb(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Df(e){var t=os(e);return(t.local?vb:xb)(t)}function bb(){}function jc(e){return e==null?bb:function(){return this.querySelector(e)}}function wb(e){typeof e!="function"&&(e=jc(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var a=t[o],s=a.length,i=r[o]=new Array(s),c,l,u=0;u<s;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&("__data__"in c&&(l.__data__=c.__data__),i[u]=l);return new st(r,this._parents)}function jb(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function _b(){return[]}function Of(e){return e==null?_b:function(){return this.querySelectorAll(e)}}function Sb(e){return function(){return jb(e.apply(this,arguments))}}function Cb(e){typeof e=="function"?e=Sb(e):e=Of(e);for(var t=this._groups,n=t.length,r=[],o=[],a=0;a<n;++a)for(var s=t[a],i=s.length,c,l=0;l<i;++l)(c=s[l])&&(r.push(e.call(c,c.__data__,l,s)),o.push(c));return new st(r,o)}function Rf(e){return function(){return this.matches(e)}}function Af(e){return function(t){return t.matches(e)}}var Nb=Array.prototype.find;function Eb(e){return function(){return Nb.call(this.children,e)}}function kb(){return this.firstElementChild}function Pb(e){return this.select(e==null?kb:Eb(typeof e=="function"?e:Af(e)))}var Mb=Array.prototype.filter;function Db(){return Array.from(this.children)}function Ob(e){return function(){return Mb.call(this.children,e)}}function Rb(e){return this.selectAll(e==null?Db:Ob(typeof e=="function"?e:Af(e)))}function Ab(e){typeof e!="function"&&(e=Rf(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var a=t[o],s=a.length,i=r[o]=[],c,l=0;l<s;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&i.push(c);return new st(r,this._parents)}function Tf(e){return new Array(e.length)}function Tb(){return new st(this._enter||this._groups.map(Tf),this._parents)}function Pa(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Pa.prototype={constructor:Pa,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Ib(e){return function(){return e}}function $b(e,t,n,r,o,a){for(var s=0,i,c=t.length,l=a.length;s<l;++s)(i=t[s])?(i.__data__=a[s],r[s]=i):n[s]=new Pa(e,a[s]);for(;s<c;++s)(i=t[s])&&(o[s]=i)}function zb(e,t,n,r,o,a,s){var i,c,l=new Map,u=t.length,f=a.length,h=new Array(u),p;for(i=0;i<u;++i)(c=t[i])&&(h[i]=p=s.call(c,c.__data__,i,t)+"",l.has(p)?o[i]=c:l.set(p,c));for(i=0;i<f;++i)p=s.call(e,a[i],i,a)+"",(c=l.get(p))?(r[i]=c,c.__data__=a[i],l.delete(p)):n[i]=new Pa(e,a[i]);for(i=0;i<u;++i)(c=t[i])&&l.get(h[i])===c&&(o[i]=c)}function Lb(e){return e.__data__}function Wb(e,t){if(!arguments.length)return Array.from(this,Lb);var n=t?zb:$b,r=this._parents,o=this._groups;typeof e!="function"&&(e=Ib(e));for(var a=o.length,s=new Array(a),i=new Array(a),c=new Array(a),l=0;l<a;++l){var u=r[l],f=o[l],h=f.length,p=Fb(e.call(u,u&&u.__data__,l,r)),m=p.length,g=i[l]=new Array(m),y=s[l]=new Array(m),v=c[l]=new Array(h);n(u,f,g,y,v,p,t);for(var w=0,x=0,j,N;w<m;++w)if(j=g[w]){for(w>=x&&(x=w+1);!(N=y[x])&&++x<m;);j._next=N||null}}return s=new st(s,r),s._enter=i,s._exit=c,s}function Fb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Bb(){return new st(this._exit||this._groups.map(Tf),this._parents)}function Hb(e,t,n){var r=this.enter(),o=this,a=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?a.remove():n(a),r&&o?r.merge(o).order():o}function Vb(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,a=r.length,s=Math.min(o,a),i=new Array(o),c=0;c<s;++c)for(var l=n[c],u=r[c],f=l.length,h=i[c]=new Array(f),p,m=0;m<f;++m)(p=l[m]||u[m])&&(h[m]=p);for(;c<o;++c)i[c]=n[c];return new st(i,this._parents)}function Yb(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,a=r[o],s;--o>=0;)(s=r[o])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function qb(e){e||(e=Gb);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,o=new Array(r),a=0;a<r;++a){for(var s=n[a],i=s.length,c=o[a]=new Array(i),l,u=0;u<i;++u)(l=s[u])&&(c[u]=l);c.sort(t)}return new st(o,this._parents).order()}function Gb(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ub(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Xb(){return Array.from(this)}function Kb(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,a=r.length;o<a;++o){var s=r[o];if(s)return s}return null}function Jb(){let e=0;for(const t of this)++e;return e}function Zb(){return!this.node()}function Qb(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],a=0,s=o.length,i;a<s;++a)(i=o[a])&&e.call(i,i.__data__,a,o);return this}function e0(e){return function(){this.removeAttribute(e)}}function t0(e){return function(){this.removeAttributeNS(e.space,e.local)}}function n0(e,t){return function(){this.setAttribute(e,t)}}function r0(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function o0(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function a0(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function s0(e,t){var n=os(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?t0:e0:typeof t=="function"?n.local?a0:o0:n.local?r0:n0)(n,t))}function If(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function i0(e){return function(){this.style.removeProperty(e)}}function c0(e,t,n){return function(){this.style.setProperty(e,t,n)}}function l0(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function d0(e,t,n){return arguments.length>1?this.each((t==null?i0:typeof t=="function"?l0:c0)(e,t,n??"")):vr(this.node(),e)}function vr(e,t){return e.style.getPropertyValue(t)||If(e).getComputedStyle(e,null).getPropertyValue(t)}function u0(e){return function(){delete this[e]}}function f0(e,t){return function(){this[e]=t}}function h0(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function p0(e,t){return arguments.length>1?this.each((t==null?u0:typeof t=="function"?h0:f0)(e,t)):this.node()[e]}function $f(e){return e.trim().split(/^|\s+/)}function _c(e){return e.classList||new zf(e)}function zf(e){this._node=e,this._names=$f(e.getAttribute("class")||"")}zf.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Lf(e,t){for(var n=_c(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Wf(e,t){for(var n=_c(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function m0(e){return function(){Lf(this,e)}}function g0(e){return function(){Wf(this,e)}}function y0(e,t){return function(){(t.apply(this,arguments)?Lf:Wf)(this,e)}}function x0(e,t){var n=$f(e+"");if(arguments.length<2){for(var r=_c(this.node()),o=-1,a=n.length;++o<a;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?y0:t?m0:g0)(n,t))}function v0(){this.textContent=""}function b0(e){return function(){this.textContent=e}}function w0(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function j0(e){return arguments.length?this.each(e==null?v0:(typeof e=="function"?w0:b0)(e)):this.node().textContent}function _0(){this.innerHTML=""}function S0(e){return function(){this.innerHTML=e}}function C0(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function N0(e){return arguments.length?this.each(e==null?_0:(typeof e=="function"?C0:S0)(e)):this.node().innerHTML}function E0(){this.nextSibling&&this.parentNode.appendChild(this)}function k0(){return this.each(E0)}function P0(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function M0(){return this.each(P0)}function D0(e){var t=typeof e=="function"?e:Df(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function O0(){return null}function R0(e,t){var n=typeof e=="function"?e:Df(e),r=t==null?O0:typeof t=="function"?t:jc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function A0(){var e=this.parentNode;e&&e.removeChild(this)}function T0(){return this.each(A0)}function I0(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function $0(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function z0(e){return this.select(e?$0:I0)}function L0(e){return arguments.length?this.property("__data__",e):this.node().__data__}function W0(e){return function(t){e.call(this,t,this.__data__)}}function F0(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function B0(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,a;n<o;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function H0(e,t,n){return function(){var r=this.__on,o,a=W0(t);if(r){for(var s=0,i=r.length;s<i;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=n),o.value=t;return}}this.addEventListener(e.type,a,n),o={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(o):this.__on=[o]}}function V0(e,t,n){var r=F0(e+""),o,a=r.length,s;if(arguments.length<2){var i=this.node().__on;if(i){for(var c=0,l=i.length,u;c<l;++c)for(o=0,u=i[c];o<a;++o)if((s=r[o]).type===u.type&&s.name===u.name)return u.value}return}for(i=t?H0:B0,o=0;o<a;++o)this.each(i(r[o],t,n));return this}function Ff(e,t,n){var r=If(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function Y0(e,t){return function(){return Ff(this,e,t)}}function q0(e,t){return function(){return Ff(this,e,t.apply(this,arguments))}}function G0(e,t){return this.each((typeof t=="function"?q0:Y0)(e,t))}function*U0(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,a=r.length,s;o<a;++o)(s=r[o])&&(yield s)}var Bf=[null];function st(e,t){this._groups=e,this._parents=t}function Ao(){return new st([[document.documentElement]],Bf)}function X0(){return this}st.prototype=Ao.prototype={constructor:st,select:wb,selectAll:Cb,selectChild:Pb,selectChildren:Rb,filter:Ab,data:Wb,enter:Tb,exit:Bb,join:Hb,merge:Vb,selection:X0,order:Yb,sort:qb,call:Ub,nodes:Xb,node:Kb,size:Jb,empty:Zb,each:Qb,attr:s0,style:d0,property:p0,classed:x0,text:j0,html:N0,raise:k0,lower:M0,append:D0,insert:R0,remove:T0,clone:z0,datum:L0,on:V0,dispatch:G0,[Symbol.iterator]:U0};function ot(e){return typeof e=="string"?new st([[document.querySelector(e)]],[document.documentElement]):new st([[e]],Bf)}function K0(e){let t;for(;t=e.sourceEvent;)e=t;return e}function gt(e,t){if(e=K0(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const J0={passive:!1},po={capture:!0,passive:!1};function Js(e){e.stopImmediatePropagation()}function hr(e){e.preventDefault(),e.stopImmediatePropagation()}function Hf(e){var t=e.document.documentElement,n=ot(e).on("dragstart.drag",hr,po);"onselectstart"in t?n.on("selectstart.drag",hr,po):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Vf(e,t){var n=e.document.documentElement,r=ot(e).on("dragstart.drag",null);t&&(r.on("click.drag",hr,po),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const ea=e=>()=>e;function $i(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:a,x:s,y:i,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:i,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}$i.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Z0(e){return!e.ctrlKey&&!e.button}function Q0(){return this.parentNode}function ew(e,t){return t??{x:e.x,y:e.y}}function tw(){return navigator.maxTouchPoints||"ontouchstart"in this}function Yf(){var e=Z0,t=Q0,n=ew,r=tw,o={},a=rs("start","drag","end"),s=0,i,c,l,u,f=0;function h(j){j.on("mousedown.drag",p).filter(r).on("touchstart.drag",y).on("touchmove.drag",v,J0).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(j,N){if(!(u||!e.call(this,j,N))){var S=x(this,t.call(this,j,N),j,N,"mouse");S&&(ot(j.view).on("mousemove.drag",m,po).on("mouseup.drag",g,po),Hf(j.view),Js(j),l=!1,i=j.clientX,c=j.clientY,S("start",j))}}function m(j){if(hr(j),!l){var N=j.clientX-i,S=j.clientY-c;l=N*N+S*S>f}o.mouse("drag",j)}function g(j){ot(j.view).on("mousemove.drag mouseup.drag",null),Vf(j.view,l),hr(j),o.mouse("end",j)}function y(j,N){if(e.call(this,j,N)){var S=j.changedTouches,C=t.call(this,j,N),P=S.length,k,T;for(k=0;k<P;++k)(T=x(this,C,j,N,S[k].identifier,S[k]))&&(Js(j),T("start",j,S[k]))}}function v(j){var N=j.changedTouches,S=N.length,C,P;for(C=0;C<S;++C)(P=o[N[C].identifier])&&(hr(j),P("drag",j,N[C]))}function w(j){var N=j.changedTouches,S=N.length,C,P;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),C=0;C<S;++C)(P=o[N[C].identifier])&&(Js(j),P("end",j,N[C]))}function x(j,N,S,C,P,k){var T=a.copy(),D=gt(k||S,N),M,L,E;if((E=n.call(j,new $i("beforestart",{sourceEvent:S,target:h,identifier:P,active:s,x:D[0],y:D[1],dx:0,dy:0,dispatch:T}),C))!=null)return M=E.x-D[0]||0,L=E.y-D[1]||0,function I(R,z,A){var O=D,F;switch(R){case"start":o[P]=I,F=s++;break;case"end":delete o[P],--s;case"drag":D=gt(A||z,N),F=s;break}T.call(R,j,new $i(R,{sourceEvent:z,subject:E,target:h,identifier:P,active:F,x:D[0]+M,y:D[1]+L,dx:D[0]-O[0],dy:D[1]-O[1],dispatch:T}),C)}}return h.filter=function(j){return arguments.length?(e=typeof j=="function"?j:ea(!!j),h):e},h.container=function(j){return arguments.length?(t=typeof j=="function"?j:ea(j),h):t},h.subject=function(j){return arguments.length?(n=typeof j=="function"?j:ea(j),h):n},h.touchable=function(j){return arguments.length?(r=typeof j=="function"?j:ea(!!j),h):r},h.on=function(){var j=a.on.apply(a,arguments);return j===a?h:j},h.clickDistance=function(j){return arguments.length?(f=(j=+j)*j,h):Math.sqrt(f)},h}function Sc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function qf(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function To(){}var mo=.7,Ma=1/mo,pr="\\s*([+-]?\\d+)\\s*",go="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ht="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",nw=/^#([0-9a-f]{3,8})$/,rw=new RegExp(`^rgb\\(${pr},${pr},${pr}\\)$`),ow=new RegExp(`^rgb\\(${Ht},${Ht},${Ht}\\)$`),aw=new RegExp(`^rgba\\(${pr},${pr},${pr},${go}\\)$`),sw=new RegExp(`^rgba\\(${Ht},${Ht},${Ht},${go}\\)$`),iw=new RegExp(`^hsl\\(${go},${Ht},${Ht}\\)$`),cw=new RegExp(`^hsla\\(${go},${Ht},${Ht},${go}\\)$`),sd={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Sc(To,Ln,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:id,formatHex:id,formatHex8:lw,formatHsl:dw,formatRgb:cd,toString:cd});function id(){return this.rgb().formatHex()}function lw(){return this.rgb().formatHex8()}function dw(){return Gf(this).formatHsl()}function cd(){return this.rgb().formatRgb()}function Ln(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=nw.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ld(t):n===3?new Je(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ta(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ta(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=rw.exec(e))?new Je(t[1],t[2],t[3],1):(t=ow.exec(e))?new Je(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=aw.exec(e))?ta(t[1],t[2],t[3],t[4]):(t=sw.exec(e))?ta(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=iw.exec(e))?fd(t[1],t[2]/100,t[3]/100,1):(t=cw.exec(e))?fd(t[1],t[2]/100,t[3]/100,t[4]):sd.hasOwnProperty(e)?ld(sd[e]):e==="transparent"?new Je(NaN,NaN,NaN,0):null}function ld(e){return new Je(e>>16&255,e>>8&255,e&255,1)}function ta(e,t,n,r){return r<=0&&(e=t=n=NaN),new Je(e,t,n,r)}function uw(e){return e instanceof To||(e=Ln(e)),e?(e=e.rgb(),new Je(e.r,e.g,e.b,e.opacity)):new Je}function zi(e,t,n,r){return arguments.length===1?uw(e):new Je(e,t,n,r??1)}function Je(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Sc(Je,zi,qf(To,{brighter(e){return e=e==null?Ma:Math.pow(Ma,e),new Je(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?mo:Math.pow(mo,e),new Je(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Je(In(this.r),In(this.g),In(this.b),Da(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:dd,formatHex:dd,formatHex8:fw,formatRgb:ud,toString:ud}));function dd(){return`#${An(this.r)}${An(this.g)}${An(this.b)}`}function fw(){return`#${An(this.r)}${An(this.g)}${An(this.b)}${An((isNaN(this.opacity)?1:this.opacity)*255)}`}function ud(){const e=Da(this.opacity);return`${e===1?"rgb(":"rgba("}${In(this.r)}, ${In(this.g)}, ${In(this.b)}${e===1?")":`, ${e})`}`}function Da(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function In(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function An(e){return e=In(e),(e<16?"0":"")+e.toString(16)}function fd(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new xt(e,t,n,r)}function Gf(e){if(e instanceof xt)return new xt(e.h,e.s,e.l,e.opacity);if(e instanceof To||(e=Ln(e)),!e)return new xt;if(e instanceof xt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),a=Math.max(t,n,r),s=NaN,i=a-o,c=(a+o)/2;return i?(t===a?s=(n-r)/i+(n<r)*6:n===a?s=(r-t)/i+2:s=(t-n)/i+4,i/=c<.5?a+o:2-a-o,s*=60):i=c>0&&c<1?0:s,new xt(s,i,c,e.opacity)}function hw(e,t,n,r){return arguments.length===1?Gf(e):new xt(e,t,n,r??1)}function xt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Sc(xt,hw,qf(To,{brighter(e){return e=e==null?Ma:Math.pow(Ma,e),new xt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?mo:Math.pow(mo,e),new xt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Je(Zs(e>=240?e-240:e+120,o,r),Zs(e,o,r),Zs(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new xt(hd(this.h),na(this.s),na(this.l),Da(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Da(this.opacity);return`${e===1?"hsl(":"hsla("}${hd(this.h)}, ${na(this.s)*100}%, ${na(this.l)*100}%${e===1?")":`, ${e})`}`}}));function hd(e){return e=(e||0)%360,e<0?e+360:e}function na(e){return Math.max(0,Math.min(1,e||0))}function Zs(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Cc=e=>()=>e;function pw(e,t){return function(n){return e+n*t}}function mw(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function gw(e){return(e=+e)==1?Uf:function(t,n){return n-t?mw(t,n,e):Cc(isNaN(t)?n:t)}}function Uf(e,t){var n=t-e;return n?pw(e,n):Cc(isNaN(e)?t:e)}const Oa=function e(t){var n=gw(t);function r(o,a){var s=n((o=zi(o)).r,(a=zi(a)).r),i=n(o.g,a.g),c=n(o.b,a.b),l=Uf(o.opacity,a.opacity);return function(u){return o.r=s(u),o.g=i(u),o.b=c(u),o.opacity=l(u),o+""}}return r.gamma=e,r}(1);function yw(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(a){for(o=0;o<n;++o)r[o]=e[o]*(1-a)+t[o]*a;return r}}function xw(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function vw(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,o=new Array(r),a=new Array(n),s;for(s=0;s<r;++s)o[s]=uo(e[s],t[s]);for(;s<n;++s)a[s]=t[s];return function(i){for(s=0;s<r;++s)a[s]=o[s](i);return a}}function bw(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function It(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function ww(e,t){var n={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=uo(e[o],t[o]):r[o]=t[o];return function(a){for(o in n)r[o]=n[o](a);return r}}var Li=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Qs=new RegExp(Li.source,"g");function jw(e){return function(){return e}}function _w(e){return function(t){return e(t)+""}}function Xf(e,t){var n=Li.lastIndex=Qs.lastIndex=0,r,o,a,s=-1,i=[],c=[];for(e=e+"",t=t+"";(r=Li.exec(e))&&(o=Qs.exec(t));)(a=o.index)>n&&(a=t.slice(n,a),i[s]?i[s]+=a:i[++s]=a),(r=r[0])===(o=o[0])?i[s]?i[s]+=o:i[++s]=o:(i[++s]=null,c.push({i:s,x:It(r,o)})),n=Qs.lastIndex;return n<t.length&&(a=t.slice(n),i[s]?i[s]+=a:i[++s]=a),i.length<2?c[0]?_w(c[0].x):jw(t):(t=c.length,function(l){for(var u=0,f;u<t;++u)i[(f=c[u]).i]=f.x(l);return i.join("")})}function uo(e,t){var n=typeof t,r;return t==null||n==="boolean"?Cc(t):(n==="number"?It:n==="string"?(r=Ln(t))?(t=r,Oa):Xf:t instanceof Ln?Oa:t instanceof Date?bw:xw(t)?yw:Array.isArray(t)?vw:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?ww:It)(e,t)}var pd=180/Math.PI,Wi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Kf(e,t,n,r,o,a){var s,i,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(i=Math.sqrt(n*n+r*r))&&(n/=i,r/=i,c/=i),e*r<t*n&&(e=-e,t=-t,c=-c,s=-s),{translateX:o,translateY:a,rotate:Math.atan2(t,e)*pd,skewX:Math.atan(c)*pd,scaleX:s,scaleY:i}}var ra;function Sw(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Wi:Kf(t.a,t.b,t.c,t.d,t.e,t.f)}function Cw(e){return e==null||(ra||(ra=document.createElementNS("http://www.w3.org/2000/svg","g")),ra.setAttribute("transform",e),!(e=ra.transform.baseVal.consolidate()))?Wi:(e=e.matrix,Kf(e.a,e.b,e.c,e.d,e.e,e.f))}function Jf(e,t,n,r){function o(l){return l.length?l.pop()+" ":""}function a(l,u,f,h,p,m){if(l!==f||u!==h){var g=p.push("translate(",null,t,null,n);m.push({i:g-4,x:It(l,f)},{i:g-2,x:It(u,h)})}else(f||h)&&p.push("translate("+f+t+h+n)}function s(l,u,f,h){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),h.push({i:f.push(o(f)+"rotate(",null,r)-2,x:It(l,u)})):u&&f.push(o(f)+"rotate("+u+r)}function i(l,u,f,h){l!==u?h.push({i:f.push(o(f)+"skewX(",null,r)-2,x:It(l,u)}):u&&f.push(o(f)+"skewX("+u+r)}function c(l,u,f,h,p,m){if(l!==f||u!==h){var g=p.push(o(p)+"scale(",null,",",null,")");m.push({i:g-4,x:It(l,f)},{i:g-2,x:It(u,h)})}else(f!==1||h!==1)&&p.push(o(p)+"scale("+f+","+h+")")}return function(l,u){var f=[],h=[];return l=e(l),u=e(u),a(l.translateX,l.translateY,u.translateX,u.translateY,f,h),s(l.rotate,u.rotate,f,h),i(l.skewX,u.skewX,f,h),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,f,h),l=u=null,function(p){for(var m=-1,g=h.length,y;++m<g;)f[(y=h[m]).i]=y.x(p);return f.join("")}}}var Nw=Jf(Sw,"px, ","px)","deg)"),Ew=Jf(Cw,", ",")",")"),kw=1e-12;function md(e){return((e=Math.exp(e))+1/e)/2}function Pw(e){return((e=Math.exp(e))-1/e)/2}function Mw(e){return((e=Math.exp(2*e))-1)/(e+1)}const ba=function e(t,n,r){function o(a,s){var i=a[0],c=a[1],l=a[2],u=s[0],f=s[1],h=s[2],p=u-i,m=f-c,g=p*p+m*m,y,v;if(g<kw)v=Math.log(h/l)/t,y=function(C){return[i+C*p,c+C*m,l*Math.exp(t*C*v)]};else{var w=Math.sqrt(g),x=(h*h-l*l+r*g)/(2*l*n*w),j=(h*h-l*l-r*g)/(2*h*n*w),N=Math.log(Math.sqrt(x*x+1)-x),S=Math.log(Math.sqrt(j*j+1)-j);v=(S-N)/t,y=function(C){var P=C*v,k=md(N),T=l/(n*w)*(k*Mw(t*P+N)-Pw(N));return[i+T*p,c+T*m,l*k/md(t*P+N)]}}return y.duration=v*1e3*t/Math.SQRT2,y}return o.rho=function(a){var s=Math.max(.001,+a),i=s*s,c=i*i;return e(s,i,c)},o}(Math.SQRT2,2,4);var br=0,eo=0,Yr=0,Zf=1e3,Ra,to,Aa=0,Wn=0,as=0,yo=typeof performance=="object"&&performance.now?performance:Date,Qf=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Nc(){return Wn||(Qf(Dw),Wn=yo.now()+as)}function Dw(){Wn=0}function Ta(){this._call=this._time=this._next=null}Ta.prototype=eh.prototype={constructor:Ta,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Nc():+n)+(t==null?0:+t),!this._next&&to!==this&&(to?to._next=this:Ra=this,to=this),this._call=e,this._time=n,Fi()},stop:function(){this._call&&(this._call=null,this._time=1/0,Fi())}};function eh(e,t,n){var r=new Ta;return r.restart(e,t,n),r}function Ow(){Nc(),++br;for(var e=Ra,t;e;)(t=Wn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--br}function gd(){Wn=(Aa=yo.now())+as,br=eo=0;try{Ow()}finally{br=0,Aw(),Wn=0}}function Rw(){var e=yo.now(),t=e-Aa;t>Zf&&(as-=t,Aa=e)}function Aw(){for(var e,t=Ra,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ra=n);to=e,Fi(r)}function Fi(e){if(!br){eo&&(eo=clearTimeout(eo));var t=e-Wn;t>24?(e<1/0&&(eo=setTimeout(gd,e-yo.now()-as)),Yr&&(Yr=clearInterval(Yr))):(Yr||(Aa=yo.now(),Yr=setInterval(Rw,Zf)),br=1,Qf(gd))}}function yd(e,t,n){var r=new Ta;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var Tw=rs("start","end","cancel","interrupt"),Iw=[],th=0,xd=1,Bi=2,wa=3,vd=4,Hi=5,ja=6;function ss(e,t,n,r,o,a){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;$w(e,n,{name:t,index:r,group:o,on:Tw,tween:Iw,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:th})}function Ec(e,t){var n=Et(e,t);if(n.state>th)throw new Error("too late; already scheduled");return n}function qt(e,t){var n=Et(e,t);if(n.state>wa)throw new Error("too late; already running");return n}function Et(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function $w(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=eh(a,0,n.time);function a(l){n.state=xd,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,f,h,p;if(n.state!==xd)return c();for(u in r)if(p=r[u],p.name===n.name){if(p.state===wa)return yd(s);p.state===vd?(p.state=ja,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[u]):+u<t&&(p.state=ja,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[u])}if(yd(function(){n.state===wa&&(n.state=vd,n.timer.restart(i,n.delay,n.time),i(l))}),n.state=Bi,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Bi){for(n.state=wa,o=new Array(h=n.tween.length),u=0,f=-1;u<h;++u)(p=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(o[++f]=p);o.length=f+1}}function i(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=Hi,1),f=-1,h=o.length;++f<h;)o[f].call(e,u);n.state===Hi&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=ja,n.timer.stop(),delete r[t];for(var l in r)return;delete e.__transition}}function _a(e,t){var n=e.__transition,r,o,a=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){a=!1;continue}o=r.state>Bi&&r.state<Hi,r.state=ja,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}a&&delete e.__transition}}function zw(e){return this.each(function(){_a(this,e)})}function Lw(e,t){var n,r;return function(){var o=qt(this,e),a=o.tween;if(a!==n){r=n=a;for(var s=0,i=r.length;s<i;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function Ww(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var a=qt(this,e),s=a.tween;if(s!==r){o=(r=s).slice();for(var i={name:t,value:n},c=0,l=o.length;c<l;++c)if(o[c].name===t){o[c]=i;break}c===l&&o.push(i)}a.tween=o}}function Fw(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Et(this.node(),n).tween,o=0,a=r.length,s;o<a;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?Lw:Ww)(n,e,t))}function kc(e,t,n){var r=e._id;return e.each(function(){var o=qt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Et(o,r).value[t]}}function nh(e,t){var n;return(typeof t=="number"?It:t instanceof Ln?Oa:(n=Ln(t))?(t=n,Oa):Xf)(e,t)}function Bw(e){return function(){this.removeAttribute(e)}}function Hw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Vw(e,t,n){var r,o=n+"",a;return function(){var s=this.getAttribute(e);return s===o?null:s===r?a:a=t(r=s,n)}}function Yw(e,t,n){var r,o=n+"",a;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?a:a=t(r=s,n)}}function qw(e,t,n){var r,o,a;return function(){var s,i=n(this),c;return i==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=i+"",s===c?null:s===r&&c===o?a:(o=c,a=t(r=s,i)))}}function Gw(e,t,n){var r,o,a;return function(){var s,i=n(this),c;return i==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=i+"",s===c?null:s===r&&c===o?a:(o=c,a=t(r=s,i)))}}function Uw(e,t){var n=os(e),r=n==="transform"?Ew:nh;return this.attrTween(e,typeof t=="function"?(n.local?Gw:qw)(n,r,kc(this,"attr."+e,t)):t==null?(n.local?Hw:Bw)(n):(n.local?Yw:Vw)(n,r,t))}function Xw(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Kw(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Jw(e,t){var n,r;function o(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&Kw(e,a)),n}return o._value=t,o}function Zw(e,t){var n,r;function o(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&Xw(e,a)),n}return o._value=t,o}function Qw(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=os(e);return this.tween(n,(r.local?Jw:Zw)(r,t))}function ej(e,t){return function(){Ec(this,e).delay=+t.apply(this,arguments)}}function tj(e,t){return t=+t,function(){Ec(this,e).delay=t}}function nj(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ej:tj)(t,e)):Et(this.node(),t).delay}function rj(e,t){return function(){qt(this,e).duration=+t.apply(this,arguments)}}function oj(e,t){return t=+t,function(){qt(this,e).duration=t}}function aj(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?rj:oj)(t,e)):Et(this.node(),t).duration}function sj(e,t){if(typeof t!="function")throw new Error;return function(){qt(this,e).ease=t}}function ij(e){var t=this._id;return arguments.length?this.each(sj(t,e)):Et(this.node(),t).ease}function cj(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;qt(this,e).ease=n}}function lj(e){if(typeof e!="function")throw new Error;return this.each(cj(this._id,e))}function dj(e){typeof e!="function"&&(e=Rf(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var a=t[o],s=a.length,i=r[o]=[],c,l=0;l<s;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&i.push(c);return new sn(r,this._parents,this._name,this._id)}function uj(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,a=Math.min(r,o),s=new Array(r),i=0;i<a;++i)for(var c=t[i],l=n[i],u=c.length,f=s[i]=new Array(u),h,p=0;p<u;++p)(h=c[p]||l[p])&&(f[p]=h);for(;i<r;++i)s[i]=t[i];return new sn(s,this._parents,this._name,this._id)}function fj(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function hj(e,t,n){var r,o,a=fj(t)?Ec:qt;return function(){var s=a(this,e),i=s.on;i!==r&&(o=(r=i).copy()).on(t,n),s.on=o}}function pj(e,t){var n=this._id;return arguments.length<2?Et(this.node(),n).on.on(e):this.each(hj(n,e,t))}function mj(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function gj(){return this.on("end.remove",mj(this._id))}function yj(e){var t=this._name,n=this._id;typeof e!="function"&&(e=jc(e));for(var r=this._groups,o=r.length,a=new Array(o),s=0;s<o;++s)for(var i=r[s],c=i.length,l=a[s]=new Array(c),u,f,h=0;h<c;++h)(u=i[h])&&(f=e.call(u,u.__data__,h,i))&&("__data__"in u&&(f.__data__=u.__data__),l[h]=f,ss(l[h],t,n,h,l,Et(u,n)));return new sn(a,this._parents,t,n)}function xj(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Of(e));for(var r=this._groups,o=r.length,a=[],s=[],i=0;i<o;++i)for(var c=r[i],l=c.length,u,f=0;f<l;++f)if(u=c[f]){for(var h=e.call(u,u.__data__,f,c),p,m=Et(u,n),g=0,y=h.length;g<y;++g)(p=h[g])&&ss(p,t,n,g,h,m);a.push(h),s.push(u)}return new sn(a,s,t,n)}var vj=Ao.prototype.constructor;function bj(){return new vj(this._groups,this._parents)}function wj(e,t){var n,r,o;return function(){var a=vr(this,e),s=(this.style.removeProperty(e),vr(this,e));return a===s?null:a===n&&s===r?o:o=t(n=a,r=s)}}function rh(e){return function(){this.style.removeProperty(e)}}function jj(e,t,n){var r,o=n+"",a;return function(){var s=vr(this,e);return s===o?null:s===r?a:a=t(r=s,n)}}function _j(e,t,n){var r,o,a;return function(){var s=vr(this,e),i=n(this),c=i+"";return i==null&&(c=i=(this.style.removeProperty(e),vr(this,e))),s===c?null:s===r&&c===o?a:(o=c,a=t(r=s,i))}}function Sj(e,t){var n,r,o,a="style."+t,s="end."+a,i;return function(){var c=qt(this,e),l=c.on,u=c.value[a]==null?i||(i=rh(t)):void 0;(l!==n||o!==u)&&(r=(n=l).copy()).on(s,o=u),c.on=r}}function Cj(e,t,n){var r=(e+="")=="transform"?Nw:nh;return t==null?this.styleTween(e,wj(e,r)).on("end.style."+e,rh(e)):typeof t=="function"?this.styleTween(e,_j(e,r,kc(this,"style."+e,t))).each(Sj(this._id,e)):this.styleTween(e,jj(e,r,t),n).on("end.style."+e,null)}function Nj(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Ej(e,t,n){var r,o;function a(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&Nj(e,s,n)),r}return a._value=t,a}function kj(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Ej(e,t,n??""))}function Pj(e){return function(){this.textContent=e}}function Mj(e){return function(){var t=e(this);this.textContent=t??""}}function Dj(e){return this.tween("text",typeof e=="function"?Mj(kc(this,"text",e)):Pj(e==null?"":e+""))}function Oj(e){return function(t){this.textContent=e.call(this,t)}}function Rj(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&Oj(o)),t}return r._value=e,r}function Aj(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Rj(e))}function Tj(){for(var e=this._name,t=this._id,n=oh(),r=this._groups,o=r.length,a=0;a<o;++a)for(var s=r[a],i=s.length,c,l=0;l<i;++l)if(c=s[l]){var u=Et(c,t);ss(c,e,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new sn(r,this._parents,e,n)}function Ij(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(a,s){var i={value:s},c={value:function(){--o===0&&a()}};n.each(function(){var l=qt(this,r),u=l.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(i),t._.interrupt.push(i),t._.end.push(c)),l.on=t}),o===0&&a()})}var $j=0;function sn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function oh(){return++$j}var Zt=Ao.prototype;sn.prototype={constructor:sn,select:yj,selectAll:xj,selectChild:Zt.selectChild,selectChildren:Zt.selectChildren,filter:dj,merge:uj,selection:bj,transition:Tj,call:Zt.call,nodes:Zt.nodes,node:Zt.node,size:Zt.size,empty:Zt.empty,each:Zt.each,on:pj,attr:Uw,attrTween:Qw,style:Cj,styleTween:kj,text:Dj,textTween:Aj,remove:gj,tween:Fw,delay:nj,duration:aj,ease:ij,easeVarying:lj,end:Ij,[Symbol.iterator]:Zt[Symbol.iterator]};function zj(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Lj={time:null,delay:0,duration:250,ease:zj};function Wj(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Fj(e){var t,n;e instanceof sn?(t=e._id,e=e._name):(t=oh(),(n=Lj).time=Nc(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,a=0;a<o;++a)for(var s=r[a],i=s.length,c,l=0;l<i;++l)(c=s[l])&&ss(c,e,t,l,s,n||Wj(c,t));return new sn(r,this._parents,e,t)}Ao.prototype.interrupt=zw;Ao.prototype.transition=Fj;const oa=e=>()=>e;function Bj(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function tn(e,t,n){this.k=e,this.x=t,this.y=n}tn.prototype={constructor:tn,scale:function(e){return e===1?this:new tn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new tn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var is=new tn(1,0,0);ah.prototype=tn.prototype;function ah(e){for(;!e.__zoom;)if(!(e=e.parentNode))return is;return e.__zoom}function ei(e){e.stopImmediatePropagation()}function qr(e){e.preventDefault(),e.stopImmediatePropagation()}function Hj(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Vj(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function bd(){return this.__zoom||is}function Yj(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function qj(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gj(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s))}function sh(){var e=Hj,t=Vj,n=Gj,r=Yj,o=qj,a=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],i=250,c=ba,l=rs("start","zoom","end"),u,f,h,p=500,m=150,g=0,y=10;function v(E){E.property("__zoom",bd).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",T).filter(o).on("touchstart.zoom",D).on("touchmove.zoom",M).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}v.transform=function(E,I,R,z){var A=E.selection?E.selection():E;A.property("__zoom",bd),E!==A?N(E,I,R,z):A.interrupt().each(function(){S(this,arguments).event(z).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},v.scaleBy=function(E,I,R,z){v.scaleTo(E,function(){var A=this.__zoom.k,O=typeof I=="function"?I.apply(this,arguments):I;return A*O},R,z)},v.scaleTo=function(E,I,R,z){v.transform(E,function(){var A=t.apply(this,arguments),O=this.__zoom,F=R==null?j(A):typeof R=="function"?R.apply(this,arguments):R,G=O.invert(F),Y=typeof I=="function"?I.apply(this,arguments):I;return n(x(w(O,Y),F,G),A,s)},R,z)},v.translateBy=function(E,I,R,z){v.transform(E,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof R=="function"?R.apply(this,arguments):R),t.apply(this,arguments),s)},null,z)},v.translateTo=function(E,I,R,z,A){v.transform(E,function(){var O=t.apply(this,arguments),F=this.__zoom,G=z==null?j(O):typeof z=="function"?z.apply(this,arguments):z;return n(is.translate(G[0],G[1]).scale(F.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof R=="function"?-R.apply(this,arguments):-R),O,s)},z,A)};function w(E,I){return I=Math.max(a[0],Math.min(a[1],I)),I===E.k?E:new tn(I,E.x,E.y)}function x(E,I,R){var z=I[0]-R[0]*E.k,A=I[1]-R[1]*E.k;return z===E.x&&A===E.y?E:new tn(E.k,z,A)}function j(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function N(E,I,R,z){E.on("start.zoom",function(){S(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(z).end()}).tween("zoom",function(){var A=this,O=arguments,F=S(A,O).event(z),G=t.apply(A,O),Y=R==null?j(G):typeof R=="function"?R.apply(A,O):R,H=Math.max(G[1][0]-G[0][0],G[1][1]-G[0][1]),V=A.__zoom,B=typeof I=="function"?I.apply(A,O):I,q=c(V.invert(Y).concat(H/V.k),B.invert(Y).concat(H/B.k));return function($){if($===1)$=B;else{var W=q($),U=H/W[2];$=new tn(U,Y[0]-W[0]*U,Y[1]-W[1]*U)}F.zoom(null,$)}})}function S(E,I,R){return!R&&E.__zooming||new C(E,I)}function C(E,I){this.that=E,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,I),this.taps=0}C.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,I){return this.mouse&&E!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var I=ot(this.that).datum();l.call(E,this.that,new Bj(E,{sourceEvent:this.sourceEvent,target:v,transform:this.that.__zoom,dispatch:l}),I)}};function P(E,...I){if(!e.apply(this,arguments))return;var R=S(this,I).event(E),z=this.__zoom,A=Math.max(a[0],Math.min(a[1],z.k*Math.pow(2,r.apply(this,arguments)))),O=gt(E);if(R.wheel)(R.mouse[0][0]!==O[0]||R.mouse[0][1]!==O[1])&&(R.mouse[1]=z.invert(R.mouse[0]=O)),clearTimeout(R.wheel);else{if(z.k===A)return;R.mouse=[O,z.invert(O)],_a(this),R.start()}qr(E),R.wheel=setTimeout(F,m),R.zoom("mouse",n(x(w(z,A),R.mouse[0],R.mouse[1]),R.extent,s));function F(){R.wheel=null,R.end()}}function k(E,...I){if(h||!e.apply(this,arguments))return;var R=E.currentTarget,z=S(this,I,!0).event(E),A=ot(E.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",H,!0),O=gt(E,R),F=E.clientX,G=E.clientY;Hf(E.view),ei(E),z.mouse=[O,this.__zoom.invert(O)],_a(this),z.start();function Y(V){if(qr(V),!z.moved){var B=V.clientX-F,q=V.clientY-G;z.moved=B*B+q*q>g}z.event(V).zoom("mouse",n(x(z.that.__zoom,z.mouse[0]=gt(V,R),z.mouse[1]),z.extent,s))}function H(V){A.on("mousemove.zoom mouseup.zoom",null),Vf(V.view,z.moved),qr(V),z.event(V).end()}}function T(E,...I){if(e.apply(this,arguments)){var R=this.__zoom,z=gt(E.changedTouches?E.changedTouches[0]:E,this),A=R.invert(z),O=R.k*(E.shiftKey?.5:2),F=n(x(w(R,O),z,A),t.apply(this,I),s);qr(E),i>0?ot(this).transition().duration(i).call(N,F,z,E):ot(this).call(v.transform,F,z,E)}}function D(E,...I){if(e.apply(this,arguments)){var R=E.touches,z=R.length,A=S(this,I,E.changedTouches.length===z).event(E),O,F,G,Y;for(ei(E),F=0;F<z;++F)G=R[F],Y=gt(G,this),Y=[Y,this.__zoom.invert(Y),G.identifier],A.touch0?!A.touch1&&A.touch0[2]!==Y[2]&&(A.touch1=Y,A.taps=0):(A.touch0=Y,O=!0,A.taps=1+!!u);u&&(u=clearTimeout(u)),O&&(A.taps<2&&(f=Y[0],u=setTimeout(function(){u=null},p)),_a(this),A.start())}}function M(E,...I){if(this.__zooming){var R=S(this,I).event(E),z=E.changedTouches,A=z.length,O,F,G,Y;for(qr(E),O=0;O<A;++O)F=z[O],G=gt(F,this),R.touch0&&R.touch0[2]===F.identifier?R.touch0[0]=G:R.touch1&&R.touch1[2]===F.identifier&&(R.touch1[0]=G);if(F=R.that.__zoom,R.touch1){var H=R.touch0[0],V=R.touch0[1],B=R.touch1[0],q=R.touch1[1],$=($=B[0]-H[0])*$+($=B[1]-H[1])*$,W=(W=q[0]-V[0])*W+(W=q[1]-V[1])*W;F=w(F,Math.sqrt($/W)),G=[(H[0]+B[0])/2,(H[1]+B[1])/2],Y=[(V[0]+q[0])/2,(V[1]+q[1])/2]}else if(R.touch0)G=R.touch0[0],Y=R.touch0[1];else return;R.zoom("touch",n(x(F,G,Y),R.extent,s))}}function L(E,...I){if(this.__zooming){var R=S(this,I).event(E),z=E.changedTouches,A=z.length,O,F;for(ei(E),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),O=0;O<A;++O)F=z[O],R.touch0&&R.touch0[2]===F.identifier?delete R.touch0:R.touch1&&R.touch1[2]===F.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(F=gt(F,this),Math.hypot(f[0]-F[0],f[1]-F[1])<y)){var G=ot(this).on("dblclick.zoom");G&&G.apply(this,arguments)}}}return v.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:oa(+E),v):r},v.filter=function(E){return arguments.length?(e=typeof E=="function"?E:oa(!!E),v):e},v.touchable=function(E){return arguments.length?(o=typeof E=="function"?E:oa(!!E),v):o},v.extent=function(E){return arguments.length?(t=typeof E=="function"?E:oa([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),v):t},v.scaleExtent=function(E){return arguments.length?(a[0]=+E[0],a[1]=+E[1],v):[a[0],a[1]]},v.translateExtent=function(E){return arguments.length?(s[0][0]=+E[0][0],s[1][0]=+E[1][0],s[0][1]=+E[0][1],s[1][1]=+E[1][1],v):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},v.constrain=function(E){return arguments.length?(n=E,v):n},v.duration=function(E){return arguments.length?(i=+E,v):i},v.interpolate=function(E){return arguments.length?(c=E,v):c},v.on=function(){var E=l.on.apply(l,arguments);return E===l?v:E},v.clickDistance=function(E){return arguments.length?(g=(E=+E)*E,v):Math.sqrt(g)},v.tapDistance=function(E){return arguments.length?(y=+E,v):y},v}const it={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},xo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ih=["Enter"," ","Escape"],ch={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var wr;(function(e){e.Strict="strict",e.Loose="loose"})(wr||(wr={}));var $n;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})($n||($n={}));var vo;(function(e){e.Partial="partial",e.Full="full"})(vo||(vo={}));const lh={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var xn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(xn||(xn={}));var Ia;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ia||(Ia={}));var oe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(oe||(oe={}));const wd={[oe.Left]:oe.Right,[oe.Right]:oe.Left,[oe.Top]:oe.Bottom,[oe.Bottom]:oe.Top};function dh(e){return e===null?null:e?"valid":"invalid"}const uh=e=>"id"in e&&"source"in e&&"target"in e,Uj=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Pc=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Io=(e,t=[0,0])=>{const{width:n,height:r}=dn(e),o=e.origin??t,a=n*o[0],s=r*o[1];return{x:e.position.x-a,y:e.position.y-s}},Xj=(e,t={nodeOrigin:[0,0]})=>{if(process.env.NODE_ENV==="development"&&!t.nodeLookup&&console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."),e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const a=typeof o=="string";let s=!t.nodeLookup&&!a?o:void 0;t.nodeLookup&&(s=a?t.nodeLookup.get(o):Pc(o)?o:t.nodeLookup.get(o.id));const i=s?$a(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return cs(r,i)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ls(n)},$o=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=cs(n,$a(o)),r=!0)}),r?ls(n):{x:0,y:0,width:0,height:0}},Mc=(e,t,[n,r,o]=[0,0,1],a=!1,s=!1)=>{const i={...Lo(t,[n,r,o]),width:t.width/o,height:t.height/o},c=[];for(const l of e.values()){const{measured:u,selectable:f=!0,hidden:h=!1}=l;if(s&&!f||h)continue;const p=u.width??l.width??l.initialWidth??null,m=u.height??l.height??l.initialHeight??null,g=bo(i,_r(l)),y=(p??0)*(m??0),v=a&&g>0;(!l.internals.handleBounds||v||g>=y||l.dragging)&&c.push(l)}return c},Kj=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Jj(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function Zj({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:a},s){if(e.size===0)return Promise.resolve(!0);const i=Jj(e,s),c=$o(i),l=Dc(c,t,n,(s==null?void 0:s.minZoom)??o,(s==null?void 0:s.maxZoom)??a,(s==null?void 0:s.padding)??.1);return await r.setViewport(l,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function fh({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:a}){const s=n.get(e),i=s.parentId?n.get(s.parentId):void 0,{x:c,y:l}=i?i.internals.positionAbsolute:{x:0,y:0},u=s.origin??r;let f=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!i)a==null||a("005",it.error005());else{const p=i.measured.width,m=i.measured.height;p&&m&&(f=[[c,l],[c+p,l+m]])}else i&&Sr(s.extent)&&(f=[[s.extent[0][0]+c,s.extent[0][1]+l],[s.extent[1][0]+c,s.extent[1][1]+l]]);const h=Sr(f)?Fn(t,f,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(a==null||a("015",it.error015())),{position:{x:h.x-c+(s.measured.width??0)*u[0],y:h.y-l+(s.measured.height??0)*u[1]},positionAbsolute:h}}async function Qj({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const a=new Set(e.map(h=>h.id)),s=[];for(const h of n){if(h.deletable===!1)continue;const p=a.has(h.id),m=!p&&h.parentId&&s.find(g=>g.id===h.parentId);(p||m)&&s.push(h)}const i=new Set(t.map(h=>h.id)),c=r.filter(h=>h.deletable!==!1),u=Kj(s,c);for(const h of c)i.has(h.id)&&!u.find(m=>m.id===h.id)&&u.push(h);if(!o)return{edges:u,nodes:s};const f=await o({nodes:s,edges:u});return typeof f=="boolean"?f?{edges:u,nodes:s}:{edges:[],nodes:[]}:f}const jr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Fn=(e={x:0,y:0},t,n)=>({x:jr(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:jr(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function hh(e,t,n){const{width:r,height:o}=dn(n),{x:a,y:s}=n.internals.positionAbsolute;return Fn(e,[[a,s],[a+r,s+o]],t)}const jd=(e,t,n)=>e<t?jr(Math.abs(e-t),1,t)/t:e>n?-jr(Math.abs(e-n),1,t)/t:0,ph=(e,t,n=15,r=40)=>{const o=jd(e.x,r,t.width-r)*n,a=jd(e.y,r,t.height-r)*n;return[o,a]},cs=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Vi=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),ls=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),_r=(e,t=[0,0])=>{var o,a;const{x:n,y:r}=Pc(e)?e.internals.positionAbsolute:Io(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},$a=(e,t=[0,0])=>{var o,a;const{x:n,y:r}=Pc(e)?e.internals.positionAbsolute:Io(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},mh=(e,t)=>ls(cs(Vi(e),Vi(t))),bo=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},_d=e=>vt(e.width)&&vt(e.height)&&vt(e.x)&&vt(e.y),vt=e=>!isNaN(e)&&isFinite(e),gh=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},zo=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Lo=({x:e,y:t},[n,r,o],a=!1,s=[1,1])=>{const i={x:(e-n)/o,y:(t-r)/o};return a?zo(i,s):i},za=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function er(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function e_(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=er(e,n),o=er(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=er(e.top??e.y??0,n),o=er(e.bottom??e.y??0,n),a=er(e.left??e.x??0,t),s=er(e.right??e.x??0,t);return{top:r,right:s,bottom:o,left:a,x:a+s,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function t_(e,t,n,r,o,a){const{x:s,y:i}=za(e,[t,n,r]),{x:c,y:l}=za({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=o-c,f=a-l;return{left:Math.floor(s),top:Math.floor(i),right:Math.floor(u),bottom:Math.floor(f)}}const Dc=(e,t,n,r,o,a)=>{const s=e_(a,t,n),i=(t-s.x)/e.width,c=(n-s.y)/e.height,l=Math.min(i,c),u=jr(l,r,o),f=e.x+e.width/2,h=e.y+e.height/2,p=t/2-f*u,m=n/2-h*u,g=t_(e,p,m,u,t,n),y={left:Math.min(g.left-s.left,0),top:Math.min(g.top-s.top,0),right:Math.min(g.right-s.right,0),bottom:Math.min(g.bottom-s.bottom,0)};return{x:p-y.left+y.right,y:m-y.top+y.bottom,zoom:u}},wo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Sr(e){return e!=null&&e!=="parent"}function dn(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function yh(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function xh(e,t={width:0,height:0},n,r,o){const a={...e},s=r.get(n);if(s){const i=s.origin||o;a.x+=s.internals.positionAbsolute.x-(t.width??0)*i[0],a.y+=s.internals.positionAbsolute.y-(t.height??0)*i[1]}return a}function Sd(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function n_(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function r_(e){return{...ch,...e||{}}}function fo(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:a,y:s}=bt(e),i=Lo({x:a-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:c,y:l}=n?zo(i,t):i;return{xSnapped:c,ySnapped:l,...i}}const Oc=e=>({width:e.offsetWidth,height:e.offsetHeight}),vh=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},o_=["INPUT","SELECT","TEXTAREA"];function bh(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:o_.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const wh=e=>"clientX"in e,bt=(e,t)=>{var a,s;const n=wh(e),r=n?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},Cd=(e,t,n,r,o)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(s=>{const i=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(i.left-n.left)/r,y:(i.top-n.top)/r,...Oc(s)}})};function jh({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:a,targetControlX:s,targetControlY:i}){const c=e*.125+o*.375+s*.375+n*.125,l=t*.125+a*.375+i*.375+r*.125,u=Math.abs(c-e),f=Math.abs(l-t);return[c,l,u,f]}function aa(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Nd({pos:e,x1:t,y1:n,x2:r,y2:o,c:a}){switch(e){case oe.Left:return[t-aa(t-r,a),n];case oe.Right:return[t+aa(r-t,a),n];case oe.Top:return[t,n-aa(n-o,a)];case oe.Bottom:return[t,n+aa(o-n,a)]}}function Rc({sourceX:e,sourceY:t,sourcePosition:n=oe.Bottom,targetX:r,targetY:o,targetPosition:a=oe.Top,curvature:s=.25}){const[i,c]=Nd({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[l,u]=Nd({pos:a,x1:r,y1:o,x2:e,y2:t,c:s}),[f,h,p,m]=jh({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:i,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${i},${c} ${l},${u} ${r},${o}`,f,h,p,m]}function _h({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,a=n<e?n+o:n-o,s=Math.abs(r-t)/2,i=r<t?r+s:r-s;return[a,i,o,s]}function a_({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:a="basic"}){if(a==="manual")return r;const s=o&&n?r+1e3:r,i=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return s+i}function s_({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const a=cs($a(e),$a(t));a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1);const s={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return bo(s,ls(a))>0}const i_=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,c_=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Sh=(e,t,n={})=>{if(!e.source||!e.target)return gh("006",it.error006()),t;const r=n.getEdgeId||i_;let o;return uh(e)?o={...e}:o={...e,id:r(e)},c_(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function Ch({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,a,s,i]=_h({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,a,s,i]}const Ed={[oe.Left]:{x:-1,y:0},[oe.Right]:{x:1,y:0},[oe.Top]:{x:0,y:-1},[oe.Bottom]:{x:0,y:1}},l_=({source:e,sourcePosition:t=oe.Bottom,target:n})=>t===oe.Left||t===oe.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},kd=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function d_({source:e,sourcePosition:t=oe.Bottom,target:n,targetPosition:r=oe.Top,center:o,offset:a,stepPosition:s}){const i=Ed[t],c=Ed[r],l={x:e.x+i.x*a,y:e.y+i.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},f=l_({source:l,sourcePosition:t,target:u}),h=f.x!==0?"x":"y",p=f[h];let m=[],g,y;const v={x:0,y:0},w={x:0,y:0},[,,x,j]=_h({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[h]*c[h]===-1){h==="x"?(g=o.x??l.x+(u.x-l.x)*s,y=o.y??(l.y+u.y)/2):(g=o.x??(l.x+u.x)/2,y=o.y??l.y+(u.y-l.y)*s);const S=[{x:g,y:l.y},{x:g,y:u.y}],C=[{x:l.x,y},{x:u.x,y}];i[h]===p?m=h==="x"?S:C:m=h==="x"?C:S}else{const S=[{x:l.x,y:u.y}],C=[{x:u.x,y:l.y}];if(h==="x"?m=i.x===p?C:S:m=i.y===p?S:C,t===r){const M=Math.abs(e[h]-n[h]);if(M<=a){const L=Math.min(a-1,a-M);i[h]===p?v[h]=(l[h]>e[h]?-1:1)*L:w[h]=(u[h]>n[h]?-1:1)*L}}if(t!==r){const M=h==="x"?"y":"x",L=i[h]===c[M],E=l[M]>u[M],I=l[M]<u[M];(i[h]===1&&(!L&&E||L&&I)||i[h]!==1&&(!L&&I||L&&E))&&(m=h==="x"?S:C)}const P={x:l.x+v.x,y:l.y+v.y},k={x:u.x+w.x,y:u.y+w.y},T=Math.max(Math.abs(P.x-m[0].x),Math.abs(k.x-m[0].x)),D=Math.max(Math.abs(P.y-m[0].y),Math.abs(k.y-m[0].y));T>=D?(g=(P.x+k.x)/2,y=m[0].y):(g=m[0].x,y=(P.y+k.y)/2)}return[[e,{x:l.x+v.x,y:l.y+v.y},...m,{x:u.x+w.x,y:u.y+w.y},n],g,y,x,j]}function u_(e,t,n,r){const o=Math.min(kd(e,t)/2,kd(t,n)/2,r),{x:a,y:s}=t;if(e.x===a&&a===n.x||e.y===s&&s===n.y)return`L${a} ${s}`;if(e.y===s){const l=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${a+o*l},${s}Q ${a},${s} ${a},${s+o*u}`}const i=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${a},${s+o*c}Q ${a},${s} ${a+o*i},${s}`}function Yi({sourceX:e,sourceY:t,sourcePosition:n=oe.Bottom,targetX:r,targetY:o,targetPosition:a=oe.Top,borderRadius:s=5,centerX:i,centerY:c,offset:l=20,stepPosition:u=.5}){const[f,h,p,m,g]=d_({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:a,center:{x:i,y:c},offset:l,stepPosition:u});return[f.reduce((v,w,x)=>{let j="";return x>0&&x<f.length-1?j=u_(f[x-1],w,f[x+1],s):j=`${x===0?"M":"L"}${w.x} ${w.y}`,v+=j,v},""),h,p,m,g]}function Pd(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function f_(e){var f;const{sourceNode:t,targetNode:n}=e;if(!Pd(t)||!Pd(n))return null;const r=t.internals.handleBounds||Md(t.handles),o=n.internals.handleBounds||Md(n.handles),a=Dd((r==null?void 0:r.source)??[],e.sourceHandle),s=Dd(e.connectionMode===wr.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!a||!s)return(f=e.onError)==null||f.call(e,"008",it.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const i=(a==null?void 0:a.position)||oe.Bottom,c=(s==null?void 0:s.position)||oe.Top,l=Bn(t,a,i),u=Bn(n,s,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:i,targetPosition:c}}function Md(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Bn(e,t,n=oe.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,a=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:i}=t??dn(e);if(r)return{x:o+s/2,y:a+i/2};switch((t==null?void 0:t.position)??n){case oe.Top:return{x:o+s/2,y:a};case oe.Right:return{x:o+s,y:a+i/2};case oe.Bottom:return{x:o+s/2,y:a+i};case oe.Left:return{x:o,y:a+i/2}}}function Dd(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function qi(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function h_(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const a=new Set;return e.reduce((s,i)=>([i.markerStart||r,i.markerEnd||o].forEach(c=>{if(c&&typeof c=="object"){const l=qi(c,t);a.has(l)||(s.push({id:l,color:c.color||n,...c}),a.add(l))}}),s),[]).sort((s,i)=>s.id.localeCompare(i.id))}const Nh=1e3,p_=10,Ac={nodeOrigin:[0,0],nodeExtent:xo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},m_={...Ac,checkEquality:!0};function Tc(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function g_(e,t,n){const r=Tc(Ac,n);for(const o of e.values())if(o.parentId)$c(o,e,t,r);else{const a=Io(o,r.nodeOrigin),s=Sr(o.extent)?o.extent:r.nodeExtent,i=Fn(a,s,dn(o));o.internals.positionAbsolute=i}}function y_(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const a={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(a):o.type==="target"&&r.push(a)}return{source:n,target:r}}function Ic(e){return e==="manual"}function Gi(e,t,n,r={}){var l,u;const o=Tc(m_,r),a={i:0},s=new Map(t),i=o!=null&&o.elevateNodesOnSelect&&!Ic(o.zIndexMode)?Nh:0;let c=e.length>0;t.clear(),n.clear();for(const f of e){let h=s.get(f.id);if(o.checkEquality&&f===(h==null?void 0:h.internals.userNode))t.set(f.id,h);else{const p=Io(f,o.nodeOrigin),m=Sr(f.extent)?f.extent:o.nodeExtent,g=Fn(p,m,dn(f));h={...o.defaults,...f,measured:{width:(l=f.measured)==null?void 0:l.width,height:(u=f.measured)==null?void 0:u.height},internals:{positionAbsolute:g,handleBounds:y_(f,h),z:Eh(f,i,o.zIndexMode),userNode:f}},t.set(f.id,h)}(h.measured===void 0||h.measured.width===void 0||h.measured.height===void 0)&&!h.hidden&&(c=!1),f.parentId&&$c(h,t,n,r,a)}return c}function x_(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function $c(e,t,n,r,o){const{elevateNodesOnSelect:a,nodeOrigin:s,nodeExtent:i,zIndexMode:c}=Tc(Ac,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}x_(e,n),o&&!u.parentId&&u.internals.rootParentIndex===void 0&&c==="auto"&&(u.internals.rootParentIndex=++o.i,u.internals.z=u.internals.z+o.i*p_),o&&u.internals.rootParentIndex!==void 0&&(o.i=u.internals.rootParentIndex);const f=a&&!Ic(c)?Nh:0,{x:h,y:p,z:m}=v_(e,u,s,i,f,c),{positionAbsolute:g}=e.internals,y=h!==g.x||p!==g.y;(y||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:y?{x:h,y:p}:g,z:m}})}function Eh(e,t,n){const r=vt(e.zIndex)?e.zIndex:0;return Ic(n)?r:r+(e.selected?t:0)}function v_(e,t,n,r,o,a){const{x:s,y:i}=t.internals.positionAbsolute,c=dn(e),l=Io(e,n),u=Sr(e.extent)?Fn(l,e.extent,c):l;let f=Fn({x:s+u.x,y:i+u.y},r,c);e.extent==="parent"&&(f=hh(f,c,t));const h=Eh(e,o,a),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function zc(e,t,n,r=[0,0]){var s;const o=[],a=new Map;for(const i of e){const c=t.get(i.parentId);if(!c)continue;const l=((s=a.get(i.parentId))==null?void 0:s.expandedRect)??_r(c),u=mh(l,i.rect);a.set(i.parentId,{expandedRect:u,parent:c})}return a.size>0&&a.forEach(({expandedRect:i,parent:c},l)=>{var x;const u=c.internals.positionAbsolute,f=dn(c),h=c.origin??r,p=i.x<u.x?Math.round(Math.abs(u.x-i.x)):0,m=i.y<u.y?Math.round(Math.abs(u.y-i.y)):0,g=Math.max(f.width,Math.round(i.width)),y=Math.max(f.height,Math.round(i.height)),v=(g-f.width)*h[0],w=(y-f.height)*h[1];(p>0||m>0||v||w)&&(o.push({id:l,type:"position",position:{x:c.position.x-p+v,y:c.position.y-m+w}}),(x=n.get(l))==null||x.forEach(j=>{e.some(N=>N.id===j.id)||o.push({id:j.id,type:"position",position:{x:j.position.x+p,y:j.position.y+m}})})),(f.width<i.width||f.height<i.height||p||m)&&o.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:g+(p?h[0]*p-v:0),height:y+(m?h[1]*m-w:0)}})}),o}function b_(e,t,n,r,o,a,s){const i=r==null?void 0:r.querySelector(".xyflow__viewport");let c=!1;if(!i)return{changes:[],updatedInternals:c};const l=[],u=window.getComputedStyle(i),{m22:f}=new window.DOMMatrixReadOnly(u.transform),h=[];for(const p of e.values()){const m=t.get(p.id);if(!m)continue;if(m.hidden){t.set(m.id,{...m,internals:{...m.internals,handleBounds:void 0}}),c=!0;continue}const g=Oc(p.nodeElement),y=m.measured.width!==g.width||m.measured.height!==g.height;if(!!(g.width&&g.height&&(y||!m.internals.handleBounds||p.force))){const w=p.nodeElement.getBoundingClientRect(),x=Sr(m.extent)?m.extent:a;let{positionAbsolute:j}=m.internals;m.parentId&&m.extent==="parent"?j=hh(j,g,t.get(m.parentId)):x&&(j=Fn(j,x,g));const N={...m,measured:g,internals:{...m.internals,positionAbsolute:j,handleBounds:{source:Cd("source",p.nodeElement,w,f,m.id),target:Cd("target",p.nodeElement,w,f,m.id)}}};t.set(m.id,N),m.parentId&&$c(N,t,n,{nodeOrigin:o,zIndexMode:s}),c=!0,y&&(l.push({id:m.id,type:"dimensions",dimensions:g}),m.expandParent&&m.parentId&&h.push({id:m.id,parentId:m.parentId,rect:_r(N,o)}))}}if(h.length>0){const p=zc(h,t,n,o);l.push(...p)}return{changes:l,updatedInternals:c}}async function w_({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,a]],r),i=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(i)}function Od(e,t,n,r,o,a){let s=o;const i=r.get(s)||new Map;r.set(s,i.set(n,t)),s=`${o}-${e}`;const c=r.get(s)||new Map;if(r.set(s,c.set(n,t)),a){s=`${o}-${e}-${a}`;const l=r.get(s)||new Map;r.set(s,l.set(n,t))}}function kh(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:a,sourceHandle:s=null,targetHandle:i=null}=r,c={edgeId:r.id,source:o,target:a,sourceHandle:s,targetHandle:i},l=`${o}-${s}--${a}-${i}`,u=`${a}-${i}--${o}-${s}`;Od("source",c,u,e,o,s),Od("target",c,l,e,a,i),t.set(r.id,r)}}function Ph(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Ph(n,t):!1}function Rd(e,t,n){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function j_(e,t,n,r){const o=new Map;for(const[a,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!Ph(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const i=e.get(a);i&&o.set(a,{id:a,position:i.position||{x:0,y:0},distance:{x:n.x-i.internals.positionAbsolute.x,y:n.y-i.internals.positionAbsolute.y},extent:i.extent,parentId:i.parentId,origin:i.origin,expandParent:i.expandParent,internals:{positionAbsolute:i.internals.positionAbsolute||{x:0,y:0}},measured:{width:i.measured.width??0,height:i.measured.height??0}})}return o}function ti({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,i,c;const o=[];for(const[l,u]of t){const f=(s=n.get(l))==null?void 0:s.internals.userNode;f&&o.push({...f,position:u.position,dragging:r})}if(!e)return[o[0],o];const a=(i=n.get(e))==null?void 0:i.internals.userNode;return[a?{...a,position:((c=t.get(e))==null?void 0:c.position)||a.position,dragging:r}:o[0],o]}function __({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const a={x:n-o.distance.x,y:r-o.distance.y},s=zo(a,t);return{x:s.x-a.x,y:s.y-a.y}}function S_({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let a={x:null,y:null},s=0,i=new Map,c=!1,l={x:0,y:0},u=null,f=!1,h=null,p=!1,m=!1,g=null;function y({noDragClassName:w,handleSelector:x,domNode:j,isSelectable:N,nodeId:S,nodeClickDistance:C=0}){h=ot(j);function P({x:M,y:L}){const{nodeLookup:E,nodeExtent:I,snapGrid:R,snapToGrid:z,nodeOrigin:A,onNodeDrag:O,onSelectionDrag:F,onError:G,updateNodePositions:Y}=t();a={x:M,y:L};let H=!1;const V=i.size>1,B=V&&I?Vi($o(i)):null,q=V&&z?__({dragItems:i,snapGrid:R,x:M,y:L}):null;for(const[$,W]of i){if(!E.has($))continue;let U={x:M-W.distance.x,y:L-W.distance.y};z&&(U=q?{x:Math.round(U.x+q.x),y:Math.round(U.y+q.y)}:zo(U,R));let K=null;if(V&&I&&!W.extent&&B){const{positionAbsolute:Z}=W.internals,ee=Z.x-B.x+I[0][0],ce=Z.x+W.measured.width-B.x2+I[1][0],ne=Z.y-B.y+I[0][1],xe=Z.y+W.measured.height-B.y2+I[1][1];K=[[ee,ne],[ce,xe]]}const{position:X,positionAbsolute:J}=fh({nodeId:$,nextPosition:U,nodeLookup:E,nodeExtent:K||I,nodeOrigin:A,onError:G});H=H||W.position.x!==X.x||W.position.y!==X.y,W.position=X,W.internals.positionAbsolute=J}if(m=m||H,!!H&&(Y(i,!0),g&&(r||O||!S&&F))){const[$,W]=ti({nodeId:S,dragItems:i,nodeLookup:E});r==null||r(g,i,$,W),O==null||O(g,$,W),S||F==null||F(g,W)}}async function k(){if(!u)return;const{transform:M,panBy:L,autoPanSpeed:E,autoPanOnNodeDrag:I}=t();if(!I){c=!1,cancelAnimationFrame(s);return}const[R,z]=ph(l,u,E);(R!==0||z!==0)&&(a.x=(a.x??0)-R/M[2],a.y=(a.y??0)-z/M[2],await L({x:R,y:z})&&P(a)),s=requestAnimationFrame(k)}function T(M){var V;const{nodeLookup:L,multiSelectionActive:E,nodesDraggable:I,transform:R,snapGrid:z,snapToGrid:A,selectNodesOnDrag:O,onNodeDragStart:F,onSelectionDragStart:G,unselectNodesAndEdges:Y}=t();f=!0,(!O||!N)&&!E&&S&&((V=L.get(S))!=null&&V.selected||Y()),N&&O&&S&&(e==null||e(S));const H=fo(M.sourceEvent,{transform:R,snapGrid:z,snapToGrid:A,containerBounds:u});if(a=H,i=j_(L,I,H,S),i.size>0&&(n||F||!S&&G)){const[B,q]=ti({nodeId:S,dragItems:i,nodeLookup:L});n==null||n(M.sourceEvent,i,B,q),F==null||F(M.sourceEvent,B,q),S||G==null||G(M.sourceEvent,q)}}const D=Yf().clickDistance(C).on("start",M=>{const{domNode:L,nodeDragThreshold:E,transform:I,snapGrid:R,snapToGrid:z}=t();u=(L==null?void 0:L.getBoundingClientRect())||null,p=!1,m=!1,g=M.sourceEvent,E===0&&T(M),a=fo(M.sourceEvent,{transform:I,snapGrid:R,snapToGrid:z,containerBounds:u}),l=bt(M.sourceEvent,u)}).on("drag",M=>{const{autoPanOnNodeDrag:L,transform:E,snapGrid:I,snapToGrid:R,nodeDragThreshold:z,nodeLookup:A}=t(),O=fo(M.sourceEvent,{transform:E,snapGrid:I,snapToGrid:R,containerBounds:u});if(g=M.sourceEvent,(M.sourceEvent.type==="touchmove"&&M.sourceEvent.touches.length>1||S&&!A.has(S))&&(p=!0),!p){if(!c&&L&&f&&(c=!0,k()),!f){const F=bt(M.sourceEvent,u),G=F.x-l.x,Y=F.y-l.y;Math.sqrt(G*G+Y*Y)>z&&T(M)}(a.x!==O.xSnapped||a.y!==O.ySnapped)&&i&&f&&(l=bt(M.sourceEvent,u),P(O))}}).on("end",M=>{if(!(!f||p)&&(c=!1,f=!1,cancelAnimationFrame(s),i.size>0)){const{nodeLookup:L,updateNodePositions:E,onNodeDragStop:I,onSelectionDragStop:R}=t();if(m&&(E(i,!1),m=!1),o||I||!S&&R){const[z,A]=ti({nodeId:S,dragItems:i,nodeLookup:L,dragging:!1});o==null||o(M.sourceEvent,i,z,A),I==null||I(M.sourceEvent,z,A),S||R==null||R(M.sourceEvent,A)}}}).filter(M=>{const L=M.target;return!M.button&&(!w||!Rd(L,`.${w}`,j))&&(!x||Rd(L,x,j))});h.call(D)}function v(){h==null||h.on(".drag",null)}return{update:y,destroy:v}}function C_(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const a of t.values())bo(o,_r(a))>0&&r.push(a);return r}const N_=250;function E_(e,t,n,r){var i,c;let o=[],a=1/0;const s=C_(e,n,t+N_);for(const l of s){const u=[...((i=l.internals.handleBounds)==null?void 0:i.source)??[],...((c=l.internals.handleBounds)==null?void 0:c.target)??[]];for(const f of u){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:h,y:p}=Bn(l,f,f.position,!0),m=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(p-e.y,2));m>t||(m<a?(o=[{...f,x:h,y:p}],a=m):m===a&&o.push({...f,x:h,y:p}))}}if(!o.length)return null;if(o.length>1){const l=r.type==="source"?"target":"source";return o.find(u=>u.type===l)??o[0]}return o[0]}function Mh(e,t,n,r,o,a=!1){var l,u,f;const s=r.get(e);if(!s)return null;const i=o==="strict"?(l=s.internals.handleBounds)==null?void 0:l[t]:[...((u=s.internals.handleBounds)==null?void 0:u.source)??[],...((f=s.internals.handleBounds)==null?void 0:f.target)??[]],c=(n?i==null?void 0:i.find(h=>h.id===n):i==null?void 0:i[0])??null;return c&&a?{...c,...Bn(s,c,c.position,!0)}:c}function Dh(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function k_(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Oh=()=>!0;function P_(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:a,isTarget:s,domNode:i,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:g,onConnectEnd:y,isValidConnection:v=Oh,onReconnectEnd:w,updateConnection:x,getTransform:j,getFromHandle:N,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:P}){const k=vh(e.target);let T=0,D;const{x:M,y:L}=bt(e),E=Dh(a,P),I=i==null?void 0:i.getBoundingClientRect();let R=!1;if(!I||!E)return;const z=Mh(o,E,r,c,t);if(!z)return;let A=bt(e,I),O=!1,F=null,G=!1,Y=null;function H(){if(!u||!I)return;const[X,J]=ph(A,I,S);h({x:X,y:J}),T=requestAnimationFrame(H)}const V={...z,nodeId:o,type:E,position:z.position},B=c.get(o);let $={inProgress:!0,isValid:null,from:Bn(B,V,oe.Left,!0),fromHandle:V,fromPosition:V.position,fromNode:B,to:A,toHandle:null,toPosition:wd[V.position],toNode:null,pointer:A};function W(){R=!0,x($),m==null||m(e,{nodeId:o,handleId:r,handleType:E})}C===0&&W();function U(X){if(!R){const{x:xe,y:de}=bt(X),Me=xe-M,Fe=de-L;if(!(Me*Me+Fe*Fe>C*C))return;W()}if(!N()||!V){K(X);return}const J=j();A=bt(X,I),D=E_(Lo(A,J,!1,[1,1]),n,c,V),O||(H(),O=!0);const Z=Rh(X,{handle:D,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:v,doc:k,lib:l,flowId:f,nodeLookup:c});Y=Z.handleDomNode,F=Z.connection,G=k_(!!D,Z.isValid);const ee=c.get(o),ce=ee?Bn(ee,V,oe.Left,!0):$.from,ne={...$,from:ce,isValid:G,to:Z.toHandle&&G?za({x:Z.toHandle.x,y:Z.toHandle.y},J):A,toHandle:Z.toHandle,toPosition:G&&Z.toHandle?Z.toHandle.position:wd[V.position],toNode:Z.toHandle?c.get(Z.toHandle.nodeId):null,pointer:A};x(ne),$=ne}function K(X){if(!("touches"in X&&X.touches.length>0)){if(R){(D||Y)&&F&&G&&(g==null||g(F));const{inProgress:J,...Z}=$,ee={...Z,toPosition:$.toHandle?$.toPosition:null};y==null||y(X,ee),a&&(w==null||w(X,ee))}p(),cancelAnimationFrame(T),O=!1,G=!1,F=null,Y=null,k.removeEventListener("mousemove",U),k.removeEventListener("mouseup",K),k.removeEventListener("touchmove",U),k.removeEventListener("touchend",K)}}k.addEventListener("mousemove",U),k.addEventListener("mouseup",K),k.addEventListener("touchmove",U),k.addEventListener("touchend",K)}function Rh(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:a,doc:s,lib:i,flowId:c,isValidConnection:l=Oh,nodeLookup:u}){const f=a==="target",h=t?s.querySelector(`.${i}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y:m}=bt(e),g=s.elementFromPoint(p,m),y=g!=null&&g.classList.contains(`${i}-flow__handle`)?g:h,v={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const w=Dh(void 0,y),x=y.getAttribute("data-nodeid"),j=y.getAttribute("data-handleid"),N=y.classList.contains("connectable"),S=y.classList.contains("connectableend");if(!x||!w)return v;const C={source:f?x:r,sourceHandle:f?j:o,target:f?r:x,targetHandle:f?o:j};v.connection=C;const k=N&&S&&(n===wr.Strict?f&&w==="source"||!f&&w==="target":x!==r||j!==o);v.isValid=k&&l(C),v.toHandle=Mh(x,w,j,u,n,!0)}return v}const Ui={onPointerDown:P_,isValid:Rh};function M_({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=ot(e);function a({translateExtent:i,width:c,height:l,zoomStep:u=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){const m=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const j=n(),N=x.sourceEvent.ctrlKey&&wo()?10:1,S=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*u,C=j[2]*Math.pow(2,S*N);t.scaleTo(C)};let g=[0,0];const y=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(g=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},v=x=>{const j=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const N=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],S=[N[0]-g[0],N[1]-g[1]];g=N;const C=r()*Math.max(j[2],Math.log(j[2]))*(p?-1:1),P={x:j[0]-S[0]*C,y:j[1]-S[1]*C},k=[[0,0],[c,l]];t.setViewportConstrained({x:P.x,y:P.y,zoom:j[2]},k,i)},w=sh().on("start",y).on("zoom",f?v:null).on("zoom.wheel",h?m:null);o.call(w,{})}function s(){o.on("zoom",null)}return{update:a,destroy:s,pointer:gt}}const ds=e=>({x:e.x,y:e.y,zoom:e.k}),ni=({x:e,y:t,zoom:n})=>is.translate(e,t).scale(n),dr=(e,t)=>e.target.closest(`.${t}`),Ah=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),D_=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,ri=(e,t=0,n=D_,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},Th=e=>{const t=e.ctrlKey&&wo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function O_({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:a,zoomOnPinch:s,onPanZoomStart:i,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(dr(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(u.ctrlKey&&s){const y=gt(u),v=Th(u),w=f*Math.pow(2,v);r.scaleTo(n,w,y,u);return}const h=u.deltaMode===1?20:1;let p=o===$n.Vertical?0:u.deltaX*h,m=o===$n.Horizontal?0:u.deltaY*h;!wo()&&u.shiftKey&&o!==$n.Vertical&&(p=u.deltaY*h,m=0),r.translateBy(n,-(p/f)*a,-(m/f)*a,{internal:!0});const g=ds(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(u,g),e.panScrollTimeout=setTimeout(()=>{l==null||l(u,g),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,i==null||i(u,g))}}function R_({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const a=r.type==="wheel",s=!t&&a&&!r.ctrlKey,i=dr(r,e);if(r.ctrlKey&&a&&i&&r.preventDefault(),s||i)return null;r.preventDefault(),n.call(this,r,o)}}function A_({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var a,s,i;if((a=r.sourceEvent)!=null&&a.internal)return;const o=ds(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((i=r.sourceEvent)==null?void 0:i.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function T_({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return a=>{var s,i;e.usedRightMouseButton=!!(n&&Ah(t,e.mouseButton??0)),(s=a.sourceEvent)!=null&&s.sync||r([a.transform.x,a.transform.y,a.transform.k]),o&&!((i=a.sourceEvent)!=null&&i.internal)&&(o==null||o(a.sourceEvent,ds(a.transform)))}}function I_({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:a}){return s=>{var i;if(!((i=s.sourceEvent)!=null&&i.internal)&&(e.isZoomingOrPanning=!1,a&&Ah(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&a(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const c=ds(s.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,c)},n?150:0)}}}function $_({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:a,userSelectionActive:s,noWheelClassName:i,noPanClassName:c,lib:l,connectionInProgress:u}){return f=>{var y;const h=e||t,p=n&&f.ctrlKey,m=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(dr(f,`${l}-flow__node`)||dr(f,`${l}-flow__edge`)))return!0;if(!r&&!h&&!o&&!a&&!n||s||u&&!m||dr(f,i)&&m||dr(f,c)&&(!m||o&&m&&!e)||!n&&f.ctrlKey&&m)return!1;if(!n&&f.type==="touchstart"&&((y=f.touches)==null?void 0:y.length)>1)return f.preventDefault(),!1;if(!h&&!o&&!p&&m||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const g=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m)&&g}}function z_({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:a,onPanZoomStart:s,onPanZoomEnd:i,onDraggingChange:c}){const l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),f=sh().scaleExtent([t,n]).translateExtent(r),h=ot(e).call(f);w({x:o.x,y:o.y,zoom:jr(o.zoom,t,n)},[[0,0],[u.width,u.height]],r);const p=h.on("wheel.zoom"),m=h.on("dblclick.zoom");f.wheelDelta(Th);function g(D,M){return h?new Promise(L=>{f==null||f.interpolate((M==null?void 0:M.interpolate)==="linear"?uo:ba).transform(ri(h,M==null?void 0:M.duration,M==null?void 0:M.ease,()=>L(!0)),D)}):Promise.resolve(!1)}function y({noWheelClassName:D,noPanClassName:M,onPaneContextMenu:L,userSelectionActive:E,panOnScroll:I,panOnDrag:R,panOnScrollMode:z,panOnScrollSpeed:A,preventScrolling:O,zoomOnPinch:F,zoomOnScroll:G,zoomOnDoubleClick:Y,zoomActivationKeyPressed:H,lib:V,onTransformChange:B,connectionInProgress:q,paneClickDistance:$,selectionOnDrag:W}){E&&!l.isZoomingOrPanning&&v();const U=I&&!H&&!E;f.clickDistance(W?1/0:!vt($)||$<0?0:$);const K=U?O_({zoomPanValues:l,noWheelClassName:D,d3Selection:h,d3Zoom:f,panOnScrollMode:z,panOnScrollSpeed:A,zoomOnPinch:F,onPanZoomStart:s,onPanZoom:a,onPanZoomEnd:i}):R_({noWheelClassName:D,preventScrolling:O,d3ZoomHandler:p});if(h.on("wheel.zoom",K,{passive:!1}),!E){const J=A_({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:s});f.on("start",J);const Z=T_({zoomPanValues:l,panOnDrag:R,onPaneContextMenu:!!L,onPanZoom:a,onTransformChange:B});f.on("zoom",Z);const ee=I_({zoomPanValues:l,panOnDrag:R,panOnScroll:I,onPaneContextMenu:L,onPanZoomEnd:i,onDraggingChange:c});f.on("end",ee)}const X=$_({zoomActivationKeyPressed:H,panOnDrag:R,zoomOnScroll:G,panOnScroll:I,zoomOnDoubleClick:Y,zoomOnPinch:F,userSelectionActive:E,noPanClassName:M,noWheelClassName:D,lib:V,connectionInProgress:q});f.filter(X),Y?h.on("dblclick.zoom",m):h.on("dblclick.zoom",null)}function v(){f.on("zoom",null)}async function w(D,M,L){const E=ni(D),I=f==null?void 0:f.constrain()(E,M,L);return I&&await g(I),new Promise(R=>R(I))}async function x(D,M){const L=ni(D);return await g(L,M),new Promise(E=>E(L))}function j(D){if(h){const M=ni(D),L=h.property("__zoom");(L.k!==D.zoom||L.x!==D.x||L.y!==D.y)&&(f==null||f.transform(h,M,null,{sync:!0}))}}function N(){const D=h?ah(h.node()):{x:0,y:0,k:1};return{x:D.x,y:D.y,zoom:D.k}}function S(D,M){return h?new Promise(L=>{f==null||f.interpolate((M==null?void 0:M.interpolate)==="linear"?uo:ba).scaleTo(ri(h,M==null?void 0:M.duration,M==null?void 0:M.ease,()=>L(!0)),D)}):Promise.resolve(!1)}function C(D,M){return h?new Promise(L=>{f==null||f.interpolate((M==null?void 0:M.interpolate)==="linear"?uo:ba).scaleBy(ri(h,M==null?void 0:M.duration,M==null?void 0:M.ease,()=>L(!0)),D)}):Promise.resolve(!1)}function P(D){f==null||f.scaleExtent(D)}function k(D){f==null||f.translateExtent(D)}function T(D){const M=!vt(D)||D<0?0:D;f==null||f.clickDistance(M)}return{update:y,destroy:v,setViewport:x,setViewportConstrained:w,getViewport:N,scaleTo:S,scaleBy:C,setScaleExtent:P,setTranslateExtent:k,syncViewport:j,setClickDistance:T}}var Cr;(function(e){e.Line="line",e.Handle="handle"})(Cr||(Cr={}));function L_({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:a}){const s=e-t,i=n-r,c=[s>0?1:s<0?-1:0,i>0?1:i<0?-1:0];return s&&o&&(c[0]=c[0]*-1),i&&a&&(c[1]=c[1]*-1),c}function Ad(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:o}}function un(e,t){return Math.max(0,t-e)}function fn(e,t){return Math.max(0,e-t)}function sa(e,t,n){return Math.max(0,t-e,e-n)}function Td(e,t){return e?!t:t}function W_(e,t,n,r,o,a,s,i){let{affectsX:c,affectsY:l}=t;const{isHorizontal:u,isVertical:f}=t,h=u&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:g,maxWidth:y,minHeight:v,maxHeight:w}=r,{x,y:j,width:N,height:S,aspectRatio:C}=e;let P=Math.floor(u?p-e.pointerX:0),k=Math.floor(f?m-e.pointerY:0);const T=N+(c?-P:P),D=S+(l?-k:k),M=-a[0]*N,L=-a[1]*S;let E=sa(T,g,y),I=sa(D,v,w);if(s){let A=0,O=0;c&&P<0?A=un(x+P+M,s[0][0]):!c&&P>0&&(A=fn(x+T+M,s[1][0])),l&&k<0?O=un(j+k+L,s[0][1]):!l&&k>0&&(O=fn(j+D+L,s[1][1])),E=Math.max(E,A),I=Math.max(I,O)}if(i){let A=0,O=0;c&&P>0?A=fn(x+P,i[0][0]):!c&&P<0&&(A=un(x+T,i[1][0])),l&&k>0?O=fn(j+k,i[0][1]):!l&&k<0&&(O=un(j+D,i[1][1])),E=Math.max(E,A),I=Math.max(I,O)}if(o){if(u){const A=sa(T/C,v,w)*C;if(E=Math.max(E,A),s){let O=0;!c&&!l||c&&!l&&h?O=fn(j+L+T/C,s[1][1])*C:O=un(j+L+(c?P:-P)/C,s[0][1])*C,E=Math.max(E,O)}if(i){let O=0;!c&&!l||c&&!l&&h?O=un(j+T/C,i[1][1])*C:O=fn(j+(c?P:-P)/C,i[0][1])*C,E=Math.max(E,O)}}if(f){const A=sa(D*C,g,y)/C;if(I=Math.max(I,A),s){let O=0;!c&&!l||l&&!c&&h?O=fn(x+D*C+M,s[1][0])/C:O=un(x+(l?k:-k)*C+M,s[0][0])/C,I=Math.max(I,O)}if(i){let O=0;!c&&!l||l&&!c&&h?O=un(x+D*C,i[1][0])/C:O=fn(x+(l?k:-k)*C,i[0][0])/C,I=Math.max(I,O)}}}k=k+(k<0?I:-I),P=P+(P<0?E:-E),o&&(h?T>D*C?k=(Td(c,l)?-P:P)/C:P=(Td(c,l)?-k:k)*C:u?(k=P/C,l=c):(P=k*C,c=l));const R=c?x+P:x,z=l?j+k:j;return{width:N+(c?-P:P),height:S+(l?-k:k),x:a[0]*P*(c?-1:1)+R,y:a[1]*k*(l?-1:1)+z}}const Ih={width:0,height:0,x:0,y:0},F_={...Ih,pointerX:0,pointerY:0,aspectRatio:1};function B_(e){return[[0,0],[e.measured.width,e.measured.height]]}function H_(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,a=e.measured.width??0,s=e.measured.height??0,i=n[0]*a,c=n[1]*s;return[[r-i,o-c],[r+a-i,o+s-c]]}function V_({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const a=ot(e);let s={controlDirection:Ad("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function i({controlPosition:l,boundaries:u,keepAspectRatio:f,resizeDirection:h,onResizeStart:p,onResize:m,onResizeEnd:g,shouldResize:y}){let v={...Ih},w={...F_};s={boundaries:u,resizeDirection:h,keepAspectRatio:f,controlDirection:Ad(l)};let x,j=null,N=[],S,C,P,k=!1;const T=Yf().on("start",D=>{const{nodeLookup:M,transform:L,snapGrid:E,snapToGrid:I,nodeOrigin:R,paneDomNode:z}=n();if(x=M.get(t),!x)return;j=(z==null?void 0:z.getBoundingClientRect())??null;const{xSnapped:A,ySnapped:O}=fo(D.sourceEvent,{transform:L,snapGrid:E,snapToGrid:I,containerBounds:j});v={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},w={...v,pointerX:A,pointerY:O,aspectRatio:v.width/v.height},S=void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(S=M.get(x.parentId),C=S&&x.extent==="parent"?B_(S):void 0),N=[],P=void 0;for(const[F,G]of M)if(G.parentId===t&&(N.push({id:F,position:{...G.position},extent:G.extent}),G.extent==="parent"||G.expandParent)){const Y=H_(G,x,G.origin??R);P?P=[[Math.min(Y[0][0],P[0][0]),Math.min(Y[0][1],P[0][1])],[Math.max(Y[1][0],P[1][0]),Math.max(Y[1][1],P[1][1])]]:P=Y}p==null||p(D,{...v})}).on("drag",D=>{const{transform:M,snapGrid:L,snapToGrid:E,nodeOrigin:I}=n(),R=fo(D.sourceEvent,{transform:M,snapGrid:L,snapToGrid:E,containerBounds:j}),z=[];if(!x)return;const{x:A,y:O,width:F,height:G}=v,Y={},H=x.origin??I,{width:V,height:B,x:q,y:$}=W_(w,s.controlDirection,R,s.boundaries,s.keepAspectRatio,H,C,P),W=V!==F,U=B!==G,K=q!==A&&W,X=$!==O&&U;if(!K&&!X&&!W&&!U)return;if((K||X||H[0]===1||H[1]===1)&&(Y.x=K?q:v.x,Y.y=X?$:v.y,v.x=Y.x,v.y=Y.y,N.length>0)){const ce=q-A,ne=$-O;for(const xe of N)xe.position={x:xe.position.x-ce+H[0]*(V-F),y:xe.position.y-ne+H[1]*(B-G)},z.push(xe)}if((W||U)&&(Y.width=W&&(!s.resizeDirection||s.resizeDirection==="horizontal")?V:v.width,Y.height=U&&(!s.resizeDirection||s.resizeDirection==="vertical")?B:v.height,v.width=Y.width,v.height=Y.height),S&&x.expandParent){const ce=H[0]*(Y.width??0);Y.x&&Y.x<ce&&(v.x=ce,w.x=w.x-(Y.x-ce));const ne=H[1]*(Y.height??0);Y.y&&Y.y<ne&&(v.y=ne,w.y=w.y-(Y.y-ne))}const J=L_({width:v.width,prevWidth:F,height:v.height,prevHeight:G,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),Z={...v,direction:J};(y==null?void 0:y(D,Z))!==!1&&(k=!0,m==null||m(D,Z),r(Y,z))}).on("end",D=>{k&&(g==null||g(D,{...v}),o==null||o({...v}),k=!1)});a.call(T)}function c(){a.on(".drag",null)}return{update:i,destroy:c}}var Y_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xi={exports:{}},oi={},ia={exports:{}},ai={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* use-sync-external-store-shim.production.js
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var
|
|
10
|
+
*/var Id;function q_(){if(Id)return ai;Id=1;var e=_;function t(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,a=e.useLayoutEffect,s=e.useDebugValue;function i(f,h){var p=h(),m=r({inst:{value:p,getSnapshot:h}}),g=m[0].inst,y=m[1];return a(function(){g.value=p,g.getSnapshot=h,c(g)&&y({inst:g})},[f,p,h]),o(function(){return c(g)&&y({inst:g}),f(function(){c(g)&&y({inst:g})})},[f]),s(p),p}function c(f){var h=f.getSnapshot;f=f.value;try{var p=h();return!n(f,p)}catch{return!0}}function l(f,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:i;return ai.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,ai}var si={};/**
|
|
11
11
|
* @license React
|
|
12
12
|
* use-sync-external-store-shim.development.js
|
|
13
13
|
*
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var
|
|
18
|
+
*/var $d;function G_(){return $d||($d=1,process.env.NODE_ENV!=="production"&&function(){function e(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}function t(p,m){u||o.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=m();if(!f){var y=m();a(g,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}y=s({inst:{value:g,getSnapshot:m}});var v=y[0].inst,w=y[1];return c(function(){v.value=g,v.getSnapshot=m,n(v)&&w({inst:v})},[p,g,m]),i(function(){return n(v)&&w({inst:v}),p(function(){n(v)&&w({inst:v})})},[p]),l(g),g}function n(p){var m=p.getSnapshot;p=p.value;try{var g=m();return!a(p,g)}catch{return!0}}function r(p,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=_,a=typeof Object.is=="function"?Object.is:e,s=o.useState,i=o.useEffect,c=o.useLayoutEffect,l=o.useDebugValue,u=!1,f=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;si.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),si}var zd;function zh(){return zd||(zd=1,process.env.NODE_ENV==="production"?ia.exports=q_():ia.exports=G_()),ia.exports}/**
|
|
19
19
|
* @license React
|
|
20
20
|
* use-sync-external-store-shim/with-selector.production.js
|
|
21
21
|
*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the MIT license found in the
|
|
25
25
|
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var
|
|
26
|
+
*/var Ld;function U_(){if(Ld)return oi;Ld=1;var e=_,t=zh();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,a=e.useRef,s=e.useEffect,i=e.useMemo,c=e.useDebugValue;return oi.useSyncExternalStoreWithSelector=function(l,u,f,h,p){var m=a(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=i(function(){function v(S){if(!w){if(w=!0,x=S,S=h(S),p!==void 0&&g.hasValue){var C=g.value;if(p(C,S))return j=C}return j=S}if(C=j,r(x,S))return C;var P=h(S);return p!==void 0&&p(C,P)?(x=S,C):(x=S,j=P)}var w=!1,x,j,N=f===void 0?null:f;return[function(){return v(u())},N===null?void 0:function(){return v(N())}]},[u,f,h,p]);var y=o(l,m[0],m[1]);return s(function(){g.hasValue=!0,g.value=y},[y]),c(y),y},oi}var ii={};/**
|
|
27
27
|
* @license React
|
|
28
28
|
* use-sync-external-store-shim/with-selector.development.js
|
|
29
29
|
*
|
|
@@ -31,224 +31,237 @@
|
|
|
31
31
|
*
|
|
32
32
|
* This source code is licensed under the MIT license found in the
|
|
33
33
|
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var
|
|
34
|
+
*/var Wd;function X_(){return Wd||(Wd=1,process.env.NODE_ENV!=="production"&&function(){function e(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=_,n=zh(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,a=t.useRef,s=t.useEffect,i=t.useMemo,c=t.useDebugValue;ii.useSyncExternalStoreWithSelector=function(l,u,f,h,p){var m=a(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=i(function(){function v(S){if(!w){if(w=!0,x=S,S=h(S),p!==void 0&&g.hasValue){var C=g.value;if(p(C,S))return j=C}return j=S}if(C=j,r(x,S))return C;var P=h(S);return p!==void 0&&p(C,P)?(x=S,C):(x=S,j=P)}var w=!1,x,j,N=f===void 0?null:f;return[function(){return v(u())},N===null?void 0:function(){return v(N())}]},[u,f,h,p]);var y=o(l,m[0],m[1]);return s(function(){g.hasValue=!0,g.value=y},[y]),c(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ii}process.env.NODE_ENV==="production"?Xi.exports=U_():Xi.exports=X_();var K_=Xi.exports;const J_=$h(K_),Z_={},Fd=e=>{let t;const n=new Set,r=(u,f)=>{const h=typeof u=="function"?u(t):u;if(!Object.is(h,t)){const p=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(m=>m(t,p))}},o=()=>t,c={setState:r,getState:o,getInitialState:()=>l,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(Z_?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},l=t=e(r,o,c);return c},Q_=e=>e?Fd(e):Fd,{useDebugValue:e1}=_,{useSyncExternalStoreWithSelector:t1}=J_,n1=e=>e;function Lh(e,t=n1,n){const r=t1(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return e1(r),r}const Bd=(e,t)=>{const n=Q_(e),r=(o,a=t)=>Lh(n,o,a);return Object.assign(r,n),r},r1=(e,t)=>e?Bd(e,t):Bd;function ke(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const us=_.createContext(null),o1=us.Provider,Wh=it.error001();function ye(e,t){const n=_.useContext(us);if(n===null)throw new Error(Wh);return Lh(n,e,t)}function Pe(){const e=_.useContext(us);if(e===null)throw new Error(Wh);return _.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Hd={display:"none"},a1={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Fh="react-flow__node-desc",Bh="react-flow__edge-desc",s1="react-flow__aria-live",i1=e=>e.ariaLiveMessage,c1=e=>e.ariaLabelConfig;function l1({rfId:e}){const t=ye(i1);return d.jsx("div",{id:`${s1}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:a1,children:t})}function d1({rfId:e,disableKeyboardA11y:t}){const n=ye(c1);return d.jsxs(d.Fragment,{children:[d.jsx("div",{id:`${Fh}-${e}`,style:Hd,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),d.jsx("div",{id:`${Bh}-${e}`,style:Hd,children:n["edge.a11yDescription.default"]}),!t&&d.jsx(l1,{rfId:e})]})}const Wo=_.forwardRef(({position:e="top-left",children:t,className:n,style:r,...o},a)=>{const s=`${e}`.split("-");return d.jsx("div",{className:Ie(["react-flow__panel",n,...s]),style:r,ref:a,...o,children:t})});Wo.displayName="Panel";function u1({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:d.jsx(Wo,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:d.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const f1=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},ca=e=>e.id;function h1(e,t){return ke(e.selectedNodes.map(ca),t.selectedNodes.map(ca))&&ke(e.selectedEdges.map(ca),t.selectedEdges.map(ca))}function p1({onSelectionChange:e}){const t=Pe(),{selectedNodes:n,selectedEdges:r}=ye(f1,h1);return _.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(a=>a(o))},[n,r,e]),null}const m1=e=>!!e.onSelectionChangeHandlers;function g1({onSelectionChange:e}){const t=ye(m1);return e||t?d.jsx(p1,{onSelectionChange:e}):null}const Hh=[0,0],y1={x:0,y:0,zoom:1},x1=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Vd=[...x1,"rfId"],v1=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Yd={translateExtent:xo,nodeOrigin:Hh,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function b1(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:a,setNodeExtent:s,reset:i,setDefaultNodesAndEdges:c}=ye(v1,ke),l=Pe();_.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=Yd,i()}),[]);const u=_.useRef(Yd);return _.useEffect(()=>{for(const f of Vd){const h=e[f],p=u.current[f];h!==p&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?r(h):f==="maxZoom"?o(h):f==="translateExtent"?a(h):f==="nodeExtent"?s(h):f==="ariaLabelConfig"?l.setState({ariaLabelConfig:r_(h)}):f==="fitView"?l.setState({fitViewQueued:h}):f==="fitViewOptions"?l.setState({fitViewOptions:h}):l.setState({[f]:h})))}u.current=e},Vd.map(f=>e[f])),null}function qd(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function w1(e){var r;const[t,n]=_.useState(e==="system"?null:e);return _.useEffect(()=>{if(e!=="system"){n(e);return}const o=qd(),a=()=>n(o!=null&&o.matches?"dark":"light");return a(),o==null||o.addEventListener("change",a),()=>{o==null||o.removeEventListener("change",a)}},[e]),t!==null?t:(r=qd())!=null&&r.matches?"dark":"light"}const Gd=typeof document<"u"?document:null;function jo(e=null,t={target:Gd,actInsideInputWithModifier:!0}){const[n,r]=_.useState(!1),o=_.useRef(!1),a=_.useRef(new Set([])),[s,i]=_.useMemo(()=>{if(e!==null){const l=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",`
|
|
35
35
|
`).replace(`
|
|
36
36
|
|
|
37
37
|
`,`
|
|
38
38
|
+`).split(`
|
|
39
|
-
`)),f=l.reduce((d,h)=>d.concat(...h),[]);return[l,f]}return[[],[]]},[e]);return C.useEffect(()=>{const c=(t==null?void 0:t.target)??Wu,l=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const f=m=>{var y,v;if(o.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!o.current||o.current&&!l)&&fh(m))return!1;const p=Bu(m.code,i);if(s.current.add(m[p]),Fu(a,s.current,!1)){const b=((v=(y=m.composedPath)==null?void 0:y.call(m))==null?void 0:v[0])||m.target,x=(b==null?void 0:b.nodeName)==="BUTTON"||(b==null?void 0:b.nodeName)==="A";t.preventDefault!==!1&&(o.current||!x)&&m.preventDefault(),r(!0)}},d=m=>{const g=Bu(m.code,i);Fu(a,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(m[g]),m.key==="Meta"&&s.current.clear(),o.current=!1},h=()=>{s.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",f),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{c==null||c.removeEventListener("keydown",f),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,r]),n}function Fu(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function Bu(e,t){return t.includes(e)?"code":"key"}const dS=()=>{const e=Pe();return C.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,o,s],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??s},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:o,minZoom:s,maxZoom:a,panZoom:i}=e.getState(),c=Ec(t,r,o,s,a,(n==null?void 0:n.padding)??.1);return i?(await i.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:o,snapToGrid:s,domNode:a}=e.getState();if(!a)return t;const{x:i,y:c}=a.getBoundingClientRect(),l={x:t.x-i,y:t.y-c},f=n.snapGrid??o,d=n.snapToGrid??s;return Io(l,r,d,f)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:s}=r.getBoundingClientRect(),a=As(t,n);return{x:a.x+o,y:a.y+s}}}),[])};function Ih(e,t){const n=[],r=new Map,o=[];for(const s of e)if(s.type==="add"){o.push(s);continue}else if(s.type==="remove"||s.type==="replace")r.set(s.id,[s]);else{const a=r.get(s.id);a?a.push(s):r.set(s.id,[s])}for(const s of t){const a=r.get(s.id);if(!a){n.push(s);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const i={...s};for(const c of a)fS(c,i);n.push(i)}return o.length&&o.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function fS(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function $h(e,t){return Ih(e,t)}function zh(e,t){return Ih(e,t)}function Mn(e,t){return{id:e,type:"select",selected:t}}function ur(e,t=new Set,n=!1){const r=[];for(const[o,s]of e){const a=t.has(o);!(s.selected===void 0&&!a)&&s.selected!==a&&(n&&(s.selected=a),r.push(Mn(s.id,a)))}return r}function Hu({items:e=[],lookup:t}){var o;const n=[],r=new Map(e.map(s=>[s.id,s]));for(const[s,a]of e.entries()){const i=t.get(a.id),c=((o=i==null?void 0:i.internals)==null?void 0:o.userNode)??i;c!==void 0&&c!==a&&n.push({id:a.id,item:a,type:"replace"}),c===void 0&&n.push({item:a,type:"add",index:s})}for(const[s]of t)r.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function Vu(e){return{id:e.id,type:"remove"}}const Yu=e=>$j(e),hS=e=>rh(e);function Lh(e){return C.forwardRef(e)}const mS=typeof window<"u"?C.useLayoutEffect:C.useEffect;function qu(e){const[t,n]=C.useState(BigInt(0)),[r]=C.useState(()=>pS(()=>n(o=>o+BigInt(1))));return mS(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function pS(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Wh=C.createContext(null);function gS({children:e}){const t=Pe(),n=C.useCallback(i=>{const{nodes:c=[],setNodes:l,hasDefaultNodes:f,onNodesChange:d,nodeLookup:h,fitViewQueued:m,onNodesChangeMiddlewareMap:g}=t.getState();let p=c;for(const v of i)p=typeof v=="function"?v(p):v;let y=Hu({items:p,lookup:h});for(const v of g.values())y=v(y);f&&l(p),y.length>0?d==null||d(y):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:v,nodes:b,setNodes:x}=t.getState();v&&x(b)})},[]),r=qu(n),o=C.useCallback(i=>{const{edges:c=[],setEdges:l,hasDefaultEdges:f,onEdgesChange:d,edgeLookup:h}=t.getState();let m=c;for(const g of i)m=typeof g=="function"?g(m):g;f?l(m):d&&d(Hu({items:m,lookup:h}))},[]),s=qu(o),a=C.useMemo(()=>({nodeQueue:r,edgeQueue:s}),[]);return u.jsx(Wh.Provider,{value:a,children:e})}function yS(){const e=C.useContext(Wh);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const xS=e=>!!e.panZoom;function ca(){const e=dS(),t=Pe(),n=yS(),r=ye(xS),o=C.useMemo(()=>{const s=d=>t.getState().nodeLookup.get(d),a=d=>{n.nodeQueue.push(d)},i=d=>{n.edgeQueue.push(d)},c=d=>{var v,b;const{nodeLookup:h,nodeOrigin:m}=t.getState(),g=Yu(d)?d:h.get(d.id),p=g.parentId?uh(g.position,g.measured,g.parentId,h,m):g.position,y={...g,position:p,width:((v=g.measured)==null?void 0:v.width)??g.width,height:((b=g.measured)==null?void 0:b.height)??g.height};return jr(y)},l=(d,h,m={replace:!1})=>{a(g=>g.map(p=>{if(p.id===d){const y=typeof h=="function"?h(p):h;return m.replace&&Yu(y)?y:{...p,...y}}return p}))},f=(d,h,m={replace:!1})=>{i(g=>g.map(p=>{if(p.id===d){const y=typeof h=="function"?h(p):h;return m.replace&&hS(y)?y:{...p,...y}}return p}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var h;return(h=s(d))==null?void 0:h.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(h=>({...h}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:a,setEdges:i,addNodes:d=>{const h=Array.isArray(d)?d:[d];n.nodeQueue.push(m=>[...m,...h])},addEdges:d=>{const h=Array.isArray(d)?d:[d];n.edgeQueue.push(m=>[...m,...h])},toObject:()=>{const{nodes:d=[],edges:h=[],transform:m}=t.getState(),[g,p,y]=m;return{nodes:d.map(v=>({...v})),edges:h.map(v=>({...v})),viewport:{x:g,y:p,zoom:y}}},deleteElements:async({nodes:d=[],edges:h=[]})=>{const{nodes:m,edges:g,onNodesDelete:p,onEdgesDelete:y,triggerNodeChanges:v,triggerEdgeChanges:b,onDelete:x,onBeforeDelete:j}=t.getState(),{nodes:N,edges:S}=await Bj({nodesToRemove:d,edgesToRemove:h,nodes:m,edges:g,onBeforeDelete:j}),E=S.length>0,O=N.length>0;if(E){const P=S.map(Vu);y==null||y(S),b(P)}if(O){const P=N.map(Vu);p==null||p(N),v(P)}return(O||E)&&(x==null||x({nodes:N,edges:S})),{deletedNodes:N,deletedEdges:S}},getIntersectingNodes:(d,h=!0,m)=>{const g=gu(d),p=g?d:c(d),y=m!==void 0;return p?(m||t.getState().nodes).filter(v=>{const b=t.getState().nodeLookup.get(v.id);if(b&&!g&&(v.id===d.id||!b.internals.positionAbsolute))return!1;const x=jr(y?v:b),j=xo(x,p);return h&&j>0||j>=x.width*x.height||j>=p.width*p.height}):[]},isNodeIntersecting:(d,h,m=!0)=>{const p=gu(d)?d:c(d);if(!p)return!1;const y=xo(p,h);return m&&y>0||y>=h.width*h.height||y>=p.width*p.height},updateNode:l,updateNodeData:(d,h,m={replace:!1})=>{l(d,g=>{const p=typeof h=="function"?h(g):h;return m.replace?{...g,data:p}:{...g,data:{...g.data,...p}}},m)},updateEdge:f,updateEdgeData:(d,h,m={replace:!1})=>{f(d,g=>{const p=typeof h=="function"?h(g):h;return m.replace?{...g,data:p}:{...g,data:{...g.data,...p}}},m)},getNodesBounds:d=>{const{nodeLookup:h,nodeOrigin:m}=t.getState();return zj(d,{nodeLookup:h,nodeOrigin:m})},getHandleConnections:({type:d,id:h,nodeId:m})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${m}-${d}${h?`-${h}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:d,handleId:h,nodeId:m})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${m}${d?h?`-${d}-${h}`:`-${d}`:""}`))==null?void 0:g.values())??[])},fitView:async d=>{const h=t.getState().fitViewResolver??Yj();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:h}),n.nodeQueue.push(m=>[...m]),h.promise}}},[]);return C.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const Gu=e=>e.selected,vS=typeof window<"u"?window:void 0;function bS({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Pe(),{deleteElements:r}=ca(),o=bo(e,{actInsideInputWithModifier:!1}),s=bo(t,{target:vS});C.useEffect(()=>{if(o){const{edges:a,nodes:i}=n.getState();r({nodes:i.filter(Gu),edges:a.filter(Gu)}),n.setState({nodesSelectionActive:!1})}},[o]),C.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function wS(e){const t=Pe();C.useEffect(()=>{const n=()=>{var o,s,a,i;if(!e.current||!(((s=(o=e.current).checkVisibility)==null?void 0:s.call(o))??!0))return!1;const r=_c(e.current);(r.height===0||r.width===0)&&((i=(a=t.getState()).onError)==null||i.call(a,"004",it.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const la={position:"absolute",width:"100%",height:"100%",top:0,left:0},jS=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function SS({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:o=.5,panOnScrollMode:s=In.Free,zoomOnDoubleClick:a=!0,panOnDrag:i=!0,defaultViewport:c,translateExtent:l,minZoom:f,maxZoom:d,zoomActivationKeyCode:h,preventScrolling:m=!0,children:g,noWheelClassName:p,noPanClassName:y,onViewportChange:v,isControlledViewport:b,paneClickDistance:x,selectionOnDrag:j}){const N=Pe(),S=C.useRef(null),{userSelectionActive:E,lib:O,connectionInProgress:P}=ye(jS,Me),T=bo(h),k=C.useRef();wS(S);const M=C.useCallback(W=>{v==null||v({x:W[0],y:W[1],zoom:W[2]}),b||N.setState({transform:W})},[v,b]);return C.useEffect(()=>{if(S.current){k.current=_1({domNode:S.current,minZoom:f,maxZoom:d,translateExtent:l,viewport:c,onDraggingChange:R=>N.setState(z=>z.paneDragging===R?z:{paneDragging:R}),onPanZoomStart:(R,z)=>{const{onViewportChangeStart:A,onMoveStart:D}=N.getState();D==null||D(R,z),A==null||A(z)},onPanZoom:(R,z)=>{const{onViewportChange:A,onMove:D}=N.getState();D==null||D(R,z),A==null||A(z)},onPanZoomEnd:(R,z)=>{const{onViewportChangeEnd:A,onMoveEnd:D}=N.getState();D==null||D(R,z),A==null||A(z)}});const{x:W,y:_,zoom:I}=k.current.getViewport();return N.setState({panZoom:k.current,transform:[W,_,I],domNode:S.current.closest(".react-flow")}),()=>{var R;(R=k.current)==null||R.destroy()}}},[]),C.useEffect(()=>{var W;(W=k.current)==null||W.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:o,panOnScrollMode:s,zoomOnDoubleClick:a,panOnDrag:i,zoomActivationKeyPressed:T,preventScrolling:m,noPanClassName:y,userSelectionActive:E,noWheelClassName:p,lib:O,onTransformChange:M,connectionInProgress:P,selectionOnDrag:j,paneClickDistance:x})},[e,t,n,r,o,s,a,i,T,m,y,E,p,O,M,P,j,x]),u.jsx("div",{className:"react-flow__renderer",ref:S,style:la,children:g})}const CS=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function NS(){const{userSelectionActive:e,userSelectionRect:t}=ye(CS,Me);return e&&t?u.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const oi=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},ES=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function _S({isSelecting:e,selectionKeyPressed:t,selectionMode:n=yo.Full,panOnDrag:r,paneClickDistance:o,selectionOnDrag:s,onSelectionStart:a,onSelectionEnd:i,onPaneClick:c,onPaneContextMenu:l,onPaneScroll:f,onPaneMouseEnter:d,onPaneMouseMove:h,onPaneMouseLeave:m,children:g}){const p=Pe(),{userSelectionActive:y,elementsSelectable:v,dragging:b,connectionInProgress:x}=ye(ES,Me),j=v&&(e||y),N=C.useRef(null),S=C.useRef(),E=C.useRef(new Set),O=C.useRef(new Set),P=C.useRef(!1),T=A=>{if(P.current||x){P.current=!1;return}c==null||c(A),p.getState().resetSelectedElements(),p.setState({nodesSelectionActive:!1})},k=A=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){A.preventDefault();return}l==null||l(A)},M=f?A=>f(A):void 0,W=A=>{P.current&&(A.stopPropagation(),P.current=!1)},_=A=>{var Y,G;const{domNode:D}=p.getState();if(S.current=D==null?void 0:D.getBoundingClientRect(),!S.current)return;const B=A.target===N.current;if(!B&&!!A.target.closest(".nokey")||!e||!(s&&B||t)||A.button!==0||!A.isPrimary)return;(G=(Y=A.target)==null?void 0:Y.setPointerCapture)==null||G.call(Y,A.pointerId),P.current=!1;const{x:H,y:L}=vt(A.nativeEvent,S.current);p.setState({userSelectionRect:{width:0,height:0,startX:H,startY:L,x:H,y:L}}),B||(A.stopPropagation(),A.preventDefault())},I=A=>{const{userSelectionRect:D,transform:B,nodeLookup:q,edgeLookup:V,connectionLookup:H,triggerNodeChanges:L,triggerEdgeChanges:Y,defaultEdgeOptions:G,resetSelectedElements:$}=p.getState();if(!S.current||!D)return;const{x:F,y:U}=vt(A.nativeEvent,S.current),{startX:X,startY:Z}=D;if(!P.current){const ae=t?0:o;if(Math.hypot(F-X,U-Z)<=ae)return;$(),a==null||a(A)}P.current=!0;const K={startX:X,startY:Z,x:F<X?F:X,y:U<Z?U:Z,width:Math.abs(F-X),height:Math.abs(U-Z)},J=E.current,ee=O.current;E.current=new Set(Nc(q,K,B,n===yo.Partial,!0).map(ae=>ae.id)),O.current=new Set;const se=(G==null?void 0:G.selectable)??!0;for(const ae of E.current){const ue=H.get(ae);if(ue)for(const{edgeId:ve}of ue.values()){const ke=V.get(ve);ke&&(ke.selectable??se)&&O.current.add(ve)}}if(!yu(J,E.current)){const ae=ur(q,E.current,!0);L(ae)}if(!yu(ee,O.current)){const ae=ur(V,O.current);Y(ae)}p.setState({userSelectionRect:K,userSelectionActive:!0,nodesSelectionActive:!1})},R=A=>{var D,B;A.button===0&&((B=(D=A.target)==null?void 0:D.releasePointerCapture)==null||B.call(D,A.pointerId),!y&&A.target===N.current&&p.getState().userSelectionRect&&(T==null||T(A)),p.setState({userSelectionActive:!1,userSelectionRect:null}),P.current&&(i==null||i(A),p.setState({nodesSelectionActive:E.current.size>0})))},z=r===!0||Array.isArray(r)&&r.includes(0);return u.jsxs("div",{className:Te(["react-flow__pane",{draggable:z,dragging:b,selection:e}]),onClick:j?void 0:oi(T,N),onContextMenu:oi(k,N),onWheel:oi(M,N),onPointerEnter:j?void 0:d,onPointerMove:j?I:h,onPointerUp:j?R:void 0,onPointerDownCapture:j?_:void 0,onClickCapture:j?W:void 0,onPointerLeave:m,ref:N,style:la,children:[g,u.jsx(NS,{})]})}function Yi({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:s,multiSelectionActive:a,nodeLookup:i,onError:c}=t.getState(),l=i.get(e);if(!l){c==null||c("012",it.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&a)&&(s({nodes:[l],edges:[]}),requestAnimationFrame(()=>{var f;return(f=r==null?void 0:r.current)==null?void 0:f.blur()})):o([e])}function Fh({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:s,nodeClickDistance:a}){const i=Pe(),[c,l]=C.useState(!1),f=C.useRef();return C.useEffect(()=>{f.current=h1({getStoreItems:()=>i.getState(),onNodeMouseDown:d=>{Yi({id:d,store:i,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}})},[]),C.useEffect(()=>{if(!(t||!e.current||!f.current))return f.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:s,nodeId:o,nodeClickDistance:a}),()=>{var d;(d=f.current)==null||d.destroy()}},[n,r,t,s,e,o,a]),c}const kS=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Bh(){const e=Pe();return C.useCallback(n=>{const{nodeExtent:r,snapToGrid:o,snapGrid:s,nodesDraggable:a,onError:i,updateNodePositions:c,nodeLookup:l,nodeOrigin:f}=e.getState(),d=new Map,h=kS(a),m=o?s[0]:5,g=o?s[1]:5,p=n.direction.x*m*n.factor,y=n.direction.y*g*n.factor;for(const[,v]of l){if(!h(v))continue;let b={x:v.internals.positionAbsolute.x+p,y:v.internals.positionAbsolute.y+y};o&&(b=To(b,s));const{position:x,positionAbsolute:j}=oh({nodeId:v.id,nextPosition:b,nodeLookup:l,nodeExtent:r,nodeOrigin:f,onError:i});v.position=x,v.internals.positionAbsolute=j,d.set(v.id,v)}c(d)},[])}const Ac=C.createContext(null),MS=Ac.Provider;Ac.Consumer;const Hh=()=>C.useContext(Ac),PS=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),DS=(e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:s,connection:a}=r,{fromHandle:i,toHandle:c,isValid:l}=a,f=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,connectingTo:f,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:s===br.Strict?(i==null?void 0:i.type)!==n:e!==(i==null?void 0:i.nodeId)||t!==(i==null?void 0:i.id),connectionInProcess:!!i,clickConnectionInProcess:!!o,valid:f&&l}};function OS({type:e="source",position:t=re.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:s=!0,id:a,onConnect:i,children:c,className:l,onMouseDown:f,onTouchStart:d,...h},m){var I,R;const g=a||null,p=e==="target",y=Pe(),v=Hh(),{connectOnClick:b,noPanClassName:x,rfId:j}=ye(PS,Me),{connectingFrom:N,connectingTo:S,clickConnecting:E,isPossibleEndHandle:O,connectionInProcess:P,clickConnectionInProcess:T,valid:k}=ye(DS(v,g,e),Me);v||(R=(I=y.getState()).onError)==null||R.call(I,"010",it.error010());const M=z=>{const{defaultEdgeOptions:A,onConnect:D,hasDefaultEdges:B}=y.getState(),q={...A,...z};if(B){const{edges:V,setEdges:H}=y.getState();H(gh(q,V))}D==null||D(q),i==null||i(q)},W=z=>{if(!v)return;const A=hh(z.nativeEvent);if(o&&(A&&z.button===0||!A)){const D=y.getState();Hi.onPointerDown(z.nativeEvent,{handleDomNode:z.currentTarget,autoPanOnConnect:D.autoPanOnConnect,connectionMode:D.connectionMode,connectionRadius:D.connectionRadius,domNode:D.domNode,nodeLookup:D.nodeLookup,lib:D.lib,isTarget:p,handleId:g,nodeId:v,flowId:D.rfId,panBy:D.panBy,cancelConnection:D.cancelConnection,onConnectStart:D.onConnectStart,onConnectEnd:(...B)=>{var q,V;return(V=(q=y.getState()).onConnectEnd)==null?void 0:V.call(q,...B)},updateConnection:D.updateConnection,onConnect:M,isValidConnection:n||((...B)=>{var q,V;return((V=(q=y.getState()).isValidConnection)==null?void 0:V.call(q,...B))??!0}),getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,autoPanSpeed:D.autoPanSpeed,dragThreshold:D.connectionDragThreshold})}A?f==null||f(z):d==null||d(z)},_=z=>{const{onClickConnectStart:A,onClickConnectEnd:D,connectionClickStartHandle:B,connectionMode:q,isValidConnection:V,lib:H,rfId:L,nodeLookup:Y,connection:G}=y.getState();if(!v||!B&&!o)return;if(!B){A==null||A(z.nativeEvent,{nodeId:v,handleId:g,handleType:e}),y.setState({connectionClickStartHandle:{nodeId:v,type:e,id:g}});return}const $=dh(z.target),F=n||V,{connection:U,isValid:X}=Hi.isValid(z.nativeEvent,{handle:{nodeId:v,id:g,type:e},connectionMode:q,fromNodeId:B.nodeId,fromHandleId:B.id||null,fromType:B.type,isValidConnection:F,flowId:L,doc:$,lib:H,nodeLookup:Y});X&&U&&M(U);const Z=structuredClone(G);delete Z.inProgress,Z.toPosition=Z.toHandle?Z.toHandle.position:null,D==null||D(z,Z),y.setState({connectionClickStartHandle:null})};return u.jsx("div",{"data-handleid":g,"data-nodeid":v,"data-handlepos":t,"data-id":`${j}-${v}-${g}-${e}`,className:Te(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,l,{source:!p,target:p,connectable:r,connectablestart:o,connectableend:s,clickconnecting:E,connectingfrom:N,connectingto:S,valid:k,connectionindicator:r&&(!P||O)&&(P||T?s:o)}]),onMouseDown:W,onTouchStart:W,onClick:b?_:void 0,ref:m,...h,children:c})}const Nr=C.memo(Lh(OS));function RS({data:e,isConnectable:t,sourcePosition:n=re.Bottom}){return u.jsxs(u.Fragment,{children:[e==null?void 0:e.label,u.jsx(Nr,{type:"source",position:n,isConnectable:t})]})}function AS({data:e,isConnectable:t,targetPosition:n=re.Top,sourcePosition:r=re.Bottom}){return u.jsxs(u.Fragment,{children:[u.jsx(Nr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,u.jsx(Nr,{type:"source",position:r,isConnectable:t})]})}function TS(){return null}function IS({data:e,isConnectable:t,targetPosition:n=re.Top}){return u.jsxs(u.Fragment,{children:[u.jsx(Nr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Ts={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Uu={input:RS,default:AS,output:IS,group:TS};function $S(e){var t,n,r,o;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const zS=e=>{const{width:t,height:n,x:r,y:o}=Ao(e.nodeLookup,{filter:s=>!!s.selected});return{width:xt(t)?t:null,height:xt(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function LS({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Pe(),{width:o,height:s,transformString:a,userSelectionActive:i}=ye(zS,Me),c=Bh(),l=C.useRef(null);C.useEffect(()=>{var m;n||(m=l.current)==null||m.focus({preventScroll:!0})},[n]);const f=!i&&o!==null&&s!==null;if(Fh({nodeRef:l,disabled:!f}),!f)return null;const d=e?m=>{const g=r.getState().nodes.filter(p=>p.selected);e(m,g)}:void 0,h=m=>{Object.prototype.hasOwnProperty.call(Ts,m.key)&&(m.preventDefault(),c({direction:Ts[m.key],factor:m.shiftKey?4:1}))};return u.jsx("div",{className:Te(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:u.jsx("div",{ref:l,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:o,height:s}})})}const Xu=typeof window<"u"?window:void 0,WS=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Vh({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:a,paneClickDistance:i,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:f,selectionMode:d,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:g,panActivationKeyCode:p,zoomActivationKeyCode:y,elementsSelectable:v,zoomOnScroll:b,zoomOnPinch:x,panOnScroll:j,panOnScrollSpeed:N,panOnScrollMode:S,zoomOnDoubleClick:E,panOnDrag:O,defaultViewport:P,translateExtent:T,minZoom:k,maxZoom:M,preventScrolling:W,onSelectionContextMenu:_,noWheelClassName:I,noPanClassName:R,disableKeyboardA11y:z,onViewportChange:A,isControlledViewport:D}){const{nodesSelectionActive:B,userSelectionActive:q}=ye(WS,Me),V=bo(l,{target:Xu}),H=bo(p,{target:Xu}),L=H||O,Y=H||j,G=f&&L!==!0,$=V||q||G;return bS({deleteKeyCode:c,multiSelectionKeyCode:g}),u.jsx(SS,{onPaneContextMenu:s,elementsSelectable:v,zoomOnScroll:b,zoomOnPinch:x,panOnScroll:Y,panOnScrollSpeed:N,panOnScrollMode:S,zoomOnDoubleClick:E,panOnDrag:!V&&L,defaultViewport:P,translateExtent:T,minZoom:k,maxZoom:M,zoomActivationKeyCode:y,preventScrolling:W,noWheelClassName:I,noPanClassName:R,onViewportChange:A,isControlledViewport:D,paneClickDistance:i,selectionOnDrag:G,children:u.jsxs(_S,{onSelectionStart:h,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:a,panOnDrag:L,isSelecting:!!$,selectionMode:d,selectionKeyPressed:V,paneClickDistance:i,selectionOnDrag:G,children:[e,B&&u.jsx(LS,{onSelectionContextMenu:_,noPanClassName:R,disableKeyboardA11y:z})]})})}Vh.displayName="FlowRenderer";const FS=C.memo(Vh),BS=e=>t=>e?Nc(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function HS(e){return ye(C.useCallback(BS(e),[e]),Me)}const VS=e=>e.updateNodeInternals;function YS(){const e=ye(VS),[t]=C.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(o=>{const s=o.target.getAttribute("data-id");r.set(s,{id:s,nodeElement:o.target,force:!0})}),e(r)}));return C.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function qS({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=Pe(),s=C.useRef(null),a=C.useRef(null),i=C.useRef(e.sourcePosition),c=C.useRef(e.targetPosition),l=C.useRef(t),f=n&&!!e.internals.handleBounds;return C.useEffect(()=>{s.current&&!e.hidden&&(!f||a.current!==s.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(s.current),a.current=s.current)},[f,e.hidden]),C.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),C.useEffect(()=>{if(s.current){const d=l.current!==t,h=i.current!==e.sourcePosition,m=c.current!==e.targetPosition;(d||h||m)&&(l.current=t,i.current=e.sourcePosition,c.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function GS({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:s,onDoubleClick:a,nodesDraggable:i,elementsSelectable:c,nodesConnectable:l,nodesFocusable:f,resizeObserver:d,noDragClassName:h,noPanClassName:m,disableKeyboardA11y:g,rfId:p,nodeTypes:y,nodeClickDistance:v,onError:b}){const{node:x,internals:j,isParent:N}=ye(F=>{const U=F.nodeLookup.get(e),X=F.parentLookup.has(e);return{node:U,internals:U.internals,isParent:X}},Me);let S=x.type||"default",E=(y==null?void 0:y[S])||Uu[S];E===void 0&&(b==null||b("003",it.error003(S)),S="default",E=(y==null?void 0:y.default)||Uu.default);const O=!!(x.draggable||i&&typeof x.draggable>"u"),P=!!(x.selectable||c&&typeof x.selectable>"u"),T=!!(x.connectable||l&&typeof x.connectable>"u"),k=!!(x.focusable||f&&typeof x.focusable>"u"),M=Pe(),W=lh(x),_=qS({node:x,nodeType:S,hasDimensions:W,resizeObserver:d}),I=Fh({nodeRef:_,disabled:x.hidden||!O,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:P,nodeClickDistance:v}),R=Bh();if(x.hidden)return null;const z=ln(x),A=$S(x),D=P||O||t||n||r||o,B=n?F=>n(F,{...j.userNode}):void 0,q=r?F=>r(F,{...j.userNode}):void 0,V=o?F=>o(F,{...j.userNode}):void 0,H=s?F=>s(F,{...j.userNode}):void 0,L=a?F=>a(F,{...j.userNode}):void 0,Y=F=>{const{selectNodesOnDrag:U,nodeDragThreshold:X}=M.getState();P&&(!U||!O||X>0)&&Yi({id:e,store:M,nodeRef:_}),t&&t(F,{...j.userNode})},G=F=>{if(!(fh(F.nativeEvent)||g)){if(Qf.includes(F.key)&&P){const U=F.key==="Escape";Yi({id:e,store:M,unselect:U,nodeRef:_})}else if(O&&x.selected&&Object.prototype.hasOwnProperty.call(Ts,F.key)){F.preventDefault();const{ariaLabelConfig:U}=M.getState();M.setState({ariaLiveMessage:U["node.a11yDescription.ariaLiveMessage"]({direction:F.key.replace("Arrow","").toLowerCase(),x:~~j.positionAbsolute.x,y:~~j.positionAbsolute.y})}),R({direction:Ts[F.key],factor:F.shiftKey?4:1})}}},$=()=>{var ee;if(g||!((ee=_.current)!=null&&ee.matches(":focus-visible")))return;const{transform:F,width:U,height:X,autoPanOnNodeFocus:Z,setCenter:K}=M.getState();if(!Z)return;Nc(new Map([[e,x]]),{x:0,y:0,width:U,height:X},F,!0).length>0||K(x.position.x+z.width/2,x.position.y+z.height/2,{zoom:F[2]})};return u.jsx("div",{className:Te(["react-flow__node",`react-flow__node-${S}`,{[m]:O},x.className,{selected:x.selected,selectable:P,parent:N,draggable:O,dragging:I}]),ref:_,style:{zIndex:j.z,transform:`translate(${j.positionAbsolute.x}px,${j.positionAbsolute.y}px)`,pointerEvents:D?"all":"none",visibility:W?"visible":"hidden",...x.style,...A},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:B,onMouseMove:q,onMouseLeave:V,onContextMenu:H,onClick:Y,onDoubleClick:L,onKeyDown:k?G:void 0,tabIndex:k?0:void 0,onFocus:k?$:void 0,role:x.ariaRole??(k?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${Rh}-${p}`,"aria-label":x.ariaLabel,...x.domAttributes,children:u.jsx(MS,{value:e,children:u.jsx(E,{id:e,data:x.data,type:S,positionAbsoluteX:j.positionAbsolute.x,positionAbsoluteY:j.positionAbsolute.y,selected:x.selected??!1,selectable:P,draggable:O,deletable:x.deletable??!0,isConnectable:T,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:I,dragHandle:x.dragHandle,zIndex:j.z,parentId:x.parentId,...z})})})}var US=C.memo(GS);const XS=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Yh(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,onError:s}=ye(XS,Me),a=HS(e.onlyRenderVisibleElements),i=YS();return u.jsx("div",{className:"react-flow__nodes",style:la,children:a.map(c=>u.jsx(US,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:i,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:s},c))})}Yh.displayName="NodeRenderer";const KS=C.memo(Yh);function JS(e){return ye(C.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const r=[];if(n.width&&n.height)for(const o of n.edges){const s=n.nodeLookup.get(o.source),a=n.nodeLookup.get(o.target);s&&a&&Xj({sourceNode:s,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(o.id)}return r},[e]),Me)}const ZS=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return u.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},QS=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return u.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Ku={[Os.Arrow]:ZS,[Os.ArrowClosed]:QS};function eC(e){const t=Pe();return C.useMemo(()=>{var o,s;return Object.prototype.hasOwnProperty.call(Ku,e)?Ku[e]:((s=(o=t.getState()).onError)==null||s.call(o,"009",it.error009(e)),null)},[e])}const tC=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:s="strokeWidth",strokeWidth:a,orient:i="auto-start-reverse"})=>{const c=eC(t);return c?u.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:i,refX:"0",refY:"0",children:u.jsx(c,{color:n,strokeWidth:a})}):null},qh=({defaultColor:e,rfId:t})=>{const n=ye(s=>s.edges),r=ye(s=>s.defaultEdgeOptions),o=C.useMemo(()=>n1(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return o.length?u.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:u.jsx("defs",{children:o.map(s=>u.jsx(tC,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};qh.displayName="MarkerDefinitions";var nC=C.memo(qh);function Gh({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:s,labelBgPadding:a=[2,4],labelBgBorderRadius:i=2,children:c,className:l,...f}){const[d,h]=C.useState({x:1,y:0,width:0,height:0}),m=Te(["react-flow__edge-textwrapper",l]),g=C.useRef(null);return C.useEffect(()=>{if(g.current){const p=g.current.getBBox();h({x:p.x,y:p.y,width:p.width,height:p.height})}},[n]),n?u.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:m,visibility:d.width?"visible":"hidden",...f,children:[o&&u.jsx("rect",{width:d.width+2*a[0],x:-a[0],y:-a[1],height:d.height+2*a[1],className:"react-flow__edge-textbg",style:s,rx:i,ry:i}),u.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:g,style:r,children:n}),c]}):null}Gh.displayName="EdgeText";const rC=C.memo(Gh);function zo({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:i,labelBgBorderRadius:c,interactionWidth:l=20,...f}){return u.jsxs(u.Fragment,{children:[u.jsx("path",{...f,d:e,fill:"none",className:Te(["react-flow__edge-path",f.className])}),l?u.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:l,className:"react-flow__edge-interaction"}):null,r&&xt(t)&&xt(n)?u.jsx(rC,{x:t,y:n,label:r,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:i,labelBgBorderRadius:c}):null]})}function Ju({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===re.Left||e===re.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Uh({sourceX:e,sourceY:t,sourcePosition:n=re.Bottom,targetX:r,targetY:o,targetPosition:s=re.Top}){const[a,i]=Ju({pos:n,x1:e,y1:t,x2:r,y2:o}),[c,l]=Ju({pos:s,x1:r,y1:o,x2:e,y2:t}),[f,d,h,m]=mh({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:i,targetControlX:c,targetControlY:l});return[`M${e},${t} C${a},${i} ${c},${l} ${r},${o}`,f,d,h,m]}function Xh(e){return C.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:s,sourcePosition:a,targetPosition:i,label:c,labelStyle:l,labelShowBg:f,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:p,markerStart:y,interactionWidth:v})=>{const[b,x,j]=Uh({sourceX:n,sourceY:r,sourcePosition:a,targetX:o,targetY:s,targetPosition:i}),N=e.isInternal?void 0:t;return u.jsx(zo,{id:N,path:b,labelX:x,labelY:j,label:c,labelStyle:l,labelShowBg:f,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:p,markerStart:y,interactionWidth:v})})}const oC=Xh({isInternal:!1}),Kh=Xh({isInternal:!0});oC.displayName="SimpleBezierEdge";Kh.displayName="SimpleBezierEdgeInternal";function Jh(e){return C.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:s,label:a,labelStyle:i,labelShowBg:c,labelBgStyle:l,labelBgPadding:f,labelBgBorderRadius:d,style:h,sourcePosition:m=re.Bottom,targetPosition:g=re.Top,markerEnd:p,markerStart:y,pathOptions:v,interactionWidth:b})=>{const[x,j,N]=Wi({sourceX:n,sourceY:r,sourcePosition:m,targetX:o,targetY:s,targetPosition:g,borderRadius:v==null?void 0:v.borderRadius,offset:v==null?void 0:v.offset,stepPosition:v==null?void 0:v.stepPosition}),S=e.isInternal?void 0:t;return u.jsx(zo,{id:S,path:x,labelX:j,labelY:N,label:a,labelStyle:i,labelShowBg:c,labelBgStyle:l,labelBgPadding:f,labelBgBorderRadius:d,style:h,markerEnd:p,markerStart:y,interactionWidth:b})})}const Zh=Jh({isInternal:!1}),Qh=Jh({isInternal:!0});Zh.displayName="SmoothStepEdge";Qh.displayName="SmoothStepEdgeInternal";function em(e){return C.memo(({id:t,...n})=>{var o;const r=e.isInternal?void 0:t;return u.jsx(Zh,{...n,id:r,pathOptions:C.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const sC=em({isInternal:!1}),tm=em({isInternal:!0});sC.displayName="StepEdge";tm.displayName="StepEdgeInternal";function nm(e){return C.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:s,label:a,labelStyle:i,labelShowBg:c,labelBgStyle:l,labelBgPadding:f,labelBgBorderRadius:d,style:h,markerEnd:m,markerStart:g,interactionWidth:p})=>{const[y,v,b]=yh({sourceX:n,sourceY:r,targetX:o,targetY:s}),x=e.isInternal?void 0:t;return u.jsx(zo,{id:x,path:y,labelX:v,labelY:b,label:a,labelStyle:i,labelShowBg:c,labelBgStyle:l,labelBgPadding:f,labelBgBorderRadius:d,style:h,markerEnd:m,markerStart:g,interactionWidth:p})})}const aC=nm({isInternal:!1}),rm=nm({isInternal:!0});aC.displayName="StraightEdge";rm.displayName="StraightEdgeInternal";function om(e){return C.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:s,sourcePosition:a=re.Bottom,targetPosition:i=re.Top,label:c,labelStyle:l,labelShowBg:f,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:p,markerStart:y,pathOptions:v,interactionWidth:b})=>{const[x,j,N]=kc({sourceX:n,sourceY:r,sourcePosition:a,targetX:o,targetY:s,targetPosition:i,curvature:v==null?void 0:v.curvature}),S=e.isInternal?void 0:t;return u.jsx(zo,{id:S,path:x,labelX:j,labelY:N,label:c,labelStyle:l,labelShowBg:f,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:p,markerStart:y,interactionWidth:b})})}const iC=om({isInternal:!1}),sm=om({isInternal:!0});iC.displayName="BezierEdge";sm.displayName="BezierEdgeInternal";const Zu={default:sm,straight:rm,step:tm,smoothstep:Qh,simplebezier:Kh},Qu={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},cC=(e,t,n)=>n===re.Left?e-t:n===re.Right?e+t:e,lC=(e,t,n)=>n===re.Top?e-t:n===re.Bottom?e+t:e,ed="react-flow__edgeupdater";function td({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:s,onMouseOut:a,type:i}){return u.jsx("circle",{onMouseDown:o,onMouseEnter:s,onMouseOut:a,className:Te([ed,`${ed}-${i}`]),cx:cC(t,r,e),cy:lC(n,r,e),r,stroke:"transparent",fill:"transparent"})}function uC({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:s,targetY:a,sourcePosition:i,targetPosition:c,onReconnect:l,onReconnectStart:f,onReconnectEnd:d,setReconnecting:h,setUpdateHover:m}){const g=Pe(),p=(j,N)=>{if(j.button!==0)return;const{autoPanOnConnect:S,domNode:E,connectionMode:O,connectionRadius:P,lib:T,onConnectStart:k,cancelConnection:M,nodeLookup:W,rfId:_,panBy:I,updateConnection:R}=g.getState(),z=N.type==="target",A=(q,V)=>{h(!1),d==null||d(q,n,N.type,V)},D=q=>l==null?void 0:l(n,q),B=(q,V)=>{h(!0),f==null||f(j,n,N.type),k==null||k(q,V)};Hi.onPointerDown(j.nativeEvent,{autoPanOnConnect:S,connectionMode:O,connectionRadius:P,domNode:E,handleId:N.id,nodeId:N.nodeId,nodeLookup:W,isTarget:z,edgeUpdaterType:N.type,lib:T,flowId:_,cancelConnection:M,panBy:I,isValidConnection:(...q)=>{var V,H;return((H=(V=g.getState()).isValidConnection)==null?void 0:H.call(V,...q))??!0},onConnect:D,onConnectStart:B,onConnectEnd:(...q)=>{var V,H;return(H=(V=g.getState()).onConnectEnd)==null?void 0:H.call(V,...q)},onReconnectEnd:A,updateConnection:R,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:j.currentTarget})},y=j=>p(j,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),v=j=>p(j,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),b=()=>m(!0),x=()=>m(!1);return u.jsxs(u.Fragment,{children:[(e===!0||e==="source")&&u.jsx(td,{position:i,centerX:r,centerY:o,radius:t,onMouseDown:y,onMouseEnter:b,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&u.jsx(td,{position:c,centerX:s,centerY:a,radius:t,onMouseDown:v,onMouseEnter:b,onMouseOut:x,type:"target"})]})}function dC({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:s,onContextMenu:a,onMouseEnter:i,onMouseMove:c,onMouseLeave:l,reconnectRadius:f,onReconnect:d,onReconnectStart:h,onReconnectEnd:m,rfId:g,edgeTypes:p,noPanClassName:y,onError:v,disableKeyboardA11y:b}){let x=ye(K=>K.edgeLookup.get(e));const j=ye(K=>K.defaultEdgeOptions);x=j?{...j,...x}:x;let N=x.type||"default",S=(p==null?void 0:p[N])||Zu[N];S===void 0&&(v==null||v("011",it.error011(N)),N="default",S=(p==null?void 0:p.default)||Zu.default);const E=!!(x.focusable||t&&typeof x.focusable>"u"),O=typeof d<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),P=!!(x.selectable||r&&typeof x.selectable>"u"),T=C.useRef(null),[k,M]=C.useState(!1),[W,_]=C.useState(!1),I=Pe(),{zIndex:R,sourceX:z,sourceY:A,targetX:D,targetY:B,sourcePosition:q,targetPosition:V}=ye(C.useCallback(K=>{const J=K.nodeLookup.get(x.source),ee=K.nodeLookup.get(x.target);if(!J||!ee)return{zIndex:x.zIndex,...Qu};const se=t1({id:e,sourceNode:J,targetNode:ee,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:K.connectionMode,onError:v});return{zIndex:Uj({selected:x.selected,zIndex:x.zIndex,sourceNode:J,targetNode:ee,elevateOnSelect:K.elevateEdgesOnSelect,zIndexMode:K.zIndexMode}),...se||Qu}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),Me),H=C.useMemo(()=>x.markerStart?`url('#${Fi(x.markerStart,g)}')`:void 0,[x.markerStart,g]),L=C.useMemo(()=>x.markerEnd?`url('#${Fi(x.markerEnd,g)}')`:void 0,[x.markerEnd,g]);if(x.hidden||z===null||A===null||D===null||B===null)return null;const Y=K=>{var ae;const{addSelectedEdges:J,unselectNodesAndEdges:ee,multiSelectionActive:se}=I.getState();P&&(I.setState({nodesSelectionActive:!1}),x.selected&&se?(ee({nodes:[],edges:[x]}),(ae=T.current)==null||ae.blur()):J([e])),o&&o(K,x)},G=s?K=>{s(K,{...x})}:void 0,$=a?K=>{a(K,{...x})}:void 0,F=i?K=>{i(K,{...x})}:void 0,U=c?K=>{c(K,{...x})}:void 0,X=l?K=>{l(K,{...x})}:void 0,Z=K=>{var J;if(!b&&Qf.includes(K.key)&&P){const{unselectNodesAndEdges:ee,addSelectedEdges:se}=I.getState();K.key==="Escape"?((J=T.current)==null||J.blur(),ee({edges:[x]})):se([e])}};return u.jsx("svg",{style:{zIndex:R},children:u.jsxs("g",{className:Te(["react-flow__edge",`react-flow__edge-${N}`,x.className,y,{selected:x.selected,animated:x.animated,inactive:!P&&!o,updating:k,selectable:P}]),onClick:Y,onDoubleClick:G,onContextMenu:$,onMouseEnter:F,onMouseMove:U,onMouseLeave:X,onKeyDown:E?Z:void 0,tabIndex:E?0:void 0,role:x.ariaRole??(E?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":E?`${Ah}-${g}`:void 0,ref:T,...x.domAttributes,children:[!W&&u.jsx(S,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:P,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:z,sourceY:A,targetX:D,targetY:B,sourcePosition:q,targetPosition:V,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:H,markerEnd:L,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),O&&u.jsx(uC,{edge:x,isReconnectable:O,reconnectRadius:f,onReconnect:d,onReconnectStart:h,onReconnectEnd:m,sourceX:z,sourceY:A,targetX:D,targetY:B,sourcePosition:q,targetPosition:V,setUpdateHover:M,setReconnecting:_})]})})}var fC=C.memo(dC);const hC=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function am({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:s,onEdgeContextMenu:a,onEdgeMouseEnter:i,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:f,reconnectRadius:d,onEdgeDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,disableKeyboardA11y:p}){const{edgesFocusable:y,edgesReconnectable:v,elementsSelectable:b,onError:x}=ye(hC,Me),j=JS(t);return u.jsxs("div",{className:"react-flow__edges",children:[u.jsx(nC,{defaultColor:e,rfId:n}),j.map(N=>u.jsx(fC,{id:N,edgesFocusable:y,edgesReconnectable:v,elementsSelectable:b,noPanClassName:o,onReconnect:s,onContextMenu:a,onMouseEnter:i,onMouseMove:c,onMouseLeave:l,onClick:f,reconnectRadius:d,onDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,rfId:n,onError:x,edgeTypes:r,disableKeyboardA11y:p},N))]})}am.displayName="EdgeRenderer";const mC=C.memo(am),pC=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function gC({children:e}){const t=ye(pC);return u.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function yC(e){const t=ca(),n=C.useRef(!1);C.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const xC=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function vC(e){const t=ye(xC),n=Pe();return C.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function bC(e){return e.connection.inProgress?{...e.connection,to:Io(e.connection.to,e.transform)}:{...e.connection}}function wC(e){return bC}function jC(e){const t=wC();return ye(t,Me)}const SC=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function CC({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:s,height:a,isValid:i,inProgress:c}=ye(SC,Me);return!(s&&o&&c)?null:u.jsx("svg",{style:e,width:s,height:a,className:"react-flow__connectionline react-flow__container",children:u.jsx("g",{className:Te(["react-flow__connection",nh(i)]),children:u.jsx(im,{style:t,type:n,CustomComponent:r,isValid:i})})})}const im=({style:e,type:t=yn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:s,fromNode:a,fromHandle:i,fromPosition:c,to:l,toNode:f,toHandle:d,toPosition:h,pointer:m}=jC();if(!o)return;if(n)return u.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:i,fromX:s.x,fromY:s.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:h,connectionStatus:nh(r),toNode:f,toHandle:d,pointer:m});let g="";const p={sourceX:s.x,sourceY:s.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:h};switch(t){case yn.Bezier:[g]=kc(p);break;case yn.SimpleBezier:[g]=Uh(p);break;case yn.Step:[g]=Wi({...p,borderRadius:0});break;case yn.SmoothStep:[g]=Wi(p);break;default:[g]=yh(p)}return u.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};im.displayName="ConnectionLine";const NC={};function nd(e=NC){const t=C.useRef(e),n=Pe();C.useEffect(()=>{var r,o;if(process.env.NODE_ENV==="development"){const s=new Set([...Object.keys(t.current),...Object.keys(e)]);for(const a of s)if(t.current[a]!==e[a]){(o=(r=n.getState()).onError)==null||o.call(r,"002",it.error002());break}t.current=e}},[e])}function EC(){const e=Pe(),t=C.useRef(!1);C.useEffect(()=>{var n,r;if(process.env.NODE_ENV==="development"&&!t.current){const o=document.querySelector(".react-flow__pane");o&&window.getComputedStyle(o).zIndex!=="1"&&((r=(n=e.getState()).onError)==null||r.call(n,"013",it.error013("react"))),t.current=!0}},[])}function cm({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:s,onEdgeDoubleClick:a,onNodeMouseEnter:i,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:f,onSelectionContextMenu:d,onSelectionStart:h,onSelectionEnd:m,connectionLineType:g,connectionLineStyle:p,connectionLineComponent:y,connectionLineContainerStyle:v,selectionKeyCode:b,selectionOnDrag:x,selectionMode:j,multiSelectionKeyCode:N,panActivationKeyCode:S,zoomActivationKeyCode:E,deleteKeyCode:O,onlyRenderVisibleElements:P,elementsSelectable:T,defaultViewport:k,translateExtent:M,minZoom:W,maxZoom:_,preventScrolling:I,defaultMarkerColor:R,zoomOnScroll:z,zoomOnPinch:A,panOnScroll:D,panOnScrollSpeed:B,panOnScrollMode:q,zoomOnDoubleClick:V,panOnDrag:H,onPaneClick:L,onPaneMouseEnter:Y,onPaneMouseMove:G,onPaneMouseLeave:$,onPaneScroll:F,onPaneContextMenu:U,paneClickDistance:X,nodeClickDistance:Z,onEdgeContextMenu:K,onEdgeMouseEnter:J,onEdgeMouseMove:ee,onEdgeMouseLeave:se,reconnectRadius:ae,onReconnect:ue,onReconnectStart:ve,onReconnectEnd:ke,noDragClassName:Fe,noWheelClassName:Ie,noPanClassName:Qe,disableKeyboardA11y:Le,nodeExtent:Xt,rfId:Mt,viewport:Re,onViewportChange:Ue}){return nd(e),nd(t),EC(),yC(n),vC(Re),u.jsx(FS,{onPaneClick:L,onPaneMouseEnter:Y,onPaneMouseMove:G,onPaneMouseLeave:$,onPaneContextMenu:U,onPaneScroll:F,paneClickDistance:X,deleteKeyCode:O,selectionKeyCode:b,selectionOnDrag:x,selectionMode:j,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:N,panActivationKeyCode:S,zoomActivationKeyCode:E,elementsSelectable:T,zoomOnScroll:z,zoomOnPinch:A,zoomOnDoubleClick:V,panOnScroll:D,panOnScrollSpeed:B,panOnScrollMode:q,panOnDrag:H,defaultViewport:k,translateExtent:M,minZoom:W,maxZoom:_,onSelectionContextMenu:d,preventScrolling:I,noDragClassName:Fe,noWheelClassName:Ie,noPanClassName:Qe,disableKeyboardA11y:Le,onViewportChange:Ue,isControlledViewport:!!Re,children:u.jsxs(gC,{children:[u.jsx(mC,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:a,onReconnect:ue,onReconnectStart:ve,onReconnectEnd:ke,onlyRenderVisibleElements:P,onEdgeContextMenu:K,onEdgeMouseEnter:J,onEdgeMouseMove:ee,onEdgeMouseLeave:se,reconnectRadius:ae,defaultMarkerColor:R,noPanClassName:Qe,disableKeyboardA11y:Le,rfId:Mt}),u.jsx(CC,{style:p,type:g,component:y,containerStyle:v}),u.jsx("div",{className:"react-flow__edgelabel-renderer"}),u.jsx(KS,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:s,onNodeMouseEnter:i,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:f,nodeClickDistance:Z,onlyRenderVisibleElements:P,noPanClassName:Qe,noDragClassName:Fe,disableKeyboardA11y:Le,nodeExtent:Xt,rfId:Mt}),u.jsx("div",{className:"react-flow__viewport-portal"})]})})}cm.displayName="GraphView";const _C=C.memo(cm),rd=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:s,fitView:a,fitViewOptions:i,minZoom:c=.5,maxZoom:l=2,nodeOrigin:f,nodeExtent:d,zIndexMode:h="basic"}={})=>{const m=new Map,g=new Map,p=new Map,y=new Map,v=r??t??[],b=n??e??[],x=f??[0,0],j=d??go;bh(p,y,v);const N=Bi(b,m,g,{nodeOrigin:x,nodeExtent:j,zIndexMode:h});let S=[0,0,1];if(a&&o&&s){const E=Ao(m,{filter:k=>!!((k.width||k.initialWidth)&&(k.height||k.initialHeight))}),{x:O,y:P,zoom:T}=Ec(E,o,s,c,l,(i==null?void 0:i.padding)??.1);S=[O,P,T]}return{rfId:"1",width:o??0,height:s??0,transform:S,nodes:b,nodesInitialized:N,nodeLookup:m,parentLookup:g,edges:v,edgeLookup:y,connectionLookup:p,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:go,nodeExtent:j,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:br.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:i,fitViewResolver:null,connection:{...th},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:ch,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:eh,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},kC=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:s,fitView:a,fitViewOptions:i,minZoom:c,maxZoom:l,nodeOrigin:f,nodeExtent:d,zIndexMode:h})=>q1((m,g)=>{async function p(){const{nodeLookup:y,panZoom:v,fitViewOptions:b,fitViewResolver:x,width:j,height:N,minZoom:S,maxZoom:E}=g();v&&(await Fj({nodes:y,width:j,height:N,panZoom:v,minZoom:S,maxZoom:E},b),x==null||x.resolve(!0),m({fitViewResolver:null}))}return{...rd({nodes:e,edges:t,width:o,height:s,fitView:a,fitViewOptions:i,minZoom:c,maxZoom:l,nodeOrigin:f,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:y=>{const{nodeLookup:v,parentLookup:b,nodeOrigin:x,elevateNodesOnSelect:j,fitViewQueued:N,zIndexMode:S}=g(),E=Bi(y,v,b,{nodeOrigin:x,nodeExtent:d,elevateNodesOnSelect:j,checkEquality:!0,zIndexMode:S});N&&E?(p(),m({nodes:y,nodesInitialized:E,fitViewQueued:!1,fitViewOptions:void 0})):m({nodes:y,nodesInitialized:E})},setEdges:y=>{const{connectionLookup:v,edgeLookup:b}=g();bh(v,b,y),m({edges:y})},setDefaultNodesAndEdges:(y,v)=>{if(y){const{setNodes:b}=g();b(y),m({hasDefaultNodes:!0})}if(v){const{setEdges:b}=g();b(v),m({hasDefaultEdges:!0})}},updateNodeInternals:y=>{const{triggerNodeChanges:v,nodeLookup:b,parentLookup:x,domNode:j,nodeOrigin:N,nodeExtent:S,debug:E,fitViewQueued:O,zIndexMode:P}=g(),{changes:T,updatedInternals:k}=l1(y,b,x,j,N,S,P);k&&(s1(b,x,{nodeOrigin:N,nodeExtent:S,zIndexMode:P}),O?(p(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(T==null?void 0:T.length)>0&&(E&&console.log("React Flow: trigger node changes",T),v==null||v(T)))},updateNodePositions:(y,v=!1)=>{const b=[];let x=[];const{nodeLookup:j,triggerNodeChanges:N,connection:S,updateConnection:E,onNodesChangeMiddlewareMap:O}=g();for(const[P,T]of y){const k=j.get(P),M=!!(k!=null&&k.expandParent&&(k!=null&&k.parentId)&&(T!=null&&T.position)),W={id:P,type:"position",position:M?{x:Math.max(0,T.position.x),y:Math.max(0,T.position.y)}:T.position,dragging:v};if(k&&S.inProgress&&S.fromNode.id===k.id){const _=Fn(k,S.fromHandle,re.Left,!0);E({...S,from:_})}M&&k.parentId&&b.push({id:P,parentId:k.parentId,rect:{...T.internals.positionAbsolute,width:T.measured.width??0,height:T.measured.height??0}}),x.push(W)}if(b.length>0){const{parentLookup:P,nodeOrigin:T}=g(),k=Rc(b,j,P,T);x.push(...k)}for(const P of O.values())x=P(x);N(x)},triggerNodeChanges:y=>{const{onNodesChange:v,setNodes:b,nodes:x,hasDefaultNodes:j,debug:N}=g();if(y!=null&&y.length){if(j){const S=$h(y,x);b(S)}N&&console.log("React Flow: trigger node changes",y),v==null||v(y)}},triggerEdgeChanges:y=>{const{onEdgesChange:v,setEdges:b,edges:x,hasDefaultEdges:j,debug:N}=g();if(y!=null&&y.length){if(j){const S=zh(y,x);b(S)}N&&console.log("React Flow: trigger edge changes",y),v==null||v(y)}},addSelectedNodes:y=>{const{multiSelectionActive:v,edgeLookup:b,nodeLookup:x,triggerNodeChanges:j,triggerEdgeChanges:N}=g();if(v){const S=y.map(E=>Mn(E,!0));j(S);return}j(ur(x,new Set([...y]),!0)),N(ur(b))},addSelectedEdges:y=>{const{multiSelectionActive:v,edgeLookup:b,nodeLookup:x,triggerNodeChanges:j,triggerEdgeChanges:N}=g();if(v){const S=y.map(E=>Mn(E,!0));N(S);return}N(ur(b,new Set([...y]))),j(ur(x,new Set,!0))},unselectNodesAndEdges:({nodes:y,edges:v}={})=>{const{edges:b,nodes:x,nodeLookup:j,triggerNodeChanges:N,triggerEdgeChanges:S}=g(),E=y||x,O=v||b,P=[];for(const k of E){if(!k.selected)continue;const M=j.get(k.id);M&&(M.selected=!1),P.push(Mn(k.id,!1))}const T=[];for(const k of O)k.selected&&T.push(Mn(k.id,!1));N(P),S(T)},setMinZoom:y=>{const{panZoom:v,maxZoom:b}=g();v==null||v.setScaleExtent([y,b]),m({minZoom:y})},setMaxZoom:y=>{const{panZoom:v,minZoom:b}=g();v==null||v.setScaleExtent([b,y]),m({maxZoom:y})},setTranslateExtent:y=>{var v;(v=g().panZoom)==null||v.setTranslateExtent(y),m({translateExtent:y})},resetSelectedElements:()=>{const{edges:y,nodes:v,triggerNodeChanges:b,triggerEdgeChanges:x,elementsSelectable:j}=g();if(!j)return;const N=v.reduce((E,O)=>O.selected?[...E,Mn(O.id,!1)]:E,[]),S=y.reduce((E,O)=>O.selected?[...E,Mn(O.id,!1)]:E,[]);b(N),x(S)},setNodeExtent:y=>{const{nodes:v,nodeLookup:b,parentLookup:x,nodeOrigin:j,elevateNodesOnSelect:N,nodeExtent:S,zIndexMode:E}=g();y[0][0]===S[0][0]&&y[0][1]===S[0][1]&&y[1][0]===S[1][0]&&y[1][1]===S[1][1]||(Bi(v,b,x,{nodeOrigin:j,nodeExtent:y,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:E}),m({nodeExtent:y}))},panBy:y=>{const{transform:v,width:b,height:x,panZoom:j,translateExtent:N}=g();return u1({delta:y,panZoom:j,transform:v,translateExtent:N,width:b,height:x})},setCenter:async(y,v,b)=>{const{width:x,height:j,maxZoom:N,panZoom:S}=g();if(!S)return Promise.resolve(!1);const E=typeof(b==null?void 0:b.zoom)<"u"?b.zoom:N;return await S.setViewport({x:x/2-y*E,y:j/2-v*E,zoom:E},{duration:b==null?void 0:b.duration,ease:b==null?void 0:b.ease,interpolate:b==null?void 0:b.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{m({connection:{...th}})},updateConnection:y=>{m({connection:y})},reset:()=>m({...rd()})}},Object.is);function lm({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:s,initialMinZoom:a,initialMaxZoom:i,initialFitViewOptions:c,fitView:l,nodeOrigin:f,nodeExtent:d,zIndexMode:h,children:m}){const[g]=C.useState(()=>kC({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:s,fitView:l,minZoom:a,maxZoom:i,fitViewOptions:c,nodeOrigin:f,nodeExtent:d,zIndexMode:h}));return u.jsx(G1,{value:g,children:u.jsx(gS,{children:m})})}function MC({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:s,height:a,fitView:i,fitViewOptions:c,minZoom:l,maxZoom:f,nodeOrigin:d,nodeExtent:h,zIndexMode:m}){return C.useContext(ia)?u.jsx(u.Fragment,{children:e}):u.jsx(lm,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:s,initialHeight:a,fitView:i,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:f,nodeOrigin:d,nodeExtent:h,zIndexMode:m,children:e})}const PC={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function DC({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:s,edgeTypes:a,onNodeClick:i,onEdgeClick:c,onInit:l,onMove:f,onMoveStart:d,onMoveEnd:h,onConnect:m,onConnectStart:g,onConnectEnd:p,onClickConnectStart:y,onClickConnectEnd:v,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:j,onNodeContextMenu:N,onNodeDoubleClick:S,onNodeDragStart:E,onNodeDrag:O,onNodeDragStop:P,onNodesDelete:T,onEdgesDelete:k,onDelete:M,onSelectionChange:W,onSelectionDragStart:_,onSelectionDrag:I,onSelectionDragStop:R,onSelectionContextMenu:z,onSelectionStart:A,onSelectionEnd:D,onBeforeDelete:B,connectionMode:q,connectionLineType:V=yn.Bezier,connectionLineStyle:H,connectionLineComponent:L,connectionLineContainerStyle:Y,deleteKeyCode:G="Backspace",selectionKeyCode:$="Shift",selectionOnDrag:F=!1,selectionMode:U=yo.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:Z=vo()?"Meta":"Control",zoomActivationKeyCode:K=vo()?"Meta":"Control",snapToGrid:J,snapGrid:ee,onlyRenderVisibleElements:se=!1,selectNodesOnDrag:ae,nodesDraggable:ue,autoPanOnNodeFocus:ve,nodesConnectable:ke,nodesFocusable:Fe,nodeOrigin:Ie=Th,edgesFocusable:Qe,edgesReconnectable:Le,elementsSelectable:Xt=!0,defaultViewport:Mt=aS,minZoom:Re=.5,maxZoom:Ue=2,translateExtent:Xn=go,preventScrolling:Fr=!0,nodeExtent:Pt,defaultMarkerColor:Br="#b1b1b7",zoomOnScroll:Kn=!0,zoomOnPinch:En=!0,panOnScroll:Dt=!1,panOnScrollSpeed:Jn=.5,panOnScrollMode:Ot=In.Free,zoomOnDoubleClick:Zn=!0,panOnDrag:Hr=!0,onPaneClick:_n,onPaneMouseEnter:le,onPaneMouseMove:xe,onPaneMouseLeave:oe,onPaneScroll:de,onPaneContextMenu:Be,paneClickDistance:Q=1,nodeClickDistance:be=0,children:Ce,onReconnect:qe,onReconnectStart:He,onReconnectEnd:Xe,onEdgeContextMenu:Kt,onEdgeDoubleClick:et,onEdgeMouseEnter:Rt,onEdgeMouseMove:wv,onEdgeMouseLeave:jv,reconnectRadius:Sv=10,onNodesChange:Cv,onEdgesChange:Nv,noDragClassName:Ev="nodrag",noWheelClassName:_v="nowheel",noPanClassName:Bl="nopan",fitView:Hl,fitViewOptions:Vl,connectOnClick:kv,attributionPosition:Mv,proOptions:Pv,defaultEdgeOptions:Dv,elevateNodesOnSelect:Ov=!0,elevateEdgesOnSelect:Rv=!1,disableKeyboardA11y:Yl=!1,autoPanOnConnect:Av,autoPanOnNodeDrag:Tv,autoPanSpeed:Iv,connectionRadius:$v,isValidConnection:zv,onError:Lv,style:Wv,id:ql,nodeDragThreshold:Fv,connectionDragThreshold:Bv,viewport:Hv,onViewportChange:Vv,width:Yv,height:qv,colorMode:Gv="light",debug:Uv,onScroll:Ko,ariaLabelConfig:Xv,zIndexMode:Gl="basic",...Kv},Jv){const qa=ql||"1",Zv=uS(Gv),Qv=C.useCallback(Ul=>{Ul.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ko==null||Ko(Ul)},[Ko]);return u.jsx("div",{"data-testid":"rf__wrapper",...Kv,onScroll:Qv,style:{...Wv,...PC},ref:Jv,className:Te(["react-flow",o,Zv]),id:ql,role:"application",children:u.jsxs(MC,{nodes:e,edges:t,width:Yv,height:qv,fitView:Hl,fitViewOptions:Vl,minZoom:Re,maxZoom:Ue,nodeOrigin:Ie,nodeExtent:Pt,zIndexMode:Gl,children:[u.jsx(_C,{onInit:l,onNodeClick:i,onEdgeClick:c,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:j,onNodeContextMenu:N,onNodeDoubleClick:S,nodeTypes:s,edgeTypes:a,connectionLineType:V,connectionLineStyle:H,connectionLineComponent:L,connectionLineContainerStyle:Y,selectionKeyCode:$,selectionOnDrag:F,selectionMode:U,deleteKeyCode:G,multiSelectionKeyCode:Z,panActivationKeyCode:X,zoomActivationKeyCode:K,onlyRenderVisibleElements:se,defaultViewport:Mt,translateExtent:Xn,minZoom:Re,maxZoom:Ue,preventScrolling:Fr,zoomOnScroll:Kn,zoomOnPinch:En,zoomOnDoubleClick:Zn,panOnScroll:Dt,panOnScrollSpeed:Jn,panOnScrollMode:Ot,panOnDrag:Hr,onPaneClick:_n,onPaneMouseEnter:le,onPaneMouseMove:xe,onPaneMouseLeave:oe,onPaneScroll:de,onPaneContextMenu:Be,paneClickDistance:Q,nodeClickDistance:be,onSelectionContextMenu:z,onSelectionStart:A,onSelectionEnd:D,onReconnect:qe,onReconnectStart:He,onReconnectEnd:Xe,onEdgeContextMenu:Kt,onEdgeDoubleClick:et,onEdgeMouseEnter:Rt,onEdgeMouseMove:wv,onEdgeMouseLeave:jv,reconnectRadius:Sv,defaultMarkerColor:Br,noDragClassName:Ev,noWheelClassName:_v,noPanClassName:Bl,rfId:qa,disableKeyboardA11y:Yl,nodeExtent:Pt,viewport:Hv,onViewportChange:Vv}),u.jsx(lS,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:m,onConnectStart:g,onConnectEnd:p,onClickConnectStart:y,onClickConnectEnd:v,nodesDraggable:ue,autoPanOnNodeFocus:ve,nodesConnectable:ke,nodesFocusable:Fe,edgesFocusable:Qe,edgesReconnectable:Le,elementsSelectable:Xt,elevateNodesOnSelect:Ov,elevateEdgesOnSelect:Rv,minZoom:Re,maxZoom:Ue,nodeExtent:Pt,onNodesChange:Cv,onEdgesChange:Nv,snapToGrid:J,snapGrid:ee,connectionMode:q,translateExtent:Xn,connectOnClick:kv,defaultEdgeOptions:Dv,fitView:Hl,fitViewOptions:Vl,onNodesDelete:T,onEdgesDelete:k,onDelete:M,onNodeDragStart:E,onNodeDrag:O,onNodeDragStop:P,onSelectionDrag:I,onSelectionDragStart:_,onSelectionDragStop:R,onMove:f,onMoveStart:d,onMoveEnd:h,noPanClassName:Bl,nodeOrigin:Ie,rfId:qa,autoPanOnConnect:Av,autoPanOnNodeDrag:Tv,autoPanSpeed:Iv,onError:Lv,connectionRadius:$v,isValidConnection:zv,selectNodesOnDrag:ae,nodeDragThreshold:Fv,connectionDragThreshold:Bv,onBeforeDelete:B,debug:Uv,ariaLabelConfig:Xv,zIndexMode:Gl}),u.jsx(sS,{onSelectionChange:W}),Ce,u.jsx(eS,{proOptions:Pv,position:Mv}),u.jsx(Q1,{rfId:qa,disableKeyboardA11y:Yl})]})})}var OC=Lh(DC);const RC=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function AC({children:e}){const t=ye(RC);return t?Js.createPortal(e,t):null}function TC({dimensions:e,lineWidth:t,variant:n,className:r}){return u.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Te(["react-flow__background-pattern",n,r])})}function IC({radius:e,className:t}){return u.jsx("circle",{cx:e,cy:e,r:e,className:Te(["react-flow__background-pattern","dots",t])})}var vn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(vn||(vn={}));const $C={[vn.Dots]:1,[vn.Lines]:1,[vn.Cross]:6},zC=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function um({id:e,variant:t=vn.Dots,gap:n=20,size:r,lineWidth:o=1,offset:s=0,color:a,bgColor:i,style:c,className:l,patternClassName:f}){const d=C.useRef(null),{transform:h,patternId:m}=ye(zC,Me),g=r||$C[t],p=t===vn.Dots,y=t===vn.Cross,v=Array.isArray(n)?n:[n,n],b=[v[0]*h[2]||1,v[1]*h[2]||1],x=g*h[2],j=Array.isArray(s)?s:[s,s],N=y?[x,x]:b,S=[j[0]*h[2]||1+N[0]/2,j[1]*h[2]||1+N[1]/2],E=`${m}${e||""}`;return u.jsxs("svg",{className:Te(["react-flow__background",l]),style:{...c,...la,"--xy-background-color-props":i,"--xy-background-pattern-color-props":a},ref:d,"data-testid":"rf__background",children:[u.jsx("pattern",{id:E,x:h[0]%b[0],y:h[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:p?u.jsx(IC,{radius:x/2,className:f}):u.jsx(TC,{dimensions:N,lineWidth:o,variant:t,className:f})}),u.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${E})`})]})}um.displayName="Background";const LC=C.memo(um);function WC(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:u.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function FC(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:u.jsx("path",{d:"M0 0h32v4.2H0z"})})}function BC(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:u.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function HC(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:u.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function VC(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:u.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function as({children:e,className:t,...n}){return u.jsx("button",{type:"button",className:Te(["react-flow__controls-button",t]),...n,children:e})}const YC=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function dm({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:s,onZoomOut:a,onFitView:i,onInteractiveChange:c,className:l,children:f,position:d="bottom-left",orientation:h="vertical","aria-label":m}){const g=Pe(),{isInteractive:p,minZoomReached:y,maxZoomReached:v,ariaLabelConfig:b}=ye(YC,Me),{zoomIn:x,zoomOut:j,fitView:N}=ca(),S=()=>{x(),s==null||s()},E=()=>{j(),a==null||a()},O=()=>{N(o),i==null||i()},P=()=>{g.setState({nodesDraggable:!p,nodesConnectable:!p,elementsSelectable:!p}),c==null||c(!p)},T=h==="horizontal"?"horizontal":"vertical";return u.jsxs($o,{className:Te(["react-flow__controls",T,l]),position:d,style:e,"data-testid":"rf__controls","aria-label":m??b["controls.ariaLabel"],children:[t&&u.jsxs(u.Fragment,{children:[u.jsx(as,{onClick:S,className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:v,children:u.jsx(WC,{})}),u.jsx(as,{onClick:E,className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:y,children:u.jsx(FC,{})})]}),n&&u.jsx(as,{className:"react-flow__controls-fitview",onClick:O,title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:u.jsx(BC,{})}),r&&u.jsx(as,{className:"react-flow__controls-interactive",onClick:P,title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:p?u.jsx(VC,{}):u.jsx(HC,{})}),f]})}dm.displayName="Controls";const qC=C.memo(dm);function GC({id:e,x:t,y:n,width:r,height:o,style:s,color:a,strokeColor:i,strokeWidth:c,className:l,borderRadius:f,shapeRendering:d,selected:h,onClick:m}){const{background:g,backgroundColor:p}=s||{},y=a||g||p;return u.jsx("rect",{className:Te(["react-flow__minimap-node",{selected:h},l]),x:t,y:n,rx:f,ry:f,width:r,height:o,style:{fill:y,stroke:i,strokeWidth:c},shapeRendering:d,onClick:m?v=>m(v,e):void 0})}const UC=C.memo(GC),XC=e=>e.nodes.map(t=>t.id),si=e=>e instanceof Function?e:()=>e;function KC({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:s=UC,onClick:a}){const i=ye(XC,Me),c=si(t),l=si(e),f=si(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return u.jsx(u.Fragment,{children:i.map(h=>u.jsx(ZC,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:f,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:s,onClick:a,shapeRendering:d},h))})}function JC({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:s,shapeRendering:a,NodeComponent:i,onClick:c}){const{node:l,x:f,y:d,width:h,height:m}=ye(g=>{const p=g.nodeLookup.get(e);if(!p)return{node:void 0,x:0,y:0,width:0,height:0};const y=p.internals.userNode,{x:v,y:b}=p.internals.positionAbsolute,{width:x,height:j}=ln(y);return{node:y,x:v,y:b,width:x,height:j}},Me);return!l||l.hidden||!lh(l)?null:u.jsx(i,{x:f,y:d,width:h,height:m,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:o,strokeColor:n(l),strokeWidth:s,shapeRendering:a,onClick:c,id:l.id})}const ZC=C.memo(JC);var QC=C.memo(KC);const eN=200,tN=150,nN=e=>!e.hidden,rN=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?ih(Ao(e.nodeLookup,{filter:nN}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},oN="react-flow__minimap-desc";function fm({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:i,bgColor:c,maskColor:l,maskStrokeColor:f,maskStrokeWidth:d,position:h="bottom-right",onClick:m,onNodeClick:g,pannable:p=!1,zoomable:y=!1,ariaLabel:v,inversePan:b,zoomStep:x=1,offsetScale:j=5}){const N=Pe(),S=C.useRef(null),{boundingRect:E,viewBB:O,rfId:P,panZoom:T,translateExtent:k,flowWidth:M,flowHeight:W,ariaLabelConfig:_}=ye(rN,Me),I=(e==null?void 0:e.width)??eN,R=(e==null?void 0:e.height)??tN,z=E.width/I,A=E.height/R,D=Math.max(z,A),B=D*I,q=D*R,V=j*D,H=E.x-(B-E.width)/2-V,L=E.y-(q-E.height)/2-V,Y=B+V*2,G=q+V*2,$=`${oN}-${P}`,F=C.useRef(0),U=C.useRef();F.current=D,C.useEffect(()=>{if(S.current&&T)return U.current=v1({domNode:S.current,panZoom:T,getTransform:()=>N.getState().transform,getViewScale:()=>F.current}),()=>{var J;(J=U.current)==null||J.destroy()}},[T]),C.useEffect(()=>{var J;(J=U.current)==null||J.update({translateExtent:k,width:M,height:W,inversePan:b,pannable:p,zoomStep:x,zoomable:y})},[p,y,b,x,k,M,W]);const X=m?J=>{var ae;const[ee,se]=((ae=U.current)==null?void 0:ae.pointer(J))||[0,0];m(J,{x:ee,y:se})}:void 0,Z=g?C.useCallback((J,ee)=>{const se=N.getState().nodeLookup.get(ee).internals.userNode;g(J,se)},[]):void 0,K=v??_["minimap.ariaLabel"];return u.jsx($o,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*D:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:Te(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:u.jsxs("svg",{width:I,height:R,viewBox:`${H} ${L} ${Y} ${G}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":$,ref:S,onClick:X,children:[K&&u.jsx("title",{id:$,children:K}),u.jsx(QC,{onClick:Z,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:a,nodeComponent:i}),u.jsx("path",{className:"react-flow__minimap-mask",d:`M${H-V},${L-V}h${Y+V*2}v${G+V*2}h${-Y-V*2}z
|
|
40
|
-
M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}fm.displayName="MiniMap";const sN=C.memo(fm),aN=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,iN={[Cr.Line]:"right",[Cr.Handle]:"bottom-right"};function cN({nodeId:e,position:t,variant:n=Cr.Handle,className:r,style:o=void 0,children:s,color:a,minWidth:i=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:h,autoScale:m=!0,shouldResize:g,onResizeStart:p,onResize:y,onResizeEnd:v}){const b=Hh(),x=typeof e=="string"?e:b,j=Pe(),N=C.useRef(null),S=n===Cr.Handle,E=ye(C.useCallback(aN(S&&m),[S,m]),Me),O=C.useRef(null),P=t??iN[n];C.useEffect(()=>{if(!(!N.current||!x))return O.current||(O.current=R1({domNode:N.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:k,transform:M,snapGrid:W,snapToGrid:_,nodeOrigin:I,domNode:R}=j.getState();return{nodeLookup:k,transform:M,snapGrid:W,snapToGrid:_,nodeOrigin:I,paneDomNode:R}},onChange:(k,M)=>{const{triggerNodeChanges:W,nodeLookup:_,parentLookup:I,nodeOrigin:R}=j.getState(),z=[],A={x:k.x,y:k.y},D=_.get(x);if(D&&D.expandParent&&D.parentId){const B=D.origin??R,q=k.width??D.measured.width??0,V=k.height??D.measured.height??0,H={id:D.id,parentId:D.parentId,rect:{width:q,height:V,...uh({x:k.x??D.position.x,y:k.y??D.position.y},{width:q,height:V},D.parentId,_,B)}},L=Rc([H],_,I,R);z.push(...L),A.x=k.x?Math.max(B[0]*q,k.x):void 0,A.y=k.y?Math.max(B[1]*V,k.y):void 0}if(A.x!==void 0&&A.y!==void 0){const B={id:x,type:"position",position:{...A}};z.push(B)}if(k.width!==void 0&&k.height!==void 0){const q={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:k.width,height:k.height}};z.push(q)}for(const B of M){const q={...B,type:"position"};z.push(q)}W(z)},onEnd:({width:k,height:M})=>{const W={id:x,type:"dimensions",resizing:!1,dimensions:{width:k,height:M}};j.getState().triggerNodeChanges([W])}})),O.current.update({controlPosition:P,boundaries:{minWidth:i,minHeight:c,maxWidth:l,maxHeight:f},keepAspectRatio:d,resizeDirection:h,onResizeStart:p,onResize:y,onResizeEnd:v,shouldResize:g}),()=>{var k;(k=O.current)==null||k.destroy()}},[P,i,c,l,f,d,p,y,v,g]);const T=P.split("-");return u.jsx("div",{className:Te(["react-flow__resize-control","nodrag",...T,n,r]),ref:N,style:{...o,scale:E,...a&&{[S?"backgroundColor":"borderColor"]:a}},children:s})}C.memo(cN);var hm={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(A1,function(){Array.isArray||(Array.isArray=function(s){return Object.prototype.toString.call(s)==="[object Array]"});function n(s){for(var a=[],i=0,c=s.length;i<c;i++)a.indexOf(s[i])===-1&&a.push(s[i]);return a}var r={},o={"==":function(s,a){return s==a},"===":function(s,a){return s===a},"!=":function(s,a){return s!=a},"!==":function(s,a){return s!==a},">":function(s,a){return s>a},">=":function(s,a){return s>=a},"<":function(s,a,i){return i===void 0?s<a:s<a&&a<i},"<=":function(s,a,i){return i===void 0?s<=a:s<=a&&a<=i},"!!":function(s){return r.truthy(s)},"!":function(s){return!r.truthy(s)},"%":function(s,a){return s%a},log:function(s){return console.log(s),s},in:function(s,a){return!a||typeof a.indexOf>"u"?!1:a.indexOf(s)!==-1},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(s,a,i){if(i<0){var c=String(s).substr(a);return c.substr(0,c.length+i)}return String(s).substr(a,i)},"+":function(){return Array.prototype.reduce.call(arguments,function(s,a){return parseFloat(s,10)+parseFloat(a,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(s,a){return parseFloat(s,10)*parseFloat(a,10)})},"-":function(s,a){return a===void 0?-s:s-a},"/":function(s,a){return s/a},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,function(s,a){return s.concat(a)},[])},var:function(s,a){var i=a===void 0?null:a,c=this;if(typeof s>"u"||s===""||s===null)return c;for(var l=String(s).split("."),f=0;f<l.length;f++)if(c==null||(c=c[l[f]],c===void 0))return i;return c},missing:function(){for(var s=[],a=Array.isArray(arguments[0])?arguments[0]:arguments,i=0;i<a.length;i++){var c=a[i],l=r.apply({var:c},this);(l===null||l==="")&&s.push(c)}return s},missing_some:function(s,a){var i=r.apply({missing:a},this);return a.length-i.length>=s?[]:i}};return r.is_logic=function(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&Object.keys(s).length===1},r.truthy=function(s){return Array.isArray(s)&&s.length===0?!1:!!s},r.get_operator=function(s){return Object.keys(s)[0]},r.get_values=function(s){return s[r.get_operator(s)]},r.apply=function(s,a){if(Array.isArray(s))return s.map(function(y){return r.apply(y,a)});if(!r.is_logic(s))return s;var i=r.get_operator(s),c=s[i],l,f,d,h,m;if(Array.isArray(c)||(c=[c]),i==="if"||i=="?:"){for(l=0;l<c.length-1;l+=2)if(r.truthy(r.apply(c[l],a)))return r.apply(c[l+1],a);return c.length===l+1?r.apply(c[l],a):null}else if(i==="and"){for(l=0;l<c.length;l+=1)if(f=r.apply(c[l],a),!r.truthy(f))return f;return f}else if(i==="or"){for(l=0;l<c.length;l+=1)if(f=r.apply(c[l],a),r.truthy(f))return f;return f}else{if(i==="filter")return h=r.apply(c[0],a),d=c[1],Array.isArray(h)?h.filter(function(y){return r.truthy(r.apply(d,y))}):[];if(i==="map")return h=r.apply(c[0],a),d=c[1],Array.isArray(h)?h.map(function(y){return r.apply(d,y)}):[];if(i==="reduce")return h=r.apply(c[0],a),d=c[1],m=typeof c[2]<"u"?r.apply(c[2],a):null,Array.isArray(h)?h.reduce(function(y,v){return r.apply(d,{current:v,accumulator:y})},m):m;if(i==="all"){if(h=r.apply(c[0],a),d=c[1],!Array.isArray(h)||!h.length)return!1;for(l=0;l<h.length;l+=1)if(!r.truthy(r.apply(d,h[l])))return!1;return!0}else if(i==="none"){if(h=r.apply(c[0],a),d=c[1],!Array.isArray(h)||!h.length)return!0;for(l=0;l<h.length;l+=1)if(r.truthy(r.apply(d,h[l])))return!1;return!0}else if(i==="some"){if(h=r.apply(c[0],a),d=c[1],!Array.isArray(h)||!h.length)return!1;for(l=0;l<h.length;l+=1)if(r.truthy(r.apply(d,h[l])))return!0;return!1}}if(c=c.map(function(y){return r.apply(y,a)}),o.hasOwnProperty(i)&&typeof o[i]=="function")return o[i].apply(a,c);if(i.indexOf(".")>0){var g=String(i).split("."),p=o;for(l=0;l<g.length;l++){if(!p.hasOwnProperty(g[l]))throw new Error("Unrecognized operation "+i+" (failed at "+g.slice(0,l+1).join(".")+")");p=p[g[l]]}return p.apply(a,c)}throw new Error("Unrecognized operation "+i)},r.uses_data=function(s){var a=[];if(r.is_logic(s)){var i=r.get_operator(s),c=s[i];Array.isArray(c)||(c=[c]),i==="var"?a.push(c[0]):c.forEach(function(l){a.push.apply(a,r.uses_data(l))})}return n(a)},r.add_operation=function(s,a){o[s]=a},r.rm_operation=function(s){delete o[s]},r.rule_like=function(s,a){if(a===s||a==="@")return!0;if(a==="number")return typeof s=="number";if(a==="string")return typeof s=="string";if(a==="array")return Array.isArray(s)&&!r.is_logic(s);if(r.is_logic(a)){if(r.is_logic(s)){var i=r.get_operator(a),c=r.get_operator(s);if(i==="@"||i===c)return r.rule_like(r.get_values(s,!1),r.get_values(a,!1))}return!1}if(Array.isArray(a))if(Array.isArray(s)){if(a.length!==s.length)return!1;for(var l=0;l<a.length;l+=1)if(!r.rule_like(s[l],a[l]))return!1;return!0}else return!1;return!1},r})})(hm);var lN=hm.exports;const Is=Mh(lN),$e=rb((e,t)=>({nodes:[],edges:[],selectedNodeId:null,selectedEdgeId:null,previewAnswers:{},previewCurrentNodeId:null,previewPath:[],isPreviewActive:!1,isDirty:!1,markClean:()=>e({isDirty:!1}),_history:[],_future:[],_clipboard:null,_pushSnapshot:()=>{const{nodes:n,edges:r,_history:o}=t(),s={nodes:JSON.parse(JSON.stringify(n)),edges:JSON.parse(JSON.stringify(r))};e({_history:[...o.slice(-50),s],_future:[],isDirty:!0})},undo:()=>{const{_history:n,nodes:r,edges:o}=t();if(n.length===0)return;const s=n[n.length-1],a={nodes:JSON.parse(JSON.stringify(r)),edges:JSON.parse(JSON.stringify(o))};e({nodes:s.nodes,edges:s.edges,_history:n.slice(0,-1),_future:[...t()._future,a],selectedNodeId:null,selectedEdgeId:null})},redo:()=>{const{_future:n,nodes:r,edges:o}=t();if(n.length===0)return;const s=n[n.length-1],a={nodes:JSON.parse(JSON.stringify(r)),edges:JSON.parse(JSON.stringify(o))};e({nodes:s.nodes,edges:s.edges,_history:[...t()._history,a],_future:n.slice(0,-1),selectedNodeId:null,selectedEdgeId:null})},canUndo:()=>t()._history.length>0,canRedo:()=>t()._future.length>0,copySelectedNodes:()=>{const{selectedNodeId:n,nodes:r}=t();if(!n)return;const o=r.find(s=>s.id===n);o&&e({_clipboard:[JSON.parse(JSON.stringify(o))]})},pasteNodes:()=>{var o;const{_clipboard:n}=t();if(!n||n.length===0)return;t()._pushSnapshot();const r=n.map(s=>{const a=`node_${s.data.namespace}_${Date.now()}`;return{...s,id:a,position:{x:s.position.x+40,y:s.position.y+40},selected:!1}});e({nodes:[...t().nodes,...r],selectedNodeId:((o=r[0])==null?void 0:o.id)||null,selectedEdgeId:null})},duplicateSelectedNode:()=>{const{selectedNodeId:n,nodes:r}=t();if(!n)return;const o=r.find(i=>i.id===n);if(!o)return;t()._pushSnapshot();const s=`node_${o.data.namespace}_${Date.now()}`,a={...JSON.parse(JSON.stringify(o)),id:s,position:{x:o.position.x+40,y:o.position.y+40},selected:!1};e({nodes:[...t().nodes,a],selectedNodeId:s,selectedEdgeId:null})},deleteSelected:()=>{const{selectedNodeId:n,selectedEdgeId:r}=t();n?(t()._pushSnapshot(),t().deleteNode(n)):r&&(t()._pushSnapshot(),t().deleteEdge(r))},onNodesChange:n=>{e({nodes:$h(n,t().nodes)})},onEdgesChange:n=>{e({edges:zh(n,t().edges)})},onConnect:n=>{t()._pushSnapshot();const r={...n,id:`edge_${n.source}_${n.target}`,type:"conditional",source:n.source||"",target:n.target||"",data:{condition:null,priority:0,isDefault:!1}};e({edges:gh(r,t().edges)})},addNodeFromSpec:(n,r)=>{t()._pushSnapshot();const o=`node_${n.namespace}_${Date.now()}`,s={id:o,type:"questionNode",position:r,data:{specId:n.id,namespace:n.namespace,label:n.label,schema:n.schema,options:n.options,actor:"customer",bindings:[{target_namespace:n.namespace}],required:!1}};e({nodes:[...t().nodes,s],selectedNodeId:o,selectedEdgeId:null})},addCustomNode:(n,r)=>{t()._pushSnapshot();const o=`node_custom_${Date.now()}`,s={id:o,type:"questionNode",position:r,data:{specId:"custom",namespace:n.namespace,label:n.label,schema:n.schema,options:n.options,actor:"customer",bindings:n.bindings.map(a=>({target_namespace:a.target_namespace})),required:!1}};e({nodes:[...t().nodes,s],selectedNodeId:o,selectedEdgeId:null})},updateNodeData:(n,r)=>{t()._pushSnapshot(),e({nodes:t().nodes.map(o=>o.id===n?{...o,data:{...o.data,...r}}:o)})},deleteNode:n=>{e({nodes:t().nodes.filter(r=>r.id!==n),edges:t().edges.filter(r=>r.source!==n&&r.target!==n),selectedNodeId:t().selectedNodeId===n?null:t().selectedNodeId})},updateEdgeData:(n,r)=>{t()._pushSnapshot(),e({edges:t().edges.map(o=>o.id===n?{...o,data:{...o.data,...r}}:o)})},createEdgesForOptions:n=>{const{nodes:r,edges:o}=t(),s=r.find(a=>a.id===n);!s||s.data.options},deleteEdge:n=>{e({edges:t().edges.filter(r=>r.id!==n),selectedEdgeId:t().selectedEdgeId===n?null:t().selectedEdgeId})},setSelectedNode:n=>{e({selectedNodeId:n,selectedEdgeId:null})},setSelectedEdge:n=>{e({selectedEdgeId:n,selectedNodeId:null})},clearSelection:()=>{e({selectedNodeId:null,selectedEdgeId:null})},importJourneySpec:n=>{t()._pushSnapshot();const r=n.nodes.map(s=>{var a;return{id:s.node_id,type:"questionNode",position:s.layout?{x:s.layout.x,y:s.layout.y}:{x:0,y:0},data:{specId:s.source_property_spec_id||"custom",namespace:s.question_key,label:s.label_override||s.question_key,labelOverride:s.label_override,schema:s.schema||"v1_string",options:s.options||null,actor:s.actor||"customer",bindings:s.bindings||[{target_namespace:s.question_key}],widget:(a=s.ui)==null?void 0:a.widget,required:s.required||!1,uploadConfig:s.upload_config}}}),o=n.edges.map(s=>({id:s.edge_id,source:s.from_node_id,target:s.to_node_id,type:"conditional",data:{condition:s.condition||null,priority:s.priority||0,isDefault:s.is_default||!1}}));e({nodes:r,edges:o,selectedNodeId:null,selectedEdgeId:null,previewAnswers:{},previewCurrentNodeId:null,previewPath:[],isPreviewActive:!1,isDirty:!1})},exportJourneySpec:()=>{var c;const{nodes:n,edges:r}=t(),o=n.map(l=>({node_id:l.id,question_key:l.data.namespace,source_property_spec_id:l.data.specId,schema:l.data.schema,options:l.data.options,actor:l.data.actor,bindings:l.data.bindings,ui:{widget:l.data.widget||"auto"},layout:{x:l.position.x,y:l.position.y},required:l.data.required,label:l.data.label,...l.data.labelOverride&&{label_override:l.data.labelOverride},...l.data.uploadConfig&&{upload_config:l.data.uploadConfig}})),s=r.map(l=>{var f,d,h;return{edge_id:l.id,from_node_id:l.source,to_node_id:l.target,condition:((f=l.data)==null?void 0:f.condition)||null,priority:((d=l.data)==null?void 0:d.priority)||0,is_default:((h=l.data)==null?void 0:h.isDefault)||!1}}),a=new Set(r.map(l=>l.target)),i=n.find(l=>!a.has(l.id));return{journey_id:`journey_${Date.now()}`,claimspec_id:(c=n[0])!=null&&c.data.specId?"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1":"",version:"0.1.0",nodes:o,edges:s,start_node_id:(i==null?void 0:i.id)||null}},setPreviewAnswer:(n,r)=>{e({previewAnswers:{...t().previewAnswers,[n]:r}})},startPreview:()=>{const{nodes:n,edges:r}=t();if(n.length===0)return;const o=new Set(r.map(a=>a.target)),s=n.find(a=>!o.has(a.id));s&&e({previewAnswers:{},previewCurrentNodeId:s.id,previewPath:[s.id],isPreviewActive:!0,selectedNodeId:s.id,selectedEdgeId:null})},resetPreview:()=>{e({previewAnswers:{},previewCurrentNodeId:null,previewPath:[],isPreviewActive:!1})},navigatePreview:n=>{var h,m;const{nodes:r,edges:o,previewCurrentNodeId:s,previewPath:a,previewAnswers:i}=t();if(!s)return null;if(n==="back"){if(a.length<=1)return null;const g=a.slice(0,-1),p=g[g.length-1];return e({previewPath:g,previewCurrentNodeId:p,selectedNodeId:p}),p}const c=o.filter(g=>g.source===s);if(c.length===0)return null;const l=[...c].sort((g,p)=>{var y,v;return(((y=p.data)==null?void 0:y.priority)||0)-(((v=g.data)==null?void 0:v.priority)||0)});let f=null,d=null;for(const g of l){if((h=g.data)!=null&&h.isDefault){d=g;continue}if((m=g.data)!=null&&m.condition)try{if(Is.apply(g.data.condition,{answers:i})){f=g.target;break}}catch(p){console.error("Error evaluating edge condition:",p)}else{f=g.target;break}}return!f&&d&&(f=d.target),!f&&l.length===1&&(f=l[0].target),f?(e({previewPath:[...a,f],previewCurrentNodeId:f,selectedNodeId:f}),f):null}}));/**
|
|
39
|
+
`)),u=l.reduce((f,h)=>f.concat(...h),[]);return[l,u]}return[[],[]]},[e]);return _.useEffect(()=>{const c=(t==null?void 0:t.target)??Gd,l=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const u=p=>{var y,v;if(o.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!o.current||o.current&&!l)&&bh(p))return!1;const g=Xd(p.code,i);if(a.current.add(p[g]),Ud(s,a.current,!1)){const w=((v=(y=p.composedPath)==null?void 0:y.call(p))==null?void 0:v[0])||p.target,x=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";t.preventDefault!==!1&&(o.current||!x)&&p.preventDefault(),r(!0)}},f=p=>{const m=Xd(p.code,i);Ud(s,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(p[m]),p.key==="Meta"&&a.current.clear(),o.current=!1},h=()=>{a.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",u),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{c==null||c.removeEventListener("keydown",u),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,r]),n}function Ud(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function Xd(e,t){return t.includes(e)?"code":"key"}const j1=()=>{const e=Pe();return _.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,o,a],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??a},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:o,minZoom:a,maxZoom:s,panZoom:i}=e.getState(),c=Dc(t,r,o,a,s,(n==null?void 0:n.padding)??.1);return i?(await i.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:o,snapToGrid:a,domNode:s}=e.getState();if(!s)return t;const{x:i,y:c}=s.getBoundingClientRect(),l={x:t.x-i,y:t.y-c},u=n.snapGrid??o,f=n.snapToGrid??a;return Lo(l,r,f,u)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:a}=r.getBoundingClientRect(),s=za(t,n);return{x:s.x+o,y:s.y+a}}}),[])};function Vh(e,t){const n=[],r=new Map,o=[];for(const a of e)if(a.type==="add"){o.push(a);continue}else if(a.type==="remove"||a.type==="replace")r.set(a.id,[a]);else{const s=r.get(a.id);s?s.push(a):r.set(a.id,[a])}for(const a of t){const s=r.get(a.id);if(!s){n.push(a);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const i={...a};for(const c of s)_1(c,i);n.push(i)}return o.length&&o.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function _1(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function Yh(e,t){return Vh(e,t)}function qh(e,t){return Vh(e,t)}function Mn(e,t){return{id:e,type:"select",selected:t}}function ur(e,t=new Set,n=!1){const r=[];for(const[o,a]of e){const s=t.has(o);!(a.selected===void 0&&!s)&&a.selected!==s&&(n&&(a.selected=s),r.push(Mn(a.id,s)))}return r}function Kd({items:e=[],lookup:t}){var o;const n=[],r=new Map(e.map(a=>[a.id,a]));for(const[a,s]of e.entries()){const i=t.get(s.id),c=((o=i==null?void 0:i.internals)==null?void 0:o.userNode)??i;c!==void 0&&c!==s&&n.push({id:s.id,item:s,type:"replace"}),c===void 0&&n.push({item:s,type:"add",index:a})}for(const[a]of t)r.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function Jd(e){return{id:e.id,type:"remove"}}const Zd=e=>Uj(e),S1=e=>uh(e);function Gh(e){return _.forwardRef(e)}const C1=typeof window<"u"?_.useLayoutEffect:_.useEffect;function Qd(e){const[t,n]=_.useState(BigInt(0)),[r]=_.useState(()=>N1(()=>n(o=>o+BigInt(1))));return C1(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function N1(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Uh=_.createContext(null);function E1({children:e}){const t=Pe(),n=_.useCallback(i=>{const{nodes:c=[],setNodes:l,hasDefaultNodes:u,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let g=c;for(const v of i)g=typeof v=="function"?v(g):v;let y=Kd({items:g,lookup:h});for(const v of m.values())y=v(y);u&&l(g),y.length>0?f==null||f(y):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:v,nodes:w,setNodes:x}=t.getState();v&&x(w)})},[]),r=Qd(n),o=_.useCallback(i=>{const{edges:c=[],setEdges:l,hasDefaultEdges:u,onEdgesChange:f,edgeLookup:h}=t.getState();let p=c;for(const m of i)p=typeof m=="function"?m(p):m;u?l(p):f&&f(Kd({items:p,lookup:h}))},[]),a=Qd(o),s=_.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return d.jsx(Uh.Provider,{value:s,children:e})}function k1(){const e=_.useContext(Uh);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const P1=e=>!!e.panZoom;function fs(){const e=j1(),t=Pe(),n=k1(),r=ye(P1),o=_.useMemo(()=>{const a=f=>t.getState().nodeLookup.get(f),s=f=>{n.nodeQueue.push(f)},i=f=>{n.edgeQueue.push(f)},c=f=>{var v,w;const{nodeLookup:h,nodeOrigin:p}=t.getState(),m=Zd(f)?f:h.get(f.id),g=m.parentId?xh(m.position,m.measured,m.parentId,h,p):m.position,y={...m,position:g,width:((v=m.measured)==null?void 0:v.width)??m.width,height:((w=m.measured)==null?void 0:w.height)??m.height};return _r(y)},l=(f,h,p={replace:!1})=>{s(m=>m.map(g=>{if(g.id===f){const y=typeof h=="function"?h(g):h;return p.replace&&Zd(y)?y:{...g,...y}}return g}))},u=(f,h,p={replace:!1})=>{i(m=>m.map(g=>{if(g.id===f){const y=typeof h=="function"?h(g):h;return p.replace&&S1(y)?y:{...g,...y}}return g}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=a(f))==null?void 0:h.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:s,setEdges:i,addNodes:f=>{const h=Array.isArray(f)?f:[f];n.nodeQueue.push(p=>[...p,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(p=>[...p,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:p}=t.getState(),[m,g,y]=p;return{nodes:f.map(v=>({...v})),edges:h.map(v=>({...v})),viewport:{x:m,y:g,zoom:y}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:m,onNodesDelete:g,onEdgesDelete:y,triggerNodeChanges:v,triggerEdgeChanges:w,onDelete:x,onBeforeDelete:j}=t.getState(),{nodes:N,edges:S}=await Qj({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:m,onBeforeDelete:j}),C=S.length>0,P=N.length>0;if(C){const k=S.map(Jd);y==null||y(S),w(k)}if(P){const k=N.map(Jd);g==null||g(N),v(k)}return(P||C)&&(x==null||x({nodes:N,edges:S})),{deletedNodes:N,deletedEdges:S}},getIntersectingNodes:(f,h=!0,p)=>{const m=_d(f),g=m?f:c(f),y=p!==void 0;return g?(p||t.getState().nodes).filter(v=>{const w=t.getState().nodeLookup.get(v.id);if(w&&!m&&(v.id===f.id||!w.internals.positionAbsolute))return!1;const x=_r(y?v:w),j=bo(x,g);return h&&j>0||j>=x.width*x.height||j>=g.width*g.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const g=_d(f)?f:c(f);if(!g)return!1;const y=bo(g,h);return p&&y>0||y>=h.width*h.height||y>=g.width*g.height},updateNode:l,updateNodeData:(f,h,p={replace:!1})=>{l(f,m=>{const g=typeof h=="function"?h(m):h;return p.replace?{...m,data:g}:{...m,data:{...m.data,...g}}},p)},updateEdge:u,updateEdgeData:(f,h,p={replace:!1})=>{u(f,m=>{const g=typeof h=="function"?h(m):h;return p.replace?{...m,data:g}:{...m,data:{...m.data,...g}}},p)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return Xj(f,{nodeLookup:h,nodeOrigin:p})},getHandleConnections:({type:f,id:h,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}-${f}${h?`-${h}`:""}`))==null?void 0:m.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:m.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??n_();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return _.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const eu=e=>e.selected,M1=typeof window<"u"?window:void 0;function D1({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Pe(),{deleteElements:r}=fs(),o=jo(e,{actInsideInputWithModifier:!1}),a=jo(t,{target:M1});_.useEffect(()=>{if(o){const{edges:s,nodes:i}=n.getState();r({nodes:i.filter(eu),edges:s.filter(eu)}),n.setState({nodesSelectionActive:!1})}},[o]),_.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function O1(e){const t=Pe();_.useEffect(()=>{const n=()=>{var o,a,s,i;if(!e.current||!(((a=(o=e.current).checkVisibility)==null?void 0:a.call(o))??!0))return!1;const r=Oc(e.current);(r.height===0||r.width===0)&&((i=(s=t.getState()).onError)==null||i.call(s,"004",it.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const hs={position:"absolute",width:"100%",height:"100%",top:0,left:0},R1=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function A1({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:o=.5,panOnScrollMode:a=$n.Free,zoomOnDoubleClick:s=!0,panOnDrag:i=!0,defaultViewport:c,translateExtent:l,minZoom:u,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:m,noWheelClassName:g,noPanClassName:y,onViewportChange:v,isControlledViewport:w,paneClickDistance:x,selectionOnDrag:j}){const N=Pe(),S=_.useRef(null),{userSelectionActive:C,lib:P,connectionInProgress:k}=ye(R1,ke),T=jo(h),D=_.useRef();O1(S);const M=_.useCallback(L=>{v==null||v({x:L[0],y:L[1],zoom:L[2]}),w||N.setState({transform:L})},[v,w]);return _.useEffect(()=>{if(S.current){D.current=z_({domNode:S.current,minZoom:u,maxZoom:f,translateExtent:l,viewport:c,onDraggingChange:R=>N.setState(z=>z.paneDragging===R?z:{paneDragging:R}),onPanZoomStart:(R,z)=>{const{onViewportChangeStart:A,onMoveStart:O}=N.getState();O==null||O(R,z),A==null||A(z)},onPanZoom:(R,z)=>{const{onViewportChange:A,onMove:O}=N.getState();O==null||O(R,z),A==null||A(z)},onPanZoomEnd:(R,z)=>{const{onViewportChangeEnd:A,onMoveEnd:O}=N.getState();O==null||O(R,z),A==null||A(z)}});const{x:L,y:E,zoom:I}=D.current.getViewport();return N.setState({panZoom:D.current,transform:[L,E,I],domNode:S.current.closest(".react-flow")}),()=>{var R;(R=D.current)==null||R.destroy()}}},[]),_.useEffect(()=>{var L;(L=D.current)==null||L.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:o,panOnScrollMode:a,zoomOnDoubleClick:s,panOnDrag:i,zoomActivationKeyPressed:T,preventScrolling:p,noPanClassName:y,userSelectionActive:C,noWheelClassName:g,lib:P,onTransformChange:M,connectionInProgress:k,selectionOnDrag:j,paneClickDistance:x})},[e,t,n,r,o,a,s,i,T,p,y,C,g,P,M,k,j,x]),d.jsx("div",{className:"react-flow__renderer",ref:S,style:hs,children:m})}const T1=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function I1(){const{userSelectionActive:e,userSelectionRect:t}=ye(T1,ke);return e&&t?d.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const ci=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},$1=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function z1({isSelecting:e,selectionKeyPressed:t,selectionMode:n=vo.Full,panOnDrag:r,paneClickDistance:o,selectionOnDrag:a,onSelectionStart:s,onSelectionEnd:i,onPaneClick:c,onPaneContextMenu:l,onPaneScroll:u,onPaneMouseEnter:f,onPaneMouseMove:h,onPaneMouseLeave:p,children:m}){const g=Pe(),{userSelectionActive:y,elementsSelectable:v,dragging:w,connectionInProgress:x}=ye($1,ke),j=v&&(e||y),N=_.useRef(null),S=_.useRef(),C=_.useRef(new Set),P=_.useRef(new Set),k=_.useRef(!1),T=A=>{if(k.current||x){k.current=!1;return}c==null||c(A),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},D=A=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){A.preventDefault();return}l==null||l(A)},M=u?A=>u(A):void 0,L=A=>{k.current&&(A.stopPropagation(),k.current=!1)},E=A=>{var B,q;const{domNode:O}=g.getState();if(S.current=O==null?void 0:O.getBoundingClientRect(),!S.current)return;const F=A.target===N.current;if(!F&&!!A.target.closest(".nokey")||!e||!(a&&F||t)||A.button!==0||!A.isPrimary)return;(q=(B=A.target)==null?void 0:B.setPointerCapture)==null||q.call(B,A.pointerId),k.current=!1;const{x:H,y:V}=bt(A.nativeEvent,S.current);g.setState({userSelectionRect:{width:0,height:0,startX:H,startY:V,x:H,y:V}}),F||(A.stopPropagation(),A.preventDefault())},I=A=>{const{userSelectionRect:O,transform:F,nodeLookup:G,edgeLookup:Y,connectionLookup:H,triggerNodeChanges:V,triggerEdgeChanges:B,defaultEdgeOptions:q,resetSelectedElements:$}=g.getState();if(!S.current||!O)return;const{x:W,y:U}=bt(A.nativeEvent,S.current),{startX:K,startY:X}=O;if(!k.current){const ne=t?0:o;if(Math.hypot(W-K,U-X)<=ne)return;$(),s==null||s(A)}k.current=!0;const J={startX:K,startY:X,x:W<K?W:K,y:U<X?U:X,width:Math.abs(W-K),height:Math.abs(U-X)},Z=C.current,ee=P.current;C.current=new Set(Mc(G,J,F,n===vo.Partial,!0).map(ne=>ne.id)),P.current=new Set;const ce=(q==null?void 0:q.selectable)??!0;for(const ne of C.current){const xe=H.get(ne);if(xe)for(const{edgeId:de}of xe.values()){const Me=Y.get(de);Me&&(Me.selectable??ce)&&P.current.add(de)}}if(!Sd(Z,C.current)){const ne=ur(G,C.current,!0);V(ne)}if(!Sd(ee,P.current)){const ne=ur(Y,P.current);B(ne)}g.setState({userSelectionRect:J,userSelectionActive:!0,nodesSelectionActive:!1})},R=A=>{var O,F;A.button===0&&((F=(O=A.target)==null?void 0:O.releasePointerCapture)==null||F.call(O,A.pointerId),!y&&A.target===N.current&&g.getState().userSelectionRect&&(T==null||T(A)),g.setState({userSelectionActive:!1,userSelectionRect:null}),k.current&&(i==null||i(A),g.setState({nodesSelectionActive:C.current.size>0})))},z=r===!0||Array.isArray(r)&&r.includes(0);return d.jsxs("div",{className:Ie(["react-flow__pane",{draggable:z,dragging:w,selection:e}]),onClick:j?void 0:ci(T,N),onContextMenu:ci(D,N),onWheel:ci(M,N),onPointerEnter:j?void 0:f,onPointerMove:j?I:h,onPointerUp:j?R:void 0,onPointerDownCapture:j?E:void 0,onClickCapture:j?L:void 0,onPointerLeave:p,ref:N,style:hs,children:[m,d.jsx(I1,{})]})}function Ki({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:a,multiSelectionActive:s,nodeLookup:i,onError:c}=t.getState(),l=i.get(e);if(!l){c==null||c("012",it.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&s)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>{var u;return(u=r==null?void 0:r.current)==null?void 0:u.blur()})):o([e])}function Xh({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:a,nodeClickDistance:s}){const i=Pe(),[c,l]=_.useState(!1),u=_.useRef();return _.useEffect(()=>{u.current=S_({getStoreItems:()=>i.getState(),onNodeMouseDown:f=>{Ki({id:f,store:i,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}})},[]),_.useEffect(()=>{if(!(t||!e.current||!u.current))return u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:o,nodeClickDistance:s}),()=>{var f;(f=u.current)==null||f.destroy()}},[n,r,t,a,e,o,s]),c}const L1=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Kh(){const e=Pe();return _.useCallback(n=>{const{nodeExtent:r,snapToGrid:o,snapGrid:a,nodesDraggable:s,onError:i,updateNodePositions:c,nodeLookup:l,nodeOrigin:u}=e.getState(),f=new Map,h=L1(s),p=o?a[0]:5,m=o?a[1]:5,g=n.direction.x*p*n.factor,y=n.direction.y*m*n.factor;for(const[,v]of l){if(!h(v))continue;let w={x:v.internals.positionAbsolute.x+g,y:v.internals.positionAbsolute.y+y};o&&(w=zo(w,a));const{position:x,positionAbsolute:j}=fh({nodeId:v.id,nextPosition:w,nodeLookup:l,nodeExtent:r,nodeOrigin:u,onError:i});v.position=x,v.internals.positionAbsolute=j,f.set(v.id,v)}c(f)},[])}const Lc=_.createContext(null),W1=Lc.Provider;Lc.Consumer;const Jh=()=>_.useContext(Lc),F1=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),B1=(e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:a,connection:s}=r,{fromHandle:i,toHandle:c,isValid:l}=s,u=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,connectingTo:u,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:a===wr.Strict?(i==null?void 0:i.type)!==n:e!==(i==null?void 0:i.nodeId)||t!==(i==null?void 0:i.id),connectionInProcess:!!i,clickConnectionInProcess:!!o,valid:u&&l}};function H1({type:e="source",position:t=oe.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:a=!0,id:s,onConnect:i,children:c,className:l,onMouseDown:u,onTouchStart:f,...h},p){var I,R;const m=s||null,g=e==="target",y=Pe(),v=Jh(),{connectOnClick:w,noPanClassName:x,rfId:j}=ye(F1,ke),{connectingFrom:N,connectingTo:S,clickConnecting:C,isPossibleEndHandle:P,connectionInProcess:k,clickConnectionInProcess:T,valid:D}=ye(B1(v,m,e),ke);v||(R=(I=y.getState()).onError)==null||R.call(I,"010",it.error010());const M=z=>{const{defaultEdgeOptions:A,onConnect:O,hasDefaultEdges:F}=y.getState(),G={...A,...z};if(F){const{edges:Y,setEdges:H}=y.getState();H(Sh(G,Y))}O==null||O(G),i==null||i(G)},L=z=>{if(!v)return;const A=wh(z.nativeEvent);if(o&&(A&&z.button===0||!A)){const O=y.getState();Ui.onPointerDown(z.nativeEvent,{handleDomNode:z.currentTarget,autoPanOnConnect:O.autoPanOnConnect,connectionMode:O.connectionMode,connectionRadius:O.connectionRadius,domNode:O.domNode,nodeLookup:O.nodeLookup,lib:O.lib,isTarget:g,handleId:m,nodeId:v,flowId:O.rfId,panBy:O.panBy,cancelConnection:O.cancelConnection,onConnectStart:O.onConnectStart,onConnectEnd:(...F)=>{var G,Y;return(Y=(G=y.getState()).onConnectEnd)==null?void 0:Y.call(G,...F)},updateConnection:O.updateConnection,onConnect:M,isValidConnection:n||((...F)=>{var G,Y;return((Y=(G=y.getState()).isValidConnection)==null?void 0:Y.call(G,...F))??!0}),getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,autoPanSpeed:O.autoPanSpeed,dragThreshold:O.connectionDragThreshold})}A?u==null||u(z):f==null||f(z)},E=z=>{const{onClickConnectStart:A,onClickConnectEnd:O,connectionClickStartHandle:F,connectionMode:G,isValidConnection:Y,lib:H,rfId:V,nodeLookup:B,connection:q}=y.getState();if(!v||!F&&!o)return;if(!F){A==null||A(z.nativeEvent,{nodeId:v,handleId:m,handleType:e}),y.setState({connectionClickStartHandle:{nodeId:v,type:e,id:m}});return}const $=vh(z.target),W=n||Y,{connection:U,isValid:K}=Ui.isValid(z.nativeEvent,{handle:{nodeId:v,id:m,type:e},connectionMode:G,fromNodeId:F.nodeId,fromHandleId:F.id||null,fromType:F.type,isValidConnection:W,flowId:V,doc:$,lib:H,nodeLookup:B});K&&U&&M(U);const X=structuredClone(q);delete X.inProgress,X.toPosition=X.toHandle?X.toHandle.position:null,O==null||O(z,X),y.setState({connectionClickStartHandle:null})};return d.jsx("div",{"data-handleid":m,"data-nodeid":v,"data-handlepos":t,"data-id":`${j}-${v}-${m}-${e}`,className:Ie(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,l,{source:!g,target:g,connectable:r,connectablestart:o,connectableend:a,clickconnecting:C,connectingfrom:N,connectingto:S,valid:D,connectionindicator:r&&(!k||P)&&(k||T?a:o)}]),onMouseDown:L,onTouchStart:L,onClick:w?E:void 0,ref:p,...h,children:c})}const Nr=_.memo(Gh(H1));function V1({data:e,isConnectable:t,sourcePosition:n=oe.Bottom}){return d.jsxs(d.Fragment,{children:[e==null?void 0:e.label,d.jsx(Nr,{type:"source",position:n,isConnectable:t})]})}function Y1({data:e,isConnectable:t,targetPosition:n=oe.Top,sourcePosition:r=oe.Bottom}){return d.jsxs(d.Fragment,{children:[d.jsx(Nr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,d.jsx(Nr,{type:"source",position:r,isConnectable:t})]})}function q1(){return null}function G1({data:e,isConnectable:t,targetPosition:n=oe.Top}){return d.jsxs(d.Fragment,{children:[d.jsx(Nr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const La={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},tu={input:V1,default:Y1,output:G1,group:q1};function U1(e){var t,n,r,o;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const X1=e=>{const{width:t,height:n,x:r,y:o}=$o(e.nodeLookup,{filter:a=>!!a.selected});return{width:vt(t)?t:null,height:vt(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function K1({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Pe(),{width:o,height:a,transformString:s,userSelectionActive:i}=ye(X1,ke),c=Kh(),l=_.useRef(null);_.useEffect(()=>{var p;n||(p=l.current)==null||p.focus({preventScroll:!0})},[n]);const u=!i&&o!==null&&a!==null;if(Xh({nodeRef:l,disabled:!u}),!u)return null;const f=e?p=>{const m=r.getState().nodes.filter(g=>g.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(La,p.key)&&(p.preventDefault(),c({direction:La[p.key],factor:p.shiftKey?4:1}))};return d.jsx("div",{className:Ie(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:d.jsx("div",{ref:l,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:o,height:a}})})}const nu=typeof window<"u"?window:void 0,J1=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Zh({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:s,paneClickDistance:i,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:g,zoomActivationKeyCode:y,elementsSelectable:v,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:j,panOnScrollSpeed:N,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:P,defaultViewport:k,translateExtent:T,minZoom:D,maxZoom:M,preventScrolling:L,onSelectionContextMenu:E,noWheelClassName:I,noPanClassName:R,disableKeyboardA11y:z,onViewportChange:A,isControlledViewport:O}){const{nodesSelectionActive:F,userSelectionActive:G}=ye(J1,ke),Y=jo(l,{target:nu}),H=jo(g,{target:nu}),V=H||P,B=H||j,q=u&&V!==!0,$=Y||G||q;return D1({deleteKeyCode:c,multiSelectionKeyCode:m}),d.jsx(A1,{onPaneContextMenu:a,elementsSelectable:v,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:B,panOnScrollSpeed:N,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!Y&&V,defaultViewport:k,translateExtent:T,minZoom:D,maxZoom:M,zoomActivationKeyCode:y,preventScrolling:L,noWheelClassName:I,noPanClassName:R,onViewportChange:A,isControlledViewport:O,paneClickDistance:i,selectionOnDrag:q,children:d.jsxs(z1,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:s,panOnDrag:V,isSelecting:!!$,selectionMode:f,selectionKeyPressed:Y,paneClickDistance:i,selectionOnDrag:q,children:[e,F&&d.jsx(K1,{onSelectionContextMenu:E,noPanClassName:R,disableKeyboardA11y:z})]})})}Zh.displayName="FlowRenderer";const Z1=_.memo(Zh),Q1=e=>t=>e?Mc(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function eS(e){return ye(_.useCallback(Q1(e),[e]),ke)}const tS=e=>e.updateNodeInternals;function nS(){const e=ye(tS),[t]=_.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(o=>{const a=o.target.getAttribute("data-id");r.set(a,{id:a,nodeElement:o.target,force:!0})}),e(r)}));return _.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function rS({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=Pe(),a=_.useRef(null),s=_.useRef(null),i=_.useRef(e.sourcePosition),c=_.useRef(e.targetPosition),l=_.useRef(t),u=n&&!!e.internals.handleBounds;return _.useEffect(()=>{a.current&&!e.hidden&&(!u||s.current!==a.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(a.current),s.current=a.current)},[u,e.hidden]),_.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),_.useEffect(()=>{if(a.current){const f=l.current!==t,h=i.current!==e.sourcePosition,p=c.current!==e.targetPosition;(f||h||p)&&(l.current=t,i.current=e.sourcePosition,c.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function oS({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:a,onDoubleClick:s,nodesDraggable:i,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:m,rfId:g,nodeTypes:y,nodeClickDistance:v,onError:w}){const{node:x,internals:j,isParent:N}=ye(W=>{const U=W.nodeLookup.get(e),K=W.parentLookup.has(e);return{node:U,internals:U.internals,isParent:K}},ke);let S=x.type||"default",C=(y==null?void 0:y[S])||tu[S];C===void 0&&(w==null||w("003",it.error003(S)),S="default",C=(y==null?void 0:y.default)||tu.default);const P=!!(x.draggable||i&&typeof x.draggable>"u"),k=!!(x.selectable||c&&typeof x.selectable>"u"),T=!!(x.connectable||l&&typeof x.connectable>"u"),D=!!(x.focusable||u&&typeof x.focusable>"u"),M=Pe(),L=yh(x),E=rS({node:x,nodeType:S,hasDimensions:L,resizeObserver:f}),I=Xh({nodeRef:E,disabled:x.hidden||!P,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:k,nodeClickDistance:v}),R=Kh();if(x.hidden)return null;const z=dn(x),A=U1(x),O=k||P||t||n||r||o,F=n?W=>n(W,{...j.userNode}):void 0,G=r?W=>r(W,{...j.userNode}):void 0,Y=o?W=>o(W,{...j.userNode}):void 0,H=a?W=>a(W,{...j.userNode}):void 0,V=s?W=>s(W,{...j.userNode}):void 0,B=W=>{const{selectNodesOnDrag:U,nodeDragThreshold:K}=M.getState();k&&(!U||!P||K>0)&&Ki({id:e,store:M,nodeRef:E}),t&&t(W,{...j.userNode})},q=W=>{if(!(bh(W.nativeEvent)||m)){if(ih.includes(W.key)&&k){const U=W.key==="Escape";Ki({id:e,store:M,unselect:U,nodeRef:E})}else if(P&&x.selected&&Object.prototype.hasOwnProperty.call(La,W.key)){W.preventDefault();const{ariaLabelConfig:U}=M.getState();M.setState({ariaLiveMessage:U["node.a11yDescription.ariaLiveMessage"]({direction:W.key.replace("Arrow","").toLowerCase(),x:~~j.positionAbsolute.x,y:~~j.positionAbsolute.y})}),R({direction:La[W.key],factor:W.shiftKey?4:1})}}},$=()=>{var ee;if(m||!((ee=E.current)!=null&&ee.matches(":focus-visible")))return;const{transform:W,width:U,height:K,autoPanOnNodeFocus:X,setCenter:J}=M.getState();if(!X)return;Mc(new Map([[e,x]]),{x:0,y:0,width:U,height:K},W,!0).length>0||J(x.position.x+z.width/2,x.position.y+z.height/2,{zoom:W[2]})};return d.jsx("div",{className:Ie(["react-flow__node",`react-flow__node-${S}`,{[p]:P},x.className,{selected:x.selected,selectable:k,parent:N,draggable:P,dragging:I}]),ref:E,style:{zIndex:j.z,transform:`translate(${j.positionAbsolute.x}px,${j.positionAbsolute.y}px)`,pointerEvents:O?"all":"none",visibility:L?"visible":"hidden",...x.style,...A},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:F,onMouseMove:G,onMouseLeave:Y,onContextMenu:H,onClick:B,onDoubleClick:V,onKeyDown:D?q:void 0,tabIndex:D?0:void 0,onFocus:D?$:void 0,role:x.ariaRole??(D?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${Fh}-${g}`,"aria-label":x.ariaLabel,...x.domAttributes,children:d.jsx(W1,{value:e,children:d.jsx(C,{id:e,data:x.data,type:S,positionAbsoluteX:j.positionAbsolute.x,positionAbsoluteY:j.positionAbsolute.y,selected:x.selected??!1,selectable:k,draggable:P,deletable:x.deletable??!0,isConnectable:T,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:I,dragHandle:x.dragHandle,zIndex:j.z,parentId:x.parentId,...z})})})}var aS=_.memo(oS);const sS=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Qh(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,onError:a}=ye(sS,ke),s=eS(e.onlyRenderVisibleElements),i=nS();return d.jsx("div",{className:"react-flow__nodes",style:hs,children:s.map(c=>d.jsx(aS,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:i,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:a},c))})}Qh.displayName="NodeRenderer";const iS=_.memo(Qh);function cS(e){return ye(_.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const r=[];if(n.width&&n.height)for(const o of n.edges){const a=n.nodeLookup.get(o.source),s=n.nodeLookup.get(o.target);a&&s&&s_({sourceNode:a,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(o.id)}return r},[e]),ke)}const lS=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return d.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},dS=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return d.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},ru={[Ia.Arrow]:lS,[Ia.ArrowClosed]:dS};function uS(e){const t=Pe();return _.useMemo(()=>{var o,a;return Object.prototype.hasOwnProperty.call(ru,e)?ru[e]:((a=(o=t.getState()).onError)==null||a.call(o,"009",it.error009(e)),null)},[e])}const fS=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:a="strokeWidth",strokeWidth:s,orient:i="auto-start-reverse"})=>{const c=uS(t);return c?d.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:i,refX:"0",refY:"0",children:d.jsx(c,{color:n,strokeWidth:s})}):null},ep=({defaultColor:e,rfId:t})=>{const n=ye(a=>a.edges),r=ye(a=>a.defaultEdgeOptions),o=_.useMemo(()=>h_(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return o.length?d.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:d.jsx("defs",{children:o.map(a=>d.jsx(fS,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};ep.displayName="MarkerDefinitions";var hS=_.memo(ep);function tp({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:a,labelBgPadding:s=[2,4],labelBgBorderRadius:i=2,children:c,className:l,...u}){const[f,h]=_.useState({x:1,y:0,width:0,height:0}),p=Ie(["react-flow__edge-textwrapper",l]),m=_.useRef(null);return _.useEffect(()=>{if(m.current){const g=m.current.getBBox();h({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),n?d.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...u,children:[o&&d.jsx("rect",{width:f.width+2*s[0],x:-s[0],y:-s[1],height:f.height+2*s[1],className:"react-flow__edge-textbg",style:a,rx:i,ry:i}),d.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:r,children:n}),c]}):null}tp.displayName="EdgeText";const pS=_.memo(tp);function Fo({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:i,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return d.jsxs(d.Fragment,{children:[d.jsx("path",{...u,d:e,fill:"none",className:Ie(["react-flow__edge-path",u.className])}),l?d.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:l,className:"react-flow__edge-interaction"}):null,r&&vt(t)&&vt(n)?d.jsx(pS,{x:t,y:n,label:r,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:i,labelBgBorderRadius:c}):null]})}function ou({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===oe.Left||e===oe.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function np({sourceX:e,sourceY:t,sourcePosition:n=oe.Bottom,targetX:r,targetY:o,targetPosition:a=oe.Top}){const[s,i]=ou({pos:n,x1:e,y1:t,x2:r,y2:o}),[c,l]=ou({pos:a,x1:r,y1:o,x2:e,y2:t}),[u,f,h,p]=jh({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:i,targetControlX:c,targetControlY:l});return[`M${e},${t} C${s},${i} ${c},${l} ${r},${o}`,u,f,h,p]}function rp(e){return _.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,sourcePosition:s,targetPosition:i,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:y,interactionWidth:v})=>{const[w,x,j]=np({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:a,targetPosition:i}),N=e.isInternal?void 0:t;return d.jsx(Fo,{id:N,path:w,labelX:x,labelY:j,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:y,interactionWidth:v})})}const mS=rp({isInternal:!1}),op=rp({isInternal:!0});mS.displayName="SimpleBezierEdge";op.displayName="SimpleBezierEdgeInternal";function ap(e){return _.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,label:s,labelStyle:i,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:f,style:h,sourcePosition:p=oe.Bottom,targetPosition:m=oe.Top,markerEnd:g,markerStart:y,pathOptions:v,interactionWidth:w})=>{const[x,j,N]=Yi({sourceX:n,sourceY:r,sourcePosition:p,targetX:o,targetY:a,targetPosition:m,borderRadius:v==null?void 0:v.borderRadius,offset:v==null?void 0:v.offset,stepPosition:v==null?void 0:v.stepPosition}),S=e.isInternal?void 0:t;return d.jsx(Fo,{id:S,path:x,labelX:j,labelY:N,label:s,labelStyle:i,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:f,style:h,markerEnd:g,markerStart:y,interactionWidth:w})})}const sp=ap({isInternal:!1}),ip=ap({isInternal:!0});sp.displayName="SmoothStepEdge";ip.displayName="SmoothStepEdgeInternal";function cp(e){return _.memo(({id:t,...n})=>{var o;const r=e.isInternal?void 0:t;return d.jsx(sp,{...n,id:r,pathOptions:_.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const gS=cp({isInternal:!1}),lp=cp({isInternal:!0});gS.displayName="StepEdge";lp.displayName="StepEdgeInternal";function dp(e){return _.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,label:s,labelStyle:i,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:g})=>{const[y,v,w]=Ch({sourceX:n,sourceY:r,targetX:o,targetY:a}),x=e.isInternal?void 0:t;return d.jsx(Fo,{id:x,path:y,labelX:v,labelY:w,label:s,labelStyle:i,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:g})})}const yS=dp({isInternal:!1}),up=dp({isInternal:!0});yS.displayName="StraightEdge";up.displayName="StraightEdgeInternal";function fp(e){return _.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,sourcePosition:s=oe.Bottom,targetPosition:i=oe.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:y,pathOptions:v,interactionWidth:w})=>{const[x,j,N]=Rc({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:a,targetPosition:i,curvature:v==null?void 0:v.curvature}),S=e.isInternal?void 0:t;return d.jsx(Fo,{id:S,path:x,labelX:j,labelY:N,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:y,interactionWidth:w})})}const xS=fp({isInternal:!1}),hp=fp({isInternal:!0});xS.displayName="BezierEdge";hp.displayName="BezierEdgeInternal";const au={default:hp,straight:up,step:lp,smoothstep:ip,simplebezier:op},su={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},vS=(e,t,n)=>n===oe.Left?e-t:n===oe.Right?e+t:e,bS=(e,t,n)=>n===oe.Top?e-t:n===oe.Bottom?e+t:e,iu="react-flow__edgeupdater";function cu({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:a,onMouseOut:s,type:i}){return d.jsx("circle",{onMouseDown:o,onMouseEnter:a,onMouseOut:s,className:Ie([iu,`${iu}-${i}`]),cx:vS(t,r,e),cy:bS(n,r,e),r,stroke:"transparent",fill:"transparent"})}function wS({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:a,targetY:s,sourcePosition:i,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const m=Pe(),g=(j,N)=>{if(j.button!==0)return;const{autoPanOnConnect:S,domNode:C,connectionMode:P,connectionRadius:k,lib:T,onConnectStart:D,cancelConnection:M,nodeLookup:L,rfId:E,panBy:I,updateConnection:R}=m.getState(),z=N.type==="target",A=(G,Y)=>{h(!1),f==null||f(G,n,N.type,Y)},O=G=>l==null?void 0:l(n,G),F=(G,Y)=>{h(!0),u==null||u(j,n,N.type),D==null||D(G,Y)};Ui.onPointerDown(j.nativeEvent,{autoPanOnConnect:S,connectionMode:P,connectionRadius:k,domNode:C,handleId:N.id,nodeId:N.nodeId,nodeLookup:L,isTarget:z,edgeUpdaterType:N.type,lib:T,flowId:E,cancelConnection:M,panBy:I,isValidConnection:(...G)=>{var Y,H;return((H=(Y=m.getState()).isValidConnection)==null?void 0:H.call(Y,...G))??!0},onConnect:O,onConnectStart:F,onConnectEnd:(...G)=>{var Y,H;return(H=(Y=m.getState()).onConnectEnd)==null?void 0:H.call(Y,...G)},onReconnectEnd:A,updateConnection:R,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:j.currentTarget})},y=j=>g(j,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),v=j=>g(j,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>p(!0),x=()=>p(!1);return d.jsxs(d.Fragment,{children:[(e===!0||e==="source")&&d.jsx(cu,{position:i,centerX:r,centerY:o,radius:t,onMouseDown:y,onMouseEnter:w,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&d.jsx(cu,{position:c,centerX:a,centerY:s,radius:t,onMouseDown:v,onMouseEnter:w,onMouseOut:x,type:"target"})]})}function jS({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:a,onContextMenu:s,onMouseEnter:i,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:m,edgeTypes:g,noPanClassName:y,onError:v,disableKeyboardA11y:w}){let x=ye(J=>J.edgeLookup.get(e));const j=ye(J=>J.defaultEdgeOptions);x=j?{...j,...x}:x;let N=x.type||"default",S=(g==null?void 0:g[N])||au[N];S===void 0&&(v==null||v("011",it.error011(N)),N="default",S=(g==null?void 0:g.default)||au.default);const C=!!(x.focusable||t&&typeof x.focusable>"u"),P=typeof f<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),k=!!(x.selectable||r&&typeof x.selectable>"u"),T=_.useRef(null),[D,M]=_.useState(!1),[L,E]=_.useState(!1),I=Pe(),{zIndex:R,sourceX:z,sourceY:A,targetX:O,targetY:F,sourcePosition:G,targetPosition:Y}=ye(_.useCallback(J=>{const Z=J.nodeLookup.get(x.source),ee=J.nodeLookup.get(x.target);if(!Z||!ee)return{zIndex:x.zIndex,...su};const ce=f_({id:e,sourceNode:Z,targetNode:ee,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:J.connectionMode,onError:v});return{zIndex:a_({selected:x.selected,zIndex:x.zIndex,sourceNode:Z,targetNode:ee,elevateOnSelect:J.elevateEdgesOnSelect,zIndexMode:J.zIndexMode}),...ce||su}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),ke),H=_.useMemo(()=>x.markerStart?`url('#${qi(x.markerStart,m)}')`:void 0,[x.markerStart,m]),V=_.useMemo(()=>x.markerEnd?`url('#${qi(x.markerEnd,m)}')`:void 0,[x.markerEnd,m]);if(x.hidden||z===null||A===null||O===null||F===null)return null;const B=J=>{var ne;const{addSelectedEdges:Z,unselectNodesAndEdges:ee,multiSelectionActive:ce}=I.getState();k&&(I.setState({nodesSelectionActive:!1}),x.selected&&ce?(ee({nodes:[],edges:[x]}),(ne=T.current)==null||ne.blur()):Z([e])),o&&o(J,x)},q=a?J=>{a(J,{...x})}:void 0,$=s?J=>{s(J,{...x})}:void 0,W=i?J=>{i(J,{...x})}:void 0,U=c?J=>{c(J,{...x})}:void 0,K=l?J=>{l(J,{...x})}:void 0,X=J=>{var Z;if(!w&&ih.includes(J.key)&&k){const{unselectNodesAndEdges:ee,addSelectedEdges:ce}=I.getState();J.key==="Escape"?((Z=T.current)==null||Z.blur(),ee({edges:[x]})):ce([e])}};return d.jsx("svg",{style:{zIndex:R},children:d.jsxs("g",{className:Ie(["react-flow__edge",`react-flow__edge-${N}`,x.className,y,{selected:x.selected,animated:x.animated,inactive:!k&&!o,updating:D,selectable:k}]),onClick:B,onDoubleClick:q,onContextMenu:$,onMouseEnter:W,onMouseMove:U,onMouseLeave:K,onKeyDown:C?X:void 0,tabIndex:C?0:void 0,role:x.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":C?`${Bh}-${m}`:void 0,ref:T,...x.domAttributes,children:[!L&&d.jsx(S,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:k,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:z,sourceY:A,targetX:O,targetY:F,sourcePosition:G,targetPosition:Y,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:H,markerEnd:V,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),P&&d.jsx(wS,{edge:x,isReconnectable:P,reconnectRadius:u,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:z,sourceY:A,targetX:O,targetY:F,sourcePosition:G,targetPosition:Y,setUpdateHover:M,setReconnecting:E})]})})}var _S=_.memo(jS);const SS=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function pp({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:a,onEdgeContextMenu:s,onEdgeMouseEnter:i,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:g}){const{edgesFocusable:y,edgesReconnectable:v,elementsSelectable:w,onError:x}=ye(SS,ke),j=cS(t);return d.jsxs("div",{className:"react-flow__edges",children:[d.jsx(hS,{defaultColor:e,rfId:n}),j.map(N=>d.jsx(_S,{id:N,edgesFocusable:y,edgesReconnectable:v,elementsSelectable:w,noPanClassName:o,onReconnect:a,onContextMenu:s,onMouseEnter:i,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:x,edgeTypes:r,disableKeyboardA11y:g},N))]})}pp.displayName="EdgeRenderer";const CS=_.memo(pp),NS=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function ES({children:e}){const t=ye(NS);return d.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function kS(e){const t=fs(),n=_.useRef(!1);_.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const PS=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function MS(e){const t=ye(PS),n=Pe();return _.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function DS(e){return e.connection.inProgress?{...e.connection,to:Lo(e.connection.to,e.transform)}:{...e.connection}}function OS(e){return DS}function RS(e){const t=OS();return ye(t,ke)}const AS=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function TS({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:a,height:s,isValid:i,inProgress:c}=ye(AS,ke);return!(a&&o&&c)?null:d.jsx("svg",{style:e,width:a,height:s,className:"react-flow__connectionline react-flow__container",children:d.jsx("g",{className:Ie(["react-flow__connection",dh(i)]),children:d.jsx(mp,{style:t,type:n,CustomComponent:r,isValid:i})})})}const mp=({style:e,type:t=xn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:a,fromNode:s,fromHandle:i,fromPosition:c,to:l,toNode:u,toHandle:f,toPosition:h,pointer:p}=RS();if(!o)return;if(n)return d.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:i,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:h,connectionStatus:dh(r),toNode:u,toHandle:f,pointer:p});let m="";const g={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:h};switch(t){case xn.Bezier:[m]=Rc(g);break;case xn.SimpleBezier:[m]=np(g);break;case xn.Step:[m]=Yi({...g,borderRadius:0});break;case xn.SmoothStep:[m]=Yi(g);break;default:[m]=Ch(g)}return d.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};mp.displayName="ConnectionLine";const IS={};function lu(e=IS){const t=_.useRef(e),n=Pe();_.useEffect(()=>{var r,o;if(process.env.NODE_ENV==="development"){const a=new Set([...Object.keys(t.current),...Object.keys(e)]);for(const s of a)if(t.current[s]!==e[s]){(o=(r=n.getState()).onError)==null||o.call(r,"002",it.error002());break}t.current=e}},[e])}function $S(){const e=Pe(),t=_.useRef(!1);_.useEffect(()=>{var n,r;if(process.env.NODE_ENV==="development"&&!t.current){const o=document.querySelector(".react-flow__pane");o&&window.getComputedStyle(o).zIndex!=="1"&&((r=(n=e.getState()).onError)==null||r.call(n,"013",it.error013("react"))),t.current=!0}},[])}function gp({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:a,onEdgeDoubleClick:s,onNodeMouseEnter:i,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:g,connectionLineComponent:y,connectionLineContainerStyle:v,selectionKeyCode:w,selectionOnDrag:x,selectionMode:j,multiSelectionKeyCode:N,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:P,onlyRenderVisibleElements:k,elementsSelectable:T,defaultViewport:D,translateExtent:M,minZoom:L,maxZoom:E,preventScrolling:I,defaultMarkerColor:R,zoomOnScroll:z,zoomOnPinch:A,panOnScroll:O,panOnScrollSpeed:F,panOnScrollMode:G,zoomOnDoubleClick:Y,panOnDrag:H,onPaneClick:V,onPaneMouseEnter:B,onPaneMouseMove:q,onPaneMouseLeave:$,onPaneScroll:W,onPaneContextMenu:U,paneClickDistance:K,nodeClickDistance:X,onEdgeContextMenu:J,onEdgeMouseEnter:Z,onEdgeMouseMove:ee,onEdgeMouseLeave:ce,reconnectRadius:ne,onReconnect:xe,onReconnectStart:de,onReconnectEnd:Me,noDragClassName:Fe,noWheelClassName:Oe,noPanClassName:Qe,disableKeyboardA11y:Le,nodeExtent:Kt,rfId:Mt,viewport:Ae,onViewportChange:Ue}){return lu(e),lu(t),$S(),kS(n),MS(Ae),d.jsx(Z1,{onPaneClick:V,onPaneMouseEnter:B,onPaneMouseMove:q,onPaneMouseLeave:$,onPaneContextMenu:U,onPaneScroll:W,paneClickDistance:K,deleteKeyCode:P,selectionKeyCode:w,selectionOnDrag:x,selectionMode:j,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:N,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:T,zoomOnScroll:z,zoomOnPinch:A,zoomOnDoubleClick:Y,panOnScroll:O,panOnScrollSpeed:F,panOnScrollMode:G,panOnDrag:H,defaultViewport:D,translateExtent:M,minZoom:L,maxZoom:E,onSelectionContextMenu:f,preventScrolling:I,noDragClassName:Fe,noWheelClassName:Oe,noPanClassName:Qe,disableKeyboardA11y:Le,onViewportChange:Ue,isControlledViewport:!!Ae,children:d.jsxs(ES,{children:[d.jsx(CS,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:s,onReconnect:xe,onReconnectStart:de,onReconnectEnd:Me,onlyRenderVisibleElements:k,onEdgeContextMenu:J,onEdgeMouseEnter:Z,onEdgeMouseMove:ee,onEdgeMouseLeave:ce,reconnectRadius:ne,defaultMarkerColor:R,noPanClassName:Qe,disableKeyboardA11y:Le,rfId:Mt}),d.jsx(TS,{style:g,type:m,component:y,containerStyle:v}),d.jsx("div",{className:"react-flow__edgelabel-renderer"}),d.jsx(iS,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:i,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:X,onlyRenderVisibleElements:k,noPanClassName:Qe,noDragClassName:Fe,disableKeyboardA11y:Le,nodeExtent:Kt,rfId:Mt}),d.jsx("div",{className:"react-flow__viewport-portal"})]})})}gp.displayName="GraphView";const zS=_.memo(gp),du=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:a,fitView:s,fitViewOptions:i,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,m=new Map,g=new Map,y=new Map,v=r??t??[],w=n??e??[],x=u??[0,0],j=f??xo;kh(g,y,v);const N=Gi(w,p,m,{nodeOrigin:x,nodeExtent:j,zIndexMode:h});let S=[0,0,1];if(s&&o&&a){const C=$o(p,{filter:D=>!!((D.width||D.initialWidth)&&(D.height||D.initialHeight))}),{x:P,y:k,zoom:T}=Dc(C,o,a,c,l,(i==null?void 0:i.padding)??.1);S=[P,k,T]}return{rfId:"1",width:o??0,height:a??0,transform:S,nodes:w,nodesInitialized:N,nodeLookup:p,parentLookup:m,edges:v,edgeLookup:y,connectionLookup:g,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:xo,nodeExtent:j,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:wr.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:i,fitViewResolver:null,connection:{...lh},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:gh,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:ch,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},LS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:a,fitView:s,fitViewOptions:i,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:f,zIndexMode:h})=>r1((p,m)=>{async function g(){const{nodeLookup:y,panZoom:v,fitViewOptions:w,fitViewResolver:x,width:j,height:N,minZoom:S,maxZoom:C}=m();v&&(await Zj({nodes:y,width:j,height:N,panZoom:v,minZoom:S,maxZoom:C},w),x==null||x.resolve(!0),p({fitViewResolver:null}))}return{...du({nodes:e,edges:t,width:o,height:a,fitView:s,fitViewOptions:i,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:y=>{const{nodeLookup:v,parentLookup:w,nodeOrigin:x,elevateNodesOnSelect:j,fitViewQueued:N,zIndexMode:S}=m(),C=Gi(y,v,w,{nodeOrigin:x,nodeExtent:f,elevateNodesOnSelect:j,checkEquality:!0,zIndexMode:S});N&&C?(g(),p({nodes:y,nodesInitialized:C,fitViewQueued:!1,fitViewOptions:void 0})):p({nodes:y,nodesInitialized:C})},setEdges:y=>{const{connectionLookup:v,edgeLookup:w}=m();kh(v,w,y),p({edges:y})},setDefaultNodesAndEdges:(y,v)=>{if(y){const{setNodes:w}=m();w(y),p({hasDefaultNodes:!0})}if(v){const{setEdges:w}=m();w(v),p({hasDefaultEdges:!0})}},updateNodeInternals:y=>{const{triggerNodeChanges:v,nodeLookup:w,parentLookup:x,domNode:j,nodeOrigin:N,nodeExtent:S,debug:C,fitViewQueued:P,zIndexMode:k}=m(),{changes:T,updatedInternals:D}=b_(y,w,x,j,N,S,k);D&&(g_(w,x,{nodeOrigin:N,nodeExtent:S,zIndexMode:k}),P?(g(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(T==null?void 0:T.length)>0&&(C&&console.log("React Flow: trigger node changes",T),v==null||v(T)))},updateNodePositions:(y,v=!1)=>{const w=[];let x=[];const{nodeLookup:j,triggerNodeChanges:N,connection:S,updateConnection:C,onNodesChangeMiddlewareMap:P}=m();for(const[k,T]of y){const D=j.get(k),M=!!(D!=null&&D.expandParent&&(D!=null&&D.parentId)&&(T!=null&&T.position)),L={id:k,type:"position",position:M?{x:Math.max(0,T.position.x),y:Math.max(0,T.position.y)}:T.position,dragging:v};if(D&&S.inProgress&&S.fromNode.id===D.id){const E=Bn(D,S.fromHandle,oe.Left,!0);C({...S,from:E})}M&&D.parentId&&w.push({id:k,parentId:D.parentId,rect:{...T.internals.positionAbsolute,width:T.measured.width??0,height:T.measured.height??0}}),x.push(L)}if(w.length>0){const{parentLookup:k,nodeOrigin:T}=m(),D=zc(w,j,k,T);x.push(...D)}for(const k of P.values())x=k(x);N(x)},triggerNodeChanges:y=>{const{onNodesChange:v,setNodes:w,nodes:x,hasDefaultNodes:j,debug:N}=m();if(y!=null&&y.length){if(j){const S=Yh(y,x);w(S)}N&&console.log("React Flow: trigger node changes",y),v==null||v(y)}},triggerEdgeChanges:y=>{const{onEdgesChange:v,setEdges:w,edges:x,hasDefaultEdges:j,debug:N}=m();if(y!=null&&y.length){if(j){const S=qh(y,x);w(S)}N&&console.log("React Flow: trigger edge changes",y),v==null||v(y)}},addSelectedNodes:y=>{const{multiSelectionActive:v,edgeLookup:w,nodeLookup:x,triggerNodeChanges:j,triggerEdgeChanges:N}=m();if(v){const S=y.map(C=>Mn(C,!0));j(S);return}j(ur(x,new Set([...y]),!0)),N(ur(w))},addSelectedEdges:y=>{const{multiSelectionActive:v,edgeLookup:w,nodeLookup:x,triggerNodeChanges:j,triggerEdgeChanges:N}=m();if(v){const S=y.map(C=>Mn(C,!0));N(S);return}N(ur(w,new Set([...y]))),j(ur(x,new Set,!0))},unselectNodesAndEdges:({nodes:y,edges:v}={})=>{const{edges:w,nodes:x,nodeLookup:j,triggerNodeChanges:N,triggerEdgeChanges:S}=m(),C=y||x,P=v||w,k=[];for(const D of C){if(!D.selected)continue;const M=j.get(D.id);M&&(M.selected=!1),k.push(Mn(D.id,!1))}const T=[];for(const D of P)D.selected&&T.push(Mn(D.id,!1));N(k),S(T)},setMinZoom:y=>{const{panZoom:v,maxZoom:w}=m();v==null||v.setScaleExtent([y,w]),p({minZoom:y})},setMaxZoom:y=>{const{panZoom:v,minZoom:w}=m();v==null||v.setScaleExtent([w,y]),p({maxZoom:y})},setTranslateExtent:y=>{var v;(v=m().panZoom)==null||v.setTranslateExtent(y),p({translateExtent:y})},resetSelectedElements:()=>{const{edges:y,nodes:v,triggerNodeChanges:w,triggerEdgeChanges:x,elementsSelectable:j}=m();if(!j)return;const N=v.reduce((C,P)=>P.selected?[...C,Mn(P.id,!1)]:C,[]),S=y.reduce((C,P)=>P.selected?[...C,Mn(P.id,!1)]:C,[]);w(N),x(S)},setNodeExtent:y=>{const{nodes:v,nodeLookup:w,parentLookup:x,nodeOrigin:j,elevateNodesOnSelect:N,nodeExtent:S,zIndexMode:C}=m();y[0][0]===S[0][0]&&y[0][1]===S[0][1]&&y[1][0]===S[1][0]&&y[1][1]===S[1][1]||(Gi(v,w,x,{nodeOrigin:j,nodeExtent:y,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:C}),p({nodeExtent:y}))},panBy:y=>{const{transform:v,width:w,height:x,panZoom:j,translateExtent:N}=m();return w_({delta:y,panZoom:j,transform:v,translateExtent:N,width:w,height:x})},setCenter:async(y,v,w)=>{const{width:x,height:j,maxZoom:N,panZoom:S}=m();if(!S)return Promise.resolve(!1);const C=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:N;return await S.setViewport({x:x/2-y*C,y:j/2-v*C,zoom:C},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{p({connection:{...lh}})},updateConnection:y=>{p({connection:y})},reset:()=>p({...du()})}},Object.is);function yp({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:a,initialMinZoom:s,initialMaxZoom:i,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:f,zIndexMode:h,children:p}){const[m]=_.useState(()=>LS({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:a,fitView:l,minZoom:s,maxZoom:i,fitViewOptions:c,nodeOrigin:u,nodeExtent:f,zIndexMode:h}));return d.jsx(o1,{value:m,children:d.jsx(E1,{children:p})})}function WS({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:a,height:s,fitView:i,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return _.useContext(us)?d.jsx(d.Fragment,{children:e}):d.jsx(yp,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:a,initialHeight:s,fitView:i,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const FS={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function BS({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:a,edgeTypes:s,onNodeClick:i,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:v,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:j,onNodeContextMenu:N,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:P,onNodeDragStop:k,onNodesDelete:T,onEdgesDelete:D,onDelete:M,onSelectionChange:L,onSelectionDragStart:E,onSelectionDrag:I,onSelectionDragStop:R,onSelectionContextMenu:z,onSelectionStart:A,onSelectionEnd:O,onBeforeDelete:F,connectionMode:G,connectionLineType:Y=xn.Bezier,connectionLineStyle:H,connectionLineComponent:V,connectionLineContainerStyle:B,deleteKeyCode:q="Backspace",selectionKeyCode:$="Shift",selectionOnDrag:W=!1,selectionMode:U=vo.Full,panActivationKeyCode:K="Space",multiSelectionKeyCode:X=wo()?"Meta":"Control",zoomActivationKeyCode:J=wo()?"Meta":"Control",snapToGrid:Z,snapGrid:ee,onlyRenderVisibleElements:ce=!1,selectNodesOnDrag:ne,nodesDraggable:xe,autoPanOnNodeFocus:de,nodesConnectable:Me,nodesFocusable:Fe,nodeOrigin:Oe=Hh,edgesFocusable:Qe,edgesReconnectable:Le,elementsSelectable:Kt=!0,defaultViewport:Mt=y1,minZoom:Ae=.5,maxZoom:Ue=2,translateExtent:Kn=xo,preventScrolling:Br=!0,nodeExtent:Dt,defaultMarkerColor:Hr="#b1b1b7",zoomOnScroll:Jn=!0,zoomOnPinch:En=!0,panOnScroll:Ot=!1,panOnScrollSpeed:Zn=.5,panOnScrollMode:Rt=$n.Free,zoomOnDoubleClick:Qn=!0,panOnDrag:Vr=!0,onPaneClick:kn,onPaneMouseEnter:le,onPaneMouseMove:ve,onPaneMouseLeave:ae,onPaneScroll:ue,onPaneContextMenu:Be,paneClickDistance:Q=1,nodeClickDistance:be=0,children:Se,onReconnect:qe,onReconnectStart:He,onReconnectEnd:Xe,onEdgeContextMenu:Jt,onEdgeDoubleClick:et,onEdgeMouseEnter:At,onEdgeMouseMove:Ov,onEdgeMouseLeave:Rv,reconnectRadius:Av=10,onNodesChange:Tv,onEdgesChange:Iv,noDragClassName:$v="nodrag",noWheelClassName:zv="nowheel",noPanClassName:Xl="nopan",fitView:Kl,fitViewOptions:Jl,connectOnClick:Lv,attributionPosition:Wv,proOptions:Fv,defaultEdgeOptions:Bv,elevateNodesOnSelect:Hv=!0,elevateEdgesOnSelect:Vv=!1,disableKeyboardA11y:Zl=!1,autoPanOnConnect:Yv,autoPanOnNodeDrag:qv,autoPanSpeed:Gv,connectionRadius:Uv,isValidConnection:Xv,onError:Kv,style:Jv,id:Ql,nodeDragThreshold:Zv,connectionDragThreshold:Qv,viewport:eb,onViewportChange:tb,width:nb,height:rb,colorMode:ob="light",debug:ab,onScroll:Qo,ariaLabelConfig:sb,zIndexMode:ed="basic",...ib},cb){const Ks=Ql||"1",lb=w1(ob),db=_.useCallback(td=>{td.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Qo==null||Qo(td)},[Qo]);return d.jsx("div",{"data-testid":"rf__wrapper",...ib,onScroll:db,style:{...Jv,...FS},ref:cb,className:Ie(["react-flow",o,lb]),id:Ql,role:"application",children:d.jsxs(WS,{nodes:e,edges:t,width:nb,height:rb,fitView:Kl,fitViewOptions:Jl,minZoom:Ae,maxZoom:Ue,nodeOrigin:Oe,nodeExtent:Dt,zIndexMode:ed,children:[d.jsx(zS,{onInit:l,onNodeClick:i,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:j,onNodeContextMenu:N,onNodeDoubleClick:S,nodeTypes:a,edgeTypes:s,connectionLineType:Y,connectionLineStyle:H,connectionLineComponent:V,connectionLineContainerStyle:B,selectionKeyCode:$,selectionOnDrag:W,selectionMode:U,deleteKeyCode:q,multiSelectionKeyCode:X,panActivationKeyCode:K,zoomActivationKeyCode:J,onlyRenderVisibleElements:ce,defaultViewport:Mt,translateExtent:Kn,minZoom:Ae,maxZoom:Ue,preventScrolling:Br,zoomOnScroll:Jn,zoomOnPinch:En,zoomOnDoubleClick:Qn,panOnScroll:Ot,panOnScrollSpeed:Zn,panOnScrollMode:Rt,panOnDrag:Vr,onPaneClick:kn,onPaneMouseEnter:le,onPaneMouseMove:ve,onPaneMouseLeave:ae,onPaneScroll:ue,onPaneContextMenu:Be,paneClickDistance:Q,nodeClickDistance:be,onSelectionContextMenu:z,onSelectionStart:A,onSelectionEnd:O,onReconnect:qe,onReconnectStart:He,onReconnectEnd:Xe,onEdgeContextMenu:Jt,onEdgeDoubleClick:et,onEdgeMouseEnter:At,onEdgeMouseMove:Ov,onEdgeMouseLeave:Rv,reconnectRadius:Av,defaultMarkerColor:Hr,noDragClassName:$v,noWheelClassName:zv,noPanClassName:Xl,rfId:Ks,disableKeyboardA11y:Zl,nodeExtent:Dt,viewport:eb,onViewportChange:tb}),d.jsx(b1,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:v,nodesDraggable:xe,autoPanOnNodeFocus:de,nodesConnectable:Me,nodesFocusable:Fe,edgesFocusable:Qe,edgesReconnectable:Le,elementsSelectable:Kt,elevateNodesOnSelect:Hv,elevateEdgesOnSelect:Vv,minZoom:Ae,maxZoom:Ue,nodeExtent:Dt,onNodesChange:Tv,onEdgesChange:Iv,snapToGrid:Z,snapGrid:ee,connectionMode:G,translateExtent:Kn,connectOnClick:Lv,defaultEdgeOptions:Bv,fitView:Kl,fitViewOptions:Jl,onNodesDelete:T,onEdgesDelete:D,onDelete:M,onNodeDragStart:C,onNodeDrag:P,onNodeDragStop:k,onSelectionDrag:I,onSelectionDragStart:E,onSelectionDragStop:R,onMove:u,onMoveStart:f,onMoveEnd:h,noPanClassName:Xl,nodeOrigin:Oe,rfId:Ks,autoPanOnConnect:Yv,autoPanOnNodeDrag:qv,autoPanSpeed:Gv,onError:Kv,connectionRadius:Uv,isValidConnection:Xv,selectNodesOnDrag:ne,nodeDragThreshold:Zv,connectionDragThreshold:Qv,onBeforeDelete:F,debug:ab,ariaLabelConfig:sb,zIndexMode:ed}),d.jsx(g1,{onSelectionChange:L}),Se,d.jsx(u1,{proOptions:Fv,position:Wv}),d.jsx(d1,{rfId:Ks,disableKeyboardA11y:Zl})]})})}var HS=Gh(BS);const VS=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function YS({children:e}){const t=ye(VS);return t?ts.createPortal(e,t):null}function qS({dimensions:e,lineWidth:t,variant:n,className:r}){return d.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ie(["react-flow__background-pattern",n,r])})}function GS({radius:e,className:t}){return d.jsx("circle",{cx:e,cy:e,r:e,className:Ie(["react-flow__background-pattern","dots",t])})}var bn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(bn||(bn={}));const US={[bn.Dots]:1,[bn.Lines]:1,[bn.Cross]:6},XS=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function xp({id:e,variant:t=bn.Dots,gap:n=20,size:r,lineWidth:o=1,offset:a=0,color:s,bgColor:i,style:c,className:l,patternClassName:u}){const f=_.useRef(null),{transform:h,patternId:p}=ye(XS,ke),m=r||US[t],g=t===bn.Dots,y=t===bn.Cross,v=Array.isArray(n)?n:[n,n],w=[v[0]*h[2]||1,v[1]*h[2]||1],x=m*h[2],j=Array.isArray(a)?a:[a,a],N=y?[x,x]:w,S=[j[0]*h[2]||1+N[0]/2,j[1]*h[2]||1+N[1]/2],C=`${p}${e||""}`;return d.jsxs("svg",{className:Ie(["react-flow__background",l]),style:{...c,...hs,"--xy-background-color-props":i,"--xy-background-pattern-color-props":s},ref:f,"data-testid":"rf__background",children:[d.jsx("pattern",{id:C,x:h[0]%w[0],y:h[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:g?d.jsx(GS,{radius:x/2,className:u}):d.jsx(qS,{dimensions:N,lineWidth:o,variant:t,className:u})}),d.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}xp.displayName="Background";const KS=_.memo(xp);function JS(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:d.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function ZS(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:d.jsx("path",{d:"M0 0h32v4.2H0z"})})}function QS(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:d.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function eC(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function tC(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function la({children:e,className:t,...n}){return d.jsx("button",{type:"button",className:Ie(["react-flow__controls-button",t]),...n,children:e})}const nC=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function vp({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:a,onZoomOut:s,onFitView:i,onInteractiveChange:c,className:l,children:u,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const m=Pe(),{isInteractive:g,minZoomReached:y,maxZoomReached:v,ariaLabelConfig:w}=ye(nC,ke),{zoomIn:x,zoomOut:j,fitView:N}=fs(),S=()=>{x(),a==null||a()},C=()=>{j(),s==null||s()},P=()=>{N(o),i==null||i()},k=()=>{m.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),c==null||c(!g)},T=h==="horizontal"?"horizontal":"vertical";return d.jsxs(Wo,{className:Ie(["react-flow__controls",T,l]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??w["controls.ariaLabel"],children:[t&&d.jsxs(d.Fragment,{children:[d.jsx(la,{onClick:S,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:v,children:d.jsx(JS,{})}),d.jsx(la,{onClick:C,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:y,children:d.jsx(ZS,{})})]}),n&&d.jsx(la,{className:"react-flow__controls-fitview",onClick:P,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:d.jsx(QS,{})}),r&&d.jsx(la,{className:"react-flow__controls-interactive",onClick:k,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:g?d.jsx(tC,{}):d.jsx(eC,{})}),u]})}vp.displayName="Controls";const rC=_.memo(vp);function oC({id:e,x:t,y:n,width:r,height:o,style:a,color:s,strokeColor:i,strokeWidth:c,className:l,borderRadius:u,shapeRendering:f,selected:h,onClick:p}){const{background:m,backgroundColor:g}=a||{},y=s||m||g;return d.jsx("rect",{className:Ie(["react-flow__minimap-node",{selected:h},l]),x:t,y:n,rx:u,ry:u,width:r,height:o,style:{fill:y,stroke:i,strokeWidth:c},shapeRendering:f,onClick:p?v=>p(v,e):void 0})}const aC=_.memo(oC),sC=e=>e.nodes.map(t=>t.id),li=e=>e instanceof Function?e:()=>e;function iC({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:a=aC,onClick:s}){const i=ye(sC,ke),c=li(t),l=li(e),u=li(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return d.jsx(d.Fragment,{children:i.map(h=>d.jsx(lC,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:a,onClick:s,shapeRendering:f},h))})}function cC({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:a,shapeRendering:s,NodeComponent:i,onClick:c}){const{node:l,x:u,y:f,width:h,height:p}=ye(m=>{const g=m.nodeLookup.get(e);if(!g)return{node:void 0,x:0,y:0,width:0,height:0};const y=g.internals.userNode,{x:v,y:w}=g.internals.positionAbsolute,{width:x,height:j}=dn(y);return{node:y,x:v,y:w,width:x,height:j}},ke);return!l||l.hidden||!yh(l)?null:d.jsx(i,{x:u,y:f,width:h,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:o,strokeColor:n(l),strokeWidth:a,shapeRendering:s,onClick:c,id:l.id})}const lC=_.memo(cC);var dC=_.memo(iC);const uC=200,fC=150,hC=e=>!e.hidden,pC=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?mh($o(e.nodeLookup,{filter:hC}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},mC="react-flow__minimap-desc";function bp({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:a=5,nodeStrokeWidth:s,nodeComponent:i,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:m,pannable:g=!1,zoomable:y=!1,ariaLabel:v,inversePan:w,zoomStep:x=1,offsetScale:j=5}){const N=Pe(),S=_.useRef(null),{boundingRect:C,viewBB:P,rfId:k,panZoom:T,translateExtent:D,flowWidth:M,flowHeight:L,ariaLabelConfig:E}=ye(pC,ke),I=(e==null?void 0:e.width)??uC,R=(e==null?void 0:e.height)??fC,z=C.width/I,A=C.height/R,O=Math.max(z,A),F=O*I,G=O*R,Y=j*O,H=C.x-(F-C.width)/2-Y,V=C.y-(G-C.height)/2-Y,B=F+Y*2,q=G+Y*2,$=`${mC}-${k}`,W=_.useRef(0),U=_.useRef();W.current=O,_.useEffect(()=>{if(S.current&&T)return U.current=M_({domNode:S.current,panZoom:T,getTransform:()=>N.getState().transform,getViewScale:()=>W.current}),()=>{var Z;(Z=U.current)==null||Z.destroy()}},[T]),_.useEffect(()=>{var Z;(Z=U.current)==null||Z.update({translateExtent:D,width:M,height:L,inversePan:w,pannable:g,zoomStep:x,zoomable:y})},[g,y,w,x,D,M,L]);const K=p?Z=>{var ne;const[ee,ce]=((ne=U.current)==null?void 0:ne.pointer(Z))||[0,0];p(Z,{x:ee,y:ce})}:void 0,X=m?_.useCallback((Z,ee)=>{const ce=N.getState().nodeLookup.get(ee).internals.userNode;m(Z,ce)},[]):void 0,J=v??E["minimap.ariaLabel"];return d.jsx(Wo,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*O:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:Ie(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:d.jsxs("svg",{width:I,height:R,viewBox:`${H} ${V} ${B} ${q}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":$,ref:S,onClick:K,children:[J&&d.jsx("title",{id:$,children:J}),d.jsx(dC,{onClick:X,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:i}),d.jsx("path",{className:"react-flow__minimap-mask",d:`M${H-Y},${V-Y}h${B+Y*2}v${q+Y*2}h${-B-Y*2}z
|
|
40
|
+
M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}bp.displayName="MiniMap";const gC=_.memo(bp),yC=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,xC={[Cr.Line]:"right",[Cr.Handle]:"bottom-right"};function vC({nodeId:e,position:t,variant:n=Cr.Handle,className:r,style:o=void 0,children:a,color:s,minWidth:i=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:p=!0,shouldResize:m,onResizeStart:g,onResize:y,onResizeEnd:v}){const w=Jh(),x=typeof e=="string"?e:w,j=Pe(),N=_.useRef(null),S=n===Cr.Handle,C=ye(_.useCallback(yC(S&&p),[S,p]),ke),P=_.useRef(null),k=t??xC[n];_.useEffect(()=>{if(!(!N.current||!x))return P.current||(P.current=V_({domNode:N.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:D,transform:M,snapGrid:L,snapToGrid:E,nodeOrigin:I,domNode:R}=j.getState();return{nodeLookup:D,transform:M,snapGrid:L,snapToGrid:E,nodeOrigin:I,paneDomNode:R}},onChange:(D,M)=>{const{triggerNodeChanges:L,nodeLookup:E,parentLookup:I,nodeOrigin:R}=j.getState(),z=[],A={x:D.x,y:D.y},O=E.get(x);if(O&&O.expandParent&&O.parentId){const F=O.origin??R,G=D.width??O.measured.width??0,Y=D.height??O.measured.height??0,H={id:O.id,parentId:O.parentId,rect:{width:G,height:Y,...xh({x:D.x??O.position.x,y:D.y??O.position.y},{width:G,height:Y},O.parentId,E,F)}},V=zc([H],E,I,R);z.push(...V),A.x=D.x?Math.max(F[0]*G,D.x):void 0,A.y=D.y?Math.max(F[1]*Y,D.y):void 0}if(A.x!==void 0&&A.y!==void 0){const F={id:x,type:"position",position:{...A}};z.push(F)}if(D.width!==void 0&&D.height!==void 0){const G={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:D.width,height:D.height}};z.push(G)}for(const F of M){const G={...F,type:"position"};z.push(G)}L(z)},onEnd:({width:D,height:M})=>{const L={id:x,type:"dimensions",resizing:!1,dimensions:{width:D,height:M}};j.getState().triggerNodeChanges([L])}})),P.current.update({controlPosition:k,boundaries:{minWidth:i,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:f,resizeDirection:h,onResizeStart:g,onResize:y,onResizeEnd:v,shouldResize:m}),()=>{var D;(D=P.current)==null||D.destroy()}},[k,i,c,l,u,f,g,y,v,m]);const T=k.split("-");return d.jsx("div",{className:Ie(["react-flow__resize-control","nodrag",...T,n,r]),ref:N,style:{...o,scale:C,...s&&{[S?"backgroundColor":"borderColor"]:s}},children:a})}_.memo(vC);var wp={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Y_,function(){Array.isArray||(Array.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]"});function n(a){for(var s=[],i=0,c=a.length;i<c;i++)s.indexOf(a[i])===-1&&s.push(a[i]);return s}var r={},o={"==":function(a,s){return a==s},"===":function(a,s){return a===s},"!=":function(a,s){return a!=s},"!==":function(a,s){return a!==s},">":function(a,s){return a>s},">=":function(a,s){return a>=s},"<":function(a,s,i){return i===void 0?a<s:a<s&&s<i},"<=":function(a,s,i){return i===void 0?a<=s:a<=s&&s<=i},"!!":function(a){return r.truthy(a)},"!":function(a){return!r.truthy(a)},"%":function(a,s){return a%s},log:function(a){return console.log(a),a},in:function(a,s){return!s||typeof s.indexOf>"u"?!1:s.indexOf(a)!==-1},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(a,s,i){if(i<0){var c=String(a).substr(s);return c.substr(0,c.length+i)}return String(a).substr(s,i)},"+":function(){return Array.prototype.reduce.call(arguments,function(a,s){return parseFloat(a,10)+parseFloat(s,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(a,s){return parseFloat(a,10)*parseFloat(s,10)})},"-":function(a,s){return s===void 0?-a:a-s},"/":function(a,s){return a/s},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,function(a,s){return a.concat(s)},[])},var:function(a,s){var i=s===void 0?null:s,c=this;if(typeof a>"u"||a===""||a===null)return c;for(var l=String(a).split("."),u=0;u<l.length;u++)if(c==null||(c=c[l[u]],c===void 0))return i;return c},missing:function(){for(var a=[],s=Array.isArray(arguments[0])?arguments[0]:arguments,i=0;i<s.length;i++){var c=s[i],l=r.apply({var:c},this);(l===null||l==="")&&a.push(c)}return a},missing_some:function(a,s){var i=r.apply({missing:s},this);return s.length-i.length>=a?[]:i}};return r.is_logic=function(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)&&Object.keys(a).length===1},r.truthy=function(a){return Array.isArray(a)&&a.length===0?!1:!!a},r.get_operator=function(a){return Object.keys(a)[0]},r.get_values=function(a){return a[r.get_operator(a)]},r.apply=function(a,s){if(Array.isArray(a))return a.map(function(y){return r.apply(y,s)});if(!r.is_logic(a))return a;var i=r.get_operator(a),c=a[i],l,u,f,h,p;if(Array.isArray(c)||(c=[c]),i==="if"||i=="?:"){for(l=0;l<c.length-1;l+=2)if(r.truthy(r.apply(c[l],s)))return r.apply(c[l+1],s);return c.length===l+1?r.apply(c[l],s):null}else if(i==="and"){for(l=0;l<c.length;l+=1)if(u=r.apply(c[l],s),!r.truthy(u))return u;return u}else if(i==="or"){for(l=0;l<c.length;l+=1)if(u=r.apply(c[l],s),r.truthy(u))return u;return u}else{if(i==="filter")return h=r.apply(c[0],s),f=c[1],Array.isArray(h)?h.filter(function(y){return r.truthy(r.apply(f,y))}):[];if(i==="map")return h=r.apply(c[0],s),f=c[1],Array.isArray(h)?h.map(function(y){return r.apply(f,y)}):[];if(i==="reduce")return h=r.apply(c[0],s),f=c[1],p=typeof c[2]<"u"?r.apply(c[2],s):null,Array.isArray(h)?h.reduce(function(y,v){return r.apply(f,{current:v,accumulator:y})},p):p;if(i==="all"){if(h=r.apply(c[0],s),f=c[1],!Array.isArray(h)||!h.length)return!1;for(l=0;l<h.length;l+=1)if(!r.truthy(r.apply(f,h[l])))return!1;return!0}else if(i==="none"){if(h=r.apply(c[0],s),f=c[1],!Array.isArray(h)||!h.length)return!0;for(l=0;l<h.length;l+=1)if(r.truthy(r.apply(f,h[l])))return!1;return!0}else if(i==="some"){if(h=r.apply(c[0],s),f=c[1],!Array.isArray(h)||!h.length)return!1;for(l=0;l<h.length;l+=1)if(r.truthy(r.apply(f,h[l])))return!0;return!1}}if(c=c.map(function(y){return r.apply(y,s)}),o.hasOwnProperty(i)&&typeof o[i]=="function")return o[i].apply(s,c);if(i.indexOf(".")>0){var m=String(i).split("."),g=o;for(l=0;l<m.length;l++){if(!g.hasOwnProperty(m[l]))throw new Error("Unrecognized operation "+i+" (failed at "+m.slice(0,l+1).join(".")+")");g=g[m[l]]}return g.apply(s,c)}throw new Error("Unrecognized operation "+i)},r.uses_data=function(a){var s=[];if(r.is_logic(a)){var i=r.get_operator(a),c=a[i];Array.isArray(c)||(c=[c]),i==="var"?s.push(c[0]):c.forEach(function(l){s.push.apply(s,r.uses_data(l))})}return n(s)},r.add_operation=function(a,s){o[a]=s},r.rm_operation=function(a){delete o[a]},r.rule_like=function(a,s){if(s===a||s==="@")return!0;if(s==="number")return typeof a=="number";if(s==="string")return typeof a=="string";if(s==="array")return Array.isArray(a)&&!r.is_logic(a);if(r.is_logic(s)){if(r.is_logic(a)){var i=r.get_operator(s),c=r.get_operator(a);if(i==="@"||i===c)return r.rule_like(r.get_values(a,!1),r.get_values(s,!1))}return!1}if(Array.isArray(s))if(Array.isArray(a)){if(s.length!==a.length)return!1;for(var l=0;l<s.length;l+=1)if(!r.rule_like(a[l],s[l]))return!1;return!0}else return!1;return!1},r})})(wp);var bC=wp.exports;const Wa=$h(bC),$e=pb((e,t)=>({nodes:[],edges:[],selectedNodeId:null,selectedEdgeId:null,previewAnswers:{},previewCurrentNodeId:null,previewPath:[],isPreviewActive:!1,isDirty:!1,markClean:()=>e({isDirty:!1}),_history:[],_future:[],_clipboard:null,_pushSnapshot:()=>{const{nodes:n,edges:r,_history:o}=t(),a={nodes:JSON.parse(JSON.stringify(n)),edges:JSON.parse(JSON.stringify(r))};e({_history:[...o.slice(-50),a],_future:[],isDirty:!0})},undo:()=>{const{_history:n,nodes:r,edges:o}=t();if(n.length===0)return;const a=n[n.length-1],s={nodes:JSON.parse(JSON.stringify(r)),edges:JSON.parse(JSON.stringify(o))};e({nodes:a.nodes,edges:a.edges,_history:n.slice(0,-1),_future:[...t()._future,s],selectedNodeId:null,selectedEdgeId:null})},redo:()=>{const{_future:n,nodes:r,edges:o}=t();if(n.length===0)return;const a=n[n.length-1],s={nodes:JSON.parse(JSON.stringify(r)),edges:JSON.parse(JSON.stringify(o))};e({nodes:a.nodes,edges:a.edges,_history:[...t()._history,s],_future:n.slice(0,-1),selectedNodeId:null,selectedEdgeId:null})},canUndo:()=>t()._history.length>0,canRedo:()=>t()._future.length>0,copySelectedNodes:()=>{const{selectedNodeId:n,nodes:r}=t();if(!n)return;const o=r.find(a=>a.id===n);o&&e({_clipboard:[JSON.parse(JSON.stringify(o))]})},pasteNodes:()=>{var o;const{_clipboard:n}=t();if(!n||n.length===0)return;t()._pushSnapshot();const r=n.map(a=>{const s=`node_${a.data.namespace}_${Date.now()}`;return{...a,id:s,position:{x:a.position.x+40,y:a.position.y+40},selected:!1}});e({nodes:[...t().nodes,...r],selectedNodeId:((o=r[0])==null?void 0:o.id)||null,selectedEdgeId:null})},duplicateSelectedNode:()=>{const{selectedNodeId:n,nodes:r}=t();if(!n)return;const o=r.find(i=>i.id===n);if(!o)return;t()._pushSnapshot();const a=`node_${o.data.namespace}_${Date.now()}`,s={...JSON.parse(JSON.stringify(o)),id:a,position:{x:o.position.x+40,y:o.position.y+40},selected:!1};e({nodes:[...t().nodes,s],selectedNodeId:a,selectedEdgeId:null})},deleteSelected:()=>{const{selectedNodeId:n,selectedEdgeId:r}=t();n?(t()._pushSnapshot(),t().deleteNode(n)):r&&(t()._pushSnapshot(),t().deleteEdge(r))},onNodesChange:n=>{e({nodes:Yh(n,t().nodes)})},onEdgesChange:n=>{e({edges:qh(n,t().edges)})},onConnect:n=>{t()._pushSnapshot();const r={...n,id:`edge_${n.source}_${n.target}`,type:"conditional",source:n.source||"",target:n.target||"",data:{condition:null,priority:0,isDefault:!1}};e({edges:Sh(r,t().edges)})},addNodeFromSpec:(n,r)=>{t()._pushSnapshot();const o=`node_${n.namespace}_${Date.now()}`,a={id:o,type:"questionNode",position:r,data:{specId:n.id,namespace:n.namespace,label:n.label,schema:n.schema,options:n.options,actor:"customer",bindings:[{target_namespace:n.namespace}],required:!1}};e({nodes:[...t().nodes,a],selectedNodeId:o,selectedEdgeId:null})},addCustomNode:(n,r)=>{t()._pushSnapshot();const o=`node_custom_${Date.now()}`,a={id:o,type:"questionNode",position:r,data:{specId:"custom",namespace:n.namespace,label:n.label,schema:n.schema,options:n.options,actor:"customer",bindings:n.bindings.map(s=>({target_namespace:s.target_namespace})),required:!1}};e({nodes:[...t().nodes,a],selectedNodeId:o,selectedEdgeId:null})},updateNodeData:(n,r)=>{t()._pushSnapshot(),e({nodes:t().nodes.map(o=>o.id===n?{...o,data:{...o.data,...r}}:o)})},deleteNode:n=>{e({nodes:t().nodes.filter(r=>r.id!==n),edges:t().edges.filter(r=>r.source!==n&&r.target!==n),selectedNodeId:t().selectedNodeId===n?null:t().selectedNodeId})},updateEdgeData:(n,r)=>{t()._pushSnapshot(),e({edges:t().edges.map(o=>o.id===n?{...o,data:{...o.data,...r}}:o)})},createEdgesForOptions:n=>{const{nodes:r,edges:o}=t(),a=r.find(s=>s.id===n);!a||a.data.options},deleteEdge:n=>{e({edges:t().edges.filter(r=>r.id!==n),selectedEdgeId:t().selectedEdgeId===n?null:t().selectedEdgeId})},setSelectedNode:n=>{e({selectedNodeId:n,selectedEdgeId:null})},setSelectedEdge:n=>{e({selectedEdgeId:n,selectedNodeId:null})},clearSelection:()=>{e({selectedNodeId:null,selectedEdgeId:null})},importJourneySpec:n=>{t()._pushSnapshot();const r=n.nodes.map(a=>{var s;return{id:a.node_id,type:"questionNode",position:a.layout?{x:a.layout.x,y:a.layout.y}:{x:0,y:0},data:{specId:a.source_property_spec_id||"custom",namespace:a.question_key,label:a.label_override||a.question_key,labelOverride:a.label_override,schema:a.schema||"v1_string",options:a.options||null,actor:a.actor||"customer",bindings:a.bindings||[{target_namespace:a.question_key}],widget:(s=a.ui)==null?void 0:s.widget,required:a.required||!1,uploadConfig:a.upload_config}}}),o=n.edges.map(a=>({id:a.edge_id,source:a.from_node_id,target:a.to_node_id,type:"conditional",data:{condition:a.condition||null,priority:a.priority||0,isDefault:a.is_default||!1}}));e({nodes:r,edges:o,selectedNodeId:null,selectedEdgeId:null,previewAnswers:{},previewCurrentNodeId:null,previewPath:[],isPreviewActive:!1,isDirty:!1})},exportJourneySpec:()=>{var c;const{nodes:n,edges:r}=t(),o=n.map(l=>({node_id:l.id,question_key:l.data.namespace,source_property_spec_id:l.data.specId,schema:l.data.schema,options:l.data.options,actor:l.data.actor,bindings:l.data.bindings,ui:{widget:l.data.widget||"auto"},layout:{x:l.position.x,y:l.position.y},required:l.data.required,label:l.data.label,...l.data.labelOverride&&{label_override:l.data.labelOverride},...l.data.uploadConfig&&{upload_config:l.data.uploadConfig}})),a=r.map(l=>{var u,f,h;return{edge_id:l.id,from_node_id:l.source,to_node_id:l.target,condition:((u=l.data)==null?void 0:u.condition)||null,priority:((f=l.data)==null?void 0:f.priority)||0,is_default:((h=l.data)==null?void 0:h.isDefault)||!1}}),s=new Set(r.map(l=>l.target)),i=n.find(l=>!s.has(l.id));return{journey_id:`journey_${Date.now()}`,claimspec_id:(c=n[0])!=null&&c.data.specId?"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1":"",version:"0.1.0",nodes:o,edges:a,start_node_id:(i==null?void 0:i.id)||null}},setPreviewAnswer:(n,r)=>{e({previewAnswers:{...t().previewAnswers,[n]:r}})},startPreview:()=>{const{nodes:n,edges:r}=t();if(n.length===0)return;const o=new Set(r.map(s=>s.target)),a=n.find(s=>!o.has(s.id));a&&e({previewAnswers:{},previewCurrentNodeId:a.id,previewPath:[a.id],isPreviewActive:!0,selectedNodeId:a.id,selectedEdgeId:null})},resetPreview:()=>{e({previewAnswers:{},previewCurrentNodeId:null,previewPath:[],isPreviewActive:!1})},navigatePreview:n=>{var h,p;const{nodes:r,edges:o,previewCurrentNodeId:a,previewPath:s,previewAnswers:i}=t();if(!a)return null;if(n==="back"){if(s.length<=1)return null;const m=s.slice(0,-1),g=m[m.length-1];return e({previewPath:m,previewCurrentNodeId:g,selectedNodeId:g}),g}const c=o.filter(m=>m.source===a);if(c.length===0)return null;const l=[...c].sort((m,g)=>{var y,v;return(((y=g.data)==null?void 0:y.priority)||0)-(((v=m.data)==null?void 0:v.priority)||0)});let u=null,f=null;for(const m of l){if((h=m.data)!=null&&h.isDefault){f=m;continue}if((p=m.data)!=null&&p.condition)try{if(Wa.apply(m.data.condition,{answers:i})){u=m.target;break}}catch(g){console.error("Error evaluating edge condition:",g)}else{u=m.target;break}}return!u&&f&&(u=f.target),!u&&l.length===1&&(u=l[0].target),u?(e({previewPath:[...s,u],previewCurrentNodeId:u,selectedNodeId:u}),u):null}})),Ji={back:"Back",next:"Next",reset:"Reset",cancel:"Cancel",submit:"Submit",save:"Save",delete:"Delete",close:"Close",empty:"(empty)",path:"Path",unknown:"Unknown",runner_title:"Form Runner",runner_save_exit:"Save & Exit",runner_ready_title:"Ready to begin",runner_question_count:"This form has {{count}} question{{plural}}.",runner_start_form:"Start Form",runner_review_title:"Review Your Answers",runner_no_answers:"No answers recorded.",runner_review:"Review",runner_step:"Step {{step}}",runner_no_journey:"No journey has been built yet.",runner_no_data:"No journey data available.",builder_title:"Journey Builder",builder_read_only:"Read Only",builder_publish:"Publish",builder_unlock_edit:"Unlock Edit",builder_open_runner:"Open Runner",builder_auto_layout:"Auto Layout",builder_export_json:"Export JSON",builder_export_copied:"Journey spec copied to clipboard",specs_title:"Property Specs",specs_search_placeholder:"Search specs...",specs_filter_all:"All Types",specs_create_custom:"Create Custom Field",specs_count:"{{filtered}} of {{total}} specs",specs_no_results:"No specs found",props_select_hint:"Select a node or edge to edit",props_drag_hint:"Drag specs from the left panel onto the canvas to create nodes",node_props_title:"Node Properties",node_schema_type:"Schema Type",node_source_spec:"Source Spec ID",node_namespace:"Namespace",node_required:"Required",node_required_hint:"Block navigation if empty",node_original_label:"Original Label",node_label_override:"Label Override (optional)",node_label_override_placeholder:"Custom label to display…",node_actor:"Actor",node_actor_customer:"Customer",node_actor_operator:"Operator",node_widget:"Widget Override",node_widget_auto:"Auto (from schema)",node_widget_text:"Text Input",node_widget_textarea:"Textarea",node_widget_select:"Select Dropdown",node_widget_radio:"Radio Group",node_widget_datepicker:"Date Picker",node_widget_currency:"Currency Input",node_widget_upload:"File Upload",node_widget_email:"Email",node_widget_phone:"Phone",node_bindings_title:"Bindings",node_bindings_target:"Target Namespace",node_bindings_add:"Add Binding",node_delete:"Delete Node",node_options_title:"Options",upload_config_title:"Upload Configuration",upload_file_type_preset:"File type preset",upload_any_file:"Any file",upload_images_only:"Images only",upload_documents_only:"Documents only",upload_images_pdf:"Images + PDFs",upload_custom:"Custom",upload_accepted_types:"Accepted types (custom)",upload_accepted_types_placeholder:"e.g. image/*,.pdf",upload_max_size:"Max file size (MB)",upload_max_size_placeholder:"e.g. 10",edge_props_title:"Edge Properties",edge_connection:"Connection",edge_default:"Default Edge",edge_default_hint:"Used when no other conditions match",edge_priority:"Priority",edge_priority_hint:"Higher priority edges are evaluated first",edge_quick_pick:"Quick pick from source options:",edge_condition:"Condition",edge_visual:"Visual",edge_advanced:"Advanced",edge_json_logic:"JSON Logic condition",edge_delete:"Delete Edge",preview_title:"Form Preview",preview_step_of:"Step {{current}} of {{total}}",preview_start:"Start Preview",preview_add_nodes_hint:"Add nodes to the canvas to preview the form flow.",preview_start_hint:'Click "Start Preview" to test the form flow interactively.',preview_no_node:"No current node selected.",preview_required_hint:"This field is required",preview_validation_hint:"Fix validation errors first",import_title:"Import Journey Spec",import_description:"Load a JourneySpec JSON file or paste JSON to populate the canvas.",import_paste_tab:"Paste JSON",import_upload_tab:"Upload File",import_paste_clipboard:"Paste from Clipboard",import_placeholder:'{"journey_id": "...", "nodes": [...], "edges": [...]}',import_button:"Import Journey",import_validation_errors:"Validation errors:",validation_title:"Graph Validation",validation_no_issues:"No issues found",validation_issue_count:"{{count}} issue{{plural}} found",validation_good:"Graph looks good!",validation_no_issues_actor:"No issues",validation_validate:"Validate",create_node_title:"Create Custom Field",create_node_label:"Label *",create_node_label_placeholder:"Enter a display label",create_node_namespace:"Namespace",create_node_namespace_hint:"Auto-generated from label. Override if needed.",create_node_schema:"Schema Type",upload_drag_drop:"Drag & drop a file here, or click to select",upload_uploading:"Uploading…",widget_unknown_schema:"Unknown schema type: {{schema}}",widget_no_widget:"No widget available for this field type.",widget_no_options:"No options configured for this select field.",not_found_title:"404",not_found_message:"Oops! Page not found",not_found_link:"Return to Home",runner_page_back:"Builder"},wC={back:"Atrás",next:"Siguiente",reset:"Reiniciar",cancel:"Cancelar",submit:"Enviar",save:"Guardar",delete:"Eliminar",close:"Cerrar",empty:"(vacío)",path:"Ruta",unknown:"Desconocido",runner_title:"Formulario",runner_save_exit:"Guardar y Salir",runner_ready_title:"Listo para comenzar",runner_question_count:"Este formulario tiene {{count}} pregunta{{plural}}.",runner_start_form:"Iniciar Formulario",runner_review_title:"Revisa tus respuestas",runner_no_answers:"No hay respuestas registradas.",runner_review:"Revisar",runner_step:"Paso {{step}}",runner_no_journey:"Aún no se ha creado ningún recorrido.",runner_no_data:"Datos del recorrido no disponibles.",builder_title:"Constructor de Recorridos",builder_read_only:"Solo Lectura",builder_publish:"Publicar",builder_unlock_edit:"Desbloquear Edición",builder_open_runner:"Abrir Formulario",builder_auto_layout:"Diseño Automático",builder_export_json:"Exportar JSON",builder_export_copied:"Especificación copiada al portapapeles",specs_title:"Propiedades",specs_search_placeholder:"Buscar...",specs_filter_all:"Todos los Tipos",specs_create_custom:"Crear Campo Personalizado",specs_count:"{{filtered}} de {{total}} propiedades",specs_no_results:"No se encontraron propiedades",props_select_hint:"Selecciona un nodo o arista para editar",props_drag_hint:"Arrastra propiedades del panel izquierdo al lienzo para crear nodos",node_props_title:"Propiedades del Nodo",node_schema_type:"Tipo de Schema",node_source_spec:"ID de Propiedad",node_namespace:"Namespace",node_required:"Obligatorio",node_required_hint:"Bloquear navegación si está vacío",node_original_label:"Etiqueta Original",node_label_override:"Etiqueta Personalizada (opcional)",node_label_override_placeholder:"Etiqueta personalizada…",node_actor:"Actor",node_actor_customer:"Cliente",node_actor_operator:"Operador",node_widget:"Widget",node_widget_auto:"Automático (del schema)",node_widget_text:"Campo de Texto",node_widget_textarea:"Área de Texto",node_widget_select:"Lista Desplegable",node_widget_radio:"Grupo de Radio",node_widget_datepicker:"Selector de Fecha",node_widget_currency:"Campo Monetario",node_widget_upload:"Carga de Archivo",node_widget_email:"Email",node_widget_phone:"Teléfono",node_bindings_title:"Bindings",node_bindings_target:"Namespace Destino",node_bindings_add:"Agregar Binding",node_delete:"Eliminar Nodo",node_options_title:"Opciones",upload_config_title:"Configuración de Carga",upload_file_type_preset:"Tipo de archivo",upload_any_file:"Cualquier archivo",upload_images_only:"Solo imágenes",upload_documents_only:"Solo documentos",upload_images_pdf:"Imágenes + PDFs",upload_custom:"Personalizado",upload_accepted_types:"Tipos aceptados (personalizado)",upload_accepted_types_placeholder:"ej: image/*,.pdf",upload_max_size:"Tamaño máximo (MB)",upload_max_size_placeholder:"ej: 10",edge_props_title:"Propiedades de la Arista",edge_connection:"Conexión",edge_default:"Arista Predeterminada",edge_default_hint:"Se usa cuando ninguna otra condición coincide",edge_priority:"Prioridad",edge_priority_hint:"Las aristas con mayor prioridad se evalúan primero",edge_quick_pick:"Selección rápida de opciones:",edge_condition:"Condición",edge_visual:"Visual",edge_advanced:"Avanzado",edge_json_logic:"Condición JSON Logic",edge_delete:"Eliminar Arista",preview_title:"Vista Previa",preview_step_of:"Paso {{current}} de {{total}}",preview_start:"Iniciar Vista Previa",preview_add_nodes_hint:"Agrega nodos al lienzo para previsualizar el flujo.",preview_start_hint:'Haz clic en "Iniciar Vista Previa" para probar el flujo interactivamente.',preview_no_node:"Ningún nodo seleccionado.",preview_required_hint:"Este campo es obligatorio",preview_validation_hint:"Corrige los errores de validación primero",import_title:"Importar Especificación",import_description:"Carga un archivo JSON o pega el JSON para poblar el lienzo.",import_paste_tab:"Pegar JSON",import_upload_tab:"Cargar Archivo",import_paste_clipboard:"Pegar del Portapapeles",import_placeholder:'{"journey_id": "...", "nodes": [...], "edges": [...]}',import_button:"Importar",import_validation_errors:"Errores de validación:",validation_title:"Validación del Grafo",validation_no_issues:"Sin problemas encontrados",validation_issue_count:"{{count}} problema{{plural}} encontrado{{plural}}",validation_good:"¡El grafo está correcto!",validation_no_issues_actor:"Sin problemas",validation_validate:"Validar",create_node_title:"Crear Campo Personalizado",create_node_label:"Etiqueta *",create_node_label_placeholder:"Ingresa una etiqueta",create_node_namespace:"Namespace",create_node_namespace_hint:"Generado automáticamente a partir de la etiqueta.",create_node_schema:"Tipo de Schema",upload_drag_drop:"Arrastra y suelta un archivo aquí, o haz clic para seleccionar",upload_uploading:"Cargando…",widget_unknown_schema:"Tipo de schema desconocido: {{schema}}",widget_no_widget:"No hay widget disponible para este tipo de campo.",widget_no_options:"No hay opciones configuradas para este campo de selección.",not_found_title:"404",not_found_message:"Página no encontrada",not_found_link:"Volver al Inicio",runner_page_back:"Constructor"},jC={back:"Voltar",next:"Seguinte",reset:"Reiniciar",cancel:"Cancelar",submit:"Submeter",save:"Guardar",delete:"Eliminar",close:"Fechar",empty:"(vazio)",path:"Caminho",unknown:"Desconhecido",runner_title:"Formulário",runner_save_exit:"Guardar e Sair",runner_ready_title:"Pronto para começar",runner_question_count:"Este formulário tem {{count}} pergunta{{plural}}.",runner_start_form:"Iniciar Formulário",runner_review_title:"Reveja as suas respostas",runner_no_answers:"Nenhuma resposta registada.",runner_review:"Rever",runner_step:"Passo {{step}}",runner_no_journey:"Ainda não foi criado nenhum percurso.",runner_no_data:"Dados do percurso indisponíveis.",builder_title:"Construtor de Percursos",builder_read_only:"Só Leitura",builder_publish:"Publicar",builder_unlock_edit:"Desbloquear Edição",builder_open_runner:"Abrir Formulário",builder_auto_layout:"Disposição Auto",builder_export_json:"Exportar JSON",builder_export_copied:"Especificação copiada para a área de transferência",specs_title:"Propriedades",specs_search_placeholder:"Pesquisar...",specs_filter_all:"Todos os Tipos",specs_create_custom:"Criar Campo Personalizado",specs_count:"{{filtered}} de {{total}} propriedades",specs_no_results:"Nenhuma propriedade encontrada",props_select_hint:"Selecione um nó ou aresta para editar",props_drag_hint:"Arraste propriedades do painel esquerdo para a tela para criar nós",node_props_title:"Propriedades do Nó",node_schema_type:"Tipo de Schema",node_source_spec:"ID da Propriedade",node_namespace:"Namespace",node_required:"Obrigatório",node_required_hint:"Bloquear navegação se vazio",node_original_label:"Etiqueta Original",node_label_override:"Etiqueta Personalizada (opcional)",node_label_override_placeholder:"Etiqueta personalizada…",node_actor:"Ator",node_actor_customer:"Cliente",node_actor_operator:"Operador",node_widget:"Widget",node_widget_auto:"Automático (do schema)",node_widget_text:"Campo de Texto",node_widget_textarea:"Área de Texto",node_widget_select:"Lista Suspensa",node_widget_radio:"Grupo de Rádio",node_widget_datepicker:"Seletor de Data",node_widget_currency:"Campo Monetário",node_widget_upload:"Carregamento de Ficheiro",node_widget_email:"Email",node_widget_phone:"Telefone",node_bindings_title:"Bindings",node_bindings_target:"Namespace Destino",node_bindings_add:"Adicionar Binding",node_delete:"Eliminar Nó",node_options_title:"Opções",upload_config_title:"Configuração de Upload",upload_file_type_preset:"Tipo de ficheiro",upload_any_file:"Qualquer ficheiro",upload_images_only:"Apenas imagens",upload_documents_only:"Apenas documentos",upload_images_pdf:"Imagens + PDFs",upload_custom:"Personalizado",upload_accepted_types:"Tipos aceites (personalizado)",upload_accepted_types_placeholder:"ex: image/*,.pdf",upload_max_size:"Tamanho máximo (MB)",upload_max_size_placeholder:"ex: 10",edge_props_title:"Propriedades da Aresta",edge_connection:"Ligação",edge_default:"Aresta Padrão",edge_default_hint:"Usada quando nenhuma outra condição coincide",edge_priority:"Prioridade",edge_priority_hint:"Arestas com maior prioridade são avaliadas primeiro",edge_quick_pick:"Seleção rápida das opções:",edge_condition:"Condição",edge_visual:"Visual",edge_advanced:"Avançado",edge_json_logic:"Condição JSON Logic",edge_delete:"Eliminar Aresta",preview_title:"Pré-visualização",preview_step_of:"Passo {{current}} de {{total}}",preview_start:"Iniciar Pré-visualização",preview_add_nodes_hint:"Adicione nós à tela para pré-visualizar o fluxo.",preview_start_hint:'Clique em "Iniciar Pré-visualização" para testar o fluxo interativamente.',preview_no_node:"Nenhum nó selecionado.",preview_required_hint:"Este campo é obrigatório",preview_validation_hint:"Corrija os erros de validação primeiro",import_title:"Importar Especificação",import_description:"Carregue um ficheiro JSON ou cole o JSON para popular a tela.",import_paste_tab:"Colar JSON",import_upload_tab:"Carregar Ficheiro",import_paste_clipboard:"Colar da Área de Transferência",import_placeholder:'{"journey_id": "...", "nodes": [...], "edges": [...]}',import_button:"Importar",import_validation_errors:"Erros de validação:",validation_title:"Validação do Grafo",validation_no_issues:"Sem problemas encontrados",validation_issue_count:"{{count}} problema{{plural}} encontrado{{plural}}",validation_good:"O grafo está correto!",validation_no_issues_actor:"Sem problemas",validation_validate:"Validar",create_node_title:"Criar Campo Personalizado",create_node_label:"Etiqueta *",create_node_label_placeholder:"Introduza uma etiqueta",create_node_namespace:"Namespace",create_node_namespace_hint:"Gerado automaticamente a partir da etiqueta.",create_node_schema:"Tipo de Schema",upload_drag_drop:"Arraste e largue um ficheiro aqui, ou clique para selecionar",upload_uploading:"A carregar…",widget_unknown_schema:"Tipo de schema desconhecido: {{schema}}",widget_no_widget:"Nenhum widget disponível para este tipo de campo.",widget_no_options:"Nenhuma opção configurada para este campo de seleção.",not_found_title:"404",not_found_message:"Página não encontrada",not_found_link:"Voltar ao Início",runner_page_back:"Construtor"},uu={en:Ji,es:wC,pt:jC},Wc="language",_o="pt";function _C(){try{return localStorage.getItem(Wc)||_o}catch{return _o}}let ho=[],Fc=_C();function SC(e){return ho.push(e),()=>{ho=ho.filter(t=>t!==e)}}function CC(){return Fc}function jp(e){try{localStorage.setItem(Wc,e)}catch{}Fc=e,ho.forEach(t=>t())}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Wc&&(Fc=e.newValue||_o,ho.forEach(t=>t()))});function dt(){const e=_.useSyncExternalStore(SC,CC,()=>_o),t=uu[e]||uu[_o]||Ji;return{t:_.useCallback((r,o)=>{let a=t[r]??Ji[r]??r;if(o)for(const[s,i]of Object.entries(o))a=a.replace(new RegExp(`\\{\\{${s}\\}\\}`,"g"),String(i));return a},[t]),language:e,setLanguage:jp}}var NC=e=>{switch(e){case"success":return PC;case"info":return DC;case"warning":return MC;case"error":return OC;default:return null}},EC=Array(12).fill(0),kC=({visible:e,className:t})=>_.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},_.createElement("div",{className:"sonner-spinner"},EC.map((n,r)=>_.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),PC=_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),MC=_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},_.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),DC=_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),OC=_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),RC=_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},_.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),_.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),AC=()=>{let[e,t]=_.useState(document.hidden);return _.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Zi=1,TC=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Zi++,a=this.toasts.find(i=>i.id===o),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(i=>i.id===o?(this.publish({...i,...e,id:o,title:n}),{...i,...e,id:o,dismissible:s,title:n}):i):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0,a,s=r.then(async c=>{if(a=["resolve",c],_.isValidElement(c))o=!1,this.create({id:n,type:"default",message:c});else if($C(c)&&!c.ok){o=!1;let l=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:l,description:u})}else if(t.success!==void 0){o=!1;let l=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:l,description:u})}}).catch(async c=>{if(a=["reject",c],t.error!==void 0){o=!1;let l=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:l,description:u})}}).finally(()=>{var c;o&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),i=()=>new Promise((c,l)=>s.then(()=>a[0]==="reject"?l(a[1]):c(a[1])).catch(l));return typeof n!="string"&&typeof n!="number"?{unwrap:i}:Object.assign(n,{unwrap:i})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Zi++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ke=new TC,IC=(e,t)=>{let n=(t==null?void 0:t.id)||Zi++;return Ke.addToast({title:e,...t,id:n}),n},$C=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",zC=IC,LC=()=>Ke.toasts,WC=()=>Ke.getActiveToasts(),$t=Object.assign(zC,{success:Ke.success,info:Ke.info,warning:Ke.warning,error:Ke.error,custom:Ke.custom,message:Ke.message,promise:Ke.promise,dismiss:Ke.dismiss,loading:Ke.loading},{getHistory:LC,getToasts:WC});function FC(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}FC(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
41
|
+
`);function da(e){return e.label!==void 0}var BC=3,HC="32px",VC="16px",fu=4e3,YC=356,qC=14,GC=20,UC=200;function ht(...e){return e.filter(Boolean).join(" ")}function XC(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var KC=e=>{var t,n,r,o,a,s,i,c,l,u,f;let{invert:h,toast:p,unstyled:m,interacting:g,setHeights:y,visibleToasts:v,heights:w,index:x,toasts:j,expanded:N,removeToast:S,defaultRichColors:C,closeButton:P,style:k,cancelButtonStyle:T,actionButtonStyle:D,className:M="",descriptionClassName:L="",duration:E,position:I,gap:R,loadingIcon:z,expandByDefault:A,classNames:O,icons:F,closeButtonAriaLabel:G="Close toast",pauseWhenPageIsHidden:Y}=e,[H,V]=_.useState(null),[B,q]=_.useState(null),[$,W]=_.useState(!1),[U,K]=_.useState(!1),[X,J]=_.useState(!1),[Z,ee]=_.useState(!1),[ce,ne]=_.useState(!1),[xe,de]=_.useState(0),[Me,Fe]=_.useState(0),Oe=_.useRef(p.duration||E||fu),Qe=_.useRef(null),Le=_.useRef(null),Kt=x===0,Mt=x+1<=v,Ae=p.type,Ue=p.dismissible!==!1,Kn=p.className||"",Br=p.descriptionClassName||"",Dt=_.useMemo(()=>w.findIndex(Q=>Q.toastId===p.id)||0,[w,p.id]),Hr=_.useMemo(()=>{var Q;return(Q=p.closeButton)!=null?Q:P},[p.closeButton,P]),Jn=_.useMemo(()=>p.duration||E||fu,[p.duration,E]),En=_.useRef(0),Ot=_.useRef(0),Zn=_.useRef(0),Rt=_.useRef(null),[Qn,Vr]=I.split("-"),kn=_.useMemo(()=>w.reduce((Q,be,Se)=>Se>=Dt?Q:Q+be.height,0),[w,Dt]),le=AC(),ve=p.invert||h,ae=Ae==="loading";Ot.current=_.useMemo(()=>Dt*R+kn,[Dt,kn]),_.useEffect(()=>{Oe.current=Jn},[Jn]),_.useEffect(()=>{W(!0)},[]),_.useEffect(()=>{let Q=Le.current;if(Q){let be=Q.getBoundingClientRect().height;return Fe(be),y(Se=>[{toastId:p.id,height:be,position:p.position},...Se]),()=>y(Se=>Se.filter(qe=>qe.toastId!==p.id))}},[y,p.id]),_.useLayoutEffect(()=>{if(!$)return;let Q=Le.current,be=Q.style.height;Q.style.height="auto";let Se=Q.getBoundingClientRect().height;Q.style.height=be,Fe(Se),y(qe=>qe.find(He=>He.toastId===p.id)?qe.map(He=>He.toastId===p.id?{...He,height:Se}:He):[{toastId:p.id,height:Se,position:p.position},...qe])},[$,p.title,p.description,y,p.id]);let ue=_.useCallback(()=>{K(!0),de(Ot.current),y(Q=>Q.filter(be=>be.toastId!==p.id)),setTimeout(()=>{S(p)},UC)},[p,S,y,Ot]);_.useEffect(()=>{if(p.promise&&Ae==="loading"||p.duration===1/0||p.type==="loading")return;let Q;return N||g||Y&&le?(()=>{if(Zn.current<En.current){let be=new Date().getTime()-En.current;Oe.current=Oe.current-be}Zn.current=new Date().getTime()})():Oe.current!==1/0&&(En.current=new Date().getTime(),Q=setTimeout(()=>{var be;(be=p.onAutoClose)==null||be.call(p,p),ue()},Oe.current)),()=>clearTimeout(Q)},[N,g,p,Ae,Y,le,ue]),_.useEffect(()=>{p.delete&&ue()},[ue,p.delete]);function Be(){var Q,be,Se;return F!=null&&F.loading?_.createElement("div",{className:ht(O==null?void 0:O.loader,(Q=p==null?void 0:p.classNames)==null?void 0:Q.loader,"sonner-loader"),"data-visible":Ae==="loading"},F.loading):z?_.createElement("div",{className:ht(O==null?void 0:O.loader,(be=p==null?void 0:p.classNames)==null?void 0:be.loader,"sonner-loader"),"data-visible":Ae==="loading"},z):_.createElement(kC,{className:ht(O==null?void 0:O.loader,(Se=p==null?void 0:p.classNames)==null?void 0:Se.loader),visible:Ae==="loading"})}return _.createElement("li",{tabIndex:0,ref:Le,className:ht(M,Kn,O==null?void 0:O.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,O==null?void 0:O.default,O==null?void 0:O[Ae],(n=p==null?void 0:p.classNames)==null?void 0:n[Ae]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:C,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":$,"data-promise":!!p.promise,"data-swiped":ce,"data-removed":U,"data-visible":Mt,"data-y-position":Qn,"data-x-position":Vr,"data-index":x,"data-front":Kt,"data-swiping":X,"data-dismissible":Ue,"data-type":Ae,"data-invert":ve,"data-swipe-out":Z,"data-swipe-direction":B,"data-expanded":!!(N||A&&$),style:{"--index":x,"--toasts-before":x,"--z-index":j.length-x,"--offset":`${U?xe:Ot.current}px`,"--initial-height":A?"auto":`${Me}px`,...k,...p.style},onDragEnd:()=>{J(!1),V(null),Rt.current=null},onPointerDown:Q=>{ae||!Ue||(Qe.current=new Date,de(Ot.current),Q.target.setPointerCapture(Q.pointerId),Q.target.tagName!=="BUTTON"&&(J(!0),Rt.current={x:Q.clientX,y:Q.clientY}))},onPointerUp:()=>{var Q,be,Se,qe;if(Z||!Ue)return;Rt.current=null;let He=Number(((Q=Le.current)==null?void 0:Q.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Xe=Number(((be=Le.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Jt=new Date().getTime()-((Se=Qe.current)==null?void 0:Se.getTime()),et=H==="x"?He:Xe,At=Math.abs(et)/Jt;if(Math.abs(et)>=GC||At>.11){de(Ot.current),(qe=p.onDismiss)==null||qe.call(p,p),q(H==="x"?He>0?"right":"left":Xe>0?"down":"up"),ue(),ee(!0),ne(!1);return}J(!1),V(null)},onPointerMove:Q=>{var be,Se,qe,He;if(!Rt.current||!Ue||((be=window.getSelection())==null?void 0:be.toString().length)>0)return;let Xe=Q.clientY-Rt.current.y,Jt=Q.clientX-Rt.current.x,et=(Se=e.swipeDirections)!=null?Se:XC(I);!H&&(Math.abs(Jt)>1||Math.abs(Xe)>1)&&V(Math.abs(Jt)>Math.abs(Xe)?"x":"y");let At={x:0,y:0};H==="y"?(et.includes("top")||et.includes("bottom"))&&(et.includes("top")&&Xe<0||et.includes("bottom")&&Xe>0)&&(At.y=Xe):H==="x"&&(et.includes("left")||et.includes("right"))&&(et.includes("left")&&Jt<0||et.includes("right")&&Jt>0)&&(At.x=Jt),(Math.abs(At.x)>0||Math.abs(At.y)>0)&&ne(!0),(qe=Le.current)==null||qe.style.setProperty("--swipe-amount-x",`${At.x}px`),(He=Le.current)==null||He.style.setProperty("--swipe-amount-y",`${At.y}px`)}},Hr&&!p.jsx?_.createElement("button",{"aria-label":G,"data-disabled":ae,"data-close-button":!0,onClick:ae||!Ue?()=>{}:()=>{var Q;ue(),(Q=p.onDismiss)==null||Q.call(p,p)},className:ht(O==null?void 0:O.closeButton,(o=p==null?void 0:p.classNames)==null?void 0:o.closeButton)},(a=F==null?void 0:F.close)!=null?a:RC):null,p.jsx||_.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:_.createElement(_.Fragment,null,Ae||p.icon||p.promise?_.createElement("div",{"data-icon":"",className:ht(O==null?void 0:O.icon,(s=p==null?void 0:p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Be():null,p.type!=="loading"?p.icon||(F==null?void 0:F[Ae])||NC(Ae):null):null,_.createElement("div",{"data-content":"",className:ht(O==null?void 0:O.content,(i=p==null?void 0:p.classNames)==null?void 0:i.content)},_.createElement("div",{"data-title":"",className:ht(O==null?void 0:O.title,(c=p==null?void 0:p.classNames)==null?void 0:c.title)},typeof p.title=="function"?p.title():p.title),p.description?_.createElement("div",{"data-description":"",className:ht(L,Br,O==null?void 0:O.description,(l=p==null?void 0:p.classNames)==null?void 0:l.description)},typeof p.description=="function"?p.description():p.description):null),_.isValidElement(p.cancel)?p.cancel:p.cancel&&da(p.cancel)?_.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||T,onClick:Q=>{var be,Se;da(p.cancel)&&Ue&&((Se=(be=p.cancel).onClick)==null||Se.call(be,Q),ue())},className:ht(O==null?void 0:O.cancelButton,(u=p==null?void 0:p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,_.isValidElement(p.action)?p.action:p.action&&da(p.action)?_.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||D,onClick:Q=>{var be,Se;da(p.action)&&((Se=(be=p.action).onClick)==null||Se.call(be,Q),!Q.defaultPrevented&&ue())},className:ht(O==null?void 0:O.actionButton,(f=p==null?void 0:p.classNames)==null?void 0:f.actionButton)},p.action.label):null))};function hu(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function JC(e,t){let n={};return[e,t].forEach((r,o)=>{let a=o===1,s=a?"--mobile-offset":"--offset",i=a?VC:HC;function c(l){["top","right","bottom","left"].forEach(u=>{n[`${s}-${u}`]=typeof l=="number"?`${l}px`:l})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(l=>{r[l]===void 0?n[`${s}-${l}`]=i:n[`${s}-${l}`]=typeof r[l]=="number"?`${r[l]}px`:r[l]}):c(i)}),n}_.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:a,closeButton:s,className:i,offset:c,mobileOffset:l,theme:u="light",richColors:f,duration:h,style:p,visibleToasts:m=BC,toastOptions:g,dir:y=hu(),gap:v=qC,loadingIcon:w,icons:x,containerAriaLabel:j="Notifications",pauseWhenPageIsHidden:N}=e,[S,C]=_.useState([]),P=_.useMemo(()=>Array.from(new Set([r].concat(S.filter(Y=>Y.position).map(Y=>Y.position)))),[S,r]),[k,T]=_.useState([]),[D,M]=_.useState(!1),[L,E]=_.useState(!1),[I,R]=_.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=_.useRef(null),A=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=_.useRef(null),F=_.useRef(!1),G=_.useCallback(Y=>{C(H=>{var V;return(V=H.find(B=>B.id===Y.id))!=null&&V.delete||Ke.dismiss(Y.id),H.filter(({id:B})=>B!==Y.id)})},[]);return _.useEffect(()=>Ke.subscribe(Y=>{if(Y.dismiss){C(H=>H.map(V=>V.id===Y.id?{...V,delete:!0}:V));return}setTimeout(()=>{ts.flushSync(()=>{C(H=>{let V=H.findIndex(B=>B.id===Y.id);return V!==-1?[...H.slice(0,V),{...H[V],...Y},...H.slice(V+1)]:[Y,...H]})})})}),[]),_.useEffect(()=>{if(u!=="system"){R(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?R("dark"):R("light")),typeof window>"u")return;let Y=window.matchMedia("(prefers-color-scheme: dark)");try{Y.addEventListener("change",({matches:H})=>{R(H?"dark":"light")})}catch{Y.addListener(({matches:V})=>{try{R(V?"dark":"light")}catch(B){console.error(B)}})}},[u]),_.useEffect(()=>{S.length<=1&&M(!1)},[S]),_.useEffect(()=>{let Y=H=>{var V,B;o.every(q=>H[q]||H.code===q)&&(M(!0),(V=z.current)==null||V.focus()),H.code==="Escape"&&(document.activeElement===z.current||(B=z.current)!=null&&B.contains(document.activeElement))&&M(!1)};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[o]),_.useEffect(()=>{if(z.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,F.current=!1)}},[z.current]),_.createElement("section",{ref:t,"aria-label":`${j} ${A}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((Y,H)=>{var V;let[B,q]=Y.split("-");return S.length?_.createElement("ol",{key:Y,dir:y==="auto"?hu():y,tabIndex:-1,ref:z,className:i,"data-sonner-toaster":!0,"data-theme":I,"data-y-position":B,"data-lifted":D&&S.length>1&&!a,"data-x-position":q,style:{"--front-toast-height":`${((V=k[0])==null?void 0:V.height)||0}px`,"--width":`${YC}px`,"--gap":`${v}px`,...p,...JC(c,l)},onBlur:$=>{F.current&&!$.currentTarget.contains($.relatedTarget)&&(F.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:$=>{$.target instanceof HTMLElement&&$.target.dataset.dismissible==="false"||F.current||(F.current=!0,O.current=$.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{L||M(!1)},onDragEnd:()=>M(!1),onPointerDown:$=>{$.target instanceof HTMLElement&&$.target.dataset.dismissible==="false"||E(!0)},onPointerUp:()=>E(!1)},S.filter($=>!$.position&&H===0||$.position===Y).map(($,W)=>{var U,K;return _.createElement(KC,{key:$.id,icons:x,index:W,toast:$,defaultRichColors:f,duration:(U=g==null?void 0:g.duration)!=null?U:h,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:m,closeButton:(K=g==null?void 0:g.closeButton)!=null?K:s,interacting:L,position:Y,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:G,toasts:S.filter(X=>X.position==$.position),heights:k.filter(X=>X.position==$.position),setHeights:T,expandByDefault:a,gap:v,loadingIcon:w,expanded:D,pauseWhenPageIsHidden:N,swipeDirections:e.swipeDirections})})):null}))});function ZC(){const e=_.useCallback(t=>{const n=t.target,r=n.tagName.toLowerCase();if(r==="input"||r==="textarea"||r==="select"||n.isContentEditable)return;const o=t.metaKey||t.ctrlKey,a=$e.getState();if(t.key==="Delete"||t.key==="Backspace"){(a.selectedNodeId||a.selectedEdgeId)&&(t.preventDefault(),a.deleteSelected(),$t.success("Deleted"));return}if(o&&t.key==="z"&&!t.shiftKey){t.preventDefault(),a.canUndo()&&(a.undo(),$t("Undo",{duration:1500}));return}if(o&&(t.key==="y"||t.key==="z"&&t.shiftKey||t.key==="Z"&&t.shiftKey)){t.preventDefault(),a.canRedo()&&(a.redo(),$t("Redo",{duration:1500}));return}if(o&&t.key==="c"){a.selectedNodeId&&(t.preventDefault(),a.copySelectedNodes(),$t.success("Copied to clipboard",{duration:1500}));return}if(o&&t.key==="v"){a._clipboard&&(t.preventDefault(),a.pasteNodes(),$t.success("Pasted",{duration:1500}));return}if(o&&t.key==="d"){a.selectedNodeId&&(t.preventDefault(),a.duplicateSelectedNode(),$t.success("Duplicated",{duration:1500}));return}},[]);_.useEffect(()=>(window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)),[e])}const Bc={v1_string:{label:"String",color:"cj-bg-blue-500"},"v2_single_option_select-1":{label:"Single Select",color:"cj-bg-purple-500"},"v2_date-1":{label:"Date",color:"cj-bg-green-500"},"v2_currency-1":{label:"Currency",color:"cj-bg-yellow-500"},v2_single_asset_upload:{label:"Upload",color:"cj-bg-orange-500"},"v2_phone-1":{label:"Phone",color:"cj-bg-teal-500"},"v2_email-1":{label:"Email",color:"cj-bg-rose-500"}};function Er(e){return Bc[e]||{label:e,color:"cj-bg-muted"}}function _p(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=_p(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Sp(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=_p(e))&&(r&&(r+=" "),r+=t);return r}const pu=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,mu=Sp,ps=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return mu(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:a}=t,s=Object.keys(o).map(l=>{const u=n==null?void 0:n[l],f=a==null?void 0:a[l];if(u===null)return null;const h=pu(u)||pu(f);return o[l][h]}),i=n&&Object.entries(n).reduce((l,u)=>{let[f,h]=u;return h===void 0||(l[f]=h),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:f,className:h,...p}=u;return Object.entries(p).every(m=>{let[g,y]=m;return Array.isArray(y)?y.includes({...a,...i}[g]):{...a,...i}[g]===y})?[...l,f,h]:l},[]);return mu(e,s,c,n==null?void 0:n.class,n==null?void 0:n.className)},Hc="-",QC=e=>{const t=tN(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const i=s.split(Hc);return i[0]===""&&i.length!==1&&i.shift(),Cp(i,t)||eN(s)},getConflictingClassGroupIds:(s,i)=>{const c=n[s]||[];return i&&r[s]?[...c,...r[s]]:c}}},Cp=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Cp(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const a=e.join(Hc);return(s=t.validators.find(({validator:i})=>i(a)))==null?void 0:s.classGroupId},gu=/^\[(.+)\]$/,eN=e=>{if(gu.test(e)){const t=gu.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},tN=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return rN(Object.entries(e.classGroups),n).forEach(([a,s])=>{Qi(s,r,a,t)}),r},Qi=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const a=o===""?t:yu(t,o);a.classGroupId=n;return}if(typeof o=="function"){if(nN(o)){Qi(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([a,s])=>{Qi(s,yu(t,a),n,r)})})},yu=(e,t)=>{let n=e;return t.split(Hc).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},nN=e=>e.isThemeGetter,rN=(e,t)=>t?e.map(([n,r])=>{const o=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([s,i])=>[t+s,i])):a);return[n,o]}):e,oN=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(a,s)=>{n.set(a,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let s=n.get(a);if(s!==void 0)return s;if((s=r.get(a))!==void 0)return o(a,s),s},set(a,s){n.has(a)?n.set(a,s):o(a,s)}}},Np="!",aN=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],a=t.length,s=i=>{const c=[];let l=0,u=0,f;for(let y=0;y<i.length;y++){let v=i[y];if(l===0){if(v===o&&(r||i.slice(y,y+a)===t)){c.push(i.slice(u,y)),u=y+a;continue}if(v==="/"){f=y;continue}}v==="["?l++:v==="]"&&l--}const h=c.length===0?i:i.substring(u),p=h.startsWith(Np),m=p?h.substring(1):h,g=f&&f>u?f-u:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}};return n?i=>n({className:i,parseClassName:s}):s},sN=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},iN=e=>({cache:oN(e.cacheSize),parseClassName:aN(e),...QC(e)}),cN=/\s+/,lN=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,a=[],s=e.trim().split(cN);let i="";for(let c=s.length-1;c>=0;c-=1){const l=s[c],{modifiers:u,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(l);let m=!!p,g=r(m?h.substring(0,p):h);if(!g){if(!m){i=l+(i.length>0?" "+i:i);continue}if(g=r(h),!g){i=l+(i.length>0?" "+i:i);continue}m=!1}const y=sN(u).join(":"),v=f?y+Np:y,w=v+g;if(a.includes(w))continue;a.push(w);const x=o(g,m);for(let j=0;j<x.length;++j){const N=x[j];a.push(v+N)}i=l+(i.length>0?" "+i:i)}return i};function dN(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Ep(t))&&(r&&(r+=" "),r+=n);return r}const Ep=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ep(e[r]))&&(n&&(n+=" "),n+=t);return n};function xu(e,...t){let n,r,o,a=s;function s(c){const l=t.reduce((u,f)=>f(u),e());return n=iN(l),r=n.cache.get,o=n.cache.set,a=i,i(c)}function i(c){const l=r(c);if(l)return l;const u=lN(c,n);return o(c,u),u}return function(){return a(dN.apply(null,arguments))}}const Ne=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},kp=/^\[(?:([a-z-]+):)?(.+)\]$/i,uN=/^\d+\/\d+$/,fN=new Set(["px","full","screen"]),hN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pN=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,mN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,gN=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yN=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qt=e=>mr(e)||fN.has(e)||uN.test(e),hn=e=>Ar(e,"length",CN),mr=e=>!!e&&!Number.isNaN(Number(e)),di=e=>Ar(e,"number",mr),Gr=e=>!!e&&Number.isInteger(Number(e)),xN=e=>e.endsWith("%")&&mr(e.slice(0,-1)),he=e=>kp.test(e),pn=e=>hN.test(e),vN=new Set(["length","size","percentage"]),bN=e=>Ar(e,vN,Pp),wN=e=>Ar(e,"position",Pp),jN=new Set(["image","url"]),_N=e=>Ar(e,jN,EN),SN=e=>Ar(e,"",NN),Ur=()=>!0,Ar=(e,t,n)=>{const r=kp.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},CN=e=>pN.test(e)&&!mN.test(e),Pp=()=>!1,NN=e=>gN.test(e),EN=e=>yN.test(e),vu=()=>{const e=Ne("colors"),t=Ne("spacing"),n=Ne("blur"),r=Ne("brightness"),o=Ne("borderColor"),a=Ne("borderRadius"),s=Ne("borderSpacing"),i=Ne("borderWidth"),c=Ne("contrast"),l=Ne("grayscale"),u=Ne("hueRotate"),f=Ne("invert"),h=Ne("gap"),p=Ne("gradientColorStops"),m=Ne("gradientColorStopPositions"),g=Ne("inset"),y=Ne("margin"),v=Ne("opacity"),w=Ne("padding"),x=Ne("saturate"),j=Ne("scale"),N=Ne("sepia"),S=Ne("skew"),C=Ne("space"),P=Ne("translate"),k=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",he,t],M=()=>[he,t],L=()=>["",Qt,hn],E=()=>["auto",mr,he],I=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],R=()=>["solid","dashed","dotted","double","none"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>["start","end","center","between","around","evenly","stretch"],O=()=>["","0",he],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[mr,he];return{cacheSize:500,separator:":",theme:{colors:[Ur],spacing:[Qt,hn],blur:["none","",pn,he],brightness:G(),borderColor:[e],borderRadius:["none","","full",pn,he],borderSpacing:M(),borderWidth:L(),contrast:G(),grayscale:O(),hueRotate:G(),invert:O(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[xN,hn],inset:D(),margin:D(),opacity:G(),padding:M(),saturate:G(),scale:G(),sepia:O(),skew:G(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",he]}],container:["container"],columns:[{columns:[pn]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...I(),he]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Gr,he]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",he]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",Gr,he]}],"grid-cols":[{"grid-cols":[Ur]}],"col-start-end":[{col:["auto",{span:["full",Gr,he]},he]}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":[Ur]}],"row-start-end":[{row:["auto",{span:[Gr,he]},he]}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",he]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",he]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...A()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...A(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...A(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",he,t]}],"min-w":[{"min-w":[he,t,"min","max","fit"]}],"max-w":[{"max-w":[he,t,"none","full","min","max","fit","prose",{screen:[pn]},pn]}],h:[{h:[he,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[he,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[he,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[he,t,"auto","min","max","fit"]}],"font-size":[{text:["base",pn,hn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",di]}],"font-family":[{font:[Ur]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",he]}],"line-clamp":[{"line-clamp":["none",mr,di]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Qt,he]}],"list-image":[{"list-image":["none",he]}],"list-style-type":[{list:["none","disc","decimal",he]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...R(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Qt,hn]}],"underline-offset":[{"underline-offset":["auto",Qt,he]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...I(),wN]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",bN]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_N]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...R(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:R()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...R()]}],"outline-offset":[{"outline-offset":[Qt,he]}],"outline-w":[{outline:[Qt,hn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Qt,hn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",pn,SN]}],"shadow-color":[{shadow:[Ur]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",pn,he]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[x]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",he]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",he]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",he]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[Gr,he]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",he]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Qt,hn,di]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},kN=(e,{cacheSize:t,prefix:n,separator:r,experimentalParseClassName:o,extend:a={},override:s={}})=>{no(e,"cacheSize",t),no(e,"prefix",n),no(e,"separator",r),no(e,"experimentalParseClassName",o);for(const i in s)PN(e[i],s[i]);for(const i in a)MN(e[i],a[i]);return e},no=(e,t,n)=>{n!==void 0&&(e[t]=n)},PN=(e,t)=>{if(t)for(const n in t)no(e,n,t[n])},MN=(e,t)=>{if(t)for(const n in t){const r=t[n];r!==void 0&&(e[n]=(e[n]||[]).concat(r))}},DN=(e,...t)=>typeof e=="function"?xu(vu,e,...t):xu(()=>kN(vu(),e),...t),ON=DN({prefix:"cj-"});function ie(...e){return ON(Sp(e))}const RN=ps("cj-inline-flex cj-items-center cj-rounded-full cj-border cj-px-2.5 cj-py-0.5 cj-text-xs cj-font-semibold cj-transition-colors focus:cj-outline-none focus:cj-ring-2 focus:cj-ring-ring focus:cj-ring-offset-2",{variants:{variant:{default:"cj-border-transparent cj-bg-primary cj-text-primary-foreground hover:cj-bg-primary/80",secondary:"cj-border-transparent cj-bg-secondary cj-text-secondary-foreground hover:cj-bg-secondary/80",destructive:"cj-border-transparent cj-bg-destructive cj-text-destructive-foreground hover:cj-bg-destructive/80",outline:"cj-text-foreground"}},defaultVariants:{variant:"default"}});function ct({className:e,variant:t,...n}){return d.jsx("div",{className:ie(RN({variant:t}),e),...n})}/**
|
|
41
42
|
* @license lucide-react v0.462.0 - ISC
|
|
42
43
|
*
|
|
43
44
|
* This source code is licensed under the ISC license.
|
|
44
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
-
*/const
|
|
46
|
+
*/const AN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Mp=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
46
47
|
* @license lucide-react v0.462.0 - ISC
|
|
47
48
|
*
|
|
48
49
|
* This source code is licensed under the ISC license.
|
|
49
50
|
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
-
*/var
|
|
51
|
+
*/var TN={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
51
52
|
* @license lucide-react v0.462.0 - ISC
|
|
52
53
|
*
|
|
53
54
|
* This source code is licensed under the ISC license.
|
|
54
55
|
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
-
*/const
|
|
56
|
+
*/const IN=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:a,iconNode:s,...i},c)=>_.createElement("svg",{ref:c,...TN,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Mp("lucide",o),...i},[...s.map(([l,u])=>_.createElement(l,u)),...Array.isArray(a)?a:[a]]));/**
|
|
56
57
|
* @license lucide-react v0.462.0 - ISC
|
|
57
58
|
*
|
|
58
59
|
* This source code is licensed under the ISC license.
|
|
59
60
|
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
-
*/const ge=(e,t)=>{const n=
|
|
61
|
+
*/const ge=(e,t)=>{const n=_.forwardRef(({className:r,...o},a)=>_.createElement(IN,{ref:a,iconNode:t,className:Mp(`lucide-${AN(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
|
|
61
62
|
* @license lucide-react v0.462.0 - ISC
|
|
62
63
|
*
|
|
63
64
|
* This source code is licensed under the ISC license.
|
|
64
65
|
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
-
*/const
|
|
66
|
+
*/const ec=ge("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
66
67
|
* @license lucide-react v0.462.0 - ISC
|
|
67
68
|
*
|
|
68
69
|
* This source code is licensed under the ISC license.
|
|
69
70
|
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
-
*/const
|
|
71
|
+
*/const Dp=ge("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
71
72
|
* @license lucide-react v0.462.0 - ISC
|
|
72
73
|
*
|
|
73
74
|
* This source code is licensed under the ISC license.
|
|
74
75
|
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
-
*/const
|
|
76
|
+
*/const Op=ge("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
|
|
76
77
|
* @license lucide-react v0.462.0 - ISC
|
|
77
78
|
*
|
|
78
79
|
* This source code is licensed under the ISC license.
|
|
79
80
|
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
-
*/const
|
|
81
|
+
*/const $N=ge("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
81
82
|
* @license lucide-react v0.462.0 - ISC
|
|
82
83
|
*
|
|
83
84
|
* This source code is licensed under the ISC license.
|
|
84
85
|
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/const
|
|
86
|
+
*/const Rp=ge("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
86
87
|
* @license lucide-react v0.462.0 - ISC
|
|
87
88
|
*
|
|
88
89
|
* This source code is licensed under the ISC license.
|
|
89
90
|
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
-
*/const
|
|
91
|
+
*/const Tr=ge("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
91
92
|
* @license lucide-react v0.462.0 - ISC
|
|
92
93
|
*
|
|
93
94
|
* This source code is licensed under the ISC license.
|
|
94
95
|
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/const
|
|
96
|
+
*/const zN=ge("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
96
97
|
* @license lucide-react v0.462.0 - ISC
|
|
97
98
|
*
|
|
98
99
|
* This source code is licensed under the ISC license.
|
|
99
100
|
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const
|
|
101
|
+
*/const Ap=ge("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
101
102
|
* @license lucide-react v0.462.0 - ISC
|
|
102
103
|
*
|
|
103
104
|
* This source code is licensed under the ISC license.
|
|
104
105
|
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/const
|
|
106
|
+
*/const Tp=ge("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
106
107
|
* @license lucide-react v0.462.0 - ISC
|
|
107
108
|
*
|
|
108
109
|
* This source code is licensed under the ISC license.
|
|
109
110
|
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/const
|
|
111
|
+
*/const Ip=ge("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
111
112
|
* @license lucide-react v0.462.0 - ISC
|
|
112
113
|
*
|
|
113
114
|
* This source code is licensed under the ISC license.
|
|
114
115
|
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
-
*/const
|
|
116
|
+
*/const bu=ge("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
116
117
|
* @license lucide-react v0.462.0 - ISC
|
|
117
118
|
*
|
|
118
119
|
* This source code is licensed under the ISC license.
|
|
119
120
|
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
-
*/const
|
|
121
|
+
*/const tc=ge("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
121
122
|
* @license lucide-react v0.462.0 - ISC
|
|
122
123
|
*
|
|
123
124
|
* This source code is licensed under the ISC license.
|
|
124
125
|
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/const
|
|
126
|
+
*/const $p=ge("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
126
127
|
* @license lucide-react v0.462.0 - ISC
|
|
127
128
|
*
|
|
128
129
|
* This source code is licensed under the ISC license.
|
|
129
130
|
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/const
|
|
131
|
+
*/const LN=ge("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
131
132
|
* @license lucide-react v0.462.0 - ISC
|
|
132
133
|
*
|
|
133
134
|
* This source code is licensed under the ISC license.
|
|
134
135
|
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
-
*/const
|
|
136
|
+
*/const WN=ge("ClipboardPaste",[["path",{d:"M15 2H9a1 1 0 0 0-1 1v2c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1Z",key:"1pp7kr"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2M16 4h2a2 2 0 0 1 2 2v2M11 14h10",key:"2ik1ml"}],["path",{d:"m17 10 4 4-4 4",key:"vp2hj1"}]]);/**
|
|
136
137
|
* @license lucide-react v0.462.0 - ISC
|
|
137
138
|
*
|
|
138
139
|
* This source code is licensed under the ISC license.
|
|
139
140
|
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
-
*/const
|
|
141
|
+
*/const FN=ge("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
141
142
|
* @license lucide-react v0.462.0 - ISC
|
|
142
143
|
*
|
|
143
144
|
* This source code is licensed under the ISC license.
|
|
144
145
|
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
-
*/const
|
|
146
|
+
*/const BN=ge("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
146
147
|
* @license lucide-react v0.462.0 - ISC
|
|
147
148
|
*
|
|
148
149
|
* This source code is licensed under the ISC license.
|
|
149
150
|
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/const
|
|
151
|
+
*/const HN=ge("FileUp",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/**
|
|
151
152
|
* @license lucide-react v0.462.0 - ISC
|
|
152
153
|
*
|
|
153
154
|
* This source code is licensed under the ISC license.
|
|
154
155
|
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
-
*/const
|
|
156
|
+
*/const VN=ge("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
156
157
|
* @license lucide-react v0.462.0 - ISC
|
|
157
158
|
*
|
|
158
159
|
* This source code is licensed under the ISC license.
|
|
159
160
|
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
-
*/const
|
|
161
|
+
*/const zp=ge("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
161
162
|
* @license lucide-react v0.462.0 - ISC
|
|
162
163
|
*
|
|
163
164
|
* This source code is licensed under the ISC license.
|
|
164
165
|
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
-
*/const
|
|
166
|
+
*/const YN=ge("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
|
|
166
167
|
* @license lucide-react v0.462.0 - ISC
|
|
167
168
|
*
|
|
168
169
|
* This source code is licensed under the ISC license.
|
|
169
170
|
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
-
*/const
|
|
171
|
+
*/const qN=ge("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
171
172
|
* @license lucide-react v0.462.0 - ISC
|
|
172
173
|
*
|
|
173
174
|
* This source code is licensed under the ISC license.
|
|
174
175
|
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
-
*/const
|
|
176
|
+
*/const GN=ge("LockKeyholeOpen",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{width:"18",height:"12",x:"3",y:"10",rx:"2",key:"l0tzu3"}],["path",{d:"M7 10V7a5 5 0 0 1 9.33-2.5",key:"car5b7"}]]);/**
|
|
176
177
|
* @license lucide-react v0.462.0 - ISC
|
|
177
178
|
*
|
|
178
179
|
* This source code is licensed under the ISC license.
|
|
179
180
|
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
-
*/const
|
|
181
|
+
*/const UN=ge("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
181
182
|
* @license lucide-react v0.462.0 - ISC
|
|
182
183
|
*
|
|
183
184
|
* This source code is licensed under the ISC license.
|
|
184
185
|
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
-
*/const
|
|
186
|
+
*/const XN=ge("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
|
|
186
187
|
* @license lucide-react v0.462.0 - ISC
|
|
187
188
|
*
|
|
188
189
|
* This source code is licensed under the ISC license.
|
|
189
190
|
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
-
*/const
|
|
191
|
+
*/const Fa=ge("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
191
192
|
* @license lucide-react v0.462.0 - ISC
|
|
192
193
|
*
|
|
193
194
|
* This source code is licensed under the ISC license.
|
|
194
195
|
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
-
*/const
|
|
196
|
+
*/const So=ge("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
196
197
|
* @license lucide-react v0.462.0 - ISC
|
|
197
198
|
*
|
|
198
199
|
* This source code is licensed under the ISC license.
|
|
199
200
|
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
-
*/const
|
|
201
|
+
*/const KN=ge("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);/**
|
|
201
202
|
* @license lucide-react v0.462.0 - ISC
|
|
202
203
|
*
|
|
203
204
|
* This source code is licensed under the ISC license.
|
|
204
205
|
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
-
*/const
|
|
206
|
+
*/const Lp=ge("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
206
207
|
* @license lucide-react v0.462.0 - ISC
|
|
207
208
|
*
|
|
208
209
|
* This source code is licensed under the ISC license.
|
|
209
210
|
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/const
|
|
211
|
+
*/const Wp=ge("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
211
212
|
* @license lucide-react v0.462.0 - ISC
|
|
212
213
|
*
|
|
213
214
|
* This source code is licensed under the ISC license.
|
|
214
215
|
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
-
*/const
|
|
216
|
+
*/const Fp=ge("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
216
217
|
* @license lucide-react v0.462.0 - ISC
|
|
217
218
|
*
|
|
218
219
|
* This source code is licensed under the ISC license.
|
|
219
220
|
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
-
*/const
|
|
221
|
+
*/const JN=ge("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
221
222
|
* @license lucide-react v0.462.0 - ISC
|
|
222
223
|
*
|
|
223
224
|
* This source code is licensed under the ISC license.
|
|
224
225
|
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
-
*/const
|
|
226
|
+
*/const Bp=ge("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
226
227
|
* @license lucide-react v0.462.0 - ISC
|
|
227
228
|
*
|
|
228
229
|
* This source code is licensed under the ISC license.
|
|
229
230
|
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
-
*/const
|
|
231
|
+
*/const ZN=ge("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
231
232
|
* @license lucide-react v0.462.0 - ISC
|
|
232
233
|
*
|
|
233
234
|
* This source code is licensed under the ISC license.
|
|
234
235
|
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
-
*/const
|
|
236
|
+
*/const QN=ge("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
|
|
236
237
|
* @license lucide-react v0.462.0 - ISC
|
|
237
238
|
*
|
|
238
239
|
* This source code is licensed under the ISC license.
|
|
239
240
|
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
-
*/const
|
|
241
|
+
*/const Hp=ge("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
241
242
|
* @license lucide-react v0.462.0 - ISC
|
|
242
243
|
*
|
|
243
244
|
* This source code is licensed under the ISC license.
|
|
244
245
|
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
-
*/const
|
|
246
|
+
*/const Vc=ge("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
|
246
247
|
* @license lucide-react v0.462.0 - ISC
|
|
247
248
|
*
|
|
248
249
|
* This source code is licensed under the ISC license.
|
|
249
250
|
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
-
*/const MN=ge("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),ua=C.createContext(null);ua.displayName="PanelGroupContext";const Oe={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Ic=10,$n=C.useLayoutEffect,sd=w.useId,PN=typeof sd=="function"?sd:()=>null;let DN=0;function $c(e=null){const t=PN(),n=C.useRef(e||t||null);return n.current===null&&(n.current=""+DN++),e??n.current}function _m({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:s,id:a,maxSize:i,minSize:c,onCollapse:l,onExpand:f,onResize:d,order:h,style:m,tagName:g="div",...p}){const y=C.useContext(ua);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:v,expandPanel:b,getPanelSize:x,getPanelStyle:j,groupId:N,isPanelCollapsed:S,reevaluatePanelConstraints:E,registerPanel:O,resizePanel:P,unregisterPanel:T}=y,k=$c(a),M=C.useRef({callbacks:{onCollapse:l,onExpand:f,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:i,minSize:c},id:k,idIsFromProps:a!==void 0,order:h});C.useRef({didLogMissingDefaultSizeWarning:!1}),$n(()=>{const{callbacks:_,constraints:I}=M.current,R={...I};M.current.id=k,M.current.idIsFromProps=a!==void 0,M.current.order=h,_.onCollapse=l,_.onExpand=f,_.onResize=d,I.collapsedSize=n,I.collapsible=r,I.defaultSize=o,I.maxSize=i,I.minSize=c,(R.collapsedSize!==I.collapsedSize||R.collapsible!==I.collapsible||R.maxSize!==I.maxSize||R.minSize!==I.minSize)&&E(M.current,R)}),$n(()=>{const _=M.current;return O(_),()=>{T(_)}},[h,k,O,T]),C.useImperativeHandle(s,()=>({collapse:()=>{v(M.current)},expand:_=>{b(M.current,_)},getId(){return k},getSize(){return x(M.current)},isCollapsed(){return S(M.current)},isExpanded(){return!S(M.current)},resize:_=>{P(M.current,_)}}),[v,b,x,S,k,P]);const W=j(M.current,o);return C.createElement(g,{...p,children:e,className:t,id:k,style:{...W,...m},[Oe.groupId]:N,[Oe.panel]:"",[Oe.panelCollapsible]:r||void 0,[Oe.panelId]:k,[Oe.panelSize]:parseFloat(""+W.flexGrow).toFixed(1)})}const km=C.forwardRef((e,t)=>C.createElement(_m,{...e,forwardedRef:t}));_m.displayName="Panel";km.displayName="forwardRef(Panel)";let Xi=null,bs=-1,xn=null;function ON(e,t){if(t){const n=(t&Rm)!==0,r=(t&Am)!==0,o=(t&Tm)!==0,s=(t&Im)!==0;if(n)return o?"se-resize":s?"ne-resize":"e-resize";if(r)return o?"sw-resize":s?"nw-resize":"w-resize";if(o)return"s-resize";if(s)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function RN(){xn!==null&&(document.head.removeChild(xn),Xi=null,xn=null,bs=-1)}function ai(e,t){var n,r;const o=ON(e,t);if(Xi!==o){if(Xi=o,xn===null&&(xn=document.createElement("style"),document.head.appendChild(xn)),bs>=0){var s;(s=xn.sheet)===null||s===void 0||s.removeRule(bs)}bs=(n=(r=xn.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${o} !important;}`))!==null&&n!==void 0?n:-1}}function Mm(e){return e.type==="keydown"}function Pm(e){return e.type.startsWith("pointer")}function Dm(e){return e.type.startsWith("mouse")}function da(e){if(Pm(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(Dm(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function AN(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function TN(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function IN(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:cd(e),b:cd(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;me(r,"Stacking order can only be calculated for elements with a common ancestor");const o={a:id(ad(n.a)),b:id(ad(n.b))};if(o.a===o.b){const s=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let i=s.length;for(;i--;){const c=s[i];if(c===a.a)return 1;if(c===a.b)return-1}}return Math.sign(o.a-o.b)}const $N=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function zN(e){var t;const n=getComputedStyle((t=Om(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function LN(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||zN(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||$N.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function ad(e){let t=e.length;for(;t--;){const n=e[t];if(me(n,"Missing node"),LN(n))return n}return null}function id(e){return e&&Number(getComputedStyle(e).zIndex)||0}function cd(e){const t=[];for(;e;)t.push(e),e=Om(e);return t}function Om(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const Rm=1,Am=2,Tm=4,Im=8,WN=AN()==="coarse";let wt=[],mr=!1,On=new Map,fa=new Map;const jo=new Set;function FN(e,t,n,r,o){var s;const{ownerDocument:a}=t,i={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:o},c=(s=On.get(a))!==null&&s!==void 0?s:0;return On.set(a,c+1),jo.add(i),zs(),function(){var f;fa.delete(e),jo.delete(i);const d=(f=On.get(a))!==null&&f!==void 0?f:1;if(On.set(a,d-1),zs(),d===1&&On.delete(a),wt.includes(i)){const h=wt.indexOf(i);h>=0&&wt.splice(h,1),Lc(),o("up",!0,null)}}}function BN(e){const{target:t}=e,{x:n,y:r}=da(e);mr=!0,zc({target:t,x:n,y:r}),zs(),wt.length>0&&(Ls("down",e),e.preventDefault(),$m(t)||e.stopImmediatePropagation())}function ii(e){const{x:t,y:n}=da(e);if(mr&&e.buttons===0&&(mr=!1,Ls("up",e)),!mr){const{target:r}=e;zc({target:r,x:t,y:n})}Ls("move",e),Lc(),wt.length>0&&e.preventDefault()}function ci(e){const{target:t}=e,{x:n,y:r}=da(e);fa.clear(),mr=!1,wt.length>0&&(e.preventDefault(),$m(t)||e.stopImmediatePropagation()),Ls("up",e),zc({target:t,x:n,y:r}),Lc(),zs()}function $m(e){let t=e;for(;t;){if(t.hasAttribute(Oe.resizeHandle))return!0;t=t.parentElement}return!1}function zc({target:e,x:t,y:n}){wt.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),jo.forEach(o=>{const{element:s,hitAreaMargins:a}=o,i=s.getBoundingClientRect(),{bottom:c,left:l,right:f,top:d}=i,h=WN?a.coarse:a.fine;if(t>=l-h&&t<=f+h&&n>=d-h&&n<=c+h){if(r!==null&&document.contains(r)&&s!==r&&!s.contains(r)&&!r.contains(s)&&IN(r,s)>0){let g=r,p=!1;for(;g&&!g.contains(s);){if(TN(g.getBoundingClientRect(),i)){p=!0;break}g=g.parentElement}if(p)return}wt.push(o)}})}function li(e,t){fa.set(e,t)}function Lc(){let e=!1,t=!1;wt.forEach(r=>{const{direction:o}=r;o==="horizontal"?e=!0:t=!0});let n=0;fa.forEach(r=>{n|=r}),e&&t?ai("intersection",n):e?ai("horizontal",n):t?ai("vertical",n):RN()}let ui=new AbortController;function zs(){ui.abort(),ui=new AbortController;const e={capture:!0,signal:ui.signal};jo.size&&(mr?(wt.length>0&&On.forEach((t,n)=>{const{body:r}=n;t>0&&(r.addEventListener("contextmenu",ci,e),r.addEventListener("pointerleave",ii,e),r.addEventListener("pointermove",ii,e))}),window.addEventListener("pointerup",ci,e),window.addEventListener("pointercancel",ci,e)):On.forEach((t,n)=>{const{body:r}=n;t>0&&(r.addEventListener("pointerdown",BN,e),r.addEventListener("pointermove",ii,e))}))}function Ls(e,t){jo.forEach(n=>{const{setResizeHandlerState:r}=n,o=wt.includes(n);r(e,o,t)})}function HN(){const[e,t]=C.useState(0);return C.useCallback(()=>t(n=>n+1),[])}function me(e,t){if(!e)throw console.error(t),Error(t)}function Bn(e,t,n=Ic){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Qt(e,t,n=Ic){return Bn(e,t,n)===0}function tt(e,t,n){return Bn(e,t,n)===0}function VN(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const o=e[r],s=t[r];if(!tt(o,s,n))return!1}return!0}function dr({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];me(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:o=0,collapsible:s,maxSize:a=100,minSize:i=0}=r;if(Bn(n,i)<0)if(s){const c=(o+i)/2;Bn(n,c)<0?n=o:n=i}else n=i;return n=Math.min(a,n),n=parseFloat(n.toFixed(Ic)),n}function to({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:s}){if(tt(e,0))return t;const a=[...t],[i,c]=r;me(i!=null,"Invalid first pivot index"),me(c!=null,"Invalid second pivot index");let l=0;if(s==="keyboard"){{const d=e<0?c:i,h=n[d];me(h,`Panel constraints not found for index ${d}`);const{collapsedSize:m=0,collapsible:g,minSize:p=0}=h;if(g){const y=t[d];if(me(y!=null,`Previous layout not found for panel index ${d}`),tt(y,m)){const v=p-y;Bn(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}{const d=e<0?i:c,h=n[d];me(h,`No panel constraints found for index ${d}`);const{collapsedSize:m=0,collapsible:g,minSize:p=0}=h;if(g){const y=t[d];if(me(y!=null,`Previous layout not found for panel index ${d}`),tt(y,p)){const v=y-m;Bn(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}}{const d=e<0?1:-1;let h=e<0?c:i,m=0;for(;;){const p=t[h];me(p!=null,`Previous layout not found for panel index ${h}`);const v=dr({panelConstraints:n,panelIndex:h,size:100})-p;if(m+=v,h+=d,h<0||h>=n.length)break}const g=Math.min(Math.abs(e),Math.abs(m));e=e<0?0-g:g}{let h=e<0?i:c;for(;h>=0&&h<n.length;){const m=Math.abs(e)-Math.abs(l),g=t[h];me(g!=null,`Previous layout not found for panel index ${h}`);const p=g-m,y=dr({panelConstraints:n,panelIndex:h,size:p});if(!tt(g,y)&&(l+=g-y,a[h]=y,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?h--:h++}}if(VN(o,a))return o;{const d=e<0?c:i,h=t[d];me(h!=null,`Previous layout not found for panel index ${d}`);const m=h+l,g=dr({panelConstraints:n,panelIndex:d,size:m});if(a[d]=g,!tt(g,m)){let p=m-g,v=e<0?c:i;for(;v>=0&&v<n.length;){const b=a[v];me(b!=null,`Previous layout not found for panel index ${v}`);const x=b+p,j=dr({panelConstraints:n,panelIndex:v,size:x});if(tt(b,j)||(p-=j-b,a[v]=j),tt(p,0))break;e>0?v--:v++}}}const f=a.reduce((d,h)=>h+d,0);return tt(f,100)?a:o}function YN({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,s=0,a=0;const i=n[0];me(i!=null,"No pivot index found"),t.forEach((d,h)=>{const{constraints:m}=d,{maxSize:g=100,minSize:p=0}=m;h===i?(r=p,o=g):(s+=p,a+=g)});const c=Math.min(o,100-s),l=Math.max(r,100-a),f=e[i];return{valueMax:c,valueMin:l,valueNow:f}}function So(e,t=document){return Array.from(t.querySelectorAll(`[${Oe.resizeHandleId}][data-panel-group-id="${e}"]`))}function zm(e,t,n=document){const o=So(e,n).findIndex(s=>s.getAttribute(Oe.resizeHandleId)===t);return o??null}function Lm(e,t,n){const r=zm(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function Wm(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function ha(e,t=document){const n=t.querySelector(`[${Oe.resizeHandleId}="${e}"]`);return n||null}function qN(e,t,n,r=document){var o,s,a,i;const c=ha(t,r),l=So(e,r),f=c?l.indexOf(c):-1,d=(o=(s=n[f])===null||s===void 0?void 0:s.id)!==null&&o!==void 0?o:null,h=(a=(i=n[f+1])===null||i===void 0?void 0:i.id)!==null&&a!==void 0?a:null;return[d,h]}function GN({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,panelGroupElement:s,setLayout:a}){C.useRef({didWarnAboutMissingResizeHandle:!1}),$n(()=>{if(!s)return;const i=So(n,s);for(let c=0;c<o.length-1;c++){const{valueMax:l,valueMin:f,valueNow:d}=YN({layout:r,panelsArray:o,pivotIndices:[c,c+1]}),h=i[c];if(h!=null){const m=o[c];me(m,`No panel data found for index "${c}"`),h.setAttribute("aria-controls",m.id),h.setAttribute("aria-valuemax",""+Math.round(l)),h.setAttribute("aria-valuemin",""+Math.round(f)),h.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{i.forEach((c,l)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,r,o,s]),C.useEffect(()=>{if(!s)return;const i=t.current;me(i,"Eager values not found");const{panelDataArray:c}=i,l=Wm(n,s);me(l!=null,`No group found for id "${n}"`);const f=So(n,s);me(f,`No resize handles found for group id "${n}"`);const d=f.map(h=>{const m=h.getAttribute(Oe.resizeHandleId);me(m,"Resize handle element has no handle id attribute");const[g,p]=qN(n,m,c,s);if(g==null||p==null)return()=>{};const y=v=>{if(!v.defaultPrevented)switch(v.key){case"Enter":{v.preventDefault();const b=c.findIndex(x=>x.id===g);if(b>=0){const x=c[b];me(x,`No panel data found for index ${b}`);const j=r[b],{collapsedSize:N=0,collapsible:S,minSize:E=0}=x.constraints;if(j!=null&&S){const O=to({delta:tt(j,N)?E-N:N-j,initialLayout:r,panelConstraints:c.map(P=>P.constraints),pivotIndices:Lm(n,m,s),prevLayout:r,trigger:"keyboard"});r!==O&&a(O)}}break}}};return h.addEventListener("keydown",y),()=>{h.removeEventListener("keydown",y)}});return()=>{d.forEach(h=>h())}},[s,e,t,n,r,o,a])}function ld(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Fm(e,t){const n=e==="horizontal",{x:r,y:o}=da(t);return n?r:o}function UN(e,t,n,r,o){const s=n==="horizontal",a=ha(t,o);me(a,`No resize handle element found for id "${t}"`);const i=a.getAttribute(Oe.groupId);me(i,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=r;const l=Fm(n,e),f=Wm(i,o);me(f,`No group element found for id "${i}"`);const d=f.getBoundingClientRect(),h=s?d.width:d.height;return(l-c)/h*100}function XN(e,t,n,r,o,s){if(Mm(e)){const a=n==="horizontal";let i=0;e.shiftKey?i=100:o!=null?i=o:i=10;let c=0;switch(e.key){case"ArrowDown":c=a?0:i;break;case"ArrowLeft":c=a?-i:0;break;case"ArrowRight":c=a?i:0;break;case"ArrowUp":c=a?0:-i;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return r==null?0:UN(e,t,n,r,s)}function KN({panelDataArray:e}){const t=Array(e.length),n=e.map(s=>s.constraints);let r=0,o=100;for(let s=0;s<e.length;s++){const a=n[s];me(a,`Panel constraints not found for index ${s}`);const{defaultSize:i}=a;i!=null&&(r++,t[s]=i,o-=i)}for(let s=0;s<e.length;s++){const a=n[s];me(a,`Panel constraints not found for index ${s}`);const{defaultSize:i}=a;if(i!=null)continue;const c=e.length-r,l=o/c;r++,t[s]=l,o-=l}return t}function er(e,t,n){t.forEach((r,o)=>{const s=e[o];me(s,`Panel data not found for index ${o}`);const{callbacks:a,constraints:i,id:c}=s,{collapsedSize:l=0,collapsible:f}=i,d=n[c];if(d==null||r!==d){n[c]=r;const{onCollapse:h,onExpand:m,onResize:g}=a;g&&g(r,d),f&&(h||m)&&(m&&(d==null||Qt(d,l))&&!Qt(r,l)&&m(),h&&(d==null||!Qt(d,l))&&Qt(r,l)&&h())}})}function is(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function JN({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:s=3}){const a=n[o];let i;return a==null?i=e!=null?e.toPrecision(s):"1":r.length===1?i="1":i=a.toPrecision(s),{flexBasis:0,flexGrow:i,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function ZN(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function ud(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function Bm(e){return`react-resizable-panels:${e}`}function Hm(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:o,order:s}=t;return o?r:s?`${s}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function Vm(e,t){try{const n=Bm(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function QN(e,t,n){var r,o;const s=(r=Vm(e,n))!==null&&r!==void 0?r:{},a=Hm(t);return(o=s[a])!==null&&o!==void 0?o:null}function eE(e,t,n,r,o){var s;const a=Bm(e),i=Hm(t),c=(s=Vm(e,o))!==null&&s!==void 0?s:{};c[i]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(a,JSON.stringify(c))}catch(l){console.error(l)}}function dd({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((s,a)=>s+a,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(s=>`${s}%`).join(", ")}`);if(!tt(r,100)&&n.length>0)for(let s=0;s<t.length;s++){const a=n[s];me(a!=null,`No layout data found for index ${s}`);const i=100/r*a;n[s]=i}let o=0;for(let s=0;s<t.length;s++){const a=n[s];me(a!=null,`No layout data found for index ${s}`);const i=dr({panelConstraints:t,panelIndex:s,size:a});a!=i&&(o+=a-i,n[s]=i)}if(!tt(o,0))for(let s=0;s<t.length;s++){const a=n[s];me(a!=null,`No layout data found for index ${s}`);const i=a+o,c=dr({panelConstraints:t,panelIndex:s,size:i});if(a!==c&&(o-=c-a,n[s]=c,tt(o,0)))break}return n}const tE=100,no={getItem:e=>(ud(no),no.getItem(e)),setItem:(e,t)=>{ud(no),no.setItem(e,t)}},fd={};function Ym({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:s=null,onLayout:a=null,keyboardResizeBy:i=null,storage:c=no,style:l,tagName:f="div",...d}){const h=$c(s),m=C.useRef(null),[g,p]=C.useState(null),[y,v]=C.useState([]),b=HN(),x=C.useRef({}),j=C.useRef(new Map),N=C.useRef(0),S=C.useRef({autoSaveId:e,direction:r,dragState:g,id:h,keyboardResizeBy:i,onLayout:a,storage:c}),E=C.useRef({layout:y,panelDataArray:[],panelDataArrayChanged:!1});C.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),C.useImperativeHandle(o,()=>({getId:()=>S.current.id,getLayout:()=>{const{layout:H}=E.current;return H},setLayout:H=>{const{onLayout:L}=S.current,{layout:Y,panelDataArray:G}=E.current,$=dd({layout:H,panelConstraints:G.map(F=>F.constraints)});ld(Y,$)||(v($),E.current.layout=$,L&&L($),er(G,$,x.current))}}),[]),$n(()=>{S.current.autoSaveId=e,S.current.direction=r,S.current.dragState=g,S.current.id=h,S.current.onLayout=a,S.current.storage=c}),GN({committedValuesRef:S,eagerValuesRef:E,groupId:h,layout:y,panelDataArray:E.current.panelDataArray,setLayout:v,panelGroupElement:m.current}),C.useEffect(()=>{const{panelDataArray:H}=E.current;if(e){if(y.length===0||y.length!==H.length)return;let L=fd[e];L==null&&(L=ZN(eE,tE),fd[e]=L);const Y=[...H],G=new Map(j.current);L(e,Y,G,y,c)}},[e,y,c]),C.useEffect(()=>{});const O=C.useCallback(H=>{const{onLayout:L}=S.current,{layout:Y,panelDataArray:G}=E.current;if(H.constraints.collapsible){const $=G.map(Z=>Z.constraints),{collapsedSize:F=0,panelSize:U,pivotIndices:X}=kn(G,H,Y);if(me(U!=null,`Panel size not found for panel "${H.id}"`),!Qt(U,F)){j.current.set(H.id,U);const K=ir(G,H)===G.length-1?U-F:F-U,J=to({delta:K,initialLayout:Y,panelConstraints:$,pivotIndices:X,prevLayout:Y,trigger:"imperative-api"});is(Y,J)||(v(J),E.current.layout=J,L&&L(J),er(G,J,x.current))}}},[]),P=C.useCallback((H,L)=>{const{onLayout:Y}=S.current,{layout:G,panelDataArray:$}=E.current;if(H.constraints.collapsible){const F=$.map(ee=>ee.constraints),{collapsedSize:U=0,panelSize:X=0,minSize:Z=0,pivotIndices:K}=kn($,H,G),J=L??Z;if(Qt(X,U)){const ee=j.current.get(H.id),se=ee!=null&&ee>=J?ee:J,ue=ir($,H)===$.length-1?X-se:se-X,ve=to({delta:ue,initialLayout:G,panelConstraints:F,pivotIndices:K,prevLayout:G,trigger:"imperative-api"});is(G,ve)||(v(ve),E.current.layout=ve,Y&&Y(ve),er($,ve,x.current))}}},[]),T=C.useCallback(H=>{const{layout:L,panelDataArray:Y}=E.current,{panelSize:G}=kn(Y,H,L);return me(G!=null,`Panel size not found for panel "${H.id}"`),G},[]),k=C.useCallback((H,L)=>{const{panelDataArray:Y}=E.current,G=ir(Y,H);return JN({defaultSize:L,dragState:g,layout:y,panelData:Y,panelIndex:G})},[g,y]),M=C.useCallback(H=>{const{layout:L,panelDataArray:Y}=E.current,{collapsedSize:G=0,collapsible:$,panelSize:F}=kn(Y,H,L);return me(F!=null,`Panel size not found for panel "${H.id}"`),$===!0&&Qt(F,G)},[]),W=C.useCallback(H=>{const{layout:L,panelDataArray:Y}=E.current,{collapsedSize:G=0,collapsible:$,panelSize:F}=kn(Y,H,L);return me(F!=null,`Panel size not found for panel "${H.id}"`),!$||Bn(F,G)>0},[]),_=C.useCallback(H=>{const{panelDataArray:L}=E.current;L.push(H),L.sort((Y,G)=>{const $=Y.order,F=G.order;return $==null&&F==null?0:$==null?-1:F==null?1:$-F}),E.current.panelDataArrayChanged=!0,b()},[b]);$n(()=>{if(E.current.panelDataArrayChanged){E.current.panelDataArrayChanged=!1;const{autoSaveId:H,onLayout:L,storage:Y}=S.current,{layout:G,panelDataArray:$}=E.current;let F=null;if(H){const X=QN(H,$,Y);X&&(j.current=new Map(Object.entries(X.expandToSizes)),F=X.layout)}F==null&&(F=KN({panelDataArray:$}));const U=dd({layout:F,panelConstraints:$.map(X=>X.constraints)});ld(G,U)||(v(U),E.current.layout=U,L&&L(U),er($,U,x.current))}}),$n(()=>{const H=E.current;return()=>{H.layout=[]}},[]);const I=C.useCallback(H=>{let L=!1;const Y=m.current;return Y&&window.getComputedStyle(Y,null).getPropertyValue("direction")==="rtl"&&(L=!0),function($){$.preventDefault();const F=m.current;if(!F)return()=>null;const{direction:U,dragState:X,id:Z,keyboardResizeBy:K,onLayout:J}=S.current,{layout:ee,panelDataArray:se}=E.current,{initialLayout:ae}=X??{},ue=Lm(Z,H,F);let ve=XN($,H,U,X,K,F);const ke=U==="horizontal";ke&&L&&(ve=-ve);const Fe=se.map(Le=>Le.constraints),Ie=to({delta:ve,initialLayout:ae??ee,panelConstraints:Fe,pivotIndices:ue,prevLayout:ee,trigger:Mm($)?"keyboard":"mouse-or-touch"}),Qe=!is(ee,Ie);(Pm($)||Dm($))&&N.current!=ve&&(N.current=ve,!Qe&&ve!==0?ke?li(H,ve<0?Rm:Am):li(H,ve<0?Tm:Im):li(H,0)),Qe&&(v(Ie),E.current.layout=Ie,J&&J(Ie),er(se,Ie,x.current))}},[]),R=C.useCallback((H,L)=>{const{onLayout:Y}=S.current,{layout:G,panelDataArray:$}=E.current,F=$.map(ee=>ee.constraints),{panelSize:U,pivotIndices:X}=kn($,H,G);me(U!=null,`Panel size not found for panel "${H.id}"`);const K=ir($,H)===$.length-1?U-L:L-U,J=to({delta:K,initialLayout:G,panelConstraints:F,pivotIndices:X,prevLayout:G,trigger:"imperative-api"});is(G,J)||(v(J),E.current.layout=J,Y&&Y(J),er($,J,x.current))},[]),z=C.useCallback((H,L)=>{const{layout:Y,panelDataArray:G}=E.current,{collapsedSize:$=0,collapsible:F}=L,{collapsedSize:U=0,collapsible:X,maxSize:Z=100,minSize:K=0}=H.constraints,{panelSize:J}=kn(G,H,Y);J!=null&&(F&&X&&Qt(J,$)?Qt($,U)||R(H,U):J<K?R(H,K):J>Z&&R(H,Z))},[R]),A=C.useCallback((H,L)=>{const{direction:Y}=S.current,{layout:G}=E.current;if(!m.current)return;const $=ha(H,m.current);me($,`Drag handle element not found for id "${H}"`);const F=Fm(Y,L);p({dragHandleId:H,dragHandleRect:$.getBoundingClientRect(),initialCursorPosition:F,initialLayout:G})},[]),D=C.useCallback(()=>{p(null)},[]),B=C.useCallback(H=>{const{panelDataArray:L}=E.current,Y=ir(L,H);Y>=0&&(L.splice(Y,1),delete x.current[H.id],E.current.panelDataArrayChanged=!0,b())},[b]),q=C.useMemo(()=>({collapsePanel:O,direction:r,dragState:g,expandPanel:P,getPanelSize:T,getPanelStyle:k,groupId:h,isPanelCollapsed:M,isPanelExpanded:W,reevaluatePanelConstraints:z,registerPanel:_,registerResizeHandle:I,resizePanel:R,startDragging:A,stopDragging:D,unregisterPanel:B,panelGroupElement:m.current}),[O,g,r,P,T,k,h,M,W,z,_,I,R,A,D,B]),V={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return C.createElement(ua.Provider,{value:q},C.createElement(f,{...d,children:t,className:n,id:s,ref:m,style:{...V,...l},[Oe.group]:"",[Oe.groupDirection]:r,[Oe.groupId]:h}))}const qm=C.forwardRef((e,t)=>C.createElement(Ym,{...e,forwardedRef:t}));Ym.displayName="PanelGroup";qm.displayName="forwardRef(PanelGroup)";function ir(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function kn(e,t,n){const r=ir(e,t),s=r===e.length-1?[r-1,r]:[r,r+1],a=n[r];return{...t.constraints,panelSize:a,pivotIndices:s}}function nE({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){C.useEffect(()=>{if(e||n==null||r==null)return;const o=ha(t,r);if(o==null)return;const s=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),n(a);break}case"F6":{a.preventDefault();const i=o.getAttribute(Oe.groupId);me(i,`No group element found for id "${i}"`);const c=So(i,r),l=zm(i,t,r);me(l!==null,`No resize element found for id "${t}"`);const f=a.shiftKey?l>0?l-1:c.length-1:l+1<c.length?l+1:0;c[f].focus();break}}};return o.addEventListener("keydown",s),()=>{o.removeEventListener("keydown",s)}},[r,e,t,n])}function Gm({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:o,onBlur:s,onClick:a,onDragging:i,onFocus:c,onPointerDown:l,onPointerUp:f,style:d={},tabIndex:h=0,tagName:m="div",...g}){var p,y;const v=C.useRef(null),b=C.useRef({onClick:a,onDragging:i,onPointerDown:l,onPointerUp:f});C.useEffect(()=>{b.current.onClick=a,b.current.onDragging=i,b.current.onPointerDown=l,b.current.onPointerUp=f});const x=C.useContext(ua);if(x===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:j,groupId:N,registerResizeHandle:S,startDragging:E,stopDragging:O,panelGroupElement:P}=x,T=$c(o),[k,M]=C.useState("inactive"),[W,_]=C.useState(!1),[I,R]=C.useState(null),z=C.useRef({state:k});$n(()=>{z.current.state=k}),C.useEffect(()=>{if(n)R(null);else{const q=S(T);R(()=>q)}},[n,T,S]);const A=(p=r==null?void 0:r.coarse)!==null&&p!==void 0?p:15,D=(y=r==null?void 0:r.fine)!==null&&y!==void 0?y:5;C.useEffect(()=>{if(n||I==null)return;const q=v.current;me(q,"Element ref not attached");let V=!1;return FN(T,q,j,{coarse:A,fine:D},(L,Y,G)=>{if(!Y){M("inactive");return}switch(L){case"down":{M("drag"),V=!1,me(G,'Expected event to be defined for "down" action'),E(T,G);const{onDragging:$,onPointerDown:F}=b.current;$==null||$(!0),F==null||F();break}case"move":{const{state:$}=z.current;V=!0,$!=="drag"&&M("hover"),me(G,'Expected event to be defined for "move" action'),I(G);break}case"up":{M("hover"),O();const{onClick:$,onDragging:F,onPointerUp:U}=b.current;F==null||F(!1),U==null||U(),V||$==null||$();break}}})},[A,j,n,D,S,T,I,E,O]),nE({disabled:n,handleId:T,resizeHandler:I,panelGroupElement:P});const B={touchAction:"none",userSelect:"none"};return C.createElement(m,{...g,children:e,className:t,id:o,onBlur:()=>{_(!1),s==null||s()},onFocus:()=>{_(!0),c==null||c()},ref:v,role:"separator",style:{...B,...d},tabIndex:h,[Oe.groupDirection]:j,[Oe.groupId]:N,[Oe.resizeHandle]:"",[Oe.resizeHandleActive]:k==="drag"?"pointer":W?"keyboard":void 0,[Oe.resizeHandleEnabled]:!n,[Oe.resizeHandleId]:T,[Oe.resizeHandleState]:k})}Gm.displayName="PanelResizeHandle";function Um(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Um(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Xm(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Um(e))&&(r&&(r+=" "),r+=t);return r}const Wc="-",rE=e=>{const t=sE(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const i=a.split(Wc);return i[0]===""&&i.length!==1&&i.shift(),Km(i,t)||oE(a)},getConflictingClassGroupIds:(a,i)=>{const c=n[a]||[];return i&&r[a]?[...c,...r[a]]:c}}},Km=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Km(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Wc);return(a=t.validators.find(({validator:i})=>i(s)))==null?void 0:a.classGroupId},hd=/^\[(.+)\]$/,oE=e=>{if(hd.test(e)){const t=hd.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},sE=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return iE(Object.entries(e.classGroups),n).forEach(([s,a])=>{Ki(a,r,s,t)}),r},Ki=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:md(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(aE(o)){Ki(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,a])=>{Ki(a,md(t,s),n,r)})})},md=(e,t)=>{let n=e;return t.split(Wc).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},aE=e=>e.isThemeGetter,iE=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,i])=>[t+a,i])):s);return[n,o]}):e,cE=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,a)=>{n.set(s,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return o(s,a),a},set(s,a){n.has(s)?n.set(s,a):o(s,a)}}},Jm="!",lE=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,a=i=>{const c=[];let l=0,f=0,d;for(let y=0;y<i.length;y++){let v=i[y];if(l===0){if(v===o&&(r||i.slice(y,y+s)===t)){c.push(i.slice(f,y)),f=y+s;continue}if(v==="/"){d=y;continue}}v==="["?l++:v==="]"&&l--}const h=c.length===0?i:i.substring(f),m=h.startsWith(Jm),g=m?h.substring(1):h,p=d&&d>f?d-f:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:p}};return n?i=>n({className:i,parseClassName:a}):a},uE=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},dE=e=>({cache:cE(e.cacheSize),parseClassName:lE(e),...rE(e)}),fE=/\s+/,hE=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],a=e.trim().split(fE);let i="";for(let c=a.length-1;c>=0;c-=1){const l=a[c],{modifiers:f,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:m}=n(l);let g=!!m,p=r(g?h.substring(0,m):h);if(!p){if(!g){i=l+(i.length>0?" "+i:i);continue}if(p=r(h),!p){i=l+(i.length>0?" "+i:i);continue}g=!1}const y=uE(f).join(":"),v=d?y+Jm:y,b=v+p;if(s.includes(b))continue;s.push(b);const x=o(p,g);for(let j=0;j<x.length;++j){const N=x[j];s.push(v+N)}i=l+(i.length>0?" "+i:i)}return i};function mE(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Zm(t))&&(r&&(r+=" "),r+=n);return r}const Zm=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Zm(e[r]))&&(n&&(n+=" "),n+=t);return n};function pd(e,...t){let n,r,o,s=a;function a(c){const l=t.reduce((f,d)=>d(f),e());return n=dE(l),r=n.cache.get,o=n.cache.set,s=i,i(c)}function i(c){const l=r(c);if(l)return l;const f=hE(c,n);return o(c,f),f}return function(){return s(mE.apply(null,arguments))}}const Ee=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Qm=/^\[(?:([a-z-]+):)?(.+)\]$/i,pE=/^\d+\/\d+$/,gE=new Set(["px","full","screen"]),yE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xE=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,vE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,bE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Zt=e=>pr(e)||gE.has(e)||pE.test(e),fn=e=>Ar(e,"length",ME),pr=e=>!!e&&!Number.isNaN(Number(e)),di=e=>Ar(e,"number",pr),qr=e=>!!e&&Number.isInteger(Number(e)),jE=e=>e.endsWith("%")&&pr(e.slice(0,-1)),he=e=>Qm.test(e),hn=e=>yE.test(e),SE=new Set(["length","size","percentage"]),CE=e=>Ar(e,SE,ep),NE=e=>Ar(e,"position",ep),EE=new Set(["image","url"]),_E=e=>Ar(e,EE,DE),kE=e=>Ar(e,"",PE),Gr=()=>!0,Ar=(e,t,n)=>{const r=Qm.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},ME=e=>xE.test(e)&&!vE.test(e),ep=()=>!1,PE=e=>bE.test(e),DE=e=>wE.test(e),gd=()=>{const e=Ee("colors"),t=Ee("spacing"),n=Ee("blur"),r=Ee("brightness"),o=Ee("borderColor"),s=Ee("borderRadius"),a=Ee("borderSpacing"),i=Ee("borderWidth"),c=Ee("contrast"),l=Ee("grayscale"),f=Ee("hueRotate"),d=Ee("invert"),h=Ee("gap"),m=Ee("gradientColorStops"),g=Ee("gradientColorStopPositions"),p=Ee("inset"),y=Ee("margin"),v=Ee("opacity"),b=Ee("padding"),x=Ee("saturate"),j=Ee("scale"),N=Ee("sepia"),S=Ee("skew"),E=Ee("space"),O=Ee("translate"),P=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto",he,t],M=()=>[he,t],W=()=>["",Zt,fn],_=()=>["auto",pr,he],I=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],R=()=>["solid","dashed","dotted","double","none"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",he],B=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[pr,he];return{cacheSize:500,separator:":",theme:{colors:[Gr],spacing:[Zt,fn],blur:["none","",hn,he],brightness:q(),borderColor:[e],borderRadius:["none","","full",hn,he],borderSpacing:M(),borderWidth:W(),contrast:q(),grayscale:D(),hueRotate:q(),invert:D(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[jE,fn],inset:k(),margin:k(),opacity:q(),padding:M(),saturate:q(),scale:q(),sepia:D(),skew:q(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",he]}],container:["container"],columns:[{columns:[hn]}],"break-after":[{"break-after":B()}],"break-before":[{"break-before":B()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...I(),he]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",qr,he]}],basis:[{basis:k()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",he]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",qr,he]}],"grid-cols":[{"grid-cols":[Gr]}],"col-start-end":[{col:["auto",{span:["full",qr,he]},he]}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":[Gr]}],"row-start-end":[{row:["auto",{span:[qr,he]},he]}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",he]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",he]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...A()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...A(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...A(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",he,t]}],"min-w":[{"min-w":[he,t,"min","max","fit"]}],"max-w":[{"max-w":[he,t,"none","full","min","max","fit","prose",{screen:[hn]},hn]}],h:[{h:[he,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[he,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[he,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[he,t,"auto","min","max","fit"]}],"font-size":[{text:["base",hn,fn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",di]}],"font-family":[{font:[Gr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",he]}],"line-clamp":[{"line-clamp":["none",pr,di]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Zt,he]}],"list-image":[{"list-image":["none",he]}],"list-style-type":[{list:["none","disc","decimal",he]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...R(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Zt,fn]}],"underline-offset":[{"underline-offset":["auto",Zt,he]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...I(),NE]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",CE]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_E]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...R(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:R()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...R()]}],"outline-offset":[{"outline-offset":[Zt,he]}],"outline-w":[{outline:[Zt,fn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Zt,fn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",hn,kE]}],"shadow-color":[{shadow:[Gr]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",hn,he]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",he]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",he]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",he]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[qr,he]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",he]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Zt,fn,di]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},OE=(e,{cacheSize:t,prefix:n,separator:r,experimentalParseClassName:o,extend:s={},override:a={}})=>{ro(e,"cacheSize",t),ro(e,"prefix",n),ro(e,"separator",r),ro(e,"experimentalParseClassName",o);for(const i in a)RE(e[i],a[i]);for(const i in s)AE(e[i],s[i]);return e},ro=(e,t,n)=>{n!==void 0&&(e[t]=n)},RE=(e,t)=>{if(t)for(const n in t)ro(e,n,t[n])},AE=(e,t)=>{if(t)for(const n in t){const r=t[n];r!==void 0&&(e[n]=(e[n]||[]).concat(r))}},TE=(e,...t)=>typeof e=="function"?pd(gd,e,...t):pd(()=>OE(gd(),e),...t),IE=TE({prefix:"cj-"});function ce(...e){return IE(Xm(e))}const yd=({className:e,...t})=>u.jsx(qm,{className:ce("cj-flex cj-h-full cj-w-full data-[panel-group-direction=vertical]:cj-flex-col",e),...t}),Ur=km,fi=({withHandle:e,className:t,...n})=>u.jsx(Gm,{className:ce("cj-relative cj-flex cj-w-px cj-items-center cj-justify-center cj-bg-border after:cj-absolute after:cj-inset-y-0 after:cj-left-1/2 after:cj-w-1 after:-cj-translate-x-1/2 data-[panel-group-direction=vertical]:cj-h-px data-[panel-group-direction=vertical]:cj-w-full data-[panel-group-direction=vertical]:after:cj-left-0 data-[panel-group-direction=vertical]:after:cj-h-1 data-[panel-group-direction=vertical]:after:cj-w-full data-[panel-group-direction=vertical]:after:-cj-translate-y-1/2 data-[panel-group-direction=vertical]:after:cj-translate-x-0 focus-visible:cj-outline-none focus-visible:cj-ring-1 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-1 [&[data-panel-group-direction=vertical]>div]:cj-rotate-90",t),...n,children:e&&u.jsx("div",{className:"cj-z-10 cj-flex cj-h-4 cj-w-3 cj-items-center cj-justify-center cj-rounded-sm cj-border cj-bg-border",children:u.jsx(jm,{className:"cj-h-2.5 cj-w-2.5"})})}),ze=w.forwardRef(({className:e,type:t,...n},r)=>u.jsx("input",{type:t,className:ce("cj-flex cj-h-10 cj-w-full cj-rounded-md cj-border cj-border-input cj-bg-background cj-px-3 cj-py-2 cj-text-base cj-ring-offset-background file:cj-border-0 file:cj-bg-transparent file:cj-text-sm file:cj-font-medium file:cj-text-foreground placeholder:cj-text-muted-foreground focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-cursor-not-allowed disabled:cj-opacity-50 md:cj-text-sm",e),ref:r,...n}));ze.displayName="Input";const xd=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,vd=Xm,ma=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return vd(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,a=Object.keys(o).map(l=>{const f=n==null?void 0:n[l],d=s==null?void 0:s[l];if(f===null)return null;const h=xd(f)||xd(d);return o[l][h]}),i=n&&Object.entries(n).reduce((l,f)=>{let[d,h]=f;return h===void 0||(l[d]=h),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,f)=>{let{class:d,className:h,...m}=f;return Object.entries(m).every(g=>{let[p,y]=g;return Array.isArray(y)?y.includes({...s,...i}[p]):{...s,...i}[p]===y})?[...l,d,h]:l},[]);return vd(e,a,c,n==null?void 0:n.class,n==null?void 0:n.className)},$E=ma("cj-inline-flex cj-items-center cj-rounded-full cj-border cj-px-2.5 cj-py-0.5 cj-text-xs cj-font-semibold cj-transition-colors focus:cj-outline-none focus:cj-ring-2 focus:cj-ring-ring focus:cj-ring-offset-2",{variants:{variant:{default:"cj-border-transparent cj-bg-primary cj-text-primary-foreground hover:cj-bg-primary/80",secondary:"cj-border-transparent cj-bg-secondary cj-text-secondary-foreground hover:cj-bg-secondary/80",destructive:"cj-border-transparent cj-bg-destructive cj-text-destructive-foreground hover:cj-bg-destructive/80",outline:"cj-text-foreground"}},defaultVariants:{variant:"default"}});function ct({className:e,variant:t,...n}){return u.jsx("div",{className:ce($E({variant:t}),e),...n})}function bd(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Un(...e){return t=>{let n=!1;const r=e.map(o=>{const s=bd(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():bd(e[o],null)}}}}function pe(...e){return w.useCallback(Un(...e),e)}var zE=Symbol.for("react.lazy"),Ws=w[" use ".trim().toString()];function LE(e){return typeof e=="object"&&e!==null&&"then"in e}function tp(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===zE&&"_payload"in e&&LE(e._payload)}function pa(e){const t=FE(e),n=w.forwardRef((r,o)=>{let{children:s,...a}=r;tp(s)&&typeof Ws=="function"&&(s=Ws(s._payload));const i=w.Children.toArray(s),c=i.find(HE);if(c){const l=c.props.children,f=i.map(d=>d===c?w.Children.count(l)>1?w.Children.only(null):w.isValidElement(l)?l.props.children:null:d);return u.jsx(t,{...a,ref:o,children:w.isValidElement(l)?w.cloneElement(l,void 0,f):null})}return u.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var WE=pa("Slot");function FE(e){const t=w.forwardRef((n,r)=>{let{children:o,...s}=n;if(tp(o)&&typeof Ws=="function"&&(o=Ws(o._payload)),w.isValidElement(o)){const a=YE(o),i=VE(s,o.props);return o.type!==w.Fragment&&(i.ref=r?Un(r,a):a),w.cloneElement(o,i)}return w.Children.count(o)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var BE=Symbol("radix.slottable");function HE(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===BE}function VE(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const c=s(...i);return o(...i),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function YE(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const ws=ma("cj-inline-flex cj-items-center cj-justify-center cj-gap-2 cj-whitespace-nowrap cj-rounded-md cj-text-sm cj-font-medium cj-ring-offset-background cj-transition-colors focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-pointer-events-none disabled:cj-opacity-50 [&_svg]:cj-pointer-events-none [&_svg]:cj-size-4 [&_svg]:cj-shrink-0",{variants:{variant:{default:"cj-bg-primary cj-text-primary-foreground hover:cj-bg-primary/90",destructive:"cj-bg-destructive cj-text-destructive-foreground hover:cj-bg-destructive/90",outline:"cj-border cj-border-input cj-bg-background hover:cj-bg-accent hover:cj-text-accent-foreground",secondary:"cj-bg-secondary cj-text-secondary-foreground hover:cj-bg-secondary/80",ghost:"hover:cj-bg-accent hover:cj-text-accent-foreground",link:"cj-text-primary cj-underline-offset-4 hover:cj-underline"},size:{default:"cj-h-10 cj-px-4 cj-py-2",sm:"cj-h-9 cj-rounded-md cj-px-3",lg:"cj-h-11 cj-rounded-md cj-px-8",icon:"cj-h-10 cj-w-10"}},defaultVariants:{variant:"default",size:"default"}}),fe=w.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const a=r?WE:"button";return u.jsx(a,{className:ce(ws({variant:t,size:n,className:e})),ref:s,...o})});fe.displayName="Button";function qE(e){const t=GE(e),n=w.forwardRef((r,o)=>{const{children:s,...a}=r,i=w.Children.toArray(s),c=i.find(XE);if(c){const l=c.props.children,f=i.map(d=>d===c?w.Children.count(l)>1?w.Children.only(null):w.isValidElement(l)?l.props.children:null:d);return u.jsx(t,{...a,ref:o,children:w.isValidElement(l)?w.cloneElement(l,void 0,f):null})}return u.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function GE(e){const t=w.forwardRef((n,r)=>{const{children:o,...s}=n;if(w.isValidElement(o)){const a=JE(o),i=KE(s,o.props);return o.type!==w.Fragment&&(i.ref=r?Un(r,a):a),w.cloneElement(o,i)}return w.Children.count(o)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var UE=Symbol("radix.slottable");function XE(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===UE}function KE(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const c=s(...i);return o(...i),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function JE(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ZE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ie=ZE.reduce((e,t)=>{const n=qE(`Primitive.${t}`),r=w.forwardRef((o,s)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function QE(e,t){e&&Zs.flushSync(()=>e.dispatchEvent(t))}var We=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{};function e_(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var Ye=e=>{const{present:t,children:n}=e,r=t_(t),o=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),s=pe(r.ref,n_(o));return typeof n=="function"||r.isPresent?w.cloneElement(o,{ref:s}):null};Ye.displayName="Presence";function t_(e){const[t,n]=w.useState(),r=w.useRef(null),o=w.useRef(e),s=w.useRef("none"),a=e?"mounted":"unmounted",[i,c]=e_(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const l=cs(r.current);s.current=i==="mounted"?l:"none"},[i]),We(()=>{const l=r.current,f=o.current;if(f!==e){const h=s.current,m=cs(l);e?c("MOUNT"):m==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(f&&h!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),We(()=>{if(t){let l;const f=t.ownerDocument.defaultView??window,d=m=>{const p=cs(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&p&&(c("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",l=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=m=>{m.target===t&&(s.current=cs(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:w.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function cs(e){return(e==null?void 0:e.animationName)||"none"}function n_(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function r_(e,t){const n=w.createContext(t),r=s=>{const{children:a,...i}=s,c=w.useMemo(()=>i,Object.values(i));return u.jsx(n.Provider,{value:c,children:a})};r.displayName=e+"Provider";function o(s){const a=w.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Ze(e,t=[]){let n=[];function r(s,a){const i=w.createContext(a),c=n.length;n=[...n,a];const l=d=>{var v;const{scope:h,children:m,...g}=d,p=((v=h==null?void 0:h[e])==null?void 0:v[c])||i,y=w.useMemo(()=>g,Object.values(g));return u.jsx(p.Provider,{value:y,children:m})};l.displayName=s+"Provider";function f(d,h){var p;const m=((p=h==null?void 0:h[e])==null?void 0:p[c])||i,g=w.useContext(m);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,f]}const o=()=>{const s=n.map(a=>w.createContext(a));return function(i){const c=(i==null?void 0:i[e])||s;return w.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return o.scopeName=e,[r,o_(o,...t)]}function o_(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((i,{useScope:c,scopeName:l})=>{const d=c(s)[`__scope${l}`];return{...i,...d}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Ge(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var s_=w.createContext(void 0);function Lo(e){const t=w.useContext(s_);return e||t||"ltr"}function Ji(e,[t,n]){return Math.min(n,Math.max(t,e))}function te(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function a_(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var Fc="ScrollArea",[np]=Ze(Fc),[i_,dt]=np(Fc),rp=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...a}=e,[i,c]=w.useState(null),[l,f]=w.useState(null),[d,h]=w.useState(null),[m,g]=w.useState(null),[p,y]=w.useState(null),[v,b]=w.useState(0),[x,j]=w.useState(0),[N,S]=w.useState(!1),[E,O]=w.useState(!1),P=pe(t,k=>c(k)),T=Lo(o);return u.jsx(i_,{scope:n,type:r,dir:T,scrollHideDelay:s,scrollArea:i,viewport:l,onViewportChange:f,content:d,onContentChange:h,scrollbarX:m,onScrollbarXChange:g,scrollbarXEnabled:N,onScrollbarXEnabledChange:S,scrollbarY:p,onScrollbarYChange:y,scrollbarYEnabled:E,onScrollbarYEnabledChange:O,onCornerWidthChange:b,onCornerHeightChange:j,children:u.jsx(ie.div,{dir:T,...a,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});rp.displayName=Fc;var op="ScrollAreaViewport",sp=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...s}=e,a=dt(op,n),i=w.useRef(null),c=pe(t,i,a.onViewportChange);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),u.jsx(ie.div,{"data-radix-scroll-area-viewport":"",...s,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:u.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});sp.displayName=op;var qt="ScrollAreaScrollbar",Bc=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=dt(qt,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:a}=o,i=e.orientation==="horizontal";return w.useEffect(()=>(i?s(!0):a(!0),()=>{i?s(!1):a(!1)}),[i,s,a]),o.type==="hover"?u.jsx(c_,{...r,ref:t,forceMount:n}):o.type==="scroll"?u.jsx(l_,{...r,ref:t,forceMount:n}):o.type==="auto"?u.jsx(ap,{...r,ref:t,forceMount:n}):o.type==="always"?u.jsx(Hc,{...r,ref:t}):null});Bc.displayName=qt;var c_=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=dt(qt,e.__scopeScrollArea),[s,a]=w.useState(!1);return w.useEffect(()=>{const i=o.scrollArea;let c=0;if(i){const l=()=>{window.clearTimeout(c),a(!0)},f=()=>{c=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return i.addEventListener("pointerenter",l),i.addEventListener("pointerleave",f),()=>{window.clearTimeout(c),i.removeEventListener("pointerenter",l),i.removeEventListener("pointerleave",f)}}},[o.scrollArea,o.scrollHideDelay]),u.jsx(Ye,{present:n||s,children:u.jsx(ap,{"data-state":s?"visible":"hidden",...r,ref:t})})}),l_=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=dt(qt,e.__scopeScrollArea),s=e.orientation==="horizontal",a=ya(()=>c("SCROLL_END"),100),[i,c]=a_("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(i==="idle"){const l=window.setTimeout(()=>c("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(l)}},[i,o.scrollHideDelay,c]),w.useEffect(()=>{const l=o.viewport,f=s?"scrollLeft":"scrollTop";if(l){let d=l[f];const h=()=>{const m=l[f];d!==m&&(c("SCROLL"),a()),d=m};return l.addEventListener("scroll",h),()=>l.removeEventListener("scroll",h)}},[o.viewport,s,c,a]),u.jsx(Ye,{present:n||i!=="hidden",children:u.jsx(Hc,{"data-state":i==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:te(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:te(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),ap=w.forwardRef((e,t)=>{const n=dt(qt,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,a]=w.useState(!1),i=e.orientation==="horizontal",c=ya(()=>{if(n.viewport){const l=n.viewport.offsetWidth<n.viewport.scrollWidth,f=n.viewport.offsetHeight<n.viewport.scrollHeight;a(i?l:f)}},10);return _r(n.viewport,c),_r(n.content,c),u.jsx(Ye,{present:r||s,children:u.jsx(Hc,{"data-state":s?"visible":"hidden",...o,ref:t})})}),Hc=w.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=dt(qt,e.__scopeScrollArea),s=w.useRef(null),a=w.useRef(0),[i,c]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=dp(i.viewport,i.content),f={...r,sizes:i,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:h=>s.current=h,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:h=>a.current=h};function d(h,m){return p_(h,a.current,i,m)}return n==="horizontal"?u.jsx(u_,{...f,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const h=o.viewport.scrollLeft,m=wd(h,i,o.dir);s.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollLeft=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollLeft=d(h,o.dir))}}):n==="vertical"?u.jsx(d_,{...f,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const h=o.viewport.scrollTop,m=wd(h,i);s.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollTop=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollTop=d(h))}}):null}),u_=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=dt(qt,e.__scopeScrollArea),[a,i]=w.useState(),c=w.useRef(null),l=pe(t,c,s.onScrollbarXChange);return w.useEffect(()=>{c.current&&i(getComputedStyle(c.current))},[c]),u.jsx(cp,{"data-orientation":"horizontal",...o,ref:l,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ga(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,d)=>{if(s.viewport){const h=s.viewport.scrollLeft+f.deltaX;e.onWheelScroll(h),hp(h,d)&&f.preventDefault()}},onResize:()=>{c.current&&s.viewport&&a&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Bs(a.paddingLeft),paddingEnd:Bs(a.paddingRight)}})}})}),d_=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=dt(qt,e.__scopeScrollArea),[a,i]=w.useState(),c=w.useRef(null),l=pe(t,c,s.onScrollbarYChange);return w.useEffect(()=>{c.current&&i(getComputedStyle(c.current))},[c]),u.jsx(cp,{"data-orientation":"vertical",...o,ref:l,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ga(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,d)=>{if(s.viewport){const h=s.viewport.scrollTop+f.deltaY;e.onWheelScroll(h),hp(h,d)&&f.preventDefault()}},onResize:()=>{c.current&&s.viewport&&a&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Bs(a.paddingTop),paddingEnd:Bs(a.paddingBottom)}})}})}),[f_,ip]=np(qt),cp=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:a,onThumbPointerDown:i,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:f,onResize:d,...h}=e,m=dt(qt,n),[g,p]=w.useState(null),y=pe(t,P=>p(P)),v=w.useRef(null),b=w.useRef(""),x=m.viewport,j=r.content-r.viewport,N=Ge(f),S=Ge(c),E=ya(d,10);function O(P){if(v.current){const T=P.clientX-v.current.left,k=P.clientY-v.current.top;l({x:T,y:k})}}return w.useEffect(()=>{const P=T=>{const k=T.target;(g==null?void 0:g.contains(k))&&N(T,j)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[x,g,j,N]),w.useEffect(S,[r,S]),_r(g,E),_r(m.content,E),u.jsx(f_,{scope:n,scrollbar:g,hasThumb:o,onThumbChange:Ge(s),onThumbPointerUp:Ge(a),onThumbPositionChange:S,onThumbPointerDown:Ge(i),children:u.jsx(ie.div,{...h,ref:y,style:{position:"absolute",...h.style},onPointerDown:te(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),v.current=g.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),O(P))}),onPointerMove:te(e.onPointerMove,O),onPointerUp:te(e.onPointerUp,P=>{const T=P.target;T.hasPointerCapture(P.pointerId)&&T.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=b.current,m.viewport&&(m.viewport.style.scrollBehavior=""),v.current=null})})})}),Fs="ScrollAreaThumb",lp=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ip(Fs,e.__scopeScrollArea);return u.jsx(Ye,{present:n||o.hasThumb,children:u.jsx(h_,{ref:t,...r})})}),h_=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=dt(Fs,n),a=ip(Fs,n),{onThumbPositionChange:i}=a,c=pe(t,d=>a.onThumbChange(d)),l=w.useRef(void 0),f=ya(()=>{l.current&&(l.current(),l.current=void 0)},100);return w.useEffect(()=>{const d=s.viewport;if(d){const h=()=>{if(f(),!l.current){const m=g_(d,i);l.current=m,i()}};return i(),d.addEventListener("scroll",h),()=>d.removeEventListener("scroll",h)}},[s.viewport,f,i]),u.jsx(ie.div,{"data-state":a.hasThumb?"visible":"hidden",...o,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:te(e.onPointerDownCapture,d=>{const m=d.target.getBoundingClientRect(),g=d.clientX-m.left,p=d.clientY-m.top;a.onThumbPointerDown({x:g,y:p})}),onPointerUp:te(e.onPointerUp,a.onThumbPointerUp)})});lp.displayName=Fs;var Vc="ScrollAreaCorner",up=w.forwardRef((e,t)=>{const n=dt(Vc,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?u.jsx(m_,{...e,ref:t}):null});up.displayName=Vc;var m_=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=dt(Vc,n),[s,a]=w.useState(0),[i,c]=w.useState(0),l=!!(s&&i);return _r(o.scrollbarX,()=>{var d;const f=((d=o.scrollbarX)==null?void 0:d.offsetHeight)||0;o.onCornerHeightChange(f),c(f)}),_r(o.scrollbarY,()=>{var d;const f=((d=o.scrollbarY)==null?void 0:d.offsetWidth)||0;o.onCornerWidthChange(f),a(f)}),l?u.jsx(ie.div,{...r,ref:t,style:{width:s,height:i,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Bs(e){return e?parseInt(e,10):0}function dp(e,t){const n=e/t;return isNaN(n)?0:n}function ga(e){const t=dp(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function p_(e,t,n,r="ltr"){const o=ga(n),s=o/2,a=t||s,i=o-a,c=n.scrollbar.paddingStart+a,l=n.scrollbar.size-n.scrollbar.paddingEnd-i,f=n.content-n.viewport,d=r==="ltr"?[0,f]:[f*-1,0];return fp([c,l],d)(e)}function wd(e,t,n="ltr"){const r=ga(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,a=t.content-t.viewport,i=s-r,c=n==="ltr"?[0,a]:[a*-1,0],l=Ji(e,c);return fp([0,a],[0,i])(l)}function fp(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function hp(e,t){return e>0&&e<t}var g_=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},a=n.left!==s.left,i=n.top!==s.top;(a||i)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function ya(e,t){const n=Ge(e),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function _r(e,t){const n=Ge(t);We(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var mp=rp,y_=sp,x_=up;const Tr=w.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(mp,{ref:r,className:ce("cj-relative cj-overflow-hidden",e),...n,children:[u.jsx(y_,{className:"cj-h-full cj-w-full cj-rounded-[inherit]",children:t}),u.jsx(pp,{}),u.jsx(x_,{})]}));Tr.displayName=mp.displayName;const pp=w.forwardRef(({className:e,orientation:t="vertical",...n},r)=>u.jsx(Bc,{ref:r,orientation:t,className:ce("cj-flex cj-touch-none cj-select-none cj-transition-colors",t==="vertical"&&"cj-h-full cj-w-2.5 cj-border-l cj-border-l-transparent cj-p-[1px]",t==="horizontal"&&"cj-h-2.5 cj-flex-col cj-border-t cj-border-t-transparent cj-p-[1px]",e),...n,children:u.jsx(lp,{className:"cj-relative cj-flex-1 cj-rounded-full cj-bg-border"})}));pp.displayName=Bc.displayName;function jd(e){const t=v_(e),n=w.forwardRef((r,o)=>{const{children:s,...a}=r,i=w.Children.toArray(s),c=i.find(w_);if(c){const l=c.props.children,f=i.map(d=>d===c?w.Children.count(l)>1?w.Children.only(null):w.isValidElement(l)?l.props.children:null:d);return u.jsx(t,{...a,ref:o,children:w.isValidElement(l)?w.cloneElement(l,void 0,f):null})}return u.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function v_(e){const t=w.forwardRef((n,r)=>{const{children:o,...s}=n;if(w.isValidElement(o)){const a=S_(o),i=j_(s,o.props);return o.type!==w.Fragment&&(i.ref=r?Un(r,a):a),w.cloneElement(o,i)}return w.Children.count(o)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var b_=Symbol("radix.slottable");function w_(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===b_}function j_(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const c=s(...i);return o(...i),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function S_(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function gp(e){const t=e+"CollectionProvider",[n,r]=Ze(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:y,children:v}=p,b=C.useRef(null),x=C.useRef(new Map).current;return u.jsx(o,{scope:y,itemMap:x,collectionRef:b,children:v})};a.displayName=t;const i=e+"CollectionSlot",c=jd(i),l=C.forwardRef((p,y)=>{const{scope:v,children:b}=p,x=s(i,v),j=pe(y,x.collectionRef);return u.jsx(c,{ref:j,children:b})});l.displayName=i;const f=e+"CollectionItemSlot",d="data-radix-collection-item",h=jd(f),m=C.forwardRef((p,y)=>{const{scope:v,children:b,...x}=p,j=C.useRef(null),N=pe(y,j),S=s(f,v);return C.useEffect(()=>(S.itemMap.set(j,{ref:j,...x}),()=>void S.itemMap.delete(j))),u.jsx(h,{[d]:"",ref:N,children:b})});m.displayName=f;function g(p){const y=s(e+"CollectionConsumer",p);return C.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const x=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((S,E)=>x.indexOf(S.ref.current)-x.indexOf(E.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:a,Slot:l,ItemSlot:m},g,r]}function C_(e,t=globalThis==null?void 0:globalThis.document){const n=Ge(e);w.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var N_="DismissableLayer",Zi="dismissableLayer.update",E_="dismissableLayer.pointerDownOutside",__="dismissableLayer.focusOutside",Sd,yp=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wo=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:i,...c}=e,l=w.useContext(yp),[f,d]=w.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=w.useState({}),g=pe(t,E=>d(E)),p=Array.from(l.layers),[y]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(y),b=f?p.indexOf(f):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,j=b>=v,N=P_(E=>{const O=E.target,P=[...l.branches].some(T=>T.contains(O));!j||P||(o==null||o(E),a==null||a(E),E.defaultPrevented||i==null||i())},h),S=D_(E=>{const O=E.target;[...l.branches].some(T=>T.contains(O))||(s==null||s(E),a==null||a(E),E.defaultPrevented||i==null||i())},h);return C_(E=>{b===l.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&i&&(E.preventDefault(),i()))},h),w.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Sd=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),Cd(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Sd)}},[f,h,n,l]),w.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),Cd())},[f,l]),w.useEffect(()=>{const E=()=>m({});return document.addEventListener(Zi,E),()=>document.removeEventListener(Zi,E)},[]),u.jsx(ie.div,{...c,ref:g,style:{pointerEvents:x?j?"auto":"none":void 0,...e.style},onFocusCapture:te(e.onFocusCapture,S.onFocusCapture),onBlurCapture:te(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:te(e.onPointerDownCapture,N.onPointerDownCapture)})});Wo.displayName=N_;var k_="DismissableLayerBranch",M_=w.forwardRef((e,t)=>{const n=w.useContext(yp),r=w.useRef(null),o=pe(t,r);return w.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),u.jsx(ie.div,{...e,ref:o})});M_.displayName=k_;function P_(e,t=globalThis==null?void 0:globalThis.document){const n=Ge(e),r=w.useRef(!1),o=w.useRef(()=>{});return w.useEffect(()=>{const s=i=>{if(i.target&&!r.current){let c=function(){xp(E_,n,l,{discrete:!0})};const l={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function D_(e,t=globalThis==null?void 0:globalThis.document){const n=Ge(e),r=w.useRef(!1);return w.useEffect(()=>{const o=s=>{s.target&&!r.current&&xp(__,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Cd(){const e=new CustomEvent(Zi);document.dispatchEvent(e)}function xp(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?QE(o,s):o.dispatchEvent(s)}var hi=0;function Yc(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Nd()),document.body.insertAdjacentElement("beforeend",e[1]??Nd()),hi++,()=>{hi===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),hi--}},[])}function Nd(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var mi="focusScope.autoFocusOnMount",pi="focusScope.autoFocusOnUnmount",Ed={bubbles:!1,cancelable:!0},O_="FocusScope",xa=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=e,[i,c]=w.useState(null),l=Ge(o),f=Ge(s),d=w.useRef(null),h=pe(t,p=>c(p)),m=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let p=function(x){if(m.paused||!i)return;const j=x.target;i.contains(j)?d.current=j:gn(d.current,{select:!0})},y=function(x){if(m.paused||!i)return;const j=x.relatedTarget;j!==null&&(i.contains(j)||gn(d.current,{select:!0}))},v=function(x){if(document.activeElement===document.body)for(const N of x)N.removedNodes.length>0&&gn(i)};document.addEventListener("focusin",p),document.addEventListener("focusout",y);const b=new MutationObserver(v);return i&&b.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",y),b.disconnect()}}},[r,i,m.paused]),w.useEffect(()=>{if(i){kd.add(m);const p=document.activeElement;if(!i.contains(p)){const v=new CustomEvent(mi,Ed);i.addEventListener(mi,l),i.dispatchEvent(v),v.defaultPrevented||(R_(z_(vp(i)),{select:!0}),document.activeElement===p&&gn(i))}return()=>{i.removeEventListener(mi,l),setTimeout(()=>{const v=new CustomEvent(pi,Ed);i.addEventListener(pi,f),i.dispatchEvent(v),v.defaultPrevented||gn(p??document.body,{select:!0}),i.removeEventListener(pi,f),kd.remove(m)},0)}}},[i,l,f,m]);const g=w.useCallback(p=>{if(!n&&!r||m.paused)return;const y=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,v=document.activeElement;if(y&&v){const b=p.currentTarget,[x,j]=A_(b);x&&j?!p.shiftKey&&v===j?(p.preventDefault(),n&&gn(x,{select:!0})):p.shiftKey&&v===x&&(p.preventDefault(),n&&gn(j,{select:!0})):v===b&&p.preventDefault()}},[n,r,m.paused]);return u.jsx(ie.div,{tabIndex:-1,...a,ref:h,onKeyDown:g})});xa.displayName=O_;function R_(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(gn(r,{select:t}),document.activeElement!==n)return}function A_(e){const t=vp(e),n=_d(t,e),r=_d(t.reverse(),e);return[n,r]}function vp(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function _d(e,t){for(const n of e)if(!T_(n,{upTo:t}))return n}function T_(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function I_(e){return e instanceof HTMLInputElement&&"select"in e}function gn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&I_(e)&&t&&e.select()}}var kd=$_();function $_(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Md(e,t),e.unshift(t)},remove(t){var n;e=Md(e,t),(n=e[0])==null||n.resume()}}}function Md(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function z_(e){return e.filter(t=>t.tagName!=="A")}var L_=w[" useId ".trim().toString()]||(()=>{}),W_=0;function jt(e){const[t,n]=w.useState(L_());return We(()=>{n(r=>r??String(W_++))},[e]),t?`radix-${t}`:""}const F_=["top","right","bottom","left"],wn=Math.min,rt=Math.max,Hs=Math.round,ls=Math.floor,Ht=e=>({x:e,y:e}),B_={left:"right",right:"left",bottom:"top",top:"bottom"},H_={start:"end",end:"start"};function Qi(e,t,n){return rt(e,wn(t,n))}function an(e,t){return typeof e=="function"?e(t):e}function cn(e){return e.split("-")[0]}function Ir(e){return e.split("-")[1]}function qc(e){return e==="x"?"y":"x"}function Gc(e){return e==="y"?"height":"width"}const V_=new Set(["top","bottom"]);function zt(e){return V_.has(cn(e))?"y":"x"}function Uc(e){return qc(zt(e))}function Y_(e,t,n){n===void 0&&(n=!1);const r=Ir(e),o=Uc(e),s=Gc(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Vs(a)),[a,Vs(a)]}function q_(e){const t=Vs(e);return[ec(e),t,ec(t)]}function ec(e){return e.replace(/start|end/g,t=>H_[t])}const Pd=["left","right"],Dd=["right","left"],G_=["top","bottom"],U_=["bottom","top"];function X_(e,t,n){switch(e){case"top":case"bottom":return n?t?Dd:Pd:t?Pd:Dd;case"left":case"right":return t?G_:U_;default:return[]}}function K_(e,t,n,r){const o=Ir(e);let s=X_(cn(e),n==="start",r);return o&&(s=s.map(a=>a+"-"+o),t&&(s=s.concat(s.map(ec)))),s}function Vs(e){return e.replace(/left|right|bottom|top/g,t=>B_[t])}function J_(e){return{top:0,right:0,bottom:0,left:0,...e}}function bp(e){return typeof e!="number"?J_(e):{top:e,right:e,bottom:e,left:e}}function Ys(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Od(e,t,n){let{reference:r,floating:o}=e;const s=zt(t),a=Uc(t),i=Gc(a),c=cn(t),l=s==="y",f=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[i]/2-o[i]/2;let m;switch(c){case"top":m={x:f,y:r.y-o.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-o.width,y:d};break;default:m={x:r.x,y:r.y}}switch(Ir(t)){case"start":m[a]-=h*(n&&l?-1:1);break;case"end":m[a]+=h*(n&&l?-1:1);break}return m}async function Z_(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:a,elements:i,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:h=!1,padding:m=0}=an(t,e),g=bp(m),y=i[h?d==="floating"?"reference":"floating":d],v=Ys(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:l,rootBoundary:f,strategy:c})),b=d==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(i.floating)),j=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},N=Ys(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:b,offsetParent:x,strategy:c}):b);return{top:(v.top-N.top+g.top)/j.y,bottom:(N.bottom-v.bottom+g.bottom)/j.y,left:(v.left-N.left+g.left)/j.x,right:(N.right-v.right+g.right)/j.x}}const Q_=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:a}=n,i=s.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:d}=Od(l,r,c),h=r,m={},g=0;for(let y=0;y<i.length;y++){var p;const{name:v,fn:b}=i[y],{x,y:j,data:N,reset:S}=await b({x:f,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:m,rects:l,platform:{...a,detectOverflow:(p=a.detectOverflow)!=null?p:Z_},elements:{reference:e,floating:t}});f=x??f,d=j??d,m={...m,[v]:{...m[v],...N}},S&&g<=50&&(g++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(l=S.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:f,y:d}=Od(l,h,c)),y=-1)}return{x:f,y:d,placement:h,strategy:o,middlewareData:m}},ek=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:a,elements:i,middlewareData:c}=t,{element:l,padding:f=0}=an(e,t)||{};if(l==null)return{};const d=bp(f),h={x:n,y:r},m=Uc(o),g=Gc(m),p=await a.getDimensions(l),y=m==="y",v=y?"top":"left",b=y?"bottom":"right",x=y?"clientHeight":"clientWidth",j=s.reference[g]+s.reference[m]-h[m]-s.floating[g],N=h[m]-s.reference[m],S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let E=S?S[x]:0;(!E||!await(a.isElement==null?void 0:a.isElement(S)))&&(E=i.floating[x]||s.floating[g]);const O=j/2-N/2,P=E/2-p[g]/2-1,T=wn(d[v],P),k=wn(d[b],P),M=T,W=E-p[g]-k,_=E/2-p[g]/2+O,I=Qi(M,_,W),R=!c.arrow&&Ir(o)!=null&&_!==I&&s.reference[g]/2-(_<M?T:k)-p[g]/2<0,z=R?_<M?_-M:_-W:0;return{[m]:h[m]+z,data:{[m]:I,centerOffset:_-I-z,...R&&{alignmentOffset:z}},reset:R}}}),tk=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:a,initialPlacement:i,platform:c,elements:l}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...y}=an(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=cn(o),b=zt(i),x=cn(i)===i,j=await(c.isRTL==null?void 0:c.isRTL(l.floating)),N=h||(x||!p?[Vs(i)]:q_(i)),S=g!=="none";!h&&S&&N.push(...K_(i,p,g,j));const E=[i,...N],O=await c.detectOverflow(t,y),P=[];let T=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&P.push(O[v]),d){const _=Y_(o,a,j);P.push(O[_[0]],O[_[1]])}if(T=[...T,{placement:o,overflows:P}],!P.every(_=>_<=0)){var k,M;const _=(((k=s.flip)==null?void 0:k.index)||0)+1,I=E[_];if(I&&(!(d==="alignment"?b!==zt(I):!1)||T.every(A=>zt(A.placement)===b?A.overflows[0]>0:!0)))return{data:{index:_,overflows:T},reset:{placement:I}};let R=(M=T.filter(z=>z.overflows[0]<=0).sort((z,A)=>z.overflows[1]-A.overflows[1])[0])==null?void 0:M.placement;if(!R)switch(m){case"bestFit":{var W;const z=(W=T.filter(A=>{if(S){const D=zt(A.placement);return D===b||D==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(D=>D>0).reduce((D,B)=>D+B,0)]).sort((A,D)=>A[1]-D[1])[0])==null?void 0:W[0];z&&(R=z);break}case"initialPlacement":R=i;break}if(o!==R)return{reset:{placement:R}}}return{}}}};function Rd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ad(e){return F_.some(t=>e[t]>=0)}const nk=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=an(e,t);switch(o){case"referenceHidden":{const a=await r.detectOverflow(t,{...s,elementContext:"reference"}),i=Rd(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Ad(i)}}}case"escaped":{const a=await r.detectOverflow(t,{...s,altBoundary:!0}),i=Rd(a,n.floating);return{data:{escapedOffsets:i,escaped:Ad(i)}}}default:return{}}}}},wp=new Set(["left","top"]);async function rk(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=cn(n),i=Ir(n),c=zt(n)==="y",l=wp.has(a)?-1:1,f=s&&c?-1:1,d=an(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return i&&typeof g=="number"&&(m=i==="end"?g*-1:g),c?{x:m*f,y:h*l}:{x:h*l,y:m*f}}const ok=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:a,middlewareData:i}=t,c=await rk(t,e);return a===((n=i.offset)==null?void 0:n.placement)&&(r=i.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:a}}}}},sk=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:c={fn:v=>{let{x:b,y:x}=v;return{x:b,y:x}}},...l}=an(e,t),f={x:n,y:r},d=await s.detectOverflow(t,l),h=zt(cn(o)),m=qc(h);let g=f[m],p=f[h];if(a){const v=m==="y"?"top":"left",b=m==="y"?"bottom":"right",x=g+d[v],j=g-d[b];g=Qi(x,g,j)}if(i){const v=h==="y"?"top":"left",b=h==="y"?"bottom":"right",x=p+d[v],j=p-d[b];p=Qi(x,p,j)}const y=c.fn({...t,[m]:g,[h]:p});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[m]:a,[h]:i}}}}}},ak=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:a}=t,{offset:i=0,mainAxis:c=!0,crossAxis:l=!0}=an(e,t),f={x:n,y:r},d=zt(o),h=qc(d);let m=f[h],g=f[d];const p=an(i,t),y=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const x=h==="y"?"height":"width",j=s.reference[h]-s.floating[x]+y.mainAxis,N=s.reference[h]+s.reference[x]-y.mainAxis;m<j?m=j:m>N&&(m=N)}if(l){var v,b;const x=h==="y"?"width":"height",j=wp.has(cn(o)),N=s.reference[d]-s.floating[x]+(j&&((v=a.offset)==null?void 0:v[d])||0)+(j?0:y.crossAxis),S=s.reference[d]+s.reference[x]+(j?0:((b=a.offset)==null?void 0:b[d])||0)-(j?y.crossAxis:0);g<N?g=N:g>S&&(g=S)}return{[h]:m,[d]:g}}}},ik=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:a,elements:i}=t,{apply:c=()=>{},...l}=an(e,t),f=await a.detectOverflow(t,l),d=cn(o),h=Ir(o),m=zt(o)==="y",{width:g,height:p}=s.floating;let y,v;d==="top"||d==="bottom"?(y=d,v=h===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(v=d,y=h==="end"?"top":"bottom");const b=p-f.top-f.bottom,x=g-f.left-f.right,j=wn(p-f[y],b),N=wn(g-f[v],x),S=!t.middlewareData.shift;let E=j,O=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=b),S&&!h){const T=rt(f.left,0),k=rt(f.right,0),M=rt(f.top,0),W=rt(f.bottom,0);m?O=g-2*(T!==0||k!==0?T+k:rt(f.left,f.right)):E=p-2*(M!==0||W!==0?M+W:rt(f.top,f.bottom))}await c({...t,availableWidth:O,availableHeight:E});const P=await a.getDimensions(i.floating);return g!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function va(){return typeof window<"u"}function $r(e){return jp(e)?(e.nodeName||"").toLowerCase():"#document"}function st(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Gt(e){var t;return(t=(jp(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function jp(e){return va()?e instanceof Node||e instanceof st(e).Node:!1}function St(e){return va()?e instanceof Element||e instanceof st(e).Element:!1}function Vt(e){return va()?e instanceof HTMLElement||e instanceof st(e).HTMLElement:!1}function Td(e){return!va()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof st(e).ShadowRoot}const ck=new Set(["inline","contents"]);function Fo(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ct(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ck.has(o)}const lk=new Set(["table","td","th"]);function uk(e){return lk.has($r(e))}const dk=[":popover-open",":modal"];function ba(e){return dk.some(t=>{try{return e.matches(t)}catch{return!1}})}const fk=["transform","translate","scale","rotate","perspective"],hk=["transform","translate","scale","rotate","perspective","filter"],mk=["paint","layout","strict","content"];function Xc(e){const t=Kc(),n=St(e)?Ct(e):e;return fk.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||hk.some(r=>(n.willChange||"").includes(r))||mk.some(r=>(n.contain||"").includes(r))}function pk(e){let t=jn(e);for(;Vt(t)&&!kr(t);){if(Xc(t))return t;if(ba(t))return null;t=jn(t)}return null}function Kc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const gk=new Set(["html","body","#document"]);function kr(e){return gk.has($r(e))}function Ct(e){return st(e).getComputedStyle(e)}function wa(e){return St(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jn(e){if($r(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Td(e)&&e.host||Gt(e);return Td(t)?t.host:t}function Sp(e){const t=jn(e);return kr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vt(t)&&Fo(t)?t:Sp(t)}function Co(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Sp(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),a=st(o);if(s){const i=tc(a);return t.concat(a,a.visualViewport||[],Fo(o)?o:[],i&&n?Co(i):[])}return t.concat(o,Co(o,[],n))}function tc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Cp(e){const t=Ct(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Vt(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,i=Hs(n)!==s||Hs(r)!==a;return i&&(n=s,r=a),{width:n,height:r,$:i}}function Jc(e){return St(e)?e:e.contextElement}function gr(e){const t=Jc(e);if(!Vt(t))return Ht(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Cp(t);let a=(s?Hs(n.width):n.width)/r,i=(s?Hs(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const yk=Ht(0);function Np(e){const t=st(e);return!Kc()||!t.visualViewport?yk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xk(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==st(e)?!1:t}function Hn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Jc(e);let a=Ht(1);t&&(r?St(r)&&(a=gr(r)):a=gr(e));const i=xk(s,n,r)?Np(s):Ht(0);let c=(o.left+i.x)/a.x,l=(o.top+i.y)/a.y,f=o.width/a.x,d=o.height/a.y;if(s){const h=st(s),m=r&&St(r)?st(r):r;let g=h,p=tc(g);for(;p&&r&&m!==g;){const y=gr(p),v=p.getBoundingClientRect(),b=Ct(p),x=v.left+(p.clientLeft+parseFloat(b.paddingLeft))*y.x,j=v.top+(p.clientTop+parseFloat(b.paddingTop))*y.y;c*=y.x,l*=y.y,f*=y.x,d*=y.y,c+=x,l+=j,g=st(p),p=tc(g)}}return Ys({width:f,height:d,x:c,y:l})}function ja(e,t){const n=wa(e).scrollLeft;return t?t.left+n:Hn(Gt(e)).left+n}function Ep(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ja(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function vk(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",a=Gt(r),i=t?ba(t.floating):!1;if(r===a||i&&s)return n;let c={scrollLeft:0,scrollTop:0},l=Ht(1);const f=Ht(0),d=Vt(r);if((d||!d&&!s)&&(($r(r)!=="body"||Fo(a))&&(c=wa(r)),Vt(r))){const m=Hn(r);l=gr(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const h=a&&!d&&!s?Ep(a,c):Ht(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+f.x+h.x,y:n.y*l.y-c.scrollTop*l.y+f.y+h.y}}function bk(e){return Array.from(e.getClientRects())}function wk(e){const t=Gt(e),n=wa(e),r=e.ownerDocument.body,o=rt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=rt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ja(e);const i=-n.scrollTop;return Ct(r).direction==="rtl"&&(a+=rt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:a,y:i}}const Id=25;function jk(e,t){const n=st(e),r=Gt(e),o=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,i=0,c=0;if(o){s=o.width,a=o.height;const f=Kc();(!f||f&&t==="fixed")&&(i=o.offsetLeft,c=o.offsetTop)}const l=ja(r);if(l<=0){const f=r.ownerDocument,d=f.body,h=getComputedStyle(d),m=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(r.clientWidth-d.clientWidth-m);g<=Id&&(s-=g)}else l<=Id&&(s+=l);return{width:s,height:a,x:i,y:c}}const Sk=new Set(["absolute","fixed"]);function Ck(e,t){const n=Hn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Vt(e)?gr(e):Ht(1),a=e.clientWidth*s.x,i=e.clientHeight*s.y,c=o*s.x,l=r*s.y;return{width:a,height:i,x:c,y:l}}function $d(e,t,n){let r;if(t==="viewport")r=jk(e,n);else if(t==="document")r=wk(Gt(e));else if(St(t))r=Ck(t,n);else{const o=Np(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ys(r)}function _p(e,t){const n=jn(e);return n===t||!St(n)||kr(n)?!1:Ct(n).position==="fixed"||_p(n,t)}function Nk(e,t){const n=t.get(e);if(n)return n;let r=Co(e,[],!1).filter(i=>St(i)&&$r(i)!=="body"),o=null;const s=Ct(e).position==="fixed";let a=s?jn(e):e;for(;St(a)&&!kr(a);){const i=Ct(a),c=Xc(a);!c&&i.position==="fixed"&&(o=null),(s?!c&&!o:!c&&i.position==="static"&&!!o&&Sk.has(o.position)||Fo(a)&&!c&&_p(e,a))?r=r.filter(f=>f!==a):o=i,a=jn(a)}return t.set(e,r),r}function Ek(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?ba(t)?[]:Nk(t,this._c):[].concat(n),r],i=a[0],c=a.reduce((l,f)=>{const d=$d(t,f,o);return l.top=rt(d.top,l.top),l.right=wn(d.right,l.right),l.bottom=wn(d.bottom,l.bottom),l.left=rt(d.left,l.left),l},$d(t,i,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function _k(e){const{width:t,height:n}=Cp(e);return{width:t,height:n}}function kk(e,t,n){const r=Vt(t),o=Gt(t),s=n==="fixed",a=Hn(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const c=Ht(0);function l(){c.x=ja(o)}if(r||!r&&!s)if(($r(t)!=="body"||Fo(o))&&(i=wa(t)),r){const m=Hn(t,!0,s,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else o&&l();s&&!r&&o&&l();const f=o&&!r&&!s?Ep(o,i):Ht(0),d=a.left+i.scrollLeft-c.x-f.x,h=a.top+i.scrollTop-c.y-f.y;return{x:d,y:h,width:a.width,height:a.height}}function gi(e){return Ct(e).position==="static"}function zd(e,t){if(!Vt(e)||Ct(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Gt(e)===n&&(n=n.ownerDocument.body),n}function kp(e,t){const n=st(e);if(ba(e))return n;if(!Vt(e)){let o=jn(e);for(;o&&!kr(o);){if(St(o)&&!gi(o))return o;o=jn(o)}return n}let r=zd(e,t);for(;r&&uk(r)&&gi(r);)r=zd(r,t);return r&&kr(r)&&gi(r)&&!Xc(r)?n:r||pk(e)||n}const Mk=async function(e){const t=this.getOffsetParent||kp,n=this.getDimensions,r=await n(e.floating);return{reference:kk(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Pk(e){return Ct(e).direction==="rtl"}const Dk={convertOffsetParentRelativeRectToViewportRelativeRect:vk,getDocumentElement:Gt,getClippingRect:Ek,getOffsetParent:kp,getElementRects:Mk,getClientRects:bk,getDimensions:_k,getScale:gr,isElement:St,isRTL:Pk};function Mp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ok(e,t){let n=null,r;const o=Gt(e);function s(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function a(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:f,top:d,width:h,height:m}=l;if(i||t(),!h||!m)return;const g=ls(d),p=ls(o.clientWidth-(f+h)),y=ls(o.clientHeight-(d+m)),v=ls(f),x={rootMargin:-g+"px "+-p+"px "+-y+"px "+-v+"px",threshold:rt(0,wn(1,c))||1};let j=!0;function N(S){const E=S[0].intersectionRatio;if(E!==c){if(!j)return a();E?a(!1,E):r=setTimeout(()=>{a(!1,1e-7)},1e3)}E===1&&!Mp(l,e.getBoundingClientRect())&&a(),j=!1}try{n=new IntersectionObserver(N,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(N,x)}n.observe(e)}return a(!0),s}function Rk(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=Jc(e),f=o||s?[...l?Co(l):[],...Co(t)]:[];f.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=l&&i?Ok(l,n):null;let h=-1,m=null;a&&(m=new ResizeObserver(v=>{let[b]=v;b&&b.target===l&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),l&&!c&&m.observe(l),m.observe(t));let g,p=c?Hn(e):null;c&&y();function y(){const v=Hn(e);p&&!Mp(p,v)&&n(),p=v,g=requestAnimationFrame(y)}return n(),()=>{var v;f.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),d==null||d(),(v=m)==null||v.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const Ak=ok,Tk=sk,Ik=tk,$k=ik,zk=nk,Ld=ek,Lk=ak,Wk=(e,t,n)=>{const r=new Map,o={platform:Dk,...n},s={...o.platform,_c:r};return Q_(e,t,{...o,platform:s})};var Fk=typeof document<"u",Bk=function(){},js=Fk?C.useLayoutEffect:Bk;function qs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!qs(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!qs(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Pp(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Wd(e,t){const n=Pp(e);return Math.round(t*n)/n}function yi(e){const t=w.useRef(e);return js(()=>{t.current=e}),t}function Hk(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:a}={},transform:i=!0,whileElementsMounted:c,open:l}=e,[f,d]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=w.useState(r);qs(h,r)||m(r);const[g,p]=w.useState(null),[y,v]=w.useState(null),b=w.useCallback(A=>{A!==S.current&&(S.current=A,p(A))},[]),x=w.useCallback(A=>{A!==E.current&&(E.current=A,v(A))},[]),j=s||g,N=a||y,S=w.useRef(null),E=w.useRef(null),O=w.useRef(f),P=c!=null,T=yi(c),k=yi(o),M=yi(l),W=w.useCallback(()=>{if(!S.current||!E.current)return;const A={placement:t,strategy:n,middleware:h};k.current&&(A.platform=k.current),Wk(S.current,E.current,A).then(D=>{const B={...D,isPositioned:M.current!==!1};_.current&&!qs(O.current,B)&&(O.current=B,Zs.flushSync(()=>{d(B)}))})},[h,t,n,k,M]);js(()=>{l===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(A=>({...A,isPositioned:!1})))},[l]);const _=w.useRef(!1);js(()=>(_.current=!0,()=>{_.current=!1}),[]),js(()=>{if(j&&(S.current=j),N&&(E.current=N),j&&N){if(T.current)return T.current(j,N,W);W()}},[j,N,W,T,P]);const I=w.useMemo(()=>({reference:S,floating:E,setReference:b,setFloating:x}),[b,x]),R=w.useMemo(()=>({reference:j,floating:N}),[j,N]),z=w.useMemo(()=>{const A={position:n,left:0,top:0};if(!R.floating)return A;const D=Wd(R.floating,f.x),B=Wd(R.floating,f.y);return i?{...A,transform:"translate("+D+"px, "+B+"px)",...Pp(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:B}},[n,i,R.floating,f.x,f.y]);return w.useMemo(()=>({...f,update:W,refs:I,elements:R,floatingStyles:z}),[f,W,I,R,z])}const Vk=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Ld({element:r.current,padding:o}).fn(n):{}:r?Ld({element:r,padding:o}).fn(n):{}}}},Yk=(e,t)=>({...Ak(e),options:[e,t]}),qk=(e,t)=>({...Tk(e),options:[e,t]}),Gk=(e,t)=>({...Lk(e),options:[e,t]}),Uk=(e,t)=>({...Ik(e),options:[e,t]}),Xk=(e,t)=>({...$k(e),options:[e,t]}),Kk=(e,t)=>({...zk(e),options:[e,t]}),Jk=(e,t)=>({...Vk(e),options:[e,t]});var Zk="Arrow",Dp=w.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return u.jsx(ie.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});Dp.displayName=Zk;var Qk=Dp;function Sa(e){const[t,n]=w.useState(void 0);return We(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let a,i;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;a=l.inlineSize,i=l.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Zc="Popper",[Op,zr]=Ze(Zc),[eM,Rp]=Op(Zc),Ap=e=>{const{__scopePopper:t,children:n}=e,[r,o]=w.useState(null);return u.jsx(eM,{scope:t,anchor:r,onAnchorChange:o,children:n})};Ap.displayName=Zc;var Tp="PopperAnchor",Ip=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Rp(Tp,n),a=w.useRef(null),i=pe(t,a),c=w.useRef(null);return w.useEffect(()=>{const l=c.current;c.current=(r==null?void 0:r.current)||a.current,l!==c.current&&s.onAnchorChange(c.current)}),r?null:u.jsx(ie.div,{...o,ref:i})});Ip.displayName=Tp;var Qc="PopperContent",[tM,nM]=Op(Qc),$p=w.forwardRef((e,t)=>{var $,F,U,X,Z,K;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:g,...p}=e,y=Rp(Qc,n),[v,b]=w.useState(null),x=pe(t,J=>b(J)),[j,N]=w.useState(null),S=Sa(j),E=(S==null?void 0:S.width)??0,O=(S==null?void 0:S.height)??0,P=r+(s!=="center"?"-"+s:""),T=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(l)?l:[l],M=k.length>0,W={padding:T,boundary:k.filter(oM),altBoundary:M},{refs:_,floatingStyles:I,placement:R,isPositioned:z,middlewareData:A}=Hk({strategy:"fixed",placement:P,whileElementsMounted:(...J)=>Rk(...J,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[Yk({mainAxis:o+O,alignmentAxis:a}),c&&qk({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Gk():void 0,...W}),c&&Uk({...W}),Xk({...W,apply:({elements:J,rects:ee,availableWidth:se,availableHeight:ae})=>{const{width:ue,height:ve}=ee.reference,ke=J.floating.style;ke.setProperty("--radix-popper-available-width",`${se}px`),ke.setProperty("--radix-popper-available-height",`${ae}px`),ke.setProperty("--radix-popper-anchor-width",`${ue}px`),ke.setProperty("--radix-popper-anchor-height",`${ve}px`)}}),j&&Jk({element:j,padding:i}),sM({arrowWidth:E,arrowHeight:O}),h&&Kk({strategy:"referenceHidden",...W})]}),[D,B]=Wp(R),q=Ge(g);We(()=>{z&&(q==null||q())},[z,q]);const V=($=A.arrow)==null?void 0:$.x,H=(F=A.arrow)==null?void 0:F.y,L=((U=A.arrow)==null?void 0:U.centerOffset)!==0,[Y,G]=w.useState();return We(()=>{v&&G(window.getComputedStyle(v).zIndex)},[v]),u.jsx("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:z?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(X=A.transformOrigin)==null?void 0:X.x,(Z=A.transformOrigin)==null?void 0:Z.y].join(" "),...((K=A.hide)==null?void 0:K.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(tM,{scope:n,placedSide:D,onArrowChange:N,arrowX:V,arrowY:H,shouldHideArrow:L,children:u.jsx(ie.div,{"data-side":D,"data-align":B,...p,ref:x,style:{...p.style,animation:z?void 0:"none"}})})})});$p.displayName=Qc;var zp="PopperArrow",rM={top:"bottom",right:"left",bottom:"top",left:"right"},Lp=w.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=nM(zp,r),a=rM[s.placedSide];return u.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:u.jsx(Qk,{...o,ref:n,style:{...o.style,display:"block"}})})});Lp.displayName=zp;function oM(e){return e!==null}var sM=e=>({name:"transformOrigin",options:e,fn(t){var y,v,b;const{placement:n,rects:r,middlewareData:o}=t,a=((y=o.arrow)==null?void 0:y.centerOffset)!==0,i=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[l,f]=Wp(n),d={start:"0%",center:"50%",end:"100%"}[f],h=(((v=o.arrow)==null?void 0:v.x)??0)+i/2,m=(((b=o.arrow)==null?void 0:b.y)??0)+c/2;let g="",p="";return l==="bottom"?(g=a?d:`${h}px`,p=`${-c}px`):l==="top"?(g=a?d:`${h}px`,p=`${r.floating.height+c}px`):l==="right"?(g=`${-c}px`,p=a?d:`${m}px`):l==="left"&&(g=`${r.floating.width+c}px`,p=a?d:`${m}px`),{data:{x:g,y:p}}}});function Wp(e){const[t,n="center"]=e.split("-");return[t,n]}var el=Ap,Ca=Ip,tl=$p,nl=Lp,aM="Portal",Bo=w.forwardRef((e,t)=>{var i;const{container:n,...r}=e,[o,s]=w.useState(!1);We(()=>s(!0),[]);const a=n||o&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return a?Js.createPortal(u.jsx(ie.div,{...r,ref:t}),a):null});Bo.displayName=aM;function iM(e){const t=cM(e),n=w.forwardRef((r,o)=>{const{children:s,...a}=r,i=w.Children.toArray(s),c=i.find(uM);if(c){const l=c.props.children,f=i.map(d=>d===c?w.Children.count(l)>1?w.Children.only(null):w.isValidElement(l)?l.props.children:null:d);return u.jsx(t,{...a,ref:o,children:w.isValidElement(l)?w.cloneElement(l,void 0,f):null})}return u.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function cM(e){const t=w.forwardRef((n,r)=>{const{children:o,...s}=n;if(w.isValidElement(o)){const a=fM(o),i=dM(s,o.props);return o.type!==w.Fragment&&(i.ref=r?Un(r,a):a),w.cloneElement(o,i)}return w.Children.count(o)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lM=Symbol("radix.slottable");function uM(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lM}function dM(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const c=s(...i);return o(...i),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function fM(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var hM=w[" useInsertionEffect ".trim().toString()]||We;function Nt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,a]=mM({defaultProp:t,onChange:n}),i=e!==void 0,c=i?e:o;{const f=w.useRef(e!==void 0);w.useEffect(()=>{const d=f.current;d!==i&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=i},[i,r])}const l=w.useCallback(f=>{var d;if(i){const h=pM(f)?f(e):f;h!==e&&((d=a.current)==null||d.call(a,h))}else s(f)},[i,e,s,a]);return[c,l]}function mM({defaultProp:e,onChange:t}){const[n,r]=w.useState(e),o=w.useRef(n),s=w.useRef(t);return hM(()=>{s.current=t},[t]),w.useEffect(()=>{var a;o.current!==n&&((a=s.current)==null||a.call(s,n),o.current=n)},[n,o]),[n,r,s]}function pM(e){return typeof e=="function"}function Na(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Fp=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),gM="VisuallyHidden",Bp=w.forwardRef((e,t)=>u.jsx(ie.span,{...e,ref:t,style:{...Fp,...e.style}}));Bp.displayName=gM;var yM=Bp,xM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},tr=new WeakMap,us=new WeakMap,ds={},xi=0,Hp=function(e){return e&&(e.host||Hp(e.parentNode))},vM=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Hp(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},bM=function(e,t,n,r){var o=vM(t,Array.isArray(e)?e:[e]);ds[n]||(ds[n]=new WeakMap);var s=ds[n],a=[],i=new Set,c=new Set(o),l=function(d){!d||i.has(d)||(i.add(d),l(d.parentNode))};o.forEach(l);var f=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(h){if(i.has(h))f(h);else try{var m=h.getAttribute(r),g=m!==null&&m!=="false",p=(tr.get(h)||0)+1,y=(s.get(h)||0)+1;tr.set(h,p),s.set(h,y),a.push(h),p===1&&g&&us.set(h,!0),y===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return f(t),i.clear(),xi++,function(){a.forEach(function(d){var h=tr.get(d)-1,m=s.get(d)-1;tr.set(d,h),s.set(d,m),h||(us.has(d)||d.removeAttribute(r),us.delete(d)),m||d.removeAttribute(n)}),xi--,xi||(tr=new WeakMap,tr=new WeakMap,us=new WeakMap,ds={})}},rl=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=xM(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),bM(r,o,n,"aria-hidden")):function(){return null}},$t=function(){return $t=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},$t.apply(this,arguments)};function Vp(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function wM(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Ss="right-scroll-bar-position",Cs="width-before-scroll-bar",jM="with-scroll-bars-hidden",SM="--removed-body-scroll-bar-size";function vi(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function CM(e,t){var n=C.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var NM=typeof window<"u"?w.useLayoutEffect:w.useEffect,Fd=new WeakMap;function EM(e,t){var n=CM(null,function(r){return e.forEach(function(o){return vi(o,r)})});return NM(function(){var r=Fd.get(n);if(r){var o=new Set(r),s=new Set(e),a=n.current;o.forEach(function(i){s.has(i)||vi(i,null)}),s.forEach(function(i){o.has(i)||vi(i,a)})}Fd.set(n,e)},[e]),n}function _M(e){return e}function kM(e,t){t===void 0&&(t=_M);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(i){return s(i)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(s),a=n}var c=function(){var f=a;a=[],f.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(f){a.push(f),l()},filter:function(f){return a=a.filter(f),n}}}};return o}function MM(e){e===void 0&&(e={});var t=kM(null);return t.options=$t({async:!0,ssr:!1},e),t}var Yp=function(e){var t=e.sideCar,n=Vp(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,$t({},n))};Yp.isSideCarExport=!0;function PM(e,t){return e.useMedium(t),Yp}var qp=MM(),bi=function(){},Ea=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:bi,onWheelCapture:bi,onTouchMoveCapture:bi}),o=r[0],s=r[1],a=e.forwardProps,i=e.children,c=e.className,l=e.removeScrollBar,f=e.enabled,d=e.shards,h=e.sideCar,m=e.noRelative,g=e.noIsolation,p=e.inert,y=e.allowPinchZoom,v=e.as,b=v===void 0?"div":v,x=e.gapMode,j=Vp(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=h,S=EM([n,t]),E=$t($t({},j),o);return w.createElement(w.Fragment,null,f&&w.createElement(N,{sideCar:qp,removeScrollBar:l,shards:d,noRelative:m,noIsolation:g,inert:p,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:x}),a?w.cloneElement(w.Children.only(i),$t($t({},E),{ref:S})):w.createElement(b,$t({},E,{className:c,ref:S}),i))});Ea.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ea.classNames={fullWidth:Cs,zeroRight:Ss};var DM=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function OM(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=DM();return t&&e.setAttribute("nonce",t),e}function RM(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function AM(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var TM=function(){var e=0,t=null;return{add:function(n){e==0&&(t=OM())&&(RM(t,n),AM(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},IM=function(){var e=TM();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Gp=function(){var e=IM(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},$M={left:0,top:0,right:0,gap:0},wi=function(e){return parseInt(e||"",10)||0},zM=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[wi(n),wi(r),wi(o)]},LM=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $M;var t=zM(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},WM=Gp(),yr="data-scroll-locked",FM=function(e,t,n,r){var o=e.left,s=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),`
|
|
251
|
-
|
|
251
|
+
*/const kr=ge("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
252
|
+
* @license lucide-react v0.462.0 - ISC
|
|
253
|
+
*
|
|
254
|
+
* This source code is licensed under the ISC license.
|
|
255
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
+
*/const eE=ge("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function tE({data:e,selected:t}){const n=Er(e.schema),r=e.isCurrentPreviewNode,o=e.isInPreviewPath,a=e.actor==="customer"?"cj-bg-blue-50 dark:cj-bg-blue-950":"cj-bg-muted",s=r?"cj-border-primary cj-ring-2 cj-ring-primary/30 cj-shadow-lg cj-shadow-primary/20":o?"cj-border-primary/50":t?"cj-border-primary cj-ring-2 cj-ring-primary/20":"cj-border-border";return d.jsxs("div",{className:`
|
|
257
|
+
cj-min-w-[220px] cj-rounded-lg cj-border-2 cj-p-3 cj-shadow-sm cj-transition-all
|
|
258
|
+
cj-bg-background ${a} ${s}
|
|
259
|
+
`,children:[d.jsx(Nr,{type:"target",position:oe.Top,className:"!cj-bg-primary !cj-w-3 !cj-h-3 !cj-border-2 !cj-border-background hover:!cj-w-4 hover:!cj-h-4 hover:!cj-bg-primary/80 cj-transition-all cj-duration-150"}),d.jsxs("div",{className:"cj-space-y-2",children:[d.jsxs("div",{className:"cj-flex cj-items-center cj-gap-1 cj-flex-wrap",children:[d.jsx(ct,{variant:"secondary",className:`cj-text-[10px] ${n.color} cj-text-white`,children:n.label}),e.widget&&d.jsxs(ct,{variant:"outline",className:"cj-text-[10px]",children:["→ ",e.widget]})]}),d.jsx("div",{className:"cj-font-medium cj-text-sm cj-leading-tight",children:e.labelOverride||e.label}),d.jsx("div",{className:"cj-text-xs cj-text-muted-foreground cj-font-mono",children:e.namespace}),d.jsx("div",{className:"cj-flex cj-items-center cj-gap-1 cj-text-xs cj-text-muted-foreground",children:e.actor==="customer"?d.jsxs(d.Fragment,{children:[d.jsx(Vc,{className:"cj-h-3 cj-w-3"}),d.jsx("span",{children:"Customer"})]}):d.jsxs(d.Fragment,{children:[d.jsx(Op,{className:"cj-h-3 cj-w-3"}),d.jsx("span",{children:"Operator"})]})})]}),d.jsx(Nr,{type:"source",position:oe.Bottom,className:"!cj-bg-primary !cj-w-3 !cj-h-3 !cj-border-2 !cj-border-background hover:!cj-w-4 hover:!cj-h-4 hover:!cj-bg-primary/80 cj-transition-all cj-duration-150"})]})}const nE=_.memo(tE),rE={"==":"=","!=":"≠",">":">","<":"<",">=":"≥","<=":"≤",in:"∈"};function Vp(e){var l;const t=Object.keys(e)[0];if(t==="and"||t==="or"){const u=e[t];if(!Array.isArray(u))return t.toUpperCase();const f=u.map(Vp).filter(Boolean),h=t==="and"?" & ":" | ",p=f.join(h);return p.length>48?p.slice(0,45)+"…":p}const n=e[t];if(!Array.isArray(n)||n.length<2)return t;const r=n[0],o=((l=r==null?void 0:r.var)==null?void 0:l.replace("answers.",""))??"?",a=o.length>18?o.slice(0,15)+"…":o;if(n[1]===null)return t==="=="?`${a} is null`:`${a} is not null`;const s=rE[t]||t,i=String(n[1]),c=i.length>14?i.slice(0,11)+"…":i;return`${a} ${s} ${c}`}function oE({id:e,sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:a,targetPosition:s,data:i,selected:c}){const[l,u,f]=Rc({sourceX:t,sourceY:n,sourcePosition:a,targetX:r,targetY:o,targetPosition:s}),h=(i==null?void 0:i.isDefault)??!1,p=(i==null?void 0:i.condition)&&Object.keys(i.condition).length>0,m=(i==null?void 0:i.isInPreviewPath)??!1,g=h?"default":p?Vp(i.condition):null,v=m||c?"hsl(262, 83%, 58%)":h?"hsl(220, 14%, 50%)":p?"hsl(142, 71%, 45%)":"hsl(220, 14%, 40%)",w=m||c?5:3,x=`arrow-${e}`,j=p&&!h?"8 4":void 0;return d.jsxs(d.Fragment,{children:[d.jsx("defs",{children:d.jsx("marker",{id:x,markerWidth:"20",markerHeight:"20",refX:"16",refY:"10",orient:"auto",markerUnits:"userSpaceOnUse",children:d.jsx("path",{d:"M4,4 L16,10 L4,16 L7,10 Z",fill:v,stroke:v,strokeWidth:"1",strokeLinejoin:"round",style:{transition:"fill 0.2s, stroke 0.2s"}})})}),d.jsx("path",{d:l,fill:"none",stroke:c?"hsl(262, 83%, 58%)":"hsl(220, 14%, 20%)",strokeWidth:w+4,strokeLinecap:"round",style:{opacity:.3,filter:c?"blur(3px)":"blur(2px)"}}),d.jsx(Fo,{id:e,path:l,markerEnd:`url(#${x})`,style:{stroke:v,strokeWidth:w,strokeLinecap:"round",strokeDasharray:j,transition:"stroke 0.2s, stroke-width 0.2s"}}),d.jsx("path",{d:l,fill:"none",stroke:"transparent",strokeWidth:24,style:{cursor:"pointer"}}),g&&d.jsx(YS,{children:d.jsx("div",{className:`
|
|
260
|
+
cj-absolute cj-pointer-events-auto cj-px-2 cj-py-0.5 cj-rounded cj-text-[10px] cj-font-mono cj-font-medium
|
|
261
|
+
cj-border cj-shadow-sm cj-cursor-pointer cj-transition-all cj-max-w-[200px] cj-truncate
|
|
262
|
+
${c?"cj-bg-primary cj-text-primary-foreground cj-border-primary":h?"cj-bg-muted cj-text-muted-foreground cj-border-border":"cj-bg-card cj-text-foreground cj-border-border"}
|
|
263
|
+
`,style:{transform:`translate(-50%, -50%) translate(${u}px, ${f}px)`},children:g})})]})}const aE=_.memo(oE);function wu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xn(...e){return t=>{let n=!1;const r=e.map(o=>{const a=wu(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():wu(e[o],null)}}}}function me(...e){return b.useCallback(Xn(...e),e)}var sE=Symbol.for("react.lazy"),Ba=b[" use ".trim().toString()];function iE(e){return typeof e=="object"&&e!==null&&"then"in e}function Yp(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===sE&&"_payload"in e&&iE(e._payload)}function ms(e){const t=lE(e),n=b.forwardRef((r,o)=>{let{children:a,...s}=r;Yp(a)&&typeof Ba=="function"&&(a=Ba(a._payload));const i=b.Children.toArray(a),c=i.find(uE);if(c){const l=c.props.children,u=i.map(f=>f===c?b.Children.count(l)>1?b.Children.only(null):b.isValidElement(l)?l.props.children:null:f);return d.jsx(t,{...s,ref:o,children:b.isValidElement(l)?b.cloneElement(l,void 0,u):null})}return d.jsx(t,{...s,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}var cE=ms("Slot");function lE(e){const t=b.forwardRef((n,r)=>{let{children:o,...a}=n;if(Yp(o)&&typeof Ba=="function"&&(o=Ba(o._payload)),b.isValidElement(o)){const s=hE(o),i=fE(a,o.props);return o.type!==b.Fragment&&(i.ref=r?Xn(r,s):s),b.cloneElement(o,i)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dE=Symbol("radix.slottable");function uE(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dE}function fE(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{const c=a(...i);return o(...i),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function hE(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Sa=ps("cj-inline-flex cj-items-center cj-justify-center cj-gap-2 cj-whitespace-nowrap cj-rounded-md cj-text-sm cj-font-medium cj-ring-offset-background cj-transition-colors focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-pointer-events-none disabled:cj-opacity-50 [&_svg]:cj-pointer-events-none [&_svg]:cj-size-4 [&_svg]:cj-shrink-0",{variants:{variant:{default:"cj-bg-primary cj-text-primary-foreground hover:cj-bg-primary/90",destructive:"cj-bg-destructive cj-text-destructive-foreground hover:cj-bg-destructive/90",outline:"cj-border cj-border-input cj-bg-background hover:cj-bg-accent hover:cj-text-accent-foreground",secondary:"cj-bg-secondary cj-text-secondary-foreground hover:cj-bg-secondary/80",ghost:"hover:cj-bg-accent hover:cj-text-accent-foreground",link:"cj-text-primary cj-underline-offset-4 hover:cj-underline"},size:{default:"cj-h-10 cj-px-4 cj-py-2",sm:"cj-h-9 cj-rounded-md cj-px-3",lg:"cj-h-11 cj-rounded-md cj-px-8",icon:"cj-h-10 cj-w-10"}},defaultVariants:{variant:"default",size:"default"}}),fe=b.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},a)=>{const s=r?cE:"button";return d.jsx(s,{className:ie(Sa({variant:t,size:n,className:e})),ref:a,...o})});fe.displayName="Button";function te(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function pE(e,t){const n=b.createContext(t),r=a=>{const{children:s,...i}=a,c=b.useMemo(()=>i,Object.values(i));return d.jsx(n.Provider,{value:c,children:s})};r.displayName=e+"Provider";function o(a){const s=b.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,o]}function Ze(e,t=[]){let n=[];function r(a,s){const i=b.createContext(s),c=n.length;n=[...n,s];const l=f=>{var v;const{scope:h,children:p,...m}=f,g=((v=h==null?void 0:h[e])==null?void 0:v[c])||i,y=b.useMemo(()=>m,Object.values(m));return d.jsx(g.Provider,{value:y,children:p})};l.displayName=a+"Provider";function u(f,h){var g;const p=((g=h==null?void 0:h[e])==null?void 0:g[c])||i,m=b.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[l,u]}const o=()=>{const a=n.map(s=>b.createContext(s));return function(i){const c=(i==null?void 0:i[e])||a;return b.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return o.scopeName=e,[r,mE(o,...t)]}function mE(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const s=r.reduce((i,{useScope:c,scopeName:l})=>{const f=c(a)[`__scope${l}`];return{...i,...f}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function gE(e){const t=yE(e),n=b.forwardRef((r,o)=>{const{children:a,...s}=r,i=b.Children.toArray(a),c=i.find(vE);if(c){const l=c.props.children,u=i.map(f=>f===c?b.Children.count(l)>1?b.Children.only(null):b.isValidElement(l)?l.props.children:null:f);return d.jsx(t,{...s,ref:o,children:b.isValidElement(l)?b.cloneElement(l,void 0,u):null})}return d.jsx(t,{...s,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function yE(e){const t=b.forwardRef((n,r)=>{const{children:o,...a}=n;if(b.isValidElement(o)){const s=wE(o),i=bE(a,o.props);return o.type!==b.Fragment&&(i.ref=r?Xn(r,s):s),b.cloneElement(o,i)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xE=Symbol("radix.slottable");function vE(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xE}function bE(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{const c=a(...i);return o(...i),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function wE(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var jE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],se=jE.reduce((e,t)=>{const n=gE(`Primitive.${t}`),r=b.forwardRef((o,a)=>{const{asChild:s,...i}=o,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(c,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function _E(e,t){e&&ns.flushSync(()=>e.dispatchEvent(t))}function Ge(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function SE(e,t=globalThis==null?void 0:globalThis.document){const n=Ge(e);b.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var CE="DismissableLayer",nc="dismissableLayer.update",NE="dismissableLayer.pointerDownOutside",EE="dismissableLayer.focusOutside",ju,qp=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Bo=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:i,...c}=e,l=b.useContext(qp),[u,f]=b.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=b.useState({}),m=me(t,C=>f(C)),g=Array.from(l.layers),[y]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(y),w=u?g.indexOf(u):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,j=w>=v,N=ME(C=>{const P=C.target,k=[...l.branches].some(T=>T.contains(P));!j||k||(o==null||o(C),s==null||s(C),C.defaultPrevented||i==null||i())},h),S=DE(C=>{const P=C.target;[...l.branches].some(T=>T.contains(P))||(a==null||a(C),s==null||s(C),C.defaultPrevented||i==null||i())},h);return SE(C=>{w===l.layers.size-1&&(r==null||r(C),!C.defaultPrevented&&i&&(C.preventDefault(),i()))},h),b.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(ju=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),_u(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=ju)}},[u,h,n,l]),b.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),_u())},[u,l]),b.useEffect(()=>{const C=()=>p({});return document.addEventListener(nc,C),()=>document.removeEventListener(nc,C)},[]),d.jsx(se.div,{...c,ref:m,style:{pointerEvents:x?j?"auto":"none":void 0,...e.style},onFocusCapture:te(e.onFocusCapture,S.onFocusCapture),onBlurCapture:te(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:te(e.onPointerDownCapture,N.onPointerDownCapture)})});Bo.displayName=CE;var kE="DismissableLayerBranch",PE=b.forwardRef((e,t)=>{const n=b.useContext(qp),r=b.useRef(null),o=me(t,r);return b.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),d.jsx(se.div,{...e,ref:o})});PE.displayName=kE;function ME(e,t=globalThis==null?void 0:globalThis.document){const n=Ge(e),r=b.useRef(!1),o=b.useRef(()=>{});return b.useEffect(()=>{const a=i=>{if(i.target&&!r.current){let c=function(){Gp(NE,n,l,{discrete:!0})};const l={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function DE(e,t=globalThis==null?void 0:globalThis.document){const n=Ge(e),r=b.useRef(!1);return b.useEffect(()=>{const o=a=>{a.target&&!r.current&&Gp(EE,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function _u(){const e=new CustomEvent(nc);document.dispatchEvent(e)}function Gp(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?_E(o,a):o.dispatchEvent(a)}var We=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},OE=b[" useId ".trim().toString()]||(()=>{}),RE=0;function jt(e){const[t,n]=b.useState(OE());return We(()=>{n(r=>r??String(RE++))},[e]),t?`radix-${t}`:""}const AE=["top","right","bottom","left"],jn=Math.min,rt=Math.max,Ha=Math.round,ua=Math.floor,Vt=e=>({x:e,y:e}),TE={left:"right",right:"left",bottom:"top",top:"bottom"},IE={start:"end",end:"start"};function rc(e,t,n){return rt(e,jn(t,n))}function cn(e,t){return typeof e=="function"?e(t):e}function ln(e){return e.split("-")[0]}function Ir(e){return e.split("-")[1]}function Yc(e){return e==="x"?"y":"x"}function qc(e){return e==="y"?"height":"width"}const $E=new Set(["top","bottom"]);function Lt(e){return $E.has(ln(e))?"y":"x"}function Gc(e){return Yc(Lt(e))}function zE(e,t,n){n===void 0&&(n=!1);const r=Ir(e),o=Gc(e),a=qc(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=Va(s)),[s,Va(s)]}function LE(e){const t=Va(e);return[oc(e),t,oc(t)]}function oc(e){return e.replace(/start|end/g,t=>IE[t])}const Su=["left","right"],Cu=["right","left"],WE=["top","bottom"],FE=["bottom","top"];function BE(e,t,n){switch(e){case"top":case"bottom":return n?t?Cu:Su:t?Su:Cu;case"left":case"right":return t?WE:FE;default:return[]}}function HE(e,t,n,r){const o=Ir(e);let a=BE(ln(e),n==="start",r);return o&&(a=a.map(s=>s+"-"+o),t&&(a=a.concat(a.map(oc)))),a}function Va(e){return e.replace(/left|right|bottom|top/g,t=>TE[t])}function VE(e){return{top:0,right:0,bottom:0,left:0,...e}}function Up(e){return typeof e!="number"?VE(e):{top:e,right:e,bottom:e,left:e}}function Ya(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Nu(e,t,n){let{reference:r,floating:o}=e;const a=Lt(t),s=Gc(t),i=qc(s),c=ln(t),l=a==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[i]/2-o[i]/2;let p;switch(c){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Ir(t)){case"start":p[s]-=h*(n&&l?-1:1);break;case"end":p[s]+=h*(n&&l?-1:1);break}return p}async function YE(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:a,rects:s,elements:i,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=cn(t,e),m=Up(p),y=i[h?f==="floating"?"reference":"floating":f],v=Ya(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(y)))==null||n?y:y.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:l,rootBoundary:u,strategy:c})),w=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating)),j=await(a.isElement==null?void 0:a.isElement(x))?await(a.getScale==null?void 0:a.getScale(x))||{x:1,y:1}:{x:1,y:1},N=Ya(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:w,offsetParent:x,strategy:c}):w);return{top:(v.top-N.top+m.top)/j.y,bottom:(N.bottom-v.bottom+m.bottom)/j.y,left:(v.left-N.left+m.left)/j.x,right:(N.right-v.right+m.right)/j.x}}const qE=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:s}=n,i=a.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Nu(l,r,c),h=r,p={},m=0;for(let y=0;y<i.length;y++){var g;const{name:v,fn:w}=i[y],{x,y:j,data:N,reset:S}=await w({x:u,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:l,platform:{...s,detectOverflow:(g=s.detectOverflow)!=null?g:YE},elements:{reference:e,floating:t}});u=x??u,f=j??f,p={...p,[v]:{...p[v],...N}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(l=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:u,y:f}=Nu(l,h,c)),y=-1)}return{x:u,y:f,placement:h,strategy:o,middlewareData:p}},GE=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:s,elements:i,middlewareData:c}=t,{element:l,padding:u=0}=cn(e,t)||{};if(l==null)return{};const f=Up(u),h={x:n,y:r},p=Gc(o),m=qc(p),g=await s.getDimensions(l),y=p==="y",v=y?"top":"left",w=y?"bottom":"right",x=y?"clientHeight":"clientWidth",j=a.reference[m]+a.reference[p]-h[p]-a.floating[m],N=h[p]-a.reference[p],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let C=S?S[x]:0;(!C||!await(s.isElement==null?void 0:s.isElement(S)))&&(C=i.floating[x]||a.floating[m]);const P=j/2-N/2,k=C/2-g[m]/2-1,T=jn(f[v],k),D=jn(f[w],k),M=T,L=C-g[m]-D,E=C/2-g[m]/2+P,I=rc(M,E,L),R=!c.arrow&&Ir(o)!=null&&E!==I&&a.reference[m]/2-(E<M?T:D)-g[m]/2<0,z=R?E<M?E-M:E-L:0;return{[p]:h[p]+z,data:{[p]:I,centerOffset:E-I-z,...R&&{alignmentOffset:z}},reset:R}}}),UE=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:s,initialPlacement:i,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=cn(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const v=ln(o),w=Lt(i),x=ln(i)===i,j=await(c.isRTL==null?void 0:c.isRTL(l.floating)),N=h||(x||!g?[Va(i)]:LE(i)),S=m!=="none";!h&&S&&N.push(...HE(i,g,m,j));const C=[i,...N],P=await c.detectOverflow(t,y),k=[];let T=((r=a.flip)==null?void 0:r.overflows)||[];if(u&&k.push(P[v]),f){const E=zE(o,s,j);k.push(P[E[0]],P[E[1]])}if(T=[...T,{placement:o,overflows:k}],!k.every(E=>E<=0)){var D,M;const E=(((D=a.flip)==null?void 0:D.index)||0)+1,I=C[E];if(I&&(!(f==="alignment"?w!==Lt(I):!1)||T.every(A=>Lt(A.placement)===w?A.overflows[0]>0:!0)))return{data:{index:E,overflows:T},reset:{placement:I}};let R=(M=T.filter(z=>z.overflows[0]<=0).sort((z,A)=>z.overflows[1]-A.overflows[1])[0])==null?void 0:M.placement;if(!R)switch(p){case"bestFit":{var L;const z=(L=T.filter(A=>{if(S){const O=Lt(A.placement);return O===w||O==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(O=>O>0).reduce((O,F)=>O+F,0)]).sort((A,O)=>A[1]-O[1])[0])==null?void 0:L[0];z&&(R=z);break}case"initialPlacement":R=i;break}if(o!==R)return{reset:{placement:R}}}return{}}}};function Eu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ku(e){return AE.some(t=>e[t]>=0)}const XE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...a}=cn(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...a,elementContext:"reference"}),i=Eu(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:ku(i)}}}case"escaped":{const s=await r.detectOverflow(t,{...a,altBoundary:!0}),i=Eu(s,n.floating);return{data:{escapedOffsets:i,escaped:ku(i)}}}default:return{}}}}},Xp=new Set(["left","top"]);async function KE(e,t){const{placement:n,platform:r,elements:o}=e,a=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=ln(n),i=Ir(n),c=Lt(n)==="y",l=Xp.has(s)?-1:1,u=a&&c?-1:1,f=cn(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return i&&typeof m=="number"&&(p=i==="end"?m*-1:m),c?{x:p*u,y:h*l}:{x:h*l,y:p*u}}const JE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:s,middlewareData:i}=t,c=await KE(t,e);return s===((n=i.offset)==null?void 0:n.placement)&&(r=i.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:a+c.y,data:{...c,placement:s}}}}},ZE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:a}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:c={fn:v=>{let{x:w,y:x}=v;return{x:w,y:x}}},...l}=cn(e,t),u={x:n,y:r},f=await a.detectOverflow(t,l),h=Lt(ln(o)),p=Yc(h);let m=u[p],g=u[h];if(s){const v=p==="y"?"top":"left",w=p==="y"?"bottom":"right",x=m+f[v],j=m-f[w];m=rc(x,m,j)}if(i){const v=h==="y"?"top":"left",w=h==="y"?"bottom":"right",x=g+f[v],j=g-f[w];g=rc(x,g,j)}const y=c.fn({...t,[p]:m,[h]:g});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[p]:s,[h]:i}}}}}},QE=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:s}=t,{offset:i=0,mainAxis:c=!0,crossAxis:l=!0}=cn(e,t),u={x:n,y:r},f=Lt(o),h=Yc(f);let p=u[h],m=u[f];const g=cn(i,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const x=h==="y"?"height":"width",j=a.reference[h]-a.floating[x]+y.mainAxis,N=a.reference[h]+a.reference[x]-y.mainAxis;p<j?p=j:p>N&&(p=N)}if(l){var v,w;const x=h==="y"?"width":"height",j=Xp.has(ln(o)),N=a.reference[f]-a.floating[x]+(j&&((v=s.offset)==null?void 0:v[f])||0)+(j?0:y.crossAxis),S=a.reference[f]+a.reference[x]+(j?0:((w=s.offset)==null?void 0:w[f])||0)-(j?y.crossAxis:0);m<N?m=N:m>S&&(m=S)}return{[h]:p,[f]:m}}}},ek=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:s,elements:i}=t,{apply:c=()=>{},...l}=cn(e,t),u=await s.detectOverflow(t,l),f=ln(o),h=Ir(o),p=Lt(o)==="y",{width:m,height:g}=a.floating;let y,v;f==="top"||f==="bottom"?(y=f,v=h===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(v=f,y=h==="end"?"top":"bottom");const w=g-u.top-u.bottom,x=m-u.left-u.right,j=jn(g-u[y],w),N=jn(m-u[v],x),S=!t.middlewareData.shift;let C=j,P=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=w),S&&!h){const T=rt(u.left,0),D=rt(u.right,0),M=rt(u.top,0),L=rt(u.bottom,0);p?P=m-2*(T!==0||D!==0?T+D:rt(u.left,u.right)):C=g-2*(M!==0||L!==0?M+L:rt(u.top,u.bottom))}await c({...t,availableWidth:P,availableHeight:C});const k=await s.getDimensions(i.floating);return m!==k.width||g!==k.height?{reset:{rects:!0}}:{}}}};function gs(){return typeof window<"u"}function $r(e){return Kp(e)?(e.nodeName||"").toLowerCase():"#document"}function at(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Gt(e){var t;return(t=(Kp(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Kp(e){return gs()?e instanceof Node||e instanceof at(e).Node:!1}function St(e){return gs()?e instanceof Element||e instanceof at(e).Element:!1}function Yt(e){return gs()?e instanceof HTMLElement||e instanceof at(e).HTMLElement:!1}function Pu(e){return!gs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof at(e).ShadowRoot}const tk=new Set(["inline","contents"]);function Ho(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ct(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!tk.has(o)}const nk=new Set(["table","td","th"]);function rk(e){return nk.has($r(e))}const ok=[":popover-open",":modal"];function ys(e){return ok.some(t=>{try{return e.matches(t)}catch{return!1}})}const ak=["transform","translate","scale","rotate","perspective"],sk=["transform","translate","scale","rotate","perspective","filter"],ik=["paint","layout","strict","content"];function Uc(e){const t=Xc(),n=St(e)?Ct(e):e;return ak.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||sk.some(r=>(n.willChange||"").includes(r))||ik.some(r=>(n.contain||"").includes(r))}function ck(e){let t=_n(e);for(;Yt(t)&&!Pr(t);){if(Uc(t))return t;if(ys(t))return null;t=_n(t)}return null}function Xc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lk=new Set(["html","body","#document"]);function Pr(e){return lk.has($r(e))}function Ct(e){return at(e).getComputedStyle(e)}function xs(e){return St(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _n(e){if($r(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Pu(e)&&e.host||Gt(e);return Pu(t)?t.host:t}function Jp(e){const t=_n(e);return Pr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Yt(t)&&Ho(t)?t:Jp(t)}function Co(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Jp(e),a=o===((r=e.ownerDocument)==null?void 0:r.body),s=at(o);if(a){const i=ac(s);return t.concat(s,s.visualViewport||[],Ho(o)?o:[],i&&n?Co(i):[])}return t.concat(o,Co(o,[],n))}function ac(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Zp(e){const t=Ct(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Yt(e),a=o?e.offsetWidth:n,s=o?e.offsetHeight:r,i=Ha(n)!==a||Ha(r)!==s;return i&&(n=a,r=s),{width:n,height:r,$:i}}function Kc(e){return St(e)?e:e.contextElement}function gr(e){const t=Kc(e);if(!Yt(t))return Vt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=Zp(t);let s=(a?Ha(n.width):n.width)/r,i=(a?Ha(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}const dk=Vt(0);function Qp(e){const t=at(e);return!Xc()||!t.visualViewport?dk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uk(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==at(e)?!1:t}function Hn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),a=Kc(e);let s=Vt(1);t&&(r?St(r)&&(s=gr(r)):s=gr(e));const i=uk(a,n,r)?Qp(a):Vt(0);let c=(o.left+i.x)/s.x,l=(o.top+i.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(a){const h=at(a),p=r&&St(r)?at(r):r;let m=h,g=ac(m);for(;g&&r&&p!==m;){const y=gr(g),v=g.getBoundingClientRect(),w=Ct(g),x=v.left+(g.clientLeft+parseFloat(w.paddingLeft))*y.x,j=v.top+(g.clientTop+parseFloat(w.paddingTop))*y.y;c*=y.x,l*=y.y,u*=y.x,f*=y.y,c+=x,l+=j,m=at(g),g=ac(m)}}return Ya({width:u,height:f,x:c,y:l})}function vs(e,t){const n=xs(e).scrollLeft;return t?t.left+n:Hn(Gt(e)).left+n}function em(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-vs(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function fk(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a=o==="fixed",s=Gt(r),i=t?ys(t.floating):!1;if(r===s||i&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Vt(1);const u=Vt(0),f=Yt(r);if((f||!f&&!a)&&(($r(r)!=="body"||Ho(s))&&(c=xs(r)),Yt(r))){const p=Hn(r);l=gr(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const h=s&&!f&&!a?em(s,c):Vt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+h.x,y:n.y*l.y-c.scrollTop*l.y+u.y+h.y}}function hk(e){return Array.from(e.getClientRects())}function pk(e){const t=Gt(e),n=xs(e),r=e.ownerDocument.body,o=rt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=rt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+vs(e);const i=-n.scrollTop;return Ct(r).direction==="rtl"&&(s+=rt(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:s,y:i}}const Mu=25;function mk(e,t){const n=at(e),r=Gt(e),o=n.visualViewport;let a=r.clientWidth,s=r.clientHeight,i=0,c=0;if(o){a=o.width,s=o.height;const u=Xc();(!u||u&&t==="fixed")&&(i=o.offsetLeft,c=o.offsetTop)}const l=vs(r);if(l<=0){const u=r.ownerDocument,f=u.body,h=getComputedStyle(f),p=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(r.clientWidth-f.clientWidth-p);m<=Mu&&(a-=m)}else l<=Mu&&(a+=l);return{width:a,height:s,x:i,y:c}}const gk=new Set(["absolute","fixed"]);function yk(e,t){const n=Hn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=Yt(e)?gr(e):Vt(1),s=e.clientWidth*a.x,i=e.clientHeight*a.y,c=o*a.x,l=r*a.y;return{width:s,height:i,x:c,y:l}}function Du(e,t,n){let r;if(t==="viewport")r=mk(e,n);else if(t==="document")r=pk(Gt(e));else if(St(t))r=yk(t,n);else{const o=Qp(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ya(r)}function tm(e,t){const n=_n(e);return n===t||!St(n)||Pr(n)?!1:Ct(n).position==="fixed"||tm(n,t)}function xk(e,t){const n=t.get(e);if(n)return n;let r=Co(e,[],!1).filter(i=>St(i)&&$r(i)!=="body"),o=null;const a=Ct(e).position==="fixed";let s=a?_n(e):e;for(;St(s)&&!Pr(s);){const i=Ct(s),c=Uc(s);!c&&i.position==="fixed"&&(o=null),(a?!c&&!o:!c&&i.position==="static"&&!!o&&gk.has(o.position)||Ho(s)&&!c&&tm(e,s))?r=r.filter(u=>u!==s):o=i,s=_n(s)}return t.set(e,r),r}function vk(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?ys(t)?[]:xk(t,this._c):[].concat(n),r],i=s[0],c=s.reduce((l,u)=>{const f=Du(t,u,o);return l.top=rt(f.top,l.top),l.right=jn(f.right,l.right),l.bottom=jn(f.bottom,l.bottom),l.left=rt(f.left,l.left),l},Du(t,i,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function bk(e){const{width:t,height:n}=Zp(e);return{width:t,height:n}}function wk(e,t,n){const r=Yt(t),o=Gt(t),a=n==="fixed",s=Hn(e,!0,a,t);let i={scrollLeft:0,scrollTop:0};const c=Vt(0);function l(){c.x=vs(o)}if(r||!r&&!a)if(($r(t)!=="body"||Ho(o))&&(i=xs(t)),r){const p=Hn(t,!0,a,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else o&&l();a&&!r&&o&&l();const u=o&&!r&&!a?em(o,i):Vt(0),f=s.left+i.scrollLeft-c.x-u.x,h=s.top+i.scrollTop-c.y-u.y;return{x:f,y:h,width:s.width,height:s.height}}function ui(e){return Ct(e).position==="static"}function Ou(e,t){if(!Yt(e)||Ct(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Gt(e)===n&&(n=n.ownerDocument.body),n}function nm(e,t){const n=at(e);if(ys(e))return n;if(!Yt(e)){let o=_n(e);for(;o&&!Pr(o);){if(St(o)&&!ui(o))return o;o=_n(o)}return n}let r=Ou(e,t);for(;r&&rk(r)&&ui(r);)r=Ou(r,t);return r&&Pr(r)&&ui(r)&&!Uc(r)?n:r||ck(e)||n}const jk=async function(e){const t=this.getOffsetParent||nm,n=this.getDimensions,r=await n(e.floating);return{reference:wk(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _k(e){return Ct(e).direction==="rtl"}const Sk={convertOffsetParentRelativeRectToViewportRelativeRect:fk,getDocumentElement:Gt,getClippingRect:vk,getOffsetParent:nm,getElementRects:jk,getClientRects:hk,getDimensions:bk,getScale:gr,isElement:St,isRTL:_k};function rm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ck(e,t){let n=null,r;const o=Gt(e);function a(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function s(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),a();const l=e.getBoundingClientRect(),{left:u,top:f,width:h,height:p}=l;if(i||t(),!h||!p)return;const m=ua(f),g=ua(o.clientWidth-(u+h)),y=ua(o.clientHeight-(f+p)),v=ua(u),x={rootMargin:-m+"px "+-g+"px "+-y+"px "+-v+"px",threshold:rt(0,jn(1,c))||1};let j=!0;function N(S){const C=S[0].intersectionRatio;if(C!==c){if(!j)return s();C?s(!1,C):r=setTimeout(()=>{s(!1,1e-7)},1e3)}C===1&&!rm(l,e.getBoundingClientRect())&&s(),j=!1}try{n=new IntersectionObserver(N,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(N,x)}n.observe(e)}return s(!0),a}function Nk(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=Kc(e),u=o||a?[...l?Co(l):[],...Co(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),a&&v.addEventListener("resize",n)});const f=l&&i?Ck(l,n):null;let h=-1,p=null;s&&(p=new ResizeObserver(v=>{let[w]=v;w&&w.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,g=c?Hn(e):null;c&&y();function y(){const v=Hn(e);g&&!rm(g,v)&&n(),g=v,m=requestAnimationFrame(y)}return n(),()=>{var v;u.forEach(w=>{o&&w.removeEventListener("scroll",n),a&&w.removeEventListener("resize",n)}),f==null||f(),(v=p)==null||v.disconnect(),p=null,c&&cancelAnimationFrame(m)}}const Ek=JE,kk=ZE,Pk=UE,Mk=ek,Dk=XE,Ru=GE,Ok=QE,Rk=(e,t,n)=>{const r=new Map,o={platform:Sk,...n},a={...o.platform,_c:r};return qE(e,t,{...o,platform:a})};var Ak=typeof document<"u",Tk=function(){},Ca=Ak?_.useLayoutEffect:Tk;function qa(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!qa(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const a=o[r];if(!(a==="_owner"&&e.$$typeof)&&!qa(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function om(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Au(e,t){const n=om(e);return Math.round(t*n)/n}function fi(e){const t=b.useRef(e);return Ca(()=>{t.current=e}),t}function Ik(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:s}={},transform:i=!0,whileElementsMounted:c,open:l}=e,[u,f]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=b.useState(r);qa(h,r)||p(r);const[m,g]=b.useState(null),[y,v]=b.useState(null),w=b.useCallback(A=>{A!==S.current&&(S.current=A,g(A))},[]),x=b.useCallback(A=>{A!==C.current&&(C.current=A,v(A))},[]),j=a||m,N=s||y,S=b.useRef(null),C=b.useRef(null),P=b.useRef(u),k=c!=null,T=fi(c),D=fi(o),M=fi(l),L=b.useCallback(()=>{if(!S.current||!C.current)return;const A={placement:t,strategy:n,middleware:h};D.current&&(A.platform=D.current),Rk(S.current,C.current,A).then(O=>{const F={...O,isPositioned:M.current!==!1};E.current&&!qa(P.current,F)&&(P.current=F,ns.flushSync(()=>{f(F)}))})},[h,t,n,D,M]);Ca(()=>{l===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(A=>({...A,isPositioned:!1})))},[l]);const E=b.useRef(!1);Ca(()=>(E.current=!0,()=>{E.current=!1}),[]),Ca(()=>{if(j&&(S.current=j),N&&(C.current=N),j&&N){if(T.current)return T.current(j,N,L);L()}},[j,N,L,T,k]);const I=b.useMemo(()=>({reference:S,floating:C,setReference:w,setFloating:x}),[w,x]),R=b.useMemo(()=>({reference:j,floating:N}),[j,N]),z=b.useMemo(()=>{const A={position:n,left:0,top:0};if(!R.floating)return A;const O=Au(R.floating,u.x),F=Au(R.floating,u.y);return i?{...A,transform:"translate("+O+"px, "+F+"px)",...om(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:F}},[n,i,R.floating,u.x,u.y]);return b.useMemo(()=>({...u,update:L,refs:I,elements:R,floatingStyles:z}),[u,L,I,R,z])}const $k=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Ru({element:r.current,padding:o}).fn(n):{}:r?Ru({element:r,padding:o}).fn(n):{}}}},zk=(e,t)=>({...Ek(e),options:[e,t]}),Lk=(e,t)=>({...kk(e),options:[e,t]}),Wk=(e,t)=>({...Ok(e),options:[e,t]}),Fk=(e,t)=>({...Pk(e),options:[e,t]}),Bk=(e,t)=>({...Mk(e),options:[e,t]}),Hk=(e,t)=>({...Dk(e),options:[e,t]}),Vk=(e,t)=>({...$k(e),options:[e,t]});var Yk="Arrow",am=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return d.jsx(se.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});am.displayName=Yk;var qk=am;function bs(e){const[t,n]=b.useState(void 0);return We(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let s,i;if("borderBoxSize"in a){const c=a.borderBoxSize,l=Array.isArray(c)?c[0]:c;s=l.inlineSize,i=l.blockSize}else s=e.offsetWidth,i=e.offsetHeight;n({width:s,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Jc="Popper",[sm,zr]=Ze(Jc),[Gk,im]=sm(Jc),cm=e=>{const{__scopePopper:t,children:n}=e,[r,o]=b.useState(null);return d.jsx(Gk,{scope:t,anchor:r,onAnchorChange:o,children:n})};cm.displayName=Jc;var lm="PopperAnchor",dm=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,a=im(lm,n),s=b.useRef(null),i=me(t,s),c=b.useRef(null);return b.useEffect(()=>{const l=c.current;c.current=(r==null?void 0:r.current)||s.current,l!==c.current&&a.onAnchorChange(c.current)}),r?null:d.jsx(se.div,{...o,ref:i})});dm.displayName=lm;var Zc="PopperContent",[Uk,Xk]=sm(Zc),um=b.forwardRef((e,t)=>{var $,W,U,K,X,J;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,arrowPadding:i=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:m,...g}=e,y=im(Zc,n),[v,w]=b.useState(null),x=me(t,Z=>w(Z)),[j,N]=b.useState(null),S=bs(j),C=(S==null?void 0:S.width)??0,P=(S==null?void 0:S.height)??0,k=r+(a!=="center"?"-"+a:""),T=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],M=D.length>0,L={padding:T,boundary:D.filter(Jk),altBoundary:M},{refs:E,floatingStyles:I,placement:R,isPositioned:z,middlewareData:A}=Ik({strategy:"fixed",placement:k,whileElementsMounted:(...Z)=>Nk(...Z,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[zk({mainAxis:o+P,alignmentAxis:s}),c&&Lk({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Wk():void 0,...L}),c&&Fk({...L}),Bk({...L,apply:({elements:Z,rects:ee,availableWidth:ce,availableHeight:ne})=>{const{width:xe,height:de}=ee.reference,Me=Z.floating.style;Me.setProperty("--radix-popper-available-width",`${ce}px`),Me.setProperty("--radix-popper-available-height",`${ne}px`),Me.setProperty("--radix-popper-anchor-width",`${xe}px`),Me.setProperty("--radix-popper-anchor-height",`${de}px`)}}),j&&Vk({element:j,padding:i}),Zk({arrowWidth:C,arrowHeight:P}),h&&Hk({strategy:"referenceHidden",...L})]}),[O,F]=pm(R),G=Ge(m);We(()=>{z&&(G==null||G())},[z,G]);const Y=($=A.arrow)==null?void 0:$.x,H=(W=A.arrow)==null?void 0:W.y,V=((U=A.arrow)==null?void 0:U.centerOffset)!==0,[B,q]=b.useState();return We(()=>{v&&q(window.getComputedStyle(v).zIndex)},[v]),d.jsx("div",{ref:E.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:z?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[(K=A.transformOrigin)==null?void 0:K.x,(X=A.transformOrigin)==null?void 0:X.y].join(" "),...((J=A.hide)==null?void 0:J.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(Uk,{scope:n,placedSide:O,onArrowChange:N,arrowX:Y,arrowY:H,shouldHideArrow:V,children:d.jsx(se.div,{"data-side":O,"data-align":F,...g,ref:x,style:{...g.style,animation:z?void 0:"none"}})})})});um.displayName=Zc;var fm="PopperArrow",Kk={top:"bottom",right:"left",bottom:"top",left:"right"},hm=b.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,a=Xk(fm,r),s=Kk[a.placedSide];return d.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:d.jsx(qk,{...o,ref:n,style:{...o.style,display:"block"}})})});hm.displayName=fm;function Jk(e){return e!==null}var Zk=e=>({name:"transformOrigin",options:e,fn(t){var y,v,w;const{placement:n,rects:r,middlewareData:o}=t,s=((y=o.arrow)==null?void 0:y.centerOffset)!==0,i=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[l,u]=pm(n),f={start:"0%",center:"50%",end:"100%"}[u],h=(((v=o.arrow)==null?void 0:v.x)??0)+i/2,p=(((w=o.arrow)==null?void 0:w.y)??0)+c/2;let m="",g="";return l==="bottom"?(m=s?f:`${h}px`,g=`${-c}px`):l==="top"?(m=s?f:`${h}px`,g=`${r.floating.height+c}px`):l==="right"?(m=`${-c}px`,g=s?f:`${p}px`):l==="left"&&(m=`${r.floating.width+c}px`,g=s?f:`${p}px`),{data:{x:m,y:g}}}});function pm(e){const[t,n="center"]=e.split("-");return[t,n]}var Qc=cm,ws=dm,el=um,tl=hm,Qk="Portal",Vo=b.forwardRef((e,t)=>{var i;const{container:n,...r}=e,[o,a]=b.useState(!1);We(()=>a(!0),[]);const s=n||o&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return s?ts.createPortal(d.jsx(se.div,{...r,ref:t}),s):null});Vo.displayName=Qk;function eP(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var Ye=e=>{const{present:t,children:n}=e,r=tP(t),o=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),a=me(r.ref,nP(o));return typeof n=="function"||r.isPresent?b.cloneElement(o,{ref:a}):null};Ye.displayName="Presence";function tP(e){const[t,n]=b.useState(),r=b.useRef(null),o=b.useRef(e),a=b.useRef("none"),s=e?"mounted":"unmounted",[i,c]=eP(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const l=fa(r.current);a.current=i==="mounted"?l:"none"},[i]),We(()=>{const l=r.current,u=o.current;if(u!==e){const h=a.current,p=fa(l);e?c("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),We(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,f=p=>{const g=fa(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&g&&(c("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=p=>{p.target===t&&(a.current=fa(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:b.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function fa(e){return(e==null?void 0:e.animationName)||"none"}function nP(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var rP=Symbol("radix.slottable");function oP(e){const t=({children:n})=>d.jsx(d.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=rP,t}var aP=b[" useInsertionEffect ".trim().toString()]||We;function Nt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,s]=sP({defaultProp:t,onChange:n}),i=e!==void 0,c=i?e:o;{const u=b.useRef(e!==void 0);b.useEffect(()=>{const f=u.current;f!==i&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=i},[i,r])}const l=b.useCallback(u=>{var f;if(i){const h=iP(u)?u(e):u;h!==e&&((f=s.current)==null||f.call(s,h))}else a(u)},[i,e,a,s]);return[c,l]}function sP({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),o=b.useRef(n),a=b.useRef(t);return aP(()=>{a.current=t},[t]),b.useEffect(()=>{var s;o.current!==n&&((s=a.current)==null||s.call(a,n),o.current=n)},[n,o]),[n,r,a]}function iP(e){return typeof e=="function"}var mm=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),cP="VisuallyHidden",gm=b.forwardRef((e,t)=>d.jsx(se.span,{...e,ref:t,style:{...mm,...e.style}}));gm.displayName=cP;var lP=gm,[js]=Ze("Tooltip",[zr]),_s=zr(),ym="TooltipProvider",dP=700,sc="tooltip.open",[uP,nl]=js(ym),xm=e=>{const{__scopeTooltip:t,delayDuration:n=dP,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:a}=e,s=b.useRef(!0),i=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),d.jsx(uP,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),s.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:i,onPointerInTransitChange:b.useCallback(l=>{i.current=l},[]),disableHoverableContent:o,children:a})};xm.displayName=ym;var No="Tooltip",[fP,Yo]=js(No),vm=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:a,disableHoverableContent:s,delayDuration:i}=e,c=nl(No,e.__scopeTooltip),l=_s(t),[u,f]=b.useState(null),h=jt(),p=b.useRef(0),m=s??c.disableHoverableContent,g=i??c.delayDuration,y=b.useRef(!1),[v,w]=Nt({prop:r,defaultProp:o??!1,onChange:C=>{C?(c.onOpen(),document.dispatchEvent(new CustomEvent(sc))):c.onClose(),a==null||a(C)},caller:No}),x=b.useMemo(()=>v?y.current?"delayed-open":"instant-open":"closed",[v]),j=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,w(!0)},[w]),N=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,w(!1)},[w]),S=b.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,w(!0),p.current=0},g)},[g,w]);return b.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),d.jsx(Qc,{...l,children:d.jsx(fP,{scope:t,contentId:h,open:v,stateAttribute:x,trigger:u,onTriggerChange:f,onTriggerEnter:b.useCallback(()=>{c.isOpenDelayedRef.current?S():j()},[c.isOpenDelayedRef,S,j]),onTriggerLeave:b.useCallback(()=>{m?N():(window.clearTimeout(p.current),p.current=0)},[N,m]),onOpen:j,onClose:N,disableHoverableContent:m,children:n})})};vm.displayName=No;var ic="TooltipTrigger",bm=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Yo(ic,n),a=nl(ic,n),s=_s(n),i=b.useRef(null),c=me(t,i,o.onTriggerChange),l=b.useRef(!1),u=b.useRef(!1),f=b.useCallback(()=>l.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),d.jsx(ws,{asChild:!0,...s,children:d.jsx(se.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:te(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:te(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:te(e.onPointerDown,()=>{o.open&&o.onClose(),l.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:te(e.onFocus,()=>{l.current||o.onOpen()}),onBlur:te(e.onBlur,o.onClose),onClick:te(e.onClick,o.onClose)})})});bm.displayName=ic;var rl="TooltipPortal",[hP,pP]=js(rl,{forceMount:void 0}),wm=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,a=Yo(rl,t);return d.jsx(hP,{scope:t,forceMount:n,children:d.jsx(Ye,{present:n||a.open,children:d.jsx(Vo,{asChild:!0,container:o,children:r})})})};wm.displayName=rl;var Mr="TooltipContent",jm=b.forwardRef((e,t)=>{const n=pP(Mr,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=e,s=Yo(Mr,e.__scopeTooltip);return d.jsx(Ye,{present:r||s.open,children:s.disableHoverableContent?d.jsx(_m,{side:o,...a,ref:t}):d.jsx(mP,{side:o,...a,ref:t})})}),mP=b.forwardRef((e,t)=>{const n=Yo(Mr,e.__scopeTooltip),r=nl(Mr,e.__scopeTooltip),o=b.useRef(null),a=me(t,o),[s,i]=b.useState(null),{trigger:c,onClose:l}=n,u=o.current,{onPointerInTransitChange:f}=r,h=b.useCallback(()=>{i(null),f(!1)},[f]),p=b.useCallback((m,g)=>{const y=m.currentTarget,v={x:m.clientX,y:m.clientY},w=bP(v,y.getBoundingClientRect()),x=wP(v,w),j=jP(g.getBoundingClientRect()),N=SP([...x,...j]);i(N),f(!0)},[f]);return b.useEffect(()=>()=>h(),[h]),b.useEffect(()=>{if(c&&u){const m=y=>p(y,u),g=y=>p(y,c);return c.addEventListener("pointerleave",m),u.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",g)}}},[c,u,p,h]),b.useEffect(()=>{if(s){const m=g=>{const y=g.target,v={x:g.clientX,y:g.clientY},w=(c==null?void 0:c.contains(y))||(u==null?void 0:u.contains(y)),x=!_P(v,s);w?h():x&&(h(),l())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[c,u,s,l,h]),d.jsx(_m,{...e,ref:a})}),[gP,yP]=js(No,{isInside:!1}),xP=oP("TooltipContent"),_m=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:s,...i}=e,c=Yo(Mr,n),l=_s(n),{onClose:u}=c;return b.useEffect(()=>(document.addEventListener(sc,u),()=>document.removeEventListener(sc,u)),[u]),b.useEffect(()=>{if(c.trigger){const f=h=>{const p=h.target;p!=null&&p.contains(c.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,u]),d.jsx(Bo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:d.jsxs(el,{"data-state":c.stateAttribute,...l,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(xP,{children:r}),d.jsx(gP,{scope:n,isInside:!0,children:d.jsx(lP,{id:c.contentId,role:"tooltip",children:o||r})})]})})});jm.displayName=Mr;var Sm="TooltipArrow",vP=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=_s(n);return yP(Sm,n).isInside?null:d.jsx(tl,{...o,...r,ref:t})});vP.displayName=Sm;function bP(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function wP(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function jP(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function _P(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){const i=t[a],c=t[s],l=i.x,u=i.y,f=c.x,h=c.y;u>r!=h>r&&n<(f-l)*(r-u)/(h-u)+l&&(o=!o)}return o}function SP(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),CP(t)}function CP(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const a=t[t.length-1],s=t[t.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const a=n[n.length-1],s=n[n.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var NP=xm,EP=vm,kP=bm,PP=wm,Cm=jm;const ol=_.createContext(null);function qo(){return _.useContext(ol)}const MP=NP,Tu=EP,Iu=kP,cc=b.forwardRef(({className:e,sideOffset:t=4,...n},r)=>{const o=qo();return d.jsx(PP,{container:o??void 0,children:d.jsx(Cm,{ref:r,sideOffset:t,className:ie("cj-z-50 cj-overflow-hidden cj-rounded-md cj-border cj-bg-popover cj-px-3 cj-py-1.5 cj-text-sm cj-text-popover-foreground cj-shadow-md cj-animate-in cj-fade-in-0 cj-zoom-in-95 data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=closed]:cj-zoom-out-95 data-[side=bottom]:cj-slide-in-from-top-2 data-[side=left]:cj-slide-in-from-right-2 data-[side=right]:cj-slide-in-from-left-2 data-[side=top]:cj-slide-in-from-bottom-2",e),...n})})});cc.displayName=Cm.displayName;var hi="focusScope.autoFocusOnMount",pi="focusScope.autoFocusOnUnmount",$u={bubbles:!1,cancelable:!0},DP="FocusScope",Ss=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...s}=e,[i,c]=b.useState(null),l=Ge(o),u=Ge(a),f=b.useRef(null),h=me(t,g=>c(g)),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let g=function(x){if(p.paused||!i)return;const j=x.target;i.contains(j)?f.current=j:yn(f.current,{select:!0})},y=function(x){if(p.paused||!i)return;const j=x.relatedTarget;j!==null&&(i.contains(j)||yn(f.current,{select:!0}))},v=function(x){if(document.activeElement===document.body)for(const N of x)N.removedNodes.length>0&&yn(i)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const w=new MutationObserver(v);return i&&w.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),w.disconnect()}}},[r,i,p.paused]),b.useEffect(()=>{if(i){Lu.add(p);const g=document.activeElement;if(!i.contains(g)){const v=new CustomEvent(hi,$u);i.addEventListener(hi,l),i.dispatchEvent(v),v.defaultPrevented||(OP($P(Nm(i)),{select:!0}),document.activeElement===g&&yn(i))}return()=>{i.removeEventListener(hi,l),setTimeout(()=>{const v=new CustomEvent(pi,$u);i.addEventListener(pi,u),i.dispatchEvent(v),v.defaultPrevented||yn(g??document.body,{select:!0}),i.removeEventListener(pi,u),Lu.remove(p)},0)}}},[i,l,u,p]);const m=b.useCallback(g=>{if(!n&&!r||p.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(y&&v){const w=g.currentTarget,[x,j]=RP(w);x&&j?!g.shiftKey&&v===j?(g.preventDefault(),n&&yn(x,{select:!0})):g.shiftKey&&v===x&&(g.preventDefault(),n&&yn(j,{select:!0})):v===w&&g.preventDefault()}},[n,r,p.paused]);return d.jsx(se.div,{tabIndex:-1,...s,ref:h,onKeyDown:m})});Ss.displayName=DP;function OP(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(yn(r,{select:t}),document.activeElement!==n)return}function RP(e){const t=Nm(e),n=zu(t,e),r=zu(t.reverse(),e);return[n,r]}function Nm(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function zu(e,t){for(const n of e)if(!AP(n,{upTo:t}))return n}function AP(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function TP(e){return e instanceof HTMLInputElement&&"select"in e}function yn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&TP(e)&&t&&e.select()}}var Lu=IP();function IP(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Wu(e,t),e.unshift(t)},remove(t){var n;e=Wu(e,t),(n=e[0])==null||n.resume()}}}function Wu(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function $P(e){return e.filter(t=>t.tagName!=="A")}var mi=0;function al(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Fu()),document.body.insertAdjacentElement("beforeend",e[1]??Fu()),mi++,()=>{mi===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),mi--}},[])}function Fu(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var zt=function(){return zt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},zt.apply(this,arguments)};function Em(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function zP(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Na="right-scroll-bar-position",Ea="width-before-scroll-bar",LP="with-scroll-bars-hidden",WP="--removed-body-scroll-bar-size";function gi(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function FP(e,t){var n=_.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var BP=typeof window<"u"?b.useLayoutEffect:b.useEffect,Bu=new WeakMap;function HP(e,t){var n=FP(null,function(r){return e.forEach(function(o){return gi(o,r)})});return BP(function(){var r=Bu.get(n);if(r){var o=new Set(r),a=new Set(e),s=n.current;o.forEach(function(i){a.has(i)||gi(i,null)}),a.forEach(function(i){o.has(i)||gi(i,s)})}Bu.set(n,e)},[e]),n}function VP(e){return e}function YP(e,t){t===void 0&&(t=VP);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var s=t(a,r);return n.push(s),function(){n=n.filter(function(i){return i!==s})}},assignSyncMedium:function(a){for(r=!0;n.length;){var s=n;n=[],s.forEach(a)}n={push:function(i){return a(i)},filter:function(){return n}}},assignMedium:function(a){r=!0;var s=[];if(n.length){var i=n;n=[],i.forEach(a),s=n}var c=function(){var u=s;s=[],u.forEach(a)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){s.push(u),l()},filter:function(u){return s=s.filter(u),n}}}};return o}function qP(e){e===void 0&&(e={});var t=YP(null);return t.options=zt({async:!0,ssr:!1},e),t}var km=function(e){var t=e.sideCar,n=Em(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,zt({},n))};km.isSideCarExport=!0;function GP(e,t){return e.useMedium(t),km}var Pm=qP(),yi=function(){},Cs=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:yi,onWheelCapture:yi,onTouchMoveCapture:yi}),o=r[0],a=r[1],s=e.forwardProps,i=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,f=e.shards,h=e.sideCar,p=e.noRelative,m=e.noIsolation,g=e.inert,y=e.allowPinchZoom,v=e.as,w=v===void 0?"div":v,x=e.gapMode,j=Em(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=h,S=HP([n,t]),C=zt(zt({},j),o);return b.createElement(b.Fragment,null,u&&b.createElement(N,{sideCar:Pm,removeScrollBar:l,shards:f,noRelative:p,noIsolation:m,inert:g,setCallbacks:a,allowPinchZoom:!!y,lockRef:n,gapMode:x}),s?b.cloneElement(b.Children.only(i),zt(zt({},C),{ref:S})):b.createElement(w,zt({},C,{className:c,ref:S}),i))});Cs.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Cs.classNames={fullWidth:Ea,zeroRight:Na};var UP=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function XP(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=UP();return t&&e.setAttribute("nonce",t),e}function KP(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function JP(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ZP=function(){var e=0,t=null;return{add:function(n){e==0&&(t=XP())&&(KP(t,n),JP(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},QP=function(){var e=ZP();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Mm=function(){var e=QP(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},eM={left:0,top:0,right:0,gap:0},xi=function(e){return parseInt(e||"",10)||0},tM=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[xi(n),xi(r),xi(o)]},nM=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return eM;var t=tM(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},rM=Mm(),yr="data-scroll-locked",oM=function(e,t,n,r){var o=e.left,a=e.top,s=e.right,i=e.gap;return n===void 0&&(n="margin"),`
|
|
264
|
+
.`.concat(LP,` {
|
|
252
265
|
overflow: hidden `).concat(r,`;
|
|
253
266
|
padding-right: `).concat(i,"px ").concat(r,`;
|
|
254
267
|
}
|
|
@@ -257,51 +270,43 @@
|
|
|
257
270
|
overscroll-behavior: contain;
|
|
258
271
|
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
259
272
|
padding-left: `.concat(o,`px;
|
|
260
|
-
padding-top: `).concat(
|
|
261
|
-
padding-right: `).concat(
|
|
273
|
+
padding-top: `).concat(a,`px;
|
|
274
|
+
padding-right: `).concat(s,`px;
|
|
262
275
|
margin-left:0;
|
|
263
276
|
margin-top:0;
|
|
264
277
|
margin-right: `).concat(i,"px ").concat(r,`;
|
|
265
278
|
`),n==="padding"&&"padding-right: ".concat(i,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
266
279
|
}
|
|
267
280
|
|
|
268
|
-
.`).concat(
|
|
281
|
+
.`).concat(Na,` {
|
|
269
282
|
right: `).concat(i,"px ").concat(r,`;
|
|
270
283
|
}
|
|
271
284
|
|
|
272
|
-
.`).concat(
|
|
285
|
+
.`).concat(Ea,` {
|
|
273
286
|
margin-right: `).concat(i,"px ").concat(r,`;
|
|
274
287
|
}
|
|
275
288
|
|
|
276
|
-
.`).concat(
|
|
289
|
+
.`).concat(Na," .").concat(Na,` {
|
|
277
290
|
right: 0 `).concat(r,`;
|
|
278
291
|
}
|
|
279
292
|
|
|
280
|
-
.`).concat(
|
|
293
|
+
.`).concat(Ea," .").concat(Ea,` {
|
|
281
294
|
margin-right: 0 `).concat(r,`;
|
|
282
295
|
}
|
|
283
296
|
|
|
284
297
|
body[`).concat(yr,`] {
|
|
285
|
-
`).concat(
|
|
298
|
+
`).concat(WP,": ").concat(i,`px;
|
|
286
299
|
}
|
|
287
|
-
`)},
|
|
300
|
+
`)},Hu=function(){var e=parseInt(document.body.getAttribute(yr)||"0",10);return isFinite(e)?e:0},aM=function(){b.useEffect(function(){return document.body.setAttribute(yr,(Hu()+1).toString()),function(){var e=Hu()-1;e<=0?document.body.removeAttribute(yr):document.body.setAttribute(yr,e.toString())}},[])},sM=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;aM();var a=b.useMemo(function(){return nM(o)},[o]);return b.createElement(rM,{styles:oM(a,!t,o,n?"":"!important")})},lc=!1;if(typeof window<"u")try{var ha=Object.defineProperty({},"passive",{get:function(){return lc=!0,!0}});window.addEventListener("test",ha,ha),window.removeEventListener("test",ha,ha)}catch{lc=!1}var tr=lc?{passive:!1}:!1,iM=function(e){return e.tagName==="TEXTAREA"},Dm=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!iM(e)&&n[t]==="visible")},cM=function(e){return Dm(e,"overflowY")},lM=function(e){return Dm(e,"overflowX")},Vu=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Om(e,r);if(o){var a=Rm(e,r),s=a[1],i=a[2];if(s>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},dM=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},uM=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Om=function(e,t){return e==="v"?cM(t):lM(t)},Rm=function(e,t){return e==="v"?dM(t):uM(t)},fM=function(e,t){return e==="h"&&t==="rtl"?-1:1},hM=function(e,t,n,r,o){var a=fM(e,window.getComputedStyle(t).direction),s=a*r,i=n.target,c=t.contains(i),l=!1,u=s>0,f=0,h=0;do{if(!i)break;var p=Rm(e,i),m=p[0],g=p[1],y=p[2],v=g-y-a*m;(m||v)&&Om(e,i)&&(f+=v,h+=m);var w=i.parentNode;i=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&i!==document.body||c&&(t.contains(i)||t===i));return(u&&Math.abs(f)<1||!u&&Math.abs(h)<1)&&(l=!0),l},pa=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Yu=function(e){return[e.deltaX,e.deltaY]},qu=function(e){return e&&"current"in e?e.current:e},pM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},mM=function(e){return`
|
|
288
301
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
289
302
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
290
|
-
`)},QM=0,rr=[];function eP(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),o=w.useState(QM++)[0],s=w.useState(Gp)[0],a=w.useRef(e);w.useEffect(function(){a.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=wM([e.lockRef.current],(e.shards||[]).map(Yd),!0).filter(Boolean);return p.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=w.useCallback(function(p,y){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var v=hs(p),b=n.current,x="deltaX"in p?p.deltaX:b[0]-v[0],j="deltaY"in p?p.deltaY:b[1]-v[1],N,S=p.target,E=Math.abs(x)>Math.abs(j)?"h":"v";if("touches"in p&&E==="h"&&S.type==="range")return!1;var O=window.getSelection(),P=O&&O.anchorNode,T=P?P===S||P.contains(S):!1;if(T)return!1;var k=Hd(E,S);if(!k)return!0;if(k?N=E:(N=E==="v"?"h":"v",k=Hd(E,S)),!k)return!1;if(!r.current&&"changedTouches"in p&&(x||j)&&(r.current=N),!N)return!0;var M=r.current||N;return KM(M,y,p,M==="h"?x:j)},[]),c=w.useCallback(function(p){var y=p;if(!(!rr.length||rr[rr.length-1]!==s)){var v="deltaY"in y?Vd(y):hs(y),b=t.current.filter(function(N){return N.name===y.type&&(N.target===y.target||y.target===N.shadowParent)&&JM(N.delta,v)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var x=(a.current.shards||[]).map(Yd).filter(Boolean).filter(function(N){return N.contains(y.target)}),j=x.length>0?i(y,x[0]):!a.current.noIsolation;j&&y.cancelable&&y.preventDefault()}}},[]),l=w.useCallback(function(p,y,v,b){var x={name:p,delta:y,target:v,should:b,shadowParent:tP(v)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(j){return j!==x})},1)},[]),f=w.useCallback(function(p){n.current=hs(p),r.current=void 0},[]),d=w.useCallback(function(p){l(p.type,Vd(p),p.target,i(p,e.lockRef.current))},[]),h=w.useCallback(function(p){l(p.type,hs(p),p.target,i(p,e.lockRef.current))},[]);w.useEffect(function(){return rr.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",c,nr),document.addEventListener("touchmove",c,nr),document.addEventListener("touchstart",f,nr),function(){rr=rr.filter(function(p){return p!==s}),document.removeEventListener("wheel",c,nr),document.removeEventListener("touchmove",c,nr),document.removeEventListener("touchstart",f,nr)}},[]);var m=e.removeScrollBar,g=e.inert;return w.createElement(w.Fragment,null,g?w.createElement(s,{styles:ZM(o)}):null,m?w.createElement(HM,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function tP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const nP=PM(qp,eP);var _a=w.forwardRef(function(e,t){return w.createElement(Ea,$t({},e,{ref:t,sideCar:nP}))});_a.classNames=Ea.classNames;var rP=[" ","Enter","ArrowUp","ArrowDown"],oP=[" ","Enter"],Vn="Select",[ka,Ma,sP]=gp(Vn),[Lr]=Ze(Vn,[sP,zr]),Pa=zr(),[aP,Sn]=Lr(Vn),[iP,cP]=Lr(Vn),Jp=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:a,defaultValue:i,onValueChange:c,dir:l,name:f,autoComplete:d,disabled:h,required:m,form:g}=e,p=Pa(t),[y,v]=w.useState(null),[b,x]=w.useState(null),[j,N]=w.useState(!1),S=Lo(l),[E,O]=Nt({prop:r,defaultProp:o??!1,onChange:s,caller:Vn}),[P,T]=Nt({prop:a,defaultProp:i,onChange:c,caller:Vn}),k=w.useRef(null),M=y?g||!!y.closest("form"):!0,[W,_]=w.useState(new Set),I=Array.from(W).map(R=>R.props.value).join(";");return u.jsx(el,{...p,children:u.jsxs(aP,{required:m,scope:t,trigger:y,onTriggerChange:v,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:j,onValueNodeHasChildrenChange:N,contentId:jt(),value:P,onValueChange:T,open:E,onOpenChange:O,dir:S,triggerPointerDownPosRef:k,disabled:h,children:[u.jsx(ka.Provider,{scope:t,children:u.jsx(iP,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(R=>{_(z=>new Set(z).add(R))},[]),onNativeOptionRemove:w.useCallback(R=>{_(z=>{const A=new Set(z);return A.delete(R),A})},[]),children:n})}),M?u.jsxs(wg,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:d,value:P,onChange:R=>T(R.target.value),disabled:h,form:g,children:[P===void 0?u.jsx("option",{value:""}):null,Array.from(W)]},I):null]})})};Jp.displayName=Vn;var Zp="SelectTrigger",Qp=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=Pa(n),a=Sn(Zp,n),i=a.disabled||r,c=pe(t,a.onTriggerChange),l=Ma(n),f=w.useRef("touch"),[d,h,m]=Sg(p=>{const y=l().filter(x=>!x.disabled),v=y.find(x=>x.value===a.value),b=Cg(y,p,v);b!==void 0&&a.onValueChange(b.value)}),g=p=>{i||(a.onOpenChange(!0),m()),p&&(a.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return u.jsx(Ca,{asChild:!0,...s,children:u.jsx(ie.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":jg(a.value)?"":void 0,...o,ref:c,onClick:te(o.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&g(p)}),onPointerDown:te(o.onPointerDown,p=>{f.current=p.pointerType;const y=p.target;y.hasPointerCapture(p.pointerId)&&y.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(g(p),p.preventDefault())}),onKeyDown:te(o.onKeyDown,p=>{const y=d.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&h(p.key),!(y&&p.key===" ")&&rP.includes(p.key)&&(g(),p.preventDefault())})})})});Qp.displayName=Zp;var eg="SelectValue",tg=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:a="",...i}=e,c=Sn(eg,n),{onValueNodeHasChildrenChange:l}=c,f=s!==void 0,d=pe(t,c.onValueNodeChange);return We(()=>{l(f)},[l,f]),u.jsx(ie.span,{...i,ref:d,style:{pointerEvents:"none"},children:jg(c.value)?u.jsx(u.Fragment,{children:a}):s})});tg.displayName=eg;var lP="SelectIcon",ng=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return u.jsx(ie.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});ng.displayName=lP;var uP="SelectPortal",rg=e=>u.jsx(Bo,{asChild:!0,...e});rg.displayName=uP;var Yn="SelectContent",og=w.forwardRef((e,t)=>{const n=Sn(Yn,e.__scopeSelect),[r,o]=w.useState();if(We(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Zs.createPortal(u.jsx(sg,{scope:e.__scopeSelect,children:u.jsx(ka.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),s):null}return u.jsx(ag,{...e,ref:t})});og.displayName=Yn;var mt=10,[sg,Cn]=Lr(Yn),dP="SelectContentImpl",fP=iM("SelectContent.RemoveScroll"),ag=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:a,side:i,sideOffset:c,align:l,alignOffset:f,arrowPadding:d,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:p,avoidCollisions:y,...v}=e,b=Sn(Yn,n),[x,j]=w.useState(null),[N,S]=w.useState(null),E=pe(t,$=>j($)),[O,P]=w.useState(null),[T,k]=w.useState(null),M=Ma(n),[W,_]=w.useState(!1),I=w.useRef(!1);w.useEffect(()=>{if(x)return rl(x)},[x]),Yc();const R=w.useCallback($=>{const[F,...U]=M().map(K=>K.ref.current),[X]=U.slice(-1),Z=document.activeElement;for(const K of $)if(K===Z||(K==null||K.scrollIntoView({block:"nearest"}),K===F&&N&&(N.scrollTop=0),K===X&&N&&(N.scrollTop=N.scrollHeight),K==null||K.focus(),document.activeElement!==Z))return},[M,N]),z=w.useCallback(()=>R([O,x]),[R,O,x]);w.useEffect(()=>{W&&z()},[W,z]);const{onOpenChange:A,triggerPointerDownPosRef:D}=b;w.useEffect(()=>{if(x){let $={x:0,y:0};const F=X=>{var Z,K;$={x:Math.abs(Math.round(X.pageX)-(((Z=D.current)==null?void 0:Z.x)??0)),y:Math.abs(Math.round(X.pageY)-(((K=D.current)==null?void 0:K.y)??0))}},U=X=>{$.x<=10&&$.y<=10?X.preventDefault():x.contains(X.target)||A(!1),document.removeEventListener("pointermove",F),D.current=null};return D.current!==null&&(document.addEventListener("pointermove",F),document.addEventListener("pointerup",U,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",F),document.removeEventListener("pointerup",U,{capture:!0})}}},[x,A,D]),w.useEffect(()=>{const $=()=>A(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[A]);const[B,q]=Sg($=>{const F=M().filter(Z=>!Z.disabled),U=F.find(Z=>Z.ref.current===document.activeElement),X=Cg(F,$,U);X&&setTimeout(()=>X.ref.current.focus())}),V=w.useCallback(($,F,U)=>{const X=!I.current&&!U;(b.value!==void 0&&b.value===F||X)&&(P($),X&&(I.current=!0))},[b.value]),H=w.useCallback(()=>x==null?void 0:x.focus(),[x]),L=w.useCallback(($,F,U)=>{const X=!I.current&&!U;(b.value!==void 0&&b.value===F||X)&&k($)},[b.value]),Y=r==="popper"?rc:ig,G=Y===rc?{side:i,sideOffset:c,align:l,alignOffset:f,arrowPadding:d,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:p,avoidCollisions:y}:{};return u.jsx(sg,{scope:n,content:x,viewport:N,onViewportChange:S,itemRefCallback:V,selectedItem:O,onItemLeave:H,itemTextRefCallback:L,focusSelectedItem:z,selectedItemText:T,position:r,isPositioned:W,searchRef:B,children:u.jsx(_a,{as:fP,allowPinchZoom:!0,children:u.jsx(xa,{asChild:!0,trapped:b.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:te(o,$=>{var F;(F=b.trigger)==null||F.focus({preventScroll:!0}),$.preventDefault()}),children:u.jsx(Wo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:u.jsx(Y,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:$=>$.preventDefault(),...v,...G,onPlaced:()=>_(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:te(v.onKeyDown,$=>{const F=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!F&&$.key.length===1&&q($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let X=M().filter(Z=>!Z.disabled).map(Z=>Z.ref.current);if(["ArrowUp","End"].includes($.key)&&(X=X.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const Z=$.target,K=X.indexOf(Z);X=X.slice(K+1)}setTimeout(()=>R(X)),$.preventDefault()}})})})})})})});ag.displayName=dP;var hP="SelectItemAlignedPosition",ig=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=Sn(Yn,n),a=Cn(Yn,n),[i,c]=w.useState(null),[l,f]=w.useState(null),d=pe(t,E=>f(E)),h=Ma(n),m=w.useRef(!1),g=w.useRef(!0),{viewport:p,selectedItem:y,selectedItemText:v,focusSelectedItem:b}=a,x=w.useCallback(()=>{if(s.trigger&&s.valueNode&&i&&l&&p&&y&&v){const E=s.trigger.getBoundingClientRect(),O=l.getBoundingClientRect(),P=s.valueNode.getBoundingClientRect(),T=v.getBoundingClientRect();if(s.dir!=="rtl"){const Z=T.left-O.left,K=P.left-Z,J=E.left-K,ee=E.width+J,se=Math.max(ee,O.width),ae=window.innerWidth-mt,ue=Ji(K,[mt,Math.max(mt,ae-se)]);i.style.minWidth=ee+"px",i.style.left=ue+"px"}else{const Z=O.right-T.right,K=window.innerWidth-P.right-Z,J=window.innerWidth-E.right-K,ee=E.width+J,se=Math.max(ee,O.width),ae=window.innerWidth-mt,ue=Ji(K,[mt,Math.max(mt,ae-se)]);i.style.minWidth=ee+"px",i.style.right=ue+"px"}const k=h(),M=window.innerHeight-mt*2,W=p.scrollHeight,_=window.getComputedStyle(l),I=parseInt(_.borderTopWidth,10),R=parseInt(_.paddingTop,10),z=parseInt(_.borderBottomWidth,10),A=parseInt(_.paddingBottom,10),D=I+R+W+A+z,B=Math.min(y.offsetHeight*5,D),q=window.getComputedStyle(p),V=parseInt(q.paddingTop,10),H=parseInt(q.paddingBottom,10),L=E.top+E.height/2-mt,Y=M-L,G=y.offsetHeight/2,$=y.offsetTop+G,F=I+R+$,U=D-F;if(F<=L){const Z=k.length>0&&y===k[k.length-1].ref.current;i.style.bottom="0px";const K=l.clientHeight-p.offsetTop-p.offsetHeight,J=Math.max(Y,G+(Z?H:0)+K+z),ee=F+J;i.style.height=ee+"px"}else{const Z=k.length>0&&y===k[0].ref.current;i.style.top="0px";const J=Math.max(L,I+p.offsetTop+(Z?V:0)+G)+U;i.style.height=J+"px",p.scrollTop=F-L+p.offsetTop}i.style.margin=`${mt}px 0`,i.style.minHeight=B+"px",i.style.maxHeight=M+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[h,s.trigger,s.valueNode,i,l,p,y,v,s.dir,r]);We(()=>x(),[x]);const[j,N]=w.useState();We(()=>{l&&N(window.getComputedStyle(l).zIndex)},[l]);const S=w.useCallback(E=>{E&&g.current===!0&&(x(),b==null||b(),g.current=!1)},[x,b]);return u.jsx(pP,{scope:n,contentWrapper:i,shouldExpandOnScrollRef:m,onScrollButtonChange:S,children:u.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:u.jsx(ie.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});ig.displayName=hP;var mP="SelectPopperPosition",rc=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=mt,...s}=e,a=Pa(n);return u.jsx(tl,{...a,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});rc.displayName=mP;var[pP,ol]=Lr(Yn,{}),oc="SelectViewport",cg=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=Cn(oc,n),a=ol(oc,n),i=pe(t,s.onViewportChange),c=w.useRef(0);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),u.jsx(ka.Slot,{scope:n,children:u.jsx(ie.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:te(o.onScroll,l=>{const f=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=a;if(h!=null&&h.current&&d){const m=Math.abs(c.current-f.scrollTop);if(m>0){const g=window.innerHeight-mt*2,p=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),v=Math.max(p,y);if(v<g){const b=v+m,x=Math.min(g,b),j=b-x;d.style.height=x+"px",d.style.bottom==="0px"&&(f.scrollTop=j>0?j:0,d.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});cg.displayName=oc;var lg="SelectGroup",[gP,yP]=Lr(lg),xP=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=jt();return u.jsx(gP,{scope:n,id:o,children:u.jsx(ie.div,{role:"group","aria-labelledby":o,...r,ref:t})})});xP.displayName=lg;var ug="SelectLabel",dg=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=yP(ug,n);return u.jsx(ie.div,{id:o.id,...r,ref:t})});dg.displayName=ug;var Gs="SelectItem",[vP,fg]=Lr(Gs),hg=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...a}=e,i=Sn(Gs,n),c=Cn(Gs,n),l=i.value===r,[f,d]=w.useState(s??""),[h,m]=w.useState(!1),g=pe(t,b=>{var x;return(x=c.itemRefCallback)==null?void 0:x.call(c,b,r,o)}),p=jt(),y=w.useRef("touch"),v=()=>{o||(i.onValueChange(r),i.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return u.jsx(vP,{scope:n,value:r,disabled:o,textId:p,isSelected:l,onItemTextChange:w.useCallback(b=>{d(x=>x||((b==null?void 0:b.textContent)??"").trim())},[]),children:u.jsx(ka.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:u.jsx(ie.div,{role:"option","aria-labelledby":p,"data-highlighted":h?"":void 0,"aria-selected":l&&h,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:g,onFocus:te(a.onFocus,()=>m(!0)),onBlur:te(a.onBlur,()=>m(!1)),onClick:te(a.onClick,()=>{y.current!=="mouse"&&v()}),onPointerUp:te(a.onPointerUp,()=>{y.current==="mouse"&&v()}),onPointerDown:te(a.onPointerDown,b=>{y.current=b.pointerType}),onPointerMove:te(a.onPointerMove,b=>{var x;y.current=b.pointerType,o?(x=c.onItemLeave)==null||x.call(c):y.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:te(a.onPointerLeave,b=>{var x;b.currentTarget===document.activeElement&&((x=c.onItemLeave)==null||x.call(c))}),onKeyDown:te(a.onKeyDown,b=>{var j;((j=c.searchRef)==null?void 0:j.current)!==""&&b.key===" "||(oP.includes(b.key)&&v(),b.key===" "&&b.preventDefault())})})})})});hg.displayName=Gs;var oo="SelectItemText",mg=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,a=Sn(oo,n),i=Cn(oo,n),c=fg(oo,n),l=cP(oo,n),[f,d]=w.useState(null),h=pe(t,v=>d(v),c.onItemTextChange,v=>{var b;return(b=i.itemTextRefCallback)==null?void 0:b.call(i,v,c.value,c.disabled)}),m=f==null?void 0:f.textContent,g=w.useMemo(()=>u.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:p,onNativeOptionRemove:y}=l;return We(()=>(p(g),()=>y(g)),[p,y,g]),u.jsxs(u.Fragment,{children:[u.jsx(ie.span,{id:c.textId,...s,ref:h}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Zs.createPortal(s.children,a.valueNode):null]})});mg.displayName=oo;var pg="SelectItemIndicator",gg=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return fg(pg,n).isSelected?u.jsx(ie.span,{"aria-hidden":!0,...r,ref:t}):null});gg.displayName=pg;var sc="SelectScrollUpButton",yg=w.forwardRef((e,t)=>{const n=Cn(sc,e.__scopeSelect),r=ol(sc,e.__scopeSelect),[o,s]=w.useState(!1),a=pe(t,r.onScrollButtonChange);return We(()=>{if(n.viewport&&n.isPositioned){let i=function(){const l=c.scrollTop>0;s(l)};const c=n.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?u.jsx(vg,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=n;i&&c&&(i.scrollTop=i.scrollTop-c.offsetHeight)}}):null});yg.displayName=sc;var ac="SelectScrollDownButton",xg=w.forwardRef((e,t)=>{const n=Cn(ac,e.__scopeSelect),r=ol(ac,e.__scopeSelect),[o,s]=w.useState(!1),a=pe(t,r.onScrollButtonChange);return We(()=>{if(n.viewport&&n.isPositioned){let i=function(){const l=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<l;s(f)};const c=n.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?u.jsx(vg,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=n;i&&c&&(i.scrollTop=i.scrollTop+c.offsetHeight)}}):null});xg.displayName=ac;var vg=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=Cn("SelectScrollButton",n),a=w.useRef(null),i=Ma(n),c=w.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return w.useEffect(()=>()=>c(),[c]),We(()=>{var f;const l=i().find(d=>d.ref.current===document.activeElement);(f=l==null?void 0:l.ref.current)==null||f.scrollIntoView({block:"nearest"})},[i]),u.jsx(ie.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:te(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:te(o.onPointerMove,()=>{var l;(l=s.onItemLeave)==null||l.call(s),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:te(o.onPointerLeave,()=>{c()})})}),bP="SelectSeparator",bg=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u.jsx(ie.div,{"aria-hidden":!0,...r,ref:t})});bg.displayName=bP;var ic="SelectArrow",wP=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Pa(n),s=Sn(ic,n),a=Cn(ic,n);return s.open&&a.position==="popper"?u.jsx(nl,{...o,...r,ref:t}):null});wP.displayName=ic;var jP="SelectBubbleInput",wg=w.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=w.useRef(null),s=pe(r,o),a=Na(t);return w.useEffect(()=>{const i=o.current;if(!i)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&f){const d=new Event("change",{bubbles:!0});f.call(i,t),i.dispatchEvent(d)}},[a,t]),u.jsx(ie.select,{...n,style:{...Fp,...n.style},ref:s,defaultValue:t})});wg.displayName=jP;function jg(e){return e===""||e===void 0}function Sg(e){const t=Ge(e),n=w.useRef(""),r=w.useRef(0),o=w.useCallback(a=>{const i=n.current+a;t(i),function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(i)},[t]),s=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function Cg(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=SP(e,Math.max(s,0));o.length===1&&(a=a.filter(l=>l!==n));const c=a.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function SP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var CP=Jp,Ng=Qp,NP=tg,EP=ng,_P=rg,Eg=og,kP=cg,_g=dg,kg=hg,MP=mg,PP=gg,Mg=yg,Pg=xg,Dg=bg;const sl=C.createContext(null);function Ho(){return C.useContext(sl)}const tn=CP,nn=NP,Lt=w.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(Ng,{ref:r,className:ce("cj-flex cj-h-10 cj-w-full cj-items-center cj-justify-between cj-rounded-md cj-border cj-border-input cj-bg-background cj-px-3 cj-py-2 cj-text-sm cj-ring-offset-background placeholder:cj-text-muted-foreground focus:cj-outline-none focus:cj-ring-2 focus:cj-ring-ring focus:cj-ring-offset-2 disabled:cj-cursor-not-allowed disabled:cj-opacity-50 [&>span]:cj-line-clamp-1",e),...n,children:[t,u.jsx(EP,{asChild:!0,children:u.jsx(Rr,{className:"cj-h-4 cj-w-4 cj-opacity-50"})})]}));Lt.displayName=Ng.displayName;const Og=w.forwardRef(({className:e,...t},n)=>u.jsx(Mg,{ref:n,className:ce("cj-flex cj-cursor-default cj-items-center cj-justify-center cj-py-1",e),...t,children:u.jsx(vm,{className:"cj-h-4 cj-w-4"})}));Og.displayName=Mg.displayName;const Rg=w.forwardRef(({className:e,...t},n)=>u.jsx(Pg,{ref:n,className:ce("cj-flex cj-cursor-default cj-items-center cj-justify-center cj-py-1",e),...t,children:u.jsx(Rr,{className:"cj-h-4 cj-w-4"})}));Rg.displayName=Pg.displayName;const Wt=w.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>{const s=Ho();return u.jsx(_P,{container:s??void 0,children:u.jsxs(Eg,{ref:o,className:ce("cj-relative cj-z-50 cj-max-h-96 cj-min-w-[8rem] cj-overflow-hidden cj-rounded-md cj-border cj-bg-popover cj-text-popover-foreground cj-shadow-md data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0 data-[state=closed]:cj-zoom-out-95 data-[state=open]:cj-zoom-in-95 data-[side=bottom]:cj-slide-in-from-top-2 data-[side=left]:cj-slide-in-from-right-2 data-[side=right]:cj-slide-in-from-left-2 data-[side=top]:cj-slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:cj-translate-y-1 data-[side=left]:-cj-translate-x-1 data-[side=right]:cj-translate-x-1 data-[side=top]:-cj-translate-y-1",e),position:n,...r,children:[u.jsx(Og,{}),u.jsx(kP,{className:ce("cj-p-1",n==="popper"&&"cj-h-[var(--radix-select-trigger-height)] cj-w-full cj-min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(Rg,{})]})})});Wt.displayName=Eg.displayName;const DP=w.forwardRef(({className:e,...t},n)=>u.jsx(_g,{ref:n,className:ce("cj-py-1.5 cj-pl-8 cj-pr-2 cj-text-sm cj-font-semibold",e),...t}));DP.displayName=_g.displayName;const _e=w.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(kg,{ref:r,className:ce("cj-relative cj-flex cj-w-full cj-cursor-default cj-select-none cj-items-center cj-rounded-sm cj-py-1.5 cj-pl-8 cj-pr-2 cj-text-sm cj-outline-none data-[disabled]:cj-pointer-events-none data-[disabled]:cj-opacity-50 focus:cj-bg-accent focus:cj-text-accent-foreground",e),...n,children:[u.jsx("span",{className:"cj-absolute cj-left-2 cj-flex cj-h-3.5 cj-w-3.5 cj-items-center cj-justify-center",children:u.jsx(PP,{children:u.jsx(ym,{className:"cj-h-4 cj-w-4"})})}),u.jsx(MP,{children:t})]}));_e.displayName=kg.displayName;const OP=w.forwardRef(({className:e,...t},n)=>u.jsx(Dg,{ref:n,className:ce("-cj-mx-1 cj-my-1 cj-h-px cj-bg-muted",e),...t}));OP.displayName=Dg.displayName;const al={v1_string:{label:"String",color:"cj-bg-blue-500"},"v2_single_option_select-1":{label:"Single Select",color:"cj-bg-purple-500"},"v2_date-1":{label:"Date",color:"cj-bg-green-500"},"v2_currency-1":{label:"Currency",color:"cj-bg-yellow-500"},v2_single_asset_upload:{label:"Upload",color:"cj-bg-orange-500"},"v2_phone-1":{label:"Phone",color:"cj-bg-teal-500"},"v2_email-1":{label:"Email",color:"cj-bg-rose-500"}};function Mr(e){return al[e]||{label:e,color:"cj-bg-muted"}}function RP(e){const t=AP(e),n=w.forwardRef((r,o)=>{const{children:s,...a}=r,i=w.Children.toArray(s),c=i.find(IP);if(c){const l=c.props.children,f=i.map(d=>d===c?w.Children.count(l)>1?w.Children.only(null):w.isValidElement(l)?l.props.children:null:d);return u.jsx(t,{...a,ref:o,children:w.isValidElement(l)?w.cloneElement(l,void 0,f):null})}return u.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function AP(e){const t=w.forwardRef((n,r)=>{const{children:o,...s}=n;if(w.isValidElement(o)){const a=zP(o),i=$P(s,o.props);return o.type!==w.Fragment&&(i.ref=r?Un(r,a):a),w.cloneElement(o,i)}return w.Children.count(o)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var TP=Symbol("radix.slottable");function IP(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===TP}function $P(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const c=s(...i);return o(...i),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function zP(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Da="Dialog",[Ag]=Ze(Da),[LP,_t]=Ag(Da),Tg=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,i=w.useRef(null),c=w.useRef(null),[l,f]=Nt({prop:r,defaultProp:o??!1,onChange:s,caller:Da});return u.jsx(LP,{scope:t,triggerRef:i,contentRef:c,contentId:jt(),titleId:jt(),descriptionId:jt(),open:l,onOpenChange:f,onOpenToggle:w.useCallback(()=>f(d=>!d),[f]),modal:a,children:n})};Tg.displayName=Da;var Ig="DialogTrigger",$g=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=_t(Ig,n),s=pe(t,o.triggerRef);return u.jsx(ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ll(o.open),...r,ref:s,onClick:te(e.onClick,o.onOpenToggle)})});$g.displayName=Ig;var il="DialogPortal",[WP,zg]=Ag(il,{forceMount:void 0}),Lg=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=_t(il,t);return u.jsx(WP,{scope:t,forceMount:n,children:w.Children.map(r,a=>u.jsx(Ye,{present:n||s.open,children:u.jsx(Bo,{asChild:!0,container:o,children:a})}))})};Lg.displayName=il;var Us="DialogOverlay",Wg=w.forwardRef((e,t)=>{const n=zg(Us,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=_t(Us,e.__scopeDialog);return s.modal?u.jsx(Ye,{present:r||s.open,children:u.jsx(BP,{...o,ref:t})}):null});Wg.displayName=Us;var FP=RP("DialogOverlay.RemoveScroll"),BP=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=_t(Us,n);return u.jsx(_a,{as:FP,allowPinchZoom:!0,shards:[o.contentRef],children:u.jsx(ie.div,{"data-state":ll(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),qn="DialogContent",Fg=w.forwardRef((e,t)=>{const n=zg(qn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=_t(qn,e.__scopeDialog);return u.jsx(Ye,{present:r||s.open,children:s.modal?u.jsx(HP,{...o,ref:t}):u.jsx(VP,{...o,ref:t})})});Fg.displayName=qn;var HP=w.forwardRef((e,t)=>{const n=_t(qn,e.__scopeDialog),r=w.useRef(null),o=pe(t,n.contentRef,r);return w.useEffect(()=>{const s=r.current;if(s)return rl(s)},[]),u.jsx(Bg,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:te(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:te(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,i=a.button===0&&a.ctrlKey===!0;(a.button===2||i)&&s.preventDefault()}),onFocusOutside:te(e.onFocusOutside,s=>s.preventDefault())})}),VP=w.forwardRef((e,t)=>{const n=_t(qn,e.__scopeDialog),r=w.useRef(!1),o=w.useRef(!1);return u.jsx(Bg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,i;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(r.current||(i=n.triggerRef.current)==null||i.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;((l=n.triggerRef.current)==null?void 0:l.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Bg=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...a}=e,i=_t(qn,n),c=w.useRef(null),l=pe(t,c);return Yc(),u.jsxs(u.Fragment,{children:[u.jsx(xa,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:u.jsx(Wo,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":ll(i.open),...a,ref:l,onDismiss:()=>i.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(YP,{titleId:i.titleId}),u.jsx(GP,{contentRef:c,descriptionId:i.descriptionId})]})]})}),cl="DialogTitle",Hg=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=_t(cl,n);return u.jsx(ie.h2,{id:o.titleId,...r,ref:t})});Hg.displayName=cl;var Vg="DialogDescription",Yg=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=_t(Vg,n);return u.jsx(ie.p,{id:o.descriptionId,...r,ref:t})});Yg.displayName=Vg;var qg="DialogClose",Gg=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=_t(qg,n);return u.jsx(ie.button,{type:"button",...r,ref:t,onClick:te(e.onClick,()=>o.onOpenChange(!1))})});Gg.displayName=qg;function ll(e){return e?"open":"closed"}var Ug="DialogTitleWarning",[l4,Xg]=r_(Ug,{contentName:qn,titleName:cl,docsSlug:"dialog"}),YP=({titleId:e})=>{const t=Xg(Ug),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
303
|
+
`)},gM=0,nr=[];function yM(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),o=b.useState(gM++)[0],a=b.useState(Mm)[0],s=b.useRef(e);b.useEffect(function(){s.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=zP([e.lockRef.current],(e.shards||[]).map(qu),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=b.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!s.current.allowPinchZoom;var v=pa(g),w=n.current,x="deltaX"in g?g.deltaX:w[0]-v[0],j="deltaY"in g?g.deltaY:w[1]-v[1],N,S=g.target,C=Math.abs(x)>Math.abs(j)?"h":"v";if("touches"in g&&C==="h"&&S.type==="range")return!1;var P=window.getSelection(),k=P&&P.anchorNode,T=k?k===S||k.contains(S):!1;if(T)return!1;var D=Vu(C,S);if(!D)return!0;if(D?N=C:(N=C==="v"?"h":"v",D=Vu(C,S)),!D)return!1;if(!r.current&&"changedTouches"in g&&(x||j)&&(r.current=N),!N)return!0;var M=r.current||N;return hM(M,y,g,M==="h"?x:j)},[]),c=b.useCallback(function(g){var y=g;if(!(!nr.length||nr[nr.length-1]!==a)){var v="deltaY"in y?Yu(y):pa(y),w=t.current.filter(function(N){return N.name===y.type&&(N.target===y.target||y.target===N.shadowParent)&&pM(N.delta,v)})[0];if(w&&w.should){y.cancelable&&y.preventDefault();return}if(!w){var x=(s.current.shards||[]).map(qu).filter(Boolean).filter(function(N){return N.contains(y.target)}),j=x.length>0?i(y,x[0]):!s.current.noIsolation;j&&y.cancelable&&y.preventDefault()}}},[]),l=b.useCallback(function(g,y,v,w){var x={name:g,delta:y,target:v,should:w,shadowParent:xM(v)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(j){return j!==x})},1)},[]),u=b.useCallback(function(g){n.current=pa(g),r.current=void 0},[]),f=b.useCallback(function(g){l(g.type,Yu(g),g.target,i(g,e.lockRef.current))},[]),h=b.useCallback(function(g){l(g.type,pa(g),g.target,i(g,e.lockRef.current))},[]);b.useEffect(function(){return nr.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,tr),document.addEventListener("touchmove",c,tr),document.addEventListener("touchstart",u,tr),function(){nr=nr.filter(function(g){return g!==a}),document.removeEventListener("wheel",c,tr),document.removeEventListener("touchmove",c,tr),document.removeEventListener("touchstart",u,tr)}},[]);var p=e.removeScrollBar,m=e.inert;return b.createElement(b.Fragment,null,m?b.createElement(a,{styles:mM(o)}):null,p?b.createElement(sM,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function xM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const vM=GP(Pm,yM);var Ns=b.forwardRef(function(e,t){return b.createElement(Cs,zt({},e,{ref:t,sideCar:vM}))});Ns.classNames=Cs.classNames;var bM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},rr=new WeakMap,ma=new WeakMap,ga={},vi=0,Am=function(e){return e&&(e.host||Am(e.parentNode))},wM=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Am(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},jM=function(e,t,n,r){var o=wM(t,Array.isArray(e)?e:[e]);ga[n]||(ga[n]=new WeakMap);var a=ga[n],s=[],i=new Set,c=new Set(o),l=function(f){!f||i.has(f)||(i.add(f),l(f.parentNode))};o.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(i.has(h))u(h);else try{var p=h.getAttribute(r),m=p!==null&&p!=="false",g=(rr.get(h)||0)+1,y=(a.get(h)||0)+1;rr.set(h,g),a.set(h,y),s.push(h),g===1&&m&&ma.set(h,!0),y===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return u(t),i.clear(),vi++,function(){s.forEach(function(f){var h=rr.get(f)-1,p=a.get(f)-1;rr.set(f,h),a.set(f,p),h||(ma.has(f)||f.removeAttribute(r),ma.delete(f)),p||f.removeAttribute(n)}),vi--,vi||(rr=new WeakMap,rr=new WeakMap,ma=new WeakMap,ga={})}},sl=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=bM(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),jM(r,o,n,"aria-hidden")):function(){return null}};function _M(e){const t=SM(e),n=b.forwardRef((r,o)=>{const{children:a,...s}=r,i=b.Children.toArray(a),c=i.find(NM);if(c){const l=c.props.children,u=i.map(f=>f===c?b.Children.count(l)>1?b.Children.only(null):b.isValidElement(l)?l.props.children:null:f);return d.jsx(t,{...s,ref:o,children:b.isValidElement(l)?b.cloneElement(l,void 0,u):null})}return d.jsx(t,{...s,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function SM(e){const t=b.forwardRef((n,r)=>{const{children:o,...a}=n;if(b.isValidElement(o)){const s=kM(o),i=EM(a,o.props);return o.type!==b.Fragment&&(i.ref=r?Xn(r,s):s),b.cloneElement(o,i)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var CM=Symbol("radix.slottable");function NM(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===CM}function EM(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{const c=a(...i);return o(...i),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function kM(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Es="Dialog",[Tm]=Ze(Es),[PM,kt]=Tm(Es),Im=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,i=b.useRef(null),c=b.useRef(null),[l,u]=Nt({prop:r,defaultProp:o??!1,onChange:a,caller:Es});return d.jsx(PM,{scope:t,triggerRef:i,contentRef:c,contentId:jt(),titleId:jt(),descriptionId:jt(),open:l,onOpenChange:u,onOpenToggle:b.useCallback(()=>u(f=>!f),[u]),modal:s,children:n})};Im.displayName=Es;var $m="DialogTrigger",zm=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=kt($m,n),a=me(t,o.triggerRef);return d.jsx(se.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ll(o.open),...r,ref:a,onClick:te(e.onClick,o.onOpenToggle)})});zm.displayName=$m;var il="DialogPortal",[MM,Lm]=Tm(il,{forceMount:void 0}),Wm=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=kt(il,t);return d.jsx(MM,{scope:t,forceMount:n,children:b.Children.map(r,s=>d.jsx(Ye,{present:n||a.open,children:d.jsx(Vo,{asChild:!0,container:o,children:s})}))})};Wm.displayName=il;var Ga="DialogOverlay",Fm=b.forwardRef((e,t)=>{const n=Lm(Ga,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=kt(Ga,e.__scopeDialog);return a.modal?d.jsx(Ye,{present:r||a.open,children:d.jsx(OM,{...o,ref:t})}):null});Fm.displayName=Ga;var DM=_M("DialogOverlay.RemoveScroll"),OM=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=kt(Ga,n);return d.jsx(Ns,{as:DM,allowPinchZoom:!0,shards:[o.contentRef],children:d.jsx(se.div,{"data-state":ll(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Vn="DialogContent",Bm=b.forwardRef((e,t)=>{const n=Lm(Vn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=kt(Vn,e.__scopeDialog);return d.jsx(Ye,{present:r||a.open,children:a.modal?d.jsx(RM,{...o,ref:t}):d.jsx(AM,{...o,ref:t})})});Bm.displayName=Vn;var RM=b.forwardRef((e,t)=>{const n=kt(Vn,e.__scopeDialog),r=b.useRef(null),o=me(t,n.contentRef,r);return b.useEffect(()=>{const a=r.current;if(a)return sl(a)},[]),d.jsx(Hm,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:te(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:te(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,i=s.button===0&&s.ctrlKey===!0;(s.button===2||i)&&a.preventDefault()}),onFocusOutside:te(e.onFocusOutside,a=>a.preventDefault())})}),AM=b.forwardRef((e,t)=>{const n=kt(Vn,e.__scopeDialog),r=b.useRef(!1),o=b.useRef(!1);return d.jsx(Hm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,i;(s=e.onCloseAutoFocus)==null||s.call(e,a),a.defaultPrevented||(r.current||(i=n.triggerRef.current)==null||i.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=a.target;((l=n.triggerRef.current)==null?void 0:l.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Hm=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...s}=e,i=kt(Vn,n),c=b.useRef(null),l=me(t,c);return al(),d.jsxs(d.Fragment,{children:[d.jsx(Ss,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:d.jsx(Bo,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":ll(i.open),...s,ref:l,onDismiss:()=>i.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(TM,{titleId:i.titleId}),d.jsx($M,{contentRef:c,descriptionId:i.descriptionId})]})]})}),cl="DialogTitle",Vm=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=kt(cl,n);return d.jsx(se.h2,{id:o.titleId,...r,ref:t})});Vm.displayName=cl;var Ym="DialogDescription",qm=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=kt(Ym,n);return d.jsx(se.p,{id:o.descriptionId,...r,ref:t})});qm.displayName=Ym;var Gm="DialogClose",Um=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=kt(Gm,n);return d.jsx(se.button,{type:"button",...r,ref:t,onClick:te(e.onClick,()=>o.onOpenChange(!1))})});Um.displayName=Gm;function ll(e){return e?"open":"closed"}var Xm="DialogTitleWarning",[N4,Km]=pE(Xm,{contentName:Vn,titleName:cl,docsSlug:"dialog"}),TM=({titleId:e})=>{const t=Km(Xm),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
291
304
|
|
|
292
305
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
293
306
|
|
|
294
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},qP="DialogDescriptionWarning",GP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Xg(qP).contentName}}.`;return w.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},UP=Tg,XP=$g,KP=Lg,Kg=Wg,Jg=Fg,Zg=Hg,Qg=Yg,JP=Gg;const ey=UP,ZP=XP,QP=KP,ty=w.forwardRef(({className:e,...t},n)=>{const r=Ho();return u.jsx(Kg,{ref:n,className:ce(r?"cj-absolute cj-inset-0 cj-z-50 cj-bg-black/80 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0":"cj-fixed cj-inset-0 cj-z-50 cj-bg-black/80 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0",e),...t})});ty.displayName=Kg.displayName;const ul=w.forwardRef(({className:e,children:t,...n},r)=>{const o=Ho(),s=o?"cj-absolute cj-left-[50%] cj-top-[50%] cj-z-50 cj-grid cj-w-full cj-max-w-lg cj-translate-x-[-50%] cj-translate-y-[-50%] cj-gap-4 cj-border cj-bg-background cj-p-6 cj-shadow-lg cj-duration-200 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0 data-[state=closed]:cj-zoom-out-95 data-[state=open]:cj-zoom-in-95 sm:cj-rounded-lg":"cj-fixed cj-left-[50%] cj-top-[50%] cj-z-50 cj-grid cj-w-full cj-max-w-lg cj-translate-x-[-50%] cj-translate-y-[-50%] cj-gap-4 cj-border cj-bg-background cj-p-6 cj-shadow-lg cj-duration-200 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0 data-[state=closed]:cj-zoom-out-95 data-[state=open]:cj-zoom-in-95 data-[state=closed]:cj-slide-out-to-left-1/2 data-[state=closed]:cj-slide-out-to-top-[48%] data-[state=open]:cj-slide-in-from-left-1/2 data-[state=open]:cj-slide-in-from-top-[48%] sm:cj-rounded-lg";return u.jsxs(QP,{container:o??void 0,children:[u.jsx(ty,{}),u.jsxs(Jg,{ref:r,className:ce(s,e),...n,children:[t,u.jsxs(JP,{className:"cj-absolute cj-right-4 cj-top-4 cj-rounded-sm cj-opacity-70 cj-ring-offset-background cj-transition-opacity data-[state=open]:cj-bg-accent data-[state=open]:cj-text-muted-foreground hover:cj-opacity-100 focus:cj-outline-none focus:cj-ring-2 focus:cj-ring-ring focus:cj-ring-offset-2 disabled:cj-pointer-events-none",children:[u.jsx(Er,{className:"cj-h-4 cj-w-4"}),u.jsx("span",{className:"cj-sr-only",children:"Close"})]})]})]})});ul.displayName=Jg.displayName;const dl=({className:e,...t})=>u.jsx("div",{className:ce("cj-flex cj-flex-col cj-space-y-1.5 cj-text-center sm:cj-text-left",e),...t});dl.displayName="DialogHeader";const fl=({className:e,...t})=>u.jsx("div",{className:ce("cj-flex cj-flex-col-reverse sm:cj-flex-row sm:cj-justify-end sm:cj-space-x-2",e),...t});fl.displayName="DialogFooter";const hl=w.forwardRef(({className:e,...t},n)=>u.jsx(Zg,{ref:n,className:ce("cj-text-lg cj-font-semibold cj-leading-none cj-tracking-tight",e),...t}));hl.displayName=Zg.displayName;const ml=w.forwardRef(({className:e,...t},n)=>u.jsx(Qg,{ref:n,className:ce("cj-text-sm cj-text-muted-foreground",e),...t}));ml.displayName=Qg.displayName;var e2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],t2=e2.reduce((e,t)=>{const n=pa(`Primitive.${t}`),r=w.forwardRef((o,s)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),n2="Label",ny=w.forwardRef((e,t)=>u.jsx(t2.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));ny.displayName=n2;var ry=ny;const r2=ma("cj-text-sm cj-font-medium cj-leading-none peer-disabled:cj-cursor-not-allowed peer-disabled:cj-opacity-70"),we=w.forwardRef(({className:e,...t},n)=>u.jsx(ry,{ref:n,className:ce(r2(),e),...t}));we.displayName=ry.displayName;var Oa="Checkbox",[o2]=Ze(Oa),[s2,pl]=o2(Oa);function a2(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:s,form:a,name:i,onCheckedChange:c,required:l,value:f="on",internal_do_not_use_render:d}=e,[h,m]=Nt({prop:n,defaultProp:o??!1,onChange:c,caller:Oa}),[g,p]=w.useState(null),[y,v]=w.useState(null),b=w.useRef(!1),x=g?!!a||!!g.closest("form"):!0,j={checked:h,disabled:s,setChecked:m,control:g,setControl:p,name:i,form:a,value:f,hasConsumerStoppedPropagationRef:b,required:l,defaultChecked:bn(o)?!1:o,isFormControl:x,bubbleInput:y,setBubbleInput:v};return u.jsx(s2,{scope:t,...j,children:i2(d)?d(j):r})}var oy="CheckboxTrigger",sy=w.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:a,disabled:i,checked:c,required:l,setControl:f,setChecked:d,hasConsumerStoppedPropagationRef:h,isFormControl:m,bubbleInput:g}=pl(oy,e),p=pe(o,f),y=w.useRef(c);return w.useEffect(()=>{const v=s==null?void 0:s.form;if(v){const b=()=>d(y.current);return v.addEventListener("reset",b),()=>v.removeEventListener("reset",b)}},[s,d]),u.jsx(ie.button,{type:"button",role:"checkbox","aria-checked":bn(c)?"mixed":c,"aria-required":l,"data-state":uy(c),"data-disabled":i?"":void 0,disabled:i,value:a,...r,ref:p,onKeyDown:te(t,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:te(n,v=>{d(b=>bn(b)?!0:!b),g&&m&&(h.current=v.isPropagationStopped(),h.current||v.stopPropagation())})})});sy.displayName=oy;var gl=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:a,disabled:i,value:c,onCheckedChange:l,form:f,...d}=e;return u.jsx(a2,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:i,required:a,onCheckedChange:l,name:r,form:f,value:c,internal_do_not_use_render:({isFormControl:h})=>u.jsxs(u.Fragment,{children:[u.jsx(sy,{...d,ref:t,__scopeCheckbox:n}),h&&u.jsx(ly,{__scopeCheckbox:n})]})})});gl.displayName=Oa;var ay="CheckboxIndicator",iy=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=pl(ay,n);return u.jsx(Ye,{present:r||bn(s.checked)||s.checked===!0,children:u.jsx(ie.span,{"data-state":uy(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});iy.displayName=ay;var cy="CheckboxBubbleInput",ly=w.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:a,required:i,disabled:c,name:l,value:f,form:d,bubbleInput:h,setBubbleInput:m}=pl(cy,e),g=pe(n,m),p=Na(s),y=Sa(r);w.useEffect(()=>{const b=h;if(!b)return;const x=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(x,"checked").set,S=!o.current;if(p!==s&&N){const E=new Event("click",{bubbles:S});b.indeterminate=bn(s),N.call(b,bn(s)?!1:s),b.dispatchEvent(E)}},[h,p,s,o]);const v=w.useRef(bn(s)?!1:s);return u.jsx(ie.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??v.current,required:i,disabled:c,name:l,value:f,form:d,...t,tabIndex:-1,ref:g,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ly.displayName=cy;function i2(e){return typeof e=="function"}function bn(e){return e==="indeterminate"}function uy(e){return bn(e)?"indeterminate":e?"checked":"unchecked"}const dy=w.forwardRef(({className:e,...t},n)=>u.jsx(gl,{ref:n,className:ce("cj-peer cj-h-4 cj-w-4 cj-shrink-0 cj-rounded-sm cj-border cj-border-primary cj-ring-offset-background data-[state=checked]:cj-bg-primary data-[state=checked]:cj-text-primary-foreground focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-cursor-not-allowed disabled:cj-opacity-50",e),...t,children:u.jsx(iy,{className:ce("cj-flex cj-items-center cj-justify-center cj-text-current"),children:u.jsx(ym,{className:"cj-h-4 cj-w-4"})})}));dy.displayName=gl.displayName;function c2({specs:e,open:t,onOpenChange:n,onCreateNode:r}){const[o,s]=C.useState(""),[a,i]=C.useState(""),[c,l]=C.useState("v1_string"),[f,d]=C.useState([]),[h,m]=C.useState([]),[g,p]=C.useState(""),y=Object.entries(al),v=c==="v2_single_option_select-1",b=C.useMemo(()=>e.filter(P=>P.label.toLowerCase().includes(g.toLowerCase())||P.namespace.toLowerCase().includes(g.toLowerCase())),[g]),x=()=>{d([...f,{data:"",label:""}])},j=(P,T,k)=>{d(f.map((M,W)=>W===P?{...M,[T]:k}:M))},N=P=>{d(f.filter((T,k)=>k!==P))},S=P=>{m(T=>T.includes(P)?T.filter(k=>k!==P):[...T,P])},E=()=>{const P=h.map(T=>{const k=e.find(M=>M.id===T);return{target_namespace:(k==null?void 0:k.namespace)||"",spec_id:T}});P.length===0&&P.push({target_namespace:a,spec_id:void 0}),r({label:o,namespace:a||`custom_${Date.now()}`,schema:c,options:v&&f.length>0?f:null,bindings:P}),s(""),i(""),l("v1_string"),d([]),m([]),n(!1)},O=o.trim()!==""&&(a.trim()!==""||h.length>0);return u.jsx(ey,{open:t,onOpenChange:n,children:u.jsxs(ul,{className:"cj-max-w-lg cj-max-h-[85vh] cj-flex cj-flex-col cj-w-[calc(100%-2rem)] [&_input]:cj-ring-offset-0 [&_button]:cj-ring-offset-0 [&_input]:focus-visible:cj-ring-0 [&_input]:focus-visible:cj-border-ring",children:[u.jsxs(dl,{children:[u.jsx(hl,{children:"Create Custom Node"}),u.jsx(ml,{children:"Create a field by choosing a schema type and binding it to existing specs."})]}),u.jsx(Tr,{className:"cj-flex-1 cj-min-h-0 cj-w-full [&>div>div]:!cj-block",children:u.jsxs("div",{className:"cj-space-y-4 cj-py-2 cj-pr-4",children:[u.jsxs("div",{children:[u.jsx(we,{htmlFor:"label",children:"Label *"}),u.jsx(ze,{id:"label",value:o,onChange:P=>s(P.target.value),placeholder:"e.g., Customer Name",className:"cj-mt-1"})]}),u.jsxs("div",{children:[u.jsx(we,{htmlFor:"namespace",children:"Namespace"}),u.jsx(ze,{id:"namespace",value:a,onChange:P=>i(P.target.value),placeholder:"e.g., customer_name",className:"cj-mt-1 cj-font-mono"}),u.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mt-1",children:"Unique identifier for this field"})]}),u.jsxs("div",{children:[u.jsx(we,{children:"Schema Type"}),u.jsxs(tn,{value:c,onValueChange:l,children:[u.jsx(Lt,{className:"cj-mt-1",children:u.jsx(nn,{})}),u.jsx(Wt,{children:y.map(([P,T])=>u.jsx(_e,{value:P,children:u.jsx("div",{className:"cj-flex cj-items-center cj-gap-2",children:u.jsx(ct,{className:`${T.color} cj-text-white cj-text-[10px]`,children:T.label})})},P))})]})]}),v&&u.jsxs("div",{children:[u.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-mb-2",children:[u.jsx(we,{children:"Options"}),u.jsxs(fe,{variant:"outline",size:"sm",onClick:x,children:[u.jsx(wo,{className:"cj-h-3 cj-w-3 cj-mr-1"}),"Add Option"]})]}),u.jsxs("div",{className:"cj-space-y-2",children:[f.map((P,T)=>u.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2 cj-min-w-0",children:[u.jsx(ze,{value:P.data,onChange:k=>j(T,"data",k.target.value),placeholder:"Value",className:"cj-flex-1 cj-min-w-0 cj-font-mono cj-text-sm"}),u.jsx(ze,{value:P.label,onChange:k=>j(T,"label",k.target.value),placeholder:"Label",className:"cj-flex-1 cj-min-w-0"}),u.jsx(fe,{variant:"ghost",size:"icon",onClick:()=>N(T),className:"cj-h-8 cj-w-8",children:u.jsx(Er,{className:"cj-h-3 cj-w-3"})})]},T)),f.length===0&&u.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:"Add options for the dropdown"})]})]}),u.jsxs("div",{children:[u.jsx(we,{children:"Bind to Specs (optional)"}),u.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mb-2",children:"Map this field's answer to existing spec namespaces"}),u.jsx(ze,{placeholder:"Search specs...",value:g,onChange:P=>p(P.target.value),className:"cj-mb-2"}),u.jsx("div",{className:"cj-border cj-rounded-lg cj-max-h-40 cj-overflow-auto",children:b.slice(0,20).map(P=>{const T=Mr(P.schema),k=h.includes(P.id);return u.jsxs("div",{className:`cj-flex cj-items-center cj-gap-2 cj-p-2 hover:cj-bg-accent cj-cursor-pointer ${k?"cj-bg-accent":""}`,onClick:()=>S(P.id),children:[u.jsx(dy,{checked:k}),u.jsx(ct,{className:`${T.color} cj-text-white cj-text-[10px]`,children:T.label}),u.jsx("span",{className:"cj-text-sm cj-truncate cj-flex-1",children:P.label})]},P.id)})}),h.length>0&&u.jsxs("div",{className:"cj-mt-2 cj-text-xs cj-text-muted-foreground",children:[h.length," spec(s) selected"]})]})]})}),u.jsxs(fl,{children:[u.jsx(fe,{variant:"outline",onClick:()=>n(!1),children:"Cancel"}),u.jsx(fe,{onClick:E,disabled:!O,children:"Create Node"})]})]})})}function l2({specs:e,onDragStart:t,onCreateCustomNode:n}){const[r,o]=C.useState(!1),[s,a]=C.useState(""),[i,c]=C.useState("all"),l=C.useMemo(()=>e.filter(d=>{const h=d.label.toLowerCase().includes(s.toLowerCase())||d.namespace.toLowerCase().includes(s.toLowerCase()),m=i==="all"||d.schema===i;return h&&m}),[s,i]),f=C.useMemo(()=>{const d=new Set(e.map(h=>h.schema));return Array.from(d)},[]);return u.jsxs("div",{className:"cj-flex cj-h-full cj-flex-col",children:[u.jsxs("div",{className:"cj-border-b cj-p-4",children:[u.jsx("h2",{className:"cj-mb-3 cj-text-sm cj-font-semibold",children:"Property Specs"}),u.jsxs("div",{className:"cj-relative cj-mb-3",children:[u.jsx(Nm,{className:"cj-absolute cj-left-2.5 cj-top-2.5 cj-h-4 cj-w-4 cj-text-muted-foreground"}),u.jsx(ze,{placeholder:"Search specs...",value:s,onChange:d=>a(d.target.value),className:"cj-pl-8"})]}),u.jsxs(tn,{value:i,onValueChange:c,children:[u.jsx(Lt,{className:"cj-w-full",children:u.jsx(nn,{placeholder:"Filter by schema"})}),u.jsxs(Wt,{children:[u.jsx(_e,{value:"all",children:"All Types"}),f.map(d=>u.jsx(_e,{value:d,children:Mr(d).label},d))]})]})]}),u.jsx(Tr,{className:"cj-flex-1",children:u.jsxs("div",{className:"cj-space-y-2 cj-p-4",children:[l.map(d=>{const h=Mr(d.schema);return u.jsx("div",{draggable:!0,onDragStart:m=>{m.dataTransfer.setData("application/json",JSON.stringify(d)),m.dataTransfer.effectAllowed="copy",t(d)},className:"cj-cursor-grab cj-rounded-lg cj-border cj-bg-card cj-p-3 cj-transition-colors hover:cj-bg-accent active:cj-cursor-grabbing",children:u.jsxs("div",{className:"cj-flex cj-items-start cj-gap-2",children:[u.jsx(jm,{className:"cj-mt-0.5 cj-h-4 cj-w-4 cj-flex-shrink-0 cj-text-muted-foreground"}),u.jsxs("div",{className:"cj-flex-1 cj-min-w-0",children:[u.jsx("div",{className:"cj-flex cj-items-center cj-gap-2 cj-mb-1",children:u.jsx(ct,{variant:"secondary",className:`cj-text-[10px] ${h.color} cj-text-white cj-flex-shrink-0`,children:h.label})}),u.jsx("div",{className:"cj-text-sm cj-font-medium cj-truncate",children:d.label}),u.jsx("div",{className:"cj-text-xs cj-text-muted-foreground cj-font-mono cj-truncate",children:d.namespace})]})]})},d.id)}),l.length===0&&u.jsx("div",{className:"cj-py-8 cj-text-center cj-text-sm cj-text-muted-foreground",children:"No specs found"})]})}),u.jsxs("div",{className:"cj-border-t cj-p-3",children:[u.jsxs(fe,{variant:"outline",className:"cj-w-full",onClick:()=>o(!0),children:[u.jsx(wo,{className:"cj-h-4 cj-w-4 cj-mr-2"}),"Create Custom Field"]}),u.jsxs("div",{className:"cj-text-xs cj-text-muted-foreground cj-mt-2 cj-text-center",children:[l.length," of ",e.length," specs"]})]}),u.jsx(c2,{specs:e,open:r,onOpenChange:o,onCreateNode:n})]})}var u2=e=>{switch(e){case"success":return h2;case"info":return p2;case"warning":return m2;case"error":return g2;default:return null}},d2=Array(12).fill(0),f2=({visible:e,className:t})=>C.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},C.createElement("div",{className:"sonner-spinner"},d2.map((n,r)=>C.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),h2=C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},C.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),m2=C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},C.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),p2=C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},C.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),g2=C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},C.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),y2=C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},C.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),C.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),x2=()=>{let[e,t]=C.useState(document.hidden);return C.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},cc=1,v2=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:cc++,s=this.toasts.find(i=>i.id===o),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),s?this.toasts=this.toasts.map(i=>i.id===o?(this.publish({...i,...e,id:o,title:n}),{...i,...e,id:o,dismissible:a,title:n}):i):this.addToast({title:n,...r,dismissible:a,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0,s,a=r.then(async c=>{if(s=["resolve",c],C.isValidElement(c))o=!1,this.create({id:n,type:"default",message:c});else if(w2(c)&&!c.ok){o=!1;let l=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,f=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:l,description:f})}else if(t.success!==void 0){o=!1;let l=typeof t.success=="function"?await t.success(c):t.success,f=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:l,description:f})}}).catch(async c=>{if(s=["reject",c],t.error!==void 0){o=!1;let l=typeof t.error=="function"?await t.error(c):t.error,f=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:l,description:f})}}).finally(()=>{var c;o&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),i=()=>new Promise((c,l)=>a.then(()=>s[0]==="reject"?l(s[1]):c(s[1])).catch(l));return typeof n!="string"&&typeof n!="number"?{unwrap:i}:Object.assign(n,{unwrap:i})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||cc++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ke=new v2,b2=(e,t)=>{let n=(t==null?void 0:t.id)||cc++;return Ke.addToast({title:e,...t,id:n}),n},w2=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",j2=b2,S2=()=>Ke.toasts,C2=()=>Ke.getActiveToasts(),It=Object.assign(j2,{success:Ke.success,info:Ke.info,warning:Ke.warning,error:Ke.error,custom:Ke.custom,message:Ke.message,promise:Ke.promise,dismiss:Ke.dismiss,loading:Ke.loading},{getHistory:S2,getToasts:C2});function N2(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}N2(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
295
|
-
`);function ms(e){return e.label!==void 0}var E2=3,_2="32px",k2="16px",qd=4e3,M2=356,P2=14,D2=20,O2=200;function ft(...e){return e.filter(Boolean).join(" ")}function R2(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var A2=e=>{var t,n,r,o,s,a,i,c,l,f,d;let{invert:h,toast:m,unstyled:g,interacting:p,setHeights:y,visibleToasts:v,heights:b,index:x,toasts:j,expanded:N,removeToast:S,defaultRichColors:E,closeButton:O,style:P,cancelButtonStyle:T,actionButtonStyle:k,className:M="",descriptionClassName:W="",duration:_,position:I,gap:R,loadingIcon:z,expandByDefault:A,classNames:D,icons:B,closeButtonAriaLabel:q="Close toast",pauseWhenPageIsHidden:V}=e,[H,L]=C.useState(null),[Y,G]=C.useState(null),[$,F]=C.useState(!1),[U,X]=C.useState(!1),[Z,K]=C.useState(!1),[J,ee]=C.useState(!1),[se,ae]=C.useState(!1),[ue,ve]=C.useState(0),[ke,Fe]=C.useState(0),Ie=C.useRef(m.duration||_||qd),Qe=C.useRef(null),Le=C.useRef(null),Xt=x===0,Mt=x+1<=v,Re=m.type,Ue=m.dismissible!==!1,Xn=m.className||"",Fr=m.descriptionClassName||"",Pt=C.useMemo(()=>b.findIndex(Q=>Q.toastId===m.id)||0,[b,m.id]),Br=C.useMemo(()=>{var Q;return(Q=m.closeButton)!=null?Q:O},[m.closeButton,O]),Kn=C.useMemo(()=>m.duration||_||qd,[m.duration,_]),En=C.useRef(0),Dt=C.useRef(0),Jn=C.useRef(0),Ot=C.useRef(null),[Zn,Hr]=I.split("-"),_n=C.useMemo(()=>b.reduce((Q,be,Ce)=>Ce>=Pt?Q:Q+be.height,0),[b,Pt]),le=x2(),xe=m.invert||h,oe=Re==="loading";Dt.current=C.useMemo(()=>Pt*R+_n,[Pt,_n]),C.useEffect(()=>{Ie.current=Kn},[Kn]),C.useEffect(()=>{F(!0)},[]),C.useEffect(()=>{let Q=Le.current;if(Q){let be=Q.getBoundingClientRect().height;return Fe(be),y(Ce=>[{toastId:m.id,height:be,position:m.position},...Ce]),()=>y(Ce=>Ce.filter(qe=>qe.toastId!==m.id))}},[y,m.id]),C.useLayoutEffect(()=>{if(!$)return;let Q=Le.current,be=Q.style.height;Q.style.height="auto";let Ce=Q.getBoundingClientRect().height;Q.style.height=be,Fe(Ce),y(qe=>qe.find(He=>He.toastId===m.id)?qe.map(He=>He.toastId===m.id?{...He,height:Ce}:He):[{toastId:m.id,height:Ce,position:m.position},...qe])},[$,m.title,m.description,y,m.id]);let de=C.useCallback(()=>{X(!0),ve(Dt.current),y(Q=>Q.filter(be=>be.toastId!==m.id)),setTimeout(()=>{S(m)},O2)},[m,S,y,Dt]);C.useEffect(()=>{if(m.promise&&Re==="loading"||m.duration===1/0||m.type==="loading")return;let Q;return N||p||V&&le?(()=>{if(Jn.current<En.current){let be=new Date().getTime()-En.current;Ie.current=Ie.current-be}Jn.current=new Date().getTime()})():Ie.current!==1/0&&(En.current=new Date().getTime(),Q=setTimeout(()=>{var be;(be=m.onAutoClose)==null||be.call(m,m),de()},Ie.current)),()=>clearTimeout(Q)},[N,p,m,Re,V,le,de]),C.useEffect(()=>{m.delete&&de()},[de,m.delete]);function Be(){var Q,be,Ce;return B!=null&&B.loading?C.createElement("div",{className:ft(D==null?void 0:D.loader,(Q=m==null?void 0:m.classNames)==null?void 0:Q.loader,"sonner-loader"),"data-visible":Re==="loading"},B.loading):z?C.createElement("div",{className:ft(D==null?void 0:D.loader,(be=m==null?void 0:m.classNames)==null?void 0:be.loader,"sonner-loader"),"data-visible":Re==="loading"},z):C.createElement(f2,{className:ft(D==null?void 0:D.loader,(Ce=m==null?void 0:m.classNames)==null?void 0:Ce.loader),visible:Re==="loading"})}return C.createElement("li",{tabIndex:0,ref:Le,className:ft(M,Xn,D==null?void 0:D.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,D==null?void 0:D.default,D==null?void 0:D[Re],(n=m==null?void 0:m.classNames)==null?void 0:n[Re]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:E,"data-styled":!(m.jsx||m.unstyled||g),"data-mounted":$,"data-promise":!!m.promise,"data-swiped":se,"data-removed":U,"data-visible":Mt,"data-y-position":Zn,"data-x-position":Hr,"data-index":x,"data-front":Xt,"data-swiping":Z,"data-dismissible":Ue,"data-type":Re,"data-invert":xe,"data-swipe-out":J,"data-swipe-direction":Y,"data-expanded":!!(N||A&&$),style:{"--index":x,"--toasts-before":x,"--z-index":j.length-x,"--offset":`${U?ue:Dt.current}px`,"--initial-height":A?"auto":`${ke}px`,...P,...m.style},onDragEnd:()=>{K(!1),L(null),Ot.current=null},onPointerDown:Q=>{oe||!Ue||(Qe.current=new Date,ve(Dt.current),Q.target.setPointerCapture(Q.pointerId),Q.target.tagName!=="BUTTON"&&(K(!0),Ot.current={x:Q.clientX,y:Q.clientY}))},onPointerUp:()=>{var Q,be,Ce,qe;if(J||!Ue)return;Ot.current=null;let He=Number(((Q=Le.current)==null?void 0:Q.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Xe=Number(((be=Le.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Kt=new Date().getTime()-((Ce=Qe.current)==null?void 0:Ce.getTime()),et=H==="x"?He:Xe,Rt=Math.abs(et)/Kt;if(Math.abs(et)>=D2||Rt>.11){ve(Dt.current),(qe=m.onDismiss)==null||qe.call(m,m),G(H==="x"?He>0?"right":"left":Xe>0?"down":"up"),de(),ee(!0),ae(!1);return}K(!1),L(null)},onPointerMove:Q=>{var be,Ce,qe,He;if(!Ot.current||!Ue||((be=window.getSelection())==null?void 0:be.toString().length)>0)return;let Xe=Q.clientY-Ot.current.y,Kt=Q.clientX-Ot.current.x,et=(Ce=e.swipeDirections)!=null?Ce:R2(I);!H&&(Math.abs(Kt)>1||Math.abs(Xe)>1)&&L(Math.abs(Kt)>Math.abs(Xe)?"x":"y");let Rt={x:0,y:0};H==="y"?(et.includes("top")||et.includes("bottom"))&&(et.includes("top")&&Xe<0||et.includes("bottom")&&Xe>0)&&(Rt.y=Xe):H==="x"&&(et.includes("left")||et.includes("right"))&&(et.includes("left")&&Kt<0||et.includes("right")&&Kt>0)&&(Rt.x=Kt),(Math.abs(Rt.x)>0||Math.abs(Rt.y)>0)&&ae(!0),(qe=Le.current)==null||qe.style.setProperty("--swipe-amount-x",`${Rt.x}px`),(He=Le.current)==null||He.style.setProperty("--swipe-amount-y",`${Rt.y}px`)}},Br&&!m.jsx?C.createElement("button",{"aria-label":q,"data-disabled":oe,"data-close-button":!0,onClick:oe||!Ue?()=>{}:()=>{var Q;de(),(Q=m.onDismiss)==null||Q.call(m,m)},className:ft(D==null?void 0:D.closeButton,(o=m==null?void 0:m.classNames)==null?void 0:o.closeButton)},(s=B==null?void 0:B.close)!=null?s:y2):null,m.jsx||C.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:C.createElement(C.Fragment,null,Re||m.icon||m.promise?C.createElement("div",{"data-icon":"",className:ft(D==null?void 0:D.icon,(a=m==null?void 0:m.classNames)==null?void 0:a.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||Be():null,m.type!=="loading"?m.icon||(B==null?void 0:B[Re])||u2(Re):null):null,C.createElement("div",{"data-content":"",className:ft(D==null?void 0:D.content,(i=m==null?void 0:m.classNames)==null?void 0:i.content)},C.createElement("div",{"data-title":"",className:ft(D==null?void 0:D.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?C.createElement("div",{"data-description":"",className:ft(W,Fr,D==null?void 0:D.description,(l=m==null?void 0:m.classNames)==null?void 0:l.description)},typeof m.description=="function"?m.description():m.description):null),C.isValidElement(m.cancel)?m.cancel:m.cancel&&ms(m.cancel)?C.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||T,onClick:Q=>{var be,Ce;ms(m.cancel)&&Ue&&((Ce=(be=m.cancel).onClick)==null||Ce.call(be,Q),de())},className:ft(D==null?void 0:D.cancelButton,(f=m==null?void 0:m.classNames)==null?void 0:f.cancelButton)},m.cancel.label):null,C.isValidElement(m.action)?m.action:m.action&&ms(m.action)?C.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||k,onClick:Q=>{var be,Ce;ms(m.action)&&((Ce=(be=m.action).onClick)==null||Ce.call(be,Q),!Q.defaultPrevented&&de())},className:ft(D==null?void 0:D.actionButton,(d=m==null?void 0:m.classNames)==null?void 0:d.actionButton)},m.action.label):null))};function Gd(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function T2(e,t){let n={};return[e,t].forEach((r,o)=>{let s=o===1,a=s?"--mobile-offset":"--offset",i=s?k2:_2;function c(l){["top","right","bottom","left"].forEach(f=>{n[`${a}-${f}`]=typeof l=="number"?`${l}px`:l})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(l=>{r[l]===void 0?n[`${a}-${l}`]=i:n[`${a}-${l}`]=typeof r[l]=="number"?`${r[l]}px`:r[l]}):c(i)}),n}C.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:s,closeButton:a,className:i,offset:c,mobileOffset:l,theme:f="light",richColors:d,duration:h,style:m,visibleToasts:g=E2,toastOptions:p,dir:y=Gd(),gap:v=P2,loadingIcon:b,icons:x,containerAriaLabel:j="Notifications",pauseWhenPageIsHidden:N}=e,[S,E]=C.useState([]),O=C.useMemo(()=>Array.from(new Set([r].concat(S.filter(V=>V.position).map(V=>V.position)))),[S,r]),[P,T]=C.useState([]),[k,M]=C.useState(!1),[W,_]=C.useState(!1),[I,R]=C.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=C.useRef(null),A=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=C.useRef(null),B=C.useRef(!1),q=C.useCallback(V=>{E(H=>{var L;return(L=H.find(Y=>Y.id===V.id))!=null&&L.delete||Ke.dismiss(V.id),H.filter(({id:Y})=>Y!==V.id)})},[]);return C.useEffect(()=>Ke.subscribe(V=>{if(V.dismiss){E(H=>H.map(L=>L.id===V.id?{...L,delete:!0}:L));return}setTimeout(()=>{Js.flushSync(()=>{E(H=>{let L=H.findIndex(Y=>Y.id===V.id);return L!==-1?[...H.slice(0,L),{...H[L],...V},...H.slice(L+1)]:[V,...H]})})})}),[]),C.useEffect(()=>{if(f!=="system"){R(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?R("dark"):R("light")),typeof window>"u")return;let V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:H})=>{R(H?"dark":"light")})}catch{V.addListener(({matches:L})=>{try{R(L?"dark":"light")}catch(Y){console.error(Y)}})}},[f]),C.useEffect(()=>{S.length<=1&&M(!1)},[S]),C.useEffect(()=>{let V=H=>{var L,Y;o.every(G=>H[G]||H.code===G)&&(M(!0),(L=z.current)==null||L.focus()),H.code==="Escape"&&(document.activeElement===z.current||(Y=z.current)!=null&&Y.contains(document.activeElement))&&M(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[o]),C.useEffect(()=>{if(z.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,B.current=!1)}},[z.current]),C.createElement("section",{ref:t,"aria-label":`${j} ${A}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((V,H)=>{var L;let[Y,G]=V.split("-");return S.length?C.createElement("ol",{key:V,dir:y==="auto"?Gd():y,tabIndex:-1,ref:z,className:i,"data-sonner-toaster":!0,"data-theme":I,"data-y-position":Y,"data-lifted":k&&S.length>1&&!s,"data-x-position":G,style:{"--front-toast-height":`${((L=P[0])==null?void 0:L.height)||0}px`,"--width":`${M2}px`,"--gap":`${v}px`,...m,...T2(c,l)},onBlur:$=>{B.current&&!$.currentTarget.contains($.relatedTarget)&&(B.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:$=>{$.target instanceof HTMLElement&&$.target.dataset.dismissible==="false"||B.current||(B.current=!0,D.current=$.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{W||M(!1)},onDragEnd:()=>M(!1),onPointerDown:$=>{$.target instanceof HTMLElement&&$.target.dataset.dismissible==="false"||_(!0)},onPointerUp:()=>_(!1)},S.filter($=>!$.position&&H===0||$.position===V).map(($,F)=>{var U,X;return C.createElement(A2,{key:$.id,icons:x,index:F,toast:$,defaultRichColors:d,duration:(U=p==null?void 0:p.duration)!=null?U:h,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:n,visibleToasts:g,closeButton:(X=p==null?void 0:p.closeButton)!=null?X:a,interacting:W,position:V,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:q,toasts:S.filter(Z=>Z.position==$.position),heights:P.filter(Z=>Z.position==$.position),setHeights:T,expandByDefault:s,gap:v,loadingIcon:b,expanded:k,pauseWhenPageIsHidden:N,swipeDirections:e.swipeDirections})})):null}))});function I2(){const e=C.useCallback(t=>{const n=t.target,r=n.tagName.toLowerCase();if(r==="input"||r==="textarea"||r==="select"||n.isContentEditable)return;const o=t.metaKey||t.ctrlKey,s=$e.getState();if(t.key==="Delete"||t.key==="Backspace"){(s.selectedNodeId||s.selectedEdgeId)&&(t.preventDefault(),s.deleteSelected(),It.success("Deleted"));return}if(o&&t.key==="z"&&!t.shiftKey){t.preventDefault(),s.canUndo()&&(s.undo(),It("Undo",{duration:1500}));return}if(o&&(t.key==="y"||t.key==="z"&&t.shiftKey||t.key==="Z"&&t.shiftKey)){t.preventDefault(),s.canRedo()&&(s.redo(),It("Redo",{duration:1500}));return}if(o&&t.key==="c"){s.selectedNodeId&&(t.preventDefault(),s.copySelectedNodes(),It.success("Copied to clipboard",{duration:1500}));return}if(o&&t.key==="v"){s._clipboard&&(t.preventDefault(),s.pasteNodes(),It.success("Pasted",{duration:1500}));return}if(o&&t.key==="d"){s.selectedNodeId&&(t.preventDefault(),s.duplicateSelectedNode(),It.success("Duplicated",{duration:1500}));return}},[]);C.useEffect(()=>(window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)),[e])}function $2({data:e,selected:t}){const n=Mr(e.schema),r=e.isCurrentPreviewNode,o=e.isInPreviewPath,s=e.actor==="customer"?"cj-bg-blue-50 dark:cj-bg-blue-950":"cj-bg-muted",a=r?"cj-border-primary cj-ring-2 cj-ring-primary/30 cj-shadow-lg cj-shadow-primary/20":o?"cj-border-primary/50":t?"cj-border-primary cj-ring-2 cj-ring-primary/20":"cj-border-border";return u.jsxs("div",{className:`
|
|
296
|
-
cj-min-w-[220px] cj-rounded-lg cj-border-2 cj-p-3 cj-shadow-sm cj-transition-all
|
|
297
|
-
cj-bg-background ${s} ${a}
|
|
298
|
-
`,children:[u.jsx(Nr,{type:"target",position:re.Top,className:"!cj-bg-primary !cj-w-3 !cj-h-3 !cj-border-2 !cj-border-background hover:!cj-w-4 hover:!cj-h-4 hover:!cj-bg-primary/80 cj-transition-all cj-duration-150"}),u.jsxs("div",{className:"cj-space-y-2",children:[u.jsxs("div",{className:"cj-flex cj-items-center cj-gap-1 cj-flex-wrap",children:[u.jsx(ct,{variant:"secondary",className:`cj-text-[10px] ${n.color} cj-text-white`,children:n.label}),e.widget&&u.jsxs(ct,{variant:"outline",className:"cj-text-[10px]",children:["→ ",e.widget]})]}),u.jsx("div",{className:"cj-font-medium cj-text-sm cj-leading-tight",children:e.labelOverride||e.label}),u.jsx("div",{className:"cj-text-xs cj-text-muted-foreground cj-font-mono",children:e.namespace}),u.jsx("div",{className:"cj-flex cj-items-center cj-gap-1 cj-text-xs cj-text-muted-foreground",children:e.actor==="customer"?u.jsxs(u.Fragment,{children:[u.jsx(Tc,{className:"cj-h-3 cj-w-3"}),u.jsx("span",{children:"Customer"})]}):u.jsxs(u.Fragment,{children:[u.jsx(gm,{className:"cj-h-3 cj-w-3"}),u.jsx("span",{children:"Operator"})]})})]}),u.jsx(Nr,{type:"source",position:re.Bottom,className:"!cj-bg-primary !cj-w-3 !cj-h-3 !cj-border-2 !cj-border-background hover:!cj-w-4 hover:!cj-h-4 hover:!cj-bg-primary/80 cj-transition-all cj-duration-150"})]})}const z2=C.memo($2),L2={"==":"=","!=":"≠",">":">","<":"<",">=":"≥","<=":"≤",in:"∈"};function fy(e){var l;const t=Object.keys(e)[0];if(t==="and"||t==="or"){const f=e[t];if(!Array.isArray(f))return t.toUpperCase();const d=f.map(fy).filter(Boolean),h=t==="and"?" & ":" | ",m=d.join(h);return m.length>48?m.slice(0,45)+"…":m}const n=e[t];if(!Array.isArray(n)||n.length<2)return t;const r=n[0],o=((l=r==null?void 0:r.var)==null?void 0:l.replace("answers.",""))??"?",s=o.length>18?o.slice(0,15)+"…":o;if(n[1]===null)return t==="=="?`${s} is null`:`${s} is not null`;const a=L2[t]||t,i=String(n[1]),c=i.length>14?i.slice(0,11)+"…":i;return`${s} ${a} ${c}`}function W2({id:e,sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:s,targetPosition:a,data:i,selected:c}){const[l,f,d]=kc({sourceX:t,sourceY:n,sourcePosition:s,targetX:r,targetY:o,targetPosition:a}),h=(i==null?void 0:i.isDefault)??!1,m=(i==null?void 0:i.condition)&&Object.keys(i.condition).length>0,g=(i==null?void 0:i.isInPreviewPath)??!1,p=h?"default":m?fy(i.condition):null,v=g||c?"hsl(262, 83%, 58%)":h?"hsl(220, 14%, 50%)":m?"hsl(142, 71%, 45%)":"hsl(220, 14%, 40%)",b=g||c?5:3,x=`arrow-${e}`,j=m&&!h?"8 4":void 0;return u.jsxs(u.Fragment,{children:[u.jsx("defs",{children:u.jsx("marker",{id:x,markerWidth:"20",markerHeight:"20",refX:"16",refY:"10",orient:"auto",markerUnits:"userSpaceOnUse",children:u.jsx("path",{d:"M4,4 L16,10 L4,16 L7,10 Z",fill:v,stroke:v,strokeWidth:"1",strokeLinejoin:"round",style:{transition:"fill 0.2s, stroke 0.2s"}})})}),u.jsx("path",{d:l,fill:"none",stroke:c?"hsl(262, 83%, 58%)":"hsl(220, 14%, 20%)",strokeWidth:b+4,strokeLinecap:"round",style:{opacity:.3,filter:c?"blur(3px)":"blur(2px)"}}),u.jsx(zo,{id:e,path:l,markerEnd:`url(#${x})`,style:{stroke:v,strokeWidth:b,strokeLinecap:"round",strokeDasharray:j,transition:"stroke 0.2s, stroke-width 0.2s"}}),u.jsx("path",{d:l,fill:"none",stroke:"transparent",strokeWidth:24,style:{cursor:"pointer"}}),p&&u.jsx(AC,{children:u.jsx("div",{className:`
|
|
299
|
-
cj-absolute cj-pointer-events-auto cj-px-2 cj-py-0.5 cj-rounded cj-text-[10px] cj-font-mono cj-font-medium
|
|
300
|
-
cj-border cj-shadow-sm cj-cursor-pointer cj-transition-all cj-max-w-[200px] cj-truncate
|
|
301
|
-
${c?"cj-bg-primary cj-text-primary-foreground cj-border-primary":h?"cj-bg-muted cj-text-muted-foreground cj-border-border":"cj-bg-card cj-text-foreground cj-border-border"}
|
|
302
|
-
`,style:{transform:`translate(-50%, -50%) translate(${f}px, ${d}px)`},children:p})})]})}const F2=C.memo(W2);var B2=Symbol("radix.slottable");function H2(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=B2,t}var[Ra]=Ze("Tooltip",[zr]),Aa=zr(),hy="TooltipProvider",V2=700,lc="tooltip.open",[Y2,yl]=Ra(hy),my=e=>{const{__scopeTooltip:t,delayDuration:n=V2,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,a=w.useRef(!0),i=w.useRef(!1),c=w.useRef(0);return w.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),u.jsx(Y2,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:i,onPointerInTransitChange:w.useCallback(l=>{i.current=l},[]),disableHoverableContent:o,children:s})};my.displayName=hy;var No="Tooltip",[q2,Vo]=Ra(No),py=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:a,delayDuration:i}=e,c=yl(No,e.__scopeTooltip),l=Aa(t),[f,d]=w.useState(null),h=jt(),m=w.useRef(0),g=a??c.disableHoverableContent,p=i??c.delayDuration,y=w.useRef(!1),[v,b]=Nt({prop:r,defaultProp:o??!1,onChange:E=>{E?(c.onOpen(),document.dispatchEvent(new CustomEvent(lc))):c.onClose(),s==null||s(E)},caller:No}),x=w.useMemo(()=>v?y.current?"delayed-open":"instant-open":"closed",[v]),j=w.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,b(!0)},[b]),N=w.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b(!1)},[b]),S=w.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,b(!0),m.current=0},p)},[p,b]);return w.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),u.jsx(el,{...l,children:u.jsx(q2,{scope:t,contentId:h,open:v,stateAttribute:x,trigger:f,onTriggerChange:d,onTriggerEnter:w.useCallback(()=>{c.isOpenDelayedRef.current?S():j()},[c.isOpenDelayedRef,S,j]),onTriggerLeave:w.useCallback(()=>{g?N():(window.clearTimeout(m.current),m.current=0)},[N,g]),onOpen:j,onClose:N,disableHoverableContent:g,children:n})})};py.displayName=No;var uc="TooltipTrigger",gy=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Vo(uc,n),s=yl(uc,n),a=Aa(n),i=w.useRef(null),c=pe(t,i,o.onTriggerChange),l=w.useRef(!1),f=w.useRef(!1),d=w.useCallback(()=>l.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),u.jsx(Ca,{asChild:!0,...a,children:u.jsx(ie.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:te(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:te(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:te(e.onPointerDown,()=>{o.open&&o.onClose(),l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:te(e.onFocus,()=>{l.current||o.onOpen()}),onBlur:te(e.onBlur,o.onClose),onClick:te(e.onClick,o.onClose)})})});gy.displayName=uc;var xl="TooltipPortal",[G2,U2]=Ra(xl,{forceMount:void 0}),yy=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=Vo(xl,t);return u.jsx(G2,{scope:t,forceMount:n,children:u.jsx(Ye,{present:n||s.open,children:u.jsx(Bo,{asChild:!0,container:o,children:r})})})};yy.displayName=xl;var Pr="TooltipContent",xy=w.forwardRef((e,t)=>{const n=U2(Pr,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,a=Vo(Pr,e.__scopeTooltip);return u.jsx(Ye,{present:r||a.open,children:a.disableHoverableContent?u.jsx(vy,{side:o,...s,ref:t}):u.jsx(X2,{side:o,...s,ref:t})})}),X2=w.forwardRef((e,t)=>{const n=Vo(Pr,e.__scopeTooltip),r=yl(Pr,e.__scopeTooltip),o=w.useRef(null),s=pe(t,o),[a,i]=w.useState(null),{trigger:c,onClose:l}=n,f=o.current,{onPointerInTransitChange:d}=r,h=w.useCallback(()=>{i(null),d(!1)},[d]),m=w.useCallback((g,p)=>{const y=g.currentTarget,v={x:g.clientX,y:g.clientY},b=eD(v,y.getBoundingClientRect()),x=tD(v,b),j=nD(p.getBoundingClientRect()),N=oD([...x,...j]);i(N),d(!0)},[d]);return w.useEffect(()=>()=>h(),[h]),w.useEffect(()=>{if(c&&f){const g=y=>m(y,f),p=y=>m(y,c);return c.addEventListener("pointerleave",g),f.addEventListener("pointerleave",p),()=>{c.removeEventListener("pointerleave",g),f.removeEventListener("pointerleave",p)}}},[c,f,m,h]),w.useEffect(()=>{if(a){const g=p=>{const y=p.target,v={x:p.clientX,y:p.clientY},b=(c==null?void 0:c.contains(y))||(f==null?void 0:f.contains(y)),x=!rD(v,a);b?h():x&&(h(),l())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[c,f,a,l,h]),u.jsx(vy,{...e,ref:s})}),[K2,J2]=Ra(No,{isInside:!1}),Z2=H2("TooltipContent"),vy=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:a,...i}=e,c=Vo(Pr,n),l=Aa(n),{onClose:f}=c;return w.useEffect(()=>(document.addEventListener(lc,f),()=>document.removeEventListener(lc,f)),[f]),w.useEffect(()=>{if(c.trigger){const d=h=>{const m=h.target;m!=null&&m.contains(c.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,f]),u.jsx(Wo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:u.jsxs(tl,{"data-state":c.stateAttribute,...l,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(Z2,{children:r}),u.jsx(K2,{scope:n,isInside:!0,children:u.jsx(yM,{id:c.contentId,role:"tooltip",children:o||r})})]})})});xy.displayName=Pr;var by="TooltipArrow",Q2=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Aa(n);return J2(by,n).isInside?null:u.jsx(nl,{...o,...r,ref:t})});Q2.displayName=by;function eD(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function tD(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function nD(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function rD(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const i=t[s],c=t[a],l=i.x,f=i.y,d=c.x,h=c.y;f>r!=h>r&&n<(d-l)*(r-f)/(h-f)+l&&(o=!o)}return o}function oD(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),sD(t)}function sD(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var aD=my,iD=py,cD=gy,lD=yy,wy=xy;const uD=aD,Ud=iD,Xd=cD,dc=w.forwardRef(({className:e,sideOffset:t=4,...n},r)=>{const o=Ho();return u.jsx(lD,{container:o??void 0,children:u.jsx(wy,{ref:r,sideOffset:t,className:ce("cj-z-50 cj-overflow-hidden cj-rounded-md cj-border cj-bg-popover cj-px-3 cj-py-1.5 cj-text-sm cj-text-popover-foreground cj-shadow-md cj-animate-in cj-fade-in-0 cj-zoom-in-95 data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=closed]:cj-zoom-out-95 data-[side=bottom]:cj-slide-in-from-top-2 data-[side=left]:cj-slide-in-from-right-2 data-[side=right]:cj-slide-in-from-left-2 data-[side=top]:cj-slide-in-from-bottom-2",e),...n})})});dc.displayName=wy.displayName;const Ta=w.forwardRef(({className:e,...t},n)=>u.jsx("textarea",{className:ce("cj-flex cj-min-h-[80px] cj-w-full cj-rounded-md cj-border cj-border-input cj-bg-background cj-px-3 cj-py-2 cj-text-sm cj-ring-offset-background placeholder:cj-text-muted-foreground focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-cursor-not-allowed disabled:cj-opacity-50",e),ref:n,...t}));Ta.displayName="Textarea";var ji="rovingFocusGroup.onEntryFocus",dD={bubbles:!1,cancelable:!0},Yo="RovingFocusGroup",[fc,jy,fD]=gp(Yo),[hD,Ia]=Ze(Yo,[fD]),[mD,pD]=hD(Yo),Sy=w.forwardRef((e,t)=>u.jsx(fc.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(fc.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(gD,{...e,ref:t})})}));Sy.displayName=Yo;var gD=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:f=!1,...d}=e,h=w.useRef(null),m=pe(t,h),g=Lo(s),[p,y]=Nt({prop:a,defaultProp:i??null,onChange:c,caller:Yo}),[v,b]=w.useState(!1),x=Ge(l),j=jy(n),N=w.useRef(!1),[S,E]=w.useState(0);return w.useEffect(()=>{const O=h.current;if(O)return O.addEventListener(ji,x),()=>O.removeEventListener(ji,x)},[x]),u.jsx(mD,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:p,onItemFocus:w.useCallback(O=>y(O),[y]),onItemShiftTab:w.useCallback(()=>b(!0),[]),onFocusableItemAdd:w.useCallback(()=>E(O=>O+1),[]),onFocusableItemRemove:w.useCallback(()=>E(O=>O-1),[]),children:u.jsx(ie.div,{tabIndex:v||S===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:te(e.onMouseDown,()=>{N.current=!0}),onFocus:te(e.onFocus,O=>{const P=!N.current;if(O.target===O.currentTarget&&P&&!v){const T=new CustomEvent(ji,dD);if(O.currentTarget.dispatchEvent(T),!T.defaultPrevented){const k=j().filter(R=>R.focusable),M=k.find(R=>R.active),W=k.find(R=>R.id===p),I=[M,W,...k].filter(Boolean).map(R=>R.ref.current);Ey(I,f)}}N.current=!1}),onBlur:te(e.onBlur,()=>b(!1))})})}),Cy="RovingFocusGroupItem",Ny=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:a,...i}=e,c=jt(),l=s||c,f=pD(Cy,n),d=f.currentTabStopId===l,h=jy(n),{onFocusableItemAdd:m,onFocusableItemRemove:g,currentTabStopId:p}=f;return w.useEffect(()=>{if(r)return m(),()=>g()},[r,m,g]),u.jsx(fc.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:u.jsx(ie.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...i,ref:t,onMouseDown:te(e.onMouseDown,y=>{r?f.onItemFocus(l):y.preventDefault()}),onFocus:te(e.onFocus,()=>f.onItemFocus(l)),onKeyDown:te(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=vD(y,f.orientation,f.dir);if(v!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let x=h().filter(j=>j.focusable).map(j=>j.ref.current);if(v==="last")x.reverse();else if(v==="prev"||v==="next"){v==="prev"&&x.reverse();const j=x.indexOf(y.currentTarget);x=f.loop?bD(x,j+1):x.slice(j+1)}setTimeout(()=>Ey(x))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:p!=null}):a})})});Ny.displayName=Cy;var yD={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function xD(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function vD(e,t,n){const r=xD(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return yD[r]}function Ey(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function bD(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var _y=Sy,ky=Ny,$a="Tabs",[wD]=Ze($a,[Ia]),My=Ia(),[jD,vl]=wD($a),Py=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:a="horizontal",dir:i,activationMode:c="automatic",...l}=e,f=Lo(i),[d,h]=Nt({prop:r,onChange:o,defaultProp:s??"",caller:$a});return u.jsx(jD,{scope:n,baseId:jt(),value:d,onValueChange:h,orientation:a,dir:f,activationMode:c,children:u.jsx(ie.div,{dir:f,"data-orientation":a,...l,ref:t})})});Py.displayName=$a;var Dy="TabsList",Oy=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=vl(Dy,n),a=My(n);return u.jsx(_y,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:r,children:u.jsx(ie.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});Oy.displayName=Dy;var Ry="TabsTrigger",Ay=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,a=vl(Ry,n),i=My(n),c=$y(a.baseId,r),l=zy(a.baseId,r),f=r===a.value;return u.jsx(ky,{asChild:!0,...i,focusable:!o,active:f,children:u.jsx(ie.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":l,"data-state":f?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...s,ref:t,onMouseDown:te(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?a.onValueChange(r):d.preventDefault()}),onKeyDown:te(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&a.onValueChange(r)}),onFocus:te(e.onFocus,()=>{const d=a.activationMode!=="manual";!f&&!o&&d&&a.onValueChange(r)})})})});Ay.displayName=Ry;var Ty="TabsContent",Iy=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...a}=e,i=vl(Ty,n),c=$y(i.baseId,r),l=zy(i.baseId,r),f=r===i.value,d=w.useRef(f);return w.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),u.jsx(Ye,{present:o||f,children:({present:h})=>u.jsx(ie.div,{"data-state":f?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:l,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:h&&s})})});Iy.displayName=Ty;function $y(e,t){return`${e}-trigger-${t}`}function zy(e,t){return`${e}-content-${t}`}var SD=Py,Ly=Oy,Wy=Ay,Fy=Iy;const By=SD,bl=w.forwardRef(({className:e,...t},n)=>u.jsx(Ly,{ref:n,className:ce("cj-inline-flex cj-h-10 cj-items-center cj-justify-center cj-rounded-md cj-bg-muted cj-p-1 cj-text-muted-foreground",e),...t}));bl.displayName=Ly.displayName;const Eo=w.forwardRef(({className:e,...t},n)=>u.jsx(Wy,{ref:n,className:ce("cj-inline-flex cj-items-center cj-justify-center cj-whitespace-nowrap cj-rounded-sm cj-px-3 cj-py-1.5 cj-text-sm cj-font-medium cj-ring-offset-background cj-transition-all data-[state=active]:cj-bg-background data-[state=active]:cj-text-foreground data-[state=active]:cj-shadow-sm focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-pointer-events-none disabled:cj-opacity-50",e),...t}));Eo.displayName=Wy.displayName;const _o=w.forwardRef(({className:e,...t},n)=>u.jsx(Fy,{ref:n,className:ce("cj-mt-2 cj-ring-offset-background focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2",e),...t}));_o.displayName=Fy.displayName;function CD(e){const t=[];if(!e||typeof e!="object")return{valid:!1,errors:["Input is not a valid JSON object."]};const n=e;return(!n.journey_id||typeof n.journey_id!="string")&&t.push('Missing or invalid "journey_id" (string).'),Array.isArray(n.nodes)?n.nodes.forEach((r,o)=>{r.node_id||t.push(`Node ${o}: missing "node_id".`),r.question_key||t.push(`Node ${o}: missing "question_key".`),r.actor||t.push(`Node ${o}: missing "actor".`)}):t.push('Missing or invalid "nodes" (array).'),Array.isArray(n.edges)?n.edges.forEach((r,o)=>{r.edge_id||t.push(`Edge ${o}: missing "edge_id".`),r.from_node_id||t.push(`Edge ${o}: missing "from_node_id".`),r.to_node_id||t.push(`Edge ${o}: missing "to_node_id".`)}):t.push('Missing or invalid "edges" (array).'),{valid:t.length===0,errors:t}}function ND(){const[e,t]=C.useState(!1),[n,r]=C.useState(""),[o,s]=C.useState([]),a=C.useRef(null),i=$e(d=>d.importJourneySpec),c=C.useCallback(d=>{s([]);let h;try{h=JSON.parse(d)}catch{s(["Invalid JSON: could not parse the input."]);return}const m=CD(h);if(!m.valid){s(m.errors);return}i(h),It.success("Journey imported successfully"),r(""),s([]),t(!1)},[i]),l=C.useCallback(d=>{var g;const h=(g=d.target.files)==null?void 0:g[0];if(!h)return;const m=new FileReader;m.onload=p=>{var v;const y=(v=p.target)==null?void 0:v.result;r(y),c(y)},m.readAsText(h),d.target.value=""},[c]),f=C.useCallback(async()=>{try{const d=await navigator.clipboard.readText();r(d)}catch{It.error("Could not read clipboard")}},[]);return u.jsxs(ey,{open:e,onOpenChange:d=>{t(d),d||(s([]),r(""))},children:[u.jsx(ZP,{asChild:!0,children:u.jsxs(fe,{variant:"outline",size:"sm",children:[u.jsx(Ui,{className:"cj-h-4 cj-w-4 cj-mr-1"}),"Import"]})}),u.jsxs(ul,{className:"sm:cj-max-w-lg",children:[u.jsxs(dl,{children:[u.jsx(hl,{children:"Import Journey Spec"}),u.jsx(ml,{children:"Load a JourneySpec JSON file or paste JSON to populate the canvas."})]}),u.jsxs(By,{defaultValue:"paste",className:"cj-w-full",children:[u.jsxs(bl,{className:"cj-grid cj-w-full cj-grid-cols-2",children:[u.jsx(Eo,{value:"paste",children:"Paste JSON"}),u.jsx(Eo,{value:"file",children:"Upload File"})]}),u.jsxs(_o,{value:"paste",className:"cj-space-y-3 cj-mt-3",children:[u.jsx("div",{className:"cj-flex cj-justify-end",children:u.jsxs(fe,{variant:"ghost",size:"sm",onClick:f,className:"cj-h-7 cj-text-xs",children:[u.jsx(gN,{className:"cj-h-3 cj-w-3 cj-mr-1"}),"Paste from Clipboard"]})}),u.jsx(Ta,{placeholder:'{"journey_id": "...", "nodes": [...], "edges": [...]}',value:n,onChange:d=>r(d.target.value),className:"cj-min-h-[200px] cj-font-mono cj-text-xs"})]}),u.jsx(_o,{value:"file",className:"cj-mt-3",children:u.jsxs("div",{className:"cj-border-2 cj-border-dashed cj-rounded-lg cj-p-8 cj-text-center cj-cursor-pointer hover:cj-border-primary/50 cj-transition-colors",onClick:()=>{var d;return(d=a.current)==null?void 0:d.click()},children:[u.jsx(xN,{className:"cj-h-8 cj-w-8 cj-mx-auto cj-mb-2 cj-text-muted-foreground"}),u.jsxs("p",{className:"cj-text-sm cj-text-muted-foreground",children:["Click to select a ",u.jsx("strong",{children:".json"})," file"]}),u.jsx("input",{ref:a,type:"file",accept:".json,application/json",className:"cj-hidden",onChange:l})]})})]}),o.length>0&&u.jsxs("div",{className:"cj-bg-destructive/10 cj-border cj-border-destructive/30 cj-rounded-md cj-p-3 cj-space-y-1",children:[u.jsx("p",{className:"cj-text-xs cj-font-medium cj-text-destructive",children:"Validation errors:"}),u.jsx("ul",{className:"cj-text-xs cj-text-destructive/80 cj-list-disc cj-list-inside cj-space-y-0.5",children:o.map((d,h)=>u.jsx("li",{children:d},h))})]}),u.jsxs(fl,{children:[u.jsx(fe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),u.jsx(fe,{onClick:()=>c(n),disabled:!n.trim(),children:"Import Journey"})]})]})]})}function ED(e,t){const n=[];if(e.length===0)return n;const r=new Set(t.map(y=>y.target)),o=e.filter(y=>!r.has(y.id));o.length===0?n.push({type:"error",category:"no-start",message:"No start node found. Every node has incoming edges, which implies a loop."}):o.length>1&&n.push({type:"warning",category:"multi-start",message:`Multiple start nodes detected: ${o.map(y=>y.data.label).join(", ")}. Only the first will be used.`,nodeIds:o.map(y=>y.id)});const s=new Map;for(const y of t)s.has(y.source)||s.set(y.source,[]),s.get(y.source).push(y.target);const a=new Set,i=new Set,c=new Set;function l(y){a.add(y),i.add(y);let v=!1;for(const b of s.get(y)||[])i.has(b)?(c.add(y),c.add(b),v=!0):a.has(b)||l(b)&&(v=!0);return i.delete(y),v}for(const y of e)a.has(y.id)||l(y.id);if(c.size>0){const y=e.filter(v=>c.has(v.id)).map(v=>v.data.label);n.push({type:"error",category:"loop",message:`Loop detected involving: ${y.join(", ")}`,nodeIds:[...c]})}const f=new Set(t.map(y=>y.source)),d=e.filter(y=>!r.has(y.id)&&!f.has(y.id)&&e.length>1);for(const y of d)n.push({type:"warning",category:"orphan",message:`"${y.data.label}" is disconnected (no edges).`,nodeIds:[y.id]});const h=e.filter(y=>r.has(y.id)&&!f.has(y.id));h.length>1&&n.push({type:"warning",category:"dead-end",message:`Multiple end nodes: ${h.map(y=>y.data.label).join(", ")}. Verify this is intentional.`,nodeIds:h.map(y=>y.id)});const m=new Map;for(const y of t)m.has(y.source)||m.set(y.source,[]),m.get(y.source).push(y);for(const[y,v]of m){if(v.length<=1)continue;const b=v.some(j=>{var N;return(N=j.data)==null?void 0:N.isDefault}),x=v.filter(j=>{var N,S;return!((N=j.data)!=null&&N.condition)&&!((S=j.data)!=null&&S.isDefault)});if(x.length>0){const j=e.find(N=>N.id===y);n.push({type:"warning",category:"missing-condition",message:`"${j==null?void 0:j.data.label}" has ${v.length} outgoing edges but ${x.length} lack conditions.`,nodeIds:[y],edgeIds:x.map(N=>N.id)})}if(!b&&v.length>1){const j=e.find(N=>N.id===y);n.push({type:"warning",category:"missing-condition",message:`"${j==null?void 0:j.data.label}" has branching edges but no default fallback.`,nodeIds:[y]})}}const g=new Map,p=new Map;for(const y of e){const v=y.data.bindings||[];for(const b of v){const x=b.target_namespace;g.has(x)||(g.set(x,[]),p.set(x,[])),g.get(x).push(y.data.label),p.get(x).push(y.id)}}for(const[y,v]of g)v.length>1&&n.push({type:"warning",category:"duplicate-binding",message:`Duplicate binding "${y}" on nodes: ${v.join(", ")}. The last answer will overwrite previous ones.`,nodeIds:p.get(y)});return n}function _D(e,t){if(e.length===0)return[];const n=new Map;for(const i of e)n.set(i.id,i.data.actor);const r=new Map;for(const i of e){const c=i.data.actor;r.has(c)||r.set(c,[]),r.get(c).push(i)}const o=new Map,s=[];for(const i of t){const c=n.get(i.source),l=n.get(i.target);!c||!l||(c===l?(o.has(c)||o.set(c,[]),o.get(c).push(i)):s.push(i))}const a=[];for(const[i,c]of r){const l=o.get(i)||[],f=new Set(s.filter(g=>n.get(g.target)===i).map(g=>g.target)),d=new Set(s.filter(g=>n.get(g.source)===i).map(g=>g.source)),m=ED(c,l).filter(g=>{if(g.category==="orphan"&&g.nodeIds)return!g.nodeIds.every(p=>f.has(p)||d.has(p));if(g.category==="no-start"&&f.size>0)return!1;if(g.category==="multi-start"&&g.nodeIds){const p=g.nodeIds.filter(y=>!f.has(y));if(p.length<=1)return!1;g.nodeIds=p,g.message=`Multiple start nodes detected: ${p.map(y=>{var v;return(v=c.find(b=>b.id===y))==null?void 0:v.data.label}).join(", ")}. Only the first will be used.`}return!0});for(const g of m)g.actor=i;a.push(...m)}return a}const kD=ma("cj-relative cj-w-full cj-rounded-lg cj-border cj-p-4 [&>svg~*]:cj-pl-7 [&>svg+div]:cj-translate-y-[-3px] [&>svg]:cj-absolute [&>svg]:cj-left-4 [&>svg]:cj-top-4 [&>svg]:cj-text-foreground",{variants:{variant:{default:"cj-bg-background cj-text-foreground",destructive:"cj-border-destructive/50 cj-text-destructive dark:cj-border-destructive [&>svg]:cj-text-destructive"}},defaultVariants:{variant:"default"}}),Hy=w.forwardRef(({className:e,variant:t,...n},r)=>u.jsx("div",{ref:r,role:"alert",className:ce(kD({variant:t}),e),...n}));Hy.displayName="Alert";const Vy=w.forwardRef(({className:e,...t},n)=>u.jsx("h5",{ref:n,className:ce("cj-mb-1 cj-font-medium cj-leading-none cj-tracking-tight",e),...t}));Vy.displayName="AlertTitle";const Yy=w.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ce("cj-text-sm [&_p]:cj-leading-relaxed",e),...t}));Yy.displayName="AlertDescription";function MD(e){const t=PD(e),n=w.forwardRef((r,o)=>{const{children:s,...a}=r,i=w.Children.toArray(s),c=i.find(OD);if(c){const l=c.props.children,f=i.map(d=>d===c?w.Children.count(l)>1?w.Children.only(null):w.isValidElement(l)?l.props.children:null:d);return u.jsx(t,{...a,ref:o,children:w.isValidElement(l)?w.cloneElement(l,void 0,f):null})}return u.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function PD(e){const t=w.forwardRef((n,r)=>{const{children:o,...s}=n;if(w.isValidElement(o)){const a=AD(o),i=RD(s,o.props);return o.type!==w.Fragment&&(i.ref=r?Un(r,a):a),w.cloneElement(o,i)}return w.Children.count(o)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var DD=Symbol("radix.slottable");function OD(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===DD}function RD(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const c=s(...i);return o(...i),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function AD(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var za="Popover",[qy]=Ze(za,[zr]),qo=zr(),[TD,Nn]=qy(za),Gy=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!1}=e,i=qo(t),c=w.useRef(null),[l,f]=w.useState(!1),[d,h]=Nt({prop:r,defaultProp:o??!1,onChange:s,caller:za});return u.jsx(el,{...i,children:u.jsx(TD,{scope:t,contentId:jt(),triggerRef:c,open:d,onOpenChange:h,onOpenToggle:w.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:l,onCustomAnchorAdd:w.useCallback(()=>f(!0),[]),onCustomAnchorRemove:w.useCallback(()=>f(!1),[]),modal:a,children:n})})};Gy.displayName=za;var Uy="PopoverAnchor",ID=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Nn(Uy,n),s=qo(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=o;return w.useEffect(()=>(a(),()=>i()),[a,i]),u.jsx(Ca,{...s,...r,ref:t})});ID.displayName=Uy;var Xy="PopoverTrigger",Ky=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Nn(Xy,n),s=qo(n),a=pe(t,o.triggerRef),i=u.jsx(ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":tx(o.open),...r,ref:a,onClick:te(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:u.jsx(Ca,{asChild:!0,...s,children:i})});Ky.displayName=Xy;var wl="PopoverPortal",[$D,zD]=qy(wl,{forceMount:void 0}),Jy=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=Nn(wl,t);return u.jsx($D,{scope:t,forceMount:n,children:u.jsx(Ye,{present:n||s.open,children:u.jsx(Bo,{asChild:!0,container:o,children:r})})})};Jy.displayName=wl;var Dr="PopoverContent",Zy=w.forwardRef((e,t)=>{const n=zD(Dr,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=Nn(Dr,e.__scopePopover);return u.jsx(Ye,{present:r||s.open,children:s.modal?u.jsx(WD,{...o,ref:t}):u.jsx(FD,{...o,ref:t})})});Zy.displayName=Dr;var LD=MD("PopoverContent.RemoveScroll"),WD=w.forwardRef((e,t)=>{const n=Nn(Dr,e.__scopePopover),r=w.useRef(null),o=pe(t,r),s=w.useRef(!1);return w.useEffect(()=>{const a=r.current;if(a)return rl(a)},[]),u.jsx(_a,{as:LD,allowPinchZoom:!0,children:u.jsx(Qy,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:te(e.onCloseAutoFocus,a=>{var i;a.preventDefault(),s.current||(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:te(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0,l=i.button===2||c;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:te(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),FD=w.forwardRef((e,t)=>{const n=Nn(Dr,e.__scopePopover),r=w.useRef(!1),o=w.useRef(!1);return u.jsx(Qy,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,i;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(r.current||(i=n.triggerRef.current)==null||i.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;((l=n.triggerRef.current)==null?void 0:l.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Qy=w.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:f,...d}=e,h=Nn(Dr,n),m=qo(n);return Yc(),u.jsx(xa,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:u.jsx(Wo,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),children:u.jsx(tl,{"data-state":tx(h.open),role:"dialog",id:h.contentId,...m,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),ex="PopoverClose",BD=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Nn(ex,n);return u.jsx(ie.button,{type:"button",...r,ref:t,onClick:te(e.onClick,()=>o.onOpenChange(!1))})});BD.displayName=ex;var HD="PopoverArrow",VD=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=qo(n);return u.jsx(nl,{...o,...r,ref:t})});VD.displayName=HD;function tx(e){return e?"open":"closed"}var YD=Gy,qD=Ky,GD=Jy,nx=Zy;const jl=YD,Sl=qD,La=w.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>{const s=Ho();return u.jsx(GD,{container:s??void 0,children:u.jsx(nx,{ref:o,align:t,sideOffset:n,className:ce("cj-z-50 cj-w-72 cj-rounded-md cj-border cj-bg-popover cj-p-4 cj-text-popover-foreground cj-shadow-md cj-outline-none data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0 data-[state=closed]:cj-zoom-out-95 data-[state=open]:cj-zoom-in-95 data-[side=bottom]:cj-slide-in-from-top-2 data-[side=left]:cj-slide-in-from-right-2 data-[side=right]:cj-slide-in-from-left-2 data-[side=top]:cj-slide-in-from-bottom-2",e),...r})})});La.displayName=nx.displayName;var Wa="Collapsible",[UD]=Ze(Wa),[XD,Cl]=UD(Wa),rx=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:s,onOpenChange:a,...i}=e,[c,l]=Nt({prop:r,defaultProp:o??!1,onChange:a,caller:Wa});return u.jsx(XD,{scope:n,disabled:s,contentId:jt(),open:c,onOpenToggle:w.useCallback(()=>l(f=>!f),[l]),children:u.jsx(ie.div,{"data-state":El(c),"data-disabled":s?"":void 0,...i,ref:t})})});rx.displayName=Wa;var ox="CollapsibleTrigger",sx=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=Cl(ox,n);return u.jsx(ie.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":El(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:te(e.onClick,o.onOpenToggle)})});sx.displayName=ox;var Nl="CollapsibleContent",ax=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Cl(Nl,e.__scopeCollapsible);return u.jsx(Ye,{present:n||o.open,children:({present:s})=>u.jsx(KD,{...r,ref:t,present:s})})});ax.displayName=Nl;var KD=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...s}=e,a=Cl(Nl,n),[i,c]=w.useState(r),l=w.useRef(null),f=pe(t,l),d=w.useRef(0),h=d.current,m=w.useRef(0),g=m.current,p=a.open||i,y=w.useRef(p),v=w.useRef(void 0);return w.useEffect(()=>{const b=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(b)},[]),We(()=>{const b=l.current;if(b){v.current=v.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const x=b.getBoundingClientRect();d.current=x.height,m.current=x.width,y.current||(b.style.transitionDuration=v.current.transitionDuration,b.style.animationName=v.current.animationName),c(r)}},[a.open,r]),u.jsx(ie.div,{"data-state":El(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!p,...s,ref:f,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:p&&o})});function El(e){return e?"open":"closed"}var JD=rx;const _l=JD,kl=sx,Ml=ax,ZD={customer:{label:"Customer Flow",icon:Tc},operator:{label:"Operator Flow",icon:gm}};function QD(){const e=$e(m=>m.nodes),t=$e(m=>m.edges),n=$e(m=>m.setSelectedNode),r=$e(m=>m.setSelectedEdge),[o,s]=C.useState(!1),a=C.useMemo(()=>_D(e,t),[e,t]),i=C.useMemo(()=>{const m={};for(const g of a){const p=g.actor||"unknown";m[p]||(m[p]=[]),m[p].push(g)}return m},[a]),c=C.useMemo(()=>{const m=new Set(e.map(g=>g.data.actor));return Array.from(m)},[e]),l=a.filter(m=>m.type==="error"),f=a.filter(m=>m.type==="warning"),d=m=>{var g,p;(g=m.nodeIds)!=null&&g[0]?n(m.nodeIds[0]):(p=m.edgeIds)!=null&&p[0]&&r(m.edgeIds[0])},h=a.length;return u.jsxs(jl,{open:o,onOpenChange:s,children:[u.jsx(Sl,{asChild:!0,children:u.jsxs(fe,{variant:"outline",size:"sm",className:l.length>0?"cj-border-destructive cj-text-destructive hover:cj-text-destructive":f.length>0?"cj-border-yellow-500 cj-text-yellow-600 hover:cj-text-yellow-600":"",children:[u.jsx(EN,{className:"cj-h-4 cj-w-4 cj-mr-1"}),"Validate",h>0&&u.jsx(ct,{variant:l.length>0?"destructive":"secondary",className:"cj-ml-1.5 cj-h-5 cj-min-w-5 cj-px-1 cj-text-xs",children:h})]})}),u.jsxs(La,{className:"cj-w-96 cj-p-0",align:"end",children:[u.jsxs("div",{className:"cj-p-3 cj-border-b",children:[u.jsx("h4",{className:"cj-font-semibold cj-text-sm",children:"Graph Validation"}),u.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mt-0.5",children:a.length===0?"No issues found":`${l.length} error(s), ${f.length} warning(s)`})]}),a.length===0?u.jsxs("div",{className:"cj-p-6 cj-flex cj-flex-col cj-items-center cj-gap-2 cj-text-muted-foreground",children:[u.jsx(Gi,{className:"cj-h-8 cj-w-8 cj-text-green-500"}),u.jsx("span",{className:"cj-text-sm cj-font-medium",children:"Graph looks good!"})]}):u.jsx(Tr,{className:"cj-max-h-80",children:u.jsx("div",{className:"cj-p-2 cj-space-y-1",children:c.map(m=>{const g=ZD[m]||{label:m,icon:Tc},p=g.icon,y=i[m]||[],v=y.filter(b=>b.type==="error");return u.jsxs(_l,{defaultOpen:y.length>0,children:[u.jsxs(kl,{className:"cj-flex cj-items-center cj-gap-2 cj-w-full cj-px-2 cj-py-1.5 cj-rounded hover:cj-bg-accent/50 cj-transition-colors cj-text-sm cj-font-medium",children:[u.jsx(Rr,{className:"cj-h-3.5 cj-w-3.5 cj-text-muted-foreground cj-transition-transform [[data-state=closed]>&]:cj-rotate-[-90deg]"}),u.jsx(p,{className:"cj-h-3.5 cj-w-3.5"}),u.jsx("span",{children:g.label}),y.length===0?u.jsx(Gi,{className:"cj-h-3.5 cj-w-3.5 cj-text-green-500 cj-ml-auto"}):u.jsx(ct,{variant:v.length>0?"destructive":"secondary",className:"cj-ml-auto cj-h-5 cj-min-w-5 cj-px-1 cj-text-xs",children:y.length})]}),u.jsx(Ml,{children:y.length===0?u.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-pl-8 cj-py-1",children:"No issues"}):u.jsx("div",{className:"cj-pl-2 cj-pr-1 cj-pb-1 cj-space-y-1.5",children:y.map((b,x)=>u.jsxs(Hy,{variant:b.type==="error"?"destructive":"default",className:"cj-cursor-pointer hover:cj-bg-accent/50 cj-transition-colors cj-py-2",onClick:()=>d(b),children:[b.type==="error"?u.jsx(wm,{className:"cj-h-4 cj-w-4"}):u.jsx(_N,{className:"cj-h-4 cj-w-4 cj-text-yellow-500"}),u.jsx(Vy,{className:"cj-text-xs cj-font-semibold cj-uppercase cj-tracking-wide",children:b.category.replace("-"," ")}),u.jsx(Yy,{className:"cj-text-xs",children:b.message})]},x))})})]},m)})})})]})]})}const eO={questionNode:z2},tO={conditional:F2},Kd={padding:.3,maxZoom:.8};function nO({onOpenRunner:e,readOnly:t=!1}){const n=C.useRef(null),{screenToFlowPosition:r,fitView:o}=ca();I2();const{nodes:s,edges:a,onNodesChange:i,onEdgesChange:c,onConnect:l,addNodeFromSpec:f,setSelectedNode:d,setSelectedEdge:h,clearSelection:m,exportJourneySpec:g,isPreviewActive:p,previewPath:y,previewCurrentNodeId:v}=$e(),b=C.useCallback(k=>{k.preventDefault(),k.dataTransfer.dropEffect="copy"},[]),x=C.useCallback(k=>{k.preventDefault();const M=k.dataTransfer.getData("application/json");if(M)try{const W=JSON.parse(M),_=r({x:k.clientX,y:k.clientY});f(W,_)}catch{console.error("Failed to parse dropped data")}},[r,f]),j=C.useCallback((k,M)=>{d(M.id)},[d]),N=C.useCallback((k,M)=>{h(M.id)},[h]),S=C.useCallback(()=>{m()},[m]),E=C.useCallback(()=>{const k=g(),M=JSON.stringify(k,null,2);navigator.clipboard.writeText(M).then(()=>{It.success("Journey spec copied to clipboard")});const W=new Blob([M],{type:"application/json"}),_=URL.createObjectURL(W),I=document.createElement("a");I.href=_,I.download=`${k.journey_id}.json`,I.click(),URL.revokeObjectURL(_)},[g]),O=C.useCallback(()=>{const k=$e.getState();k._pushSnapshot();const{nodes:M}=k,W=Math.ceil(Math.sqrt(M.length)),_={x:280,y:180},I=M.map((R,z)=>{const A=z%W,D=Math.floor(z/W);return{...R,position:{x:A*_.x+50,y:D*_.y+50}}});$e.setState({nodes:I}),setTimeout(()=>o(Kd),50)},[o]),P=C.useMemo(()=>{if(!p)return s;const k=new Set(y);return s.map(M=>({...M,data:{...M.data,isInPreviewPath:k.has(M.id),isCurrentPreviewNode:M.id===v}}))},[s,p,y,v]),T=C.useMemo(()=>{if(!p)return a;const k=new Set;for(let M=0;M<y.length-1;M++){const W=y[M],_=y[M+1],I=a.find(R=>R.source===W&&R.target===_);I&&k.add(I.id)}return a.map(M=>({...M,data:{...M.data,isInPreviewPath:k.has(M.id)}}))},[a,p,y]);return u.jsx("div",{ref:n,className:"cj-h-full cj-w-full",children:u.jsxs(OC,{nodes:P,edges:T,onNodesChange:i,onEdgesChange:c,onConnect:t?void 0:l,onDragOver:t?void 0:b,onDrop:t?void 0:x,onNodeClick:j,onEdgeClick:N,onPaneClick:S,nodeTypes:eO,edgeTypes:tO,defaultEdgeOptions:{type:"conditional"},fitView:!0,fitViewOptions:Kd,deleteKeyCode:t?null:"Delete",nodesDraggable:!t,nodesConnectable:!t,elementsSelectable:!t,className:"cj-bg-muted/30",children:[u.jsx(LC,{gap:20,size:1}),u.jsx(qC,{}),u.jsx(sN,{className:"!cj-bg-background !cj-border-border",nodeColor:()=>"hsl(var(--claims-journey-primary))"}),u.jsxs($o,{position:"top-right",className:"cj-flex cj-gap-2",children:[u.jsx(uD,{delayDuration:300,children:!t&&u.jsxs(u.Fragment,{children:[u.jsxs(Ud,{children:[u.jsx(Xd,{asChild:!0,children:u.jsx(fe,{variant:"outline",size:"icon",className:"cj-h-8 cj-w-8",onClick:()=>$e.getState().undo(),disabled:!$e.getState().canUndo(),children:u.jsx(kN,{className:"cj-h-4 cj-w-4"})})}),u.jsx(dc,{children:"Undo (Ctrl+Z)"})]}),u.jsxs(Ud,{children:[u.jsx(Xd,{asChild:!0,children:u.jsx(fe,{variant:"outline",size:"icon",className:"cj-h-8 cj-w-8",onClick:()=>$e.getState().redo(),disabled:!$e.getState().canRedo(),children:u.jsx(NN,{className:"cj-h-4 cj-w-4"})})}),u.jsx(dc,{children:"Redo (Ctrl+Y)"})]})]})}),u.jsx(QD,{}),!t&&u.jsx(ND,{}),e&&u.jsxs(fe,{variant:"outline",size:"sm",onClick:e,children:[u.jsx($s,{className:"cj-h-4 cj-w-4 cj-mr-1"}),"Open Runner"]}),!t&&u.jsxs(fe,{variant:"outline",size:"sm",onClick:O,children:[u.jsx(bN,{className:"cj-h-4 cj-w-4 cj-mr-1"}),"Auto Layout"]}),u.jsxs(fe,{size:"sm",onClick:E,children:[u.jsx(yN,{className:"cj-h-4 cj-w-4 cj-mr-1"}),"Export JSON"]})]})]})})}function rO({onOpenRunner:e,readOnly:t}){return u.jsx(lm,{children:u.jsx(nO,{onOpenRunner:e,readOnly:t})})}var oO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],sO=oO.reduce((e,t)=>{const n=pa(`Primitive.${t}`),r=w.forwardRef((o,s)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),aO="Separator",Jd="horizontal",iO=["horizontal","vertical"],ix=w.forwardRef((e,t)=>{const{decorative:n,orientation:r=Jd,...o}=e,s=cO(r)?r:Jd,i=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return u.jsx(sO.div,{"data-orientation":s,...i,...o,ref:t})});ix.displayName=aO;function cO(e){return iO.includes(e)}var cx=ix;const gt=w.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>u.jsx(cx,{ref:o,decorative:n,orientation:t,className:ce("cj-shrink-0 cj-bg-border",t==="horizontal"?"cj-h-[1px] cj-w-full":"cj-h-full cj-w-[1px]",e),...r}));gt.displayName=cx.displayName;var Fa="Switch",[lO]=Ze(Fa),[uO,dO]=lO(Fa),lx=w.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:s,required:a,disabled:i,value:c="on",onCheckedChange:l,form:f,...d}=e,[h,m]=w.useState(null),g=pe(t,x=>m(x)),p=w.useRef(!1),y=h?f||!!h.closest("form"):!0,[v,b]=Nt({prop:o,defaultProp:s??!1,onChange:l,caller:Fa});return u.jsxs(uO,{scope:n,checked:v,disabled:i,children:[u.jsx(ie.button,{type:"button",role:"switch","aria-checked":v,"aria-required":a,"data-state":hx(v),"data-disabled":i?"":void 0,disabled:i,value:c,...d,ref:g,onClick:te(e.onClick,x=>{b(j=>!j),y&&(p.current=x.isPropagationStopped(),p.current||x.stopPropagation())})}),y&&u.jsx(fx,{control:h,bubbles:!p.current,name:r,value:c,checked:v,required:a,disabled:i,form:f,style:{transform:"translateX(-100%)"}})]})});lx.displayName=Fa;var ux="SwitchThumb",dx=w.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=dO(ux,n);return u.jsx(ie.span,{"data-state":hx(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});dx.displayName=ux;var fO="SwitchBubbleInput",fx=w.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const a=w.useRef(null),i=pe(a,s),c=Na(n),l=Sa(t);return w.useEffect(()=>{const f=a.current;if(!f)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==n&&m){const g=new Event("click",{bubbles:r});m.call(f,n),f.dispatchEvent(g)}},[c,n,r]),u.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});fx.displayName=fO;function hx(e){return e?"checked":"unchecked"}var mx=lx,hO=dx;const Pl=w.forwardRef(({className:e,...t},n)=>u.jsx(mx,{className:ce("cj-peer cj-inline-flex cj-h-6 cj-w-11 cj-shrink-0 cj-cursor-pointer cj-items-center cj-rounded-full cj-border-2 cj-border-transparent cj-transition-colors data-[state=checked]:cj-bg-primary data-[state=unchecked]:cj-bg-input focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 focus-visible:cj-ring-offset-background disabled:cj-cursor-not-allowed disabled:cj-opacity-50",e),...t,ref:n,children:u.jsx(hO,{className:ce("cj-pointer-events-none cj-block cj-h-5 cj-w-5 cj-rounded-full cj-bg-background cj-shadow-lg cj-ring-0 cj-transition-transform data-[state=checked]:cj-translate-x-5 data-[state=unchecked]:cj-translate-x-0")})}));Pl.displayName=mx.displayName;const mO=[{id:"65ec628d-0ebf-476b-bdd3-d160ea91a36d",namespace:"police_asset",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:1,schema:"v1_string",label:"Nome Completo",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"297c616b-cde6-489a-8fd7-1eeb5e169f77",namespace:"claim_role",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:2,schema:"v2_single_option_select-1",label:"Qualidade",data:null,force_data:!1,options:[{data:"segurado",label:"Segurado"},{data:"representante",label:"Representante"}],help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"e96d0cc2-25b2-4658-9d67-d83469d9672e",namespace:"employer",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:3,schema:"v1_string",label:"Entidade Patronal",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"2bcf5aaf-983e-4d26-8611-57b2668becf3",namespace:"work_regime",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:4,schema:"v2_single_option_select-1",label:"Regime de Trabalho",data:null,force_data:!1,options:[{data:"contrato-sem-termo",label:"Contrato sem Termo"},{data:"empresario-em-nome-individual",label:"Empresário em Nome Individual"},{data:"prestador-de-servicos",label:"Prestador de Serviços"}],help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"1ecd3d9c-1797-4024-87fb-533afee3b278",namespace:"phone_number",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:5,schema:"v1_string",label:"Nº Telefone de Contacto",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"ac578a3a-1e94-4168-ad8c-c9327059448f",namespace:"what_happened",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:7,schema:"v2_single_option_select-1",label:"Qual o tipo de ocorrência ?",data:null,force_data:!1,options:[{data:"morte-por-acidente",label:"Morte por Acidente"},{data:"incapacidade-permanente-e-absoluta-por-acidente",label:"Incapacidade Permanente e Absoluta por Acidente"},{data:"incapacidade-temporaria-absoluta-para-o-trabalho-devido-a-acidente-ou-doenca",label:"Incapacidade Temporária Absoluta para o Trabalho devido a Acidente ou Doença"},{data:"desemprego-em-situacao-de-despedimento-coletivo",label:"Desemprego em situação de Despedimento Coletivo"},{data:"desemprego-por-extincao-do-posto-de-trabalho",label:"DEsemprego por Extinção do Posto de Trabalho"}],help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"d7752ff6-2541-484b-b45b-a9a645ce4ba5",namespace:"ocorrence_date",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:8,schema:"v2_date-1",label:"Qual a Data da Ocorrência ?",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"7c545395-fe60-48ff-b6aa-083fdcabc3c3",namespace:"ocorrence_description",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:9,schema:"v1_string",label:"Descreva detalhadamente o que aconteceu",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"4db6022a-6cda-4be5-a0f5-289ab6029086",namespace:"event_asset",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:10,schema:"v2_single_asset_upload",label:"Anexe fotografia ou cópia dos documentos que sustentam o tipo de ocorrência",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"4fb85b7a-e016-45f2-be49-db3f05b261bd",namespace:"damage_asset",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:11,schema:"v2_single_asset_upload",label:"Anexe cópia das faturas a Reembolsar",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"d05fb14c-1bbd-4443-993c-f5cb64d8e694",namespace:"budget_value",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:12,schema:"v2_currency-1",label:"Insira a soma das faturas a reembolsar",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"9de98902-119e-4863-b188-596d52ef5169",namespace:"iban",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:13,schema:"v1_string",label:"IBAN para Reembolso",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"39565066-f8d1-48f9-90e3-4714c901ab6c",namespace:"iban_holder",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:14,schema:"v1_string",label:"Titular da Conta",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"5fcbe7f7-a3e5-456e-990c-1f19ff0d3d0e",namespace:"iban_proof",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:15,schema:"v2_single_asset_upload",label:"Anexe comprovativo de IBAN e Titular da conta bancária",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"b199e26e-1d40-4506-a6cc-357ca41c87f1",namespace:"claim_notes",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:16,schema:"v1_string",label:"Notas do Processo",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.management","io.habit.operations.required.claims.create"]},{id:"81779d52-aef3-4988-a2b2-97010aa417fb",namespace:"claim_total_amount",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:"9340e42c-bdb5-43fd-846e-28139650121e",order_index:17,schema:"v2_currency-1",label:"Total Indeminização Apurado",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.management","io.habit.operations.required.claims.create"]},{id:"0ab3d3e4-665e-43c4-a857-a16a18e1fa33",namespace:"claim_decision",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:"81779d52-aef3-4988-a2b2-97010aa417fb",order_index:18,schema:"v2_single_option_select-1",label:"Decisão",data:null,force_data:!1,options:[{data:"aceite",label:"Aceite",next:["ebe6445b-8a9f-4bd9-924f-9d0231cb7630"]},{data:"declinado",label:"Declinado"}],help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.management","io.habit.operations.required.claims.create"]},{id:"ebe6445b-8a9f-4bd9-924f-9d0231cb7630",namespace:"claim_refund_method",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:"0ab3d3e4-665e-43c4-a857-a16a18e1fa33",order_index:19,schema:"v2_single_option_select-1",label:"Método de Reembolso",data:null,force_data:!1,options:[{data:"fraccionado",label:"Fraccionado",next:["9340e42c-bdb5-43fd-846e-28139650121e"]},{data:"total",label:"Total",next:["9340e42c-bdb5-43fd-846e-28139650121e"]}],help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.management","io.habit.operations.required.claims.create"]},{id:"9340e42c-bdb5-43fd-846e-28139650121e",namespace:"claim_payment_count",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:"ebe6445b-8a9f-4bd9-924f-9d0231cb7630",order_index:20,schema:"v2_single_option_select-1",label:"Qt Reembolsos",data:null,force_data:!1,options:[{data:"1",label:"1",next:["81779d52-aef3-4988-a2b2-97010aa417fb"]},{data:"2",label:"2",next:["cfeba596-7f83-4169-8cf0-f0b9e6bd4c9b"]},{data:"3",label:"3",next:["cfeba596-7f83-4169-8cf0-f0b9e6bd4c9b"]},{data:"4",label:"4",next:["cfeba596-7f83-4169-8cf0-f0b9e6bd4c9b"]},{data:"5",label:"5",next:["cfeba596-7f83-4169-8cf0-f0b9e6bd4c9b"]},{data:"6",label:"6",next:["cfeba596-7f83-4169-8cf0-f0b9e6bd4c9b"]}],help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.management","io.habit.operations.required.claims.create"]},{id:"cfeba596-7f83-4169-8cf0-f0b9e6bd4c9b",namespace:"claim_parcial_amount",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:"9340e42c-bdb5-43fd-846e-28139650121e",order_index:21,schema:"v2_currency-1",label:"Valor Indeminização Mensal",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.fields.optional","io.habit.operations.management","io.habit.operations.required.claims.create"]},{id:"85d86e19-338a-4cf7-81b9-9ac87c3432dd",namespace:"claim_parcial_next_date_payment",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:"cfeba596-7f83-4169-8cf0-f0b9e6bd4c9b",order_index:22,schema:"v2_date-1",label:"Data Proximo Pagamento",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.fields.optional","io.habit.operations.management","io.habit.operations.required.claims.create"]},{id:"f723be65-c8a4-4ec4-ad33-2f327b94a782",namespace:"claim_parcial_payment_first_date",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:"cfeba596-7f83-4169-8cf0-f0b9e6bd4c9b",order_index:22,schema:"v2_date-1",label:"Data 1º Pagamento",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.fields.optional","io.habit.operations.management","io.habit.operations.required.claims.create"]},{id:"de72c452-9580-464f-8463-1d551281bd0d",namespace:"claim_total_amount_one_payment",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:"9340e42c-bdb5-43fd-846e-28139650121e",order_index:23,schema:"v2_currency-1",label:"Total Indeminização para único pagamento",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.management","io.habit.operations.required.claims.create"]},{id:"d26fa38c-dee4-40ac-8411-a5024b8698c7",namespace:"claim_total_payment_date",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:"81779d52-aef3-4988-a2b2-97010aa417fb",order_index:24,schema:"v2_date-1",label:"Data Pagamento",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.fields.optional","io.habit.operations.management","io.habit.operations.required.claims.create"]}],pO={claimproperty_specs:mO},gO=pO.claimproperty_specs;function yO(){const{nodes:e,selectedNodeId:t,updateNodeData:n,deleteNode:r}=$e(),o=e.find(b=>b.id===t),s=C.useMemo(()=>gO.map(b=>({namespace:b.namespace,label:b.label})),[]);if(!o)return u.jsx("div",{className:"cj-flex cj-h-full cj-items-center cj-justify-center cj-p-4 cj-text-center cj-text-sm cj-text-muted-foreground",children:"Select a node to edit its properties"});const{data:a}=o,i=Mr(a.schema),c=a.schema==="v2_single_option_select-1",l=a.schema==="v2_single_asset_upload"||a.widget==="upload",f=a.options||[],d=a.uploadConfig||{},h=()=>{n(o.id,{options:[...f,{data:"",label:""}]})},m=(b,x,j)=>{n(o.id,{options:f.map((N,S)=>S===b?{...N,[x]:j}:N)})},g=b=>{n(o.id,{options:f.filter((x,j)=>j!==b)})},p=()=>{n(o.id,{bindings:[...a.bindings,{target_namespace:""}]})},y=b=>{n(o.id,{bindings:a.bindings.filter((x,j)=>j!==b)})},v=(b,x)=>{n(o.id,{bindings:a.bindings.map((j,N)=>N===b?{target_namespace:x}:j)})};return u.jsxs("div",{className:"cj-flex cj-h-full cj-flex-col",children:[u.jsx("div",{className:"cj-border-b cj-p-4",children:u.jsx("h2",{className:"cj-text-sm cj-font-semibold",children:"Node Properties"})}),u.jsxs("div",{className:"cj-flex-1 cj-overflow-auto cj-p-4 cj-space-y-4",children:[u.jsxs("div",{children:[u.jsx(we,{className:"cj-text-xs cj-text-muted-foreground",children:"Schema Type"}),u.jsx("div",{className:"cj-mt-1",children:u.jsx(ct,{variant:"secondary",className:`${i.color} cj-text-white`,children:i.label})})]}),u.jsxs("div",{children:[u.jsx(we,{className:"cj-text-xs cj-text-muted-foreground",children:"Source Spec ID"}),u.jsx("div",{className:"cj-mt-1 cj-text-xs cj-font-mono cj-text-muted-foreground cj-break-all",children:a.specId})]}),u.jsxs("div",{children:[u.jsx(we,{className:"cj-text-xs cj-text-muted-foreground",children:"Namespace"}),u.jsx("div",{className:"cj-mt-1 cj-text-sm cj-font-mono",children:a.namespace})]}),u.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between",children:[u.jsxs("div",{children:[u.jsx(we,{htmlFor:"required",children:"Required"}),u.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:"Block navigation if empty"})]}),u.jsx(Pl,{id:"required",checked:a.required??!1,onCheckedChange:b=>n(o.id,{required:b})})]}),u.jsx(gt,{}),u.jsxs("div",{children:[u.jsx(we,{className:"cj-text-xs cj-text-muted-foreground",children:"Original Label"}),u.jsx("div",{className:"cj-mt-1 cj-text-sm",children:a.label})]}),u.jsxs("div",{children:[u.jsx(we,{htmlFor:"labelOverride",children:"Label Override (optional)"}),u.jsx(ze,{id:"labelOverride",value:a.labelOverride||"",onChange:b=>n(o.id,{labelOverride:b.target.value||void 0}),placeholder:"Leave empty to use original",className:"cj-mt-1"})]}),c&&u.jsxs(u.Fragment,{children:[u.jsx(gt,{}),u.jsxs("div",{children:[u.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between",children:[u.jsx(we,{children:"Select Options"}),u.jsxs(fe,{variant:"ghost",size:"sm",onClick:h,children:[u.jsx(wo,{className:"cj-h-3 cj-w-3 cj-mr-1"}),"Add"]})]}),u.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mb-2",children:"Define the dropdown options and their values"}),u.jsxs("div",{className:"cj-space-y-2",children:[f.map((b,x)=>u.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2 cj-p-2 cj-border cj-rounded-md cj-bg-muted/30",children:[u.jsxs("div",{className:"cj-flex-1 cj-space-y-1",children:[u.jsx(ze,{value:b.data,onChange:j=>m(x,"data",j.target.value),placeholder:"value (e.g., 'full_time')",className:"cj-font-mono cj-text-sm cj-h-8"}),u.jsx(ze,{value:b.label,onChange:j=>m(x,"label",j.target.value),placeholder:"Label (e.g., 'Full Time')",className:"cj-text-sm cj-h-8"})]}),u.jsx(fe,{variant:"ghost",size:"icon",onClick:()=>g(x),className:"cj-h-8 cj-w-8",children:u.jsx(Er,{className:"cj-h-3 cj-w-3"})})]},x)),f.length===0&&u.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-italic cj-py-2",children:"No options defined. Add options to enable conditional routing."})]})]})]}),l&&u.jsxs(u.Fragment,{children:[u.jsx(gt,{}),u.jsxs("div",{children:[u.jsx(we,{children:"Upload Validation"}),u.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mb-2",children:"Restrict accepted file types and maximum size"}),u.jsxs("div",{className:"cj-space-y-3",children:[u.jsxs("div",{children:[u.jsx(we,{htmlFor:"acceptPreset",className:"cj-text-xs",children:"File type preset"}),u.jsxs(tn,{value:d.accept==="image/*"?"images":d.accept===".pdf,.doc,.docx,.txt"?"documents":d.accept==="image/*,.pdf"?"images_pdf":d.accept===void 0||d.accept===""?"any":"custom",onValueChange:b=>{const x={any:void 0,images:"image/*",documents:".pdf,.doc,.docx,.txt",images_pdf:"image/*,.pdf"};b!=="custom"&&n(o.id,{uploadConfig:{...d,accept:x[b]}})},children:[u.jsx(Lt,{className:"cj-mt-1",children:u.jsx(nn,{})}),u.jsxs(Wt,{children:[u.jsx(_e,{value:"any",children:"Any file"}),u.jsx(_e,{value:"images",children:"Images only"}),u.jsx(_e,{value:"documents",children:"Documents only"}),u.jsx(_e,{value:"images_pdf",children:"Images + PDFs"}),u.jsx(_e,{value:"custom",children:"Custom"})]})]})]}),u.jsxs("div",{children:[u.jsx(we,{htmlFor:"acceptTypes",className:"cj-text-xs",children:"Accepted types (custom)"}),u.jsx(ze,{id:"acceptTypes",value:d.accept||"",onChange:b=>n(o.id,{uploadConfig:{...d,accept:b.target.value||void 0}}),placeholder:"e.g. image/*,.pdf",className:"cj-mt-1 cj-font-mono cj-text-sm"}),u.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mt-1",children:"Comma-separated MIME types or extensions"})]}),u.jsxs("div",{children:[u.jsx(we,{htmlFor:"maxSizeMB",className:"cj-text-xs",children:"Max file size (MB)"}),u.jsx(ze,{id:"maxSizeMB",type:"number",min:0,step:.5,value:d.maxSizeMB??"",onChange:b=>n(o.id,{uploadConfig:{...d,maxSizeMB:b.target.value?parseFloat(b.target.value):void 0}}),placeholder:"e.g. 5",className:"cj-mt-1 cj-w-24"})]})]})]})]}),u.jsx(gt,{}),u.jsxs("div",{children:[u.jsx(we,{children:"Actor"}),u.jsxs(tn,{value:a.actor,onValueChange:b=>n(o.id,{actor:b}),children:[u.jsx(Lt,{className:"cj-mt-1",children:u.jsx(nn,{})}),u.jsxs(Wt,{children:[u.jsx(_e,{value:"customer",children:"Customer"}),u.jsx(_e,{value:"operator",children:"Operator"})]})]})]}),u.jsx(gt,{}),u.jsxs("div",{children:[u.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between",children:[u.jsx(we,{children:"Bindings"}),u.jsxs(fe,{variant:"ghost",size:"sm",onClick:p,children:[u.jsx(wo,{className:"cj-h-3 cj-w-3 cj-mr-1"}),"Add"]})]}),u.jsx("div",{className:"cj-mt-2 cj-space-y-2",children:a.bindings.map((b,x)=>u.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[u.jsxs(tn,{value:b.target_namespace,onValueChange:j=>v(x,j),children:[u.jsx(Lt,{className:"cj-flex-1 cj-font-mono cj-text-sm",children:u.jsx(nn,{placeholder:"Select namespace..."})}),u.jsx(Wt,{children:s.map(j=>u.jsx(_e,{value:j.namespace,children:u.jsxs("div",{className:"cj-flex cj-flex-col",children:[u.jsx("span",{className:"cj-font-mono cj-text-xs",children:j.namespace}),u.jsx("span",{className:"cj-text-xs cj-text-muted-foreground",children:j.label})]})},j.namespace))})]}),a.bindings.length>1&&u.jsx(fe,{variant:"ghost",size:"icon",onClick:()=>y(x),className:"cj-h-8 cj-w-8",children:u.jsx(Er,{className:"cj-h-3 cj-w-3"})})]},x))})]}),u.jsx(gt,{}),u.jsxs("div",{children:[u.jsx(we,{children:"Widget Override"}),u.jsxs(tn,{value:a.widget||"auto",onValueChange:b=>n(o.id,{widget:b==="auto"?void 0:b}),children:[u.jsx(Lt,{className:"cj-mt-1",children:u.jsx(nn,{})}),u.jsxs(Wt,{children:[u.jsx(_e,{value:"auto",children:"Auto (from schema)"}),u.jsx(_e,{value:"text",children:"Text Input"}),u.jsx(_e,{value:"textarea",children:"Textarea"}),u.jsx(_e,{value:"select",children:"Select Dropdown"}),u.jsx(_e,{value:"radio",children:"Radio Group"}),u.jsx(_e,{value:"datepicker",children:"Date Picker"}),u.jsx(_e,{value:"currency",children:"Currency Input"}),u.jsx(_e,{value:"upload",children:"File Upload"}),u.jsx(_e,{value:"email",children:"Email"}),u.jsx(_e,{value:"phone",children:"Phone"})]})]})]})]}),u.jsx("div",{className:"cj-border-t cj-p-4",children:u.jsxs(fe,{variant:"destructive",className:"cj-w-full",onClick:()=>r(o.id),children:[u.jsx(Em,{className:"cj-h-4 cj-w-4 cj-mr-2"}),"Delete Node"]})})]})}const px=[{value:"==",label:"equals"},{value:"!=",label:"not equals"},{value:">",label:"greater than"},{value:"<",label:"less than"},{value:">=",label:"greater or equal"},{value:"<=",label:"less or equal"},{value:"in",label:"contains"},{value:"is_null",label:"is null"},{value:"is_not_null",label:"is not null"}],hc=["is_null","is_not_null"];function Zd(e){const t=Object.keys(e)[0];if(t==="=="||t==="!="){const s=e[t];if(!Array.isArray(s)||s.length!==2)return null;const a=s[0];if(!(a!=null&&a.var))return null;const i=a.var.replace("answers.","");return s[1]===null?{field:i,operator:t==="=="?"is_null":"is_not_null",value:""}:{field:i,operator:t,value:String(s[1])}}if(!px.some(s=>s.value===t))return null;const n=e[t];if(!Array.isArray(n)||n.length!==2)return null;const r=n[0];return r!=null&&r.var?{field:r.var.replace("answers.",""),operator:t,value:String(n[1])}:null}function Qd(e){const t={mode:"and",rules:[{field:"",operator:"==",value:""}]};if(!e)return t;const n=Object.keys(e)[0];if(n==="and"||n==="or"){const o=e[n];if(Array.isArray(o)){const s=o.map(Zd).filter(Boolean);if(s.length>0)return{mode:n,rules:s}}return t}const r=Zd(e);return r?{mode:"and",rules:[r]}:t}function xO(e){const t=e.rules.filter(r=>r.field&&(r.value||hc.includes(r.operator)));if(t.length===0)return null;const n=t.map(r=>r.operator==="is_null"?{"==":[{var:`answers.${r.field}`},null]}:r.operator==="is_not_null"?{"!=":[{var:`answers.${r.field}`},null]}:{[r.operator]:[{var:`answers.${r.field}`},r.value]});return n.length===1?n[0]:{[e.mode]:n}}function vO(){return{field:"",operator:"==",value:""}}function bO(e,t){const n=new Set,r=[e];for(;r.length>0;){const o=r.pop();for(const s of t)s.target===o&&!n.has(s.source)&&(n.add(s.source),r.push(s.source))}return n}function wO({rule:e,availableFields:t,canRemove:n,onChange:r,onRemove:o}){const s=hc.includes(e.operator);return u.jsxs("div",{className:"cj-flex cj-items-start cj-gap-1.5 cj-group",children:[u.jsxs("div",{className:"cj-flex-1 cj-space-y-1.5",children:[u.jsxs(tn,{value:e.field,onValueChange:a=>r({field:a}),children:[u.jsx(Lt,{className:"cj-h-8 cj-text-xs",children:u.jsx(nn,{placeholder:"Field"})}),u.jsx(Wt,{children:t.map(a=>u.jsx(_e,{value:a.namespace,children:a.label},a.namespace))})]}),u.jsxs(tn,{value:e.operator,onValueChange:a=>r({operator:a,...hc.includes(a)?{value:""}:{}}),children:[u.jsx(Lt,{className:"cj-h-8 cj-text-xs",children:u.jsx(nn,{})}),u.jsx(Wt,{children:px.map(a=>u.jsx(_e,{value:a.value,children:a.label},a.value))})]}),!s&&u.jsx(ze,{className:"cj-h-8 cj-text-xs",placeholder:"Value",value:e.value,onChange:a=>r({value:a.target.value})})]}),n&&u.jsx(fe,{variant:"ghost",size:"icon",className:"cj-h-8 cj-w-8 cj-opacity-0 group-hover:cj-opacity-100 cj-shrink-0 cj-mt-0",onClick:o,children:u.jsx(Er,{className:"cj-h-3.5 cj-w-3.5"})})]})}function jO({conditions:e,availableFields:t,onChange:n}){const r=()=>{n({...e,mode:e.mode==="and"?"or":"and"})},o=(i,c)=>{const l=e.rules.map((f,d)=>d===i?{...f,...c}:f);n({...e,rules:l})},s=()=>{n({...e,rules:[...e.rules,vO()]})},a=i=>{n({...e,rules:e.rules.filter((c,l)=>l!==i)})};return u.jsxs("div",{className:"cj-space-y-3",children:[e.rules.length>1&&u.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[u.jsx("span",{className:"cj-text-xs cj-text-muted-foreground",children:"Combine with:"}),u.jsx(ct,{variant:e.mode==="and"?"default":"outline",className:"cj-cursor-pointer cj-text-[10px]",onClick:r,children:"AND"}),u.jsx(ct,{variant:e.mode==="or"?"default":"outline",className:"cj-cursor-pointer cj-text-[10px]",onClick:r,children:"OR"})]}),u.jsx("div",{className:"cj-space-y-3",children:e.rules.map((i,c)=>u.jsxs("div",{children:[c>0&&u.jsx("div",{className:"cj-text-center cj-text-[10px] cj-text-muted-foreground cj-font-medium cj-py-1 cj-uppercase",children:e.mode}),u.jsx(wO,{rule:i,availableFields:t,canRemove:e.rules.length>1,onChange:l=>o(c,l),onRemove:()=>a(c)})]},c))}),u.jsxs(fe,{variant:"outline",size:"sm",className:"cj-w-full cj-h-7 cj-text-xs",onClick:s,children:[u.jsx(wo,{className:"cj-h-3 cj-w-3 cj-mr-1"}),"Add condition"]})]})}function SO({condition:e,availableFields:t}){const[n,r]=C.useState(!1),[o,s]=C.useState({}),[a,i]=C.useState(null),c=()=>{if(!e){i(null);return}try{const l={answers:{...o}},f=Is.apply(e,l);i(!!f)}catch{i(!1)}};return u.jsxs(_l,{open:n,onOpenChange:r,children:[u.jsxs(kl,{className:"cj-flex cj-items-center cj-gap-1.5 cj-text-xs cj-font-medium cj-text-muted-foreground hover:cj-text-foreground cj-w-full cj-py-1",children:[n?u.jsx(Rr,{className:"cj-h-3.5 cj-w-3.5"}):u.jsx(xm,{className:"cj-h-3.5 cj-w-3.5"}),"Test Condition"]}),u.jsxs(Ml,{className:"cj-space-y-2 cj-pt-2",children:[u.jsx("p",{className:"cj-text-[11px] cj-text-muted-foreground",children:"Enter sample answers to test:"}),t.map(l=>u.jsxs("div",{className:"cj-space-y-0.5",children:[u.jsx(we,{className:"cj-text-[11px]",children:l.label}),u.jsx(ze,{className:"cj-h-7 cj-text-xs",placeholder:l.namespace,value:o[l.namespace]||"",onChange:f=>s(d=>({...d,[l.namespace]:f.target.value}))})]},l.namespace)),u.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[u.jsxs(fe,{size:"sm",variant:"outline",className:"cj-h-7 cj-text-xs",onClick:c,disabled:!e,children:[u.jsx($s,{className:"cj-h-3 cj-w-3 cj-mr-1"}),"Run Test"]}),a!==null&&(a?u.jsxs("span",{className:"cj-flex cj-items-center cj-gap-1 cj-text-xs cj-text-primary",children:[u.jsx(Gi,{className:"cj-h-3.5 cj-w-3.5"})," True"]}):u.jsxs("span",{className:"cj-flex cj-items-center cj-gap-1 cj-text-xs cj-text-destructive",children:[u.jsx(wm,{className:"cj-h-3.5 cj-w-3.5"})," False"]}))]})]})]})}function CO(){const{nodes:e,edges:t,selectedEdgeId:n,updateEdgeData:r,deleteEdge:o}=$e(),[s,a]=C.useState(null),[i,c]=C.useState({mode:"and",rules:[{field:"",operator:"==",value:""}]}),l=t.find(S=>S.id===n),f=(l==null?void 0:l.data)||{condition:null,priority:0,isDefault:!1};C.useEffect(()=>{var S;l&&c(Qd(((S=l.data)==null?void 0:S.condition)??null))},[n]);const d=C.useMemo(()=>{if(!l)return new Set;const S=bO(l.source,t);return S.add(l.source),S},[l==null?void 0:l.source,t]),h=C.useMemo(()=>e.filter(S=>d.has(S.id)).map(S=>({namespace:S.data.namespace,label:S.data.label})),[e,d]);if(!l)return u.jsx("div",{className:"cj-flex cj-h-full cj-items-center cj-justify-center cj-p-4 cj-text-center cj-text-sm cj-text-muted-foreground",children:"Select an edge to edit its properties"});const m=e.find(S=>S.id===l.source),g=e.find(S=>S.id===l.target),p=m==null?void 0:m.data,y=(p==null?void 0:p.options)||[],v=y.length>0,b=S=>{c(S),r(l.id,{condition:xO(S)}),a(null)},x=S=>{try{const E=S.trim()?JSON.parse(S):null;r(l.id,{condition:E}),c(Qd(E)),a(null)}catch{a("Invalid JSON")}},j=S=>{if(p){const E={mode:"and",rules:[{field:p.namespace,operator:"==",value:S}]};b(E)}},N=()=>i.rules.length===1&&i.rules[0].value&&i.rules[0].field===(p==null?void 0:p.namespace)?i.rules[0].value:null;return u.jsxs("div",{className:"cj-flex cj-h-full cj-flex-col",children:[u.jsx("div",{className:"cj-border-b cj-p-4",children:u.jsx("h2",{className:"cj-text-sm cj-font-semibold",children:"Edge Properties"})}),u.jsxs("div",{className:"cj-flex-1 cj-overflow-auto cj-p-4 cj-space-y-4",children:[u.jsxs("div",{className:"cj-rounded-lg cj-bg-muted cj-p-3 cj-text-sm",children:[u.jsx("div",{className:"cj-text-xs cj-text-muted-foreground cj-mb-1",children:"Connection"}),u.jsx("div",{className:"cj-font-medium",children:m?m.data.namespace:"Unknown"}),u.jsx("div",{className:"cj-text-muted-foreground cj-text-center cj-my-1",children:"↓"}),u.jsx("div",{className:"cj-font-medium",children:g?g.data.namespace:"Unknown"})]}),u.jsx(gt,{}),u.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between",children:[u.jsxs("div",{children:[u.jsx(we,{children:"Default Edge"}),u.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:"Used when no other conditions match"})]}),u.jsx(Pl,{checked:f.isDefault,onCheckedChange:S=>r(l.id,{isDefault:S})})]}),!f.isDefault&&u.jsxs(u.Fragment,{children:[u.jsx(gt,{}),u.jsxs("div",{children:[u.jsx(we,{htmlFor:"priority",children:"Priority"}),u.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mb-1",children:"Higher priority edges are evaluated first"}),u.jsx(ze,{id:"priority",type:"number",value:f.priority,onChange:S=>r(l.id,{priority:parseInt(S.target.value)||0})})]}),u.jsx(gt,{}),u.jsxs("div",{children:[u.jsx(we,{children:"Condition"}),v&&u.jsxs("div",{className:"cj-mt-2 cj-mb-3",children:[u.jsxs("div",{className:"cj-flex cj-items-center cj-gap-1.5 cj-mb-1.5",children:[u.jsx(MN,{className:"cj-h-3.5 cj-w-3.5 cj-text-primary"}),u.jsx("span",{className:"cj-text-xs cj-text-muted-foreground",children:"Quick pick from source options:"})]}),u.jsx("div",{className:"cj-flex cj-flex-wrap cj-gap-1",children:y.map(S=>{const E=N()===S.data;return u.jsx(ct,{variant:E?"default":"outline",className:"cj-cursor-pointer cj-text-[11px]",onClick:()=>j(S.data),children:S.label||S.data},S.data)})})]}),u.jsxs(By,{defaultValue:"visual",className:"cj-mt-2",children:[u.jsxs(bl,{className:"cj-w-full",children:[u.jsx(Eo,{value:"visual",className:"cj-flex-1",children:"Visual"}),u.jsx(Eo,{value:"advanced",className:"cj-flex-1",children:"Advanced"})]}),u.jsx(_o,{value:"visual",className:"cj-mt-3",children:u.jsx(jO,{conditions:i,availableFields:h,onChange:b})}),u.jsxs(_o,{value:"advanced",className:"cj-mt-3",children:[u.jsx("div",{className:"cj-text-sm cj-text-muted-foreground cj-mb-2",children:"JSON Logic condition"}),u.jsx(Ta,{className:"cj-font-mono cj-text-sm",rows:6,value:f.condition?JSON.stringify(f.condition,null,2):"",onChange:S=>x(S.target.value),placeholder:'{"==": [{"var": "answers.field"}, "value"]}'}),s&&u.jsxs("div",{className:"cj-flex cj-items-center cj-gap-1 cj-mt-1 cj-text-destructive cj-text-xs",children:[u.jsx(bm,{className:"cj-h-3 cj-w-3"}),s]})]})]})]}),u.jsx(gt,{}),u.jsx(SO,{condition:f.condition,availableFields:h})]})]}),u.jsx("div",{className:"cj-border-t cj-p-4",children:u.jsxs(fe,{variant:"destructive",className:"cj-w-full",onClick:()=>o(l.id),children:[u.jsx(Em,{className:"cj-h-4 cj-w-4 cj-mr-2"}),"Delete Edge"]})})]})}function NO(){const{selectedNodeId:e,selectedEdgeId:t}=$e();return t?u.jsx(CO,{}):e?u.jsx(yO,{}):u.jsx("div",{className:"cj-flex cj-h-full cj-flex-col cj-items-center cj-justify-center cj-p-4 cj-text-center",children:u.jsxs("div",{className:"cj-text-sm cj-text-muted-foreground",children:[u.jsx("p",{className:"cj-mb-2",children:"Select a node or edge to edit"}),u.jsx("p",{className:"cj-text-xs",children:"Drag specs from the left panel onto the canvas to create nodes"})]})})}function EO({label:e,value:t,onChange:n,placeholder:r,helpText:o,multiline:s=!1}){return u.jsxs("div",{className:"cj-space-y-2",children:[u.jsx(we,{className:"cj-text-sm cj-font-medium",children:e}),s?u.jsx(Ta,{value:t,onChange:a=>n(a.target.value),placeholder:r,className:"cj-min-h-[100px]"}):u.jsx(ze,{type:"text",value:t,onChange:a=>n(a.target.value),placeholder:r}),o&&u.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o})]})}var Dl="Radio",[_O,gx]=Ze(Dl),[kO,MO]=_O(Dl),yx=w.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:s,disabled:a,value:i="on",onCheck:c,form:l,...f}=e,[d,h]=w.useState(null),m=pe(t,y=>h(y)),g=w.useRef(!1),p=d?l||!!d.closest("form"):!0;return u.jsxs(kO,{scope:n,checked:o,disabled:a,children:[u.jsx(ie.button,{type:"button",role:"radio","aria-checked":o,"data-state":wx(o),"data-disabled":a?"":void 0,disabled:a,value:i,...f,ref:m,onClick:te(e.onClick,y=>{o||c==null||c(),p&&(g.current=y.isPropagationStopped(),g.current||y.stopPropagation())})}),p&&u.jsx(bx,{control:d,bubbles:!g.current,name:r,value:i,checked:o,required:s,disabled:a,form:l,style:{transform:"translateX(-100%)"}})]})});yx.displayName=Dl;var xx="RadioIndicator",vx=w.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,s=MO(xx,n);return u.jsx(Ye,{present:r||s.checked,children:u.jsx(ie.span,{"data-state":wx(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});vx.displayName=xx;var PO="RadioBubbleInput",bx=w.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const a=w.useRef(null),i=pe(a,s),c=Na(n),l=Sa(t);return w.useEffect(()=>{const f=a.current;if(!f)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==n&&m){const g=new Event("click",{bubbles:r});m.call(f,n),f.dispatchEvent(g)}},[c,n,r]),u.jsx(ie.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});bx.displayName=PO;function wx(e){return e?"checked":"unchecked"}var DO=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ba="RadioGroup",[OO]=Ze(Ba,[Ia,gx]),jx=Ia(),Sx=gx(),[RO,AO]=OO(Ba),Cx=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:s,required:a=!1,disabled:i=!1,orientation:c,dir:l,loop:f=!0,onValueChange:d,...h}=e,m=jx(n),g=Lo(l),[p,y]=Nt({prop:s,defaultProp:o??null,onChange:d,caller:Ba});return u.jsx(RO,{scope:n,name:r,required:a,disabled:i,value:p,onValueChange:y,children:u.jsx(_y,{asChild:!0,...m,orientation:c,dir:g,loop:f,children:u.jsx(ie.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":i?"":void 0,dir:g,...h,ref:t})})})});Cx.displayName=Ba;var Nx="RadioGroupItem",Ex=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,s=AO(Nx,n),a=s.disabled||r,i=jx(n),c=Sx(n),l=w.useRef(null),f=pe(t,l),d=s.value===o.value,h=w.useRef(!1);return w.useEffect(()=>{const m=p=>{DO.includes(p.key)&&(h.current=!0)},g=()=>h.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",g)}},[]),u.jsx(ky,{asChild:!0,...i,focusable:!a,active:d,children:u.jsx(yx,{disabled:a,required:s.required,checked:d,...c,...o,name:s.name,ref:f,onCheck:()=>s.onValueChange(o.value),onKeyDown:te(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:te(o.onFocus,()=>{var m;h.current&&((m=l.current)==null||m.click())})})})});Ex.displayName=Nx;var TO="RadioGroupIndicator",_x=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=Sx(n);return u.jsx(vx,{...o,...r,ref:t})});_x.displayName=TO;var kx=Cx,Mx=Ex,IO=_x;const Px=w.forwardRef(({className:e,...t},n)=>u.jsx(kx,{className:ce("cj-grid cj-gap-2",e),...t,ref:n}));Px.displayName=kx.displayName;const Dx=w.forwardRef(({className:e,...t},n)=>u.jsx(Mx,{ref:n,className:ce("cj-aspect-square cj-h-4 cj-w-4 cj-rounded-full cj-border cj-border-primary cj-text-primary cj-ring-offset-background focus:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-cursor-not-allowed disabled:cj-opacity-50",e),...t,children:u.jsx(IO,{className:"cj-flex cj-items-center cj-justify-center",children:u.jsx(pN,{className:"cj-h-2.5 cj-w-2.5 cj-fill-current cj-text-current"})})}));Dx.displayName=Mx.displayName;function $O({label:e,value:t,onChange:n,options:r,helpText:o}){const s=r.length<=5;return u.jsxs("div",{className:"cj-space-y-2",children:[u.jsx(we,{className:"cj-text-sm cj-font-medium",children:e}),s?u.jsx(Px,{value:t,onValueChange:n,className:"cj-space-y-2",children:r.map(a=>u.jsxs("div",{className:"cj-flex cj-items-center cj-space-x-2",children:[u.jsx(Dx,{value:a.data,id:a.data}),u.jsx(we,{htmlFor:a.data,className:"cj-font-normal cj-cursor-pointer",children:a.label})]},a.data))}):u.jsxs(tn,{value:t,onValueChange:n,children:[u.jsx(Lt,{className:"cj-w-full",children:u.jsx(nn,{placeholder:"Select an option..."})}),u.jsx(Wt,{className:"cj-bg-popover cj-z-50",children:r.map(a=>u.jsx(_e,{value:a.data,children:a.label},a.data))})]}),o&&u.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o})]})}function kt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Gn(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const Ox=6048e5,zO=864e5;let LO={};function Ha(){return LO}function ko(e,t){var i,c,l,f;const n=Ha(),r=(t==null?void 0:t.weekStartsOn)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(l=n.locale)==null?void 0:l.options)==null?void 0:f.weekStartsOn)??0,o=kt(e),s=o.getDay(),a=(s<r?7:0)+s-r;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function Xs(e){return ko(e,{weekStartsOn:1})}function Rx(e){const t=kt(e),n=t.getFullYear(),r=Gn(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=Xs(r),s=Gn(e,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const a=Xs(s);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function ef(e){const t=kt(e);return t.setHours(0,0,0,0),t}function tf(e){const t=kt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function WO(e,t){const n=ef(e),r=ef(t),o=+n-tf(n),s=+r-tf(r);return Math.round((o-s)/zO)}function FO(e){const t=Rx(e),n=Gn(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Xs(n)}function BO(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function HO(e){if(!BO(e)&&typeof e!="number")return!1;const t=kt(e);return!isNaN(Number(t))}function VO(e){const t=kt(e),n=Gn(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const YO={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},qO=(e,t,n)=>{let r;const o=YO[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Si(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const GO={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},UO={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},XO={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},KO={date:Si({formats:GO,defaultWidth:"full"}),time:Si({formats:UO,defaultWidth:"full"}),dateTime:Si({formats:XO,defaultWidth:"full"})},JO={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ZO=(e,t,n,r)=>JO[e];function Xr(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,i=n!=null&&n.width?String(n.width):a;o=e.formattingValues[i]||e.formattingValues[a]}else{const a=e.defaultWidth,i=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[i]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const QO={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},eR={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},tR={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},nR={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},rR={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},oR={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},sR=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},aR={ordinalNumber:sR,era:Xr({values:QO,defaultWidth:"wide"}),quarter:Xr({values:eR,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Xr({values:tR,defaultWidth:"wide"}),day:Xr({values:nR,defaultWidth:"wide"}),dayPeriod:Xr({values:rR,defaultWidth:"wide",formattingValues:oR,defaultFormattingWidth:"wide"})};function Kr(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const a=s[0],i=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?cR(i,d=>d.test(a)):iR(i,d=>d.test(a));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const f=t.slice(a.length);return{value:l,rest:f}}}function iR(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function cR(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function lR(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const i=t.slice(o.length);return{value:a,rest:i}}}const uR=/^(\d+)(th|st|nd|rd)?/i,dR=/\d+/i,fR={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},hR={any:[/^b/i,/^(a|c)/i]},mR={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},pR={any:[/1/i,/2/i,/3/i,/4/i]},gR={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},yR={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},xR={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},vR={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},bR={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},wR={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},jR={ordinalNumber:lR({matchPattern:uR,parsePattern:dR,valueCallback:e=>parseInt(e,10)}),era:Kr({matchPatterns:fR,defaultMatchWidth:"wide",parsePatterns:hR,defaultParseWidth:"any"}),quarter:Kr({matchPatterns:mR,defaultMatchWidth:"wide",parsePatterns:pR,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Kr({matchPatterns:gR,defaultMatchWidth:"wide",parsePatterns:yR,defaultParseWidth:"any"}),day:Kr({matchPatterns:xR,defaultMatchWidth:"wide",parsePatterns:vR,defaultParseWidth:"any"}),dayPeriod:Kr({matchPatterns:bR,defaultMatchWidth:"any",parsePatterns:wR,defaultParseWidth:"any"})},SR={code:"en-US",formatDistance:qO,formatLong:KO,formatRelative:ZO,localize:aR,match:jR,options:{weekStartsOn:0,firstWeekContainsDate:1}};function CR(e){const t=kt(e);return WO(t,VO(t))+1}function NR(e){const t=kt(e),n=+Xs(t)-+FO(t);return Math.round(n/Ox)+1}function Ax(e,t){var f,d,h,m;const n=kt(e),r=n.getFullYear(),o=Ha(),s=(t==null?void 0:t.firstWeekContainsDate)??((d=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((m=(h=o.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,a=Gn(e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const i=ko(a,t),c=Gn(e,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const l=ko(c,t);return n.getTime()>=i.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function ER(e,t){var i,c,l,f;const n=Ha(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(l=n.locale)==null?void 0:l.options)==null?void 0:f.firstWeekContainsDate)??1,o=Ax(e,t),s=Gn(e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),ko(s,t)}function _R(e,t){const n=kt(e),r=+ko(n,t)-+ER(n,t);return Math.round(r/Ox)+1}function je(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const mn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return je(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):je(n+1,2)},d(e,t){return je(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return je(e.getHours()%12||12,t.length)},H(e,t){return je(e.getHours(),t.length)},m(e,t){return je(e.getMinutes(),t.length)},s(e,t){return je(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return je(o,t.length)}},or={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},nf={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return mn.y(e,t)},Y:function(e,t,n,r){const o=Ax(e,r),s=o>0?o:1-o;if(t==="YY"){const a=s%100;return je(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):je(s,t.length)},R:function(e,t){const n=Rx(e);return je(n,t.length)},u:function(e,t){const n=e.getFullYear();return je(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return je(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return je(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return mn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return je(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=_R(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):je(o,t.length)},I:function(e,t,n){const r=NR(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):je(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):mn.d(e,t)},D:function(e,t,n){const r=CR(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):je(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return je(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return je(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return je(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=or.noon:r===0?o=or.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=or.evening:r>=12?o=or.afternoon:r>=4?o=or.morning:o=or.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return mn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):mn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):je(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):je(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):mn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):mn.s(e,t)},S:function(e,t){return mn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return of(r);case"XXXX":case"XX":return Pn(r);case"XXXXX":case"XXX":default:return Pn(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return of(r);case"xxxx":case"xx":return Pn(r);case"xxxxx":case"xxx":default:return Pn(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+rf(r,":");case"OOOO":default:return"GMT"+Pn(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+rf(r,":");case"zzzz":default:return"GMT"+Pn(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return je(r,t.length)},T:function(e,t,n){const r=e.getTime();return je(r,t.length)}};function rf(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+je(s,2)}function of(e,t){return e%60===0?(e>0?"-":"+")+je(Math.abs(e)/60,2):Pn(e,t)}function Pn(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=je(Math.trunc(r/60),2),s=je(r%60,2);return n+o+t+s}const sf=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Tx=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},kR=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return sf(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",sf(r,t)).replace("{{time}}",Tx(o,t))},MR={p:Tx,P:kR},PR=/^D+$/,DR=/^Y+$/,OR=["D","DD","YY","YYYY"];function RR(e){return PR.test(e)}function AR(e){return DR.test(e)}function TR(e,t,n){const r=IR(e,t,n);if(console.warn(r),OR.includes(e))throw new RangeError(r)}function IR(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $R=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,LR=/^'([^]*?)'?$/,WR=/''/g,FR=/[a-zA-Z]/;function BR(e,t,n){var f,d,h,m;const r=Ha(),o=r.locale??SR,s=r.firstWeekContainsDate??((d=(f=r.locale)==null?void 0:f.options)==null?void 0:d.firstWeekContainsDate)??1,a=r.weekStartsOn??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,i=kt(e);if(!HO(i))throw new RangeError("Invalid time value");let c=t.match(zR).map(g=>{const p=g[0];if(p==="p"||p==="P"){const y=MR[p];return y(g,o.formatLong)}return g}).join("").match($R).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const p=g[0];if(p==="'")return{isToken:!1,value:HR(g)};if(nf[p])return{isToken:!0,value:g};if(p.match(FR))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:g}});o.localize.preprocessor&&(c=o.localize.preprocessor(i,c));const l={firstWeekContainsDate:s,weekStartsOn:a,locale:o};return c.map(g=>{if(!g.isToken)return g.value;const p=g.value;(AR(p)||RR(p))&&TR(p,t,String(e));const y=nf[p[0]];return y(i,p,o.localize,l)}).join("")}function HR(e){const t=e.match(LR);return t?t[1].replace(WR,"'"):e}function VR(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const Ci={},so={};function An(e,t){try{const r=(Ci[e]||(Ci[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in so?so[r]:af(r,r.split(":"))}catch{if(e in so)return so[e];const n=e==null?void 0:e.match(YR);return n?af(e,n.slice(1)):NaN}}const YR=/([+-]\d\d):?(\d\d)?/;function af(e,t){const n=+(t[0]||0),r=+(t[1]||0),o=+(t[2]||0)/60;return so[e]=n*60+r>0?n*60+r+o:n*60-r-o}class Ft extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(An(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),Ix(this),mc(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new Ft(...n,t):new Ft(Date.now(),t)}withTimeZone(t){return new Ft(+this,t)}getTimezoneOffset(){const t=-An(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),mc(this),+this}[Symbol.for("constructDateFrom")](t){return new Ft(+new Date(t),this.timeZone)}}const cf=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!cf.test(e))return;const t=e.replace(cf,"$1UTC");Ft.prototype[t]&&(e.startsWith("get")?Ft.prototype[e]=function(){return this.internal[t]()}:(Ft.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),qR(this),+this},Ft.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),mc(this),+this}))});function mc(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-An(e.timeZone,e)*60))}function qR(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Ix(e)}function Ix(e){const t=An(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const o=-new Date(+e).getTimezoneOffset(),s=-new Date(+r).getTimezoneOffset(),a=o-s,i=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&i&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);const c=o-n;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const l=new Date(+e);l.setUTCSeconds(0);const f=o>0?l.getSeconds():(l.getSeconds()-60)%60,d=Math.round(-(An(e.timeZone,e)*60))%60;(d||f)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+d),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+d+f));const h=An(e.timeZone,e),m=h>0?Math.floor(h):Math.ceil(h),p=-new Date(+e).getTimezoneOffset()-m,y=m!==n,v=p-c;if(y&&v){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+v);const b=An(e.timeZone,e),x=b>0?Math.floor(b):Math.ceil(b),j=m-x;j&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+j),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+j))}}class Ve extends Ft{static tz(t,...n){return n.length?new Ve(...n,t):new Ve(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),o=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,o]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${o}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,o]=this.tzComponents();return`${t} GMT${n}${r}${o} (${VR(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),o=String(Math.abs(t)%60).padStart(2,"0");return[n,r,o]}withTimeZone(t){return new Ve(+this,t)}[Symbol.for("constructDateFrom")](t){return new Ve(+new Date(t),this.timeZone)}}const $x=6048e5,GR=864e5,lf=Symbol.for("constructDateFrom");function Ae(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&lf in e?e[lf](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ne(e,t){return Ae(t||e,e)}function zx(e,t,n){const r=Ne(e,n==null?void 0:n.in);return isNaN(t)?Ae(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Lx(e,t,n){const r=Ne(e,n==null?void 0:n.in);if(isNaN(t))return Ae(e,NaN);if(!t)return r;const o=r.getDate(),s=Ae(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const a=s.getDate();return o>=a?s:(r.setFullYear(s.getFullYear(),s.getMonth(),o),r)}let UR={};function Go(){return UR}function Or(e,t){var i,c,l,f;const n=Go(),r=(t==null?void 0:t.weekStartsOn)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(l=n.locale)==null?void 0:l.options)==null?void 0:f.weekStartsOn)??0,o=Ne(e,t==null?void 0:t.in),s=o.getDay(),a=(s<r?7:0)+s-r;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function Mo(e,t){return Or(e,{...t,weekStartsOn:1})}function Wx(e,t){const n=Ne(e,t==null?void 0:t.in),r=n.getFullYear(),o=Ae(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=Mo(o),a=Ae(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const i=Mo(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=i.getTime()?r:r-1}function uf(e){const t=Ne(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Wr(e,...t){const n=Ae.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Po(e,t){const n=Ne(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function Ol(e,t,n){const[r,o]=Wr(n==null?void 0:n.in,e,t),s=Po(r),a=Po(o),i=+s-uf(s),c=+a-uf(a);return Math.round((i-c)/GR)}function XR(e,t){const n=Wx(e,t),r=Ae(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Mo(r)}function KR(e,t,n){return zx(e,t*7,n)}function JR(e,t,n){return Lx(e,t*12,n)}function ZR(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=Ae.bind(null,o));const s=Ne(o,r);(!n||n<s||isNaN(+s))&&(n=s)}),Ae(r,n||NaN)}function QR(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=Ae.bind(null,o));const s=Ne(o,r);(!n||n>s||isNaN(+s))&&(n=s)}),Ae(r,n||NaN)}function eA(e,t,n){const[r,o]=Wr(n==null?void 0:n.in,e,t);return+Po(r)==+Po(o)}function Fx(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function tA(e){return!(!Fx(e)&&typeof e!="number"||isNaN(+Ne(e)))}function Bx(e,t,n){const[r,o]=Wr(n==null?void 0:n.in,e,t),s=r.getFullYear()-o.getFullYear(),a=r.getMonth()-o.getMonth();return s*12+a}function nA(e,t){const n=Ne(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Hx(e,t){const[n,r]=Wr(e,t.start,t.end);return{start:n,end:r}}function rA(e,t){const{start:n,end:r}=Hx(t==null?void 0:t.in,e);let o=+n>+r;const s=o?+n:+r,a=o?r:n;a.setHours(0,0,0,0),a.setDate(1);let i=1;const c=[];for(;+a<=s;)c.push(Ae(n,a)),a.setMonth(a.getMonth()+i);return o?c.reverse():c}function oA(e,t){const n=Ne(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function sA(e,t){const n=Ne(e,t==null?void 0:t.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function Vx(e,t){const n=Ne(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function aA(e,t){const{start:n,end:r}=Hx(t==null?void 0:t.in,e);let o=+n>+r;const s=o?+n:+r,a=o?r:n;a.setHours(0,0,0,0),a.setMonth(0,1);let i=1;const c=[];for(;+a<=s;)c.push(Ae(n,a)),a.setFullYear(a.getFullYear()+i);return o?c.reverse():c}function Yx(e,t){var i,c,l,f;const n=Go(),r=(t==null?void 0:t.weekStartsOn)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(l=n.locale)==null?void 0:l.options)==null?void 0:f.weekStartsOn)??0,o=Ne(e,t==null?void 0:t.in),s=o.getDay(),a=(s<r?-7:0)+6-(s-r);return o.setDate(o.getDate()+a),o.setHours(23,59,59,999),o}function iA(e,t){return Yx(e,{...t,weekStartsOn:1})}const cA={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},lA=(e,t,n)=>{let r;const o=cA[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Ni(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const uA={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},dA={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},fA={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},hA={date:Ni({formats:uA,defaultWidth:"full"}),time:Ni({formats:dA,defaultWidth:"full"}),dateTime:Ni({formats:fA,defaultWidth:"full"})},mA={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},pA=(e,t,n,r)=>mA[e];function Jr(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,i=n!=null&&n.width?String(n.width):a;o=e.formattingValues[i]||e.formattingValues[a]}else{const a=e.defaultWidth,i=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[i]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const gA={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yA={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},xA={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},vA={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},bA={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},wA={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},jA=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},SA={ordinalNumber:jA,era:Jr({values:gA,defaultWidth:"wide"}),quarter:Jr({values:yA,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Jr({values:xA,defaultWidth:"wide"}),day:Jr({values:vA,defaultWidth:"wide"}),dayPeriod:Jr({values:bA,defaultWidth:"wide",formattingValues:wA,defaultFormattingWidth:"wide"})};function Zr(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const a=s[0],i=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?NA(i,d=>d.test(a)):CA(i,d=>d.test(a));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const f=t.slice(a.length);return{value:l,rest:f}}}function CA(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function NA(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function EA(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const i=t.slice(o.length);return{value:a,rest:i}}}const _A=/^(\d+)(th|st|nd|rd)?/i,kA=/\d+/i,MA={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},PA={any:[/^b/i,/^(a|c)/i]},DA={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},OA={any:[/1/i,/2/i,/3/i,/4/i]},RA={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},AA={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},TA={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},IA={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},$A={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},zA={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},LA={ordinalNumber:EA({matchPattern:_A,parsePattern:kA,valueCallback:e=>parseInt(e,10)}),era:Zr({matchPatterns:MA,defaultMatchWidth:"wide",parsePatterns:PA,defaultParseWidth:"any"}),quarter:Zr({matchPatterns:DA,defaultMatchWidth:"wide",parsePatterns:OA,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Zr({matchPatterns:RA,defaultMatchWidth:"wide",parsePatterns:AA,defaultParseWidth:"any"}),day:Zr({matchPatterns:TA,defaultMatchWidth:"wide",parsePatterns:IA,defaultParseWidth:"any"}),dayPeriod:Zr({matchPatterns:$A,defaultMatchWidth:"any",parsePatterns:zA,defaultParseWidth:"any"})},cr={code:"en-US",formatDistance:lA,formatLong:hA,formatRelative:pA,localize:SA,match:LA,options:{weekStartsOn:0,firstWeekContainsDate:1}};function WA(e,t){const n=Ne(e,t==null?void 0:t.in);return Ol(n,Vx(n))+1}function Rl(e,t){const n=Ne(e,t==null?void 0:t.in),r=+Mo(n)-+XR(n);return Math.round(r/$x)+1}function qx(e,t){var f,d,h,m;const n=Ne(e,t==null?void 0:t.in),r=n.getFullYear(),o=Go(),s=(t==null?void 0:t.firstWeekContainsDate)??((d=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((m=(h=o.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,a=Ae((t==null?void 0:t.in)||e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const i=Or(a,t),c=Ae((t==null?void 0:t.in)||e,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const l=Or(c,t);return+n>=+i?r+1:+n>=+l?r:r-1}function FA(e,t){var i,c,l,f;const n=Go(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(l=n.locale)==null?void 0:l.options)==null?void 0:f.firstWeekContainsDate)??1,o=qx(e,t),s=Ae((t==null?void 0:t.in)||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),Or(s,t)}function Al(e,t){const n=Ne(e,t==null?void 0:t.in),r=+Or(n,t)-+FA(n,t);return Math.round(r/$x)+1}function Se(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const pn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Se(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Se(n+1,2)},d(e,t){return Se(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Se(e.getHours()%12||12,t.length)},H(e,t){return Se(e.getHours(),t.length)},m(e,t){return Se(e.getMinutes(),t.length)},s(e,t){return Se(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Se(o,t.length)}},sr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},df={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return pn.y(e,t)},Y:function(e,t,n,r){const o=qx(e,r),s=o>0?o:1-o;if(t==="YY"){const a=s%100;return Se(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Se(s,t.length)},R:function(e,t){const n=Wx(e);return Se(n,t.length)},u:function(e,t){const n=e.getFullYear();return Se(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Se(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Se(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return pn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Se(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=Al(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Se(o,t.length)},I:function(e,t,n){const r=Rl(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Se(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):pn.d(e,t)},D:function(e,t,n){const r=WA(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Se(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Se(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Se(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return Se(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=sr.noon:r===0?o=sr.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=sr.evening:r>=12?o=sr.afternoon:r>=4?o=sr.morning:o=sr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return pn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):pn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Se(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Se(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):pn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):pn.s(e,t)},S:function(e,t){return pn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return hf(r);case"XXXX":case"XX":return Dn(r);case"XXXXX":case"XXX":default:return Dn(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return hf(r);case"xxxx":case"xx":return Dn(r);case"xxxxx":case"xxx":default:return Dn(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ff(r,":");case"OOOO":default:return"GMT"+Dn(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ff(r,":");case"zzzz":default:return"GMT"+Dn(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Se(r,t.length)},T:function(e,t,n){return Se(+e,t.length)}};function ff(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+Se(s,2)}function hf(e,t){return e%60===0?(e>0?"-":"+")+Se(Math.abs(e)/60,2):Dn(e,t)}function Dn(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Se(Math.trunc(r/60),2),s=Se(r%60,2);return n+o+t+s}const mf=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Gx=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},BA=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return mf(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",mf(r,t)).replace("{{time}}",Gx(o,t))},HA={p:Gx,P:BA},VA=/^D+$/,YA=/^Y+$/,qA=["D","DD","YY","YYYY"];function GA(e){return VA.test(e)}function UA(e){return YA.test(e)}function XA(e,t,n){const r=KA(e,t,n);if(console.warn(r),qA.includes(e))throw new RangeError(r)}function KA(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const JA=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ZA=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,QA=/^'([^]*?)'?$/,eT=/''/g,tT=/[a-zA-Z]/;function ao(e,t,n){var f,d,h,m,g,p,y,v;const r=Go(),o=(n==null?void 0:n.locale)??r.locale??cr,s=(n==null?void 0:n.firstWeekContainsDate)??((d=(f=n==null?void 0:n.locale)==null?void 0:f.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??((p=(g=n==null?void 0:n.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??r.weekStartsOn??((v=(y=r.locale)==null?void 0:y.options)==null?void 0:v.weekStartsOn)??0,i=Ne(e,n==null?void 0:n.in);if(!tA(i))throw new RangeError("Invalid time value");let c=t.match(ZA).map(b=>{const x=b[0];if(x==="p"||x==="P"){const j=HA[x];return j(b,o.formatLong)}return b}).join("").match(JA).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const x=b[0];if(x==="'")return{isToken:!1,value:nT(b)};if(df[x])return{isToken:!0,value:b};if(x.match(tT))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:b}});o.localize.preprocessor&&(c=o.localize.preprocessor(i,c));const l={firstWeekContainsDate:s,weekStartsOn:a,locale:o};return c.map(b=>{if(!b.isToken)return b.value;const x=b.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&UA(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&GA(x))&&XA(x,t,String(e));const j=df[x[0]];return j(i,x,o.localize,l)}).join("")}function nT(e){const t=e.match(QA);return t?t[1].replace(eT,"'"):e}function rT(e,t){const n=Ne(e,t==null?void 0:t.in),r=n.getFullYear(),o=n.getMonth(),s=Ae(n,0);return s.setFullYear(r,o+1,0),s.setHours(0,0,0,0),s.getDate()}function oT(e,t){return Ne(e,t==null?void 0:t.in).getMonth()}function sT(e,t){return Ne(e,t==null?void 0:t.in).getFullYear()}function aT(e,t){return+Ne(e)>+Ne(t)}function iT(e,t){return+Ne(e)<+Ne(t)}function cT(e,t,n){const[r,o]=Wr(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}function lT(e,t,n){const[r,o]=Wr(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()}function uT(e,t,n){const r=Ne(e,n==null?void 0:n.in),o=r.getFullYear(),s=r.getDate(),a=Ae(e,0);a.setFullYear(o,t,15),a.setHours(0,0,0,0);const i=rT(a);return r.setMonth(t,Math.min(s,i)),r}function dT(e,t,n){const r=Ne(e,n==null?void 0:n.in);return isNaN(+r)?Ae(e,NaN):(r.setFullYear(t),r)}const pf=5,fT=4;function hT(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,o=t.addDays(e,-r+1),s=t.addDays(o,pf*7-1);return t.getMonth(e)===t.getMonth(s)?pf:fT}function Ux(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-1*6):t.addDays(n,-1*(r-1))}function mT(e,t){const n=Ux(e,t),r=hT(e,t);return t.addDays(n,r*7-1)}const Xx={...cr,labels:{labelDayButton:(e,t,n,r)=>{let o;r&&typeof r.format=="function"?o=r.format.bind(r):o=(a,i)=>ao(a,i,{locale:cr,...n});let s=o(e,"PPPP");return t.today&&(s=`Today, ${s}`),t.selected&&(s=`${s}, selected`),s},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(o,s)=>ao(o,s,{locale:cr,...t}),r(e,"LLLL yyyy")},labelGridcell:(e,t,n,r)=>{let o;r&&typeof r.format=="function"?o=r.format.bind(r):o=(a,i)=>ao(a,i,{locale:cr,...n});let s=o(e,"PPPP");return t!=null&&t.today&&(s=`Today, ${s}`),s},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(o,s)=>ao(o,s,{locale:cr,...t}),r(e,"cccc")}}};class lt{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?Ve.tz(this.options.timeZone):new this.Date},this.newDate=(r,o,s)=>{var a;return(a=this.overrides)!=null&&a.newDate?this.overrides.newDate(r,o,s):this.options.timeZone?new Ve(r,o,s,this.options.timeZone):new Date(r,o,s)},this.addDays=(r,o)=>{var s;return(s=this.overrides)!=null&&s.addDays?this.overrides.addDays(r,o):zx(r,o)},this.addMonths=(r,o)=>{var s;return(s=this.overrides)!=null&&s.addMonths?this.overrides.addMonths(r,o):Lx(r,o)},this.addWeeks=(r,o)=>{var s;return(s=this.overrides)!=null&&s.addWeeks?this.overrides.addWeeks(r,o):KR(r,o)},this.addYears=(r,o)=>{var s;return(s=this.overrides)!=null&&s.addYears?this.overrides.addYears(r,o):JR(r,o)},this.differenceInCalendarDays=(r,o)=>{var s;return(s=this.overrides)!=null&&s.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,o):Ol(r,o)},this.differenceInCalendarMonths=(r,o)=>{var s;return(s=this.overrides)!=null&&s.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,o):Bx(r,o)},this.eachMonthOfInterval=r=>{var o;return(o=this.overrides)!=null&&o.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):rA(r)},this.eachYearOfInterval=r=>{var i;const o=(i=this.overrides)!=null&&i.eachYearOfInterval?this.overrides.eachYearOfInterval(r):aA(r),s=new Set(o.map(c=>this.getYear(c)));if(s.size===o.length)return o;const a=[];return s.forEach(c=>{a.push(new Date(c,0,1))}),a},this.endOfBroadcastWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):mT(r,this)},this.endOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfISOWeek?this.overrides.endOfISOWeek(r):iA(r)},this.endOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.endOfMonth?this.overrides.endOfMonth(r):nA(r)},this.endOfWeek=(r,o)=>{var s;return(s=this.overrides)!=null&&s.endOfWeek?this.overrides.endOfWeek(r,o):Yx(r,this.options)},this.endOfYear=r=>{var o;return(o=this.overrides)!=null&&o.endOfYear?this.overrides.endOfYear(r):sA(r)},this.format=(r,o,s)=>{var i;const a=(i=this.overrides)!=null&&i.format?this.overrides.format(r,o,this.options):ao(r,o,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(a):a},this.getISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.getISOWeek?this.overrides.getISOWeek(r):Rl(r)},this.getMonth=(r,o)=>{var s;return(s=this.overrides)!=null&&s.getMonth?this.overrides.getMonth(r,this.options):oT(r,this.options)},this.getYear=(r,o)=>{var s;return(s=this.overrides)!=null&&s.getYear?this.overrides.getYear(r,this.options):sT(r,this.options)},this.getWeek=(r,o)=>{var s;return(s=this.overrides)!=null&&s.getWeek?this.overrides.getWeek(r,this.options):Al(r,this.options)},this.isAfter=(r,o)=>{var s;return(s=this.overrides)!=null&&s.isAfter?this.overrides.isAfter(r,o):aT(r,o)},this.isBefore=(r,o)=>{var s;return(s=this.overrides)!=null&&s.isBefore?this.overrides.isBefore(r,o):iT(r,o)},this.isDate=r=>{var o;return(o=this.overrides)!=null&&o.isDate?this.overrides.isDate(r):Fx(r)},this.isSameDay=(r,o)=>{var s;return(s=this.overrides)!=null&&s.isSameDay?this.overrides.isSameDay(r,o):eA(r,o)},this.isSameMonth=(r,o)=>{var s;return(s=this.overrides)!=null&&s.isSameMonth?this.overrides.isSameMonth(r,o):cT(r,o)},this.isSameYear=(r,o)=>{var s;return(s=this.overrides)!=null&&s.isSameYear?this.overrides.isSameYear(r,o):lT(r,o)},this.max=r=>{var o;return(o=this.overrides)!=null&&o.max?this.overrides.max(r):ZR(r)},this.min=r=>{var o;return(o=this.overrides)!=null&&o.min?this.overrides.min(r):QR(r)},this.setMonth=(r,o)=>{var s;return(s=this.overrides)!=null&&s.setMonth?this.overrides.setMonth(r,o):uT(r,o)},this.setYear=(r,o)=>{var s;return(s=this.overrides)!=null&&s.setYear?this.overrides.setYear(r,o):dT(r,o)},this.startOfBroadcastWeek=(r,o)=>{var s;return(s=this.overrides)!=null&&s.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):Ux(r,this)},this.startOfDay=r=>{var o;return(o=this.overrides)!=null&&o.startOfDay?this.overrides.startOfDay(r):Po(r)},this.startOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.startOfISOWeek?this.overrides.startOfISOWeek(r):Mo(r)},this.startOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.startOfMonth?this.overrides.startOfMonth(r):oA(r)},this.startOfWeek=(r,o)=>{var s;return(s=this.overrides)!=null&&s.startOfWeek?this.overrides.startOfWeek(r,this.options):Or(r,this.options)},this.startOfYear=r=>{var o;return(o=this.overrides)!=null&&o.startOfYear?this.overrides.startOfYear(r):Vx(r)},this.options={locale:Xx,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let o=0;o<10;o++)r[o.toString()]=n.format(o);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&<.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:o}=this.options,s=n==null?void 0:n.code;if(s&<.yearFirstLocales.has(s))try{return new Intl.DateTimeFormat(s,{month:"long",year:"numeric",timeZone:r,numberingSystem:o}).format(t)}catch{}const a=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,a)}}lt.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Ut=new lt;class Kx{constructor(t,n,r=Ut){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r,this.isoDate=r.format(t,"yyyy-MM-dd"),this.displayMonthId=r.format(n,"yyyy-MM"),this.dateMonthId=r.format(t,"yyyy-MM")}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class pT{constructor(t,n){this.date=t,this.weeks=n}}class gT{constructor(t,n){this.days=n,this.weekNumber=t}}function yT(e){return C.createElement("button",{...e})}function xT(e){return C.createElement("span",{...e})}function vT(e){const{size:t=24,orientation:n="left",className:r}=e;return C.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&C.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&C.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&C.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&C.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function bT(e){const{day:t,modifiers:n,...r}=e;return C.createElement("td",{...r})}function wT(e){const{day:t,modifiers:n,...r}=e,o=C.useRef(null);return C.useEffect(()=>{var s;n.focused&&((s=o.current)==null||s.focus())},[n.focused]),C.createElement("button",{ref:o,...r})}var ne;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(ne||(ne={}));var De;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(De||(De={}));var bt;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(bt||(bt={}));var nt;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(nt||(nt={}));function jT(e){const{options:t,className:n,components:r,classNames:o,...s}=e,a=[o[ne.Dropdown],n].join(" "),i=t==null?void 0:t.find(({value:c})=>c===s.value);return C.createElement("span",{"data-disabled":s.disabled,className:o[ne.DropdownRoot]},C.createElement(r.Select,{className:a,...s},t==null?void 0:t.map(({value:c,label:l,disabled:f})=>C.createElement(r.Option,{key:c,value:c,disabled:f},l))),C.createElement("span",{className:o[ne.CaptionLabel],"aria-hidden":!0},i==null?void 0:i.label,C.createElement(r.Chevron,{orientation:"down",size:18,className:o[ne.Chevron]})))}function ST(e){return C.createElement("div",{...e})}function CT(e){return C.createElement("div",{...e})}function NT(e){const{calendarMonth:t,displayIndex:n,...r}=e;return C.createElement("div",{...r},e.children)}function ET(e){const{calendarMonth:t,displayIndex:n,...r}=e;return C.createElement("div",{...r})}function _T(e){return C.createElement("table",{...e})}function kT(e){return C.createElement("div",{...e})}const Jx=C.createContext(void 0);function Uo(){const e=C.useContext(Jx);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function MT(e){const{components:t}=Uo();return C.createElement(t.Dropdown,{...e})}function PT(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:o,...s}=e,{components:a,classNames:i,labels:{labelPrevious:c,labelNext:l}}=Uo(),f=C.useCallback(h=>{o&&(n==null||n(h))},[o,n]),d=C.useCallback(h=>{r&&(t==null||t(h))},[r,t]);return C.createElement("nav",{...s},C.createElement(a.PreviousMonthButton,{type:"button",className:i[ne.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:d},C.createElement(a.Chevron,{disabled:r?void 0:!0,className:i[ne.Chevron],orientation:"left"})),C.createElement(a.NextMonthButton,{type:"button",className:i[ne.NextMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":l(o),onClick:f},C.createElement(a.Chevron,{disabled:o?void 0:!0,orientation:"right",className:i[ne.Chevron]})))}function DT(e){const{components:t}=Uo();return C.createElement(t.Button,{...e})}function OT(e){return C.createElement("option",{...e})}function RT(e){const{components:t}=Uo();return C.createElement(t.Button,{...e})}function AT(e){const{rootRef:t,...n}=e;return C.createElement("div",{...n,ref:t})}function TT(e){return C.createElement("select",{...e})}function IT(e){const{week:t,...n}=e;return C.createElement("tr",{...n})}function $T(e){return C.createElement("th",{...e})}function zT(e){return C.createElement("thead",{"aria-hidden":!0},C.createElement("tr",{...e}))}function LT(e){const{week:t,...n}=e;return C.createElement("th",{...n})}function WT(e){return C.createElement("th",{...e})}function FT(e){return C.createElement("tbody",{...e})}function BT(e){const{components:t}=Uo();return C.createElement(t.Dropdown,{...e})}const HT=Object.freeze(Object.defineProperty({__proto__:null,Button:yT,CaptionLabel:xT,Chevron:vT,Day:bT,DayButton:wT,Dropdown:jT,DropdownNav:ST,Footer:CT,Month:NT,MonthCaption:ET,MonthGrid:_T,Months:kT,MonthsDropdown:MT,Nav:PT,NextMonthButton:DT,Option:OT,PreviousMonthButton:RT,Root:AT,Select:TT,Week:IT,WeekNumber:LT,WeekNumberHeader:WT,Weekday:$T,Weekdays:zT,Weeks:FT,YearsDropdown:BT},Symbol.toStringTag,{value:"Module"}));function rn(e,t,n=!1,r=Ut){let{from:o,to:s}=e;const{differenceInCalendarDays:a,isSameDay:i}=r;return o&&s?(a(s,o)<0&&([o,s]=[s,o]),a(t,o)>=(n?1:0)&&a(s,t)>=(n?1:0)):!n&&s?i(s,t):!n&&o?i(o,t):!1}function Tl(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Va(e){return!!(e&&typeof e=="object"&&"from"in e)}function Il(e){return!!(e&&typeof e=="object"&&"after"in e)}function $l(e){return!!(e&&typeof e=="object"&&"before"in e)}function Zx(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Qx(e,t){return Array.isArray(e)&&e.every(t.isDate)}function on(e,t,n=Ut){const r=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:s,isAfter:a}=n;return r.some(i=>{if(typeof i=="boolean")return i;if(n.isDate(i))return o(e,i);if(Qx(i,n))return i.some(c=>o(e,c));if(Va(i))return rn(i,e,!1,n);if(Zx(i))return Array.isArray(i.dayOfWeek)?i.dayOfWeek.includes(e.getDay()):i.dayOfWeek===e.getDay();if(Tl(i)){const c=s(i.before,e),l=s(i.after,e),f=c>0,d=l<0;return a(i.before,i.after)?d&&f:f||d}return Il(i)?s(e,i.after)>0:$l(i)?s(i.before,e)>0:typeof i=="function"?i(e):!1})}function VT(e,t,n,r,o){const{disabled:s,hidden:a,modifiers:i,showOutsideDays:c,broadcastCalendar:l,today:f=o.today()}=t,{isSameDay:d,isSameMonth:h,startOfMonth:m,isBefore:g,endOfMonth:p,isAfter:y}=o,v=n&&m(n),b=r&&p(r),x={[De.focused]:[],[De.outside]:[],[De.disabled]:[],[De.hidden]:[],[De.today]:[]},j={};for(const N of e){const{date:S,displayMonth:E}=N,O=!!(E&&!h(S,E)),P=!!(v&&g(S,v)),T=!!(b&&y(S,b)),k=!!(s&&on(S,s,o)),M=!!(a&&on(S,a,o))||P||T||!l&&!c&&O||l&&c===!1&&O,W=d(S,f);O&&x.outside.push(N),k&&x.disabled.push(N),M&&x.hidden.push(N),W&&x.today.push(N),i&&Object.keys(i).forEach(_=>{const I=i==null?void 0:i[_];I&&on(S,I,o)&&(j[_]?j[_].push(N):j[_]=[N])})}return N=>{const S={[De.focused]:!1,[De.disabled]:!1,[De.hidden]:!1,[De.outside]:!1,[De.today]:!1},E={};for(const O in x){const P=x[O];S[O]=P.some(T=>T===N)}for(const O in j)E[O]=j[O].some(P=>P===N);return{...S,...E}}}function YT(e,t,n={}){return Object.entries(e).filter(([,o])=>o===!0).reduce((o,[s])=>(n[s]?o.push(n[s]):t[De[s]]?o.push(t[De[s]]):t[bt[s]]&&o.push(t[bt[s]]),o),[t[ne.Day]])}function qT(e){return{...HT,...e}}function GT(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function UT(){const e={};for(const t in ne)e[ne[t]]=`rdp-${ne[t]}`;for(const t in De)e[De[t]]=`rdp-${De[t]}`;for(const t in bt)e[bt[t]]=`rdp-${bt[t]}`;for(const t in nt)e[nt[t]]=`rdp-${nt[t]}`;return e}function ev(e,t,n){return(n??new lt(t)).formatMonthYear(e)}const XT=ev;function KT(e,t,n){return(n??new lt(t)).format(e,"d")}function JT(e,t=Ut){return t.format(e,"LLLL")}function ZT(e,t,n){return(n??new lt(t)).format(e,"cccccc")}function QT(e,t=Ut){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function eI(){return""}function tv(e,t=Ut){return t.format(e,"yyyy")}const tI=tv,nI=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:ev,formatDay:KT,formatMonthCaption:XT,formatMonthDropdown:JT,formatWeekNumber:QT,formatWeekNumberHeader:eI,formatWeekdayName:ZT,formatYearCaption:tI,formatYearDropdown:tv},Symbol.toStringTag,{value:"Module"}));function rI(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...nI,...e}}function zl(e,t,n,r){let o=(r??new lt(n)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const oI=zl;function Ll(e,t,n){return(n??new lt(t)).formatMonthYear(e)}const sI=Ll;function nv(e,t,n,r){let o=(r??new lt(n)).format(e,"PPPP");return t!=null&&t.today&&(o=`Today, ${o}`),o}function rv(e){return"Choose the Month"}function ov(){return""}const aI="Go to the Next Month";function sv(e,t){return aI}function av(e){return"Go to the Previous Month"}function iv(e,t,n){return(n??new lt(t)).format(e,"cccc")}function cv(e,t){return`Week ${e}`}function lv(e){return"Week Number"}function uv(e){return"Choose the Year"}const iI=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:sI,labelDay:oI,labelDayButton:zl,labelGrid:Ll,labelGridcell:nv,labelMonthDropdown:rv,labelNav:ov,labelNext:sv,labelPrevious:av,labelWeekNumber:cv,labelWeekNumberHeader:lv,labelWeekday:iv,labelYearDropdown:uv},Symbol.toStringTag,{value:"Module"})),ht=(e,t,n)=>t||(n?typeof n=="function"?n:(...r)=>n:e);function cI(e,t){var r;const n=((r=t.locale)==null?void 0:r.labels)??{};return{...iI,...e??{},labelDayButton:ht(zl,e==null?void 0:e.labelDayButton,n.labelDayButton),labelMonthDropdown:ht(rv,e==null?void 0:e.labelMonthDropdown,n.labelMonthDropdown),labelNext:ht(sv,e==null?void 0:e.labelNext,n.labelNext),labelPrevious:ht(av,e==null?void 0:e.labelPrevious,n.labelPrevious),labelWeekNumber:ht(cv,e==null?void 0:e.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:ht(uv,e==null?void 0:e.labelYearDropdown,n.labelYearDropdown),labelGrid:ht(Ll,e==null?void 0:e.labelGrid,n.labelGrid),labelGridcell:ht(nv,e==null?void 0:e.labelGridcell,n.labelGridcell),labelNav:ht(ov,e==null?void 0:e.labelNav,n.labelNav),labelWeekNumberHeader:ht(lv,e==null?void 0:e.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:ht(iv,e==null?void 0:e.labelWeekday,n.labelWeekday)}}function lI(e,t,n,r,o){const{startOfMonth:s,startOfYear:a,endOfYear:i,eachMonthOfInterval:c,getMonth:l}=o;return c({start:a(e),end:i(e)}).map(h=>{const m=r.formatMonthDropdown(h,o),g=l(h),p=t&&h<s(t)||n&&h>s(n)||!1;return{value:g,label:m,disabled:p}})}function uI(e,t={},n={}){let r={...t==null?void 0:t[ne.Day]};return Object.entries(e).filter(([,o])=>o===!0).forEach(([o])=>{r={...r,...n==null?void 0:n[o]}}),r}function dI(e,t,n,r){const o=r??e.today(),s=n?e.startOfBroadcastWeek(o,e):t?e.startOfISOWeek(o):e.startOfWeek(o),a=[];for(let i=0;i<7;i++){const c=e.addDays(s,i);a.push(c)}return a}function fI(e,t,n,r,o=!1){if(!e||!t)return;const{startOfYear:s,endOfYear:a,eachYearOfInterval:i,getYear:c}=r,l=s(e),f=a(t),d=i({start:l,end:f});return o&&d.reverse(),d.map(h=>{const m=n.formatYearDropdown(h,r);return{value:c(h),label:m,disabled:!1}})}function hI(e,t={}){var i;const{weekStartsOn:n,locale:r}=t,o=n??((i=r==null?void 0:r.options)==null?void 0:i.weekStartsOn)??0,s=c=>{const l=typeof c=="number"||typeof c=="string"?new Date(c):c;return new Ve(l.getFullYear(),l.getMonth(),l.getDate(),12,0,0,e)},a=c=>{const l=s(c);return new Date(l.getFullYear(),l.getMonth(),l.getDate(),0,0,0,0)};return{today:()=>s(Ve.tz(e)),newDate:(c,l,f)=>new Ve(c,l,f,12,0,0,e),startOfDay:c=>s(c),startOfWeek:(c,l)=>{const f=s(c),d=(l==null?void 0:l.weekStartsOn)??o,h=(f.getDay()-d+7)%7;return f.setDate(f.getDate()-h),f},startOfISOWeek:c=>{const l=s(c),f=(l.getDay()-1+7)%7;return l.setDate(l.getDate()-f),l},startOfMonth:c=>{const l=s(c);return l.setDate(1),l},startOfYear:c=>{const l=s(c);return l.setMonth(0,1),l},endOfWeek:(c,l)=>{const f=s(c),m=((((l==null?void 0:l.weekStartsOn)??o)+6)%7-f.getDay()+7)%7;return f.setDate(f.getDate()+m),f},endOfISOWeek:c=>{const l=s(c),f=(7-l.getDay())%7;return l.setDate(l.getDate()+f),l},endOfMonth:c=>{const l=s(c);return l.setMonth(l.getMonth()+1,0),l},endOfYear:c=>{const l=s(c);return l.setMonth(11,31),l},eachMonthOfInterval:c=>{const l=s(c.start),f=s(c.end),d=[],h=new Ve(l.getFullYear(),l.getMonth(),1,12,0,0,e),m=f.getFullYear()*12+f.getMonth();for(;h.getFullYear()*12+h.getMonth()<=m;)d.push(new Ve(h,e)),h.setMonth(h.getMonth()+1,1);return d},addDays:(c,l)=>{const f=s(c);return f.setDate(f.getDate()+l),f},addWeeks:(c,l)=>{const f=s(c);return f.setDate(f.getDate()+l*7),f},addMonths:(c,l)=>{const f=s(c);return f.setMonth(f.getMonth()+l),f},addYears:(c,l)=>{const f=s(c);return f.setFullYear(f.getFullYear()+l),f},eachYearOfInterval:c=>{const l=s(c.start),f=s(c.end),d=[],h=new Ve(l.getFullYear(),0,1,12,0,0,e);for(;h.getFullYear()<=f.getFullYear();)d.push(new Ve(h,e)),h.setFullYear(h.getFullYear()+1,0,1);return d},getWeek:(c,l)=>{var d;const f=a(c);return Al(f,{weekStartsOn:(l==null?void 0:l.weekStartsOn)??o,firstWeekContainsDate:(l==null?void 0:l.firstWeekContainsDate)??((d=r==null?void 0:r.options)==null?void 0:d.firstWeekContainsDate)??1})},getISOWeek:c=>{const l=a(c);return Rl(l)},differenceInCalendarDays:(c,l)=>{const f=a(c),d=a(l);return Ol(f,d)},differenceInCalendarMonths:(c,l)=>{const f=a(c),d=a(l);return Bx(f,d)}}}const Xo=e=>e instanceof HTMLElement?e:null,Ei=e=>[...e.querySelectorAll("[data-animated-month]")??[]],mI=e=>Xo(e.querySelector("[data-animated-month]")),_i=e=>Xo(e.querySelector("[data-animated-caption]")),ki=e=>Xo(e.querySelector("[data-animated-weeks]")),pI=e=>Xo(e.querySelector("[data-animated-nav]")),gI=e=>Xo(e.querySelector("[data-animated-weekdays]"));function yI(e,t,{classNames:n,months:r,focused:o,dateLib:s}){const a=C.useRef(null),i=C.useRef(r),c=C.useRef(!1);C.useLayoutEffect(()=>{const l=i.current;if(i.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||l.length===0||r.length!==l.length)return;const f=s.isSameMonth(r[0].date,l[0].date),d=s.isAfter(r[0].date,l[0].date),h=d?n[nt.caption_after_enter]:n[nt.caption_before_enter],m=d?n[nt.weeks_after_enter]:n[nt.weeks_before_enter],g=a.current,p=e.current.cloneNode(!0);if(p instanceof HTMLElement?(Ei(p).forEach(x=>{if(!(x instanceof HTMLElement))return;const j=mI(x);j&&x.contains(j)&&x.removeChild(j);const N=_i(x);N&&N.classList.remove(h);const S=ki(x);S&&S.classList.remove(m)}),a.current=p):a.current=null,c.current||f||o)return;const y=g instanceof HTMLElement?Ei(g):[],v=Ei(e.current);if(v!=null&&v.every(b=>b instanceof HTMLElement)&&y&&y.every(b=>b instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const b=pI(e.current);b&&(b.style.zIndex="1"),v.forEach((x,j)=>{const N=y[j];if(!N)return;x.style.position="relative",x.style.overflow="hidden";const S=_i(x);S&&S.classList.add(h);const E=ki(x);E&&E.classList.add(m);const O=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),b&&(b.style.zIndex=""),S&&S.classList.remove(h),E&&E.classList.remove(m),x.style.position="",x.style.overflow="",x.contains(N)&&x.removeChild(N)};N.style.pointerEvents="none",N.style.position="absolute",N.style.overflow="hidden",N.setAttribute("aria-hidden","true");const P=gI(N);P&&(P.style.opacity="0");const T=_i(N);T&&(T.classList.add(d?n[nt.caption_before_exit]:n[nt.caption_after_exit]),T.addEventListener("animationend",O));const k=ki(N);k&&k.classList.add(d?n[nt.weeks_before_exit]:n[nt.weeks_after_exit]),x.insertBefore(N,x.firstChild)})}})}function xI(e,t,n,r){const o=e[0],s=e[e.length-1],{ISOWeek:a,fixedWeeks:i,broadcastCalendar:c}=n??{},{addDays:l,differenceInCalendarDays:f,differenceInCalendarMonths:d,endOfBroadcastWeek:h,endOfISOWeek:m,endOfMonth:g,endOfWeek:p,isAfter:y,startOfBroadcastWeek:v,startOfISOWeek:b,startOfWeek:x}=r,j=c?v(o,r):a?b(o):x(o),N=c?h(s):a?m(g(s)):p(g(s)),S=t&&(c?h(t):a?m(t):p(t)),E=S&&y(N,S)?S:N,O=f(E,j),P=d(s,o)+1,T=[];for(let W=0;W<=O;W++){const _=l(j,W);T.push(_)}const M=(c?35:42)*P;if(i&&T.length<M){const W=M-T.length;for(let _=0;_<W;_++){const I=l(T[T.length-1],1);T.push(I)}}return T}function vI(e){const t=[];return e.reduce((n,r)=>{const o=r.weeks.reduce((s,a)=>s.concat(a.days.slice()),t.slice());return n.concat(o.slice())},t.slice())}function bI(e,t,n,r){const{numberOfMonths:o=1}=n,s=[];for(let a=0;a<o;a++){const i=r.addMonths(e,a);if(t&&i>t)break;s.push(i)}return s}function gf(e,t,n,r){const{month:o,defaultMonth:s,today:a=r.today(),numberOfMonths:i=1}=e;let c=o||s||a;const{differenceInCalendarMonths:l,addMonths:f,startOfMonth:d}=r;if(n&&l(n,c)<i-1){const h=-1*(i-1);c=f(n,h)}return t&&l(c,t)<0&&(c=t),d(c)}function wI(e,t,n,r){const{addDays:o,endOfBroadcastWeek:s,endOfISOWeek:a,endOfMonth:i,endOfWeek:c,getISOWeek:l,getWeek:f,startOfBroadcastWeek:d,startOfISOWeek:h,startOfWeek:m}=r,g=e.reduce((p,y)=>{const v=n.broadcastCalendar?d(y,r):n.ISOWeek?h(y):m(y),b=n.broadcastCalendar?s(y):n.ISOWeek?a(i(y)):c(i(y)),x=t.filter(E=>E>=v&&E<=b),j=n.broadcastCalendar?35:42;if(n.fixedWeeks&&x.length<j){const E=t.filter(O=>{const P=j-x.length;return O>b&&O<=o(b,P)});x.push(...E)}const N=x.reduce((E,O)=>{const P=n.ISOWeek?l(O):f(O),T=E.find(M=>M.weekNumber===P),k=new Kx(O,y,r);return T?T.days.push(k):E.push(new gT(P,[k])),E},[]),S=new pT(y,N);return p.push(S),p},[]);return n.reverseMonths?g.reverse():g}function jI(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:o,startOfDay:s,startOfMonth:a,endOfMonth:i,addYears:c,endOfYear:l,newDate:f,today:d}=t,{fromYear:h,toYear:m,fromMonth:g,toMonth:p}=e;!n&&g&&(n=g),!n&&h&&(n=t.newDate(h,0,1)),!r&&p&&(r=p),!r&&m&&(r=f(m,11,31));const y=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=a(n):h?n=f(h,0,1):!n&&y&&(n=o(c(e.today??d(),-100))),r?r=i(r):m?r=f(m,11,31):!r&&y&&(r=l(e.today??d())),[n&&s(n),r&&s(r)]}function SI(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:s=1}=n,{startOfMonth:a,addMonths:i,differenceInCalendarMonths:c}=r,l=o?s:1,f=a(e);if(!t)return i(f,l);if(!(c(t,e)<s))return i(f,l)}function CI(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:s}=n,{startOfMonth:a,addMonths:i,differenceInCalendarMonths:c}=r,l=o?s??1:1,f=a(e);if(!t)return i(f,-l);if(!(c(f,t)<=0))return i(f,-l)}function NI(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function Ya(e,t){const[n,r]=C.useState(e);return[t===void 0?n:t,r]}function EI(e,t){var j;const[n,r]=jI(e,t),{startOfMonth:o,endOfMonth:s}=t,a=gf(e,n,r,t),[i,c]=Ya(a,e.month?a:void 0);C.useEffect(()=>{const N=gf(e,n,r,t);c(N)},[e.timeZone]);const{months:l,weeks:f,days:d,previousMonth:h,nextMonth:m}=C.useMemo(()=>{const N=bI(i,r,{numberOfMonths:e.numberOfMonths},t),S=xI(N,e.endMonth?s(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),E=wI(N,S,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),O=NI(E),P=vI(E),T=CI(i,n,e,t),k=SI(i,r,e,t);return{months:E,weeks:O,days:P,previousMonth:T,nextMonth:k}},[t,i.getTime(),r==null?void 0:r.getTime(),n==null?void 0:n.getTime(),e.disableNavigation,e.broadcastCalendar,(j=e.endMonth)==null?void 0:j.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:g,onMonthChange:p}=e,y=N=>f.some(S=>S.days.some(E=>E.isEqualTo(N))),v=N=>{if(g)return;let S=o(N);n&&S<o(n)&&(S=o(n)),r&&S>o(r)&&(S=o(r)),c(S),p==null||p(S)};return{months:l,weeks:f,days:d,navStart:n,navEnd:r,previousMonth:h,nextMonth:m,goToMonth:v,goToDay:N=>{y(N)||v(N.date)}}}var At;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(At||(At={}));function yf(e){return!e[De.disabled]&&!e[De.hidden]&&!e[De.outside]}function _I(e,t,n,r){let o,s=-1;for(const a of e){const i=t(a);yf(i)&&(i[De.focused]&&s<At.FocusedModifier?(o=a,s=At.FocusedModifier):r!=null&&r.isEqualTo(a)&&s<At.LastFocused?(o=a,s=At.LastFocused):n(a.date)&&s<At.Selected?(o=a,s=At.Selected):i[De.today]&&s<At.Today&&(o=a,s=At.Today))}return o||(o=e.find(a=>yf(t(a)))),o}function kI(e,t,n,r,o,s,a){const{ISOWeek:i,broadcastCalendar:c}=s,{addDays:l,addMonths:f,addWeeks:d,addYears:h,endOfBroadcastWeek:m,endOfISOWeek:g,endOfWeek:p,max:y,min:v,startOfBroadcastWeek:b,startOfISOWeek:x,startOfWeek:j}=a;let S={day:l,week:d,month:f,year:h,startOfWeek:E=>c?b(E,a):i?x(E):j(E),endOfWeek:E=>c?m(E):i?g(E):p(E)}[e](n,t==="after"?1:-1);return t==="before"&&r?S=y([r,S]):t==="after"&&o&&(S=v([o,S])),S}function dv(e,t,n,r,o,s,a,i=0){if(i>365)return;const c=kI(e,t,n.date,r,o,s,a),l=!!(s.disabled&&on(c,s.disabled,a)),f=!!(s.hidden&&on(c,s.hidden,a)),d=c,h=new Kx(c,d,a);return!l&&!f?h:dv(e,t,h,r,o,s,a,i+1)}function MI(e,t,n,r,o){const{autoFocus:s}=e,[a,i]=C.useState(),c=_I(t.days,n,r||(()=>!1),a),[l,f]=C.useState(s?c:void 0);return{isFocusTarget:p=>!!(c!=null&&c.isEqualTo(p)),setFocused:f,focused:l,blur:()=>{i(l),f(void 0)},moveFocus:(p,y)=>{if(!l)return;const v=dv(p,y,l,t.navStart,t.navEnd,e,o);v&&(e.disableNavigation&&!t.days.some(x=>x.isEqualTo(v))||(t.goToDay(v),f(v)))}}}function PI(e,t){const{selected:n,required:r,onSelect:o}=e,[s,a]=Ya(n,o?n:void 0),i=o?n:s,{isSameDay:c}=t,l=m=>(i==null?void 0:i.some(g=>c(g,m)))??!1,{min:f,max:d}=e;return{selected:i,select:(m,g,p)=>{let y=[...i??[]];if(l(m)){if((i==null?void 0:i.length)===f||r&&(i==null?void 0:i.length)===1)return;y=i==null?void 0:i.filter(v=>!c(v,m))}else(i==null?void 0:i.length)===d?y=[m]:y=[...y,m];return o||a(y),o==null||o(y,m,g,p),y},isSelected:l}}function DI(e,t,n=0,r=0,o=!1,s=Ut){const{from:a,to:i}=t||{},{isSameDay:c,isAfter:l,isBefore:f}=s;let d;if(!a&&!i)d={from:e,to:n>0?void 0:e};else if(a&&!i)c(a,e)?n===0?d={from:a,to:e}:o?d={from:a,to:void 0}:d=void 0:f(e,a)?d={from:e,to:a}:d={from:a,to:e};else if(a&&i)if(c(a,e)&&c(i,e))o?d={from:a,to:i}:d=void 0;else if(c(a,e))d={from:a,to:n>0?void 0:e};else if(c(i,e))d={from:e,to:n>0?void 0:e};else if(f(e,a))d={from:e,to:i};else if(l(e,a))d={from:a,to:e};else if(l(e,i))d={from:a,to:e};else throw new Error("Invalid range");if(d!=null&&d.from&&(d!=null&&d.to)){const h=s.differenceInCalendarDays(d.to,d.from);r>0&&h>r?d={from:e,to:void 0}:n>1&&h<n&&(d={from:e,to:void 0})}return d}function OI(e,t,n=Ut){const r=Array.isArray(t)?t:[t];let o=e.from;const s=n.differenceInCalendarDays(e.to,e.from),a=Math.min(s,6);for(let i=0;i<=a;i++){if(r.includes(o.getDay()))return!0;o=n.addDays(o,1)}return!1}function xf(e,t,n=Ut){return rn(e,t.from,!1,n)||rn(e,t.to,!1,n)||rn(t,e.from,!1,n)||rn(t,e.to,!1,n)}function RI(e,t,n=Ut){const r=Array.isArray(t)?t:[t];if(r.filter(i=>typeof i!="function").some(i=>typeof i=="boolean"?i:n.isDate(i)?rn(e,i,!1,n):Qx(i,n)?i.some(c=>rn(e,c,!1,n)):Va(i)?i.from&&i.to?xf(e,{from:i.from,to:i.to},n):!1:Zx(i)?OI(e,i.dayOfWeek,n):Tl(i)?n.isAfter(i.before,i.after)?xf(e,{from:n.addDays(i.after,1),to:n.addDays(i.before,-1)},n):on(e.from,i,n)||on(e.to,i,n):Il(i)||$l(i)?on(e.from,i,n)||on(e.to,i,n):!1))return!0;const a=r.filter(i=>typeof i=="function");if(a.length){let i=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let l=0;l<=c;l++){if(a.some(f=>f(i)))return!0;i=n.addDays(i,1)}}return!1}function AI(e,t){const{disabled:n,excludeDisabled:r,selected:o,required:s,onSelect:a}=e,[i,c]=Ya(o,a?o:void 0),l=a?o:i;return{selected:l,select:(h,m,g)=>{const{min:p,max:y}=e,v=h?DI(h,l,p,y,s,t):void 0;return r&&n&&(v!=null&&v.from)&&v.to&&RI({from:v.from,to:v.to},n,t)&&(v.from=h,v.to=void 0),a||c(v),a==null||a(v,h,m,g),v},isSelected:h=>l&&rn(l,h,!1,t)}}function TI(e,t){const{selected:n,required:r,onSelect:o}=e,[s,a]=Ya(n,o?n:void 0),i=o?n:s,{isSameDay:c}=t;return{selected:i,select:(d,h,m)=>{let g=d;return!r&&i&&i&&c(d,i)&&(g=void 0),o||a(g),o==null||o(g,d,h,m),g},isSelected:d=>i?c(i,d):!1}}function II(e,t){const n=TI(e,t),r=PI(e,t),o=AI(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return o;default:return}}function ut(e,t){return e instanceof Ve&&e.timeZone===t?e:new Ve(e,t)}function ar(e,t,n){return ut(e,t)}function vf(e,t,n){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?ar(e,t):Array.isArray(e)?e.map(r=>r instanceof Date?ar(r,t):r):Va(e)?{...e,from:e.from?ut(e.from,t):e.from,to:e.to?ut(e.to,t):e.to}:Tl(e)?{before:ar(e.before,t),after:ar(e.after,t)}:Il(e)?{after:ar(e.after,t)}:$l(e)?{before:ar(e.before,t)}:e}function Mi(e,t,n){return e&&(Array.isArray(e)?e.map(r=>vf(r,t)):vf(e,t))}function $I(e){var _n;let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=ut(t.today,n)),t.month&&(t.month=ut(t.month,n)),t.defaultMonth&&(t.defaultMonth=ut(t.defaultMonth,n)),t.startMonth&&(t.startMonth=ut(t.startMonth,n)),t.endMonth&&(t.endMonth=ut(t.endMonth,n)),t.mode==="single"&&t.selected?t.selected=ut(t.selected,n):t.mode==="multiple"&&t.selected?t.selected=(_n=t.selected)==null?void 0:_n.map(le=>ut(le,n)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?ut(t.selected.from,n):t.selected.from,to:t.selected.to?ut(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=Mi(t.disabled,n)),t.hidden!==void 0&&(t.hidden=Mi(t.hidden,n)),t.modifiers)){const le={};Object.keys(t.modifiers).forEach(xe=>{var oe;le[xe]=Mi((oe=t.modifiers)==null?void 0:oe[xe],n)}),t.modifiers=le}const{components:r,formatters:o,labels:s,dateLib:a,locale:i,classNames:c}=C.useMemo(()=>{const le={...Xx,...t.locale},xe=t.broadcastCalendar?1:t.weekStartsOn,oe=t.noonSafe&&t.timeZone?hI(t.timeZone,{weekStartsOn:xe,locale:le}):void 0,de=t.dateLib&&oe?{...oe,...t.dateLib}:t.dateLib??oe,Be=new lt({locale:le,weekStartsOn:xe,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},de);return{dateLib:Be,components:qT(t.components),formatters:rI(t.formatters),labels:cI(t.labels,Be.options),locale:le,classNames:{...UT(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:a.today()});const{captionLayout:l,mode:f,navLayout:d,numberOfMonths:h=1,onDayBlur:m,onDayClick:g,onDayFocus:p,onDayKeyDown:y,onDayMouseEnter:v,onDayMouseLeave:b,onNextClick:x,onPrevClick:j,showWeekNumber:N,styles:S}=t,{formatCaption:E,formatDay:O,formatMonthDropdown:P,formatWeekNumber:T,formatWeekNumberHeader:k,formatWeekdayName:M,formatYearDropdown:W}=o,_=EI(t,a),{days:I,months:R,navStart:z,navEnd:A,previousMonth:D,nextMonth:B,goToMonth:q}=_,V=VT(I,t,z,A,a),{isSelected:H,select:L,selected:Y}=II(t,a)??{},{blur:G,focused:$,isFocusTarget:F,moveFocus:U,setFocused:X}=MI(t,_,V,H??(()=>!1),a),{labelDayButton:Z,labelGridcell:K,labelGrid:J,labelMonthDropdown:ee,labelNav:se,labelPrevious:ae,labelNext:ue,labelWeekday:ve,labelWeekNumber:ke,labelWeekNumberHeader:Fe,labelYearDropdown:Ie}=s,Qe=C.useMemo(()=>dI(a,t.ISOWeek,t.broadcastCalendar,t.today),[a,t.ISOWeek,t.broadcastCalendar,t.today]),Le=f!==void 0||g!==void 0,Xt=C.useCallback(()=>{D&&(q(D),j==null||j(D))},[D,q,j]),Mt=C.useCallback(()=>{B&&(q(B),x==null||x(B))},[q,B,x]),Re=C.useCallback((le,xe)=>oe=>{oe.preventDefault(),oe.stopPropagation(),X(le),!xe.disabled&&(L==null||L(le.date,xe,oe),g==null||g(le.date,xe,oe))},[L,g,X]),Ue=C.useCallback((le,xe)=>oe=>{X(le),p==null||p(le.date,xe,oe)},[p,X]),Xn=C.useCallback((le,xe)=>oe=>{G(),m==null||m(le.date,xe,oe)},[G,m]),Fr=C.useCallback((le,xe)=>oe=>{const de={ArrowLeft:[oe.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[oe.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[oe.shiftKey?"year":"week","after"],ArrowUp:[oe.shiftKey?"year":"week","before"],PageUp:[oe.shiftKey?"year":"month","before"],PageDown:[oe.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(de[oe.key]){oe.preventDefault(),oe.stopPropagation();const[Be,Q]=de[oe.key];U(Be,Q)}y==null||y(le.date,xe,oe)},[U,y,t.dir]),Pt=C.useCallback((le,xe)=>oe=>{v==null||v(le.date,xe,oe)},[v]),Br=C.useCallback((le,xe)=>oe=>{b==null||b(le.date,xe,oe)},[b]),Kn=C.useCallback(le=>xe=>{const oe=Number(xe.target.value),de=a.setMonth(a.startOfMonth(le),oe);q(de)},[a,q]),En=C.useCallback(le=>xe=>{const oe=Number(xe.target.value),de=a.setYear(a.startOfMonth(le),oe);q(de)},[a,q]),{className:Dt,style:Jn}=C.useMemo(()=>({className:[c[ne.Root],t.className].filter(Boolean).join(" "),style:{...S==null?void 0:S[ne.Root],...t.style}}),[c,t.className,t.style,S]),Ot=GT(t),Zn=C.useRef(null);yI(Zn,!!t.animate,{classNames:c,months:R,focused:$,dateLib:a});const Hr={dayPickerProps:t,selected:Y,select:L,isSelected:H,months:R,nextMonth:B,previousMonth:D,goToMonth:q,getModifiers:V,components:r,classNames:c,styles:S,labels:s,formatters:o};return C.createElement(Jx.Provider,{value:Hr},C.createElement(r.Root,{rootRef:t.animate?Zn:void 0,className:Dt,style:Jn,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...Ot},C.createElement(r.Months,{className:c[ne.Months],style:S==null?void 0:S[ne.Months]},!t.hideNavigation&&!d&&C.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[ne.Nav],style:S==null?void 0:S[ne.Nav],"aria-label":se(),onPreviousClick:Xt,onNextClick:Mt,previousMonth:D,nextMonth:B}),R.map((le,xe)=>C.createElement(r.Month,{"data-animated-month":t.animate?"true":void 0,className:c[ne.Month],style:S==null?void 0:S[ne.Month],key:xe,displayIndex:xe,calendarMonth:le},d==="around"&&!t.hideNavigation&&xe===0&&C.createElement(r.PreviousMonthButton,{type:"button",className:c[ne.PreviousMonthButton],tabIndex:D?void 0:-1,"aria-disabled":D?void 0:!0,"aria-label":ae(D),onClick:Xt,"data-animated-button":t.animate?"true":void 0},C.createElement(r.Chevron,{disabled:D?void 0:!0,className:c[ne.Chevron],orientation:t.dir==="rtl"?"right":"left"})),C.createElement(r.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:c[ne.MonthCaption],style:S==null?void 0:S[ne.MonthCaption],calendarMonth:le,displayIndex:xe},l!=null&&l.startsWith("dropdown")?C.createElement(r.DropdownNav,{className:c[ne.Dropdowns],style:S==null?void 0:S[ne.Dropdowns]},(()=>{const oe=l==="dropdown"||l==="dropdown-months"?C.createElement(r.MonthsDropdown,{key:"month",className:c[ne.MonthsDropdown],"aria-label":ee(),classNames:c,components:r,disabled:!!t.disableNavigation,onChange:Kn(le.date),options:lI(le.date,z,A,o,a),style:S==null?void 0:S[ne.Dropdown],value:a.getMonth(le.date)}):C.createElement("span",{key:"month"},P(le.date,a)),de=l==="dropdown"||l==="dropdown-years"?C.createElement(r.YearsDropdown,{key:"year",className:c[ne.YearsDropdown],"aria-label":Ie(a.options),classNames:c,components:r,disabled:!!t.disableNavigation,onChange:En(le.date),options:fI(z,A,o,a,!!t.reverseYears),style:S==null?void 0:S[ne.Dropdown],value:a.getYear(le.date)}):C.createElement("span",{key:"year"},W(le.date,a));return a.getMonthYearOrder()==="year-first"?[de,oe]:[oe,de]})(),C.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},E(le.date,a.options,a))):C.createElement(r.CaptionLabel,{className:c[ne.CaptionLabel],role:"status","aria-live":"polite"},E(le.date,a.options,a))),d==="around"&&!t.hideNavigation&&xe===h-1&&C.createElement(r.NextMonthButton,{type:"button",className:c[ne.NextMonthButton],tabIndex:B?void 0:-1,"aria-disabled":B?void 0:!0,"aria-label":ue(B),onClick:Mt,"data-animated-button":t.animate?"true":void 0},C.createElement(r.Chevron,{disabled:B?void 0:!0,className:c[ne.Chevron],orientation:t.dir==="rtl"?"left":"right"})),xe===h-1&&d==="after"&&!t.hideNavigation&&C.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[ne.Nav],style:S==null?void 0:S[ne.Nav],"aria-label":se(),onPreviousClick:Xt,onNextClick:Mt,previousMonth:D,nextMonth:B}),C.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":f==="multiple"||f==="range","aria-label":J(le.date,a.options,a)||void 0,className:c[ne.MonthGrid],style:S==null?void 0:S[ne.MonthGrid]},!t.hideWeekdays&&C.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:c[ne.Weekdays],style:S==null?void 0:S[ne.Weekdays]},N&&C.createElement(r.WeekNumberHeader,{"aria-label":Fe(a.options),className:c[ne.WeekNumberHeader],style:S==null?void 0:S[ne.WeekNumberHeader],scope:"col"},k()),Qe.map(oe=>C.createElement(r.Weekday,{"aria-label":ve(oe,a.options,a),className:c[ne.Weekday],key:String(oe),style:S==null?void 0:S[ne.Weekday],scope:"col"},M(oe,a.options,a)))),C.createElement(r.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:c[ne.Weeks],style:S==null?void 0:S[ne.Weeks]},le.weeks.map(oe=>C.createElement(r.Week,{className:c[ne.Week],key:oe.weekNumber,style:S==null?void 0:S[ne.Week],week:oe},N&&C.createElement(r.WeekNumber,{week:oe,style:S==null?void 0:S[ne.WeekNumber],"aria-label":ke(oe.weekNumber,{locale:i}),className:c[ne.WeekNumber],scope:"row",role:"rowheader"},T(oe.weekNumber,a)),oe.days.map(de=>{const{date:Be}=de,Q=V(de);if(Q[De.focused]=!Q.hidden&&!!($!=null&&$.isEqualTo(de)),Q[bt.selected]=(H==null?void 0:H(Be))||Q.selected,Va(Y)){const{from:He,to:Xe}=Y;Q[bt.range_start]=!!(He&&Xe&&a.isSameDay(Be,He)),Q[bt.range_end]=!!(He&&Xe&&a.isSameDay(Be,Xe)),Q[bt.range_middle]=rn(Y,Be,!0,a)}const be=uI(Q,S,t.modifiersStyles),Ce=YT(Q,c,t.modifiersClassNames),qe=!Le&&!Q.hidden?K(Be,Q,a.options,a):void 0;return C.createElement(r.Day,{key:`${de.isoDate}_${de.displayMonthId}`,day:de,modifiers:Q,className:Ce.join(" "),style:be,role:"gridcell","aria-selected":Q.selected||void 0,"aria-label":qe,"data-day":de.isoDate,"data-month":de.outside?de.dateMonthId:void 0,"data-selected":Q.selected||void 0,"data-disabled":Q.disabled||void 0,"data-hidden":Q.hidden||void 0,"data-outside":de.outside||void 0,"data-focused":Q.focused||void 0,"data-today":Q.today||void 0},!Q.hidden&&Le?C.createElement(r.DayButton,{className:c[ne.DayButton],style:S==null?void 0:S[ne.DayButton],type:"button",day:de,modifiers:Q,disabled:!Q.focused&&Q.disabled||void 0,"aria-disabled":Q.focused&&Q.disabled||void 0,tabIndex:F(de)?0:-1,"aria-label":Z(Be,Q,a.options,a),onClick:Re(de,Q),onBlur:Xn(de,Q),onFocus:Ue(de,Q),onKeyDown:Fr(de,Q),onMouseEnter:Pt(de,Q),onMouseLeave:Br(de,Q)},O(Be,a.options,a)):!Q.hidden&&O(de.date,a.options,a))})))))))),t.footer&&C.createElement(r.Footer,{className:c[ne.Footer],style:S==null?void 0:S[ne.Footer],role:"status","aria-live":"polite"},t.footer)))}function fv({className:e,classNames:t,showOutsideDays:n=!0,...r}){return u.jsx($I,{showOutsideDays:n,className:ce("cj-p-3",e),classNames:{months:"cj-flex cj-flex-col sm:cj-flex-row cj-space-y-4 sm:cj-space-x-4 sm:cj-space-y-0",month:"cj-space-y-4",month_caption:"cj-flex cj-justify-center cj-pt-1 cj-relative cj-items-center",caption_label:"cj-text-sm cj-font-medium",nav:"cj-space-x-1 cj-flex cj-items-center",button_previous:ce(ws({variant:"outline"}),"cj-h-7 cj-w-7 cj-bg-transparent cj-p-0 cj-opacity-50 hover:cj-opacity-100 cj-absolute cj-left-1"),button_next:ce(ws({variant:"outline"}),"cj-h-7 cj-w-7 cj-bg-transparent cj-p-0 cj-opacity-50 hover:cj-opacity-100 cj-absolute cj-right-1"),month_grid:"cj-w-full cj-border-collapse cj-space-y-1",weekdays:"cj-flex",weekday:"cj-text-muted-foreground cj-rounded-md cj-w-9 cj-font-normal cj-text-[0.8rem]",week:"cj-flex cj-w-full cj-mt-2",day:"cj-h-9 cj-w-9 cj-text-center cj-text-sm cj-p-0 cj-relative [&:has([aria-selected].day-range-end)]:cj-rounded-r-md [&:has([aria-selected].day-outside)]:cj-bg-accent/50 [&:has([aria-selected])]:cj-bg-accent first:[&:has([aria-selected])]:cj-rounded-l-md last:[&:has([aria-selected])]:cj-rounded-r-md focus-within:cj-relative focus-within:cj-z-20",day_button:ce(ws({variant:"ghost"}),"cj-h-9 cj-w-9 cj-p-0 cj-font-normal aria-selected:cj-opacity-100"),range_end:"day-range-end",selected:"cj-bg-primary cj-text-primary-foreground hover:cj-bg-primary hover:cj-text-primary-foreground focus:cj-bg-primary focus:cj-text-primary-foreground",today:"cj-bg-accent cj-text-accent-foreground",outside:"day-outside cj-text-muted-foreground cj-opacity-50 aria-selected:cj-bg-accent/50 aria-selected:cj-text-muted-foreground aria-selected:cj-opacity-30",disabled:"cj-text-muted-foreground cj-opacity-50",range_middle:"aria-selected:cj-bg-accent aria-selected:cj-text-accent-foreground",hidden:"cj-invisible",...t},components:{Chevron:({orientation:o,...s})=>o==="left"?u.jsx(mN,{className:"cj-h-4 cj-w-4"}):u.jsx(xm,{className:"cj-h-4 cj-w-4"})},...r})}fv.displayName="Calendar";function zI({label:e,value:t,onChange:n,helpText:r}){const[o,s]=C.useState(!1),a=t?new Date(t):void 0,i=c=>{c&&(n(c.toISOString()),s(!1))};return u.jsxs("div",{className:"cj-space-y-2",children:[u.jsx(we,{className:"cj-text-sm cj-font-medium",children:e}),u.jsxs(jl,{open:o,onOpenChange:s,children:[u.jsx(Sl,{asChild:!0,children:u.jsxs(fe,{variant:"outline",className:ce("cj-w-full cj-justify-start cj-text-left cj-font-normal",!a&&"cj-text-muted-foreground"),children:[u.jsx(hN,{className:"cj-mr-2 cj-h-4 cj-w-4"}),a?BR(a,"PPP"):u.jsx("span",{children:"Pick a date"})]})}),u.jsx(La,{className:"cj-w-auto cj-p-0 cj-z-50",align:"start",children:u.jsx(fv,{mode:"single",selected:a,onSelect:i,autoFocus:!0,className:ce("cj-p-3 cj-pointer-events-auto")})})]}),r&&u.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:r})]})}function LI({label:e,value:t,onChange:n,helpText:r,currency:o="EUR"}){const[s,a]=C.useState("");C.useEffect(()=>{if(t){const h=parseFloat(t);isNaN(h)||a(i(h))}else a("")},[t]);const i=h=>new Intl.NumberFormat("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2}).format(h),c=h=>{const m=h.replace(/\./g,"").replace(",",".");return parseFloat(m)||0},l=h=>{const g=h.target.value.replace(/[^\d.,]/g,"");a(g)},f=()=>{if(s){const h=c(s);n(h.toString()),a(i(h))}else n("")},d=h=>({EUR:"€",USD:"$",GBP:"£"})[h]||h;return u.jsxs("div",{className:"cj-space-y-2",children:[u.jsx(we,{className:"cj-text-sm cj-font-medium",children:e}),u.jsxs("div",{className:"cj-relative",children:[u.jsx("span",{className:"cj-absolute cj-left-3 cj-top-1/2 -cj-translate-y-1/2 cj-text-muted-foreground",children:d(o)}),u.jsx(ze,{type:"text",value:s,onChange:l,onBlur:f,placeholder:"0,00",className:"cj-pl-8"})]}),r&&u.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:r})]})}function WI({label:e,value:t,onChange:n,onFileSelect:r,helpText:o,accept:s,maxSizeMB:a}){const i=C.useRef(null),[c,l]=C.useState(!1),[f,d]=C.useState(null),h=N=>{if(a&&N.size>a*1024*1024)return`File exceeds ${a} MB limit (${(N.size/1024/1024).toFixed(1)} MB)`;if(s){const S=s.split(",").map(T=>T.trim().toLowerCase()),E=N.name.toLowerCase(),O=N.type.toLowerCase();if(!S.some(T=>T.startsWith(".")?E.endsWith(T):T.endsWith("/*")?O.startsWith(T.replace("/*","/")):O===T))return`File type not accepted. Allowed: ${s}`}return null},m=async N=>{d(null);const S=h(N);if(S){d(S);return}if(!r){n(N.name);return}l(!0);try{const E=await r(N);n(typeof E=="string"?E:N.name)}catch(E){d(E instanceof Error?E.message:"Upload failed"),n("")}finally{l(!1)}},g=N=>{if(N.preventDefault(),c)return;const S=N.dataTransfer.files;S.length>0&&m(S[0])},p=N=>{N.preventDefault()},y=()=>{var N;c||(N=i.current)==null||N.click()},v=N=>{const S=N.target.files;S&&S.length>0&&m(S[0]),N.target.value=""},b=N=>{N.stopPropagation(),n(""),d(null)},x=[];s&&x.push(`Accepted: ${s}`),a&&x.push(`Max ${a} MB`);const j=x.length>0?x.join(" · "):null;return u.jsxs("div",{className:"cj-space-y-2",children:[u.jsx(we,{className:"cj-text-sm cj-font-medium",children:e}),u.jsx("input",{ref:i,type:"file",className:"cj-hidden",accept:s,onChange:v}),u.jsx("div",{onDrop:g,onDragOver:p,onClick:y,className:`cj-border-2 cj-border-dashed cj-rounded-lg cj-p-8 cj-text-center cj-transition-colors ${c?"cj-border-muted-foreground/25 cj-cursor-wait cj-opacity-60":f?"cj-border-destructive/50 cj-cursor-pointer hover:cj-border-destructive/75":"cj-border-muted-foreground/25 cj-cursor-pointer hover:cj-border-muted-foreground/50"}`,children:c?u.jsxs(u.Fragment,{children:[u.jsx(wN,{className:"cj-h-8 cj-w-8 cj-mx-auto cj-text-muted-foreground cj-mb-2 cj-animate-spin"}),u.jsx("p",{className:"cj-text-sm cj-text-muted-foreground",children:"Uploading…"})]}):t?u.jsxs(u.Fragment,{children:[u.jsx(Ui,{className:"cj-h-8 cj-w-8 cj-mx-auto cj-text-muted-foreground cj-mb-2"}),u.jsxs("div",{className:"cj-flex cj-items-center cj-justify-center cj-gap-2",children:[u.jsx("p",{className:"cj-text-sm cj-font-medium cj-truncate cj-max-w-[240px]",children:t}),u.jsx("button",{type:"button",onClick:b,className:"cj-text-muted-foreground hover:cj-text-foreground",children:u.jsx(Er,{className:"cj-h-4 cj-w-4"})})]})]}):u.jsxs(u.Fragment,{children:[u.jsx(Ui,{className:"cj-h-8 cj-w-8 cj-mx-auto cj-text-muted-foreground cj-mb-2"}),u.jsx("p",{className:"cj-text-sm cj-text-muted-foreground",children:"Drag & drop a file here, or click to select"})]})}),f&&u.jsxs("p",{className:"cj-text-xs cj-text-destructive cj-flex cj-items-center cj-gap-1",children:[u.jsx(bm,{className:"cj-h-3 cj-w-3"})," ",f]}),(o||j)&&u.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o||j})]})}const Pi=[{code:"US",name:"United States",dial:"+1",flag:"🇺🇸"},{code:"GB",name:"United Kingdom",dial:"+44",flag:"🇬🇧"},{code:"CA",name:"Canada",dial:"+1",flag:"🇨🇦"},{code:"AU",name:"Australia",dial:"+61",flag:"🇦🇺"},{code:"DE",name:"Germany",dial:"+49",flag:"🇩🇪"},{code:"FR",name:"France",dial:"+33",flag:"🇫🇷"},{code:"IT",name:"Italy",dial:"+39",flag:"🇮🇹"},{code:"ES",name:"Spain",dial:"+34",flag:"🇪🇸"},{code:"PT",name:"Portugal",dial:"+351",flag:"🇵🇹"},{code:"NL",name:"Netherlands",dial:"+31",flag:"🇳🇱"},{code:"BE",name:"Belgium",dial:"+32",flag:"🇧🇪"},{code:"CH",name:"Switzerland",dial:"+41",flag:"🇨🇭"},{code:"AT",name:"Austria",dial:"+43",flag:"🇦🇹"},{code:"SE",name:"Sweden",dial:"+46",flag:"🇸🇪"},{code:"NO",name:"Norway",dial:"+47",flag:"🇳🇴"},{code:"DK",name:"Denmark",dial:"+45",flag:"🇩🇰"},{code:"FI",name:"Finland",dial:"+358",flag:"🇫🇮"},{code:"IE",name:"Ireland",dial:"+353",flag:"🇮🇪"},{code:"PL",name:"Poland",dial:"+48",flag:"🇵🇱"},{code:"CZ",name:"Czech Republic",dial:"+420",flag:"🇨🇿"},{code:"RO",name:"Romania",dial:"+40",flag:"🇷🇴"},{code:"HU",name:"Hungary",dial:"+36",flag:"🇭🇺"},{code:"GR",name:"Greece",dial:"+30",flag:"🇬🇷"},{code:"TR",name:"Turkey",dial:"+90",flag:"🇹🇷"},{code:"RU",name:"Russia",dial:"+7",flag:"🇷🇺"},{code:"JP",name:"Japan",dial:"+81",flag:"🇯🇵"},{code:"KR",name:"South Korea",dial:"+82",flag:"🇰🇷"},{code:"CN",name:"China",dial:"+86",flag:"🇨🇳"},{code:"IN",name:"India",dial:"+91",flag:"🇮🇳"},{code:"PK",name:"Pakistan",dial:"+92",flag:"🇵🇰"},{code:"BD",name:"Bangladesh",dial:"+880",flag:"🇧🇩"},{code:"ID",name:"Indonesia",dial:"+62",flag:"🇮🇩"},{code:"MY",name:"Malaysia",dial:"+60",flag:"🇲🇾"},{code:"SG",name:"Singapore",dial:"+65",flag:"🇸🇬"},{code:"PH",name:"Philippines",dial:"+63",flag:"🇵🇭"},{code:"TH",name:"Thailand",dial:"+66",flag:"🇹🇭"},{code:"VN",name:"Vietnam",dial:"+84",flag:"🇻🇳"},{code:"AE",name:"UAE",dial:"+971",flag:"🇦🇪"},{code:"SA",name:"Saudi Arabia",dial:"+966",flag:"🇸🇦"},{code:"IL",name:"Israel",dial:"+972",flag:"🇮🇱"},{code:"EG",name:"Egypt",dial:"+20",flag:"🇪🇬"},{code:"ZA",name:"South Africa",dial:"+27",flag:"🇿🇦"},{code:"NG",name:"Nigeria",dial:"+234",flag:"🇳🇬"},{code:"KE",name:"Kenya",dial:"+254",flag:"🇰🇪"},{code:"BR",name:"Brazil",dial:"+55",flag:"🇧🇷"},{code:"MX",name:"Mexico",dial:"+52",flag:"🇲🇽"},{code:"AR",name:"Argentina",dial:"+54",flag:"🇦🇷"},{code:"CO",name:"Colombia",dial:"+57",flag:"🇨🇴"},{code:"CL",name:"Chile",dial:"+56",flag:"🇨🇱"},{code:"PE",name:"Peru",dial:"+51",flag:"🇵🇪"},{code:"NZ",name:"New Zealand",dial:"+64",flag:"🇳🇿"}];function FI({label:e,value:t,onChange:n,placeholder:r="555 000 0000",helpText:o,onValidationChange:s}){const[a,i]=C.useState(null),[c,l]=C.useState(Pi[0]),[f,d]=C.useState(""),[h,m]=C.useState(!1),g=C.useMemo(()=>t?t.startsWith(c.dial)?t.slice(c.dial.length).trimStart():t.replace(/^\+\d+\s*/,""):"",[t,c.dial]),p=C.useMemo(()=>{if(!f)return Pi;const x=f.toLowerCase();return Pi.filter(j=>j.name.toLowerCase().includes(x)||j.code.toLowerCase().includes(x)||j.dial.includes(x))},[f]),y=x=>{const j=!!x&&!/^[\d\s\-()]{4,20}$/.test(x);i(j?"Enter a valid phone number":null),s==null||s(j)};C.useEffect(()=>{y(g)},[]);const v=x=>{const j=x.replace(/[^\d\s\-()]/g,""),N=j?`${c.dial} ${j}`:"";n(N),y(j)},b=x=>{l(x),m(!1),d(""),g&&n(`${x.dial} ${g}`)};return u.jsxs("div",{className:"cj-space-y-2",children:[u.jsx(we,{className:"cj-text-sm cj-font-medium",children:e}),u.jsxs("div",{className:"cj-flex cj-gap-1.5",children:[u.jsxs(jl,{open:h,onOpenChange:m,children:[u.jsx(Sl,{asChild:!0,children:u.jsxs(fe,{variant:"outline",role:"combobox","aria-expanded":h,className:"cj-w-[100px] cj-justify-between cj-px-2 cj-shrink-0",children:[u.jsx("span",{className:"cj-text-base cj-leading-none",children:c.flag}),u.jsx("span",{className:"cj-text-xs cj-text-muted-foreground",children:c.dial}),u.jsx(Rr,{className:"cj-h-3 cj-w-3 cj-opacity-50"})]})}),u.jsxs(La,{className:"cj-w-[260px] cj-p-0",align:"start",children:[u.jsxs("div",{className:"cj-flex cj-items-center cj-border-b cj-px-3 cj-py-2",children:[u.jsx(Nm,{className:"cj-h-4 cj-w-4 cj-shrink-0 cj-text-muted-foreground cj-mr-2"}),u.jsx("input",{placeholder:"Search country...",value:f,onChange:x=>d(x.target.value),className:"cj-flex-1 cj-bg-transparent cj-text-sm cj-outline-none placeholder:cj-text-muted-foreground"})]}),u.jsx(Tr,{className:"cj-h-[200px]",children:u.jsxs("div",{className:"cj-p-1",children:[p.map(x=>u.jsxs("button",{onClick:()=>b(x),className:`cj-flex cj-w-full cj-items-center cj-gap-2 cj-rounded-sm cj-px-2 cj-py-1.5 cj-text-sm hover:cj-bg-accent hover:cj-text-accent-foreground cj-cursor-pointer cj-transition-colors ${c.code===x.code?"cj-bg-accent":""}`,children:[u.jsx("span",{className:"cj-text-base",children:x.flag}),u.jsx("span",{className:"cj-flex-1 cj-text-left cj-truncate",children:x.name}),u.jsx("span",{className:"cj-text-xs cj-text-muted-foreground",children:x.dial})]},x.code)),p.length===0&&u.jsx("p",{className:"cj-py-4 cj-text-center cj-text-sm cj-text-muted-foreground",children:"No country found."})]})})]})]}),u.jsx(ze,{type:"tel",value:g,onChange:x=>v(x.target.value),placeholder:r,className:"cj-flex-1"})]}),a&&u.jsx("p",{className:"cj-text-xs cj-text-destructive",children:a}),!a&&o&&u.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o})]})}function BI({label:e,value:t,onChange:n,placeholder:r="name@example.com",helpText:o,onValidationChange:s}){const[a,i]=C.useState(null),c=f=>{const d=!!f&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(f);i(d?"Enter a valid email address":null),s==null||s(d)};C.useEffect(()=>{c(t)},[]);const l=f=>{const d=f.trim();n(d),c(d)};return u.jsxs("div",{className:"cj-space-y-2",children:[u.jsx(we,{className:"cj-text-sm cj-font-medium",children:e}),u.jsxs("div",{className:"cj-relative",children:[u.jsx(CN,{className:"cj-absolute cj-left-3 cj-top-1/2 -cj-translate-y-1/2 cj-h-4 cj-w-4 cj-text-muted-foreground"}),u.jsx(ze,{type:"email",value:t,onChange:f=>l(f.target.value),placeholder:r,className:"cj-pl-9"})]}),a&&u.jsx("p",{className:"cj-text-xs cj-text-destructive",children:a}),!a&&o&&u.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o})]})}const HI={text:"v1_string",textarea:"v1_string",select:"v2_single_option_select-1",radio:"v2_single_option_select-1",datepicker:"v2_date-1",currency:"v2_currency-1",upload:"v2_single_asset_upload",email:"v2_email-1",phone:"v2_phone-1"};function hv({nodeData:e,value:t,onChange:n,onValidationChange:r,onFileSelect:o}){var d,h;const{schema:s,label:a,options:i}=e,c=e.required?`${e.labelOverride||a} *`:e.labelOverride||a,l=t!=null?String(t):"";switch(e.widget&&HI[e.widget]||s){case"v1_string":return u.jsx(EO,{label:c,value:l,onChange:n});case"v2_single_option_select-1":return!i||i.length===0?u.jsx("div",{className:"cj-text-sm cj-text-muted-foreground",children:"No options configured for this select field."}):u.jsx($O,{label:c,value:l,onChange:n,options:i});case"v2_date-1":return u.jsx(zI,{label:c,value:l,onChange:n});case"v2_currency-1":return u.jsx(LI,{label:c,value:l,onChange:n});case"v2_single_asset_upload":return u.jsx(WI,{label:c,value:l,onChange:n,onFileSelect:o,accept:(d=e.uploadConfig)==null?void 0:d.accept,maxSizeMB:(h=e.uploadConfig)==null?void 0:h.maxSizeMB});case"v2_phone-1":return u.jsx(FI,{label:c,value:l,onChange:n,onValidationChange:r});case"v2_email-1":return u.jsx(BI,{label:c,value:l,onChange:n,onValidationChange:r});default:return u.jsxs("div",{className:"cj-p-4 cj-border cj-border-dashed cj-rounded-lg cj-text-center cj-text-muted-foreground",children:[u.jsxs("p",{className:"cj-text-sm",children:["Unknown schema type: ",s]}),u.jsx("p",{className:"cj-text-xs cj-mt-1",children:"No widget available for this field type."})]})}}function VI(){const[e,t]=C.useState(!0),[n,r]=C.useState(!1),o=C.useCallback(E=>{r(E)},[]),{nodes:s,edges:a,previewCurrentNodeId:i,previewAnswers:c,previewPath:l,isPreviewActive:f,setPreviewAnswer:d,startPreview:h,resetPreview:m,navigatePreview:g}=$e(),p=s.find(E=>E.id===i),y=l.indexOf(i||""),v=p?a.some(E=>E.source===p.id):!1,b=E=>{p&&d(p.data.namespace,E)},x=()=>{g("next")},j=()=>{g("back")},N=p?c[p.data.namespace]:void 0,S=(p==null?void 0:p.data.required)&&(N==null||N==="");return u.jsxs(_l,{open:e,onOpenChange:t,className:"cj-border-t cj-bg-background",children:[u.jsx(kl,{asChild:!0,children:u.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-px-4 cj-py-2 cj-cursor-pointer hover:cj-bg-muted/50 cj-transition-colors",children:[u.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[u.jsx("h3",{className:"cj-text-sm cj-font-medium",children:"Form Preview"}),f&&u.jsxs(ct,{variant:"secondary",className:"cj-text-xs",children:["Step ",y+1," of ",l.length]})]}),u.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[!f&&s.length>0&&u.jsxs(fe,{size:"sm",variant:"outline",onClick:E=>{E.stopPropagation(),h()},className:"cj-h-7 cj-text-xs",children:[u.jsx($s,{className:"cj-h-3 cj-w-3 cj-mr-1"}),"Start Preview"]}),f&&u.jsxs(fe,{size:"sm",variant:"ghost",onClick:E=>{E.stopPropagation(),m()},className:"cj-h-7 cj-text-xs",children:[u.jsx(Sm,{className:"cj-h-3 cj-w-3 cj-mr-1"}),"Reset"]}),e?u.jsx(Rr,{className:"cj-h-4 cj-w-4 cj-text-muted-foreground"}):u.jsx(vm,{className:"cj-h-4 cj-w-4 cj-text-muted-foreground"})]})]})}),u.jsx(Ml,{children:u.jsx("div",{className:"cj-px-4 cj-pb-4 cj-pt-2",children:f?p?u.jsxs("div",{className:"cj-max-w-md cj-mx-auto cj-space-y-4",children:[u.jsx("div",{className:"cj-bg-muted/30 cj-rounded-lg cj-p-4",children:u.jsx(hv,{nodeData:p.data,value:N,onChange:b,onValidationChange:o})}),u.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between",children:[u.jsxs(fe,{variant:"outline",size:"sm",onClick:j,disabled:l.length<=1,children:[u.jsx(qi,{className:"cj-h-4 cj-w-4 cj-mr-1"}),"Back"]}),u.jsx("div",{className:"cj-text-xs cj-text-muted-foreground",children:p.data.namespace}),u.jsxs(fe,{size:"sm",onClick:x,disabled:!v||!!S||n,title:S?"This field is required":n?"Fix validation errors first":void 0,children:["Next",u.jsx(pm,{className:"cj-h-4 cj-w-4 cj-ml-1"})]})]}),l.length>1&&u.jsxs("div",{className:"cj-flex cj-items-center cj-gap-1 cj-flex-wrap cj-text-xs cj-text-muted-foreground",children:[u.jsx("span",{children:"Path:"}),l.map((E,O)=>{const P=s.find(T=>T.id===E);return u.jsxs("span",{className:"cj-flex cj-items-center",children:[O>0&&u.jsx("span",{className:"cj-mx-1",children:"→"}),u.jsx("span",{className:E===i?"cj-text-foreground cj-font-medium":"",children:(P==null?void 0:P.data.label)||E})]},E)})]})]}):u.jsx("div",{className:"cj-text-center cj-py-4 cj-text-sm cj-text-muted-foreground",children:"No current node selected."}):u.jsx("div",{className:"cj-flex cj-flex-col cj-items-center cj-justify-center cj-py-8 cj-text-center",children:s.length===0?u.jsx("p",{className:"cj-text-sm cj-text-muted-foreground",children:"Add nodes to the canvas to preview the form flow."}):u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"cj-text-sm cj-text-muted-foreground cj-mb-3",children:'Click "Start Preview" to test the form flow interactively.'}),u.jsxs(fe,{size:"sm",onClick:h,children:[u.jsx($s,{className:"cj-h-4 cj-w-4 cj-mr-2"}),"Start Preview"]})]})})})})]})}function YI({specs:e,onSave:t,onPublish:n,onUnlockEdit:r,onOpenRunner:o,readOnly:s=!1}){const[,a]=C.useState(null),{addCustomNode:i,isDirty:c}=$e(),l=C.useCallback(f=>{i(f,{x:300,y:200})},[i]);return u.jsxs("div",{className:"cj-h-full cj-w-full cj-flex cj-flex-col",children:[u.jsxs("header",{className:"cj-h-14 cj-border-b cj-bg-background cj-px-4 cj-flex cj-items-center cj-justify-between cj-shrink-0",children:[u.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[u.jsx("h1",{className:"cj-text-lg cj-font-semibold",children:"Journey Builder"}),s&&u.jsxs(ct,{variant:"secondary",className:"cj-gap-1",children:[u.jsx(SN,{className:"cj-h-3 cj-w-3"}),"Read Only"]})]}),u.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[!s&&t&&u.jsxs(fe,{size:"sm",onClick:t,disabled:!c,className:"cj-relative cj-overflow-visible",children:[u.jsx(Cm,{className:"cj-h-4 cj-w-4 cj-mr-1"}),"Save",c&&u.jsx("span",{className:"cj-absolute -cj-top-1 -cj-right-1 cj-h-2.5 cj-w-2.5 cj-rounded-full cj-bg-destructive cj-border-2 cj-border-background cj-z-10"})]}),!s&&n&&u.jsxs(fe,{size:"sm",variant:"default",onClick:n,children:[u.jsx(vN,{className:"cj-h-4 cj-w-4 cj-mr-1"}),"Publish"]}),s&&r&&u.jsxs(fe,{size:"sm",variant:"outline",onClick:r,children:[u.jsx(jN,{className:"cj-h-4 cj-w-4 cj-mr-1"}),"Unlock Edit"]})]})]}),u.jsx("div",{className:"cj-flex-1 cj-overflow-hidden cj-flex cj-flex-col",children:u.jsxs(yd,{direction:"vertical",children:[u.jsx(Ur,{defaultSize:75,minSize:50,children:u.jsxs(yd,{direction:"horizontal",children:[u.jsx(Ur,{defaultSize:20,minSize:15,maxSize:30,children:u.jsx("div",{className:"cj-h-full cj-border-r cj-bg-background",children:!s&&u.jsx(l2,{specs:e,onDragStart:a,onCreateCustomNode:l})})}),u.jsx(fi,{withHandle:!0}),u.jsx(Ur,{defaultSize:55,minSize:40,children:u.jsx(rO,{onOpenRunner:s?void 0:o,readOnly:s})}),u.jsx(fi,{withHandle:!0}),u.jsx(Ur,{defaultSize:25,minSize:20,maxSize:35,children:u.jsx("div",{className:"cj-h-full cj-border-l cj-bg-background",children:u.jsx(NO,{})})})]})}),u.jsx(fi,{withHandle:!0}),u.jsx(Ur,{defaultSize:25,minSize:15,maxSize:50,children:u.jsx(VI,{})})]})})]})}function qI({specs:e,journey:t,onSave:n,onPublish:r,onUnlockEdit:o,onChange:s,onOpenRunner:a,readOnly:i=!1}){const{importJourneySpec:c,exportJourneySpec:l,markClean:f,nodes:d,edges:h}=$e(),m=C.useRef(null),[g,p]=C.useState(null);C.useEffect(()=>{m.current&&p(m.current)},[]),C.useEffect(()=>{t&&c(t)},[]),C.useEffect(()=>{s&&(d.length>0||h.length>0)&&s(l())},[d,h,s,l]);const y=C.useCallback(()=>{const b=l();n==null||n(b),f()},[l,n,f]),v=C.useCallback(()=>{const b=l();r==null||r(b)},[l,r]);return u.jsx("div",{ref:m,className:"jb-widget-root cj-h-full cj-w-full cj-relative cj-overflow-hidden",children:u.jsx(sl.Provider,{value:g,children:u.jsx(YI,{specs:e,onSave:!i&&n?y:void 0,onPublish:!i&&r?v:void 0,onUnlockEdit:i?o:void 0,onOpenRunner:i?void 0:a,readOnly:i})})})}function GI(e,t=[]){let n=[];function r(s,a){const i=w.createContext(a);i.displayName=s+"Context";const c=n.length;n=[...n,a];const l=d=>{var v;const{scope:h,children:m,...g}=d,p=((v=h==null?void 0:h[e])==null?void 0:v[c])||i,y=w.useMemo(()=>g,Object.values(g));return u.jsx(p.Provider,{value:y,children:m})};l.displayName=s+"Provider";function f(d,h){var p;const m=((p=h==null?void 0:h[e])==null?void 0:p[c])||i,g=w.useContext(m);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,f]}const o=()=>{const s=n.map(a=>w.createContext(a));return function(i){const c=(i==null?void 0:i[e])||s;return w.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return o.scopeName=e,[r,UI(o,...t)]}function UI(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((i,{useScope:c,scopeName:l})=>{const d=c(s)[`__scope${l}`];return{...i,...d}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var XI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],mv=XI.reduce((e,t)=>{const n=pa(`Primitive.${t}`),r=w.forwardRef((o,s)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Wl="Progress",Fl=100,[KI]=GI(Wl),[JI,ZI]=KI(Wl),pv=w.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:s=QI,...a}=e;(o||o===0)&&!bf(o)&&console.error(e4(`${o}`,"Progress"));const i=bf(o)?o:Fl;r!==null&&!wf(r,i)&&console.error(t4(`${r}`,"Progress"));const c=wf(r,i)?r:null,l=Ks(c)?s(c,i):void 0;return u.jsx(JI,{scope:n,value:c,max:i,children:u.jsx(mv.div,{"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":Ks(c)?c:void 0,"aria-valuetext":l,role:"progressbar","data-state":xv(c,i),"data-value":c??void 0,"data-max":i,...a,ref:t})})});pv.displayName=Wl;var gv="ProgressIndicator",yv=w.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=ZI(gv,n);return u.jsx(mv.div,{"data-state":xv(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});yv.displayName=gv;function QI(e,t){return`${Math.round(e/t*100)}%`}function xv(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Ks(e){return typeof e=="number"}function bf(e){return Ks(e)&&!isNaN(e)&&e>0}function wf(e,t){return Ks(e)&&!isNaN(e)&&e<=t&&e>=0}function e4(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Fl}\`.`}function t4(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
307
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},IM="DialogDescriptionWarning",$M=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Km(IM).contentName}}.`;return b.useEffect(()=>{var a;const o=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},zM=Im,LM=zm,WM=Wm,Jm=Fm,Zm=Bm,Qm=Vm,eg=qm,FM=Um;const tg=zM,BM=LM,HM=WM,ng=b.forwardRef(({className:e,...t},n)=>{const r=qo();return d.jsx(Jm,{ref:n,className:ie(r?"cj-absolute cj-inset-0 cj-z-50 cj-bg-black/80 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0":"cj-fixed cj-inset-0 cj-z-50 cj-bg-black/80 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0",e),...t})});ng.displayName=Jm.displayName;const dl=b.forwardRef(({className:e,children:t,...n},r)=>{const o=qo(),a=o?"cj-absolute cj-left-[50%] cj-top-[50%] cj-z-50 cj-grid cj-w-full cj-max-w-lg cj-translate-x-[-50%] cj-translate-y-[-50%] cj-gap-4 cj-border cj-bg-background cj-p-6 cj-shadow-lg cj-duration-200 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0 data-[state=closed]:cj-zoom-out-95 data-[state=open]:cj-zoom-in-95 sm:cj-rounded-lg":"cj-fixed cj-left-[50%] cj-top-[50%] cj-z-50 cj-grid cj-w-full cj-max-w-lg cj-translate-x-[-50%] cj-translate-y-[-50%] cj-gap-4 cj-border cj-bg-background cj-p-6 cj-shadow-lg cj-duration-200 data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0 data-[state=closed]:cj-zoom-out-95 data-[state=open]:cj-zoom-in-95 data-[state=closed]:cj-slide-out-to-left-1/2 data-[state=closed]:cj-slide-out-to-top-[48%] data-[state=open]:cj-slide-in-from-left-1/2 data-[state=open]:cj-slide-in-from-top-[48%] sm:cj-rounded-lg";return d.jsxs(HM,{container:o??void 0,children:[d.jsx(ng,{}),d.jsxs(Zm,{ref:r,className:ie(a,e),...n,children:[t,d.jsxs(FM,{className:"cj-absolute cj-right-4 cj-top-4 cj-rounded-sm cj-opacity-70 cj-ring-offset-background cj-transition-opacity data-[state=open]:cj-bg-accent data-[state=open]:cj-text-muted-foreground hover:cj-opacity-100 focus:cj-outline-none focus:cj-ring-2 focus:cj-ring-ring focus:cj-ring-offset-2 disabled:cj-pointer-events-none",children:[d.jsx(kr,{className:"cj-h-4 cj-w-4"}),d.jsx("span",{className:"cj-sr-only",children:"Close"})]})]})]})});dl.displayName=Zm.displayName;const ul=({className:e,...t})=>d.jsx("div",{className:ie("cj-flex cj-flex-col cj-space-y-1.5 cj-text-center sm:cj-text-left",e),...t});ul.displayName="DialogHeader";const fl=({className:e,...t})=>d.jsx("div",{className:ie("cj-flex cj-flex-col-reverse sm:cj-flex-row sm:cj-justify-end sm:cj-space-x-2",e),...t});fl.displayName="DialogFooter";const hl=b.forwardRef(({className:e,...t},n)=>d.jsx(Qm,{ref:n,className:ie("cj-text-lg cj-font-semibold cj-leading-none cj-tracking-tight",e),...t}));hl.displayName=Qm.displayName;const pl=b.forwardRef(({className:e,...t},n)=>d.jsx(eg,{ref:n,className:ie("cj-text-sm cj-text-muted-foreground",e),...t}));pl.displayName=eg.displayName;const ks=b.forwardRef(({className:e,...t},n)=>d.jsx("textarea",{className:ie("cj-flex cj-min-h-[80px] cj-w-full cj-rounded-md cj-border cj-border-input cj-bg-background cj-px-3 cj-py-2 cj-text-sm cj-ring-offset-background placeholder:cj-text-muted-foreground focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-cursor-not-allowed disabled:cj-opacity-50",e),ref:n,...t}));ks.displayName="Textarea";function Gu(e){const t=VM(e),n=b.forwardRef((r,o)=>{const{children:a,...s}=r,i=b.Children.toArray(a),c=i.find(qM);if(c){const l=c.props.children,u=i.map(f=>f===c?b.Children.count(l)>1?b.Children.only(null):b.isValidElement(l)?l.props.children:null:f);return d.jsx(t,{...s,ref:o,children:b.isValidElement(l)?b.cloneElement(l,void 0,u):null})}return d.jsx(t,{...s,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function VM(e){const t=b.forwardRef((n,r)=>{const{children:o,...a}=n;if(b.isValidElement(o)){const s=UM(o),i=GM(a,o.props);return o.type!==b.Fragment&&(i.ref=r?Xn(r,s):s),b.cloneElement(o,i)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var YM=Symbol("radix.slottable");function qM(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===YM}function GM(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{const c=a(...i);return o(...i),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function UM(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function rg(e){const t=e+"CollectionProvider",[n,r]=Ze(t),[o,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:y,children:v}=g,w=_.useRef(null),x=_.useRef(new Map).current;return d.jsx(o,{scope:y,itemMap:x,collectionRef:w,children:v})};s.displayName=t;const i=e+"CollectionSlot",c=Gu(i),l=_.forwardRef((g,y)=>{const{scope:v,children:w}=g,x=a(i,v),j=me(y,x.collectionRef);return d.jsx(c,{ref:j,children:w})});l.displayName=i;const u=e+"CollectionItemSlot",f="data-radix-collection-item",h=Gu(u),p=_.forwardRef((g,y)=>{const{scope:v,children:w,...x}=g,j=_.useRef(null),N=me(y,j),S=a(u,v);return _.useEffect(()=>(S.itemMap.set(j,{ref:j,...x}),()=>void S.itemMap.delete(j))),d.jsx(h,{[f]:"",ref:N,children:w})});p.displayName=u;function m(g){const y=a(e+"CollectionConsumer",g);return _.useCallback(()=>{const w=y.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((S,C)=>x.indexOf(S.ref.current)-x.indexOf(C.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:l,ItemSlot:p},m,r]}var XM=b.createContext(void 0);function Go(e){const t=b.useContext(XM);return e||t||"ltr"}var bi="rovingFocusGroup.onEntryFocus",KM={bubbles:!1,cancelable:!0},Uo="RovingFocusGroup",[dc,og,JM]=rg(Uo),[ZM,Ps]=Ze(Uo,[JM]),[QM,e2]=ZM(Uo),ag=b.forwardRef((e,t)=>d.jsx(dc.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(dc.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(t2,{...e,ref:t})})}));ag.displayName=Uo;var t2=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...f}=e,h=b.useRef(null),p=me(t,h),m=Go(a),[g,y]=Nt({prop:s,defaultProp:i??null,onChange:c,caller:Uo}),[v,w]=b.useState(!1),x=Ge(l),j=og(n),N=b.useRef(!1),[S,C]=b.useState(0);return b.useEffect(()=>{const P=h.current;if(P)return P.addEventListener(bi,x),()=>P.removeEventListener(bi,x)},[x]),d.jsx(QM,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:g,onItemFocus:b.useCallback(P=>y(P),[y]),onItemShiftTab:b.useCallback(()=>w(!0),[]),onFocusableItemAdd:b.useCallback(()=>C(P=>P+1),[]),onFocusableItemRemove:b.useCallback(()=>C(P=>P-1),[]),children:d.jsx(se.div,{tabIndex:v||S===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:te(e.onMouseDown,()=>{N.current=!0}),onFocus:te(e.onFocus,P=>{const k=!N.current;if(P.target===P.currentTarget&&k&&!v){const T=new CustomEvent(bi,KM);if(P.currentTarget.dispatchEvent(T),!T.defaultPrevented){const D=j().filter(R=>R.focusable),M=D.find(R=>R.active),L=D.find(R=>R.id===g),I=[M,L,...D].filter(Boolean).map(R=>R.ref.current);cg(I,u)}}N.current=!1}),onBlur:te(e.onBlur,()=>w(!1))})})}),sg="RovingFocusGroupItem",ig=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:s,...i}=e,c=jt(),l=a||c,u=e2(sg,n),f=u.currentTabStopId===l,h=og(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:g}=u;return b.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),d.jsx(dc.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:d.jsx(se.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...i,ref:t,onMouseDown:te(e.onMouseDown,y=>{r?u.onItemFocus(l):y.preventDefault()}),onFocus:te(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:te(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=o2(y,u.orientation,u.dir);if(v!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let x=h().filter(j=>j.focusable).map(j=>j.ref.current);if(v==="last")x.reverse();else if(v==="prev"||v==="next"){v==="prev"&&x.reverse();const j=x.indexOf(y.currentTarget);x=u.loop?a2(x,j+1):x.slice(j+1)}setTimeout(()=>cg(x))}}),children:typeof s=="function"?s({isCurrentTabStop:f,hasTabStop:g!=null}):s})})});ig.displayName=sg;var n2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function r2(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function o2(e,t,n){const r=r2(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return n2[r]}function cg(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function a2(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var lg=ag,dg=ig,Ms="Tabs",[s2]=Ze(Ms,[Ps]),ug=Ps(),[i2,ml]=s2(Ms),fg=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:a,orientation:s="horizontal",dir:i,activationMode:c="automatic",...l}=e,u=Go(i),[f,h]=Nt({prop:r,onChange:o,defaultProp:a??"",caller:Ms});return d.jsx(i2,{scope:n,baseId:jt(),value:f,onValueChange:h,orientation:s,dir:u,activationMode:c,children:d.jsx(se.div,{dir:u,"data-orientation":s,...l,ref:t})})});fg.displayName=Ms;var hg="TabsList",pg=b.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,a=ml(hg,n),s=ug(n);return d.jsx(lg,{asChild:!0,...s,orientation:a.orientation,dir:a.dir,loop:r,children:d.jsx(se.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:t})})});pg.displayName=hg;var mg="TabsTrigger",gg=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...a}=e,s=ml(mg,n),i=ug(n),c=vg(s.baseId,r),l=bg(s.baseId,r),u=r===s.value;return d.jsx(dg,{asChild:!0,...i,focusable:!o,active:u,children:d.jsx(se.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":l,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...a,ref:t,onMouseDown:te(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:te(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:te(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!o&&f&&s.onValueChange(r)})})})});gg.displayName=mg;var yg="TabsContent",xg=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:a,...s}=e,i=ml(yg,n),c=vg(i.baseId,r),l=bg(i.baseId,r),u=r===i.value,f=b.useRef(u);return b.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),d.jsx(Ye,{present:o||u,children:({present:h})=>d.jsx(se.div,{"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:l,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&a})})});xg.displayName=yg;function vg(e,t){return`${e}-trigger-${t}`}function bg(e,t){return`${e}-content-${t}`}var c2=fg,wg=pg,jg=gg,_g=xg;const Sg=c2,gl=b.forwardRef(({className:e,...t},n)=>d.jsx(wg,{ref:n,className:ie("cj-inline-flex cj-h-10 cj-items-center cj-justify-center cj-rounded-md cj-bg-muted cj-p-1 cj-text-muted-foreground",e),...t}));gl.displayName=wg.displayName;const Eo=b.forwardRef(({className:e,...t},n)=>d.jsx(jg,{ref:n,className:ie("cj-inline-flex cj-items-center cj-justify-center cj-whitespace-nowrap cj-rounded-sm cj-px-3 cj-py-1.5 cj-text-sm cj-font-medium cj-ring-offset-background cj-transition-all data-[state=active]:cj-bg-background data-[state=active]:cj-text-foreground data-[state=active]:cj-shadow-sm focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-pointer-events-none disabled:cj-opacity-50",e),...t}));Eo.displayName=jg.displayName;const ko=b.forwardRef(({className:e,...t},n)=>d.jsx(_g,{ref:n,className:ie("cj-mt-2 cj-ring-offset-background focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2",e),...t}));ko.displayName=_g.displayName;function l2(e){const t=[];if(!e||typeof e!="object")return{valid:!1,errors:["Input is not a valid JSON object."]};const n=e;return(!n.journey_id||typeof n.journey_id!="string")&&t.push('Missing or invalid "journey_id" (string).'),Array.isArray(n.nodes)?n.nodes.forEach((r,o)=>{r.node_id||t.push(`Node ${o}: missing "node_id".`),r.question_key||t.push(`Node ${o}: missing "question_key".`),r.actor||t.push(`Node ${o}: missing "actor".`)}):t.push('Missing or invalid "nodes" (array).'),Array.isArray(n.edges)?n.edges.forEach((r,o)=>{r.edge_id||t.push(`Edge ${o}: missing "edge_id".`),r.from_node_id||t.push(`Edge ${o}: missing "from_node_id".`),r.to_node_id||t.push(`Edge ${o}: missing "to_node_id".`)}):t.push('Missing or invalid "edges" (array).'),{valid:t.length===0,errors:t}}function d2(){const{t:e}=dt(),[t,n]=_.useState(!1),[r,o]=_.useState(""),[a,s]=_.useState([]),i=_.useRef(null),c=$e(h=>h.importJourneySpec),l=_.useCallback(h=>{s([]);let p;try{p=JSON.parse(h)}catch{s(["Invalid JSON: could not parse the input."]);return}const m=l2(p);if(!m.valid){s(m.errors);return}c(p),$t.success("Journey imported successfully"),o(""),s([]),n(!1)},[c]),u=_.useCallback(h=>{var g;const p=(g=h.target.files)==null?void 0:g[0];if(!p)return;const m=new FileReader;m.onload=y=>{var w;const v=(w=y.target)==null?void 0:w.result;o(v),l(v)},m.readAsText(p),h.target.value=""},[l]),f=_.useCallback(async()=>{try{const h=await navigator.clipboard.readText();o(h)}catch{$t.error("Could not read clipboard")}},[]);return d.jsxs(tg,{open:t,onOpenChange:h=>{n(h),h||(s([]),o(""))},children:[d.jsx(BM,{asChild:!0,children:d.jsxs(fe,{variant:"outline",size:"sm",children:[d.jsx(Hp,{className:"cj-h-4 cj-w-4 cj-mr-1"}),"Import"]})}),d.jsxs(dl,{className:"sm:cj-max-w-lg",children:[d.jsxs(ul,{children:[d.jsx(hl,{children:e("import_title")}),d.jsx(pl,{children:e("import_description")})]}),d.jsxs(Sg,{defaultValue:"paste",className:"cj-w-full",children:[d.jsxs(gl,{className:"cj-grid cj-w-full cj-grid-cols-2",children:[d.jsx(Eo,{value:"paste",children:e("import_paste_tab")}),d.jsx(Eo,{value:"file",children:e("import_upload_tab")})]}),d.jsxs(ko,{value:"paste",className:"cj-space-y-3 cj-mt-3",children:[d.jsx("div",{className:"cj-flex cj-justify-end",children:d.jsxs(fe,{variant:"ghost",size:"sm",onClick:f,className:"cj-h-7 cj-text-xs",children:[d.jsx(WN,{className:"cj-h-3 cj-w-3 cj-mr-1"}),e("import_paste_clipboard")]})}),d.jsx(ks,{placeholder:'{"journey_id": "...", "nodes": [...], "edges": [...]}',value:r,onChange:h=>o(h.target.value),className:"cj-min-h-[200px] cj-font-mono cj-text-xs"})]}),d.jsx(ko,{value:"file",className:"cj-mt-3",children:d.jsxs("div",{className:"cj-border-2 cj-border-dashed cj-rounded-lg cj-p-8 cj-text-center cj-cursor-pointer hover:cj-border-primary/50 cj-transition-colors",onClick:()=>{var h;return(h=i.current)==null?void 0:h.click()},children:[d.jsx(HN,{className:"cj-h-8 cj-w-8 cj-mx-auto cj-mb-2 cj-text-muted-foreground"}),d.jsxs("p",{className:"cj-text-sm cj-text-muted-foreground",children:["Click to select a ",d.jsx("strong",{children:".json"})," file"]}),d.jsx("input",{ref:i,type:"file",accept:".json,application/json",className:"cj-hidden",onChange:u})]})})]}),a.length>0&&d.jsxs("div",{className:"cj-bg-destructive/10 cj-border cj-border-destructive/30 cj-rounded-md cj-p-3 cj-space-y-1",children:[d.jsx("p",{className:"cj-text-xs cj-font-medium cj-text-destructive",children:e("import_validation_errors")}),d.jsx("ul",{className:"cj-text-xs cj-text-destructive/80 cj-list-disc cj-list-inside cj-space-y-0.5",children:a.map((h,p)=>d.jsx("li",{children:h},p))})]}),d.jsxs(fl,{children:[d.jsx(fe,{variant:"outline",onClick:()=>n(!1),children:e("cancel")}),d.jsx(fe,{onClick:()=>l(r),disabled:!r.trim(),children:e("import_button")})]})]})]})}function u2(e,t){const n=[];if(e.length===0)return n;const r=new Set(t.map(y=>y.target)),o=e.filter(y=>!r.has(y.id));o.length===0?n.push({type:"error",category:"no-start",message:"No start node found. Every node has incoming edges, which implies a loop."}):o.length>1&&n.push({type:"warning",category:"multi-start",message:`Multiple start nodes detected: ${o.map(y=>y.data.label).join(", ")}. Only the first will be used.`,nodeIds:o.map(y=>y.id)});const a=new Map;for(const y of t)a.has(y.source)||a.set(y.source,[]),a.get(y.source).push(y.target);const s=new Set,i=new Set,c=new Set;function l(y){s.add(y),i.add(y);let v=!1;for(const w of a.get(y)||[])i.has(w)?(c.add(y),c.add(w),v=!0):s.has(w)||l(w)&&(v=!0);return i.delete(y),v}for(const y of e)s.has(y.id)||l(y.id);if(c.size>0){const y=e.filter(v=>c.has(v.id)).map(v=>v.data.label);n.push({type:"error",category:"loop",message:`Loop detected involving: ${y.join(", ")}`,nodeIds:[...c]})}const u=new Set(t.map(y=>y.source)),f=e.filter(y=>!r.has(y.id)&&!u.has(y.id)&&e.length>1);for(const y of f)n.push({type:"warning",category:"orphan",message:`"${y.data.label}" is disconnected (no edges).`,nodeIds:[y.id]});const h=e.filter(y=>r.has(y.id)&&!u.has(y.id));h.length>1&&n.push({type:"warning",category:"dead-end",message:`Multiple end nodes: ${h.map(y=>y.data.label).join(", ")}. Verify this is intentional.`,nodeIds:h.map(y=>y.id)});const p=new Map;for(const y of t)p.has(y.source)||p.set(y.source,[]),p.get(y.source).push(y);for(const[y,v]of p){if(v.length<=1)continue;const w=v.some(j=>{var N;return(N=j.data)==null?void 0:N.isDefault}),x=v.filter(j=>{var N,S;return!((N=j.data)!=null&&N.condition)&&!((S=j.data)!=null&&S.isDefault)});if(x.length>0){const j=e.find(N=>N.id===y);n.push({type:"warning",category:"missing-condition",message:`"${j==null?void 0:j.data.label}" has ${v.length} outgoing edges but ${x.length} lack conditions.`,nodeIds:[y],edgeIds:x.map(N=>N.id)})}if(!w&&v.length>1){const j=e.find(N=>N.id===y);n.push({type:"warning",category:"missing-condition",message:`"${j==null?void 0:j.data.label}" has branching edges but no default fallback.`,nodeIds:[y]})}}const m=new Map,g=new Map;for(const y of e){const v=y.data.bindings||[];for(const w of v){const x=w.target_namespace;m.has(x)||(m.set(x,[]),g.set(x,[])),m.get(x).push(y.data.label),g.get(x).push(y.id)}}for(const[y,v]of m)v.length>1&&n.push({type:"warning",category:"duplicate-binding",message:`Duplicate binding "${y}" on nodes: ${v.join(", ")}. The last answer will overwrite previous ones.`,nodeIds:g.get(y)});return n}function f2(e,t){if(e.length===0)return[];const n=new Map;for(const i of e)n.set(i.id,i.data.actor);const r=new Map;for(const i of e){const c=i.data.actor;r.has(c)||r.set(c,[]),r.get(c).push(i)}const o=new Map,a=[];for(const i of t){const c=n.get(i.source),l=n.get(i.target);!c||!l||(c===l?(o.has(c)||o.set(c,[]),o.get(c).push(i)):a.push(i))}const s=[];for(const[i,c]of r){const l=o.get(i)||[],u=new Set(a.filter(m=>n.get(m.target)===i).map(m=>m.target)),f=new Set(a.filter(m=>n.get(m.source)===i).map(m=>m.source)),p=u2(c,l).filter(m=>{if(m.category==="orphan"&&m.nodeIds)return!m.nodeIds.every(g=>u.has(g)||f.has(g));if(m.category==="no-start"&&u.size>0)return!1;if(m.category==="multi-start"&&m.nodeIds){const g=m.nodeIds.filter(y=>!u.has(y));if(g.length<=1)return!1;m.nodeIds=g,m.message=`Multiple start nodes detected: ${g.map(y=>{var v;return(v=c.find(w=>w.id===y))==null?void 0:v.data.label}).join(", ")}. Only the first will be used.`}return!0});for(const m of p)m.actor=i;s.push(...p)}return s}const h2=ps("cj-relative cj-w-full cj-rounded-lg cj-border cj-p-4 [&>svg~*]:cj-pl-7 [&>svg+div]:cj-translate-y-[-3px] [&>svg]:cj-absolute [&>svg]:cj-left-4 [&>svg]:cj-top-4 [&>svg]:cj-text-foreground",{variants:{variant:{default:"cj-bg-background cj-text-foreground",destructive:"cj-border-destructive/50 cj-text-destructive dark:cj-border-destructive [&>svg]:cj-text-destructive"}},defaultVariants:{variant:"default"}}),Cg=b.forwardRef(({className:e,variant:t,...n},r)=>d.jsx("div",{ref:r,role:"alert",className:ie(h2({variant:t}),e),...n}));Cg.displayName="Alert";const Ng=b.forwardRef(({className:e,...t},n)=>d.jsx("h5",{ref:n,className:ie("cj-mb-1 cj-font-medium cj-leading-none cj-tracking-tight",e),...t}));Ng.displayName="AlertTitle";const Eg=b.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:ie("cj-text-sm [&_p]:cj-leading-relaxed",e),...t}));Eg.displayName="AlertDescription";function p2(e){const t=m2(e),n=b.forwardRef((r,o)=>{const{children:a,...s}=r,i=b.Children.toArray(a),c=i.find(y2);if(c){const l=c.props.children,u=i.map(f=>f===c?b.Children.count(l)>1?b.Children.only(null):b.isValidElement(l)?l.props.children:null:f);return d.jsx(t,{...s,ref:o,children:b.isValidElement(l)?b.cloneElement(l,void 0,u):null})}return d.jsx(t,{...s,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function m2(e){const t=b.forwardRef((n,r)=>{const{children:o,...a}=n;if(b.isValidElement(o)){const s=v2(o),i=x2(a,o.props);return o.type!==b.Fragment&&(i.ref=r?Xn(r,s):s),b.cloneElement(o,i)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var g2=Symbol("radix.slottable");function y2(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===g2}function x2(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{const c=a(...i);return o(...i),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function v2(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ds="Popover",[kg]=Ze(Ds,[zr]),Xo=zr(),[b2,Sn]=kg(Ds),Pg=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:s=!1}=e,i=Xo(t),c=b.useRef(null),[l,u]=b.useState(!1),[f,h]=Nt({prop:r,defaultProp:o??!1,onChange:a,caller:Ds});return d.jsx(Qc,{...i,children:d.jsx(b2,{scope:t,contentId:jt(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:b.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:l,onCustomAnchorAdd:b.useCallback(()=>u(!0),[]),onCustomAnchorRemove:b.useCallback(()=>u(!1),[]),modal:s,children:n})})};Pg.displayName=Ds;var Mg="PopoverAnchor",w2=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Sn(Mg,n),a=Xo(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:i}=o;return b.useEffect(()=>(s(),()=>i()),[s,i]),d.jsx(ws,{...a,...r,ref:t})});w2.displayName=Mg;var Dg="PopoverTrigger",Og=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Sn(Dg,n),a=Xo(n),s=me(t,o.triggerRef),i=d.jsx(se.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":$g(o.open),...r,ref:s,onClick:te(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:d.jsx(ws,{asChild:!0,...a,children:i})});Og.displayName=Dg;var yl="PopoverPortal",[j2,_2]=kg(yl,{forceMount:void 0}),Rg=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,a=Sn(yl,t);return d.jsx(j2,{scope:t,forceMount:n,children:d.jsx(Ye,{present:n||a.open,children:d.jsx(Vo,{asChild:!0,container:o,children:r})})})};Rg.displayName=yl;var Dr="PopoverContent",Ag=b.forwardRef((e,t)=>{const n=_2(Dr,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,a=Sn(Dr,e.__scopePopover);return d.jsx(Ye,{present:r||a.open,children:a.modal?d.jsx(C2,{...o,ref:t}):d.jsx(N2,{...o,ref:t})})});Ag.displayName=Dr;var S2=p2("PopoverContent.RemoveScroll"),C2=b.forwardRef((e,t)=>{const n=Sn(Dr,e.__scopePopover),r=b.useRef(null),o=me(t,r),a=b.useRef(!1);return b.useEffect(()=>{const s=r.current;if(s)return sl(s)},[]),d.jsx(Ns,{as:S2,allowPinchZoom:!0,children:d.jsx(Tg,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:te(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),a.current||(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:te(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0,l=i.button===2||c;a.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:te(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),N2=b.forwardRef((e,t)=>{const n=Sn(Dr,e.__scopePopover),r=b.useRef(!1),o=b.useRef(!1);return d.jsx(Tg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,i;(s=e.onCloseAutoFocus)==null||s.call(e,a),a.defaultPrevented||(r.current||(i=n.triggerRef.current)==null||i.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=a.target;((l=n.triggerRef.current)==null?void 0:l.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Tg=b.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...f}=e,h=Sn(Dr,n),p=Xo(n);return al(),d.jsx(Ss,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:d.jsx(Bo,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),children:d.jsx(el,{"data-state":$g(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Ig="PopoverClose",E2=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Sn(Ig,n);return d.jsx(se.button,{type:"button",...r,ref:t,onClick:te(e.onClick,()=>o.onOpenChange(!1))})});E2.displayName=Ig;var k2="PopoverArrow",P2=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Xo(n);return d.jsx(tl,{...o,...r,ref:t})});P2.displayName=k2;function $g(e){return e?"open":"closed"}var M2=Pg,D2=Og,O2=Rg,zg=Ag;const xl=M2,vl=D2,Os=b.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>{const a=qo();return d.jsx(O2,{container:a??void 0,children:d.jsx(zg,{ref:o,align:t,sideOffset:n,className:ie("cj-z-50 cj-w-72 cj-rounded-md cj-border cj-bg-popover cj-p-4 cj-text-popover-foreground cj-shadow-md cj-outline-none data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0 data-[state=closed]:cj-zoom-out-95 data-[state=open]:cj-zoom-in-95 data-[side=bottom]:cj-slide-in-from-top-2 data-[side=left]:cj-slide-in-from-right-2 data-[side=right]:cj-slide-in-from-left-2 data-[side=top]:cj-slide-in-from-bottom-2",e),...r})})});Os.displayName=zg.displayName;var Rs="Collapsible",[R2]=Ze(Rs),[A2,bl]=R2(Rs),Lg=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:a,onOpenChange:s,...i}=e,[c,l]=Nt({prop:r,defaultProp:o??!1,onChange:s,caller:Rs});return d.jsx(A2,{scope:n,disabled:a,contentId:jt(),open:c,onOpenToggle:b.useCallback(()=>l(u=>!u),[l]),children:d.jsx(se.div,{"data-state":jl(c),"data-disabled":a?"":void 0,...i,ref:t})})});Lg.displayName=Rs;var Wg="CollapsibleTrigger",Fg=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=bl(Wg,n);return d.jsx(se.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":jl(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:te(e.onClick,o.onOpenToggle)})});Fg.displayName=Wg;var wl="CollapsibleContent",Bg=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=bl(wl,e.__scopeCollapsible);return d.jsx(Ye,{present:n||o.open,children:({present:a})=>d.jsx(T2,{...r,ref:t,present:a})})});Bg.displayName=wl;var T2=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...a}=e,s=bl(wl,n),[i,c]=b.useState(r),l=b.useRef(null),u=me(t,l),f=b.useRef(0),h=f.current,p=b.useRef(0),m=p.current,g=s.open||i,y=b.useRef(g),v=b.useRef(void 0);return b.useEffect(()=>{const w=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(w)},[]),We(()=>{const w=l.current;if(w){v.current=v.current||{transitionDuration:w.style.transitionDuration,animationName:w.style.animationName},w.style.transitionDuration="0s",w.style.animationName="none";const x=w.getBoundingClientRect();f.current=x.height,p.current=x.width,y.current||(w.style.transitionDuration=v.current.transitionDuration,w.style.animationName=v.current.animationName),c(r)}},[s.open,r]),d.jsx(se.div,{"data-state":jl(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!g,...a,ref:u,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:g&&o})});function jl(e){return e?"open":"closed"}var I2=Lg;const _l=I2,Sl=Fg,Cl=Bg;function uc(e,[t,n]){return Math.min(n,Math.max(t,e))}function $2(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var Nl="ScrollArea",[Hg]=Ze(Nl),[z2,ft]=Hg(Nl),Vg=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:a=600,...s}=e,[i,c]=b.useState(null),[l,u]=b.useState(null),[f,h]=b.useState(null),[p,m]=b.useState(null),[g,y]=b.useState(null),[v,w]=b.useState(0),[x,j]=b.useState(0),[N,S]=b.useState(!1),[C,P]=b.useState(!1),k=me(t,D=>c(D)),T=Go(o);return d.jsx(z2,{scope:n,type:r,dir:T,scrollHideDelay:a,scrollArea:i,viewport:l,onViewportChange:u,content:f,onContentChange:h,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:N,onScrollbarXEnabledChange:S,scrollbarY:g,onScrollbarYChange:y,scrollbarYEnabled:C,onScrollbarYEnabledChange:P,onCornerWidthChange:w,onCornerHeightChange:j,children:d.jsx(se.div,{dir:T,...s,ref:k,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});Vg.displayName=Nl;var Yg="ScrollAreaViewport",qg=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...a}=e,s=ft(Yg,n),i=b.useRef(null),c=me(t,i,s.onViewportChange);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(se.div,{"data-radix-scroll-area-viewport":"",...a,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:d.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});qg.displayName=Yg;var Ut="ScrollAreaScrollbar",El=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ft(Ut,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:s}=o,i=e.orientation==="horizontal";return b.useEffect(()=>(i?a(!0):s(!0),()=>{i?a(!1):s(!1)}),[i,a,s]),o.type==="hover"?d.jsx(L2,{...r,ref:t,forceMount:n}):o.type==="scroll"?d.jsx(W2,{...r,ref:t,forceMount:n}):o.type==="auto"?d.jsx(Gg,{...r,ref:t,forceMount:n}):o.type==="always"?d.jsx(kl,{...r,ref:t}):null});El.displayName=Ut;var L2=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ft(Ut,e.__scopeScrollArea),[a,s]=b.useState(!1);return b.useEffect(()=>{const i=o.scrollArea;let c=0;if(i){const l=()=>{window.clearTimeout(c),s(!0)},u=()=>{c=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return i.addEventListener("pointerenter",l),i.addEventListener("pointerleave",u),()=>{window.clearTimeout(c),i.removeEventListener("pointerenter",l),i.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),d.jsx(Ye,{present:n||a,children:d.jsx(Gg,{"data-state":a?"visible":"hidden",...r,ref:t})})}),W2=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ft(Ut,e.__scopeScrollArea),a=e.orientation==="horizontal",s=Ts(()=>c("SCROLL_END"),100),[i,c]=$2("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return b.useEffect(()=>{if(i==="idle"){const l=window.setTimeout(()=>c("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(l)}},[i,o.scrollHideDelay,c]),b.useEffect(()=>{const l=o.viewport,u=a?"scrollLeft":"scrollTop";if(l){let f=l[u];const h=()=>{const p=l[u];f!==p&&(c("SCROLL"),s()),f=p};return l.addEventListener("scroll",h),()=>l.removeEventListener("scroll",h)}},[o.viewport,a,c,s]),d.jsx(Ye,{present:n||i!=="hidden",children:d.jsx(kl,{"data-state":i==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:te(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:te(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Gg=b.forwardRef((e,t)=>{const n=ft(Ut,e.__scopeScrollArea),{forceMount:r,...o}=e,[a,s]=b.useState(!1),i=e.orientation==="horizontal",c=Ts(()=>{if(n.viewport){const l=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(i?l:u)}},10);return Or(n.viewport,c),Or(n.content,c),d.jsx(Ye,{present:r||a,children:d.jsx(kl,{"data-state":a?"visible":"hidden",...o,ref:t})})}),kl=b.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=ft(Ut,e.__scopeScrollArea),a=b.useRef(null),s=b.useRef(0),[i,c]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=Zg(i.viewport,i.content),u={...r,sizes:i,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:h=>a.current=h,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:h=>s.current=h};function f(h,p){return q2(h,s.current,i,p)}return n==="horizontal"?d.jsx(F2,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const h=o.viewport.scrollLeft,p=Uu(h,i,o.dir);a.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollLeft=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollLeft=f(h,o.dir))}}):n==="vertical"?d.jsx(B2,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const h=o.viewport.scrollTop,p=Uu(h,i);a.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollTop=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollTop=f(h))}}):null}),F2=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,a=ft(Ut,e.__scopeScrollArea),[s,i]=b.useState(),c=b.useRef(null),l=me(t,c,a.onScrollbarXChange);return b.useEffect(()=>{c.current&&i(getComputedStyle(c.current))},[c]),d.jsx(Xg,{"data-orientation":"horizontal",...o,ref:l,sizes:n,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":As(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,f)=>{if(a.viewport){const h=a.viewport.scrollLeft+u.deltaX;e.onWheelScroll(h),ey(h,f)&&u.preventDefault()}},onResize:()=>{c.current&&a.viewport&&s&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Xa(s.paddingLeft),paddingEnd:Xa(s.paddingRight)}})}})}),B2=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,a=ft(Ut,e.__scopeScrollArea),[s,i]=b.useState(),c=b.useRef(null),l=me(t,c,a.onScrollbarYChange);return b.useEffect(()=>{c.current&&i(getComputedStyle(c.current))},[c]),d.jsx(Xg,{"data-orientation":"vertical",...o,ref:l,sizes:n,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":As(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,f)=>{if(a.viewport){const h=a.viewport.scrollTop+u.deltaY;e.onWheelScroll(h),ey(h,f)&&u.preventDefault()}},onResize:()=>{c.current&&a.viewport&&s&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Xa(s.paddingTop),paddingEnd:Xa(s.paddingBottom)}})}})}),[H2,Ug]=Hg(Ut),Xg=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:a,onThumbPointerUp:s,onThumbPointerDown:i,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:f,...h}=e,p=ft(Ut,n),[m,g]=b.useState(null),y=me(t,k=>g(k)),v=b.useRef(null),w=b.useRef(""),x=p.viewport,j=r.content-r.viewport,N=Ge(u),S=Ge(c),C=Ts(f,10);function P(k){if(v.current){const T=k.clientX-v.current.left,D=k.clientY-v.current.top;l({x:T,y:D})}}return b.useEffect(()=>{const k=T=>{const D=T.target;(m==null?void 0:m.contains(D))&&N(T,j)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[x,m,j,N]),b.useEffect(S,[r,S]),Or(m,C),Or(p.content,C),d.jsx(H2,{scope:n,scrollbar:m,hasThumb:o,onThumbChange:Ge(a),onThumbPointerUp:Ge(s),onThumbPositionChange:S,onThumbPointerDown:Ge(i),children:d.jsx(se.div,{...h,ref:y,style:{position:"absolute",...h.style},onPointerDown:te(e.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),v.current=m.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),P(k))}),onPointerMove:te(e.onPointerMove,P),onPointerUp:te(e.onPointerUp,k=>{const T=k.target;T.hasPointerCapture(k.pointerId)&&T.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=w.current,p.viewport&&(p.viewport.style.scrollBehavior=""),v.current=null})})})}),Ua="ScrollAreaThumb",Kg=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Ug(Ua,e.__scopeScrollArea);return d.jsx(Ye,{present:n||o.hasThumb,children:d.jsx(V2,{ref:t,...r})})}),V2=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,a=ft(Ua,n),s=Ug(Ua,n),{onThumbPositionChange:i}=s,c=me(t,f=>s.onThumbChange(f)),l=b.useRef(void 0),u=Ts(()=>{l.current&&(l.current(),l.current=void 0)},100);return b.useEffect(()=>{const f=a.viewport;if(f){const h=()=>{if(u(),!l.current){const p=G2(f,i);l.current=p,i()}};return i(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[a.viewport,u,i]),d.jsx(se.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:te(e.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),m=f.clientX-p.left,g=f.clientY-p.top;s.onThumbPointerDown({x:m,y:g})}),onPointerUp:te(e.onPointerUp,s.onThumbPointerUp)})});Kg.displayName=Ua;var Pl="ScrollAreaCorner",Jg=b.forwardRef((e,t)=>{const n=ft(Pl,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?d.jsx(Y2,{...e,ref:t}):null});Jg.displayName=Pl;var Y2=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=ft(Pl,n),[a,s]=b.useState(0),[i,c]=b.useState(0),l=!!(a&&i);return Or(o.scrollbarX,()=>{var f;const u=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(u),c(u)}),Or(o.scrollbarY,()=>{var f;const u=((f=o.scrollbarY)==null?void 0:f.offsetWidth)||0;o.onCornerWidthChange(u),s(u)}),l?d.jsx(se.div,{...r,ref:t,style:{width:a,height:i,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Xa(e){return e?parseInt(e,10):0}function Zg(e,t){const n=e/t;return isNaN(n)?0:n}function As(e){const t=Zg(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function q2(e,t,n,r="ltr"){const o=As(n),a=o/2,s=t||a,i=o-s,c=n.scrollbar.paddingStart+s,l=n.scrollbar.size-n.scrollbar.paddingEnd-i,u=n.content-n.viewport,f=r==="ltr"?[0,u]:[u*-1,0];return Qg([c,l],f)(e)}function Uu(e,t,n="ltr"){const r=As(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,s=t.content-t.viewport,i=a-r,c=n==="ltr"?[0,s]:[s*-1,0],l=uc(e,c);return Qg([0,s],[0,i])(l)}function Qg(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function ey(e,t){return e>0&&e<t}var G2=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const a={left:e.scrollLeft,top:e.scrollTop},s=n.left!==a.left,i=n.top!==a.top;(s||i)&&t(),n=a,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Ts(e,t){const n=Ge(e),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Or(e,t){const n=Ge(t);We(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var ty=Vg,U2=qg,X2=Jg;const Lr=b.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(ty,{ref:r,className:ie("cj-relative cj-overflow-hidden",e),...n,children:[d.jsx(U2,{className:"cj-h-full cj-w-full cj-rounded-[inherit]",children:t}),d.jsx(ny,{}),d.jsx(X2,{})]}));Lr.displayName=ty.displayName;const ny=b.forwardRef(({className:e,orientation:t="vertical",...n},r)=>d.jsx(El,{ref:r,orientation:t,className:ie("cj-flex cj-touch-none cj-select-none cj-transition-colors",t==="vertical"&&"cj-h-full cj-w-2.5 cj-border-l cj-border-l-transparent cj-p-[1px]",t==="horizontal"&&"cj-h-2.5 cj-flex-col cj-border-t cj-border-t-transparent cj-p-[1px]",e),...n,children:d.jsx(Kg,{className:"cj-relative cj-flex-1 cj-rounded-full cj-bg-border"})}));ny.displayName=El.displayName;const K2={customer:{label:"Customer Flow",icon:Vc},operator:{label:"Operator Flow",icon:Op}};function J2(){const e=$e(m=>m.nodes),t=$e(m=>m.edges),n=$e(m=>m.setSelectedNode),r=$e(m=>m.setSelectedEdge),[o,a]=_.useState(!1),{t:s}=dt(),i=_.useMemo(()=>f2(e,t),[e,t]),c=_.useMemo(()=>{const m={};for(const g of i){const y=g.actor||"unknown";m[y]||(m[y]=[]),m[y].push(g)}return m},[i]),l=_.useMemo(()=>{const m=new Set(e.map(g=>g.data.actor));return Array.from(m)},[e]),u=i.filter(m=>m.type==="error"),f=i.filter(m=>m.type==="warning"),h=m=>{var g,y;(g=m.nodeIds)!=null&&g[0]?n(m.nodeIds[0]):(y=m.edgeIds)!=null&&y[0]&&r(m.edgeIds[0])},p=i.length;return d.jsxs(xl,{open:o,onOpenChange:a,children:[d.jsx(vl,{asChild:!0,children:d.jsxs(fe,{variant:"outline",size:"sm",className:u.length>0?"cj-border-destructive cj-text-destructive hover:cj-text-destructive":f.length>0?"cj-border-yellow-500 cj-text-yellow-600 hover:cj-text-yellow-600":"",children:[d.jsx(JN,{className:"cj-h-4 cj-w-4 cj-mr-1"}),s("validation_validate"),p>0&&d.jsx(ct,{variant:u.length>0?"destructive":"secondary",className:"cj-ml-1.5 cj-h-5 cj-min-w-5 cj-px-1 cj-text-xs",children:p})]})}),d.jsxs(Os,{className:"cj-w-96 cj-p-0",align:"end",children:[d.jsxs("div",{className:"cj-p-3 cj-border-b",children:[d.jsx("h4",{className:"cj-font-semibold cj-text-sm",children:s("validation_title")}),d.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mt-0.5",children:i.length===0?s("validation_no_issues"):`${u.length} error(s), ${f.length} warning(s)`})]}),i.length===0?d.jsxs("div",{className:"cj-p-6 cj-flex cj-flex-col cj-items-center cj-gap-2 cj-text-muted-foreground",children:[d.jsx(tc,{className:"cj-h-8 cj-w-8 cj-text-green-500"}),d.jsx("span",{className:"cj-text-sm cj-font-medium",children:s("validation_good")})]}):d.jsx(Lr,{className:"cj-max-h-80",children:d.jsx("div",{className:"cj-p-2 cj-space-y-1",children:l.map(m=>{const g=K2[m]||{label:m,icon:Vc},y=g.icon,v=c[m]||[],w=v.filter(x=>x.type==="error");return d.jsxs(_l,{defaultOpen:v.length>0,children:[d.jsxs(Sl,{className:"cj-flex cj-items-center cj-gap-2 cj-w-full cj-px-2 cj-py-1.5 cj-rounded hover:cj-bg-accent/50 cj-transition-colors cj-text-sm cj-font-medium",children:[d.jsx(Tr,{className:"cj-h-3.5 cj-w-3.5 cj-text-muted-foreground cj-transition-transform [[data-state=closed]>&]:cj-rotate-[-90deg]"}),d.jsx(y,{className:"cj-h-3.5 cj-w-3.5"}),d.jsx("span",{children:g.label}),v.length===0?d.jsx(tc,{className:"cj-h-3.5 cj-w-3.5 cj-text-green-500 cj-ml-auto"}):d.jsx(ct,{variant:w.length>0?"destructive":"secondary",className:"cj-ml-auto cj-h-5 cj-min-w-5 cj-px-1 cj-text-xs",children:v.length})]}),d.jsx(Cl,{children:v.length===0?d.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-pl-8 cj-py-1",children:s("validation_no_issues_actor")}):d.jsx("div",{className:"cj-pl-2 cj-pr-1 cj-pb-1 cj-space-y-1.5",children:v.map((x,j)=>d.jsxs(Cg,{variant:x.type==="error"?"destructive":"default",className:"cj-cursor-pointer hover:cj-bg-accent/50 cj-transition-colors cj-py-2",onClick:()=>h(x),children:[x.type==="error"?d.jsx($p,{className:"cj-h-4 cj-w-4"}):d.jsx(ZN,{className:"cj-h-4 cj-w-4 cj-text-yellow-500"}),d.jsx(Ng,{className:"cj-text-xs cj-font-semibold cj-uppercase cj-tracking-wide",children:x.category.replace("-"," ")}),d.jsx(Eg,{className:"cj-text-xs",children:x.message})]},j))})})]},m)})})})]})]})}const Z2={questionNode:nE},Q2={conditional:aE},Xu={padding:.3,maxZoom:.8};function eD({onOpenRunner:e,readOnly:t=!1}){const n=_.useRef(null),{screenToFlowPosition:r,fitView:o}=fs(),{t:a}=dt();ZC();const{nodes:s,edges:i,onNodesChange:c,onEdgesChange:l,onConnect:u,addNodeFromSpec:f,setSelectedNode:h,setSelectedEdge:p,clearSelection:m,exportJourneySpec:g,isPreviewActive:y,previewPath:v,previewCurrentNodeId:w}=$e(),x=_.useCallback(M=>{M.preventDefault(),M.dataTransfer.dropEffect="copy"},[]),j=_.useCallback(M=>{M.preventDefault();const L=M.dataTransfer.getData("application/json");if(L)try{const E=JSON.parse(L),I=r({x:M.clientX,y:M.clientY});f(E,I)}catch{console.error("Failed to parse dropped data")}},[r,f]),N=_.useCallback((M,L)=>{h(L.id)},[h]),S=_.useCallback((M,L)=>{p(L.id)},[p]),C=_.useCallback(()=>{m()},[m]),P=_.useCallback(()=>{const M=g(),L=JSON.stringify(M,null,2);navigator.clipboard.writeText(L).then(()=>{$t.success(a("builder_export_copied"))});const E=new Blob([L],{type:"application/json"}),I=URL.createObjectURL(E),R=document.createElement("a");R.href=I,R.download=`${M.journey_id}.json`,R.click(),URL.revokeObjectURL(I)},[g]),k=_.useCallback(()=>{const M=$e.getState();M._pushSnapshot();const{nodes:L}=M,E=Math.ceil(Math.sqrt(L.length)),I={x:280,y:180},R=L.map((z,A)=>{const O=A%E,F=Math.floor(A/E);return{...z,position:{x:O*I.x+50,y:F*I.y+50}}});$e.setState({nodes:R}),setTimeout(()=>o(Xu),50)},[o]),T=_.useMemo(()=>{if(!y)return s;const M=new Set(v);return s.map(L=>({...L,data:{...L.data,isInPreviewPath:M.has(L.id),isCurrentPreviewNode:L.id===w}}))},[s,y,v,w]),D=_.useMemo(()=>{if(!y)return i;const M=new Set;for(let L=0;L<v.length-1;L++){const E=v[L],I=v[L+1],R=i.find(z=>z.source===E&&z.target===I);R&&M.add(R.id)}return i.map(L=>({...L,data:{...L.data,isInPreviewPath:M.has(L.id)}}))},[i,y,v]);return d.jsx("div",{ref:n,className:"cj-h-full cj-w-full",children:d.jsxs(HS,{nodes:T,edges:D,onNodesChange:c,onEdgesChange:l,onConnect:t?void 0:u,onDragOver:t?void 0:x,onDrop:t?void 0:j,onNodeClick:N,onEdgeClick:S,onPaneClick:C,nodeTypes:Z2,edgeTypes:Q2,defaultEdgeOptions:{type:"conditional"},fitView:!0,fitViewOptions:Xu,deleteKeyCode:t?null:"Delete",nodesDraggable:!t,nodesConnectable:!t,elementsSelectable:!t,className:"cj-bg-muted/30",children:[d.jsx(KS,{gap:20,size:1}),d.jsx(rC,{}),d.jsx(gC,{className:"!cj-bg-background !cj-border-border",nodeColor:()=>"hsl(var(--claims-journey-primary))"}),d.jsxs(Wo,{position:"top-right",className:"cj-flex cj-gap-2",children:[d.jsx(MP,{delayDuration:300,children:!t&&d.jsxs(d.Fragment,{children:[d.jsxs(Tu,{children:[d.jsx(Iu,{asChild:!0,children:d.jsx(fe,{variant:"outline",size:"icon",className:"cj-h-8 cj-w-8",onClick:()=>$e.getState().undo(),disabled:!$e.getState().canUndo(),children:d.jsx(QN,{className:"cj-h-4 cj-w-4"})})}),d.jsx(cc,{children:"Undo (Ctrl+Z)"})]}),d.jsxs(Tu,{children:[d.jsx(Iu,{asChild:!0,children:d.jsx(fe,{variant:"outline",size:"icon",className:"cj-h-8 cj-w-8",onClick:()=>$e.getState().redo(),disabled:!$e.getState().canRedo(),children:d.jsx(KN,{className:"cj-h-4 cj-w-4"})})}),d.jsx(cc,{children:"Redo (Ctrl+Y)"})]})]})}),d.jsx(J2,{}),!t&&d.jsx(d2,{}),e&&d.jsxs(fe,{variant:"outline",size:"sm",onClick:e,children:[d.jsx(Fa,{className:"cj-h-4 cj-w-4 cj-mr-1"}),a("builder_open_runner")]}),!t&&d.jsxs(fe,{variant:"outline",size:"sm",onClick:k,children:[d.jsx(YN,{className:"cj-h-4 cj-w-4 cj-mr-1"}),a("builder_auto_layout")]}),d.jsxs(fe,{size:"sm",onClick:P,children:[d.jsx(FN,{className:"cj-h-4 cj-w-4 cj-mr-1"}),a("builder_export_json")]})]})]})})}function tD({onOpenRunner:e,readOnly:t}){return d.jsx(yp,{children:d.jsx(eD,{onOpenRunner:e,readOnly:t})})}const ze=b.forwardRef(({className:e,type:t,...n},r)=>d.jsx("input",{type:t,className:ie("cj-flex cj-h-10 cj-w-full cj-rounded-md cj-border cj-border-input cj-bg-background cj-px-3 cj-py-2 cj-text-base cj-ring-offset-background file:cj-border-0 file:cj-bg-transparent file:cj-text-sm file:cj-font-medium file:cj-text-foreground placeholder:cj-text-muted-foreground focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-cursor-not-allowed disabled:cj-opacity-50 md:cj-text-sm",e),ref:r,...n}));ze.displayName="Input";function nD(e){const t=rD(e),n=b.forwardRef((r,o)=>{const{children:a,...s}=r,i=b.Children.toArray(a),c=i.find(aD);if(c){const l=c.props.children,u=i.map(f=>f===c?b.Children.count(l)>1?b.Children.only(null):b.isValidElement(l)?l.props.children:null:f);return d.jsx(t,{...s,ref:o,children:b.isValidElement(l)?b.cloneElement(l,void 0,u):null})}return d.jsx(t,{...s,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function rD(e){const t=b.forwardRef((n,r)=>{const{children:o,...a}=n;if(b.isValidElement(o)){const s=iD(o),i=sD(a,o.props);return o.type!==b.Fragment&&(i.ref=r?Xn(r,s):s),b.cloneElement(o,i)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oD=Symbol("radix.slottable");function aD(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===oD}function sD(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{const c=a(...i);return o(...i),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function iD(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Is(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var cD=[" ","Enter","ArrowUp","ArrowDown"],lD=[" ","Enter"],Yn="Select",[$s,zs,dD]=rg(Yn),[Wr]=Ze(Yn,[dD,zr]),Ls=zr(),[uD,Cn]=Wr(Yn),[fD,hD]=Wr(Yn),ry=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:a,value:s,defaultValue:i,onValueChange:c,dir:l,name:u,autoComplete:f,disabled:h,required:p,form:m}=e,g=Ls(t),[y,v]=b.useState(null),[w,x]=b.useState(null),[j,N]=b.useState(!1),S=Go(l),[C,P]=Nt({prop:r,defaultProp:o??!1,onChange:a,caller:Yn}),[k,T]=Nt({prop:s,defaultProp:i,onChange:c,caller:Yn}),D=b.useRef(null),M=y?m||!!y.closest("form"):!0,[L,E]=b.useState(new Set),I=Array.from(L).map(R=>R.props.value).join(";");return d.jsx(Qc,{...g,children:d.jsxs(uD,{required:p,scope:t,trigger:y,onTriggerChange:v,valueNode:w,onValueNodeChange:x,valueNodeHasChildren:j,onValueNodeHasChildrenChange:N,contentId:jt(),value:k,onValueChange:T,open:C,onOpenChange:P,dir:S,triggerPointerDownPosRef:D,disabled:h,children:[d.jsx($s.Provider,{scope:t,children:d.jsx(fD,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(R=>{E(z=>new Set(z).add(R))},[]),onNativeOptionRemove:b.useCallback(R=>{E(z=>{const A=new Set(z);return A.delete(R),A})},[]),children:n})}),M?d.jsxs(Ey,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:f,value:k,onChange:R=>T(R.target.value),disabled:h,form:m,children:[k===void 0?d.jsx("option",{value:""}):null,Array.from(L)]},I):null]})})};ry.displayName=Yn;var oy="SelectTrigger",ay=b.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,a=Ls(n),s=Cn(oy,n),i=s.disabled||r,c=me(t,s.onTriggerChange),l=zs(n),u=b.useRef("touch"),[f,h,p]=Py(g=>{const y=l().filter(x=>!x.disabled),v=y.find(x=>x.value===s.value),w=My(y,g,v);w!==void 0&&s.onValueChange(w.value)}),m=g=>{i||(s.onOpenChange(!0),p()),g&&(s.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return d.jsx(ws,{asChild:!0,...a,children:d.jsx(se.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":ky(s.value)?"":void 0,...o,ref:c,onClick:te(o.onClick,g=>{g.currentTarget.focus(),u.current!=="mouse"&&m(g)}),onPointerDown:te(o.onPointerDown,g=>{u.current=g.pointerType;const y=g.target;y.hasPointerCapture(g.pointerId)&&y.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(m(g),g.preventDefault())}),onKeyDown:te(o.onKeyDown,g=>{const y=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&h(g.key),!(y&&g.key===" ")&&cD.includes(g.key)&&(m(),g.preventDefault())})})})});ay.displayName=oy;var sy="SelectValue",iy=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:a,placeholder:s="",...i}=e,c=Cn(sy,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,f=me(t,c.onValueNodeChange);return We(()=>{l(u)},[l,u]),d.jsx(se.span,{...i,ref:f,style:{pointerEvents:"none"},children:ky(c.value)?d.jsx(d.Fragment,{children:s}):a})});iy.displayName=sy;var pD="SelectIcon",cy=b.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return d.jsx(se.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});cy.displayName=pD;var mD="SelectPortal",ly=e=>d.jsx(Vo,{asChild:!0,...e});ly.displayName=mD;var qn="SelectContent",dy=b.forwardRef((e,t)=>{const n=Cn(qn,e.__scopeSelect),[r,o]=b.useState();if(We(()=>{o(new DocumentFragment)},[]),!n.open){const a=r;return a?ns.createPortal(d.jsx(uy,{scope:e.__scopeSelect,children:d.jsx($s.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),a):null}return d.jsx(fy,{...e,ref:t})});dy.displayName=qn;var mt=10,[uy,Nn]=Wr(qn),gD="SelectContentImpl",yD=nD("SelectContent.RemoveScroll"),fy=b.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:s,side:i,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:g,avoidCollisions:y,...v}=e,w=Cn(qn,n),[x,j]=b.useState(null),[N,S]=b.useState(null),C=me(t,$=>j($)),[P,k]=b.useState(null),[T,D]=b.useState(null),M=zs(n),[L,E]=b.useState(!1),I=b.useRef(!1);b.useEffect(()=>{if(x)return sl(x)},[x]),al();const R=b.useCallback($=>{const[W,...U]=M().map(J=>J.ref.current),[K]=U.slice(-1),X=document.activeElement;for(const J of $)if(J===X||(J==null||J.scrollIntoView({block:"nearest"}),J===W&&N&&(N.scrollTop=0),J===K&&N&&(N.scrollTop=N.scrollHeight),J==null||J.focus(),document.activeElement!==X))return},[M,N]),z=b.useCallback(()=>R([P,x]),[R,P,x]);b.useEffect(()=>{L&&z()},[L,z]);const{onOpenChange:A,triggerPointerDownPosRef:O}=w;b.useEffect(()=>{if(x){let $={x:0,y:0};const W=K=>{var X,J;$={x:Math.abs(Math.round(K.pageX)-(((X=O.current)==null?void 0:X.x)??0)),y:Math.abs(Math.round(K.pageY)-(((J=O.current)==null?void 0:J.y)??0))}},U=K=>{$.x<=10&&$.y<=10?K.preventDefault():x.contains(K.target)||A(!1),document.removeEventListener("pointermove",W),O.current=null};return O.current!==null&&(document.addEventListener("pointermove",W),document.addEventListener("pointerup",U,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",U,{capture:!0})}}},[x,A,O]),b.useEffect(()=>{const $=()=>A(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[A]);const[F,G]=Py($=>{const W=M().filter(X=>!X.disabled),U=W.find(X=>X.ref.current===document.activeElement),K=My(W,$,U);K&&setTimeout(()=>K.ref.current.focus())}),Y=b.useCallback(($,W,U)=>{const K=!I.current&&!U;(w.value!==void 0&&w.value===W||K)&&(k($),K&&(I.current=!0))},[w.value]),H=b.useCallback(()=>x==null?void 0:x.focus(),[x]),V=b.useCallback(($,W,U)=>{const K=!I.current&&!U;(w.value!==void 0&&w.value===W||K)&&D($)},[w.value]),B=r==="popper"?fc:hy,q=B===fc?{side:i,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:g,avoidCollisions:y}:{};return d.jsx(uy,{scope:n,content:x,viewport:N,onViewportChange:S,itemRefCallback:Y,selectedItem:P,onItemLeave:H,itemTextRefCallback:V,focusSelectedItem:z,selectedItemText:T,position:r,isPositioned:L,searchRef:F,children:d.jsx(Ns,{as:yD,allowPinchZoom:!0,children:d.jsx(Ss,{asChild:!0,trapped:w.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:te(o,$=>{var W;(W=w.trigger)==null||W.focus({preventScroll:!0}),$.preventDefault()}),children:d.jsx(Bo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:d.jsx(B,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:$=>$.preventDefault(),...v,...q,onPlaced:()=>E(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:te(v.onKeyDown,$=>{const W=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!W&&$.key.length===1&&G($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let K=M().filter(X=>!X.disabled).map(X=>X.ref.current);if(["ArrowUp","End"].includes($.key)&&(K=K.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const X=$.target,J=K.indexOf(X);K=K.slice(J+1)}setTimeout(()=>R(K)),$.preventDefault()}})})})})})})});fy.displayName=gD;var xD="SelectItemAlignedPosition",hy=b.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,a=Cn(qn,n),s=Nn(qn,n),[i,c]=b.useState(null),[l,u]=b.useState(null),f=me(t,C=>u(C)),h=zs(n),p=b.useRef(!1),m=b.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:v,focusSelectedItem:w}=s,x=b.useCallback(()=>{if(a.trigger&&a.valueNode&&i&&l&&g&&y&&v){const C=a.trigger.getBoundingClientRect(),P=l.getBoundingClientRect(),k=a.valueNode.getBoundingClientRect(),T=v.getBoundingClientRect();if(a.dir!=="rtl"){const X=T.left-P.left,J=k.left-X,Z=C.left-J,ee=C.width+Z,ce=Math.max(ee,P.width),ne=window.innerWidth-mt,xe=uc(J,[mt,Math.max(mt,ne-ce)]);i.style.minWidth=ee+"px",i.style.left=xe+"px"}else{const X=P.right-T.right,J=window.innerWidth-k.right-X,Z=window.innerWidth-C.right-J,ee=C.width+Z,ce=Math.max(ee,P.width),ne=window.innerWidth-mt,xe=uc(J,[mt,Math.max(mt,ne-ce)]);i.style.minWidth=ee+"px",i.style.right=xe+"px"}const D=h(),M=window.innerHeight-mt*2,L=g.scrollHeight,E=window.getComputedStyle(l),I=parseInt(E.borderTopWidth,10),R=parseInt(E.paddingTop,10),z=parseInt(E.borderBottomWidth,10),A=parseInt(E.paddingBottom,10),O=I+R+L+A+z,F=Math.min(y.offsetHeight*5,O),G=window.getComputedStyle(g),Y=parseInt(G.paddingTop,10),H=parseInt(G.paddingBottom,10),V=C.top+C.height/2-mt,B=M-V,q=y.offsetHeight/2,$=y.offsetTop+q,W=I+R+$,U=O-W;if(W<=V){const X=D.length>0&&y===D[D.length-1].ref.current;i.style.bottom="0px";const J=l.clientHeight-g.offsetTop-g.offsetHeight,Z=Math.max(B,q+(X?H:0)+J+z),ee=W+Z;i.style.height=ee+"px"}else{const X=D.length>0&&y===D[0].ref.current;i.style.top="0px";const Z=Math.max(V,I+g.offsetTop+(X?Y:0)+q)+U;i.style.height=Z+"px",g.scrollTop=W-V+g.offsetTop}i.style.margin=`${mt}px 0`,i.style.minHeight=F+"px",i.style.maxHeight=M+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[h,a.trigger,a.valueNode,i,l,g,y,v,a.dir,r]);We(()=>x(),[x]);const[j,N]=b.useState();We(()=>{l&&N(window.getComputedStyle(l).zIndex)},[l]);const S=b.useCallback(C=>{C&&m.current===!0&&(x(),w==null||w(),m.current=!1)},[x,w]);return d.jsx(bD,{scope:n,contentWrapper:i,shouldExpandOnScrollRef:p,onScrollButtonChange:S,children:d.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:d.jsx(se.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});hy.displayName=xD;var vD="SelectPopperPosition",fc=b.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=mt,...a}=e,s=Ls(n);return d.jsx(el,{...s,...a,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});fc.displayName=vD;var[bD,Ml]=Wr(qn,{}),hc="SelectViewport",py=b.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,a=Nn(hc,n),s=Ml(hc,n),i=me(t,a.onViewportChange),c=b.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),d.jsx($s.Slot,{scope:n,children:d.jsx(se.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:te(o.onScroll,l=>{const u=l.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=s;if(h!=null&&h.current&&f){const p=Math.abs(c.current-u.scrollTop);if(p>0){const m=window.innerHeight-mt*2,g=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),v=Math.max(g,y);if(v<m){const w=v+p,x=Math.min(m,w),j=w-x;f.style.height=x+"px",f.style.bottom==="0px"&&(u.scrollTop=j>0?j:0,f.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});py.displayName=hc;var my="SelectGroup",[wD,jD]=Wr(my),_D=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=jt();return d.jsx(wD,{scope:n,id:o,children:d.jsx(se.div,{role:"group","aria-labelledby":o,...r,ref:t})})});_D.displayName=my;var gy="SelectLabel",yy=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=jD(gy,n);return d.jsx(se.div,{id:o.id,...r,ref:t})});yy.displayName=gy;var Ka="SelectItem",[SD,xy]=Wr(Ka),vy=b.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:a,...s}=e,i=Cn(Ka,n),c=Nn(Ka,n),l=i.value===r,[u,f]=b.useState(a??""),[h,p]=b.useState(!1),m=me(t,w=>{var x;return(x=c.itemRefCallback)==null?void 0:x.call(c,w,r,o)}),g=jt(),y=b.useRef("touch"),v=()=>{o||(i.onValueChange(r),i.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(SD,{scope:n,value:r,disabled:o,textId:g,isSelected:l,onItemTextChange:b.useCallback(w=>{f(x=>x||((w==null?void 0:w.textContent)??"").trim())},[]),children:d.jsx($s.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:d.jsx(se.div,{role:"option","aria-labelledby":g,"data-highlighted":h?"":void 0,"aria-selected":l&&h,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:m,onFocus:te(s.onFocus,()=>p(!0)),onBlur:te(s.onBlur,()=>p(!1)),onClick:te(s.onClick,()=>{y.current!=="mouse"&&v()}),onPointerUp:te(s.onPointerUp,()=>{y.current==="mouse"&&v()}),onPointerDown:te(s.onPointerDown,w=>{y.current=w.pointerType}),onPointerMove:te(s.onPointerMove,w=>{var x;y.current=w.pointerType,o?(x=c.onItemLeave)==null||x.call(c):y.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:te(s.onPointerLeave,w=>{var x;w.currentTarget===document.activeElement&&((x=c.onItemLeave)==null||x.call(c))}),onKeyDown:te(s.onKeyDown,w=>{var j;((j=c.searchRef)==null?void 0:j.current)!==""&&w.key===" "||(lD.includes(w.key)&&v(),w.key===" "&&w.preventDefault())})})})})});vy.displayName=Ka;var ro="SelectItemText",by=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...a}=e,s=Cn(ro,n),i=Nn(ro,n),c=xy(ro,n),l=hD(ro,n),[u,f]=b.useState(null),h=me(t,v=>f(v),c.onItemTextChange,v=>{var w;return(w=i.itemTextRefCallback)==null?void 0:w.call(i,v,c.value,c.disabled)}),p=u==null?void 0:u.textContent,m=b.useMemo(()=>d.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:g,onNativeOptionRemove:y}=l;return We(()=>(g(m),()=>y(m)),[g,y,m]),d.jsxs(d.Fragment,{children:[d.jsx(se.span,{id:c.textId,...a,ref:h}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?ns.createPortal(a.children,s.valueNode):null]})});by.displayName=ro;var wy="SelectItemIndicator",jy=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return xy(wy,n).isSelected?d.jsx(se.span,{"aria-hidden":!0,...r,ref:t}):null});jy.displayName=wy;var pc="SelectScrollUpButton",_y=b.forwardRef((e,t)=>{const n=Nn(pc,e.__scopeSelect),r=Ml(pc,e.__scopeSelect),[o,a]=b.useState(!1),s=me(t,r.onScrollButtonChange);return We(()=>{if(n.viewport&&n.isPositioned){let i=function(){const l=c.scrollTop>0;a(l)};const c=n.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?d.jsx(Cy,{...e,ref:s,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=n;i&&c&&(i.scrollTop=i.scrollTop-c.offsetHeight)}}):null});_y.displayName=pc;var mc="SelectScrollDownButton",Sy=b.forwardRef((e,t)=>{const n=Nn(mc,e.__scopeSelect),r=Ml(mc,e.__scopeSelect),[o,a]=b.useState(!1),s=me(t,r.onScrollButtonChange);return We(()=>{if(n.viewport&&n.isPositioned){let i=function(){const l=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<l;a(u)};const c=n.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?d.jsx(Cy,{...e,ref:s,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=n;i&&c&&(i.scrollTop=i.scrollTop+c.offsetHeight)}}):null});Sy.displayName=mc;var Cy=b.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,a=Nn("SelectScrollButton",n),s=b.useRef(null),i=zs(n),c=b.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return b.useEffect(()=>()=>c(),[c]),We(()=>{var u;const l=i().find(f=>f.ref.current===document.activeElement);(u=l==null?void 0:l.ref.current)==null||u.scrollIntoView({block:"nearest"})},[i]),d.jsx(se.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:te(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:te(o.onPointerMove,()=>{var l;(l=a.onItemLeave)==null||l.call(a),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:te(o.onPointerLeave,()=>{c()})})}),CD="SelectSeparator",Ny=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return d.jsx(se.div,{"aria-hidden":!0,...r,ref:t})});Ny.displayName=CD;var gc="SelectArrow",ND=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ls(n),a=Cn(gc,n),s=Nn(gc,n);return a.open&&s.position==="popper"?d.jsx(tl,{...o,...r,ref:t}):null});ND.displayName=gc;var ED="SelectBubbleInput",Ey=b.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=b.useRef(null),a=me(r,o),s=Is(t);return b.useEffect(()=>{const i=o.current;if(!i)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==t&&u){const f=new Event("change",{bubbles:!0});u.call(i,t),i.dispatchEvent(f)}},[s,t]),d.jsx(se.select,{...n,style:{...mm,...n.style},ref:a,defaultValue:t})});Ey.displayName=ED;function ky(e){return e===""||e===void 0}function Py(e){const t=Ge(e),n=b.useRef(""),r=b.useRef(0),o=b.useCallback(s=>{const i=n.current+s;t(i),function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(i)},[t]),a=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,a]}function My(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let s=kD(e,Math.max(a,0));o.length===1&&(s=s.filter(l=>l!==n));const c=s.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function kD(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var PD=ry,Dy=ay,MD=iy,DD=cy,OD=ly,Oy=dy,RD=py,Ry=yy,Ay=vy,AD=by,TD=jy,Ty=_y,Iy=Sy,$y=Ny;const nn=PD,rn=MD,Wt=b.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(Dy,{ref:r,className:ie("cj-flex cj-h-10 cj-w-full cj-items-center cj-justify-between cj-rounded-md cj-border cj-border-input cj-bg-background cj-px-3 cj-py-2 cj-text-sm cj-ring-offset-background placeholder:cj-text-muted-foreground focus:cj-outline-none focus:cj-ring-2 focus:cj-ring-ring focus:cj-ring-offset-2 disabled:cj-cursor-not-allowed disabled:cj-opacity-50 [&>span]:cj-line-clamp-1",e),...n,children:[t,d.jsx(DD,{asChild:!0,children:d.jsx(Tr,{className:"cj-h-4 cj-w-4 cj-opacity-50"})})]}));Wt.displayName=Dy.displayName;const zy=b.forwardRef(({className:e,...t},n)=>d.jsx(Ty,{ref:n,className:ie("cj-flex cj-cursor-default cj-items-center cj-justify-center cj-py-1",e),...t,children:d.jsx(Tp,{className:"cj-h-4 cj-w-4"})}));zy.displayName=Ty.displayName;const Ly=b.forwardRef(({className:e,...t},n)=>d.jsx(Iy,{ref:n,className:ie("cj-flex cj-cursor-default cj-items-center cj-justify-center cj-py-1",e),...t,children:d.jsx(Tr,{className:"cj-h-4 cj-w-4"})}));Ly.displayName=Iy.displayName;const Ft=b.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>{const a=qo();return d.jsx(OD,{container:a??void 0,children:d.jsxs(Oy,{ref:o,className:ie("cj-relative cj-z-50 cj-max-h-96 cj-min-w-[8rem] cj-overflow-hidden cj-rounded-md cj-border cj-bg-popover cj-text-popover-foreground cj-shadow-md data-[state=open]:cj-animate-in data-[state=closed]:cj-animate-out data-[state=closed]:cj-fade-out-0 data-[state=open]:cj-fade-in-0 data-[state=closed]:cj-zoom-out-95 data-[state=open]:cj-zoom-in-95 data-[side=bottom]:cj-slide-in-from-top-2 data-[side=left]:cj-slide-in-from-right-2 data-[side=right]:cj-slide-in-from-left-2 data-[side=top]:cj-slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:cj-translate-y-1 data-[side=left]:-cj-translate-x-1 data-[side=right]:cj-translate-x-1 data-[side=top]:-cj-translate-y-1",e),position:n,...r,children:[d.jsx(zy,{}),d.jsx(RD,{className:ie("cj-p-1",n==="popper"&&"cj-h-[var(--radix-select-trigger-height)] cj-w-full cj-min-w-[var(--radix-select-trigger-width)]"),children:t}),d.jsx(Ly,{})]})})});Ft.displayName=Oy.displayName;const ID=b.forwardRef(({className:e,...t},n)=>d.jsx(Ry,{ref:n,className:ie("cj-py-1.5 cj-pl-8 cj-pr-2 cj-text-sm cj-font-semibold",e),...t}));ID.displayName=Ry.displayName;const Ee=b.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(Ay,{ref:r,className:ie("cj-relative cj-flex cj-w-full cj-cursor-default cj-select-none cj-items-center cj-rounded-sm cj-py-1.5 cj-pl-8 cj-pr-2 cj-text-sm cj-outline-none data-[disabled]:cj-pointer-events-none data-[disabled]:cj-opacity-50 focus:cj-bg-accent focus:cj-text-accent-foreground",e),...n,children:[d.jsx("span",{className:"cj-absolute cj-left-2 cj-flex cj-h-3.5 cj-w-3.5 cj-items-center cj-justify-center",children:d.jsx(TD,{children:d.jsx(Rp,{className:"cj-h-4 cj-w-4"})})}),d.jsx(AD,{children:t})]}));Ee.displayName=Ay.displayName;const $D=b.forwardRef(({className:e,...t},n)=>d.jsx($y,{ref:n,className:ie("-cj-mx-1 cj-my-1 cj-h-px cj-bg-muted",e),...t}));$D.displayName=$y.displayName;var zD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],LD=zD.reduce((e,t)=>{const n=ms(`Primitive.${t}`),r=b.forwardRef((o,a)=>{const{asChild:s,...i}=o,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(c,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),WD="Label",Wy=b.forwardRef((e,t)=>d.jsx(LD.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Wy.displayName=WD;var Fy=Wy;const FD=ps("cj-text-sm cj-font-medium cj-leading-none peer-disabled:cj-cursor-not-allowed peer-disabled:cj-opacity-70"),we=b.forwardRef(({className:e,...t},n)=>d.jsx(Fy,{ref:n,className:ie(FD(),e),...t}));we.displayName=Fy.displayName;var Ws="Checkbox",[BD]=Ze(Ws),[HD,Dl]=BD(Ws);function VD(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:a,form:s,name:i,onCheckedChange:c,required:l,value:u="on",internal_do_not_use_render:f}=e,[h,p]=Nt({prop:n,defaultProp:o??!1,onChange:c,caller:Ws}),[m,g]=b.useState(null),[y,v]=b.useState(null),w=b.useRef(!1),x=m?!!s||!!m.closest("form"):!0,j={checked:h,disabled:a,setChecked:p,control:m,setControl:g,name:i,form:s,value:u,hasConsumerStoppedPropagationRef:w,required:l,defaultChecked:wn(o)?!1:o,isFormControl:x,bubbleInput:y,setBubbleInput:v};return d.jsx(HD,{scope:t,...j,children:YD(f)?f(j):r})}var By="CheckboxTrigger",Hy=b.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:a,value:s,disabled:i,checked:c,required:l,setControl:u,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:p,bubbleInput:m}=Dl(By,e),g=me(o,u),y=b.useRef(c);return b.useEffect(()=>{const v=a==null?void 0:a.form;if(v){const w=()=>f(y.current);return v.addEventListener("reset",w),()=>v.removeEventListener("reset",w)}},[a,f]),d.jsx(se.button,{type:"button",role:"checkbox","aria-checked":wn(c)?"mixed":c,"aria-required":l,"data-state":Uy(c),"data-disabled":i?"":void 0,disabled:i,value:s,...r,ref:g,onKeyDown:te(t,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:te(n,v=>{f(w=>wn(w)?!0:!w),m&&p&&(h.current=v.isPropagationStopped(),h.current||v.stopPropagation())})})});Hy.displayName=By;var Ol=b.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:a,required:s,disabled:i,value:c,onCheckedChange:l,form:u,...f}=e;return d.jsx(VD,{__scopeCheckbox:n,checked:o,defaultChecked:a,disabled:i,required:s,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:h})=>d.jsxs(d.Fragment,{children:[d.jsx(Hy,{...f,ref:t,__scopeCheckbox:n}),h&&d.jsx(Gy,{__scopeCheckbox:n})]})})});Ol.displayName=Ws;var Vy="CheckboxIndicator",Yy=b.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,a=Dl(Vy,n);return d.jsx(Ye,{present:r||wn(a.checked)||a.checked===!0,children:d.jsx(se.span,{"data-state":Uy(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Yy.displayName=Vy;var qy="CheckboxBubbleInput",Gy=b.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:a,defaultChecked:s,required:i,disabled:c,name:l,value:u,form:f,bubbleInput:h,setBubbleInput:p}=Dl(qy,e),m=me(n,p),g=Is(a),y=bs(r);b.useEffect(()=>{const w=h;if(!w)return;const x=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(x,"checked").set,S=!o.current;if(g!==a&&N){const C=new Event("click",{bubbles:S});w.indeterminate=wn(a),N.call(w,wn(a)?!1:a),w.dispatchEvent(C)}},[h,g,a,o]);const v=b.useRef(wn(a)?!1:a);return d.jsx(se.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??v.current,required:i,disabled:c,name:l,value:u,form:f,...t,tabIndex:-1,ref:m,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Gy.displayName=qy;function YD(e){return typeof e=="function"}function wn(e){return e==="indeterminate"}function Uy(e){return wn(e)?"indeterminate":e?"checked":"unchecked"}const Xy=b.forwardRef(({className:e,...t},n)=>d.jsx(Ol,{ref:n,className:ie("cj-peer cj-h-4 cj-w-4 cj-shrink-0 cj-rounded-sm cj-border cj-border-primary cj-ring-offset-background data-[state=checked]:cj-bg-primary data-[state=checked]:cj-text-primary-foreground focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-cursor-not-allowed disabled:cj-opacity-50",e),...t,children:d.jsx(Yy,{className:ie("cj-flex cj-items-center cj-justify-center cj-text-current"),children:d.jsx(Rp,{className:"cj-h-4 cj-w-4"})})}));Xy.displayName=Ol.displayName;function qD({specs:e,open:t,onOpenChange:n,onCreateNode:r}){const[o,a]=_.useState(""),[s,i]=_.useState(""),[c,l]=_.useState("v1_string"),[u,f]=_.useState([]),[h,p]=_.useState([]),[m,g]=_.useState(""),y=Object.entries(Bc),v=c==="v2_single_option_select-1",w=_.useMemo(()=>e.filter(k=>k.label.toLowerCase().includes(m.toLowerCase())||k.namespace.toLowerCase().includes(m.toLowerCase())),[m]),x=()=>{f([...u,{data:"",label:""}])},j=(k,T,D)=>{f(u.map((M,L)=>L===k?{...M,[T]:D}:M))},N=k=>{f(u.filter((T,D)=>D!==k))},S=k=>{p(T=>T.includes(k)?T.filter(D=>D!==k):[...T,k])},C=()=>{const k=h.map(T=>{const D=e.find(M=>M.id===T);return{target_namespace:(D==null?void 0:D.namespace)||"",spec_id:T}});k.length===0&&k.push({target_namespace:s,spec_id:void 0}),r({label:o,namespace:s||`custom_${Date.now()}`,schema:c,options:v&&u.length>0?u:null,bindings:k}),a(""),i(""),l("v1_string"),f([]),p([]),n(!1)},P=o.trim()!==""&&(s.trim()!==""||h.length>0);return d.jsx(tg,{open:t,onOpenChange:n,children:d.jsxs(dl,{className:"cj-max-w-lg cj-max-h-[85vh] cj-flex cj-flex-col cj-w-[calc(100%-2rem)] [&_input]:cj-ring-offset-0 [&_button]:cj-ring-offset-0 [&_input]:focus-visible:cj-ring-0 [&_input]:focus-visible:cj-border-ring",children:[d.jsxs(ul,{children:[d.jsx(hl,{children:"Create Custom Node"}),d.jsx(pl,{children:"Create a field by choosing a schema type and binding it to existing specs."})]}),d.jsx(Lr,{className:"cj-flex-1 cj-min-h-0 cj-w-full [&>div>div]:!cj-block",children:d.jsxs("div",{className:"cj-space-y-4 cj-py-2 cj-pr-4",children:[d.jsxs("div",{children:[d.jsx(we,{htmlFor:"label",children:"Label *"}),d.jsx(ze,{id:"label",value:o,onChange:k=>a(k.target.value),placeholder:"e.g., Customer Name",className:"cj-mt-1"})]}),d.jsxs("div",{children:[d.jsx(we,{htmlFor:"namespace",children:"Namespace"}),d.jsx(ze,{id:"namespace",value:s,onChange:k=>i(k.target.value),placeholder:"e.g., customer_name",className:"cj-mt-1 cj-font-mono"}),d.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mt-1",children:"Unique identifier for this field"})]}),d.jsxs("div",{children:[d.jsx(we,{children:"Schema Type"}),d.jsxs(nn,{value:c,onValueChange:l,children:[d.jsx(Wt,{className:"cj-mt-1",children:d.jsx(rn,{})}),d.jsx(Ft,{children:y.map(([k,T])=>d.jsx(Ee,{value:k,children:d.jsx("div",{className:"cj-flex cj-items-center cj-gap-2",children:d.jsx(ct,{className:`${T.color} cj-text-white cj-text-[10px]`,children:T.label})})},k))})]})]}),v&&d.jsxs("div",{children:[d.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-mb-2",children:[d.jsx(we,{children:"Options"}),d.jsxs(fe,{variant:"outline",size:"sm",onClick:x,children:[d.jsx(So,{className:"cj-h-3 cj-w-3 cj-mr-1"}),"Add Option"]})]}),d.jsxs("div",{className:"cj-space-y-2",children:[u.map((k,T)=>d.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2 cj-min-w-0",children:[d.jsx(ze,{value:k.data,onChange:D=>j(T,"data",D.target.value),placeholder:"Value",className:"cj-flex-1 cj-min-w-0 cj-font-mono cj-text-sm"}),d.jsx(ze,{value:k.label,onChange:D=>j(T,"label",D.target.value),placeholder:"Label",className:"cj-flex-1 cj-min-w-0"}),d.jsx(fe,{variant:"ghost",size:"icon",onClick:()=>N(T),className:"cj-h-8 cj-w-8",children:d.jsx(kr,{className:"cj-h-3 cj-w-3"})})]},T)),u.length===0&&d.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:"Add options for the dropdown"})]})]}),d.jsxs("div",{children:[d.jsx(we,{children:"Bind to Specs (optional)"}),d.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mb-2",children:"Map this field's answer to existing spec namespaces"}),d.jsx(ze,{placeholder:"Search specs...",value:m,onChange:k=>g(k.target.value),className:"cj-mb-2"}),d.jsx("div",{className:"cj-border cj-rounded-lg cj-max-h-40 cj-overflow-auto",children:w.slice(0,20).map(k=>{const T=Er(k.schema),D=h.includes(k.id);return d.jsxs("div",{className:`cj-flex cj-items-center cj-gap-2 cj-p-2 hover:cj-bg-accent cj-cursor-pointer ${D?"cj-bg-accent":""}`,onClick:()=>S(k.id),children:[d.jsx(Xy,{checked:D}),d.jsx(ct,{className:`${T.color} cj-text-white cj-text-[10px]`,children:T.label}),d.jsx("span",{className:"cj-text-sm cj-truncate cj-flex-1",children:k.label})]},k.id)})}),h.length>0&&d.jsxs("div",{className:"cj-mt-2 cj-text-xs cj-text-muted-foreground",children:[h.length," spec(s) selected"]})]})]})}),d.jsxs(fl,{children:[d.jsx(fe,{variant:"outline",onClick:()=>n(!1),children:"Cancel"}),d.jsx(fe,{onClick:C,disabled:!P,children:"Create Node"})]})]})})}function GD({specs:e,onDragStart:t,onCreateCustomNode:n}){const[r,o]=_.useState(!1),[a,s]=_.useState(""),[i,c]=_.useState("all"),{t:l}=dt(),u=_.useMemo(()=>e.filter(h=>{const p=h.label.toLowerCase().includes(a.toLowerCase())||h.namespace.toLowerCase().includes(a.toLowerCase()),m=i==="all"||h.schema===i;return p&&m}),[a,i]),f=_.useMemo(()=>{const h=new Set(e.map(p=>p.schema));return Array.from(h)},[]);return d.jsxs("div",{className:"cj-flex cj-h-full cj-flex-col",children:[d.jsxs("div",{className:"cj-border-b cj-p-4",children:[d.jsx("h2",{className:"cj-mb-3 cj-text-sm cj-font-semibold",children:l("specs_title")}),d.jsxs("div",{className:"cj-relative cj-mb-3",children:[d.jsx(Fp,{className:"cj-absolute cj-left-2.5 cj-top-2.5 cj-h-4 cj-w-4 cj-text-muted-foreground"}),d.jsx(ze,{placeholder:l("specs_search_placeholder"),value:a,onChange:h=>s(h.target.value),className:"cj-pl-8"})]}),d.jsxs(nn,{value:i,onValueChange:c,children:[d.jsx(Wt,{className:"cj-w-full",children:d.jsx(rn,{placeholder:l("specs_filter_all")})}),d.jsxs(Ft,{children:[d.jsx(Ee,{value:"all",children:l("specs_filter_all")}),f.map(h=>d.jsx(Ee,{value:h,children:Er(h).label},h))]})]})]}),d.jsx(Lr,{className:"cj-flex-1",children:d.jsxs("div",{className:"cj-space-y-2 cj-p-4",children:[u.map(h=>{const p=Er(h.schema);return d.jsx("div",{draggable:!0,onDragStart:m=>{m.dataTransfer.setData("application/json",JSON.stringify(h)),m.dataTransfer.effectAllowed="copy",t(h)},className:"cj-cursor-grab cj-rounded-lg cj-border cj-bg-card cj-p-3 cj-transition-colors hover:cj-bg-accent active:cj-cursor-grabbing",children:d.jsxs("div",{className:"cj-flex cj-items-start cj-gap-2",children:[d.jsx(zp,{className:"cj-mt-0.5 cj-h-4 cj-w-4 cj-flex-shrink-0 cj-text-muted-foreground"}),d.jsxs("div",{className:"cj-flex-1 cj-min-w-0",children:[d.jsx("div",{className:"cj-flex cj-items-center cj-gap-2 cj-mb-1",children:d.jsx(ct,{variant:"secondary",className:`cj-text-[10px] ${p.color} cj-text-white cj-flex-shrink-0`,children:p.label})}),d.jsx("div",{className:"cj-text-sm cj-font-medium cj-truncate",children:h.label}),d.jsx("div",{className:"cj-text-xs cj-text-muted-foreground cj-font-mono cj-truncate",children:h.namespace})]})]})},h.id)}),u.length===0&&d.jsx("div",{className:"cj-py-8 cj-text-center cj-text-sm cj-text-muted-foreground",children:l("specs_no_results")})]})}),d.jsxs("div",{className:"cj-border-t cj-p-3",children:[d.jsxs(fe,{variant:"outline",className:"cj-w-full",onClick:()=>o(!0),children:[d.jsx(So,{className:"cj-h-4 cj-w-4 cj-mr-2"}),l("specs_create_custom")]}),d.jsx("div",{className:"cj-text-xs cj-text-muted-foreground cj-mt-2 cj-text-center",children:l("specs_count",{filtered:u.length,total:e.length})})]}),d.jsx(qD,{specs:e,open:r,onOpenChange:o,onCreateNode:n})]})}var UD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],XD=UD.reduce((e,t)=>{const n=ms(`Primitive.${t}`),r=b.forwardRef((o,a)=>{const{asChild:s,...i}=o,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(c,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),KD="Separator",Ku="horizontal",JD=["horizontal","vertical"],Ky=b.forwardRef((e,t)=>{const{decorative:n,orientation:r=Ku,...o}=e,a=ZD(r)?r:Ku,i=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return d.jsx(XD.div,{"data-orientation":a,...i,...o,ref:t})});Ky.displayName=KD;function ZD(e){return JD.includes(e)}var Jy=Ky;const yt=b.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>d.jsx(Jy,{ref:o,decorative:n,orientation:t,className:ie("cj-shrink-0 cj-bg-border",t==="horizontal"?"cj-h-[1px] cj-w-full":"cj-h-full cj-w-[1px]",e),...r}));yt.displayName=Jy.displayName;var Fs="Switch",[QD]=Ze(Fs),[eO,tO]=QD(Fs),Zy=b.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:a,required:s,disabled:i,value:c="on",onCheckedChange:l,form:u,...f}=e,[h,p]=b.useState(null),m=me(t,x=>p(x)),g=b.useRef(!1),y=h?u||!!h.closest("form"):!0,[v,w]=Nt({prop:o,defaultProp:a??!1,onChange:l,caller:Fs});return d.jsxs(eO,{scope:n,checked:v,disabled:i,children:[d.jsx(se.button,{type:"button",role:"switch","aria-checked":v,"aria-required":s,"data-state":nx(v),"data-disabled":i?"":void 0,disabled:i,value:c,...f,ref:m,onClick:te(e.onClick,x=>{w(j=>!j),y&&(g.current=x.isPropagationStopped(),g.current||x.stopPropagation())})}),y&&d.jsx(tx,{control:h,bubbles:!g.current,name:r,value:c,checked:v,required:s,disabled:i,form:u,style:{transform:"translateX(-100%)"}})]})});Zy.displayName=Fs;var Qy="SwitchThumb",ex=b.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=tO(Qy,n);return d.jsx(se.span,{"data-state":nx(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});ex.displayName=Qy;var nO="SwitchBubbleInput",tx=b.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},a)=>{const s=b.useRef(null),i=me(s,a),c=Is(n),l=bs(t);return b.useEffect(()=>{const u=s.current;if(!u)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&p){const m=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(m)}},[c,n,r]),d.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});tx.displayName=nO;function nx(e){return e?"checked":"unchecked"}var rx=Zy,rO=ex;const Rl=b.forwardRef(({className:e,...t},n)=>d.jsx(rx,{className:ie("cj-peer cj-inline-flex cj-h-6 cj-w-11 cj-shrink-0 cj-cursor-pointer cj-items-center cj-rounded-full cj-border-2 cj-border-transparent cj-transition-colors data-[state=checked]:cj-bg-primary data-[state=unchecked]:cj-bg-input focus-visible:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 focus-visible:cj-ring-offset-background disabled:cj-cursor-not-allowed disabled:cj-opacity-50",e),...t,ref:n,children:d.jsx(rO,{className:ie("cj-pointer-events-none cj-block cj-h-5 cj-w-5 cj-rounded-full cj-bg-background cj-shadow-lg cj-ring-0 cj-transition-transform data-[state=checked]:cj-translate-x-5 data-[state=unchecked]:cj-translate-x-0")})}));Rl.displayName=rx.displayName;const oO=[{id:"65ec628d-0ebf-476b-bdd3-d160ea91a36d",namespace:"police_asset",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:1,schema:"v1_string",label:"Nome Completo",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"297c616b-cde6-489a-8fd7-1eeb5e169f77",namespace:"claim_role",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:2,schema:"v2_single_option_select-1",label:"Qualidade",data:null,force_data:!1,options:[{data:"segurado",label:"Segurado"},{data:"representante",label:"Representante"}],help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"e96d0cc2-25b2-4658-9d67-d83469d9672e",namespace:"employer",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:3,schema:"v1_string",label:"Entidade Patronal",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"2bcf5aaf-983e-4d26-8611-57b2668becf3",namespace:"work_regime",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:4,schema:"v2_single_option_select-1",label:"Regime de Trabalho",data:null,force_data:!1,options:[{data:"contrato-sem-termo",label:"Contrato sem Termo"},{data:"empresario-em-nome-individual",label:"Empresário em Nome Individual"},{data:"prestador-de-servicos",label:"Prestador de Serviços"}],help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"1ecd3d9c-1797-4024-87fb-533afee3b278",namespace:"phone_number",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:5,schema:"v1_string",label:"Nº Telefone de Contacto",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"ac578a3a-1e94-4168-ad8c-c9327059448f",namespace:"what_happened",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:7,schema:"v2_single_option_select-1",label:"Qual o tipo de ocorrência ?",data:null,force_data:!1,options:[{data:"morte-por-acidente",label:"Morte por Acidente"},{data:"incapacidade-permanente-e-absoluta-por-acidente",label:"Incapacidade Permanente e Absoluta por Acidente"},{data:"incapacidade-temporaria-absoluta-para-o-trabalho-devido-a-acidente-ou-doenca",label:"Incapacidade Temporária Absoluta para o Trabalho devido a Acidente ou Doença"},{data:"desemprego-em-situacao-de-despedimento-coletivo",label:"Desemprego em situação de Despedimento Coletivo"},{data:"desemprego-por-extincao-do-posto-de-trabalho",label:"DEsemprego por Extinção do Posto de Trabalho"}],help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"d7752ff6-2541-484b-b45b-a9a645ce4ba5",namespace:"ocorrence_date",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:8,schema:"v2_date-1",label:"Qual a Data da Ocorrência ?",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"7c545395-fe60-48ff-b6aa-083fdcabc3c3",namespace:"ocorrence_description",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:9,schema:"v1_string",label:"Descreva detalhadamente o que aconteceu",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"4db6022a-6cda-4be5-a0f5-289ab6029086",namespace:"event_asset",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:10,schema:"v2_single_asset_upload",label:"Anexe fotografia ou cópia dos documentos que sustentam o tipo de ocorrência",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"4fb85b7a-e016-45f2-be49-db3f05b261bd",namespace:"damage_asset",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:11,schema:"v2_single_asset_upload",label:"Anexe cópia das faturas a Reembolsar",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"d05fb14c-1bbd-4443-993c-f5cb64d8e694",namespace:"budget_value",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:12,schema:"v2_currency-1",label:"Insira a soma das faturas a reembolsar",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"9de98902-119e-4863-b188-596d52ef5169",namespace:"iban",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:13,schema:"v1_string",label:"IBAN para Reembolso",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"39565066-f8d1-48f9-90e3-4714c901ab6c",namespace:"iban_holder",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:14,schema:"v1_string",label:"Titular da Conta",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"5fcbe7f7-a3e5-456e-990c-1f19ff0d3d0e",namespace:"iban_proof",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:15,schema:"v2_single_asset_upload",label:"Anexe comprovativo de IBAN e Titular da conta bancária",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.operations.required.claims.create"]},{id:"b199e26e-1d40-4506-a6cc-357ca41c87f1",namespace:"claim_notes",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:null,order_index:16,schema:"v1_string",label:"Notas do Processo",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.management","io.habit.operations.required.claims.create"]},{id:"81779d52-aef3-4988-a2b2-97010aa417fb",namespace:"claim_total_amount",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:"9340e42c-bdb5-43fd-846e-28139650121e",order_index:17,schema:"v2_currency-1",label:"Total Indeminização Apurado",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.management","io.habit.operations.required.claims.create"]},{id:"0ab3d3e4-665e-43c4-a857-a16a18e1fa33",namespace:"claim_decision",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:"81779d52-aef3-4988-a2b2-97010aa417fb",order_index:18,schema:"v2_single_option_select-1",label:"Decisão",data:null,force_data:!1,options:[{data:"aceite",label:"Aceite",next:["ebe6445b-8a9f-4bd9-924f-9d0231cb7630"]},{data:"declinado",label:"Declinado"}],help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.management","io.habit.operations.required.claims.create"]},{id:"ebe6445b-8a9f-4bd9-924f-9d0231cb7630",namespace:"claim_refund_method",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:"0ab3d3e4-665e-43c4-a857-a16a18e1fa33",order_index:19,schema:"v2_single_option_select-1",label:"Método de Reembolso",data:null,force_data:!1,options:[{data:"fraccionado",label:"Fraccionado",next:["9340e42c-bdb5-43fd-846e-28139650121e"]},{data:"total",label:"Total",next:["9340e42c-bdb5-43fd-846e-28139650121e"]}],help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.management","io.habit.operations.required.claims.create"]},{id:"9340e42c-bdb5-43fd-846e-28139650121e",namespace:"claim_payment_count",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:"ebe6445b-8a9f-4bd9-924f-9d0231cb7630",order_index:20,schema:"v2_single_option_select-1",label:"Qt Reembolsos",data:null,force_data:!1,options:[{data:"1",label:"1",next:["81779d52-aef3-4988-a2b2-97010aa417fb"]},{data:"2",label:"2",next:["cfeba596-7f83-4169-8cf0-f0b9e6bd4c9b"]},{data:"3",label:"3",next:["cfeba596-7f83-4169-8cf0-f0b9e6bd4c9b"]},{data:"4",label:"4",next:["cfeba596-7f83-4169-8cf0-f0b9e6bd4c9b"]},{data:"5",label:"5",next:["cfeba596-7f83-4169-8cf0-f0b9e6bd4c9b"]},{data:"6",label:"6",next:["cfeba596-7f83-4169-8cf0-f0b9e6bd4c9b"]}],help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.management","io.habit.operations.required.claims.create"]},{id:"cfeba596-7f83-4169-8cf0-f0b9e6bd4c9b",namespace:"claim_parcial_amount",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:"9340e42c-bdb5-43fd-846e-28139650121e",order_index:21,schema:"v2_currency-1",label:"Valor Indeminização Mensal",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.fields.optional","io.habit.operations.management","io.habit.operations.required.claims.create"]},{id:"85d86e19-338a-4cf7-81b9-9ac87c3432dd",namespace:"claim_parcial_next_date_payment",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:"cfeba596-7f83-4169-8cf0-f0b9e6bd4c9b",order_index:22,schema:"v2_date-1",label:"Data Proximo Pagamento",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.fields.optional","io.habit.operations.management","io.habit.operations.required.claims.create"]},{id:"f723be65-c8a4-4ec4-ad33-2f327b94a782",namespace:"claim_parcial_payment_first_date",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:"cfeba596-7f83-4169-8cf0-f0b9e6bd4c9b",order_index:22,schema:"v2_date-1",label:"Data 1º Pagamento",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.fields.optional","io.habit.operations.management","io.habit.operations.required.claims.create"]},{id:"de72c452-9580-464f-8463-1d551281bd0d",namespace:"claim_total_amount_one_payment",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:"9340e42c-bdb5-43fd-846e-28139650121e",order_index:23,schema:"v2_currency-1",label:"Total Indeminização para único pagamento",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.management","io.habit.operations.required.claims.create"]},{id:"d26fa38c-dee4-40ac-8411-a5024b8698c7",namespace:"claim_total_payment_date",claimspec_id:"4baa0039-e4b9-4ca4-8f9b-d42dfa14cce1",parent_id:"81779d52-aef3-4988-a2b2-97010aa417fb",order_index:24,schema:"v2_date-1",label:"Data Pagamento",data:null,force_data:!1,options:null,help_text:null,placeholder:"",icon:null,image:null,classes:["io.habit.claim.chat.ignore","io.habit.operations.editable_management","io.habit.operations.fields.optional","io.habit.operations.management","io.habit.operations.required.claims.create"]}],aO={claimproperty_specs:oO},sO=aO.claimproperty_specs;function iO(){const{nodes:e,selectedNodeId:t,updateNodeData:n,deleteNode:r}=$e(),{t:o}=dt(),a=e.find(x=>x.id===t),s=_.useMemo(()=>sO.map(x=>({namespace:x.namespace,label:x.label})),[]);if(!a)return d.jsx("div",{className:"cj-flex cj-h-full cj-items-center cj-justify-center cj-p-4 cj-text-center cj-text-sm cj-text-muted-foreground",children:o("props_select_hint")});const{data:i}=a,c=Er(i.schema),l=i.schema==="v2_single_option_select-1",u=i.schema==="v2_single_asset_upload"||i.widget==="upload",f=i.options||[],h=i.uploadConfig||{},p=()=>{n(a.id,{options:[...f,{data:"",label:""}]})},m=(x,j,N)=>{n(a.id,{options:f.map((S,C)=>C===x?{...S,[j]:N}:S)})},g=x=>{n(a.id,{options:f.filter((j,N)=>N!==x)})},y=()=>{n(a.id,{bindings:[...i.bindings,{target_namespace:""}]})},v=x=>{n(a.id,{bindings:i.bindings.filter((j,N)=>N!==x)})},w=(x,j)=>{n(a.id,{bindings:i.bindings.map((N,S)=>S===x?{target_namespace:j}:N)})};return d.jsxs("div",{className:"cj-flex cj-h-full cj-flex-col",children:[d.jsx("div",{className:"cj-border-b cj-p-4",children:d.jsx("h2",{className:"cj-text-sm cj-font-semibold",children:o("node_props_title")})}),d.jsxs("div",{className:"cj-flex-1 cj-overflow-auto cj-p-4 cj-space-y-4",children:[d.jsxs("div",{children:[d.jsx(we,{className:"cj-text-xs cj-text-muted-foreground",children:o("node_schema_type")}),d.jsx("div",{className:"cj-mt-1",children:d.jsx(ct,{variant:"secondary",className:`${c.color} cj-text-white`,children:c.label})})]}),d.jsxs("div",{children:[d.jsx(we,{className:"cj-text-xs cj-text-muted-foreground",children:o("node_source_spec")}),d.jsx("div",{className:"cj-mt-1 cj-text-xs cj-font-mono cj-text-muted-foreground cj-break-all",children:i.specId})]}),d.jsxs("div",{children:[d.jsx(we,{className:"cj-text-xs cj-text-muted-foreground",children:o("node_namespace")}),d.jsx("div",{className:"cj-mt-1 cj-text-sm cj-font-mono",children:i.namespace})]}),d.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between",children:[d.jsxs("div",{children:[d.jsx(we,{htmlFor:"required",children:o("node_required")}),d.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o("node_required_hint")})]}),d.jsx(Rl,{id:"required",checked:i.required??!1,onCheckedChange:x=>n(a.id,{required:x})})]}),d.jsx(yt,{}),d.jsxs("div",{children:[d.jsx(we,{className:"cj-text-xs cj-text-muted-foreground",children:o("node_original_label")}),d.jsx("div",{className:"cj-mt-1 cj-text-sm",children:i.label})]}),d.jsxs("div",{children:[d.jsx(we,{htmlFor:"labelOverride",children:o("node_label_override")}),d.jsx(ze,{id:"labelOverride",value:i.labelOverride||"",onChange:x=>n(a.id,{labelOverride:x.target.value||void 0}),placeholder:o("node_label_override_placeholder"),className:"cj-mt-1"})]}),l&&d.jsxs(d.Fragment,{children:[d.jsx(yt,{}),d.jsxs("div",{children:[d.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between",children:[d.jsx(we,{children:"Select Options"}),d.jsxs(fe,{variant:"ghost",size:"sm",onClick:p,children:[d.jsx(So,{className:"cj-h-3 cj-w-3 cj-mr-1"}),"Add"]})]}),d.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mb-2",children:"Define the dropdown options and their values"}),d.jsxs("div",{className:"cj-space-y-2",children:[f.map((x,j)=>d.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2 cj-p-2 cj-border cj-rounded-md cj-bg-muted/30",children:[d.jsxs("div",{className:"cj-flex-1 cj-space-y-1",children:[d.jsx(ze,{value:x.data,onChange:N=>m(j,"data",N.target.value),placeholder:"value (e.g., 'full_time')",className:"cj-font-mono cj-text-sm cj-h-8"}),d.jsx(ze,{value:x.label,onChange:N=>m(j,"label",N.target.value),placeholder:"Label (e.g., 'Full Time')",className:"cj-text-sm cj-h-8"})]}),d.jsx(fe,{variant:"ghost",size:"icon",onClick:()=>g(j),className:"cj-h-8 cj-w-8",children:d.jsx(kr,{className:"cj-h-3 cj-w-3"})})]},j)),f.length===0&&d.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-italic cj-py-2",children:"No options defined. Add options to enable conditional routing."})]})]})]}),u&&d.jsxs(d.Fragment,{children:[d.jsx(yt,{}),d.jsxs("div",{children:[d.jsx(we,{children:"Upload Validation"}),d.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mb-2",children:"Restrict accepted file types and maximum size"}),d.jsxs("div",{className:"cj-space-y-3",children:[d.jsxs("div",{children:[d.jsx(we,{htmlFor:"acceptPreset",className:"cj-text-xs",children:o("upload_file_type_preset")}),d.jsxs(nn,{value:h.accept==="image/*"?"images":h.accept===".pdf,.doc,.docx,.txt"?"documents":h.accept==="image/*,.pdf"?"images_pdf":h.accept===void 0||h.accept===""?"any":"custom",onValueChange:x=>{const j={any:void 0,images:"image/*",documents:".pdf,.doc,.docx,.txt",images_pdf:"image/*,.pdf"};x!=="custom"&&n(a.id,{uploadConfig:{...h,accept:j[x]}})},children:[d.jsx(Wt,{className:"cj-mt-1",children:d.jsx(rn,{})}),d.jsxs(Ft,{children:[d.jsx(Ee,{value:"any",children:o("upload_any_file")}),d.jsx(Ee,{value:"images",children:o("upload_images_only")}),d.jsx(Ee,{value:"documents",children:o("upload_documents_only")}),d.jsx(Ee,{value:"images_pdf",children:o("upload_images_pdf")}),d.jsx(Ee,{value:"custom",children:o("upload_custom")})]})]})]}),d.jsxs("div",{children:[d.jsx(we,{htmlFor:"acceptTypes",className:"cj-text-xs",children:o("upload_accepted_types")}),d.jsx(ze,{id:"acceptTypes",value:h.accept||"",onChange:x=>n(a.id,{uploadConfig:{...h,accept:x.target.value||void 0}}),placeholder:"e.g. image/*,.pdf",className:"cj-mt-1 cj-font-mono cj-text-sm"}),d.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mt-1",children:"Comma-separated MIME types or extensions"})]}),d.jsxs("div",{children:[d.jsx(we,{htmlFor:"maxSizeMB",className:"cj-text-xs",children:o("upload_max_size")}),d.jsx(ze,{id:"maxSizeMB",type:"number",min:0,step:.5,value:h.maxSizeMB??"",onChange:x=>n(a.id,{uploadConfig:{...h,maxSizeMB:x.target.value?parseFloat(x.target.value):void 0}}),placeholder:"e.g. 5",className:"cj-mt-1 cj-w-24"})]})]})]})]}),d.jsx(yt,{}),d.jsxs("div",{children:[d.jsx(we,{children:o("node_actor")}),d.jsxs(nn,{value:i.actor,onValueChange:x=>n(a.id,{actor:x}),children:[d.jsx(Wt,{className:"cj-mt-1",children:d.jsx(rn,{})}),d.jsxs(Ft,{children:[d.jsx(Ee,{value:"customer",children:o("node_actor_customer")}),d.jsx(Ee,{value:"operator",children:o("node_actor_operator")})]})]})]}),d.jsx(yt,{}),d.jsxs("div",{children:[d.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between",children:[d.jsx(we,{children:o("node_bindings_title")}),d.jsxs(fe,{variant:"ghost",size:"sm",onClick:y,children:[d.jsx(So,{className:"cj-h-3 cj-w-3 cj-mr-1"}),"Add"]})]}),d.jsx("div",{className:"cj-mt-2 cj-space-y-2",children:i.bindings.map((x,j)=>d.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[d.jsxs(nn,{value:x.target_namespace,onValueChange:N=>w(j,N),children:[d.jsx(Wt,{className:"cj-flex-1 cj-font-mono cj-text-sm",children:d.jsx(rn,{placeholder:"Select namespace..."})}),d.jsx(Ft,{children:s.map(N=>d.jsx(Ee,{value:N.namespace,children:d.jsxs("div",{className:"cj-flex cj-flex-col",children:[d.jsx("span",{className:"cj-font-mono cj-text-xs",children:N.namespace}),d.jsx("span",{className:"cj-text-xs cj-text-muted-foreground",children:N.label})]})},N.namespace))})]}),i.bindings.length>1&&d.jsx(fe,{variant:"ghost",size:"icon",onClick:()=>v(j),className:"cj-h-8 cj-w-8",children:d.jsx(kr,{className:"cj-h-3 cj-w-3"})})]},j))})]}),d.jsx(yt,{}),d.jsxs("div",{children:[d.jsx(we,{children:o("node_widget")}),d.jsxs(nn,{value:i.widget||"auto",onValueChange:x=>n(a.id,{widget:x==="auto"?void 0:x}),children:[d.jsx(Wt,{className:"cj-mt-1",children:d.jsx(rn,{})}),d.jsxs(Ft,{children:[d.jsx(Ee,{value:"auto",children:o("node_widget_auto")}),d.jsx(Ee,{value:"text",children:o("node_widget_text")}),d.jsx(Ee,{value:"textarea",children:o("node_widget_textarea")}),d.jsx(Ee,{value:"select",children:o("node_widget_select")}),d.jsx(Ee,{value:"radio",children:o("node_widget_radio")}),d.jsx(Ee,{value:"datepicker",children:o("node_widget_datepicker")}),d.jsx(Ee,{value:"currency",children:o("node_widget_currency")}),d.jsx(Ee,{value:"upload",children:o("node_widget_upload")}),d.jsx(Ee,{value:"email",children:o("node_widget_email")}),d.jsx(Ee,{value:"phone",children:o("node_widget_phone")})]})]})]})]}),d.jsx("div",{className:"cj-border-t cj-p-4",children:d.jsxs(fe,{variant:"destructive",className:"cj-w-full",onClick:()=>r(a.id),children:[d.jsx(Bp,{className:"cj-h-4 cj-w-4 cj-mr-2"}),o("node_delete")]})})]})}const ox=[{value:"==",label:"equals"},{value:"!=",label:"not equals"},{value:">",label:"greater than"},{value:"<",label:"less than"},{value:">=",label:"greater or equal"},{value:"<=",label:"less or equal"},{value:"in",label:"contains"},{value:"is_null",label:"is null"},{value:"is_not_null",label:"is not null"}],yc=["is_null","is_not_null"];function Ju(e){const t=Object.keys(e)[0];if(t==="=="||t==="!="){const a=e[t];if(!Array.isArray(a)||a.length!==2)return null;const s=a[0];if(!(s!=null&&s.var))return null;const i=s.var.replace("answers.","");return a[1]===null?{field:i,operator:t==="=="?"is_null":"is_not_null",value:""}:{field:i,operator:t,value:String(a[1])}}if(!ox.some(a=>a.value===t))return null;const n=e[t];if(!Array.isArray(n)||n.length!==2)return null;const r=n[0];return r!=null&&r.var?{field:r.var.replace("answers.",""),operator:t,value:String(n[1])}:null}function Zu(e){const t={mode:"and",rules:[{field:"",operator:"==",value:""}]};if(!e)return t;const n=Object.keys(e)[0];if(n==="and"||n==="or"){const o=e[n];if(Array.isArray(o)){const a=o.map(Ju).filter(Boolean);if(a.length>0)return{mode:n,rules:a}}return t}const r=Ju(e);return r?{mode:"and",rules:[r]}:t}function cO(e){const t=e.rules.filter(r=>r.field&&(r.value||yc.includes(r.operator)));if(t.length===0)return null;const n=t.map(r=>r.operator==="is_null"?{"==":[{var:`answers.${r.field}`},null]}:r.operator==="is_not_null"?{"!=":[{var:`answers.${r.field}`},null]}:{[r.operator]:[{var:`answers.${r.field}`},r.value]});return n.length===1?n[0]:{[e.mode]:n}}function lO(){return{field:"",operator:"==",value:""}}function dO(e,t){const n=new Set,r=[e];for(;r.length>0;){const o=r.pop();for(const a of t)a.target===o&&!n.has(a.source)&&(n.add(a.source),r.push(a.source))}return n}function uO({rule:e,availableFields:t,canRemove:n,onChange:r,onRemove:o}){const a=yc.includes(e.operator);return d.jsxs("div",{className:"cj-flex cj-items-start cj-gap-1.5 cj-group",children:[d.jsxs("div",{className:"cj-flex-1 cj-space-y-1.5",children:[d.jsxs(nn,{value:e.field,onValueChange:s=>r({field:s}),children:[d.jsx(Wt,{className:"cj-h-8 cj-text-xs",children:d.jsx(rn,{placeholder:"Field"})}),d.jsx(Ft,{children:t.map(s=>d.jsx(Ee,{value:s.namespace,children:s.label},s.namespace))})]}),d.jsxs(nn,{value:e.operator,onValueChange:s=>r({operator:s,...yc.includes(s)?{value:""}:{}}),children:[d.jsx(Wt,{className:"cj-h-8 cj-text-xs",children:d.jsx(rn,{})}),d.jsx(Ft,{children:ox.map(s=>d.jsx(Ee,{value:s.value,children:s.label},s.value))})]}),!a&&d.jsx(ze,{className:"cj-h-8 cj-text-xs",placeholder:"Value",value:e.value,onChange:s=>r({value:s.target.value})})]}),n&&d.jsx(fe,{variant:"ghost",size:"icon",className:"cj-h-8 cj-w-8 cj-opacity-0 group-hover:cj-opacity-100 cj-shrink-0 cj-mt-0",onClick:o,children:d.jsx(kr,{className:"cj-h-3.5 cj-w-3.5"})})]})}function fO({conditions:e,availableFields:t,onChange:n}){const r=()=>{n({...e,mode:e.mode==="and"?"or":"and"})},o=(i,c)=>{const l=e.rules.map((u,f)=>f===i?{...u,...c}:u);n({...e,rules:l})},a=()=>{n({...e,rules:[...e.rules,lO()]})},s=i=>{n({...e,rules:e.rules.filter((c,l)=>l!==i)})};return d.jsxs("div",{className:"cj-space-y-3",children:[e.rules.length>1&&d.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[d.jsx("span",{className:"cj-text-xs cj-text-muted-foreground",children:"Combine with:"}),d.jsx(ct,{variant:e.mode==="and"?"default":"outline",className:"cj-cursor-pointer cj-text-[10px]",onClick:r,children:"AND"}),d.jsx(ct,{variant:e.mode==="or"?"default":"outline",className:"cj-cursor-pointer cj-text-[10px]",onClick:r,children:"OR"})]}),d.jsx("div",{className:"cj-space-y-3",children:e.rules.map((i,c)=>d.jsxs("div",{children:[c>0&&d.jsx("div",{className:"cj-text-center cj-text-[10px] cj-text-muted-foreground cj-font-medium cj-py-1 cj-uppercase",children:e.mode}),d.jsx(uO,{rule:i,availableFields:t,canRemove:e.rules.length>1,onChange:l=>o(c,l),onRemove:()=>s(c)})]},c))}),d.jsxs(fe,{variant:"outline",size:"sm",className:"cj-w-full cj-h-7 cj-text-xs",onClick:a,children:[d.jsx(So,{className:"cj-h-3 cj-w-3 cj-mr-1"}),"Add condition"]})]})}function hO({condition:e,availableFields:t}){const[n,r]=_.useState(!1),[o,a]=_.useState({}),[s,i]=_.useState(null),c=()=>{if(!e){i(null);return}try{const l={answers:{...o}},u=Wa.apply(e,l);i(!!u)}catch{i(!1)}};return d.jsxs(_l,{open:n,onOpenChange:r,children:[d.jsxs(Sl,{className:"cj-flex cj-items-center cj-gap-1.5 cj-text-xs cj-font-medium cj-text-muted-foreground hover:cj-text-foreground cj-w-full cj-py-1",children:[n?d.jsx(Tr,{className:"cj-h-3.5 cj-w-3.5"}):d.jsx(Ap,{className:"cj-h-3.5 cj-w-3.5"}),"Test Condition"]}),d.jsxs(Cl,{className:"cj-space-y-2 cj-pt-2",children:[d.jsx("p",{className:"cj-text-[11px] cj-text-muted-foreground",children:"Enter sample answers to test:"}),t.map(l=>d.jsxs("div",{className:"cj-space-y-0.5",children:[d.jsx(we,{className:"cj-text-[11px]",children:l.label}),d.jsx(ze,{className:"cj-h-7 cj-text-xs",placeholder:l.namespace,value:o[l.namespace]||"",onChange:u=>a(f=>({...f,[l.namespace]:u.target.value}))})]},l.namespace)),d.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[d.jsxs(fe,{size:"sm",variant:"outline",className:"cj-h-7 cj-text-xs",onClick:c,disabled:!e,children:[d.jsx(Fa,{className:"cj-h-3 cj-w-3 cj-mr-1"}),"Run Test"]}),s!==null&&(s?d.jsxs("span",{className:"cj-flex cj-items-center cj-gap-1 cj-text-xs cj-text-primary",children:[d.jsx(tc,{className:"cj-h-3.5 cj-w-3.5"})," True"]}):d.jsxs("span",{className:"cj-flex cj-items-center cj-gap-1 cj-text-xs cj-text-destructive",children:[d.jsx($p,{className:"cj-h-3.5 cj-w-3.5"})," False"]}))]})]})]})}function pO(){const{nodes:e,edges:t,selectedEdgeId:n,updateEdgeData:r,deleteEdge:o}=$e(),{t:a}=dt(),[s,i]=_.useState(null),[c,l]=_.useState({mode:"and",rules:[{field:"",operator:"==",value:""}]}),u=t.find(C=>C.id===n),f=(u==null?void 0:u.data)||{condition:null,priority:0,isDefault:!1};_.useEffect(()=>{var C;u&&l(Zu(((C=u.data)==null?void 0:C.condition)??null))},[n]);const h=_.useMemo(()=>{if(!u)return new Set;const C=dO(u.source,t);return C.add(u.source),C},[u==null?void 0:u.source,t]),p=_.useMemo(()=>e.filter(C=>h.has(C.id)).map(C=>({namespace:C.data.namespace,label:C.data.label})),[e,h]);if(!u)return d.jsx("div",{className:"cj-flex cj-h-full cj-items-center cj-justify-center cj-p-4 cj-text-center cj-text-sm cj-text-muted-foreground",children:a("props_select_hint")});const m=e.find(C=>C.id===u.source),g=e.find(C=>C.id===u.target),y=m==null?void 0:m.data,v=(y==null?void 0:y.options)||[],w=v.length>0,x=C=>{l(C),r(u.id,{condition:cO(C)}),i(null)},j=C=>{try{const P=C.trim()?JSON.parse(C):null;r(u.id,{condition:P}),l(Zu(P)),i(null)}catch{i("Invalid JSON")}},N=C=>{if(y){const P={mode:"and",rules:[{field:y.namespace,operator:"==",value:C}]};x(P)}},S=()=>c.rules.length===1&&c.rules[0].value&&c.rules[0].field===(y==null?void 0:y.namespace)?c.rules[0].value:null;return d.jsxs("div",{className:"cj-flex cj-h-full cj-flex-col",children:[d.jsx("div",{className:"cj-border-b cj-p-4",children:d.jsx("h2",{className:"cj-text-sm cj-font-semibold",children:a("edge_props_title")})}),d.jsxs("div",{className:"cj-flex-1 cj-overflow-auto cj-p-4 cj-space-y-4",children:[d.jsxs("div",{className:"cj-rounded-lg cj-bg-muted cj-p-3 cj-text-sm",children:[d.jsx("div",{className:"cj-text-xs cj-text-muted-foreground cj-mb-1",children:a("edge_connection")}),d.jsx("div",{className:"cj-font-medium",children:m?m.data.namespace:a("unknown")}),d.jsx("div",{className:"cj-text-muted-foreground cj-text-center cj-my-1",children:"↓"}),d.jsx("div",{className:"cj-font-medium",children:g?g.data.namespace:a("unknown")})]}),d.jsx(yt,{}),d.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between",children:[d.jsxs("div",{children:[d.jsx(we,{children:a("edge_default")}),d.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:a("edge_default_hint")})]}),d.jsx(Rl,{checked:f.isDefault,onCheckedChange:C=>r(u.id,{isDefault:C})})]}),!f.isDefault&&d.jsxs(d.Fragment,{children:[d.jsx(yt,{}),d.jsxs("div",{children:[d.jsx(we,{htmlFor:"priority",children:a("edge_priority")}),d.jsx("p",{className:"cj-text-xs cj-text-muted-foreground cj-mb-1",children:a("edge_priority_hint")}),d.jsx(ze,{id:"priority",type:"number",value:f.priority,onChange:C=>r(u.id,{priority:parseInt(C.target.value)||0})})]}),d.jsx(yt,{}),d.jsxs("div",{children:[d.jsx(we,{children:a("edge_condition")}),w&&d.jsxs("div",{className:"cj-mt-2 cj-mb-3",children:[d.jsxs("div",{className:"cj-flex cj-items-center cj-gap-1.5 cj-mb-1.5",children:[d.jsx(eE,{className:"cj-h-3.5 cj-w-3.5 cj-text-primary"}),d.jsx("span",{className:"cj-text-xs cj-text-muted-foreground",children:a("edge_quick_pick")})]}),d.jsx("div",{className:"cj-flex cj-flex-wrap cj-gap-1",children:v.map(C=>{const P=S()===C.data;return d.jsx(ct,{variant:P?"default":"outline",className:"cj-cursor-pointer cj-text-[11px]",onClick:()=>N(C.data),children:C.label||C.data},C.data)})})]}),d.jsxs(Sg,{defaultValue:"visual",className:"cj-mt-2",children:[d.jsxs(gl,{className:"cj-w-full",children:[d.jsx(Eo,{value:"visual",className:"cj-flex-1",children:a("edge_visual")}),d.jsx(Eo,{value:"advanced",className:"cj-flex-1",children:a("edge_advanced")})]}),d.jsx(ko,{value:"visual",className:"cj-mt-3",children:d.jsx(fO,{conditions:c,availableFields:p,onChange:x})}),d.jsxs(ko,{value:"advanced",className:"cj-mt-3",children:[d.jsx("div",{className:"cj-text-sm cj-text-muted-foreground cj-mb-2",children:a("edge_json_logic")}),d.jsx(ks,{className:"cj-font-mono cj-text-sm",rows:6,value:f.condition?JSON.stringify(f.condition,null,2):"",onChange:C=>j(C.target.value),placeholder:'{"==": [{"var": "answers.field"}, "value"]}'}),s&&d.jsxs("div",{className:"cj-flex cj-items-center cj-gap-1 cj-mt-1 cj-text-destructive cj-text-xs",children:[d.jsx(Ip,{className:"cj-h-3 cj-w-3"}),s]})]})]})]}),d.jsx(yt,{}),d.jsx(hO,{condition:f.condition,availableFields:p})]})]}),d.jsx("div",{className:"cj-border-t cj-p-4",children:d.jsxs(fe,{variant:"destructive",className:"cj-w-full",onClick:()=>o(u.id),children:[d.jsx(Bp,{className:"cj-h-4 cj-w-4 cj-mr-2"}),a("edge_delete")]})})]})}function mO(){const{selectedNodeId:e,selectedEdgeId:t}=$e(),{t:n}=dt();return t?d.jsx(pO,{}):e?d.jsx(iO,{}):d.jsx("div",{className:"cj-flex cj-h-full cj-flex-col cj-items-center cj-justify-center cj-p-4 cj-text-center",children:d.jsxs("div",{className:"cj-text-sm cj-text-muted-foreground",children:[d.jsx("p",{className:"cj-mb-2",children:n("props_select_hint")}),d.jsx("p",{className:"cj-text-xs",children:n("props_drag_hint")})]})})}function gO({label:e,value:t,onChange:n,placeholder:r,helpText:o,multiline:a=!1}){return d.jsxs("div",{className:"cj-space-y-2",children:[d.jsx(we,{className:"cj-text-sm cj-font-medium",children:e}),a?d.jsx(ks,{value:t,onChange:s=>n(s.target.value),placeholder:r,className:"cj-min-h-[100px]"}):d.jsx(ze,{type:"text",value:t,onChange:s=>n(s.target.value),placeholder:r}),o&&d.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o})]})}var Al="Radio",[yO,ax]=Ze(Al),[xO,vO]=yO(Al),sx=b.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:a,disabled:s,value:i="on",onCheck:c,form:l,...u}=e,[f,h]=b.useState(null),p=me(t,y=>h(y)),m=b.useRef(!1),g=f?l||!!f.closest("form"):!0;return d.jsxs(xO,{scope:n,checked:o,disabled:s,children:[d.jsx(se.button,{type:"button",role:"radio","aria-checked":o,"data-state":dx(o),"data-disabled":s?"":void 0,disabled:s,value:i,...u,ref:p,onClick:te(e.onClick,y=>{o||c==null||c(),g&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})}),g&&d.jsx(lx,{control:f,bubbles:!m.current,name:r,value:i,checked:o,required:a,disabled:s,form:l,style:{transform:"translateX(-100%)"}})]})});sx.displayName=Al;var ix="RadioIndicator",cx=b.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,a=vO(ix,n);return d.jsx(Ye,{present:r||a.checked,children:d.jsx(se.span,{"data-state":dx(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:t})})});cx.displayName=ix;var bO="RadioBubbleInput",lx=b.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},a)=>{const s=b.useRef(null),i=me(s,a),c=Is(n),l=bs(t);return b.useEffect(()=>{const u=s.current;if(!u)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&p){const m=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(m)}},[c,n,r]),d.jsx(se.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});lx.displayName=bO;function dx(e){return e?"checked":"unchecked"}var wO=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Bs="RadioGroup",[jO]=Ze(Bs,[Ps,ax]),ux=Ps(),fx=ax(),[_O,SO]=jO(Bs),hx=b.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:a,required:s=!1,disabled:i=!1,orientation:c,dir:l,loop:u=!0,onValueChange:f,...h}=e,p=ux(n),m=Go(l),[g,y]=Nt({prop:a,defaultProp:o??null,onChange:f,caller:Bs});return d.jsx(_O,{scope:n,name:r,required:s,disabled:i,value:g,onValueChange:y,children:d.jsx(lg,{asChild:!0,...p,orientation:c,dir:m,loop:u,children:d.jsx(se.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":i?"":void 0,dir:m,...h,ref:t})})})});hx.displayName=Bs;var px="RadioGroupItem",mx=b.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,a=SO(px,n),s=a.disabled||r,i=ux(n),c=fx(n),l=b.useRef(null),u=me(t,l),f=a.value===o.value,h=b.useRef(!1);return b.useEffect(()=>{const p=g=>{wO.includes(g.key)&&(h.current=!0)},m=()=>h.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",m)}},[]),d.jsx(dg,{asChild:!0,...i,focusable:!s,active:f,children:d.jsx(sx,{disabled:s,required:a.required,checked:f,...c,...o,name:a.name,ref:u,onCheck:()=>a.onValueChange(o.value),onKeyDown:te(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:te(o.onFocus,()=>{var p;h.current&&((p=l.current)==null||p.click())})})})});mx.displayName=px;var CO="RadioGroupIndicator",gx=b.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=fx(n);return d.jsx(cx,{...o,...r,ref:t})});gx.displayName=CO;var yx=hx,xx=mx,NO=gx;const vx=b.forwardRef(({className:e,...t},n)=>d.jsx(yx,{className:ie("cj-grid cj-gap-2",e),...t,ref:n}));vx.displayName=yx.displayName;const bx=b.forwardRef(({className:e,...t},n)=>d.jsx(xx,{ref:n,className:ie("cj-aspect-square cj-h-4 cj-w-4 cj-rounded-full cj-border cj-border-primary cj-text-primary cj-ring-offset-background focus:cj-outline-none focus-visible:cj-ring-2 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-2 disabled:cj-cursor-not-allowed disabled:cj-opacity-50",e),...t,children:d.jsx(NO,{className:"cj-flex cj-items-center cj-justify-center",children:d.jsx(LN,{className:"cj-h-2.5 cj-w-2.5 cj-fill-current cj-text-current"})})}));bx.displayName=xx.displayName;function EO({label:e,value:t,onChange:n,options:r,helpText:o}){const a=r.length<=5;return d.jsxs("div",{className:"cj-space-y-2",children:[d.jsx(we,{className:"cj-text-sm cj-font-medium",children:e}),a?d.jsx(vx,{value:t,onValueChange:n,className:"cj-space-y-2",children:r.map(s=>d.jsxs("div",{className:"cj-flex cj-items-center cj-space-x-2",children:[d.jsx(bx,{value:s.data,id:s.data}),d.jsx(we,{htmlFor:s.data,className:"cj-font-normal cj-cursor-pointer",children:s.label})]},s.data))}):d.jsxs(nn,{value:t,onValueChange:n,children:[d.jsx(Wt,{className:"cj-w-full",children:d.jsx(rn,{placeholder:"Select an option..."})}),d.jsx(Ft,{className:"cj-bg-popover cj-z-50",children:r.map(s=>d.jsx(Ee,{value:s.data,children:s.label},s.data))})]}),o&&d.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o})]})}function Pt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Gn(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const wx=6048e5,kO=864e5;let PO={};function Hs(){return PO}function Po(e,t){var i,c,l,u;const n=Hs(),r=(t==null?void 0:t.weekStartsOn)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(l=n.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??0,o=Pt(e),a=o.getDay(),s=(a<r?7:0)+a-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function Ja(e){return Po(e,{weekStartsOn:1})}function jx(e){const t=Pt(e),n=t.getFullYear(),r=Gn(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=Ja(r),a=Gn(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const s=Ja(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function Qu(e){const t=Pt(e);return t.setHours(0,0,0,0),t}function ef(e){const t=Pt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function MO(e,t){const n=Qu(e),r=Qu(t),o=+n-ef(n),a=+r-ef(r);return Math.round((o-a)/kO)}function DO(e){const t=jx(e),n=Gn(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Ja(n)}function OO(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function RO(e){if(!OO(e)&&typeof e!="number")return!1;const t=Pt(e);return!isNaN(Number(t))}function AO(e){const t=Pt(e),n=Gn(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const TO={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},IO=(e,t,n)=>{let r;const o=TO[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function wi(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const $O={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},zO={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},LO={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},WO={date:wi({formats:$O,defaultWidth:"full"}),time:wi({formats:zO,defaultWidth:"full"}),dateTime:wi({formats:LO,defaultWidth:"full"})},FO={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},BO=(e,t,n,r)=>FO[e];function Xr(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,i=n!=null&&n.width?String(n.width):s;o=e.formattingValues[i]||e.formattingValues[s]}else{const s=e.defaultWidth,i=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[i]||e.values[s]}const a=e.argumentCallback?e.argumentCallback(t):t;return o[a]}}const HO={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},VO={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},YO={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},qO={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},GO={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},UO={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},XO=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},KO={ordinalNumber:XO,era:Xr({values:HO,defaultWidth:"wide"}),quarter:Xr({values:VO,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Xr({values:YO,defaultWidth:"wide"}),day:Xr({values:qO,defaultWidth:"wide"}),dayPeriod:Xr({values:GO,defaultWidth:"wide",formattingValues:UO,defaultFormattingWidth:"wide"})};function Kr(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const s=a[0],i=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?ZO(i,f=>f.test(s)):JO(i,f=>f.test(s));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(s.length);return{value:l,rest:u}}}function JO(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function ZO(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function QO(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],a=t.match(e.parsePattern);if(!a)return null;let s=e.valueCallback?e.valueCallback(a[0]):a[0];s=n.valueCallback?n.valueCallback(s):s;const i=t.slice(o.length);return{value:s,rest:i}}}const eR=/^(\d+)(th|st|nd|rd)?/i,tR=/\d+/i,nR={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},rR={any:[/^b/i,/^(a|c)/i]},oR={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},aR={any:[/1/i,/2/i,/3/i,/4/i]},sR={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},iR={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},cR={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},lR={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},dR={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},uR={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},fR={ordinalNumber:QO({matchPattern:eR,parsePattern:tR,valueCallback:e=>parseInt(e,10)}),era:Kr({matchPatterns:nR,defaultMatchWidth:"wide",parsePatterns:rR,defaultParseWidth:"any"}),quarter:Kr({matchPatterns:oR,defaultMatchWidth:"wide",parsePatterns:aR,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Kr({matchPatterns:sR,defaultMatchWidth:"wide",parsePatterns:iR,defaultParseWidth:"any"}),day:Kr({matchPatterns:cR,defaultMatchWidth:"wide",parsePatterns:lR,defaultParseWidth:"any"}),dayPeriod:Kr({matchPatterns:dR,defaultMatchWidth:"any",parsePatterns:uR,defaultParseWidth:"any"})},hR={code:"en-US",formatDistance:IO,formatLong:WO,formatRelative:BO,localize:KO,match:fR,options:{weekStartsOn:0,firstWeekContainsDate:1}};function pR(e){const t=Pt(e);return MO(t,AO(t))+1}function mR(e){const t=Pt(e),n=+Ja(t)-+DO(t);return Math.round(n/wx)+1}function _x(e,t){var u,f,h,p;const n=Pt(e),r=n.getFullYear(),o=Hs(),a=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(h=o.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,s=Gn(e,0);s.setFullYear(r+1,0,a),s.setHours(0,0,0,0);const i=Po(s,t),c=Gn(e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);const l=Po(c,t);return n.getTime()>=i.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function gR(e,t){var i,c,l,u;const n=Hs(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(l=n.locale)==null?void 0:l.options)==null?void 0:u.firstWeekContainsDate)??1,o=_x(e,t),a=Gn(e,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),Po(a,t)}function yR(e,t){const n=Pt(e),r=+Po(n,t)-+gR(n,t);return Math.round(r/wx)+1}function je(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const mn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return je(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):je(n+1,2)},d(e,t){return je(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return je(e.getHours()%12||12,t.length)},H(e,t){return je(e.getHours(),t.length)},m(e,t){return je(e.getMinutes(),t.length)},s(e,t){return je(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return je(o,t.length)}},or={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tf={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return mn.y(e,t)},Y:function(e,t,n,r){const o=_x(e,r),a=o>0?o:1-o;if(t==="YY"){const s=a%100;return je(s,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):je(a,t.length)},R:function(e,t){const n=jx(e);return je(n,t.length)},u:function(e,t){const n=e.getFullYear();return je(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return je(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return je(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return mn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return je(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=yR(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):je(o,t.length)},I:function(e,t,n){const r=mR(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):je(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):mn.d(e,t)},D:function(e,t,n){const r=pR(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):je(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return je(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return je(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return je(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=or.noon:r===0?o=or.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=or.evening:r>=12?o=or.afternoon:r>=4?o=or.morning:o=or.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return mn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):mn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):je(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):je(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):mn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):mn.s(e,t)},S:function(e,t){return mn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return rf(r);case"XXXX":case"XX":return Dn(r);case"XXXXX":case"XXX":default:return Dn(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return rf(r);case"xxxx":case"xx":return Dn(r);case"xxxxx":case"xxx":default:return Dn(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+nf(r,":");case"OOOO":default:return"GMT"+Dn(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+nf(r,":");case"zzzz":default:return"GMT"+Dn(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return je(r,t.length)},T:function(e,t,n){const r=e.getTime();return je(r,t.length)}};function nf(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),a=r%60;return a===0?n+String(o):n+String(o)+t+je(a,2)}function rf(e,t){return e%60===0?(e>0?"-":"+")+je(Math.abs(e)/60,2):Dn(e,t)}function Dn(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=je(Math.trunc(r/60),2),a=je(r%60,2);return n+o+t+a}const of=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Sx=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},xR=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return of(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",of(r,t)).replace("{{time}}",Sx(o,t))},vR={p:Sx,P:xR},bR=/^D+$/,wR=/^Y+$/,jR=["D","DD","YY","YYYY"];function _R(e){return bR.test(e)}function SR(e){return wR.test(e)}function CR(e,t,n){const r=NR(e,t,n);if(console.warn(r),jR.includes(e))throw new RangeError(r)}function NR(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ER=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,PR=/^'([^]*?)'?$/,MR=/''/g,DR=/[a-zA-Z]/;function OR(e,t,n){var u,f,h,p;const r=Hs(),o=r.locale??hR,a=r.firstWeekContainsDate??((f=(u=r.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,s=r.weekStartsOn??((p=(h=r.locale)==null?void 0:h.options)==null?void 0:p.weekStartsOn)??0,i=Pt(e);if(!RO(i))throw new RangeError("Invalid time value");let c=t.match(kR).map(m=>{const g=m[0];if(g==="p"||g==="P"){const y=vR[g];return y(m,o.formatLong)}return m}).join("").match(ER).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const g=m[0];if(g==="'")return{isToken:!1,value:RR(m)};if(tf[g])return{isToken:!0,value:m};if(g.match(DR))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:m}});o.localize.preprocessor&&(c=o.localize.preprocessor(i,c));const l={firstWeekContainsDate:a,weekStartsOn:s,locale:o};return c.map(m=>{if(!m.isToken)return m.value;const g=m.value;(SR(g)||_R(g))&&CR(g,t,String(e));const y=tf[g[0]];return y(i,g,o.localize,l)}).join("")}function RR(e){const t=e.match(PR);return t?t[1].replace(MR,"'"):e}function AR(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const ji={},oo={};function Tn(e,t){try{const r=(ji[e]||(ji[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in oo?oo[r]:af(r,r.split(":"))}catch{if(e in oo)return oo[e];const n=e==null?void 0:e.match(TR);return n?af(e,n.slice(1)):NaN}}const TR=/([+-]\d\d):?(\d\d)?/;function af(e,t){const n=+(t[0]||0),r=+(t[1]||0),o=+(t[2]||0)/60;return oo[e]=n*60+r>0?n*60+r+o:n*60-r-o}class Bt extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Tn(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),Cx(this),xc(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new Bt(...n,t):new Bt(Date.now(),t)}withTimeZone(t){return new Bt(+this,t)}getTimezoneOffset(){const t=-Tn(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),xc(this),+this}[Symbol.for("constructDateFrom")](t){return new Bt(+new Date(t),this.timeZone)}}const sf=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!sf.test(e))return;const t=e.replace(sf,"$1UTC");Bt.prototype[t]&&(e.startsWith("get")?Bt.prototype[e]=function(){return this.internal[t]()}:(Bt.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),IR(this),+this},Bt.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),xc(this),+this}))});function xc(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Tn(e.timeZone,e)*60))}function IR(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Cx(e)}function Cx(e){const t=Tn(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const o=-new Date(+e).getTimezoneOffset(),a=-new Date(+r).getTimezoneOffset(),s=o-a,i=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();s&&i&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+s);const c=o-n;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const l=new Date(+e);l.setUTCSeconds(0);const u=o>0?l.getSeconds():(l.getSeconds()-60)%60,f=Math.round(-(Tn(e.timeZone,e)*60))%60;(f||u)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+f),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+f+u));const h=Tn(e.timeZone,e),p=h>0?Math.floor(h):Math.ceil(h),g=-new Date(+e).getTimezoneOffset()-p,y=p!==n,v=g-c;if(y&&v){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+v);const w=Tn(e.timeZone,e),x=w>0?Math.floor(w):Math.ceil(w),j=p-x;j&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+j),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+j))}}class Ve extends Bt{static tz(t,...n){return n.length?new Ve(...n,t):new Ve(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),o=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,o]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${o}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,o]=this.tzComponents();return`${t} GMT${n}${r}${o} (${AR(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),o=String(Math.abs(t)%60).padStart(2,"0");return[n,r,o]}withTimeZone(t){return new Ve(+this,t)}[Symbol.for("constructDateFrom")](t){return new Ve(+new Date(t),this.timeZone)}}const Nx=6048e5,$R=864e5,cf=Symbol.for("constructDateFrom");function Te(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&cf in e?e[cf](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ce(e,t){return Te(t||e,e)}function Ex(e,t,n){const r=Ce(e,n==null?void 0:n.in);return isNaN(t)?Te(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function kx(e,t,n){const r=Ce(e,n==null?void 0:n.in);if(isNaN(t))return Te(e,NaN);if(!t)return r;const o=r.getDate(),a=Te(e,r.getTime());a.setMonth(r.getMonth()+t+1,0);const s=a.getDate();return o>=s?a:(r.setFullYear(a.getFullYear(),a.getMonth(),o),r)}let zR={};function Ko(){return zR}function Rr(e,t){var i,c,l,u;const n=Ko(),r=(t==null?void 0:t.weekStartsOn)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(l=n.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??0,o=Ce(e,t==null?void 0:t.in),a=o.getDay(),s=(a<r?7:0)+a-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function Mo(e,t){return Rr(e,{...t,weekStartsOn:1})}function Px(e,t){const n=Ce(e,t==null?void 0:t.in),r=n.getFullYear(),o=Te(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const a=Mo(o),s=Te(n,0);s.setFullYear(r,0,4),s.setHours(0,0,0,0);const i=Mo(s);return n.getTime()>=a.getTime()?r+1:n.getTime()>=i.getTime()?r:r-1}function lf(e){const t=Ce(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Fr(e,...t){const n=Te.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Do(e,t){const n=Ce(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function Tl(e,t,n){const[r,o]=Fr(n==null?void 0:n.in,e,t),a=Do(r),s=Do(o),i=+a-lf(a),c=+s-lf(s);return Math.round((i-c)/$R)}function LR(e,t){const n=Px(e,t),r=Te(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Mo(r)}function WR(e,t,n){return Ex(e,t*7,n)}function FR(e,t,n){return kx(e,t*12,n)}function BR(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=Te.bind(null,o));const a=Ce(o,r);(!n||n<a||isNaN(+a))&&(n=a)}),Te(r,n||NaN)}function HR(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=Te.bind(null,o));const a=Ce(o,r);(!n||n>a||isNaN(+a))&&(n=a)}),Te(r,n||NaN)}function VR(e,t,n){const[r,o]=Fr(n==null?void 0:n.in,e,t);return+Do(r)==+Do(o)}function Mx(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function YR(e){return!(!Mx(e)&&typeof e!="number"||isNaN(+Ce(e)))}function Dx(e,t,n){const[r,o]=Fr(n==null?void 0:n.in,e,t),a=r.getFullYear()-o.getFullYear(),s=r.getMonth()-o.getMonth();return a*12+s}function qR(e,t){const n=Ce(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Ox(e,t){const[n,r]=Fr(e,t.start,t.end);return{start:n,end:r}}function GR(e,t){const{start:n,end:r}=Ox(t==null?void 0:t.in,e);let o=+n>+r;const a=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0),s.setDate(1);let i=1;const c=[];for(;+s<=a;)c.push(Te(n,s)),s.setMonth(s.getMonth()+i);return o?c.reverse():c}function UR(e,t){const n=Ce(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function XR(e,t){const n=Ce(e,t==null?void 0:t.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function Rx(e,t){const n=Ce(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function KR(e,t){const{start:n,end:r}=Ox(t==null?void 0:t.in,e);let o=+n>+r;const a=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0),s.setMonth(0,1);let i=1;const c=[];for(;+s<=a;)c.push(Te(n,s)),s.setFullYear(s.getFullYear()+i);return o?c.reverse():c}function Ax(e,t){var i,c,l,u;const n=Ko(),r=(t==null?void 0:t.weekStartsOn)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(l=n.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??0,o=Ce(e,t==null?void 0:t.in),a=o.getDay(),s=(a<r?-7:0)+6-(a-r);return o.setDate(o.getDate()+s),o.setHours(23,59,59,999),o}function JR(e,t){return Ax(e,{...t,weekStartsOn:1})}const ZR={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},QR=(e,t,n)=>{let r;const o=ZR[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function _i(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const eA={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},tA={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},nA={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},rA={date:_i({formats:eA,defaultWidth:"full"}),time:_i({formats:tA,defaultWidth:"full"}),dateTime:_i({formats:nA,defaultWidth:"full"})},oA={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},aA=(e,t,n,r)=>oA[e];function Jr(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,i=n!=null&&n.width?String(n.width):s;o=e.formattingValues[i]||e.formattingValues[s]}else{const s=e.defaultWidth,i=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[i]||e.values[s]}const a=e.argumentCallback?e.argumentCallback(t):t;return o[a]}}const sA={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},iA={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},cA={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},lA={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dA={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},uA={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},fA=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},hA={ordinalNumber:fA,era:Jr({values:sA,defaultWidth:"wide"}),quarter:Jr({values:iA,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Jr({values:cA,defaultWidth:"wide"}),day:Jr({values:lA,defaultWidth:"wide"}),dayPeriod:Jr({values:dA,defaultWidth:"wide",formattingValues:uA,defaultFormattingWidth:"wide"})};function Zr(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const s=a[0],i=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?mA(i,f=>f.test(s)):pA(i,f=>f.test(s));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(s.length);return{value:l,rest:u}}}function pA(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function mA(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function gA(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],a=t.match(e.parsePattern);if(!a)return null;let s=e.valueCallback?e.valueCallback(a[0]):a[0];s=n.valueCallback?n.valueCallback(s):s;const i=t.slice(o.length);return{value:s,rest:i}}}const yA=/^(\d+)(th|st|nd|rd)?/i,xA=/\d+/i,vA={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},bA={any:[/^b/i,/^(a|c)/i]},wA={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},jA={any:[/1/i,/2/i,/3/i,/4/i]},_A={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},SA={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},CA={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},NA={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},EA={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},kA={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},PA={ordinalNumber:gA({matchPattern:yA,parsePattern:xA,valueCallback:e=>parseInt(e,10)}),era:Zr({matchPatterns:vA,defaultMatchWidth:"wide",parsePatterns:bA,defaultParseWidth:"any"}),quarter:Zr({matchPatterns:wA,defaultMatchWidth:"wide",parsePatterns:jA,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Zr({matchPatterns:_A,defaultMatchWidth:"wide",parsePatterns:SA,defaultParseWidth:"any"}),day:Zr({matchPatterns:CA,defaultMatchWidth:"wide",parsePatterns:NA,defaultParseWidth:"any"}),dayPeriod:Zr({matchPatterns:EA,defaultMatchWidth:"any",parsePatterns:kA,defaultParseWidth:"any"})},cr={code:"en-US",formatDistance:QR,formatLong:rA,formatRelative:aA,localize:hA,match:PA,options:{weekStartsOn:0,firstWeekContainsDate:1}};function MA(e,t){const n=Ce(e,t==null?void 0:t.in);return Tl(n,Rx(n))+1}function Il(e,t){const n=Ce(e,t==null?void 0:t.in),r=+Mo(n)-+LR(n);return Math.round(r/Nx)+1}function Tx(e,t){var u,f,h,p;const n=Ce(e,t==null?void 0:t.in),r=n.getFullYear(),o=Ko(),a=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(h=o.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,s=Te((t==null?void 0:t.in)||e,0);s.setFullYear(r+1,0,a),s.setHours(0,0,0,0);const i=Rr(s,t),c=Te((t==null?void 0:t.in)||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);const l=Rr(c,t);return+n>=+i?r+1:+n>=+l?r:r-1}function DA(e,t){var i,c,l,u;const n=Ko(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(l=n.locale)==null?void 0:l.options)==null?void 0:u.firstWeekContainsDate)??1,o=Tx(e,t),a=Te((t==null?void 0:t.in)||e,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),Rr(a,t)}function $l(e,t){const n=Ce(e,t==null?void 0:t.in),r=+Rr(n,t)-+DA(n,t);return Math.round(r/Nx)+1}function _e(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const gn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return _e(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):_e(n+1,2)},d(e,t){return _e(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return _e(e.getHours()%12||12,t.length)},H(e,t){return _e(e.getHours(),t.length)},m(e,t){return _e(e.getMinutes(),t.length)},s(e,t){return _e(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return _e(o,t.length)}},ar={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},df={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return gn.y(e,t)},Y:function(e,t,n,r){const o=Tx(e,r),a=o>0?o:1-o;if(t==="YY"){const s=a%100;return _e(s,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):_e(a,t.length)},R:function(e,t){const n=Px(e);return _e(n,t.length)},u:function(e,t){const n=e.getFullYear();return _e(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return _e(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return _e(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return gn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return _e(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=$l(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):_e(o,t.length)},I:function(e,t,n){const r=Il(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):_e(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):gn.d(e,t)},D:function(e,t,n){const r=MA(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):_e(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return _e(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return _e(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return _e(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=ar.noon:r===0?o=ar.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=ar.evening:r>=12?o=ar.afternoon:r>=4?o=ar.morning:o=ar.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return gn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):gn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):_e(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):_e(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):gn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):gn.s(e,t)},S:function(e,t){return gn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return ff(r);case"XXXX":case"XX":return On(r);case"XXXXX":case"XXX":default:return On(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return ff(r);case"xxxx":case"xx":return On(r);case"xxxxx":case"xxx":default:return On(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+uf(r,":");case"OOOO":default:return"GMT"+On(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+uf(r,":");case"zzzz":default:return"GMT"+On(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return _e(r,t.length)},T:function(e,t,n){return _e(+e,t.length)}};function uf(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),a=r%60;return a===0?n+String(o):n+String(o)+t+_e(a,2)}function ff(e,t){return e%60===0?(e>0?"-":"+")+_e(Math.abs(e)/60,2):On(e,t)}function On(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=_e(Math.trunc(r/60),2),a=_e(r%60,2);return n+o+t+a}const hf=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Ix=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},OA=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return hf(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",hf(r,t)).replace("{{time}}",Ix(o,t))},RA={p:Ix,P:OA},AA=/^D+$/,TA=/^Y+$/,IA=["D","DD","YY","YYYY"];function $A(e){return AA.test(e)}function zA(e){return TA.test(e)}function LA(e,t,n){const r=WA(e,t,n);if(console.warn(r),IA.includes(e))throw new RangeError(r)}function WA(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const FA=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,BA=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,HA=/^'([^]*?)'?$/,VA=/''/g,YA=/[a-zA-Z]/;function ao(e,t,n){var u,f,h,p,m,g,y,v;const r=Ko(),o=(n==null?void 0:n.locale)??r.locale??cr,a=(n==null?void 0:n.firstWeekContainsDate)??((f=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(h=r.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((g=(m=n==null?void 0:n.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??r.weekStartsOn??((v=(y=r.locale)==null?void 0:y.options)==null?void 0:v.weekStartsOn)??0,i=Ce(e,n==null?void 0:n.in);if(!YR(i))throw new RangeError("Invalid time value");let c=t.match(BA).map(w=>{const x=w[0];if(x==="p"||x==="P"){const j=RA[x];return j(w,o.formatLong)}return w}).join("").match(FA).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const x=w[0];if(x==="'")return{isToken:!1,value:qA(w)};if(df[x])return{isToken:!0,value:w};if(x.match(YA))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:w}});o.localize.preprocessor&&(c=o.localize.preprocessor(i,c));const l={firstWeekContainsDate:a,weekStartsOn:s,locale:o};return c.map(w=>{if(!w.isToken)return w.value;const x=w.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&zA(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&$A(x))&&LA(x,t,String(e));const j=df[x[0]];return j(i,x,o.localize,l)}).join("")}function qA(e){const t=e.match(HA);return t?t[1].replace(VA,"'"):e}function GA(e,t){const n=Ce(e,t==null?void 0:t.in),r=n.getFullYear(),o=n.getMonth(),a=Te(n,0);return a.setFullYear(r,o+1,0),a.setHours(0,0,0,0),a.getDate()}function UA(e,t){return Ce(e,t==null?void 0:t.in).getMonth()}function XA(e,t){return Ce(e,t==null?void 0:t.in).getFullYear()}function KA(e,t){return+Ce(e)>+Ce(t)}function JA(e,t){return+Ce(e)<+Ce(t)}function ZA(e,t,n){const[r,o]=Fr(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}function QA(e,t,n){const[r,o]=Fr(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()}function eT(e,t,n){const r=Ce(e,n==null?void 0:n.in),o=r.getFullYear(),a=r.getDate(),s=Te(e,0);s.setFullYear(o,t,15),s.setHours(0,0,0,0);const i=GA(s);return r.setMonth(t,Math.min(a,i)),r}function tT(e,t,n){const r=Ce(e,n==null?void 0:n.in);return isNaN(+r)?Te(e,NaN):(r.setFullYear(t),r)}const pf=5,nT=4;function rT(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,o=t.addDays(e,-r+1),a=t.addDays(o,pf*7-1);return t.getMonth(e)===t.getMonth(a)?pf:nT}function $x(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-1*6):t.addDays(n,-1*(r-1))}function oT(e,t){const n=$x(e,t),r=rT(e,t);return t.addDays(n,r*7-1)}const zx={...cr,labels:{labelDayButton:(e,t,n,r)=>{let o;r&&typeof r.format=="function"?o=r.format.bind(r):o=(s,i)=>ao(s,i,{locale:cr,...n});let a=o(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(o,a)=>ao(o,a,{locale:cr,...t}),r(e,"LLLL yyyy")},labelGridcell:(e,t,n,r)=>{let o;r&&typeof r.format=="function"?o=r.format.bind(r):o=(s,i)=>ao(s,i,{locale:cr,...n});let a=o(e,"PPPP");return t!=null&&t.today&&(a=`Today, ${a}`),a},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(o,a)=>ao(o,a,{locale:cr,...t}),r(e,"cccc")}}};class lt{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?Ve.tz(this.options.timeZone):new this.Date},this.newDate=(r,o,a)=>{var s;return(s=this.overrides)!=null&&s.newDate?this.overrides.newDate(r,o,a):this.options.timeZone?new Ve(r,o,a,this.options.timeZone):new Date(r,o,a)},this.addDays=(r,o)=>{var a;return(a=this.overrides)!=null&&a.addDays?this.overrides.addDays(r,o):Ex(r,o)},this.addMonths=(r,o)=>{var a;return(a=this.overrides)!=null&&a.addMonths?this.overrides.addMonths(r,o):kx(r,o)},this.addWeeks=(r,o)=>{var a;return(a=this.overrides)!=null&&a.addWeeks?this.overrides.addWeeks(r,o):WR(r,o)},this.addYears=(r,o)=>{var a;return(a=this.overrides)!=null&&a.addYears?this.overrides.addYears(r,o):FR(r,o)},this.differenceInCalendarDays=(r,o)=>{var a;return(a=this.overrides)!=null&&a.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,o):Tl(r,o)},this.differenceInCalendarMonths=(r,o)=>{var a;return(a=this.overrides)!=null&&a.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,o):Dx(r,o)},this.eachMonthOfInterval=r=>{var o;return(o=this.overrides)!=null&&o.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):GR(r)},this.eachYearOfInterval=r=>{var i;const o=(i=this.overrides)!=null&&i.eachYearOfInterval?this.overrides.eachYearOfInterval(r):KR(r),a=new Set(o.map(c=>this.getYear(c)));if(a.size===o.length)return o;const s=[];return a.forEach(c=>{s.push(new Date(c,0,1))}),s},this.endOfBroadcastWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):oT(r,this)},this.endOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfISOWeek?this.overrides.endOfISOWeek(r):JR(r)},this.endOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.endOfMonth?this.overrides.endOfMonth(r):qR(r)},this.endOfWeek=(r,o)=>{var a;return(a=this.overrides)!=null&&a.endOfWeek?this.overrides.endOfWeek(r,o):Ax(r,this.options)},this.endOfYear=r=>{var o;return(o=this.overrides)!=null&&o.endOfYear?this.overrides.endOfYear(r):XR(r)},this.format=(r,o,a)=>{var i;const s=(i=this.overrides)!=null&&i.format?this.overrides.format(r,o,this.options):ao(r,o,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(s):s},this.getISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.getISOWeek?this.overrides.getISOWeek(r):Il(r)},this.getMonth=(r,o)=>{var a;return(a=this.overrides)!=null&&a.getMonth?this.overrides.getMonth(r,this.options):UA(r,this.options)},this.getYear=(r,o)=>{var a;return(a=this.overrides)!=null&&a.getYear?this.overrides.getYear(r,this.options):XA(r,this.options)},this.getWeek=(r,o)=>{var a;return(a=this.overrides)!=null&&a.getWeek?this.overrides.getWeek(r,this.options):$l(r,this.options)},this.isAfter=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isAfter?this.overrides.isAfter(r,o):KA(r,o)},this.isBefore=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isBefore?this.overrides.isBefore(r,o):JA(r,o)},this.isDate=r=>{var o;return(o=this.overrides)!=null&&o.isDate?this.overrides.isDate(r):Mx(r)},this.isSameDay=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isSameDay?this.overrides.isSameDay(r,o):VR(r,o)},this.isSameMonth=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isSameMonth?this.overrides.isSameMonth(r,o):ZA(r,o)},this.isSameYear=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isSameYear?this.overrides.isSameYear(r,o):QA(r,o)},this.max=r=>{var o;return(o=this.overrides)!=null&&o.max?this.overrides.max(r):BR(r)},this.min=r=>{var o;return(o=this.overrides)!=null&&o.min?this.overrides.min(r):HR(r)},this.setMonth=(r,o)=>{var a;return(a=this.overrides)!=null&&a.setMonth?this.overrides.setMonth(r,o):eT(r,o)},this.setYear=(r,o)=>{var a;return(a=this.overrides)!=null&&a.setYear?this.overrides.setYear(r,o):tT(r,o)},this.startOfBroadcastWeek=(r,o)=>{var a;return(a=this.overrides)!=null&&a.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):$x(r,this)},this.startOfDay=r=>{var o;return(o=this.overrides)!=null&&o.startOfDay?this.overrides.startOfDay(r):Do(r)},this.startOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.startOfISOWeek?this.overrides.startOfISOWeek(r):Mo(r)},this.startOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.startOfMonth?this.overrides.startOfMonth(r):UR(r)},this.startOfWeek=(r,o)=>{var a;return(a=this.overrides)!=null&&a.startOfWeek?this.overrides.startOfWeek(r,this.options):Rr(r,this.options)},this.startOfYear=r=>{var o;return(o=this.overrides)!=null&&o.startOfYear?this.overrides.startOfYear(r):Rx(r)},this.options={locale:zx,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let o=0;o<10;o++)r[o.toString()]=n.format(o);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&<.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:o}=this.options,a=n==null?void 0:n.code;if(a&<.yearFirstLocales.has(a))try{return new Intl.DateTimeFormat(a,{month:"long",year:"numeric",timeZone:r,numberingSystem:o}).format(t)}catch{}const s=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,s)}}lt.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Xt=new lt;class Lx{constructor(t,n,r=Xt){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r,this.isoDate=r.format(t,"yyyy-MM-dd"),this.displayMonthId=r.format(n,"yyyy-MM"),this.dateMonthId=r.format(t,"yyyy-MM")}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class aT{constructor(t,n){this.date=t,this.weeks=n}}class sT{constructor(t,n){this.days=n,this.weekNumber=t}}function iT(e){return _.createElement("button",{...e})}function cT(e){return _.createElement("span",{...e})}function lT(e){const{size:t=24,orientation:n="left",className:r}=e;return _.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&_.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&_.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&_.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&_.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function dT(e){const{day:t,modifiers:n,...r}=e;return _.createElement("td",{...r})}function uT(e){const{day:t,modifiers:n,...r}=e,o=_.useRef(null);return _.useEffect(()=>{var a;n.focused&&((a=o.current)==null||a.focus())},[n.focused]),_.createElement("button",{ref:o,...r})}var re;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(re||(re={}));var De;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(De||(De={}));var wt;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(wt||(wt={}));var tt;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(tt||(tt={}));function fT(e){const{options:t,className:n,components:r,classNames:o,...a}=e,s=[o[re.Dropdown],n].join(" "),i=t==null?void 0:t.find(({value:c})=>c===a.value);return _.createElement("span",{"data-disabled":a.disabled,className:o[re.DropdownRoot]},_.createElement(r.Select,{className:s,...a},t==null?void 0:t.map(({value:c,label:l,disabled:u})=>_.createElement(r.Option,{key:c,value:c,disabled:u},l))),_.createElement("span",{className:o[re.CaptionLabel],"aria-hidden":!0},i==null?void 0:i.label,_.createElement(r.Chevron,{orientation:"down",size:18,className:o[re.Chevron]})))}function hT(e){return _.createElement("div",{...e})}function pT(e){return _.createElement("div",{...e})}function mT(e){const{calendarMonth:t,displayIndex:n,...r}=e;return _.createElement("div",{...r},e.children)}function gT(e){const{calendarMonth:t,displayIndex:n,...r}=e;return _.createElement("div",{...r})}function yT(e){return _.createElement("table",{...e})}function xT(e){return _.createElement("div",{...e})}const Wx=_.createContext(void 0);function Jo(){const e=_.useContext(Wx);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function vT(e){const{components:t}=Jo();return _.createElement(t.Dropdown,{...e})}function bT(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:o,...a}=e,{components:s,classNames:i,labels:{labelPrevious:c,labelNext:l}}=Jo(),u=_.useCallback(h=>{o&&(n==null||n(h))},[o,n]),f=_.useCallback(h=>{r&&(t==null||t(h))},[r,t]);return _.createElement("nav",{...a},_.createElement(s.PreviousMonthButton,{type:"button",className:i[re.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:f},_.createElement(s.Chevron,{disabled:r?void 0:!0,className:i[re.Chevron],orientation:"left"})),_.createElement(s.NextMonthButton,{type:"button",className:i[re.NextMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":l(o),onClick:u},_.createElement(s.Chevron,{disabled:o?void 0:!0,orientation:"right",className:i[re.Chevron]})))}function wT(e){const{components:t}=Jo();return _.createElement(t.Button,{...e})}function jT(e){return _.createElement("option",{...e})}function _T(e){const{components:t}=Jo();return _.createElement(t.Button,{...e})}function ST(e){const{rootRef:t,...n}=e;return _.createElement("div",{...n,ref:t})}function CT(e){return _.createElement("select",{...e})}function NT(e){const{week:t,...n}=e;return _.createElement("tr",{...n})}function ET(e){return _.createElement("th",{...e})}function kT(e){return _.createElement("thead",{"aria-hidden":!0},_.createElement("tr",{...e}))}function PT(e){const{week:t,...n}=e;return _.createElement("th",{...n})}function MT(e){return _.createElement("th",{...e})}function DT(e){return _.createElement("tbody",{...e})}function OT(e){const{components:t}=Jo();return _.createElement(t.Dropdown,{...e})}const RT=Object.freeze(Object.defineProperty({__proto__:null,Button:iT,CaptionLabel:cT,Chevron:lT,Day:dT,DayButton:uT,Dropdown:fT,DropdownNav:hT,Footer:pT,Month:mT,MonthCaption:gT,MonthGrid:yT,Months:xT,MonthsDropdown:vT,Nav:bT,NextMonthButton:wT,Option:jT,PreviousMonthButton:_T,Root:ST,Select:CT,Week:NT,WeekNumber:PT,WeekNumberHeader:MT,Weekday:ET,Weekdays:kT,Weeks:DT,YearsDropdown:OT},Symbol.toStringTag,{value:"Module"}));function on(e,t,n=!1,r=Xt){let{from:o,to:a}=e;const{differenceInCalendarDays:s,isSameDay:i}=r;return o&&a?(s(a,o)<0&&([o,a]=[a,o]),s(t,o)>=(n?1:0)&&s(a,t)>=(n?1:0)):!n&&a?i(a,t):!n&&o?i(o,t):!1}function zl(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Vs(e){return!!(e&&typeof e=="object"&&"from"in e)}function Ll(e){return!!(e&&typeof e=="object"&&"after"in e)}function Wl(e){return!!(e&&typeof e=="object"&&"before"in e)}function Fx(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Bx(e,t){return Array.isArray(e)&&e.every(t.isDate)}function an(e,t,n=Xt){const r=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:a,isAfter:s}=n;return r.some(i=>{if(typeof i=="boolean")return i;if(n.isDate(i))return o(e,i);if(Bx(i,n))return i.some(c=>o(e,c));if(Vs(i))return on(i,e,!1,n);if(Fx(i))return Array.isArray(i.dayOfWeek)?i.dayOfWeek.includes(e.getDay()):i.dayOfWeek===e.getDay();if(zl(i)){const c=a(i.before,e),l=a(i.after,e),u=c>0,f=l<0;return s(i.before,i.after)?f&&u:u||f}return Ll(i)?a(e,i.after)>0:Wl(i)?a(i.before,e)>0:typeof i=="function"?i(e):!1})}function AT(e,t,n,r,o){const{disabled:a,hidden:s,modifiers:i,showOutsideDays:c,broadcastCalendar:l,today:u=o.today()}=t,{isSameDay:f,isSameMonth:h,startOfMonth:p,isBefore:m,endOfMonth:g,isAfter:y}=o,v=n&&p(n),w=r&&g(r),x={[De.focused]:[],[De.outside]:[],[De.disabled]:[],[De.hidden]:[],[De.today]:[]},j={};for(const N of e){const{date:S,displayMonth:C}=N,P=!!(C&&!h(S,C)),k=!!(v&&m(S,v)),T=!!(w&&y(S,w)),D=!!(a&&an(S,a,o)),M=!!(s&&an(S,s,o))||k||T||!l&&!c&&P||l&&c===!1&&P,L=f(S,u);P&&x.outside.push(N),D&&x.disabled.push(N),M&&x.hidden.push(N),L&&x.today.push(N),i&&Object.keys(i).forEach(E=>{const I=i==null?void 0:i[E];I&&an(S,I,o)&&(j[E]?j[E].push(N):j[E]=[N])})}return N=>{const S={[De.focused]:!1,[De.disabled]:!1,[De.hidden]:!1,[De.outside]:!1,[De.today]:!1},C={};for(const P in x){const k=x[P];S[P]=k.some(T=>T===N)}for(const P in j)C[P]=j[P].some(k=>k===N);return{...S,...C}}}function TT(e,t,n={}){return Object.entries(e).filter(([,o])=>o===!0).reduce((o,[a])=>(n[a]?o.push(n[a]):t[De[a]]?o.push(t[De[a]]):t[wt[a]]&&o.push(t[wt[a]]),o),[t[re.Day]])}function IT(e){return{...RT,...e}}function $T(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function zT(){const e={};for(const t in re)e[re[t]]=`rdp-${re[t]}`;for(const t in De)e[De[t]]=`rdp-${De[t]}`;for(const t in wt)e[wt[t]]=`rdp-${wt[t]}`;for(const t in tt)e[tt[t]]=`rdp-${tt[t]}`;return e}function Hx(e,t,n){return(n??new lt(t)).formatMonthYear(e)}const LT=Hx;function WT(e,t,n){return(n??new lt(t)).format(e,"d")}function FT(e,t=Xt){return t.format(e,"LLLL")}function BT(e,t,n){return(n??new lt(t)).format(e,"cccccc")}function HT(e,t=Xt){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function VT(){return""}function Vx(e,t=Xt){return t.format(e,"yyyy")}const YT=Vx,qT=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:Hx,formatDay:WT,formatMonthCaption:LT,formatMonthDropdown:FT,formatWeekNumber:HT,formatWeekNumberHeader:VT,formatWeekdayName:BT,formatYearCaption:YT,formatYearDropdown:Vx},Symbol.toStringTag,{value:"Module"}));function GT(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...qT,...e}}function Fl(e,t,n,r){let o=(r??new lt(n)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const UT=Fl;function Bl(e,t,n){return(n??new lt(t)).formatMonthYear(e)}const XT=Bl;function Yx(e,t,n,r){let o=(r??new lt(n)).format(e,"PPPP");return t!=null&&t.today&&(o=`Today, ${o}`),o}function qx(e){return"Choose the Month"}function Gx(){return""}const KT="Go to the Next Month";function Ux(e,t){return KT}function Xx(e){return"Go to the Previous Month"}function Kx(e,t,n){return(n??new lt(t)).format(e,"cccc")}function Jx(e,t){return`Week ${e}`}function Zx(e){return"Week Number"}function Qx(e){return"Choose the Year"}const JT=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:XT,labelDay:UT,labelDayButton:Fl,labelGrid:Bl,labelGridcell:Yx,labelMonthDropdown:qx,labelNav:Gx,labelNext:Ux,labelPrevious:Xx,labelWeekNumber:Jx,labelWeekNumberHeader:Zx,labelWeekday:Kx,labelYearDropdown:Qx},Symbol.toStringTag,{value:"Module"})),pt=(e,t,n)=>t||(n?typeof n=="function"?n:(...r)=>n:e);function ZT(e,t){var r;const n=((r=t.locale)==null?void 0:r.labels)??{};return{...JT,...e??{},labelDayButton:pt(Fl,e==null?void 0:e.labelDayButton,n.labelDayButton),labelMonthDropdown:pt(qx,e==null?void 0:e.labelMonthDropdown,n.labelMonthDropdown),labelNext:pt(Ux,e==null?void 0:e.labelNext,n.labelNext),labelPrevious:pt(Xx,e==null?void 0:e.labelPrevious,n.labelPrevious),labelWeekNumber:pt(Jx,e==null?void 0:e.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:pt(Qx,e==null?void 0:e.labelYearDropdown,n.labelYearDropdown),labelGrid:pt(Bl,e==null?void 0:e.labelGrid,n.labelGrid),labelGridcell:pt(Yx,e==null?void 0:e.labelGridcell,n.labelGridcell),labelNav:pt(Gx,e==null?void 0:e.labelNav,n.labelNav),labelWeekNumberHeader:pt(Zx,e==null?void 0:e.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:pt(Kx,e==null?void 0:e.labelWeekday,n.labelWeekday)}}function QT(e,t,n,r,o){const{startOfMonth:a,startOfYear:s,endOfYear:i,eachMonthOfInterval:c,getMonth:l}=o;return c({start:s(e),end:i(e)}).map(h=>{const p=r.formatMonthDropdown(h,o),m=l(h),g=t&&h<a(t)||n&&h>a(n)||!1;return{value:m,label:p,disabled:g}})}function eI(e,t={},n={}){let r={...t==null?void 0:t[re.Day]};return Object.entries(e).filter(([,o])=>o===!0).forEach(([o])=>{r={...r,...n==null?void 0:n[o]}}),r}function tI(e,t,n,r){const o=r??e.today(),a=n?e.startOfBroadcastWeek(o,e):t?e.startOfISOWeek(o):e.startOfWeek(o),s=[];for(let i=0;i<7;i++){const c=e.addDays(a,i);s.push(c)}return s}function nI(e,t,n,r,o=!1){if(!e||!t)return;const{startOfYear:a,endOfYear:s,eachYearOfInterval:i,getYear:c}=r,l=a(e),u=s(t),f=i({start:l,end:u});return o&&f.reverse(),f.map(h=>{const p=n.formatYearDropdown(h,r);return{value:c(h),label:p,disabled:!1}})}function rI(e,t={}){var i;const{weekStartsOn:n,locale:r}=t,o=n??((i=r==null?void 0:r.options)==null?void 0:i.weekStartsOn)??0,a=c=>{const l=typeof c=="number"||typeof c=="string"?new Date(c):c;return new Ve(l.getFullYear(),l.getMonth(),l.getDate(),12,0,0,e)},s=c=>{const l=a(c);return new Date(l.getFullYear(),l.getMonth(),l.getDate(),0,0,0,0)};return{today:()=>a(Ve.tz(e)),newDate:(c,l,u)=>new Ve(c,l,u,12,0,0,e),startOfDay:c=>a(c),startOfWeek:(c,l)=>{const u=a(c),f=(l==null?void 0:l.weekStartsOn)??o,h=(u.getDay()-f+7)%7;return u.setDate(u.getDate()-h),u},startOfISOWeek:c=>{const l=a(c),u=(l.getDay()-1+7)%7;return l.setDate(l.getDate()-u),l},startOfMonth:c=>{const l=a(c);return l.setDate(1),l},startOfYear:c=>{const l=a(c);return l.setMonth(0,1),l},endOfWeek:(c,l)=>{const u=a(c),p=((((l==null?void 0:l.weekStartsOn)??o)+6)%7-u.getDay()+7)%7;return u.setDate(u.getDate()+p),u},endOfISOWeek:c=>{const l=a(c),u=(7-l.getDay())%7;return l.setDate(l.getDate()+u),l},endOfMonth:c=>{const l=a(c);return l.setMonth(l.getMonth()+1,0),l},endOfYear:c=>{const l=a(c);return l.setMonth(11,31),l},eachMonthOfInterval:c=>{const l=a(c.start),u=a(c.end),f=[],h=new Ve(l.getFullYear(),l.getMonth(),1,12,0,0,e),p=u.getFullYear()*12+u.getMonth();for(;h.getFullYear()*12+h.getMonth()<=p;)f.push(new Ve(h,e)),h.setMonth(h.getMonth()+1,1);return f},addDays:(c,l)=>{const u=a(c);return u.setDate(u.getDate()+l),u},addWeeks:(c,l)=>{const u=a(c);return u.setDate(u.getDate()+l*7),u},addMonths:(c,l)=>{const u=a(c);return u.setMonth(u.getMonth()+l),u},addYears:(c,l)=>{const u=a(c);return u.setFullYear(u.getFullYear()+l),u},eachYearOfInterval:c=>{const l=a(c.start),u=a(c.end),f=[],h=new Ve(l.getFullYear(),0,1,12,0,0,e);for(;h.getFullYear()<=u.getFullYear();)f.push(new Ve(h,e)),h.setFullYear(h.getFullYear()+1,0,1);return f},getWeek:(c,l)=>{var f;const u=s(c);return $l(u,{weekStartsOn:(l==null?void 0:l.weekStartsOn)??o,firstWeekContainsDate:(l==null?void 0:l.firstWeekContainsDate)??((f=r==null?void 0:r.options)==null?void 0:f.firstWeekContainsDate)??1})},getISOWeek:c=>{const l=s(c);return Il(l)},differenceInCalendarDays:(c,l)=>{const u=s(c),f=s(l);return Tl(u,f)},differenceInCalendarMonths:(c,l)=>{const u=s(c),f=s(l);return Dx(u,f)}}}const Zo=e=>e instanceof HTMLElement?e:null,Si=e=>[...e.querySelectorAll("[data-animated-month]")??[]],oI=e=>Zo(e.querySelector("[data-animated-month]")),Ci=e=>Zo(e.querySelector("[data-animated-caption]")),Ni=e=>Zo(e.querySelector("[data-animated-weeks]")),aI=e=>Zo(e.querySelector("[data-animated-nav]")),sI=e=>Zo(e.querySelector("[data-animated-weekdays]"));function iI(e,t,{classNames:n,months:r,focused:o,dateLib:a}){const s=_.useRef(null),i=_.useRef(r),c=_.useRef(!1);_.useLayoutEffect(()=>{const l=i.current;if(i.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||l.length===0||r.length!==l.length)return;const u=a.isSameMonth(r[0].date,l[0].date),f=a.isAfter(r[0].date,l[0].date),h=f?n[tt.caption_after_enter]:n[tt.caption_before_enter],p=f?n[tt.weeks_after_enter]:n[tt.weeks_before_enter],m=s.current,g=e.current.cloneNode(!0);if(g instanceof HTMLElement?(Si(g).forEach(x=>{if(!(x instanceof HTMLElement))return;const j=oI(x);j&&x.contains(j)&&x.removeChild(j);const N=Ci(x);N&&N.classList.remove(h);const S=Ni(x);S&&S.classList.remove(p)}),s.current=g):s.current=null,c.current||u||o)return;const y=m instanceof HTMLElement?Si(m):[],v=Si(e.current);if(v!=null&&v.every(w=>w instanceof HTMLElement)&&y&&y.every(w=>w instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const w=aI(e.current);w&&(w.style.zIndex="1"),v.forEach((x,j)=>{const N=y[j];if(!N)return;x.style.position="relative",x.style.overflow="hidden";const S=Ci(x);S&&S.classList.add(h);const C=Ni(x);C&&C.classList.add(p);const P=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),w&&(w.style.zIndex=""),S&&S.classList.remove(h),C&&C.classList.remove(p),x.style.position="",x.style.overflow="",x.contains(N)&&x.removeChild(N)};N.style.pointerEvents="none",N.style.position="absolute",N.style.overflow="hidden",N.setAttribute("aria-hidden","true");const k=sI(N);k&&(k.style.opacity="0");const T=Ci(N);T&&(T.classList.add(f?n[tt.caption_before_exit]:n[tt.caption_after_exit]),T.addEventListener("animationend",P));const D=Ni(N);D&&D.classList.add(f?n[tt.weeks_before_exit]:n[tt.weeks_after_exit]),x.insertBefore(N,x.firstChild)})}})}function cI(e,t,n,r){const o=e[0],a=e[e.length-1],{ISOWeek:s,fixedWeeks:i,broadcastCalendar:c}=n??{},{addDays:l,differenceInCalendarDays:u,differenceInCalendarMonths:f,endOfBroadcastWeek:h,endOfISOWeek:p,endOfMonth:m,endOfWeek:g,isAfter:y,startOfBroadcastWeek:v,startOfISOWeek:w,startOfWeek:x}=r,j=c?v(o,r):s?w(o):x(o),N=c?h(a):s?p(m(a)):g(m(a)),S=t&&(c?h(t):s?p(t):g(t)),C=S&&y(N,S)?S:N,P=u(C,j),k=f(a,o)+1,T=[];for(let L=0;L<=P;L++){const E=l(j,L);T.push(E)}const M=(c?35:42)*k;if(i&&T.length<M){const L=M-T.length;for(let E=0;E<L;E++){const I=l(T[T.length-1],1);T.push(I)}}return T}function lI(e){const t=[];return e.reduce((n,r)=>{const o=r.weeks.reduce((a,s)=>a.concat(s.days.slice()),t.slice());return n.concat(o.slice())},t.slice())}function dI(e,t,n,r){const{numberOfMonths:o=1}=n,a=[];for(let s=0;s<o;s++){const i=r.addMonths(e,s);if(t&&i>t)break;a.push(i)}return a}function mf(e,t,n,r){const{month:o,defaultMonth:a,today:s=r.today(),numberOfMonths:i=1}=e;let c=o||a||s;const{differenceInCalendarMonths:l,addMonths:u,startOfMonth:f}=r;if(n&&l(n,c)<i-1){const h=-1*(i-1);c=u(n,h)}return t&&l(c,t)<0&&(c=t),f(c)}function uI(e,t,n,r){const{addDays:o,endOfBroadcastWeek:a,endOfISOWeek:s,endOfMonth:i,endOfWeek:c,getISOWeek:l,getWeek:u,startOfBroadcastWeek:f,startOfISOWeek:h,startOfWeek:p}=r,m=e.reduce((g,y)=>{const v=n.broadcastCalendar?f(y,r):n.ISOWeek?h(y):p(y),w=n.broadcastCalendar?a(y):n.ISOWeek?s(i(y)):c(i(y)),x=t.filter(C=>C>=v&&C<=w),j=n.broadcastCalendar?35:42;if(n.fixedWeeks&&x.length<j){const C=t.filter(P=>{const k=j-x.length;return P>w&&P<=o(w,k)});x.push(...C)}const N=x.reduce((C,P)=>{const k=n.ISOWeek?l(P):u(P),T=C.find(M=>M.weekNumber===k),D=new Lx(P,y,r);return T?T.days.push(D):C.push(new sT(k,[D])),C},[]),S=new aT(y,N);return g.push(S),g},[]);return n.reverseMonths?m.reverse():m}function fI(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:o,startOfDay:a,startOfMonth:s,endOfMonth:i,addYears:c,endOfYear:l,newDate:u,today:f}=t,{fromYear:h,toYear:p,fromMonth:m,toMonth:g}=e;!n&&m&&(n=m),!n&&h&&(n=t.newDate(h,0,1)),!r&&g&&(r=g),!r&&p&&(r=u(p,11,31));const y=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=s(n):h?n=u(h,0,1):!n&&y&&(n=o(c(e.today??f(),-100))),r?r=i(r):p?r=u(p,11,31):!r&&y&&(r=l(e.today??f())),[n&&a(n),r&&a(r)]}function hI(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a=1}=n,{startOfMonth:s,addMonths:i,differenceInCalendarMonths:c}=r,l=o?a:1,u=s(e);if(!t)return i(u,l);if(!(c(t,e)<a))return i(u,l)}function pI(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a}=n,{startOfMonth:s,addMonths:i,differenceInCalendarMonths:c}=r,l=o?a??1:1,u=s(e);if(!t)return i(u,-l);if(!(c(u,t)<=0))return i(u,-l)}function mI(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function Ys(e,t){const[n,r]=_.useState(e);return[t===void 0?n:t,r]}function gI(e,t){var j;const[n,r]=fI(e,t),{startOfMonth:o,endOfMonth:a}=t,s=mf(e,n,r,t),[i,c]=Ys(s,e.month?s:void 0);_.useEffect(()=>{const N=mf(e,n,r,t);c(N)},[e.timeZone]);const{months:l,weeks:u,days:f,previousMonth:h,nextMonth:p}=_.useMemo(()=>{const N=dI(i,r,{numberOfMonths:e.numberOfMonths},t),S=cI(N,e.endMonth?a(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),C=uI(N,S,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),P=mI(C),k=lI(C),T=pI(i,n,e,t),D=hI(i,r,e,t);return{months:C,weeks:P,days:k,previousMonth:T,nextMonth:D}},[t,i.getTime(),r==null?void 0:r.getTime(),n==null?void 0:n.getTime(),e.disableNavigation,e.broadcastCalendar,(j=e.endMonth)==null?void 0:j.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:m,onMonthChange:g}=e,y=N=>u.some(S=>S.days.some(C=>C.isEqualTo(N))),v=N=>{if(m)return;let S=o(N);n&&S<o(n)&&(S=o(n)),r&&S>o(r)&&(S=o(r)),c(S),g==null||g(S)};return{months:l,weeks:u,days:f,navStart:n,navEnd:r,previousMonth:h,nextMonth:p,goToMonth:v,goToDay:N=>{y(N)||v(N.date)}}}var Tt;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Tt||(Tt={}));function gf(e){return!e[De.disabled]&&!e[De.hidden]&&!e[De.outside]}function yI(e,t,n,r){let o,a=-1;for(const s of e){const i=t(s);gf(i)&&(i[De.focused]&&a<Tt.FocusedModifier?(o=s,a=Tt.FocusedModifier):r!=null&&r.isEqualTo(s)&&a<Tt.LastFocused?(o=s,a=Tt.LastFocused):n(s.date)&&a<Tt.Selected?(o=s,a=Tt.Selected):i[De.today]&&a<Tt.Today&&(o=s,a=Tt.Today))}return o||(o=e.find(s=>gf(t(s)))),o}function xI(e,t,n,r,o,a,s){const{ISOWeek:i,broadcastCalendar:c}=a,{addDays:l,addMonths:u,addWeeks:f,addYears:h,endOfBroadcastWeek:p,endOfISOWeek:m,endOfWeek:g,max:y,min:v,startOfBroadcastWeek:w,startOfISOWeek:x,startOfWeek:j}=s;let S={day:l,week:f,month:u,year:h,startOfWeek:C=>c?w(C,s):i?x(C):j(C),endOfWeek:C=>c?p(C):i?m(C):g(C)}[e](n,t==="after"?1:-1);return t==="before"&&r?S=y([r,S]):t==="after"&&o&&(S=v([o,S])),S}function ev(e,t,n,r,o,a,s,i=0){if(i>365)return;const c=xI(e,t,n.date,r,o,a,s),l=!!(a.disabled&&an(c,a.disabled,s)),u=!!(a.hidden&&an(c,a.hidden,s)),f=c,h=new Lx(c,f,s);return!l&&!u?h:ev(e,t,h,r,o,a,s,i+1)}function vI(e,t,n,r,o){const{autoFocus:a}=e,[s,i]=_.useState(),c=yI(t.days,n,r||(()=>!1),s),[l,u]=_.useState(a?c:void 0);return{isFocusTarget:g=>!!(c!=null&&c.isEqualTo(g)),setFocused:u,focused:l,blur:()=>{i(l),u(void 0)},moveFocus:(g,y)=>{if(!l)return;const v=ev(g,y,l,t.navStart,t.navEnd,e,o);v&&(e.disableNavigation&&!t.days.some(x=>x.isEqualTo(v))||(t.goToDay(v),u(v)))}}}function bI(e,t){const{selected:n,required:r,onSelect:o}=e,[a,s]=Ys(n,o?n:void 0),i=o?n:a,{isSameDay:c}=t,l=p=>(i==null?void 0:i.some(m=>c(m,p)))??!1,{min:u,max:f}=e;return{selected:i,select:(p,m,g)=>{let y=[...i??[]];if(l(p)){if((i==null?void 0:i.length)===u||r&&(i==null?void 0:i.length)===1)return;y=i==null?void 0:i.filter(v=>!c(v,p))}else(i==null?void 0:i.length)===f?y=[p]:y=[...y,p];return o||s(y),o==null||o(y,p,m,g),y},isSelected:l}}function wI(e,t,n=0,r=0,o=!1,a=Xt){const{from:s,to:i}=t||{},{isSameDay:c,isAfter:l,isBefore:u}=a;let f;if(!s&&!i)f={from:e,to:n>0?void 0:e};else if(s&&!i)c(s,e)?n===0?f={from:s,to:e}:o?f={from:s,to:void 0}:f=void 0:u(e,s)?f={from:e,to:s}:f={from:s,to:e};else if(s&&i)if(c(s,e)&&c(i,e))o?f={from:s,to:i}:f=void 0;else if(c(s,e))f={from:s,to:n>0?void 0:e};else if(c(i,e))f={from:e,to:n>0?void 0:e};else if(u(e,s))f={from:e,to:i};else if(l(e,s))f={from:s,to:e};else if(l(e,i))f={from:s,to:e};else throw new Error("Invalid range");if(f!=null&&f.from&&(f!=null&&f.to)){const h=a.differenceInCalendarDays(f.to,f.from);r>0&&h>r?f={from:e,to:void 0}:n>1&&h<n&&(f={from:e,to:void 0})}return f}function jI(e,t,n=Xt){const r=Array.isArray(t)?t:[t];let o=e.from;const a=n.differenceInCalendarDays(e.to,e.from),s=Math.min(a,6);for(let i=0;i<=s;i++){if(r.includes(o.getDay()))return!0;o=n.addDays(o,1)}return!1}function yf(e,t,n=Xt){return on(e,t.from,!1,n)||on(e,t.to,!1,n)||on(t,e.from,!1,n)||on(t,e.to,!1,n)}function _I(e,t,n=Xt){const r=Array.isArray(t)?t:[t];if(r.filter(i=>typeof i!="function").some(i=>typeof i=="boolean"?i:n.isDate(i)?on(e,i,!1,n):Bx(i,n)?i.some(c=>on(e,c,!1,n)):Vs(i)?i.from&&i.to?yf(e,{from:i.from,to:i.to},n):!1:Fx(i)?jI(e,i.dayOfWeek,n):zl(i)?n.isAfter(i.before,i.after)?yf(e,{from:n.addDays(i.after,1),to:n.addDays(i.before,-1)},n):an(e.from,i,n)||an(e.to,i,n):Ll(i)||Wl(i)?an(e.from,i,n)||an(e.to,i,n):!1))return!0;const s=r.filter(i=>typeof i=="function");if(s.length){let i=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let l=0;l<=c;l++){if(s.some(u=>u(i)))return!0;i=n.addDays(i,1)}}return!1}function SI(e,t){const{disabled:n,excludeDisabled:r,selected:o,required:a,onSelect:s}=e,[i,c]=Ys(o,s?o:void 0),l=s?o:i;return{selected:l,select:(h,p,m)=>{const{min:g,max:y}=e,v=h?wI(h,l,g,y,a,t):void 0;return r&&n&&(v!=null&&v.from)&&v.to&&_I({from:v.from,to:v.to},n,t)&&(v.from=h,v.to=void 0),s||c(v),s==null||s(v,h,p,m),v},isSelected:h=>l&&on(l,h,!1,t)}}function CI(e,t){const{selected:n,required:r,onSelect:o}=e,[a,s]=Ys(n,o?n:void 0),i=o?n:a,{isSameDay:c}=t;return{selected:i,select:(f,h,p)=>{let m=f;return!r&&i&&i&&c(f,i)&&(m=void 0),o||s(m),o==null||o(m,f,h,p),m},isSelected:f=>i?c(i,f):!1}}function NI(e,t){const n=CI(e,t),r=bI(e,t),o=SI(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return o;default:return}}function ut(e,t){return e instanceof Ve&&e.timeZone===t?e:new Ve(e,t)}function sr(e,t,n){return ut(e,t)}function xf(e,t,n){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?sr(e,t):Array.isArray(e)?e.map(r=>r instanceof Date?sr(r,t):r):Vs(e)?{...e,from:e.from?ut(e.from,t):e.from,to:e.to?ut(e.to,t):e.to}:zl(e)?{before:sr(e.before,t),after:sr(e.after,t)}:Ll(e)?{after:sr(e.after,t)}:Wl(e)?{before:sr(e.before,t)}:e}function Ei(e,t,n){return e&&(Array.isArray(e)?e.map(r=>xf(r,t)):xf(e,t))}function EI(e){var kn;let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=ut(t.today,n)),t.month&&(t.month=ut(t.month,n)),t.defaultMonth&&(t.defaultMonth=ut(t.defaultMonth,n)),t.startMonth&&(t.startMonth=ut(t.startMonth,n)),t.endMonth&&(t.endMonth=ut(t.endMonth,n)),t.mode==="single"&&t.selected?t.selected=ut(t.selected,n):t.mode==="multiple"&&t.selected?t.selected=(kn=t.selected)==null?void 0:kn.map(le=>ut(le,n)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?ut(t.selected.from,n):t.selected.from,to:t.selected.to?ut(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=Ei(t.disabled,n)),t.hidden!==void 0&&(t.hidden=Ei(t.hidden,n)),t.modifiers)){const le={};Object.keys(t.modifiers).forEach(ve=>{var ae;le[ve]=Ei((ae=t.modifiers)==null?void 0:ae[ve],n)}),t.modifiers=le}const{components:r,formatters:o,labels:a,dateLib:s,locale:i,classNames:c}=_.useMemo(()=>{const le={...zx,...t.locale},ve=t.broadcastCalendar?1:t.weekStartsOn,ae=t.noonSafe&&t.timeZone?rI(t.timeZone,{weekStartsOn:ve,locale:le}):void 0,ue=t.dateLib&&ae?{...ae,...t.dateLib}:t.dateLib??ae,Be=new lt({locale:le,weekStartsOn:ve,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},ue);return{dateLib:Be,components:IT(t.components),formatters:GT(t.formatters),labels:ZT(t.labels,Be.options),locale:le,classNames:{...zT(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:s.today()});const{captionLayout:l,mode:u,navLayout:f,numberOfMonths:h=1,onDayBlur:p,onDayClick:m,onDayFocus:g,onDayKeyDown:y,onDayMouseEnter:v,onDayMouseLeave:w,onNextClick:x,onPrevClick:j,showWeekNumber:N,styles:S}=t,{formatCaption:C,formatDay:P,formatMonthDropdown:k,formatWeekNumber:T,formatWeekNumberHeader:D,formatWeekdayName:M,formatYearDropdown:L}=o,E=gI(t,s),{days:I,months:R,navStart:z,navEnd:A,previousMonth:O,nextMonth:F,goToMonth:G}=E,Y=AT(I,t,z,A,s),{isSelected:H,select:V,selected:B}=NI(t,s)??{},{blur:q,focused:$,isFocusTarget:W,moveFocus:U,setFocused:K}=vI(t,E,Y,H??(()=>!1),s),{labelDayButton:X,labelGridcell:J,labelGrid:Z,labelMonthDropdown:ee,labelNav:ce,labelPrevious:ne,labelNext:xe,labelWeekday:de,labelWeekNumber:Me,labelWeekNumberHeader:Fe,labelYearDropdown:Oe}=a,Qe=_.useMemo(()=>tI(s,t.ISOWeek,t.broadcastCalendar,t.today),[s,t.ISOWeek,t.broadcastCalendar,t.today]),Le=u!==void 0||m!==void 0,Kt=_.useCallback(()=>{O&&(G(O),j==null||j(O))},[O,G,j]),Mt=_.useCallback(()=>{F&&(G(F),x==null||x(F))},[G,F,x]),Ae=_.useCallback((le,ve)=>ae=>{ae.preventDefault(),ae.stopPropagation(),K(le),!ve.disabled&&(V==null||V(le.date,ve,ae),m==null||m(le.date,ve,ae))},[V,m,K]),Ue=_.useCallback((le,ve)=>ae=>{K(le),g==null||g(le.date,ve,ae)},[g,K]),Kn=_.useCallback((le,ve)=>ae=>{q(),p==null||p(le.date,ve,ae)},[q,p]),Br=_.useCallback((le,ve)=>ae=>{const ue={ArrowLeft:[ae.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[ae.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[ae.shiftKey?"year":"week","after"],ArrowUp:[ae.shiftKey?"year":"week","before"],PageUp:[ae.shiftKey?"year":"month","before"],PageDown:[ae.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(ue[ae.key]){ae.preventDefault(),ae.stopPropagation();const[Be,Q]=ue[ae.key];U(Be,Q)}y==null||y(le.date,ve,ae)},[U,y,t.dir]),Dt=_.useCallback((le,ve)=>ae=>{v==null||v(le.date,ve,ae)},[v]),Hr=_.useCallback((le,ve)=>ae=>{w==null||w(le.date,ve,ae)},[w]),Jn=_.useCallback(le=>ve=>{const ae=Number(ve.target.value),ue=s.setMonth(s.startOfMonth(le),ae);G(ue)},[s,G]),En=_.useCallback(le=>ve=>{const ae=Number(ve.target.value),ue=s.setYear(s.startOfMonth(le),ae);G(ue)},[s,G]),{className:Ot,style:Zn}=_.useMemo(()=>({className:[c[re.Root],t.className].filter(Boolean).join(" "),style:{...S==null?void 0:S[re.Root],...t.style}}),[c,t.className,t.style,S]),Rt=$T(t),Qn=_.useRef(null);iI(Qn,!!t.animate,{classNames:c,months:R,focused:$,dateLib:s});const Vr={dayPickerProps:t,selected:B,select:V,isSelected:H,months:R,nextMonth:F,previousMonth:O,goToMonth:G,getModifiers:Y,components:r,classNames:c,styles:S,labels:a,formatters:o};return _.createElement(Wx.Provider,{value:Vr},_.createElement(r.Root,{rootRef:t.animate?Qn:void 0,className:Ot,style:Zn,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...Rt},_.createElement(r.Months,{className:c[re.Months],style:S==null?void 0:S[re.Months]},!t.hideNavigation&&!f&&_.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[re.Nav],style:S==null?void 0:S[re.Nav],"aria-label":ce(),onPreviousClick:Kt,onNextClick:Mt,previousMonth:O,nextMonth:F}),R.map((le,ve)=>_.createElement(r.Month,{"data-animated-month":t.animate?"true":void 0,className:c[re.Month],style:S==null?void 0:S[re.Month],key:ve,displayIndex:ve,calendarMonth:le},f==="around"&&!t.hideNavigation&&ve===0&&_.createElement(r.PreviousMonthButton,{type:"button",className:c[re.PreviousMonthButton],tabIndex:O?void 0:-1,"aria-disabled":O?void 0:!0,"aria-label":ne(O),onClick:Kt,"data-animated-button":t.animate?"true":void 0},_.createElement(r.Chevron,{disabled:O?void 0:!0,className:c[re.Chevron],orientation:t.dir==="rtl"?"right":"left"})),_.createElement(r.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:c[re.MonthCaption],style:S==null?void 0:S[re.MonthCaption],calendarMonth:le,displayIndex:ve},l!=null&&l.startsWith("dropdown")?_.createElement(r.DropdownNav,{className:c[re.Dropdowns],style:S==null?void 0:S[re.Dropdowns]},(()=>{const ae=l==="dropdown"||l==="dropdown-months"?_.createElement(r.MonthsDropdown,{key:"month",className:c[re.MonthsDropdown],"aria-label":ee(),classNames:c,components:r,disabled:!!t.disableNavigation,onChange:Jn(le.date),options:QT(le.date,z,A,o,s),style:S==null?void 0:S[re.Dropdown],value:s.getMonth(le.date)}):_.createElement("span",{key:"month"},k(le.date,s)),ue=l==="dropdown"||l==="dropdown-years"?_.createElement(r.YearsDropdown,{key:"year",className:c[re.YearsDropdown],"aria-label":Oe(s.options),classNames:c,components:r,disabled:!!t.disableNavigation,onChange:En(le.date),options:nI(z,A,o,s,!!t.reverseYears),style:S==null?void 0:S[re.Dropdown],value:s.getYear(le.date)}):_.createElement("span",{key:"year"},L(le.date,s));return s.getMonthYearOrder()==="year-first"?[ue,ae]:[ae,ue]})(),_.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},C(le.date,s.options,s))):_.createElement(r.CaptionLabel,{className:c[re.CaptionLabel],role:"status","aria-live":"polite"},C(le.date,s.options,s))),f==="around"&&!t.hideNavigation&&ve===h-1&&_.createElement(r.NextMonthButton,{type:"button",className:c[re.NextMonthButton],tabIndex:F?void 0:-1,"aria-disabled":F?void 0:!0,"aria-label":xe(F),onClick:Mt,"data-animated-button":t.animate?"true":void 0},_.createElement(r.Chevron,{disabled:F?void 0:!0,className:c[re.Chevron],orientation:t.dir==="rtl"?"left":"right"})),ve===h-1&&f==="after"&&!t.hideNavigation&&_.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[re.Nav],style:S==null?void 0:S[re.Nav],"aria-label":ce(),onPreviousClick:Kt,onNextClick:Mt,previousMonth:O,nextMonth:F}),_.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":Z(le.date,s.options,s)||void 0,className:c[re.MonthGrid],style:S==null?void 0:S[re.MonthGrid]},!t.hideWeekdays&&_.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:c[re.Weekdays],style:S==null?void 0:S[re.Weekdays]},N&&_.createElement(r.WeekNumberHeader,{"aria-label":Fe(s.options),className:c[re.WeekNumberHeader],style:S==null?void 0:S[re.WeekNumberHeader],scope:"col"},D()),Qe.map(ae=>_.createElement(r.Weekday,{"aria-label":de(ae,s.options,s),className:c[re.Weekday],key:String(ae),style:S==null?void 0:S[re.Weekday],scope:"col"},M(ae,s.options,s)))),_.createElement(r.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:c[re.Weeks],style:S==null?void 0:S[re.Weeks]},le.weeks.map(ae=>_.createElement(r.Week,{className:c[re.Week],key:ae.weekNumber,style:S==null?void 0:S[re.Week],week:ae},N&&_.createElement(r.WeekNumber,{week:ae,style:S==null?void 0:S[re.WeekNumber],"aria-label":Me(ae.weekNumber,{locale:i}),className:c[re.WeekNumber],scope:"row",role:"rowheader"},T(ae.weekNumber,s)),ae.days.map(ue=>{const{date:Be}=ue,Q=Y(ue);if(Q[De.focused]=!Q.hidden&&!!($!=null&&$.isEqualTo(ue)),Q[wt.selected]=(H==null?void 0:H(Be))||Q.selected,Vs(B)){const{from:He,to:Xe}=B;Q[wt.range_start]=!!(He&&Xe&&s.isSameDay(Be,He)),Q[wt.range_end]=!!(He&&Xe&&s.isSameDay(Be,Xe)),Q[wt.range_middle]=on(B,Be,!0,s)}const be=eI(Q,S,t.modifiersStyles),Se=TT(Q,c,t.modifiersClassNames),qe=!Le&&!Q.hidden?J(Be,Q,s.options,s):void 0;return _.createElement(r.Day,{key:`${ue.isoDate}_${ue.displayMonthId}`,day:ue,modifiers:Q,className:Se.join(" "),style:be,role:"gridcell","aria-selected":Q.selected||void 0,"aria-label":qe,"data-day":ue.isoDate,"data-month":ue.outside?ue.dateMonthId:void 0,"data-selected":Q.selected||void 0,"data-disabled":Q.disabled||void 0,"data-hidden":Q.hidden||void 0,"data-outside":ue.outside||void 0,"data-focused":Q.focused||void 0,"data-today":Q.today||void 0},!Q.hidden&&Le?_.createElement(r.DayButton,{className:c[re.DayButton],style:S==null?void 0:S[re.DayButton],type:"button",day:ue,modifiers:Q,disabled:!Q.focused&&Q.disabled||void 0,"aria-disabled":Q.focused&&Q.disabled||void 0,tabIndex:W(ue)?0:-1,"aria-label":X(Be,Q,s.options,s),onClick:Ae(ue,Q),onBlur:Kn(ue,Q),onFocus:Ue(ue,Q),onKeyDown:Br(ue,Q),onMouseEnter:Dt(ue,Q),onMouseLeave:Hr(ue,Q)},P(Be,s.options,s)):!Q.hidden&&P(ue.date,s.options,s))})))))))),t.footer&&_.createElement(r.Footer,{className:c[re.Footer],style:S==null?void 0:S[re.Footer],role:"status","aria-live":"polite"},t.footer)))}function tv({className:e,classNames:t,showOutsideDays:n=!0,...r}){return d.jsx(EI,{showOutsideDays:n,className:ie("cj-p-3",e),classNames:{months:"cj-flex cj-flex-col sm:cj-flex-row cj-space-y-4 sm:cj-space-x-4 sm:cj-space-y-0",month:"cj-space-y-4",month_caption:"cj-flex cj-justify-center cj-pt-1 cj-relative cj-items-center",caption_label:"cj-text-sm cj-font-medium",nav:"cj-space-x-1 cj-flex cj-items-center",button_previous:ie(Sa({variant:"outline"}),"cj-h-7 cj-w-7 cj-bg-transparent cj-p-0 cj-opacity-50 hover:cj-opacity-100 cj-absolute cj-left-1"),button_next:ie(Sa({variant:"outline"}),"cj-h-7 cj-w-7 cj-bg-transparent cj-p-0 cj-opacity-50 hover:cj-opacity-100 cj-absolute cj-right-1"),month_grid:"cj-w-full cj-border-collapse cj-space-y-1",weekdays:"cj-flex",weekday:"cj-text-muted-foreground cj-rounded-md cj-w-9 cj-font-normal cj-text-[0.8rem]",week:"cj-flex cj-w-full cj-mt-2",day:"cj-h-9 cj-w-9 cj-text-center cj-text-sm cj-p-0 cj-relative [&:has([aria-selected].day-range-end)]:cj-rounded-r-md [&:has([aria-selected].day-outside)]:cj-bg-accent/50 [&:has([aria-selected])]:cj-bg-accent first:[&:has([aria-selected])]:cj-rounded-l-md last:[&:has([aria-selected])]:cj-rounded-r-md focus-within:cj-relative focus-within:cj-z-20",day_button:ie(Sa({variant:"ghost"}),"cj-h-9 cj-w-9 cj-p-0 cj-font-normal aria-selected:cj-opacity-100"),range_end:"day-range-end",selected:"cj-bg-primary cj-text-primary-foreground hover:cj-bg-primary hover:cj-text-primary-foreground focus:cj-bg-primary focus:cj-text-primary-foreground",today:"cj-bg-accent cj-text-accent-foreground",outside:"day-outside cj-text-muted-foreground cj-opacity-50 aria-selected:cj-bg-accent/50 aria-selected:cj-text-muted-foreground aria-selected:cj-opacity-30",disabled:"cj-text-muted-foreground cj-opacity-50",range_middle:"aria-selected:cj-bg-accent aria-selected:cj-text-accent-foreground",hidden:"cj-invisible",...t},components:{Chevron:({orientation:o,...a})=>o==="left"?d.jsx(zN,{className:"cj-h-4 cj-w-4"}):d.jsx(Ap,{className:"cj-h-4 cj-w-4"})},...r})}tv.displayName="Calendar";function kI({label:e,value:t,onChange:n,helpText:r}){const[o,a]=_.useState(!1),s=t?new Date(t):void 0,i=c=>{c&&(n(c.toISOString()),a(!1))};return d.jsxs("div",{className:"cj-space-y-2",children:[d.jsx(we,{className:"cj-text-sm cj-font-medium",children:e}),d.jsxs(xl,{open:o,onOpenChange:a,children:[d.jsx(vl,{asChild:!0,children:d.jsxs(fe,{variant:"outline",className:ie("cj-w-full cj-justify-start cj-text-left cj-font-normal",!s&&"cj-text-muted-foreground"),children:[d.jsx($N,{className:"cj-mr-2 cj-h-4 cj-w-4"}),s?OR(s,"PPP"):d.jsx("span",{children:"Pick a date"})]})}),d.jsx(Os,{className:"cj-w-auto cj-p-0 cj-z-50",align:"start",children:d.jsx(tv,{mode:"single",selected:s,onSelect:i,autoFocus:!0,className:ie("cj-p-3 cj-pointer-events-auto")})})]}),r&&d.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:r})]})}function PI({label:e,value:t,onChange:n,helpText:r,currency:o="EUR"}){const[a,s]=_.useState("");_.useEffect(()=>{if(t){const h=parseFloat(t);isNaN(h)||s(i(h))}else s("")},[t]);const i=h=>new Intl.NumberFormat("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2}).format(h),c=h=>{const p=h.replace(/\./g,"").replace(",",".");return parseFloat(p)||0},l=h=>{const m=h.target.value.replace(/[^\d.,]/g,"");s(m)},u=()=>{if(a){const h=c(a);n(h.toString()),s(i(h))}else n("")},f=h=>({EUR:"€",USD:"$",GBP:"£"})[h]||h;return d.jsxs("div",{className:"cj-space-y-2",children:[d.jsx(we,{className:"cj-text-sm cj-font-medium",children:e}),d.jsxs("div",{className:"cj-relative",children:[d.jsx("span",{className:"cj-absolute cj-left-3 cj-top-1/2 -cj-translate-y-1/2 cj-text-muted-foreground",children:f(o)}),d.jsx(ze,{type:"text",value:a,onChange:l,onBlur:u,placeholder:"0,00",className:"cj-pl-8"})]}),r&&d.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:r})]})}function ya(e){return typeof e=="object"&&e!==null&&"filename"in e&&"url"in e}function MI({label:e,value:t,onChange:n,onFileSelect:r,helpText:o,accept:a,maxSizeMB:s}){const{t:i}=dt(),c=_.useRef(null),[l,u]=_.useState(!1),[f,h]=_.useState(null),p=k=>{if(s&&k.size>s*1024*1024)return`File exceeds ${s} MB limit (${(k.size/1024/1024).toFixed(1)} MB)`;if(a){const T=a.split(",").map(E=>E.trim().toLowerCase()),D=k.name.toLowerCase(),M=k.type.toLowerCase();if(!T.some(E=>E.startsWith(".")?D.endsWith(E):E.endsWith("/*")?M.startsWith(E.replace("/*","/")):M===E))return`File type not accepted. Allowed: ${a}`}return null},m=async k=>{h(null);const T=p(k);if(T){h(T);return}if(!r){n(k.name);return}u(!0);try{const D=await r(k);ya(D)?n(D):n(typeof D=="string"?D:k.name)}catch(D){h(D instanceof Error?D.message:"Upload failed"),n("")}finally{u(!1)}},g=k=>{if(k.preventDefault(),l)return;const T=k.dataTransfer.files;T.length>0&&m(T[0])},y=k=>{k.preventDefault()},v=()=>{var k;l||(k=c.current)==null||k.click()},w=k=>{const T=k.target.files;T&&T.length>0&&m(T[0]),k.target.value=""},x=k=>{k.stopPropagation(),n(""),h(null)},j=ya(t)?!!t.url:!!t,N=ya(t)?t.filename:t,S=ya(t)?t.url:null,C=[];a&&C.push(`Accepted: ${a}`),s&&C.push(`Max ${s} MB`);const P=C.length>0?C.join(" · "):null;return d.jsxs("div",{className:"cj-space-y-2",children:[d.jsx(we,{className:"cj-text-sm cj-font-medium",children:e}),d.jsx("input",{ref:c,type:"file",className:"cj-hidden",accept:a,onChange:w}),d.jsx("div",{onDrop:g,onDragOver:y,onClick:v,className:`cj-border-2 cj-border-dashed cj-rounded-lg cj-p-8 cj-text-center cj-transition-colors ${l?"cj-border-muted-foreground/25 cj-cursor-wait cj-opacity-60":f?"cj-border-destructive/50 cj-cursor-pointer hover:cj-border-destructive/75":"cj-border-muted-foreground/25 cj-cursor-pointer hover:cj-border-muted-foreground/50"}`,children:l?d.jsxs(d.Fragment,{children:[d.jsx(qN,{className:"cj-h-8 cj-w-8 cj-mx-auto cj-text-muted-foreground cj-mb-2 cj-animate-spin"}),d.jsx("p",{className:"cj-text-sm cj-text-muted-foreground",children:i("upload_uploading")})]}):j?d.jsxs(d.Fragment,{children:[d.jsx(BN,{className:"cj-h-8 cj-w-8 cj-mx-auto cj-text-muted-foreground cj-mb-2"}),d.jsxs("div",{className:"cj-flex cj-items-center cj-justify-center cj-gap-2",children:[S?d.jsx("a",{href:S,target:"_blank",rel:"noopener noreferrer",onClick:k=>k.stopPropagation(),className:"cj-text-sm cj-font-medium cj-text-primary cj-underline cj-truncate cj-max-w-[240px]",title:N,children:N}):d.jsx("p",{className:"cj-text-sm cj-font-medium cj-truncate cj-max-w-[240px]",children:N}),d.jsx("button",{type:"button",onClick:x,className:"cj-text-muted-foreground hover:cj-text-foreground",children:d.jsx(kr,{className:"cj-h-4 cj-w-4"})})]})]}):d.jsxs(d.Fragment,{children:[d.jsx(Hp,{className:"cj-h-8 cj-w-8 cj-mx-auto cj-text-muted-foreground cj-mb-2"}),d.jsx("p",{className:"cj-text-sm cj-text-muted-foreground",children:i("upload_drag_drop")})]})}),f&&d.jsxs("p",{className:"cj-text-xs cj-text-destructive cj-flex cj-items-center cj-gap-1",children:[d.jsx(Ip,{className:"cj-h-3 cj-w-3"})," ",f]}),(o||P)&&d.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o||P})]})}const ki=[{code:"US",name:"United States",dial:"+1",flag:"🇺🇸"},{code:"GB",name:"United Kingdom",dial:"+44",flag:"🇬🇧"},{code:"CA",name:"Canada",dial:"+1",flag:"🇨🇦"},{code:"AU",name:"Australia",dial:"+61",flag:"🇦🇺"},{code:"DE",name:"Germany",dial:"+49",flag:"🇩🇪"},{code:"FR",name:"France",dial:"+33",flag:"🇫🇷"},{code:"IT",name:"Italy",dial:"+39",flag:"🇮🇹"},{code:"ES",name:"Spain",dial:"+34",flag:"🇪🇸"},{code:"PT",name:"Portugal",dial:"+351",flag:"🇵🇹"},{code:"NL",name:"Netherlands",dial:"+31",flag:"🇳🇱"},{code:"BE",name:"Belgium",dial:"+32",flag:"🇧🇪"},{code:"CH",name:"Switzerland",dial:"+41",flag:"🇨🇭"},{code:"AT",name:"Austria",dial:"+43",flag:"🇦🇹"},{code:"SE",name:"Sweden",dial:"+46",flag:"🇸🇪"},{code:"NO",name:"Norway",dial:"+47",flag:"🇳🇴"},{code:"DK",name:"Denmark",dial:"+45",flag:"🇩🇰"},{code:"FI",name:"Finland",dial:"+358",flag:"🇫🇮"},{code:"IE",name:"Ireland",dial:"+353",flag:"🇮🇪"},{code:"PL",name:"Poland",dial:"+48",flag:"🇵🇱"},{code:"CZ",name:"Czech Republic",dial:"+420",flag:"🇨🇿"},{code:"RO",name:"Romania",dial:"+40",flag:"🇷🇴"},{code:"HU",name:"Hungary",dial:"+36",flag:"🇭🇺"},{code:"GR",name:"Greece",dial:"+30",flag:"🇬🇷"},{code:"TR",name:"Turkey",dial:"+90",flag:"🇹🇷"},{code:"RU",name:"Russia",dial:"+7",flag:"🇷🇺"},{code:"JP",name:"Japan",dial:"+81",flag:"🇯🇵"},{code:"KR",name:"South Korea",dial:"+82",flag:"🇰🇷"},{code:"CN",name:"China",dial:"+86",flag:"🇨🇳"},{code:"IN",name:"India",dial:"+91",flag:"🇮🇳"},{code:"PK",name:"Pakistan",dial:"+92",flag:"🇵🇰"},{code:"BD",name:"Bangladesh",dial:"+880",flag:"🇧🇩"},{code:"ID",name:"Indonesia",dial:"+62",flag:"🇮🇩"},{code:"MY",name:"Malaysia",dial:"+60",flag:"🇲🇾"},{code:"SG",name:"Singapore",dial:"+65",flag:"🇸🇬"},{code:"PH",name:"Philippines",dial:"+63",flag:"🇵🇭"},{code:"TH",name:"Thailand",dial:"+66",flag:"🇹🇭"},{code:"VN",name:"Vietnam",dial:"+84",flag:"🇻🇳"},{code:"AE",name:"UAE",dial:"+971",flag:"🇦🇪"},{code:"SA",name:"Saudi Arabia",dial:"+966",flag:"🇸🇦"},{code:"IL",name:"Israel",dial:"+972",flag:"🇮🇱"},{code:"EG",name:"Egypt",dial:"+20",flag:"🇪🇬"},{code:"ZA",name:"South Africa",dial:"+27",flag:"🇿🇦"},{code:"NG",name:"Nigeria",dial:"+234",flag:"🇳🇬"},{code:"KE",name:"Kenya",dial:"+254",flag:"🇰🇪"},{code:"BR",name:"Brazil",dial:"+55",flag:"🇧🇷"},{code:"MX",name:"Mexico",dial:"+52",flag:"🇲🇽"},{code:"AR",name:"Argentina",dial:"+54",flag:"🇦🇷"},{code:"CO",name:"Colombia",dial:"+57",flag:"🇨🇴"},{code:"CL",name:"Chile",dial:"+56",flag:"🇨🇱"},{code:"PE",name:"Peru",dial:"+51",flag:"🇵🇪"},{code:"NZ",name:"New Zealand",dial:"+64",flag:"🇳🇿"}];function DI({label:e,value:t,onChange:n,placeholder:r="555 000 0000",helpText:o,onValidationChange:a}){const[s,i]=_.useState(null),[c,l]=_.useState(ki[0]),[u,f]=_.useState(""),[h,p]=_.useState(!1),m=_.useMemo(()=>t?t.startsWith(c.dial)?t.slice(c.dial.length).trimStart():t.replace(/^\+\d+\s*/,""):"",[t,c.dial]),g=_.useMemo(()=>{if(!u)return ki;const x=u.toLowerCase();return ki.filter(j=>j.name.toLowerCase().includes(x)||j.code.toLowerCase().includes(x)||j.dial.includes(x))},[u]),y=x=>{const j=!!x&&!/^[\d\s\-()]{4,20}$/.test(x);i(j?"Enter a valid phone number":null),a==null||a(j)};_.useEffect(()=>{y(m)},[]);const v=x=>{const j=x.replace(/[^\d\s\-()]/g,""),N=j?`${c.dial} ${j}`:"";n(N),y(j)},w=x=>{l(x),p(!1),f(""),m&&n(`${x.dial} ${m}`)};return d.jsxs("div",{className:"cj-space-y-2",children:[d.jsx(we,{className:"cj-text-sm cj-font-medium",children:e}),d.jsxs("div",{className:"cj-flex cj-gap-1.5",children:[d.jsxs(xl,{open:h,onOpenChange:p,children:[d.jsx(vl,{asChild:!0,children:d.jsxs(fe,{variant:"outline",role:"combobox","aria-expanded":h,className:"cj-w-[100px] cj-justify-between cj-px-2 cj-shrink-0",children:[d.jsx("span",{className:"cj-text-base cj-leading-none",children:c.flag}),d.jsx("span",{className:"cj-text-xs cj-text-muted-foreground",children:c.dial}),d.jsx(Tr,{className:"cj-h-3 cj-w-3 cj-opacity-50"})]})}),d.jsxs(Os,{className:"cj-w-[260px] cj-p-0",align:"start",children:[d.jsxs("div",{className:"cj-flex cj-items-center cj-border-b cj-px-3 cj-py-2",children:[d.jsx(Fp,{className:"cj-h-4 cj-w-4 cj-shrink-0 cj-text-muted-foreground cj-mr-2"}),d.jsx("input",{placeholder:"Search country...",value:u,onChange:x=>f(x.target.value),className:"cj-flex-1 cj-bg-transparent cj-text-sm cj-outline-none placeholder:cj-text-muted-foreground"})]}),d.jsx(Lr,{className:"cj-h-[200px]",children:d.jsxs("div",{className:"cj-p-1",children:[g.map(x=>d.jsxs("button",{onClick:()=>w(x),className:`cj-flex cj-w-full cj-items-center cj-gap-2 cj-rounded-sm cj-px-2 cj-py-1.5 cj-text-sm hover:cj-bg-accent hover:cj-text-accent-foreground cj-cursor-pointer cj-transition-colors ${c.code===x.code?"cj-bg-accent":""}`,children:[d.jsx("span",{className:"cj-text-base",children:x.flag}),d.jsx("span",{className:"cj-flex-1 cj-text-left cj-truncate",children:x.name}),d.jsx("span",{className:"cj-text-xs cj-text-muted-foreground",children:x.dial})]},x.code)),g.length===0&&d.jsx("p",{className:"cj-py-4 cj-text-center cj-text-sm cj-text-muted-foreground",children:"No country found."})]})})]})]}),d.jsx(ze,{type:"tel",value:m,onChange:x=>v(x.target.value),placeholder:r,className:"cj-flex-1"})]}),s&&d.jsx("p",{className:"cj-text-xs cj-text-destructive",children:s}),!s&&o&&d.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o})]})}function OI({label:e,value:t,onChange:n,placeholder:r="name@example.com",helpText:o,onValidationChange:a}){const[s,i]=_.useState(null),c=u=>{const f=!!u&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(u);i(f?"Enter a valid email address":null),a==null||a(f)};_.useEffect(()=>{c(t)},[]);const l=u=>{const f=u.trim();n(f),c(f)};return d.jsxs("div",{className:"cj-space-y-2",children:[d.jsx(we,{className:"cj-text-sm cj-font-medium",children:e}),d.jsxs("div",{className:"cj-relative",children:[d.jsx(XN,{className:"cj-absolute cj-left-3 cj-top-1/2 -cj-translate-y-1/2 cj-h-4 cj-w-4 cj-text-muted-foreground"}),d.jsx(ze,{type:"email",value:t,onChange:u=>l(u.target.value),placeholder:r,className:"cj-pl-9"})]}),s&&d.jsx("p",{className:"cj-text-xs cj-text-destructive",children:s}),!s&&o&&d.jsx("p",{className:"cj-text-xs cj-text-muted-foreground",children:o})]})}const RI={text:"v1_string",textarea:"v1_string",select:"v2_single_option_select-1",radio:"v2_single_option_select-1",datepicker:"v2_date-1",currency:"v2_currency-1",upload:"v2_single_asset_upload",email:"v2_email-1",phone:"v2_phone-1"};function nv({nodeData:e,value:t,onChange:n,onValidationChange:r,onFileSelect:o}){var h,p;const{t:a}=dt(),{schema:s,label:i,options:c}=e,l=e.required?`${e.labelOverride||i} *`:e.labelOverride||i,u=t!=null?String(t):"";switch(e.widget&&RI[e.widget]||s){case"v1_string":return d.jsx(gO,{label:l,value:u,onChange:n});case"v2_single_option_select-1":return!c||c.length===0?d.jsx("div",{className:"cj-text-sm cj-text-muted-foreground",children:a("widget_no_options")}):d.jsx(EO,{label:l,value:u,onChange:n,options:c});case"v2_date-1":return d.jsx(kI,{label:l,value:u,onChange:n});case"v2_currency-1":return d.jsx(PI,{label:l,value:u,onChange:n});case"v2_single_asset_upload":return d.jsx(MI,{label:l,value:typeof t=="object"&&t!==null&&"filename"in t?t:u,onChange:n,onFileSelect:o,accept:(h=e.uploadConfig)==null?void 0:h.accept,maxSizeMB:(p=e.uploadConfig)==null?void 0:p.maxSizeMB});case"v2_phone-1":return d.jsx(DI,{label:l,value:u,onChange:n,onValidationChange:r});case"v2_email-1":return d.jsx(OI,{label:l,value:u,onChange:n,onValidationChange:r});default:return d.jsxs("div",{className:"cj-p-4 cj-border cj-border-dashed cj-rounded-lg cj-text-center cj-text-muted-foreground",children:[d.jsx("p",{className:"cj-text-sm",children:a("widget_unknown_schema",{schema:s})}),d.jsx("p",{className:"cj-text-xs cj-mt-1",children:a("widget_no_widget")})]})}}function AI(){const[e,t]=_.useState(!0),[n,r]=_.useState(!1),{t:o}=dt(),a=_.useCallback(P=>{r(P)},[]),{nodes:s,edges:i,previewCurrentNodeId:c,previewAnswers:l,previewPath:u,isPreviewActive:f,setPreviewAnswer:h,startPreview:p,resetPreview:m,navigatePreview:g}=$e(),y=s.find(P=>P.id===c),v=u.indexOf(c||""),w=y?i.some(P=>P.source===y.id):!1,x=P=>{y&&h(y.data.namespace,P)},j=()=>{g("next")},N=()=>{g("back")},S=y?l[y.data.namespace]:void 0,C=(y==null?void 0:y.data.required)&&(S==null||S==="");return d.jsxs(_l,{open:e,onOpenChange:t,className:"cj-border-t cj-bg-background",children:[d.jsx(Sl,{asChild:!0,children:d.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-px-4 cj-py-2 cj-cursor-pointer hover:cj-bg-muted/50 cj-transition-colors",children:[d.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[d.jsx("h3",{className:"cj-text-sm cj-font-medium",children:o("preview_title")}),f&&d.jsx(ct,{variant:"secondary",className:"cj-text-xs",children:o("preview_step_of",{current:v+1,total:u.length})})]}),d.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[!f&&s.length>0&&d.jsxs(fe,{size:"sm",variant:"outline",onClick:P=>{P.stopPropagation(),p()},className:"cj-h-7 cj-text-xs",children:[d.jsx(Fa,{className:"cj-h-3 cj-w-3 cj-mr-1"}),o("preview_start")]}),f&&d.jsxs(fe,{size:"sm",variant:"ghost",onClick:P=>{P.stopPropagation(),m()},className:"cj-h-7 cj-text-xs",children:[d.jsx(Lp,{className:"cj-h-3 cj-w-3 cj-mr-1"}),o("reset")]}),e?d.jsx(Tr,{className:"cj-h-4 cj-w-4 cj-text-muted-foreground"}):d.jsx(Tp,{className:"cj-h-4 cj-w-4 cj-text-muted-foreground"})]})]})}),d.jsx(Cl,{children:d.jsx("div",{className:"cj-px-4 cj-pb-4 cj-pt-2",children:f?y?d.jsxs("div",{className:"cj-max-w-md cj-mx-auto cj-space-y-4",children:[d.jsx("div",{className:"cj-bg-muted/30 cj-rounded-lg cj-p-4",children:d.jsx(nv,{nodeData:y.data,value:S,onChange:x,onValidationChange:a})}),d.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between",children:[d.jsxs(fe,{variant:"outline",size:"sm",onClick:N,disabled:u.length<=1,children:[d.jsx(ec,{className:"cj-h-4 cj-w-4 cj-mr-1"}),o("back")]}),d.jsx("div",{className:"cj-text-xs cj-text-muted-foreground",children:y.data.namespace}),d.jsxs(fe,{size:"sm",onClick:j,disabled:!w||!!C||n,title:C?o("preview_required_hint"):n?o("preview_validation_hint"):void 0,children:[o("next"),d.jsx(Dp,{className:"cj-h-4 cj-w-4 cj-ml-1"})]})]}),u.length>1&&d.jsxs("div",{className:"cj-flex cj-items-center cj-gap-1 cj-flex-wrap cj-text-xs cj-text-muted-foreground",children:[d.jsxs("span",{children:[o("path"),":"]}),u.map((P,k)=>{const T=s.find(D=>D.id===P);return d.jsxs("span",{className:"cj-flex cj-items-center",children:[k>0&&d.jsx("span",{className:"cj-mx-1",children:"→"}),d.jsx("span",{className:P===c?"cj-text-foreground cj-font-medium":"",children:(T==null?void 0:T.data.label)||P})]},P)})]})]}):d.jsx("div",{className:"cj-text-center cj-py-4 cj-text-sm cj-text-muted-foreground",children:o("preview_no_node")}):d.jsx("div",{className:"cj-flex cj-flex-col cj-items-center cj-justify-center cj-py-8 cj-text-center",children:s.length===0?d.jsx("p",{className:"cj-text-sm cj-text-muted-foreground",children:o("preview_add_nodes_hint")}):d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"cj-text-sm cj-text-muted-foreground cj-mb-3",children:o("preview_start_hint")}),d.jsxs(fe,{size:"sm",onClick:p,children:[d.jsx(Fa,{className:"cj-h-4 cj-w-4 cj-mr-2"}),o("preview_start")]})]})})})})]})}const qs=_.createContext(null);qs.displayName="PanelGroupContext";const Re={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Hl=10,zn=_.useLayoutEffect,vf=b.useId,TI=typeof vf=="function"?vf:()=>null;let II=0;function Vl(e=null){const t=TI(),n=_.useRef(e||t||null);return n.current===null&&(n.current=""+II++),e??n.current}function rv({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:a,id:s,maxSize:i,minSize:c,onCollapse:l,onExpand:u,onResize:f,order:h,style:p,tagName:m="div",...g}){const y=_.useContext(qs);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:v,expandPanel:w,getPanelSize:x,getPanelStyle:j,groupId:N,isPanelCollapsed:S,reevaluatePanelConstraints:C,registerPanel:P,resizePanel:k,unregisterPanel:T}=y,D=Vl(s),M=_.useRef({callbacks:{onCollapse:l,onExpand:u,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:i,minSize:c},id:D,idIsFromProps:s!==void 0,order:h});_.useRef({didLogMissingDefaultSizeWarning:!1}),zn(()=>{const{callbacks:E,constraints:I}=M.current,R={...I};M.current.id=D,M.current.idIsFromProps=s!==void 0,M.current.order=h,E.onCollapse=l,E.onExpand=u,E.onResize=f,I.collapsedSize=n,I.collapsible=r,I.defaultSize=o,I.maxSize=i,I.minSize=c,(R.collapsedSize!==I.collapsedSize||R.collapsible!==I.collapsible||R.maxSize!==I.maxSize||R.minSize!==I.minSize)&&C(M.current,R)}),zn(()=>{const E=M.current;return P(E),()=>{T(E)}},[h,D,P,T]),_.useImperativeHandle(a,()=>({collapse:()=>{v(M.current)},expand:E=>{w(M.current,E)},getId(){return D},getSize(){return x(M.current)},isCollapsed(){return S(M.current)},isExpanded(){return!S(M.current)},resize:E=>{k(M.current,E)}}),[v,w,x,S,D,k]);const L=j(M.current,o);return _.createElement(m,{...g,children:e,className:t,id:D,style:{...L,...p},[Re.groupId]:N,[Re.panel]:"",[Re.panelCollapsible]:r||void 0,[Re.panelId]:D,[Re.panelSize]:parseFloat(""+L.flexGrow).toFixed(1)})}const ov=_.forwardRef((e,t)=>_.createElement(rv,{...e,forwardedRef:t}));rv.displayName="Panel";ov.displayName="forwardRef(Panel)";let vc=null,ka=-1,vn=null;function $I(e,t){if(t){const n=(t&lv)!==0,r=(t&dv)!==0,o=(t&uv)!==0,a=(t&fv)!==0;if(n)return o?"se-resize":a?"ne-resize":"e-resize";if(r)return o?"sw-resize":a?"nw-resize":"w-resize";if(o)return"s-resize";if(a)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function zI(){vn!==null&&(document.head.removeChild(vn),vc=null,vn=null,ka=-1)}function Pi(e,t){var n,r;const o=$I(e,t);if(vc!==o){if(vc=o,vn===null&&(vn=document.createElement("style"),document.head.appendChild(vn)),ka>=0){var a;(a=vn.sheet)===null||a===void 0||a.removeRule(ka)}ka=(n=(r=vn.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${o} !important;}`))!==null&&n!==void 0?n:-1}}function av(e){return e.type==="keydown"}function sv(e){return e.type.startsWith("pointer")}function iv(e){return e.type.startsWith("mouse")}function Gs(e){if(sv(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(iv(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function LI(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function WI(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function FI(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:jf(e),b:jf(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;pe(r,"Stacking order can only be calculated for elements with a common ancestor");const o={a:wf(bf(n.a)),b:wf(bf(n.b))};if(o.a===o.b){const a=r.childNodes,s={a:n.a.at(-1),b:n.b.at(-1)};let i=a.length;for(;i--;){const c=a[i];if(c===s.a)return 1;if(c===s.b)return-1}}return Math.sign(o.a-o.b)}const BI=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function HI(e){var t;const n=getComputedStyle((t=cv(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function VI(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||HI(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||BI.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function bf(e){let t=e.length;for(;t--;){const n=e[t];if(pe(n,"Missing node"),VI(n))return n}return null}function wf(e){return e&&Number(getComputedStyle(e).zIndex)||0}function jf(e){const t=[];for(;e;)t.push(e),e=cv(e);return t}function cv(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const lv=1,dv=2,uv=4,fv=8,YI=LI()==="coarse";let _t=[],xr=!1,Rn=new Map,Us=new Map;const Oo=new Set;function qI(e,t,n,r,o){var a;const{ownerDocument:s}=t,i={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:o},c=(a=Rn.get(s))!==null&&a!==void 0?a:0;return Rn.set(s,c+1),Oo.add(i),Za(),function(){var u;Us.delete(e),Oo.delete(i);const f=(u=Rn.get(s))!==null&&u!==void 0?u:1;if(Rn.set(s,f-1),Za(),f===1&&Rn.delete(s),_t.includes(i)){const h=_t.indexOf(i);h>=0&&_t.splice(h,1),ql(),o("up",!0,null)}}}function GI(e){const{target:t}=e,{x:n,y:r}=Gs(e);xr=!0,Yl({target:t,x:n,y:r}),Za(),_t.length>0&&(Qa("down",e),e.preventDefault(),hv(t)||e.stopImmediatePropagation())}function Mi(e){const{x:t,y:n}=Gs(e);if(xr&&e.buttons===0&&(xr=!1,Qa("up",e)),!xr){const{target:r}=e;Yl({target:r,x:t,y:n})}Qa("move",e),ql(),_t.length>0&&e.preventDefault()}function Di(e){const{target:t}=e,{x:n,y:r}=Gs(e);Us.clear(),xr=!1,_t.length>0&&(e.preventDefault(),hv(t)||e.stopImmediatePropagation()),Qa("up",e),Yl({target:t,x:n,y:r}),ql(),Za()}function hv(e){let t=e;for(;t;){if(t.hasAttribute(Re.resizeHandle))return!0;t=t.parentElement}return!1}function Yl({target:e,x:t,y:n}){_t.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),Oo.forEach(o=>{const{element:a,hitAreaMargins:s}=o,i=a.getBoundingClientRect(),{bottom:c,left:l,right:u,top:f}=i,h=YI?s.coarse:s.fine;if(t>=l-h&&t<=u+h&&n>=f-h&&n<=c+h){if(r!==null&&document.contains(r)&&a!==r&&!a.contains(r)&&!r.contains(a)&&FI(r,a)>0){let m=r,g=!1;for(;m&&!m.contains(a);){if(WI(m.getBoundingClientRect(),i)){g=!0;break}m=m.parentElement}if(g)return}_t.push(o)}})}function Oi(e,t){Us.set(e,t)}function ql(){let e=!1,t=!1;_t.forEach(r=>{const{direction:o}=r;o==="horizontal"?e=!0:t=!0});let n=0;Us.forEach(r=>{n|=r}),e&&t?Pi("intersection",n):e?Pi("horizontal",n):t?Pi("vertical",n):zI()}let Ri=new AbortController;function Za(){Ri.abort(),Ri=new AbortController;const e={capture:!0,signal:Ri.signal};Oo.size&&(xr?(_t.length>0&&Rn.forEach((t,n)=>{const{body:r}=n;t>0&&(r.addEventListener("contextmenu",Di,e),r.addEventListener("pointerleave",Mi,e),r.addEventListener("pointermove",Mi,e))}),window.addEventListener("pointerup",Di,e),window.addEventListener("pointercancel",Di,e)):Rn.forEach((t,n)=>{const{body:r}=n;t>0&&(r.addEventListener("pointerdown",GI,e),r.addEventListener("pointermove",Mi,e))}))}function Qa(e,t){Oo.forEach(n=>{const{setResizeHandlerState:r}=n,o=_t.includes(n);r(e,o,t)})}function UI(){const[e,t]=_.useState(0);return _.useCallback(()=>t(n=>n+1),[])}function pe(e,t){if(!e)throw console.error(t),Error(t)}function Un(e,t,n=Hl){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function en(e,t,n=Hl){return Un(e,t,n)===0}function nt(e,t,n){return Un(e,t,n)===0}function XI(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const o=e[r],a=t[r];if(!nt(o,a,n))return!1}return!0}function fr({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];pe(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:o=0,collapsible:a,maxSize:s=100,minSize:i=0}=r;if(Un(n,i)<0)if(a){const c=(o+i)/2;Un(n,c)<0?n=o:n=i}else n=i;return n=Math.min(s,n),n=parseFloat(n.toFixed(Hl)),n}function so({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:a}){if(nt(e,0))return t;const s=[...t],[i,c]=r;pe(i!=null,"Invalid first pivot index"),pe(c!=null,"Invalid second pivot index");let l=0;if(a==="keyboard"){{const f=e<0?c:i,h=n[f];pe(h,`Panel constraints not found for index ${f}`);const{collapsedSize:p=0,collapsible:m,minSize:g=0}=h;if(m){const y=t[f];if(pe(y!=null,`Previous layout not found for panel index ${f}`),nt(y,p)){const v=g-y;Un(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}{const f=e<0?i:c,h=n[f];pe(h,`No panel constraints found for index ${f}`);const{collapsedSize:p=0,collapsible:m,minSize:g=0}=h;if(m){const y=t[f];if(pe(y!=null,`Previous layout not found for panel index ${f}`),nt(y,g)){const v=y-p;Un(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}}{const f=e<0?1:-1;let h=e<0?c:i,p=0;for(;;){const g=t[h];pe(g!=null,`Previous layout not found for panel index ${h}`);const v=fr({panelConstraints:n,panelIndex:h,size:100})-g;if(p+=v,h+=f,h<0||h>=n.length)break}const m=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-m:m}{let h=e<0?i:c;for(;h>=0&&h<n.length;){const p=Math.abs(e)-Math.abs(l),m=t[h];pe(m!=null,`Previous layout not found for panel index ${h}`);const g=m-p,y=fr({panelConstraints:n,panelIndex:h,size:g});if(!nt(m,y)&&(l+=m-y,s[h]=y,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?h--:h++}}if(XI(o,s))return o;{const f=e<0?c:i,h=t[f];pe(h!=null,`Previous layout not found for panel index ${f}`);const p=h+l,m=fr({panelConstraints:n,panelIndex:f,size:p});if(s[f]=m,!nt(m,p)){let g=p-m,v=e<0?c:i;for(;v>=0&&v<n.length;){const w=s[v];pe(w!=null,`Previous layout not found for panel index ${v}`);const x=w+g,j=fr({panelConstraints:n,panelIndex:v,size:x});if(nt(w,j)||(g-=j-w,s[v]=j),nt(g,0))break;e>0?v--:v++}}}const u=s.reduce((f,h)=>h+f,0);return nt(u,100)?s:o}function KI({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,a=0,s=0;const i=n[0];pe(i!=null,"No pivot index found"),t.forEach((f,h)=>{const{constraints:p}=f,{maxSize:m=100,minSize:g=0}=p;h===i?(r=g,o=m):(a+=g,s+=m)});const c=Math.min(o,100-a),l=Math.max(r,100-s),u=e[i];return{valueMax:c,valueMin:l,valueNow:u}}function Ro(e,t=document){return Array.from(t.querySelectorAll(`[${Re.resizeHandleId}][data-panel-group-id="${e}"]`))}function pv(e,t,n=document){const o=Ro(e,n).findIndex(a=>a.getAttribute(Re.resizeHandleId)===t);return o??null}function mv(e,t,n){const r=pv(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function gv(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function Xs(e,t=document){const n=t.querySelector(`[${Re.resizeHandleId}="${e}"]`);return n||null}function JI(e,t,n,r=document){var o,a,s,i;const c=Xs(t,r),l=Ro(e,r),u=c?l.indexOf(c):-1,f=(o=(a=n[u])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null,h=(s=(i=n[u+1])===null||i===void 0?void 0:i.id)!==null&&s!==void 0?s:null;return[f,h]}function ZI({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,panelGroupElement:a,setLayout:s}){_.useRef({didWarnAboutMissingResizeHandle:!1}),zn(()=>{if(!a)return;const i=Ro(n,a);for(let c=0;c<o.length-1;c++){const{valueMax:l,valueMin:u,valueNow:f}=KI({layout:r,panelsArray:o,pivotIndices:[c,c+1]}),h=i[c];if(h!=null){const p=o[c];pe(p,`No panel data found for index "${c}"`),h.setAttribute("aria-controls",p.id),h.setAttribute("aria-valuemax",""+Math.round(l)),h.setAttribute("aria-valuemin",""+Math.round(u)),h.setAttribute("aria-valuenow",f!=null?""+Math.round(f):"")}}return()=>{i.forEach((c,l)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,r,o,a]),_.useEffect(()=>{if(!a)return;const i=t.current;pe(i,"Eager values not found");const{panelDataArray:c}=i,l=gv(n,a);pe(l!=null,`No group found for id "${n}"`);const u=Ro(n,a);pe(u,`No resize handles found for group id "${n}"`);const f=u.map(h=>{const p=h.getAttribute(Re.resizeHandleId);pe(p,"Resize handle element has no handle id attribute");const[m,g]=JI(n,p,c,a);if(m==null||g==null)return()=>{};const y=v=>{if(!v.defaultPrevented)switch(v.key){case"Enter":{v.preventDefault();const w=c.findIndex(x=>x.id===m);if(w>=0){const x=c[w];pe(x,`No panel data found for index ${w}`);const j=r[w],{collapsedSize:N=0,collapsible:S,minSize:C=0}=x.constraints;if(j!=null&&S){const P=so({delta:nt(j,N)?C-N:N-j,initialLayout:r,panelConstraints:c.map(k=>k.constraints),pivotIndices:mv(n,p,a),prevLayout:r,trigger:"keyboard"});r!==P&&s(P)}}break}}};return h.addEventListener("keydown",y),()=>{h.removeEventListener("keydown",y)}});return()=>{f.forEach(h=>h())}},[a,e,t,n,r,o,s])}function _f(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function yv(e,t){const n=e==="horizontal",{x:r,y:o}=Gs(t);return n?r:o}function QI(e,t,n,r,o){const a=n==="horizontal",s=Xs(t,o);pe(s,`No resize handle element found for id "${t}"`);const i=s.getAttribute(Re.groupId);pe(i,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=r;const l=yv(n,e),u=gv(i,o);pe(u,`No group element found for id "${i}"`);const f=u.getBoundingClientRect(),h=a?f.width:f.height;return(l-c)/h*100}function e4(e,t,n,r,o,a){if(av(e)){const s=n==="horizontal";let i=0;e.shiftKey?i=100:o!=null?i=o:i=10;let c=0;switch(e.key){case"ArrowDown":c=s?0:i;break;case"ArrowLeft":c=s?-i:0;break;case"ArrowRight":c=s?i:0;break;case"ArrowUp":c=s?0:-i;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return r==null?0:QI(e,t,n,r,a)}function t4({panelDataArray:e}){const t=Array(e.length),n=e.map(a=>a.constraints);let r=0,o=100;for(let a=0;a<e.length;a++){const s=n[a];pe(s,`Panel constraints not found for index ${a}`);const{defaultSize:i}=s;i!=null&&(r++,t[a]=i,o-=i)}for(let a=0;a<e.length;a++){const s=n[a];pe(s,`Panel constraints not found for index ${a}`);const{defaultSize:i}=s;if(i!=null)continue;const c=e.length-r,l=o/c;r++,t[a]=l,o-=l}return t}function ir(e,t,n){t.forEach((r,o)=>{const a=e[o];pe(a,`Panel data not found for index ${o}`);const{callbacks:s,constraints:i,id:c}=a,{collapsedSize:l=0,collapsible:u}=i,f=n[c];if(f==null||r!==f){n[c]=r;const{onCollapse:h,onExpand:p,onResize:m}=s;m&&m(r,f),u&&(h||p)&&(p&&(f==null||en(f,l))&&!en(r,l)&&p(),h&&(f==null||!en(f,l))&&en(r,l)&&h())}})}function xa(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function n4({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:a=3}){const s=n[o];let i;return s==null?i=e!=null?e.toPrecision(a):"1":r.length===1?i="1":i=s.toPrecision(a),{flexBasis:0,flexGrow:i,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function r4(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function Sf(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function xv(e){return`react-resizable-panels:${e}`}function vv(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:o,order:a}=t;return o?r:a?`${a}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function bv(e,t){try{const n=xv(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function o4(e,t,n){var r,o;const a=(r=bv(e,n))!==null&&r!==void 0?r:{},s=vv(t);return(o=a[s])!==null&&o!==void 0?o:null}function a4(e,t,n,r,o){var a;const s=xv(e),i=vv(t),c=(a=bv(e,o))!==null&&a!==void 0?a:{};c[i]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(s,JSON.stringify(c))}catch(l){console.error(l)}}function Cf({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((a,s)=>a+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(a=>`${a}%`).join(", ")}`);if(!nt(r,100)&&n.length>0)for(let a=0;a<t.length;a++){const s=n[a];pe(s!=null,`No layout data found for index ${a}`);const i=100/r*s;n[a]=i}let o=0;for(let a=0;a<t.length;a++){const s=n[a];pe(s!=null,`No layout data found for index ${a}`);const i=fr({panelConstraints:t,panelIndex:a,size:s});s!=i&&(o+=s-i,n[a]=i)}if(!nt(o,0))for(let a=0;a<t.length;a++){const s=n[a];pe(s!=null,`No layout data found for index ${a}`);const i=s+o,c=fr({panelConstraints:t,panelIndex:a,size:i});if(s!==c&&(o-=c-s,n[a]=c,nt(o,0)))break}return n}const s4=100,io={getItem:e=>(Sf(io),io.getItem(e)),setItem:(e,t)=>{Sf(io),io.setItem(e,t)}},Nf={};function wv({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:a=null,onLayout:s=null,keyboardResizeBy:i=null,storage:c=io,style:l,tagName:u="div",...f}){const h=Vl(a),p=_.useRef(null),[m,g]=_.useState(null),[y,v]=_.useState([]),w=UI(),x=_.useRef({}),j=_.useRef(new Map),N=_.useRef(0),S=_.useRef({autoSaveId:e,direction:r,dragState:m,id:h,keyboardResizeBy:i,onLayout:s,storage:c}),C=_.useRef({layout:y,panelDataArray:[],panelDataArrayChanged:!1});_.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),_.useImperativeHandle(o,()=>({getId:()=>S.current.id,getLayout:()=>{const{layout:H}=C.current;return H},setLayout:H=>{const{onLayout:V}=S.current,{layout:B,panelDataArray:q}=C.current,$=Cf({layout:H,panelConstraints:q.map(W=>W.constraints)});_f(B,$)||(v($),C.current.layout=$,V&&V($),ir(q,$,x.current))}}),[]),zn(()=>{S.current.autoSaveId=e,S.current.direction=r,S.current.dragState=m,S.current.id=h,S.current.onLayout=s,S.current.storage=c}),ZI({committedValuesRef:S,eagerValuesRef:C,groupId:h,layout:y,panelDataArray:C.current.panelDataArray,setLayout:v,panelGroupElement:p.current}),_.useEffect(()=>{const{panelDataArray:H}=C.current;if(e){if(y.length===0||y.length!==H.length)return;let V=Nf[e];V==null&&(V=r4(a4,s4),Nf[e]=V);const B=[...H],q=new Map(j.current);V(e,B,q,y,c)}},[e,y,c]),_.useEffect(()=>{});const P=_.useCallback(H=>{const{onLayout:V}=S.current,{layout:B,panelDataArray:q}=C.current;if(H.constraints.collapsible){const $=q.map(X=>X.constraints),{collapsedSize:W=0,panelSize:U,pivotIndices:K}=Pn(q,H,B);if(pe(U!=null,`Panel size not found for panel "${H.id}"`),!en(U,W)){j.current.set(H.id,U);const J=lr(q,H)===q.length-1?U-W:W-U,Z=so({delta:J,initialLayout:B,panelConstraints:$,pivotIndices:K,prevLayout:B,trigger:"imperative-api"});xa(B,Z)||(v(Z),C.current.layout=Z,V&&V(Z),ir(q,Z,x.current))}}},[]),k=_.useCallback((H,V)=>{const{onLayout:B}=S.current,{layout:q,panelDataArray:$}=C.current;if(H.constraints.collapsible){const W=$.map(ee=>ee.constraints),{collapsedSize:U=0,panelSize:K=0,minSize:X=0,pivotIndices:J}=Pn($,H,q),Z=V??X;if(en(K,U)){const ee=j.current.get(H.id),ce=ee!=null&&ee>=Z?ee:Z,xe=lr($,H)===$.length-1?K-ce:ce-K,de=so({delta:xe,initialLayout:q,panelConstraints:W,pivotIndices:J,prevLayout:q,trigger:"imperative-api"});xa(q,de)||(v(de),C.current.layout=de,B&&B(de),ir($,de,x.current))}}},[]),T=_.useCallback(H=>{const{layout:V,panelDataArray:B}=C.current,{panelSize:q}=Pn(B,H,V);return pe(q!=null,`Panel size not found for panel "${H.id}"`),q},[]),D=_.useCallback((H,V)=>{const{panelDataArray:B}=C.current,q=lr(B,H);return n4({defaultSize:V,dragState:m,layout:y,panelData:B,panelIndex:q})},[m,y]),M=_.useCallback(H=>{const{layout:V,panelDataArray:B}=C.current,{collapsedSize:q=0,collapsible:$,panelSize:W}=Pn(B,H,V);return pe(W!=null,`Panel size not found for panel "${H.id}"`),$===!0&&en(W,q)},[]),L=_.useCallback(H=>{const{layout:V,panelDataArray:B}=C.current,{collapsedSize:q=0,collapsible:$,panelSize:W}=Pn(B,H,V);return pe(W!=null,`Panel size not found for panel "${H.id}"`),!$||Un(W,q)>0},[]),E=_.useCallback(H=>{const{panelDataArray:V}=C.current;V.push(H),V.sort((B,q)=>{const $=B.order,W=q.order;return $==null&&W==null?0:$==null?-1:W==null?1:$-W}),C.current.panelDataArrayChanged=!0,w()},[w]);zn(()=>{if(C.current.panelDataArrayChanged){C.current.panelDataArrayChanged=!1;const{autoSaveId:H,onLayout:V,storage:B}=S.current,{layout:q,panelDataArray:$}=C.current;let W=null;if(H){const K=o4(H,$,B);K&&(j.current=new Map(Object.entries(K.expandToSizes)),W=K.layout)}W==null&&(W=t4({panelDataArray:$}));const U=Cf({layout:W,panelConstraints:$.map(K=>K.constraints)});_f(q,U)||(v(U),C.current.layout=U,V&&V(U),ir($,U,x.current))}}),zn(()=>{const H=C.current;return()=>{H.layout=[]}},[]);const I=_.useCallback(H=>{let V=!1;const B=p.current;return B&&window.getComputedStyle(B,null).getPropertyValue("direction")==="rtl"&&(V=!0),function($){$.preventDefault();const W=p.current;if(!W)return()=>null;const{direction:U,dragState:K,id:X,keyboardResizeBy:J,onLayout:Z}=S.current,{layout:ee,panelDataArray:ce}=C.current,{initialLayout:ne}=K??{},xe=mv(X,H,W);let de=e4($,H,U,K,J,W);const Me=U==="horizontal";Me&&V&&(de=-de);const Fe=ce.map(Le=>Le.constraints),Oe=so({delta:de,initialLayout:ne??ee,panelConstraints:Fe,pivotIndices:xe,prevLayout:ee,trigger:av($)?"keyboard":"mouse-or-touch"}),Qe=!xa(ee,Oe);(sv($)||iv($))&&N.current!=de&&(N.current=de,!Qe&&de!==0?Me?Oi(H,de<0?lv:dv):Oi(H,de<0?uv:fv):Oi(H,0)),Qe&&(v(Oe),C.current.layout=Oe,Z&&Z(Oe),ir(ce,Oe,x.current))}},[]),R=_.useCallback((H,V)=>{const{onLayout:B}=S.current,{layout:q,panelDataArray:$}=C.current,W=$.map(ee=>ee.constraints),{panelSize:U,pivotIndices:K}=Pn($,H,q);pe(U!=null,`Panel size not found for panel "${H.id}"`);const J=lr($,H)===$.length-1?U-V:V-U,Z=so({delta:J,initialLayout:q,panelConstraints:W,pivotIndices:K,prevLayout:q,trigger:"imperative-api"});xa(q,Z)||(v(Z),C.current.layout=Z,B&&B(Z),ir($,Z,x.current))},[]),z=_.useCallback((H,V)=>{const{layout:B,panelDataArray:q}=C.current,{collapsedSize:$=0,collapsible:W}=V,{collapsedSize:U=0,collapsible:K,maxSize:X=100,minSize:J=0}=H.constraints,{panelSize:Z}=Pn(q,H,B);Z!=null&&(W&&K&&en(Z,$)?en($,U)||R(H,U):Z<J?R(H,J):Z>X&&R(H,X))},[R]),A=_.useCallback((H,V)=>{const{direction:B}=S.current,{layout:q}=C.current;if(!p.current)return;const $=Xs(H,p.current);pe($,`Drag handle element not found for id "${H}"`);const W=yv(B,V);g({dragHandleId:H,dragHandleRect:$.getBoundingClientRect(),initialCursorPosition:W,initialLayout:q})},[]),O=_.useCallback(()=>{g(null)},[]),F=_.useCallback(H=>{const{panelDataArray:V}=C.current,B=lr(V,H);B>=0&&(V.splice(B,1),delete x.current[H.id],C.current.panelDataArrayChanged=!0,w())},[w]),G=_.useMemo(()=>({collapsePanel:P,direction:r,dragState:m,expandPanel:k,getPanelSize:T,getPanelStyle:D,groupId:h,isPanelCollapsed:M,isPanelExpanded:L,reevaluatePanelConstraints:z,registerPanel:E,registerResizeHandle:I,resizePanel:R,startDragging:A,stopDragging:O,unregisterPanel:F,panelGroupElement:p.current}),[P,m,r,k,T,D,h,M,L,z,E,I,R,A,O,F]),Y={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return _.createElement(qs.Provider,{value:G},_.createElement(u,{...f,children:t,className:n,id:a,ref:p,style:{...Y,...l},[Re.group]:"",[Re.groupDirection]:r,[Re.groupId]:h}))}const jv=_.forwardRef((e,t)=>_.createElement(wv,{...e,forwardedRef:t}));wv.displayName="PanelGroup";jv.displayName="forwardRef(PanelGroup)";function lr(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Pn(e,t,n){const r=lr(e,t),a=r===e.length-1?[r-1,r]:[r,r+1],s=n[r];return{...t.constraints,panelSize:s,pivotIndices:a}}function i4({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){_.useEffect(()=>{if(e||n==null||r==null)return;const o=Xs(t,r);if(o==null)return;const a=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const i=o.getAttribute(Re.groupId);pe(i,`No group element found for id "${i}"`);const c=Ro(i,r),l=pv(i,t,r);pe(l!==null,`No resize element found for id "${t}"`);const u=s.shiftKey?l>0?l-1:c.length-1:l+1<c.length?l+1:0;c[u].focus();break}}};return o.addEventListener("keydown",a),()=>{o.removeEventListener("keydown",a)}},[r,e,t,n])}function _v({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:o,onBlur:a,onClick:s,onDragging:i,onFocus:c,onPointerDown:l,onPointerUp:u,style:f={},tabIndex:h=0,tagName:p="div",...m}){var g,y;const v=_.useRef(null),w=_.useRef({onClick:s,onDragging:i,onPointerDown:l,onPointerUp:u});_.useEffect(()=>{w.current.onClick=s,w.current.onDragging=i,w.current.onPointerDown=l,w.current.onPointerUp=u});const x=_.useContext(qs);if(x===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:j,groupId:N,registerResizeHandle:S,startDragging:C,stopDragging:P,panelGroupElement:k}=x,T=Vl(o),[D,M]=_.useState("inactive"),[L,E]=_.useState(!1),[I,R]=_.useState(null),z=_.useRef({state:D});zn(()=>{z.current.state=D}),_.useEffect(()=>{if(n)R(null);else{const G=S(T);R(()=>G)}},[n,T,S]);const A=(g=r==null?void 0:r.coarse)!==null&&g!==void 0?g:15,O=(y=r==null?void 0:r.fine)!==null&&y!==void 0?y:5;_.useEffect(()=>{if(n||I==null)return;const G=v.current;pe(G,"Element ref not attached");let Y=!1;return qI(T,G,j,{coarse:A,fine:O},(V,B,q)=>{if(!B){M("inactive");return}switch(V){case"down":{M("drag"),Y=!1,pe(q,'Expected event to be defined for "down" action'),C(T,q);const{onDragging:$,onPointerDown:W}=w.current;$==null||$(!0),W==null||W();break}case"move":{const{state:$}=z.current;Y=!0,$!=="drag"&&M("hover"),pe(q,'Expected event to be defined for "move" action'),I(q);break}case"up":{M("hover"),P();const{onClick:$,onDragging:W,onPointerUp:U}=w.current;W==null||W(!1),U==null||U(),Y||$==null||$();break}}})},[A,j,n,O,S,T,I,C,P]),i4({disabled:n,handleId:T,resizeHandler:I,panelGroupElement:k});const F={touchAction:"none",userSelect:"none"};return _.createElement(p,{...m,children:e,className:t,id:o,onBlur:()=>{E(!1),a==null||a()},onFocus:()=>{E(!0),c==null||c()},ref:v,role:"separator",style:{...F,...f},tabIndex:h,[Re.groupDirection]:j,[Re.groupId]:N,[Re.resizeHandle]:"",[Re.resizeHandleActive]:D==="drag"?"pointer":L?"keyboard":void 0,[Re.resizeHandleEnabled]:!n,[Re.resizeHandleId]:T,[Re.resizeHandleState]:D})}_v.displayName="PanelResizeHandle";const Ef=({className:e,...t})=>d.jsx(jv,{className:ie("cj-flex cj-h-full cj-w-full data-[panel-group-direction=vertical]:cj-flex-col",e),...t}),Qr=ov,Ai=({withHandle:e,className:t,...n})=>d.jsx(_v,{className:ie("cj-relative cj-flex cj-w-px cj-items-center cj-justify-center cj-bg-border after:cj-absolute after:cj-inset-y-0 after:cj-left-1/2 after:cj-w-1 after:-cj-translate-x-1/2 data-[panel-group-direction=vertical]:cj-h-px data-[panel-group-direction=vertical]:cj-w-full data-[panel-group-direction=vertical]:after:cj-left-0 data-[panel-group-direction=vertical]:after:cj-h-1 data-[panel-group-direction=vertical]:after:cj-w-full data-[panel-group-direction=vertical]:after:-cj-translate-y-1/2 data-[panel-group-direction=vertical]:after:cj-translate-x-0 focus-visible:cj-outline-none focus-visible:cj-ring-1 focus-visible:cj-ring-ring focus-visible:cj-ring-offset-1 [&[data-panel-group-direction=vertical]>div]:cj-rotate-90",t),...n,children:e&&d.jsx("div",{className:"cj-z-10 cj-flex cj-h-4 cj-w-3 cj-items-center cj-justify-center cj-rounded-sm cj-border cj-bg-border",children:d.jsx(zp,{className:"cj-h-2.5 cj-w-2.5"})})});function c4({specs:e,readOnly:t,onSave:n,onPublish:r,onUnlockEdit:o,onOpenRunner:a}){const{addCustomNode:s,isDirty:i}=$e(),{t:c}=dt(),l=_.useCallback(u=>{s(u,{x:300,y:200})},[s]);return d.jsxs("div",{className:"cj-h-full cj-w-full cj-flex cj-flex-col",children:[d.jsxs("header",{className:"cj-h-14 cj-border-b cj-bg-background cj-px-4 cj-flex cj-items-center cj-justify-between cj-shrink-0",children:[d.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[d.jsx("h1",{className:"cj-text-lg cj-font-semibold",children:c("builder_title")}),t&&d.jsxs(ct,{variant:"secondary",className:"cj-gap-1",children:[d.jsx(UN,{className:"cj-h-3 cj-w-3"}),c("builder_read_only")]})]}),d.jsxs("div",{className:"cj-flex cj-items-center cj-gap-2",children:[!t&&n&&d.jsxs(fe,{size:"sm",onClick:n,disabled:!i,className:"cj-relative cj-overflow-visible",children:[d.jsx(Wp,{className:"cj-h-4 cj-w-4 cj-mr-1"}),c("save"),i&&d.jsx("span",{className:"cj-absolute -cj-top-1 -cj-right-1 cj-h-2.5 cj-w-2.5 cj-rounded-full cj-bg-destructive cj-border-2 cj-border-background cj-z-10"})]}),!t&&r&&d.jsxs(fe,{size:"sm",variant:"default",onClick:r,children:[d.jsx(VN,{className:"cj-h-4 cj-w-4 cj-mr-1"}),c("builder_publish")]}),t&&o&&d.jsxs(fe,{size:"sm",variant:"outline",onClick:o,children:[d.jsx(GN,{className:"cj-h-4 cj-w-4 cj-mr-1"}),c("builder_unlock_edit")]})]})]}),d.jsx("div",{className:"cj-flex-1 cj-overflow-hidden cj-flex cj-flex-col",children:d.jsxs(Ef,{direction:"vertical",children:[d.jsx(Qr,{defaultSize:75,minSize:50,children:d.jsxs(Ef,{direction:"horizontal",children:[d.jsx(Qr,{defaultSize:20,minSize:15,maxSize:30,children:d.jsx("div",{className:"cj-h-full cj-border-r cj-bg-background",children:!t&&d.jsx(GD,{specs:e,onDragStart:l4,onCreateCustomNode:l})})}),d.jsx(Ai,{withHandle:!0}),d.jsx(Qr,{defaultSize:55,minSize:40,children:d.jsx(tD,{onOpenRunner:t?void 0:a,readOnly:t})}),d.jsx(Ai,{withHandle:!0}),d.jsx(Qr,{defaultSize:25,minSize:20,maxSize:35,children:d.jsx("div",{className:"cj-h-full cj-border-l cj-bg-background",children:d.jsx(mO,{})})})]})}),d.jsx(Ai,{withHandle:!0}),d.jsx(Qr,{defaultSize:25,minSize:15,maxSize:50,children:d.jsx(AI,{})})]})})]})}function l4(e){}function d4({specs:e,journey:t,onSave:n,onPublish:r,onUnlockEdit:o,onChange:a,onOpenRunner:s,readOnly:i=!1}){const{importJourneySpec:c,exportJourneySpec:l,markClean:u,nodes:f,edges:h}=$e(),p=_.useRef(null),[m,g]=_.useState(null);_.useEffect(()=>{p.current&&g(p.current)},[]),_.useEffect(()=>{t&&c(t)},[]),_.useEffect(()=>{a&&(f.length>0||h.length>0)&&a(l())},[f,h,a,l]);const y=_.useCallback(()=>{const w=l();n==null||n(w),u()},[l,n,u]),v=_.useCallback(()=>{const w=l();r==null||r(w)},[l,r]);return d.jsx("div",{ref:p,className:"jb-widget-root cj-h-full cj-w-full cj-relative cj-overflow-hidden",children:d.jsx(ol.Provider,{value:m,children:d.jsx(c4,{specs:e,onSave:!i&&n?y:void 0,onPublish:!i&&r?v:void 0,onUnlockEdit:i?o:void 0,onOpenRunner:i?void 0:s,readOnly:i})})})}function u4(e,t=[]){let n=[];function r(a,s){const i=b.createContext(s);i.displayName=a+"Context";const c=n.length;n=[...n,s];const l=f=>{var v;const{scope:h,children:p,...m}=f,g=((v=h==null?void 0:h[e])==null?void 0:v[c])||i,y=b.useMemo(()=>m,Object.values(m));return d.jsx(g.Provider,{value:y,children:p})};l.displayName=a+"Provider";function u(f,h){var g;const p=((g=h==null?void 0:h[e])==null?void 0:g[c])||i,m=b.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[l,u]}const o=()=>{const a=n.map(s=>b.createContext(s));return function(i){const c=(i==null?void 0:i[e])||a;return b.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return o.scopeName=e,[r,f4(o,...t)]}function f4(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const s=r.reduce((i,{useScope:c,scopeName:l})=>{const f=c(a)[`__scope${l}`];return{...i,...f}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var h4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Sv=h4.reduce((e,t)=>{const n=ms(`Primitive.${t}`),r=b.forwardRef((o,a)=>{const{asChild:s,...i}=o,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(c,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Gl="Progress",Ul=100,[p4]=u4(Gl),[m4,g4]=p4(Gl),Cv=b.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:a=y4,...s}=e;(o||o===0)&&!kf(o)&&console.error(x4(`${o}`,"Progress"));const i=kf(o)?o:Ul;r!==null&&!Pf(r,i)&&console.error(v4(`${r}`,"Progress"));const c=Pf(r,i)?r:null,l=es(c)?a(c,i):void 0;return d.jsx(m4,{scope:n,value:c,max:i,children:d.jsx(Sv.div,{"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":es(c)?c:void 0,"aria-valuetext":l,role:"progressbar","data-state":kv(c,i),"data-value":c??void 0,"data-max":i,...s,ref:t})})});Cv.displayName=Gl;var Nv="ProgressIndicator",Ev=b.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=g4(Nv,n);return d.jsx(Sv.div,{"data-state":kv(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});Ev.displayName=Nv;function y4(e,t){return`${Math.round(e/t*100)}%`}function kv(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function es(e){return typeof e=="number"}function kf(e){return es(e)&&!isNaN(e)&&e>0}function Pf(e,t){return es(e)&&!isNaN(e)&&e<=t&&e>=0}function x4(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Ul}\`.`}function v4(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
303
308
|
- a positive number
|
|
304
|
-
- less than the value passed to \`max\` (or ${
|
|
309
|
+
- less than the value passed to \`max\` (or ${Ul} if no \`max\` prop is set)
|
|
305
310
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
306
311
|
|
|
307
|
-
Defaulting to \`null\`.`}var vv=pv,n4=yv;const bv=w.forwardRef(({className:e,value:t,...n},r)=>u.jsx(vv,{ref:r,className:ce("cj-relative cj-h-4 cj-w-full cj-overflow-hidden cj-rounded-full cj-bg-secondary",e),...n,children:u.jsx(n4,{className:"cj-h-full cj-w-full cj-flex-1 cj-bg-primary cj-transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));bv.displayName=vv.displayName;const io=w.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ce("cj-rounded-lg cj-border cj-bg-card cj-text-card-foreground cj-shadow-sm",e),...t}));io.displayName="Card";const pc=w.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ce("cj-flex cj-flex-col cj-space-y-1.5 cj-p-6",e),...t}));pc.displayName="CardHeader";const gc=w.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:ce("cj-text-2xl cj-font-semibold cj-leading-none cj-tracking-tight",e),...t}));gc.displayName="CardTitle";const r4=w.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:ce("cj-text-sm cj-text-muted-foreground",e),...t}));r4.displayName="CardDescription";const co=w.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ce("cj-p-6 cj-pt-0",e),...t}));co.displayName="CardContent";const o4=w.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ce("cj-flex cj-items-center cj-p-6 cj-pt-0",e),...t}));o4.displayName="CardFooter";function s4(e,t=40){if(e==null||e==="")return"(empty)";const n=String(e);return n.length>t?n.slice(0,t)+"…":n}function a4({path:e,currentNodeId:t,nodes:n,answers:r,onJumpTo:o}){const s=e.indexOf(t||""),a=e.slice(0,s);return a.length===0?null:u.jsx(Tr,{className:"cj-max-h-[300px] cj-mb-4 cj-rounded-lg cj-border cj-bg-card",children:u.jsx("div",{className:"cj-divide-y",children:a.map((i,c)=>{const l=n.find(d=>d.id===i);if(!l)return null;const f=r[l.data.namespace];return u.jsxs("button",{onClick:()=>o(c),className:"cj-w-full cj-flex cj-items-center cj-gap-2 cj-px-3 cj-py-2 cj-text-left cj-text-sm hover:cj-bg-muted/50 cj-transition-colors",children:[u.jsx("span",{className:"cj-truncate cj-font-medium cj-text-foreground",children:l.data.labelOverride||l.data.label}),u.jsx("span",{className:"cj-ml-auto cj-text-muted-foreground cj-truncate cj-max-w-[140px] cj-text-xs",children:s4(f)})]},i)})})})}function i4(e){const t=e.nodes.map(r=>{var o;return{id:r.node_id,type:"questionNode",position:r.layout?{x:r.layout.x,y:r.layout.y}:{x:0,y:0},data:{specId:r.source_property_spec_id||"custom",namespace:r.question_key,label:r.label_override||r.label||r.question_key,labelOverride:r.label_override,schema:r.schema||"v1_string",options:r.options||null,actor:r.actor||"customer",bindings:r.bindings||[{target_namespace:r.question_key}],widget:(o=r.ui)==null?void 0:o.widget,required:r.required||!1,uploadConfig:r.upload_config}}}),n=e.edges.map(r=>({id:r.edge_id,source:r.from_node_id,target:r.to_node_id,type:"conditional",data:{condition:r.condition||null,priority:r.priority||0,isDefault:r.is_default||!1}}));return{nodes:t,edges:n}}function c4({journey:e,onSubmit:t,onSave:n,onFileSelect:r,enrichedOutput:o=!1,initialAnswers:s}){const{nodes:a,edges:i}=C.useMemo(()=>i4(e),[e]),c=C.useMemo(()=>{var F,U;if(!s||Object.keys(s).length===0)return null;const L=new Set(i.map(X=>X.target)),Y=a.find(X=>!L.has(X.id));if(!Y)return null;const G=[];let $=Y.id;for(;$;){const X=a.find(ue=>ue.id===$);if(!X)break;G.push($);const Z=X.data.namespace;if(!(s[Z]!==void 0&&s[Z]!==null&&s[Z]!==""))return{answers:{...s},path:G,currentNodeId:$,step:"form",started:!0};const J=i.filter(ue=>ue.source===$);if(J.length===0)return{answers:{...s},path:G,currentNodeId:$,step:"summary",started:!0};const ee=[...J].sort((ue,ve)=>{var ke,Fe;return(((ke=ve.data)==null?void 0:ke.priority)||0)-(((Fe=ue.data)==null?void 0:Fe.priority)||0)});let se=null,ae=null;for(const ue of ee){if((F=ue.data)!=null&&F.isDefault){ae=ue;continue}if((U=ue.data)!=null&&U.condition)try{if(Is.apply(ue.data.condition,{answers:s})){se=ue.target;break}}catch{}else{se=ue.target;break}}if(!se&&ae&&(se=ae.target),!se&&ee.length===1&&(se=ee[0].target),!se||G.includes(se))return{answers:{...s},path:G,currentNodeId:$,step:"summary",started:!0};$=se}return null},[s,a,i]),[l,f]=C.useState((c==null?void 0:c.answers)??{}),[d,h]=C.useState((c==null?void 0:c.path)??[]),[m,g]=C.useState((c==null?void 0:c.currentNodeId)??null),[p,y]=C.useState((c==null?void 0:c.step)??"form"),[v,b]=C.useState((c==null?void 0:c.started)??!1),[x,j]=C.useState(!1),N=C.useMemo(()=>{const L=new Set(i.map(G=>G.target)),Y=a.find(G=>!L.has(G.id));return(Y==null?void 0:Y.id)||null},[a,i]),S=a.find(L=>L.id===m),E=S?i.some(L=>L.source===S.id):!1,O=S?l[S.data.namespace]:void 0,P=(S==null?void 0:S.data.required)&&(O==null||O===""),T=C.useMemo(()=>{var G;const L=new Set;let Y=N;for(;Y&&!L.has(Y);){L.add(Y);const $=i.filter(U=>U.source===Y);if($.length===0)break;const F=$.find(U=>{var X;return(X=U.data)==null?void 0:X.isDefault});Y=(F==null?void 0:F.target)||((G=$[0])==null?void 0:G.target)||null}return Math.max(L.size,d.length)},[N,i,d.length]),k=p==="summary"?100:d.length>0?Math.round(d.indexOf(m||"")/T*100):0,M=C.useCallback(()=>{N&&(f({}),h([N]),g(N),y("form"),b(!0))},[N]),W=C.useCallback(()=>{f({}),h([]),g(null),y("form"),b(!1),j(!1)},[]),_=C.useCallback(L=>{if(!o)return L;const Y={};for(const[G,$]of Object.entries(L)){const F=a.find(U=>U.data.namespace===G);Y[G]={data:$,schema:(F==null?void 0:F.data.schema)||"unknown"}}return Y},[o,a]),I=C.useCallback(()=>{n&&n(_(l))},[n,l,_]),R=C.useCallback(async L=>{if(!(!S||!r))return r(L,S.data.namespace)},[S,r]),z=C.useCallback(L=>{S&&f(Y=>{var $;const G={...Y,[S.data.namespace]:L};if(($=S.data.bindings)!=null&&$.length)for(const F of S.data.bindings)G[F.target_namespace]=L;return G})},[S]),A=C.useCallback(()=>{var F,U;if(!m)return;const L=i.filter(X=>X.source===m);if(L.length===0){y("summary");return}const Y=[...L].sort((X,Z)=>{var K,J;return(((K=Z.data)==null?void 0:K.priority)||0)-(((J=X.data)==null?void 0:J.priority)||0)});let G=null,$=null;for(const X of Y){if((F=X.data)!=null&&F.isDefault){$=X;continue}if((U=X.data)!=null&&U.condition)try{if(Is.apply(X.data.condition,{answers:l})){G=X.target;break}}catch{}else{G=X.target;break}}!G&&$&&(G=$.target),!G&&Y.length===1&&(G=Y[0].target),G?(h(X=>[...X,G]),g(G),j(!1)):y("summary")},[m,i,l]),D=C.useCallback(L=>{const Y=new Set(L.map(G=>{var $;return($=a.find(F=>F.id===G))==null?void 0:$.data.namespace}).filter(Boolean));f(G=>{const $={};for(const[F,U]of Object.entries(G))Y.has(F)&&($[F]=U);return $})},[a]),B=C.useCallback(()=>{if(p==="summary"){y("form");return}if(d.length<=1)return;const L=d.slice(0,-1);h(L),g(L[L.length-1]),D(L),j(!1)},[p,d,D]),q=C.useCallback(L=>{const Y=d[L];if(!Y)return;const G=d.slice(0,L+1);h(G),g(Y),D(G),y("form"),j(!1)},[d,D]),V=C.useCallback(()=>{const L=_(l);if(t)t(L);else{const Y=JSON.stringify(L,null,2);navigator.clipboard.writeText(Y).then(()=>{It.success("Answers copied to clipboard!")})}},[l,_,t]),H=C.useMemo(()=>d.map(L=>a.find(Y=>Y.id===L)).filter(L=>L&&l[L.data.namespace]!==void 0).map(L=>L),[d,a,l]);return a.length===0?u.jsx("div",{className:"jb-widget-root cj-min-h-screen cj-bg-background cj-flex cj-items-center cj-justify-center cj-p-4",children:u.jsx(io,{className:"cj-max-w-md cj-w-full",children:u.jsx(co,{className:"cj-pt-6 cj-text-center cj-space-y-4",children:u.jsx("p",{className:"cj-text-muted-foreground",children:"No journey data available."})})})}):u.jsxs("div",{className:"jb-widget-root cj-min-h-screen cj-bg-background cj-flex cj-flex-col",children:[u.jsxs("header",{className:"cj-border-b cj-bg-card cj-px-4 cj-py-3 cj-flex cj-items-center cj-justify-between",children:[u.jsx("h1",{className:"cj-text-sm cj-font-semibold",children:"Form Runner"}),u.jsxs("div",{className:"cj-flex cj-items-center cj-gap-1",children:[v&&n&&u.jsxs(fe,{variant:"ghost",size:"sm",onClick:I,children:[u.jsx(Cm,{className:"cj-h-4 cj-w-4 cj-mr-1"}),"Save & Exit"]}),u.jsxs(fe,{variant:"ghost",size:"sm",onClick:W,children:[u.jsx(Sm,{className:"cj-h-4 cj-w-4 cj-mr-1"}),"Reset"]})]})]}),v&&u.jsxs("div",{className:"cj-px-4 cj-pt-4 cj-max-w-lg cj-mx-auto cj-w-full",children:[u.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-text-xs cj-text-muted-foreground cj-mb-1",children:[u.jsx("span",{children:p==="summary"?"Review":`Step ${d.indexOf(m||"")+1}`}),u.jsxs("span",{children:[k,"%"]})]}),u.jsx(bv,{value:k,className:"cj-h-2"})]}),u.jsx("main",{className:"cj-flex-1 cj-flex cj-items-start cj-justify-center cj-p-4 cj-pt-8",children:u.jsx("div",{className:"cj-max-w-lg cj-w-full",children:v?p==="summary"?u.jsxs(io,{children:[u.jsx(pc,{children:u.jsxs(gc,{className:"cj-flex cj-items-center cj-gap-2",children:[u.jsx(od,{className:"cj-h-5 cj-w-5 cj-text-primary"}),"Review Your Answers"]})}),u.jsxs(co,{className:"cj-space-y-4",children:[H.length===0?u.jsx("p",{className:"cj-text-sm cj-text-muted-foreground",children:"No answers recorded."}):u.jsx("div",{className:"cj-divide-y",children:H.map(L=>{const Y=l[L.data.namespace];return u.jsxs("div",{className:"cj-py-3 first:cj-pt-0 last:cj-pb-0",children:[u.jsx("span",{className:"cj-text-sm cj-font-medium",children:L.data.labelOverride||L.data.label}),u.jsx("p",{className:"cj-text-sm cj-text-muted-foreground cj-pl-1",children:Y!=null&&Y!==""?String(Y):"(empty)"})]},L.id)})}),u.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-pt-4 cj-border-t",children:[u.jsxs(fe,{variant:"outline",size:"sm",onClick:B,children:[u.jsx(qi,{className:"cj-h-4 cj-w-4 cj-mr-1"})," Back"]}),u.jsxs(fe,{size:"sm",onClick:V,children:[u.jsx(od,{className:"cj-h-4 cj-w-4 cj-mr-1"})," Submit"]})]})]})]}):S?u.jsxs(u.Fragment,{children:[u.jsx(a4,{path:d,currentNodeId:m,nodes:a,answers:l,onJumpTo:q}),u.jsx(io,{children:u.jsxs(co,{className:"cj-pt-6 cj-space-y-6",children:[u.jsx(hv,{nodeData:S.data,value:O,onChange:z,onValidationChange:j,onFileSelect:R}),u.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-pt-2",children:[u.jsxs(fe,{variant:"outline",size:"sm",onClick:B,disabled:d.length<=1,children:[u.jsx(qi,{className:"cj-h-4 cj-w-4 cj-mr-1"})," Back"]}),u.jsxs(fe,{size:"sm",onClick:A,disabled:!!P||x,children:[E?"Next":"Review",u.jsx(pm,{className:"cj-h-4 cj-w-4 cj-ml-1"})]})]})]})})]}):null:u.jsxs(io,{children:[u.jsx(pc,{className:"cj-text-center",children:u.jsx(gc,{children:"Ready to begin"})}),u.jsxs(co,{className:"cj-text-center cj-space-y-4",children:[u.jsxs("p",{className:"cj-text-sm cj-text-muted-foreground",children:["This form has ",a.length," question",a.length!==1?"s":"","."]}),u.jsx(fe,{onClick:M,size:"lg",children:"Start Form"})]})]})})})]})}exports.FormRunnerWidget=c4;exports.JourneyBuilderWidget=qI;exports.PortalContainerContext=sl;exports.SCHEMA_TYPES=al;exports.getSchemaInfo=Mr;
|
|
312
|
+
Defaulting to \`null\`.`}var Pv=Cv,b4=Ev;const Mv=b.forwardRef(({className:e,value:t,...n},r)=>d.jsx(Pv,{ref:r,className:ie("cj-relative cj-h-4 cj-w-full cj-overflow-hidden cj-rounded-full cj-bg-secondary",e),...n,children:d.jsx(b4,{className:"cj-h-full cj-w-full cj-flex-1 cj-bg-primary cj-transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Mv.displayName=Pv.displayName;const co=b.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:ie("cj-rounded-lg cj-border cj-bg-card cj-text-card-foreground cj-shadow-sm",e),...t}));co.displayName="Card";const bc=b.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:ie("cj-flex cj-flex-col cj-space-y-1.5 cj-p-6",e),...t}));bc.displayName="CardHeader";const wc=b.forwardRef(({className:e,...t},n)=>d.jsx("h3",{ref:n,className:ie("cj-text-2xl cj-font-semibold cj-leading-none cj-tracking-tight",e),...t}));wc.displayName="CardTitle";const w4=b.forwardRef(({className:e,...t},n)=>d.jsx("p",{ref:n,className:ie("cj-text-sm cj-text-muted-foreground",e),...t}));w4.displayName="CardDescription";const lo=b.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:ie("cj-p-6 cj-pt-0",e),...t}));lo.displayName="CardContent";const j4=b.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:ie("cj-flex cj-items-center cj-p-6 cj-pt-0",e),...t}));j4.displayName="CardFooter";function Dv(e,t=40){if(e==null||e==="")return"(empty)";if(typeof e=="object"&&e!==null&&"filename"in e)return Dv(e.filename,t);const n=String(e);return n.length>t?n.slice(0,t)+"…":n}function _4({path:e,currentNodeId:t,nodes:n,answers:r,onJumpTo:o}){const a=e.indexOf(t||""),s=e.slice(0,a);return s.length===0?null:d.jsx(Lr,{className:"cj-max-h-[300px] cj-mb-4 cj-rounded-lg cj-border cj-bg-card",children:d.jsx("div",{className:"cj-divide-y",children:s.map((i,c)=>{const l=n.find(h=>h.id===i);if(!l)return null;const u=l.data.bindings,f=u!=null&&u.length?r[u[0].target_namespace]:r[l.data.namespace];return d.jsxs("button",{onClick:()=>o(c),className:"cj-w-full cj-flex cj-items-center cj-gap-2 cj-px-3 cj-py-2 cj-text-left cj-text-sm hover:cj-bg-muted/50 cj-transition-colors",children:[d.jsx("span",{className:"cj-truncate cj-font-medium cj-text-foreground",children:l.data.labelOverride||l.data.label}),d.jsx("span",{className:"cj-ml-auto cj-text-muted-foreground cj-truncate cj-max-w-[140px] cj-text-xs",children:Dv(f)})]},i)})})})}function Ti(e,t){const n=e.data.bindings;return n!=null&&n.length?t[n[0].target_namespace]:t[e.data.namespace]}function S4(e){const t=e.nodes.map(r=>{var o;return{id:r.node_id,type:"questionNode",position:r.layout?{x:r.layout.x,y:r.layout.y}:{x:0,y:0},data:{specId:r.source_property_spec_id||"custom",namespace:r.question_key,label:r.label_override||r.label||r.question_key,labelOverride:r.label_override,schema:r.schema||"v1_string",options:r.options||null,actor:r.actor||"customer",bindings:r.bindings||[{target_namespace:r.question_key}],widget:(o=r.ui)==null?void 0:o.widget,required:r.required||!1,uploadConfig:r.upload_config}}}),n=e.edges.map(r=>({id:r.edge_id,source:r.from_node_id,target:r.to_node_id,type:"conditional",data:{condition:r.condition||null,priority:r.priority||0,isDefault:r.is_default||!1}}));return{nodes:t,edges:n}}function C4({journey:e,onSubmit:t,onSave:n,onFileSelect:r,enrichedOutput:o=!1,initialAnswers:a}){const{nodes:s,edges:i}=_.useMemo(()=>S4(e),[e]),c=_.useMemo(()=>{var U,K;if(!a||Object.keys(a).length===0)return null;const B=new Set(i.map(X=>X.target)),q=s.find(X=>!B.has(X.id));if(!q)return null;const $=[];let W=q.id;for(;W;){const X=s.find(de=>de.id===W);if(!X)break;$.push(W);const J=X.data.namespace;if(!(a[J]!==void 0&&a[J]!==null&&a[J]!==""))return{answers:{...a},path:$,currentNodeId:W,step:"form",started:!0};const ee=i.filter(de=>de.source===W);if(ee.length===0)return{answers:{...a},path:$,currentNodeId:W,step:"summary",started:!0};const ce=[...ee].sort((de,Me)=>{var Fe,Oe;return(((Fe=Me.data)==null?void 0:Fe.priority)||0)-(((Oe=de.data)==null?void 0:Oe.priority)||0)});let ne=null,xe=null;for(const de of ce){if((U=de.data)!=null&&U.isDefault){xe=de;continue}if((K=de.data)!=null&&K.condition)try{if(Wa.apply(de.data.condition,{answers:a})){ne=de.target;break}}catch{}else{ne=de.target;break}}if(!ne&&xe&&(ne=xe.target),!ne&&ce.length===1&&(ne=ce[0].target),!ne||$.includes(ne))return{answers:{...a},path:$,currentNodeId:W,step:"summary",started:!0};W=ne}return null},[a,s,i]),[l,u]=_.useState((c==null?void 0:c.answers)??{}),[f,h]=_.useState((c==null?void 0:c.path)??[]),[p,m]=_.useState((c==null?void 0:c.currentNodeId)??null),[g,y]=_.useState((c==null?void 0:c.step)??"form"),[v,w]=_.useState((c==null?void 0:c.started)??!1),[x,j]=_.useState(!1),N=_.useMemo(()=>{const B=new Set(i.map($=>$.target)),q=s.find($=>!B.has($.id));return(q==null?void 0:q.id)||null},[s,i]),S=s.find(B=>B.id===p),C=S?i.some(B=>B.source===S.id):!1,P=S?Ti(S,l):void 0,k=(S==null?void 0:S.data.required)&&(P==null||P===""),T=_.useMemo(()=>{var $;const B=new Set;let q=N;for(;q&&!B.has(q);){B.add(q);const W=i.filter(K=>K.source===q);if(W.length===0)break;const U=W.find(K=>{var X;return(X=K.data)==null?void 0:X.isDefault});q=(U==null?void 0:U.target)||(($=W[0])==null?void 0:$.target)||null}return Math.max(B.size,f.length)},[N,i,f.length]),D=g==="summary"?100:f.length>0?Math.round(f.indexOf(p||"")/T*100):0,M=_.useCallback(()=>{N&&(u({}),h([N]),m(N),y("form"),w(!0))},[N]),L=_.useCallback(()=>{u({}),h([]),m(null),y("form"),w(!1),j(!1)},[]),E=_.useCallback(B=>{if(!o)return B;const q={};for(const[$,W]of Object.entries(B)){const U=s.find(K=>{var X;return((X=K.data.bindings)==null?void 0:X.some(J=>J.target_namespace===$))||K.data.namespace===$});q[$]={data:W,schema:(U==null?void 0:U.data.schema)||"unknown"}}return q},[o,s]),I=_.useCallback(()=>{n&&n(E(l))},[n,l,E]),R=_.useCallback(async B=>{if(!(!S||!r))return r(B,S.data.namespace)},[S,r]),z=_.useCallback(B=>{S&&u(q=>{const $={...q},W=S.data.bindings;if(W!=null&&W.length)for(const U of W)$[U.target_namespace]=B;else $[S.data.namespace]=B;return $})},[S]),A=_.useCallback(()=>{var U,K;if(!p)return;const B=i.filter(X=>X.source===p);if(B.length===0){y("summary");return}const q=[...B].sort((X,J)=>{var Z,ee;return(((Z=J.data)==null?void 0:Z.priority)||0)-(((ee=X.data)==null?void 0:ee.priority)||0)});let $=null,W=null;for(const X of q){if((U=X.data)!=null&&U.isDefault){W=X;continue}if((K=X.data)!=null&&K.condition)try{if(Wa.apply(X.data.condition,{answers:l})){$=X.target;break}}catch{}else{$=X.target;break}}!$&&W&&($=W.target),!$&&q.length===1&&($=q[0].target),$?(h(X=>[...X,$]),m($),j(!1)):y("summary")},[p,i,l]),O=_.useCallback(B=>{var $;const q=new Set;for(const W of B){const U=s.find(K=>K.id===W);if(U)if(($=U.data.bindings)!=null&&$.length)for(const K of U.data.bindings)q.add(K.target_namespace);else q.add(U.data.namespace)}u(W=>{const U={};for(const[K,X]of Object.entries(W))q.has(K)&&(U[K]=X);return U})},[s]),F=_.useCallback(()=>{if(g==="summary"){y("form");return}if(f.length<=1)return;const B=f.slice(0,-1);h(B),m(B[B.length-1]),O(B),j(!1)},[g,f,O]),G=_.useCallback(B=>{const q=f[B];if(!q)return;const $=f.slice(0,B+1);h($),m(q),O($),y("form"),j(!1)},[f,O]),Y=_.useCallback(()=>{const B=E(l);if(t)t(B);else{const q=JSON.stringify(B,null,2);navigator.clipboard.writeText(q).then(()=>{$t.success("Answers copied to clipboard!")})}},[l,E,t]),H=_.useMemo(()=>f.map(B=>s.find(q=>q.id===B)).filter(B=>B&&Ti(B,l)!==void 0).map(B=>B),[f,s,l]),{t:V}=dt();return s.length===0?d.jsx("div",{className:"jb-widget-root cj-min-h-screen cj-bg-background cj-flex cj-items-center cj-justify-center cj-p-4",children:d.jsx(co,{className:"cj-max-w-md cj-w-full",children:d.jsx(lo,{className:"cj-pt-6 cj-text-center cj-space-y-4",children:d.jsx("p",{className:"cj-text-muted-foreground",children:V("runner_no_data")})})})}):d.jsxs("div",{className:"jb-widget-root cj-min-h-screen cj-bg-background cj-flex cj-flex-col",children:[d.jsxs("header",{className:"cj-border-b cj-bg-card cj-px-4 cj-py-3 cj-flex cj-items-center cj-justify-between",children:[d.jsx("h1",{className:"cj-text-sm cj-font-semibold",children:V("runner_title")}),d.jsxs("div",{className:"cj-flex cj-items-center cj-gap-1",children:[v&&n&&d.jsxs(fe,{variant:"ghost",size:"sm",onClick:I,children:[d.jsx(Wp,{className:"cj-h-4 cj-w-4 cj-mr-1"}),V("runner_save_exit")]}),d.jsxs(fe,{variant:"ghost",size:"sm",onClick:L,children:[d.jsx(Lp,{className:"cj-h-4 cj-w-4 cj-mr-1"}),V("reset")]})]})]}),v&&d.jsxs("div",{className:"cj-px-4 cj-pt-4 cj-max-w-lg cj-mx-auto cj-w-full",children:[d.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-text-xs cj-text-muted-foreground cj-mb-1",children:[d.jsx("span",{children:g==="summary"?V("runner_review"):V("runner_step",{step:f.indexOf(p||"")+1})}),d.jsxs("span",{children:[D,"%"]})]}),d.jsx(Mv,{value:D,className:"cj-h-2"})]}),d.jsx("main",{className:"cj-flex-1 cj-flex cj-items-start cj-justify-center cj-p-4 cj-pt-8",children:d.jsx("div",{className:"cj-max-w-lg cj-w-full",children:v?g==="summary"?d.jsxs(co,{children:[d.jsx(bc,{children:d.jsxs(wc,{className:"cj-flex cj-items-center cj-gap-2",children:[d.jsx(bu,{className:"cj-h-5 cj-w-5 cj-text-primary"}),V("runner_review_title")]})}),d.jsxs(lo,{className:"cj-space-y-4",children:[H.length===0?d.jsx("p",{className:"cj-text-sm cj-text-muted-foreground",children:V("runner_no_answers")}):d.jsx("div",{className:"cj-divide-y",children:H.map(B=>{const q=Ti(B,l);return d.jsxs("div",{className:"cj-py-3 first:cj-pt-0 last:cj-pb-0",children:[d.jsx("span",{className:"cj-text-sm cj-font-medium",children:B.data.labelOverride||B.data.label}),d.jsx("div",{className:"cj-text-sm cj-text-muted-foreground cj-pl-1",children:q!=null&&q!==""?typeof q=="object"&&q!==null&&"filename"in q&&"url"in q?d.jsx("a",{href:q.url,target:"_blank",rel:"noopener noreferrer",className:"cj-text-primary cj-underline",children:q.filename}):String(q):"(empty)"})]},B.id)})}),d.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-pt-4 cj-border-t",children:[d.jsxs(fe,{variant:"outline",size:"sm",onClick:F,children:[d.jsx(ec,{className:"cj-h-4 cj-w-4 cj-mr-1"})," ",V("back")]}),d.jsxs(fe,{size:"sm",onClick:Y,children:[d.jsx(bu,{className:"cj-h-4 cj-w-4 cj-mr-1"})," ",V("submit")]})]})]})]}):S?d.jsxs(d.Fragment,{children:[d.jsx(_4,{path:f,currentNodeId:p,nodes:s,answers:l,onJumpTo:G}),d.jsx(co,{children:d.jsxs(lo,{className:"cj-pt-6 cj-space-y-6",children:[d.jsx(nv,{nodeData:S.data,value:P,onChange:z,onValidationChange:j,onFileSelect:R}),d.jsxs("div",{className:"cj-flex cj-items-center cj-justify-between cj-pt-2",children:[d.jsxs(fe,{variant:"outline",size:"sm",onClick:F,disabled:f.length<=1,children:[d.jsx(ec,{className:"cj-h-4 cj-w-4 cj-mr-1"})," ",V("back")]}),d.jsxs(fe,{size:"sm",onClick:A,disabled:!!k||x,children:[V(C?"next":"runner_review"),d.jsx(Dp,{className:"cj-h-4 cj-w-4 cj-ml-1"})]})]})]})})]}):null:d.jsxs(co,{children:[d.jsx(bc,{className:"cj-text-center",children:d.jsx(wc,{children:V("runner_ready_title")})}),d.jsxs(lo,{className:"cj-text-center cj-space-y-4",children:[d.jsx("p",{className:"cj-text-sm cj-text-muted-foreground",children:V("runner_question_count",{count:s.length,plural:s.length!==1?"s":""})}),d.jsx(fe,{onClick:M,size:"lg",children:V("runner_start_form")})]})]})})})]})}exports.FormRunnerWidget=C4;exports.JourneyBuilderWidget=d4;exports.PortalContainerContext=ol;exports.SCHEMA_TYPES=Bc;exports.getSchemaInfo=Er;exports.setLanguage=jp;exports.useTranslation=dt;
|