treege 3.0.0-beta.37 → 3.0.0-beta.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,29 +1,30 @@
1
- import { a as e, c as t, d as n, i as r, l as i, r as a, t as o, u as s } from "./ThemeContext-DBFles56.js";
2
- import { C as c, D as l, E as u, F as d, M as f, N as p, O as m, S as h, T as ee, _ as g, a as _, b as v, c as y, d as b, f as x, g as S, h as C, i as te, j as w, k as T, l as ne, m as re, n as E, o as D, p as O, r as ie, s as ae, t as k, u as oe, v as A, w as se, x as ce, y as j } from "./separator-Cdfv5nIR.js";
3
- import { Background as le, BackgroundVariant as ue, BaseEdge as de, Controls as fe, EdgeLabelRenderer as pe, Handle as me, MiniMap as he, NodeResizer as ge, Panel as _e, Position as ve, ReactFlow as ye, ReactFlowProvider as be, addEdge as xe, getBezierPath as Se, useEdges as Ce, useNodes as we, useReactFlow as M } from "@xyflow/react";
1
+ import { a as e, c as t, d as n, i as r, l as i, r as a, t as o, u as s } from "./ThemeContext-PGG6Ht__.js";
2
+ import { C as c, D as l, E as u, F as d, M as f, N as p, O as m, S as h, T as ee, _ as g, a as _, b as v, c as y, d as b, f as x, g as S, h as C, i as te, j as w, k as T, l as ne, m as re, n as ie, o as E, p as D, r as O, s as ae, t as oe, u as k, v as A, w as se, x as ce, y as j } from "./separator-Cdfv5nIR.js";
3
+ import { Background as le, BackgroundVariant as ue, BaseEdge as de, Controls as fe, EdgeLabelRenderer as pe, Handle as me, MiniMap as he, NodeResizer as ge, Panel as _e, Position as ve, ReactFlow as ye, ReactFlowProvider as be, addEdge as xe, getBezierPath as Se, useEdges as Ce, useNodes as we, useNodesInitialized as Te, useReactFlow as M, useStore as Ee } from "@xyflow/react";
4
4
  import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
5
5
  import { useForm as I } from "@tanstack/react-form";
6
- import { AlignLeft as Te, ArrowRightFromLine as Ee, Boxes as De, Calendar as Oe, CalendarRange as ke, CaseSensitive as Ae, Check as je, CheckSquare as Me, ChevronDown as Ne, ChevronsUpDown as Pe, CircleDot as Fe, Clock as Ie, Cloud as Le, Copy as Re, Download as ze, EllipsisVertical as Be, EyeOff as Ve, Hash as He, Heading as Ue, ImagePlus as We, KeyRound as Ge, Link2 as Ke, ListFilter as qe, Loader2 as Je, MapPin as Ye, Minus as Xe, MoreVertical as Ze, Paperclip as Qe, Plus as L, PlusCircle as $e, RectangleEllipsis as et, Save as tt, Search as nt, Send as rt, Settings as it, ToggleLeft as at, Trash2 as ot, Upload as st, Variable as ct, WandSparkles as lt, Waypoints as ut, X as R, XIcon as dt } from "lucide-react";
7
- import { createContext as ft, memo as pt, useCallback as z, useContext as mt, useEffect as ht, useId as gt, useMemo as _t, useRef as vt, useState as B } from "react";
8
- import { Slot as yt } from "@radix-ui/react-slot";
9
- import { cva as bt } from "class-variance-authority";
10
- import * as xt from "@radix-ui/react-scroll-area";
6
+ import { AlignLeft as De, ArrowRightFromLine as Oe, Boxes as ke, Calendar as Ae, CalendarRange as je, CaseSensitive as Me, Check as Ne, CheckSquare as Pe, ChevronDown as Fe, ChevronsUpDown as Ie, CircleDot as Le, Clock as Re, Cloud as ze, Copy as Be, Download as Ve, EllipsisVertical as He, EyeOff as Ue, Hash as We, Heading as Ge, ImagePlus as Ke, KeyRound as qe, Link2 as Je, ListFilter as Ye, Loader2 as Xe, MapPin as Ze, Minus as Qe, MoreVertical as $e, Paperclip as et, Plus as L, PlusCircle as tt, RectangleEllipsis as nt, Save as rt, Search as it, Send as at, Settings as ot, ToggleLeft as st, Trash2 as ct, Upload as lt, Variable as ut, WandSparkles as dt, Waypoints as ft, X as R, XIcon as pt } from "lucide-react";
7
+ import { createContext as mt, memo as ht, useCallback as z, useContext as gt, useEffect as _t, useId as vt, useMemo as yt, useRef as bt, useState as B } from "react";
8
+ import { Slot as xt } from "@radix-ui/react-slot";
9
+ import { cva as St } from "class-variance-authority";
10
+ import * as Ct from "@radix-ui/react-scroll-area";
11
11
  import * as V from "@radix-ui/react-dropdown-menu";
12
12
  import * as H from "@radix-ui/react-dialog";
13
- import { Toaster as St, toast as U } from "sonner";
14
- import * as Ct from "@radix-ui/react-collapsible";
15
- import { useTheme as wt } from "next-themes";
13
+ import { Toaster as wt, toast as U } from "sonner";
14
+ import * as Tt from "@radix-ui/react-collapsible";
15
+ import Et from "@dagrejs/dagre";
16
+ import { useTheme as Dt } from "next-themes";
16
17
  //#region src/editor/assets/img/treege-black.svg
