treege 3.0.0-beta.33 → 3.0.0-beta.34
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,30 +1,30 @@
|
|
|
1
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
2
|
import { C as c, D as l, E as u, F as d, M as f, N as p, O as m, P as h, S as g, T as _, _ as v, a as y, b, c as x, d as S, f as C, g as w, h as ee, i as te, j as T, k as E, l as ne, m as re, n as ie, o as D, p as ae, r as oe, s as O, t as se, u as ce, v as k, w as le, x as ue, y as A } from "./separator-Cdfv5nIR.js";
|
|
3
|
-
import { Background as de, BackgroundVariant as fe, BaseEdge as pe, Controls as me, EdgeLabelRenderer as he, Handle as ge, MiniMap as _e, NodeResizer as ve, Panel as ye, Position as be, ReactFlow as xe, ReactFlowProvider as Se, addEdge as Ce, getBezierPath as we, useEdges as Te, useNodes as Ee, useReactFlow as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { useForm as
|
|
6
|
-
import { AlignLeft as
|
|
7
|
-
import { createContext as
|
|
3
|
+
import { Background as de, BackgroundVariant as fe, BaseEdge as pe, Controls as me, EdgeLabelRenderer as he, Handle as ge, MiniMap as _e, NodeResizer as ve, Panel as ye, Position as be, ReactFlow as xe, ReactFlowProvider as Se, addEdge as Ce, getBezierPath as we, useEdges as Te, useNodes as Ee, useReactFlow as j } from "@xyflow/react";
|
|
4
|
+
import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
5
|
+
import { useForm as F } from "@tanstack/react-form";
|
|
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 I, 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 L, XIcon as pt } from "lucide-react";
|
|
7
|
+
import { createContext as mt, memo as ht, useCallback as R, useContext as gt, useEffect as _t, useId as vt, useMemo as yt, useRef as bt, useState as z } from "react";
|
|
8
8
|
import { Slot as xt } from "@radix-ui/react-slot";
|
|
9
9
|
import { cva as St } from "class-variance-authority";
|
|
10
10
|
import * as Ct from "@radix-ui/react-scroll-area";
|
|
11
|
-
import * as B from "@radix-ui/react-
|
|
12
|
-
import * as V from "@radix-ui/react-
|
|
11
|
+
import * as B from "@radix-ui/react-dropdown-menu";
|
|
12
|
+
import * as V from "@radix-ui/react-alert-dialog";
|
|
13
13
|
import { Toaster as wt, toast as H } from "sonner";
|
|
14
14
|
import * as U from "@radix-ui/react-dialog";
|
|
15
15
|
import * as Tt from "@radix-ui/react-collapsible";
|
|
16
16
|
import { useTheme as Et } from "next-themes";
|
|
17
17
|
//#region src/editor/assets/img/treege-black.svg
|
|
18
|
-
var Dt = "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", 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_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", kt = ({ theme: e = "dark" }) => /* @__PURE__ */ M("div", {
|
|
18
|
+
var Dt = "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", 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_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", kt = ({ theme: e = "dark" }) => /* @__PURE__ */ N("div", {
|
|
19
19
|
className: "absolute top-5 left-5 z-50 select-none",
|
|
20
|
-
children: /* @__PURE__ */
|
|
20
|
+
children: /* @__PURE__ */ N("img", {
|
|
21
21
|
src: e === "dark" ? Ot : Dt,
|
|
22
22
|
alt: "Treege",
|
|
23
23
|
className: "relative h-14 w-auto drop-shadow-[0_0px_35px] drop-shadow-blue-600"
|
|
24
24
|
})
|
|
25
25
|
}), At = (e) => {
|
|
26
26
|
let t = Ee(), n = Te();
|
|
27
|
-
return
|
|
27
|
+
return yt(() => {
|
|
28
28
|
if (!e) return [];
|
|
29
29
|
let r = (e, t = /* @__PURE__ */ new Set()) => {
|
|
30
30
|
if (t.has(e)) return [];
|
|
@@ -45,30 +45,37 @@ var Dt = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%20
|
|
|
45
45
|
t,
|
|
46
46
|
n
|
|
47
47
|
]);
|
|
48
|
-
}, jt =
|
|
49
|
-
let [n, r] = z(t?.flowId), [i, a] = z(!1), o =
|
|
48
|
+
}, jt = mt(null), Mt = ({ children: e, value: t }) => {
|
|
49
|
+
let [n, r] = z(t?.flowId), [i, a] = z(!1), [o, s] = z(null), c = yt(() => ({
|
|
50
50
|
...t,
|
|
51
51
|
...t?.aiConfig && { aiConfig: {
|
|
52
52
|
...t.aiConfig,
|
|
53
53
|
provider: t?.aiConfig.provider ?? "gemini"
|
|
54
54
|
} },
|
|
55
|
+
closeDeleteNodeConfirmation: () => s(null),
|
|
55
56
|
flowId: n,
|
|
56
57
|
isNodeSheetOpen: i,
|
|
58
|
+
openDeleteNodeConfirmation: (e) => s(e),
|
|
59
|
+
pendingDeleteNodeId: o,
|
|
57
60
|
setFlowId: r,
|
|
58
61
|
setIsNodeSheetOpen: a
|
|
59
62
|
}), [
|
|
60
63
|
n,
|
|
61
64
|
t,
|
|
62
|
-
i
|
|
65
|
+
i,
|
|
66
|
+
o
|
|
63
67
|
]);
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
value:
|
|
68
|
+
return /* @__PURE__ */ N(jt.Provider, {
|
|
69
|
+
value: c,
|
|
66
70
|
children: e
|
|
67
71
|
});
|
|
68
|
-
}, W = () =>
|
|
72
|
+
}, W = () => gt(jt) ?? {
|
|
73
|
+
closeDeleteNodeConfirmation: () => {},
|
|
69
74
|
flowId: void 0,
|
|
70
75
|
isNodeSheetOpen: !1,
|
|
71
76
|
language: "en",
|
|
77
|
+
openDeleteNodeConfirmation: () => {},
|
|
78
|
+
pendingDeleteNodeId: null,
|
|
72
79
|
setFlowId: () => {},
|
|
73
80
|
setIsNodeSheetOpen: () => {}
|
|
74
81
|
}, G = (t) => {
|
|
@@ -78,28 +85,28 @@ var Dt = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%20
|
|
|
78
85
|
//#endregion
|
|
79
86
|
//#region src/shared/components/ui/scroll-area.tsx
|
|
80
87
|
function Nt({ className: e, children: t, ...n }) {
|
|
81
|
-
return /* @__PURE__ */
|
|
88
|
+
return /* @__PURE__ */ P(Ct.Root, {
|
|
82
89
|
"data-slot": "scroll-area",
|
|
83
90
|
className: d("relative", e),
|
|
84
91
|
...n,
|
|
85
92
|
children: [
|
|
86
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ N(Ct.Viewport, {
|
|
87
94
|
"data-slot": "scroll-area-viewport",
|
|
88
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",
|
|
89
96
|
children: t
|
|
90
97
|
}),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ N(Pt, {}),
|
|
99
|
+
/* @__PURE__ */ N(Ct.Corner, {})
|
|
93
100
|
]
|
|
94
101
|
});
|
|
95
102
|
}
|
|
96
103
|
function Pt({ className: e, orientation: t = "vertical", ...n }) {
|
|
97
|
-
return /* @__PURE__ */
|
|
104
|
+
return /* @__PURE__ */ N(Ct.ScrollAreaScrollbar, {
|
|
98
105
|
"data-slot": "scroll-area-scrollbar",
|
|
99
106
|
orientation: t,
|
|
100
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),
|
|
101
108
|
...n,
|
|
102
|
-
children: /* @__PURE__ */
|
|
109
|
+
children: /* @__PURE__ */ N(Ct.ScrollAreaThumb, {
|
|
103
110
|
"data-slot": "scroll-area-thumb",
|
|
104
111
|
className: "relative flex-1 rounded-full bg-border"
|
|
105
112
|
})
|
|
@@ -108,7 +115,7 @@ function Pt({ className: e, orientation: t = "vertical", ...n }) {
|
|
|
108
115
|
//#endregion
|
|
109
116
|
//#region src/editor/constants/edgeTypes.ts
|
|
110
117
|
var Ft = {
|
|
111
|
-
conditional:
|
|
118
|
+
conditional: ht(({ id: e, target: t, sourceX: n, sourceY: i, targetX: a, targetY: o, sourcePosition: s, targetPosition: d, markerEnd: h, style: y, data: x }) => {
|
|
112
119
|
let [S, C, w] = we({
|
|
113
120
|
sourcePosition: s,
|
|
114
121
|
sourceX: n,
|
|
@@ -116,7 +123,7 @@ var Ft = {
|
|
|
116
123
|
targetPosition: d,
|
|
117
124
|
targetX: a,
|
|
118
125
|
targetY: o
|
|
119
|
-
}), [ee, te] = z(!1), { updateEdgeData: ne } =
|
|
126
|
+
}), [ee, te] = z(!1), { updateEdgeData: ne } = j(), re = At(t), ie = x?.conditions && x.conditions.length > 0, D = G(), { handleSubmit: ae, reset: oe, Field: O } = F({
|
|
120
127
|
defaultValues: {
|
|
121
128
|
conditions: x?.conditions || [{
|
|
122
129
|
field: re[0]?.nodeId ?? "",
|
|
@@ -156,7 +163,7 @@ var Ft = {
|
|
|
156
163
|
let t = e.filter((e) => e.logicalOperator === r.AND).length, n = e.filter((e) => e.logicalOperator === r.OR).length;
|
|
157
164
|
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")}`;
|
|
158
165
|
}, A = () => x?.isFallback ? "var(--color-chart-4)" : ie ? "var(--color-chart-2)" : "var(--color-chart-3)";
|
|
159
|
-
return /* @__PURE__ */
|
|
166
|
+
return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(pe, {
|
|
160
167
|
path: S,
|
|
161
168
|
markerEnd: h,
|
|
162
169
|
style: {
|
|
@@ -165,121 +172,121 @@ var Ft = {
|
|
|
165
172
|
strokeDasharray: x?.isFallback ? "5,5" : void 0,
|
|
166
173
|
strokeWidth: ie || x?.isFallback ? 2 : y?.strokeWidth
|
|
167
174
|
}
|
|
168
|
-
}), /* @__PURE__ */
|
|
175
|
+
}), /* @__PURE__ */ N(he, { children: /* @__PURE__ */ N("div", {
|
|
169
176
|
className: "nodrag nopan absolute",
|
|
170
177
|
style: {
|
|
171
178
|
pointerEvents: "all",
|
|
172
179
|
transform: `translate(-50%, -50%) translate(${C}px,${w}px)`
|
|
173
180
|
},
|
|
174
|
-
children: /* @__PURE__ */
|
|
181
|
+
children: /* @__PURE__ */ P(le, {
|
|
175
182
|
open: ee,
|
|
176
183
|
onOpenChange: te,
|
|
177
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ N(u, {
|
|
178
185
|
asChild: !0,
|
|
179
|
-
children: /* @__PURE__ */
|
|
186
|
+
children: /* @__PURE__ */ P(p, {
|
|
180
187
|
variant: ie || x?.isFallback ? "default" : "secondary",
|
|
181
188
|
className: "h-8 px-2 text-xs",
|
|
182
189
|
onClick: se,
|
|
183
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ N(ft, { className: "mr-1 h-3 w-3" }), ie || x?.isFallback ? ue() : D("editor.conditionalEdge.condition")]
|
|
184
191
|
})
|
|
185
|
-
}), /* @__PURE__ */
|
|
192
|
+
}), /* @__PURE__ */ N(_, {
|
|
186
193
|
className: "w-96 p-1",
|
|
187
194
|
align: "center",
|
|
188
195
|
onClick: (e) => e.stopPropagation(),
|
|
189
|
-
children: /* @__PURE__ */
|
|
196
|
+
children: /* @__PURE__ */ N(Nt, {
|
|
190
197
|
className: "flex max-h-150 flex-col p-3",
|
|
191
|
-
children: /* @__PURE__ */
|
|
198
|
+
children: /* @__PURE__ */ N("form", {
|
|
192
199
|
onSubmit: (e) => {
|
|
193
200
|
e.preventDefault(), e.stopPropagation();
|
|
194
201
|
},
|
|
195
|
-
children: /* @__PURE__ */
|
|
202
|
+
children: /* @__PURE__ */ P("div", {
|
|
196
203
|
className: "grid gap-5",
|
|
197
204
|
children: [
|
|
198
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ P("div", {
|
|
199
206
|
className: "space-y-2",
|
|
200
|
-
children: [/* @__PURE__ */
|
|
207
|
+
children: [/* @__PURE__ */ N("h4", {
|
|
201
208
|
className: "font-medium leading-none",
|
|
202
209
|
children: D("editor.conditionalEdge.displayConditions")
|
|
203
|
-
}), /* @__PURE__ */
|
|
210
|
+
}), /* @__PURE__ */ N("p", {
|
|
204
211
|
className: "text-muted-foreground text-sm",
|
|
205
212
|
children: D("editor.conditionalEdge.displayConditionsDesc")
|
|
206
213
|
})]
|
|
207
214
|
}),
|
|
208
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ P("div", {
|
|
209
216
|
className: "grid gap-4",
|
|
210
217
|
children: [
|
|
211
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ N(O, {
|
|
212
219
|
name: "label",
|
|
213
|
-
children: (e) => /* @__PURE__ */
|
|
214
|
-
/* @__PURE__ */
|
|
220
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [
|
|
221
|
+
/* @__PURE__ */ N(l, {
|
|
215
222
|
htmlFor: e.name,
|
|
216
223
|
children: D("editor.conditionalEdge.labelOptional")
|
|
217
224
|
}),
|
|
218
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ N(m, {
|
|
219
226
|
id: e.name,
|
|
220
227
|
placeholder: D("editor.conditionalEdge.labelPlaceholder"),
|
|
221
228
|
value: e.state.value,
|
|
222
229
|
onChange: (t) => e.handleChange(t.target.value)
|
|
223
230
|
}),
|
|
224
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ N(E, { children: D("editor.conditionalEdge.labelDesc") })
|
|
225
232
|
] })
|
|
226
233
|
}),
|
|
227
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ N(O, {
|
|
228
235
|
name: "isFallback",
|
|
229
|
-
children: (e) => /* @__PURE__ */
|
|
236
|
+
children: (e) => /* @__PURE__ */ N(T, { children: /* @__PURE__ */ P("div", {
|
|
230
237
|
className: "flex items-center gap-3 rounded-lg border bg-muted/20 p-3",
|
|
231
|
-
children: [/* @__PURE__ */
|
|
238
|
+
children: [/* @__PURE__ */ N(f, {
|
|
232
239
|
id: e.name,
|
|
233
240
|
checked: e.state.value,
|
|
234
241
|
onCheckedChange: (t) => e.handleChange(t)
|
|
235
|
-
}), /* @__PURE__ */
|
|
242
|
+
}), /* @__PURE__ */ P("div", {
|
|
236
243
|
className: "flex flex-col gap-1",
|
|
237
|
-
children: [/* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ N(l, {
|
|
238
245
|
htmlFor: e.name,
|
|
239
246
|
className: "cursor-pointer font-medium",
|
|
240
247
|
children: D("editor.conditionalEdge.fallbackPath")
|
|
241
|
-
}), /* @__PURE__ */
|
|
248
|
+
}), /* @__PURE__ */ N(E, {
|
|
242
249
|
className: "text-xs",
|
|
243
250
|
children: D("editor.conditionalEdge.fallbackPathDesc")
|
|
244
251
|
})]
|
|
245
252
|
})]
|
|
246
253
|
}) })
|
|
247
254
|
}),
|
|
248
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ N(O, {
|
|
249
256
|
name: "conditions",
|
|
250
257
|
mode: "array",
|
|
251
258
|
children: (e) => {
|
|
252
259
|
let t = e.form.getFieldValue("isFallback");
|
|
253
|
-
return /* @__PURE__ */
|
|
260
|
+
return /* @__PURE__ */ P("div", {
|
|
254
261
|
className: "space-y-3",
|
|
255
|
-
children: [/* @__PURE__ */
|
|
262
|
+
children: [/* @__PURE__ */ N(l, {
|
|
256
263
|
className: t ? "text-muted-foreground" : "",
|
|
257
264
|
children: D("editor.conditionalEdge.conditions")
|
|
258
|
-
}), /* @__PURE__ */
|
|
265
|
+
}), /* @__PURE__ */ P("div", {
|
|
259
266
|
className: "space-y-2",
|
|
260
|
-
children: [e.state.value?.map((n, i) => /* @__PURE__ */
|
|
267
|
+
children: [e.state.value?.map((n, i) => /* @__PURE__ */ P("div", {
|
|
261
268
|
className: "space-y-2",
|
|
262
|
-
children: [/* @__PURE__ */
|
|
269
|
+
children: [/* @__PURE__ */ P("div", {
|
|
263
270
|
className: "space-y-2 rounded-lg border bg-muted/30 p-3",
|
|
264
271
|
children: [
|
|
265
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ N(O, {
|
|
266
273
|
name: `conditions[${i}].field`,
|
|
267
|
-
children: (e) => /* @__PURE__ */
|
|
274
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [/* @__PURE__ */ N(l, {
|
|
268
275
|
htmlFor: `field-${i}`,
|
|
269
276
|
children: D("editor.conditionalEdge.field")
|
|
270
|
-
}), /* @__PURE__ */
|
|
277
|
+
}), /* @__PURE__ */ P(v, {
|
|
271
278
|
disabled: t,
|
|
272
279
|
value: e.state.value || "",
|
|
273
280
|
onValueChange: (t) => e.handleChange(t),
|
|
274
|
-
children: [/* @__PURE__ */
|
|
281
|
+
children: [/* @__PURE__ */ N(g, {
|
|
275
282
|
id: `field-${i}`,
|
|
276
283
|
className: "w-full",
|
|
277
|
-
children: /* @__PURE__ */
|
|
278
|
-
}), /* @__PURE__ */
|
|
284
|
+
children: /* @__PURE__ */ N(c, { placeholder: D("editor.conditionalEdge.selectField") })
|
|
285
|
+
}), /* @__PURE__ */ N(k, { children: re.length === 0 ? /* @__PURE__ */ N(b, {
|
|
279
286
|
value: "none",
|
|
280
287
|
disabled: !0,
|
|
281
288
|
children: D("editor.conditionalEdge.noFieldsAvailable")
|
|
282
|
-
}) : re.map((e) => /* @__PURE__ */
|
|
289
|
+
}) : re.map((e) => /* @__PURE__ */ P(b, {
|
|
283
290
|
value: e.nodeId,
|
|
284
291
|
children: [
|
|
285
292
|
e.label,
|
|
@@ -290,55 +297,55 @@ var Ft = {
|
|
|
290
297
|
}, e.nodeId)) })]
|
|
291
298
|
})] })
|
|
292
299
|
}),
|
|
293
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ P("div", {
|
|
294
301
|
className: "flex gap-2",
|
|
295
|
-
children: [/* @__PURE__ */
|
|
302
|
+
children: [/* @__PURE__ */ N(O, {
|
|
296
303
|
name: `conditions[${i}].operator`,
|
|
297
|
-
children: (e) => /* @__PURE__ */
|
|
304
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [/* @__PURE__ */ N(l, {
|
|
298
305
|
htmlFor: `operator-${i}`,
|
|
299
306
|
children: D("editor.conditionalEdge.operator")
|
|
300
|
-
}), /* @__PURE__ */
|
|
307
|
+
}), /* @__PURE__ */ P(v, {
|
|
301
308
|
disabled: t,
|
|
302
309
|
value: e.state.value || "===",
|
|
303
310
|
onValueChange: (t) => e.handleChange(t),
|
|
304
|
-
children: [/* @__PURE__ */
|
|
311
|
+
children: [/* @__PURE__ */ N(g, {
|
|
305
312
|
id: `operator-${i}`,
|
|
306
|
-
children: /* @__PURE__ */
|
|
307
|
-
}), /* @__PURE__ */
|
|
308
|
-
/* @__PURE__ */
|
|
313
|
+
children: /* @__PURE__ */ N(c, {})
|
|
314
|
+
}), /* @__PURE__ */ P(k, { children: [
|
|
315
|
+
/* @__PURE__ */ N(b, {
|
|
309
316
|
value: "===",
|
|
310
317
|
children: "="
|
|
311
318
|
}),
|
|
312
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ N(b, {
|
|
313
320
|
value: "!==",
|
|
314
321
|
children: "≠"
|
|
315
322
|
}),
|
|
316
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ N(b, {
|
|
317
324
|
value: ">",
|
|
318
325
|
children: ">"
|
|
319
326
|
}),
|
|
320
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ N(b, {
|
|
321
328
|
value: "<",
|
|
322
329
|
children: "<"
|
|
323
330
|
}),
|
|
324
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ N(b, {
|
|
325
332
|
value: ">=",
|
|
326
333
|
children: ">="
|
|
327
334
|
}),
|
|
328
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ N(b, {
|
|
329
336
|
value: "<=",
|
|
330
337
|
children: "<="
|
|
331
338
|
})
|
|
332
339
|
] })]
|
|
333
340
|
})] })
|
|
334
|
-
}), /* @__PURE__ */
|
|
341
|
+
}), /* @__PURE__ */ N(O, {
|
|
335
342
|
name: `conditions[${i}].value`,
|
|
336
|
-
children: (e) => /* @__PURE__ */
|
|
343
|
+
children: (e) => /* @__PURE__ */ P(T, {
|
|
337
344
|
className: "w-full",
|
|
338
|
-
children: [/* @__PURE__ */
|
|
345
|
+
children: [/* @__PURE__ */ N(l, {
|
|
339
346
|
htmlFor: `value-${i}`,
|
|
340
347
|
children: D("editor.conditionalEdge.value")
|
|
341
|
-
}), /* @__PURE__ */
|
|
348
|
+
}), /* @__PURE__ */ N(m, {
|
|
342
349
|
disabled: t,
|
|
343
350
|
id: `value-${i}`,
|
|
344
351
|
placeholder: D("editor.conditionalEdge.valuePlaceholder"),
|
|
@@ -348,7 +355,7 @@ var Ft = {
|
|
|
348
355
|
})
|
|
349
356
|
})]
|
|
350
357
|
}),
|
|
351
|
-
e.state.value && e.state.value.length > 1 && /* @__PURE__ */
|
|
358
|
+
e.state.value && e.state.value.length > 1 && /* @__PURE__ */ P(p, {
|
|
352
359
|
disabled: t,
|
|
353
360
|
type: "button",
|
|
354
361
|
variant: "ghost",
|
|
@@ -357,31 +364,31 @@ var Ft = {
|
|
|
357
364
|
onClick: () => {
|
|
358
365
|
e.removeValue(i), ae().then();
|
|
359
366
|
},
|
|
360
|
-
children: [/* @__PURE__ */
|
|
367
|
+
children: [/* @__PURE__ */ N(L, { className: "mr-1 h-4 w-4" }), D("editor.conditionalEdge.removeCondition")]
|
|
361
368
|
})
|
|
362
369
|
]
|
|
363
|
-
}), e.state.value && i < e.state.value.length - 1 && /* @__PURE__ */
|
|
370
|
+
}), e.state.value && i < e.state.value.length - 1 && /* @__PURE__ */ N(O, {
|
|
364
371
|
name: `conditions[${i}].logicalOperator`,
|
|
365
|
-
children: (e) => /* @__PURE__ */
|
|
372
|
+
children: (e) => /* @__PURE__ */ N("div", {
|
|
366
373
|
className: "flex justify-center",
|
|
367
|
-
children: /* @__PURE__ */
|
|
374
|
+
children: /* @__PURE__ */ P(v, {
|
|
368
375
|
disabled: t,
|
|
369
376
|
value: e.state.value || r.AND,
|
|
370
377
|
onValueChange: (t) => e.handleChange(t),
|
|
371
|
-
children: [/* @__PURE__ */
|
|
378
|
+
children: [/* @__PURE__ */ N(g, {
|
|
372
379
|
className: "h-9 w-32 font-semibold",
|
|
373
|
-
children: /* @__PURE__ */
|
|
374
|
-
}), /* @__PURE__ */
|
|
380
|
+
children: /* @__PURE__ */ N(c, {})
|
|
381
|
+
}), /* @__PURE__ */ P(k, { children: [/* @__PURE__ */ N(b, {
|
|
375
382
|
value: r.AND,
|
|
376
383
|
children: "AND"
|
|
377
|
-
}), /* @__PURE__ */
|
|
384
|
+
}), /* @__PURE__ */ N(b, {
|
|
378
385
|
value: r.OR,
|
|
379
386
|
children: "OR"
|
|
380
387
|
})] })]
|
|
381
388
|
})
|
|
382
389
|
})
|
|
383
390
|
})]
|
|
384
|
-
}, `condition-${i}`)), /* @__PURE__ */
|
|
391
|
+
}, `condition-${i}`)), /* @__PURE__ */ P(p, {
|
|
385
392
|
disabled: t,
|
|
386
393
|
type: "button",
|
|
387
394
|
variant: "outline",
|
|
@@ -395,7 +402,7 @@ var Ft = {
|
|
|
395
402
|
value: ""
|
|
396
403
|
}), ae().then();
|
|
397
404
|
},
|
|
398
|
-
children: [/* @__PURE__ */
|
|
405
|
+
children: [/* @__PURE__ */ N(I, { className: "mr-2 h-4 w-4" }), D("editor.conditionalEdge.addCondition")]
|
|
399
406
|
})]
|
|
400
407
|
})]
|
|
401
408
|
});
|
|
@@ -403,15 +410,15 @@ var Ft = {
|
|
|
403
410
|
})
|
|
404
411
|
]
|
|
405
412
|
}),
|
|
406
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ P("div", {
|
|
407
414
|
className: "flex justify-end gap-2 pt-2",
|
|
408
|
-
children: [/* @__PURE__ */
|
|
415
|
+
children: [/* @__PURE__ */ P(p, {
|
|
409
416
|
type: "button",
|
|
410
417
|
size: "sm",
|
|
411
418
|
variant: "outline",
|
|
412
419
|
onClick: ce,
|
|
413
|
-
children: [/* @__PURE__ */
|
|
414
|
-
}), /* @__PURE__ */
|
|
420
|
+
children: [/* @__PURE__ */ N(L, { className: "mr-1 h-4 w-4" }), D("common.clear")]
|
|
421
|
+
}), /* @__PURE__ */ N(p, {
|
|
415
422
|
type: "button",
|
|
416
423
|
size: "sm",
|
|
417
424
|
onClick: () => te(!1),
|
|
@@ -426,7 +433,7 @@ var Ft = {
|
|
|
426
433
|
})
|
|
427
434
|
}) })] });
|
|
428
435
|
}),
|
|
429
|
-
default:
|
|
436
|
+
default: ht(({ id: e, sourceX: t, sourceY: n, targetX: r, targetY: i, sourcePosition: a, targetPosition: o, style: s, markerEnd: c, selected: l }) => {
|
|
430
437
|
let [u, d, f] = we({
|
|
431
438
|
sourcePosition: a,
|
|
432
439
|
sourceX: t,
|
|
@@ -434,15 +441,15 @@ var Ft = {
|
|
|
434
441
|
targetPosition: o,
|
|
435
442
|
targetX: r,
|
|
436
443
|
targetY: i
|
|
437
|
-
}), { setEdges: p } =
|
|
438
|
-
return /* @__PURE__ */
|
|
444
|
+
}), { setEdges: p } = j();
|
|
445
|
+
return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(pe, {
|
|
439
446
|
path: u,
|
|
440
447
|
markerEnd: c,
|
|
441
448
|
style: s
|
|
442
|
-
}), /* @__PURE__ */
|
|
449
|
+
}), /* @__PURE__ */ N(he, { children: l && /* @__PURE__ */ N("div", {
|
|
443
450
|
className: "button-edge__label nodrag nopan",
|
|
444
451
|
style: { transform: `translate(-50%, -50%) translate(${d}px,${f}px)` },
|
|
445
|
-
children: /* @__PURE__ */
|
|
452
|
+
children: /* @__PURE__ */ N("button", {
|
|
446
453
|
type: "button",
|
|
447
454
|
className: "button-edge__button",
|
|
448
455
|
onClick: () => {
|
|
@@ -473,14 +480,14 @@ var Ft = {
|
|
|
473
480
|
time: "time",
|
|
474
481
|
timerange: "timerange"
|
|
475
482
|
}, It = { [a.input]: { type: K.text } }, q = () => {
|
|
476
|
-
let { setNodes: e, setEdges: t, getNodes: n } =
|
|
483
|
+
let { setNodes: e, setEdges: t, getNodes: n } = j(), r = R(() => {
|
|
477
484
|
e((e) => e.map(({ selected: e, ...t }) => t)), t((e) => e.map(({ selected: e, ...t }) => t));
|
|
478
|
-
}, [t, e]), i =
|
|
485
|
+
}, [t, e]), i = R((n) => {
|
|
479
486
|
e((e) => e.map((e) => ({
|
|
480
487
|
...e,
|
|
481
488
|
selected: e.id === n
|
|
482
489
|
}))), t((e) => e.map(({ selected: e, ...t }) => t));
|
|
483
|
-
}, [t, e]), a =
|
|
490
|
+
}, [t, e]), a = R((t, n) => {
|
|
484
491
|
e((e) => e.map((e) => e.id === t ? {
|
|
485
492
|
...e,
|
|
486
493
|
data: {
|
|
@@ -488,25 +495,25 @@ var Ft = {
|
|
|
488
495
|
...n
|
|
489
496
|
}
|
|
490
497
|
} : e));
|
|
491
|
-
}, [e]), o =
|
|
498
|
+
}, [e]), o = R((t, n) => {
|
|
492
499
|
e((e) => e.map((e) => e.id === t ? {
|
|
493
500
|
...e,
|
|
494
501
|
data: It[n] ?? {},
|
|
495
502
|
type: n
|
|
496
503
|
} : e));
|
|
497
|
-
}, [e]), s =
|
|
504
|
+
}, [e]), s = R((e) => {
|
|
498
505
|
let t = n().find((e) => e.selected);
|
|
499
506
|
t && o(t.id, e);
|
|
500
|
-
}, [n, o]), c =
|
|
507
|
+
}, [n, o]), c = R((e) => {
|
|
501
508
|
let t = n().find((e) => e.selected);
|
|
502
509
|
t && a(t.id, e);
|
|
503
|
-
}, [n, a]), l =
|
|
510
|
+
}, [n, a]), l = R((n) => {
|
|
504
511
|
e((e) => e.filter((e) => e.id !== n)), t((e) => e.filter((e) => e.source !== n && e.target !== n));
|
|
505
512
|
}, [e, t]);
|
|
506
513
|
return {
|
|
507
514
|
clearSelection: r,
|
|
508
515
|
deleteNode: l,
|
|
509
|
-
deleteSelectedNode:
|
|
516
|
+
deleteSelectedNode: R(() => {
|
|
510
517
|
let e = n().find((e) => e.selected);
|
|
511
518
|
e && l(e.id);
|
|
512
519
|
}, [n, l]),
|
|
@@ -523,7 +530,7 @@ var Ft = {
|
|
|
523
530
|
[i]: n.target.value
|
|
524
531
|
} });
|
|
525
532
|
}, u = (e) => e.stopPropagation();
|
|
526
|
-
return /* @__PURE__ */
|
|
533
|
+
return /* @__PURE__ */ N("input", {
|
|
527
534
|
type: "text",
|
|
528
535
|
value: s,
|
|
529
536
|
placeholder: c,
|
|
@@ -535,109 +542,35 @@ var Ft = {
|
|
|
535
542
|
});
|
|
536
543
|
};
|
|
537
544
|
//#endregion
|
|
538
|
-
//#region src/shared/components/ui/alert-dialog.tsx
|
|
539
|
-
function Rt({ ...e }) {
|
|
540
|
-
return /* @__PURE__ */ M(B.Root, {
|
|
541
|
-
"data-slot": "alert-dialog",
|
|
542
|
-
...e
|
|
543
|
-
});
|
|
544
|
-
}
|
|
545
|
-
function zt({ ...e }) {
|
|
546
|
-
return /* @__PURE__ */ M(B.Trigger, {
|
|
547
|
-
"data-slot": "alert-dialog-trigger",
|
|
548
|
-
...e
|
|
549
|
-
});
|
|
550
|
-
}
|
|
551
|
-
function Bt({ ...e }) {
|
|
552
|
-
return /* @__PURE__ */ M(B.Portal, {
|
|
553
|
-
"data-slot": "alert-dialog-portal",
|
|
554
|
-
...e
|
|
555
|
-
});
|
|
556
|
-
}
|
|
557
|
-
function Vt({ className: e, ...t }) {
|
|
558
|
-
return /* @__PURE__ */ M(B.Overlay, {
|
|
559
|
-
"data-slot": "alert-dialog-overlay",
|
|
560
|
-
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),
|
|
561
|
-
...t
|
|
562
|
-
});
|
|
563
|
-
}
|
|
564
|
-
function Ht({ className: e, ...t }) {
|
|
565
|
-
return /* @__PURE__ */ N(Bt, { children: [/* @__PURE__ */ M(Vt, {}), /* @__PURE__ */ M(B.Content, {
|
|
566
|
-
"data-slot": "alert-dialog-content",
|
|
567
|
-
className: d("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg", e),
|
|
568
|
-
...t
|
|
569
|
-
})] });
|
|
570
|
-
}
|
|
571
|
-
function Ut({ className: e, ...t }) {
|
|
572
|
-
return /* @__PURE__ */ M("div", {
|
|
573
|
-
"data-slot": "alert-dialog-header",
|
|
574
|
-
className: d("flex flex-col gap-2 text-center sm:text-left", e),
|
|
575
|
-
...t
|
|
576
|
-
});
|
|
577
|
-
}
|
|
578
|
-
function Wt({ className: e, ...t }) {
|
|
579
|
-
return /* @__PURE__ */ M("div", {
|
|
580
|
-
"data-slot": "alert-dialog-footer",
|
|
581
|
-
className: d("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", e),
|
|
582
|
-
...t
|
|
583
|
-
});
|
|
584
|
-
}
|
|
585
|
-
function Gt({ className: e, ...t }) {
|
|
586
|
-
return /* @__PURE__ */ M(B.Title, {
|
|
587
|
-
"data-slot": "alert-dialog-title",
|
|
588
|
-
className: d("font-semibold text-lg", e),
|
|
589
|
-
...t
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
function Kt({ className: e, ...t }) {
|
|
593
|
-
return /* @__PURE__ */ M(B.Description, {
|
|
594
|
-
"data-slot": "alert-dialog-description",
|
|
595
|
-
className: d("text-muted-foreground text-sm", e),
|
|
596
|
-
...t
|
|
597
|
-
});
|
|
598
|
-
}
|
|
599
|
-
function qt({ className: e, ...t }) {
|
|
600
|
-
return /* @__PURE__ */ M(B.Action, {
|
|
601
|
-
className: d(h(), e),
|
|
602
|
-
...t
|
|
603
|
-
});
|
|
604
|
-
}
|
|
605
|
-
function Jt({ className: e, ...t }) {
|
|
606
|
-
return /* @__PURE__ */ M(B.Cancel, {
|
|
607
|
-
className: d(h({ variant: "outline" }), e),
|
|
608
|
-
...t
|
|
609
|
-
});
|
|
610
|
-
}
|
|
611
|
-
//#endregion
|
|
612
545
|
//#region src/shared/components/ui/dropdown-menu.tsx
|
|
613
546
|
function J({ ...e }) {
|
|
614
|
-
return /* @__PURE__ */
|
|
547
|
+
return /* @__PURE__ */ N(B.Root, {
|
|
615
548
|
"data-slot": "dropdown-menu",
|
|
616
549
|
...e
|
|
617
550
|
});
|
|
618
551
|
}
|
|
619
552
|
function Y({ ...e }) {
|
|
620
|
-
return /* @__PURE__ */
|
|
553
|
+
return /* @__PURE__ */ N(B.Trigger, {
|
|
621
554
|
"data-slot": "dropdown-menu-trigger",
|
|
622
555
|
...e
|
|
623
556
|
});
|
|
624
557
|
}
|
|
625
558
|
function X({ className: e, sideOffset: t = 4, ...n }) {
|
|
626
|
-
return /* @__PURE__ */
|
|
559
|
+
return /* @__PURE__ */ N(B.Portal, { children: /* @__PURE__ */ N(B.Content, {
|
|
627
560
|
"data-slot": "dropdown-menu-content",
|
|
628
561
|
sideOffset: t,
|
|
629
562
|
className: d("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in", e),
|
|
630
563
|
...n
|
|
631
564
|
}) });
|
|
632
565
|
}
|
|
633
|
-
function
|
|
634
|
-
return /* @__PURE__ */
|
|
566
|
+
function Rt({ ...e }) {
|
|
567
|
+
return /* @__PURE__ */ N(B.Group, {
|
|
635
568
|
"data-slot": "dropdown-menu-group",
|
|
636
569
|
...e
|
|
637
570
|
});
|
|
638
571
|
}
|
|
639
572
|
function Z({ className: e, inset: t, variant: n = "default", ...r }) {
|
|
640
|
-
return /* @__PURE__ */
|
|
573
|
+
return /* @__PURE__ */ N(B.Item, {
|
|
641
574
|
"data-slot": "dropdown-menu-item",
|
|
642
575
|
"data-inset": t,
|
|
643
576
|
"data-variant": n,
|
|
@@ -645,16 +578,16 @@ function Z({ className: e, inset: t, variant: n = "default", ...r }) {
|
|
|
645
578
|
...r
|
|
646
579
|
});
|
|
647
580
|
}
|
|
648
|
-
function
|
|
649
|
-
return /* @__PURE__ */
|
|
581
|
+
function zt({ className: e, inset: t, ...n }) {
|
|
582
|
+
return /* @__PURE__ */ N(B.Label, {
|
|
650
583
|
"data-slot": "dropdown-menu-label",
|
|
651
584
|
"data-inset": t,
|
|
652
585
|
className: d("px-1.5 py-1 font-medium text-muted-foreground text-xs data-[inset]:pl-7", e),
|
|
653
586
|
...n
|
|
654
587
|
});
|
|
655
588
|
}
|
|
656
|
-
function
|
|
657
|
-
return /* @__PURE__ */
|
|
589
|
+
function Bt({ className: e, ...t }) {
|
|
590
|
+
return /* @__PURE__ */ N(B.Separator, {
|
|
658
591
|
"data-slot": "dropdown-menu-separator",
|
|
659
592
|
className: d("-mx-1 my-1 h-px bg-border", e),
|
|
660
593
|
...t
|
|
@@ -662,48 +595,38 @@ function Zt({ className: e, ...t }) {
|
|
|
662
595
|
}
|
|
663
596
|
//#endregion
|
|
664
597
|
//#region src/editor/features/TreegeEditor/nodes/components/NodeMoreMenu.tsx
|
|
665
|
-
var
|
|
666
|
-
let {
|
|
667
|
-
return /* @__PURE__ */
|
|
598
|
+
var Vt = ({ nodeId: e, className: t }) => {
|
|
599
|
+
let { selectNode: n } = q(), { setIsNodeSheetOpen: r, openDeleteNodeConfirmation: i } = W(), a = G(), o = (e) => e.stopPropagation();
|
|
600
|
+
return /* @__PURE__ */ P(J, { children: [/* @__PURE__ */ N(Y, {
|
|
668
601
|
asChild: !0,
|
|
669
|
-
onClick:
|
|
670
|
-
children: /* @__PURE__ */
|
|
602
|
+
onClick: o,
|
|
603
|
+
children: /* @__PURE__ */ N("button", {
|
|
671
604
|
type: "button",
|
|
672
605
|
"aria-label": a("editor.nodeActionsSheet.editNode"),
|
|
673
606
|
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),
|
|
674
|
-
children: /* @__PURE__ */
|
|
607
|
+
children: /* @__PURE__ */ N($e, { className: "h-3.5 w-3.5" })
|
|
675
608
|
})
|
|
676
|
-
}), /* @__PURE__ */
|
|
609
|
+
}), /* @__PURE__ */ P(X, {
|
|
677
610
|
align: "end",
|
|
678
|
-
onClick:
|
|
611
|
+
onClick: o,
|
|
679
612
|
children: [
|
|
680
|
-
/* @__PURE__ */
|
|
613
|
+
/* @__PURE__ */ P(Z, {
|
|
681
614
|
onClick: () => {
|
|
682
|
-
|
|
615
|
+
n(e), r(!0);
|
|
683
616
|
},
|
|
684
|
-
children: [/* @__PURE__ */
|
|
617
|
+
children: [/* @__PURE__ */ N(ot, {}), a("common.settings")]
|
|
685
618
|
}),
|
|
686
|
-
/* @__PURE__ */
|
|
687
|
-
/* @__PURE__ */
|
|
619
|
+
/* @__PURE__ */ N(Bt, {}),
|
|
620
|
+
/* @__PURE__ */ P(Z, {
|
|
688
621
|
variant: "destructive",
|
|
689
|
-
onClick: () => s(!0),
|
|
690
|
-
children: [/* @__PURE__ */ M(lt, {}), a("common.delete")]
|
|
691
|
-
})
|
|
692
|
-
]
|
|
693
|
-
})] }), /* @__PURE__ */ M(Rt, {
|
|
694
|
-
open: o,
|
|
695
|
-
onOpenChange: s,
|
|
696
|
-
children: /* @__PURE__ */ N(Ht, {
|
|
697
|
-
onClick: c,
|
|
698
|
-
children: [/* @__PURE__ */ N(Ut, { children: [/* @__PURE__ */ M(Gt, { children: a("editor.nodeActionsSheet.deleteNode") }), /* @__PURE__ */ M(Kt, { children: a("editor.nodeActionsSheet.deleteNodeConfirm") })] }), /* @__PURE__ */ N(Wt, { children: [/* @__PURE__ */ M(Jt, { children: a("common.cancel") }), /* @__PURE__ */ M(qt, {
|
|
699
622
|
onClick: () => {
|
|
700
|
-
|
|
623
|
+
i(e);
|
|
701
624
|
},
|
|
702
|
-
children: a("common.delete")
|
|
703
|
-
})
|
|
704
|
-
|
|
625
|
+
children: [/* @__PURE__ */ N(ct, {}), a("common.delete")]
|
|
626
|
+
})
|
|
627
|
+
]
|
|
705
628
|
})] });
|
|
706
|
-
},
|
|
629
|
+
}, Ht = 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", {
|
|
707
630
|
defaultVariants: { variant: "default" },
|
|
708
631
|
variants: { variant: {
|
|
709
632
|
blue: "bg-blue-500 text-white dark:bg-blue-600",
|
|
@@ -714,45 +637,45 @@ var Qt = ({ nodeId: e, className: t }) => {
|
|
|
714
637
|
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90"
|
|
715
638
|
} }
|
|
716
639
|
});
|
|
717
|
-
function
|
|
718
|
-
return /* @__PURE__ */
|
|
640
|
+
function Ut({ className: e, variant: t, asChild: n = !1, ...r }) {
|
|
641
|
+
return /* @__PURE__ */ N(n ? xt : "span", {
|
|
719
642
|
"data-slot": "badge",
|
|
720
|
-
className: d(
|
|
643
|
+
className: d(Ht({ variant: t }), e),
|
|
721
644
|
...r
|
|
722
645
|
});
|
|
723
646
|
}
|
|
724
|
-
var
|
|
725
|
-
/* @__PURE__ */
|
|
726
|
-
/* @__PURE__ */
|
|
647
|
+
var Wt = ht(({ data: e, id: t }) => /* @__PURE__ */ P(M, { children: [
|
|
648
|
+
/* @__PURE__ */ N(ve, {}),
|
|
649
|
+
/* @__PURE__ */ N("div", {
|
|
727
650
|
className: "-top-3.5 absolute left-6",
|
|
728
|
-
children: /* @__PURE__ */
|
|
651
|
+
children: /* @__PURE__ */ P(Ut, {
|
|
729
652
|
className: "max-w-50 bg-chart-2",
|
|
730
|
-
children: [/* @__PURE__ */
|
|
653
|
+
children: [/* @__PURE__ */ N(ke, { className: "!w-3 !h-3" }), /* @__PURE__ */ N(Lt, {
|
|
731
654
|
nodeId: t,
|
|
732
655
|
label: e?.label,
|
|
733
656
|
className: "min-w-0 flex-1 text-xs text-white placeholder:text-white/60"
|
|
734
657
|
})]
|
|
735
658
|
})
|
|
736
659
|
}),
|
|
737
|
-
/* @__PURE__ */
|
|
738
|
-
] })),
|
|
660
|
+
/* @__PURE__ */ N(Vt, { nodeId: t })
|
|
661
|
+
] })), Gt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", Kt = (e = 21) => {
|
|
739
662
|
let t = "", n = crypto.getRandomValues(new Uint8Array(e |= 0));
|
|
740
|
-
for (; e--;) t +=
|
|
663
|
+
for (; e--;) t += Gt[n[e] & 63];
|
|
741
664
|
return t;
|
|
742
|
-
},
|
|
665
|
+
}, qt = {
|
|
743
666
|
data: { type: "text" },
|
|
744
|
-
id:
|
|
667
|
+
id: Kt(),
|
|
745
668
|
position: {
|
|
746
669
|
x: 0,
|
|
747
670
|
y: 0
|
|
748
671
|
},
|
|
749
672
|
type: "input"
|
|
750
|
-
},
|
|
751
|
-
let { setNodes: e, setEdges: t, screenToFlowPosition: n, getNode: r, getNodes: i, getEdges: a } =
|
|
673
|
+
}, Jt = () => {
|
|
674
|
+
let { setNodes: e, setEdges: t, screenToFlowPosition: n, getNode: r, getNodes: i, getEdges: a } = j(), o = R((n, r, i = !1, o) => {
|
|
752
675
|
let c = n.id, l = a().filter((e) => e.source === c), u = s(n);
|
|
753
676
|
if (l.length > 0 && !u) return;
|
|
754
|
-
let d =
|
|
755
|
-
...
|
|
677
|
+
let d = Kt(), f = {
|
|
678
|
+
...qt,
|
|
756
679
|
...o && {
|
|
757
680
|
data: o.data ?? {},
|
|
758
681
|
type: o.type
|
|
@@ -768,7 +691,7 @@ var tn = gt(({ data: e, id: t }) => /* @__PURE__ */ N(j, { children: [
|
|
|
768
691
|
operator: "===",
|
|
769
692
|
value: ""
|
|
770
693
|
}] } : void 0,
|
|
771
|
-
id:
|
|
694
|
+
id: Kt(),
|
|
772
695
|
source: c,
|
|
773
696
|
target: d,
|
|
774
697
|
type: t && u ? "conditional" : "default"
|
|
@@ -796,7 +719,7 @@ var tn = gt(({ data: e, id: t }) => /* @__PURE__ */ N(j, { children: [
|
|
|
796
719
|
a,
|
|
797
720
|
e,
|
|
798
721
|
t
|
|
799
|
-
]), c =
|
|
722
|
+
]), c = R((e) => {
|
|
800
723
|
t((t) => {
|
|
801
724
|
let n = Ce(e, t), i = e.source, a = r(i);
|
|
802
725
|
return n.filter((e) => e.source === i).length > 1 && a && s(a) ? n.map((e) => e.source === i ? {
|
|
@@ -812,7 +735,7 @@ var tn = gt(({ data: e, id: t }) => /* @__PURE__ */ N(j, { children: [
|
|
|
812
735
|
type: "conditional"
|
|
813
736
|
} : e) : n;
|
|
814
737
|
});
|
|
815
|
-
}, [t, r]), l =
|
|
738
|
+
}, [t, r]), l = R((e, t) => {
|
|
816
739
|
let n = r(e);
|
|
817
740
|
if (!n) return;
|
|
818
741
|
let s = getComputedStyle(document.documentElement).getPropertyValue("--node-height"), c = getComputedStyle(document.documentElement).getPropertyValue("--node-width"), l = parseFloat(s) || 100, u = parseFloat(c) || 100, d = n.position.y + l + 100, f = i(), p = a(), m = f.filter((t) => p.some((n) => n.source === e && n.target === t.id));
|
|
@@ -825,7 +748,7 @@ var tn = gt(({ data: e, id: t }) => /* @__PURE__ */ N(j, { children: [
|
|
|
825
748
|
i,
|
|
826
749
|
a,
|
|
827
750
|
o
|
|
828
|
-
]), u =
|
|
751
|
+
]), u = R((e, t) => {
|
|
829
752
|
if (!t.isValid) {
|
|
830
753
|
let { clientX: i, clientY: a } = "changedTouches" in e ? e.changedTouches[0] : e, s = t.fromNode;
|
|
831
754
|
if (!s) return;
|
|
@@ -845,7 +768,7 @@ var tn = gt(({ data: e, id: t }) => /* @__PURE__ */ N(j, { children: [
|
|
|
845
768
|
o,
|
|
846
769
|
r,
|
|
847
770
|
n
|
|
848
|
-
]), d =
|
|
771
|
+
]), d = R((e) => {
|
|
849
772
|
t((t) => {
|
|
850
773
|
let n = t.filter((t) => !e.find((e) => e.id === t.id)), r = new Set(e.map((e) => e.source)), i = /* @__PURE__ */ new Map();
|
|
851
774
|
return n.forEach((e) => {
|
|
@@ -864,7 +787,7 @@ var tn = gt(({ data: e, id: t }) => /* @__PURE__ */ N(j, { children: [
|
|
|
864
787
|
});
|
|
865
788
|
}, [t]);
|
|
866
789
|
return {
|
|
867
|
-
isValidConnection:
|
|
790
|
+
isValidConnection: R((e) => {
|
|
868
791
|
if (e.source === e.target) return !1;
|
|
869
792
|
let t = r(e.source);
|
|
870
793
|
return t ? !(a().filter((t) => t.source === e.source).length > 0 && !s(t)) : !1;
|
|
@@ -874,12 +797,12 @@ var tn = gt(({ data: e, id: t }) => /* @__PURE__ */ N(j, { children: [
|
|
|
874
797
|
onConnectEnd: u,
|
|
875
798
|
onEdgesDelete: d
|
|
876
799
|
};
|
|
877
|
-
},
|
|
800
|
+
}, Yt = {
|
|
878
801
|
divider: "divider",
|
|
879
802
|
title: "title"
|
|
880
|
-
},
|
|
881
|
-
let { onAddFromHandle: n } =
|
|
882
|
-
return /* @__PURE__ */
|
|
803
|
+
}, Xt = ({ nodeId: e, isConnectable: t }) => {
|
|
804
|
+
let { onAddFromHandle: n } = Jt(), r = G(), [i, o] = z(!1);
|
|
805
|
+
return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(ge, {
|
|
883
806
|
type: "source",
|
|
884
807
|
position: be.Bottom,
|
|
885
808
|
isConnectable: t,
|
|
@@ -887,22 +810,22 @@ var tn = gt(({ data: e, id: t }) => /* @__PURE__ */ N(j, { children: [
|
|
|
887
810
|
e.defaultPrevented || o(!0);
|
|
888
811
|
},
|
|
889
812
|
className: "flex h-6! w-6! cursor-pointer items-center justify-center rounded-sm transition-colors hover:bg-primary/80!",
|
|
890
|
-
children: /* @__PURE__ */
|
|
891
|
-
}), /* @__PURE__ */
|
|
813
|
+
children: /* @__PURE__ */ N(I, { className: "h-4 w-4 text-primary-foreground" })
|
|
814
|
+
}), /* @__PURE__ */ P(J, {
|
|
892
815
|
open: i,
|
|
893
816
|
onOpenChange: o,
|
|
894
|
-
children: [/* @__PURE__ */
|
|
817
|
+
children: [/* @__PURE__ */ N(Y, {
|
|
895
818
|
asChild: !0,
|
|
896
|
-
children: /* @__PURE__ */
|
|
819
|
+
children: /* @__PURE__ */ N("span", {
|
|
897
820
|
"aria-hidden": !0,
|
|
898
821
|
className: "-translate-x-1/2 pointer-events-none absolute bottom-0 left-1/2 h-0 w-0"
|
|
899
822
|
})
|
|
900
|
-
}), /* @__PURE__ */
|
|
823
|
+
}), /* @__PURE__ */ P(X, {
|
|
901
824
|
align: "center",
|
|
902
825
|
side: "bottom",
|
|
903
826
|
className: "treege-scrollbar max-h-80",
|
|
904
827
|
children: [
|
|
905
|
-
/* @__PURE__ */
|
|
828
|
+
/* @__PURE__ */ P(Rt, { children: [/* @__PURE__ */ N(zt, { children: r("editor.selectNodeType.options.input") }), Object.values(K).map((t) => /* @__PURE__ */ N(Z, {
|
|
906
829
|
onClick: () => n(e, {
|
|
907
830
|
data: { type: t },
|
|
908
831
|
type: a.input
|
|
@@ -910,8 +833,8 @@ var tn = gt(({ data: e, id: t }) => /* @__PURE__ */ N(j, { children: [
|
|
|
910
833
|
className: "capitalize",
|
|
911
834
|
children: t
|
|
912
835
|
}, t))] }),
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
/* @__PURE__ */
|
|
836
|
+
/* @__PURE__ */ N(Bt, {}),
|
|
837
|
+
/* @__PURE__ */ P(Rt, { children: [/* @__PURE__ */ N(zt, { children: r("editor.selectNodeType.options.ui") }), Object.values(Yt).map((t) => /* @__PURE__ */ N(Z, {
|
|
915
838
|
onClick: () => n(e, {
|
|
916
839
|
data: { type: t },
|
|
917
840
|
type: a.ui
|
|
@@ -919,8 +842,8 @@ var tn = gt(({ data: e, id: t }) => /* @__PURE__ */ N(j, { children: [
|
|
|
919
842
|
className: "capitalize",
|
|
920
843
|
children: t
|
|
921
844
|
}, t))] }),
|
|
922
|
-
/* @__PURE__ */
|
|
923
|
-
/* @__PURE__ */
|
|
845
|
+
/* @__PURE__ */ N(Bt, {}),
|
|
846
|
+
/* @__PURE__ */ P(Rt, { children: [/* @__PURE__ */ N(zt, { children: r("common.other") }), /* @__PURE__ */ N(Z, {
|
|
924
847
|
onClick: () => n(e, {
|
|
925
848
|
data: {},
|
|
926
849
|
type: a.flow
|
|
@@ -930,65 +853,65 @@ var tn = gt(({ data: e, id: t }) => /* @__PURE__ */ N(j, { children: [
|
|
|
930
853
|
]
|
|
931
854
|
})]
|
|
932
855
|
})] });
|
|
933
|
-
},
|
|
934
|
-
[K.address]:
|
|
935
|
-
[K.autocomplete]:
|
|
936
|
-
[K.checkbox]:
|
|
937
|
-
[K.date]:
|
|
938
|
-
[K.daterange]:
|
|
939
|
-
[K.file]:
|
|
940
|
-
[K.hidden]:
|
|
941
|
-
[K.http]:
|
|
942
|
-
[K.number]:
|
|
943
|
-
[K.password]:
|
|
944
|
-
[K.radio]:
|
|
945
|
-
[K.select]:
|
|
946
|
-
[K.submit]:
|
|
947
|
-
[K.switch]:
|
|
948
|
-
[K.text]:
|
|
949
|
-
[K.textarea]:
|
|
950
|
-
[K.time]:
|
|
951
|
-
[K.timerange]:
|
|
952
|
-
[
|
|
953
|
-
[
|
|
954
|
-
},
|
|
856
|
+
}, Zt = {
|
|
857
|
+
[K.address]: Ze,
|
|
858
|
+
[K.autocomplete]: it,
|
|
859
|
+
[K.checkbox]: Pe,
|
|
860
|
+
[K.date]: Ae,
|
|
861
|
+
[K.daterange]: je,
|
|
862
|
+
[K.file]: et,
|
|
863
|
+
[K.hidden]: Ue,
|
|
864
|
+
[K.http]: ze,
|
|
865
|
+
[K.number]: We,
|
|
866
|
+
[K.password]: qe,
|
|
867
|
+
[K.radio]: Le,
|
|
868
|
+
[K.select]: Ye,
|
|
869
|
+
[K.submit]: at,
|
|
870
|
+
[K.switch]: st,
|
|
871
|
+
[K.text]: Me,
|
|
872
|
+
[K.textarea]: De,
|
|
873
|
+
[K.time]: Re,
|
|
874
|
+
[K.timerange]: Re,
|
|
875
|
+
[Yt.divider]: Qe,
|
|
876
|
+
[Yt.title]: Ge
|
|
877
|
+
}, Qt = nt, $t = (e) => e && Zt[e] || Qt, en = {
|
|
955
878
|
input: Object.values(K),
|
|
956
|
-
ui: Object.values(
|
|
957
|
-
},
|
|
958
|
-
let { updateNodeData: r } = q(), i = G(), a =
|
|
959
|
-
return /* @__PURE__ */
|
|
879
|
+
ui: Object.values(Yt)
|
|
880
|
+
}, tn = ({ nodeId: e, type: t, inputType: n }) => {
|
|
881
|
+
let { updateNodeData: r } = q(), i = G(), a = en[t], o = (e) => e.stopPropagation();
|
|
882
|
+
return /* @__PURE__ */ P(J, { children: [/* @__PURE__ */ N(Y, {
|
|
960
883
|
asChild: !0,
|
|
961
884
|
onClick: o,
|
|
962
|
-
children: /* @__PURE__ */
|
|
885
|
+
children: /* @__PURE__ */ P(Ut, {
|
|
963
886
|
variant: "default",
|
|
964
887
|
className: "nodrag nopan cursor-pointer px-1.5 py-0 text-[10px] capitalize [&>svg]:size-2.5",
|
|
965
888
|
children: [
|
|
966
|
-
/* @__PURE__ */
|
|
889
|
+
/* @__PURE__ */ N($t(n), { className: "mt-0.5" }),
|
|
967
890
|
n || i("editor.selectInputType.type"),
|
|
968
|
-
/* @__PURE__ */
|
|
891
|
+
/* @__PURE__ */ N(Fe, {})
|
|
969
892
|
]
|
|
970
893
|
})
|
|
971
|
-
}), /* @__PURE__ */
|
|
894
|
+
}), /* @__PURE__ */ N(X, {
|
|
972
895
|
align: "start",
|
|
973
896
|
className: "treege-scrollbar max-h-60",
|
|
974
897
|
onClick: o,
|
|
975
898
|
children: a.map((t) => {
|
|
976
|
-
let i =
|
|
977
|
-
return /* @__PURE__ */
|
|
899
|
+
let i = $t(t);
|
|
900
|
+
return /* @__PURE__ */ P(Z, {
|
|
978
901
|
onClick: () => r(e, { type: t }),
|
|
979
902
|
className: d("capitalize", t === n && "bg-accent"),
|
|
980
|
-
children: [/* @__PURE__ */
|
|
903
|
+
children: [/* @__PURE__ */ N(i, {}), t]
|
|
981
904
|
}, t);
|
|
982
905
|
})
|
|
983
906
|
})] });
|
|
984
|
-
},
|
|
907
|
+
}, nn = [
|
|
985
908
|
"radio",
|
|
986
909
|
"select",
|
|
987
910
|
"checkbox",
|
|
988
911
|
"autocomplete"
|
|
989
|
-
],
|
|
912
|
+
], rn = ({ nodeId: e, data: t }) => {
|
|
990
913
|
let [n, r] = z(!1), [i, a] = z(""), [o, s] = z(""), { updateNodeData: c } = q(), { language: d } = W(), f = G(), h = t && "type" in t ? t.type : void 0;
|
|
991
|
-
if (!(h &&
|
|
914
|
+
if (!(h && nn.includes(h))) return null;
|
|
992
915
|
let g = t.options ?? [], v = () => {
|
|
993
916
|
a(""), s("");
|
|
994
917
|
}, y = (t) => {
|
|
@@ -1005,42 +928,42 @@ var tn = gt(({ data: e, id: t }) => /* @__PURE__ */ N(j, { children: [
|
|
|
1005
928
|
}, x = (e) => {
|
|
1006
929
|
e.key === "Enter" && (e.preventDefault(), y());
|
|
1007
930
|
}, S = (e) => e.stopPropagation();
|
|
1008
|
-
return /* @__PURE__ */
|
|
931
|
+
return /* @__PURE__ */ P("div", {
|
|
1009
932
|
className: "nodrag nopan my-1 flex flex-col gap-0.5",
|
|
1010
933
|
children: [g.map((e, t) => {
|
|
1011
934
|
let n = f(e.label) || e.value || "—", r = `${e.value || "opt"}-${t}`;
|
|
1012
|
-
return /* @__PURE__ */
|
|
935
|
+
return /* @__PURE__ */ N("div", {
|
|
1013
936
|
className: "truncate text-muted-foreground text-xs",
|
|
1014
937
|
children: n
|
|
1015
938
|
}, r);
|
|
1016
|
-
}), /* @__PURE__ */
|
|
939
|
+
}), /* @__PURE__ */ P(le, {
|
|
1017
940
|
open: n,
|
|
1018
941
|
onOpenChange: b,
|
|
1019
|
-
children: [/* @__PURE__ */
|
|
942
|
+
children: [/* @__PURE__ */ N(u, {
|
|
1020
943
|
asChild: !0,
|
|
1021
944
|
onClick: S,
|
|
1022
|
-
children: /* @__PURE__ */
|
|
945
|
+
children: /* @__PURE__ */ P(p, {
|
|
1023
946
|
type: "button",
|
|
1024
947
|
variant: "link",
|
|
1025
948
|
size: "xs",
|
|
1026
949
|
className: "w-fit p-0!",
|
|
1027
|
-
children: [/* @__PURE__ */
|
|
950
|
+
children: [/* @__PURE__ */ N(I, { className: "size-3" }), f("editor.inputNodeForm.addOption")]
|
|
1028
951
|
})
|
|
1029
|
-
}), /* @__PURE__ */
|
|
952
|
+
}), /* @__PURE__ */ N(_, {
|
|
1030
953
|
align: "start",
|
|
1031
954
|
className: "w-64 p-3",
|
|
1032
955
|
onClick: S,
|
|
1033
|
-
children: /* @__PURE__ */
|
|
956
|
+
children: /* @__PURE__ */ P("form", {
|
|
1034
957
|
onSubmit: y,
|
|
1035
958
|
className: "flex flex-col gap-2",
|
|
1036
959
|
children: [
|
|
1037
|
-
/* @__PURE__ */
|
|
960
|
+
/* @__PURE__ */ P("div", {
|
|
1038
961
|
className: "flex flex-col gap-1",
|
|
1039
|
-
children: [/* @__PURE__ */
|
|
962
|
+
children: [/* @__PURE__ */ N(l, {
|
|
1040
963
|
htmlFor: `${e}-option-label`,
|
|
1041
964
|
className: "text-xs",
|
|
1042
965
|
children: f("editor.inputNodeForm.optionLabel")
|
|
1043
|
-
}), /* @__PURE__ */
|
|
966
|
+
}), /* @__PURE__ */ N(m, {
|
|
1044
967
|
id: `${e}-option-label`,
|
|
1045
968
|
autoFocus: !0,
|
|
1046
969
|
value: i,
|
|
@@ -1048,20 +971,20 @@ var tn = gt(({ data: e, id: t }) => /* @__PURE__ */ N(j, { children: [
|
|
|
1048
971
|
onKeyDown: x
|
|
1049
972
|
})]
|
|
1050
973
|
}),
|
|
1051
|
-
/* @__PURE__ */
|
|
974
|
+
/* @__PURE__ */ P("div", {
|
|
1052
975
|
className: "flex flex-col gap-1",
|
|
1053
|
-
children: [/* @__PURE__ */
|
|
976
|
+
children: [/* @__PURE__ */ N(l, {
|
|
1054
977
|
htmlFor: `${e}-option-value`,
|
|
1055
978
|
className: "text-xs",
|
|
1056
979
|
children: f("editor.inputNodeForm.optionValue")
|
|
1057
|
-
}), /* @__PURE__ */
|
|
980
|
+
}), /* @__PURE__ */ N(m, {
|
|
1058
981
|
id: `${e}-option-value`,
|
|
1059
982
|
value: o,
|
|
1060
983
|
onChange: (e) => s(e.target.value),
|
|
1061
984
|
onKeyDown: x
|
|
1062
985
|
})]
|
|
1063
986
|
}),
|
|
1064
|
-
/* @__PURE__ */
|
|
987
|
+
/* @__PURE__ */ N(p, {
|
|
1065
988
|
type: "submit",
|
|
1066
989
|
size: "sm",
|
|
1067
990
|
disabled: !(i.trim() || o.trim()),
|
|
@@ -1072,13 +995,13 @@ var tn = gt(({ data: e, id: t }) => /* @__PURE__ */ N(j, { children: [
|
|
|
1072
995
|
})]
|
|
1073
996
|
})]
|
|
1074
997
|
});
|
|
1075
|
-
},
|
|
998
|
+
}, an = ({ nodeId: e, required: t }) => {
|
|
1076
999
|
let { updateNodeData: n } = q(), r = G();
|
|
1077
|
-
return /* @__PURE__ */
|
|
1000
|
+
return /* @__PURE__ */ N(Ut, {
|
|
1078
1001
|
variant: t ? "destructive" : "outline",
|
|
1079
1002
|
asChild: !0,
|
|
1080
1003
|
className: "nodrag nopan cursor-pointer px-1.5 py-0 text-[10px] capitalize [&>svg]:size-2.5",
|
|
1081
|
-
children: /* @__PURE__ */
|
|
1004
|
+
children: /* @__PURE__ */ N("button", {
|
|
1082
1005
|
type: "button",
|
|
1083
1006
|
onClick: (r) => {
|
|
1084
1007
|
r.stopPropagation(), n(e, { required: !t });
|
|
@@ -1086,54 +1009,139 @@ var tn = gt(({ data: e, id: t }) => /* @__PURE__ */ N(j, { children: [
|
|
|
1086
1009
|
children: r(t ? "editor.inputNodeForm.required" : "editor.inputNodeForm.optional")
|
|
1087
1010
|
})
|
|
1088
1011
|
});
|
|
1089
|
-
},
|
|
1012
|
+
}, on = ({ children: e, inGroup: t, isSubmit: n }) => /* @__PURE__ */ N("div", {
|
|
1090
1013
|
className: d("react-flow__node__wrapper relative", t && "in-group", n && "submit-type"),
|
|
1091
1014
|
children: e
|
|
1092
|
-
}),
|
|
1015
|
+
}), sn = ht(({ data: e, isConnectable: t, parentId: n, type: r, id: i }) => {
|
|
1093
1016
|
let a = r === "input" || r === "ui" ? e?.type : void 0, o = r === "input" && e?.type === "submit", s = r === "input" ? e?.name : void 0;
|
|
1094
|
-
return /* @__PURE__ */
|
|
1017
|
+
return /* @__PURE__ */ P(on, {
|
|
1095
1018
|
inGroup: !!n,
|
|
1096
1019
|
isSubmit: o,
|
|
1097
1020
|
children: [
|
|
1098
|
-
/* @__PURE__ */
|
|
1099
|
-
/* @__PURE__ */
|
|
1021
|
+
/* @__PURE__ */ N(Vt, { nodeId: i }),
|
|
1022
|
+
/* @__PURE__ */ N(ge, {
|
|
1100
1023
|
type: "target",
|
|
1101
1024
|
position: be.Top,
|
|
1102
1025
|
isConnectable: t,
|
|
1103
1026
|
isConnectableStart: r === "ui"
|
|
1104
1027
|
}),
|
|
1105
|
-
/* @__PURE__ */
|
|
1028
|
+
/* @__PURE__ */ N(Lt, {
|
|
1106
1029
|
nodeId: i,
|
|
1107
1030
|
label: e?.label,
|
|
1108
1031
|
placeholder: s,
|
|
1109
1032
|
className: d("py-1", r === "ui" && "capitalize")
|
|
1110
1033
|
}),
|
|
1111
|
-
/* @__PURE__ */
|
|
1034
|
+
/* @__PURE__ */ P("div", {
|
|
1112
1035
|
className: "mb-1 flex gap-1",
|
|
1113
|
-
children: [(r === "input" || r === "ui") && /* @__PURE__ */
|
|
1036
|
+
children: [(r === "input" || r === "ui") && /* @__PURE__ */ N(tn, {
|
|
1114
1037
|
nodeId: i,
|
|
1115
1038
|
type: r,
|
|
1116
1039
|
inputType: a
|
|
1117
|
-
}), r === "input" && !o && /* @__PURE__ */
|
|
1040
|
+
}), r === "input" && !o && /* @__PURE__ */ N(an, {
|
|
1118
1041
|
nodeId: i,
|
|
1119
1042
|
required: e?.required
|
|
1120
1043
|
})]
|
|
1121
1044
|
}),
|
|
1122
|
-
r === "input" && /* @__PURE__ */
|
|
1045
|
+
r === "input" && /* @__PURE__ */ N(rn, {
|
|
1123
1046
|
nodeId: i,
|
|
1124
1047
|
data: e
|
|
1125
1048
|
}),
|
|
1126
|
-
/* @__PURE__ */
|
|
1049
|
+
/* @__PURE__ */ N(Xt, {
|
|
1127
1050
|
nodeId: i,
|
|
1128
1051
|
isConnectable: t
|
|
1129
1052
|
})
|
|
1130
1053
|
]
|
|
1131
1054
|
});
|
|
1132
|
-
}),
|
|
1133
|
-
[a.flow]:
|
|
1134
|
-
[a.group]:
|
|
1135
|
-
[a.input]:
|
|
1136
|
-
[a.ui]:
|
|
1055
|
+
}), cn = {
|
|
1056
|
+
[a.flow]: sn,
|
|
1057
|
+
[a.group]: Wt,
|
|
1058
|
+
[a.input]: sn,
|
|
1059
|
+
[a.ui]: sn
|
|
1060
|
+
};
|
|
1061
|
+
//#endregion
|
|
1062
|
+
//#region src/shared/components/ui/alert-dialog.tsx
|
|
1063
|
+
function ln({ ...e }) {
|
|
1064
|
+
return /* @__PURE__ */ N(V.Root, {
|
|
1065
|
+
"data-slot": "alert-dialog",
|
|
1066
|
+
...e
|
|
1067
|
+
});
|
|
1068
|
+
}
|
|
1069
|
+
function un({ ...e }) {
|
|
1070
|
+
return /* @__PURE__ */ N(V.Portal, {
|
|
1071
|
+
"data-slot": "alert-dialog-portal",
|
|
1072
|
+
...e
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
function dn({ className: e, ...t }) {
|
|
1076
|
+
return /* @__PURE__ */ N(V.Overlay, {
|
|
1077
|
+
"data-slot": "alert-dialog-overlay",
|
|
1078
|
+
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),
|
|
1079
|
+
...t
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1082
|
+
function fn({ className: e, ...t }) {
|
|
1083
|
+
return /* @__PURE__ */ P(un, { children: [/* @__PURE__ */ N(dn, {}), /* @__PURE__ */ N(V.Content, {
|
|
1084
|
+
"data-slot": "alert-dialog-content",
|
|
1085
|
+
className: d("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg", e),
|
|
1086
|
+
...t
|
|
1087
|
+
})] });
|
|
1088
|
+
}
|
|
1089
|
+
function pn({ className: e, ...t }) {
|
|
1090
|
+
return /* @__PURE__ */ N("div", {
|
|
1091
|
+
"data-slot": "alert-dialog-header",
|
|
1092
|
+
className: d("flex flex-col gap-2 text-center sm:text-left", e),
|
|
1093
|
+
...t
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
1096
|
+
function mn({ className: e, ...t }) {
|
|
1097
|
+
return /* @__PURE__ */ N("div", {
|
|
1098
|
+
"data-slot": "alert-dialog-footer",
|
|
1099
|
+
className: d("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", e),
|
|
1100
|
+
...t
|
|
1101
|
+
});
|
|
1102
|
+
}
|
|
1103
|
+
function hn({ className: e, ...t }) {
|
|
1104
|
+
return /* @__PURE__ */ N(V.Title, {
|
|
1105
|
+
"data-slot": "alert-dialog-title",
|
|
1106
|
+
className: d("font-semibold text-lg", e),
|
|
1107
|
+
...t
|
|
1108
|
+
});
|
|
1109
|
+
}
|
|
1110
|
+
function gn({ className: e, ...t }) {
|
|
1111
|
+
return /* @__PURE__ */ N(V.Description, {
|
|
1112
|
+
"data-slot": "alert-dialog-description",
|
|
1113
|
+
className: d("text-muted-foreground text-sm", e),
|
|
1114
|
+
...t
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1117
|
+
function _n({ className: e, ...t }) {
|
|
1118
|
+
return /* @__PURE__ */ N(V.Action, {
|
|
1119
|
+
className: d(h(), e),
|
|
1120
|
+
...t
|
|
1121
|
+
});
|
|
1122
|
+
}
|
|
1123
|
+
function vn({ className: e, ...t }) {
|
|
1124
|
+
return /* @__PURE__ */ N(V.Cancel, {
|
|
1125
|
+
className: d(h({ variant: "outline" }), e),
|
|
1126
|
+
...t
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
//#endregion
|
|
1130
|
+
//#region src/editor/features/TreegeEditor/dialogs/DeleteNodeDialog.tsx
|
|
1131
|
+
var yn = () => {
|
|
1132
|
+
let { pendingDeleteNodeId: e, closeDeleteNodeConfirmation: t } = W(), { deleteNode: n } = q(), r = G();
|
|
1133
|
+
return /* @__PURE__ */ N(ln, {
|
|
1134
|
+
open: e !== null,
|
|
1135
|
+
onOpenChange: (e) => {
|
|
1136
|
+
e || t();
|
|
1137
|
+
},
|
|
1138
|
+
children: /* @__PURE__ */ P(fn, { children: [/* @__PURE__ */ P(pn, { children: [/* @__PURE__ */ N(hn, { children: r("editor.nodeActionsSheet.deleteNode") }), /* @__PURE__ */ N(gn, { children: r("editor.nodeActionsSheet.deleteNodeConfirm") })] }), /* @__PURE__ */ P(mn, { children: [/* @__PURE__ */ N(vn, { children: r("common.cancel") }), /* @__PURE__ */ N(_n, {
|
|
1139
|
+
onClick: () => {
|
|
1140
|
+
e && n(e), t();
|
|
1141
|
+
},
|
|
1142
|
+
children: r("common.delete")
|
|
1143
|
+
})] })] })
|
|
1144
|
+
});
|
|
1137
1145
|
}, bn = "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", xn = {
|
|
1138
1146
|
claude: "claude-3-5-haiku-20241022",
|
|
1139
1147
|
deepseek: "deepseek-chat",
|
|
@@ -1292,36 +1300,36 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1292
1300
|
s(!1);
|
|
1293
1301
|
}
|
|
1294
1302
|
};
|
|
1295
|
-
return /* @__PURE__ */
|
|
1303
|
+
return /* @__PURE__ */ P(ce, {
|
|
1296
1304
|
open: n,
|
|
1297
1305
|
onOpenChange: r,
|
|
1298
|
-
children: [/* @__PURE__ */
|
|
1306
|
+
children: [/* @__PURE__ */ N(w, {
|
|
1299
1307
|
asChild: !0,
|
|
1300
|
-
children: /* @__PURE__ */
|
|
1308
|
+
children: /* @__PURE__ */ P(p, {
|
|
1301
1309
|
variant: "outline",
|
|
1302
1310
|
size: "sm",
|
|
1303
1311
|
disabled: !e?.apiKey,
|
|
1304
1312
|
children: [
|
|
1305
|
-
/* @__PURE__ */
|
|
1313
|
+
/* @__PURE__ */ N(dt, { className: "h-4 w-4 text-[#13d3b4]" }),
|
|
1306
1314
|
" ",
|
|
1307
1315
|
c("editor.aiGenerator.buttonLabel")
|
|
1308
1316
|
]
|
|
1309
1317
|
})
|
|
1310
|
-
}), /* @__PURE__ */
|
|
1318
|
+
}), /* @__PURE__ */ P(S, {
|
|
1311
1319
|
className: "sm:max-w-[550px]",
|
|
1312
1320
|
children: [
|
|
1313
|
-
/* @__PURE__ */
|
|
1314
|
-
/* @__PURE__ */
|
|
1321
|
+
/* @__PURE__ */ P(re, { children: [/* @__PURE__ */ N(ee, { children: c("editor.aiGenerator.title") }), /* @__PURE__ */ N(C, { children: c("editor.aiGenerator.titleDescription") })] }),
|
|
1322
|
+
/* @__PURE__ */ P("div", {
|
|
1315
1323
|
className: "grid gap-4 py-4",
|
|
1316
|
-
children: [/* @__PURE__ */
|
|
1324
|
+
children: [/* @__PURE__ */ P("div", {
|
|
1317
1325
|
className: "grid gap-2",
|
|
1318
1326
|
children: [
|
|
1319
|
-
/* @__PURE__ */
|
|
1327
|
+
/* @__PURE__ */ N("label", {
|
|
1320
1328
|
htmlFor: "ai-prompt",
|
|
1321
1329
|
className: "font-medium text-sm",
|
|
1322
1330
|
children: c("editor.aiGenerator.description")
|
|
1323
1331
|
}),
|
|
1324
|
-
/* @__PURE__ */
|
|
1332
|
+
/* @__PURE__ */ N(ne, {
|
|
1325
1333
|
placeholder: c("editor.aiGenerator.descriptionPlaceholder"),
|
|
1326
1334
|
value: i,
|
|
1327
1335
|
onChange: (e) => a(e.target.value),
|
|
@@ -1332,22 +1340,22 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1332
1340
|
disabled: o,
|
|
1333
1341
|
className: "resize-none"
|
|
1334
1342
|
}),
|
|
1335
|
-
/* @__PURE__ */
|
|
1343
|
+
/* @__PURE__ */ N("p", {
|
|
1336
1344
|
className: "text-muted-foreground text-xs",
|
|
1337
1345
|
children: c("editor.aiGenerator.keyboardShortcut").replace("{cmdEnter}", "⌘ Enter").replace("{ctrlEnter}", "Ctrl Enter")
|
|
1338
1346
|
})
|
|
1339
1347
|
]
|
|
1340
|
-
}), !e?.apiKey && /* @__PURE__ */
|
|
1348
|
+
}), !e?.apiKey && /* @__PURE__ */ P("div", {
|
|
1341
1349
|
className: "rounded-md bg-muted p-3 text-sm",
|
|
1342
|
-
children: [/* @__PURE__ */
|
|
1350
|
+
children: [/* @__PURE__ */ N("p", {
|
|
1343
1351
|
className: "font-medium",
|
|
1344
1352
|
children: c("editor.aiGenerator.aiNotConfigured")
|
|
1345
|
-
}), /* @__PURE__ */
|
|
1353
|
+
}), /* @__PURE__ */ P("p", {
|
|
1346
1354
|
className: "mt-1 text-muted-foreground text-xs",
|
|
1347
1355
|
children: [
|
|
1348
1356
|
c("editor.aiGenerator.aiNotConfiguredDesc").replace("{code}", ""),
|
|
1349
1357
|
" ",
|
|
1350
|
-
/* @__PURE__ */
|
|
1358
|
+
/* @__PURE__ */ N("code", {
|
|
1351
1359
|
className: "rounded bg-background px-1 py-0.5",
|
|
1352
1360
|
children: "aiConfig"
|
|
1353
1361
|
})
|
|
@@ -1355,28 +1363,28 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1355
1363
|
})]
|
|
1356
1364
|
})]
|
|
1357
1365
|
}),
|
|
1358
|
-
/* @__PURE__ */
|
|
1366
|
+
/* @__PURE__ */ P(ae, { children: [/* @__PURE__ */ N(p, {
|
|
1359
1367
|
variant: "outline",
|
|
1360
1368
|
onClick: () => r(!1),
|
|
1361
1369
|
disabled: o,
|
|
1362
1370
|
children: c("editor.aiGenerator.cancel")
|
|
1363
|
-
}), /* @__PURE__ */
|
|
1371
|
+
}), /* @__PURE__ */ N(p, {
|
|
1364
1372
|
onClick: l,
|
|
1365
1373
|
disabled: o || !i.trim() || !e?.apiKey,
|
|
1366
|
-
children: o ? /* @__PURE__ */
|
|
1374
|
+
children: o ? /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(Xe, { className: "h-4 w-4 animate-spin" }), c("editor.aiGenerator.generating")] }) : /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(dt, { className: "h-4 w-4 text-[--treege-color-primary]" }), c("editor.aiGenerator.generate")] })
|
|
1367
1375
|
})] })
|
|
1368
1376
|
]
|
|
1369
1377
|
})]
|
|
1370
1378
|
});
|
|
1371
|
-
}, An =
|
|
1372
|
-
let { flowId: n, setFlowId: r, aiConfig: i } = W(), { setNodes: a, setEdges: o, addNodes: s, screenToFlowPosition: c } =
|
|
1379
|
+
}, An = Kt(), jn = ({ onExportJson: e, onSave: t }) => {
|
|
1380
|
+
let { flowId: n, setFlowId: r, aiConfig: i } = W(), { setNodes: a, setEdges: o, addNodes: s, screenToFlowPosition: c } = j(), l = n || An, u = Ee(), d = Te(), f = bt(null), m = G(), h = () => {
|
|
1373
1381
|
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({
|
|
1374
1382
|
x: e - n,
|
|
1375
1383
|
y: t - r
|
|
1376
1384
|
});
|
|
1377
1385
|
s([{
|
|
1378
|
-
...
|
|
1379
|
-
id:
|
|
1386
|
+
...qt,
|
|
1387
|
+
id: Kt(),
|
|
1380
1388
|
position: i,
|
|
1381
1389
|
selected: !0
|
|
1382
1390
|
}]);
|
|
@@ -1400,7 +1408,7 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1400
1408
|
nodes: u
|
|
1401
1409
|
}, i = new Blob([JSON.stringify(t, null, 2)], { type: "application/json" }), a = URL.createObjectURL(i), o = document.createElement("a");
|
|
1402
1410
|
o.href = a, o.download = "treege.json", o.click(), URL.revokeObjectURL(a), H.success(m("editor.actionsPanel.downloadSuccess"), { description: m("editor.actionsPanel.downloadSuccessDesc") }), n || r?.(l), e?.(t);
|
|
1403
|
-
}, v =
|
|
1411
|
+
}, v = R(() => {
|
|
1404
1412
|
n || r?.(l), t?.({
|
|
1405
1413
|
edges: d,
|
|
1406
1414
|
id: l,
|
|
@@ -1414,61 +1422,61 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1414
1422
|
t,
|
|
1415
1423
|
r
|
|
1416
1424
|
]);
|
|
1417
|
-
return
|
|
1425
|
+
return _t(() => {
|
|
1418
1426
|
let e = (e) => {
|
|
1419
1427
|
(e.ctrlKey || e.metaKey) && e.key === "s" && (e.preventDefault(), v());
|
|
1420
1428
|
};
|
|
1421
1429
|
return window.addEventListener("keydown", e), () => {
|
|
1422
1430
|
window.removeEventListener("keydown", e);
|
|
1423
1431
|
};
|
|
1424
|
-
}, [v]), /* @__PURE__ */
|
|
1432
|
+
}, [v]), /* @__PURE__ */ P(ye, {
|
|
1425
1433
|
position: "top-right",
|
|
1426
1434
|
className: "flex gap-2",
|
|
1427
1435
|
children: [
|
|
1428
|
-
/* @__PURE__ */
|
|
1436
|
+
/* @__PURE__ */ N(kn, {
|
|
1429
1437
|
aiConfig: i,
|
|
1430
1438
|
onGenerate: (e) => {
|
|
1431
1439
|
a(e.nodes), o(e.edges);
|
|
1432
1440
|
}
|
|
1433
1441
|
}),
|
|
1434
|
-
/* @__PURE__ */
|
|
1442
|
+
/* @__PURE__ */ P(p, {
|
|
1435
1443
|
variant: "outline",
|
|
1436
1444
|
size: "sm",
|
|
1437
1445
|
onClick: h,
|
|
1438
1446
|
children: [
|
|
1439
|
-
/* @__PURE__ */
|
|
1447
|
+
/* @__PURE__ */ N(I, {}),
|
|
1440
1448
|
" ",
|
|
1441
1449
|
m("editor.actionsPanel.addNode")
|
|
1442
1450
|
]
|
|
1443
1451
|
}),
|
|
1444
|
-
/* @__PURE__ */
|
|
1452
|
+
/* @__PURE__ */ P(p, {
|
|
1445
1453
|
variant: "outline",
|
|
1446
1454
|
size: "sm",
|
|
1447
1455
|
onClick: v,
|
|
1448
1456
|
children: [
|
|
1449
|
-
/* @__PURE__ */
|
|
1457
|
+
/* @__PURE__ */ N(rt, {}),
|
|
1450
1458
|
" ",
|
|
1451
1459
|
m("common.save")
|
|
1452
1460
|
]
|
|
1453
1461
|
}),
|
|
1454
|
-
/* @__PURE__ */
|
|
1462
|
+
/* @__PURE__ */ P(J, { children: [/* @__PURE__ */ N(Y, {
|
|
1455
1463
|
asChild: !0,
|
|
1456
|
-
children: /* @__PURE__ */
|
|
1464
|
+
children: /* @__PURE__ */ N(p, {
|
|
1457
1465
|
variant: "outline",
|
|
1458
1466
|
size: "sm",
|
|
1459
|
-
children: /* @__PURE__ */
|
|
1467
|
+
children: /* @__PURE__ */ N(He, {})
|
|
1460
1468
|
})
|
|
1461
|
-
}), /* @__PURE__ */
|
|
1469
|
+
}), /* @__PURE__ */ P(X, {
|
|
1462
1470
|
align: "start",
|
|
1463
1471
|
children: [
|
|
1464
|
-
/* @__PURE__ */
|
|
1472
|
+
/* @__PURE__ */ N(zt, {
|
|
1465
1473
|
className: "font-normal",
|
|
1466
|
-
children: /* @__PURE__ */
|
|
1474
|
+
children: /* @__PURE__ */ P("div", {
|
|
1467
1475
|
className: "flex flex-col gap-1",
|
|
1468
|
-
children: [/* @__PURE__ */
|
|
1476
|
+
children: [/* @__PURE__ */ N("span", {
|
|
1469
1477
|
className: "text-muted-foreground text-xs",
|
|
1470
1478
|
children: "Flow ID"
|
|
1471
|
-
}), /* @__PURE__ */
|
|
1479
|
+
}), /* @__PURE__ */ P("button", {
|
|
1472
1480
|
onClick: async () => {
|
|
1473
1481
|
try {
|
|
1474
1482
|
await navigator.clipboard.writeText(l), H.success(m("editor.actionsPanel.idCopied"), { description: l });
|
|
@@ -1478,44 +1486,44 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1478
1486
|
},
|
|
1479
1487
|
className: "flex items-center gap-2 font-mono text-muted-foreground transition-colors hover:text-primary",
|
|
1480
1488
|
type: "button",
|
|
1481
|
-
children: [/* @__PURE__ */
|
|
1489
|
+
children: [/* @__PURE__ */ N(Be, { className: "h-3 w-3" }), /* @__PURE__ */ N("span", {
|
|
1482
1490
|
className: "truncate text-xs",
|
|
1483
1491
|
children: l
|
|
1484
1492
|
})]
|
|
1485
1493
|
})]
|
|
1486
1494
|
})
|
|
1487
1495
|
}),
|
|
1488
|
-
/* @__PURE__ */
|
|
1489
|
-
/* @__PURE__ */
|
|
1496
|
+
/* @__PURE__ */ N(Bt, {}),
|
|
1497
|
+
/* @__PURE__ */ P(Rt, { children: [/* @__PURE__ */ P(Z, {
|
|
1490
1498
|
onClick: () => f?.current?.click(),
|
|
1491
1499
|
children: [
|
|
1492
|
-
/* @__PURE__ */
|
|
1500
|
+
/* @__PURE__ */ N(Ve, {}),
|
|
1493
1501
|
" ",
|
|
1494
1502
|
m("editor.actionsPanel.importJson")
|
|
1495
1503
|
]
|
|
1496
|
-
}), /* @__PURE__ */
|
|
1504
|
+
}), /* @__PURE__ */ P(Z, {
|
|
1497
1505
|
onClick: _,
|
|
1498
1506
|
children: [
|
|
1499
|
-
/* @__PURE__ */
|
|
1507
|
+
/* @__PURE__ */ N(Oe, {}),
|
|
1500
1508
|
" ",
|
|
1501
1509
|
m("editor.actionsPanel.exportJson")
|
|
1502
1510
|
]
|
|
1503
1511
|
})] }),
|
|
1504
|
-
/* @__PURE__ */
|
|
1505
|
-
/* @__PURE__ */
|
|
1512
|
+
/* @__PURE__ */ N(Bt, {}),
|
|
1513
|
+
/* @__PURE__ */ N(Rt, { children: /* @__PURE__ */ P(Z, {
|
|
1506
1514
|
onClick: () => {
|
|
1507
1515
|
a([]), o([]), H.success(m("editor.actionsPanel.clearSuccess"), { description: m("editor.actionsPanel.clearSuccessDesc") });
|
|
1508
1516
|
},
|
|
1509
1517
|
className: "text-destructive focus:text-destructive",
|
|
1510
1518
|
children: [
|
|
1511
|
-
/* @__PURE__ */
|
|
1519
|
+
/* @__PURE__ */ N(ct, { className: "text-destructive" }),
|
|
1512
1520
|
" ",
|
|
1513
1521
|
m("editor.actionsPanel.clear")
|
|
1514
1522
|
]
|
|
1515
1523
|
}) })
|
|
1516
1524
|
]
|
|
1517
1525
|
})] }),
|
|
1518
|
-
/* @__PURE__ */
|
|
1526
|
+
/* @__PURE__ */ N("input", {
|
|
1519
1527
|
type: "file",
|
|
1520
1528
|
accept: "application/json,.json",
|
|
1521
1529
|
className: "hidden",
|
|
@@ -1532,19 +1540,19 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1532
1540
|
fr: "fr",
|
|
1533
1541
|
it: "it",
|
|
1534
1542
|
pt: "pt"
|
|
1535
|
-
}, Q = ({ value: e = "en", onValueChange: t }) => /* @__PURE__ */
|
|
1543
|
+
}, Q = ({ value: e = "en", onValueChange: t }) => /* @__PURE__ */ P(v, {
|
|
1536
1544
|
value: e,
|
|
1537
1545
|
onValueChange: t,
|
|
1538
|
-
children: [/* @__PURE__ */
|
|
1546
|
+
children: [/* @__PURE__ */ N(g, {
|
|
1539
1547
|
className: "uppercase",
|
|
1540
|
-
children: /* @__PURE__ */
|
|
1541
|
-
}), /* @__PURE__ */
|
|
1548
|
+
children: /* @__PURE__ */ N(c, { placeholder: "" })
|
|
1549
|
+
}), /* @__PURE__ */ N(k, { children: /* @__PURE__ */ N(A, { children: Object.values(Mn).map((e) => /* @__PURE__ */ N(b, {
|
|
1542
1550
|
value: e,
|
|
1543
1551
|
className: "uppercase",
|
|
1544
1552
|
children: e
|
|
1545
1553
|
}, e)) }) })]
|
|
1546
1554
|
}), $ = () => {
|
|
1547
|
-
let e = Ee(), t =
|
|
1555
|
+
let e = Ee(), t = yt(() => e.filter(i), [e]), n = yt(() => e.filter((e) => e.selected), [e]), r = yt(() => e.find((e) => e.selected), [e]);
|
|
1548
1556
|
return {
|
|
1549
1557
|
groupNodes: t,
|
|
1550
1558
|
hasSelectedNodes: n.length > 0,
|
|
@@ -1553,7 +1561,7 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1553
1561
|
selectedNodes: n
|
|
1554
1562
|
};
|
|
1555
1563
|
}, Nn = () => {
|
|
1556
|
-
let [e, t] = z("en"), { updateSelectedNodeData: n } = q(), { selectedNode: r } = $(), i = G(), { Field: a } =
|
|
1564
|
+
let [e, t] = z("en"), { updateSelectedNodeData: n } = q(), { selectedNode: r } = $(), i = G(), { Field: a } = F({
|
|
1557
1565
|
defaultValues: {
|
|
1558
1566
|
label: r?.data?.label || { en: "" },
|
|
1559
1567
|
targetId: r?.data?.targetId || ""
|
|
@@ -1568,22 +1576,22 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1568
1576
|
n(e);
|
|
1569
1577
|
}
|
|
1570
1578
|
});
|
|
1571
|
-
return /* @__PURE__ */
|
|
1579
|
+
return /* @__PURE__ */ N("form", {
|
|
1572
1580
|
onSubmit: (e) => {
|
|
1573
1581
|
e.preventDefault(), e.stopPropagation();
|
|
1574
1582
|
},
|
|
1575
|
-
children: /* @__PURE__ */
|
|
1583
|
+
children: /* @__PURE__ */ P("div", {
|
|
1576
1584
|
className: "grid gap-6",
|
|
1577
|
-
children: [/* @__PURE__ */
|
|
1585
|
+
children: [/* @__PURE__ */ P("div", {
|
|
1578
1586
|
className: "flex items-end gap-2",
|
|
1579
|
-
children: [/* @__PURE__ */
|
|
1587
|
+
children: [/* @__PURE__ */ N(a, {
|
|
1580
1588
|
name: "label",
|
|
1581
|
-
children: (t) => /* @__PURE__ */
|
|
1589
|
+
children: (t) => /* @__PURE__ */ P(T, {
|
|
1582
1590
|
className: "flex-1",
|
|
1583
|
-
children: [/* @__PURE__ */
|
|
1591
|
+
children: [/* @__PURE__ */ N(l, {
|
|
1584
1592
|
htmlFor: t.name,
|
|
1585
1593
|
children: i("editor.flowNodeForm.label")
|
|
1586
|
-
}), /* @__PURE__ */
|
|
1594
|
+
}), /* @__PURE__ */ N(m, {
|
|
1587
1595
|
id: t.name,
|
|
1588
1596
|
name: t.name,
|
|
1589
1597
|
value: t.state.value?.[e] || "",
|
|
@@ -1596,31 +1604,31 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1596
1604
|
}
|
|
1597
1605
|
})]
|
|
1598
1606
|
})
|
|
1599
|
-
}), /* @__PURE__ */
|
|
1607
|
+
}), /* @__PURE__ */ N(Q, {
|
|
1600
1608
|
value: e,
|
|
1601
1609
|
onValueChange: t
|
|
1602
1610
|
})]
|
|
1603
|
-
}), /* @__PURE__ */
|
|
1611
|
+
}), /* @__PURE__ */ N(a, {
|
|
1604
1612
|
name: "targetId",
|
|
1605
|
-
children: (e) => /* @__PURE__ */
|
|
1606
|
-
/* @__PURE__ */
|
|
1613
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [
|
|
1614
|
+
/* @__PURE__ */ P(l, {
|
|
1607
1615
|
htmlFor: e.name,
|
|
1608
1616
|
children: [i("editor.flowNodeForm.targetId"), " (Flow ID)"]
|
|
1609
1617
|
}),
|
|
1610
|
-
/* @__PURE__ */
|
|
1618
|
+
/* @__PURE__ */ N(m, {
|
|
1611
1619
|
id: e.name,
|
|
1612
1620
|
name: e.name,
|
|
1613
1621
|
value: e.state.value,
|
|
1614
1622
|
onBlur: e.handleBlur,
|
|
1615
1623
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
1616
1624
|
}),
|
|
1617
|
-
/* @__PURE__ */
|
|
1625
|
+
/* @__PURE__ */ N(E, { children: "Unique identifier of the target flow." })
|
|
1618
1626
|
] })
|
|
1619
1627
|
})]
|
|
1620
1628
|
})
|
|
1621
1629
|
});
|
|
1622
1630
|
}, Pn = () => {
|
|
1623
|
-
let [e, t] = z("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = q(), { Field: i } =
|
|
1631
|
+
let [e, t] = z("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = q(), { Field: i } = F({
|
|
1624
1632
|
defaultValues: { label: n?.data?.label || { en: "" } },
|
|
1625
1633
|
listeners: {
|
|
1626
1634
|
onChange: ({ formApi: e }) => {
|
|
@@ -1632,20 +1640,20 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1632
1640
|
r(e);
|
|
1633
1641
|
}
|
|
1634
1642
|
});
|
|
1635
|
-
return /* @__PURE__ */
|
|
1643
|
+
return /* @__PURE__ */ N("form", {
|
|
1636
1644
|
onSubmit: (e) => {
|
|
1637
1645
|
e.preventDefault(), e.stopPropagation();
|
|
1638
1646
|
},
|
|
1639
|
-
children: /* @__PURE__ */
|
|
1647
|
+
children: /* @__PURE__ */ P("div", {
|
|
1640
1648
|
className: "flex items-end gap-2",
|
|
1641
|
-
children: [/* @__PURE__ */
|
|
1649
|
+
children: [/* @__PURE__ */ N(i, {
|
|
1642
1650
|
name: "label",
|
|
1643
|
-
children: (t) => /* @__PURE__ */
|
|
1651
|
+
children: (t) => /* @__PURE__ */ P(T, {
|
|
1644
1652
|
className: "flex-1",
|
|
1645
|
-
children: [/* @__PURE__ */
|
|
1653
|
+
children: [/* @__PURE__ */ N(l, {
|
|
1646
1654
|
htmlFor: t.name,
|
|
1647
1655
|
children: "Label"
|
|
1648
|
-
}), /* @__PURE__ */
|
|
1656
|
+
}), /* @__PURE__ */ N(m, {
|
|
1649
1657
|
id: t.name,
|
|
1650
1658
|
name: t.name,
|
|
1651
1659
|
value: t.state.value?.[e] || "",
|
|
@@ -1658,7 +1666,7 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1658
1666
|
}
|
|
1659
1667
|
})]
|
|
1660
1668
|
})
|
|
1661
|
-
}), /* @__PURE__ */
|
|
1669
|
+
}), /* @__PURE__ */ N(Q, {
|
|
1662
1670
|
value: e,
|
|
1663
1671
|
onValueChange: t
|
|
1664
1672
|
})]
|
|
@@ -1669,7 +1677,7 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1669
1677
|
"PUT",
|
|
1670
1678
|
"PATCH"
|
|
1671
1679
|
], In = ({ value: e, onChange: t }) => {
|
|
1672
|
-
let { selectedNode: n } = $(), r = G(), i = At(n?.id), { handleSubmit: a, Field: o, Subscribe: s } =
|
|
1680
|
+
let { selectedNode: n } = $(), r = G(), i = At(n?.id), { handleSubmit: a, Field: o, Subscribe: s } = F({
|
|
1673
1681
|
defaultValues: {
|
|
1674
1682
|
body: e?.body || "",
|
|
1675
1683
|
fetchOnMount: e?.fetchOnMount ?? !e?.searchParam,
|
|
@@ -1695,19 +1703,19 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1695
1703
|
t(e);
|
|
1696
1704
|
}
|
|
1697
1705
|
});
|
|
1698
|
-
return /* @__PURE__ */
|
|
1706
|
+
return /* @__PURE__ */ N("div", { children: /* @__PURE__ */ P("div", {
|
|
1699
1707
|
className: "grid gap-6",
|
|
1700
1708
|
children: [
|
|
1701
|
-
/* @__PURE__ */
|
|
1709
|
+
/* @__PURE__ */ N(o, {
|
|
1702
1710
|
name: "url",
|
|
1703
|
-
children: (e) => /* @__PURE__ */
|
|
1704
|
-
/* @__PURE__ */
|
|
1711
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [
|
|
1712
|
+
/* @__PURE__ */ N(l, {
|
|
1705
1713
|
htmlFor: e.name,
|
|
1706
1714
|
children: r("editor.httpConfigForm.apiUrl")
|
|
1707
1715
|
}),
|
|
1708
|
-
/* @__PURE__ */
|
|
1716
|
+
/* @__PURE__ */ P("div", {
|
|
1709
1717
|
className: "flex gap-2",
|
|
1710
|
-
children: [/* @__PURE__ */
|
|
1718
|
+
children: [/* @__PURE__ */ N(m, {
|
|
1711
1719
|
id: e.name,
|
|
1712
1720
|
name: e.name,
|
|
1713
1721
|
value: e.state.value,
|
|
@@ -1715,30 +1723,30 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1715
1723
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
1716
1724
|
placeholder: r("editor.httpConfigForm.apiUrlPlaceholder"),
|
|
1717
1725
|
className: "flex-1"
|
|
1718
|
-
}), /* @__PURE__ */
|
|
1726
|
+
}), /* @__PURE__ */ P(J, { children: [/* @__PURE__ */ N(Y, {
|
|
1719
1727
|
asChild: !0,
|
|
1720
|
-
children: /* @__PURE__ */
|
|
1728
|
+
children: /* @__PURE__ */ N(p, {
|
|
1721
1729
|
type: "button",
|
|
1722
1730
|
variant: "outline",
|
|
1723
1731
|
size: "icon",
|
|
1724
|
-
children: /* @__PURE__ */
|
|
1732
|
+
children: /* @__PURE__ */ N(ut, { className: "h-4 w-4" })
|
|
1725
1733
|
})
|
|
1726
|
-
}), /* @__PURE__ */
|
|
1734
|
+
}), /* @__PURE__ */ N(X, {
|
|
1727
1735
|
align: "end",
|
|
1728
|
-
children: i.length === 0 ? /* @__PURE__ */
|
|
1736
|
+
children: i.length === 0 ? /* @__PURE__ */ N(Z, {
|
|
1729
1737
|
disabled: !0,
|
|
1730
1738
|
children: r("editor.httpConfigForm.noFieldsAvailable")
|
|
1731
|
-
}) : i.map((t) => /* @__PURE__ */
|
|
1739
|
+
}) : i.map((t) => /* @__PURE__ */ N(Z, {
|
|
1732
1740
|
onClick: () => {
|
|
1733
1741
|
let n = `{{${t.nodeId}}}`, r = e.state.value || "";
|
|
1734
1742
|
e.handleChange(r + n);
|
|
1735
1743
|
},
|
|
1736
|
-
children: /* @__PURE__ */
|
|
1744
|
+
children: /* @__PURE__ */ P("div", {
|
|
1737
1745
|
className: "flex flex-col",
|
|
1738
|
-
children: [/* @__PURE__ */
|
|
1746
|
+
children: [/* @__PURE__ */ N("span", {
|
|
1739
1747
|
className: "font-medium",
|
|
1740
1748
|
children: t.label
|
|
1741
|
-
}), /* @__PURE__ */
|
|
1749
|
+
}), /* @__PURE__ */ N("span", {
|
|
1742
1750
|
className: "text-muted-foreground text-xs",
|
|
1743
1751
|
children: `{{${t.nodeId}}}`
|
|
1744
1752
|
})]
|
|
@@ -1746,87 +1754,87 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1746
1754
|
}, t.nodeId))
|
|
1747
1755
|
})] })]
|
|
1748
1756
|
}),
|
|
1749
|
-
/* @__PURE__ */
|
|
1757
|
+
/* @__PURE__ */ N(E, { children: r("editor.httpConfigForm.apiUrlDesc") })
|
|
1750
1758
|
] })
|
|
1751
1759
|
}),
|
|
1752
|
-
/* @__PURE__ */
|
|
1760
|
+
/* @__PURE__ */ N(o, {
|
|
1753
1761
|
name: "method",
|
|
1754
|
-
children: (e) => /* @__PURE__ */
|
|
1762
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [/* @__PURE__ */ N(l, {
|
|
1755
1763
|
htmlFor: e.name,
|
|
1756
1764
|
children: r("editor.httpConfigForm.httpMethod")
|
|
1757
|
-
}), /* @__PURE__ */
|
|
1765
|
+
}), /* @__PURE__ */ P(v, {
|
|
1758
1766
|
value: e.state.value,
|
|
1759
1767
|
onValueChange: (t) => e.handleChange(t),
|
|
1760
|
-
children: [/* @__PURE__ */
|
|
1768
|
+
children: [/* @__PURE__ */ N(g, {
|
|
1761
1769
|
id: e.name,
|
|
1762
|
-
children: /* @__PURE__ */
|
|
1763
|
-
}), /* @__PURE__ */
|
|
1764
|
-
/* @__PURE__ */
|
|
1770
|
+
children: /* @__PURE__ */ N(c, { placeholder: r("editor.httpConfigForm.selectMethod") })
|
|
1771
|
+
}), /* @__PURE__ */ P(k, { children: [
|
|
1772
|
+
/* @__PURE__ */ N(b, {
|
|
1765
1773
|
value: "GET",
|
|
1766
1774
|
children: r("editor.httpConfigForm.methodGet")
|
|
1767
1775
|
}),
|
|
1768
|
-
/* @__PURE__ */
|
|
1776
|
+
/* @__PURE__ */ N(b, {
|
|
1769
1777
|
value: "POST",
|
|
1770
1778
|
children: r("editor.httpConfigForm.methodPost")
|
|
1771
1779
|
}),
|
|
1772
|
-
/* @__PURE__ */
|
|
1780
|
+
/* @__PURE__ */ N(b, {
|
|
1773
1781
|
value: "PUT",
|
|
1774
1782
|
children: r("editor.httpConfigForm.methodPut")
|
|
1775
1783
|
}),
|
|
1776
|
-
/* @__PURE__ */
|
|
1784
|
+
/* @__PURE__ */ N(b, {
|
|
1777
1785
|
value: "DELETE",
|
|
1778
1786
|
children: r("editor.httpConfigForm.methodDelete")
|
|
1779
1787
|
}),
|
|
1780
|
-
/* @__PURE__ */
|
|
1788
|
+
/* @__PURE__ */ N(b, {
|
|
1781
1789
|
value: "PATCH",
|
|
1782
1790
|
children: r("editor.httpConfigForm.methodPatch")
|
|
1783
1791
|
})
|
|
1784
1792
|
] })]
|
|
1785
1793
|
})] })
|
|
1786
1794
|
}),
|
|
1787
|
-
/* @__PURE__ */
|
|
1795
|
+
/* @__PURE__ */ P("div", {
|
|
1788
1796
|
className: "space-y-4",
|
|
1789
|
-
children: [/* @__PURE__ */
|
|
1797
|
+
children: [/* @__PURE__ */ N("h4", {
|
|
1790
1798
|
className: "font-semibold text-sm",
|
|
1791
1799
|
children: r("editor.httpConfigForm.headers")
|
|
1792
|
-
}), /* @__PURE__ */
|
|
1800
|
+
}), /* @__PURE__ */ N(o, {
|
|
1793
1801
|
name: "headers",
|
|
1794
1802
|
mode: "array",
|
|
1795
|
-
children: (e) => /* @__PURE__ */
|
|
1803
|
+
children: (e) => /* @__PURE__ */ P("div", {
|
|
1796
1804
|
className: "space-y-2",
|
|
1797
1805
|
children: [e.state.value?.map((t, n) => {
|
|
1798
1806
|
let i = `headers[${n}]`;
|
|
1799
|
-
return /* @__PURE__ */
|
|
1807
|
+
return /* @__PURE__ */ P("div", {
|
|
1800
1808
|
className: "flex items-start gap-2",
|
|
1801
1809
|
children: [
|
|
1802
|
-
/* @__PURE__ */
|
|
1810
|
+
/* @__PURE__ */ N(o, {
|
|
1803
1811
|
name: `headers[${n}].key`,
|
|
1804
|
-
children: (e) => /* @__PURE__ */
|
|
1812
|
+
children: (e) => /* @__PURE__ */ N(m, {
|
|
1805
1813
|
placeholder: r("editor.httpConfigForm.headerName"),
|
|
1806
1814
|
value: e.state.value || "",
|
|
1807
1815
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
1808
1816
|
})
|
|
1809
1817
|
}),
|
|
1810
|
-
/* @__PURE__ */
|
|
1818
|
+
/* @__PURE__ */ N(o, {
|
|
1811
1819
|
name: `headers[${n}].value`,
|
|
1812
|
-
children: (e) => /* @__PURE__ */
|
|
1820
|
+
children: (e) => /* @__PURE__ */ N(m, {
|
|
1813
1821
|
placeholder: r("editor.httpConfigForm.headerValue"),
|
|
1814
1822
|
value: e.state.value || "",
|
|
1815
1823
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
1816
1824
|
})
|
|
1817
1825
|
}),
|
|
1818
|
-
/* @__PURE__ */
|
|
1826
|
+
/* @__PURE__ */ N(p, {
|
|
1819
1827
|
type: "button",
|
|
1820
1828
|
variant: "ghost",
|
|
1821
1829
|
size: "icon",
|
|
1822
1830
|
onClick: () => {
|
|
1823
1831
|
e.removeValue(n);
|
|
1824
1832
|
},
|
|
1825
|
-
children: /* @__PURE__ */
|
|
1833
|
+
children: /* @__PURE__ */ N(L, { className: "h-4 w-4" })
|
|
1826
1834
|
})
|
|
1827
1835
|
]
|
|
1828
1836
|
}, i);
|
|
1829
|
-
}), /* @__PURE__ */
|
|
1837
|
+
}), /* @__PURE__ */ P(p, {
|
|
1830
1838
|
type: "button",
|
|
1831
1839
|
variant: "outline",
|
|
1832
1840
|
size: "sm",
|
|
@@ -1836,64 +1844,64 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1836
1844
|
value: ""
|
|
1837
1845
|
});
|
|
1838
1846
|
},
|
|
1839
|
-
children: [/* @__PURE__ */
|
|
1847
|
+
children: [/* @__PURE__ */ N(I, { className: "mr-2 h-4 w-4" }), r("editor.httpConfigForm.addHeader")]
|
|
1840
1848
|
})]
|
|
1841
1849
|
})
|
|
1842
1850
|
})]
|
|
1843
1851
|
}),
|
|
1844
|
-
/* @__PURE__ */
|
|
1852
|
+
/* @__PURE__ */ N(s, {
|
|
1845
1853
|
selector: (e) => ({
|
|
1846
1854
|
method: e.values.method,
|
|
1847
1855
|
sendAllFormValues: e.values.sendAllFormValues
|
|
1848
1856
|
}),
|
|
1849
|
-
children: ({ method: e, sendAllFormValues: t }) => Fn.includes(e || "") && /* @__PURE__ */
|
|
1857
|
+
children: ({ method: e, sendAllFormValues: t }) => Fn.includes(e || "") && /* @__PURE__ */ P("div", {
|
|
1850
1858
|
className: "space-y-4",
|
|
1851
|
-
children: [/* @__PURE__ */
|
|
1859
|
+
children: [/* @__PURE__ */ N(o, {
|
|
1852
1860
|
name: "sendAllFormValues",
|
|
1853
|
-
children: (e) => /* @__PURE__ */
|
|
1861
|
+
children: (e) => /* @__PURE__ */ P("div", {
|
|
1854
1862
|
className: "flex items-center space-x-2",
|
|
1855
|
-
children: [/* @__PURE__ */
|
|
1863
|
+
children: [/* @__PURE__ */ N(x, {
|
|
1856
1864
|
id: e.name,
|
|
1857
1865
|
checked: e.state.value,
|
|
1858
1866
|
onCheckedChange: (t) => e.handleChange(t)
|
|
1859
|
-
}), /* @__PURE__ */
|
|
1867
|
+
}), /* @__PURE__ */ N(l, {
|
|
1860
1868
|
htmlFor: e.name,
|
|
1861
1869
|
children: r("editor.httpConfigForm.sendAllFormValues")
|
|
1862
1870
|
})]
|
|
1863
1871
|
})
|
|
1864
|
-
}), /* @__PURE__ */
|
|
1872
|
+
}), /* @__PURE__ */ N(o, {
|
|
1865
1873
|
name: "body",
|
|
1866
|
-
children: (e) => /* @__PURE__ */
|
|
1867
|
-
/* @__PURE__ */
|
|
1874
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [
|
|
1875
|
+
/* @__PURE__ */ P("div", {
|
|
1868
1876
|
className: "mb-2 flex items-center justify-between",
|
|
1869
|
-
children: [/* @__PURE__ */
|
|
1877
|
+
children: [/* @__PURE__ */ N(l, {
|
|
1870
1878
|
htmlFor: e.name,
|
|
1871
1879
|
children: r("editor.httpConfigForm.requestBody")
|
|
1872
|
-
}), /* @__PURE__ */
|
|
1880
|
+
}), /* @__PURE__ */ P(J, { children: [/* @__PURE__ */ N(Y, {
|
|
1873
1881
|
asChild: !0,
|
|
1874
|
-
children: /* @__PURE__ */
|
|
1882
|
+
children: /* @__PURE__ */ P(p, {
|
|
1875
1883
|
type: "button",
|
|
1876
1884
|
variant: "ghost",
|
|
1877
1885
|
size: "sm",
|
|
1878
1886
|
disabled: t,
|
|
1879
|
-
children: [/* @__PURE__ */
|
|
1887
|
+
children: [/* @__PURE__ */ N(ut, { className: "mr-2 h-4 w-4" }), r("editor.httpConfigForm.insertVariable")]
|
|
1880
1888
|
})
|
|
1881
|
-
}), /* @__PURE__ */
|
|
1889
|
+
}), /* @__PURE__ */ N(X, {
|
|
1882
1890
|
align: "end",
|
|
1883
|
-
children: i.length === 0 ? /* @__PURE__ */
|
|
1891
|
+
children: i.length === 0 ? /* @__PURE__ */ N(Z, {
|
|
1884
1892
|
disabled: !0,
|
|
1885
1893
|
children: r("editor.httpConfigForm.noFieldsAvailable")
|
|
1886
|
-
}) : i.map((t) => /* @__PURE__ */
|
|
1894
|
+
}) : i.map((t) => /* @__PURE__ */ N(Z, {
|
|
1887
1895
|
onClick: () => {
|
|
1888
1896
|
let n = `{{${t.nodeId}}}`, r = e.state.value || "";
|
|
1889
1897
|
e.handleChange(r + n), a().then();
|
|
1890
1898
|
},
|
|
1891
|
-
children: /* @__PURE__ */
|
|
1899
|
+
children: /* @__PURE__ */ P("div", {
|
|
1892
1900
|
className: "flex flex-col",
|
|
1893
|
-
children: [/* @__PURE__ */
|
|
1901
|
+
children: [/* @__PURE__ */ N("span", {
|
|
1894
1902
|
className: "font-medium",
|
|
1895
1903
|
children: t.label
|
|
1896
|
-
}), /* @__PURE__ */
|
|
1904
|
+
}), /* @__PURE__ */ N("span", {
|
|
1897
1905
|
className: "text-muted-foreground text-xs",
|
|
1898
1906
|
children: `{{${t.nodeId}}}`
|
|
1899
1907
|
})]
|
|
@@ -1901,7 +1909,7 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1901
1909
|
}, t.nodeId))
|
|
1902
1910
|
})] })]
|
|
1903
1911
|
}),
|
|
1904
|
-
/* @__PURE__ */
|
|
1912
|
+
/* @__PURE__ */ N(ne, {
|
|
1905
1913
|
id: e.name,
|
|
1906
1914
|
name: e.name,
|
|
1907
1915
|
value: e.state.value,
|
|
@@ -1911,26 +1919,26 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1911
1919
|
rows: 4,
|
|
1912
1920
|
disabled: t
|
|
1913
1921
|
}),
|
|
1914
|
-
/* @__PURE__ */
|
|
1922
|
+
/* @__PURE__ */ N(E, { children: r(t ? "editor.httpConfigForm.sendAllFormValuesDesc" : "editor.httpConfigForm.requestBodyDesc") })
|
|
1915
1923
|
] })
|
|
1916
1924
|
})]
|
|
1917
1925
|
})
|
|
1918
1926
|
}),
|
|
1919
|
-
/* @__PURE__ */
|
|
1927
|
+
/* @__PURE__ */ P("div", {
|
|
1920
1928
|
className: "space-y-4",
|
|
1921
1929
|
children: [
|
|
1922
|
-
/* @__PURE__ */
|
|
1930
|
+
/* @__PURE__ */ N("h4", {
|
|
1923
1931
|
className: "font-semibold text-sm",
|
|
1924
1932
|
children: r("editor.httpConfigForm.responseConfiguration")
|
|
1925
1933
|
}),
|
|
1926
|
-
/* @__PURE__ */
|
|
1934
|
+
/* @__PURE__ */ N(o, {
|
|
1927
1935
|
name: "responsePath",
|
|
1928
|
-
children: (e) => /* @__PURE__ */
|
|
1929
|
-
/* @__PURE__ */
|
|
1936
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [
|
|
1937
|
+
/* @__PURE__ */ N(l, {
|
|
1930
1938
|
htmlFor: e.name,
|
|
1931
1939
|
children: r("editor.httpConfigForm.responsePath")
|
|
1932
1940
|
}),
|
|
1933
|
-
/* @__PURE__ */
|
|
1941
|
+
/* @__PURE__ */ N(m, {
|
|
1934
1942
|
id: e.name,
|
|
1935
1943
|
name: e.name,
|
|
1936
1944
|
value: e.state.value,
|
|
@@ -1938,24 +1946,24 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1938
1946
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
1939
1947
|
placeholder: r("editor.httpConfigForm.responsePathPlaceholder")
|
|
1940
1948
|
}),
|
|
1941
|
-
/* @__PURE__ */
|
|
1949
|
+
/* @__PURE__ */ N(E, { children: r("editor.httpConfigForm.responsePathDesc") })
|
|
1942
1950
|
] })
|
|
1943
1951
|
}),
|
|
1944
|
-
/* @__PURE__ */
|
|
1952
|
+
/* @__PURE__ */ P("div", {
|
|
1945
1953
|
className: "space-y-4",
|
|
1946
1954
|
children: [
|
|
1947
|
-
/* @__PURE__ */
|
|
1955
|
+
/* @__PURE__ */ N("h5", {
|
|
1948
1956
|
className: "font-medium text-sm",
|
|
1949
1957
|
children: r("editor.httpConfigForm.mapToOptions")
|
|
1950
1958
|
}),
|
|
1951
|
-
/* @__PURE__ */
|
|
1959
|
+
/* @__PURE__ */ N(o, {
|
|
1952
1960
|
name: "responseMapping.valueField",
|
|
1953
|
-
children: (e) => /* @__PURE__ */
|
|
1954
|
-
/* @__PURE__ */
|
|
1961
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [
|
|
1962
|
+
/* @__PURE__ */ N(l, {
|
|
1955
1963
|
htmlFor: e.name,
|
|
1956
1964
|
children: r("editor.httpConfigForm.valueField")
|
|
1957
1965
|
}),
|
|
1958
|
-
/* @__PURE__ */
|
|
1966
|
+
/* @__PURE__ */ N(m, {
|
|
1959
1967
|
id: e.name,
|
|
1960
1968
|
name: e.name,
|
|
1961
1969
|
value: e.state.value,
|
|
@@ -1963,17 +1971,17 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1963
1971
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
1964
1972
|
placeholder: r("editor.httpConfigForm.valueFieldPlaceholder")
|
|
1965
1973
|
}),
|
|
1966
|
-
/* @__PURE__ */
|
|
1974
|
+
/* @__PURE__ */ N(E, { children: r("editor.httpConfigForm.valueFieldDesc") })
|
|
1967
1975
|
] })
|
|
1968
1976
|
}),
|
|
1969
|
-
/* @__PURE__ */
|
|
1977
|
+
/* @__PURE__ */ N(o, {
|
|
1970
1978
|
name: "responseMapping.labelField",
|
|
1971
|
-
children: (e) => /* @__PURE__ */
|
|
1972
|
-
/* @__PURE__ */
|
|
1979
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [
|
|
1980
|
+
/* @__PURE__ */ N(l, {
|
|
1973
1981
|
htmlFor: e.name,
|
|
1974
1982
|
children: r("editor.httpConfigForm.labelField")
|
|
1975
1983
|
}),
|
|
1976
|
-
/* @__PURE__ */
|
|
1984
|
+
/* @__PURE__ */ N(m, {
|
|
1977
1985
|
id: e.name,
|
|
1978
1986
|
name: e.name,
|
|
1979
1987
|
value: e.state.value,
|
|
@@ -1981,19 +1989,19 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1981
1989
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
1982
1990
|
placeholder: r("editor.httpConfigForm.labelFieldPlaceholder")
|
|
1983
1991
|
}),
|
|
1984
|
-
/* @__PURE__ */
|
|
1992
|
+
/* @__PURE__ */ N(E, { children: r("editor.httpConfigForm.labelFieldDesc") })
|
|
1985
1993
|
] })
|
|
1986
1994
|
})
|
|
1987
1995
|
]
|
|
1988
1996
|
}),
|
|
1989
|
-
/* @__PURE__ */
|
|
1997
|
+
/* @__PURE__ */ N(o, {
|
|
1990
1998
|
name: "searchParam",
|
|
1991
|
-
children: (e) => /* @__PURE__ */
|
|
1992
|
-
/* @__PURE__ */
|
|
1999
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [
|
|
2000
|
+
/* @__PURE__ */ N(l, {
|
|
1993
2001
|
htmlFor: e.name,
|
|
1994
2002
|
children: r("editor.httpConfigForm.searchParameter")
|
|
1995
2003
|
}),
|
|
1996
|
-
/* @__PURE__ */
|
|
2004
|
+
/* @__PURE__ */ N(m, {
|
|
1997
2005
|
id: e.name,
|
|
1998
2006
|
name: e.name,
|
|
1999
2007
|
value: e.state.value,
|
|
@@ -2001,32 +2009,32 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2001
2009
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
2002
2010
|
placeholder: r("editor.httpConfigForm.searchParameterPlaceholder")
|
|
2003
2011
|
}),
|
|
2004
|
-
/* @__PURE__ */
|
|
2012
|
+
/* @__PURE__ */ N(E, { children: r("editor.httpConfigForm.searchParameterDesc") })
|
|
2005
2013
|
] })
|
|
2006
2014
|
})
|
|
2007
2015
|
]
|
|
2008
2016
|
}),
|
|
2009
|
-
/* @__PURE__ */
|
|
2017
|
+
/* @__PURE__ */ P("div", {
|
|
2010
2018
|
className: "space-y-4",
|
|
2011
2019
|
children: [
|
|
2012
|
-
/* @__PURE__ */
|
|
2020
|
+
/* @__PURE__ */ N("h4", {
|
|
2013
2021
|
className: "font-semibold text-sm",
|
|
2014
2022
|
children: r("editor.httpConfigForm.behavior")
|
|
2015
2023
|
}),
|
|
2016
|
-
/* @__PURE__ */
|
|
2024
|
+
/* @__PURE__ */ N(s, {
|
|
2017
2025
|
selector: (e) => e.values.searchParam,
|
|
2018
|
-
children: (e) => /* @__PURE__ */
|
|
2026
|
+
children: (e) => /* @__PURE__ */ N(o, {
|
|
2019
2027
|
name: "fetchOnMount",
|
|
2020
2028
|
children: (t) => {
|
|
2021
2029
|
let n = !!e?.trim(), i = n ? t.state.value : !0;
|
|
2022
|
-
return !n && t.state.value !== !0 && t.handleChange(!0), /* @__PURE__ */
|
|
2030
|
+
return !n && t.state.value !== !0 && t.handleChange(!0), /* @__PURE__ */ P("div", {
|
|
2023
2031
|
className: "flex items-center space-x-2",
|
|
2024
|
-
children: [/* @__PURE__ */
|
|
2032
|
+
children: [/* @__PURE__ */ N(x, {
|
|
2025
2033
|
id: t.name,
|
|
2026
2034
|
checked: i,
|
|
2027
2035
|
disabled: !n,
|
|
2028
2036
|
onCheckedChange: (e) => t.handleChange(e)
|
|
2029
|
-
}), /* @__PURE__ */
|
|
2037
|
+
}), /* @__PURE__ */ N(l, {
|
|
2030
2038
|
htmlFor: t.name,
|
|
2031
2039
|
className: n ? "" : "text-muted-foreground",
|
|
2032
2040
|
children: r("editor.httpConfigForm.fetchOnMount")
|
|
@@ -2035,15 +2043,15 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2035
2043
|
}
|
|
2036
2044
|
})
|
|
2037
2045
|
}),
|
|
2038
|
-
/* @__PURE__ */
|
|
2046
|
+
/* @__PURE__ */ N(o, {
|
|
2039
2047
|
name: "showLoading",
|
|
2040
|
-
children: (e) => /* @__PURE__ */
|
|
2048
|
+
children: (e) => /* @__PURE__ */ P("div", {
|
|
2041
2049
|
className: "flex items-center space-x-2",
|
|
2042
|
-
children: [/* @__PURE__ */
|
|
2050
|
+
children: [/* @__PURE__ */ N(x, {
|
|
2043
2051
|
id: e.name,
|
|
2044
2052
|
checked: e.state.value,
|
|
2045
2053
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2046
|
-
}), /* @__PURE__ */
|
|
2054
|
+
}), /* @__PURE__ */ N(l, {
|
|
2047
2055
|
htmlFor: e.name,
|
|
2048
2056
|
children: r("editor.httpConfigForm.showLoadingState")
|
|
2049
2057
|
})]
|
|
@@ -2058,7 +2066,7 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2058
2066
|
"PUT",
|
|
2059
2067
|
"PATCH"
|
|
2060
2068
|
], Rn = ({ value: e, onChange: t }) => {
|
|
2061
|
-
let [n, r] = z("en"), { selectedNode: i } = $(), a = G(), o = At(i?.id), { handleSubmit: s, Field: u, Subscribe: d } =
|
|
2069
|
+
let [n, r] = z("en"), { selectedNode: i } = $(), a = G(), o = At(i?.id), { handleSubmit: s, Field: u, Subscribe: d } = F({
|
|
2062
2070
|
defaultValues: {
|
|
2063
2071
|
body: e?.body || "",
|
|
2064
2072
|
errorMessage: e?.errorMessage || { en: "" },
|
|
@@ -2080,19 +2088,19 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2080
2088
|
t(e);
|
|
2081
2089
|
}
|
|
2082
2090
|
});
|
|
2083
|
-
return /* @__PURE__ */
|
|
2091
|
+
return /* @__PURE__ */ N("div", { children: /* @__PURE__ */ P("div", {
|
|
2084
2092
|
className: "grid gap-6",
|
|
2085
2093
|
children: [
|
|
2086
|
-
/* @__PURE__ */
|
|
2094
|
+
/* @__PURE__ */ N(u, {
|
|
2087
2095
|
name: "url",
|
|
2088
|
-
children: (e) => /* @__PURE__ */
|
|
2089
|
-
/* @__PURE__ */
|
|
2096
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [
|
|
2097
|
+
/* @__PURE__ */ N(l, {
|
|
2090
2098
|
htmlFor: e.name,
|
|
2091
2099
|
children: a("editor.submitConfigForm.apiUrl")
|
|
2092
2100
|
}),
|
|
2093
|
-
/* @__PURE__ */
|
|
2101
|
+
/* @__PURE__ */ P("div", {
|
|
2094
2102
|
className: "flex gap-2",
|
|
2095
|
-
children: [/* @__PURE__ */
|
|
2103
|
+
children: [/* @__PURE__ */ N(m, {
|
|
2096
2104
|
id: e.name,
|
|
2097
2105
|
name: e.name,
|
|
2098
2106
|
value: e.state.value,
|
|
@@ -2100,30 +2108,30 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2100
2108
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
2101
2109
|
placeholder: a("editor.submitConfigForm.apiUrlPlaceholder"),
|
|
2102
2110
|
className: "flex-1"
|
|
2103
|
-
}), /* @__PURE__ */
|
|
2111
|
+
}), /* @__PURE__ */ P(J, { children: [/* @__PURE__ */ N(Y, {
|
|
2104
2112
|
asChild: !0,
|
|
2105
|
-
children: /* @__PURE__ */
|
|
2113
|
+
children: /* @__PURE__ */ N(p, {
|
|
2106
2114
|
type: "button",
|
|
2107
2115
|
variant: "outline",
|
|
2108
2116
|
size: "icon",
|
|
2109
|
-
children: /* @__PURE__ */
|
|
2117
|
+
children: /* @__PURE__ */ N(ut, { className: "h-4 w-4" })
|
|
2110
2118
|
})
|
|
2111
|
-
}), /* @__PURE__ */
|
|
2119
|
+
}), /* @__PURE__ */ N(X, {
|
|
2112
2120
|
align: "end",
|
|
2113
|
-
children: o.length === 0 ? /* @__PURE__ */
|
|
2121
|
+
children: o.length === 0 ? /* @__PURE__ */ N(Z, {
|
|
2114
2122
|
disabled: !0,
|
|
2115
2123
|
children: a("editor.submitConfigForm.noFieldsAvailable")
|
|
2116
|
-
}) : o.map((t) => /* @__PURE__ */
|
|
2124
|
+
}) : o.map((t) => /* @__PURE__ */ N(Z, {
|
|
2117
2125
|
onClick: () => {
|
|
2118
2126
|
let n = `{{${t.nodeId}}}`, r = e.state.value || "";
|
|
2119
2127
|
e.handleChange(r + n);
|
|
2120
2128
|
},
|
|
2121
|
-
children: /* @__PURE__ */
|
|
2129
|
+
children: /* @__PURE__ */ P("div", {
|
|
2122
2130
|
className: "flex flex-col",
|
|
2123
|
-
children: [/* @__PURE__ */
|
|
2131
|
+
children: [/* @__PURE__ */ N("span", {
|
|
2124
2132
|
className: "font-medium",
|
|
2125
2133
|
children: t.label
|
|
2126
|
-
}), /* @__PURE__ */
|
|
2134
|
+
}), /* @__PURE__ */ N("span", {
|
|
2127
2135
|
className: "text-muted-foreground text-xs",
|
|
2128
2136
|
children: `{{${t.nodeId}}}`
|
|
2129
2137
|
})]
|
|
@@ -2131,83 +2139,83 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2131
2139
|
}, t.nodeId))
|
|
2132
2140
|
})] })]
|
|
2133
2141
|
}),
|
|
2134
|
-
/* @__PURE__ */
|
|
2142
|
+
/* @__PURE__ */ N(E, { children: a("editor.submitConfigForm.apiUrlDesc") })
|
|
2135
2143
|
] })
|
|
2136
2144
|
}),
|
|
2137
|
-
/* @__PURE__ */
|
|
2145
|
+
/* @__PURE__ */ N(u, {
|
|
2138
2146
|
name: "method",
|
|
2139
|
-
children: (e) => /* @__PURE__ */
|
|
2147
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [/* @__PURE__ */ N(l, {
|
|
2140
2148
|
htmlFor: e.name,
|
|
2141
2149
|
children: a("editor.submitConfigForm.httpMethod")
|
|
2142
|
-
}), /* @__PURE__ */
|
|
2150
|
+
}), /* @__PURE__ */ P(v, {
|
|
2143
2151
|
value: e.state.value,
|
|
2144
2152
|
onValueChange: (t) => e.handleChange(t),
|
|
2145
|
-
children: [/* @__PURE__ */
|
|
2153
|
+
children: [/* @__PURE__ */ N(g, {
|
|
2146
2154
|
id: e.name,
|
|
2147
|
-
children: /* @__PURE__ */
|
|
2148
|
-
}), /* @__PURE__ */
|
|
2149
|
-
/* @__PURE__ */
|
|
2155
|
+
children: /* @__PURE__ */ N(c, { placeholder: a("editor.submitConfigForm.selectMethod") })
|
|
2156
|
+
}), /* @__PURE__ */ P(k, { children: [
|
|
2157
|
+
/* @__PURE__ */ N(b, {
|
|
2150
2158
|
value: "POST",
|
|
2151
2159
|
children: a("editor.submitConfigForm.methodPost")
|
|
2152
2160
|
}),
|
|
2153
|
-
/* @__PURE__ */
|
|
2161
|
+
/* @__PURE__ */ N(b, {
|
|
2154
2162
|
value: "PUT",
|
|
2155
2163
|
children: a("editor.submitConfigForm.methodPut")
|
|
2156
2164
|
}),
|
|
2157
|
-
/* @__PURE__ */
|
|
2165
|
+
/* @__PURE__ */ N(b, {
|
|
2158
2166
|
value: "DELETE",
|
|
2159
2167
|
children: a("editor.submitConfigForm.methodDelete")
|
|
2160
2168
|
}),
|
|
2161
|
-
/* @__PURE__ */
|
|
2169
|
+
/* @__PURE__ */ N(b, {
|
|
2162
2170
|
value: "PATCH",
|
|
2163
2171
|
children: a("editor.submitConfigForm.methodPatch")
|
|
2164
2172
|
})
|
|
2165
2173
|
] })]
|
|
2166
2174
|
})] })
|
|
2167
2175
|
}),
|
|
2168
|
-
/* @__PURE__ */
|
|
2176
|
+
/* @__PURE__ */ P("div", {
|
|
2169
2177
|
className: "space-y-4",
|
|
2170
|
-
children: [/* @__PURE__ */
|
|
2178
|
+
children: [/* @__PURE__ */ N("h4", {
|
|
2171
2179
|
className: "font-semibold text-sm",
|
|
2172
2180
|
children: a("editor.submitConfigForm.headers")
|
|
2173
|
-
}), /* @__PURE__ */
|
|
2181
|
+
}), /* @__PURE__ */ N(u, {
|
|
2174
2182
|
name: "headers",
|
|
2175
2183
|
mode: "array",
|
|
2176
|
-
children: (e) => /* @__PURE__ */
|
|
2184
|
+
children: (e) => /* @__PURE__ */ P("div", {
|
|
2177
2185
|
className: "space-y-2",
|
|
2178
2186
|
children: [e.state.value?.map((t, n) => {
|
|
2179
2187
|
let r = `headers[${n}]`;
|
|
2180
|
-
return /* @__PURE__ */
|
|
2188
|
+
return /* @__PURE__ */ P("div", {
|
|
2181
2189
|
className: "flex items-start gap-2",
|
|
2182
2190
|
children: [
|
|
2183
|
-
/* @__PURE__ */
|
|
2191
|
+
/* @__PURE__ */ N(u, {
|
|
2184
2192
|
name: `headers[${n}].key`,
|
|
2185
|
-
children: (e) => /* @__PURE__ */
|
|
2193
|
+
children: (e) => /* @__PURE__ */ N(m, {
|
|
2186
2194
|
placeholder: a("editor.submitConfigForm.headerName"),
|
|
2187
2195
|
value: e.state.value || "",
|
|
2188
2196
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
2189
2197
|
})
|
|
2190
2198
|
}),
|
|
2191
|
-
/* @__PURE__ */
|
|
2199
|
+
/* @__PURE__ */ N(u, {
|
|
2192
2200
|
name: `headers[${n}].value`,
|
|
2193
|
-
children: (e) => /* @__PURE__ */
|
|
2201
|
+
children: (e) => /* @__PURE__ */ N(m, {
|
|
2194
2202
|
placeholder: a("editor.submitConfigForm.headerValue"),
|
|
2195
2203
|
value: e.state.value || "",
|
|
2196
2204
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
2197
2205
|
})
|
|
2198
2206
|
}),
|
|
2199
|
-
/* @__PURE__ */
|
|
2207
|
+
/* @__PURE__ */ N(p, {
|
|
2200
2208
|
type: "button",
|
|
2201
2209
|
variant: "ghost",
|
|
2202
2210
|
size: "icon",
|
|
2203
2211
|
onClick: () => {
|
|
2204
2212
|
e.removeValue(n);
|
|
2205
2213
|
},
|
|
2206
|
-
children: /* @__PURE__ */
|
|
2214
|
+
children: /* @__PURE__ */ N(L, { className: "h-4 w-4" })
|
|
2207
2215
|
})
|
|
2208
2216
|
]
|
|
2209
2217
|
}, r);
|
|
2210
|
-
}), /* @__PURE__ */
|
|
2218
|
+
}), /* @__PURE__ */ P(p, {
|
|
2211
2219
|
type: "button",
|
|
2212
2220
|
variant: "outline",
|
|
2213
2221
|
size: "sm",
|
|
@@ -2217,64 +2225,64 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2217
2225
|
value: ""
|
|
2218
2226
|
});
|
|
2219
2227
|
},
|
|
2220
|
-
children: [/* @__PURE__ */
|
|
2228
|
+
children: [/* @__PURE__ */ N(I, { className: "mr-2 h-4 w-4" }), a("editor.submitConfigForm.addHeader")]
|
|
2221
2229
|
})]
|
|
2222
2230
|
})
|
|
2223
2231
|
})]
|
|
2224
2232
|
}),
|
|
2225
|
-
/* @__PURE__ */
|
|
2233
|
+
/* @__PURE__ */ N(d, {
|
|
2226
2234
|
selector: (e) => ({
|
|
2227
2235
|
method: e.values.method,
|
|
2228
2236
|
sendAllFormValues: e.values.sendAllFormValues
|
|
2229
2237
|
}),
|
|
2230
|
-
children: ({ method: e, sendAllFormValues: t }) => Ln.includes(e || "") && /* @__PURE__ */
|
|
2238
|
+
children: ({ method: e, sendAllFormValues: t }) => Ln.includes(e || "") && /* @__PURE__ */ P("div", {
|
|
2231
2239
|
className: "space-y-4",
|
|
2232
|
-
children: [/* @__PURE__ */
|
|
2240
|
+
children: [/* @__PURE__ */ N(u, {
|
|
2233
2241
|
name: "sendAllFormValues",
|
|
2234
|
-
children: (e) => /* @__PURE__ */
|
|
2242
|
+
children: (e) => /* @__PURE__ */ P("div", {
|
|
2235
2243
|
className: "flex items-center space-x-2",
|
|
2236
|
-
children: [/* @__PURE__ */
|
|
2244
|
+
children: [/* @__PURE__ */ N(x, {
|
|
2237
2245
|
id: e.name,
|
|
2238
2246
|
checked: e.state.value,
|
|
2239
2247
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2240
|
-
}), /* @__PURE__ */
|
|
2248
|
+
}), /* @__PURE__ */ N(l, {
|
|
2241
2249
|
htmlFor: e.name,
|
|
2242
2250
|
children: a("editor.submitConfigForm.sendAllFormValues")
|
|
2243
2251
|
})]
|
|
2244
2252
|
})
|
|
2245
|
-
}), /* @__PURE__ */
|
|
2253
|
+
}), /* @__PURE__ */ N(u, {
|
|
2246
2254
|
name: "body",
|
|
2247
|
-
children: (e) => /* @__PURE__ */
|
|
2248
|
-
/* @__PURE__ */
|
|
2255
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [
|
|
2256
|
+
/* @__PURE__ */ P("div", {
|
|
2249
2257
|
className: "mb-2 flex items-center justify-between",
|
|
2250
|
-
children: [/* @__PURE__ */
|
|
2258
|
+
children: [/* @__PURE__ */ N(l, {
|
|
2251
2259
|
htmlFor: e.name,
|
|
2252
2260
|
children: a("editor.submitConfigForm.requestBody")
|
|
2253
|
-
}), /* @__PURE__ */
|
|
2261
|
+
}), /* @__PURE__ */ P(J, { children: [/* @__PURE__ */ N(Y, {
|
|
2254
2262
|
asChild: !0,
|
|
2255
|
-
children: /* @__PURE__ */
|
|
2263
|
+
children: /* @__PURE__ */ P(p, {
|
|
2256
2264
|
type: "button",
|
|
2257
2265
|
variant: "ghost",
|
|
2258
2266
|
size: "sm",
|
|
2259
2267
|
disabled: t,
|
|
2260
|
-
children: [/* @__PURE__ */
|
|
2268
|
+
children: [/* @__PURE__ */ N(ut, { className: "mr-2 h-4 w-4" }), a("editor.submitConfigForm.insertVariable")]
|
|
2261
2269
|
})
|
|
2262
|
-
}), /* @__PURE__ */
|
|
2270
|
+
}), /* @__PURE__ */ N(X, {
|
|
2263
2271
|
align: "end",
|
|
2264
|
-
children: o.length === 0 ? /* @__PURE__ */
|
|
2272
|
+
children: o.length === 0 ? /* @__PURE__ */ N(Z, {
|
|
2265
2273
|
disabled: !0,
|
|
2266
2274
|
children: a("editor.submitConfigForm.noFieldsAvailable")
|
|
2267
|
-
}) : o.map((t) => /* @__PURE__ */
|
|
2275
|
+
}) : o.map((t) => /* @__PURE__ */ N(Z, {
|
|
2268
2276
|
onClick: () => {
|
|
2269
2277
|
let n = `{{${t.nodeId}}}`, r = e.state.value || "";
|
|
2270
2278
|
e.handleChange(r + n), s().then();
|
|
2271
2279
|
},
|
|
2272
|
-
children: /* @__PURE__ */
|
|
2280
|
+
children: /* @__PURE__ */ P("div", {
|
|
2273
2281
|
className: "flex flex-col",
|
|
2274
|
-
children: [/* @__PURE__ */
|
|
2282
|
+
children: [/* @__PURE__ */ N("span", {
|
|
2275
2283
|
className: "font-medium",
|
|
2276
2284
|
children: t.label
|
|
2277
|
-
}), /* @__PURE__ */
|
|
2285
|
+
}), /* @__PURE__ */ N("span", {
|
|
2278
2286
|
className: "text-muted-foreground text-xs",
|
|
2279
2287
|
children: `{{${t.nodeId}}}`
|
|
2280
2288
|
})]
|
|
@@ -2282,7 +2290,7 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2282
2290
|
}, t.nodeId))
|
|
2283
2291
|
})] })]
|
|
2284
2292
|
}),
|
|
2285
|
-
/* @__PURE__ */
|
|
2293
|
+
/* @__PURE__ */ N(ne, {
|
|
2286
2294
|
id: e.name,
|
|
2287
2295
|
name: e.name,
|
|
2288
2296
|
value: e.state.value,
|
|
@@ -2292,26 +2300,26 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2292
2300
|
rows: 4,
|
|
2293
2301
|
disabled: t
|
|
2294
2302
|
}),
|
|
2295
|
-
/* @__PURE__ */
|
|
2303
|
+
/* @__PURE__ */ N(E, { children: a(t ? "editor.submitConfigForm.sendAllFormValuesDesc" : "editor.submitConfigForm.requestBodyDesc") })
|
|
2296
2304
|
] })
|
|
2297
2305
|
})]
|
|
2298
2306
|
})
|
|
2299
2307
|
}),
|
|
2300
|
-
/* @__PURE__ */
|
|
2308
|
+
/* @__PURE__ */ P("div", {
|
|
2301
2309
|
className: "space-y-4",
|
|
2302
2310
|
children: [
|
|
2303
|
-
/* @__PURE__ */
|
|
2311
|
+
/* @__PURE__ */ N("h4", {
|
|
2304
2312
|
className: "font-semibold text-sm",
|
|
2305
2313
|
children: a("editor.submitConfigForm.postSubmission")
|
|
2306
2314
|
}),
|
|
2307
|
-
/* @__PURE__ */
|
|
2315
|
+
/* @__PURE__ */ N(u, {
|
|
2308
2316
|
name: "redirectUrl",
|
|
2309
|
-
children: (e) => /* @__PURE__ */
|
|
2310
|
-
/* @__PURE__ */
|
|
2317
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [
|
|
2318
|
+
/* @__PURE__ */ N(l, {
|
|
2311
2319
|
htmlFor: e.name,
|
|
2312
2320
|
children: a("editor.submitConfigForm.redirectUrl")
|
|
2313
2321
|
}),
|
|
2314
|
-
/* @__PURE__ */
|
|
2322
|
+
/* @__PURE__ */ N(m, {
|
|
2315
2323
|
id: e.name,
|
|
2316
2324
|
name: e.name,
|
|
2317
2325
|
value: e.state.value,
|
|
@@ -2319,21 +2327,21 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2319
2327
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
2320
2328
|
placeholder: a("editor.submitConfigForm.redirectUrlPlaceholder")
|
|
2321
2329
|
}),
|
|
2322
|
-
/* @__PURE__ */
|
|
2330
|
+
/* @__PURE__ */ N(E, { children: a("editor.submitConfigForm.redirectUrlDesc") })
|
|
2323
2331
|
] })
|
|
2324
2332
|
}),
|
|
2325
|
-
/* @__PURE__ */
|
|
2333
|
+
/* @__PURE__ */ P("div", {
|
|
2326
2334
|
className: "flex items-center gap-2",
|
|
2327
|
-
children: [/* @__PURE__ */
|
|
2335
|
+
children: [/* @__PURE__ */ N(u, {
|
|
2328
2336
|
name: "successMessage",
|
|
2329
|
-
children: (e) => /* @__PURE__ */
|
|
2337
|
+
children: (e) => /* @__PURE__ */ P(T, {
|
|
2330
2338
|
className: "flex-1",
|
|
2331
2339
|
children: [
|
|
2332
|
-
/* @__PURE__ */
|
|
2340
|
+
/* @__PURE__ */ N(l, {
|
|
2333
2341
|
htmlFor: e.name,
|
|
2334
2342
|
children: a("editor.submitConfigForm.successMessage")
|
|
2335
2343
|
}),
|
|
2336
|
-
/* @__PURE__ */
|
|
2344
|
+
/* @__PURE__ */ N(m, {
|
|
2337
2345
|
id: e.name,
|
|
2338
2346
|
name: e.name,
|
|
2339
2347
|
value: e.state.value?.[n] || "",
|
|
@@ -2346,26 +2354,26 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2346
2354
|
},
|
|
2347
2355
|
placeholder: a("editor.submitConfigForm.successMessagePlaceholder")
|
|
2348
2356
|
}),
|
|
2349
|
-
/* @__PURE__ */
|
|
2357
|
+
/* @__PURE__ */ N(E, { children: a("editor.submitConfigForm.successMessageDesc") })
|
|
2350
2358
|
]
|
|
2351
2359
|
})
|
|
2352
|
-
}), /* @__PURE__ */
|
|
2360
|
+
}), /* @__PURE__ */ N(Q, {
|
|
2353
2361
|
value: n,
|
|
2354
2362
|
onValueChange: r
|
|
2355
2363
|
})]
|
|
2356
2364
|
}),
|
|
2357
|
-
/* @__PURE__ */
|
|
2365
|
+
/* @__PURE__ */ P("div", {
|
|
2358
2366
|
className: "flex items-center gap-2",
|
|
2359
|
-
children: [/* @__PURE__ */
|
|
2367
|
+
children: [/* @__PURE__ */ N(u, {
|
|
2360
2368
|
name: "errorMessage",
|
|
2361
|
-
children: (e) => /* @__PURE__ */
|
|
2369
|
+
children: (e) => /* @__PURE__ */ P(T, {
|
|
2362
2370
|
className: "flex-1",
|
|
2363
2371
|
children: [
|
|
2364
|
-
/* @__PURE__ */
|
|
2372
|
+
/* @__PURE__ */ N(l, {
|
|
2365
2373
|
htmlFor: e.name,
|
|
2366
2374
|
children: a("editor.submitConfigForm.errorMessage")
|
|
2367
2375
|
}),
|
|
2368
|
-
/* @__PURE__ */
|
|
2376
|
+
/* @__PURE__ */ N(m, {
|
|
2369
2377
|
id: e.name,
|
|
2370
2378
|
name: e.name,
|
|
2371
2379
|
value: e.state.value?.[n] || "",
|
|
@@ -2378,30 +2386,30 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2378
2386
|
},
|
|
2379
2387
|
placeholder: a("editor.submitConfigForm.errorMessagePlaceholder")
|
|
2380
2388
|
}),
|
|
2381
|
-
/* @__PURE__ */
|
|
2389
|
+
/* @__PURE__ */ N(E, { children: a("editor.submitConfigForm.errorMessageDesc") })
|
|
2382
2390
|
]
|
|
2383
2391
|
})
|
|
2384
|
-
}), /* @__PURE__ */
|
|
2392
|
+
}), /* @__PURE__ */ N(Q, {
|
|
2385
2393
|
value: n,
|
|
2386
2394
|
onValueChange: r
|
|
2387
2395
|
})]
|
|
2388
2396
|
})
|
|
2389
2397
|
]
|
|
2390
2398
|
}),
|
|
2391
|
-
/* @__PURE__ */
|
|
2399
|
+
/* @__PURE__ */ P("div", {
|
|
2392
2400
|
className: "space-y-4",
|
|
2393
|
-
children: [/* @__PURE__ */
|
|
2401
|
+
children: [/* @__PURE__ */ N("h4", {
|
|
2394
2402
|
className: "font-semibold text-sm",
|
|
2395
2403
|
children: a("editor.submitConfigForm.behavior")
|
|
2396
|
-
}), /* @__PURE__ */
|
|
2404
|
+
}), /* @__PURE__ */ N(u, {
|
|
2397
2405
|
name: "showLoading",
|
|
2398
|
-
children: (e) => /* @__PURE__ */
|
|
2406
|
+
children: (e) => /* @__PURE__ */ P("div", {
|
|
2399
2407
|
className: "flex items-center space-x-2",
|
|
2400
|
-
children: [/* @__PURE__ */
|
|
2408
|
+
children: [/* @__PURE__ */ N(x, {
|
|
2401
2409
|
id: e.name,
|
|
2402
2410
|
checked: e.state.value,
|
|
2403
2411
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2404
|
-
}), /* @__PURE__ */
|
|
2412
|
+
}), /* @__PURE__ */ N(l, {
|
|
2405
2413
|
htmlFor: e.name,
|
|
2406
2414
|
children: a("editor.submitConfigForm.showLoadingState")
|
|
2407
2415
|
})]
|
|
@@ -2414,56 +2422,56 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2414
2422
|
let [h, g] = z(!1), [v, b] = z(""), x = (e) => e ?? "", S = (e) => e.trim().toLowerCase(), C = x(n), w = n !== null && n !== "", ee = w ? e.find((e) => x(e.value) === C) : void 0, T = S(v), E = m && T !== "" && !e.some((e) => S(e.label) === T || S(e.value ?? "") === T), ne = (e) => {
|
|
2415
2423
|
e === C ? f && r?.("") : r?.(e), g(!1), b("");
|
|
2416
2424
|
};
|
|
2417
|
-
return /* @__PURE__ */
|
|
2425
|
+
return /* @__PURE__ */ P(le, {
|
|
2418
2426
|
open: h,
|
|
2419
2427
|
onOpenChange: g,
|
|
2420
|
-
children: [/* @__PURE__ */
|
|
2428
|
+
children: [/* @__PURE__ */ N(u, {
|
|
2421
2429
|
asChild: !0,
|
|
2422
2430
|
id: t,
|
|
2423
|
-
children: /* @__PURE__ */
|
|
2431
|
+
children: /* @__PURE__ */ P(p, {
|
|
2424
2432
|
type: "button",
|
|
2425
2433
|
variant: "outline",
|
|
2426
2434
|
role: "combobox",
|
|
2427
2435
|
"aria-expanded": h,
|
|
2428
2436
|
className: d("w-full justify-between font-normal", l),
|
|
2429
|
-
children: [/* @__PURE__ */
|
|
2437
|
+
children: [/* @__PURE__ */ N("span", {
|
|
2430
2438
|
className: "truncate",
|
|
2431
2439
|
children: w && ee ? ee.label : i
|
|
2432
|
-
}), /* @__PURE__ */
|
|
2440
|
+
}), /* @__PURE__ */ N(Ie, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })]
|
|
2433
2441
|
})
|
|
2434
|
-
}), /* @__PURE__ */
|
|
2442
|
+
}), /* @__PURE__ */ N(_, {
|
|
2435
2443
|
className: "w-full p-0",
|
|
2436
2444
|
align: "start",
|
|
2437
|
-
children: /* @__PURE__ */
|
|
2445
|
+
children: /* @__PURE__ */ P(ie, {
|
|
2438
2446
|
shouldFilter: !1,
|
|
2439
|
-
children: [/* @__PURE__ */
|
|
2447
|
+
children: [/* @__PURE__ */ N(y, {
|
|
2440
2448
|
placeholder: a,
|
|
2441
2449
|
value: v,
|
|
2442
2450
|
onValueChange: b
|
|
2443
|
-
}), /* @__PURE__ */
|
|
2444
|
-
/* @__PURE__ */
|
|
2445
|
-
f && w && /* @__PURE__ */
|
|
2451
|
+
}), /* @__PURE__ */ P(O, { children: [
|
|
2452
|
+
/* @__PURE__ */ N(oe, { children: c }),
|
|
2453
|
+
f && w && /* @__PURE__ */ N(te, { children: /* @__PURE__ */ P(D, {
|
|
2446
2454
|
value: "__clear__",
|
|
2447
2455
|
onSelect: () => {
|
|
2448
2456
|
r?.(""), g(!1), b("");
|
|
2449
2457
|
},
|
|
2450
2458
|
className: "mt-1 text-muted-foreground",
|
|
2451
|
-
children: [/* @__PURE__ */
|
|
2459
|
+
children: [/* @__PURE__ */ N(L, { className: "mr-2 h-4 w-4" }), s]
|
|
2452
2460
|
}) }),
|
|
2453
|
-
/* @__PURE__ */
|
|
2461
|
+
/* @__PURE__ */ P(te, { children: [E && /* @__PURE__ */ P(D, {
|
|
2454
2462
|
value: `__create__${v}`,
|
|
2455
2463
|
onSelect: () => {
|
|
2456
2464
|
v.trim() && (r?.(v.trim()), g(!1), b(""));
|
|
2457
2465
|
},
|
|
2458
2466
|
className: "text-primary",
|
|
2459
|
-
children: [/* @__PURE__ */
|
|
2467
|
+
children: [/* @__PURE__ */ N(I, { className: "mr-2 h-4 w-4" }), o(v)]
|
|
2460
2468
|
}), e.filter((e) => {
|
|
2461
2469
|
let t = v.toLowerCase();
|
|
2462
2470
|
return e.label.toLowerCase().includes(t) || (e.value?.toLowerCase() ?? "").includes(t);
|
|
2463
|
-
}).map((e, t) => /* @__PURE__ */
|
|
2471
|
+
}).map((e, t) => /* @__PURE__ */ P(D, {
|
|
2464
2472
|
value: e.label,
|
|
2465
2473
|
onSelect: () => ne(e?.value || ""),
|
|
2466
|
-
children: [/* @__PURE__ */
|
|
2474
|
+
children: [/* @__PURE__ */ N(Ne, {
|
|
2467
2475
|
"aria-hidden": "true",
|
|
2468
2476
|
className: d("mr-2 h-4 w-4", w && x(e.value) === C ? "opacity-100" : "opacity-0")
|
|
2469
2477
|
}), e.label]
|
|
@@ -2481,9 +2489,9 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2481
2489
|
}).map(([e, t]) => ({
|
|
2482
2490
|
label: e.charAt(0).toUpperCase() + e.slice(1).replace(/_/g, " "),
|
|
2483
2491
|
value: t
|
|
2484
|
-
})), Vn = ({ id: e, value: t, onValueChange: n }) => /* @__PURE__ */
|
|
2492
|
+
})), Vn = ({ id: e, value: t, onValueChange: n }) => /* @__PURE__ */ N(zn, {
|
|
2485
2493
|
id: e,
|
|
2486
|
-
options:
|
|
2494
|
+
options: yt(() => t && !Bn.some((e) => e.value === t) ? [...Bn, {
|
|
2487
2495
|
label: `Custom: ${t}`,
|
|
2488
2496
|
value: t
|
|
2489
2497
|
}] : Bn, [t]),
|
|
@@ -2515,9 +2523,9 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2515
2523
|
}
|
|
2516
2524
|
}, Jn = ({ value: e, onChange: t }) => {
|
|
2517
2525
|
let n = bt(null), r = bt(null), [i, a] = z(!1), [o, s] = z(e && /^https?:\/\//i.test(e) ? e : ""), c = G();
|
|
2518
|
-
|
|
2526
|
+
_t(() => {
|
|
2519
2527
|
i || s(e && /^https?:\/\//i.test(e) ? e : "");
|
|
2520
|
-
}, [i, e]),
|
|
2528
|
+
}, [i, e]), _t(() => () => {
|
|
2521
2529
|
r.current && clearTimeout(r.current);
|
|
2522
2530
|
}, []);
|
|
2523
2531
|
let l = async (e) => {
|
|
@@ -2534,53 +2542,53 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2534
2542
|
let e = o.trim();
|
|
2535
2543
|
e && (t(e), a(!1));
|
|
2536
2544
|
};
|
|
2537
|
-
return /* @__PURE__ */
|
|
2545
|
+
return /* @__PURE__ */ P("div", {
|
|
2538
2546
|
className: "relative",
|
|
2539
2547
|
children: [
|
|
2540
|
-
/* @__PURE__ */
|
|
2548
|
+
/* @__PURE__ */ N("input", {
|
|
2541
2549
|
ref: n,
|
|
2542
2550
|
type: "file",
|
|
2543
2551
|
accept: "image/*",
|
|
2544
2552
|
className: "hidden",
|
|
2545
2553
|
onChange: l
|
|
2546
2554
|
}),
|
|
2547
|
-
/* @__PURE__ */
|
|
2555
|
+
/* @__PURE__ */ P(le, {
|
|
2548
2556
|
open: i,
|
|
2549
2557
|
onOpenChange: a,
|
|
2550
|
-
children: [/* @__PURE__ */
|
|
2558
|
+
children: [/* @__PURE__ */ N(u, {
|
|
2551
2559
|
asChild: !0,
|
|
2552
|
-
children: e ? /* @__PURE__ */
|
|
2560
|
+
children: e ? /* @__PURE__ */ N("button", {
|
|
2553
2561
|
type: "button",
|
|
2554
2562
|
className: "h-9 w-9 cursor-pointer overflow-hidden rounded-md border border-input",
|
|
2555
2563
|
"aria-label": c("editor.inputNodeForm.optionImageReplace"),
|
|
2556
|
-
children: /* @__PURE__ */
|
|
2564
|
+
children: /* @__PURE__ */ N("img", {
|
|
2557
2565
|
src: e,
|
|
2558
2566
|
alt: "",
|
|
2559
2567
|
className: "h-full w-full object-cover"
|
|
2560
2568
|
})
|
|
2561
|
-
}) : /* @__PURE__ */
|
|
2569
|
+
}) : /* @__PURE__ */ N(p, {
|
|
2562
2570
|
type: "button",
|
|
2563
2571
|
variant: "outline",
|
|
2564
2572
|
size: "icon",
|
|
2565
2573
|
"aria-label": c("editor.inputNodeForm.optionImageAdd"),
|
|
2566
|
-
children: /* @__PURE__ */
|
|
2574
|
+
children: /* @__PURE__ */ N(Ke, { className: "h-4 w-4" })
|
|
2567
2575
|
})
|
|
2568
|
-
}), /* @__PURE__ */
|
|
2576
|
+
}), /* @__PURE__ */ P(_, {
|
|
2569
2577
|
align: "start",
|
|
2570
2578
|
className: "w-64 space-y-3 p-3",
|
|
2571
2579
|
children: [
|
|
2572
|
-
/* @__PURE__ */
|
|
2580
|
+
/* @__PURE__ */ P(p, {
|
|
2573
2581
|
type: "button",
|
|
2574
2582
|
variant: "outline",
|
|
2575
2583
|
size: "sm",
|
|
2576
2584
|
className: "w-full",
|
|
2577
2585
|
onClick: () => n.current?.click(),
|
|
2578
|
-
children: [/* @__PURE__ */
|
|
2586
|
+
children: [/* @__PURE__ */ N(lt, { className: "mr-2 h-4 w-4" }), c("editor.inputNodeForm.optionImageUpload")]
|
|
2579
2587
|
}),
|
|
2580
|
-
/* @__PURE__ */
|
|
2581
|
-
/* @__PURE__ */
|
|
2588
|
+
/* @__PURE__ */ N(se, {}),
|
|
2589
|
+
/* @__PURE__ */ P("div", {
|
|
2582
2590
|
className: "flex items-center gap-2",
|
|
2583
|
-
children: [/* @__PURE__ */
|
|
2591
|
+
children: [/* @__PURE__ */ N(Je, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), /* @__PURE__ */ N(m, {
|
|
2584
2592
|
placeholder: c("editor.inputNodeForm.optionImageUrlPlaceholder"),
|
|
2585
2593
|
value: o,
|
|
2586
2594
|
onChange: (n) => {
|
|
@@ -2600,52 +2608,52 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2600
2608
|
]
|
|
2601
2609
|
})]
|
|
2602
2610
|
}),
|
|
2603
|
-
e && /* @__PURE__ */
|
|
2611
|
+
e && /* @__PURE__ */ N("button", {
|
|
2604
2612
|
type: "button",
|
|
2605
2613
|
onClick: (e) => {
|
|
2606
2614
|
e.stopPropagation(), t("");
|
|
2607
2615
|
},
|
|
2608
2616
|
className: "-top-1 -right-1 absolute flex h-4 w-4 cursor-pointer items-center justify-center rounded-full bg-destructive text-destructive-foreground",
|
|
2609
2617
|
"aria-label": c("editor.inputNodeForm.optionImageRemove"),
|
|
2610
|
-
children: /* @__PURE__ */
|
|
2618
|
+
children: /* @__PURE__ */ N(L, { className: "h-3 w-3" })
|
|
2611
2619
|
})
|
|
2612
2620
|
]
|
|
2613
2621
|
});
|
|
2614
2622
|
}, Yn = ({ value: e, onValueChange: t }) => {
|
|
2615
|
-
let n = G(), r =
|
|
2616
|
-
return /* @__PURE__ */
|
|
2623
|
+
let n = G(), r = vt();
|
|
2624
|
+
return /* @__PURE__ */ P(A, { children: [/* @__PURE__ */ N(ue, {
|
|
2617
2625
|
htmlFor: r,
|
|
2618
2626
|
children: n("editor.selectInputType.type")
|
|
2619
|
-
}), /* @__PURE__ */
|
|
2627
|
+
}), /* @__PURE__ */ P(v, {
|
|
2620
2628
|
value: e,
|
|
2621
2629
|
onValueChange: t,
|
|
2622
|
-
children: [/* @__PURE__ */
|
|
2630
|
+
children: [/* @__PURE__ */ N(g, {
|
|
2623
2631
|
id: r,
|
|
2624
2632
|
className: "w-full capitalize",
|
|
2625
|
-
children: /* @__PURE__ */
|
|
2626
|
-
}), /* @__PURE__ */
|
|
2633
|
+
children: /* @__PURE__ */ N(c, { placeholder: "" })
|
|
2634
|
+
}), /* @__PURE__ */ N(k, { children: /* @__PURE__ */ N(A, { children: Object.values(K).map((e) => /* @__PURE__ */ P(b, {
|
|
2627
2635
|
value: e,
|
|
2628
2636
|
className: "capitalize",
|
|
2629
|
-
children: [/* @__PURE__ */
|
|
2637
|
+
children: [/* @__PURE__ */ N($t(e), {}), e]
|
|
2630
2638
|
}, e)) }) })]
|
|
2631
2639
|
})] });
|
|
2632
2640
|
};
|
|
2633
2641
|
//#endregion
|
|
2634
2642
|
//#region src/shared/components/ui/collapsible.tsx
|
|
2635
2643
|
function Xn({ ...e }) {
|
|
2636
|
-
return /* @__PURE__ */
|
|
2644
|
+
return /* @__PURE__ */ N(Tt.Root, {
|
|
2637
2645
|
"data-slot": "collapsible",
|
|
2638
2646
|
...e
|
|
2639
2647
|
});
|
|
2640
2648
|
}
|
|
2641
2649
|
function Zn({ ...e }) {
|
|
2642
|
-
return /* @__PURE__ */
|
|
2650
|
+
return /* @__PURE__ */ N(Tt.CollapsibleTrigger, {
|
|
2643
2651
|
"data-slot": "collapsible-trigger",
|
|
2644
2652
|
...e
|
|
2645
2653
|
});
|
|
2646
2654
|
}
|
|
2647
2655
|
function Qn({ ...e }) {
|
|
2648
|
-
return /* @__PURE__ */
|
|
2656
|
+
return /* @__PURE__ */ N(Tt.CollapsibleContent, {
|
|
2649
2657
|
"data-slot": "collapsible-content",
|
|
2650
2658
|
...e
|
|
2651
2659
|
});
|
|
@@ -2658,7 +2666,7 @@ var $n = () => {
|
|
|
2658
2666
|
"radio",
|
|
2659
2667
|
"autocomplete",
|
|
2660
2668
|
"checkbox"
|
|
2661
|
-
].includes(n?.data?.type || ""), a = At(n?.id), o = G(), s = n?.data?.type === "submit", { handleSubmit: u, Field: d } =
|
|
2669
|
+
].includes(n?.data?.type || ""), a = At(n?.id), o = G(), s = n?.data?.type === "submit", { handleSubmit: u, Field: d } = F({
|
|
2662
2670
|
defaultValues: {
|
|
2663
2671
|
defaultValue: n?.data?.defaultValue,
|
|
2664
2672
|
disablePast: n?.data?.disablePast,
|
|
@@ -2686,30 +2694,30 @@ var $n = () => {
|
|
|
2686
2694
|
r(e);
|
|
2687
2695
|
}
|
|
2688
2696
|
});
|
|
2689
|
-
return /* @__PURE__ */
|
|
2697
|
+
return /* @__PURE__ */ N("form", {
|
|
2690
2698
|
onSubmit: (e) => {
|
|
2691
2699
|
e.preventDefault(), e.stopPropagation();
|
|
2692
2700
|
},
|
|
2693
|
-
children: /* @__PURE__ */
|
|
2701
|
+
children: /* @__PURE__ */ P("div", {
|
|
2694
2702
|
className: "grid gap-6",
|
|
2695
2703
|
children: [
|
|
2696
|
-
/* @__PURE__ */
|
|
2704
|
+
/* @__PURE__ */ N(d, {
|
|
2697
2705
|
name: "type",
|
|
2698
|
-
children: (e) => /* @__PURE__ */
|
|
2706
|
+
children: (e) => /* @__PURE__ */ N(T, { children: /* @__PURE__ */ N(Yn, {
|
|
2699
2707
|
value: e.state.value,
|
|
2700
2708
|
onValueChange: (t) => e.handleChange(t)
|
|
2701
2709
|
}) })
|
|
2702
2710
|
}),
|
|
2703
|
-
/* @__PURE__ */
|
|
2711
|
+
/* @__PURE__ */ P("div", {
|
|
2704
2712
|
className: "flex items-end gap-2",
|
|
2705
|
-
children: [/* @__PURE__ */
|
|
2713
|
+
children: [/* @__PURE__ */ N(d, {
|
|
2706
2714
|
name: "label",
|
|
2707
|
-
children: (t) => /* @__PURE__ */
|
|
2715
|
+
children: (t) => /* @__PURE__ */ P(T, {
|
|
2708
2716
|
className: "flex-1",
|
|
2709
|
-
children: [/* @__PURE__ */
|
|
2717
|
+
children: [/* @__PURE__ */ N(l, {
|
|
2710
2718
|
htmlFor: t.name,
|
|
2711
2719
|
children: o("editor.inputNodeForm.label")
|
|
2712
|
-
}), /* @__PURE__ */
|
|
2720
|
+
}), /* @__PURE__ */ N(m, {
|
|
2713
2721
|
autoFocus: !0,
|
|
2714
2722
|
id: t.name,
|
|
2715
2723
|
name: t.name,
|
|
@@ -2723,21 +2731,21 @@ var $n = () => {
|
|
|
2723
2731
|
}
|
|
2724
2732
|
})]
|
|
2725
2733
|
})
|
|
2726
|
-
}), /* @__PURE__ */
|
|
2734
|
+
}), /* @__PURE__ */ N(Q, {
|
|
2727
2735
|
value: e,
|
|
2728
2736
|
onValueChange: t
|
|
2729
2737
|
})]
|
|
2730
2738
|
}),
|
|
2731
|
-
!s && n?.data?.type !== "file" && /* @__PURE__ */
|
|
2739
|
+
!s && n?.data?.type !== "file" && /* @__PURE__ */ P("div", {
|
|
2732
2740
|
className: "flex items-end gap-2",
|
|
2733
|
-
children: [/* @__PURE__ */
|
|
2741
|
+
children: [/* @__PURE__ */ N(d, {
|
|
2734
2742
|
name: "placeholder",
|
|
2735
|
-
children: (t) => /* @__PURE__ */
|
|
2743
|
+
children: (t) => /* @__PURE__ */ P(T, {
|
|
2736
2744
|
className: "flex-1",
|
|
2737
|
-
children: [/* @__PURE__ */
|
|
2745
|
+
children: [/* @__PURE__ */ N(l, {
|
|
2738
2746
|
htmlFor: t.name,
|
|
2739
2747
|
children: o("editor.inputNodeForm.placeholder")
|
|
2740
|
-
}), /* @__PURE__ */
|
|
2748
|
+
}), /* @__PURE__ */ N(m, {
|
|
2741
2749
|
id: t.name,
|
|
2742
2750
|
name: t.name,
|
|
2743
2751
|
value: t.state.value?.[e] || "",
|
|
@@ -2750,21 +2758,21 @@ var $n = () => {
|
|
|
2750
2758
|
}
|
|
2751
2759
|
})]
|
|
2752
2760
|
})
|
|
2753
|
-
}), /* @__PURE__ */
|
|
2761
|
+
}), /* @__PURE__ */ N(Q, {
|
|
2754
2762
|
value: e,
|
|
2755
2763
|
onValueChange: t
|
|
2756
2764
|
})]
|
|
2757
2765
|
}),
|
|
2758
|
-
!s && /* @__PURE__ */
|
|
2766
|
+
!s && /* @__PURE__ */ P("div", {
|
|
2759
2767
|
className: "flex items-end gap-2",
|
|
2760
|
-
children: [/* @__PURE__ */
|
|
2768
|
+
children: [/* @__PURE__ */ N(d, {
|
|
2761
2769
|
name: "helperText",
|
|
2762
|
-
children: (t) => /* @__PURE__ */
|
|
2770
|
+
children: (t) => /* @__PURE__ */ P(T, {
|
|
2763
2771
|
className: "flex-1",
|
|
2764
|
-
children: [/* @__PURE__ */
|
|
2772
|
+
children: [/* @__PURE__ */ N(l, {
|
|
2765
2773
|
htmlFor: t.name,
|
|
2766
2774
|
children: o("editor.inputNodeForm.helperText")
|
|
2767
|
-
}), /* @__PURE__ */
|
|
2775
|
+
}), /* @__PURE__ */ N(m, {
|
|
2768
2776
|
id: t.name,
|
|
2769
2777
|
name: t.name,
|
|
2770
2778
|
value: t.state.value?.[e] || "",
|
|
@@ -2777,36 +2785,36 @@ var $n = () => {
|
|
|
2777
2785
|
}
|
|
2778
2786
|
})]
|
|
2779
2787
|
})
|
|
2780
|
-
}), /* @__PURE__ */
|
|
2788
|
+
}), /* @__PURE__ */ N(Q, {
|
|
2781
2789
|
value: e,
|
|
2782
2790
|
onValueChange: t
|
|
2783
2791
|
})]
|
|
2784
2792
|
}),
|
|
2785
|
-
n?.data?.type === "http" && /* @__PURE__ */
|
|
2793
|
+
n?.data?.type === "http" && /* @__PURE__ */ P(Xn, {
|
|
2786
2794
|
defaultOpen: !0,
|
|
2787
2795
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
2788
|
-
children: [/* @__PURE__ */
|
|
2796
|
+
children: [/* @__PURE__ */ N(Zn, {
|
|
2789
2797
|
asChild: !0,
|
|
2790
|
-
children: /* @__PURE__ */
|
|
2798
|
+
children: /* @__PURE__ */ P("div", {
|
|
2791
2799
|
className: "flex items-center justify-between gap-4",
|
|
2792
|
-
children: [/* @__PURE__ */
|
|
2800
|
+
children: [/* @__PURE__ */ N("h4", {
|
|
2793
2801
|
className: "font-semibold text-sm",
|
|
2794
2802
|
children: o("editor.inputNodeForm.httpConfiguration")
|
|
2795
|
-
}), /* @__PURE__ */
|
|
2803
|
+
}), /* @__PURE__ */ P(p, {
|
|
2796
2804
|
variant: "ghost",
|
|
2797
2805
|
size: "icon",
|
|
2798
2806
|
className: "size-8",
|
|
2799
|
-
children: [/* @__PURE__ */
|
|
2807
|
+
children: [/* @__PURE__ */ N(Ie, {}), /* @__PURE__ */ N("span", {
|
|
2800
2808
|
className: "sr-only",
|
|
2801
2809
|
children: o("common.toggle")
|
|
2802
2810
|
})]
|
|
2803
2811
|
})]
|
|
2804
2812
|
})
|
|
2805
|
-
}), /* @__PURE__ */
|
|
2813
|
+
}), /* @__PURE__ */ N(Qn, {
|
|
2806
2814
|
className: "flex flex-col gap-4",
|
|
2807
|
-
children: /* @__PURE__ */
|
|
2815
|
+
children: /* @__PURE__ */ N(d, {
|
|
2808
2816
|
name: "httpConfig",
|
|
2809
|
-
children: (e) => /* @__PURE__ */
|
|
2817
|
+
children: (e) => /* @__PURE__ */ N(In, {
|
|
2810
2818
|
value: e.state.value,
|
|
2811
2819
|
onChange: (t) => {
|
|
2812
2820
|
e.handleChange(t), u().then();
|
|
@@ -2815,30 +2823,30 @@ var $n = () => {
|
|
|
2815
2823
|
})
|
|
2816
2824
|
})]
|
|
2817
2825
|
}),
|
|
2818
|
-
s && /* @__PURE__ */
|
|
2826
|
+
s && /* @__PURE__ */ P(Xn, {
|
|
2819
2827
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
2820
|
-
children: [/* @__PURE__ */
|
|
2828
|
+
children: [/* @__PURE__ */ N(Zn, {
|
|
2821
2829
|
asChild: !0,
|
|
2822
|
-
children: /* @__PURE__ */
|
|
2830
|
+
children: /* @__PURE__ */ P("div", {
|
|
2823
2831
|
className: "flex items-center justify-between gap-4",
|
|
2824
|
-
children: [/* @__PURE__ */
|
|
2832
|
+
children: [/* @__PURE__ */ N("h4", {
|
|
2825
2833
|
className: "font-semibold text-sm",
|
|
2826
2834
|
children: o("editor.inputNodeForm.submitConfiguration")
|
|
2827
|
-
}), /* @__PURE__ */
|
|
2835
|
+
}), /* @__PURE__ */ P(p, {
|
|
2828
2836
|
variant: "ghost",
|
|
2829
2837
|
size: "icon",
|
|
2830
2838
|
className: "size-8",
|
|
2831
|
-
children: [/* @__PURE__ */
|
|
2839
|
+
children: [/* @__PURE__ */ N(Ie, {}), /* @__PURE__ */ N("span", {
|
|
2832
2840
|
className: "sr-only",
|
|
2833
2841
|
children: o("common.toggle")
|
|
2834
2842
|
})]
|
|
2835
2843
|
})]
|
|
2836
2844
|
})
|
|
2837
|
-
}), /* @__PURE__ */
|
|
2845
|
+
}), /* @__PURE__ */ N(Qn, {
|
|
2838
2846
|
className: "flex flex-col gap-4",
|
|
2839
|
-
children: /* @__PURE__ */
|
|
2847
|
+
children: /* @__PURE__ */ N(d, {
|
|
2840
2848
|
name: "submitConfig",
|
|
2841
|
-
children: (e) => /* @__PURE__ */
|
|
2849
|
+
children: (e) => /* @__PURE__ */ N(Rn, {
|
|
2842
2850
|
value: e.state.value,
|
|
2843
2851
|
onChange: (t) => {
|
|
2844
2852
|
e.handleChange(t), u().then();
|
|
@@ -2847,65 +2855,65 @@ var $n = () => {
|
|
|
2847
2855
|
})
|
|
2848
2856
|
})]
|
|
2849
2857
|
}),
|
|
2850
|
-
n?.data?.type === "file" && /* @__PURE__ */
|
|
2858
|
+
n?.data?.type === "file" && /* @__PURE__ */ N(d, {
|
|
2851
2859
|
name: "multiple",
|
|
2852
|
-
children: (e) => /* @__PURE__ */
|
|
2860
|
+
children: (e) => /* @__PURE__ */ P("div", {
|
|
2853
2861
|
className: "flex items-center space-x-2",
|
|
2854
|
-
children: [/* @__PURE__ */
|
|
2862
|
+
children: [/* @__PURE__ */ N(x, {
|
|
2855
2863
|
id: e.name,
|
|
2856
2864
|
checked: e.state.value,
|
|
2857
2865
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2858
|
-
}), /* @__PURE__ */
|
|
2866
|
+
}), /* @__PURE__ */ N(l, {
|
|
2859
2867
|
htmlFor: e.name,
|
|
2860
2868
|
children: o("editor.inputNodeForm.multipleFiles")
|
|
2861
2869
|
})]
|
|
2862
2870
|
})
|
|
2863
2871
|
}),
|
|
2864
|
-
i && /* @__PURE__ */
|
|
2872
|
+
i && /* @__PURE__ */ P(Xn, {
|
|
2865
2873
|
defaultOpen: !0,
|
|
2866
2874
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
2867
|
-
children: [/* @__PURE__ */
|
|
2875
|
+
children: [/* @__PURE__ */ N(Zn, {
|
|
2868
2876
|
asChild: !0,
|
|
2869
|
-
children: /* @__PURE__ */
|
|
2877
|
+
children: /* @__PURE__ */ P("div", {
|
|
2870
2878
|
className: "flex items-center justify-between gap-4",
|
|
2871
|
-
children: [/* @__PURE__ */
|
|
2879
|
+
children: [/* @__PURE__ */ N("h4", {
|
|
2872
2880
|
className: "font-semibold text-sm",
|
|
2873
2881
|
children: o("editor.inputNodeForm.options")
|
|
2874
|
-
}), /* @__PURE__ */
|
|
2882
|
+
}), /* @__PURE__ */ P(p, {
|
|
2875
2883
|
variant: "ghost",
|
|
2876
2884
|
size: "icon",
|
|
2877
2885
|
className: "size-8",
|
|
2878
|
-
children: [/* @__PURE__ */
|
|
2886
|
+
children: [/* @__PURE__ */ N(Ie, {}), /* @__PURE__ */ N("span", {
|
|
2879
2887
|
className: "sr-only",
|
|
2880
2888
|
children: o("common.toggle")
|
|
2881
2889
|
})]
|
|
2882
2890
|
})]
|
|
2883
2891
|
})
|
|
2884
|
-
}), /* @__PURE__ */
|
|
2892
|
+
}), /* @__PURE__ */ P(Qn, {
|
|
2885
2893
|
className: "flex flex-col gap-4",
|
|
2886
2894
|
children: [
|
|
2887
|
-
/* @__PURE__ */
|
|
2895
|
+
/* @__PURE__ */ N(d, {
|
|
2888
2896
|
name: "options",
|
|
2889
2897
|
mode: "array",
|
|
2890
|
-
children: (t) => /* @__PURE__ */
|
|
2898
|
+
children: (t) => /* @__PURE__ */ P("div", {
|
|
2891
2899
|
className: "space-y-2",
|
|
2892
2900
|
children: [t.state.value?.map((r, i) => {
|
|
2893
2901
|
let a = `options[${i}]`;
|
|
2894
|
-
return /* @__PURE__ */
|
|
2902
|
+
return /* @__PURE__ */ P("div", {
|
|
2895
2903
|
className: "flex flex-col gap-2",
|
|
2896
|
-
children: [/* @__PURE__ */
|
|
2904
|
+
children: [/* @__PURE__ */ P("div", {
|
|
2897
2905
|
className: "flex items-start gap-2",
|
|
2898
2906
|
children: [
|
|
2899
|
-
n?.data?.type === "radio" && /* @__PURE__ */
|
|
2907
|
+
n?.data?.type === "radio" && /* @__PURE__ */ N(d, {
|
|
2900
2908
|
name: `options[${i}].image`,
|
|
2901
|
-
children: (e) => /* @__PURE__ */
|
|
2909
|
+
children: (e) => /* @__PURE__ */ N(Jn, {
|
|
2902
2910
|
value: e.state.value,
|
|
2903
2911
|
onChange: (t) => e.handleChange(t)
|
|
2904
2912
|
})
|
|
2905
2913
|
}),
|
|
2906
|
-
/* @__PURE__ */
|
|
2914
|
+
/* @__PURE__ */ N(d, {
|
|
2907
2915
|
name: `options[${i}].label`,
|
|
2908
|
-
children: (t) => /* @__PURE__ */
|
|
2916
|
+
children: (t) => /* @__PURE__ */ N(m, {
|
|
2909
2917
|
placeholder: o("editor.inputNodeForm.optionLabel"),
|
|
2910
2918
|
value: t.state.value?.[e] || "",
|
|
2911
2919
|
onChange: ({ target: n }) => {
|
|
@@ -2916,27 +2924,27 @@ var $n = () => {
|
|
|
2916
2924
|
}
|
|
2917
2925
|
})
|
|
2918
2926
|
}),
|
|
2919
|
-
/* @__PURE__ */
|
|
2927
|
+
/* @__PURE__ */ N(d, {
|
|
2920
2928
|
name: `options[${i}].value`,
|
|
2921
|
-
children: (e) => /* @__PURE__ */
|
|
2929
|
+
children: (e) => /* @__PURE__ */ N(m, {
|
|
2922
2930
|
placeholder: o("editor.inputNodeForm.optionValue"),
|
|
2923
2931
|
value: e.state.value || "",
|
|
2924
2932
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
2925
2933
|
})
|
|
2926
2934
|
}),
|
|
2927
|
-
/* @__PURE__ */
|
|
2935
|
+
/* @__PURE__ */ N(p, {
|
|
2928
2936
|
type: "button",
|
|
2929
2937
|
variant: "ghost",
|
|
2930
2938
|
size: "icon",
|
|
2931
2939
|
onClick: () => {
|
|
2932
2940
|
t.removeValue(i), u().then();
|
|
2933
2941
|
},
|
|
2934
|
-
children: /* @__PURE__ */
|
|
2942
|
+
children: /* @__PURE__ */ N(L, { className: "h-4 w-4" })
|
|
2935
2943
|
})
|
|
2936
2944
|
]
|
|
2937
|
-
}), (n?.data?.type === "radio" || n?.data?.type === "checkbox") && /* @__PURE__ */
|
|
2945
|
+
}), (n?.data?.type === "radio" || n?.data?.type === "checkbox") && /* @__PURE__ */ N(d, {
|
|
2938
2946
|
name: `options[${i}].description`,
|
|
2939
|
-
children: (t) => /* @__PURE__ */
|
|
2947
|
+
children: (t) => /* @__PURE__ */ N(m, {
|
|
2940
2948
|
placeholder: o("editor.inputNodeForm.optionDescription"),
|
|
2941
2949
|
value: t.state.value?.[e] || "",
|
|
2942
2950
|
onChange: ({ target: n }) => {
|
|
@@ -2948,7 +2956,7 @@ var $n = () => {
|
|
|
2948
2956
|
})
|
|
2949
2957
|
})]
|
|
2950
2958
|
}, a);
|
|
2951
|
-
}), /* @__PURE__ */
|
|
2959
|
+
}), /* @__PURE__ */ N(p, {
|
|
2952
2960
|
type: "button",
|
|
2953
2961
|
variant: "outline",
|
|
2954
2962
|
size: "sm",
|
|
@@ -2962,36 +2970,36 @@ var $n = () => {
|
|
|
2962
2970
|
})]
|
|
2963
2971
|
})
|
|
2964
2972
|
}),
|
|
2965
|
-
n?.data?.type === "select" && /* @__PURE__ */
|
|
2973
|
+
n?.data?.type === "select" && /* @__PURE__ */ N(d, {
|
|
2966
2974
|
name: "multiple",
|
|
2967
|
-
children: (e) => /* @__PURE__ */
|
|
2975
|
+
children: (e) => /* @__PURE__ */ P("div", {
|
|
2968
2976
|
className: "flex items-center space-x-2",
|
|
2969
|
-
children: [/* @__PURE__ */
|
|
2977
|
+
children: [/* @__PURE__ */ N(x, {
|
|
2970
2978
|
id: e.name,
|
|
2971
2979
|
checked: e.state.value,
|
|
2972
2980
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2973
|
-
}), /* @__PURE__ */
|
|
2981
|
+
}), /* @__PURE__ */ N(l, {
|
|
2974
2982
|
htmlFor: e.name,
|
|
2975
2983
|
children: o("editor.inputNodeForm.multipleSelection")
|
|
2976
2984
|
})]
|
|
2977
2985
|
})
|
|
2978
2986
|
}),
|
|
2979
|
-
n?.data?.type === "radio" && /* @__PURE__ */
|
|
2987
|
+
n?.data?.type === "radio" && /* @__PURE__ */ N(d, {
|
|
2980
2988
|
name: "variant",
|
|
2981
|
-
children: (e) => /* @__PURE__ */
|
|
2989
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [/* @__PURE__ */ N(l, {
|
|
2982
2990
|
htmlFor: e.name,
|
|
2983
2991
|
children: o("editor.inputNodeForm.variant")
|
|
2984
|
-
}), /* @__PURE__ */
|
|
2992
|
+
}), /* @__PURE__ */ P(v, {
|
|
2985
2993
|
value: e.state.value || "default",
|
|
2986
2994
|
onValueChange: (t) => e.handleChange(t),
|
|
2987
|
-
children: [/* @__PURE__ */
|
|
2995
|
+
children: [/* @__PURE__ */ N(g, {
|
|
2988
2996
|
id: e.name,
|
|
2989
2997
|
className: "w-full",
|
|
2990
|
-
children: /* @__PURE__ */
|
|
2991
|
-
}), /* @__PURE__ */
|
|
2998
|
+
children: /* @__PURE__ */ N(c, {})
|
|
2999
|
+
}), /* @__PURE__ */ P(k, { children: [/* @__PURE__ */ N(b, {
|
|
2992
3000
|
value: "default",
|
|
2993
3001
|
children: o("editor.inputNodeForm.variantDefault")
|
|
2994
|
-
}), /* @__PURE__ */
|
|
3002
|
+
}), /* @__PURE__ */ N(b, {
|
|
2995
3003
|
value: "card",
|
|
2996
3004
|
children: o("editor.inputNodeForm.variantCard")
|
|
2997
3005
|
})] })]
|
|
@@ -3000,77 +3008,77 @@ var $n = () => {
|
|
|
3000
3008
|
]
|
|
3001
3009
|
})]
|
|
3002
3010
|
}),
|
|
3003
|
-
!s && /* @__PURE__ */
|
|
3011
|
+
!s && /* @__PURE__ */ P(Xn, {
|
|
3004
3012
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
3005
|
-
children: [/* @__PURE__ */
|
|
3013
|
+
children: [/* @__PURE__ */ N(Zn, {
|
|
3006
3014
|
asChild: !0,
|
|
3007
|
-
children: /* @__PURE__ */
|
|
3015
|
+
children: /* @__PURE__ */ P("div", {
|
|
3008
3016
|
className: "flex items-center justify-between gap-4",
|
|
3009
|
-
children: [/* @__PURE__ */
|
|
3017
|
+
children: [/* @__PURE__ */ N("h4", {
|
|
3010
3018
|
className: "font-semibold text-sm",
|
|
3011
3019
|
children: o("editor.inputNodeForm.validation")
|
|
3012
|
-
}), /* @__PURE__ */
|
|
3020
|
+
}), /* @__PURE__ */ P(p, {
|
|
3013
3021
|
variant: "ghost",
|
|
3014
3022
|
size: "icon",
|
|
3015
3023
|
className: "size-8",
|
|
3016
|
-
children: [/* @__PURE__ */
|
|
3024
|
+
children: [/* @__PURE__ */ N(Ie, {}), /* @__PURE__ */ N("span", {
|
|
3017
3025
|
className: "sr-only",
|
|
3018
3026
|
children: o("common.toggle")
|
|
3019
3027
|
})]
|
|
3020
3028
|
})]
|
|
3021
3029
|
})
|
|
3022
|
-
}), /* @__PURE__ */
|
|
3030
|
+
}), /* @__PURE__ */ P(Qn, {
|
|
3023
3031
|
className: "flex flex-col gap-6",
|
|
3024
3032
|
children: [
|
|
3025
|
-
/* @__PURE__ */
|
|
3033
|
+
/* @__PURE__ */ N(d, {
|
|
3026
3034
|
name: "required",
|
|
3027
|
-
children: (e) => /* @__PURE__ */
|
|
3035
|
+
children: (e) => /* @__PURE__ */ N(T, { children: /* @__PURE__ */ P("div", {
|
|
3028
3036
|
className: "flex items-center space-x-2",
|
|
3029
|
-
children: [/* @__PURE__ */
|
|
3037
|
+
children: [/* @__PURE__ */ N(x, {
|
|
3030
3038
|
id: e.name,
|
|
3031
3039
|
checked: e.state.value,
|
|
3032
3040
|
onCheckedChange: (t) => e.handleChange(t)
|
|
3033
|
-
}), /* @__PURE__ */
|
|
3041
|
+
}), /* @__PURE__ */ N(l, {
|
|
3034
3042
|
htmlFor: e.name,
|
|
3035
3043
|
children: o("editor.inputNodeForm.required")
|
|
3036
3044
|
})]
|
|
3037
3045
|
}) })
|
|
3038
3046
|
}),
|
|
3039
|
-
(n?.data?.type === "date" || n?.data?.type === "daterange") && /* @__PURE__ */
|
|
3047
|
+
(n?.data?.type === "date" || n?.data?.type === "daterange") && /* @__PURE__ */ N(d, {
|
|
3040
3048
|
name: "disablePast",
|
|
3041
|
-
children: (e) => /* @__PURE__ */
|
|
3049
|
+
children: (e) => /* @__PURE__ */ N(T, { children: /* @__PURE__ */ P("div", {
|
|
3042
3050
|
className: "flex items-center space-x-2",
|
|
3043
|
-
children: [/* @__PURE__ */
|
|
3051
|
+
children: [/* @__PURE__ */ N(x, {
|
|
3044
3052
|
id: e.name,
|
|
3045
3053
|
checked: e.state.value,
|
|
3046
3054
|
onCheckedChange: (t) => e.handleChange(t)
|
|
3047
|
-
}), /* @__PURE__ */
|
|
3055
|
+
}), /* @__PURE__ */ N(l, {
|
|
3048
3056
|
htmlFor: e.name,
|
|
3049
3057
|
children: o("editor.inputNodeForm.disablePast")
|
|
3050
3058
|
})]
|
|
3051
3059
|
}) })
|
|
3052
3060
|
}),
|
|
3053
|
-
/* @__PURE__ */
|
|
3061
|
+
/* @__PURE__ */ N(d, {
|
|
3054
3062
|
name: "pattern",
|
|
3055
|
-
children: (e) => /* @__PURE__ */
|
|
3063
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [/* @__PURE__ */ N(l, {
|
|
3056
3064
|
htmlFor: e.name,
|
|
3057
3065
|
children: o("editor.inputNodeForm.pattern")
|
|
3058
|
-
}), /* @__PURE__ */
|
|
3066
|
+
}), /* @__PURE__ */ N(Vn, {
|
|
3059
3067
|
id: e.name,
|
|
3060
3068
|
value: e.state.value,
|
|
3061
3069
|
onValueChange: e.handleChange
|
|
3062
3070
|
})] })
|
|
3063
3071
|
}),
|
|
3064
|
-
/* @__PURE__ */
|
|
3072
|
+
/* @__PURE__ */ P("div", {
|
|
3065
3073
|
className: "flex items-end gap-2",
|
|
3066
|
-
children: [/* @__PURE__ */
|
|
3074
|
+
children: [/* @__PURE__ */ N(d, {
|
|
3067
3075
|
name: "errorMessage",
|
|
3068
|
-
children: (t) => /* @__PURE__ */
|
|
3076
|
+
children: (t) => /* @__PURE__ */ P(T, {
|
|
3069
3077
|
className: "flex-1",
|
|
3070
|
-
children: [/* @__PURE__ */
|
|
3078
|
+
children: [/* @__PURE__ */ N(l, {
|
|
3071
3079
|
htmlFor: t.name,
|
|
3072
3080
|
children: o("editor.inputNodeForm.errorMessage")
|
|
3073
|
-
}), /* @__PURE__ */
|
|
3081
|
+
}), /* @__PURE__ */ N(m, {
|
|
3074
3082
|
id: t.name,
|
|
3075
3083
|
name: t.name,
|
|
3076
3084
|
value: t.state.value?.[e] || "",
|
|
@@ -3083,7 +3091,7 @@ var $n = () => {
|
|
|
3083
3091
|
}
|
|
3084
3092
|
})]
|
|
3085
3093
|
})
|
|
3086
|
-
}), /* @__PURE__ */
|
|
3094
|
+
}), /* @__PURE__ */ N(Q, {
|
|
3087
3095
|
value: e,
|
|
3088
3096
|
onValueChange: t
|
|
3089
3097
|
})]
|
|
@@ -3091,80 +3099,80 @@ var $n = () => {
|
|
|
3091
3099
|
]
|
|
3092
3100
|
})]
|
|
3093
3101
|
}),
|
|
3094
|
-
!s && /* @__PURE__ */
|
|
3102
|
+
!s && /* @__PURE__ */ P(Xn, {
|
|
3095
3103
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
3096
|
-
children: [/* @__PURE__ */
|
|
3104
|
+
children: [/* @__PURE__ */ N(Zn, {
|
|
3097
3105
|
asChild: !0,
|
|
3098
|
-
children: /* @__PURE__ */
|
|
3106
|
+
children: /* @__PURE__ */ P("div", {
|
|
3099
3107
|
className: "flex items-center justify-between gap-4",
|
|
3100
|
-
children: [/* @__PURE__ */
|
|
3108
|
+
children: [/* @__PURE__ */ N("h4", {
|
|
3101
3109
|
className: "font-semibold text-sm",
|
|
3102
3110
|
children: o("editor.inputNodeForm.advancedConfiguration")
|
|
3103
|
-
}), /* @__PURE__ */
|
|
3111
|
+
}), /* @__PURE__ */ P(p, {
|
|
3104
3112
|
variant: "ghost",
|
|
3105
3113
|
size: "icon",
|
|
3106
3114
|
className: "size-8",
|
|
3107
|
-
children: [/* @__PURE__ */
|
|
3115
|
+
children: [/* @__PURE__ */ N(Ie, {}), /* @__PURE__ */ N("span", {
|
|
3108
3116
|
className: "sr-only",
|
|
3109
3117
|
children: o("common.toggle")
|
|
3110
3118
|
})]
|
|
3111
3119
|
})]
|
|
3112
3120
|
})
|
|
3113
|
-
}), /* @__PURE__ */
|
|
3121
|
+
}), /* @__PURE__ */ P(Qn, {
|
|
3114
3122
|
className: "flex flex-col gap-6",
|
|
3115
|
-
children: [/* @__PURE__ */
|
|
3123
|
+
children: [/* @__PURE__ */ N(d, {
|
|
3116
3124
|
name: "name",
|
|
3117
|
-
children: (e) => /* @__PURE__ */
|
|
3118
|
-
/* @__PURE__ */
|
|
3125
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [
|
|
3126
|
+
/* @__PURE__ */ N(l, {
|
|
3119
3127
|
htmlFor: e.name,
|
|
3120
3128
|
children: o("editor.inputNodeForm.name")
|
|
3121
3129
|
}),
|
|
3122
|
-
/* @__PURE__ */
|
|
3130
|
+
/* @__PURE__ */ N(m, {
|
|
3123
3131
|
id: e.name,
|
|
3124
3132
|
name: e.name,
|
|
3125
3133
|
value: e.state.value,
|
|
3126
3134
|
onBlur: e.handleBlur,
|
|
3127
3135
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
3128
3136
|
}),
|
|
3129
|
-
/* @__PURE__ */
|
|
3137
|
+
/* @__PURE__ */ N(E, { children: o("editor.inputNodeForm.nameDescription") })
|
|
3130
3138
|
] })
|
|
3131
|
-
}), /* @__PURE__ */
|
|
3139
|
+
}), /* @__PURE__ */ N(d, {
|
|
3132
3140
|
name: "defaultValue",
|
|
3133
|
-
children: (e) => /* @__PURE__ */
|
|
3134
|
-
/* @__PURE__ */
|
|
3141
|
+
children: (e) => /* @__PURE__ */ P(M, { children: [
|
|
3142
|
+
/* @__PURE__ */ P(T, { children: [/* @__PURE__ */ N(l, {
|
|
3135
3143
|
htmlFor: e.name,
|
|
3136
3144
|
children: o("editor.inputNodeForm.defaultValueType")
|
|
3137
|
-
}), /* @__PURE__ */
|
|
3145
|
+
}), /* @__PURE__ */ P(v, {
|
|
3138
3146
|
value: e.state.value?.type || "none",
|
|
3139
3147
|
onValueChange: (t) => {
|
|
3140
3148
|
e.handleChange(t === "none" ? null : { type: t });
|
|
3141
3149
|
},
|
|
3142
|
-
children: [/* @__PURE__ */
|
|
3150
|
+
children: [/* @__PURE__ */ N(g, {
|
|
3143
3151
|
id: e.name,
|
|
3144
|
-
children: /* @__PURE__ */
|
|
3145
|
-
}), /* @__PURE__ */
|
|
3146
|
-
/* @__PURE__ */
|
|
3152
|
+
children: /* @__PURE__ */ N(c, { placeholder: o("editor.inputNodeForm.selectType") })
|
|
3153
|
+
}), /* @__PURE__ */ P(k, { children: [
|
|
3154
|
+
/* @__PURE__ */ N(b, {
|
|
3147
3155
|
value: "none",
|
|
3148
3156
|
children: o("editor.inputNodeForm.defaultValueTypeNone")
|
|
3149
3157
|
}),
|
|
3150
|
-
/* @__PURE__ */
|
|
3158
|
+
/* @__PURE__ */ N(b, {
|
|
3151
3159
|
value: "static",
|
|
3152
3160
|
children: o("editor.inputNodeForm.defaultValueTypeStatic")
|
|
3153
3161
|
}),
|
|
3154
|
-
/* @__PURE__ */
|
|
3162
|
+
/* @__PURE__ */ N(b, {
|
|
3155
3163
|
value: "reference",
|
|
3156
3164
|
children: o("editor.inputNodeForm.defaultValueTypeReference")
|
|
3157
3165
|
})
|
|
3158
3166
|
] })]
|
|
3159
3167
|
})] }),
|
|
3160
|
-
e.state.value?.type === "static" && /* @__PURE__ */
|
|
3168
|
+
e.state.value?.type === "static" && /* @__PURE__ */ N(d, {
|
|
3161
3169
|
name: "defaultValue.staticValue",
|
|
3162
3170
|
children: (e) => {
|
|
3163
3171
|
let t = n?.data?.type;
|
|
3164
|
-
return (t === "select" || t === "checkbox") && n?.data?.multiple ? /* @__PURE__ */
|
|
3172
|
+
return (t === "select" || t === "checkbox") && n?.data?.multiple ? /* @__PURE__ */ P(T, { children: [/* @__PURE__ */ N(l, {
|
|
3165
3173
|
htmlFor: e.name,
|
|
3166
3174
|
children: o("editor.inputNodeForm.defaultValuesCommaSeparated")
|
|
3167
|
-
}), /* @__PURE__ */
|
|
3175
|
+
}), /* @__PURE__ */ N(m, {
|
|
3168
3176
|
id: e.name,
|
|
3169
3177
|
placeholder: o("editor.inputNodeForm.defaultValuesPlaceholder"),
|
|
3170
3178
|
value: Array.isArray(e.state.value) ? e.state.value.join(", ") : "",
|
|
@@ -3172,20 +3180,20 @@ var $n = () => {
|
|
|
3172
3180
|
let n = t.value.split(",").map((e) => e.trim()).filter(Boolean);
|
|
3173
3181
|
e.handleChange(n.length > 0 ? n : null);
|
|
3174
3182
|
}
|
|
3175
|
-
})] }) : t === "checkbox" ? /* @__PURE__ */
|
|
3183
|
+
})] }) : t === "checkbox" ? /* @__PURE__ */ N(T, { children: /* @__PURE__ */ P("div", {
|
|
3176
3184
|
className: "flex items-center space-x-2",
|
|
3177
|
-
children: [/* @__PURE__ */
|
|
3185
|
+
children: [/* @__PURE__ */ N(x, {
|
|
3178
3186
|
id: e.name,
|
|
3179
3187
|
checked: !!e.state.value,
|
|
3180
3188
|
onCheckedChange: (t) => e.handleChange(t)
|
|
3181
|
-
}), /* @__PURE__ */
|
|
3189
|
+
}), /* @__PURE__ */ N(l, {
|
|
3182
3190
|
htmlFor: e.name,
|
|
3183
3191
|
children: o("editor.inputNodeForm.defaultChecked")
|
|
3184
3192
|
})]
|
|
3185
|
-
}) }) : /* @__PURE__ */
|
|
3193
|
+
}) }) : /* @__PURE__ */ P(T, { children: [/* @__PURE__ */ N(l, {
|
|
3186
3194
|
htmlFor: e.name,
|
|
3187
3195
|
children: o("editor.inputNodeForm.staticValue")
|
|
3188
|
-
}), /* @__PURE__ */
|
|
3196
|
+
}), /* @__PURE__ */ N(m, {
|
|
3189
3197
|
id: e.name,
|
|
3190
3198
|
placeholder: o("editor.inputNodeForm.staticValuePlaceholder"),
|
|
3191
3199
|
value: typeof e.state.value == "string" ? e.state.value : "",
|
|
@@ -3193,27 +3201,27 @@ var $n = () => {
|
|
|
3193
3201
|
})] });
|
|
3194
3202
|
}
|
|
3195
3203
|
}),
|
|
3196
|
-
e.state.value?.type === "reference" && /* @__PURE__ */
|
|
3197
|
-
/* @__PURE__ */
|
|
3204
|
+
e.state.value?.type === "reference" && /* @__PURE__ */ P(M, { children: [
|
|
3205
|
+
/* @__PURE__ */ N(d, {
|
|
3198
3206
|
name: "defaultValue.referenceField",
|
|
3199
|
-
children: (e) => /* @__PURE__ */
|
|
3200
|
-
/* @__PURE__ */
|
|
3207
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [
|
|
3208
|
+
/* @__PURE__ */ N(l, {
|
|
3201
3209
|
htmlFor: e.name,
|
|
3202
3210
|
children: o("editor.inputNodeForm.referenceField")
|
|
3203
3211
|
}),
|
|
3204
|
-
/* @__PURE__ */
|
|
3212
|
+
/* @__PURE__ */ P(v, {
|
|
3205
3213
|
value: e.state.value || "",
|
|
3206
3214
|
onValueChange: (t) => {
|
|
3207
3215
|
e.handleChange(t);
|
|
3208
3216
|
},
|
|
3209
|
-
children: [/* @__PURE__ */
|
|
3217
|
+
children: [/* @__PURE__ */ N(g, {
|
|
3210
3218
|
id: e.name,
|
|
3211
|
-
children: /* @__PURE__ */
|
|
3212
|
-
}), /* @__PURE__ */
|
|
3219
|
+
children: /* @__PURE__ */ N(c, { placeholder: o("editor.inputNodeForm.selectReferenceField") })
|
|
3220
|
+
}), /* @__PURE__ */ N(k, { children: a.length === 0 ? /* @__PURE__ */ N(b, {
|
|
3213
3221
|
value: "none",
|
|
3214
3222
|
disabled: !0,
|
|
3215
3223
|
children: o("editor.inputNodeForm.noParentFieldsAvailable")
|
|
3216
|
-
}) : a.map((e) => /* @__PURE__ */
|
|
3224
|
+
}) : a.map((e) => /* @__PURE__ */ P(b, {
|
|
3217
3225
|
value: e.nodeId,
|
|
3218
3226
|
children: [
|
|
3219
3227
|
e.label,
|
|
@@ -3223,17 +3231,17 @@ var $n = () => {
|
|
|
3223
3231
|
]
|
|
3224
3232
|
}, e.nodeId)) })]
|
|
3225
3233
|
}),
|
|
3226
|
-
a.length === 0 && /* @__PURE__ */
|
|
3234
|
+
a.length === 0 && /* @__PURE__ */ N(E, { children: o("editor.inputNodeForm.addInputFieldsBeforeReference") })
|
|
3227
3235
|
] })
|
|
3228
3236
|
}),
|
|
3229
|
-
/* @__PURE__ */
|
|
3237
|
+
/* @__PURE__ */ N(d, {
|
|
3230
3238
|
name: "defaultValue.transformFunction",
|
|
3231
|
-
children: (t) => /* @__PURE__ */
|
|
3232
|
-
/* @__PURE__ */
|
|
3239
|
+
children: (t) => /* @__PURE__ */ P(T, { children: [
|
|
3240
|
+
/* @__PURE__ */ N(l, {
|
|
3233
3241
|
htmlFor: t.name,
|
|
3234
3242
|
children: o("editor.inputNodeForm.transformType")
|
|
3235
3243
|
}),
|
|
3236
|
-
/* @__PURE__ */
|
|
3244
|
+
/* @__PURE__ */ P(v, {
|
|
3237
3245
|
value: t.state.value || "none",
|
|
3238
3246
|
onValueChange: (n) => {
|
|
3239
3247
|
let r = n === "none" ? null : n;
|
|
@@ -3245,80 +3253,80 @@ var $n = () => {
|
|
|
3245
3253
|
});
|
|
3246
3254
|
}
|
|
3247
3255
|
},
|
|
3248
|
-
children: [/* @__PURE__ */
|
|
3256
|
+
children: [/* @__PURE__ */ N(g, {
|
|
3249
3257
|
id: t.name,
|
|
3250
|
-
children: /* @__PURE__ */
|
|
3251
|
-
}), /* @__PURE__ */
|
|
3252
|
-
/* @__PURE__ */
|
|
3258
|
+
children: /* @__PURE__ */ N(c, { placeholder: o("editor.inputNodeForm.selectTransformation") })
|
|
3259
|
+
}), /* @__PURE__ */ P(k, { children: [
|
|
3260
|
+
/* @__PURE__ */ N(b, {
|
|
3253
3261
|
value: "none",
|
|
3254
3262
|
children: o("editor.inputNodeForm.transformNone")
|
|
3255
3263
|
}),
|
|
3256
|
-
/* @__PURE__ */
|
|
3264
|
+
/* @__PURE__ */ N(b, {
|
|
3257
3265
|
value: "toString",
|
|
3258
3266
|
children: o("editor.inputNodeForm.transformString")
|
|
3259
3267
|
}),
|
|
3260
|
-
/* @__PURE__ */
|
|
3268
|
+
/* @__PURE__ */ N(b, {
|
|
3261
3269
|
value: "toNumber",
|
|
3262
3270
|
children: o("editor.inputNodeForm.transformNumber")
|
|
3263
3271
|
}),
|
|
3264
|
-
/* @__PURE__ */
|
|
3272
|
+
/* @__PURE__ */ N(b, {
|
|
3265
3273
|
value: "toBoolean",
|
|
3266
3274
|
children: o("editor.inputNodeForm.transformBoolean")
|
|
3267
3275
|
}),
|
|
3268
|
-
/* @__PURE__ */
|
|
3276
|
+
/* @__PURE__ */ N(b, {
|
|
3269
3277
|
value: "toArray",
|
|
3270
3278
|
children: o("editor.inputNodeForm.transformArray")
|
|
3271
3279
|
}),
|
|
3272
|
-
/* @__PURE__ */
|
|
3280
|
+
/* @__PURE__ */ N(b, {
|
|
3273
3281
|
value: "toObject",
|
|
3274
3282
|
children: o("editor.inputNodeForm.transformMapToObject")
|
|
3275
3283
|
})
|
|
3276
3284
|
] })]
|
|
3277
3285
|
}),
|
|
3278
|
-
/* @__PURE__ */
|
|
3286
|
+
/* @__PURE__ */ N(E, { children: o("editor.inputNodeForm.transformDesc") })
|
|
3279
3287
|
] })
|
|
3280
3288
|
}),
|
|
3281
|
-
e.state.value?.transformFunction === "toObject" && /* @__PURE__ */
|
|
3289
|
+
e.state.value?.transformFunction === "toObject" && /* @__PURE__ */ N(d, {
|
|
3282
3290
|
name: "defaultValue.objectMapping",
|
|
3283
3291
|
mode: "array",
|
|
3284
|
-
children: (e) => /* @__PURE__ */
|
|
3285
|
-
/* @__PURE__ */
|
|
3286
|
-
/* @__PURE__ */
|
|
3292
|
+
children: (e) => /* @__PURE__ */ P(T, { children: [
|
|
3293
|
+
/* @__PURE__ */ N(l, { children: o("editor.inputNodeForm.objectMapping") }),
|
|
3294
|
+
/* @__PURE__ */ P("div", {
|
|
3287
3295
|
className: "space-y-2",
|
|
3288
|
-
children: [e.state.value?.map((t, n) => /* @__PURE__ */
|
|
3296
|
+
children: [e.state.value?.map((t, n) => /* @__PURE__ */ P("div", {
|
|
3289
3297
|
className: "flex items-center gap-2",
|
|
3290
3298
|
children: [
|
|
3291
|
-
/* @__PURE__ */
|
|
3299
|
+
/* @__PURE__ */ N(d, {
|
|
3292
3300
|
name: `defaultValue.objectMapping[${n}].sourceKey`,
|
|
3293
|
-
children: (e) => /* @__PURE__ */
|
|
3301
|
+
children: (e) => /* @__PURE__ */ N(m, {
|
|
3294
3302
|
placeholder: o("editor.inputNodeForm.sourceKey"),
|
|
3295
3303
|
value: e.state.value || "",
|
|
3296
3304
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
3297
3305
|
})
|
|
3298
3306
|
}),
|
|
3299
|
-
/* @__PURE__ */
|
|
3307
|
+
/* @__PURE__ */ N("span", {
|
|
3300
3308
|
className: "text-muted-foreground",
|
|
3301
3309
|
children: "→"
|
|
3302
3310
|
}),
|
|
3303
|
-
/* @__PURE__ */
|
|
3311
|
+
/* @__PURE__ */ N(d, {
|
|
3304
3312
|
name: `defaultValue.objectMapping[${n}].targetKey`,
|
|
3305
|
-
children: (e) => /* @__PURE__ */
|
|
3313
|
+
children: (e) => /* @__PURE__ */ N(m, {
|
|
3306
3314
|
placeholder: o("editor.inputNodeForm.targetKey"),
|
|
3307
3315
|
value: e.state.value || "",
|
|
3308
3316
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
3309
3317
|
})
|
|
3310
3318
|
}),
|
|
3311
|
-
/* @__PURE__ */
|
|
3319
|
+
/* @__PURE__ */ N(p, {
|
|
3312
3320
|
type: "button",
|
|
3313
3321
|
variant: "ghost",
|
|
3314
3322
|
size: "icon",
|
|
3315
3323
|
onClick: () => {
|
|
3316
3324
|
e.removeValue(n), u().then();
|
|
3317
3325
|
},
|
|
3318
|
-
children: /* @__PURE__ */
|
|
3326
|
+
children: /* @__PURE__ */ N(L, { className: "h-4 w-4" })
|
|
3319
3327
|
})
|
|
3320
3328
|
]
|
|
3321
|
-
}, `mapping-${n}`)), /* @__PURE__ */
|
|
3329
|
+
}, `mapping-${n}`)), /* @__PURE__ */ P(p, {
|
|
3322
3330
|
type: "button",
|
|
3323
3331
|
variant: "outline",
|
|
3324
3332
|
size: "sm",
|
|
@@ -3329,10 +3337,10 @@ var $n = () => {
|
|
|
3329
3337
|
targetKey: ""
|
|
3330
3338
|
}), u().then();
|
|
3331
3339
|
},
|
|
3332
|
-
children: [/* @__PURE__ */
|
|
3340
|
+
children: [/* @__PURE__ */ N(I, { className: "mr-2 h-4 w-4" }), o("editor.inputNodeForm.addMapping")]
|
|
3333
3341
|
})]
|
|
3334
3342
|
}),
|
|
3335
|
-
/* @__PURE__ */
|
|
3343
|
+
/* @__PURE__ */ N(E, { children: o("editor.inputNodeForm.objectMappingDesc") })
|
|
3336
3344
|
] })
|
|
3337
3345
|
})
|
|
3338
3346
|
] })
|
|
@@ -3344,7 +3352,7 @@ var $n = () => {
|
|
|
3344
3352
|
})
|
|
3345
3353
|
});
|
|
3346
3354
|
}, er = () => {
|
|
3347
|
-
let [e, t] = z("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = q(), { Field: i } =
|
|
3355
|
+
let [e, t] = z("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = q(), { Field: i } = F({
|
|
3348
3356
|
defaultValues: {
|
|
3349
3357
|
label: n?.data?.label || { en: "" },
|
|
3350
3358
|
type: n?.data?.type || ""
|
|
@@ -3359,22 +3367,22 @@ var $n = () => {
|
|
|
3359
3367
|
r(e);
|
|
3360
3368
|
}
|
|
3361
3369
|
});
|
|
3362
|
-
return /* @__PURE__ */
|
|
3370
|
+
return /* @__PURE__ */ N("form", {
|
|
3363
3371
|
onSubmit: (e) => {
|
|
3364
3372
|
e.preventDefault(), e.stopPropagation();
|
|
3365
3373
|
},
|
|
3366
|
-
children: /* @__PURE__ */
|
|
3374
|
+
children: /* @__PURE__ */ P("div", {
|
|
3367
3375
|
className: "grid gap-6",
|
|
3368
|
-
children: [/* @__PURE__ */
|
|
3376
|
+
children: [/* @__PURE__ */ P("div", {
|
|
3369
3377
|
className: "flex items-end gap-2",
|
|
3370
|
-
children: [/* @__PURE__ */
|
|
3378
|
+
children: [/* @__PURE__ */ N(i, {
|
|
3371
3379
|
name: "label",
|
|
3372
|
-
children: (t) => /* @__PURE__ */
|
|
3380
|
+
children: (t) => /* @__PURE__ */ P(T, {
|
|
3373
3381
|
className: "flex-1",
|
|
3374
|
-
children: [/* @__PURE__ */
|
|
3382
|
+
children: [/* @__PURE__ */ N(l, {
|
|
3375
3383
|
htmlFor: t.name,
|
|
3376
3384
|
children: "Label"
|
|
3377
|
-
}), /* @__PURE__ */
|
|
3385
|
+
}), /* @__PURE__ */ N(m, {
|
|
3378
3386
|
id: t.name,
|
|
3379
3387
|
name: t.name,
|
|
3380
3388
|
value: t.state.value?.[e] || "",
|
|
@@ -3387,27 +3395,27 @@ var $n = () => {
|
|
|
3387
3395
|
}
|
|
3388
3396
|
})]
|
|
3389
3397
|
})
|
|
3390
|
-
}), /* @__PURE__ */
|
|
3398
|
+
}), /* @__PURE__ */ N(Q, {
|
|
3391
3399
|
value: e,
|
|
3392
3400
|
onValueChange: t
|
|
3393
3401
|
})]
|
|
3394
|
-
}), /* @__PURE__ */
|
|
3402
|
+
}), /* @__PURE__ */ N(i, {
|
|
3395
3403
|
name: "type",
|
|
3396
|
-
children: (e) => /* @__PURE__ */
|
|
3404
|
+
children: (e) => /* @__PURE__ */ P(A, { children: [/* @__PURE__ */ N(ue, {
|
|
3397
3405
|
htmlFor: e.name,
|
|
3398
3406
|
children: "Type"
|
|
3399
|
-
}), /* @__PURE__ */
|
|
3407
|
+
}), /* @__PURE__ */ P(v, {
|
|
3400
3408
|
value: e.state.value,
|
|
3401
3409
|
onValueChange: (t) => e.handleChange(t),
|
|
3402
|
-
children: [/* @__PURE__ */
|
|
3410
|
+
children: [/* @__PURE__ */ N(g, {
|
|
3403
3411
|
id: e.name,
|
|
3404
3412
|
className: "w-full",
|
|
3405
|
-
children: /* @__PURE__ */
|
|
3406
|
-
}), /* @__PURE__ */
|
|
3407
|
-
value:
|
|
3413
|
+
children: /* @__PURE__ */ N(c, { placeholder: "" })
|
|
3414
|
+
}), /* @__PURE__ */ N(k, { children: /* @__PURE__ */ P(A, { children: [/* @__PURE__ */ N(b, {
|
|
3415
|
+
value: Yt.title,
|
|
3408
3416
|
children: "Title"
|
|
3409
|
-
}), /* @__PURE__ */
|
|
3410
|
-
value:
|
|
3417
|
+
}), /* @__PURE__ */ N(b, {
|
|
3418
|
+
value: Yt.divider,
|
|
3411
3419
|
children: "Divider"
|
|
3412
3420
|
})] }) })]
|
|
3413
3421
|
})] })
|
|
@@ -3415,7 +3423,7 @@ var $n = () => {
|
|
|
3415
3423
|
})
|
|
3416
3424
|
});
|
|
3417
3425
|
}, tr = () => {
|
|
3418
|
-
let [e, t] = z(""), [n, r] = z(!1), { selectedNode: a, groupNodes: o } = $(), { setNodes: s } =
|
|
3426
|
+
let [e, t] = z(""), [n, r] = z(!1), { selectedNode: a, groupNodes: o } = $(), { setNodes: s } = j(), d = a?.parentId || "none", f = i(a), h = G(), y = vt(), x = vt();
|
|
3419
3427
|
if (f) return null;
|
|
3420
3428
|
let S = (e) => {
|
|
3421
3429
|
a && s((t) => e === "none" ? t.map((e) => {
|
|
@@ -3442,7 +3450,7 @@ var $n = () => {
|
|
|
3442
3450
|
H.error("This group already exists", { description: "Use the selector to add the node to an existing group." });
|
|
3443
3451
|
return;
|
|
3444
3452
|
}
|
|
3445
|
-
let n =
|
|
3453
|
+
let n = Kt();
|
|
3446
3454
|
s((t) => [{
|
|
3447
3455
|
data: { label: { en: e.trim() } },
|
|
3448
3456
|
id: n,
|
|
@@ -3465,61 +3473,61 @@ var $n = () => {
|
|
|
3465
3473
|
}
|
|
3466
3474
|
} : e)]), t(""), r(!1), H.success("Group created", { description: `The group "${e.trim()}" has been created successfully.` });
|
|
3467
3475
|
};
|
|
3468
|
-
return /* @__PURE__ */
|
|
3476
|
+
return /* @__PURE__ */ P("div", {
|
|
3469
3477
|
className: "space-y-2",
|
|
3470
|
-
children: [/* @__PURE__ */
|
|
3478
|
+
children: [/* @__PURE__ */ N(l, {
|
|
3471
3479
|
htmlFor: y,
|
|
3472
3480
|
children: h("editor.selectNodeGroup.group")
|
|
3473
|
-
}), /* @__PURE__ */
|
|
3481
|
+
}), /* @__PURE__ */ P("div", {
|
|
3474
3482
|
className: "flex gap-2",
|
|
3475
|
-
children: [/* @__PURE__ */
|
|
3483
|
+
children: [/* @__PURE__ */ P(v, {
|
|
3476
3484
|
value: d,
|
|
3477
3485
|
onValueChange: S,
|
|
3478
|
-
children: [/* @__PURE__ */
|
|
3486
|
+
children: [/* @__PURE__ */ N(g, {
|
|
3479
3487
|
id: y,
|
|
3480
3488
|
className: "flex-1",
|
|
3481
|
-
children: /* @__PURE__ */
|
|
3482
|
-
}), /* @__PURE__ */
|
|
3489
|
+
children: /* @__PURE__ */ N(c, { placeholder: h("editor.selectNodeGroup.noGroup") })
|
|
3490
|
+
}), /* @__PURE__ */ N(k, { children: /* @__PURE__ */ P(A, { children: [/* @__PURE__ */ N(b, {
|
|
3483
3491
|
value: "none",
|
|
3484
3492
|
children: h("editor.selectNodeGroup.noGroup")
|
|
3485
|
-
}), o.map((e) => /* @__PURE__ */
|
|
3493
|
+
}), o.map((e) => /* @__PURE__ */ N(b, {
|
|
3486
3494
|
value: e.id,
|
|
3487
3495
|
children: e.data.label?.en ? String(e.data.label?.en) : e.id
|
|
3488
3496
|
}, e.id))] }) })]
|
|
3489
|
-
}), /* @__PURE__ */
|
|
3497
|
+
}), /* @__PURE__ */ P(le, {
|
|
3490
3498
|
open: n,
|
|
3491
3499
|
onOpenChange: r,
|
|
3492
|
-
children: [/* @__PURE__ */
|
|
3500
|
+
children: [/* @__PURE__ */ N(u, {
|
|
3493
3501
|
asChild: !0,
|
|
3494
|
-
children: /* @__PURE__ */
|
|
3502
|
+
children: /* @__PURE__ */ N(p, {
|
|
3495
3503
|
variant: "outline",
|
|
3496
3504
|
size: "icon",
|
|
3497
3505
|
title: "Create a new group",
|
|
3498
|
-
children: /* @__PURE__ */
|
|
3506
|
+
children: /* @__PURE__ */ N(tt, { className: "h-4 w-4" })
|
|
3499
3507
|
})
|
|
3500
|
-
}), /* @__PURE__ */
|
|
3508
|
+
}), /* @__PURE__ */ N(_, {
|
|
3501
3509
|
className: "w-80",
|
|
3502
3510
|
align: "end",
|
|
3503
3511
|
disablePortal: !0,
|
|
3504
|
-
children: /* @__PURE__ */
|
|
3512
|
+
children: /* @__PURE__ */ P("div", {
|
|
3505
3513
|
className: "space-y-4",
|
|
3506
3514
|
children: [
|
|
3507
|
-
/* @__PURE__ */
|
|
3515
|
+
/* @__PURE__ */ P("div", {
|
|
3508
3516
|
className: "space-y-2",
|
|
3509
|
-
children: [/* @__PURE__ */
|
|
3517
|
+
children: [/* @__PURE__ */ N("h4", {
|
|
3510
3518
|
className: "font-medium leading-none",
|
|
3511
3519
|
children: h("editor.selectNodeGroup.newGroup")
|
|
3512
|
-
}), /* @__PURE__ */
|
|
3520
|
+
}), /* @__PURE__ */ N("p", {
|
|
3513
3521
|
className: "text-muted-foreground text-sm",
|
|
3514
3522
|
children: h("editor.selectNodeGroup.newGroupDescription")
|
|
3515
3523
|
})]
|
|
3516
3524
|
}),
|
|
3517
|
-
/* @__PURE__ */
|
|
3525
|
+
/* @__PURE__ */ P("div", {
|
|
3518
3526
|
className: "space-y-2",
|
|
3519
|
-
children: [/* @__PURE__ */
|
|
3527
|
+
children: [/* @__PURE__ */ N(l, {
|
|
3520
3528
|
htmlFor: x,
|
|
3521
3529
|
children: h("editor.selectNodeGroup.groupName")
|
|
3522
|
-
}), /* @__PURE__ */
|
|
3530
|
+
}), /* @__PURE__ */ N(m, {
|
|
3523
3531
|
autoFocus: !0,
|
|
3524
3532
|
id: x,
|
|
3525
3533
|
value: e,
|
|
@@ -3530,14 +3538,14 @@ var $n = () => {
|
|
|
3530
3538
|
}
|
|
3531
3539
|
})]
|
|
3532
3540
|
}),
|
|
3533
|
-
/* @__PURE__ */
|
|
3541
|
+
/* @__PURE__ */ P("div", {
|
|
3534
3542
|
className: "flex justify-end gap-2",
|
|
3535
|
-
children: [/* @__PURE__ */
|
|
3543
|
+
children: [/* @__PURE__ */ N(p, {
|
|
3536
3544
|
variant: "outline",
|
|
3537
3545
|
size: "sm",
|
|
3538
3546
|
onClick: () => r(!1),
|
|
3539
3547
|
children: "Cancel"
|
|
3540
|
-
}), /* @__PURE__ */
|
|
3548
|
+
}), /* @__PURE__ */ N(p, {
|
|
3541
3549
|
size: "sm",
|
|
3542
3550
|
onClick: C,
|
|
3543
3551
|
disabled: !e.trim(),
|
|
@@ -3551,19 +3559,19 @@ var $n = () => {
|
|
|
3551
3559
|
})]
|
|
3552
3560
|
});
|
|
3553
3561
|
}, nr = () => {
|
|
3554
|
-
let { selectedNode: e } = $(), { updateSelectedNodeType: t } = q(), n = e?.type || "", r = i(e), a = G(), o =
|
|
3555
|
-
return /* @__PURE__ */
|
|
3562
|
+
let { selectedNode: e } = $(), { updateSelectedNodeType: t } = q(), n = e?.type || "", r = i(e), a = G(), o = vt();
|
|
3563
|
+
return /* @__PURE__ */ P(A, { children: [/* @__PURE__ */ N(ue, {
|
|
3556
3564
|
htmlFor: o,
|
|
3557
3565
|
children: a("editor.selectNodeType.nodeType")
|
|
3558
|
-
}), /* @__PURE__ */
|
|
3566
|
+
}), /* @__PURE__ */ P(v, {
|
|
3559
3567
|
value: n,
|
|
3560
3568
|
onValueChange: (e) => t(e),
|
|
3561
3569
|
disabled: r,
|
|
3562
|
-
children: [/* @__PURE__ */
|
|
3570
|
+
children: [/* @__PURE__ */ N(g, {
|
|
3563
3571
|
className: "w-full",
|
|
3564
3572
|
id: o,
|
|
3565
|
-
children: /* @__PURE__ */
|
|
3566
|
-
}), /* @__PURE__ */
|
|
3573
|
+
children: /* @__PURE__ */ N(c, { placeholder: a("editor.selectNodeType.nodeType") })
|
|
3574
|
+
}), /* @__PURE__ */ N(k, { children: /* @__PURE__ */ N(A, { children: Object.keys(cn).filter((e) => r ? e === "group" : e !== "group").map((e) => /* @__PURE__ */ N(b, {
|
|
3567
3575
|
value: e,
|
|
3568
3576
|
children: a(`editor.selectNodeType.options.${e}`)
|
|
3569
3577
|
}, e)) }) })]
|
|
@@ -3572,32 +3580,32 @@ var $n = () => {
|
|
|
3572
3580
|
//#endregion
|
|
3573
3581
|
//#region src/shared/components/ui/sheet.tsx
|
|
3574
3582
|
function rr({ ...e }) {
|
|
3575
|
-
return /* @__PURE__ */
|
|
3583
|
+
return /* @__PURE__ */ N(U.Root, {
|
|
3576
3584
|
"data-slot": "sheet",
|
|
3577
3585
|
...e
|
|
3578
3586
|
});
|
|
3579
3587
|
}
|
|
3580
3588
|
function ir({ ...e }) {
|
|
3581
|
-
return /* @__PURE__ */
|
|
3589
|
+
return /* @__PURE__ */ N(U.Portal, {
|
|
3582
3590
|
"data-slot": "sheet-portal",
|
|
3583
3591
|
...e
|
|
3584
3592
|
});
|
|
3585
3593
|
}
|
|
3586
3594
|
function ar({ className: e, ...t }) {
|
|
3587
|
-
return /* @__PURE__ */
|
|
3595
|
+
return /* @__PURE__ */ N(U.Overlay, {
|
|
3588
3596
|
"data-slot": "sheet-overlay",
|
|
3589
3597
|
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),
|
|
3590
3598
|
...t
|
|
3591
3599
|
});
|
|
3592
3600
|
}
|
|
3593
3601
|
function or({ className: e, children: t, side: n = "right", ...r }) {
|
|
3594
|
-
return /* @__PURE__ */
|
|
3602
|
+
return /* @__PURE__ */ P(ir, { children: [/* @__PURE__ */ N(ar, {}), /* @__PURE__ */ P(U.Content, {
|
|
3595
3603
|
"data-slot": "sheet-content",
|
|
3596
3604
|
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),
|
|
3597
3605
|
...r,
|
|
3598
|
-
children: [t, /* @__PURE__ */
|
|
3606
|
+
children: [t, /* @__PURE__ */ P(U.Close, {
|
|
3599
3607
|
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",
|
|
3600
|
-
children: [/* @__PURE__ */
|
|
3608
|
+
children: [/* @__PURE__ */ N(pt, { className: "size-4" }), /* @__PURE__ */ N("span", {
|
|
3601
3609
|
className: "sr-only",
|
|
3602
3610
|
children: "Close"
|
|
3603
3611
|
})]
|
|
@@ -3605,28 +3613,28 @@ function or({ className: e, children: t, side: n = "right", ...r }) {
|
|
|
3605
3613
|
})] });
|
|
3606
3614
|
}
|
|
3607
3615
|
function sr({ className: e, ...t }) {
|
|
3608
|
-
return /* @__PURE__ */
|
|
3616
|
+
return /* @__PURE__ */ N("div", {
|
|
3609
3617
|
"data-slot": "sheet-header",
|
|
3610
3618
|
className: d("flex flex-col gap-1.5 p-4", e),
|
|
3611
3619
|
...t
|
|
3612
3620
|
});
|
|
3613
3621
|
}
|
|
3614
3622
|
function cr({ className: e, ...t }) {
|
|
3615
|
-
return /* @__PURE__ */
|
|
3623
|
+
return /* @__PURE__ */ N("div", {
|
|
3616
3624
|
"data-slot": "sheet-footer",
|
|
3617
3625
|
className: d("mt-auto flex flex-col gap-2 p-4", e),
|
|
3618
3626
|
...t
|
|
3619
3627
|
});
|
|
3620
3628
|
}
|
|
3621
3629
|
function lr({ className: e, ...t }) {
|
|
3622
|
-
return /* @__PURE__ */
|
|
3630
|
+
return /* @__PURE__ */ N(U.Title, {
|
|
3623
3631
|
"data-slot": "sheet-title",
|
|
3624
3632
|
className: d("font-semibold text-foreground", e),
|
|
3625
3633
|
...t
|
|
3626
3634
|
});
|
|
3627
3635
|
}
|
|
3628
3636
|
function ur({ className: e, ...t }) {
|
|
3629
|
-
return /* @__PURE__ */
|
|
3637
|
+
return /* @__PURE__ */ N(U.Description, {
|
|
3630
3638
|
"data-slot": "sheet-description",
|
|
3631
3639
|
className: d("text-muted-foreground text-sm", e),
|
|
3632
3640
|
...t
|
|
@@ -3635,62 +3643,58 @@ function ur({ className: e, ...t }) {
|
|
|
3635
3643
|
//#endregion
|
|
3636
3644
|
//#region src/editor/features/TreegeEditor/sheets/NodeActionsSheet.tsx
|
|
3637
3645
|
var dr = () => {
|
|
3638
|
-
let { selectedNode: e } = $(), { clearSelection: r
|
|
3639
|
-
|
|
3646
|
+
let { selectedNode: e } = $(), { clearSelection: r } = q(), { isNodeSheetOpen: a, setIsNodeSheetOpen: o, openDeleteNodeConfirmation: c } = W(), l = G(), u = l(e?.data?.label), d = () => {
|
|
3647
|
+
o(!1), r();
|
|
3640
3648
|
};
|
|
3641
|
-
return /* @__PURE__ */
|
|
3642
|
-
open:
|
|
3649
|
+
return /* @__PURE__ */ N(rr, {
|
|
3650
|
+
open: a && !!e,
|
|
3643
3651
|
onOpenChange: (e) => {
|
|
3644
3652
|
e || d();
|
|
3645
3653
|
},
|
|
3646
|
-
children: /* @__PURE__ */
|
|
3654
|
+
children: /* @__PURE__ */ P(or, {
|
|
3647
3655
|
className: "flex flex-col gap-0",
|
|
3648
3656
|
children: [
|
|
3649
|
-
/* @__PURE__ */
|
|
3657
|
+
/* @__PURE__ */ P(sr, { children: [/* @__PURE__ */ P(lr, { children: [
|
|
3650
3658
|
l("editor.nodeActionsSheet.editNode"),
|
|
3651
3659
|
" ",
|
|
3652
|
-
/* @__PURE__ */
|
|
3660
|
+
/* @__PURE__ */ N("span", {
|
|
3653
3661
|
className: "font-light text-muted-foreground text-xs",
|
|
3654
3662
|
children: e?.id
|
|
3655
3663
|
})
|
|
3656
|
-
] }), /* @__PURE__ */
|
|
3657
|
-
/* @__PURE__ */
|
|
3664
|
+
] }), /* @__PURE__ */ N(ur, { children: u || "\xA0" })] }),
|
|
3665
|
+
/* @__PURE__ */ N(Nt, {
|
|
3658
3666
|
className: "flex min-h-0 flex-1 flex-col px-4",
|
|
3659
|
-
children: /* @__PURE__ */
|
|
3667
|
+
children: /* @__PURE__ */ P("div", {
|
|
3660
3668
|
className: "space-y-6 py-4",
|
|
3661
3669
|
children: [
|
|
3662
|
-
/* @__PURE__ */
|
|
3663
|
-
/* @__PURE__ */
|
|
3664
|
-
/* @__PURE__ */
|
|
3665
|
-
s(e) && /* @__PURE__ */
|
|
3666
|
-
n(e) && /* @__PURE__ */
|
|
3667
|
-
t(e) && /* @__PURE__ */
|
|
3668
|
-
i(e) && /* @__PURE__ */
|
|
3670
|
+
/* @__PURE__ */ N(nr, {}),
|
|
3671
|
+
/* @__PURE__ */ N(tr, {}),
|
|
3672
|
+
/* @__PURE__ */ N(se, {}),
|
|
3673
|
+
s(e) && /* @__PURE__ */ N($n, {}),
|
|
3674
|
+
n(e) && /* @__PURE__ */ N(er, {}),
|
|
3675
|
+
t(e) && /* @__PURE__ */ N(Nn, {}),
|
|
3676
|
+
i(e) && /* @__PURE__ */ N(Pn, {})
|
|
3669
3677
|
]
|
|
3670
3678
|
})
|
|
3671
3679
|
}),
|
|
3672
|
-
/* @__PURE__ */
|
|
3680
|
+
/* @__PURE__ */ N(cr, {
|
|
3673
3681
|
className: "flex items-end border-t",
|
|
3674
|
-
children: /* @__PURE__ */ N(
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
variant: "ghost",
|
|
3678
|
-
size: "icon",
|
|
3679
|
-
children: /* @__PURE__ */ M(lt, {})
|
|
3680
|
-
})
|
|
3681
|
-
}), /* @__PURE__ */ N(Ht, { children: [/* @__PURE__ */ N(Ut, { children: [/* @__PURE__ */ M(Gt, { children: l("editor.nodeActionsSheet.deleteNode") }), /* @__PURE__ */ M(Kt, { children: l("editor.nodeActionsSheet.deleteNodeConfirm") })] }), /* @__PURE__ */ N(Wt, { children: [/* @__PURE__ */ M(Jt, { children: l("common.cancel") }), /* @__PURE__ */ M(qt, {
|
|
3682
|
+
children: /* @__PURE__ */ N(p, {
|
|
3683
|
+
variant: "ghost",
|
|
3684
|
+
size: "icon",
|
|
3682
3685
|
onClick: () => {
|
|
3683
|
-
|
|
3686
|
+
e && c(e.id);
|
|
3684
3687
|
},
|
|
3685
|
-
|
|
3686
|
-
|
|
3688
|
+
"aria-label": l("editor.nodeActionsSheet.deleteNode"),
|
|
3689
|
+
children: /* @__PURE__ */ N(ct, {})
|
|
3690
|
+
})
|
|
3687
3691
|
})
|
|
3688
3692
|
]
|
|
3689
3693
|
})
|
|
3690
3694
|
});
|
|
3691
3695
|
}, fr = ({ ...e }) => {
|
|
3692
3696
|
let { theme: t = "system" } = Et();
|
|
3693
|
-
return /* @__PURE__ */
|
|
3697
|
+
return /* @__PURE__ */ N(wt, {
|
|
3694
3698
|
theme: t,
|
|
3695
3699
|
className: "toaster group",
|
|
3696
3700
|
style: {
|
|
@@ -3701,12 +3705,12 @@ var dr = () => {
|
|
|
3701
3705
|
...e
|
|
3702
3706
|
});
|
|
3703
3707
|
}, pr = ({ flow: e, onExportJson: t, onSave: n, theme: r, className: i }) => {
|
|
3704
|
-
let { onConnect: a, onConnectEnd: o, onEdgesDelete: s, isValidConnection: c } =
|
|
3705
|
-
return /* @__PURE__ */
|
|
3708
|
+
let { onConnect: a, onConnectEnd: o, onEdgesDelete: s, isValidConnection: c } = Jt();
|
|
3709
|
+
return /* @__PURE__ */ P(xe, {
|
|
3706
3710
|
fitView: !0,
|
|
3707
3711
|
colorMode: r,
|
|
3708
3712
|
selectNodesOnDrag: !1,
|
|
3709
|
-
nodeTypes:
|
|
3713
|
+
nodeTypes: cn,
|
|
3710
3714
|
edgeTypes: Ft,
|
|
3711
3715
|
defaultEdges: e?.edges || [],
|
|
3712
3716
|
defaultNodes: e?.nodes || [],
|
|
@@ -3716,31 +3720,32 @@ var dr = () => {
|
|
|
3716
3720
|
isValidConnection: c,
|
|
3717
3721
|
className: d(i, "treege"),
|
|
3718
3722
|
children: [
|
|
3719
|
-
/* @__PURE__ */
|
|
3723
|
+
/* @__PURE__ */ N(de, {
|
|
3720
3724
|
gap: 10,
|
|
3721
3725
|
variant: fe.Dots
|
|
3722
3726
|
}),
|
|
3723
|
-
/* @__PURE__ */
|
|
3727
|
+
/* @__PURE__ */ N(jn, {
|
|
3724
3728
|
onExportJson: t,
|
|
3725
3729
|
onSave: n
|
|
3726
3730
|
}),
|
|
3727
|
-
/* @__PURE__ */
|
|
3728
|
-
/* @__PURE__ */
|
|
3729
|
-
/* @__PURE__ */
|
|
3730
|
-
/* @__PURE__ */
|
|
3731
|
+
/* @__PURE__ */ N(kt, { theme: r }),
|
|
3732
|
+
/* @__PURE__ */ N(_e, {}),
|
|
3733
|
+
/* @__PURE__ */ N(me, {}),
|
|
3734
|
+
/* @__PURE__ */ N(dr, {}),
|
|
3735
|
+
/* @__PURE__ */ N(yn, {})
|
|
3731
3736
|
]
|
|
3732
3737
|
});
|
|
3733
|
-
}, mr = ({ flow: e, onExportJson: t, onSave: n, theme: r = "dark", language: i = "en", aiConfig: a }) => /* @__PURE__ */
|
|
3738
|
+
}, mr = ({ flow: e, onExportJson: t, onSave: n, theme: r = "dark", language: i = "en", aiConfig: a }) => /* @__PURE__ */ N(o, {
|
|
3734
3739
|
defaultTheme: r,
|
|
3735
3740
|
storageKey: "treege-editor-theme",
|
|
3736
3741
|
theme: r,
|
|
3737
|
-
children: /* @__PURE__ */
|
|
3742
|
+
children: /* @__PURE__ */ P(Mt, {
|
|
3738
3743
|
value: {
|
|
3739
3744
|
aiConfig: a,
|
|
3740
3745
|
flowId: e?.id,
|
|
3741
3746
|
language: i
|
|
3742
3747
|
},
|
|
3743
|
-
children: [/* @__PURE__ */
|
|
3748
|
+
children: [/* @__PURE__ */ N(fr, { position: "bottom-center" }), /* @__PURE__ */ N(Se, { children: /* @__PURE__ */ N(pr, {
|
|
3744
3749
|
onExportJson: t,
|
|
3745
3750
|
onSave: n,
|
|
3746
3751
|
flow: e,
|