app-v3-scripts-editor 1.37.4 → 1.37.5

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.
@@ -768,7 +768,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
768
768
  background-color: #f6f9ff !important;
769
769
  border-radius: 10px;
770
770
  padding: 8px;
771
- `,dpt=({hasInitialFilter:e=!1})=>{const{emit:t}=eb(),{data:n,isLoading:r}=Cx(),o=R.useFormInstance(),i=R.useWatch("type",o),a=R.useWatch(["settings","user"],o)||[],s=R.useWatch(["settings","strategy"],o),l=R.useWatch("groups",o),c=A.useMemo(()=>(l==null?void 0:l.some(h=>{var p;return(p=h==null?void 0:h.conditions)==null?void 0:p.some(g=>!nt.isEmpty(g))}))??!1,[l]),[u,d]=A.useState(e||c);return A.useEffect(()=>{(e||c)&&d(!0)},[c,e]),f.jsxs(f.Fragment,{children:[f.jsx(ge.Paragraph,{strong:!0,children:"Chọn liên hệ"}),f.jsxs(Nn,{children:[f.jsx(at,{span:22,children:f.jsx(R.Item,{label:null,name:"id",children:f.jsx(Jy,{placeholder:"Chọn nguồn dữ liệu liên hệ",disabledModes:i===kle.ASSIGN_ONE?[qr[0]]:[qr[1]],nodeFilter:h=>h.node_type===be.ACTION_CONTACT||h.node_type===be.CONTACT_ASSIGN||h.node_type===be.TRIGGER_CONTACT})})}),f.jsx(at,{span:2,className:wht,children:f.jsx(EY,{style:{cursor:"pointer"},size:"24",color:"#1890FF",variant:u?"Bold":"Linear",onClick:()=>d(h=>!h)})})]}),f.jsx(h8,{initial:!1,children:u?f.jsx(Py.div,{initial:{opacity:0,height:0,y:-8},animate:{opacity:1,height:"auto",y:0},exit:{opacity:0,height:0,y:-8},transition:{duration:.18,ease:"easeOut"},style:{overflow:"hidden"},children:f.jsx(ha,{model:"contact"})}):null}),f.jsx(ge.Paragraph,{strong:!0,children:"Cơ chế phân công nhân viên"}),f.jsx(R.Item,{label:null,name:["settings","strategy"],initialValue:lv.SEQUENCE,children:f.jsx(In,{options:apt.map(h=>({label:w7[h],value:h}))})}),f.jsx(R.Item,{label:null,name:["settings","user"],children:f.jsx(cpt,{mode:"multiple",placeholder:"Chọn nhân viên"})}),a.length>0&&f.jsxs(ou,{spinning:r,children:[f.jsxs(Ke,{align:"center",justify:"space-between",children:[f.jsx(ge.Paragraph,{strong:!0,children:"Nhân viên được phân công"}),s===lv.WEIGHTED&&f.jsx(ge.Paragraph,{strong:!0,children:"Hệ số"})]}),f.jsx(R.Item,{noStyle:!0,shouldUpdate:(h,p)=>{var g,y,v,b;return((g=h.settings)==null?void 0:g.user)!==((y=p.settings)==null?void 0:y.user)||((v=h.settings)==null?void 0:v.strategy)!==((b=p.settings)==null?void 0:b.strategy)},children:({getFieldValue:h,setFieldValue:p})=>{const g=h(["settings","assignees"])||[],y=a.map(v=>{const b=g.find(C=>C.profile_company_id===v);return b??{profile_company_id:v,weight:s===lv.WEIGHTED?(b==null?void 0:b.weight)??1:void 0}});return p(["settings","assignees"],y),f.jsx(R.List,{name:["settings","assignees"],children:v=>f.jsx(f.Fragment,{children:v.map(b=>{var x;const C=h(["settings","assignees",b.name,"profile_company_id"]),S=s===lv.SEQUENCE,E=(x=n==null?void 0:n.data)==null?void 0:x.find(I=>I.id===C);return f.jsxs(Nn,{gutter:12,children:[f.jsx(R.Item,{name:[b.name,"profile_company_id"],hidden:!0}),f.jsx(at,{span:S?24:18,children:f.jsx("div",{className:Aht,children:f.jsx(Yy,{label:(E==null?void 0:E.full_name)??(E==null?void 0:E.email),avatar:E==null?void 0:E.avatar})})}),f.jsx(at,{span:S?0:6,children:f.jsx(R.Item,{style:{marginBottom:0},name:[b.name,"weight"],initialValue:1,rules:[{required:!0,message:"Vui lòng nhập hệ số"}],children:f.jsx(ci,{style:{width:"100%"},min:1})})})]},b.key)})})})}})]}),f.jsxs(upt,{children:[f.jsx(ge.Paragraph,{strong:!0,children:"Điều kiện nhân viên không được chia lead"}),f.jsx(R.Item,{label:null,name:["settings","constraints","within_working_hours"],valuePropName:"checked",children:f.jsx(Fr,{children:"Chỉ chia trong giờ làm việc"})}),f.jsxs(Ke,{align:"center",justify:"space-between",style:{marginBottom:12},children:[f.jsx(R.Item,{label:null,noStyle:!0,name:["settings","constraints","exclude_off_shift"],valuePropName:"checked",children:f.jsx(Fr,{children:"Chỉ chia cho nhân viên có ca làm việc"})}),f.jsx(yt,{icon:f.jsx(q2,{}),iconPosition:"end",type:"link",style:{padding:"unset"},onClick:()=>t("openWorkShiftSettingPage",{}),children:"Ca làm việc"})]}),f.jsx(R.Item,{label:null,name:["settings","constraints","reassign_if_has_owner"],valuePropName:"checked",children:f.jsx(Fr,{children:"Chia cả khi liên hệ đã có nhân viên phụ trách"})}),f.jsxs(Ke,{align:"center",gap:4,style:{marginBottom:12},children:[f.jsx(R.Item,{noStyle:!0,label:null,name:["settings","constraints","exclude_compensation_for_unassigned"],valuePropName:"checked",children:f.jsx(zi,{size:"small"})}),f.jsx(ge.Text,{children:"Chia bù cho nhân viên không được chia lead"})]})]})]})},fpt=({id:e})=>{var y,v;const{getNode:t}=bn(),n=Cr(),{data:r}=t(e),o=r,[i]=R.useForm(),[a,s]=A.useState("1"),l=R.useWatch("type",i);vo({form:i,type:l,getResetValues:()=>em[be.CONTACT_ASSIGN]});const c=((y=o==null?void 0:o.groups)==null?void 0:y.some(b=>{var C;return(C=b==null?void 0:b.conditions)==null?void 0:C.some(S=>!nt.isEmpty(S))}))??!1,{data:u}=Zo({type:be.CONTACT_ASSIGN,action:l??""});A.useEffect(()=>{var b,C;n(e,{output:((C=(b=u==null?void 0:u.data)==null?void 0:b.outputs)==null?void 0:C.map(S=>{var E;return{...S,object:e,node_type:be.CONTACT_ASSIGN,order:o==null?void 0:o.order,output_mode:((E=u==null?void 0:u.data)==null?void 0:E.output_mode)??[]}}))||[]})},[u==null?void 0:u.data,o==null?void 0:o.order,e,n]),A.useEffect(()=>{l&&s("2")},[l]);const d=A.useRef(!0);A.useEffect(()=>{var b,C,S,E,x;if(d.current){const I=nt.cloneDeep(o),N=Cs(I==null?void 0:I.object,(I==null?void 0:I.groups)??[],(I==null?void 0:I.filter_type)??"AND");i.setFieldsValue({...I,...N,settings:{...I==null?void 0:I.settings,user:((C=(b=I==null?void 0:I.settings)==null?void 0:b.assignees)==null?void 0:C.map(O=>O.profile_company_id))||[],constraints:{...(S=I==null?void 0:I.settings)==null?void 0:S.constraints,exclude_compensation_for_unassigned:!((x=(E=I==null?void 0:I.settings)==null?void 0:E.constraints)!=null&&x.exclude_compensation_for_unassigned)}}}),d.current=!1}},[o,i]);const h=b=>{var E;const C=Vl(zl(b)),S=Js(((b==null?void 0:b.groups)??[]).map(x=>{var I;return{...x,conditions:(I=x==null?void 0:x.conditions)==null?void 0:I.filter(N=>!nt.isEmpty(N))}}));"user"in b.settings&&delete b.settings.user,b.settings.strategy===lv.SEQUENCE&&(b.settings.assignees=(E=b.settings.assignees)==null?void 0:E.map(x=>({...x,weight:void 0}))),b.settings.constraints.exclude_compensation_for_unassigned=!b.settings.constraints.exclude_compensation_for_unassigned,n(e,{...b,groups:S,variables:C})},p=A.useMemo(()=>nt.debounce(()=>{i.submit()},500),[i]);A.useEffect(()=>()=>{p.cancel()},[p]);const g=[{key:"1",label:"Hành động",children:f.jsx(spt,{})},{key:"2",label:"Cài đặt",children:f.jsx(dpt,{hasInitialFilter:c})},{key:"3",label:"Đầu ra",children:f.jsx(lpt,{outputs:(v=u==null?void 0:u.data)==null?void 0:v.outputs,id:e})}];return f.jsx("div",{className:h7,children:f.jsxs(R,{form:i,layout:"vertical",initialValues:{...o},onFinish:h,onValuesChange:p,children:[f.jsx(R.Item,{hidden:!0,name:["title"]}),f.jsx(Ir,{activeKey:a,onChange:s,items:g})]})})},hpt=({id:e,data:t,mini:n})=>{var l;const{mode:r}=Xt(),{displayComponent:o}=Rn(),i=t.title||"Liên hệ",a=A.useRef(Object.fromEntries(Mle.map(({suffix:c})=>[c,`${e}_${c}`]))),s=c=>{const u=c.target;u!=null&&u.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(c.stopPropagation(),c.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(fpt,{id:e}),i,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx("div",{className:c7,onClick:s,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&s(c)},children:f.jsxs("div",{className:`${u7}`,children:[f.jsxs(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",justify:"flex-start",style:{width:"100%"},gap:12,children:[f.jsx("div",{className:d7,children:f.jsx(Ad,{className:f7})}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:i})]}),f.jsx(Po,{id:e,data:t})]}),f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:16,children:S7[t.type]}),f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Quy tắc"})}),f.jsx(at,{span:16,children:w7[(l=t==null?void 0:t.settings)==null?void 0:l.strategy]}),f.jsx(at,{span:24,children:f.jsx(Ke,{vertical:!0,gap:8,align:"flex-end",style:{width:"100%"},children:f.jsx(Ke,{className:Eht,children:Mle.map(c=>f.jsxs("div",{className:Sht,children:[f.jsx(ge.Text,{children:c.label}),f.jsx(mn,{id:a.current[c.suffix],type:"source",position:Mt.Right,style:{right:-14,top:"50%"}})]},c.suffix))})})})]})]})})},ppt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(hpt,{id:t,data:e})]}),gpt=({id:e,outputs:t})=>{const n=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t).map(r=>({...r,icon:()=>{var i;const o=so[((i=r.meta)==null?void 0:i.iconType)??""]??null;return o?f.jsx(o,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:n})},xx=({dataDefault:e,modal:t,propertyType:n,...r})=>{const[o,i]=A.useState([]),{data:a,isLoading:s}=E7({currentFilters:{app_model:t,raw:!0}});A.useEffect(()=>{let c=[...e?nt.isArray(e)?e:[e]:[],...(a==null?void 0:a.data)||[]];const u=n?new Set(n):null;u&&(c=nt.filter(c,({variant_config:h})=>u.has(h)));const d=nt.uniqBy(c,"id");i(d)},[a==null?void 0:a.data,e,n]);const l=A.useMemo(()=>o.map(c=>({value:c.id,label:c.name,key:c.id,data:c})),[o]);return f.jsx(In,{options:l,allowClear:!0,filterOption:!1,loading:s,placeholder:"Chọn thuộc tính",style:{width:"100%"},...r})};var Hl=(e=>(e.CREATED="created",e.UPDATED="updated",e.UPDATED_BY_CONDITION="updated_by_condition",e.DELETED="deleted",e.TIME="TIME",e))(Hl||{}),cv=(e=>(e.SAME_DAY="SAME_DAY",e.BEFORE="BEFORE",e.AFTER="AFTER",e))(cv||{}),kc=(e=>(e.AT_EVENT="AT_EVENT",e.BEFORE_EVENT="BEFORE_EVENT",e.AFTER_EVENT="AFTER_EVENT",e.FIXED_TIME="FIXED_TIME",e))(kc||{});const Ix={created:"Liên hệ mới được tạo",updated_by_condition:"Liên hệ được cập nhật",updated:"Liên hệ cập nhật thoả mãn điều kiện",deleted:"Liên hệ bị xóa",TIME:"Tại thời điểm của 1 trường dữ liệu"},_le={created:"Khi có liên hệ mới được tạo",updated_by_condition:"Khi cập nhật một số trường dữ liệu của liên hệ",updated:"Khi Liên hệ được cập nhật thoả mãn điều kiện",deleted:"Khi có liên hệ bị xóa",TIME:"Kích hoạt theo thời gian đã định"},$le=nt.keys(Ix),x7={SAME_DAY:"Ngày diễn ra sự kiện",BEFORE:"Trước ngày diễn ra sự kiện",AFTER:"Sau ngày diễn ra sự kiện"},mpt=nt.keys(x7),Ple={AT_EVENT:"Thời gian sự kiện",BEFORE_EVENT:"Trước sự kiện",AFTER_EVENT:"Sau sự kiện",FIXED_TIME:"Thời gian cố định"},vpt=nt.keys(Ple),ypt=[...Cc,...xd,...Id,...wd,...hu].reduce((e,t)=>(e[t.value]=t.label,e),{}),Nx=e=>{if(e!=null){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(e&&typeof e=="object"&&"title"in e)return e.title;if(e&&typeof e=="object"&&"label"in e)return e.label;if(e&&typeof e=="object"&&"name"in e)return e.name}},bpt=e=>[Bn.singleoption,Bn.multioption,Bn.optiongroup,$n.singleoptionproperty,$n.multioptionproperty].includes(e),Cpt=(e,t)=>{var i;const r=(((i=t==null?void 0:t.settings)==null?void 0:i.options)??[]).reduce((a,s)=>{const l=s.id??s.value;return l&&(a[String(l)]=Nx(s)??s.value??s.id),a},{}),o=a=>{const s=Nx(a),l=typeof a=="object"&&a!==null&&"value"in a?a.value:a;return typeof s=="string"&&s!==l?s:typeof l=="string"||typeof l=="number"||typeof l=="boolean"?r[String(l)]??s:s};return Array.isArray(e)?e.map(o).filter(Boolean).join(", "):o(e)},Apt=(e,t)=>{const n=(t==null?void 0:t.variant)||(t==null?void 0:t.variant_config);if(bpt(n))return Cpt(e,t);if(e!=null)return typeof e=="string"?e:Array.isArray(e)?e.map(r=>Nx(r)).filter(Boolean).join(", "):Nx(e)},Ept=e=>[$n.dateproperty,Bn.date,Bn.datetime].includes(e)?xd:[$n.integerproperty,$n.floatproperty,Bn.integer,Bn.float,Bn.percentage,Bn.duration].includes(e)?wd:[$n.fileproperty,Bn.file].includes(e)?Id:Cc,Dle=e=>(e??"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),I7=e=>{if(typeof e=="string")return e;if(e&&typeof e=="object"&&"value"in e)return e.value;if(e&&typeof e=="object"&&"id"in e)return e.id},Lle=e=>(e==null?void 0:e.flatMap(t=>t.conditions??[]))??[],Spt=(e=[])=>e.reduce((t,n)=>{var o;const r=I7(n.property);return r&&(t[r]={operator:n.operator,value:n.value,titleValue:(o=n.title)==null?void 0:o.value}),t},{}),Ble=e=>Spt(Lle(e)),Fle=e=>Lle(e).map(t=>I7(t.property)).filter(Boolean),jle=(e,t="contact")=>{const n=Array.isArray(e)?e:[],r=n.flatMap(i=>Array.isArray(i.conditions)?i.conditions.filter(a=>!nt.isEmpty(a)):[]),o=n[0];return[{object:(o==null?void 0:o.object)??t,filter_type:(o==null?void 0:o.filter_type)??"OR",conditions:r}]},wpt=e=>e==null||e===""?!1:Array.isArray(e)?e.length>0:!0,xpt=(e,t,n,r,o="contact")=>{const i=new Set(n),a=t.map(s=>{const l=e.find(y=>y.id===s),c=r[s],u=(l==null?void 0:l.variant)||(l==null?void 0:l.variant_config),d=i.has(s),h=c==null?void 0:c.operator,p=d&&h&&(zle(h)||wpt(c==null?void 0:c.value)),g=p?h:"VALUABLE";return l?{property:l.id,slug:l.slug,type:u,operator:g,title:{label:l.name,operator:ypt[g]??g,value:p?Apt((c==null?void 0:c.titleValue)??(c==null?void 0:c.value),l):void 0},...p?{value:c==null?void 0:c.value}:{}}:null}).filter(Boolean);return[{object:o,filter_type:"OR",conditions:a}]},zle=e=>e==="VALUABLE"||e==="EMPTY",Ipt={changeFieldIds:"change_field_ids",conditionValues:"condition_values",groups:"groups",condition:"condition"},Vle=e=>{if(!(!e||typeof e!="object")){if("title"in e&&typeof e.title=="string")return e.title;if("rawLabel"in e&&typeof e.rawLabel=="string")return e.rawLabel;if("label"in e&&typeof e.label=="string")return e.label}},Npt=e=>{if(Array.isArray(e)){const n=e.map(Vle).filter(Boolean);return n.length?n:void 0}const t=Vle(e);if(t)return t},Hle=({model:e,object:t=e,title:n,searchPlaceholder:r="Tìm kiếm thuộc tính",emptyText:o="Không tìm thấy thuộc tính",conditionText:i="sau khi cập nhật",addConditionText:a="Thêm điều kiện",removeConditionText:s="Xóa điều kiện",fieldNames:l})=>{const c=R.useFormInstance(),u={...Ipt,...l},[d,h]=A.useState(""),[p,g]=A.useState(()=>{var T;const N=c.getFieldValue(u.groups);return(N!=null&&N.length?N.flatMap(M=>M.conditions??[]):((T=c.getFieldValue(u.condition))==null?void 0:T.conditions)??[]).map(M=>I7(M.property)).filter(Boolean)}),{data:y,isLoading:v}=E7({currentFilters:{app_model:e,raw:!0}}),b=A.useMemo(()=>nt.orderBy(((y==null?void 0:y.data)??[]).filter(N=>!N.is_auto),["order_default"],["asc"]),[y==null?void 0:y.data]),C=A.useMemo(()=>{const N=Dle(d.trim());return N?b.filter(O=>Dle(O.name).includes(N)):b},[b,d]),S=R.useWatch(u.changeFieldIds,c)??[],E=R.useWatch(u.conditionValues,c)??{};A.useEffect(()=>{v||(c.setFieldValue(u.groups,xpt(b,S,p,E,t)),c.submit())},[p,E,c,v,t,b,u.groups,S]);const x=N=>{const O=c.getFieldValue(u.conditionValues)??{};c.setFieldValue(u.conditionValues,{...O,[N]:void 0}),g(T=>T.filter(M=>M!==N))},I=N=>{var T,M,_;const O=c.getFieldValue(u.conditionValues)??{};c.setFieldValue(u.conditionValues,{...O,[N]:{operator:((T=O[N])==null?void 0:T.operator)||"EQUAL",value:(M=O[N])==null?void 0:M.value,titleValue:(_=O[N])==null?void 0:_.titleValue}}),g(L=>L.includes(N)?L:[...L,N])};return f.jsxs(Ke,{vertical:!0,gap:16,children:[f.jsx(Ke,{align:"center",justify:"space-between",children:f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:n})}),f.jsx(Nt.Search,{allowClear:!0,placeholder:r,value:d,onChange:N=>h(N.target.value),onSearch:h}),f.jsx(ou,{spinning:v,children:f.jsx(R.Item,{name:u.changeFieldIds,initialValue:[],noStyle:!0,children:f.jsx(Fr.Group,{style:{width:"100%"},children:f.jsxs(Ke,{vertical:!0,gap:14,style:{width:"100%"},children:[C.length===0&&!v?f.jsx(ge.Text,{type:"secondary",children:o}):null,C.map(N=>{var B;const O=N.id??"",T=S.includes(O),M=p.includes(O),_=N.variant||N.variant_config,L=Ept(_),P=((B=E[O])==null?void 0:B.operator)||"EQUAL",$=zle(P);return f.jsxs(Ke,{vertical:!0,gap:8,children:[f.jsxs(Ke,{align:"center",justify:"space-between",gap:8,children:[f.jsxs(Ke,{align:"center",gap:8,children:[f.jsx(Fr,{value:O,disabled:v,children:N.name}),T&&M&&f.jsx(ge.Text,{type:"secondary",children:i})]}),T&&!M&&f.jsx(yt,{type:"link",icon:f.jsx(si,{}),onClick:()=>I(O),children:a})]}),T&&M&&f.jsxs(Ke,{align:"baseline",gap:8,style:{paddingLeft:26},children:[f.jsx(R.Item,{name:[u.conditionValues,O,"operator"],initialValue:"EQUAL",children:f.jsx(In,{options:L,onChange:()=>{c.setFieldValue([u.conditionValues,O,"value"],void 0),c.setFieldValue([u.conditionValues,O,"titleValue"],void 0)}})}),f.jsx("div",{style:{flex:1},children:$?f.jsx(R.Item,{name:[u.conditionValues,O,"value"],children:f.jsx(In,{disabled:!0,placeholder:"Chọn giá trị",options:[]})}):f.jsx(yle,{property:N,name:[u.conditionValues,O,"value"],operator:P,onValueChange:(D,F)=>{c.setFieldValue([u.conditionValues,O,"titleValue"],Npt(F))}})}),f.jsx(yt,{type:"text","aria-label":s,title:s,icon:f.jsx(ds,{}),onClick:()=>x(O)})]})]},O)})]})})})})]})},Opt=()=>f.jsx(Hle,{model:"contact",object:"contact",title:"Liên hệ được cập nhật một trong các trường:"}),Tpt=()=>f.jsx(R.Item,{shouldUpdate:(e,t)=>e.type!==t.type,noStyle:!0,children:({getFieldValue:e})=>{const t=e("type");if(t===Hl.TIME)return f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Trường dữ liệu thời gian"}),name:"time_field",getValueProps:r=>({value:r==null?void 0:r.id,dataDefault:r}),getValueFromEvent:(r,o)=>{var i;return(i=Array.isArray(o)?o[0]:o)==null?void 0:i.data},children:f.jsx(xx,{modal:"contact",propertyType:[Bn.date,Bn.datetime]})}),f.jsx(ge.Paragraph,{style:{marginBottom:"8px"},strong:!0,children:"Thời gian kích hoạt"}),f.jsx(R.Item,{shouldUpdate:(r,o)=>r.date_config_value!==o.date_config_value,noStyle:!0,children:({getFieldValue:r})=>{const i=(r("date_config_value")??cv.SAME_DAY)!==cv.SAME_DAY;return f.jsxs(Nn,{gutter:12,style:{alignItems:"baseline"},children:[f.jsx(at,{span:3,children:f.jsx(R.Item,{label:"Ngày",labelCol:{span:24},wrapperCol:{span:0}})}),f.jsx(at,{span:i?12:21,children:f.jsx(R.Item,{name:"date_config_value",initialValue:cv.SAME_DAY,children:f.jsx(In,{options:mpt.map(a=>({value:a,label:x7[a],key:a})),placeholder:"Thời gian kích hoạt"})})}),i&&f.jsx(at,{span:9,children:f.jsx(R.Item,{name:"date_config_offset",initialValue:1,children:f.jsx(ci,{min:1,style:{width:"100%"},suffix:"Ngày",controls:!1})})})]})}}),f.jsx(R.Item,{shouldUpdate:(r,o)=>r.time_config_value!==o.time_config_value||r.time_field!==o.time_field,noStyle:!0,children:({getFieldValue:r})=>{const o=r("time_config_value")??kc.BEFORE_EVENT,i=r("time_field"),a=o!==kc.AT_EVENT;return f.jsxs(Nn,{gutter:12,style:{alignItems:"baseline"},children:[f.jsx(at,{span:3,children:f.jsx(R.Item,{label:"Giờ",labelCol:{span:24},wrapperCol:{span:0}})}),f.jsx(at,{span:(i==null?void 0:i.variant_config)===Bn.date?0:a?12:21,children:f.jsx(R.Item,{name:"time_config_value",initialValue:kc.BEFORE_EVENT,children:f.jsx(In,{options:vpt.map(s=>({value:s,label:Ple[s],key:s}))})})}),(a||(i==null?void 0:i.variant_config)===Bn.date||(i==null?void 0:i.variant_config)===Bn.datetime)&&f.jsx(at,{span:(i==null?void 0:i.variant_config)===Bn.date?21:a?9:0,children:f.jsx(R.Item,{noStyle:!0,shouldUpdate:(s,l)=>s.time_config_value!==l.time_config_value,children:({getFieldValue:s})=>s("time_config_value")===kc.FIXED_TIME||(i==null?void 0:i.variant_config)===Bn.date?f.jsx(R.Item,{name:"time_config_fixed_time",initialValue:Un("08:30",lo),children:f.jsx(cu,{style:{width:"100%"},placeholder:"Chọn giờ",format:lo,minuteStep:5,allowClear:!1})}):f.jsxs(Cn.Compact,{block:!0,children:[f.jsx(R.Item,{name:"time_config_offset",initialValue:10,children:f.jsx(ci,{style:{width:"100%"},min:1,controls:!1})}),f.jsx(R.Item,{name:"time_config_offset_unit",initialValue:"MINUTES",children:f.jsx(In,{options:[{label:"Giờ",value:"HOURS"},{label:"Phút",value:"MINUTES"}]})})]})})})]})}})]});if(t===Hl.UPDATED_BY_CONDITION)return f.jsx(Opt,{});let n="";return t===Hl.CREATED?n="Liên hệ mới đáp ứng các điều kiện sau":t===Hl.DELETED?n="Liên hệ bị xóa thoả mãn":t===Hl.UPDATED&&(n="Liên hệ sau khi cập nhật thoả mãn"),f.jsxs(f.Fragment,{children:[f.jsxs(ge.Title,{level:5,style:{margin:"unset"},children:["Kích hoạt khi ",n,":"]}),f.jsx(ha,{model:"contact"})]})}}),kpt=()=>{const e=R.useFormInstance(),t=R.useWatch("type",e),[n,r]=A.useState(""),o=A.useMemo(()=>{const i=n.trim().toLowerCase();return i?$le.filter(a=>{const s=Ix[a].toLowerCase(),l=_le[a].toLowerCase();return s.includes(i)||l.includes(i)}):$le},[n]);return f.jsxs("div",{children:[f.jsx(Nt.Search,{placeholder:"Tìm kiếm hành động trigger",allowClear:!0,onChange:i=>r(i.target.value),onSearch:r,style:{marginBottom:12}}),f.jsx(R.Item,{name:"type",label:null,children:f.jsx(ln.Group,{className:p7,children:f.jsx(Cn,{direction:"vertical",className:g7,size:12,children:o.map(i=>f.jsxs(ln,{value:i,className:m7,children:[f.jsxs("div",{className:v7,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:Ix[i]}),f.jsx(ge.Text,{type:"secondary",children:_le[i]})]}),t===i&&f.jsxs("div",{className:y7,children:[f.jsx("div",{className:b7}),f.jsx(Wr,{className:C7})]})]},i))})})})]})},Mpt=e=>{var t;if(e.type===Hl.UPDATED_BY_CONDITION){if((t=e.groups)!=null&&t.length)return e.groups;if(e.condition)return[e.condition]}},_pt=e=>{var l;const t={...e},{change_field_id:n,...r}=t,o=Cs(t.object??"",t.groups??[],t.filter_type??"AND"),i=Mpt(t),a=t.date_config,s=t.time_config;return{...r,...i?{filter_type:((l=i[0])==null?void 0:l.filter_type)??"AND",groups:i}:o,condition:void 0,change_field_ids:t.type===Hl.UPDATED_BY_CONDITION?t.change_field_ids??Fle(i):void 0,condition_values:Ble(i),time_field:{id:t.time_field,name:t.time_field_name,slug:t.time_field_slug,variant_config:t.time_field_type},date_config_value:a==null?void 0:a.relative_type,date_config_offset:a==null?void 0:a.offset_value,time_config_value:s==null?void 0:s.execution_mode,time_config_fixed_time:s!=null&&s.fixed_time_value?Un(s.fixed_time_value,lo):void 0,time_config_offset:s==null?void 0:s.relative_value,time_config_offset_unit:s==null?void 0:s.relative_unit}},$pt=e=>{const{time_field:t,date_config_value:n,date_config_offset:r,time_config_value:o,time_config_fixed_time:i,time_config_offset:a,time_config_offset_unit:s,condition_values:l,output:c,...u}=e,d=e.type===Hl.UPDATED_BY_CONDITION,h=Js((e.groups??[]).map(v=>{var b;return{...v,conditions:(b=v.conditions)==null?void 0:b.filter(C=>!nt.isEmpty(C))}})),p=t,g={relative_type:n,offset_value:n!==cv.SAME_DAY?r:void 0},y={execution_mode:o,fixed_time_value:o===kc.FIXED_TIME||(p==null?void 0:p.variant_config)===Bn.date?Un(i).format(lo):void 0,relative_value:o!==kc.FIXED_TIME&&o!==kc.AT_EVENT?a:void 0,relative_unit:o!==kc.FIXED_TIME&&o!==kc.AT_EVENT?s:void 0};return{...u,groups:d?jle(e.groups):h,change_field_ids:d?e.change_field_ids:void 0,time_field:p==null?void 0:p.id,time_field_type:p==null?void 0:p.variant_config,time_field_slug:p==null?void 0:p.slug,time_field_name:p==null?void 0:p.name,date_config:g,time_config:y}},Ppt=({id:e})=>{var v;const{getNode:t,setNodes:n}=bn(),{mode:r}=Xt(),o=Cr(),{data:i}=t(e),a=i,[s]=R.useForm(),[l,c]=A.useState("1"),u=R.useWatch("type",s);vo({form:s,type:u});const{data:d}=Zo({type:be.TRIGGER_CONTACT,action:u??""});A.useEffect(()=>{var b,C;o(e,{output:((C=(b=d==null?void 0:d.data)==null?void 0:b.outputs)==null?void 0:C.map(S=>{var E;return{...S,object:e,node_type:be.TRIGGER_CONTACT,order:a==null?void 0:a.order,output_mode:((E=d==null?void 0:d.data)==null?void 0:E.output_mode)??[]}}))||[]})},[d==null?void 0:d.data,a==null?void 0:a.order,e,o]),A.useEffect(()=>{u&&c("2")},[u]);const h=A.useRef(!0);A.useEffect(()=>{h.current&&(s.setFieldsValue(_pt(a)),h.current=!1)},[a,s]);const p=()=>{const b=$pt(s.getFieldsValue(!0));r==="edit"&&n(C=>C.map(S=>{if(S.id!==e)return S;const{change_field_id:E,...x}=S.data,I={...x,...b};return{...S,data:I}}))},g=A.useMemo(()=>nt.debounce(()=>{s.submit()},500),[s]);A.useEffect(()=>()=>{g.cancel()},[g]);const y=[{key:"1",label:"Trigger",children:f.jsx(kpt,{})},{key:"2",label:"Cài đặt",children:f.jsx(Tpt,{}),disabled:!u},{key:"3",label:"Đầu ra",children:f.jsx(gpt,{outputs:(v=d==null?void 0:d.data)==null?void 0:v.outputs,id:e}),disabled:!u}];return f.jsx("div",{className:h7,children:f.jsxs(R,{form:s,layout:"vertical",onFinish:p,onValuesChange:g,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(Ir,{activeKey:l,onChange:c,items:y})]})})},Dpt=({id:e,data:t,mini:n})=>{var C,S,E,x;const{mode:r}=Xt(),{displayComponent:o}=Rn(),i=t.title||"Liên hệ",a=t.type,s=t==null?void 0:t.date_config,l=(t==null?void 0:t.date_config_value)??(s==null?void 0:s.relative_type),c=(t==null?void 0:t.date_config_offset)??(s==null?void 0:s.offset_value),d=`${(l?x7[l]:void 0)??""} ${l!==cv.SAME_DAY&&c!=null?`${c} ngày`:""}`.trim(),h=t==null?void 0:t.condition,p=(C=t==null?void 0:t.groups)!=null&&C.length?t.groups:h?[h]:[],g=p==null?void 0:p.some(I=>{var N;return(N=I.conditions)==null?void 0:N.length}),y=t==null?void 0:t.change_field_id,v=((S=t==null?void 0:t.change_field_ids)==null?void 0:S.length)??(y==null?void 0:y.length)??0,b=I=>{const N=I.target;N!=null&&N.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(I.stopPropagation(),I.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(Ppt,{id:e}),i,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx(f.Fragment,{children:f.jsx("div",{className:c7,onClick:b,onKeyDown:I=>{(I.key==="Enter"||I.key===" ")&&b(I)},children:f.jsxs("div",{className:`${u7}`,children:[f.jsxs(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",justify:"flex-start",style:{width:"100%"},gap:12,children:[f.jsxs("div",{className:d7,children:[f.jsx(qT,{color:"#096DD9",variant:"Bold",size:24,className:f7}),f.jsx(vs,{size:14,className:Cht,variant:"Bold",color:"#000"})]}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:i})]}),f.jsx(Po,{id:e,data:t})]}),f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:16,children:f.jsx(ge.Text,{children:Ix[a]})}),f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Điều kiện"})}),f.jsx(at,{span:16,children:(t==null?void 0:t.type)===Hl.UPDATED_BY_CONDITION?g?f.jsx(ku,{nodeId:e,groups:p}):f.jsx(ge.Text,{children:v?`${v} trường được chọn`:"Chưa chọn trường"}):(t==null?void 0:t.type)!==Hl.TIME?f.jsx(ku,{nodeId:e,groups:t==null?void 0:t.groups}):f.jsxs(Ke,{vertical:!0,gap:4,style:{minWidth:0},children:[f.jsxs(ge.Paragraph,{style:{marginBottom:0},ellipsis:{rows:1,expanded:!1,tooltip:((E=t==null?void 0:t.time_field)==null?void 0:E.name)||(t==null?void 0:t.time_field_name)},children:[f.jsx(ge.Text,{strong:!0,children:((x=t==null?void 0:t.time_field)==null?void 0:x.name)||(t==null?void 0:t.time_field_name)})," "]}),f.jsx(ge.Paragraph,{style:{marginBottom:0},ellipsis:{rows:1,expanded:!1,tooltip:d},children:f.jsx(ge.Text,{strong:!0,children:d})})]})})]})]})})})},Lpt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(Dpt,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]});var Bpt="scripts_editor_1y18uwq0",Fpt="scripts_editor_1y18uwq1",Wle={default:"scripts_editor_1y18uwq2",active:"scripts_editor_1y18uwq3"},jpt="scripts_editor_1y18uwq4",zpt="scripts_editor_1y18uwq5",Vpt="scripts_editor_1y18uwq8",Hpt="scripts_editor_1y18uwq9",Wpt="scripts_editor_1y18uwqa",Kpt="scripts_editor_1y18uwqb",qpt="scripts_editor_1y18uwqc",Upt="scripts_editor_1y18uwqd",Gpt="scripts_editor_1y18uwqe",Qpt="scripts_editor_1y18uwqf",Ox=(e=>(e.CREATE="CREATE",e.UPDATE="UPDATE",e.GET="GET",e))(Ox||{});const Kle=[vn.CONTACT,vn.ENTERPRISE,vn.CRMDEAL,vn.CRMORDER];var qle=(e=>(e.CREATE_CONTACT="CREATE_CONTACT",e.UPDATE_CONTACT="UPDATE_CONTACT",e.GET_CONTACT="GET_CONTACT",e.CREATE_ENTERPRISE="CREATE_ENTERPRISE",e.UPDATE_ENTERPRISE="UPDATE_ENTERPRISE",e.GET_ENTERPRISE="GET_ENTERPRISE",e.CREATE_CRMDEAL="CREATE_CRMDEAL",e.UPDATE_CRMDEAL="UPDATE_CRMDEAL",e.GET_CRMDEAL="GET_CRMDEAL",e.CREATE_CRMORDER="CREATE_CRMORDER",e.UPDATE_CRMORDER="UPDATE_CRMORDER",e.GET_CRMORDER="GET_CRMORDER",e))(qle||{});const nl=(e,t,n,r,o)=>({action:e,object:t,label:`${r} ${n.toLowerCase()}`,description:o}),pa={[vn.CONTACT]:"Liên hệ",[vn.ENTERPRISE]:"Công ty",[vn.CRMDEAL]:"Cơ hội bán hàng",[vn.CRMORDER]:"Đơn hàng"},N7={CREATE_CONTACT:nl("CREATE",vn.CONTACT,pa[vn.CONTACT],"Tạo mới","Tạo mới liên hệ trong CRM"),UPDATE_CONTACT:nl("UPDATE",vn.CONTACT,pa[vn.CONTACT],"Cập nhật","Cập nhật liên hệ theo điều kiện lọc"),GET_CONTACT:nl("GET",vn.CONTACT,pa[vn.CONTACT],"Lấy dữ liệu","Lấy dữ liệu liên hệ theo điều kiện lọc"),CREATE_ENTERPRISE:nl("CREATE",vn.ENTERPRISE,pa[vn.ENTERPRISE],"Tạo mới","Tạo mới công ty trong CRM"),UPDATE_ENTERPRISE:nl("UPDATE",vn.ENTERPRISE,pa[vn.ENTERPRISE],"Cập nhật","Cập nhật công ty theo điều kiện lọc"),GET_ENTERPRISE:nl("GET",vn.ENTERPRISE,pa[vn.ENTERPRISE],"Lấy dữ liệu","Lấy dữ liệu công ty theo điều kiện lọc"),CREATE_CRMDEAL:nl("CREATE",vn.CRMDEAL,pa[vn.CRMDEAL],"Tạo mới","Tạo mới cơ hội bán hàng trong CRM"),UPDATE_CRMDEAL:nl("UPDATE",vn.CRMDEAL,pa[vn.CRMDEAL],"Cập nhật","Cập nhật cơ hội bán hàng theo điều kiện lọc"),GET_CRMDEAL:nl("GET",vn.CRMDEAL,pa[vn.CRMDEAL],"Lấy dữ liệu","Lấy dữ liệu cơ hội bán hàng theo điều kiện lọc"),CREATE_CRMORDER:nl("CREATE",vn.CRMORDER,pa[vn.CRMORDER],"Tạo mới","Tạo mới đơn hàng trong CRM"),UPDATE_CRMORDER:nl("UPDATE",vn.CRMORDER,pa[vn.CRMORDER],"Cập nhật","Cập nhật đơn hàng theo điều kiện lọc"),GET_CRMORDER:nl("GET",vn.CRMORDER,pa[vn.CRMORDER],"Lấy dữ liệu","Lấy dữ liệu đơn hàng theo điều kiện lọc")};Object.values(qle);const Ule=Object.fromEntries(Object.entries(N7).map(([e,t])=>[e,t.label])),Rpt=Object.fromEntries(Object.entries(N7).map(([e,t])=>[e,t.description])),Ypt={[vn.CONTACT]:["CREATE_CONTACT","UPDATE_CONTACT","GET_CONTACT"],[vn.ENTERPRISE]:["CREATE_ENTERPRISE","UPDATE_ENTERPRISE","GET_ENTERPRISE"],[vn.CRMDEAL]:["CREATE_CRMDEAL","UPDATE_CRMDEAL","GET_CRMDEAL"],[vn.CRMORDER]:["CREATE_CRMORDER","UPDATE_CRMORDER","GET_CRMORDER"]},O7=e=>Array.isArray(e)?e.some(O7):e&&typeof e=="object"?Object.values(e).some(O7):e!=null&&e!=="",Gle=e=>{if(e)return N7[e]},Xpt=e=>{var t;return(t=Gle(e))==null?void 0:t.action},dp=e=>{var t;return(t=Gle(e))==null?void 0:t.object},Zpt=e=>(e==null?void 0:e.some(t=>{var n;return(n=t.conditions)==null?void 0:n.some(r=>Object.values(r??{}).some(O7))}))??!1,Jpt=()=>{const e=R.useFormInstance(),t=R.useWatch("type",e);return f.jsx(R.Item,{name:"type",label:null,children:f.jsx(ln.Group,{className:Hpt,children:f.jsx(IA,{defaultActiveKey:[...Kle],expandIconPosition:"start",ghost:!0,items:Kle.map(n=>({key:n,label:f.jsx(ge.Text,{strong:!0,children:pa[n]}),styles:{header:{padding:"12px 0"},body:{padding:0}},children:f.jsx(Cn,{direction:"vertical",className:Wpt,size:12,children:Ypt[n].map(r=>f.jsxs(ln,{value:r,className:Kpt,children:[f.jsxs("div",{className:qpt,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:Ule[r]}),f.jsx(ge.Text,{type:"secondary",children:Rpt[r]})]}),t===r?f.jsxs("div",{className:Upt,children:[f.jsx("div",{className:Gpt}),f.jsx(Wr,{className:Qpt})]}):null]},r))})}))})})})},egt=({type:e})=>{const t=dp(e);return t?f.jsx(tl,{title:`Tạo mới ${pa[t].toLowerCase()}`,model:t,formListName:"update_fields"}):null},tgt=({type:e})=>{const t=dp(e);return t?f.jsxs(f.Fragment,{children:[f.jsx(ge.Paragraph,{strong:!0,children:`Lấy dữ liệu ${pa[t].toLowerCase()} đáp ứng điều kiện sau:`}),f.jsx(ha,{model:t})]}):null},ngt=({id:e,outputs:t})=>{const n=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t??[]).map(r=>({...r,icon:()=>{var i;const o=so[((i=r.meta)==null?void 0:i.iconType)??""]??null;return o?f.jsx(o,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:n})},rgt=({type:e})=>{const t=dp(e);return t?f.jsxs(f.Fragment,{children:[f.jsx(ge.Paragraph,{strong:!0,children:`Cập nhật ${pa[t].toLowerCase()} đáp ứng điều kiện sau:`}),f.jsxs(Ke,{vertical:!0,gap:12,children:[f.jsx(ha,{model:t}),f.jsx(tl,{title:"Cập nhật dữ liệu",model:t,formListName:"update_fields"})]})]}):null},Qle=({id:e})=>{var y;const{getNode:t}=bn(),n=Cr(),{data:r}=t(e),o=r,[i]=R.useForm(),[a,s]=A.useState("1"),l=R.useWatch("type",i);vo({form:i,type:l,getResetValues:({nextType:v})=>{const b=dp(v);return b?{object:b}:void 0}});const{data:c}=Zo({type:be.DATA_CRM,action:l??""});A.useEffect(()=>{var v,b;n(e,{output:((b=(v=c==null?void 0:c.data)==null?void 0:v.outputs)==null?void 0:b.map(C=>{var S;return{...C,object:e,node_type:be.DATA_CRM,order:o==null?void 0:o.order,output_mode:((S=c==null?void 0:c.data)==null?void 0:S.output_mode)??[]}}))||[]})},[c==null?void 0:c.data,o==null?void 0:o.order,e,n]),A.useEffect(()=>{l&&s("2")},[l]),A.useEffect(()=>{const v=dp(l);v&&i.getFieldValue("object")!==v&&i.setFieldValue("object",v)},[i,l]);const u=A.useRef(!0);A.useEffect(()=>{if(u.current){const v=nt.cloneDeep(o),b=(v==null?void 0:v.object)??dp(v==null?void 0:v.type),C=Cs(b,(v==null?void 0:v.groups)??[],(v==null?void 0:v.filter_type)??"AND");i.setFieldsValue({...v,object:b,...C}),u.current=!1}},[o,i]);const d=()=>{if(!l)return null;switch(Xpt(l)){case Ox.CREATE:return f.jsx(egt,{type:l});case Ox.UPDATE:return f.jsx(rgt,{type:l});case Ox.GET:return f.jsx(tgt,{type:l});default:return null}},h=v=>{const b=Js(((v==null?void 0:v.groups)??[]).map(E=>{var x;return{...E,conditions:(x=E==null?void 0:E.conditions)==null?void 0:x.filter(I=>!nt.isEmpty(I))}})),C=Vl(zl(v)),S=dp(v.type);n(e,{...v,object:S,groups:b,variables:C})},p=A.useMemo(()=>nt.debounce(()=>{i.submit()},500),[i]);A.useEffect(()=>()=>{p.cancel()},[p]);const g=[{key:"1",label:"Hành động",children:f.jsx(Jpt,{})},{key:"2",label:"Cài đặt",children:d(),disabled:!l},{key:"3",label:"Đầu ra",children:f.jsx(ngt,{id:e,outputs:(y=c==null?void 0:c.data)==null?void 0:y.outputs}),disabled:!l}];return f.jsx("div",{className:Vpt,children:f.jsxs(R,{form:i,layout:"vertical",initialValues:{...o},onFinish:h,onValuesChange:p,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(R.Item,{name:["object"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(Ir,{activeKey:a,onChange:s,items:g})]})})},ogt=({id:e,data:t,mini:n})=>{const{mode:r}=Xt(),{displayComponent:o,nodeId:i}=Rn(),a=t.title||"Lấy dữ liệu",s=Zpt(t.groups),l=c=>{const u=c.target;u!=null&&u.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(c.stopPropagation(),c.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(Qle,{id:e}),a,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx(f.Fragment,{children:f.jsx("div",{className:Bpt,onClick:l,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&l(c)},children:f.jsxs("div",{className:`${Fpt} ${i===e?Wle.active:Wle.default}`,children:[f.jsxs("div",{className:`${zpt} drag-handle__custom`,children:[f.jsxs("div",{className:jpt,children:[f.jsx(io,{style:{fontSize:16,color:Fn.conditionBlock.focus}}),f.jsx(Xd,{id:e,color:Fn.conditionBlock.focus})]}),f.jsx(Iu,{id:e,deleteBtnColor:Fn.conditionBlock.focus})]}),f.jsx(fo,{styles:{body:{padding:8}},children:f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:10,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:14,children:f.jsx(ge.Text,{children:Ule[t.type]})}),s?f.jsxs(f.Fragment,{children:[f.jsx(at,{span:10,children:f.jsx(ge.Text,{type:"secondary",children:"Bộ lọc"})}),f.jsx(at,{span:14,children:f.jsx(ku,{nodeId:e,groups:t.groups})})]}):null]})})]})})})},igt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(ogt,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]});var agt="scripts_editor_12j5lm80",sgt="scripts_editor_12j5lm81",lgt="scripts_editor_12j5lm82",cgt="scripts_editor_12j5lm83",ugt="scripts_editor_12j5lm85",dgt="scripts_editor_12j5lm87",fgt="scripts_editor_12j5lm88",hgt="scripts_editor_12j5lm89",pgt="scripts_editor_12j5lm8a",ggt="scripts_editor_12j5lm8b",mgt="scripts_editor_12j5lm8c",vgt="scripts_editor_12j5lm8d";const T7={DELAY:"Hẹn giờ"},ygt={DELAY:"Tạm dừng trong một khoảng thời gian xác định"},bgt=nt.keys(T7);var Rle=(e=>(e.SECONDS="SECONDS",e.MINUTES="MINUTES",e.HOURS="HOURS",e.DAYS="DAYS",e))(Rle||{});const Tx={SECONDS:"giây",MINUTES:"phút",HOURS:"giờ",DAYS:"ngày"},Cgt=nt.keys(Tx),Agt=()=>{const e=R.useFormInstance(),t=R.useWatch("type",e);return f.jsxs("div",{children:[f.jsx(Nt.Search,{placeholder:"Tìm kiếm hành động",allowClear:!0,onSearch:n=>{console.log("🚀 ~ e:",n)},style:{marginBottom:12}}),f.jsx(R.Item,{name:"type",label:null,children:f.jsx(ln.Group,{className:dgt,children:f.jsx(Cn,{direction:"vertical",className:fgt,size:12,children:bgt.map(n=>f.jsxs(ln,{value:n,className:hgt,children:[f.jsxs("div",{className:pgt,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:T7[n]}),f.jsx(ge.Text,{type:"secondary",children:ygt[n]})]}),t===n&&f.jsxs("div",{className:ggt,children:[f.jsx("div",{className:mgt}),f.jsx(Wr,{className:vgt})]})]},n))})})})]})},Egt=({id:e,outputs:t})=>{const n=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t).map(r=>({...r,icon:()=>{var i;const o=so[((i=r.meta)==null?void 0:i.iconType)??""]??null;return o?f.jsx(o,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:n})},Mc=[{label:"Thứ 2",value:2},{label:"Thứ 6",value:6},{label:"Thứ 3",value:3},{label:"Thứ 7",value:7},{label:"Thứ 4",value:4},{label:"Chủ nhật",value:8},{label:"Thứ 5",value:5}],Sgt=()=>{const e=R.useFormInstance(),t=R.useWatch(["config","time_restriction","apply_on_days"],e),n=()=>{const r=(t==null?void 0:t.length)===(Mc==null?void 0:Mc.length);e.setFieldsValue({config:{time_restriction:{apply_on_days:r?[]:Mc==null?void 0:Mc.map(o=>o.value)}}}),nt.debounce(()=>{e.submit()},500)()};return f.jsxs(f.Fragment,{children:[f.jsx(ge.Text,{strong:!0,children:"Thời gian chờ"}),f.jsxs(Nn,{gutter:6,style:{marginTop:8},children:[f.jsx(at,{span:12,children:f.jsx(R.Item,{name:["config","wait_time","value"],label:null,style:{marginBottom:12},children:f.jsx(ci,{min:1,style:{width:"100%"},placeholder:"Nhập thời gian",suffix:f.jsx(N2,{})})})}),f.jsx(at,{span:12,children:f.jsx(R.Item,{initialValue:Rle.SECONDS,name:["config","wait_time","unit"],label:null,style:{marginBottom:12},children:f.jsx(In,{placeholder:"Chọn đơn vị",options:Cgt.map(r=>({label:Tx[r],value:r}))})})})]}),f.jsx(R.Item,{name:["config","time_restriction","is_enabled"],valuePropName:"checked",label:null,style:{marginBottom:12},children:f.jsx(Fr,{children:"Đặt giới hạn thời gian"})}),f.jsx(R.Item,{noStyle:!0,shouldUpdate:(r,o)=>{var i,a,s,l;return((a=(i=r.config)==null?void 0:i.time_restriction)==null?void 0:a.is_enabled)!==((l=(s=o.config)==null?void 0:s.time_restriction)==null?void 0:l.is_enabled)},children:({getFieldValue:r})=>r(["config","time_restriction","is_enabled"])?f.jsx(Ed,{children:f.jsxs("div",{style:{background:"#F9F9FF",borderRadius:8,padding:12,display:"flex",flexDirection:"column",gap:8},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsx(ge.Text,{strong:!0,children:"Áp dụng cho các ngày"}),f.jsx(ge.Link,{onClick:n,children:(t==null?void 0:t.length)===(Mc==null?void 0:Mc.length)?"Bỏ chọn tất cả":"Chọn tất cả"})]}),f.jsx(R.Item,{label:null,name:["config","time_restriction","apply_on_days"],children:f.jsx(Fr.Group,{style:{display:"grid",gridTemplateColumns:"repeat(2, minmax(100px, 1fr))",rowGap:8},options:Mc})})]})}):null})]})},wgt=({id:e})=>{var g;const{getNode:t,setNodes:n}=bn(),r=Cr(),{data:o}=t(e),i=o,[a]=R.useForm(),[s,l]=A.useState("1"),c=R.useWatch("type",a);vo({form:a,type:c});const{data:u}=Zo({type:be.DELAY,action:c??""});A.useEffect(()=>{var y,v;r(e,{output:((v=(y=u==null?void 0:u.data)==null?void 0:y.outputs)==null?void 0:v.map(b=>{var C;return{...b,object:e,node_type:be.DELAY,order:i==null?void 0:i.order,output_mode:((C=u==null?void 0:u.data)==null?void 0:C.output_mode)??[]}}))||[]})},[u==null?void 0:u.data,i==null?void 0:i.order,e,r]),A.useEffect(()=>{c&&l("2")},[c]);const d=y=>{r(e,y)},h=A.useMemo(()=>nt.debounce(()=>{a.submit()},500),[a]);A.useEffect(()=>()=>{h.cancel()},[h]);const p=[{key:"1",label:"Hành động",children:f.jsx(Agt,{})},{key:"2",label:"Cài đặt",children:f.jsx(Sgt,{}),disabled:!c},{key:"3",label:"Đầu ra",children:f.jsx(Egt,{id:e,outputs:(g=u==null?void 0:u.data)==null?void 0:g.outputs}),disabled:!c}];return f.jsx("div",{className:ugt,children:f.jsxs(R,{form:a,layout:"vertical",initialValues:{...i},onFinish:d,onValuesChange:h,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(Ir,{activeKey:s,onChange:l,items:p})]})})},xgt=({id:e,data:t,mini:n})=>{var s,l,c,u,d,h,p,g;const{mode:r}=Xt(),{displayComponent:o}=Rn(),i=t.title||"Hẹn giờ",a=y=>{const v=y.target;v!=null&&v.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(y.stopPropagation(),y.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(wgt,{id:e}),i,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx("div",{className:agt,onClick:a,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&a(y)},children:f.jsxs("div",{className:`${sgt}`,children:[f.jsxs(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",justify:"flex-start",style:{width:"100%"},gap:12,children:[f.jsx("div",{className:lgt,children:f.jsx(QT,{className:cgt})}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:i})]}),f.jsx(Po,{id:e,data:t})]}),f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:16,children:T7[t.type]}),f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Thời gian"})}),f.jsx(at,{span:16,children:f.jsx(Ke,{style:{minWidth:0},children:f.jsx(ge.Paragraph,{ellipsis:{rows:1,expanded:!1,tooltip:(l=(s=t==null?void 0:t.config)==null?void 0:s.wait_time)!=null&&l.value&&((u=(c=t==null?void 0:t.config)==null?void 0:c.wait_time)!=null&&u.unit)?`${t.config.wait_time.value} ${Tx[t.config.wait_time.unit]}`:""},children:f.jsx(ge.Text,{children:(h=(d=t==null?void 0:t.config)==null?void 0:d.wait_time)!=null&&h.value&&((g=(p=t==null?void 0:t.config)==null?void 0:p.wait_time)!=null&&g.unit)?`${t.config.wait_time.value} ${Tx[t.config.wait_time.unit]}`:""})})})})]})]})})},Igt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(xgt,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]});var Ngt="scripts_editor_139p2vp0",Ogt="scripts_editor_139p2vp1",Tgt="scripts_editor_139p2vp2",kgt="scripts_editor_139p2vp3",Mgt="scripts_editor_139p2vp5",_gt="scripts_editor_139p2vp7",$gt="scripts_editor_139p2vp8",Pgt="scripts_editor_139p2vp9",Dgt="scripts_editor_139p2vpa",Lgt="scripts_editor_139p2vpb",Bgt="scripts_editor_139p2vpc",Fgt="scripts_editor_139p2vpd",jgt="scripts_editor_139p2vpe",Yle="scripts_editor_139p2vpf";const k7={SEND_MAIL:"Gửi email"},zgt={SEND_MAIL:"Gửi email với mẫu có sẵn"},Vgt=nt.keys(k7),Hgt=()=>{const e=R.useFormInstance(),t=R.useWatch("type",e);return f.jsxs("div",{children:[f.jsx(Nt.Search,{placeholder:"Tìm kiếm hành động",allowClear:!0,onSearch:n=>{console.log("🚀 ~ e:",n)},style:{marginBottom:12}}),f.jsx(R.Item,{name:"type",label:null,children:f.jsx(ln.Group,{className:_gt,children:f.jsx(Cn,{direction:"vertical",className:$gt,size:12,children:Vgt.map(n=>f.jsxs(ln,{value:n,className:Pgt,children:[f.jsxs("div",{className:Dgt,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:k7[n]}),f.jsx(ge.Text,{type:"secondary",children:zgt[n]})]}),t===n&&f.jsxs("div",{className:Lgt,children:[f.jsx("div",{className:Bgt}),f.jsx(Wr,{className:Fgt})]})]},n))})})})]})},Wgt=({id:e,outputs:t})=>{const n=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t).map(r=>({...r,icon:()=>{var i;const o=so[((i=r.meta)==null?void 0:i.iconType)??""]??null;return o?f.jsx(o,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:n})},Kgt="filter-infinite-mail-config",qgt=({currentFilters:e,pageSize:t=10,enabled:n=!0})=>{const{axiosInstance:r,context:{COMPANY_ID:o}}=Xt();return ba({queryKey:[Kgt,o??"",e],queryFn:({pageParam:i=1})=>r.get(`/company/${o}/mailconfig`,{params:{...e,page:i,size:t}}),enabled:n&&!!o,initialPageParam:1,getNextPageParam:(i,a)=>{if(a.reduce((l,c)=>l+c.data.results.length,0)<i.data.count)return a.length+1},staleTime:1e3*60*10,refetchOnMount:!1,retry:1})},Ugt=({dataDefault:e,...t})=>{const{search:n,onSearch:r}=wi(),{data:o,fetchNextPage:i,hasNextPage:a,isLoading:s}=qgt({currentFilters:{search:n},pageSize:10}),[l,c]=A.useState([]);A.useEffect(()=>{const h=[...e?nt.isArray(e)?e:[e]:[],...(o==null?void 0:o.pages.flatMap(p=>{var g;return(g=p==null?void 0:p.data)==null?void 0:g.results}))||[]];c(nt.uniqBy(h,"id"))},[o==null?void 0:o.pages,e]);const u=A.useMemo(()=>l.map(h=>({label:h.name,value:h.id})),[l]),d=async h=>{const p=h.target;p.scrollTop+p.offsetHeight===p.scrollHeight&&a&&await i()};return f.jsx(In,{options:u,allowClear:!0,onSearch:r,onFocus:()=>r(void 0),filterOption:!1,onPopupScroll:d,loading:s,placeholder:"Chọn Email",...t})},Ggt="filter-infinite-mail-template",Qgt=({currentFilters:e,pageSize:t=10,enabled:n=!0})=>{const{axiosInstance:r,context:{COMPANY_ID:o}}=Xt();return ba({queryKey:[Ggt,o??"",e],queryFn:({pageParam:i=1})=>r.get(`/company/${o}/mailtemplate`,{params:{...e,page:i,size:t}}),enabled:n&&!!o,initialPageParam:1,getNextPageParam:(i,a)=>{if(a.reduce((l,c)=>l+c.data.results.length,0)<i.data.count)return a.length+1},staleTime:1e3*60*10,refetchOnMount:!1,retry:1})},Rgt=({dataDefault:e,...t})=>{const{search:n,onSearch:r}=wi(),{data:o,fetchNextPage:i,hasNextPage:a,isLoading:s}=Qgt({currentFilters:{search:n},pageSize:10}),[l,c]=A.useState([]);A.useEffect(()=>{const h=[...e?nt.isArray(e)?e:[e]:[],...(o==null?void 0:o.pages.flatMap(p=>{var g;return(g=p==null?void 0:p.data)==null?void 0:g.results}))||[]];c(nt.uniqBy(h,"id"))},[o==null?void 0:o.pages,e]);const u=A.useMemo(()=>l.map(h=>({label:h.name,value:h.id})),[l]),d=async h=>{const p=h.target;p.scrollTop+p.offsetHeight===p.scrollHeight&&a&&await i()};return f.jsx(In,{options:u,allowClear:!0,onSearch:r,onFocus:()=>r(void 0),filterOption:!1,onPopupScroll:d,loading:s,placeholder:"Chọn mẫu Email",...t})};function M7(e,t){let n=-1,r=-1;for(let o=t-1;o>=0;o--){if((e==null?void 0:e.substring(o,o+2))==="{{"){n=o;break}if((e==null?void 0:e.substring(o,o+2))==="}}")return{start:-1,end:-1}}if(n!==-1)for(let o=t;o<e.length-1;o++){if((e==null?void 0:e.substring(o,o+2))==="}}"){r=o+2;break}if((e==null?void 0:e.substring(o,o+2))==="{{")break}return{start:n,end:r}}function Ygt(e,t){const{value:n,onChange:r,isCheckPrefix:o=!0,onSelect:i,status:a}=t||{},[s,l]=A.useState(!1),[c,u]=A.useState(0),d=A.useRef(null),[h,p]=A.useState(n??""),g=n!==void 0;A.useEffect(()=>{!g&&n!==void 0&&p(n)},[g,n]);const y=g?n:h,v=x=>{r==null||r(x),g||p(x)},b=A.useMemo(()=>{var N;const{start:x}=M7(y,c);if(x===-1)return e;const I=(N=y==null?void 0:y.slice(x+2,c))==null?void 0:N.toLowerCase();return I?e.map(O=>mv(O,I)).filter(O=>O!==null):e},[e,y,c]);return A.useEffect(()=>{if(!o)return;const{start:x}=M7(y,c);l(x!==-1?b.length>0:!1)},[y,c,b,o]),{value:y,open:s,options:b,bindInput:{ref:d,value:y,onChange:x=>{const I=x.target?x.target.value:x,N=x.target&&x.target.selectionStart||I.length;v(I),u(N),!o&&(nt.isEmpty(I)||I.includes("{{"))&&l(!0)},onClick:x=>u(x.target.selectionStart||0),status:a,onFocus:()=>{o||l(b.length>0)}},onSelect:(x,I)=>{var M,_,L;const N=((M=d.current)==null?void 0:M.selectionStart)??c,{start:O,end:T}=M7(y,N);if(O!==-1){const P=y==null?void 0:y.substring(0,O),$=T!==-1?y==null?void 0:y.substring(T):y==null?void 0:y.substring(N),B=P+I.value+$;v(B)}else{const P=(_=y??"")==null?void 0:_.substring(0,N),$=(L=y??"")==null?void 0:L.substring(N);v(P+I.value+$)}l(!1),i==null||i(x,I)},setOpen:l,updateValue:v}}var Xgt="scripts_editor_1k16buo0",Zgt="scripts_editor_1k16buo2",Jgt="scripts_editor_1k16buo3",emt="scripts_editor_1k16buo4",tmt="scripts_editor_1k16buo5",nmt="scripts_editor_1k16buo6",rmt="scripts_editor_1k16buo7";const omt=e=>{const t=A.useRef(null),{nodeId:n}=Rn(),{optionMap:r,optionsData:o}=af(n),i=Ygt(o,e),{checkedMap:a}=Xy(),[s,l]=A.useState([]),[c,u]=A.useState({}),d=A.useDeferredValue(c),h=A.useMemo(()=>JSON.stringify(a),[a]),p=A.useRef(!1),g=A.useRef(!1),y=A.useRef(null);A.useEffect(()=>{s.some(I=>I.includes(qr[0]))&&(p.current=!0)},[h,s]),A.useEffect(()=>()=>{y.current!==null&&window.clearTimeout(y.current)},[]);const v=A.useCallback(()=>{g.current=!0,y.current!==null&&window.clearTimeout(y.current),y.current=window.setTimeout(()=>{g.current=!1,y.current=null},0)},[]),b=A.useCallback((x,I)=>{const N=r.get(x);if(!N)return;const O=lp(N,I);O&&i.onSelect(O,{value:O,data:el(N,O,I)})},[r,i]),C=()=>{var N;const x=Object.values(a).flat().map(O=>{const T=rf(O);return r.get(T)}).filter(O=>!!O&&"data"in O);if(x.length===0)return;const I=x.map(O=>`{{${O.data.object}.ALL_MATCHES.${O.data.slug}}}`);(N=e==null?void 0:e.onMultiSelect)==null||N.call(e,I),i.updateValue(""),i.setOpen(!1)},S=A.useMemo(()=>{var x;return(x=i.options)==null?void 0:x.map(I=>qx(I,e==null?void 0:e.filterTypes)).filter(I=>I!==null)},[i.options,e==null?void 0:e.filterTypes]),E=A.useMemo(()=>S==null?void 0:S.map(x=>{var L,P;const I="options"in x?c[x.label]??"":"",N="options"in x?(d[x.label]??"").trim().toLowerCase():"",O="options"in x&&N?mv(x,N):x,T="options"in x&&(!O||!("options"in O))?{...x,options:[]}:O,M="options"in x?{value:I,onChange:$=>{u(B=>({...B,[x.label]:$}))},onInteract:v,placeholder:"Tìm kiếm giá trị"}:void 0,_=!!((L=T==null?void 0:T.output_mode)!=null&&L.length)&&((P=T.output_mode)==null?void 0:P.every($=>jl($)));return T&&"options"in T&&_?W_(T,{search:M},$=>{const B=rf($),D=nf($);b(B,D)},v):vv(T,void 0,$=>{const B=rf($),D=nf($);b(B,D)},v,M)}),[d,b,v,S,c]);return f.jsx("div",{className:Xgt,ref:t,children:f.jsx(bN,{...e,value:i.value,options:i.options,open:i.open,onSelect:i.onSelect,onOpenChange:x=>{i.setOpen(x),x||(l([]),u({}))},getPopupContainer:()=>t.current||document.body,popupRender:()=>f.jsx(lc,{items:E,openKeys:s,mode:"vertical",triggerSubMenuAction:"click",selectable:!1,onOpenChange:x=>{if(g.current){g.current=!1;return}const I=s.some(O=>O.includes(qr[0])),N=x.some(O=>O.includes(qr[0]));I&&!N&&p.current&&s.find(T=>T.includes(qr[0]))&&(C(),p.current=!1),l(x)},onClick:({key:x,domEvent:I,keyPath:N})=>{if(I.target instanceof Element&&I.target.closest(`[${sb}="true"]`))return;const O=nf(String(x),N),T=rf(String(x));I.stopPropagation(),I.preventDefault(),b(T,O)}}),children:e.children?A.cloneElement(e.children,{...i.bindInput}):f.jsx(Nt,{...i.bindInput})})})};function imt(e){return f.jsx(V_,{children:f.jsx(omt,{...e})})}const amt=({value:e,onChange:t})=>{const{nodeId:n}=Rn(),{optionMap:r}=af(n),[o,i]=A.useState(""),[a,s]=A.useState(""),l=h=>{i(h),s("")},c=h=>{const p=(e||[]).filter(g=>g!==h);(p==null?void 0:p.length)===0&&s("Vui lòng nhập ít nhất một email hoặc biến!"),t(p.length>0?p:void 0)},u=h=>{const p=h.trim();if(!(z8.test(p)||Ra.test(p))){s("Vui lòng nhập đúng định dạng email hoặc biến!");return}const y=e||[];if(y.includes(p)){s("Email đã tồn tại!");return}t([...y,p]),i("")},d=h=>{if(h.key==="Enter"){if(o.startsWith("{{")&&!o.endsWith("}}"))return;h.preventDefault(),u(o)}};return f.jsxs("div",{children:[f.jsx("div",{style:{marginBottom:8},children:(e||[]).map(h=>{const p=h.match(Ra),g=z8.test(h)||Ra.test(h);if(p){const y=ev(r,h),v=y?el(y,h):tv(h);if(v)return f.jsx(Tu,{data:v,onClose:()=>c(h),closable:!0,style:{marginBottom:4,display:"inline-flex"}},h)}return f.jsx(ms,{closable:!0,onClose:()=>c(h),color:g?"blue":"red",style:{marginBottom:4},children:h},h)})}),f.jsx(imt,{value:o,onChange:l,onSelect:(h,p)=>{u((p==null?void 0:p.value)||h)},onMultiSelect:h=>{const p=e||[],g=h.filter(y=>!p.includes(y));t([...p,...g]),i("")},placeholder:"Nhập email hoặc biến và ấn Enter",status:a?"error":"",onKeyDown:d}),a&&f.jsx("div",{style:{color:"#ff4d4f",fontSize:14,marginTop:4},children:a})]})},smt=()=>{const{emit:e}=eb();return f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{name:"mailconfig",label:"Email người gửi",children:f.jsx(Ugt,{popupRender:t=>f.jsxs(f.Fragment,{children:[t,f.jsx(ia,{style:{margin:"6px 0"}}),f.jsx(Ke,{align:"center",justify:"center",children:f.jsx(yt,{style:{width:"100%"},type:"primary",onClick:()=>{e("openIntegrationEmailPage",void 0)},children:"Tích hợp mới"})})]})})}),f.jsx(R.Item,{name:"recipient_list",label:"Email người nhận",children:f.jsx(amt,{})}),f.jsx(R.Item,{label:"Nội dung email",name:"email_type",children:f.jsxs(ln.Group,{className:jgt,children:[f.jsx(ln,{value:"template",className:Yle,children:"Sử dụng mẫu có sẵn"}),f.jsx(ln,{value:"custom",className:Yle,children:"Soạn mới"})]})}),f.jsx(R.Item,{noStyle:!0,shouldUpdate:(t,n)=>t.email_type!==n.email_type,children:({getFieldValue:t})=>t("email_type")==="template"?f.jsx(R.Item,{name:"template_id",label:null,children:f.jsx(Rgt,{})}):f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{name:"subject",label:"Tiêu đề",children:f.jsx(yo,{placeholder:"Soạn tiêu đề"})}),f.jsx(R.Item,{name:"message",label:"Nội dung",children:f.jsx(yo,{placeholder:"Nhập nội dung email",rows:4})})]})})]})},lmt=()=>f.jsxs(Ke,{vertical:!0,gap:12,children:[f.jsx(ge.Text,{strong:!0,children:"Email người nhận"}),f.jsx(Nt,{placeholder:"Nhập email"}),f.jsx(yt,{type:"primary",icon:f.jsx(RT,{}),children:"Gửi thử"})]}),cmt=({id:e})=>{var y;const{getNode:t,setNodes:n}=bn(),r=Cr(),{data:o}=t(e),i=o,[a]=R.useForm(),[s,l]=A.useState("1"),c=R.useWatch("type",a);vo({form:a,type:c,getResetValues:()=>em[be.EMAIL]});const{data:u}=Zo({type:be.EMAIL,action:c??""});A.useEffect(()=>{var v,b;r(e,{output:((b=(v=u==null?void 0:u.data)==null?void 0:v.outputs)==null?void 0:b.map(C=>{var S;return{...C,object:e,node_type:be.EMAIL,order:i==null?void 0:i.order,output_mode:((S=u==null?void 0:u.data)==null?void 0:S.output_mode)??[]}}))||[]})},[u==null?void 0:u.data,i==null?void 0:i.order,e,r]),A.useEffect(()=>{c&&l("2")},[c]);const d=A.useRef(!0);A.useEffect(()=>{if(d.current){const v=nt.cloneDeep(i),b=(v==null?void 0:v.email)??{};a.setFieldsValue({...v,...b}),d.current=!1}},[i]);const h=v=>{const{email_type:b,mailconfig:C,message:S,recipient_list:E,subject:x,template_id:I,...N}=v,O=b==="custom"?{mailconfig:C,recipient_list:E,subject:x,message:S,email_type:b}:{mailconfig:C,recipient_list:E,email_type:b,template_id:I},T=Vl(zl(v));r(e,{...N,email:O,variables:T})},p=A.useMemo(()=>nt.debounce(()=>{a.submit()},500),[a]);A.useEffect(()=>()=>{p.cancel()},[p]);const g=[{key:"1",label:"Hành động",children:f.jsx(Hgt,{})},{key:"2",label:"Cài đặt",children:f.jsx(smt,{}),disabled:!c},{key:"3",label:"Kiểm thử",children:f.jsx(lmt,{}),disabled:!c},{key:"4",label:"Đầu ra",children:f.jsx(Wgt,{outputs:(y=u==null?void 0:u.data)==null?void 0:y.outputs,id:e}),disabled:!c}];return f.jsx("div",{className:Mgt,children:f.jsxs(R,{form:a,layout:"vertical",initialValues:{...i},onFinish:h,onValuesChange:p,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(Ir,{activeKey:s,onChange:l,items:g})]})})},umt=({id:e,data:t,mini:n})=>{var c;const{mode:r}=Xt(),{displayComponent:o}=Rn(),i=t.title||"Email",{optionMap:a}=af(e),s=A.useMemo(()=>{var u,d;return(d=(u=t==null?void 0:t.email)==null?void 0:u.recipient_list)==null?void 0:d.map((h,p)=>{if(h.match(Ra)){const y=ev(a,h),v=y?el(y,h):tv(h);if(v)return f.jsx(Tu,{showTooltip:!1,collapsed:!1,closable:!1,data:v,style:{marginBottom:4,display:"inline-flex"}},`var-${h}-${p}`)}return f.jsx(ms,{color:"blue",style:{marginBottom:4},children:h},`email-${h}-${p}`)})},[(c=t==null?void 0:t.email)==null?void 0:c.recipient_list,a]),l=u=>{const d=u.target;d!=null&&d.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(u.stopPropagation(),u.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(cmt,{id:e}),i,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx("div",{className:Ngt,onClick:l,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&l(u)},children:f.jsxs("div",{className:`${Ogt}`,children:[f.jsxs(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",justify:"flex-start",style:{width:"100%"},gap:12,children:[f.jsx("div",{className:Tgt,children:f.jsx(dE,{color:"#096DD9",variant:"Bold",size:24,className:kgt})}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:i})]}),f.jsx(Po,{id:e,data:t})]}),f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:16,children:f.jsx(ge.Text,{children:k7[t.type]})}),f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Email nhận"})}),f.jsx(at,{span:16,children:f.jsx(Ke,{style:{minWidth:0},children:f.jsx(ge.Paragraph,{ellipsis:{rows:1,expanded:!1,tooltip:{children:s,styles:{body:{width:"fit-content"}},showArrow:!1,color:"#FFF"}},style:{marginBottom:"unset"},children:f.jsx(ge.Text,{children:s})})})})]})]})})},dmt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(umt,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]});function fmt(e){return wr({attr:{viewBox:"0 0 488 512"},child:[{tag:"path",attr:{d:"M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z"},child:[]}]})(e)}function hmt(e){return wr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M480 128V96h20c6.627 0 12-5.373 12-12V44c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v20H64V44c0-6.627-5.373-12-12-12H12C5.373 32 0 37.373 0 44v40c0 6.627 5.373 12 12 12h20v320H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-20h384v20c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-20V128zM96 276V140c0-6.627 5.373-12 12-12h168c6.627 0 12 5.373 12 12v136c0 6.627-5.373 12-12 12H108c-6.627 0-12-5.373-12-12zm320 96c0 6.627-5.373 12-12 12H236c-6.627 0-12-5.373-12-12v-52h72c13.255 0 24-10.745 24-24v-72h84c6.627 0 12 5.373 12 12v136z"},child:[]}]})(e)}function pmt(e){return wr({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M288 248v28c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-28c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12zm-12 72H108c-6.6 0-12 5.4-12 12v28c0 6.6 5.4 12 12 12h168c6.6 0 12-5.4 12-12v-28c0-6.6-5.4-12-12-12zm108-188.1V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V48C0 21.5 21.5 0 48 0h204.1C264.8 0 277 5.1 286 14.1L369.9 98c9 8.9 14.1 21.2 14.1 33.9zm-128-80V128h76.1L256 51.9zM336 464V176H232c-13.3 0-24-10.7-24-24V48H48v416h288z"},child:[]}]})(e)}function gmt(e){return wr({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M527.9 224H480v-48c0-26.5-21.5-48-48-48H272l-64-64H48C21.5 64 0 85.5 0 112v288c0 26.5 21.5 48 48 48h400c16.5 0 31.9-8.5 40.7-22.6l79.9-128c20-31.9-3-73.4-40.7-73.4zM48 118c0-3.3 2.7-6 6-6h134.1l64 64H426c3.3 0 6 2.7 6 6v42H152c-16.8 0-32.4 8.8-41.1 23.2L48 351.4zm400 282H72l77.2-128H528z"},child:[]}]})(e)}function Xle(e){return Zn(n=>n.nodes.filter(r=>r.parentId===e))}const Zle=A.createContext([null,()=>{}]),mmt=({children:e})=>{const[t,n]=A.useState(null);return f.jsx(Zle.Provider,{value:[t,n],children:e})},kx=()=>A.useContext(Zle),Jle=A.createContext(null),vmt=({children:e})=>{const[t,n]=iu.useMessage();return f.jsxs(Jle.Provider,{value:t,children:[n,e]})},nb=()=>{const e=A.useContext(Jle);if(!e)throw new Error("useMessage must be used within a MessageProvider");return e};var ymt="scripts_editor_7lmk2x0",bmt="scripts_editor_7lmk2x1",Cmt="scripts_editor_7lmk2x4",Amt={default:"scripts_editor_7lmk2x5",dynamic:"scripts_editor_7lmk2x6"},Emt="scripts_editor_7lmk2x7",Smt="scripts_editor_7lmk2x9",wmt="scripts_editor_7lmk2xa",ece="scripts_editor_7lmk2xb",xmt="scripts_editor_7lmk2xc",Imt="scripts_editor_7lmk2xd",Nmt="scripts_editor_7lmk2xe";const Omt=({item:e})=>{var b;const{getViewport:t}=bn(),n=1/t().zoom,r=((b=e.id)==null?void 0:b.toString())||"condition-missing-id",o=qy(e),{attributes:i,listeners:a,setNodeRef:s,transform:l,isDragging:c,transition:u}=Qw({id:r,transition:null}),[d,h]=A.useState(!1),{Text:p}=ge,g=l?{x:l.x*n,y:l.y*n,scaleX:1,scaleY:1}:null,y={opacity:c?.4:void 0,transform:Zd.Translate.toString(g),transition:u},v=ip(e);return f.jsx("div",{ref:s,style:y,className:`${ymt} ${c?bmt:""}`,children:f.jsxs(fo,{size:"small",className:`nodrag nopan ${Cmt} ${Amt[v?"default":"dynamic"]} ${c?Emt:""}`,styles:{body:{padding:"2px 10px 2px 0",display:"flex",alignItems:"center"}},onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[f.jsx(yt,{type:"text",size:"small",className:`${Smt} ${d?wmt:""}`,...i,...a,children:f.jsx(zg,{className:ece})}),f.jsx(p,{className:xmt,children:e.label}),f.jsx(mn,{type:"source",position:Mt.Right,id:o,className:Imt})]})})},{Text:Tmt}=ge,kmt=({NODE_ID:e})=>{const{getNode:t}=bn(),{data:n}=t(e),{closeModal:r}=Rn(),o=b0(),i=n,{updateNode:a}=bn(),s=i.conditions||[],l=s.map(d=>{var h;return(h=d.id)==null?void 0:h.toString()}).filter(d=>!!d),c=Lw(Jd(Gm,{activationConstraint:{distance:8}}),Jd(Um,{coordinateGetter:Yw})),u=d=>{const{active:h,over:p}=d;if(!p||h.id===p.id)return;const g=s.findIndex(v=>{var b;return((b=v.id)==null?void 0:b.toString())===h.id}),y=s.findIndex(v=>{var b;return((b=v.id)==null?void 0:b.toString())===p.id});g===-1||y===-1||(a(e,v=>{const b=tf(s,g,y);return{...v,data:{...v.data,conditions:b}}}),requestAnimationFrame(()=>{o(e)}))};return f.jsx(fo,{className:Nmt,styles:{body:{padding:"4px"}},children:f.jsx(Ww,{sensors:c,collisionDetection:Bw,onDragStart:()=>{r()},onDragMove:()=>{requestAnimationFrame(()=>{o(e)})},onDragEnd:u,children:f.jsxs(Gw,{items:l,strategy:Uw,children:[f.jsx(Io,{isOpen:s.length===0,children:f.jsx(Tmt,{type:"secondary",children:"Không có ý định nào"})}),f.jsx(Io,{isOpen:s.length>0,children:f.jsx(Ke,{vertical:!0,gap:8,children:s.map(d=>f.jsx(Omt,{item:d},d.id))})})]})})})};var Mmt="scripts_editor_ao5dig0",tce="scripts_editor_ao5dig1",nce={default:"scripts_editor_ao5dig2",active:"scripts_editor_ao5dig3"},rce="scripts_editor_ao5dig5",oce="scripts_editor_ao5dig6",_mt="scripts_editor_ao5dig7",ice="scripts_editor_ao5dig8",$mt="scripts_editor_ao5diga",Pmt="scripts_editor_ao5digc scripts_editor_ao5digb",Dmt="scripts_editor_ao5digd scripts_editor_ao5digb";const ace=A.forwardRef(({dataSubmit:e,defaultValues:t,onFormSubmit:n},r)=>{const[o]=R.useForm();A.useEffect(()=>{t&&o.setFieldsValue({label:t.label,description:t.description,keywords:t.keywords,is_conversion:t.is_conversion})},[o,t]),A.useImperativeHandle(r,()=>({onSubmit:()=>{o.submit()}}));const i=a=>{e==null||e(a),n==null||n()};return f.jsxs(R,{preserve:!1,form:o,layout:"vertical",onFinish:i,children:[f.jsx(R.Item,{layout:"vertical",label:"Tên ý định",name:"label",rules:[{required:!0,message:"Vui lòng nhập dữ liệu"}],children:f.jsx(Nt,{placeholder:"Nhập tên ý định"})}),f.jsx(R.Item,{layout:"vertical",label:"Mô tả",name:"description",children:f.jsx(Nt.TextArea,{autoSize:{minRows:1,maxRows:6},placeholder:"Nhập mô tả ý định"})}),f.jsx(R.Item,{layout:"vertical",label:"Từ khóa",name:"keywords",children:f.jsx(Nt.TextArea,{autoSize:{minRows:1,maxRows:6},placeholder:"Nhập từ khóa, cách nhau bởi dấu phẩy"})}),f.jsx(R.Item,{label:null,name:"is_conversion",valuePropName:"checked",initialValue:!1,children:f.jsx(Fr,{children:"Đặt làm chuyển đổi"})})]})}),sce=A.createContext({attributes:{},listeners:void 0,ref(){}}),Lmt=({id:e,children:t,className:n,currentZoom:r=1})=>{const{attributes:o,isDragging:i,listeners:a,setNodeRef:s,setActivatorNodeRef:l,transform:c,transition:u}=Qw({id:e}),d=A.useMemo(()=>({attributes:o,listeners:a,ref:l}),[o,a,l]),h=c?{x:c.x*r,y:c.y*r,scaleX:1,scaleY:1}:null,p={opacity:i?.4:void 0,transform:Zd.Translate.toString(h),transition:u};return f.jsx(sce.Provider,{value:d,children:f.jsxs("div",{ref:s,className:n,style:p,children:[f.jsx(Bmt,{}),t]})})},Bmt=()=>{const{attributes:e,listeners:t,ref:n}=A.useContext(sce);return f.jsx(yt,{type:"text",size:"small",...e,...t,ref:n,children:f.jsx(zg,{className:ece})})},Fmt=()=>{const{setEdges:e,updateNode:t}=bn(),{nodeId:n}=Rn(),{context:r}=Xt(),o=Zl(),{mutate:i}=i_(),a=a_(),s=R.useFormInstance(),l=R.useWatch("conditions",s),[c,u]=A.useState(),d=A.useRef(null),h=(l??[]).map(b=>{var C;return(C=b.id)==null?void 0:C.toString()}).filter(b=>!!b),p=(b,C)=>{const S=s.getFieldValue("conditions")||[],E=S.find(N=>{var O;return((O=N.id)==null?void 0:O.toString())===b}),x={...Jw(C),id:b,slug:(E==null?void 0:E.slug)??C.slug},I=S.map(N=>{var O;return((O=N.id)==null?void 0:O.toString())===b?x:N});s.setFieldValue("conditions",I),t(n,N=>({...N,data:{...N.data,conditions:[...I]}})),i({SCENARIO_ID:r.CALLBOTSCENARIO_ID,INTENT_ID:b,label:C.label,description:C.description,keywords:C.keywords,is_conversion:C.is_conversion},{onSuccess:N=>{a({dataKey:"conditions",item:r_(N.data)}),o.invalidateQueries({queryKey:Zm(r.COMPANY_ID,r.CALLBOTSCENARIO_ID)}),o.invalidateQueries({queryKey:Xm(r.COMPANY_ID,r.CALLBOTSCENARIO_ID)})}})},g=b=>{const C=s.getFieldValue("conditions")||[],S=C.find(I=>{var N;return((N=I.id)==null?void 0:N.toString())===b}),E=S?qy(S):void 0,x=C.filter(I=>{var N;return((N=I.id)==null?void 0:N.toString())!==b});s.setFieldValue("conditions",x),E&&e(I=>I.filter(N=>N.sourceHandle!==E&&N.targetHandle!==E)),t(n,I=>({...I,data:{...I.data,conditions:[...x]}}))},y=Lw(Jd(Gm,{activationConstraint:{distance:8}}),Jd(Um,{coordinateGetter:Yw})),v=b=>{const{active:C,over:S}=b;if((C==null?void 0:C.id)!==(S==null?void 0:S.id)){const E=l.findIndex(I=>{var N;return((N=I.id)==null?void 0:N.toString())===(C==null?void 0:C.id)}),x=l.findIndex(I=>{var N;return((N=I.id)==null?void 0:N.toString())===(S==null?void 0:S.id)});s.setFieldValue("conditions",tf(l,E,x)),t(n,I=>{const N=tf(l,E,x);return{...I,data:{...I.data,conditions:N}}})}};return f.jsxs(f.Fragment,{children:[f.jsx(R.List,{name:"conditions",children:b=>nt.isEmpty(b)?f.jsx(ki,{}):null}),f.jsx(Ww,{sensors:y,collisionDetection:Bw,onDragEnd:v,children:f.jsx(Gw,{items:h,strategy:Uw,children:l==null?void 0:l.map(b=>{var C,S,E,x,I;return f.jsx(Lmt,{className:$mt,id:(C=b==null?void 0:b.id)==null?void 0:C.toString(),children:f.jsx(tu,{autoAdjustOverflow:!0,getPopupContainer:()=>document.body,styles:{body:{minWidth:350}},placement:"leftTop",content:f.jsx(ace,{ref:d,defaultValues:b,dataSubmit:N=>{var O;p(((O=b.id)==null?void 0:O.toString())||"",N)},onFormSubmit:()=>{nt.isEmpty(c)||u(null)}}),trigger:"click",open:c===((S=b==null?void 0:b.id)==null?void 0:S.toString())&&!ip(b),onOpenChange:N=>{var O,T;N?u((O=b.id)==null?void 0:O.toString()):((T=d.current)==null||T.onSubmit(),u(null))},children:f.jsxs(Ke,{onClick:N=>{var O;N.stopPropagation(),u((O=b==null?void 0:b.id)==null?void 0:O.toString())},align:"center",justify:"space-between",style:{flex:1},children:[f.jsx(ge.Text,{style:{marginBottom:0},children:b==null?void 0:b.label}),(x=(E=b==null?void 0:b.id)==null?void 0:E.toString())!=null&&x.includes("condition-default")&&!Uy(b)?null:f.jsx(yt,{type:"text",icon:f.jsx(uc,{}),onClick:()=>{var N;g(((N=b==null?void 0:b.id)==null?void 0:N.toString())||"")}})]})})},(I=b==null?void 0:b.id)==null?void 0:I.toString())})})})]})},jmt=240,zmt=16,lce=({children:e,isOuter:t,nodeId:n,containerRenderID:r,onToggleModal:o})=>{var V,U;const{closeModal:i}=Rn(),a=ph(),s=A.useRef(null),{isOpen:l,onToggle:c}=Eo(),{context:u}=Xt(),[d,h]=A.useState(!1),{token:p}=tE.useToken(),{getNode:g,updateNode:y}=bn(),{data:v,fetchNextPage:b,hasNextPage:C,isFetchingNextPage:S,isLoading:E}=Fae({SCENARIO_ID:u.CALLBOTSCENARIO_ID,pageSize:10,enabled:!!(u.COMPANY_ID&&u.CALLBOTSCENARIO_ID)}),x=A.useMemo(()=>(v==null?void 0:v.pages.flatMap(q=>q.data.results))??[],[v==null?void 0:v.pages]),I=Zl(),{mutateAsync:N}=s_(),O=(n?(U=(V=g(n))==null?void 0:V.data)==null?void 0:U.conditions:[])??[],T=O.some(q=>Qm(q)),M=O.some(q=>Rm(q)),_=A.useCallback(q=>{const W=Qm(q)?ex():Rm(q)?tx():Jw(q);if(n&&y(n,G=>({...G,data:{...G.data,conditions:Ym(G.data.conditions??[],W)}})),t)return;const H=a.getFieldValue("conditions")||[],K=Ym(H,W);a.setFieldValue("conditions",K)},[a,t,n,y]),L=A.useCallback(()=>{h(!1),c(),o==null||o(!l)},[c,o,l]),P=A.useCallback(q=>{_(q),h(!1)},[_]),$=A.useMemo(()=>[...x.filter(W=>!Uy(W)).map((W,H)=>{var K;return{key:((K=W.id)==null?void 0:K.toString())??`intent-${H}`,label:W.label??W.slug??"Ý định không tên",onClick:()=>P(W)}}),{key:"default-silence-intent",label:"Im lặng",disabled:T,onClick:T?void 0:()=>P({label:Go.SILENT.label})},{key:"default-noresponse-intent",label:Go.NORESPONSE.label,disabled:M,onClick:M?void 0:()=>P({label:Go.NORESPONSE.label})}],[P,M,T,x]),B=A.useCallback(async q=>{const W=q.currentTarget;W.scrollTop+W.clientHeight>=W.scrollHeight-zmt&&C&&!S&&await b()},[b,C,S]),D=q=>{h(q),q&&t&&i()},F=A.useCallback(()=>document.getElementById(r)||document.body,[r]),z=async q=>{const W=await N({...q,SCENARIO_ID:u.CALLBOTSCENARIO_ID});await Promise.all([I.invalidateQueries({queryKey:Zm(u.COMPANY_ID,u.CALLBOTSCENARIO_ID)}),I.invalidateQueries({queryKey:Xm(u.COMPANY_ID,u.CALLBOTSCENARIO_ID)})]),_(W.data),L()};return f.jsxs(f.Fragment,{children:[f.jsx(Fs,{open:d,menu:{items:$},placement:"bottomRight",trigger:["click"],onOpenChange:D,popupRender:q=>f.jsxs("div",{style:{backgroundColor:p.colorBgElevated,borderRadius:p.borderRadiusLG,boxShadow:p.boxShadowSecondary,minWidth:220},children:[f.jsxs("div",{style:{maxHeight:jmt,overflowY:"auto"},onScroll:B,children:[$.length>0?A.cloneElement(q,{style:{borderRadius:0}}):f.jsx("div",{style:{padding:8},children:f.jsx(ki,{image:ki.PRESENTED_IMAGE_SIMPLE,description:"Chưa có ý định"})}),(E||S)&&f.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"8px 0"},children:f.jsx(ou,{size:"small"})})]}),f.jsx(ia,{style:{margin:0}}),f.jsx(yt,{type:"text",block:!0,icon:f.jsx(y1,{}),onClick:L,children:"Mới"})]}),children:e}),f.jsx(to,{open:l,closeIcon:null,width:400,destroyOnHidden:!0,maskClosable:!1,mask:!1,getContainer:F,footer:[f.jsx(yt,{onClick:L,children:"Hủy"},"cancel"),f.jsx(yt,{type:"primary",onClick:()=>{var q;(q=s.current)==null||q.onSubmit()},children:"Lưu"},"submit")],children:f.jsx(ace,{ref:s,dataSubmit:q=>{z(q)},onFormSubmit:()=>{}})})]})},{Text:cce}=ge,Vmt={validator:(e,t)=>t==null||t===""||Number(t)>=1?Promise.resolve():Promise.reject(new Error("Giá trị phải lớn hơn hoặc bằng 1"))},Hmt={validator:(e,t)=>t==null||t===""||Number(t)>=2?Promise.resolve():Promise.reject(new Error("Giá trị phải lớn hơn hoặc bằng 2"))},uce=({id:e})=>{const{getEdges:t,setEdges:n}=bn(),r=Cr(),{data:o}=Nh(e),i=o,a=A.useId(),[s,l]=A.useState(!1),[c]=R.useForm(),u=p=>{r(e,p)},d=A.useMemo(()=>nt.debounce(()=>{c.submit()},500),[c]);A.useEffect(()=>()=>{d.cancel()},[d]),lE(()=>{!c.isFieldsTouched()&&i.conditions&&c.setFieldsValue(i)},[i.conditions]);const h=p=>{if(t().some(b=>b.target===e))return;const y=c.getFieldValue("conditions")||[];if(p){const{removedDefaultConditions:b,nextConditions:C}=Nae(y),S=Oae(b);S!=null&&S.length&&n(E=>E.filter(x=>!S.includes(x.targetHandle||"")&&!S.includes(x.sourceHandle||""))),c.setFieldsValue({conditions:C}),r(e,{...i,conditions:C});return}const v=Tae(y,()=>{const b=`condition-default-${kl()}`;return{id:b,slug:b,is_conversion:!1,...Go.DEFAULT}},ex,tx);v.length!==y.length&&(c.setFieldsValue({conditions:v}),r(e,{...i,conditions:v}))};return f.jsxs("div",{style:{height:"100%"},children:[f.jsx(R,{form:c,layout:"horizontal",initialValues:{...i},onFinish:u,onValuesChange:d,children:f.jsxs(Cn,{direction:"vertical",size:"small",style:{width:"100%"},children:[f.jsx("div",{style:{width:"100%"},children:f.jsx(ch,{block:!0,size:"middle",style:{width:"100%"},options:[{label:f.jsxs(Ke,{align:"center",gap:12,justify:"center",children:[f.jsx(VO,{size:12}),"Ý định"]}),value:du.INTENT},{label:f.jsxs(Ke,{align:"center",gap:12,justify:"center",children:[f.jsx(BY,{size:12}),"Nhận diện biến"]}),value:du.VARIABLE}]})}),f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[f.jsx(ge.Title,{level:5,style:{marginTop:"unset"},children:"Ý định"}),f.jsx(lce,{onToggleModal:p=>{l(p)},nodeId:e,containerRenderID:a,children:f.jsx(yt,{size:"small",type:"primary",icon:f.jsx(si,{})})})]}),f.jsx(Fmt,{}),f.jsx(ia,{style:{margin:"12px 0"}}),f.jsxs(Cn,{direction:"vertical",size:16,style:{width:"100%"},children:[f.jsx(ge.Title,{level:5,style:{marginTop:"unset"},children:"Cấu hình"}),f.jsx(R.Item,{rules:[{required:!0,message:"Vui lòng nhập thời gian nghe tối đa"},Hmt],name:"maximum_listentime",children:f.jsx(Nt,{addonBefore:"Thời gian nghe tối đa",type:"number",min:2,addonAfter:"giây",style:{width:"100%"}})}),f.jsx(R.Item,{rules:[{required:!0,message:"Vui lòng nhập số lần kích hoạt tối đa"},Vmt],name:"maximum_retry",children:f.jsx(Nt,{addonBefore:"Kích hoạt mỗi TH tối đa",type:"number",min:1,addonAfter:"lần",style:{width:"100%"}})}),f.jsx(R.Item,{name:"is_global_node",valuePropName:"checked",style:{marginBottom:0},labelCol:{span:21},labelAlign:"left",label:f.jsx(pr,{title:`Cho phép node này được kích hoạt tại bất cứ thời điểm nào
771
+ `,dpt=({hasInitialFilter:e=!1})=>{const{emit:t}=eb(),{data:n,isLoading:r}=Cx(),o=R.useFormInstance(),i=R.useWatch("type",o),a=R.useWatch(["settings","user"],o)||[],s=R.useWatch(["settings","strategy"],o),l=R.useWatch("groups",o),c=A.useMemo(()=>(l==null?void 0:l.some(h=>{var p;return(p=h==null?void 0:h.conditions)==null?void 0:p.some(g=>!nt.isEmpty(g))}))??!1,[l]),[u,d]=A.useState(e||c);return A.useEffect(()=>{(e||c)&&d(!0)},[c,e]),f.jsxs(f.Fragment,{children:[f.jsx(ge.Paragraph,{strong:!0,children:"Chọn liên hệ"}),f.jsxs(Nn,{children:[f.jsx(at,{span:22,children:f.jsx(R.Item,{label:null,name:"id",children:f.jsx(Jy,{placeholder:"Chọn nguồn dữ liệu liên hệ",disabledModes:i===kle.ASSIGN_ONE?[qr[0]]:[qr[1]],nodeFilter:h=>h.node_type===be.ACTION_CONTACT||h.node_type===be.CONTACT_ASSIGN||h.node_type===be.TRIGGER_CONTACT})})}),f.jsx(at,{span:2,className:wht,children:f.jsx(EY,{style:{cursor:"pointer"},size:"24",color:"#1890FF",variant:u?"Bold":"Linear",onClick:()=>d(h=>!h)})})]}),f.jsx(h8,{initial:!1,children:u?f.jsx(Py.div,{initial:{opacity:0,height:0,y:-8},animate:{opacity:1,height:"auto",y:0},exit:{opacity:0,height:0,y:-8},transition:{duration:.18,ease:"easeOut"},style:{overflow:"hidden"},children:f.jsx(ha,{model:"contact"})}):null}),f.jsx(ge.Paragraph,{strong:!0,children:"Cơ chế phân công nhân viên"}),f.jsx(R.Item,{label:null,name:["settings","strategy"],initialValue:lv.SEQUENCE,children:f.jsx(In,{options:apt.map(h=>({label:w7[h],value:h}))})}),f.jsx(R.Item,{label:null,name:["settings","user"],children:f.jsx(cpt,{mode:"multiple",placeholder:"Chọn nhân viên"})}),a.length>0&&f.jsxs(ou,{spinning:r,children:[f.jsxs(Ke,{align:"center",justify:"space-between",children:[f.jsx(ge.Paragraph,{strong:!0,children:"Nhân viên được phân công"}),s===lv.WEIGHTED&&f.jsx(ge.Paragraph,{strong:!0,children:"Hệ số"})]}),f.jsx(R.Item,{noStyle:!0,shouldUpdate:(h,p)=>{var g,y,v,b;return((g=h.settings)==null?void 0:g.user)!==((y=p.settings)==null?void 0:y.user)||((v=h.settings)==null?void 0:v.strategy)!==((b=p.settings)==null?void 0:b.strategy)},children:({getFieldValue:h,setFieldValue:p})=>{const g=h(["settings","assignees"])||[],y=a.map(v=>{const b=g.find(C=>C.profile_company_id===v);return b??{profile_company_id:v,weight:s===lv.WEIGHTED?(b==null?void 0:b.weight)??1:void 0}});return p(["settings","assignees"],y),f.jsx(R.List,{name:["settings","assignees"],children:v=>f.jsx(f.Fragment,{children:v.map(b=>{var x;const C=h(["settings","assignees",b.name,"profile_company_id"]),S=s===lv.SEQUENCE,E=(x=n==null?void 0:n.data)==null?void 0:x.find(I=>I.id===C);return f.jsxs(Nn,{gutter:12,children:[f.jsx(R.Item,{name:[b.name,"profile_company_id"],hidden:!0}),f.jsx(at,{span:S?24:18,children:f.jsx("div",{className:Aht,children:f.jsx(Yy,{label:(E==null?void 0:E.full_name)??(E==null?void 0:E.email),avatar:E==null?void 0:E.avatar})})}),f.jsx(at,{span:S?0:6,children:f.jsx(R.Item,{style:{marginBottom:0},name:[b.name,"weight"],initialValue:1,rules:[{required:!0,message:"Vui lòng nhập hệ số"}],children:f.jsx(ci,{style:{width:"100%"},min:1})})})]},b.key)})})})}})]}),f.jsxs(upt,{children:[f.jsx(ge.Paragraph,{strong:!0,children:"Điều kiện nhân viên không được chia lead"}),f.jsx(R.Item,{label:null,name:["settings","constraints","within_working_hours"],valuePropName:"checked",children:f.jsx(Fr,{children:"Chỉ chia trong giờ làm việc"})}),f.jsxs(Ke,{align:"center",justify:"space-between",style:{marginBottom:12},children:[f.jsx(R.Item,{label:null,noStyle:!0,name:["settings","constraints","exclude_off_shift"],valuePropName:"checked",children:f.jsx(Fr,{children:"Chỉ chia cho nhân viên có ca làm việc"})}),f.jsx(yt,{icon:f.jsx(q2,{}),iconPosition:"end",type:"link",style:{padding:"unset"},onClick:()=>t("openWorkShiftSettingPage",{}),children:"Ca làm việc"})]}),f.jsx(R.Item,{label:null,name:["settings","constraints","reassign_if_has_owner"],valuePropName:"checked",children:f.jsx(Fr,{children:"Chia cả khi liên hệ đã có nhân viên phụ trách"})}),f.jsxs(Ke,{align:"center",gap:4,style:{marginBottom:12},children:[f.jsx(R.Item,{noStyle:!0,label:null,name:["settings","constraints","exclude_compensation_for_unassigned"],valuePropName:"checked",children:f.jsx(zi,{size:"small"})}),f.jsx(ge.Text,{children:"Chia bù cho nhân viên không được chia lead"})]})]})]})},fpt=({id:e})=>{var y,v;const{getNode:t}=bn(),n=Cr(),{data:r}=t(e),o=r,[i]=R.useForm(),[a,s]=A.useState("1"),l=R.useWatch("type",i);vo({form:i,type:l,getResetValues:()=>em[be.CONTACT_ASSIGN]});const c=((y=o==null?void 0:o.groups)==null?void 0:y.some(b=>{var C;return(C=b==null?void 0:b.conditions)==null?void 0:C.some(S=>!nt.isEmpty(S))}))??!1,{data:u}=Zo({type:be.CONTACT_ASSIGN,action:l??""});A.useEffect(()=>{var b,C;n(e,{output:((C=(b=u==null?void 0:u.data)==null?void 0:b.outputs)==null?void 0:C.map(S=>{var E;return{...S,object:e,node_type:be.CONTACT_ASSIGN,order:o==null?void 0:o.order,output_mode:((E=u==null?void 0:u.data)==null?void 0:E.output_mode)??[]}}))||[]})},[u==null?void 0:u.data,o==null?void 0:o.order,e,n]),A.useEffect(()=>{l&&s("2")},[l]);const d=A.useRef(!0);A.useEffect(()=>{var b,C,S,E,x;if(d.current){const I=nt.cloneDeep(o),N=Cs(I==null?void 0:I.object,(I==null?void 0:I.groups)??[],(I==null?void 0:I.filter_type)??"AND");i.setFieldsValue({...I,...N,settings:{...I==null?void 0:I.settings,user:((C=(b=I==null?void 0:I.settings)==null?void 0:b.assignees)==null?void 0:C.map(O=>O.profile_company_id))||[],constraints:{...(S=I==null?void 0:I.settings)==null?void 0:S.constraints,exclude_compensation_for_unassigned:!((x=(E=I==null?void 0:I.settings)==null?void 0:E.constraints)!=null&&x.exclude_compensation_for_unassigned)}}}),d.current=!1}},[o,i]);const h=b=>{var E;const C=Vl(zl(b)),S=Js(((b==null?void 0:b.groups)??[]).map(x=>{var I;return{...x,conditions:(I=x==null?void 0:x.conditions)==null?void 0:I.filter(N=>!nt.isEmpty(N))}}));"user"in b.settings&&delete b.settings.user,b.settings.strategy===lv.SEQUENCE&&(b.settings.assignees=(E=b.settings.assignees)==null?void 0:E.map(x=>({...x,weight:void 0}))),b.settings.constraints.exclude_compensation_for_unassigned=!b.settings.constraints.exclude_compensation_for_unassigned,n(e,{...b,groups:S,variables:C})},p=A.useMemo(()=>nt.debounce(()=>{i.submit()},500),[i]);A.useEffect(()=>()=>{p.cancel()},[p]);const g=[{key:"1",label:"Hành động",children:f.jsx(spt,{})},{key:"2",label:"Cài đặt",children:f.jsx(dpt,{hasInitialFilter:c})},{key:"3",label:"Đầu ra",children:f.jsx(lpt,{outputs:(v=u==null?void 0:u.data)==null?void 0:v.outputs,id:e})}];return f.jsx("div",{className:h7,children:f.jsxs(R,{form:i,layout:"vertical",initialValues:{...o},onFinish:h,onValuesChange:p,children:[f.jsx(R.Item,{hidden:!0,name:["title"]}),f.jsx(Ir,{activeKey:a,onChange:s,items:g})]})})},hpt=({id:e,data:t,mini:n})=>{var l;const{mode:r}=Xt(),{displayComponent:o}=Rn(),i=t.title||"Liên hệ",a=A.useRef(Object.fromEntries(Mle.map(({suffix:c})=>[c,`${e}_${c}`]))),s=c=>{const u=c.target;u!=null&&u.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(c.stopPropagation(),c.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(fpt,{id:e}),i,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx("div",{className:c7,onClick:s,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&s(c)},children:f.jsxs("div",{className:`${u7}`,children:[f.jsxs(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",justify:"flex-start",style:{width:"100%"},gap:12,children:[f.jsx("div",{className:d7,children:f.jsx(Ad,{className:f7})}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:i})]}),f.jsx(Po,{id:e,data:t})]}),f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:16,children:S7[t.type]}),f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Quy tắc"})}),f.jsx(at,{span:16,children:w7[(l=t==null?void 0:t.settings)==null?void 0:l.strategy]}),f.jsx(at,{span:24,children:f.jsx(Ke,{vertical:!0,gap:8,align:"flex-end",style:{width:"100%"},children:f.jsx(Ke,{className:Eht,children:Mle.map(c=>f.jsxs("div",{className:Sht,children:[f.jsx(ge.Text,{children:c.label}),f.jsx(mn,{id:a.current[c.suffix],type:"source",position:Mt.Right,style:{right:-14,top:"50%"}})]},c.suffix))})})})]})]})})},ppt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(hpt,{id:t,data:e})]}),gpt=({id:e,outputs:t})=>{const n=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t).map(r=>({...r,icon:()=>{var i;const o=so[((i=r.meta)==null?void 0:i.iconType)??""]??null;return o?f.jsx(o,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:n})},xx=({dataDefault:e,modal:t,propertyType:n,...r})=>{const[o,i]=A.useState([]),{data:a,isLoading:s}=E7({currentFilters:{app_model:t,raw:!0}});A.useEffect(()=>{let c=[...e?nt.isArray(e)?e:[e]:[],...(a==null?void 0:a.data)||[]];const u=n?new Set(n):null;u&&(c=nt.filter(c,({variant_config:h})=>u.has(h)));const d=nt.uniqBy(c,"id");i(d)},[a==null?void 0:a.data,e,n]);const l=A.useMemo(()=>o.map(c=>({value:c.id,label:c.name,key:c.id,data:c})),[o]);return f.jsx(In,{options:l,allowClear:!0,filterOption:!1,loading:s,placeholder:"Chọn thuộc tính",style:{width:"100%"},...r})};var Hl=(e=>(e.CREATED="created",e.UPDATED="updated",e.UPDATED_BY_CONDITION="updated_by_condition",e.DELETED="deleted",e.TIME="TIME",e))(Hl||{}),cv=(e=>(e.SAME_DAY="SAME_DAY",e.BEFORE="BEFORE",e.AFTER="AFTER",e))(cv||{}),kc=(e=>(e.AT_EVENT="AT_EVENT",e.BEFORE_EVENT="BEFORE_EVENT",e.AFTER_EVENT="AFTER_EVENT",e.FIXED_TIME="FIXED_TIME",e))(kc||{});const Ix={created:"Liên hệ mới được tạo",updated_by_condition:"Liên hệ được cập nhật",updated:"Liên hệ cập nhật thoả mãn điều kiện",deleted:"Liên hệ bị xóa",TIME:"Tại thời điểm của 1 trường dữ liệu"},_le={created:"Khi có liên hệ mới được tạo",updated_by_condition:"Khi cập nhật một số trường dữ liệu của liên hệ",updated:"Khi Liên hệ được cập nhật thoả mãn điều kiện",deleted:"Khi có liên hệ bị xóa",TIME:"Kích hoạt theo thời gian đã định"},$le=nt.keys(Ix),x7={SAME_DAY:"Ngày diễn ra sự kiện",BEFORE:"Trước ngày diễn ra sự kiện",AFTER:"Sau ngày diễn ra sự kiện"},mpt=nt.keys(x7),Ple={AT_EVENT:"Thời gian sự kiện",BEFORE_EVENT:"Trước sự kiện",AFTER_EVENT:"Sau sự kiện",FIXED_TIME:"Thời gian cố định"},vpt=nt.keys(Ple),ypt=[...Cc,...xd,...Id,...wd,...hu].reduce((e,t)=>(e[t.value]=t.label,e),{}),Nx=e=>{if(e!=null){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(e&&typeof e=="object"&&"title"in e)return e.title;if(e&&typeof e=="object"&&"label"in e)return e.label;if(e&&typeof e=="object"&&"name"in e)return e.name}},bpt=e=>[Bn.singleoption,Bn.multioption,Bn.optiongroup,$n.singleoptionproperty,$n.multioptionproperty].includes(e),Cpt=(e,t)=>{var i;const r=(((i=t==null?void 0:t.settings)==null?void 0:i.options)??[]).reduce((a,s)=>{const l=s.id??s.value;return l&&(a[String(l)]=Nx(s)??s.value??s.id),a},{}),o=a=>{const s=Nx(a),l=typeof a=="object"&&a!==null&&"value"in a?a.value:a;return typeof s=="string"&&s!==l?s:typeof l=="string"||typeof l=="number"||typeof l=="boolean"?r[String(l)]??s:s};return Array.isArray(e)?e.map(o).filter(Boolean).join(", "):o(e)},Apt=(e,t)=>{const n=(t==null?void 0:t.variant)||(t==null?void 0:t.variant_config);if(bpt(n))return Cpt(e,t);if(e!=null)return typeof e=="string"?e:Array.isArray(e)?e.map(r=>Nx(r)).filter(Boolean).join(", "):Nx(e)},Ept=e=>[$n.dateproperty,Bn.date,Bn.datetime].includes(e)?xd:[$n.integerproperty,$n.floatproperty,Bn.integer,Bn.float,Bn.percentage,Bn.duration].includes(e)?wd:[$n.fileproperty,Bn.file].includes(e)?Id:Cc,Dle=e=>(e??"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),I7=e=>{if(typeof e=="string")return e;if(e&&typeof e=="object"&&"value"in e)return e.value;if(e&&typeof e=="object"&&"id"in e)return e.id},Lle=e=>(e==null?void 0:e.flatMap(t=>t.conditions??[]))??[],Spt=(e=[])=>e.reduce((t,n)=>{var o;const r=I7(n.property);return r&&(t[r]={operator:n.operator,value:n.value,titleValue:(o=n.title)==null?void 0:o.value}),t},{}),Ble=e=>Spt(Lle(e)),Fle=e=>Lle(e).map(t=>I7(t.property)).filter(Boolean),jle=(e,t="contact")=>{const n=Array.isArray(e)?e:[],r=n.flatMap(i=>Array.isArray(i.conditions)?i.conditions.filter(a=>!nt.isEmpty(a)):[]),o=n[0];return[{object:(o==null?void 0:o.object)??t,filter_type:(o==null?void 0:o.filter_type)??"OR",conditions:r}]},wpt=e=>e==null||e===""?!1:Array.isArray(e)?e.length>0:!0,xpt=(e,t,n,r,o="contact")=>{const i=new Set(n),a=t.map(s=>{const l=e.find(y=>y.id===s),c=r[s],u=(l==null?void 0:l.variant)||(l==null?void 0:l.variant_config),d=i.has(s),h=c==null?void 0:c.operator,p=d&&h&&(zle(h)||wpt(c==null?void 0:c.value)),g=p?h:"VALUABLE";return l?{property:l.id,slug:l.slug,type:u,operator:g,title:{label:l.name,operator:ypt[g]??g,value:p?Apt((c==null?void 0:c.titleValue)??(c==null?void 0:c.value),l):void 0},...p?{value:c==null?void 0:c.value}:{}}:null}).filter(Boolean);return[{object:o,filter_type:"OR",conditions:a}]},zle=e=>e==="VALUABLE"||e==="EMPTY",Ipt={changeFieldIds:"change_field_ids",conditionValues:"condition_values",groups:"groups",condition:"condition"},Vle=e=>{if(!(!e||typeof e!="object")){if("title"in e&&typeof e.title=="string")return e.title;if("rawLabel"in e&&typeof e.rawLabel=="string")return e.rawLabel;if("label"in e&&typeof e.label=="string")return e.label}},Npt=e=>{if(Array.isArray(e)){const n=e.map(Vle).filter(Boolean);return n.length?n:void 0}const t=Vle(e);if(t)return t},Hle=({model:e,object:t=e,title:n,searchPlaceholder:r="Tìm kiếm thuộc tính",emptyText:o="Không tìm thấy thuộc tính",conditionText:i="sau khi cập nhật",addConditionText:a="Thêm điều kiện",removeConditionText:s="Xóa điều kiện",fieldNames:l})=>{const c=R.useFormInstance(),u={...Ipt,...l},[d,h]=A.useState(""),[p,g]=A.useState(()=>{var T;const N=c.getFieldValue(u.groups);return(N!=null&&N.length?N.flatMap(M=>M.conditions??[]):((T=c.getFieldValue(u.condition))==null?void 0:T.conditions)??[]).map(M=>I7(M.property)).filter(Boolean)}),{data:y,isLoading:v}=E7({currentFilters:{app_model:e,raw:!0}}),b=A.useMemo(()=>nt.orderBy(((y==null?void 0:y.data)??[]).filter(N=>N.allow_in_form),["order_default"],["asc"]),[y==null?void 0:y.data]),C=A.useMemo(()=>{const N=Dle(d.trim());return N?b.filter(O=>Dle(O.name).includes(N)):b},[b,d]),S=R.useWatch(u.changeFieldIds,c)??[],E=R.useWatch(u.conditionValues,c)??{};A.useEffect(()=>{v||(c.setFieldValue(u.groups,xpt(b,S,p,E,t)),c.submit())},[p,E,c,v,t,b,u.groups,S]);const x=N=>{const O=c.getFieldValue(u.conditionValues)??{};c.setFieldValue(u.conditionValues,{...O,[N]:void 0}),g(T=>T.filter(M=>M!==N))},I=N=>{var T,M,_;const O=c.getFieldValue(u.conditionValues)??{};c.setFieldValue(u.conditionValues,{...O,[N]:{operator:((T=O[N])==null?void 0:T.operator)||"EQUAL",value:(M=O[N])==null?void 0:M.value,titleValue:(_=O[N])==null?void 0:_.titleValue}}),g(L=>L.includes(N)?L:[...L,N])};return f.jsxs(Ke,{vertical:!0,gap:16,children:[f.jsx(Ke,{align:"center",justify:"space-between",children:f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:n})}),f.jsx(Nt.Search,{allowClear:!0,placeholder:r,value:d,onChange:N=>h(N.target.value),onSearch:h}),f.jsx(ou,{spinning:v,children:f.jsx(R.Item,{name:u.changeFieldIds,initialValue:[],noStyle:!0,children:f.jsx(Fr.Group,{style:{width:"100%"},children:f.jsxs(Ke,{vertical:!0,gap:14,style:{width:"100%"},children:[C.length===0&&!v?f.jsx(ge.Text,{type:"secondary",children:o}):null,C.map(N=>{var B;const O=N.id??"",T=S.includes(O),M=p.includes(O),_=N.variant||N.variant_config,L=Ept(_),P=((B=E[O])==null?void 0:B.operator)||"EQUAL",$=zle(P);return f.jsxs(Ke,{vertical:!0,gap:8,children:[f.jsxs(Ke,{align:"center",justify:"space-between",gap:8,children:[f.jsxs(Ke,{align:"center",gap:8,children:[f.jsx(Fr,{value:O,disabled:v,children:N.name}),T&&M&&f.jsx(ge.Text,{type:"secondary",children:i})]}),T&&!M&&f.jsx(yt,{type:"link",icon:f.jsx(si,{}),onClick:()=>I(O),children:a})]}),T&&M&&f.jsxs(Ke,{align:"baseline",gap:8,style:{paddingLeft:26},children:[f.jsx(R.Item,{name:[u.conditionValues,O,"operator"],initialValue:"EQUAL",children:f.jsx(In,{options:L,onChange:()=>{c.setFieldValue([u.conditionValues,O,"value"],void 0),c.setFieldValue([u.conditionValues,O,"titleValue"],void 0)}})}),f.jsx("div",{style:{flex:1},children:$?f.jsx(R.Item,{name:[u.conditionValues,O,"value"],children:f.jsx(In,{disabled:!0,placeholder:"Chọn giá trị",options:[]})}):f.jsx(yle,{property:N,name:[u.conditionValues,O,"value"],operator:P,onValueChange:(D,F)=>{c.setFieldValue([u.conditionValues,O,"titleValue"],Npt(F))}})}),f.jsx(yt,{type:"text","aria-label":s,title:s,icon:f.jsx(ds,{}),onClick:()=>x(O)})]})]},O)})]})})})})]})},Opt=()=>f.jsx(Hle,{model:"contact",object:"contact",title:"Liên hệ được cập nhật một trong các trường:"}),Tpt=()=>f.jsx(R.Item,{shouldUpdate:(e,t)=>e.type!==t.type,noStyle:!0,children:({getFieldValue:e})=>{const t=e("type");if(t===Hl.TIME)return f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Trường dữ liệu thời gian"}),name:"time_field",getValueProps:r=>({value:r==null?void 0:r.id,dataDefault:r}),getValueFromEvent:(r,o)=>{var i;return(i=Array.isArray(o)?o[0]:o)==null?void 0:i.data},children:f.jsx(xx,{modal:"contact",propertyType:[Bn.date,Bn.datetime]})}),f.jsx(ge.Paragraph,{style:{marginBottom:"8px"},strong:!0,children:"Thời gian kích hoạt"}),f.jsx(R.Item,{shouldUpdate:(r,o)=>r.date_config_value!==o.date_config_value,noStyle:!0,children:({getFieldValue:r})=>{const i=(r("date_config_value")??cv.SAME_DAY)!==cv.SAME_DAY;return f.jsxs(Nn,{gutter:12,style:{alignItems:"baseline"},children:[f.jsx(at,{span:3,children:f.jsx(R.Item,{label:"Ngày",labelCol:{span:24},wrapperCol:{span:0}})}),f.jsx(at,{span:i?12:21,children:f.jsx(R.Item,{name:"date_config_value",initialValue:cv.SAME_DAY,children:f.jsx(In,{options:mpt.map(a=>({value:a,label:x7[a],key:a})),placeholder:"Thời gian kích hoạt"})})}),i&&f.jsx(at,{span:9,children:f.jsx(R.Item,{name:"date_config_offset",initialValue:1,children:f.jsx(ci,{min:1,style:{width:"100%"},suffix:"Ngày",controls:!1})})})]})}}),f.jsx(R.Item,{shouldUpdate:(r,o)=>r.time_config_value!==o.time_config_value||r.time_field!==o.time_field,noStyle:!0,children:({getFieldValue:r})=>{const o=r("time_config_value")??kc.BEFORE_EVENT,i=r("time_field"),a=o!==kc.AT_EVENT;return f.jsxs(Nn,{gutter:12,style:{alignItems:"baseline"},children:[f.jsx(at,{span:3,children:f.jsx(R.Item,{label:"Giờ",labelCol:{span:24},wrapperCol:{span:0}})}),f.jsx(at,{span:(i==null?void 0:i.variant_config)===Bn.date?0:a?12:21,children:f.jsx(R.Item,{name:"time_config_value",initialValue:kc.BEFORE_EVENT,children:f.jsx(In,{options:vpt.map(s=>({value:s,label:Ple[s],key:s}))})})}),(a||(i==null?void 0:i.variant_config)===Bn.date||(i==null?void 0:i.variant_config)===Bn.datetime)&&f.jsx(at,{span:(i==null?void 0:i.variant_config)===Bn.date?21:a?9:0,children:f.jsx(R.Item,{noStyle:!0,shouldUpdate:(s,l)=>s.time_config_value!==l.time_config_value,children:({getFieldValue:s})=>s("time_config_value")===kc.FIXED_TIME||(i==null?void 0:i.variant_config)===Bn.date?f.jsx(R.Item,{name:"time_config_fixed_time",initialValue:Un("08:30",lo),children:f.jsx(cu,{style:{width:"100%"},placeholder:"Chọn giờ",format:lo,minuteStep:5,allowClear:!1})}):f.jsxs(Cn.Compact,{block:!0,children:[f.jsx(R.Item,{name:"time_config_offset",initialValue:10,children:f.jsx(ci,{style:{width:"100%"},min:1,controls:!1})}),f.jsx(R.Item,{name:"time_config_offset_unit",initialValue:"MINUTES",children:f.jsx(In,{options:[{label:"Giờ",value:"HOURS"},{label:"Phút",value:"MINUTES"}]})})]})})})]})}})]});if(t===Hl.UPDATED_BY_CONDITION)return f.jsx(Opt,{});let n="";return t===Hl.CREATED?n="Liên hệ mới đáp ứng các điều kiện sau":t===Hl.DELETED?n="Liên hệ bị xóa thoả mãn":t===Hl.UPDATED&&(n="Liên hệ sau khi cập nhật thoả mãn"),f.jsxs(f.Fragment,{children:[f.jsxs(ge.Title,{level:5,style:{margin:"unset"},children:["Kích hoạt khi ",n,":"]}),f.jsx(ha,{model:"contact"})]})}}),kpt=()=>{const e=R.useFormInstance(),t=R.useWatch("type",e),[n,r]=A.useState(""),o=A.useMemo(()=>{const i=n.trim().toLowerCase();return i?$le.filter(a=>{const s=Ix[a].toLowerCase(),l=_le[a].toLowerCase();return s.includes(i)||l.includes(i)}):$le},[n]);return f.jsxs("div",{children:[f.jsx(Nt.Search,{placeholder:"Tìm kiếm hành động trigger",allowClear:!0,onChange:i=>r(i.target.value),onSearch:r,style:{marginBottom:12}}),f.jsx(R.Item,{name:"type",label:null,children:f.jsx(ln.Group,{className:p7,children:f.jsx(Cn,{direction:"vertical",className:g7,size:12,children:o.map(i=>f.jsxs(ln,{value:i,className:m7,children:[f.jsxs("div",{className:v7,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:Ix[i]}),f.jsx(ge.Text,{type:"secondary",children:_le[i]})]}),t===i&&f.jsxs("div",{className:y7,children:[f.jsx("div",{className:b7}),f.jsx(Wr,{className:C7})]})]},i))})})})]})},Mpt=e=>{var t;if(e.type===Hl.UPDATED_BY_CONDITION){if((t=e.groups)!=null&&t.length)return e.groups;if(e.condition)return[e.condition]}},_pt=e=>{var l;const t={...e},{change_field_id:n,...r}=t,o=Cs(t.object??"",t.groups??[],t.filter_type??"AND"),i=Mpt(t),a=t.date_config,s=t.time_config;return{...r,...i?{filter_type:((l=i[0])==null?void 0:l.filter_type)??"AND",groups:i}:o,condition:void 0,change_field_ids:t.type===Hl.UPDATED_BY_CONDITION?t.change_field_ids??Fle(i):void 0,condition_values:Ble(i),time_field:{id:t.time_field,name:t.time_field_name,slug:t.time_field_slug,variant_config:t.time_field_type},date_config_value:a==null?void 0:a.relative_type,date_config_offset:a==null?void 0:a.offset_value,time_config_value:s==null?void 0:s.execution_mode,time_config_fixed_time:s!=null&&s.fixed_time_value?Un(s.fixed_time_value,lo):void 0,time_config_offset:s==null?void 0:s.relative_value,time_config_offset_unit:s==null?void 0:s.relative_unit}},$pt=e=>{const{time_field:t,date_config_value:n,date_config_offset:r,time_config_value:o,time_config_fixed_time:i,time_config_offset:a,time_config_offset_unit:s,condition_values:l,output:c,...u}=e,d=e.type===Hl.UPDATED_BY_CONDITION,h=Js((e.groups??[]).map(v=>{var b;return{...v,conditions:(b=v.conditions)==null?void 0:b.filter(C=>!nt.isEmpty(C))}})),p=t,g={relative_type:n,offset_value:n!==cv.SAME_DAY?r:void 0},y={execution_mode:o,fixed_time_value:o===kc.FIXED_TIME||(p==null?void 0:p.variant_config)===Bn.date?Un(i).format(lo):void 0,relative_value:o!==kc.FIXED_TIME&&o!==kc.AT_EVENT?a:void 0,relative_unit:o!==kc.FIXED_TIME&&o!==kc.AT_EVENT?s:void 0};return{...u,groups:d?jle(e.groups):h,change_field_ids:d?e.change_field_ids:void 0,time_field:p==null?void 0:p.id,time_field_type:p==null?void 0:p.variant_config,time_field_slug:p==null?void 0:p.slug,time_field_name:p==null?void 0:p.name,date_config:g,time_config:y}},Ppt=({id:e})=>{var v;const{getNode:t,setNodes:n}=bn(),{mode:r}=Xt(),o=Cr(),{data:i}=t(e),a=i,[s]=R.useForm(),[l,c]=A.useState("1"),u=R.useWatch("type",s);vo({form:s,type:u});const{data:d}=Zo({type:be.TRIGGER_CONTACT,action:u??""});A.useEffect(()=>{var b,C;o(e,{output:((C=(b=d==null?void 0:d.data)==null?void 0:b.outputs)==null?void 0:C.map(S=>{var E;return{...S,object:e,node_type:be.TRIGGER_CONTACT,order:a==null?void 0:a.order,output_mode:((E=d==null?void 0:d.data)==null?void 0:E.output_mode)??[]}}))||[]})},[d==null?void 0:d.data,a==null?void 0:a.order,e,o]),A.useEffect(()=>{u&&c("2")},[u]);const h=A.useRef(!0);A.useEffect(()=>{h.current&&(s.setFieldsValue(_pt(a)),h.current=!1)},[a,s]);const p=()=>{const b=$pt(s.getFieldsValue(!0));r==="edit"&&n(C=>C.map(S=>{if(S.id!==e)return S;const{change_field_id:E,...x}=S.data,I={...x,...b};return{...S,data:I}}))},g=A.useMemo(()=>nt.debounce(()=>{s.submit()},500),[s]);A.useEffect(()=>()=>{g.cancel()},[g]);const y=[{key:"1",label:"Trigger",children:f.jsx(kpt,{})},{key:"2",label:"Cài đặt",children:f.jsx(Tpt,{}),disabled:!u},{key:"3",label:"Đầu ra",children:f.jsx(gpt,{outputs:(v=d==null?void 0:d.data)==null?void 0:v.outputs,id:e}),disabled:!u}];return f.jsx("div",{className:h7,children:f.jsxs(R,{form:s,layout:"vertical",onFinish:p,onValuesChange:g,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(Ir,{activeKey:l,onChange:c,items:y})]})})},Dpt=({id:e,data:t,mini:n})=>{var C,S,E,x;const{mode:r}=Xt(),{displayComponent:o}=Rn(),i=t.title||"Liên hệ",a=t.type,s=t==null?void 0:t.date_config,l=(t==null?void 0:t.date_config_value)??(s==null?void 0:s.relative_type),c=(t==null?void 0:t.date_config_offset)??(s==null?void 0:s.offset_value),d=`${(l?x7[l]:void 0)??""} ${l!==cv.SAME_DAY&&c!=null?`${c} ngày`:""}`.trim(),h=t==null?void 0:t.condition,p=(C=t==null?void 0:t.groups)!=null&&C.length?t.groups:h?[h]:[],g=p==null?void 0:p.some(I=>{var N;return(N=I.conditions)==null?void 0:N.length}),y=t==null?void 0:t.change_field_id,v=((S=t==null?void 0:t.change_field_ids)==null?void 0:S.length)??(y==null?void 0:y.length)??0,b=I=>{const N=I.target;N!=null&&N.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(I.stopPropagation(),I.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(Ppt,{id:e}),i,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx(f.Fragment,{children:f.jsx("div",{className:c7,onClick:b,onKeyDown:I=>{(I.key==="Enter"||I.key===" ")&&b(I)},children:f.jsxs("div",{className:`${u7}`,children:[f.jsxs(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",justify:"flex-start",style:{width:"100%"},gap:12,children:[f.jsxs("div",{className:d7,children:[f.jsx(qT,{color:"#096DD9",variant:"Bold",size:24,className:f7}),f.jsx(vs,{size:14,className:Cht,variant:"Bold",color:"#000"})]}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:i})]}),f.jsx(Po,{id:e,data:t})]}),f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:16,children:f.jsx(ge.Text,{children:Ix[a]})}),f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Điều kiện"})}),f.jsx(at,{span:16,children:(t==null?void 0:t.type)===Hl.UPDATED_BY_CONDITION?g?f.jsx(ku,{nodeId:e,groups:p}):f.jsx(ge.Text,{children:v?`${v} trường được chọn`:"Chưa chọn trường"}):(t==null?void 0:t.type)!==Hl.TIME?f.jsx(ku,{nodeId:e,groups:t==null?void 0:t.groups}):f.jsxs(Ke,{vertical:!0,gap:4,style:{minWidth:0},children:[f.jsxs(ge.Paragraph,{style:{marginBottom:0},ellipsis:{rows:1,expanded:!1,tooltip:((E=t==null?void 0:t.time_field)==null?void 0:E.name)||(t==null?void 0:t.time_field_name)},children:[f.jsx(ge.Text,{strong:!0,children:((x=t==null?void 0:t.time_field)==null?void 0:x.name)||(t==null?void 0:t.time_field_name)})," "]}),f.jsx(ge.Paragraph,{style:{marginBottom:0},ellipsis:{rows:1,expanded:!1,tooltip:d},children:f.jsx(ge.Text,{strong:!0,children:d})})]})})]})]})})})},Lpt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(Dpt,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]});var Bpt="scripts_editor_1y18uwq0",Fpt="scripts_editor_1y18uwq1",Wle={default:"scripts_editor_1y18uwq2",active:"scripts_editor_1y18uwq3"},jpt="scripts_editor_1y18uwq4",zpt="scripts_editor_1y18uwq5",Vpt="scripts_editor_1y18uwq8",Hpt="scripts_editor_1y18uwq9",Wpt="scripts_editor_1y18uwqa",Kpt="scripts_editor_1y18uwqb",qpt="scripts_editor_1y18uwqc",Upt="scripts_editor_1y18uwqd",Gpt="scripts_editor_1y18uwqe",Qpt="scripts_editor_1y18uwqf",Ox=(e=>(e.CREATE="CREATE",e.UPDATE="UPDATE",e.GET="GET",e))(Ox||{});const Kle=[vn.CONTACT,vn.ENTERPRISE,vn.CRMDEAL,vn.CRMORDER];var qle=(e=>(e.CREATE_CONTACT="CREATE_CONTACT",e.UPDATE_CONTACT="UPDATE_CONTACT",e.GET_CONTACT="GET_CONTACT",e.CREATE_ENTERPRISE="CREATE_ENTERPRISE",e.UPDATE_ENTERPRISE="UPDATE_ENTERPRISE",e.GET_ENTERPRISE="GET_ENTERPRISE",e.CREATE_CRMDEAL="CREATE_CRMDEAL",e.UPDATE_CRMDEAL="UPDATE_CRMDEAL",e.GET_CRMDEAL="GET_CRMDEAL",e.CREATE_CRMORDER="CREATE_CRMORDER",e.UPDATE_CRMORDER="UPDATE_CRMORDER",e.GET_CRMORDER="GET_CRMORDER",e))(qle||{});const nl=(e,t,n,r,o)=>({action:e,object:t,label:`${r} ${n.toLowerCase()}`,description:o}),pa={[vn.CONTACT]:"Liên hệ",[vn.ENTERPRISE]:"Công ty",[vn.CRMDEAL]:"Cơ hội bán hàng",[vn.CRMORDER]:"Đơn hàng"},N7={CREATE_CONTACT:nl("CREATE",vn.CONTACT,pa[vn.CONTACT],"Tạo mới","Tạo mới liên hệ trong CRM"),UPDATE_CONTACT:nl("UPDATE",vn.CONTACT,pa[vn.CONTACT],"Cập nhật","Cập nhật liên hệ theo điều kiện lọc"),GET_CONTACT:nl("GET",vn.CONTACT,pa[vn.CONTACT],"Lấy dữ liệu","Lấy dữ liệu liên hệ theo điều kiện lọc"),CREATE_ENTERPRISE:nl("CREATE",vn.ENTERPRISE,pa[vn.ENTERPRISE],"Tạo mới","Tạo mới công ty trong CRM"),UPDATE_ENTERPRISE:nl("UPDATE",vn.ENTERPRISE,pa[vn.ENTERPRISE],"Cập nhật","Cập nhật công ty theo điều kiện lọc"),GET_ENTERPRISE:nl("GET",vn.ENTERPRISE,pa[vn.ENTERPRISE],"Lấy dữ liệu","Lấy dữ liệu công ty theo điều kiện lọc"),CREATE_CRMDEAL:nl("CREATE",vn.CRMDEAL,pa[vn.CRMDEAL],"Tạo mới","Tạo mới cơ hội bán hàng trong CRM"),UPDATE_CRMDEAL:nl("UPDATE",vn.CRMDEAL,pa[vn.CRMDEAL],"Cập nhật","Cập nhật cơ hội bán hàng theo điều kiện lọc"),GET_CRMDEAL:nl("GET",vn.CRMDEAL,pa[vn.CRMDEAL],"Lấy dữ liệu","Lấy dữ liệu cơ hội bán hàng theo điều kiện lọc"),CREATE_CRMORDER:nl("CREATE",vn.CRMORDER,pa[vn.CRMORDER],"Tạo mới","Tạo mới đơn hàng trong CRM"),UPDATE_CRMORDER:nl("UPDATE",vn.CRMORDER,pa[vn.CRMORDER],"Cập nhật","Cập nhật đơn hàng theo điều kiện lọc"),GET_CRMORDER:nl("GET",vn.CRMORDER,pa[vn.CRMORDER],"Lấy dữ liệu","Lấy dữ liệu đơn hàng theo điều kiện lọc")};Object.values(qle);const Ule=Object.fromEntries(Object.entries(N7).map(([e,t])=>[e,t.label])),Rpt=Object.fromEntries(Object.entries(N7).map(([e,t])=>[e,t.description])),Ypt={[vn.CONTACT]:["CREATE_CONTACT","UPDATE_CONTACT","GET_CONTACT"],[vn.ENTERPRISE]:["CREATE_ENTERPRISE","UPDATE_ENTERPRISE","GET_ENTERPRISE"],[vn.CRMDEAL]:["CREATE_CRMDEAL","UPDATE_CRMDEAL","GET_CRMDEAL"],[vn.CRMORDER]:["CREATE_CRMORDER","UPDATE_CRMORDER","GET_CRMORDER"]},O7=e=>Array.isArray(e)?e.some(O7):e&&typeof e=="object"?Object.values(e).some(O7):e!=null&&e!=="",Gle=e=>{if(e)return N7[e]},Xpt=e=>{var t;return(t=Gle(e))==null?void 0:t.action},dp=e=>{var t;return(t=Gle(e))==null?void 0:t.object},Zpt=e=>(e==null?void 0:e.some(t=>{var n;return(n=t.conditions)==null?void 0:n.some(r=>Object.values(r??{}).some(O7))}))??!1,Jpt=()=>{const e=R.useFormInstance(),t=R.useWatch("type",e);return f.jsx(R.Item,{name:"type",label:null,children:f.jsx(ln.Group,{className:Hpt,children:f.jsx(IA,{defaultActiveKey:[...Kle],expandIconPosition:"start",ghost:!0,items:Kle.map(n=>({key:n,label:f.jsx(ge.Text,{strong:!0,children:pa[n]}),styles:{header:{padding:"12px 0"},body:{padding:0}},children:f.jsx(Cn,{direction:"vertical",className:Wpt,size:12,children:Ypt[n].map(r=>f.jsxs(ln,{value:r,className:Kpt,children:[f.jsxs("div",{className:qpt,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:Ule[r]}),f.jsx(ge.Text,{type:"secondary",children:Rpt[r]})]}),t===r?f.jsxs("div",{className:Upt,children:[f.jsx("div",{className:Gpt}),f.jsx(Wr,{className:Qpt})]}):null]},r))})}))})})})},egt=({type:e})=>{const t=dp(e);return t?f.jsx(tl,{title:`Tạo mới ${pa[t].toLowerCase()}`,model:t,formListName:"update_fields"}):null},tgt=({type:e})=>{const t=dp(e);return t?f.jsxs(f.Fragment,{children:[f.jsx(ge.Paragraph,{strong:!0,children:`Lấy dữ liệu ${pa[t].toLowerCase()} đáp ứng điều kiện sau:`}),f.jsx(ha,{model:t})]}):null},ngt=({id:e,outputs:t})=>{const n=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t??[]).map(r=>({...r,icon:()=>{var i;const o=so[((i=r.meta)==null?void 0:i.iconType)??""]??null;return o?f.jsx(o,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:n})},rgt=({type:e})=>{const t=dp(e);return t?f.jsxs(f.Fragment,{children:[f.jsx(ge.Paragraph,{strong:!0,children:`Cập nhật ${pa[t].toLowerCase()} đáp ứng điều kiện sau:`}),f.jsxs(Ke,{vertical:!0,gap:12,children:[f.jsx(ha,{model:t}),f.jsx(tl,{title:"Cập nhật dữ liệu",model:t,formListName:"update_fields"})]})]}):null},Qle=({id:e})=>{var y;const{getNode:t}=bn(),n=Cr(),{data:r}=t(e),o=r,[i]=R.useForm(),[a,s]=A.useState("1"),l=R.useWatch("type",i);vo({form:i,type:l,getResetValues:({nextType:v})=>{const b=dp(v);return b?{object:b}:void 0}});const{data:c}=Zo({type:be.DATA_CRM,action:l??""});A.useEffect(()=>{var v,b;n(e,{output:((b=(v=c==null?void 0:c.data)==null?void 0:v.outputs)==null?void 0:b.map(C=>{var S;return{...C,object:e,node_type:be.DATA_CRM,order:o==null?void 0:o.order,output_mode:((S=c==null?void 0:c.data)==null?void 0:S.output_mode)??[]}}))||[]})},[c==null?void 0:c.data,o==null?void 0:o.order,e,n]),A.useEffect(()=>{l&&s("2")},[l]),A.useEffect(()=>{const v=dp(l);v&&i.getFieldValue("object")!==v&&i.setFieldValue("object",v)},[i,l]);const u=A.useRef(!0);A.useEffect(()=>{if(u.current){const v=nt.cloneDeep(o),b=(v==null?void 0:v.object)??dp(v==null?void 0:v.type),C=Cs(b,(v==null?void 0:v.groups)??[],(v==null?void 0:v.filter_type)??"AND");i.setFieldsValue({...v,object:b,...C}),u.current=!1}},[o,i]);const d=()=>{if(!l)return null;switch(Xpt(l)){case Ox.CREATE:return f.jsx(egt,{type:l});case Ox.UPDATE:return f.jsx(rgt,{type:l});case Ox.GET:return f.jsx(tgt,{type:l});default:return null}},h=v=>{const b=Js(((v==null?void 0:v.groups)??[]).map(E=>{var x;return{...E,conditions:(x=E==null?void 0:E.conditions)==null?void 0:x.filter(I=>!nt.isEmpty(I))}})),C=Vl(zl(v)),S=dp(v.type);n(e,{...v,object:S,groups:b,variables:C})},p=A.useMemo(()=>nt.debounce(()=>{i.submit()},500),[i]);A.useEffect(()=>()=>{p.cancel()},[p]);const g=[{key:"1",label:"Hành động",children:f.jsx(Jpt,{})},{key:"2",label:"Cài đặt",children:d(),disabled:!l},{key:"3",label:"Đầu ra",children:f.jsx(ngt,{id:e,outputs:(y=c==null?void 0:c.data)==null?void 0:y.outputs}),disabled:!l}];return f.jsx("div",{className:Vpt,children:f.jsxs(R,{form:i,layout:"vertical",initialValues:{...o},onFinish:h,onValuesChange:p,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(R.Item,{name:["object"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(Ir,{activeKey:a,onChange:s,items:g})]})})},ogt=({id:e,data:t,mini:n})=>{const{mode:r}=Xt(),{displayComponent:o,nodeId:i}=Rn(),a=t.title||"Lấy dữ liệu",s=Zpt(t.groups),l=c=>{const u=c.target;u!=null&&u.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(c.stopPropagation(),c.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(Qle,{id:e}),a,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx(f.Fragment,{children:f.jsx("div",{className:Bpt,onClick:l,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&l(c)},children:f.jsxs("div",{className:`${Fpt} ${i===e?Wle.active:Wle.default}`,children:[f.jsxs("div",{className:`${zpt} drag-handle__custom`,children:[f.jsxs("div",{className:jpt,children:[f.jsx(io,{style:{fontSize:16,color:Fn.conditionBlock.focus}}),f.jsx(Xd,{id:e,color:Fn.conditionBlock.focus})]}),f.jsx(Iu,{id:e,deleteBtnColor:Fn.conditionBlock.focus})]}),f.jsx(fo,{styles:{body:{padding:8}},children:f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:10,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:14,children:f.jsx(ge.Text,{children:Ule[t.type]})}),s?f.jsxs(f.Fragment,{children:[f.jsx(at,{span:10,children:f.jsx(ge.Text,{type:"secondary",children:"Bộ lọc"})}),f.jsx(at,{span:14,children:f.jsx(ku,{nodeId:e,groups:t.groups})})]}):null]})})]})})})},igt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(ogt,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]});var agt="scripts_editor_12j5lm80",sgt="scripts_editor_12j5lm81",lgt="scripts_editor_12j5lm82",cgt="scripts_editor_12j5lm83",ugt="scripts_editor_12j5lm85",dgt="scripts_editor_12j5lm87",fgt="scripts_editor_12j5lm88",hgt="scripts_editor_12j5lm89",pgt="scripts_editor_12j5lm8a",ggt="scripts_editor_12j5lm8b",mgt="scripts_editor_12j5lm8c",vgt="scripts_editor_12j5lm8d";const T7={DELAY:"Hẹn giờ"},ygt={DELAY:"Tạm dừng trong một khoảng thời gian xác định"},bgt=nt.keys(T7);var Rle=(e=>(e.SECONDS="SECONDS",e.MINUTES="MINUTES",e.HOURS="HOURS",e.DAYS="DAYS",e))(Rle||{});const Tx={SECONDS:"giây",MINUTES:"phút",HOURS:"giờ",DAYS:"ngày"},Cgt=nt.keys(Tx),Agt=()=>{const e=R.useFormInstance(),t=R.useWatch("type",e);return f.jsxs("div",{children:[f.jsx(Nt.Search,{placeholder:"Tìm kiếm hành động",allowClear:!0,onSearch:n=>{console.log("🚀 ~ e:",n)},style:{marginBottom:12}}),f.jsx(R.Item,{name:"type",label:null,children:f.jsx(ln.Group,{className:dgt,children:f.jsx(Cn,{direction:"vertical",className:fgt,size:12,children:bgt.map(n=>f.jsxs(ln,{value:n,className:hgt,children:[f.jsxs("div",{className:pgt,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:T7[n]}),f.jsx(ge.Text,{type:"secondary",children:ygt[n]})]}),t===n&&f.jsxs("div",{className:ggt,children:[f.jsx("div",{className:mgt}),f.jsx(Wr,{className:vgt})]})]},n))})})})]})},Egt=({id:e,outputs:t})=>{const n=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t).map(r=>({...r,icon:()=>{var i;const o=so[((i=r.meta)==null?void 0:i.iconType)??""]??null;return o?f.jsx(o,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:n})},Mc=[{label:"Thứ 2",value:2},{label:"Thứ 6",value:6},{label:"Thứ 3",value:3},{label:"Thứ 7",value:7},{label:"Thứ 4",value:4},{label:"Chủ nhật",value:8},{label:"Thứ 5",value:5}],Sgt=()=>{const e=R.useFormInstance(),t=R.useWatch(["config","time_restriction","apply_on_days"],e),n=()=>{const r=(t==null?void 0:t.length)===(Mc==null?void 0:Mc.length);e.setFieldsValue({config:{time_restriction:{apply_on_days:r?[]:Mc==null?void 0:Mc.map(o=>o.value)}}}),nt.debounce(()=>{e.submit()},500)()};return f.jsxs(f.Fragment,{children:[f.jsx(ge.Text,{strong:!0,children:"Thời gian chờ"}),f.jsxs(Nn,{gutter:6,style:{marginTop:8},children:[f.jsx(at,{span:12,children:f.jsx(R.Item,{name:["config","wait_time","value"],label:null,style:{marginBottom:12},children:f.jsx(ci,{min:1,style:{width:"100%"},placeholder:"Nhập thời gian",suffix:f.jsx(N2,{})})})}),f.jsx(at,{span:12,children:f.jsx(R.Item,{initialValue:Rle.SECONDS,name:["config","wait_time","unit"],label:null,style:{marginBottom:12},children:f.jsx(In,{placeholder:"Chọn đơn vị",options:Cgt.map(r=>({label:Tx[r],value:r}))})})})]}),f.jsx(R.Item,{name:["config","time_restriction","is_enabled"],valuePropName:"checked",label:null,style:{marginBottom:12},children:f.jsx(Fr,{children:"Đặt giới hạn thời gian"})}),f.jsx(R.Item,{noStyle:!0,shouldUpdate:(r,o)=>{var i,a,s,l;return((a=(i=r.config)==null?void 0:i.time_restriction)==null?void 0:a.is_enabled)!==((l=(s=o.config)==null?void 0:s.time_restriction)==null?void 0:l.is_enabled)},children:({getFieldValue:r})=>r(["config","time_restriction","is_enabled"])?f.jsx(Ed,{children:f.jsxs("div",{style:{background:"#F9F9FF",borderRadius:8,padding:12,display:"flex",flexDirection:"column",gap:8},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsx(ge.Text,{strong:!0,children:"Áp dụng cho các ngày"}),f.jsx(ge.Link,{onClick:n,children:(t==null?void 0:t.length)===(Mc==null?void 0:Mc.length)?"Bỏ chọn tất cả":"Chọn tất cả"})]}),f.jsx(R.Item,{label:null,name:["config","time_restriction","apply_on_days"],children:f.jsx(Fr.Group,{style:{display:"grid",gridTemplateColumns:"repeat(2, minmax(100px, 1fr))",rowGap:8},options:Mc})})]})}):null})]})},wgt=({id:e})=>{var g;const{getNode:t,setNodes:n}=bn(),r=Cr(),{data:o}=t(e),i=o,[a]=R.useForm(),[s,l]=A.useState("1"),c=R.useWatch("type",a);vo({form:a,type:c});const{data:u}=Zo({type:be.DELAY,action:c??""});A.useEffect(()=>{var y,v;r(e,{output:((v=(y=u==null?void 0:u.data)==null?void 0:y.outputs)==null?void 0:v.map(b=>{var C;return{...b,object:e,node_type:be.DELAY,order:i==null?void 0:i.order,output_mode:((C=u==null?void 0:u.data)==null?void 0:C.output_mode)??[]}}))||[]})},[u==null?void 0:u.data,i==null?void 0:i.order,e,r]),A.useEffect(()=>{c&&l("2")},[c]);const d=y=>{r(e,y)},h=A.useMemo(()=>nt.debounce(()=>{a.submit()},500),[a]);A.useEffect(()=>()=>{h.cancel()},[h]);const p=[{key:"1",label:"Hành động",children:f.jsx(Agt,{})},{key:"2",label:"Cài đặt",children:f.jsx(Sgt,{}),disabled:!c},{key:"3",label:"Đầu ra",children:f.jsx(Egt,{id:e,outputs:(g=u==null?void 0:u.data)==null?void 0:g.outputs}),disabled:!c}];return f.jsx("div",{className:ugt,children:f.jsxs(R,{form:a,layout:"vertical",initialValues:{...i},onFinish:d,onValuesChange:h,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(Ir,{activeKey:s,onChange:l,items:p})]})})},xgt=({id:e,data:t,mini:n})=>{var s,l,c,u,d,h,p,g;const{mode:r}=Xt(),{displayComponent:o}=Rn(),i=t.title||"Hẹn giờ",a=y=>{const v=y.target;v!=null&&v.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(y.stopPropagation(),y.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(wgt,{id:e}),i,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx("div",{className:agt,onClick:a,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&a(y)},children:f.jsxs("div",{className:`${sgt}`,children:[f.jsxs(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",justify:"flex-start",style:{width:"100%"},gap:12,children:[f.jsx("div",{className:lgt,children:f.jsx(QT,{className:cgt})}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:i})]}),f.jsx(Po,{id:e,data:t})]}),f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:16,children:T7[t.type]}),f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Thời gian"})}),f.jsx(at,{span:16,children:f.jsx(Ke,{style:{minWidth:0},children:f.jsx(ge.Paragraph,{ellipsis:{rows:1,expanded:!1,tooltip:(l=(s=t==null?void 0:t.config)==null?void 0:s.wait_time)!=null&&l.value&&((u=(c=t==null?void 0:t.config)==null?void 0:c.wait_time)!=null&&u.unit)?`${t.config.wait_time.value} ${Tx[t.config.wait_time.unit]}`:""},children:f.jsx(ge.Text,{children:(h=(d=t==null?void 0:t.config)==null?void 0:d.wait_time)!=null&&h.value&&((g=(p=t==null?void 0:t.config)==null?void 0:p.wait_time)!=null&&g.unit)?`${t.config.wait_time.value} ${Tx[t.config.wait_time.unit]}`:""})})})})]})]})})},Igt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(xgt,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]});var Ngt="scripts_editor_139p2vp0",Ogt="scripts_editor_139p2vp1",Tgt="scripts_editor_139p2vp2",kgt="scripts_editor_139p2vp3",Mgt="scripts_editor_139p2vp5",_gt="scripts_editor_139p2vp7",$gt="scripts_editor_139p2vp8",Pgt="scripts_editor_139p2vp9",Dgt="scripts_editor_139p2vpa",Lgt="scripts_editor_139p2vpb",Bgt="scripts_editor_139p2vpc",Fgt="scripts_editor_139p2vpd",jgt="scripts_editor_139p2vpe",Yle="scripts_editor_139p2vpf";const k7={SEND_MAIL:"Gửi email"},zgt={SEND_MAIL:"Gửi email với mẫu có sẵn"},Vgt=nt.keys(k7),Hgt=()=>{const e=R.useFormInstance(),t=R.useWatch("type",e);return f.jsxs("div",{children:[f.jsx(Nt.Search,{placeholder:"Tìm kiếm hành động",allowClear:!0,onSearch:n=>{console.log("🚀 ~ e:",n)},style:{marginBottom:12}}),f.jsx(R.Item,{name:"type",label:null,children:f.jsx(ln.Group,{className:_gt,children:f.jsx(Cn,{direction:"vertical",className:$gt,size:12,children:Vgt.map(n=>f.jsxs(ln,{value:n,className:Pgt,children:[f.jsxs("div",{className:Dgt,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:k7[n]}),f.jsx(ge.Text,{type:"secondary",children:zgt[n]})]}),t===n&&f.jsxs("div",{className:Lgt,children:[f.jsx("div",{className:Bgt}),f.jsx(Wr,{className:Fgt})]})]},n))})})})]})},Wgt=({id:e,outputs:t})=>{const n=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t).map(r=>({...r,icon:()=>{var i;const o=so[((i=r.meta)==null?void 0:i.iconType)??""]??null;return o?f.jsx(o,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:n})},Kgt="filter-infinite-mail-config",qgt=({currentFilters:e,pageSize:t=10,enabled:n=!0})=>{const{axiosInstance:r,context:{COMPANY_ID:o}}=Xt();return ba({queryKey:[Kgt,o??"",e],queryFn:({pageParam:i=1})=>r.get(`/company/${o}/mailconfig`,{params:{...e,page:i,size:t}}),enabled:n&&!!o,initialPageParam:1,getNextPageParam:(i,a)=>{if(a.reduce((l,c)=>l+c.data.results.length,0)<i.data.count)return a.length+1},staleTime:1e3*60*10,refetchOnMount:!1,retry:1})},Ugt=({dataDefault:e,...t})=>{const{search:n,onSearch:r}=wi(),{data:o,fetchNextPage:i,hasNextPage:a,isLoading:s}=qgt({currentFilters:{search:n},pageSize:10}),[l,c]=A.useState([]);A.useEffect(()=>{const h=[...e?nt.isArray(e)?e:[e]:[],...(o==null?void 0:o.pages.flatMap(p=>{var g;return(g=p==null?void 0:p.data)==null?void 0:g.results}))||[]];c(nt.uniqBy(h,"id"))},[o==null?void 0:o.pages,e]);const u=A.useMemo(()=>l.map(h=>({label:h.name,value:h.id})),[l]),d=async h=>{const p=h.target;p.scrollTop+p.offsetHeight===p.scrollHeight&&a&&await i()};return f.jsx(In,{options:u,allowClear:!0,onSearch:r,onFocus:()=>r(void 0),filterOption:!1,onPopupScroll:d,loading:s,placeholder:"Chọn Email",...t})},Ggt="filter-infinite-mail-template",Qgt=({currentFilters:e,pageSize:t=10,enabled:n=!0})=>{const{axiosInstance:r,context:{COMPANY_ID:o}}=Xt();return ba({queryKey:[Ggt,o??"",e],queryFn:({pageParam:i=1})=>r.get(`/company/${o}/mailtemplate`,{params:{...e,page:i,size:t}}),enabled:n&&!!o,initialPageParam:1,getNextPageParam:(i,a)=>{if(a.reduce((l,c)=>l+c.data.results.length,0)<i.data.count)return a.length+1},staleTime:1e3*60*10,refetchOnMount:!1,retry:1})},Rgt=({dataDefault:e,...t})=>{const{search:n,onSearch:r}=wi(),{data:o,fetchNextPage:i,hasNextPage:a,isLoading:s}=Qgt({currentFilters:{search:n},pageSize:10}),[l,c]=A.useState([]);A.useEffect(()=>{const h=[...e?nt.isArray(e)?e:[e]:[],...(o==null?void 0:o.pages.flatMap(p=>{var g;return(g=p==null?void 0:p.data)==null?void 0:g.results}))||[]];c(nt.uniqBy(h,"id"))},[o==null?void 0:o.pages,e]);const u=A.useMemo(()=>l.map(h=>({label:h.name,value:h.id})),[l]),d=async h=>{const p=h.target;p.scrollTop+p.offsetHeight===p.scrollHeight&&a&&await i()};return f.jsx(In,{options:u,allowClear:!0,onSearch:r,onFocus:()=>r(void 0),filterOption:!1,onPopupScroll:d,loading:s,placeholder:"Chọn mẫu Email",...t})};function M7(e,t){let n=-1,r=-1;for(let o=t-1;o>=0;o--){if((e==null?void 0:e.substring(o,o+2))==="{{"){n=o;break}if((e==null?void 0:e.substring(o,o+2))==="}}")return{start:-1,end:-1}}if(n!==-1)for(let o=t;o<e.length-1;o++){if((e==null?void 0:e.substring(o,o+2))==="}}"){r=o+2;break}if((e==null?void 0:e.substring(o,o+2))==="{{")break}return{start:n,end:r}}function Ygt(e,t){const{value:n,onChange:r,isCheckPrefix:o=!0,onSelect:i,status:a}=t||{},[s,l]=A.useState(!1),[c,u]=A.useState(0),d=A.useRef(null),[h,p]=A.useState(n??""),g=n!==void 0;A.useEffect(()=>{!g&&n!==void 0&&p(n)},[g,n]);const y=g?n:h,v=x=>{r==null||r(x),g||p(x)},b=A.useMemo(()=>{var N;const{start:x}=M7(y,c);if(x===-1)return e;const I=(N=y==null?void 0:y.slice(x+2,c))==null?void 0:N.toLowerCase();return I?e.map(O=>mv(O,I)).filter(O=>O!==null):e},[e,y,c]);return A.useEffect(()=>{if(!o)return;const{start:x}=M7(y,c);l(x!==-1?b.length>0:!1)},[y,c,b,o]),{value:y,open:s,options:b,bindInput:{ref:d,value:y,onChange:x=>{const I=x.target?x.target.value:x,N=x.target&&x.target.selectionStart||I.length;v(I),u(N),!o&&(nt.isEmpty(I)||I.includes("{{"))&&l(!0)},onClick:x=>u(x.target.selectionStart||0),status:a,onFocus:()=>{o||l(b.length>0)}},onSelect:(x,I)=>{var M,_,L;const N=((M=d.current)==null?void 0:M.selectionStart)??c,{start:O,end:T}=M7(y,N);if(O!==-1){const P=y==null?void 0:y.substring(0,O),$=T!==-1?y==null?void 0:y.substring(T):y==null?void 0:y.substring(N),B=P+I.value+$;v(B)}else{const P=(_=y??"")==null?void 0:_.substring(0,N),$=(L=y??"")==null?void 0:L.substring(N);v(P+I.value+$)}l(!1),i==null||i(x,I)},setOpen:l,updateValue:v}}var Xgt="scripts_editor_1k16buo0",Zgt="scripts_editor_1k16buo2",Jgt="scripts_editor_1k16buo3",emt="scripts_editor_1k16buo4",tmt="scripts_editor_1k16buo5",nmt="scripts_editor_1k16buo6",rmt="scripts_editor_1k16buo7";const omt=e=>{const t=A.useRef(null),{nodeId:n}=Rn(),{optionMap:r,optionsData:o}=af(n),i=Ygt(o,e),{checkedMap:a}=Xy(),[s,l]=A.useState([]),[c,u]=A.useState({}),d=A.useDeferredValue(c),h=A.useMemo(()=>JSON.stringify(a),[a]),p=A.useRef(!1),g=A.useRef(!1),y=A.useRef(null);A.useEffect(()=>{s.some(I=>I.includes(qr[0]))&&(p.current=!0)},[h,s]),A.useEffect(()=>()=>{y.current!==null&&window.clearTimeout(y.current)},[]);const v=A.useCallback(()=>{g.current=!0,y.current!==null&&window.clearTimeout(y.current),y.current=window.setTimeout(()=>{g.current=!1,y.current=null},0)},[]),b=A.useCallback((x,I)=>{const N=r.get(x);if(!N)return;const O=lp(N,I);O&&i.onSelect(O,{value:O,data:el(N,O,I)})},[r,i]),C=()=>{var N;const x=Object.values(a).flat().map(O=>{const T=rf(O);return r.get(T)}).filter(O=>!!O&&"data"in O);if(x.length===0)return;const I=x.map(O=>`{{${O.data.object}.ALL_MATCHES.${O.data.slug}}}`);(N=e==null?void 0:e.onMultiSelect)==null||N.call(e,I),i.updateValue(""),i.setOpen(!1)},S=A.useMemo(()=>{var x;return(x=i.options)==null?void 0:x.map(I=>qx(I,e==null?void 0:e.filterTypes)).filter(I=>I!==null)},[i.options,e==null?void 0:e.filterTypes]),E=A.useMemo(()=>S==null?void 0:S.map(x=>{var L,P;const I="options"in x?c[x.label]??"":"",N="options"in x?(d[x.label]??"").trim().toLowerCase():"",O="options"in x&&N?mv(x,N):x,T="options"in x&&(!O||!("options"in O))?{...x,options:[]}:O,M="options"in x?{value:I,onChange:$=>{u(B=>({...B,[x.label]:$}))},onInteract:v,placeholder:"Tìm kiếm giá trị"}:void 0,_=!!((L=T==null?void 0:T.output_mode)!=null&&L.length)&&((P=T.output_mode)==null?void 0:P.every($=>jl($)));return T&&"options"in T&&_?W_(T,{search:M},$=>{const B=rf($),D=nf($);b(B,D)},v):vv(T,void 0,$=>{const B=rf($),D=nf($);b(B,D)},v,M)}),[d,b,v,S,c]);return f.jsx("div",{className:Xgt,ref:t,children:f.jsx(bN,{...e,value:i.value,options:i.options,open:i.open,onSelect:i.onSelect,onOpenChange:x=>{i.setOpen(x),x||(l([]),u({}))},getPopupContainer:()=>t.current||document.body,popupRender:()=>f.jsx(lc,{items:E,openKeys:s,mode:"vertical",triggerSubMenuAction:"click",selectable:!1,onOpenChange:x=>{if(g.current){g.current=!1;return}const I=s.some(O=>O.includes(qr[0])),N=x.some(O=>O.includes(qr[0]));I&&!N&&p.current&&s.find(T=>T.includes(qr[0]))&&(C(),p.current=!1),l(x)},onClick:({key:x,domEvent:I,keyPath:N})=>{if(I.target instanceof Element&&I.target.closest(`[${sb}="true"]`))return;const O=nf(String(x),N),T=rf(String(x));I.stopPropagation(),I.preventDefault(),b(T,O)}}),children:e.children?A.cloneElement(e.children,{...i.bindInput}):f.jsx(Nt,{...i.bindInput})})})};function imt(e){return f.jsx(V_,{children:f.jsx(omt,{...e})})}const amt=({value:e,onChange:t})=>{const{nodeId:n}=Rn(),{optionMap:r}=af(n),[o,i]=A.useState(""),[a,s]=A.useState(""),l=h=>{i(h),s("")},c=h=>{const p=(e||[]).filter(g=>g!==h);(p==null?void 0:p.length)===0&&s("Vui lòng nhập ít nhất một email hoặc biến!"),t(p.length>0?p:void 0)},u=h=>{const p=h.trim();if(!(z8.test(p)||Ra.test(p))){s("Vui lòng nhập đúng định dạng email hoặc biến!");return}const y=e||[];if(y.includes(p)){s("Email đã tồn tại!");return}t([...y,p]),i("")},d=h=>{if(h.key==="Enter"){if(o.startsWith("{{")&&!o.endsWith("}}"))return;h.preventDefault(),u(o)}};return f.jsxs("div",{children:[f.jsx("div",{style:{marginBottom:8},children:(e||[]).map(h=>{const p=h.match(Ra),g=z8.test(h)||Ra.test(h);if(p){const y=ev(r,h),v=y?el(y,h):tv(h);if(v)return f.jsx(Tu,{data:v,onClose:()=>c(h),closable:!0,style:{marginBottom:4,display:"inline-flex"}},h)}return f.jsx(ms,{closable:!0,onClose:()=>c(h),color:g?"blue":"red",style:{marginBottom:4},children:h},h)})}),f.jsx(imt,{value:o,onChange:l,onSelect:(h,p)=>{u((p==null?void 0:p.value)||h)},onMultiSelect:h=>{const p=e||[],g=h.filter(y=>!p.includes(y));t([...p,...g]),i("")},placeholder:"Nhập email hoặc biến và ấn Enter",status:a?"error":"",onKeyDown:d}),a&&f.jsx("div",{style:{color:"#ff4d4f",fontSize:14,marginTop:4},children:a})]})},smt=()=>{const{emit:e}=eb();return f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{name:"mailconfig",label:"Email người gửi",children:f.jsx(Ugt,{popupRender:t=>f.jsxs(f.Fragment,{children:[t,f.jsx(ia,{style:{margin:"6px 0"}}),f.jsx(Ke,{align:"center",justify:"center",children:f.jsx(yt,{style:{width:"100%"},type:"primary",onClick:()=>{e("openIntegrationEmailPage",void 0)},children:"Tích hợp mới"})})]})})}),f.jsx(R.Item,{name:"recipient_list",label:"Email người nhận",children:f.jsx(amt,{})}),f.jsx(R.Item,{label:"Nội dung email",name:"email_type",children:f.jsxs(ln.Group,{className:jgt,children:[f.jsx(ln,{value:"template",className:Yle,children:"Sử dụng mẫu có sẵn"}),f.jsx(ln,{value:"custom",className:Yle,children:"Soạn mới"})]})}),f.jsx(R.Item,{noStyle:!0,shouldUpdate:(t,n)=>t.email_type!==n.email_type,children:({getFieldValue:t})=>t("email_type")==="template"?f.jsx(R.Item,{name:"template_id",label:null,children:f.jsx(Rgt,{})}):f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{name:"subject",label:"Tiêu đề",children:f.jsx(yo,{placeholder:"Soạn tiêu đề"})}),f.jsx(R.Item,{name:"message",label:"Nội dung",children:f.jsx(yo,{placeholder:"Nhập nội dung email",rows:4})})]})})]})},lmt=()=>f.jsxs(Ke,{vertical:!0,gap:12,children:[f.jsx(ge.Text,{strong:!0,children:"Email người nhận"}),f.jsx(Nt,{placeholder:"Nhập email"}),f.jsx(yt,{type:"primary",icon:f.jsx(RT,{}),children:"Gửi thử"})]}),cmt=({id:e})=>{var y;const{getNode:t,setNodes:n}=bn(),r=Cr(),{data:o}=t(e),i=o,[a]=R.useForm(),[s,l]=A.useState("1"),c=R.useWatch("type",a);vo({form:a,type:c,getResetValues:()=>em[be.EMAIL]});const{data:u}=Zo({type:be.EMAIL,action:c??""});A.useEffect(()=>{var v,b;r(e,{output:((b=(v=u==null?void 0:u.data)==null?void 0:v.outputs)==null?void 0:b.map(C=>{var S;return{...C,object:e,node_type:be.EMAIL,order:i==null?void 0:i.order,output_mode:((S=u==null?void 0:u.data)==null?void 0:S.output_mode)??[]}}))||[]})},[u==null?void 0:u.data,i==null?void 0:i.order,e,r]),A.useEffect(()=>{c&&l("2")},[c]);const d=A.useRef(!0);A.useEffect(()=>{if(d.current){const v=nt.cloneDeep(i),b=(v==null?void 0:v.email)??{};a.setFieldsValue({...v,...b}),d.current=!1}},[i]);const h=v=>{const{email_type:b,mailconfig:C,message:S,recipient_list:E,subject:x,template_id:I,...N}=v,O=b==="custom"?{mailconfig:C,recipient_list:E,subject:x,message:S,email_type:b}:{mailconfig:C,recipient_list:E,email_type:b,template_id:I},T=Vl(zl(v));r(e,{...N,email:O,variables:T})},p=A.useMemo(()=>nt.debounce(()=>{a.submit()},500),[a]);A.useEffect(()=>()=>{p.cancel()},[p]);const g=[{key:"1",label:"Hành động",children:f.jsx(Hgt,{})},{key:"2",label:"Cài đặt",children:f.jsx(smt,{}),disabled:!c},{key:"3",label:"Kiểm thử",children:f.jsx(lmt,{}),disabled:!c},{key:"4",label:"Đầu ra",children:f.jsx(Wgt,{outputs:(y=u==null?void 0:u.data)==null?void 0:y.outputs,id:e}),disabled:!c}];return f.jsx("div",{className:Mgt,children:f.jsxs(R,{form:a,layout:"vertical",initialValues:{...i},onFinish:h,onValuesChange:p,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(Ir,{activeKey:s,onChange:l,items:g})]})})},umt=({id:e,data:t,mini:n})=>{var c;const{mode:r}=Xt(),{displayComponent:o}=Rn(),i=t.title||"Email",{optionMap:a}=af(e),s=A.useMemo(()=>{var u,d;return(d=(u=t==null?void 0:t.email)==null?void 0:u.recipient_list)==null?void 0:d.map((h,p)=>{if(h.match(Ra)){const y=ev(a,h),v=y?el(y,h):tv(h);if(v)return f.jsx(Tu,{showTooltip:!1,collapsed:!1,closable:!1,data:v,style:{marginBottom:4,display:"inline-flex"}},`var-${h}-${p}`)}return f.jsx(ms,{color:"blue",style:{marginBottom:4},children:h},`email-${h}-${p}`)})},[(c=t==null?void 0:t.email)==null?void 0:c.recipient_list,a]),l=u=>{const d=u.target;d!=null&&d.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(u.stopPropagation(),u.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(cmt,{id:e}),i,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx("div",{className:Ngt,onClick:l,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&l(u)},children:f.jsxs("div",{className:`${Ogt}`,children:[f.jsxs(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",justify:"flex-start",style:{width:"100%"},gap:12,children:[f.jsx("div",{className:Tgt,children:f.jsx(dE,{color:"#096DD9",variant:"Bold",size:24,className:kgt})}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:i})]}),f.jsx(Po,{id:e,data:t})]}),f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:16,children:f.jsx(ge.Text,{children:k7[t.type]})}),f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Email nhận"})}),f.jsx(at,{span:16,children:f.jsx(Ke,{style:{minWidth:0},children:f.jsx(ge.Paragraph,{ellipsis:{rows:1,expanded:!1,tooltip:{children:s,styles:{body:{width:"fit-content"}},showArrow:!1,color:"#FFF"}},style:{marginBottom:"unset"},children:f.jsx(ge.Text,{children:s})})})})]})]})})},dmt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(umt,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]});function fmt(e){return wr({attr:{viewBox:"0 0 488 512"},child:[{tag:"path",attr:{d:"M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z"},child:[]}]})(e)}function hmt(e){return wr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M480 128V96h20c6.627 0 12-5.373 12-12V44c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v20H64V44c0-6.627-5.373-12-12-12H12C5.373 32 0 37.373 0 44v40c0 6.627 5.373 12 12 12h20v320H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-20h384v20c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-20V128zM96 276V140c0-6.627 5.373-12 12-12h168c6.627 0 12 5.373 12 12v136c0 6.627-5.373 12-12 12H108c-6.627 0-12-5.373-12-12zm320 96c0 6.627-5.373 12-12 12H236c-6.627 0-12-5.373-12-12v-52h72c13.255 0 24-10.745 24-24v-72h84c6.627 0 12 5.373 12 12v136z"},child:[]}]})(e)}function pmt(e){return wr({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M288 248v28c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-28c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12zm-12 72H108c-6.6 0-12 5.4-12 12v28c0 6.6 5.4 12 12 12h168c6.6 0 12-5.4 12-12v-28c0-6.6-5.4-12-12-12zm108-188.1V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V48C0 21.5 21.5 0 48 0h204.1C264.8 0 277 5.1 286 14.1L369.9 98c9 8.9 14.1 21.2 14.1 33.9zm-128-80V128h76.1L256 51.9zM336 464V176H232c-13.3 0-24-10.7-24-24V48H48v416h288z"},child:[]}]})(e)}function gmt(e){return wr({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M527.9 224H480v-48c0-26.5-21.5-48-48-48H272l-64-64H48C21.5 64 0 85.5 0 112v288c0 26.5 21.5 48 48 48h400c16.5 0 31.9-8.5 40.7-22.6l79.9-128c20-31.9-3-73.4-40.7-73.4zM48 118c0-3.3 2.7-6 6-6h134.1l64 64H426c3.3 0 6 2.7 6 6v42H152c-16.8 0-32.4 8.8-41.1 23.2L48 351.4zm400 282H72l77.2-128H528z"},child:[]}]})(e)}function Xle(e){return Zn(n=>n.nodes.filter(r=>r.parentId===e))}const Zle=A.createContext([null,()=>{}]),mmt=({children:e})=>{const[t,n]=A.useState(null);return f.jsx(Zle.Provider,{value:[t,n],children:e})},kx=()=>A.useContext(Zle),Jle=A.createContext(null),vmt=({children:e})=>{const[t,n]=iu.useMessage();return f.jsxs(Jle.Provider,{value:t,children:[n,e]})},nb=()=>{const e=A.useContext(Jle);if(!e)throw new Error("useMessage must be used within a MessageProvider");return e};var ymt="scripts_editor_7lmk2x0",bmt="scripts_editor_7lmk2x1",Cmt="scripts_editor_7lmk2x4",Amt={default:"scripts_editor_7lmk2x5",dynamic:"scripts_editor_7lmk2x6"},Emt="scripts_editor_7lmk2x7",Smt="scripts_editor_7lmk2x9",wmt="scripts_editor_7lmk2xa",ece="scripts_editor_7lmk2xb",xmt="scripts_editor_7lmk2xc",Imt="scripts_editor_7lmk2xd",Nmt="scripts_editor_7lmk2xe";const Omt=({item:e})=>{var b;const{getViewport:t}=bn(),n=1/t().zoom,r=((b=e.id)==null?void 0:b.toString())||"condition-missing-id",o=qy(e),{attributes:i,listeners:a,setNodeRef:s,transform:l,isDragging:c,transition:u}=Qw({id:r,transition:null}),[d,h]=A.useState(!1),{Text:p}=ge,g=l?{x:l.x*n,y:l.y*n,scaleX:1,scaleY:1}:null,y={opacity:c?.4:void 0,transform:Zd.Translate.toString(g),transition:u},v=ip(e);return f.jsx("div",{ref:s,style:y,className:`${ymt} ${c?bmt:""}`,children:f.jsxs(fo,{size:"small",className:`nodrag nopan ${Cmt} ${Amt[v?"default":"dynamic"]} ${c?Emt:""}`,styles:{body:{padding:"2px 10px 2px 0",display:"flex",alignItems:"center"}},onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[f.jsx(yt,{type:"text",size:"small",className:`${Smt} ${d?wmt:""}`,...i,...a,children:f.jsx(zg,{className:ece})}),f.jsx(p,{className:xmt,children:e.label}),f.jsx(mn,{type:"source",position:Mt.Right,id:o,className:Imt})]})})},{Text:Tmt}=ge,kmt=({NODE_ID:e})=>{const{getNode:t}=bn(),{data:n}=t(e),{closeModal:r}=Rn(),o=b0(),i=n,{updateNode:a}=bn(),s=i.conditions||[],l=s.map(d=>{var h;return(h=d.id)==null?void 0:h.toString()}).filter(d=>!!d),c=Lw(Jd(Gm,{activationConstraint:{distance:8}}),Jd(Um,{coordinateGetter:Yw})),u=d=>{const{active:h,over:p}=d;if(!p||h.id===p.id)return;const g=s.findIndex(v=>{var b;return((b=v.id)==null?void 0:b.toString())===h.id}),y=s.findIndex(v=>{var b;return((b=v.id)==null?void 0:b.toString())===p.id});g===-1||y===-1||(a(e,v=>{const b=tf(s,g,y);return{...v,data:{...v.data,conditions:b}}}),requestAnimationFrame(()=>{o(e)}))};return f.jsx(fo,{className:Nmt,styles:{body:{padding:"4px"}},children:f.jsx(Ww,{sensors:c,collisionDetection:Bw,onDragStart:()=>{r()},onDragMove:()=>{requestAnimationFrame(()=>{o(e)})},onDragEnd:u,children:f.jsxs(Gw,{items:l,strategy:Uw,children:[f.jsx(Io,{isOpen:s.length===0,children:f.jsx(Tmt,{type:"secondary",children:"Không có ý định nào"})}),f.jsx(Io,{isOpen:s.length>0,children:f.jsx(Ke,{vertical:!0,gap:8,children:s.map(d=>f.jsx(Omt,{item:d},d.id))})})]})})})};var Mmt="scripts_editor_ao5dig0",tce="scripts_editor_ao5dig1",nce={default:"scripts_editor_ao5dig2",active:"scripts_editor_ao5dig3"},rce="scripts_editor_ao5dig5",oce="scripts_editor_ao5dig6",_mt="scripts_editor_ao5dig7",ice="scripts_editor_ao5dig8",$mt="scripts_editor_ao5diga",Pmt="scripts_editor_ao5digc scripts_editor_ao5digb",Dmt="scripts_editor_ao5digd scripts_editor_ao5digb";const ace=A.forwardRef(({dataSubmit:e,defaultValues:t,onFormSubmit:n},r)=>{const[o]=R.useForm();A.useEffect(()=>{t&&o.setFieldsValue({label:t.label,description:t.description,keywords:t.keywords,is_conversion:t.is_conversion})},[o,t]),A.useImperativeHandle(r,()=>({onSubmit:()=>{o.submit()}}));const i=a=>{e==null||e(a),n==null||n()};return f.jsxs(R,{preserve:!1,form:o,layout:"vertical",onFinish:i,children:[f.jsx(R.Item,{layout:"vertical",label:"Tên ý định",name:"label",rules:[{required:!0,message:"Vui lòng nhập dữ liệu"}],children:f.jsx(Nt,{placeholder:"Nhập tên ý định"})}),f.jsx(R.Item,{layout:"vertical",label:"Mô tả",name:"description",children:f.jsx(Nt.TextArea,{autoSize:{minRows:1,maxRows:6},placeholder:"Nhập mô tả ý định"})}),f.jsx(R.Item,{layout:"vertical",label:"Từ khóa",name:"keywords",children:f.jsx(Nt.TextArea,{autoSize:{minRows:1,maxRows:6},placeholder:"Nhập từ khóa, cách nhau bởi dấu phẩy"})}),f.jsx(R.Item,{label:null,name:"is_conversion",valuePropName:"checked",initialValue:!1,children:f.jsx(Fr,{children:"Đặt làm chuyển đổi"})})]})}),sce=A.createContext({attributes:{},listeners:void 0,ref(){}}),Lmt=({id:e,children:t,className:n,currentZoom:r=1})=>{const{attributes:o,isDragging:i,listeners:a,setNodeRef:s,setActivatorNodeRef:l,transform:c,transition:u}=Qw({id:e}),d=A.useMemo(()=>({attributes:o,listeners:a,ref:l}),[o,a,l]),h=c?{x:c.x*r,y:c.y*r,scaleX:1,scaleY:1}:null,p={opacity:i?.4:void 0,transform:Zd.Translate.toString(h),transition:u};return f.jsx(sce.Provider,{value:d,children:f.jsxs("div",{ref:s,className:n,style:p,children:[f.jsx(Bmt,{}),t]})})},Bmt=()=>{const{attributes:e,listeners:t,ref:n}=A.useContext(sce);return f.jsx(yt,{type:"text",size:"small",...e,...t,ref:n,children:f.jsx(zg,{className:ece})})},Fmt=()=>{const{setEdges:e,updateNode:t}=bn(),{nodeId:n}=Rn(),{context:r}=Xt(),o=Zl(),{mutate:i}=i_(),a=a_(),s=R.useFormInstance(),l=R.useWatch("conditions",s),[c,u]=A.useState(),d=A.useRef(null),h=(l??[]).map(b=>{var C;return(C=b.id)==null?void 0:C.toString()}).filter(b=>!!b),p=(b,C)=>{const S=s.getFieldValue("conditions")||[],E=S.find(N=>{var O;return((O=N.id)==null?void 0:O.toString())===b}),x={...Jw(C),id:b,slug:(E==null?void 0:E.slug)??C.slug},I=S.map(N=>{var O;return((O=N.id)==null?void 0:O.toString())===b?x:N});s.setFieldValue("conditions",I),t(n,N=>({...N,data:{...N.data,conditions:[...I]}})),i({SCENARIO_ID:r.CALLBOTSCENARIO_ID,INTENT_ID:b,label:C.label,description:C.description,keywords:C.keywords,is_conversion:C.is_conversion},{onSuccess:N=>{a({dataKey:"conditions",item:r_(N.data)}),o.invalidateQueries({queryKey:Zm(r.COMPANY_ID,r.CALLBOTSCENARIO_ID)}),o.invalidateQueries({queryKey:Xm(r.COMPANY_ID,r.CALLBOTSCENARIO_ID)})}})},g=b=>{const C=s.getFieldValue("conditions")||[],S=C.find(I=>{var N;return((N=I.id)==null?void 0:N.toString())===b}),E=S?qy(S):void 0,x=C.filter(I=>{var N;return((N=I.id)==null?void 0:N.toString())!==b});s.setFieldValue("conditions",x),E&&e(I=>I.filter(N=>N.sourceHandle!==E&&N.targetHandle!==E)),t(n,I=>({...I,data:{...I.data,conditions:[...x]}}))},y=Lw(Jd(Gm,{activationConstraint:{distance:8}}),Jd(Um,{coordinateGetter:Yw})),v=b=>{const{active:C,over:S}=b;if((C==null?void 0:C.id)!==(S==null?void 0:S.id)){const E=l.findIndex(I=>{var N;return((N=I.id)==null?void 0:N.toString())===(C==null?void 0:C.id)}),x=l.findIndex(I=>{var N;return((N=I.id)==null?void 0:N.toString())===(S==null?void 0:S.id)});s.setFieldValue("conditions",tf(l,E,x)),t(n,I=>{const N=tf(l,E,x);return{...I,data:{...I.data,conditions:N}}})}};return f.jsxs(f.Fragment,{children:[f.jsx(R.List,{name:"conditions",children:b=>nt.isEmpty(b)?f.jsx(ki,{}):null}),f.jsx(Ww,{sensors:y,collisionDetection:Bw,onDragEnd:v,children:f.jsx(Gw,{items:h,strategy:Uw,children:l==null?void 0:l.map(b=>{var C,S,E,x,I;return f.jsx(Lmt,{className:$mt,id:(C=b==null?void 0:b.id)==null?void 0:C.toString(),children:f.jsx(tu,{autoAdjustOverflow:!0,getPopupContainer:()=>document.body,styles:{body:{minWidth:350}},placement:"leftTop",content:f.jsx(ace,{ref:d,defaultValues:b,dataSubmit:N=>{var O;p(((O=b.id)==null?void 0:O.toString())||"",N)},onFormSubmit:()=>{nt.isEmpty(c)||u(null)}}),trigger:"click",open:c===((S=b==null?void 0:b.id)==null?void 0:S.toString())&&!ip(b),onOpenChange:N=>{var O,T;N?u((O=b.id)==null?void 0:O.toString()):((T=d.current)==null||T.onSubmit(),u(null))},children:f.jsxs(Ke,{onClick:N=>{var O;N.stopPropagation(),u((O=b==null?void 0:b.id)==null?void 0:O.toString())},align:"center",justify:"space-between",style:{flex:1},children:[f.jsx(ge.Text,{style:{marginBottom:0},children:b==null?void 0:b.label}),(x=(E=b==null?void 0:b.id)==null?void 0:E.toString())!=null&&x.includes("condition-default")&&!Uy(b)?null:f.jsx(yt,{type:"text",icon:f.jsx(uc,{}),onClick:()=>{var N;g(((N=b==null?void 0:b.id)==null?void 0:N.toString())||"")}})]})})},(I=b==null?void 0:b.id)==null?void 0:I.toString())})})})]})},jmt=240,zmt=16,lce=({children:e,isOuter:t,nodeId:n,containerRenderID:r,onToggleModal:o})=>{var V,U;const{closeModal:i}=Rn(),a=ph(),s=A.useRef(null),{isOpen:l,onToggle:c}=Eo(),{context:u}=Xt(),[d,h]=A.useState(!1),{token:p}=tE.useToken(),{getNode:g,updateNode:y}=bn(),{data:v,fetchNextPage:b,hasNextPage:C,isFetchingNextPage:S,isLoading:E}=Fae({SCENARIO_ID:u.CALLBOTSCENARIO_ID,pageSize:10,enabled:!!(u.COMPANY_ID&&u.CALLBOTSCENARIO_ID)}),x=A.useMemo(()=>(v==null?void 0:v.pages.flatMap(q=>q.data.results))??[],[v==null?void 0:v.pages]),I=Zl(),{mutateAsync:N}=s_(),O=(n?(U=(V=g(n))==null?void 0:V.data)==null?void 0:U.conditions:[])??[],T=O.some(q=>Qm(q)),M=O.some(q=>Rm(q)),_=A.useCallback(q=>{const W=Qm(q)?ex():Rm(q)?tx():Jw(q);if(n&&y(n,G=>({...G,data:{...G.data,conditions:Ym(G.data.conditions??[],W)}})),t)return;const H=a.getFieldValue("conditions")||[],K=Ym(H,W);a.setFieldValue("conditions",K)},[a,t,n,y]),L=A.useCallback(()=>{h(!1),c(),o==null||o(!l)},[c,o,l]),P=A.useCallback(q=>{_(q),h(!1)},[_]),$=A.useMemo(()=>[...x.filter(W=>!Uy(W)).map((W,H)=>{var K;return{key:((K=W.id)==null?void 0:K.toString())??`intent-${H}`,label:W.label??W.slug??"Ý định không tên",onClick:()=>P(W)}}),{key:"default-silence-intent",label:"Im lặng",disabled:T,onClick:T?void 0:()=>P({label:Go.SILENT.label})},{key:"default-noresponse-intent",label:Go.NORESPONSE.label,disabled:M,onClick:M?void 0:()=>P({label:Go.NORESPONSE.label})}],[P,M,T,x]),B=A.useCallback(async q=>{const W=q.currentTarget;W.scrollTop+W.clientHeight>=W.scrollHeight-zmt&&C&&!S&&await b()},[b,C,S]),D=q=>{h(q),q&&t&&i()},F=A.useCallback(()=>document.getElementById(r)||document.body,[r]),z=async q=>{const W=await N({...q,SCENARIO_ID:u.CALLBOTSCENARIO_ID});await Promise.all([I.invalidateQueries({queryKey:Zm(u.COMPANY_ID,u.CALLBOTSCENARIO_ID)}),I.invalidateQueries({queryKey:Xm(u.COMPANY_ID,u.CALLBOTSCENARIO_ID)})]),_(W.data),L()};return f.jsxs(f.Fragment,{children:[f.jsx(Fs,{open:d,menu:{items:$},placement:"bottomRight",trigger:["click"],onOpenChange:D,popupRender:q=>f.jsxs("div",{style:{backgroundColor:p.colorBgElevated,borderRadius:p.borderRadiusLG,boxShadow:p.boxShadowSecondary,minWidth:220},children:[f.jsxs("div",{style:{maxHeight:jmt,overflowY:"auto"},onScroll:B,children:[$.length>0?A.cloneElement(q,{style:{borderRadius:0}}):f.jsx("div",{style:{padding:8},children:f.jsx(ki,{image:ki.PRESENTED_IMAGE_SIMPLE,description:"Chưa có ý định"})}),(E||S)&&f.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"8px 0"},children:f.jsx(ou,{size:"small"})})]}),f.jsx(ia,{style:{margin:0}}),f.jsx(yt,{type:"text",block:!0,icon:f.jsx(y1,{}),onClick:L,children:"Mới"})]}),children:e}),f.jsx(to,{open:l,closeIcon:null,width:400,destroyOnHidden:!0,maskClosable:!1,mask:!1,getContainer:F,footer:[f.jsx(yt,{onClick:L,children:"Hủy"},"cancel"),f.jsx(yt,{type:"primary",onClick:()=>{var q;(q=s.current)==null||q.onSubmit()},children:"Lưu"},"submit")],children:f.jsx(ace,{ref:s,dataSubmit:q=>{z(q)},onFormSubmit:()=>{}})})]})},{Text:cce}=ge,Vmt={validator:(e,t)=>t==null||t===""||Number(t)>=1?Promise.resolve():Promise.reject(new Error("Giá trị phải lớn hơn hoặc bằng 1"))},Hmt={validator:(e,t)=>t==null||t===""||Number(t)>=2?Promise.resolve():Promise.reject(new Error("Giá trị phải lớn hơn hoặc bằng 2"))},uce=({id:e})=>{const{getEdges:t,setEdges:n}=bn(),r=Cr(),{data:o}=Nh(e),i=o,a=A.useId(),[s,l]=A.useState(!1),[c]=R.useForm(),u=p=>{r(e,p)},d=A.useMemo(()=>nt.debounce(()=>{c.submit()},500),[c]);A.useEffect(()=>()=>{d.cancel()},[d]),lE(()=>{!c.isFieldsTouched()&&i.conditions&&c.setFieldsValue(i)},[i.conditions]);const h=p=>{if(t().some(b=>b.target===e))return;const y=c.getFieldValue("conditions")||[];if(p){const{removedDefaultConditions:b,nextConditions:C}=Nae(y),S=Oae(b);S!=null&&S.length&&n(E=>E.filter(x=>!S.includes(x.targetHandle||"")&&!S.includes(x.sourceHandle||""))),c.setFieldsValue({conditions:C}),r(e,{...i,conditions:C});return}const v=Tae(y,()=>{const b=`condition-default-${kl()}`;return{id:b,slug:b,is_conversion:!1,...Go.DEFAULT}},ex,tx);v.length!==y.length&&(c.setFieldsValue({conditions:v}),r(e,{...i,conditions:v}))};return f.jsxs("div",{style:{height:"100%"},children:[f.jsx(R,{form:c,layout:"horizontal",initialValues:{...i},onFinish:u,onValuesChange:d,children:f.jsxs(Cn,{direction:"vertical",size:"small",style:{width:"100%"},children:[f.jsx("div",{style:{width:"100%"},children:f.jsx(ch,{block:!0,size:"middle",style:{width:"100%"},options:[{label:f.jsxs(Ke,{align:"center",gap:12,justify:"center",children:[f.jsx(VO,{size:12}),"Ý định"]}),value:du.INTENT},{label:f.jsxs(Ke,{align:"center",gap:12,justify:"center",children:[f.jsx(BY,{size:12}),"Nhận diện biến"]}),value:du.VARIABLE}]})}),f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[f.jsx(ge.Title,{level:5,style:{marginTop:"unset"},children:"Ý định"}),f.jsx(lce,{onToggleModal:p=>{l(p)},nodeId:e,containerRenderID:a,children:f.jsx(yt,{size:"small",type:"primary",icon:f.jsx(si,{})})})]}),f.jsx(Fmt,{}),f.jsx(ia,{style:{margin:"12px 0"}}),f.jsxs(Cn,{direction:"vertical",size:16,style:{width:"100%"},children:[f.jsx(ge.Title,{level:5,style:{marginTop:"unset"},children:"Cấu hình"}),f.jsx(R.Item,{rules:[{required:!0,message:"Vui lòng nhập thời gian nghe tối đa"},Hmt],name:"maximum_listentime",children:f.jsx(Nt,{addonBefore:"Thời gian nghe tối đa",type:"number",min:2,addonAfter:"giây",style:{width:"100%"}})}),f.jsx(R.Item,{rules:[{required:!0,message:"Vui lòng nhập số lần kích hoạt tối đa"},Vmt],name:"maximum_retry",children:f.jsx(Nt,{addonBefore:"Kích hoạt mỗi TH tối đa",type:"number",min:1,addonAfter:"lần",style:{width:"100%"}})}),f.jsx(R.Item,{name:"is_global_node",valuePropName:"checked",style:{marginBottom:0},labelCol:{span:21},labelAlign:"left",label:f.jsx(pr,{title:`Cho phép node này được kích hoạt tại bất cứ thời điểm nào
772
772
  trong cuộc gọi`,children:f.jsx(cce,{children:"Node toàn cục"})}),children:f.jsx(zi,{onChange:h})}),f.jsx(R.Item,{name:"is_conjunction",valuePropName:"checked",style:{marginBottom:0},labelCol:{span:21},labelAlign:"left",label:f.jsx(pr,{title:"Trong khi phân loại ý định, bot sẽ nói từ nối trước node bot nói tiếp theo để hội thoại tự nhiên hơn. Ví dụ: Dạ vâng ạ, dạ vâng,... (Tuỳ chỉnh từ nối)",children:f.jsx(cce,{children:"Sử dụng từ nối"})}),children:f.jsx(zi,{})})]})]})}),s?f.jsx("div",{id:a,className:Pmt}):null]})},{Text:Wmt}=ge,dce=({id:e,data:t,mini:n})=>{const{displayComponent:r,nodeId:o}=Rn(),i=t.type||du.INTENT,[a,s]=A.useState(!1),l=c=>{const u=c.target;u!=null&&u.closest(`button, [role="button"], .${_r}-modal-wrap, input, ul, li`)||(c.stopPropagation(),c.preventDefault(),r(f.jsx(uce,{id:e}),"Cài đặt node nghe",()=>{},e))};return n?f.jsxs(fo,{className:tce,styles:{body:{padding:"8px"}},children:[f.jsx("div",{className:`${oce}`,children:f.jsxs("div",{className:rce,children:[f.jsx(Ah,{size:24,color:Fn.listenBlock.focus}),f.jsx(Wmt,{strong:!0,className:_mt,children:t.title})]})}),f.jsx("div",{className:ice})]}):f.jsx("div",{className:Mmt,onClick:l,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&l(c)},children:f.jsxs("div",{className:`${tce} ${o===e?nce.active:nce.default}`,children:[f.jsxs("div",{className:`${oce} drag-handle__custom`,children:[f.jsxs("div",{className:rce,children:[f.jsxs(Ke,{gap:2,children:[t.is_global_node?f.jsx(vs,{size:16,variant:"Bold",color:Fn.listenBlock.focus}):null,f.jsx(Ah,{style:{fontSize:16,color:Fn.listenBlock.focus}})]}),f.jsx(Xd,{id:e,color:Fn.listenBlock.focus})]}),f.jsx(Iu,{id:e,deleteBtnColor:Fn.listenBlock.focus})]}),f.jsxs(Ke,{gap:4,justify:"space-between",align:"center",children:[f.jsx(ch,{block:!0,size:"small",style:{width:"100%",fontSize:12},options:[{label:f.jsxs(Ke,{align:"center",gap:6,justify:"center",children:[f.jsx(VO,{size:12}),"Ý định"]}),value:du.INTENT,disabled:i===du.VARIABLE},{label:f.jsxs(Ke,{align:"center",gap:6,justify:"center",children:[f.jsx(BY,{size:12}),"Nhận diện biến"]}),value:du.VARIABLE,disabled:i===du.INTENT}],value:i}),f.jsx(lce,{isOuter:!0,nodeId:e,onToggleModal:c=>{s(c)},containerRenderID:`listen-condition-${e}-container`,children:f.jsx(yt,{size:"small",shape:"circle",type:"primary",style:{backgroundColor:Fn.listenBlock.focus},icon:f.jsx(si,{})})})]}),f.jsx("div",{className:ice,children:f.jsx(kmt,{NODE_ID:e})}),a?f.jsx("div",{id:`listen-condition-${e}-container`,className:Dmt}):null]})})},Kmt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(dce,{id:t,data:e})]}),fce=({record:e,className:t,style:n})=>{const{isReadOnly:r}=Dy(),o=A.useRef(null),[i,a]=A.useState(!1),[s,l]=A.useState(!1);A.useEffect(()=>{e&&l(!1),a(!1);const u=o.current;u&&!u.paused&&(u.pause(),u.currentTime=0)},[e]),A.useEffect(()=>()=>{const u=o.current;u&&!u.paused&&u.pause()},[]);const c=()=>{if(r)return;const u=o.current;!u||s||(u.paused?u.play().catch(d=>{console.error("Playback failed:",d),l(!0),a(!1)}):u.pause())};if(!s)return f.jsxs(f.Fragment,{children:[f.jsx("audio",{ref:o,src:e,preload:"auto",onPlay:()=>a(!0),onPause:()=>a(!1),onEnded:()=>a(!1),onError:()=>l(!0)}),f.jsx("button",{disabled:r,onClick:c,className:t,style:{...n,background:"none",border:"none",padding:0,cursor:r?"not-allowed":"pointer"},"aria-label":i?"Dừng phát":"Phát audio",type:"button",children:i?f.jsx(DHe,{color:"red"}):f.jsx(PHe,{color:"red"})})]})};var qmt="scripts_editor_10lsbsa0",Umt="scripts_editor_10lsbsa1",hce="scripts_editor_10lsbsa2",pce={default:"scripts_editor_10lsbsa3",active:"scripts_editor_10lsbsa4"},gce="scripts_editor_10lsbsa5",mce="scripts_editor_10lsbsa6",Gmt="scripts_editor_10lsbsa7",Qmt="scripts_editor_10lsbsaa",Rmt="scripts_editor_10lsbsac",vce="scripts_editor_10lsbsad",yce="scripts_editor_10lsbsae",Ymt="scripts_editor_10lsbsaf",bce="scripts_editor_10lsbsag",_7="scripts_editor_10lsbsah";const Xmt=()=>{const{axiosInstance:e,context:{COMPANY_ID:t,CALLBOTSCENARIO_ID:n}}=Xt(),{error:r}=nb();return Bf({mutationFn:async({audio:o})=>{var a,s,l;if(!t||!n)throw new Error("COMPANY_ID and CALLBOTSCENARIO_ID are required");const i=new FormData;i.append("raw_file",o);try{return(await e.postForm(`/company/${t}/callbotscenario/${n}/file`,i)).data}catch(c){const u=c;throw r((l=(s=(a=u.response)==null?void 0:a.data)==null?void 0:s.raw_file)==null?void 0:l[0]),u}},onError:o=>{console.error("Upload audio error:",o)}})};function Xi(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(c){try{l(r.next(c))}catch(u){i(u)}}function s(c){try{l(r.throw(c))}catch(u){i(u)}}function l(c){var u;c.done?o(c.value):(u=c.value,u instanceof n?u:new n(function(d){d(u)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;let rb=class{constructor(){this.listeners={}}on(t,n,r){if(this.listeners[t]||(this.listeners[t]=new Set),r==null?void 0:r.once){const o=(...i)=>{this.un(t,o),n(...i)};return this.listeners[t].add(o),()=>this.un(t,o)}return this.listeners[t].add(n),()=>this.un(t,n)}un(t,n){var r;(r=this.listeners[t])===null||r===void 0||r.delete(n)}once(t,n){return this.on(t,n,{once:!0})}unAll(){this.listeners={}}emit(t,...n){this.listeners[t]&&this.listeners[t].forEach(r=>r(...n))}};const Mx={decode:function(e,t){return Xi(this,void 0,void 0,function*(){const n=new AudioContext({sampleRate:t});try{return yield n.decodeAudioData(e)}finally{n.close()}})},createBuffer:function(e,t){if(!e||e.length===0)throw new Error("channelData must be a non-empty array");if(t<=0)throw new Error("duration must be greater than 0");if(typeof e[0]=="number"&&(e=[e]),!e[0]||e[0].length===0)throw new Error("channelData must contain non-empty channel arrays");return function(n){const r=n[0];if(r.some(o=>o>1||o<-1)){const o=r.length;let i=0;for(let a=0;a<o;a++){const s=Math.abs(r[a]);s>i&&(i=s)}for(const a of n)for(let s=0;s<o;s++)a[s]/=i}}(e),{duration:t,length:e[0].length,sampleRate:e[0].length/t,numberOfChannels:e.length,getChannelData:n=>e==null?void 0:e[n],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function Cce(e,t){const n=t.xmlns?document.createElementNS(t.xmlns,e):document.createElement(e);for(const[r,o]of Object.entries(t))if(r==="children"&&o)for(const[i,a]of Object.entries(o))a instanceof Node?n.appendChild(a):typeof a=="string"?n.appendChild(document.createTextNode(a)):n.appendChild(Cce(i,a));else r==="style"?Object.assign(n.style,o):r==="textContent"?n.textContent=o:n.setAttribute(r,o.toString());return n}function Ace(e,t,n){const r=Cce(e,t||{});return n==null||n.appendChild(r),r}var Zmt=Object.freeze({__proto__:null,createElement:Ace,default:Ace});const Jmt={fetchBlob:function(e,t,n){return Xi(this,void 0,void 0,function*(){const r=yield fetch(e,n);if(r.status>=400)throw new Error(`Failed to fetch ${e}: ${r.status} (${r.statusText})`);return function(o,i){Xi(this,void 0,void 0,function*(){if(!o.body||!o.headers)return;const a=o.body.getReader(),s=Number(o.headers.get("Content-Length"))||0;let l=0,c=0;const u=h=>Xi(this,void 0,void 0,function*(){l+=(h==null?void 0:h.length)||0;const p=Math.round(l/s*100);i(p)}),d=()=>Xi(this,void 0,void 0,function*(){if(c++>1e5)return void console.error("Fetcher: Maximum iterations reached, stopping read loop");let h;try{h=yield a.read()}catch{return}h.done||(u(h.value),yield d())});d()})}(r.clone(),t),r.blob()})}};let evt=class extends rb{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,n,r){return this.media.addEventListener(t,n,r),()=>this.media.removeEventListener(t,n,r)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,n){const r=this.getSrc();if(t&&r===t)return;this.revokeSrc();const o=n instanceof Blob&&(this.canPlayType(n.type)||!t)?URL.createObjectURL(n):t;if(r&&this.media.removeAttribute("src"),o||t)try{this.media.src=o}catch{this.media.src=t}}destroy(){this.isExternalMedia||(this.media.pause(),this.revokeSrc(),this.media.removeAttribute("src"),this.media.load(),this.media.remove())}setMediaElement(t){this.media=t}play(){return Xi(this,void 0,void 0,function*(){try{return yield this.media.play()}catch(t){if(t instanceof DOMException&&t.name==="AbortError")return;throw t}})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,n){n!=null&&(this.media.preservesPitch=n),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}};class uv extends rb{constructor(t,n){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.dragUnsubscribe=null,this.subscriptions=[],this.options=t;const r=this.parentFromOptionsContainer(t.container);this.parent=r;const[o,i]=this.initHtml();r.appendChild(o),this.container=o,this.scrollContainer=i.querySelector(".scroll"),this.wrapper=i.querySelector(".wrapper"),this.canvasWrapper=i.querySelector(".canvases"),this.progressWrapper=i.querySelector(".progress"),this.cursor=i.querySelector(".cursor"),n&&i.appendChild(n),this.initEvents()}parentFromOptionsContainer(t){let n;if(typeof t=="string"?n=document.querySelector(t):t instanceof HTMLElement&&(n=t),!n)throw new Error("Container not found");return n}initEvents(){const t=n=>{const r=this.wrapper.getBoundingClientRect(),o=n.clientX-r.left,i=n.clientY-r.top;return[o/r.width,i/r.height]};if(this.wrapper.addEventListener("click",n=>{const[r,o]=t(n);this.emit("click",r,o)}),this.wrapper.addEventListener("dblclick",n=>{const[r,o]=t(n);this.emit("dblclick",r,o)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:n,scrollWidth:r,clientWidth:o}=this.scrollContainer,i=n/r,a=(n+o)/r;this.emit("scroll",i,a,n,n+o)}),typeof ResizeObserver=="function"){const n=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{n().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.dragUnsubscribe||(this.dragUnsubscribe=function(t,n,r,o,i=3,a=0,s=100){if(!t)return()=>{};const l=matchMedia("(pointer: coarse)").matches;let c=()=>{};const u=d=>{if(d.button!==a)return;d.preventDefault(),d.stopPropagation();let h=d.clientX,p=d.clientY,g=!1;const y=Date.now(),v=x=>{if(x.preventDefault(),x.stopPropagation(),l&&Date.now()-y<s)return;const I=x.clientX,N=x.clientY,O=I-h,T=N-p;if(g||Math.abs(O)>i||Math.abs(T)>i){const M=t.getBoundingClientRect(),{left:_,top:L}=M;g||(r==null||r(h-_,p-L),g=!0),n(O,T,I-_,N-L),h=I,p=N}},b=x=>{if(g){const I=x.clientX,N=x.clientY,O=t.getBoundingClientRect(),{left:T,top:M}=O;o==null||o(I-T,N-M)}c()},C=x=>{x.relatedTarget&&x.relatedTarget!==document.documentElement||b(x)},S=x=>{g&&(x.stopPropagation(),x.preventDefault())},E=x=>{g&&x.preventDefault()};document.addEventListener("pointermove",v),document.addEventListener("pointerup",b),document.addEventListener("pointerout",C),document.addEventListener("pointercancel",C),document.addEventListener("touchmove",E,{passive:!1}),document.addEventListener("click",S,{capture:!0}),c=()=>{document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",b),document.removeEventListener("pointerout",C),document.removeEventListener("pointercancel",C),document.removeEventListener("touchmove",E),setTimeout(()=>{document.removeEventListener("click",S,{capture:!0})},10)}};return t.addEventListener("pointerdown",u),()=>{c(),t.removeEventListener("pointerdown",u)}}(this.wrapper,(t,n,r)=>{this.emit("drag",Math.max(0,Math.min(1,r/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}),this.subscriptions.push(this.dragUnsubscribe))}getHeight(t,n){var r;const o=((r=this.audioData)===null||r===void 0?void 0:r.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const i=this.parent.clientHeight||128;return n!=null&&n.every(a=>!a.overlay)?i/o:i}return 128}initHtml(){const t=document.createElement("div"),n=t.attachShadow({mode:"open"}),r=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return n.innerHTML=`
773
773
  <style${r?` nonce="${r}"`:""}>
774
774
  :host {
@@ -857,7 +857,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
857
857
  ***************************************************************************** */function Ece(e,t){const[n,r]=A.useState(null),o=A.useMemo(()=>Object.entries(t).flat(),[t]);return A.useEffect(()=>{if(!(e!=null&&e.current))return;const i=P7.create(Object.assign(Object.assign({},t),{container:e.current}));return r(i),()=>{i.destroy()}},[e,...o]),n}const Sce=/^on([A-Z])/,rvt=e=>Sce.test(e);function ovt(e,t){const n=A.useMemo(()=>Object.entries(t).flat(),[t]);A.useEffect(()=>{if(!e)return;const r=Object.entries(t);if(!r.length)return;const o=r.map(([i,a])=>{const s=i.replace(Sce,(l,c)=>c.toLowerCase());return e.on(s,(...l)=>a(e,...l))});return()=>{o.forEach(i=>i())}},[e,...n])}A.memo(e=>{const t=A.useRef(null),[n,r]=function(o){return A.useMemo(()=>{const i=Object.assign({},o),a=Object.assign({},o);for(const s in i)rvt(s)?delete i[s]:delete a[s];return[i,a]},[o])}(e);return ovt(Ece(t,n),r),f.jsx("div",{ref:t})});function wce(e){var{container:t}=e;const n=Ece(t,function(o,i){var a={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.indexOf(s)<0&&(a[s]=o[s]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function"){var l=0;for(s=Object.getOwnPropertySymbols(o);l<s.length;l++)i.indexOf(s[l])<0&&Object.prototype.propertyIsEnumerable.call(o,s[l])&&(a[s[l]]=o[s[l]])}return a}(e,["container"])),r=function(o){const[i,a]=A.useState(!1),[s,l]=A.useState(!1),[c,u]=A.useState(!1),[d,h]=A.useState(0);return A.useEffect(()=>{if(!o)return;const p=[o.on("load",()=>{a(!1),l(!1),h(0)}),o.on("ready",()=>{a(!0),l(!1),u(!1),h(0)}),o.on("finish",()=>{u(!0)}),o.on("play",()=>{l(!0)}),o.on("pause",()=>{l(!1)}),o.on("timeupdate",()=>{h(o.getCurrentTime())}),o.on("destroy",()=>{a(!1),l(!1)})];return()=>{p.forEach(g=>g())}},[o]),A.useMemo(()=>({isReady:i,isPlaying:s,hasFinished:c,currentTime:d}),[s,c,d,i])}(n);return A.useMemo(()=>Object.assign(Object.assign({},r),{wavesurfer:n}),[r,n])}function D7(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(c){try{l(r.next(c))}catch(u){i(u)}}function s(c){try{l(r.throw(c))}catch(u){i(u)}}function l(c){var u;c.done?o(c.value):(u=c.value,u instanceof n?u:new n(function(d){d(u)})).then(a,s)}l((r=r.apply(e,[])).next())})}typeof SuppressedError=="function"&&SuppressedError;let xce=class{constructor(){this.listeners={}}on(t,n,r){if(this.listeners[t]||(this.listeners[t]=new Set),r==null?void 0:r.once){const o=(...i)=>{this.un(t,o),n(...i)};return this.listeners[t].add(o),()=>this.un(t,o)}return this.listeners[t].add(n),()=>this.un(t,n)}un(t,n){var r;(r=this.listeners[t])===null||r===void 0||r.delete(n)}once(t,n){return this.on(t,n,{once:!0})}unAll(){this.listeners={}}emit(t,...n){this.listeners[t]&&this.listeners[t].forEach(r=>r(...n))}},ivt=class extends xce{constructor(t){super(),this.subscriptions=[],this.isDestroyed=!1,this.options=t}onInit(){}_init(t){this.isDestroyed&&(this.subscriptions=[],this.isDestroyed=!1),this.wavesurfer=t,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(t=>t()),this.subscriptions=[],this.isDestroyed=!0,this.wavesurfer=void 0}},avt=class extends xce{constructor(){super(...arguments),this.animationFrameId=null,this.isRunning=!1}start(){if(this.isRunning)return;this.isRunning=!0;const t=()=>{this.isRunning&&(this.emit("tick"),this.animationFrameId=requestAnimationFrame(t))};t()}stop(){this.isRunning=!1,this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}destroy(){this.stop()}};const svt=["audio/webm","audio/wav","audio/mpeg","audio/mp4","audio/mp3"];let lvt=class Age extends ivt{constructor(t){var n,r,o,i,a,s;super(Object.assign(Object.assign({},t),{audioBitsPerSecond:(n=t.audioBitsPerSecond)!==null&&n!==void 0?n:128e3,scrollingWaveform:(r=t.scrollingWaveform)!==null&&r!==void 0&&r,scrollingWaveformWindow:(o=t.scrollingWaveformWindow)!==null&&o!==void 0?o:5,continuousWaveform:(i=t.continuousWaveform)!==null&&i!==void 0&&i,renderRecordedAudio:(a=t.renderRecordedAudio)===null||a===void 0||a,mediaRecorderTimeslice:(s=t.mediaRecorderTimeslice)!==null&&s!==void 0?s:void 0})),this.stream=null,this.mediaRecorder=null,this.dataWindow=null,this.isWaveformPaused=!1,this.lastStartTime=0,this.lastDuration=0,this.duration=0,this.micStream=null,this.recordedBlobUrl=null,this.timer=new avt,this.subscriptions.push(this.timer.on("tick",()=>{const l=performance.now()-this.lastStartTime;this.duration=this.isPaused()?this.duration:this.lastDuration+l,this.emit("record-progress",this.duration)}))}static create(t){return new Age(t||{})}renderMicStream(t){var n;const r=new AudioContext,o=r.createMediaStreamSource(t),i=r.createAnalyser();o.connect(i),this.options.continuousWaveform&&(i.fftSize=32);const a=i.frequencyBinCount,s=new Float32Array(a);let l=0;this.wavesurfer&&((n=this.originalOptions)!==null&&n!==void 0||(this.originalOptions=Object.assign({},this.wavesurfer.options)),this.wavesurfer.options.interact=!1,this.options.scrollingWaveform&&(this.wavesurfer.options.cursorWidth=0));const c=setInterval(()=>{var u,d,h,p;if(!this.isWaveformPaused){if(i.getFloatTimeDomainData(s),this.options.scrollingWaveform){const g=Math.floor((this.options.scrollingWaveformWindow||0)*r.sampleRate),y=Math.min(g,this.dataWindow?this.dataWindow.length+a:a),v=new Float32Array(g);if(this.dataWindow){const b=Math.max(0,g-this.dataWindow.length);v.set(this.dataWindow.slice(-y+a),b)}v.set(s,g-a),this.dataWindow=v}else if(this.options.continuousWaveform){if(!this.dataWindow){const y=this.options.continuousWaveformDuration?Math.round(100*this.options.continuousWaveformDuration):((d=(u=this.wavesurfer)===null||u===void 0?void 0:u.getWidth())!==null&&d!==void 0?d:0)*window.devicePixelRatio;this.dataWindow=new Float32Array(y)}let g=0;for(let y=0;y<a;y++){const v=Math.abs(s[y]);v>g&&(g=v)}if(l+1>this.dataWindow.length){const y=new Float32Array(2*this.dataWindow.length);y.set(this.dataWindow,0),this.dataWindow=y}this.dataWindow[l]=g,l++}else this.dataWindow=s;if(this.wavesurfer){const g=((p=(h=this.dataWindow)===null||h===void 0?void 0:h.length)!==null&&p!==void 0?p:0)/100;this.wavesurfer.load("",[this.dataWindow],this.options.scrollingWaveform?this.options.scrollingWaveformWindow:g).then(()=>{this.wavesurfer&&this.options.continuousWaveform&&(this.wavesurfer.setTime(this.getDuration()/1e3),this.wavesurfer.options.minPxPerSec||this.wavesurfer.setOptions({minPxPerSec:this.wavesurfer.getWidth()/this.wavesurfer.getDuration()}))}).catch(y=>{console.error("Error rendering real-time recording data:",y)})}}},10);return{onDestroy:()=>{clearInterval(c),o==null||o.disconnect(),r==null||r.close()},onEnd:()=>{this.isWaveformPaused=!0,this.stopMic()}}}startMic(t){return D7(this,void 0,void 0,function*(){let n;this.micStream&&this.stopMic();try{n=yield navigator.mediaDevices.getUserMedia({audio:t==null||t})}catch(o){throw new Error("Error accessing the microphone: "+o.message)}const r=this.renderMicStream(n);return this.micStream=r,this.unsubscribeDestroy=this.once("destroy",r.onDestroy),this.unsubscribeRecordEnd=this.once("record-end",r.onEnd),this.stream=n,n})}stopMic(){var t,n,r;(t=this.micStream)===null||t===void 0||t.onDestroy(),(n=this.unsubscribeDestroy)===null||n===void 0||n.call(this),(r=this.unsubscribeRecordEnd)===null||r===void 0||r.call(this),this.micStream=null,this.unsubscribeDestroy=void 0,this.unsubscribeRecordEnd=void 0,this.stream&&(this.stream.getTracks().forEach(o=>o.stop()),this.stream=null,this.mediaRecorder=null)}startRecording(t){return D7(this,void 0,void 0,function*(){const n=this.stream||(yield this.startMic(t));this.dataWindow=null;const r=this.mediaRecorder||new MediaRecorder(n,{mimeType:this.options.mimeType||svt.find(a=>MediaRecorder.isTypeSupported(a)),audioBitsPerSecond:this.options.audioBitsPerSecond});this.mediaRecorder=r,this.stopRecording();const o=[];r.ondataavailable=a=>{a.data.size>0&&o.push(a.data),this.emit("record-data-available",a.data)};const i=a=>{var s;const l=new Blob(o,{type:r.mimeType});this.emit(a,l),this.options.renderRecordedAudio&&(this.applyOriginalOptionsIfNeeded(),this.recordedBlobUrl&&URL.revokeObjectURL(this.recordedBlobUrl),this.recordedBlobUrl=URL.createObjectURL(l),(s=this.wavesurfer)===null||s===void 0||s.load(this.recordedBlobUrl))};r.onpause=()=>i("record-pause"),r.onstop=()=>i("record-end"),r.start(this.options.mediaRecorderTimeslice),this.lastStartTime=performance.now(),this.lastDuration=0,this.duration=0,this.isWaveformPaused=!1,this.timer.start(),this.emit("record-start")})}getDuration(){return this.duration}isRecording(){var t;return((t=this.mediaRecorder)===null||t===void 0?void 0:t.state)==="recording"}isPaused(){var t;return((t=this.mediaRecorder)===null||t===void 0?void 0:t.state)==="paused"}isActive(){var t;return((t=this.mediaRecorder)===null||t===void 0?void 0:t.state)!=="inactive"}stopRecording(){var t;this.isActive()&&((t=this.mediaRecorder)===null||t===void 0||t.stop(),this.timer.stop())}pauseRecording(){var t,n;this.isRecording()&&(this.isWaveformPaused=!0,(t=this.mediaRecorder)===null||t===void 0||t.requestData(),(n=this.mediaRecorder)===null||n===void 0||n.pause(),this.timer.stop(),this.lastDuration=this.duration)}resumeRecording(){var t;this.isPaused()&&(this.isWaveformPaused=!1,(t=this.mediaRecorder)===null||t===void 0||t.resume(),this.timer.start(),this.lastStartTime=performance.now(),this.emit("record-resume"))}static getAvailableAudioDevices(){return D7(this,void 0,void 0,function*(){return navigator.mediaDevices.enumerateDevices().then(t=>t.filter(n=>n.kind==="audioinput"))})}destroy(){this.applyOriginalOptionsIfNeeded(),super.destroy(),this.stopRecording(),this.stopMic(),this.recordedBlobUrl&&(URL.revokeObjectURL(this.recordedBlobUrl),this.recordedBlobUrl=null)}applyOriginalOptionsIfNeeded(){this.wavesurfer&&this.originalOptions&&(this.wavesurfer.setOptions(this.originalOptions),delete this.originalOptions)}};const Ice=60*10,_x=({onStartRecord:e,onFinishRecord:t,disabled:n=!1})=>{const r=A.useRef(null),o=A.useRef(null),i=A.useRef(null),a=A.useRef(t),s=A.useRef(n);A.useEffect(()=>{a.current=t},[t]),A.useEffect(()=>{s.current=n},[n]);const[l,c]=A.useState(!1),[u,d]=A.useState(0),[h,p]=A.useState(!1),g=C=>{const S=Math.floor(C/60).toString().padStart(2,"0"),E=(C%60).toString().padStart(2,"0");return`${S}:${E}`},y=A.useRef(()=>{}),v=A.useCallback(()=>{s.current||o.current&&(o.current.stopRecording(),c(!1),i.current&&(clearTimeout(i.current),i.current=null))},[]);A.useEffect(()=>{y.current=v},[v]),wce({container:r,waveColor:"#b0dfff",progressColor:"#30b4ff",height:50,plugins:A.useMemo(()=>{const C=lvt.create({renderRecordedAudio:!1,continuousWaveform:!1,scrollingWaveform:!0,continuousWaveformDuration:30});return C.on("record-progress",S=>{const E=Math.floor(S/1e3);d(E),E>=Ice&&y.current()}),C.on("record-start",()=>{console.log("🎤 Recording started")}),C.on("record-end",async S=>{var I;const E=`${KHe("recording")}.webm`,x=new File([S],E,{type:S.type});p(!0),await((I=a.current)==null?void 0:I.call(a,x)),p(!1)}),C.on("record-data-available",async S=>{console.log("🎤 Recording finished, data available")}),o.current=C,[C]},[])});const b=()=>{n||o.current&&o.current.startRecording().then(()=>{c(!0),e==null||e(),d(0),i.current=setTimeout(()=>{y.current()},Ice*1e3)}).catch(C=>console.error("Start recording failed:",C))};return f.jsxs(Ke,{gap:12,align:"center",style:{flex:1},children:[l?f.jsx(yt,{type:"text",onClick:v,disabled:n||h,style:{width:"40px",height:"32px",borderRadius:"8px",backgroundColor:Fn.speakBlock.background,border:`1px solid ${Fn.speakBlock.border}`,display:"flex",alignItems:"center",justifyContent:"center",padding:0},children:f.jsx("div",{style:{width:"12px",height:"12px",backgroundColor:Fn.common.red,borderRadius:"2px"}})}):f.jsx(yt,{icon:h?f.jsx(Ds,{}):f.jsx(WO,{}),onClick:b,disabled:n||h,loading:h,children:h?"Đang tải lên...":"Ghi âm"}),f.jsx("div",{ref:r,style:{width:"100%",height:50,overflow:"hidden",opacity:l?1:0,pointerEvents:l?"auto":"none",transition:"opacity 0.2s"}}),l&&f.jsx("div",{style:{fontSize:14,fontWeight:500,minWidth:40,textAlign:"right"},children:g(u)})]})};var cvt="scripts_editor_14vtnyz0",uvt="scripts_editor_14vtnyz1",dvt="scripts_editor_14vtnyz2";const dv=({url:e,className:t,formPath:n,onDelete:r,style:o,disabled:i=!1})=>{const a=R.useFormInstance();if(!e||e==="")return f.jsx(Xf,{message:"Không có file âm thanh",description:"Vui lòng tải lên file âm thanh hoặc ghi âm",type:"info",showIcon:!0,icon:f.jsx(WO,{})});const s=()=>{n&&n.forEach(l=>{a.setFieldValue(l,void 0)}),r==null||r()};return f.jsx("div",{className:t,children:f.jsxs("div",{className:uvt,children:[f.jsxs("audio",{controls:!0,preload:"auto","aria-label":"Audio playback",src:e,style:{height:32,maxWidth:"260px",...o},children:[f.jsx("track",{kind:"captions",src:"",label:"Captions"}),"Trình duyệt của bạn không hỗ trợ phát âm thanh."]}),n&&f.jsx(yt,{className:dvt,danger:!0,disabled:i,icon:f.jsx(aa,{}),"aria-label":"Delete audio",style:{marginLeft:"8px"},onClick:s})]})})};var fvt="scripts_editor_1v7rh6r0";const Nce=({content:e})=>f.jsx("div",{className:fvt,children:e}),hvt=({prefixPaths:e=[]})=>f.jsxs(f.Fragment,{children:[f.jsx(Nce,{content:"Cắt file audio tự động có thể không chính xác bằng cắt file audio thủ công."}),f.jsx(R.Item,{name:[...e,"record","trim"],valuePropName:"checked",children:f.jsx(Fr,{children:f.jsxs(Ke,{align:"center",gap:8,children:["Tự động cắt file ghi âm",f.jsx(pr,{title:"Hệ thống tự động cắt phần đầu và phần cuối không có âm thanh",children:f.jsx(md,{})})]})})}),f.jsx(R.Item,{name:[...e,"record","autoGender"],valuePropName:"checked",children:f.jsx(Fr,{children:f.jsxs(Ke,{align:"center",gap:8,children:["Tự động tạo file ghi âm nam/nữ",f.jsx(pr,{title:`Hệ thống tự động tạo file ghi âm nam/nữ từ file ghi âm gốc,
858
858
  sử dụng trong tính năng nhận diện giới tính`,children:f.jsx(md,{})})]})})}),f.jsx(Ke,{justify:"center",children:f.jsx(yt,{type:"primary",children:"Áp dụng"})})]});let Oce=class{constructor(){this.listeners={}}on(t,n,r){if(this.listeners[t]||(this.listeners[t]=new Set),r==null?void 0:r.once){const o=(...i)=>{this.un(t,o),n(...i)};return this.listeners[t].add(o),()=>this.un(t,o)}return this.listeners[t].add(n),()=>this.un(t,n)}un(t,n){var r;(r=this.listeners[t])===null||r===void 0||r.delete(n)}once(t,n){return this.on(t,n,{once:!0})}unAll(){this.listeners={}}emit(t,...n){this.listeners[t]&&this.listeners[t].forEach(r=>r(...n))}},pvt=class extends Oce{constructor(t){super(),this.subscriptions=[],this.isDestroyed=!1,this.options=t}onInit(){}_init(t){this.isDestroyed&&(this.subscriptions=[],this.isDestroyed=!1),this.wavesurfer=t,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(t=>t()),this.subscriptions=[],this.isDestroyed=!0,this.wavesurfer=void 0}};function $x(e,t,n,r,o=3,i=0,a=100){if(!e)return()=>{};const s=matchMedia("(pointer: coarse)").matches;let l=()=>{};const c=u=>{if(u.button!==i)return;u.preventDefault(),u.stopPropagation();let d=u.clientX,h=u.clientY,p=!1;const g=Date.now(),y=E=>{if(E.preventDefault(),E.stopPropagation(),s&&Date.now()-g<a)return;const x=E.clientX,I=E.clientY,N=x-d,O=I-h;if(p||Math.abs(N)>o||Math.abs(O)>o){const T=e.getBoundingClientRect(),{left:M,top:_}=T;p||(n==null||n(d-M,h-_),p=!0),t(N,O,x-M,I-_),d=x,h=I}},v=E=>{if(p){const x=E.clientX,I=E.clientY,N=e.getBoundingClientRect(),{left:O,top:T}=N;r==null||r(x-O,I-T)}l()},b=E=>{E.relatedTarget&&E.relatedTarget!==document.documentElement||v(E)},C=E=>{p&&(E.stopPropagation(),E.preventDefault())},S=E=>{p&&E.preventDefault()};document.addEventListener("pointermove",y),document.addEventListener("pointerup",v),document.addEventListener("pointerout",b),document.addEventListener("pointercancel",b),document.addEventListener("touchmove",S,{passive:!1}),document.addEventListener("click",C,{capture:!0}),l=()=>{document.removeEventListener("pointermove",y),document.removeEventListener("pointerup",v),document.removeEventListener("pointerout",b),document.removeEventListener("pointercancel",b),document.removeEventListener("touchmove",S),setTimeout(()=>{document.removeEventListener("click",C,{capture:!0})},10)}};return e.addEventListener("pointerdown",c),()=>{l(),e.removeEventListener("pointerdown",c)}}function Tce(e,t){const n=t.xmlns?document.createElementNS(t.xmlns,e):document.createElement(e);for(const[r,o]of Object.entries(t))if(r==="children"&&o)for(const[i,a]of Object.entries(o))a instanceof Node?n.appendChild(a):typeof a=="string"?n.appendChild(document.createTextNode(a)):n.appendChild(Tce(i,a));else r==="style"?Object.assign(n.style,o):r==="textContent"?n.textContent=o:n.setAttribute(r,o.toString());return n}function ob(e,t,n){const r=Tce(e,t||{});return n==null||n.appendChild(r),r}let kce=class extends Oce{constructor(t,n,r=0){var o,i,a,s,l,c,u,d,h,p;super(),this.totalDuration=n,this.numberOfChannels=r,this.element=null,this.minLength=0,this.maxLength=1/0,this.contentEditable=!1,this.subscriptions=[],this.updatingSide=void 0,this.isRemoved=!1,this.subscriptions=[],this.id=t.id||`region-${Math.random().toString(32).slice(2)}`,this.start=this.clampPosition(t.start),this.end=this.clampPosition((o=t.end)!==null&&o!==void 0?o:t.start),this.drag=(i=t.drag)===null||i===void 0||i,this.resize=(a=t.resize)===null||a===void 0||a,this.resizeStart=(s=t.resizeStart)===null||s===void 0||s,this.resizeEnd=(l=t.resizeEnd)===null||l===void 0||l,this.color=(c=t.color)!==null&&c!==void 0?c:"rgba(0, 0, 0, 0.1)",this.minLength=(u=t.minLength)!==null&&u!==void 0?u:this.minLength,this.maxLength=(d=t.maxLength)!==null&&d!==void 0?d:this.maxLength,this.channelIdx=(h=t.channelIdx)!==null&&h!==void 0?h:-1,this.contentEditable=(p=t.contentEditable)!==null&&p!==void 0?p:this.contentEditable,this.element=this.initElement(),this.setContent(t.content),this.setPart(),this.renderPosition(),this.initMouseEvents()}clampPosition(t){return Math.max(0,Math.min(this.totalDuration,t))}setPart(){var t;const n=this.start===this.end;(t=this.element)===null||t===void 0||t.setAttribute("part",`${n?"marker":"region"} ${this.id}`)}addResizeHandles(t){const n={position:"absolute",zIndex:"2",width:"6px",height:"100%",top:"0",cursor:"ew-resize",wordBreak:"keep-all"},r=ob("div",{part:"region-handle region-handle-left",style:Object.assign(Object.assign({},n),{left:"0",borderLeft:"2px solid rgba(0, 0, 0, 0.5)",borderRadius:"2px 0 0 2px"})},t),o=ob("div",{part:"region-handle region-handle-right",style:Object.assign(Object.assign({},n),{right:"0",borderRight:"2px solid rgba(0, 0, 0, 0.5)",borderRadius:"0 2px 2px 0"})},t);this.subscriptions.push($x(r,i=>this.onResize(i,"start"),()=>null,()=>this.onEndResizing("start"),1),$x(o,i=>this.onResize(i,"end"),()=>null,()=>this.onEndResizing("end"),1))}removeResizeHandles(t){const n=t.querySelector('[part*="region-handle-left"]'),r=t.querySelector('[part*="region-handle-right"]');n&&t.removeChild(n),r&&t.removeChild(r)}initElement(){if(this.isRemoved)return null;const t=this.start===this.end;let n=0,r=100;this.channelIdx>=0&&this.numberOfChannels>0&&this.channelIdx<this.numberOfChannels&&(r=100/this.numberOfChannels,n=r*this.channelIdx);const o=ob("div",{style:{position:"absolute",top:`${n}%`,height:`${r}%`,backgroundColor:t?"none":this.color,borderLeft:t?"2px solid "+this.color:"none",borderRadius:"2px",boxSizing:"border-box",transition:"background-color 0.2s ease",cursor:this.drag?"grab":"default",pointerEvents:"all"}});return!t&&this.resize&&this.addResizeHandles(o),o}renderPosition(){if(!this.element)return;const t=this.start/this.totalDuration,n=(this.totalDuration-this.end)/this.totalDuration;this.element.style.left=100*t+"%",this.element.style.right=100*n+"%"}toggleCursor(t){var n;this.drag&&(!((n=this.element)===null||n===void 0)&&n.style)&&(this.element.style.cursor=t?"grabbing":"grab")}initMouseEvents(){const{element:t}=this;t&&(t.addEventListener("click",n=>this.emit("click",n)),t.addEventListener("mouseenter",n=>this.emit("over",n)),t.addEventListener("mouseleave",n=>this.emit("leave",n)),t.addEventListener("dblclick",n=>this.emit("dblclick",n)),t.addEventListener("pointerdown",()=>this.toggleCursor(!0)),t.addEventListener("pointerup",()=>this.toggleCursor(!1)),this.subscriptions.push($x(t,n=>this.onMove(n),()=>this.toggleCursor(!0),()=>{this.toggleCursor(!1),this.drag&&this.emit("update-end")})),this.contentEditable&&this.content&&(this.contentClickListener=n=>this.onContentClick(n),this.contentBlurListener=()=>this.onContentBlur(),this.content.addEventListener("click",this.contentClickListener),this.content.addEventListener("blur",this.contentBlurListener)))}_onUpdate(t,n,r){var o;if(!(!((o=this.element)===null||o===void 0)&&o.parentElement))return;const{width:i}=this.element.parentElement.getBoundingClientRect(),a=t/i*this.totalDuration;let s=n&&n!=="start"?this.start:this.start+a,l=n&&n!=="end"?this.end:this.end+a;const c=r!==void 0;c&&this.updatingSide&&this.updatingSide!==n&&(this.updatingSide==="start"?s=r:l=r),s=Math.max(0,s),l=Math.min(this.totalDuration,l);const u=l-s;this.updatingSide=n;const d=u>=this.minLength&&u<=this.maxLength;s<=l&&(d||c)&&(this.start=s,this.end=l,this.renderPosition(),this.emit("update",n))}onMove(t){this.drag&&this._onUpdate(t)}onResize(t,n){this.resize&&(this.resizeStart||n!=="start")&&(this.resizeEnd||n!=="end")&&this._onUpdate(t,n)}onEndResizing(t){this.resize&&(this.emit("update-end",t),this.updatingSide=void 0)}onContentClick(t){t.stopPropagation(),t.target.focus(),this.emit("click",t)}onContentBlur(){this.emit("update-end")}_setTotalDuration(t){this.totalDuration=t,this.renderPosition()}play(t){this.emit("play",t&&this.end!==this.start?this.end:void 0)}getContent(t=!1){var n;return t?this.content||void 0:this.element instanceof HTMLElement?((n=this.content)===null||n===void 0?void 0:n.innerHTML)||void 0:""}setContent(t){var n;if(this.element)if(this.content&&this.contentEditable&&(this.contentClickListener&&this.content.removeEventListener("click",this.contentClickListener),this.contentBlurListener&&this.content.removeEventListener("blur",this.contentBlurListener)),(n=this.content)===null||n===void 0||n.remove(),t){if(typeof t=="string"){const r=this.start===this.end;this.content=ob("div",{style:{padding:`0.2em ${r?.2:.4}em`,display:"inline-block"},textContent:t})}else this.content=t;this.contentEditable&&(this.content.contentEditable="true",this.contentClickListener=r=>this.onContentClick(r),this.contentBlurListener=()=>this.onContentBlur(),this.content.addEventListener("click",this.contentClickListener),this.content.addEventListener("blur",this.contentBlurListener)),this.content.setAttribute("part","region-content"),this.element.appendChild(this.content),this.emit("content-changed")}else this.content=void 0}setOptions(t){var n,r;if(this.element){if(t.color&&(this.color=t.color,this.element.style.backgroundColor=this.color),t.drag!==void 0&&(this.drag=t.drag,this.element.style.cursor=this.drag?"grab":"default"),t.start!==void 0||t.end!==void 0){const o=this.start===this.end;this.start=this.clampPosition((n=t.start)!==null&&n!==void 0?n:this.start),this.end=this.clampPosition((r=t.end)!==null&&r!==void 0?r:o?this.start:this.end),this.renderPosition(),this.setPart()}if(t.content&&this.setContent(t.content),t.id&&(this.id=t.id,this.setPart()),t.resize!==void 0&&t.resize!==this.resize){const o=this.start===this.end;this.resize=t.resize,this.resize&&!o?this.addResizeHandles(this.element):this.removeResizeHandles(this.element)}t.resizeStart!==void 0&&(this.resizeStart=t.resizeStart),t.resizeEnd!==void 0&&(this.resizeEnd=t.resizeEnd)}}remove(){this.isRemoved=!0,this.emit("remove"),this.subscriptions.forEach(t=>t()),this.element&&(this.element.remove(),this.element=null)}};class L7 extends pvt{constructor(t){super(t),this.regions=[],this.regionsContainer=this.initRegionsContainer()}static create(t){return new L7(t)}onInit(){if(!this.wavesurfer)throw Error("WaveSurfer is not initialized");this.wavesurfer.getWrapper().appendChild(this.regionsContainer),this.subscriptions.push(this.wavesurfer.on("ready",n=>{this.regions.forEach(r=>r._setTotalDuration(n))}));let t=[];this.subscriptions.push(this.wavesurfer.on("timeupdate",n=>{const r=this.regions.filter(o=>o.start<=n&&(o.end===o.start?o.start+.05:o.end)>=n);r.forEach(o=>{t.includes(o)||this.emit("region-in",o)}),t.forEach(o=>{r.includes(o)||this.emit("region-out",o)}),t=r}))}initRegionsContainer(){return ob("div",{part:"regions-container",style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",zIndex:"5",pointerEvents:"none"}})}getRegions(){return this.regions}avoidOverlapping(t){t.content&&setTimeout(()=>{const n=t.content,r=n.getBoundingClientRect(),o=this.regions.map(i=>{if(i===t||!i.content)return 0;const a=i.content.getBoundingClientRect();return r.left<a.left+a.width&&a.left<r.left+r.width?a.height:0}).reduce((i,a)=>i+a,0);n.style.marginTop=`${o}px`},10)}adjustScroll(t){var n,r;if(!t.element)return;const o=(r=(n=this.wavesurfer)===null||n===void 0?void 0:n.getWrapper())===null||r===void 0?void 0:r.parentElement;if(!o)return;const{clientWidth:i,scrollWidth:a}=o;if(a<=i)return;const s=o.getBoundingClientRect(),l=t.element.getBoundingClientRect(),c=l.left-s.left,u=l.right-s.left;c<0?o.scrollLeft+=c:u>i&&(o.scrollLeft+=u-i)}virtualAppend(t,n,r){const o=()=>{if(!this.wavesurfer)return;const i=this.wavesurfer.getWidth(),a=this.wavesurfer.getScroll(),s=n.clientWidth,l=this.wavesurfer.getDuration(),c=Math.round(t.start/l*s),u=c+(Math.round((t.end-t.start)/l*s)||1)>a&&c<a+i;u&&!r.parentElement?n.appendChild(r):!u&&r.parentElement&&r.remove()};setTimeout(()=>{if(!this.wavesurfer||!t.element)return;o();const i=this.wavesurfer.on("scroll",o),a=this.wavesurfer.on("zoom",o);this.subscriptions.push(i,a),t.once("remove",()=>{i(),a()})},0)}saveRegion(t){if(!t.element)return;this.virtualAppend(t,this.regionsContainer,t.element),this.avoidOverlapping(t),this.regions.push(t);const n=[t.on("update",r=>{r||this.adjustScroll(t),this.emit("region-update",t,r)}),t.on("update-end",r=>{this.avoidOverlapping(t),this.emit("region-updated",t,r)}),t.on("play",r=>{var o;(o=this.wavesurfer)===null||o===void 0||o.play(t.start,r)}),t.on("click",r=>{this.emit("region-clicked",t,r)}),t.on("dblclick",r=>{this.emit("region-double-clicked",t,r)}),t.on("content-changed",()=>{this.emit("region-content-changed",t)}),t.once("remove",()=>{n.forEach(r=>r()),this.regions=this.regions.filter(r=>r!==t),this.emit("region-removed",t)})];this.subscriptions.push(...n),this.emit("region-created",t)}addRegion(t){var n,r;if(!this.wavesurfer)throw Error("WaveSurfer is not initialized");const o=this.wavesurfer.getDuration(),i=(r=(n=this.wavesurfer)===null||n===void 0?void 0:n.getDecodedData())===null||r===void 0?void 0:r.numberOfChannels,a=new kce(t,o,i);return this.emit("region-initialized",a),o?this.saveRegion(a):this.subscriptions.push(this.wavesurfer.once("ready",s=>{a._setTotalDuration(s),this.saveRegion(a)})),a}enableDragSelection(t,n=3){var r;const o=(r=this.wavesurfer)===null||r===void 0?void 0:r.getWrapper();if(!(o&&o instanceof HTMLElement))return()=>{};let i=null,a=0,s=0;return $x(o,(l,c,u)=>{i&&i._onUpdate(l,u>a?"end":"start",s)},l=>{var c,u;if(a=l,!this.wavesurfer)return;const d=this.wavesurfer.getDuration(),h=(u=(c=this.wavesurfer)===null||c===void 0?void 0:c.getDecodedData())===null||u===void 0?void 0:u.numberOfChannels,{width:p}=this.wavesurfer.getWrapper().getBoundingClientRect();s=a/p*d;const g=l/p*d,y=(l+5)/p*d;i=new kce(Object.assign(Object.assign({},t),{start:g,end:y}),d,h),this.emit("region-initialized",i),i.element&&this.regionsContainer.appendChild(i.element)},()=>{i&&(this.saveRegion(i),i.updatingSide=void 0,i=null)},n)}clearRegions(){this.regions.slice().forEach(t=>t.remove()),this.regions=[]}destroy(){this.clearRegions(),super.destroy(),this.regionsContainer.remove()}}let gvt=class{constructor(){this.listeners={}}on(t,n,r){if(this.listeners[t]||(this.listeners[t]=new Set),r==null?void 0:r.once){const o=(...i)=>{this.un(t,o),n(...i)};return this.listeners[t].add(o),()=>this.un(t,o)}return this.listeners[t].add(n),()=>this.un(t,n)}un(t,n){var r;(r=this.listeners[t])===null||r===void 0||r.delete(n)}once(t,n){return this.on(t,n,{once:!0})}unAll(){this.listeners={}}emit(t,...n){this.listeners[t]&&this.listeners[t].forEach(r=>r(...n))}},mvt=class extends gvt{constructor(t){super(),this.subscriptions=[],this.isDestroyed=!1,this.options=t}onInit(){}_init(t){this.isDestroyed&&(this.subscriptions=[],this.isDestroyed=!1),this.wavesurfer=t,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(t=>t()),this.subscriptions=[],this.isDestroyed=!0,this.wavesurfer=void 0}};function Mce(e,t){const n=t.xmlns?document.createElementNS(t.xmlns,e):document.createElement(e);for(const[r,o]of Object.entries(t))if(r==="children"&&o)for(const[i,a]of Object.entries(o))a instanceof Node?n.appendChild(a):typeof a=="string"?n.appendChild(document.createTextNode(a)):n.appendChild(Mce(i,a));else r==="style"?Object.assign(n.style,o):r==="textContent"?n.textContent=o:n.setAttribute(r,o.toString());return n}function B7(e,t,n){return Mce(e,t||{})}const vvt={height:20,timeOffset:0,formatTimeCallback:e=>e/60>1?`${Math.floor(e/60)}:${`${(e=Math.round(e%60))<10?"0":""}${e}`}`:`${Math.round(1e3*e)/1e3}`};class F7 extends mvt{constructor(t){super(t||{}),this.unsubscribeNotches=[],this.notchElements=new Map,this.options=Object.assign({},vvt,t),this.timelineWrapper=this.initTimelineWrapper()}static create(t){return new F7(t)}onInit(){var t;if(!this.wavesurfer)throw Error("WaveSurfer is not initialized");let n=this.wavesurfer.getWrapper();if(this.options.container instanceof HTMLElement)n=this.options.container;else if(typeof this.options.container=="string"){const r=document.querySelector(this.options.container);if(!r)throw Error(`No Timeline container found matching ${this.options.container}`);n=r}this.options.insertPosition?(n.firstElementChild||n).insertAdjacentElement(this.options.insertPosition,this.timelineWrapper):n.appendChild(this.timelineWrapper),this.subscriptions.push(this.wavesurfer.on("redraw",()=>this.initTimeline())),(!((t=this.wavesurfer)===null||t===void 0)&&t.getDuration()||this.options.duration)&&this.initTimeline()}destroy(){this.unsubscribeNotches.forEach(t=>t()),this.unsubscribeNotches=[],this.timelineWrapper.remove(),super.destroy()}initTimelineWrapper(){return B7("div",{part:"timeline-wrapper",style:{pointerEvents:"none"}})}defaultTimeInterval(t){return t>=25?1:5*t>=25?5:15*t>=25?15:60*Math.ceil(.5/t)}defaultPrimaryLabelInterval(t){return t>=25?10:5*t>=25?6:4}defaultSecondaryLabelInterval(t){return t>=25?5:2}virtualAppend(t,n,r){if(this.notchElements.set(r,{start:t,width:r.clientWidth,wasVisible:!1}),!this.wavesurfer)return;const o=this.wavesurfer.getScroll(),i=o+this.wavesurfer.getWidth(),a=this.notchElements.get(r),s=t>=o&&t+a.width<i;a.wasVisible=s,s&&n.appendChild(r)}updateVisibleNotches(t,n,r){this.notchElements.forEach((o,i)=>{const a=o.start>=t&&o.start+o.width<n;a!==o.wasVisible&&(o.wasVisible=a,a?r.appendChild(i):i.remove())})}initTimeline(){var t,n,r,o,i,a,s,l;this.unsubscribeNotches.forEach(S=>S()),this.unsubscribeNotches=[],this.notchElements.clear();const c=(r=(n=(t=this.wavesurfer)===null||t===void 0?void 0:t.getDuration())!==null&&n!==void 0?n:this.options.duration)!==null&&r!==void 0?r:0,u=(((o=this.wavesurfer)===null||o===void 0?void 0:o.getWrapper().scrollWidth)||this.timelineWrapper.scrollWidth)/c,d=(i=this.options.timeInterval)!==null&&i!==void 0?i:this.defaultTimeInterval(u),h=(a=this.options.primaryLabelInterval)!==null&&a!==void 0?a:this.defaultPrimaryLabelInterval(u),p=this.options.primaryLabelSpacing,g=(s=this.options.secondaryLabelInterval)!==null&&s!==void 0?s:this.defaultSecondaryLabelInterval(u),y=this.options.secondaryLabelSpacing,v=this.options.insertPosition==="beforebegin",b=B7("div",{style:Object.assign({height:`${this.options.height}px`,overflow:"hidden",fontSize:this.options.height/2+"px",whiteSpace:"nowrap"},v?{position:"absolute",top:"0",left:"0",right:"0",zIndex:"2"}:{position:"relative"})});b.setAttribute("part","timeline"),typeof this.options.style=="string"?b.setAttribute("style",b.getAttribute("style")+this.options.style):typeof this.options.style=="object"&&Object.assign(b.style,this.options.style);const C=B7("div",{style:{width:"0",height:"50%",display:"flex",flexDirection:"column",justifyContent:v?"flex-start":"flex-end",top:v?"0":"auto",bottom:v?"auto":"0",overflow:"visible",borderLeft:"1px solid currentColor",opacity:`${(l=this.options.secondaryLabelOpacity)!==null&&l!==void 0?l:.25}`,position:"absolute",zIndex:"1"}});for(let S=0,E=0;S<c;S+=d,E++){const x=C.cloneNode(),I=Math.round(100*S)%Math.round(100*h)==0||p&&E%p==0,N=Math.round(100*S)%Math.round(100*g)==0||y&&E%y==0;(I||N)&&(x.style.height="100%",x.style.textIndent="3px",x.textContent=this.options.formatTimeCallback(S),I&&(x.style.opacity="1"));const O=I?"primary":N?"secondary":"tick";x.setAttribute("part",`timeline-notch timeline-notch-${O}`);const T=Math.round(100*(S+this.options.timeOffset))/100*u;x.style.left=`${T}px`,this.virtualAppend(T,b,x)}this.timelineWrapper.innerHTML="",this.timelineWrapper.appendChild(b),this.wavesurfer&&this.unsubscribeNotches.push(this.wavesurfer.on("scroll",(S,E,x,I)=>{this.updateVisibleNotches(x,I,b)})),this.emit("ready")}}class yvt{constructor(){this.listeners={}}on(t,n,r){if(this.listeners[t]||(this.listeners[t]=new Set),r==null?void 0:r.once){const o=(...i)=>{this.un(t,o),n(...i)};return this.listeners[t].add(o),()=>this.un(t,o)}return this.listeners[t].add(n),()=>this.un(t,n)}un(t,n){var r;(r=this.listeners[t])===null||r===void 0||r.delete(n)}once(t,n){return this.on(t,n,{once:!0})}unAll(){this.listeners={}}emit(t,...n){this.listeners[t]&&this.listeners[t].forEach(r=>r(...n))}}class bvt extends yvt{constructor(t){super(),this.subscriptions=[],this.isDestroyed=!1,this.options=t}onInit(){}_init(t){this.isDestroyed&&(this.subscriptions=[],this.isDestroyed=!1),this.wavesurfer=t,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(t=>t()),this.subscriptions=[],this.isDestroyed=!0,this.wavesurfer=void 0}}const Cvt={scale:.5,deltaThreshold:5,exponentialZooming:!1,iterations:20};class j7 extends bvt{constructor(t){super(t||{}),this.wrapper=void 0,this.container=null,this.accumulatedDelta=0,this.pointerTime=0,this.oldX=0,this.endZoom=0,this.startZoom=0,this.onWheel=n=>{if(this.wavesurfer&&this.container&&!(Math.abs(n.deltaX)>=Math.abs(n.deltaY))&&(n.preventDefault(),this.accumulatedDelta+=-n.deltaY,this.startZoom===0&&this.options.exponentialZooming&&(this.startZoom=this.wavesurfer.getWrapper().clientWidth/this.wavesurfer.getDuration()),this.options.deltaThreshold===0||Math.abs(this.accumulatedDelta)>=this.options.deltaThreshold)){const r=this.wavesurfer.getDuration(),o=this.wavesurfer.options.minPxPerSec===0?this.wavesurfer.getWrapper().scrollWidth/r:this.wavesurfer.options.minPxPerSec,i=n.clientX-this.container.getBoundingClientRect().left,a=this.container.clientWidth,s=this.wavesurfer.getScroll();i===this.oldX&&this.oldX!==0||(this.pointerTime=(s+i)/o),this.oldX=i;const l=this.calculateNewZoom(o,this.accumulatedDelta),c=a/l*(i/a);l*r<a?(this.wavesurfer.zoom(a/r),this.container.scrollLeft=0):(this.wavesurfer.zoom(l),this.container.scrollLeft=(this.pointerTime-c)*l),this.accumulatedDelta=0}},this.calculateNewZoom=(n,r)=>{let o;if(this.options.exponentialZooming){const i=r>0?Math.pow(this.endZoom/this.startZoom,1/(this.options.iterations-1)):Math.pow(this.startZoom/this.endZoom,1/(this.options.iterations-1));o=Math.max(0,n*i)}else o=Math.max(0,n+r*this.options.scale);return Math.min(o,this.options.maxZoom)},this.options=Object.assign({},Cvt,t)}static create(t){return new j7(t)}onInit(){var t;this.wrapper=(t=this.wavesurfer)===null||t===void 0?void 0:t.getWrapper(),this.wrapper&&(this.container=this.wrapper.parentElement,this.container.addEventListener("wheel",this.onWheel),this.options.maxZoom===void 0&&(this.options.maxZoom=this.container.clientWidth),this.endZoom=this.options.maxZoom)}destroy(){this.container&&this.container.removeEventListener("wheel",this.onWheel),super.destroy()}}const _ce=e=>[e/60,e%60].map(t=>`0${Math.floor(t)}`.slice(-2)).join(":"),Avt=({prefixPaths:e=[]})=>{const t=A.useRef(null),n=A.useRef(null),r=A.useRef(null),[o,i]=A.useState(0),[a,s]=A.useState(0),[l,c]=A.useState(!1),[u,d]=A.useState(null),h=R.useFormInstance(),p=h.getFieldValue([...e,"title"]),g=h.getFieldValue([...e,"record","transcript_original"]),{wavesurfer:y}=wce({container:t,height:60,waveColor:"#b0dfff",progressColor:"#30b4ff",interact:!0,dragToSeek:!1,url:h.getFieldValue([...e,"record","default_record"]),plugins:A.useMemo(()=>{const b=j7.create({scale:.5,maxZoom:100,deltaThreshold:5,exponentialZooming:!0}),C=F7.create({insertPosition:"afterend",height:15,timeInterval:1,primaryLabelInterval:5,secondaryLabelInterval:1,style:{fontSize:"10px"}}),S=L7.create({dragSelection:!1});return r.current=C,n.current=S,[b,C,S]},[])});A.useEffect(()=>{if(!y)return;const b=n.current;if(b)return b.enableDragSelection({slop:5}),b.on("region-created",C=>{console.log("🟢 Created region:",C.start,C.end),Object.assign(C.element.style,{border:"2px solid rgba(255,165,0,0.8)",borderRadius:"6px",backgroundColor:"transparent",boxSizing:"border-box"}),C.element.querySelectorAll('[part~="region-handle"]').forEach(S=>{Object.assign(S.style,{border:"none",background:"transparent",borderRadius:"0"})})}),b.on("region-updated",C=>{console.log("✏️ Updated region:",C.start,C.end)}),b.on("region-clicked",(C,S)=>{S.stopPropagation(),b.getRegions().forEach(E=>{Object.assign(E.element.style,{border:"2px solid rgba(255,165,0,0.8)",backgroundColor:"transparent"}),E.element.classList.remove("wavesurfer-region-active")}),Object.assign(C.element.style,{border:"2px solid rgba(255,165,0,0.8)",backgroundColor:"rgba(255,165,0,0.25)"}),C.element.classList.add("wavesurfer-region-active"),d(C)}),y.on("audioprocess",C=>s(C)),y.on("ready",()=>i(y.getDuration())),y.on("play",()=>c(!0)),y.on("pause",()=>c(!1)),()=>{b.unAll()}},[y]);const v=A.useCallback(()=>{y==null||y.playPause()},[y]);return A.useEffect(()=>{const b=C=>{u&&(C.key==="Delete"||C.key==="Backspace")&&(C.preventDefault(),u.remove(),d(null))};return window.addEventListener("keydown",b),()=>{window.removeEventListener("keydown",b)}},[u]),f.jsxs(f.Fragment,{children:[f.jsx(Nce,{content:f.jsxs("ul",{style:{margin:0,paddingLeft:10},children:[f.jsx("li",{children:"Cắt thủ công áp dụng cho từng file audio."}),f.jsx("li",{children:"Kéo vị trí khung anh/chị để cắt từ anh/chị từ audio gốc."}),f.jsx("li",{children:"Kéo nút || trên thanh công cụ để cắt bỏ phần đầu và phần cuối không mong muốn."})]})}),f.jsx(fo,{children:f.jsxs(Ke,{vertical:!0,gap:20,align:"center",children:[f.jsxs(Nn,{style:{width:"100%"},children:[f.jsx(at,{span:4,children:f.jsx(ge.Text,{strong:!0,children:p})}),f.jsx(at,{span:20,children:f.jsx(ge.Text,{italic:!0,type:"secondary",children:g})})]}),f.jsxs(Nn,{style:{width:"100%"},children:[f.jsx(at,{span:5,style:{display:"flex",alignItems:"center"},children:f.jsxs(Ke,{align:"center",gap:12,children:[f.jsx(yt,{size:"large",icon:l?f.jsx(EQ,{}):f.jsx(xQ,{}),type:"primary",onClick:v}),f.jsxs(ge.Text,{strong:!0,children:[_ce(a),"/",_ce(o)]})]})}),f.jsx(at,{span:19,children:f.jsx("div",{ref:t})})]}),f.jsx(yt,{icon:f.jsx(Eh,{}),style:{color:"white",backgroundColor:Fn.button.volcano},children:"Tạo file nam/nữ"})]})})]})},Evt=({onConfirm:e})=>{const{isOpen:t,onToggle:n}=Eo(),r=()=>{e(),n()};return f.jsx(au,{open:t,title:"Khôi phục tất cả audio gốc",description:"Bạn có chắc chắn muốn khôi phục audio gốc",onConfirm:r,onCancel:n,okText:"Có",cancelText:"Không",children:f.jsx(yt,{onClick:n,className:"float-right",type:"link",icon:f.jsx(TQ,{}),children:"Khôi phục tất cả audio gốc"})})},Svt=({prefixPaths:e=[]})=>{const t=R.useFormInstance();return R.useWatch([...e,"record","volume"],t),R.useWatch([...e,"record","speed"],t),f.jsxs(f.Fragment,{children:[f.jsxs(Nn,{gutter:8,align:"middle",children:[f.jsx(at,{xs:20,sm:18,md:20,children:f.jsx(R.Item,{name:[...e,"record","volume"],label:"Âm lượng",labelCol:{span:4},labelAlign:"left",children:f.jsx(EO,{min:.1,max:2,step:.1,tooltip:{open:!1}})})}),f.jsx(at,{xs:4,sm:6,md:4,children:f.jsx(R.Item,{name:[...e,"record","volume"],labelAlign:"left",children:f.jsx(ci,{min:.1,max:2,step:.1,style:{width:"100%"}})})})]}),f.jsxs(Nn,{gutter:8,align:"middle",children:[f.jsx(at,{xs:20,sm:18,md:20,children:f.jsx(R.Item,{name:[...e,"record","speed"],label:"Tốc độ",labelCol:{span:4},labelAlign:"left",children:f.jsx(EO,{min:.1,max:2,step:.1,tooltip:{open:!1}})})}),f.jsx(at,{xs:4,sm:6,md:4,children:f.jsx(R.Item,{name:[...e,"record","speed"],labelAlign:"left",children:f.jsx(ci,{min:.1,max:2,step:.1,style:{width:"100%"}})})})]}),f.jsx(Ke,{justify:"center",children:f.jsx(yt,{type:"primary",children:"Áp dụng"})})]})},wvt=({prefixPaths:e=[],disabled:t=!1})=>{const[n,r]=A.useState(!0),{isOpen:o,onOpen:i,onToggle:a}=Eo(),l=R.useFormInstance().getFieldValue([...e,"title"]);return f.jsxs(f.Fragment,{children:[f.jsx(yt,{disabled:t,type:"text",onClick:i,icon:f.jsx(jg,{})}),f.jsx(to,{title:"Chỉnh sửa file ghi âm",open:o,onCancel:a,onOk:a,destroyOnHidden:!0,width:900,footer:[f.jsx(yt,{type:"primary",onClick:a,children:"Hoàn thành"},"submit")],children:f.jsxs(Ke,{vertical:!0,gap:12,children:[f.jsxs(Ke,{justify:"space-between",children:[f.jsx(ge.Paragraph,{strong:!0,children:`File ghi âm ${l}`}),f.jsx(Evt,{onConfirm:()=>{}})]}),f.jsxs(Ea,{theme:{components:{Collapse:{headerBg:Fn.collapseHeaderBg.background}}},children:[f.jsx(IA,{size:"small",defaultActiveKey:["1"],items:[{key:"1",label:"Âm lượng & Tốc độ",children:f.jsx(Svt,{})}]}),f.jsx(IA,{size:"small",defaultActiveKey:["1"],items:[{key:"1",label:f.jsxs(Cn,{children:[f.jsx(ge.Text,{children:"Trim audio & cắt file nam/nữ"}),f.jsx(ms,{icon:f.jsx(L2,{}),color:"volcano",onClick:c=>{t||(c.stopPropagation(),c.preventDefault(),r(!n))},children:n?"Cắt file thủ công":"Cắt file tự động"})]}),children:n?f.jsx(hvt,{}):f.jsx(Avt,{})}]})]})]})})]})},{TextArea:xvt}=Nt,Ivt=({placeholder:e="Vui lòng tải lên ghi âm để cá nhân hoá",rows:t=4,disabled:n=!1})=>{const r=ph(),o=A.useRef(null),{isOpen:i,onOpen:a,onClose:s}=Eo(),[l,c]=A.useState(""),[u,d]=A.useState("confirm"),h=E=>{},p=E=>{var O;if(n)return;const x=o.current;if(!x)return;const I=(O=x.resizableTextArea)==null?void 0:O.textArea;if(!I)return;const N=I.value.substring(I.selectionStart,I.selectionEnd);N.trim()?(c(N),d("confirm"),a()):s()},g=()=>{n||d("configure")},y=()=>{s(),c(""),d("confirm")},v=()=>{var _;if(n)return;const E=o.current;if(!E)return;const x=(_=E.resizableTextArea)==null?void 0:_.textArea;if(!x)return;const I=x.value,N=I.substring(0,x.selectionStart),O=I.substring(x.selectionEnd),T=prompt("Nhập tên biến"),M=`${N}{{${T}}}${O}`;r.setFieldValue(["record","transcript_personalize"],M),r.submit(),s(),c(""),d("confirm")},b=()=>{s(),c(""),d("confirm")},C=()=>f.jsxs("div",{style:{minWidth:"300px"},children:[f.jsx("div",{style:{marginBottom:"16px"},children:f.jsxs(ge.Text,{children:["Bạn muốn thay thế cụm từ ",f.jsx("strong",{children:l})," bằng biến?"]})}),f.jsx(Io,{isOpen:u==="configure",children:f.jsx("div",{children:f.jsx("div",{style:{padding:"16px",backgroundColor:"#f5f5f5",borderRadius:"8px"},children:f.jsx("p",{children:"TODO: Component tìm kiếm tên trường"})})})})]}),S=()=>u==="confirm"?{onConfirm:g,onCancel:y,okText:"Thêm biến",cancelText:"Hủy"}:{onConfirm:v,onCancel:b,okText:"Thêm biến",cancelText:"Hủy"};return f.jsxs(f.Fragment,{children:[f.jsx(au,{title:C(),...S(),open:!n&&i,icon:!1,children:f.jsx(ge.Text,{type:"secondary",children:"Xoá cụm từ trong kịch bản, sau đó điền biến vào chỗ vừa xoá bằng cách nhập {{ten_bien}}."})}),f.jsx(xvt,{disabled:n,ref:o,placeholder:e,rows:t,value:r.getFieldValue(["record","transcript_personalize"]),onChange:h,onMouseUp:p,style:{width:"100%",border:"none",borderRadius:TE.block.rounded.borderRadius,backgroundColor:Fn.common.gray,padding:"12px",marginTop:"12px",fontSize:"14px",lineHeight:"1.5",resize:"none"}})]})},Px=({onUpload:e,fieldName:t="audio",disabled:n=!1,beforeUpload:r})=>{const o=nb(),[i,a]=A.useState(!1),s={name:t,accept:".mp3,.wav,.m4a",showUploadList:!1,beforeUpload:async l=>{if(a(!0),r==null||r(),!["audio/mp3","audio/mpeg","audio/wav","audio/x-wav","audio/m4a","audio/x-m4a"].includes(l.type))return a(!1),o.error("Chỉ chấp nhận file audio (mp3, wav, m4a)"),!1;if(!(l.size/1024/1024<50))return a(!1),o.error("File phải nhỏ hơn 50MB!"),!1;try{await(e==null?void 0:e(l)),a(!1)}catch{a(!1),o.error("Tải lên thất bại. Vui lòng thử lại.")}return!1}};return f.jsx(Rg,{...s,children:f.jsx(yt,{icon:i?f.jsx(Ds,{}):f.jsx(XO,{}),disabled:n||i,loading:i,children:i?"Đang tải lên...":"Tải lên"})})},{TextArea:z7}=Nt,{Text:ib}=ge,Nvt=({prefixPaths:e=[]})=>{const{isReadOnly:t}=Rn(),[n,r]=A.useState(),{mutateAsync:o}=Xmt(),i=R.useWatch([...e,"record","detect_gender"]),a=R.useWatch([...e,"record","personalize"]),s=ph(),l=R.useWatch([...e,"record","default_record"],s),c=R.useWatch([...e,"record","male_record"],s),u=R.useWatch([...e,"record","female_record"],s);return f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{name:[...e,"record","default_record"],valuePropName:"checked",style:{marginBottom:"8px",paddingTop:8},className:cvt,label:f.jsxs(Ke,{justify:"space-between",align:"center",style:{width:"100%"},children:[f.jsx(pr,{placement:"right",title:f.jsxs(f.Fragment,{children:["Nếu bạn ghi âm, node này sẽ sử dụng file ghi âm khi gọi",f.jsx("br",{}),"Nếu bạn bỏ trống, node này sử dụng giọng bot"]}),children:f.jsx(ib,{strong:!0,children:"Ghi âm"})}),f.jsx(pr,{title:"Cập nhật nội dung văn bản theo file ghi âm",children:f.jsx(yt,{disabled:t,size:"small",icon:f.jsx(cQ,{}),type:"primary",onClick:()=>{const d=s.getFieldValue([...e,"record","transcript_original"]);s.setFieldValue([...e,"machine","content"],d),s.submit()}})})]}),children:f.jsxs("div",{children:[f.jsx(Io,{isOpen:!l,children:f.jsxs(Ke,{align:"center",gap:12,children:[n?null:f.jsx(Px,{disabled:t,beforeUpload:()=>{r(!1)},onUpload:async d=>{const{file:h,transcript_text:p,transcript:g}=await o({audio:d});s.setFieldValue([...e,"record","default_record"],h),s.setFieldValue([...e,"record","transcript_original"],p),s.setFieldValue([...e,"record","transcript_with_timestamp"],g),s.submit()}}),n||nt.isUndefined(n)?f.jsx(_x,{disabled:t,onStartRecord:()=>{r(!0)},onFinishRecord:async d=>{const{file:h,transcript_text:p,transcript:g}=await o({audio:d});s.setFieldValue([...e,"record","default_record"],h),s.setFieldValue([...e,"record","transcript_original"],p),s.setFieldValue([...e,"record","transcript_with_timestamp"],g),s.submit(),r(void 0)}}):null]})}),f.jsx(Io,{isOpen:!!l,children:f.jsx(dv,{disabled:t,onDelete:()=>{r(void 0),s.submit()},url:l,formPath:[[...e,"record","default_record"],[...e,"record","transcript_original"],[...e,"record","transcript_with_timestamp"]]})})]})}),f.jsxs(Ke,{justify:"space-between",align:"center",children:[f.jsx(R.Item,{name:[...e,"record","detect_gender"],valuePropName:"checked",style:{marginBottom:"0px"},children:f.jsx(Fr,{disabled:t||!!a,children:f.jsx(pr,{title:a?"Tắt cá nhân hoá nội dung để dùng tính năng này":null,children:f.jsx(ib,{strong:!0,children:"Cá nhân hoá giới tính"})})})}),a||!i?null:f.jsx(wvt,{disabled:t})]}),f.jsx(Io,{isOpen:i,children:f.jsxs(Nn,{gutter:[0,16],children:[f.jsx(R.Item,{name:[...e,"record","male_record"],noStyle:!0,children:f.jsxs(Cn,{direction:"vertical",size:0,wrap:!0,style:{width:"100%"},children:[f.jsx(ib,{children:"Khách hàng nam"}),f.jsx(Io,{isOpen:!c,children:f.jsxs(Ke,{align:"center",gap:12,children:[n?null:f.jsx(Px,{disabled:t,onUpload:async d=>{const{file:h}=await o({audio:d});s.setFieldValue([...e,"record","male_record"],h),s.submit()}}),n||nt.isUndefined(n)?f.jsx(_x,{disabled:t,onStartRecord:()=>{r(!0)},onFinishRecord:async d=>{const{file:h}=await o({audio:d});s.setFieldValue([...e,"record","male_record"],h),s.submit(),r(void 0)}}):null]})}),f.jsx(Io,{isOpen:!!c,children:f.jsx(dv,{disabled:t,url:c,formPath:[[...e,"record","male_record"]],onDelete:()=>{s.submit()}})})]})}),f.jsx(R.Item,{name:[...e,"record","female_record"],noStyle:!0,children:f.jsxs(Cn,{direction:"vertical",size:0,wrap:!0,style:{width:"100%"},children:[f.jsx(ib,{children:"Khách hàng nữ"}),f.jsx(Io,{isOpen:!u,children:f.jsxs(Ke,{align:"center",gap:12,children:[n?null:f.jsx(Px,{disabled:t,onUpload:async d=>{const{file:h}=await o({audio:d});s.setFieldValue([...e,"record","female_record"],h),s.submit()}}),n||nt.isUndefined(n)?f.jsx(_x,{disabled:t,onStartRecord:()=>{r(!0)},onFinishRecord:async d=>{const{file:h}=await o({audio:d});s.setFieldValue([...e,"record","female_record"],h),s.submit(),r(void 0)}}):null]})}),f.jsx(Io,{isOpen:!!u,children:f.jsx(dv,{disabled:t,url:u,formPath:[[...e,"record","female_record"]],onDelete:()=>{s.submit()}})})]})})]})}),f.jsx(ia,{style:{margin:"8px 0"}}),f.jsx(R.Item,{name:[...e,"record","personalize"],valuePropName:"checked",style:{marginBottom:"8px"},children:f.jsx(Fr,{disabled:t||!!i,onChange:d=>{t||(d.target.checked?s.setFieldValue([...e,"record","transcript_personalize"],s.getFieldValue([...e,"record","transcript_original"])):s.setFieldValue([...e,"record","transcript_personalize"],void 0))},children:f.jsx(pr,{title:i?"Tắt cá nhân hoá giới tính để dùng tính năng này":null,children:f.jsx(ib,{strong:!0,children:"Cá nhân hoá nội dung"})})})}),f.jsx(Io,{isOpen:a,children:f.jsx(Ivt,{disabled:t})}),f.jsx(R.Item,{name:[...e,"record","transcript_with_timestamp"],label:"Transcript với timestamp",hidden:!0,children:f.jsx(z7,{placeholder:"<span start='0.0' end='0.3'>em</span> ...",rows:2})}),f.jsx(R.Item,{name:[...e,"record","transcript_original"],label:"Transcript gốc",hidden:!0,children:f.jsx(z7,{placeholder:"Em chào anh chị ạ",rows:2})}),f.jsx(R.Item,{name:[...e,"record","transcript_personalize"],label:"Transcript cá nhân hóa",hidden:!0,children:f.jsx(z7,{placeholder:"Em chào {{name}} ạ",rows:2})})]})},{TextArea:Ovt}=Nt,Tvt=({prefixPaths:e=[]})=>{const t=R.useFormInstance(),n=R.useWatch([...e,"record","default_record"],t);return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:yce,children:[f.jsx(R.Item,{name:[...e,"machine","content"],style:{marginBottom:"8px"},children:f.jsx(Ovt,{placeholder:"Nhập kịch bản",rows:4,className:_7})}),f.jsx(pr,{className:Ymt,placement:"left",title:`Khi đã tải lên file ghi âm, bot sẽ ưu tiên sử dụng nội dung
859
859
  của file ghi âm, mà không dùng nội dung văn bản này.`,children:f.jsx(md,{})}),n?f.jsx(fce,{className:bce,record:n}):null]}),f.jsx(Nvt,{})]})},{TextArea:kvt}=Nt,Mvt=({prefixPaths:e=[]})=>f.jsx(R.Item,{name:[...e,"prompt","content"],noStyle:!0,children:f.jsx(kvt,{placeholder:"Nhập prompt",rows:4,className:_7})}),$ce=({id:e})=>{const{getNode:t,setNodes:n}=bn(),r=Cr(),{infos:o,errors:i}=nv(e),a=o.length!==0||i.length!==0,{data:s}=t(e),l=s,[c]=R.useForm(),u=R.useWatch(["type"],c)||ho.MACHINE_AND_RECORD,d=p=>{r(e,p)},h=A.useMemo(()=>nt.debounce(()=>{c.submit()},500),[c]);return A.useEffect(()=>()=>{h.cancel()},[h]),f.jsx("div",{className:Rmt,children:f.jsxs(R,{form:c,layout:"vertical",initialValues:{...l},onFinish:d,onValuesChange:h,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsxs(Cn,{direction:"vertical",size:"small",style:{width:"100%"},children:[f.jsx(R.Item,{name:["type"],noStyle:!0,children:f.jsx(ch,{size:"middle",block:!0,options:[{label:f.jsxs(Ke,{align:"center",gap:12,justify:"center",children:[f.jsx(Ah,{}),"Câu cố định"]}),value:ho.MACHINE_AND_RECORD},{label:f.jsxs(Ke,{align:"center",gap:12,justify:"center",children:[f.jsx(Eh,{}),"Prompt"]}),value:ho.PROMPT}]})}),f.jsx(Io,{isOpen:u===ho.MACHINE_AND_RECORD,children:f.jsx(Tvt,{})}),f.jsx(Io,{isOpen:u===ho.PROMPT,children:f.jsx(Mvt,{})}),f.jsxs(Ed,{visible:a,children:[f.jsx(ia,{style:{margin:"4px 0"}}),!nt.isEmpty(o)&&f.jsx("div",{className:vce,children:o.map(p=>f.jsx(Xf,{message:p.title,description:p.description,type:"info",showIcon:!0,closable:!0,style:{width:"100%",padding:"12px",margin:"12px 0"}},p.title))}),!nt.isEmpty(i)&&f.jsx("div",{className:vce,children:i.map(p=>f.jsx(Xf,{style:{width:"100%",padding:"12px"},message:p.title,description:p.description,type:"error",showIcon:!0,closable:!0},p.title))})]})]})]})})},Pce=({id:e,data:t,mini:n})=>{var v,b;const{mode:r}=Xt(),{displayComponent:o,nodeId:i,closeModal:a}=Rn(),s=Cr(),{errors:l}=nv(e),c=t.title||"Node nói",u=t.type||ho.MACHINE_AND_RECORD,d=A.useMemo(()=>{var C,S;return u===ho.MACHINE_AND_RECORD?((C=t==null?void 0:t.machine)==null?void 0:C.content)??"":((S=t==null?void 0:t.prompt)==null?void 0:S.content)??""},[u,t]),[h,p]=A.useState(d);A.useEffect(()=>{p(d)},[d]);const g=A.useMemo(()=>nt.debounce(C=>{u===ho.MACHINE_AND_RECORD?s(e,{...t,machine:{...t.machine,content:C}}):s(e,{...t,prompt:{...t.prompt,content:C}})},300),[u,e,t,s]),y=C=>{C.target.closest(`button, [role="button"], input, textarea, .${_r}-modal-wrap, audio`)||(C.stopPropagation(),C.preventDefault(),o(f.jsx($ce,{id:e}),"Cài đặt node nói",()=>{},e))};return n?f.jsx("div",{className:Umt,children:f.jsx("div",{className:hce,children:f.jsx("div",{className:gce,children:f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f.jsx("span",{className:mce,children:f.jsx(G2,{})}),f.jsx("span",{className:Gmt,children:c})]})})})}):f.jsx("div",{className:qmt,onClick:y,onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&y(C)},children:f.jsxs("div",{className:`${hce} ${i===e?pce.active:pce.default}`,children:[f.jsxs("div",{className:gce,children:[f.jsxs(Cn,{size:4,children:[f.jsx("span",{className:mce,children:f.jsx(G2,{})}),f.jsx(Xd,{id:e,color:Fn.common.red})]}),f.jsx(Iu,{id:e,deleteBtnColor:Fn.common.red})]}),f.jsxs(Ke,{gap:6,vertical:!0,style:{width:"100%"},children:[f.jsx(ch,{block:!0,size:"small",style:{width:"100%",fontSize:12},value:u,options:[{label:f.jsxs(Ke,{align:"center",gap:12,justify:"center",children:[f.jsx(Ah,{size:12}),"Câu cố định"]}),value:ho.MACHINE_AND_RECORD,disabled:u===ho.PROMPT},{label:f.jsxs(Ke,{align:"center",gap:12,justify:"center",children:[f.jsx(Eh,{size:12}),"Prompt"]}),value:ho.PROMPT,disabled:u===ho.MACHINE_AND_RECORD}]}),f.jsx(Io,{isOpen:!nt.isEmpty(l),children:f.jsx("div",{className:Qmt,children:l.map(C=>f.jsx(Xf,{message:C.title,type:"error",showIcon:!0,closable:!0,style:{width:"100%"}},`alert-${e}-${C.title}`))})})]}),f.jsxs("div",{className:`${yce} nodrag nopan nowheel`,onWheelCapture:C=>{C.stopPropagation()},onMouseDownCapture:C=>{C.stopPropagation()},onPointerDownCapture:C=>{C.stopPropagation()},children:[f.jsx(Nt.TextArea,{readOnly:r!=="edit",onWheelCapture:C=>{C.stopPropagation()},onMouseDown:C=>{C.stopPropagation()},onPointerDown:C=>{C.stopPropagation()},rows:4,autoSize:{minRows:4,maxRows:4},placeholder:"Vui lòng nhập nội dung",className:`${_7} nodrag nopan nowheel`,onFocus:()=>a(),value:h,onChange:C=>{const S=C.target.value;p(S),g(S)}}),(v=t.record)!=null&&v.default_record?f.jsx(fce,{className:bce,record:(b=t.record)==null?void 0:b.default_record,style:{right:2}}):null]})]})})};var _vt="scripts_editor_1b2l0x40",$vt="scripts_editor_1b2l0x41",Pvt="scripts_editor_1b2l0x42",Dvt="scripts_editor_1b2l0x43",Lvt="scripts_editor_1b2l0x44",Bvt="scripts_editor_1b2l0x45",Fvt="scripts_editor_1b2l0x46",jvt="scripts_editor_1b2l0x4b",Dce={default:"scripts_editor_1b2l0x4c",active:"scripts_editor_1b2l0x4d"},zvt="scripts_editor_1b2l0x4e",Vvt="scripts_editor_1b2l0x4f",Hvt="scripts_editor_1b2l0x4g",V7="scripts_editor_1b2l0x4h",Wvt="scripts_editor_1b2l0x4i",Kvt="scripts_editor_1b2l0x4j",qvt="scripts_editor_1b2l0x4k",Uvt="scripts_editor_1b2l0x4l",Gvt="scripts_editor_1b2l0x4m",Qvt="scripts_editor_1b2l0x4n",Rvt="scripts_editor_1b2l0x4o",Yvt="scripts_editor_1b2l0x4p",Xvt="scripts_editor_1b2l0x4q",Zvt="scripts_editor_1b2l0x4r",Jvt="scripts_editor_1b2l0x4s",e0t="scripts_editor_1b2l0x4t",t0t="scripts_editor_1b2l0x4u",n0t="scripts_editor_1b2l0x4v",r0t="scripts_editor_1b2l0x4w",o0t="scripts_editor_1b2l0x4x",i0t="scripts_editor_1b2l0x4y",a0t="scripts_editor_1b2l0x4z",s0t="scripts_editor_1b2l0x410",l0t="scripts_editor_1b2l0x411",c0t="scripts_editor_1b2l0x412";const u0t=()=>f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{name:["dynamic","value"],style:{marginBottom:12},children:f.jsx(Nt.TextArea,{placeholder:"Nhập dữ liệu",className:Hvt})}),f.jsx(R.Item,{noStyle:!0,name:["dynamic","maximum_try"],children:f.jsx(ci,{addonBefore:"Chờ tối đa",addonAfter:"giây",min:1,max:300,placeholder:"30",style:{width:"100%"}})})]}),d0t=()=>f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{name:["external","value"],style:{marginBottom:12},children:f.jsx(Nt,{placeholder:"Nhập số điện thoại"})}),f.jsx(R.Item,{noStyle:!0,name:["external","maximum_try"],children:f.jsx(ci,{addonBefore:"Chờ tối đa",addonAfter:"giây",min:1,max:300,placeholder:"30",style:{width:"100%"}})})]}),f0t=()=>f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{name:["internal","value"],style:{marginBottom:12},children:f.jsx(Nt,{placeholder:"Chọn nhánh nội bộ hoặc nhập số điện thoại"})}),f.jsx(R.Item,{noStyle:!0,name:["internal","maximum_try"],children:f.jsx(ci,{addonBefore:"Chờ tối đa",addonAfter:"giây",min:1,max:300,placeholder:"30",style:{width:"100%"}})})]}),Lce="COLD",Bce=ho.PROMPT,Fce="SPEAK_AFTER_PICKUP",h0t=[{label:"Chuyển máy lạnh",value:"COLD"},{label:"Chuyển máy ấm",value:"WARM"}],p0t=[{label:"Giọng máy",value:ho.MACHINE_AND_RECORD},{label:"Prompt",value:ho.PROMPT}],g0t=[{label:"Lời nhắn SIP Header",value:"SIP_HEADER"},{label:"Nói sau khi nhấc máy",value:"SPEAK_AFTER_PICKUP"}],jce=e=>e===Wi.EXTERNAL?"external":e===Wi.DYNAMIC?"dynamic":"internal",zce=({id:e})=>{const{getNode:t}=bn(),{data:n}=t(e),r=n,[o]=R.useForm(),[i,a]=A.useState(r.type||Wi.INTERNAL),{infos:s}=nv(e),l=Cr(),c=R.useWatch("transfer_mode",o)||r.transfer_mode||Lce,u=jce(i),d=r[u],h=R.useWatch([u,"type"],o)||(d==null?void 0:d.type)||Bce,p=R.useWatch([u,"display_type"],o)||(d==null?void 0:d.display_type)||Fce,g=A.useCallback(b=>{var x,I,N,O;const C=jce(b),S=o.getFieldValue(C),E=!!((x=S==null?void 0:S.machine)!=null&&x.content||(I=S==null?void 0:S.prompt)!=null&&I.content||(N=S==null?void 0:S.record)!=null&&N.default_record);S!=null&&S.display_type||o.setFieldValue([C,"display_type"],Fce),S!=null&&S.type||o.setFieldValue([C,"type"],Bce),E||o.setFieldValue([C,"prompt","content"],(O=S==null?void 0:S.prompt)==null?void 0:O.content)},[o]),y=b=>{l(e,b)},v=A.useMemo(()=>nt.debounce(()=>{o.submit()},500),[o]);return A.useEffect(()=>()=>{v.cancel()},[v]),A.useEffect(()=>{const b=r.type||Wi.INTERNAL,C=r.transfer_mode||Lce;o.setFieldsValue({...r,transfer_mode:C}),a(b),C==="WARM"&&g(b)},[r,o,g]),f.jsx(R,{form:o,layout:"vertical",onFinish:y,onBlur:()=>{o.submit()},onChange:()=>{v()},children:f.jsxs(Cn,{direction:"vertical",size:16,style:{width:"100%"},children:[f.jsxs(Cn,{direction:"vertical",size:12,style:{width:"100%"},children:[f.jsx(ge.Text,{className:V7,children:"Chọn đầu số"}),f.jsx(R.Item,{name:"type",noStyle:!0,children:f.jsx(ch,{value:i,onChange:b=>{const C=b;a(C),c==="WARM"&&g(C)},options:[{label:"Tổng đài",value:Wi.INTERNAL},{label:"Điện thoại",value:Wi.EXTERNAL},{label:"Dynamic",value:Wi.DYNAMIC}],block:!0})}),f.jsx(Io,{isOpen:i===Wi.INTERNAL,children:f.jsx(f0t,{})}),f.jsx(Io,{isOpen:i===Wi.EXTERNAL,children:f.jsx(d0t,{})}),f.jsx(Io,{isOpen:i===Wi.DYNAMIC,children:f.jsx(u0t,{})})]}),f.jsxs(Cn,{direction:"vertical",size:12,style:{width:"100%"},children:[f.jsx(ge.Text,{className:V7,children:"Loại chuyển máy"}),f.jsx(R.Item,{name:"transfer_mode",noStyle:!0,children:f.jsx(ln.Group,{className:Wvt,onChange:b=>{b.target.value==="WARM"&&g(i)},children:f.jsx(Cn,{direction:"vertical",size:12,className:Kvt,children:h0t.map(b=>{const C=c===b.value;return f.jsxs(ln,{value:b.value,className:qvt,children:[f.jsx("span",{className:Uvt,children:b.label}),f.jsx("span",{className:`${Gvt} ${C?Qvt:""}`,children:f.jsx("span",{className:`${Rvt} ${C?Yvt:""}`})})]},b.value)})})})})]}),f.jsx(Io,{isOpen:c==="WARM",children:f.jsxs(Cn,{direction:"vertical",size:6,style:{width:"100%"},children:[f.jsx(ge.Text,{className:V7,children:"Cài đặt nội dung"}),f.jsxs("div",{className:Xvt,children:[f.jsx(ge.Text,{className:Zvt,children:"Lời nhắn riêng cho nhân viên nhân viên"}),f.jsx(R.Item,{name:[u,"type"],noStyle:!0,children:f.jsx(ch,{className:Jvt,options:p0t,block:!0})}),f.jsx(R.Item,{name:[u,h===ho.PROMPT?"prompt":"machine","content"],noStyle:!0,children:f.jsx(Nt.TextArea,{rows:4,className:e0t})}),f.jsxs(Cn,{direction:"vertical",size:8,style:{width:"100%"},children:[f.jsx(ge.Text,{className:t0t,children:"Cách hiển thị"}),f.jsx(R.Item,{name:[u,"display_type"],noStyle:!0,children:f.jsx(ln.Group,{className:n0t,children:f.jsx("div",{className:r0t,children:g0t.map(b=>{const C=p===b.value;return f.jsxs(ln,{value:b.value,className:o0t,children:[f.jsx("span",{className:i0t,children:b.label}),f.jsx("span",{className:`${a0t} ${C?s0t:""}`,children:f.jsx("span",{className:`${l0t} ${C?c0t:""}`})})]},b.value)})})})})]})]})]})}),!nt.isEmpty(s)&&f.jsx(Ed,{children:s.map(b=>f.jsx(Xf,{message:b.title,description:b.description,type:"info",showIcon:!0,closable:!0,style:{padding:"12px",margin:"12px 0"}},b.title))})]})})},Vce=({id:e,data:t,mini:n,group:r})=>{const{displayComponent:o,nodeId:i}=Rn(),a=t.title||"Chuyển máy",s=t.type||Wi.INTERNAL,l=b0(),c=d=>{d.target.closest(`button, [role="button"], input, textarea, .${_r}-modal-wrap`)||(d.stopPropagation(),d.preventDefault(),o(f.jsx(zce,{id:e}),"Cài đặt chuyển máy",()=>{},e),l(e))},u=A.useMemo(()=>s===Wi.INTERNAL?"Tổng đài":s===Wi.EXTERNAL?"Điện thoại":"UNKNOWN",[s]);return n?f.jsx("div",{className:$vt,children:f.jsx("div",{className:Pvt,children:f.jsxs("div",{className:Dvt,children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f.jsx("span",{className:Lvt,children:f.jsx(SQ,{})}),f.jsx("span",{className:Bvt,children:a})]}),f.jsx("div",{className:Fvt,children:u})]})})}):f.jsx("div",{className:_vt,onClick:c,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&c(d)},children:f.jsxs("div",{className:`${jvt} ${i===e?Dce.active:Dce.default}`,children:[f.jsxs("div",{className:`${Vvt} drag-handle__custom`,children:[f.jsxs("div",{className:zvt,children:[f.jsx(_He,{style:{fontSize:16,color:Fn.transferBlock.focus}}),f.jsx(Xd,{id:e,color:Fn.transferBlock.focus})]}),f.jsx(Iu,{id:e,deleteBtnColor:Fn.icon.transferCall})]}),!r&&f.jsx(fo,{styles:{body:{padding:4}},children:f.jsxs(Ke,{vertical:!0,gap:8,children:[f.jsxs(fo,{size:"small",styles:{body:{background:Fn.common.gray,padding:"4px 12px",borderRadius:TE.block.rounded.borderRadius,width:"100%",boxSizing:"border-box"}},children:[f.jsx(ge.Text,{children:"Chuyển máy thành công"}),f.jsx(mn,{type:"source",position:Mt.Right,id:`${e}_success`,style:{right:6}})]}),f.jsxs(fo,{size:"small",styles:{body:{background:Fn.common.gray,padding:"4px 12px",borderRadius:TE.block.rounded.borderRadius,width:"100%",boxSizing:"border-box"}},children:[f.jsx(ge.Text,{children:"Chuyển máy thất bại"}),f.jsx(mn,{type:"source",position:Mt.Right,id:`${e}_failed`,style:{right:6}})]})]})})]})})},m0t=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(Vce,{id:t,data:e})]}),v0t=[be.SPEAK,be.TRANSFER],y0t=e=>{const t=Xle(e);return{verifyAddable:A.useCallback(r=>{const o=v0t.includes(r);let i=!0;const a=[];return o||(i=!1,a.push("Block này không hỗ trợ thêm vào nhóm")),t.filter(s=>s.type===be.SPEAK).length>0&&r===be.SPEAK&&(i=!1,a.push("Nhóm chỉ có thể chứa tối đa 1 block nói")),t.filter(s=>s.type===be.TRANSFER).length>0&&r===be.TRANSFER&&(i=!1,a.push("Nhóm chỉ có thể chứa tối đa 1 block chuyển máy")),{allowed:i,errors:a}},[t])}};var b0t="scripts_editor_dxvfua1",C0t="scripts_editor_dxvfua2",A0t="scripts_editor_dxvfua3",E0t="scripts_editor_dxvfua4",S0t="scripts_editor_dxvfua5 scripts_editor_dxvfua4";const{Text:Hce}=ge,w0t=({id:e,data:t})=>{const{isReadOnly:n}=Dy(),[r]=kx(),{setNodes:o}=bn(),{screenToFlowPosition:i}=bn(),a=Xle(e),{verifyAddable:s}=y0t(e),{error:l}=nb(),c=a.length>0,u=g=>{g.preventDefault(),g.dataTransfer.dropEffect="move"},d=g=>`${e}_${g.toLowerCase()}_${Sh()}`,h=g=>{if(g.preventDefault(),!r)return;const y=s(r);if(!y.allowed){y.errors.forEach(C=>{l({content:C,key:C})});return}const v=i({x:g.clientX,y:g.clientY}),b={id:d(r),type:r,position:v,data:{title:Jg[r],...I1(r)},deletable:!0,...N1[r],parentId:e,extent:"parent",hidden:!0};o(C=>C.concat(b))},p=A.useMemo(()=>a.map(g=>g.type===be.SPEAK?f.jsx(Pce,{...g,data:g.data,group:!0},g.id):g.type===be.LISTEN?f.jsx(dce,{...g,data:g.data,group:!0},g.id):g.type===be.TRANSFER?f.jsx(Vce,{...g,data:g.data,group:!0},g.id):f.jsx(f.Fragment,{})),[a]);return f.jsx("div",{children:f.jsxs(fo,{className:b0t,styles:{body:{padding:"8px",display:"flex",flex:1,flexDirection:"column",height:"100%",minHeight:"100%"}},children:[f.jsxs("div",{className:`${C0t} drag-handle__custom`,children:[f.jsxs("div",{className:A0t,children:[f.jsx(hmt,{size:16,color:Fn.common.black}),f.jsx(Hce,{strong:!0,children:t.title}),f.jsx(Xd,{id:e,color:Fn.common.black})]}),f.jsx(Iu,{id:e,deleteBtnColor:Fn.common.black})]}),f.jsx(Cn,{direction:"vertical",size:8,children:p}),f.jsx("button",{className:c?E0t:S0t,disabled:n,onDragOver:u,onDrop:h,type:"button","data-group-drop-zone":"true",children:f.jsx(Hce,{children:"Thả block vào đây"})}),f.jsxs(Cn,{direction:"vertical",size:8,style:{marginTop:8},children:[f.jsxs(fo,{styles:{body:{padding:"12px"}},children:["Thực hiện thành công",f.jsx(mn,{type:"source",position:Mt.Right})]}),f.jsxs(fo,{styles:{body:{padding:"12px"}},children:["Thực hiện thất bại",f.jsx(mn,{type:"source",position:Mt.Right})]})]})]})})},x0t=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(w0t,{id:t,data:e})]});var I0t="scripts_editor_e9mrdz0",N0t="scripts_editor_e9mrdz1",Wce={default:"scripts_editor_e9mrdz2",active:"scripts_editor_e9mrdz3"},O0t="scripts_editor_e9mrdz4",T0t="scripts_editor_e9mrdz5",k0t="scripts_editor_e9mrdz6",M0t="scripts_editor_e9mrdz8",_0t="scripts_editor_e9mrdz9",$0t="scripts_editor_e9mrdza",P0t="scripts_editor_e9mrdzb",D0t="scripts_editor_e9mrdzc",L0t="scripts_editor_e9mrdzd",B0t="scripts_editor_e9mrdze",H7=(e=>(e.GET="GET",e.PUT="PUT",e.POST="POST",e.PATCH="PATCH",e.DELETE="DELETE",e))(H7||{}),_u=(e=>(e.JSON="json",e))(_u||{});const W7={GET:"GET",PUT:"PUT",POST:"POST",PATCH:"PATCH",DELETE:"DELETE"},F0t={GET:"Thực hiện yêu cầu GET",PUT:"Thực hiện yêu cầu PUT",POST:"Thực hiện yêu cầu POST",PATCH:"Thực hiện yêu cầu PATCH",DELETE:"Thực hiện yêu cầu DELETE"},Kce=nt.keys(W7),K7={json:"JSON"},qce=nt.keys(K7);var ka=(e=>(e.STRING="string",e.INTEGER="integer",e.FLOAT="float",e.BOOLEAN="boolean",e.LIST="list",e.OBJECT="object",e))(ka||{});const Uce={string:"String",integer:"Integer",float:"Float",boolean:"Boolean",list:"List",object:"Object"},Gce=nt.keys(Uce),j0t=()=>{const e=R.useFormInstance(),t=R.useWatch("action",e);return f.jsxs("div",{children:[f.jsx(Nt.Search,{placeholder:"Tìm kiếm hành động",allowClear:!0,onSearch:n=>{console.log("🚀 ~ e:",n)},style:{marginBottom:12}}),f.jsx(R.Item,{name:"action",label:null,children:f.jsx(ln.Group,{className:M0t,children:f.jsx(Cn,{direction:"vertical",className:_0t,size:12,children:Kce.map(n=>f.jsxs(ln,{value:n,className:$0t,children:[f.jsxs("div",{className:P0t,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:W7[n]}),f.jsx(ge.Text,{type:"secondary",children:F0t[n]})]}),t===n&&f.jsxs("div",{className:D0t,children:[f.jsx("div",{className:L0t}),f.jsx(Wr,{className:B0t})]})]},n))})})})]})},Qce="status",fp=e=>{if(typeof e=="string")return e;if(e!=null)return String(e)},Rce=e=>{if(!e||typeof e!="object")return;const t=e;return{key:fp(t.key??t.field),value:fp(t.value??t.data)}},Dx=e=>{if(Array.isArray(e))return e.map(Rce).filter(n=>n!==void 0);const t=Rce(e);return t?[t]:void 0},Yce=e=>Kce.includes(e),Xce=e=>qce.includes(e),z0t=e=>Gce.includes(e),Zce=(e,t)=>[e,...t.map(encodeURIComponent)].join("."),q7=e=>typeof e=="number"?Number.isInteger(e)?ka.INTEGER:ka.FLOAT:typeof e=="boolean"?ka.BOOLEAN:Array.isArray(e)||e!==null&&typeof e=="object"?ka.LIST:ka.STRING,V0t=e=>{if(!e||typeof e!="object")return;const t=e,n=z0t(t.type)?t.type:q7(t.value??t.data);return{key:fp(t.key??t.field),value:fp(t.value??t.data),type:n}},U7=e=>{if(Array.isArray(e)){const t=e.map(n=>{const r=V0t(n);return r||{key:void 0,value:fp(n),type:q7(n)}}).filter(n=>{var r,o;return((r=n.key)==null?void 0:r.trim())||((o=n.value)==null?void 0:o.trim())});return t.length>0?t:void 0}if(typeof e=="string"){if(!e.trim())return;try{return U7(JSON.parse(e))}catch{return}}if(e&&typeof e=="object"){const t=Object.entries(e).map(([n,r])=>({key:n,value:r!==null&&typeof r=="object"?JSON.stringify(r):fp(r),type:q7(r)}));return t.length>0?t:void 0}},H0t=()=>[{value:"true"},{value:"false"}],W0t=e=>{switch(e){case ka.INTEGER:return $n.integerproperty;case ka.FLOAT:return $n.floatproperty;case ka.BOOLEAN:case ka.LIST:return $n.singleoptionproperty;default:return $n.singlelineproperty}},K0t=({item:e,slug:t,nodeId:n,order:r,pathSegments:o})=>({id:Zce(n,o),object:n,slug:t,name:t,type:W0t(e.type),options:e.type===ka.BOOLEAN?H0t():[],node_type:be.HTTP_REQUEST,order:r}),Jce=({responseBody:e,nodeId:t,order:n})=>{const r=U7(e),o=(r==null?void 0:r.filter(a=>{var s;return(s=a.key)==null?void 0:s.trim()}).map(a=>K0t({item:a,slug:a.key??"",nodeId:t,order:n,pathSegments:[a.key??""]})))??[],i=[{id:Zce(t,[Qce]),object:t,slug:Qce,name:"Mã trạng thái",type:$n.integerproperty,options:[],node_type:be.HTTP_REQUEST,order:n}];return o.length&&i.push(...o),i},eue=e=>{const t=Dx(e==null?void 0:e.params),n=Dx(e==null?void 0:e.headers),r=Yce(e==null?void 0:e.action)?e.action:Yce(e==null?void 0:e.type)?e.type:void 0,o=Xce(e==null?void 0:e.request_body_type)?e==null?void 0:e.request_body_type:_u.JSON,i=Xce(e==null?void 0:e.response_body_type)?e==null?void 0:e.response_body_type:_u.JSON,a=e==null?void 0:e.request_body,s=U7(e==null?void 0:e.response_body),l=fp(e==null?void 0:e.api_url);return{...e,action:r,api_url:l,params:t,headers:n,request_body_type:o,request_body:a,response_body_type:i,response_body:s}},q0t=(e,{nodeId:t,order:n})=>{const r=eue(e),o=Dx(r.params),i=Dx(r.headers);return{...r,params:o,headers:i,output:Jce({responseBody:r.response_body,nodeId:t,order:n})}},U0t=({id:e,outputs:t})=>{const n=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t).map(r=>({...r,icon:()=>{var i;const o=so[((i=r.meta)==null?void 0:i.iconType)??""]??null;return o?f.jsx(o,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:n})},tue=Gce.map(e=>({label:Uce[e],value:e})),G0t=[{label:K7[_u.JSON],value:_u.JSON}],Q0t=qce.map(e=>({label:K7[e],value:e})),Lx=({name:e,title:t,addValue:n={},keyPlaceholder:r="Nhập tham số",renderValueField:o,renderExtraField:i})=>f.jsx(R.List,{name:e,initialValue:[{...n}],children:(a,{add:s,remove:l})=>f.jsxs("div",{style:{marginBottom:12},children:[f.jsxs(Ke,{align:"center",justify:"space-between",children:[f.jsx(ge.Text,{children:t}),f.jsx(yt,{type:"text",icon:f.jsx(su,{}),onClick:()=>s({...n})})]}),f.jsx(Ke,{vertical:!0,gap:12,children:a.map(c=>f.jsxs(Ke,{align:"center",justify:"space-between",gap:12,children:[f.jsx("div",{style:{flex:"1 1 0",minWidth:0},children:f.jsx(R.Item,{noStyle:!0,name:[c.name,"key"],children:f.jsx(Nt,{placeholder:r})})}),f.jsx("div",{style:{flex:"1.5 1 0",minWidth:0},children:o?o(c):f.jsx(R.Item,{noStyle:!0,name:[c.name,"value"],children:f.jsx(yo,{placeholder:"Nhập giá trị"})})}),i?f.jsx("div",{style:{flex:"1 1 0",minWidth:0},children:i(c)}):null,f.jsx(yt,{type:"text",icon:f.jsx(uc,{}),onClick:()=>l(c.name)})]},c.key))})]})}),R0t=()=>{const e=R.useFormInstance(),t=R.useWatch("action",e),n=R.useWatch("request_body_type",e),r=R.useWatch("response_body_type",e);return A.useEffect(()=>{if(!t)return;if(t===H7.GET){e.setFieldsValue({request_body_type:void 0,request_body:void 0});return}const o=e.getFieldValue("request_body");Array.isArray(o)||e.setFieldsValue({request_body_type:_u.JSON,response_body_type:_u.JSON,request_body:o??[{}]})},[e,t]),f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{name:"api_url",label:"API URL",children:f.jsx(yo,{placeholder:"Nhập API URL"})}),Lx({name:"params",title:"Params"}),Lx({name:"headers",title:"Headers"}),t!==H7.GET?f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{name:"request_body_type",label:"Request body",children:f.jsx(In,{options:Q0t})}),n===_u.JSON?Lx({name:"request_body",title:"Giá trị",addValue:{type:ka.STRING},keyPlaceholder:"Nhập key",renderExtraField:o=>f.jsx(R.Item,{noStyle:!0,name:[o.name,"type"],initialValue:ka.STRING,children:f.jsx(In,{style:{width:"100%"},placeholder:"Chọn kiểu dữ liệu",options:tue})})}):null]}):null,f.jsx(R.Item,{name:"response_body_type",label:"Response body",children:f.jsx(In,{options:G0t})}),r===_u.JSON?Lx({name:"response_body",title:"Giá trị",addValue:{type:ka.STRING},keyPlaceholder:"Nhập key",renderValueField:o=>f.jsx(R.Item,{noStyle:!0,name:[o.name,"value"],children:f.jsx(Nt,{placeholder:"Nhập giá trị"})}),renderExtraField:o=>f.jsx(R.Item,{noStyle:!0,name:[o.name,"type"],initialValue:ka.STRING,children:f.jsx(In,{style:{width:"100%"},placeholder:"Chọn kiểu dữ liệu",options:tue})})}):null]})},nue=({id:e})=>{const{getNode:t}=bn(),n=Cr(),{data:r}=t(e),o=r,i=A.useMemo(()=>eue(o),[o]),[a]=R.useForm(),[s,l]=A.useState("1"),c=R.useWatch("action",a),u=R.useWatch("response_body",a);vo({form:a,type:c}),A.useEffect(()=>{c&&l("2")},[c]);const d=y=>{n(e,q0t(y,{nodeId:e,order:o==null?void 0:o.order}))},h=A.useMemo(()=>nt.debounce(()=>{a.submit()},500),[a]);A.useEffect(()=>()=>{h.cancel()},[h]);const p=A.useMemo(()=>{if(u===void 0)return o.output??[];const y=Jce({responseBody:u,nodeId:e,order:o==null?void 0:o.order});return y.length>0?y:o.output??[]},[o.output,o==null?void 0:o.order,e,u]),g=[{key:"1",label:"Hành động",children:f.jsx(j0t,{})},{key:"2",label:"Cài đặt",children:f.jsx(R0t,{}),disabled:!c},{key:"3",label:"Đầu ra",children:f.jsx(U0t,{id:e,outputs:p}),disabled:!c}];return f.jsx("div",{className:k0t,children:f.jsxs(R,{form:a,layout:"vertical",initialValues:{...i},onFinish:d,onValuesChange:h,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(Ir,{activeKey:s,onChange:l,items:g})]})})},Y0t=({id:e,data:t,mini:n})=>{const{mode:r}=Xt(),{displayComponent:o,nodeId:i}=Rn(),a=t.title||"HTTP Request",s=l=>{const c=l.target;c!=null&&c.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(l.stopPropagation(),l.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(nue,{id:e}),a,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx(f.Fragment,{children:f.jsx("div",{className:I0t,onClick:s,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&s(l)},children:f.jsxs("div",{className:`${N0t} ${i===e?Wce.active:Wce.default}`,children:[f.jsxs("div",{className:`${T0t} drag-handle__custom`,children:[f.jsxs("div",{className:O0t,children:[f.jsx(gd,{style:{fontSize:16,color:Fn.transferBlock.focus}}),f.jsx(Xd,{id:e,color:Fn.transferBlock.focus})]}),f.jsx(Iu,{id:e,deleteBtnColor:Fn.icon.httpRequest})]}),f.jsx(fo,{styles:{body:{padding:8}},children:t!=null&&t.action?f.jsxs(Nn,{gutter:6,style:{width:"100%"},children:[f.jsx(at,{span:6,children:f.jsx(ge.Text,{strong:!0,children:W7[t==null?void 0:t.action]})}),f.jsx(at,{span:18,children:f.jsx(Ke,{style:{minWidth:0},children:f.jsx(ge.Paragraph,{style:{marginBottom:0},ellipsis:{rows:1,expanded:!1,tooltip:t==null?void 0:t.api_url},children:f.jsx(ge.Text,{children:t==null?void 0:t.api_url})})})})]}):"Chưa có hành động"})]})})})},X0t=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(Y0t,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]});var Z0t="scripts_editor_1300n210",J0t="scripts_editor_1300n211",e1t="scripts_editor_1300n212",t1t="scripts_editor_1300n213",n1t="scripts_editor_1300n215",r1t="scripts_editor_1300n217",o1t="scripts_editor_1300n218",i1t="scripts_editor_1300n219",a1t="scripts_editor_1300n21a",s1t="scripts_editor_1300n21b",l1t="scripts_editor_1300n21c",c1t="scripts_editor_1300n21d";const G7={SEND_IN_APP_WEB:"Gửi thông báo trong app"},u1t={SEND_IN_APP_WEB:"Gửi thông báo trong app"},d1t=nt.keys(G7),f1t=()=>{const e=R.useFormInstance(),t=R.useWatch("type",e);return f.jsxs("div",{children:[f.jsx(Nt.Search,{placeholder:"Tìm kiếm hành động",allowClear:!0,onSearch:n=>{console.log("🚀 ~ e:",n)},style:{marginBottom:12}}),f.jsx(R.Item,{name:"type",label:null,children:f.jsx(ln.Group,{className:r1t,children:f.jsx(Cn,{direction:"vertical",className:o1t,size:12,children:d1t.map(n=>f.jsxs(ln,{value:n,className:i1t,children:[f.jsxs("div",{className:a1t,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:G7[n]}),f.jsx(ge.Text,{type:"secondary",children:u1t[n]})]}),t===n&&f.jsxs("div",{className:s1t,children:[f.jsx("div",{className:l1t}),f.jsx(Wr,{className:c1t})]})]},n))})})})]})},h1t=({id:e,outputs:t})=>{const{getNode:n}=bn();Cr();const r=n(e);r==null||r.data;const o=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t??[]).map(i=>({...i,icon:()=>{var s;const a=so[((s=i.meta)==null?void 0:s.iconType)??""]??null;return a?f.jsx(a,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:o})},p1t=()=>f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{name:"to",label:"Người nhận thông báo",children:f.jsx(Zy,{mode:"multiple",placeholder:"Chọn người nhận thông báo",variableFilterTypes:[$n.singleuserproperty,$n.multiuserproperty]})}),f.jsx(R.Item,{name:"subject",label:"Tiêu đề thông báo",children:f.jsx(yo,{placeholder:"Nhập tiêu đề thông báo"})}),f.jsx(R.Item,{name:"content",label:"Nội dung thông báo",children:f.jsx(yo,{rows:4,placeholder:"Nhập nội dung thông báo"})})]}),g1t=()=>f.jsxs(Ke,{vertical:!0,gap:12,children:[f.jsx(ge.Text,{strong:!0,children:"Gửi thông báo"}),f.jsx(yt,{type:"primary",icon:f.jsx(RT,{}),children:"Gửi thử"})]}),m1t=({id:e})=>{var y;const{getNode:t,setNodes:n}=bn(),r=Cr(),{data:o}=t(e),i=o,[a]=R.useForm(),[s,l]=A.useState("1"),c=R.useWatch("type",a);vo({form:a,type:c});const{data:u}=Zo({type:be.NOTIFICATION,action:c??""});A.useEffect(()=>{var v,b;r(e,{output:((b=(v=u==null?void 0:u.data)==null?void 0:v.outputs)==null?void 0:b.map(C=>{var S;return{...C,object:e,node_type:be.NOTIFICATION,order:i==null?void 0:i.order,output_mode:((S=u==null?void 0:u.data)==null?void 0:S.output_mode)??[]}}))||[]})},[u==null?void 0:u.data,i==null?void 0:i.order,e,r]),A.useEffect(()=>{c&&l("2")},[c]);const d=A.useRef(!0);A.useEffect(()=>{if(d.current){const v=nt.cloneDeep(i);a.setFieldsValue({...v}),d.current=!1}},[i]);const h=v=>{const b=Vl(zl(v));r(e,{...v,variables:b})},p=A.useMemo(()=>nt.debounce(()=>{a.submit()},500),[a]);A.useEffect(()=>()=>{p.cancel()},[p]);const g=[{key:"1",label:"Hành động",children:f.jsx(f1t,{})},{key:"2",label:"Cài đặt",children:f.jsx(p1t,{}),disabled:!c},{key:"3",label:"Kiểm thử",children:f.jsx(g1t,{}),disabled:!c},{key:"4",label:"Đầu ra",children:f.jsx(h1t,{id:e,outputs:(y=u==null?void 0:u.data)==null?void 0:y.outputs}),disabled:!c}];return f.jsx("div",{className:n1t,children:f.jsxs(R,{form:a,layout:"vertical",onFinish:h,onValuesChange:p,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(Ir,{activeKey:s,onChange:l,items:g})]})})},v1t=({id:e,data:t,mini:n})=>{const{mode:r}=Xt(),{displayComponent:o}=Rn(),i=t.title||"Thông báo",{optionMap:a}=af(e),{data:s}=Cx(),l=A.useMemo(()=>{var h;const d=new Map;return(h=s==null?void 0:s.data)==null||h.forEach(p=>{d.set(p.id,p.full_name||p.email||p.id)}),d},[s==null?void 0:s.data]),c=A.useMemo(()=>{var d;return(d=t==null?void 0:t.to)==null?void 0:d.map((h,p)=>{const g=Yi(h);if(!g)return null;const y=typeof h=="string"?l.get(h)??h:p_(h)??l.get(g)??g;if(g.match(Ra)){const b=ev(a,g),C=b?el(b,g):tv(g);if(C)return f.jsx(Tu,{showTooltip:!1,closable:!1,data:C,style:{marginBottom:4,display:"inline-flex"}},`var-${g}-${p}`)}return f.jsx(ge.Paragraph,{style:{marginBottom:4},children:y},`notification-${g}-${p}`)})},[t==null?void 0:t.to,a,l]),u=d=>{const h=d.target;h!=null&&h.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(d.stopPropagation(),d.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(m1t,{id:e}),i,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx("div",{className:Z0t,onClick:u,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&u(d)},children:f.jsxs("div",{className:`${J0t}`,children:[f.jsxs(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",justify:"flex-start",style:{width:"100%"},gap:12,children:[f.jsx("div",{className:e1t,children:f.jsx(fE,{color:"#096DD9",variant:"Bold",size:24,className:t1t})}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:i})]}),f.jsx(Po,{id:e,data:t})]}),f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:16,children:f.jsx(ge.Text,{children:G7[t.type]})}),f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Người nhận"})}),f.jsx(at,{span:16,children:f.jsx(Ke,{style:{minWidth:0},children:f.jsx(ge.Paragraph,{ellipsis:{rows:1,expanded:!1,tooltip:{children:c,styles:{body:{width:"fit-content"}},showArrow:!1,color:"#FFF"}},style:{marginBottom:"unset"},children:f.jsx(ge.Text,{children:c})})})})]})]})})},y1t=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(v1t,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]});var rue="scripts_editor_1csgg250",oue="scripts_editor_1csgg251",iue="scripts_editor_1csgg252",aue="scripts_editor_1csgg253",b1t="scripts_editor_1csgg254",sue="scripts_editor_1csgg255",lue="scripts_editor_1csgg257",cue="scripts_editor_1csgg258",uue="scripts_editor_1csgg259",due="scripts_editor_1csgg25a",fue="scripts_editor_1csgg25b",hue="scripts_editor_1csgg25c",pue="scripts_editor_1csgg25d",ab=(e=>(e.CREATE="CREATE",e.GET="GET",e.UPDATE="UPDATE",e))(ab||{});const Q7={CREATE:"Thêm đơn hàng",UPDATE:"Cập nhật đơn hàng",GET:"Lấy dữ liệu đơn hàng"},C1t={CREATE:"Khi tạo đơn hàng mới",UPDATE:"Khi cập nhật đơn hàng",GET:"Khi lấy thông tin đơn hàng"},A1t=nt.keys(Q7),E1t=()=>{const e=R.useFormInstance(),t=R.useWatch("type",e);return f.jsxs("div",{children:[f.jsx(Nt.Search,{placeholder:"Tìm kiếm hành động",allowClear:!0,onSearch:n=>{console.log("🚀 ~ e:",n)},style:{marginBottom:12}}),f.jsx(R.Item,{name:"type",label:null,children:f.jsx(ln.Group,{className:lue,children:f.jsx(Cn,{direction:"vertical",className:cue,size:12,children:A1t.map(n=>f.jsxs(ln,{value:n,className:uue,children:[f.jsxs("div",{className:due,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:Q7[n]}),f.jsx(ge.Text,{type:"secondary",children:C1t[n]})]}),t===n&&f.jsxs("div",{className:fue,children:[f.jsx("div",{className:hue}),f.jsx(Wr,{className:pue})]})]},n))})})})]})},S1t=()=>f.jsx(tl,{title:"Thêm đơn hàng mới",model:"crmorder",formListName:"update_fields"}),w1t=()=>f.jsxs(f.Fragment,{children:[f.jsx(ge.Paragraph,{strong:!0,children:"Lấy thông tin các đơn hàng đáp ứng điều kiện sau:"}),f.jsx(ha,{model:"crmorder"})]}),x1t=({id:e,outputs:t})=>{const n=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t??[]).map(r=>({...r,icon:()=>{var i;const o=so[((i=r.meta)==null?void 0:i.iconType)??""]??null;return o?f.jsx(o,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:n})},I1t=()=>f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Chọn đơn hàng"}),name:"crmorder",children:f.jsx(Jy,{mode:"multiple",placeholder:"Chọn nguồn dữ liệu đơn hàng",nodeFilter:e=>e.node_type===be.ACTION_CRMORDER||e.node_type===be.TRIGGER_CRMORDER})}),f.jsx(ge.Paragraph,{strong:!0,children:"Cập nhật khi đơn hàng mới đáp ứng các điều kiện sau:"}),f.jsxs(Ke,{vertical:!0,gap:12,children:[f.jsx(ha,{model:"crmorder"}),f.jsx(tl,{title:"Cập nhật dữ liệu",model:"crmorder",formListName:"update_fields"})]})]}),N1t=({id:e})=>{var v;const{getNode:t,setNodes:n}=bn(),r=Cr(),{data:o}=t(e),i=o,[a]=R.useForm(),[s,l]=A.useState("1"),c=R.useWatch("type",a);vo({form:a,type:c});const{data:u}=Zo({type:be.ACTION_CRMORDER,action:c??""});A.useEffect(()=>{var b,C;r(e,{output:((C=(b=u==null?void 0:u.data)==null?void 0:b.outputs)==null?void 0:C.map(S=>{var E;return{...S,object:e,node_type:be.ACTION_CRMORDER,order:i==null?void 0:i.order,output_mode:((E=u==null?void 0:u.data)==null?void 0:E.output_mode)??[]}}))||[]})},[u==null?void 0:u.data,i==null?void 0:i.order,e,r]),A.useEffect(()=>{c&&l("2")},[c]);const d=A.useRef(!0);A.useEffect(()=>{if(d.current){const b=nt.cloneDeep(i),C=Cs(b==null?void 0:b.object,(b==null?void 0:b.groups)??[],(b==null?void 0:b.filter_type)??"AND");a.setFieldsValue({...b,...C}),d.current=!1}},[i]);const h=()=>{switch(c){case ab.CREATE:return f.jsx(S1t,{});case ab.UPDATE:return f.jsx(I1t,{});case ab.GET:return f.jsx(w1t,{});default:return null}},p=b=>{var E;const C=Js((E=(b==null?void 0:b.groups)??[])==null?void 0:E.map(x=>{var I;return{...x,conditions:(I=x==null?void 0:x.conditions)==null?void 0:I.filter(N=>!nt.isEmpty(N))}})),S=Vl(zl(b));r(e,{...b,groups:C,variables:S})},g=A.useMemo(()=>nt.debounce(()=>{a.submit()},500),[a]);A.useEffect(()=>()=>{g.cancel()},[g]);const y=[{key:"1",label:"Hành động",children:f.jsx(E1t,{})},{key:"2",label:"Cài đặt",children:h()},{key:"3",label:"Đầu ra",children:f.jsx(x1t,{outputs:(v=u==null?void 0:u.data)==null?void 0:v.outputs,id:e})}];return f.jsx("div",{className:sue,children:f.jsxs(R,{form:a,layout:"vertical",initialValues:{...i},onFinish:p,onValuesChange:g,children:[f.jsx(R.Item,{hidden:!0,name:["title"]}),f.jsx(Ir,{activeKey:s,onChange:l,items:y})]})})},O1t=({id:e,data:t,mini:n})=>{var s,l;const{mode:r}=Xt(),{displayComponent:o}=Rn(),i=t.title||"Đơn hàng",a=c=>{const u=c.target;u!=null&&u.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(c.stopPropagation(),c.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(N1t,{id:e}),i,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx(f.Fragment,{children:f.jsx("div",{className:rue,onClick:a,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&a(c)},children:f.jsxs("div",{className:`${oue}`,children:[f.jsxs(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",justify:"flex-start",style:{width:"100%"},gap:12,children:[f.jsx("div",{className:iue,children:f.jsx(yh,{className:aue})}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:i})]}),f.jsx(Po,{id:e,data:t})]}),f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:16,children:Q7[t.type]}),(t==null?void 0:t.type)===ab.GET?f.jsxs(f.Fragment,{children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Điều kiện"})}),f.jsx(at,{span:16,children:f.jsx(ku,{nodeId:e,groups:t==null?void 0:t.groups})})]}):f.jsxs(f.Fragment,{children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Dữ liệu"})}),f.jsx(at,{span:16,children:f.jsxs(ge.Paragraph,{style:{marginBottom:0},ellipsis:{rows:2,expanded:!1,tooltip:(s=t==null?void 0:t.update_fields)==null?void 0:s.map(c=>c.name).join(", ")},children:[f.jsx(ge.Text,{strong:!0,children:(l=t==null?void 0:t.update_fields)==null?void 0:l.map(c=>c.name).join(", ")})," "]})})]})]})]})})})},T1t=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(O1t,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]}),k1t=({id:e,outputs:t})=>{const n=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t).map(r=>({...r,icon:()=>{var i;const o=so[((i=r.meta)==null?void 0:i.iconType)??""]??null;return o?f.jsx(o,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:n})};var _c=(e=>(e.CREATED="created",e.UPDATED="updated",e.UPDATED_BY_CONDITION="updated_by_condition",e.DELETED="deleted",e.TIME="TIME",e))(_c||{}),fv=(e=>(e.SAME_DAY="SAME_DAY",e.BEFORE="BEFORE",e.AFTER="AFTER",e))(fv||{}),$c=(e=>(e.AT_EVENT="AT_EVENT",e.BEFORE_EVENT="BEFORE_EVENT",e.AFTER_EVENT="AFTER_EVENT",e.FIXED_TIME="FIXED_TIME",e))($c||{});const R7={created:"Đơn hàng mới được tạo",updated_by_condition:"Đơn hàng được cập nhật",updated:"Đơn hàng cập nhật thoả mãn điều kiện",deleted:"Đơn hàng bị xóa",TIME:"Tại thời điểm của 1 trường dữ liệu"},M1t={created:"Khi có đơn hàng mới được tạo",updated:"Khi đơn hàng được cập nhật thoả mãn điều kiện",updated_by_condition:"Khi cập nhật một số trường dữ liệu của đơn hàng",deleted:"Khi có đơn hàng bị xóa",TIME:"Kích hoạt theo thời gian đã định"},_1t=nt.keys(R7),Y7={SAME_DAY:"Ngày diễn ra sự kiện",BEFORE:"Trước ngày diễn ra sự kiện",AFTER:"Sau ngày diễn ra sự kiện"},$1t=nt.keys(Y7),gue={AT_EVENT:"Thời gian sự kiện",BEFORE_EVENT:"Trước sự kiện",AFTER_EVENT:"Sau sự kiện",FIXED_TIME:"Thời gian cố định"},P1t=nt.keys(gue),D1t=()=>f.jsx(R.Item,{shouldUpdate:(e,t)=>e.type!==t.type,noStyle:!0,children:({getFieldValue:e})=>{const t=e("type");if(t===_c.TIME)return f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Trường dữ liệu thời gian"}),name:"time_field",getValueProps:r=>({value:r==null?void 0:r.id,dataDefault:r}),getValueFromEvent:(r,o)=>{var i;return(i=Array.isArray(o)?o[0]:o)==null?void 0:i.data},children:f.jsx(xx,{modal:"crmorder",propertyType:[Bn.date,Bn.datetime]})}),f.jsx(ge.Paragraph,{style:{marginBottom:"8px"},strong:!0,children:"Thời gian kích hoạt"}),f.jsx(R.Item,{shouldUpdate:(r,o)=>r.date_config_value!==o.date_config_value,noStyle:!0,children:({getFieldValue:r})=>{const i=(r("date_config_value")??fv.SAME_DAY)!==fv.SAME_DAY;return f.jsxs(Nn,{gutter:12,style:{alignItems:"baseline"},children:[f.jsx(at,{span:3,children:f.jsx(R.Item,{label:"Ngày",labelCol:{span:24},wrapperCol:{span:0}})}),f.jsx(at,{span:i?12:21,children:f.jsx(R.Item,{name:"date_config_value",initialValue:fv.SAME_DAY,children:f.jsx(In,{options:$1t.map(a=>({value:a,label:Y7[a],key:a})),placeholder:"Thời gian kích hoạt"})})}),i&&f.jsx(at,{span:9,children:f.jsx(R.Item,{name:"date_config_offset",initialValue:1,children:f.jsx(ci,{min:1,style:{width:"100%"},suffix:"Ngày",controls:!1})})})]})}}),f.jsx(R.Item,{shouldUpdate:(r,o)=>r.time_config_value!==o.time_config_value||r.time_field!==o.time_field,noStyle:!0,children:({getFieldValue:r})=>{const o=r("time_config_value")??$c.BEFORE_EVENT,i=r("time_field"),a=o!==$c.AT_EVENT;return f.jsxs(Nn,{gutter:12,style:{alignItems:"baseline"},children:[f.jsx(at,{span:3,children:f.jsx(R.Item,{label:"Giờ",labelCol:{span:24},wrapperCol:{span:0}})}),f.jsx(at,{span:(i==null?void 0:i.variant_config)===Bn.date?0:a?12:21,children:f.jsx(R.Item,{name:"time_config_value",initialValue:$c.BEFORE_EVENT,children:f.jsx(In,{options:P1t.map(s=>({value:s,label:gue[s],key:s}))})})}),(a||(i==null?void 0:i.variant_config)===Bn.date||(i==null?void 0:i.variant_config)===Bn.datetime)&&f.jsx(at,{span:(i==null?void 0:i.variant_config)===Bn.date?21:a?9:0,children:f.jsx(R.Item,{noStyle:!0,shouldUpdate:(s,l)=>s.time_config_value!==l.time_config_value,children:({getFieldValue:s})=>s("time_config_value")===$c.FIXED_TIME||(i==null?void 0:i.variant_config)===Bn.date?f.jsx(R.Item,{name:"time_config_fixed_time",initialValue:Un("08:30",lo),children:f.jsx(cu,{style:{width:"100%"},placeholder:"Chọn giờ",format:lo,minuteStep:5,allowClear:!1})}):f.jsxs(Cn.Compact,{block:!0,children:[f.jsx(R.Item,{name:"time_config_offset",initialValue:10,children:f.jsx(ci,{style:{width:"100%"},min:1,controls:!1})}),f.jsx(R.Item,{name:"time_config_offset_unit",initialValue:"MINUTES",children:f.jsx(In,{options:[{label:"Giờ",value:"HOURS"},{label:"Phút",value:"MINUTES"}]})})]})})})]})}})]});if(t===_c.UPDATED_BY_CONDITION)return f.jsx(Hle,{model:"crmorder",object:"crmorder",title:"Đơn hàng được cập nhật một trong các trường:"});let n="";return t===_c.CREATED?n="Đơn hàng mới đáp ứng các điều kiện sau":t===_c.DELETED?n="Đơn hàng bị xóa thoả mãn":t===_c.UPDATED&&(n="Đơn hàng sau khi cập nhật thoả mãn"),f.jsxs(f.Fragment,{children:[f.jsxs(ge.Title,{level:5,style:{margin:"unset"},children:["Kích hoạt khi ",n,":"]}),f.jsx(ha,{model:"crmorder"})]})}}),L1t=()=>{const e=R.useFormInstance(),t=R.useWatch("type",e);return f.jsxs("div",{children:[f.jsx(Nt.Search,{placeholder:"Tìm kiếm hành động trigger",allowClear:!0,onSearch:n=>{console.log("🚀 ~ e:",n)},style:{marginBottom:12}}),f.jsx(R.Item,{name:"type",label:null,children:f.jsx(ln.Group,{className:lue,children:f.jsx(Cn,{direction:"vertical",className:cue,size:12,children:_1t.map(n=>f.jsxs(ln,{value:n,className:uue,children:[f.jsxs("div",{className:due,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:R7[n]}),f.jsx(ge.Text,{type:"secondary",children:M1t[n]})]}),t===n&&f.jsxs("div",{className:fue,children:[f.jsx("div",{className:hue}),f.jsx(Wr,{className:pue})]})]},n))})})})]})},B1t=e=>{var t;if(e.type===_c.UPDATED_BY_CONDITION){if((t=e.groups)!=null&&t.length)return e.groups;if(e.condition)return[e.condition]}},F1t=({id:e})=>{var v;const{getNode:t,setNodes:n}=bn(),{mode:r}=Xt(),o=Cr(),{data:i}=t(e),a=i,[s]=R.useForm(),[l,c]=A.useState("1"),u=R.useWatch("type",s);vo({form:s,type:u});const{data:d}=Zo({type:be.TRIGGER_CRMORDER,action:u??""});A.useEffect(()=>{var b,C;o(e,{output:((C=(b=d==null?void 0:d.data)==null?void 0:b.outputs)==null?void 0:C.map(S=>{var E;return{...S,object:e,node_type:be.TRIGGER_CRMORDER,order:a==null?void 0:a.order,output_mode:((E=d==null?void 0:d.data)==null?void 0:E.output_mode)??[]}}))||[]})},[d==null?void 0:d.data,a==null?void 0:a.order,e,o]),A.useEffect(()=>{u&&c("2")},[u]);const h=A.useRef(!0);A.useEffect(()=>{var b;if(h.current){const C=nt.cloneDeep(a),{change_field_id:S,...E}=C,x=Cs(C.object??"",C.groups??[],C.filter_type??"AND"),I=B1t(C),N=C==null?void 0:C.date_config,O=C==null?void 0:C.time_config;s.setFieldsValue({...E,...I?{filter_type:((b=I[0])==null?void 0:b.filter_type)??"AND",groups:I}:x,condition:void 0,change_field_ids:C.type===_c.UPDATED_BY_CONDITION?C.change_field_ids??Fle(I):void 0,condition_values:Ble(I),time_field:{id:C.time_field,name:C==null?void 0:C.time_field_name,slug:C==null?void 0:C.time_field_slug,variant_config:C==null?void 0:C.time_field_type},date_config_value:N==null?void 0:N.relative_type,date_config_offset:N==null?void 0:N.offset_value,time_config_value:O==null?void 0:O.execution_mode,time_config_fixed_time:O!=null&&O.fixed_time_value?Un(O==null?void 0:O.fixed_time_value,lo):void 0,time_config_offset:O==null?void 0:O.relative_value,time_config_offset_unit:O==null?void 0:O.relative_unit}),h.current=!1}},[a,s]);const p=()=>{var F;const b=s.getFieldsValue(!0),{time_field:C,date_config_value:S,date_config_offset:E,time_config_value:x,time_config_fixed_time:I,time_config_offset:N,time_config_offset_unit:O,condition_values:T,output:M,..._}=b,L=b.type===_c.UPDATED_BY_CONDITION,P=Js((F=b.groups??[])==null?void 0:F.map(z=>{var V;return{...z,conditions:(V=z==null?void 0:z.conditions)==null?void 0:V.filter(U=>!nt.isEmpty(U))}})),$={relative_type:S,offset_value:S!==fv.SAME_DAY?E:void 0},B={execution_mode:x,fixed_time_value:x===$c.FIXED_TIME||(C==null?void 0:C.variant_config)===Bn.date?Un(I).format(lo):void 0,relative_value:x!==$c.FIXED_TIME&&x!==$c.AT_EVENT?N:void 0,relative_unit:x!==$c.FIXED_TIME&&x!==$c.AT_EVENT?O:void 0},D={..._,groups:L?jle(b.groups,"crmorder"):P,change_field_ids:L?b.change_field_ids:void 0,time_field:C==null?void 0:C.id,time_field_type:C==null?void 0:C.variant_config,time_field_slug:C==null?void 0:C.slug,time_field_name:C==null?void 0:C.name,date_config:$,time_config:B};r==="edit"&&n(z=>z.map(V=>{if(V.id!==e)return V;const{change_field_id:U,...q}=V.data;return{...V,data:{...q,...D}}}))},g=A.useMemo(()=>nt.debounce(()=>{s.submit()},500),[s]);A.useEffect(()=>()=>{g.cancel()},[g]);const y=[{key:"1",label:"Trigger",children:f.jsx(L1t,{})},{key:"2",label:"Cài đặt",children:f.jsx(D1t,{}),disabled:!u},{key:"3",label:"Đầu ra",children:f.jsx(k1t,{outputs:(v=d==null?void 0:d.data)==null?void 0:v.outputs,id:e}),disabled:!u}];return f.jsx("div",{className:sue,children:f.jsxs(R,{form:s,layout:"vertical",onFinish:p,onValuesChange:g,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(Ir,{activeKey:l,onChange:c,items:y})]})})},j1t=({id:e,data:t,mini:n})=>{var p,g;const{mode:r}=Xt(),{displayComponent:o}=Rn(),i=t.title||"Đơn hàng",a=t.type,s=t==null?void 0:t.date_config,l=(t==null?void 0:t.date_config_value)??(s==null?void 0:s.relative_type),c=(t==null?void 0:t.date_config_offset)??(s==null?void 0:s.offset_value),d=`${(l?Y7[l]:void 0)??""} ${l!==fv.SAME_DAY&&c!=null?`${c} ngày`:""}`.trim(),h=y=>{const v=y.target;v!=null&&v.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(y.stopPropagation(),y.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(F1t,{id:e}),i,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx(f.Fragment,{children:f.jsx("div",{className:rue,onClick:h,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&h(y)},children:f.jsxs("div",{className:`${oue}`,children:[f.jsxs(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",justify:"flex-start",style:{width:"100%"},gap:12,children:[f.jsxs("div",{className:iue,children:[f.jsx(yh,{className:aue}),f.jsx(vs,{size:14,className:b1t,variant:"Bold",color:"#000"})]}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:i})]}),f.jsx(Po,{id:e,data:t})]}),f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:16,children:f.jsx(ge.Text,{children:R7[a]})}),f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Điều kiện"})}),f.jsx(at,{span:16,children:(t==null?void 0:t.type)!==_c.TIME?f.jsx(ku,{nodeId:e,groups:t==null?void 0:t.groups}):f.jsxs(Ke,{vertical:!0,gap:4,style:{minWidth:0},children:[f.jsxs(ge.Paragraph,{style:{marginBottom:0},ellipsis:{rows:1,expanded:!1,tooltip:((p=t==null?void 0:t.time_field)==null?void 0:p.name)||(t==null?void 0:t.time_field_name)},children:[f.jsx(ge.Text,{strong:!0,children:((g=t==null?void 0:t.time_field)==null?void 0:g.name)||(t==null?void 0:t.time_field_name)})," "]}),f.jsx(ge.Paragraph,{style:{marginBottom:0},ellipsis:{rows:1,expanded:!1,tooltip:d},children:f.jsx(ge.Text,{strong:!0,children:d})})]})})]})]})})})},z1t=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(j1t,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]});var V1t="scripts_editor_1osrdyg0",H1t="scripts_editor_1osrdyg1",W1t="scripts_editor_1osrdyg2",K1t="scripts_editor_1osrdyg3",q1t="scripts_editor_1osrdyg4",U1t="scripts_editor_1osrdyg5",G1t="scripts_editor_1osrdyg7",Q1t="scripts_editor_1osrdyg8",R1t="scripts_editor_1osrdyg9",Y1t="scripts_editor_1osrdyga",X1t="scripts_editor_1osrdygb",Z1t="scripts_editor_1osrdygc",J1t="scripts_editor_1osrdygd",mue="scripts_editor_1osrdygg",$u=(e=>(e.DAILY="DAILY",e.WEEKLY="WEEKLY",e.MONTHLY="MONTHLY",e.PERIODIC="PERIODIC",e))($u||{}),X7=(e=>(e.DEFAULT_2_YEARS="DEFAULT_2_YEARS",e.CUSTOM="CUSTOM",e))(X7||{}),vue=(e=>(e.FIRST_DAY="FIRST_DAY",e.LAST_DAY="LAST_DAY",e.CUSTOM="CUSTOM",e))(vue||{}),yue=(e=>(e.MINUTE="MINUTE",e.HOUR="HOUR",e.DAY="DAY",e))(yue||{});const Z7={DAILY:"Kích hoạt hàng ngày",WEEKLY:"Kích hoạt hàng tuần",MONTHLY:"Kích hoạt hàng tháng",PERIODIC:"Kích hoạt theo chu kỳ"},eyt={DAILY:"Kích hoạt hàng ngày",WEEKLY:"Kích hoạt hàng tuần",MONTHLY:"Kích hoạt hàng tháng",PERIODIC:"Kích hoạt theo chu kỳ"},tyt=nt.keys(Z7),bue={DEFAULT_2_YEARS:"Mặc định: 2 năm kể từ ngày sản xuất",CUSTOM:"Tùy chỉnh"},nyt=nt.keys(bue),Bx={MON:"Thứ 2",FRI:"Thứ 6",TUE:"Thứ 3",SAT:"Thứ 7",WED:"Thứ 4",SUN:"Chủ Nhật",THU:"Thứ 5"},ryt=nt.keys(Bx),Fx={FIRST_DAY:"Ngày đầu tiên của tháng",LAST_DAY:"Ngày cuối cùng của tháng",CUSTOM:"Tuỳ chỉnh"},oyt=nt.keys(Fx),jx={MINUTE:"Phút",HOUR:"Giờ",DAY:"Ngày"},iyt=nt.keys(jx),ayt=()=>{const e=R.useFormInstance(),t=R.useWatch("type",e);return f.jsxs("div",{children:[f.jsx(Nt.Search,{placeholder:"Tìm kiếm hành động",allowClear:!0,onSearch:n=>{console.log("🚀 ~ e:",n)},style:{marginBottom:12}}),f.jsx(R.Item,{name:"type",label:null,children:f.jsx(ln.Group,{className:G1t,children:f.jsx(Cn,{direction:"vertical",className:Q1t,size:12,children:tyt.map(n=>f.jsxs(ln,{value:n,className:R1t,children:[f.jsxs("div",{className:Y1t,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:Z7[n]}),f.jsx(ge.Text,{type:"secondary",children:eyt[n]})]}),t===n&&f.jsxs("div",{className:X1t,children:[f.jsx("div",{className:Z1t}),f.jsx(Wr,{className:J1t})]})]},n))})})})]})},syt=({id:e,outputs:t})=>{const n=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t??[]).map(r=>({...r,icon:()=>{var i;const o=so[((i=r.meta)==null?void 0:i.iconType)??""]??null;return o?f.jsx(o,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:n})},lyt=()=>f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.type!==t.type,children:({getFieldValue:e})=>e("type")===$u.WEEKLY?f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Ngày trong tuần"}),name:["config","days_of_week"],children:f.jsx(Fr.Group,{style:{display:"grid",gridTemplateColumns:"repeat(2, minmax(100px, 1fr))",rowGap:8},options:ryt.map(t=>({label:Bx[t],value:t}))})}):null}),f.jsx(R.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.type!==t.type,children:({getFieldValue:e})=>e("type")===$u.MONTHLY?f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Ngày trong tháng"}),name:["config","month_day_type"],children:f.jsx(ln.Group,{className:mue,children:oyt.map(t=>f.jsx(ln,{value:t,children:Fx[t]},t))})}):null}),f.jsx(R.Item,{noStyle:!0,shouldUpdate:(e,t)=>{var n,r;return((n=e.config)==null?void 0:n.month_day_type)!==((r=t.config)==null?void 0:r.month_day_type)},children:({getFieldValue:e})=>e(["config","month_day_type"])===vue.CUSTOM?f.jsx(R.Item,{label:null,name:["config","specific_day"],rules:[{required:!0,message:"Vui lòng chọn ngày"}],children:f.jsx(ci,{style:{width:"100%"},min:1,max:31,placeholder:"Chọn ngày"})}):null}),f.jsx(R.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.type!==t.type,children:({getFieldValue:e})=>e("type")===$u.PERIODIC?f.jsxs(f.Fragment,{children:[f.jsx(ge.Text,{strong:!0,children:"Kích hoạt mỗi"}),f.jsxs(Nn,{gutter:6,children:[f.jsx(at,{span:12,children:f.jsx(R.Item,{name:["config","interval_value"],label:null,rules:[{required:!0,message:"Vui lòng nhập giá trị"}],children:f.jsx(ci,{style:{width:"100%"},min:1,placeholder:"Nhập giá trị"})})}),f.jsx(at,{span:12,children:f.jsx(R.Item,{name:["config","interval_unit"],label:null,initialValue:yue.MINUTE,rules:[{required:!0,message:"Vui lòng chọn đơn vị"}],children:f.jsx(In,{placeholder:"Chọn đơn vị",options:iyt.map(t=>({label:jx[t],value:t}))})})})]})]}):null}),f.jsx(R.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.type!==t.type,children:({getFieldValue:e})=>e("type")!==$u.PERIODIC?f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Thời gian"}),name:["config","trigger_time"],children:f.jsx(cu,{style:{width:"100%"},placeholder:"Chọn giờ",format:lo,allowClear:!0,minuteStep:5})}):null}),f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Hiệu lực"}),name:["validity","validity_type"],children:f.jsx(ln.Group,{className:mue,children:nyt.map(e=>f.jsx(ln,{value:e,children:bue[e]},e))})}),f.jsx(R.Item,{noStyle:!0,shouldUpdate:(e,t)=>{var n,r;return((n=e.validity)==null?void 0:n.validity_type)!==((r=t.validity)==null?void 0:r.validity_type)},children:({getFieldValue:e})=>e(["validity","validity_type"])===X7.CUSTOM?f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Ngày kết thúc"}),name:["validity","validity_end_date"],rules:[{required:!0,message:"Vui lòng chọn ngày"}],children:f.jsx(fd,{style:{width:"100%"},placeholder:"Chọn ngày",allowClear:!0,format:op})}):null})]}),cyt=({id:e})=>{var y;const{getNode:t,setNodes:n}=bn(),r=Cr(),{data:o}=t(e),i=o,[a]=R.useForm(),[s,l]=A.useState("1"),c=R.useWatch("type",a);vo({form:a,type:c,getResetValues:()=>({validity:{validity_type:X7.DEFAULT_2_YEARS}})});const{data:u}=Zo({type:be.SCHEDULE_AT,action:c??""});A.useEffect(()=>{var v,b;r(e,{output:((b=(v=u==null?void 0:u.data)==null?void 0:v.outputs)==null?void 0:b.map(C=>{var S;return{...C,object:e,node_type:be.SCHEDULE_AT,order:i==null?void 0:i.order,output_mode:((S=u==null?void 0:u.data)==null?void 0:S.output_mode)??[]}}))||[]})},[u==null?void 0:u.data,i==null?void 0:i.order,e,r]),A.useEffect(()=>{c&&l("2")},[c]);const d=A.useRef(!0);A.useEffect(()=>{var v,b;if(d.current){const C=nt.cloneDeep(i);(v=C==null?void 0:C.validity)!=null&&v.validity_end_date&&(C.validity.validity_end_date=Un(C.validity.validity_end_date,op)),(b=C==null?void 0:C.config)!=null&&b.trigger_time&&(C.config.trigger_time=Un(C.config.trigger_time,lo)),a.setFieldsValue({...C}),d.current=!1}},[i]);const h=v=>{const{config:b,validity:C}=v;C!=null&&C.validity_end_date&&(v.validity.validity_end_date=Un(C.validity_end_date).format(op)),b!=null&&b.trigger_time&&(v.config.trigger_time=Un(b.trigger_time).format("HH:mm")),r(e,v)},p=A.useMemo(()=>nt.debounce(()=>{a.submit()},500),[a]);A.useEffect(()=>()=>{p.cancel()},[p]);const g=[{key:"1",label:"Hành động",children:f.jsx(ayt,{})},{key:"2",label:"Cài đặt",children:f.jsx(lyt,{}),disabled:!c},{key:"3",label:"Đầu ra",children:f.jsx(syt,{outputs:(y=u==null?void 0:u.data)==null?void 0:y.outputs,id:e}),disabled:!c}];return f.jsx("div",{className:U1t,children:f.jsxs(R,{form:a,layout:"vertical",onFinish:h,onValuesChange:p,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(Ir,{activeKey:s,onChange:l,items:g})]})})},uyt=({id:e,data:t,mini:n})=>{var l,c,u;const{mode:r}=Xt(),{displayComponent:o}=Rn(),i=t.title||"Thông báo",a=d=>{const h=d.target;h!=null&&h.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(d.stopPropagation(),d.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(cyt,{id:e}),i,()=>{},e))};if(n)return f.jsx(f.Fragment,{});const s=A.useMemo(()=>{var d,h,p,g,y,v,b,C,S,E,x,I,N,O,T,M,_,L;switch(t.type){case $u.DAILY:return f.jsx(Ke,{style:{minWidth:0},children:f.jsx(ge.Paragraph,{ellipsis:{rows:1,expanded:!1,tooltip:(d=t==null?void 0:t.config)!=null&&d.trigger_time?Un(t.config.trigger_time,lo).format(lo):void 0},style:{marginBottom:"unset"},children:f.jsx(ge.Text,{children:(h=t==null?void 0:t.config)!=null&&h.trigger_time?Un(t.config.trigger_time,lo).format(lo):""})})});case $u.WEEKLY:return f.jsxs(Ke,{vertical:!0,gap:6,children:[f.jsx(Ke,{style:{minWidth:0},children:f.jsx(ge.Paragraph,{style:{marginBottom:"unset"},ellipsis:{rows:1,expanded:!1,tooltip:(y=(g=(p=t==null?void 0:t.config)==null?void 0:p.days_of_week)==null?void 0:g.map(P=>Bx[P]))==null?void 0:y.join(", ")},children:f.jsx(ge.Text,{children:(C=(b=(v=t==null?void 0:t.config)==null?void 0:v.days_of_week)==null?void 0:b.map(P=>Bx[P]))==null?void 0:C.join(", ")})})}),f.jsx(Ke,{style:{minWidth:0},children:f.jsx(ge.Paragraph,{style:{marginBottom:"unset"},ellipsis:{rows:1,expanded:!1,tooltip:(S=t==null?void 0:t.config)!=null&&S.trigger_time?Un(t.config.trigger_time,lo).format(lo):void 0},children:f.jsx(ge.Text,{children:(E=t==null?void 0:t.config)!=null&&E.trigger_time?Un(t.config.trigger_time,lo).format(lo):""})})})]});case $u.MONTHLY:return f.jsxs(Ke,{vertical:!0,gap:6,children:[f.jsx(Ke,{style:{minWidth:0},children:f.jsx(ge.Paragraph,{style:{marginBottom:"unset"},ellipsis:{rows:1,expanded:!1,tooltip:Fx[(x=t==null?void 0:t.config)==null?void 0:x.month_day_type]},children:f.jsx(ge.Text,{children:Fx[(I=t==null?void 0:t.config)==null?void 0:I.month_day_type]})})}),f.jsx(Ke,{style:{minWidth:0},children:f.jsx(ge.Paragraph,{style:{marginBottom:"unset"},ellipsis:{rows:1,expanded:!1,tooltip:(N=t==null?void 0:t.config)!=null&&N.trigger_time?Un(t.config.trigger_time,lo).format(lo):void 0},children:f.jsx(ge.Text,{children:(O=t==null?void 0:t.config)!=null&&O.trigger_time?Un(t.config.trigger_time,lo).format(lo):""})})})]});case $u.PERIODIC:return f.jsx(Ke,{style:{minWidth:0},children:f.jsx(ge.Paragraph,{style:{marginBottom:"unset"},ellipsis:{rows:1,expanded:!1,tooltip:`Mỗi ${(T=t==null?void 0:t.config)==null?void 0:T.interval_value} ${jx[(M=t==null?void 0:t.config)==null?void 0:M.interval_unit]}`},children:f.jsxs(ge.Text,{children:["Mỗi ",(_=t==null?void 0:t.config)==null?void 0:_.interval_value," ",jx[(L=t==null?void 0:t.config)==null?void 0:L.interval_unit]]})})})}},[t]);return f.jsx("div",{className:V1t,onClick:a,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&a(d)},children:f.jsxs("div",{className:`${H1t}`,children:[f.jsxs(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",justify:"flex-start",style:{width:"100%"},gap:12,children:[f.jsxs("div",{className:W1t,children:[f.jsx(pE,{color:"#096DD9",variant:"Bold",size:24,className:K1t}),f.jsx(vs,{size:14,className:q1t,variant:"Bold",color:"#000"})]}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:i})]}),f.jsx(Po,{id:e,data:t})]}),f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:16,children:f.jsx(ge.Text,{children:Z7[t.type]})}),f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Thời gian"})}),f.jsx(at,{span:16,children:s}),(l=t==null?void 0:t.validity)!=null&&l.validity_end_date?f.jsxs(f.Fragment,{children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{ellipsis:{tooltip:"Ngày hết hạn"},type:"secondary",children:"Ngày hết hạn"})}),f.jsx(at,{span:16,children:f.jsx(Ke,{style:{minWidth:0},children:f.jsx(ge.Paragraph,{ellipsis:{rows:1,expanded:!1,tooltip:(c=t==null?void 0:t.validity)!=null&&c.validity_end_date?Un(t.validity.validity_end_date,op).format(op):void 0},children:f.jsx(ge.Text,{children:(u=t==null?void 0:t.validity)!=null&&u.validity_end_date?Un(t.validity.validity_end_date,op).format(op):""})})})})]}):null]})]})})},dyt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(uyt,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]});var fyt="scripts_editor_1eie6q00",hyt="scripts_editor_1eie6q01",pyt="scripts_editor_1eie6q02",gyt="scripts_editor_1eie6q03",myt="scripts_editor_1eie6q04",vyt="scripts_editor_1eie6q05",yyt="scripts_editor_1eie6q06",byt="scripts_editor_1eie6q07",Cyt="scripts_editor_1eie6q08",Ayt="scripts_editor_1eie6q09",Eyt="scripts_editor_1eie6q0a",Syt="scripts_editor_1eie6q0b";const J7={START:"Bắt đầu chiến dịch",PAUSE:"Tạm dừng chiến dịch",STOP:"Dừng chiến dịch"},wyt={START:"Bắt đầu chiến dịch telesale đã chọn",PAUSE:"Tạm dừng chiến dịch telesale đã chọn",STOP:"Dừng chiến dịch telesale đã chọn"},xyt=nt.keys(J7),Iyt=()=>{const e=R.useFormInstance(),t=R.useWatch("type",e);return f.jsx(R.Item,{name:"type",label:null,children:f.jsx(ln.Group,{className:vyt,children:f.jsx(Cn,{direction:"vertical",className:yyt,size:12,children:xyt.map(n=>f.jsxs(ln,{value:n,className:byt,children:[f.jsxs("div",{className:Cyt,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:J7[n]}),f.jsx(ge.Text,{type:"secondary",children:wyt[n]})]}),t===n&&f.jsxs("div",{className:Ayt,children:[f.jsx("div",{className:Eyt}),f.jsx(Wr,{className:Syt})]})]},n))})})})},Nyt=({id:e,outputs:t})=>{const n=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t??[]).map(r=>({...r,icon:()=>{var i;const o=so[((i=r.meta)==null?void 0:i.iconType)??""]??null;return o?f.jsx(o,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:n})},Oyt=()=>f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Chiến dịch telesale"}),name:"campaign_id",children:f.jsx(J_,{types:["telesale"],placeholder:"Chọn chiến dịch telesale"})}),Tyt="telesale__",kyt=e=>{if(e)return e.includes("__")?e:`${Tyt}${e}`},Myt=e=>{if(e)return e.includes("__")?e.split("__")[1]:e},_yt=({id:e})=>{var g;const{getNode:t}=bn(),n=Cr(),{data:r}=t(e),o=r,[i]=R.useForm(),[a,s]=A.useState("1"),l=R.useWatch("type",i);vo({form:i,type:l});const{data:c}=Zo({type:be.SMS_CAMPAIGN,action:l??""});A.useEffect(()=>{var y,v;n(e,{output:((v=(y=c==null?void 0:c.data)==null?void 0:y.outputs)==null?void 0:v.map(b=>{var C;return{...b,object:e,node_type:be.SMS_CAMPAIGN,order:o==null?void 0:o.order,output_mode:((C=c==null?void 0:c.data)==null?void 0:C.output_mode)??[]}}))||[]})},[c==null?void 0:c.data,o==null?void 0:o.order,e,n]),A.useEffect(()=>{l&&s("2")},[l]);const u=A.useMemo(()=>({...o,campaign_id:kyt(o==null?void 0:o.campaign_id)}),[o]),d=y=>{n(e,{...y,campaign_id:Myt(y.campaign_id)})},h=A.useMemo(()=>nt.debounce(()=>{i.submit()},500),[i]);A.useEffect(()=>()=>{h.cancel()},[h]);const p=[{key:"1",label:"Hành động",children:f.jsx(Iyt,{})},{key:"2",label:"Cài đặt",children:f.jsx(Oyt,{}),disabled:!l},{key:"3",label:"Đầu ra",children:f.jsx(Nyt,{id:e,outputs:(g=c==null?void 0:c.data)==null?void 0:g.outputs}),disabled:!l}];return f.jsx("div",{className:myt,children:f.jsxs(R,{form:i,layout:"vertical",initialValues:u,onFinish:d,onValuesChange:h,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(Ir,{activeKey:a,onChange:s,items:p})]})})},$yt=({id:e,data:t,mini:n})=>{const{mode:r}=Xt(),{displayComponent:o}=Rn(),i=t.title||"Chiến dịch Telesale",a=s=>{const l=s.target;l!=null&&l.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(s.stopPropagation(),s.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(_yt,{id:e}),i,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx("div",{className:fyt,onClick:a,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&a(s)},children:f.jsxs("div",{className:hyt,children:[f.jsxs(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",justify:"flex-start",style:{width:"100%"},gap:12,children:[f.jsx("div",{className:pyt,children:f.jsx(cE,{color:"#096DD9",variant:"Bold",size:24,className:gyt})}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:i})]}),f.jsx(Po,{id:e,data:t})]}),f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:16,children:f.jsx(ge.Text,{children:J7[t.type]})})]})]})})},Pyt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx($yt,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]}),Dyt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(Pce,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]});var Lyt="scripts_editor_flqrya0",Byt="scripts_editor_flqrya1",Fyt="scripts_editor_flqrya2 scripts_editor_flqrya1",Cue="scripts_editor_flqrya3",jyt="scripts_editor_flqrya4",zyt="scripts_editor_flqrya5 scripts_editor_flqrya4";const Vyt=({mini:e})=>e?f.jsxs("div",{className:Fyt,children:[f.jsx("span",{className:Cue,children:f.jsx(LY,{style:{fontSize:"20px"}})}),f.jsx("span",{className:zyt,children:"Bắt đầu"})]}):f.jsx("div",{className:Lyt,children:f.jsxs("div",{className:Byt,children:[f.jsx("span",{className:Cue,children:f.jsx(LY,{})}),f.jsx("span",{className:jyt,children:"Bắt đầu"})]})}),Hyt=({id:e,data:t})=>f.jsxs(Tr,{nodeId:e,children:[f.jsx(mn,{type:"source",position:Mt.Right}),f.jsx(Vyt,{id:e,data:t})]});var Wyt="scripts_editor_1csgg250",Kyt="scripts_editor_1csgg251",qyt="scripts_editor_1csgg252",Uyt="scripts_editor_1csgg253",Gyt="scripts_editor_1csgg255",Qyt="scripts_editor_1csgg257",Ryt="scripts_editor_1csgg258",Yyt="scripts_editor_1csgg259",Xyt="scripts_editor_1csgg25a",Zyt="scripts_editor_1csgg25b",Jyt="scripts_editor_1csgg25c",ebt="scripts_editor_1csgg25d",zx=(e=>(e.CREATE="CREATE",e.UPDATE="UPDATE",e.GET="GET",e))(zx||{});const e$={CREATE:"Tạo mới task",UPDATE:"Cập nhật task",GET:"Lấy thông tin task"},tbt={CREATE:"Tạo mới task",UPDATE:"Cập nhật task đã chọn",GET:"Lấy thông tin task theo điều kiện"},nbt=nt.keys(e$),rbt=()=>{const e=R.useFormInstance(),t=R.useWatch("type",e);return f.jsx(R.Item,{name:"type",label:null,children:f.jsx(ln.Group,{className:Qyt,children:f.jsx(Cn,{direction:"vertical",className:Ryt,size:12,children:nbt.map(n=>f.jsxs(ln,{value:n,className:Yyt,children:[f.jsxs("div",{className:Xyt,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:e$[n]}),f.jsx(ge.Text,{type:"secondary",children:tbt[n]})]}),t===n&&f.jsxs("div",{className:Zyt,children:[f.jsx("div",{className:Jyt}),f.jsx(Wr,{className:ebt})]})]},n))})})})},obt=()=>f.jsx(tl,{title:"Tạo mới task",model:"crmtask",formListName:"update_fields"}),ibt=()=>f.jsxs(f.Fragment,{children:[f.jsx(ge.Paragraph,{strong:!0,children:"Lấy thông tin các task đáp ứng điều kiện sau:"}),f.jsx(ha,{model:"crmtask"})]}),abt=({id:e,outputs:t})=>{const n=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t??[]).map(r=>({...r,icon:()=>{var i;const o=so[((i=r.meta)==null?void 0:i.iconType)??""]??null;return o?f.jsx(o,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:n})},sbt=()=>f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Chọn task"}),name:"task_id",children:f.jsx(Xse,{placeholder:"Chọn task"})}),f.jsx(ge.Paragraph,{strong:!0,children:"Cập nhật khi task đáp ứng các điều kiện sau:"}),f.jsxs(Ke,{vertical:!0,gap:12,children:[f.jsx(ha,{model:"crmtask"}),f.jsx(tl,{title:"Cập nhật dữ liệu",model:"crmtask",formListName:"update_fields"})]})]}),lbt=({id:e})=>{var y;const{getNode:t}=bn(),n=Cr(),{data:r}=t(e),o=r,[i]=R.useForm(),[a,s]=A.useState("1"),l=R.useWatch("type",i);vo({form:i,type:l});const{data:c}=Zo({type:be.TASK,action:l??""});A.useEffect(()=>{var v,b;n(e,{output:((b=(v=c==null?void 0:c.data)==null?void 0:v.outputs)==null?void 0:b.map(C=>{var S;return{...C,object:e,node_type:be.TASK,order:o==null?void 0:o.order,output_mode:((S=c==null?void 0:c.data)==null?void 0:S.output_mode)??[]}}))||[]})},[c==null?void 0:c.data,o==null?void 0:o.order,e,n]),A.useEffect(()=>{l&&s("2")},[l]);const u=A.useRef(!0);A.useEffect(()=>{if(u.current){const v=nt.cloneDeep(o),b=Cs(v==null?void 0:v.object,(v==null?void 0:v.groups)??[],(v==null?void 0:v.filter_type)??"AND");i.setFieldsValue({...v,...b}),u.current=!1}},[o,i]);const d=()=>{switch(l){case zx.CREATE:return f.jsx(obt,{});case zx.UPDATE:return f.jsx(sbt,{});case zx.GET:return f.jsx(ibt,{});default:return null}},h=v=>{const b=Js(((v==null?void 0:v.groups)??[]).map(S=>{var E;return{...S,conditions:(E=S==null?void 0:S.conditions)==null?void 0:E.filter(x=>!nt.isEmpty(x))}})),C=Vl(zl(v));n(e,{...v,groups:b,variables:C})},p=A.useMemo(()=>nt.debounce(()=>{i.submit()},500),[i]);A.useEffect(()=>()=>{p.cancel()},[p]);const g=[{key:"1",label:"Hành động",children:f.jsx(rbt,{})},{key:"2",label:"Cài đặt",children:d(),disabled:!l},{key:"3",label:"Đầu ra",children:f.jsx(abt,{id:e,outputs:(y=c==null?void 0:c.data)==null?void 0:y.outputs}),disabled:!l}];return f.jsx("div",{className:Gyt,children:f.jsxs(R,{form:i,layout:"vertical",initialValues:{...o},onFinish:h,onValuesChange:p,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(Ir,{activeKey:a,onChange:s,items:g})]})})},cbt=({id:e,data:t,mini:n})=>{const{mode:r}=Xt(),{displayComponent:o}=Rn(),i=t.title||"Task",a=s=>{const l=s.target;l!=null&&l.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(s.stopPropagation(),s.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(lbt,{id:e}),i,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx("div",{className:Wyt,onClick:a,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&a(s)},children:f.jsxs("div",{className:Kyt,children:[f.jsxs(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",justify:"flex-start",style:{width:"100%"},gap:12,children:[f.jsx("div",{className:qyt,children:f.jsx(uE,{color:"#096DD9",variant:"Bold",size:24,className:Uyt})}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:i})]}),f.jsx(Po,{id:e,data:t})]}),f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:16,children:f.jsx(ge.Text,{children:e$[t.type]})})]})]})})},ubt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(cbt,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]});var Aue="scripts_editor_1md7pi10",Eue="scripts_editor_1md7pi11",Sue="scripts_editor_1md7pi12",wue="scripts_editor_1md7pi13",dbt="scripts_editor_1md7pi14",xue="scripts_editor_1md7pi15",Iue="scripts_editor_1md7pi16",Nue="scripts_editor_1md7pi17",Oue="scripts_editor_1md7pi18",Tue="scripts_editor_1md7pi19",kue="scripts_editor_1md7pi1a",Mue="scripts_editor_1md7pi1b",_ue="scripts_editor_1md7pi1c",Vx=(e=>(e.CREATE="CREATE",e.UPDATE="UPDATE",e.GET="GET",e))(Vx||{});const t$={CREATE:"Tạo mới phiếu ghi",UPDATE:"Cập nhật phiếu ghi",GET:"Lấy thông tin phiếu ghi"},fbt={CREATE:"Tạo mới phiếu ghi",UPDATE:"Cập nhật phiếu ghi đã chọn",GET:"Lấy thông tin phiếu ghi theo điều kiện"},hbt=nt.keys(t$),pbt=()=>{const e=R.useFormInstance(),t=R.useWatch("type",e);return f.jsx(R.Item,{name:"type",label:null,children:f.jsx(ln.Group,{className:Iue,children:f.jsx(Cn,{direction:"vertical",className:Nue,size:12,children:hbt.map(n=>f.jsxs(ln,{value:n,className:Oue,children:[f.jsxs("div",{className:Tue,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:t$[n]}),f.jsx(ge.Text,{type:"secondary",children:fbt[n]})]}),t===n&&f.jsxs("div",{className:kue,children:[f.jsx("div",{className:Mue}),f.jsx(Wr,{className:_ue})]})]},n))})})})},gbt=()=>f.jsx(tl,{title:"Tạo mới phiếu ghi",model:"ticket",formListName:"update_fields"}),mbt=()=>f.jsxs(f.Fragment,{children:[f.jsx(ge.Paragraph,{strong:!0,children:"Lấy thông tin các phiếu ghi đáp ứng điều kiện sau:"}),f.jsx(ha,{model:"ticket"})]}),vbt=({id:e,outputs:t})=>{const n=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t??[]).map(r=>({...r,icon:()=>{var i;const o=so[((i=r.meta)==null?void 0:i.iconType)??""]??null;return o?f.jsx(o,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:n})},ybt=()=>f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Chọn phiếu ghi"}),name:"ticket",children:f.jsx(Jy,{mode:"multiple",placeholder:"Chọn nguồn dữ liệu phiếu ghi",nodeFilter:e=>e.node_type===be.ACTION_TICKET||e.node_type===be.TRIGGER_TICKET})}),f.jsx(ge.Paragraph,{strong:!0,children:"Cập nhật khi phiếu ghi đáp ứng các điều kiện sau:"}),f.jsxs(Ke,{vertical:!0,gap:12,children:[f.jsx(ha,{model:"ticket"}),f.jsx(tl,{title:"Cập nhật dữ liệu",model:"ticket",formListName:"update_fields"})]})]}),bbt=({id:e})=>{var y;const{getNode:t}=bn(),n=Cr(),{data:r}=t(e),o=r,[i]=R.useForm(),[a,s]=A.useState("1"),l=R.useWatch("type",i);vo({form:i,type:l});const{data:c}=Zo({type:be.ACTION_TICKET,action:l??""});A.useEffect(()=>{var v,b;n(e,{output:((b=(v=c==null?void 0:c.data)==null?void 0:v.outputs)==null?void 0:b.map(C=>{var S;return{...C,object:e,node_type:be.ACTION_TICKET,order:o==null?void 0:o.order,output_mode:((S=c==null?void 0:c.data)==null?void 0:S.output_mode)??[]}}))||[]})},[c==null?void 0:c.data,o==null?void 0:o.order,e,n]),A.useEffect(()=>{l&&s("2")},[l]);const u=A.useRef(!0);A.useEffect(()=>{if(u.current){const v=nt.cloneDeep(o),b=Cs(v==null?void 0:v.object,(v==null?void 0:v.groups)??[],(v==null?void 0:v.filter_type)??"AND");i.setFieldsValue({...v,...b}),u.current=!1}},[o,i]);const d=()=>{switch(l){case Vx.CREATE:return f.jsx(gbt,{});case Vx.UPDATE:return f.jsx(ybt,{});case Vx.GET:return f.jsx(mbt,{});default:return null}},h=v=>{const b=Js(((v==null?void 0:v.groups)??[]).map(S=>{var E;return{...S,conditions:(E=S==null?void 0:S.conditions)==null?void 0:E.filter(x=>!nt.isEmpty(x))}})),C=Vl(zl(v));n(e,{...v,groups:b,variables:C})},p=A.useMemo(()=>nt.debounce(()=>{i.submit()},500),[i]);A.useEffect(()=>()=>{p.cancel()},[p]);const g=[{key:"1",label:"Hành động",children:f.jsx(pbt,{})},{key:"2",label:"Cài đặt",children:d(),disabled:!l},{key:"3",label:"Đầu ra",children:f.jsx(vbt,{id:e,outputs:(y=c==null?void 0:c.data)==null?void 0:y.outputs}),disabled:!l}];return f.jsx("div",{className:xue,children:f.jsxs(R,{form:i,layout:"vertical",initialValues:{...o},onFinish:h,onValuesChange:p,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(Ir,{activeKey:a,onChange:s,items:g})]})})},Cbt=({id:e,data:t,mini:n})=>{const{mode:r}=Xt(),{displayComponent:o}=Rn(),i=t.title||"Phiếu ghi",a=s=>{const l=s.target;l!=null&&l.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(s.stopPropagation(),s.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(bbt,{id:e}),i,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx("div",{className:Aue,onClick:a,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&a(s)},children:f.jsxs("div",{className:Eue,children:[f.jsxs(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",justify:"flex-start",style:{width:"100%"},gap:12,children:[f.jsx("div",{className:Sue,children:f.jsx(Ch,{color:"#096DD9",variant:"Bold",size:24,className:wue})}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:i})]}),f.jsx(Po,{id:e,data:t})]}),f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:16,children:f.jsx(ge.Text,{children:t$[t.type]})})]})]})})},Abt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(Cbt,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]}),Ebt=({id:e,outputs:t})=>{const n=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t).map(r=>({...r,icon:()=>{var i;const o=so[((i=r.meta)==null?void 0:i.iconType)??""]??null;return o?f.jsx(o,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:n})};var Hx=(e=>(e.CREATED="created",e.UPDATED="updated",e.DELETED="deleted",e.TIME="TIME",e))(Hx||{}),hv=(e=>(e.SAME_DAY="SAME_DAY",e.BEFORE="BEFORE",e.AFTER="AFTER",e))(hv||{}),Pc=(e=>(e.AT_EVENT="AT_EVENT",e.BEFORE_EVENT="BEFORE_EVENT",e.AFTER_EVENT="AFTER_EVENT",e.FIXED_TIME="FIXED_TIME",e))(Pc||{});const Wx={created:"Phiếu ghi mới được tạo",updated:"Phiếu ghi được cập nhật",deleted:"Phiếu ghi bị xóa",TIME:"Tại thời điểm của 1 trường dữ liệu"},Sbt={created:"Khi có phiếu ghi mới được tạo",updated:"Khi có phiếu ghi được cập nhật",deleted:"Khi có phiếu ghi bị xóa",TIME:"Kích hoạt theo thời gian đã định"},wbt=nt.keys(Wx),n$={SAME_DAY:"Ngày diễn ra sự kiện",BEFORE:"Trước ngày diễn ra sự kiện",AFTER:"Sau ngày diễn ra sự kiện"},xbt=nt.keys(n$),$ue={AT_EVENT:"Thời gian sự kiện",BEFORE_EVENT:"Trước sự kiện",AFTER_EVENT:"Sau sự kiện",FIXED_TIME:"Thời gian cố định"},Ibt=nt.keys($ue),Nbt=()=>f.jsx(R.Item,{shouldUpdate:(e,t)=>e.type!==t.type,noStyle:!0,children:({getFieldValue:e})=>{const t=e("type");return t===Hx.TIME?f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Trường dữ liệu thời gian"}),name:"time_field",getValueProps:n=>({value:n==null?void 0:n.id,dataDefault:n}),getValueFromEvent:(n,r)=>{var o;return(o=Array.isArray(r)?r[0]:r)==null?void 0:o.data},children:f.jsx(xx,{modal:"ticket",propertyType:[Bn.date,Bn.datetime]})}),f.jsx(ge.Paragraph,{style:{marginBottom:"8px"},strong:!0,children:"Thời gian kích hoạt"}),f.jsx(R.Item,{shouldUpdate:(n,r)=>n.date_config_value!==r.date_config_value,noStyle:!0,children:({getFieldValue:n})=>{const o=(n("date_config_value")??hv.SAME_DAY)!==hv.SAME_DAY;return f.jsxs(Nn,{gutter:12,style:{alignItems:"baseline"},children:[f.jsx(at,{span:3,children:f.jsx(R.Item,{label:"Ngày",labelCol:{span:24},wrapperCol:{span:0}})}),f.jsx(at,{span:o?12:21,children:f.jsx(R.Item,{name:"date_config_value",initialValue:hv.SAME_DAY,children:f.jsx(In,{options:xbt.map(i=>({value:i,label:n$[i],key:i})),placeholder:"Thời gian kích hoạt"})})}),o&&f.jsx(at,{span:9,children:f.jsx(R.Item,{name:"date_config_offset",initialValue:1,children:f.jsx(ci,{min:1,style:{width:"100%"},suffix:"Ngày",controls:!1})})})]})}}),f.jsx(R.Item,{shouldUpdate:(n,r)=>n.time_config_value!==r.time_config_value||n.time_field!==r.time_field,noStyle:!0,children:({getFieldValue:n})=>{const r=n("time_config_value")??Pc.BEFORE_EVENT,o=n("time_field"),i=r!==Pc.AT_EVENT;return f.jsxs(Nn,{gutter:12,style:{alignItems:"baseline"},children:[f.jsx(at,{span:3,children:f.jsx(R.Item,{label:"Giờ",labelCol:{span:24},wrapperCol:{span:0}})}),f.jsx(at,{span:(o==null?void 0:o.variant_config)===Bn.date?0:i?12:21,children:f.jsx(R.Item,{name:"time_config_value",initialValue:Pc.BEFORE_EVENT,children:f.jsx(In,{options:Ibt.map(a=>({value:a,label:$ue[a],key:a}))})})}),(i||(o==null?void 0:o.variant_config)===Bn.date||(o==null?void 0:o.variant_config)===Bn.datetime)&&f.jsx(at,{span:(o==null?void 0:o.variant_config)===Bn.date?21:i?9:0,children:f.jsx(R.Item,{noStyle:!0,shouldUpdate:(a,s)=>a.time_config_value!==s.time_config_value,children:({getFieldValue:a})=>a("time_config_value")===Pc.FIXED_TIME||(o==null?void 0:o.variant_config)===Bn.date?f.jsx(R.Item,{name:"time_config_fixed_time",initialValue:Un("08:30",lo),children:f.jsx(cu,{style:{width:"100%"},placeholder:"Chọn giờ",format:lo,minuteStep:5,allowClear:!1})}):f.jsxs(Cn.Compact,{block:!0,children:[f.jsx(R.Item,{name:"time_config_offset",initialValue:10,children:f.jsx(ci,{style:{width:"100%"},min:1,controls:!1})}),f.jsx(R.Item,{name:"time_config_offset_unit",initialValue:"MINUTES",children:f.jsx(In,{options:[{label:"Giờ",value:"HOURS"},{label:"Phút",value:"MINUTES"}]})})]})})})]})}})]}):f.jsxs(f.Fragment,{children:[t===Hx.UPDATED?f.jsx(R.Item,{label:"Trường dữ liệu thay đổi",name:"change_field_id",children:f.jsx(xx,{modal:"ticket"})}):null,f.jsxs(ge.Title,{level:5,style:{margin:"unset"},children:["Kích hoạt khi ",Wx[t]," đáp ứng các điều kiện sau:"]}),f.jsx(ha,{model:"ticket"})]})}}),Obt=()=>{const e=R.useFormInstance(),t=R.useWatch("type",e);return f.jsxs("div",{children:[f.jsx(Nt.Search,{placeholder:"Tìm kiếm hành động trigger",allowClear:!0,onSearch:n=>{console.log("🚀 ~ e:",n)},style:{marginBottom:12}}),f.jsx(R.Item,{name:"type",label:null,children:f.jsx(ln.Group,{className:Iue,children:f.jsx(Cn,{direction:"vertical",className:Nue,size:12,children:wbt.map(n=>f.jsxs(ln,{value:n,className:Oue,children:[f.jsxs("div",{className:Tue,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:Wx[n]}),f.jsx(ge.Text,{type:"secondary",children:Sbt[n]})]}),t===n&&f.jsxs("div",{className:kue,children:[f.jsx("div",{className:Mue}),f.jsx(Wr,{className:_ue})]})]},n))})})})]})},Tbt=({id:e})=>{var g;const{getNode:t}=bn(),n=Cr(),{data:r}=t(e),o=r,[i]=R.useForm(),[a,s]=A.useState("1"),l=R.useWatch("type",i);vo({form:i,type:l});const{data:c}=Zo({type:be.TRIGGER_TICKET,action:l??""});A.useEffect(()=>{var y,v;n(e,{output:((v=(y=c==null?void 0:c.data)==null?void 0:y.outputs)==null?void 0:v.map(b=>{var C;return{...b,object:e,node_type:be.TRIGGER_TICKET,order:o==null?void 0:o.order,output_mode:((C=c==null?void 0:c.data)==null?void 0:C.output_mode)??[]}}))||[]})},[c==null?void 0:c.data,o==null?void 0:o.order,e,n]),A.useEffect(()=>{l&&s("2")},[l]);const u=A.useRef(!0);A.useEffect(()=>{if(u.current){const y=nt.cloneDeep(o),v=Cs(y.object??"",y.groups??[],y.filter_type??"AND"),b=y==null?void 0:y.date_config,C=y==null?void 0:y.time_config;i.setFieldsValue({...y,...v,time_field:{id:y.time_field,name:y==null?void 0:y.time_field_name,slug:y==null?void 0:y.time_field_slug,variant_config:y==null?void 0:y.time_field_type},date_config_value:b==null?void 0:b.relative_type,date_config_offset:b==null?void 0:b.offset_value,time_config_value:C==null?void 0:C.execution_mode,time_config_fixed_time:C!=null&&C.fixed_time_value?Un(C==null?void 0:C.fixed_time_value,lo):void 0,time_config_offset:C==null?void 0:C.relative_value,time_config_offset_unit:C==null?void 0:C.relative_unit}),u.current=!1}},[o,i]);const d=y=>{var _;const{time_field:v,date_config_value:b,date_config_offset:C,time_config_value:S,time_config_fixed_time:E,time_config_offset:x,time_config_offset_unit:I,...N}=y,O=Js((_=y.groups??[])==null?void 0:_.map(L=>{var P;return{...L,conditions:(P=L==null?void 0:L.conditions)==null?void 0:P.filter($=>!nt.isEmpty($))}})),T={relative_type:b,offset_value:b!==hv.SAME_DAY?C:void 0},M={execution_mode:S,fixed_time_value:S===Pc.FIXED_TIME||(v==null?void 0:v.variant_config)===Bn.date?Un(E).format(lo):void 0,relative_value:S!==Pc.FIXED_TIME&&S!==Pc.AT_EVENT?x:void 0,relative_unit:S!==Pc.FIXED_TIME&&S!==Pc.AT_EVENT?I:void 0};n(e,{...N,groups:O,time_field:v==null?void 0:v.id,time_field_type:v==null?void 0:v.variant_config,time_field_slug:v==null?void 0:v.slug,time_field_name:v==null?void 0:v.name,date_config:T,time_config:M})},h=A.useMemo(()=>nt.debounce(()=>{i.submit()},500),[i]);A.useEffect(()=>()=>{h.cancel()},[h]);const p=[{key:"1",label:"Hành động",children:f.jsx(Obt,{})},{key:"2",label:"Cài đặt",children:f.jsx(Nbt,{}),disabled:!l},{key:"3",label:"Đầu ra",children:f.jsx(Ebt,{outputs:(g=c==null?void 0:c.data)==null?void 0:g.outputs,id:e}),disabled:!l}];return f.jsx("div",{className:xue,children:f.jsxs(R,{form:i,layout:"vertical",onFinish:d,onValuesChange:h,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(Ir,{activeKey:a,onChange:s,items:p})]})})},kbt=({id:e,data:t,mini:n})=>{var p,g;const{mode:r}=Xt(),{displayComponent:o}=Rn(),i=t.title||"Phiếu ghi",a=t.type,s=t==null?void 0:t.date_config,l=(t==null?void 0:t.date_config_value)??(s==null?void 0:s.relative_type),c=(t==null?void 0:t.date_config_offset)??(s==null?void 0:s.offset_value),d=`${(l?n$[l]:void 0)??""} ${l!==hv.SAME_DAY&&c!=null?`${c} ngày`:""}`.trim(),h=y=>{const v=y.target;v!=null&&v.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(y.stopPropagation(),y.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(Tbt,{id:e}),i,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx(f.Fragment,{children:f.jsx("div",{className:Aue,onClick:h,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&h(y)},children:f.jsxs("div",{className:Eue,children:[f.jsxs(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",justify:"flex-start",style:{width:"100%"},gap:12,children:[f.jsxs("div",{className:Sue,children:[f.jsx(Ch,{color:"#096DD9",variant:"Bold",size:24,className:wue}),f.jsx(vs,{size:14,className:dbt,variant:"Bold",color:"#000"})]}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:i})]}),f.jsx(Po,{id:e,data:t})]}),f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:16,children:f.jsx(ge.Text,{children:Wx[a]})}),f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Điều kiện"})}),f.jsx(at,{span:16,children:(t==null?void 0:t.type)!==Hx.TIME?f.jsx(ku,{nodeId:e,groups:t==null?void 0:t.groups}):f.jsxs(Ke,{vertical:!0,gap:4,style:{minWidth:0},children:[f.jsxs(ge.Paragraph,{style:{marginBottom:0},ellipsis:{rows:1,expanded:!1,tooltip:((p=t==null?void 0:t.time_field)==null?void 0:p.name)||(t==null?void 0:t.time_field_name)},children:[f.jsx(ge.Text,{strong:!0,children:((g=t==null?void 0:t.time_field)==null?void 0:g.name)||(t==null?void 0:t.time_field_name)})," "]}),f.jsx(ge.Paragraph,{style:{marginBottom:0},ellipsis:{rows:1,expanded:!1,tooltip:d},children:f.jsx(ge.Text,{strong:!0,children:d})})]})})]})]})})})},Mbt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(kbt,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]});var _bt="scripts_editor_zsm0z70",$bt="scripts_editor_zsm0z71",Pbt="scripts_editor_zsm0z72",Dbt="scripts_editor_zsm0z73",Lbt="scripts_editor_zsm0z75",Bbt="scripts_editor_zsm0z76",Fbt="scripts_editor_zsm0z77",jbt="scripts_editor_zsm0z78",zbt="scripts_editor_zsm0z79",Vbt="scripts_editor_zsm0z7a",Hbt="scripts_editor_zsm0z7b",Wbt="scripts_editor_zsm0z7c",pv=(e=>(e.CREATE="CREATE",e.GET="GET",e.UPDATE="UPDATE",e.TOGGLE="TOGGLE",e.SEND="SEND",e))(pv||{});const r$={CREATE:"Thêm khách hàng vào chiến dịch",UPDATE:"Cập nhật khách hàng chiến dịch",GET:"Lấy thông tin khách hàng chiến dịch",TOGGLE:"Bật/tắt chiến dịch",SEND:"Gửi tin nhắn với mẫu có sẵn"},Kbt={CREATE:"Thêm khách hàng vào chiến dịch ZNS đã chọn",UPDATE:"Cập nhật khách hàng trong chiến dịch ZNS",GET:"Lấy thông tin khách hàng trong chiến dịch ZNS",TOGGLE:"Bật hoặc tắt chiến dịch ZNS đã chọn",SEND:"Gửi tin nhắn ZNS với mẫu có sẵn"},qbt=nt.keys(r$),Ubt=()=>{const e=R.useFormInstance(),t=R.useWatch("type",e);return f.jsx(R.Item,{name:"type",label:null,children:f.jsx(ln.Group,{className:Bbt,children:f.jsx(Cn,{direction:"vertical",className:Fbt,size:12,children:qbt.map(n=>f.jsxs(ln,{value:n,className:jbt,children:[f.jsxs("div",{className:zbt,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:r$[n]}),f.jsx(ge.Text,{type:"secondary",children:Kbt[n]})]}),t===n&&f.jsxs("div",{className:Vbt,children:[f.jsx("div",{className:Hbt}),f.jsx(Wr,{className:Wbt})]})]},n))})})})},Gbt="filter-infinite-zns-campaign",Qbt=({currentFilters:e,pageSize:t=10,enabled:n=!0})=>{const{axiosInstance:r,context:{COMPANY_ID:o}}=Xt();return ba({queryKey:[Gbt,o??"",e,t],queryFn:({pageParam:i=1})=>r.get(`/company/${o}/sms_campaign`,{params:{...e,page:i,page_size:t}}),enabled:n&&!!o,initialPageParam:1,getNextPageParam:(i,a)=>{if(a.reduce((l,c)=>l+c.data.results.length,0)<i.data.count)return a.length+1},staleTime:1e3*60*10,refetchOnMount:!1,retry:1})},gv=({placeholder:e="Chọn chiến dịch ZNS",...t})=>{const{search:n,onSearch:r}=wi(),{data:o,fetchNextPage:i,hasNextPage:a,isLoading:s}=Qbt({currentFilters:{search:n},pageSize:10}),l=A.useMemo(()=>(o==null?void 0:o.pages.flatMap(u=>u.data.results))??[],[o==null?void 0:o.pages]),c=A.useCallback(u=>{const d=u.name||u.id;return{value:u.id,label:d,rawLabel:d,title:d}},[]);return f.jsx(Tc,{placeholder:e,records:l,isLoading:s,hasNextPage:a,fetchNextPage:i,onSearch:r,buildOption:c,...t})},Rbt=()=>f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Chiến dịch ZNS"}),name:"id",children:f.jsx(gv,{placeholder:"Chọn chiến dịch ZNS"})}),f.jsx(tl,{title:"Thêm khách hàng vào chiến dịch",model:"contact",formListName:"update_fields"})]}),Ybt=()=>f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Chiến dịch ZNS"}),name:"id",children:f.jsx(gv,{placeholder:"Chọn chiến dịch ZNS"})}),f.jsx(ge.Paragraph,{strong:!0,children:"Lấy thông tin khách hàng đáp ứng điều kiện sau:"}),f.jsx(ha,{model:"contact"})]}),Xbt=({id:e,outputs:t})=>{const n=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t??[]).map(r=>({...r,icon:()=>{var i;const o=so[((i=r.meta)==null?void 0:i.iconType)??""]??null;return o?f.jsx(o,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:n})},Zbt=()=>f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Chiến dịch ZNS"}),name:"id",children:f.jsx(gv,{placeholder:"Chọn chiến dịch ZNS"})}),Jbt=()=>f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Chiến dịch ZNS"}),name:"id",children:f.jsx(gv,{placeholder:"Chọn chiến dịch ZNS"})}),eCt=()=>f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Chiến dịch ZNS"}),name:"id",children:f.jsx(gv,{placeholder:"Chọn chiến dịch ZNS"})}),f.jsx(ge.Paragraph,{strong:!0,children:"Cập nhật khi khách hàng đáp ứng điều kiện sau:"}),f.jsxs(Ke,{vertical:!0,gap:12,children:[f.jsx(ha,{model:"contact"}),f.jsx(tl,{title:"Cập nhật dữ liệu",model:"contact",formListName:"update_fields"})]})]}),tCt=({id:e})=>{var y;const{getNode:t}=bn(),n=Cr(),{data:r}=t(e),o=r,[i]=R.useForm(),[a,s]=A.useState("1"),l=R.useWatch("type",i);vo({form:i,type:l});const{data:c}=Zo({type:be.ACTION_ZNS,action:l??""});A.useEffect(()=>{var v,b;n(e,{output:((b=(v=c==null?void 0:c.data)==null?void 0:v.outputs)==null?void 0:b.map(C=>{var S;return{...C,object:e,node_type:be.ACTION_ZNS,order:o==null?void 0:o.order,output_mode:((S=c==null?void 0:c.data)==null?void 0:S.output_mode)??[]}}))||[]})},[c==null?void 0:c.data,o==null?void 0:o.order,e,n]),A.useEffect(()=>{l&&s("2")},[l]);const u=A.useRef(!0);A.useEffect(()=>{if(u.current){const v=nt.cloneDeep(o),b=Cs(v==null?void 0:v.object,(v==null?void 0:v.groups)??[],(v==null?void 0:v.filter_type)??"AND");i.setFieldsValue({...v,...b}),u.current=!1}},[o,i]);const d=()=>{switch(l){case pv.CREATE:return f.jsx(Rbt,{});case pv.UPDATE:return f.jsx(eCt,{});case pv.GET:return f.jsx(Ybt,{});case pv.TOGGLE:return f.jsx(Jbt,{});case pv.SEND:return f.jsx(Zbt,{});default:return null}},h=v=>{const b=Js(((v==null?void 0:v.groups)??[]).map(S=>{var E;return{...S,conditions:(E=S==null?void 0:S.conditions)==null?void 0:E.filter(x=>!nt.isEmpty(x))}})),C=Vl(zl(v));n(e,{...v,groups:b,variables:C})},p=A.useMemo(()=>nt.debounce(()=>{i.submit()},500),[i]);A.useEffect(()=>()=>{p.cancel()},[p]);const g=[{key:"1",label:"Hành động",children:f.jsx(Ubt,{})},{key:"2",label:"Cài đặt",children:d(),disabled:!l},{key:"3",label:"Đầu ra",children:f.jsx(Xbt,{id:e,outputs:(y=c==null?void 0:c.data)==null?void 0:y.outputs}),disabled:!l}];return f.jsx("div",{className:Lbt,children:f.jsxs(R,{form:i,layout:"vertical",initialValues:o,onFinish:h,onValuesChange:p,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(Ir,{activeKey:a,onChange:s,items:g})]})})},nCt=({id:e,data:t,mini:n})=>{const{mode:r}=Xt(),{displayComponent:o}=Rn(),i=t.title||"Chiến dịch ZNS",a=l=>{const c=l.target;c!=null&&c.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(l.stopPropagation(),l.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(tCt,{id:e}),i,()=>{},e))};if(n)return f.jsx(f.Fragment,{});const s=Array.isArray(t==null?void 0:t.groups)&&t.groups.length>0;return f.jsx("div",{className:_bt,onClick:a,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&a(l)},children:f.jsxs("div",{className:$bt,children:[f.jsxs(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",justify:"flex-start",style:{width:"100%"},gap:12,children:[f.jsx("div",{className:Pbt,children:f.jsx(gc,{color:"#096DD9",variant:"Bold",size:24,className:Dbt})}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:i})]}),f.jsx(Po,{id:e,data:t})]}),f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:16,children:f.jsx(ge.Text,{children:r$[t.type]})}),s&&f.jsxs(f.Fragment,{children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Bộ lọc"})}),f.jsx(at,{span:16,children:f.jsx(ku,{nodeId:e,groups:t.groups})})]})]})]})})},rCt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(nCt,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]});var oCt="scripts_editor_1wqjt4n0",iCt="scripts_editor_1wqjt4n1",aCt="scripts_editor_1wqjt4n2",sCt="scripts_editor_1wqjt4n3",lCt="scripts_editor_1wqjt4n4",cCt="scripts_editor_1wqjt4n5",uCt="scripts_editor_1wqjt4n6",dCt="scripts_editor_1wqjt4n7",fCt="scripts_editor_1wqjt4n8",hCt="scripts_editor_1wqjt4n9",pCt="scripts_editor_1wqjt4na",gCt="scripts_editor_1wqjt4nb",mCt="scripts_editor_1wqjt4nc";const o$={ADD:"Khách hàng mới thêm vào chiến dịch",UPDATE:"Khách hàng được cập nhật thông tin"},vCt={ADD:"Khi có khách mới được thêm vào chiến dịch ZNS",UPDATE:"Khi có khách được cập nhật thông tin trong chiến dịch ZNS"},yCt=nt.keys(o$),bCt=()=>{const e=R.useFormInstance(),t=R.useWatch("type",e);return f.jsx(R.Item,{name:"type",label:null,children:f.jsx(ln.Group,{className:uCt,children:f.jsx(Cn,{direction:"vertical",className:dCt,size:12,children:yCt.map(n=>f.jsxs(ln,{value:n,className:fCt,children:[f.jsxs("div",{className:hCt,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:o$[n]}),f.jsx(ge.Text,{type:"secondary",children:vCt[n]})]}),t===n?f.jsxs("div",{className:pCt,children:[f.jsx("div",{className:gCt}),f.jsx(Wr,{className:mCt})]}):null]},n))})})})},CCt=({id:e,outputs:t})=>{const n=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t??[]).map(r=>({...r,icon:()=>{var i;const o=so[((i=r.meta)==null?void 0:i.iconType)??""]??null;return o?f.jsx(o,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:n})},ACt=()=>f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Chiến dịch ZNS"}),name:"id",children:f.jsx(gv,{placeholder:"Chọn chiến dịch ZNS"})}),ECt=({id:e})=>{var p;const{getNode:t}=bn(),n=Cr(),{data:r}=t(e),o=r,[i]=R.useForm(),[a,s]=A.useState("1"),l=R.useWatch("type",i);vo({form:i,type:l});const{data:c}=Zo({type:be.ZNS_CUSTOMER,action:l??""});A.useEffect(()=>{var g,y;n(e,{output:((y=(g=c==null?void 0:c.data)==null?void 0:g.outputs)==null?void 0:y.map(v=>{var b;return{...v,object:e,node_type:be.ZNS_CUSTOMER,order:o==null?void 0:o.order,output_mode:((b=c==null?void 0:c.data)==null?void 0:b.output_mode)??[]}}))||[]})},[c==null?void 0:c.data,o==null?void 0:o.order,e,n]),A.useEffect(()=>{l&&s("2")},[l]);const u=g=>{n(e,g)},d=A.useMemo(()=>nt.debounce(()=>{i.submit()},500),[i]);A.useEffect(()=>()=>{d.cancel()},[d]);const h=[{key:"1",label:"Hành động",children:f.jsx(bCt,{})},{key:"2",label:"Cài đặt",children:f.jsx(ACt,{}),disabled:!l},{key:"3",label:"Đầu ra",children:f.jsx(CCt,{id:e,outputs:(p=c==null?void 0:c.data)==null?void 0:p.outputs}),disabled:!l}];return f.jsx("div",{className:cCt,children:f.jsxs(R,{form:i,layout:"vertical",initialValues:o,onFinish:u,onValuesChange:d,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(Ir,{activeKey:a,onChange:s,items:h})]})})},SCt=({id:e,data:t,mini:n})=>{const{mode:r}=Xt(),{displayComponent:o}=Rn(),i=t.title||"Khách hàng ZNS",a=s=>{const l=s.target;l!=null&&l.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(s.stopPropagation(),s.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(ECt,{id:e}),i,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx("div",{className:oCt,onClick:a,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&a(s)},children:f.jsxs("div",{className:iCt,children:[f.jsxs(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",justify:"flex-start",style:{width:"100%"},gap:12,children:[f.jsxs("div",{className:aCt,children:[f.jsx(gc,{color:"#096DD9",variant:"Bold",size:24,className:sCt}),f.jsx(vs,{size:14,className:lCt,variant:"Bold",color:"#000"})]}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:i})]}),f.jsx(Po,{id:e,data:t})]}),f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:16,children:f.jsx(ge.Text,{children:o$[t.type]})})]})]})})},wCt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(SCt,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]}),Pue=[{id:"sent",name:"Đã gửi"},{id:"delivered",name:"Đã nhận"},{id:"read",name:"Đã đọc"},{id:"failed",name:"Gửi thất bại"}],xCt=e=>{var t;return(t=Pue.find(n=>n.id===e))==null?void 0:t.name},ICt="filter-infinite-zns-status",NCt=e=>typeof e=="string"?e.trim().toLowerCase():"",OCt=({currentFilters:e,pageSize:t=10,enabled:n=!0})=>ba({queryKey:[ICt,e,t],queryFn:async({pageParam:r=1})=>{const o=Number(r)||1,i=NCt(e==null?void 0:e.search),a=Pue.filter(c=>i?c.id.toLowerCase().includes(i)||c.name.toLowerCase().includes(i):!0),s=(o-1)*t,l=s+t;return{count:a.length,page_count:Math.ceil(a.length/t),results:a.slice(s,l)}},enabled:n,initialPageParam:1,getNextPageParam:(r,o)=>{if(o.reduce((a,s)=>a+s.results.length,0)<r.count)return o.length+1},staleTime:1e3*60*10,refetchOnMount:!1,retry:1});var TCt="scripts_editor_zsm0z70",kCt="scripts_editor_zsm0z71",MCt="scripts_editor_zsm0z72",_Ct="scripts_editor_zsm0z73",$Ct="scripts_editor_zsm0z74",PCt="scripts_editor_zsm0z75",DCt="scripts_editor_zsm0z76",LCt="scripts_editor_zsm0z77",BCt="scripts_editor_zsm0z78",FCt="scripts_editor_zsm0z79",jCt="scripts_editor_zsm0z7a",zCt="scripts_editor_zsm0z7b",VCt="scripts_editor_zsm0z7c";const i$={STATUS_CHANGE:"Chiến dịch thay đổi trạng thái"},HCt={STATUS_CHANGE:"Khi chiến dịch ZNS thay đổi trạng thái đã chọn"},WCt=nt.keys(i$),KCt=()=>{const e=R.useFormInstance(),t=R.useWatch("type",e);return f.jsx(R.Item,{name:"type",label:null,children:f.jsx(ln.Group,{className:DCt,children:f.jsx(Cn,{direction:"vertical",className:LCt,size:12,children:WCt.map(n=>f.jsxs(ln,{value:n,className:BCt,children:[f.jsxs("div",{className:FCt,children:[f.jsx(ge.Title,{level:5,style:{margin:0},children:i$[n]}),f.jsx(ge.Text,{type:"secondary",children:HCt[n]})]}),t===n&&f.jsxs("div",{className:jCt,children:[f.jsx("div",{className:zCt}),f.jsx(Wr,{className:VCt})]})]},n))})})})},qCt=({id:e,outputs:t})=>{const n=[{title:e,key:e,icon:f.jsx(io,{}),children:No(t??[]).map(r=>({...r,icon:()=>{var i;const o=so[((i=r.meta)==null?void 0:i.iconType)??""]??null;return o?f.jsx(o,{}):void 0}}))}];return f.jsx(ao,{showLine:!0,showIcon:!0,switcherIcon:f.jsx(eo,{}),defaultExpandedKeys:[e],treeData:n})},UCt=({placeholder:e="Chọn trạng thái ZNS",...t})=>{const{search:n,onSearch:r}=wi(),{data:o,fetchNextPage:i,hasNextPage:a,isLoading:s}=OCt({currentFilters:{search:n},pageSize:10}),l=A.useMemo(()=>(o==null?void 0:o.pages.flatMap(u=>u.results))??[],[o==null?void 0:o.pages]),c=A.useCallback(u=>({value:u.id,label:u.name,rawLabel:u.name,title:u.name}),[]);return f.jsx(Tc,{placeholder:e,records:l,isLoading:s,hasNextPage:a,fetchNextPage:i,onSearch:r,buildOption:c,...t})},GCt=()=>f.jsx(R.Item,{label:f.jsx(ge.Text,{strong:!0,children:"Trạng thái chiến dịch ZNS"}),name:"id",children:f.jsx(UCt,{placeholder:"Chọn trạng thái ZNS"})}),QCt=({id:e})=>{var p;const{getNode:t}=bn(),n=Cr(),{data:r}=t(e),o=r,[i]=R.useForm(),[a,s]=A.useState("1"),l=R.useWatch("type",i);vo({form:i,type:l});const{data:c}=Zo({type:be.TRIGGER_ZNS,action:l??""});A.useEffect(()=>{var g,y;n(e,{output:((y=(g=c==null?void 0:c.data)==null?void 0:g.outputs)==null?void 0:y.map(v=>{var b;return{...v,object:e,node_type:be.TRIGGER_ZNS,order:o==null?void 0:o.order,output_mode:((b=c==null?void 0:c.data)==null?void 0:b.output_mode)??[]}}))||[]})},[c==null?void 0:c.data,o==null?void 0:o.order,e,n]),A.useEffect(()=>{l&&s("2")},[l]);const u=g=>{n(e,g)},d=A.useMemo(()=>nt.debounce(()=>{i.submit()},500),[i]);A.useEffect(()=>()=>{d.cancel()},[d]);const h=[{key:"1",label:"Hành động",children:f.jsx(KCt,{})},{key:"2",label:"Cài đặt",children:f.jsx(GCt,{}),disabled:!l},{key:"3",label:"Đầu ra",children:f.jsx(qCt,{id:e,outputs:(p=c==null?void 0:c.data)==null?void 0:p.outputs}),disabled:!l}];return f.jsx("div",{className:PCt,children:f.jsxs(R,{form:i,layout:"vertical",initialValues:o,onFinish:u,onValuesChange:d,children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsx(Ir,{activeKey:a,onChange:s,items:h})]})})},RCt=({id:e,data:t,mini:n})=>{const{mode:r}=Xt(),{displayComponent:o}=Rn(),i=t.title||"Chiến dịch ZNS",a=xCt(t.id),s=l=>{const c=l.target;c!=null&&c.closest(`button, [role="button"], .${_r}-modal-wrap, input, textarea`)||(l.stopPropagation(),l.preventDefault(),o(r==="history"?f.jsx(mo,{id:e}):f.jsx(QCt,{id:e}),i,()=>{},e))};return n?f.jsx(f.Fragment,{}):f.jsx("div",{className:TCt,onClick:s,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&s(l)},children:f.jsxs("div",{className:kCt,children:[f.jsxs(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",justify:"flex-start",style:{width:"100%"},gap:12,children:[f.jsxs("div",{className:MCt,children:[f.jsx(gc,{color:"#096DD9",variant:"Bold",size:24,className:_Ct}),f.jsx(vs,{size:14,className:$Ct,variant:"Bold",color:"#000"})]}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:i})]}),f.jsx(Po,{id:e,data:t})]}),f.jsxs(Nn,{gutter:[12,6],style:{width:"100%"},children:[f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Hành động"})}),f.jsx(at,{span:16,children:f.jsx(ge.Text,{children:i$[t.type]})}),f.jsx(at,{span:8,children:f.jsx(ge.Text,{type:"secondary",children:"Trạng thái"})}),f.jsx(at,{span:16,children:f.jsx(ge.Text,{children:a})})]})]})})},YCt=({data:e,id:t})=>f.jsxs(Tr,{nodeId:t,children:[f.jsx(mn,{type:"target",position:Mt.Left}),f.jsx(RCt,{id:t,data:e}),f.jsx(mn,{type:"source",position:Mt.Right})]}),Due={[be.AGENT]:Gat,[be.SPEAK]:Dyt,[be.START]:Hyt,[be.LISTEN]:Kmt,[be.TRANSFER]:m0t,[be.GROUP]:x0t,[be.CONDITION]:bht,[be.DATA_CRM]:igt,[be.HTTP_REQUEST]:X0t,[be.TRIGGER_CONTACT]:Lpt,[be.TRIGGER_CRMORDER]:z1t,[be.TRIGGER_TICKET]:Mbt,[be.TRIGGER_CALLBOT]:hft,[be.SCHEDULE_AT]:dyt,[be.TRIGGER_CATCH_HOOK]:mht,[be.TRIGGER_CALLBOT_CUSTOMER]:Dft,[be.ACTION_CONTACT]:rpt,[be.CONTACT_ASSIGN]:ppt,[be.ACTION_CRMORDER]:T1t,[be.ACTION_CALLBOT]:oft,[be.ACTION_ZNS]:rCt,[be.SMS_CAMPAIGN]:Pyt,[be.TRIGGER_ZNS]:YCt,[be.ZNS_CUSTOMER]:wCt,[be.TASK]:ubt,[be.ACTION_TICKET]:Abt,[be.EMAIL]:dmt,[be.DELAY]:Igt,[be.BRANCH]:Xut,[be.AI_AGENT]:llt,[be.NOTIFICATION]:y1t,[be.AUTO_FLOW_HTTP_REQUEST]:Dlt},Kx=e=>{switch(e.type){case be.AGENT:return Fn.agentBlock.background;case be.START:return Fn.startBlock.background;case be.SPEAK:return Fn.speakBlock.background;case be.LISTEN:return Fn.listenBlock.background;case be.TRANSFER:return Fn.icon.transferCall;case be.DATA_CRM:return Fn.icon.getData;case be.HTTP_REQUEST:return Fn.icon.httpRequest;case be.CONDITION:return Fn.icon.condition;case be.GROUP:return Fn.groupBlock.background;case be.DELAY:case be.BRANCH:case be.AI_AGENT:case be.AUTO_FLOW_HTTP_REQUEST:return Fn.delayBlock.backgroundNoGradient;case be.TRIGGER_CONTACT:case be.ACTION_CONTACT:case be.TRIGGER_CRMORDER:case be.TRIGGER_TICKET:case be.ACTION_CRMORDER:case be.ACTION_TICKET:case be.TRIGGER_CALLBOT:case be.ACTION_CALLBOT:case be.ACTION_ZNS:case be.SMS_CAMPAIGN:case be.TRIGGER_ZNS:case be.ZNS_CUSTOMER:case be.TASK:case be.EMAIL:case be.NOTIFICATION:case be.SCHEDULE_AT:case be.TRIGGER_CATCH_HOOK:case be.CONTACT_ASSIGN:case be.TRIGGER_CALLBOT_CUSTOMER:return Fn.contactBlock.backgroundNoGradient;default:return Fn.common.gray}},sb="data-menu-select-action";function qx(e,t){var n;if(!(t!=null&&t.length))return e;if("options"in e){if(e.type&&t.includes(e.type))return e;const r=e.options.map(o=>qx(o,t)).filter(o=>o!==null);return r.length?{...e,options:r}:null}return t.includes((n=e.data)==null?void 0:n.type)?e:null}function mv(e,t){if(!t)return e;if("value"in e&&!("options"in e))return Dst(e.data).includes(t)?e:null;const n=e.options.map(r=>mv(r,t)).filter(r=>r!==null);return n.length?{...e,options:n}:null}const Lue=(e,t)=>{if(t)return{key:`${e}::search`,className:emt,label:f.jsx("div",{[sb]:"true",className:Zgt,role:"presentation",onMouseDown:n=>{var r;(r=t.onInteract)==null||r.call(t,n),n.stopPropagation()},onClick:n=>{n.preventDefault(),n.stopPropagation()},onKeyDown:n=>{var r;(r=t.onInteract)==null||r.call(t,n),n.stopPropagation()},onFocus:n=>{var r;(r=t.onInteract)==null||r.call(t,n),n.stopPropagation()},children:f.jsx(Nt,{className:Jgt,allowClear:!0,size:"small",placeholder:t.placeholder??"Tìm kiếm giá trị",value:t.value,onChange:n=>t.onChange(n.target.value)})})}},Bue=e=>({type:"divider",key:`${e}::search-divider`,className:tmt}),Ux=(e,t,n=!1)=>{const r=e.node_type?XT[e.node_type]:so[e.type],o=e.node_type?mc[e.node_type]:void 0,i=n&&e.node_type?Zg[e.node_type]:e.label;return f.jsxs(Ke,{align:"center",justify:"space-between",gap:12,style:{width:"100%"},children:[f.jsxs(Ke,{gap:4,align:"center",style:{flex:1,minWidth:0},children:[r&&n&&f.jsx(r,{width:16,height:16,size:16,variant:"Bold",color:o,style:{fontSize:16,color:o}}),f.jsx(ge.Paragraph,{ellipsis:{rows:1,tooltip:i},strong:!0,style:{flex:1,minWidth:0,marginBottom:0},children:i})]}),f.jsxs(Ke,{gap:8,align:"center",style:{flex:"none"},children:[n&&(e!=null&&e.order)?f.jsx(l_,{order:e.order}):null,t]})]})},vv=(e,t,n,r,o)=>{const i=t?`${t}::`:"";if("options"in e){const l=`${i}${e.label}`,c=e.value?`${l}::${e.value}`:void 0,u=t&&c&&n?f.jsx(yt,{[sb]:"true",size:"small",type:"text",onMouseDown:y=>{r==null||r(c),y.preventDefault(),y.stopPropagation()},onClick:y=>{y.preventDefault(),y.stopPropagation(),n(c)},children:f.jsx(ge.Link,{children:"Chọn"})}):void 0,d=e.options.map(y=>vv(y,l,n,r)).filter(Boolean),h=t?void 0:Lue(l,o),p=h?Bue(l):void 0,g=h&&!d.length?{key:`${l}::empty`,disabled:!0,label:"Không có giá trị phù hợp"}:void 0;return{key:l,label:Ux(e,u,!t),popupClassName:"scripts-editor-dropdown-menu-submenu-popup",children:h?[h,p,...g?[g]:d]:d}}const a=e.data,s=so[a.type];return{key:`${i}${e.value}`,label:f.jsxs(Ke,{gap:4,align:"center",className:nmt,children:[s&&f.jsx(s,{style:{fontSize:16}}),f.jsx(ge.Text,{children:g_(a)}),a.slug?f.jsxs(ge.Text,{className:rmt,type:"secondary",style:{fontSize:12},children:["(",a.slug,")"]}):null]}),popupClassName:"scripts-editor-dropdown-menu-submenu-popup"}};function a$(e,t){"value"in e&&(e.value&&t.set(e.value,e),!("options"in e))||e.options.forEach(n=>a$(n,t))}const af=e=>{const t=Zn(a=>a.nodes),n=Zn(a=>a.edges),r=A.useMemo(()=>{if(!e)return[];const a=new Map(t.map(d=>[d.id,d])),s=new Map;for(const d of n)s.has(d.target)||s.set(d.target,[]),s.get(d.target).push(d.source);const l=new Set,c=[e],u=[];for(;c.length>0;){const d=c.pop(),h=s.get(d)||[];for(const p of h)if(!l.has(p)){l.add(p);const g=a.get(p);g&&u.push(g),c.push(p)}}return u},[e,t,n]),o=A.useMemo(()=>{const a=r.flatMap(s=>{var l;return((l=s.data)==null?void 0:l.output)??[]});return Vie(a)},[r]),i=A.useMemo(()=>{const a=new Map;return o.forEach(s=>{a$(s,a)}),a},[o]);return{optionsData:o,optionMap:i}};var XCt="scripts_editor_5lqjsi1",ZCt="scripts_editor_5lqjsi2",JCt="scripts_editor_5lqjsi3",eAt="scripts_editor_5lqjsi4",tAt="scripts_editor_5lqjsi5",nAt="scripts_editor_5lqjsi6";const s$=new Map,l$=new Map,sf={notify:(e,t)=>{var n;(n=s$.get(t))==null||n(e)},setKeyDownHandler:(e,t)=>{l$.set(e,t)},handleKeyDown:(e,t)=>{var n;return((n=l$.get(t))==null?void 0:n(e))??!1},remove:e=>{s$.delete(e),l$.delete(e)}};function rAt(e){const[t,n]=A.useState(null);return A.useEffect(()=>(s$.set(e,n),()=>{sf.remove(e)}),[e]),t}function oAt(e){var t;const{char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:a,$position:s}=e,l=r&&!o,c=UYe(n),u=new RegExp(`\\s${c}$`),d=a?"^":"",h=o?"":c,p=l?new RegExp(`${d}${c}.*?(?=\\s${h}|$)`,"gm"):new RegExp(`${d}(?:^)?${c}[^\\s${h}]*`,"gm"),g=((t=s.nodeBefore)==null?void 0:t.isText)&&s.nodeBefore.text;if(!g)return null;const y=s.pos-g.length,v=Array.from(g.matchAll(p)).pop();if(!v||v.input===void 0||v.index===void 0)return null;const b=v.input.slice(Math.max(0,v.index-1),v.index),C=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(b);if(i!==null&&!C)return null;const S=y+v.index;let E=S+v[0].length;return l&&u.test(g.slice(E-1,E+1))&&(v[0]+=" ",E+=1),S<s.pos&&E>=s.pos?{range:{from:S,to:E},query:v[0].slice(n.length),text:v[0]}:null}var iAt=new fi("suggestion");function aAt({pluginKey:e=iAt,editor:t,char:n="@",allowSpaces:r=!1,allowToIncludeChar:o=!1,allowedPrefixes:i=[" "],startOfLine:a=!1,decorationTag:s="span",decorationClass:l="suggestion",decorationContent:c="",decorationEmptyClass:u="is-empty",command:d=()=>null,items:h=()=>[],render:p=()=>({}),allow:g=()=>!0,findSuggestionMatch:y=oAt,shouldShow:v}){let b;const C=p==null?void 0:p(),S=()=>{const N=t.state.selection.$anchor.pos,O=t.view.coordsAtPos(N),{top:T,right:M,bottom:_,left:L}=O;try{return new DOMRect(L,T,M-L,_-T)}catch{return null}},E=(N,O)=>O?()=>{const T=e.getState(t.state),M=T==null?void 0:T.decorationId,_=N.dom.querySelector(`[data-decoration-id="${M}"]`);return(_==null?void 0:_.getBoundingClientRect())||null}:S;function x(N,O){var T;try{const _=e.getState(N.state),L=_!=null&&_.decorationId?N.dom.querySelector(`[data-decoration-id="${_.decorationId}"]`):null,P={editor:t,range:(_==null?void 0:_.range)||{from:0,to:0},query:(_==null?void 0:_.query)||null,text:(_==null?void 0:_.text)||null,items:[],command:$=>d({editor:t,range:(_==null?void 0:_.range)||{from:0,to:0},props:$}),decorationNode:L,clientRect:E(N,L)};(T=C==null?void 0:C.onExit)==null||T.call(C,P)}catch{}const M=N.state.tr.setMeta(O,{exit:!0});N.dispatch(M)}const I=new So({key:e,view(){return{update:async(N,O)=>{var T,M,_,L,P,$,B;const D=(T=this.key)==null?void 0:T.getState(O),F=(M=this.key)==null?void 0:M.getState(N.state),z=D.active&&F.active&&D.range.from!==F.range.from,V=!D.active&&F.active,U=D.active&&!F.active,q=!V&&!U&&D.query!==F.query,W=V||z&&q,H=q||z,K=U||z&&q;if(!W&&!H&&!K)return;const G=K&&!W?D:F,Y=N.dom.querySelector(`[data-decoration-id="${G.decorationId}"]`);b={editor:t,range:G.range,query:G.query,text:G.text,items:[],command:ne=>d({editor:t,range:G.range,props:ne}),decorationNode:Y,clientRect:E(N,Y)},W&&((_=C==null?void 0:C.onBeforeStart)==null||_.call(C,b)),H&&((L=C==null?void 0:C.onBeforeUpdate)==null||L.call(C,b)),(H||W)&&(b.items=await h({editor:t,query:G.query})),K&&((P=C==null?void 0:C.onExit)==null||P.call(C,b)),H&&(($=C==null?void 0:C.onUpdate)==null||$.call(C,b)),W&&((B=C==null?void 0:C.onStart)==null||B.call(C,b))},destroy:()=>{var N;b&&((N=C==null?void 0:C.onExit)==null||N.call(C,b))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(N,O,T,M){const{isEditable:_}=t,{composing:L}=t.view,{selection:P}=N,{empty:$,from:B}=P,D={...O},F=N.getMeta(e);if(F&&F.exit)return D.active=!1,D.decorationId=null,D.range={from:0,to:0},D.query=null,D.text=null,D;if(D.composing=L,_&&($||t.view.composing)){(B<O.range.from||B>O.range.to)&&!L&&!O.composing&&(D.active=!1);const z=y({char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:a,$position:P.$from}),V=`id_${Math.floor(Math.random()*4294967295)}`;z&&g({editor:t,state:M,range:z.range,isActive:O.active})&&(!v||v({editor:t,range:z.range,query:z.query,text:z.text,transaction:N}))?(D.active=!0,D.decorationId=O.decorationId?O.decorationId:V,D.range=z.range,D.query=z.query,D.text=z.text):D.active=!1}else D.active=!1;return D.active||(D.decorationId=null,D.range={from:0,to:0},D.query=null,D.text=null),D}},props:{handleKeyDown(N,O){var T,M,_,L;const{active:P,range:$}=I.getState(N.state);if(!P)return!1;if(O.key==="Escape"||O.key==="Esc"){const D=I.getState(N.state),F=(T=b==null?void 0:b.decorationNode)!=null?T:null,z=F??(D!=null&&D.decorationId?N.dom.querySelector(`[data-decoration-id="${D.decorationId}"]`):null);if(((M=C==null?void 0:C.onKeyDown)==null?void 0:M.call(C,{view:N,event:O,range:D.range}))||!1)return!0;const U={editor:t,range:D.range,query:D.query,text:D.text,items:[],command:q=>d({editor:t,range:D.range,props:q}),decorationNode:z,clientRect:z?()=>z.getBoundingClientRect()||null:null};return(_=C==null?void 0:C.onExit)==null||_.call(C,U),x(N,e),!0}return((L=C==null?void 0:C.onKeyDown)==null?void 0:L.call(C,{view:N,event:O,range:$}))||!1},decorations(N){const{active:O,range:T,decorationId:M,query:_}=I.getState(N);if(!O)return null;const L=!(_!=null&&_.length),P=[l];return L&&P.push(u),wo.create(N.doc,[ua.inline(T.from,T.to,{nodeName:s,class:P.join(" "),"data-decoration-id":M,"data-decoration-content":c})])}}});return I}var sAt=aAt;function lAt({node:e,deleteNode:t}){const n=e.attrs.data;return f.jsx(SZe,{as:"span",style:{display:"inline"},children:f.jsx(Tu,{data:n,onClose:t})})}const cAt=Ua.create({name:"variable",group:"inline",inline:!0,atom:!0,addOptions(){return{getItems:()=>[],editorId:"",allowTypingTrigger:()=>!0}},addAttributes(){return{value:{default:null},data:{default:null}}},parseHTML(){return[{tag:"span[data-variable]"}]},renderHTML({HTMLAttributes:e}){return["span",Ro(e,{"data-variable":"",class:"variable-chip"}),e.value]},renderText({node:e}){return e.attrs.value},addNodeView(){return TZe(lAt)},addProseMirrorPlugins(){return[sAt({editor:this.editor,char:"{{",allow:()=>this.options.allowTypingTrigger(),items:({query:e})=>this.options.getItems(e),command:({editor:e,range:t,props:n})=>{e.chain().focus().deleteRange(t).insertContent([{type:"variable",attrs:n},{type:"text",text:" "}]).run()},render:()=>{const e=this.options.editorId;return{onStart:t=>{sf.notify({items:t.items,clientRect:t.clientRect,command:t.command,query:t.query},e),sf.setKeyDownHandler(e,t.decorationNode?()=>!1:()=>!1)},onUpdate:t=>{sf.notify({items:t.items,clientRect:t.clientRect,command:t.command,query:t.query},e)},onKeyDown:t=>sf.handleKeyDown(t,e),onExit:()=>{sf.notify(null,e),sf.setKeyDownHandler(null,e)}}}})]}});Un.extend(PK);const Fue={date:Bie,datetime:jie},uAt=200,dAt=".scripts-editor-dropdown-menu-submenu-popup";function Gx(e){return rf(e)}function fAt(e){if(!(e instanceof Node))return!1;const t=e instanceof Element?e:e.parentElement;return!!(t!=null&&t.closest(dAt))}function jue(e,t,n){if(typeof e=="string"){if(!t||!n||e.match(Ra))return e;const r=e.trim();if(!r)return"";const o=Array.from(new Set([t,Fue[n],Bie,jie,"YYYY-MM-DDTHH:mm:ssZ","YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss","YYYY-MM-DDTHH:mm"])).filter(s=>!!s),i=Un(r,o,!0);if(i.isValid())return i.format(t);const a=Un(r);return a.isValid()?a.format(t):e}return t&&Un.isDayjs(e)&&e.isValid()?e.format(t):""}function hAt(e,t){return e.split(/({{[^}]+}})/g).map(r=>{if(r.match(Ra)){const o=Nu(r),i=ev(t,r),a=i?el(i,r,o==null?void 0:o.mode):tv(r);if(a)return{type:"variable",attrs:{value:r,data:a}}}return r?{type:"text",text:r}:null}).filter(r=>r!==null)}function zue(e){if(!e)return[];const t=[],n=r=>{r==null||r.forEach(o=>{if(o.type==="text"&&typeof o.text=="string"){t.push({type:"text",text:o.text});return}if(o.type==="variable"){t.push({type:"variable",attrs:o.attrs??{}});return}Array.isArray(o.content)&&n(o.content)})};return n(e.getJSON().content),t}function Vue(e){return e.reduce((t,n)=>{if(n.type==="text"&&n.text.length===0)return t;const r=t.at(-1);return n.type==="text"&&(r==null?void 0:r.type)==="text"?(r.text+=n.text,t):(t.push(n),t)},[])}function c$(e,t){return e.length!==t.length?!1:e.every((n,r)=>{const o=t[r];return n.type!==(o==null?void 0:o.type)?!1:n.type==="text"&&o.type==="text"?n.text===o.text:n.type==="variable"&&o.type==="variable"?JSON.stringify(n.attrs)===JSON.stringify(o.attrs):!1})}function pAt(e){return{type:"doc",content:[{type:"paragraph",...e.length?{content:e}:{}}]}}function lf(e,t){e.commands.setContent(pAt(Vue(t)))}function gAt(e){let t="",n=!1;for(const r of e){if(/\d/.test(r)){t+=r;continue}if(r==="-"&&t.length===0){t+=r;continue}r==="."&&!n&&(t+=r,n=!0)}return t}function Hue(e){if(!e)return;const t=zue(e),n=Vue(t.flatMap(r=>{if(r.type==="variable")return[r];const o=gAt(r.text);return o?[{type:"text",text:o}]:[]}));c$(t,n)||lf(e,n)}function Wue(e){const{state:t}=e,{from:n}=t.selection,o=t.selection.$from.start(),a=t.doc.textBetween(o,n,void 0,"").match(/\{\{[^{]*$/);if(!a)return e.chain().focus();const s=n-a[0].length;return e.chain().focus().deleteRange({from:s,to:n})}function Kue(e,t){const n=Un(e,t,!0);return n.isValid()?n:null}function que(e,t){if(!e)return;const n=zue(e),r=n.filter(l=>l.type==="variable");if(r.length>0){if(c$(n,r))return;lf(e,r);return}const o=n.filter(l=>l.type==="text").map(l=>l.text).join("").trim();if(!o){if(!n.length)return;lf(e,[]);return}const i=Kue(o,t);if(!i){lf(e,[]);return}const s=[{type:"text",text:i.format(t)}];c$(n,s)||lf(e,s)}const mAt=({onChange:e,value:t,filterTypes:n,placeholder:r,rows:o=1,inputMode:i="string",inputFormat:a})=>{const s=A.useRef(null),l=A.useRef(x1().slice(0,4)).current,c=rAt(l),{nodeId:u}=Rn(),{optionMap:d,optionsData:h}=af(u),{checkedMap:p}=Xy(),[g,y]=A.useState([]),[v,b]=A.useState({}),C=A.useDeferredValue(v),[S,E]=A.useState(""),[x,I]=A.useState(!1),[N,O]=A.useState(!1),T=A.useRef(!1),M=A.useRef(!1),_=A.useRef(h),L=A.useRef(i==="string"),P=i==="date"||i==="datetime",$=i==="string",B=P?a??Fue[i]:void 0,D=A.useMemo(()=>g.some(Q=>Q.includes(qr[0])),[g]),F=A.useMemo(()=>JSON.stringify(p),[p]);A.useEffect(()=>{F&&D&&(T.current=!0)},[F,D]),A.useEffect(()=>{_.current=h},[h]),A.useEffect(()=>{L.current=$},[$]);const z=AZe({extensions:[WJe,cAt.configure({editorId:l,allowTypingTrigger:()=>L.current,getItems:Q=>{const ee=Q.trim().toLowerCase();return _.current.map(te=>mv(te,ee)).filter(te=>te!==null)}}),xXe.configure({placeholder:r??"Vui lòng nhập dữ liệu"})],content:"",onUpdate:({editor:Q})=>{const ee=Q.getText();E(ee),e==null||e(ee)},immediatelyRender:!1});A.useEffect(()=>{E(jue(t,B,i))},[B,i,t]),A.useEffect(()=>{const Q=jue(t,B,i);z&&z.getText()!==Q&&lf(z,hAt(Q,d))},[B,z,i,d,t]),A.useEffect(()=>{if(!z||i!=="number"||c)return;const Q=window.setTimeout(()=>{z.getText()===S&&Hue(z)},uAt);return()=>{window.clearTimeout(Q)}},[z,S,i,c]),A.useEffect(()=>{if(!N)return;const Q=ee=>{var Z;const te=ee.target;te instanceof Node&&((Z=s.current)!=null&&Z.contains(te)||fAt(te)||(O(!1),b({})))};return document.addEventListener("mousedown",Q),()=>{document.removeEventListener("mousedown",Q)}},[N]),A.useEffect(()=>{c||N||(y([]),b({}))},[N,c]);const V=A.useMemo(()=>!B||!S||Ra.test(S)?void 0:Kue(S.trim(),B)??void 0,[B,S]),U=A.useCallback((Q,ee)=>{if(!z)return;const te=d.get(Q);if(!te)return;const Z=lp(te,ee);if(!Z)return;const J=el(te,Z,ee);if(J){if(M.current=!0,i!=="string"){lf(z,[{type:"variable",attrs:{...te,value:Z,data:J}}]),z.commands.focus();return}Wue(z).insertContent([{type:"variable",attrs:{...te,value:Z,data:J}},{type:"text",text:" "}]).run()}},[z,i,d]),q=A.useCallback((Q,ee)=>{var ae;if(N||!(c!=null&&c.command)){U(Q,ee),O(!1),b({});return}const te=d.get(Q);if(!te)return;const Z=lp(te,ee);if(!Z)return;const J=el(te,Z,ee);J&&((ae=c.command)==null||ae.call(c,{...te,value:Z,data:J}),sf.notify(null,l))},[l,U,N,d,c]),W=()=>{if(!z)return;const Q=Aot(z),ee=Wue(z),te=Object.values(p).flat().flatMap(Z=>{const J=Gx(Z);if(!J)return[];const ae=d.get(J);if(!ae||Q.includes(J))return[];const re=lp(ae,qr[0]),pe=re?el(ae,re,qr[0]):void 0;return!re||!pe?[]:[{type:"variable",attrs:{...ae,value:re,data:pe}},{type:"text",text:" "}]});ee.insertContent(te).run()},H=A.useMemo(()=>N?h:c==null?void 0:c.items,[N,h,c]),K=A.useMemo(()=>H==null?void 0:H.map(Q=>qx(Q,n)).filter(Q=>Q!==null),[n,H]),G=A.useMemo(()=>K==null?void 0:K.map(Q=>{var pe,fe;const ee="options"in Q?v[Q.label]??"":"",te="options"in Q?(C[Q.label]??"").trim().toLowerCase():"",Z="options"in Q&&te?mv(Q,te):Q,J="options"in Q&&(!Z||!("options"in Z))?{...Q,options:[]}:Z,ae="options"in Q?{value:ee,onChange:Oe=>{b(Te=>({...Te,[Q.label]:Oe}))},placeholder:"Tìm kiếm giá trị"}:void 0,re=!!((pe=J==null?void 0:J.output_mode)!=null&&pe.length)&&((fe=J.output_mode)==null?void 0:fe.every(Oe=>jl(Oe)));return J&&"options"in J&&re?W_(J,{search:ae},Oe=>{const Te=Gx(Oe),je=nf(Oe);Te&&q(Te,je)}):vv(J,void 0,Oe=>{const Te=Gx(Oe),je=nf(Oe);Te&&q(Te,je)},void 0,ae)}),[C,q,K,v]),Y=Q=>{if(!z||!B)return;const ee=Q?[{type:"text",text:Q.format(B)}]:[];lf(z,ee)},ne=()=>{if(i==="number"){Hue(z);return}P&&!x&&B&&que(z,B)};return f.jsxs("div",{className:XCt,ref:s,children:[f.jsxs("div",{className:nAt,onFocusCapture:()=>{if(M.current){M.current=!1;return}P&&I(!0)},onBlurCapture:ne,style:{"--editor-rows":o},children:[f.jsx(yt,{type:"text",icon:f.jsx(IQ,{}),className:ZCt,tabIndex:-1,"aria-label":"Thêm biến",onMouseDown:Q=>{Q.preventDefault(),Q.stopPropagation()},onClick:()=>{I(!1),O(Q=>{const ee=!Q;return ee||(b({}),y([])),ee})}}),f.jsx(ine,{editor:z})]}),P&&B?f.jsx("div",{className:JCt,children:f.jsx(fd,{open:x,value:V,format:B,showTime:i==="datetime",allowClear:!0,tabIndex:-1,className:eAt,getPopupContainer:()=>document.body,onChange:Y,onOpenChange:Q=>{I(Q),Q||que(z,B)}})}):null,f.jsx(h8,{children:c||N?f.jsx(Py.div,{initial:{opacity:0,y:-4},animate:{opacity:1,scaleY:1,y:0},exit:{opacity:0,scaleY:.9,y:-4},transition:{duration:.15,ease:"easeOut"},style:{position:"absolute",left:0,right:0,zIndex:1050,transformOrigin:"top"},children:f.jsx(lc,{items:G,className:tAt,mode:"vertical",triggerSubMenuAction:"click",selectable:!1,onOpenChange:Q=>{const ee=g.some(Z=>Z.split("::").includes(qr[0])),te=Q.some(Z=>Z.split("::").includes(qr[0]));ee&&!te&&T.current&&g.find(J=>J.split("::").includes(qr[0]))&&(W(),T.current=!1),y(Q)},onClick:({key:Q,domEvent:ee,keyPath:te})=>{if(ee.target instanceof Element&&ee.target.closest(`[${sb}="true"]`))return;const Z=nf(String(Q),te),J=Gx(Q);J&&(ee.stopPropagation(),ee.preventDefault(),q(J,Z))}})}):null})]})};function yo(e){return f.jsx(V_,{children:f.jsx(mAt,{...e})})}const vAt=[$n.dateproperty],Uue=[$n.integerproperty,$n.floatproperty],yAt=[$n.fileproperty],bAt=e=>e?vAt.includes(e)?xd:Uue.includes(e)?wd:yAt.includes(e)?Id:Cc:[],CAt=({name:e,remove:t})=>{const n=R.useFormInstance(),r=R.useWatch(["conditions",e,"property"],n),o=R.useWatch(["conditions",e,"operator"],n),i=R.useWatch(["conditions",e,"type_date"],n),a=A.useMemo(()=>o==="VALUABLE"||o==="EMPTY",[o]),s=A.useMemo(()=>bAt(r==null?void 0:r.type),[r==null?void 0:r.type]),l=A.useCallback(d=>{d!=="EXACT_DATE"&&n.setFieldValue(["conditions",e,"value"],void 0)},[n,e]),c=()=>{if(a)return f.jsx(R.Item,{name:[e,"value"],children:f.jsx(Kr,{placeholder:"Chọn giá trị",options:[],disabled:!0})});const d=r==null?void 0:r.type,h=r==null?void 0:r.name;return d==="fileproperty"?f.jsx(R.Item,{name:[e,"value"],children:f.jsx(Kr,{placeholder:"Chọn giá trị",options:[],disabled:!0})}):d==="dateproperty"?f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{name:[e,"type_date"],style:{marginBottom:"unset"},children:f.jsx(Kr,{options:hu,value:i,onChange:l})}),i==="EXACT_DATE"&&f.jsx(R.Item,{name:[e,"value"],children:f.jsx(yo,{placeholder:h??"Nhập ngày",inputMode:"date",inputFormat:"DD-MM-YYYY"})})]}):Uue.includes(d)?f.jsx(R.Item,{name:[e,"value"],children:f.jsx(yo,{placeholder:h??"Nhập giá trị",inputMode:"number"})}):f.jsx(R.Item,{name:[e,"value"],children:f.jsx(Nt,{placeholder:h})})},u=A.useCallback(()=>{t(e)},[t,e]);return f.jsxs(f.Fragment,{children:[f.jsx(at,{xs:24,sm:10,md:10,children:f.jsx(R.Item,{name:[e,"property"],label:null,children:f.jsx(In,{placeholder:"Chọn biến"})})}),f.jsx(at,{xs:24,sm:7,md:6,children:f.jsx(R.Item,{name:[e,"operator"],label:null,children:f.jsx(In,{placeholder:"Chọn phép so sánh",options:s})})}),f.jsx(at,{xs:24,sm:7,md:6,children:c()}),f.jsx(R.Item,{name:[e,"type_date"],hidden:!0,children:f.jsx(Nt,{})}),f.jsx(at,{xs:24,sm:1,md:2,children:f.jsx(yt,{type:"text",icon:f.jsx(aa,{style:{color:"#00000073"}}),onClick:u})})]})};var AAt="scripts_editor_1l3pn170",EAt="scripts_editor_1l3pn171",SAt="scripts_editor_1l3pn172";const wAt=()=>f.jsxs(Cn,{direction:"vertical",size:12,style:{width:"100%"},children:[f.jsxs(Ke,{align:"center",gap:8,children:[f.jsx(ge.Text,{type:"secondary",children:"Thỏa mãn"}),f.jsx(R.Item,{name:["filter_type"],noStyle:!0,initialValue:"AND",children:f.jsx(Kr,{bordered:!1,options:[{value:"AND",label:"Tất cả"},{value:"OR",label:"Bất kỳ"}]})}),f.jsx(ge.Text,{type:"secondary",children:"điều kiện"})]}),f.jsx(R.List,{name:"conditions",initialValue:[{}],children:(e,{add:t,remove:n})=>f.jsxs(f.Fragment,{children:[e.map(({key:r,name:o,...i})=>f.jsx(Nn,{gutter:[8,4],children:f.jsx(CAt,{name:o,remove:n})},r)),f.jsx(R.Item,{className:SAt,children:f.jsx(yt,{onClick:()=>t(),icon:f.jsx(si,{style:{color:"#1E276D"}}),className:AAt,children:f.jsx("span",{className:EAt,children:"Thêm điều kiện lọc"})})})]})})]}),xAt=A.forwardRef(({dataSubmit:e,defaultValues:t,onFormSubmit:n},r)=>{const[o]=R.useForm();A.useEffect(()=>{t&&o.setFieldsValue({label:t.label,description:t.description,keywords:t.keywords,is_conversion:t.is_conversion})},[o,t]),A.useImperativeHandle(r,()=>({onSubmit:()=>{o.submit()}}));const i=a=>{e==null||e(a),n==null||n()};return f.jsx(R,{preserve:!1,form:o,layout:"vertical",onFinish:i,children:f.jsx(wAt,{})})}),IAt=A.forwardRef(({dataSubmit:e,defaultValues:t,onFormSubmit:n},r)=>{const[o]=R.useForm();A.useEffect(()=>{t&&o.setFieldsValue({label:t.label,description:t.description,keywords:t.keywords,is_conversion:t.is_conversion})},[o,t]),A.useImperativeHandle(r,()=>({onSubmit:()=>{o.submit()}}));const i=a=>{e==null||e(a),n==null||n()};return f.jsx(R,{preserve:!1,form:o,layout:"vertical",onFinish:i,children:f.jsx(R.Item,{layout:"vertical",label:"Mô tả điều kiện",name:"label",children:f.jsx(Nt.TextArea,{rows:4,placeholder:"Nhập mô tả điều kiện"})})})}),NAt=({children:e,isOuter:t,nodeId:n,containerRenderID:r,onToggleModal:o})=>{const{closeModal:i}=Rn(),a=ph(),s=A.useRef(null),l=A.useRef(null),{isOpen:c,onToggle:u,onClose:d}=Eo(),[h,p]=A.useState(),{updateNode:g}=bn(),y=E=>{const x={id:"condition-"+kl(),type:h,...E};if(n&&g(n,N=>({...N,data:{...N.data,conditions:[x,...N.data.conditions??[]]}})),t)return;const I=a.getFieldValue("conditions")||[];a.setFieldValue("conditions",[x,...I])},v=A.useCallback(E=>{u(),o==null||o(!c),E.modeType?p(E.modeType):p(void 0)},[u,o,c]),b=[{key:"compare",label:"Phép so sánh",icon:f.jsx(h6,{style:{fontSize:16,color:"#1890FF"}}),onClick:()=>{v({modeType:"compare"})}},{key:"prompt",label:"Prompt",icon:f.jsx(Eh,{style:{fontSize:16,color:"#FF7A45"}}),onClick:()=>{v({modeType:"prompt"})}}],C=E=>{E&&t&&i()},S=A.useCallback(()=>document.getElementById(r)||document.body,[r]);return f.jsxs(f.Fragment,{children:[f.jsx(Fs,{menu:{items:b},placement:"bottomRight",trigger:["click"],onOpenChange:C,children:e}),f.jsx(to,{open:c,onCancel:v,onOk:v,closeIcon:null,width:400,destroyOnHidden:!0,maskClosable:!1,mask:!1,getContainer:S,footer:[f.jsx(yt,{onClick:v,children:"Hủy"},"cancel"),f.jsx(yt,{type:"primary",onClick:()=>{var E,x;h==="prompt"&&((E=s.current)==null||E.onSubmit()),h==="compare"&&((x=l.current)==null||x.onSubmit())},children:"Lưu"},"submit")],children:h==="prompt"?f.jsx(IAt,{ref:s,dataSubmit:E=>{y(E),v()},onFormSubmit:()=>{d()}}):f.jsx(xAt,{ref:l,dataSubmit:E=>{y(E),v()},onFormSubmit:()=>{d()}})})]})},{Text:OAt}=ge,Gue=({id:e})=>{var d;const{setEdges:t}=bn(),n=Cr(),{data:r}=Nh(e);Eo();const{updateNode:o}=bn(),i=r,[a,s]=A.useState(!1),[l]=R.useForm(),c=h=>{n(e,h)},u=A.useMemo(()=>nt.debounce(()=>{l.submit()},500),[l]);return A.useEffect(()=>()=>{u.cancel()},[u]),lE(()=>{!l.isFieldsTouched()&&i.conditions&&l.setFieldsValue(i)},[i.conditions]),f.jsxs("div",{style:{height:"100%"},children:[f.jsx(R,{form:l,layout:"horizontal",initialValues:{...i},onFinish:c,onValuesChange:u,children:f.jsxs(Cn,{direction:"vertical",size:"small",style:{width:"100%"},children:[f.jsx(R.Item,{name:["title"],noStyle:!0,children:f.jsx(Nt,{type:"hidden"})}),f.jsxs(Ke,{justify:"space-between",align:"center",children:[f.jsx(ge.Title,{level:5,style:{marginTop:"unset"},children:"Điều kiện"}),f.jsx(NAt,{onToggleModal:h=>{s(h)},nodeId:e,containerRenderID:"condition-condition-form-container",children:f.jsx(yt,{size:"small",type:"primary",icon:f.jsx(si,{})})})]}),(d=i.conditions)==null?void 0:d.map(h=>f.jsxs(Ke,{align:"center",justify:"space-between",children:[f.jsxs(Ke,{align:"center",gap:12,children:[(h==null?void 0:h.type)==="compare"?f.jsx(h6,{style:{fontSize:16,color:"#1890FF"}}):f.jsx(Eh,{style:{fontSize:16,color:"#FF7A45"}}),(h==null?void 0:h.type)==="prompt"?h.label:null]}),f.jsx(yt,{onClick:()=>{o(e,p=>({...p,data:{...p.data,conditions:p.data.conditions.filter(g=>g.id!==h.id)}}))},type:"text",icon:f.jsx(uc,{})})]},h.id)),f.jsx(ia,{style:{margin:"12px 0"}}),f.jsx(R.Item,{name:"is_global_node",valuePropName:"checked",style:{marginBottom:0},labelCol:{span:21},labelAlign:"left",label:f.jsx(pr,{title:`Cho phép node này được kích hoạt tại bất cứ thời điểm nào
860
- trong cuộc gọi`,children:f.jsx(OAt,{children:"Node toàn cục"})}),children:f.jsx(zi,{})})]})}),a?f.jsx("div",{id:"condition-condition-form-container",className:kKe}):null]})};var Que="scripts_editor_223f7c0",Rue="scripts_editor_223f7c2";const TAt=(e,t,n)=>{switch(e){case be.SPEAK:return{component:f.jsx($ce,{id:t}),title:"Cài đặt node nói"};case be.LISTEN:return{component:f.jsx(uce,{id:t}),title:"Cài đặt node nghe"};case be.TRANSFER:return{component:f.jsx(zce,{id:t}),title:"Cài đặt chuyển máy"};case be.DATA_CRM:return{component:f.jsx(Qle,{id:t}),title:n};case be.HTTP_REQUEST:return{component:f.jsx(nue,{id:t}),title:n};case be.CONDITION:return{component:f.jsx(Gue,{id:t}),title:"Cài đặt node điều kiện"};default:return null}},kAt=({id:e,sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:i,targetPosition:a,style:s,markerEnd:l})=>{const{mode:c}=Xt(),{isOpen:u,onOpen:d,onClose:h}=Eo(),{displayComponent:p}=Rn(),{setEdges:g,setNodes:y}=bn(),[v,b,C]=_C({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:a}),S=[...vE.filter(I=>I.key!==be.AGENT).map(I=>({label:f.jsxs(Cn,{align:"center",size:8,children:[A.createElement(I.icon,{style:{color:mc[I.key]}}),I.label]}),key:I.key}))],E=I=>{I.preventDefault(),d()},x=({key:I})=>{const N=I,O={id:`${N.toLowerCase()}_${Sh()}`,type:N,position:{x:b,y:C},data:{title:Jg[N],...I1(N)},deletable:!0,...N1[N]},T=wKe({blockType:N,nodeData:O.data});Mr.flushSync(()=>{y(_=>_.concat(O)),g(_=>{const L=_.find(z=>z.id===e);if(!L)return _;const{source:P,sourceHandle:$,target:B,targetHandle:D}=L,F=_.filter(z=>z.id!==e);return F.push({id:`${P}_${O.id}_${Sh()}`,source:P,sourceHandle:$,target:O.id,type:"autoCallButton"}),T!==null&&F.push({id:`${O.id}_${B}_${Sh()}`,source:O.id,sourceHandle:T,target:B,targetHandle:D,type:"autoCallButton"}),F}),h()});const M=TAt(N,O.id,O.data.title);M&&p(M.component,M.title,()=>{},O.id)};return f.jsxs(f.Fragment,{children:[f.jsx(Yp,{path:v,markerEnd:l,style:s??{}}),f.jsx(nj,{children:c!=="edit"?null:f.jsx(pr,{title:"Thêm nút",children:f.jsx("div",{className:`${Que} nodrag nopan ${u?Rue:""}`,style:{transform:`translate(-50%, -50%) translate(${b}px,${C}px)`},children:f.jsx(Fs,{onOpenChange:I=>{I?d():h()},menu:{items:S,onClick:x},open:u,trigger:["click"],children:f.jsx(yt,{onClick:E,type:"text",size:"large",style:{padding:4},children:f.jsx(y1,{style:{fontSize:24}})})})})})})]})},MAt=new Set([be.ACTION_CONTACT,be.ACTION_CRMORDER,be.ACTION_TICKET,be.CONTACT_ASSIGN,be.TRIGGER_TICKET,be.ACTION_ZNS,be.CONTACT_ASSIGN,be.TRIGGER_ZNS,be.TASK,be.EMAIL,be.DELAY,be.BRANCH,be.AI_AGENT,be.NOTIFICATION]),_At=new Set([be.ACTION_CONTACT,be.ACTION_CRMORDER,be.ACTION_TICKET,be.TRIGGER_TICKET,be.ACTION_ZNS,be.TRIGGER_ZNS,be.TASK,be.EMAIL,be.DELAY,be.AI_AGENT,be.NOTIFICATION]),$At=e=>!!e&&typeof e=="object"&&"id"in e&&typeof e.id=="string"&&"conditions"in e&&Array.isArray(e.conditions),PAt=e=>{if(!MAt.has(e))return null},DAt=({blockType:e,nodeId:t,nodeData:n})=>{if(!_At.has(e)){if(e===be.BRANCH){const i=[...(Array.isArray(n.groups)?n.groups:[]).filter($At).filter(a=>a.conditions.length>0).map(a=>a.id),`branch_group_default_${t}`];return i.length===1?i[0]:null}return null}},LAt={autoCallButton:kAt,autoFlowButton:e=>{const{id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:a,targetPosition:s,style:l,markerEnd:c}=e,{mode:u}=Xt(),{isOpen:d,onOpen:h,onClose:p}=Eo(),{setEdges:g,setNodes:y}=bn(),[v,b,C]=A.useMemo(()=>_C({sourceX:n,sourceY:r,sourcePosition:a,targetX:o,targetY:i,targetPosition:s}),[n,r,o,i,a,s]),S=A.useMemo(()=>JT.filter(O=>O.group!==1).map(O=>({key:O.key,label:f.jsxs(Cn,{align:"center",size:8,children:[f.jsx("span",{style:{color:O.color||mc[O.key]},children:f.jsx(O.icon,{...O.iconProps,size:20})}),f.jsx("span",{children:O.label})]}),children:O.items.map(T=>({key:T.key,label:f.jsxs(Cn,{align:"center",size:8,children:[f.jsx("span",{style:{color:T.color||mc[T.key]},children:f.jsx(T.icon,{...T.iconProps,size:14})}),f.jsx("span",{children:T.label})]})}))})),[]),E=A.useCallback(O=>({id:`${O.toLowerCase()}_${Sh()}`,type:O,position:{x:b,y:C},data:{title:Jg[O],...I1(O)},deletable:!0,...N1[O]}),[b,C]),x=A.useCallback(({key:O})=>{const T=O,M=E(T),_=PAt(T),L=DAt({blockType:T,nodeId:M.id,nodeData:M.data});y(P=>[...P,M]),g(P=>{const $=P.find(q=>q.id===t);if(!$)return P;const{source:B,sourceHandle:D,target:F,targetHandle:z}=$,V=Sh(),U=P.filter(q=>q.id!==t);return _!==null&&U.push({id:`${B}_${M.id}_${V}`,source:B,sourceHandle:D,target:M.id,targetHandle:_,type:"autoFlowButton"}),L!==null&&U.push({id:`${M.id}_${F}_${V}`,source:M.id,sourceHandle:L,target:F,targetHandle:z,type:"autoFlowButton"}),U}),p()},[t,E,y,g,p]),I=A.useCallback(O=>{O.preventDefault(),h()},[h]),N=A.useMemo(()=>({transform:`translate(-50%, -50%) translate(${b}px,${C}px)`}),[b,C]);return f.jsxs(f.Fragment,{children:[f.jsx(Yp,{path:v,markerEnd:c,style:l}),f.jsx(nj,{children:u!=="edit"?null:f.jsx(pr,{title:"Thêm nút",children:f.jsx("div",{className:`${Que} nodrag nopan ${d?Rue:""}`,style:N,children:f.jsx(Fs,{open:d,trigger:["click"],menu:{items:S,onClick:x},onOpenChange:O=>O?h():p(),children:f.jsx(yt,{onClick:I,type:"text",size:"large",style:{padding:4},children:f.jsx(y1,{style:{fontSize:24}})})})})})})]})}};function BAt(){const{getNodes:e,getEdges:t}=bn(),n=nb();return{isValidConnection:A.useCallback(o=>{const i=e(),a=t(),s=i.find(c=>c.id===o.target);return a.some(c=>c.source===o.source&&(c.sourceHandle?c.sourceHandle===o.sourceHandle:!0))?(n.error({key:"output-used",content:"Output này đã được nối rồi"}),!1):(s==null?void 0:s.id)===o.source?(n.error({key:"self-loop",content:"Không thể kết nối node vào chính nó"}),!1):!0},[t,e,n])}}const FAt=(e,t)=>!(!e||!t||e.type===be.START&&t.type!==be.SPEAK||e.type===be.LISTEN&&t.type!==be.SPEAK||t.type===be.LISTEN&&e.type!==be.SPEAK),jAt=()=>A.useCallback(({deletedNodeId:e,deletedNodeIds:t,edges:n,nodes:r,defaultEdgeType:o})=>{const i=n.filter(u=>u.target===e&&!t.has(u.source)),a=n.filter(u=>u.source===e&&!t.has(u.target));if(i.length!==1||a.length!==1)return null;const[s]=i,[l]=a;if(s.source===l.target)return null;const c=l.type||s.type||o;if(c==="autoCallButton"){const u=r.find(h=>h.id===s.source),d=r.find(h=>h.id===l.target);if(!FAt(u,d))return null}return{source:s.source,sourceHandle:s.sourceHandle??null,target:l.target,targetHandle:l.targetHandle??null,type:c}},[]),zAt=()=>{const e=jAt();return A.useCallback(({deletedNodes:t,edges:n,nodes:r,defaultEdgeType:o})=>{const i=new Set(t.map(a=>a.id));return t.flatMap(a=>{const s=e({deletedNodeId:a.id,deletedNodeIds:i,edges:n,nodes:r,defaultEdgeType:o});return s?[s]:[]})},[e])},VAt="UPDATE_CUSTOMERS_FROM_PREVIOUS_NODE",HAt=e=>typeof e=="string"?e?[e]:[]:(e==null?void 0:e.filter(t=>typeof t=="string"&&!!t))??[];function WAt(){const{getNodes:e,setNodes:t}=bn(),{mode:n}=Xt();A.useEffect(()=>{if(n!=="edit")return;const r=e(),o=new Map(r.filter(s=>s.type===be.ACTION_CALLBOT||s.type===be.TRIGGER_CALLBOT).map(s=>{var l;return[s.id,(l=s.data)==null?void 0:l.campaign_id]}));let i=!1;const a=r.map(s=>{var d,h,p,g;if(((d=s.data)==null?void 0:d.type)!==VAt)return s;const[l]=HAt((h=s.data)==null?void 0:h.call_campaign_customer),c=l?(p=sp(l))==null?void 0:p.object:void 0,u=c?o.get(c):void 0;return((g=s.data)==null?void 0:g.campaign_id)===u?s:(i=!0,{...s,data:{...s.data,campaign_id:u,update_fields:void 0}})});i&&t(a)})}const KAt=e=>A.useMemo(()=>e.map((t,n)=>{var o,i;const r=n+1;return{...t,data:{...t.data,order:r,output:Array.isArray((o=t.data)==null?void 0:o.output)?t.data.output.map(a=>({...a,order:r})):(i=t.data)==null?void 0:i.output}}}),[e]);function Yue(e){return wr({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20"},child:[]},{tag:"path",attr:{d:"M8 11h8"},child:[]},{tag:"path",attr:{d:"M8 7h6"},child:[]}]})(e)}const qAt={version:"1.37.4"};var yv=(e=>(e.BOT="bot",e.CLONE="clone",e))(yv||{});function u$(e){const t=e.getState(),{nodes:n,edges:r,transform:o}=t;return{nodes:n,edges:r,viewport:{x:o[0],y:o[1],zoom:o[2]}}}function UAt({cb:e,delay:t=1e3,enabled:n=!0}){const r=Rr(),o=A.useRef(e),i=A.useRef(u$(r)),a=A.useRef(i.current.viewport.zoom);A.useEffect(()=>{o.current=n?e:void 0},[e,n]);const s=A.useCallback(()=>{var y;if(!n)return;const u=u$(r),d=i.current,h=nt.isEqual(u.nodes,d.nodes),p=nt.isEqual(u.edges,d.edges),g=nt.isEqual(u.viewport,d.viewport);h&&p&&g||(i.current=u,a.current=u.viewport.zoom,(y=o.current)==null||y.call(o,u))},[r,n]),l=A.useMemo(()=>nt.debounce(s,t),[s,t]);A.useEffect(()=>{const u=r.subscribe(()=>l());return()=>{l.cancel(),u()}},[r,l]),VAe({onChange:({zoom:u})=>{n&&u!==a.current&&(a.current=u,l())}});const c=A.useCallback(()=>{const u=u$(r);i.current=u,a.current=u.viewport.zoom},[r]);return{commit:l,resetCommitState:c}}const Xue=e=>{let t;const n=new Set,r=(c,u)=>{const d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){const h=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(p=>p(t,h))}},o=()=>t,s={setState:r,getState:o,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(r,o,s);return s},GAt=e=>e?Xue(e):Xue,QAt=e=>e;function RAt(e,t=QAt){const n=A.useSyncExternalStore(e.subscribe,A.useCallback(()=>t(e.getState()),[e,t]),A.useCallback(()=>t(e.getInitialState()),[e,t]));return A.useDebugValue(n),n}const Zue=e=>{const t=GAt(e),n=r=>RAt(t,r);return Object.assign(n,t),n},Jue=e=>e?Zue(e):Zue,ede=Jue(e=>({mode:"trackpad",toggleMode:()=>e(t=>({mode:t.mode==="trackpad"?"mouse":"trackpad"}))}));function YAt(){const e=ede(o=>o.mode),t=ede(o=>o.toggleMode),{mode:n}=Xt(),r=A.useMemo(()=>({...e==="trackpad"?{panOnScroll:!0,panOnDrag:!1,zoomOnScroll:!1,zoomOnPinch:!0,zoomOnDoubleClick:!1}:{panOnScroll:!1,panOnDrag:!0,zoomOnScroll:!0,zoomOnPinch:!1,zoomOnDoubleClick:!1},...n==="history"?{nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0}:n==="view"?{nodesDraggable:!0,nodesConnectable:!1,elementsSelectable:!1}:{nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0}}),[e,n]);return{mode:e,toggleMode:t,flowProps:r}}const d$=1,tde="scripts-editor.shortcuts.v1",nde=["mod","shift","alt"],Qx=[{id:"undo",label:"Hoàn tác",description:"Hoàn tác thay đổi gần nhất của flow"},{id:"redo",label:"Làm lại",description:"Làm lại thao tác đã hoàn tác"},{id:"zoomIn",label:"Phóng to",description:"Tăng mức zoom của canvas"},{id:"zoomOut",label:"Thu nhỏ",description:"Giảm mức zoom của canvas"},{id:"fitView",label:"Vừa màn hình",description:"Canh lại toàn bộ flow vào vùng nhìn"},{id:"autoLayout",label:"Sắp xếp tự động",description:"Tự động căn chỉnh vị trí node"},{id:"deleteSelection",label:"Xoá vùng chọn",description:"Xoá node/edge đang được chọn"},{id:"toggleInteractionMode",label:"Đổi chế độ tương tác",description:"Chuyển trackpad/mouse"}],f$=Qx.map(e=>e.id),h$={undo:"mod+z",redo:"mod+shift+z",zoomIn:"mod+=",zoomOut:"mod+-",fitView:"mod+0",autoLayout:"mod+shift+a",deleteSelection:"mod+backspace",toggleInteractionMode:"mod+shift+m"},XAt=new Set(["zoomIn","zoomOut"]),ZAt=new Set(["undo","redo","zoomIn","zoomOut","fitView"]),JAt=new Set(["undo","redo","autoLayout","deleteSelection"]),rde=e=>{var r;const t=(r=e==null?void 0:e.trim())==null?void 0:r.toLowerCase();return t?{esc:"escape",del:"delete",return:"enter",spacebar:"space"," ":"space",plus:"=","+":"=",minus:"-",_:"-"}[t]??t:null},ode=e=>{const t=rde(e.key);if(t)return t;switch(e.code){case"Equal":return"=";case"Minus":return"-";case"Digit0":return"0";default:return null}},Rx=e=>{const t=e.split("+").map(r=>r.trim().toLowerCase()).filter(Boolean);if(!t.length)return null;const n={mod:!1,shift:!1,alt:!1,key:""};for(const r of t){if(r==="mod"||r==="shift"||r==="alt"){if(n[r])return null;n[r]=!0;continue}const o=rde(r);if(!o||n.key)return null;n.key=o}return n.key?n:null},p$=e=>e.mod||e.alt,g$=e=>[...nde.filter(n=>e[n]),e.key].join("+"),e2t=e=>{const t=Rx(e);return!t||!p$(t)?null:g$(t)},t2t=e=>{const t=ode(e);if(!t||t==="meta"||t==="control"||t==="shift"||t==="alt")return null;const n={mod:e.metaKey||e.ctrlKey,shift:e.shiftKey,alt:e.altKey,key:t};return p$(n)?g$(n):null},n2t=(e,t)=>{const n=e.metaKey||e.ctrlKey,r=ode(e);return!r||n!==t.mod||e.altKey!==t.alt||t.shift&&!e.shiftKey||!t.shift&&e.shiftKey&&!(t.key==="="&&e.code==="Equal"||t.key==="-"&&e.code==="Minus")?!1:r===t.key},r2t=e=>{const t=Rx(e);if(!t)return e;const r={mod:typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/i.test(navigator.platform)?"Cmd":"Ctrl",shift:"Shift",alt:"Alt",backspace:"Backspace",delete:"Delete",escape:"Esc",enter:"Enter",space:"Space"},o=r[t.key]??t.key.toUpperCase();return[...nde.filter(a=>t[a]).map(a=>r[a]??a),o].join(" + ")},m$=e=>f$.reduce((t,n)=>{const r=e==null?void 0:e[n],o=r?e2t(r):null;return t[n]=o??h$[n],t},{}),o2t=e=>{const t={},n={};for(const o of f$){const i=e[o];if(!i){t[o]="Vui lòng nhập phím tắt";continue}const a=Rx(i);if(!a||!p$(a)){t[o]="Phím tắt phải có Ctrl/Cmd hoặc Alt";continue}n[o]=g$(a)}const r=new Map;for(const o of f$){const i=n[o];if(!i)continue;const a=r.get(i)??[];a.push(o),r.set(i,a)}for(const[,o]of r){if(o.length<2)continue;const i=o.map(a=>{var s;return((s=Qx.find(l=>l.id===a))==null?void 0:s.label)??a}).join(", ");for(const a of o)t[a]=`Phím tắt đang bị trùng (${i})`}return{isValid:Object.keys(t).length===0,errors:t,normalizedBindings:m$(n)}},v$=()=>({version:d$,bindings:{...h$}}),i2t=()=>{if(typeof window>"u")return v$();try{const e=window.localStorage.getItem(tde);if(!e)return v$();const t=JSON.parse(e),n=m$(t==null?void 0:t.bindings);return{version:d$,bindings:n}}catch{return v$()}},a2t=e=>{if(typeof window>"u")return;const t={version:d$,bindings:m$(e.bindings)};window.localStorage.setItem(tde,JSON.stringify(t))},s2t=e=>{if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;const t=e.tagName.toLowerCase();return t==="input"||t==="textarea"||t==="select"?!0:!!e.closest("[contenteditable='true'], [role='textbox']")},l2t=({mode:e,bindings:t,handlers:n,suspended:r=!1,onReadonlyActionBlocked:o})=>{const i=A.useMemo(()=>Object.entries(t).map(([a,s])=>({actionId:a,parsedBinding:Rx(s)})).filter(a=>!!a.parsedBinding),[t]);A.useEffect(()=>{if(r)return;const a=s=>{var c;if(s.defaultPrevented)return;const l=i.find(u=>u.parsedBinding?n2t(s,u.parsedBinding):!1);if(l&&!(s2t(s.target)&&!ZAt.has(l.actionId))&&!(s.repeat&&!XAt.has(l.actionId))){if(s.preventDefault(),e!=="edit"&&JAt.has(l.actionId)){o==null||o(l.actionId);return}(c=n[l.actionId])==null||c.call(n)}};return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[n,e,o,i,r])};var y$,ide;function b$(){if(ide)return y$;ide=1;var e="\0",t="\0",n="";class r{constructor(u){ni(this,"_isDirected",!0);ni(this,"_isMultigraph",!1);ni(this,"_isCompound",!1);ni(this,"_label");ni(this,"_defaultNodeLabelFn",()=>{});ni(this,"_defaultEdgeLabelFn",()=>{});ni(this,"_nodes",{});ni(this,"_in",{});ni(this,"_preds",{});ni(this,"_out",{});ni(this,"_sucs",{});ni(this,"_edgeObjs",{});ni(this,"_edgeLabels",{});ni(this,"_nodeCount",0);ni(this,"_edgeCount",0);ni(this,"_parent");ni(this,"_children");u&&(this._isDirected=Object.hasOwn(u,"directed")?u.directed:!0,this._isMultigraph=Object.hasOwn(u,"multigraph")?u.multigraph:!1,this._isCompound=Object.hasOwn(u,"compound")?u.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(u){return this._label=u,this}graph(){return this._label}setDefaultNodeLabel(u){return this._defaultNodeLabelFn=u,typeof u!="function"&&(this._defaultNodeLabelFn=()=>u),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var u=this;return this.nodes().filter(d=>Object.keys(u._in[d]).length===0)}sinks(){var u=this;return this.nodes().filter(d=>Object.keys(u._out[d]).length===0)}setNodes(u,d){var h=arguments,p=this;return u.forEach(function(g){h.length>1?p.setNode(g,d):p.setNode(g)}),this}setNode(u,d){return Object.hasOwn(this._nodes,u)?(arguments.length>1&&(this._nodes[u]=d),this):(this._nodes[u]=arguments.length>1?d:this._defaultNodeLabelFn(u),this._isCompound&&(this._parent[u]=t,this._children[u]={},this._children[t][u]=!0),this._in[u]={},this._preds[u]={},this._out[u]={},this._sucs[u]={},++this._nodeCount,this)}node(u){return this._nodes[u]}hasNode(u){return Object.hasOwn(this._nodes,u)}removeNode(u){var d=this;if(Object.hasOwn(this._nodes,u)){var h=p=>d.removeEdge(d._edgeObjs[p]);delete this._nodes[u],this._isCompound&&(this._removeFromParentsChildList(u),delete this._parent[u],this.children(u).forEach(function(p){d.setParent(p)}),delete this._children[u]),Object.keys(this._in[u]).forEach(h),delete this._in[u],delete this._preds[u],Object.keys(this._out[u]).forEach(h),delete this._out[u],delete this._sucs[u],--this._nodeCount}return this}setParent(u,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(d===void 0)d=t;else{d+="";for(var h=d;h!==void 0;h=this.parent(h))if(h===u)throw new Error("Setting "+d+" as parent of "+u+" would create a cycle");this.setNode(d)}return this.setNode(u),this._removeFromParentsChildList(u),this._parent[u]=d,this._children[d][u]=!0,this}_removeFromParentsChildList(u){delete this._children[this._parent[u]][u]}parent(u){if(this._isCompound){var d=this._parent[u];if(d!==t)return d}}children(u=t){if(this._isCompound){var d=this._children[u];if(d)return Object.keys(d)}else{if(u===t)return this.nodes();if(this.hasNode(u))return[]}}predecessors(u){var d=this._preds[u];if(d)return Object.keys(d)}successors(u){var d=this._sucs[u];if(d)return Object.keys(d)}neighbors(u){var d=this.predecessors(u);if(d){const p=new Set(d);for(var h of this.successors(u))p.add(h);return Array.from(p.values())}}isLeaf(u){var d;return this.isDirected()?d=this.successors(u):d=this.neighbors(u),d.length===0}filterNodes(u){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var h=this;Object.entries(this._nodes).forEach(function([y,v]){u(y)&&d.setNode(y,v)}),Object.values(this._edgeObjs).forEach(function(y){d.hasNode(y.v)&&d.hasNode(y.w)&&d.setEdge(y,h.edge(y))});var p={};function g(y){var v=h.parent(y);return v===void 0||d.hasNode(v)?(p[y]=v,v):v in p?p[v]:g(v)}return this._isCompound&&d.nodes().forEach(y=>d.setParent(y,g(y))),d}setDefaultEdgeLabel(u){return this._defaultEdgeLabelFn=u,typeof u!="function"&&(this._defaultEdgeLabelFn=()=>u),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(u,d){var h=this,p=arguments;return u.reduce(function(g,y){return p.length>1?h.setEdge(g,y,d):h.setEdge(g,y),y}),this}setEdge(){var u,d,h,p,g=!1,y=arguments[0];typeof y=="object"&&y!==null&&"v"in y?(u=y.v,d=y.w,h=y.name,arguments.length===2&&(p=arguments[1],g=!0)):(u=y,d=arguments[1],h=arguments[3],arguments.length>2&&(p=arguments[2],g=!0)),u=""+u,d=""+d,h!==void 0&&(h=""+h);var v=a(this._isDirected,u,d,h);if(Object.hasOwn(this._edgeLabels,v))return g&&(this._edgeLabels[v]=p),this;if(h!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(u),this.setNode(d),this._edgeLabels[v]=g?p:this._defaultEdgeLabelFn(u,d,h);var b=s(this._isDirected,u,d,h);return u=b.v,d=b.w,Object.freeze(b),this._edgeObjs[v]=b,o(this._preds[d],u),o(this._sucs[u],d),this._in[d][v]=b,this._out[u][v]=b,this._edgeCount++,this}edge(u,d,h){var p=arguments.length===1?l(this._isDirected,arguments[0]):a(this._isDirected,u,d,h);return this._edgeLabels[p]}edgeAsObj(){const u=this.edge(...arguments);return typeof u!="object"?{label:u}:u}hasEdge(u,d,h){var p=arguments.length===1?l(this._isDirected,arguments[0]):a(this._isDirected,u,d,h);return Object.hasOwn(this._edgeLabels,p)}removeEdge(u,d,h){var p=arguments.length===1?l(this._isDirected,arguments[0]):a(this._isDirected,u,d,h),g=this._edgeObjs[p];return g&&(u=g.v,d=g.w,delete this._edgeLabels[p],delete this._edgeObjs[p],i(this._preds[d],u),i(this._sucs[u],d),delete this._in[d][p],delete this._out[u][p],this._edgeCount--),this}inEdges(u,d){var h=this._in[u];if(h){var p=Object.values(h);return d?p.filter(g=>g.v===d):p}}outEdges(u,d){var h=this._out[u];if(h){var p=Object.values(h);return d?p.filter(g=>g.w===d):p}}nodeEdges(u,d){var h=this.inEdges(u,d);if(h)return h.concat(this.outEdges(u,d))}}function o(c,u){c[u]?c[u]++:c[u]=1}function i(c,u){--c[u]||delete c[u]}function a(c,u,d,h){var p=""+u,g=""+d;if(!c&&p>g){var y=p;p=g,g=y}return p+n+g+n+(h===void 0?e:h)}function s(c,u,d,h){var p=""+u,g=""+d;if(!c&&p>g){var y=p;p=g,g=y}var v={v:p,w:g};return h&&(v.name=h),v}function l(c,u){return a(c,u.v,u.w,u.name)}return y$=r,y$}var C$,ade;function c2t(){return ade||(ade=1,C$="2.2.4"),C$}var A$,sde;function u2t(){return sde||(sde=1,A$={Graph:b$(),version:c2t()}),A$}var E$,lde;function d2t(){if(lde)return E$;lde=1;var e=b$();E$={write:t,read:o};function t(i){var a={options:{directed:i.isDirected(),multigraph:i.isMultigraph(),compound:i.isCompound()},nodes:n(i),edges:r(i)};return i.graph()!==void 0&&(a.value=structuredClone(i.graph())),a}function n(i){return i.nodes().map(function(a){var s=i.node(a),l=i.parent(a),c={v:a};return s!==void 0&&(c.value=s),l!==void 0&&(c.parent=l),c})}function r(i){return i.edges().map(function(a){var s=i.edge(a),l={v:a.v,w:a.w};return a.name!==void 0&&(l.name=a.name),s!==void 0&&(l.value=s),l})}function o(i){var a=new e(i.options).setGraph(i.value);return i.nodes.forEach(function(s){a.setNode(s.v,s.value),s.parent&&a.setParent(s.v,s.parent)}),i.edges.forEach(function(s){a.setEdge({v:s.v,w:s.w,name:s.name},s.value)}),a}return E$}var S$,cde;function f2t(){if(cde)return S$;cde=1,S$=e;function e(t){var n={},r=[],o;function i(a){Object.hasOwn(n,a)||(n[a]=!0,o.push(a),t.successors(a).forEach(i),t.predecessors(a).forEach(i))}return t.nodes().forEach(function(a){o=[],i(a),o.length&&r.push(o)}),r}return S$}var w$,ude;function dde(){if(ude)return w$;ude=1;class e{constructor(){ni(this,"_arr",[]);ni(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(n){return n.key})}has(n){return Object.hasOwn(this._keyIndices,n)}priority(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(n,r){var o=this._keyIndices;if(n=String(n),!Object.hasOwn(o,n)){var i=this._arr,a=i.length;return o[n]=a,i.push({key:n,priority:r}),this._decrease(a),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key}decrease(n,r){var o=this._keyIndices[n];if(r>this._arr[o].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[o].priority+" New: "+r);this._arr[o].priority=r,this._decrease(o)}_heapify(n){var r=this._arr,o=2*n,i=o+1,a=n;o<r.length&&(a=r[o].priority<r[a].priority?o:a,i<r.length&&(a=r[i].priority<r[a].priority?i:a),a!==n&&(this._swap(n,a),this._heapify(a)))}_decrease(n){for(var r=this._arr,o=r[n].priority,i;n!==0&&(i=n>>1,!(r[i].priority<o));)this._swap(n,i),n=i}_swap(n,r){var o=this._arr,i=this._keyIndices,a=o[n],s=o[r];o[n]=s,o[r]=a,i[s.key]=n,i[a.key]=r}}return w$=e,w$}var x$,fde;function hde(){if(fde)return x$;fde=1;var e=dde();x$=n;var t=()=>1;function n(o,i,a,s){return r(o,String(i),a||t,s||function(l){return o.outEdges(l)})}function r(o,i,a,s){var l={},c=new e,u,d,h=function(p){var g=p.v!==u?p.v:p.w,y=l[g],v=a(p),b=d.distance+v;if(v<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+v);b<y.distance&&(y.distance=b,y.predecessor=u,c.decrease(g,b))};for(o.nodes().forEach(function(p){var g=p===i?0:Number.POSITIVE_INFINITY;l[p]={distance:g},c.add(p,g)});c.size()>0&&(u=c.removeMin(),d=l[u],d.distance!==Number.POSITIVE_INFINITY);)s(u).forEach(h);return l}return x$}var I$,pde;function h2t(){if(pde)return I$;pde=1;var e=hde();I$=t;function t(n,r,o){return n.nodes().reduce(function(i,a){return i[a]=e(n,a,r,o),i},{})}return I$}var N$,gde;function mde(){if(gde)return N$;gde=1,N$=e;function e(t){var n=0,r=[],o={},i=[];function a(s){var l=o[s]={onStack:!0,lowlink:n,index:n++};if(r.push(s),t.successors(s).forEach(function(d){Object.hasOwn(o,d)?o[d].onStack&&(l.lowlink=Math.min(l.lowlink,o[d].index)):(a(d),l.lowlink=Math.min(l.lowlink,o[d].lowlink))}),l.lowlink===l.index){var c=[],u;do u=r.pop(),o[u].onStack=!1,c.push(u);while(s!==u);i.push(c)}}return t.nodes().forEach(function(s){Object.hasOwn(o,s)||a(s)}),i}return N$}var O$,vde;function p2t(){if(vde)return O$;vde=1;var e=mde();O$=t;function t(n){return e(n).filter(function(r){return r.length>1||r.length===1&&n.hasEdge(r[0],r[0])})}return O$}var T$,yde;function g2t(){if(yde)return T$;yde=1,T$=t;var e=()=>1;function t(r,o,i){return n(r,o||e,i||function(a){return r.outEdges(a)})}function n(r,o,i){var a={},s=r.nodes();return s.forEach(function(l){a[l]={},a[l][l]={distance:0},s.forEach(function(c){l!==c&&(a[l][c]={distance:Number.POSITIVE_INFINITY})}),i(l).forEach(function(c){var u=c.v===l?c.w:c.v,d=o(c);a[l][u]={distance:d,predecessor:l}})}),s.forEach(function(l){var c=a[l];s.forEach(function(u){var d=a[u];s.forEach(function(h){var p=d[l],g=c[h],y=d[h],v=p.distance+g.distance;v<y.distance&&(y.distance=v,y.predecessor=g.predecessor)})})}),a}return T$}var k$,bde;function Cde(){if(bde)return k$;bde=1;function e(n){var r={},o={},i=[];function a(s){if(Object.hasOwn(o,s))throw new t;Object.hasOwn(r,s)||(o[s]=!0,r[s]=!0,n.predecessors(s).forEach(a),delete o[s],i.push(s))}if(n.sinks().forEach(a),Object.keys(r).length!==n.nodeCount())throw new t;return i}class t extends Error{constructor(){super(...arguments)}}return k$=e,e.CycleException=t,k$}var M$,Ade;function m2t(){if(Ade)return M$;Ade=1;var e=Cde();M$=t;function t(n){try{e(n)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}return M$}var _$,Ede;function Sde(){if(Ede)return _$;Ede=1,_$=e;function e(o,i,a){Array.isArray(i)||(i=[i]);var s=o.isDirected()?d=>o.successors(d):d=>o.neighbors(d),l=a==="post"?t:n,c=[],u={};return i.forEach(d=>{if(!o.hasNode(d))throw new Error("Graph does not have node: "+d);l(d,s,u,c)}),c}function t(o,i,a,s){for(var l=[[o,!1]];l.length>0;){var c=l.pop();c[1]?s.push(c[0]):Object.hasOwn(a,c[0])||(a[c[0]]=!0,l.push([c[0],!0]),r(i(c[0]),u=>l.push([u,!1])))}}function n(o,i,a,s){for(var l=[o];l.length>0;){var c=l.pop();Object.hasOwn(a,c)||(a[c]=!0,s.push(c),r(i(c),u=>l.push(u)))}}function r(o,i){for(var a=o.length;a--;)i(o[a],a,o);return o}return _$}var $$,wde;function v2t(){if(wde)return $$;wde=1;var e=Sde();$$=t;function t(n,r){return e(n,r,"post")}return $$}var P$,xde;function y2t(){if(xde)return P$;xde=1;var e=Sde();P$=t;function t(n,r){return e(n,r,"pre")}return P$}var D$,Ide;function b2t(){if(Ide)return D$;Ide=1;var e=b$(),t=dde();D$=n;function n(r,o){var i=new e,a={},s=new t,l;function c(d){var h=d.v===l?d.w:d.v,p=s.priority(h);if(p!==void 0){var g=o(d);g<p&&(a[h]=l,s.decrease(h,g))}}if(r.nodeCount()===0)return i;r.nodes().forEach(function(d){s.add(d,Number.POSITIVE_INFINITY),i.setNode(d)}),s.decrease(r.nodes()[0],0);for(var u=!1;s.size()>0;){if(l=s.removeMin(),Object.hasOwn(a,l))i.setEdge(l,a[l]);else{if(u)throw new Error("Input graph is not connected: "+r);u=!0}r.nodeEdges(l).forEach(c)}return i}return D$}var L$,Nde;function C2t(){return Nde||(Nde=1,L$={components:f2t(),dijkstra:hde(),dijkstraAll:h2t(),findCycles:p2t(),floydWarshall:g2t(),isAcyclic:m2t(),postorder:v2t(),preorder:y2t(),prim:b2t(),tarjan:mde(),topsort:Cde()}),L$}var B$,Ode;function Wl(){if(Ode)return B$;Ode=1;var e=u2t();return B$={Graph:e.Graph,json:d2t(),alg:C2t(),version:e.version},B$}var F$,Tde;function A2t(){if(Tde)return F$;Tde=1;class e{constructor(){let o={};o._next=o._prev=o,this._sentinel=o}dequeue(){let o=this._sentinel,i=o._prev;if(i!==o)return t(i),i}enqueue(o){let i=this._sentinel;o._prev&&o._next&&t(o),o._next=i._next,i._next._prev=o,i._next=o,o._prev=i}toString(){let o=[],i=this._sentinel,a=i._prev;for(;a!==i;)o.push(JSON.stringify(a,n)),a=a._prev;return"["+o.join(", ")+"]"}}function t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function n(r,o){if(r!=="_next"&&r!=="_prev")return o}return F$=e,F$}var j$,kde;function E2t(){if(kde)return j$;kde=1;let e=Wl().Graph,t=A2t();j$=r;let n=()=>1;function r(c,u){if(c.nodeCount()<=1)return[];let d=a(c,u||n);return o(d.graph,d.buckets,d.zeroIdx).flatMap(p=>c.outEdges(p.v,p.w))}function o(c,u,d){let h=[],p=u[u.length-1],g=u[0],y;for(;c.nodeCount();){for(;y=g.dequeue();)i(c,u,d,y);for(;y=p.dequeue();)i(c,u,d,y);if(c.nodeCount()){for(let v=u.length-2;v>0;--v)if(y=u[v].dequeue(),y){h=h.concat(i(c,u,d,y,!0));break}}}return h}function i(c,u,d,h,p){let g=p?[]:void 0;return c.inEdges(h.v).forEach(y=>{let v=c.edge(y),b=c.node(y.v);p&&g.push({v:y.v,w:y.w}),b.out-=v,s(u,d,b)}),c.outEdges(h.v).forEach(y=>{let v=c.edge(y),b=y.w,C=c.node(b);C.in-=v,s(u,d,C)}),c.removeNode(h.v),g}function a(c,u){let d=new e,h=0,p=0;c.nodes().forEach(v=>{d.setNode(v,{v,in:0,out:0})}),c.edges().forEach(v=>{let b=d.edge(v.v,v.w)||0,C=u(v),S=b+C;d.setEdge(v.v,v.w,S),p=Math.max(p,d.node(v.v).out+=C),h=Math.max(h,d.node(v.w).in+=C)});let g=l(p+h+3).map(()=>new t),y=h+1;return d.nodes().forEach(v=>{s(g,y,d.node(v))}),{graph:d,buckets:g,zeroIdx:y}}function s(c,u,d){d.out?d.in?c[d.out-d.in+u].enqueue(d):c[c.length-1].enqueue(d):c[0].enqueue(d)}function l(c){const u=[];for(let d=0;d<c;d++)u.push(d);return u}return j$}var z$,Mde;function gi(){if(Mde)return z$;Mde=1;let e=Wl().Graph;z$={addBorderNode:u,addDummyNode:t,applyWithChunking:p,asNonCompoundGraph:r,buildLayerMatrix:s,intersectRect:a,mapValues:I,maxRank:g,normalizeRanks:l,notime:b,partition:y,pick:x,predecessorWeights:i,range:E,removeEmptyRanks:c,simplify:n,successorWeights:o,time:v,uniqueId:S,zipObject:N};function t(O,T,M,_){for(var L=_;O.hasNode(L);)L=S(_);return M.dummy=T,O.setNode(L,M),L}function n(O){let T=new e().setGraph(O.graph());return O.nodes().forEach(M=>T.setNode(M,O.node(M))),O.edges().forEach(M=>{let _=T.edge(M.v,M.w)||{weight:0,minlen:1},L=O.edge(M);T.setEdge(M.v,M.w,{weight:_.weight+L.weight,minlen:Math.max(_.minlen,L.minlen)})}),T}function r(O){let T=new e({multigraph:O.isMultigraph()}).setGraph(O.graph());return O.nodes().forEach(M=>{O.children(M).length||T.setNode(M,O.node(M))}),O.edges().forEach(M=>{T.setEdge(M,O.edge(M))}),T}function o(O){let T=O.nodes().map(M=>{let _={};return O.outEdges(M).forEach(L=>{_[L.w]=(_[L.w]||0)+O.edge(L).weight}),_});return N(O.nodes(),T)}function i(O){let T=O.nodes().map(M=>{let _={};return O.inEdges(M).forEach(L=>{_[L.v]=(_[L.v]||0)+O.edge(L).weight}),_});return N(O.nodes(),T)}function a(O,T){let M=O.x,_=O.y,L=T.x-M,P=T.y-_,$=O.width/2,B=O.height/2;if(!L&&!P)throw new Error("Not possible to find intersection inside of the rectangle");let D,F;return Math.abs(P)*$>Math.abs(L)*B?(P<0&&(B=-B),D=B*L/P,F=B):(L<0&&($=-$),D=$,F=$*P/L),{x:M+D,y:_+F}}function s(O){let T=E(g(O)+1).map(()=>[]);return O.nodes().forEach(M=>{let _=O.node(M),L=_.rank;L!==void 0&&(T[L][_.order]=M)}),T}function l(O){let T=O.nodes().map(_=>{let L=O.node(_).rank;return L===void 0?Number.MAX_VALUE:L}),M=p(Math.min,T);O.nodes().forEach(_=>{let L=O.node(_);Object.hasOwn(L,"rank")&&(L.rank-=M)})}function c(O){let T=O.nodes().map($=>O.node($).rank),M=p(Math.min,T),_=[];O.nodes().forEach($=>{let B=O.node($).rank-M;_[B]||(_[B]=[]),_[B].push($)});let L=0,P=O.graph().nodeRankFactor;Array.from(_).forEach(($,B)=>{$===void 0&&B%P!==0?--L:$!==void 0&&L&&$.forEach(D=>O.node(D).rank+=L)})}function u(O,T,M,_){let L={width:0,height:0};return arguments.length>=4&&(L.rank=M,L.order=_),t(O,"border",L,T)}function d(O,T=h){const M=[];for(let _=0;_<O.length;_+=T){const L=O.slice(_,_+T);M.push(L)}return M}const h=65535;function p(O,T){if(T.length>h){const M=d(T);return O.apply(null,M.map(_=>O.apply(null,_)))}else return O.apply(null,T)}function g(O){const M=O.nodes().map(_=>{let L=O.node(_).rank;return L===void 0?Number.MIN_VALUE:L});return p(Math.max,M)}function y(O,T){let M={lhs:[],rhs:[]};return O.forEach(_=>{T(_)?M.lhs.push(_):M.rhs.push(_)}),M}function v(O,T){let M=Date.now();try{return T()}finally{console.log(O+" time: "+(Date.now()-M)+"ms")}}function b(O,T){return T()}let C=0;function S(O){var T=++C;return O+(""+T)}function E(O,T,M=1){T==null&&(T=O,O=0);let _=P=>P<T;M<0&&(_=P=>T<P);const L=[];for(let P=O;_(P);P+=M)L.push(P);return L}function x(O,T){const M={};for(const _ of T)O[_]!==void 0&&(M[_]=O[_]);return M}function I(O,T){let M=T;return typeof T=="string"&&(M=_=>_[T]),Object.entries(O).reduce((_,[L,P])=>(_[L]=M(P,L),_),{})}function N(O,T){return O.reduce((M,_,L)=>(M[_]=T[L],M),{})}return z$}var V$,_de;function S2t(){if(_de)return V$;_de=1;let e=E2t(),t=gi().uniqueId;V$={run:n,undo:o};function n(i){(i.graph().acyclicer==="greedy"?e(i,s(i)):r(i)).forEach(l=>{let c=i.edge(l);i.removeEdge(l),c.forwardName=l.name,c.reversed=!0,i.setEdge(l.w,l.v,c,t("rev"))});function s(l){return c=>l.edge(c).weight}}function r(i){let a=[],s={},l={};function c(u){Object.hasOwn(l,u)||(l[u]=!0,s[u]=!0,i.outEdges(u).forEach(d=>{Object.hasOwn(s,d.w)?a.push(d):c(d.w)}),delete s[u])}return i.nodes().forEach(c),a}function o(i){i.edges().forEach(a=>{let s=i.edge(a);if(s.reversed){i.removeEdge(a);let l=s.forwardName;delete s.reversed,delete s.forwardName,i.setEdge(a.w,a.v,s,l)}})}return V$}var H$,$de;function w2t(){if($de)return H$;$de=1;let e=gi();H$={run:t,undo:r};function t(o){o.graph().dummyChains=[],o.edges().forEach(i=>n(o,i))}function n(o,i){let a=i.v,s=o.node(a).rank,l=i.w,c=o.node(l).rank,u=i.name,d=o.edge(i),h=d.labelRank;if(c===s+1)return;o.removeEdge(i);let p,g,y;for(y=0,++s;s<c;++y,++s)d.points=[],g={width:0,height:0,edgeLabel:d,edgeObj:i,rank:s},p=e.addDummyNode(o,"edge",g,"_d"),s===h&&(g.width=d.width,g.height=d.height,g.dummy="edge-label",g.labelpos=d.labelpos),o.setEdge(a,p,{weight:d.weight},u),y===0&&o.graph().dummyChains.push(p),a=p;o.setEdge(a,l,{weight:d.weight},u)}function r(o){o.graph().dummyChains.forEach(i=>{let a=o.node(i),s=a.edgeLabel,l;for(o.setEdge(a.edgeObj,s);a.dummy;)l=o.successors(i)[0],o.removeNode(i),s.points.push({x:a.x,y:a.y}),a.dummy==="edge-label"&&(s.x=a.x,s.y=a.y,s.width=a.width,s.height=a.height),i=l,a=o.node(i)})}return H$}var W$,Pde;function Yx(){if(Pde)return W$;Pde=1;const{applyWithChunking:e}=gi();W$={longestPath:t,slack:n};function t(r){var o={};function i(a){var s=r.node(a);if(Object.hasOwn(o,a))return s.rank;o[a]=!0;let l=r.outEdges(a).map(u=>u==null?Number.POSITIVE_INFINITY:i(u.w)-r.edge(u).minlen);var c=e(Math.min,l);return c===Number.POSITIVE_INFINITY&&(c=0),s.rank=c}r.sources().forEach(i)}function n(r,o){return r.node(o.w).rank-r.node(o.v).rank-r.edge(o).minlen}return W$}var K$,Dde;function Lde(){if(Dde)return K$;Dde=1;var e=Wl().Graph,t=Yx().slack;K$=n;function n(a){var s=new e({directed:!1}),l=a.nodes()[0],c=a.nodeCount();s.setNode(l,{});for(var u,d;r(s,a)<c;)u=o(s,a),d=s.hasNode(u.v)?t(a,u):-t(a,u),i(s,a,d);return s}function r(a,s){function l(c){s.nodeEdges(c).forEach(u=>{var d=u.v,h=c===d?u.w:d;!a.hasNode(h)&&!t(s,u)&&(a.setNode(h,{}),a.setEdge(c,h,{}),l(h))})}return a.nodes().forEach(l),a.nodeCount()}function o(a,s){return s.edges().reduce((c,u)=>{let d=Number.POSITIVE_INFINITY;return a.hasNode(u.v)!==a.hasNode(u.w)&&(d=t(s,u)),d<c[0]?[d,u]:c},[Number.POSITIVE_INFINITY,null])[1]}function i(a,s,l){a.nodes().forEach(c=>s.node(c).rank+=l)}return K$}var q$,Bde;function x2t(){if(Bde)return q$;Bde=1;var e=Lde(),t=Yx().slack,n=Yx().longestPath,r=Wl().alg.preorder,o=Wl().alg.postorder,i=gi().simplify;q$=a,a.initLowLimValues=u,a.initCutValues=s,a.calcCutValue=c,a.leaveEdge=h,a.enterEdge=p,a.exchangeEdges=g;function a(C){C=i(C),n(C);var S=e(C);u(S),s(S,C);for(var E,x;E=h(S);)x=p(S,C,E),g(S,C,E,x)}function s(C,S){var E=o(C,C.nodes());E=E.slice(0,E.length-1),E.forEach(x=>l(C,S,x))}function l(C,S,E){var x=C.node(E),I=x.parent;C.edge(E,I).cutvalue=c(C,S,E)}function c(C,S,E){var x=C.node(E),I=x.parent,N=!0,O=S.edge(E,I),T=0;return O||(N=!1,O=S.edge(I,E)),T=O.weight,S.nodeEdges(E).forEach(M=>{var _=M.v===E,L=_?M.w:M.v;if(L!==I){var P=_===N,$=S.edge(M).weight;if(T+=P?$:-$,v(C,E,L)){var B=C.edge(E,L).cutvalue;T+=P?-B:B}}}),T}function u(C,S){arguments.length<2&&(S=C.nodes()[0]),d(C,{},1,S)}function d(C,S,E,x,I){var N=E,O=C.node(x);return S[x]=!0,C.neighbors(x).forEach(T=>{Object.hasOwn(S,T)||(E=d(C,S,E,T,x))}),O.low=N,O.lim=E++,I?O.parent=I:delete O.parent,E}function h(C){return C.edges().find(S=>C.edge(S).cutvalue<0)}function p(C,S,E){var x=E.v,I=E.w;S.hasEdge(x,I)||(x=E.w,I=E.v);var N=C.node(x),O=C.node(I),T=N,M=!1;N.lim>O.lim&&(T=O,M=!0);var _=S.edges().filter(L=>M===b(C,C.node(L.v),T)&&M!==b(C,C.node(L.w),T));return _.reduce((L,P)=>t(S,P)<t(S,L)?P:L)}function g(C,S,E,x){var I=E.v,N=E.w;C.removeEdge(I,N),C.setEdge(x.v,x.w,{}),u(C),s(C,S),y(C,S)}function y(C,S){var E=C.nodes().find(I=>!S.node(I).parent),x=r(C,E);x=x.slice(1),x.forEach(I=>{var N=C.node(I).parent,O=S.edge(I,N),T=!1;O||(O=S.edge(N,I),T=!0),S.node(I).rank=S.node(N).rank+(T?O.minlen:-O.minlen)})}function v(C,S,E){return C.hasEdge(S,E)}function b(C,S,E){return E.low<=S.lim&&S.lim<=E.lim}return q$}var U$,Fde;function I2t(){if(Fde)return U$;Fde=1;var e=Yx(),t=e.longestPath,n=Lde(),r=x2t();U$=o;function o(l){var c=l.graph().ranker;if(c instanceof Function)return c(l);switch(l.graph().ranker){case"network-simplex":s(l);break;case"tight-tree":a(l);break;case"longest-path":i(l);break;case"none":break;default:s(l)}}var i=t;function a(l){t(l),n(l)}function s(l){r(l)}return U$}var G$,jde;function N2t(){if(jde)return G$;jde=1,G$=e;function e(r){let o=n(r);r.graph().dummyChains.forEach(i=>{let a=r.node(i),s=a.edgeObj,l=t(r,o,s.v,s.w),c=l.path,u=l.lca,d=0,h=c[d],p=!0;for(;i!==s.w;){if(a=r.node(i),p){for(;(h=c[d])!==u&&r.node(h).maxRank<a.rank;)d++;h===u&&(p=!1)}if(!p){for(;d<c.length-1&&r.node(h=c[d+1]).minRank<=a.rank;)d++;h=c[d]}r.setParent(i,h),i=r.successors(i)[0]}})}function t(r,o,i,a){let s=[],l=[],c=Math.min(o[i].low,o[a].low),u=Math.max(o[i].lim,o[a].lim),d,h;d=i;do d=r.parent(d),s.push(d);while(d&&(o[d].low>c||u>o[d].lim));for(h=d,d=a;(d=r.parent(d))!==h;)l.push(d);return{path:s.concat(l.reverse()),lca:h}}function n(r){let o={},i=0;function a(s){let l=i;r.children(s).forEach(a),o[s]={low:l,lim:i++}}return r.children().forEach(a),o}return G$}var Q$,zde;function O2t(){if(zde)return Q$;zde=1;let e=gi();Q$={run:t,cleanup:i};function t(a){let s=e.addDummyNode(a,"root",{},"_root"),l=r(a),c=Object.values(l),u=e.applyWithChunking(Math.max,c)-1,d=2*u+1;a.graph().nestingRoot=s,a.edges().forEach(p=>a.edge(p).minlen*=d);let h=o(a)+1;a.children().forEach(p=>n(a,s,d,h,u,l,p)),a.graph().nodeRankFactor=d}function n(a,s,l,c,u,d,h){let p=a.children(h);if(!p.length){h!==s&&a.setEdge(s,h,{weight:0,minlen:l});return}let g=e.addBorderNode(a,"_bt"),y=e.addBorderNode(a,"_bb"),v=a.node(h);a.setParent(g,h),v.borderTop=g,a.setParent(y,h),v.borderBottom=y,p.forEach(b=>{n(a,s,l,c,u,d,b);let C=a.node(b),S=C.borderTop?C.borderTop:b,E=C.borderBottom?C.borderBottom:b,x=C.borderTop?c:2*c,I=S!==E?1:u-d[h]+1;a.setEdge(g,S,{weight:x,minlen:I,nestingEdge:!0}),a.setEdge(E,y,{weight:x,minlen:I,nestingEdge:!0})}),a.parent(h)||a.setEdge(s,g,{weight:0,minlen:u+d[h]})}function r(a){var s={};function l(c,u){var d=a.children(c);d&&d.length&&d.forEach(h=>l(h,u+1)),s[c]=u}return a.children().forEach(c=>l(c,1)),s}function o(a){return a.edges().reduce((s,l)=>s+a.edge(l).weight,0)}function i(a){var s=a.graph();a.removeNode(s.nestingRoot),delete s.nestingRoot,a.edges().forEach(l=>{var c=a.edge(l);c.nestingEdge&&a.removeEdge(l)})}return Q$}var R$,Vde;function T2t(){if(Vde)return R$;Vde=1;let e=gi();R$=t;function t(r){function o(i){let a=r.children(i),s=r.node(i);if(a.length&&a.forEach(o),Object.hasOwn(s,"minRank")){s.borderLeft=[],s.borderRight=[];for(let l=s.minRank,c=s.maxRank+1;l<c;++l)n(r,"borderLeft","_bl",i,s,l),n(r,"borderRight","_br",i,s,l)}}r.children().forEach(o)}function n(r,o,i,a,s,l){let c={width:0,height:0,rank:l,borderType:o},u=s[o][l-1],d=e.addDummyNode(r,"border",c,i);s[o][l]=d,r.setParent(d,a),u&&r.setEdge(u,d,{weight:1})}return R$}var Y$,Hde;function k2t(){if(Hde)return Y$;Hde=1,Y$={adjust:e,undo:t};function e(l){let c=l.graph().rankdir.toLowerCase();(c==="lr"||c==="rl")&&n(l)}function t(l){let c=l.graph().rankdir.toLowerCase();(c==="bt"||c==="rl")&&o(l),(c==="lr"||c==="rl")&&(a(l),n(l))}function n(l){l.nodes().forEach(c=>r(l.node(c))),l.edges().forEach(c=>r(l.edge(c)))}function r(l){let c=l.width;l.width=l.height,l.height=c}function o(l){l.nodes().forEach(c=>i(l.node(c))),l.edges().forEach(c=>{let u=l.edge(c);u.points.forEach(i),Object.hasOwn(u,"y")&&i(u)})}function i(l){l.y=-l.y}function a(l){l.nodes().forEach(c=>s(l.node(c))),l.edges().forEach(c=>{let u=l.edge(c);u.points.forEach(s),Object.hasOwn(u,"x")&&s(u)})}function s(l){let c=l.x;l.x=l.y,l.y=c}return Y$}var X$,Wde;function M2t(){if(Wde)return X$;Wde=1;let e=gi();X$=t;function t(n){let r={},o=n.nodes().filter(u=>!n.children(u).length),i=o.map(u=>n.node(u).rank),a=e.applyWithChunking(Math.max,i),s=e.range(a+1).map(()=>[]);function l(u){if(r[u])return;r[u]=!0;let d=n.node(u);s[d.rank].push(u),n.successors(u).forEach(l)}return o.sort((u,d)=>n.node(u).rank-n.node(d).rank).forEach(l),s}return X$}var Z$,Kde;function _2t(){if(Kde)return Z$;Kde=1;let e=gi().zipObject;Z$=t;function t(r,o){let i=0;for(let a=1;a<o.length;++a)i+=n(r,o[a-1],o[a]);return i}function n(r,o,i){let a=e(i,i.map((h,p)=>p)),s=o.flatMap(h=>r.outEdges(h).map(p=>({pos:a[p.w],weight:r.edge(p).weight})).sort((p,g)=>p.pos-g.pos)),l=1;for(;l<i.length;)l<<=1;let c=2*l-1;l-=1;let u=new Array(c).fill(0),d=0;return s.forEach(h=>{let p=h.pos+l;u[p]+=h.weight;let g=0;for(;p>0;)p%2&&(g+=u[p+1]),p=p-1>>1,u[p]+=h.weight;d+=h.weight*g}),d}return Z$}var J$,qde;function $2t(){if(qde)return J$;qde=1,J$=e;function e(t,n=[]){return n.map(r=>{let o=t.inEdges(r);if(o.length){let i=o.reduce((a,s)=>{let l=t.edge(s),c=t.node(s.v);return{sum:a.sum+l.weight*c.order,weight:a.weight+l.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}return J$}var eP,Ude;function P2t(){if(Ude)return eP;Ude=1;let e=gi();eP=t;function t(o,i){let a={};o.forEach((l,c)=>{let u=a[l.v]={indegree:0,in:[],out:[],vs:[l.v],i:c};l.barycenter!==void 0&&(u.barycenter=l.barycenter,u.weight=l.weight)}),i.edges().forEach(l=>{let c=a[l.v],u=a[l.w];c!==void 0&&u!==void 0&&(u.indegree++,c.out.push(a[l.w]))});let s=Object.values(a).filter(l=>!l.indegree);return n(s)}function n(o){let i=[];function a(l){return c=>{c.merged||(c.barycenter===void 0||l.barycenter===void 0||c.barycenter>=l.barycenter)&&r(l,c)}}function s(l){return c=>{c.in.push(l),--c.indegree===0&&o.push(c)}}for(;o.length;){let l=o.pop();i.push(l),l.in.reverse().forEach(a(l)),l.out.forEach(s(l))}return i.filter(l=>!l.merged).map(l=>e.pick(l,["vs","i","barycenter","weight"]))}function r(o,i){let a=0,s=0;o.weight&&(a+=o.barycenter*o.weight,s+=o.weight),i.weight&&(a+=i.barycenter*i.weight,s+=i.weight),o.vs=i.vs.concat(o.vs),o.barycenter=a/s,o.weight=s,o.i=Math.min(i.i,o.i),i.merged=!0}return eP}var tP,Gde;function D2t(){if(Gde)return tP;Gde=1;let e=gi();tP=t;function t(o,i){let a=e.partition(o,g=>Object.hasOwn(g,"barycenter")),s=a.lhs,l=a.rhs.sort((g,y)=>y.i-g.i),c=[],u=0,d=0,h=0;s.sort(r(!!i)),h=n(c,l,h),s.forEach(g=>{h+=g.vs.length,c.push(g.vs),u+=g.barycenter*g.weight,d+=g.weight,h=n(c,l,h)});let p={vs:c.flat(!0)};return d&&(p.barycenter=u/d,p.weight=d),p}function n(o,i,a){let s;for(;i.length&&(s=i[i.length-1]).i<=a;)i.pop(),o.push(s.vs),a++;return a}function r(o){return(i,a)=>i.barycenter<a.barycenter?-1:i.barycenter>a.barycenter?1:o?a.i-i.i:i.i-a.i}return tP}var nP,Qde;function L2t(){if(Qde)return nP;Qde=1;let e=$2t(),t=P2t(),n=D2t();nP=r;function r(a,s,l,c){let u=a.children(s),d=a.node(s),h=d?d.borderLeft:void 0,p=d?d.borderRight:void 0,g={};h&&(u=u.filter(C=>C!==h&&C!==p));let y=e(a,u);y.forEach(C=>{if(a.children(C.v).length){let S=r(a,C.v,l,c);g[C.v]=S,Object.hasOwn(S,"barycenter")&&i(C,S)}});let v=t(y,l);o(v,g);let b=n(v,c);if(h&&(b.vs=[h,b.vs,p].flat(!0),a.predecessors(h).length)){let C=a.node(a.predecessors(h)[0]),S=a.node(a.predecessors(p)[0]);Object.hasOwn(b,"barycenter")||(b.barycenter=0,b.weight=0),b.barycenter=(b.barycenter*b.weight+C.order+S.order)/(b.weight+2),b.weight+=2}return b}function o(a,s){a.forEach(l=>{l.vs=l.vs.flatMap(c=>s[c]?s[c].vs:c)})}function i(a,s){a.barycenter!==void 0?(a.barycenter=(a.barycenter*a.weight+s.barycenter*s.weight)/(a.weight+s.weight),a.weight+=s.weight):(a.barycenter=s.barycenter,a.weight=s.weight)}return nP}var rP,Rde;function B2t(){if(Rde)return rP;Rde=1;let e=Wl().Graph,t=gi();rP=n;function n(o,i,a){let s=r(o),l=new e({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(c=>o.node(c));return o.nodes().forEach(c=>{let u=o.node(c),d=o.parent(c);(u.rank===i||u.minRank<=i&&i<=u.maxRank)&&(l.setNode(c),l.setParent(c,d||s),o[a](c).forEach(h=>{let p=h.v===c?h.w:h.v,g=l.edge(p,c),y=g!==void 0?g.weight:0;l.setEdge(p,c,{weight:o.edge(h).weight+y})}),Object.hasOwn(u,"minRank")&&l.setNode(c,{borderLeft:u.borderLeft[i],borderRight:u.borderRight[i]}))}),l}function r(o){for(var i;o.hasNode(i=t.uniqueId("_root")););return i}return rP}var oP,Yde;function F2t(){if(Yde)return oP;Yde=1,oP=e;function e(t,n,r){let o={},i;r.forEach(a=>{let s=t.parent(a),l,c;for(;s;){if(l=t.parent(s),l?(c=o[l],o[l]=s):(c=i,i=s),c&&c!==s){n.setEdge(c,s);return}s=l}})}return oP}var iP,Xde;function j2t(){if(Xde)return iP;Xde=1;let e=M2t(),t=_2t(),n=L2t(),r=B2t(),o=F2t(),i=Wl().Graph,a=gi();iP=s;function s(d,h){if(h&&typeof h.customOrder=="function"){h.customOrder(d,s);return}let p=a.maxRank(d),g=l(d,a.range(1,p+1),"inEdges"),y=l(d,a.range(p-1,-1,-1),"outEdges"),v=e(d);if(u(d,v),h&&h.disableOptimalOrderHeuristic)return;let b=Number.POSITIVE_INFINITY,C;for(let S=0,E=0;E<4;++S,++E){c(S%2?g:y,S%4>=2),v=a.buildLayerMatrix(d);let x=t(d,v);x<b&&(E=0,C=Object.assign({},v),b=x)}u(d,C)}function l(d,h,p){return h.map(function(g){return r(d,g,p)})}function c(d,h){let p=new i;d.forEach(function(g){let y=g.graph().root,v=n(g,y,p,h);v.vs.forEach((b,C)=>g.node(b).order=C),o(g,p,v.vs)})}function u(d,h){Object.values(h).forEach(p=>p.forEach((g,y)=>d.node(g).order=y))}return iP}var aP,Zde;function z2t(){if(Zde)return aP;Zde=1;let e=Wl().Graph,t=gi();aP={positionX:p,findType1Conflicts:n,findType2Conflicts:r,addConflict:i,hasConflict:a,verticalAlignment:s,horizontalCompaction:l,alignCoordinates:d,findSmallestWidthAlignment:u,balance:h};function n(v,b){let C={};function S(E,x){let I=0,N=0,O=E.length,T=x[x.length-1];return x.forEach((M,_)=>{let L=o(v,M),P=L?v.node(L).order:O;(L||M===T)&&(x.slice(N,_+1).forEach($=>{v.predecessors($).forEach(B=>{let D=v.node(B),F=D.order;(F<I||P<F)&&!(D.dummy&&v.node($).dummy)&&i(C,B,$)})}),N=_+1,I=P)}),x}return b.length&&b.reduce(S),C}function r(v,b){let C={};function S(x,I,N,O,T){let M;t.range(I,N).forEach(_=>{M=x[_],v.node(M).dummy&&v.predecessors(M).forEach(L=>{let P=v.node(L);P.dummy&&(P.order<O||P.order>T)&&i(C,L,M)})})}function E(x,I){let N=-1,O,T=0;return I.forEach((M,_)=>{if(v.node(M).dummy==="border"){let L=v.predecessors(M);L.length&&(O=v.node(L[0]).order,S(I,T,_,N,O),T=_,N=O)}S(I,T,I.length,O,x.length)}),I}return b.length&&b.reduce(E),C}function o(v,b){if(v.node(b).dummy)return v.predecessors(b).find(C=>v.node(C).dummy)}function i(v,b,C){if(b>C){let E=b;b=C,C=E}let S=v[b];S||(v[b]=S={}),S[C]=!0}function a(v,b,C){if(b>C){let S=b;b=C,C=S}return!!v[b]&&Object.hasOwn(v[b],C)}function s(v,b,C,S){let E={},x={},I={};return b.forEach(N=>{N.forEach((O,T)=>{E[O]=O,x[O]=O,I[O]=T})}),b.forEach(N=>{let O=-1;N.forEach(T=>{let M=S(T);if(M.length){M=M.sort((L,P)=>I[L]-I[P]);let _=(M.length-1)/2;for(let L=Math.floor(_),P=Math.ceil(_);L<=P;++L){let $=M[L];x[T]===T&&O<I[$]&&!a(C,T,$)&&(x[$]=T,x[T]=E[T]=E[$],O=I[$])}}})}),{root:E,align:x}}function l(v,b,C,S,E){let x={},I=c(v,b,C,E),N=E?"borderLeft":"borderRight";function O(_,L){let P=I.nodes(),$=P.pop(),B={};for(;$;)B[$]?_($):(B[$]=!0,P.push($),P=P.concat(L($))),$=P.pop()}function T(_){x[_]=I.inEdges(_).reduce((L,P)=>Math.max(L,x[P.v]+I.edge(P)),0)}function M(_){let L=I.outEdges(_).reduce(($,B)=>Math.min($,x[B.w]-I.edge(B)),Number.POSITIVE_INFINITY),P=v.node(_);L!==Number.POSITIVE_INFINITY&&P.borderType!==N&&(x[_]=Math.max(x[_],L))}return O(T,I.predecessors.bind(I)),O(M,I.successors.bind(I)),Object.keys(S).forEach(_=>x[_]=x[C[_]]),x}function c(v,b,C,S){let E=new e,x=v.graph(),I=g(x.nodesep,x.edgesep,S);return b.forEach(N=>{let O;N.forEach(T=>{let M=C[T];if(E.setNode(M),O){var _=C[O],L=E.edge(_,M);E.setEdge(_,M,Math.max(I(v,T,O),L||0))}O=T})}),E}function u(v,b){return Object.values(b).reduce((C,S)=>{let E=Number.NEGATIVE_INFINITY,x=Number.POSITIVE_INFINITY;Object.entries(S).forEach(([N,O])=>{let T=y(v,N)/2;E=Math.max(O+T,E),x=Math.min(O-T,x)});const I=E-x;return I<C[0]&&(C=[I,S]),C},[Number.POSITIVE_INFINITY,null])[1]}function d(v,b){let C=Object.values(b),S=t.applyWithChunking(Math.min,C),E=t.applyWithChunking(Math.max,C);["u","d"].forEach(x=>{["l","r"].forEach(I=>{let N=x+I,O=v[N];if(O===b)return;let T=Object.values(O),M=S-t.applyWithChunking(Math.min,T);I!=="l"&&(M=E-t.applyWithChunking(Math.max,T)),M&&(v[N]=t.mapValues(O,_=>_+M))})})}function h(v,b){return t.mapValues(v.ul,(C,S)=>{if(b)return v[b.toLowerCase()][S];{let E=Object.values(v).map(x=>x[S]).sort((x,I)=>x-I);return(E[1]+E[2])/2}})}function p(v){let b=t.buildLayerMatrix(v),C=Object.assign(n(v,b),r(v,b)),S={},E;["u","d"].forEach(I=>{E=I==="u"?b:Object.values(b).reverse(),["l","r"].forEach(N=>{N==="r"&&(E=E.map(_=>Object.values(_).reverse()));let O=(I==="u"?v.predecessors:v.successors).bind(v),T=s(v,E,C,O),M=l(v,E,T.root,T.align,N==="r");N==="r"&&(M=t.mapValues(M,_=>-_)),S[I+N]=M})});let x=u(v,S);return d(S,x),h(S,v.graph().align)}function g(v,b,C){return(S,E,x)=>{let I=S.node(E),N=S.node(x),O=0,T;if(O+=I.width/2,Object.hasOwn(I,"labelpos"))switch(I.labelpos.toLowerCase()){case"l":T=-I.width/2;break;case"r":T=I.width/2;break}if(T&&(O+=C?T:-T),T=0,O+=(I.dummy?b:v)/2,O+=(N.dummy?b:v)/2,O+=N.width/2,Object.hasOwn(N,"labelpos"))switch(N.labelpos.toLowerCase()){case"l":T=N.width/2;break;case"r":T=-N.width/2;break}return T&&(O+=C?T:-T),T=0,O}}function y(v,b){return v.node(b).width}return aP}var sP,Jde;function V2t(){if(Jde)return sP;Jde=1;let e=gi(),t=z2t().positionX;sP=n;function n(o){o=e.asNonCompoundGraph(o),r(o),Object.entries(t(o)).forEach(([i,a])=>o.node(i).x=a)}function r(o){let i=e.buildLayerMatrix(o),a=o.graph().ranksep,s=0;i.forEach(l=>{const c=l.reduce((u,d)=>{const h=o.node(d).height;return u>h?u:h},0);l.forEach(u=>o.node(u).y=s+c/2),s+=c+a})}return sP}var lP,efe;function H2t(){if(efe)return lP;efe=1;let e=S2t(),t=w2t(),n=I2t(),r=gi().normalizeRanks,o=N2t(),i=gi().removeEmptyRanks,a=O2t(),s=T2t(),l=k2t(),c=j2t(),u=V2t(),d=gi(),h=Wl().Graph;lP=p;function p(H,K){let G=K&&K.debugTiming?d.time:d.notime;G("layout",()=>{let Y=G(" buildLayoutGraph",()=>O(H));G(" runLayout",()=>g(Y,G,K)),G(" updateInputGraph",()=>y(H,Y))})}function g(H,K,G){K(" makeSpaceForEdgeLabels",()=>T(H)),K(" removeSelfEdges",()=>z(H)),K(" acyclic",()=>e.run(H)),K(" nestingGraph.run",()=>a.run(H)),K(" rank",()=>n(d.asNonCompoundGraph(H))),K(" injectEdgeLabelProxies",()=>M(H)),K(" removeEmptyRanks",()=>i(H)),K(" nestingGraph.cleanup",()=>a.cleanup(H)),K(" normalizeRanks",()=>r(H)),K(" assignRankMinMax",()=>_(H)),K(" removeEdgeLabelProxies",()=>L(H)),K(" normalize.run",()=>t.run(H)),K(" parentDummyChains",()=>o(H)),K(" addBorderSegments",()=>s(H)),K(" order",()=>c(H,G)),K(" insertSelfEdges",()=>V(H)),K(" adjustCoordinateSystem",()=>l.adjust(H)),K(" position",()=>u(H)),K(" positionSelfEdges",()=>U(H)),K(" removeBorderNodes",()=>F(H)),K(" normalize.undo",()=>t.undo(H)),K(" fixupEdgeLabelCoords",()=>B(H)),K(" undoCoordinateSystem",()=>l.undo(H)),K(" translateGraph",()=>P(H)),K(" assignNodeIntersects",()=>$(H)),K(" reversePoints",()=>D(H)),K(" acyclic.undo",()=>e.undo(H))}function y(H,K){H.nodes().forEach(G=>{let Y=H.node(G),ne=K.node(G);Y&&(Y.x=ne.x,Y.y=ne.y,Y.rank=ne.rank,K.children(G).length&&(Y.width=ne.width,Y.height=ne.height))}),H.edges().forEach(G=>{let Y=H.edge(G),ne=K.edge(G);Y.points=ne.points,Object.hasOwn(ne,"x")&&(Y.x=ne.x,Y.y=ne.y)}),H.graph().width=K.graph().width,H.graph().height=K.graph().height}let v=["nodesep","edgesep","ranksep","marginx","marginy"],b={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},C=["acyclicer","ranker","rankdir","align"],S=["width","height","rank"],E={width:0,height:0},x=["minlen","weight","width","height","labeloffset"],I={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},N=["labelpos"];function O(H){let K=new h({multigraph:!0,compound:!0}),G=W(H.graph());return K.setGraph(Object.assign({},b,q(G,v),d.pick(G,C))),H.nodes().forEach(Y=>{let ne=W(H.node(Y));const Q=q(ne,S);Object.keys(E).forEach(ee=>{Q[ee]===void 0&&(Q[ee]=E[ee])}),K.setNode(Y,Q),K.setParent(Y,H.parent(Y))}),H.edges().forEach(Y=>{let ne=W(H.edge(Y));K.setEdge(Y,Object.assign({},I,q(ne,x),d.pick(ne,N)))}),K}function T(H){let K=H.graph();K.ranksep/=2,H.edges().forEach(G=>{let Y=H.edge(G);Y.minlen*=2,Y.labelpos.toLowerCase()!=="c"&&(K.rankdir==="TB"||K.rankdir==="BT"?Y.width+=Y.labeloffset:Y.height+=Y.labeloffset)})}function M(H){H.edges().forEach(K=>{let G=H.edge(K);if(G.width&&G.height){let Y=H.node(K.v),Q={rank:(H.node(K.w).rank-Y.rank)/2+Y.rank,e:K};d.addDummyNode(H,"edge-proxy",Q,"_ep")}})}function _(H){let K=0;H.nodes().forEach(G=>{let Y=H.node(G);Y.borderTop&&(Y.minRank=H.node(Y.borderTop).rank,Y.maxRank=H.node(Y.borderBottom).rank,K=Math.max(K,Y.maxRank))}),H.graph().maxRank=K}function L(H){H.nodes().forEach(K=>{let G=H.node(K);G.dummy==="edge-proxy"&&(H.edge(G.e).labelRank=G.rank,H.removeNode(K))})}function P(H){let K=Number.POSITIVE_INFINITY,G=0,Y=Number.POSITIVE_INFINITY,ne=0,Q=H.graph(),ee=Q.marginx||0,te=Q.marginy||0;function Z(J){let ae=J.x,re=J.y,pe=J.width,fe=J.height;K=Math.min(K,ae-pe/2),G=Math.max(G,ae+pe/2),Y=Math.min(Y,re-fe/2),ne=Math.max(ne,re+fe/2)}H.nodes().forEach(J=>Z(H.node(J))),H.edges().forEach(J=>{let ae=H.edge(J);Object.hasOwn(ae,"x")&&Z(ae)}),K-=ee,Y-=te,H.nodes().forEach(J=>{let ae=H.node(J);ae.x-=K,ae.y-=Y}),H.edges().forEach(J=>{let ae=H.edge(J);ae.points.forEach(re=>{re.x-=K,re.y-=Y}),Object.hasOwn(ae,"x")&&(ae.x-=K),Object.hasOwn(ae,"y")&&(ae.y-=Y)}),Q.width=G-K+ee,Q.height=ne-Y+te}function $(H){H.edges().forEach(K=>{let G=H.edge(K),Y=H.node(K.v),ne=H.node(K.w),Q,ee;G.points?(Q=G.points[0],ee=G.points[G.points.length-1]):(G.points=[],Q=ne,ee=Y),G.points.unshift(d.intersectRect(Y,Q)),G.points.push(d.intersectRect(ne,ee))})}function B(H){H.edges().forEach(K=>{let G=H.edge(K);if(Object.hasOwn(G,"x"))switch((G.labelpos==="l"||G.labelpos==="r")&&(G.width-=G.labeloffset),G.labelpos){case"l":G.x-=G.width/2+G.labeloffset;break;case"r":G.x+=G.width/2+G.labeloffset;break}})}function D(H){H.edges().forEach(K=>{let G=H.edge(K);G.reversed&&G.points.reverse()})}function F(H){H.nodes().forEach(K=>{if(H.children(K).length){let G=H.node(K),Y=H.node(G.borderTop),ne=H.node(G.borderBottom),Q=H.node(G.borderLeft[G.borderLeft.length-1]),ee=H.node(G.borderRight[G.borderRight.length-1]);G.width=Math.abs(ee.x-Q.x),G.height=Math.abs(ne.y-Y.y),G.x=Q.x+G.width/2,G.y=Y.y+G.height/2}}),H.nodes().forEach(K=>{H.node(K).dummy==="border"&&H.removeNode(K)})}function z(H){H.edges().forEach(K=>{if(K.v===K.w){var G=H.node(K.v);G.selfEdges||(G.selfEdges=[]),G.selfEdges.push({e:K,label:H.edge(K)}),H.removeEdge(K)}})}function V(H){var K=d.buildLayerMatrix(H);K.forEach(G=>{var Y=0;G.forEach((ne,Q)=>{var ee=H.node(ne);ee.order=Q+Y,(ee.selfEdges||[]).forEach(te=>{d.addDummyNode(H,"selfedge",{width:te.label.width,height:te.label.height,rank:ee.rank,order:Q+ ++Y,e:te.e,label:te.label},"_se")}),delete ee.selfEdges})})}function U(H){H.nodes().forEach(K=>{var G=H.node(K);if(G.dummy==="selfedge"){var Y=H.node(G.e.v),ne=Y.x+Y.width/2,Q=Y.y,ee=G.x-ne,te=Y.height/2;H.setEdge(G.e,G.label),H.removeNode(K),G.label.points=[{x:ne+2*ee/3,y:Q-te},{x:ne+5*ee/6,y:Q-te},{x:ne+ee,y:Q},{x:ne+5*ee/6,y:Q+te},{x:ne+2*ee/3,y:Q+te}],G.label.x=G.x,G.label.y=G.y}})}function q(H,K){return d.mapValues(d.pick(H,K),Number)}function W(H){var K={};return H&&Object.entries(H).forEach(([G,Y])=>{typeof G=="string"&&(G=G.toLowerCase()),K[G]=Y}),K}return lP}var cP,tfe;function W2t(){if(tfe)return cP;tfe=1;let e=gi(),t=Wl().Graph;cP={debugOrdering:n};function n(r){let o=e.buildLayerMatrix(r),i=new t({compound:!0,multigraph:!0}).setGraph({});return r.nodes().forEach(a=>{i.setNode(a,{label:a}),i.setParent(a,"layer"+r.node(a).rank)}),r.edges().forEach(a=>i.setEdge(a.v,a.w,{},a.name)),o.forEach((a,s)=>{let l="layer"+s;i.setNode(l,{rank:"same"}),a.reduce((c,u)=>(i.setEdge(c,u,{style:"invis"}),u))}),i}return cP}var uP,nfe;function K2t(){return nfe||(nfe=1,uP="1.1.5"),uP}var dP,rfe;function q2t(){return rfe||(rfe=1,dP={graphlib:Wl(),layout:H2t(),debug:W2t(),util:{time:gi().time,notime:gi().notime},version:K2t()}),dP}var U2t=q2t();const ofe=ta(U2t),G2t=()=>{const{getNodes:e,getEdges:t,setNodes:n,setEdges:r,fitView:o}=bn(),i=s=>{const l=document.querySelector(`[data-id="${s}"]`);if(!l)return{width:180,height:60};const c=l.getBoundingClientRect();return{width:Math.max(60,c.width),height:Math.max(30,c.height)}};return{layout:(s="LR")=>{const l=e(),c=t();l.length&&requestAnimationFrame(()=>{const u=s==="LR",d=new ofe.graphlib.Graph;d.setDefaultEdgeLabel(()=>({})),d.setGraph({rankdir:s,ranksep:120,nodesep:80}),l.forEach(p=>{const{width:g,height:y}=i(p.id);d.setNode(p.id,{width:g,height:y})}),c.forEach(p=>d.setEdge(p.source,p.target)),ofe.layout(d);const h=l.map(p=>{const g=d.node(p.id),{width:y,height:v}=i(p.id);return{...p,position:{x:g.x-y/2,y:g.y-v/2},targetPosition:u?"left":"top",sourcePosition:u?"right":"bottom"}});n(h),r(c),requestAnimationFrame(()=>o({duration:400,padding:.3}))})}}},ife={history:[],currentStep:-1,canUndo:!1,canRedo:!1},fP=e=>{try{const t=e.nodes.map(o=>({id:o.id,position:o.position})),n=e.edges.map(o=>({id:o.id,source:o.source,target:o.target})),r=e.viewport;return JSON.stringify({nodes:t,edges:n,viewport:r})}catch{return JSON.stringify(e)}},lb=Jue((e,t)=>({instances:{},pushSnapshot:(n,r)=>e(o=>{const i=o.instances[n]??ife,a=fP(r),s=i.history[i.currentStep];if(s&&fP(s)===a)return o;const l=i.history.slice(0,i.currentStep+1).concat(r),c=l.length-1;return{instances:{...o.instances,[n]:{history:l,currentStep:c,canUndo:c>0,canRedo:c<l.length-1}}}}),applySnapshot:(n,r)=>{const o=t().instances[n];return!o||r<0||r>=o.history.length?null:(e(i=>({instances:{...i.instances,[n]:{...o,currentStep:r,canUndo:r>0,canRedo:r<o.history.length-1}}})),o.history[r])},reset:(n,r)=>e(o=>({instances:{...o.instances,[n]:{history:r?[r]:[],currentStep:r?0:-1,canUndo:!1,canRedo:!1}}})),remove:n=>e(r=>{const{[n]:o,...i}=r.instances;return{instances:i}})}));function afe(e){const t=lb(a=>a.instances[e]??ife),n=lb(a=>a.pushSnapshot),r=lb(a=>a.applySnapshot),o=lb(a=>a.reset),i=lb(a=>a.remove);return{history:t.history,currentStep:t.currentStep,canUndo:t.canUndo,canRedo:t.canRedo,pushSnapshot:a=>n(e,a),undo:()=>r(e,t.currentStep-1),redo:()=>r(e,t.currentStep+1),goTo:a=>r(e,a),reset:a=>o(e,a),dispose:()=>i(e)}}const Q2t=e=>{const{canUndo:t,canRedo:n,undo:r,redo:o}=afe(e),{setNodes:i,setEdges:a,setViewport:s}=bn(),l=A.useCallback(d=>{d&&(i==null||i(d.nodes??[]),a==null||a(d.edges??[]),d.viewport&&(s==null||s(d.viewport)))},[i,a,s]),c=A.useCallback(()=>{if(!t)return;const d=r();l(d)},[t,r,l]),u=A.useCallback(()=>{if(!n)return;const d=o();l(d)},[n,o,l]);return{canUndo:t,canRedo:n,undo:c,redo:u}},R2t=(e,t)=>{const{getNodes:n,getEdges:r,getViewport:o}=bn(),{pushSnapshot:i}=afe(e),a=A.useRef(null),s=A.useRef(null),l=A.useRef(!1),c=t==null?void 0:t.snapshotDebounceMs,u=A.useCallback(()=>{const h={nodes:n()??[],edges:r()??[],viewport:o?o():null},p=fP(h);s.current!==p&&(s.current=p,i(h))},[n,r,o,i,e]),d=A.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=window.setTimeout(()=>{u(),a.current=null},c)},[c,u]);return A.useEffect(()=>{l.current||(l.current=!0,u())},[]),A.useEffect(()=>()=>{a.current&&window.clearTimeout(a.current)},[]),{takeSnapshotNow:u,takeSnapshotDebounced:d}};function Y2t(e){return wr({attr:{t:"1569683610100",viewBox:"0 0 1024 1024",version:"1.1"},child:[{tag:"path",attr:{d:"M841 370c3-3.3 2.7-8.3-0.6-11.3-1.5-1.3-3.4-2.1-5.3-2.1h-72.6c-2.4 0-4.6 1-6.1 2.8L633.5 504.6c-2.9 3.4-7.9 3.8-11.3 0.9-0.9-0.8-1.6-1.7-2.1-2.8l-63.5-141.3c-1.3-2.9-4.1-4.7-7.3-4.7H380.7l0.9-4.7 8-42.3c10.5-55.4 38-81.4 85.8-81.4 18.6 0 35.5 1.7 48.8 4.7l14.1-66.8c-22.6-4.7-35.2-6.1-54.9-6.1-103.3 0-156.4 44.3-175.9 147.3l-9.4 49.4h-97.6c-3.8 0-7.1 2.7-7.8 6.4L181.9 415c-0.9 4.3 1.9 8.6 6.2 9.5 0.5 0.1 1.1 0.2 1.6 0.2H284l-89 429.9c-0.9 4.3 1.9 8.6 6.2 9.5 0.5 0.1 1.1 0.2 1.6 0.2H269c3.8 0 7.1-2.7 7.8-6.4l89.7-433.1h135.8l68.2 139.1c1.4 2.9 1 6.4-1.2 8.8l-180.6 203c-2.9 3.3-2.6 8.4 0.7 11.3 1.5 1.3 3.4 2 5.3 2h72.7c2.4 0 4.6-1 6.1-2.8l123.7-146.7c2.8-3.4 7.9-3.8 11.3-1 0.9 0.8 1.6 1.7 2.1 2.8L676.4 784c1.3 2.8 4.1 4.7 7.3 4.7h64.6c4.4 0 8-3.6 8-8 0-1.2-0.3-2.4-0.8-3.5l-95.2-198.9c-1.4-2.9-0.9-6.4 1.3-8.8L841 370z"},child:[]}]})(e)}function X2t(e){return wr({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"},child:[]},{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"},child:[]}]})(e)}function Z2t(e){return wr({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M952 792H72c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h880c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0-632H72c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h880c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM848 660c8.8 0 16-7.2 16-16V380c0-8.8-7.2-16-16-16H176c-8.8 0-16 7.2-16 16v264c0 8.8 7.2 16 16 16h672zM232 436h560v152H232V436z"},child:[]}]})(e)}function J2t(e){return wr({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"},child:[]},{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"},child:[]}]})(e)}function eEt(e){return wr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M9 18h3v-2H9c-1.654 0-3-1.346-3-3s1.346-3 3-3h6v3l5-4-5-4v3H9c-2.757 0-5 2.243-5 5s2.243 5 5 5z"},child:[]}]})(e)}function tEt(e){return wr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M9 10h6c1.654 0 3 1.346 3 3s-1.346 3-3 3h-3v2h3c2.757 0 5-2.243 5-5s-2.243-5-5-5H9V5L4 9l5 4v-3z"},child:[]}]})(e)}function nEt(e){return wr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 3H4c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2h16c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2zm0 2 .001 4H4V5h16zM4 19v-8h16.001l.001 8H4z"},child:[]},{tag:"path",attr:{d:"M14 6h2v2h-2zm3 0h2v2h-2z"},child:[]}]})(e)}function rEt(e){return wr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 76c48.1 0 93.3 18.7 127.3 52.7S436 207.9 436 256s-18.7 93.3-52.7 127.3S304.1 436 256 436c-48.1 0-93.3-18.7-127.3-52.7S76 304.1 76 256s18.7-93.3 52.7-127.3S207.9 76 256 76m0-28C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"},child:[]},{tag:"path",attr:{d:"M256.7 160c37.5 0 63.3 20.8 63.3 50.7 0 19.8-9.6 33.5-28.1 44.4-17.4 10.1-23.3 17.5-23.3 30.3v7.9h-34.7l-.3-8.6c-1.7-20.6 5.5-33.4 23.6-44 16.9-10.1 24-16.5 24-28.9s-12-21.5-26.9-21.5c-15.1 0-26 9.8-26.8 24.6H192c.7-32.2 24.5-54.9 64.7-54.9zm-26.3 171.4c0-11.5 9.6-20.6 21.4-20.6 11.9 0 21.5 9 21.5 20.6s-9.6 20.6-21.5 20.6-21.4-9-21.4-20.6z"},child:[]}]})(e)}var oEt="scripts_editor_k7c3wx0",cf="scripts_editor_k7c3wx1",iEt="scripts_editor_k7c3wx2",hP="scripts_editor_k7c3wx3",aEt="scripts_editor_k7c3wx4";const sEt=()=>{const e=Rr(),[t,n]=A.useState(()=>e.getState().transform[2]);return A.useEffect(()=>{let r=e.getState().transform[2];return e.subscribe(i=>{const a=i.transform[2];a!==r&&(r=a,n(a))})},[e]),f.jsxs("span",{className:aEt,children:[Math.round(t*100)/2,"%"]})},lEt=A.memo(e=>{const{canUndo:t,canRedo:n,onUndo:r,onRedo:o,onLayout:i,onFitView:a,onZoomOut:s,onZoomIn:l,interactionMode:c,onToggleInteractionMode:u,isReadOnly:d,onOpenShortcutSettings:h}=e;return f.jsxs("div",{className:oEt,children:[f.jsx("button",{type:"button",disabled:!t||d,className:cf,onClick:r,children:f.jsx(tEt,{size:18})}),f.jsx("button",{type:"button",disabled:!n||d,className:cf,onClick:o,children:f.jsx(eEt,{size:18})}),f.jsx("div",{className:hP}),f.jsx("button",{type:"button",className:cf,onClick:i,children:f.jsx($He,{})}),f.jsx("button",{type:"button",className:cf,onClick:a,children:f.jsx(Z2t,{size:18})}),f.jsx("div",{className:hP}),f.jsx("button",{type:"button",className:cf,onClick:s,children:f.jsx(X2t,{size:18})}),f.jsx(sEt,{}),f.jsx("button",{type:"button",className:cf,onClick:l,children:f.jsx(J2t,{size:18})}),f.jsx("div",{className:hP}),f.jsx("button",{type:"button",className:`${cf} ${c==="trackpad"?iEt:""}`,onClick:u,children:f.jsx(nEt,{size:18})}),f.jsx("button",{type:"button",className:cf,onClick:h,children:f.jsx(rEt,{size:18})})]})});var pP,sfe;function lfe(){if(sfe)return pP;sfe=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,o=typeof r=="function"&&r.prototype||e;return n===o}return pP=t,pP}var gP,cfe;function cEt(){if(cfe)return gP;cfe=1;function e(t,n){return function(r){return t(n(r))}}return gP=e,gP}var mP,ufe;function uEt(){if(ufe)return mP;ufe=1;var e=cEt(),t=e(Object.keys,Object);return mP=t,mP}var vP,dfe;function dEt(){if(dfe)return vP;dfe=1;var e=lfe(),t=uEt(),n=Object.prototype,r=n.hasOwnProperty;function o(i){if(!e(i))return t(i);var a=[];for(var s in Object(i))r.call(i,s)&&s!="constructor"&&a.push(s);return a}return vP=o,vP}var yP,ffe;function hfe(){if(ffe)return yP;ffe=1;var e=Ry(),t=mx(),n="[object AsyncFunction]",r="[object Function]",o="[object GeneratorFunction]",i="[object Proxy]";function a(s){if(!t(s))return!1;var l=e(s);return l==r||l==o||l==n||l==i}return yP=a,yP}var bP,pfe;function fEt(){if(pfe)return bP;pfe=1;var e=Mu(),t=e["__core-js_shared__"];return bP=t,bP}var CP,gfe;function hEt(){if(gfe)return CP;gfe=1;var e=fEt(),t=function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function n(r){return!!t&&t in r}return CP=n,CP}var AP,mfe;function vfe(){if(mfe)return AP;mfe=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return AP=n,AP}var EP,yfe;function pEt(){if(yfe)return EP;yfe=1;var e=hfe(),t=hEt(),n=mx(),r=vfe(),o=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,a=Function.prototype,s=Object.prototype,l=a.toString,c=s.hasOwnProperty,u=RegExp("^"+l.call(c).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(h){if(!n(h)||t(h))return!1;var p=e(h)?u:i;return p.test(r(h))}return EP=d,EP}var SP,bfe;function gEt(){if(bfe)return SP;bfe=1;function e(t,n){return t==null?void 0:t[n]}return SP=e,SP}var wP,Cfe;function cb(){if(Cfe)return wP;Cfe=1;var e=pEt(),t=gEt();function n(r,o){var i=t(r,o);return e(i)?i:void 0}return wP=n,wP}var xP,Afe;function mEt(){if(Afe)return xP;Afe=1;var e=cb(),t=Mu(),n=e(t,"DataView");return xP=n,xP}var IP,Efe;function vEt(){if(Efe)return IP;Efe=1;var e=cb(),t=Mu(),n=e(t,"Map");return IP=n,IP}var NP,Sfe;function yEt(){if(Sfe)return NP;Sfe=1;var e=cb(),t=Mu(),n=e(t,"Promise");return NP=n,NP}var OP,wfe;function bEt(){if(wfe)return OP;wfe=1;var e=cb(),t=Mu(),n=e(t,"Set");return OP=n,OP}var TP,xfe;function CEt(){if(xfe)return TP;xfe=1;var e=cb(),t=Mu(),n=e(t,"WeakMap");return TP=n,TP}var kP,Ife;function AEt(){if(Ife)return kP;Ife=1;var e=mEt(),t=vEt(),n=yEt(),r=bEt(),o=CEt(),i=Ry(),a=vfe(),s="[object Map]",l="[object Object]",c="[object Promise]",u="[object Set]",d="[object WeakMap]",h="[object DataView]",p=a(e),g=a(t),y=a(n),v=a(r),b=a(o),C=i;return(e&&C(new e(new ArrayBuffer(1)))!=h||t&&C(new t)!=s||n&&C(n.resolve())!=c||r&&C(new r)!=u||o&&C(new o)!=d)&&(C=function(S){var E=i(S),x=E==l?S.constructor:void 0,I=x?a(x):"";if(I)switch(I){case p:return h;case g:return s;case y:return c;case v:return u;case b:return d}return E}),kP=C,kP}var MP,Nfe;function EEt(){if(Nfe)return MP;Nfe=1;var e=Ry(),t=vx(),n="[object Arguments]";function r(o){return t(o)&&e(o)==n}return MP=r,MP}var _P,Ofe;function SEt(){if(Ofe)return _P;Ofe=1;var e=EEt(),t=vx(),n=Object.prototype,r=n.hasOwnProperty,o=n.propertyIsEnumerable,i=e(function(){return arguments}())?e:function(a){return t(a)&&r.call(a,"callee")&&!o.call(a,"callee")};return _P=i,_P}var $P,Tfe;function wEt(){if(Tfe)return $P;Tfe=1;var e=Array.isArray;return $P=e,$P}var PP,kfe;function Mfe(){if(kfe)return PP;kfe=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return PP=t,PP}var DP,_fe;function xEt(){if(_fe)return DP;_fe=1;var e=hfe(),t=Mfe();function n(r){return r!=null&&t(r.length)&&!e(r)}return DP=n,DP}var ub={exports:{}},LP,$fe;function IEt(){if($fe)return LP;$fe=1;function e(){return!1}return LP=e,LP}ub.exports;var Pfe;function NEt(){return Pfe||(Pfe=1,function(e,t){var n=Mu(),r=IEt(),o=t&&!t.nodeType&&t,i=o&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===o,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,c=l||r;e.exports=c}(ub,ub.exports)),ub.exports}var BP,Dfe;function OEt(){if(Dfe)return BP;Dfe=1;var e=Ry(),t=Mfe(),n=vx(),r="[object Arguments]",o="[object Array]",i="[object Boolean]",a="[object Date]",s="[object Error]",l="[object Function]",c="[object Map]",u="[object Number]",d="[object Object]",h="[object RegExp]",p="[object Set]",g="[object String]",y="[object WeakMap]",v="[object ArrayBuffer]",b="[object DataView]",C="[object Float32Array]",S="[object Float64Array]",E="[object Int8Array]",x="[object Int16Array]",I="[object Int32Array]",N="[object Uint8Array]",O="[object Uint8ClampedArray]",T="[object Uint16Array]",M="[object Uint32Array]",_={};_[C]=_[S]=_[E]=_[x]=_[I]=_[N]=_[O]=_[T]=_[M]=!0,_[r]=_[o]=_[v]=_[i]=_[b]=_[a]=_[s]=_[l]=_[c]=_[u]=_[d]=_[h]=_[p]=_[g]=_[y]=!1;function L(P){return n(P)&&t(P.length)&&!!_[e(P)]}return BP=L,BP}var FP,Lfe;function TEt(){if(Lfe)return FP;Lfe=1;function e(t){return function(n){return t(n)}}return FP=e,FP}var db={exports:{}};db.exports;var Bfe;function kEt(){return Bfe||(Bfe=1,function(e,t){var n=xse(),r=t&&!t.nodeType&&t,o=r&&!0&&e&&!e.nodeType&&e,i=o&&o.exports===r,a=i&&n.process,s=function(){try{var l=o&&o.require&&o.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();e.exports=s}(db,db.exports)),db.exports}var jP,Ffe;function MEt(){if(Ffe)return jP;Ffe=1;var e=OEt(),t=TEt(),n=kEt(),r=n&&n.isTypedArray,o=r?t(r):e;return jP=o,jP}var zP,jfe;function _Et(){if(jfe)return zP;jfe=1;var e=dEt(),t=AEt(),n=SEt(),r=wEt(),o=xEt(),i=NEt(),a=lfe(),s=MEt(),l="[object Map]",c="[object Set]",u=Object.prototype,d=u.hasOwnProperty;function h(p){if(p==null)return!0;if(o(p)&&(r(p)||typeof p=="string"||typeof p.splice=="function"||i(p)||s(p)||n(p)))return!p.length;var g=t(p);if(g==l||g==c)return!p.size;if(a(p))return!e(p).length;for(var y in p)if(d.call(p,y))return!1;return!0}return zP=h,zP}var $Et=_Et();const PEt=ta($Et);var zfe="scripts_editor_ohkkdt0",Xx="scripts_editor_ohkkdt1",VP="scripts_editor_ohkkdt2",DEt="scripts_editor_ohkkdt3",Vfe="scripts_editor_ohkkdt4",Hfe="scripts_editor_ohkkdt5",LEt="scripts_editor_ohkkdt6",BEt="scripts_editor_ohkkdt7",FEt="scripts_editor_ohkkdt8";const Wfe=e=>f.jsx(Cn,{...e,direction:"vertical",size:10}),Kfe=A.memo(({keyId:e,Icon:t,label:n,active:r,color:o,isLongLabel:i,onDragStart:a})=>{const s=A.useCallback(l=>a(l,e),[a,e]);return f.jsxs(yt,{draggable:!0,type:"text",style:{minHeight:i?62:52},className:r?`${VP} ${DEt} `:`${VP}`,onDragStart:s,children:[f.jsx("span",{className:Vfe,style:{color:o},children:f.jsx(t,{})}),f.jsx("span",{className:Hfe,children:n})]},e)},(e,t)=>e.keyId===t.keyId&&e.label===t.label&&e.active===t.active&&e.color===t.color&&e.isLongLabel===t.isLongLabel&&e.onDragStart===t.onDragStart),jEt=()=>{const[e,t]=kx(),{BLOCKS_ENABLED:n}=Xt(),r=A.useCallback((s,l)=>{s.dataTransfer.effectAllowed="move",requestAnimationFrame(()=>t(l))},[t]),o=A.useCallback(s=>n==null?void 0:n.includes(s),[n]),i=A.useMemo(()=>vE.filter(s=>o(s.key)&&s.group===1),[o]),a=A.useMemo(()=>vE.filter(s=>o(s.key)&&s.group===2),[o]);return PEt(n)?null:f.jsxs("div",{className:zfe,children:[f.jsx(Ed,{className:Xx,wrapperTag:Wfe,children:i.map(s=>{const l=s.icon,c=s.active,u=s.label.includes(`
860
+ trong cuộc gọi`,children:f.jsx(OAt,{children:"Node toàn cục"})}),children:f.jsx(zi,{})})]})}),a?f.jsx("div",{id:"condition-condition-form-container",className:kKe}):null]})};var Que="scripts_editor_223f7c0",Rue="scripts_editor_223f7c2";const TAt=(e,t,n)=>{switch(e){case be.SPEAK:return{component:f.jsx($ce,{id:t}),title:"Cài đặt node nói"};case be.LISTEN:return{component:f.jsx(uce,{id:t}),title:"Cài đặt node nghe"};case be.TRANSFER:return{component:f.jsx(zce,{id:t}),title:"Cài đặt chuyển máy"};case be.DATA_CRM:return{component:f.jsx(Qle,{id:t}),title:n};case be.HTTP_REQUEST:return{component:f.jsx(nue,{id:t}),title:n};case be.CONDITION:return{component:f.jsx(Gue,{id:t}),title:"Cài đặt node điều kiện"};default:return null}},kAt=({id:e,sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:i,targetPosition:a,style:s,markerEnd:l})=>{const{mode:c}=Xt(),{isOpen:u,onOpen:d,onClose:h}=Eo(),{displayComponent:p}=Rn(),{setEdges:g,setNodes:y}=bn(),[v,b,C]=_C({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:a}),S=[...vE.filter(I=>I.key!==be.AGENT).map(I=>({label:f.jsxs(Cn,{align:"center",size:8,children:[A.createElement(I.icon,{style:{color:mc[I.key]}}),I.label]}),key:I.key}))],E=I=>{I.preventDefault(),d()},x=({key:I})=>{const N=I,O={id:`${N.toLowerCase()}_${Sh()}`,type:N,position:{x:b,y:C},data:{title:Jg[N],...I1(N)},deletable:!0,...N1[N]},T=wKe({blockType:N,nodeData:O.data});Mr.flushSync(()=>{y(_=>_.concat(O)),g(_=>{const L=_.find(z=>z.id===e);if(!L)return _;const{source:P,sourceHandle:$,target:B,targetHandle:D}=L,F=_.filter(z=>z.id!==e);return F.push({id:`${P}_${O.id}_${Sh()}`,source:P,sourceHandle:$,target:O.id,type:"autoCallButton"}),T!==null&&F.push({id:`${O.id}_${B}_${Sh()}`,source:O.id,sourceHandle:T,target:B,targetHandle:D,type:"autoCallButton"}),F}),h()});const M=TAt(N,O.id,O.data.title);M&&p(M.component,M.title,()=>{},O.id)};return f.jsxs(f.Fragment,{children:[f.jsx(Yp,{path:v,markerEnd:l,style:s??{}}),f.jsx(nj,{children:c!=="edit"?null:f.jsx(pr,{title:"Thêm nút",children:f.jsx("div",{className:`${Que} nodrag nopan ${u?Rue:""}`,style:{transform:`translate(-50%, -50%) translate(${b}px,${C}px)`},children:f.jsx(Fs,{onOpenChange:I=>{I?d():h()},menu:{items:S,onClick:x},open:u,trigger:["click"],children:f.jsx(yt,{onClick:E,type:"text",size:"large",style:{padding:4},children:f.jsx(y1,{style:{fontSize:24}})})})})})})]})},MAt=new Set([be.ACTION_CONTACT,be.ACTION_CRMORDER,be.ACTION_TICKET,be.CONTACT_ASSIGN,be.TRIGGER_TICKET,be.ACTION_ZNS,be.CONTACT_ASSIGN,be.TRIGGER_ZNS,be.TASK,be.EMAIL,be.DELAY,be.BRANCH,be.AI_AGENT,be.NOTIFICATION]),_At=new Set([be.ACTION_CONTACT,be.ACTION_CRMORDER,be.ACTION_TICKET,be.TRIGGER_TICKET,be.ACTION_ZNS,be.TRIGGER_ZNS,be.TASK,be.EMAIL,be.DELAY,be.AI_AGENT,be.NOTIFICATION]),$At=e=>!!e&&typeof e=="object"&&"id"in e&&typeof e.id=="string"&&"conditions"in e&&Array.isArray(e.conditions),PAt=e=>{if(!MAt.has(e))return null},DAt=({blockType:e,nodeId:t,nodeData:n})=>{if(!_At.has(e)){if(e===be.BRANCH){const i=[...(Array.isArray(n.groups)?n.groups:[]).filter($At).filter(a=>a.conditions.length>0).map(a=>a.id),`branch_group_default_${t}`];return i.length===1?i[0]:null}return null}},LAt={autoCallButton:kAt,autoFlowButton:e=>{const{id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:a,targetPosition:s,style:l,markerEnd:c}=e,{mode:u}=Xt(),{isOpen:d,onOpen:h,onClose:p}=Eo(),{setEdges:g,setNodes:y}=bn(),[v,b,C]=A.useMemo(()=>_C({sourceX:n,sourceY:r,sourcePosition:a,targetX:o,targetY:i,targetPosition:s}),[n,r,o,i,a,s]),S=A.useMemo(()=>JT.filter(O=>O.group!==1).map(O=>({key:O.key,label:f.jsxs(Cn,{align:"center",size:8,children:[f.jsx("span",{style:{color:O.color||mc[O.key]},children:f.jsx(O.icon,{...O.iconProps,size:20})}),f.jsx("span",{children:O.label})]}),children:O.items.map(T=>({key:T.key,label:f.jsxs(Cn,{align:"center",size:8,children:[f.jsx("span",{style:{color:T.color||mc[T.key]},children:f.jsx(T.icon,{...T.iconProps,size:14})}),f.jsx("span",{children:T.label})]})}))})),[]),E=A.useCallback(O=>({id:`${O.toLowerCase()}_${Sh()}`,type:O,position:{x:b,y:C},data:{title:Jg[O],...I1(O)},deletable:!0,...N1[O]}),[b,C]),x=A.useCallback(({key:O})=>{const T=O,M=E(T),_=PAt(T),L=DAt({blockType:T,nodeId:M.id,nodeData:M.data});y(P=>[...P,M]),g(P=>{const $=P.find(q=>q.id===t);if(!$)return P;const{source:B,sourceHandle:D,target:F,targetHandle:z}=$,V=Sh(),U=P.filter(q=>q.id!==t);return _!==null&&U.push({id:`${B}_${M.id}_${V}`,source:B,sourceHandle:D,target:M.id,targetHandle:_,type:"autoFlowButton"}),L!==null&&U.push({id:`${M.id}_${F}_${V}`,source:M.id,sourceHandle:L,target:F,targetHandle:z,type:"autoFlowButton"}),U}),p()},[t,E,y,g,p]),I=A.useCallback(O=>{O.preventDefault(),h()},[h]),N=A.useMemo(()=>({transform:`translate(-50%, -50%) translate(${b}px,${C}px)`}),[b,C]);return f.jsxs(f.Fragment,{children:[f.jsx(Yp,{path:v,markerEnd:c,style:l}),f.jsx(nj,{children:u!=="edit"?null:f.jsx(pr,{title:"Thêm nút",children:f.jsx("div",{className:`${Que} nodrag nopan ${d?Rue:""}`,style:N,children:f.jsx(Fs,{open:d,trigger:["click"],menu:{items:S,onClick:x},onOpenChange:O=>O?h():p(),children:f.jsx(yt,{onClick:I,type:"text",size:"large",style:{padding:4},children:f.jsx(y1,{style:{fontSize:24}})})})})})})]})}};function BAt(){const{getNodes:e,getEdges:t}=bn(),n=nb();return{isValidConnection:A.useCallback(o=>{const i=e(),a=t(),s=i.find(c=>c.id===o.target);return a.some(c=>c.source===o.source&&(c.sourceHandle?c.sourceHandle===o.sourceHandle:!0))?(n.error({key:"output-used",content:"Output này đã được nối rồi"}),!1):(s==null?void 0:s.id)===o.source?(n.error({key:"self-loop",content:"Không thể kết nối node vào chính nó"}),!1):!0},[t,e,n])}}const FAt=(e,t)=>!(!e||!t||e.type===be.START&&t.type!==be.SPEAK||e.type===be.LISTEN&&t.type!==be.SPEAK||t.type===be.LISTEN&&e.type!==be.SPEAK),jAt=()=>A.useCallback(({deletedNodeId:e,deletedNodeIds:t,edges:n,nodes:r,defaultEdgeType:o})=>{const i=n.filter(u=>u.target===e&&!t.has(u.source)),a=n.filter(u=>u.source===e&&!t.has(u.target));if(i.length!==1||a.length!==1)return null;const[s]=i,[l]=a;if(s.source===l.target)return null;const c=l.type||s.type||o;if(c==="autoCallButton"){const u=r.find(h=>h.id===s.source),d=r.find(h=>h.id===l.target);if(!FAt(u,d))return null}return{source:s.source,sourceHandle:s.sourceHandle??null,target:l.target,targetHandle:l.targetHandle??null,type:c}},[]),zAt=()=>{const e=jAt();return A.useCallback(({deletedNodes:t,edges:n,nodes:r,defaultEdgeType:o})=>{const i=new Set(t.map(a=>a.id));return t.flatMap(a=>{const s=e({deletedNodeId:a.id,deletedNodeIds:i,edges:n,nodes:r,defaultEdgeType:o});return s?[s]:[]})},[e])},VAt="UPDATE_CUSTOMERS_FROM_PREVIOUS_NODE",HAt=e=>typeof e=="string"?e?[e]:[]:(e==null?void 0:e.filter(t=>typeof t=="string"&&!!t))??[];function WAt(){const{getNodes:e,setNodes:t}=bn(),{mode:n}=Xt();A.useEffect(()=>{if(n!=="edit")return;const r=e(),o=new Map(r.filter(s=>s.type===be.ACTION_CALLBOT||s.type===be.TRIGGER_CALLBOT).map(s=>{var l;return[s.id,(l=s.data)==null?void 0:l.campaign_id]}));let i=!1;const a=r.map(s=>{var d,h,p,g;if(((d=s.data)==null?void 0:d.type)!==VAt)return s;const[l]=HAt((h=s.data)==null?void 0:h.call_campaign_customer),c=l?(p=sp(l))==null?void 0:p.object:void 0,u=c?o.get(c):void 0;return((g=s.data)==null?void 0:g.campaign_id)===u?s:(i=!0,{...s,data:{...s.data,campaign_id:u,update_fields:void 0}})});i&&t(a)})}const KAt=e=>A.useMemo(()=>e.map((t,n)=>{var o,i;const r=n+1;return{...t,data:{...t.data,order:r,output:Array.isArray((o=t.data)==null?void 0:o.output)?t.data.output.map(a=>({...a,order:r})):(i=t.data)==null?void 0:i.output}}}),[e]);function Yue(e){return wr({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20"},child:[]},{tag:"path",attr:{d:"M8 11h8"},child:[]},{tag:"path",attr:{d:"M8 7h6"},child:[]}]})(e)}const qAt={version:"1.37.5"};var yv=(e=>(e.BOT="bot",e.CLONE="clone",e))(yv||{});function u$(e){const t=e.getState(),{nodes:n,edges:r,transform:o}=t;return{nodes:n,edges:r,viewport:{x:o[0],y:o[1],zoom:o[2]}}}function UAt({cb:e,delay:t=1e3,enabled:n=!0}){const r=Rr(),o=A.useRef(e),i=A.useRef(u$(r)),a=A.useRef(i.current.viewport.zoom);A.useEffect(()=>{o.current=n?e:void 0},[e,n]);const s=A.useCallback(()=>{var y;if(!n)return;const u=u$(r),d=i.current,h=nt.isEqual(u.nodes,d.nodes),p=nt.isEqual(u.edges,d.edges),g=nt.isEqual(u.viewport,d.viewport);h&&p&&g||(i.current=u,a.current=u.viewport.zoom,(y=o.current)==null||y.call(o,u))},[r,n]),l=A.useMemo(()=>nt.debounce(s,t),[s,t]);A.useEffect(()=>{const u=r.subscribe(()=>l());return()=>{l.cancel(),u()}},[r,l]),VAe({onChange:({zoom:u})=>{n&&u!==a.current&&(a.current=u,l())}});const c=A.useCallback(()=>{const u=u$(r);i.current=u,a.current=u.viewport.zoom},[r]);return{commit:l,resetCommitState:c}}const Xue=e=>{let t;const n=new Set,r=(c,u)=>{const d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){const h=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(p=>p(t,h))}},o=()=>t,s={setState:r,getState:o,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(r,o,s);return s},GAt=e=>e?Xue(e):Xue,QAt=e=>e;function RAt(e,t=QAt){const n=A.useSyncExternalStore(e.subscribe,A.useCallback(()=>t(e.getState()),[e,t]),A.useCallback(()=>t(e.getInitialState()),[e,t]));return A.useDebugValue(n),n}const Zue=e=>{const t=GAt(e),n=r=>RAt(t,r);return Object.assign(n,t),n},Jue=e=>e?Zue(e):Zue,ede=Jue(e=>({mode:"trackpad",toggleMode:()=>e(t=>({mode:t.mode==="trackpad"?"mouse":"trackpad"}))}));function YAt(){const e=ede(o=>o.mode),t=ede(o=>o.toggleMode),{mode:n}=Xt(),r=A.useMemo(()=>({...e==="trackpad"?{panOnScroll:!0,panOnDrag:!1,zoomOnScroll:!1,zoomOnPinch:!0,zoomOnDoubleClick:!1}:{panOnScroll:!1,panOnDrag:!0,zoomOnScroll:!0,zoomOnPinch:!1,zoomOnDoubleClick:!1},...n==="history"?{nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0}:n==="view"?{nodesDraggable:!0,nodesConnectable:!1,elementsSelectable:!1}:{nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0}}),[e,n]);return{mode:e,toggleMode:t,flowProps:r}}const d$=1,tde="scripts-editor.shortcuts.v1",nde=["mod","shift","alt"],Qx=[{id:"undo",label:"Hoàn tác",description:"Hoàn tác thay đổi gần nhất của flow"},{id:"redo",label:"Làm lại",description:"Làm lại thao tác đã hoàn tác"},{id:"zoomIn",label:"Phóng to",description:"Tăng mức zoom của canvas"},{id:"zoomOut",label:"Thu nhỏ",description:"Giảm mức zoom của canvas"},{id:"fitView",label:"Vừa màn hình",description:"Canh lại toàn bộ flow vào vùng nhìn"},{id:"autoLayout",label:"Sắp xếp tự động",description:"Tự động căn chỉnh vị trí node"},{id:"deleteSelection",label:"Xoá vùng chọn",description:"Xoá node/edge đang được chọn"},{id:"toggleInteractionMode",label:"Đổi chế độ tương tác",description:"Chuyển trackpad/mouse"}],f$=Qx.map(e=>e.id),h$={undo:"mod+z",redo:"mod+shift+z",zoomIn:"mod+=",zoomOut:"mod+-",fitView:"mod+0",autoLayout:"mod+shift+a",deleteSelection:"mod+backspace",toggleInteractionMode:"mod+shift+m"},XAt=new Set(["zoomIn","zoomOut"]),ZAt=new Set(["undo","redo","zoomIn","zoomOut","fitView"]),JAt=new Set(["undo","redo","autoLayout","deleteSelection"]),rde=e=>{var r;const t=(r=e==null?void 0:e.trim())==null?void 0:r.toLowerCase();return t?{esc:"escape",del:"delete",return:"enter",spacebar:"space"," ":"space",plus:"=","+":"=",minus:"-",_:"-"}[t]??t:null},ode=e=>{const t=rde(e.key);if(t)return t;switch(e.code){case"Equal":return"=";case"Minus":return"-";case"Digit0":return"0";default:return null}},Rx=e=>{const t=e.split("+").map(r=>r.trim().toLowerCase()).filter(Boolean);if(!t.length)return null;const n={mod:!1,shift:!1,alt:!1,key:""};for(const r of t){if(r==="mod"||r==="shift"||r==="alt"){if(n[r])return null;n[r]=!0;continue}const o=rde(r);if(!o||n.key)return null;n.key=o}return n.key?n:null},p$=e=>e.mod||e.alt,g$=e=>[...nde.filter(n=>e[n]),e.key].join("+"),e2t=e=>{const t=Rx(e);return!t||!p$(t)?null:g$(t)},t2t=e=>{const t=ode(e);if(!t||t==="meta"||t==="control"||t==="shift"||t==="alt")return null;const n={mod:e.metaKey||e.ctrlKey,shift:e.shiftKey,alt:e.altKey,key:t};return p$(n)?g$(n):null},n2t=(e,t)=>{const n=e.metaKey||e.ctrlKey,r=ode(e);return!r||n!==t.mod||e.altKey!==t.alt||t.shift&&!e.shiftKey||!t.shift&&e.shiftKey&&!(t.key==="="&&e.code==="Equal"||t.key==="-"&&e.code==="Minus")?!1:r===t.key},r2t=e=>{const t=Rx(e);if(!t)return e;const r={mod:typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/i.test(navigator.platform)?"Cmd":"Ctrl",shift:"Shift",alt:"Alt",backspace:"Backspace",delete:"Delete",escape:"Esc",enter:"Enter",space:"Space"},o=r[t.key]??t.key.toUpperCase();return[...nde.filter(a=>t[a]).map(a=>r[a]??a),o].join(" + ")},m$=e=>f$.reduce((t,n)=>{const r=e==null?void 0:e[n],o=r?e2t(r):null;return t[n]=o??h$[n],t},{}),o2t=e=>{const t={},n={};for(const o of f$){const i=e[o];if(!i){t[o]="Vui lòng nhập phím tắt";continue}const a=Rx(i);if(!a||!p$(a)){t[o]="Phím tắt phải có Ctrl/Cmd hoặc Alt";continue}n[o]=g$(a)}const r=new Map;for(const o of f$){const i=n[o];if(!i)continue;const a=r.get(i)??[];a.push(o),r.set(i,a)}for(const[,o]of r){if(o.length<2)continue;const i=o.map(a=>{var s;return((s=Qx.find(l=>l.id===a))==null?void 0:s.label)??a}).join(", ");for(const a of o)t[a]=`Phím tắt đang bị trùng (${i})`}return{isValid:Object.keys(t).length===0,errors:t,normalizedBindings:m$(n)}},v$=()=>({version:d$,bindings:{...h$}}),i2t=()=>{if(typeof window>"u")return v$();try{const e=window.localStorage.getItem(tde);if(!e)return v$();const t=JSON.parse(e),n=m$(t==null?void 0:t.bindings);return{version:d$,bindings:n}}catch{return v$()}},a2t=e=>{if(typeof window>"u")return;const t={version:d$,bindings:m$(e.bindings)};window.localStorage.setItem(tde,JSON.stringify(t))},s2t=e=>{if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;const t=e.tagName.toLowerCase();return t==="input"||t==="textarea"||t==="select"?!0:!!e.closest("[contenteditable='true'], [role='textbox']")},l2t=({mode:e,bindings:t,handlers:n,suspended:r=!1,onReadonlyActionBlocked:o})=>{const i=A.useMemo(()=>Object.entries(t).map(([a,s])=>({actionId:a,parsedBinding:Rx(s)})).filter(a=>!!a.parsedBinding),[t]);A.useEffect(()=>{if(r)return;const a=s=>{var c;if(s.defaultPrevented)return;const l=i.find(u=>u.parsedBinding?n2t(s,u.parsedBinding):!1);if(l&&!(s2t(s.target)&&!ZAt.has(l.actionId))&&!(s.repeat&&!XAt.has(l.actionId))){if(s.preventDefault(),e!=="edit"&&JAt.has(l.actionId)){o==null||o(l.actionId);return}(c=n[l.actionId])==null||c.call(n)}};return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[n,e,o,i,r])};var y$,ide;function b$(){if(ide)return y$;ide=1;var e="\0",t="\0",n="";class r{constructor(u){ni(this,"_isDirected",!0);ni(this,"_isMultigraph",!1);ni(this,"_isCompound",!1);ni(this,"_label");ni(this,"_defaultNodeLabelFn",()=>{});ni(this,"_defaultEdgeLabelFn",()=>{});ni(this,"_nodes",{});ni(this,"_in",{});ni(this,"_preds",{});ni(this,"_out",{});ni(this,"_sucs",{});ni(this,"_edgeObjs",{});ni(this,"_edgeLabels",{});ni(this,"_nodeCount",0);ni(this,"_edgeCount",0);ni(this,"_parent");ni(this,"_children");u&&(this._isDirected=Object.hasOwn(u,"directed")?u.directed:!0,this._isMultigraph=Object.hasOwn(u,"multigraph")?u.multigraph:!1,this._isCompound=Object.hasOwn(u,"compound")?u.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(u){return this._label=u,this}graph(){return this._label}setDefaultNodeLabel(u){return this._defaultNodeLabelFn=u,typeof u!="function"&&(this._defaultNodeLabelFn=()=>u),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var u=this;return this.nodes().filter(d=>Object.keys(u._in[d]).length===0)}sinks(){var u=this;return this.nodes().filter(d=>Object.keys(u._out[d]).length===0)}setNodes(u,d){var h=arguments,p=this;return u.forEach(function(g){h.length>1?p.setNode(g,d):p.setNode(g)}),this}setNode(u,d){return Object.hasOwn(this._nodes,u)?(arguments.length>1&&(this._nodes[u]=d),this):(this._nodes[u]=arguments.length>1?d:this._defaultNodeLabelFn(u),this._isCompound&&(this._parent[u]=t,this._children[u]={},this._children[t][u]=!0),this._in[u]={},this._preds[u]={},this._out[u]={},this._sucs[u]={},++this._nodeCount,this)}node(u){return this._nodes[u]}hasNode(u){return Object.hasOwn(this._nodes,u)}removeNode(u){var d=this;if(Object.hasOwn(this._nodes,u)){var h=p=>d.removeEdge(d._edgeObjs[p]);delete this._nodes[u],this._isCompound&&(this._removeFromParentsChildList(u),delete this._parent[u],this.children(u).forEach(function(p){d.setParent(p)}),delete this._children[u]),Object.keys(this._in[u]).forEach(h),delete this._in[u],delete this._preds[u],Object.keys(this._out[u]).forEach(h),delete this._out[u],delete this._sucs[u],--this._nodeCount}return this}setParent(u,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(d===void 0)d=t;else{d+="";for(var h=d;h!==void 0;h=this.parent(h))if(h===u)throw new Error("Setting "+d+" as parent of "+u+" would create a cycle");this.setNode(d)}return this.setNode(u),this._removeFromParentsChildList(u),this._parent[u]=d,this._children[d][u]=!0,this}_removeFromParentsChildList(u){delete this._children[this._parent[u]][u]}parent(u){if(this._isCompound){var d=this._parent[u];if(d!==t)return d}}children(u=t){if(this._isCompound){var d=this._children[u];if(d)return Object.keys(d)}else{if(u===t)return this.nodes();if(this.hasNode(u))return[]}}predecessors(u){var d=this._preds[u];if(d)return Object.keys(d)}successors(u){var d=this._sucs[u];if(d)return Object.keys(d)}neighbors(u){var d=this.predecessors(u);if(d){const p=new Set(d);for(var h of this.successors(u))p.add(h);return Array.from(p.values())}}isLeaf(u){var d;return this.isDirected()?d=this.successors(u):d=this.neighbors(u),d.length===0}filterNodes(u){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var h=this;Object.entries(this._nodes).forEach(function([y,v]){u(y)&&d.setNode(y,v)}),Object.values(this._edgeObjs).forEach(function(y){d.hasNode(y.v)&&d.hasNode(y.w)&&d.setEdge(y,h.edge(y))});var p={};function g(y){var v=h.parent(y);return v===void 0||d.hasNode(v)?(p[y]=v,v):v in p?p[v]:g(v)}return this._isCompound&&d.nodes().forEach(y=>d.setParent(y,g(y))),d}setDefaultEdgeLabel(u){return this._defaultEdgeLabelFn=u,typeof u!="function"&&(this._defaultEdgeLabelFn=()=>u),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(u,d){var h=this,p=arguments;return u.reduce(function(g,y){return p.length>1?h.setEdge(g,y,d):h.setEdge(g,y),y}),this}setEdge(){var u,d,h,p,g=!1,y=arguments[0];typeof y=="object"&&y!==null&&"v"in y?(u=y.v,d=y.w,h=y.name,arguments.length===2&&(p=arguments[1],g=!0)):(u=y,d=arguments[1],h=arguments[3],arguments.length>2&&(p=arguments[2],g=!0)),u=""+u,d=""+d,h!==void 0&&(h=""+h);var v=a(this._isDirected,u,d,h);if(Object.hasOwn(this._edgeLabels,v))return g&&(this._edgeLabels[v]=p),this;if(h!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(u),this.setNode(d),this._edgeLabels[v]=g?p:this._defaultEdgeLabelFn(u,d,h);var b=s(this._isDirected,u,d,h);return u=b.v,d=b.w,Object.freeze(b),this._edgeObjs[v]=b,o(this._preds[d],u),o(this._sucs[u],d),this._in[d][v]=b,this._out[u][v]=b,this._edgeCount++,this}edge(u,d,h){var p=arguments.length===1?l(this._isDirected,arguments[0]):a(this._isDirected,u,d,h);return this._edgeLabels[p]}edgeAsObj(){const u=this.edge(...arguments);return typeof u!="object"?{label:u}:u}hasEdge(u,d,h){var p=arguments.length===1?l(this._isDirected,arguments[0]):a(this._isDirected,u,d,h);return Object.hasOwn(this._edgeLabels,p)}removeEdge(u,d,h){var p=arguments.length===1?l(this._isDirected,arguments[0]):a(this._isDirected,u,d,h),g=this._edgeObjs[p];return g&&(u=g.v,d=g.w,delete this._edgeLabels[p],delete this._edgeObjs[p],i(this._preds[d],u),i(this._sucs[u],d),delete this._in[d][p],delete this._out[u][p],this._edgeCount--),this}inEdges(u,d){var h=this._in[u];if(h){var p=Object.values(h);return d?p.filter(g=>g.v===d):p}}outEdges(u,d){var h=this._out[u];if(h){var p=Object.values(h);return d?p.filter(g=>g.w===d):p}}nodeEdges(u,d){var h=this.inEdges(u,d);if(h)return h.concat(this.outEdges(u,d))}}function o(c,u){c[u]?c[u]++:c[u]=1}function i(c,u){--c[u]||delete c[u]}function a(c,u,d,h){var p=""+u,g=""+d;if(!c&&p>g){var y=p;p=g,g=y}return p+n+g+n+(h===void 0?e:h)}function s(c,u,d,h){var p=""+u,g=""+d;if(!c&&p>g){var y=p;p=g,g=y}var v={v:p,w:g};return h&&(v.name=h),v}function l(c,u){return a(c,u.v,u.w,u.name)}return y$=r,y$}var C$,ade;function c2t(){return ade||(ade=1,C$="2.2.4"),C$}var A$,sde;function u2t(){return sde||(sde=1,A$={Graph:b$(),version:c2t()}),A$}var E$,lde;function d2t(){if(lde)return E$;lde=1;var e=b$();E$={write:t,read:o};function t(i){var a={options:{directed:i.isDirected(),multigraph:i.isMultigraph(),compound:i.isCompound()},nodes:n(i),edges:r(i)};return i.graph()!==void 0&&(a.value=structuredClone(i.graph())),a}function n(i){return i.nodes().map(function(a){var s=i.node(a),l=i.parent(a),c={v:a};return s!==void 0&&(c.value=s),l!==void 0&&(c.parent=l),c})}function r(i){return i.edges().map(function(a){var s=i.edge(a),l={v:a.v,w:a.w};return a.name!==void 0&&(l.name=a.name),s!==void 0&&(l.value=s),l})}function o(i){var a=new e(i.options).setGraph(i.value);return i.nodes.forEach(function(s){a.setNode(s.v,s.value),s.parent&&a.setParent(s.v,s.parent)}),i.edges.forEach(function(s){a.setEdge({v:s.v,w:s.w,name:s.name},s.value)}),a}return E$}var S$,cde;function f2t(){if(cde)return S$;cde=1,S$=e;function e(t){var n={},r=[],o;function i(a){Object.hasOwn(n,a)||(n[a]=!0,o.push(a),t.successors(a).forEach(i),t.predecessors(a).forEach(i))}return t.nodes().forEach(function(a){o=[],i(a),o.length&&r.push(o)}),r}return S$}var w$,ude;function dde(){if(ude)return w$;ude=1;class e{constructor(){ni(this,"_arr",[]);ni(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(n){return n.key})}has(n){return Object.hasOwn(this._keyIndices,n)}priority(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(n,r){var o=this._keyIndices;if(n=String(n),!Object.hasOwn(o,n)){var i=this._arr,a=i.length;return o[n]=a,i.push({key:n,priority:r}),this._decrease(a),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key}decrease(n,r){var o=this._keyIndices[n];if(r>this._arr[o].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[o].priority+" New: "+r);this._arr[o].priority=r,this._decrease(o)}_heapify(n){var r=this._arr,o=2*n,i=o+1,a=n;o<r.length&&(a=r[o].priority<r[a].priority?o:a,i<r.length&&(a=r[i].priority<r[a].priority?i:a),a!==n&&(this._swap(n,a),this._heapify(a)))}_decrease(n){for(var r=this._arr,o=r[n].priority,i;n!==0&&(i=n>>1,!(r[i].priority<o));)this._swap(n,i),n=i}_swap(n,r){var o=this._arr,i=this._keyIndices,a=o[n],s=o[r];o[n]=s,o[r]=a,i[s.key]=n,i[a.key]=r}}return w$=e,w$}var x$,fde;function hde(){if(fde)return x$;fde=1;var e=dde();x$=n;var t=()=>1;function n(o,i,a,s){return r(o,String(i),a||t,s||function(l){return o.outEdges(l)})}function r(o,i,a,s){var l={},c=new e,u,d,h=function(p){var g=p.v!==u?p.v:p.w,y=l[g],v=a(p),b=d.distance+v;if(v<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+v);b<y.distance&&(y.distance=b,y.predecessor=u,c.decrease(g,b))};for(o.nodes().forEach(function(p){var g=p===i?0:Number.POSITIVE_INFINITY;l[p]={distance:g},c.add(p,g)});c.size()>0&&(u=c.removeMin(),d=l[u],d.distance!==Number.POSITIVE_INFINITY);)s(u).forEach(h);return l}return x$}var I$,pde;function h2t(){if(pde)return I$;pde=1;var e=hde();I$=t;function t(n,r,o){return n.nodes().reduce(function(i,a){return i[a]=e(n,a,r,o),i},{})}return I$}var N$,gde;function mde(){if(gde)return N$;gde=1,N$=e;function e(t){var n=0,r=[],o={},i=[];function a(s){var l=o[s]={onStack:!0,lowlink:n,index:n++};if(r.push(s),t.successors(s).forEach(function(d){Object.hasOwn(o,d)?o[d].onStack&&(l.lowlink=Math.min(l.lowlink,o[d].index)):(a(d),l.lowlink=Math.min(l.lowlink,o[d].lowlink))}),l.lowlink===l.index){var c=[],u;do u=r.pop(),o[u].onStack=!1,c.push(u);while(s!==u);i.push(c)}}return t.nodes().forEach(function(s){Object.hasOwn(o,s)||a(s)}),i}return N$}var O$,vde;function p2t(){if(vde)return O$;vde=1;var e=mde();O$=t;function t(n){return e(n).filter(function(r){return r.length>1||r.length===1&&n.hasEdge(r[0],r[0])})}return O$}var T$,yde;function g2t(){if(yde)return T$;yde=1,T$=t;var e=()=>1;function t(r,o,i){return n(r,o||e,i||function(a){return r.outEdges(a)})}function n(r,o,i){var a={},s=r.nodes();return s.forEach(function(l){a[l]={},a[l][l]={distance:0},s.forEach(function(c){l!==c&&(a[l][c]={distance:Number.POSITIVE_INFINITY})}),i(l).forEach(function(c){var u=c.v===l?c.w:c.v,d=o(c);a[l][u]={distance:d,predecessor:l}})}),s.forEach(function(l){var c=a[l];s.forEach(function(u){var d=a[u];s.forEach(function(h){var p=d[l],g=c[h],y=d[h],v=p.distance+g.distance;v<y.distance&&(y.distance=v,y.predecessor=g.predecessor)})})}),a}return T$}var k$,bde;function Cde(){if(bde)return k$;bde=1;function e(n){var r={},o={},i=[];function a(s){if(Object.hasOwn(o,s))throw new t;Object.hasOwn(r,s)||(o[s]=!0,r[s]=!0,n.predecessors(s).forEach(a),delete o[s],i.push(s))}if(n.sinks().forEach(a),Object.keys(r).length!==n.nodeCount())throw new t;return i}class t extends Error{constructor(){super(...arguments)}}return k$=e,e.CycleException=t,k$}var M$,Ade;function m2t(){if(Ade)return M$;Ade=1;var e=Cde();M$=t;function t(n){try{e(n)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}return M$}var _$,Ede;function Sde(){if(Ede)return _$;Ede=1,_$=e;function e(o,i,a){Array.isArray(i)||(i=[i]);var s=o.isDirected()?d=>o.successors(d):d=>o.neighbors(d),l=a==="post"?t:n,c=[],u={};return i.forEach(d=>{if(!o.hasNode(d))throw new Error("Graph does not have node: "+d);l(d,s,u,c)}),c}function t(o,i,a,s){for(var l=[[o,!1]];l.length>0;){var c=l.pop();c[1]?s.push(c[0]):Object.hasOwn(a,c[0])||(a[c[0]]=!0,l.push([c[0],!0]),r(i(c[0]),u=>l.push([u,!1])))}}function n(o,i,a,s){for(var l=[o];l.length>0;){var c=l.pop();Object.hasOwn(a,c)||(a[c]=!0,s.push(c),r(i(c),u=>l.push(u)))}}function r(o,i){for(var a=o.length;a--;)i(o[a],a,o);return o}return _$}var $$,wde;function v2t(){if(wde)return $$;wde=1;var e=Sde();$$=t;function t(n,r){return e(n,r,"post")}return $$}var P$,xde;function y2t(){if(xde)return P$;xde=1;var e=Sde();P$=t;function t(n,r){return e(n,r,"pre")}return P$}var D$,Ide;function b2t(){if(Ide)return D$;Ide=1;var e=b$(),t=dde();D$=n;function n(r,o){var i=new e,a={},s=new t,l;function c(d){var h=d.v===l?d.w:d.v,p=s.priority(h);if(p!==void 0){var g=o(d);g<p&&(a[h]=l,s.decrease(h,g))}}if(r.nodeCount()===0)return i;r.nodes().forEach(function(d){s.add(d,Number.POSITIVE_INFINITY),i.setNode(d)}),s.decrease(r.nodes()[0],0);for(var u=!1;s.size()>0;){if(l=s.removeMin(),Object.hasOwn(a,l))i.setEdge(l,a[l]);else{if(u)throw new Error("Input graph is not connected: "+r);u=!0}r.nodeEdges(l).forEach(c)}return i}return D$}var L$,Nde;function C2t(){return Nde||(Nde=1,L$={components:f2t(),dijkstra:hde(),dijkstraAll:h2t(),findCycles:p2t(),floydWarshall:g2t(),isAcyclic:m2t(),postorder:v2t(),preorder:y2t(),prim:b2t(),tarjan:mde(),topsort:Cde()}),L$}var B$,Ode;function Wl(){if(Ode)return B$;Ode=1;var e=u2t();return B$={Graph:e.Graph,json:d2t(),alg:C2t(),version:e.version},B$}var F$,Tde;function A2t(){if(Tde)return F$;Tde=1;class e{constructor(){let o={};o._next=o._prev=o,this._sentinel=o}dequeue(){let o=this._sentinel,i=o._prev;if(i!==o)return t(i),i}enqueue(o){let i=this._sentinel;o._prev&&o._next&&t(o),o._next=i._next,i._next._prev=o,i._next=o,o._prev=i}toString(){let o=[],i=this._sentinel,a=i._prev;for(;a!==i;)o.push(JSON.stringify(a,n)),a=a._prev;return"["+o.join(", ")+"]"}}function t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function n(r,o){if(r!=="_next"&&r!=="_prev")return o}return F$=e,F$}var j$,kde;function E2t(){if(kde)return j$;kde=1;let e=Wl().Graph,t=A2t();j$=r;let n=()=>1;function r(c,u){if(c.nodeCount()<=1)return[];let d=a(c,u||n);return o(d.graph,d.buckets,d.zeroIdx).flatMap(p=>c.outEdges(p.v,p.w))}function o(c,u,d){let h=[],p=u[u.length-1],g=u[0],y;for(;c.nodeCount();){for(;y=g.dequeue();)i(c,u,d,y);for(;y=p.dequeue();)i(c,u,d,y);if(c.nodeCount()){for(let v=u.length-2;v>0;--v)if(y=u[v].dequeue(),y){h=h.concat(i(c,u,d,y,!0));break}}}return h}function i(c,u,d,h,p){let g=p?[]:void 0;return c.inEdges(h.v).forEach(y=>{let v=c.edge(y),b=c.node(y.v);p&&g.push({v:y.v,w:y.w}),b.out-=v,s(u,d,b)}),c.outEdges(h.v).forEach(y=>{let v=c.edge(y),b=y.w,C=c.node(b);C.in-=v,s(u,d,C)}),c.removeNode(h.v),g}function a(c,u){let d=new e,h=0,p=0;c.nodes().forEach(v=>{d.setNode(v,{v,in:0,out:0})}),c.edges().forEach(v=>{let b=d.edge(v.v,v.w)||0,C=u(v),S=b+C;d.setEdge(v.v,v.w,S),p=Math.max(p,d.node(v.v).out+=C),h=Math.max(h,d.node(v.w).in+=C)});let g=l(p+h+3).map(()=>new t),y=h+1;return d.nodes().forEach(v=>{s(g,y,d.node(v))}),{graph:d,buckets:g,zeroIdx:y}}function s(c,u,d){d.out?d.in?c[d.out-d.in+u].enqueue(d):c[c.length-1].enqueue(d):c[0].enqueue(d)}function l(c){const u=[];for(let d=0;d<c;d++)u.push(d);return u}return j$}var z$,Mde;function gi(){if(Mde)return z$;Mde=1;let e=Wl().Graph;z$={addBorderNode:u,addDummyNode:t,applyWithChunking:p,asNonCompoundGraph:r,buildLayerMatrix:s,intersectRect:a,mapValues:I,maxRank:g,normalizeRanks:l,notime:b,partition:y,pick:x,predecessorWeights:i,range:E,removeEmptyRanks:c,simplify:n,successorWeights:o,time:v,uniqueId:S,zipObject:N};function t(O,T,M,_){for(var L=_;O.hasNode(L);)L=S(_);return M.dummy=T,O.setNode(L,M),L}function n(O){let T=new e().setGraph(O.graph());return O.nodes().forEach(M=>T.setNode(M,O.node(M))),O.edges().forEach(M=>{let _=T.edge(M.v,M.w)||{weight:0,minlen:1},L=O.edge(M);T.setEdge(M.v,M.w,{weight:_.weight+L.weight,minlen:Math.max(_.minlen,L.minlen)})}),T}function r(O){let T=new e({multigraph:O.isMultigraph()}).setGraph(O.graph());return O.nodes().forEach(M=>{O.children(M).length||T.setNode(M,O.node(M))}),O.edges().forEach(M=>{T.setEdge(M,O.edge(M))}),T}function o(O){let T=O.nodes().map(M=>{let _={};return O.outEdges(M).forEach(L=>{_[L.w]=(_[L.w]||0)+O.edge(L).weight}),_});return N(O.nodes(),T)}function i(O){let T=O.nodes().map(M=>{let _={};return O.inEdges(M).forEach(L=>{_[L.v]=(_[L.v]||0)+O.edge(L).weight}),_});return N(O.nodes(),T)}function a(O,T){let M=O.x,_=O.y,L=T.x-M,P=T.y-_,$=O.width/2,B=O.height/2;if(!L&&!P)throw new Error("Not possible to find intersection inside of the rectangle");let D,F;return Math.abs(P)*$>Math.abs(L)*B?(P<0&&(B=-B),D=B*L/P,F=B):(L<0&&($=-$),D=$,F=$*P/L),{x:M+D,y:_+F}}function s(O){let T=E(g(O)+1).map(()=>[]);return O.nodes().forEach(M=>{let _=O.node(M),L=_.rank;L!==void 0&&(T[L][_.order]=M)}),T}function l(O){let T=O.nodes().map(_=>{let L=O.node(_).rank;return L===void 0?Number.MAX_VALUE:L}),M=p(Math.min,T);O.nodes().forEach(_=>{let L=O.node(_);Object.hasOwn(L,"rank")&&(L.rank-=M)})}function c(O){let T=O.nodes().map($=>O.node($).rank),M=p(Math.min,T),_=[];O.nodes().forEach($=>{let B=O.node($).rank-M;_[B]||(_[B]=[]),_[B].push($)});let L=0,P=O.graph().nodeRankFactor;Array.from(_).forEach(($,B)=>{$===void 0&&B%P!==0?--L:$!==void 0&&L&&$.forEach(D=>O.node(D).rank+=L)})}function u(O,T,M,_){let L={width:0,height:0};return arguments.length>=4&&(L.rank=M,L.order=_),t(O,"border",L,T)}function d(O,T=h){const M=[];for(let _=0;_<O.length;_+=T){const L=O.slice(_,_+T);M.push(L)}return M}const h=65535;function p(O,T){if(T.length>h){const M=d(T);return O.apply(null,M.map(_=>O.apply(null,_)))}else return O.apply(null,T)}function g(O){const M=O.nodes().map(_=>{let L=O.node(_).rank;return L===void 0?Number.MIN_VALUE:L});return p(Math.max,M)}function y(O,T){let M={lhs:[],rhs:[]};return O.forEach(_=>{T(_)?M.lhs.push(_):M.rhs.push(_)}),M}function v(O,T){let M=Date.now();try{return T()}finally{console.log(O+" time: "+(Date.now()-M)+"ms")}}function b(O,T){return T()}let C=0;function S(O){var T=++C;return O+(""+T)}function E(O,T,M=1){T==null&&(T=O,O=0);let _=P=>P<T;M<0&&(_=P=>T<P);const L=[];for(let P=O;_(P);P+=M)L.push(P);return L}function x(O,T){const M={};for(const _ of T)O[_]!==void 0&&(M[_]=O[_]);return M}function I(O,T){let M=T;return typeof T=="string"&&(M=_=>_[T]),Object.entries(O).reduce((_,[L,P])=>(_[L]=M(P,L),_),{})}function N(O,T){return O.reduce((M,_,L)=>(M[_]=T[L],M),{})}return z$}var V$,_de;function S2t(){if(_de)return V$;_de=1;let e=E2t(),t=gi().uniqueId;V$={run:n,undo:o};function n(i){(i.graph().acyclicer==="greedy"?e(i,s(i)):r(i)).forEach(l=>{let c=i.edge(l);i.removeEdge(l),c.forwardName=l.name,c.reversed=!0,i.setEdge(l.w,l.v,c,t("rev"))});function s(l){return c=>l.edge(c).weight}}function r(i){let a=[],s={},l={};function c(u){Object.hasOwn(l,u)||(l[u]=!0,s[u]=!0,i.outEdges(u).forEach(d=>{Object.hasOwn(s,d.w)?a.push(d):c(d.w)}),delete s[u])}return i.nodes().forEach(c),a}function o(i){i.edges().forEach(a=>{let s=i.edge(a);if(s.reversed){i.removeEdge(a);let l=s.forwardName;delete s.reversed,delete s.forwardName,i.setEdge(a.w,a.v,s,l)}})}return V$}var H$,$de;function w2t(){if($de)return H$;$de=1;let e=gi();H$={run:t,undo:r};function t(o){o.graph().dummyChains=[],o.edges().forEach(i=>n(o,i))}function n(o,i){let a=i.v,s=o.node(a).rank,l=i.w,c=o.node(l).rank,u=i.name,d=o.edge(i),h=d.labelRank;if(c===s+1)return;o.removeEdge(i);let p,g,y;for(y=0,++s;s<c;++y,++s)d.points=[],g={width:0,height:0,edgeLabel:d,edgeObj:i,rank:s},p=e.addDummyNode(o,"edge",g,"_d"),s===h&&(g.width=d.width,g.height=d.height,g.dummy="edge-label",g.labelpos=d.labelpos),o.setEdge(a,p,{weight:d.weight},u),y===0&&o.graph().dummyChains.push(p),a=p;o.setEdge(a,l,{weight:d.weight},u)}function r(o){o.graph().dummyChains.forEach(i=>{let a=o.node(i),s=a.edgeLabel,l;for(o.setEdge(a.edgeObj,s);a.dummy;)l=o.successors(i)[0],o.removeNode(i),s.points.push({x:a.x,y:a.y}),a.dummy==="edge-label"&&(s.x=a.x,s.y=a.y,s.width=a.width,s.height=a.height),i=l,a=o.node(i)})}return H$}var W$,Pde;function Yx(){if(Pde)return W$;Pde=1;const{applyWithChunking:e}=gi();W$={longestPath:t,slack:n};function t(r){var o={};function i(a){var s=r.node(a);if(Object.hasOwn(o,a))return s.rank;o[a]=!0;let l=r.outEdges(a).map(u=>u==null?Number.POSITIVE_INFINITY:i(u.w)-r.edge(u).minlen);var c=e(Math.min,l);return c===Number.POSITIVE_INFINITY&&(c=0),s.rank=c}r.sources().forEach(i)}function n(r,o){return r.node(o.w).rank-r.node(o.v).rank-r.edge(o).minlen}return W$}var K$,Dde;function Lde(){if(Dde)return K$;Dde=1;var e=Wl().Graph,t=Yx().slack;K$=n;function n(a){var s=new e({directed:!1}),l=a.nodes()[0],c=a.nodeCount();s.setNode(l,{});for(var u,d;r(s,a)<c;)u=o(s,a),d=s.hasNode(u.v)?t(a,u):-t(a,u),i(s,a,d);return s}function r(a,s){function l(c){s.nodeEdges(c).forEach(u=>{var d=u.v,h=c===d?u.w:d;!a.hasNode(h)&&!t(s,u)&&(a.setNode(h,{}),a.setEdge(c,h,{}),l(h))})}return a.nodes().forEach(l),a.nodeCount()}function o(a,s){return s.edges().reduce((c,u)=>{let d=Number.POSITIVE_INFINITY;return a.hasNode(u.v)!==a.hasNode(u.w)&&(d=t(s,u)),d<c[0]?[d,u]:c},[Number.POSITIVE_INFINITY,null])[1]}function i(a,s,l){a.nodes().forEach(c=>s.node(c).rank+=l)}return K$}var q$,Bde;function x2t(){if(Bde)return q$;Bde=1;var e=Lde(),t=Yx().slack,n=Yx().longestPath,r=Wl().alg.preorder,o=Wl().alg.postorder,i=gi().simplify;q$=a,a.initLowLimValues=u,a.initCutValues=s,a.calcCutValue=c,a.leaveEdge=h,a.enterEdge=p,a.exchangeEdges=g;function a(C){C=i(C),n(C);var S=e(C);u(S),s(S,C);for(var E,x;E=h(S);)x=p(S,C,E),g(S,C,E,x)}function s(C,S){var E=o(C,C.nodes());E=E.slice(0,E.length-1),E.forEach(x=>l(C,S,x))}function l(C,S,E){var x=C.node(E),I=x.parent;C.edge(E,I).cutvalue=c(C,S,E)}function c(C,S,E){var x=C.node(E),I=x.parent,N=!0,O=S.edge(E,I),T=0;return O||(N=!1,O=S.edge(I,E)),T=O.weight,S.nodeEdges(E).forEach(M=>{var _=M.v===E,L=_?M.w:M.v;if(L!==I){var P=_===N,$=S.edge(M).weight;if(T+=P?$:-$,v(C,E,L)){var B=C.edge(E,L).cutvalue;T+=P?-B:B}}}),T}function u(C,S){arguments.length<2&&(S=C.nodes()[0]),d(C,{},1,S)}function d(C,S,E,x,I){var N=E,O=C.node(x);return S[x]=!0,C.neighbors(x).forEach(T=>{Object.hasOwn(S,T)||(E=d(C,S,E,T,x))}),O.low=N,O.lim=E++,I?O.parent=I:delete O.parent,E}function h(C){return C.edges().find(S=>C.edge(S).cutvalue<0)}function p(C,S,E){var x=E.v,I=E.w;S.hasEdge(x,I)||(x=E.w,I=E.v);var N=C.node(x),O=C.node(I),T=N,M=!1;N.lim>O.lim&&(T=O,M=!0);var _=S.edges().filter(L=>M===b(C,C.node(L.v),T)&&M!==b(C,C.node(L.w),T));return _.reduce((L,P)=>t(S,P)<t(S,L)?P:L)}function g(C,S,E,x){var I=E.v,N=E.w;C.removeEdge(I,N),C.setEdge(x.v,x.w,{}),u(C),s(C,S),y(C,S)}function y(C,S){var E=C.nodes().find(I=>!S.node(I).parent),x=r(C,E);x=x.slice(1),x.forEach(I=>{var N=C.node(I).parent,O=S.edge(I,N),T=!1;O||(O=S.edge(N,I),T=!0),S.node(I).rank=S.node(N).rank+(T?O.minlen:-O.minlen)})}function v(C,S,E){return C.hasEdge(S,E)}function b(C,S,E){return E.low<=S.lim&&S.lim<=E.lim}return q$}var U$,Fde;function I2t(){if(Fde)return U$;Fde=1;var e=Yx(),t=e.longestPath,n=Lde(),r=x2t();U$=o;function o(l){var c=l.graph().ranker;if(c instanceof Function)return c(l);switch(l.graph().ranker){case"network-simplex":s(l);break;case"tight-tree":a(l);break;case"longest-path":i(l);break;case"none":break;default:s(l)}}var i=t;function a(l){t(l),n(l)}function s(l){r(l)}return U$}var G$,jde;function N2t(){if(jde)return G$;jde=1,G$=e;function e(r){let o=n(r);r.graph().dummyChains.forEach(i=>{let a=r.node(i),s=a.edgeObj,l=t(r,o,s.v,s.w),c=l.path,u=l.lca,d=0,h=c[d],p=!0;for(;i!==s.w;){if(a=r.node(i),p){for(;(h=c[d])!==u&&r.node(h).maxRank<a.rank;)d++;h===u&&(p=!1)}if(!p){for(;d<c.length-1&&r.node(h=c[d+1]).minRank<=a.rank;)d++;h=c[d]}r.setParent(i,h),i=r.successors(i)[0]}})}function t(r,o,i,a){let s=[],l=[],c=Math.min(o[i].low,o[a].low),u=Math.max(o[i].lim,o[a].lim),d,h;d=i;do d=r.parent(d),s.push(d);while(d&&(o[d].low>c||u>o[d].lim));for(h=d,d=a;(d=r.parent(d))!==h;)l.push(d);return{path:s.concat(l.reverse()),lca:h}}function n(r){let o={},i=0;function a(s){let l=i;r.children(s).forEach(a),o[s]={low:l,lim:i++}}return r.children().forEach(a),o}return G$}var Q$,zde;function O2t(){if(zde)return Q$;zde=1;let e=gi();Q$={run:t,cleanup:i};function t(a){let s=e.addDummyNode(a,"root",{},"_root"),l=r(a),c=Object.values(l),u=e.applyWithChunking(Math.max,c)-1,d=2*u+1;a.graph().nestingRoot=s,a.edges().forEach(p=>a.edge(p).minlen*=d);let h=o(a)+1;a.children().forEach(p=>n(a,s,d,h,u,l,p)),a.graph().nodeRankFactor=d}function n(a,s,l,c,u,d,h){let p=a.children(h);if(!p.length){h!==s&&a.setEdge(s,h,{weight:0,minlen:l});return}let g=e.addBorderNode(a,"_bt"),y=e.addBorderNode(a,"_bb"),v=a.node(h);a.setParent(g,h),v.borderTop=g,a.setParent(y,h),v.borderBottom=y,p.forEach(b=>{n(a,s,l,c,u,d,b);let C=a.node(b),S=C.borderTop?C.borderTop:b,E=C.borderBottom?C.borderBottom:b,x=C.borderTop?c:2*c,I=S!==E?1:u-d[h]+1;a.setEdge(g,S,{weight:x,minlen:I,nestingEdge:!0}),a.setEdge(E,y,{weight:x,minlen:I,nestingEdge:!0})}),a.parent(h)||a.setEdge(s,g,{weight:0,minlen:u+d[h]})}function r(a){var s={};function l(c,u){var d=a.children(c);d&&d.length&&d.forEach(h=>l(h,u+1)),s[c]=u}return a.children().forEach(c=>l(c,1)),s}function o(a){return a.edges().reduce((s,l)=>s+a.edge(l).weight,0)}function i(a){var s=a.graph();a.removeNode(s.nestingRoot),delete s.nestingRoot,a.edges().forEach(l=>{var c=a.edge(l);c.nestingEdge&&a.removeEdge(l)})}return Q$}var R$,Vde;function T2t(){if(Vde)return R$;Vde=1;let e=gi();R$=t;function t(r){function o(i){let a=r.children(i),s=r.node(i);if(a.length&&a.forEach(o),Object.hasOwn(s,"minRank")){s.borderLeft=[],s.borderRight=[];for(let l=s.minRank,c=s.maxRank+1;l<c;++l)n(r,"borderLeft","_bl",i,s,l),n(r,"borderRight","_br",i,s,l)}}r.children().forEach(o)}function n(r,o,i,a,s,l){let c={width:0,height:0,rank:l,borderType:o},u=s[o][l-1],d=e.addDummyNode(r,"border",c,i);s[o][l]=d,r.setParent(d,a),u&&r.setEdge(u,d,{weight:1})}return R$}var Y$,Hde;function k2t(){if(Hde)return Y$;Hde=1,Y$={adjust:e,undo:t};function e(l){let c=l.graph().rankdir.toLowerCase();(c==="lr"||c==="rl")&&n(l)}function t(l){let c=l.graph().rankdir.toLowerCase();(c==="bt"||c==="rl")&&o(l),(c==="lr"||c==="rl")&&(a(l),n(l))}function n(l){l.nodes().forEach(c=>r(l.node(c))),l.edges().forEach(c=>r(l.edge(c)))}function r(l){let c=l.width;l.width=l.height,l.height=c}function o(l){l.nodes().forEach(c=>i(l.node(c))),l.edges().forEach(c=>{let u=l.edge(c);u.points.forEach(i),Object.hasOwn(u,"y")&&i(u)})}function i(l){l.y=-l.y}function a(l){l.nodes().forEach(c=>s(l.node(c))),l.edges().forEach(c=>{let u=l.edge(c);u.points.forEach(s),Object.hasOwn(u,"x")&&s(u)})}function s(l){let c=l.x;l.x=l.y,l.y=c}return Y$}var X$,Wde;function M2t(){if(Wde)return X$;Wde=1;let e=gi();X$=t;function t(n){let r={},o=n.nodes().filter(u=>!n.children(u).length),i=o.map(u=>n.node(u).rank),a=e.applyWithChunking(Math.max,i),s=e.range(a+1).map(()=>[]);function l(u){if(r[u])return;r[u]=!0;let d=n.node(u);s[d.rank].push(u),n.successors(u).forEach(l)}return o.sort((u,d)=>n.node(u).rank-n.node(d).rank).forEach(l),s}return X$}var Z$,Kde;function _2t(){if(Kde)return Z$;Kde=1;let e=gi().zipObject;Z$=t;function t(r,o){let i=0;for(let a=1;a<o.length;++a)i+=n(r,o[a-1],o[a]);return i}function n(r,o,i){let a=e(i,i.map((h,p)=>p)),s=o.flatMap(h=>r.outEdges(h).map(p=>({pos:a[p.w],weight:r.edge(p).weight})).sort((p,g)=>p.pos-g.pos)),l=1;for(;l<i.length;)l<<=1;let c=2*l-1;l-=1;let u=new Array(c).fill(0),d=0;return s.forEach(h=>{let p=h.pos+l;u[p]+=h.weight;let g=0;for(;p>0;)p%2&&(g+=u[p+1]),p=p-1>>1,u[p]+=h.weight;d+=h.weight*g}),d}return Z$}var J$,qde;function $2t(){if(qde)return J$;qde=1,J$=e;function e(t,n=[]){return n.map(r=>{let o=t.inEdges(r);if(o.length){let i=o.reduce((a,s)=>{let l=t.edge(s),c=t.node(s.v);return{sum:a.sum+l.weight*c.order,weight:a.weight+l.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}return J$}var eP,Ude;function P2t(){if(Ude)return eP;Ude=1;let e=gi();eP=t;function t(o,i){let a={};o.forEach((l,c)=>{let u=a[l.v]={indegree:0,in:[],out:[],vs:[l.v],i:c};l.barycenter!==void 0&&(u.barycenter=l.barycenter,u.weight=l.weight)}),i.edges().forEach(l=>{let c=a[l.v],u=a[l.w];c!==void 0&&u!==void 0&&(u.indegree++,c.out.push(a[l.w]))});let s=Object.values(a).filter(l=>!l.indegree);return n(s)}function n(o){let i=[];function a(l){return c=>{c.merged||(c.barycenter===void 0||l.barycenter===void 0||c.barycenter>=l.barycenter)&&r(l,c)}}function s(l){return c=>{c.in.push(l),--c.indegree===0&&o.push(c)}}for(;o.length;){let l=o.pop();i.push(l),l.in.reverse().forEach(a(l)),l.out.forEach(s(l))}return i.filter(l=>!l.merged).map(l=>e.pick(l,["vs","i","barycenter","weight"]))}function r(o,i){let a=0,s=0;o.weight&&(a+=o.barycenter*o.weight,s+=o.weight),i.weight&&(a+=i.barycenter*i.weight,s+=i.weight),o.vs=i.vs.concat(o.vs),o.barycenter=a/s,o.weight=s,o.i=Math.min(i.i,o.i),i.merged=!0}return eP}var tP,Gde;function D2t(){if(Gde)return tP;Gde=1;let e=gi();tP=t;function t(o,i){let a=e.partition(o,g=>Object.hasOwn(g,"barycenter")),s=a.lhs,l=a.rhs.sort((g,y)=>y.i-g.i),c=[],u=0,d=0,h=0;s.sort(r(!!i)),h=n(c,l,h),s.forEach(g=>{h+=g.vs.length,c.push(g.vs),u+=g.barycenter*g.weight,d+=g.weight,h=n(c,l,h)});let p={vs:c.flat(!0)};return d&&(p.barycenter=u/d,p.weight=d),p}function n(o,i,a){let s;for(;i.length&&(s=i[i.length-1]).i<=a;)i.pop(),o.push(s.vs),a++;return a}function r(o){return(i,a)=>i.barycenter<a.barycenter?-1:i.barycenter>a.barycenter?1:o?a.i-i.i:i.i-a.i}return tP}var nP,Qde;function L2t(){if(Qde)return nP;Qde=1;let e=$2t(),t=P2t(),n=D2t();nP=r;function r(a,s,l,c){let u=a.children(s),d=a.node(s),h=d?d.borderLeft:void 0,p=d?d.borderRight:void 0,g={};h&&(u=u.filter(C=>C!==h&&C!==p));let y=e(a,u);y.forEach(C=>{if(a.children(C.v).length){let S=r(a,C.v,l,c);g[C.v]=S,Object.hasOwn(S,"barycenter")&&i(C,S)}});let v=t(y,l);o(v,g);let b=n(v,c);if(h&&(b.vs=[h,b.vs,p].flat(!0),a.predecessors(h).length)){let C=a.node(a.predecessors(h)[0]),S=a.node(a.predecessors(p)[0]);Object.hasOwn(b,"barycenter")||(b.barycenter=0,b.weight=0),b.barycenter=(b.barycenter*b.weight+C.order+S.order)/(b.weight+2),b.weight+=2}return b}function o(a,s){a.forEach(l=>{l.vs=l.vs.flatMap(c=>s[c]?s[c].vs:c)})}function i(a,s){a.barycenter!==void 0?(a.barycenter=(a.barycenter*a.weight+s.barycenter*s.weight)/(a.weight+s.weight),a.weight+=s.weight):(a.barycenter=s.barycenter,a.weight=s.weight)}return nP}var rP,Rde;function B2t(){if(Rde)return rP;Rde=1;let e=Wl().Graph,t=gi();rP=n;function n(o,i,a){let s=r(o),l=new e({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(c=>o.node(c));return o.nodes().forEach(c=>{let u=o.node(c),d=o.parent(c);(u.rank===i||u.minRank<=i&&i<=u.maxRank)&&(l.setNode(c),l.setParent(c,d||s),o[a](c).forEach(h=>{let p=h.v===c?h.w:h.v,g=l.edge(p,c),y=g!==void 0?g.weight:0;l.setEdge(p,c,{weight:o.edge(h).weight+y})}),Object.hasOwn(u,"minRank")&&l.setNode(c,{borderLeft:u.borderLeft[i],borderRight:u.borderRight[i]}))}),l}function r(o){for(var i;o.hasNode(i=t.uniqueId("_root")););return i}return rP}var oP,Yde;function F2t(){if(Yde)return oP;Yde=1,oP=e;function e(t,n,r){let o={},i;r.forEach(a=>{let s=t.parent(a),l,c;for(;s;){if(l=t.parent(s),l?(c=o[l],o[l]=s):(c=i,i=s),c&&c!==s){n.setEdge(c,s);return}s=l}})}return oP}var iP,Xde;function j2t(){if(Xde)return iP;Xde=1;let e=M2t(),t=_2t(),n=L2t(),r=B2t(),o=F2t(),i=Wl().Graph,a=gi();iP=s;function s(d,h){if(h&&typeof h.customOrder=="function"){h.customOrder(d,s);return}let p=a.maxRank(d),g=l(d,a.range(1,p+1),"inEdges"),y=l(d,a.range(p-1,-1,-1),"outEdges"),v=e(d);if(u(d,v),h&&h.disableOptimalOrderHeuristic)return;let b=Number.POSITIVE_INFINITY,C;for(let S=0,E=0;E<4;++S,++E){c(S%2?g:y,S%4>=2),v=a.buildLayerMatrix(d);let x=t(d,v);x<b&&(E=0,C=Object.assign({},v),b=x)}u(d,C)}function l(d,h,p){return h.map(function(g){return r(d,g,p)})}function c(d,h){let p=new i;d.forEach(function(g){let y=g.graph().root,v=n(g,y,p,h);v.vs.forEach((b,C)=>g.node(b).order=C),o(g,p,v.vs)})}function u(d,h){Object.values(h).forEach(p=>p.forEach((g,y)=>d.node(g).order=y))}return iP}var aP,Zde;function z2t(){if(Zde)return aP;Zde=1;let e=Wl().Graph,t=gi();aP={positionX:p,findType1Conflicts:n,findType2Conflicts:r,addConflict:i,hasConflict:a,verticalAlignment:s,horizontalCompaction:l,alignCoordinates:d,findSmallestWidthAlignment:u,balance:h};function n(v,b){let C={};function S(E,x){let I=0,N=0,O=E.length,T=x[x.length-1];return x.forEach((M,_)=>{let L=o(v,M),P=L?v.node(L).order:O;(L||M===T)&&(x.slice(N,_+1).forEach($=>{v.predecessors($).forEach(B=>{let D=v.node(B),F=D.order;(F<I||P<F)&&!(D.dummy&&v.node($).dummy)&&i(C,B,$)})}),N=_+1,I=P)}),x}return b.length&&b.reduce(S),C}function r(v,b){let C={};function S(x,I,N,O,T){let M;t.range(I,N).forEach(_=>{M=x[_],v.node(M).dummy&&v.predecessors(M).forEach(L=>{let P=v.node(L);P.dummy&&(P.order<O||P.order>T)&&i(C,L,M)})})}function E(x,I){let N=-1,O,T=0;return I.forEach((M,_)=>{if(v.node(M).dummy==="border"){let L=v.predecessors(M);L.length&&(O=v.node(L[0]).order,S(I,T,_,N,O),T=_,N=O)}S(I,T,I.length,O,x.length)}),I}return b.length&&b.reduce(E),C}function o(v,b){if(v.node(b).dummy)return v.predecessors(b).find(C=>v.node(C).dummy)}function i(v,b,C){if(b>C){let E=b;b=C,C=E}let S=v[b];S||(v[b]=S={}),S[C]=!0}function a(v,b,C){if(b>C){let S=b;b=C,C=S}return!!v[b]&&Object.hasOwn(v[b],C)}function s(v,b,C,S){let E={},x={},I={};return b.forEach(N=>{N.forEach((O,T)=>{E[O]=O,x[O]=O,I[O]=T})}),b.forEach(N=>{let O=-1;N.forEach(T=>{let M=S(T);if(M.length){M=M.sort((L,P)=>I[L]-I[P]);let _=(M.length-1)/2;for(let L=Math.floor(_),P=Math.ceil(_);L<=P;++L){let $=M[L];x[T]===T&&O<I[$]&&!a(C,T,$)&&(x[$]=T,x[T]=E[T]=E[$],O=I[$])}}})}),{root:E,align:x}}function l(v,b,C,S,E){let x={},I=c(v,b,C,E),N=E?"borderLeft":"borderRight";function O(_,L){let P=I.nodes(),$=P.pop(),B={};for(;$;)B[$]?_($):(B[$]=!0,P.push($),P=P.concat(L($))),$=P.pop()}function T(_){x[_]=I.inEdges(_).reduce((L,P)=>Math.max(L,x[P.v]+I.edge(P)),0)}function M(_){let L=I.outEdges(_).reduce(($,B)=>Math.min($,x[B.w]-I.edge(B)),Number.POSITIVE_INFINITY),P=v.node(_);L!==Number.POSITIVE_INFINITY&&P.borderType!==N&&(x[_]=Math.max(x[_],L))}return O(T,I.predecessors.bind(I)),O(M,I.successors.bind(I)),Object.keys(S).forEach(_=>x[_]=x[C[_]]),x}function c(v,b,C,S){let E=new e,x=v.graph(),I=g(x.nodesep,x.edgesep,S);return b.forEach(N=>{let O;N.forEach(T=>{let M=C[T];if(E.setNode(M),O){var _=C[O],L=E.edge(_,M);E.setEdge(_,M,Math.max(I(v,T,O),L||0))}O=T})}),E}function u(v,b){return Object.values(b).reduce((C,S)=>{let E=Number.NEGATIVE_INFINITY,x=Number.POSITIVE_INFINITY;Object.entries(S).forEach(([N,O])=>{let T=y(v,N)/2;E=Math.max(O+T,E),x=Math.min(O-T,x)});const I=E-x;return I<C[0]&&(C=[I,S]),C},[Number.POSITIVE_INFINITY,null])[1]}function d(v,b){let C=Object.values(b),S=t.applyWithChunking(Math.min,C),E=t.applyWithChunking(Math.max,C);["u","d"].forEach(x=>{["l","r"].forEach(I=>{let N=x+I,O=v[N];if(O===b)return;let T=Object.values(O),M=S-t.applyWithChunking(Math.min,T);I!=="l"&&(M=E-t.applyWithChunking(Math.max,T)),M&&(v[N]=t.mapValues(O,_=>_+M))})})}function h(v,b){return t.mapValues(v.ul,(C,S)=>{if(b)return v[b.toLowerCase()][S];{let E=Object.values(v).map(x=>x[S]).sort((x,I)=>x-I);return(E[1]+E[2])/2}})}function p(v){let b=t.buildLayerMatrix(v),C=Object.assign(n(v,b),r(v,b)),S={},E;["u","d"].forEach(I=>{E=I==="u"?b:Object.values(b).reverse(),["l","r"].forEach(N=>{N==="r"&&(E=E.map(_=>Object.values(_).reverse()));let O=(I==="u"?v.predecessors:v.successors).bind(v),T=s(v,E,C,O),M=l(v,E,T.root,T.align,N==="r");N==="r"&&(M=t.mapValues(M,_=>-_)),S[I+N]=M})});let x=u(v,S);return d(S,x),h(S,v.graph().align)}function g(v,b,C){return(S,E,x)=>{let I=S.node(E),N=S.node(x),O=0,T;if(O+=I.width/2,Object.hasOwn(I,"labelpos"))switch(I.labelpos.toLowerCase()){case"l":T=-I.width/2;break;case"r":T=I.width/2;break}if(T&&(O+=C?T:-T),T=0,O+=(I.dummy?b:v)/2,O+=(N.dummy?b:v)/2,O+=N.width/2,Object.hasOwn(N,"labelpos"))switch(N.labelpos.toLowerCase()){case"l":T=N.width/2;break;case"r":T=-N.width/2;break}return T&&(O+=C?T:-T),T=0,O}}function y(v,b){return v.node(b).width}return aP}var sP,Jde;function V2t(){if(Jde)return sP;Jde=1;let e=gi(),t=z2t().positionX;sP=n;function n(o){o=e.asNonCompoundGraph(o),r(o),Object.entries(t(o)).forEach(([i,a])=>o.node(i).x=a)}function r(o){let i=e.buildLayerMatrix(o),a=o.graph().ranksep,s=0;i.forEach(l=>{const c=l.reduce((u,d)=>{const h=o.node(d).height;return u>h?u:h},0);l.forEach(u=>o.node(u).y=s+c/2),s+=c+a})}return sP}var lP,efe;function H2t(){if(efe)return lP;efe=1;let e=S2t(),t=w2t(),n=I2t(),r=gi().normalizeRanks,o=N2t(),i=gi().removeEmptyRanks,a=O2t(),s=T2t(),l=k2t(),c=j2t(),u=V2t(),d=gi(),h=Wl().Graph;lP=p;function p(H,K){let G=K&&K.debugTiming?d.time:d.notime;G("layout",()=>{let Y=G(" buildLayoutGraph",()=>O(H));G(" runLayout",()=>g(Y,G,K)),G(" updateInputGraph",()=>y(H,Y))})}function g(H,K,G){K(" makeSpaceForEdgeLabels",()=>T(H)),K(" removeSelfEdges",()=>z(H)),K(" acyclic",()=>e.run(H)),K(" nestingGraph.run",()=>a.run(H)),K(" rank",()=>n(d.asNonCompoundGraph(H))),K(" injectEdgeLabelProxies",()=>M(H)),K(" removeEmptyRanks",()=>i(H)),K(" nestingGraph.cleanup",()=>a.cleanup(H)),K(" normalizeRanks",()=>r(H)),K(" assignRankMinMax",()=>_(H)),K(" removeEdgeLabelProxies",()=>L(H)),K(" normalize.run",()=>t.run(H)),K(" parentDummyChains",()=>o(H)),K(" addBorderSegments",()=>s(H)),K(" order",()=>c(H,G)),K(" insertSelfEdges",()=>V(H)),K(" adjustCoordinateSystem",()=>l.adjust(H)),K(" position",()=>u(H)),K(" positionSelfEdges",()=>U(H)),K(" removeBorderNodes",()=>F(H)),K(" normalize.undo",()=>t.undo(H)),K(" fixupEdgeLabelCoords",()=>B(H)),K(" undoCoordinateSystem",()=>l.undo(H)),K(" translateGraph",()=>P(H)),K(" assignNodeIntersects",()=>$(H)),K(" reversePoints",()=>D(H)),K(" acyclic.undo",()=>e.undo(H))}function y(H,K){H.nodes().forEach(G=>{let Y=H.node(G),ne=K.node(G);Y&&(Y.x=ne.x,Y.y=ne.y,Y.rank=ne.rank,K.children(G).length&&(Y.width=ne.width,Y.height=ne.height))}),H.edges().forEach(G=>{let Y=H.edge(G),ne=K.edge(G);Y.points=ne.points,Object.hasOwn(ne,"x")&&(Y.x=ne.x,Y.y=ne.y)}),H.graph().width=K.graph().width,H.graph().height=K.graph().height}let v=["nodesep","edgesep","ranksep","marginx","marginy"],b={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},C=["acyclicer","ranker","rankdir","align"],S=["width","height","rank"],E={width:0,height:0},x=["minlen","weight","width","height","labeloffset"],I={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},N=["labelpos"];function O(H){let K=new h({multigraph:!0,compound:!0}),G=W(H.graph());return K.setGraph(Object.assign({},b,q(G,v),d.pick(G,C))),H.nodes().forEach(Y=>{let ne=W(H.node(Y));const Q=q(ne,S);Object.keys(E).forEach(ee=>{Q[ee]===void 0&&(Q[ee]=E[ee])}),K.setNode(Y,Q),K.setParent(Y,H.parent(Y))}),H.edges().forEach(Y=>{let ne=W(H.edge(Y));K.setEdge(Y,Object.assign({},I,q(ne,x),d.pick(ne,N)))}),K}function T(H){let K=H.graph();K.ranksep/=2,H.edges().forEach(G=>{let Y=H.edge(G);Y.minlen*=2,Y.labelpos.toLowerCase()!=="c"&&(K.rankdir==="TB"||K.rankdir==="BT"?Y.width+=Y.labeloffset:Y.height+=Y.labeloffset)})}function M(H){H.edges().forEach(K=>{let G=H.edge(K);if(G.width&&G.height){let Y=H.node(K.v),Q={rank:(H.node(K.w).rank-Y.rank)/2+Y.rank,e:K};d.addDummyNode(H,"edge-proxy",Q,"_ep")}})}function _(H){let K=0;H.nodes().forEach(G=>{let Y=H.node(G);Y.borderTop&&(Y.minRank=H.node(Y.borderTop).rank,Y.maxRank=H.node(Y.borderBottom).rank,K=Math.max(K,Y.maxRank))}),H.graph().maxRank=K}function L(H){H.nodes().forEach(K=>{let G=H.node(K);G.dummy==="edge-proxy"&&(H.edge(G.e).labelRank=G.rank,H.removeNode(K))})}function P(H){let K=Number.POSITIVE_INFINITY,G=0,Y=Number.POSITIVE_INFINITY,ne=0,Q=H.graph(),ee=Q.marginx||0,te=Q.marginy||0;function Z(J){let ae=J.x,re=J.y,pe=J.width,fe=J.height;K=Math.min(K,ae-pe/2),G=Math.max(G,ae+pe/2),Y=Math.min(Y,re-fe/2),ne=Math.max(ne,re+fe/2)}H.nodes().forEach(J=>Z(H.node(J))),H.edges().forEach(J=>{let ae=H.edge(J);Object.hasOwn(ae,"x")&&Z(ae)}),K-=ee,Y-=te,H.nodes().forEach(J=>{let ae=H.node(J);ae.x-=K,ae.y-=Y}),H.edges().forEach(J=>{let ae=H.edge(J);ae.points.forEach(re=>{re.x-=K,re.y-=Y}),Object.hasOwn(ae,"x")&&(ae.x-=K),Object.hasOwn(ae,"y")&&(ae.y-=Y)}),Q.width=G-K+ee,Q.height=ne-Y+te}function $(H){H.edges().forEach(K=>{let G=H.edge(K),Y=H.node(K.v),ne=H.node(K.w),Q,ee;G.points?(Q=G.points[0],ee=G.points[G.points.length-1]):(G.points=[],Q=ne,ee=Y),G.points.unshift(d.intersectRect(Y,Q)),G.points.push(d.intersectRect(ne,ee))})}function B(H){H.edges().forEach(K=>{let G=H.edge(K);if(Object.hasOwn(G,"x"))switch((G.labelpos==="l"||G.labelpos==="r")&&(G.width-=G.labeloffset),G.labelpos){case"l":G.x-=G.width/2+G.labeloffset;break;case"r":G.x+=G.width/2+G.labeloffset;break}})}function D(H){H.edges().forEach(K=>{let G=H.edge(K);G.reversed&&G.points.reverse()})}function F(H){H.nodes().forEach(K=>{if(H.children(K).length){let G=H.node(K),Y=H.node(G.borderTop),ne=H.node(G.borderBottom),Q=H.node(G.borderLeft[G.borderLeft.length-1]),ee=H.node(G.borderRight[G.borderRight.length-1]);G.width=Math.abs(ee.x-Q.x),G.height=Math.abs(ne.y-Y.y),G.x=Q.x+G.width/2,G.y=Y.y+G.height/2}}),H.nodes().forEach(K=>{H.node(K).dummy==="border"&&H.removeNode(K)})}function z(H){H.edges().forEach(K=>{if(K.v===K.w){var G=H.node(K.v);G.selfEdges||(G.selfEdges=[]),G.selfEdges.push({e:K,label:H.edge(K)}),H.removeEdge(K)}})}function V(H){var K=d.buildLayerMatrix(H);K.forEach(G=>{var Y=0;G.forEach((ne,Q)=>{var ee=H.node(ne);ee.order=Q+Y,(ee.selfEdges||[]).forEach(te=>{d.addDummyNode(H,"selfedge",{width:te.label.width,height:te.label.height,rank:ee.rank,order:Q+ ++Y,e:te.e,label:te.label},"_se")}),delete ee.selfEdges})})}function U(H){H.nodes().forEach(K=>{var G=H.node(K);if(G.dummy==="selfedge"){var Y=H.node(G.e.v),ne=Y.x+Y.width/2,Q=Y.y,ee=G.x-ne,te=Y.height/2;H.setEdge(G.e,G.label),H.removeNode(K),G.label.points=[{x:ne+2*ee/3,y:Q-te},{x:ne+5*ee/6,y:Q-te},{x:ne+ee,y:Q},{x:ne+5*ee/6,y:Q+te},{x:ne+2*ee/3,y:Q+te}],G.label.x=G.x,G.label.y=G.y}})}function q(H,K){return d.mapValues(d.pick(H,K),Number)}function W(H){var K={};return H&&Object.entries(H).forEach(([G,Y])=>{typeof G=="string"&&(G=G.toLowerCase()),K[G]=Y}),K}return lP}var cP,tfe;function W2t(){if(tfe)return cP;tfe=1;let e=gi(),t=Wl().Graph;cP={debugOrdering:n};function n(r){let o=e.buildLayerMatrix(r),i=new t({compound:!0,multigraph:!0}).setGraph({});return r.nodes().forEach(a=>{i.setNode(a,{label:a}),i.setParent(a,"layer"+r.node(a).rank)}),r.edges().forEach(a=>i.setEdge(a.v,a.w,{},a.name)),o.forEach((a,s)=>{let l="layer"+s;i.setNode(l,{rank:"same"}),a.reduce((c,u)=>(i.setEdge(c,u,{style:"invis"}),u))}),i}return cP}var uP,nfe;function K2t(){return nfe||(nfe=1,uP="1.1.5"),uP}var dP,rfe;function q2t(){return rfe||(rfe=1,dP={graphlib:Wl(),layout:H2t(),debug:W2t(),util:{time:gi().time,notime:gi().notime},version:K2t()}),dP}var U2t=q2t();const ofe=ta(U2t),G2t=()=>{const{getNodes:e,getEdges:t,setNodes:n,setEdges:r,fitView:o}=bn(),i=s=>{const l=document.querySelector(`[data-id="${s}"]`);if(!l)return{width:180,height:60};const c=l.getBoundingClientRect();return{width:Math.max(60,c.width),height:Math.max(30,c.height)}};return{layout:(s="LR")=>{const l=e(),c=t();l.length&&requestAnimationFrame(()=>{const u=s==="LR",d=new ofe.graphlib.Graph;d.setDefaultEdgeLabel(()=>({})),d.setGraph({rankdir:s,ranksep:120,nodesep:80}),l.forEach(p=>{const{width:g,height:y}=i(p.id);d.setNode(p.id,{width:g,height:y})}),c.forEach(p=>d.setEdge(p.source,p.target)),ofe.layout(d);const h=l.map(p=>{const g=d.node(p.id),{width:y,height:v}=i(p.id);return{...p,position:{x:g.x-y/2,y:g.y-v/2},targetPosition:u?"left":"top",sourcePosition:u?"right":"bottom"}});n(h),r(c),requestAnimationFrame(()=>o({duration:400,padding:.3}))})}}},ife={history:[],currentStep:-1,canUndo:!1,canRedo:!1},fP=e=>{try{const t=e.nodes.map(o=>({id:o.id,position:o.position})),n=e.edges.map(o=>({id:o.id,source:o.source,target:o.target})),r=e.viewport;return JSON.stringify({nodes:t,edges:n,viewport:r})}catch{return JSON.stringify(e)}},lb=Jue((e,t)=>({instances:{},pushSnapshot:(n,r)=>e(o=>{const i=o.instances[n]??ife,a=fP(r),s=i.history[i.currentStep];if(s&&fP(s)===a)return o;const l=i.history.slice(0,i.currentStep+1).concat(r),c=l.length-1;return{instances:{...o.instances,[n]:{history:l,currentStep:c,canUndo:c>0,canRedo:c<l.length-1}}}}),applySnapshot:(n,r)=>{const o=t().instances[n];return!o||r<0||r>=o.history.length?null:(e(i=>({instances:{...i.instances,[n]:{...o,currentStep:r,canUndo:r>0,canRedo:r<o.history.length-1}}})),o.history[r])},reset:(n,r)=>e(o=>({instances:{...o.instances,[n]:{history:r?[r]:[],currentStep:r?0:-1,canUndo:!1,canRedo:!1}}})),remove:n=>e(r=>{const{[n]:o,...i}=r.instances;return{instances:i}})}));function afe(e){const t=lb(a=>a.instances[e]??ife),n=lb(a=>a.pushSnapshot),r=lb(a=>a.applySnapshot),o=lb(a=>a.reset),i=lb(a=>a.remove);return{history:t.history,currentStep:t.currentStep,canUndo:t.canUndo,canRedo:t.canRedo,pushSnapshot:a=>n(e,a),undo:()=>r(e,t.currentStep-1),redo:()=>r(e,t.currentStep+1),goTo:a=>r(e,a),reset:a=>o(e,a),dispose:()=>i(e)}}const Q2t=e=>{const{canUndo:t,canRedo:n,undo:r,redo:o}=afe(e),{setNodes:i,setEdges:a,setViewport:s}=bn(),l=A.useCallback(d=>{d&&(i==null||i(d.nodes??[]),a==null||a(d.edges??[]),d.viewport&&(s==null||s(d.viewport)))},[i,a,s]),c=A.useCallback(()=>{if(!t)return;const d=r();l(d)},[t,r,l]),u=A.useCallback(()=>{if(!n)return;const d=o();l(d)},[n,o,l]);return{canUndo:t,canRedo:n,undo:c,redo:u}},R2t=(e,t)=>{const{getNodes:n,getEdges:r,getViewport:o}=bn(),{pushSnapshot:i}=afe(e),a=A.useRef(null),s=A.useRef(null),l=A.useRef(!1),c=t==null?void 0:t.snapshotDebounceMs,u=A.useCallback(()=>{const h={nodes:n()??[],edges:r()??[],viewport:o?o():null},p=fP(h);s.current!==p&&(s.current=p,i(h))},[n,r,o,i,e]),d=A.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=window.setTimeout(()=>{u(),a.current=null},c)},[c,u]);return A.useEffect(()=>{l.current||(l.current=!0,u())},[]),A.useEffect(()=>()=>{a.current&&window.clearTimeout(a.current)},[]),{takeSnapshotNow:u,takeSnapshotDebounced:d}};function Y2t(e){return wr({attr:{t:"1569683610100",viewBox:"0 0 1024 1024",version:"1.1"},child:[{tag:"path",attr:{d:"M841 370c3-3.3 2.7-8.3-0.6-11.3-1.5-1.3-3.4-2.1-5.3-2.1h-72.6c-2.4 0-4.6 1-6.1 2.8L633.5 504.6c-2.9 3.4-7.9 3.8-11.3 0.9-0.9-0.8-1.6-1.7-2.1-2.8l-63.5-141.3c-1.3-2.9-4.1-4.7-7.3-4.7H380.7l0.9-4.7 8-42.3c10.5-55.4 38-81.4 85.8-81.4 18.6 0 35.5 1.7 48.8 4.7l14.1-66.8c-22.6-4.7-35.2-6.1-54.9-6.1-103.3 0-156.4 44.3-175.9 147.3l-9.4 49.4h-97.6c-3.8 0-7.1 2.7-7.8 6.4L181.9 415c-0.9 4.3 1.9 8.6 6.2 9.5 0.5 0.1 1.1 0.2 1.6 0.2H284l-89 429.9c-0.9 4.3 1.9 8.6 6.2 9.5 0.5 0.1 1.1 0.2 1.6 0.2H269c3.8 0 7.1-2.7 7.8-6.4l89.7-433.1h135.8l68.2 139.1c1.4 2.9 1 6.4-1.2 8.8l-180.6 203c-2.9 3.3-2.6 8.4 0.7 11.3 1.5 1.3 3.4 2 5.3 2h72.7c2.4 0 4.6-1 6.1-2.8l123.7-146.7c2.8-3.4 7.9-3.8 11.3-1 0.9 0.8 1.6 1.7 2.1 2.8L676.4 784c1.3 2.8 4.1 4.7 7.3 4.7h64.6c4.4 0 8-3.6 8-8 0-1.2-0.3-2.4-0.8-3.5l-95.2-198.9c-1.4-2.9-0.9-6.4 1.3-8.8L841 370z"},child:[]}]})(e)}function X2t(e){return wr({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"},child:[]},{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"},child:[]}]})(e)}function Z2t(e){return wr({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M952 792H72c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h880c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0-632H72c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h880c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM848 660c8.8 0 16-7.2 16-16V380c0-8.8-7.2-16-16-16H176c-8.8 0-16 7.2-16 16v264c0 8.8 7.2 16 16 16h672zM232 436h560v152H232V436z"},child:[]}]})(e)}function J2t(e){return wr({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"},child:[]},{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"},child:[]}]})(e)}function eEt(e){return wr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M9 18h3v-2H9c-1.654 0-3-1.346-3-3s1.346-3 3-3h6v3l5-4-5-4v3H9c-2.757 0-5 2.243-5 5s2.243 5 5 5z"},child:[]}]})(e)}function tEt(e){return wr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M9 10h6c1.654 0 3 1.346 3 3s-1.346 3-3 3h-3v2h3c2.757 0 5-2.243 5-5s-2.243-5-5-5H9V5L4 9l5 4v-3z"},child:[]}]})(e)}function nEt(e){return wr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 3H4c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2h16c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2zm0 2 .001 4H4V5h16zM4 19v-8h16.001l.001 8H4z"},child:[]},{tag:"path",attr:{d:"M14 6h2v2h-2zm3 0h2v2h-2z"},child:[]}]})(e)}function rEt(e){return wr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 76c48.1 0 93.3 18.7 127.3 52.7S436 207.9 436 256s-18.7 93.3-52.7 127.3S304.1 436 256 436c-48.1 0-93.3-18.7-127.3-52.7S76 304.1 76 256s18.7-93.3 52.7-127.3S207.9 76 256 76m0-28C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"},child:[]},{tag:"path",attr:{d:"M256.7 160c37.5 0 63.3 20.8 63.3 50.7 0 19.8-9.6 33.5-28.1 44.4-17.4 10.1-23.3 17.5-23.3 30.3v7.9h-34.7l-.3-8.6c-1.7-20.6 5.5-33.4 23.6-44 16.9-10.1 24-16.5 24-28.9s-12-21.5-26.9-21.5c-15.1 0-26 9.8-26.8 24.6H192c.7-32.2 24.5-54.9 64.7-54.9zm-26.3 171.4c0-11.5 9.6-20.6 21.4-20.6 11.9 0 21.5 9 21.5 20.6s-9.6 20.6-21.5 20.6-21.4-9-21.4-20.6z"},child:[]}]})(e)}var oEt="scripts_editor_k7c3wx0",cf="scripts_editor_k7c3wx1",iEt="scripts_editor_k7c3wx2",hP="scripts_editor_k7c3wx3",aEt="scripts_editor_k7c3wx4";const sEt=()=>{const e=Rr(),[t,n]=A.useState(()=>e.getState().transform[2]);return A.useEffect(()=>{let r=e.getState().transform[2];return e.subscribe(i=>{const a=i.transform[2];a!==r&&(r=a,n(a))})},[e]),f.jsxs("span",{className:aEt,children:[Math.round(t*100)/2,"%"]})},lEt=A.memo(e=>{const{canUndo:t,canRedo:n,onUndo:r,onRedo:o,onLayout:i,onFitView:a,onZoomOut:s,onZoomIn:l,interactionMode:c,onToggleInteractionMode:u,isReadOnly:d,onOpenShortcutSettings:h}=e;return f.jsxs("div",{className:oEt,children:[f.jsx("button",{type:"button",disabled:!t||d,className:cf,onClick:r,children:f.jsx(tEt,{size:18})}),f.jsx("button",{type:"button",disabled:!n||d,className:cf,onClick:o,children:f.jsx(eEt,{size:18})}),f.jsx("div",{className:hP}),f.jsx("button",{type:"button",className:cf,onClick:i,children:f.jsx($He,{})}),f.jsx("button",{type:"button",className:cf,onClick:a,children:f.jsx(Z2t,{size:18})}),f.jsx("div",{className:hP}),f.jsx("button",{type:"button",className:cf,onClick:s,children:f.jsx(X2t,{size:18})}),f.jsx(sEt,{}),f.jsx("button",{type:"button",className:cf,onClick:l,children:f.jsx(J2t,{size:18})}),f.jsx("div",{className:hP}),f.jsx("button",{type:"button",className:`${cf} ${c==="trackpad"?iEt:""}`,onClick:u,children:f.jsx(nEt,{size:18})}),f.jsx("button",{type:"button",className:cf,onClick:h,children:f.jsx(rEt,{size:18})})]})});var pP,sfe;function lfe(){if(sfe)return pP;sfe=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,o=typeof r=="function"&&r.prototype||e;return n===o}return pP=t,pP}var gP,cfe;function cEt(){if(cfe)return gP;cfe=1;function e(t,n){return function(r){return t(n(r))}}return gP=e,gP}var mP,ufe;function uEt(){if(ufe)return mP;ufe=1;var e=cEt(),t=e(Object.keys,Object);return mP=t,mP}var vP,dfe;function dEt(){if(dfe)return vP;dfe=1;var e=lfe(),t=uEt(),n=Object.prototype,r=n.hasOwnProperty;function o(i){if(!e(i))return t(i);var a=[];for(var s in Object(i))r.call(i,s)&&s!="constructor"&&a.push(s);return a}return vP=o,vP}var yP,ffe;function hfe(){if(ffe)return yP;ffe=1;var e=Ry(),t=mx(),n="[object AsyncFunction]",r="[object Function]",o="[object GeneratorFunction]",i="[object Proxy]";function a(s){if(!t(s))return!1;var l=e(s);return l==r||l==o||l==n||l==i}return yP=a,yP}var bP,pfe;function fEt(){if(pfe)return bP;pfe=1;var e=Mu(),t=e["__core-js_shared__"];return bP=t,bP}var CP,gfe;function hEt(){if(gfe)return CP;gfe=1;var e=fEt(),t=function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function n(r){return!!t&&t in r}return CP=n,CP}var AP,mfe;function vfe(){if(mfe)return AP;mfe=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return AP=n,AP}var EP,yfe;function pEt(){if(yfe)return EP;yfe=1;var e=hfe(),t=hEt(),n=mx(),r=vfe(),o=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,a=Function.prototype,s=Object.prototype,l=a.toString,c=s.hasOwnProperty,u=RegExp("^"+l.call(c).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(h){if(!n(h)||t(h))return!1;var p=e(h)?u:i;return p.test(r(h))}return EP=d,EP}var SP,bfe;function gEt(){if(bfe)return SP;bfe=1;function e(t,n){return t==null?void 0:t[n]}return SP=e,SP}var wP,Cfe;function cb(){if(Cfe)return wP;Cfe=1;var e=pEt(),t=gEt();function n(r,o){var i=t(r,o);return e(i)?i:void 0}return wP=n,wP}var xP,Afe;function mEt(){if(Afe)return xP;Afe=1;var e=cb(),t=Mu(),n=e(t,"DataView");return xP=n,xP}var IP,Efe;function vEt(){if(Efe)return IP;Efe=1;var e=cb(),t=Mu(),n=e(t,"Map");return IP=n,IP}var NP,Sfe;function yEt(){if(Sfe)return NP;Sfe=1;var e=cb(),t=Mu(),n=e(t,"Promise");return NP=n,NP}var OP,wfe;function bEt(){if(wfe)return OP;wfe=1;var e=cb(),t=Mu(),n=e(t,"Set");return OP=n,OP}var TP,xfe;function CEt(){if(xfe)return TP;xfe=1;var e=cb(),t=Mu(),n=e(t,"WeakMap");return TP=n,TP}var kP,Ife;function AEt(){if(Ife)return kP;Ife=1;var e=mEt(),t=vEt(),n=yEt(),r=bEt(),o=CEt(),i=Ry(),a=vfe(),s="[object Map]",l="[object Object]",c="[object Promise]",u="[object Set]",d="[object WeakMap]",h="[object DataView]",p=a(e),g=a(t),y=a(n),v=a(r),b=a(o),C=i;return(e&&C(new e(new ArrayBuffer(1)))!=h||t&&C(new t)!=s||n&&C(n.resolve())!=c||r&&C(new r)!=u||o&&C(new o)!=d)&&(C=function(S){var E=i(S),x=E==l?S.constructor:void 0,I=x?a(x):"";if(I)switch(I){case p:return h;case g:return s;case y:return c;case v:return u;case b:return d}return E}),kP=C,kP}var MP,Nfe;function EEt(){if(Nfe)return MP;Nfe=1;var e=Ry(),t=vx(),n="[object Arguments]";function r(o){return t(o)&&e(o)==n}return MP=r,MP}var _P,Ofe;function SEt(){if(Ofe)return _P;Ofe=1;var e=EEt(),t=vx(),n=Object.prototype,r=n.hasOwnProperty,o=n.propertyIsEnumerable,i=e(function(){return arguments}())?e:function(a){return t(a)&&r.call(a,"callee")&&!o.call(a,"callee")};return _P=i,_P}var $P,Tfe;function wEt(){if(Tfe)return $P;Tfe=1;var e=Array.isArray;return $P=e,$P}var PP,kfe;function Mfe(){if(kfe)return PP;kfe=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return PP=t,PP}var DP,_fe;function xEt(){if(_fe)return DP;_fe=1;var e=hfe(),t=Mfe();function n(r){return r!=null&&t(r.length)&&!e(r)}return DP=n,DP}var ub={exports:{}},LP,$fe;function IEt(){if($fe)return LP;$fe=1;function e(){return!1}return LP=e,LP}ub.exports;var Pfe;function NEt(){return Pfe||(Pfe=1,function(e,t){var n=Mu(),r=IEt(),o=t&&!t.nodeType&&t,i=o&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===o,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,c=l||r;e.exports=c}(ub,ub.exports)),ub.exports}var BP,Dfe;function OEt(){if(Dfe)return BP;Dfe=1;var e=Ry(),t=Mfe(),n=vx(),r="[object Arguments]",o="[object Array]",i="[object Boolean]",a="[object Date]",s="[object Error]",l="[object Function]",c="[object Map]",u="[object Number]",d="[object Object]",h="[object RegExp]",p="[object Set]",g="[object String]",y="[object WeakMap]",v="[object ArrayBuffer]",b="[object DataView]",C="[object Float32Array]",S="[object Float64Array]",E="[object Int8Array]",x="[object Int16Array]",I="[object Int32Array]",N="[object Uint8Array]",O="[object Uint8ClampedArray]",T="[object Uint16Array]",M="[object Uint32Array]",_={};_[C]=_[S]=_[E]=_[x]=_[I]=_[N]=_[O]=_[T]=_[M]=!0,_[r]=_[o]=_[v]=_[i]=_[b]=_[a]=_[s]=_[l]=_[c]=_[u]=_[d]=_[h]=_[p]=_[g]=_[y]=!1;function L(P){return n(P)&&t(P.length)&&!!_[e(P)]}return BP=L,BP}var FP,Lfe;function TEt(){if(Lfe)return FP;Lfe=1;function e(t){return function(n){return t(n)}}return FP=e,FP}var db={exports:{}};db.exports;var Bfe;function kEt(){return Bfe||(Bfe=1,function(e,t){var n=xse(),r=t&&!t.nodeType&&t,o=r&&!0&&e&&!e.nodeType&&e,i=o&&o.exports===r,a=i&&n.process,s=function(){try{var l=o&&o.require&&o.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();e.exports=s}(db,db.exports)),db.exports}var jP,Ffe;function MEt(){if(Ffe)return jP;Ffe=1;var e=OEt(),t=TEt(),n=kEt(),r=n&&n.isTypedArray,o=r?t(r):e;return jP=o,jP}var zP,jfe;function _Et(){if(jfe)return zP;jfe=1;var e=dEt(),t=AEt(),n=SEt(),r=wEt(),o=xEt(),i=NEt(),a=lfe(),s=MEt(),l="[object Map]",c="[object Set]",u=Object.prototype,d=u.hasOwnProperty;function h(p){if(p==null)return!0;if(o(p)&&(r(p)||typeof p=="string"||typeof p.splice=="function"||i(p)||s(p)||n(p)))return!p.length;var g=t(p);if(g==l||g==c)return!p.size;if(a(p))return!e(p).length;for(var y in p)if(d.call(p,y))return!1;return!0}return zP=h,zP}var $Et=_Et();const PEt=ta($Et);var zfe="scripts_editor_ohkkdt0",Xx="scripts_editor_ohkkdt1",VP="scripts_editor_ohkkdt2",DEt="scripts_editor_ohkkdt3",Vfe="scripts_editor_ohkkdt4",Hfe="scripts_editor_ohkkdt5",LEt="scripts_editor_ohkkdt6",BEt="scripts_editor_ohkkdt7",FEt="scripts_editor_ohkkdt8";const Wfe=e=>f.jsx(Cn,{...e,direction:"vertical",size:10}),Kfe=A.memo(({keyId:e,Icon:t,label:n,active:r,color:o,isLongLabel:i,onDragStart:a})=>{const s=A.useCallback(l=>a(l,e),[a,e]);return f.jsxs(yt,{draggable:!0,type:"text",style:{minHeight:i?62:52},className:r?`${VP} ${DEt} `:`${VP}`,onDragStart:s,children:[f.jsx("span",{className:Vfe,style:{color:o},children:f.jsx(t,{})}),f.jsx("span",{className:Hfe,children:n})]},e)},(e,t)=>e.keyId===t.keyId&&e.label===t.label&&e.active===t.active&&e.color===t.color&&e.isLongLabel===t.isLongLabel&&e.onDragStart===t.onDragStart),jEt=()=>{const[e,t]=kx(),{BLOCKS_ENABLED:n}=Xt(),r=A.useCallback((s,l)=>{s.dataTransfer.effectAllowed="move",requestAnimationFrame(()=>t(l))},[t]),o=A.useCallback(s=>n==null?void 0:n.includes(s),[n]),i=A.useMemo(()=>vE.filter(s=>o(s.key)&&s.group===1),[o]),a=A.useMemo(()=>vE.filter(s=>o(s.key)&&s.group===2),[o]);return PEt(n)?null:f.jsxs("div",{className:zfe,children:[f.jsx(Ed,{className:Xx,wrapperTag:Wfe,children:i.map(s=>{const l=s.icon,c=s.active,u=s.label.includes(`
861
861
  `)||s.label.length>9;return f.jsx(Kfe,{keyId:s.key,Icon:l,label:s.label,active:c,color:mc[s.key],isLongLabel:u,onDragStart:r},s.key)})}),f.jsx(Ed,{className:Xx,wrapperTag:Wfe,children:a.map(s=>{const l=s.icon,c=s.active,u=s.label.includes(`
862
862
  `)||s.label.length>9;return f.jsx(Kfe,{keyId:s.key,Icon:l,label:s.label,active:c,color:mc[s.key],isLongLabel:u,onDragStart:r},s.key)})})]})},zEt=A.memo(jEt),VEt=e=>{const{BLOCKS_ENABLED:t}=Xt(),[n,r]=kx(),o=(c,u)=>{c.dataTransfer.effectAllowed="move",requestAnimationFrame(()=>r(u))},i=e.filter(c=>t.includes(c.key)),a={},s=[];i.forEach(c=>{c.group?(a[c.group]||(a[c.group]=[]),a[c.group].push(c)):s.push(c)});const l=c=>{const u=c.icon,d=c.iconProps||{},h=[be.BRANCH,be.DELAY,be.AI_AGENT,be.AUTO_FLOW_HTTP_REQUEST].includes(c.key);return f.jsx(yt,{className:LEt,draggable:!0,onDragStart:p=>o(p,c.key),icon:f.jsx("div",{className:`${BEt} ${h?FEt:""}`,style:{color:c.color??mc[c.key]},children:f.jsx(u,{...d})}),children:f.jsxs(Ke,{vertical:!0,align:"flex-start",justify:"center",style:{minWidth:0},children:[f.jsx(ge.Text,{strong:!0,ellipsis:{tooltip:c.label,expanded:!1},children:c.label}),f.jsx(ge.Text,{ellipsis:{tooltip:c.description,expanded:!1},type:"secondary",style:{fontSize:12},children:c.description})]})},c.key)};return f.jsxs(f.Fragment,{children:[s.map(l),Object.entries(a).map(([c,u])=>f.jsxs("div",{children:[f.jsx(ge.Text,{type:"secondary",strong:!0,style:{fontSize:13,marginLeft:8},children:c}),u.map(l)]},c))]})},HEt=()=>{const{BLOCKS_ENABLED:e}=Xt();if(nt.isEmpty(e))return f.jsx(f.Fragment,{});const t=a=>{var s;return(s=a.items)!=null&&s.length?a.items.some(l=>e.includes(l.key)):e.includes(a.key)},n=a=>JT.filter(s=>s.group===a).filter(s=>t(s)),r=a=>{var u;const s=a.icon,l=a.iconProps||{},c=a.label.includes(`
863
863
  `)||a.label.length>9;return f.jsx(tu,{content:(u=a.items)!=null&&u.length?VEt(a.items):null,overlayInnerStyle:{padding:8},trigger:"hover",placement:"rightTop",children:f.jsxs(yt,{type:"text",className:VP,style:{minHeight:c?64:58,minWidth:c?64:58},children:[f.jsx("span",{className:Vfe,style:{color:a.color||mc[a.key]},children:f.jsx(s,{...l})}),f.jsx("span",{className:Hfe,children:a.label})]})},a.key)},o=n(1),i=n(2);return f.jsxs("div",{className:zfe,children:[o.length>0&&f.jsx(Ed,{className:Xx,wrapperTag:a=>f.jsx(Cn,{...a,direction:"vertical",size:10,style:{}}),children:o.map(r)}),i.length>0&&f.jsx(Ed,{className:Xx,wrapperTag:a=>f.jsx(Cn,{...a,direction:"vertical",size:10}),children:i.map(r)})]})},WEt=A.memo(HEt),KEt=()=>f.jsxs("div",{children:[f.jsx(R.Item,{name:"personalization",valuePropName:"checked",label:null,style:{marginBottom:8},children:f.jsx(Fr,{children:f.jsxs(Ke,{gap:12,align:"center",children:["Cá nhân hoá",f.jsx(pr,{title:"Cá nhân hoá",children:f.jsx(md,{color:"red"})})]})})}),f.jsx(R.Item,{name:"voice_induction_wait_until_finish_speaking",valuePropName:"checked",label:null,style:{marginBottom:8},children:f.jsx(Fr,{children:f.jsxs(Ke,{gap:12,align:"center",children:["Cảm ứng giọng nói - Chờ khách nói hết",f.jsx(pr,{title:"Cảm ứng giọng nói - Chờ khách nói hết",children:f.jsx(md,{color:"red"})})]})})}),f.jsx(R.Item,{name:"voice_induction_interrupt",valuePropName:"checked",label:null,style:{marginBottom:8},children:f.jsx(Fr,{children:f.jsxs(Ke,{gap:12,align:"center",children:["Cảm ứng giọng nói - Cho phép xen ngang",f.jsx(pr,{title:"Cảm ứng giọng nói - Cho phép xen ngang",children:f.jsx(md,{color:"red"})})]})})}),f.jsx(R.Item,{name:"gender_identity",valuePropName:"checked",label:null,style:{marginBottom:8},children:f.jsx(Fr,{children:f.jsxs(Ke,{gap:12,align:"center",children:["Nhận diện giới tính",f.jsx(pr,{title:"Nhận diện giới tính",children:f.jsx(md,{color:"red"})})]})})})]});var qEt="scripts_editor_3c0va90",UEt="scripts_editor_3c0va91",GEt="scripts_editor_3c0va93",QEt="scripts_editor_3c0va94",REt="scripts_editor_3c0va95",YEt="scripts_editor_3c0va96",hp="scripts_editor_3c0va97",XEt="scripts_editor_3c0va98",ZEt="scripts_editor_3c0va99";const JEt=()=>f.jsxs("div",{children:[f.jsx(ge.Paragraph,{type:"secondary",children:"Nếu bạn dùng node agent thì bạn nên điền prompt. Bạn có thể không dùng prompt đối với kịch bản dùng giọng ghi âm."}),f.jsx(R.Item,{name:"al_model",label:"AI Model",layout:"vertical",children:f.jsx(ise,{})}),f.jsx(R.Item,{name:"prompt_system",className:XEt,label:f.jsx(Ke,{align:"center",justify:"space-between",style:{width:"100%"},children:f.jsx(ge.Text,{children:"Prompt hệ thống"})}),layout:"vertical",children:f.jsx(Nt.TextArea,{placeholder:"Nhập prompt hệ thống",rows:4,className:ZEt})})]}),eSt="infinite_filter_voice",tSt=({enabled:e=!0})=>{const{axiosInstance:t,context:{COMPANY_ID:n}}=Xt();return Fa({queryKey:[eSt,n??""],queryFn:({pageParam:r=1})=>t.get("/voice"),enabled:e,staleTime:1e3*60*10,refetchOnMount:!1,retry:1})},nSt=({dataDefault:e,...t})=>{const[n,r]=A.useState([]),{data:o,isLoading:i}=tSt({enabled:!0});A.useEffect(()=>{const s=[...e?nt.isArray(e)?e:[e]:[],...(o==null?void 0:o.data)||[]],l=nt.uniqBy(s,"id");r(l)},[o==null?void 0:o.data,e]);const a=A.useMemo(()=>n.map(({title:s,id:l})=>({value:l,label:s,key:l})),[n]);return f.jsx(In,{options:a,allowClear:!0,showSearch:!0,filterOption:!1,loading:i,placeholder:"Chọn giọng bot",style:{width:"100%"},...t})},rSt=()=>{const e=R.useFormInstance(),t=R.useWatch("voice_choice",e);return f.jsx(f.Fragment,{children:f.jsx(R.Item,{label:null,name:"voice_choice",children:f.jsxs(ln.Group,{style:{width:"100%"},children:[f.jsxs(Nn,{gutter:12,children:[f.jsx(at,{span:18,children:f.jsxs(Ke,{vertical:!0,gap:8,children:[f.jsx(ln,{value:yv.BOT,children:"Sử dụng giọng bot"}),f.jsx(Io,{isOpen:t===yv.BOT,children:f.jsx(R.Item,{label:null,name:"bot_voice",children:f.jsx(nSt,{})})})]})}),f.jsx(at,{span:6,children:f.jsx(Io,{isOpen:t===yv.BOT,children:f.jsxs(Ke,{gap:12,children:[f.jsx(R.Item,{label:"Tốc độ",name:"speed_bot_voice",layout:"vertical",children:f.jsx(ci,{min:.1,max:2,step:.1,style:{width:"100%"}})}),f.jsx(R.Item,{label:"Âm lượng",name:"volume_bot_voice",layout:"vertical",children:f.jsx(ci,{min:.1,max:2,step:.1,style:{width:"100%"}})})]})})})]}),f.jsx(ln,{value:yv.CLONE,children:"Sử dụng giọng nhân bản"})]})})})},Zx="get_list_connector_key",oSt=(e,t,n)=>{const r=[Zx,e,t];return!(n!=null&&n.pagination)&&!(n!=null&&n.currentFilters)?r:[r[0],r[1],r[2],n]};function iSt({currentFilters:e,pagination:t,enabled:n=!0}){const{axiosInstance:r,context:{COMPANY_ID:o,CALLBOTSCENARIO_ID:i}}=Xt();return Fa({queryKey:oSt(o,i,{pagination:t,currentFilters:e}),queryFn:async()=>await r.get(`/company/${o}/callbotscenario/${i}/connector`,{params:{...t,...e}}),enabled:o!==void 0&&!!i&&n,retry:1,staleTime:0,gcTime:0,refetchOnMount:"always"})}const aSt=()=>{const{axiosInstance:e,context:{COMPANY_ID:t,CALLBOTSCENARIO_ID:n}}=Xt();return Bf({mutationFn:async({raw_file:r,title:o,voice_type:i})=>{if(!t||!n)throw new Error("COMPANY_ID and CALLBOTSCENARIO_ID are required");const a=new FormData;r&&a.append("raw_file",r),a.append("title",o),a.append("voice_type",i);try{return(await e.postForm(`/company/${t}/callbotscenario/${n}/connector`,a)).data}catch(s){throw s}}})},qfe=({form:e,onOpenGlobalSettingModal:t})=>{const{isReadOnly:n}=Rn(),[r,o]=A.useState(),i=R.useWatch("voice_type",e),a=R.useWatch("raw_file",e),{emit:s}=eb(),l=A.useMemo(()=>a?a instanceof File?URL.createObjectURL(a):typeof a=="string"?a:null:null,[a]);return f.jsxs(f.Fragment,{children:[f.jsx(R.Item,{name:"raw_file",hidden:!0}),f.jsx(R.Item,{label:"Tên câu nối",name:"title",rules:[{required:!0,transform:c=>c==null?void 0:c.trim(),message:"Vui lòng nhập tên câu nối"}],children:f.jsx(Nt,{placeholder:"Nhập mô tả ngắn gọn",disabled:n})}),f.jsx(R.Item,{name:"voice_type",initialValue:$l.VOICE_AI,children:f.jsxs(ln.Group,{disabled:n,style:{display:"flex",flexDirection:"column",gap:12},children:[f.jsxs(ln,{value:$l.VOICE_AI,children:["Giọng bot",f.jsx(yt,{style:{marginLeft:8},icon:f.jsx(q2,{}),iconPosition:"end",type:"link",onClick:()=>{s("openGlobalSettingModal",{}),t==null||t()},children:"Cài đặt giọng bot của kịch bản"})]}),f.jsx(ln,{value:$l.VOICE_RECORD,children:"Giọng ghi âm"})]})}),f.jsx(R.Item,{name:"raw_file",dependencies:["voice_type"],rules:[({getFieldValue:c})=>({validator(u,d){return c("voice_type")!==$l.VOICE_RECORD||d?Promise.resolve():Promise.reject(new Error("Vui lòng ghi âm hoặc tải lên file âm thanh"))}})],children:f.jsxs(f.Fragment,{children:[f.jsx(Io,{isOpen:i===$l.VOICE_RECORD&&!a,children:f.jsxs(Ke,{align:"center",gap:12,children:[!r&&f.jsx(Px,{beforeUpload:()=>{o(!1)},onUpload:async c=>{e.setFieldValue("raw_file",c)}}),(r||nt.isUndefined(r))&&f.jsx(_x,{onStartRecord:()=>{o(!0)},onFinishRecord:async c=>{e.setFieldValue("raw_file",c),o(void 0)}})]})}),f.jsx(Io,{isOpen:!!a&&i===$l.VOICE_RECORD,children:f.jsx(dv,{disabled:n,url:l,formPath:[["raw_file"]],onDelete:()=>{o(void 0)}})})]})})]})},sSt=()=>{const e=Zl(),{isOpen:t,onOpen:n,onClose:r}=Eo(),[o]=R.useForm(),{mutateAsync:i,isPending:a}=aSt(),s=async l=>{await i({...l,raw_file:(l==null?void 0:l.voice_type)===$l.VOICE_RECORD?l.raw_file:null},{onSuccess:()=>{iu.success("Tạo từ nối thành công"),e.invalidateQueries({queryKey:[Zx],exact:!1})}}),r()};return f.jsxs(f.Fragment,{children:[f.jsx(yt,{icon:f.jsx(si,{}),onClick:n,type:"primary",children:"Thêm từ nối"}),f.jsx(to,{open:t,title:"Thêm câu nối trong kịch bản",onCancel:r,cancelText:"Hủy",okText:"Lưu",destroyOnHidden:!0,footer:f.jsxs(Ke,{align:"center",justify:"center",gap:8,children:[f.jsx(yt,{onClick:r,children:"Hủy"}),f.jsx(yt,{type:"primary",onClick:o.submit,loading:a,children:"Lưu"})]}),children:f.jsx(R,{form:o,onFinish:s,layout:"vertical",preserve:!1,children:f.jsx(qfe,{form:o,onOpenGlobalSettingModal:r})})})]})};function lSt(){const{axiosInstance:e,context:{COMPANY_ID:t,CALLBOTSCENARIO_ID:n}}=Xt();return Bf({mutationFn:async({CONNECTOR_ID:r})=>e.delete(`/company/${t}/callbotscenario/${n}/connector/${r}`),onError:r=>{var a;const o=(a=r.response)==null?void 0:a.data,i=(o==null?void 0:o.error_messages)??"Đã có lỗi xảy ra";iu.error(i)}})}const cSt=({id:e})=>{const t=Zl(),{mutateAsync:n}=lSt(),r=async()=>{try{await n({CONNECTOR_ID:e},{onSuccess:()=>{iu.success("Xoá từ nối thành công"),t.invalidateQueries({queryKey:[Zx],exact:!1})}})}catch(o){console.error("Failed to delete connector:",o)}};return f.jsx(au,{title:f.jsx("span",{children:"Bạn có chắc chắn muốn xoá?"}),onConfirm:r,okText:"Có",cancelText:"Không",children:f.jsx(yt,{danger:!0,type:"text",icon:f.jsx(aa,{})})})},uSt="get_connector_detail_key";function dSt({CONNECTOR_ID:e,enabled:t=!0}){const{axiosInstance:n,context:{COMPANY_ID:r,CALLBOTSCENARIO_ID:o}}=Xt();return Fa({queryKey:[uSt,r,o,e],queryFn:async()=>await n.get(`/company/${r}/callbotscenario/${o}/connector/${e}`),enabled:r!==void 0&&!!o&&t,retry:1,staleTime:0,gcTime:0,refetchOnMount:"always"})}const fSt=()=>{const{axiosInstance:e,context:{COMPANY_ID:t,CALLBOTSCENARIO_ID:n}}=Xt();return Bf({mutationFn:async({raw_file:r,title:o,voice_type:i,CONNECTOR_ID:a})=>{if(!t||!n)throw new Error("COMPANY_ID and CALLBOTSCENARIO_ID are required");const s=new FormData;r&&r instanceof File&&s.append("raw_file",r),s.append("title",o),s.append("voice_type",i);try{return(await e.patchForm(`/company/${t}/callbotscenario/${n}/connector/${a}`,s)).data}catch(l){throw l}}})},hSt=({CONNECTOR_ID:e})=>{const t=Zl(),{isOpen:n,onOpen:r,onClose:o}=Eo(),[i]=R.useForm(),{data:a,isLoading:s}=dSt({CONNECTOR_ID:e,enabled:n}),{mutateAsync:l,isPending:c}=fSt();A.useEffect(()=>{var d,h;a&&i.setFieldsValue({title:a.data.title,voice_type:a.data.voice_type,raw_file:(h=(d=a.data)==null?void 0:d.file)==null?void 0:h.file})},[a]);const u=async d=>{await l({...d,raw_file:(d==null?void 0:d.voice_type)===$l.VOICE_RECORD?d.raw_file:null,CONNECTOR_ID:e},{onSuccess:()=>{iu.success("Cập nhật từ nối thành công"),t.invalidateQueries({queryKey:[Zx],exact:!1})}}),o()};return f.jsxs(f.Fragment,{children:[f.jsx(yt,{type:"text",icon:f.jsx(pQ,{}),onClick:r}),f.jsx(to,{loading:s,open:n,title:"Thêm câu nối",onCancel:o,cancelText:"Hủy",okText:"Lưu",destroyOnHidden:!0,footer:f.jsxs(Ke,{align:"center",justify:"center",gap:8,children:[f.jsx(yt,{onClick:o,children:"Hủy"}),f.jsx(yt,{type:"primary",onClick:i.submit,loading:c,children:"Lưu"})]}),children:f.jsx(R,{form:i,onFinish:u,layout:"vertical",preserve:!1,children:f.jsx(qfe,{form:i,onOpenGlobalSettingModal:o})})})]})},pSt=({item:e})=>{const t=e==null?void 0:e.file,n=e.voice_type===$l.VOICE_RECORD;return f.jsx(f1.Item,{children:f.jsxs(fo,{style:{boxShadow:"0 2px 8px 0 rgba(0, 0, 0, 0.15)"},variant:"borderless",title:e.title,extra:[f.jsx(hSt,{CONNECTOR_ID:e.id}),f.jsx(cSt,{id:e.id})],children:[n?f.jsxs(Nn,{gutter:12,children:[f.jsx(at,{span:10,children:f.jsx(dv,{url:t==null?void 0:t.file,style:{maxWidth:"unset",width:"100%"}})}),f.jsx(at,{span:14,children:f.jsx(ge.Text,{type:"secondary",children:t==null?void 0:t.transcript_text})})]}):null,e.voice_type===$l.VOICE_AI?f.jsxs(ge.Text,{type:"secondary",children:["Giọng bot: ",e==null?void 0:e.voice_ai]}):null]})})},gSt=()=>{var l,c;const[e,t]=A.useState({page:1,size:5}),{data:n,isLoading:r}=iSt({pagination:e}),o=A.useCallback((u,d)=>{t(h=>({page:u,size:d??h.size}))},[]),i=A.useCallback((u,d)=>{t({page:1,size:d})},[]),a=A.useMemo(()=>{var u;return{current:e.page,pageSize:e.size,total:((u=n==null?void 0:n.data)==null?void 0:u.count)??0,showSizeChanger:!0,pageSizeOptions:["5","10","20","50"],onChange:o,onShowSizeChange:i}},[(l=n==null?void 0:n.data)==null?void 0:l.count,i,o,e.page,e.size]),s=A.useCallback(u=>f.jsx(pSt,{item:u}),[]);return f.jsxs(Ke,{vertical:!0,gap:12,children:[f.jsxs(Ke,{align:"center",justify:"space-between",children:[f.jsx(ge.Title,{level:5,children:"Danh sách từ nối"}),f.jsx(sSt,{})]}),f.jsx(f1,{loading:r,grid:{gutter:12,column:1},dataSource:((c=n==null?void 0:n.data)==null?void 0:c.results)??[],pagination:a,renderItem:s})]})},mSt="get_list_block_key",vSt=(e,t,n)=>{const r=[mSt,e,t];return!(n!=null&&n.pagination)&&!(n!=null&&n.currentFilters)?r:[r[0],r[1],r[2],n]};function ySt({currentFilters:e,pagination:t,enabled:n=!0,SCENARIO_ID:r}){const{axiosInstance:o,context:{COMPANY_ID:i}}=Xt();return Fa({queryKey:vSt(i,r,{pagination:t,currentFilters:e}),queryFn:async()=>await o.get(`/company/${i}/callbotscenario/${r}/block`,{params:{...t,...e}}),enabled:i!==void 0&&!!r&&n,retry:1,staleTime:0,gcTime:0,refetchOnMount:"always"})}const bSt={page:1,size:5},CSt={boxShadow:"0 2px 8px 0 rgba(0, 0, 0, 0.15)"},ASt={maxWidth:"unset",width:"100%"},ESt=[{label:"Mặc định",type:"default"},{label:"Nam",type:"male"},{label:"Nữ",type:"female"}],SSt=e=>e!=null&&e.length?e.reduce((t,n)=>(!n.type||!n.url||(t[n.type]=n.url),t),{}):{},wSt=({item:e,onClose:t})=>{const n=SSt(e.file),{fitView:r}=bn(),o=A.useCallback(()=>{e.slug&&(r({nodes:[{id:e.slug}],padding:.2,duration:700}),t==null||t())},[r,e.slug,t]);return f.jsx(f1.Item,{children:f.jsx(fo,{style:CSt,variant:"borderless",title:e.title,extra:f.jsx(yt,{type:"link",onClick:o,icon:f.jsx(q2,{})}),children:f.jsxs(Nn,{gutter:12,children:[f.jsx(at,{span:10,children:f.jsx(Ke,{vertical:!0,gap:8,children:ESt.map(({label:i,type:a})=>{const s=n[a];return s?f.jsxs(Nn,{gutter:12,children:[f.jsx(at,{span:6,children:f.jsx(ge.Text,{children:i})}),f.jsx(at,{span:18,children:f.jsx(dv,{url:s,style:ASt})})]},a):null})})}),f.jsx(at,{span:14,children:f.jsx(ge.Text,{type:"secondary"})})]})})})},xSt=({onClose:e})=>{var d,h;const{context:t}=Xt(),[n,r]=A.useState(bSt),{data:o,isLoading:i}=ySt({SCENARIO_ID:t.CALLBOTSCENARIO_ID,pagination:n,currentFilters:{type:be.SPEAK}}),a=A.useCallback((p,g)=>{r(y=>({page:p,size:g??y.size}))},[]),s=A.useCallback((p,g)=>{r({page:1,size:g})},[]),l=A.useMemo(()=>{var p,g;return((g=(p=o==null?void 0:o.data)==null?void 0:p.results)==null?void 0:g.filter(y=>y.type===be.SPEAK))||[]},[(d=o==null?void 0:o.data)==null?void 0:d.results]),c=A.useMemo(()=>{var p;return{current:n.page,pageSize:n.size,total:((p=o==null?void 0:o.data)==null?void 0:p.count)??0,showSizeChanger:!0,pageSizeOptions:["5","10","20","50"],onChange:a,onShowSizeChange:s}},[(h=o==null?void 0:o.data)==null?void 0:h.count,s,a,n.page,n.size]),u=A.useCallback(p=>f.jsx(wSt,{item:p,onClose:e}),[e]);return f.jsxs(Ke,{vertical:!0,gap:12,children:[f.jsxs(Ke,{align:"center",justify:"space-between",children:[f.jsx(ge.Title,{level:5,children:"Danh sách audio"}),f.jsxs(Cn,{children:[f.jsx(yt,{icon:f.jsx(Ah,{}),children:"Sinh file audio nghe trước"}),f.jsx(yt,{icon:f.jsx(jg,{}),type:"primary",children:"Tuỳ chỉnh audio"})]})]}),f.jsx(f1,{loading:i,grid:{gutter:12,column:1},dataSource:l,pagination:c,renderItem:u})]})},ISt=({onClose:e})=>{const t=[{key:"1",label:"Node bot nói",children:f.jsx(xSt,{onClose:e})},{key:"2",label:"Từ nối",children:f.jsx(gSt,{})}];return f.jsxs(Ke,{gap:16,vertical:!0,children:[f.jsxs(Ke,{align:"center",gap:12,children:[f.jsx(Mat,{className:hp}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:"Audio"})]}),f.jsx(Ir,{type:"card",items:t})]})};function NSt(){const{axiosInstance:e,context:{COMPANY_ID:t}}=Xt();return Bf({mutationFn:async({SCENARIO_ID:n,INTENT_ID:r})=>e.delete(`/company/${t}/callbotscenario/${n}/intent/${r}`),onError:n=>{var i;const r=(i=n.response)==null?void 0:i.data,o=(r==null?void 0:r.error_messages)??"Đã có lỗi xảy ra";iu.error(o)}})}const Ufe=({initialValues:e,modalTitle:t="Thêm ý định",submitText:n="Lưu",buttonProps:r,buttonText:o="Thêm ý định mới",loading:i,onSubmit:a})=>{const{isOpen:s,onOpen:l,onClose:c}=Eo(),[u]=R.useForm();A.useEffect(()=>{if(!s){u.resetFields();return}u.setFieldsValue({label:e==null?void 0:e.label,description:e==null?void 0:e.description,keywords:e==null?void 0:e.keywords,is_conversion:e==null?void 0:e.is_conversion})},[u,e,s]);const d=()=>{u.resetFields(),c()},h=async p=>{await(a==null?void 0:a(p)),d()};return f.jsxs(f.Fragment,{children:[f.jsx(yt,{icon:f.jsx(si,{}),type:"primary",onClick:l,...r,children:o}),f.jsx(to,{open:s,title:t,onCancel:d,cancelText:"Hủy",okText:n,destroyOnHidden:!0,footer:f.jsxs(Ke,{align:"center",justify:"center",gap:8,children:[f.jsx(yt,{onClick:d,children:"Hủy"}),f.jsx(yt,{type:"primary",onClick:u.submit,loading:i,children:n})]}),children:f.jsxs(R,{form:u,onFinish:h,name:"intent-form",layout:"vertical",preserve:!1,children:[f.jsx(R.Item,{label:"Tên ý định",name:"label",rules:[{required:!0,message:"Vui lòng nhập tên ý định"}],children:f.jsx(Nt,{placeholder:"Nhập tên ý định"})}),f.jsx(R.Item,{label:"Mô tả",name:"description",children:f.jsx(Nt.TextArea,{autoSize:{minRows:1,maxRows:6},placeholder:"Nhập mô tả"})}),f.jsx(R.Item,{label:"Từ khoá",name:"keywords",children:f.jsx(Nt.TextArea,{autoSize:{minRows:1,maxRows:6},placeholder:"Nhập từ khoá, cách nhau bởi dấu phẩy"})}),f.jsx(R.Item,{name:"is_conversion",valuePropName:"checked",label:null,initialValue:!1,children:f.jsx(Fr,{children:"Đặt làm chuyển đổi"})})]})})]})},OSt=()=>{var x,I;const{context:e}=Xt(),t=a_(),n=e.CALLBOTSCENARIO_ID,r=Zl(),[o,i]=A.useState({page:1,size:10}),{data:a,isLoading:s}=Dat({SCENARIO_ID:n,pagination:o}),{mutateAsync:l,isPending:c}=s_(),{mutateAsync:u,isPending:d}=i_(),{mutateAsync:h,isPending:p}=NSt(),g=async()=>{await Promise.all([r.invalidateQueries({queryKey:Zm(e.COMPANY_ID,n)}),r.invalidateQueries({queryKey:Xm(e.COMPANY_ID,n)})])},y=async N=>{await l({SCENARIO_ID:n,label:N.label,description:N.description,keywords:N.keywords,is_conversion:N.is_conversion}),await g()},v=async(N,O)=>{const T=await u({SCENARIO_ID:n,INTENT_ID:N,label:O.label,description:O.description,keywords:O.keywords,is_conversion:O.is_conversion});t({dataKey:"conditions",item:r_(T.data)}),await g()},b=async N=>{await h({SCENARIO_ID:n,INTENT_ID:N}),await g()},C=A.useCallback((N,O)=>{i(T=>({page:N,size:O??T.size}))},[]),S=A.useCallback((N,O)=>{i({page:1,size:O})},[]),E=[{title:"Ý định",dataIndex:"label",key:"label"},{title:"Mô tả",dataIndex:"description",key:"description"},{title:"Từ khoá",dataIndex:"keywords",key:"keywords"},{title:"Đặt làm chuyển đổi",dataIndex:"is_conversion",key:"is_conversion",align:"center",render:(N,O)=>O!=null&&O.is_conversion?f.jsx(KO,{style:{fontSize:20},twoToneColor:"#A0D911"}):null},{title:"Hành động",dataIndex:"action",key:"action",render:(N,O)=>{var M;const T=((M=O.id)==null?void 0:M.toString())??"";return f.jsxs(Ke,{align:"center",children:[f.jsx(Ufe,{buttonProps:{size:"large",type:"text",icon:f.jsx(jg,{})},buttonText:null,modalTitle:"Cập nhật ý định",submitText:"Cập nhật",initialValues:O,loading:d,onSubmit:_=>v(T,_)}),f.jsx(au,{title:null,description:"Bạn có chắc chắn muốn xoá ý định này?",okText:"Có",cancelText:"Không",disabled:O.is_using,onConfirm:()=>b(T),children:f.jsx(yt,{size:"large",type:"text",icon:f.jsx(aa,{}),danger:!0,disabled:O.is_using||p})})]})}}];return f.jsxs(Ke,{gap:16,vertical:!0,children:[f.jsxs(Ke,{align:"center",justify:"space-between",children:[f.jsxs(Ke,{align:"center",gap:12,children:[f.jsx(_at,{className:hp}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:"Ý định"})]}),f.jsx(Ufe,{loading:c,onSubmit:y})]}),f.jsx(gs,{rowKey:N=>{var O;return((O=N.id)==null?void 0:O.toString())??""},dataSource:((x=a==null?void 0:a.data)==null?void 0:x.results)??[],columns:E,loading:s,pagination:{current:o.page,pageSize:o.size,total:((I=a==null?void 0:a.data)==null?void 0:I.count)??0,showSizeChanger:!0,onChange:C,onShowSizeChange:S}})]})},Jx={fileIcons:{XLS:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyEAAAPBCAYAAADpqqVxAAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4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m4MBuDylt+o+WJMnggBJkKEsAYZIkSAAKzOoPizmDT7QoAJESGsxYRvSS/POA0LYJXSaVlF8UhM2nBpwl/7gWkkQlid5U3pk303rKy+mdoLArB65WiT+oQVIgQYOxHC6uTYlF6UDwYAq7e8ejzZe0PKyHQoCTBNRAirNJzsO2HLG9KNYgGs3VdiokorIcDYiRBWqZj0xkQBArAu5Tdiogob04GxEyGsTjHh5XirIADrM+idjEkanZAFMF4ihNUpy20xSWUx2W+iAF2VTsmK4smYJCECjJkIYZUmuRyfjuYdTvYbKECXleVk38gZ9Cb7RhQwdUQIq1T+SkyKY3kBNqaICa8ml/aFAGMlQlityX0DKkQIwIYUxbMxSUXPOBYwViKEBij+JQBYv7LwZg7QKiKEq1u+LX2CisletAXQdTNLIgRoFRHC1W0emAUGmGaTPiERmDoiBAC4ChcWAuMlQgAAgKxECAAAkJUIAQAAshIhAABAViIEAADISoQAAABZiRAAACArEQIAAGQlQgAAgKxECAAAkJUIAQAAshIhAABAViIEAADISoQAAABZiRAAACArEQIAAGQlQgAAgKxECAAAkJUIAQAAshIhAABAViIEAADISoQAAABZiRAAACArEQIAAGQlQgAAgKxECAAAkJUIAQAAshIhAABAViIEAADISoQAAABZiRAAACArEQIAAGQlQgAAgKxECAAAkJUIAQAAshIhAABAViIEAADISoQAAABZiRAAACArEQIAAGQlQgAAgKxmA2pXvjcGve3BRmyPIvIaFJ+Nsng26J7cr6Wi3FZ9DXggWL/0ZwjQIiKEJrileui5JWiZ4r3ZH1bpqGJr9Vq6K9gAn4xAuxjHAgAAshIhAABAViIEAADISoQAAABZiRAAACArEQIAAGQlQgAAgKxECAAAkJUIAQAAshIhAABAViIEAADISoQAAABZiRAAACArEQIAAGQlQgAAgKxECAAAkJUIAQAAshIhAABAViIEAADISoQAAABZiRAAACArEQIAAGQlQgAAgKxECAAAkJUIAQAAshIhAABAViIEAADIajagbmU8GEX5YLABvT+p/iBviZyK8t7qf7ungg4qvhpZlWeqH/YE61cW26KIgwHQEiKE+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k3nhiuCOgZgIEAOZZmg1JFxcW5V2WZc29pVhxWzr1EyAAQDUJUj4Y4+K3LMuae0tViIoQaiVAAIBVl41OvbEsy5G982xZhFAnAQIAvNX0yF4hMs9WI+TYcClgxgQIAHB+54aIPSLzZjnOiBBmT4AAABc3DZF0m7rN6vNmRxUh9wfMkAABANYnhUfarL56h8inLc+aG8N4bChCmBkBAgBs3KA8MpkVGSz8z5NZkYgjQX8VsSeODvcFzEAR//m3fzEAALbssm1Rrny8mhn5eDXE2Fn9wragX4rYHx85dE/AFggQAKAe4xQhxU3Vj26t3tL3gqQPRAhbJEAAgDzGg5uiKG+MsrgxVoNElHTVQrEnPvzwAwGbIEAAgAZdti3GKzdVUbI9ihQmZRUk5S9VQ5Rtk7eyrH49todQaZ8ibqlmQh4N2KDFAABozGsvxCBtYC/TT7795q+XQcuNX3ktYBOcggUAAGQjQAAAgGwECAAAkI0AAQAAshEgAABANgIEAADIRoAAAADZCBAAACAbAQIAAGQjQAAAgGwECAAAkI0AAQAAshEgAABANgIEAADIRoAAAADZCBAAACAbAQIAAGQjQAAAgGwECAAAkI0AAQAAshEgAABANgIEAADIRoAAAADZCBAAACAbAQIAAGQjQAAAgGwECAAAkI0AAQAAshEgAABANgIEAADIRoAAAADZCBAAACAbAQIAAGQjQAAAgGwECAAAkI0AAQAAshEgAABANgIEAADIRoAAAADZCBAAACAbAQIAAGQjQAAAgGwECAAAkI0AAQAAshEgAABANgIEAADIRoAAAADZCBAAACAbAQIAAGQjQAAAgGwECAAAkI0AAQAAshEgAABANgIEAADIRoAAAADZCBAAACAbAQIAAGQjQAAAgGwECAAAkI0AAQAAshEgAABANgIEAADIRoAAAADZCBAAACAbAQIAAGQjQAAAgGwECAAAkI0AAQAAshEgAABANgIEAADIRoAAAADZCBAAACAbAQIAAGQjQAAAgGwECAAAkI0AAQAAshEgAABANgIEAADIRoAAAADZLAZ03mXboojtMSqvn/y0eP17gDYpi6ff+PFC9ePytacDYA4JEDqmio1yvDPKcmf11fy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ViebP0uTIwEAoBtr+YebRYiVEMZrkmcCAEBXnt8sQAorIYzbieZC+/HxAABQ06V8bfIPt/qLVkIYt7U8FZvUAQBq23Z/rghh3GxSBwCo7Xy7CnJ+u58gQhi/r03Kkb0vBwCAg3ZpsyN5NxIhzIfZWNalAABwcNbyua02o99MhDAfyljWwjREAAA4GOU0rNd28hOdjsV8OdEcbz+eDQAA++nlfG3yuZ3+ZCshzJeyP2SSbwYAgP1y6cbo+46JEObPao63IbKjpUIAALZVAuSxGyeS7phxLObT8Wa5TfCL7WfLAQBgLy7fCJBdv7lrJYT5VE5tKP/SODELAGCvntlLgBRWQphvVkQAAPbiqTtdSLgdEQJCBABgN+4qQAoRAoUQAQDYibsOkEKEwDohAgCwlXLx8+dyZvJK9oGN6bBufbO643sBAG42+xppnwKksBICm3mmKZcaPh0AgHlW3pxdbVdAypu1+8hKCGzm7OR4+/H5AADMq0lebAPksf0OkNn/NLA1+0QAgPlTbj9/Pl+bvJADYiUEtrO+T6TJNwMAMHaTvNJ+7fMLBxkgs78NsDMnmifbj6djVQQAGJ+y+vFiGx8rqUCEwG6U8axJVtrHsQAAjEFZ/VjNUwex92PrvyWweyVGFnMhTY4EAGCYLrU18Ey+Onk5lYkQuBtGtACA4ZmNXq3lhXb143I6IEJgP4gRAKD/Oo+PdSIE9lOJkbJfpMmjAQDoh0vt45t9iI91IgQOwgcb2D8VqyMAQBfKhvNJns+ZySvpGRECB202qvXZ9vF4AAAOUgmPJt9uVz3O92XVYzMiBGo53ixlMY+2TwqPWyEBAPZJCY1X2sf3+h4eNxMh0JXjzZEs5Mh0/8hC/pHjfgGAHbiUWXT8uzY6Xmmj47UMkAiBPilhstiukMyC5B+0/4YuT3+8mX67dOMBAIzXpenHSfttM/38P05/bC2vTb8dyEoHAABAr/wXOCBXRqKKeRsAAAAASUVORK5CYII="}},bv=e=>{switch(e){case"file":return A.createElement(pmt);case"link":return A.createElement(BHe);case"text":return A.createElement(FHe);case"google":return A.createElement(fmt)}};function TSt(e,t){var o;const n=(o=e==null?void 0:e.split(".").pop())==null?void 0:o.toLowerCase();let r="";switch(n){case"xls":r=Jx.fileIcons.XLS;break;case"xlsx":r=Jx.fileIcons.XLSX;break;case"csv":r=Jx.fileIcons.CSV;break;case"txt":r=Jx.fileIcons.TXT;break}return r}var fb=(e=>(e.NONE="Không",e.DAILY="Hàng ngày",e.WEEKLY="Hàng tuần",e.MONTHLY="Hàng tháng",e))(fb||{});const e3=[{id:"1",title:"https://ucall.vn/",type:"link",created_at:"2024-06-10T10:00:00Z",auto_updated:"Không"},{id:"2",title:"hlf.xlsx",type:"file",created_at:"2024-06-11T10:00:00Z",auto_updated:"Hàng ngày"},{id:"3",title:"Vinhomes Green Paradise Cần Giờ",type:"text",created_at:"2024-06-11T10:00:00Z",auto_updated:"Hàng tuần"},{id:"4",title:"Tên file Google Docs",type:"google",created_at:"2024-06-11T10:00:00Z",auto_updated:"Hàng tháng"}];var kSt="scripts_editor_7uh0go0",MSt="scripts_editor_7uh0go1";const _St=A.forwardRef((e,t)=>{const{token:{colorPrimary:n}}=tE.useToken(),{isOpen:r,onClose:o,onToggle:i}=Eo(),[a,s]=A.useState([]),l=u=>{try{const d=u.file;s(h=>[...h,d]),u.onSuccess&&u.onSuccess({})}catch{u.file.name}};A.useImperativeHandle(t,()=>({onToggle:()=>{i()}}));const c=()=>{o()};return f.jsx(to,{open:r,title:"Thêm kiến thức từ file",onCancel:c,onOk:c,cancelText:"Hủy",okText:"Lưu",destroyOnHidden:!0,footer:f.jsxs(Ke,{align:"center",justify:"center",gap:8,children:[f.jsx(yt,{onClick:c,children:"Hủy"}),f.jsx(yt,{type:"primary",onClick:c,children:"Lưu"})]}),children:f.jsxs(Ke,{vertical:!0,gap:12,children:[f.jsxs(Rg.Dragger,{accept:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, text/csv, text/plain",name:"file",customRequest:l,multiple:!0,height:180,showUploadList:!1,children:[f.jsx("p",{className:"scripts-editor-upload-drag-icon",children:f.jsx(RO,{})}),f.jsx("p",{className:"scripts-editor-upload-text",children:"Click hoặc kéo thả file vào đây để upload"}),f.jsx("p",{className:"scripts-editor-upload-hint",children:"Hỗ trợ định dạng file doc, docx, txt, csv, xlsx, xls, pdf"})]}),a==null?void 0:a.map(u=>f.jsxs("div",{className:MSt,children:[f.jsxs(Ke,{align:"center",gap:8,children:[f.jsx(B2,{preview:!1,src:TSt(u.name),width:26,height:26,alt:"file icon"}),f.jsx(ge.Text,{className:"!text-xs",style:{color:n},children:u.name})]}),f.jsx(yt,{type:"text",icon:f.jsx(aa,{}),danger:!0,onClick:()=>{s(d=>d.filter(h=>h.uid!==u.uid))}})]}))]})})}),$St=A.forwardRef((e,t)=>{const{isOpen:n,onClose:r,onToggle:o}=Eo(),[i]=R.useForm();A.useImperativeHandle(t,()=>({onToggle:()=>{o()}}));const a=()=>{r()},s=()=>{};return f.jsx(to,{open:n,title:"Thêm kiến thức từ URL",onCancel:a,onOk:i.submit,cancelText:"Hủy",okText:"Lưu",destroyOnHidden:!0,footer:f.jsxs(Ke,{align:"center",justify:"center",gap:8,children:[f.jsx(yt,{onClick:a,children:"Hủy"}),f.jsx(yt,{type:"primary",onClick:i.submit,children:"Lưu"})]}),children:f.jsxs(R,{form:i,onFinish:s,name:"knowledge-by-url-form",layout:"vertical",preserve:!1,children:[f.jsx(R.Item,{label:"URL",name:"url",rules:[{required:!0,message:"Vui lòng nhập URL!"}],children:f.jsx(Nt.TextArea,{rows:4,placeholder:"Nhập URLs, bấm enter để xuống dòng và điền URL tiếp theo"})}),f.jsx(R.Item,{label:"Tự động cập nhật",name:"auto_updated",initialValue:fb.NONE,children:f.jsx(In,{placeholder:"Chọn tần suất cập nhật",options:Object.values(fb).map(l=>({label:l,value:l}))})}),f.jsx(Xf,{message:"Dự kiến xử lý dữ liệu cần 0,5 block",type:"info",showIcon:!0})]})})}),PSt=A.forwardRef((e,t)=>{const{isOpen:n,onClose:r,onToggle:o}=Eo(),[i]=R.useForm();A.useImperativeHandle(t,()=>({onToggle:()=>{o()}}));const a=()=>{r()},s=()=>{};return f.jsx(to,{open:n,title:"Thêm kiến thức từ URL",onCancel:a,onOk:i.submit,cancelText:"Hủy",okText:"Lưu",destroyOnHidden:!0,footer:f.jsxs(Ke,{align:"center",justify:"center",gap:8,children:[f.jsx(yt,{onClick:a,children:"Hủy"}),f.jsx(yt,{type:"primary",onClick:i.submit,children:"Lưu"})]}),children:f.jsx(R,{form:i,onFinish:s,name:"knowledge-by-url-form",layout:"vertical",preserve:!1,children:f.jsx(R.Item,{label:"Nội dung",name:"content",rules:[{required:!0,message:"Vui lòng nhập nội dung"}],children:f.jsx(Nt.TextArea,{rows:4,placeholder:"Nhập nội dung"})})})})}),DSt=[{key:"1",name:"ABC",file_type:"Docs",created_at:"2024-06-10T10:00:00Z"},{key:"2",name:"ABC",file_type:"Sheets",created_at:"2024-06-10T10:00:00Z"},{key:"3",name:"ABC",file_type:"Docs",created_at:"2024-06-10T10:00:00Z"}],LSt=A.forwardRef((e,t)=>{const{isOpen:n,onClose:r,onToggle:o}=Eo(),[i]=R.useForm();A.useImperativeHandle(t,()=>({onToggle:()=>{o()}}));const a=()=>{r()},s=()=>{},l=[{title:"Tên file",dataIndex:"name"},{title:"Kiểu file",dataIndex:"file_type"},{title:"Ngày khởi tạo",dataIndex:"created_at",render:(u,d)=>f.jsx(ge.Text,{children:Un(d.created_at).format(Fie)})}],c={onChange:(u,d)=>{console.log(`selectedRowKeys: ${u}`,"selectedRows: ",d)},getCheckboxProps:u=>({disabled:u.name==="Disabled User",name:u.name})};return f.jsx(to,{open:n,title:"Thêm kiến thức từ Google",onCancel:a,onOk:i.submit,cancelText:"Hủy",okText:"Lưu",destroyOnHidden:!0,footer:f.jsxs(Ke,{align:"center",justify:"center",gap:8,children:[f.jsx(yt,{onClick:a,children:"Hủy"}),f.jsx(yt,{type:"primary",onClick:i.submit,children:"Lưu"})]}),children:f.jsxs(R,{form:i,onFinish:s,name:"knowledge-by-google-form",layout:"vertical",preserve:!1,children:[f.jsx(R.Item,{layout:"horizontal",label:"Tài khoản",name:"account",rules:[{required:!0,message:"Vui lòng chọn tài khoản!"}],children:f.jsx(In,{style:{width:200},placeholder:"Chọn tài khoản",popupRender:u=>f.jsxs(f.Fragment,{children:[u,f.jsx(ia,{}),f.jsx(yt,{style:{width:"100%"},type:"primary",children:"Tích hợp Google mới"})]})})}),f.jsx(gs,{rowSelection:{type:"checkbox",...c},columns:l,dataSource:DSt}),f.jsx(Vg,{icon:f.jsx(B2,{preview:!1,src:"/assets/images/empty.png",width:140,height:120,alt:"file icon"}),title:null,extra:f.jsx(yt,{type:"primary",children:"Tích hợp tài khoản Google"})}),f.jsx(R.Item,{label:"Tự động cập nhật",name:"auto_updated",initialValue:fb.NONE,children:f.jsx(In,{placeholder:"Chọn tần suất cập nhật",options:Object.values(fb).map(u=>({label:u,value:u}))})})]})})}),BSt=()=>{const e=A.useRef(null),t=A.useRef(null),n=A.useRef(null),r=A.useRef(null),o=[{key:"1",label:"URL(s)",icon:bv("link"),onClick:()=>{var i;return(i=e.current)==null?void 0:i.onToggle()}},{key:"2",label:"Tải file",icon:bv("file"),onClick:()=>{var i;return(i=t.current)==null?void 0:i.onToggle()}},{key:"3",label:"Nhập văn bản",icon:bv("text"),onClick:()=>{var i;return(i=n.current)==null?void 0:i.onToggle()}},{key:"4",label:"Google Drive",icon:bv("google"),onClick:()=>{var i;return(i=r.current)==null?void 0:i.onToggle()}}];return f.jsxs(f.Fragment,{children:[f.jsx(Fs,{menu:{items:o},trigger:["click"],children:f.jsx(yt,{icon:f.jsx(si,{}),type:"primary",children:"Thêm kiến thức"})}),f.jsx($St,{ref:e}),f.jsx(_St,{ref:t}),f.jsx(PSt,{ref:n}),f.jsx(LSt,{ref:r})]})},FSt=()=>{const{isOpen:e,onOpen:t,onClose:n}=Eo(),r=(o,i,a)=>console.log(a==null?void 0:a.source,o);return f.jsxs(f.Fragment,{children:[f.jsx(yt,{icon:f.jsx(gmt,{}),onClick:t,children:"Chọn từ thư viện"}),f.jsxs(to,{open:e,onCancel:n,footer:null,closeIcon:null,children:[f.jsx(Nt.Search,{placeholder:"Tìm kiếm",allowClear:!0,onSearch:r}),f.jsx(Ke,{gap:4,vertical:!0,style:{marginTop:12},children:e3==null?void 0:e3.map(o=>f.jsxs(Ke,{gap:8,className:kSt,align:"center",children:[bv(o.type),f.jsx(ge.Text,{children:o.title})]},o.id))})]})]})},jSt=()=>{const e=[{title:"Kiến thức",dataIndex:"title",key:"title",render:(t,n)=>f.jsxs(Ke,{align:"center",gap:8,children:[bv(n.type),f.jsx(ge.Text,{children:n.title})]})},{title:"Ngày khởi tạo",dataIndex:"created_at",key:"created_at",render:(t,n)=>f.jsx(ge.Text,{children:Un(n.created_at).format(Fie)})},{title:"Tự động cập nhật",dataIndex:"auto_updated",key:"auto_updated"},{title:"Hành động",dataIndex:"action",key:"action",render:()=>f.jsxs(Ke,{align:"center",children:[f.jsx(au,{title:null,description:"Bạn có chắc chắn muốn lưu vào thư viện?",okText:"Có",cancelText:"Không",children:f.jsx(yt,{size:"large",type:"text",icon:f.jsx(qO,{})})}),f.jsx(yt,{size:"large",type:"text",icon:f.jsx(OQ,{})}),f.jsx(yt,{size:"large",type:"text",icon:f.jsx(aa,{}),danger:!0})]})}];return f.jsxs(Ke,{gap:16,vertical:!0,children:[f.jsxs(Ke,{align:"center",justify:"space-between",children:[f.jsxs(Ke,{align:"center",gap:12,children:[f.jsx(Yue,{className:hp}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:"Kiến thức"})]}),f.jsxs(Ke,{align:"center",gap:12,children:[f.jsx(FSt,{}),f.jsx(BSt,{})]})]}),f.jsx(gs,{dataSource:e3,columns:e})]})},zSt=[{id:1,title:"Họ và tên",data_type:"string",description:"Tên người dùng",default_value:"Quý khác",global_identification:!0}],VSt=()=>{const e=Eo(),t=[{title:"Tên biến",dataIndex:"title",key:"title",render:(n,r)=>f.jsxs(Ke,{align:"center",gap:8,children:[f.jsx(ge.Text,{children:r.title}),f.jsx(ge.Text,{type:"secondary",children:r.data_type})]})},{title:"Mô tả",dataIndex:"description",key:"description"},{title:"Giá trị mặc định",dataIndex:"default_value",key:"default_value"},{title:"Nhận diện trong toàn bộ hội thoại",dataIndex:"global_identification",key:"global_identification",align:"center",render:(n,r)=>r!=null&&r.global_identification?f.jsx(KO,{style:{fontSize:20},twoToneColor:"#A0D911"}):null},{title:"Hành động",dataIndex:"action",key:"action",render:()=>f.jsxs(Ke,{align:"center",children:[f.jsx(au,{title:null,description:"Bạn có chắc chắn muốn lưu vào thư viện?",okText:"Có",cancelText:"Không",children:f.jsx(yt,{size:"large",type:"text",icon:f.jsx(qO,{})})}),f.jsx(yt,{size:"large",type:"text",icon:f.jsx(jg,{})}),f.jsx(yt,{size:"large",type:"text",icon:f.jsx(aa,{}),danger:!0})]})}];return f.jsxs(Ke,{gap:16,vertical:!0,children:[f.jsxs(Ke,{align:"center",justify:"space-between",children:[f.jsxs(Ke,{align:"center",gap:12,children:[f.jsx(Y2t,{className:hp}),f.jsx(ge.Title,{level:5,style:{margin:"unset"},children:"Kiến thức"})]}),f.jsx(yt,{icon:f.jsx(si,{}),type:"primary",onClick:e.onOpen,children:"Thêm biến"}),f.jsx(Hae,{disclosure:e})]}),f.jsx(gs,{dataSource:zSt,columns:t})]})},HSt=({onClose:e})=>{const t=[{label:"Kiến thức",key:"1",children:f.jsx(jSt,{})},{label:"Biến",key:"2",children:f.jsx(VSt,{})},{label:"Ý định",key:"3",children:f.jsx(OSt,{})},{label:"Audio",key:"4",children:f.jsx(ISt,{onClose:e})}];return f.jsx(Ir,{defaultActiveKey:"1",tabPosition:"left",items:t})},WSt=({open:e,value:t,onSave:n,onCancel:r})=>{const[o,i]=A.useState(t.bindings),[a,s]=A.useState(null),[l,c]=A.useState({});A.useEffect(()=>{e&&(i(t.bindings),s(null),c({}))},[e,t.bindings]),A.useEffect(()=>{if(!a)return;const p=g=>{if(g.preventDefault(),g.stopPropagation(),g.key==="Escape"){s(null);return}const y=t2t(g);if(!y){c(v=>({...v,[a]:"Phím tắt phải có Ctrl/Cmd hoặc Alt"}));return}i(v=>({...v,[a]:y})),c(v=>({...v,[a]:void 0})),s(null)};return window.addEventListener("keydown",p,!0),()=>{window.removeEventListener("keydown",p,!0)}},[a]);const u=A.useMemo(()=>o2t(o),[o]),d=A.useMemo(()=>Qx.reduce((p,g)=>(p[g.id]=l[g.id]??u.errors[g.id],p),{}),[l,u.errors]),h=()=>{u.isValid&&n({version:1,bindings:u.normalizedBindings})};return f.jsx(to,{open:e,title:"Cài đặt phím tắt",width:760,onCancel:r,destroyOnHidden:!0,footer:[f.jsx(yt,{onClick:()=>{i({...h$}),c({}),s(null)},style:{float:"left"},children:"Khôi phục mặc định"},"reset-default"),f.jsxs(Cn,{children:[f.jsx(yt,{onClick:r,children:"Huỷ"}),f.jsx(yt,{type:"primary",disabled:!u.isValid,onClick:h,children:"Lưu phím tắt"})]},"shortcut-actions")],children:f.jsxs(Ke,{vertical:!0,gap:12,children:[f.jsxs(ge.Text,{type:"secondary",children:["Mỗi action cần tổ hợp có ",f.jsx("b",{children:"Ctrl/Cmd hoặc Alt"}),". Nhấn ",f.jsx("b",{children:"Esc"})," để thoát chế độ ghi phím."]}),Qx.map(p=>{const g=!!d[p.id],y=a===p.id;return f.jsx("div",{style:{border:`1px solid ${g?"#ff4d4f":"#f0f0f0"}`,borderRadius:8,padding:12},children:f.jsxs(Ke,{justify:"space-between",align:"start",gap:16,children:[f.jsxs(Ke,{vertical:!0,gap:4,style:{flex:1},children:[f.jsx(ge.Text,{strong:!0,children:p.label}),f.jsx(ge.Text,{type:"secondary",children:p.description}),g?f.jsx(ge.Text,{type:"danger",children:d[p.id]}):null]}),f.jsxs(Ke,{vertical:!0,align:"end",gap:8,style:{minWidth:260},children:[f.jsx(Nt,{readOnly:!0,status:g?"error":void 0,value:r2t(o[p.id])}),f.jsxs(Ke,{align:"center",gap:8,children:[y?f.jsx(ms,{color:"processing",children:"Đang ghi phím..."}):null,f.jsx(yt,{onClick:()=>{c(v=>({...v,[p.id]:void 0})),s(p.id)},children:y?"Nhấn tổ hợp phím":"Gán phím"})]})]})]})},p.id)})]})})},KSt=qAt.version,qSt=X3(),USt=e=>`${e.toLowerCase()}_${Sh()}`,GSt=[{key:"1",label:f.jsxs(Ke,{gap:12,align:"center",children:[f.jsx(G2,{className:hp}),f.jsx(ge.Text,{style:{marginBottom:0},strong:!0,children:"Cài đặt giọng nói"})]}),children:f.jsx(rSt,{})},{key:"2",label:f.jsxs(Ke,{gap:12,align:"center",children:[f.jsx(Yue,{className:hp}),f.jsx(ge.Text,{style:{marginBottom:0},strong:!0,children:"Prompt"})]}),children:f.jsx(JEt,{})},{key:"4",label:f.jsxs(Ke,{gap:12,align:"center",children:[f.jsx(_Q,{className:hp}),f.jsx(ge.Text,{style:{marginBottom:0},strong:!0,children:"Cài đặt nâng cao"})]}),children:f.jsx(KEt,{})}],QSt=A.forwardRef((e,t)=>{const n=e.type,{reactFlowRef:r,instanceId:o,mode:i}=Xt(),[a,s]=jAe([]),[l,c]=zAe(HY),[u,d]=A.useState(),{screenToFlowPosition:h,fitView:p,zoomIn:g,zoomOut:y,getNodes:v,getEdges:b,deleteElements:C}=bn(),{isValidConnection:S}=BAt(),[E]=kx(),x=v_(),{flowProps:I,mode:N,toggleMode:O}=YAt(),{layout:T}=G2t(),M=nb(),{undo:_,redo:L,canUndo:P,canRedo:$}=Q2t(o),{takeSnapshotDebounced:B,takeSnapshotNow:D}=R2t(o,{snapshotDebounceMs:150}),{isOpen:F,onToggle:z,onClose:V}=Eo(),{isOpen:U,onToggle:q,onClose:W}=Eo(),{isOpen:H,onOpen:K,onClose:G}=Eo(),[Y,ne]=A.useState(()=>i2t()),[Q]=R.useForm(),ee=A.useRef(null),te=A.useRef(!1),Z=KAt(a);WAt();const J=A.useMemo(()=>n==="autocall"?"autoCallButton":"autoFlowButton",[n]),ae=zAt(),{resetCommitState:re}=UAt({cb:(we,Me)=>{var $e;!te.current||i==="view"||($e=ee.current)==null||$e.call(ee,we,Me)},enabled:!0}),pe=e.onAlertsChange||(()=>{}),fe=e.onReady,Oe=A.useCallback(()=>{D(),T(),B()},[T,B,D]),Te=A.useCallback(()=>{p({padding:.2})},[p]),je=A.useCallback(()=>{const we=v().filter($e=>$e.selected).map($e=>({id:$e.id})),Me=b().filter($e=>$e.selected).map($e=>({id:$e.id}));!we.length&&!Me.length||(D(),C({nodes:we,edges:Me}))},[C,b,v,D]),Fe=A.useMemo(()=>({undo:_,redo:L,zoomIn:g,zoomOut:y,fitView:Te,autoLayout:Oe,deleteSelection:je,toggleInteractionMode:O}),[je,Te,Oe,L,O,_,g,y]);l2t({mode:i,bindings:Y.bindings,handlers:Fe,suspended:H,onReadonlyActionBlocked:()=>{M.warning({key:"readonly-shortcut-warning",content:"Chế độ hiện tại không cho phép chỉnh sửa flow bằng phím tắt"})}});const Ee=A.useCallback(we=>(B(),c(Me=>$C({...we,type:n==="autocall"?"autoCallButton":"autoFlowButton"},Me))),[n,c,B]),ke=A.useCallback(we=>{we.preventDefault(),we.dataTransfer.dropEffect="move"},[]),Ve=A.useCallback(we=>{if(we.preventDefault(),!E||we.target.closest('[data-group-drop-zone="true"]'))return;const Ne=h({x:we.clientX,y:we.clientY}),ut={id:USt(E),type:E,position:Ne,data:{title:Jg[E],...I1(E)},deletable:!0,...N1[E]};s(At=>At.concat(ut))},[h,E,s]),Le=A.useCallback(we=>{p({nodes:[{id:we}],padding:.2,duration:700})},[p]),Se=A.useCallback(we=>{s(Me=>s5(we,Me)),B()},[s,B]),Ae=A.useCallback(we=>{c(Me=>l5(we,Me)),B()},[c,B]),Ie=A.useCallback(we=>{const Me=ae({deletedNodes:we,edges:l,nodes:a,defaultEdgeType:J});Me.length!==0&&c($e=>Me.reduce((Ne,Xe)=>$C(Xe,Ne),$e))},[J,l,ae,a,c]),_e=(we,Me)=>{Me&&Q.setFieldsValue(Me),te.current=!1;const $e=Array.isArray(we.nodes)&&!nt.isEmpty(we.nodes)?we.nodes:n==="autocall"?VY:[],Ne=Array.isArray(we.edges)?we.edges.map(Xe=>({...Xe,selectable:i==="edit"})):[];s($e),c(Ne),requestAnimationFrame(()=>{we.viewport?u.setViewport(we.viewport):u.fitView({padding:.2,duration:0,maxZoom:1}),requestAnimationFrame(()=>{re(),te.current=!0})})};A.useImperativeHandle(t,()=>({getFlowJson:()=>({flow:{...u==null?void 0:u.toObject(),type:n==="autocall"?"autocall":"autoflow",version:KSt},globalSetting:Q.getFieldsValue()}),loadFlowJson:(we,Me)=>{if(!we)return!0;if(!u)throw new Error("React Flow instance is not ready yet.");return _e(we,Me),!0},moveToNode:we=>{Le(we)},toggleGlobalSetting:()=>{z()},toggleResourceCMS:()=>{q()},useFlowChange:(we,Me)=>{ee.current=Me?we:null},instanceId:o})),A.useEffect(()=>(u&&fe&&fe(!0),()=>{fe&&fe(!1)}),[fe,u]),lE(()=>{pe(x)},[x]);const Be=A.useCallback(we=>{d(we)},[]),Ue=async we=>{var Me;await((Me=ee.current)==null?void 0:Me.call(ee,void 0,we)),M.success("Đã lưu cài đặt kịch bản"),V()},qe=A.useCallback(we=>{ne(we),a2t(we),G(),M.success("Đã lưu cài đặt phím tắt")},[M,G]),Pe=A.useCallback((we,Me)=>{var $t;if(!(Me!=null&&Me.fromNode))return;const{clientX:$e,clientY:Ne}=we,Xe=h({x:$e,y:Ne}),ut=a.find(ct=>{const{x:et,y:St}=ct.position,{width:dt=0,height:Ct=0}=ct.measured;return Xe.x>=et&&Xe.x<=et+dt&&Xe.y>=St&&Xe.y<=St+Ct});if(!ut)return;const At={source:Me.fromNode.id,sourceHandle:($t=Me.fromHandle)==null?void 0:$t.id,target:ut.id};if(S(At))return B(),c(ct=>{var et;return $C({source:Me.fromNode.id,target:ut.id,sourceHandle:(et=Me.fromHandle)==null?void 0:et.id,targetHandle:null,type:n==="autocall"?"autoCallButton":"autoFlowButton"},ct)})},[S,a,h,c,n,B]),Je=A.useMemo(()=>i!=="edit"?null:n==="autocall"?f.jsx(zEt,{}):f.jsx(WEt,{}),[i,n]);return f.jsxs("div",{className:qEt,children:[f.jsx("div",{className:UEt,children:f.jsxs("div",{className:GEt,ref:r,children:[f.jsxs(BAe,{nodes:Z,edges:l,nodeTypes:Due,edgeTypes:LAt,onNodesChange:Se,onNodesDelete:Ie,onEdgesChange:Ae,isValidConnection:S,onConnect:Ee,onConnectEnd:Pe,onInit:Be,onDrop:Ve,onDragOver:ke,onNodeDragStop:()=>{D()},connectionMode:Hf.Strict,style:{backgroundColor:"#F6F9FF"},...I,children:[f.jsx(lEt,{canUndo:P,canRedo:$,onUndo:_,onRedo:L,onLayout:Oe,onFitView:Te,onZoomOut:y,onZoomIn:g,interactionMode:N,onToggleInteractionMode:O,isReadOnly:i==="view",onOpenShortcutSettings:K}),f.jsx(u2e,{nodeColor:Kx,pannable:!0,zoomable:!0,maskColor:"#F7F7F7",nodeStrokeWidth:4,nodeStrokeColor:we=>{if(!Kx(we))return"transparent";const Me=Kx(we);return Me.startsWith("linear-gradient")?Me:_i(Me).darken(.25).hex()},nodeBorderRadius:12,className:QEt})]}),Je]})}),f.jsx(O2,{title:"Cài đặt kịch bản",open:F,zIndex:2e3,extra:f.jsxs(Cn,{children:[f.jsx(yt,{onClick:V,children:"Huỷ"}),f.jsx(yt,{type:"primary",onClick:Q.submit,icon:f.jsx(MQ,{}),children:"Lưu cài đặt"})]}),width:800,onClose:V,className:REt,children:f.jsx(R,{form:Q,name:"form-global-setting",onFinish:Ue,initialValues:{voice_choice:yv.BOT,speed_bot_voice:1,volume_bot_voice:1},children:f.jsx(IA,{rootClassName:YEt,expandIconPosition:"right",items:GSt,bordered:!1,defaultActiveKey:["1"]})})}),f.jsx(to,{title:"Tài nguyên",open:U,onCancel:W,footer:[f.jsx(yt,{onClick:W,children:"Đóng"},"close")],cancelText:"Đóng",width:1200,centered:!0,destroyOnHidden:!0,children:f.jsx(HSt,{onClose:W})}),f.jsx(WSt,{open:H,value:Y,onSave:qe,onCancel:G})]})}),Gfe=A.forwardRef((e,t)=>{const{AUTOFLOW_ID:n,CALLBOTSCENARIO_ID:r}=e.context,o=e.type==="autoflow"&&!n,i=e.type==="autocall"&&!r;if(o||i){const a=o?"Missing AutoFlow ID":"Missing CallBotScenario ID";return f.jsx(Ke,{justify:"center",align:"center",style:{height:"100%"},children:f.jsx(Vg,{status:"error",title:a})})}return f.jsx("section",{className:"scripts-editor-global",children:f.jsx(Lge,{cache:qSt,hashPriority:"high",children:f.jsx(Ea,{theme:{token:{colorPrimary:Fn.common.primary},components:{Button:{primaryShadow:"unset"}}},prefixCls:_r,iconPrefixCls:Ize,children:f.jsx(OX,{...e,BLOCKS_ENABLED:e.BLOCKS_ENABLED||(e.type==="autocall"?WY:KY),instanceId:e.instanceId||qHe(),children:f.jsx(rve,{client:xze,children:f.jsx(vmt,{children:f.jsx(tj,{children:f.jsx(mmt,{children:f.jsx(EKe,{children:f.jsx(QSt,{ref:t,onAlertsChange:e.onAlertsChange,type:e.type,onReady:e.onReady})})})})})})})})})})});Gfe.displayName="ScriptEditor";const RSt=(e,t)=>e===t?!0:!e||!t||e.length!==t.length?!1:e.every((n,r)=>n===t[r]),YSt=(e,t)=>e.BASE_URL===t.BASE_URL&&e.AUTHORIZATION_HEADER===t.AUTHORIZATION_HEADER&&e.type===t.type&&e.instanceId===t.instanceId&&e.mode===t.mode&&e.onReady===t.onReady&&e.context.COMPANY_ID===t.context.COMPANY_ID&&e.context.AUTOFLOW_ID===t.context.AUTOFLOW_ID&&e.context.CALLBOTSCENARIO_ID===t.context.CALLBOTSCENARIO_ID&&RSt(e.BLOCKS_ENABLED,t.BLOCKS_ENABLED),XSt=A.memo(Gfe,YSt);yn.BlockType=be,yn.BlockTypeIcons=XT,yn.BlockTypeLabels=Zg,yn.DEFAULT_AUTOFLOW_SIDEBAR_BUTTONS=KY,yn.DEFAULT_CALLBOT_SIDEBAR_BUTTONS=WY,yn.INTENTS=Go,yn.InstanceContextProvider=OX,yn.LISTEN_TYPE=du,yn.SPEAK_TYPE=ho,yn.ScriptEditor=XSt,yn.TRANSFER_TYPE=Wi,yn.autoCallSidebarButtons=vE,yn.autoFlowSidebarButtons=JT,yn.eventBus=l7,yn.getInitialData=I1,yn.getNodeColor=Kx,yn.iconColors=mc,yn.initialData=em,yn.initialEdges=HY,yn.initialNodeProps=N1,yn.initialNodes=VY,yn.initialTitles=Jg,yn.nodeTypes=Due,yn.useAlert=nv,yn.useAlerts=v_,yn.useEvent=eb,yn.useInstanceContext=Xt,yn.useInstanceId=TX,Object.defineProperty(yn,Symbol.toStringTag,{value:"Module"})});