cft-builder 0.2.333 → 0.2.335

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.
@@ -1591,7 +1591,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1591
1591
  }
1592
1592
  }
1593
1593
  `}}),r8=b.forwardRef(function(t,e){var n=Kn(),r=b.useContext(ar),i=jm.getProps(t,r),a=b.useState(i.id),s=_I(a,2),l=s[0],c=s[1],u=b.useState(i.collapsed),d=_I(u,2),f=d[0],h=d[1],g=i.toggleable?i.onToggle?i.collapsed:f:!1,v=b.useRef(null),m=b.useRef(null),A=l+"_header",w=l+"_content",S=jm.setMetaData({props:i,state:{id:l,collapsed:g}}),x=S.ptm,T=S.cx,C=S.isUnstyled;ci(jm.css.styles,C,{name:"fieldset"});var E=function(X){i.toggleable&&(g?_(X):M(X),i.onToggle&&i.onToggle({originalEvent:X,value:!g})),X.preventDefault()},_=function(X){i.onToggle||h(!1),i.onExpand&&i.onExpand(X)},M=function(X){i.onToggle||h(!0),i.onCollapse&&i.onCollapse(X)};Li(function(){i.id||c(So())});var N=function(X){(X.code==="Enter"||X.code==="NumpadEnter"||X.code==="Space")&&(E(X),X.preventDefault())},F=function(){var X=n({className:T("content")},x("content")),ce=n({ref:m,id:w,role:"region","aria-labelledby":A,className:T("toggleableContent")},x("toggleableContent")),Y=n({classNames:T("transition"),timeout:{enter:1e3,exit:450},in:!g,unmountOnExit:!0,options:i.transitionOptions},x("transition"));return b.createElement(Ro,$m({nodeRef:m},Y),b.createElement("div",ce,b.createElement("div",X,i.children)))},P=function(){if(i.toggleable){var X=n({className:T("togglericon")},x("togglericon")),ce=g?i.expandIcon||b.createElement(Mm,X):i.collapseIcon||b.createElement(n8,X),Y=nr.getJSXIcon(ce,X,{props:i});return Y}return null},H=function(){var X=n({className:T("legendTitle")},x("legendTitle")),ce=n({id:A,role:"button","aria-expanded":!g,"aria-controls":w,onKeyDown:N,onClick:E,"aria-label":i.legend,tabIndex:0},x("toggler"));if(i.toggleable){var Y=P();return b.createElement("a",ce,Y,b.createElement("span",X,i.legend),b.createElement(Qt,null))}return b.createElement("span",$m({},X,{id:A}),i.legend)},O=function(){var X=n({className:T("legend")},x("legend"));if(i.legend!=null||i.toggleable){var ce=H();return b.createElement("legend",X,ce)}};b.useImperativeHandle(e,function(){return{props:i,getElement:function(){return v.current},getContent:function(){return m.current}}});var j=n({id:l,ref:v,style:i.style,className:ft(i.className,T("root")),onClick:i.onClick},jm.getOtherProps(i),x("root")),U=O(),le=F();return b.createElement("fieldset",j,U,le)});r8.displayName="Fieldset";const _G=t=>o.jsx(cn,{target:`.${t==null?void 0:t.element}`,position:"right",children:o.jsxs("div",{style:{width:400},className:"m-3",children:[o.jsx("div",{className:"text-900 font-medium text-2xl mb-2",children:t==null?void 0:t.label}),o.jsx("div",{children:"Dynamic listing component"}),o.jsx(ga,{}),o.jsxs("div",{className:"p-fluid",children:[o.jsx("div",{className:"mb-2",children:t==null?void 0:t.label}),o.jsxs("div",{children:[o.jsxs(r8,{children:[o.jsx("div",{className:"pi pi-circle",children:" Option 1"}),o.jsx("br",{})]}),o.jsx("br",{}),o.jsx(r8,{children:o.jsx("div",{className:"pi pi-circle",children:" Option 2"})})]})]})]})}),DG=t=>o.jsx(cn,{target:`.${t==null?void 0:t.element}`,position:"right",children:o.jsxs("div",{style:{width:400},className:"m-3",children:[o.jsx("div",{className:"text-900 font-medium text-2xl mb-2",children:t==null?void 0:t.label}),o.jsx("div",{children:"Documents"}),o.jsx(ga,{}),o.jsxs("div",{className:"p-fluid",children:[o.jsx("div",{className:"mb-2",children:t==null?void 0:t.label}),o.jsxs("div",{children:["1.Hr Cv.docx",o.jsx("br",{}),"2.Readme.txt",o.jsx("br",{}),"3.Cover.jpg"]})]})]})}),NG=[{label:"Free form inputs",icon:"pi pi-fw pi-file",expanded:!0,items:[{label:"Text",icon:"pi pi-fw pi-plus",element:"input",schema:bH,uuid:nt(),type:tr,toolTip:t=>RY(t)},{label:"Number",icon:"pi pi-fw pi-trash",element:"number",schema:vH,uuid:nt(),type:tr,toolTip:t=>GY(t)},{label:"Email",icon:"pi pi-fw pi-external-link",element:"email",schema:mH,uuid:nt(),type:tr,toolTip:t=>WY(t)},{label:"Text area",icon:"pi pi-fw pi-external-link",element:"textArea",schema:xH,uuid:nt(),type:tr,toolTip:t=>QY(t)},{label:"Text editor",icon:"pi pi-fw pi-external-link",element:"textHtmlEditor",schema:gH,uuid:nt(),type:tr,toolTip:t=>JY(t)},{label:"Date picker",icon:"pi pi-fw pi-user-plus",element:"date-picker",schema:cH,uuid:nt(),type:tr,toolTip:t=>WK(t)},{label:"Draw signature",icon:"pi pi-fw pi-trash",element:"signature",schema:Tx,uuid:nt(),type:tr,toolTip:t=>tX(t)},{label:"Type signature",icon:"pi pi-fw pi-trash",element:"type-signature",schema:TH,uuid:nt(),type:tr,toolTip:t=>nX(t)},{label:"File upload",icon:"pi pi-fw pi-trash",element:"file-upload",schema:fH,uuid:nt(),type:tr,toolTip:t=>rX(t)},{label:"Phone number",icon:"pi pi-fw pi-trash",element:"phone",schema:AH,uuid:nt(),type:tr,PhoneNumberToolTip:NT,toolTip:t=>NT(t)},{label:"Website url",icon:"pi pi-fw pi-trash",element:"web-url",schema:IH,uuid:nt(),type:tr,toolTip:t=>aX(t)},{label:"Hidden field",icon:"pi pi-fw pi-trash",element:"hidden-field",schema:pH,uuid:nt(),type:tr,toolTip:t=>BX(t)},{label:"Address",icon:"pi pi-fw pi-trash",element:"address",schema:oH,uuid:nt(),type:tr,toolTip:t=>VX(t)},{label:"Grid component",icon:"pi pi-fw pi-trash",element:"grid-component",schema:hH,uuid:nt(),type:tr,toolTip:t=>SG(t)},{label:"Matrix dropdown",icon:"pi pi-fw pi-trash",element:"matrix-dropdown",schema:yH,uuid:nt(),type:tr,toolTip:t=>CG(t)}]},{label:"Controlled inputs",icon:"pi pi-fw pi-pencil",items:[{label:"Countries",icon:"pi pi-fw pi-align-left",element:"country",schema:fx,uuid:nt(),type:tr,toolTip:t=>CI(t)},{label:"Dropdown",icon:"pi pi-fw pi-align-left",element:"select",schema:xx,uuid:nt(),type:tr,toolTip:t=>xI(t)},{label:"Multi select",icon:"pi pi-fw pi-align-right",element:"multi-select",schema:Ax,uuid:nt(),type:tr,toolTip:t=>TI(t)},{label:"Checkbox",icon:"pi pi-fw pi-align-left",element:"checkbox",schema:dx,uuid:nt(),type:tr,toolTip:t=>EI(t)},{label:"Radio button",icon:"pi pi-fw pi-align-left",element:"radio",schema:Sx,uuid:nt(),type:tr,toolTip:t=>e8(t)},{label:"Hierarchal radio",icon:"pi pi-fw pi-align-left",element:"radio-hierarchal",schema:SH,uuid:nt(),type:tr,toolTip:t=>e8(t)},{label:"Dynamic radio",icon:"pi pi-fw pi-align-left",element:"dynamic-listing",schema:uH,uuid:nt(),type:tr,toolTip:t=>_G(t)}]},{label:"Rating inputs",icon:"pi pi-fw pi-pencil",items:[{label:"Likert scale",icon:"pi pi-fw pi-trash",element:"likert-scale",schema:yx,uuid:nt(),type:tr,toolTip:t=>WT(t)},{label:"Slider",icon:"pi pi-fw pi-trash",element:"slider",schema:Ex,uuid:nt(),type:tr,toolTip:t=>UT(t)},{label:"Rating",icon:"pi pi-fw pi-trash",element:"rating",schema:Cx,uuid:nt(),type:tr,toolTip:t=>BT(t)},{label:"Thumbs up and down",icon:"pi pi-fw pi-align-left",element:"thumbs",schema:Ix,uuid:nt(),type:tr,toolTip:t=>MX(t)},{label:"Likert emoji scale",icon:"pi pi-fw pi-align-left",element:"likert-emoji-scale",schema:bx,uuid:nt(),type:tr,toolTip:t=>LX(t)}]},{label:"Media",icon:"pi pi-fw pi-user",items:[{label:"Document",icon:"pi pi-fw pi-trash",element:"document",schema:hx,uuid:nt(),type:tr,toolTip:t=>DG(t)}]}],OG=[{label:"HTML",icon:"pi pi-fw pi-file",expanded:!0,items:[{label:"<a>",icon:"pi pi-fw pi-plus",element:"a",schema:mx,uuid:nt(),type:tr},{label:"<p>",icon:"pi pi-fw pi-trash",element:"paragraph",schema:wx,uuid:nt(),type:tr},{label:"<heading>",icon:"pi pi-fw pi-external-link",element:"h",schema:px,uuid:nt(),type:tr},{label:"<li>",icon:"pi pi-fw pi-external-link",element:"list",schema:EH,uuid:nt(),type:tr},{label:"Divider",icon:"pi pi-fw pi-external-link",element:"hr",schema:gx,uuid:nt(),type:tr},{label:"Image",icon:"pi pi-fw pi-user-plus",element:"image",schema:x9,uuid:nt(),type:tr},{label:"Image gallery",icon:"pi pi-fw pi-user-plus",element:"image-gallery",schema:vx,uuid:nt(),type:tr},{label:"Video",icon:"pi pi-fw pi-user-minus",element:"video",schema:T9,uuid:nt(),type:tr}]}],FG=[{label:"Controlled inputs",icon:"pi pi-fw pi-pencil",items:[{label:"Countries",icon:"pi pi-fw pi-align-left",element:"country",schema:fx,uuid:nt(),type:tr,toolTip:t=>CI(t)},{label:"Dropdown",icon:"pi pi-fw pi-align-left",element:"select",schema:xx,uuid:nt(),type:tr,toolTip:t=>xI(t)},{label:"Multi select",icon:"pi pi-fw pi-align-right",element:"multi-select",schema:Ax,uuid:nt(),type:tr,toolTip:t=>TI(t)},{label:"Checkbox",icon:"pi pi-fw pi-align-left",element:"checkbox",schema:dx,uuid:nt(),type:tr,toolTip:t=>EI(t)},{label:"Radio button",icon:"pi pi-fw pi-align-left",element:"radio",schema:Sx,uuid:nt(),type:tr,toolTip:t=>e8(t)}]},{label:"Rating inputs",icon:"pi pi-fw pi-pencil",items:[{label:"Likert scale",icon:"pi pi-fw pi-trash",element:"likert-scale",schema:yx,uuid:nt(),type:tr,toolTip:t=>WT(t)},{label:"Slider",icon:"pi pi-fw pi-trash",element:"slider",schema:Ex,uuid:nt(),type:tr,toolTip:t=>UT(t)},{label:"Rating",icon:"pi pi-fw pi-trash",element:"rating",schema:Cx,uuid:nt(),type:tr,toolTip:t=>BT(t)},{label:"Thumbs up and down",icon:"pi pi-fw pi-align-left",element:"thumbs",schema:Ix,uuid:nt(),type:tr},{label:"Likert emoji scale",icon:"pi pi-fw pi-align-left",element:"likert-emoji-scale",schema:bx,uuid:nt(),type:tr}]}],kG=[{label:"Media",icon:"pi pi-fw pi-user",items:[{label:"Image",icon:"pi pi-fw pi-user-plus",element:"image",schema:x9,uuid:nt(),type:tr},{label:"Video",icon:"pi pi-fw pi-user-minus",element:"video",schema:T9,uuid:nt(),type:tr},{label:"Quiz",icon:"pi pi-fw pi-trash",element:"quiz",schema:wH,uuid:nt(),type:tr},{label:"Document",icon:"pi pi-fw pi-trash",element:"document",schema:hx,uuid:nt(),type:tr}]}],PG=[{label:"Left",icon:"pi pi-align-left",value:"left"},{label:"Right",icon:"pi pi-align-right",value:"right"}],MG=[{key:1,language:"English",type:"english"},{key:2,language:"Urdu",type:"urdu"},{key:3,language:"Hindi",type:"hindi"},{key:4,language:"Arabic",type:"arabic"},{key:5,language:"French",type:"french"},{key:6,language:"Italian",type:"italian"},{key:7,language:"Spanish",type:"spanish"}],LG=[{name:"Bad Script",font:"bad-script"},{name:"Bilbo Swash Caps",font:"bilbo-swash-caps"},{name:"caveat",font:"caveat"},{name:"Covered By Your Grace",font:"covered-by-your-grace"},{name:"Dancing Script",font:"dancing-script"},{name:"Gochi Hand",font:"gochi-hand"},{name:"Great Vibes",font:"great-vibes"},{name:"Handlee",font:"handlee"},{name:"Just Another Hand",font:"just-another-hand"},{name:"Kalam",font:"kalam"},{name:"La Belle Aurore",font:"la-belle-aurore"},{name:"Marck Script",font:"marck-script"},{name:"Nothing You Could Do",font:"nothing-you-could-do"},{name:"Qwigley",font:"qwigley"},{name:"Sacramento",font:"sacramento"},{name:"Shadows Into Light",font:"shadows-into-light"},{name:"Stalemate",font:"stalemate"},{name:"Yellowtail",font:"yellowtail"}],zm={type:sx,isCoverPage:!1,margin:{left:0,right:0,top:0,bottom:0},isVisible:!0,isHidden:!1,isValid:!1,displayRules:[],title:{english:"Page 1"}},lf={type:na,showSectionHeader:!1,isVisible:!0,isHidden:!1,isValid:!1,showSectionTitle:!1,showSectionSubTitle:!1,heading:{english:"Section header"},subHeadingText:{english:""},isCollapsed:!1},eu={type:Ao,isHidden:!1,isValid:!1,isRequired:!1,isCollapsed:!1,showRowTitle:!0,showRowSubTitle:!0,heading:{english:""},subHeadingText:{english:""},rowIsRepeatable:!1,repeatableFields:[],repeatableFieldsData:[],isMinimumEntries:!1,minimumEntries:5,addToListButtonLabel:{english:"Save"},reviewerChecklist:[]},wc={type:As,isCollapsed:!1},BG=t=>{let e=t;e={...e,uuid:nt()};const n=e.children.map(r=>({...r,uuid:nt(),children:r.children.map(i=>({...i,uuid:nt(),children:i.children.map(a=>{var s;return{...a,uuid:nt(),...((s=a==null?void 0:a.children)==null?void 0:s.length)>0?{children:a.children.map(l=>{var c;return{...l,uuid:nt(),...((c=l.options)==null?void 0:c.length)>0?{options:l.options.map(u=>({...u,uuid:nt()}))}:{}}})}:{}}})}))}));return e={...e,children:n},e};function VG(t){return e=>{const n={...zm,uuid:nt(),title:{english:`Page ${t+1}`},children:[{...lf,uuid:nt(),children:[{...eu,uuid:nt(),children:[{...wc,uuid:nt(),children:[]}]}]}]};e({type:BC,payLoad:n})}}function qG(t){return e=>{const n=[];for(const[,i]of t.entries())for(const[,a]of i.children.entries())for(const[,s]of a.children.entries())for(const[,l]of s.children.entries())for(const[,c]of l.children.entries())s!=null&&s.rowIsRepeatable||n.push(c);e({type:nx,payLoad:{tableFields:n}})}}function UG(t,e){return(n,r)=>{const i=t;let a=_t.cloneDeep(i);const{layout:s}=r;a={...a,title:{english:`Page ${(s==null?void 0:s.length)+1}`}},a=BG(a),n({type:$C,payLoad:{page:a,pageIndex:e}})}}function $G(t,e){return n=>{n({type:tx,payLoad:{pageIndex:t,page:e}})}}function jG(t){return e=>{e({type:NC,payLoad:{pageIndex:t}})}}const DI=t=>{let e=t;e={...e,uuid:nt()};const n=e.children.map(r=>({...r,uuid:nt(),children:r.children.map(i=>{var a;return{...i,uuid:nt(),...((a=i==null?void 0:i.children)==null?void 0:a.length)>0?{children:i.children.map(s=>{var l;return{...s,uuid:nt(),...((l=s.options)==null?void 0:l.length)>0?{options:s.options.map(c=>({...c,uuid:nt()}))}:{}}})}:{}}})}));return e={...e,children:n},e};function zG(t,e){return n=>{n({type:OC,payLoad:{pageIndex:t,sectionIndex:e}})}}function HG(t){return e=>{const n={...lf,uuid:nt(),children:[{...eu,uuid:nt(),children:[{...wc,uuid:nt(),children:[]}]}]};e({type:VC,payLoad:{pageIndex:t,section:n}})}}function YG(t,e,n){return r=>{const i={type:LC,payLoad:{pageIndex:t,sectionIndex:e,section:_t.cloneDeep(n)}};r(i)}}function KG(t,e,n){return r=>{const i=t;let a=_t.cloneDeep(i);a=DI(a),r({type:jC,payLoad:{section:a,pageIndex:e,sectionIndex:n}})}}function XG(t,e){return n=>{const r=t;let i=_t.cloneDeep(r);i=DI(i),n({type:zC,payLoad:{section:i,pageIndex:e}})}}const RG=t=>{let e=t;e={...e,uuid:nt()};const n=e.children.map(r=>{var i;return{...r,uuid:nt(),...((i=r==null?void 0:r.children)==null?void 0:i.length)>0?{children:r.children.map(a=>{var s;return{...a,uuid:nt(),...((s=a.options)==null?void 0:s.length)>0?{options:a.options.map(l=>({...l,uuid:nt()}))}:{}}})}:{}}});return e={...e,children:n},e};function GG(t,e,n,r){return i=>{const a=t;let s=_t.cloneDeep(a);s=RG(s),i({type:HC,payLoad:{row:s,pageIndex:e,sectionIndex:n,rowIndex:r}})}}function WG(t,e,n,r){return i=>{i({type:w9,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,row:r}})}}function QG(t,e,n){return r=>{r({type:FC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n}})}}function JG(t,e){return n=>{const r={...eu,uuid:nt(),isCollapsed:!1,children:[{...wc,uuid:nt(),children:[]}]};n({type:qC,payLoad:{pageIndex:t,sectionIndex:e,row:r}})}}function ZG(t,e,n,r){return i=>{i({type:RC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,fieldItem:r}})}}const eW=t=>{var r;let e=t;e={...e,uuid:nt()};const n=((r=e==null?void 0:e.children)==null?void 0:r.length)>0?e.children.map((i,a)=>{var s;return{...i,uuid:nt(),...((s=i.options)==null?void 0:s.length)>0?{options:i.options.map((l,c)=>({...l,uuid:nt()}))}:{}}}):[];return e={...e,children:n},e};function tW(t,e,n){return r=>{const i={...wc,uuid:nt(),children:[]};r({type:UC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,column:i}})}}function nW(t,e,n,r,i){return a=>{const s=t;let l=_t.cloneDeep(s);l=eW(l),a({type:YC,payLoad:{column:l,pageIndex:e,sectionIndex:n,rowIndex:r,columnIndex:i}})}}function rW(t,e,n,r){return i=>{i({type:kC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r}})}}function NI(t,e,n,r){return i=>{i({type:w9,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,row:r}})}}function iW(t,e,n,r,i){return(a,s)=>{var g,v,m,A;const{layout:l,tableFields:c}=s;let u=(g=l[t])==null?void 0:g.children[e].children[n];const d=(A=(m=(v=l[t])==null?void 0:v.children[e])==null?void 0:m.children[n])==null?void 0:A.children[r].children[i];if((u==null?void 0:u.rowIsRepeatable)===!0){const w=[...u.repeatableFields],S=_t.findIndex(w,function(x){return x.uuid===(d==null?void 0:d.uuid)});w.splice(S,1),u={...u,repeatableFields:w},NI(t,e,n,u)(a)}const f=_t.findIndex(c,function(w){return w.uuid===(d==null?void 0:d.uuid)});c.splice(f,1),a({type:PC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i}})}}function aW(t,e,n,r,i,a){return(s,l)=>{var g,v,m,A;const{layout:c,tableFields:u}=l;let d=(g=c[t])==null?void 0:g.children[e].children[n];if((d==null?void 0:d.rowIsRepeatable)===!0){const w=(A=(m=(v=c[t])==null?void 0:v.children[e])==null?void 0:m.children[n])==null?void 0:A.children[r].children[i],S=[...d.repeatableFields],x=_t.findIndex(S,function(T){return T.uuid===(w==null?void 0:w.uuid)});x===-1?S.splice(i,0,a):S[x]=a,S[x]=a,d={...d,repeatableFields:S},NI(t,e,n,d)(s)}const f={type:MC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,field:a}},h=u.findIndex(w=>w.uuid===a.uuid);h>=0&&(u[h]=a),s(f)}}function sW(t,e,n,r,i,a){return s=>{var d;const l=t;let c=_t.cloneDeep(l);if(c={...c,uuid:nt()},c!=null&&c.options&&((d=c==null?void 0:c.options)==null?void 0:d.length)>0){const f=c==null?void 0:c.options.map(h=>({...h,uuid:nt()}));c={...c,options:f}}s({type:KC,payLoad:{field:c,pageIndex:e,sectionIndex:n,rowIndex:r,columnIndex:i,fieldIndex:a}})}}function oW(t,e,n,r,i,a,s,l){return c=>{c({type:GC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,ruleIndex:a,conditionIndex:s,field:l}})}}function lW(t,e,n,r,i,a,s,l){return c=>{c({type:WC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,gridColumnIndex:s,gridRowIndex:a,field:l}})}}function cW(t,e,n,r,i,a,s,l,c){return u=>{u({type:ZC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,gridRowIndex:a,gridColumnIndex:s,fieldChildrenIndex:l,field:c}})}}function uW(t,e,n,r,i,a,s,l){return c=>{c({type:ex,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,gridRowIndex:a,gridColumnIndex:s,fieldChildrenIndex:l}})}}function dW(t,e,n,r,i,a,s,l,c){return u=>{u({type:QC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,ruleIndex:a,conditionIndex:s,inlineFieldIndex:l,field:c}})}}function fW(t,e,n,r,i,a,s,l){return c=>{c({type:JC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,ruleIndex:a,conditionIndex:s,inlineFieldIndex:l}})}}function hW(t){return e=>{e({type:j1,payLoad:{formSchema:t}})}}function pW(t){return e=>{e({type:j1,payLoad:{layout:t}})}}function gW(t){return(e,n)=>{const{languages:r}=n,i={type:j1,payLoad:{languages:[...r,t]}};e(i)}}function mW(t){return(e,n)=>{const{languages:r}=n,i=_t.findIndex(r,l=>l.key===t.key),a=[...r];a.splice(i,1),e({type:j1,payLoad:{languages:a}})}}function vW(t){return e=>{const n={type:j1,payLoad:{userSelectedLanguage:t.value}};e(n)}}function bW(t){return e=>{e({type:Zg,payLoad:{formType:t}})}}function yW(t){return e=>{e({type:Zg,payLoad:t})}}function AW(t){return e=>{e({type:Zg,payLoad:{editing_by:t}})}}function wW(){return t=>{t({type:XC,payLoad:null})}}const i8={loading:!1,intro:"",editing_by:0,isChangesSaved:!1,enableReviewTask:!1,enableAutoSave:!1,enableAutoSaveBuilderSetting:!1,surveyQuestionSlide:!1,enableFormFluid:!0,showConditionalFields:!0,isAdvanceView:!1,models:[],fieldMappings:[],version_name:null,showIntroTab:!1,published_status:!1,formType:null,randomiseQuestions:!1,randomiseAnswers:!1,enableNoOfAssessmentQuestions:!1,noOfAssessmentQuestions:null,tableFields:[],tableConfiguration:{stripedRows:!1,gridLines:!1,flexScroll:!1,isResponsive:!1,rowReorder:!1},builderTemplateName:"",quizConfiguration:{quizPassMark:75,quizTimeLimit:2,quizMaxAttempts:99,quizSequentialAnswer:0,isAllCorrectMandatory:!0,quizRandomiseQuestions:1,quizUniqueAnswersPerAttempt:"1"},header:[],languages:[{key:1,language:"English",type:"english"}],userSelectedLanguage:{key:1,language:"English",type:"english"},layout:[{uuid:nt(),...zm,children:[{uuid:nt(),...lf,children:[{uuid:nt(),...eu,children:[{uuid:nt(),...wc,children:[]}]}]}]}],conditionalTabsRules:[],conditionalSectionsRules:[]},SW=(t=i8,e)=>{var n,r;switch(e.type){case iH:return{...t,...e.payLoad};case rH:return{...t,...e.payLoad};case XC:return{...t,...i8};case j1:return{...t,...e.payLoad};case Zg:return{...t,...e.payLoad};case NC:{const{pageIndex:i}=e.payLoad;return{...t,layout:t.layout.filter((a,s)=>s!==i)}}case BC:return{...t,layout:[...t.layout,e.payLoad]};case VC:{const{pageIndex:i,section:a}=e.payLoad,s=[...t.layout];return s[i].children=[...s[i].children,a],{...t,layout:s}}case RC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,fieldItem:l}=e.payLoad,c=[...t.layout],u=Array.isArray((n=c[i].children[a].children[s])==null?void 0:n.repeatableFields)?[...((r=c[i].children[a].children[s])==null?void 0:r.repeatableFields)||[],l]:l?[l]:[];return c[i].children[a].children[s]={...c[i].children[a].children[s],repeatableFields:u},{...t,layout:c}}case aH:{const{fieldItem:i}=e.payLoad;let a=[...t.tableFields];return a=[...a,i],{...t,tableFields:a}}case nx:return{...t,...e.payLoad};case qC:{const{pageIndex:i,sectionIndex:a,row:s}=e.payLoad,l=[...t.layout];return l[i].children[a].children=[...l[i].children[a].children,s],{...t,layout:l}}case UC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,column:l}=e.payLoad,c=[...t.layout];return c[i].children[a].children[s].children=[...c[i].children[a].children[s].children,l],{...t,layout:c}}case GC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,ruleIndex:u,conditionIndex:d,field:f}=e.payLoad,h=[...t.layout];return h[i].children[a].children[s].children[l].children[c].inlineConditionalRules.rules[u].conditions[d].children=[...h[i].children[a].children[s].children[l].children[c].inlineConditionalRules.rules[u].conditions[d].children,f],{...t,layout:h}}case WC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,gridRowIndex:u,gridColumnIndex:d,field:f}=e.payLoad,h=[...t.layout];return h[i].children[a].children[s].children[l].children[c].children.push({[`${u}-${d}`]:f}),{...t,layout:h}}case QC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,ruleIndex:u,conditionIndex:d,inlineFieldIndex:f,field:h}=e.payLoad,g=[...t.layout];return g[i].children[a].children[s].children[l].children[c].inlineConditionalRules.rules[u].conditions[d].children[f]=h,{...t,layout:g}}case ZC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,gridRowIndex:u,gridColumnIndex:d,fieldChildrenIndex:f,field:h}=e.payLoad,g=[...t.layout];return g[i].children[a].children[s].children[l].children[c].children[f]={[`${u}-${d}`]:h},{...t,layout:g}}case JC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,ruleIndex:u,conditionIndex:d,inlineFieldIndex:f}=e.payLoad,h=[...t.layout];return h[i].children[a].children[s].children[l].children[c].inlineConditionalRules.rules[u].conditions[d].children.splice(f,1),{...t,layout:h}}case ex:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,fieldChildrenIndex:u}=e.payLoad,d=[...t.layout];return d[i].children[a].children[s].children[l].children[c].children.splice(u,1),{...t,layout:d}}case OC:{const{pageIndex:i,sectionIndex:a}=e.payLoad,s=[...t.layout];return s[i].children.splice(a,1),{...t,layout:s}}case FC:{const{pageIndex:i,sectionIndex:a,rowIndex:s}=e.payLoad,l=[...t.layout];return l[i].children[a].children.splice(s,1),{...t,layout:l}}case kC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l}=e.payLoad,c=[...t.layout];return c[i].children[a].children[s].children.splice(l,1),{...t,layout:c}}case PC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c}=e.payLoad,u=[...t.layout];return u[i].children[a].children[s].children[l].children.splice(c,1),{...t,layout:u}}case MC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,field:u}=e.payLoad,d=[...t.layout];return d[i].children[a].children[s].children[l].children[c]=u,{...t,layout:d}}case LC:{const{pageIndex:i,sectionIndex:a,section:s}=e.payLoad,l=[...t.layout];return l[i].children[a]=s,{...t,layout:l}}case w9:{const{pageIndex:i,sectionIndex:a,rowIndex:s,row:l}=e.payLoad,c=[...t.layout];return c[i].children[a].children[s]=l,{...t,layout:c}}case tx:{const{pageIndex:i,page:a}=e.payLoad,s=[...t.layout];return s[i]=a,{...t,layout:s}}case $C:{const{page:i,pageIndex:a}=e.payLoad,s=[...t.layout];return s.splice(a+1,0,i),{...t,layout:s}}case jC:{const{section:i,pageIndex:a,sectionIndex:s}=e.payLoad,l=[...t.layout];return l[a].children.splice(s+1,0,i),{...t,layout:l}}case zC:{const{section:i,pageIndex:a}=e.payLoad,s=[...t.layout];return s[a].children.push(i),{...t,layout:s}}case HC:{const{row:i,pageIndex:a,sectionIndex:s,rowIndex:l}=e.payLoad,c=[...t.layout];return c[a].children[s].children.splice(l+1,0,i),{...t,layout:c}}case YC:{const{column:i,pageIndex:a,sectionIndex:s,rowIndex:l,columnIndex:c}=e.payLoad,u=[...t.layout];return u[a].children[s].children[l].children.splice(c+1,0,i),{...t,layout:u}}case KC:{const{field:i,pageIndex:a,sectionIndex:s,rowIndex:l,columnIndex:c,fieldIndex:u}=e.payLoad,d=[...t.layout];return d[a].children[s].children[l].children[c].children.splice(u+1,0,i),{...t,layout:d}}}return t},OI=k.createContext({dragDropManager:void 0});function tu(t){"@babel/helpers - typeof";return tu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tu(t)}function CW(t,e){if(tu(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(tu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xW(t){var e=CW(t,"string");return tu(e)=="symbol"?e:e+""}function TW(t,e,n){return(e=xW(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function FI(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function kI(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?FI(Object(n),!0).forEach(function(r){TW(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):FI(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ql(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var PI=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),a8=function(){return Math.random().toString(36).substring(7).split("").join(".")},MI={INIT:"@@redux/INIT"+a8(),REPLACE:"@@redux/REPLACE"+a8(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+a8()}};function EW(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function IW(t){if(t===void 0)return"undefined";if(t===null)return"null";var e=typeof t;switch(e){case"boolean":case"string":case"number":case"symbol":case"function":return e}if(Array.isArray(t))return"array";if(NW(t))return"date";if(DW(t))return"error";var n=_W(t);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return e.slice(8,-1).toLowerCase().replace(/\s/g,"")}function _W(t){return typeof t.constructor=="function"?t.constructor.name:null}function DW(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function NW(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function cf(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=IW(t)),e}function LI(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?ql(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?ql(1):"Expected the enhancer to be a function. Instead, received: '"+cf(n)+"'");return n(LI)(t,e)}if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?ql(2):"Expected the root reducer to be a function. Instead, received: '"+cf(t)+"'");var i=t,a=e,s=[],l=s,c=!1;function u(){l===s&&(l=s.slice())}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?ql(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return a}function f(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?ql(4):"Expected the listener to be a function. Instead, received: '"+cf(m)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?ql(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var A=!0;return u(),l.push(m),function(){if(A){if(c)throw new Error(process.env.NODE_ENV==="production"?ql(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");A=!1,u();var S=l.indexOf(m);l.splice(S,1),s=null}}}function h(m){if(!EW(m))throw new Error(process.env.NODE_ENV==="production"?ql(7):"Actions must be plain objects. Instead, the actual type was: '"+cf(m)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof m.type>"u")throw new Error(process.env.NODE_ENV==="production"?ql(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?ql(9):"Reducers may not dispatch actions.");try{c=!0,a=i(a,m)}finally{c=!1}for(var A=s=l,w=0;w<A.length;w++){var S=A[w];S()}return m}function g(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?ql(10):"Expected the nextReducer to be a function. Instead, received: '"+cf(m));i=m,h({type:MI.REPLACE})}function v(){var m,A=f;return m={subscribe:function(S){if(typeof S!="object"||S===null)throw new Error(process.env.NODE_ENV==="production"?ql(11):"Expected the observer to be an object. Instead, received: '"+cf(S)+"'");function x(){S.next&&S.next(d())}x();var T=A(x);return{unsubscribe:T}}},m[PI]=function(){return this},m}return h({type:MI.INIT}),r={dispatch:h,subscribe:f,getState:d,replaceReducer:g},r[PI]=v,r}function Hr(t,e,...n){if(OW()&&e===void 0)throw new Error("invariant requires an error message argument");if(!t){let r;if(e===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let i=0;r=new Error(e.replace(/%s/g,function(){return n[i++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function OW(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function FW(t,e,n){return e.split(".").reduce((r,i)=>r&&r[i]?r[i]:n||null,t)}function kW(t,e){return t.filter(n=>n!==e)}function BI(t){return typeof t=="object"}function PW(t,e){const n=new Map,r=a=>{n.set(a,n.has(a)?n.get(a)+1:1)};t.forEach(r),e.forEach(r);const i=[];return n.forEach((a,s)=>{a===1&&i.push(s)}),i}function MW(t,e){return t.filter(n=>e.indexOf(n)>-1)}const s8="dnd-core/INIT_COORDS",Hm="dnd-core/BEGIN_DRAG",o8="dnd-core/PUBLISH_DRAG_SOURCE",Ym="dnd-core/HOVER",Km="dnd-core/DROP",Xm="dnd-core/END_DRAG";function VI(t,e){return{type:s8,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const LW={type:s8,payload:{clientOffset:null,sourceClientOffset:null}};function BW(t){return function(n=[],r={publishSource:!0}){const{publishSource:i=!0,clientOffset:a,getSourceClientOffset:s}=r,l=t.getMonitor(),c=t.getRegistry();t.dispatch(VI(a)),VW(n,l,c);const u=$W(n,l);if(u==null){t.dispatch(LW);return}let d=null;if(a){if(!s)throw new Error("getSourceClientOffset must be defined");qW(s),d=s(u)}t.dispatch(VI(a,d));const h=c.getSource(u).beginDrag(l,u);if(h==null)return;UW(h),c.pinSource(u);const g=c.getSourceType(u);return{type:Hm,payload:{itemType:g,item:h,sourceId:u,clientOffset:a||null,sourceClientOffset:d||null,isSourcePublic:!!i}}}}function VW(t,e,n){Hr(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){Hr(n.getSource(r),"Expected sourceIds to be registered.")})}function qW(t){Hr(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function UW(t){Hr(BI(t),"Item must be an object.")}function $W(t,e){let n=null;for(let r=t.length-1;r>=0;r--)if(e.canDragSource(t[r])){n=t[r];break}return n}function jW(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zW(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){jW(t,i,n[i])})}return t}function HW(t){return function(n={}){const r=t.getMonitor(),i=t.getRegistry();YW(r),RW(r).forEach((s,l)=>{const c=KW(s,l,i,r),u={type:Km,payload:{dropResult:zW({},n,c)}};t.dispatch(u)})}}function YW(t){Hr(t.isDragging(),"Cannot call drop while not dragging."),Hr(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function KW(t,e,n,r){const i=n.getTarget(t);let a=i?i.drop(r,t):void 0;return XW(a),typeof a>"u"&&(a=e===0?{}:r.getDropResult()),a}function XW(t){Hr(typeof t>"u"||BI(t),"Drop result must either be an object or undefined.")}function RW(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function GW(t){return function(){const n=t.getMonitor(),r=t.getRegistry();WW(n);const i=n.getSourceId();return i!=null&&(r.getSource(i,!0).endDrag(n,i),r.unpinSource()),{type:Xm}}}function WW(t){Hr(t.isDragging(),"Cannot call endDrag while not dragging.")}function l8(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function QW(t){return function(n,{clientOffset:r}={}){JW(n);const i=n.slice(0),a=t.getMonitor(),s=t.getRegistry(),l=a.getItemType();return eQ(i,s,l),ZW(i,a,s),tQ(i,a,s),{type:Ym,payload:{targetIds:i,clientOffset:r||null}}}}function JW(t){Hr(Array.isArray(t),"Expected targetIds to be an array.")}function ZW(t,e,n){Hr(e.isDragging(),"Cannot call hover while not dragging."),Hr(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r<t.length;r++){const i=t[r];Hr(t.lastIndexOf(i)===r,"Expected targetIds to be unique in the passed array.");const a=n.getTarget(i);Hr(a,"Expected targetIds to be registered.")}}function eQ(t,e,n){for(let r=t.length-1;r>=0;r--){const i=t[r],a=e.getTargetType(i);l8(a,n)||t.splice(r,1)}}function tQ(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function nQ(t){return function(){if(t.getMonitor().isDragging())return{type:o8}}}function rQ(t){return{beginDrag:BW(t),publishDragSource:nQ(t),hover:QW(t),drop:HW(t),endDrag:GW(t)}}class iQ{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:n}=this.store;function r(a){return(...s)=>{const l=a.apply(e,s);typeof l<"u"&&n(l)}}const i=rQ(this);return Object.keys(i).reduce((a,s)=>{const l=i[s];return a[s]=r(l),a},{})}dispatch(e){this.store.dispatch(e)}constructor(e,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}}function aQ(t,e){return{x:t.x+e.x,y:t.y+e.y}}function qI(t,e){return{x:t.x-e.x,y:t.y-e.y}}function sQ(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:qI(aQ(e,r),n)}function oQ(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:qI(e,n)}const Ap=[],c8=[];Ap.__IS_NONE__=!0,c8.__IS_ALL__=!0;function lQ(t,e){return t===Ap?!1:t===c8||typeof e>"u"?!0:MW(e,t).length>0}class cQ{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;Hr(typeof e=="function","listener must be a function."),Hr(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const a=()=>{const s=this.store.getState(),l=s.stateId;try{l===i||l===i+1&&!lQ(s.dirtyHandlerIds,r)||e()}finally{i=l}};return this.store.subscribe(a)}subscribeToOffsetChange(e){Hr(typeof e=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const i=this.store.getState().dragOffset;i!==n&&(n=i,e())};return this.store.subscribe(r)}canDragSource(e){if(!e)return!1;const n=this.registry.getSource(e);return Hr(n,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:n.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const n=this.registry.getTarget(e);if(Hr(n,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(e),i=this.getItemType();return l8(r,i)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(Hr(n,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(e),i=this.getItemType();return r!==i?!1:n.isDragging(this,e)}isOverTarget(e,n={shallow:!1}){if(!e)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const i=this.registry.getTargetType(e),a=this.getItemType();if(a&&!l8(i,a))return!1;const s=this.getTargetIds();if(!s.length)return!1;const l=s.indexOf(e);return r?l===s.length-1:l>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return sQ(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return oQ(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const UI=typeof global<"u"?global:self,$I=UI.MutationObserver||UI.WebKitMutationObserver;function jI(t){return function(){const n=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(n),clearInterval(r),t()}}}function uQ(t){let e=1;const n=new $I(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const dQ=typeof $I=="function"?uQ:jI;class fQ{enqueueTask(e){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const n=this.index;if(this.index++,e[n].call(),this.index>this.capacity){for(let r=0,i=e.length-this.index;r<i;r++)e[r]=e[r+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=dQ(this.flush),this.requestErrorThrow=jI(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class hQ{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}class pQ{create(e){const n=this.freeTasks,r=n.length?n.pop():new hQ(this.onError,i=>n[n.length]=i);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const zI=new fQ,gQ=new pQ(zI.registerPendingError);function mQ(t){zI.enqueueTask(gQ.create(t))}const u8="dnd-core/ADD_SOURCE",d8="dnd-core/ADD_TARGET",f8="dnd-core/REMOVE_SOURCE",Rm="dnd-core/REMOVE_TARGET";function vQ(t){return{type:u8,payload:{sourceId:t}}}function bQ(t){return{type:d8,payload:{targetId:t}}}function yQ(t){return{type:f8,payload:{sourceId:t}}}function AQ(t){return{type:Rm,payload:{targetId:t}}}function wQ(t){Hr(typeof t.canDrag=="function","Expected canDrag to be a function."),Hr(typeof t.beginDrag=="function","Expected beginDrag to be a function."),Hr(typeof t.endDrag=="function","Expected endDrag to be a function.")}function SQ(t){Hr(typeof t.canDrop=="function","Expected canDrop to be a function."),Hr(typeof t.hover=="function","Expected hover to be a function."),Hr(typeof t.drop=="function","Expected beginDrag to be a function.")}function h8(t,e){if(e&&Array.isArray(t)){t.forEach(n=>h8(n,!1));return}Hr(typeof t=="string"||typeof t=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Ul;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(Ul||(Ul={}));let CQ=0;function xQ(){return CQ++}function TQ(t){const e=xQ().toString();switch(t){case Ul.SOURCE:return`S${e}`;case Ul.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function HI(t){switch(t[0]){case"S":return Ul.SOURCE;case"T":return Ul.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function YI(t,e){const n=t.entries();let r=!1;do{const{done:i,value:[,a]}=n.next();if(a===e)return!0;r=!!i}while(!r);return!1}class EQ{addSource(e,n){h8(e),wQ(n);const r=this.addHandler(Ul.SOURCE,e,n);return this.store.dispatch(vQ(r)),r}addTarget(e,n){h8(e,!0),SQ(n);const r=this.addHandler(Ul.TARGET,e,n);return this.store.dispatch(bQ(r)),r}containsHandler(e){return YI(this.dragSources,e)||YI(this.dropTargets,e)}getSource(e,n=!1){return Hr(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return Hr(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return Hr(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return Hr(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return HI(e)===Ul.SOURCE}isTargetId(e){return HI(e)===Ul.TARGET}removeSource(e){Hr(this.getSource(e),"Expected an existing source."),this.store.dispatch(yQ(e)),mQ(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){Hr(this.getTarget(e),"Expected an existing target."),this.store.dispatch(AQ(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);Hr(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){Hr(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const i=TQ(e);return this.types.set(i,n),e===Ul.SOURCE?this.dragSources.set(i,r):e===Ul.TARGET&&this.dropTargets.set(i,r),i}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const IQ=(t,e)=>t===e;function _Q(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function DQ(t,e,n=IQ){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!n(t[r],e[r]))return!1;return!0}function NQ(t=Ap,e){switch(e.type){case Ym:break;case u8:case d8:case Rm:case f8:return Ap;case Hm:case o8:case Xm:case Km:default:return c8}const{targetIds:n=[],prevTargetIds:r=[]}=e.payload,i=PW(n,r);if(!(i.length>0||!DQ(n,r)))return Ap;const s=r[r.length-1],l=n[n.length-1];return s!==l&&(s&&i.push(s),l&&i.push(l)),i}function OQ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function FQ(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){OQ(t,i,n[i])})}return t}const KI={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function kQ(t=KI,e){const{payload:n}=e;switch(e.type){case s8:case Hm:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Ym:return _Q(t.clientOffset,n.clientOffset)?t:FQ({},t,{clientOffset:n.clientOffset});case Xm:case Km:return KI;default:return t}}function PQ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uf(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){PQ(t,i,n[i])})}return t}const MQ={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function LQ(t=MQ,e){const{payload:n}=e;switch(e.type){case Hm:return uf({},t,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case o8:return uf({},t,{isSourcePublic:!0});case Ym:return uf({},t,{targetIds:n.targetIds});case Rm:return t.targetIds.indexOf(n.targetId)===-1?t:uf({},t,{targetIds:kW(t.targetIds,n.targetId)});case Km:return uf({},t,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Xm:return uf({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function BQ(t=0,e){switch(e.type){case u8:case d8:return t+1;case f8:case Rm:return t-1;default:return t}}function VQ(t=0){return t+1}function qQ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function UQ(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){qQ(t,i,n[i])})}return t}function $Q(t={},e){return{dirtyHandlerIds:NQ(t.dirtyHandlerIds,{type:e.type,payload:UQ({},e.payload,{prevTargetIds:FW(t,"dragOperation.targetIds",[])})}),dragOffset:kQ(t.dragOffset,e),refCount:BQ(t.refCount,e),dragOperation:LQ(t.dragOperation,e),stateId:VQ(t.stateId)}}function jQ(t,e=void 0,n={},r=!1){const i=zQ(r),a=new cQ(i,new EQ(i)),s=new iQ(i,a),l=t(s,e,n);return s.receiveBackend(l),s}function zQ(t){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return LI($Q,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function HQ(t,e){if(t==null)return{};var n=YQ(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function YQ(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}let XI=0;const Gm=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var wp=k.memo(function(e){var{children:n}=e,r=HQ(e,["children"]);const[i,a]=KQ(r);return k.useEffect(()=>{if(a){const s=RI();return++XI,()=>{--XI===0&&(s[Gm]=null)}}},[]),o.jsx(OI.Provider,{value:i,children:n})});function KQ(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=XQ(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function XQ(t,e=RI(),n,r){const i=e;return i[Gm]||(i[Gm]={dragDropManager:jQ(t,e,n,r)}),i[Gm]}function RI(){return typeof global<"u"?global:window}var GI=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(a=Object.keys(e),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var s=a[i];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n};const RQ=zs(GI),$0=typeof window<"u"?k.useLayoutEffect:k.useEffect;function GQ(t,e,n){const[r,i]=k.useState(()=>e(t)),a=k.useCallback(()=>{const s=e(t);RQ(r,s)||(i(s),n&&n())},[r,t,n]);return $0(a),[r,a]}function WQ(t,e,n){const[r,i]=GQ(t,e,n);return $0(function(){const s=t.getHandlerId();if(s!=null)return t.subscribeToStateChange(i,{handlerIds:[s]})},[t,i]),r}function WI(t,e,n){return WQ(e,t||(()=>({})),()=>n.reconnect())}function QI(t,e){const n=[];return typeof t!="function"&&n.push(t),k.useMemo(()=>typeof t=="function"?t():t,n)}function QQ(t){return k.useMemo(()=>t.hooks.dragSource(),[t])}function JQ(t){return k.useMemo(()=>t.hooks.dragPreview(),[t])}let p8=!1,g8=!1;class ZQ{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){Hr(!p8,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return p8=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{p8=!1}}isDragging(){if(!this.sourceId)return!1;Hr(!g8,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return g8=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{g8=!1}}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,n){return this.internalMonitor.isOverTarget(e,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let m8=!1;class eJ{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;Hr(!m8,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return m8=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{m8=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function tJ(t,e,n){const r=n.getRegistry(),i=r.addTarget(t,e);return[i,()=>r.removeTarget(i)]}function nJ(t,e,n){const r=n.getRegistry(),i=r.addSource(t,e);return[i,()=>r.removeSource(i)]}function v8(t,e,n,r){let i;if(i!==void 0)return!!i;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;const a=Object.keys(t),s=Object.keys(e);if(a.length!==s.length)return!1;const l=Object.prototype.hasOwnProperty.bind(e);for(let c=0;c<a.length;c++){const u=a[c];if(!l(u))return!1;const d=t[u],f=e[u];if(i=void 0,i===!1||i===void 0&&d!==f)return!1}return!0}function b8(t){return t!==null&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function rJ(t){if(typeof t.type=="string")return;const e=t.type.displayName||t.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function iJ(t){return(e=null,n=null)=>{if(!k.isValidElement(e)){const a=e;return t(a,n),a}const r=e;return rJ(r),aJ(r,n?a=>t(a,n):t)}}function JI(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const i=iJ(r);e[n]=()=>i}}),e}function ZI(t,e){typeof t=="function"?t(e):t.current=e}function aJ(t,e){const n=t.ref;return Hr(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?k.cloneElement(t,{ref:r=>{ZI(n,r),ZI(e,r)}}):k.cloneElement(t,{ref:e})}class sJ{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?e?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),n):(this.lastConnectedDragSource=e,n):n}reconnectDragPreview(e=!1){const n=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!v8(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!v8(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=JI({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,b8(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,b8(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class oJ{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!v8(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=JI({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,b8(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function df(){const{dragDropManager:t}=k.useContext(OI);return Hr(t!=null,"Expected drag drop context"),t}function lJ(t,e){const n=df(),r=k.useMemo(()=>new sJ(n.getBackend()),[n]);return $0(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),$0(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function cJ(){const t=df();return k.useMemo(()=>new ZQ(t),[t])}class uJ{beginDrag(){const e=this.spec,n=this.monitor;let r=null;return typeof e.item=="object"?r=e.item:typeof e.item=="function"?r=e.item(n):r={},r??null}canDrag(){const e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(n):!0}isDragging(e,n){const r=this.spec,i=this.monitor,{isDragging:a}=r;return a?a(i):n===e.getSourceId()}endDrag(){const e=this.spec,n=this.monitor,r=this.connector,{end:i}=e;i&&i(n.getItem(),n),r.reconnect()}constructor(e,n,r){this.spec=e,this.monitor=n,this.connector=r}}function dJ(t,e,n){const r=k.useMemo(()=>new uJ(t,e,n),[e,n]);return k.useEffect(()=>{r.spec=t},[t]),r}function fJ(t){return k.useMemo(()=>{const e=t.type;return Hr(e!=null,"spec.type must be defined"),e},[t])}function hJ(t,e,n){const r=df(),i=dJ(t,e,n),a=fJ(t);$0(function(){if(a!=null){const[l,c]=nJ(a,i,r);return e.receiveHandlerId(l),n.receiveHandlerId(l),c}},[r,e,n,i,a])}function ra(t,e){const n=QI(t);Hr(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=cJ(),i=lJ(n.options,n.previewOptions);return hJ(n,r,i),[WI(n.collect,r,i),QQ(i),JQ(i)]}function pJ(t){return k.useMemo(()=>t.hooks.dropTarget(),[t])}function gJ(t){const e=df(),n=k.useMemo(()=>new oJ(e.getBackend()),[e]);return $0(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function mJ(){const t=df();return k.useMemo(()=>new eJ(t),[t])}function vJ(t){const{accept:e}=t;return k.useMemo(()=>(Hr(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class bJ{canDrop(){const e=this.spec,n=this.monitor;return e.canDrop?e.canDrop(n.getItem(),n):!0}hover(){const e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}drop(){const e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}constructor(e,n){this.spec=e,this.monitor=n}}function yJ(t,e){const n=k.useMemo(()=>new bJ(t,e),[e]);return k.useEffect(()=>{n.spec=t},[t]),n}function AJ(t,e,n){const r=df(),i=yJ(t,e),a=vJ(t);$0(function(){const[l,c]=tJ(a,i,r);return e.receiveHandlerId(l),n.receiveHandlerId(l),c},[r,e,i,n,a.map(s=>s.toString()).join("|")])}function wJ(t,e){const n=QI(t),r=mJ(),i=gJ(n.options);return AJ(n,r,i),[WI(n.collect,r,i),pJ(i)]}function e_(t){let e=null;return()=>(e==null&&(e=t()),e)}function SJ(t,e){return t.filter(n=>n!==e)}function CJ(t,e){const n=new Set,r=a=>n.add(a);t.forEach(r),e.forEach(r);const i=[];return n.forEach(a=>i.push(a)),i}class xJ{enter(e){const n=this.entered.length,r=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(e));return this.entered=CJ(this.entered.filter(r),[e]),n===0&&this.entered.length>0}leave(e){const n=this.entered.length;return this.entered=SJ(this.entered.filter(this.isNodeInDocument),e),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class TJ{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const i=this.config.exposeProperties[r];i!=null&&(n[r]={value:i(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,n){return n===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const t_="__NATIVE_FILE__",n_="__NATIVE_URL__",r_="__NATIVE_TEXT__",i_="__NATIVE_HTML__",a_=Object.freeze(Object.defineProperty({__proto__:null,FILE:t_,HTML:i_,TEXT:r_,URL:n_},Symbol.toStringTag,{value:"Module"}));function y8(t,e,n){const r=e.reduce((i,a)=>i||t.getData(a),"");return r??n}const A8={[t_]:{exposeProperties:{files:t=>Array.prototype.slice.call(t.files),items:t=>t.items,dataTransfer:t=>t},matchesTypes:["Files"]},[i_]:{exposeProperties:{html:(t,e)=>y8(t,e,""),dataTransfer:t=>t},matchesTypes:["Html","text/html"]},[n_]:{exposeProperties:{urls:(t,e)=>y8(t,e,"").split(`
1594
- `),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[r_]:{exposeProperties:{text:(t,e)=>y8(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function EJ(t,e){const n=A8[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new TJ(n);return r.loadDataTransfer(e),r}function w8(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(A8).filter(n=>{const r=A8[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(i=>e.indexOf(i)>-1):!1})[0]||null}const IJ=e_(()=>/firefox/i.test(navigator.userAgent)),s_=e_(()=>!!window.safari);class o_{interpolate(e){const{xs:n,ys:r,c1s:i,c2s:a,c3s:s}=this;let l=n.length-1;if(e===n[l])return r[l];let c=0,u=s.length-1,d;for(;c<=u;){d=Math.floor(.5*(c+u));const g=n[d];if(g<e)c=d+1;else if(g>e)u=d-1;else return r[d]}l=Math.max(0,u);const f=e-n[l],h=f*f;return r[l]+i[l]*f+a[l]*h+s[l]*f*h}constructor(e,n){const{length:r}=e,i=[];for(let g=0;g<r;g++)i.push(g);i.sort((g,v)=>e[g]<e[v]?-1:1);const a=[],s=[];let l,c;for(let g=0;g<r-1;g++)l=e[g+1]-e[g],c=n[g+1]-n[g],a.push(l),s.push(c/l);const u=[s[0]];for(let g=0;g<a.length-1;g++){const v=s[g],m=s[g+1];if(v*m<=0)u.push(0);else{l=a[g];const A=a[g+1],w=l+A;u.push(3*w/((w+A)/v+(w+l)/m))}}u.push(s[s.length-1]);const d=[],f=[];let h;for(let g=0;g<u.length-1;g++){h=s[g];const v=u[g],m=1/a[g],A=v+u[g+1]-h-h;d.push((h-v-A)*m),f.push(A*m*m)}this.xs=e,this.ys=n,this.c1s=u,this.c2s=d,this.c3s=f}}const _J=1;function l_(t){const e=t.nodeType===_J?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function Wm(t){return{x:t.clientX,y:t.clientY}}function DJ(t){var e;return t.nodeName==="IMG"&&(IJ()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function NJ(t,e,n,r){let i=t?e.width:n,a=t?e.height:r;return s_()&&t&&(a/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:a}}function OJ(t,e,n,r,i){const a=DJ(e),l=l_(a?t:e),c={x:n.x-l.x,y:n.y-l.y},{offsetWidth:u,offsetHeight:d}=t,{anchorX:f,anchorY:h}=r,{dragPreviewWidth:g,dragPreviewHeight:v}=NJ(a,e,u,d),m=()=>{let E=new o_([0,.5,1],[c.y,c.y/d*v,c.y+v-d]).interpolate(h);return s_()&&a&&(E+=(window.devicePixelRatio-1)*v),E},A=()=>new o_([0,.5,1],[c.x,c.x/u*g,c.x+g-u]).interpolate(f),{offsetX:w,offsetY:S}=i,x=w===0||w,T=S===0||S;return{x:x?w:A(),y:T?S:m()}}class FJ{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,n){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=n}}function kJ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c_(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){kJ(t,i,n[i])})}return t}class PJ{profile(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,n,r){this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);const i=s=>this.handleDragStart(s,e),a=s=>this.handleSelectStart(s);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",a),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",a),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=s=>this.handleDragEnter(s,e),i=s=>this.handleDragOver(s,e),a=s=>this.handleDrop(s,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",i),n.addEventListener("drop",a),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",i),n.removeEventListener("drop",a)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return c_({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(e);return c_({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(a_).some(n=>a_[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=EJ(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(e,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(e,n){this.dropTargetIds.unshift(n)}constructor(e,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const a=this.sourceNodes.get(i);return a&&l_(a)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:a}=this;this.dragStartSourceIds=null;const s=Wm(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:s});const{dataTransfer:l}=i,c=w8(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const d=this.monitor.getSourceId(),f=this.sourceNodes.get(d),h=this.sourcePreviewNodes.get(d)||f;if(h){const{anchorX:g,anchorY:v,offsetX:m,offsetY:A}=this.getCurrentSourcePreviewNodeOptions(),x=OJ(f,h,s,{anchorX:g,anchorY:v},{offsetX:m,offsetY:A});l.setDragImage(h,x.x,x.y)}}try{l==null||l.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);else{if(l&&!l.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:l}=i,c=w8(l);c&&this.beginDragNativeItem(c,l)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:a}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,a.length>0&&this.actions.hover(a,{clientOffset:Wm(i)}),a.some(l=>this.monitor.canDropOnTarget(l))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:a}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=Wm(i),this.scheduleHover(a),(a||[]).some(l=>this.monitor.canDropOnTarget(l))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var a;i.preventDefault(),(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}else w8(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:a}=this;this.dropTargetIds=[],this.actions.hover(a,{clientOffset:Wm(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const a=i.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(i.preventDefault(),a.dragDrop()))},this.options=new FJ(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new xJ(this.isNodeInDocument)}}const Sp=function(e,n,r){return new PJ(e,n,r)},u_=k.createContext(void 0),d_=({children:t,option:e,saveFormBuilderSchema:n,templateSchema:r,onChange:i,isHTML5BackendDisabled:a=!1})=>{const{isPreview:s,isAdmin:l,isRenderView:c,isBuilderMode:u,renderType:d,isAdvanceView:f,globalAlignment:h="ltr",emitSocketData:g,media:v,exam:m={},reusableComponent:A,saveFormProgress:w,showSettings:S,training:x,fileUploadParams:T}=e,C={...i8,formType:d,...r},[E,_]=k.useReducer(SW,C);return k.useEffect(()=>{const M=_t.debounce(()=>{n&&n(E)},1e3);return M(),()=>M.cancel()},[E,n]),o.jsx(u_.Provider,{value:{media:v,isBuilderMode:u,isPreview:s,isAdmin:l,isRenderView:c,renderType:d,isAdvanceView:f,globalAlignment:h,exam:m,emitSocketData:g,reusableComponent:A,state:E,dispatch:_,onChange:i,saveFormProgress:w,showSettings:S,training:x,fileUploadParams:T},children:a?o.jsx(o.Fragment,{children:t}):o.jsx(wp,{backend:Sp,children:t})})},f_=()=>k.useContext(u_),MJ=(t,e,n)=>{const r=Array.from(t),[i]=r.splice(e,1);return r.splice(n,0,i),r},LJ=(t,e)=>[...t.slice(0,e),...t.slice(e+1)],BJ=(t,e,n)=>[...t.slice(0,e),n,...t.slice(e)],h_=(t,e,n)=>{if(e.length===1){const c=Number(e[0]),u=Number(n[0]);return MJ(t,u,c)}const r=[...t],i=Number(e.slice(0,1)),a=e.slice(1),s=n.slice(1),l=r[i];return r[i]={...l,children:h_(l.children,a,s)},r},p_=(t,e)=>{if(e.length===1){const s=Number(e[0]);return LJ(t,s)}const n=[...t],r=Number(e.slice(0,1)),i=e.slice(1),a=n[r];return n[r]={...a,children:p_(a.children,i)},n},S8=(t,e,n)=>{if(e.length===1){const l=Number(e[0]);return BJ(t,l,n)}const r=[...t],i=Number(e.slice(0,1)),a=e.slice(1),s=r[i];return r[i]={...s,children:S8(s.children,a,n)},r},VJ=(t,e,n)=>{let r=[...t],i=r[n[fa]].children[n[ha]].children[n[Ca]].children[n[xa]].children[n[Ta]].inlineConditionalRules.rules[n[Fa]].conditions[n[Xo]].children[n[wo]];return r[n[fa]].children[n[ha]].children[n[Ca]].children[n[xa]].children[n[Ta]].inlineConditionalRules.rules[n[Fa]].conditions[n[Xo]].children.splice([n[wo]],1),r[e[fa]].children[e[ha]].children[e[Ca]].children[e[xa]].children[e[Ta]].inlineConditionalRules.rules[e[Fa]].conditions[e[Xo]].children.splice(e[wo],0,i),r},qJ=(t,e,n)=>h_(t,e,n),UJ=t=>{const e=[...t],n={type:As,uuid:nt(),children:[]};return e.map(r=>(r.children.length||(r.children=[n]),r))},g_=(t,e,n,r)=>{var h,g,v,m,A,w;let i;const a={...wc,uuid:nt(),children:[r]},s={...eu,uuid:nt()},l={...eu,uuid:nt(),children:[a]},c={...lf,uuid:nt(),children:[l]},u={...zm,uuid:nt(),children:[c]};switch(e.length){case 1:{r.type===sx?i={...c,children:[r]}:i={...c,children:[s]};break}case 2:{r.type===na?i={...u,children:[c]}:i={...u,children:[c]};break}case 3:{r.type===Ao?i={...c,children:[l]}:i={...eu,uuid:nt(),children:[{...wc,uuid:nt(),children:[r]}]};break}case 4:{r.type===z1?i=a:i=r;break}case 5:{i=r;break}default:i=r}let d=t;return n.length>5?(w=(A=(m=(v=(g=(h=d[n[fa]])==null?void 0:h.children[n[ha]])==null?void 0:g.children[n[Ca]])==null?void 0:v.children[n[xa]])==null?void 0:m.children[n[Ta]])==null?void 0:A.inlineConditionalRules)==null||w.rules[n[Fa]].conditions[n[Xo]].children.splice(n[wo],1):d=p_(d,n),d=UJ(d),d=S8(d,e,i),d},$J=(t,e,n)=>{let r;switch(e.length){case 1:{r={...zm,uuid:nt(),children:[{...lf,uuid:nt(),children:[{...eu,uuid:nt(),children:[{...wc,uuid:nt(),children:[n]}]}]}]};break}case 2:{r={...lf,uuid:nt(),children:[{...eu,uuid:nt(),children:[{...wc,uuid:nt(),children:[n]}]}]};break}case 3:{r={...eu,uuid:nt(),children:[{...wc,uuid:nt(),children:[n]}]};break}case 4:{r={...wc,uuid:nt(),children:[n]};break}default:r=n}return S8(t,e,r)},sn=()=>{var Pe;const{state:t,dispatch:e,onChange:n,saveFormProgress:r}=f_(),{updateGlobalToast:i,emitSocketData:a}=Ht();if(t===void 0)throw new Error("Must be wrapped in builder provider");const s=t.builderTemplateName,l=t.isChangesSaved,c=t.editing_by,u=t.version_name,d=t.loading,f=t.published_status,h=t,g=t,v=t.formType,m=t==null?void 0:t.userSelectedLanguage,A=(Pe=t==null?void 0:t.userSelectedLanguage)==null?void 0:Pe.type,w=t==null?void 0:t.languages,S=t.layout,x=k.useCallback(Ee=>hW(Ee)(e),[e]),T=k.useCallback(Ee=>qG(Ee)(e),[e]),C=k.useCallback(Ee=>pW(Ee)(e),[e]),E=k.useCallback((Ee,$)=>{var He,ot,rn,nn,Jt,_n,wt,Ke,st;const he=Ee.path.split("-"),ye=he.slice(0,-1).join("-"),se={uuid:$.uuid,type:$.type,reviewerChecklist:[]},fe=0,Ae=1,Ne=2,Le=3,ze=4,tt=5,it=6,ht=8,Ut=7,fn=5,$t=6,mn=8;if($.type===na&&($==null?void 0:$.schema)!==void 0){O(JSON.parse($==null?void 0:$.schema),parseInt(he[fe]));return}if(((He=$==null?void 0:$.schema)==null?void 0:He.componentType)==="question"&&((_n=(Jt=(nn=(rn=(ot=S[0])==null?void 0:ot.children[0])==null?void 0:rn.children[0])==null?void 0:nn.children[0])==null?void 0:Jt.children)!=null&&_n.some(vt=>{var Vt,On,$n;return((Vt=vt==null?void 0:vt.questionText)==null?void 0:Vt[m.type])===(($n=(On=$==null?void 0:$.schema)==null?void 0:On.questionText)==null?void 0:$n[m.type])}))&&((wt=$==null?void 0:$.schema.questionText)==null?void 0:wt.english)!=="Sample Question"){alert("not allow"),i({showToast:!0,toastMessage:"Exist",toastDetail:"Question text cannot be same for more than one element",toastType:"warn"});return}if($.type===tr){let vt={type:z1,reviewerChecklist:[],..._t.cloneDeep($.schema)};if(vt!=null&&vt.options&&(vt={...vt,options:[{uuid:nt(),optionText:{english:"Option 1"},value:"Option1",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}},{uuid:nt(),optionText:{english:"Option 2"},value:"Option2",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}}]}),vt.componentType==="grid-component"&&(vt={...vt,children:[],options:[{uuid:nt(),custom_values:{}}]}),vt.componentType==="radio-hierarchal"&&(vt={...vt,type:"radio",children:[],options:[{uuid:nt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:nt(),label:"No",value:null,enableConditionalField:!0,children:[]}]}),vt={...vt,uuid:nt()},he.length===ht){pe(parseInt(he[fe]),parseInt(he[Ae]),parseInt(he[Ne]),parseInt(he[Le]),parseInt(he[ze]),parseInt(he[tt]),parseInt(he[it]),vt);return}if(he.length===Ut){Ce(parseInt(he[fe]),parseInt(he[Ae]),parseInt(he[Ne]),parseInt(he[Le]),parseInt(he[ze]),parseInt(he[fn]),parseInt(he[$t]),vt);return}if((st=(Ke=S[he[fe]].children[he[Ae]])==null?void 0:Ke.children[he[Ne]])!=null&&st.rowIsRepeatable&&(vt==null?void 0:vt.componentType)==="editor"){i({showToast:!0,toastMessage:"Forbidden",toastDetail:"This Field cannot be applied in repeatable",toastType:"error"});return}C($J(S,he,vt)),he.length>1&&de(he[fe],he[Ae],he[Ne],vt);return}const En=$.path.split("-"),Tt=En.slice(0,-1).join("-");if(En.length===he.length){if(Tt===ye){if((En==null?void 0:En.length)===mn){C(VJ(S,he,En));return}C(qJ(S,he,En));return}const vt={...se,...$};($==null?void 0:$.id)===void 0&&(vt.id=nt()),C(g_(S,he,En,vt));return}if((En==null?void 0:En.length)===8){const vt={type:z1,reviewerChecklist:[],...$};Ce(parseInt(he[fe]),parseInt(he[Ae]),parseInt(he[Ne]),parseInt(he[Le]),parseInt(he[ze]),parseInt(he[fn]),parseInt(he[$t]),vt),ee(En[fa],En[ha],En[Ca],En[xa],En[Ta],En[fn],En[$t],En[Bl]);return}const je={...se,...$};($==null?void 0:$.id)===void 0&&(je.id=nt()),C(g_(S,he,En,je))},[S,m.type]),_=k.useCallback(()=>wW()(e),[e]),M=k.useCallback(Ee=>gW(Ee)(e,t),[e]),N=k.useCallback(Ee=>mW(Ee)(e,t),[e]),F=k.useCallback(Ee=>vW(Ee)(e),[e]),P=k.useCallback(Ee=>VG(Ee)(e),[e]),H=k.useCallback(Ee=>HG(Ee)(e),[e]),O=k.useCallback((Ee,$)=>XG(Ee,$)(e),[e]),j=k.useCallback((Ee,$)=>JG(Ee,$)(e),[e]),U=k.useCallback((Ee,$,he)=>tW(Ee,$,he)(e),[e]),le=k.useCallback(Ee=>jG(Ee)(e),[e]),R=k.useCallback((Ee,$)=>zG(Ee,$)(e),[e]),X=k.useCallback((Ee,$,he)=>QG(Ee,$,he)(e),[e]),ce=k.useCallback((Ee,$,he,ye)=>rW(Ee,$,he,ye)(e),[e]),Y=k.useCallback((Ee,$,he,ye,se)=>iW(Ee,$,he,ye,se)(e,t),[e,t]),ae=k.useCallback((Ee,$,he,ye,se,fe)=>aW(Ee,$,he,ye,se,fe)(e,t),[e,t]),re=k.useCallback((Ee,$,he)=>YG(Ee,$,he)(e),[e]),Z=k.useCallback((Ee,$,he,ye)=>WG(Ee,$,he,ye)(e),[e]),K=k.useCallback((Ee,$)=>$G(Ee,$)(e),[e]),W=k.useCallback((Ee,$,he,ye,se,fe)=>sW(Ee,$,he,ye,se,fe)(e),[e]),ge=k.useCallback((Ee,$,he,ye,se)=>nW(Ee,$,he,ye,se)(e),[e]),ve=k.useCallback((Ee,$,he,ye)=>GG(Ee,$,he,ye)(e),[e]),Ie=k.useCallback((Ee,$,he)=>KG(Ee,$,he)(e),[e]),be=k.useCallback((Ee,$)=>UG(Ee,$)(e,t),[e]),de=k.useCallback((Ee,$,he,ye)=>ZG(Ee,$,he,ye)(e),[e]),ne=k.useCallback((Ee,$,he,ye,se,fe,Ae,Ne,Le)=>dW(Ee,$,he,ye,se,fe,Ae,Ne,Le)(e),[e]),q=k.useCallback((Ee,$,he,ye,se,fe,Ae,Ne,Le)=>cW(Ee,$,he,ye,se,fe,Ae,Ne,Le)(e),[e]),ee=k.useCallback((Ee,$,he,ye,se,fe,Ae,Ne)=>uW(Ee,$,he,ye,se,fe,Ae,Ne)(e),[e]),oe=k.useCallback((Ee,$,he,ye,se,fe,Ae,Ne)=>fW(Ee,$,he,ye,se,fe,Ae,Ne)(e),[e]),pe=k.useCallback((Ee,$,he,ye,se,fe,Ae,Ne)=>oW(Ee,$,he,ye,se,fe,Ae,Ne)(e),[e]),Ce=k.useCallback((Ee,$,he,ye,se,fe,Ae,Ne)=>lW(Ee,$,he,ye,se,fe,Ae,Ne)(e),[e]),De=k.useCallback(Ee=>bW(Ee)(e),[e]),me=k.useCallback(Ee=>yW(Ee)(e),[e]),Te=k.useCallback(Ee=>AW(Ee)(e),[e]);return{builderIsChangesSaved:l,builderTemplateName:s,formBuilderFormSchema:h,formBuilderFormLayout:S,formBuilderSchemaLanguages:w,saveFormTemplateNewVersion:g,userSelectedLanguage:m,selectedLanguage:A,formBuilderConfigurationType:v,formBuilderLoading:d,formBuilderPublishedStatus:f,builderEditingBy:c,builderVersionName:u,handleDrop:E,formatTableFieldsHook:T,saveFormBuilderSchema:x,removePage:le,removeSection:R,removeRow:X,removeColumn:ce,removeField:Y,updateEditingBy:Te,addTabs:P,addSection:H,addRow:j,addColumn:U,cloneField:W,cloneColumn:ge,cloneRow:ve,cloneSection:Ie,clonePage:be,sectionImport:O,setLayout:C,fieldSettingUpdate:ae,selectFormBuilderLanguage:M,unselectFormBuilderLanguage:N,updateUserFormSelectedLanguage:F,updateFormType:De,schemaBuilderUpdate:me,pageSettingUpdate:K,saveFormProgress:r,sectionSettingUpdate:re,rowSettingUpdate:Z,clearBuilderSchema:_,addFieldToRowRepeaptable:de,addFieldToInlineRuleCondtionFields:pe,fieldSettingUpdateInlineConditional:ne,fieldSettingDeleteInlineConditional:oe,addFieldToGridComponentHook:Ce,gridComponentFieldSettingUpdate:q,gridComponentFieldDelete:ee}},Ht=()=>{var C,E,_;const{isPreview:t,isAdmin:e,isRenderView:n,renderType:r,isAdvanceView:i,isBuilderMode:a,media:s,exam:l,globalAlignment:c,reusableComponent:u,showSettings:d,training:f,fileUploadParams:h}=f_();if(t===void 0)throw new Error("Must be wrapped in builder provider");const g=r==null?void 0:r.key,{saveComponent:v,componentList:m,sectionsList:A}=u,w=()=>{},S=M=>{d!=null&&d.showToast&&(d==null||d.showToast(M))},x=((C=f==null?void 0:f.quiz)==null?void 0:C.quizList)||[],T=(E=f==null?void 0:f.quiz)!=null&&E.getQuizList?(_=f==null?void 0:f.quiz)==null?void 0:_.getQuizList:()=>{};return{quizlist:x,getQuizList:T,isPreview:t,isAdmin:e,isRenderView:n,renderType:g,isAdvanceView:i,isBuilderMode:a,globalAlignment:c,media:s,exam:l,saveComponent:v,componentList:m,sectionsList:A,fileUploadParams:h,emitSocketData:w,updateGlobalToast:S}},jJ="TASKS_LOADING",zJ="TASKS_ADD",HJ="TASKS_GET_PAGINATED_LIST",YJ="TASKS_DELETE",KJ="TASKS_PAGNIATION_UPDATE",XJ="TASKS_UPDATE",RJ="TASKS_SUCCESS_GET",GJ="TASK_GET_TEMPLATE",WJ="TASK_SET_DATA",QJ="TASKS_FORM_SUBMIT",JJ="TASKS_FORM_HTTP_REQUEST",C8="TASK_SET_PROGRESS_VALUE",m_="TASK_SET_MAX_PROGRESS_VALUE",v_="TASK_SET_REGISTER_DATA",b_="TASK_SET_SCHEMA",x8="TASK_UPDATE_USER_FORM_SUBMIT_DATA",y_="CLEAR_TASK",A_="TASK_USER_SUBMIT_FORM_REPEATABLE_ADD",w_="TASK_USER_SUBMIT_FORM_REPEATABLE_REMOVE_INDEX",S_="TASK_USER_TRAINING_DATA",C_="TASK_FIELD_UPDATE",T8=6,Qm=1,Cp="DISPLAY_TYPE_START_DETAILS",Jm="DISPLAY_TYPE_QUIZ",E8="DISPLAY_TYPE_START_TIMER";function ZJ(t,e,n,r,i,a){return s=>{s({type:C_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,field:a}})}}function x_(t){return e=>{const n={type:x8,payLoad:{userTaskSubmitFormData:[...t]}};e(n)}}function eZ(t){return(e,n)=>{const{TasksReducer:r}=n(),{taskData:i}=r,a={type:x8,payLoad:{taskData:{...i,...t}}};e(a)}}function tZ(t,e){return(n,r)=>{const{userTaskSubmitFormData:i}=r,a=_t.findIndex(i,function(l){return l.rowId===t});n({type:w_,payLoad:{userSubmitFormIndex:a,repeatableDataRowIndex:e}})}}function nZ(t,e){return(n,r)=>{const{userTaskSubmitFormData:i}=r,a=_t.findIndex(i,function(l){return l.rowId===t});if(a<0){alert("No repeatable section found for the given row UUID");return}n({type:A_,payLoad:{userSubmitFormIndex:a,repeatableData:e}})}}function rZ(){return t=>{t({type:y_,payLoad:null})}}const T_=t=>e=>{e({type:C8,payLoad:{progressValue:t}})},iZ=t=>e=>{e({type:C8,payLoad:t})},aZ=t=>e=>{e({type:S_,payLoad:{userTrainingSaveData:t}})},E_=t=>e=>{e({type:v_,payLoad:{registerData:t}})},sZ=(t,e,n)=>(r,i)=>{var u;const{userTaskSubmitFormData:a}=i,s=[...a],l=_t.findIndex(s,function(d){var f;return d.rowId===((f=t==null?void 0:t.row)==null?void 0:f.uuid)});let c=(u=a[l])==null?void 0:u.repeatableFields;c={...c,[e==null?void 0:e.uuid]:`<div>${n}</div>`},s[l]={...s[l],repeatableFields:c},x_(s)(r)},oZ=(t,e,n)=>(r,i)=>{const{userTaskSubmitFormData:a,registerData:s}=i,l=a,c=_t.cloneDeep(s);if(n&&(l==null?void 0:l.length)>0){c[e==null?void 0:e.uuid]=n;for(const d of l)d.fieldId===e.uuid&&(d.postData[0]={postValue:n})}else if((l==null?void 0:l.length)>0){for(const d of l)d.fieldId===e.uuid&&(d.postData[0]={postValue:""});delete c[e==null?void 0:e.uuid]}E_(c)(r);const u=Object.keys(c).length;T_(u)(r)},lZ=t=>e=>{e({type:m_,payLoad:{progressMaxValue:t}})},I8={submitting:!1,httpRequest:!1,taskData:null,taskUpdateLoading:!1,loading:!1,progressLoading:!1,list:[],filter:"",sort:"task.created_at|desc",total_records:0,page:1,per_page:10,success:!1,success_message:"",userTaskSubmitFormData:null,taskSchema:null,progressMaxValue:0,maxTabs:0,registerData:{},progressValue:0,tabNoOfFieldsData:[],noOfTotalElements:0,sortField:null,sortOrder:null,userTrainingSaveData:null,assessmentData:null,task_status:1},cZ=(t=I8,e)=>{var n,r;switch(e.type){case y_:return{...t,...I8,list:[...t.list],page:t.page,per_page:t.per_page,filter:t.filter,sort:t.sort,total_records:t.total_records};case RJ:return{...t,...e.payLoad};case x8:return{...t,...e.payLoad};case b_:return{...t,...e.payLoad};case C8:return{...t,...e.payLoad};case v_:return{...t,registerData:e.payLoad.registerData};case m_:return{...t,...e.payLoad};case jJ:return{...t,...e.payLoad};case QJ:return{...t,...e.payLoad};case JJ:return{...t,...e.payLoad};case zJ:{const{record:i}=e.payLoad;return{...t,list:[...i,...t.list]}}case HJ:return{...t,...e.payLoad};case WJ:return{...t,taskData:e.payLoad};case KJ:return{...t,...e.payLoad};case YJ:{const i=t.list.filter(a=>a.task_id!==e.payLoad.task_id);return{...t,list:[...i]}}case S_:return{...t,...e.payLoad};case C_:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,field:u}=e.payLoad,d=[...t.taskSchema.layout];d[i].children[a].children[s].children[l].children[c]=u;const f={...t.taskSchema,layout:d};return{...t,taskSchema:f}}case A_:{console.log("TASK_USER_SUBMIT_FORM_REPEATABLE_ADD*******",e.payLoad);const{userSubmitFormIndex:i,repeatableData:a}=e.payLoad,s=t.userTaskSubmitFormData[i].repeatableFieldsData?(n=t.userTaskSubmitFormData[i])==null?void 0:n.repeatableFieldsData:[];return s.push(a),t.userTaskSubmitFormData[i].repeatableFieldsData=s,t}case w_:{const{userSubmitFormIndex:i,repeatableDataRowIndex:a}=e.payLoad,s=[...t.userTaskSubmitFormData],l=[...(r=s[i])==null?void 0:r.repeatableFieldsData];return l.splice(a,1),s[i]={...s[i],repeatableFieldsData:l},{...t,userTaskSubmitFormData:s}}case XJ:{const{row:i,eventIndex:a}=e.payLoad,s=t.list[a];return t.list[a]={...s,...i},t}case GJ:return{...t,...e.payLoad}}return t},I_=k.createContext(void 0),uZ=({option:t,taskOptions:e,saveFormBuilderSchema:n,templateSchema:r,taskValue:i,children:a,isHTML5BackendDisabled:s=!1})=>{const[l,c]=k.useReducer(cZ,{...I8,...i}),{progressMaxValue:u=0,progressValue:d=0,registerData:f=null,...h}=i||{};return k.useEffect(()=>{c({type:b_,payLoad:h})},[i]),o.jsx(I_.Provider,{value:{taskOptions:e,state:l,dispatch:c},children:o.jsx(d_,{isHTML5BackendDisabled:s,option:t,saveFormBuilderSchema:n,templateSchema:r,onChange:()=>{},children:a})})},dZ=()=>k.useContext(I_),Ar=()=>{var de,ne,q,ee,oe,pe,Ce,De;const{taskOptions:n,state:r,dispatch:i}=dZ();if(r===void 0)throw new Error("Must be wrapped in task render provider");const a=r.task_status,s=r.task_status,l=r.userTaskSubmitFormData,c=r.userTrainingSaveData,u=r.taskSchema,d=r.assessmentData,f=r.progressLoading,h=r.submitting,g=r.httpRequest,v=r.taskData,m=r.progressMaxValue,A=r.maxTabs,w=r.tabNoOfFieldsData,S=r.registerData,x=r.progressValue,T=r.noOfTotalElements,C=r.menuList,E=r.loading,_=r.submitting,M=r.success,N=r.success_message,F=(de=n==null?void 0:n.exam)!=null&&de.startQuiz?(ne=n==null?void 0:n.exam)==null?void 0:ne.startQuiz:()=>{},P=(q=n==null?void 0:n.exam)!=null&&q.AddUserAssessmentAnswer?(ee=n==null?void 0:n.exam)==null?void 0:ee.AddUserAssessmentAnswer:()=>{},H=(oe=n==null?void 0:n.exam)!=null&&oe.endQuiz?(pe=n==null?void 0:n.exam)==null?void 0:pe.endQuiz:()=>{},O=(Ce=n==null?void 0:n.exam)!=null&&Ce.examComplete?(De=n==null?void 0:n.exam)==null?void 0:De.examComplete:me=>{},j=n!=null&&n.updateTaskFormData?n==null?void 0:n.updateTaskFormData:(me,Te,Pe,Ee,$,he)=>{},U=n!=null&&n.submitTaskFormData?n==null?void 0:n.submitTaskFormData:(me,Te,Pe)=>{},le=k.useCallback(me=>i(eZ(me)),[i]),R=k.useCallback((me,Te,Pe)=>{},[i]),X=k.useCallback(()=>rZ()(i),[i]),ce=k.useCallback((me,Te)=>nZ(me,Te)(i,r),[i,r]),Y=k.useCallback((me,Te)=>tZ(me,Te)(i,r),[i,r]),ae=k.useCallback(me=>{T_(me)(i)},[i]),re=k.useCallback(me=>{E_(me)(i)},[i]),Z=k.useCallback(me=>iZ(me)(i),[i]),K=k.useCallback(me=>x_(me)(i),[i]),W=k.useCallback(me=>lZ(me)(i),[i]),ge=k.useCallback(me=>aZ(me)(i),[i]),ve=k.useCallback((me,Te,Pe)=>sZ(me,Te,Pe)(i,r),[i,r]),Ie=k.useCallback((me,Te,Pe)=>oZ(me,Te,Pe)(i,r),[i,r]),be=k.useCallback((me,Te,Pe,Ee,$,he)=>i(ZJ(me,Te,Pe,Ee,$,he)),[i]);return{examComplete:O,taskOptions:n,TASK_PUBLISHED:6,TASK_PENDING:1,taskStatus:s,assessmentData:d,taskSchema:u,taskData:v,TasksList:C,TasksLoading:E,TasksSuccess:M,TasksSuccessMessage:N,taskProgressMaxValue:m,taskRegisterData:S,taskProgressValue:x,taskMaxTabs:A,noOfTotalElements:T,taskTabRequiredFieldsData:w,userTaskSubmitFormData:l,userTrainingSaveData:c,TasksSubmitLoading:_,updateTaskDataSchema:le,submitTaskFormData:U,updateTaskFormData:j,TasksSubmit:h,TasksHTTPRequest:g,updateTaskRegisterData:re,updateTaskProgressValue:ae,updateTaskProgressMaxValue:W,updateUserFormDataSubmit:K,removeUserDataFormRowRepeatableData:Y,addUserDataFormRowRepeatableData:ce,onSetValuetoRepeatableData:ve,onSetValuetoPostDataHook:Ie,clearTaskSchema:X,taskProgressLoading:f,task_status:a,startQuiz:F,endQuiz:H,AddUserAssessmentAnswer:P,updateUserTraining:ge,taskFieldUpdateHook:be,updateProgressDataValuesHook:Z,saveProgressDataHook:R}};function xp(t){"@babel/helpers - typeof";return xp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xp(t)}function fZ(t,e){if(xp(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(xp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hZ(t){var e=fZ(t,"string");return xp(e)=="symbol"?e:e+""}function pZ(t,e,n){return(e=hZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var gZ={root:function(e){var n=e.props;return ft("p-skeleton p-component",{"p-skeleton-circle":n.shape==="circle","p-skeleton-none":n.animation==="none"})}},mZ=`
1594
+ `),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[r_]:{exposeProperties:{text:(t,e)=>y8(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function EJ(t,e){const n=A8[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new TJ(n);return r.loadDataTransfer(e),r}function w8(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(A8).filter(n=>{const r=A8[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(i=>e.indexOf(i)>-1):!1})[0]||null}const IJ=e_(()=>/firefox/i.test(navigator.userAgent)),s_=e_(()=>!!window.safari);class o_{interpolate(e){const{xs:n,ys:r,c1s:i,c2s:a,c3s:s}=this;let l=n.length-1;if(e===n[l])return r[l];let c=0,u=s.length-1,d;for(;c<=u;){d=Math.floor(.5*(c+u));const g=n[d];if(g<e)c=d+1;else if(g>e)u=d-1;else return r[d]}l=Math.max(0,u);const f=e-n[l],h=f*f;return r[l]+i[l]*f+a[l]*h+s[l]*f*h}constructor(e,n){const{length:r}=e,i=[];for(let g=0;g<r;g++)i.push(g);i.sort((g,v)=>e[g]<e[v]?-1:1);const a=[],s=[];let l,c;for(let g=0;g<r-1;g++)l=e[g+1]-e[g],c=n[g+1]-n[g],a.push(l),s.push(c/l);const u=[s[0]];for(let g=0;g<a.length-1;g++){const v=s[g],m=s[g+1];if(v*m<=0)u.push(0);else{l=a[g];const A=a[g+1],w=l+A;u.push(3*w/((w+A)/v+(w+l)/m))}}u.push(s[s.length-1]);const d=[],f=[];let h;for(let g=0;g<u.length-1;g++){h=s[g];const v=u[g],m=1/a[g],A=v+u[g+1]-h-h;d.push((h-v-A)*m),f.push(A*m*m)}this.xs=e,this.ys=n,this.c1s=u,this.c2s=d,this.c3s=f}}const _J=1;function l_(t){const e=t.nodeType===_J?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function Wm(t){return{x:t.clientX,y:t.clientY}}function DJ(t){var e;return t.nodeName==="IMG"&&(IJ()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function NJ(t,e,n,r){let i=t?e.width:n,a=t?e.height:r;return s_()&&t&&(a/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:a}}function OJ(t,e,n,r,i){const a=DJ(e),l=l_(a?t:e),c={x:n.x-l.x,y:n.y-l.y},{offsetWidth:u,offsetHeight:d}=t,{anchorX:f,anchorY:h}=r,{dragPreviewWidth:g,dragPreviewHeight:v}=NJ(a,e,u,d),m=()=>{let E=new o_([0,.5,1],[c.y,c.y/d*v,c.y+v-d]).interpolate(h);return s_()&&a&&(E+=(window.devicePixelRatio-1)*v),E},A=()=>new o_([0,.5,1],[c.x,c.x/u*g,c.x+g-u]).interpolate(f),{offsetX:w,offsetY:S}=i,x=w===0||w,T=S===0||S;return{x:x?w:A(),y:T?S:m()}}class FJ{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,n){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=n}}function kJ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c_(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){kJ(t,i,n[i])})}return t}class PJ{profile(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,n,r){this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);const i=s=>this.handleDragStart(s,e),a=s=>this.handleSelectStart(s);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",a),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",a),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=s=>this.handleDragEnter(s,e),i=s=>this.handleDragOver(s,e),a=s=>this.handleDrop(s,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",i),n.addEventListener("drop",a),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",i),n.removeEventListener("drop",a)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return c_({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(e);return c_({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(a_).some(n=>a_[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=EJ(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(e,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(e,n){this.dropTargetIds.unshift(n)}constructor(e,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const a=this.sourceNodes.get(i);return a&&l_(a)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:a}=this;this.dragStartSourceIds=null;const s=Wm(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:s});const{dataTransfer:l}=i,c=w8(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const d=this.monitor.getSourceId(),f=this.sourceNodes.get(d),h=this.sourcePreviewNodes.get(d)||f;if(h){const{anchorX:g,anchorY:v,offsetX:m,offsetY:A}=this.getCurrentSourcePreviewNodeOptions(),x=OJ(f,h,s,{anchorX:g,anchorY:v},{offsetX:m,offsetY:A});l.setDragImage(h,x.x,x.y)}}try{l==null||l.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);else{if(l&&!l.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:l}=i,c=w8(l);c&&this.beginDragNativeItem(c,l)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:a}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,a.length>0&&this.actions.hover(a,{clientOffset:Wm(i)}),a.some(l=>this.monitor.canDropOnTarget(l))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:a}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=Wm(i),this.scheduleHover(a),(a||[]).some(l=>this.monitor.canDropOnTarget(l))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var a;i.preventDefault(),(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}else w8(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:a}=this;this.dropTargetIds=[],this.actions.hover(a,{clientOffset:Wm(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const a=i.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(i.preventDefault(),a.dragDrop()))},this.options=new FJ(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new xJ(this.isNodeInDocument)}}const Sp=function(e,n,r){return new PJ(e,n,r)},u_=k.createContext(void 0),d_=({children:t,option:e,saveFormBuilderSchema:n,templateSchema:r,onChange:i,isHTML5BackendDisabled:a=!1})=>{const{taskId:s,isPreview:l,isAdmin:c,isRenderView:u,isBuilderMode:d,renderType:f,isAdvanceView:h,globalAlignment:g="ltr",emitSocketData:v,media:m,exam:A={},reusableComponent:w,saveFormProgress:S,showSettings:x,training:T,fileUploadParams:C}=e,E={...i8,formType:f,...r},[_,M]=k.useReducer(SW,E);return k.useEffect(()=>{const N=_t.debounce(()=>{n&&n(_)},1e3);return N(),()=>N.cancel()},[_,n]),o.jsx(u_.Provider,{value:{taskId:s,media:m,isBuilderMode:d,isPreview:l,isAdmin:c,isRenderView:u,renderType:f,isAdvanceView:h,globalAlignment:g,exam:A,emitSocketData:v,reusableComponent:w,state:_,dispatch:M,onChange:i,saveFormProgress:S,showSettings:x,training:T,fileUploadParams:C},children:a?o.jsx(o.Fragment,{children:t}):o.jsx(wp,{backend:Sp,children:t})})},f_=()=>k.useContext(u_),MJ=(t,e,n)=>{const r=Array.from(t),[i]=r.splice(e,1);return r.splice(n,0,i),r},LJ=(t,e)=>[...t.slice(0,e),...t.slice(e+1)],BJ=(t,e,n)=>[...t.slice(0,e),n,...t.slice(e)],h_=(t,e,n)=>{if(e.length===1){const c=Number(e[0]),u=Number(n[0]);return MJ(t,u,c)}const r=[...t],i=Number(e.slice(0,1)),a=e.slice(1),s=n.slice(1),l=r[i];return r[i]={...l,children:h_(l.children,a,s)},r},p_=(t,e)=>{if(e.length===1){const s=Number(e[0]);return LJ(t,s)}const n=[...t],r=Number(e.slice(0,1)),i=e.slice(1),a=n[r];return n[r]={...a,children:p_(a.children,i)},n},S8=(t,e,n)=>{if(e.length===1){const l=Number(e[0]);return BJ(t,l,n)}const r=[...t],i=Number(e.slice(0,1)),a=e.slice(1),s=r[i];return r[i]={...s,children:S8(s.children,a,n)},r},VJ=(t,e,n)=>{let r=[...t],i=r[n[fa]].children[n[ha]].children[n[Ca]].children[n[xa]].children[n[Ta]].inlineConditionalRules.rules[n[Fa]].conditions[n[Xo]].children[n[wo]];return r[n[fa]].children[n[ha]].children[n[Ca]].children[n[xa]].children[n[Ta]].inlineConditionalRules.rules[n[Fa]].conditions[n[Xo]].children.splice([n[wo]],1),r[e[fa]].children[e[ha]].children[e[Ca]].children[e[xa]].children[e[Ta]].inlineConditionalRules.rules[e[Fa]].conditions[e[Xo]].children.splice(e[wo],0,i),r},qJ=(t,e,n)=>h_(t,e,n),UJ=t=>{const e=[...t],n={type:As,uuid:nt(),children:[]};return e.map(r=>(r.children.length||(r.children=[n]),r))},g_=(t,e,n,r)=>{var h,g,v,m,A,w;let i;const a={...wc,uuid:nt(),children:[r]},s={...eu,uuid:nt()},l={...eu,uuid:nt(),children:[a]},c={...lf,uuid:nt(),children:[l]},u={...zm,uuid:nt(),children:[c]};switch(e.length){case 1:{r.type===sx?i={...c,children:[r]}:i={...c,children:[s]};break}case 2:{r.type===na?i={...u,children:[c]}:i={...u,children:[c]};break}case 3:{r.type===Ao?i={...c,children:[l]}:i={...eu,uuid:nt(),children:[{...wc,uuid:nt(),children:[r]}]};break}case 4:{r.type===z1?i=a:i=r;break}case 5:{i=r;break}default:i=r}let d=t;return n.length>5?(w=(A=(m=(v=(g=(h=d[n[fa]])==null?void 0:h.children[n[ha]])==null?void 0:g.children[n[Ca]])==null?void 0:v.children[n[xa]])==null?void 0:m.children[n[Ta]])==null?void 0:A.inlineConditionalRules)==null||w.rules[n[Fa]].conditions[n[Xo]].children.splice(n[wo],1):d=p_(d,n),d=UJ(d),d=S8(d,e,i),d},$J=(t,e,n)=>{let r;switch(e.length){case 1:{r={...zm,uuid:nt(),children:[{...lf,uuid:nt(),children:[{...eu,uuid:nt(),children:[{...wc,uuid:nt(),children:[n]}]}]}]};break}case 2:{r={...lf,uuid:nt(),children:[{...eu,uuid:nt(),children:[{...wc,uuid:nt(),children:[n]}]}]};break}case 3:{r={...eu,uuid:nt(),children:[{...wc,uuid:nt(),children:[n]}]};break}case 4:{r={...wc,uuid:nt(),children:[n]};break}default:r=n}return S8(t,e,r)},sn=()=>{var Pe;const{state:t,dispatch:e,onChange:n,saveFormProgress:r}=f_(),{updateGlobalToast:i,emitSocketData:a}=Ht();if(t===void 0)throw new Error("Must be wrapped in builder provider");const s=t.builderTemplateName,l=t.isChangesSaved,c=t.editing_by,u=t.version_name,d=t.loading,f=t.published_status,h=t,g=t,v=t.formType,m=t==null?void 0:t.userSelectedLanguage,A=(Pe=t==null?void 0:t.userSelectedLanguage)==null?void 0:Pe.type,w=t==null?void 0:t.languages,S=t.layout,x=k.useCallback(Ee=>hW(Ee)(e),[e]),T=k.useCallback(Ee=>qG(Ee)(e),[e]),C=k.useCallback(Ee=>pW(Ee)(e),[e]),E=k.useCallback((Ee,$)=>{var He,ot,rn,nn,Jt,_n,wt,Ke,st;const he=Ee.path.split("-"),ye=he.slice(0,-1).join("-"),se={uuid:$.uuid,type:$.type,reviewerChecklist:[]},fe=0,Ae=1,Ne=2,Le=3,ze=4,tt=5,it=6,ht=8,Ut=7,fn=5,$t=6,mn=8;if($.type===na&&($==null?void 0:$.schema)!==void 0){O(JSON.parse($==null?void 0:$.schema),parseInt(he[fe]));return}if(((He=$==null?void 0:$.schema)==null?void 0:He.componentType)==="question"&&((_n=(Jt=(nn=(rn=(ot=S[0])==null?void 0:ot.children[0])==null?void 0:rn.children[0])==null?void 0:nn.children[0])==null?void 0:Jt.children)!=null&&_n.some(vt=>{var Vt,On,$n;return((Vt=vt==null?void 0:vt.questionText)==null?void 0:Vt[m.type])===(($n=(On=$==null?void 0:$.schema)==null?void 0:On.questionText)==null?void 0:$n[m.type])}))&&((wt=$==null?void 0:$.schema.questionText)==null?void 0:wt.english)!=="Sample Question"){alert("not allow"),i({showToast:!0,toastMessage:"Exist",toastDetail:"Question text cannot be same for more than one element",toastType:"warn"});return}if($.type===tr){let vt={type:z1,reviewerChecklist:[],..._t.cloneDeep($.schema)};if(vt!=null&&vt.options&&(vt={...vt,options:[{uuid:nt(),optionText:{english:"Option 1"},value:"Option1",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}},{uuid:nt(),optionText:{english:"Option 2"},value:"Option2",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}}]}),vt.componentType==="grid-component"&&(vt={...vt,children:[],options:[{uuid:nt(),custom_values:{}}]}),vt.componentType==="radio-hierarchal"&&(vt={...vt,type:"radio",children:[],options:[{uuid:nt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:nt(),label:"No",value:null,enableConditionalField:!0,children:[]}]}),vt={...vt,uuid:nt()},he.length===ht){pe(parseInt(he[fe]),parseInt(he[Ae]),parseInt(he[Ne]),parseInt(he[Le]),parseInt(he[ze]),parseInt(he[tt]),parseInt(he[it]),vt);return}if(he.length===Ut){Ce(parseInt(he[fe]),parseInt(he[Ae]),parseInt(he[Ne]),parseInt(he[Le]),parseInt(he[ze]),parseInt(he[fn]),parseInt(he[$t]),vt);return}if((st=(Ke=S[he[fe]].children[he[Ae]])==null?void 0:Ke.children[he[Ne]])!=null&&st.rowIsRepeatable&&(vt==null?void 0:vt.componentType)==="editor"){i({showToast:!0,toastMessage:"Forbidden",toastDetail:"This Field cannot be applied in repeatable",toastType:"error"});return}C($J(S,he,vt)),he.length>1&&de(he[fe],he[Ae],he[Ne],vt);return}const En=$.path.split("-"),Tt=En.slice(0,-1).join("-");if(En.length===he.length){if(Tt===ye){if((En==null?void 0:En.length)===mn){C(VJ(S,he,En));return}C(qJ(S,he,En));return}const vt={...se,...$};($==null?void 0:$.id)===void 0&&(vt.id=nt()),C(g_(S,he,En,vt));return}if((En==null?void 0:En.length)===8){const vt={type:z1,reviewerChecklist:[],...$};Ce(parseInt(he[fe]),parseInt(he[Ae]),parseInt(he[Ne]),parseInt(he[Le]),parseInt(he[ze]),parseInt(he[fn]),parseInt(he[$t]),vt),ee(En[fa],En[ha],En[Ca],En[xa],En[Ta],En[fn],En[$t],En[Bl]);return}const je={...se,...$};($==null?void 0:$.id)===void 0&&(je.id=nt()),C(g_(S,he,En,je))},[S,m.type]),_=k.useCallback(()=>wW()(e),[e]),M=k.useCallback(Ee=>gW(Ee)(e,t),[e]),N=k.useCallback(Ee=>mW(Ee)(e,t),[e]),F=k.useCallback(Ee=>vW(Ee)(e),[e]),P=k.useCallback(Ee=>VG(Ee)(e),[e]),H=k.useCallback(Ee=>HG(Ee)(e),[e]),O=k.useCallback((Ee,$)=>XG(Ee,$)(e),[e]),j=k.useCallback((Ee,$)=>JG(Ee,$)(e),[e]),U=k.useCallback((Ee,$,he)=>tW(Ee,$,he)(e),[e]),le=k.useCallback(Ee=>jG(Ee)(e),[e]),R=k.useCallback((Ee,$)=>zG(Ee,$)(e),[e]),X=k.useCallback((Ee,$,he)=>QG(Ee,$,he)(e),[e]),ce=k.useCallback((Ee,$,he,ye)=>rW(Ee,$,he,ye)(e),[e]),Y=k.useCallback((Ee,$,he,ye,se)=>iW(Ee,$,he,ye,se)(e,t),[e,t]),ae=k.useCallback((Ee,$,he,ye,se,fe)=>aW(Ee,$,he,ye,se,fe)(e,t),[e,t]),re=k.useCallback((Ee,$,he)=>YG(Ee,$,he)(e),[e]),Z=k.useCallback((Ee,$,he,ye)=>WG(Ee,$,he,ye)(e),[e]),K=k.useCallback((Ee,$)=>$G(Ee,$)(e),[e]),W=k.useCallback((Ee,$,he,ye,se,fe)=>sW(Ee,$,he,ye,se,fe)(e),[e]),ge=k.useCallback((Ee,$,he,ye,se)=>nW(Ee,$,he,ye,se)(e),[e]),ve=k.useCallback((Ee,$,he,ye)=>GG(Ee,$,he,ye)(e),[e]),Ie=k.useCallback((Ee,$,he)=>KG(Ee,$,he)(e),[e]),be=k.useCallback((Ee,$)=>UG(Ee,$)(e,t),[e]),de=k.useCallback((Ee,$,he,ye)=>ZG(Ee,$,he,ye)(e),[e]),ne=k.useCallback((Ee,$,he,ye,se,fe,Ae,Ne,Le)=>dW(Ee,$,he,ye,se,fe,Ae,Ne,Le)(e),[e]),q=k.useCallback((Ee,$,he,ye,se,fe,Ae,Ne,Le)=>cW(Ee,$,he,ye,se,fe,Ae,Ne,Le)(e),[e]),ee=k.useCallback((Ee,$,he,ye,se,fe,Ae,Ne)=>uW(Ee,$,he,ye,se,fe,Ae,Ne)(e),[e]),oe=k.useCallback((Ee,$,he,ye,se,fe,Ae,Ne)=>fW(Ee,$,he,ye,se,fe,Ae,Ne)(e),[e]),pe=k.useCallback((Ee,$,he,ye,se,fe,Ae,Ne)=>oW(Ee,$,he,ye,se,fe,Ae,Ne)(e),[e]),Ce=k.useCallback((Ee,$,he,ye,se,fe,Ae,Ne)=>lW(Ee,$,he,ye,se,fe,Ae,Ne)(e),[e]),De=k.useCallback(Ee=>bW(Ee)(e),[e]),me=k.useCallback(Ee=>yW(Ee)(e),[e]),Te=k.useCallback(Ee=>AW(Ee)(e),[e]);return{builderIsChangesSaved:l,builderTemplateName:s,formBuilderFormSchema:h,formBuilderFormLayout:S,formBuilderSchemaLanguages:w,saveFormTemplateNewVersion:g,userSelectedLanguage:m,selectedLanguage:A,formBuilderConfigurationType:v,formBuilderLoading:d,formBuilderPublishedStatus:f,builderEditingBy:c,builderVersionName:u,handleDrop:E,formatTableFieldsHook:T,saveFormBuilderSchema:x,removePage:le,removeSection:R,removeRow:X,removeColumn:ce,removeField:Y,updateEditingBy:Te,addTabs:P,addSection:H,addRow:j,addColumn:U,cloneField:W,cloneColumn:ge,cloneRow:ve,cloneSection:Ie,clonePage:be,sectionImport:O,setLayout:C,fieldSettingUpdate:ae,selectFormBuilderLanguage:M,unselectFormBuilderLanguage:N,updateUserFormSelectedLanguage:F,updateFormType:De,schemaBuilderUpdate:me,pageSettingUpdate:K,saveFormProgress:r,sectionSettingUpdate:re,rowSettingUpdate:Z,clearBuilderSchema:_,addFieldToRowRepeaptable:de,addFieldToInlineRuleCondtionFields:pe,fieldSettingUpdateInlineConditional:ne,fieldSettingDeleteInlineConditional:oe,addFieldToGridComponentHook:Ce,gridComponentFieldSettingUpdate:q,gridComponentFieldDelete:ee}},Ht=()=>{var E,_,M;const{taskId:t,isPreview:e,isAdmin:n,isRenderView:r,renderType:i,isAdvanceView:a,isBuilderMode:s,media:l,exam:c,globalAlignment:u,reusableComponent:d,showSettings:f,training:h,fileUploadParams:g}=f_();if(e===void 0)throw new Error("Must be wrapped in builder provider");const v=i==null?void 0:i.key,{saveComponent:m,componentList:A,sectionsList:w}=d,S=()=>{},x=N=>{f!=null&&f.showToast&&(f==null||f.showToast(N))},T=((E=h==null?void 0:h.quiz)==null?void 0:E.quizList)||[],C=(_=h==null?void 0:h.quiz)!=null&&_.getQuizList?(M=h==null?void 0:h.quiz)==null?void 0:M.getQuizList:()=>{};return{taskId:t,quizlist:T,getQuizList:C,isPreview:e,isAdmin:n,isRenderView:r,renderType:v,isAdvanceView:a,isBuilderMode:s,globalAlignment:u,media:l,exam:c,saveComponent:m,componentList:A,sectionsList:w,fileUploadParams:g,emitSocketData:S,updateGlobalToast:x}},jJ="TASKS_LOADING",zJ="TASKS_ADD",HJ="TASKS_GET_PAGINATED_LIST",YJ="TASKS_DELETE",KJ="TASKS_PAGNIATION_UPDATE",XJ="TASKS_UPDATE",RJ="TASKS_SUCCESS_GET",GJ="TASK_GET_TEMPLATE",WJ="TASK_SET_DATA",QJ="TASKS_FORM_SUBMIT",JJ="TASKS_FORM_HTTP_REQUEST",C8="TASK_SET_PROGRESS_VALUE",m_="TASK_SET_MAX_PROGRESS_VALUE",v_="TASK_SET_REGISTER_DATA",b_="TASK_SET_SCHEMA",x8="TASK_UPDATE_USER_FORM_SUBMIT_DATA",y_="CLEAR_TASK",A_="TASK_USER_SUBMIT_FORM_REPEATABLE_ADD",w_="TASK_USER_SUBMIT_FORM_REPEATABLE_REMOVE_INDEX",S_="TASK_USER_TRAINING_DATA",C_="TASK_FIELD_UPDATE",T8=6,Qm=1,Cp="DISPLAY_TYPE_START_DETAILS",Jm="DISPLAY_TYPE_QUIZ",E8="DISPLAY_TYPE_START_TIMER";function ZJ(t,e,n,r,i,a){return s=>{s({type:C_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,field:a}})}}function x_(t){return e=>{const n={type:x8,payLoad:{userTaskSubmitFormData:[...t]}};e(n)}}function eZ(t){return(e,n)=>{const{TasksReducer:r}=n(),{taskData:i}=r,a={type:x8,payLoad:{taskData:{...i,...t}}};e(a)}}function tZ(t,e){return(n,r)=>{const{userTaskSubmitFormData:i}=r,a=_t.findIndex(i,function(l){return l.rowId===t});n({type:w_,payLoad:{userSubmitFormIndex:a,repeatableDataRowIndex:e}})}}function nZ(t,e){return(n,r)=>{const{userTaskSubmitFormData:i}=r,a=_t.findIndex(i,function(l){return l.rowId===t});if(a<0){alert("No repeatable section found for the given row UUID");return}n({type:A_,payLoad:{userSubmitFormIndex:a,repeatableData:e}})}}function rZ(){return t=>{t({type:y_,payLoad:null})}}const T_=t=>e=>{e({type:C8,payLoad:{progressValue:t}})},iZ=t=>e=>{e({type:C8,payLoad:t})},aZ=t=>e=>{e({type:S_,payLoad:{userTrainingSaveData:t}})},E_=t=>e=>{e({type:v_,payLoad:{registerData:t}})},sZ=(t,e,n)=>(r,i)=>{var u;const{userTaskSubmitFormData:a}=i,s=[...a],l=_t.findIndex(s,function(d){var f;return d.rowId===((f=t==null?void 0:t.row)==null?void 0:f.uuid)});let c=(u=a[l])==null?void 0:u.repeatableFields;c={...c,[e==null?void 0:e.uuid]:`<div>${n}</div>`},s[l]={...s[l],repeatableFields:c},x_(s)(r)},oZ=(t,e,n)=>(r,i)=>{const{userTaskSubmitFormData:a,registerData:s}=i,l=a,c=_t.cloneDeep(s);if(n&&(l==null?void 0:l.length)>0){c[e==null?void 0:e.uuid]=n;for(const d of l)d.fieldId===e.uuid&&(d.postData[0]={postValue:n})}else if((l==null?void 0:l.length)>0){for(const d of l)d.fieldId===e.uuid&&(d.postData[0]={postValue:""});delete c[e==null?void 0:e.uuid]}E_(c)(r);const u=Object.keys(c).length;T_(u)(r)},lZ=t=>e=>{e({type:m_,payLoad:{progressMaxValue:t}})},I8={submitting:!1,httpRequest:!1,taskData:null,taskUpdateLoading:!1,loading:!1,progressLoading:!1,list:[],filter:"",sort:"task.created_at|desc",total_records:0,page:1,per_page:10,success:!1,success_message:"",userTaskSubmitFormData:null,taskSchema:null,progressMaxValue:0,maxTabs:0,registerData:{},progressValue:0,tabNoOfFieldsData:[],noOfTotalElements:0,sortField:null,sortOrder:null,userTrainingSaveData:null,assessmentData:null,task_status:1},cZ=(t=I8,e)=>{var n,r;switch(e.type){case y_:return{...t,...I8,list:[...t.list],page:t.page,per_page:t.per_page,filter:t.filter,sort:t.sort,total_records:t.total_records};case RJ:return{...t,...e.payLoad};case x8:return{...t,...e.payLoad};case b_:return{...t,...e.payLoad};case C8:return{...t,...e.payLoad};case v_:return{...t,registerData:e.payLoad.registerData};case m_:return{...t,...e.payLoad};case jJ:return{...t,...e.payLoad};case QJ:return{...t,...e.payLoad};case JJ:return{...t,...e.payLoad};case zJ:{const{record:i}=e.payLoad;return{...t,list:[...i,...t.list]}}case HJ:return{...t,...e.payLoad};case WJ:return{...t,taskData:e.payLoad};case KJ:return{...t,...e.payLoad};case YJ:{const i=t.list.filter(a=>a.task_id!==e.payLoad.task_id);return{...t,list:[...i]}}case S_:return{...t,...e.payLoad};case C_:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,field:u}=e.payLoad,d=[...t.taskSchema.layout];d[i].children[a].children[s].children[l].children[c]=u;const f={...t.taskSchema,layout:d};return{...t,taskSchema:f}}case A_:{console.log("TASK_USER_SUBMIT_FORM_REPEATABLE_ADD*******",e.payLoad);const{userSubmitFormIndex:i,repeatableData:a}=e.payLoad,s=t.userTaskSubmitFormData[i].repeatableFieldsData?(n=t.userTaskSubmitFormData[i])==null?void 0:n.repeatableFieldsData:[];return s.push(a),t.userTaskSubmitFormData[i].repeatableFieldsData=s,t}case w_:{const{userSubmitFormIndex:i,repeatableDataRowIndex:a}=e.payLoad,s=[...t.userTaskSubmitFormData],l=[...(r=s[i])==null?void 0:r.repeatableFieldsData];return l.splice(a,1),s[i]={...s[i],repeatableFieldsData:l},{...t,userTaskSubmitFormData:s}}case XJ:{const{row:i,eventIndex:a}=e.payLoad,s=t.list[a];return t.list[a]={...s,...i},t}case GJ:return{...t,...e.payLoad}}return t},I_=k.createContext(void 0),uZ=({option:t,taskOptions:e,saveFormBuilderSchema:n,templateSchema:r,taskValue:i,children:a,isHTML5BackendDisabled:s=!1})=>{const[l,c]=k.useReducer(cZ,{...I8,...i}),{progressMaxValue:u=0,progressValue:d=0,registerData:f=null,...h}=i||{};return k.useEffect(()=>{c({type:b_,payLoad:h})},[i]),o.jsx(I_.Provider,{value:{taskOptions:e,state:l,dispatch:c},children:o.jsx(d_,{isHTML5BackendDisabled:s,option:t,saveFormBuilderSchema:n,templateSchema:r,onChange:()=>{},children:a})})},dZ=()=>k.useContext(I_),Ar=()=>{var de,ne,q,ee,oe,pe,Ce,De;const{taskOptions:n,state:r,dispatch:i}=dZ();if(r===void 0)throw new Error("Must be wrapped in task render provider");const a=r.task_status,s=r.task_status,l=r.userTaskSubmitFormData,c=r.userTrainingSaveData,u=r.taskSchema,d=r.assessmentData,f=r.progressLoading,h=r.submitting,g=r.httpRequest,v=r.taskData,m=r.progressMaxValue,A=r.maxTabs,w=r.tabNoOfFieldsData,S=r.registerData,x=r.progressValue,T=r.noOfTotalElements,C=r.menuList,E=r.loading,_=r.submitting,M=r.success,N=r.success_message,F=(de=n==null?void 0:n.exam)!=null&&de.startQuiz?(ne=n==null?void 0:n.exam)==null?void 0:ne.startQuiz:()=>{},P=(q=n==null?void 0:n.exam)!=null&&q.AddUserAssessmentAnswer?(ee=n==null?void 0:n.exam)==null?void 0:ee.AddUserAssessmentAnswer:()=>{},H=(oe=n==null?void 0:n.exam)!=null&&oe.endQuiz?(pe=n==null?void 0:n.exam)==null?void 0:pe.endQuiz:()=>{},O=(Ce=n==null?void 0:n.exam)!=null&&Ce.examComplete?(De=n==null?void 0:n.exam)==null?void 0:De.examComplete:me=>{},j=n!=null&&n.updateTaskFormData?n==null?void 0:n.updateTaskFormData:(me,Te,Pe,Ee,$,he)=>{},U=n!=null&&n.submitTaskFormData?n==null?void 0:n.submitTaskFormData:(me,Te,Pe)=>{},le=k.useCallback(me=>i(eZ(me)),[i]),R=k.useCallback((me,Te,Pe)=>{},[i]),X=k.useCallback(()=>rZ()(i),[i]),ce=k.useCallback((me,Te)=>nZ(me,Te)(i,r),[i,r]),Y=k.useCallback((me,Te)=>tZ(me,Te)(i,r),[i,r]),ae=k.useCallback(me=>{T_(me)(i)},[i]),re=k.useCallback(me=>{E_(me)(i)},[i]),Z=k.useCallback(me=>iZ(me)(i),[i]),K=k.useCallback(me=>x_(me)(i),[i]),W=k.useCallback(me=>lZ(me)(i),[i]),ge=k.useCallback(me=>aZ(me)(i),[i]),ve=k.useCallback((me,Te,Pe)=>sZ(me,Te,Pe)(i,r),[i,r]),Ie=k.useCallback((me,Te,Pe)=>oZ(me,Te,Pe)(i,r),[i,r]),be=k.useCallback((me,Te,Pe,Ee,$,he)=>i(ZJ(me,Te,Pe,Ee,$,he)),[i]);return{examComplete:O,taskOptions:n,TASK_PUBLISHED:6,TASK_PENDING:1,taskStatus:s,assessmentData:d,taskSchema:u,taskData:v,TasksList:C,TasksLoading:E,TasksSuccess:M,TasksSuccessMessage:N,taskProgressMaxValue:m,taskRegisterData:S,taskProgressValue:x,taskMaxTabs:A,noOfTotalElements:T,taskTabRequiredFieldsData:w,userTaskSubmitFormData:l,userTrainingSaveData:c,TasksSubmitLoading:_,updateTaskDataSchema:le,submitTaskFormData:U,updateTaskFormData:j,TasksSubmit:h,TasksHTTPRequest:g,updateTaskRegisterData:re,updateTaskProgressValue:ae,updateTaskProgressMaxValue:W,updateUserFormDataSubmit:K,removeUserDataFormRowRepeatableData:Y,addUserDataFormRowRepeatableData:ce,onSetValuetoRepeatableData:ve,onSetValuetoPostDataHook:Ie,clearTaskSchema:X,taskProgressLoading:f,task_status:a,startQuiz:F,endQuiz:H,AddUserAssessmentAnswer:P,updateUserTraining:ge,taskFieldUpdateHook:be,updateProgressDataValuesHook:Z,saveProgressDataHook:R}};function xp(t){"@babel/helpers - typeof";return xp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xp(t)}function fZ(t,e){if(xp(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(xp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hZ(t){var e=fZ(t,"string");return xp(e)=="symbol"?e:e+""}function pZ(t,e,n){return(e=hZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var gZ={root:function(e){var n=e.props;return ft("p-skeleton p-component",{"p-skeleton-circle":n.shape==="circle","p-skeleton-none":n.animation==="none"})}},mZ=`
1595
1595
  @layer primereact {
1596
1596
  .p-skeleton {
1597
1597
  position: relative;
@@ -2286,7 +2286,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2286
2286
  position: relative;
2287
2287
  }
2288
2288
  }
2289
- `}}),ii=b.forwardRef(function(t,e){var n=Kn(),r=b.useContext(ar),i=_3.getProps(t,r),a=b.useState(i.id),s=pN(a,2),l=s[0],c=s[1],u=b.useState(i.collapsed),d=pN(u,2),f=d[0],h=d[1],g=b.useRef(null),v=b.useRef(null),m=i.toggleable?i.onToggle?i.collapsed:f:!1,A=l+"_header",w=l+"_content",S=_3.setMetaData({props:i,state:{id:l,collapsed:m}}),x=S.ptm,T=S.cx,C=S.isUnstyled;ci(_3.css.styles,C,{name:"panel"});var E=function(X){i.toggleable&&(m?_(X):M(X),X&&(i.onToggle&&i.onToggle({originalEvent:X,value:!m}),X.preventDefault()))},_=function(X){i.onToggle||h(!1),i.onExpand&&X&&i.onExpand(X)},M=function(X){i.onToggle||h(!0),i.onCollapse&&X&&i.onCollapse(X)};b.useImperativeHandle(e,function(){return{props:i,toggle:E,expand:_,collapse:M,getElement:function(){return g.current},getContent:function(){return v.current}}}),Li(function(){l||c(So())});var N=function(){if(i.toggleable){var X=l+"_label",ce=n({className:T("toggler"),onClick:E,id:X,"aria-controls":w,"aria-expanded":!m,type:"button",role:"button","aria-label":i.header},x("toggler")),Y=n(x("togglericon")),ae=m?i.expandIcon||b.createElement(Mm,Y):i.collapseIcon||b.createElement(n8,Y),re=nr.getJSXIcon(ae,Y,{props:i,collapsed:m});return b.createElement("button",ce,re,b.createElement(Qt,null))}return null},F=function(){var X=ke.getJSXElement(i.header,i),ce=ke.getJSXElement(i.icons,i),Y=N(),ae=n({id:A,className:T("title")},x("title")),re=b.createElement("span",ae,X),Z=n({className:T("icons")},x("icons")),K=b.createElement("div",Z,ce,Y),W=n({className:T("header")},x("header")),ge=b.createElement("div",W,re,K);if(i.headerTemplate){var ve={className:"p-panel-header",titleClassName:"p-panel-title",iconsClassName:"p-panel-icons",togglerClassName:"p-panel-header-icon p-panel-toggler p-link",onTogglerClick:E,titleElement:re,iconsElement:K,togglerElement:Y,element:ge,id:l+"_header",props:i,collapsed:m};return ke.getJSXElement(i.headerTemplate,ve)}else if(i.header||i.toggleable)return ge;return null},P=function(){var X=ke.getJSXElement(i.footer,i),ce=n({className:T("footer")},x("footer")),Y=b.createElement("div",ce,X);if(i.footerTemplate){var ae={className:T("footer"),element:Y,props:i};return ke.getJSXElement(i.footerTemplate,ae)}else if(i.footer)return Y;return null},H=function(){var X=n({ref:v,className:T("toggleableContent"),"aria-hidden":m,role:"region",id:w,"aria-labelledby":A},x("toggleablecontent")),ce=n({className:T("content")},x("content")),Y=n({classNames:T("transition"),timeout:{enter:1e3,exit:450},in:!m,unmountOnExit:!0,options:i.transitionOptions},x("transition"));return b.createElement(Ro,v7({nodeRef:v},Y),b.createElement("div",X,b.createElement("div",ce,i.children)))},O=n({id:l,ref:g,style:i.style,className:ft(i.className,T("root"))},_3.getOtherProps(i),x("root")),j=F(),U=H(),le=P();return b.createElement("div",O,j,U,le)});ii.displayName="Panel";const ese=t=>{var v;const{fieldState:e,setFieldState:n,pageIndex:r,formBuilderFormLayout:i,pageSettingUpdate:a}=t,s=(m,A)=>{const w=`${m.className} justify-content-start`,S=`${m.titleClassName} pl-1`;return o.jsxs("div",{className:w,children:[o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:m.togglerClassName,onClick:()=>c(A),"aria-label":"Submit"}),o.jsx("span",{className:S,children:`Rule ${A+1}`})]})},l=(m,A)=>{var S;const w=[...((S=e==null?void 0:e.conditionalTabRules)==null?void 0:S.rules)||[]];w[m].conditions=w[m].conditions.filter((x,T)=>A!==T),n(x=>({...x,conditionalTabRules:{...x.conditionalTabRules,rules:w}}))},c=m=>{var x;const A=[...(e==null?void 0:e.conditionalTabRules.rules)||[]],w=A.filter((T,C)=>m!==C);n(T=>({...T,conditionalTabRules:{...T.conditionalTabRules,rules:w}}));const S=A[m];(x=S==null?void 0:S.conditions)==null||x.map(T=>{const C=i?_t.findIndex(i,_=>{var M;return(_==null?void 0:_.uuid)===((M=T==null?void 0:T.tab)==null?void 0:M.uuid)}):-1,E=i[C];E&&(E.isHidden=!1,a(C,E))})};let u=[...i].filter(function(m,A){return A!==r});u.map(m=>({uuid:m==null?void 0:m.uuid,title:m==null?void 0:m.title}));const d=(m,A,w)=>{const S=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];S[A].conditions[w].option=m==null?void 0:m.value,n(x=>({...x,conditionalTabRules:{...x.conditionalTabRules,rules:S}}))},f=(m,A,w)=>{const S=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];S[A].conditions[w].tab=m==null?void 0:m.value,n(C=>({...C,conditionalTabRules:{...C.conditionalTabRules,rules:S}}));const x=_t.findIndex(i,C=>{var E;return(C==null?void 0:C.uuid)===((E=m==null?void 0:m.value)==null?void 0:E.uuid)}),T=i[x];T&&(T.isHidden=!0,a(x,T))},h=()=>{n(m=>({...m,conditionalTabRules:{...m.conditionalTabRules,rules:[...m.conditionalTabRules.rules,{conditions:[]}]}}))},g=m=>{const A=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];A[m].conditions=[...A[m].conditions,{option:null,tab:null}],n(w=>({...w,conditionalTabRules:{...w.conditionalTabRules,rules:[...A]}}))};return o.jsxs("div",{children:[o.jsx("h4",{children:"Conditional Tabs"}),i&&(i==null?void 0:i.length)>1&&((v=e==null?void 0:e.conditionalTabRules)==null?void 0:v.rules.map((m,A)=>o.jsx(ii,{className:"mb-3",header:`Rule ${A+1}`,headerTemplate:w=>s(w,A),children:o.jsxs("div",{children:[m==null?void 0:m.conditions.map((w,S)=>o.jsx("div",{className:"p-field pb-6",children:o.jsxs("div",{className:"grid",children:[o.jsx("div",{className:"col-2",children:o.jsxs("label",{children:["Show tab",w.value]})}),o.jsx("div",{className:"col-3 p-fluid",children:o.jsx(Pa,{value:w.tab,options:u,onChange:x=>f(x,A,S),optionLabel:"title.english",placeholder:"Select option"})}),o.jsx("div",{className:"col-3",children:"when option is selected"}),o.jsx("div",{className:"col-3 p-fluid",children:o.jsx(Pa,{value:w==null?void 0:w.option,options:e==null?void 0:e.options,onChange:x=>d(x,A,S),optionLabel:"optionText.english",placeholder:"Select option"})}),o.jsx("div",{className:"col-1",children:o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>l(A,S),tooltipOptions:{position:"top"}})})]})},S)),o.jsx(Ot,{text:!0,size:"small",onClick:()=>g(A),icon:"pi pi-plus",className:"p-mt-4",label:"Add Condition"})]})},"conditional_tab_rule"+A))),i&&(i==null?void 0:i.length)>1&&o.jsx(Ot,{text:!0,onClick:()=>h(),className:"p-mt-4",icon:"pi pi-plus",label:"Add Rule",size:"small"}),i&&(i==null?void 0:i.length)<2&&o.jsx("p",{className:"error",children:"Please needs to have two or more tabs to enable the conditional tabs"})]})},tse=t=>{var x;const{fieldState:e,setFieldState:n,section:r,formBuilderFormLayout:i,sectionSettingUpdate:a,page:s}=t,[l]=k.useState([]),{schemaBuilderUpdate:c,formBuilderFormSchema:u}=sn(),d=(T,C)=>{const E=`${T.className} justify-content-start`,_=`${T.titleClassName} pl-1`;return o.jsxs("div",{className:E,children:[o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:T.togglerClassName,onClick:()=>f(C),"aria-label":"Submit"}),o.jsx("span",{className:_,children:`Rule ${C+1}`})]})},f=T=>{var M;const C=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],E=C[T];(M=E==null?void 0:E.conditions)==null||M.map(N=>{var H;const F=_t.findIndex(i,O=>{var j;return(O==null?void 0:O.uuid)===((j=N==null?void 0:N.tab)==null?void 0:j.uuid)}),P=i?_t.findIndex(i[F].children,O=>{var j;return(O==null?void 0:O.uuid)===((j=N==null?void 0:N.section)==null?void 0:j.uuid)}):-1;if(P>=0){const O=(H=i[F])==null?void 0:H.children[P];O&&(O.isHidden=!1,a(F,P,O))}});const _=C.filter((N,F)=>T!==F);n(N=>({...N,conditionalSectionRules:{...N.conditionalSectionRules,rules:_}}))},h=T=>{var _;let C=!1;const E=i?i.filter(function(M){return(M==null?void 0:M.uuid)===(T==null?void 0:T.uuid)}):[];return(E==null?void 0:E.length)>0&&((_=E[0].children)==null?void 0:_.length)>1&&(C=!0),C},g=(T,C,E)=>{const _=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];_[C].conditions[E].option=T==null?void 0:T.value,n(M=>({...M,conditionalSectionRules:{...M.conditionalSectionRules,rules:_}}))},v=(T,C)=>{var M;const E=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],_=E[T];(M=_==null?void 0:_.conditions)==null||M.map(N=>{var O;const F=_t.findIndex(i,j=>{var U;return(j==null?void 0:j.uuid)===((U=N==null?void 0:N.tab)==null?void 0:U.uuid)}),P=i?_t.findIndex(i[F].children,j=>{var U;return(j==null?void 0:j.uuid)===((U=N==null?void 0:N.section)==null?void 0:U.uuid)}):-1,H=(O=i[F])==null?void 0:O.children[P];console.log("sectionData",H),H&&(H.isHidden=!1,console.log("sectionData",H),a(F,P,H))}),E[T].conditions=E[T].conditions.filter((N,F)=>C!==F),n(N=>({...N,conditionalSectionRules:{...N.conditionalSectionRules,rules:E}}))},m=(T,C,E)=>{var H,O;const _=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];_[C].conditions[E].section=T==null?void 0:T.value;const M=(O=(H=_[C].conditions[E])==null?void 0:H.tab)==null?void 0:O.uuid,N=_t.findIndex(i,j=>(j==null?void 0:j.uuid)===M);n(j=>({...j,conditionalSectionRules:{...j.conditionalSectionRules,rules:_}}));const F=i?_t.findIndex(i[N].children,j=>{var U;return(j==null?void 0:j.uuid)===((U=T==null?void 0:T.value)==null?void 0:U.uuid)}):-1,P=i[N].children[F];P&&(P.isHidden=!0,a(N,F,P))},A=T=>{const C=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];C[T].conditions=[...C[T].conditions,{option:null,tab:{title:s==null?void 0:s.title,uuid:s==null?void 0:s.uuid},section:null}],n(E=>({...E,conditionalSectionRules:{...E.conditionalSectionRules,rules:C}}))},w=()=>{n(C=>({...C,conditionalSectionRules:{...C.conditionalSectionRules,rules:[...C.conditionalSectionRules.rules,{uuid:nt(),conditions:[]}]}}));const T=[...(u==null?void 0:u.conditionalSectionsRules)||[]];c({conditionalSectionsRules:[...T,{fieldId:e==null?void 0:e.uuid,uuid:nt(),conditions:[]}]})},S=T=>{var E;const C=i==null?void 0:i.filter(function(_){return(_==null?void 0:_.uuid)===(T==null?void 0:T.uuid)});if(C&&(C==null?void 0:C.length)>0){const _=(E=C[0])==null?void 0:E.children.filter(function(M){return(M==null?void 0:M.uuid)!==(r==null?void 0:r.uuid)});if((_==null?void 0:_.length)>0)return _}return l};return o.jsxs("div",{children:[o.jsx("h4",{children:"Conditional Sections"}),(x=e==null?void 0:e.conditionalSectionRules)==null?void 0:x.rules.map((T,C)=>o.jsx(ii,{className:"mb-3",header:`Rule ${C+1}`,headerTemplate:E=>d(E,C),children:o.jsxs("div",{children:[T==null?void 0:T.conditions.map((E,_)=>{var M,N;return o.jsx("div",{className:"p-field pb-2",children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-3 p-fluid",children:[o.jsx("label",{children:"In Tab"}),o.jsx("p",{children:(N=(M=E==null?void 0:E.tab)==null?void 0:M.title)==null?void 0:N.english})]}),o.jsxs("div",{className:"col-3 p-fluid",children:[o.jsxs("label",{children:["Select section",E.value]}),o.jsx(Pa,{disabled:!h(E==null?void 0:E.tab),value:E.section,options:S(E.tab),onChange:F=>m(F,C,_),optionLabel:"heading.english",placeholder:"Select option"})]}),o.jsxs("div",{className:"col-4 p-fluid",children:["when option is selected",o.jsx(Pa,{disabled:!h(E==null?void 0:E.tab),value:E==null?void 0:E.option,options:e==null?void 0:e.options,onChange:F=>g(F,C,_),optionLabel:"optionText.english",placeholder:"Select option"})]}),o.jsxs("div",{className:"col-1",children:[o.jsx("br",{}),o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>v(C,_),tooltipOptions:{position:"top"}})]}),!h(E.tab)&&o.jsx("div",{className:"col-12",children:o.jsxs("p",{className:"error",children:[" ","At least two or more sections should exist in a page"]})})]})},_)}),o.jsx("div",{children:o.jsx("div",{className:"flex",children:o.jsx(Ot,{text:!0,className:"btn-sm mt-3 ",label:"+ Add Condition",onClick:()=>A(C),size:"small"})})})]})},C)),o.jsx(Ot,{text:!0,icon:"pi pi-plus",onClick:()=>w(),className:"p-mt-4",label:"Add Rule",size:"small"})]})},nse=t=>{var u;const{fieldState:e,setFieldState:n}=t,r=d=>{var g;const h=[...((g=e==null?void 0:e.inlineConditionalRules)==null?void 0:g.rules)||[]].filter((v,m)=>d!==m);n(v=>({...v,inlineConditionalRules:{...v.inlineConditionalRules,rules:h}}))},i=(d,f)=>{const h=`${d.className} justify-content-start`,g=`${d.titleClassName} pl-1`;return o.jsxs("div",{className:h,children:[o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:d.togglerClassName,onClick:()=>r(f),"aria-label":"Submit"}),o.jsx("span",{className:g,children:`Rule ${f+1}`})]})},a=(d,f,h)=>{const g=[...(e==null?void 0:e.inlineConditionalRules.rules)||[]];g[f].conditions[h].value=d==null?void 0:d.value,n(v=>({...v,inlineConditionalRules:{...v.inlineConditionalRules,rules:g}}))},s=(d,f)=>{const h=[...(e==null?void 0:e.inlineConditionalRules.rules)||[]];h[d].conditions=h[d].conditions.filter((g,v)=>f!==v),n(g=>({...g,inlineConditionalRules:{...g.inlineConditionalRules,rules:h}}))},l=d=>{const f=[...(e==null?void 0:e.inlineConditionalRules.rules)||[]];f[d].conditions=[...f[d].conditions,{value:"",children:[]}],n(h=>({...h,inlineConditionalRules:{...h.inlineConditionalRules,rules:f}}))},c=()=>{n(d=>({...d,inlineConditionalRules:{...d.inlineConditionalRules,rules:[...d.inlineConditionalRules.rules,{conditions:[]}]}}))};return o.jsxs("div",{children:[o.jsx("h4",{children:"Inline Conditions"}),(u=e==null?void 0:e.inlineConditionalRules)==null?void 0:u.rules.map((d,f)=>o.jsx(ii,{className:"mb-3",header:`Rule ${f+1}`,headerTemplate:h=>i(h,f),children:o.jsxs("div",{children:[d==null?void 0:d.conditions.map((h,g)=>o.jsx("div",{className:"p-field p-pt-2",children:o.jsxs("div",{className:"grid",children:[o.jsx("label",{className:"block",children:"Show when selected option is:"}),o.jsx("div",{className:" p-fluid col-11",children:o.jsx(Pa,{value:h.value,options:e==null?void 0:e.options,onChange:v=>a(v,f,g),optionLabel:"optionText.english",placeholder:"Select option"})}),o.jsx("div",{className:"col-1",children:o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>s(f,g),tooltipOptions:{position:"top"}})})]})},"inline-rules-"+g)),o.jsx(Ot,{text:!0,onClick:()=>l(f),className:"p-mt-4",icon:"pi pi-plus",label:"Add Condition",size:"small"})]})},f)),o.jsx(Ot,{text:!0,onClick:()=>c(),className:"p-mt-4",icon:"pi pi-plus",label:"Add Rule",size:"small"})]})},rse=t=>{const{fieldState:e,pageIndex:n,section:r,setFieldState:i,page:a}=t,{pageSettingUpdate:s,formBuilderFormLayout:l,sectionSettingUpdate:c}=sn();return o.jsx(o.Fragment,{children:o.jsxs("div",{className:" scroll-height-250",children:[o.jsx(nse,{fieldState:e,setFieldState:i}),o.jsx("hr",{}),o.jsx(ese,{fieldState:e,setFieldState:i,pageIndex:n,formBuilderFormLayout:l,pageSettingUpdate:s}),o.jsx("hr",{}),o.jsx(tse,{fieldState:e,setFieldState:i,section:r,formBuilderFormLayout:l,sectionSettingUpdate:c,page:a}),o.jsx("hr",{})]})})},ise=t=>{const{fieldState:e,setFieldState:n}=t,[r,i]=k.useState(""),[a,s]=k.useState([""]),[l,c]=k.useState(!1),[u,d]=k.useState(0),[f,h]=k.useState(!1),{updateGlobalToast:g}=Ht(),v=()=>{h(!0)},m=()=>{var j;const H=((j=e==null?void 0:e.reviewerChecklist)==null?void 0:j.length)>=0?[...e.reviewerChecklist]:[];H.push({uuid:nt(),checklist:r,action:a,agree:null,selectAction:[],other:{isOther:!1,description:""},reviewerComments:""});const O={...e,reviewerChecklist:H};n(U=>({...U,...O})),h(!1),i(""),s([""])},A=()=>{h(!1),i(""),s([""])},w=H=>{const O=[...e.reviewerChecklist];O.splice(H,1);const j={...e,reviewerChecklist:O};n(U=>({...U,...j}))},S=(H,O)=>{c(!0);const{checklist:j,action:U}=H;h(!0),d(O),setTimeout(()=>{i(j),s(U)},1e3)},x=(H,O)=>o.jsxs(o.Fragment,{children:[o.jsx(Ot,{text:!0,type:"button",className:"p-button-info",icon:"pi pi-pencil",onClick:()=>S(H,O==null?void 0:O.rowIndex)}),o.jsx(Ot,{text:!0,type:"button",className:"p-button-danger",icon:"pi pi-trash",onClick:()=>w(O==null?void 0:O.rowIndex)})]}),T=H=>{var O;return o.jsx(o.Fragment,{children:(O=H==null?void 0:H.action)==null?void 0:O.length})},C=H=>{const O=[...a];O.splice(H,1),s(O)},E=()=>{const H=[...e.reviewerChecklist];H[u]={checklist:r,action:a};const O={...e,reviewerChecklist:H};n(j=>({...j,...O})),h(!1),c(!1)},_=()=>o.jsx("div",{children:l?o.jsx(Ot,{text:!0,className:"mb-5 p-button-success",label:"Edit Checklist",onClick:()=>{E()}}):o.jsx(Ot,{text:!0,className:"mb-5 p-button-success",label:"Add Checklist",onClick:()=>{m()}})}),M=H=>{n(O=>({...O,reviewerChecklist:H==null?void 0:H.value}))},N=H=>{navigator.clipboard.writeText(JSON.stringify(H))};function F(H){try{JSON.parse(H)}catch{return!1}return!0}const P=async()=>{var j;const H=await navigator.clipboard.readText();let O="";if(F(H)){const U=JSON.parse(H);if((j=U[0])!=null&&j.checklist){const le={..._t.cloneDeep(e),reviewerChecklist:U};n(R=>({...R,...le}));return}else O="Empty or Invalid Schema"}else O="Invalid Schema";g({showToast:!0,toastMessage:O,toastDetail:"",toastType:"error"})};return o.jsxs("div",{children:[o.jsx(Os,{maximizable:!0,header:"Add Checklist options for admin to reveiw",visible:f,style:{width:"30vw"},onHide:()=>A(),footer:_(),children:o.jsxs("div",{className:"scroll-height-500",children:[o.jsx("h5",{children:"Checklist"}),o.jsx(so,{rows:2,cols:50,value:r,onChange:H=>{var O;i((O=H==null?void 0:H.target)==null?void 0:O.value)}}),o.jsx("h5",{children:"Actions when admin selects NO as invalid"}),a.map((H,O)=>o.jsxs("div",{children:[O+1,"."," ",o.jsx(so,{value:H,onChange:j=>{var le;const U=[...a];U[O]=(le=j==null?void 0:j.target)==null?void 0:le.value,s(U)},rows:2,cols:50})," ",o.jsx(Ot,{text:!0,type:"button",icon:"pi pi-trash",className:"p-button-danger",onClick:()=>C(O)}),o.jsx("br",{}),o.jsx("br",{})]},`actionIndex-${O}`)),o.jsx(Ot,{outlined:!0,className:" p-button-primary mr-2",onClick:()=>{s([...a,""])},children:"Add Action"})]})})," ",o.jsx("h5",{children:"Reviewer Checklist"}),o.jsx(Ot,{className:"mb-5 mr-2 p-button-success",label:"Add Review Checklist",onClick:()=>{v()}}),o.jsx(Ot,{outlined:!0,label:"Copy Schema ",onClick:()=>{N([...(e==null?void 0:e.reviewerChecklist)||[]])},className:"mb-5 mr-2"}),o.jsx(Ot,{outlined:!0,label:"Paste Checklist ",onClick:()=>{P()},className:"mb-5 p-button-info"}),o.jsx("div",{className:"card",children:o.jsxs(ro,{value:e==null?void 0:e.reviewerChecklist,reorderableRows:!0,onRowReorder:M,scrollable:!0,children:[o.jsx(Sr,{rowReorder:!0,style:{width:"3em"}}),o.jsx(Sr,{field:"checklist",header:"Checklist"}),o.jsx(Sr,{field:"actions",header:"Actions",body:H=>T(H)}),o.jsx(Sr,{header:"",body:(H,O)=>x(H,O)})]})})]})},ase=t=>{const{onHandleChangeLayoutSettings:e,fieldState:n}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{inputId:"isFieldAnFilterOption",checked:(n==null?void 0:n.isFieldAnFilterOption)||!1,onChange:r=>e("isFieldAnFilterOption",r.checked)}),o.jsx("label",{htmlFor:"isFieldAnFilterOption",children:"Is field an filter option to filter data"}),"     ",o.jsx(cn,{target:".isFieldAnFilterOption",content:"Make the field a filter for sorting data"}),o.jsx("i",{className:"isFieldAnFilterOption pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{inputId:"isSortable",checked:(n==null?void 0:n.isSortable)||!1,onChange:r=>e("isSortable",r.checked)}),o.jsx("label",{htmlFor:"isSortable",children:"Enable sortable"}),"     ",o.jsx(cn,{target:".isSortable",content:"Make the field as column sortable"}),o.jsx("i",{className:"isSortable pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{inputId:"isFilterable",checked:(n==null?void 0:n.isFilterable)||!1,onChange:r=>e("isFilterable",r.checked)}),o.jsx("label",{htmlFor:"isFilterable",children:"Enable filter"}),"     ",o.jsx(cn,{target:".isFilterable",content:"Filter the column data"}),o.jsx("i",{className:"isFilterable pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{inputId:"resizableColumns",checked:n==null?void 0:n.resizableColumns,onChange:r=>e("resizableColumns",r.checked)}),o.jsx("label",{htmlFor:"resizableColumns",children:"Enable resizable columns"}),"     ",o.jsx(cn,{target:".resizableColumns",content:"Column width can be increase or decreased by dragging"}),o.jsx("i",{className:"resizableColumns pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{inputId:"reorderableColumns",checked:n==null?void 0:n.reorderableColumns,onChange:r=>e("reorderableColumns",r.checked)}),o.jsx("label",{htmlFor:"reorderableColumns",children:"Enable reorderable columns"}),"     ",o.jsx(cn,{target:".reorderableColumns",content:"Column can ordered to show as first or last"}),o.jsx("i",{className:"reorderableColumns pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{inputId:"colToggle",checked:(n==null?void 0:n.colToggle)||!1,onChange:r=>e("colToggle",r.checked)}),o.jsx("label",{htmlFor:"colToggle",children:"Enable column toggle"}),"     ",o.jsx(cn,{target:".colToggle",content:"Column can be shown and hide by settings by user"}),o.jsx("i",{className:"colToggle pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{inputId:"freezeColumn",checked:(n==null?void 0:n.freezeColumn)||!1,onChange:r=>e("freezeColumn",r.checked)}),o.jsx("label",{htmlFor:"freezeColumn",children:"Enable freeze columns"}),"     ",o.jsx(cn,{target:".freezeColumn",content:"Column can sticky so the important can be in view all the time"}),o.jsx("i",{className:"freezeColumn pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]})]})},sse=t=>{var c,u,d;const{fieldState:e,setFieldState:n}=t,{formBuilderSchemaLanguages:r}=sn(),i=()=>{n(f=>Object.assign({},f,{options:[...f.options,{uuid:nt(),optionText:{english:""},value:"",score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]}))},a=f=>{n(h=>({...h,fieldType:{...h==null?void 0:h.fieldType,type:f}}))},s=(f,h)=>{n(g=>({...g,[f]:h}))},l=[{label:"Employee",api:"/employees/list",availableId:["user_id","employee_id"],optionValue:"employee_id",optionLabel:"first_name"},{label:"Departments",api:"/department/",availableId:["department_id"],optionValue:"department_id",optionLabel:"department_name"}];return o.jsxs("div",{className:"p-fluid",children:[o.jsx("h4",{children:"Render Type"}),o.jsxs("div",{className:"flex flex-wrap gap-3 my-2",children:[o.jsxs("div",{className:"flex align-items-center",children:[o.jsx(ia,{inputId:"renderType1",name:"renderType",value:"radio",onChange:f=>{a(f==null?void 0:f.value)},checked:((c=e==null?void 0:e.fieldType)==null?void 0:c.type)==="radio"}),o.jsx("label",{htmlFor:"ingredient1",className:"ml-2",children:"Radio"})]}),o.jsxs("div",{className:"flex align-items-center",children:[o.jsx(ia,{inputId:"renderType2",name:"renderType",value:"dropdown",onChange:f=>{a(f==null?void 0:f.value)},checked:((u=e==null?void 0:e.fieldType)==null?void 0:u.type)==="dropdown"}),o.jsx("label",{htmlFor:"ingredient2",className:"ml-2",children:"Dropdown"})]})]}),o.jsx("label",{htmlFor:"",className:"pb-2",children:"Data Source"}),o.jsxs("div",{className:"flex flex-wrap gap-3 mt-2",children:[o.jsxs("div",{className:"flex align-items-center",children:[o.jsx(ia,{inputId:"dataSourceType1",name:"dataSourceType",value:"custom",onChange:f=>{s("dataSourceType",f==null?void 0:f.value)},checked:(e==null?void 0:e.dataSourceType)==="custom"}),o.jsx("label",{htmlFor:"ingredient1",className:"ml-2",children:"Custom"})]}),o.jsxs("div",{className:"flex align-items-center",children:[o.jsx(ia,{inputId:"dataSourceType2",name:"dataSourceType",value:"database",onChange:f=>{s("dataSourceType",f==null?void 0:f.value)},checked:(e==null?void 0:e.dataSourceType)==="database"}),o.jsx("label",{htmlFor:"ingredient2",className:"ml-2",children:"Database"})]})]}),(e==null?void 0:e.dataSourceType)==="database"&&o.jsxs(o.Fragment,{children:[o.jsx("h4",{children:"Select Data Source"}),o.jsx("div",{children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-6",children:[o.jsx("div",{className:"py-2",children:o.jsx("label",{children:"Datasources"})}),o.jsx(Pa,{value:e==null?void 0:e.dataSource,onChange:f=>{var h;s("optionLabel",(h=f.value)==null?void 0:h.optionLabel),s("dataSource",f.value)},options:l,placeholder:"Select a Data Source",className:"w-full "})]}),o.jsxs("div",{className:"col-6",children:[o.jsx("div",{className:"py-2",children:o.jsx("label",{htmlFor:"",className:"py-2",children:"Select Datasource Id"})}),o.jsx(Pa,{value:e==null?void 0:e.optionValue,onChange:f=>s("optionValue",f.value),options:(d=e==null?void 0:e.dataSource)==null?void 0:d.availableId,placeholder:"Source Id",className:"w-full "})]})]})})]}),(e==null?void 0:e.dataSourceType)==="custom"&&o.jsx(o.Fragment,{children:(e==null?void 0:e.options)!==void 0&&e.componentType!=="grid-component"&&e.componentType!=="matrix-dropdown"&&e.componentType!=="table"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"scroll-height-300 pt-5",children:o.jsx(ao,{activeIndex:0,children:r!=null&&r.length?r.map((f,h)=>o.jsx(io,{tabIndex:h,header:f==null?void 0:f.language,children:o.jsx(fN,{enableCopyPaste:!0,isCustomValue:!0,fieldState:e,setFieldState:n,language:f})},h)):""})}),o.jsx(Ot,{text:!0,className:"mr-3",label:"Add",icon:"pi pi-plus",onClick:()=>i(),"aria-label":"Add"})]})})]})},ose=t=>{var u,d;const{option:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a}=t,{userSelectedLanguage:s}=sn(),l=[{type:"radio",label:"Radio"},{type:"text",label:"Input Text"},{type:"text-area",label:"Text Area"},{type:"date",label:"Date Field"}],c=(f,h)=>{var g;return o.jsxs("div",{onClick:f.onClick,className:f.className,children:[o.jsx("span",{children:f.titleElement}),e.children&&((g=e.children)==null?void 0:g.length)>1&&o.jsx(Ot,{text:!0,icon:"pi pi-trash",size:"small",onClick:()=>{console.log("field",h==null?void 0:h.uuid),a(h==null?void 0:h.uuid)},"aria-label":"Filter"})]})};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"field-checkbox mt-3",children:[o.jsx(Yr,{inputId:"showConditionalFields",onChange:f=>{n(e==null?void 0:e.uuid,f.checked,{enableConditionalField:f.checked})},checked:e==null?void 0:e.enableConditionalField}),o.jsx("label",{htmlFor:"showConditionalFields",children:"Enable Conditional Field"})]}),(e==null?void 0:e.enableConditionalField)===!0&&o.jsxs(o.Fragment,{children:[o.jsx(Ot,{text:!0,label:"Add Field",onClick:()=>{i(e==null?void 0:e.uuid)}}),o.jsx(ss,{children:((u=e.children)==null?void 0:u.length)&&((d=e.children)==null?void 0:d.map((f,h)=>{var g,v;return o.jsx(Cr,{header:(g=f.label)==null?void 0:g[s==null?void 0:s.type],headerTemplate:m=>c(m,f),children:o.jsxs("div",{className:"card",children:[o.jsx("p",{children:"Choose Field Type"}),o.jsx("div",{className:"flex mb-3",children:(l==null?void 0:l.length)&&(l==null?void 0:l.map(m=>o.jsxs("div",{className:"mr-3",children:[o.jsx(ia,{inputId:"ingredient1",name:"fieldType",value:m==null?void 0:m.type,onChange:()=>r(f==null?void 0:f.uuid,{type:m==null?void 0:m.type}),checked:(f==null?void 0:f.type)===(m==null?void 0:m.type)}),o.jsx("label",{htmlFor:"ingredient1",className:"ml-2",children:m==null?void 0:m.label})]},`field_type_${f==null?void 0:f.uuid}`)))}),o.jsxs("div",{className:"field-checkbox mt-3",children:[o.jsx(Yr,{inputId:"isRequired",onChange:m=>{r(f==null?void 0:f.uuid,{attributes:{required:m.checked}})},checked:(v=f==null?void 0:f.attributes)==null?void 0:v.required}),o.jsxs("label",{htmlFor:"showConditionalFields",children:["Is Required"," "]})]}),o.jsxs(ss,{children:[o.jsx(Cr,{header:"Text",children:o.jsx(ii,{header:"Text Settings",toggleable:!0,collapsed:!0,children:o.jsx("div",{className:"",children:o.jsx(nD,{language:s,fieldState:f,onHandleChange:(m,A,w)=>{r(f==null?void 0:f.uuid,{[m]:{[A==null?void 0:A.type]:w}})}})})})}),(f==null?void 0:f.type)==="radio"&&o.jsx(Cr,{header:"Radio",children:o.jsx("div",{style:{width:"100%"},children:o.jsx(b7,{option:e,fieldState:f,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a})})})]})]})},`field-tab-${h}-${f==null?void 0:f.uuid}-${e==null?void 0:e.uuid}`)}))})]})]})},b7=t=>{var s,l;const{fieldState:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a}=t;return o.jsx(o.Fragment,{children:o.jsx(ss,{children:((s=e==null?void 0:e.options)==null?void 0:s.length)&&((l=e==null?void 0:e.options)==null?void 0:l.map((c,u)=>o.jsx(Cr,{header:`Option - ${c==null?void 0:c.label}`,children:o.jsx(ose,{option:c,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a})},`hirarchey-option-${u}`)))})})};var gN={},lse=Fi&&Fi.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),D3=Fi&&Fi.__assign||function(){return D3=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},D3.apply(this,arguments)},cse=Fi&&Fi.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),use=Fi&&Fi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),mN=Fi&&Fi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&cse(e,t,n);return use(e,t),e},dse=Fi&&Fi.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},fse=Fi&&Fi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gN,"__esModule",{value:!0});var y7=mN(k),hse=fse(GI),Zu=mN(la);function vN(t){return t&&t.replace(/&nbsp;|\u202F|\u00A0/g," ").replace(/<br \/>/g,"<br>")}function pse(t){var e=document.createTextNode("");t.appendChild(e);var n=document.activeElement===t;if(e!==null&&e.nodeValue!==null&&n){var r=window.getSelection();if(r!==null){var i=document.createRange();i.setStart(e,e.nodeValue.length),i.collapse(!0),r.removeAllRanges(),r.addRange(i)}t instanceof HTMLElement&&t.focus()}}var gse=function(t){lse(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.lastHtml=n.props.html,n.el=typeof n.props.innerRef=="function"?{current:null}:y7.createRef(),n.getEl=function(){return(n.props.innerRef&&typeof n.props.innerRef!="function"?n.props.innerRef:n.el).current},n.emitChange=function(r){var i=n.getEl();if(i){var a=i.innerHTML;if(n.props.onChange&&a!==n.lastHtml){var s=Object.assign({},r,{target:{value:a}});n.props.onChange(s)}n.lastHtml=a}},n}return e.prototype.render=function(){var n=this,r=this.props,i=r.tagName,a=r.html,s=r.innerRef,l=dse(r,["tagName","html","innerRef"]);return y7.createElement(i||"div",D3(D3({},l),{ref:typeof s=="function"?function(c){s(c),n.el.current=c}:s||this.el,onInput:this.emitChange,onBlur:this.props.onBlur||this.emitChange,onKeyUp:this.props.onKeyUp||this.emitChange,onKeyDown:this.props.onKeyDown||this.emitChange,contentEditable:!this.props.disabled,dangerouslySetInnerHTML:{__html:a}}),this.props.children)},e.prototype.shouldComponentUpdate=function(n){var r=this.props,i=this.getEl();return!i||vN(n.html)!==vN(i.innerHTML)?!0:r.disabled!==n.disabled||r.tagName!==n.tagName||r.className!==n.className||r.innerRef!==n.innerRef||r.placeholder!==n.placeholder||!(0,hse.default)(r.style,n.style)},e.prototype.componentDidUpdate=function(){var n=this.getEl();n&&(this.props.html!==n.innerHTML&&(n.innerHTML=this.props.html),this.lastHtml=this.props.html,pse(n))},e.propTypes={html:Zu.string.isRequired,onChange:Zu.func,disabled:Zu.bool,tagName:Zu.string,className:Zu.string,style:Zu.object,innerRef:Zu.oneOfType([Zu.object,Zu.func])},e}(y7.Component),N3=gN.default=gse;const mse=t=>{var w;const e=k.useRef(null),{field:n,fieldIndex:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,path:c}=t,[u,d]=k.useState(n),{userSelectedLanguage:f,fieldSettingUpdate:h,fieldSettingUpdateInlineConditional:g,gridComponentFieldSettingUpdate:v}=sn(),m=(S,x,T)=>{d(C=>({...C,[S]:{...C[S],[x==null?void 0:x.type]:T}}))};k.useEffect(()=>(A(),()=>{}),[u]);const A=()=>{const S=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?g(S[fa],S[ha],S[Ca],S[xa],S[Ta],S[Fa],S[Xo],S[wo],u):(S==null?void 0:S.length)>Fa&&(S==null?void 0:S.length)===Bl+1&&(n!=null&&n.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?v(S[fa],S[ha],S[Ca],S[xa],S[Ta],S[5],S[6],S[7],u):h(i,a,s,l,r,{...n,label:u==null?void 0:u.label})};return o.jsx(o.Fragment,{children:o.jsx(N3,{style:{display:"inline-block"},className:"builder-input-label-edit",innerRef:e,html:(w=n==null?void 0:n.label)==null?void 0:w[f==null?void 0:f.type],disabled:!1,onChange:S=>{var x;m("label",f,(x=S==null?void 0:S.target)==null?void 0:x.value)},tagName:"article"})})},ca=t=>{const{sectionIndex:e,fieldIndex:n}=t,{formBuilderFormSchema:r}=sn();return(r==null?void 0:r.enableFieldEnumeration)===!0?o.jsx("span",{className:"mr-2",children:o.jsx(F8,{classes:"font-medium p-1 bg-primary",level:"purple",value:`${e+1}.${n+1}`})}):o.jsx(o.Fragment,{})},A7=t=>{var f,h,g,v,m,A,w,S,x,T,C,E,_,M;const{field:e,update:n,value:r,isFirst:i,isDisabled:a}=t,{isBuilderMode:s,isAdmin:l}=Ht(),{selectedLanguage:c}=sn(),[u,d]=k.useState(0);return k.useEffect(()=>{const N=Gt.addListener("onSubmitUserForm",()=>{var P;(P=e==null?void 0:e.attributes)!=null&&P.required?r!=null&&r[e.uuid]?e.isValid=t3:e.isValid=D8:e.isValid=1}),F=Gt.addListener("OnInvalidFieldCatch",P=>{(e==null?void 0:e.uuid)===(P==null?void 0:P.fieldId)?d(N8):d(O8)});return()=>{N.remove(),F.remove()}}),o.jsxs("div",{className:"",children:[(e==null?void 0:e.type)===yZ&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex align-items-center mb-3",children:[" ",i===!0&&o.jsx(ca,{...t}),((f=e==null?void 0:e.attributes)==null?void 0:f.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",s?o.jsx(mse,{...t}):o.jsx("div",{className:"text-gray-900 font-bold text-xl",children:(h=e==null?void 0:e.label)==null?void 0:h[c]})]}),((g=e==null?void 0:e.options)==null?void 0:g.length)&&((v=e==null?void 0:e.options)==null?void 0:v.map(N=>{var F,P;return o.jsxs("div",{children:[o.jsxs("div",{className:"flex align-items-center mb-2",children:[o.jsx(ia,{inputId:N.uuid,name:e==null?void 0:e.uuid,value:N.uuid,onChange:H=>{(!l||!a)&&n(e==null?void 0:e.uuid,H==null?void 0:H.value)},checked:(r==null?void 0:r[e.uuid])===N.uuid,disabled:l||a}),o.jsx("label",{htmlFor:N.uuid,className:"ml-2",children:N.label})]}),(N==null?void 0:N.enableConditionalField)===!0&&(r==null?void 0:r[e==null?void 0:e.uuid])===(N==null?void 0:N.uuid)&&(N==null?void 0:N.children)&&((F=N==null?void 0:N.children)==null?void 0:F.length)>0&&((P=N==null?void 0:N.children)==null?void 0:P.map(()=>o.jsx(A7,{...t},`radio_child_${r==null?void 0:r[e==null?void 0:e.uuid]}`)))]},`${N.uuid}-radio-wrapper-${e==null?void 0:e.uuid}`)}))]}),(e==null?void 0:e.type)===AZ&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((m=e==null?void 0:e.attributes)==null?void 0:m.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[c]]}),o.jsx(wn,{className:"mt-2",onChange:N=>{var F;return n(e==null?void 0:e.uuid,(F=N==null?void 0:N.target)==null?void 0:F.value)},value:r==null?void 0:r.uuid,placeholder:(A=e==null?void 0:e.placeholder)==null?void 0:A[c],disabled:l||a})]})}),(e==null?void 0:e.type)===wZ&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((w=e==null?void 0:e.attributes)==null?void 0:w.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[c]]}),o.jsx(ef,{className:"mt-2",onChange:N=>{var F;return n(e==null?void 0:e.uuid,(F=N==null?void 0:N.target)==null?void 0:F.value)},value:r==null?void 0:r.uuid,placeholder:(S=e==null?void 0:e.placeholder)==null?void 0:S[c],disabled:l||a})]})}),(e==null?void 0:e.type)===SZ&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((x=e==null?void 0:e.attributes)==null?void 0:x.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[c]]}),o.jsx(so,{className:"mt-2",onChange:N=>{var F;return n(e==null?void 0:e.uuid,(F=N==null?void 0:N.target)==null?void 0:F.value)},value:r==null?void 0:r.uuid,placeholder:(T=e==null?void 0:e.placeholder)==null?void 0:T[c],disabled:l||a})]})}),o.jsx("div",{children:((C=e==null?void 0:e.helperText)==null?void 0:C[c])!==""&&o.jsx("small",{children:(E=e==null?void 0:e.helperText)==null?void 0:E[c]})}),o.jsx("div",{children:((_=e==null?void 0:e.attributes)==null?void 0:_.required)&&o.jsx("small",{className:"error",children:u===1&&!(r!=null&&r[e.uuid])?(M=e==null?void 0:e.validationMesssage)==null?void 0:M.language:""})})]},`${e==null?void 0:e.uuid}-radio`)},vse=t=>{const{hirarechicalRadioSchemaState:e}=t,[n,r]=k.useState({});return o.jsx("div",{children:o.jsx(A7,{schema:e,field:e,update:(i,a)=>{const s={...n};s[i]=a,r(s)},value:n,sectionIndex:0,fieldIndex:0,pageIndex:0,rowIndex:0,columnIndex:0,path:""})})},w7={showHeaderText:!1,showHelperText:!1,showToolTip:!1,showLabel:!0,label:{english:"Field label"},abbreviationLabel:{english:""},helperText:{english:"Helper Text"},guidelines:{english:""},headerText:{english:"Header text"},textTable:{english:""},toolTip:{english:""},validationMesssage:{english:"This field is required"},placeholder:{english:""},enableConditionalField:!0},bse={uuid:nt(),...w7,type:"radio",value:null,options:[{uuid:nt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:nt(),label:"No",value:null,enableConditionalField:!0,children:[]}]};({uuid:nt(),...w7,options:(nt(),{uuid:nt(),...w7,options:(nt(),nt())},nt())});const yse=t=>{const{fieldState:e,setFieldState:n}=t,r=(f,h,g)=>g==null?void 0:g.map(v=>{var m;return v.uuid===f?{...v,...h}:{...v,children:v!=null&&v.children&&((m=v==null?void 0:v.children)==null?void 0:m.length)>0?[...v.children.map(A=>A.type==="radio"?{...A,options:r(f,h,(A==null?void 0:A.options)||[])}:{...A})]:[]}}),i=(f,h,g)=>{const v=r(f,g,e.options);n(m=>({...m,options:v}))},a=(f,h,g)=>g==null?void 0:g.map(v=>{var m;return{...v,children:v!=null&&v.children&&((m=v==null?void 0:v.children)==null?void 0:m.length)>0?[...v.children.map(A=>A.uuid===f?{...A,...h}:{...A,options:a(f,h,A==null?void 0:A.options)})]:[]}}),s=(f,h)=>{const g=a(f,h,e.options);n(v=>({...v,options:g}))},l=(f,h)=>h==null?void 0:h.map(g=>{var v;return{...g,children:g!=null&&g.children&&((v=g==null?void 0:g.children)==null?void 0:v.length)>0?[...g.children.filter(m=>{if(m.uuid!==f)return{...m,options:l(f,m==null?void 0:m.options)}})]:[]}}),c=(f,h,g)=>g==null?void 0:g.map(v=>{var m;return v.children&&v.uuid===f?{...v,children:[...v.children,h]}:{...v,children:v!=null&&v.children&&((m=v==null?void 0:v.children)==null?void 0:m.length)>0?[...v.children.map(A=>({...A,options:c(f,h,A==null?void 0:A.options)}))]:[]}}),u=f=>{const h=c(f,{...bse,isValid:0,uuid:nt(),options:[{uuid:nt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:nt(),label:"No",value:null,enableConditionalField:!0,children:[]}],isPostField:!1,showAlphabetList:!1,showButtonLayout:!1,answerOptions:[],isExternalSource:!1,underLined:!1,noOfMultpleAnswer:void 0,isAllowMultipleAnswer:!1,isIcon:!1,isTodayBtn:!1,resizableColumns:!1,isFilterable:!1,freezeColumn:!1,colToggle:!1,isFieldAnFilterOption:!1,isSortable:!1,reorderableColumns:!1,timeLimit:0,score:0,subject_id:0,course_category_id:0,TextEditorProps:!1,fieldData:void 0},e.options);n(g=>({...g,options:h}))},d=f=>{const h=l(f,e.options);n(g=>({...g,options:h}))};return o.jsx("div",{children:o.jsx("div",{className:" px-4",children:o.jsxs("div",{className:"grid",children:[o.jsx("div",{className:"col-6 scroll-height-200",children:(e==null?void 0:e.isHierarchalCondionalTabEnabled)===!0&&o.jsx(b7,{fieldState:e,updateCondtionOption:i,updateChildrenField:s,addChildrenField:u,removeChildrenField:d})}),o.jsxs("div",{className:"col-6 p-3 scroll-height-200",children:[o.jsx("h4",{className:"flex justify-content-center align-items-center",children:"Preview"}),o.jsx(vse,{hirarechicalRadioSchemaState:e})]})]})})})},Qi=t=>{var Z;const{formBuilderFormSchema:e,fieldSettingUpdate:n,fieldSettingUpdateInlineConditional:r,formBuilderSchemaLanguages:i,pageSettingUpdate:a,formBuilderFormLayout:s,formBuilderPublishedStatus:l,gridComponentFieldSettingUpdate:c}=sn(),{renderType:u}=Ht(),{visibilty:d,field:f,closeSettingFieldSidebar:h,pageIndex:g,sectionIndex:v,rowIndex:m,columnIndex:A,fieldIndex:w,path:S,row:x,typeName:T}=t,{updateGlobalToast:C}=Ht(),[E,_]=k.useState(f),M=S.split("-"),N=()=>{const K=S.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?r(K[fa],K[ha],K[Ca],K[xa],K[Ta],K[Fa],K[Xo],K[wo],E):(K==null?void 0:K.length)>Fa&&(K==null?void 0:K.length)===Bl+1&&(E!=null&&E.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?c(K[fa],K[ha],K[Ca],K[xa],K[Ta],K[5],K[6],K[7],E):(n(g,v,m,A,w,{...E}),setTimeout(()=>{Gt.emit("OnSignatureSettingChange",{})},1e3),setTimeout(()=>{Gt.emit("onUpdateField",{})},1e3)),C({showToast:!0,toastMessage:"Updated",toastDetail:`${T} updated`,toastType:"success"})},F=(K,W,ge)=>{_(ve=>({...ve,[K]:{...ve[K],[W==null?void 0:W.type]:ge}}))},P=(K,W)=>{_(ge=>({...ge,attributes:{...ge.attributes,[K]:W}}))},H=(K,W)=>{_(ge=>({...ge,[K]:W}))},O=(K,W)=>{_(ge=>({...ge,inlineConditional:{...ge.inlineConditional,[K]:W}}))},j=()=>{},U=()=>{_(K=>({...K,data:[...K.data,{uuid:nt(),dataKey:"",value:""}]}))},le=()=>{_(K=>Object.assign({},K,{options:[...K.options,{uuid:nt(),optionText:{english:""},value:"",score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]}))},R=()=>{},X=()=>{},ce=()=>{},Y=()=>{},ae=K=>{var Ie;const W=[...(E==null?void 0:E.conditionalTabRules.rules)||[]],ge=W.filter((be,de)=>K!==de);_(be=>({...be,conditionalTabRules:{...be.conditionalTabRules,rules:ge}}));const ve=W[K];(Ie=ve==null?void 0:ve.conditions)==null||Ie.map(be=>{const de=_t.findIndex(s,q=>{var ee;return(q==null?void 0:q.uuid)===((ee=be==null?void 0:be.tab)==null?void 0:ee.uuid)}),ne=s[de];ne&&(ne.isHidden=!1,a(de,ne))})},re=(K,W)=>{const ge=[...(E==null?void 0:E.conditionalTabRules.rules)||[]];ge[K].conditions=ge[K].conditions.filter((ve,Ie)=>W!==Ie),_(ve=>({...ve,conditionalTabRules:{...ve.conditionalTabRules,rules:ge}}))};return o.jsx(o.Fragment,{children:o.jsxs(To,{style:{width:"80vw",zIndex:7e3},visible:d,position:"left",className:"p-sidebar-lg",onHide:()=>h(),header:()=>{var K;return o.jsx("div",{className:"flex align-items-center gap-2 justify-content-between",children:o.jsxs("div",{className:"text-gray-900 font-bold text-2xl",children:[(K=f==null?void 0:f.label)==null?void 0:K.english," "]})})},"aria-label":"Field Setting Sidebar",children:[o.jsx("div",{className:"",children:o.jsxs(ss,{children:[o.jsx(Cr,{header:"Text",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(ao,{activeIndex:0,children:i!=null&&i.length?i.map((K,W)=>o.jsx(io,{tabIndex:W,header:K==null?void 0:K.language,children:o.jsx(nD,{language:K,fieldState:E,onHandleChange:F,...t})},W)):""})})}),(E==null?void 0:E.isValidationTabEnabled)===!0&&o.jsx(Cr,{header:"Validation",children:o.jsx(xte,{fieldState:E,onHandleChangeLayoutSettings:H,onHandleChangeAttributesSetttings:P,...t})}),o.jsx(Cr,{header:"Attributes",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(Tte,{fieldState:E,onHandleChangeLayoutSettings:H,onHandleChangeAttributesSetttings:P})})}),(E==null?void 0:E.isLayoutTabEnabled)===!0&&o.jsx(Cr,{header:"Layout",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(Bte,{fieldState:E,onHandleChangeLayoutSettings:H})})}),(E==null?void 0:E.isDynamicListingTabEnabled)===!0&&o.jsx(Cr,{header:"Dynamic Options",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(sse,{fieldState:E,setFieldState:_})})}),(E==null?void 0:E.options)!==void 0&&(E==null?void 0:E.data)&&o.jsx(Cr,{header:"Data",children:o.jsxs("div",{className:"scroll-height-200",children:[o.jsx(Vte,{onHandleChangeLayoutSettings:H,fieldState:E,setFieldState:_}),o.jsx(Ot,{className:"mr-3",label:"Data Option",icon:"pi pi-plus",onClick:()=>U(),"aria-label":"Add"})]})}),o.jsx(Cr,{header:"Table view options",children:o.jsx(ase,{fieldState:E,onHandleChangeLayoutSettings:H})}),(E==null?void 0:E.componentType)!=="radio-hierarchal"&&(E==null?void 0:E.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsxs(Cr,{header:"Options",children:[(E==null?void 0:E.componentType)!=="radio-hierarchal"&&o.jsx("div",{className:"flex justify-content-end",children:o.jsx(Ot,{className:"mr-3 mb-2",label:"Option",icon:"pi pi-plus",onClick:()=>le(),"aria-label":"Option"})}),o.jsxs("div",{className:"scroll-height-200 px-4",children:[o.jsx(ao,{activeIndex:0,children:i!=null&&i.length?i.map((K,W)=>o.jsx(io,{tabIndex:W,header:K==null?void 0:K.language,children:o.jsx(fN,{enableAbbreviationColumn:(E==null?void 0:E.componentType)!=="radio-hierarchal",enableHyperTextColumn:(E==null?void 0:E.componentType)!=="radio-hierarchal",enableAddNewColumn:(E==null?void 0:E.componentType)!=="radio-hierarchal",enableCopyPaste:(E==null?void 0:E.componentType)!=="radio-hierarchal",isCustomValue:!1,fieldState:E,setFieldState:_,language:K})},W)):""}),(E==null?void 0:E.isHierarchalCondionalTabEnabled)===!0&&o.jsx(b7,{fieldState:E,onHandleChangeLayoutSettings:H,removeChildrenField:Y,addChildrenField:ce,updateChildrenField:X,updateCondtionOption:R})]})]}),(E==null?void 0:E.componentType)==="radio-hierarchal"&&(E==null?void 0:E.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsx(Cr,{header:"Hierarchal Options",children:o.jsx(yse,{fieldState:E,setFieldState:_})}),u===e3&&(E==null?void 0:E.inlineConditionalRules)!==void 0&&!(x!=null&&x.rowIsRepeatable)&&(M==null?void 0:M.length)<wo+1&&o.jsx(Cr,{header:"Conditional",children:o.jsx(rse,{handleRemoveConditionalTabRule:ae,handleRemoveConditionalTabRuleCondition:re,onHandleSelectInlineConditionalOption:j,onHandleChangeLayoutSettings:H,onHandleChangeInlineConditionaltSetttings:O,fieldState:E,setFieldState:_,pageIndex:g,sectionIndex:v,...t})}),!((Z=t==null?void 0:t.row)!=null&&Z.rowIsRepeatable)&&(e==null?void 0:e.enableReviewTask)===!0&&o.jsx(Cr,{header:"Admin reviewer checklist",children:o.jsx(ise,{fieldState:E,setFieldState:_})})]})}),o.jsx("div",{className:"w-full px-4 py-3 surface-100 sidebar-footer",children:o.jsxs("div",{className:"flex flex-row gap-2 align-items-center justify-content-end",children:[o.jsx(Ot,{text:!0,label:"Close",type:"button",icon:"pi pi-times",onClick:()=>h(),"aria-label":"Close",size:"small",className:"p-button-danger"}),!l&&o.jsx(Ot,{size:"small",label:"Update",type:"button",outlined:!0,onClick:()=>N(),"aria-label":"Update"})]})})]})})},ki=t=>{const[e,n]=k.useState(null),{field:r}=t,{userTaskSubmitFormData:i,updateUserFormDataSubmit:a,updateTaskFormData:s}=Ar();console.log("userTaskSubmitFormData",i),k.useEffect(()=>{var g,v;if(i!==null&&e===null){let m=0;r!=null&&r.rowIsRepeatable?m=i.findIndex(A=>(A==null?void 0:A.rowId)===(r==null?void 0:r.uuid)):m=i.findIndex(A=>(A==null?void 0:A.fieldId)===(r==null?void 0:r.uuid)),n((g=i[m])!=null&&g.reviewerChecklist?(v=i[m])==null?void 0:v.reviewerChecklist:[])}return()=>{}},[r==null?void 0:r.rowIsRepeatable,r==null?void 0:r.uuid,e,i]);const l=g=>{const v=i.findIndex(A=>(A==null?void 0:A.fieldId)===(r==null?void 0:r.uuid)),m=[...i];m[v]={...m[v],reviewerChecklist:g},a(m),s(m,params==null?void 0:params.taskId,"/survey/update/formdata/")},c=(g,v)=>{const m=e;m[v]={...m[v],agree:g==null?void 0:g.value},n([...m]),l(m)},u=(g,v)=>{const m=e;if(v!=null&&v.checked)m[g].selectAction.push(v==null?void 0:v.value);else{const A=m[g].selectAction.findIndex(w=>w===(v==null?void 0:v.value));m[g].selectAction.splice(A,1)}n([...m]),l(m)},d=(g,v)=>{const m=e;g!=null&&g.checked?m[v]={...m[v],other:{...m[v].other,isOther:!0}}:m[v]={...m[v],other:{...m[v].other,isOther:!1}},n([...m]),l(m)},f=(g,v)=>{var A;const m=e;m[v]={...m[v],other:{...m[v].other,description:(A=g==null?void 0:g.target)==null?void 0:A.value}},n([...m]),l(m)},h=(g,v,m)=>{var w;const A=e;A[m]={...A[m],[v]:(w=g==null?void 0:g.target)==null?void 0:w.value},n([...A]),l(A)};return o.jsx(o.Fragment,{children:e!==null&&(e==null?void 0:e.length)>0?o.jsx(o.Fragment,{children:o.jsx(ii,{header:"Reviewer Checklist",toggleable:!0,collapsed:!0,children:o.jsx("div",{className:"flex flex-row flex-wrap gap-2",children:e==null?void 0:e.map((g,v)=>{var m,A,w,S,x;return o.jsxs("div",{className:"card p-fluid",style:{width:250},children:[o.jsx("h6",{className:"mb-2",children:g==null?void 0:g.checklist}),o.jsx("br",{}),o.jsxs("div",{className:"flex flex-row gap-3 mb-2",children:[o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(ia,{inputId:`yes-${v}`,name:"action",value:!0,onChange:T=>{c(T,v)},checked:(g==null?void 0:g.agree)===!0}),o.jsx("label",{htmlFor:`yes-${v}`,children:"Yes"})]}),o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(ia,{inputId:`no-${v}`,name:"action",value:!1,onChange:T=>{c(T,v)},checked:(g==null?void 0:g.agree)===!1}),o.jsx("label",{htmlFor:`no-${v}`,children:"No"})]})]}),(g==null?void 0:g.agree)===!1&&o.jsxs("div",{className:"px-5 mb-3",children:[(g==null?void 0:g.action)&&Array.isArray(g.action)&&((m=g==null?void 0:g.action)==null?void 0:m.length)>0&&((A=g==null?void 0:g.action)==null?void 0:A.map((T,C)=>{var E;return o.jsxs("div",{children:[o.jsx(Yr,{value:T,checked:((E=g==null?void 0:g.selectAction)==null?void 0:E.length)>0?g==null?void 0:g.selectAction.some(_=>_===T):!1,onChange:_=>{u(v,_)}})," ",T," ",o.jsx("br",{}),o.jsx("br",{})]},`action-${v}-${C}`)})),o.jsx(Yr,{checked:(w=g==null?void 0:g.other)==null?void 0:w.isOther,onChange:T=>{d(T,v)}})," Other ",o.jsx("br",{}),o.jsx("br",{}),((S=g==null?void 0:g.other)==null?void 0:S.isOther)===!0&&o.jsxs("div",{className:"",children:[o.jsx("label",{children:"If other please specify the action point"}),o.jsx("br",{}),o.jsx(so,{className:"mt-3",value:(x=g==null?void 0:g.other)==null?void 0:x.description,onChange:T=>f(T,v)})]})]}),(g==null?void 0:g.agree)===!1&&o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Feedback "}),o.jsx("br",{}),o.jsx(so,{className:"mt-3",value:g==null?void 0:g.reviewerFeedback,onChange:T=>h(T,"reviewerFeedback",v)})]}),o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Comments / Notes (internal use only)"}),o.jsx("br",{}),o.jsx(so,{className:"mt-3",value:g==null?void 0:g.reviewerComments,onChange:T=>h(T,"reviewerComments",v)})]})]},`checklistIndex-${v}`)})})})}):o.jsx(o.Fragment,{children:o.jsx("div",{className:"text-gray-900 flex justify-content-center align-items-center",children:"No admin review is required"})})})},xi=t=>{const{isPreview:e,field:n,isAdmin:r,fieldWrap:i}=t,{userSelectedLanguage:a}=sn(),{globalAlignment:s}=Ht(),l=g=>{const v=g.collapsed?"pi pi-chevron-down":"pi pi-chevron-up",m=`${g.className} justify-content-start`,A=`${g.titleClassName} pl-1`;return o.jsxs("div",{className:m,children:[o.jsxs("button",{className:g.togglerClassName,onClick:g.onTogglerClick,children:[o.jsx("span",{className:v}),o.jsx(Qt,{})]}),o.jsx("span",{className:A,children:d})]})},{TASK_PUBLISHED:c,task_status:u}=Ar(),[d,f]=k.useState("");k.useEffect(()=>{var g;f((g=n==null?void 0:n.label)==null?void 0:g[a==null?void 0:a.type])},[n,a==null?void 0:a.type]);const h=()=>{let g="";return e||(g=g+" field-form-builder"),u===c&&r===!0&&(g=g+" card"),g};return o.jsx(o.Fragment,{children:o.jsx("div",{dir:s,className:h(),children:u===c&&r===!0?o.jsx(ii,{headerTemplate:l,toggleable:!0,children:i}):i})})};/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */const{entries:bN,setPrototypeOf:yN,isFrozen:Ase,getPrototypeOf:wse,getOwnPropertyDescriptor:Sse}=Object;let{freeze:Eo,seal:jl,create:AN}=Object,{apply:S7,construct:C7}=typeof Reflect<"u"&&Reflect;Eo||(Eo=function(e){return e}),jl||(jl=function(e){return e}),S7||(S7=function(e,n,r){return e.apply(n,r)}),C7||(C7=function(e,n){return new e(...n)});const O3=ml(Array.prototype.forEach),wN=ml(Array.prototype.pop),Jp=ml(Array.prototype.push),F3=ml(String.prototype.toLowerCase),x7=ml(String.prototype.toString),SN=ml(String.prototype.match),Zp=ml(String.prototype.replace),Cse=ml(String.prototype.indexOf),xse=ml(String.prototype.trim),xc=ml(Object.prototype.hasOwnProperty),Io=ml(RegExp.prototype.test),e2=Tse(TypeError);function ml(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return S7(t,e,r)}}function Tse(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return C7(t,n)}}function hi(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:F3;yN&&yN(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const a=n(i);a!==i&&(Ase(e)||(e[r]=a),i=a)}t[i]=!0}return t}function Ese(t){for(let e=0;e<t.length;e++)xc(t,e)||(t[e]=null);return t}function J0(t){const e=AN(null);for(const[n,r]of bN(t))xc(t,n)&&(Array.isArray(r)?e[n]=Ese(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=J0(r):e[n]=r);return e}function t2(t,e){for(;t!==null;){const r=Sse(t,e);if(r){if(r.get)return ml(r.get);if(typeof r.value=="function")return ml(r.value)}t=wse(t)}function n(){return null}return n}const CN=Eo(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),T7=Eo(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),E7=Eo(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ise=Eo(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),I7=Eo(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),_se=Eo(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xN=Eo(["#text"]),TN=Eo(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),_7=Eo(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),EN=Eo(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),k3=Eo(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Dse=jl(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Nse=jl(/<%[\w\W]*|[\w\W]*%>/gm),Ose=jl(/\${[\w\W]*}/gm),Fse=jl(/^data-[\-\w.\u00B7-\uFFFF]/),kse=jl(/^aria-[\-\w]+$/),IN=jl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Pse=jl(/^(?:\w+script|data):/i),Mse=jl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_N=jl(/^html$/i),Lse=jl(/^[a-z][.\w]*(-[.\w]+)+$/i);var DN=Object.freeze({__proto__:null,MUSTACHE_EXPR:Dse,ERB_EXPR:Nse,TMPLIT_EXPR:Ose,DATA_ATTR:Fse,ARIA_ATTR:kse,IS_ALLOWED_URI:IN,IS_SCRIPT_OR_DATA:Pse,ATTR_WHITESPACE:Mse,DOCTYPE_NAME:_N,CUSTOM_ELEMENT:Lse});const n2={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Bse=function(){return typeof window>"u"?null:window},Vse=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const a="dompurify"+(r?"#"+r:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}};function NN(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bse();const e=It=>NN(It);if(e.version="3.1.7",e.removed=[],!t||!t.document||t.document.nodeType!==n2.document)return e.isSupported=!1,e;let{document:n}=t;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:f,DOMParser:h,trustedTypes:g}=t,v=c.prototype,m=t2(v,"cloneNode"),A=t2(v,"remove"),w=t2(v,"nextSibling"),S=t2(v,"childNodes"),x=t2(v,"parentNode");if(typeof s=="function"){const It=n.createElement("template");It.content&&It.content.ownerDocument&&(n=It.content.ownerDocument)}let T,C="";const{implementation:E,createNodeIterator:_,createDocumentFragment:M,getElementsByTagName:N}=n,{importNode:F}=r;let P={};e.isSupported=typeof bN=="function"&&typeof x=="function"&&E&&E.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:H,ERB_EXPR:O,TMPLIT_EXPR:j,DATA_ATTR:U,ARIA_ATTR:le,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:X,CUSTOM_ELEMENT:ce}=DN;let{IS_ALLOWED_URI:Y}=DN,ae=null;const re=hi({},[...CN,...T7,...E7,...I7,...xN]);let Z=null;const K=hi({},[...TN,..._7,...EN,...k3]);let W=Object.seal(AN(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ge=null,ve=null,Ie=!0,be=!0,de=!1,ne=!0,q=!1,ee=!0,oe=!1,pe=!1,Ce=!1,De=!1,me=!1,Te=!1,Pe=!0,Ee=!1;const $="user-content-";let he=!0,ye=!1,se={},fe=null;const Ae=hi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ne=null;const Le=hi({},["audio","video","img","source","image","track"]);let ze=null;const tt=hi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),it="http://www.w3.org/1998/Math/MathML",ht="http://www.w3.org/2000/svg",Ut="http://www.w3.org/1999/xhtml";let fn=Ut,$t=!1,mn=null;const En=hi({},[it,ht,Ut],x7);let Tt=null;const je=["application/xhtml+xml","text/html"],He="text/html";let ot=null,rn=null;const nn=n.createElement("form"),Jt=function(Fe){return Fe instanceof RegExp||Fe instanceof Function},_n=function(){let Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(rn&&rn===Fe)){if((!Fe||typeof Fe!="object")&&(Fe={}),Fe=J0(Fe),Tt=je.indexOf(Fe.PARSER_MEDIA_TYPE)===-1?He:Fe.PARSER_MEDIA_TYPE,ot=Tt==="application/xhtml+xml"?x7:F3,ae=xc(Fe,"ALLOWED_TAGS")?hi({},Fe.ALLOWED_TAGS,ot):re,Z=xc(Fe,"ALLOWED_ATTR")?hi({},Fe.ALLOWED_ATTR,ot):K,mn=xc(Fe,"ALLOWED_NAMESPACES")?hi({},Fe.ALLOWED_NAMESPACES,x7):En,ze=xc(Fe,"ADD_URI_SAFE_ATTR")?hi(J0(tt),Fe.ADD_URI_SAFE_ATTR,ot):tt,Ne=xc(Fe,"ADD_DATA_URI_TAGS")?hi(J0(Le),Fe.ADD_DATA_URI_TAGS,ot):Le,fe=xc(Fe,"FORBID_CONTENTS")?hi({},Fe.FORBID_CONTENTS,ot):Ae,ge=xc(Fe,"FORBID_TAGS")?hi({},Fe.FORBID_TAGS,ot):{},ve=xc(Fe,"FORBID_ATTR")?hi({},Fe.FORBID_ATTR,ot):{},se=xc(Fe,"USE_PROFILES")?Fe.USE_PROFILES:!1,Ie=Fe.ALLOW_ARIA_ATTR!==!1,be=Fe.ALLOW_DATA_ATTR!==!1,de=Fe.ALLOW_UNKNOWN_PROTOCOLS||!1,ne=Fe.ALLOW_SELF_CLOSE_IN_ATTR!==!1,q=Fe.SAFE_FOR_TEMPLATES||!1,ee=Fe.SAFE_FOR_XML!==!1,oe=Fe.WHOLE_DOCUMENT||!1,De=Fe.RETURN_DOM||!1,me=Fe.RETURN_DOM_FRAGMENT||!1,Te=Fe.RETURN_TRUSTED_TYPE||!1,Ce=Fe.FORCE_BODY||!1,Pe=Fe.SANITIZE_DOM!==!1,Ee=Fe.SANITIZE_NAMED_PROPS||!1,he=Fe.KEEP_CONTENT!==!1,ye=Fe.IN_PLACE||!1,Y=Fe.ALLOWED_URI_REGEXP||IN,fn=Fe.NAMESPACE||Ut,W=Fe.CUSTOM_ELEMENT_HANDLING||{},Fe.CUSTOM_ELEMENT_HANDLING&&Jt(Fe.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(W.tagNameCheck=Fe.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Fe.CUSTOM_ELEMENT_HANDLING&&Jt(Fe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(W.attributeNameCheck=Fe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Fe.CUSTOM_ELEMENT_HANDLING&&typeof Fe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(W.allowCustomizedBuiltInElements=Fe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(be=!1),me&&(De=!0),se&&(ae=hi({},xN),Z=[],se.html===!0&&(hi(ae,CN),hi(Z,TN)),se.svg===!0&&(hi(ae,T7),hi(Z,_7),hi(Z,k3)),se.svgFilters===!0&&(hi(ae,E7),hi(Z,_7),hi(Z,k3)),se.mathMl===!0&&(hi(ae,I7),hi(Z,EN),hi(Z,k3))),Fe.ADD_TAGS&&(ae===re&&(ae=J0(ae)),hi(ae,Fe.ADD_TAGS,ot)),Fe.ADD_ATTR&&(Z===K&&(Z=J0(Z)),hi(Z,Fe.ADD_ATTR,ot)),Fe.ADD_URI_SAFE_ATTR&&hi(ze,Fe.ADD_URI_SAFE_ATTR,ot),Fe.FORBID_CONTENTS&&(fe===Ae&&(fe=J0(fe)),hi(fe,Fe.FORBID_CONTENTS,ot)),he&&(ae["#text"]=!0),oe&&hi(ae,["html","head","body"]),ae.table&&(hi(ae,["tbody"]),delete ge.tbody),Fe.TRUSTED_TYPES_POLICY){if(typeof Fe.TRUSTED_TYPES_POLICY.createHTML!="function")throw e2('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Fe.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw e2('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=Fe.TRUSTED_TYPES_POLICY,C=T.createHTML("")}else T===void 0&&(T=Vse(g,i)),T!==null&&typeof C=="string"&&(C=T.createHTML(""));Eo&&Eo(Fe),rn=Fe}},wt=hi({},["mi","mo","mn","ms","mtext"]),Ke=hi({},["annotation-xml"]),st=hi({},["title","style","font","a","script"]),vt=hi({},[...T7,...E7,...Ise]),Vt=hi({},[...I7,..._se]),On=function(Fe){let Qe=x(Fe);(!Qe||!Qe.tagName)&&(Qe={namespaceURI:fn,tagName:"template"});const At=F3(Fe.tagName),jt=F3(Qe.tagName);return mn[Fe.namespaceURI]?Fe.namespaceURI===ht?Qe.namespaceURI===Ut?At==="svg":Qe.namespaceURI===it?At==="svg"&&(jt==="annotation-xml"||wt[jt]):!!vt[At]:Fe.namespaceURI===it?Qe.namespaceURI===Ut?At==="math":Qe.namespaceURI===ht?At==="math"&&Ke[jt]:!!Vt[At]:Fe.namespaceURI===Ut?Qe.namespaceURI===ht&&!Ke[jt]||Qe.namespaceURI===it&&!wt[jt]?!1:!Vt[At]&&(st[At]||!vt[At]):!!(Tt==="application/xhtml+xml"&&mn[Fe.namespaceURI]):!1},$n=function(Fe){Jp(e.removed,{element:Fe});try{x(Fe).removeChild(Fe)}catch{A(Fe)}},lr=function(Fe,Qe){try{Jp(e.removed,{attribute:Qe.getAttributeNode(Fe),from:Qe})}catch{Jp(e.removed,{attribute:null,from:Qe})}if(Qe.removeAttribute(Fe),Fe==="is"&&!Z[Fe])if(De||me)try{$n(Qe)}catch{}else try{Qe.setAttribute(Fe,"")}catch{}},Wn=function(Fe){let Qe=null,At=null;if(Ce)Fe="<remove></remove>"+Fe;else{const Zt=SN(Fe,/^[\r\n\t ]+/);At=Zt&&Zt[0]}Tt==="application/xhtml+xml"&&fn===Ut&&(Fe='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Fe+"</body></html>");const jt=T?T.createHTML(Fe):Fe;if(fn===Ut)try{Qe=new h().parseFromString(jt,Tt)}catch{}if(!Qe||!Qe.documentElement){Qe=E.createDocument(fn,"template",null);try{Qe.documentElement.innerHTML=$t?C:jt}catch{}}const Xt=Qe.body||Qe.documentElement;return Fe&&At&&Xt.insertBefore(n.createTextNode(At),Xt.childNodes[0]||null),fn===Ut?N.call(Qe,oe?"html":"body")[0]:oe?Qe.documentElement:Xt},vr=function(Fe){return _.call(Fe.ownerDocument||Fe,Fe,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Nr=function(Fe){return Fe instanceof f&&(typeof Fe.nodeName!="string"||typeof Fe.textContent!="string"||typeof Fe.removeChild!="function"||!(Fe.attributes instanceof d)||typeof Fe.removeAttribute!="function"||typeof Fe.setAttribute!="function"||typeof Fe.namespaceURI!="string"||typeof Fe.insertBefore!="function"||typeof Fe.hasChildNodes!="function")},yn=function(Fe){return typeof l=="function"&&Fe instanceof l},lt=function(Fe,Qe,At){P[Fe]&&O3(P[Fe],jt=>{jt.call(e,Qe,At,rn)})},ut=function(Fe){let Qe=null;if(lt("beforeSanitizeElements",Fe,null),Nr(Fe))return $n(Fe),!0;const At=ot(Fe.nodeName);if(lt("uponSanitizeElement",Fe,{tagName:At,allowedTags:ae}),Fe.hasChildNodes()&&!yn(Fe.firstElementChild)&&Io(/<[/\w]/g,Fe.innerHTML)&&Io(/<[/\w]/g,Fe.textContent)||Fe.nodeType===n2.progressingInstruction||ee&&Fe.nodeType===n2.comment&&Io(/<[/\w]/g,Fe.data))return $n(Fe),!0;if(!ae[At]||ge[At]){if(!ge[At]&&Nt(At)&&(W.tagNameCheck instanceof RegExp&&Io(W.tagNameCheck,At)||W.tagNameCheck instanceof Function&&W.tagNameCheck(At)))return!1;if(he&&!fe[At]){const jt=x(Fe)||Fe.parentNode,Xt=S(Fe)||Fe.childNodes;if(Xt&&jt){const Zt=Xt.length;for(let Sn=Zt-1;Sn>=0;--Sn){const Ln=m(Xt[Sn],!0);Ln.__removalCount=(Fe.__removalCount||0)+1,jt.insertBefore(Ln,w(Fe))}}}return $n(Fe),!0}return Fe instanceof c&&!On(Fe)||(At==="noscript"||At==="noembed"||At==="noframes")&&Io(/<\/no(script|embed|frames)/i,Fe.innerHTML)?($n(Fe),!0):(q&&Fe.nodeType===n2.text&&(Qe=Fe.textContent,O3([H,O,j],jt=>{Qe=Zp(Qe,jt," ")}),Fe.textContent!==Qe&&(Jp(e.removed,{element:Fe.cloneNode()}),Fe.textContent=Qe)),lt("afterSanitizeElements",Fe,null),!1)},yt=function(Fe,Qe,At){if(Pe&&(Qe==="id"||Qe==="name")&&(At in n||At in nn))return!1;if(!(be&&!ve[Qe]&&Io(U,Qe))){if(!(Ie&&Io(le,Qe))){if(!Z[Qe]||ve[Qe]){if(!(Nt(Fe)&&(W.tagNameCheck instanceof RegExp&&Io(W.tagNameCheck,Fe)||W.tagNameCheck instanceof Function&&W.tagNameCheck(Fe))&&(W.attributeNameCheck instanceof RegExp&&Io(W.attributeNameCheck,Qe)||W.attributeNameCheck instanceof Function&&W.attributeNameCheck(Qe))||Qe==="is"&&W.allowCustomizedBuiltInElements&&(W.tagNameCheck instanceof RegExp&&Io(W.tagNameCheck,At)||W.tagNameCheck instanceof Function&&W.tagNameCheck(At))))return!1}else if(!ze[Qe]){if(!Io(Y,Zp(At,X,""))){if(!((Qe==="src"||Qe==="xlink:href"||Qe==="href")&&Fe!=="script"&&Cse(At,"data:")===0&&Ne[Fe])){if(!(de&&!Io(R,Zp(At,X,"")))){if(At)return!1}}}}}}return!0},Nt=function(Fe){return Fe!=="annotation-xml"&&SN(Fe,ce)},An=function(Fe){lt("beforeSanitizeAttributes",Fe,null);const{attributes:Qe}=Fe;if(!Qe)return;const At={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z};let jt=Qe.length;for(;jt--;){const Xt=Qe[jt],{name:Zt,namespaceURI:Sn,value:Ln}=Xt,zn=ot(Zt);let at=Zt==="value"?Ln:xse(Ln);if(At.attrName=zn,At.attrValue=at,At.keepAttr=!0,At.forceKeepAttr=void 0,lt("uponSanitizeAttribute",Fe,At),at=At.attrValue,At.forceKeepAttr||(lr(Zt,Fe),!At.keepAttr))continue;if(!ne&&Io(/\/>/i,at)){lr(Zt,Fe);continue}q&&O3([H,O,j],Me=>{at=Zp(at,Me," ")});const ie=ot(Fe.nodeName);if(yt(ie,zn,at)){if(Ee&&(zn==="id"||zn==="name")&&(lr(Zt,Fe),at=$+at),ee&&Io(/((--!?|])>)|<\/(style|title)/i,at)){lr(Zt,Fe);continue}if(T&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Sn)switch(g.getAttributeType(ie,zn)){case"TrustedHTML":{at=T.createHTML(at);break}case"TrustedScriptURL":{at=T.createScriptURL(at);break}}try{Sn?Fe.setAttributeNS(Sn,Zt,at):Fe.setAttribute(Zt,at),Nr(Fe)?$n(Fe):wN(e.removed)}catch{}}}lt("afterSanitizeAttributes",Fe,null)},Nn=function It(Fe){let Qe=null;const At=vr(Fe);for(lt("beforeSanitizeShadowDOM",Fe,null);Qe=At.nextNode();)lt("uponSanitizeShadowNode",Qe,null),!ut(Qe)&&(Qe.content instanceof a&&It(Qe.content),An(Qe));lt("afterSanitizeShadowDOM",Fe,null)};return e.sanitize=function(It){let Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Qe=null,At=null,jt=null,Xt=null;if($t=!It,$t&&(It="<!-->"),typeof It!="string"&&!yn(It))if(typeof It.toString=="function"){if(It=It.toString(),typeof It!="string")throw e2("dirty is not a string, aborting")}else throw e2("toString is not a function");if(!e.isSupported)return It;if(pe||_n(Fe),e.removed=[],typeof It=="string"&&(ye=!1),ye){if(It.nodeName){const Ln=ot(It.nodeName);if(!ae[Ln]||ge[Ln])throw e2("root node is forbidden and cannot be sanitized in-place")}}else if(It instanceof l)Qe=Wn("<!---->"),At=Qe.ownerDocument.importNode(It,!0),At.nodeType===n2.element&&At.nodeName==="BODY"||At.nodeName==="HTML"?Qe=At:Qe.appendChild(At);else{if(!De&&!q&&!oe&&It.indexOf("<")===-1)return T&&Te?T.createHTML(It):It;if(Qe=Wn(It),!Qe)return De?null:Te?C:""}Qe&&Ce&&$n(Qe.firstChild);const Zt=vr(ye?It:Qe);for(;jt=Zt.nextNode();)ut(jt)||(jt.content instanceof a&&Nn(jt.content),An(jt));if(ye)return It;if(De){if(me)for(Xt=M.call(Qe.ownerDocument);Qe.firstChild;)Xt.appendChild(Qe.firstChild);else Xt=Qe;return(Z.shadowroot||Z.shadowrootmode)&&(Xt=F.call(r,Xt,!0)),Xt}let Sn=oe?Qe.outerHTML:Qe.innerHTML;return oe&&ae["!doctype"]&&Qe.ownerDocument&&Qe.ownerDocument.doctype&&Qe.ownerDocument.doctype.name&&Io(_N,Qe.ownerDocument.doctype.name)&&(Sn="<!DOCTYPE "+Qe.ownerDocument.doctype.name+`>
2289
+ `}}),ii=b.forwardRef(function(t,e){var n=Kn(),r=b.useContext(ar),i=_3.getProps(t,r),a=b.useState(i.id),s=pN(a,2),l=s[0],c=s[1],u=b.useState(i.collapsed),d=pN(u,2),f=d[0],h=d[1],g=b.useRef(null),v=b.useRef(null),m=i.toggleable?i.onToggle?i.collapsed:f:!1,A=l+"_header",w=l+"_content",S=_3.setMetaData({props:i,state:{id:l,collapsed:m}}),x=S.ptm,T=S.cx,C=S.isUnstyled;ci(_3.css.styles,C,{name:"panel"});var E=function(X){i.toggleable&&(m?_(X):M(X),X&&(i.onToggle&&i.onToggle({originalEvent:X,value:!m}),X.preventDefault()))},_=function(X){i.onToggle||h(!1),i.onExpand&&X&&i.onExpand(X)},M=function(X){i.onToggle||h(!0),i.onCollapse&&X&&i.onCollapse(X)};b.useImperativeHandle(e,function(){return{props:i,toggle:E,expand:_,collapse:M,getElement:function(){return g.current},getContent:function(){return v.current}}}),Li(function(){l||c(So())});var N=function(){if(i.toggleable){var X=l+"_label",ce=n({className:T("toggler"),onClick:E,id:X,"aria-controls":w,"aria-expanded":!m,type:"button",role:"button","aria-label":i.header},x("toggler")),Y=n(x("togglericon")),ae=m?i.expandIcon||b.createElement(Mm,Y):i.collapseIcon||b.createElement(n8,Y),re=nr.getJSXIcon(ae,Y,{props:i,collapsed:m});return b.createElement("button",ce,re,b.createElement(Qt,null))}return null},F=function(){var X=ke.getJSXElement(i.header,i),ce=ke.getJSXElement(i.icons,i),Y=N(),ae=n({id:A,className:T("title")},x("title")),re=b.createElement("span",ae,X),Z=n({className:T("icons")},x("icons")),K=b.createElement("div",Z,ce,Y),W=n({className:T("header")},x("header")),ge=b.createElement("div",W,re,K);if(i.headerTemplate){var ve={className:"p-panel-header",titleClassName:"p-panel-title",iconsClassName:"p-panel-icons",togglerClassName:"p-panel-header-icon p-panel-toggler p-link",onTogglerClick:E,titleElement:re,iconsElement:K,togglerElement:Y,element:ge,id:l+"_header",props:i,collapsed:m};return ke.getJSXElement(i.headerTemplate,ve)}else if(i.header||i.toggleable)return ge;return null},P=function(){var X=ke.getJSXElement(i.footer,i),ce=n({className:T("footer")},x("footer")),Y=b.createElement("div",ce,X);if(i.footerTemplate){var ae={className:T("footer"),element:Y,props:i};return ke.getJSXElement(i.footerTemplate,ae)}else if(i.footer)return Y;return null},H=function(){var X=n({ref:v,className:T("toggleableContent"),"aria-hidden":m,role:"region",id:w,"aria-labelledby":A},x("toggleablecontent")),ce=n({className:T("content")},x("content")),Y=n({classNames:T("transition"),timeout:{enter:1e3,exit:450},in:!m,unmountOnExit:!0,options:i.transitionOptions},x("transition"));return b.createElement(Ro,v7({nodeRef:v},Y),b.createElement("div",X,b.createElement("div",ce,i.children)))},O=n({id:l,ref:g,style:i.style,className:ft(i.className,T("root"))},_3.getOtherProps(i),x("root")),j=F(),U=H(),le=P();return b.createElement("div",O,j,U,le)});ii.displayName="Panel";const ese=t=>{var v;const{fieldState:e,setFieldState:n,pageIndex:r,formBuilderFormLayout:i,pageSettingUpdate:a}=t,s=(m,A)=>{const w=`${m.className} justify-content-start`,S=`${m.titleClassName} pl-1`;return o.jsxs("div",{className:w,children:[o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:m.togglerClassName,onClick:()=>c(A),"aria-label":"Submit"}),o.jsx("span",{className:S,children:`Rule ${A+1}`})]})},l=(m,A)=>{var S;const w=[...((S=e==null?void 0:e.conditionalTabRules)==null?void 0:S.rules)||[]];w[m].conditions=w[m].conditions.filter((x,T)=>A!==T),n(x=>({...x,conditionalTabRules:{...x.conditionalTabRules,rules:w}}))},c=m=>{var x;const A=[...(e==null?void 0:e.conditionalTabRules.rules)||[]],w=A.filter((T,C)=>m!==C);n(T=>({...T,conditionalTabRules:{...T.conditionalTabRules,rules:w}}));const S=A[m];(x=S==null?void 0:S.conditions)==null||x.map(T=>{const C=i?_t.findIndex(i,_=>{var M;return(_==null?void 0:_.uuid)===((M=T==null?void 0:T.tab)==null?void 0:M.uuid)}):-1,E=i[C];E&&(E.isHidden=!1,a(C,E))})};let u=[...i].filter(function(m,A){return A!==r});u.map(m=>({uuid:m==null?void 0:m.uuid,title:m==null?void 0:m.title}));const d=(m,A,w)=>{const S=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];S[A].conditions[w].option=m==null?void 0:m.value,n(x=>({...x,conditionalTabRules:{...x.conditionalTabRules,rules:S}}))},f=(m,A,w)=>{const S=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];S[A].conditions[w].tab=m==null?void 0:m.value,n(C=>({...C,conditionalTabRules:{...C.conditionalTabRules,rules:S}}));const x=_t.findIndex(i,C=>{var E;return(C==null?void 0:C.uuid)===((E=m==null?void 0:m.value)==null?void 0:E.uuid)}),T=i[x];T&&(T.isHidden=!0,a(x,T))},h=()=>{n(m=>({...m,conditionalTabRules:{...m.conditionalTabRules,rules:[...m.conditionalTabRules.rules,{conditions:[]}]}}))},g=m=>{const A=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];A[m].conditions=[...A[m].conditions,{option:null,tab:null}],n(w=>({...w,conditionalTabRules:{...w.conditionalTabRules,rules:[...A]}}))};return o.jsxs("div",{children:[o.jsx("h4",{children:"Conditional Tabs"}),i&&(i==null?void 0:i.length)>1&&((v=e==null?void 0:e.conditionalTabRules)==null?void 0:v.rules.map((m,A)=>o.jsx(ii,{className:"mb-3",header:`Rule ${A+1}`,headerTemplate:w=>s(w,A),children:o.jsxs("div",{children:[m==null?void 0:m.conditions.map((w,S)=>o.jsx("div",{className:"p-field pb-6",children:o.jsxs("div",{className:"grid",children:[o.jsx("div",{className:"col-2",children:o.jsxs("label",{children:["Show tab",w.value]})}),o.jsx("div",{className:"col-3 p-fluid",children:o.jsx(Pa,{value:w.tab,options:u,onChange:x=>f(x,A,S),optionLabel:"title.english",placeholder:"Select option"})}),o.jsx("div",{className:"col-3",children:"when option is selected"}),o.jsx("div",{className:"col-3 p-fluid",children:o.jsx(Pa,{value:w==null?void 0:w.option,options:e==null?void 0:e.options,onChange:x=>d(x,A,S),optionLabel:"optionText.english",placeholder:"Select option"})}),o.jsx("div",{className:"col-1",children:o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>l(A,S),tooltipOptions:{position:"top"}})})]})},S)),o.jsx(Ot,{text:!0,size:"small",onClick:()=>g(A),icon:"pi pi-plus",className:"p-mt-4",label:"Add Condition"})]})},"conditional_tab_rule"+A))),i&&(i==null?void 0:i.length)>1&&o.jsx(Ot,{text:!0,onClick:()=>h(),className:"p-mt-4",icon:"pi pi-plus",label:"Add Rule",size:"small"}),i&&(i==null?void 0:i.length)<2&&o.jsx("p",{className:"error",children:"Please needs to have two or more tabs to enable the conditional tabs"})]})},tse=t=>{var x;const{fieldState:e,setFieldState:n,section:r,formBuilderFormLayout:i,sectionSettingUpdate:a,page:s}=t,[l]=k.useState([]),{schemaBuilderUpdate:c,formBuilderFormSchema:u}=sn(),d=(T,C)=>{const E=`${T.className} justify-content-start`,_=`${T.titleClassName} pl-1`;return o.jsxs("div",{className:E,children:[o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:T.togglerClassName,onClick:()=>f(C),"aria-label":"Submit"}),o.jsx("span",{className:_,children:`Rule ${C+1}`})]})},f=T=>{var M;const C=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],E=C[T];(M=E==null?void 0:E.conditions)==null||M.map(N=>{var H;const F=_t.findIndex(i,O=>{var j;return(O==null?void 0:O.uuid)===((j=N==null?void 0:N.tab)==null?void 0:j.uuid)}),P=i?_t.findIndex(i[F].children,O=>{var j;return(O==null?void 0:O.uuid)===((j=N==null?void 0:N.section)==null?void 0:j.uuid)}):-1;if(P>=0){const O=(H=i[F])==null?void 0:H.children[P];O&&(O.isHidden=!1,a(F,P,O))}});const _=C.filter((N,F)=>T!==F);n(N=>({...N,conditionalSectionRules:{...N.conditionalSectionRules,rules:_}}))},h=T=>{var _;let C=!1;const E=i?i.filter(function(M){return(M==null?void 0:M.uuid)===(T==null?void 0:T.uuid)}):[];return(E==null?void 0:E.length)>0&&((_=E[0].children)==null?void 0:_.length)>1&&(C=!0),C},g=(T,C,E)=>{const _=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];_[C].conditions[E].option=T==null?void 0:T.value,n(M=>({...M,conditionalSectionRules:{...M.conditionalSectionRules,rules:_}}))},v=(T,C)=>{var M;const E=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],_=E[T];(M=_==null?void 0:_.conditions)==null||M.map(N=>{var O;const F=_t.findIndex(i,j=>{var U;return(j==null?void 0:j.uuid)===((U=N==null?void 0:N.tab)==null?void 0:U.uuid)}),P=i?_t.findIndex(i[F].children,j=>{var U;return(j==null?void 0:j.uuid)===((U=N==null?void 0:N.section)==null?void 0:U.uuid)}):-1,H=(O=i[F])==null?void 0:O.children[P];console.log("sectionData",H),H&&(H.isHidden=!1,console.log("sectionData",H),a(F,P,H))}),E[T].conditions=E[T].conditions.filter((N,F)=>C!==F),n(N=>({...N,conditionalSectionRules:{...N.conditionalSectionRules,rules:E}}))},m=(T,C,E)=>{var H,O;const _=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];_[C].conditions[E].section=T==null?void 0:T.value;const M=(O=(H=_[C].conditions[E])==null?void 0:H.tab)==null?void 0:O.uuid,N=_t.findIndex(i,j=>(j==null?void 0:j.uuid)===M);n(j=>({...j,conditionalSectionRules:{...j.conditionalSectionRules,rules:_}}));const F=i?_t.findIndex(i[N].children,j=>{var U;return(j==null?void 0:j.uuid)===((U=T==null?void 0:T.value)==null?void 0:U.uuid)}):-1,P=i[N].children[F];P&&(P.isHidden=!0,a(N,F,P))},A=T=>{const C=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];C[T].conditions=[...C[T].conditions,{option:null,tab:{title:s==null?void 0:s.title,uuid:s==null?void 0:s.uuid},section:null}],n(E=>({...E,conditionalSectionRules:{...E.conditionalSectionRules,rules:C}}))},w=()=>{n(C=>({...C,conditionalSectionRules:{...C.conditionalSectionRules,rules:[...C.conditionalSectionRules.rules,{uuid:nt(),conditions:[]}]}}));const T=[...(u==null?void 0:u.conditionalSectionsRules)||[]];c({conditionalSectionsRules:[...T,{fieldId:e==null?void 0:e.uuid,uuid:nt(),conditions:[]}]})},S=T=>{var E;const C=i==null?void 0:i.filter(function(_){return(_==null?void 0:_.uuid)===(T==null?void 0:T.uuid)});if(C&&(C==null?void 0:C.length)>0){const _=(E=C[0])==null?void 0:E.children.filter(function(M){return(M==null?void 0:M.uuid)!==(r==null?void 0:r.uuid)});if((_==null?void 0:_.length)>0)return _}return l};return o.jsxs("div",{children:[o.jsx("h4",{children:"Conditional Sections"}),(x=e==null?void 0:e.conditionalSectionRules)==null?void 0:x.rules.map((T,C)=>o.jsx(ii,{className:"mb-3",header:`Rule ${C+1}`,headerTemplate:E=>d(E,C),children:o.jsxs("div",{children:[T==null?void 0:T.conditions.map((E,_)=>{var M,N;return o.jsx("div",{className:"p-field pb-2",children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-3 p-fluid",children:[o.jsx("label",{children:"In Tab"}),o.jsx("p",{children:(N=(M=E==null?void 0:E.tab)==null?void 0:M.title)==null?void 0:N.english})]}),o.jsxs("div",{className:"col-3 p-fluid",children:[o.jsxs("label",{children:["Select section",E.value]}),o.jsx(Pa,{disabled:!h(E==null?void 0:E.tab),value:E.section,options:S(E.tab),onChange:F=>m(F,C,_),optionLabel:"heading.english",placeholder:"Select option"})]}),o.jsxs("div",{className:"col-4 p-fluid",children:["when option is selected",o.jsx(Pa,{disabled:!h(E==null?void 0:E.tab),value:E==null?void 0:E.option,options:e==null?void 0:e.options,onChange:F=>g(F,C,_),optionLabel:"optionText.english",placeholder:"Select option"})]}),o.jsxs("div",{className:"col-1",children:[o.jsx("br",{}),o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>v(C,_),tooltipOptions:{position:"top"}})]}),!h(E.tab)&&o.jsx("div",{className:"col-12",children:o.jsxs("p",{className:"error",children:[" ","At least two or more sections should exist in a page"]})})]})},_)}),o.jsx("div",{children:o.jsx("div",{className:"flex",children:o.jsx(Ot,{text:!0,className:"btn-sm mt-3 ",label:"+ Add Condition",onClick:()=>A(C),size:"small"})})})]})},C)),o.jsx(Ot,{text:!0,icon:"pi pi-plus",onClick:()=>w(),className:"p-mt-4",label:"Add Rule",size:"small"})]})},nse=t=>{var u;const{fieldState:e,setFieldState:n}=t,r=d=>{var g;const h=[...((g=e==null?void 0:e.inlineConditionalRules)==null?void 0:g.rules)||[]].filter((v,m)=>d!==m);n(v=>({...v,inlineConditionalRules:{...v.inlineConditionalRules,rules:h}}))},i=(d,f)=>{const h=`${d.className} justify-content-start`,g=`${d.titleClassName} pl-1`;return o.jsxs("div",{className:h,children:[o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:d.togglerClassName,onClick:()=>r(f),"aria-label":"Submit"}),o.jsx("span",{className:g,children:`Rule ${f+1}`})]})},a=(d,f,h)=>{const g=[...(e==null?void 0:e.inlineConditionalRules.rules)||[]];g[f].conditions[h].value=d==null?void 0:d.value,n(v=>({...v,inlineConditionalRules:{...v.inlineConditionalRules,rules:g}}))},s=(d,f)=>{const h=[...(e==null?void 0:e.inlineConditionalRules.rules)||[]];h[d].conditions=h[d].conditions.filter((g,v)=>f!==v),n(g=>({...g,inlineConditionalRules:{...g.inlineConditionalRules,rules:h}}))},l=d=>{const f=[...(e==null?void 0:e.inlineConditionalRules.rules)||[]];f[d].conditions=[...f[d].conditions,{value:"",children:[]}],n(h=>({...h,inlineConditionalRules:{...h.inlineConditionalRules,rules:f}}))},c=()=>{n(d=>({...d,inlineConditionalRules:{...d.inlineConditionalRules,rules:[...d.inlineConditionalRules.rules,{conditions:[]}]}}))};return o.jsxs("div",{children:[o.jsx("h4",{children:"Inline Conditions"}),(u=e==null?void 0:e.inlineConditionalRules)==null?void 0:u.rules.map((d,f)=>o.jsx(ii,{className:"mb-3",header:`Rule ${f+1}`,headerTemplate:h=>i(h,f),children:o.jsxs("div",{children:[d==null?void 0:d.conditions.map((h,g)=>o.jsx("div",{className:"p-field p-pt-2",children:o.jsxs("div",{className:"grid",children:[o.jsx("label",{className:"block",children:"Show when selected option is:"}),o.jsx("div",{className:" p-fluid col-11",children:o.jsx(Pa,{value:h.value,options:e==null?void 0:e.options,onChange:v=>a(v,f,g),optionLabel:"optionText.english",placeholder:"Select option"})}),o.jsx("div",{className:"col-1",children:o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>s(f,g),tooltipOptions:{position:"top"}})})]})},"inline-rules-"+g)),o.jsx(Ot,{text:!0,onClick:()=>l(f),className:"p-mt-4",icon:"pi pi-plus",label:"Add Condition",size:"small"})]})},f)),o.jsx(Ot,{text:!0,onClick:()=>c(),className:"p-mt-4",icon:"pi pi-plus",label:"Add Rule",size:"small"})]})},rse=t=>{const{fieldState:e,pageIndex:n,section:r,setFieldState:i,page:a}=t,{pageSettingUpdate:s,formBuilderFormLayout:l,sectionSettingUpdate:c}=sn();return o.jsx(o.Fragment,{children:o.jsxs("div",{className:" scroll-height-250",children:[o.jsx(nse,{fieldState:e,setFieldState:i}),o.jsx("hr",{}),o.jsx(ese,{fieldState:e,setFieldState:i,pageIndex:n,formBuilderFormLayout:l,pageSettingUpdate:s}),o.jsx("hr",{}),o.jsx(tse,{fieldState:e,setFieldState:i,section:r,formBuilderFormLayout:l,sectionSettingUpdate:c,page:a}),o.jsx("hr",{})]})})},ise=t=>{const{fieldState:e,setFieldState:n}=t,[r,i]=k.useState(""),[a,s]=k.useState([""]),[l,c]=k.useState(!1),[u,d]=k.useState(0),[f,h]=k.useState(!1),{updateGlobalToast:g}=Ht(),v=()=>{h(!0)},m=()=>{var j;const H=((j=e==null?void 0:e.reviewerChecklist)==null?void 0:j.length)>=0?[...e.reviewerChecklist]:[];H.push({uuid:nt(),checklist:r,action:a,agree:null,selectAction:[],other:{isOther:!1,description:""},reviewerComments:""});const O={...e,reviewerChecklist:H};n(U=>({...U,...O})),h(!1),i(""),s([""])},A=()=>{h(!1),i(""),s([""])},w=H=>{const O=[...e.reviewerChecklist];O.splice(H,1);const j={...e,reviewerChecklist:O};n(U=>({...U,...j}))},S=(H,O)=>{c(!0);const{checklist:j,action:U}=H;h(!0),d(O),setTimeout(()=>{i(j),s(U)},1e3)},x=(H,O)=>o.jsxs(o.Fragment,{children:[o.jsx(Ot,{text:!0,type:"button",className:"p-button-info",icon:"pi pi-pencil",onClick:()=>S(H,O==null?void 0:O.rowIndex)}),o.jsx(Ot,{text:!0,type:"button",className:"p-button-danger",icon:"pi pi-trash",onClick:()=>w(O==null?void 0:O.rowIndex)})]}),T=H=>{var O;return o.jsx(o.Fragment,{children:(O=H==null?void 0:H.action)==null?void 0:O.length})},C=H=>{const O=[...a];O.splice(H,1),s(O)},E=()=>{const H=[...e.reviewerChecklist];H[u]={checklist:r,action:a};const O={...e,reviewerChecklist:H};n(j=>({...j,...O})),h(!1),c(!1)},_=()=>o.jsx("div",{children:l?o.jsx(Ot,{text:!0,className:"mb-5 p-button-success",label:"Edit Checklist",onClick:()=>{E()}}):o.jsx(Ot,{text:!0,className:"mb-5 p-button-success",label:"Add Checklist",onClick:()=>{m()}})}),M=H=>{n(O=>({...O,reviewerChecklist:H==null?void 0:H.value}))},N=H=>{navigator.clipboard.writeText(JSON.stringify(H))};function F(H){try{JSON.parse(H)}catch{return!1}return!0}const P=async()=>{var j;const H=await navigator.clipboard.readText();let O="";if(F(H)){const U=JSON.parse(H);if((j=U[0])!=null&&j.checklist){const le={..._t.cloneDeep(e),reviewerChecklist:U};n(R=>({...R,...le}));return}else O="Empty or Invalid Schema"}else O="Invalid Schema";g({showToast:!0,toastMessage:O,toastDetail:"",toastType:"error"})};return o.jsxs("div",{children:[o.jsx(Os,{maximizable:!0,header:"Add Checklist options for admin to reveiw",visible:f,style:{width:"30vw"},onHide:()=>A(),footer:_(),children:o.jsxs("div",{className:"scroll-height-500",children:[o.jsx("h5",{children:"Checklist"}),o.jsx(so,{rows:2,cols:50,value:r,onChange:H=>{var O;i((O=H==null?void 0:H.target)==null?void 0:O.value)}}),o.jsx("h5",{children:"Actions when admin selects NO as invalid"}),a.map((H,O)=>o.jsxs("div",{children:[O+1,"."," ",o.jsx(so,{value:H,onChange:j=>{var le;const U=[...a];U[O]=(le=j==null?void 0:j.target)==null?void 0:le.value,s(U)},rows:2,cols:50})," ",o.jsx(Ot,{text:!0,type:"button",icon:"pi pi-trash",className:"p-button-danger",onClick:()=>C(O)}),o.jsx("br",{}),o.jsx("br",{})]},`actionIndex-${O}`)),o.jsx(Ot,{outlined:!0,className:" p-button-primary mr-2",onClick:()=>{s([...a,""])},children:"Add Action"})]})})," ",o.jsx("h5",{children:"Reviewer Checklist"}),o.jsx(Ot,{className:"mb-5 mr-2 p-button-success",label:"Add Review Checklist",onClick:()=>{v()}}),o.jsx(Ot,{outlined:!0,label:"Copy Schema ",onClick:()=>{N([...(e==null?void 0:e.reviewerChecklist)||[]])},className:"mb-5 mr-2"}),o.jsx(Ot,{outlined:!0,label:"Paste Checklist ",onClick:()=>{P()},className:"mb-5 p-button-info"}),o.jsx("div",{className:"card",children:o.jsxs(ro,{value:e==null?void 0:e.reviewerChecklist,reorderableRows:!0,onRowReorder:M,scrollable:!0,children:[o.jsx(Sr,{rowReorder:!0,style:{width:"3em"}}),o.jsx(Sr,{field:"checklist",header:"Checklist"}),o.jsx(Sr,{field:"actions",header:"Actions",body:H=>T(H)}),o.jsx(Sr,{header:"",body:(H,O)=>x(H,O)})]})})]})},ase=t=>{const{onHandleChangeLayoutSettings:e,fieldState:n}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{inputId:"isFieldAnFilterOption",checked:(n==null?void 0:n.isFieldAnFilterOption)||!1,onChange:r=>e("isFieldAnFilterOption",r.checked)}),o.jsx("label",{htmlFor:"isFieldAnFilterOption",children:"Is field an filter option to filter data"}),"     ",o.jsx(cn,{target:".isFieldAnFilterOption",content:"Make the field a filter for sorting data"}),o.jsx("i",{className:"isFieldAnFilterOption pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{inputId:"isSortable",checked:(n==null?void 0:n.isSortable)||!1,onChange:r=>e("isSortable",r.checked)}),o.jsx("label",{htmlFor:"isSortable",children:"Enable sortable"}),"     ",o.jsx(cn,{target:".isSortable",content:"Make the field as column sortable"}),o.jsx("i",{className:"isSortable pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{inputId:"isFilterable",checked:(n==null?void 0:n.isFilterable)||!1,onChange:r=>e("isFilterable",r.checked)}),o.jsx("label",{htmlFor:"isFilterable",children:"Enable filter"}),"     ",o.jsx(cn,{target:".isFilterable",content:"Filter the column data"}),o.jsx("i",{className:"isFilterable pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{inputId:"resizableColumns",checked:n==null?void 0:n.resizableColumns,onChange:r=>e("resizableColumns",r.checked)}),o.jsx("label",{htmlFor:"resizableColumns",children:"Enable resizable columns"}),"     ",o.jsx(cn,{target:".resizableColumns",content:"Column width can be increase or decreased by dragging"}),o.jsx("i",{className:"resizableColumns pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{inputId:"reorderableColumns",checked:n==null?void 0:n.reorderableColumns,onChange:r=>e("reorderableColumns",r.checked)}),o.jsx("label",{htmlFor:"reorderableColumns",children:"Enable reorderable columns"}),"     ",o.jsx(cn,{target:".reorderableColumns",content:"Column can ordered to show as first or last"}),o.jsx("i",{className:"reorderableColumns pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{inputId:"colToggle",checked:(n==null?void 0:n.colToggle)||!1,onChange:r=>e("colToggle",r.checked)}),o.jsx("label",{htmlFor:"colToggle",children:"Enable column toggle"}),"     ",o.jsx(cn,{target:".colToggle",content:"Column can be shown and hide by settings by user"}),o.jsx("i",{className:"colToggle pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{inputId:"freezeColumn",checked:(n==null?void 0:n.freezeColumn)||!1,onChange:r=>e("freezeColumn",r.checked)}),o.jsx("label",{htmlFor:"freezeColumn",children:"Enable freeze columns"}),"     ",o.jsx(cn,{target:".freezeColumn",content:"Column can sticky so the important can be in view all the time"}),o.jsx("i",{className:"freezeColumn pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]})]})},sse=t=>{var c,u,d;const{fieldState:e,setFieldState:n}=t,{formBuilderSchemaLanguages:r}=sn(),i=()=>{n(f=>Object.assign({},f,{options:[...f.options,{uuid:nt(),optionText:{english:""},value:"",score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]}))},a=f=>{n(h=>({...h,fieldType:{...h==null?void 0:h.fieldType,type:f}}))},s=(f,h)=>{n(g=>({...g,[f]:h}))},l=[{label:"Employee",api:"/employees/list",availableId:["user_id","employee_id"],optionValue:"employee_id",optionLabel:"first_name"},{label:"Departments",api:"/department/",availableId:["department_id"],optionValue:"department_id",optionLabel:"department_name"}];return o.jsxs("div",{className:"p-fluid",children:[o.jsx("h4",{children:"Render Type"}),o.jsxs("div",{className:"flex flex-wrap gap-3 my-2",children:[o.jsxs("div",{className:"flex align-items-center",children:[o.jsx(ia,{inputId:"renderType1",name:"renderType",value:"radio",onChange:f=>{a(f==null?void 0:f.value)},checked:((c=e==null?void 0:e.fieldType)==null?void 0:c.type)==="radio"}),o.jsx("label",{htmlFor:"ingredient1",className:"ml-2",children:"Radio"})]}),o.jsxs("div",{className:"flex align-items-center",children:[o.jsx(ia,{inputId:"renderType2",name:"renderType",value:"dropdown",onChange:f=>{a(f==null?void 0:f.value)},checked:((u=e==null?void 0:e.fieldType)==null?void 0:u.type)==="dropdown"}),o.jsx("label",{htmlFor:"ingredient2",className:"ml-2",children:"Dropdown"})]})]}),o.jsx("label",{htmlFor:"",className:"pb-2",children:"Data Source"}),o.jsxs("div",{className:"flex flex-wrap gap-3 mt-2",children:[o.jsxs("div",{className:"flex align-items-center",children:[o.jsx(ia,{inputId:"dataSourceType1",name:"dataSourceType",value:"custom",onChange:f=>{s("dataSourceType",f==null?void 0:f.value)},checked:(e==null?void 0:e.dataSourceType)==="custom"}),o.jsx("label",{htmlFor:"ingredient1",className:"ml-2",children:"Custom"})]}),o.jsxs("div",{className:"flex align-items-center",children:[o.jsx(ia,{inputId:"dataSourceType2",name:"dataSourceType",value:"database",onChange:f=>{s("dataSourceType",f==null?void 0:f.value)},checked:(e==null?void 0:e.dataSourceType)==="database"}),o.jsx("label",{htmlFor:"ingredient2",className:"ml-2",children:"Database"})]})]}),(e==null?void 0:e.dataSourceType)==="database"&&o.jsxs(o.Fragment,{children:[o.jsx("h4",{children:"Select Data Source"}),o.jsx("div",{children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-6",children:[o.jsx("div",{className:"py-2",children:o.jsx("label",{children:"Datasources"})}),o.jsx(Pa,{value:e==null?void 0:e.dataSource,onChange:f=>{var h;s("optionLabel",(h=f.value)==null?void 0:h.optionLabel),s("dataSource",f.value)},options:l,placeholder:"Select a Data Source",className:"w-full "})]}),o.jsxs("div",{className:"col-6",children:[o.jsx("div",{className:"py-2",children:o.jsx("label",{htmlFor:"",className:"py-2",children:"Select Datasource Id"})}),o.jsx(Pa,{value:e==null?void 0:e.optionValue,onChange:f=>s("optionValue",f.value),options:(d=e==null?void 0:e.dataSource)==null?void 0:d.availableId,placeholder:"Source Id",className:"w-full "})]})]})})]}),(e==null?void 0:e.dataSourceType)==="custom"&&o.jsx(o.Fragment,{children:(e==null?void 0:e.options)!==void 0&&e.componentType!=="grid-component"&&e.componentType!=="matrix-dropdown"&&e.componentType!=="table"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"scroll-height-300 pt-5",children:o.jsx(ao,{activeIndex:0,children:r!=null&&r.length?r.map((f,h)=>o.jsx(io,{tabIndex:h,header:f==null?void 0:f.language,children:o.jsx(fN,{enableCopyPaste:!0,isCustomValue:!0,fieldState:e,setFieldState:n,language:f})},h)):""})}),o.jsx(Ot,{text:!0,className:"mr-3",label:"Add",icon:"pi pi-plus",onClick:()=>i(),"aria-label":"Add"})]})})]})},ose=t=>{var u,d;const{option:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a}=t,{userSelectedLanguage:s}=sn(),l=[{type:"radio",label:"Radio"},{type:"text",label:"Input Text"},{type:"text-area",label:"Text Area"},{type:"date",label:"Date Field"}],c=(f,h)=>{var g;return o.jsxs("div",{onClick:f.onClick,className:f.className,children:[o.jsx("span",{children:f.titleElement}),e.children&&((g=e.children)==null?void 0:g.length)>1&&o.jsx(Ot,{text:!0,icon:"pi pi-trash",size:"small",onClick:()=>{console.log("field",h==null?void 0:h.uuid),a(h==null?void 0:h.uuid)},"aria-label":"Filter"})]})};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"field-checkbox mt-3",children:[o.jsx(Yr,{inputId:"showConditionalFields",onChange:f=>{n(e==null?void 0:e.uuid,f.checked,{enableConditionalField:f.checked})},checked:e==null?void 0:e.enableConditionalField}),o.jsx("label",{htmlFor:"showConditionalFields",children:"Enable Conditional Field"})]}),(e==null?void 0:e.enableConditionalField)===!0&&o.jsxs(o.Fragment,{children:[o.jsx(Ot,{text:!0,label:"Add Field",onClick:()=>{i(e==null?void 0:e.uuid)}}),o.jsx(ss,{children:((u=e.children)==null?void 0:u.length)&&((d=e.children)==null?void 0:d.map((f,h)=>{var g,v;return o.jsx(Cr,{header:(g=f.label)==null?void 0:g[s==null?void 0:s.type],headerTemplate:m=>c(m,f),children:o.jsxs("div",{className:"card",children:[o.jsx("p",{children:"Choose Field Type"}),o.jsx("div",{className:"flex mb-3",children:(l==null?void 0:l.length)&&(l==null?void 0:l.map(m=>o.jsxs("div",{className:"mr-3",children:[o.jsx(ia,{inputId:"ingredient1",name:"fieldType",value:m==null?void 0:m.type,onChange:()=>r(f==null?void 0:f.uuid,{type:m==null?void 0:m.type}),checked:(f==null?void 0:f.type)===(m==null?void 0:m.type)}),o.jsx("label",{htmlFor:"ingredient1",className:"ml-2",children:m==null?void 0:m.label})]},`field_type_${f==null?void 0:f.uuid}`)))}),o.jsxs("div",{className:"field-checkbox mt-3",children:[o.jsx(Yr,{inputId:"isRequired",onChange:m=>{r(f==null?void 0:f.uuid,{attributes:{required:m.checked}})},checked:(v=f==null?void 0:f.attributes)==null?void 0:v.required}),o.jsxs("label",{htmlFor:"showConditionalFields",children:["Is Required"," "]})]}),o.jsxs(ss,{children:[o.jsx(Cr,{header:"Text",children:o.jsx(ii,{header:"Text Settings",toggleable:!0,collapsed:!0,children:o.jsx("div",{className:"",children:o.jsx(nD,{language:s,fieldState:f,onHandleChange:(m,A,w)=>{r(f==null?void 0:f.uuid,{[m]:{[A==null?void 0:A.type]:w}})}})})})}),(f==null?void 0:f.type)==="radio"&&o.jsx(Cr,{header:"Radio",children:o.jsx("div",{style:{width:"100%"},children:o.jsx(b7,{option:e,fieldState:f,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a})})})]})]})},`field-tab-${h}-${f==null?void 0:f.uuid}-${e==null?void 0:e.uuid}`)}))})]})]})},b7=t=>{var s,l;const{fieldState:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a}=t;return o.jsx(o.Fragment,{children:o.jsx(ss,{children:((s=e==null?void 0:e.options)==null?void 0:s.length)&&((l=e==null?void 0:e.options)==null?void 0:l.map((c,u)=>o.jsx(Cr,{header:`Option - ${c==null?void 0:c.label}`,children:o.jsx(ose,{option:c,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a})},`hirarchey-option-${u}`)))})})};var gN={},lse=Fi&&Fi.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),D3=Fi&&Fi.__assign||function(){return D3=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},D3.apply(this,arguments)},cse=Fi&&Fi.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),use=Fi&&Fi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),mN=Fi&&Fi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&cse(e,t,n);return use(e,t),e},dse=Fi&&Fi.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},fse=Fi&&Fi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gN,"__esModule",{value:!0});var y7=mN(k),hse=fse(GI),Zu=mN(la);function vN(t){return t&&t.replace(/&nbsp;|\u202F|\u00A0/g," ").replace(/<br \/>/g,"<br>")}function pse(t){var e=document.createTextNode("");t.appendChild(e);var n=document.activeElement===t;if(e!==null&&e.nodeValue!==null&&n){var r=window.getSelection();if(r!==null){var i=document.createRange();i.setStart(e,e.nodeValue.length),i.collapse(!0),r.removeAllRanges(),r.addRange(i)}t instanceof HTMLElement&&t.focus()}}var gse=function(t){lse(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.lastHtml=n.props.html,n.el=typeof n.props.innerRef=="function"?{current:null}:y7.createRef(),n.getEl=function(){return(n.props.innerRef&&typeof n.props.innerRef!="function"?n.props.innerRef:n.el).current},n.emitChange=function(r){var i=n.getEl();if(i){var a=i.innerHTML;if(n.props.onChange&&a!==n.lastHtml){var s=Object.assign({},r,{target:{value:a}});n.props.onChange(s)}n.lastHtml=a}},n}return e.prototype.render=function(){var n=this,r=this.props,i=r.tagName,a=r.html,s=r.innerRef,l=dse(r,["tagName","html","innerRef"]);return y7.createElement(i||"div",D3(D3({},l),{ref:typeof s=="function"?function(c){s(c),n.el.current=c}:s||this.el,onInput:this.emitChange,onBlur:this.props.onBlur||this.emitChange,onKeyUp:this.props.onKeyUp||this.emitChange,onKeyDown:this.props.onKeyDown||this.emitChange,contentEditable:!this.props.disabled,dangerouslySetInnerHTML:{__html:a}}),this.props.children)},e.prototype.shouldComponentUpdate=function(n){var r=this.props,i=this.getEl();return!i||vN(n.html)!==vN(i.innerHTML)?!0:r.disabled!==n.disabled||r.tagName!==n.tagName||r.className!==n.className||r.innerRef!==n.innerRef||r.placeholder!==n.placeholder||!(0,hse.default)(r.style,n.style)},e.prototype.componentDidUpdate=function(){var n=this.getEl();n&&(this.props.html!==n.innerHTML&&(n.innerHTML=this.props.html),this.lastHtml=this.props.html,pse(n))},e.propTypes={html:Zu.string.isRequired,onChange:Zu.func,disabled:Zu.bool,tagName:Zu.string,className:Zu.string,style:Zu.object,innerRef:Zu.oneOfType([Zu.object,Zu.func])},e}(y7.Component),N3=gN.default=gse;const mse=t=>{var w;const e=k.useRef(null),{field:n,fieldIndex:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,path:c}=t,[u,d]=k.useState(n),{userSelectedLanguage:f,fieldSettingUpdate:h,fieldSettingUpdateInlineConditional:g,gridComponentFieldSettingUpdate:v}=sn(),m=(S,x,T)=>{d(C=>({...C,[S]:{...C[S],[x==null?void 0:x.type]:T}}))};k.useEffect(()=>(A(),()=>{}),[u]);const A=()=>{const S=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?g(S[fa],S[ha],S[Ca],S[xa],S[Ta],S[Fa],S[Xo],S[wo],u):(S==null?void 0:S.length)>Fa&&(S==null?void 0:S.length)===Bl+1&&(n!=null&&n.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?v(S[fa],S[ha],S[Ca],S[xa],S[Ta],S[5],S[6],S[7],u):h(i,a,s,l,r,{...n,label:u==null?void 0:u.label})};return o.jsx(o.Fragment,{children:o.jsx(N3,{style:{display:"inline-block"},className:"builder-input-label-edit",innerRef:e,html:(w=n==null?void 0:n.label)==null?void 0:w[f==null?void 0:f.type],disabled:!1,onChange:S=>{var x;m("label",f,(x=S==null?void 0:S.target)==null?void 0:x.value)},tagName:"article"})})},ca=t=>{const{sectionIndex:e,fieldIndex:n}=t,{formBuilderFormSchema:r}=sn();return(r==null?void 0:r.enableFieldEnumeration)===!0?o.jsx("span",{className:"mr-2",children:o.jsx(F8,{classes:"font-medium p-1 bg-primary",level:"purple",value:`${e+1}.${n+1}`})}):o.jsx(o.Fragment,{})},A7=t=>{var f,h,g,v,m,A,w,S,x,T,C,E,_,M;const{field:e,update:n,value:r,isFirst:i,isDisabled:a}=t,{isBuilderMode:s,isAdmin:l}=Ht(),{selectedLanguage:c}=sn(),[u,d]=k.useState(0);return k.useEffect(()=>{const N=Gt.addListener("onSubmitUserForm",()=>{var P;(P=e==null?void 0:e.attributes)!=null&&P.required?r!=null&&r[e.uuid]?e.isValid=t3:e.isValid=D8:e.isValid=1}),F=Gt.addListener("OnInvalidFieldCatch",P=>{(e==null?void 0:e.uuid)===(P==null?void 0:P.fieldId)?d(N8):d(O8)});return()=>{N.remove(),F.remove()}}),o.jsxs("div",{className:"",children:[(e==null?void 0:e.type)===yZ&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex align-items-center mb-3",children:[" ",i===!0&&o.jsx(ca,{...t}),((f=e==null?void 0:e.attributes)==null?void 0:f.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",s?o.jsx(mse,{...t}):o.jsx("div",{className:"text-gray-900 font-bold text-xl",children:(h=e==null?void 0:e.label)==null?void 0:h[c]})]}),((g=e==null?void 0:e.options)==null?void 0:g.length)&&((v=e==null?void 0:e.options)==null?void 0:v.map(N=>{var F,P;return o.jsxs("div",{children:[o.jsxs("div",{className:"flex align-items-center mb-2",children:[o.jsx(ia,{inputId:N.uuid,name:e==null?void 0:e.uuid,value:N.uuid,onChange:H=>{(!l||!a)&&n(e==null?void 0:e.uuid,H==null?void 0:H.value)},checked:(r==null?void 0:r[e.uuid])===N.uuid,disabled:l||a}),o.jsx("label",{htmlFor:N.uuid,className:"ml-2",children:N.label})]}),(N==null?void 0:N.enableConditionalField)===!0&&(r==null?void 0:r[e==null?void 0:e.uuid])===(N==null?void 0:N.uuid)&&(N==null?void 0:N.children)&&((F=N==null?void 0:N.children)==null?void 0:F.length)>0&&((P=N==null?void 0:N.children)==null?void 0:P.map(()=>o.jsx(A7,{...t},`radio_child_${r==null?void 0:r[e==null?void 0:e.uuid]}`)))]},`${N.uuid}-radio-wrapper-${e==null?void 0:e.uuid}`)}))]}),(e==null?void 0:e.type)===AZ&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((m=e==null?void 0:e.attributes)==null?void 0:m.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[c]]}),o.jsx(wn,{className:"mt-2",onChange:N=>{var F;return n(e==null?void 0:e.uuid,(F=N==null?void 0:N.target)==null?void 0:F.value)},value:r==null?void 0:r.uuid,placeholder:(A=e==null?void 0:e.placeholder)==null?void 0:A[c],disabled:l||a})]})}),(e==null?void 0:e.type)===wZ&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((w=e==null?void 0:e.attributes)==null?void 0:w.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[c]]}),o.jsx(ef,{className:"mt-2",onChange:N=>{var F;return n(e==null?void 0:e.uuid,(F=N==null?void 0:N.target)==null?void 0:F.value)},value:r==null?void 0:r.uuid,placeholder:(S=e==null?void 0:e.placeholder)==null?void 0:S[c],disabled:l||a})]})}),(e==null?void 0:e.type)===SZ&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((x=e==null?void 0:e.attributes)==null?void 0:x.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[c]]}),o.jsx(so,{className:"mt-2",onChange:N=>{var F;return n(e==null?void 0:e.uuid,(F=N==null?void 0:N.target)==null?void 0:F.value)},value:r==null?void 0:r.uuid,placeholder:(T=e==null?void 0:e.placeholder)==null?void 0:T[c],disabled:l||a})]})}),o.jsx("div",{children:((C=e==null?void 0:e.helperText)==null?void 0:C[c])!==""&&o.jsx("small",{children:(E=e==null?void 0:e.helperText)==null?void 0:E[c]})}),o.jsx("div",{children:((_=e==null?void 0:e.attributes)==null?void 0:_.required)&&o.jsx("small",{className:"error",children:u===1&&!(r!=null&&r[e.uuid])?(M=e==null?void 0:e.validationMesssage)==null?void 0:M.language:""})})]},`${e==null?void 0:e.uuid}-radio`)},vse=t=>{const{hirarechicalRadioSchemaState:e}=t,[n,r]=k.useState({});return o.jsx("div",{children:o.jsx(A7,{schema:e,field:e,update:(i,a)=>{const s={...n};s[i]=a,r(s)},value:n,sectionIndex:0,fieldIndex:0,pageIndex:0,rowIndex:0,columnIndex:0,path:""})})},w7={showHeaderText:!1,showHelperText:!1,showToolTip:!1,showLabel:!0,label:{english:"Field label"},abbreviationLabel:{english:""},helperText:{english:"Helper Text"},guidelines:{english:""},headerText:{english:"Header text"},textTable:{english:""},toolTip:{english:""},validationMesssage:{english:"This field is required"},placeholder:{english:""},enableConditionalField:!0},bse={uuid:nt(),...w7,type:"radio",value:null,options:[{uuid:nt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:nt(),label:"No",value:null,enableConditionalField:!0,children:[]}]};({uuid:nt(),...w7,options:(nt(),{uuid:nt(),...w7,options:(nt(),nt())},nt())});const yse=t=>{const{fieldState:e,setFieldState:n}=t,r=(f,h,g)=>g==null?void 0:g.map(v=>{var m;return v.uuid===f?{...v,...h}:{...v,children:v!=null&&v.children&&((m=v==null?void 0:v.children)==null?void 0:m.length)>0?[...v.children.map(A=>A.type==="radio"?{...A,options:r(f,h,(A==null?void 0:A.options)||[])}:{...A})]:[]}}),i=(f,h,g)=>{const v=r(f,g,e.options);n(m=>({...m,options:v}))},a=(f,h,g)=>g==null?void 0:g.map(v=>{var m;return{...v,children:v!=null&&v.children&&((m=v==null?void 0:v.children)==null?void 0:m.length)>0?[...v.children.map(A=>A.uuid===f?{...A,...h}:{...A,options:a(f,h,A==null?void 0:A.options)})]:[]}}),s=(f,h)=>{const g=a(f,h,e.options);n(v=>({...v,options:g}))},l=(f,h)=>h==null?void 0:h.map(g=>{var v;return{...g,children:g!=null&&g.children&&((v=g==null?void 0:g.children)==null?void 0:v.length)>0?[...g.children.filter(m=>{if(m.uuid!==f)return{...m,options:l(f,m==null?void 0:m.options)}})]:[]}}),c=(f,h,g)=>g==null?void 0:g.map(v=>{var m;return v.children&&v.uuid===f?{...v,children:[...v.children,h]}:{...v,children:v!=null&&v.children&&((m=v==null?void 0:v.children)==null?void 0:m.length)>0?[...v.children.map(A=>({...A,options:c(f,h,A==null?void 0:A.options)}))]:[]}}),u=f=>{const h=c(f,{...bse,isValid:0,uuid:nt(),options:[{uuid:nt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:nt(),label:"No",value:null,enableConditionalField:!0,children:[]}],isPostField:!1,showAlphabetList:!1,showButtonLayout:!1,answerOptions:[],isExternalSource:!1,underLined:!1,noOfMultpleAnswer:void 0,isAllowMultipleAnswer:!1,isIcon:!1,isTodayBtn:!1,resizableColumns:!1,isFilterable:!1,freezeColumn:!1,colToggle:!1,isFieldAnFilterOption:!1,isSortable:!1,reorderableColumns:!1,timeLimit:0,score:0,subject_id:0,course_category_id:0,TextEditorProps:!1,fieldData:void 0},e.options);n(g=>({...g,options:h}))},d=f=>{const h=l(f,e.options);n(g=>({...g,options:h}))};return o.jsx("div",{children:o.jsx("div",{className:" px-4",children:o.jsxs("div",{className:"grid",children:[o.jsx("div",{className:"col-6 scroll-height-200",children:(e==null?void 0:e.isHierarchalCondionalTabEnabled)===!0&&o.jsx(b7,{fieldState:e,updateCondtionOption:i,updateChildrenField:s,addChildrenField:u,removeChildrenField:d})}),o.jsxs("div",{className:"col-6 p-3 scroll-height-200",children:[o.jsx("h4",{className:"flex justify-content-center align-items-center",children:"Preview"}),o.jsx(vse,{hirarechicalRadioSchemaState:e})]})]})})})},Qi=t=>{var Z;const{formBuilderFormSchema:e,fieldSettingUpdate:n,fieldSettingUpdateInlineConditional:r,formBuilderSchemaLanguages:i,pageSettingUpdate:a,formBuilderFormLayout:s,formBuilderPublishedStatus:l,gridComponentFieldSettingUpdate:c}=sn(),{renderType:u}=Ht(),{visibilty:d,field:f,closeSettingFieldSidebar:h,pageIndex:g,sectionIndex:v,rowIndex:m,columnIndex:A,fieldIndex:w,path:S,row:x,typeName:T}=t,{updateGlobalToast:C}=Ht(),[E,_]=k.useState(f),M=S.split("-"),N=()=>{const K=S.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?r(K[fa],K[ha],K[Ca],K[xa],K[Ta],K[Fa],K[Xo],K[wo],E):(K==null?void 0:K.length)>Fa&&(K==null?void 0:K.length)===Bl+1&&(E!=null&&E.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?c(K[fa],K[ha],K[Ca],K[xa],K[Ta],K[5],K[6],K[7],E):(n(g,v,m,A,w,{...E}),setTimeout(()=>{Gt.emit("OnSignatureSettingChange",{})},1e3),setTimeout(()=>{Gt.emit("onUpdateField",{})},1e3)),C({showToast:!0,toastMessage:"Updated",toastDetail:`${T} updated`,toastType:"success"})},F=(K,W,ge)=>{_(ve=>({...ve,[K]:{...ve[K],[W==null?void 0:W.type]:ge}}))},P=(K,W)=>{_(ge=>({...ge,attributes:{...ge.attributes,[K]:W}}))},H=(K,W)=>{_(ge=>({...ge,[K]:W}))},O=(K,W)=>{_(ge=>({...ge,inlineConditional:{...ge.inlineConditional,[K]:W}}))},j=()=>{},U=()=>{_(K=>({...K,data:[...K.data,{uuid:nt(),dataKey:"",value:""}]}))},le=()=>{_(K=>Object.assign({},K,{options:[...K.options,{uuid:nt(),optionText:{english:""},value:"",score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]}))},R=()=>{},X=()=>{},ce=()=>{},Y=()=>{},ae=K=>{var Ie;const W=[...(E==null?void 0:E.conditionalTabRules.rules)||[]],ge=W.filter((be,de)=>K!==de);_(be=>({...be,conditionalTabRules:{...be.conditionalTabRules,rules:ge}}));const ve=W[K];(Ie=ve==null?void 0:ve.conditions)==null||Ie.map(be=>{const de=_t.findIndex(s,q=>{var ee;return(q==null?void 0:q.uuid)===((ee=be==null?void 0:be.tab)==null?void 0:ee.uuid)}),ne=s[de];ne&&(ne.isHidden=!1,a(de,ne))})},re=(K,W)=>{const ge=[...(E==null?void 0:E.conditionalTabRules.rules)||[]];ge[K].conditions=ge[K].conditions.filter((ve,Ie)=>W!==Ie),_(ve=>({...ve,conditionalTabRules:{...ve.conditionalTabRules,rules:ge}}))};return o.jsx(o.Fragment,{children:o.jsxs(To,{style:{width:"80vw",zIndex:7e3},visible:d,position:"left",className:"p-sidebar-lg",onHide:()=>h(),header:()=>{var K;return o.jsx("div",{className:"flex align-items-center gap-2 justify-content-between",children:o.jsxs("div",{className:"text-gray-900 font-bold text-2xl",children:[(K=f==null?void 0:f.label)==null?void 0:K.english," "]})})},"aria-label":"Field Setting Sidebar",children:[o.jsx("div",{className:"",children:o.jsxs(ss,{children:[o.jsx(Cr,{header:"Text",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(ao,{activeIndex:0,children:i!=null&&i.length?i.map((K,W)=>o.jsx(io,{tabIndex:W,header:K==null?void 0:K.language,children:o.jsx(nD,{language:K,fieldState:E,onHandleChange:F,...t})},W)):""})})}),(E==null?void 0:E.isValidationTabEnabled)===!0&&o.jsx(Cr,{header:"Validation",children:o.jsx(xte,{fieldState:E,onHandleChangeLayoutSettings:H,onHandleChangeAttributesSetttings:P,...t})}),o.jsx(Cr,{header:"Attributes",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(Tte,{fieldState:E,onHandleChangeLayoutSettings:H,onHandleChangeAttributesSetttings:P})})}),(E==null?void 0:E.isLayoutTabEnabled)===!0&&o.jsx(Cr,{header:"Layout",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(Bte,{fieldState:E,onHandleChangeLayoutSettings:H})})}),(E==null?void 0:E.isDynamicListingTabEnabled)===!0&&o.jsx(Cr,{header:"Dynamic Options",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(sse,{fieldState:E,setFieldState:_})})}),(E==null?void 0:E.options)!==void 0&&(E==null?void 0:E.data)&&o.jsx(Cr,{header:"Data",children:o.jsxs("div",{className:"scroll-height-200",children:[o.jsx(Vte,{onHandleChangeLayoutSettings:H,fieldState:E,setFieldState:_}),o.jsx(Ot,{className:"mr-3",label:"Data Option",icon:"pi pi-plus",onClick:()=>U(),"aria-label":"Add"})]})}),o.jsx(Cr,{header:"Table view options",children:o.jsx(ase,{fieldState:E,onHandleChangeLayoutSettings:H})}),(E==null?void 0:E.componentType)!=="radio-hierarchal"&&(E==null?void 0:E.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsxs(Cr,{header:"Options",children:[(E==null?void 0:E.componentType)!=="radio-hierarchal"&&o.jsx("div",{className:"flex justify-content-end",children:o.jsx(Ot,{className:"mr-3 mb-2",label:"Option",icon:"pi pi-plus",onClick:()=>le(),"aria-label":"Option"})}),o.jsxs("div",{className:"scroll-height-200 px-4",children:[o.jsx(ao,{activeIndex:0,children:i!=null&&i.length?i.map((K,W)=>o.jsx(io,{tabIndex:W,header:K==null?void 0:K.language,children:o.jsx(fN,{enableAbbreviationColumn:(E==null?void 0:E.componentType)!=="radio-hierarchal",enableHyperTextColumn:(E==null?void 0:E.componentType)!=="radio-hierarchal",enableAddNewColumn:(E==null?void 0:E.componentType)!=="radio-hierarchal",enableCopyPaste:(E==null?void 0:E.componentType)!=="radio-hierarchal",isCustomValue:!1,fieldState:E,setFieldState:_,language:K})},W)):""}),(E==null?void 0:E.isHierarchalCondionalTabEnabled)===!0&&o.jsx(b7,{fieldState:E,onHandleChangeLayoutSettings:H,removeChildrenField:Y,addChildrenField:ce,updateChildrenField:X,updateCondtionOption:R})]})]}),(E==null?void 0:E.componentType)==="radio-hierarchal"&&(E==null?void 0:E.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsx(Cr,{header:"Hierarchal Options",children:o.jsx(yse,{fieldState:E,setFieldState:_})}),u===e3&&(E==null?void 0:E.inlineConditionalRules)!==void 0&&!(x!=null&&x.rowIsRepeatable)&&(M==null?void 0:M.length)<wo+1&&o.jsx(Cr,{header:"Conditional",children:o.jsx(rse,{handleRemoveConditionalTabRule:ae,handleRemoveConditionalTabRuleCondition:re,onHandleSelectInlineConditionalOption:j,onHandleChangeLayoutSettings:H,onHandleChangeInlineConditionaltSetttings:O,fieldState:E,setFieldState:_,pageIndex:g,sectionIndex:v,...t})}),!((Z=t==null?void 0:t.row)!=null&&Z.rowIsRepeatable)&&(e==null?void 0:e.enableReviewTask)===!0&&o.jsx(Cr,{header:"Admin reviewer checklist",children:o.jsx(ise,{fieldState:E,setFieldState:_})})]})}),o.jsx("div",{className:"w-full px-4 py-3 surface-100 sidebar-footer",children:o.jsxs("div",{className:"flex flex-row gap-2 align-items-center justify-content-end",children:[o.jsx(Ot,{text:!0,label:"Close",type:"button",icon:"pi pi-times",onClick:()=>h(),"aria-label":"Close",size:"small",className:"p-button-danger"}),!l&&o.jsx(Ot,{size:"small",label:"Update",type:"button",outlined:!0,onClick:()=>N(),"aria-label":"Update"})]})})]})})},ki=t=>{const[e,n]=k.useState(null),{field:r}=t,{userTaskSubmitFormData:i,updateUserFormDataSubmit:a,updateTaskFormData:s,taskSchema:l}=Ar(),{taskId:c}=Ht();console.log("ReviewerForm-taskId",c),k.useEffect(()=>{var m,A;if(i!==null&&e===null){let w=0;r!=null&&r.rowIsRepeatable?w=i.findIndex(S=>(S==null?void 0:S.rowId)===(r==null?void 0:r.uuid)):w=i.findIndex(S=>(S==null?void 0:S.fieldId)===(r==null?void 0:r.uuid)),n((m=i[w])!=null&&m.reviewerChecklist?(A=i[w])==null?void 0:A.reviewerChecklist:[])}return()=>{}},[r==null?void 0:r.rowIsRepeatable,r==null?void 0:r.uuid,e,i]);const u=m=>{const A=i.findIndex(S=>(S==null?void 0:S.fieldId)===(r==null?void 0:r.uuid)),w=[...i];w[A]={...w[A],reviewerChecklist:m},a(w),s(w,c,"/survey/update/formdata/")},d=(m,A)=>{const w=e;w[A]={...w[A],agree:m==null?void 0:m.value},n([...w]),u(w)},f=(m,A)=>{const w=e;if(A!=null&&A.checked)w[m].selectAction.push(A==null?void 0:A.value);else{const S=w[m].selectAction.findIndex(x=>x===(A==null?void 0:A.value));w[m].selectAction.splice(S,1)}n([...w]),u(w)},h=(m,A)=>{const w=e;m!=null&&m.checked?w[A]={...w[A],other:{...w[A].other,isOther:!0}}:w[A]={...w[A],other:{...w[A].other,isOther:!1}},n([...w]),u(w)},g=(m,A)=>{var S;const w=e;w[A]={...w[A],other:{...w[A].other,description:(S=m==null?void 0:m.target)==null?void 0:S.value}},n([...w]),u(w)},v=(m,A,w)=>{var x;const S=e;S[w]={...S[w],[A]:(x=m==null?void 0:m.target)==null?void 0:x.value},n([...S]),u(S)};return o.jsx(o.Fragment,{children:e!==null&&(e==null?void 0:e.length)>0?o.jsx(o.Fragment,{children:o.jsx(ii,{header:"Reviewer Checklist",toggleable:!0,collapsed:!0,children:o.jsx("div",{className:"flex flex-row flex-wrap gap-2",children:e==null?void 0:e.map((m,A)=>{var w,S,x,T,C;return o.jsxs("div",{className:"card p-fluid",style:{width:250},children:[o.jsx("h6",{className:"mb-2",children:m==null?void 0:m.checklist}),o.jsx("br",{}),o.jsxs("div",{className:"flex flex-row gap-3 mb-2",children:[o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(ia,{inputId:`yes-${A}`,name:"action",value:!0,onChange:E=>{d(E,A)},checked:(m==null?void 0:m.agree)===!0}),o.jsx("label",{htmlFor:`yes-${A}`,children:"Yes"})]}),o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(ia,{inputId:`no-${A}`,name:"action",value:!1,onChange:E=>{d(E,A)},checked:(m==null?void 0:m.agree)===!1}),o.jsx("label",{htmlFor:`no-${A}`,children:"No"})]})]}),(m==null?void 0:m.agree)===!1&&o.jsxs("div",{className:"px-5 mb-3",children:[(m==null?void 0:m.action)&&Array.isArray(m.action)&&((w=m==null?void 0:m.action)==null?void 0:w.length)>0&&((S=m==null?void 0:m.action)==null?void 0:S.map((E,_)=>{var M;return o.jsxs("div",{children:[o.jsx(Yr,{value:E,checked:((M=m==null?void 0:m.selectAction)==null?void 0:M.length)>0?m==null?void 0:m.selectAction.some(N=>N===E):!1,onChange:N=>{f(A,N)}})," ",E," ",o.jsx("br",{}),o.jsx("br",{})]},`action-${A}-${_}`)})),o.jsx(Yr,{checked:(x=m==null?void 0:m.other)==null?void 0:x.isOther,onChange:E=>{h(E,A)}})," Other ",o.jsx("br",{}),o.jsx("br",{}),((T=m==null?void 0:m.other)==null?void 0:T.isOther)===!0&&o.jsxs("div",{className:"",children:[o.jsx("label",{children:"If other please specify the action point"}),o.jsx("br",{}),o.jsx(so,{className:"mt-3",value:(C=m==null?void 0:m.other)==null?void 0:C.description,onChange:E=>g(E,A)})]})]}),(m==null?void 0:m.agree)===!1&&o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Feedback "}),o.jsx("br",{}),o.jsx(so,{className:"mt-3",value:m==null?void 0:m.reviewerFeedback,onChange:E=>v(E,"reviewerFeedback",A)})]}),o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Comments / Notes (internal use only)"}),o.jsx("br",{}),o.jsx(so,{className:"mt-3",value:m==null?void 0:m.reviewerComments,onChange:E=>v(E,"reviewerComments",A)})]})]},`checklistIndex-${A}`)})})})}):o.jsx(o.Fragment,{children:o.jsx("div",{className:"text-gray-900 flex justify-content-center align-items-center",children:"No admin review is required"})})})},xi=t=>{const{isPreview:e,field:n,isAdmin:r,fieldWrap:i}=t,{userSelectedLanguage:a}=sn(),{globalAlignment:s}=Ht(),l=g=>{const v=g.collapsed?"pi pi-chevron-down":"pi pi-chevron-up",m=`${g.className} justify-content-start`,A=`${g.titleClassName} pl-1`;return o.jsxs("div",{className:m,children:[o.jsxs("button",{className:g.togglerClassName,onClick:g.onTogglerClick,children:[o.jsx("span",{className:v}),o.jsx(Qt,{})]}),o.jsx("span",{className:A,children:d})]})},{TASK_PUBLISHED:c,task_status:u}=Ar(),[d,f]=k.useState("");k.useEffect(()=>{var g;f((g=n==null?void 0:n.label)==null?void 0:g[a==null?void 0:a.type])},[n,a==null?void 0:a.type]);const h=()=>{let g="";return e||(g=g+" field-form-builder"),u===c&&r===!0&&(g=g+" card"),g};return o.jsx(o.Fragment,{children:o.jsx("div",{dir:s,className:h(),children:u===c&&r===!0?o.jsx(ii,{headerTemplate:l,toggleable:!0,children:i}):i})})};/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */const{entries:bN,setPrototypeOf:yN,isFrozen:Ase,getPrototypeOf:wse,getOwnPropertyDescriptor:Sse}=Object;let{freeze:Eo,seal:jl,create:AN}=Object,{apply:S7,construct:C7}=typeof Reflect<"u"&&Reflect;Eo||(Eo=function(e){return e}),jl||(jl=function(e){return e}),S7||(S7=function(e,n,r){return e.apply(n,r)}),C7||(C7=function(e,n){return new e(...n)});const O3=ml(Array.prototype.forEach),wN=ml(Array.prototype.pop),Jp=ml(Array.prototype.push),F3=ml(String.prototype.toLowerCase),x7=ml(String.prototype.toString),SN=ml(String.prototype.match),Zp=ml(String.prototype.replace),Cse=ml(String.prototype.indexOf),xse=ml(String.prototype.trim),xc=ml(Object.prototype.hasOwnProperty),Io=ml(RegExp.prototype.test),e2=Tse(TypeError);function ml(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return S7(t,e,r)}}function Tse(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return C7(t,n)}}function hi(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:F3;yN&&yN(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const a=n(i);a!==i&&(Ase(e)||(e[r]=a),i=a)}t[i]=!0}return t}function Ese(t){for(let e=0;e<t.length;e++)xc(t,e)||(t[e]=null);return t}function J0(t){const e=AN(null);for(const[n,r]of bN(t))xc(t,n)&&(Array.isArray(r)?e[n]=Ese(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=J0(r):e[n]=r);return e}function t2(t,e){for(;t!==null;){const r=Sse(t,e);if(r){if(r.get)return ml(r.get);if(typeof r.value=="function")return ml(r.value)}t=wse(t)}function n(){return null}return n}const CN=Eo(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),T7=Eo(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),E7=Eo(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ise=Eo(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),I7=Eo(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),_se=Eo(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xN=Eo(["#text"]),TN=Eo(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),_7=Eo(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),EN=Eo(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),k3=Eo(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Dse=jl(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Nse=jl(/<%[\w\W]*|[\w\W]*%>/gm),Ose=jl(/\${[\w\W]*}/gm),Fse=jl(/^data-[\-\w.\u00B7-\uFFFF]/),kse=jl(/^aria-[\-\w]+$/),IN=jl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Pse=jl(/^(?:\w+script|data):/i),Mse=jl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_N=jl(/^html$/i),Lse=jl(/^[a-z][.\w]*(-[.\w]+)+$/i);var DN=Object.freeze({__proto__:null,MUSTACHE_EXPR:Dse,ERB_EXPR:Nse,TMPLIT_EXPR:Ose,DATA_ATTR:Fse,ARIA_ATTR:kse,IS_ALLOWED_URI:IN,IS_SCRIPT_OR_DATA:Pse,ATTR_WHITESPACE:Mse,DOCTYPE_NAME:_N,CUSTOM_ELEMENT:Lse});const n2={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Bse=function(){return typeof window>"u"?null:window},Vse=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const a="dompurify"+(r?"#"+r:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}};function NN(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bse();const e=It=>NN(It);if(e.version="3.1.7",e.removed=[],!t||!t.document||t.document.nodeType!==n2.document)return e.isSupported=!1,e;let{document:n}=t;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:f,DOMParser:h,trustedTypes:g}=t,v=c.prototype,m=t2(v,"cloneNode"),A=t2(v,"remove"),w=t2(v,"nextSibling"),S=t2(v,"childNodes"),x=t2(v,"parentNode");if(typeof s=="function"){const It=n.createElement("template");It.content&&It.content.ownerDocument&&(n=It.content.ownerDocument)}let T,C="";const{implementation:E,createNodeIterator:_,createDocumentFragment:M,getElementsByTagName:N}=n,{importNode:F}=r;let P={};e.isSupported=typeof bN=="function"&&typeof x=="function"&&E&&E.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:H,ERB_EXPR:O,TMPLIT_EXPR:j,DATA_ATTR:U,ARIA_ATTR:le,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:X,CUSTOM_ELEMENT:ce}=DN;let{IS_ALLOWED_URI:Y}=DN,ae=null;const re=hi({},[...CN,...T7,...E7,...I7,...xN]);let Z=null;const K=hi({},[...TN,..._7,...EN,...k3]);let W=Object.seal(AN(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ge=null,ve=null,Ie=!0,be=!0,de=!1,ne=!0,q=!1,ee=!0,oe=!1,pe=!1,Ce=!1,De=!1,me=!1,Te=!1,Pe=!0,Ee=!1;const $="user-content-";let he=!0,ye=!1,se={},fe=null;const Ae=hi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ne=null;const Le=hi({},["audio","video","img","source","image","track"]);let ze=null;const tt=hi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),it="http://www.w3.org/1998/Math/MathML",ht="http://www.w3.org/2000/svg",Ut="http://www.w3.org/1999/xhtml";let fn=Ut,$t=!1,mn=null;const En=hi({},[it,ht,Ut],x7);let Tt=null;const je=["application/xhtml+xml","text/html"],He="text/html";let ot=null,rn=null;const nn=n.createElement("form"),Jt=function(Fe){return Fe instanceof RegExp||Fe instanceof Function},_n=function(){let Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(rn&&rn===Fe)){if((!Fe||typeof Fe!="object")&&(Fe={}),Fe=J0(Fe),Tt=je.indexOf(Fe.PARSER_MEDIA_TYPE)===-1?He:Fe.PARSER_MEDIA_TYPE,ot=Tt==="application/xhtml+xml"?x7:F3,ae=xc(Fe,"ALLOWED_TAGS")?hi({},Fe.ALLOWED_TAGS,ot):re,Z=xc(Fe,"ALLOWED_ATTR")?hi({},Fe.ALLOWED_ATTR,ot):K,mn=xc(Fe,"ALLOWED_NAMESPACES")?hi({},Fe.ALLOWED_NAMESPACES,x7):En,ze=xc(Fe,"ADD_URI_SAFE_ATTR")?hi(J0(tt),Fe.ADD_URI_SAFE_ATTR,ot):tt,Ne=xc(Fe,"ADD_DATA_URI_TAGS")?hi(J0(Le),Fe.ADD_DATA_URI_TAGS,ot):Le,fe=xc(Fe,"FORBID_CONTENTS")?hi({},Fe.FORBID_CONTENTS,ot):Ae,ge=xc(Fe,"FORBID_TAGS")?hi({},Fe.FORBID_TAGS,ot):{},ve=xc(Fe,"FORBID_ATTR")?hi({},Fe.FORBID_ATTR,ot):{},se=xc(Fe,"USE_PROFILES")?Fe.USE_PROFILES:!1,Ie=Fe.ALLOW_ARIA_ATTR!==!1,be=Fe.ALLOW_DATA_ATTR!==!1,de=Fe.ALLOW_UNKNOWN_PROTOCOLS||!1,ne=Fe.ALLOW_SELF_CLOSE_IN_ATTR!==!1,q=Fe.SAFE_FOR_TEMPLATES||!1,ee=Fe.SAFE_FOR_XML!==!1,oe=Fe.WHOLE_DOCUMENT||!1,De=Fe.RETURN_DOM||!1,me=Fe.RETURN_DOM_FRAGMENT||!1,Te=Fe.RETURN_TRUSTED_TYPE||!1,Ce=Fe.FORCE_BODY||!1,Pe=Fe.SANITIZE_DOM!==!1,Ee=Fe.SANITIZE_NAMED_PROPS||!1,he=Fe.KEEP_CONTENT!==!1,ye=Fe.IN_PLACE||!1,Y=Fe.ALLOWED_URI_REGEXP||IN,fn=Fe.NAMESPACE||Ut,W=Fe.CUSTOM_ELEMENT_HANDLING||{},Fe.CUSTOM_ELEMENT_HANDLING&&Jt(Fe.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(W.tagNameCheck=Fe.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Fe.CUSTOM_ELEMENT_HANDLING&&Jt(Fe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(W.attributeNameCheck=Fe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Fe.CUSTOM_ELEMENT_HANDLING&&typeof Fe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(W.allowCustomizedBuiltInElements=Fe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(be=!1),me&&(De=!0),se&&(ae=hi({},xN),Z=[],se.html===!0&&(hi(ae,CN),hi(Z,TN)),se.svg===!0&&(hi(ae,T7),hi(Z,_7),hi(Z,k3)),se.svgFilters===!0&&(hi(ae,E7),hi(Z,_7),hi(Z,k3)),se.mathMl===!0&&(hi(ae,I7),hi(Z,EN),hi(Z,k3))),Fe.ADD_TAGS&&(ae===re&&(ae=J0(ae)),hi(ae,Fe.ADD_TAGS,ot)),Fe.ADD_ATTR&&(Z===K&&(Z=J0(Z)),hi(Z,Fe.ADD_ATTR,ot)),Fe.ADD_URI_SAFE_ATTR&&hi(ze,Fe.ADD_URI_SAFE_ATTR,ot),Fe.FORBID_CONTENTS&&(fe===Ae&&(fe=J0(fe)),hi(fe,Fe.FORBID_CONTENTS,ot)),he&&(ae["#text"]=!0),oe&&hi(ae,["html","head","body"]),ae.table&&(hi(ae,["tbody"]),delete ge.tbody),Fe.TRUSTED_TYPES_POLICY){if(typeof Fe.TRUSTED_TYPES_POLICY.createHTML!="function")throw e2('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Fe.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw e2('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=Fe.TRUSTED_TYPES_POLICY,C=T.createHTML("")}else T===void 0&&(T=Vse(g,i)),T!==null&&typeof C=="string"&&(C=T.createHTML(""));Eo&&Eo(Fe),rn=Fe}},wt=hi({},["mi","mo","mn","ms","mtext"]),Ke=hi({},["annotation-xml"]),st=hi({},["title","style","font","a","script"]),vt=hi({},[...T7,...E7,...Ise]),Vt=hi({},[...I7,..._se]),On=function(Fe){let Qe=x(Fe);(!Qe||!Qe.tagName)&&(Qe={namespaceURI:fn,tagName:"template"});const At=F3(Fe.tagName),jt=F3(Qe.tagName);return mn[Fe.namespaceURI]?Fe.namespaceURI===ht?Qe.namespaceURI===Ut?At==="svg":Qe.namespaceURI===it?At==="svg"&&(jt==="annotation-xml"||wt[jt]):!!vt[At]:Fe.namespaceURI===it?Qe.namespaceURI===Ut?At==="math":Qe.namespaceURI===ht?At==="math"&&Ke[jt]:!!Vt[At]:Fe.namespaceURI===Ut?Qe.namespaceURI===ht&&!Ke[jt]||Qe.namespaceURI===it&&!wt[jt]?!1:!Vt[At]&&(st[At]||!vt[At]):!!(Tt==="application/xhtml+xml"&&mn[Fe.namespaceURI]):!1},$n=function(Fe){Jp(e.removed,{element:Fe});try{x(Fe).removeChild(Fe)}catch{A(Fe)}},lr=function(Fe,Qe){try{Jp(e.removed,{attribute:Qe.getAttributeNode(Fe),from:Qe})}catch{Jp(e.removed,{attribute:null,from:Qe})}if(Qe.removeAttribute(Fe),Fe==="is"&&!Z[Fe])if(De||me)try{$n(Qe)}catch{}else try{Qe.setAttribute(Fe,"")}catch{}},Wn=function(Fe){let Qe=null,At=null;if(Ce)Fe="<remove></remove>"+Fe;else{const Zt=SN(Fe,/^[\r\n\t ]+/);At=Zt&&Zt[0]}Tt==="application/xhtml+xml"&&fn===Ut&&(Fe='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Fe+"</body></html>");const jt=T?T.createHTML(Fe):Fe;if(fn===Ut)try{Qe=new h().parseFromString(jt,Tt)}catch{}if(!Qe||!Qe.documentElement){Qe=E.createDocument(fn,"template",null);try{Qe.documentElement.innerHTML=$t?C:jt}catch{}}const Xt=Qe.body||Qe.documentElement;return Fe&&At&&Xt.insertBefore(n.createTextNode(At),Xt.childNodes[0]||null),fn===Ut?N.call(Qe,oe?"html":"body")[0]:oe?Qe.documentElement:Xt},vr=function(Fe){return _.call(Fe.ownerDocument||Fe,Fe,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Nr=function(Fe){return Fe instanceof f&&(typeof Fe.nodeName!="string"||typeof Fe.textContent!="string"||typeof Fe.removeChild!="function"||!(Fe.attributes instanceof d)||typeof Fe.removeAttribute!="function"||typeof Fe.setAttribute!="function"||typeof Fe.namespaceURI!="string"||typeof Fe.insertBefore!="function"||typeof Fe.hasChildNodes!="function")},yn=function(Fe){return typeof l=="function"&&Fe instanceof l},lt=function(Fe,Qe,At){P[Fe]&&O3(P[Fe],jt=>{jt.call(e,Qe,At,rn)})},ut=function(Fe){let Qe=null;if(lt("beforeSanitizeElements",Fe,null),Nr(Fe))return $n(Fe),!0;const At=ot(Fe.nodeName);if(lt("uponSanitizeElement",Fe,{tagName:At,allowedTags:ae}),Fe.hasChildNodes()&&!yn(Fe.firstElementChild)&&Io(/<[/\w]/g,Fe.innerHTML)&&Io(/<[/\w]/g,Fe.textContent)||Fe.nodeType===n2.progressingInstruction||ee&&Fe.nodeType===n2.comment&&Io(/<[/\w]/g,Fe.data))return $n(Fe),!0;if(!ae[At]||ge[At]){if(!ge[At]&&Nt(At)&&(W.tagNameCheck instanceof RegExp&&Io(W.tagNameCheck,At)||W.tagNameCheck instanceof Function&&W.tagNameCheck(At)))return!1;if(he&&!fe[At]){const jt=x(Fe)||Fe.parentNode,Xt=S(Fe)||Fe.childNodes;if(Xt&&jt){const Zt=Xt.length;for(let Sn=Zt-1;Sn>=0;--Sn){const Ln=m(Xt[Sn],!0);Ln.__removalCount=(Fe.__removalCount||0)+1,jt.insertBefore(Ln,w(Fe))}}}return $n(Fe),!0}return Fe instanceof c&&!On(Fe)||(At==="noscript"||At==="noembed"||At==="noframes")&&Io(/<\/no(script|embed|frames)/i,Fe.innerHTML)?($n(Fe),!0):(q&&Fe.nodeType===n2.text&&(Qe=Fe.textContent,O3([H,O,j],jt=>{Qe=Zp(Qe,jt," ")}),Fe.textContent!==Qe&&(Jp(e.removed,{element:Fe.cloneNode()}),Fe.textContent=Qe)),lt("afterSanitizeElements",Fe,null),!1)},yt=function(Fe,Qe,At){if(Pe&&(Qe==="id"||Qe==="name")&&(At in n||At in nn))return!1;if(!(be&&!ve[Qe]&&Io(U,Qe))){if(!(Ie&&Io(le,Qe))){if(!Z[Qe]||ve[Qe]){if(!(Nt(Fe)&&(W.tagNameCheck instanceof RegExp&&Io(W.tagNameCheck,Fe)||W.tagNameCheck instanceof Function&&W.tagNameCheck(Fe))&&(W.attributeNameCheck instanceof RegExp&&Io(W.attributeNameCheck,Qe)||W.attributeNameCheck instanceof Function&&W.attributeNameCheck(Qe))||Qe==="is"&&W.allowCustomizedBuiltInElements&&(W.tagNameCheck instanceof RegExp&&Io(W.tagNameCheck,At)||W.tagNameCheck instanceof Function&&W.tagNameCheck(At))))return!1}else if(!ze[Qe]){if(!Io(Y,Zp(At,X,""))){if(!((Qe==="src"||Qe==="xlink:href"||Qe==="href")&&Fe!=="script"&&Cse(At,"data:")===0&&Ne[Fe])){if(!(de&&!Io(R,Zp(At,X,"")))){if(At)return!1}}}}}}return!0},Nt=function(Fe){return Fe!=="annotation-xml"&&SN(Fe,ce)},An=function(Fe){lt("beforeSanitizeAttributes",Fe,null);const{attributes:Qe}=Fe;if(!Qe)return;const At={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z};let jt=Qe.length;for(;jt--;){const Xt=Qe[jt],{name:Zt,namespaceURI:Sn,value:Ln}=Xt,zn=ot(Zt);let at=Zt==="value"?Ln:xse(Ln);if(At.attrName=zn,At.attrValue=at,At.keepAttr=!0,At.forceKeepAttr=void 0,lt("uponSanitizeAttribute",Fe,At),at=At.attrValue,At.forceKeepAttr||(lr(Zt,Fe),!At.keepAttr))continue;if(!ne&&Io(/\/>/i,at)){lr(Zt,Fe);continue}q&&O3([H,O,j],Me=>{at=Zp(at,Me," ")});const ie=ot(Fe.nodeName);if(yt(ie,zn,at)){if(Ee&&(zn==="id"||zn==="name")&&(lr(Zt,Fe),at=$+at),ee&&Io(/((--!?|])>)|<\/(style|title)/i,at)){lr(Zt,Fe);continue}if(T&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Sn)switch(g.getAttributeType(ie,zn)){case"TrustedHTML":{at=T.createHTML(at);break}case"TrustedScriptURL":{at=T.createScriptURL(at);break}}try{Sn?Fe.setAttributeNS(Sn,Zt,at):Fe.setAttribute(Zt,at),Nr(Fe)?$n(Fe):wN(e.removed)}catch{}}}lt("afterSanitizeAttributes",Fe,null)},Nn=function It(Fe){let Qe=null;const At=vr(Fe);for(lt("beforeSanitizeShadowDOM",Fe,null);Qe=At.nextNode();)lt("uponSanitizeShadowNode",Qe,null),!ut(Qe)&&(Qe.content instanceof a&&It(Qe.content),An(Qe));lt("afterSanitizeShadowDOM",Fe,null)};return e.sanitize=function(It){let Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Qe=null,At=null,jt=null,Xt=null;if($t=!It,$t&&(It="<!-->"),typeof It!="string"&&!yn(It))if(typeof It.toString=="function"){if(It=It.toString(),typeof It!="string")throw e2("dirty is not a string, aborting")}else throw e2("toString is not a function");if(!e.isSupported)return It;if(pe||_n(Fe),e.removed=[],typeof It=="string"&&(ye=!1),ye){if(It.nodeName){const Ln=ot(It.nodeName);if(!ae[Ln]||ge[Ln])throw e2("root node is forbidden and cannot be sanitized in-place")}}else if(It instanceof l)Qe=Wn("<!---->"),At=Qe.ownerDocument.importNode(It,!0),At.nodeType===n2.element&&At.nodeName==="BODY"||At.nodeName==="HTML"?Qe=At:Qe.appendChild(At);else{if(!De&&!q&&!oe&&It.indexOf("<")===-1)return T&&Te?T.createHTML(It):It;if(Qe=Wn(It),!Qe)return De?null:Te?C:""}Qe&&Ce&&$n(Qe.firstChild);const Zt=vr(ye?It:Qe);for(;jt=Zt.nextNode();)ut(jt)||(jt.content instanceof a&&Nn(jt.content),An(jt));if(ye)return It;if(De){if(me)for(Xt=M.call(Qe.ownerDocument);Qe.firstChild;)Xt.appendChild(Qe.firstChild);else Xt=Qe;return(Z.shadowroot||Z.shadowrootmode)&&(Xt=F.call(r,Xt,!0)),Xt}let Sn=oe?Qe.outerHTML:Qe.innerHTML;return oe&&ae["!doctype"]&&Qe.ownerDocument&&Qe.ownerDocument.doctype&&Qe.ownerDocument.doctype.name&&Io(_N,Qe.ownerDocument.doctype.name)&&(Sn="<!DOCTYPE "+Qe.ownerDocument.doctype.name+`>
2290
2290
  `+Sn),q&&O3([H,O,j],Ln=>{Sn=Zp(Sn,Ln," ")}),T&&Te?T.createHTML(Sn):Sn},e.setConfig=function(){let It=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_n(It),pe=!0},e.clearConfig=function(){rn=null,pe=!1},e.isValidAttribute=function(It,Fe,Qe){rn||_n({});const At=ot(It),jt=ot(Fe);return yt(At,jt,Qe)},e.addHook=function(It,Fe){typeof Fe=="function"&&(P[It]=P[It]||[],Jp(P[It],Fe))},e.removeHook=function(It){if(P[It])return wN(P[It])},e.removeHooks=function(It){P[It]&&(P[It]=[])},e.removeAllHooks=function(){P={}},e}var P3=NN();const aa=t=>{var S;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,rowIndex:a,columnIndex:s,path:l}=t,[c,u]=k.useState(e);k.useEffect(()=>{var x;return A((x=e==null?void 0:e.label)==null?void 0:x[d==null?void 0:d.type]),()=>{}},[e]);const{userSelectedLanguage:d,fieldSettingUpdate:f,fieldSettingUpdateInlineConditional:h,gridComponentFieldSettingUpdate:g}=sn(),v=(x,T,C)=>{u(E=>({...E,[x]:{...E[x],[T==null?void 0:T.type]:C}}))},[m,A]=k.useState((S=e==null?void 0:e.label)==null?void 0:S[d==null?void 0:d.type]);k.useEffect(()=>(w(),()=>{}),[c]);const w=()=>{const x=l.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?h(x[fa],x[ha],x[Ca],x[xa],x[Ta],x[Fa],x[Xo],x[wo],c):(x==null?void 0:x.length)>Fa&&(x==null?void 0:x.length)===Bl+1&&(e!=null&&e.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?g(x[fa],x[ha],x[Ca],x[xa],x[Ta],x[5],x[6],x[7],c):f(r,i,a,s,n,{...e,label:c==null?void 0:c.label})};return o.jsx(o.Fragment,{children:o.jsx(N3,{style:{display:"inline-block"},className:"builder-input-label-edit",html:m,disabled:!1,onChange:x=>{var T;A(P3.sanitize((T=x==null?void 0:x.target)==null?void 0:T.value))},onBlur:x=>{var C;const T=P3.sanitize((C=x==null?void 0:x.target)==null?void 0:C.innerText);A(T),v("label",d,T)},tagName:"article"})})},Z0=t=>{const{onLabel:e,offLabel:n,onIcon:r,offIcon:i,onHandleChangeSetttings:a,settingsKey:s,settingsKeyValue:l}=t;return o.jsx(o.Fragment,{children:o.jsx(qp,{checked:l,onLabel:e,onChange:c=>{a(s,c.value)},offLabel:n,onIcon:r,offIcon:i,className:"mr-1 px-1",style:{fontSize:"0.8rem"}})})},Wr=t=>{var le,R,X,ce;const{field:e,fieldIndex:n,columnIndex:r,sectionIndex:i,rowIndex:a,pageIndex:s,type:l,path:c,handleFieldSettingsSidebar:u,showFieldIcons:d=!0,showSettingsIcon:f=!0}=t,{emitSocketData:h,renderType:g}=Ht(),v=(Y,ae)=>{P(re=>({...re,[Y]:ae}))},{fieldSettingUpdate:m,fieldSettingUpdateInlineConditional:A,cloneField:w,gridComponentFieldSettingUpdate:S,fieldSettingDeleteInlineConditional:x,gridComponentFieldDelete:T,removeField:C}=sn(),{updateGlobalToast:E}=Ht(),_=Y=>{const ae=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?A(ae[fa],ae[ha],ae[Ca],ae[xa],ae[Ta],ae[Fa],ae[Xo],ae[wo],Y):(ae==null?void 0:ae.length)>Fa&&(ae==null?void 0:ae.length)===Bl+1&&(Y!=null&&Y.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?S(ae[fa],ae[ha],ae[Ca],ae[xa],ae[Ta],ae[5],ae[6],ae[7],Y):m(s,i,a,r,n,Y),E({showToast:!0,toastMessage:"Updated",toastDetail:"Field updated",toastType:"success"})},[M,N]=k.useState(!1),[F,P]=k.useState({custom_component_title:"",custom_component_description:""}),H=()=>{P(Y=>({...Y,custom_component_schema:e})),N(!0)},O=()=>{const Y=c.split("-").map(Number);l==="inline-conditional"?x(Y[fa],Y[ha],Y[Ca],Y[xa],Y[Ta],Y[Fa],Y[Xo],Y[wo]):(Y==null?void 0:Y.length)>Fa&&(Y==null?void 0:Y.length)===Bl+1&&(e!=null&&e.componentType)&&l==="grid"?T(Y[fa],Y[ha],Y[Ca],Y[xa],Y[Ta],Y[5],Y[6],Y[7]):C(s,i,a,r,n)},j=(Y,ae)=>{const re={...e,attributes:{...e.attributes,[Y]:ae}};_(re)},U=(Y,ae)=>{const re={...e,[Y]:ae};_(re)};return o.jsx(o.Fragment,{children:o.jsxs("div",{className:`${(e==null?void 0:e.componentType)!=="hidden-field"&&(e==null?void 0:e.componentType)!=="image"&&(e==null?void 0:e.componentType)!=="quiz"&&(e==null?void 0:e.componentType)!=="document"&&(e==null?void 0:e.componentType)!=="href"&&(e==null?void 0:e.componentType)!=="paragraph"&&(e==null?void 0:e.componentType)!=="heading"&&(e==null?void 0:e.componentType)!=="list"&&(e==null?void 0:e.componentType)!=="hr"&&(e==null?void 0:e.componentType)!=="image-gallery"&&(e==null?void 0:e.componentType)!=="video"&&(e==null?void 0:e.componentType)!=="question","builder-element-quick-options mb-2 w-3 justify-content-center"} flex quick-setting`,children:[o.jsx(o.Fragment,{children:(e==null?void 0:e.componentType)!=="hidden-field"&&(e==null?void 0:e.componentType)!=="document"&&(e==null?void 0:e.componentType)!=="quiz"&&(e==null?void 0:e.componentType)!=="image"&&(e==null?void 0:e.componentType)!=="href"&&(e==null?void 0:e.componentType)!=="paragraph"&&(e==null?void 0:e.componentType)!=="heading"&&(e==null?void 0:e.componentType)!=="list"&&(e==null?void 0:e.componentType)!=="hr"&&(e==null?void 0:e.componentType)!=="image-gallery"&&(e==null?void 0:e.componentType)!=="video"&&(e==null?void 0:e.componentType)!=="question"&&d===!1&&o.jsxs("div",{className:" ",children:[o.jsx(Z0,{field:e,onHandleChangeSetttings:j,settingsKey:"required",settingsKeyValue:(le=e==null?void 0:e.attributes)==null?void 0:le.required,onLabel:"Required",offLabel:"Not Required",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:(R=e==null?void 0:e.attributes)==null?void 0:R.required}),o.jsx(Z0,{field:e,onHandleChangeSetttings:U,settingsKey:"showToolTip",settingsKeyValue:e==null?void 0:e.showToolTip,onLabel:"Tooltip",offLabel:"Tooltip",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showToolTip}),o.jsx(Z0,{field:e,onHandleChangeSetttings:U,settingsKey:"showHelperText",settingsKeyValue:e==null?void 0:e.showHelperText,onLabel:"Helper text",offLabel:"Helper text",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showHelperText}),o.jsx(Z0,{field:e,onHandleChangeSetttings:U,settingsKey:"showHeaderText",settingsKeyValue:e==null?void 0:e.showHeaderText,onLabel:"Header text",offLabel:"Header text",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showHeaderText}),o.jsx(Z0,{field:e,onHandleChangeSetttings:U,settingsKey:"isFluid",settingsKeyValue:e==null?void 0:e.isFluid,onLabel:"Fluid",offLabel:"Fluid",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.isFluid}),(e==null?void 0:e.componentType)=="radio"&&o.jsxs(o.Fragment,{children:[o.jsx(Z0,{field:e,onHandleChangeSetttings:U,settingsKey:"showAlphabetList",settingsKeyValue:e==null?void 0:e.showAlphabetList,onLabel:"Alpha",offLabel:"Alpha",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showAlphabetList}),o.jsx(Z0,{field:e,onHandleChangeSetttings:j,settingsKey:"style",settingsKeyValue:(X=e==null?void 0:e.attributes)==null?void 0:X.style,onLabel:"Style",offLabel:"Style",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:(ce=e==null?void 0:e.attributes)==null?void 0:ce.style})]})]})}),o.jsxs("div",{className:"quick-setting",children:[f===!0&&o.jsxs("span",{className:"p-buttonset",children:[(e==null?void 0:e.componentType)!=="hr"&&o.jsx(Ot,{text:!0,size:"small",tooltip:"Advanced settings",icon:"pi pi-cog",onClick:()=>{u(!0)},className:"mr-3"}),o.jsx(Ot,{size:"small",text:!0,icon:"pi pi-clone",outlined:!0,onClick:()=>{w(e,s,i,a,r,n),h()},tooltip:"Clone"}),o.jsx(Ot,{text:!0,className:"p-button-danger",size:"small",outlined:!0,icon:"pi pi-trash",onClick:()=>{O()},tooltip:"Delete"}),(g===e3||g===k0)&&o.jsx(Ot,{text:!0,size:"small",outlined:!0,icon:"pi pi-file",tooltip:"Save as custom component",onClick:()=>{H()}})]}),o.jsxs(Os,{header:"Custom component save",visible:M,style:{width:"20vw"},footer:()=>o.jsx(o.Fragment,{children:o.jsxs("div",{children:[o.jsx(Ot,{size:"small",text:!0,label:"Close",icon:"pi pi-times",onClick:()=>N(!1),className:"p-button-text"}),(e==null?void 0:e.componentType)!=="hidden-field"&&o.jsx(Ot,{text:!0,label:"Save",icon:"pi pi-check",onClick:()=>{N(!1)},autoFocus:!0})]})}),onHide:()=>N(!1),children:[o.jsxs("span",{className:"p-float-label",children:[o.jsx(wn,{id:"custom_component_title",name:"custom_component_title",className:"w-full",value:(F==null?void 0:F.custom_component_title)||"",onChange:Y=>{var ae;return v("custom_component_title",(ae=Y==null?void 0:Y.target)==null?void 0:ae.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component title"})]}),o.jsxs("span",{className:"p-float-label mt-5",children:[o.jsx(so,{id:"custom_component_description",name:"custom_component_description",className:"w-full",value:(F==null?void 0:F.custom_component_description)||"",onChange:Y=>{var ae;return v("custom_component_description",(ae=Y==null?void 0:Y.target)==null?void 0:ae.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component description"})]})]})]})]})})},qse=t=>{var re,Z,K,W,ge,ve,Ie,be;const{pageIndex:e,sectionIndex:n,field:r,fieldIndex:i,row:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isAdmin:u,isBuilderMode:d}=Ht(),{userSelectedLanguage:f,fieldSettingUpdate:h}=sn(),{taskRegisterData:g,updateTaskRegisterData:v,updateTaskProgressValue:m,updateUserFormDataSubmit:A,userTaskSubmitFormData:w}=Ar(),[S,x]=k.useState(!1),[T,C]=k.useState(!1),[E,_]=k.useState(null),[M,N]=k.useState(0),[F,P]=k.useState(!1),H=()=>{P(!0)},O=()=>{P(!1)},j=de=>{x(de)},U=()=>{x(!1)},le=()=>{var de,ne,q;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const ee=[...a.repeatableFields],oe=_t.findIndex(ee,function(pe){return pe.uuid===(r==null?void 0:r.uuid)});oe>=0&&ee[oe].fieldData?_(ee[oe].fieldData):(r.isValid=0,_(null))}}else{const ee=w,oe=_t.cloneDeep(g);if(ee!=null&&ee.length){for(const pe of ee)if(pe.fieldId===t.field.uuid&&((de=pe==null?void 0:pe.postData)!=null&&de.length)){_((ne=pe==null?void 0:pe.postData[0])==null?void 0:ne.postValue),oe[r==null?void 0:r.uuid]=(q=pe==null?void 0:pe.postData[0])==null?void 0:q.postValue;const Ce=Object.keys(oe).length;m(Ce);break}}}C(!0)},R=de=>{var oe;_(de.target.value);const ne=w,q=_t.cloneDeep(g);if((oe=de==null?void 0:de.target)!=null&&oe.value&&(ne==null?void 0:ne.length)>0)for(const pe of ne)pe.fieldId===t.field.uuid&&(q[r==null?void 0:r.uuid]=de==null?void 0:de.value,pe.postData[0]={postValue:de.value});else delete q[r==null?void 0:r.uuid];v(q);const ee=Object.keys(q).length;m(ee)};k.useEffect(()=>{T||le();const de=Gt.addListener("clearRepeatableFields",ee=>{ee===(a==null?void 0:a.uuid)&&(_(null),N(0),r.isValid=0,h(e,n,s,l,i,r))}),ne=Gt.addListener("onSubmitUserForm",()=>{var ee;(ee=r==null?void 0:r.attributes)!=null&&ee.required?E!==null||E!==void 0?r.isValid=1:(console.log("Countr field in valid ",E),r.isValid=0):r.isValid=1}),q=Gt.addListener("OnInvalidFieldCatch",ee=>{console.log("OnInvalidFieldCatch listener"),console.log("field.uuid === value?.fieldId",r.uuid===(ee==null?void 0:ee.fieldId)),r.uuid===(ee==null?void 0:ee.fieldId)?N(1):N(0)});return()=>{ne.remove(),q.remove(),de.remove()}});const X=(de,ne)=>{var q;if(w){const ee=[...w],oe=_t.findIndex(ee,function(Ce){return Ce.rowId===(a==null?void 0:a.uuid)});let pe=(q=w[oe])==null?void 0:q.repeatableFields;pe={...pe,[de==null?void 0:de.uuid]:ne==null?void 0:ne.name},ee[oe]={...ee[oe],repeatableFields:pe},A(ee)}_(ne),console.log("value !== null country",ne!==null),ne!==null?de.isValid=1:de.isValid=0},ce=(de,ne)=>de?o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:de.name,src:de==null?void 0:de.image,onError:q=>q.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:de.name})]}):o.jsx("span",{children:ne.placeholder}),Y=de=>o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:de.name,src:de==null?void 0:de.image,onError:ne=>ne.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:de.name})]}),ae=o.jsxs("div",{onMouseOver:H,onMouseOut:O,children:[d&&F&&o.jsx(Wr,{handleFieldSettingsSidebar:j,...t}),o.jsxs("div",{className:`field ${d?" py-3 px-4 builder-element-wrapper ":""}${(r==null?void 0:r.isFluid)===!0&&" p-fluid"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:d?"field-form-builder col-12 ":"col-12 ",children:[(r==null?void 0:r.showHeaderText)&&o.jsx("h6",{children:(re=r==null?void 0:r.headerText)==null?void 0:re[f==null?void 0:f.type]}),(r==null?void 0:r.showLabel)&&o.jsxs("label",{htmlFor:i,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((Z=r==null?void 0:r.attributes)==null?void 0:Z.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",d?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(K=r==null?void 0:r.label)==null?void 0:K[f==null?void 0:f.type]}),o.jsx("span",{className:"ml-3",children:(r==null?void 0:r.showToolTip)&&o.jsx(zi,{message:(W=r==null?void 0:r.toolTip)==null?void 0:W[f==null?void 0:f.type],position:"right"})})]}),o.jsx(Pa,{className:"country-select-builder-component",onFocus:()=>N(1),onChange:de=>{a!=null&&a.rowIsRepeatable?X(r,de.target.value):R(de)},options:r==null?void 0:r.countries,optionLabel:"name",value:E,placeholder:(ge=r==null?void 0:r.placeholder)==null?void 0:ge[f==null?void 0:f.type],disabled:c,valueTemplate:ce,itemTemplate:Y,filter:!0,filterBy:"name",showClear:!0}),((ve=r==null?void 0:r.attributes)==null?void 0:ve.required)&&o.jsx("small",{className:"error",children:M===1&&E===null?((Ie=r==null?void 0:r.validationMesssage)==null?void 0:Ie[f==null?void 0:f.type])||"field is required":""}),o.jsx("div",{children:(r==null?void 0:r.showHelperText)&&o.jsx("small",{children:(be=r==null?void 0:r.helperText)==null?void 0:be[f==null?void 0:f.type]})})]})}),u&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(ki,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[S===!0&&o.jsx(Qi,{visibilty:S,closeSettingFieldSidebar:U,...t},r==null?void 0:r.uuid),o.jsx(xi,{...t,fieldWrap:ae})]})},Use=t=>{var re,Z,K,W,ge,ve,Ie,be,de,ne,q,ee,oe,pe,Ce;const{taskRegisterData:e,updateTaskRegisterData:n,updateTaskProgressValue:r,updateUserFormDataSubmit:i,userTaskSubmitFormData:a}=Ar(),{userSelectedLanguage:s,fieldSettingUpdate:l}=sn(),{field:c,fieldIndex:u,sectionIndex:d,pageIndex:f,row:h,rowIndex:g,columnIndex:v,isDisabled:m}=t,{isAdmin:A,isBuilderMode:w}=Ht(),[S,x]=k.useState(!1),[T,C]=k.useState(""),[E,_]=k.useState(null),[M,N]=k.useState(0),[F,P]=k.useState(!1),[H,O]=k.useState(!1),j=()=>{O(!0)},U=()=>{O(!1)},le=()=>{var De,me,Te;if(h!=null&&h.rowIsRepeatable){if(h!=null&&h.repeatableFields){const Pe=[...h.repeatableFields],Ee=_t.findIndex(Pe,function($){return $.uuid===(c==null?void 0:c.uuid)});Ee>=0&&Pe[Ee].fieldData?C(Pe[Ee].fieldData):C("")}}else{const Pe=a;if(Pe!=null&&Pe.length){for(const Ee of Pe)if(Ee.fieldId===t.field.uuid&&((De=Ee==null?void 0:Ee.postData[0])==null?void 0:De.postValue)!==""&&((me=Ee==null?void 0:Ee.postData[0])!=null&&me.postValue)){C((Te=Ee==null?void 0:Ee.postData[0])==null?void 0:Te.postValue);break}}}P(!0)};k.useEffect(()=>{F||le();const De=Gt.addListener("clearRepeatableFields",$=>{$===(h==null?void 0:h.uuid)&&(C(""),N(0),c.isValid=0,l(f,d,g,v,u,c))}),me=Gt.addListener("onSubmitUserForm",()=>{var $,he;($=c==null?void 0:c.attributes)!=null&&$.required?T&&T.length&&(T==null?void 0:T.length)<((he=c==null?void 0:c.attributes)==null?void 0:he.minLength)?c.isValid=1:c.isValid=0:c.isValid=1}),Te=Gt.addListener("OnInvalidFieldCatch",$=>{console.log("Text field catch before"),c.uuid===($==null?void 0:$.fieldId)?(console.log("Text field catch"),N(1)):N(0)}),Pe=Gt.addListener("OnGetFieldValue",$=>{var ye;const he=(ye=$==null?void 0:$.repeatableColumn)==null?void 0:ye.filter(se=>(se==null?void 0:se.fieldUuid)===(c==null?void 0:c.uuid));he!=null&&he.length}),Ee=Gt.addListener("formFieldAdded",$=>{E===null&&_($==null?void 0:$.uuid)});return()=>{me.remove(),Te.remove(),Pe.remove(),De.remove(),Ee.remove()}}),k.useEffect(()=>(E!==null&&setTimeout(()=>{_(null)},1e3),()=>{}),[E]);const R=De=>{x(De)},X=()=>{x(!1)},ce=De=>{var Pe,Ee;C(De.target.value);const me=a,Te=_t.cloneDeep(e);if(me!==null){if((Pe=De==null?void 0:De.target)!=null&&Pe.value){if(Te[c==null?void 0:c.uuid]=(Ee=De==null?void 0:De.target)==null?void 0:Ee.value,(me==null?void 0:me.length)>0)for(const $ of me)$.fieldId===t.field.uuid&&($.postData[0]={postValue:De.target.value})}else if(delete Te[c==null?void 0:c.uuid],(me==null?void 0:me.length)>0)for(const $ of me)$.fieldId===t.field.uuid&&($.postData[0]={postValue:""})}if(!(h!=null&&h.rowIsRepeatable)){n(Te);const $=Object.keys(Te).length;r($)}},Y=(De,me)=>{var Te;if(a){const Pe=[...a],Ee=_t.findIndex(Pe,function(he){return he.rowId===(h==null?void 0:h.uuid)});let $=(Te=a[Ee])==null?void 0:Te.repeatableFields;$={...$,[De==null?void 0:De.uuid]:me},Pe[Ee]={...Pe[Ee],repeatableFields:$},i(Pe)}C(me),me!==""?De.isValid=1:De.isValid=0},ae=o.jsxs("div",{onMouseOver:j,onMouseOut:U,children:[w&&H&&o.jsx(Wr,{handleFieldSettingsSidebar:R,...t}),o.jsxs("div",{className:`field ${w?" py-3 px-4 builder-element-wrapper ":""} ${(c==null?void 0:c.isFluid)===!0&&" p-fluid"}`,children:[o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:A?"col-6 ":"col-12 p-fluid",children:[(c==null?void 0:c.showHeaderText)&&o.jsx("h6",{children:(re=c==null?void 0:c.headerText)==null?void 0:re[s==null?void 0:s.type]}),(c==null?void 0:c.showLabel)&&o.jsxs("label",{htmlFor:c==null?void 0:c.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((Z=c==null?void 0:c.attributes)==null?void 0:Z.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",w===!1?o.jsx(o.Fragment,{children:(K=c==null?void 0:c.label)==null?void 0:K[s==null?void 0:s.type]}):o.jsx(aa,{...t}),(c==null?void 0:c.showToolTip)&&o.jsx("span",{className:"ml-3",children:o.jsx(zi,{message:(W=c==null?void 0:c.toolTip)==null?void 0:W[s==null?void 0:s.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(c==null?void 0:c.iconAlignment),children:[(c==null?void 0:c.showIcon)&&o.jsx("i",{className:"pi pi-"+((ve=(ge=c==null?void 0:c.icon)==null?void 0:ge.properties)==null?void 0:ve.name)}),o.jsx(wn,{"data-component":"text-input",id:c==null?void 0:c.uuid,placeholder:(Ie=c==null?void 0:c.placeholder)==null?void 0:Ie[s==null?void 0:s.type],minLength:(be=c==null?void 0:c.attributes)==null?void 0:be.minLength,maxLength:(de=c==null?void 0:c.attributes)==null?void 0:de.maxLength,value:T,onFocus:()=>N(1),onChange:De=>{h!=null&&h.rowIsRepeatable?Y(c,De.target.value):ce(De)},className:M===N8&&((ne=c==null?void 0:c.attributes)!=null&&ne.required)?T?"valid":"invalid":"valid'",readOnly:m,disabled:A})]}),o.jsx("div",{children:((q=c==null?void 0:c.attributes)==null?void 0:q.required)&&o.jsxs(o.Fragment,{children:[o.jsx("small",{className:"error",children:M===1&&!T?(ee=c==null?void 0:c.validationMesssage)==null?void 0:ee.english:""}),o.jsx("small",{className:"error",children:M===1&&T.length&&(T==null?void 0:T.length)<((oe=c==null?void 0:c.attributes)==null?void 0:oe.minLength)?`Mini length ${(pe=c==null?void 0:c.attributes)==null?void 0:pe.minLength}`:""})]})}),o.jsx("div",{children:(c==null?void 0:c.showHelperText)&&o.jsx("small",{children:(Ce=c==null?void 0:c.helperText)==null?void 0:Ce[s==null?void 0:s.type]})})]})]}),A&&o.jsx(o.Fragment,{children:o.jsx("div",{className:"col-6",children:o.jsx(ki,{...t})})})]}),A&&o.jsx("hr",{})]})]});return o.jsxs(o.Fragment,{children:[S===!0&&o.jsx(Qi,{visibilty:S,closeSettingFieldSidebar:X,...t}),o.jsx(xi,{...t,fieldWrap:ae})]})},$se=t=>{var i,a;const{language:e,onHandleChange:n,fieldState:r}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Hyperlink text"}),o.jsx(wn,{value:(i=r==null?void 0:r.text)==null?void 0:i[e==null?void 0:e.type],onChange:s=>n("text",e,s.target.value)})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Hyperlink"}),o.jsx(wn,{value:(a=r==null?void 0:r.hrefLink)==null?void 0:a[e==null?void 0:e.type],onChange:s=>n("hrefLink",e,s.target.value)})]})]})},jse=t=>{var r;const{onHandleChangeStyling:e,fieldState:n}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("label",{className:"mr-2",children:"Hyperlink color"}),o.jsx(v3,{value:n==null?void 0:n.color,onChange:i=>{e("color",i.value)}})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Font Size"}),o.jsx(wn,{type:"number",maxLength:2,placeholder:"eg 20px",value:(r=Number(n==null?void 0:n.fontSize))==null?void 0:r.toFixed(0),onChange:i=>{e("fontSize",i.target.value)}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{checked:n==null?void 0:n.underLined,onChange:i=>{e("underLined",i.checked)}}),o.jsx("label",{children:"Underline link"})]})]})},zse=t=>{const{visibilty:e,field:n,closeSettingFieldSidebar:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,typeName:u}=t,[d,f]=k.useState(n),{fieldSettingUpdate:h,formBuilderSchemaLanguages:g,formBuilderPublishedStatus:v}=sn(),{updateGlobalToast:m}=Ht(),A=(x,T,C)=>{f(E=>({...E,[x]:{...E[x],[T==null?void 0:T.type]:C}}))},w=(x,T)=>{f(C=>({...C,[x]:T}))},S=()=>{h(i,a,s,l,c,d),m({showToast:!0,toastMessage:"Updated",toastDetail:`${u} updated`,toastType:"success"})};return o.jsx(o.Fragment,{children:o.jsxs(To,{visible:e,position:"left",className:"p-sidebar-lg",onHide:()=>r(),header:()=>{var x,T;return o.jsx("div",{className:"flex align-items-center gap-2 justify-content-between",children:o.jsxs("div",{className:"text-gray-900 font-bold text-2xl",children:[t==null?void 0:t.typeName," settings"," ",(x=n==null?void 0:n.label)!=null&&x.english?`- ${(T=n==null?void 0:n.label)==null?void 0:T.english}`:""," "]})})},children:[o.jsxs(ss,{children:[o.jsx(Cr,{header:"Text",children:o.jsx(ao,{activeIndex:0,children:g!=null&&g.length?g.map((x,T)=>o.jsx(io,{tabIndex:T,header:x==null?void 0:x.language,children:o.jsx($se,{language:x,fieldState:d,onHandleChange:A,...t})},T)):""})}),o.jsx(Cr,{header:"Styling",children:o.jsx(jse,{fieldState:d,onHandleChangeStyling:w,...t})})]}),o.jsx("div",{className:"w-full px-4 py-3 surface-100 sidebar-footer",children:o.jsxs("div",{className:"flex flex-row gap-2 align-items-center justify-content-end",children:[!v&&o.jsx(Ot,{size:"small",label:"Update",type:"button",outlined:!0,onClick:()=>S(),"aria-label":"Update"}),o.jsx(Ot,{label:"Close",type:"button",onClick:()=>r(),"aria-label":"Close",size:"small",className:"p-button-danger"})]})})]})})},Hse=t=>{var g,v,m,A,w,S,x,T,C;const{field:e}=t,{userSelectedLanguage:n}=sn(),{isBuilderMode:r}=Ht(),[i,a]=k.useState(!1),[s,l]=k.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)},d=E=>{a(E)},f=()=>{a(!1)};k.useEffect(()=>{},[e]);const h=o.jsxs("div",{className:r?"builder-element-wrapper":"",onMouseOver:c,onMouseOut:u,children:[r&&s&&o.jsx(Wr,{handleFieldSettingsSidebar:d,...t}),o.jsxs("div",{className:r?"field-form-builder px-4":" px-4",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(g=e==null?void 0:e.headerText)==null?void 0:g[n==null?void 0:n.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[((v=e==null?void 0:e.attributes)==null?void 0:v.required)&&o.jsx("span",{className:"must-required",children:"*"})," ",r?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(m=e==null?void 0:e.label)==null?void 0:m[n==null?void 0:n.type]}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(zi,{message:(A=e==null?void 0:e.toolTip)==null?void 0:A[n==null?void 0:n.type],position:"right"})})]}),o.jsx("a",{style:{fontSize:parseInt(e==null?void 0:e.fontSize),color:`#${e==null?void 0:e.color}`,textDecoration:e!=null&&e.underLined?"underline":"none"},className:"atag-style",href:(w=e==null?void 0:e.hrefLink)==null?void 0:w[n==null?void 0:n.type],children:(S=e==null?void 0:e.text)==null?void 0:S[n==null?void 0:n.type]}),((x=e==null?void 0:e.attributes)==null?void 0:x.required)&&o.jsx("small",{className:"error",children:(T=e==null?void 0:e.validationMesssage)==null?void 0:T[n==null?void 0:n.type]}),(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(C=e==null?void 0:e.helperText)==null?void 0:C[n==null?void 0:n.type]})]})]});return o.jsxs(o.Fragment,{children:[i&&o.jsx(zse,{visibilty:i,closeSettingFieldSidebar:f,...t}),o.jsx(xi,{...t,fieldWrap:h})]})},Yse=t=>{var K,W,ge,ve,Ie,be,de,ne,q,ee,oe,pe,Ce,De,me,Te,Pe,Ee,$,he,ye;const{field:e,fieldIndex:n,sectionIndex:r,pageIndex:i,row:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isAdmin:u,isBuilderMode:d}=Ht(),{taskRegisterData:f,updateTaskRegisterData:h,updateTaskProgressValue:g,updateUserFormDataSubmit:v,userTaskSubmitFormData:m,TASK_PUBLISHED:A,task_status:w}=Ar(),{userSelectedLanguage:S,fieldSettingUpdate:x}=sn(),[T,C]=k.useState(null),[E,_]=k.useState(!1),[M,N]=k.useState(null),[F,P]=k.useState(0),[H,O]=k.useState(!1),[j,U]=k.useState(!1),le=()=>{U(!0)},R=()=>{U(!1)},X=()=>{var se,fe;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const Ae=[...a.repeatableFields],Ne=_t.findIndex(Ae,function(Le){return Le.uuid===(e==null?void 0:e.uuid)});Ne>=0&&Ae[Ne].fieldData?N(Number(Ae[Ne].fieldData)||null):N(null)}}else{const Ae=m;if(Ae!=null&&Ae.length){for(const Ne of Ae)if(Ne.fieldId===t.field.uuid&&((se=Ne==null?void 0:Ne.postData)!=null&&se.length)){N(Number((fe=Ne==null?void 0:Ne.postData[0])==null?void 0:fe.postValue)||null);break}}}O(!0)};k.useEffect(()=>{H||X();const se=Gt.addListener("clearRepeatableFields",ze=>{ze===(a==null?void 0:a.uuid)&&(N(null),P(0),e.isValid=0,x(i,r,s,l,n,e))}),fe=Gt.addListener("onSubmitUserForm",()=>{var ze;(ze=e==null?void 0:e.attributes)!=null&&ze.required?M?e.isValid=1:e.isValid=0:e.isValid=1}),Ae=Gt.addListener("OnInvalidFieldCatch",ze=>{e.uuid===(ze==null?void 0:ze.fieldId)?P(1):P(0)}),Ne=Gt.addListener("OnGetFieldValue",ze=>{var it;const tt=(it=ze==null?void 0:ze.repeatableColumn)==null?void 0:it.filter(ht=>(ht==null?void 0:ht.fieldUuid)===(e==null?void 0:e.uuid));tt!=null&&tt.length}),Le=Gt.addListener("formFieldAdded",ze=>{T===null&&C(ze.uuid)});return()=>{fe.remove(),Ae.remove(),Ne.remove(),se.remove(),Le.remove()}}),k.useEffect(()=>(T!==null&&setTimeout(()=>{C(null)},1e3),()=>{}),[T]);const ce=se=>{_(se)},Y=()=>{_(!1)},ae=se=>{const fe=m,Ae=_t.cloneDeep(f);if(fe!==null){if(se){if(Ae[e==null?void 0:e.uuid]=se,(fe==null?void 0:fe.length)>0)for(const Ne of fe)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:se})}else if(delete Ae[e==null?void 0:e.uuid],(fe==null?void 0:fe.length)>0)for(const Ne of fe)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:""})}if(!(a!=null&&a.rowIsRepeatable)){h(Ae);const Ne=Object.keys(Ae).length;g(Ne)}},re=(se,fe)=>{var Ae;if(m!=null&&m.length){const Ne=[...m],Le=_t.findIndex(Ne,function(tt){return tt.rowId===(a==null?void 0:a.uuid)});let ze=(Ae=m[Le])==null?void 0:Ae.repeatableFields;ze={...ze,[se==null?void 0:se.uuid]:fe},Ne[Le]={...Ne[Le],repeatableFields:ze},v(Ne)}N(fe),fe!==""?se.isValid=1:se.isValid=0},Z=o.jsxs("div",{onMouseOver:le,onMouseOut:R,children:[d===!0&&j===!0&&o.jsx(Wr,{handleFieldSettingsSidebar:ce,...t}),o.jsxs("div",{className:`field ${d===!0&&" py-3 px-4 builder-element-wrapper "} ${(e==null?void 0:e.isFluid)===!0&&" p-fluid"}`,children:[o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:u?"col-6 ":"col-12 p-fluid",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(K=e==null?void 0:e.headerText)==null?void 0:K[S==null?void 0:S.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((W=e==null?void 0:e.attributes)==null?void 0:W.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",d?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(ge=e==null?void 0:e.label)==null?void 0:ge[S==null?void 0:S.type]}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(zi,{message:(ve=e==null?void 0:e.toolTip)==null?void 0:ve[S==null?void 0:S.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(e==null?void 0:e.iconAlignment),children:[(e==null?void 0:e.showIcon)&&o.jsx("i",{className:"pi pi-"+((be=(Ie=e==null?void 0:e.icon)==null?void 0:Ie.properties)==null?void 0:be.name)}),o.jsx(eo,{readOnly:c,id:e==null?void 0:e.uuid,disabled:u||c,placeholder:(de=e==null?void 0:e.placeholder)==null?void 0:de[S==null?void 0:S.type],value:M,min:(ne=e==null?void 0:e.attributes)==null?void 0:ne.min,max:e==null?void 0:e.attributes.max,suffix:e==null?void 0:e.attributes.suffix,prefix:(q=e==null?void 0:e.attributes)==null?void 0:q.prefix,showButtons:(ee=e==null?void 0:e.attributes)==null?void 0:ee.showButtons,pt:{incrementButton:{className:"bg-teal-500 border-teal-500"},decrementButton:{className:"bg-orange-500 border-orange-500"}},minFractionDigits:(oe=e==null?void 0:e.attributes)==null?void 0:oe.minFractionDigits,maxFractionDigits:(pe=e==null?void 0:e.attributes)==null?void 0:pe.maxFractionDigits,locale:(Ce=e==null?void 0:e.attributes)==null?void 0:Ce.locale,mode:(De=e==null?void 0:e.attributes)==null?void 0:De.mode,currency:(me=e==null?void 0:e.attributes)==null?void 0:me.currency,currencyDisplay:(Te=e==null?void 0:e.attributes)==null?void 0:Te.currencyDisplay,useGrouping:(Pe=e==null?void 0:e.attributes)==null?void 0:Pe.useGrouping,onFocus:()=>P(1),onChange:se=>{a!=null&&a.rowIsRepeatable?re(e,se.value):ae(se.value)},className:F===1&&((Ee=e==null?void 0:e.attributes)!=null&&Ee.required)?M?"valid":"invalid":"valid'"})]}),o.jsx("div",{children:(($=e==null?void 0:e.attributes)==null?void 0:$.required)&&o.jsx("small",{className:"error",children:F===1&&!M?(he=e==null?void 0:e.validationMesssage)==null?void 0:he.english:""})}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(ye=e==null?void 0:e.helperText)==null?void 0:ye[S==null?void 0:S.type]})})]})]}),u&&o.jsx(o.Fragment,{children:o.jsx("div",{className:"col-6",children:o.jsx(ki,{...t})})})]}),u&&o.jsx("hr",{})]})]});return o.jsxs(o.Fragment,{children:[E===!0&&d===!0&&o.jsx(Qi,{visibilty:E,closeSettingFieldSidebar:Y,...t}),o.jsx(xi,{...t,fieldWrap:Z})]})};//! moment.js
2291
2291
  //! version : 2.30.1
2292
2292
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors