@emporix/process-diagram 2.0.0-alpha.1 → 2.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/App.d.ts.map +1 -1
  2. package/dist/components/ProcessDiagram.d.ts +4 -2
  3. package/dist/components/ProcessDiagram.d.ts.map +1 -1
  4. package/dist/components/common/icons/IteratorIcon.d.ts +3 -0
  5. package/dist/components/common/icons/IteratorIcon.d.ts.map +1 -0
  6. package/dist/components/common/icons/LoopIcon.d.ts +8 -0
  7. package/dist/components/common/icons/LoopIcon.d.ts.map +1 -0
  8. package/dist/components/common/icons/index.d.ts +1 -0
  9. package/dist/components/common/icons/index.d.ts.map +1 -1
  10. package/dist/components/condition/Condition.d.ts.map +1 -1
  11. package/dist/components/iterator/Iterator.d.ts +17 -0
  12. package/dist/components/iterator/Iterator.d.ts.map +1 -0
  13. package/dist/components/iterator/LoopBoxIcon.d.ts +8 -0
  14. package/dist/components/iterator/LoopBoxIcon.d.ts.map +1 -0
  15. package/dist/components/menu/Menu.d.ts.map +1 -1
  16. package/dist/components/plus-button/PlusButton.d.ts +3 -2
  17. package/dist/components/plus-button/PlusButton.d.ts.map +1 -1
  18. package/dist/components/row/Row.d.ts +4 -2
  19. package/dist/components/row/Row.d.ts.map +1 -1
  20. package/dist/components/steps/Steps.d.ts +5 -3
  21. package/dist/components/steps/Steps.d.ts.map +1 -1
  22. package/dist/components/tooltip/Tooltip.d.ts +10 -0
  23. package/dist/components/tooltip/Tooltip.d.ts.map +1 -0
  24. package/dist/index.cjs +1 -1
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.ts +2 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.mjs +965 -712
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/style.css +1 -1
  31. package/dist/types/index.d.ts +7 -3
  32. package/dist/types/index.d.ts.map +1 -1
  33. package/package.json +1 -1
  34. /package/dist/components/common/{MenuTemplate.d.ts → menuTemplate.d.ts} +0 -0
  35. /package/dist/components/common/{MenuTemplate.d.ts.map → menuTemplate.d.ts.map} +0 -0
package/dist/App.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAqBA,OAAO,mBAAmB,CAAA;AAE1B,QAAA,MAAM,GAAG,+CAmMR,CAAA;AAED,eAAe,GAAG,CAAA"}
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAqBA,OAAO,mBAAmB,CAAA;AAE1B,QAAA,MAAM,GAAG,+CAoMR,CAAA;AAED,eAAe,GAAG,CAAA"}
@@ -4,13 +4,15 @@ export interface ProcessDiagramProps {
4
4
  process: Process;
5
5
  onAddTrigger: (id?: string, pathId?: string, operation?: AddStepType) => unknown;
6
6
  onAddStep: (id?: string, pathId?: string, operation?: AddStepOperation) => unknown;
7
- onAddCondition?: (stepId: string) => unknown;
7
+ onAddCondition: (stepId?: string, pathId?: string, operation?: AddStepOperation) => void;
8
+ onAddLoop: (stepId?: string, pathId?: string, operation?: AddStepOperation) => void;
9
+ onResize?: () => void;
8
10
  onDeleteTrigger: (id: string) => unknown;
9
11
  onDeleteStep: (id: string) => unknown;
10
12
  onUpdateFilter: (id: string) => unknown;
11
13
  addMultipleTriggers: () => unknown;
12
14
  onSelectStep: (id: string) => unknown;
13
15
  }
14
- declare const ProcessDiagram: ({ process, addMultipleTriggers, onAddStep, onAddTrigger, onAddCondition, onDeleteTrigger, onDeleteStep, onUpdateFilter, onSelectStep, }: Readonly<ProcessDiagramProps>) => import("react/jsx-runtime").JSX.Element;
16
+ declare const ProcessDiagram: ({ process, addMultipleTriggers, onAddStep, onAddTrigger, onAddCondition, onAddLoop, onResize, onDeleteTrigger, onDeleteStep, onUpdateFilter, onSelectStep, }: Readonly<ProcessDiagramProps>) => import("react/jsx-runtime").JSX.Element;
15
17
  export default ProcessDiagram;
16
18
  //# sourceMappingURL=ProcessDiagram.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProcessDiagram.d.ts","sourceRoot":"","sources":["../../src/components/ProcessDiagram.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAGvC,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,gCAAgC,CAAA;AAEvC,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,CACZ,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,WAAW,KACpB,OAAO,CAAA;IACZ,SAAS,EAAE,CACT,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,OAAO,CAAA;IACZ,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAA;IAC5C,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACxC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACrC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACvC,mBAAmB,EAAE,MAAM,OAAO,CAAA;IAClC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;CACtC;AAED,QAAA,MAAM,cAAc,GAAI,yIAUrB,QAAQ,CAAC,mBAAmB,CAAC,4CAuC/B,CAAA;AAED,eAAe,cAAc,CAAA"}