17
- var Tt = "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", Et = "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", Dt = ({ theme: e = "dark" }) => /* @__PURE__ */ P("div", {
18
+ var Ot = "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", kt = "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", At = ({ theme: e = "dark" }) => /* @__PURE__ */ P("div", {
18
19
  className: "absolute top-5 left-5 z-50 select-none",
19
20
  children: /* @__PURE__ */ P("img", {
20
- src: e === "dark" ? Et : Tt,
21
+ src: e === "dark" ? kt : Ot,
21
22
  alt: "Treege",
22
23
  className: "relative h-14 w-auto drop-shadow-[0_0px_35px] drop-shadow-blue-600"
23
24
  })
24
- }), Ot = (e) => {
25
+ }), jt = (e) => {
25
26
  let t = we(), n = Ce();
26
- return _t(() => {
27
+ return yt(() => {
27
28
  if (!e) return [];
28
29
  let r = (e, t = /* @__PURE__ */ new Set()) => {
29
30
  if (t.has(e)) return [];
@@ -44,8 +45,8 @@ var Tt = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%20
44
45
  t,
45
46
  n
46
47
  ]);
47
- }, kt = ft(null), At = ({ children: e, value: t }) => {
48
- let [n, r] = B(t?.flowId), [i, a] = B(!1), [o, s] = B(null), c = _t(() => ({
48
+ }, Mt = mt(null), Nt = ({ children: e, value: t }) => {
49
+ let [n, r] = B(t?.flowId), [i, a] = B(!1), [o, s] = B(null), c = yt(() => ({
49
50
  ...t,
50
51
  ...t?.aiConfig && { aiConfig: {
51
52
  ...t.aiConfig,
@@ -64,11 +65,11 @@ var Tt = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%20
64
65
  i,
65
66
  o
66
67
  ]);
67
- return /* @__PURE__ */ P(kt.Provider, {
68
+ return /* @__PURE__ */ P(Mt.Provider, {
68
69
  value: c,
69
70
  children: e
70
71
  });
71
- }, W = () => mt(kt) ?? {
72
+ }, W = () => gt(Mt) ?? {
72
73
  closeDeleteNodeConfirmation: () => {},
73
74
  flowId: void 0,
74
75
  isNodeSheetOpen: !1,
@@ -83,54 +84,54 @@ var Tt = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%20
83
84
  };
84
85
  //#endregion
85
86
  //#region src/shared/components/ui/scroll-area.tsx
86
- function jt({ className: e, children: t, ...n }) {
87
- return /* @__PURE__ */ F(xt.Root, {
87
+ function Pt({ className: e, children: t, ...n }) {
88
+ return /* @__PURE__ */ F(Ct.Root, {
88
89
  "data-slot": "scroll-area",
89
90
  className: d("relative", e),
90
91
  ...n,
91
92
  children: [
92
- /* @__PURE__ */ P(xt.Viewport, {
93
+ /* @__PURE__ */ P(Ct.Viewport, {
93
94
  "data-slot": "scroll-area-viewport",
94
95
  className: "size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:outline-1 focus-visible:ring-[3px] focus-visible:ring-ring/50",
95
96
  children: t
96
97
  }),
97
- /* @__PURE__ */ P(Mt, {}),
98
- /* @__PURE__ */ P(xt.Corner, {})
98
+ /* @__PURE__ */ P(Ft, {}),
99
+ /* @__PURE__ */ P(Ct.Corner, {})
99
100
  ]
100
101
  });
101
102
  }
102
- function Mt({ className: e, orientation: t = "vertical", ...n }) {
103
- return /* @__PURE__ */ P(xt.ScrollAreaScrollbar, {
103
+ function Ft({ className: e, orientation: t = "vertical", ...n }) {
104
+ return /* @__PURE__ */ P(Ct.ScrollAreaScrollbar, {
104
105
  "data-slot": "scroll-area-scrollbar",
105
106
  orientation: t,
106
107
  className: d("flex touch-none select-none p-px transition-colors", t === "vertical" && "h-full w-2.5 border-l border-l-transparent", t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent", e),
107
108
  ...n,
108
- children: /* @__PURE__ */ P(xt.ScrollAreaThumb, {
109
+ children: /* @__PURE__ */ P(Ct.ScrollAreaThumb, {
109
110
  "data-slot": "scroll-area-thumb",
110
111
  className: "relative flex-1 rounded-full bg-border"
111
112
  })
112
113
  });
113
114
  }
114
115
  //#endregion
115
- //#region src/editor/constants/edgeTypes.ts
116
- var Nt = {
117
- conditional: pt(({ id: e, target: t, sourceX: n, sourceY: i, targetX: a, targetY: o, sourcePosition: s, targetPosition: d, markerEnd: _, style: y, data: b }) => {
118
- let [x, S, C] = Se({
116
+ //#region src/editor/features/TreegeEditor/edges/ConditionalEdge.tsx
117
+ var It = (e) => !!e.field && e.value !== void 0 && e.value !== "", Lt = {
118
+ conditional: ht(({ id: e, target: t, sourceX: n, sourceY: i, targetX: a, targetY: o, sourcePosition: s, targetPosition: _, markerEnd: y, style: b, data: x }) => {
119
+ let [S, C, te] = Se({
119
120
  sourcePosition: s,
120
121
  sourceX: n,
121
122
  sourceY: i,
122
- targetPosition: d,
123
+ targetPosition: _,
123
124
  targetX: a,
124
125
  targetY: o
125
- }), [te, ne] = B(!1), { updateEdgeData: re } = M(), E = Ot(t), D = b?.conditions && b.conditions.length > 0, O = G(), { handleSubmit: ie, reset: ae, Field: k } = I({
126
+ }), [ne, re] = B(!1), { updateEdgeData: ie } = M(), E = jt(t), D = G(), O = !!x?.configured || !!x?.isFallback || !!x?.label || (x?.conditions?.some(It) ?? !1), { handleSubmit: ae, reset: oe, Field: k } = I({
126
127
  defaultValues: {
127
- conditions: b?.conditions || [{
128
+ conditions: x?.conditions || [{
128
129
  field: E[0]?.nodeId ?? "",
129
130
  operator: "===",
130
131
  value: ""
131
132
  }],
132
- isFallback: !!b?.isFallback,
133
- label: b?.label || ""
133
+ isFallback: !!x?.isFallback,
134
+ label: x?.label || ""
134
135
  },
135
136
  listeners: {
136
137
  onChange: ({ formApi: e }) => {
@@ -139,60 +140,70 @@ var Nt = {
139
140
  onChangeDebounceMs: 150
140
141
  },
141
142
  onSubmit: ({ value: t }) => {
142
- re(e, t);
143
+ ie(e, {
144
+ ...t,
145
+ configured: !0
146
+ });
143
147
  }
144
- }), oe = (e) => {
148
+ }), ce = (e) => {
145
149
  e.stopPropagation();
146
- }, ce = () => {
147
- ae({
150
+ }, j = () => {
151
+ oe({
148
152
  conditions: [],
149
153
  isFallback: !1,
150
154
  label: ""
151
- }), re(e, {
155
+ }), ie(e, {
152
156
  conditions: void 0,
157
+ configured: void 0,
153
158
  isFallback: void 0,
154
159
  label: void 0
155
160
  });
156
- }, j = () => {
157
- if (b?.isFallback) return b.label || O("editor.conditionalEdge.fallback");
158
- if (!D) return null;
159
- if (b.label) return b.label;
160
- let e = b.conditions;
161
- if (e.length === 1) return `${E.find((t) => t.nodeId === e[0].field)?.label || e[0].field} ${e[0].operator} ${e[0].value}`;
161
+ }, le = (t) => {
162
+ re(t), !(t || x?.configured) && (x?.isFallback || x?.label || x?.conditions?.length) && ie(e, { configured: !0 });
163
+ }, ue = () => {
164
+ if (x?.isFallback) return x.label || D("editor.conditionalEdge.fallback");
165
+ if (x?.label) return x.label;
166
+ let e = x?.conditions ?? [];
167
+ if (e.length === 0) return null;
168
+ if (e.length === 1) {
169
+ let [t] = e, n = E.find((e) => e.nodeId === t.field)?.label ?? t.field ?? "";
170
+ return `${n === t.field && n.length > 5 ? `${n.slice(0, 5)}…` : n} ${t.operator} ${t.value ?? ""}`;
171
+ }
162
172
  let t = e.filter((e) => e.logicalOperator === r.AND).length, n = e.filter((e) => e.logicalOperator === r.OR).length;
163
- return t > 0 && n === 0 ? `${e.length} ${O("editor.conditionalEdge.conditionsAnd")}` : n > 0 && t === 0 ? `${e.length} ${O("editor.conditionalEdge.conditionsOr")}` : `${e.length} ${O("editor.conditionalEdge.conditionsMixed")}`;
164
- }, le = () => b?.isFallback ? "var(--color-chart-4)" : D ? "var(--color-chart-2)" : "var(--color-chart-3)";
173
+ return t > 0 && n === 0 ? `${e.length} ${D("editor.conditionalEdge.conditionsAnd")}` : n > 0 && t === 0 ? `${e.length} ${D("editor.conditionalEdge.conditionsOr")}` : `${e.length} ${D("editor.conditionalEdge.conditionsMixed")}`;
174
+ }, fe = () => x?.isFallback ? "var(--color-chart-4)" : O ? "var(--color-chart-2)" : "var(--color-chart-3)";
165
175
  return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(de, {
166
- path: x,
167
- markerEnd: _,
176
+ path: S,
177
+ markerEnd: y,
168
178
  style: {
169
- ...y,
170
- stroke: le(),
171
- strokeDasharray: b?.isFallback ? "5,5" : void 0,
172
- strokeWidth: D || b?.isFallback ? 2 : y?.strokeWidth
179
+ ...b,
180
+ stroke: fe(),
181
+ strokeDasharray: x?.isFallback ? "5,5" : void 0,
182
+ strokeWidth: O ? 2 : b?.strokeWidth
173
183
  }
174
184
  }), /* @__PURE__ */ P(pe, { children: /* @__PURE__ */ P("div", {
175
185
  className: "nodrag nopan absolute",
176
186
  style: {
177
187
  pointerEvents: "all",
178
- transform: `translate(-50%, -50%) translate(${S}px,${C}px)`
188
+ transform: `translate(-50%, -50%) translate(${C}px,${te}px)`
179
189
  },
180
190
  children: /* @__PURE__ */ F(se, {
181
- open: te,
182
- onOpenChange: ne,
191
+ open: ne,
192
+ onOpenChange: le,
183
193
  children: [/* @__PURE__ */ P(u, {
184
194
  asChild: !0,
185
195
  children: /* @__PURE__ */ F(p, {
186
- variant: D || b?.isFallback ? "default" : "secondary",
187
- className: "h-8 px-2 text-xs",
188
- onClick: oe,
189
- children: [/* @__PURE__ */ P(ut, { className: "mr-1 h-3 w-3" }), D || b?.isFallback ? j() : O("editor.conditionalEdge.condition")]
196
+ variant: O ? "default" : "secondary",
197
+ size: "xs",
198
+ className: d("transition-[filter]", O ? "hover:bg-primary hover:brightness-125" : "hover:bg-secondary hover:brightness-90"),
199
+ onClick: ce,
200
+ children: [/* @__PURE__ */ P(ft, { className: "h-3 w-3" }), O ? ue() : D("editor.conditionalEdge.defineCondition")]
190
201
  })
191
202
  }), /* @__PURE__ */ P(ee, {
192
203
  className: "w-96 p-1",
193
204
  align: "center",
194
205
  onClick: (e) => e.stopPropagation(),
195
- children: /* @__PURE__ */ P(jt, {
206
+ children: /* @__PURE__ */ P(Pt, {
196
207
  className: "flex max-h-150 flex-col p-3",
197
208
  children: /* @__PURE__ */ P("form", {
198
209
  onSubmit: (e) => {
@@ -205,10 +216,10 @@ var Nt = {
205
216
  className: "space-y-2",
206
217
  children: [/* @__PURE__ */ P("h4", {
207
218
  className: "font-medium leading-none",
208
- children: O("editor.conditionalEdge.displayConditions")
219
+ children: D("editor.conditionalEdge.displayConditions")
209
220
  }), /* @__PURE__ */ P("p", {
210
221
  className: "text-muted-foreground text-sm",
211
- children: O("editor.conditionalEdge.displayConditionsDesc")
222
+ children: D("editor.conditionalEdge.displayConditionsDesc")
212
223
  })]
213
224
  }),
214
225
  /* @__PURE__ */ F("div", {
@@ -219,15 +230,15 @@ var Nt = {
219
230
  children: (e) => /* @__PURE__ */ F(w, { children: [
220
231
  /* @__PURE__ */ P(l, {
221
232
  htmlFor: e.name,
222
- children: O("editor.conditionalEdge.labelOptional")
233
+ children: D("editor.conditionalEdge.labelOptional")
223
234
  }),
224
235
  /* @__PURE__ */ P(m, {
225
236
  id: e.name,
226
- placeholder: O("editor.conditionalEdge.labelPlaceholder"),
237
+ placeholder: D("editor.conditionalEdge.labelPlaceholder"),
227
238
  value: e.state.value,
228
239
  onChange: (t) => e.handleChange(t.target.value)
229
240
  }),
230
- /* @__PURE__ */ P(T, { children: O("editor.conditionalEdge.labelDesc") })
241
+ /* @__PURE__ */ P(T, { children: D("editor.conditionalEdge.labelDesc") })
231
242
  ] })
232
243
  }),
233
244
  /* @__PURE__ */ P(k, {
@@ -243,10 +254,10 @@ var Nt = {
243
254
  children: [/* @__PURE__ */ P(l, {
244
255
  htmlFor: e.name,
245
256
  className: "cursor-pointer font-medium",
246
- children: O("editor.conditionalEdge.fallbackPath")
257
+ children: D("editor.conditionalEdge.fallbackPath")
247
258
  }), /* @__PURE__ */ P(T, {
248
259
  className: "text-xs",
249
- children: O("editor.conditionalEdge.fallbackPathDesc")
260
+ children: D("editor.conditionalEdge.fallbackPathDesc")
250
261
  })]
251
262
  })]
252
263
  }) })
@@ -260,7 +271,7 @@ var Nt = {
260
271
  className: "space-y-3",
261
272
  children: [/* @__PURE__ */ P(l, {
262
273
  className: t ? "text-muted-foreground" : "",
263
- children: O("editor.conditionalEdge.conditions")
274
+ children: D("editor.conditionalEdge.conditions")
264
275
  }), /* @__PURE__ */ F("div", {
265
276
  className: "space-y-2",
266
277
  children: [e.state.value?.map((n, i) => /* @__PURE__ */ F("div", {
@@ -272,7 +283,7 @@ var Nt = {
272
283
  name: `conditions[${i}].field`,
273
284
  children: (e) => /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
274
285
  htmlFor: `field-${i}`,
275
- children: O("editor.conditionalEdge.field")
286
+ children: D("editor.conditionalEdge.field")
276
287
  }), /* @__PURE__ */ F(g, {
277
288
  disabled: t,
278
289
  value: e.state.value || "",
@@ -280,11 +291,11 @@ var Nt = {
280
291
  children: [/* @__PURE__ */ P(h, {
281
292
  id: `field-${i}`,
282
293
  className: "w-full",
283
- children: /* @__PURE__ */ P(c, { placeholder: O("editor.conditionalEdge.selectField") })
294
+ children: /* @__PURE__ */ P(c, { placeholder: D("editor.conditionalEdge.selectField") })
284
295
  }), /* @__PURE__ */ P(A, { children: E.length === 0 ? /* @__PURE__ */ P(v, {
285
296
  value: "none",
286
297
  disabled: !0,
287
- children: O("editor.conditionalEdge.noFieldsAvailable")
298
+ children: D("editor.conditionalEdge.noFieldsAvailable")
288
299
  }) : E.map((e) => /* @__PURE__ */ F(v, {
289
300
  value: e.nodeId,
290
301
  children: [
@@ -302,7 +313,7 @@ var Nt = {
302
313
  name: `conditions[${i}].operator`,
303
314
  children: (e) => /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
304
315
  htmlFor: `operator-${i}`,
305
- children: O("editor.conditionalEdge.operator")
316
+ children: D("editor.conditionalEdge.operator")
306
317
  }), /* @__PURE__ */ F(g, {
307
318
  disabled: t,
308
319
  value: e.state.value || "===",
@@ -343,11 +354,11 @@ var Nt = {
343
354
  className: "w-full",
344
355
  children: [/* @__PURE__ */ P(l, {
345
356
  htmlFor: `value-${i}`,
346
- children: O("editor.conditionalEdge.value")
357
+ children: D("editor.conditionalEdge.value")
347
358
  }), /* @__PURE__ */ P(m, {
348
359
  disabled: t,
349
360
  id: `value-${i}`,
350
- placeholder: O("editor.conditionalEdge.valuePlaceholder"),
361
+ placeholder: D("editor.conditionalEdge.valuePlaceholder"),
351
362
  value: e.state.value || "",
352
363
  onChange: (t) => e.handleChange(t.target.value)
353
364
  })]
@@ -361,9 +372,9 @@ var Nt = {
361
372
  size: "sm",
362
373
  className: "w-full",
363
374
  onClick: () => {
364
- e.removeValue(i), ie().then();
375
+ e.removeValue(i), ae().then();
365
376
  },
366
- children: [/* @__PURE__ */ P(R, { className: "mr-1 h-4 w-4" }), O("editor.conditionalEdge.removeCondition")]
377
+ children: [/* @__PURE__ */ P(R, { className: "mr-1 h-4 w-4" }), D("editor.conditionalEdge.removeCondition")]
367
378
  })
368
379
  ]
369
380
  }), e.state.value && i < e.state.value.length - 1 && /* @__PURE__ */ P(k, {
@@ -399,9 +410,9 @@ var Nt = {
399
410
  logicalOperator: r.AND,
400
411
  operator: "===",
401
412
  value: ""
402
- }), ie().then();
413
+ }), ae().then();
403
414
  },
404
- children: [/* @__PURE__ */ P(L, { className: "mr-2 h-4 w-4" }), O("editor.conditionalEdge.addCondition")]
415
+ children: [/* @__PURE__ */ P(L, { className: "mr-2 h-4 w-4" }), D("editor.conditionalEdge.addCondition")]
405
416
  })]
406
417
  })]
407
418
  });
@@ -415,13 +426,13 @@ var Nt = {
415
426
  type: "button",
416
427
  size: "sm",
417
428
  variant: "outline",
418
- onClick: ce,
419
- children: [/* @__PURE__ */ P(R, { className: "mr-1 h-4 w-4" }), O("common.clear")]
429
+ onClick: j,
430
+ children: [/* @__PURE__ */ P(R, { className: "mr-1 h-4 w-4" }), D("common.clear")]
420
431
  }), /* @__PURE__ */ P(p, {
421
432
  type: "button",
422
433
  size: "sm",
423
- onClick: () => ne(!1),
424
- children: O("common.close")
434
+ onClick: () => le(!1),
435
+ children: D("common.close")
425
436
  })]
426
437
  })
427
438
  ]
@@ -432,7 +443,7 @@ var Nt = {
432
443
  })
433
444
  }) })] });
434
445
  }),
435
- default: pt(({ id: e, sourceX: t, sourceY: n, targetX: r, targetY: i, sourcePosition: a, targetPosition: o, style: s, markerEnd: c, selected: l }) => {
446
+ default: ht(({ id: e, sourceX: t, sourceY: n, targetX: r, targetY: i, sourcePosition: a, targetPosition: o, style: s, markerEnd: c, selected: l }) => {
436
447
  let [u, d, f] = Se({
437
448
  sourcePosition: a,
438
449
  sourceX: t,
@@ -478,7 +489,7 @@ var Nt = {
478
489
  textarea: "textarea",
479
490
  time: "time",
480
491
  timerange: "timerange"
481
- }, Pt = { [a.input]: { type: K.text } }, q = () => {
492
+ }, Rt = { [a.input]: { type: K.text } }, q = () => {
482
493
  let { setNodes: e, setEdges: t, getNodes: n } = M(), r = z(() => {
483
494
  e((e) => e.map(({ selected: e, ...t }) => t)), t((e) => e.map(({ selected: e, ...t }) => t));
484
495
  }, [t, e]), i = z((n) => {
@@ -497,7 +508,7 @@ var Nt = {
497
508
  }, [e]), o = z((t, n) => {
498
509
  e((e) => e.map((e) => e.id === t ? {
499
510
  ...e,
500
- data: Pt[n] ?? {},
511
+ data: Rt[n] ?? {},
501
512
  type: n
502
513
  } : e));
503
514
  }, [e]), s = z((e) => {
@@ -522,7 +533,7 @@ var Nt = {
522
533
  updateSelectedNodeData: c,
523
534
  updateSelectedNodeType: s
524
535
  };
525
- }, Ft = ({ nodeId: e, label: t, placeholder: n, className: r }) => {
536
+ }, zt = ({ nodeId: e, label: t, placeholder: n, className: r }) => {
526
537
  let { language: i } = W(), { updateNodeData: a } = q(), o = G(), s = t?.[i] ?? "", c = n || o("editor.treegeNode.labelPlaceholder"), l = (n) => {
527
538
  a(e, { label: {
528
539
  ...t,
@@ -562,7 +573,7 @@ function X({ className: e, sideOffset: t = 4, ...n }) {
562
573
  ...n
563
574
  }) });
564
575
  }
565
- function It({ ...e }) {
576
+ function Bt({ ...e }) {
566
577
  return /* @__PURE__ */ P(V.Group, {
567
578
  "data-slot": "dropdown-menu-group",
568
579
  ...e
@@ -577,7 +588,7 @@ function Z({ className: e, inset: t, variant: n = "default", ...r }) {
577
588
  ...r
578
589
  });
579
590
  }
580
- function Lt({ className: e, inset: t, ...n }) {
591
+ function Vt({ className: e, inset: t, ...n }) {
581
592
  return /* @__PURE__ */ P(V.Label, {
582
593
  "data-slot": "dropdown-menu-label",
583
594
  "data-inset": t,
@@ -585,7 +596,7 @@ function Lt({ className: e, inset: t, ...n }) {
585
596
  ...n
586
597
  });
587
598
  }
588
- function Rt({ className: e, ...t }) {
599
+ function Ht({ className: e, ...t }) {
589
600
  return /* @__PURE__ */ P(V.Separator, {
590
601
  "data-slot": "dropdown-menu-separator",
591
602
  className: d("-mx-1 my-1 h-px bg-border", e),
@@ -594,38 +605,41 @@ function Rt({ className: e, ...t }) {
594
605
  }
595
606
  //#endregion
596
607
  //#region src/editor/features/TreegeEditor/nodes/components/NodeMoreMenu.tsx
597
- var zt = ({ nodeId: e, className: t }) => {
608
+ var Ut = ({ nodeId: e, className: t }) => {
598
609
  let { selectNode: n } = q(), { setIsNodeSheetOpen: r, openDeleteNodeConfirmation: i } = W(), a = G(), o = (e) => e.stopPropagation();
599
- return /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(Y, {
600
- asChild: !0,
601
- onClick: o,
602
- children: /* @__PURE__ */ P("button", {
603
- type: "button",
604
- "aria-label": a("editor.nodeActionsSheet.editNode"),
605
- className: d("nodrag nopan absolute top-2 right-2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-md opacity-60 transition-all hover:text-[--treege-color-primary] hover:opacity-100", t),
606
- children: /* @__PURE__ */ P(Ze, { className: "h-3.5 w-3.5" })
607
- })
608
- }), /* @__PURE__ */ F(X, {
609
- align: "end",
610
- onClick: o,
611
- children: [
612
- /* @__PURE__ */ F(Z, {
613
- onClick: () => {
614
- n(e), r(!0);
615
- },
616
- children: [/* @__PURE__ */ P(it, {}), a("common.settings")]
617
- }),
618
- /* @__PURE__ */ P(Rt, {}),
619
- /* @__PURE__ */ F(Z, {
620
- variant: "destructive",
621
- onSelect: (t) => {
622
- t.preventDefault(), i(e);
623
- },
624
- children: [/* @__PURE__ */ P(ot, {}), a("common.delete")]
610
+ return /* @__PURE__ */ F(J, {
611
+ modal: !1,
612
+ children: [/* @__PURE__ */ P(Y, {
613
+ asChild: !0,
614
+ onClick: o,
615
+ children: /* @__PURE__ */ P("button", {
616
+ type: "button",
617
+ "aria-label": a("editor.nodeActionsSheet.editNode"),
618
+ className: d("nodrag nopan absolute top-2 right-2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-md opacity-60 transition-all hover:text-[--treege-color-primary] hover:opacity-100", t),
619
+ children: /* @__PURE__ */ P($e, { className: "h-3.5 w-3.5" })
625
620
  })
626
- ]
627
- })] });
628
- }, Bt = bt("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3", {
621
+ }), /* @__PURE__ */ F(X, {
622
+ align: "end",
623
+ onClick: o,
624
+ children: [
625
+ /* @__PURE__ */ F(Z, {
626
+ onSelect: () => {
627
+ n(e), r(!0);
628
+ },
629
+ children: [/* @__PURE__ */ P(ot, {}), a("common.settings")]
630
+ }),
631
+ /* @__PURE__ */ P(Ht, {}),
632
+ /* @__PURE__ */ F(Z, {
633
+ variant: "destructive",
634
+ onSelect: () => {
635
+ i(e);
636
+ },
637
+ children: [/* @__PURE__ */ P(ct, {}), a("common.delete")]
638
+ })
639
+ ]
640
+ })]
641
+ });
642
+ }, Wt = St("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3", {
629
643
  defaultVariants: { variant: "default" },
630
644
  variants: { variant: {
631
645
  blue: "bg-blue-500 text-white dark:bg-blue-600",
@@ -636,45 +650,45 @@ var zt = ({ nodeId: e, className: t }) => {
636
650
  secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90"
637
651
  } }
638
652
  });
639
- function Vt({ className: e, variant: t, asChild: n = !1, ...r }) {
640
- return /* @__PURE__ */ P(n ? yt : "span", {
653
+ function Gt({ className: e, variant: t, asChild: n = !1, ...r }) {
654
+ return /* @__PURE__ */ P(n ? xt : "span", {
641
655
  "data-slot": "badge",
642
- className: d(Bt({ variant: t }), e),
656
+ className: d(Wt({ variant: t }), e),
643
657
  ...r
644
658
  });
645
659
  }
646
- var Ht = pt(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
660
+ var Kt = ht(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
647
661
  /* @__PURE__ */ P(ge, {}),
648
662
  /* @__PURE__ */ P("div", {
649
663
  className: "-top-3.5 absolute left-6",
650
- children: /* @__PURE__ */ F(Vt, {
664
+ children: /* @__PURE__ */ F(Gt, {
651
665
  className: "max-w-50 bg-chart-2",
652
- children: [/* @__PURE__ */ P(De, { className: "!w-3 !h-3" }), /* @__PURE__ */ P(Ft, {
666
+ children: [/* @__PURE__ */ P(ke, { className: "!w-3 !h-3" }), /* @__PURE__ */ P(zt, {
653
667
  nodeId: t,
654
668
  label: e?.label,
655
669
  className: "min-w-0 flex-1 text-xs text-white placeholder:text-white/60"
656
670
  })]
657
671
  })
658
672
  }),
659
- /* @__PURE__ */ P(zt, { nodeId: t })
660
- ] })), Ut = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", Wt = (e = 21) => {
673
+ /* @__PURE__ */ P(Ut, { nodeId: t })
674
+ ] })), qt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", Jt = (e = 21) => {
661
675
  let t = "", n = crypto.getRandomValues(new Uint8Array(e |= 0));
662
- for (; e--;) t += Ut[n[e] & 63];
676
+ for (; e--;) t += qt[n[e] & 63];
663
677
  return t;
664
- }, Gt = {
678
+ }, Yt = {
665
679
  data: { type: "text" },
666
- id: Wt(),
680
+ id: Jt(),
667
681
  position: {
668
682
  x: 0,
669
683
  y: 0
670
684
  },
671
685
  type: "input"
672
- }, Kt = () => {
686
+ }, Xt = () => {
673
687
  let { setNodes: e, setEdges: t, screenToFlowPosition: n, getNode: r, getNodes: i, getEdges: a } = M(), o = z((n, r, i = !1, o) => {
674
688
  let c = n.id, l = a().filter((e) => e.source === c), u = s(n);
675
689
  if (l.length > 0 && !u) return;
676
- let d = Wt(), f = {
677
- ...Gt,
690
+ let d = Jt(), f = {
691
+ ...Yt,
678
692
  ...o && {
679
693
  data: o.data ?? {},
680
694
  type: o.type
@@ -690,7 +704,7 @@ var Ht = pt(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
690
704
  operator: "===",
691
705
  value: ""
692
706
  }] } : void 0,
693
- id: Wt(),
707
+ id: Jt(),
694
708
  source: c,
695
709
  target: d,
696
710
  type: t && u ? "conditional" : "default"
@@ -796,11 +810,11 @@ var Ht = pt(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
796
810
  onConnectEnd: u,
797
811
  onEdgesDelete: d
798
812
  };
799
- }, qt = {
813
+ }, Zt = {
800
814
  divider: "divider",
801
815
  title: "title"
802
- }, Jt = ({ nodeId: e, isConnectable: t }) => {
803
- let { onAddFromHandle: n } = Kt(), r = G(), [i, o] = B(!1);
816
+ }, Qt = ({ nodeId: e, isConnectable: t }) => {
817
+ let { onAddFromHandle: n } = Xt(), r = G(), [i, o] = B(!1);
804
818
  return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(me, {
805
819
  type: "source",
806
820
  position: ve.Bottom,
@@ -824,7 +838,7 @@ var Ht = pt(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
824
838
  side: "bottom",
825
839
  className: "treege-scrollbar max-h-80",
826
840
  children: [
827
- /* @__PURE__ */ F(It, { children: [/* @__PURE__ */ P(Lt, { children: r("editor.selectNodeType.options.input") }), Object.values(K).map((t) => /* @__PURE__ */ P(Z, {
841
+ /* @__PURE__ */ F(Bt, { children: [/* @__PURE__ */ P(Vt, { children: r("editor.selectNodeType.options.input") }), Object.values(K).map((t) => /* @__PURE__ */ P(Z, {
828
842
  onClick: () => n(e, {
829
843
  data: { type: t },
830
844
  type: a.input
@@ -832,8 +846,8 @@ var Ht = pt(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
832
846
  className: "capitalize",
833
847
  children: t
834
848
  }, t))] }),
835
- /* @__PURE__ */ P(Rt, {}),
836
- /* @__PURE__ */ F(It, { children: [/* @__PURE__ */ P(Lt, { children: r("editor.selectNodeType.options.ui") }), Object.values(qt).map((t) => /* @__PURE__ */ P(Z, {
849
+ /* @__PURE__ */ P(Ht, {}),
850
+ /* @__PURE__ */ F(Bt, { children: [/* @__PURE__ */ P(Vt, { children: r("editor.selectNodeType.options.ui") }), Object.values(Zt).map((t) => /* @__PURE__ */ P(Z, {
837
851
  onClick: () => n(e, {
838
852
  data: { type: t },
839
853
  type: a.ui
@@ -841,8 +855,8 @@ var Ht = pt(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
841
855
  className: "capitalize",
842
856
  children: t
843
857
  }, t))] }),
844
- /* @__PURE__ */ P(Rt, {}),
845
- /* @__PURE__ */ F(It, { children: [/* @__PURE__ */ P(Lt, { children: r("common.other") }), /* @__PURE__ */ P(Z, {
858
+ /* @__PURE__ */ P(Ht, {}),
859
+ /* @__PURE__ */ F(Bt, { children: [/* @__PURE__ */ P(Vt, { children: r("common.other") }), /* @__PURE__ */ P(Z, {
846
860
  onClick: () => n(e, {
847
861
  data: {},
848
862
  type: a.flow
@@ -852,42 +866,42 @@ var Ht = pt(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
852
866
  ]
853
867
  })]
854
868
  })] });
855
- }, Yt = {
856
- [K.address]: Ye,
857
- [K.autocomplete]: nt,
858
- [K.checkbox]: Me,
859
- [K.date]: Oe,
860
- [K.daterange]: ke,
861
- [K.file]: Qe,
862
- [K.hidden]: Ve,
863
- [K.http]: Le,
864
- [K.number]: He,
865
- [K.password]: Ge,
866
- [K.radio]: Fe,
867
- [K.select]: qe,
868
- [K.submit]: rt,
869
- [K.switch]: at,
870
- [K.text]: Ae,
871
- [K.textarea]: Te,
872
- [K.time]: Ie,
873
- [K.timerange]: Ie,
874
- [qt.divider]: Xe,
875
- [qt.title]: Ue
876
- }, Xt = et, Zt = (e) => e && Yt[e] || Xt, Qt = {
869
+ }, $t = {
870
+ [K.address]: Ze,
871
+ [K.autocomplete]: it,
872
+ [K.checkbox]: Pe,
873
+ [K.date]: Ae,
874
+ [K.daterange]: je,
875
+ [K.file]: et,
876
+ [K.hidden]: Ue,
877
+ [K.http]: ze,
878
+ [K.number]: We,
879
+ [K.password]: qe,
880
+ [K.radio]: Le,
881
+ [K.select]: Ye,
882
+ [K.submit]: at,
883
+ [K.switch]: st,
884
+ [K.text]: Me,
885
+ [K.textarea]: De,
886
+ [K.time]: Re,
887
+ [K.timerange]: Re,
888
+ [Zt.divider]: Qe,
889
+ [Zt.title]: Ge
890
+ }, en = nt, tn = (e) => e && $t[e] || en, nn = {
877
891
  input: Object.values(K),
878
- ui: Object.values(qt)
879
- }, $t = ({ nodeId: e, type: t, inputType: n }) => {
880
- let { updateNodeData: r } = q(), i = G(), a = Qt[t], o = (e) => e.stopPropagation();
892
+ ui: Object.values(Zt)
893
+ }, rn = ({ nodeId: e, type: t, inputType: n }) => {
894
+ let { updateNodeData: r } = q(), i = G(), a = nn[t], o = (e) => e.stopPropagation();
881
895
  return /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(Y, {
882
896
  asChild: !0,
883
897
  onClick: o,
884
- children: /* @__PURE__ */ F(Vt, {
898
+ children: /* @__PURE__ */ F(Gt, {
885
899
  variant: "default",
886
900
  className: "nodrag nopan cursor-pointer px-1.5 py-0 text-[10px] capitalize [&>svg]:size-2.5",
887
901
  children: [
888
- /* @__PURE__ */ P(Zt(n), { className: "mt-0.5" }),
902
+ /* @__PURE__ */ P(tn(n), { className: "mt-0.5" }),
889
903
  n || i("editor.selectInputType.type"),
890
- /* @__PURE__ */ P(Ne, {})
904
+ /* @__PURE__ */ P(Fe, {})
891
905
  ]
892
906
  })
893
907
  }), /* @__PURE__ */ P(X, {
@@ -895,7 +909,7 @@ var Ht = pt(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
895
909
  className: "treege-scrollbar max-h-60",
896
910
  onClick: o,
897
911
  children: a.map((t) => {
898
- let i = Zt(t);
912
+ let i = tn(t);
899
913
  return /* @__PURE__ */ F(Z, {
900
914
  onClick: () => r(e, { type: t }),
901
915
  className: d("capitalize", t === n && "bg-accent"),
@@ -903,14 +917,14 @@ var Ht = pt(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
903
917
  }, t);
904
918
  })
905
919
  })] });
906
- }, en = [
920
+ }, an = [
907
921
  "radio",
908
922
  "select",
909
923
  "checkbox",
910
924
  "autocomplete"
911
- ], tn = ({ nodeId: e, data: t }) => {
925
+ ], on = ({ nodeId: e, data: t }) => {
912
926
  let [n, r] = B(!1), [i, a] = B(""), [o, s] = B(""), { updateNodeData: c } = q(), { language: d } = W(), f = G(), h = t && "type" in t ? t.type : void 0;
913
- if (!(h && en.includes(h))) return null;
927
+ if (!(h && an.includes(h))) return null;
914
928
  let g = t.options ?? [], _ = () => {
915
929
  a(""), s("");
916
930
  }, v = (t) => {
@@ -945,7 +959,7 @@ var Ht = pt(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
945
959
  type: "button",
946
960
  variant: "link",
947
961
  size: "xs",
948
- className: "w-fit p-0!",
962
+ className: "w-fit p-0! focus-visible:border-transparent! focus-visible:ring-0!",
949
963
  children: [/* @__PURE__ */ P(L, { className: "size-3" }), f("editor.inputNodeForm.addOption")]
950
964
  })
951
965
  }), /* @__PURE__ */ P(ee, {
@@ -994,9 +1008,9 @@ var Ht = pt(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
994
1008
  })]
995
1009
  })]
996
1010
  });
997
- }, nn = ({ nodeId: e, required: t }) => {
1011
+ }, sn = ({ nodeId: e, required: t }) => {
998
1012
  let { updateNodeData: n } = q(), r = G();
999
- return /* @__PURE__ */ P(Vt, {
1013
+ return /* @__PURE__ */ P(Gt, {
1000
1014
  variant: t ? "destructive" : "outline",
1001
1015
  asChild: !0,
1002
1016
  className: "nodrag nopan cursor-pointer px-1.5 py-0 text-[10px] capitalize [&>svg]:size-2.5",
@@ -1008,23 +1022,23 @@ var Ht = pt(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
1008
1022
  children: r(t ? "editor.inputNodeForm.required" : "editor.inputNodeForm.optional")
1009
1023
  })
1010
1024
  });
1011
- }, rn = ({ children: e, inGroup: t, isSubmit: n }) => /* @__PURE__ */ P("div", {
1025
+ }, cn = ({ children: e, inGroup: t, isSubmit: n }) => /* @__PURE__ */ P("div", {
1012
1026
  className: d("react-flow__node__wrapper relative", t && "in-group", n && "submit-type"),
1013
1027
  children: e
1014
- }), an = pt(({ data: e, isConnectable: t, parentId: n, type: r, id: i }) => {
1028
+ }), ln = ht(({ data: e, isConnectable: t, parentId: n, type: r, id: i }) => {
1015
1029
  let a = r === "input" || r === "ui" ? e?.type : void 0, o = r === "input" && e?.type === "submit", s = r === "input" ? e?.name : void 0;
1016
- return /* @__PURE__ */ F(rn, {
1030
+ return /* @__PURE__ */ F(cn, {
1017
1031
  inGroup: !!n,
1018
1032
  isSubmit: o,
1019
1033
  children: [
1020
- /* @__PURE__ */ P(zt, { nodeId: i }),
1034
+ /* @__PURE__ */ P(Ut, { nodeId: i }),
1021
1035
  /* @__PURE__ */ P(me, {
1022
1036
  type: "target",
1023
1037
  position: ve.Top,
1024
1038
  isConnectable: t,
1025
1039
  isConnectableStart: r === "ui"
1026
1040
  }),
1027
- /* @__PURE__ */ P(Ft, {
1041
+ /* @__PURE__ */ P(zt, {
1028
1042
  nodeId: i,
1029
1043
  label: e?.label,
1030
1044
  placeholder: s,
@@ -1032,43 +1046,40 @@ var Ht = pt(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
1032
1046
  }),
1033
1047
  /* @__PURE__ */ F("div", {
1034
1048
  className: "mb-1 flex gap-1",
1035
- children: [(r === "input" || r === "ui") && /* @__PURE__ */ P($t, {
1049
+ children: [(r === "input" || r === "ui") && /* @__PURE__ */ P(rn, {
1036
1050
  nodeId: i,
1037
1051
  type: r,
1038
1052
  inputType: a
1039
- }), r === "input" && !o && /* @__PURE__ */ P(nn, {
1053
+ }), r === "input" && !o && /* @__PURE__ */ P(sn, {
1040
1054
  nodeId: i,
1041
1055
  required: e?.required
1042
1056
  })]
1043
1057
  }),
1044
- r === "input" && /* @__PURE__ */ P(tn, {
1058
+ r === "input" && /* @__PURE__ */ P(on, {
1045
1059
  nodeId: i,
1046
1060
  data: e
1047
1061
  }),
1048
- /* @__PURE__ */ P(Jt, {
1062
+ /* @__PURE__ */ P(Qt, {
1049
1063
  nodeId: i,
1050
1064
  isConnectable: t
1051
1065
  })
1052
1066
  ]
1053
1067
  });
1054
- }), on = {
1055
- [a.flow]: an,
1056
- [a.group]: Ht,
1057
- [a.input]: an,
1058
- [a.ui]: an
1059
- }, sn = () => {
1068
+ }), un = {
1069
+ [a.flow]: ln,
1070
+ [a.group]: Kt,
1071
+ [a.input]: ln,
1072
+ [a.ui]: ln
1073
+ }, dn = () => {
1060
1074
  let { pendingDeleteNodeId: e, closeDeleteNodeConfirmation: t } = W(), { deleteNode: n } = q(), r = G();
1061
- return /* @__PURE__ */ P(oe, {
1075
+ return /* @__PURE__ */ P(k, {
1062
1076
  open: e !== null,
1063
1077
  onOpenChange: (e) => {
1064
1078
  e || t();
1065
1079
  },
1066
- modal: !1,
1067
1080
  children: /* @__PURE__ */ F(b, {
1068
1081
  showCloseButton: !1,
1069
- onInteractOutside: (e) => e.preventDefault(),
1070
- onPointerDownOutside: (e) => e.preventDefault(),
1071
- children: [/* @__PURE__ */ F(re, { children: [/* @__PURE__ */ P(C, { children: r("editor.nodeActionsSheet.deleteNode") }), /* @__PURE__ */ P(x, { children: r("editor.nodeActionsSheet.deleteNodeConfirm") })] }), /* @__PURE__ */ F(O, { children: [/* @__PURE__ */ P(p, {
1082
+ children: [/* @__PURE__ */ F(re, { children: [/* @__PURE__ */ P(C, { children: r("editor.nodeActionsSheet.deleteNode") }), /* @__PURE__ */ P(x, { children: r("editor.nodeActionsSheet.deleteNodeConfirm") })] }), /* @__PURE__ */ F(D, { children: [/* @__PURE__ */ P(p, {
1072
1083
  variant: "outline",
1073
1084
  onClick: t,
1074
1085
  children: r("common.cancel")
@@ -1080,13 +1091,13 @@ var Ht = pt(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
1080
1091
  })] })]
1081
1092
  })
1082
1093
  });
1083
- }, cn = "You are a Treege decision tree generator. You must generate valid JSON structures for decision trees.\n\nIMPORTANT RULES:\n1. Always respond with valid JSON only, no markdown, no code blocks, no explanations outside the JSON\n2. The JSON must have this exact structure: { \"nodes\": [...], \"edges\": [...] }\n3. Every node must have: id (string), type (string), position ({ x: number, y: number }), data (object)\n4. Every edge must have: id (string), source (string), target (string)\n5. For regex patterns: ALWAYS use double backslashes (\\\\) for special characters (\\\\s, \\\\d, etc.)\n6. AVOID using \"pattern\" field unless specifically requested - prefer using simple validation\n7. For submit buttons, use type \"input\" with data.type \"submit\", NOT type \"flow\"\n8. For conditional logic, use conditional edges with proper operators (===, !==, >, <, >=, <=)\n\nNODE TYPES:\n- \"input\": Form input fields (text, number, select, checkbox, etc.)\n- \"ui\": UI elements (title, divider)\n- \"flow\": Navigation/flow control nodes\n- \"group\": Container for organizing nodes\n\nINPUT NODE TYPES (data.type):\n- \"text\", \"number\", \"textarea\", \"password\"\n- \"select\", \"radio\", \"checkbox\", \"switch\"\n- \"autocomplete\", \"date\", \"daterange\", \"time\", \"timerange\"\n- \"file\", \"address\", \"http\", \"hidden\", \"submit\"\n\nINPUT NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Field Label\",\n \"name\": \"fieldName\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter value...\",\n \"helperText\": \"Optional helper text\",\n \"pattern\": \"regex pattern (optional)\",\n \"errorMessage\": \"Error message if validation fails\",\n \"options\": [{ \"value\": \"val\", \"label\": \"Label\" }], // for select/radio/checkbox\n \"multiple\": false // for select/checkbox\n }\n}\n\nUI NODE TYPES (data.type):\n- \"title\": Display a title\n- \"divider\": Display a divider line\n\nUI NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"UI Element Label\",\n \"type\": \"title\" // or \"divider\"\n }\n}\n\nFLOW NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"flow\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Flow Step Label\",\n \"targetId\": \"next-node-id\" // optional\n }\n}\n\nGROUP NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"group\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Group Label\"\n }\n}\n\nEDGE STRUCTURE:\n{\n \"id\": \"edge-id\",\n \"source\": \"source-node-id\",\n \"target\": \"target-node-id\",\n \"type\": \"default\" // or \"conditional\" for conditional logic\n}\n\nCONDITIONAL EDGE STRUCTURE:\n{\n \"id\": \"edge-id\",\n \"source\": \"source-node-id\",\n \"target\": \"target-node-id\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If condition is true\", // optional label for the edge\n \"conditions\": [\n {\n \"field\": \"field-node-id\", // ID of the field to check\n \"operator\": \">=\", // operators: ===, !==, >, <, >=, <=\n \"value\": \"18\" // value to compare (as string)\n }\n ],\n \"operator\": \"AND\" // optional: \"AND\" or \"OR\" for multiple conditions (default: AND)\n }\n}\n\nIMPORTANT: For conditional edges, the value must ALWAYS be a string, even for numbers.\nExample: For \"age >= 18\", use \"value\": \"18\" (not value: 18)\n\nLAYOUT GUIDELINES:\n- Position nodes in a vertical flow (top to bottom)\n- Start at position { x: 0, y: 0 }\n- Space nodes vertically by exactly 250 pixels between each position (node height 150px + 100px spacing)\n- For horizontal spacing, use 350 pixels\n- Create logical flow from top to bottom\n- IMPORTANT: Keep consistent vertical spacing to avoid overlap\n- Each node position Y should increment by 250: first at y:0, second at y:250, third at y:500, etc.\n\nEXAMPLES:\n\nUser: \"Create a simple contact form with name, email and message\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"Contact Form\", \"type\": \"title\" }\n },\n {\n \"id\": \"name-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Name\",\n \"name\": \"name\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter your name\"\n }\n },\n {\n \"id\": \"email-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Email\",\n \"name\": \"email\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"your@email.com\"\n }\n },\n {\n \"id\": \"message-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 750 },\n \"data\": {\n \"label\": \"Message\",\n \"name\": \"message\",\n \"type\": \"textarea\",\n \"required\": true,\n \"placeholder\": \"Enter your message\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"name-1\" },\n { \"id\": \"e2\", \"source\": \"name-1\", \"target\": \"email-1\" },\n { \"id\": \"e3\", \"source\": \"email-1\", \"target\": \"message-1\" }\n ]\n}\n\nUser: \"Create a user registration form with age, address and country selector\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"User Registration\", \"type\": \"title\" }\n },\n {\n \"id\": \"age-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Age\",\n \"name\": \"age\",\n \"type\": \"number\",\n \"required\": true,\n \"placeholder\": \"Enter your age\"\n }\n },\n {\n \"id\": \"address-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Address\",\n \"name\": \"address\",\n \"type\": \"address\",\n \"required\": true,\n \"placeholder\": \"Enter your address\"\n }\n },\n {\n \"id\": \"country-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 750 },\n \"data\": {\n \"label\": \"Country\",\n \"name\": \"country\",\n \"type\": \"select\",\n \"required\": true,\n \"options\": [\n { \"value\": \"us\", \"label\": \"United States\" },\n { \"value\": \"ca\", \"label\": \"Canada\" },\n { \"value\": \"uk\", \"label\": \"United Kingdom\" },\n { \"value\": \"fr\", \"label\": \"France\" },\n { \"value\": \"de\", \"label\": \"Germany\" }\n ]\n }\n },\n {\n \"id\": \"submit-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 1000 },\n \"data\": {\n \"label\": \"Submit\",\n \"type\": \"submit\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"age-1\" },\n { \"id\": \"e2\", \"source\": \"age-1\", \"target\": \"address-1\" },\n { \"id\": \"e3\", \"source\": \"address-1\", \"target\": \"country-1\" },\n { \"id\": \"e4\", \"source\": \"country-1\", \"target\": \"submit-1\" }\n ]\n}\n\nUser: \"Create a form with name, age, and show different questions based on age (movie for 18+, color for under 18)\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"Survey Form\", \"type\": \"title\" }\n },\n {\n \"id\": \"name-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Name\",\n \"name\": \"name\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter your name\"\n }\n },\n {\n \"id\": \"age-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Age\",\n \"name\": \"age\",\n \"type\": \"number\",\n \"required\": true,\n \"placeholder\": \"Enter your age\"\n }\n },\n {\n \"id\": \"movie-1\",\n \"type\": \"input\",\n \"position\": { \"x\": -350, \"y\": 750 },\n \"data\": {\n \"label\": \"Favorite Movie\",\n \"name\": \"favoriteMovie\",\n \"type\": \"text\",\n \"required\": true,\n \"helperText\": \"For adults 18 and over\"\n }\n },\n {\n \"id\": \"color-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 350, \"y\": 750 },\n \"data\": {\n \"label\": \"Favorite Color\",\n \"name\": \"favoriteColor\",\n \"type\": \"text\",\n \"required\": true,\n \"helperText\": \"For those under 18\"\n }\n },\n {\n \"id\": \"submit-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 1000 },\n \"data\": {\n \"label\": \"Submit\",\n \"type\": \"submit\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"name-1\" },\n { \"id\": \"e2\", \"source\": \"name-1\", \"target\": \"age-1\" },\n {\n \"id\": \"e3\",\n \"source\": \"age-1\",\n \"target\": \"movie-1\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If 18 or older\",\n \"conditions\": [\n {\n \"field\": \"age-1\",\n \"operator\": \">=\",\n \"value\": \"18\"\n }\n ]\n }\n },\n {\n \"id\": \"e4\",\n \"source\": \"age-1\",\n \"target\": \"color-1\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If under 18\",\n \"conditions\": [\n {\n \"field\": \"age-1\",\n \"operator\": \"<\",\n \"value\": \"18\"\n }\n ]\n }\n },\n { \"id\": \"e5\", \"source\": \"movie-1\", \"target\": \"submit-1\" },\n { \"id\": \"e6\", \"source\": \"color-1\", \"target\": \"submit-1\" }\n ]\n}\n\nRemember:\n- Always respond with ONLY valid JSON\n- No markdown code blocks\n- No explanations outside the JSON\n- Follow the exact structure shown above\n- For submit buttons, ALWAYS use type \"input\" with data.type \"submit\"\n- For conditional edges, ALWAYS specify the value as a string and use proper operators (>=, <, ===, etc.)\n- Never leave condition values empty - always provide the comparison value\n", ln = {
1094
+ }, fn = "You are a Treege decision tree generator. You must generate valid JSON structures for decision trees.\n\nIMPORTANT RULES:\n1. Always respond with valid JSON only, no markdown, no code blocks, no explanations outside the JSON\n2. The JSON must have this exact structure: { \"nodes\": [...], \"edges\": [...] }\n3. Every node must have: id (string), type (string), position ({ x: number, y: number }), data (object)\n4. Every edge must have: id (string), source (string), target (string)\n5. For regex patterns: ALWAYS use double backslashes (\\\\) for special characters (\\\\s, \\\\d, etc.)\n6. AVOID using \"pattern\" field unless specifically requested - prefer using simple validation\n7. For submit buttons, use type \"input\" with data.type \"submit\", NOT type \"flow\"\n8. For conditional logic, use conditional edges with proper operators (===, !==, >, <, >=, <=)\n\nNODE TYPES:\n- \"input\": Form input fields (text, number, select, checkbox, etc.)\n- \"ui\": UI elements (title, divider)\n- \"flow\": Navigation/flow control nodes\n- \"group\": Container for organizing nodes\n\nINPUT NODE TYPES (data.type):\n- \"text\", \"number\", \"textarea\", \"password\"\n- \"select\", \"radio\", \"checkbox\", \"switch\"\n- \"autocomplete\", \"date\", \"daterange\", \"time\", \"timerange\"\n- \"file\", \"address\", \"http\", \"hidden\", \"submit\"\n\nINPUT NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Field Label\",\n \"name\": \"fieldName\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter value...\",\n \"helperText\": \"Optional helper text\",\n \"pattern\": \"regex pattern (optional)\",\n \"errorMessage\": \"Error message if validation fails\",\n \"options\": [{ \"value\": \"val\", \"label\": \"Label\" }], // for select/radio/checkbox\n \"multiple\": false // for select/checkbox\n }\n}\n\nUI NODE TYPES (data.type):\n- \"title\": Display a title\n- \"divider\": Display a divider line\n\nUI NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"UI Element Label\",\n \"type\": \"title\" // or \"divider\"\n }\n}\n\nFLOW NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"flow\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Flow Step Label\",\n \"targetId\": \"next-node-id\" // optional\n }\n}\n\nGROUP NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"group\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Group Label\"\n }\n}\n\nEDGE STRUCTURE:\n{\n \"id\": \"edge-id\",\n \"source\": \"source-node-id\",\n \"target\": \"target-node-id\",\n \"type\": \"default\" // or \"conditional\" for conditional logic\n}\n\nCONDITIONAL EDGE STRUCTURE:\n{\n \"id\": \"edge-id\",\n \"source\": \"source-node-id\",\n \"target\": \"target-node-id\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If condition is true\", // optional label for the edge\n \"conditions\": [\n {\n \"field\": \"field-node-id\", // ID of the field to check\n \"operator\": \">=\", // operators: ===, !==, >, <, >=, <=\n \"value\": \"18\" // value to compare (as string)\n }\n ],\n \"operator\": \"AND\" // optional: \"AND\" or \"OR\" for multiple conditions (default: AND)\n }\n}\n\nIMPORTANT: For conditional edges, the value must ALWAYS be a string, even for numbers.\nExample: For \"age >= 18\", use \"value\": \"18\" (not value: 18)\n\nLAYOUT GUIDELINES:\n- Position nodes in a vertical flow (top to bottom)\n- Start at position { x: 0, y: 0 }\n- Space nodes vertically by exactly 250 pixels between each position (node height 150px + 100px spacing)\n- For horizontal spacing, use 350 pixels\n- Create logical flow from top to bottom\n- IMPORTANT: Keep consistent vertical spacing to avoid overlap\n- Each node position Y should increment by 250: first at y:0, second at y:250, third at y:500, etc.\n\nEXAMPLES:\n\nUser: \"Create a simple contact form with name, email and message\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"Contact Form\", \"type\": \"title\" }\n },\n {\n \"id\": \"name-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Name\",\n \"name\": \"name\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter your name\"\n }\n },\n {\n \"id\": \"email-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Email\",\n \"name\": \"email\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"your@email.com\"\n }\n },\n {\n \"id\": \"message-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 750 },\n \"data\": {\n \"label\": \"Message\",\n \"name\": \"message\",\n \"type\": \"textarea\",\n \"required\": true,\n \"placeholder\": \"Enter your message\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"name-1\" },\n { \"id\": \"e2\", \"source\": \"name-1\", \"target\": \"email-1\" },\n { \"id\": \"e3\", \"source\": \"email-1\", \"target\": \"message-1\" }\n ]\n}\n\nUser: \"Create a user registration form with age, address and country selector\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"User Registration\", \"type\": \"title\" }\n },\n {\n \"id\": \"age-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Age\",\n \"name\": \"age\",\n \"type\": \"number\",\n \"required\": true,\n \"placeholder\": \"Enter your age\"\n }\n },\n {\n \"id\": \"address-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Address\",\n \"name\": \"address\",\n \"type\": \"address\",\n \"required\": true,\n \"placeholder\": \"Enter your address\"\n }\n },\n {\n \"id\": \"country-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 750 },\n \"data\": {\n \"label\": \"Country\",\n \"name\": \"country\",\n \"type\": \"select\",\n \"required\": true,\n \"options\": [\n { \"value\": \"us\", \"label\": \"United States\" },\n { \"value\": \"ca\", \"label\": \"Canada\" },\n { \"value\": \"uk\", \"label\": \"United Kingdom\" },\n { \"value\": \"fr\", \"label\": \"France\" },\n { \"value\": \"de\", \"label\": \"Germany\" }\n ]\n }\n },\n {\n \"id\": \"submit-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 1000 },\n \"data\": {\n \"label\": \"Submit\",\n \"type\": \"submit\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"age-1\" },\n { \"id\": \"e2\", \"source\": \"age-1\", \"target\": \"address-1\" },\n { \"id\": \"e3\", \"source\": \"address-1\", \"target\": \"country-1\" },\n { \"id\": \"e4\", \"source\": \"country-1\", \"target\": \"submit-1\" }\n ]\n}\n\nUser: \"Create a form with name, age, and show different questions based on age (movie for 18+, color for under 18)\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"Survey Form\", \"type\": \"title\" }\n },\n {\n \"id\": \"name-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Name\",\n \"name\": \"name\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter your name\"\n }\n },\n {\n \"id\": \"age-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Age\",\n \"name\": \"age\",\n \"type\": \"number\",\n \"required\": true,\n \"placeholder\": \"Enter your age\"\n }\n },\n {\n \"id\": \"movie-1\",\n \"type\": \"input\",\n \"position\": { \"x\": -350, \"y\": 750 },\n \"data\": {\n \"label\": \"Favorite Movie\",\n \"name\": \"favoriteMovie\",\n \"type\": \"text\",\n \"required\": true,\n \"helperText\": \"For adults 18 and over\"\n }\n },\n {\n \"id\": \"color-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 350, \"y\": 750 },\n \"data\": {\n \"label\": \"Favorite Color\",\n \"name\": \"favoriteColor\",\n \"type\": \"text\",\n \"required\": true,\n \"helperText\": \"For those under 18\"\n }\n },\n {\n \"id\": \"submit-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 1000 },\n \"data\": {\n \"label\": \"Submit\",\n \"type\": \"submit\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"name-1\" },\n { \"id\": \"e2\", \"source\": \"name-1\", \"target\": \"age-1\" },\n {\n \"id\": \"e3\",\n \"source\": \"age-1\",\n \"target\": \"movie-1\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If 18 or older\",\n \"conditions\": [\n {\n \"field\": \"age-1\",\n \"operator\": \">=\",\n \"value\": \"18\"\n }\n ]\n }\n },\n {\n \"id\": \"e4\",\n \"source\": \"age-1\",\n \"target\": \"color-1\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If under 18\",\n \"conditions\": [\n {\n \"field\": \"age-1\",\n \"operator\": \"<\",\n \"value\": \"18\"\n }\n ]\n }\n },\n { \"id\": \"e5\", \"source\": \"movie-1\", \"target\": \"submit-1\" },\n { \"id\": \"e6\", \"source\": \"color-1\", \"target\": \"submit-1\" }\n ]\n}\n\nRemember:\n- Always respond with ONLY valid JSON\n- No markdown code blocks\n- No explanations outside the JSON\n- Follow the exact structure shown above\n- For submit buttons, ALWAYS use type \"input\" with data.type \"submit\"\n- For conditional edges, ALWAYS specify the value as a string and use proper operators (>=, <, ===, etc.)\n- Never leave condition values empty - always provide the comparison value\n", pn = {
1084
1095
  claude: "claude-3-5-haiku-20241022",
1085
1096
  deepseek: "deepseek-chat",
1086
1097
  gemini: "gemini-2.5-flash",
1087
1098
  openai: "gpt-4o-mini"
1088
- }, un = .3;
1089
- function dn(e) {
1099
+ }, mn = .3;
1100
+ function hn(e) {
1090
1101
  try {
1091
1102
  return JSON.parse(e);
1092
1103
  } catch (t) {
@@ -1098,10 +1109,10 @@ function dn(e) {
1098
1109
  }
1099
1110
  }
1100
1111
  }
1101
- async function fn(e) {
1102
- let t = e.config.model || ln.gemini, n = e.config.temperature ?? un, r = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/${t}:generateContent?key=${e.config.apiKey}`, {
1112
+ async function gn(e) {
1113
+ let t = e.config.model || pn.gemini, n = e.config.temperature ?? mn, r = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/${t}:generateContent?key=${e.config.apiKey}`, {
1103
1114
  body: JSON.stringify({
1104
- contents: [{ parts: [{ text: `${cn}\n\nUser request: ${e.prompt}` }] }],
1115
+ contents: [{ parts: [{ text: `${fn}\n\nUser request: ${e.prompt}` }] }],
1105
1116
  generationConfig: {
1106
1117
  responseMimeType: "application/json",
1107
1118
  temperature: n
@@ -1116,13 +1127,13 @@ async function fn(e) {
1116
1127
  }
1117
1128
  let i = (await r.json()).candidates?.[0]?.content?.parts?.[0]?.text;
1118
1129
  if (!i) throw Error("No response from Gemini");
1119
- return dn(i);
1130
+ return hn(i);
1120
1131
  }
1121
- async function pn(e) {
1122
- let t = e.config.model || ln.openai, n = e.config.temperature ?? un, r = await fetch("https://api.openai.com/v1/chat/completions", {
1132
+ async function _n(e) {
1133
+ let t = e.config.model || pn.openai, n = e.config.temperature ?? mn, r = await fetch("https://api.openai.com/v1/chat/completions", {
1123
1134
  body: JSON.stringify({
1124
1135
  messages: [{
1125
- content: cn,
1136
+ content: fn,
1126
1137
  role: "system"
1127
1138
  }, {
1128
1139
  content: e.prompt,
@@ -1144,13 +1155,13 @@ async function pn(e) {
1144
1155
  }
1145
1156
  let i = (await r.json()).choices?.[0]?.message?.content;
1146
1157
  if (!i) throw Error("No response from OpenAI");
1147
- return dn(i);
1158
+ return hn(i);
1148
1159
  }
1149
- async function mn(e) {
1150
- let t = e.config.model || ln.deepseek, n = e.config.temperature ?? un, r = await fetch("https://api.deepseek.com/v1/chat/completions", {
1160
+ async function vn(e) {
1161
+ let t = e.config.model || pn.deepseek, n = e.config.temperature ?? mn, r = await fetch("https://api.deepseek.com/v1/chat/completions", {
1151
1162
  body: JSON.stringify({
1152
1163
  messages: [{
1153
- content: cn,
1164
+ content: fn,
1154
1165
  role: "system"
1155
1166
  }, {
1156
1167
  content: e.prompt,
@@ -1172,10 +1183,10 @@ async function mn(e) {
1172
1183
  }
1173
1184
  let i = (await r.json()).choices?.[0]?.message?.content;
1174
1185
  if (!i) throw Error("No response from DeepSeek");
1175
- return dn(i);
1186
+ return hn(i);
1176
1187
  }
1177
- async function hn(e) {
1178
- let t = e.config.model || ln.claude, n = e.config.temperature ?? un, r = await fetch("https://api.anthropic.com/v1/messages", {
1188
+ async function yn(e) {
1189
+ let t = e.config.model || pn.claude, n = e.config.temperature ?? mn, r = await fetch("https://api.anthropic.com/v1/messages", {
1179
1190
  body: JSON.stringify({
1180
1191
  max_tokens: 4096,
1181
1192
  messages: [{
@@ -1183,7 +1194,7 @@ async function hn(e) {
1183
1194
  role: "user"
1184
1195
  }],
1185
1196
  model: t,
1186
- system: cn,
1197
+ system: fn,
1187
1198
  temperature: n
1188
1199
  }),
1189
1200
  headers: {
@@ -1199,20 +1210,20 @@ async function hn(e) {
1199
1210
  }
1200
1211
  let i = (await r.json()).content?.[0]?.text;
1201
1212
  if (!i) throw Error("No response from Claude");
1202
- return dn(i);
1213
+ return hn(i);
1203
1214
  }
1204
- function gn(e) {
1215
+ function bn(e) {
1205
1216
  switch (e.config.provider) {
1206
- case "gemini": return fn(e);
1207
- case "openai": return pn(e);
1208
- case "deepseek": return mn(e);
1209
- case "claude": return hn(e);
1217
+ case "gemini": return gn(e);
1218
+ case "openai": return _n(e);
1219
+ case "deepseek": return vn(e);
1220
+ case "claude": return yn(e);
1210
1221
  default: throw Error(`Unsupported AI provider: ${e.config.provider}`);
1211
1222
  }
1212
1223
  }
1213
1224
  //#endregion
1214
1225
  //#region src/editor/features/TreegeEditor/panel/AIGeneratorDialog.tsx
1215
- var _n = ({ aiConfig: e, onGenerate: t }) => {
1226
+ var xn = ({ aiConfig: e, onGenerate: t }) => {
1216
1227
  let [n, r] = B(!1), [i, a] = B(""), [o, s] = B(!1), c = G(), l = async () => {
1217
1228
  if (!i.trim()) {
1218
1229
  U.error(c("editor.aiGenerator.enterDescription"));
@@ -1224,7 +1235,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
1224
1235
  }
1225
1236
  s(!0);
1226
1237
  try {
1227
- let n = await gn({
1238
+ let n = await bn({
1228
1239
  config: e,
1229
1240
  prompt: i.trim()
1230
1241
  });
@@ -1238,7 +1249,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
1238
1249
  s(!1);
1239
1250
  }
1240
1251
  };
1241
- return /* @__PURE__ */ F(oe, {
1252
+ return /* @__PURE__ */ F(k, {
1242
1253
  open: n,
1243
1254
  onOpenChange: r,
1244
1255
  children: [/* @__PURE__ */ P(S, {
@@ -1248,7 +1259,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
1248
1259
  size: "sm",
1249
1260
  disabled: !e?.apiKey,
1250
1261
  children: [
1251
- /* @__PURE__ */ P(lt, { className: "h-4 w-4 text-[#13d3b4]" }),
1262
+ /* @__PURE__ */ P(dt, { className: "h-4 w-4 text-[#13d3b4]" }),
1252
1263
  " ",
1253
1264
  c("editor.aiGenerator.buttonLabel")
1254
1265
  ]
@@ -1301,7 +1312,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
1301
1312
  })]
1302
1313
  })]
1303
1314
  }),
1304
- /* @__PURE__ */ F(O, { children: [/* @__PURE__ */ P(p, {
1315
+ /* @__PURE__ */ F(D, { children: [/* @__PURE__ */ P(p, {
1305
1316
  variant: "outline",
1306
1317
  onClick: () => r(!1),
1307
1318
  disabled: o,
@@ -1309,20 +1320,20 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
1309
1320
  }), /* @__PURE__ */ P(p, {
1310
1321
  onClick: l,
1311
1322
  disabled: o || !i.trim() || !e?.apiKey,
1312
- children: o ? /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(Je, { className: "h-4 w-4 animate-spin" }), c("editor.aiGenerator.generating")] }) : /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(lt, { className: "h-4 w-4 text-[--treege-color-primary]" }), c("editor.aiGenerator.generate")] })
1323
+ children: o ? /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(Xe, { className: "h-4 w-4 animate-spin" }), c("editor.aiGenerator.generating")] }) : /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(dt, { className: "h-4 w-4 text-[--treege-color-primary]" }), c("editor.aiGenerator.generate")] })
1313
1324
  })] })
1314
1325
  ]
1315
1326
  })]
1316
1327
  });
1317
- }, vn = Wt(), yn = ({ onExportJson: e, onSave: t }) => {
1318
- let { flowId: n, setFlowId: r, aiConfig: i } = W(), { setNodes: a, setEdges: o, addNodes: s, screenToFlowPosition: c } = M(), l = n || vn, u = we(), d = Ce(), f = vt(null), m = G(), h = () => {
1328
+ }, Sn = Jt(), Cn = ({ onExportJson: e, onSave: t }) => {
1329
+ let { flowId: n, setFlowId: r, aiConfig: i } = W(), { setNodes: a, setEdges: o, addNodes: s, screenToFlowPosition: c } = M(), l = n || Sn, u = we(), d = Ce(), f = bt(null), m = G(), h = () => {
1319
1330
  let e = (window.innerWidth || 0) / 2, t = (window.innerHeight || 0) / 2, n = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--node-width"), 10), r = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--node-height"), 10), i = c({
1320
1331
  x: e - n,
1321
1332
  y: t - r
1322
1333
  });
1323
1334
  s([{
1324
- ...Gt,
1325
- id: Wt(),
1335
+ ...Yt,
1336
+ id: Jt(),
1326
1337
  position: i,
1327
1338
  selected: !0
1328
1339
  }]);
@@ -1360,7 +1371,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
1360
1371
  t,
1361
1372
  r
1362
1373
  ]);
1363
- return ht(() => {
1374
+ return _t(() => {
1364
1375
  let e = (e) => {
1365
1376
  (e.ctrlKey || e.metaKey) && e.key === "s" && (e.preventDefault(), _());
1366
1377
  };
@@ -1371,7 +1382,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
1371
1382
  position: "top-right",
1372
1383
  className: "flex gap-2",
1373
1384
  children: [
1374
- /* @__PURE__ */ P(_n, {
1385
+ /* @__PURE__ */ P(xn, {
1375
1386
  aiConfig: i,
1376
1387
  onGenerate: (e) => {
1377
1388
  a(e.nodes), o(e.edges);
@@ -1392,7 +1403,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
1392
1403
  size: "sm",
1393
1404
  onClick: _,
1394
1405
  children: [
1395
- /* @__PURE__ */ P(tt, {}),
1406
+ /* @__PURE__ */ P(rt, {}),
1396
1407
  " ",
1397
1408
  m("common.save")
1398
1409
  ]
@@ -1402,12 +1413,12 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
1402
1413
  children: /* @__PURE__ */ P(p, {
1403
1414
  variant: "outline",
1404
1415
  size: "sm",
1405
- children: /* @__PURE__ */ P(Be, {})
1416
+ children: /* @__PURE__ */ P(He, {})
1406
1417
  })
1407
1418
  }), /* @__PURE__ */ F(X, {
1408
1419
  align: "start",
1409
1420
  children: [
1410
- /* @__PURE__ */ P(Lt, {
1421
+ /* @__PURE__ */ P(Vt, {
1411
1422
  className: "font-normal",
1412
1423
  children: /* @__PURE__ */ F("div", {
1413
1424
  className: "flex flex-col gap-1",
@@ -1424,37 +1435,37 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
1424
1435
  },
1425
1436
  className: "flex items-center gap-2 font-mono text-muted-foreground transition-colors hover:text-primary",
1426
1437
  type: "button",
1427
- children: [/* @__PURE__ */ P(Re, { className: "h-3 w-3" }), /* @__PURE__ */ P("span", {
1438
+ children: [/* @__PURE__ */ P(Be, { className: "h-3 w-3" }), /* @__PURE__ */ P("span", {
1428
1439
  className: "truncate text-xs",
1429
1440
  children: l
1430
1441
  })]
1431
1442
  })]
1432
1443
  })
1433
1444
  }),
1434
- /* @__PURE__ */ P(Rt, {}),
1435
- /* @__PURE__ */ F(It, { children: [/* @__PURE__ */ F(Z, {
1445
+ /* @__PURE__ */ P(Ht, {}),
1446
+ /* @__PURE__ */ F(Bt, { children: [/* @__PURE__ */ F(Z, {
1436
1447
  onClick: () => f?.current?.click(),
1437
1448
  children: [
1438
- /* @__PURE__ */ P(ze, {}),
1449
+ /* @__PURE__ */ P(Ve, {}),
1439
1450
  " ",
1440
1451
  m("editor.actionsPanel.importJson")
1441
1452
  ]
1442
1453
  }), /* @__PURE__ */ F(Z, {
1443
1454
  onClick: g,
1444
1455
  children: [
1445
- /* @__PURE__ */ P(Ee, {}),
1456
+ /* @__PURE__ */ P(Oe, {}),
1446
1457
  " ",
1447
1458
  m("editor.actionsPanel.exportJson")
1448
1459
  ]
1449
1460
  })] }),
1450
- /* @__PURE__ */ P(Rt, {}),
1451
- /* @__PURE__ */ P(It, { children: /* @__PURE__ */ F(Z, {
1461
+ /* @__PURE__ */ P(Ht, {}),
1462
+ /* @__PURE__ */ P(Bt, { children: /* @__PURE__ */ F(Z, {
1452
1463
  onClick: () => {
1453
1464
  a([]), o([]), U.success(m("editor.actionsPanel.clearSuccess"), { description: m("editor.actionsPanel.clearSuccessDesc") });
1454
1465
  },
1455
1466
  className: "text-destructive focus:text-destructive",
1456
1467
  children: [
1457
- /* @__PURE__ */ P(ot, { className: "text-destructive" }),
1468
+ /* @__PURE__ */ P(ct, { className: "text-destructive" }),
1458
1469
  " ",
1459
1470
  m("editor.actionsPanel.clear")
1460
1471
  ]
@@ -1470,7 +1481,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
1470
1481
  })
1471
1482
  ]
1472
1483
  });
1473
- }, bn = {
1484
+ }, wn = {
1474
1485
  ar: "ar",
1475
1486
  de: "de",
1476
1487
  en: "en",
@@ -1484,13 +1495,13 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
1484
1495
  children: [/* @__PURE__ */ P(h, {
1485
1496
  className: "uppercase",
1486
1497
  children: /* @__PURE__ */ P(c, { placeholder: "" })
1487
- }), /* @__PURE__ */ P(A, { children: /* @__PURE__ */ P(j, { children: Object.values(bn).map((e) => /* @__PURE__ */ P(v, {
1498
+ }), /* @__PURE__ */ P(A, { children: /* @__PURE__ */ P(j, { children: Object.values(wn).map((e) => /* @__PURE__ */ P(v, {
1488
1499
  value: e,
1489
1500
  className: "uppercase",
1490
1501
  children: e
1491
1502
  }, e)) }) })]
1492
1503
  }), $ = () => {
1493
- let e = we(), t = _t(() => e.filter(i), [e]), n = _t(() => e.filter((e) => e.selected), [e]), r = _t(() => e.find((e) => e.selected), [e]);
1504
+ let e = we(), t = yt(() => e.filter(i), [e]), n = yt(() => e.filter((e) => e.selected), [e]), r = yt(() => e.find((e) => e.selected), [e]);
1494
1505
  return {
1495
1506
  groupNodes: t,
1496
1507
  hasSelectedNodes: n.length > 0,
@@ -1498,7 +1509,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
1498
1509
  selectedNode: r,
1499
1510
  selectedNodes: n
1500
1511
  };
1501
- }, xn = () => {
1512
+ }, Tn = () => {
1502
1513
  let [e, t] = B("en"), { updateSelectedNodeData: n } = q(), { selectedNode: r } = $(), i = G(), { Field: a } = I({
1503
1514
  defaultValues: {
1504
1515
  label: r?.data?.label || { en: "" },
@@ -1565,7 +1576,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
1565
1576
  })]
1566
1577
  })
1567
1578
  });
1568
- }, Sn = () => {
1579
+ }, En = () => {
1569
1580
  let [e, t] = B("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = q(), { Field: i } = I({
1570
1581
  defaultValues: { label: n?.data?.label || { en: "" } },
1571
1582
  listeners: {
@@ -1610,12 +1621,12 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
1610
1621
  })]
1611
1622
  })
1612
1623
  });
1613
- }, Cn = [
1624
+ }, Dn = [
1614
1625
  "POST",
1615
1626
  "PUT",
1616
1627
  "PATCH"
1617
- ], wn = ({ value: e, onChange: t }) => {
1618
- let { selectedNode: n } = $(), r = G(), i = Ot(n?.id), { handleSubmit: a, Field: o, Subscribe: s } = I({
1628
+ ], On = ({ value: e, onChange: t }) => {
1629
+ let { selectedNode: n } = $(), r = G(), i = jt(n?.id), { handleSubmit: a, Field: o, Subscribe: s } = I({
1619
1630
  defaultValues: {
1620
1631
  body: e?.body || "",
1621
1632
  fetchOnMount: e?.fetchOnMount ?? !e?.searchParam,
@@ -1667,7 +1678,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
1667
1678
  type: "button",
1668
1679
  variant: "outline",
1669
1680
  size: "icon",
1670
- children: /* @__PURE__ */ P(ct, { className: "h-4 w-4" })
1681
+ children: /* @__PURE__ */ P(ut, { className: "h-4 w-4" })
1671
1682
  })
1672
1683
  }), /* @__PURE__ */ P(X, {
1673
1684
  align: "end",
@@ -1792,7 +1803,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
1792
1803
  method: e.values.method,
1793
1804
  sendAllFormValues: e.values.sendAllFormValues
1794
1805
  }),
1795
- children: ({ method: e, sendAllFormValues: t }) => Cn.includes(e || "") && /* @__PURE__ */ F("div", {
1806
+ children: ({ method: e, sendAllFormValues: t }) => Dn.includes(e || "") && /* @__PURE__ */ F("div", {
1796
1807
  className: "space-y-4",
1797
1808
  children: [/* @__PURE__ */ P(o, {
1798
1809
  name: "sendAllFormValues",
@@ -1822,7 +1833,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
1822
1833
  variant: "ghost",
1823
1834
  size: "sm",
1824
1835
  disabled: t,
1825
- children: [/* @__PURE__ */ P(ct, { className: "mr-2 h-4 w-4" }), r("editor.httpConfigForm.insertVariable")]
1836
+ children: [/* @__PURE__ */ P(ut, { className: "mr-2 h-4 w-4" }), r("editor.httpConfigForm.insertVariable")]
1826
1837
  })
1827
1838
  }), /* @__PURE__ */ P(X, {
1828
1839
  align: "end",
@@ -1999,12 +2010,12 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
1999
2010
  })
2000
2011
  ]
2001
2012
  }) });
2002
- }, Tn = [
2013
+ }, kn = [
2003
2014
  "POST",
2004
2015
  "PUT",
2005
2016
  "PATCH"
2006
- ], En = ({ value: e, onChange: t }) => {
2007
- let [n, r] = B("en"), { selectedNode: i } = $(), a = G(), o = Ot(i?.id), { handleSubmit: s, Field: u, Subscribe: d } = I({
2017
+ ], An = ({ value: e, onChange: t }) => {
2018
+ let [n, r] = B("en"), { selectedNode: i } = $(), a = G(), o = jt(i?.id), { handleSubmit: s, Field: u, Subscribe: d } = I({
2008
2019
  defaultValues: {
2009
2020
  body: e?.body || "",
2010
2021
  errorMessage: e?.errorMessage || { en: "" },
@@ -2052,7 +2063,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
2052
2063
  type: "button",
2053
2064
  variant: "outline",
2054
2065
  size: "icon",
2055
- children: /* @__PURE__ */ P(ct, { className: "h-4 w-4" })
2066
+ children: /* @__PURE__ */ P(ut, { className: "h-4 w-4" })
2056
2067
  })
2057
2068
  }), /* @__PURE__ */ P(X, {
2058
2069
  align: "end",
@@ -2173,7 +2184,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
2173
2184
  method: e.values.method,
2174
2185
  sendAllFormValues: e.values.sendAllFormValues
2175
2186
  }),
2176
- children: ({ method: e, sendAllFormValues: t }) => Tn.includes(e || "") && /* @__PURE__ */ F("div", {
2187
+ children: ({ method: e, sendAllFormValues: t }) => kn.includes(e || "") && /* @__PURE__ */ F("div", {
2177
2188
  className: "space-y-4",
2178
2189
  children: [/* @__PURE__ */ P(u, {
2179
2190
  name: "sendAllFormValues",
@@ -2203,7 +2214,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
2203
2214
  variant: "ghost",
2204
2215
  size: "sm",
2205
2216
  disabled: t,
2206
- children: [/* @__PURE__ */ P(ct, { className: "mr-2 h-4 w-4" }), a("editor.submitConfigForm.insertVariable")]
2217
+ children: [/* @__PURE__ */ P(ut, { className: "mr-2 h-4 w-4" }), a("editor.submitConfigForm.insertVariable")]
2207
2218
  })
2208
2219
  }), /* @__PURE__ */ P(X, {
2209
2220
  align: "end",
@@ -2356,7 +2367,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
2356
2367
  })
2357
2368
  ]
2358
2369
  }) });
2359
- }, Dn = ({ options: e, id: t, value: n, onValueChange: r, placeholder: i = "Select...", searchPlaceholder: a = "Search or create...", createLabel: o = (e) => `Use: ${e}`, clearLabel: s = "Clear selection", emptyLabel: c = "No results found", className: l, allowClear: f = !0, allowCreate: m = !0 }) => {
2370
+ }, jn = ({ options: e, id: t, value: n, onValueChange: r, placeholder: i = "Select...", searchPlaceholder: a = "Search or create...", createLabel: o = (e) => `Use: ${e}`, clearLabel: s = "Clear selection", emptyLabel: c = "No results found", className: l, allowClear: f = !0, allowCreate: m = !0 }) => {
2360
2371
  let [h, g] = B(!1), [v, y] = B(""), b = (e) => e ?? "", x = (e) => e.trim().toLowerCase(), S = b(n), C = n !== null && n !== "", w = C ? e.find((e) => b(e.value) === S) : void 0, T = x(v), ne = m && T !== "" && !e.some((e) => x(e.label) === T || x(e.value ?? "") === T), re = (e) => {
2361
2372
  e === S ? f && r?.("") : r?.(e), g(!1), y("");
2362
2373
  };
@@ -2375,20 +2386,20 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
2375
2386
  children: [/* @__PURE__ */ P("span", {
2376
2387
  className: "truncate",
2377
2388
  children: C && w ? w.label : i
2378
- }), /* @__PURE__ */ P(Pe, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })]
2389
+ }), /* @__PURE__ */ P(Ie, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })]
2379
2390
  })
2380
2391
  }), /* @__PURE__ */ P(ee, {
2381
2392
  className: "w-full p-0",
2382
2393
  align: "start",
2383
- children: /* @__PURE__ */ F(E, {
2394
+ children: /* @__PURE__ */ F(ie, {
2384
2395
  shouldFilter: !1,
2385
2396
  children: [/* @__PURE__ */ P(_, {
2386
2397
  placeholder: a,
2387
2398
  value: v,
2388
2399
  onValueChange: y
2389
2400
  }), /* @__PURE__ */ F(ae, { children: [
2390
- /* @__PURE__ */ P(ie, { children: c }),
2391
- f && C && /* @__PURE__ */ P(te, { children: /* @__PURE__ */ F(D, {
2401
+ /* @__PURE__ */ P(O, { children: c }),
2402
+ f && C && /* @__PURE__ */ P(te, { children: /* @__PURE__ */ F(E, {
2392
2403
  value: "__clear__",
2393
2404
  onSelect: () => {
2394
2405
  r?.(""), g(!1), y("");
@@ -2396,7 +2407,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
2396
2407
  className: "mt-1 text-muted-foreground",
2397
2408
  children: [/* @__PURE__ */ P(R, { className: "mr-2 h-4 w-4" }), s]
2398
2409
  }) }),
2399
- /* @__PURE__ */ F(te, { children: [ne && /* @__PURE__ */ F(D, {
2410
+ /* @__PURE__ */ F(te, { children: [ne && /* @__PURE__ */ F(E, {
2400
2411
  value: `__create__${v}`,
2401
2412
  onSelect: () => {
2402
2413
  v.trim() && (r?.(v.trim()), g(!1), y(""));
@@ -2406,10 +2417,10 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
2406
2417
  }), e.filter((e) => {
2407
2418
  let t = v.toLowerCase();
2408
2419
  return e.label.toLowerCase().includes(t) || (e.value?.toLowerCase() ?? "").includes(t);
2409
- }).map((e, t) => /* @__PURE__ */ F(D, {
2420
+ }).map((e, t) => /* @__PURE__ */ F(E, {
2410
2421
  value: e.label,
2411
2422
  onSelect: () => re(e?.value || ""),
2412
- children: [/* @__PURE__ */ P(je, {
2423
+ children: [/* @__PURE__ */ P(Ne, {
2413
2424
  "aria-hidden": "true",
2414
2425
  className: d("mr-2 h-4 w-4", C && b(e.value) === S ? "opacity-100" : "opacity-0")
2415
2426
  }), e.label]
@@ -2418,7 +2429,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
2418
2429
  })
2419
2430
  })]
2420
2431
  });
2421
- }, On = Object.entries({
2432
+ }, Mn = Object.entries({
2422
2433
  alphanumeric: "^[a-zA-Z0-9]+$",
2423
2434
  email: "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",
2424
2435
  letters: "^[a-zA-Z]+$",
@@ -2427,49 +2438,49 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
2427
2438
  }).map(([e, t]) => ({
2428
2439
  label: e.charAt(0).toUpperCase() + e.slice(1).replace(/_/g, " "),
2429
2440
  value: t
2430
- })), kn = ({ id: e, value: t, onValueChange: n }) => /* @__PURE__ */ P(Dn, {
2441
+ })), Nn = ({ id: e, value: t, onValueChange: n }) => /* @__PURE__ */ P(jn, {
2431
2442
  id: e,
2432
- options: _t(() => t && !On.some((e) => e.value === t) ? [...On, {
2443
+ options: yt(() => t && !Mn.some((e) => e.value === t) ? [...Mn, {
2433
2444
  label: `Custom: ${t}`,
2434
2445
  value: t
2435
- }] : On, [t]),
2446
+ }] : Mn, [t]),
2436
2447
  value: t,
2437
2448
  onValueChange: n,
2438
2449
  placeholder: "Select or create a pattern",
2439
2450
  searchPlaceholder: "Search patterns...",
2440
2451
  createLabel: (e) => `Use pattern: ${e}`
2441
- }), An = 400, jn = .8, Mn = (e) => new Promise((t, n) => {
2452
+ }), Pn = 400, Fn = .8, In = (e) => new Promise((t, n) => {
2442
2453
  let r = new FileReader();
2443
2454
  r.onerror = () => n(/* @__PURE__ */ Error("read_failed")), r.onload = () => {
2444
2455
  let e = new Image();
2445
2456
  e.onload = () => t(e), e.onerror = () => n(/* @__PURE__ */ Error("decode_failed")), e.src = r.result;
2446
2457
  }, r.readAsDataURL(e);
2447
- }), Nn = async (e) => {
2458
+ }), Ln = async (e) => {
2448
2459
  if (!e.type.startsWith("image/")) throw Error("invalid_type");
2449
2460
  if (e.size > 5242880) throw Error("too_large");
2450
- let t = await Mn(e), n = Math.min(1, An / Math.max(t.width, t.height)), r = document.createElement("canvas");
2461
+ let t = await In(e), n = Math.min(1, Pn / Math.max(t.width, t.height)), r = document.createElement("canvas");
2451
2462
  r.width = Math.round(t.width * n), r.height = Math.round(t.height * n);
2452
2463
  let i = r.getContext("2d");
2453
2464
  if (!i) throw Error("canvas_unavailable");
2454
- return i.drawImage(t, 0, 0, r.width, r.height), r.toDataURL("image/jpeg", jn);
2455
- }, Pn = 400, Fn = (e) => {
2465
+ return i.drawImage(t, 0, 0, r.width, r.height), r.toDataURL("image/jpeg", Fn);
2466
+ }, Rn = 400, zn = (e) => {
2456
2467
  if (!/^https?:\/\//i.test(e)) return !1;
2457
2468
  try {
2458
2469
  return !!new URL(e).hostname;
2459
2470
  } catch {
2460
2471
  return !1;
2461
2472
  }
2462
- }, In = ({ value: e, onChange: t }) => {
2463
- let n = vt(null), r = vt(null), [i, a] = B(!1), [o, s] = B(e && /^https?:\/\//i.test(e) ? e : ""), c = G();
2464
- ht(() => {
2473
+ }, Bn = ({ value: e, onChange: t }) => {
2474
+ let n = bt(null), r = bt(null), [i, a] = B(!1), [o, s] = B(e && /^https?:\/\//i.test(e) ? e : ""), c = G();
2475
+ _t(() => {
2465
2476
  i || s(e && /^https?:\/\//i.test(e) ? e : "");
2466
- }, [i, e]), ht(() => () => {
2477
+ }, [i, e]), _t(() => () => {
2467
2478
  r.current && clearTimeout(r.current);
2468
2479
  }, []);
2469
2480
  let l = async (e) => {
2470
2481
  let r = e.target.files?.[0];
2471
2482
  if (r) try {
2472
- t(await Nn(r)), a(!1);
2483
+ t(await Ln(r)), a(!1);
2473
2484
  } catch (e) {
2474
2485
  let t = e.message;
2475
2486
  t === "too_large" ? U.error(c("editor.inputNodeForm.optionImageTooLarge")) : t === "invalid_type" ? U.error(c("editor.inputNodeForm.optionImageInvalid")) : U.error(c("editor.inputNodeForm.optionImageError"));
@@ -2509,7 +2520,7 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
2509
2520
  variant: "outline",
2510
2521
  size: "icon",
2511
2522
  "aria-label": c("editor.inputNodeForm.optionImageAdd"),
2512
- children: /* @__PURE__ */ P(We, { className: "h-4 w-4" })
2523
+ children: /* @__PURE__ */ P(Ke, { className: "h-4 w-4" })
2513
2524
  })
2514
2525
  }), /* @__PURE__ */ F(ee, {
2515
2526
  align: "start",
@@ -2521,21 +2532,21 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
2521
2532
  size: "sm",
2522
2533
  className: "w-full",
2523
2534
  onClick: () => n.current?.click(),
2524
- children: [/* @__PURE__ */ P(st, { className: "mr-2 h-4 w-4" }), c("editor.inputNodeForm.optionImageUpload")]
2535
+ children: [/* @__PURE__ */ P(lt, { className: "mr-2 h-4 w-4" }), c("editor.inputNodeForm.optionImageUpload")]
2525
2536
  }),
2526
- /* @__PURE__ */ P(k, {}),
2537
+ /* @__PURE__ */ P(oe, {}),
2527
2538
  /* @__PURE__ */ F("div", {
2528
2539
  className: "flex items-center gap-2",
2529
- children: [/* @__PURE__ */ P(Ke, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), /* @__PURE__ */ P(m, {
2540
+ children: [/* @__PURE__ */ P(Je, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), /* @__PURE__ */ P(m, {
2530
2541
  placeholder: c("editor.inputNodeForm.optionImageUrlPlaceholder"),
2531
2542
  value: o,
2532
2543
  onChange: (n) => {
2533
2544
  let i = n.target.value;
2534
2545
  s(i), r.current && clearTimeout(r.current);
2535
2546
  let a = i.trim();
2536
- !Fn(a) || a === e || (r.current = setTimeout(() => {
2547
+ !zn(a) || a === e || (r.current = setTimeout(() => {
2537
2548
  t(a);
2538
- }, Pn));
2549
+ }, Rn));
2539
2550
  },
2540
2551
  onKeyDown: (e) => {
2541
2552
  e.key === "Enter" && (e.preventDefault(), d());
@@ -2557,8 +2568,8 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
2557
2568
  })
2558
2569
  ]
2559
2570
  });
2560
- }, Ln = ({ value: e, onValueChange: t }) => {
2561
- let n = G(), r = gt();
2571
+ }, Vn = ({ value: e, onValueChange: t }) => {
2572
+ let n = G(), r = vt();
2562
2573
  return /* @__PURE__ */ F(j, { children: [/* @__PURE__ */ P(ce, {
2563
2574
  htmlFor: r,
2564
2575
  children: n("editor.selectInputType.type")
@@ -2572,39 +2583,39 @@ var _n = ({ aiConfig: e, onGenerate: t }) => {
2572
2583
  }), /* @__PURE__ */ P(A, { children: /* @__PURE__ */ P(j, { children: Object.values(K).map((e) => /* @__PURE__ */ F(v, {
2573
2584
  value: e,
2574
2585
  className: "capitalize",
2575
- children: [/* @__PURE__ */ P(Zt(e), {}), e]
2586
+ children: [/* @__PURE__ */ P(tn(e), {}), e]
2576
2587
  }, e)) }) })]
2577
2588
  })] });
2578
2589
  };
2579
2590
  //#endregion
2580
2591
  //#region src/shared/components/ui/collapsible.tsx
2581
- function Rn({ ...e }) {
2582
- return /* @__PURE__ */ P(Ct.Root, {
2592
+ function Hn({ ...e }) {
2593
+ return /* @__PURE__ */ P(Tt.Root, {
2583
2594
  "data-slot": "collapsible",
2584
2595
  ...e
2585
2596
  });
2586
2597
  }
2587
- function zn({ ...e }) {
2588
- return /* @__PURE__ */ P(Ct.CollapsibleTrigger, {
2598
+ function Un({ ...e }) {
2599
+ return /* @__PURE__ */ P(Tt.CollapsibleTrigger, {
2589
2600
  "data-slot": "collapsible-trigger",
2590
2601
  ...e
2591
2602
  });
2592
2603
  }
2593
- function Bn({ ...e }) {
2594
- return /* @__PURE__ */ P(Ct.CollapsibleContent, {
2604
+ function Wn({ ...e }) {
2605
+ return /* @__PURE__ */ P(Tt.CollapsibleContent, {
2595
2606
  "data-slot": "collapsible-content",
2596
2607
  ...e
2597
2608
  });
2598
2609
  }
2599
2610
  //#endregion
2600
2611
  //#region src/editor/features/TreegeEditor/forms/InputNodeForm.tsx
2601
- var Vn = () => {
2612
+ var Gn = () => {
2602
2613
  let [e, t] = B("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = q(), i = [
2603
2614
  "select",
2604
2615
  "radio",
2605
2616
  "autocomplete",
2606
2617
  "checkbox"
2607
- ].includes(n?.data?.type || ""), a = Ot(n?.id), o = G(), s = n?.data?.type === "submit", { handleSubmit: u, Field: d } = I({
2618
+ ].includes(n?.data?.type || ""), a = jt(n?.id), o = G(), s = n?.data?.type === "submit", { handleSubmit: u, Field: d } = I({
2608
2619
  defaultValues: {
2609
2620
  defaultValue: n?.data?.defaultValue,
2610
2621
  disablePast: n?.data?.disablePast,
@@ -2641,7 +2652,7 @@ var Vn = () => {
2641
2652
  children: [
2642
2653
  /* @__PURE__ */ P(d, {
2643
2654
  name: "type",
2644
- children: (e) => /* @__PURE__ */ P(w, { children: /* @__PURE__ */ P(Ln, {
2655
+ children: (e) => /* @__PURE__ */ P(w, { children: /* @__PURE__ */ P(Vn, {
2645
2656
  value: e.state.value,
2646
2657
  onValueChange: (t) => e.handleChange(t)
2647
2658
  }) })
@@ -2728,10 +2739,10 @@ var Vn = () => {
2728
2739
  onValueChange: t
2729
2740
  })]
2730
2741
  }),
2731
- n?.data?.type === "http" && /* @__PURE__ */ F(Rn, {
2742
+ n?.data?.type === "http" && /* @__PURE__ */ F(Hn, {
2732
2743
  defaultOpen: !0,
2733
2744
  className: "flex w-full max-w-[350px] flex-col gap-2",
2734
- children: [/* @__PURE__ */ P(zn, {
2745
+ children: [/* @__PURE__ */ P(Un, {
2735
2746
  asChild: !0,
2736
2747
  children: /* @__PURE__ */ F("div", {
2737
2748
  className: "flex items-center justify-between gap-4",
@@ -2742,17 +2753,17 @@ var Vn = () => {
2742
2753
  variant: "ghost",
2743
2754
  size: "icon",
2744
2755
  className: "size-8",
2745
- children: [/* @__PURE__ */ P(Pe, {}), /* @__PURE__ */ P("span", {
2756
+ children: [/* @__PURE__ */ P(Ie, {}), /* @__PURE__ */ P("span", {
2746
2757
  className: "sr-only",
2747
2758
  children: o("common.toggle")
2748
2759
  })]
2749
2760
  })]
2750
2761
  })
2751
- }), /* @__PURE__ */ P(Bn, {
2762
+ }), /* @__PURE__ */ P(Wn, {
2752
2763
  className: "flex flex-col gap-4",
2753
2764
  children: /* @__PURE__ */ P(d, {
2754
2765
  name: "httpConfig",
2755
- children: (e) => /* @__PURE__ */ P(wn, {
2766
+ children: (e) => /* @__PURE__ */ P(On, {
2756
2767
  value: e.state.value,
2757
2768
  onChange: (t) => {
2758
2769
  e.handleChange(t), u().then();
@@ -2761,9 +2772,9 @@ var Vn = () => {
2761
2772
  })
2762
2773
  })]
2763
2774
  }),
2764
- s && /* @__PURE__ */ F(Rn, {
2775
+ s && /* @__PURE__ */ F(Hn, {
2765
2776
  className: "flex w-full max-w-[350px] flex-col gap-2",
2766
- children: [/* @__PURE__ */ P(zn, {
2777
+ children: [/* @__PURE__ */ P(Un, {
2767
2778
  asChild: !0,
2768
2779
  children: /* @__PURE__ */ F("div", {
2769
2780
  className: "flex items-center justify-between gap-4",
@@ -2774,17 +2785,17 @@ var Vn = () => {
2774
2785
  variant: "ghost",
2775
2786
  size: "icon",
2776
2787
  className: "size-8",
2777
- children: [/* @__PURE__ */ P(Pe, {}), /* @__PURE__ */ P("span", {
2788
+ children: [/* @__PURE__ */ P(Ie, {}), /* @__PURE__ */ P("span", {
2778
2789
  className: "sr-only",
2779
2790
  children: o("common.toggle")
2780
2791
  })]
2781
2792
  })]
2782
2793
  })
2783
- }), /* @__PURE__ */ P(Bn, {
2794
+ }), /* @__PURE__ */ P(Wn, {
2784
2795
  className: "flex flex-col gap-4",
2785
2796
  children: /* @__PURE__ */ P(d, {
2786
2797
  name: "submitConfig",
2787
- children: (e) => /* @__PURE__ */ P(En, {
2798
+ children: (e) => /* @__PURE__ */ P(An, {
2788
2799
  value: e.state.value,
2789
2800
  onChange: (t) => {
2790
2801
  e.handleChange(t), u().then();
@@ -2807,10 +2818,10 @@ var Vn = () => {
2807
2818
  })]
2808
2819
  })
2809
2820
  }),
2810
- i && /* @__PURE__ */ F(Rn, {
2821
+ i && /* @__PURE__ */ F(Hn, {
2811
2822
  defaultOpen: !0,
2812
2823
  className: "flex w-full max-w-[350px] flex-col gap-2",
2813
- children: [/* @__PURE__ */ P(zn, {
2824
+ children: [/* @__PURE__ */ P(Un, {
2814
2825
  asChild: !0,
2815
2826
  children: /* @__PURE__ */ F("div", {
2816
2827
  className: "flex items-center justify-between gap-4",
@@ -2821,13 +2832,13 @@ var Vn = () => {
2821
2832
  variant: "ghost",
2822
2833
  size: "icon",
2823
2834
  className: "size-8",
2824
- children: [/* @__PURE__ */ P(Pe, {}), /* @__PURE__ */ P("span", {
2835
+ children: [/* @__PURE__ */ P(Ie, {}), /* @__PURE__ */ P("span", {
2825
2836
  className: "sr-only",
2826
2837
  children: o("common.toggle")
2827
2838
  })]
2828
2839
  })]
2829
2840
  })
2830
- }), /* @__PURE__ */ F(Bn, {
2841
+ }), /* @__PURE__ */ F(Wn, {
2831
2842
  className: "flex flex-col gap-4",
2832
2843
  children: [
2833
2844
  /* @__PURE__ */ P(d, {
@@ -2844,7 +2855,7 @@ var Vn = () => {
2844
2855
  children: [
2845
2856
  n?.data?.type === "radio" && /* @__PURE__ */ P(d, {
2846
2857
  name: `options[${i}].image`,
2847
- children: (e) => /* @__PURE__ */ P(In, {
2858
+ children: (e) => /* @__PURE__ */ P(Bn, {
2848
2859
  value: e.state.value,
2849
2860
  onChange: (t) => e.handleChange(t)
2850
2861
  })
@@ -2946,9 +2957,9 @@ var Vn = () => {
2946
2957
  ]
2947
2958
  })]
2948
2959
  }),
2949
- !s && /* @__PURE__ */ F(Rn, {
2960
+ !s && /* @__PURE__ */ F(Hn, {
2950
2961
  className: "flex w-full max-w-[350px] flex-col gap-2",
2951
- children: [/* @__PURE__ */ P(zn, {
2962
+ children: [/* @__PURE__ */ P(Un, {
2952
2963
  asChild: !0,
2953
2964
  children: /* @__PURE__ */ F("div", {
2954
2965
  className: "flex items-center justify-between gap-4",
@@ -2959,13 +2970,13 @@ var Vn = () => {
2959
2970
  variant: "ghost",
2960
2971
  size: "icon",
2961
2972
  className: "size-8",
2962
- children: [/* @__PURE__ */ P(Pe, {}), /* @__PURE__ */ P("span", {
2973
+ children: [/* @__PURE__ */ P(Ie, {}), /* @__PURE__ */ P("span", {
2963
2974
  className: "sr-only",
2964
2975
  children: o("common.toggle")
2965
2976
  })]
2966
2977
  })]
2967
2978
  })
2968
- }), /* @__PURE__ */ F(Bn, {
2979
+ }), /* @__PURE__ */ F(Wn, {
2969
2980
  className: "flex flex-col gap-6",
2970
2981
  children: [
2971
2982
  /* @__PURE__ */ P(d, {
@@ -3001,7 +3012,7 @@ var Vn = () => {
3001
3012
  children: (e) => /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
3002
3013
  htmlFor: e.name,
3003
3014
  children: o("editor.inputNodeForm.pattern")
3004
- }), /* @__PURE__ */ P(kn, {
3015
+ }), /* @__PURE__ */ P(Nn, {
3005
3016
  id: e.name,
3006
3017
  value: e.state.value,
3007
3018
  onValueChange: e.handleChange
@@ -3037,9 +3048,9 @@ var Vn = () => {
3037
3048
  ]
3038
3049
  })]
3039
3050
  }),
3040
- !s && /* @__PURE__ */ F(Rn, {
3051
+ !s && /* @__PURE__ */ F(Hn, {
3041
3052
  className: "flex w-full max-w-[350px] flex-col gap-2",
3042
- children: [/* @__PURE__ */ P(zn, {
3053
+ children: [/* @__PURE__ */ P(Un, {
3043
3054
  asChild: !0,
3044
3055
  children: /* @__PURE__ */ F("div", {
3045
3056
  className: "flex items-center justify-between gap-4",
@@ -3050,13 +3061,13 @@ var Vn = () => {
3050
3061
  variant: "ghost",
3051
3062
  size: "icon",
3052
3063
  className: "size-8",
3053
- children: [/* @__PURE__ */ P(Pe, {}), /* @__PURE__ */ P("span", {
3064
+ children: [/* @__PURE__ */ P(Ie, {}), /* @__PURE__ */ P("span", {
3054
3065
  className: "sr-only",
3055
3066
  children: o("common.toggle")
3056
3067
  })]
3057
3068
  })]
3058
3069
  })
3059
- }), /* @__PURE__ */ F(Bn, {
3070
+ }), /* @__PURE__ */ F(Wn, {
3060
3071
  className: "flex flex-col gap-6",
3061
3072
  children: [/* @__PURE__ */ P(d, {
3062
3073
  name: "name",
@@ -3289,7 +3300,7 @@ var Vn = () => {
3289
3300
  ]
3290
3301
  })
3291
3302
  });
3292
- }, Hn = () => {
3303
+ }, Kn = () => {
3293
3304
  let [e, t] = B("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = q(), { Field: i } = I({
3294
3305
  defaultValues: {
3295
3306
  label: n?.data?.label || { en: "" },
@@ -3350,18 +3361,18 @@ var Vn = () => {
3350
3361
  className: "w-full",
3351
3362
  children: /* @__PURE__ */ P(c, { placeholder: "" })
3352
3363
  }), /* @__PURE__ */ P(A, { children: /* @__PURE__ */ F(j, { children: [/* @__PURE__ */ P(v, {
3353
- value: qt.title,
3364
+ value: Zt.title,
3354
3365
  children: "Title"
3355
3366
  }), /* @__PURE__ */ P(v, {
3356
- value: qt.divider,
3367
+ value: Zt.divider,
3357
3368
  children: "Divider"
3358
3369
  })] }) })]
3359
3370
  })] })
3360
3371
  })]
3361
3372
  })
3362
3373
  });
3363
- }, Un = () => {
3364
- let [e, t] = B(""), [n, r] = B(!1), { selectedNode: a, groupNodes: o } = $(), { setNodes: s } = M(), d = a?.parentId || "none", f = i(a), _ = G(), y = gt(), b = gt();
3374
+ }, qn = () => {
3375
+ let [e, t] = B(""), [n, r] = B(!1), { selectedNode: a, groupNodes: o } = $(), { setNodes: s } = M(), d = a?.parentId || "none", f = i(a), _ = G(), y = vt(), b = vt();
3365
3376
  if (f) return null;
3366
3377
  let x = (e) => {
3367
3378
  a && s((t) => e === "none" ? t.map((e) => {
@@ -3388,7 +3399,7 @@ var Vn = () => {
3388
3399
  U.error("This group already exists", { description: "Use the selector to add the node to an existing group." });
3389
3400
  return;
3390
3401
  }
3391
- let n = Wt();
3402
+ let n = Jt();
3392
3403
  s((t) => [{
3393
3404
  data: { label: { en: e.trim() } },
3394
3405
  id: n,
@@ -3441,7 +3452,7 @@ var Vn = () => {
3441
3452
  variant: "outline",
3442
3453
  size: "icon",
3443
3454
  title: "Create a new group",
3444
- children: /* @__PURE__ */ P($e, { className: "h-4 w-4" })
3455
+ children: /* @__PURE__ */ P(tt, { className: "h-4 w-4" })
3445
3456
  })
3446
3457
  }), /* @__PURE__ */ P(ee, {
3447
3458
  className: "w-80",
@@ -3496,8 +3507,8 @@ var Vn = () => {
3496
3507
  })]
3497
3508
  })]
3498
3509
  });
3499
- }, Wn = () => {
3500
- let { selectedNode: e } = $(), { updateSelectedNodeType: t } = q(), n = e?.type || "", r = i(e), a = G(), o = gt();
3510
+ }, Jn = () => {
3511
+ let { selectedNode: e } = $(), { updateSelectedNodeType: t } = q(), n = e?.type || "", r = i(e), a = G(), o = vt();
3501
3512
  return /* @__PURE__ */ F(j, { children: [/* @__PURE__ */ P(ce, {
3502
3513
  htmlFor: o,
3503
3514
  children: a("editor.selectNodeType.nodeType")
@@ -3509,7 +3520,7 @@ var Vn = () => {
3509
3520
  className: "w-full",
3510
3521
  id: o,
3511
3522
  children: /* @__PURE__ */ P(c, { placeholder: a("editor.selectNodeType.nodeType") })
3512
- }), /* @__PURE__ */ P(A, { children: /* @__PURE__ */ P(j, { children: Object.keys(on).filter((e) => r ? e === "group" : e !== "group").map((e) => /* @__PURE__ */ P(v, {
3523
+ }), /* @__PURE__ */ P(A, { children: /* @__PURE__ */ P(j, { children: Object.keys(un).filter((e) => r ? e === "group" : e !== "group").map((e) => /* @__PURE__ */ P(v, {
3513
3524
  value: e,
3514
3525
  children: a(`editor.selectNodeType.options.${e}`)
3515
3526
  }, e)) }) })]
@@ -3517,61 +3528,61 @@ var Vn = () => {
3517
3528
  };
3518
3529
  //#endregion
3519
3530
  //#region src/shared/components/ui/sheet.tsx
3520
- function Gn({ ...e }) {
3531
+ function Yn({ ...e }) {
3521
3532
  return /* @__PURE__ */ P(H.Root, {
3522
3533
  "data-slot": "sheet",
3523
3534
  ...e
3524
3535
  });
3525
3536
  }
3526
- function Kn({ ...e }) {
3537
+ function Xn({ ...e }) {
3527
3538
  return /* @__PURE__ */ P(H.Portal, {
3528
3539
  "data-slot": "sheet-portal",
3529
3540
  ...e
3530
3541
  });
3531
3542
  }
3532
- function qn({ className: e, ...t }) {
3543
+ function Zn({ className: e, ...t }) {
3533
3544
  return /* @__PURE__ */ P(H.Overlay, {
3534
3545
  "data-slot": "sheet-overlay",
3535
3546
  className: d("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", e),
3536
3547
  ...t
3537
3548
  });
3538
3549
  }
3539
- function Jn({ className: e, children: t, side: n = "right", ...r }) {
3540
- return /* @__PURE__ */ F(Kn, { children: [/* @__PURE__ */ P(qn, {}), /* @__PURE__ */ F(H.Content, {
3550
+ function Qn({ className: e, children: t, side: n = "right", ...r }) {
3551
+ return /* @__PURE__ */ F(Xn, { children: [/* @__PURE__ */ P(Zn, {}), /* @__PURE__ */ F(H.Content, {
3541
3552
  "data-slot": "sheet-content",
3542
3553
  className: d("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", n === "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", n === "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", n === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b", n === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t", e),
3543
3554
  ...r,
3544
3555
  children: [t, /* @__PURE__ */ F(H.Close, {
3545
3556
  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",
3546
- children: [/* @__PURE__ */ P(dt, { className: "size-4" }), /* @__PURE__ */ P("span", {
3557
+ children: [/* @__PURE__ */ P(pt, { className: "size-4" }), /* @__PURE__ */ P("span", {
3547
3558
  className: "sr-only",
3548
3559
  children: "Close"
3549
3560
  })]
3550
3561
  })]
3551
3562
  })] });
3552
3563
  }
3553
- function Yn({ className: e, ...t }) {
3564
+ function $n({ className: e, ...t }) {
3554
3565
  return /* @__PURE__ */ P("div", {
3555
3566
  "data-slot": "sheet-header",
3556
3567
  className: d("flex flex-col gap-1.5 p-4", e),
3557
3568
  ...t
3558
3569
  });
3559
3570
  }
3560
- function Xn({ className: e, ...t }) {
3571
+ function er({ className: e, ...t }) {
3561
3572
  return /* @__PURE__ */ P("div", {
3562
3573
  "data-slot": "sheet-footer",
3563
3574
  className: d("mt-auto flex flex-col gap-2 p-4", e),
3564
3575
  ...t
3565
3576
  });
3566
3577
  }
3567
- function Zn({ className: e, ...t }) {
3578
+ function tr({ className: e, ...t }) {
3568
3579
  return /* @__PURE__ */ P(H.Title, {
3569
3580
  "data-slot": "sheet-title",
3570
3581
  className: d("font-semibold text-foreground", e),
3571
3582
  ...t
3572
3583
  });
3573
3584
  }
3574
- function Qn({ className: e, ...t }) {
3585
+ function nr({ className: e, ...t }) {
3575
3586
  return /* @__PURE__ */ P(H.Description, {
3576
3587
  "data-slot": "sheet-description",
3577
3588
  className: d("text-muted-foreground text-sm", e),
@@ -3580,42 +3591,42 @@ function Qn({ className: e, ...t }) {
3580
3591
  }
3581
3592
  //#endregion
3582
3593
  //#region src/editor/features/TreegeEditor/sheets/NodeActionsSheet.tsx
3583
- var $n = () => {
3594
+ var rr = () => {
3584
3595
  let { selectedNode: e } = $(), { clearSelection: r } = q(), { isNodeSheetOpen: a, setIsNodeSheetOpen: o, openDeleteNodeConfirmation: c } = W(), l = G(), u = l(e?.data?.label), d = () => {
3585
3596
  o(!1), r();
3586
3597
  };
3587
- return /* @__PURE__ */ P(Gn, {
3598
+ return /* @__PURE__ */ P(Yn, {
3588
3599
  open: a && !!e,
3589
3600
  onOpenChange: (e) => {
3590
3601
  e || d();
3591
3602
  },
3592
- children: /* @__PURE__ */ F(Jn, {
3603
+ children: /* @__PURE__ */ F(Qn, {
3593
3604
  className: "flex flex-col gap-0",
3594
3605
  children: [
3595
- /* @__PURE__ */ F(Yn, { children: [/* @__PURE__ */ F(Zn, { children: [
3606
+ /* @__PURE__ */ F($n, { children: [/* @__PURE__ */ F(tr, { children: [
3596
3607
  l("editor.nodeActionsSheet.editNode"),
3597
3608
  " ",
3598
3609
  /* @__PURE__ */ P("span", {
3599
3610
  className: "font-light text-muted-foreground text-xs",
3600
3611
  children: e?.id
3601
3612
  })
3602
- ] }), /* @__PURE__ */ P(Qn, { children: u || "\xA0" })] }),
3603
- /* @__PURE__ */ P(jt, {
3613
+ ] }), /* @__PURE__ */ P(nr, { children: u || "\xA0" })] }),
3614
+ /* @__PURE__ */ P(Pt, {
3604
3615
  className: "flex min-h-0 flex-1 flex-col px-4",
3605
3616
  children: /* @__PURE__ */ F("div", {
3606
3617
  className: "space-y-6 py-4",
3607
3618
  children: [
3608
- /* @__PURE__ */ P(Wn, {}),
3609
- /* @__PURE__ */ P(Un, {}),
3610
- /* @__PURE__ */ P(k, {}),
3611
- s(e) && /* @__PURE__ */ P(Vn, {}),
3612
- n(e) && /* @__PURE__ */ P(Hn, {}),
3613
- t(e) && /* @__PURE__ */ P(xn, {}),
3614
- i(e) && /* @__PURE__ */ P(Sn, {})
3619
+ /* @__PURE__ */ P(Jn, {}),
3620
+ /* @__PURE__ */ P(qn, {}),
3621
+ /* @__PURE__ */ P(oe, {}),
3622
+ s(e) && /* @__PURE__ */ P(Gn, {}),
3623
+ n(e) && /* @__PURE__ */ P(Kn, {}),
3624
+ t(e) && /* @__PURE__ */ P(Tn, {}),
3625
+ i(e) && /* @__PURE__ */ P(En, {})
3615
3626
  ]
3616
3627
  })
3617
3628
  }),
3618
- /* @__PURE__ */ P(Xn, {
3629
+ /* @__PURE__ */ P(er, {
3619
3630
  className: "flex items-end border-t",
3620
3631
  children: /* @__PURE__ */ P(p, {
3621
3632
  variant: "ghost",
@@ -3624,15 +3635,84 @@ var $n = () => {
3624
3635
  e && c(e.id);
3625
3636
  },
3626
3637
  "aria-label": l("editor.nodeActionsSheet.deleteNode"),
3627
- children: /* @__PURE__ */ P(ot, {})
3638
+ children: /* @__PURE__ */ P(ct, {})
3628
3639
  })
3629
3640
  })
3630
3641
  ]
3631
3642
  })
3632
3643
  });
3633
- }, er = ({ ...e }) => {
3634
- let { theme: t = "system" } = wt();
3635
- return /* @__PURE__ */ P(St, {
3644
+ }, ir = 200, ar = 100, or = (e) => !!(e.measured?.width && e.measured?.height), sr = (e, t, n) => {
3645
+ let r = n === "TB" ? "y" : "x";
3646
+ return e.reduce((e, n) => t.node(n.id)[r] < t.node(e.id)[r] ? n : e, e[0]);
3647
+ }, cr = (e, t, n) => {
3648
+ let r = new Et.graphlib.Graph().setDefaultEdgeLabel(() => ({}));
3649
+ r.setGraph({
3650
+ nodesep: n.horizontalSpacing,
3651
+ rankdir: n.direction,
3652
+ ranksep: n.verticalSpacing
3653
+ });
3654
+ let i = /* @__PURE__ */ new Set();
3655
+ e.forEach((e) => {
3656
+ i.add(e.id), r.setNode(e.id, {
3657
+ height: e.measured?.height ?? ar,
3658
+ width: e.measured?.width ?? ir
3659
+ });
3660
+ }), t.forEach((e) => {
3661
+ i.has(e.source) && i.has(e.target) && r.setEdge(e.source, e.target);
3662
+ }), Et.layout(r);
3663
+ let a = sr(e, r, n.direction), o = a.measured?.width ?? ir, s = a.measured?.height ?? ar, c = r.node(a.id), l = a.position.x - (c.x - o / 2), u = a.position.y - (c.y - s / 2), d = /* @__PURE__ */ new Map();
3664
+ return e.forEach((e) => {
3665
+ let { x: t, y: n } = r.node(e.id), i = e.measured?.width ?? ir, a = e.measured?.height ?? ar;
3666
+ d.set(e.id, {
3667
+ x: t - i / 2 + l,
3668
+ y: n - a / 2 + u
3669
+ });
3670
+ }), d;
3671
+ }, lr = (e) => {
3672
+ let t = /* @__PURE__ */ new Map();
3673
+ return e.forEach((e) => {
3674
+ let n = t.get(e.parentId) ?? [];
3675
+ n.push(e), t.set(e.parentId, n);
3676
+ }), t;
3677
+ }, ur = (e, t, n = {}) => {
3678
+ let r = {
3679
+ direction: n.direction ?? "TB",
3680
+ horizontalSpacing: n.horizontalSpacing ?? 60,
3681
+ verticalSpacing: n.verticalSpacing ?? 80
3682
+ }, i = /* @__PURE__ */ new Map();
3683
+ return lr(e).forEach((e) => {
3684
+ let n = e.filter(or);
3685
+ n.length !== 0 && cr(n, t, r).forEach((e, t) => {
3686
+ i.set(t, e);
3687
+ });
3688
+ }), e.map((e) => {
3689
+ let t = i.get(e.id);
3690
+ return t ? {
3691
+ ...e,
3692
+ position: t
3693
+ } : e;
3694
+ });
3695
+ }, dr = (e) => Array.from(e.nodeLookup.values()).map((e) => `${e.id}:${e.measured?.width ?? 0}x${e.measured?.height ?? 0}`).join("|"), fr = ({ direction: e, horizontalSpacing: t, verticalSpacing: n } = {}) => {
3696
+ let { getNodes: r, getEdges: i, setNodes: a } = M(), o = Te(), s = Ee(dr);
3697
+ _t(() => {
3698
+ o && s && a(ur(r(), i(), {
3699
+ direction: e,
3700
+ horizontalSpacing: t,
3701
+ verticalSpacing: n
3702
+ }));
3703
+ }, [
3704
+ o,
3705
+ s,
3706
+ e,
3707
+ t,
3708
+ n,
3709
+ r,
3710
+ i,
3711
+ a
3712
+ ]);
3713
+ }, pr = ({ ...e }) => {
3714
+ let { theme: t = "system" } = Dt();
3715
+ return /* @__PURE__ */ P(wt, {
3636
3716
  theme: t,
3637
3717
  className: "toaster group",
3638
3718
  style: {
@@ -3642,14 +3722,14 @@ var $n = () => {
3642
3722
  },
3643
3723
  ...e
3644
3724
  });
3645
- }, tr = ({ flow: e, onExportJson: t, onSave: n, theme: r, className: i }) => {
3646
- let { onConnect: a, onConnectEnd: o, onEdgesDelete: s, isValidConnection: c } = Kt();
3647
- return /* @__PURE__ */ F(ye, {
3725
+ }, mr = ({ flow: e, onExportJson: t, onSave: n, theme: r, className: i }) => {
3726
+ let { onConnect: a, onConnectEnd: o, onEdgesDelete: s, isValidConnection: c } = Xt();
3727
+ return fr(), /* @__PURE__ */ F(ye, {
3648
3728
  fitView: !0,
3649
3729
  colorMode: r,
3650
3730
  selectNodesOnDrag: !1,
3651
- nodeTypes: on,
3652
- edgeTypes: Nt,
3731
+ nodeTypes: un,
3732
+ edgeTypes: Lt,
3653
3733
  defaultEdges: e?.edges || [],
3654
3734
  defaultNodes: e?.nodes || [],
3655
3735
  onConnect: a,
@@ -3662,28 +3742,28 @@ var $n = () => {
3662
3742
  gap: 10,
3663
3743
  variant: ue.Dots
3664
3744
  }),
3665
- /* @__PURE__ */ P(yn, {
3745
+ /* @__PURE__ */ P(Cn, {
3666
3746
  onExportJson: t,
3667
3747
  onSave: n
3668
3748
  }),
3669
- /* @__PURE__ */ P(Dt, { theme: r }),
3749
+ /* @__PURE__ */ P(At, { theme: r }),
3670
3750
  /* @__PURE__ */ P(he, {}),
3671
3751
  /* @__PURE__ */ P(fe, {}),
3672
- /* @__PURE__ */ P($n, {}),
3673
- /* @__PURE__ */ P(sn, {})
3752
+ /* @__PURE__ */ P(rr, {}),
3753
+ /* @__PURE__ */ P(dn, {})
3674
3754
  ]
3675
3755
  });
3676
- }, nr = ({ flow: e, onExportJson: t, onSave: n, theme: r = "dark", language: i = "en", aiConfig: a }) => /* @__PURE__ */ P(o, {
3756
+ }, hr = ({ flow: e, onExportJson: t, onSave: n, theme: r = "dark", language: i = "en", aiConfig: a }) => /* @__PURE__ */ P(o, {
3677
3757
  defaultTheme: r,
3678
3758
  storageKey: "treege-editor-theme",
3679
3759
  theme: r,
3680
- children: /* @__PURE__ */ F(At, {
3760
+ children: /* @__PURE__ */ F(Nt, {
3681
3761
  value: {
3682
3762
  aiConfig: a,
3683
3763
  flowId: e?.id,
3684
3764
  language: i
3685
3765
  },
3686
- children: [/* @__PURE__ */ P(er, { position: "bottom-center" }), /* @__PURE__ */ P(be, { children: /* @__PURE__ */ P(tr, {
3766
+ children: [/* @__PURE__ */ P(pr, { position: "bottom-center" }), /* @__PURE__ */ P(be, { children: /* @__PURE__ */ P(mr, {
3687
3767
  onExportJson: t,
3688
3768
  onSave: n,
3689
3769
  flow: e,
@@ -3692,4 +3772,4 @@ var $n = () => {
3692
3772
  })
3693
3773
  });
3694
3774
  //#endregion
3695
- export { nr as t };
3775
+ export { hr as t };