treege 3.0.0-beta.2 → 3.0.0-beta.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/LICENSE +18 -12
  2. package/README.md +118 -26
  3. package/dist/ThemeContext-BIT4DHqC.js +763 -0
  4. package/dist/TreegeEditor-LKN_xeXZ.js +3311 -0
  5. package/dist/TreegeRenderer-Ci_Ym86Y.js +1812 -0
  6. package/dist/editor/components/input/ComboboxWithCreate.d.ts +2 -1
  7. package/dist/editor/constants/defaultNode.d.ts +1 -1
  8. package/dist/editor/constants/edgeTypes.d.ts +3 -2
  9. package/dist/editor/constants/nodeSpacing.d.ts +20 -0
  10. package/dist/editor/constants/nodeTypes.d.ts +5 -5
  11. package/dist/editor/context/TreegeEditorContext.d.ts +15 -0
  12. package/dist/editor/features/TreegeEditor/TreegeEditor.d.ts +1 -1
  13. package/dist/editor/features/TreegeEditor/edges/ConditionalEdge.d.ts +2 -2
  14. package/dist/editor/features/TreegeEditor/edges/DefaultEdge.d.ts +3 -0
  15. package/dist/editor/features/TreegeEditor/forms/SubmitConfigForm.d.ts +7 -0
  16. package/dist/editor/features/TreegeEditor/inputs/ComboboxPattern.d.ts +2 -1
  17. package/dist/editor/features/TreegeEditor/nodes/FlowNode.d.ts +2 -2
  18. package/dist/editor/features/TreegeEditor/nodes/GroupNode.d.ts +2 -2
  19. package/dist/editor/features/TreegeEditor/nodes/InputNode.d.ts +2 -2
  20. package/dist/editor/features/TreegeEditor/nodes/UINode.d.ts +2 -2
  21. package/dist/editor/features/TreegeEditor/nodes/hooks/useBottomHandleClick.d.ts +8 -0
  22. package/dist/editor/features/TreegeEditor/nodes/layout/NodeWrapper.d.ts +2 -1
  23. package/dist/editor/features/TreegeEditor/panel/AIGeneratorDialog.d.ts +16 -0
  24. package/dist/editor/hooks/useFlowActions.d.ts +1 -0
  25. package/dist/editor/hooks/useFlowConnections.d.ts +1 -0
  26. package/dist/editor/types/ai.d.ts +65 -0
  27. package/dist/editor/types/editor.d.ts +5 -8
  28. package/dist/editor/utils/aiFlowGenerator.d.ts +5 -0
  29. package/dist/editor.js +2 -2
  30. package/dist/main.js +43 -39
  31. package/dist/renderer/context/TreegeRendererContext.d.ts +4 -1
  32. package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +3 -1
  33. package/dist/renderer/features/TreegeRenderer/web/TreegeRenderer.d.ts +1 -1
  34. package/dist/renderer/features/TreegeRenderer/web/components/DefaultSubmitButton.d.ts +1 -1
  35. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAddressInput.d.ts +1 -1
  36. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAutocompleteInput.d.ts +1 -1
  37. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultCheckboxInput.d.ts +1 -1
  38. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.d.ts +1 -1
  39. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateRangeInput.d.ts +1 -1
  40. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultFileInput.d.ts +1 -1
  41. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHiddenInput.d.ts +1 -1
  42. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHttpInput.d.ts +1 -1
  43. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultNumberInput.d.ts +1 -1
  44. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultPasswordInput.d.ts +1 -1
  45. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.d.ts +1 -1
  46. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSelectInput.d.ts +1 -1
  47. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSubmitInput.d.ts +3 -0
  48. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSwitchInput.d.ts +1 -1
  49. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextAreaInput.d.ts +1 -1
  50. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextInput.d.ts +1 -1
  51. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeInput.d.ts +1 -1
  52. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeRangeInput.d.ts +1 -1
  53. package/dist/renderer/hooks/useSubmitHandler.d.ts +34 -0
  54. package/dist/renderer/hooks/useTranslate.d.ts +6 -4
  55. package/dist/renderer/index.d.ts +1 -0
  56. package/dist/renderer/types/renderer.d.ts +40 -2
  57. package/dist/renderer/utils/form.d.ts +22 -2
  58. package/dist/renderer/utils/http.d.ts +101 -0
  59. package/dist/renderer/utils/node.d.ts +9 -1
  60. package/dist/renderer/utils/sanitize.d.ts +85 -0
  61. package/dist/renderer/utils/submit.d.ts +47 -0
  62. package/dist/renderer.js +33 -29
  63. package/dist/shared/components/ui/alert-dialog.d.ts +14 -0
  64. package/dist/shared/components/ui/badge.d.ts +1 -1
  65. package/dist/shared/components/ui/popover.d.ts +3 -1
  66. package/dist/shared/components/ui/select.d.ts +3 -1
  67. package/dist/shared/constants/inputType.d.ts +1 -0
  68. package/dist/shared/locales/ar.json.d.ts +81 -8
  69. package/dist/shared/locales/de.json.d.ts +81 -8
  70. package/dist/shared/locales/en.json.d.ts +82 -9
  71. package/dist/shared/locales/es.json.d.ts +81 -8
  72. package/dist/shared/locales/fr.json.d.ts +81 -8
  73. package/dist/shared/locales/it.json.d.ts +81 -8
  74. package/dist/shared/locales/pt.json.d.ts +81 -8
  75. package/dist/shared/types/node.d.ts +51 -0
  76. package/package.json +9 -5
  77. package/dist/ThemeContext-BIvs8Kw-.js +0 -758
  78. package/dist/TreegeEditor-BSPfQQk3.js +0 -2151
  79. package/dist/TreegeRenderer-D3EvsEfJ.js +0 -1413
  80. package/dist/_name_.css +0 -1