1
+ {"version":3,"file":"ProcessDiagram.d.ts","sourceRoot":"","sources":["../../src/components/ProcessDiagram.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAGvC,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,gCAAgC,CAAA;AAEvC,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,CACZ,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,WAAW,KACpB,OAAO,CAAA;IACZ,SAAS,EAAE,CACT,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,OAAO,CAAA;IACZ,cAAc,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAA;IACxF,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAA;IACnF,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACxC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACrC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACvC,mBAAmB,EAAE,MAAM,OAAO,CAAA;IAClC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;CACtC;AAED,QAAA,MAAM,cAAc,GAAI,8JAYrB,QAAQ,CAAC,mBAAmB,CAAC,4CA2C/B,CAAA;AAED,eAAe,cAAc,CAAA"}
@@ -0,0 +1,3 @@
1
+ declare const IteratorIcon: () => import("react/jsx-runtime").JSX.Element;
2
+ export default IteratorIcon;
3
+ //# sourceMappingURL=IteratorIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IteratorIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/common/icons/IteratorIcon.tsx"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY,+CAqBjB,CAAA;AAED,eAAe,YAAY,CAAA"}
@@ -0,0 +1,8 @@
1
+ interface LoopIconProps {
2
+ width?: number;
3
+ height?: number;
4
+ color?: string;
5
+ }
6
+ declare const LoopIcon: ({ width, height, color, }: LoopIconProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default LoopIcon;
8
+ //# sourceMappingURL=LoopIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoopIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/common/icons/LoopIcon.tsx"],"names":[],"mappings":"AAAA,UAAU,aAAa;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,QAAA,MAAM,QAAQ,GAAI,2BAIf,aAAa,4CAmBf,CAAA;AAED,eAAe,QAAQ,CAAA"}
@@ -1,3 +1,4 @@
1
1
  export { default as ConditionIcon } from './ConditionIcon';
2
+ export { default as LoopIcon } from './LoopIcon';
2
3
  export { default as MenuFilterIcon } from './MenuFilterIcon';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/common/icons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/common/icons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Condition.d.ts","sourceRoot":"","sources":["../../../src/components/condition/Condition.tsx"],"names":[],"mappings":"AAEA,QAAA,MAAM,SAAS,GAAI,wBAGhB,QAAQ,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAAE,CAAC,4CAS/D,CAAA;AAED,eAAe,SAAS,CAAA"}
1
+ {"version":3,"file":"Condition.d.ts","sourceRoot":"","sources":["../../../src/components/condition/Condition.tsx"],"names":[],"mappings":"AAIA,QAAA,MAAM,SAAS,GAAI,wBAGhB,QAAQ,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAAE,CAAC,4CAwB/D,CAAA;AAED,eAAe,SAAS,CAAA"}
@@ -0,0 +1,17 @@
1
+ import type { Iterator as IteratorType } from '../../types';
2
+ import type { AddStepOperation, AddStepType } from '../../helpers/add-process.helpers';
3
+ export interface IteratorProps {
4
+ /** Iterator data: must include localId; limit is optional. */
5
+ value: Pick<IteratorType, 'localId'> & Partial<Pick<IteratorType, 'limit' | 'steps'>>;
6
+ onAddStep?: (id?: string, pathId?: string, operation?: AddStepOperation) => void;
7
+ onAddTrigger?: (id?: string, pathId?: string, operation?: AddStepType) => void;
8
+ onAddCondition?: (stepId?: string, pathId?: string, operation?: AddStepOperation) => void;
9
+ onAddLoop?: (stepId?: string, pathId?: string, operation?: AddStepOperation) => void;
10
+ onDeleteStep?: (id: string) => void;
11
+ onUpdateFilter?: (id: string) => void;
12
+ onSelectStep?: (id: string) => void;
13
+ onResize?: () => void;
14
+ }
15
+ declare const IteratorComponent: ({ value, onAddStep, onAddTrigger, onAddCondition, onAddLoop, onDeleteStep, onUpdateFilter, onSelectStep, onResize, }: Readonly<IteratorProps>) => import("react/jsx-runtime").JSX.Element;
16
+ export default IteratorComponent;
17
+ //# sourceMappingURL=Iterator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Iterator.d.ts","sourceRoot":"","sources":["../../../src/components/iterator/Iterator.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,mCAAmC,CAAA;AAG1C,MAAM,WAAW,aAAa;IAC5B,8DAA8D;IAC9D,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,GAClC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAA;IAChD,SAAS,CAAC,EAAE,CACV,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IAC9E,cAAc,CAAC,EAAE,CACf,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,SAAS,CAAC,EAAE,CACV,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAED,QAAA,MAAM,iBAAiB,GAAI,sHAUxB,QAAQ,CAAC,aAAa,CAAC,4CAwFzB,CAAA;AAED,eAAe,iBAAiB,CAAA"}
@@ -0,0 +1,8 @@
1
+ interface LoopBoxIconProps {
2
+ width?: number;
3
+ height?: number;
4
+ color?: string;
5
+ }
6
+ declare const LoopBoxIcon: ({ width, height, color, }: LoopBoxIconProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default LoopBoxIcon;
8
+ //# sourceMappingURL=LoopBoxIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoopBoxIcon.d.ts","sourceRoot":"","sources":["../../../src/components/iterator/LoopBoxIcon.tsx"],"names":[],"mappings":"AAAA,UAAU,gBAAgB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,QAAA,MAAM,WAAW,GAAI,2BAIlB,gBAAgB,4CAmBlB,CAAA;AAED,eAAe,WAAW,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAItD,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,cAAc,CAAC;QAAC,IAAI,EAAE,QAAQ,CAAA;KAAE,KAAK,IAAI,CAAA;IAC9E,QAAQ,CAAC,EAAE,CACT,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE;QAAE,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAA;KAAE,KAChD,SAAS,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAA;IAC3C,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAA;IAC5C,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAA;CAC9C;AAED,UAAU,SAAS;IACjB,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAA;CACxC;AAkBD,QAAA,MAAM,IAAI,2EAoIR,CAAA;AAEF,eAAe,IAAI,CAAA"}
1
+ {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAItD,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,cAAc,CAAC;QAAC,IAAI,EAAE,QAAQ,CAAA;KAAE,KAAK,IAAI,CAAA;IAC9E,QAAQ,CAAC,EAAE,CACT,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE;QAAE,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAA;KAAE,KAChD,SAAS,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAA;IAC3C,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAA;IAC5C,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAA;CAC9C;AAED,UAAU,SAAS;IACjB,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAA;CACxC;AAkBD,QAAA,MAAM,IAAI,2EAqIR,CAAA;AAEF,eAAe,IAAI,CAAA"}
@@ -3,11 +3,12 @@ export interface PlusButtonProps {
3
3
  style?: React.CSSProperties;
4
4
  onAddStep?: (id?: string, pathId?: string, operation?: AddStepOperation) => void;
5
5
  onAddTrigger?: (id?: string, pathId?: string, operation?: AddStepType) => void;
6
- onAddCondition?: (stepId: string) => void;
6
+ onAddCondition?: (stepId?: string, pathId?: string, operation?: AddStepOperation) => void;
7
+ onAddLoop?: (stepId?: string, pathId?: string, operation?: AddStepOperation) => void;
7
8
  stepId?: string;
8
9
  index?: number;
9
10
  pathId?: string;
10
11
  }
11
- declare const PlusButton: ({ onAddStep, onAddTrigger, onAddCondition, stepId, index, style, pathId, }: PlusButtonProps) => import("react/jsx-runtime").JSX.Element;
12
+ declare const PlusButton: ({ onAddStep, onAddTrigger, onAddCondition, onAddLoop, stepId, index, style, pathId, }: PlusButtonProps) => import("react/jsx-runtime").JSX.Element;
12
13
  export default PlusButton;
13
14
  //# sourceMappingURL=PlusButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlusButton.d.ts","sourceRoot":"","sources":["../../../src/components/plus-button/PlusButton.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,mCAAmC,CAAA;AAE1C,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,SAAS,CAAC,EAAE,CACV,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IAC9E,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,QAAA,MAAM,UAAU,GAAI,4EAQjB,eAAe,4CAyDjB,CAAA;AAED,eAAe,UAAU,CAAA"}
1
+ {"version":3,"file":"PlusButton.d.ts","sourceRoot":"","sources":["../../../src/components/plus-button/PlusButton.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,mCAAmC,CAAA;AAE1C,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,SAAS,CAAC,EAAE,CACV,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IAC9E,cAAc,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAA;IACzF,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAA;IACpF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,QAAA,MAAM,UAAU,GAAI,uFASjB,eAAe,4CA+DjB,CAAA;AAED,eAAe,UAAU,CAAA"}
@@ -1,14 +1,16 @@
1
1
  import type { Path, Step } from '../../types';
2
2
  import type { AddStepOperation, AddStepType } from '../../helpers/add-process.helpers';
3
- declare const Row: ({ items, pathId, onAddStep, onAddTrigger, onAddCondition, onDeleteStep, onUpdateFilter, onSelectStep, }: Readonly<{
3
+ declare const Row: ({ items, pathId, onAddStep, onAddTrigger, onAddCondition, onAddLoop, onDeleteStep, onUpdateFilter, onSelectStep, onResize, }: Readonly<{
4
4
  items: Path[] | Step[];
5
5
  pathId?: string;
6
6
  onAddStep?: (id?: string, pathId?: string, operation?: AddStepOperation) => void;
7
7
  onAddTrigger?: (id?: string, pathId?: string, operation?: AddStepType) => void;
8
- onAddCondition?: (stepId: string) => void;
8
+ onAddCondition: (stepId?: string, pathId?: string, operation?: AddStepOperation) => void;
9
+ onAddLoop?: (stepId?: string, pathId?: string, operation?: AddStepOperation) => void;
9
10
  onDeleteStep?: (id: string) => void;
10
11
  onUpdateFilter: (id: string) => void;
11
12
  onSelectStep: (id: string) => void;
13
+ onResize?: () => void;
12
14
  }>) => import("react/jsx-runtime").JSX.Element;
13
15
  export default Row;
14
16
  //# sourceMappingURL=Row.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../../../src/components/row/Row.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAI7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAGtF,QAAA,MAAM,GAAG,GAAI,yGASV,QAAQ,CAAC;IACV,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,CACV,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IAC9E,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CACnC,CAAC,4CA4JD,CAAA;AAED,eAAe,GAAG,CAAA"}
1
+ {"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../../../src/components/row/Row.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAI7C,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,mCAAmC,CAAA;AAI1C,QAAA,MAAM,GAAG,GAAI,8HAWV,QAAQ,CAAC;IACV,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,CACV,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IAC9E,cAAc,EAAE,CACd,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,SAAS,CAAC,EAAE,CACV,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB,CAAC,4CA6KD,CAAA;AAED,eAAe,GAAG,CAAA"}
@@ -6,14 +6,16 @@ interface Props extends PropsWithClassName {
6
6
  centerY?: number;
7
7
  onDeleteStep?: (id: string) => void;
8
8
  onUpdateFilter: (id: string) => void;
9
- onAddStep?: (id?: string, pathId?: string, operation?: AddStepOperation) => void;
9
+ onAddStep: (id?: string, pathId?: string, operation?: AddStepOperation) => void;
10
10
  onAddTrigger?: (id?: string, pathId?: string, operation?: AddStepType) => void;
11
- onAddCondition?: (stepId: string) => void;
11
+ onAddCondition: (stepId?: string, pathId?: string, operation?: AddStepOperation) => void;
12
+ onAddLoop?: (stepId?: string, pathId?: string, operation?: AddStepOperation) => void;
12
13
  onSelectStep: (id: string) => void;
14
+ onResize?: () => void;
13
15
  isDescendent?: boolean;
14
16
  pathId?: string;
15
17
  }
16
18
  export declare const STEP_ROW_HEIGHT = 68;
17
- declare const Steps: ({ pathId, steps, centerY, className, onAddStep, onDeleteStep, onUpdateFilter, onAddTrigger, onAddCondition, onSelectStep, isDescendent, }: Readonly<Props>) => import("react/jsx-runtime").JSX.Element;
19
+ declare const Steps: ({ pathId, steps, centerY, className, onAddStep, onDeleteStep, onUpdateFilter, onAddTrigger, onAddCondition, onAddLoop, onSelectStep, onResize, isDescendent, }: Readonly<Props>) => import("react/jsx-runtime").JSX.Element;
18
20
  export default Steps;
19
21
  //# sourceMappingURL=Steps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../../src/components/steps/Steps.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAE7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAEtF,UAAU,KAAM,SAAQ,kBAAkB;IACxC,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,SAAS,CAAC,EAAE,CACV,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IAC9E,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,eAAe,KAAK,CAAA;AACjC,QAAA,MAAM,KAAK,GAAI,2IAYZ,QAAQ,CAAC,KAAK,CAAC,4CA8IjB,CAAA;AAED,eAAe,KAAK,CAAA"}
1
+ {"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../../src/components/steps/Steps.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAE7D,OAAO,KAAK,EAA4B,IAAI,EAAE,MAAM,aAAa,CAAA;AAGjE,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,mCAAmC,CAAA;AAE1C,UAAU,KAAM,SAAQ,kBAAkB;IACxC,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,SAAS,EAAE,CACT,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IAC9E,cAAc,EAAE,CACd,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,SAAS,CAAC,EAAE,CACV,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,eAAe,KAAK,CAAA;AACjC,QAAA,MAAM,KAAK,GAAI,gKAcZ,QAAQ,CAAC,KAAK,CAAC,4CA6LjB,CAAA;AAED,eAAe,KAAK,CAAA"}
@@ -0,0 +1,10 @@
1
+ import type { ReactNode } from 'react';
2
+ type TooltipProps = Readonly<{
3
+ content: ReactNode;
4
+ children: ReactNode;
5
+ maxWidth?: number;
6
+ className?: string;
7
+ }>;
8
+ declare const Tooltip: ({ content, children, maxWidth, className, }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default Tooltip;
10
+ //# sourceMappingURL=Tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,KAAK,YAAY,GAAG,QAAQ,CAAC;IAC3B,OAAO,EAAE,SAAS,CAAA;IAClB,QAAQ,EAAE,SAAS,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC,CAAA;AAEF,QAAA,MAAM,OAAO,GAAI,6CAKd,YAAY,4CAcd,CAAA;AAED,eAAe,OAAO,CAAA"}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),ge=require("react-dom"),Ce="_container_8wfnz_1",ve="_step_8wfnz_7",_e="_selected_8wfnz_23",je="_selectedInvalid_8wfnz_29",we="_isSet_8wfnz_35",ye="_invalid_8wfnz_39",Ie="_filterFlag_8wfnz_45",be="_title_8wfnz_73",ke="_icon_8wfnz_90",Me="_content_8wfnz_108",Pe="_dotsButton_8wfnz_114",C={container:Ce,step:ve,selected:_e,selectedInvalid:je,isSet:we,invalid:ye,filterFlag:Ie,title:be,icon:ke,content:Me,dotsButton:Pe};var ie={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},te=l.createContext&&l.createContext(ie),Ne=["attr","size","title"];function Se(e,n){if(e==null)return{};var s=Be(e,n),o,i;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(i=0;i<u.length;i++)o=u[i],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(s[o]=e[o])}return s}function Be(e,n){if(e==null)return{};var s={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(n.indexOf(o)>=0)continue;s[o]=e[o]}return s}function W(){return W=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e[o]=s[o])}return e},W.apply(this,arguments)}function ne(e,n){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),s.push.apply(s,o)}return s}function D(e){for(var n=1;n<arguments.length;n++){var s=arguments[n]!=null?arguments[n]:{};n%2?ne(Object(s),!0).forEach(function(o){Le(e,o,s[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):ne(Object(s)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(s,o))})}return e}function Le(e,n,s){return n=Ee(n),n in e?Object.defineProperty(e,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[n]=s,e}function Ee(e){var n=Te(e,"string");return typeof n=="symbol"?n:n+""}function Te(e,n){if(typeof e!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var o=s.call(e,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function re(e){return e&&e.map((n,s)=>l.createElement(n.tag,D({key:s},n.attr),re(n.child)))}function O(e){return n=>l.createElement(Oe,W({attr:D({},e.attr)},n),re(e.child))}function Oe(e){var n=s=>{var{attr:o,size:i,title:u}=e,p=Se(e,Ne),c=i||s.size||"1em",r;return s.className&&(r=s.className),e.className&&(r=(r?r+" ":"")+e.className),l.createElement("svg",W({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},s.attr,o,p,{className:r,style:D(D({color:e.color||s.color},s.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),u&&l.createElement("title",null,u),e.children)};return te!==void 0?l.createElement(te.Consumer,null,s=>n(s)):n(ie)}function $e(e){return O({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.52.359A.5.5 0 0 1 6 0h4a.5.5 0 0 1 .474.658L8.694 6H12.5a.5.5 0 0 1 .395.807l-7 9a.5.5 0 0 1-.873-.454L6.823 9.5H3.5a.5.5 0 0 1-.48-.641zM6.374 1 4.168 8.5H7.5a.5.5 0 0 1 .478.647L6.78 13.04 11.478 7H8a.5.5 0 0 1-.474-.658L9.306 1z"},child:[]}]})(e)}function ze(e){return O({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325"},child:[]}]})(e)}function G(e){return O({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"},child:[]}]})(e)}function K(e){return O({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z"},child:[]},{tag:"path",attr:{d:"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z"},child:[]}]})(e)}const Re="_panel_19663_1",He="_panelExiting_19663_13",Ae="_menuItem_19663_37",We="_disabled_19663_52",De="_menuItemIcon_19663_57",Fe="_menuItemText_19663_63",Ve="_overlay_19663_69",N={panel:Re,panelExiting:He,menuItem:Ae,disabled:We,menuItemIcon:De,menuItemText:Fe,overlay:Ve},Ze=e=>{const s=e.currentTarget??e.target;if(s?.getBoundingClientRect){const i=s.getBoundingClientRect();return{top:i.bottom+2,left:i.left}}const o=e;return{top:(o.clientY??0)+2,left:o.clientX??0}},F=l.forwardRef(function({model:n,popup:s=!0,onHide:o,onClick:i},u){const[p,c]=l.useState(!1),[r,a]=l.useState(!1),[g,w]=l.useState({top:0,left:0}),m=l.useRef(null),d=l.useCallback(()=>{r||a(!0)},[r]),v=l.useCallback(f=>{r&&f.animationName.includes("menuOut")&&(c(!1),a(!1),o?.())},[r,o]),_=l.useCallback(f=>{w(Ze(f)),a(!1),c(!0)},[]),y=l.useCallback(f=>{p?d():_(f)},[p,d,_]);l.useImperativeHandle(u,()=>({show:_,hide:d,toggle:y}),[_,d,y]),l.useEffect(()=>{if(!p)return;const f=P=>{P.key==="Escape"&&d()},j=P=>{const h=m.current;h&&!h.contains(P.target)&&d()};return document.addEventListener("keydown",f),document.addEventListener("mousedown",j),()=>{document.removeEventListener("keydown",f),document.removeEventListener("mousedown",j)}},[p,d]);const M=(f,j)=>{j.stopPropagation(),f.command?.({originalEvent:j,item:f}),d()},I=(f,j)=>{const P=h=>M(f,h);return f.template?t.jsx(l.Fragment,{children:f.template(f,{onClick:P})},j):t.jsxs("button",{type:"button",className:`${N.menuItem} ${f.disabled&&N.disabled}`,onClick:h=>{f.disabled||P(h)},children:[f.icon&&t.jsx("span",{className:N.menuItemIcon,children:f.icon}),t.jsx("span",{className:N.menuItemText,children:f.label})]},j)};return!p||!s?null:ge.createPortal(t.jsxs(t.Fragment,{children:[t.jsx("div",{className:N.overlay,"aria-hidden":!0,onClick:()=>d(),onMouseDown:f=>f.stopPropagation()}),t.jsx("div",{ref:m,className:`${N.panel} ${r?N.panelExiting:""}`,role:"menu",style:{top:g.top,left:g.left},onAnimationEnd:v,onClick:f=>{f.stopPropagation(),i?.(f)},children:n.map(I)})]}),document.body)}),le=()=>(e,n)=>t.jsxs("button",{className:N.menuItem,onClick:s=>n.onClick(s),children:[t.jsx("span",{className:N.menuItemIcon,children:e.icon}),t.jsx("span",{className:N.menuItemText,children:e.label})]}),Ye=({width:e=16,height:n=16,color:s="#3B64A0"})=>t.jsxs("svg",{width:e,height:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("rect",{x:"7.99219",y:"0.222732",width:"11",height:"11",rx:"1.5",transform:"rotate(45 7.99219 0.222732)",stroke:s}),t.jsx("path",{d:"M10.4693 5.52599L5.52513 10.4813M5.52513 5.53151L10.4749 10.4813",stroke:s,strokeLinecap:"round"})]}),se=({width:e=16,height:n=16,color:s="#3B64A0"})=>t.jsxs("svg",{width:e,height:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M8 15C6.14348 15 4.36301 14.2625 3.05025 12.9497C1.7375 11.637 1 9.85652 1 8C1 6.14348 1.7375 4.36301 3.05025 3.05025C4.36301 1.7375 6.14348 1 8 1C9.85652 1 11.637 1.7375 12.9497 3.05025C14.2625 4.36301 15 6.14348 15 8C15 9.85652 14.2625 11.637 12.9497 12.9497C11.637 14.2625 9.85652 15 8 15ZM8 16C10.1217 16 12.1566 15.1571 13.6569 13.6569C15.1571 12.1566 16 10.1217 16 8C16 5.87827 15.1571 3.84344 13.6569 2.34315C12.1566 0.842855 10.1217 0 8 0C5.87827 0 3.84344 0.842855 2.34315 2.34315C0.842855 3.84344 0 5.87827 0 8C0 10.1217 0.842855 12.1566 2.34315 13.6569C3.84344 15.1571 5.87827 16 8 16Z",fill:s}),t.jsx("path",{d:"M7 11.5C7 11.3674 7.05268 11.2402 7.14645 11.1464C7.24021 11.0527 7.36739 11 7.5 11H8.5C8.63261 11 8.75979 11.0527 8.85355 11.1464C8.94732 11.2402 9 11.3674 9 11.5C9 11.6326 8.94732 11.7598 8.85355 11.8536C8.75979 11.9473 8.63261 12 8.5 12H7.5C7.36739 12 7.24021 11.9473 7.14645 11.8536C7.05268 11.7598 7 11.6326 7 11.5ZM5 8.5C5 8.36739 5.05268 8.24021 5.14645 8.14645C5.24021 8.05268 5.36739 8 5.5 8H10.5C10.6326 8 10.7598 8.05268 10.8536 8.14645C10.9473 8.24021 11 8.36739 11 8.5C11 8.63261 10.9473 8.75979 10.8536 8.85355C10.7598 8.94732 10.6326 9 10.5 9H5.5C5.36739 9 5.24021 8.94732 5.14645 8.85355C5.05268 8.75979 5 8.63261 5 8.5ZM3 5.5C3 5.36739 3.05268 5.24021 3.14645 5.14645C3.24021 5.05268 3.36739 5 3.5 5H12.5C12.6326 5 12.7598 5.05268 12.8536 5.14645C12.9473 5.24021 13 5.36739 13 5.5C13 5.63261 12.9473 5.75979 12.8536 5.85355C12.7598 5.94732 12.6326 6 12.5 6H3.5C3.36739 6 3.24021 5.94732 3.14645 5.85355C3.05268 5.75979 3 5.63261 3 5.5Z",fill:s})]}),ce=l.createContext(void 0),Xe=({children:e})=>{const[n,s]=l.useState([]),o=l.useCallback((p,c)=>{s(r=>(r.forEach(a=>{a.current&&a!==p&&a.current.hide(c)}),[])),p.current?.toggle(c),s([p])},[]),i=l.useCallback(p=>{s(c=>c.filter(r=>r!==p))},[]),u=l.useMemo(()=>({openMenus:n,openMenu:o,closeMenu:i}),[n,o,i]);return t.jsx(ce.Provider,{value:u,children:e})},J=()=>{const e=l.useContext(ce);if(e===void 0)throw new Error("useMenuProvider must be used within a MenuProvider");return e},Ge=({color:e="#E32012"})=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[t.jsx("g",{clipPath:"url(#clip0_3105_5367)",children:t.jsx("path",{d:"M16 8C16 10.1217 15.1571 12.1566 13.6569 13.6569C12.1566 15.1571 10.1217 16 8 16C5.87827 16 3.84344 15.1571 2.34315 13.6569C0.842855 12.1566 0 10.1217 0 8C0 5.87827 0.842855 3.84344 2.34315 2.34315C3.84344 0.842855 5.87827 0 8 0C10.1217 0 12.1566 0.842855 13.6569 2.34315C15.1571 3.84344 16 5.87827 16 8ZM8 4C7.87361 4.00007 7.74863 4.02662 7.63312 4.07793C7.51761 4.12924 7.41413 4.20418 7.32934 4.29791C7.24456 4.39165 7.18035 4.5021 7.14084 4.62217C7.10134 4.74223 7.08743 4.86923 7.1 4.995L7.45 8.502C7.46176 8.63977 7.5248 8.76811 7.62664 8.86164C7.72849 8.95516 7.86173 9.00705 8 9.00705C8.13827 9.00705 8.27151 8.95516 8.37336 8.86164C8.4752 8.76811 8.53824 8.63977 8.55 8.502L8.9 4.995C8.91257 4.86923 8.89866 4.74223 8.85915 4.62217C8.81965 4.5021 8.75544 4.39165 8.67066 4.29791C8.58587 4.20418 8.48239 4.12924 8.36688 4.07793C8.25137 4.02662 8.12639 4.00007 8 4ZM8.002 10C7.73678 10 7.48243 10.1054 7.29489 10.2929C7.10736 10.4804 7.002 10.7348 7.002 11C7.002 11.2652 7.10736 11.5196 7.29489 11.7071C7.48243 11.8946 7.73678 12 8.002 12C8.26722 12 8.52157 11.8946 8.70911 11.7071C8.89664 11.5196 9.002 11.2652 9.002 11C9.002 10.7348 8.89664 10.4804 8.70911 10.2929C8.52157 10.1054 8.26722 10 8.002 10Z",fill:e})}),t.jsx("defs",{children:t.jsx("clipPath",{id:"clip0_3105_5367",children:t.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),V=e=>{const{isSet:n,isSelected:s,isFilter:o,className:i,title:u,icon:p,contextMenuItems:c=void 0,onDeleteStep:r,onUpdateFilter:a,onSelectStep:g,subtitle:w,isInvalid:m,localId:d}=e,v=l.useRef(null),{openMenu:_,closeMenu:y}=J(),M=le(),I=l.useMemo(()=>[{label:"Add Step Filter",icon:t.jsx("div",{className:"mr-2 flex items-center justify-center",children:t.jsx(se,{})}),command:x=>{x?.originalEvent?.stopPropagation(),a&&a(d)},template:M},{label:"Remove",icon:t.jsx(K,{color:"#3B64A0",size:18}),command:x=>{x?.originalEvent?.stopPropagation(),r&&r(d)},template:M}],[a,r,d,M]),f=l.useMemo(()=>c!==void 0?c:I,[c,I]),j=x=>{x.stopPropagation(),_(v,x)},P=l.useMemo(()=>s&&m?C.step+" "+C.selectedInvalid:s?C.step+" "+C.selected:n?C.step+" "+C.isSet:m?C.step+" "+C.invalid:C.step,[n,s,m]),h=l.useMemo(()=>m?t.jsx(Ge,{color:"#E32012"}):p,[p,m]);return t.jsx("div",{className:C.container+" "+i,children:t.jsxs("div",{children:[t.jsxs("div",{className:P,onClick:()=>g(d),children:[t.jsxs("div",{className:C.content,children:[t.jsx("div",{className:`${C.icon} ${m&&C.invalid}`,children:h}),t.jsx("div",{className:C.title,children:u})]}),t.jsx("button",{className:C.dotsButton,onClick:j,"aria-haspopup":!0,"aria-label":"Step options",children:t.jsx(G,{className:C.dots,color:m?"#E32012":"#3B64A0"})}),t.jsx(F,{model:f,popup:!0,ref:v,onClick:x=>x.stopPropagation(),onHide:()=>y(v)})]}),o&&t.jsxs("div",{className:C.filterFlag,role:"button",tabIndex:0,onClick:()=>{a&&a(d)},onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&a&&(x.preventDefault(),a(d))},children:[t.jsx(se,{color:"#3B64A0"}),t.jsx("span",{children:"Filter"}),t.jsx(G,{className:C.dots,color:m?"#E32012":"#3B64A0",style:{height:"10px"}})]}),w&&t.jsx("div",{className:C.subtitle,children:w})]})})},qe=()=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[t.jsxs("g",{clipPath:"url(#clip0_6551_9169)",children:[t.jsx("rect",{width:"24",height:"24",rx:"12",fill:"#0C971F"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V11H18C18.5523 11 19 11.4477 19 12C19 12.5523 18.5523 13 18 13H13V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H6C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11H11V6Z",fill:"white"})]}),t.jsx("rect",{x:"0.75",y:"0.75",width:"22.5",height:"22.5",rx:"11.25",stroke:"#14BC2B",strokeWidth:"1.5"}),t.jsx("defs",{children:t.jsx("clipPath",{id:"clip0_6551_9169",children:t.jsx("rect",{width:"24",height:"24",rx:"12",fill:"white"})})})]}),Ke="_multipleTriggersIcon_oxhdi_1",Je={multipleTriggersIcon:Ke},Qe=()=>t.jsx("div",{className:Je.multipleTriggersIcon,children:t.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 3.75C1.5 3.15326 1.73705 2.58097 2.15901 2.15901C2.58097 1.73705 3.15326 1.5 3.75 1.5H5.25C5.84674 1.5 6.41903 1.73705 6.84099 2.15901C7.26295 2.58097 7.5 3.15326 7.5 3.75L13.701 3.75C13.8661 3.46404 14.1209 3.24054 14.426 3.11418C14.7311 2.98782 15.0693 2.96565 15.3883 3.05111C15.7072 3.13657 15.9891 3.32489 16.1901 3.58686C16.3911 3.84882 16.5 4.1698 16.5 4.5C16.5 4.8302 16.3911 5.15118 16.1901 5.41314C15.9891 5.67511 15.7072 5.86343 15.3883 5.94889C15.0693 6.03435 14.7311 6.01218 14.426 5.88582C14.1209 5.75946 13.8661 5.53596 13.701 5.25H10.686C10.956 5.52 11.196 5.8215 11.412 6.1575C12.369 7.6455 12.75 9.6885 12.75 12C12.75 14.9895 13.1355 16.638 13.8195 17.55C14.3535 18.264 15.162 18.6315 16.5 18.726C16.5063 18.1334 16.7462 17.5673 17.1674 17.1505C17.5887 16.7337 18.1574 16.5 18.75 16.5H20.25C20.8467 16.5 21.419 16.7371 21.841 17.159C22.2629 17.581 22.5 18.1533 22.5 18.75V20.25C22.5 20.8467 22.2629 21.419 21.841 21.841C21.419 22.2629 20.8467 22.5 20.25 22.5H18.75C18.1533 22.5 17.581 22.2629 17.159 21.841C16.7371 21.419 16.5 20.8467 16.5 20.25H10.299C10.1339 20.536 9.87905 20.7595 9.57399 20.8858C9.26892 21.0122 8.93068 21.0344 8.61173 20.9489C8.29278 20.8634 8.01095 20.6751 7.80993 20.4131C7.60892 20.1512 7.49996 19.8302 7.49996 19.5C7.49996 19.1698 7.60892 18.8488 7.80993 18.5869C8.01095 18.3249 8.29278 18.1366 8.61173 18.0511C8.93068 17.9656 9.26892 17.9878 9.57399 18.1142C9.87905 18.2405 10.1339 18.464 10.299 18.75H12.8655C12.7785 18.6538 12.6959 18.5537 12.618 18.45C11.6145 17.1105 11.25 15.0105 11.25 12C11.25 9.81 10.881 8.1045 10.1505 6.9675C9.5655 6.06 8.7225 5.4675 7.5 5.2995C7.48706 5.88762 7.2443 6.44728 6.82374 6.85859C6.40318 7.2699 5.83826 7.50014 5.25 7.5H3.75C3.15326 7.5 2.58097 7.26295 2.15901 6.84099C1.73705 6.41903 1.5 5.84674 1.5 5.25V3.75ZM3.75 3C3.55109 3 3.36032 3.07902 3.21967 3.21967C3.07902 3.36032 3 3.55109 3 3.75V5.25C3 5.44891 3.07902 5.63968 3.21967 5.78033C3.36032 5.92098 3.55109 6 3.75 6H5.25C5.44891 6 5.63968 5.92098 5.78033 5.78033C5.92098 5.63968 6 5.44891 6 5.25V3.75C6 3.55109 5.92098 3.36032 5.78033 3.21967C5.63968 3.07902 5.44891 3 5.25 3H3.75ZM18.75 18C18.5511 18 18.3603 18.079 18.2197 18.2197C18.079 18.3603 18 18.5511 18 18.75V20.25C18 20.4489 18.079 20.6397 18.2197 20.7803C18.3603 20.921 18.5511 21 18.75 21H20.25C20.4489 21 20.6397 20.921 20.7803 20.7803C20.921 20.6397 21 20.4489 21 20.25V18.75C21 18.5511 20.921 18.3603 20.7803 18.2197C20.6397 18.079 20.4489 18 20.25 18H18.75Z",fill:"white"})})}),Ue="_trigger_kfg1y_1",et="_title_kfg1y_7",tt="_empty_kfg1y_15",nt="_triggerContainer_kfg1y_21",st="_stepsContainer_kfg1y_25",ot="_stepItem_kfg1y_51",it="_curvesSvg_kfg1y_70",rt="_centralNode_kfg1y_78",lt="_iconWrapper_kfg1y_104",ct="_fadeIn_kfg1y_127",at="_fadeOut_kfg1y_130",dt="_operationContainer_kfg1y_134",b={trigger:Ue,title:et,empty:tt,triggerContainer:nt,stepsContainer:st,stepItem:ot,curvesSvg:it,centralNode:rt,iconWrapper:lt,fadeIn:ct,fadeOut:at,operationContainer:dt},ut=()=>t.jsx("div",{style:{height:"1px",marginLeft:"4px",marginRight:"4px",borderTop:"1px solid #a1bbdc"}}),pt=80,R=34,ae=({steps:e,title:n,className:s,onDeleteTrigger:o,onAddTrigger:i,onSelectStep:u,onUpdateFilter:p,onCenterYUpdate:c})=>{const r=l.useRef(null),a=l.useRef([]),[g,w]=l.useState([]),[m,d]=l.useState({width:0,height:0}),[v,_]=l.useState(!1),[y,M]=l.useState(!1),I=l.useRef(null);l.useEffect(()=>{const h=()=>{if(!r.current)return;const x=[];if(a.current.forEach((k,S)=>{if(k&&r.current){const B=r.current.getBoundingClientRect(),L=k.getBoundingClientRect();x.push({localId:e[S]?.localId??`step-${S}`,top:L.top-B.top,right:L.right-B.left,centerY:L.top-B.top+L.height/2})}}),w(x),r.current&&x.length>0){const k=r.current.getBoundingClientRect(),S=Math.min(...x.map(E=>E.top)),B=a.current.filter(Boolean).map(E=>E?.offsetHeight||68),L=Math.max(...x.map((E,xe)=>E.top+(B[xe]||68))),Z=Math.max(...x.map(E=>E.right))+0,Y=Math.max(k.height,L-S+100);d({width:Z,height:Y})}};return h(),window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[e]),l.useEffect(()=>{let h=!0;if(v){I.current&&(clearTimeout(I.current),I.current=null);const x=setTimeout(()=>{h&&M(!0)},0);return()=>{h=!1,clearTimeout(x)}}return I.current=setTimeout(()=>{h&&M(!1)},140),()=>{h=!1,I.current&&(clearTimeout(I.current),I.current=null)}},[v]);const f=g.length>0?pt:0,j=l.useMemo(()=>g.length>1?g.reduce((h,x)=>h+x.top+R,0)/g.length:g.length===1?g[0].top+R:0,[g]);if(l.useEffect(()=>{c?.(j)},[j,c]),e.length===0)return t.jsxs("div",{className:`${b.trigger} ${s||""}`,children:[n&&t.jsx("h3",{className:b.title,children:n}),t.jsx("div",{className:b.empty,children:"No steps"})]});const P=(h,x,k,S)=>{const B=k-h,L=Math.min(B*.6,60),ee=h+L,Z=x,Y=k-L;return`M ${h} ${x} C ${ee} ${Z}, ${Y} ${S}, ${k} ${S}`};return t.jsxs("div",{className:`${b.trigger} ${s||""}`,ref:r,children:[n&&t.jsx("h3",{className:b.title,children:n}),t.jsxs("div",{className:b.triggerContainer,children:[t.jsx("div",{className:b.stepsContainer,children:e.map((h,x)=>t.jsx("div",{ref:k=>{a.current[x]=k},children:t.jsx(V,{title:h.title,className:b.stepItem,localId:h.localId,idx:x,isSet:h.isSet,isSelected:h.isSelected,isInvalid:h.isInvalid,isFilter:h.isFilter,icon:h.icon,onSelectStep:u,onUpdateFilter:p,contextMenuItems:[{label:"Delete",icon:t.jsx(K,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{o?.(h.localId)},disabled:e.length===1},{label:"",template:()=>t.jsx(ut,{})},{label:"Add More Triggers",icon:t.jsx($e,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{i?.()}}]})},h.localId))}),t.jsx("div",{style:{position:"relative"},children:g.length>1&&t.jsx("svg",{className:b.curvesSvg,width:m.width,height:m.height,children:g.map(h=>{const k=g.length===1?g[0].top+R:h.top+R,S=f,B=j;return t.jsx("path",{d:P(0,k,S,B),stroke:"#3b64a0",strokeWidth:"2",fill:"none",strokeLinecap:"round"},h.localId)})})}),g.length>1?t.jsxs("div",{style:{position:"relative",marginRight:"140px"},children:[t.jsx("div",{className:b.centralNode,style:{"--node-x":`${f}px`,"--node-y":`${j}px`},onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:y?t.jsx("div",{className:`${b.iconWrapper} ${v?b.fadeIn:b.fadeOut}`,onClick:i,children:t.jsx(qe,{})}):null}),t.jsx("div",{className:b.operationContainer,style:{"--op-x":`${f+16}px`,"--op-y":`${j}px`},children:t.jsx(Qe,{})})]}):null]})]})};function ht(e){return O({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"4"},child:[]},{tag:"line",attr:{x1:"1.05",y1:"12",x2:"7",y2:"12"},child:[]},{tag:"line",attr:{x1:"17.01",y1:"12",x2:"22.96",y2:"12"},child:[]}]})(e)}function mt(e){return O({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"},child:[]}]})(e)}const ft=()=>t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M6 12L18 12",stroke:"#3B64A0",strokeWidth:"2",strokeLinecap:"round"}),t.jsx("path",{d:"M12 6V18",stroke:"#3B64A0",strokeWidth:"2",strokeLinecap:"round"})]}),xt="_stepLinkIcon_18iyj_1",gt="_stepLinkLine_18iyj_15",Ct="_stepLinkContainer_18iyj_39",H={stepLinkIcon:xt,stepLinkLine:gt,stepLinkContainer:Ct},A=({onAddStep:e,onAddTrigger:n,onAddCondition:s,stepId:o,index:i=0,style:u,pathId:p})=>{const c=le(),r=l.useRef(null),a=[...i>0?[{label:"Trigger",icon:t.jsx(mt,{color:"#3B64A0",size:18}),command:()=>{n?.(o,p,"trigger")},template:c}]:[],{label:"Step",icon:t.jsx(ht,{color:"#3B64A0",size:18}),command:()=>e?.(o,p,"append"),template:c},...o!=null?[{label:"Condition",icon:t.jsx(Ye,{width:18,height:18}),command:()=>s?.(o),template:c}]:[]],g=w=>{r.current?.show(w)};return t.jsxs("div",{className:H.stepLinkContainer,style:{...u},"data-plus-index":i,children:[t.jsx("div",{className:H.stepLinkLine}),t.jsx("div",{className:H.stepLinkIcon,onClick:g,"aria-haspopup":!0,children:t.jsx(ft,{})}),t.jsx(F,{model:a,popup:!0,ref:r}),t.jsx("div",{className:H.stepLinkLine})]})},vt="_steps_yug55_1",_t="_stepContainer_yug55_8",jt="_stepContainerWithPaths_yug55_14",X={steps:vt,stepContainer:_t,stepContainerWithPaths:jt},wt=(e,n,s,o)=>{const i=s-e,u=Math.min(i*.66,66),p=e+u,c=n,r=s-u;return`M ${e} ${n} C ${p} ${c}, ${r} ${o}, ${s} ${o}`},yt=({width:e,height:n})=>{const p=wt(0,1,e,n);return t.jsx("div",{style:{position:"absolute"},children:t.jsx("svg",{width:e,height:n+1,viewBox:`0 0 ${e} ${n+1}`,xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:p,stroke:"#3b64a0",strokeWidth:"2",fill:"none",strokeLinecap:"round"})})})},It="_column_5kuaz_1",bt="_row_5kuaz_19",kt="_stepsContainer_5kuaz_24",$={column:It,row:bt,stepsContainer:kt},Mt="_conditionContainer_1jxi6_1",Pt="_connectorLine_1jxi6_6",Nt="_condition_1jxi6_1",St="_connectorDot_1jxi6_31",z={conditionContainer:Mt,connectorLine:Pt,condition:Nt,connectorDot:St},Bt=({expression:e,style:n})=>t.jsxs("div",{className:z.conditionContainer,style:n,children:[t.jsx("div",{className:z.connectorLine}),t.jsx("div",{className:z.condition,children:e})," ",t.jsx("div",{className:z.connectorLine}),t.jsx("div",{className:z.connectorDot})]}),Lt="data:image/svg+xml,%3csvg%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='21.8125'%20y='-2.52539'%20width='34.4207'%20height='34.4207'%20rx='6.09524'%20transform='rotate(45%2021.8125%20-2.52539)'%20fill='%236B90C0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M31.3947%2013.0355C31.4679%2013.1085%2031.526%2013.1952%2031.5656%2013.2907C31.6052%2013.3861%2031.6256%2013.4885%2031.6256%2013.5918C31.6256%2013.6952%2031.6052%2013.7975%2031.5656%2013.8929C31.526%2013.9884%2031.4679%2014.0751%2031.3947%2014.1481L14.109%2031.4338C13.9615%2031.5813%2013.7614%2031.6642%2013.5527%2031.6642C13.3441%2031.6642%2013.144%2031.5813%2012.9965%2031.4338C12.8489%2031.2863%2012.766%2031.0862%2012.766%2030.8775C12.766%2030.6689%2012.8489%2030.4688%2012.9965%2030.3212L30.2822%2013.0355C30.3552%2012.9623%2030.4419%2012.9043%2030.5373%2012.8647C30.6328%2012.8251%2030.7351%2012.8047%2030.8385%2012.8047C30.9418%2012.8047%2031.0441%2012.8251%2031.1396%2012.8647C31.2351%2012.9043%2031.3218%2012.9623%2031.3947%2013.0355Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.9965%2013.0355C12.9233%2013.1085%2012.8652%2013.1952%2012.8256%2013.2907C12.786%2013.3861%2012.7656%2013.4885%2012.7656%2013.5918C12.7656%2013.6952%2012.786%2013.7975%2012.8256%2013.8929C12.8652%2013.9884%2012.9233%2014.0751%2012.9965%2014.1481L30.2822%2031.4338C30.4297%2031.5813%2030.6298%2031.6642%2030.8385%2031.6642C31.0471%2031.6642%2031.2472%2031.5813%2031.3947%2031.4338C31.5423%2031.2863%2031.6252%2031.0862%2031.6252%2030.8775C31.6252%2030.6689%2031.5423%2030.4688%2031.3947%2030.3212L14.109%2013.0355C14.036%2012.9623%2013.9493%2012.9043%2013.8539%2012.8647C13.7584%2012.8251%2013.6561%2012.8047%2013.5527%2012.8047C13.4494%2012.8047%2013.3471%2012.8251%2013.2516%2012.8647C13.1561%2012.9043%2013.0694%2012.9623%2012.9965%2013.0355Z'%20fill='white'/%3e%3c/svg%3e",Et="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='1'%20y='1'%20width='26'%20height='26'%20rx='13'%20fill='white'/%3e%3crect%20x='1'%20y='1'%20width='26'%20height='26'%20rx='13'%20stroke='%236B90C0'%20stroke-width='2'/%3e%3ccircle%20cx='14'%20cy='14'%20r='6'%20fill='%236B90C0'/%3e%3c/svg%3e",Tt="_ifStatement_13p1p_1",Ot="_conditionIcon_13p1p_7",$t="_ifStatementContainer_13p1p_21",zt="_menuButton_13p1p_27",Rt="_menuIcon_13p1p_52",Ht="_ifdotIcon_13p1p_59",T={ifStatement:Tt,conditionIcon:Ot,ifStatementContainer:$t,menuButton:zt,menuIcon:Rt,ifdotIcon:Ht},At=({style:e})=>t.jsx("div",{style:{width:"100%",height:"2px",borderTop:"2px solid #3B64A0",...e}}),Wt=({onEdit:e,onDelete:n,onSelect:s})=>{const o=l.useRef(null),{openMenu:i,closeMenu:u}=J(),p=l.useMemo(()=>[{label:"Edit",icon:t.jsx(ze,{color:"#3B64A0",size:18}),command:()=>e?.()},{label:"Delete",icon:t.jsx(K,{color:"#3B64A0",size:18}),command:()=>n?.()}],[e,n]),c=a=>{a.stopPropagation(),i(o,a)},r=a=>{a.target.closest(`.${T.menuButton}`)||s?.()};return t.jsxs("div",{className:T.ifStatementContainer,children:[t.jsx(At,{style:{position:"absolute",top:"22.5px",left:0,zIndex:1}}),t.jsx("div",{className:T.ifStatement,children:t.jsx("img",{src:Lt,alt:"condition",onClick:a=>r(a),className:T.conditionIcon})}),t.jsx("button",{type:"button",className:T.menuButton,onClick:c,"aria-label":"Open menu","aria-haspopup":"menu",children:t.jsx(G,{className:T.menuIcon})}),t.jsx(F,{ref:o,model:p,popup:!0,onHide:()=>u(o)}),t.jsx("img",{src:Et,alt:"ifdot",className:T.ifdotIcon})]})},Dt=34.5,de=({items:e,pathId:n,onAddStep:s,onAddTrigger:o,onAddCondition:i,onDeleteStep:u,onUpdateFilter:p,onSelectStep:c})=>{const r=l.useRef(null),a=l.useRef([]),[g,w]=l.useState([]);l.useEffect(()=>{const d=()=>{if(!r.current||e.length===0){w([]);return}const v=r.current.getBoundingClientRect(),_=[];for(let y=0;y<e.length;y++){const M=a.current[y];if(M){const I=M.getBoundingClientRect();_.push(I.top-v.top+Dt)}}_.length===e.length&&w(_)};return d(),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[e]);const m=l.useMemo(()=>g.length!==e.length||e.length<=1?null:e.map((d,v)=>v).filter(d=>d>0).map(d=>{const v=g[d];return v===void 0?null:t.jsx(yt,{width:100,height:v},d)}),[e,g]);return t.jsxs("div",{className:$.row,children:[t.jsx(Wt,{onDelete:()=>n!=null&&u?.(n),onSelect:n!=null&&c?()=>c(n):void 0}),t.jsxs("div",{ref:r,className:$.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100px",height:"2px",borderTop:"2px solid #3B64A0"}}),m]}),t.jsx("div",{className:$.column,children:e.map((d,v)=>{let _;if(d.paths)_=t.jsx(de,{items:d.paths,pathId:n,onAddStep:s,onAddTrigger:o,onAddCondition:i,onDeleteStep:u,onUpdateFilter:p,onSelectStep:c},d.localId);else if(d.steps){const y=d;_=t.jsxs("div",{className:$.stepsContainer,children:[t.jsx(Bt,{expression:y.condition,style:{marginTop:"25px"}}),t.jsx(ue,{steps:d.steps,pathId:d.localId,onSelectStep:c??(()=>{}),onAddStep:s,onAddTrigger:o,onAddCondition:i,onDeleteStep:u,onUpdateFilter:p},d.localId)]})}else _=t.jsx(V,{localId:d.localId,title:"title"in d?d.title:"",idx:1,icon:"icon"in d?d.icon:void 0,onSelectStep:c,onDeleteStep:u,onUpdateFilter:p},d.localId);return t.jsx("div",{ref:y=>{a.current[v]=y},style:{width:"100%"},children:_},d.localId)})}),t.jsxs("div",{className:$.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:.5,left:0,flex:1,width:"100%",height:"2px",borderTop:"2px solid #3B64A0"}}),m]}),t.jsx("div",{style:{flex:1,width:"100%",height:"2px",borderTop:"2px solid #3B64A0",marginTop:"34px"}})]})},q=68,ue=({pathId:e,steps:n,centerY:s,className:o,onAddStep:i,onDeleteStep:u,onUpdateFilter:p,onAddTrigger:c,onAddCondition:r,onSelectStep:a,isDescendent:g=!0})=>{const w=s===void 0?void 0:{marginTop:Math.max(0,s-q/2)};return n.length===0?t.jsxs("div",{style:{width:"100%",marginTop:"20px",display:"flex",flexDirection:"row",flex:1,minWidth:0,...w},children:[t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:"2px solid #3B64A0"}}),t.jsx(A,{onAddStep:()=>{i?.(void 0,e)},onAddTrigger:c,index:0,style:{height:"auto"}}),t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:"2px solid #3B64A0"}})]}):t.jsx("div",{className:X.steps+(o?" "+o:""),style:w,children:t.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:1,minWidth:0,width:"100%",alignItems:"flex-start"},children:[t.jsx(A,{onAddStep:()=>{i?.(n[0].localId,e,"prepend")},onAddTrigger:c,onAddCondition:r,stepId:n[0].localId,pathId:e,index:0,style:{marginTop:"20px"}}),n.map((m,d)=>t.jsx("div",{className:X.stepContainer+(m.paths?" "+X.stepContainerWithPaths:""),children:m.paths?t.jsx(de,{items:m.paths,pathId:m.localId,onAddStep:i,onAddCondition:r,onDeleteStep:u,onAddTrigger:c,onSelectStep:a,onUpdateFilter:p},m.title):t.jsxs(t.Fragment,{children:[t.jsx(V,{localId:m.localId,title:m.title,idx:1,icon:m.icon,isSet:m.isSet,isInvalid:m.isInvalid,isFilter:m.isFilter,onSelectStep:a,onDeleteStep:u,onUpdateFilter:p},m.title),t.jsx(A,{onAddStep:i,onAddTrigger:c,onAddCondition:r,stepId:m.localId,pathId:e,index:d+1})]})},m.localId)),g&&t.jsx("div",{style:{flexGrow:1,minWidth:0,borderTop:"2px solid #3B64A0",marginTop:"33.5px"}})]})})},Ft="_container_12c1g_1",Vt={container:Ft},Zt=({process:e,addMultipleTriggers:n,onAddStep:s,onAddTrigger:o,onAddCondition:i,onDeleteTrigger:u,onDeleteStep:p,onUpdateFilter:c,onSelectStep:r})=>{const[a,g]=l.useState(0);return t.jsxs("div",{className:Vt.container,children:[t.jsx(ae,{steps:e.triggers,onAddTrigger:n,onUpdateFilter:c,onDeleteTrigger:u,onSelectStep:r,onCenterYUpdate:g}),e.steps.length>0?t.jsx(ue,{steps:e.steps,centerY:a,onAddStep:s,onAddTrigger:o,onAddCondition:i,onDeleteStep:p,onUpdateFilter:c,onSelectStep:r,isDescendent:!1,pathId:void 0}):t.jsx(A,{onAddStep:()=>s(),onAddTrigger:o,index:0,style:{height:q,marginTop:Math.max(0,a-q/2)}})]})};class pe extends Error{constructor(n){super(n),this.name="AddStepError"}}const oe=e=>"condition"in e&&typeof e.condition=="string",he=(e,n,s,o)=>{const i=o==="prepend"?n:n+1;return[...e.slice(0,i),s,...e.slice(i)]},Q=(e,n,s,o)=>{for(let i=0;i<e.length;i++){if(e[i].localId===n)return he(e,i,o,s);const u=e[i],p=u.steps?.length&&Q(u.steps,n,s,o);if(p)return e.map((r,a)=>a===i?{...r,steps:p}:r);const c=u.paths?.length&&me(u.paths,n,s,o);if(c)return e.map((r,a)=>a===i?{...r,paths:c}:r)}return null},Yt=(e,n,s)=>{const o=e.steps??[],i=n==="prepend"?[s,...o]:[...o,s];return{...e,steps:i}},me=(e,n,s,o)=>{for(let i=0;i<e.length;i++){const u=e[i];if(u.localId===n)return oe(u)?e.map((p,c)=>c===i?Yt(u,s,o):p):he(e,i,o,s);if(oe(u)){const p=u.steps?.length&&Q(u.steps,n,s,o);if(p)return e.map((r,a)=>a===i?{...r,steps:p}:r);const c=u.paths?.length&&me(u.paths,n,s,o);if(c)return e.map((r,a)=>a===i?{...r,paths:c}:r)}}return null},Xt=(e,n,s,o)=>{const i=Q(e.steps,n,s,o);if(i)return{...e,steps:i};throw new pe(`Step or path with id "${n}" not found`)},fe=(e,n)=>({...e,...e.steps!=null&&{steps:U(e.steps,n)},...e.paths!=null&&{paths:e.paths.map(s=>fe(s,n))}}),U=(e,n)=>e.filter(s=>s.localId!==n).map(s=>({...s,...s.steps!=null&&{steps:U(s.steps,n)},...s.paths!=null&&{paths:s.paths.map(o=>fe(o,n))}})),Gt=(e,n)=>{const s=U(e.steps,n);return{...e,steps:s}};exports.AddStepError=pe;exports.Menu=F;exports.MenuProvider=Xe;exports.ProcessDiagram=Zt;exports.ProcessStep=V;exports.Trigger=ae;exports.addStep=Xt;exports.deleteStep=Gt;exports.useMenuProvider=J;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),_1=require("react-dom"),j1="_container_8wfnz_1",w1="_step_8wfnz_7",y1="_selected_8wfnz_23",I1="_selectedInvalid_8wfnz_29",b1="_isSet_8wfnz_35",N1="_invalid_8wfnz_39",k1="_filterFlag_8wfnz_45",M1="_title_8wfnz_73",B1="_icon_8wfnz_90",P1="_content_8wfnz_108",L1="_dotsButton_8wfnz_114",b={container:j1,step:w1,selected:y1,selectedInvalid:I1,isSet:b1,invalid:N1,filterFlag:k1,title:M1,icon:B1,content:P1,dotsButton:L1};var a1={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},o1=l.createContext&&l.createContext(a1),S1=["attr","size","title"];function E1(e,n){if(e==null)return{};var s=T1(e,n),o,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)o=a[i],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(s[o]=e[o])}return s}function T1(e,n){if(e==null)return{};var s={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(n.indexOf(o)>=0)continue;s[o]=e[o]}return s}function Z(){return Z=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e[o]=s[o])}return e},Z.apply(this,arguments)}function i1(e,n){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),s.push.apply(s,o)}return s}function V(e){for(var n=1;n<arguments.length;n++){var s=arguments[n]!=null?arguments[n]:{};n%2?i1(Object(s),!0).forEach(function(o){$1(e,o,s[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):i1(Object(s)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(s,o))})}return e}function $1(e,n,s){return n=O1(n),n in e?Object.defineProperty(e,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[n]=s,e}function O1(e){var n=H1(e,"string");return typeof n=="symbol"?n:n+""}function H1(e,n){if(typeof e!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var o=s.call(e,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function d1(e){return e&&e.map((n,s)=>l.createElement(n.tag,V({key:s},n.attr),d1(n.child)))}function R(e){return n=>l.createElement(R1,Z({attr:V({},e.attr)},n),d1(e.child))}function R1(e){var n=s=>{var{attr:o,size:i,title:a}=e,d=E1(e,S1),u=i||s.size||"1em",r;return s.className&&(r=s.className),e.className&&(r=(r?r+" ":"")+e.className),l.createElement("svg",Z({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},s.attr,o,d,{className:r,style:V(V({color:e.color||s.color},s.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),a&&l.createElement("title",null,a),e.children)};return o1!==void 0?l.createElement(o1.Consumer,null,s=>n(s)):n(a1)}function W1(e){return R({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.52.359A.5.5 0 0 1 6 0h4a.5.5 0 0 1 .474.658L8.694 6H12.5a.5.5 0 0 1 .395.807l-7 9a.5.5 0 0 1-.873-.454L6.823 9.5H3.5a.5.5 0 0 1-.48-.641zM6.374 1 4.168 8.5H7.5a.5.5 0 0 1 .478.647L6.78 13.04 11.478 7H8a.5.5 0 0 1-.474-.658L9.306 1z"},child:[]}]})(e)}function z1(e){return R({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325"},child:[]}]})(e)}function q(e){return R({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"},child:[]}]})(e)}function A(e){return R({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z"},child:[]},{tag:"path",attr:{d:"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z"},child:[]}]})(e)}const D1="_panel_19663_1",F1="_panelExiting_19663_13",Z1="_menuItem_19663_37",V1="_disabled_19663_52",q1="_menuItemIcon_19663_57",A1="_menuItemText_19663_63",Y1="_overlay_19663_69",L={panel:D1,panelExiting:F1,menuItem:Z1,disabled:V1,menuItemIcon:q1,menuItemText:A1,overlay:Y1},X1=e=>{const s=e.currentTarget??e.target;if(s?.getBoundingClientRect){const i=s.getBoundingClientRect();return{top:i.bottom+2,left:i.left}}const o=e;return{top:(o.clientY??0)+2,left:o.clientX??0}},z=l.forwardRef(function({model:n,popup:s=!0,onHide:o,onClick:i},a){const[d,u]=l.useState(!1),[r,c]=l.useState(!1),[x,I]=l.useState({top:0,left:0}),_=l.useRef(null),g=l.useCallback(()=>{r||c(!0)},[r]),m=l.useCallback(h=>{r&&h.animationName.includes("menuOut")&&(u(!1),c(!1),o?.())},[r,o]),p=l.useCallback(h=>{I(X1(h)),c(!1),u(!0)},[]),j=l.useCallback(h=>{d?g():p(h)},[d,g,p]);l.useImperativeHandle(a,()=>({show:p,hide:g,toggle:j}),[p,g,j]),l.useEffect(()=>{if(!d)return;const h=P=>{P.key==="Escape"&&g()},y=P=>{const C=_.current;C&&!C.contains(P.target)&&(P.stopPropagation(),g())};return document.addEventListener("keydown",h),document.addEventListener("mousedown",y),()=>{document.removeEventListener("keydown",h),document.removeEventListener("mousedown",y)}},[d,g]);const w=(h,y)=>{y.stopPropagation(),h.command?.({originalEvent:y,item:h}),g()},v=(h,y)=>{const P=C=>w(h,C);return h.template?t.jsx(l.Fragment,{children:h.template(h,{onClick:P})},y):t.jsxs("button",{type:"button",className:`${L.menuItem} ${h.disabled&&L.disabled}`,onClick:C=>{h.disabled||P(C)},children:[h.icon&&t.jsx("span",{className:L.menuItemIcon,children:h.icon}),t.jsx("span",{className:L.menuItemText,children:h.label})]},y)};return!d||!s?null:_1.createPortal(t.jsxs(t.Fragment,{children:[t.jsx("div",{className:L.overlay,"aria-hidden":!0,onClick:()=>g(),onMouseDown:h=>h.stopPropagation()}),t.jsx("div",{ref:_,className:`${L.panel} ${r?L.panelExiting:""}`,role:"menu",style:{top:x.top,left:x.left},onAnimationEnd:m,onClick:h=>{h.stopPropagation(),i?.(h)},children:n.map(v)})]}),document.body)}),U=()=>(e,n)=>t.jsxs("button",{className:L.menuItem,onClick:s=>n.onClick(s),children:[t.jsx("span",{className:L.menuItemIcon,children:e.icon}),t.jsx("span",{className:L.menuItemText,children:e.label})]}),G1=({width:e=16,height:n=16,color:s="#3B64A0"})=>t.jsxs("svg",{width:e,height:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("rect",{x:"7.99219",y:"0.222732",width:"11",height:"11",rx:"1.5",transform:"rotate(45 7.99219 0.222732)",stroke:s}),t.jsx("path",{d:"M10.4693 5.52599L5.52513 10.4813M5.52513 5.53151L10.4749 10.4813",stroke:s,strokeLinecap:"round"})]}),K1=({width:e=16,height:n=16,color:s="#3B64A0"})=>t.jsxs("svg",{width:e,height:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M11.5341 7.00002H15.4661C15.5136 7.00004 15.5601 7.01359 15.6002 7.03909C15.6403 7.06459 15.6722 7.10098 15.6924 7.144C15.7125 7.18702 15.72 7.23489 15.7139 7.282C15.7079 7.32912 15.6885 7.37352 15.6581 7.41002L13.6921 9.77002C13.6686 9.79816 13.6393 9.82079 13.6061 9.83633C13.5729 9.85186 13.5367 9.85991 13.5001 9.85991C13.4635 9.85991 13.4273 9.85186 13.3941 9.83633C13.3609 9.82079 13.3315 9.79816 13.3081 9.77002L11.3421 7.41002C11.3117 7.37352 11.2923 7.32912 11.2862 7.282C11.2802 7.23489 11.2876 7.18702 11.3078 7.144C11.3279 7.10098 11.3599 7.06459 11.4 7.03909C11.4401 7.01359 11.4866 7.00004 11.5341 7.00002ZM0.534086 9.00002H4.46609C4.51359 9.00001 4.56011 8.98645 4.60019 8.96096C4.64027 8.93546 4.67225 8.89907 4.6924 8.85605C4.71254 8.81303 4.72002 8.76516 4.71394 8.71804C4.70786 8.67093 4.68849 8.62652 4.65809 8.59002L2.69209 6.23002C2.66862 6.20189 2.63926 6.17925 2.60609 6.16372C2.57291 6.14819 2.53672 6.14014 2.50009 6.14014C2.46345 6.14014 2.42726 6.14819 2.39409 6.16372C2.36091 6.17925 2.33155 6.20189 2.30809 6.23002L0.342086 8.59002C0.311684 8.62652 0.29231 8.67093 0.286234 8.71804C0.280157 8.76516 0.287629 8.81303 0.307775 8.85605C0.327921 8.89907 0.359907 8.93546 0.399987 8.96096C0.440067 8.98645 0.486583 9.00001 0.534086 9.00002Z",fill:s}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00001 3.00023C6.44801 3.00023 5.06001 3.70723 4.14301 4.81823C4.10206 4.87131 4.05086 4.9156 3.99245 4.94849C3.93404 4.98138 3.86961 5.00219 3.803 5.00968C3.73638 5.01717 3.66895 5.01119 3.60469 4.99209C3.54043 4.97299 3.48068 4.94117 3.42897 4.89851C3.37726 4.85586 3.33465 4.80324 3.30368 4.74379C3.27272 4.68434 3.25402 4.61926 3.24871 4.55244C3.24339 4.48562 3.25157 4.41841 3.27275 4.35481C3.29394 4.29121 3.32769 4.23252 3.37201 4.18223C4.1042 3.29576 5.0756 2.63824 6.17067 2.28789C7.26575 1.93753 8.43841 1.90908 9.54918 2.20592C10.66 2.50276 11.6621 3.1124 12.4364 3.96232C13.2107 4.81224 13.7246 5.86668 13.917 7.00023H12.9C12.6691 5.87104 12.0554 4.85623 11.1625 4.12738C10.2697 3.39853 9.15256 3.00037 8.00001 3.00023ZM3.10001 9.00023C3.28932 9.92486 3.73636 10.7771 4.38949 11.4584C5.04261 12.1397 5.87517 12.6223 6.79097 12.8505C7.70677 13.0787 8.66845 13.0431 9.5649 12.7479C10.4613 12.4527 11.256 11.9099 11.857 11.1822C11.898 11.1292 11.9492 11.0849 12.0076 11.052C12.066 11.0191 12.1304 10.9983 12.197 10.9908C12.2636 10.9833 12.3311 10.9893 12.3953 11.0084C12.4596 11.0275 12.5193 11.0593 12.5711 11.102C12.6228 11.1446 12.6654 11.1972 12.6963 11.2567C12.7273 11.3161 12.746 11.3812 12.7513 11.448C12.7566 11.5148 12.7484 11.5821 12.7273 11.6457C12.7061 11.7093 12.6723 11.7679 12.628 11.8182C11.8958 12.7047 10.9244 13.3622 9.82934 13.7126C8.73427 14.0629 7.56161 14.0914 6.45083 13.7945C5.34006 13.4977 4.33791 12.8881 3.5636 12.0381C2.78928 11.1882 2.27538 10.1338 2.08301 9.00023H3.10001Z",fill:s})]}),r1=({width:e=16,height:n=16,color:s="#3B64A0"})=>t.jsxs("svg",{width:e,height:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M8 15C6.14348 15 4.36301 14.2625 3.05025 12.9497C1.7375 11.637 1 9.85652 1 8C1 6.14348 1.7375 4.36301 3.05025 3.05025C4.36301 1.7375 6.14348 1 8 1C9.85652 1 11.637 1.7375 12.9497 3.05025C14.2625 4.36301 15 6.14348 15 8C15 9.85652 14.2625 11.637 12.9497 12.9497C11.637 14.2625 9.85652 15 8 15ZM8 16C10.1217 16 12.1566 15.1571 13.6569 13.6569C15.1571 12.1566 16 10.1217 16 8C16 5.87827 15.1571 3.84344 13.6569 2.34315C12.1566 0.842855 10.1217 0 8 0C5.87827 0 3.84344 0.842855 2.34315 2.34315C0.842855 3.84344 0 5.87827 0 8C0 10.1217 0.842855 12.1566 2.34315 13.6569C3.84344 15.1571 5.87827 16 8 16Z",fill:s}),t.jsx("path",{d:"M7 11.5C7 11.3674 7.05268 11.2402 7.14645 11.1464C7.24021 11.0527 7.36739 11 7.5 11H8.5C8.63261 11 8.75979 11.0527 8.85355 11.1464C8.94732 11.2402 9 11.3674 9 11.5C9 11.6326 8.94732 11.7598 8.85355 11.8536C8.75979 11.9473 8.63261 12 8.5 12H7.5C7.36739 12 7.24021 11.9473 7.14645 11.8536C7.05268 11.7598 7 11.6326 7 11.5ZM5 8.5C5 8.36739 5.05268 8.24021 5.14645 8.14645C5.24021 8.05268 5.36739 8 5.5 8H10.5C10.6326 8 10.7598 8.05268 10.8536 8.14645C10.9473 8.24021 11 8.36739 11 8.5C11 8.63261 10.9473 8.75979 10.8536 8.85355C10.7598 8.94732 10.6326 9 10.5 9H5.5C5.36739 9 5.24021 8.94732 5.14645 8.85355C5.05268 8.75979 5 8.63261 5 8.5ZM3 5.5C3 5.36739 3.05268 5.24021 3.14645 5.14645C3.24021 5.05268 3.36739 5 3.5 5H12.5C12.6326 5 12.7598 5.05268 12.8536 5.14645C12.9473 5.24021 13 5.36739 13 5.5C13 5.63261 12.9473 5.75979 12.8536 5.85355C12.7598 5.94732 12.6326 6 12.5 6H3.5C3.36739 6 3.24021 5.94732 3.14645 5.85355C3.05268 5.75979 3 5.63261 3 5.5Z",fill:s})]}),u1=l.createContext(void 0),J1=({children:e})=>{const[n,s]=l.useState([]),o=l.useCallback((d,u)=>{s(r=>(r.forEach(c=>{c.current&&c!==d&&c.current.hide(u)}),[])),d.current?.toggle(u),s([d])},[]),i=l.useCallback(d=>{s(u=>u.filter(r=>r!==d))},[]),a=l.useMemo(()=>({openMenus:n,openMenu:o,closeMenu:i}),[n,o,i]);return t.jsx(u1.Provider,{value:a,children:e})},Y=()=>{const e=l.useContext(u1);if(e===void 0)throw new Error("useMenuProvider must be used within a MenuProvider");return e},Q1=({color:e="#E32012"})=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[t.jsx("g",{clipPath:"url(#clip0_3105_5367)",children:t.jsx("path",{d:"M16 8C16 10.1217 15.1571 12.1566 13.6569 13.6569C12.1566 15.1571 10.1217 16 8 16C5.87827 16 3.84344 15.1571 2.34315 13.6569C0.842855 12.1566 0 10.1217 0 8C0 5.87827 0.842855 3.84344 2.34315 2.34315C3.84344 0.842855 5.87827 0 8 0C10.1217 0 12.1566 0.842855 13.6569 2.34315C15.1571 3.84344 16 5.87827 16 8ZM8 4C7.87361 4.00007 7.74863 4.02662 7.63312 4.07793C7.51761 4.12924 7.41413 4.20418 7.32934 4.29791C7.24456 4.39165 7.18035 4.5021 7.14084 4.62217C7.10134 4.74223 7.08743 4.86923 7.1 4.995L7.45 8.502C7.46176 8.63977 7.5248 8.76811 7.62664 8.86164C7.72849 8.95516 7.86173 9.00705 8 9.00705C8.13827 9.00705 8.27151 8.95516 8.37336 8.86164C8.4752 8.76811 8.53824 8.63977 8.55 8.502L8.9 4.995C8.91257 4.86923 8.89866 4.74223 8.85915 4.62217C8.81965 4.5021 8.75544 4.39165 8.67066 4.29791C8.58587 4.20418 8.48239 4.12924 8.36688 4.07793C8.25137 4.02662 8.12639 4.00007 8 4ZM8.002 10C7.73678 10 7.48243 10.1054 7.29489 10.2929C7.10736 10.4804 7.002 10.7348 7.002 11C7.002 11.2652 7.10736 11.5196 7.29489 11.7071C7.48243 11.8946 7.73678 12 8.002 12C8.26722 12 8.52157 11.8946 8.70911 11.7071C8.89664 11.5196 9.002 11.2652 9.002 11C9.002 10.7348 8.89664 10.4804 8.70911 10.2929C8.52157 10.1054 8.26722 10 8.002 10Z",fill:e})}),t.jsx("defs",{children:t.jsx("clipPath",{id:"clip0_3105_5367",children:t.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),X=e=>{const{isSet:n,isSelected:s,isFilter:o,className:i,title:a,icon:d,contextMenuItems:u=void 0,onDeleteStep:r,onUpdateFilter:c,onSelectStep:x,subtitle:I,isInvalid:_,localId:g}=e,m=l.useRef(null),{openMenu:p,closeMenu:j}=Y(),w=U(),v=l.useMemo(()=>[{label:"Add Step Filter",icon:t.jsx("div",{className:"mr-2 flex items-center justify-center",children:t.jsx(r1,{})}),command:f=>{f?.originalEvent?.stopPropagation(),c&&c(g)},template:w},{label:"Remove",icon:t.jsx(A,{color:"#3B64A0",size:18}),command:f=>{f?.originalEvent?.stopPropagation(),r&&r(g)},template:w}],[c,r,g,w]),h=l.useMemo(()=>u!==void 0?u:v,[u,v]),y=f=>{f.stopPropagation(),p(m,f)},P=l.useMemo(()=>s&&_?b.step+" "+b.selectedInvalid:s?b.step+" "+b.selected:n?b.step+" "+b.isSet:_?b.step+" "+b.invalid:b.step,[n,s,_]),C=l.useMemo(()=>_?t.jsx(Q1,{color:"#E32012"}):d,[d,_]);return t.jsx("div",{className:b.container+" "+i,children:t.jsxs("div",{children:[t.jsxs("div",{className:P,onClick:()=>x(g),children:[t.jsxs("div",{className:b.content,children:[t.jsx("div",{className:`${b.icon} ${_&&b.invalid}`,children:C}),t.jsx("div",{className:b.title,children:a})]}),t.jsx("button",{className:b.dotsButton,onClick:y,"aria-haspopup":!0,"aria-label":"Step options",children:t.jsx(q,{className:b.dots,color:_?"#E32012":"#3B64A0"})}),t.jsx(z,{model:h,popup:!0,ref:m,onClick:f=>f.stopPropagation(),onHide:()=>j(m)})]}),o&&t.jsxs("div",{className:b.filterFlag,role:"button",tabIndex:0,onClick:()=>{c&&c(g)},onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&c&&(f.preventDefault(),c(g))},children:[t.jsx(r1,{color:"#3B64A0"}),t.jsx("span",{children:"Filter"}),t.jsx(q,{className:b.dots,color:_?"#E32012":"#3B64A0",style:{height:"10px"}})]}),I&&t.jsx("div",{className:b.subtitle,children:I})]})})},U1=()=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[t.jsxs("g",{clipPath:"url(#clip0_6551_9169)",children:[t.jsx("rect",{width:"24",height:"24",rx:"12",fill:"#0C971F"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V11H18C18.5523 11 19 11.4477 19 12C19 12.5523 18.5523 13 18 13H13V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H6C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11H11V6Z",fill:"white"})]}),t.jsx("rect",{x:"0.75",y:"0.75",width:"22.5",height:"22.5",rx:"11.25",stroke:"#14BC2B",strokeWidth:"1.5"}),t.jsx("defs",{children:t.jsx("clipPath",{id:"clip0_6551_9169",children:t.jsx("rect",{width:"24",height:"24",rx:"12",fill:"white"})})})]}),ee="_multipleTriggersIcon_oxhdi_1",te={multipleTriggersIcon:ee},ne=()=>t.jsx("div",{className:te.multipleTriggersIcon,children:t.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 3.75C1.5 3.15326 1.73705 2.58097 2.15901 2.15901C2.58097 1.73705 3.15326 1.5 3.75 1.5H5.25C5.84674 1.5 6.41903 1.73705 6.84099 2.15901C7.26295 2.58097 7.5 3.15326 7.5 3.75L13.701 3.75C13.8661 3.46404 14.1209 3.24054 14.426 3.11418C14.7311 2.98782 15.0693 2.96565 15.3883 3.05111C15.7072 3.13657 15.9891 3.32489 16.1901 3.58686C16.3911 3.84882 16.5 4.1698 16.5 4.5C16.5 4.8302 16.3911 5.15118 16.1901 5.41314C15.9891 5.67511 15.7072 5.86343 15.3883 5.94889C15.0693 6.03435 14.7311 6.01218 14.426 5.88582C14.1209 5.75946 13.8661 5.53596 13.701 5.25H10.686C10.956 5.52 11.196 5.8215 11.412 6.1575C12.369 7.6455 12.75 9.6885 12.75 12C12.75 14.9895 13.1355 16.638 13.8195 17.55C14.3535 18.264 15.162 18.6315 16.5 18.726C16.5063 18.1334 16.7462 17.5673 17.1674 17.1505C17.5887 16.7337 18.1574 16.5 18.75 16.5H20.25C20.8467 16.5 21.419 16.7371 21.841 17.159C22.2629 17.581 22.5 18.1533 22.5 18.75V20.25C22.5 20.8467 22.2629 21.419 21.841 21.841C21.419 22.2629 20.8467 22.5 20.25 22.5H18.75C18.1533 22.5 17.581 22.2629 17.159 21.841C16.7371 21.419 16.5 20.8467 16.5 20.25H10.299C10.1339 20.536 9.87905 20.7595 9.57399 20.8858C9.26892 21.0122 8.93068 21.0344 8.61173 20.9489C8.29278 20.8634 8.01095 20.6751 7.80993 20.4131C7.60892 20.1512 7.49996 19.8302 7.49996 19.5C7.49996 19.1698 7.60892 18.8488 7.80993 18.5869C8.01095 18.3249 8.29278 18.1366 8.61173 18.0511C8.93068 17.9656 9.26892 17.9878 9.57399 18.1142C9.87905 18.2405 10.1339 18.464 10.299 18.75H12.8655C12.7785 18.6538 12.6959 18.5537 12.618 18.45C11.6145 17.1105 11.25 15.0105 11.25 12C11.25 9.81 10.881 8.1045 10.1505 6.9675C9.5655 6.06 8.7225 5.4675 7.5 5.2995C7.48706 5.88762 7.2443 6.44728 6.82374 6.85859C6.40318 7.2699 5.83826 7.50014 5.25 7.5H3.75C3.15326 7.5 2.58097 7.26295 2.15901 6.84099C1.73705 6.41903 1.5 5.84674 1.5 5.25V3.75ZM3.75 3C3.55109 3 3.36032 3.07902 3.21967 3.21967C3.07902 3.36032 3 3.55109 3 3.75V5.25C3 5.44891 3.07902 5.63968 3.21967 5.78033C3.36032 5.92098 3.55109 6 3.75 6H5.25C5.44891 6 5.63968 5.92098 5.78033 5.78033C5.92098 5.63968 6 5.44891 6 5.25V3.75C6 3.55109 5.92098 3.36032 5.78033 3.21967C5.63968 3.07902 5.44891 3 5.25 3H3.75ZM18.75 18C18.5511 18 18.3603 18.079 18.2197 18.2197C18.079 18.3603 18 18.5511 18 18.75V20.25C18 20.4489 18.079 20.6397 18.2197 20.7803C18.3603 20.921 18.5511 21 18.75 21H20.25C20.4489 21 20.6397 20.921 20.7803 20.7803C20.921 20.6397 21 20.4489 21 20.25V18.75C21 18.5511 20.921 18.3603 20.7803 18.2197C20.6397 18.079 20.4489 18 20.25 18H18.75Z",fill:"white"})})}),se="_trigger_kfg1y_1",oe="_title_kfg1y_7",ie="_empty_kfg1y_15",re="_triggerContainer_kfg1y_21",le="_stepsContainer_kfg1y_25",ce="_stepItem_kfg1y_51",ae="_curvesSvg_kfg1y_70",de="_centralNode_kfg1y_78",ue="_iconWrapper_kfg1y_104",pe="_fadeIn_kfg1y_127",he="_fadeOut_kfg1y_130",Ce="_operationContainer_kfg1y_134",B={trigger:se,title:oe,empty:ie,triggerContainer:re,stepsContainer:le,stepItem:ce,curvesSvg:ae,centralNode:de,iconWrapper:ue,fadeIn:pe,fadeOut:he,operationContainer:Ce},me=()=>t.jsx("div",{style:{height:"1px",marginLeft:"4px",marginRight:"4px",borderTop:"1px solid #a1bbdc"}}),xe=80,D=34,p1=({steps:e,title:n,className:s,onDeleteTrigger:o,onAddTrigger:i,onSelectStep:a,onUpdateFilter:d,onCenterYUpdate:u})=>{const r=l.useRef(null),c=l.useRef([]),[x,I]=l.useState([]),[_,g]=l.useState({width:0,height:0}),[m,p]=l.useState(!1),[j,w]=l.useState(!1),v=l.useRef(null);l.useEffect(()=>{const C=()=>{if(!r.current)return;const f=[];if(c.current.forEach((M,N)=>{if(M&&r.current){const S=r.current.getBoundingClientRect(),E=M.getBoundingClientRect();f.push({localId:e[N]?.localId??`step-${N}`,top:E.top-S.top,right:E.right-S.left,centerY:E.top-S.top+E.height/2})}}),I(f),r.current&&f.length>0){const M=r.current.getBoundingClientRect(),N=Math.min(...f.map(T=>T.top)),S=c.current.filter(Boolean).map(T=>T?.offsetHeight||68),E=Math.max(...f.map((T,v1)=>T.top+(S[v1]||68))),G=Math.max(...f.map(T=>T.right))+0,K=Math.max(M.height,E-N+100);g({width:G,height:K})}};return C(),window.addEventListener("resize",C),()=>window.removeEventListener("resize",C)},[e]),l.useEffect(()=>{let C=!0;if(m){v.current&&(clearTimeout(v.current),v.current=null);const f=setTimeout(()=>{C&&w(!0)},0);return()=>{C=!1,clearTimeout(f)}}return v.current=setTimeout(()=>{C&&w(!1)},140),()=>{C=!1,v.current&&(clearTimeout(v.current),v.current=null)}},[m]);const h=x.length>0?xe:0,y=l.useMemo(()=>x.length>1?x.reduce((C,f)=>C+f.top+D,0)/x.length:x.length===1?x[0].top+D:0,[x]);if(l.useEffect(()=>{u?.(y)},[y,u]),e.length===0)return t.jsxs("div",{className:`${B.trigger} ${s||""}`,children:[n&&t.jsx("h3",{className:B.title,children:n}),t.jsx("div",{className:B.empty,children:"No steps"})]});const P=(C,f,M,N)=>{const S=M-C,E=Math.min(S*.6,60),s1=C+E,G=f,K=M-E;return`M ${C} ${f} C ${s1} ${G}, ${K} ${N}, ${M} ${N}`};return t.jsxs("div",{className:`${B.trigger} ${s||""}`,ref:r,children:[n&&t.jsx("h3",{className:B.title,children:n}),t.jsxs("div",{className:B.triggerContainer,children:[t.jsx("div",{className:B.stepsContainer,children:e.map((C,f)=>t.jsx("div",{ref:M=>{c.current[f]=M},children:t.jsx(X,{title:C.title,className:B.stepItem,localId:C.localId,idx:f,isSet:C.isSet,isSelected:C.isSelected,isInvalid:C.isInvalid,isFilter:C.isFilter,icon:C.icon,onSelectStep:a,onUpdateFilter:d,contextMenuItems:[{label:"Delete",icon:t.jsx(A,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{o?.(C.localId)},disabled:e.length===1},{label:"",template:()=>t.jsx(me,{})},{label:"Add More Triggers",icon:t.jsx(W1,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{i?.()}}]})},C.localId))}),t.jsx("div",{style:{position:"relative"},children:x.length>1&&t.jsx("svg",{className:B.curvesSvg,width:_.width,height:_.height,children:x.map(C=>{const M=x.length===1?x[0].top+D:C.top+D,N=h,S=y;return t.jsx("path",{d:P(0,M,N,S),stroke:"#3b64a0",strokeWidth:"2",fill:"none",strokeLinecap:"round"},C.localId)})})}),x.length>1?t.jsxs("div",{style:{position:"relative",marginRight:"140px"},children:[t.jsx("div",{className:B.centralNode,style:{"--node-x":`${h}px`,"--node-y":`${y}px`},onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:j?t.jsx("div",{className:`${B.iconWrapper} ${m?B.fadeIn:B.fadeOut}`,onClick:i,children:t.jsx(U1,{})}):null}),t.jsx("div",{className:B.operationContainer,style:{"--op-x":`${h+16}px`,"--op-y":`${y}px`},children:t.jsx(ne,{})})]}):null]})]})};function fe(e){return R({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"4"},child:[]},{tag:"line",attr:{x1:"1.05",y1:"12",x2:"7",y2:"12"},child:[]},{tag:"line",attr:{x1:"17.01",y1:"12",x2:"22.96",y2:"12"},child:[]}]})(e)}function ge(e){return R({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"},child:[]}]})(e)}const ve=()=>t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M6 12L18 12",stroke:"#3B64A0",strokeWidth:"2",strokeLinecap:"round"}),t.jsx("path",{d:"M12 6V18",stroke:"#3B64A0",strokeWidth:"2",strokeLinecap:"round"})]}),_e="_stepLinkIcon_18u2g_1",je="_stepLinkLine_18u2g_15",we="_stepLinkContainer_18u2g_39",F={stepLinkIcon:_e,stepLinkLine:je,stepLinkContainer:we},H=({onAddStep:e,onAddTrigger:n,onAddCondition:s,onAddLoop:o,stepId:i,index:a=0,style:d,pathId:u})=>{const r=U(),c=l.useRef(null),x=[...a>0?[{label:"Trigger",icon:t.jsx(ge,{color:"#3B64A0",size:18}),command:()=>{n?.(i,u,"trigger")},template:r}]:[],{label:"Step",icon:t.jsx(fe,{color:"#3B64A0",size:18}),command:()=>e?.(i,u,"append"),template:r},...i?[{label:"Condition",icon:t.jsx(G1,{width:18,height:18}),command:()=>s?.(i,u,"append"),template:r},{label:"Loop",icon:t.jsx(K1,{width:18,height:18}),command:()=>o?.(i,u,"append"),template:r}]:[]],I=_=>{c.current?.show(_)};return t.jsxs("div",{className:F.stepLinkContainer,style:{...d},"data-plus-index":a,children:[t.jsx("div",{className:F.stepLinkLine}),t.jsx("div",{className:F.stepLinkIcon,onClick:I,"aria-haspopup":!0,children:t.jsx(ve,{})}),t.jsx(z,{model:x,popup:!0,ref:c}),t.jsx("div",{className:F.stepLinkLine})]})},ye="_steps_yug55_1",Ie="_stepContainer_yug55_8",be="_stepContainerWithPaths_yug55_14",J={steps:ye,stepContainer:Ie,stepContainerWithPaths:be},Ne=(e,n,s,o)=>{const i=s-e,a=Math.min(i*.66,66),d=e+a,u=n,r=s-a;return`M ${e} ${n} C ${d} ${u}, ${r} ${o}, ${s} ${o}`},ke=({width:e,height:n})=>{const d=Ne(0,1,e,n);return t.jsx("div",{style:{position:"absolute"},children:t.jsx("svg",{width:e,height:n+1,viewBox:`0 0 ${e} ${n+1}`,xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d,stroke:"#3b64a0",strokeWidth:"2",fill:"none",strokeLinecap:"round"})})})},Me="_column_1uiy3_1",Be="_row_1uiy3_19",Pe="_stepsContainer_1uiy3_24",W={column:Me,row:Be,stepsContainer:Pe},Le="_wrapper_1nl2d_1",Se="_tooltip_1nl2d_5",l1={wrapper:Le,tooltip:Se},Ee=({content:e,children:n,maxWidth:s=500,className:o})=>t.jsxs("div",{className:`${l1.wrapper} ${o??""}`.trim(),style:{"--tooltip-max-width":`${s}px`},children:[n,e?t.jsx("div",{className:l1.tooltip,role:"tooltip",children:e}):null]}),Te="_conditionContainer_5kl8s_1",$e="_connectorLine_5kl8s_6",Oe="_conditionWrapper_5kl8s_12",He="_condition_5kl8s_1",Re="_connectorDot_5kl8s_43",O={conditionContainer:Te,connectorLine:$e,conditionWrapper:Oe,condition:He,connectorDot:Re},We=({expression:e,style:n})=>{const s=l.useRef(null),[o,i]=l.useState(!1);l.useLayoutEffect(()=>{const d=s.current;d&&i(d.scrollHeight>d.clientHeight)},[e]);const a=e&&o?e:"";return t.jsxs("div",{className:O.conditionContainer,style:n,children:[t.jsx("div",{className:O.connectorLine}),t.jsx(Ee,{content:a,className:O.conditionWrapper,children:t.jsx("div",{ref:s,className:O.condition,children:e})}),t.jsx("div",{className:O.connectorLine}),t.jsx("div",{className:O.connectorDot})]})},ze="data:image/svg+xml,%3csvg%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='21.8125'%20y='-2.52539'%20width='34.4207'%20height='34.4207'%20rx='6.09524'%20transform='rotate(45%2021.8125%20-2.52539)'%20fill='%236B90C0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M31.3947%2013.0355C31.4679%2013.1085%2031.526%2013.1952%2031.5656%2013.2907C31.6052%2013.3861%2031.6256%2013.4885%2031.6256%2013.5918C31.6256%2013.6952%2031.6052%2013.7975%2031.5656%2013.8929C31.526%2013.9884%2031.4679%2014.0751%2031.3947%2014.1481L14.109%2031.4338C13.9615%2031.5813%2013.7614%2031.6642%2013.5527%2031.6642C13.3441%2031.6642%2013.144%2031.5813%2012.9965%2031.4338C12.8489%2031.2863%2012.766%2031.0862%2012.766%2030.8775C12.766%2030.6689%2012.8489%2030.4688%2012.9965%2030.3212L30.2822%2013.0355C30.3552%2012.9623%2030.4419%2012.9043%2030.5373%2012.8647C30.6328%2012.8251%2030.7351%2012.8047%2030.8385%2012.8047C30.9418%2012.8047%2031.0441%2012.8251%2031.1396%2012.8647C31.2351%2012.9043%2031.3218%2012.9623%2031.3947%2013.0355Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.9965%2013.0355C12.9233%2013.1085%2012.8652%2013.1952%2012.8256%2013.2907C12.786%2013.3861%2012.7656%2013.4885%2012.7656%2013.5918C12.7656%2013.6952%2012.786%2013.7975%2012.8256%2013.8929C12.8652%2013.9884%2012.9233%2014.0751%2012.9965%2014.1481L30.2822%2031.4338C30.4297%2031.5813%2030.6298%2031.6642%2030.8385%2031.6642C31.0471%2031.6642%2031.2472%2031.5813%2031.3947%2031.4338C31.5423%2031.2863%2031.6252%2031.0862%2031.6252%2030.8775C31.6252%2030.6689%2031.5423%2030.4688%2031.3947%2030.3212L14.109%2013.0355C14.036%2012.9623%2013.9493%2012.9043%2013.8539%2012.8647C13.7584%2012.8251%2013.6561%2012.8047%2013.5527%2012.8047C13.4494%2012.8047%2013.3471%2012.8251%2013.2516%2012.8647C13.1561%2012.9043%2013.0694%2012.9623%2012.9965%2013.0355Z'%20fill='white'/%3e%3c/svg%3e",De="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='1'%20y='1'%20width='26'%20height='26'%20rx='13'%20fill='white'/%3e%3crect%20x='1'%20y='1'%20width='26'%20height='26'%20rx='13'%20stroke='%236B90C0'%20stroke-width='2'/%3e%3ccircle%20cx='14'%20cy='14'%20r='6'%20fill='%236B90C0'/%3e%3c/svg%3e",Fe="_ifStatement_1xsn9_1",Ze="_conditionIcon_1xsn9_7",Ve="_ifStatementContainer_1xsn9_21",qe="_menuButton_1xsn9_27",Ae="_menuIcon_1xsn9_52",Ye="_ifdotIcon_1xsn9_59",$={ifStatement:Fe,conditionIcon:Ze,ifStatementContainer:Ve,menuButton:qe,menuIcon:Ae,ifdotIcon:Ye},Xe=({style:e})=>t.jsx("div",{style:{width:"100%",height:"2px",borderTop:"2px solid #3B64A0",...e}}),Ge=({onEdit:e,onDelete:n,onSelect:s})=>{const o=l.useRef(null),{openMenu:i,closeMenu:a}=Y(),d=l.useMemo(()=>[{label:"Edit",icon:t.jsx(z1,{color:"#3B64A0",size:18}),command:()=>e?.()},{label:"Delete",icon:t.jsx(A,{color:"#3B64A0",size:18}),command:()=>n?.()}],[e,n]),u=c=>{c.stopPropagation(),i(o,c)},r=c=>{c.target.closest(`.${$.menuButton}`)||s?.()};return t.jsxs("div",{className:$.ifStatementContainer,children:[t.jsx(Xe,{style:{position:"absolute",top:"22.5px",left:0,zIndex:1}}),t.jsx("div",{className:$.ifStatement,children:t.jsx("img",{src:ze,alt:"condition",onClick:c=>r(c),className:$.conditionIcon})}),t.jsx("button",{type:"button",className:$.menuButton,onClick:u,"aria-label":"Open menu","aria-haspopup":"menu",children:t.jsx(q,{className:$.menuIcon})}),t.jsx(z,{ref:o,model:d,popup:!0,onHide:()=>a(o)}),t.jsx("img",{src:De,alt:"ifdot",className:$.ifdotIcon})]})},Ke=34.5,h1=({items:e,pathId:n,onAddStep:s,onAddTrigger:o,onAddCondition:i,onAddLoop:a,onDeleteStep:d,onUpdateFilter:u,onSelectStep:r,onResize:c})=>{const x=l.useRef(null),I=l.useRef([]),[_,g]=l.useState([]);l.useEffect(()=>{const p=()=>{if(!x.current||e.length===0){g([]);return}const j=x.current.getBoundingClientRect(),w=[];for(let v=0;v<e.length;v++){const h=I.current[v];if(h){const y=h.getBoundingClientRect();w.push(y.top-j.top+Ke)}}w.length===e.length&&g(w)};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[e]);const m=l.useMemo(()=>_.length!==e.length||e.length<=1?null:e.map((p,j)=>j).filter(p=>p>0).map(p=>{const j=_[p];return j===void 0?null:t.jsx(ke,{width:100,height:j},p)}),[e,_]);return t.jsxs("div",{className:W.row,children:[t.jsx(Ge,{onDelete:()=>n!=null&&d?.(n),onSelect:n!=null&&r?()=>r(n):void 0}),t.jsxs("div",{ref:x,className:W.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100px",height:"2px",borderTop:"2px solid #3B64A0"}}),m]}),t.jsx("div",{className:W.column,children:e.map((p,j)=>{let w;if(p.paths)w=t.jsx(h1,{items:p.paths,pathId:n,onAddStep:s,onAddTrigger:o,onAddCondition:i,onAddLoop:a,onDeleteStep:d,onUpdateFilter:u,onSelectStep:r,onResize:c},p.localId);else if(p.steps){const v=p;w=t.jsxs("div",{className:W.stepsContainer,children:[t.jsx(We,{expression:v.condition,style:{marginTop:"25px"}}),t.jsx(e1,{steps:p.steps,pathId:p.localId,onSelectStep:r??(()=>{}),onAddStep:s??(()=>{}),onAddTrigger:o,onAddCondition:i??(()=>{}),onAddLoop:a,onDeleteStep:d,onUpdateFilter:u,onResize:c},p.localId)]})}else w=t.jsx(X,{localId:p.localId,title:"title"in p?p.title:"",idx:1,icon:"icon"in p?p.icon:void 0,onSelectStep:r,onDeleteStep:d,onUpdateFilter:u},p.localId);return t.jsx("div",{ref:v=>{I.current[j]=v},style:{width:"100%"},children:w},p.localId)})}),t.jsxs("div",{className:W.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:.5,left:0,flex:1,width:"100%",height:"2px",borderTop:"2px solid #3B64A0"}}),m]}),t.jsx(H,{onAddStep:s,onAddTrigger:o,onAddCondition:i,onAddLoop:a,stepId:n,pathId:n,index:1,style:{marginTop:"34px",height:0}}),t.jsx("div",{style:{flex:1,width:"100%",height:"2px",borderTop:"2px solid #3B64A0",marginTop:"34px"}})]})},Q=68,e1=({pathId:e,steps:n,centerY:s,className:o,onAddStep:i,onDeleteStep:a,onUpdateFilter:d,onAddTrigger:u,onAddCondition:r,onAddLoop:c,onSelectStep:x,onResize:I,isDescendent:_=!0})=>{const g=s===void 0?void 0:{marginTop:Math.max(0,s-Q/2)};return n.length===0?t.jsxs("div",{style:{width:"100%",marginTop:"20px",display:"flex",flexDirection:"row",flex:1,minWidth:0,...g},children:[t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:"2px solid #3B64A0"}}),t.jsx(H,{onAddStep:()=>{i?.(void 0,e)},onAddTrigger:u,onAddCondition:r,onAddLoop:c,stepId:e,index:0,style:{height:"auto"}}),t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:"2px solid #3B64A0"}})]}):t.jsx("div",{className:J.steps+(o?" "+o:""),style:g,children:t.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:1,minWidth:0,width:"100%",alignItems:"flex-start"},children:[t.jsx(H,{onAddStep:()=>{i?.(n[0].localId,e,"prepend")},onAddTrigger:u,onAddCondition:r,onAddLoop:c,stepId:n[0].localId,pathId:e,index:0,style:{marginTop:"20px"}}),n.map((m,p)=>{const j=!!m.paths,w="condition"in m&&typeof m.condition=="string";let v;return j&&m.paths?v=t.jsx(h1,{items:m.paths,pathId:m.localId,onAddStep:i,onAddCondition:r,onAddLoop:c,onDeleteStep:a,onAddTrigger:u,onSelectStep:x,onUpdateFilter:d,onResize:I},m.title):w?v=t.jsxs(t.Fragment,{children:[t.jsx(C1,{value:m,onAddStep:i,onAddTrigger:u,onAddCondition:r,onAddLoop:c,onDeleteStep:a,onUpdateFilter:d,onSelectStep:x,onResize:I},m.localId),t.jsx(H,{onAddStep:i,onAddTrigger:u,onAddCondition:r,onAddLoop:c,stepId:m.localId,pathId:e,index:p+1,style:{marginTop:"34px",height:0}})]}):v=t.jsxs(t.Fragment,{children:[t.jsx(X,{localId:m.localId,title:m.title,idx:1,icon:m.icon,isSet:m.isSet,isInvalid:m.isInvalid,isFilter:m.isFilter,onSelectStep:x,onDeleteStep:a,onUpdateFilter:d},m.title),t.jsx(H,{onAddStep:i,onAddTrigger:u,onAddCondition:r,onAddLoop:c,stepId:m.localId,pathId:e,index:p+1})]}),t.jsx("div",{className:J.stepContainer+(j||w?" "+J.stepContainerWithPaths:""),children:v},m.localId)}),_&&t.jsx("div",{style:{flexGrow:1,minWidth:0,borderTop:"2px solid #3B64A0",marginTop:"33.5px"}})]})})},Je=()=>t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M17.3006 10.5H23.1986C23.2699 10.5001 23.3397 10.5204 23.3998 10.5586C23.4599 10.5969 23.5079 10.6515 23.5381 10.716C23.5683 10.7805 23.5795 10.8523 23.5704 10.923C23.5613 10.9937 23.5322 11.0603 23.4866 11.115L20.5376 14.655C20.5024 14.6972 20.4584 14.7312 20.4086 14.7545C20.3589 14.7778 20.3046 14.7899 20.2496 14.7899C20.1947 14.7899 20.1404 14.7778 20.0906 14.7545C20.0409 14.7312 19.9968 14.6972 19.9616 14.655L17.0126 11.115C16.967 11.0603 16.938 10.9937 16.9289 10.923C16.9197 10.8523 16.931 10.7805 16.9612 10.716C16.9914 10.6515 17.0394 10.5969 17.0995 10.5586C17.1596 10.5204 17.2294 10.5001 17.3006 10.5ZM0.800641 13.5H6.69864C6.7699 13.5 6.83967 13.4797 6.89979 13.4414C6.95991 13.4032 7.00789 13.3486 7.03811 13.2841C7.06833 13.2195 7.07953 13.1477 7.07042 13.0771C7.06131 13.0064 7.03224 12.9398 6.98664 12.885L4.03764 9.34504C4.00245 9.30283 3.95841 9.26888 3.90864 9.24558C3.85887 9.22228 3.80459 9.21021 3.74964 9.21021C3.69469 9.21021 3.64041 9.22228 3.59064 9.24558C3.54087 9.26888 3.49683 9.30283 3.46164 9.34504L0.512641 12.885C0.467037 12.9398 0.437977 13.0064 0.428862 13.0771C0.419747 13.1477 0.430956 13.2195 0.461175 13.2841C0.491394 13.3486 0.539372 13.4032 0.599493 13.4414C0.659613 13.4797 0.729386 13.5 0.800641 13.5Z",fill:"#41B0AC"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.9995 4.50011C9.67152 4.50011 7.58952 5.5606 6.21402 7.2271C6.1526 7.30671 6.0758 7.37316 5.98819 7.42249C5.90057 7.47183 5.80393 7.50304 5.70401 7.51427C5.60409 7.52551 5.50293 7.51653 5.40655 7.48789C5.31016 7.45924 5.22052 7.41151 5.14296 7.34753C5.06539 7.28354 5.00149 7.20462 4.95504 7.11544C4.90859 7.02626 4.88054 6.92865 4.87257 6.82842C4.8646 6.72819 4.87687 6.62737 4.90864 6.53198C4.94041 6.43658 4.99104 6.34854 5.05752 6.27311C6.15581 4.9434 7.61291 3.95712 9.25552 3.43159C10.8981 2.90606 12.6571 2.86338 14.3233 3.30864C15.9895 3.7539 17.4927 4.66835 18.6541 5.94324C19.8156 7.21812 20.5865 8.79978 20.875 10.5001L19.3495 10.5001C19.0032 8.80632 18.0826 7.28409 16.7433 6.19082C15.4041 5.09755 13.7284 4.50032 11.9995 4.50011ZM4.64952 13.5001C4.93349 14.887 5.60405 16.1653 6.58374 17.1873C7.56343 18.2093 8.81226 18.9332 10.186 19.2755C11.5597 19.6178 13.0022 19.5645 14.3469 19.1217C15.6915 18.6789 16.8835 17.8646 17.785 16.7731C17.8464 16.6935 17.9232 16.627 18.0109 16.5777C18.0985 16.5284 18.1951 16.4972 18.295 16.4859C18.395 16.4747 18.4961 16.4837 18.5925 16.5123C18.6889 16.541 18.7785 16.5887 18.8561 16.6527C18.9337 16.7167 18.9976 16.7956 19.044 16.8848C19.0905 16.974 19.1185 17.0716 19.1265 17.1718C19.1344 17.272 19.1222 17.3728 19.0904 17.4682C19.0586 17.5636 19.008 17.6517 18.9415 17.7271C17.8432 19.0568 16.3861 20.0431 14.7435 20.5686C13.1009 21.0942 11.3419 21.1368 9.67576 20.6916C8.0096 20.2463 6.50638 19.3319 5.34491 18.057C4.18343 16.7821 3.41258 15.2004 3.12402 13.5001H4.64952Z",fill:"#41B0AC"})]}),Qe="_container_3aqee_1",Ue="_collapsed_3aqee_16",et="_loopNodeWrapper_3aqee_20",tt="_loopIconWrapper_3aqee_30",nt="_loopBox_3aqee_39",st="_dotsButton_3aqee_56",ot="_label_3aqee_76",it="_limit_3aqee_83",rt="_expandable_3aqee_89",lt="_expandableCollapsed_3aqee_98",ct="_connector_3aqee_104",at="_line_3aqee_112",dt="_circleDot_3aqee_120",ut="_innerDot_3aqee_135",pt="_stepsWrapper_3aqee_142",k={container:Qe,collapsed:Ue,loopNodeWrapper:et,loopIconWrapper:tt,loopBox:nt,dotsButton:st,label:ot,limit:it,expandable:rt,expandableCollapsed:lt,connector:ct,line:at,circleDot:dt,innerDot:ut,stepsWrapper:pt},C1=({value:e,onAddStep:n,onAddTrigger:s,onAddCondition:o,onAddLoop:i,onDeleteStep:a,onUpdateFilter:d,onSelectStep:u,onResize:r})=>{const{localId:c,limit:x,steps:I}=e,_=I??[],g=()=>{},[m,p]=l.useState(!1),j=l.useRef(null),{openMenu:w,closeMenu:v}=Y(),h=U(),y=l.useMemo(()=>[{label:"Remove",icon:t.jsx(A,{color:"#3B64A0",size:18}),command:N=>{N?.originalEvent?.stopPropagation(),a&&a(c)},template:h}],[a,c,h]),P=N=>{N.stopPropagation(),w(j,N)},C=()=>{p(N=>!N),r?.()},f=k.container+(m?"":" "+k.collapsed),M=k.expandable+(m?"":" "+k.expandableCollapsed);return t.jsxs("div",{className:f,children:[t.jsxs("div",{className:k.loopNodeWrapper,children:[t.jsxs("div",{className:k.loopBox,children:[t.jsx("div",{onClick:C,className:k.loopIconWrapper,children:t.jsx(Je,{})}),t.jsx("button",{className:k.dotsButton,onClick:P,children:t.jsx(q,{size:16})}),t.jsx(z,{model:y,popup:!0,ref:j,onHide:()=>v(j)})]}),t.jsx("div",{className:k.label,children:"Loop"}),x!=null&&t.jsxs("div",{className:k.limit,children:[x,"x"]})]}),t.jsxs("div",{className:M,children:[t.jsxs("div",{className:k.connector,children:[t.jsx("div",{className:k.line,style:{width:"12px"}}),t.jsx("div",{className:k.circleDot,children:t.jsx("div",{className:k.innerDot})}),t.jsx("div",{className:k.line})]}),t.jsx("div",{className:k.stepsWrapper,children:t.jsx(e1,{steps:_,pathId:c,onAddStep:n??g,onAddTrigger:s,onAddCondition:o??g,onAddLoop:i,onDeleteStep:a,onUpdateFilter:d??g,onSelectStep:u??g,isDescendent:!0})})]})]})},ht="_container_kielx_1",Ct={container:ht},mt=({process:e,addMultipleTriggers:n,onAddStep:s,onAddTrigger:o,onAddCondition:i,onAddLoop:a,onResize:d,onDeleteTrigger:u,onDeleteStep:r,onUpdateFilter:c,onSelectStep:x})=>{const[I,_]=l.useState(0);return t.jsxs("div",{className:Ct.container,children:[t.jsx(p1,{steps:e.triggers,onAddTrigger:n,onUpdateFilter:c,onDeleteTrigger:u,onSelectStep:x,onCenterYUpdate:_}),e.steps.length>0?t.jsx(e1,{steps:e.steps,centerY:I,onAddStep:s,onAddTrigger:o,onAddCondition:i,onAddLoop:a,onResize:d,onDeleteStep:r,onUpdateFilter:c,onSelectStep:x,isDescendent:!1,pathId:void 0}):t.jsx(H,{onAddStep:()=>s(),onAddTrigger:o,onAddCondition:i,onAddLoop:a,index:0,style:{height:Q,marginTop:Math.max(0,I-Q/2)}})]})};class m1 extends Error{constructor(n){super(n),this.name="AddStepError"}}const c1=e=>"condition"in e&&typeof e.condition=="string",x1=(e,n,s,o)=>{const i=o==="prepend"?n:n+1;return[...e.slice(0,i),s,...e.slice(i)]},t1=(e,n,s,o)=>{for(let i=0;i<e.length;i++){if(e[i].localId===n)return x1(e,i,o,s);const a=e[i],d=a.steps?.length&&t1(a.steps,n,s,o);if(d)return e.map((r,c)=>c===i?{...r,steps:d}:r);const u=a.paths?.length&&f1(a.paths,n,s,o);if(u)return e.map((r,c)=>c===i?{...r,paths:u}:r)}return null},xt=(e,n,s)=>{const o=e.steps??[],i=n==="prepend"?[s,...o]:[...o,s];return{...e,steps:i}},f1=(e,n,s,o)=>{for(let i=0;i<e.length;i++){const a=e[i];if(a.localId===n)return c1(a)?e.map((d,u)=>u===i?xt(a,s,o):d):x1(e,i,o,s);if(c1(a)){const d=a.steps?.length&&t1(a.steps,n,s,o);if(d)return e.map((r,c)=>c===i?{...r,steps:d}:r);const u=a.paths?.length&&f1(a.paths,n,s,o);if(u)return e.map((r,c)=>c===i?{...r,paths:u}:r)}}return null},ft=(e,n,s,o)=>{const i=t1(e.steps,n,s,o);if(i)return{...e,steps:i};throw new m1(`Step or path with id "${n}" not found`)},g1=(e,n)=>({...e,...e.steps!=null&&{steps:n1(e.steps,n)},...e.paths!=null&&{paths:e.paths.map(s=>g1(s,n))}}),n1=(e,n)=>e.filter(s=>s.localId!==n).map(s=>({...s,...s.steps!=null&&{steps:n1(s.steps,n)},...s.paths!=null&&{paths:s.paths.map(o=>g1(o,n))}})),gt=(e,n)=>{const s=n1(e.steps,n);return{...e,steps:s}};exports.AddStepError=m1;exports.Iterator=C1;exports.Menu=z;exports.MenuProvider=J1;exports.ProcessDiagram=mt;exports.ProcessStep=X;exports.Trigger=p1;exports.addStep=ft;exports.deleteStep=gt;exports.useMenuProvider=Y;
2
2
  //# sourceMappingURL=index.cjs.map