@@ -0,0 +1,3311 @@
1
+ (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(`/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}.react-flow{--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:#ffffff80;--xy-minimap-background-color-default:#fff;--xy-minimap-mask-background-color-default:#f0f0f099;--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-border-default:1px solid #bbb;--xy-node-border-selected-default:1px solid #555;--xy-handle-background-color-default:#333;--xy-selection-background-color-default:#9696b41a;--xy-selection-border-default:1px dotted #9b9b9bcc;--xy-resize-background-color-default:#3367d9;direction:ltr}.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:#96969640;--xy-minimap-background-color-default:#141414;--xy-minimap-mask-background-color-default:#3c3c3c99;--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}.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{width:100%;height:100%;position:absolute;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{pointer-events:none;position:absolute;overflow:visible}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.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;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:.5s linear infinite dashdraw}svg.react-flow__connectionline{z-index:1001;position:absolute;overflow:visible}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.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:0 0;pointer-events:none}.react-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.react-flow__handle{pointer-events:none;background-color:var(--xy-handle-background-color,var(--xy-handle-background-color-default));min-width:5px;min-height:5px;position:absolute}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;bottom:0;left:50%;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{z-index:5;margin:15px;position:absolute}.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{background:var(--xy-attribution-background-color,var(--xy-attribution-background-color-default));margin:0;padding:2px 3px;font-size:10px}.react-flow__attribution a{color:#999;text-decoration:none}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.react-flow__edgelabel-renderer{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__viewport-portal{-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.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{flex-direction:column;display:flex}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{justify-content:center;align-items:center;width:26px;height:26px;padding:4px;display:flex}.react-flow__controls-button svg{fill:currentColor;width:100%;max-width:12px;max-height:12px}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{border:var(--xy-node-border,var(--xy-node-border-default));color:var(--xy-node-color,var(--xy-node-color-default))}.react-flow__node-input.selected,.react-flow__node-input:focus,.react-flow__node-input:focus-visible,.react-flow__node-default.selected,.react-flow__node-default:focus,.react-flow__node-default:focus-visible,.react-flow__node-output.selected,.react-flow__node-output:focus,.react-flow__node-output:focus-visible,.react-flow__node-group.selected,.react-flow__node-group:focus,.react-flow__node-group:focus-visible{border:var(--xy-node-border-selected,var(--xy-node-border-selected-default));outline:none}.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__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{background-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border:1px solid #fff;border-radius:1px;width:5px;height:5px;translate:-50% -50%}.react-flow__resize-control.handle.left{top:50%;left:0}.react-flow__resize-control.handle.right{top:50%;left:100%}.react-flow__resize-control.handle.top{top:0;left:50%}.react-flow__resize-control.handle.bottom{top:100%;left:50%}.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-style:solid;border-width:0}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;height:100%;top:0;transform:translate(-50%)}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{width:100%;height:1px;left:0;transform:translateY(-50%)}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-300:oklch(80.8% .114 19.571);--color-red-500:oklch(63.7% .237 25.331);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-green-50:oklch(98.2% .018 155.826);--color-green-300:oklch(87.1% .15 154.449);--color-green-800:oklch(44.8% .119 151.328);--color-green-900:oklch(39.3% .095 152.535);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-purple-600:oklch(55.8% .288 302.321);--color-purple-700:oklch(49.6% .265 301.924);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-lg:32rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-widest:.1em;--radius-xs:.125rem;--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-card:var(--card);--color-ring:var(--ring);--color-chart-2:var(--chart-2);--color-chart-3:var(--chart-3);--color-chart-4:var(--chart-4)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring)50%,transparent)}}body{background-color:var(--background);color:var(--foreground)}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.inset-y-0{inset-block:calc(var(--spacing)*0)}.-top-3\\.5{top:calc(var(--spacing)*-3.5)}.top-0{top:calc(var(--spacing)*0)}.top-1\\/2{top:50%}.top-4{top:calc(var(--spacing)*4)}.top-5{top:calc(var(--spacing)*5)}.top-\\[50\\%\\]{top:50%}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.right-3{right:calc(var(--spacing)*3)}.right-4{right:calc(var(--spacing)*4)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-5{left:calc(var(--spacing)*5)}.left-6{left:calc(var(--spacing)*6)}.left-\\[50\\%\\]{left:50%}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing)*1)}.my-4{margin-block:calc(var(--spacing)*4)}.my-8{margin-block:calc(var(--spacing)*8)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-8{margin-top:calc(var(--spacing)*8)}.mt-10{margin-top:calc(var(--spacing)*10)}.mt-auto{margin-top:auto}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-10{margin-bottom:calc(var(--spacing)*10)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.field-sizing-content{field-sizing:content}.aspect-square{aspect-ratio:1}.size-\\(--cell-size\\){width:var(--cell-size);height:var(--cell-size)}.size-2{width:calc(var(--spacing)*2);height:calc(var(--spacing)*2)}.size-2\\.5{width:calc(var(--spacing)*2.5);height:calc(var(--spacing)*2.5)}.size-3\\.5{width:calc(var(--spacing)*3.5);height:calc(var(--spacing)*3.5)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.size-auto{width:auto;height:auto}.size-full{width:100%;height:100%}.\\!h-3{height:calc(var(--spacing)*3)!important}.\\!h-6{height:calc(var(--spacing)*6)!important}.h-\\(--cell-size\\){height:var(--cell-size)}.h-2\\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-14{height:calc(var(--spacing)*14)}.h-\\[1\\.15rem\\]{height:1.15rem}.h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\(--radix-dropdown-menu-content-available-height\\){max-height:var(--radix-dropdown-menu-content-available-height)}.max-h-\\(--radix-select-content-available-height\\){max-height:var(--radix-select-content-available-height)}.max-h-150{max-height:calc(var(--spacing)*150)}.max-h-\\[300px\\]{max-height:300px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-16{min-height:calc(var(--spacing)*16)}.\\!w-3{width:calc(var(--spacing)*3)!important}.\\!w-6{width:calc(var(--spacing)*6)!important}.w-\\(--cell-size\\){width:var(--cell-size)}.w-2\\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\\/4{width:75%}.w-4{width:calc(var(--spacing)*4)}.w-4\\/12{width:33.3333%}.w-8{width:calc(var(--spacing)*8)}.w-8\\/12{width:66.6667%}.w-12{width:calc(var(--spacing)*12)}.w-32{width:calc(var(--spacing)*32)}.w-72{width:calc(var(--spacing)*72)}.w-80{width:calc(var(--spacing)*80)}.w-96{width:calc(var(--spacing)*96)}.w-\\[300px\\]{width:300px}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-50{max-width:calc(var(--spacing)*50)}.max-w-\\[350px\\]{max-width:350px}.max-w-\\[calc\\(100\\%-2rem\\)\\]{max-width:calc(100% - 2rem)}.max-w-full{max-width:100%}.min-w-\\(--cell-size\\){min-width:var(--cell-size)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.origin-\\(--radix-dropdown-menu-content-transform-origin\\){transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\\(--radix-popover-content-transform-origin\\){transform-origin:var(--radix-popover-content-transform-origin)}.origin-\\(--radix-select-content-transform-origin\\){transform-origin:var(--radix-select-content-transform-origin)}.origin-\\(--radix-tooltip-content-transform-origin\\){transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\\[-50\\%\\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\\[-50\\%\\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\\[calc\\(-50\\%_-_2px\\)\\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-45{rotate:45deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize-none{resize:none}.scroll-my-1{scroll-margin-block:calc(var(--spacing)*1)}.scroll-py-1{scroll-padding-block:calc(var(--spacing)*1)}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.place-content-center{place-content:center}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing)*0)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-5{gap:calc(var(--spacing)*5)}.gap-6{gap:calc(var(--spacing)*6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing)*3)}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.gap-y-3{row-gap:calc(var(--spacing)*3)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[2px\\]{border-radius:2px}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xs{border-radius:var(--radius-xs)}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-gray-300{border-color:var(--color-gray-300)}.border-input{border-color:var(--input)}.border-transparent{border-color:#0000}.border-t-transparent{border-top-color:#0000}.border-l-transparent{border-left-color:#0000}.\\!bg-primary{background-color:var(--primary)!important}.bg-accent{background-color:var(--accent)}.bg-background{background-color:var(--background)}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-blue-300{background-color:var(--color-blue-300)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-border{background-color:var(--border)}.bg-chart-2{background-color:var(--chart-2)}.bg-destructive{background-color:var(--destructive)}.bg-foreground{background-color:var(--foreground)}.bg-green-50{background-color:var(--color-green-50)}.bg-muted,.bg-muted\\/20{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\\/20{background-color:color-mix(in oklab,var(--muted)20%,transparent)}}.bg-muted\\/30{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\\/30{background-color:color-mix(in oklab,var(--muted)30%,transparent)}}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-purple-600{background-color:var(--color-purple-600)}.bg-red-50{background-color:var(--color-red-50)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.fill-current{fill:currentColor}.fill-foreground{fill:var(--foreground)}.fill-primary{fill:var(--primary)}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-px{padding:1px}.px-\\(--cell-size\\){padding-inline:var(--cell-size)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-6{padding-block:calc(var(--spacing)*6)}.pt-2{padding-top:calc(var(--spacing)*2)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-8{padding-right:calc(var(--spacing)*8)}.pr-10{padding-right:calc(var(--spacing)*10)}.pb-1\\.5{padding-bottom:calc(var(--spacing)*1.5)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-8{padding-left:calc(var(--spacing)*8)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[0\\.8rem\\]{font-size:.8rem}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-light{--tw-font-weight:var(--font-weight-light);font-weight:var(--font-weight-light)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.text-nowrap{text-wrap:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-\\[\\#13d3b4\\]{color:#13d3b4}.text-\\[--treege-color-primary\\]{color:--treege-color-primary}.text-accent-foreground{color:var(--accent-foreground)}.text-background{color:var(--background)}.text-current{color:currentColor}.text-destructive{color:var(--destructive)}.text-foreground{color:var(--foreground)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-green-800{color:var(--color-green-800)}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-red-500{color:var(--color-red-500)}.text-red-800{color:var(--color-red-800)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.\\[color-scheme\\:light\\]{color-scheme:light}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-100{opacity:1}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.drop-shadow-\\[0_0px_35px\\]{--tw-drop-shadow-size:drop-shadow(0 0px 35px var(--tw-drop-shadow-color,currentcolor));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-blue-600{--tw-drop-shadow-color:oklch(54.6% .245 262.881)}@supports (color:color-mix(in lab,red,red)){.drop-shadow-blue-600{--tw-drop-shadow-color:color-mix(in oklab,var(--color-blue-600)var(--tw-drop-shadow-alpha),transparent)}}.drop-shadow-blue-600{--tw-drop-shadow:var(--tw-drop-shadow-size)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-none{transition-property:none}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.\\[--cell-size\\:--spacing\\(8\\)\\]{--cell-size:calc(var(--spacing)*8)}.group-data-\\[disabled\\=true\\]\\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\\[disabled\\=true\\]\\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.group-data-\\[focused\\=true\\]\\/day\\:relative:is(:where(.group\\/day)[data-focused=true] *){position:relative}.group-data-\\[focused\\=true\\]\\/day\\:z-10:is(:where(.group\\/day)[data-focused=true] *){z-index:10}.group-data-\\[focused\\=true\\]\\/day\\:border-ring:is(:where(.group\\/day)[data-focused=true] *){border-color:var(--ring)}.group-data-\\[focused\\=true\\]\\/day\\:ring-\\[3px\\]:is(:where(.group\\/day)[data-focused=true] *){--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\\[focused\\=true\\]\\/day\\:ring-ring\\/50:is(:where(.group\\/day)[data-focused=true] *){--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.group-data-\\[focused\\=true\\]\\/day\\:ring-ring\\/50:is(:where(.group\\/day)[data-focused=true] *){--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.peer-disabled\\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.selection\\:bg-primary ::selection{background-color:var(--primary)}.selection\\:bg-primary::selection{background-color:var(--primary)}.selection\\:text-primary-foreground ::selection{color:var(--primary-foreground)}.selection\\:text-primary-foreground::selection{color:var(--primary-foreground)}.file\\:inline-flex::file-selector-button{display:inline-flex}.file\\:h-7::file-selector-button{height:calc(var(--spacing)*7)}.file\\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\\:bg-transparent::file-selector-button{background-color:#0000}.file\\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\\:text-muted-foreground::placeholder{color:var(--muted-foreground)}@media(hover:hover){.hover\\:\\!bg-primary\\/80:hover{background-color:var(--primary)!important}@supports (color:color-mix(in lab,red,red)){.hover\\:\\!bg-primary\\/80:hover{background-color:color-mix(in oklab,var(--primary)80%,transparent)!important}}.hover\\:bg-accent:hover{background-color:var(--accent)}.hover\\:bg-blue-600:hover{background-color:var(--color-blue-600)}.hover\\:bg-destructive\\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}.hover\\:bg-primary\\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}.hover\\:bg-purple-700:hover{background-color:var(--color-purple-700)}.hover\\:bg-secondary\\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab,var(--secondary)80%,transparent)}}.hover\\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\\:text-primary:hover{color:var(--primary)}.hover\\:no-underline:hover{text-decoration-line:none}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}}.focus\\:bg-accent:focus{background-color:var(--accent)}.focus\\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\\:text-destructive:focus{color:var(--destructive)}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-blue-500:focus{--tw-ring-color:var(--color-blue-500)}.focus\\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus\\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.focus-visible\\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-focus\\:border-ring:has(:focus){border-color:var(--ring)}.has-focus\\:ring-\\[3px\\]:has(:focus){--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.has-focus\\:ring-ring\\/50:has(:focus){--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.has-focus\\:ring-ring\\/50:has(:focus){--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.has-\\[\\>svg\\]\\:px-2\\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\\[\\>svg\\]\\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\\[\\>svg\\]\\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.aria-disabled\\:opacity-50[aria-disabled=true]{opacity:.5}.aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.aria-selected\\:text-muted-foreground[aria-selected=true]{color:var(--muted-foreground)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[disabled\\=true\\]\\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\\[disabled\\=true\\]\\:opacity-50[data-disabled=true]{opacity:.5}.data-\\[inset\\]\\:pl-8[data-inset]{padding-left:calc(var(--spacing)*8)}.data-\\[orientation\\=horizontal\\]\\:h-px[data-orientation=horizontal]{height:1px}.data-\\[orientation\\=horizontal\\]\\:w-full[data-orientation=horizontal]{width:100%}.data-\\[orientation\\=vertical\\]\\:h-full[data-orientation=vertical]{height:100%}.data-\\[orientation\\=vertical\\]\\:w-px[data-orientation=vertical]{width:1px}.data-\\[placeholder\\]\\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\\[range-end\\=true\\]\\:rounded-md[data-range-end=true]{border-radius:calc(var(--radius) - 2px)}.data-\\[range-end\\=true\\]\\:rounded-r-md[data-range-end=true]{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\\[range-end\\=true\\]\\:bg-primary[data-range-end=true]{background-color:var(--primary)}.data-\\[range-end\\=true\\]\\:text-primary-foreground[data-range-end=true]{color:var(--primary-foreground)}.data-\\[range-middle\\=true\\]\\:rounded-none[data-range-middle=true]{border-radius:0}.data-\\[range-middle\\=true\\]\\:bg-accent[data-range-middle=true]{background-color:var(--accent)}.data-\\[range-middle\\=true\\]\\:text-accent-foreground[data-range-middle=true]{color:var(--accent-foreground)}.data-\\[range-start\\=true\\]\\:rounded-md[data-range-start=true]{border-radius:calc(var(--radius) - 2px)}.data-\\[range-start\\=true\\]\\:rounded-l-md[data-range-start=true]{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.data-\\[range-start\\=true\\]\\:bg-primary[data-range-start=true]{background-color:var(--primary)}.data-\\[range-start\\=true\\]\\:text-primary-foreground[data-range-start=true]{color:var(--primary-foreground)}.data-\\[selected-single\\=true\\]\\:bg-primary[data-selected-single=true]{background-color:var(--primary)}.data-\\[selected-single\\=true\\]\\:text-primary-foreground[data-selected-single=true]{color:var(--primary-foreground)}.data-\\[selected\\=true\\]\\:rounded-none[data-selected=true]{border-radius:0}.data-\\[selected\\=true\\]\\:bg-accent[data-selected=true]{background-color:var(--accent)}.data-\\[selected\\=true\\]\\:text-accent-foreground[data-selected=true]{color:var(--accent-foreground)}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\\[size\\=default\\]\\:h-9[data-size=default]{height:calc(var(--spacing)*9)}.data-\\[size\\=sm\\]\\:h-8[data-size=sm]{height:calc(var(--spacing)*8)}:is(.\\*\\*\\:data-\\[slot\\=command-input-wrapper\\]\\:h-12 *)[data-slot=command-input-wrapper]{height:calc(var(--spacing)*12)}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:flex>*)[data-slot=select-value]{display:flex}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing)*2)}.data-\\[state\\=checked\\]\\:translate-x-\\[calc\\(100\\%-2px\\)\\][data-state=checked]{--tw-translate-x: calc(100% - 2px) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[state\\=checked\\]\\:border-primary[data-state=checked]{border-color:var(--primary)}.data-\\[state\\=checked\\]\\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\\[state\\=checked\\]\\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\\[state\\=closed\\]\\:duration-300[data-state=closed]{--tw-duration:.3s;transition-duration:.3s}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=closed\\]\\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y:100%}.data-\\[state\\=closed\\]\\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x:-100%}.data-\\[state\\=closed\\]\\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x:100%}.data-\\[state\\=closed\\]\\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y:-100%}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\\[state\\=open\\]\\:bg-secondary[data-state=open]{background-color:var(--secondary)}.data-\\[state\\=open\\]\\:text-accent-foreground[data-state=open]{color:var(--accent-foreground)}.data-\\[state\\=open\\]\\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\\[state\\=open\\]\\:duration-500[data-state=open]{--tw-duration:.5s;transition-duration:.5s}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[state\\=open\\]\\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y:100%}.data-\\[state\\=open\\]\\:slide-in-from-left[data-state=open]{--tw-enter-translate-x:-100%}.data-\\[state\\=open\\]\\:slide-in-from-right[data-state=open]{--tw-enter-translate-x:100%}.data-\\[state\\=open\\]\\:slide-in-from-top[data-state=open]{--tw-enter-translate-y:-100%}.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{background-color:var(--input)}.data-\\[variant\\=destructive\\]\\:text-destructive[data-variant=destructive]{color:var(--destructive)}.data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/10[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive)10%,transparent)}}.data-\\[variant\\=destructive\\]\\:focus\\:text-destructive[data-variant=destructive]:focus{color:var(--destructive)}@media(min-width:40rem){.sm\\:max-w-\\[550px\\]{max-width:550px}.sm\\:max-w-lg{max-width:var(--container-lg)}.sm\\:max-w-sm{max-width:var(--container-sm)}.sm\\:flex-row{flex-direction:row}.sm\\:justify-end{justify-content:flex-end}.sm\\:text-left{text-align:left}}@media(min-width:48rem){.md\\:flex-row{flex-direction:row}.md\\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.dark\\:border-input:is(.dark *){border-color:var(--input)}.dark\\:bg-blue-600:is(.dark *){background-color:var(--color-blue-600)}.dark\\:bg-destructive\\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\\:bg-destructive\\/60:is(.dark *){background-color:color-mix(in oklab,var(--destructive)60%,transparent)}}.dark\\:bg-green-900\\/20:is(.dark *){background-color:#0d542b33}@supports (color:color-mix(in lab,red,red)){.dark\\:bg-green-900\\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-green-900)20%,transparent)}}.dark\\:bg-input\\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\\:bg-input\\/30:is(.dark *){background-color:color-mix(in oklab,var(--input)30%,transparent)}}.dark\\:bg-red-900\\/20:is(.dark *){background-color:#82181a33}@supports (color:color-mix(in lab,red,red)){.dark\\:bg-red-900\\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-red-900)20%,transparent)}}.dark\\:text-green-300:is(.dark *){color:var(--color-green-300)}.dark\\:text-red-300:is(.dark *){color:var(--color-red-300)}.dark\\:\\[color-scheme\\:dark\\]:is(.dark *){color-scheme:dark}@media(hover:hover){.dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent)50%,transparent)}}.dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input)50%,transparent)}}.dark\\:hover\\:text-accent-foreground:is(.dark *):hover{color:var(--accent-foreground)}}.dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\\:data-\\[state\\=checked\\]\\:bg-primary:is(.dark *)[data-state=checked]{background-color:var(--primary)}.dark\\:data-\\[state\\=checked\\]\\:bg-primary-foreground:is(.dark *)[data-state=checked]{background-color:var(--primary-foreground)}.dark\\:data-\\[state\\=unchecked\\]\\:bg-foreground:is(.dark *)[data-state=unchecked]{background-color:var(--foreground)}.dark\\:data-\\[state\\=unchecked\\]\\:bg-input\\/80:is(.dark *)[data-state=unchecked]{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\\:data-\\[state\\=unchecked\\]\\:bg-input\\/80:is(.dark *)[data-state=unchecked]{background-color:color-mix(in oklab,var(--input)80%,transparent)}}.dark\\:data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/20:is(.dark *)[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\\:data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/20:is(.dark *)[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing)*2)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:py-1\\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing)*1.5)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-muted-foreground [cmdk-group-heading]{color:var(--muted-foreground)}.\\[\\&_\\[cmdk-group\\]\\]\\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing)*2)}.\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:calc(var(--spacing)*0)}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing)*5)}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing)*5)}.\\[\\&_\\[cmdk-input\\]\\]\\:h-12 [cmdk-input]{height:calc(var(--spacing)*12)}.\\[\\&_\\[cmdk-item\\]\\]\\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing)*2)}.\\[\\&_\\[cmdk-item\\]\\]\\:py-3 [cmdk-item]{padding-block:calc(var(--spacing)*3)}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:h-5 [cmdk-item] svg{height:calc(var(--spacing)*5)}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:w-5 [cmdk-item] svg{width:calc(var(--spacing)*5)}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'text-\\'\\]\\)\\]\\:text-muted-foreground svg:not([class*=text-]){color:var(--muted-foreground)}.\\[\\&\\:first-child\\[data-selected\\=true\\]_button\\]\\:rounded-l-md:first-child[data-selected=true] button{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}:is(.rtl\\:\\*\\*\\:\\[\\.rdp-button\\\\_next\\>svg\\]\\:rotate-180:where(:dir(rtl),[dir=rtl],[dir=rtl] *) *):is(.rdp-button_next>svg),:is(.rtl\\:\\*\\*\\:\\[\\.rdp-button\\\\_previous\\>svg\\]\\:rotate-180:where(:dir(rtl),[dir=rtl],[dir=rtl] *) *):is(.rdp-button_previous>svg){rotate:180deg}:is(.\\*\\:\\[span\\]\\:last\\:flex>*):is(span):last-child{display:flex}:is(.\\*\\:\\[span\\]\\:last\\:items-center>*):is(span):last-child{align-items:center}:is(.\\*\\:\\[span\\]\\:last\\:gap-2>*):is(span):last-child{gap:calc(var(--spacing)*2)}:is(.data-\\[variant\\=destructive\\]\\:\\*\\:\\[svg\\]\\:\\!text-destructive[data-variant=destructive]>*):is(svg){color:var(--destructive)!important}.\\[\\&\\:last-child\\[data-selected\\=true\\]_button\\]\\:rounded-r-md:last-child[data-selected=true] button{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\\[\\&\\>span\\]\\:text-xs>span{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\\[\\&\\>span\\]\\:opacity-70>span{opacity:.7}.\\[\\&\\>svg\\]\\:pointer-events-none>svg{pointer-events:none}.\\[\\&\\>svg\\]\\:size-3>svg{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.\\[\\&\\>svg\\]\\:size-3\\.5>svg{width:calc(var(--spacing)*3.5);height:calc(var(--spacing)*3.5)}.\\[\\&\\>svg\\]\\:text-muted-foreground>svg{color:var(--muted-foreground)}[data-slot=card-content] .\\[\\[data-slot\\=card-content\\]_\\&\\]\\:bg-transparent,[data-slot=popover-content] .\\[\\[data-slot\\=popover-content\\]_\\&\\]\\:bg-transparent{background-color:#0000}@media(hover:hover){a.\\[a\\&\\]\\:hover\\:bg-accent:hover{background-color:var(--accent)}a.\\[a\\&\\]\\:hover\\:bg-destructive\\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){a.\\[a\\&\\]\\:hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}a.\\[a\\&\\]\\:hover\\:bg-primary\\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){a.\\[a\\&\\]\\:hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}a.\\[a\\&\\]\\:hover\\:bg-secondary\\/90:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){a.\\[a\\&\\]\\:hover\\:bg-secondary\\/90:hover{background-color:color-mix(in oklab,var(--secondary)90%,transparent)}}a.\\[a\\&\\]\\:hover\\:text-accent-foreground:hover{color:var(--accent-foreground)}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--radius:.625rem;--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(55.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--destructive:oklch(57.7% .245 27.325);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--chart-1:oklch(64.6% .222 41.116);--chart-2:oklch(60% .118 184.704);--chart-3:oklch(39.8% .07 227.392);--chart-4:oklch(82.8% .189 84.429);--chart-5:oklch(76.9% .188 70.08);--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:oklch(20.5% 0 0);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0)}.dark{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0)}:root{--node-width:280px;--node-height:150px;--node-border-radius:40px;--treege-color-primary:#13d3b4;--treege-color-tertiary:#0065a8;--treege-color-secondary:#007ff6;--treege-color-submit-primary:#ff4757;--treege-color-submit-secondary:#ff6b81;--treege-color-submit-tertiary:#ee5a6f}button{cursor:pointer;-webkit-user-select:none;user-select:none}#root{width:100vw;height:100vh}div.react-flow__node{border:0}div.react-flow__node__wrapper{padding:calc(var(--spacing)*7);width:270px;height:150px;box-shadow:0 0 20px 6px oklch(from var(--treege-color-primary)l c h/10%),0 0 20px oklch(from var(--treege-color-tertiary)l c h/10%);background:linear-gradient(oklch(from var(--color-card)l c h/33%),oklch(from var(--color-card)l c h/33%))padding-box,linear-gradient(145deg,oklch(from var(--treege-color-primary)l c h/40%),#0000,oklch(from var(--treege-color-secondary)l c h/40%))border-box;border:3px solid #0000;border-radius:40px;flex-direction:column;justify-content:center;display:flex}div.react-flow__node__wrapper.in-group{background:linear-gradient(oklch(from var(--color-card)l c h/33%),oklch(from var(--color-card)l c h/33%))padding-box,linear-gradient(145deg,oklch(from var(--color-chart-2)l c h/33%),#0000,oklch(from var(--color-chart-2)l c h/33%))border-box}div.react-flow__node.selected .react-flow__node__wrapper{box-shadow:0 0 20px 6px oklch(from var(--treege-color-primary)l c h/30%),0 0 20px oklch(from var(--treege-color-tertiary)l c h/30%)}div.react-flow__node__wrapper.submit-type{box-shadow:0 0 20px 6px oklch(from var(--treege-color-submit-primary)l c h/10%),0 0 20px oklch(from var(--treege-color-submit-tertiary)l c h/10%);background:linear-gradient(oklch(from var(--color-card)l c h/33%),oklch(from var(--color-card)l c h/33%))padding-box,linear-gradient(145deg,oklch(from var(--treege-color-submit-primary)l c h/40%),#0000,oklch(from var(--treege-color-submit-secondary)l c h/40%))border-box}div.react-flow__node.selected .react-flow__node__wrapper.submit-type{box-shadow:0 0 20px 6px oklch(from var(--treege-color-submit-primary)l c h/30%),0 0 20px oklch(from var(--treege-color-submit-tertiary)l c h/30%)}div.react-flow__node-group,div.react-flow__node-group.selected{background:oklch(from var(--color-chart-2)l c h/5%);box-shadow:none;border:3px dashed var(--color-chart-2)}div.react-flow__node-group .react-flow__resize-control{opacity:0;padding:4px;transition:opacity .2s}div.react-flow__node-group:hover .react-flow__resize-control,.react-flow__resize-control:hover{opacity:1}div.react-flow__handle{background-color:var(--muted-foreground);height:calc(var(--spacing)*6);width:calc(var(--spacing)*6);cursor:pointer;border-radius:calc(var(--radius) - 4px);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));justify-content:center;align-items:center;display:flex}@media(hover:hover){div.react-flow__handle:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){div.react-flow__handle:hover{background-color:color-mix(in oklab,var(--primary)80%,transparent)}}}path.react-flow__edge-path{stroke:var(--muted-foreground)}.button-edge__label{pointer-events:all;transform-origin:50%;position:absolute}.button-edge__button{border:5px solid var(--xy-minimap-background-color-default);background-color:var(--color-ring);width:30px;height:30px;color:var(--primary);cursor:pointer;border-radius:50%;padding-top:0;font-size:12px}.button-edge__button:hover{background-color:var(--destructive);color:#fff}.w-tc-editor{border-radius:calc(var(--radius) - 2px);border-style:var(--tw-border-style);border-width:1px;border-color:var(--input);background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.w-tc-editor{background-color:color-mix(in oklab,var(--input)30%,transparent)}}.w-tc-editor:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.w-tc-editor:is(.dark *){background-color:color-mix(in oklab,var(--input)30%,transparent)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@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));filter:blur(var(--tw-enter-blur,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));filter:blur(var(--tw-exit-blur,0))}}`)),document.head.appendChild(r)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
+ import { j as e, i as je, e as dt, s as k, P as Oe, p as Me, B as S, q as Le, F as N, f as j, I as D, o as M, t as ct, S as _, w as R, x as Z, y as K, A as y, L as oe, N as ye, E as Ge, z as te, c as Se, D as J, C as ut, r as ht, h as mt, k as pt, l as _e, m as Ve, H as Be, v as We, a as xt, b as gt, G as jt, T as Ct } from "./ThemeContext-BIT4DHqC.js";
3
+ import { useNodes as $e, useEdges as Je, getBezierPath as qe, useReactFlow as ue, BaseEdge as Xe, EdgeLabelRenderer as Qe, addEdge as vt, Handle as ie, Position as de, NodeResizer as ft, Panel as bt, ReactFlowProvider as Nt, ReactFlow as yt, Background as wt, BackgroundVariant as Ft, MiniMap as St, Controls as Et } from "@xyflow/react";
4
+ import { useForm as ne } from "@tanstack/react-form";
5
+ import { Waypoints as Dt, X as se, Plus as X, Network as kt, Boxes as Pt, Type as et, LucidePencilRuler as Tt, XIcon as tt, WandSparkles as Re, Loader2 as At, Save as Vt, EllipsisVertical as It, Copy as Ot, Download as Mt, ArrowRightFromLine as Lt, Trash2 as at, Variable as we, ChevronsUpDown as re, Check as Gt, PlusCircle as Bt } from "lucide-react";
6
+ import { useMemo as le, createContext as $t, useContext as zt, useState as z, memo as he, useCallback as $, useRef as Ht, useEffect as Ut, useId as Fe } from "react";
7
+ import * as Ce from "@radix-ui/react-scroll-area";
8
+ import { Slot as _t } from "@radix-ui/react-slot";
9
+ import { cva as Rt } from "class-variance-authority";
10
+ import { toast as U, Toaster as Zt } from "sonner";
11
+ import * as L from "@radix-ui/react-dialog";
12
+ import * as ae from "@radix-ui/react-dropdown-menu";
13
+ import * as ze from "@radix-ui/react-collapsible";
14
+ import * as Q from "@radix-ui/react-alert-dialog";
15
+ import { useTheme as Kt } from "next-themes";
16
+ const Yt = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%200%20462%20144'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1809_3434)'%3e%3cpath%20d='M137%2041.34L116.57%206C116.22%205.39399%20115.717%204.89037%20115.112%204.53942C114.507%204.18847%20113.82%204.00247%20113.12%204H38.83C38.1303%204.00247%2037.4434%204.18847%2036.838%204.53942C36.2326%204.89037%2035.7299%205.39399%2035.38%206L15%2041.34C14.6495%2041.947%2014.4647%2042.6355%2014.4641%2043.3365C14.4635%2044.0374%2014.6471%2044.7262%2014.9965%2045.3339C15.3459%2045.9416%2015.8488%2046.4467%2016.455%2046.7988C17.0611%2047.1509%2017.7491%2047.3375%2018.45%2047.34H133.53C134.233%2047.341%20134.923%2047.157%20135.532%2046.8063C136.141%2046.4557%20136.647%2045.9508%20136.999%2045.3426C137.35%2044.7343%20137.536%2044.0441%20137.536%2043.3415C137.536%2042.6388%20137.351%2041.9485%20137%2041.34V41.34Z'%20fill='%2311D3B4'/%3e%3cpath%20d='M92.48%20140.64H113.1C113.805%20140.643%20114.498%20140.459%20115.109%20140.108C115.72%20139.757%20116.228%20139.251%20116.58%20138.64L151.39%2078.3401C151.741%2077.7316%20151.926%2077.0413%20151.926%2076.3386C151.926%2075.636%20151.74%2074.9458%20151.389%2074.3375C151.037%2073.7293%20150.531%2073.2244%20149.922%2072.8738C149.313%2072.5231%20148.623%2072.3391%20147.92%2072.3401H92.48C91.4191%2072.3401%2090.4017%2072.7615%2089.6516%2073.5117C88.9014%2074.2618%2088.48%2075.2792%2088.48%2076.3401V136.64C88.48%20137.701%2088.9014%20138.718%2089.6516%20139.469C90.4017%20140.219%2091.4191%20140.64%2092.48%20140.64Z'%20fill='%23007EF6'/%3e%3cpath%20d='M59.48%2072.3201H3.99999C3.29819%2072.3208%202.60893%2072.5061%202.00143%2072.8575C1.39392%2073.2089%200.88955%2073.7139%200.538962%2074.3218C0.188375%2074.9298%200.00390931%2075.6193%200.00408949%2076.3211C0.00426966%2077.0229%200.189089%2077.7123%200.539989%2078.3201L35.38%20138.66C35.7299%20139.266%2036.2326%20139.77%2036.838%20140.121C37.4434%20140.472%2038.1302%20140.658%2038.83%20140.66H59.48C60.5409%20140.66%2061.5583%20140.239%2062.3084%20139.489C63.0586%20138.738%2063.48%20137.721%2063.48%20136.66V76.3101C63.4773%2075.2509%2063.0547%2074.2361%2062.3049%2073.4881C61.555%2072.7401%2060.5391%2072.3201%2059.48%2072.3201V72.3201Z'%20fill='%230164A8'/%3e%3c/g%3e%3cpath%20d='M207.52%20106.96C202.272%20106.96%20198.368%20105.584%20195.808%20102.832C193.312%20100.08%20192.064%2096.336%20192.064%2091.6V70.48H185.632V60.496H192.064V50.704L205.024%2046.864V60.496H216.544L215.776%2070.48H205.024V90.736C205.024%2093.232%20205.6%2094.96%20206.752%2095.92C207.904%2096.816%20209.696%2097.264%20212.128%2097.264C213.92%2097.264%20215.776%2096.944%20217.696%2096.304V105.232C216.288%20105.808%20214.752%20106.224%20213.088%20106.48C211.424%20106.8%20209.568%20106.96%20207.52%20106.96ZM224.347%20106V60.496H236.347L236.923%2065.2C238.971%2063.92%20241.499%2062.768%20244.507%2061.744C247.579%2060.656%20250.587%2059.92%20253.531%2059.536V69.328C251.803%2069.584%20249.915%2069.968%20247.867%2070.48C245.819%2070.992%20243.867%2071.568%20242.011%2072.208C240.155%2072.848%20238.587%2073.52%20237.307%2074.224V106H224.347ZM281.997%20106.96C274.125%20106.96%20267.885%20105.008%20263.277%20101.104C258.669%2097.136%20256.365%2091.152%20256.365%2083.152C256.365%2075.92%20258.285%2070.192%20262.125%2065.968C266.029%2061.68%20271.821%2059.536%20279.501%2059.536C286.541%2059.536%20291.917%2061.392%20295.629%2065.104C299.405%2068.752%20301.292%2073.552%20301.292%2079.504V87.76H268.365C269.069%2091.408%20270.733%2093.904%20273.357%2095.248C276.045%2096.592%20279.821%2097.264%20284.685%2097.264C287.117%2097.264%20289.581%2097.04%20292.077%2096.592C294.637%2096.144%20296.813%2095.568%20298.605%2094.864V104.08C296.493%20105.04%20294.029%20105.744%20291.213%20106.192C288.397%20106.704%20285.325%20106.96%20281.997%20106.96ZM268.365%2079.792H289.965V77.296C289.965%2074.672%20289.197%2072.624%20287.661%2071.152C286.125%2069.616%20283.533%2068.848%20279.885%2068.848C275.597%2068.848%20272.589%2069.712%20270.861%2071.44C269.197%2073.168%20268.365%2075.952%20268.365%2079.792ZM334.028%20106.96C326.156%20106.96%20319.916%20105.008%20315.308%20101.104C310.7%2097.136%20308.396%2091.152%20308.396%2083.152C308.396%2075.92%20310.316%2070.192%20314.156%2065.968C318.06%2061.68%20323.852%2059.536%20331.532%2059.536C338.572%2059.536%20343.948%2061.392%20347.66%2065.104C351.436%2068.752%20353.324%2073.552%20353.324%2079.504V87.76H320.396C321.1%2091.408%20322.764%2093.904%20325.388%2095.248C328.076%2096.592%20331.852%2097.264%20336.716%2097.264C339.148%2097.264%20341.612%2097.04%20344.108%2096.592C346.668%2096.144%20348.844%2095.568%20350.636%2094.864V104.08C348.524%20105.04%20346.06%20105.744%20343.244%20106.192C340.428%20106.704%20337.356%20106.96%20334.028%20106.96ZM320.396%2079.792H341.996V77.296C341.996%2074.672%20341.228%2072.624%20339.692%2071.152C338.156%2069.616%20335.564%2068.848%20331.916%2068.848C327.628%2068.848%20324.62%2069.712%20322.892%2071.44C321.228%2073.168%20320.396%2075.952%20320.396%2079.792ZM381.547%20122.896C378.155%20122.896%20374.667%20122.672%20371.083%20122.224C367.563%20121.776%20364.587%20121.136%20362.155%20120.304V110.608C364.715%20111.44%20367.723%20112.08%20371.179%20112.528C374.635%20113.04%20377.867%20113.296%20380.875%20113.296C385.291%20113.296%20388.491%20113.04%20390.475%20112.528C392.459%20112.08%20393.451%20111.248%20393.451%20110.032C393.451%20109.008%20393.003%20108.304%20392.107%20107.92C391.275%20107.536%20389.483%20107.344%20386.731%20107.344H374.347C366.219%20107.344%20362.155%20104.336%20362.155%2098.32C362.155%2096.464%20362.667%2094.768%20363.691%2093.232C364.715%2091.696%20366.347%2090.48%20368.587%2089.584C363.403%2086.96%20360.811%2082.544%20360.811%2076.336C360.811%2070.448%20362.635%2066.192%20366.283%2063.568C369.931%2060.88%20375.339%2059.536%20382.507%2059.536C383.979%2059.536%20385.579%2059.664%20387.307%2059.92C389.099%2060.112%20390.443%2060.304%20391.339%2060.496H408.427L408.139%2068.656H400.939C402.923%2070.512%20403.915%2073.104%20403.915%2076.432C403.915%2081.104%20402.443%2084.848%20399.499%2087.664C396.555%2090.416%20392.203%2091.792%20386.443%2091.792C385.419%2091.792%20384.427%2091.76%20383.467%2091.696C382.571%2091.568%20381.643%2091.44%20380.683%2091.312C378.763%2091.568%20377.131%2092.016%20375.787%2092.656C374.507%2093.296%20373.867%2094.16%20373.867%2095.248C373.867%2096.72%20375.179%2097.456%20377.803%2097.456H390.667C395.275%2097.456%20398.827%2098.512%20401.323%20100.624C403.819%20102.672%20405.067%20105.68%20405.067%20109.648C405.067%20114.128%20403.051%20117.456%20399.019%20119.632C394.987%20121.808%20389.163%20122.896%20381.547%20122.896ZM382.603%2084.496C386.443%2084.496%20389.099%2083.856%20390.571%2082.576C392.107%2081.232%20392.875%2078.992%20392.875%2075.856C392.875%2072.72%20392.107%2070.448%20390.571%2069.04C389.099%2067.632%20386.443%2066.928%20382.603%2066.928C378.955%2066.928%20376.331%2067.632%20374.731%2069.04C373.131%2070.384%20372.331%2072.656%20372.331%2075.856C372.331%2078.8%20373.067%2080.976%20374.539%2082.384C376.075%2083.792%20378.763%2084.496%20382.603%2084.496ZM439.028%20106.96C431.156%20106.96%20424.916%20105.008%20420.308%20101.104C415.7%2097.136%20413.396%2091.152%20413.396%2083.152C413.396%2075.92%20415.316%2070.192%20419.156%2065.968C423.06%2061.68%20428.852%2059.536%20436.532%2059.536C443.572%2059.536%20448.948%2061.392%20452.66%2065.104C456.436%2068.752%20458.324%2073.552%20458.324%2079.504V87.76H425.396C426.1%2091.408%20427.764%2093.904%20430.388%2095.248C433.076%2096.592%20436.852%2097.264%20441.716%2097.264C444.148%2097.264%20446.612%2097.04%20449.108%2096.592C451.668%2096.144%20453.844%2095.568%20455.636%2094.864V104.08C453.524%20105.04%20451.06%20105.744%20448.244%20106.192C445.428%20106.704%20442.356%20106.96%20439.028%20106.96ZM425.396%2079.792H446.996V77.296C446.996%2074.672%20446.228%2072.624%20444.692%2071.152C443.156%2069.616%20440.564%2068.848%20436.916%2068.848C432.628%2068.848%20429.62%2069.712%20427.892%2071.44C426.228%2073.168%20425.396%2075.952%20425.396%2079.792Z'%20fill='black'/%3e%3cdefs%3e%3cclipPath%20id='clip0_1809_3434'%3e%3crect%20width='151.93'%20height='136.64'%20fill='white'%20transform='translate(0%204)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", Wt = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%200%20462%20144'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2_65)'%3e%3cpath%20d='M137%2041.34L116.57%206C116.22%205.39399%20115.717%204.89037%20115.112%204.53942C114.507%204.18847%20113.82%204.00247%20113.12%204H38.83C38.1302%204.00247%2037.4434%204.18847%2036.838%204.53942C36.2326%204.89037%2035.7299%205.39399%2035.38%206L15%2041.34C14.6495%2041.947%2014.4647%2042.6355%2014.4641%2043.3365C14.4635%2044.0374%2014.6471%2044.7262%2014.9965%2045.3339C15.3459%2045.9416%2015.8488%2046.4467%2016.4549%2046.7988C17.061%2047.1509%2017.749%2047.3375%2018.45%2047.34H133.53C134.233%2047.341%20134.923%2047.157%20135.532%2046.8063C136.141%2046.4557%20136.647%2045.9508%20136.999%2045.3426C137.35%2044.7343%20137.536%2044.0441%20137.536%2043.3415C137.536%2042.6388%20137.351%2041.9485%20137%2041.34Z'%20fill='%2311D3B4'/%3e%3cpath%20d='M92.48%20140.64H113.1C113.805%20140.643%20114.498%20140.459%20115.109%20140.108C115.72%20139.757%20116.228%20139.25%20116.58%20138.64L151.39%2078.34C151.741%2077.7315%20151.926%2077.0412%20151.926%2076.3385C151.926%2075.6359%20151.74%2074.9457%20151.389%2074.3374C151.037%2073.7292%20150.531%2073.2243%20149.922%2072.8737C149.313%2072.523%20148.623%2072.339%20147.92%2072.34H92.48C91.4191%2072.34%2090.4017%2072.7614%2089.6516%2073.5116C88.9014%2074.2617%2088.48%2075.2791%2088.48%2076.34V136.64C88.48%20137.701%2088.9014%20138.718%2089.6516%20139.468C90.4017%20140.219%2091.4191%20140.64%2092.48%20140.64Z'%20fill='%23007EF6'/%3e%3cpath%20d='M59.48%2072.32H4C3.2982%2072.3207%202.60894%2072.5061%202.00143%2072.8574C1.39393%2073.2088%200.889558%2073.7138%200.53897%2074.3218C0.188382%2074.9297%200.00391694%2075.6192%200.00409712%2076.321C0.00427729%2077.0228%200.189097%2077.7122%200.539997%2078.32L35.38%20138.66C35.7299%20139.266%2036.2326%20139.77%2036.838%20140.121C37.4434%20140.472%2038.1302%20140.658%2038.83%20140.66H59.48C60.5409%20140.66%2061.5583%20140.239%2062.3084%20139.488C63.0586%20138.738%2063.48%20137.721%2063.48%20136.66V76.31C63.4773%2075.2509%2063.0548%2074.236%2062.3049%2073.488C61.555%2072.7401%2060.5391%2072.32%2059.48%2072.32Z'%20fill='%230164A8'/%3e%3c/g%3e%3cpath%20d='M207.52%20106.96C202.272%20106.96%20198.368%20105.584%20195.808%20102.832C193.312%20100.08%20192.064%2096.336%20192.064%2091.6V70.48H185.632V60.496H192.064V50.704L205.024%2046.864V60.496H216.544L215.776%2070.48H205.024V90.736C205.024%2093.232%20205.6%2094.96%20206.752%2095.92C207.904%2096.816%20209.696%2097.264%20212.128%2097.264C213.92%2097.264%20215.776%2096.944%20217.696%2096.304V105.232C216.288%20105.808%20214.752%20106.224%20213.088%20106.48C211.424%20106.8%20209.568%20106.96%20207.52%20106.96ZM224.347%20106V60.496H236.347L236.923%2065.2C238.971%2063.92%20241.499%2062.768%20244.507%2061.744C247.579%2060.656%20250.587%2059.92%20253.531%2059.536V69.328C251.803%2069.584%20249.915%2069.968%20247.867%2070.48C245.819%2070.992%20243.867%2071.568%20242.011%2072.208C240.155%2072.848%20238.587%2073.52%20237.307%2074.224V106H224.347ZM281.997%20106.96C274.125%20106.96%20267.885%20105.008%20263.277%20101.104C258.669%2097.136%20256.365%2091.152%20256.365%2083.152C256.365%2075.92%20258.285%2070.192%20262.125%2065.968C266.029%2061.68%20271.821%2059.536%20279.501%2059.536C286.541%2059.536%20291.917%2061.392%20295.629%2065.104C299.405%2068.752%20301.292%2073.552%20301.292%2079.504V87.76H268.365C269.069%2091.408%20270.733%2093.904%20273.357%2095.248C276.045%2096.592%20279.821%2097.264%20284.685%2097.264C287.117%2097.264%20289.581%2097.04%20292.077%2096.592C294.637%2096.144%20296.813%2095.568%20298.605%2094.864V104.08C296.493%20105.04%20294.029%20105.744%20291.213%20106.192C288.397%20106.704%20285.325%20106.96%20281.997%20106.96ZM268.365%2079.792H289.965V77.296C289.965%2074.672%20289.197%2072.624%20287.661%2071.152C286.125%2069.616%20283.533%2068.848%20279.885%2068.848C275.597%2068.848%20272.589%2069.712%20270.861%2071.44C269.197%2073.168%20268.365%2075.952%20268.365%2079.792ZM334.028%20106.96C326.156%20106.96%20319.916%20105.008%20315.308%20101.104C310.7%2097.136%20308.396%2091.152%20308.396%2083.152C308.396%2075.92%20310.316%2070.192%20314.156%2065.968C318.06%2061.68%20323.852%2059.536%20331.532%2059.536C338.572%2059.536%20343.948%2061.392%20347.66%2065.104C351.436%2068.752%20353.324%2073.552%20353.324%2079.504V87.76H320.396C321.1%2091.408%20322.764%2093.904%20325.388%2095.248C328.076%2096.592%20331.852%2097.264%20336.716%2097.264C339.148%2097.264%20341.612%2097.04%20344.108%2096.592C346.668%2096.144%20348.844%2095.568%20350.636%2094.864V104.08C348.524%20105.04%20346.06%20105.744%20343.244%20106.192C340.428%20106.704%20337.356%20106.96%20334.028%20106.96ZM320.396%2079.792H341.996V77.296C341.996%2074.672%20341.228%2072.624%20339.692%2071.152C338.156%2069.616%20335.564%2068.848%20331.916%2068.848C327.628%2068.848%20324.62%2069.712%20322.892%2071.44C321.228%2073.168%20320.396%2075.952%20320.396%2079.792ZM381.547%20122.896C378.155%20122.896%20374.667%20122.672%20371.083%20122.224C367.563%20121.776%20364.587%20121.136%20362.155%20120.304V110.608C364.715%20111.44%20367.723%20112.08%20371.179%20112.528C374.635%20113.04%20377.867%20113.296%20380.875%20113.296C385.291%20113.296%20388.491%20113.04%20390.475%20112.528C392.459%20112.08%20393.451%20111.248%20393.451%20110.032C393.451%20109.008%20393.003%20108.304%20392.107%20107.92C391.275%20107.536%20389.483%20107.344%20386.731%20107.344H374.347C366.219%20107.344%20362.155%20104.336%20362.155%2098.32C362.155%2096.464%20362.667%2094.768%20363.691%2093.232C364.715%2091.696%20366.347%2090.48%20368.587%2089.584C363.403%2086.96%20360.811%2082.544%20360.811%2076.336C360.811%2070.448%20362.635%2066.192%20366.283%2063.568C369.931%2060.88%20375.339%2059.536%20382.507%2059.536C383.979%2059.536%20385.579%2059.664%20387.307%2059.92C389.099%2060.112%20390.443%2060.304%20391.339%2060.496H408.427L408.139%2068.656H400.939C402.923%2070.512%20403.915%2073.104%20403.915%2076.432C403.915%2081.104%20402.443%2084.848%20399.499%2087.664C396.555%2090.416%20392.203%2091.792%20386.443%2091.792C385.419%2091.792%20384.427%2091.76%20383.467%2091.696C382.571%2091.568%20381.643%2091.44%20380.683%2091.312C378.763%2091.568%20377.131%2092.016%20375.787%2092.656C374.507%2093.296%20373.867%2094.16%20373.867%2095.248C373.867%2096.72%20375.179%2097.456%20377.803%2097.456H390.667C395.275%2097.456%20398.827%2098.512%20401.323%20100.624C403.819%20102.672%20405.067%20105.68%20405.067%20109.648C405.067%20114.128%20403.051%20117.456%20399.019%20119.632C394.987%20121.808%20389.163%20122.896%20381.547%20122.896ZM382.603%2084.496C386.443%2084.496%20389.099%2083.856%20390.571%2082.576C392.107%2081.232%20392.875%2078.992%20392.875%2075.856C392.875%2072.72%20392.107%2070.448%20390.571%2069.04C389.099%2067.632%20386.443%2066.928%20382.603%2066.928C378.955%2066.928%20376.331%2067.632%20374.731%2069.04C373.131%2070.384%20372.331%2072.656%20372.331%2075.856C372.331%2078.8%20373.067%2080.976%20374.539%2082.384C376.075%2083.792%20378.763%2084.496%20382.603%2084.496ZM439.028%20106.96C431.156%20106.96%20424.916%20105.008%20420.308%20101.104C415.7%2097.136%20413.396%2091.152%20413.396%2083.152C413.396%2075.92%20415.316%2070.192%20419.156%2065.968C423.06%2061.68%20428.852%2059.536%20436.532%2059.536C443.572%2059.536%20448.948%2061.392%20452.66%2065.104C456.436%2068.752%20458.324%2073.552%20458.324%2079.504V87.76H425.396C426.1%2091.408%20427.764%2093.904%20430.388%2095.248C433.076%2096.592%20436.852%2097.264%20441.716%2097.264C444.148%2097.264%20446.612%2097.04%20449.108%2096.592C451.668%2096.144%20453.844%2095.568%20455.636%2094.864V104.08C453.524%20105.04%20451.06%20105.744%20448.244%20106.192C445.428%20106.704%20442.356%20106.96%20439.028%20106.96ZM425.396%2079.792H446.996V77.296C446.996%2074.672%20446.228%2072.624%20444.692%2071.152C443.156%2069.616%20440.564%2068.848%20436.916%2068.848C432.628%2068.848%20429.62%2069.712%20427.892%2071.44C426.228%2073.168%20425.396%2075.952%20425.396%2079.792Z'%20fill='white'/%3e%3cdefs%3e%3cclipPath%20id='clip0_2_65'%3e%3crect%20width='151.93'%20height='136.64'%20fill='white'%20transform='translate(0%204)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", Jt = ({ theme: t = "dark" }) => /* @__PURE__ */ e.jsx("div", { className: "absolute top-5 left-5 z-50 select-none", children: /* @__PURE__ */ e.jsx(
17
+ "img",
18
+ {
19
+ src: t === "dark" ? Wt : Yt,
20
+ alt: "Treege",
21
+ className: "relative h-14 w-auto drop-shadow-[0_0px_35px] drop-shadow-blue-600"
22
+ }
23
+ ) }), Ee = (t) => {
24
+ const s = $e(), l = Je();
25
+ return le(() => {
26
+ if (!t)
27
+ return [];
28
+ const i = (o, n = /* @__PURE__ */ new Set()) => {
29
+ if (n.has(o))
30
+ return [];
31
+ const f = new Set(n).add(o);
32
+ return l.filter((c) => c.target === o).flatMap((c) => [c.source, ...i(c.source, f)]);
33
+ }, h = i(t);
34
+ return s.filter((o) => h.includes(o.id) && je(o)).map((o) => {
35
+ const n = o.data;
36
+ return {
37
+ label: (typeof n.label == "object" ? n.label.en : n.label) || n.name || o.id,
38
+ name: n.name,
39
+ nodeId: o.id,
40
+ type: n.type || "text"
41
+ };
42
+ });
43
+ }, [t, s, l]);
44
+ }, st = $t(null), qt = ({ children: t, value: s }) => {
45
+ const [l, i] = z(s?.flowId), h = le(
46
+ () => ({
47
+ ...s,
48
+ ...s?.aiConfig && {
49
+ aiConfig: {
50
+ ...s.aiConfig,
51
+ provider: s?.aiConfig.provider ?? "gemini"
52
+ }
53
+ },
54
+ flowId: l,
55
+ setFlowId: i
56
+ }),
57
+ [l, s]
58
+ );
59
+ return /* @__PURE__ */ e.jsx(st.Provider, { value: h, children: t });
60
+ }, nt = () => zt(st) ?? {
61
+ flowId: void 0,
62
+ language: "en",
63
+ setFlowId: () => {
64
+ }
65
+ }, G = (t) => {
66
+ const l = nt().language;
67
+ return dt(l);
68
+ };
69
+ function ot({ className: t, children: s, ...l }) {
70
+ return /* @__PURE__ */ e.jsxs(Ce.Root, { "data-slot": "scroll-area", className: k("relative", t), ...l, children: [
71
+ /* @__PURE__ */ e.jsx(
72
+ Ce.Viewport,
73
+ {
74
+ "data-slot": "scroll-area-viewport",
75
+ className: "size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:outline-1 focus-visible:ring-[3px] focus-visible:ring-ring/50",
76
+ children: s
77
+ }
78
+ ),
79
+ /* @__PURE__ */ e.jsx(Xt, {}),
80
+ /* @__PURE__ */ e.jsx(Ce.Corner, {})
81
+ ] });
82
+ }
83
+ function Xt({
84
+ className: t,
85
+ orientation: s = "vertical",
86
+ ...l
87
+ }) {
88
+ return /* @__PURE__ */ e.jsx(
89
+ Ce.ScrollAreaScrollbar,
90
+ {
91
+ "data-slot": "scroll-area-scrollbar",
92
+ orientation: s,
93
+ className: k(
94
+ "flex touch-none select-none p-px transition-colors",
95
+ s === "vertical" && "h-full w-2.5 border-l border-l-transparent",
96
+ s === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
97
+ t
98
+ ),
99
+ ...l,
100
+ children: /* @__PURE__ */ e.jsx(Ce.ScrollAreaThumb, { "data-slot": "scroll-area-thumb", className: "relative flex-1 rounded-full bg-border" })
101
+ }
102
+ );
103
+ }
104
+ const Qt = ({
105
+ id: t,
106
+ target: s,
107
+ sourceX: l,
108
+ sourceY: i,
109
+ targetX: h,
110
+ targetY: o,
111
+ sourcePosition: n,
112
+ targetPosition: f,
113
+ markerEnd: d,
114
+ style: c,
115
+ data: a
116
+ }) => {
117
+ const [r, u, m] = qe({
118
+ sourcePosition: n,
119
+ sourceX: l,
120
+ sourceY: i,
121
+ targetPosition: f,
122
+ targetX: h,
123
+ targetY: o
124
+ }), [p, x] = z(!1), { updateEdgeData: F } = ue(), g = Ee(s), w = a?.conditions && a.conditions.length > 0, C = G(), { handleSubmit: I, reset: b, Field: E } = ne({
125
+ defaultValues: {
126
+ conditions: a?.conditions || [{ field: g[0]?.nodeId ?? "", operator: "===", value: "" }],
127
+ isFallback: !!a?.isFallback,
128
+ label: a?.label || ""
129
+ },
130
+ listeners: {
131
+ onChange: ({ formApi: v }) => {
132
+ v.handleSubmit().then();
133
+ },
134
+ onChangeDebounceMs: 150
135
+ },
136
+ onSubmit: ({ value: v }) => {
137
+ F(t, v);
138
+ }
139
+ }), A = (v) => {
140
+ v.stopPropagation();
141
+ }, V = () => {
142
+ b({ conditions: [], isFallback: !1, label: "" }), F(t, { conditions: void 0, isFallback: void 0, label: void 0 });
143
+ }, T = () => {
144
+ if (a?.isFallback)
145
+ return a.label || C("editor.conditionalEdge.fallback");
146
+ if (!w)
147
+ return null;
148
+ if (a.label)
149
+ return a.label;
150
+ const v = a.conditions;
151
+ if (v.length === 1)
152
+ return `${g.find((H) => H.nodeId === v[0].field)?.label || v[0].field} ${v[0].operator} ${v[0].value}`;
153
+ const B = v.filter((O) => O.logicalOperator === oe.AND).length, Ae = v.filter((O) => O.logicalOperator === oe.OR).length;
154
+ return B > 0 && Ae === 0 ? `${v.length} ${C("editor.conditionalEdge.conditionsAnd")}` : Ae > 0 && B === 0 ? `${v.length} ${C("editor.conditionalEdge.conditionsOr")}` : `${v.length} ${C("editor.conditionalEdge.conditionsMixed")}`;
155
+ }, P = () => a?.isFallback ? "var(--color-chart-4)" : w ? "var(--color-chart-2)" : "var(--color-chart-3)";
156
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
157
+ /* @__PURE__ */ e.jsx(
158
+ Xe,
159
+ {
160
+ path: r,
161
+ markerEnd: d,
162
+ style: {
163
+ ...c,
164
+ stroke: P(),
165
+ strokeDasharray: a?.isFallback ? "5,5" : void 0,
166
+ strokeWidth: w || a?.isFallback ? 2 : c?.strokeWidth
167
+ }
168
+ }
169
+ ),
170
+ /* @__PURE__ */ e.jsx(Qe, { children: /* @__PURE__ */ e.jsx(
171
+ "div",
172
+ {
173
+ className: "nodrag nopan absolute",
174
+ style: {
175
+ pointerEvents: "all",
176
+ transform: `translate(-50%, -50%) translate(${u}px,${m}px)`
177
+ },
178
+ children: /* @__PURE__ */ e.jsxs(Oe, { open: p, onOpenChange: x, children: [
179
+ /* @__PURE__ */ e.jsx(Me, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
180
+ S,
181
+ {
182
+ variant: w || a?.isFallback ? "default" : "secondary",
183
+ className: "h-8 px-2 text-xs",
184
+ onClick: A,
185
+ children: [
186
+ /* @__PURE__ */ e.jsx(Dt, { className: "mr-1 h-3 w-3" }),
187
+ w || a?.isFallback ? T() : C("editor.conditionalEdge.condition")
188
+ ]
189
+ }
190
+ ) }),
191
+ /* @__PURE__ */ e.jsx(Le, { className: "w-96 p-1", align: "center", onClick: (v) => v.stopPropagation(), children: /* @__PURE__ */ e.jsx(ot, { className: "flex max-h-150 flex-col p-3", children: /* @__PURE__ */ e.jsx(
192
+ "form",
193
+ {
194
+ onSubmit: (v) => {
195
+ v.preventDefault(), v.stopPropagation();
196
+ },
197
+ children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-5", children: [
198
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
199
+ /* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: C("editor.conditionalEdge.displayConditions") }),
200
+ /* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground text-sm", children: C("editor.conditionalEdge.displayConditionsDesc") })
201
+ ] }),
202
+ /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
203
+ /* @__PURE__ */ e.jsx(E, { name: "label", children: (v) => /* @__PURE__ */ e.jsxs(N, { children: [
204
+ /* @__PURE__ */ e.jsx(j, { htmlFor: v.name, children: C("editor.conditionalEdge.labelOptional") }),
205
+ /* @__PURE__ */ e.jsx(
206
+ D,
207
+ {
208
+ id: v.name,
209
+ placeholder: C("editor.conditionalEdge.labelPlaceholder"),
210
+ value: v.state.value,
211
+ onChange: (B) => v.handleChange(B.target.value)
212
+ }
213
+ ),
214
+ /* @__PURE__ */ e.jsx(M, { children: C("editor.conditionalEdge.labelDesc") })
215
+ ] }) }),
216
+ /* @__PURE__ */ e.jsx(E, { name: "isFallback", children: (v) => /* @__PURE__ */ e.jsx(N, { children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3 rounded-lg border bg-muted/20 p-3", children: [
217
+ /* @__PURE__ */ e.jsx(
218
+ ct,
219
+ {
220
+ id: v.name,
221
+ checked: v.state.value,
222
+ onCheckedChange: (B) => v.handleChange(B)
223
+ }
224
+ ),
225
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
226
+ /* @__PURE__ */ e.jsx(j, { htmlFor: v.name, className: "cursor-pointer font-medium", children: C("editor.conditionalEdge.fallbackPath") }),
227
+ /* @__PURE__ */ e.jsx(M, { className: "text-xs", children: C("editor.conditionalEdge.fallbackPathDesc") })
228
+ ] })
229
+ ] }) }) }),
230
+ /* @__PURE__ */ e.jsx(E, { name: "conditions", mode: "array", children: (v) => {
231
+ const B = v.form.getFieldValue("isFallback");
232
+ return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
233
+ /* @__PURE__ */ e.jsx(j, { className: B ? "text-muted-foreground" : "", children: C("editor.conditionalEdge.conditions") }),
234
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
235
+ v.state.value?.map((Ae, O) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
236
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-2 rounded-lg border bg-muted/30 p-3", children: [
237
+ /* @__PURE__ */ e.jsx(E, { name: `conditions[${O}].field`, children: (H) => /* @__PURE__ */ e.jsxs(N, { children: [
238
+ /* @__PURE__ */ e.jsx(j, { htmlFor: `field-${O}`, children: C("editor.conditionalEdge.field") }),
239
+ /* @__PURE__ */ e.jsxs(
240
+ _,
241
+ {
242
+ disabled: B,
243
+ value: H.state.value || "",
244
+ onValueChange: (Y) => H.handleChange(Y),
245
+ children: [
246
+ /* @__PURE__ */ e.jsx(R, { id: `field-${O}`, className: "w-full", children: /* @__PURE__ */ e.jsx(Z, { placeholder: C("editor.conditionalEdge.selectField") }) }),
247
+ /* @__PURE__ */ e.jsx(K, { children: g.length === 0 ? /* @__PURE__ */ e.jsx(y, { value: "none", disabled: !0, children: C("editor.conditionalEdge.noFieldsAvailable") }) : g.map((Y) => /* @__PURE__ */ e.jsxs(y, { value: Y.nodeId, children: [
248
+ Y.label,
249
+ " (",
250
+ Y.type,
251
+ ")"
252
+ ] }, Y.nodeId)) })
253
+ ]
254
+ }
255
+ )
256
+ ] }) }),
257
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
258
+ /* @__PURE__ */ e.jsx(E, { name: `conditions[${O}].operator`, children: (H) => /* @__PURE__ */ e.jsxs(N, { children: [
259
+ /* @__PURE__ */ e.jsx(j, { htmlFor: `operator-${O}`, children: C("editor.conditionalEdge.operator") }),
260
+ /* @__PURE__ */ e.jsxs(
261
+ _,
262
+ {
263
+ disabled: B,
264
+ value: H.state.value || "===",
265
+ onValueChange: (Y) => H.handleChange(Y),
266
+ children: [
267
+ /* @__PURE__ */ e.jsx(R, { id: `operator-${O}`, children: /* @__PURE__ */ e.jsx(Z, {}) }),
268
+ /* @__PURE__ */ e.jsxs(K, { children: [
269
+ /* @__PURE__ */ e.jsx(y, { value: "===", children: "=" }),
270
+ /* @__PURE__ */ e.jsx(y, { value: "!==", children: "≠" }),
271
+ /* @__PURE__ */ e.jsx(y, { value: ">", children: ">" }),
272
+ /* @__PURE__ */ e.jsx(y, { value: "<", children: "<" }),
273
+ /* @__PURE__ */ e.jsx(y, { value: ">=", children: ">=" }),
274
+ /* @__PURE__ */ e.jsx(y, { value: "<=", children: "<=" })
275
+ ] })
276
+ ]
277
+ }
278
+ )
279
+ ] }) }),
280
+ /* @__PURE__ */ e.jsx(E, { name: `conditions[${O}].value`, children: (H) => /* @__PURE__ */ e.jsxs(N, { className: "w-full", children: [
281
+ /* @__PURE__ */ e.jsx(j, { htmlFor: `value-${O}`, children: C("editor.conditionalEdge.value") }),
282
+ /* @__PURE__ */ e.jsx(
283
+ D,
284
+ {
285
+ disabled: B,
286
+ id: `value-${O}`,
287
+ placeholder: C("editor.conditionalEdge.valuePlaceholder"),
288
+ value: H.state.value || "",
289
+ onChange: (Y) => H.handleChange(Y.target.value)
290
+ }
291
+ )
292
+ ] }) })
293
+ ] }),
294
+ v.state.value && v.state.value.length > 1 && /* @__PURE__ */ e.jsxs(
295
+ S,
296
+ {
297
+ disabled: B,
298
+ type: "button",
299
+ variant: "ghost",
300
+ size: "sm",
301
+ className: "w-full",
302
+ onClick: () => {
303
+ v.removeValue(O), I().then();
304
+ },
305
+ children: [
306
+ /* @__PURE__ */ e.jsx(se, { className: "mr-1 h-4 w-4" }),
307
+ C("editor.conditionalEdge.removeCondition")
308
+ ]
309
+ }
310
+ )
311
+ ] }),
312
+ v.state.value && O < v.state.value.length - 1 && /* @__PURE__ */ e.jsx(E, { name: `conditions[${O}].logicalOperator`, children: (H) => /* @__PURE__ */ e.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ e.jsxs(
313
+ _,
314
+ {
315
+ disabled: B,
316
+ value: H.state.value || oe.AND,
317
+ onValueChange: (Y) => H.handleChange(Y),
318
+ children: [
319
+ /* @__PURE__ */ e.jsx(R, { className: "h-9 w-32 font-semibold", children: /* @__PURE__ */ e.jsx(Z, {}) }),
320
+ /* @__PURE__ */ e.jsxs(K, { children: [
321
+ /* @__PURE__ */ e.jsx(y, { value: oe.AND, children: "AND" }),
322
+ /* @__PURE__ */ e.jsx(y, { value: oe.OR, children: "OR" })
323
+ ] })
324
+ ]
325
+ }
326
+ ) }) })
327
+ ] }, `condition-${O}`)),
328
+ /* @__PURE__ */ e.jsxs(
329
+ S,
330
+ {
331
+ disabled: B,
332
+ type: "button",
333
+ variant: "outline",
334
+ size: "sm",
335
+ className: "w-full",
336
+ onClick: () => {
337
+ v.pushValue({
338
+ field: g[0]?.nodeId ?? "",
339
+ logicalOperator: oe.AND,
340
+ operator: "===",
341
+ value: ""
342
+ }), I().then();
343
+ },
344
+ children: [
345
+ /* @__PURE__ */ e.jsx(X, { className: "mr-2 h-4 w-4" }),
346
+ C("editor.conditionalEdge.addCondition")
347
+ ]
348
+ }
349
+ )
350
+ ] })
351
+ ] });
352
+ } })
353
+ ] }),
354
+ /* @__PURE__ */ e.jsxs("div", { className: "flex justify-end gap-2 pt-2", children: [
355
+ /* @__PURE__ */ e.jsxs(S, { type: "button", size: "sm", variant: "outline", onClick: V, children: [
356
+ /* @__PURE__ */ e.jsx(se, { className: "mr-1 h-4 w-4" }),
357
+ C("common.clear")
358
+ ] }),
359
+ /* @__PURE__ */ e.jsx(S, { type: "button", size: "sm", onClick: () => x(!1), children: C("common.close") })
360
+ ] })
361
+ ] })
362
+ }
363
+ ) }) })
364
+ ] })
365
+ }
366
+ ) })
367
+ ] });
368
+ }, ea = he(Qt), ta = ({ id: t, sourceX: s, sourceY: l, targetX: i, targetY: h, sourcePosition: o, targetPosition: n, style: f, markerEnd: d, selected: c }) => {
369
+ const [a, r, u] = qe({
370
+ sourcePosition: o,
371
+ sourceX: s,
372
+ sourceY: l,
373
+ targetPosition: n,
374
+ targetX: i,
375
+ targetY: h
376
+ }), { setEdges: m } = ue(), p = () => {
377
+ m((x) => x.filter((F) => F.id !== t));
378
+ };
379
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
380
+ /* @__PURE__ */ e.jsx(Xe, { path: a, markerEnd: d, style: f }),
381
+ /* @__PURE__ */ e.jsx(Qe, { children: c && /* @__PURE__ */ e.jsx(
382
+ "div",
383
+ {
384
+ className: "button-edge__label nodrag nopan",
385
+ style: {
386
+ transform: `translate(-50%, -50%) translate(${r}px,${u}px)`
387
+ },
388
+ children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "button-edge__button", onClick: p, "aria-label": "Remove edge", children: "×" })
389
+ }
390
+ ) })
391
+ ] });
392
+ }, aa = he(ta), sa = {
393
+ conditional: ea,
394
+ default: aa
395
+ }, na = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
396
+ let ce = (t = 21) => {
397
+ let s = "", l = crypto.getRandomValues(new Uint8Array(t |= 0));
398
+ for (; t--; )
399
+ s += na[l[t] & 63];
400
+ return s;
401
+ };
402
+ const rt = {
403
+ data: {
404
+ type: "text"
405
+ },
406
+ id: ce(),
407
+ position: { x: 0, y: 0 },
408
+ type: "input"
409
+ }, oa = 100, ra = 50, lt = () => {
410
+ const { setNodes: t, setEdges: s, screenToFlowPosition: l, getNode: i, getNodes: h, getEdges: o } = ue(), n = $(
411
+ (u, m, p = !1) => {
412
+ const x = u.id, g = o().filter((b) => b.source === x), w = je(u);
413
+ if (g.length > 0 && !w)
414
+ return;
415
+ const C = ce(), I = {
416
+ ...rt,
417
+ id: C,
418
+ position: m,
419
+ selected: p
420
+ };
421
+ u?.parentId && (I.parentId = u.parentId, I.extent = "parent"), t((b) => b.concat(I)), s((b) => {
422
+ const A = b.filter((T) => T.source === x).length > 0, V = {
423
+ data: A && w ? {
424
+ conditions: [{ field: x, operator: "===", value: "" }]
425
+ } : void 0,
426
+ id: ce(),
427
+ source: x,
428
+ target: C,
429
+ type: A && w ? "conditional" : "default"
430
+ };
431
+ return A && w ? b.map((T) => T.source === x ? {
432
+ ...T,
433
+ data: {
434
+ ...T.data,
435
+ conditions: T.data?.conditions || [{ field: x, operator: "===", value: "" }]
436
+ },
437
+ type: "conditional"
438
+ } : T).concat(V) : b.concat(V);
439
+ }), p && (t((b) => b.map((E) => ({ ...E, selected: E.id === C }))), s((b) => b.map((E) => ({ ...E, selected: !1 }))));
440
+ },
441
+ [o, t, s]
442
+ ), f = $(
443
+ (u) => {
444
+ s((m) => {
445
+ const p = vt(u, m), x = u.source, F = i(x);
446
+ return p.filter((w) => w.source === x).length > 1 && F && je(F) ? p.map((w) => w.source === x ? {
447
+ ...w,
448
+ data: {
449
+ ...w.data,
450
+ conditions: w.data?.conditions || [{ field: x, operator: "===", value: "" }]
451
+ },
452
+ type: "conditional"
453
+ } : w) : p;
454
+ });
455
+ },
456
+ [s, i]
457
+ ), d = $(
458
+ (u) => {
459
+ const m = i(u);
460
+ if (!m)
461
+ return;
462
+ const p = getComputedStyle(document.documentElement).getPropertyValue("--node-height"), x = getComputedStyle(document.documentElement).getPropertyValue("--node-width"), F = parseFloat(p) || 100, g = parseFloat(x) || 100, w = m.position.y + F + oa, C = h(), I = o(), b = C.filter((A) => I.some((V) => V.source === u && V.target === A.id)), E = b.length > 0 ? b.reduce((A, V) => V.position.x > A.position.x ? V : A, b[0]).position.x + g + ra : m.position.x;
463
+ n(m, { x: E, y: w }, !0);
464
+ },
465
+ [i, h, o, n]
466
+ ), c = $(
467
+ (u, m) => {
468
+ if (!m.isValid) {
469
+ const { clientX: p, clientY: x } = "changedTouches" in u ? u.changedTouches[0] : u, F = m.fromNode;
470
+ if (!F)
471
+ return;
472
+ const g = l({ x: p, y: x }), w = F.parentId ? i(F.parentId) : void 0, C = w?.position ?? { x: 0, y: 0 }, I = w ? { x: g.x - C.x, y: g.y - C.y } : g;
473
+ n(F, I);
474
+ }
475
+ },
476
+ [n, i, l]
477
+ ), a = $(
478
+ (u) => {
479
+ s((m) => {
480
+ const p = m.filter((g) => !u.find((w) => w.id === g.id)), x = new Set(u.map((g) => g.source)), F = /* @__PURE__ */ new Map();
481
+ return p.forEach((g) => {
482
+ F.set(g.source, (F.get(g.source) ?? 0) + 1);
483
+ }), p.map((g) => {
484
+ if (x.has(g.source) && (F.get(g.source) ?? 0) === 1) {
485
+ const { conditions: C, isFallback: I, ...b } = g.data ?? {}, E = b && Object.keys(b).length > 0 ? b : void 0;
486
+ return { ...g, data: E, type: "default" };
487
+ }
488
+ return g;
489
+ });
490
+ });
491
+ },
492
+ [s]
493
+ );
494
+ return {
495
+ isValidConnection: $(
496
+ (u) => {
497
+ if (u.source === u.target)
498
+ return !1;
499
+ const m = i(u.source);
500
+ return m ? !(o().filter((F) => F.source === u.source).length > 0 && !je(m)) : !1;
501
+ },
502
+ [i, o]
503
+ ),
504
+ onAddFromHandle: d,
505
+ onConnect: f,
506
+ onConnectEnd: c,
507
+ onEdgesDelete: a
508
+ };
509
+ }, He = (t) => {
510
+ const { onAddFromHandle: s } = lt();
511
+ return $(
512
+ (l) => {
513
+ l.defaultPrevented || s(t);
514
+ },
515
+ [s, t]
516
+ );
517
+ }, Ue = ({ children: t, inGroup: s, isSubmit: l }) => /* @__PURE__ */ e.jsx("div", { className: k("react-flow__node__wrapper", s && "in-group", l && "submit-type"), children: t }), la = Rt(
518
+ "inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
519
+ {
520
+ defaultVariants: {
521
+ variant: "default"
522
+ },
523
+ variants: {
524
+ variant: {
525
+ blue: "bg-blue-500 text-white dark:bg-blue-600",
526
+ default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
527
+ destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
528
+ outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
529
+ purple: "bg-purple-600 hover:bg-purple-700 text-white",
530
+ secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90"
531
+ }
532
+ }
533
+ }
534
+ );
535
+ function ve({
536
+ className: t,
537
+ variant: s,
538
+ asChild: l = !1,
539
+ ...i
540
+ }) {
541
+ const h = l ? _t : "span";
542
+ return /* @__PURE__ */ e.jsx(h, { "data-slot": "badge", className: k(la({ variant: s }), t), ...i });
543
+ }
544
+ const ia = ({ data: t, isConnectable: s, type: l, parentId: i, id: h }) => {
545
+ const n = G()(t?.label), f = He(h);
546
+ return /* @__PURE__ */ e.jsxs(Ue, { inGroup: !!i, children: [
547
+ /* @__PURE__ */ e.jsx(ie, { type: "target", position: de.Top, isConnectable: s, isConnectableStart: !1 }),
548
+ /* @__PURE__ */ e.jsx("div", { className: "mb-1 max-w-full overflow-hidden text-ellipsis text-nowrap text-2xl", children: n }),
549
+ /* @__PURE__ */ e.jsxs(ve, { variant: "destructive", className: "capitalize", children: [
550
+ /* @__PURE__ */ e.jsx(kt, {}),
551
+ l
552
+ ] }),
553
+ /* @__PURE__ */ e.jsx(
554
+ ie,
555
+ {
556
+ type: "source",
557
+ position: de.Bottom,
558
+ isConnectable: s,
559
+ onClick: f,
560
+ className: "hover:!bg-primary/80 !w-6 !h-6 flex cursor-pointer items-center justify-center rounded-sm transition-colors",
561
+ children: /* @__PURE__ */ e.jsx(X, { className: "h-4 w-4 text-primary-foreground" })
562
+ }
563
+ )
564
+ ] });
565
+ }, da = he(ia), ca = ({ data: t }) => {
566
+ const l = G()(t?.label);
567
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
568
+ /* @__PURE__ */ e.jsx(ft, {}),
569
+ /* @__PURE__ */ e.jsx("div", { className: "-top-3.5 absolute left-6", children: /* @__PURE__ */ e.jsxs(ve, { className: "max-w-50 bg-chart-2", children: [
570
+ /* @__PURE__ */ e.jsx(Pt, { className: "!w-3 !h-3" }),
571
+ l
572
+ ] }) })
573
+ ] });
574
+ }, ua = he(ca), ha = ({ data: t, isConnectable: s, parentId: l, id: i }) => {
575
+ const o = G()(t?.label), n = He(i);
576
+ return /* @__PURE__ */ e.jsxs(Ue, { inGroup: !!l, isSubmit: t?.type === "submit", children: [
577
+ /* @__PURE__ */ e.jsx(ie, { type: "target", position: de.Top, isConnectable: s, isConnectableStart: !1 }),
578
+ /* @__PURE__ */ e.jsx("div", { className: "mb-1 max-w-full overflow-hidden text-ellipsis text-nowrap text-2xl", children: o || t?.name }),
579
+ /* @__PURE__ */ e.jsx("div", { className: "flex gap-1", children: t?.type && /* @__PURE__ */ e.jsxs(ve, { variant: "blue", className: "capitalize", children: [
580
+ /* @__PURE__ */ e.jsx(et, {}),
581
+ t.type
582
+ ] }) }),
583
+ /* @__PURE__ */ e.jsx(
584
+ ie,
585
+ {
586
+ type: "source",
587
+ position: de.Bottom,
588
+ isConnectable: s,
589
+ onClick: n,
590
+ className: "hover:!bg-primary/80 flex cursor-pointer items-center justify-center rounded-sm transition-colors",
591
+ children: /* @__PURE__ */ e.jsx(X, { className: "h-4 w-4 text-primary-foreground" })
592
+ }
593
+ )
594
+ ] });
595
+ }, ma = he(ha), pa = ({ data: t, isConnectable: s, type: l, parentId: i, id: h }) => {
596
+ const n = G()(t?.label), f = He(h);
597
+ return /* @__PURE__ */ e.jsxs(Ue, { inGroup: !!i, children: [
598
+ /* @__PURE__ */ e.jsx(ie, { type: "target", position: de.Top, isConnectable: s }),
599
+ /* @__PURE__ */ e.jsx("div", { className: "mb-1 max-w-full overflow-hidden text-ellipsis text-nowrap text-2xl capitalize", children: n }),
600
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
601
+ /* @__PURE__ */ e.jsxs(ve, { variant: "purple", children: [
602
+ /* @__PURE__ */ e.jsx(Tt, {}),
603
+ l
604
+ ] }),
605
+ t?.type && /* @__PURE__ */ e.jsxs(ve, { variant: "outline", className: "capitalize", children: [
606
+ /* @__PURE__ */ e.jsx(et, {}),
607
+ t.type
608
+ ] })
609
+ ] }),
610
+ /* @__PURE__ */ e.jsx(
611
+ ie,
612
+ {
613
+ type: "source",
614
+ position: de.Bottom,
615
+ isConnectable: s,
616
+ onClick: f,
617
+ className: "!bg-primary hover:!bg-primary/80 !w-6 !h-6 flex cursor-pointer items-center justify-center transition-colors",
618
+ children: /* @__PURE__ */ e.jsx(X, { className: "h-4 w-4 text-primary-foreground" })
619
+ }
620
+ )
621
+ ] });
622
+ }, xa = he(pa), it = {
623
+ [ye.flow]: da,
624
+ [ye.group]: ua,
625
+ [ye.input]: ma,
626
+ [ye.ui]: xa
627
+ }, De = `You are a Treege decision tree generator. You must generate valid JSON structures for decision trees.
628
+
629
+ IMPORTANT RULES:
630
+ 1. Always respond with valid JSON only, no markdown, no code blocks, no explanations outside the JSON
631
+ 2. The JSON must have this exact structure: { "nodes": [...], "edges": [...] }
632
+ 3. Every node must have: id (string), type (string), position ({ x: number, y: number }), data (object)
633
+ 4. Every edge must have: id (string), source (string), target (string)
634
+ 5. For regex patterns: ALWAYS use double backslashes (\\\\) for special characters (\\\\s, \\\\d, etc.)
635
+ 6. AVOID using "pattern" field unless specifically requested - prefer using simple validation
636
+ 7. For submit buttons, use type "input" with data.type "submit", NOT type "flow"
637
+ 8. For conditional logic, use conditional edges with proper operators (===, !==, >, <, >=, <=)
638
+
639
+ NODE TYPES:
640
+ - "input": Form input fields (text, number, select, checkbox, etc.)
641
+ - "ui": UI elements (title, divider)
642
+ - "flow": Navigation/flow control nodes
643
+ - "group": Container for organizing nodes
644
+
645
+ INPUT NODE TYPES (data.type):
646
+ - "text", "number", "textarea", "password"
647
+ - "select", "radio", "checkbox", "switch"
648
+ - "autocomplete", "date", "daterange", "time", "timerange"
649
+ - "file", "address", "http", "hidden", "submit"
650
+
651
+ INPUT NODE DATA STRUCTURE:
652
+ {
653
+ "id": "unique-id",
654
+ "type": "input",
655
+ "position": { "x": 0, "y": 0 },
656
+ "data": {
657
+ "label": "Field Label",
658
+ "name": "fieldName",
659
+ "type": "text",
660
+ "required": true,
661
+ "placeholder": "Enter value...",
662
+ "helperText": "Optional helper text",
663
+ "pattern": "regex pattern (optional)",
664
+ "errorMessage": "Error message if validation fails",
665
+ "options": [{ "value": "val", "label": "Label" }], // for select/radio/checkbox
666
+ "multiple": false // for select/checkbox
667
+ }
668
+ }
669
+
670
+ UI NODE TYPES (data.type):
671
+ - "title": Display a title
672
+ - "divider": Display a divider line
673
+
674
+ UI NODE DATA STRUCTURE:
675
+ {
676
+ "id": "unique-id",
677
+ "type": "ui",
678
+ "position": { "x": 0, "y": 0 },
679
+ "data": {
680
+ "label": "UI Element Label",
681
+ "type": "title" // or "divider"
682
+ }
683
+ }
684
+
685
+ FLOW NODE DATA STRUCTURE:
686
+ {
687
+ "id": "unique-id",
688
+ "type": "flow",
689
+ "position": { "x": 0, "y": 0 },
690
+ "data": {
691
+ "label": "Flow Step Label",
692
+ "targetId": "next-node-id" // optional
693
+ }
694
+ }
695
+
696
+ GROUP NODE DATA STRUCTURE:
697
+ {
698
+ "id": "unique-id",
699
+ "type": "group",
700
+ "position": { "x": 0, "y": 0 },
701
+ "data": {
702
+ "label": "Group Label"
703
+ }
704
+ }
705
+
706
+ EDGE STRUCTURE:
707
+ {
708
+ "id": "edge-id",
709
+ "source": "source-node-id",
710
+ "target": "target-node-id",
711
+ "type": "default" // or "conditional" for conditional logic
712
+ }
713
+
714
+ CONDITIONAL EDGE STRUCTURE:
715
+ {
716
+ "id": "edge-id",
717
+ "source": "source-node-id",
718
+ "target": "target-node-id",
719
+ "type": "conditional",
720
+ "data": {
721
+ "label": "If condition is true", // optional label for the edge
722
+ "conditions": [
723
+ {
724
+ "field": "field-node-id", // ID of the field to check
725
+ "operator": ">=", // operators: ===, !==, >, <, >=, <=
726
+ "value": "18" // value to compare (as string)
727
+ }
728
+ ],
729
+ "operator": "AND" // optional: "AND" or "OR" for multiple conditions (default: AND)
730
+ }
731
+ }
732
+
733
+ IMPORTANT: For conditional edges, the value must ALWAYS be a string, even for numbers.
734
+ Example: For "age >= 18", use "value": "18" (not value: 18)
735
+
736
+ LAYOUT GUIDELINES:
737
+ - Position nodes in a vertical flow (top to bottom)
738
+ - Start at position { x: 0, y: 0 }
739
+ - Space nodes vertically by exactly 250 pixels between each position (node height 150px + 100px spacing)
740
+ - For horizontal spacing, use 350 pixels
741
+ - Create logical flow from top to bottom
742
+ - IMPORTANT: Keep consistent vertical spacing to avoid overlap
743
+ - Each node position Y should increment by 250: first at y:0, second at y:250, third at y:500, etc.
744
+
745
+ EXAMPLES:
746
+
747
+ User: "Create a simple contact form with name, email and message"
748
+ Response:
749
+ {
750
+ "nodes": [
751
+ {
752
+ "id": "title-1",
753
+ "type": "ui",
754
+ "position": { "x": 0, "y": 0 },
755
+ "data": { "label": "Contact Form", "type": "title" }
756
+ },
757
+ {
758
+ "id": "name-1",
759
+ "type": "input",
760
+ "position": { "x": 0, "y": 250 },
761
+ "data": {
762
+ "label": "Name",
763
+ "name": "name",
764
+ "type": "text",
765
+ "required": true,
766
+ "placeholder": "Enter your name"
767
+ }
768
+ },
769
+ {
770
+ "id": "email-1",
771
+ "type": "input",
772
+ "position": { "x": 0, "y": 500 },
773
+ "data": {
774
+ "label": "Email",
775
+ "name": "email",
776
+ "type": "text",
777
+ "required": true,
778
+ "placeholder": "your@email.com"
779
+ }
780
+ },
781
+ {
782
+ "id": "message-1",
783
+ "type": "input",
784
+ "position": { "x": 0, "y": 750 },
785
+ "data": {
786
+ "label": "Message",
787
+ "name": "message",
788
+ "type": "textarea",
789
+ "required": true,
790
+ "placeholder": "Enter your message"
791
+ }
792
+ }
793
+ ],
794
+ "edges": [
795
+ { "id": "e1", "source": "title-1", "target": "name-1" },
796
+ { "id": "e2", "source": "name-1", "target": "email-1" },
797
+ { "id": "e3", "source": "email-1", "target": "message-1" }
798
+ ]
799
+ }
800
+
801
+ User: "Create a user registration form with age, address and country selector"
802
+ Response:
803
+ {
804
+ "nodes": [
805
+ {
806
+ "id": "title-1",
807
+ "type": "ui",
808
+ "position": { "x": 0, "y": 0 },
809
+ "data": { "label": "User Registration", "type": "title" }
810
+ },
811
+ {
812
+ "id": "age-1",
813
+ "type": "input",
814
+ "position": { "x": 0, "y": 250 },
815
+ "data": {
816
+ "label": "Age",
817
+ "name": "age",
818
+ "type": "number",
819
+ "required": true,
820
+ "placeholder": "Enter your age"
821
+ }
822
+ },
823
+ {
824
+ "id": "address-1",
825
+ "type": "input",
826
+ "position": { "x": 0, "y": 500 },
827
+ "data": {
828
+ "label": "Address",
829
+ "name": "address",
830
+ "type": "address",
831
+ "required": true,
832
+ "placeholder": "Enter your address"
833
+ }
834
+ },
835
+ {
836
+ "id": "country-1",
837
+ "type": "input",
838
+ "position": { "x": 0, "y": 750 },
839
+ "data": {
840
+ "label": "Country",
841
+ "name": "country",
842
+ "type": "select",
843
+ "required": true,
844
+ "options": [
845
+ { "value": "us", "label": "United States" },
846
+ { "value": "ca", "label": "Canada" },
847
+ { "value": "uk", "label": "United Kingdom" },
848
+ { "value": "fr", "label": "France" },
849
+ { "value": "de", "label": "Germany" }
850
+ ]
851
+ }
852
+ },
853
+ {
854
+ "id": "submit-1",
855
+ "type": "input",
856
+ "position": { "x": 0, "y": 1000 },
857
+ "data": {
858
+ "label": "Submit",
859
+ "type": "submit"
860
+ }
861
+ }
862
+ ],
863
+ "edges": [
864
+ { "id": "e1", "source": "title-1", "target": "age-1" },
865
+ { "id": "e2", "source": "age-1", "target": "address-1" },
866
+ { "id": "e3", "source": "address-1", "target": "country-1" },
867
+ { "id": "e4", "source": "country-1", "target": "submit-1" }
868
+ ]
869
+ }
870
+
871
+ User: "Create a form with name, age, and show different questions based on age (movie for 18+, color for under 18)"
872
+ Response:
873
+ {
874
+ "nodes": [
875
+ {
876
+ "id": "title-1",
877
+ "type": "ui",
878
+ "position": { "x": 0, "y": 0 },
879
+ "data": { "label": "Survey Form", "type": "title" }
880
+ },
881
+ {
882
+ "id": "name-1",
883
+ "type": "input",
884
+ "position": { "x": 0, "y": 250 },
885
+ "data": {
886
+ "label": "Name",
887
+ "name": "name",
888
+ "type": "text",
889
+ "required": true,
890
+ "placeholder": "Enter your name"
891
+ }
892
+ },
893
+ {
894
+ "id": "age-1",
895
+ "type": "input",
896
+ "position": { "x": 0, "y": 500 },
897
+ "data": {
898
+ "label": "Age",
899
+ "name": "age",
900
+ "type": "number",
901
+ "required": true,
902
+ "placeholder": "Enter your age"
903
+ }
904
+ },
905
+ {
906
+ "id": "movie-1",
907
+ "type": "input",
908
+ "position": { "x": -350, "y": 750 },
909
+ "data": {
910
+ "label": "Favorite Movie",
911
+ "name": "favoriteMovie",
912
+ "type": "text",
913
+ "required": true,
914
+ "helperText": "For adults 18 and over"
915
+ }
916
+ },
917
+ {
918
+ "id": "color-1",
919
+ "type": "input",
920
+ "position": { "x": 350, "y": 750 },
921
+ "data": {
922
+ "label": "Favorite Color",
923
+ "name": "favoriteColor",
924
+ "type": "text",
925
+ "required": true,
926
+ "helperText": "For those under 18"
927
+ }
928
+ },
929
+ {
930
+ "id": "submit-1",
931
+ "type": "input",
932
+ "position": { "x": 0, "y": 1000 },
933
+ "data": {
934
+ "label": "Submit",
935
+ "type": "submit"
936
+ }
937
+ }
938
+ ],
939
+ "edges": [
940
+ { "id": "e1", "source": "title-1", "target": "name-1" },
941
+ { "id": "e2", "source": "name-1", "target": "age-1" },
942
+ {
943
+ "id": "e3",
944
+ "source": "age-1",
945
+ "target": "movie-1",
946
+ "type": "conditional",
947
+ "data": {
948
+ "label": "If 18 or older",
949
+ "conditions": [
950
+ {
951
+ "field": "age-1",
952
+ "operator": ">=",
953
+ "value": "18"
954
+ }
955
+ ]
956
+ }
957
+ },
958
+ {
959
+ "id": "e4",
960
+ "source": "age-1",
961
+ "target": "color-1",
962
+ "type": "conditional",
963
+ "data": {
964
+ "label": "If under 18",
965
+ "conditions": [
966
+ {
967
+ "field": "age-1",
968
+ "operator": "<",
969
+ "value": "18"
970
+ }
971
+ ]
972
+ }
973
+ },
974
+ { "id": "e5", "source": "movie-1", "target": "submit-1" },
975
+ { "id": "e6", "source": "color-1", "target": "submit-1" }
976
+ ]
977
+ }
978
+
979
+ Remember:
980
+ - Always respond with ONLY valid JSON
981
+ - No markdown code blocks
982
+ - No explanations outside the JSON
983
+ - Follow the exact structure shown above
984
+ - For submit buttons, ALWAYS use type "input" with data.type "submit"
985
+ - For conditional edges, ALWAYS specify the value as a string and use proper operators (>=, <, ===, etc.)
986
+ - Never leave condition values empty - always provide the comparison value
987
+ `, ke = {
988
+ claude: "claude-3-5-haiku-20241022",
989
+ deepseek: "deepseek-chat",
990
+ gemini: "gemini-2.5-flash",
991
+ openai: "gpt-4o-mini"
992
+ }, Pe = 0.3;
993
+ function Te(t) {
994
+ try {
995
+ return JSON.parse(t);
996
+ } catch (s) {
997
+ const l = t.replace(/```json\n?/g, "").replace(/```\n?/g, "").trim();
998
+ try {
999
+ return JSON.parse(l);
1000
+ } catch {
1001
+ throw console.error("Failed to parse AI response:", t.substring(0, 500)), new Error(`Invalid JSON response from AI: ${s instanceof Error ? s.message : "Unknown error"}`);
1002
+ }
1003
+ }
1004
+ }
1005
+ async function ga(t) {
1006
+ const s = t.config.model || ke.gemini, l = t.config.temperature ?? Pe, i = await fetch(
1007
+ `https://generativelanguage.googleapis.com/v1beta/models/${s}:generateContent?key=${t.config.apiKey}`,
1008
+ {
1009
+ body: JSON.stringify({
1010
+ contents: [
1011
+ {
1012
+ parts: [
1013
+ {
1014
+ text: `${De}
1015
+
1016
+ User request: ${t.prompt}`
1017
+ }
1018
+ ]
1019
+ }
1020
+ ],
1021
+ generationConfig: {
1022
+ responseMimeType: "application/json",
1023
+ temperature: l
1024
+ }
1025
+ }),
1026
+ headers: { "Content-Type": "application/json" },
1027
+ method: "POST"
1028
+ }
1029
+ );
1030
+ if (!i.ok) {
1031
+ const n = await i.text();
1032
+ throw new Error(`Gemini API error: ${n}`);
1033
+ }
1034
+ const o = (await i.json()).candidates?.[0]?.content?.parts?.[0]?.text;
1035
+ if (!o)
1036
+ throw new Error("No response from Gemini");
1037
+ return Te(o);
1038
+ }
1039
+ async function ja(t) {
1040
+ const s = t.config.model || ke.openai, l = t.config.temperature ?? Pe, i = await fetch("https://api.openai.com/v1/chat/completions", {
1041
+ body: JSON.stringify({
1042
+ messages: [
1043
+ { content: De, role: "system" },
1044
+ { content: t.prompt, role: "user" }
1045
+ ],
1046
+ model: s,
1047
+ response_format: { type: "json_object" },
1048
+ temperature: l
1049
+ }),
1050
+ headers: {
1051
+ Authorization: `Bearer ${t.config.apiKey}`,
1052
+ "Content-Type": "application/json"
1053
+ },
1054
+ method: "POST"
1055
+ });
1056
+ if (!i.ok) {
1057
+ const n = await i.text();
1058
+ throw new Error(`OpenAI API error: ${n}`);
1059
+ }
1060
+ const o = (await i.json()).choices?.[0]?.message?.content;
1061
+ if (!o)
1062
+ throw new Error("No response from OpenAI");
1063
+ return Te(o);
1064
+ }
1065
+ async function Ca(t) {
1066
+ const s = t.config.model || ke.deepseek, l = t.config.temperature ?? Pe, i = await fetch("https://api.deepseek.com/v1/chat/completions", {
1067
+ body: JSON.stringify({
1068
+ messages: [
1069
+ { content: De, role: "system" },
1070
+ { content: t.prompt, role: "user" }
1071
+ ],
1072
+ model: s,
1073
+ response_format: { type: "json_object" },
1074
+ temperature: l
1075
+ }),
1076
+ headers: {
1077
+ Authorization: `Bearer ${t.config.apiKey}`,
1078
+ "Content-Type": "application/json"
1079
+ },
1080
+ method: "POST"
1081
+ });
1082
+ if (!i.ok) {
1083
+ const n = await i.text();
1084
+ throw new Error(`DeepSeek API error: ${n}`);
1085
+ }
1086
+ const o = (await i.json()).choices?.[0]?.message?.content;
1087
+ if (!o)
1088
+ throw new Error("No response from DeepSeek");
1089
+ return Te(o);
1090
+ }
1091
+ async function va(t) {
1092
+ const s = t.config.model || ke.claude, l = t.config.temperature ?? Pe, i = await fetch("https://api.anthropic.com/v1/messages", {
1093
+ body: JSON.stringify({
1094
+ max_tokens: 4096,
1095
+ messages: [{ content: t.prompt, role: "user" }],
1096
+ model: s,
1097
+ system: De,
1098
+ temperature: l
1099
+ }),
1100
+ headers: {
1101
+ "anthropic-version": "2023-06-01",
1102
+ "Content-Type": "application/json",
1103
+ "x-api-key": t.config.apiKey
1104
+ },
1105
+ method: "POST"
1106
+ });
1107
+ if (!i.ok) {
1108
+ const n = await i.text();
1109
+ throw new Error(`Claude API error: ${n}`);
1110
+ }
1111
+ const o = (await i.json()).content?.[0]?.text;
1112
+ if (!o)
1113
+ throw new Error("No response from Claude");
1114
+ return Te(o);
1115
+ }
1116
+ function fa(t) {
1117
+ switch (t.config.provider) {
1118
+ case "gemini":
1119
+ return ga(t);
1120
+ case "openai":
1121
+ return ja(t);
1122
+ case "deepseek":
1123
+ return Ca(t);
1124
+ case "claude":
1125
+ return va(t);
1126
+ default:
1127
+ throw new Error(`Unsupported AI provider: ${t.config.provider}`);
1128
+ }
1129
+ }
1130
+ function ba({ ...t }) {
1131
+ return /* @__PURE__ */ e.jsx(L.Root, { "data-slot": "dialog", ...t });
1132
+ }
1133
+ function Na({ ...t }) {
1134
+ return /* @__PURE__ */ e.jsx(L.Trigger, { "data-slot": "dialog-trigger", ...t });
1135
+ }
1136
+ function ya({ ...t }) {
1137
+ return /* @__PURE__ */ e.jsx(L.Portal, { "data-slot": "dialog-portal", ...t });
1138
+ }
1139
+ function wa({ className: t, ...s }) {
1140
+ return /* @__PURE__ */ e.jsx(
1141
+ L.Overlay,
1142
+ {
1143
+ "data-slot": "dialog-overlay",
1144
+ className: k(
1145
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",
1146
+ t
1147
+ ),
1148
+ ...s
1149
+ }
1150
+ );
1151
+ }
1152
+ function Fa({
1153
+ className: t,
1154
+ children: s,
1155
+ showCloseButton: l = !0,
1156
+ ...i
1157
+ }) {
1158
+ return /* @__PURE__ */ e.jsxs(ya, { "data-slot": "dialog-portal", children: [
1159
+ /* @__PURE__ */ e.jsx(wa, {}),
1160
+ /* @__PURE__ */ e.jsxs(
1161
+ L.Content,
1162
+ {
1163
+ "data-slot": "dialog-content",
1164
+ className: k(
1165
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg",
1166
+ t
1167
+ ),
1168
+ ...i,
1169
+ children: [
1170
+ s,
1171
+ l && /* @__PURE__ */ e.jsxs(
1172
+ L.Close,
1173
+ {
1174
+ "data-slot": "dialog-close",
1175
+ className: "absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
1176
+ children: [
1177
+ /* @__PURE__ */ e.jsx(tt, {}),
1178
+ /* @__PURE__ */ e.jsx("span", { className: "sr-only", children: "Close" })
1179
+ ]
1180
+ }
1181
+ )
1182
+ ]
1183
+ }
1184
+ )
1185
+ ] });
1186
+ }
1187
+ function Sa({ className: t, ...s }) {
1188
+ return /* @__PURE__ */ e.jsx("div", { "data-slot": "dialog-header", className: k("flex flex-col gap-2 text-center sm:text-left", t), ...s });
1189
+ }
1190
+ function Ea({ className: t, ...s }) {
1191
+ return /* @__PURE__ */ e.jsx("div", { "data-slot": "dialog-footer", className: k("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", t), ...s });
1192
+ }
1193
+ function Da({ className: t, ...s }) {
1194
+ return /* @__PURE__ */ e.jsx(L.Title, { "data-slot": "dialog-title", className: k("font-semibold text-lg leading-none", t), ...s });
1195
+ }
1196
+ function ka({ className: t, ...s }) {
1197
+ return /* @__PURE__ */ e.jsx(L.Description, { "data-slot": "dialog-description", className: k("text-muted-foreground text-sm", t), ...s });
1198
+ }
1199
+ const Pa = ({ aiConfig: t, onGenerate: s }) => {
1200
+ const [l, i] = z(!1), [h, o] = z(""), [n, f] = z(!1), d = G(), c = async () => {
1201
+ if (!h.trim()) {
1202
+ U.error(d("editor.aiGenerator.enterDescription"));
1203
+ return;
1204
+ }
1205
+ if (!t?.apiKey) {
1206
+ U.error(d("editor.aiGenerator.missingApiKey"), {
1207
+ description: d("editor.aiGenerator.missingApiKeyDesc")
1208
+ });
1209
+ return;
1210
+ }
1211
+ f(!0);
1212
+ try {
1213
+ const r = await fa({
1214
+ config: t,
1215
+ prompt: h.trim()
1216
+ });
1217
+ s({
1218
+ edges: r.edges,
1219
+ nodes: r.nodes
1220
+ }), U.success(d("editor.aiGenerator.successTitle"), {
1221
+ description: d("editor.aiGenerator.successDescription").replace("{nodes}", String(r.nodes.length)).replace("{edges}", String(r.edges.length))
1222
+ }), o(""), i(!1);
1223
+ } catch (r) {
1224
+ console.error("AI generation error:", r), U.error(d("editor.aiGenerator.failedToGenerate"), {
1225
+ description: r instanceof Error ? r.message : d("editor.aiGenerator.unknownError")
1226
+ });
1227
+ } finally {
1228
+ f(!1);
1229
+ }
1230
+ }, a = (r) => {
1231
+ (r.metaKey || r.ctrlKey) && r.key === "Enter" && (r.preventDefault(), c());
1232
+ };
1233
+ return /* @__PURE__ */ e.jsxs(ba, { open: l, onOpenChange: i, children: [
1234
+ /* @__PURE__ */ e.jsx(Na, { asChild: !0, children: /* @__PURE__ */ e.jsxs(S, { variant: "outline", size: "sm", disabled: !t?.apiKey, children: [
1235
+ /* @__PURE__ */ e.jsx(Re, { className: "h-4 w-4 text-[#13d3b4]" }),
1236
+ " ",
1237
+ d("editor.aiGenerator.buttonLabel")
1238
+ ] }) }),
1239
+ /* @__PURE__ */ e.jsxs(Fa, { className: "sm:max-w-[550px]", children: [
1240
+ /* @__PURE__ */ e.jsxs(Sa, { children: [
1241
+ /* @__PURE__ */ e.jsx(Da, { children: d("editor.aiGenerator.title") }),
1242
+ /* @__PURE__ */ e.jsx(ka, { children: d("editor.aiGenerator.titleDescription") })
1243
+ ] }),
1244
+ /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4 py-4", children: [
1245
+ /* @__PURE__ */ e.jsxs("div", { className: "grid gap-2", children: [
1246
+ /* @__PURE__ */ e.jsx("label", { htmlFor: "ai-prompt", className: "font-medium text-sm", children: d("editor.aiGenerator.description") }),
1247
+ /* @__PURE__ */ e.jsx(
1248
+ Ge,
1249
+ {
1250
+ placeholder: d("editor.aiGenerator.descriptionPlaceholder"),
1251
+ value: h,
1252
+ onChange: (r) => o(r.target.value),
1253
+ onKeyDown: a,
1254
+ rows: 6,
1255
+ disabled: n,
1256
+ className: "resize-none"
1257
+ }
1258
+ ),
1259
+ /* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground text-xs", children: d("editor.aiGenerator.keyboardShortcut").replace("{cmdEnter}", "⌘ Enter").replace("{ctrlEnter}", "Ctrl Enter") })
1260
+ ] }),
1261
+ !t?.apiKey && /* @__PURE__ */ e.jsxs("div", { className: "rounded-md bg-muted p-3 text-sm", children: [
1262
+ /* @__PURE__ */ e.jsx("p", { className: "font-medium", children: d("editor.aiGenerator.aiNotConfigured") }),
1263
+ /* @__PURE__ */ e.jsxs("p", { className: "mt-1 text-muted-foreground text-xs", children: [
1264
+ d("editor.aiGenerator.aiNotConfiguredDesc").replace("{code}", ""),
1265
+ " ",
1266
+ /* @__PURE__ */ e.jsx("code", { className: "rounded bg-background px-1 py-0.5", children: "aiConfig" })
1267
+ ] })
1268
+ ] })
1269
+ ] }),
1270
+ /* @__PURE__ */ e.jsxs(Ea, { children: [
1271
+ /* @__PURE__ */ e.jsx(S, { variant: "outline", onClick: () => i(!1), disabled: n, children: d("editor.aiGenerator.cancel") }),
1272
+ /* @__PURE__ */ e.jsx(S, { onClick: c, disabled: n || !h.trim() || !t?.apiKey, children: n ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1273
+ /* @__PURE__ */ e.jsx(At, { className: "h-4 w-4 animate-spin" }),
1274
+ d("editor.aiGenerator.generating")
1275
+ ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1276
+ /* @__PURE__ */ e.jsx(Re, { className: "h-4 w-4 text-[--treege-color-primary]" }),
1277
+ d("editor.aiGenerator.generate")
1278
+ ] }) })
1279
+ ] })
1280
+ ] })
1281
+ ] });
1282
+ };
1283
+ function fe({ ...t }) {
1284
+ return /* @__PURE__ */ e.jsx(ae.Root, { "data-slot": "dropdown-menu", ...t });
1285
+ }
1286
+ function be({ ...t }) {
1287
+ return /* @__PURE__ */ e.jsx(ae.Trigger, { "data-slot": "dropdown-menu-trigger", ...t });
1288
+ }
1289
+ function Ne({ className: t, sideOffset: s = 4, ...l }) {
1290
+ return /* @__PURE__ */ e.jsx(ae.Portal, { children: /* @__PURE__ */ e.jsx(
1291
+ ae.Content,
1292
+ {
1293
+ "data-slot": "dropdown-menu-content",
1294
+ sideOffset: s,
1295
+ className: k(
1296
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",
1297
+ t
1298
+ ),
1299
+ ...l
1300
+ }
1301
+ ) });
1302
+ }
1303
+ function Ze({ ...t }) {
1304
+ return /* @__PURE__ */ e.jsx(ae.Group, { "data-slot": "dropdown-menu-group", ...t });
1305
+ }
1306
+ function W({
1307
+ className: t,
1308
+ inset: s,
1309
+ variant: l = "default",
1310
+ ...i
1311
+ }) {
1312
+ return /* @__PURE__ */ e.jsx(
1313
+ ae.Item,
1314
+ {
1315
+ "data-slot": "dropdown-menu-item",
1316
+ "data-inset": s,
1317
+ "data-variant": l,
1318
+ className: k(
1319
+ "data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",
1320
+ t
1321
+ ),
1322
+ ...i
1323
+ }
1324
+ );
1325
+ }
1326
+ function Ta({
1327
+ className: t,
1328
+ inset: s,
1329
+ ...l
1330
+ }) {
1331
+ return /* @__PURE__ */ e.jsx(
1332
+ ae.Label,
1333
+ {
1334
+ "data-slot": "dropdown-menu-label",
1335
+ "data-inset": s,
1336
+ className: k("px-2 py-1.5 font-medium text-sm data-[inset]:pl-8", t),
1337
+ ...l
1338
+ }
1339
+ );
1340
+ }
1341
+ function Ke({ className: t, ...s }) {
1342
+ return /* @__PURE__ */ e.jsx(
1343
+ ae.Separator,
1344
+ {
1345
+ "data-slot": "dropdown-menu-separator",
1346
+ className: k("-mx-1 my-1 h-px bg-border", t),
1347
+ ...s
1348
+ }
1349
+ );
1350
+ }
1351
+ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
1352
+ const { flowId: l, setFlowId: i, aiConfig: h } = nt(), { setNodes: o, setEdges: n, addNodes: f, screenToFlowPosition: d } = ue(), c = l || Aa, a = $e(), r = Je(), u = Ht(null), m = G(), p = () => {
1353
+ const b = (window.innerWidth || 0) / 2, E = (window.innerHeight || 0) / 2, A = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--node-width"), 10), V = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--node-height"), 10), T = d({ x: b - A, y: E - V });
1354
+ f([
1355
+ {
1356
+ ...rt,
1357
+ id: ce(),
1358
+ position: T,
1359
+ selected: !0
1360
+ }
1361
+ ]);
1362
+ }, x = ({ target: b }) => {
1363
+ const E = b.files?.[0];
1364
+ if (!E)
1365
+ return;
1366
+ const A = new FileReader();
1367
+ A.onload = (V) => {
1368
+ try {
1369
+ const T = JSON.parse(V.target?.result);
1370
+ T && Array.isArray(T.nodes) && Array.isArray(T.edges) ? (o(T.nodes), n(T.edges), U.success(m("editor.actionsPanel.importSuccess"), {
1371
+ description: m("editor.actionsPanel.importSuccessDesc")
1372
+ })) : U.error(m("editor.actionsPanel.invalidJson"), {
1373
+ description: m("editor.actionsPanel.invalidJsonDesc")
1374
+ });
1375
+ } catch (T) {
1376
+ console.warn(T), U.error(m("editor.actionsPanel.parseError"), {
1377
+ description: m("editor.actionsPanel.parseErrorDesc")
1378
+ });
1379
+ }
1380
+ u.current && (u.current.value = "");
1381
+ }, A.readAsText(E);
1382
+ }, F = () => {
1383
+ const b = { edges: r, id: c, nodes: a }, E = new Blob([JSON.stringify(b, null, 2)], { type: "application/json" }), A = URL.createObjectURL(E), V = document.createElement("a");
1384
+ V.href = A, V.download = "treege.json", V.click(), URL.revokeObjectURL(A), U.success(m("editor.actionsPanel.downloadSuccess"), {
1385
+ description: m("editor.actionsPanel.downloadSuccessDesc")
1386
+ }), l || i?.(c), t?.(b);
1387
+ }, g = $(() => {
1388
+ l || i?.(c), s?.({ edges: r, id: c, nodes: a });
1389
+ }, [r, l, c, a, s, i]), w = async () => {
1390
+ try {
1391
+ await navigator.clipboard.writeText(c), U.success(m("editor.actionsPanel.idCopied"), {
1392
+ description: c
1393
+ });
1394
+ } catch {
1395
+ U.error(m("editor.actionsPanel.copyFailed"));
1396
+ }
1397
+ }, C = () => {
1398
+ o([]), n([]), U.success(m("editor.actionsPanel.clearSuccess"), {
1399
+ description: m("editor.actionsPanel.clearSuccessDesc")
1400
+ });
1401
+ }, I = (b) => {
1402
+ o(b.nodes), n(b.edges);
1403
+ };
1404
+ return Ut(() => {
1405
+ const b = (E) => {
1406
+ (E.ctrlKey || E.metaKey) && E.key === "s" && (E.preventDefault(), g());
1407
+ };
1408
+ return window.addEventListener("keydown", b), () => {
1409
+ window.removeEventListener("keydown", b);
1410
+ };
1411
+ }, [g]), /* @__PURE__ */ e.jsxs(bt, { position: "top-right", className: "flex gap-2", children: [
1412
+ /* @__PURE__ */ e.jsx(Pa, { aiConfig: h, onGenerate: I }),
1413
+ /* @__PURE__ */ e.jsxs(S, { variant: "outline", size: "sm", onClick: p, children: [
1414
+ /* @__PURE__ */ e.jsx(X, {}),
1415
+ " ",
1416
+ m("editor.actionsPanel.addNode")
1417
+ ] }),
1418
+ /* @__PURE__ */ e.jsxs(S, { variant: "outline", size: "sm", onClick: g, children: [
1419
+ /* @__PURE__ */ e.jsx(Vt, {}),
1420
+ " ",
1421
+ m("common.save")
1422
+ ] }),
1423
+ /* @__PURE__ */ e.jsxs(fe, { children: [
1424
+ /* @__PURE__ */ e.jsx(be, { asChild: !0, children: /* @__PURE__ */ e.jsx(S, { variant: "outline", size: "sm", children: /* @__PURE__ */ e.jsx(It, {}) }) }),
1425
+ /* @__PURE__ */ e.jsxs(Ne, { align: "start", children: [
1426
+ /* @__PURE__ */ e.jsx(Ta, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
1427
+ /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground text-xs", children: "Flow ID" }),
1428
+ /* @__PURE__ */ e.jsxs(
1429
+ "button",
1430
+ {
1431
+ onClick: w,
1432
+ className: "flex items-center gap-2 font-mono text-muted-foreground transition-colors hover:text-primary",
1433
+ type: "button",
1434
+ children: [
1435
+ /* @__PURE__ */ e.jsx(Ot, { className: "h-3 w-3" }),
1436
+ /* @__PURE__ */ e.jsx("span", { className: "truncate text-xs", children: c })
1437
+ ]
1438
+ }
1439
+ )
1440
+ ] }) }),
1441
+ /* @__PURE__ */ e.jsx(Ke, {}),
1442
+ /* @__PURE__ */ e.jsxs(Ze, { children: [
1443
+ /* @__PURE__ */ e.jsxs(W, { onClick: () => u?.current?.click(), children: [
1444
+ /* @__PURE__ */ e.jsx(Mt, {}),
1445
+ " ",
1446
+ m("editor.actionsPanel.importJson")
1447
+ ] }),
1448
+ /* @__PURE__ */ e.jsxs(W, { onClick: F, children: [
1449
+ /* @__PURE__ */ e.jsx(Lt, {}),
1450
+ " ",
1451
+ m("editor.actionsPanel.exportJson")
1452
+ ] })
1453
+ ] }),
1454
+ /* @__PURE__ */ e.jsx(Ke, {}),
1455
+ /* @__PURE__ */ e.jsx(Ze, { children: /* @__PURE__ */ e.jsxs(W, { onClick: C, className: "text-destructive focus:text-destructive", children: [
1456
+ /* @__PURE__ */ e.jsx(at, { className: "text-destructive" }),
1457
+ " ",
1458
+ m("editor.actionsPanel.clear")
1459
+ ] }) })
1460
+ ] })
1461
+ ] }),
1462
+ /* @__PURE__ */ e.jsx("input", { type: "file", accept: "application/json,.json", className: "hidden", ref: u, onChange: x })
1463
+ ] });
1464
+ }, Ia = {
1465
+ ar: "ar",
1466
+ de: "de",
1467
+ en: "en",
1468
+ es: "es",
1469
+ fr: "fr",
1470
+ it: "it",
1471
+ pt: "pt"
1472
+ }, q = ({ value: t = "en", onValueChange: s }) => /* @__PURE__ */ e.jsxs(_, { value: t, onValueChange: s, children: [
1473
+ /* @__PURE__ */ e.jsx(R, { className: "uppercase", children: /* @__PURE__ */ e.jsx(Z, { placeholder: "" }) }),
1474
+ /* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsx(te, { children: Object.values(Ia).map((l) => /* @__PURE__ */ e.jsx(y, { value: l, className: "uppercase", children: l }, l)) }) })
1475
+ ] }), me = () => {
1476
+ const { setNodes: t, setEdges: s, getNodes: l } = ue(), i = $(() => {
1477
+ t((c) => c.map(({ selected: a, ...r }) => r)), s((c) => c.map(({ selected: a, ...r }) => r));
1478
+ }, [s, t]), h = $(
1479
+ (c, a) => {
1480
+ t(
1481
+ (r) => r.map((u) => u.id === c ? {
1482
+ ...u,
1483
+ data: {
1484
+ ...u.data,
1485
+ ...a
1486
+ }
1487
+ } : u)
1488
+ );
1489
+ },
1490
+ [t]
1491
+ ), o = $(
1492
+ (c, a) => {
1493
+ t(
1494
+ (r) => r.map((u) => u.id === c ? {
1495
+ ...u,
1496
+ data: {},
1497
+ type: a
1498
+ } : u)
1499
+ );
1500
+ },
1501
+ [t]
1502
+ ), n = $(
1503
+ (c) => {
1504
+ const a = l().find((r) => r.selected);
1505
+ a && o(a.id, c);
1506
+ },
1507
+ [l, o]
1508
+ ), f = $(
1509
+ (c) => {
1510
+ const a = l().find((r) => r.selected);
1511
+ a && h(a.id, c);
1512
+ },
1513
+ [l, h]
1514
+ ), d = $(() => {
1515
+ const c = l().find((a) => a.selected);
1516
+ c && (t((a) => a.filter((r) => r.id !== c.id)), s((a) => a.filter((r) => r.source !== c.id && r.target !== c.id)));
1517
+ }, [l, t, s]);
1518
+ return {
1519
+ clearSelection: i,
1520
+ deleteSelectedNode: d,
1521
+ updateNodeData: h,
1522
+ updateNodeType: o,
1523
+ updateSelectedNodeData: f,
1524
+ updateSelectedNodeType: n
1525
+ };
1526
+ }, ee = () => {
1527
+ const t = $e(), s = le(() => t.filter(Se), [t]), l = le(() => t.filter((h) => h.selected), [t]), i = le(() => t.find((h) => h.selected), [t]);
1528
+ return {
1529
+ groupNodes: s,
1530
+ hasSelectedNodes: l.length > 0,
1531
+ nodes: t,
1532
+ selectedNode: i,
1533
+ selectedNodes: l
1534
+ };
1535
+ }, Oa = () => {
1536
+ const [t, s] = z("en"), { updateSelectedNodeData: l } = me(), { selectedNode: i } = ee(), h = G(), { Field: o } = ne({
1537
+ defaultValues: {
1538
+ label: i?.data?.label || { en: "" },
1539
+ targetId: i?.data?.targetId || ""
1540
+ },
1541
+ listeners: {
1542
+ onChange: ({ formApi: n }) => {
1543
+ n.handleSubmit().then();
1544
+ },
1545
+ onChangeDebounceMs: 150
1546
+ },
1547
+ onSubmit: ({ value: n }) => {
1548
+ l(n);
1549
+ }
1550
+ });
1551
+ return /* @__PURE__ */ e.jsx(
1552
+ "form",
1553
+ {
1554
+ onSubmit: (n) => {
1555
+ n.preventDefault(), n.stopPropagation();
1556
+ },
1557
+ children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-6", children: [
1558
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
1559
+ /* @__PURE__ */ e.jsx(
1560
+ o,
1561
+ {
1562
+ name: "label",
1563
+ children: (n) => /* @__PURE__ */ e.jsxs(N, { className: "flex-1", children: [
1564
+ /* @__PURE__ */ e.jsx(j, { htmlFor: n.name, children: h("editor.flowNodeForm.label") }),
1565
+ /* @__PURE__ */ e.jsx(
1566
+ D,
1567
+ {
1568
+ id: n.name,
1569
+ name: n.name,
1570
+ value: n.state.value?.[t] || "",
1571
+ onBlur: n.handleBlur,
1572
+ onChange: ({ target: f }) => {
1573
+ n.handleChange({
1574
+ ...n.state.value,
1575
+ [t]: f.value
1576
+ });
1577
+ }
1578
+ }
1579
+ )
1580
+ ] })
1581
+ }
1582
+ ),
1583
+ /* @__PURE__ */ e.jsx(q, { value: t, onValueChange: s })
1584
+ ] }),
1585
+ /* @__PURE__ */ e.jsx(
1586
+ o,
1587
+ {
1588
+ name: "targetId",
1589
+ children: (n) => /* @__PURE__ */ e.jsxs(N, { children: [
1590
+ /* @__PURE__ */ e.jsxs(j, { htmlFor: n.name, children: [
1591
+ h("editor.flowNodeForm.targetId"),
1592
+ " (Flow ID)"
1593
+ ] }),
1594
+ /* @__PURE__ */ e.jsx(
1595
+ D,
1596
+ {
1597
+ id: n.name,
1598
+ name: n.name,
1599
+ value: n.state.value,
1600
+ onBlur: n.handleBlur,
1601
+ onChange: ({ target: f }) => n.handleChange(f.value)
1602
+ }
1603
+ ),
1604
+ /* @__PURE__ */ e.jsx(M, { children: "Unique identifier of the target flow." })
1605
+ ] })
1606
+ }
1607
+ )
1608
+ ] })
1609
+ }
1610
+ );
1611
+ }, Ma = () => {
1612
+ const [t, s] = z("en"), { selectedNode: l } = ee(), { updateSelectedNodeData: i } = me(), { Field: h } = ne({
1613
+ defaultValues: {
1614
+ label: l?.data?.label || { en: "" }
1615
+ },
1616
+ listeners: {
1617
+ onChange: ({ formApi: o }) => {
1618
+ o.handleSubmit().then();
1619
+ },
1620
+ onChangeDebounceMs: 150
1621
+ },
1622
+ onSubmit: ({ value: o }) => {
1623
+ i(o);
1624
+ }
1625
+ });
1626
+ return /* @__PURE__ */ e.jsx(
1627
+ "form",
1628
+ {
1629
+ onSubmit: (o) => {
1630
+ o.preventDefault(), o.stopPropagation();
1631
+ },
1632
+ children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
1633
+ /* @__PURE__ */ e.jsx(
1634
+ h,
1635
+ {
1636
+ name: "label",
1637
+ children: (o) => /* @__PURE__ */ e.jsxs(N, { className: "flex-1", children: [
1638
+ /* @__PURE__ */ e.jsx(j, { htmlFor: o.name, children: "Label" }),
1639
+ /* @__PURE__ */ e.jsx(
1640
+ D,
1641
+ {
1642
+ id: o.name,
1643
+ name: o.name,
1644
+ value: o.state.value?.[t] || "",
1645
+ onBlur: o.handleBlur,
1646
+ onChange: ({ target: n }) => {
1647
+ o.handleChange({
1648
+ ...o.state.value,
1649
+ [t]: n.value
1650
+ });
1651
+ }
1652
+ }
1653
+ )
1654
+ ] })
1655
+ }
1656
+ ),
1657
+ /* @__PURE__ */ e.jsx(q, { value: t, onValueChange: s })
1658
+ ] })
1659
+ }
1660
+ );
1661
+ }, La = ["POST", "PUT", "PATCH"], Ga = ({ value: t, onChange: s }) => {
1662
+ const { selectedNode: l } = ee(), i = G(), h = Ee(l?.id), { handleSubmit: o, Field: n, Subscribe: f } = ne({
1663
+ defaultValues: {
1664
+ body: t?.body || "",
1665
+ fetchOnMount: t?.fetchOnMount ?? !t?.searchParam,
1666
+ headers: t?.headers || [],
1667
+ method: t?.method || "GET",
1668
+ responseMapping: t?.responseMapping || {
1669
+ labelField: "",
1670
+ valueField: ""
1671
+ },
1672
+ responsePath: t?.responsePath || "",
1673
+ searchParam: t?.searchParam || "",
1674
+ sendFormData: !!t?.sendFormData,
1675
+ showLoading: t?.showLoading !== !1,
1676
+ url: t?.url || ""
1677
+ },
1678
+ listeners: {
1679
+ onChange: ({ formApi: d }) => {
1680
+ d.handleSubmit().then();
1681
+ },
1682
+ onChangeDebounceMs: 150
1683
+ },
1684
+ onSubmit: ({ value: d }) => {
1685
+ s(d);
1686
+ }
1687
+ });
1688
+ return /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-6", children: [
1689
+ /* @__PURE__ */ e.jsx(
1690
+ n,
1691
+ {
1692
+ name: "url",
1693
+ children: (d) => /* @__PURE__ */ e.jsxs(N, { children: [
1694
+ /* @__PURE__ */ e.jsx(j, { htmlFor: d.name, children: i("editor.httpConfigForm.apiUrl") }),
1695
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
1696
+ /* @__PURE__ */ e.jsx(
1697
+ D,
1698
+ {
1699
+ id: d.name,
1700
+ name: d.name,
1701
+ value: d.state.value,
1702
+ onBlur: d.handleBlur,
1703
+ onChange: ({ target: c }) => d.handleChange(c.value),
1704
+ placeholder: i("editor.httpConfigForm.apiUrlPlaceholder"),
1705
+ className: "flex-1"
1706
+ }
1707
+ ),
1708
+ /* @__PURE__ */ e.jsxs(fe, { children: [
1709
+ /* @__PURE__ */ e.jsx(be, { asChild: !0, children: /* @__PURE__ */ e.jsx(S, { type: "button", variant: "outline", size: "icon", children: /* @__PURE__ */ e.jsx(we, { className: "h-4 w-4" }) }) }),
1710
+ /* @__PURE__ */ e.jsx(Ne, { align: "end", children: h.length === 0 ? /* @__PURE__ */ e.jsx(W, { disabled: !0, children: i("editor.httpConfigForm.noFieldsAvailable") }) : h.map((c) => /* @__PURE__ */ e.jsx(
1711
+ W,
1712
+ {
1713
+ onClick: () => {
1714
+ const a = `{{${c.nodeId}}}`, r = d.state.value || "";
1715
+ d.handleChange(r + a);
1716
+ },
1717
+ children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
1718
+ /* @__PURE__ */ e.jsx("span", { className: "font-medium", children: c.label }),
1719
+ /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground text-xs", children: `{{${c.nodeId}}}` })
1720
+ ] })
1721
+ },
1722
+ c.nodeId
1723
+ )) })
1724
+ ] })
1725
+ ] }),
1726
+ /* @__PURE__ */ e.jsx(M, { children: i("editor.httpConfigForm.apiUrlDesc") })
1727
+ ] })
1728
+ }
1729
+ ),
1730
+ /* @__PURE__ */ e.jsx(
1731
+ n,
1732
+ {
1733
+ name: "method",
1734
+ children: (d) => /* @__PURE__ */ e.jsxs(N, { children: [
1735
+ /* @__PURE__ */ e.jsx(j, { htmlFor: d.name, children: i("editor.httpConfigForm.httpMethod") }),
1736
+ /* @__PURE__ */ e.jsxs(
1737
+ _,
1738
+ {
1739
+ value: d.state.value,
1740
+ onValueChange: (c) => d.handleChange(c),
1741
+ children: [
1742
+ /* @__PURE__ */ e.jsx(R, { id: d.name, children: /* @__PURE__ */ e.jsx(Z, { placeholder: i("editor.httpConfigForm.selectMethod") }) }),
1743
+ /* @__PURE__ */ e.jsxs(K, { children: [
1744
+ /* @__PURE__ */ e.jsx(y, { value: "GET", children: i("editor.httpConfigForm.methodGet") }),
1745
+ /* @__PURE__ */ e.jsx(y, { value: "POST", children: i("editor.httpConfigForm.methodPost") }),
1746
+ /* @__PURE__ */ e.jsx(y, { value: "PUT", children: i("editor.httpConfigForm.methodPut") }),
1747
+ /* @__PURE__ */ e.jsx(y, { value: "DELETE", children: i("editor.httpConfigForm.methodDelete") }),
1748
+ /* @__PURE__ */ e.jsx(y, { value: "PATCH", children: i("editor.httpConfigForm.methodPatch") })
1749
+ ] })
1750
+ ]
1751
+ }
1752
+ )
1753
+ ] })
1754
+ }
1755
+ ),
1756
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
1757
+ /* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-sm", children: i("editor.httpConfigForm.headers") }),
1758
+ /* @__PURE__ */ e.jsx(n, { name: "headers", mode: "array", children: (d) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
1759
+ d.state.value?.map((c, a) => {
1760
+ const r = `headers[${a}]`;
1761
+ return /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2", children: [
1762
+ /* @__PURE__ */ e.jsx(n, { name: `headers[${a}].key`, children: (u) => /* @__PURE__ */ e.jsx(
1763
+ D,
1764
+ {
1765
+ placeholder: i("editor.httpConfigForm.headerName"),
1766
+ value: u.state.value || "",
1767
+ onChange: ({ target: m }) => u.handleChange(m.value)
1768
+ }
1769
+ ) }),
1770
+ /* @__PURE__ */ e.jsx(n, { name: `headers[${a}].value`, children: (u) => /* @__PURE__ */ e.jsx(
1771
+ D,
1772
+ {
1773
+ placeholder: i("editor.httpConfigForm.headerValue"),
1774
+ value: u.state.value || "",
1775
+ onChange: ({ target: m }) => u.handleChange(m.value)
1776
+ }
1777
+ ) }),
1778
+ /* @__PURE__ */ e.jsx(
1779
+ S,
1780
+ {
1781
+ type: "button",
1782
+ variant: "ghost",
1783
+ size: "icon",
1784
+ onClick: () => {
1785
+ d.removeValue(a);
1786
+ },
1787
+ children: /* @__PURE__ */ e.jsx(se, { className: "h-4 w-4" })
1788
+ }
1789
+ )
1790
+ ] }, r);
1791
+ }),
1792
+ /* @__PURE__ */ e.jsxs(
1793
+ S,
1794
+ {
1795
+ type: "button",
1796
+ variant: "outline",
1797
+ size: "sm",
1798
+ onClick: () => {
1799
+ d.pushValue({ key: "", value: "" });
1800
+ },
1801
+ children: [
1802
+ /* @__PURE__ */ e.jsx(X, { className: "mr-2 h-4 w-4" }),
1803
+ i("editor.httpConfigForm.addHeader")
1804
+ ]
1805
+ }
1806
+ )
1807
+ ] }) })
1808
+ ] }),
1809
+ /* @__PURE__ */ e.jsx(f, { selector: (d) => ({ method: d.values.method, sendFormData: d.values.sendFormData }), children: ({ method: d, sendFormData: c }) => La.includes(d || "") && /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
1810
+ /* @__PURE__ */ e.jsx(n, { name: "sendFormData", children: (a) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
1811
+ /* @__PURE__ */ e.jsx(J, { id: a.name, checked: a.state.value, onCheckedChange: (r) => a.handleChange(r) }),
1812
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: i("editor.httpConfigForm.sendFormData") })
1813
+ ] }) }),
1814
+ /* @__PURE__ */ e.jsx(n, { name: "body", children: (a) => /* @__PURE__ */ e.jsxs(N, { children: [
1815
+ /* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
1816
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: i("editor.httpConfigForm.requestBody") }),
1817
+ /* @__PURE__ */ e.jsxs(fe, { children: [
1818
+ /* @__PURE__ */ e.jsx(be, { asChild: !0, children: /* @__PURE__ */ e.jsxs(S, { type: "button", variant: "ghost", size: "sm", disabled: c, children: [
1819
+ /* @__PURE__ */ e.jsx(we, { className: "mr-2 h-4 w-4" }),
1820
+ i("editor.httpConfigForm.insertVariable")
1821
+ ] }) }),
1822
+ /* @__PURE__ */ e.jsx(Ne, { align: "end", children: h.length === 0 ? /* @__PURE__ */ e.jsx(W, { disabled: !0, children: i("editor.httpConfigForm.noFieldsAvailable") }) : h.map((r) => /* @__PURE__ */ e.jsx(
1823
+ W,
1824
+ {
1825
+ onClick: () => {
1826
+ const u = `{{${r.nodeId}}}`, m = a.state.value || "";
1827
+ a.handleChange(m + u), o().then();
1828
+ },
1829
+ children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
1830
+ /* @__PURE__ */ e.jsx("span", { className: "font-medium", children: r.label }),
1831
+ /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground text-xs", children: `{{${r.nodeId}}}` })
1832
+ ] })
1833
+ },
1834
+ r.nodeId
1835
+ )) })
1836
+ ] })
1837
+ ] }),
1838
+ /* @__PURE__ */ e.jsx(
1839
+ Ge,
1840
+ {
1841
+ id: a.name,
1842
+ name: a.name,
1843
+ value: a.state.value,
1844
+ onBlur: a.handleBlur,
1845
+ onChange: ({ target: r }) => a.handleChange(r.value),
1846
+ placeholder: i("editor.httpConfigForm.requestBodyPlaceholder"),
1847
+ rows: 4,
1848
+ disabled: c
1849
+ }
1850
+ ),
1851
+ /* @__PURE__ */ e.jsx(M, { children: i(c ? "editor.httpConfigForm.sendFormDataDesc" : "editor.httpConfigForm.requestBodyDesc") })
1852
+ ] }) })
1853
+ ] }) }),
1854
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
1855
+ /* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-sm", children: i("editor.httpConfigForm.responseConfiguration") }),
1856
+ /* @__PURE__ */ e.jsx(
1857
+ n,
1858
+ {
1859
+ name: "responsePath",
1860
+ children: (d) => /* @__PURE__ */ e.jsxs(N, { children: [
1861
+ /* @__PURE__ */ e.jsx(j, { htmlFor: d.name, children: i("editor.httpConfigForm.responsePath") }),
1862
+ /* @__PURE__ */ e.jsx(
1863
+ D,
1864
+ {
1865
+ id: d.name,
1866
+ name: d.name,
1867
+ value: d.state.value,
1868
+ onBlur: d.handleBlur,
1869
+ onChange: ({ target: c }) => d.handleChange(c.value),
1870
+ placeholder: i("editor.httpConfigForm.responsePathPlaceholder")
1871
+ }
1872
+ ),
1873
+ /* @__PURE__ */ e.jsx(M, { children: i("editor.httpConfigForm.responsePathDesc") })
1874
+ ] })
1875
+ }
1876
+ ),
1877
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
1878
+ /* @__PURE__ */ e.jsx("h5", { className: "font-medium text-sm", children: i("editor.httpConfigForm.mapToOptions") }),
1879
+ /* @__PURE__ */ e.jsx(
1880
+ n,
1881
+ {
1882
+ name: "responseMapping.valueField",
1883
+ children: (d) => /* @__PURE__ */ e.jsxs(N, { children: [
1884
+ /* @__PURE__ */ e.jsx(j, { htmlFor: d.name, children: i("editor.httpConfigForm.valueField") }),
1885
+ /* @__PURE__ */ e.jsx(
1886
+ D,
1887
+ {
1888
+ id: d.name,
1889
+ name: d.name,
1890
+ value: d.state.value,
1891
+ onBlur: d.handleBlur,
1892
+ onChange: ({ target: c }) => d.handleChange(c.value),
1893
+ placeholder: i("editor.httpConfigForm.valueFieldPlaceholder")
1894
+ }
1895
+ ),
1896
+ /* @__PURE__ */ e.jsx(M, { children: i("editor.httpConfigForm.valueFieldDesc") })
1897
+ ] })
1898
+ }
1899
+ ),
1900
+ /* @__PURE__ */ e.jsx(
1901
+ n,
1902
+ {
1903
+ name: "responseMapping.labelField",
1904
+ children: (d) => /* @__PURE__ */ e.jsxs(N, { children: [
1905
+ /* @__PURE__ */ e.jsx(j, { htmlFor: d.name, children: i("editor.httpConfigForm.labelField") }),
1906
+ /* @__PURE__ */ e.jsx(
1907
+ D,
1908
+ {
1909
+ id: d.name,
1910
+ name: d.name,
1911
+ value: d.state.value,
1912
+ onBlur: d.handleBlur,
1913
+ onChange: ({ target: c }) => d.handleChange(c.value),
1914
+ placeholder: i("editor.httpConfigForm.labelFieldPlaceholder")
1915
+ }
1916
+ ),
1917
+ /* @__PURE__ */ e.jsx(M, { children: i("editor.httpConfigForm.labelFieldDesc") })
1918
+ ] })
1919
+ }
1920
+ )
1921
+ ] }),
1922
+ /* @__PURE__ */ e.jsx(
1923
+ n,
1924
+ {
1925
+ name: "searchParam",
1926
+ children: (d) => /* @__PURE__ */ e.jsxs(N, { children: [
1927
+ /* @__PURE__ */ e.jsx(j, { htmlFor: d.name, children: i("editor.httpConfigForm.searchParameter") }),
1928
+ /* @__PURE__ */ e.jsx(
1929
+ D,
1930
+ {
1931
+ id: d.name,
1932
+ name: d.name,
1933
+ value: d.state.value,
1934
+ onBlur: d.handleBlur,
1935
+ onChange: ({ target: c }) => d.handleChange(c.value),
1936
+ placeholder: i("editor.httpConfigForm.searchParameterPlaceholder")
1937
+ }
1938
+ ),
1939
+ /* @__PURE__ */ e.jsx(M, { children: i("editor.httpConfigForm.searchParameterDesc") })
1940
+ ] })
1941
+ }
1942
+ )
1943
+ ] }),
1944
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
1945
+ /* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-sm", children: i("editor.httpConfigForm.behavior") }),
1946
+ /* @__PURE__ */ e.jsx(f, { selector: (d) => d.values.searchParam, children: (d) => /* @__PURE__ */ e.jsx(n, { name: "fetchOnMount", children: (c) => {
1947
+ const a = !!d?.trim(), r = a ? c.state.value : !0;
1948
+ return !a && c.state.value !== !0 && c.handleChange(!0), /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
1949
+ /* @__PURE__ */ e.jsx(
1950
+ J,
1951
+ {
1952
+ id: c.name,
1953
+ checked: r,
1954
+ disabled: !a,
1955
+ onCheckedChange: (u) => c.handleChange(u)
1956
+ }
1957
+ ),
1958
+ /* @__PURE__ */ e.jsx(j, { htmlFor: c.name, className: a ? "" : "text-muted-foreground", children: i("editor.httpConfigForm.fetchOnMount") })
1959
+ ] });
1960
+ } }) }),
1961
+ /* @__PURE__ */ e.jsx(
1962
+ n,
1963
+ {
1964
+ name: "showLoading",
1965
+ children: (d) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
1966
+ /* @__PURE__ */ e.jsx(J, { id: d.name, checked: d.state.value, onCheckedChange: (c) => d.handleChange(c) }),
1967
+ /* @__PURE__ */ e.jsx(j, { htmlFor: d.name, children: i("editor.httpConfigForm.showLoadingState") })
1968
+ ] })
1969
+ }
1970
+ )
1971
+ ] })
1972
+ ] }) });
1973
+ }, Ba = ["POST", "PUT", "PATCH"], $a = ({ value: t, onChange: s }) => {
1974
+ const [l, i] = z("en"), { selectedNode: h } = ee(), o = G(), n = Ee(h?.id), { handleSubmit: f, Field: d, Subscribe: c } = ne({
1975
+ defaultValues: {
1976
+ body: t?.body || "",
1977
+ errorMessage: t?.errorMessage || { en: "" },
1978
+ headers: t?.headers || [],
1979
+ method: t?.method || "POST",
1980
+ redirectUrl: t?.redirectUrl || "",
1981
+ sendFormData: !!t?.sendFormData,
1982
+ showLoading: t?.showLoading !== !1,
1983
+ successMessage: t?.successMessage || { en: "" },
1984
+ url: t?.url || ""
1985
+ },
1986
+ listeners: {
1987
+ onChange: ({ formApi: a }) => {
1988
+ a.handleSubmit().then();
1989
+ },
1990
+ onChangeDebounceMs: 150
1991
+ },
1992
+ onSubmit: ({ value: a }) => {
1993
+ s(a);
1994
+ }
1995
+ });
1996
+ return /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-6", children: [
1997
+ /* @__PURE__ */ e.jsx(
1998
+ d,
1999
+ {
2000
+ name: "url",
2001
+ children: (a) => /* @__PURE__ */ e.jsxs(N, { children: [
2002
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: o("editor.submitConfigForm.apiUrl") }),
2003
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
2004
+ /* @__PURE__ */ e.jsx(
2005
+ D,
2006
+ {
2007
+ id: a.name,
2008
+ name: a.name,
2009
+ value: a.state.value,
2010
+ onBlur: a.handleBlur,
2011
+ onChange: ({ target: r }) => a.handleChange(r.value),
2012
+ placeholder: o("editor.submitConfigForm.apiUrlPlaceholder"),
2013
+ className: "flex-1"
2014
+ }
2015
+ ),
2016
+ /* @__PURE__ */ e.jsxs(fe, { children: [
2017
+ /* @__PURE__ */ e.jsx(be, { asChild: !0, children: /* @__PURE__ */ e.jsx(S, { type: "button", variant: "outline", size: "icon", children: /* @__PURE__ */ e.jsx(we, { className: "h-4 w-4" }) }) }),
2018
+ /* @__PURE__ */ e.jsx(Ne, { align: "end", children: n.length === 0 ? /* @__PURE__ */ e.jsx(W, { disabled: !0, children: o("editor.submitConfigForm.noFieldsAvailable") }) : n.map((r) => /* @__PURE__ */ e.jsx(
2019
+ W,
2020
+ {
2021
+ onClick: () => {
2022
+ const u = `{{${r.nodeId}}}`, m = a.state.value || "";
2023
+ a.handleChange(m + u);
2024
+ },
2025
+ children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
2026
+ /* @__PURE__ */ e.jsx("span", { className: "font-medium", children: r.label }),
2027
+ /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground text-xs", children: `{{${r.nodeId}}}` })
2028
+ ] })
2029
+ },
2030
+ r.nodeId
2031
+ )) })
2032
+ ] })
2033
+ ] }),
2034
+ /* @__PURE__ */ e.jsx(M, { children: o("editor.submitConfigForm.apiUrlDesc") })
2035
+ ] })
2036
+ }
2037
+ ),
2038
+ /* @__PURE__ */ e.jsx(
2039
+ d,
2040
+ {
2041
+ name: "method",
2042
+ children: (a) => /* @__PURE__ */ e.jsxs(N, { children: [
2043
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: o("editor.submitConfigForm.httpMethod") }),
2044
+ /* @__PURE__ */ e.jsxs(
2045
+ _,
2046
+ {
2047
+ value: a.state.value,
2048
+ onValueChange: (r) => a.handleChange(r),
2049
+ children: [
2050
+ /* @__PURE__ */ e.jsx(R, { id: a.name, children: /* @__PURE__ */ e.jsx(Z, { placeholder: o("editor.submitConfigForm.selectMethod") }) }),
2051
+ /* @__PURE__ */ e.jsxs(K, { children: [
2052
+ /* @__PURE__ */ e.jsx(y, { value: "POST", children: o("editor.submitConfigForm.methodPost") }),
2053
+ /* @__PURE__ */ e.jsx(y, { value: "PUT", children: o("editor.submitConfigForm.methodPut") }),
2054
+ /* @__PURE__ */ e.jsx(y, { value: "DELETE", children: o("editor.submitConfigForm.methodDelete") }),
2055
+ /* @__PURE__ */ e.jsx(y, { value: "PATCH", children: o("editor.submitConfigForm.methodPatch") })
2056
+ ] })
2057
+ ]
2058
+ }
2059
+ )
2060
+ ] })
2061
+ }
2062
+ ),
2063
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
2064
+ /* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-sm", children: o("editor.submitConfigForm.headers") }),
2065
+ /* @__PURE__ */ e.jsx(d, { name: "headers", mode: "array", children: (a) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
2066
+ a.state.value?.map((r, u) => {
2067
+ const m = `headers[${u}]`;
2068
+ return /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2", children: [
2069
+ /* @__PURE__ */ e.jsx(d, { name: `headers[${u}].key`, children: (p) => /* @__PURE__ */ e.jsx(
2070
+ D,
2071
+ {
2072
+ placeholder: o("editor.submitConfigForm.headerName"),
2073
+ value: p.state.value || "",
2074
+ onChange: ({ target: x }) => p.handleChange(x.value)
2075
+ }
2076
+ ) }),
2077
+ /* @__PURE__ */ e.jsx(d, { name: `headers[${u}].value`, children: (p) => /* @__PURE__ */ e.jsx(
2078
+ D,
2079
+ {
2080
+ placeholder: o("editor.submitConfigForm.headerValue"),
2081
+ value: p.state.value || "",
2082
+ onChange: ({ target: x }) => p.handleChange(x.value)
2083
+ }
2084
+ ) }),
2085
+ /* @__PURE__ */ e.jsx(
2086
+ S,
2087
+ {
2088
+ type: "button",
2089
+ variant: "ghost",
2090
+ size: "icon",
2091
+ onClick: () => {
2092
+ a.removeValue(u);
2093
+ },
2094
+ children: /* @__PURE__ */ e.jsx(se, { className: "h-4 w-4" })
2095
+ }
2096
+ )
2097
+ ] }, m);
2098
+ }),
2099
+ /* @__PURE__ */ e.jsxs(
2100
+ S,
2101
+ {
2102
+ type: "button",
2103
+ variant: "outline",
2104
+ size: "sm",
2105
+ onClick: () => {
2106
+ a.pushValue({ key: "", value: "" });
2107
+ },
2108
+ children: [
2109
+ /* @__PURE__ */ e.jsx(X, { className: "mr-2 h-4 w-4" }),
2110
+ o("editor.submitConfigForm.addHeader")
2111
+ ]
2112
+ }
2113
+ )
2114
+ ] }) })
2115
+ ] }),
2116
+ /* @__PURE__ */ e.jsx(c, { selector: (a) => ({ method: a.values.method, sendFormData: a.values.sendFormData }), children: ({ method: a, sendFormData: r }) => Ba.includes(a || "") && /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
2117
+ /* @__PURE__ */ e.jsx(d, { name: "sendFormData", children: (u) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2118
+ /* @__PURE__ */ e.jsx(J, { id: u.name, checked: u.state.value, onCheckedChange: (m) => u.handleChange(m) }),
2119
+ /* @__PURE__ */ e.jsx(j, { htmlFor: u.name, children: o("editor.submitConfigForm.sendFormData") })
2120
+ ] }) }),
2121
+ /* @__PURE__ */ e.jsx(d, { name: "body", children: (u) => /* @__PURE__ */ e.jsxs(N, { children: [
2122
+ /* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
2123
+ /* @__PURE__ */ e.jsx(j, { htmlFor: u.name, children: o("editor.submitConfigForm.requestBody") }),
2124
+ /* @__PURE__ */ e.jsxs(fe, { children: [
2125
+ /* @__PURE__ */ e.jsx(be, { asChild: !0, children: /* @__PURE__ */ e.jsxs(S, { type: "button", variant: "ghost", size: "sm", disabled: r, children: [
2126
+ /* @__PURE__ */ e.jsx(we, { className: "mr-2 h-4 w-4" }),
2127
+ o("editor.submitConfigForm.insertVariable")
2128
+ ] }) }),
2129
+ /* @__PURE__ */ e.jsx(Ne, { align: "end", children: n.length === 0 ? /* @__PURE__ */ e.jsx(W, { disabled: !0, children: o("editor.submitConfigForm.noFieldsAvailable") }) : n.map((m) => /* @__PURE__ */ e.jsx(
2130
+ W,
2131
+ {
2132
+ onClick: () => {
2133
+ const p = `{{${m.nodeId}}}`, x = u.state.value || "";
2134
+ u.handleChange(x + p), f().then();
2135
+ },
2136
+ children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
2137
+ /* @__PURE__ */ e.jsx("span", { className: "font-medium", children: m.label }),
2138
+ /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground text-xs", children: `{{${m.nodeId}}}` })
2139
+ ] })
2140
+ },
2141
+ m.nodeId
2142
+ )) })
2143
+ ] })
2144
+ ] }),
2145
+ /* @__PURE__ */ e.jsx(
2146
+ Ge,
2147
+ {
2148
+ id: u.name,
2149
+ name: u.name,
2150
+ value: u.state.value,
2151
+ onBlur: u.handleBlur,
2152
+ onChange: ({ target: m }) => u.handleChange(m.value),
2153
+ placeholder: o("editor.submitConfigForm.requestBodyPlaceholder"),
2154
+ rows: 4,
2155
+ disabled: r
2156
+ }
2157
+ ),
2158
+ /* @__PURE__ */ e.jsx(M, { children: o(r ? "editor.submitConfigForm.sendFormDataDesc" : "editor.submitConfigForm.requestBodyDesc") })
2159
+ ] }) })
2160
+ ] }) }),
2161
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
2162
+ /* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-sm", children: o("editor.submitConfigForm.postSubmission") }),
2163
+ /* @__PURE__ */ e.jsx(
2164
+ d,
2165
+ {
2166
+ name: "redirectUrl",
2167
+ children: (a) => /* @__PURE__ */ e.jsxs(N, { children: [
2168
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: o("editor.submitConfigForm.redirectUrl") }),
2169
+ /* @__PURE__ */ e.jsx(
2170
+ D,
2171
+ {
2172
+ id: a.name,
2173
+ name: a.name,
2174
+ value: a.state.value,
2175
+ onBlur: a.handleBlur,
2176
+ onChange: ({ target: r }) => a.handleChange(r.value),
2177
+ placeholder: o("editor.submitConfigForm.redirectUrlPlaceholder")
2178
+ }
2179
+ ),
2180
+ /* @__PURE__ */ e.jsx(M, { children: o("editor.submitConfigForm.redirectUrlDesc") })
2181
+ ] })
2182
+ }
2183
+ ),
2184
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2185
+ /* @__PURE__ */ e.jsx(
2186
+ d,
2187
+ {
2188
+ name: "successMessage",
2189
+ children: (a) => /* @__PURE__ */ e.jsxs(N, { className: "flex-1", children: [
2190
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: o("editor.submitConfigForm.successMessage") }),
2191
+ /* @__PURE__ */ e.jsx(
2192
+ D,
2193
+ {
2194
+ id: a.name,
2195
+ name: a.name,
2196
+ value: a.state.value?.[l] || "",
2197
+ onBlur: a.handleBlur,
2198
+ onChange: ({ target: r }) => {
2199
+ a.handleChange({
2200
+ ...typeof a.state.value == "object" && a.state.value !== null ? a.state.value : {},
2201
+ [l]: r.value
2202
+ });
2203
+ },
2204
+ placeholder: o("editor.submitConfigForm.successMessagePlaceholder")
2205
+ }
2206
+ ),
2207
+ /* @__PURE__ */ e.jsx(M, { children: o("editor.submitConfigForm.successMessageDesc") })
2208
+ ] })
2209
+ }
2210
+ ),
2211
+ /* @__PURE__ */ e.jsx(q, { value: l, onValueChange: i })
2212
+ ] }),
2213
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2214
+ /* @__PURE__ */ e.jsx(
2215
+ d,
2216
+ {
2217
+ name: "errorMessage",
2218
+ children: (a) => /* @__PURE__ */ e.jsxs(N, { className: "flex-1", children: [
2219
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: o("editor.submitConfigForm.errorMessage") }),
2220
+ /* @__PURE__ */ e.jsx(
2221
+ D,
2222
+ {
2223
+ id: a.name,
2224
+ name: a.name,
2225
+ value: a.state.value?.[l] || "",
2226
+ onBlur: a.handleBlur,
2227
+ onChange: ({ target: r }) => {
2228
+ a.handleChange({
2229
+ ...typeof a.state.value == "object" && a.state.value !== null ? a.state.value : {},
2230
+ [l]: r.value
2231
+ });
2232
+ },
2233
+ placeholder: o("editor.submitConfigForm.errorMessagePlaceholder")
2234
+ }
2235
+ ),
2236
+ /* @__PURE__ */ e.jsx(M, { children: o("editor.submitConfigForm.errorMessageDesc") })
2237
+ ] })
2238
+ }
2239
+ ),
2240
+ /* @__PURE__ */ e.jsx(q, { value: l, onValueChange: i })
2241
+ ] })
2242
+ ] }),
2243
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
2244
+ /* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-sm", children: o("editor.submitConfigForm.behavior") }),
2245
+ /* @__PURE__ */ e.jsx(
2246
+ d,
2247
+ {
2248
+ name: "showLoading",
2249
+ children: (a) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2250
+ /* @__PURE__ */ e.jsx(J, { id: a.name, checked: a.state.value, onCheckedChange: (r) => a.handleChange(r) }),
2251
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: o("editor.submitConfigForm.showLoadingState") })
2252
+ ] })
2253
+ }
2254
+ )
2255
+ ] })
2256
+ ] }) });
2257
+ }, za = ({
2258
+ options: t,
2259
+ id: s,
2260
+ value: l,
2261
+ onValueChange: i,
2262
+ placeholder: h = "Select...",
2263
+ searchPlaceholder: o = "Search or create...",
2264
+ createLabel: n = (u) => `Use: ${u}`,
2265
+ clearLabel: f = "Clear selection",
2266
+ emptyLabel: d = "No results found",
2267
+ className: c,
2268
+ allowClear: a = !0,
2269
+ allowCreate: r = !0
2270
+ }) => {
2271
+ const [u, m] = z(!1), [p, x] = z(""), F = (P) => P ?? "", g = (P) => P.trim().toLowerCase(), w = F(l), C = l !== null && l !== "", I = C ? t.find((P) => F(P.value) === w) : void 0, b = g(p), E = r && b !== "" && !t.some((P) => g(P.label) === b || g(P.value ?? "") === b), A = (P) => {
2272
+ P === w ? a && i?.("") : i?.(P), m(!1), x("");
2273
+ }, V = () => {
2274
+ p.trim() && (i?.(p.trim()), m(!1), x(""));
2275
+ }, T = () => {
2276
+ i?.(""), m(!1), x("");
2277
+ };
2278
+ return /* @__PURE__ */ e.jsxs(Oe, { open: u, onOpenChange: m, children: [
2279
+ /* @__PURE__ */ e.jsx(Me, { asChild: !0, id: s, children: /* @__PURE__ */ e.jsxs(
2280
+ S,
2281
+ {
2282
+ type: "button",
2283
+ variant: "outline",
2284
+ role: "combobox",
2285
+ "aria-expanded": u,
2286
+ className: k("w-full justify-between font-normal", c),
2287
+ children: [
2288
+ /* @__PURE__ */ e.jsx("span", { className: "truncate", children: C && I ? I.label : h }),
2289
+ /* @__PURE__ */ e.jsx(re, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
2290
+ ]
2291
+ }
2292
+ ) }),
2293
+ /* @__PURE__ */ e.jsx(Le, { className: "w-full p-0", align: "start", children: /* @__PURE__ */ e.jsxs(ut, { shouldFilter: !1, children: [
2294
+ /* @__PURE__ */ e.jsx(ht, { placeholder: o, value: p, onValueChange: x }),
2295
+ /* @__PURE__ */ e.jsxs(mt, { children: [
2296
+ /* @__PURE__ */ e.jsx(pt, { children: d }),
2297
+ a && C && /* @__PURE__ */ e.jsx(_e, { children: /* @__PURE__ */ e.jsxs(Ve, { value: "__clear__", onSelect: T, className: "mt-1 text-muted-foreground", children: [
2298
+ /* @__PURE__ */ e.jsx(se, { className: "mr-2 h-4 w-4" }),
2299
+ f
2300
+ ] }) }),
2301
+ /* @__PURE__ */ e.jsxs(_e, { children: [
2302
+ E && /* @__PURE__ */ e.jsxs(Ve, { value: `__create__${p}`, onSelect: V, className: "text-primary", children: [
2303
+ /* @__PURE__ */ e.jsx(X, { className: "mr-2 h-4 w-4" }),
2304
+ n(p)
2305
+ ] }),
2306
+ t.filter((P) => {
2307
+ const v = p.toLowerCase();
2308
+ return P.label.toLowerCase().includes(v) || (P.value?.toLowerCase() ?? "").includes(v);
2309
+ }).map((P, v) => /* @__PURE__ */ e.jsxs(
2310
+ Ve,
2311
+ {
2312
+ value: P.label,
2313
+ onSelect: () => A(P?.value || ""),
2314
+ children: [
2315
+ /* @__PURE__ */ e.jsx(
2316
+ Gt,
2317
+ {
2318
+ "aria-hidden": "true",
2319
+ className: k(
2320
+ "mr-2 h-4 w-4",
2321
+ C && F(P.value) === w ? "opacity-100" : "opacity-0"
2322
+ )
2323
+ }
2324
+ ),
2325
+ P.label
2326
+ ]
2327
+ },
2328
+ P.value ?? P.label ?? v
2329
+ ))
2330
+ ] })
2331
+ ] })
2332
+ ] }) })
2333
+ ] });
2334
+ }, Ha = {
2335
+ alphanumeric: "^[a-zA-Z0-9]+$",
2336
+ email: "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",
2337
+ letters: "^[a-zA-Z]+$",
2338
+ number: "^[0-9]+$",
2339
+ url: "^https?:\\/\\/.+$"
2340
+ }, Ie = Object.entries(Ha).map(([t, s]) => ({
2341
+ label: t.charAt(0).toUpperCase() + t.slice(1).replace(/_/g, " "),
2342
+ value: s
2343
+ })), Ua = ({ id: t, value: s, onValueChange: l }) => {
2344
+ const i = le(() => s && !Ie.some((h) => h.value === s) ? [
2345
+ ...Ie,
2346
+ {
2347
+ label: `Custom: ${s}`,
2348
+ value: s
2349
+ }
2350
+ ] : Ie, [s]);
2351
+ return /* @__PURE__ */ e.jsx(
2352
+ za,
2353
+ {
2354
+ id: t,
2355
+ options: i,
2356
+ value: s,
2357
+ onValueChange: l,
2358
+ placeholder: "Select or create a pattern",
2359
+ searchPlaceholder: "Search patterns...",
2360
+ createLabel: (h) => `Use pattern: ${h}`
2361
+ }
2362
+ );
2363
+ }, _a = {
2364
+ address: "address",
2365
+ autocomplete: "autocomplete",
2366
+ checkbox: "checkbox",
2367
+ date: "date",
2368
+ daterange: "daterange",
2369
+ file: "file",
2370
+ hidden: "hidden",
2371
+ http: "http",
2372
+ number: "number",
2373
+ password: "password",
2374
+ radio: "radio",
2375
+ select: "select",
2376
+ submit: "submit",
2377
+ switch: "switch",
2378
+ text: "text",
2379
+ textarea: "textarea",
2380
+ time: "time",
2381
+ timerange: "timerange"
2382
+ }, Ra = ({ value: t, onValueChange: s }) => {
2383
+ const l = G(), i = Fe();
2384
+ return /* @__PURE__ */ e.jsxs(te, { children: [
2385
+ /* @__PURE__ */ e.jsx(Be, { htmlFor: i, children: l("editor.selectInputType.type") }),
2386
+ /* @__PURE__ */ e.jsxs(_, { value: t, onValueChange: s, children: [
2387
+ /* @__PURE__ */ e.jsx(R, { id: i, className: "w-full capitalize", children: /* @__PURE__ */ e.jsx(Z, { placeholder: "" }) }),
2388
+ /* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsx(te, { children: Object.values(_a).map((h) => /* @__PURE__ */ e.jsx(y, { value: h, className: "capitalize", children: h }, h)) }) })
2389
+ ] })
2390
+ ] });
2391
+ };
2392
+ function pe({ ...t }) {
2393
+ return /* @__PURE__ */ e.jsx(ze.Root, { "data-slot": "collapsible", ...t });
2394
+ }
2395
+ function xe({ ...t }) {
2396
+ return /* @__PURE__ */ e.jsx(ze.CollapsibleTrigger, { "data-slot": "collapsible-trigger", ...t });
2397
+ }
2398
+ function ge({ ...t }) {
2399
+ return /* @__PURE__ */ e.jsx(ze.CollapsibleContent, { "data-slot": "collapsible-content", ...t });
2400
+ }
2401
+ const Za = () => {
2402
+ const [t, s] = z("en"), { selectedNode: l } = ee(), { updateSelectedNodeData: i } = me(), h = ["select", "radio", "autocomplete", "checkbox"].includes(l?.data?.type || ""), o = Ee(l?.id), n = G(), f = l?.data?.type === "submit", { handleSubmit: d, Field: c } = ne({
2403
+ defaultValues: {
2404
+ defaultValue: l?.data?.defaultValue,
2405
+ disablePast: l?.data?.disablePast,
2406
+ errorMessage: l?.data?.errorMessage || { en: "" },
2407
+ helperText: l?.data?.helperText || { en: "" },
2408
+ httpConfig: l?.data?.httpConfig,
2409
+ label: l?.data?.label || { en: "" },
2410
+ multiple: l?.data?.multiple,
2411
+ name: l?.data?.name || "",
2412
+ options: l?.data?.options || [],
2413
+ pattern: l?.data?.pattern || "",
2414
+ placeholder: l?.data?.placeholder || { en: "" },
2415
+ required: l?.data?.required,
2416
+ submitConfig: l?.data?.submitConfig,
2417
+ type: l?.data?.type || ""
2418
+ },
2419
+ listeners: {
2420
+ onChange: ({ formApi: a }) => {
2421
+ a.handleSubmit().then();
2422
+ },
2423
+ onChangeDebounceMs: 150
2424
+ },
2425
+ onSubmit: ({ value: a }) => {
2426
+ i(a);
2427
+ }
2428
+ });
2429
+ return /* @__PURE__ */ e.jsx(
2430
+ "form",
2431
+ {
2432
+ onSubmit: (a) => {
2433
+ a.preventDefault(), a.stopPropagation();
2434
+ },
2435
+ children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-6", children: [
2436
+ /* @__PURE__ */ e.jsx(
2437
+ c,
2438
+ {
2439
+ name: "type",
2440
+ children: (a) => /* @__PURE__ */ e.jsx(N, { children: /* @__PURE__ */ e.jsx(Ra, { value: a.state.value, onValueChange: (r) => a.handleChange(r) }) })
2441
+ }
2442
+ ),
2443
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
2444
+ /* @__PURE__ */ e.jsx(
2445
+ c,
2446
+ {
2447
+ name: "label",
2448
+ children: (a) => /* @__PURE__ */ e.jsxs(N, { className: "flex-1", children: [
2449
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: n("editor.inputNodeForm.label") }),
2450
+ /* @__PURE__ */ e.jsx(
2451
+ D,
2452
+ {
2453
+ autoFocus: !0,
2454
+ id: a.name,
2455
+ name: a.name,
2456
+ value: a.state.value?.[t] || "",
2457
+ onBlur: a.handleBlur,
2458
+ onChange: ({ target: r }) => {
2459
+ a.handleChange({
2460
+ ...typeof a.state.value == "object" && a.state.value !== null ? a.state.value : {},
2461
+ [t]: r.value
2462
+ });
2463
+ }
2464
+ }
2465
+ )
2466
+ ] })
2467
+ }
2468
+ ),
2469
+ /* @__PURE__ */ e.jsx(q, { value: t, onValueChange: s })
2470
+ ] }),
2471
+ !f && l?.data?.type !== "file" && /* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
2472
+ /* @__PURE__ */ e.jsx(
2473
+ c,
2474
+ {
2475
+ name: "placeholder",
2476
+ children: (a) => /* @__PURE__ */ e.jsxs(N, { className: "flex-1", children: [
2477
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: n("editor.inputNodeForm.placeholder") }),
2478
+ /* @__PURE__ */ e.jsx(
2479
+ D,
2480
+ {
2481
+ id: a.name,
2482
+ name: a.name,
2483
+ value: a.state.value?.[t] || "",
2484
+ onBlur: a.handleBlur,
2485
+ onChange: ({ target: r }) => {
2486
+ a.handleChange({
2487
+ ...typeof a.state.value == "object" && a.state.value !== null ? a.state.value : {},
2488
+ [t]: r.value
2489
+ });
2490
+ }
2491
+ }
2492
+ )
2493
+ ] })
2494
+ }
2495
+ ),
2496
+ /* @__PURE__ */ e.jsx(q, { value: t, onValueChange: s })
2497
+ ] }),
2498
+ !f && /* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
2499
+ /* @__PURE__ */ e.jsx(
2500
+ c,
2501
+ {
2502
+ name: "helperText",
2503
+ children: (a) => /* @__PURE__ */ e.jsxs(N, { className: "flex-1", children: [
2504
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: n("editor.inputNodeForm.helperText") }),
2505
+ /* @__PURE__ */ e.jsx(
2506
+ D,
2507
+ {
2508
+ id: a.name,
2509
+ name: a.name,
2510
+ value: a.state.value?.[t] || "",
2511
+ onBlur: a.handleBlur,
2512
+ onChange: ({ target: r }) => {
2513
+ a.handleChange({
2514
+ ...typeof a.state.value == "object" && a.state.value !== null ? a.state.value : {},
2515
+ [t]: r.value
2516
+ });
2517
+ }
2518
+ }
2519
+ )
2520
+ ] })
2521
+ }
2522
+ ),
2523
+ /* @__PURE__ */ e.jsx(q, { value: t, onValueChange: s })
2524
+ ] }),
2525
+ l?.data?.type === "http" && /* @__PURE__ */ e.jsxs(pe, { defaultOpen: !0, className: "flex w-full max-w-[350px] flex-col gap-2", children: [
2526
+ /* @__PURE__ */ e.jsx(xe, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
2527
+ /* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-sm", children: n("editor.inputNodeForm.httpConfiguration") }),
2528
+ /* @__PURE__ */ e.jsxs(S, { variant: "ghost", size: "icon", className: "size-8", children: [
2529
+ /* @__PURE__ */ e.jsx(re, {}),
2530
+ /* @__PURE__ */ e.jsx("span", { className: "sr-only", children: n("common.toggle") })
2531
+ ] })
2532
+ ] }) }),
2533
+ /* @__PURE__ */ e.jsx(ge, { className: "flex flex-col gap-4", children: /* @__PURE__ */ e.jsx(c, { name: "httpConfig", children: (a) => /* @__PURE__ */ e.jsx(
2534
+ Ga,
2535
+ {
2536
+ value: a.state.value,
2537
+ onChange: (r) => {
2538
+ a.handleChange(r), d().then();
2539
+ }
2540
+ }
2541
+ ) }) })
2542
+ ] }),
2543
+ f && /* @__PURE__ */ e.jsxs(pe, { className: "flex w-full max-w-[350px] flex-col gap-2", children: [
2544
+ /* @__PURE__ */ e.jsx(xe, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
2545
+ /* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-sm", children: n("editor.inputNodeForm.submitConfiguration") }),
2546
+ /* @__PURE__ */ e.jsxs(S, { variant: "ghost", size: "icon", className: "size-8", children: [
2547
+ /* @__PURE__ */ e.jsx(re, {}),
2548
+ /* @__PURE__ */ e.jsx("span", { className: "sr-only", children: n("common.toggle") })
2549
+ ] })
2550
+ ] }) }),
2551
+ /* @__PURE__ */ e.jsx(ge, { className: "flex flex-col gap-4", children: /* @__PURE__ */ e.jsx(c, { name: "submitConfig", children: (a) => /* @__PURE__ */ e.jsx(
2552
+ $a,
2553
+ {
2554
+ value: a.state.value,
2555
+ onChange: (r) => {
2556
+ a.handleChange(r), d().then();
2557
+ }
2558
+ }
2559
+ ) }) })
2560
+ ] }),
2561
+ l?.data?.type === "file" && /* @__PURE__ */ e.jsx(
2562
+ c,
2563
+ {
2564
+ name: "multiple",
2565
+ children: (a) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2566
+ /* @__PURE__ */ e.jsx(J, { id: a.name, checked: a.state.value, onCheckedChange: (r) => a.handleChange(r) }),
2567
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: n("editor.inputNodeForm.multipleFiles") })
2568
+ ] })
2569
+ }
2570
+ ),
2571
+ h && /* @__PURE__ */ e.jsxs(pe, { defaultOpen: !0, className: "flex w-full max-w-[350px] flex-col gap-2", children: [
2572
+ /* @__PURE__ */ e.jsx(xe, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
2573
+ /* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-sm", children: n("editor.inputNodeForm.options") }),
2574
+ /* @__PURE__ */ e.jsxs(S, { variant: "ghost", size: "icon", className: "size-8", children: [
2575
+ /* @__PURE__ */ e.jsx(re, {}),
2576
+ /* @__PURE__ */ e.jsx("span", { className: "sr-only", children: n("common.toggle") })
2577
+ ] })
2578
+ ] }) }),
2579
+ /* @__PURE__ */ e.jsxs(ge, { className: "flex flex-col gap-4", children: [
2580
+ /* @__PURE__ */ e.jsx(c, { name: "options", mode: "array", children: (a) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
2581
+ a.state.value?.map((r, u) => {
2582
+ const m = `options[${u}]`;
2583
+ return /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2", children: [
2584
+ /* @__PURE__ */ e.jsx(c, { name: `options[${u}].label`, children: (p) => /* @__PURE__ */ e.jsx(
2585
+ D,
2586
+ {
2587
+ placeholder: n("editor.inputNodeForm.optionLabel"),
2588
+ value: p.state.value?.[t] || "",
2589
+ onChange: ({ target: x }) => {
2590
+ p.handleChange({
2591
+ ...typeof p.state.value == "object" && p.state.value !== null ? p.state.value : {},
2592
+ [t]: x.value
2593
+ });
2594
+ }
2595
+ }
2596
+ ) }),
2597
+ /* @__PURE__ */ e.jsx(c, { name: `options[${u}].value`, children: (p) => /* @__PURE__ */ e.jsx(
2598
+ D,
2599
+ {
2600
+ placeholder: n("editor.inputNodeForm.optionValue"),
2601
+ value: p.state.value || "",
2602
+ onChange: ({ target: x }) => p.handleChange(x.value)
2603
+ }
2604
+ ) }),
2605
+ /* @__PURE__ */ e.jsx(
2606
+ S,
2607
+ {
2608
+ type: "button",
2609
+ variant: "ghost",
2610
+ size: "icon",
2611
+ onClick: () => {
2612
+ a.removeValue(u), d().then();
2613
+ },
2614
+ children: /* @__PURE__ */ e.jsx(se, { className: "h-4 w-4" })
2615
+ }
2616
+ )
2617
+ ] }, m);
2618
+ }),
2619
+ /* @__PURE__ */ e.jsx(
2620
+ S,
2621
+ {
2622
+ type: "button",
2623
+ variant: "outline",
2624
+ size: "sm",
2625
+ onClick: () => {
2626
+ a.pushValue({ label: { en: "" }, value: "" }), d().then();
2627
+ },
2628
+ children: n("editor.inputNodeForm.addOption")
2629
+ }
2630
+ )
2631
+ ] }) }),
2632
+ l?.data?.type === "select" && /* @__PURE__ */ e.jsx(
2633
+ c,
2634
+ {
2635
+ name: "multiple",
2636
+ children: (a) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2637
+ /* @__PURE__ */ e.jsx(J, { id: a.name, checked: a.state.value, onCheckedChange: (r) => a.handleChange(r) }),
2638
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: n("editor.inputNodeForm.multipleSelection") })
2639
+ ] })
2640
+ }
2641
+ )
2642
+ ] })
2643
+ ] }),
2644
+ !f && /* @__PURE__ */ e.jsxs(pe, { className: "flex w-full max-w-[350px] flex-col gap-2", children: [
2645
+ /* @__PURE__ */ e.jsx(xe, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
2646
+ /* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-sm", children: n("editor.inputNodeForm.validation") }),
2647
+ /* @__PURE__ */ e.jsxs(S, { variant: "ghost", size: "icon", className: "size-8", children: [
2648
+ /* @__PURE__ */ e.jsx(re, {}),
2649
+ /* @__PURE__ */ e.jsx("span", { className: "sr-only", children: n("common.toggle") })
2650
+ ] })
2651
+ ] }) }),
2652
+ /* @__PURE__ */ e.jsxs(ge, { className: "flex flex-col gap-6", children: [
2653
+ /* @__PURE__ */ e.jsx(
2654
+ c,
2655
+ {
2656
+ name: "required",
2657
+ children: (a) => /* @__PURE__ */ e.jsx(N, { children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2658
+ /* @__PURE__ */ e.jsx(J, { id: a.name, checked: a.state.value, onCheckedChange: (r) => a.handleChange(r) }),
2659
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: n("editor.inputNodeForm.required") })
2660
+ ] }) })
2661
+ }
2662
+ ),
2663
+ (l?.data?.type === "date" || l?.data?.type === "daterange") && /* @__PURE__ */ e.jsx(
2664
+ c,
2665
+ {
2666
+ name: "disablePast",
2667
+ children: (a) => /* @__PURE__ */ e.jsx(N, { children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2668
+ /* @__PURE__ */ e.jsx(J, { id: a.name, checked: a.state.value, onCheckedChange: (r) => a.handleChange(r) }),
2669
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: n("editor.inputNodeForm.disablePast") })
2670
+ ] }) })
2671
+ }
2672
+ ),
2673
+ /* @__PURE__ */ e.jsx(
2674
+ c,
2675
+ {
2676
+ name: "pattern",
2677
+ children: (a) => /* @__PURE__ */ e.jsxs(N, { children: [
2678
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: n("editor.inputNodeForm.pattern") }),
2679
+ /* @__PURE__ */ e.jsx(Ua, { id: a.name, value: a.state.value, onValueChange: a.handleChange })
2680
+ ] })
2681
+ }
2682
+ ),
2683
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
2684
+ /* @__PURE__ */ e.jsx(
2685
+ c,
2686
+ {
2687
+ name: "errorMessage",
2688
+ children: (a) => /* @__PURE__ */ e.jsxs(N, { className: "flex-1", children: [
2689
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: n("editor.inputNodeForm.errorMessage") }),
2690
+ /* @__PURE__ */ e.jsx(
2691
+ D,
2692
+ {
2693
+ id: a.name,
2694
+ name: a.name,
2695
+ value: a.state.value?.[t] || "",
2696
+ onBlur: a.handleBlur,
2697
+ onChange: ({ target: r }) => {
2698
+ a.handleChange({
2699
+ ...typeof a.state.value == "object" && a.state.value !== null ? a.state.value : {},
2700
+ [t]: r.value
2701
+ });
2702
+ }
2703
+ }
2704
+ )
2705
+ ] })
2706
+ }
2707
+ ),
2708
+ /* @__PURE__ */ e.jsx(q, { value: t, onValueChange: s })
2709
+ ] })
2710
+ ] })
2711
+ ] }),
2712
+ !f && /* @__PURE__ */ e.jsxs(pe, { className: "flex w-full max-w-[350px] flex-col gap-2", children: [
2713
+ /* @__PURE__ */ e.jsx(xe, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
2714
+ /* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-sm", children: n("editor.inputNodeForm.advancedConfiguration") }),
2715
+ /* @__PURE__ */ e.jsxs(S, { variant: "ghost", size: "icon", className: "size-8", children: [
2716
+ /* @__PURE__ */ e.jsx(re, {}),
2717
+ /* @__PURE__ */ e.jsx("span", { className: "sr-only", children: n("common.toggle") })
2718
+ ] })
2719
+ ] }) }),
2720
+ /* @__PURE__ */ e.jsxs(ge, { className: "flex flex-col gap-6", children: [
2721
+ /* @__PURE__ */ e.jsx(
2722
+ c,
2723
+ {
2724
+ name: "name",
2725
+ children: (a) => /* @__PURE__ */ e.jsxs(N, { children: [
2726
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: n("editor.inputNodeForm.name") }),
2727
+ /* @__PURE__ */ e.jsx(
2728
+ D,
2729
+ {
2730
+ id: a.name,
2731
+ name: a.name,
2732
+ value: a.state.value,
2733
+ onBlur: a.handleBlur,
2734
+ onChange: ({ target: r }) => a.handleChange(r.value)
2735
+ }
2736
+ ),
2737
+ /* @__PURE__ */ e.jsx(M, { children: n("editor.inputNodeForm.nameDescription") })
2738
+ ] })
2739
+ }
2740
+ ),
2741
+ /* @__PURE__ */ e.jsx(c, { name: "defaultValue", children: (a) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2742
+ /* @__PURE__ */ e.jsxs(N, { children: [
2743
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: n("editor.inputNodeForm.defaultValueType") }),
2744
+ /* @__PURE__ */ e.jsxs(
2745
+ _,
2746
+ {
2747
+ value: a.state.value?.type || "none",
2748
+ onValueChange: (r) => {
2749
+ a.handleChange(r === "none" ? null : { type: r });
2750
+ },
2751
+ children: [
2752
+ /* @__PURE__ */ e.jsx(R, { id: a.name, children: /* @__PURE__ */ e.jsx(Z, { placeholder: n("editor.inputNodeForm.selectType") }) }),
2753
+ /* @__PURE__ */ e.jsxs(K, { children: [
2754
+ /* @__PURE__ */ e.jsx(y, { value: "none", children: n("editor.inputNodeForm.defaultValueTypeNone") }),
2755
+ /* @__PURE__ */ e.jsx(y, { value: "static", children: n("editor.inputNodeForm.defaultValueTypeStatic") }),
2756
+ /* @__PURE__ */ e.jsx(y, { value: "reference", children: n("editor.inputNodeForm.defaultValueTypeReference") })
2757
+ ] })
2758
+ ]
2759
+ }
2760
+ )
2761
+ ] }),
2762
+ a.state.value?.type === "static" && /* @__PURE__ */ e.jsx(c, { name: "defaultValue.staticValue", children: (r) => {
2763
+ const u = l?.data?.type;
2764
+ return (u === "select" || u === "checkbox") && l?.data?.multiple ? /* @__PURE__ */ e.jsxs(N, { children: [
2765
+ /* @__PURE__ */ e.jsx(j, { htmlFor: r.name, children: n("editor.inputNodeForm.defaultValuesCommaSeparated") }),
2766
+ /* @__PURE__ */ e.jsx(
2767
+ D,
2768
+ {
2769
+ id: r.name,
2770
+ placeholder: n("editor.inputNodeForm.defaultValuesPlaceholder"),
2771
+ value: Array.isArray(r.state.value) ? r.state.value.join(", ") : "",
2772
+ onChange: ({ target: m }) => {
2773
+ const p = m.value.split(",").map((x) => x.trim()).filter(Boolean);
2774
+ r.handleChange(p.length > 0 ? p : null);
2775
+ }
2776
+ }
2777
+ )
2778
+ ] }) : u === "checkbox" ? /* @__PURE__ */ e.jsx(N, { children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2779
+ /* @__PURE__ */ e.jsx(
2780
+ J,
2781
+ {
2782
+ id: r.name,
2783
+ checked: !!r.state.value,
2784
+ onCheckedChange: (m) => r.handleChange(m)
2785
+ }
2786
+ ),
2787
+ /* @__PURE__ */ e.jsx(j, { htmlFor: r.name, children: n("editor.inputNodeForm.defaultChecked") })
2788
+ ] }) }) : /* @__PURE__ */ e.jsxs(N, { children: [
2789
+ /* @__PURE__ */ e.jsx(j, { htmlFor: r.name, children: n("editor.inputNodeForm.staticValue") }),
2790
+ /* @__PURE__ */ e.jsx(
2791
+ D,
2792
+ {
2793
+ id: r.name,
2794
+ placeholder: n("editor.inputNodeForm.staticValuePlaceholder"),
2795
+ value: typeof r.state.value == "string" ? r.state.value : "",
2796
+ onChange: ({ target: m }) => r.handleChange(m.value || "")
2797
+ }
2798
+ )
2799
+ ] });
2800
+ } }),
2801
+ a.state.value?.type === "reference" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2802
+ /* @__PURE__ */ e.jsx(c, { name: "defaultValue.referenceField", children: (r) => /* @__PURE__ */ e.jsxs(N, { children: [
2803
+ /* @__PURE__ */ e.jsx(j, { htmlFor: r.name, children: n("editor.inputNodeForm.referenceField") }),
2804
+ /* @__PURE__ */ e.jsxs(
2805
+ _,
2806
+ {
2807
+ value: r.state.value || "",
2808
+ onValueChange: (u) => {
2809
+ r.handleChange(u);
2810
+ },
2811
+ children: [
2812
+ /* @__PURE__ */ e.jsx(R, { id: r.name, children: /* @__PURE__ */ e.jsx(Z, { placeholder: n("editor.inputNodeForm.selectReferenceField") }) }),
2813
+ /* @__PURE__ */ e.jsx(K, { children: o.length === 0 ? /* @__PURE__ */ e.jsx(y, { value: "none", disabled: !0, children: n("editor.inputNodeForm.noParentFieldsAvailable") }) : o.map((u) => /* @__PURE__ */ e.jsxs(y, { value: u.nodeId, children: [
2814
+ u.label,
2815
+ " (",
2816
+ u.type,
2817
+ ")"
2818
+ ] }, u.nodeId)) })
2819
+ ]
2820
+ }
2821
+ ),
2822
+ o.length === 0 && /* @__PURE__ */ e.jsx(M, { children: n("editor.inputNodeForm.addInputFieldsBeforeReference") })
2823
+ ] }) }),
2824
+ /* @__PURE__ */ e.jsx(c, { name: "defaultValue.transformFunction", children: (r) => /* @__PURE__ */ e.jsxs(N, { children: [
2825
+ /* @__PURE__ */ e.jsx(j, { htmlFor: r.name, children: n("editor.inputNodeForm.transformType") }),
2826
+ /* @__PURE__ */ e.jsxs(
2827
+ _,
2828
+ {
2829
+ value: r.state.value || "none",
2830
+ onValueChange: (u) => {
2831
+ const m = u === "none" ? null : u;
2832
+ if (r.handleChange(m), u === "toObject") {
2833
+ const p = a.state.value;
2834
+ a.handleChange({
2835
+ ...p,
2836
+ objectMapping: []
2837
+ });
2838
+ }
2839
+ },
2840
+ children: [
2841
+ /* @__PURE__ */ e.jsx(R, { id: r.name, children: /* @__PURE__ */ e.jsx(Z, { placeholder: n("editor.inputNodeForm.selectTransformation") }) }),
2842
+ /* @__PURE__ */ e.jsxs(K, { children: [
2843
+ /* @__PURE__ */ e.jsx(y, { value: "none", children: n("editor.inputNodeForm.transformNone") }),
2844
+ /* @__PURE__ */ e.jsx(y, { value: "toString", children: n("editor.inputNodeForm.transformString") }),
2845
+ /* @__PURE__ */ e.jsx(y, { value: "toNumber", children: n("editor.inputNodeForm.transformNumber") }),
2846
+ /* @__PURE__ */ e.jsx(y, { value: "toBoolean", children: n("editor.inputNodeForm.transformBoolean") }),
2847
+ /* @__PURE__ */ e.jsx(y, { value: "toArray", children: n("editor.inputNodeForm.transformArray") }),
2848
+ /* @__PURE__ */ e.jsx(y, { value: "toObject", children: n("editor.inputNodeForm.transformMapToObject") })
2849
+ ] })
2850
+ ]
2851
+ }
2852
+ ),
2853
+ /* @__PURE__ */ e.jsx(M, { children: n("editor.inputNodeForm.transformDesc") })
2854
+ ] }) }),
2855
+ a.state.value?.transformFunction === "toObject" && /* @__PURE__ */ e.jsx(c, { name: "defaultValue.objectMapping", mode: "array", children: (r) => /* @__PURE__ */ e.jsxs(N, { children: [
2856
+ /* @__PURE__ */ e.jsx(j, { children: n("editor.inputNodeForm.objectMapping") }),
2857
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
2858
+ r.state.value?.map((u, m) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2859
+ /* @__PURE__ */ e.jsx(c, { name: `defaultValue.objectMapping[${m}].sourceKey`, children: (p) => /* @__PURE__ */ e.jsx(
2860
+ D,
2861
+ {
2862
+ placeholder: n("editor.inputNodeForm.sourceKey"),
2863
+ value: p.state.value || "",
2864
+ onChange: ({ target: x }) => p.handleChange(x.value)
2865
+ }
2866
+ ) }),
2867
+ /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "→" }),
2868
+ /* @__PURE__ */ e.jsx(c, { name: `defaultValue.objectMapping[${m}].targetKey`, children: (p) => /* @__PURE__ */ e.jsx(
2869
+ D,
2870
+ {
2871
+ placeholder: n("editor.inputNodeForm.targetKey"),
2872
+ value: p.state.value || "",
2873
+ onChange: ({ target: x }) => p.handleChange(x.value)
2874
+ }
2875
+ ) }),
2876
+ /* @__PURE__ */ e.jsx(
2877
+ S,
2878
+ {
2879
+ type: "button",
2880
+ variant: "ghost",
2881
+ size: "icon",
2882
+ onClick: () => {
2883
+ r.removeValue(m), d().then();
2884
+ },
2885
+ children: /* @__PURE__ */ e.jsx(se, { className: "h-4 w-4" })
2886
+ }
2887
+ )
2888
+ ] }, `mapping-${m}`)),
2889
+ /* @__PURE__ */ e.jsxs(
2890
+ S,
2891
+ {
2892
+ type: "button",
2893
+ variant: "outline",
2894
+ size: "sm",
2895
+ className: "w-full",
2896
+ onClick: () => {
2897
+ r.pushValue({ sourceKey: "", targetKey: "" }), d().then();
2898
+ },
2899
+ children: [
2900
+ /* @__PURE__ */ e.jsx(X, { className: "mr-2 h-4 w-4" }),
2901
+ n("editor.inputNodeForm.addMapping")
2902
+ ]
2903
+ }
2904
+ )
2905
+ ] }),
2906
+ /* @__PURE__ */ e.jsx(M, { children: n("editor.inputNodeForm.objectMappingDesc") })
2907
+ ] }) })
2908
+ ] })
2909
+ ] }) })
2910
+ ] })
2911
+ ] })
2912
+ ] })
2913
+ }
2914
+ );
2915
+ }, Ye = {
2916
+ divider: "divider",
2917
+ title: "title"
2918
+ }, Ka = () => {
2919
+ const [t, s] = z("en"), { selectedNode: l } = ee(), { updateSelectedNodeData: i } = me(), { Field: h } = ne({
2920
+ defaultValues: {
2921
+ label: l?.data?.label || { en: "" },
2922
+ type: l?.data?.type || ""
2923
+ },
2924
+ listeners: {
2925
+ onChange: ({ formApi: o }) => {
2926
+ o.handleSubmit().then();
2927
+ },
2928
+ onChangeDebounceMs: 150
2929
+ },
2930
+ onSubmit: ({ value: o }) => {
2931
+ i(o);
2932
+ }
2933
+ });
2934
+ return /* @__PURE__ */ e.jsx(
2935
+ "form",
2936
+ {
2937
+ onSubmit: (o) => {
2938
+ o.preventDefault(), o.stopPropagation();
2939
+ },
2940
+ children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-6", children: [
2941
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
2942
+ /* @__PURE__ */ e.jsx(
2943
+ h,
2944
+ {
2945
+ name: "label",
2946
+ children: (o) => /* @__PURE__ */ e.jsxs(N, { className: "flex-1", children: [
2947
+ /* @__PURE__ */ e.jsx(j, { htmlFor: o.name, children: "Label" }),
2948
+ /* @__PURE__ */ e.jsx(
2949
+ D,
2950
+ {
2951
+ id: o.name,
2952
+ name: o.name,
2953
+ value: o.state.value?.[t] || "",
2954
+ onBlur: o.handleBlur,
2955
+ onChange: ({ target: n }) => {
2956
+ o.handleChange({
2957
+ ...o.state.value,
2958
+ [t]: n.value
2959
+ });
2960
+ }
2961
+ }
2962
+ )
2963
+ ] })
2964
+ }
2965
+ ),
2966
+ /* @__PURE__ */ e.jsx(q, { value: t, onValueChange: s })
2967
+ ] }),
2968
+ /* @__PURE__ */ e.jsx(
2969
+ h,
2970
+ {
2971
+ name: "type",
2972
+ children: (o) => /* @__PURE__ */ e.jsxs(te, { children: [
2973
+ /* @__PURE__ */ e.jsx(Be, { htmlFor: o.name, children: "Type" }),
2974
+ /* @__PURE__ */ e.jsxs(_, { value: o.state.value, onValueChange: (n) => o.handleChange(n), children: [
2975
+ /* @__PURE__ */ e.jsx(R, { id: o.name, className: "w-full", children: /* @__PURE__ */ e.jsx(Z, { placeholder: "" }) }),
2976
+ /* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsxs(te, { children: [
2977
+ /* @__PURE__ */ e.jsx(y, { value: Ye.title, children: "Title" }),
2978
+ /* @__PURE__ */ e.jsx(y, { value: Ye.divider, children: "Divider" })
2979
+ ] }) })
2980
+ ] })
2981
+ ] })
2982
+ }
2983
+ )
2984
+ ] })
2985
+ }
2986
+ );
2987
+ }, Ya = () => {
2988
+ const [t, s] = z(""), [l, i] = z(!1), { selectedNode: h, groupNodes: o } = ee(), { setNodes: n } = ue(), f = h?.parentId || "none", d = Se(h), c = G(), a = Fe(), r = Fe();
2989
+ if (d)
2990
+ return null;
2991
+ const u = (p) => {
2992
+ h && n((x) => p === "none" ? x.map((g) => {
2993
+ if (g.id === h.id) {
2994
+ const { parentId: w, extent: C, ...I } = g;
2995
+ return I;
2996
+ }
2997
+ return g;
2998
+ }) : x.find((g) => g.id === p) ? x.map((g) => g.id === h.id ? {
2999
+ ...g,
3000
+ extent: "parent",
3001
+ parentId: p,
3002
+ position: {
3003
+ x: 50,
3004
+ y: 80
3005
+ }
3006
+ } : g) : x);
3007
+ }, m = () => {
3008
+ if (!(t.trim() && h))
3009
+ return;
3010
+ if (o.find((F) => {
3011
+ const g = F.data?.label?.en || F.data?.label;
3012
+ return String(g).toLowerCase() === t.trim().toLowerCase();
3013
+ })) {
3014
+ U.error("This group already exists", {
3015
+ description: "Use the selector to add the node to an existing group."
3016
+ });
3017
+ return;
3018
+ }
3019
+ const x = ce();
3020
+ n((F) => {
3021
+ const g = {
3022
+ data: {
3023
+ label: {
3024
+ en: t.trim()
3025
+ }
3026
+ },
3027
+ id: x,
3028
+ position: {
3029
+ x: h.position.x - 300,
3030
+ y: h.position.y
3031
+ },
3032
+ style: {
3033
+ height: 400,
3034
+ width: 600
3035
+ },
3036
+ type: "group"
3037
+ }, w = F.map((C) => C.id === h.id ? {
3038
+ ...C,
3039
+ extent: "parent",
3040
+ parentId: x,
3041
+ position: {
3042
+ x: 175,
3043
+ y: 30
3044
+ }
3045
+ } : C);
3046
+ return [g, ...w];
3047
+ }), s(""), i(!1), U.success("Group created", {
3048
+ description: `The group "${t.trim()}" has been created successfully.`
3049
+ });
3050
+ };
3051
+ return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3052
+ /* @__PURE__ */ e.jsx(j, { htmlFor: a, children: c("editor.selectNodeGroup.group") }),
3053
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
3054
+ /* @__PURE__ */ e.jsxs(_, { value: f, onValueChange: u, children: [
3055
+ /* @__PURE__ */ e.jsx(R, { id: a, className: "flex-1", children: /* @__PURE__ */ e.jsx(Z, { placeholder: c("editor.selectNodeGroup.noGroup") }) }),
3056
+ /* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsxs(te, { children: [
3057
+ /* @__PURE__ */ e.jsx(y, { value: "none", children: c("editor.selectNodeGroup.noGroup") }),
3058
+ o.map((p) => /* @__PURE__ */ e.jsx(y, { value: p.id, children: p.data.label?.en ? String(p.data.label?.en) : p.id }, p.id))
3059
+ ] }) })
3060
+ ] }),
3061
+ /* @__PURE__ */ e.jsxs(Oe, { open: l, onOpenChange: i, children: [
3062
+ /* @__PURE__ */ e.jsx(Me, { asChild: !0, children: /* @__PURE__ */ e.jsx(S, { variant: "outline", size: "icon", title: "Create a new group", children: /* @__PURE__ */ e.jsx(Bt, { className: "h-4 w-4" }) }) }),
3063
+ /* @__PURE__ */ e.jsx(Le, { className: "w-80", align: "end", disablePortal: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
3064
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3065
+ /* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: c("editor.selectNodeGroup.newGroup") }),
3066
+ /* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground text-sm", children: c("editor.selectNodeGroup.newGroupDescription") })
3067
+ ] }),
3068
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3069
+ /* @__PURE__ */ e.jsx(j, { htmlFor: r, children: c("editor.selectNodeGroup.groupName") }),
3070
+ /* @__PURE__ */ e.jsx(
3071
+ D,
3072
+ {
3073
+ autoFocus: !0,
3074
+ id: r,
3075
+ value: t,
3076
+ onChange: (p) => s(p.target.value),
3077
+ placeholder: "Ex: Step 1 - Personal info",
3078
+ onKeyDown: (p) => {
3079
+ p.key === "Enter" && (p.preventDefault(), m());
3080
+ }
3081
+ }
3082
+ )
3083
+ ] }),
3084
+ /* @__PURE__ */ e.jsxs("div", { className: "flex justify-end gap-2", children: [
3085
+ /* @__PURE__ */ e.jsx(S, { variant: "outline", size: "sm", onClick: () => i(!1), children: "Cancel" }),
3086
+ /* @__PURE__ */ e.jsx(S, { size: "sm", onClick: m, disabled: !t.trim(), children: "Create" })
3087
+ ] })
3088
+ ] }) })
3089
+ ] })
3090
+ ] })
3091
+ ] });
3092
+ }, Wa = () => {
3093
+ const { selectedNode: t } = ee(), { updateSelectedNodeType: s } = me(), l = t?.type || "", i = Se(t), h = G(), o = Fe();
3094
+ return /* @__PURE__ */ e.jsxs(te, { children: [
3095
+ /* @__PURE__ */ e.jsx(Be, { htmlFor: o, children: h("editor.selectNodeType.nodeType") }),
3096
+ /* @__PURE__ */ e.jsxs(_, { value: l, onValueChange: (n) => s(n), disabled: i, children: [
3097
+ /* @__PURE__ */ e.jsx(R, { className: "w-full", id: o, children: /* @__PURE__ */ e.jsx(Z, { placeholder: h("editor.selectNodeType.nodeType") }) }),
3098
+ /* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsx(te, { children: Object.keys(it).filter((n) => i ? n === "group" : n !== "group").map((n) => /* @__PURE__ */ e.jsx(y, { value: n, children: h(`editor.selectNodeType.options.${n}`) }, n)) }) })
3099
+ ] })
3100
+ ] });
3101
+ };
3102
+ function Ja({ ...t }) {
3103
+ return /* @__PURE__ */ e.jsx(Q.Root, { "data-slot": "alert-dialog", ...t });
3104
+ }
3105
+ function qa({ ...t }) {
3106
+ return /* @__PURE__ */ e.jsx(Q.Trigger, { "data-slot": "alert-dialog-trigger", ...t });
3107
+ }
3108
+ function Xa({ ...t }) {
3109
+ return /* @__PURE__ */ e.jsx(Q.Portal, { "data-slot": "alert-dialog-portal", ...t });
3110
+ }
3111
+ function Qa({ className: t, ...s }) {
3112
+ return /* @__PURE__ */ e.jsx(
3113
+ Q.Overlay,
3114
+ {
3115
+ "data-slot": "alert-dialog-overlay",
3116
+ className: k(
3117
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",
3118
+ t
3119
+ ),
3120
+ ...s
3121
+ }
3122
+ );
3123
+ }
3124
+ function es({ className: t, ...s }) {
3125
+ return /* @__PURE__ */ e.jsxs(Xa, { children: [
3126
+ /* @__PURE__ */ e.jsx(Qa, {}),
3127
+ /* @__PURE__ */ e.jsx(
3128
+ Q.Content,
3129
+ {
3130
+ "data-slot": "alert-dialog-content",
3131
+ className: k(
3132
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg",
3133
+ t
3134
+ ),
3135
+ ...s
3136
+ }
3137
+ )
3138
+ ] });
3139
+ }
3140
+ function ts({ className: t, ...s }) {
3141
+ return /* @__PURE__ */ e.jsx("div", { "data-slot": "alert-dialog-header", className: k("flex flex-col gap-2 text-center sm:text-left", t), ...s });
3142
+ }
3143
+ function as({ className: t, ...s }) {
3144
+ return /* @__PURE__ */ e.jsx("div", { "data-slot": "alert-dialog-footer", className: k("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", t), ...s });
3145
+ }
3146
+ function ss({ className: t, ...s }) {
3147
+ return /* @__PURE__ */ e.jsx(Q.Title, { "data-slot": "alert-dialog-title", className: k("font-semibold text-lg", t), ...s });
3148
+ }
3149
+ function ns({ className: t, ...s }) {
3150
+ return /* @__PURE__ */ e.jsx(
3151
+ Q.Description,
3152
+ {
3153
+ "data-slot": "alert-dialog-description",
3154
+ className: k("text-muted-foreground text-sm", t),
3155
+ ...s
3156
+ }
3157
+ );
3158
+ }
3159
+ function os({ className: t, ...s }) {
3160
+ return /* @__PURE__ */ e.jsx(Q.Action, { className: k(We(), t), ...s });
3161
+ }
3162
+ function rs({ className: t, ...s }) {
3163
+ return /* @__PURE__ */ e.jsx(Q.Cancel, { className: k(We({ variant: "outline" }), t), ...s });
3164
+ }
3165
+ function ls({ ...t }) {
3166
+ return /* @__PURE__ */ e.jsx(L.Root, { "data-slot": "sheet", ...t });
3167
+ }
3168
+ function is({ ...t }) {
3169
+ return /* @__PURE__ */ e.jsx(L.Portal, { "data-slot": "sheet-portal", ...t });
3170
+ }
3171
+ function ds({ className: t, ...s }) {
3172
+ return /* @__PURE__ */ e.jsx(
3173
+ L.Overlay,
3174
+ {
3175
+ "data-slot": "sheet-overlay",
3176
+ className: k(
3177
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",
3178
+ t
3179
+ ),
3180
+ ...s
3181
+ }
3182
+ );
3183
+ }
3184
+ function cs({
3185
+ className: t,
3186
+ children: s,
3187
+ side: l = "right",
3188
+ ...i
3189
+ }) {
3190
+ return /* @__PURE__ */ e.jsxs(is, { children: [
3191
+ /* @__PURE__ */ e.jsx(ds, {}),
3192
+ /* @__PURE__ */ e.jsxs(
3193
+ L.Content,
3194
+ {
3195
+ "data-slot": "sheet-content",
3196
+ className: k(
3197
+ "fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:duration-300 data-[state=open]:duration-500",
3198
+ l === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
3199
+ l === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
3200
+ l === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
3201
+ l === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
3202
+ t
3203
+ ),
3204
+ ...i,
3205
+ children: [
3206
+ s,
3207
+ /* @__PURE__ */ e.jsxs(L.Close, { className: "absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
3208
+ /* @__PURE__ */ e.jsx(tt, { className: "size-4" }),
3209
+ /* @__PURE__ */ e.jsx("span", { className: "sr-only", children: "Close" })
3210
+ ] })
3211
+ ]
3212
+ }
3213
+ )
3214
+ ] });
3215
+ }
3216
+ function us({ className: t, ...s }) {
3217
+ return /* @__PURE__ */ e.jsx("div", { "data-slot": "sheet-header", className: k("flex flex-col gap-1.5 p-4", t), ...s });
3218
+ }
3219
+ function hs({ className: t, ...s }) {
3220
+ return /* @__PURE__ */ e.jsx("div", { "data-slot": "sheet-footer", className: k("mt-auto flex flex-col gap-2 p-4", t), ...s });
3221
+ }
3222
+ function ms({ className: t, ...s }) {
3223
+ return /* @__PURE__ */ e.jsx(L.Title, { "data-slot": "sheet-title", className: k("font-semibold text-foreground", t), ...s });
3224
+ }
3225
+ function ps({ className: t, ...s }) {
3226
+ return /* @__PURE__ */ e.jsx(L.Description, { "data-slot": "sheet-description", className: k("text-muted-foreground text-sm", t), ...s });
3227
+ }
3228
+ const xs = () => {
3229
+ const { selectedNode: t, hasSelectedNodes: s } = ee(), { clearSelection: l, deleteSelectedNode: i } = me(), h = G(), o = h(t?.data?.label), n = () => {
3230
+ i(), l();
3231
+ };
3232
+ return /* @__PURE__ */ e.jsx(ls, { open: s, onOpenChange: l, children: /* @__PURE__ */ e.jsxs(cs, { className: "flex flex-col gap-0", children: [
3233
+ /* @__PURE__ */ e.jsxs(us, { children: [
3234
+ /* @__PURE__ */ e.jsxs(ms, { children: [
3235
+ h("editor.nodeActionsSheet.editNode"),
3236
+ " ",
3237
+ /* @__PURE__ */ e.jsx("span", { className: "font-light text-muted-foreground text-xs", children: t?.id })
3238
+ ] }),
3239
+ /* @__PURE__ */ e.jsx(ps, { children: o || " " })
3240
+ ] }),
3241
+ /* @__PURE__ */ e.jsx(ot, { className: "flex min-h-0 flex-1 flex-col px-4", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 py-4", children: [
3242
+ /* @__PURE__ */ e.jsx(Wa, {}),
3243
+ /* @__PURE__ */ e.jsx(Ya, {}),
3244
+ /* @__PURE__ */ e.jsx(jt, {}),
3245
+ je(t) && /* @__PURE__ */ e.jsx(Za, {}),
3246
+ xt(t) && /* @__PURE__ */ e.jsx(Ka, {}),
3247
+ gt(t) && /* @__PURE__ */ e.jsx(Oa, {}),
3248
+ Se(t) && /* @__PURE__ */ e.jsx(Ma, {})
3249
+ ] }) }),
3250
+ /* @__PURE__ */ e.jsx(hs, { className: "flex items-end border-t", children: /* @__PURE__ */ e.jsxs(Ja, { children: [
3251
+ /* @__PURE__ */ e.jsx(qa, { asChild: !0, children: /* @__PURE__ */ e.jsx(S, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(at, {}) }) }),
3252
+ /* @__PURE__ */ e.jsxs(es, { children: [
3253
+ /* @__PURE__ */ e.jsxs(ts, { children: [
3254
+ /* @__PURE__ */ e.jsx(ss, { children: h("editor.nodeActionsSheet.deleteNode") }),
3255
+ /* @__PURE__ */ e.jsx(ns, { children: h("editor.nodeActionsSheet.deleteNodeConfirm") })
3256
+ ] }),
3257
+ /* @__PURE__ */ e.jsxs(as, { children: [
3258
+ /* @__PURE__ */ e.jsx(rs, { children: h("common.cancel") }),
3259
+ /* @__PURE__ */ e.jsx(os, { onClick: n, children: h("common.delete") })
3260
+ ] })
3261
+ ] })
3262
+ ] }) })
3263
+ ] }) });
3264
+ }, gs = ({ ...t }) => {
3265
+ const { theme: s = "system" } = Kt();
3266
+ return /* @__PURE__ */ e.jsx(
3267
+ Zt,
3268
+ {
3269
+ theme: s,
3270
+ className: "toaster group",
3271
+ style: {
3272
+ "--normal-bg": "var(--popover)",
3273
+ "--normal-border": "var(--border)",
3274
+ "--normal-text": "var(--popover-foreground)"
3275
+ },
3276
+ ...t
3277
+ }
3278
+ );
3279
+ }, js = ({ flow: t, onExportJson: s, onSave: l, theme: i }) => {
3280
+ const { onConnect: h, onConnectEnd: o, onEdgesDelete: n, isValidConnection: f } = lt();
3281
+ return /* @__PURE__ */ e.jsxs(
3282
+ yt,
3283
+ {
3284
+ fitView: !0,
3285
+ colorMode: i,
3286
+ selectNodesOnDrag: !1,
3287
+ nodeTypes: it,
3288
+ edgeTypes: sa,
3289
+ defaultEdges: t?.edges || [],
3290
+ defaultNodes: t?.nodes || [],
3291
+ onConnect: h,
3292
+ onConnectEnd: o,
3293
+ onEdgesDelete: n,
3294
+ isValidConnection: f,
3295
+ children: [
3296
+ /* @__PURE__ */ e.jsx(wt, { gap: 10, variant: Ft.Dots }),
3297
+ /* @__PURE__ */ e.jsx(Va, { onExportJson: s, onSave: l }),
3298
+ /* @__PURE__ */ e.jsx(Jt, { theme: i }),
3299
+ /* @__PURE__ */ e.jsx(St, {}),
3300
+ /* @__PURE__ */ e.jsx(Et, {}),
3301
+ /* @__PURE__ */ e.jsx(xs, {})
3302
+ ]
3303
+ }
3304
+ );
3305
+ }, Es = ({ flow: t, onExportJson: s, onSave: l, theme: i = "dark", language: h = "en", aiConfig: o }) => /* @__PURE__ */ e.jsx(Ct, { defaultTheme: i, storageKey: "treege-editor-theme", theme: i, children: /* @__PURE__ */ e.jsxs(qt, { value: { aiConfig: o, flowId: t?.id, language: h }, children: [
3306
+ /* @__PURE__ */ e.jsx(gs, { position: "bottom-center" }),
3307
+ /* @__PURE__ */ e.jsx(Nt, { children: /* @__PURE__ */ e.jsx(js, { onExportJson: s, onSave: l, flow: t, theme: i }) })
3308
+ ] }) });
3309
+ export {
3310
+ Es as T
3311
+ };