@lax-wp/design-system 0.8.39 → 0.8.40
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.
- package/dist/index.es.js +5 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
.dark [class*="virtual-list-scrollbar-thumb"] {
|
|
48
48
|
background: #454545 !important;
|
|
49
49
|
}
|
|
50
|
-
`,document.head.appendChild(fe)},[]);const Re=()=>{if(q){let ie="";Te==null?ie="":typeof Te=="string"||typeof Te=="number"?ie=String(Te):Array.isArray(Te)?ie=Te.map(ye=>typeof ye=="object"&&ye!==null&&"value"in ye?ye.value:ye).join(", "):typeof Te=="object"&&"value"in Te&&(ie=String(Te.value)),q({key:h,value:ie})}},Te=Uk(e),$=x.useMemo(()=>m?Ak(m,y):null,[m,y]),te=(ie,fe)=>{if(se.current&&G.id){const ye=document.getElementById(G.id);if(ye){const ke=Array.isArray(fe)?fe.map(at=>at.value):fe?.value;ye.dataset.selectedValue=JSON.stringify(ke);const je=new Event("change",{bubbles:!0});Object.defineProperty(je,"target",{writable:!1,value:ye}),ye.dispatchEvent(je);const $e=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${G.id}`,value:ke,type:"change"}});ye.dispatchEvent($e)}}if(r==="tags"){const ye=Array.isArray(ie)?ie:[ie];p?.(ye?.map(ke=>({label:ke,value:ke})))}else p?.(fe)},oe=Bk({options:a,value:e,defaultValue:G?.defaultValue}),Le=x.useMemo(()=>oe.length>0||Te!=null,[oe,Te]),Ie=x.useMemo(()=>{if(!r||r!=="multiple"||oe.length===0)return!1;const ie=Array.isArray(Te)?Te:[];return oe.map(ye=>ye.value).every(ye=>ie.some(ke=>typeof ke=="object"&&ke!==null&&"value"in ke?String(ke.value)===String(ye):String(ke)===String(ye)))},[Te,oe,r]),Ye=()=>{!r||r!=="multiple"||!p||p(Ie?[]:oe)},Pe=x.useCallback(ie=>{if(!ie)return;const fe=new Event("submit",{bubbles:!0,cancelable:!0});ie.dispatchEvent(fe);const ye=ie.querySelector('button[type="submit"]');ye&&ye.click()},[]),Qe=x.useCallback(ie=>{if(ie.key==="Enter"&&!le&&(ie.preventDefault(),ie.stopPropagation(),Te)){const fe=ie.currentTarget.closest("form");Pe(fe)}},[le,Te,Pe]),At=x.useCallback(ie=>{const{label:fe,value:ye,onClose:ke}=ie,$e=oe.find(Ot=>String(Ot.value)===String(ye))?.color||"blue",at=Ot=>{Ot.preventDefault(),Ot.stopPropagation()};return l.jsx("div",{className:"cursor-pointer me-1 inline-flex",children:l.jsx(Kt,{label:fe,color:$e,size:"sm",onMouseDown:at,onClick:D?void 0:ke,isHashColor:!0,removable:!0,onRemove:ke})})},[oe,D]),de=x.useCallback(ie=>{Ce(ie),(A||$)?.(ie)},[A,$]);return l.jsxs("div",{ref:Q,className:W("flex gap-0.5 w-full relative",j&&f?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>ae(!0),onMouseLeave:()=>ae(!1),id:G.id,children:[f&&!j?l.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,l.jsxs("div",{className:W("w-full flex flex-col gap-1 risk-analysis-select-field",o),onMouseDown:ie=>ie.stopPropagation(),onKeyDownCapture:Qe,role:"group","aria-labelledby":t?"select-field-label":void 0,children:[t?l.jsx("label",{id:"select-field-label",htmlFor:"label",className:`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${c?"":"capitalize"} ${L||""}`,children:l.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[l.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[l.jsx(Lt,{label:t||"",required:i||!1,isRequiredConditional:B||!1}),X&&l.jsx(he.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),d&&l.jsx(Vr,{}),l.jsx(Sr,{labels:s}),u&&l.jsx(Me,{placement:"top",title:u,children:l.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onKeyDown:ie=>{(ie.key==="Enter"||ie.key===" ")&&ie.preventDefault()},children:l.jsx(yr,{})})})]}),f&&j?l.jsx("button",{id:"btn-select-field-base-add-to-document",className:"cursor-pointer",onClick:Re,type:"button",children:l.jsx(Me,{placement:"top",title:Y("Add to document"),children:l.jsx(he.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}):null,l.jsx(Fe.Select,{onOpenChange:Ee,disabled:D,className:`w-full text-black-900 dark:text-black-200 ${n&&i?"ant-select-status-error":"#e2e8f0"} ${_&&I?.color?"risk-select-field":""}`,classNames:{popup:{root:"!z-[5001]"}},style:{width:"100%","--risk-color":_&&I?.hexBgColor?I?.hexBgColor:"","--risk-border-color":_&&I?.hexBorderColor?I?.hexBorderColor:""},"aria-required":i,mode:r,value:Te,onChange:te,filterOption:m?b:(ie,fe)=>(fe?.label||"")?.toLowerCase()?.includes(ie?.toLowerCase()),showSearch:!0,onSearch:de||void 0,onPopupScroll:S,popupClassName:"select-field-dropdown-popup",popupRender:ie=>l.jsx(Vk,{showSelectAll:N,mode:r,options:oe,searchValue:ge,handleSelectAll:Ye,isAllSelected:Ie,menu:ie,isLoading:v,hasExistingData:Le,t:Y}),options:oe.map(({label:ie,value:fe,color:ye,...ke})=>({label:String(ie),value:String(fe),key:String(fe),id:String(fe),color:ye,...ke})),optionRender:ie=>{const fe=ie?.data?.fullname;if(fe&&P){const[ye,ke]=fe.split(" ");return l.jsxs("div",{className:"flex items-center justify-start gap-1",children:[l.jsx(P,{firstName:ye,lastName:ke,profilePic:ie?.data?.url||"",size:"xs",enablePopper:!0,userId:ie?.data?.value}),l.jsx("span",{className:"ml-2",children:ie.label})]})}return l.jsx("span",{children:ie.label})},autoClearSearchValue:T,onClear:()=>p&&p(r==="tags"||r==="multiple"?[]:null),maxTagCount:r==="tags"&&C?void 0:"responsive",maxTagPlaceholder:ie=>l.jsx(Me,{placement:"top",title:ie.length>3?ie.slice(0,3).map(({label:fe})=>fe).join(", ")+"...":ie.map(({label:fe})=>fe).join(", "),children:l.jsxs("span",{children:["+",ie.length," more"]})}),tagRender:k||At,allowClear:E,...G}),n&&l.jsx(ee,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:n})]}),j&&I&&_&&M&&l.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:ie=>ie.stopPropagation(),onMouseDown:ie=>ie.preventDefault(),onKeyDown:ie=>{ie.key==="Escape"&&ae(!1)},children:l.jsx(M,{riskDetails:I})})]})});Mo.displayName="SelectField";const Jb=x.forwardRef(({id:t,label:e,checked:r,isChecked:n,onChange:a,disabled:i=!1,required:s=!1,message:o,messageType:A="default",wrapperClassName:u,checkboxClassName:c,labelClassName:d,size:f="medium",variant:h="default",labelPosition:p="right",checkboxProps:m},y)=>{const b=r!==void 0?r:n||!1,S=()=>{switch(f){case"small":return"w-3 h-3";case"large":return"w-5 h-5";default:return"w-4 h-4"}},v=()=>{if(A==="error")return"text-red-600 border-red-300 focus:ring-red-500 dark:focus:ring-red-600";if(A==="success")return"text-green-600 border-green-300 focus:ring-green-500 dark:focus:ring-green-600";if(A==="info")return"text-blue-600 border-blue-300 focus:ring-blue-500 dark:focus:ring-blue-600";switch(h){case"outline":return"text-primary-600 bg-transparent border-neutral-300 focus:ring-primary-500 dark:focus:ring-primary-600";case"solid":return"text-primary-600 bg-primary-50 border-primary-300 focus:ring-primary-500 dark:focus:ring-primary-600 dark:bg-primary-900/20";default:return"text-primary-600 bg-gray-100 border-gray-300 focus:ring-primary-500 dark:focus:ring-primary-600 dark:bg-neutral-600 dark:border-gray-600"}},E=()=>A==="error"?"text-red-500 dark:text-red-400":A==="success"?"text-green-500 dark:text-green-400":A==="info"?"text-blue-500 dark:text-blue-400":"text-neutral-500 dark:text-neutral-400",T=()=>{switch(f){case"small":return"extra-small";case"large":return"medium";default:return"small"}},O=w=>{a(w.target.checked,w)},C=l.jsx(Fe.Checkbox,{...m,ref:y,id:t,checked:b,onChange:O,disabled:i,className:W("rounded focus:ring-2 focus:ring-primary-500 dark:focus:ring-primary-400 focus:ring-offset-gray-800 transition-colors duration-200",S(),v(),i&&"opacity-50 cursor-not-allowed",c),"aria-required":s,"aria-invalid":o&&A==="error"?"true":"false","aria-describedby":o?`${t}-message`:void 0}),k=e?l.jsx("label",{htmlFor:t,className:W("font-medium cursor-pointer transition-colors duration-200",i?"text-neutral-400 dark:text-neutral-600 cursor-not-allowed":"text-neutral-900 dark:text-neutral-100",p==="right"?"ml-2":"mr-2",d),children:l.jsxs(ee,{variant:"medium",size:T(),appearance:"body",children:[e,s&&l.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})}):null;return l.jsxs("div",{className:W("flex flex-col",u),children:[l.jsx("div",{className:W("flex items-center",p==="left"&&"flex-row-reverse justify-end"),children:p==="left"?l.jsxs(l.Fragment,{children:[C,k]}):l.jsxs(l.Fragment,{children:[C,k]})}),l.jsx(Ke.AnimatePresence,{children:o&&l.jsx(Ke.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${t}-message`,role:A==="error"?"alert":void 0,children:l.jsx(ee,{className:W("mt-1",E()),appearance:"custom",size:"extra-small",variant:"medium",children:o})})})]})});Jb.displayName="Checkbox";const e2=({label:t,isChecked:e,onChange:r,id:n,...a})=>l.jsxs("div",{className:"flex items-center",children:[l.jsx(Fe.Checkbox,{checked:e,onChange:r,id:n,type:"checkbox",value:"",className:"w-4 h-4 text-primary-600 bg-gray-100 border-gray-300 rounded focus:ring-primary-500 dark:focus:ring-primary-400 dark:ring-offset-gray-800 focus:ring-2 dark:!bg-neutral-600 dark:border-gray-600",...a}),l.jsx("label",{className:"ml-2 text-sm font-medium text-neutral-900 dark:text-neutral-100",children:t})]}),t2=x.forwardRef(({id:t,label:e,value:r,defaultValue:n="#000000",onChange:a,onColorChange:i,disabled:s=!1,required:o=!1,message:A,messageType:u="default",wrapperClassName:c,inputClassName:d,labelClassName:f,size:h="medium",showValue:p=!1,valueFormat:m="hex",inputProps:y,helpText:b},S)=>{const v=x.useRef(null),E=S||v,T=x.useCallback(()=>{requestAnimationFrame(()=>{E.current?.focus()})},[E]),O=x.useCallback(H=>{if(H.key==="Enter"&&!H.shiftKey){H.preventDefault();const F=H.target.closest("form");if(F){const P=F.querySelector('button[type="submit"]');P?P.click():F.requestSubmit()}}y?.onKeyDown?.(H)},[y]),C=r!==void 0?r:n,k=()=>{switch(h){case"small":return"w-8 h-8";case"large":return"w-16 h-16";default:return"w-12 h-12"}},w=()=>u==="error"?"text-red-500 dark:text-red-400":u==="success"?"text-green-500 dark:text-green-400":u==="info"?"text-blue-500 dark:text-blue-400":"text-neutral-500 dark:text-neutral-400",D=()=>u==="error"?"border-red-300 focus:border-red-500 focus:ring-red-200 dark:focus:ring-red-400/20":u==="success"?"border-green-300 focus:border-green-500 focus:ring-green-200 dark:focus:ring-green-400/20":u==="info"?"border-blue-300 focus:border-blue-500 focus:ring-blue-200 dark:focus:ring-blue-400/20":"border-neutral-300 dark:border-neutral-600 focus:border-primary-500 dark:focus:border-primary-400 focus:ring-primary-200 dark:focus:ring-primary-400/20",N=()=>{switch(h){case"small":return"extra-small";case"large":return"medium";default:return"small"}},L=H=>{const F=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(H);if(!F)return H;const P=parseInt(F[1],16),q=parseInt(F[2],16),B=parseInt(F[3],16);return`rgb(${P}, ${q}, ${B})`},I=H=>{const F=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(H);if(!F)return H;const P=parseInt(F[1],16)/255,q=parseInt(F[2],16)/255,B=parseInt(F[3],16)/255,X=Math.max(P,q,B),G=Math.min(P,q,B);let Q=0,Y=0;const j=(X+G)/2;if(X!==G){const ae=X-G;switch(Y=j>.5?ae/(2-X-G):ae/(X+G),X){case P:Q=(q-B)/ae+(q<B?6:0);break;case q:Q=(B-P)/ae+2;break;case B:Q=(P-q)/ae+4;break}Q/=6}return`hsl(${Math.round(Q*360)}, ${Math.round(Y*100)}%, ${Math.round(j*100)}%)`},_=()=>{switch(m){case"rgb":return L(C);case"hsl":return I(C);default:return C.toUpperCase()}},M=H=>{const F=H.target.value;a(F,H),i?.(F)};return l.jsxs("div",{className:W("flex flex-col w-full",c),children:[e&&l.jsx("label",{htmlFor:t,className:W("mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",f),children:l.jsx("div",{className:"flex flex-wrap items-center justify-between w-full",children:l.jsx("div",{className:"inline-flex flex-wrap items-center gap-1",children:l.jsxs(ee,{variant:"medium",size:N(),appearance:"subtitle",children:[e,o&&l.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})})})}),b&&l.jsx(ee,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:b}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"relative",children:l.jsx("input",{...y,ref:E,onBlur:T,onKeyDown:O,type:"color",id:t,value:C,onChange:M,disabled:s,required:o,className:W("border rounded-md cursor-pointer transition-all duration-200","focus:outline-none focus:ring-2",k(),D(),s&&"opacity-50 cursor-not-allowed",d),style:{backgroundColor:C},"aria-required":o,"aria-invalid":A&&u==="error"?"true":"false","aria-describedby":A||b?`${t}-description`:void 0})}),p&&l.jsx("div",{className:"flex-1",children:l.jsx(ee,{variant:"medium",size:"small",appearance:"body",className:"font-mono text-neutral-700 dark:text-neutral-300",children:_()})})]}),l.jsx(Ke.AnimatePresence,{children:A&&l.jsx(Ke.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${t}-description`,role:u==="error"?"alert":void 0,children:l.jsx(ee,{className:W("mt-1",w()),appearance:"custom",size:"extra-small",variant:"medium",children:A})})}),b&&!A&&l.jsx("div",{id:`${t}-description`,className:"sr-only",children:b})]})});t2.displayName="ColorPicker";const Bu=()=>{const[t,e]=x.useState(!1);return x.useEffect(()=>{const r=()=>{e(document.documentElement.classList.contains("dark"))};r();const n=new MutationObserver(a=>{a.forEach(i=>{i.attributeName==="class"&&r()})});return n.observe(document.documentElement,{attributes:!0}),()=>n.disconnect()},[]),t},r2=({id:t,label:e,errorMessage:r,selectOptions:n,loading:a,isClearable:i,multiSelect:s,selectedValues:o,disabled:A,required:u,value:c,className:d,tooltip:f,tags:h,originalCase:p=!1,onChange:m,filterOption:y,placeholder:b,...S})=>{const v=Bu(),[E,T]=x.useState(!1),O=(_,M)=>{m&&m(_);const H=document.getElementById(t);if(H){const F=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${t}`,value:_,type:"change"}});H.dispatchEvent(F)}},C={control:(_,M)=>({..._,borderColor:r&&u?v?"#F04438":"#fda49b":M.isFocused?"var(--color-primary-600)":v?"#434343":"#d9d9d9",backgroundColor:v?"#141414":M.isDisabled?"#f5f5f5":"#fff",borderRadius:"6px",minHeight:"32px",fontSize:"14px",padding:"0 4px 0 12px",opacity:M.isDisabled?.6:1,cursor:M.isDisabled?"not-allowed":"pointer",boxShadow:M.isFocused?v?"0 0 0 1.5px var(--color-primary-950)":"0 0 0 1.5px var(--color-primary-100)":"none","&:hover":{borderColor:r&&u?v?"#F04438":"#fda49b":"var(--color-primary-600)"}}),valueContainer:_=>({..._,fontSize:"14px",padding:0}),input:_=>({..._,margin:"0",padding:"0",color:v?"rgba(255,255,255,0.85)":"inherit"}),indicatorsContainer:_=>({..._,padding:0}),option:(_,M)=>({..._,fontSize:"14px",lineHeight:"22px",padding:"5px 12px",margin:0,backgroundColor:M.isSelected?v?"var(--color-primary-975)":"var(--color-primary-50)":M.isFocused?v?"var(--color-primary-950)":"var(--color-primary-100)":v?"#141414":"#fff",color:M.isDisabled?v?"rgba(255,255,255,0.25)":"#a3a3a3":v?M.isSelected?"var(--color-primary-600)":"rgba(255,255,255,0.85)":"rgba(0,0,0,0.88)",cursor:M.isDisabled?"not-allowed":"pointer",opacity:M.isDisabled?.6:1,"&:hover":{backgroundColor:M.isDisabled?v?"#141414":"#fff":v?"var(--color-primary-950)":"var(--color-primary-100)"},"&:active":{backgroundColor:v?"var(--color-primary-950)":"var(--color-primary-50)"}}),singleValue:(_,M)=>({..._,fontSize:"14px",lineHeight:"20px",color:M.isDisabled?v?"rgba(255,255,255,0.25)":"#a3a3a3":v?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.88)"}),placeholder:_=>({..._,fontSize:"14px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:v?"rgba(255,255,255,0.25)":"#bfbfbf"}),multiValue:_=>({..._,backgroundColor:v?"rgba(255,255,255,0.08)":"#f0f5ff",border:v?"1px solid transparent":"1px solid #adc6ff",borderRadius:"4px"}),multiValueLabel:_=>({..._,color:v?"rgba(255,255,255,0.85)":"var(--color-primary-600)",fontSize:"12px"}),multiValueRemove:_=>({..._,color:v?"rgba(255,255,255,0.85)":"var(--color-primary-600)","&:hover":{backgroundColor:v?"rgba(255,255,255,0.16)":"#e6f4ff",color:v?"#fff":"var(--color-primary-600)"}}),menu:_=>({..._,zIndex:5001,borderRadius:"8px",boxShadow:v?"0 6px 16px 0 rgba(0,0,0,0.45)":"0 6px 16px 0 rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12), 0 9px 28px 8px rgba(0,0,0,0.05)",backgroundColor:v?"#141414":"#fff",border:v?"1px solid #303030":"none",overflow:"hidden"}),menuList:_=>({..._,padding:"0",maxHeight:"256px"})},k=!!o?.length,N=E&&!A&&(i?k||!!c:!1),L=_=>{_.stopPropagation(),_.preventDefault(),O(s?[]:null)},I=()=>l.jsx("div",{className:"flex items-center",children:N?l.jsx(he.CancelRounded,{onClick:L,sx:{fontSize:"16px",cursor:"pointer",color:v?"rgba(255,255,255,0.45)":"rgba(0,0,0,0.25)","&:hover":{color:v?"rgba(255,255,255,0.65)":"rgba(0,0,0,0.45)"}}}):l.jsx(he.ChevronLeftRounded,{className:"-rotate-90",sx:{fontSize:"18px",color:v?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.25)"}})});return l.jsxs("div",{id:t,className:W("w-full flex flex-col gap-1",d),onMouseDown:_=>_.stopPropagation(),role:"group","aria-labelledby":e?t+"Label":void 0,children:[e&&l.jsxs("label",{id:t+"Label",htmlFor:"text",className:`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${p?"":"capitalize"}`,children:[l.jsx(Lt,{label:e||"",required:u||!1}),l.jsx(Sr,{labels:h}),f&&l.jsx(Fe.Tooltip,{placement:"top",title:f,children:l.jsx("div",{className:"cursor-pointer",children:l.jsx(yr,{})})})]}),l.jsx("div",{onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),children:l.jsx(lk,{...S,id:"cm"+e,classNamePrefix:"lax-select",required:u,options:n,isClearable:!1,isLoading:a,isDisabled:A,styles:C,isMulti:s,value:s?o:c,onChange:O,filterOption:y,placeholder:b,classNames:{menuList:()=>"nowheel"},components:{DropdownIndicator:I,IndicatorSeparator:()=>null}})}),r&&l.jsx(ee,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:r})]})};r2.displayName="CreatableSelectField";const qu=({ref:t,handler:e,enabled:r=!0})=>{x.useEffect(()=>{if(!r)return;const n=a=>{t.current&&!t.current.contains(a.target)&&e()};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[t,e,r])},Wk={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",850:"#1e3a8a",900:"#1e3a8a",950:"#172554",975:"#121f47"},n2=({id:t,label:e,options:r,placeholder:n,onChange:a,isLoading:i=!1,hideLabel:s=!1,errorMessage:o,required:A=!1,optionConfig:u,menuConfig:c,value:d,isMulti:f=!1,isClearable:h=!0,disabled:p=!1,className:m,isDark:y=!1,primaryColorShades:b=Wk})=>{const S=x.useRef(null),[v,E]=x.useState(null),[T,O]=x.useState("");qu({ref:S,handler:()=>{E(null)}});const C={control:(I,_)=>({...I,borderColor:o&&A?"#F04438":_.isFocused?y?b[400]:b[600]:y?"#1e1e1e":"#e2e8f0",backgroundColor:_.isDisabled?y?"#1a1a1a":"#f5f5f5":y?"#262626":"#FFFFFF",color:_.isDisabled?y?"#666666":"#a0a0a0":y?"#d4d4d4":"#0F172A",borderRadius:"6px",minHeight:"32px",fontSize:"14px",padding:"0px 10px",cursor:_.isDisabled?"not-allowed":"default",opacity:(_.isDisabled,1),boxShadow:_.isFocused?y?`0 0 0 3px ${b[950]}`:`0 0 0 3px ${b[100]}`:"none"}),valueContainer:I=>({...I,fontSize:"14px",maxHeight:"60px",overflowY:"auto",padding:"0px",margin:"0px",color:y?"#d4d4d4":"inherit","::-webkit-scrollbar":{display:"none"}}),input:I=>({...I,margin:"0"}),indicatorSeparator:()=>({display:"none"}),option:I=>({...I,fontWeight:500,fontSize:"14px",lineHeight:"1",borderBottom:y?"1px solid #1e1e1e":"1px solid #eee",backgroundColor:y?"#000000":"#FFFFFF",color:y?"#d4d4d4":"#0F172A",display:"flex",alignItems:"center",zIndex:200,":hover":{backgroundColor:y?"#171717":b[50]},".icon":{height:"14px",width:"14px"}}),singleValue:(I,_)=>({...I,fontWeight:500,fontSize:"14px",lineHeight:"1.25rem",color:(_.isDisabled,y?"#d4d4d4":"#0F172A"),display:"flex",alignItems:"center",".icon":{height:"14px",width:"14px"}}),placeholder:(I,_)=>({...I,fontSize:"14px",fontWeight:500,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:(_.isDisabled,y?"#595959":"#9CA3AF")}),multiValue:I=>({...I,backgroundColor:y?"#000000":b[50],borderRadius:"6px",fontFamily:"Inter",fontSize:"12px",height:"20px",alignItems:"center"}),indicatorsContainer:I=>({...I,padding:"0",height:"30px"}),multiValueLabel:I=>({...I,color:y?"#d4d4d4":b[600],fontSize:"12px"}),multiValueRemove:I=>({...I,color:y?"#d4d4d4":b[600],height:"12px",fontSize:"8px",":hover":{backgroundColor:y?"#171717":b[50]},svg:{height:"12px",width:"12px"}})},k=I=>{const _=r.filter(M=>M?.label?.toLowerCase()?.includes(T?.toLowerCase()));return l.jsx(Do.components.MenuList,{...I,className:W("!z-50 rounded !visible overflow-x-scroll",y?"bg-black-800":"bg-white",y?"text-neutral-300":"text-slate-900",c?.className),ref:S,children:_?.length?_.map((M,H)=>l.jsxs("div",{className:W("item z-[9999] flex items-center justify-between px-4 py-1.5 no-wheel",p?"cursor-not-allowed opacity-50":"cursor-pointer",y?"text-neutral-300":"text-slate-900",!p&&w(M)?y?"bg-black-700":"bg-primary-50":p?"":y?"hover:bg-black-700":"hover:bg-primary-50",c?.optionClassName?"":y?"border-b border-black-700":"border-b border-[#eee]"),onClick:F=>{p||(F.stopPropagation(),I.selectOption(M))},children:[u?.component?l.jsx(u.component,{...u.componentProps,...M}):l.jsx("div",{children:M.label}),l.jsx("div",{className:"flex items-center gap-1",children:w(M)&&u?.selectIndecator?u?.selectIndecator:null})]},H)):l.jsx("div",{className:W("opacity-50 flex justify-center items-center p-1 font-medium",y?"text-neutral-400":"text-gray-700"),children:"No options"})})},w=I=>f?v?.some(_=>_.value===I.value):I.value===v?.value,D=I=>{const{children:_,innerProps:M,isDisabled:H,getValue:F}=I,P=F();return l.jsx(Do.components.SingleValue,{...I,innerProps:M,isDisabled:H,children:P.length>0?P.map((q,B)=>l.jsx("span",{children:u?.component?l.jsx(u.component,{...u.componentProps,...q}):l.jsx("div",{children:q.label})},B)):l.jsx(l.Fragment,{children:_})})},N=I=>{const{innerProps:_,isDisabled:M,data:H}=I;return l.jsx(Do.components.MultiValue,{...I,innerProps:_,isDisabled:M,children:u?.component?l.jsx(u.component,{...u.componentProps,...H}):l.jsx("div",{children:H.label})})},L=(I,_)=>(O(_),!0);return l.jsxs("div",{className:W("flex flex-col",y?"text-black-300":"text-slate-900",i?"opacity-50":"opacity-100",p?"cursor-not-allowed":""),id:t,children:[s||!e?null:l.jsx(Lt,{label:e||"",required:A||!1}),l.jsx(Do,{required:!0,classNamePrefix:"lax-select",options:r,placeholder:n,value:d,onChange:I=>{E(I),a(I)},styles:C,isMulti:f,className:W(y&&"bg-black-800 border-black-700",m),components:{MenuList:k,SingleValue:D,MultiValue:N},filterOption:L,closeMenuOnSelect:!0,isClearable:h,isDisabled:p}),o&&l.jsx(ee,{className:W("mt-1",y?"text-red-400":"text-red-500"),appearance:"custom",size:"extra-small",variant:"medium",children:o})]})};n2.displayName="CustomizableSelectField";const a2=[{value:"AED",label:"UAE Dirham"},{value:"AFN",label:"Afghan Afghani"},{value:"ALL",label:"Albanian Lek"},{value:"AMD",label:"Armenian Dram"},{value:"AOA",label:"Angolan Kwanza"},{value:"ARS",label:"Argentine Peso"},{value:"AUD",label:"Australian Dollar"},{value:"AWG",label:"Aruban Florin"},{value:"AZN",label:"Azerbaijani Manat"},{value:"BBD",label:"Barbadian Dollar"},{value:"BDT",label:"Bangladeshi Taka"},{value:"BGN",label:"Bulgarian Lev"},{value:"BHD",label:"Bahraini Dinar"},{value:"BIF",label:"Burundian Franc"},{value:"BMD",label:"Bermudian Dollar"},{value:"BND",label:"Brunei Dollar"},{value:"BRL",label:"Brazilian Real"},{value:"BSD",label:"Bahamian Dollar"},{value:"BTN",label:"Bhutanese Ngultrum"},{value:"BWP",label:"Botswanan Pula"},{value:"BYN",label:"Belarusian Ruble"},{value:"BZD",label:"Belize Dollar"},{value:"CAD",label:"Canadian Dollar"},{value:"CDF",label:"Congolese Franc"},{value:"CHE",label:"WIR Euro"},{value:"CHF",label:"Swiss Franc"},{value:"CHW",label:"WIR Franc"},{value:"CLP",label:"Chilean Peso"},{value:"CNY",label:"Chinese Yuan"},{value:"COP",label:"Colombian Peso"},{value:"CRC",label:"Costa Rican Colón"},{value:"CUC",label:"Cuban Convertible Peso"},{value:"CUP",label:"Cuban Peso"},{value:"CVE",label:"Cape Verdean Escudo"},{value:"CZK",label:"Czech Koruna"},{value:"DJF",label:"Djiboutian Franc"},{value:"DKK",label:"Danish Krone"},{value:"DOP",label:"Dominican Peso"},{value:"DZD",label:"Algerian Dinar"},{value:"EGP",label:"Egyptian Pound"},{value:"ERN",label:"Eritrean Nakfa"},{value:"ESP",label:"Spanish Peseta"},{value:"ETB",label:"Ethiopian Birr"},{value:"EUR",label:"Euro"},{value:"FJD",label:"Fijian Dollar"},{value:"FKP",label:"Falkland Islands Pound"},{value:"GBP",label:"British Pound"},{value:"GEL",label:"Georgian Lari"},{value:"GHS",label:"Ghanaian Cedi"},{value:"GIP",label:"Gibraltar Pound"},{value:"GMD",label:"Gambian Dalasi"},{value:"GNF",label:"Guinean Franc"},{value:"GTQ",label:"Guatemalan Quetzal"},{value:"GYD",label:"Guyanese Dollar"},{value:"HKD",label:"Hong Kong Dollar"},{value:"HNL",label:"Honduran Lempira"},{value:"HRK",label:"Croatian Kuna"},{value:"HTG",label:"Haitian Gourde"},{value:"HUF",label:"Hungarian Forint"},{value:"IDR",label:"Indonesian Rupiah"},{value:"ILS",label:"Israeli New Shekel"},{value:"INR",label:"Indian Rupee"},{value:"IQD",label:"Iraqi Dinar"},{value:"IRR",label:"Iranian Rial"},{value:"ISK",label:"Icelandic Króna"},{value:"JMD",label:"Jamaican Dollar"},{value:"JOD",label:"Jordanian Dinar"},{value:"JPY",label:"Japanese Yen"},{value:"KES",label:"Kenyan Shilling"},{value:"KGS",label:"Kyrgyzstani Som"},{value:"KHR",label:"Cambodian Riel"},{value:"KMF",label:"Comorian Franc"},{value:"KPW",label:"North Korean Won"},{value:"KRW",label:"South Korean Won"},{value:"KWD",label:"Kuwaiti Dinar"},{value:"KYD",label:"Caymanian Dollar"},{value:"KZT",label:"Kazakhstani Tenge"},{value:"LAK",label:"Lao Kip"},{value:"LBP",label:"Lebanese Pound"},{value:"LKR",label:"Sri Lankan Rupee"},{value:"LRD",label:"Liberian Dollar"},{value:"LSL",label:"Lesotho Loti"},{value:"LTL",label:"Lithuanian Litas"},{value:"LVL",label:"Latvian Lats"},{value:"LYD",label:"Libyan Dinar"},{value:"MAD",label:"Moroccan Dirham"},{value:"MDL",label:"Moldovan Leu"},{value:"MGA",label:"Malagasy Ariary"},{value:"MKD",label:"Macedonian Denar"},{value:"MMK",label:"Myanmar Kyat"},{value:"MNT",label:"Mongolian Tögrög"},{value:"MOP",label:"Macanese Pataca"},{value:"MRU",label:"Mauritanian Ouguiya"},{value:"MUR",label:"Mauritian Rupee"},{value:"MVR",label:"Maldivian Rufiyaa"},{value:"MWK",label:"Malawian Kwacha"},{value:"MXN",label:"Mexican Peso"},{value:"MYR",label:"Malaysian Ringgit"},{value:"MZN",label:"Mozambican Metical"},{value:"NAD",label:"Namibian Dollar"},{value:"NGN",label:"Nigerian Naira"},{value:"NIO",label:"Nicaraguan Córdoba"},{value:"NOK",label:"Norwegian Krone"},{value:"NPR",label:"Nepalese Rupee"},{value:"NZD",label:"New Zealand Dollar"},{value:"OMR",label:"Omani Rial"},{value:"PAB",label:"Panamanian Balboa"},{value:"PEN",label:"Peruvian Sol"},{value:"PHP",label:"Philippine Peso"},{value:"PKR",label:"Pakistani Rupee"},{value:"PLN",label:"Polish Zloty"},{value:"PRB",label:"Transnistrian Ruble"},{value:"PYG",label:"Paraguayan Guarani"},{value:"QAR",label:"Qatari Riyal"},{value:"RON",label:"Romanian Leu"},{value:"RSD",label:"Serbian Dinar"},{value:"RUB",label:"Russian Ruble"},{value:"RWF",label:"Rwandan Franc"},{value:"SAR",label:"Saudi Riyal"},{value:"SCR",label:"Seychellois Rupee"},{value:"SDG",label:"Sudanese Pound"},{value:"SEK",label:"Swedish Krona"},{value:"SGD",label:"Singapore Dollar"},{value:"SHP",label:"Saint Helena Pound"},{value:"SLL",label:"Sierra Leonean Leone"},{value:"SOS",label:"Somali Shilling"},{value:"SRD",label:"Surinamese Dollar"},{value:"SSP",label:"South Sudanese Pound"},{value:"SVC",label:"Salvadoran Colón"},{value:"SYP",label:"Syrian Pound"},{value:"SZL",label:"Swazi Lilangeni"},{value:"THB",label:"Thai Baht"},{value:"TJS",label:"Tajikistani Somoni"},{value:"TMT",label:"Turkmenistani Manat"},{value:"TND",label:"Tunisian Dinar"},{value:"TOP",label:"Tongan Paʻanga"},{value:"TRY",label:"Turkish Lira"},{value:"TWD",label:"New Taiwan Dollar"},{value:"TZS",label:"Tanzanian Shilling"},{value:"UAH",label:"Ukrainian Hryvnia"},{value:"UGX",label:"Ugandan Shilling"},{value:"USD",label:"United States Dollar"},{value:"UYU",label:"Uruguayan Peso"},{value:"UZS",label:"Uzbekistani Som"},{value:"VEF",label:"Venezuelan Bolívar"},{value:"VND",label:"Vietnamese Dong"},{value:"VUV",label:"Vanuatu Vatu"},{value:"WST",label:"Samoan Tala"},{value:"YER",label:"Yemeni Rial"},{value:"ZAR",label:"South African Rand"},{value:"ZMW",label:"Zambian Kwacha"},{value:"ZWL",label:"Zimbabwean Dollar"}],i2={AED:"د.إ",AFN:"؋",ALL:"Lek",AMD:"դր",ANG:"ƒ",AOA:"Kz",ARS:"$",AUD:"$",AWG:"ƒ",AZN:"₼",BAM:"KM",BBD:"$",BDT:"৳",BGN:"лв",BHD:".د.ب",BIF:"Fr",BMD:"$",BND:"$",BOB:"Bs.",BOV:"Bs.",BRL:"R$",BSD:"$",BTN:"Nu.",BWP:"P",BYN:"Br",BZD:"$",CAD:"$",CDF:"Fr",CHE:"Fr",CHF:"Fr",CHW:"Fr",CLP:"$",CNY:"¥",COP:"$",CRC:"₡",CUC:"$",CUP:"₱",CVE:"$",CZK:"Kč",DJF:"Fr",DKK:"kr",DOP:"$",DZD:"د.ج",EGP:"£",ERN:"Nkf",ESP:"₧",ETB:"Br",EUR:"€",FJD:"$",FKP:"£",GBP:"£",GEL:"₾",GHS:"₵",GIP:"£",GMD:"D",GNF:"Fr",GTQ:"Q",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"₪",INR:"₹",IQD:"ع.د",IRR:"ریال",ISK:"kr",JMD:"$",JOD:"د.ا",JPY:"¥",KES:"Sh",KGS:"лв",KHR:"៛",KMF:"Fr",KPW:"₩",KRW:"₩",KWD:"د.ك",KYD:"$",KZT:"₸",LAK:"₭",LBP:"ل.ل",LKR:"₨",LRD:"$",LSL:"M",LTL:"Lt",LVL:"Ls",LYD:"د.ل",MAD:"د.م.",MDL:"lei",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"P",MRU:"UM",MUR:"₨",MVR:"Rf",MWK:"MK",MXN:"$",MYR:"RM",MZN:"MT",NAD:"$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",OMR:"ر.ع.",PAB:"B/.",PEN:"S/",PGK:"K",PHP:"₱",PKR:"₨",PLN:"zł",PRB:"₽",PYG:"₲",QAR:"ر.ق",RON:"lei",RSD:"дин.",RUB:"₽",RWF:"Fr",SAR:"ر.س",SBD:"$",SCR:"₨",SDG:"ج.س.",SEK:"kr",SGD:"$",SHP:"£",SLL:"Le",SOS:"Sh",SRD:"$",SSP:"£",STN:"Db",SVC:"$",SYP:"ل.س",SZL:"L",THB:"฿",TJS:"SM",TMT:"m",TND:"د.ت",TOP:"T$",TRY:"₺",TTD:"$",TWD:"NT$",TZS:"Sh",UAH:"₴",UGX:"Sh",USD:"$",UYU:"$",UZS:"сўм",VEF:"Bs.F",VND:"₫",VUV:"Vt",WST:"T",XAF:"Fr",XAG:"XAG",XAU:"XAU",XBA:"XBA",XBB:"XBB",XBC:"XBC",XBD:"XBD",XCD:"$",XDR:"XDR",XOF:"Fr",XPD:"XPD",XPF:"₣",XPT:"XPT",XSU:"XSU",XTS:"XTS",XUA:"XUA",YER:"ر.ي",ZAR:"R",ZMW:"K",ZWL:"$"},Ho=({classValue:t,size:e=24,fill:r="currentColor",...n})=>l.jsxs("svg",{className:W(t),width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[l.jsx("rect",{width:"12",height:"12",rx:"6",fill:r}),l.jsx("g",{clipPath:"url(#clip0_8212_362816)",children:l.jsx("path",{d:"M8.10023 3.90357C7.97023 3.77357 7.76023 3.77357 7.63023 3.90357L6.00023 5.53023L4.37023 3.90023C4.24023 3.77023 4.03023 3.77023 3.90023 3.90023C3.77023 4.03023 3.77023 4.24023 3.90023 4.37023L5.53023 6.00023L3.90023 7.63023C3.77023 7.76023 3.77023 7.97023 3.90023 8.10023C4.03023 8.23023 4.24023 8.23023 4.37023 8.10023L6.00023 6.47023L7.63023 8.10023C7.76023 8.23023 7.97023 8.23023 8.10023 8.10023C8.23023 7.97023 8.23023 7.76023 8.10023 7.63023L6.47023 6.00023L8.10023 4.37023C8.2269 4.24357 8.2269 4.03023 8.10023 3.90357Z",fill:"#98A2B3"})}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_8212_362816",children:l.jsx("rect",{width:"8",height:"8",fill:"white",transform:"translate(2 2)"})})})]});Ho.displayName="CloseRounded";const s2=({width:t=15,height:e=15,fill:r="#98A2B3",className:n})=>l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:t.toString(),height:e.toString(),viewBox:"0 0 20 20",fill:"none",className:n,children:l.jsx("path",{d:"M17.5 17.5L12.5001 12.5M14.1667 8.33333C14.1667 11.555 11.555 14.1667 8.33333 14.1667C5.11167 14.1667 2.5 11.555 2.5 8.33333C2.5 5.11167 5.11167 2.5 8.33333 2.5C11.555 2.5 14.1667 5.11167 14.1667 8.33333Z",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),Vu=t=>{const{value:e,placeholder:r,onChange:n,id:a,debounceTimeout:i=0,classValues:s,handleKeyDown:o,isClearable:A,onFocusText:u,autoComplete:c="false",searchRef:d,hasNavigation:f=!1,autoFocus:h=!1,searchConfig:p,hideSearchIcon:m,allowAStarSearch:y=!1,...b}=t,{t:S}=kt.useTranslation(),[v,E]=x.useState(!1),[T,O]=x.useState("search"),C=x.useRef(null),{searchCount:k,searchPointer:w,setSearchPointer:D}=p||{},N=()=>{E(!0),O(u||r||S("Search"));const I=d||C;I.current&&I.current.focus()},L=()=>{E(!1),O("")};return l.jsxs("label",{className:W("relative flex items-center justify-start px-4 py-[9px] w-full dark:bg-neutral-900 bg-white dark:bg-black-700 rounded-lg text-neutral-400 h-8",s),children:[!m&&l.jsx("div",{className:"flex items-center h-6 w-6 pointer-events-none",children:l.jsx(s2,{width:"16",height:"16"})}),l.jsx(wu.DebounceInput,{...b,spellCheck:"false",debounceTimeout:i,id:a,inputRef:d||C,type:"text",className:W(`absolute inset-0 dark:text-[#98A2B3] text-neutral-900 ${m?"pl-2":"pl-10"} pl-10 pr-7 w-full text-sm dark:text-white bg-transparent rounded-lg focus:outline-none focus:ring-primary-500 focus:border-primary-500`,"border border-solid","dark:border-neutral-800 border-neutral-200","dark:caret-white",s),onKeyDown:I=>{I.key==="Enter"&&I.preventDefault(),o&&o(I)},value:e||"",placeholder:v?T:y?"":`${S("Search")}`,onChange:I=>n?.(I.target.value),autoComplete:c,onFocus:I=>{E(!0),N(),t.onFocus&&t.onFocus(I)},onBlur:I=>{E(!1),L(),t.onBlur&&t.onBlur(I)},autoFocus:h}),f&&e&&l.jsxs("div",{className:W("absolute mr-2 focus:outline-none flex gap-1",A?"right-6":"right-0"),children:[!!k&&(k||0)>0&&l.jsxs("span",{className:"text-xs border-r pr-2 border-gray-200",children:[(w||0)+1,"/",k]}),l.jsxs("div",{className:"flex gap-1 items-center",children:[l.jsx("button",{id:"btn-search-bar-set-search-pointer-forward",onClick:()=>{D&&D(I=>(I||0)-1)},disabled:w===0,children:l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M15 18l-6-6 6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),l.jsx("button",{id:"btn-search-bar-set-search-pointer-backward",onClick:()=>{D&&D(I=>(I||0)+1)},disabled:w===(k||0)-1,children:l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M9 18l6-6-6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),y&&!(A&&e)&&!v&&!e?l.jsxs("div",{className:"absolute flex ml-6 items-center justify-center focus:outline-none gap-1 flex-wrap-none",children:[l.jsxs(ee,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:[S("Search")," (use"]}),l.jsx("button",{className:" bg-[#EAECF0] dark:bg-black-800 rounded-sm text-sm w-3 h-5",children:l.jsx(Fe.Tooltip,{placement:"bottomRight",color:"#141414",classNames:{root:"custom-tooltip dark:!bg-black-800"},title:l.jsxs("div",{className:"flex flex-col items-start justify-center p-2 w-full h-full gap-2 dark:bg-black-800",children:[l.jsx(ee,{className:"text-white text-lg font-semibold leading-5",children:S("Normal Search")}),l.jsx(ee,{className:"text-primary-300 dark:text-primary-300 text-sm font-bold leading-[18px] font-inter",appearance:"custom",children:S("Examples")}),l.jsxs("div",{className:"flex flex-col items-start justify-center ",children:[l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:l.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"data"})}),l.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "data", "Data".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:l.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"text"})}),l.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "text", "context", "plaintext".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:l.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"base"})}),l.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "database", "baseball", "basename".'})]})]}),l.jsx(ee,{className:"text-white text-lg font-semibold leading-5 mt-2",children:"Wildcard Search"}),l.jsx(ee,{className:"text-white dark:text-black-200 text-sm font-medium leading-[18px] font-inter",appearance:"custom",children:"Use * as a wildcard to refine your search."}),l.jsx(ee,{className:"text-primary-300 dark:text-primary-300 text-sm font-bold leading-[18px] font-inter",appearance:"custom",children:"Examples:"}),l.jsxs("div",{className:"flex flex-col items-start justify-center ",children:[l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:l.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ",children:"contract*"})}),l.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ "contracts", "contractor", "CONTRACTOR".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:l.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ",children:"*agreement"})}),l.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "service agreement", "legal agreement".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:l.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"*clause*"})}),l.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "clause", "subclause", "clauses".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:l.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"*l*s*"})}),l.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "clause", "clauses".'})]})]})]}),children:l.jsx("div",{className:"text-[#475467] dark:text-black-300 dark:bg-black-600",children:"*"})})}),l.jsx(ee,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:"as a wildcard)"})]}):A&&e&&l.jsx("button",{id:"btn-search-bar-close",className:"absolute right-0 mr-2 focus:outline-none",onClick:()=>n?.(""),children:l.jsx(Ho,{classValue:"text-neutral-200 dark:text-black-500",size:16})})]})};var Ka=(t=>(t.LEFT="left",t.RIGHT="right",t.TOP="top",t))(Ka||{});const Xk=(t,e,r,n="medium")=>{const a={small:"w-7 h-4 after:h-3 after:w-3 after:top-0.5 after:left-0.5",medium:"w-9 h-5 after:h-4 after:w-4 after:top-0.5 after:left-0.5",large:"w-11 h-6 after:h-5 after:w-5 after:top-0.5 after:left-0.5"},i={small:"peer-checked:after:translate-x-3",medium:"peer-checked:after:translate-x-full",large:"peer-checked:after:translate-x-5"};return W("p-0.5 rounded-full peer after:content-[''] after:absolute after:rounded-full after:transition-all bg-gray-200 dark:bg-black-400 peer-focus-visible:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-primary-500 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-white dark:peer-focus-visible:ring-primary-400 dark:peer-focus-visible:ring-offset-black-900 peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-100)] dark:peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-950)]",a[n],i[n],{"peer-checked:bg-primary-600 dark:peer-checked:bg-primary-700 peer-checked:after:translate-x-full after:bg-white dark:after:bg-primary-500":t,"after:bg-white dark:after:bg-black-500":!t,"text-white dark:text-black-900":e,"cursor-not-allowed opacity-70":r})},Qk=({size:t=18,fill:e="#016DCF"})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:l.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:e})}),jk=({size:t=18,fill:e="#101828"})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:l.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z",fill:e})}),kn=x.forwardRef(({isGTN:t=!1,isChecked:e,id:r,onChange:n,label:a,required:i,isRequiredConditional:s=!1,hideStatus:o=!1,labelDirection:A=Ka.TOP,statusText:u,withIcon:c=!1,tags:d,isAiExtracted:f=!1,tooltip:h="",className:p="",isDisabled:m=!1,icon:y,stopClickPropagation:b=!0,gtnName:S,variant:v="primary",labelClassName:E,isLiveField:T=!1,message:O,messageType:C="default",wrapperClassName:k,helpText:w,size:D="medium",renderGTNAddButton:N,onAddGTNToDocument:L},I)=>{const{t:_}=kt.useTranslation(),M=A===Ka.TOP,H=A===Ka.LEFT,F=A===Ka.RIGHT,[P,q]=x.useState(!1),B=()=>{L&&L({key:S,value:e?"Yes":"No"})},X=()=>C==="error"?"text-red-500 dark:text-red-400":C==="success"?"text-green-500 dark:text-green-400":C==="info"?"text-primary-500 dark:text-primary-400":"text-neutral-500 dark:text-neutral-400";return l.jsxs("div",{className:W("flex gap-0.5",P&&t?"border rounded-lg border-primary-100 bg-primary-50 p-1":"",k),onMouseEnter:()=>q(!0),onMouseLeave:()=>q(!1),onClick:G=>{b&&G.stopPropagation()},children:[t&&!P?l.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-pulse mt-1.5"}):null,l.jsxs("div",{className:"w-full flex flex-col",children:[M&&a&&l.jsxs("div",{className:"w-full flex justify-between flex-wrap",children:[l.jsxs("h1",{className:W("mb-1 font-inter text-neutral-600 font-medium text-xs flex items-center gap-0.5 flex-wrap",E),children:[l.jsx(Lt,{label:a||"",required:i||!1,isRequiredConditional:s||!1}),T&&l.jsx(he.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),f&&l.jsx(Vr,{}),l.jsx(Sr,{labels:d||[]}),h&&l.jsx(Me,{placement:"top",title:h,children:l.jsx("div",{className:"cursor-pointer",children:l.jsx(yr,{})})})]}),t&&P?N?N(B):l.jsx("button",{id:"btn-toggle-add-to-document",className:"cursor-pointer",onClick:B,type:"button",children:l.jsx(Fe.Tooltip,{placement:"top",title:_("Add to document"),children:l.jsx(he.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]}),w&&l.jsx(ee,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:w}),l.jsxs("div",{className:"flex",children:[H&&l.jsx(ee,{size:"small",variant:"medium",className:W("mr-2 text-neutral-700 dark:text-black-200",E),appearance:"custom",children:a}),l.jsxs("label",{className:W("relative inline-flex items-center",F||u?"":"w-min",m?"cursor-not-allowed opacity-50":"cursor-pointer"),onClick:G=>G.stopPropagation(),children:[l.jsx("input",{ref:I,type:"checkbox",id:r,onChange:G=>!m&&n(G.target.checked),value:"",disabled:m,checked:e,className:W("sr-only peer w-full",p),"aria-required":i,"aria-invalid":O&&C==="error"?"true":"false","aria-describedby":O||w?`${r}-description`:void 0}),l.jsx("div",{className:Xk(e,c,m,D),children:c?l.jsx("div",{className:"flex items-center justify-center h-full w-full",children:l.jsx("div",{className:W("z-10 transition-all transform",D==="small"&&(e?"translate-x-2":"translate-x-[-6px]"),D==="medium"&&(e?"translate-x-[8.5px]":"translate-x-[-8px]"),D==="large"&&(e?"translate-x-2.5":"translate-x-[-10px]")),children:e?y?.checkedIcon?y.checkedIcon:l.jsx(Qk,{size:18,fill:"#016DCF"}):y?.uncheckedIcon?y.uncheckedIcon:l.jsx(jk,{size:18,fill:"#101828"})})}):null}),F&&l.jsx(ee,{size:"small",variant:"medium",className:W("ml-2 text-neutral-700 dark:text-black-300",E),appearance:"custom",children:a}),o?null:l.jsx(ee,{size:"small",variant:"medium",className:"ml-2 text-neutral-900 dark:text-black-100",appearance:"custom",children:u||(e?"Yes":"No")})]})]}),l.jsx(Ke.AnimatePresence,{children:O&&l.jsx(Ke.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${r}-description`,role:C==="error"?"alert":void 0,children:l.jsx(ee,{className:W("mt-1",X()),appearance:"custom",size:"extra-small",variant:"medium",children:O})})}),w&&!O&&l.jsx("div",{id:`${r}-description`,className:"sr-only",children:w})]})]})});kn.displayName="Toggle";const Gk=t=>{try{return JSON.parse(t)}catch{return null}},Yk=t=>{let e="";const r="0123456789abcdef";for(let n=0;n<t;n++)e+=r.charAt(Math.floor(Math.random()*r.length));return e},Kk=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Zk=t=>{const e=[...t].sort((n,a)=>n.length-a.length),r=[];for(const n of e)r.some(i=>n!==i&&n.startsWith(i+"."))||r.push(n);return r},Za=t=>{let e="";if(t){let r=0;Object.keys(t).forEach(n=>{if(t[n]!==void 0&&t[n]!==null&&t[n]!==""){let a=t[n];typeof a=="object"?a=JSON.stringify(a):Array.isArray(a)&&(a=a.join(",")),a!=null&&a!==""&&(r===0?e+=`?${n}=${encodeURIComponent(a)}`:e+=`&${n}=${encodeURIComponent(a)}`,r+=1)}})}return e},o2=({shortcuts:t,variant:e="dark",className:r})=>{const a=Qi()==="macos",i=x.useMemo(()=>t.map(s=>{const o=_o[s];return o?a?o.macos:o.other:s}),[t,a]);return l.jsx("div",{className:W("flex flex-1 gap-1",r),children:i.map((s,o)=>l.jsx("kbd",{className:W("flex items-center rounded-[3px] px-1.5 py-[2px] min-w-[26px] justify-center text-xs font-medium",{"bg-neutral-800 text-white":e==="dark","bg-neutral-100 text-neutral-500 dark:bg-neutral-800 dark:text-white":e==="light"}),children:s},o))})},$k=({className:t="",fill:e="var(--color-primary-600)",size:r=24})=>l.jsx("svg",{className:t,width:r,height:r,viewBox:"0 0 20 20",fill:e,xmlns:"http://www.w3.org/2000/svg",children:l.jsx("g",{mask:"url(#mask0_6752_28309)",children:l.jsx("path",{d:"M8.33317 11.3333L13.2498 6.41667C13.4026 6.26389 13.5971 6.1875 13.8332 6.1875C14.0693 6.1875 14.2637 6.26389 14.4165 6.41667C14.5693 6.56944 14.6457 6.76389 14.6457 7C14.6457 7.23611 14.5693 7.43056 14.4165 7.58333L8.9165 13.0833C8.74984 13.25 8.55539 13.3333 8.33317 13.3333C8.11095 13.3333 7.9165 13.25 7.74984 13.0833L5.58317 10.9167C5.43039 10.7639 5.354 10.5694 5.354 10.3333C5.354 10.0972 5.43039 9.90278 5.58317 9.75C5.73595 9.59722 5.93039 9.52083 6.1665 9.52083C6.40262 9.52083 6.59706 9.59722 6.74984 9.75L8.33317 11.3333Z",fill:e})})}),or=({id:t,onClick:e,icon:r,text:n,className:a,isDisabled:i,onClose:s,notVisible:o,hideHoverEffect:A,leadingIcon:u,suffixRecord:c,stopPropagation:d,onToggle:f,isChecked:h=!1,highlight:p,truncateText:m=!1,showTick:y=!1,width:b="100%",tooltip:S,isFlowAvailable:v=!0,shortcuts:E,textClassName:T})=>{const O=x.useCallback(N=>{s&&s(),N.preventDefault(),e?.(N),d&&N.stopPropagation()},[s,e,d]),C=(N,L)=>{if(!L||!N||typeof N!="string"&&typeof N!="number")return N;const I=Kk(L),_=new RegExp(`(${I?.trim()})`,"gi"),M=N?.toString()?.split(_);return l.jsxs("span",{className:"overflow-clip text-ellipsis",children:[M[0],l.jsx("span",{className:"bg-yellow-300 dark:bg-primary-100 dark:text-black-900 rounded-sm",children:M[1]}),M?.slice(2)?.join("")]})},k=x.useCallback(N=>{f?.(),N.stopPropagation()},[f]),w=["delete","remove","clear","terminate session","terminate sessions","terminate all sessions"].some(L=>n?.toLowerCase().includes(L)),D=i||!v;return o?null:l.jsx("button",{id:t,className:W("w-full p-1 bg-white dark:bg-black-800 group",a,D&&"opacity-60"),onClick:f?()=>null:O,disabled:D,onMouseMove:N=>N.stopPropagation(),children:l.jsxs("div",{className:W("flex w-full justify-start items-center gap-2 px-2 py-1 rounded-lg transition-all duration-300 ease-in-out",!A&&"hover:bg-gray-50 dark:hover:bg-black-600 hover:shadow-md dark:hover:shadow-lg dark:hover:shadow-primary-500/20"),children:[r?l.jsx("div",{className:W("h-5 w-5 flex-shrink-0 flex items-center text-neutral-900 dark:text-white transition-colors duration-300 ease-in-out",w?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:l.jsx(Me,{placement:"top",title:S,children:r})}):null,l.jsxs("div",{className:"flex gap-2 flex-1 min-w-0 text-left justify-between items-center",children:[l.jsx("div",{className:W("flex-1 min-w-0",m&&"max-w-[150px]"),style:{width:b},children:l.jsx(ee,{className:W("font-medium text-sm truncate transition-colors duration-300 ease-in-out",w?"group-hover:!text-red-600":"group-hover:!text-primary-600 dark:group-hover:!text-primary-400",T),appearance:"custom",children:p?C(n,p):n})}),c?.[n]?l.jsx("span",{className:"flex-shrink-0 text-neutral-500 dark:text-neutral-200 bg-neutral-100 dark:bg-black-700 border-[#D0D5DD] dark:border-black-700 text-xs leading-[18px] font-normal border rounded-full px-2 py-0.5",children:c[n]||""}):null,y?l.jsx("div",{className:"flex-shrink-0",children:l.jsx($k,{fill:"var(--color-primary-600)"})}):null]}),u?l.jsx(l.Fragment,{children:S?l.jsx(Me,{placement:"top",title:S,children:l.jsx("div",{className:W("flex-shrink-0 transition-colors duration-300 ease-in-out",w?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:u})}):l.jsx("div",{className:W("flex-shrink-0 transition-colors duration-300 ease-in-out",w?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:u})}):null,E?l.jsx("div",{className:"flex items-center justify-end",children:l.jsx(o2,{variant:"light",shortcuts:E})}):null,f?l.jsx("div",{className:"flex-shrink-0",children:l.jsx(kn,{onChange:k,isChecked:h,isDisabled:i,hideStatus:!0})}):null]})})};or.displayName="OptionButton";const Ro=(t,e)=>{const r=t.slice(0,2),n=Wi[r];return n?l.jsx("div",{className:`
|
|
50
|
+
`,document.head.appendChild(fe)},[]);const Re=()=>{if(q){let ie="";Te==null?ie="":typeof Te=="string"||typeof Te=="number"?ie=String(Te):Array.isArray(Te)?ie=Te.map(ye=>typeof ye=="object"&&ye!==null&&"value"in ye?ye.value:ye).join(", "):typeof Te=="object"&&"value"in Te&&(ie=String(Te.value)),q({key:h,value:ie})}},Te=Uk(e),$=x.useMemo(()=>m?Ak(m,y):null,[m,y]),te=(ie,fe)=>{if(se.current&&G.id){const ye=document.getElementById(G.id);if(ye){const ke=Array.isArray(fe)?fe.map(at=>at.value):fe?.value;ye.dataset.selectedValue=JSON.stringify(ke);const je=new Event("change",{bubbles:!0});Object.defineProperty(je,"target",{writable:!1,value:ye}),ye.dispatchEvent(je);const $e=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${G.id}`,value:ke,type:"change"}});ye.dispatchEvent($e)}}if(r==="tags"){const ye=Array.isArray(ie)?ie:[ie];p?.(ye?.map(ke=>({label:ke,value:ke})))}else p?.(fe)},oe=Bk({options:a,value:e,defaultValue:G?.defaultValue}),Le=x.useMemo(()=>oe.length>0||Te!=null,[oe,Te]),Ie=x.useMemo(()=>{if(!r||r!=="multiple"||oe.length===0)return!1;const ie=Array.isArray(Te)?Te:[];return oe.map(ye=>ye.value).every(ye=>ie.some(ke=>typeof ke=="object"&&ke!==null&&"value"in ke?String(ke.value)===String(ye):String(ke)===String(ye)))},[Te,oe,r]),Ye=()=>{!r||r!=="multiple"||!p||p(Ie?[]:oe)},Pe=x.useCallback(ie=>{if(!ie)return;const fe=new Event("submit",{bubbles:!0,cancelable:!0});ie.dispatchEvent(fe);const ye=ie.querySelector('button[type="submit"]');ye&&ye.click()},[]),Qe=x.useCallback(ie=>{if(ie.key==="Enter"&&!le&&(ie.preventDefault(),ie.stopPropagation(),Te)){const fe=ie.currentTarget.closest("form");Pe(fe)}},[le,Te,Pe]),At=x.useCallback(ie=>{const{label:fe,value:ye,onClose:ke}=ie,$e=oe.find(Ot=>String(Ot.value)===String(ye))?.color||"blue",at=Ot=>{Ot.preventDefault(),Ot.stopPropagation()};return l.jsx("div",{className:"cursor-pointer me-1 inline-flex",children:l.jsx(Kt,{label:fe,color:$e,size:"sm",onMouseDown:at,onClick:D?void 0:ke,isHashColor:!0,removable:!0,onRemove:ke})})},[oe,D]),de=x.useCallback(ie=>{Ce(ie),(A||$)?.(ie)},[A,$]);return l.jsxs("div",{ref:Q,className:W("flex gap-0.5 w-full relative",j&&f?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>ae(!0),onMouseLeave:()=>ae(!1),id:G.id,children:[f&&!j?l.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,l.jsxs("div",{className:W("w-full flex flex-col gap-1 risk-analysis-select-field",o),onMouseDown:ie=>ie.stopPropagation(),onKeyDownCapture:Qe,role:"group","aria-labelledby":t?"select-field-label":void 0,children:[t?l.jsx("label",{id:"select-field-label",htmlFor:"label",className:`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${c?"":"capitalize"} ${L||""}`,children:l.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[l.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[l.jsx(Lt,{label:t||"",required:i||!1,isRequiredConditional:B||!1}),X&&l.jsx(he.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),d&&l.jsx(Vr,{}),l.jsx(Sr,{labels:s}),u&&l.jsx(Me,{placement:"top",title:u,children:l.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onKeyDown:ie=>{(ie.key==="Enter"||ie.key===" ")&&ie.preventDefault()},children:l.jsx(yr,{})})})]}),f&&j?l.jsx("button",{id:"btn-select-field-base-add-to-document",className:"cursor-pointer",onClick:Re,type:"button",children:l.jsx(Me,{placement:"top",title:Y("Add to document"),children:l.jsx(he.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}):null,l.jsx(Fe.Select,{onOpenChange:Ee,disabled:D,className:`w-full text-black-900 dark:text-black-200 ${n&&i?"ant-select-status-error":"#e2e8f0"} ${_&&I?.color?"risk-select-field":""}`,classNames:{popup:{root:"!z-[5001]"}},style:{width:"100%","--risk-color":_&&I?.hexBgColor?I?.hexBgColor:"","--risk-border-color":_&&I?.hexBorderColor?I?.hexBorderColor:""},"aria-required":i,mode:r,value:Te,onChange:te,filterOption:m?b:(ie,fe)=>(fe?.label||"")?.toLowerCase()?.includes(ie?.toLowerCase()),showSearch:!0,onSearch:de||void 0,onPopupScroll:S,popupClassName:"select-field-dropdown-popup",popupRender:ie=>l.jsx(Vk,{showSelectAll:N,mode:r,options:oe,searchValue:ge,handleSelectAll:Ye,isAllSelected:Ie,menu:ie,isLoading:v,hasExistingData:Le,t:Y}),options:oe.map(({label:ie,value:fe,color:ye,...ke})=>({label:String(ie),value:String(fe),key:String(fe),id:String(fe),color:ye,...ke})),optionRender:ie=>{const fe=ie?.data?.fullname;if(fe&&P){const[ye,ke]=fe.split(" ");return l.jsxs("div",{className:"flex items-center justify-start gap-1",children:[l.jsx(P,{firstName:ye,lastName:ke,profilePic:ie?.data?.url||"",size:"xs",enablePopper:!0,userId:ie?.data?.value}),l.jsx("span",{className:"ml-2",children:ie.label})]})}return l.jsx("span",{children:ie.label})},autoClearSearchValue:T,onClear:()=>p&&p(r==="tags"||r==="multiple"?[]:null),maxTagCount:r==="tags"&&C?void 0:"responsive",maxTagPlaceholder:ie=>l.jsx(Me,{placement:"top",title:ie.length>3?ie.slice(0,3).map(({label:fe})=>fe).join(", ")+"...":ie.map(({label:fe})=>fe).join(", "),children:l.jsxs("span",{children:["+",ie.length," more"]})}),tagRender:k||At,allowClear:E,...G}),n&&l.jsx(ee,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:n})]}),j&&I&&_&&M&&l.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:ie=>ie.stopPropagation(),onMouseDown:ie=>ie.preventDefault(),onKeyDown:ie=>{ie.key==="Escape"&&ae(!1)},children:l.jsx(M,{riskDetails:I})})]})});Mo.displayName="SelectField";const Jb=x.forwardRef(({id:t,label:e,checked:r,isChecked:n,onChange:a,disabled:i=!1,required:s=!1,message:o,messageType:A="default",wrapperClassName:u,checkboxClassName:c,labelClassName:d,size:f="medium",variant:h="default",labelPosition:p="right",checkboxProps:m},y)=>{const b=r!==void 0?r:n||!1,S=()=>{switch(f){case"small":return"w-3 h-3";case"large":return"w-5 h-5";default:return"w-4 h-4"}},v=()=>{if(A==="error")return"text-red-600 border-red-300 focus:ring-red-500 dark:focus:ring-red-600";if(A==="success")return"text-green-600 border-green-300 focus:ring-green-500 dark:focus:ring-green-600";if(A==="info")return"text-blue-600 border-blue-300 focus:ring-blue-500 dark:focus:ring-blue-600";switch(h){case"outline":return"text-primary-600 bg-transparent border-neutral-300 focus:ring-primary-500 dark:focus:ring-primary-600";case"solid":return"text-primary-600 bg-primary-50 border-primary-300 focus:ring-primary-500 dark:focus:ring-primary-600 dark:bg-primary-900/20";default:return"text-primary-600 bg-gray-100 border-gray-300 focus:ring-primary-500 dark:focus:ring-primary-600 dark:bg-neutral-600 dark:border-gray-600"}},E=()=>A==="error"?"text-red-500 dark:text-red-400":A==="success"?"text-green-500 dark:text-green-400":A==="info"?"text-blue-500 dark:text-blue-400":"text-neutral-500 dark:text-neutral-400",T=()=>{switch(f){case"small":return"extra-small";case"large":return"medium";default:return"small"}},O=w=>{a(w.target.checked,w)},C=l.jsx(Fe.Checkbox,{...m,ref:y,id:t,checked:b,onChange:O,disabled:i,className:W("rounded focus:ring-2 focus:ring-primary-500 dark:focus:ring-primary-400 focus:ring-offset-gray-800 transition-colors duration-200",S(),v(),i&&"opacity-50 cursor-not-allowed",c),"aria-required":s,"aria-invalid":o&&A==="error"?"true":"false","aria-describedby":o?`${t}-message`:void 0}),k=e?l.jsx("label",{htmlFor:t,className:W("font-medium cursor-pointer transition-colors duration-200",i?"text-neutral-400 dark:text-neutral-600 cursor-not-allowed":"text-neutral-900 dark:text-neutral-100",p==="right"?"ml-2":"mr-2",d),children:l.jsxs(ee,{variant:"medium",size:T(),appearance:"body",children:[e,s&&l.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})}):null;return l.jsxs("div",{className:W("flex flex-col",u),children:[l.jsx("div",{className:W("flex items-center",p==="left"&&"flex-row-reverse justify-end"),children:p==="left"?l.jsxs(l.Fragment,{children:[C,k]}):l.jsxs(l.Fragment,{children:[C,k]})}),l.jsx(Ke.AnimatePresence,{children:o&&l.jsx(Ke.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${t}-message`,role:A==="error"?"alert":void 0,children:l.jsx(ee,{className:W("mt-1",E()),appearance:"custom",size:"extra-small",variant:"medium",children:o})})})]})});Jb.displayName="Checkbox";const e2=({label:t,isChecked:e,onChange:r,id:n,...a})=>l.jsxs("div",{className:"flex items-center",children:[l.jsx(Fe.Checkbox,{checked:e,onChange:r,id:n,type:"checkbox",value:"",className:"w-4 h-4 text-primary-600 bg-gray-100 border-gray-300 rounded focus:ring-primary-500 dark:focus:ring-primary-400 dark:ring-offset-gray-800 focus:ring-2 dark:!bg-neutral-600 dark:border-gray-600",...a}),l.jsx("label",{className:"ml-2 text-sm font-medium text-neutral-900 dark:text-neutral-100",children:t})]}),t2=x.forwardRef(({id:t,label:e,value:r,defaultValue:n="#000000",onChange:a,onColorChange:i,disabled:s=!1,required:o=!1,message:A,messageType:u="default",wrapperClassName:c,inputClassName:d,labelClassName:f,size:h="medium",showValue:p=!1,valueFormat:m="hex",inputProps:y,helpText:b},S)=>{const v=x.useRef(null),E=S||v,T=x.useCallback(()=>{requestAnimationFrame(()=>{E.current?.focus()})},[E]),O=x.useCallback(H=>{if(H.key==="Enter"&&!H.shiftKey){H.preventDefault();const F=H.target.closest("form");if(F){const P=F.querySelector('button[type="submit"]');P?P.click():F.requestSubmit()}}y?.onKeyDown?.(H)},[y]),C=r!==void 0?r:n,k=()=>{switch(h){case"small":return"w-8 h-8";case"large":return"w-16 h-16";default:return"w-12 h-12"}},w=()=>u==="error"?"text-red-500 dark:text-red-400":u==="success"?"text-green-500 dark:text-green-400":u==="info"?"text-blue-500 dark:text-blue-400":"text-neutral-500 dark:text-neutral-400",D=()=>u==="error"?"border-red-300 focus:border-red-500 focus:ring-red-200 dark:focus:ring-red-400/20":u==="success"?"border-green-300 focus:border-green-500 focus:ring-green-200 dark:focus:ring-green-400/20":u==="info"?"border-blue-300 focus:border-blue-500 focus:ring-blue-200 dark:focus:ring-blue-400/20":"border-neutral-300 dark:border-neutral-600 focus:border-primary-500 dark:focus:border-primary-400 focus:ring-primary-200 dark:focus:ring-primary-400/20",N=()=>{switch(h){case"small":return"extra-small";case"large":return"medium";default:return"small"}},L=H=>{const F=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(H);if(!F)return H;const P=parseInt(F[1],16),q=parseInt(F[2],16),B=parseInt(F[3],16);return`rgb(${P}, ${q}, ${B})`},I=H=>{const F=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(H);if(!F)return H;const P=parseInt(F[1],16)/255,q=parseInt(F[2],16)/255,B=parseInt(F[3],16)/255,X=Math.max(P,q,B),G=Math.min(P,q,B);let Q=0,Y=0;const j=(X+G)/2;if(X!==G){const ae=X-G;switch(Y=j>.5?ae/(2-X-G):ae/(X+G),X){case P:Q=(q-B)/ae+(q<B?6:0);break;case q:Q=(B-P)/ae+2;break;case B:Q=(P-q)/ae+4;break}Q/=6}return`hsl(${Math.round(Q*360)}, ${Math.round(Y*100)}%, ${Math.round(j*100)}%)`},_=()=>{switch(m){case"rgb":return L(C);case"hsl":return I(C);default:return C.toUpperCase()}},M=H=>{const F=H.target.value;a(F,H),i?.(F)};return l.jsxs("div",{className:W("flex flex-col w-full",c),children:[e&&l.jsx("label",{htmlFor:t,className:W("mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",f),children:l.jsx("div",{className:"flex flex-wrap items-center justify-between w-full",children:l.jsx("div",{className:"inline-flex flex-wrap items-center gap-1",children:l.jsxs(ee,{variant:"medium",size:N(),appearance:"subtitle",children:[e,o&&l.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})})})}),b&&l.jsx(ee,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:b}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"relative",children:l.jsx("input",{...y,ref:E,onBlur:T,onKeyDown:O,type:"color",id:t,value:C,onChange:M,disabled:s,required:o,className:W("border rounded-md cursor-pointer transition-all duration-200","focus:outline-none focus:ring-2",k(),D(),s&&"opacity-50 cursor-not-allowed",d),style:{backgroundColor:C},"aria-required":o,"aria-invalid":A&&u==="error"?"true":"false","aria-describedby":A||b?`${t}-description`:void 0})}),p&&l.jsx("div",{className:"flex-1",children:l.jsx(ee,{variant:"medium",size:"small",appearance:"body",className:"font-mono text-neutral-700 dark:text-neutral-300",children:_()})})]}),l.jsx(Ke.AnimatePresence,{children:A&&l.jsx(Ke.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${t}-description`,role:u==="error"?"alert":void 0,children:l.jsx(ee,{className:W("mt-1",w()),appearance:"custom",size:"extra-small",variant:"medium",children:A})})}),b&&!A&&l.jsx("div",{id:`${t}-description`,className:"sr-only",children:b})]})});t2.displayName="ColorPicker";const Bu=()=>{const[t,e]=x.useState(!1);return x.useEffect(()=>{const r=()=>{e(document.documentElement.classList.contains("dark"))};r();const n=new MutationObserver(a=>{a.forEach(i=>{i.attributeName==="class"&&r()})});return n.observe(document.documentElement,{attributes:!0}),()=>n.disconnect()},[]),t},r2=({id:t,label:e,errorMessage:r,selectOptions:n,loading:a,isClearable:i,multiSelect:s,selectedValues:o,disabled:A,required:u,value:c,className:d,tooltip:f,tags:h,originalCase:p=!1,onChange:m,filterOption:y,placeholder:b,...S})=>{const v=Bu(),[E,T]=x.useState(!1),O=(_,M)=>{m&&m(_);const H=document.getElementById(t);if(H){const F=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${t}`,value:_,type:"change"}});H.dispatchEvent(F)}},C={control:(_,M)=>({..._,borderColor:r&&u?v?"#F04438":"#fda49b":M.isFocused?"var(--color-primary-600)":v?"#434343":"#d9d9d9",backgroundColor:v?"#141414":M.isDisabled?"#f5f5f5":"#fff",borderRadius:"6px",minHeight:"32px",fontSize:"14px",padding:"0 4px 0 12px",opacity:M.isDisabled?.6:1,cursor:M.isDisabled?"not-allowed":"pointer",boxShadow:M.isFocused?v?"0 0 0 1.5px var(--color-primary-950)":"0 0 0 1.5px var(--color-primary-100)":"none","&:hover":{borderColor:r&&u?v?"#F04438":"#fda49b":"var(--color-primary-600)"}}),valueContainer:_=>({..._,fontSize:"14px",padding:0}),input:_=>({..._,margin:"0",padding:"0",color:v?"rgba(255,255,255,0.85)":"inherit"}),indicatorsContainer:_=>({..._,padding:0}),option:(_,M)=>({..._,fontSize:"14px",lineHeight:"22px",padding:"5px 12px",margin:0,backgroundColor:M.isSelected?v?"var(--color-primary-975)":"var(--color-primary-50)":M.isFocused?v?"var(--color-primary-950)":"var(--color-primary-100)":v?"#141414":"#fff",color:M.isDisabled?v?"rgba(255,255,255,0.25)":"#a3a3a3":v?M.isSelected?"var(--color-primary-600)":"rgba(255,255,255,0.85)":"rgba(0,0,0,0.88)",cursor:M.isDisabled?"not-allowed":"pointer",opacity:M.isDisabled?.6:1,"&:hover":{backgroundColor:M.isDisabled?v?"#141414":"#fff":v?"var(--color-primary-950)":"var(--color-primary-100)"},"&:active":{backgroundColor:v?"var(--color-primary-950)":"var(--color-primary-50)"}}),singleValue:(_,M)=>({..._,fontSize:"14px",lineHeight:"20px",color:M.isDisabled?v?"rgba(255,255,255,0.25)":"#a3a3a3":v?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.88)"}),placeholder:_=>({..._,fontSize:"14px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:v?"rgba(255,255,255,0.25)":"#bfbfbf"}),multiValue:_=>({..._,backgroundColor:v?"rgba(255,255,255,0.08)":"#f0f5ff",border:v?"1px solid transparent":"1px solid #adc6ff",borderRadius:"4px"}),multiValueLabel:_=>({..._,color:v?"rgba(255,255,255,0.85)":"var(--color-primary-600)",fontSize:"12px"}),multiValueRemove:_=>({..._,color:v?"rgba(255,255,255,0.85)":"var(--color-primary-600)","&:hover":{backgroundColor:v?"rgba(255,255,255,0.16)":"#e6f4ff",color:v?"#fff":"var(--color-primary-600)"}}),menu:_=>({..._,zIndex:5001,borderRadius:"8px",boxShadow:v?"0 6px 16px 0 rgba(0,0,0,0.45)":"0 6px 16px 0 rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12), 0 9px 28px 8px rgba(0,0,0,0.05)",backgroundColor:v?"#141414":"#fff",border:v?"1px solid #303030":"none",overflow:"hidden"}),menuList:_=>({..._,padding:"0",maxHeight:"256px"})},k=!!o?.length,N=E&&!A&&(i?k||!!c:!1),L=_=>{_.stopPropagation(),_.preventDefault(),O(s?[]:null)},I=()=>l.jsx("div",{className:"flex items-center",children:N?l.jsx(he.CancelRounded,{onClick:L,sx:{fontSize:"16px",cursor:"pointer",color:v?"rgba(255,255,255,0.45)":"rgba(0,0,0,0.25)","&:hover":{color:v?"rgba(255,255,255,0.65)":"rgba(0,0,0,0.45)"}}}):l.jsx(he.ChevronLeftRounded,{className:"-rotate-90",sx:{fontSize:"18px",color:v?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.25)"}})});return l.jsxs("div",{id:t,className:W("w-full flex flex-col gap-1",d),onMouseDown:_=>_.stopPropagation(),role:"group","aria-labelledby":e?t+"Label":void 0,children:[e&&l.jsxs("label",{id:t+"Label",htmlFor:"text",className:`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${p?"":"capitalize"}`,children:[l.jsx(Lt,{label:e||"",required:u||!1}),l.jsx(Sr,{labels:h}),f&&l.jsx(Fe.Tooltip,{placement:"top",title:f,children:l.jsx("div",{className:"cursor-pointer",children:l.jsx(yr,{})})})]}),l.jsx("div",{onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),children:l.jsx(lk,{...S,id:"cm"+e,classNamePrefix:"lax-select",required:u,options:n,isClearable:!1,isLoading:a,isDisabled:A,styles:C,isMulti:s,value:s?o:c,onChange:O,filterOption:y,placeholder:b,classNames:{menuList:()=>"nowheel"},components:{DropdownIndicator:I,IndicatorSeparator:()=>null}})}),r&&l.jsx(ee,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:r})]})};r2.displayName="CreatableSelectField";const qu=({ref:t,handler:e,enabled:r=!0})=>{x.useEffect(()=>{if(!r)return;const n=a=>{t.current&&!t.current.contains(a.target)&&e()};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[t,e,r])},Wk={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",850:"#1e3a8a",900:"#1e3a8a",950:"#172554",975:"#121f47"},n2=({id:t,label:e,options:r,placeholder:n,onChange:a,isLoading:i=!1,hideLabel:s=!1,errorMessage:o,required:A=!1,optionConfig:u,menuConfig:c,value:d,isMulti:f=!1,isClearable:h=!0,disabled:p=!1,className:m,isDark:y=!1,primaryColorShades:b=Wk})=>{const S=x.useRef(null),[v,E]=x.useState(null),[T,O]=x.useState("");qu({ref:S,handler:()=>{E(null)}});const C={control:(I,_)=>({...I,borderColor:o&&A?"#F04438":_.isFocused?y?b[400]:b[600]:y?"#1e1e1e":"#e2e8f0",backgroundColor:_.isDisabled?y?"#1a1a1a":"#f5f5f5":y?"#262626":"#FFFFFF",color:_.isDisabled?y?"#666666":"#a0a0a0":y?"#d4d4d4":"#0F172A",borderRadius:"6px",minHeight:"32px",fontSize:"14px",padding:"0px 10px",cursor:_.isDisabled?"not-allowed":"default",opacity:(_.isDisabled,1),boxShadow:_.isFocused?y?`0 0 0 3px ${b[950]}`:`0 0 0 3px ${b[100]}`:"none"}),valueContainer:I=>({...I,fontSize:"14px",maxHeight:"60px",overflowY:"auto",padding:"0px",margin:"0px",color:y?"#d4d4d4":"inherit","::-webkit-scrollbar":{display:"none"}}),input:I=>({...I,margin:"0"}),indicatorSeparator:()=>({display:"none"}),option:I=>({...I,fontWeight:500,fontSize:"14px",lineHeight:"1",borderBottom:y?"1px solid #1e1e1e":"1px solid #eee",backgroundColor:y?"#000000":"#FFFFFF",color:y?"#d4d4d4":"#0F172A",display:"flex",alignItems:"center",zIndex:200,":hover":{backgroundColor:y?"#171717":b[50]},".icon":{height:"14px",width:"14px"}}),singleValue:(I,_)=>({...I,fontWeight:500,fontSize:"14px",lineHeight:"1.25rem",color:(_.isDisabled,y?"#d4d4d4":"#0F172A"),display:"flex",alignItems:"center",".icon":{height:"14px",width:"14px"}}),placeholder:(I,_)=>({...I,fontSize:"14px",fontWeight:500,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:(_.isDisabled,y?"#595959":"#9CA3AF")}),multiValue:I=>({...I,backgroundColor:y?"#000000":b[50],borderRadius:"6px",fontFamily:"Inter",fontSize:"12px",height:"20px",alignItems:"center"}),indicatorsContainer:I=>({...I,padding:"0",height:"30px"}),multiValueLabel:I=>({...I,color:y?"#d4d4d4":b[600],fontSize:"12px"}),multiValueRemove:I=>({...I,color:y?"#d4d4d4":b[600],height:"12px",fontSize:"8px",":hover":{backgroundColor:y?"#171717":b[50]},svg:{height:"12px",width:"12px"}})},k=I=>{const _=r.filter(M=>M?.label?.toLowerCase()?.includes(T?.toLowerCase()));return l.jsx(Do.components.MenuList,{...I,className:W("!z-50 rounded !visible overflow-x-scroll",y?"bg-black-800":"bg-white",y?"text-neutral-300":"text-slate-900",c?.className),ref:S,children:_?.length?_.map((M,H)=>l.jsxs("div",{className:W("item z-[9999] flex items-center justify-between px-4 py-1.5 no-wheel",p?"cursor-not-allowed opacity-50":"cursor-pointer",y?"text-neutral-300":"text-slate-900",!p&&w(M)?y?"bg-black-700":"bg-primary-50":p?"":y?"hover:bg-black-700":"hover:bg-primary-50",c?.optionClassName?"":y?"border-b border-black-700":"border-b border-[#eee]"),onClick:F=>{p||(F.stopPropagation(),I.selectOption(M))},children:[u?.component?l.jsx(u.component,{...u.componentProps,...M}):l.jsx("div",{children:M.label}),l.jsx("div",{className:"flex items-center gap-1",children:w(M)&&u?.selectIndecator?u?.selectIndecator:null})]},H)):l.jsx("div",{className:W("opacity-50 flex justify-center items-center p-1 font-medium",y?"text-neutral-400":"text-gray-700"),children:"No options"})})},w=I=>f?v?.some(_=>_.value===I.value):I.value===v?.value,D=I=>{const{children:_,innerProps:M,isDisabled:H,getValue:F}=I,P=F();return l.jsx(Do.components.SingleValue,{...I,innerProps:M,isDisabled:H,children:P.length>0?P.map((q,B)=>l.jsx("span",{children:u?.component?l.jsx(u.component,{...u.componentProps,...q}):l.jsx("div",{children:q.label})},B)):l.jsx(l.Fragment,{children:_})})},N=I=>{const{innerProps:_,isDisabled:M,data:H}=I;return l.jsx(Do.components.MultiValue,{...I,innerProps:_,isDisabled:M,children:u?.component?l.jsx(u.component,{...u.componentProps,...H}):l.jsx("div",{children:H.label})})},L=(I,_)=>(O(_),!0);return l.jsxs("div",{className:W("flex flex-col",y?"text-black-300":"text-slate-900",i?"opacity-50":"opacity-100",p?"cursor-not-allowed":""),id:t,children:[s||!e?null:l.jsx(Lt,{label:e||"",required:A||!1}),l.jsx(Do,{required:!0,classNamePrefix:"lax-select",options:r,placeholder:n,value:d,onChange:I=>{E(I),a(I)},styles:C,isMulti:f,className:W(y&&"bg-black-800 border-black-700",m),components:{MenuList:k,SingleValue:D,MultiValue:N},filterOption:L,closeMenuOnSelect:!0,isClearable:h,isDisabled:p}),o&&l.jsx(ee,{className:W("mt-1",y?"text-red-400":"text-red-500"),appearance:"custom",size:"extra-small",variant:"medium",children:o})]})};n2.displayName="CustomizableSelectField";const a2=[{value:"AED",label:"UAE Dirham"},{value:"AFN",label:"Afghan Afghani"},{value:"ALL",label:"Albanian Lek"},{value:"AMD",label:"Armenian Dram"},{value:"AOA",label:"Angolan Kwanza"},{value:"ARS",label:"Argentine Peso"},{value:"AUD",label:"Australian Dollar"},{value:"AWG",label:"Aruban Florin"},{value:"AZN",label:"Azerbaijani Manat"},{value:"BBD",label:"Barbadian Dollar"},{value:"BDT",label:"Bangladeshi Taka"},{value:"BGN",label:"Bulgarian Lev"},{value:"BHD",label:"Bahraini Dinar"},{value:"BIF",label:"Burundian Franc"},{value:"BMD",label:"Bermudian Dollar"},{value:"BND",label:"Brunei Dollar"},{value:"BRL",label:"Brazilian Real"},{value:"BSD",label:"Bahamian Dollar"},{value:"BTN",label:"Bhutanese Ngultrum"},{value:"BWP",label:"Botswanan Pula"},{value:"BYN",label:"Belarusian Ruble"},{value:"BZD",label:"Belize Dollar"},{value:"CAD",label:"Canadian Dollar"},{value:"CDF",label:"Congolese Franc"},{value:"CHE",label:"WIR Euro"},{value:"CHF",label:"Swiss Franc"},{value:"CHW",label:"WIR Franc"},{value:"CLP",label:"Chilean Peso"},{value:"CNY",label:"Chinese Yuan"},{value:"COP",label:"Colombian Peso"},{value:"CRC",label:"Costa Rican Colón"},{value:"CUC",label:"Cuban Convertible Peso"},{value:"CUP",label:"Cuban Peso"},{value:"CVE",label:"Cape Verdean Escudo"},{value:"CZK",label:"Czech Koruna"},{value:"DJF",label:"Djiboutian Franc"},{value:"DKK",label:"Danish Krone"},{value:"DOP",label:"Dominican Peso"},{value:"DZD",label:"Algerian Dinar"},{value:"EGP",label:"Egyptian Pound"},{value:"ERN",label:"Eritrean Nakfa"},{value:"ESP",label:"Spanish Peseta"},{value:"ETB",label:"Ethiopian Birr"},{value:"EUR",label:"Euro"},{value:"FJD",label:"Fijian Dollar"},{value:"FKP",label:"Falkland Islands Pound"},{value:"GBP",label:"British Pound"},{value:"GEL",label:"Georgian Lari"},{value:"GHS",label:"Ghanaian Cedi"},{value:"GIP",label:"Gibraltar Pound"},{value:"GMD",label:"Gambian Dalasi"},{value:"GNF",label:"Guinean Franc"},{value:"GTQ",label:"Guatemalan Quetzal"},{value:"GYD",label:"Guyanese Dollar"},{value:"HKD",label:"Hong Kong Dollar"},{value:"HNL",label:"Honduran Lempira"},{value:"HRK",label:"Croatian Kuna"},{value:"HTG",label:"Haitian Gourde"},{value:"HUF",label:"Hungarian Forint"},{value:"IDR",label:"Indonesian Rupiah"},{value:"ILS",label:"Israeli New Shekel"},{value:"INR",label:"Indian Rupee"},{value:"IQD",label:"Iraqi Dinar"},{value:"IRR",label:"Iranian Rial"},{value:"ISK",label:"Icelandic Króna"},{value:"JMD",label:"Jamaican Dollar"},{value:"JOD",label:"Jordanian Dinar"},{value:"JPY",label:"Japanese Yen"},{value:"KES",label:"Kenyan Shilling"},{value:"KGS",label:"Kyrgyzstani Som"},{value:"KHR",label:"Cambodian Riel"},{value:"KMF",label:"Comorian Franc"},{value:"KPW",label:"North Korean Won"},{value:"KRW",label:"South Korean Won"},{value:"KWD",label:"Kuwaiti Dinar"},{value:"KYD",label:"Caymanian Dollar"},{value:"KZT",label:"Kazakhstani Tenge"},{value:"LAK",label:"Lao Kip"},{value:"LBP",label:"Lebanese Pound"},{value:"LKR",label:"Sri Lankan Rupee"},{value:"LRD",label:"Liberian Dollar"},{value:"LSL",label:"Lesotho Loti"},{value:"LTL",label:"Lithuanian Litas"},{value:"LVL",label:"Latvian Lats"},{value:"LYD",label:"Libyan Dinar"},{value:"MAD",label:"Moroccan Dirham"},{value:"MDL",label:"Moldovan Leu"},{value:"MGA",label:"Malagasy Ariary"},{value:"MKD",label:"Macedonian Denar"},{value:"MMK",label:"Myanmar Kyat"},{value:"MNT",label:"Mongolian Tögrög"},{value:"MOP",label:"Macanese Pataca"},{value:"MRU",label:"Mauritanian Ouguiya"},{value:"MUR",label:"Mauritian Rupee"},{value:"MVR",label:"Maldivian Rufiyaa"},{value:"MWK",label:"Malawian Kwacha"},{value:"MXN",label:"Mexican Peso"},{value:"MYR",label:"Malaysian Ringgit"},{value:"MZN",label:"Mozambican Metical"},{value:"NAD",label:"Namibian Dollar"},{value:"NGN",label:"Nigerian Naira"},{value:"NIO",label:"Nicaraguan Córdoba"},{value:"NOK",label:"Norwegian Krone"},{value:"NPR",label:"Nepalese Rupee"},{value:"NZD",label:"New Zealand Dollar"},{value:"OMR",label:"Omani Rial"},{value:"PAB",label:"Panamanian Balboa"},{value:"PEN",label:"Peruvian Sol"},{value:"PHP",label:"Philippine Peso"},{value:"PKR",label:"Pakistani Rupee"},{value:"PLN",label:"Polish Zloty"},{value:"PRB",label:"Transnistrian Ruble"},{value:"PYG",label:"Paraguayan Guarani"},{value:"QAR",label:"Qatari Riyal"},{value:"RON",label:"Romanian Leu"},{value:"RSD",label:"Serbian Dinar"},{value:"RUB",label:"Russian Ruble"},{value:"RWF",label:"Rwandan Franc"},{value:"SAR",label:"Saudi Riyal"},{value:"SCR",label:"Seychellois Rupee"},{value:"SDG",label:"Sudanese Pound"},{value:"SEK",label:"Swedish Krona"},{value:"SGD",label:"Singapore Dollar"},{value:"SHP",label:"Saint Helena Pound"},{value:"SLL",label:"Sierra Leonean Leone"},{value:"SOS",label:"Somali Shilling"},{value:"SRD",label:"Surinamese Dollar"},{value:"SSP",label:"South Sudanese Pound"},{value:"SVC",label:"Salvadoran Colón"},{value:"SYP",label:"Syrian Pound"},{value:"SZL",label:"Swazi Lilangeni"},{value:"THB",label:"Thai Baht"},{value:"TJS",label:"Tajikistani Somoni"},{value:"TMT",label:"Turkmenistani Manat"},{value:"TND",label:"Tunisian Dinar"},{value:"TOP",label:"Tongan Paʻanga"},{value:"TRY",label:"Turkish Lira"},{value:"TWD",label:"New Taiwan Dollar"},{value:"TZS",label:"Tanzanian Shilling"},{value:"UAH",label:"Ukrainian Hryvnia"},{value:"UGX",label:"Ugandan Shilling"},{value:"USD",label:"United States Dollar"},{value:"UYU",label:"Uruguayan Peso"},{value:"UZS",label:"Uzbekistani Som"},{value:"VEF",label:"Venezuelan Bolívar"},{value:"VND",label:"Vietnamese Dong"},{value:"VUV",label:"Vanuatu Vatu"},{value:"WST",label:"Samoan Tala"},{value:"YER",label:"Yemeni Rial"},{value:"ZAR",label:"South African Rand"},{value:"ZMW",label:"Zambian Kwacha"},{value:"ZWL",label:"Zimbabwean Dollar"}],i2={AED:"د.إ",AFN:"؋",ALL:"Lek",AMD:"դր",ANG:"ƒ",AOA:"Kz",ARS:"$",AUD:"$",AWG:"ƒ",AZN:"₼",BAM:"KM",BBD:"$",BDT:"৳",BGN:"лв",BHD:".د.ب",BIF:"Fr",BMD:"$",BND:"$",BOB:"Bs.",BOV:"Bs.",BRL:"R$",BSD:"$",BTN:"Nu.",BWP:"P",BYN:"Br",BZD:"$",CAD:"$",CDF:"Fr",CHE:"Fr",CHF:"Fr",CHW:"Fr",CLP:"$",CNY:"¥",COP:"$",CRC:"₡",CUC:"$",CUP:"₱",CVE:"$",CZK:"Kč",DJF:"Fr",DKK:"kr",DOP:"$",DZD:"د.ج",EGP:"£",ERN:"Nkf",ESP:"₧",ETB:"Br",EUR:"€",FJD:"$",FKP:"£",GBP:"£",GEL:"₾",GHS:"₵",GIP:"£",GMD:"D",GNF:"Fr",GTQ:"Q",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"₪",INR:"₹",IQD:"ع.د",IRR:"ریال",ISK:"kr",JMD:"$",JOD:"د.ا",JPY:"¥",KES:"Sh",KGS:"лв",KHR:"៛",KMF:"Fr",KPW:"₩",KRW:"₩",KWD:"د.ك",KYD:"$",KZT:"₸",LAK:"₭",LBP:"ل.ل",LKR:"₨",LRD:"$",LSL:"M",LTL:"Lt",LVL:"Ls",LYD:"د.ل",MAD:"د.م.",MDL:"lei",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"P",MRU:"UM",MUR:"₨",MVR:"Rf",MWK:"MK",MXN:"$",MYR:"RM",MZN:"MT",NAD:"$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",OMR:"ر.ع.",PAB:"B/.",PEN:"S/",PGK:"K",PHP:"₱",PKR:"₨",PLN:"zł",PRB:"₽",PYG:"₲",QAR:"ر.ق",RON:"lei",RSD:"дин.",RUB:"₽",RWF:"Fr",SAR:"ر.س",SBD:"$",SCR:"₨",SDG:"ج.س.",SEK:"kr",SGD:"$",SHP:"£",SLL:"Le",SOS:"Sh",SRD:"$",SSP:"£",STN:"Db",SVC:"$",SYP:"ل.س",SZL:"L",THB:"฿",TJS:"SM",TMT:"m",TND:"د.ت",TOP:"T$",TRY:"₺",TTD:"$",TWD:"NT$",TZS:"Sh",UAH:"₴",UGX:"Sh",USD:"$",UYU:"$",UZS:"сўм",VEF:"Bs.F",VND:"₫",VUV:"Vt",WST:"T",XAF:"Fr",XAG:"XAG",XAU:"XAU",XBA:"XBA",XBB:"XBB",XBC:"XBC",XBD:"XBD",XCD:"$",XDR:"XDR",XOF:"Fr",XPD:"XPD",XPF:"₣",XPT:"XPT",XSU:"XSU",XTS:"XTS",XUA:"XUA",YER:"ر.ي",ZAR:"R",ZMW:"K",ZWL:"$"},Ho=({classValue:t,size:e=24,fill:r="currentColor",...n})=>l.jsxs("svg",{className:W(t),width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[l.jsx("rect",{width:"12",height:"12",rx:"6",fill:r}),l.jsx("g",{clipPath:"url(#clip0_8212_362816)",children:l.jsx("path",{d:"M8.10023 3.90357C7.97023 3.77357 7.76023 3.77357 7.63023 3.90357L6.00023 5.53023L4.37023 3.90023C4.24023 3.77023 4.03023 3.77023 3.90023 3.90023C3.77023 4.03023 3.77023 4.24023 3.90023 4.37023L5.53023 6.00023L3.90023 7.63023C3.77023 7.76023 3.77023 7.97023 3.90023 8.10023C4.03023 8.23023 4.24023 8.23023 4.37023 8.10023L6.00023 6.47023L7.63023 8.10023C7.76023 8.23023 7.97023 8.23023 8.10023 8.10023C8.23023 7.97023 8.23023 7.76023 8.10023 7.63023L6.47023 6.00023L8.10023 4.37023C8.2269 4.24357 8.2269 4.03023 8.10023 3.90357Z",fill:"#98A2B3"})}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_8212_362816",children:l.jsx("rect",{width:"8",height:"8",fill:"white",transform:"translate(2 2)"})})})]});Ho.displayName="CloseRounded";const s2=({width:t=15,height:e=15,fill:r="#98A2B3",className:n})=>l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:t.toString(),height:e.toString(),viewBox:"0 0 20 20",fill:"none",className:n,children:l.jsx("path",{d:"M17.5 17.5L12.5001 12.5M14.1667 8.33333C14.1667 11.555 11.555 14.1667 8.33333 14.1667C5.11167 14.1667 2.5 11.555 2.5 8.33333C2.5 5.11167 5.11167 2.5 8.33333 2.5C11.555 2.5 14.1667 5.11167 14.1667 8.33333Z",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),Vu=t=>{const{value:e,placeholder:r,onChange:n,id:a,debounceTimeout:i=0,classValues:s,handleKeyDown:o,isClearable:A,onFocusText:u,autoComplete:c="false",searchRef:d,hasNavigation:f=!1,autoFocus:h=!1,searchConfig:p,hideSearchIcon:m,allowAStarSearch:y=!1,...b}=t,{t:S}=kt.useTranslation(),[v,E]=x.useState(!1),[T,O]=x.useState("search"),C=x.useRef(null),{searchCount:k,searchPointer:w,setSearchPointer:D}=p||{},N=()=>{E(!0),O(u||r||S("Search"));const I=d||C;I.current&&I.current.focus()},L=()=>{E(!1),O("")};return l.jsxs("label",{className:W("relative flex items-center justify-start px-4 py-[9px] w-full dark:bg-neutral-900 bg-white dark:bg-black-700 rounded-lg text-neutral-400 h-8",s),children:[!m&&l.jsx("div",{className:"flex items-center h-6 w-6 pointer-events-none",children:l.jsx(s2,{width:"16",height:"16"})}),l.jsx(wu.DebounceInput,{...b,spellCheck:"false",debounceTimeout:i,id:a,inputRef:d||C,type:"text",className:W(`absolute inset-0 dark:text-[#98A2B3] text-neutral-900 ${m?"pl-2":"pl-10"} pl-10 pr-7 w-full text-sm dark:text-white bg-transparent rounded-lg focus:outline-none focus:ring-primary-500 focus:border-primary-500`,"border border-solid","dark:border-neutral-800 border-neutral-200","dark:caret-white",s),onKeyDown:I=>{I.key==="Enter"&&I.preventDefault(),o&&o(I)},value:e||"",placeholder:v?T:y?"":`${S("Search")}`,onChange:I=>n?.(I.target.value),autoComplete:c,onFocus:I=>{E(!0),N(),t.onFocus&&t.onFocus(I)},onBlur:I=>{E(!1),L(),t.onBlur&&t.onBlur(I)},autoFocus:h}),f&&e&&l.jsxs("div",{className:W("absolute mr-2 focus:outline-none flex gap-1",A?"right-6":"right-0"),children:[!!k&&(k||0)>0&&l.jsxs("span",{className:"text-xs border-r pr-2 border-gray-200",children:[(w||0)+1,"/",k]}),l.jsxs("div",{className:"flex gap-1 items-center",children:[l.jsx("button",{id:"btn-search-bar-set-search-pointer-forward",onClick:()=>{D&&D(I=>(I||0)-1)},disabled:w===0,children:l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M15 18l-6-6 6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),l.jsx("button",{id:"btn-search-bar-set-search-pointer-backward",onClick:()=>{D&&D(I=>(I||0)+1)},disabled:w===(k||0)-1,children:l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M9 18l6-6-6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),y&&!(A&&e)&&!v&&!e?l.jsxs("div",{className:"absolute flex ml-6 items-center justify-center focus:outline-none gap-1 flex-wrap-none",children:[l.jsxs(ee,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:[S("Search")," (use"]}),l.jsx("button",{className:" bg-[#EAECF0] dark:bg-black-800 rounded-sm text-sm w-3 h-5",children:l.jsx(Fe.Tooltip,{placement:"bottomRight",color:"#141414",classNames:{root:"custom-tooltip dark:!bg-black-800"},title:l.jsxs("div",{className:"flex flex-col items-start justify-center p-2 w-full h-full gap-2 dark:bg-black-800",children:[l.jsx(ee,{className:"text-white text-lg font-semibold leading-5",children:S("Normal Search")}),l.jsx(ee,{className:"text-primary-300 dark:text-primary-300 text-sm font-bold leading-[18px] font-inter",appearance:"custom",children:S("Examples")}),l.jsxs("div",{className:"flex flex-col items-start justify-center ",children:[l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:l.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"data"})}),l.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "data", "Data".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:l.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"text"})}),l.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "text", "context", "plaintext".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:l.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"base"})}),l.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "database", "baseball", "basename".'})]})]}),l.jsx(ee,{className:"text-white text-lg font-semibold leading-5 mt-2",children:"Wildcard Search"}),l.jsx(ee,{className:"text-white dark:text-black-200 text-sm font-medium leading-[18px] font-inter",appearance:"custom",children:"Use * as a wildcard to refine your search."}),l.jsx(ee,{className:"text-primary-300 dark:text-primary-300 text-sm font-bold leading-[18px] font-inter",appearance:"custom",children:"Examples:"}),l.jsxs("div",{className:"flex flex-col items-start justify-center ",children:[l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:l.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ",children:"contract*"})}),l.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ "contracts", "contractor", "CONTRACTOR".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:l.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ",children:"*agreement"})}),l.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "service agreement", "legal agreement".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:l.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"*clause*"})}),l.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "clause", "subclause", "clauses".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:l.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"*l*s*"})}),l.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "clause", "clauses".'})]})]})]}),children:l.jsx("div",{className:"text-[#475467] dark:text-black-300 dark:bg-black-600",children:"*"})})}),l.jsx(ee,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:"as a wildcard)"})]}):A&&e&&l.jsx("button",{id:"btn-search-bar-close",className:"absolute right-0 mr-2 focus:outline-none",onClick:()=>n?.(""),children:l.jsx(Ho,{classValue:"text-neutral-200 dark:text-black-500",size:16})})]})};var Ka=(t=>(t.LEFT="left",t.RIGHT="right",t.TOP="top",t))(Ka||{});const Xk=(t,e,r,n="medium")=>{const a={small:"w-7 h-4 after:h-3 after:w-3 after:top-0.5 after:left-0.5",medium:"w-9 h-5 after:h-4 after:w-4 after:top-0.5 after:left-0.5",large:"w-11 h-6 after:h-5 after:w-5 after:top-0.5 after:left-0.5"},i={small:"peer-checked:after:translate-x-3",medium:"peer-checked:after:translate-x-full",large:"peer-checked:after:translate-x-5"};return W("p-0.5 rounded-full peer after:content-[''] after:absolute after:rounded-full after:transition-all bg-gray-200 dark:bg-black-400 peer-focus-visible:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-primary-500 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-white dark:peer-focus-visible:ring-primary-400 dark:peer-focus-visible:ring-offset-black-900 peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-100)] dark:peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-950)]",a[n],i[n],{"peer-checked:bg-primary-600 dark:peer-checked:bg-primary-700 peer-checked:after:translate-x-full after:bg-white dark:after:bg-primary-500":t,"after:bg-white dark:after:bg-black-500":!t,"text-white dark:text-black-900":e,"cursor-not-allowed opacity-70":r})},Qk=({size:t=18,fill:e="#016DCF"})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:l.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:e})}),jk=({size:t=18,fill:e="#101828"})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:l.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z",fill:e})}),kn=x.forwardRef(({isGTN:t=!1,isChecked:e,id:r,onChange:n,label:a,required:i,isRequiredConditional:s=!1,hideStatus:o=!1,labelDirection:A=Ka.TOP,statusText:u,withIcon:c=!1,tags:d,isAiExtracted:f=!1,tooltip:h="",className:p="",isDisabled:m=!1,icon:y,stopClickPropagation:b=!0,gtnName:S,variant:v="primary",labelClassName:E,isLiveField:T=!1,message:O,messageType:C="default",wrapperClassName:k,helpText:w,size:D="medium",renderGTNAddButton:N,onAddGTNToDocument:L},I)=>{const{t:_}=kt.useTranslation(),M=A===Ka.TOP,H=A===Ka.LEFT,F=A===Ka.RIGHT,[P,q]=x.useState(!1),B=()=>{L&&L({key:S,value:e?"Yes":"No"})},X=()=>C==="error"?"text-red-500 dark:text-red-400":C==="success"?"text-green-500 dark:text-green-400":C==="info"?"text-primary-500 dark:text-primary-400":"text-neutral-500 dark:text-neutral-400";return l.jsxs("div",{className:W("flex gap-0.5",P&&t?"border rounded-lg border-primary-100 bg-primary-50 p-1":"",k),onMouseEnter:()=>q(!0),onMouseLeave:()=>q(!1),onClick:G=>{b&&G.stopPropagation()},children:[t&&!P?l.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-pulse mt-1.5"}):null,l.jsxs("div",{className:"w-full flex flex-col",children:[M&&a&&l.jsxs("div",{className:"w-full flex justify-between flex-wrap",children:[l.jsxs("h1",{className:W("mb-1 font-inter text-neutral-600 font-medium text-xs flex items-center gap-0.5 flex-wrap",E),children:[l.jsx(Lt,{label:a||"",required:i||!1,isRequiredConditional:s||!1}),T&&l.jsx(he.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),f&&l.jsx(Vr,{}),l.jsx(Sr,{labels:d||[]}),h&&l.jsx(Me,{placement:"top",title:h,children:l.jsx("div",{className:"cursor-pointer",children:l.jsx(yr,{})})})]}),t&&P?N?N(B):l.jsx("button",{id:"btn-toggle-add-to-document",className:"cursor-pointer",onClick:B,type:"button",children:l.jsx(Fe.Tooltip,{placement:"top",title:_("Add to document"),children:l.jsx(he.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]}),w&&l.jsx(ee,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:w}),l.jsxs("div",{className:"flex",children:[H&&l.jsx(ee,{size:"small",variant:"medium",className:W("mr-2 text-neutral-700 dark:text-black-200",E),appearance:"custom",children:a}),l.jsxs("label",{className:W("relative inline-flex items-center",F||u?"":"w-min",m?"cursor-not-allowed opacity-50":"cursor-pointer"),onClick:G=>G.stopPropagation(),children:[l.jsx("input",{ref:I,type:"checkbox",id:r,onChange:G=>!m&&n(G.target.checked),value:"",disabled:m,checked:e,className:W("sr-only peer w-full",p),"aria-required":i,"aria-invalid":O&&C==="error"?"true":"false","aria-describedby":O||w?`${r}-description`:void 0}),l.jsx("div",{className:Xk(e,c,m,D),children:c?l.jsx("div",{className:"flex items-center justify-center h-full w-full",children:l.jsx("div",{className:W("z-10 transition-all transform",D==="small"&&(e?"translate-x-2":"translate-x-[-6px]"),D==="medium"&&(e?"translate-x-[8.5px]":"translate-x-[-8px]"),D==="large"&&(e?"translate-x-2.5":"translate-x-[-10px]")),children:e?y?.checkedIcon?y.checkedIcon:l.jsx(Qk,{size:18,fill:"#016DCF"}):y?.uncheckedIcon?y.uncheckedIcon:l.jsx(jk,{size:18,fill:"#101828"})})}):null}),F&&l.jsx(ee,{size:"small",variant:"medium",className:W("ml-2 text-neutral-700 dark:text-black-300",E),appearance:"custom",children:a}),o?null:l.jsx(ee,{size:"small",variant:"medium",className:"ml-2 text-neutral-900 dark:text-black-100",appearance:"custom",children:u||(e?"Yes":"No")})]})]}),l.jsx(Ke.AnimatePresence,{children:O&&l.jsx(Ke.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${r}-description`,role:C==="error"?"alert":void 0,children:l.jsx(ee,{className:W("mt-1",X()),appearance:"custom",size:"extra-small",variant:"medium",children:O})})}),w&&!O&&l.jsx("div",{id:`${r}-description`,className:"sr-only",children:w})]})]})});kn.displayName="Toggle";const Gk=t=>{try{return JSON.parse(t)}catch{return null}},Yk=t=>{let e="";const r="0123456789abcdef";for(let n=0;n<t;n++)e+=r.charAt(Math.floor(Math.random()*r.length));return e},Kk=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Zk=t=>{const e=[...t].sort((n,a)=>n.length-a.length),r=[];for(const n of e)r.some(i=>n!==i&&n.startsWith(i+"."))||r.push(n);return r},Za=t=>{let e="";if(t){let r=0;Object.keys(t).forEach(n=>{if(t[n]!==void 0&&t[n]!==null&&t[n]!==""){let a=t[n];typeof a=="object"?a=JSON.stringify(a):Array.isArray(a)&&(a=a.join(",")),a!=null&&a!==""&&(r===0?e+=`?${n}=${encodeURIComponent(a)}`:e+=`&${n}=${encodeURIComponent(a)}`,r+=1)}})}return e},o2=({shortcuts:t,variant:e="dark",className:r})=>{const a=Qi()==="macos",i=x.useMemo(()=>t.map(s=>{const o=_o[s];return o?a?o.macos:o.other:s}),[t,a]);return l.jsx("div",{className:W("flex flex-1 gap-1",r),children:i.map((s,o)=>l.jsx("kbd",{className:W("flex items-center rounded-[3px] px-1.5 py-[2px] min-w-[26px] justify-center text-xs font-medium",{"bg-neutral-800 text-white":e==="dark","bg-neutral-100 text-neutral-500 dark:bg-neutral-800 dark:text-white":e==="light"}),children:s},o))})},$k=({className:t="",fill:e="var(--color-primary-600)",size:r=24})=>l.jsx("svg",{className:t,width:r,height:r,viewBox:"0 0 20 20",fill:e,xmlns:"http://www.w3.org/2000/svg",children:l.jsx("g",{mask:"url(#mask0_6752_28309)",children:l.jsx("path",{d:"M8.33317 11.3333L13.2498 6.41667C13.4026 6.26389 13.5971 6.1875 13.8332 6.1875C14.0693 6.1875 14.2637 6.26389 14.4165 6.41667C14.5693 6.56944 14.6457 6.76389 14.6457 7C14.6457 7.23611 14.5693 7.43056 14.4165 7.58333L8.9165 13.0833C8.74984 13.25 8.55539 13.3333 8.33317 13.3333C8.11095 13.3333 7.9165 13.25 7.74984 13.0833L5.58317 10.9167C5.43039 10.7639 5.354 10.5694 5.354 10.3333C5.354 10.0972 5.43039 9.90278 5.58317 9.75C5.73595 9.59722 5.93039 9.52083 6.1665 9.52083C6.40262 9.52083 6.59706 9.59722 6.74984 9.75L8.33317 11.3333Z",fill:e})})}),or=({id:t,onClick:e,icon:r,text:n,className:a,isDisabled:i,onClose:s,notVisible:o,hideHoverEffect:A,leadingIcon:u,suffixRecord:c,stopPropagation:d,onToggle:f,isChecked:h=!1,highlight:p,truncateText:m=!1,showTick:y=!1,width:b="100%",tooltip:S,isFlowAvailable:v=!0,shortcuts:E,textClassName:T})=>{const O=x.useCallback(N=>{s&&s(),N.preventDefault(),e?.(N),d&&N.stopPropagation()},[s,e,d]),C=(N,L)=>{if(!L||!N||typeof N!="string"&&typeof N!="number")return N;const I=Kk(L),_=new RegExp(`(${I?.trim()})`,"gi"),M=N?.toString()?.split(_);return l.jsxs("span",{className:"overflow-clip text-ellipsis",children:[M[0],l.jsx("span",{className:"bg-yellow-300 dark:bg-primary-100 dark:text-black-900 rounded-sm",children:M[1]}),M?.slice(2)?.join("")]})},k=x.useCallback(N=>{f?.(),N.stopPropagation()},[f]),w=["delete","remove","clear","terminate session","terminate sessions","terminate all sessions","trash"].some(L=>n?.toLowerCase().includes(L)),D=i||!v;return o?null:l.jsx("button",{id:t,className:W("w-full p-1 bg-white dark:bg-black-800 group",a,D&&"opacity-60"),onClick:f?()=>null:O,disabled:D,onMouseMove:N=>N.stopPropagation(),children:l.jsxs("div",{className:W("flex w-full justify-start items-center gap-2 px-2 py-1 rounded-lg transition-all duration-300 ease-in-out",!A&&"hover:bg-gray-50 dark:hover:bg-black-600 hover:shadow-md dark:hover:shadow-lg dark:hover:shadow-primary-500/20"),children:[r?l.jsx("div",{className:W("h-5 w-5 flex-shrink-0 flex items-center text-neutral-900 dark:text-white transition-colors duration-300 ease-in-out",w?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:l.jsx(Me,{placement:"top",title:S,children:r})}):null,l.jsxs("div",{className:"flex gap-2 flex-1 min-w-0 text-left justify-between items-center",children:[l.jsx("div",{className:W("flex-1 min-w-0",m&&"max-w-[150px]"),style:{width:b},children:l.jsx(ee,{className:W("font-medium text-sm truncate transition-colors duration-300 ease-in-out",w?"group-hover:!text-red-600":"group-hover:!text-primary-600 dark:group-hover:!text-primary-400",T),appearance:"custom",children:p?C(n,p):n})}),c?.[n]?l.jsx("span",{className:"flex-shrink-0 text-neutral-500 dark:text-neutral-200 bg-neutral-100 dark:bg-black-700 border-[#D0D5DD] dark:border-black-700 text-xs leading-[18px] font-normal border rounded-full px-2 py-0.5",children:c[n]||""}):null,y?l.jsx("div",{className:"flex-shrink-0",children:l.jsx($k,{fill:"var(--color-primary-600)"})}):null]}),u?l.jsx(l.Fragment,{children:S?l.jsx(Me,{placement:"top",title:S,children:l.jsx("div",{className:W("flex-shrink-0 transition-colors duration-300 ease-in-out",w?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:u})}):l.jsx("div",{className:W("flex-shrink-0 transition-colors duration-300 ease-in-out",w?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:u})}):null,E?l.jsx("div",{className:"flex items-center justify-end",children:l.jsx(o2,{variant:"light",shortcuts:E})}):null,f?l.jsx("div",{className:"flex-shrink-0",children:l.jsx(kn,{onChange:k,isChecked:h,isDisabled:i,hideStatus:!0})}):null]})})};or.displayName="OptionButton";const Ro=(t,e)=>{const r=t.slice(0,2),n=Wi[r];return n?l.jsx("div",{className:`
|
|
51
51
|
w-5 h-5 rounded-full overflow-hidden border-[0.9px] flex items-center justify-center relative
|
|
52
52
|
${e?"border-neutral-100 dark:border-neutral-100":"border-neutral-400 dark:border-neutral-500"}
|
|
53
53
|
`,children:l.jsx(n,{style:{width:"110%",height:"110%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},Jk=t=>{const e=t.slice(0,2),r=Wi[e];return r?l.jsx("div",{className:"w-4 h-4 rounded-full overflow-hidden flex items-center justify-center relative",children:l.jsx(r,{style:{width:"120%",height:"120%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},eN=t=>{const e=t.slice(0,2),r=Wi[e];return r?l.jsx("div",{className:"w-7 h-5 rounded-md overflow-hidden border border-neutral-300 dark:border-neutral-300 flex items-center justify-center relative",children:l.jsx(r,{style:{width:"110%",height:"110%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},tN=t=>{const e=t.slice(0,2),r=Wi[e];return r?l.jsx("div",{className:"w-4 h-3 rounded-sm overflow-hidden border border-neutral-300 dark:border-neutral-300 flex items-center justify-center relative",children:l.jsx(r,{style:{width:"120%",height:"120%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},A2=t=>{const e=t.slice(0,2),r=Wi[e];return r?l.jsx("div",{className:"w-5 h-4 rounded-sm overflow-hidden border border-neutral-300 dark:border-neutral-300 flex items-center justify-center relative",children:l.jsx(r,{style:{width:"115%",height:"115%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},l2=x.forwardRef(({id:t,label:e,value:r,onChange:n,errorMessage:a,defaultValue:i,required:s=!1,isRequiredConditional:o=!1,tags:A,className:u,originalCase:c=!1,tooltip:d,simpleMode:f=!1,inputFieldClassName:h="",isAiExtracted:p=!1,isGTN:m=!1,gtnName:y=null,allowMultiCurrency:b=!1,placeholder:S,disabled:v=!1,currencyCode:E="USD",inputStyle:T,labelClassName:O,isLiveField:C=!1,onBlur:k,autoFocus:w=!1,isRecording:D=!1,isPlaying:N=!1,onAddGTNToDocument:L,riskDetails:I,isRiskAnalysisOpen:_=!1,RiskDetailsCard:M,...H},F)=>{const{t:P}=kt.useTranslation(),[q,B]=x.useState(!1),[X,G]=x.useState([]),[Q,Y]=x.useState(""),[j,ae]=x.useState(E||"USD"),[se,le]=x.useState(!1),Ee=te=>{L&&L({key:y,value:te})},ge=te=>{if(te==null)return"";const oe=Number(te);return isNaN(oe)?te:oe?.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},Ce=te=>{const oe=te.target.value,Le=oe===""||oe===null||oe===void 0?0:Number(oe);n(Le,j);const Ie=document.getElementById(t);if(Ie&&Ie.setAttribute("data-selected-value",JSON.stringify({value:Le,currency_code:j})),Ie&&(D||N)){const Ye=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${t}`,value:{value:Le,currency_code:j},type:"change"}});Ie.dispatchEvent(Ye)}},Re=()=>{B(!0)},Te=()=>{B(!1),(r==null||r==="")&&Ce({target:{value:"0.00"}}),k?.()},$=()=>{const te="pl-11 border h-[32px] text-sm rounded-lg block w-full p-2.5 font-inter font-medium text-neutral-900 dark:text-black-200 disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400 focus:outline-none focus:ring-0 focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)]",oe=a?"border-red-300":_&&I?.color?`border-${I.color}-300`:"border-gray-300 dark:border-black-600",Le=`${_&&I?.color?`bg-${I.color}-50`:"bg-white dark:bg-black-600"}`;return`${te} ${oe} ${Le} ${h}`};return x.useEffect(()=>{E&&ae(E)},[E]),x.useEffect(()=>{if(j){const te=r===""||r===null||r===void 0?0:Number(r);E!==j&&n(te,j);const oe=document.getElementById(t);if(oe&&(oe.setAttribute("data-selected-value",JSON.stringify({value:te,currency_code:j})),D||N)){const Le=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${t}`,value:{value:te,currency_code:j},type:"change"}});oe.dispatchEvent(Le)}}},[j]),x.useEffect(()=>{const te=a2.filter(oe=>(oe.value+" - "+oe.label).toLowerCase().includes(Q.toLowerCase())).map(oe=>({label:l.jsx(or,{text:`${oe.value} - ${oe.label}`,icon:Ro(oe.value),showTick:j===oe.value,onClick:()=>ae(oe.value),className:"text-black-900 dark:text-white"}),key:oe.value}));G(te)},[Q,j]),x.useEffect(()=>{Y("")},[j]),f?l.jsxs("label",{id:t,className:`mb-1 text-xs font-medium text-gray-600 h-full inline-flex items-center gap-1 ${c?"":"capitalize"} ${O||""}`,children:[l.jsx("span",{className:"absolute inset-y-0 left-1 top-0.5 flex items-center pl-3",children:"$"}),l.jsx("input",{...H,ref:F,type:q?"number":"text",required:s,className:W(h,"pl-8 h-[32px]"),onChange:Ce,min:0,onFocus:Re,onBlur:Te,value:q?r:ge(r),...i&&!r?{defaultValue:q?i:ge(i)}:{},id:t||e,autoFocus:w})]}):l.jsxs("div",{className:W("flex gap-0.5 relative",se&&m?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>le(!0),onMouseLeave:()=>le(!1),children:[m&&!se?l.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,l.jsxs("div",{className:W("w-full flex flex-col",u),children:[l.jsx("label",{htmlFor:"text",className:`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${c?"":"uppercase"} ${O||""}`,children:l.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[l.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[l.jsx(Lt,{label:e||"",required:s||!1,isRequiredConditional:o||!1}),C&&l.jsx(he.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),p&&l.jsx(Vr,{}),l.jsx(Sr,{labels:A}),d&&l.jsx(Me,{placement:"top",title:d,children:l.jsx("div",{className:"cursor-pointer",children:l.jsx(yr,{})})})]}),m&&se&&L?l.jsx("button",{id:"btn-currency-input-add-to-document",className:"cursor-pointer",onClick:()=>Ee(ge(r)),type:"button",children:l.jsx(Fe.Tooltip,{placement:"top",title:P("Add to document"),children:l.jsx(he.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}),l.jsxs("label",{className:"relative block",children:[l.jsx("span",{className:"absolute inset-y-0 left-1 flex items-center pl-3 text-neutral-900 dark:text-white",children:i2[j]}),l.jsx("input",{...H,ref:F,placeholder:S,type:q?"number":"text",required:s,disabled:v,className:$(),onChange:Ce,min:0,onFocus:Re,onBlur:Te,value:q?r:ge(r),defaultValue:q?i:ge(i),id:t||e,style:T,autoComplete:"off",autoFocus:w}),l.jsx("span",{className:`absolute inset-y-0 right-2 flex items-center z-[1000px] h-full cursor-pointer dark:text-black-200 ${b?"cursor-pointer":""}`,children:b?l.jsx(Fe.Dropdown,{menu:{items:[...X]},trigger:["click"],overlayClassName:"row-option-cell",placement:"bottomRight",overlayStyle:{zIndex:999},getPopupContainer:te=>te.parentElement,popupRender:te=>l.jsxs("div",{style:{maxHeight:"200px",width:"330px",textOverflow:"ellipsis",overflowY:"auto",zIndex:"999px",borderRadius:"6px"},className:"[&>*:nth-child(2)]:!shadow-none [&>*:nth-child(2)>*]:!px-2 flex flex-col gap-2 p-2 bg-white dark:bg-black-700 border border-solid border-neutral-200 dark:border-black-600",children:[l.jsx(Vu,{id:"search-bar-currency-input",value:Q,onChange:oe=>Y(oe),className:"mb-2"}),te]}),children:l.jsxs("div",{className:"pl-4 pr-2 py-1.5 text-sm text-gray-700 dark:text-black-200 flex items-center gap-1",children:[Ro(j)," ",j]})}):j})]}),a&&l.jsx(ee,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:a})]}),se&&I&&_&&M&&l.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:te=>te.stopPropagation(),onMouseDown:te=>te.preventDefault(),onKeyDown:te=>{te.key==="Escape"&&le(!1)},children:l.jsx(M,{riskDetails:I})})]})});l2.displayName="CurrencyInputField";const u2=x.forwardRef(({id:t,label:e,value:r,defaultValue:n,onChange:a,disabled:i=!1,required:s=!1,message:o,messageType:A="default",wrapperClassName:u,inputClassName:c,labelClassName:d,helpText:f,size:h="medium",minDate:p,maxDate:m,startPlaceholder:y="Start date",endPlaceholder:b="End date",allowClear:S=!0,inputProps:v},E)=>{const T=r!==void 0?r:n||{startDate:null,endDate:null},O=()=>{switch(h){case"small":return{height:"h-7",padding:"px-2 py-1",fontSize:"text-xs"};case"large":return{height:"h-10",padding:"px-4 py-2",fontSize:"text-base"};default:return{height:"h-8",padding:"px-3 py-1.5",fontSize:"text-sm"}}},C=()=>A==="error"?"border-red-300 focus:border-red-500 focus:ring-red-200 dark:focus:ring-red-400/20":A==="success"?"border-green-300 focus:border-green-500 focus:ring-green-200 dark:focus:ring-green-400/20":A==="info"?"border-blue-300 focus:border-blue-500 focus:ring-blue-200 dark:focus:ring-blue-400/20":"border-neutral-300 dark:border-neutral-600 focus:border-primary-500 dark:focus:border-primary-400 focus:ring-primary-200 dark:focus:ring-primary-400/20",k=()=>A==="error"?"text-red-500 dark:text-red-400":A==="success"?"text-green-500 dark:text-green-400":A==="info"?"text-blue-500 dark:text-blue-400":"text-neutral-500 dark:text-neutral-400",w=()=>{switch(h){case"small":return"extra-small";case"large":return"medium";default:return"small"}},D=F=>{if(!F)return"";const P=F.getFullYear(),q=String(F.getMonth()+1).padStart(2,"0"),B=String(F.getDate()).padStart(2,"0");return`${P}-${q}-${B}`},N=F=>{if(!F)return null;const P=new Date(F);return isNaN(P.getTime())?null:P},L=F=>{const P=N(F.target.value);a({startDate:P,endDate:T.endDate})},I=F=>{const P=N(F.target.value);a({startDate:T.startDate,endDate:P})},_=()=>{a({startDate:null,endDate:null})},M=F=>F?D(F):void 0,H=O();return l.jsxs("div",{className:W("flex flex-col w-full",u),ref:E,children:[e&&l.jsx("label",{htmlFor:`${t}-start`,className:W("mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",d),children:l.jsx("div",{className:"flex flex-wrap items-center justify-between w-full",children:l.jsx("div",{className:"inline-flex flex-wrap items-center gap-1",children:l.jsxs(ee,{variant:"medium",size:w(),appearance:"subtitle",children:[e,s&&l.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})})})}),f&&l.jsx(ee,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:f}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex-1",children:l.jsx("input",{...v,id:`${t}-start`,type:"date",value:D(T.startDate),onChange:L,disabled:i,required:s,min:M(p),max:M(m),placeholder:y,className:W("border rounded-md bg-white dark:bg-neutral-800 block w-full font-medium text-neutral-900 dark:text-neutral-100","transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2",H.height,H.padding,H.fontSize,C(),i&&"opacity-50 cursor-not-allowed bg-neutral-50 dark:bg-neutral-700",c),"aria-required":s,"aria-invalid":o&&A==="error"?"true":"false","aria-describedby":o||f?`${t}-description`:void 0})}),l.jsx("div",{className:"flex-shrink-0 text-neutral-500 dark:text-neutral-400",children:l.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M18 12H6"})})}),l.jsx("div",{className:"flex-1",children:l.jsx("input",{...v,id:`${t}-end`,type:"date",value:D(T.endDate),onChange:I,disabled:i,required:s,min:M(T.startDate||p),max:M(m),placeholder:b,className:W("border rounded-md bg-white dark:bg-neutral-800 block w-full font-medium text-neutral-900 dark:text-neutral-100","transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2",H.height,H.padding,H.fontSize,C(),i&&"opacity-50 cursor-not-allowed bg-neutral-50 dark:bg-neutral-700",c),"aria-required":s,"aria-invalid":o&&A==="error"?"true":"false","aria-describedby":o||f?`${t}-description`:void 0})}),S&&(T.startDate||T.endDate)&&!i&&l.jsx("button",{type:"button",onClick:_,className:"flex-shrink-0 p-1 text-neutral-500 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-200 transition-colors","aria-label":"Clear date range",children:l.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),l.jsx("div",{className:"absolute right-3 top-1/2 transform -translate-y-1/2 pointer-events-none text-neutral-400 dark:text-neutral-500",children:l.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),l.jsx(Ke.AnimatePresence,{children:o&&l.jsx(Ke.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${t}-description`,role:A==="error"?"alert":void 0,children:l.jsx(ee,{className:W("mt-1",k()),appearance:"custom",size:"extra-small",variant:"medium",children:o})})}),f&&!o&&l.jsx("div",{id:`${t}-description`,className:"sr-only",children:f})]})});u2.displayName="DateRange2";var Fo={exports:{}},rN=Fo.exports,c2;function nN(){return c2||(c2=1,function(t,e){(function(r,n){t.exports=n()})(rN,function(){var r=1e3,n=6e4,a=36e5,i="millisecond",s="second",o="minute",A="hour",u="day",c="week",d="month",f="quarter",h="year",p="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,S={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_){var M=["th","st","nd","rd"],H=_%100;return"["+_+(M[(H-20)%10]||M[H]||M[0])+"]"}},v=function(_,M,H){var F=String(_);return!F||F.length>=M?_:""+Array(M+1-F.length).join(H)+_},E={s:v,z:function(_){var M=-_.utcOffset(),H=Math.abs(M),F=Math.floor(H/60),P=H%60;return(M<=0?"+":"-")+v(F,2,"0")+":"+v(P,2,"0")},m:function _(M,H){if(M.date()<H.date())return-_(H,M);var F=12*(H.year()-M.year())+(H.month()-M.month()),P=M.clone().add(F,d),q=H-P<0,B=M.clone().add(F+(q?-1:1),d);return+(-(F+(H-P)/(q?P-B:B-P))||0)},a:function(_){return _<0?Math.ceil(_)||0:Math.floor(_)},p:function(_){return{M:d,y:h,w:c,d:u,D:p,h:A,m:o,s,ms:i,Q:f}[_]||String(_||"").toLowerCase().replace(/s$/,"")},u:function(_){return _===void 0}},T="en",O={};O[T]=S;var C="$isDayjsObject",k=function(_){return _ instanceof L||!(!_||!_[C])},w=function _(M,H,F){var P;if(!M)return T;if(typeof M=="string"){var q=M.toLowerCase();O[q]&&(P=q),H&&(O[q]=H,P=q);var B=M.split("-");if(!P&&B.length>1)return _(B[0])}else{var X=M.name;O[X]=M,P=X}return!F&&P&&(T=P),P||!F&&T},D=function(_,M){if(k(_))return _.clone();var H=typeof M=="object"?M:{};return H.date=_,H.args=arguments,new L(H)},N=E;N.l=w,N.i=k,N.w=function(_,M){return D(_,{locale:M.$L,utc:M.$u,x:M.$x,$offset:M.$offset})};var L=function(){function _(H){this.$L=w(H.locale,null,!0),this.parse(H),this.$x=this.$x||H.x||{},this[C]=!0}var M=_.prototype;return M.parse=function(H){this.$d=function(F){var P=F.date,q=F.utc;if(P===null)return new Date(NaN);if(N.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var B=P.match(y);if(B){var X=B[2]-1||0,G=(B[7]||"0").substring(0,3);return q?new Date(Date.UTC(B[1],X,B[3]||1,B[4]||0,B[5]||0,B[6]||0,G)):new Date(B[1],X,B[3]||1,B[4]||0,B[5]||0,B[6]||0,G)}}return new Date(P)}(H),this.init()},M.init=function(){var H=this.$d;this.$y=H.getFullYear(),this.$M=H.getMonth(),this.$D=H.getDate(),this.$W=H.getDay(),this.$H=H.getHours(),this.$m=H.getMinutes(),this.$s=H.getSeconds(),this.$ms=H.getMilliseconds()},M.$utils=function(){return N},M.isValid=function(){return this.$d.toString()!==m},M.isSame=function(H,F){var P=D(H);return this.startOf(F)<=P&&P<=this.endOf(F)},M.isAfter=function(H,F){return D(H)<this.startOf(F)},M.isBefore=function(H,F){return this.endOf(F)<D(H)},M.$g=function(H,F,P){return N.u(H)?this[F]:this.set(P,H)},M.unix=function(){return Math.floor(this.valueOf()/1e3)},M.valueOf=function(){return this.$d.getTime()},M.startOf=function(H,F){var P=this,q=!!N.u(F)||F,B=N.p(H),X=function(Ee,ge){var Ce=N.w(P.$u?Date.UTC(P.$y,ge,Ee):new Date(P.$y,ge,Ee),P);return q?Ce:Ce.endOf(u)},G=function(Ee,ge){return N.w(P.toDate()[Ee].apply(P.toDate("s"),(q?[0,0,0,0]:[23,59,59,999]).slice(ge)),P)},Q=this.$W,Y=this.$M,j=this.$D,ae="set"+(this.$u?"UTC":"");switch(B){case h:return q?X(1,0):X(31,11);case d:return q?X(1,Y):X(0,Y+1);case c:var se=this.$locale().weekStart||0,le=(Q<se?Q+7:Q)-se;return X(q?j-le:j+(6-le),Y);case u:case p:return G(ae+"Hours",0);case A:return G(ae+"Minutes",1);case o:return G(ae+"Seconds",2);case s:return G(ae+"Milliseconds",3);default:return this.clone()}},M.endOf=function(H){return this.startOf(H,!1)},M.$set=function(H,F){var P,q=N.p(H),B="set"+(this.$u?"UTC":""),X=(P={},P[u]=B+"Date",P[p]=B+"Date",P[d]=B+"Month",P[h]=B+"FullYear",P[A]=B+"Hours",P[o]=B+"Minutes",P[s]=B+"Seconds",P[i]=B+"Milliseconds",P)[q],G=q===u?this.$D+(F-this.$W):F;if(q===d||q===h){var Q=this.clone().set(p,1);Q.$d[X](G),Q.init(),this.$d=Q.set(p,Math.min(this.$D,Q.daysInMonth())).$d}else X&&this.$d[X](G);return this.init(),this},M.set=function(H,F){return this.clone().$set(H,F)},M.get=function(H){return this[N.p(H)]()},M.add=function(H,F){var P,q=this;H=Number(H);var B=N.p(F),X=function(Y){var j=D(q);return N.w(j.date(j.date()+Math.round(Y*H)),q)};if(B===d)return this.set(d,this.$M+H);if(B===h)return this.set(h,this.$y+H);if(B===u)return X(1);if(B===c)return X(7);var G=(P={},P[o]=n,P[A]=a,P[s]=r,P)[B]||1,Q=this.$d.getTime()+H*G;return N.w(Q,this)},M.subtract=function(H,F){return this.add(-1*H,F)},M.format=function(H){var F=this,P=this.$locale();if(!this.isValid())return P.invalidDate||m;var q=H||"YYYY-MM-DDTHH:mm:ssZ",B=N.z(this),X=this.$H,G=this.$m,Q=this.$M,Y=P.weekdays,j=P.months,ae=P.meridiem,se=function(ge,Ce,Re,Te){return ge&&(ge[Ce]||ge(F,q))||Re[Ce].slice(0,Te)},le=function(ge){return N.s(X%12||12,ge,"0")},Ee=ae||function(ge,Ce,Re){var Te=ge<12?"AM":"PM";return Re?Te.toLowerCase():Te};return q.replace(b,function(ge,Ce){return Ce||function(Re){switch(Re){case"YY":return String(F.$y).slice(-2);case"YYYY":return N.s(F.$y,4,"0");case"M":return Q+1;case"MM":return N.s(Q+1,2,"0");case"MMM":return se(P.monthsShort,Q,j,3);case"MMMM":return se(j,Q);case"D":return F.$D;case"DD":return N.s(F.$D,2,"0");case"d":return String(F.$W);case"dd":return se(P.weekdaysMin,F.$W,Y,2);case"ddd":return se(P.weekdaysShort,F.$W,Y,3);case"dddd":return Y[F.$W];case"H":return String(X);case"HH":return N.s(X,2,"0");case"h":return le(1);case"hh":return le(2);case"a":return Ee(X,G,!0);case"A":return Ee(X,G,!1);case"m":return String(G);case"mm":return N.s(G,2,"0");case"s":return String(F.$s);case"ss":return N.s(F.$s,2,"0");case"SSS":return N.s(F.$ms,3,"0");case"Z":return B}return null}(ge)||B.replace(":","")})},M.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},M.diff=function(H,F,P){var q,B=this,X=N.p(F),G=D(H),Q=(G.utcOffset()-this.utcOffset())*n,Y=this-G,j=function(){return N.m(B,G)};switch(X){case h:q=j()/12;break;case d:q=j();break;case f:q=j()/3;break;case c:q=(Y-Q)/6048e5;break;case u:q=(Y-Q)/864e5;break;case A:q=Y/a;break;case o:q=Y/n;break;case s:q=Y/r;break;default:q=Y}return P?q:N.a(q)},M.daysInMonth=function(){return this.endOf(d).$D},M.$locale=function(){return O[this.$L]},M.locale=function(H,F){if(!H)return this.$L;var P=this.clone(),q=w(H,F,!0);return q&&(P.$L=q),P},M.clone=function(){return N.w(this.$d,this)},M.toDate=function(){return new Date(this.valueOf())},M.toJSON=function(){return this.isValid()?this.toISOString():null},M.toISOString=function(){return this.$d.toISOString()},M.toString=function(){return this.$d.toUTCString()},_}(),I=L.prototype;return D.prototype=I,[["$ms",i],["$s",s],["$m",o],["$H",A],["$W",u],["$M",d],["$y",h],["$D",p]].forEach(function(_){I[_[1]]=function(M){return this.$g(M,_[0],_[1])}}),D.extend=function(_,M){return _.$i||(_(M,L,D),_.$i=!0),D},D.locale=w,D.isDayjs=k,D.unix=function(_){return D(1e3*_)},D.en=O[T],D.Ls=O,D.p={},D})}(Fo)),Fo.exports}var aN=nN();const St=Qn(aN),{RangePicker:d2}=Fe.DatePicker,f2={ENTER:"Enter"},h2=()=>Math.random().toString(36).substring(2,9),iN=(t,e)=>{const r=x.useRef(e);x.useEffect(()=>{r.current=e},[e]),x.useEffect(()=>{const n=a=>r.current(a);return document.addEventListener(t,n),()=>{document.removeEventListener(t,n)}},[t])},p2=({onCalendarChange:t=void 0,onChange:e,required:r,label:n,startDate:a,endDate:i,errorMessage:s,className:o,id:A,disabled:u=!1,dateFormat:c,shouldPopOnParent:d=!0,getPopupContainer:f,maxDateRange:h,open:p,onOpenChange:m,placement:y="bottomLeft",renderAsIconButton:b=!1,iconButtonClassName:S,iconClassName:v})=>{const[E,T]=x.useState(!1),[O,C]=x.useState(!1),k=x.useRef(null),w=x.useRef(null),D=x.useRef(!1),N=x.useRef(!1),L=B=>B?St(B):null,I=`date-range-start-${h2()}`,_=`date-range-end-${h2()}`,M=()=>{T(!0),setTimeout(()=>{k.current&&k.current.focus()},0)};iN("keydown",B=>{if(B.key===f2.ENTER&&document.activeElement instanceof HTMLInputElement){if(document?.activeElement?.id===I){const X=St(document?.activeElement?.value);X.isValid()&&e([X,L(i)])}if(document?.activeElement?.id===_){const X=St(document?.activeElement?.value);X.isValid()&&e([L(a),X])}}});const H=x.useCallback(B=>{const[X,G]=[L(a),L(i)];return h?X?B.isBefore(X.startOf("day"))||B.isAfter(X.add(h,"day").endOf("day")):G?B.isBefore(G.subtract(h,"day").startOf("day"))||B.isAfter(G.endOf("day")):!1:!1},[a,i,h]),F=x.useCallback(B=>{if(B.key===f2.ENTER&&!(b?E:p??O)){B.preventDefault(),B.stopPropagation();const G=B.target.closest("form");if(G){const Q=G.querySelector('button[type="submit"]');Q?Q.click():G.requestSubmit()}}},[b,E,p,O]),P=x.useCallback(B=>{if(B&&D.current){D.current=!1,T(!1);return}T(B),B||(D.current=!0,requestAnimationFrame(()=>{k.current?.focus(),requestAnimationFrame(()=>{D.current=!1})}))},[]),q=x.useCallback(B=>{if(B&&N.current){N.current=!1,C(!1),m?.(!1);return}C(B),m?.(B),B||(N.current=!0,requestAnimationFrame(()=>{w.current?.focus(),requestAnimationFrame(()=>{N.current=!1})}))},[m]);return b?l.jsxs("div",{id:A,className:o,onKeyDownCapture:F,children:[l.jsx(Zt,{onClick:M,disabled:u,variant:"default",className:S,children:l.jsx(Cu.BiCalendar,{className:W("w-5 h-5",v)})}),l.jsx(d2,{ref:k,onChange:B=>{e(B),T(!1)},onCalendarChange:t,value:[L(a),L(i)],id:{start:I,end:_},allowClear:!0,format:c||"DD MMM, YYYY",separator:l.jsx(nn.BsDash,{className:"dark:text-gray-100"}),suffixIcon:l.jsx(Cu.BiCalendar,{className:"dark:text-gray-100"}),getPopupContainer:f||(d?B=>B.parentElement:()=>document.body),disabled:u,disabledDate:h?H:void 0,autoComplete:"off",open:E,onOpenChange:P,placement:y,style:{position:"absolute",opacity:0,pointerEvents:"none",width:0,height:0}})]}):l.jsxs("div",{id:A,className:W("flex flex-col",o),onKeyDownCapture:F,children:[l.jsx(Lt,{label:n||"",required:r||!1}),l.jsx(d2,{ref:w,onChange:e,onCalendarChange:t,value:[L(a),L(i)],id:{start:I,end:_},allowClear:!0,format:c||"DD MMM, YYYY",separator:l.jsx(nn.BsDash,{className:"dark:text-gray-100"}),suffixIcon:l.jsx(Cu.BiCalendar,{className:"dark:text-gray-100"}),getPopupContainer:f||(d?B=>B.parentElement:()=>document.body),disabled:u,disabledDate:h?H:void 0,open:p??O,onOpenChange:q,autoComplete:"off",placement:y}),s&&l.jsx("p",{className:W("text-sm font-inter font-normal text-left pt-[6px]","text-red-500"),children:s})]})};p2.displayName="DateRange";var Uo={exports:{}},sN=Uo.exports,m2;function oN(){return m2||(m2=1,function(t,e){(function(r,n){t.exports=n()})(sN,function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,a=/\d/,i=/\d\d/,s=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,A={},u=function(y){return(y=+y)+(y>68?1900:2e3)},c=function(y){return function(b){this[y]=+b}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=function(b){if(!b||b==="Z")return 0;var S=b.match(/([+-]|\d\d)/g),v=60*S[1]+(+S[2]||0);return v===0?0:S[0]==="+"?-v:v}(y)}],f=function(y){var b=A[y];return b&&(b.indexOf?b:b.s.concat(b.f))},h=function(y,b){var S,v=A.meridiem;if(v){for(var E=1;E<=24;E+=1)if(y.indexOf(v(E,0,b))>-1){S=E>12;break}}else S=y===(b?"pm":"PM");return S},p={A:[o,function(y){this.afternoon=h(y,!1)}],a:[o,function(y){this.afternoon=h(y,!0)}],Q:[a,function(y){this.month=3*(y-1)+1}],S:[a,function(y){this.milliseconds=100*+y}],SS:[i,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[s,c("seconds")],ss:[s,c("seconds")],m:[s,c("minutes")],mm:[s,c("minutes")],H:[s,c("hours")],h:[s,c("hours")],HH:[s,c("hours")],hh:[s,c("hours")],D:[s,c("day")],DD:[i,c("day")],Do:[o,function(y){var b=A.ordinal,S=y.match(/\d+/);if(this.day=S[0],b)for(var v=1;v<=31;v+=1)b(v).replace(/\[|\]/g,"")===y&&(this.day=v)}],w:[s,c("week")],ww:[i,c("week")],M:[s,c("month")],MM:[i,c("month")],MMM:[o,function(y){var b=f("months"),S=(f("monthsShort")||b.map(function(v){return v.slice(0,3)})).indexOf(y)+1;if(S<1)throw new Error;this.month=S%12||S}],MMMM:[o,function(y){var b=f("months").indexOf(y)+1;if(b<1)throw new Error;this.month=b%12||b}],Y:[/[+-]?\d+/,c("year")],YY:[i,function(y){this.year=u(y)}],YYYY:[/\d{4}/,c("year")],Z:d,ZZ:d};function m(y){var b,S;b=y,S=A&&A.formats;for(var v=(y=b.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(D,N,L){var I=L&&L.toUpperCase();return N||S[L]||r[L]||S[I].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(_,M,H){return M||H.slice(1)})})).match(n),E=v.length,T=0;T<E;T+=1){var O=v[T],C=p[O],k=C&&C[0],w=C&&C[1];v[T]=w?{regex:k,parser:w}:O.replace(/^\[|\]$/g,"")}return function(D){for(var N={},L=0,I=0;L<E;L+=1){var _=v[L];if(typeof _=="string")I+=_.length;else{var M=_.regex,H=_.parser,F=D.slice(I),P=M.exec(F)[0];H.call(N,P),D=D.replace(P,"")}}return function(q){var B=q.afternoon;if(B!==void 0){var X=q.hours;B?X<12&&(q.hours+=12):X===12&&(q.hours=0),delete q.afternoon}}(N),N}}return function(y,b,S){S.p.customParseFormat=!0,y&&y.parseTwoDigitYear&&(u=y.parseTwoDigitYear);var v=b.prototype,E=v.parse;v.parse=function(T){var O=T.date,C=T.utc,k=T.args;this.$u=C;var w=k[1];if(typeof w=="string"){var D=k[2]===!0,N=k[3]===!0,L=D||N,I=k[2];N&&(I=k[2]),A=this.$locale(),!D&&I&&(A=S.Ls[I]),this.$d=function(F,P,q,B){try{if(["x","X"].indexOf(P)>-1)return new Date((P==="X"?1e3:1)*F);var X=m(P)(F),G=X.year,Q=X.month,Y=X.day,j=X.hours,ae=X.minutes,se=X.seconds,le=X.milliseconds,Ee=X.zone,ge=X.week,Ce=new Date,Re=Y||(G||Q?1:Ce.getDate()),Te=G||Ce.getFullYear(),$=0;G&&!Q||($=Q>0?Q-1:Ce.getMonth());var te,oe=j||0,Le=ae||0,Ie=se||0,Ye=le||0;return Ee?new Date(Date.UTC(Te,$,Re,oe,Le,Ie,Ye+60*Ee.offset*1e3)):q?new Date(Date.UTC(Te,$,Re,oe,Le,Ie,Ye)):(te=new Date(Te,$,Re,oe,Le,Ie,Ye),ge&&(te=B(te).week(ge).toDate()),te)}catch{return new Date("")}}(O,w,C,S),this.init(),I&&I!==!0&&(this.$L=this.locale(I).$L),L&&O!=this.format(w)&&(this.$d=new Date("")),A={}}else if(w instanceof Array)for(var _=w.length,M=1;M<=_;M+=1){k[1]=w[M-1];var H=S.apply(this,k);if(H.isValid()){this.$d=H.$d,this.$L=H.$L,this.init();break}M===_&&(this.$d=new Date(""))}else E.call(this,T)}}})}(Uo)),Uo.exports}var AN=oN();const lN=Qn(AN);var zo={exports:{}},uN=zo.exports,g2;function cN(){return g2||(g2=1,function(t,e){(function(r,n){t.exports=n()})(uN,function(){return function(r,n,a){var i=n.prototype,s=function(d){return d&&(d.indexOf?d:d.s)},o=function(d,f,h,p,m){var y=d.name?d:d.$locale(),b=s(y[f]),S=s(y[h]),v=b||S.map(function(T){return T.slice(0,p)});if(!m)return v;var E=y.weekStart;return v.map(function(T,O){return v[(O+(E||0))%7]})},A=function(){return a.Ls[a.locale()]},u=function(d,f){return d.formats[f]||function(h){return h.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(p,m,y){return m||y.slice(1)})}(d.formats[f.toUpperCase()])},c=function(){var d=this;return{months:function(f){return f?f.format("MMMM"):o(d,"months")},monthsShort:function(f){return f?f.format("MMM"):o(d,"monthsShort","months",3)},firstDayOfWeek:function(){return d.$locale().weekStart||0},weekdays:function(f){return f?f.format("dddd"):o(d,"weekdays")},weekdaysMin:function(f){return f?f.format("dd"):o(d,"weekdaysMin","weekdays",2)},weekdaysShort:function(f){return f?f.format("ddd"):o(d,"weekdaysShort","weekdays",3)},longDateFormat:function(f){return u(d.$locale(),f)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};i.localeData=function(){return c.bind(this)()},a.localeData=function(){var d=A();return{firstDayOfWeek:function(){return d.weekStart||0},weekdays:function(){return a.weekdays()},weekdaysShort:function(){return a.weekdaysShort()},weekdaysMin:function(){return a.weekdaysMin()},months:function(){return a.months()},monthsShort:function(){return a.monthsShort()},longDateFormat:function(f){return u(d,f)},meridiem:d.meridiem,ordinal:d.ordinal}},a.months=function(){return o(A(),"months")},a.monthsShort=function(){return o(A(),"monthsShort","months",3)},a.weekdays=function(d){return o(A(),"weekdays",null,null,d)},a.weekdaysShort=function(d){return o(A(),"weekdaysShort","weekdays",3,d)},a.weekdaysMin=function(d){return o(A(),"weekdaysMin","weekdays",2,d)}}})}(zo)),zo.exports}var dN=cN();const fN=Qn(dN);var Bo={exports:{}},hN=Bo.exports,b2;function pN(){return b2||(b2=1,function(t,e){(function(r,n){t.exports=n()})(hN,function(){var r="minute",n=/[+-]\d\d(?::?\d\d)?/g,a=/([+-]|\d\d)/g;return function(i,s,o){var A=s.prototype;o.utc=function(m){var y={date:m,utc:!0,args:arguments};return new s(y)},A.utc=function(m){var y=o(this.toDate(),{locale:this.$L,utc:!0});return m?y.add(this.utcOffset(),r):y},A.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var u=A.parse;A.parse=function(m){m.utc&&(this.$u=!0),this.$utils().u(m.$offset)||(this.$offset=m.$offset),u.call(this,m)};var c=A.init;A.init=function(){if(this.$u){var m=this.$d;this.$y=m.getUTCFullYear(),this.$M=m.getUTCMonth(),this.$D=m.getUTCDate(),this.$W=m.getUTCDay(),this.$H=m.getUTCHours(),this.$m=m.getUTCMinutes(),this.$s=m.getUTCSeconds(),this.$ms=m.getUTCMilliseconds()}else c.call(this)};var d=A.utcOffset;A.utcOffset=function(m,y){var b=this.$utils().u;if(b(m))return this.$u?0:b(this.$offset)?d.call(this):this.$offset;if(typeof m=="string"&&(m=function(T){T===void 0&&(T="");var O=T.match(n);if(!O)return null;var C=(""+O[0]).match(a)||["-",0,0],k=C[0],w=60*+C[1]+ +C[2];return w===0?0:k==="+"?w:-w}(m),m===null))return this;var S=Math.abs(m)<=16?60*m:m,v=this;if(y)return v.$offset=S,v.$u=m===0,v;if(m!==0){var E=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(v=this.local().add(S+E,r)).$offset=S,v.$x.$localOffset=E}else v=this.utc();return v};var f=A.format;A.format=function(m){var y=m||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return f.call(this,y)},A.valueOf=function(){var m=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*m},A.isUTC=function(){return!!this.$u},A.toISOString=function(){return this.toDate().toISOString()},A.toString=function(){return this.toDate().toUTCString()};var h=A.toDate;A.toDate=function(m){return m==="s"&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var p=A.diff;A.diff=function(m,y,b){if(m&&this.$u===m.$u)return p.call(this,m,y,b);var S=this.local(),v=o(m).local();return p.call(S,v,y,b)}}})}(Bo)),Bo.exports}var mN=pN();const gN=Qn(mN);var qo={exports:{}},bN=qo.exports,v2;function vN(){return v2||(v2=1,function(t,e){(function(r,n){t.exports=n()})(bN,function(){return function(r,n){n.prototype.weekday=function(a){var i=this.$locale().weekStart||0,s=this.$W,o=(s<i?s+7:s)-i;return this.$utils().u(a)?o:this.subtract(o,"day").add(a,"day")}}})}(qo)),qo.exports}var yN=vN();const SN=Qn(yN);St.extend(gN),St.extend(lN),St.extend(SN),St.extend(fN);const y2="MM/DD/YYYY",Vo="MM/DD/YYYY - hh:mm A",S2="YYYY-MM-DD",E2="YYYY-MM-DDTHH:mm:ss",T2={ENTER:"Enter"},x2=["MM/DD/YYYY","M/DD/YYYY","MM/D/YYYY","M/D/YYYY","MM/DD/YY","M/DD/YY","MM/D/YY","M/D/YY","YYYY-MM-DD","YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ssZ"],EN=["MM/DD/YYYY - hh:mm A","M/DD/YYYY - hh:mm A","MM/D/YYYY - hh:mm A","M/D/YYYY - hh:mm A","MM/DD/YYYY hh:mm A","M/DD/YYYY hh:mm A","MM/D/YYYY hh:mm A","M/D/YYYY hh:mm A","MM/DD/YYYY HH:mm","M/DD/YYYY HH:mm","MM/D/YYYY HH:mm","M/D/YYYY HH:mm","MM/DD/YY - hh:mm A","M/DD/YY - hh:mm A","MM/D/YY - hh:mm A","M/D/YY - hh:mm A","MM/DD/YY hh:mm A","M/DD/YY hh:mm A","MM/D/YY hh:mm A","M/D/YY hh:mm A","MM/DD/YY HH:mm","M/DD/YY HH:mm","MM/D/YY HH:mm","M/D/YY HH:mm",...x2,"YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ssZ"],TN=()=>Math.random().toString(36).substring(2,9),ji=(t,e=!1)=>{if(!t)return null;const r=e?EN:x2;for(const a of r){const i=St(t,a,!0);if(i.isValid())return i}const n=St(t);return n.isValid()?n:null},O2=(t,e)=>{const r=x.useRef(e);x.useEffect(()=>{r.current=e},[e]),x.useEffect(()=>{const n=a=>r.current(a);return document.addEventListener(t,n),()=>{document.removeEventListener(t,n)}},[t])},w2=x.forwardRef(({label:t,value:e,required:r,isRequiredConditional:n=!1,disabled:a,className:i=void 0,errorMessage:s,handleOnChange:o,showTime:A=!0,tags:u,needConfirm:c=!1,simpleMode:d,originalCase:f=!1,dateFormat:h=void 0,tooltip:p,isAiExtracted:m=!1,isGTN:y=!1,gtnName:b=null,shouldPopOnParent:S=!1,allowTimezoneConversion:v=!0,inputStyle:E,labelClassName:T,isLiveField:O=!1,riskDetails:C,isRiskAnalysisOpen:k=!1,RiskDetailsCard:w,onAddGTNToDocument:D,formatDateForGTN:N,...L},I)=>{const{t:_}=kt.useTranslation(),[M,H]=x.useState(!1),[F,P]=x.useState(null),[q,B]=x.useState(null),[X,G]=x.useState(!1),Q=h||(A?Vo:y2),Y=L?.id||`date-picker-${TN()}`,j=x.useRef(null),ae=x.useRef(!1);O2("paste",$=>{document.activeElement?.id===Y&&($.preventDefault(),navigator.clipboard.readText().then(te=>{const oe=ji(te,A);oe&&Ce(oe)}))}),O2("keydown",$=>{if($.key===T2.ENTER&&document.activeElement instanceof HTMLInputElement&&document.activeElement.id===Y){const te=ji(document?.activeElement?.value,A);te&&Ce(te)}});const se=x.useCallback($=>{if(!D)return;let te=$||"";if(N&&$)te=N($,{skipTimezone:!0,withTime:A});else if($){const Le=St($);Le.isValid()&&(te=Le.format(Q))}D({key:b,value:te})},[D,b,N,A,Q]),le=x.useCallback(()=>{const $=document.getElementsByClassName("ant-picker-footer")[0];$&&($.style.display="none")},[]),Ee=x.useCallback($=>{if(!v){const te=A?E2:S2;if(o($?$.format(te):null),$){const oe=document.getElementById(Y);if(oe){const Le=new CustomEvent("pilot-date-change",{bubbles:!0,detail:{selector:`#${Y}`,value:$.format?$.format(Q):$,type:"date-change",elementId:Y}});oe.dispatchEvent(Le)}}return}if($){let te;if(A?te=St($).utc().toISOString():te=St($).utc().add(St($).utcOffset(),"minute").startOf("day").toISOString(),te){o(te);const oe=document.getElementById(Y);if(oe){const Le=new CustomEvent("pilot-date-change",{bubbles:!0,detail:{selector:`#${Y}`,value:$.format(Q),type:"date-change",elementId:Y}});oe.dispatchEvent(Le)}}}else o(null)},[v,o,A,Y,Q]),ge=x.useCallback($=>{if(!$)return null;if(!v)try{const te=St($);if(te.isValid())return te;const oe=St($,Q);return oe.isValid()?oe:null}catch{return null}if(A){const te=St($);return St(te).isValid()?te:null}else if($?.toString()?.includes("Z")){const te=St.utc($);return St(te).isValid()?te:null}else{const te=St($);return St(te).isValid()?te:null}},[v,Q,A]),Ce=x.useCallback($=>{if($?.isValid()||$===null){P($);const te=A?E2:S2,oe=v?$?.toISOString():$?$.format(te):"";if(o(oe||null),$?.isValid()){const Le=document.getElementById(Y);if(Le){const Ie=new CustomEvent("pilot-date-change",{bubbles:!0,detail:{selector:`#${Y}`,value:$.format(Q),type:"date-change",elementId:Y}});Le.dispatchEvent(Ie)}}}},[v,Q,o,Y,A]);x.useEffect(()=>{P(ge(e))},[e,ge]),x.useEffect(()=>{q&&B(null)},[q]),x.useEffect(()=>{const $=document.getElementById(Y);if(!$)return;const te=oe=>{const{value:Le,type:Ie}=oe.detail;if(Ie==="date-playback"&&Le){const Ye=ji(Le,A);Ye&&Ye.isValid()&&(P(Ye),Ee(Ye),setTimeout(()=>{const Pe=$.querySelector("input");if(Pe&&(Pe.focus(),setTimeout(()=>{Pe.blur()},10)),j.current)try{const Qe=j.current;typeof Qe.blur=="function"&&Qe.blur()}catch{}setTimeout(()=>{document.querySelectorAll(".ant-picker-dropdown:not(.ant-picker-dropdown-hidden)").forEach(At=>{At instanceof HTMLElement&&(At.style.display="none",At.classList.add("ant-picker-dropdown-hidden"))})},50)},50))}};return $.addEventListener("pilot-date-playback",te),()=>{$.removeEventListener("pilot-date-playback",te)}},[Y,Q,Ee,A]);const Re=x.useCallback($=>{if($.key===T2.ENTER&&!X){$.preventDefault(),$.stopPropagation();const te=$.target.closest("form");if(te){const oe=te.querySelector('button[type="submit"]');oe?oe.click():te.requestSubmit()}}},[X]),Te=x.useCallback($=>{if($&&ae.current){ae.current=!1,G(!1);return}G($),$||(ae.current=!0,requestAnimationFrame(()=>{j.current?.focus(),requestAnimationFrame(()=>{ae.current=!1})}))},[]);return d?l.jsx("div",{onKeyDownCapture:Re,children:l.jsx(Fe.DatePicker,{...L,showTime:A,open:X,format:Q,placeholder:Q===Vo?"MM/DD/YYYY hh:mm":Q,value:F,needConfirm:!1,onChange:$=>{P($),Ee($),B($?.toISOString()||null)},className:i,showNow:!1,onFocus:le,onOpenChange:Te,onBlur:$=>{const te=$.target.value;if(te){const oe=ji(te,A);oe&&Ce(oe)}},ref:j,disabled:a,id:Y})}):l.jsxs("div",{ref:I,className:W("flex gap-0.5 relative",M&&y?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>H(!0),onMouseLeave:()=>H(!1),children:[y&&!M?l.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,l.jsxs("div",{className:`w-full flex flex-col font-inter ${i||""}`,onKeyDownCapture:Re,children:[t?l.jsx("label",{className:`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${f?"":"capitalize"} ${T||""}`,children:l.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[l.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[l.jsx(Lt,{label:t||"",required:r||!1,isRequiredConditional:n||!1}),O&&l.jsx(he.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),m&&l.jsx(Vr,{}),l.jsx(Sr,{labels:u}),p&&l.jsx(Me,{placement:"top",title:p,children:l.jsx("div",{className:"cursor-pointer",children:l.jsx(yr,{})})})]}),y&&M&&D?l.jsx("button",{id:"btn-date-field-add-to-document",className:"cursor-pointer",onClick:()=>se(e),type:"button",children:l.jsx(Fe.Tooltip,{placement:"top",title:_("Add to document"),children:l.jsx(he.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}):null,l.jsx(Fe.DatePicker,{...L,showTime:A?{use12Hours:!0}:!1,open:X,format:Q,placeholder:Q===Vo?"MM/DD/YYYY - HH:MM":Q,className:`w-full h-8 text-inter font-medium ${s?"border-red-400":""} dark:text-black-300 ${k&&C?.color&&`bg-${C.color}-50 border-${C.color}-300`}`,styles:{root:{...E,borderRadius:"7px"}},showNow:!1,value:F,onChange:$=>{P($),Ee($),B($?.toISOString()||null)},onBlur:$=>{const te=$.target.value;if(te){const oe=ji(te,A);oe&&(P(oe),Ee(oe))}},needConfirm:c,ref:j,disabled:a,inputReadOnly:!1,onOpenChange:Te,getPopupContainer:S?$=>$.parentElement:()=>document.body,id:Y,autoComplete:"off"}),s&&l.jsx(ee,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:s})]}),M&&C&&k&&w&&l.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:$=>$.stopPropagation(),onMouseDown:$=>$.preventDefault(),onKeyDown:$=>{$.key==="Escape"&&H(!1)},children:l.jsx(w,{riskDetails:C})})]})});w2.displayName="DateTimeField";const C2=({id:t,label:e,onChange:r,errorMessage:n,required:a,bg:i,tags:s,color:o,debounceTimeout:A=0,className:u,isDarkMode:c,...d})=>{const{inputRef:f,...h}=d;return l.jsxs("div",{className:W("flex flex-col",u),children:[e&&l.jsxs("label",{htmlFor:t,className:"block mb-1 text-xs font-medium leading-[18px] text-neutral-600 dark:text-black-300 font-inter capitalize",children:[l.jsx(Lt,{label:e||"",required:a||!1}),l.jsx(Sr,{labels:s})]}),l.jsx("label",{className:"relative block h-8",children:x.createElement(wu.DebounceInput,{...h,debounceTimeout:A,id:t,key:t,required:a,className:W("border",n?"!border-error-300":"border-neutral-200 dark:border-black-600",i,o,"dark:bg-black-700 text-neutral-900 dark:text-neutral-100 text-[14px] rounded-md","focus:outline-none focus:ring-0","focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)]","focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)]","block w-full h-8 px-3 py-1.5 font-inter font-medium","disabled:opacity-70 disabled:!bg-neutral-50 dark:disabled:!bg-black-800"),onChange:p=>{r(p.target.value)},autoComplete:"off"})}),l.jsx(Ke.AnimatePresence,{children:n&&l.jsx(Ke.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.15},children:l.jsx(ee,{className:"pt-1 text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:n})})})]})};C2.displayName="DebounceInputField";const k2=x.forwardRef(({id:t,label:e,placeholder:r,value:n,onChange:a,errorMessage:i,defaultValue:s,required:o=!1,isRequiredConditional:A=!1,dataSource:u,dataKey:c,tags:d,tooltip:f="",originalCase:h=!1,color:p="",isGTN:m=!1,gtnName:y,isAiExtracted:b=!1,labelClassName:S,disabled:v=!1,isLiveField:E=!1,onAddGTNToDocument:T,riskDetails:O,isRiskAnalysisOpen:C=!1,RiskDetailsCard:k,primaryColorShades:w,isRecording:D=!1,isPlaying:N=!1,setDisableActions:L,showDeprecatedFieldWarning:I,DynamicDataModal:_},M)=>{const{t:H}=kt.useTranslation(),[F,P]=x.useState(!1),[q,B]=x.useState(n),[X,G]=x.useState(!1),Q=x.useRef(null),Y=M||Q,j=()=>{L?.(!X),G(!X)},ae=ge=>{if(ge.keyCode===9||ge.key==="Enter"){const Ce=Y.current||Q.current;Ce&&(q!==null&&a(q),B(q),Ce.blur())}},se=()=>{B(""),a("")},le=ge=>{T&&y&&T({key:y,value:ge})},Ee=()=>{const ge="border h-[32px] text-sm rounded-lg block w-full p-2.5 font-inter font-medium",Ce=i?"border-red-300":C&&O?.color?`border-${O?.color}-300`:"border-gray-300 dark:border-black-600",Re="placeholder:text-neutral-900 dark:placeholder:text-black-400",Te=`${C&&O?.color?`bg-${O?.color}-50`:"bg-gray-200 dark:bg-black-600 "} ${p||"text-neutral-900 dark:text-black-200"}`;return`${ge} ${Ce} ${Te} ${Re}`};return x.useEffect(()=>{X&&!u&&(I?.(),G(!1))},[X,u,I]),x.useEffect(()=>{B(n)},[n]),l.jsxs("div",{className:W("flex gap-0.5 w-full relative",F&&m?"border rounded-lg border-primary-100 bg-primary-50 p-1":"",{"error-field":!!i}),onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1),children:[m&&!F?l.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,l.jsxs("div",{className:W("flex flex-col w-full"),children:[l.jsx("label",{htmlFor:"text",className:`text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${h?"":"capitalize"} ${S||""}`,children:l.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[l.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[l.jsx(Lt,{label:e||"",required:o||!1,isRequiredConditional:A||!1}),E&&l.jsx(he.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),b&&l.jsx(Vr,{}),l.jsx(Sr,{labels:d}),f&&l.jsx(Me,{placement:"top",title:f,children:l.jsx("div",{className:"cursor-pointer",children:l.jsx(yr,{})})})]}),m&&F&&T?l.jsx("button",{id:"btn-dynamic-data-input-add-to-document",className:"cursor-pointer",onClick:()=>le(n?.toString()||""),type:"button",children:l.jsx(Fe.Tooltip,{placement:"top",title:H("Add to document"),children:l.jsx(he.NoteAddOutlined,{sx:{fontSize:16,color:w?.[600]||"var(--color-primary-600)"}})})}):null]})}),l.jsxs("label",{className:"relative block mt-1",children:[l.jsx("input",{id:t,ref:Y,required:o,placeholder:r,className:Ee(),onChange:ge=>{a(ge.target.value),B(ge.target?.value)},onKeyDown:ae,value:q!==null?q:n,defaultValue:s,disabled:!0}),l.jsx(Zt,{id:"btn-dynamic-data-input-rx-cross",onClick:se,className:"absolute inset-y-0 right-1 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:v,children:l.jsx(he.CloseRounded,{className:"text-neutral-900 dark:text-black-300",sx:{fontSize:16}})}),l.jsx(Zt,{id:"btn-dynamic-data-input-ai-outline-pic-center",onClick:j,className:"absolute inset-y-0 right-8 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:v,children:l.jsx(he.TableChartRounded,{className:"text-neutral-900 dark:text-black-300",sx:{fontSize:16}})})]}),i&&l.jsx(ee,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:i}),X&&_&&l.jsx(_,{isVisible:X,onSelect:ge=>{a(ge),B(ge)},onClose:j,dataKey:c,dataSource:u})]}),F&&O&&C&&k&&l.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:ge=>ge.stopPropagation(),onMouseDown:ge=>ge.preventDefault(),onKeyDown:ge=>{ge.key==="Escape"&&P(!1)},children:l.jsx(k,{riskDetails:O})})]})});k2.displayName="DynamicDataInputField";const ut=x.forwardRef(({status:t="primary",appearance:e,className:r,disabled:n,children:a,isLoading:i,title:s,id:o,onClick:A,onKeyDown:u,badge:c,type:d="button",options:f,tooltip:h,tooltipPlacement:p="top",shortcuts:m,tooltipShortcuts:y,theme:b="light",autoFocus:S},v)=>{const E=x.useCallback(()=>{switch(e){case"outline":return C();case"ghost":return k();case"dashed":return w();default:return O()}},[e,t,n,b]),T=x.useCallback(()=>{switch(e){case"dashed":return D();default:return{}}},[e,t,n,b]),O=x.useCallback(()=>{switch(t){case"primary":return"bg-primary-600 text-white focus:border-primary-200 hover:bg-primary-700 disabled:opacity-60";case"secondary":return"bg-primary-50 dark:bg-black-800 text-primary-600 dark:hover:text-primary-400 border border-primary-200 dark:border-primary-600 hover:bg-primary-100 dark:hover:bg-black-800 focus:border-primary-200 hover:border-primary-200 dark:hover:border-primary-400 disabled:opacity-60";case"error":return"bg-error-600 dark:bg-error-500 text-white hover:bg-error-700 dark:hover:bg-error-600 focus:!border-error-300 dark:focus:!border-error-600 dark:focus:bg-error-800 disabled:opacity-60";case"error-secondary":return"bg-error-100 dark:bg-black-800 text-error-600 border !border-error-300 dark:!border-error-900 hover:bg-error-200 focus:!border-error-300 dark:focus:!border-error-400 disabled:opacity-60";case"secondary-neutral":return"bg-white dark:bg-black-800 text-neutral-900 border border-neutral-300 dark:border-black-600 dark:hover:bg-black-600 dark:text-black-200 hover:bg-neutral-100 focus:border-primary-200 disabled:opacity-60";case"warning":return"bg-warning-300 dark:bg-warning-600 text-white border-warning-300 border hover:bg-warning-400 disabled:opacity-60";case"success":return"bg-success-600 text-white border-success-600 border hover:bg-success-700 disabled:opacity-60";case"publish":return"bg-teal-800 text-white border-teal-800 border hover:bg-teal-900 disabled:opacity-60";case"no-background":return"bg-transparent text-neutral-900 dark:text-black-100 border-transparent border";default:return"bg-white dark:bg-black-800 text-neutral-900 dark:text-white border-white border hover:bg-neutral-100 dark:hover:bg-black-600 disabled:opacity-60"}},[t,n,b]),C=x.useCallback(()=>{switch(t){case"primary":return"text-primary-700 dark:text-primary-600 border-primary-700 border dark:border-primary-600 hover:bg-primary-100 disabled:opacity-60";case"secondary":return"text-primary-700 dark:text-primary-600 border-primary-100 dark:border-primary-600 border bg-primary-50 dark:bg-black-800 hover:bg-primary-100 disabled:opacity-60";case"secondary-neutral":return"text-neutral-900 dark:text-white border-neutral-300 dark:border-neutral-700 border bg-white dark:bg-black-800 hover:bg-neutral-100 dark:hover:bg-black-600 disabled:opacity-60";case"error":return"text-error-600 dark:text-error-500 !border-error-600 dark:!border-error-500 border hover:bg-[#FEF3F2] disabled:opacity-60";case"warning":return"text-warning-300 dark:text-warning-500 border-warning-300 dark:border-warning-500 border hover:bg-[#FFFAEB] disabled:opacity-60";case"success":return"text-success-600 dark:text-success-500 border-success-600 dark:border-success-500 border hover:bg-[#ECFDF3] disabled:opacity-60";default:return"bg-white dark:bg-black-800 text-neutral-900 dark:text-white border-neutral-300 dark:border-neutral-700 border hover:bg-neutral-100 dark:hover:bg-black-600 disabled:opacity-60"}},[t,b]),k=x.useCallback(()=>{switch(t){case"primary":return"text-primary-700 dark:text-primary-600 border border-transparent dark:border-transparent hover:text-primary-700 disabled:opacity-60";case"secondary":return"text-primary-50 dark:text-primary-900 border border-transparent dark:border-transparent hover:text-primary-100 disabled:opacity-60";case"error":return"text-error-600 dark:text-error-500 border border-transparent dark:border-transparent hover:text-error-600 disabled:opacity-60";case"warning":return"text-warning-300 dark:text-warning-500 border border-transparent dark:border-transparent hover:text-warning-400 disabled:opacity-60";case"success":return"text-success-600 dark:text-success-500 border border-transparent dark:border-transparent hover:text-success-700 disabled:opacity-60";default:return"text-neutral-900 dark:text-white border border-transparent dark:border-transparent hover:text-[#667085] disabled:opacity-60"}},[t,b]),w=x.useCallback(()=>{switch(t){case"primary":return"bg-primary-50 dark:bg-black-700 text-primary-600 dark:text-primary-600 disabled:text-primary-100 hover:bg-primary-100 dark:hover:bg-black-600";default:return"bg-primary-50 dark:bg-black-700 text-primary-600 dark:text-primary-600 disabled:text-primary-100 hover:bg-primary-100 dark:hover:bg-black-600"}},[t,b]),D=x.useCallback(()=>{switch(t){case"primary":return{backgroundImage:"repeating-linear-gradient(3deg, #016DCF, #016DCF 10px, transparent 10px, transparent 19px, #016DCF 19px), repeating-linear-gradient(93deg, #016DCF, #016DCF 10px, transparent 10px, transparent 19px, #016DCF 19px), repeating-linear-gradient(183deg, #016DCF, #016DCF 10px, transparent 10px, transparent 19px, #016DCF 19px), repeating-linear-gradient(273deg, #016DCF, #016DCF 10px, transparent 10px, transparent 19px, #016DCF 19px)",backgroundSize:"1px 100%, 100% 1px, 1px 100% , 100% 1px",backgroundPosition:"0 0, 0 0, 100% 0, 0 100%",backgroundRepeat:"no-repeat"};default:return{}}},[t,b]),N=x.useCallback(()=>{if(!e||e==="filled")switch(t){case"primary":return"bg-primary-700 text-primary-100";case"secondary":return"bg-primary-100 text-primary-700 dark:bg-black-700 dark:text-primary-400";case"secondary-neutral":return"bg-neutral-100 text-neutral-500 dark:bg-black-700 dark:text-black-300";case"error":return"bg-error-700 text-error-100 dark:bg-error-600 dark:text-error-100";case"error-secondary":return"bg-error-200 text-error-700 dark:bg-black-700 dark:text-error-400";case"warning":return"bg-warning-400 text-white dark:bg-warning-700 dark:text-warning-100";case"success":return"bg-success-700 text-success-100";case"publish":return"bg-teal-900 text-teal-200";case"no-background":return"bg-neutral-100 text-neutral-500 dark:bg-black-700 dark:text-neutral-400";default:return"bg-neutral-100 text-neutral-500 dark:bg-black-700 dark:text-neutral-400"}switch(t){case"primary":case"secondary":return"bg-primary-100 text-primary-800 dark:bg-primary-950 dark:text-primary-400";case"error":case"error-secondary":return"bg-error-100 text-error-700 dark:bg-error-950 dark:text-error-400";case"warning":return"bg-warning-100 text-warning-700 dark:bg-warning-950 dark:text-warning-400";case"success":return"bg-success-100 text-success-700 dark:bg-success-950 dark:text-success-400";default:return"bg-neutral-100 text-neutral-500 dark:bg-black-700 dark:text-neutral-400"}},[t,e]),L=Qi(),I=x.useMemo(()=>m?.length?m.map(H=>{const F=_o[H];return F?L==="macos"?F.macos:F.other:H}):[],[m,L]),_=()=>l.jsx(l.Fragment,{children:l.jsx(ku.CgSpinner,{size:24,className:"inline mr-2 spinner"})}),M=d||(t==="primary"&&e==="filled"?"submit":d);return l.jsx(Me,{title:h,placement:p,shortcuts:y,delayShow:!0,children:l.jsxs("button",{ref:v,className:`
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
relative
|
|
69
69
|
max-h-[32px]
|
|
70
70
|
${E()}
|
|
71
|
-
`,style:{...T()},disabled:n||i,id:o,onClick:A,onKeyDown:u,title:s,type:M,autoFocus:S,children:[i&&_(),a,I.length>0?l.jsx("span",{className:"inline-flex items-center gap-0.5 ml-1 flex-shrink-0",children:I.map((H,F)=>l.jsx("kbd",{className:`inline-flex items-center justify-center min-w-[20px] h-5 px-1 rounded text-[11px] font-medium leading-none ${N()}`,children:H},F))}):null,f?.length?l.jsx("div",{onClick:H=>H.stopPropagation(),children:l.jsx(Fe.Dropdown,{menu:{items:f},trigger:["click"],overlayClassName:"row-option-cell",placement:"bottomRight",children:l.jsx(he.ChevronRightRounded,{className:"rotate-90 text-neutral-300 hover:opacity-50"})})}):null,c?l.jsx("span",{className:"absolute -top-2 -right-2 bg-zinc-500 text-white rounded-full min-w-[1.5rem] min-h-[1.5rem] text-xs flex justify-center items-center",children:c}):null]})})});ut.displayName="Button";const N2=(t={})=>{const{primaryContainerId:e="layout-app-main-content-container",fallbackContainerId:r="full-screen-container",maxRetries:n=10,retryDelay:a=100}=t,[i,s]=x.useState(null);return x.useEffect(()=>{let o=0,A;const u=d=>{if(typeof document<"u"){const f=document.getElementById(d);if(f)return f}if(typeof globalThis<"u"&&globalThis.window&&globalThis.window.parent&&globalThis.window.parent!==globalThis.window)try{const f=globalThis.window.parent.document?.getElementById(d);if(f)return f}catch{}return null},c=()=>{let d=u(e);if(!d&&r&&(d=u(r)),d){s(d);return}o<n?(o++,A=setTimeout(c,a)):s(document.body)};return c(),()=>{A&&clearTimeout(A)}},[e,r,n,a]),i},Pr=t=>{const{open:e,children:r,title:n,mask:a=!0,onlyBody:i=!1,bodySpacing:s=!0,headerRightContent:o,parentContainer:A,zIndex:u,asForm:c=!0,onSubmit:d,showCloseButton:f=!0,noPadding:h=!1,...p}=t,m=N2({primaryContainerId:"layout-app-main-content-container",fallbackContainerId:"full-screen-container"}),y=l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex justify-between items-center",children:[f?l.jsx(ee,{size:"large",variant:"semibold",className:"tour__title",children:n}):l.jsx("div",{className:"flex flex-col w-full",children:n}),o||f&&l.jsx("button",{id:"btn-modal-close",onClick:p.onCancel,className:"",type:"button",children:l.jsx(he.CloseRounded,{sx:{fontSize:"20px"},className:"cursor-pointer text-neutral-400 hover:text-neutral-600"})})]}),p.addLineAfterHeader&&l.jsx("hr",{className:"mt-2"})]}),b=c?"form":"div",S=()=>{if(A){if(typeof document<"u"){const O=document.getElementById(A);if(O)return O}if(typeof globalThis<"u"&&globalThis.window&&globalThis.window.parent&&globalThis.window.parent!==globalThis.window)try{const O=globalThis.window.parent.document?.getElementById(A);if(O)return O}catch{}}return m};if(!e)return null;const v=S();if(!v)return null;const E=v!==document.body;return l.jsx(Fe.Modal,{open:e,centered:!0,closable:!1,title:i?null:y,modalRender:O=>l.jsx(b,{onSubmit:C=>{C.preventDefault(),d&&d()},children:l.jsx("div",{role:"none",onClick:C=>C.stopPropagation(),children:O})}),styles:{content:{padding:h?"0px":"20px 0px"},header:{padding:h?"0px":"0px 20px"},body:{padding:h?"0px":s?"0px 20px":"0px"},footer:{padding:h?"0px":"0px 20px"},mask:{zIndex:u||1e3,position:E?"absolute":void 0,top:E?0:void 0,right:E?0:void 0,bottom:E?0:void 0,left:E?0:void 0},wrapper:{zIndex:u||1e3,position:E?"absolute":void 0,top:E?0:void 0,right:E?0:void 0,bottom:E?0:void 0,left:E?0:void 0,backgroundColor:a?"rgb(16 24 40 / 80%)":void 0}},mask:a,...p,getContainer:()=>v,children:r})},yt={createSuccess:function(t){return`${t} created successfully.`},createFailure:function(t){return`${t} creation failed. Please retry.`},updateSuccess:function(t){return`${t} updated successfully.`},updateFailure:function(t){return`${t} update failed. Please retry.`},copySuccess:function(t){return`${t} copied successfully.`},copyFailure:function(t){return`${t} copy failed. Please retry.`},copyToClipboard:function(t){return`${t} copied to clipboard.`},moveSuccess:function(t){return`${t} moved successfully.`},moveFailure:function(t){return`${t} move failed. Please retry.`},restoreSuccess:function(t){return`${t} restored successfully.`},resetSuccess:function(t){return`${t} reset successfully.`},resetFailure:function(t){return`${t} reset failed. Please retry.`},restoreFailure:function(t){return`${t} restore failed. Please retry.`},deleteSuccess:function(t){return`${t} deleted successfully.`},deleteFailure:function(t){return`${t} delete failed. Please retry.`},addSuccess:function(t){return`${t} added successfully.`},addFailure:function(t){return`${t} add failed. Please retry.`},removeSuccess:function(t){return`${t} removed successfully.`},removeFailure:function(t){return`${t} remove failed. Please retry.`},importSuccess:function(t){return`${t} imported successfully.`},importFailure:function(t){return`${t} import failed. Please retry.`},exportSuccess:function(t){return`${t} exported successfully.`},exportFailure:function(t){return`${t} export failed. Please retry.`},installSuccess:function(t){return`${t} installed successfully.`},duplicateSuccess:function(t){return`${t} duplicated successfully.`},installFailure:function(t){return`${t} install failed. Please retry.`},uninstallSuccess:function(t){return`${t} uninstalled successfully.`},uninstallFailure:function(t){return`${t} uninstall failed. Please retry.`},approveSuccess:function(t){return`${t} approved successfully.`},approveFailure:function(t){return`${t} approve failed. Please retry.`},rejectSuccess:function(t){return`${t} rejected successfully.`},rejectFailure:function(t){return`${t} reject failed. Please retry.`},archiveSuccess:function(t){return`${t} archived successfully.`},archiveFailure:function(t){return`${t} archive failed. Please retry.`},activateSuccess:function(t){return`${t} activated successfully.`},activateFailure:function(t){return`${t} activation failed. Please retry.`},deactivateSuccess:function(t){return`${t} deactivated successfully.`},deactivateFailure:function(t){return`${t} deactivation failed. Please retry.`},fileSizeLimit:function(t,e){return`File size exceeds the limit of ${t} ${e}.`},fetchFailure:function(t){return`An error occurred while fetching ${t}. Please retry.`},requiredField:function(t){return`${t} is required.`},existsError:function(t){return`${t} already exists.`},shouldNotContainOnlySpaces:function(t){return`${t} shouldn't contain only spaces.`},notAllowed:function(t){return`${t} not allowed.`},allowed:function(t){return`${t} allowed.`},multipleNotAllowed:function(t){return`Multiple ${t} not allowed.`},notFound:function(t){return`${t} not found.`},sendForApproval:function(t){return`${t} sent for approval.`},invalidError:function(t){return`Invalid ${t}.`},success:function(t){return`${t} successful.`},initializationError:function(t){return`Please initialize the ${t}.`},selectError:function(t){return`Please select ${t}.`},importStarted:function(t){return`${t} import has started.`},initiationSuccess:function(t){return`${t} initiated successfully.`},initiationFailure:function(t){return`${t} initiation failed. Please retry.`},transferSuccess:function(t){return`${t} has been successfully transferred.`},transferFailure:function(t){return`${t} transfer has failed, Please retry.`},terminatedSuccess:function(t){return`${t} terminated successfully.`},terminatedFailure:function(t){return`${t} termination failed, Please retry.`},markedAs:function(t){return`Marked as ${t}.`},bulkStatusChangeSuccess:function(t){return`Status changed to ${t?"locked":"unlocked"} successfully.`},bulkStatusChangeFailure:function(t){return`Status change to ${t?"locked":"unlocked"} failed, Please retry.`},downloading:function(t){return`Downloading ${t}...`},downloadFailure:function(t){return`Download ${t} failed. Please retry.`},bulkStatusChangeInfo:"Status change default info",bulkStatusChangeDefault:"Unknown response type",bulkDeleteUsersSuccess:"Users deleted successfully.",bulkDeleteUsersFailure:"Bulk user delete failed, Please retry.",errorMessage:"Something went wrong.",requiredFieldError:"Please fill out all mandatory fields.",resetPasswordSuccess:"Password reset successfully.",noItemSelected:"No item selected.",fieldAlreadyExist:"Field has already been added to this step.",fetchingError:"An error occurred while fetching configuration details.",secondaryOwnerLimitExceed:"Can't add more than 3 users to 'Secondary Owner'.",saveChangesAlert:"Please save the changes before switching tabs.",visibleColumnError:"There must be at least one visible column.",sessionExpired:"Session expired. Please login.",invalidFileType:"Non acceptable file type.",triggerNodeError:"Trigger is required!",formatFailed:"Failed to format.",memberRemoveSuccess:"Team member removed successfully.",memberRemoveInfo:"Team member removed default info.",memberRemoveError:"Unable to remove team member.",memberRemoveWarning:"Unable to remove team member.",memberRemoveDefault:"Unknown response type."},D2=({monacoEditor:t,currentEditorModel:e,code:r,setCode:n,enable:a,checkSyntaxAPI:i,formatCodeAPI:s})=>{const[o,A]=x.useState(null),[u,c]=x.useState(!1);function d(m){const y={};let b=0;return{result:m.replace(/{{(.*?)}}/g,(v,E,T,O)=>{const C=O.slice(0,T),k=O.slice(T+v.length),w=C.endsWith('"')&&k.startsWith('"'),D=C.endsWith("'")&&k.startsWith("'");return w||D?v:(y[`__dynamic_value_${b}`]=v,`"__dynamic_value_${b++}"`)}),originalValues:y}}function f(m,y){return m.replace(/"__dynamic_value_\d+"/g,b=>{const S=b.slice(1,-1);return y[S]||b})}const h=async()=>{if(!t||!e||!i){console.warn("Monaco editor, model, or syntax check API not available");return}c(!0);try{const{result:m}=d(r),b=(await i(m))?.data?.error;if(b?.message){A(b);const S=[{startLineNumber:b.line||1,endLineNumber:b.line||1,startColumn:b.column||1,endColumn:b.column||1,message:b.message,severity:t.MarkerSeverity?.Error||8}];try{t.editor.setModelMarkers(e,"owner",S)}catch(v){console.warn("Failed to set error markers:",v)}}else{A(null);try{t.editor.setModelMarkers(e,"owner",[])}catch(S){console.warn("Failed to clear error markers:",S)}}}catch(m){if(console.warn("Syntax check failed:",m),A(null),t&&e)try{t.editor.setModelMarkers(e,"owner",[])}catch(y){console.warn("Failed to clear error markers after error:",y)}}finally{c(!1)}},p=async()=>{if(!t||!e||!s){console.warn("Monaco editor, model, or format API not available");return}c(!0);try{const{result:m,originalValues:y}=d(r),b=await s(m);if(b?.data?.formatted_code){const S=f(b.data.formatted_code,y);n(S)}else console.warn("No formatted code received from service")}catch(m){const y=m?.message||yt.formatFailed;console.warn("Code formatting failed:",y),ct.toast.error(y,{toastId:y})}finally{c(!1)}};return x.useEffect(()=>{if(t&&a&&i){const m=Nu.debounce(h,500);return m(),()=>{m.cancel()}}},[r,t]),{pythonError:o,pythonLoading:u,handleCheckSyntax:h,handleFormatCode:p}};class $a{static instance;monaco=null;initialized=!1;initializationPromise=null;static getInstance(){return $a.instance||($a.instance=new $a),$a.instance}async initialize(){return this.initialized&&this.monaco?this.monaco:this.initializationPromise?this.initializationPromise:(this.initializationPromise=this.performInitialization(),this.initializationPromise)}async performInitialization(){try{return this.monaco=await Vb.loader.init(),this.initialized=!0,this.initializationPromise=null,this.monaco}catch(e){throw this.initializationPromise=null,console.error("Failed to initialize Monaco Editor:",e),new Error(`Monaco Editor initialization failed: ${e instanceof Error?e.message:"Unknown error"}`)}}getMonaco(){return this.monaco}isInitialized(){return this.initialized}getEditorInstance(e=0){if(!this.monaco)return console.warn("Monaco Editor not initialized"),null;const r=this.monaco.editor.getEditors();return r.length<=e?(console.warn(`No editor found at index ${e}. Available editors: ${r.length}`),null):r[e]}getFirstEditorInstance(){return this.getEditorInstance(0)}static safeDispose(e){e.forEach(r=>{try{r&&typeof r.dispose=="function"&&r.dispose()}catch(n){console.warn("Error disposing Monaco resource:",n)}})}}const P2=$a.getInstance(),L2=["US","GB","IN","DE","FR","CN","JP","BR","CA","AU","IT","ES","RU","KR","ZA","MX","TR","ID","SA","AR","NL","CH","SE","BE","PL","EG","SG","TH","UA","PK","BD","PH","VN","MY","CO","CL","NO","DK","FI","IE","AT","GR","PT","HU","CZ","RO","NZ","AE","GH","EU","MA","NG","TW","HK","KE","IR","PE","QA","KW","LK","NP"];function Wu(t){return{US:"United States",GB:"United Kingdom",IN:"India",DE:"Germany",FR:"France",CN:"China",JP:"Japan",BR:"Brazil",CA:"Canada",AU:"Australia",IT:"Italy",ES:"Spain",RU:"Russia",KR:"South Korea",ZA:"South Africa",MX:"Mexico",TR:"Turkey",ID:"Indonesia",SA:"Saudi Arabia",AR:"Argentina",NL:"Netherlands",CH:"Switzerland",SE:"Sweden",BE:"Belgium",PL:"Poland",EG:"Egypt",SG:"Singapore",TH:"Thailand",UA:"Ukraine",PK:"Pakistan",BD:"Bangladesh",PH:"Philippines",VN:"Vietnam",MY:"Malaysia",CO:"Colombia",CL:"Chile",NO:"Norway",DK:"Denmark",FI:"Finland",IE:"Ireland",AT:"Austria",GR:"Greece",PT:"Portugal",HU:"Hungary",CZ:"Czech Republic",RO:"Romania",NZ:"New Zealand",AE:"United Arab Emirates",GH:"Ghana",EU:"European Union",MA:"Morocco",NG:"Nigeria",TW:"Taiwan",HK:"Hong Kong",KE:"Kenya",IR:"Iran",PE:"Peru",QA:"Qatar",KW:"Kuwait",LK:"Sri Lanka",NP:"Nepal"}[t]||t}const I2=x.createContext(null),_2=I2.Provider,Ja=()=>{const t=x.useContext(I2);if(!t)throw new Error("useJsonGridViewerContext must be used within a JsonGridViewerContextProvider");return t},we={STRING:"string",NUMBER:"number",BOOLEAN:"boolean",NULL:"null",OBJECT:"object",ARRAY:"array"},M2={[we.ARRAY]:"text-purple-600 bg-purple-100",[we.OBJECT]:"text-warning-600 bg-warning-100",[we.STRING]:"text-success-600 bg-success-100",[we.NUMBER]:"text-blue-600 bg-blue-100",[we.BOOLEAN]:"text-purple-600 bg-purple-100",[we.NULL]:"text-neutral-600 bg-neutral-100"},Wo=[{label:"String",value:we.STRING},{label:"Number",value:we.NUMBER},{label:"Boolean",value:we.BOOLEAN},{label:"Null",value:we.NULL},{label:"Object",value:we.OBJECT},{label:"Array",value:we.ARRAY}],Xu=t=>t===null?we.NULL:Array.isArray(t)?we.ARRAY:typeof t=="object"?we.OBJECT:typeof t,H2=t=>{const e=[...t].sort((n,a)=>n.length-a.length),r=[];for(const n of e)r.some(i=>n!==i&&n.startsWith(i+"."))||r.push(n);return r},R2=t=>!t||t.trim()===""?{}:JSON.parse(t),F2=(t,e)=>{const r=x.useCallback((i,s)=>{const o=[],A=(u,c)=>{Array.isArray(u)?u.forEach((d,f)=>{const h=`${c}.${f}`;o.push(h),typeof d=="object"&&d!==null&&A(d,h)}):u&&typeof u=="object"&&Object.entries(u).forEach(([d,f])=>{const h=`${c}.${d}`;o.push(h),typeof f=="object"&&f!==null&&A(f,h)})};return A(s,i),o},[]),n=x.useCallback((i,s,o,A)=>{if(s){const u=[i];if(A){const c=r(i,o);u.push(...c)}e(Array.from(new Set([...t,...u])))}else{const u=[i];if(A){const c=r(i,o);u.push(...c)}e(t?.filter(c=>!u.includes(c))||[])}},[t,e,r]),a=x.useCallback(i=>t?.includes(i)||!1,[t]);return{handleCheckboxChange:n,isPathSelected:a,getAllChildPaths:r}},U2=({value:t,path:e,onChange:r,isDarkMode:n=!1})=>{const[a,i]=x.useState(""),s=Xu(t),{selectedPathForEdit:o,setSelectedPathForEdit:A}=Ja();x.useEffect(()=>{s===we.STRING?i(t):s===we.NUMBER||s===we.BOOLEAN?i(String(t)):s===we.NULL&&i("null")},[t,s]);const u=d=>{i(d.target.value)},c=()=>{try{let d;if(s===we.NUMBER){if(d=Number(a),a.trim()==="")throw new Error("Empty number");if(d=Number(a),Number.isNaN(d))throw new Error("Invalid number")}else if(s===we.BOOLEAN)if(a.toLowerCase()==="true")d=!0;else if(a.toLowerCase()==="false")d=!1;else throw new Error("Invalid boolean value");else if(s===we.NULL)if(a.toLowerCase()==="null")d=null;else throw new Error("Invalid null value");else d=a;r(e,d),A(null)}catch{s===we.STRING?i(t):s===we.NUMBER||s===we.BOOLEAN?i(String(t)):s===we.NULL&&i("null")}};return s===we.BOOLEAN?l.jsx(kn,{isChecked:t,onChange:d=>r(e,d)}):s===we.NULL?l.jsx("span",{className:n?"text-neutral-400 italic":"text-neutral-500 italic",children:"null"}):o===e&&s===we.NUMBER?l.jsx(Gn,{value:a,onChange:d=>{const h=d.replace(/\.(?=.*\.)/g,"").replace(/[^\d.-]/g,"");i(h)},className:"w-full",onBlur:c}):o===e&&s===we.STRING?l.jsx("div",{className:"w-full min-w-36",children:l.jsx("textarea",{value:a,onChange:u,onBlur:c,className:`w-full min-w-36 rounded-lg px-2 py-1 text-sm focus:outline-none focus:border-blue-500 border resize-none hover:resize-y ${n?"bg-black-800 text-white":"bg-white text-black"}`,rows:1})}):l.jsx("span",{className:W(n?"text-neutral-400":"text-neutral-900","text-sm font-medium"),children:t})},xN=({isExpanded:t})=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",className:W(t?"rotate-90":"rotate-0","transition-transform duration-200"),children:l.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),ON=()=>l.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:l.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),wN=()=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",className:"text-neutral-500 dark:text-neutral-400",children:l.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),Qu=({data:t,path:e,onChange:r})=>{const n=Array.isArray(t),[a,i]=x.useState([]),{allExpanded:s,isDarkMode:o,selectedPaths:A,setSelectedPaths:u,setSelectedPathModification:c,isEditMode:d,handleCopy:f}=Ja(),{handleCheckboxChange:h,isPathSelected:p}=F2(A,u),m=()=>{const E=[],T=(O,C)=>{Array.isArray(O)?O.forEach((k,w)=>{const D=`${C}.${w}`;typeof k=="object"&&k!==null&&(E.push(D),T(k,D))}):O&&typeof O=="object"&&Object.entries(O).forEach(([k,w])=>{const D=`${C}.${k}`;typeof w=="object"&&w!==null&&(E.push(D),T(w,D))})};return T(t,e),E};x.useEffect(()=>{t&&i(s?m():[])},[s,t,e]);const y=E=>{i(T=>T.includes(E)?T.filter(O=>O!==E):[...T,E])},b=(E,T)=>{r(E,T)},S=e==="",v=(E,T,O,C,k)=>{const w=Xu(T),D=w===we.OBJECT||w===we.ARRAY,N=`${O}.${E}`,L=a.includes(N);return l.jsxs("tr",{className:W("border-neutral-300 dark:border-neutral-700",S?"border-b":k?"border-b-0":"border-b"),children:[l.jsx("td",{className:W("px-3 py-4 align-top border-r text-sm font-medium w-1/4",o?"text-neutral-200 bg-black-700":"bg-neutral-100 text-[#101828]",C&&!S&&"rounded-tl-xl",k&&!S&&"rounded-bl-xl"),children:l.jsxs("div",{className:"flex items-center",children:[d&&l.jsx(e2,{id:`checkbox-${N}`,label:"",isChecked:p(N),onChange:I=>h(N,I.target.checked,T,D)}),l.jsx("span",{className:"text-neutral-500 dark:text-neutral-400 whitespace-nowrap",children:E})]})}),l.jsx("td",{className:"!w-[120px] py-4 px-3 align-top bg-white dark:bg-black-800",children:l.jsx("div",{className:"flex items-start justify-center h-full",children:l.jsx("span",{className:`${M2[w]} px-2 py-1 rounded-xl text-xs`,children:w?.toUpperCase()})})}),l.jsx("td",{className:W("border-l border-neutral-300 dark:border-neutral-700 bg-white dark:bg-black-800",!d&&C&&!S&&"rounded-tr-xl",!d&&k&&!S&&"rounded-br-xl","!min-w-36"),children:l.jsx("div",{className:"py-2 px-3 flex items-center justify-start h-full",children:D?l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("button",{onClick:()=>y(N),className:`mr-1 p-0.5 flex items-center justify-center rounded ${o?"hover:bg-black-700 text-neutral-200":"hover:bg-neutral-300 text-neutral-600"}`,children:l.jsx(xN,{isExpanded:L})}),l.jsx("span",{className:W(o?"text-neutral-400":"text-neutral-900","text-sm font-medium"),children:L?w===we.ARRAY?`[${T.length} items]`:`{${Object.keys(T).length} items}`:w===we.ARRAY?`[${T.length} items]`:"{...}"}),!d&&l.jsx("button",{className:"ml-2",onClick:()=>f([N]),children:l.jsx(ON,{})})]}),L&&(Array.isArray(T)&&T?.length>0||Object.keys(T).length>0)&&l.jsx("div",{className:"ml-1.5 mt-3",children:l.jsx(Qu,{data:T,path:N,onChange:b})})]}):l.jsx(U2,{value:T,path:N,onChange:b,isDarkMode:o})})}),d&&l.jsx("td",{className:W("w-6 py-3.5 align-top bg-white dark:bg-black-800",C&&!S&&"rounded-tr-xl",k&&!S&&"rounded-br-xl"),children:l.jsx("button",{onClick:()=>c(N),className:"p-1 rounded hover:bg-neutral-100 dark:hover:bg-black-700",children:l.jsx(wN,{})})})]},N)};return t?l.jsx("div",{className:S?"border-none":"border border-neutral-300 dark:border-neutral-700 rounded-xl",children:l.jsx("table",{className:W("w-full"),children:l.jsx("tbody",{children:n?t.map((E,T)=>v(T,E,e,T===0,T===t.length-1)):Object.entries(t).map(([E,T],O)=>v(E,T,e,O===0,O===Object.keys(t).length-1))})})}):null},z2=({onChange:t,style:e})=>{const{isDarkMode:r,error:n,jsonData:a,setJsonData:i}=Ja();if(!a)return null;const s=(o,A)=>{if(!o||o===".")return;const u=o.split(".");u.shift();const c=structuredClone(a);let d=c;for(let h=0;h<u.length-1;h++){const p=u[h];if(Array.isArray(d)){const m=parseInt(p,10);d=d[m]}else d=d[p]}const f=u[u.length-1];if(Array.isArray(d)){const h=parseInt(f,10);d[h]=A}else d[f]=A;i(c),t?.(JSON.stringify(c,null,2))};return n?l.jsx("div",{className:r?"p-4 bg-red-900 text-red-300 border border-red-800 rounded":"p-4 bg-red-50 text-red-600 border border-red-300 rounded",children:n}):l.jsx("div",{className:W(r?"shadow-sm overflow-auto":"bg-white dark:bg-black-800 shadow-sm overflow-auto"),style:e,id:"json-grid-core-container",children:l.jsx("div",{className:"p-0 overflow-auto",children:l.jsx(Qu,{data:a,path:"",onChange:s})})})},B2=({visible:t,onClose:e,content:r,title:n,onConfirm:a,isLoading:i,variant:s,cancelText:o="Cancel",confirmText:A})=>{const u=x.useMemo(()=>l.jsxs("div",{className:"flex justify-end gap-3",children:[l.jsx(ut,{id:"btn-confirmation-modal-cancel",onClick:e,disabled:i,status:"secondary-neutral",children:o}),l.jsx(ut,{id:`btn-confirmation-modal-${s==="destructive"?"Delete":"Confirm"}`,onClick:a,isLoading:i,status:s==="destructive"?"error":"primary",autoFocus:!0,children:A||(s==="destructive"?"Delete":"Confirm")})]}),[e,a,i,s,o,A]);return t?l.jsx(Pr,{title:n,open:t,footer:u,onCancel:e,zIndex:9999,children:l.jsx("div",{className:"my-5",children:l.jsx("div",{className:"text-neutral-400 font-inter text-base",children:r})})}):null},CN=({size:t=24,fill:e="currentColor",className:r})=>l.jsx("svg",{className:r,width:t,height:t,viewBox:"0 0 20 20",fill:e,xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M10.0002 11.1666L5.91683 15.2499C5.76405 15.4027 5.56961 15.4791 5.3335 15.4791C5.09739 15.4791 4.90294 15.4027 4.75016 15.2499C4.59738 15.0971 4.521 14.9027 4.521 14.6666C4.521 14.4305 4.59738 14.236 4.75016 14.0833L8.8335 9.99992L4.75016 5.91659C4.59738 5.76381 4.521 5.56936 4.521 5.33325C4.521 5.09714 4.59738 4.9027 4.75016 4.74992C4.90294 4.59714 5.09739 4.52075 5.3335 4.52075C5.56961 4.52075 5.76405 4.59714 5.91683 4.74992L10.0002 8.83325L14.0835 4.74992C14.2363 4.59714 14.4307 4.52075 14.6668 4.52075C14.9029 4.52075 15.0974 4.59714 15.2502 4.74992C15.4029 4.9027 15.4793 5.09714 15.4793 5.33325C15.4793 5.56936 15.4029 5.76381 15.2502 5.91659L11.1668 9.99992L15.2502 14.0833C15.4029 14.236 15.4793 14.4305 15.4793 14.6666C15.4793 14.9027 15.4029 15.0971 15.2502 15.2499C15.0974 15.4027 14.9029 15.4791 14.6668 15.4791C14.4307 15.4791 14.2363 15.4027 14.0835 15.2499L10.0002 11.1666Z"})}),kN=({fill:t="#cccccc",className:e})=>l.jsx("svg",{height:"20",width:"20",viewBox:"0 0 20 20",focusable:"false",className:e,children:l.jsx("path",{fill:t,d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"})}),NN=({size:t=24,fill:e="currentColor",className:r,onClick:n})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 20 20",fill:e,xmlns:"http://www.w3.org/2000/svg",className:r,onClick:n,children:l.jsx("g",{mask:"url(#mask0_6454_18843)",children:l.jsx("path",{d:"M5.8335 17.5C5.37516 17.5 4.9828 17.3368 4.65641 17.0104C4.33002 16.684 4.16683 16.2917 4.16683 15.8333V5C3.93072 5 3.7328 4.92014 3.57308 4.76042C3.41336 4.60069 3.3335 4.40278 3.3335 4.16667C3.3335 3.93056 3.41336 3.73264 3.57308 3.57292C3.7328 3.41319 3.93072 3.33333 4.16683 3.33333H7.50016C7.50016 3.09722 7.58002 2.89931 7.73975 2.73958C7.89947 2.57986 8.09738 2.5 8.3335 2.5H11.6668C11.9029 2.5 12.1009 2.57986 12.2606 2.73958C12.4203 2.89931 12.5002 3.09722 12.5002 3.33333H15.8335C16.0696 3.33333 16.2675 3.41319 16.4272 3.57292C16.587 3.73264 16.6668 3.93056 16.6668 4.16667C16.6668 4.40278 16.587 4.60069 16.4272 4.76042C16.2675 4.92014 16.0696 5 15.8335 5V15.8333C15.8335 16.2917 15.6703 16.684 15.3439 17.0104C15.0175 17.3368 14.6252 17.5 14.1668 17.5H5.8335ZM5.8335 5V15.8333H14.1668V5H5.8335ZM7.50016 13.3333C7.50016 13.5694 7.58002 13.7674 7.73975 13.9271C7.89947 14.0868 8.09738 14.1667 8.3335 14.1667C8.56961 14.1667 8.76752 14.0868 8.92725 13.9271C9.08697 13.7674 9.16683 13.5694 9.16683 13.3333V7.5C9.16683 7.26389 9.08697 7.06597 8.92725 6.90625C8.76752 6.74653 8.56961 6.66667 8.3335 6.66667C8.09738 6.66667 7.89947 6.74653 7.73975 6.90625C7.58002 7.06597 7.50016 7.26389 7.50016 7.5V13.3333ZM10.8335 13.3333C10.8335 13.5694 10.9134 13.7674 11.0731 13.9271C11.2328 14.0868 11.4307 14.1667 11.6668 14.1667C11.9029 14.1667 12.1009 14.0868 12.2606 13.9271C12.4203 13.7674 12.5002 13.5694 12.5002 13.3333V7.5C12.5002 7.26389 12.4203 7.06597 12.2606 6.90625C12.1009 6.74653 11.9029 6.66667 11.6668 6.66667C11.4307 6.66667 11.2328 6.74653 11.0731 6.90625C10.9134 7.06597 10.8335 7.26389 10.8335 7.5V13.3333Z"})})}),ju=t=>{const{show:e,isFlowDashboard:r,onClose:n,actionItems:a,selectedItemsCount:i,deleteConfig:s,showActionBg:o}=t,{t:A}=kt.useTranslation(),[u,c]=x.useState(!1),[d,f]=x.useState(!0),h=x.useRef(null),p=x.useRef(null);x.useEffect(()=>{const b=new ResizeObserver(()=>{if(h.current&&p.current){const S=h.current.scrollWidth-100;a.length*180+100>S?f(!1):f(!0)}});return h.current&&b.observe(h.current),()=>{h.current&&b.unobserve(h.current)}});const m={label:A("Delete"),icon:l.jsx(NN,{size:16,className:"text-error-500"}),onClick:s?.onClick,...s},y=a.filter(b=>b.visible!==!1).map((b,S)=>({key:S,label:l.jsx(or,{icon:b.dropdownIcon,text:b?.label||"",onClick:b.onClick,className:"font-inter text-[14px] font-medium text-black-900 dark:text-black-200 gap-1.5"}),children:b.dropdownItems,disabled:!1}));return e?l.jsx(Ke.motion.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},exit:{y:20,opacity:0},transition:{duration:.2,ease:[.4,0,.2,1],opacity:{duration:.15}},ref:h,className:W("h-[40px]",r?"ml-60 w-1/2":"w-full"),children:l.jsxs("div",{className:W("h-[40px] border py-1.5 px-2 text-white bg-primary-800 dark:bg-black-700 flex justify-between items-center"),children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx(Zt,{tooltip:"Close",variant:"ghost",onClick:n,className:"hover:bg-primary-100 !p-0",children:l.jsx(CN,{size:20})}),l.jsxs("div",{className:"flex items-center gap-1.5 ml-2",children:[l.jsx("span",{className:"text-primary-600 dark:text-black-100 bg-primary-50 dark:bg-black-800 border-primary-200 dark:border-black-800 text-xs leading-4 font-normal border rounded-full pr-2 pl-2",children:i||0}),l.jsx(ee,{size:"extra-small",appearance:"custom",className:"text-white",children:A("Selected")})]})]}),l.jsx("div",{ref:p,className:W("h-[36px] flex items-center rounded-full font-inter",o?"bg-primary-900 dark:bg-black-800 px-[10px] rounded-[43px]":""),children:d?l.jsxs(Ke.motion.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"flex bg-primary-800 dark:bg-black-800 px-4 rounded-full",children:[a.map((b,S)=>b.visible!==!1&&l.jsx("div",{children:b.type==="dropdown"?l.jsx(Fe.Dropdown,{menu:{items:b.dropdownItems},trigger:[b.dropdownTrigger||"click"],overlayClassName:"!min-w-[148px]",placement:"bottomRight",getPopupContainer:v=>v.parentElement,open:u,onOpenChange:c,children:l.jsxs("button",{id:`btn-floating-bar-${b.label}`,onClick:b.onClick,disabled:b.disabled,className:W(b?.label?"flex items-center mx-1 gap-1.5 py-1 pr-3 pl-2 rounded-md text-white hover:text-primary-50 transition-all duration-300 bg-transparent":"bg-transparent p-1.5 hover:bg-primary-800 rounded-xl",b?.hideLabel&&"!p-1.5",(b.label==="Delete"||b.label==="Remove")&&"!text-error-500"),children:[l.jsx(Me,{hideTooltip:!b.tooltip,title:b.tooltip,className:"flex items-center",children:b.icon}),!b?.hideLabel&&b.label&&l.jsx(ee,{size:"small",variant:"medium",className:"text-inherit",appearance:"custom",children:b.label})]},S)}):l.jsxs("button",{id:`btn-floating-bar-${b.label}`,onClick:b.onClick,disabled:b.disabled,className:W(b?.label?"flex items-center mx-1 gap-1.5 py-1 pr-3 pl-2 rounded-md text-white hover:text-primary-50 transition-all duration-300 bg-transparent":"bg-transparent p-1.5 hover:bg-primary-800 rounded-xl",b?.hideLabel&&"!p-1.5",(b.label==="Delete"||b.label==="Remove")&&"!text-error-500"),children:[l.jsx(Me,{hideTooltip:!b.tooltip,title:b.tooltip,className:"flex items-center",children:b.icon}),!b?.hideLabel&&b.label&&l.jsx(ee,{size:"small",variant:"medium",className:"text-inherit",appearance:"custom",children:b.label})]})},S)),s?l.jsxs("button",{id:`btn-floating-bar-${m.label}`,onClick:m.onClick,disabled:!1,className:"flex items-center gap-1.5 py-1 pr-3 pl-2 rounded-md",children:[m.icon,l.jsx(ee,{size:"small",variant:"medium",className:"text-error-500",appearance:"custom",children:m.label})]}):null]}):l.jsxs(Ke.motion.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"minw-[150px] p-1.5 flex items-center",children:[l.jsx(Fe.Dropdown,{menu:{items:y},trigger:["click"],overlayClassName:"!min-w-[148px]",placement:"bottomRight",getPopupContainer:b=>b.parentElement,open:u,onOpenChange:c,children:l.jsxs("button",{id:"btn-floating-bar-actions",disabled:!1,className:"flex items-center gap-1.5 px-2 py-1 w-22 h-7 rounded-full bg-primary-700",children:[l.jsx(ee,{size:"small",variant:"medium",className:"text-white",children:A("Actions")}),l.jsx(kN,{fill:"#FFFFFF",className:"w-[16px] h-[16px]"})]})}),s?l.jsxs("button",{id:`btn-floating-bar-${m.label}`,onClick:m.onClick,disabled:!1,className:"flex items-center gap-1.5 py-1 pr-3 pl-2 rounded-md",children:[m.icon,l.jsx(ee,{size:"small",variant:"medium",className:"text-error-500",appearance:"custom",children:m.label})]}):null]})})]})}):null};ju.displayName="FloatingBar";const DN=()=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",className:"text-white",children:l.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),PN=()=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",className:"text-white",children:l.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"})}),LN=()=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",className:"text-[#F04438]",children:l.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})}),q2=()=>{const{selectedTopLevelPaths:t,setSelectedPaths:e,handleDelete:r,handleDuplicate:n,handleCopy:a}=Ja(),[i,s]=x.useState(!1),o=[{id:"copy",icon:l.jsx(DN,{}),tooltip:"Copy",label:"Copy",hideLabel:!0,onClick:()=>a(t)},{id:"duplicate",icon:l.jsx(PN,{}),tooltip:"Duplicate",label:"Duplicate",hideLabel:!0,onClick:()=>n(t)},{id:"delete",icon:l.jsx(LN,{}),tooltip:"Delete",label:"Delete",hideLabel:!0,onClick:()=>s(!0)}];return l.jsxs(l.Fragment,{children:[l.jsx(B2,{title:"Delete Keys",content:"Are you sure you want to delete the selected keys?",visible:i,variant:"destructive",onClose:()=>s(!1),onConfirm:()=>{r(t),e([]),s(!1)}}),l.jsx(ju,{show:t.length>0,onClose:()=>e([]),actionItems:o,showActionBg:!0,selectedItemsCount:t.length})]})},IN=t=>{if(t===we.BOOLEAN)return!1;if(t===we.STRING)return"";if(t===we.NUMBER)return 0;if(t===we.NULL)return null;if(t===we.ARRAY)return[];if(t===we.OBJECT)return{}},V2=({isVisible:t,onClose:e,parentContainer:r})=>{const[n,a]=x.useState(""),[i,s]=x.useState(Wo[0]),[o,A]=x.useState(null),[u,c]=x.useState(""),[d,f]=x.useState(null),{handleAddKey:h,selectedPathModification:p}=Ja();x.useEffect(()=>{i.value===we.BOOLEAN?A(!1):i.value===we.STRING?A(""):i.value===we.NUMBER?A(0):i.value===we.NULL?A(null):i.value===we.ARRAY?(A([]),c("")):i.value===we.OBJECT&&(A({}),c(""))},[i]);const m=()=>{a(""),s(Wo[0]),A(null),c(""),e(),f(null)};x.useEffect(()=>{if(i.value===we.ARRAY||i.value===we.OBJECT){if(u.trim()===""){f(null);return}try{const b=JSON.parse(u);i.value===we.ARRAY&&!Array.isArray(b)?f("Enter a valid JSON array."):i.value===we.OBJECT&&(typeof b!="object"||b===null||Array.isArray(b))?f("Enter a valid JSON object."):f(null)}catch{f("Enter valid JSON.")}}},[u,i]);const y=()=>o===null&&i.value===we.NULL?null:!o&&o!==0&&o!==!1?IN(i.value):i.value===we.NUMBER?Number(o):o;return l.jsx(Pr,{open:t,onCancel:m,title:"New Key",parentContainer:r,width:351,footer:l.jsx("div",{className:"flex justify-end mt-5 gap-4",children:l.jsx(ut,{id:"btn-add-key-modal-add",status:"primary",onClick:async()=>{await h(p||"",n,y()),m()},disabled:!n||o===null&&i.value!==we.NULL||!!d,children:"Add"})}),children:l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsx(Gn,{required:!0,label:l.jsx("span",{className:"text-neutral-600 dark:text-white text-xs font-medium",children:"Key"}),value:n,onChange:b=>a(b),placeholder:"Enter key"}),l.jsx(Mo,{label:l.jsx("span",{className:"text-neutral-600 dark:text-white text-xs font-medium",children:"Type"}),options:Wo,value:i,onChange:b=>s(b)}),(()=>{switch(i.value){case we.NULL:return null;case we.BOOLEAN:return l.jsx(kn,{label:l.jsx("span",{className:"text-neutral-600 dark:text-white text-xs font-medium",children:"Value"}),isChecked:!!o,onChange:b=>A(b),statusText:o?"true":"false"});case we.OBJECT:case we.ARRAY:return l.jsx(zu,{placeholder:i.value===we.ARRAY?"e.g. [1, 2, 3]":'e.g. {"key_1" : 1, "key_2":2}',onChange:b=>{const S=b;if(c(S),S.trim()==="")A(i.value===we.ARRAY?[]:{});else try{const v=JSON.parse(S);A(v)}catch{}}});default:return l.jsx(Gn,{label:l.jsx("span",{className:"text-neutral-600 dark:text-white text-xs font-medium",children:"Value"}),className:"w-full",value:o,onChange:b=>{if(i.value===we.NUMBER){const v=b.replace(/\.(?=.*\.)/g,"").replace(/[^\d.-]/g,"");A(v)}else A(b)},placeholder:"Enter value"})}})()]})})},Xo=({isFullScreen:t,allExpanded:e,toggleAll:r,isEditMode:n,isDarkMode:a,style:i,value:s,onChange:o,setIsAddKeyModalOpen:A,isAddKeyModalOpen:u})=>{const[c,d]=x.useState({}),[f,h]=x.useState(null),[p,m]=x.useState([]),[y,b]=x.useState([]),[S,v]=x.useState(null),[E,T]=x.useState(null);x.useEffect(()=>{b(H2(p))},[p]),x.useEffect(()=>{try{const D=R2(s);d(D),h(null)}catch(D){h("Invalid JSON: "+D.message)}},[s]);const O=D=>{if(!D.length)return;const N=Du.produce(c,L=>{D.forEach(I=>{if(!I||I===".")return;const _=I.split(".");if(_.shift(),_.length===0)return;let M=L;for(let F=0;F<_.length-1;F++)if(M=M[_[F]],M===void 0)return;const H=_[_.length-1];if(Array.isArray(M)){const F=Number(H);!isNaN(F)&&F>=0&&F<M.length&&M.splice(F,1)}else M&&typeof M=="object"&&delete M[H]})});o?.(JSON.stringify(N,null,2))},C=D=>{if(!D.length)return;const N=Du.produce(c,L=>{D.forEach(I=>{const _=I.split(".");_[0]===""&&_.shift();let M=L;for(let F=0;F<_.length-1;F++)if(M=M[_[F]],M===void 0)return;const H=_[_.length-1];if(Array.isArray(M)){const F=Number(H);if(!isNaN(F)&&F>=0&&F<M.length){const P=JSON.parse(JSON.stringify(M[F]));M.splice(F+1,0,P)}}else if(M&&typeof M=="object"&&Object.hasOwn(M,H)){let F=H+"_copy",P=2;for(;M.hasOwnProperty(F);)F=`${H}_copy_${P++}`;M[F]=JSON.parse(JSON.stringify(M[H]))}})});o?.(JSON.stringify(N,null,2))},k=async D=>{if(!D.length)return!1;if(D.length===1){const N=D[0].split(".");N[0]===""&&N.shift();let L=c;for(const _ of N){if(L==null)return!1;L=L[_]}if(L===void 0)return!1;let I;typeof L=="object"?I=JSON.stringify(L,null,2):I=String(L);try{return await navigator.clipboard.writeText(I),!0}catch{return!1}}else{const N={};for(const L of D){const I=L.split(".");I[0]===""&&I.shift();let _=c;for(const M of I)_!=null&&(_=_[M]);if(_!==void 0){const M=I[I.length-1]||"root";N[M]=_}}try{return await navigator.clipboard.writeText(JSON.stringify(N,null,2)),!0}catch{return!1}}},w=async(D,N,L)=>{const I=D.split(".");I[0]===""&&I.shift();const _=Du.produce(c,M=>{let H=M;if(I.length===0){if(H.hasOwnProperty(N)){let F=N,P=2;for(;H.hasOwnProperty(F);)F=`${N}_${P++}`;H[F]=L}else H[N]=L;return}for(let F=0;F<I.length;F++)if(H=H[I[F]],H===void 0)return;if(H.hasOwnProperty(N)){let F=N,P=2;for(;H.hasOwnProperty(F);)F=`${N}_${P++}`;H[F]=L}else H[N]=L});v(null),o?.(JSON.stringify(_,null,2))};return l.jsx(_2,{value:{allExpanded:e,toggleAll:r,isEditMode:n,isDarkMode:a,selectedPaths:p,setSelectedPaths:m,selectedTopLevelPaths:y,setSelectedTopLevelPaths:b,selectedPathModification:S,setSelectedPathModification:v,selectedPathForEdit:E,setSelectedPathForEdit:T,jsonData:c,setJsonData:d,error:f,setError:h,handleDelete:O,handleDuplicate:C,handleCopy:k,handleAddKey:w,setIsAddKeyModalOpen:A,isAddKeyModalOpen:u},children:l.jsxs("div",{className:"bg-white dark:bg-black-800 rounded-b-lg",children:[n&&l.jsx(q2,{}),l.jsx(z2,{onChange:o,style:i}),n&&l.jsx(V2,{parentContainer:t?"json-grid-core-container":"full-screen-container",isVisible:u,onClose:()=>A(!1)})]})})};function W2(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(r=W2(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function _N(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=W2(t))&&(n&&(n+=" "),n+=e);return n}const Gu="-",MN=t=>{const e=RN(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:s=>{const o=s.split(Gu);return o[0]===""&&o.length!==1&&o.shift(),X2(o,e)||HN(s)},getConflictingClassGroupIds:(s,o)=>{const A=r[s]||[];return o&&n[s]?[...A,...n[s]]:A}}},X2=(t,e)=>{if(t.length===0)return e.classGroupId;const r=t[0],n=e.nextPart.get(r),a=n?X2(t.slice(1),n):void 0;if(a)return a;if(e.validators.length===0)return;const i=t.join(Gu);return e.validators.find(({validator:s})=>s(i))?.classGroupId},Q2=/^\[(.+)\]$/,HN=t=>{if(Q2.test(t)){const e=Q2.exec(t)[1],r=e?.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},RN=t=>{const{theme:e,classGroups:r}=t,n={nextPart:new Map,validators:[]};for(const a in r)Yu(r[a],n,a,e);return n},Yu=(t,e,r,n)=>{t.forEach(a=>{if(typeof a=="string"){const i=a===""?e:j2(e,a);i.classGroupId=r;return}if(typeof a=="function"){if(FN(a)){Yu(a(n),e,r,n);return}e.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,s])=>{Yu(s,j2(e,i),r,n)})})},j2=(t,e)=>{let r=t;return e.split(Gu).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},FN=t=>t.isThemeGetter,UN=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map;const a=(i,s)=>{r.set(i,s),e++,e>t&&(e=0,n=r,r=new Map)};return{get(i){let s=r.get(i);if(s!==void 0)return s;if((s=n.get(i))!==void 0)return a(i,s),s},set(i,s){r.has(i)?r.set(i,s):a(i,s)}}},Ku="!",Zu=":",zN=Zu.length,BN=t=>{const{prefix:e,experimentalParseClassName:r}=t;let n=a=>{const i=[];let s=0,o=0,A=0,u;for(let p=0;p<a.length;p++){let m=a[p];if(s===0&&o===0){if(m===Zu){i.push(a.slice(A,p)),A=p+zN;continue}if(m==="/"){u=p;continue}}m==="["?s++:m==="]"?s--:m==="("?o++:m===")"&&o--}const c=i.length===0?a:a.substring(A),d=qN(c),f=d!==c,h=u&&u>A?u-A:void 0;return{modifiers:i,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:h}};if(e){const a=e+Zu,i=n;n=s=>s.startsWith(a)?i(s.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:s,maybePostfixModifierPosition:void 0}}if(r){const a=n;n=i=>r({className:i,parseClassName:a})}return n},qN=t=>t.endsWith(Ku)?t.substring(0,t.length-1):t.startsWith(Ku)?t.substring(1):t,VN=t=>{const e=Object.fromEntries(t.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const a=[];let i=[];return n.forEach(s=>{s[0]==="["||e[s]?(a.push(...i.sort(),s),i=[]):i.push(s)}),a.push(...i.sort()),a}},WN=t=>({cache:UN(t.cacheSize),parseClassName:BN(t),sortModifiers:VN(t),...MN(t)}),XN=/\s+/,QN=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:i}=e,s=[],o=t.trim().split(XN);let A="";for(let u=o.length-1;u>=0;u-=1){const c=o[u],{isExternal:d,modifiers:f,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}=r(c);if(d){A=c+(A.length>0?" "+A:A);continue}let y=!!m,b=n(y?p.substring(0,m):p);if(!b){if(!y){A=c+(A.length>0?" "+A:A);continue}if(b=n(p),!b){A=c+(A.length>0?" "+A:A);continue}y=!1}const S=i(f).join(":"),v=h?S+Ku:S,E=v+b;if(s.includes(E))continue;s.push(E);const T=a(b,y);for(let O=0;O<T.length;++O){const C=T[O];s.push(v+C)}A=c+(A.length>0?" "+A:A)}return A};function jN(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=G2(e))&&(n&&(n+=" "),n+=r);return n}const G2=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=G2(t[n]))&&(r&&(r+=" "),r+=e);return r};function GN(t,...e){let r,n,a,i=s;function s(A){const u=e.reduce((c,d)=>d(c),t());return r=WN(u),n=r.cache.get,a=r.cache.set,i=o,o(A)}function o(A){const u=n(A);if(u)return u;const c=QN(A,r);return a(A,c),c}return function(){return i(jN.apply(null,arguments))}}const It=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},Y2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,K2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,YN=/^\d+\/\d+$/,KN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZN=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,$N=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,JN=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ei=t=>YN.test(t),ze=t=>!!t&&!Number.isNaN(Number(t)),Yn=t=>!!t&&Number.isInteger(Number(t)),$u=t=>t.endsWith("%")&&ze(t.slice(0,-1)),Nn=t=>KN.test(t),tD=()=>!0,rD=t=>ZN.test(t)&&!$N.test(t),Z2=()=>!1,nD=t=>JN.test(t),aD=t=>eD.test(t),iD=t=>!xe(t)&&!Oe(t),sD=t=>ti(t,r3,Z2),xe=t=>Y2.test(t),Ta=t=>ti(t,n3,rD),Ju=t=>ti(t,cD,ze),$2=t=>ti(t,e3,Z2),oD=t=>ti(t,t3,aD),Qo=t=>ti(t,a3,nD),Oe=t=>K2.test(t),Gi=t=>ri(t,n3),AD=t=>ri(t,dD),J2=t=>ri(t,e3),lD=t=>ri(t,r3),uD=t=>ri(t,t3),jo=t=>ri(t,a3,!0),ti=(t,e,r)=>{const n=Y2.exec(t);return n?n[1]?e(n[1]):r(n[2]):!1},ri=(t,e,r=!1)=>{const n=K2.exec(t);return n?n[1]?e(n[1]):r:!1},e3=t=>t==="position"||t==="percentage",t3=t=>t==="image"||t==="url",r3=t=>t==="length"||t==="size"||t==="bg-size",n3=t=>t==="length",cD=t=>t==="number",dD=t=>t==="family-name",a3=t=>t==="shadow",fD=GN(()=>{const t=It("color"),e=It("font"),r=It("text"),n=It("font-weight"),a=It("tracking"),i=It("leading"),s=It("breakpoint"),o=It("container"),A=It("spacing"),u=It("radius"),c=It("shadow"),d=It("inset-shadow"),f=It("text-shadow"),h=It("drop-shadow"),p=It("blur"),m=It("perspective"),y=It("aspect"),b=It("ease"),S=It("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...E(),Oe,xe],O=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],k=()=>[Oe,xe,A],w=()=>[ei,"full","auto",...k()],D=()=>[Yn,"none","subgrid",Oe,xe],N=()=>["auto",{span:["full",Yn,Oe,xe]},Yn,Oe,xe],L=()=>[Yn,"auto",Oe,xe],I=()=>["auto","min","max","fr",Oe,xe],_=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],M=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...k()],F=()=>[ei,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],P=()=>[t,Oe,xe],q=()=>[...E(),J2,$2,{position:[Oe,xe]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],X=()=>["auto","cover","contain",lD,sD,{size:[Oe,xe]}],G=()=>[$u,Gi,Ta],Q=()=>["","none","full",u,Oe,xe],Y=()=>["",ze,Gi,Ta],j=()=>["solid","dashed","dotted","double"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[ze,$u,J2,$2],le=()=>["","none",p,Oe,xe],Ee=()=>["none",ze,Oe,xe],ge=()=>["none",ze,Oe,xe],Ce=()=>[ze,Oe,xe],Re=()=>[ei,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Nn],breakpoint:[Nn],color:[tD],container:[Nn],"drop-shadow":[Nn],ease:["in","out","in-out"],font:[iD],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Nn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Nn],shadow:[Nn],spacing:["px",ze],text:[Nn],"text-shadow":[Nn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ei,xe,Oe,y]}],container:["container"],columns:[{columns:[ze,xe,Oe,o]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{start:w()}],end:[{end:w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[Yn,"auto",Oe,xe]}],basis:[{basis:[ei,"full","auto",o,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ze,ei,"auto","initial","none",xe]}],grow:[{grow:["",ze,Oe,xe]}],shrink:[{shrink:["",ze,Oe,xe]}],order:[{order:[Yn,"first","last","none",Oe,xe]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[..._(),"normal"]}],"justify-items":[{"justify-items":[...M(),"normal"]}],"justify-self":[{"justify-self":["auto",...M()]}],"align-content":[{content:["normal",..._()]}],"align-items":[{items:[...M(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...M(),{baseline:["","last"]}]}],"place-content":[{"place-content":_()}],"place-items":[{"place-items":[...M(),"baseline"]}],"place-self":[{"place-self":["auto",...M()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],w:[{w:[o,"screen",...F()]}],"min-w":[{"min-w":[o,"screen","none",...F()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[s]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",r,Gi,Ta]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Oe,Ju]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$u,xe]}],"font-family":[{font:[AD,xe,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Oe,xe]}],"line-clamp":[{"line-clamp":[ze,"none",Oe,Ju]}],leading:[{leading:[i,...k()]}],"list-image":[{"list-image":["none",Oe,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Oe,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:[ze,"from-font","auto",Oe,Ta]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[ze,"auto",Oe,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Oe,xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Oe,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:X()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Yn,Oe,xe],radial:["",Oe,xe],conic:[Yn,Oe,xe]},uD,oD]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...j(),"hidden","none"]}],"divide-style":[{divide:[...j(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...j(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ze,Oe,xe]}],"outline-w":[{outline:["",ze,Gi,Ta]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",c,jo,Qo]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",d,jo,Qo]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[ze,Ta]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",f,jo,Qo]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[ze,Oe,xe]}],"mix-blend":[{"mix-blend":[...ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ze]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[Oe,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[ze]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:X()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Oe,xe]}],filter:[{filter:["","none",Oe,xe]}],blur:[{blur:le()}],brightness:[{brightness:[ze,Oe,xe]}],contrast:[{contrast:[ze,Oe,xe]}],"drop-shadow":[{"drop-shadow":["","none",h,jo,Qo]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",ze,Oe,xe]}],"hue-rotate":[{"hue-rotate":[ze,Oe,xe]}],invert:[{invert:["",ze,Oe,xe]}],saturate:[{saturate:[ze,Oe,xe]}],sepia:[{sepia:["",ze,Oe,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",Oe,xe]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[ze,Oe,xe]}],"backdrop-contrast":[{"backdrop-contrast":[ze,Oe,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ze,Oe,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ze,Oe,xe]}],"backdrop-invert":[{"backdrop-invert":["",ze,Oe,xe]}],"backdrop-opacity":[{"backdrop-opacity":[ze,Oe,xe]}],"backdrop-saturate":[{"backdrop-saturate":[ze,Oe,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",ze,Oe,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Oe,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ze,"initial",Oe,xe]}],ease:[{ease:["linear","initial",b,Oe,xe]}],delay:[{delay:[ze,Oe,xe]}],animate:[{animate:["none",S,Oe,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,Oe,xe]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:Ee()}],"rotate-x":[{"rotate-x":Ee()}],"rotate-y":[{"rotate-y":Ee()}],"rotate-z":[{"rotate-z":Ee()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":["scale-3d"],skew:[{skew:Ce()}],"skew-x":[{"skew-x":Ce()}],"skew-y":[{"skew-y":Ce()}],transform:[{transform:[Oe,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Re()}],"translate-x":[{"translate-x":Re()}],"translate-y":[{"translate-y":Re()}],"translate-z":[{"translate-z":Re()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Oe,xe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Oe,xe]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[ze,Gi,Ta,Ju]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Yi(...t){return fD(_N(t))}const Kn=W("text-neutral-600 cursor-pointer hover:text-neutral-800","dark:text-neutral-300 dark:hover:text-neutral-50"),hD=({fontSize:t})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",children:l.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})}),pD=({fontSize:t})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:Kn,children:l.jsx("path",{d:"M19 2h-4.18C14.4.84 13.3 0 12 0S9.6.84 9.18 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm7 18H5V4h2v3h10V4h2v16z"})}),mD=({fontSize:t})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:Kn,children:l.jsx("path",{d:"M9.5 2c-1.82 0-3.53.5-5 1.35 2.99 1.73 5 4.95 5 8.65s-2.01 6.92-5 8.65c1.47.85 3.18 1.35 5 1.35 5.52 0 10-4.48 10-10S15.02 2 9.5 2z"})}),gD=({fontSize:t})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:Kn,children:l.jsx("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4-5 5-5-5h3V4h4v7h3z"})}),bD=({fontSize:t})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:Kn,children:l.jsx("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})}),vD=({fontSize:t})=>l.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:Kn,children:[l.jsx("path",{d:"M18 6.41 16.59 5 12 9.58 7.41 5 6 6.41l6 6z"}),l.jsx("path",{d:"m18 13-1.41-1.41L12 16.17l-4.59-4.58L6 13l6 6z"})]}),yD=({fontSize:t})=>l.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:Kn,children:[l.jsx("path",{d:"M6 17.59 7.41 19 12 14.42 16.59 19 18 17.59l-6-6z"}),l.jsx("path",{d:"m6 11 1.41 1.41L12 7.83l4.59 4.58L18 11l-6-6z"})]}),SD=({fontSize:t})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:Kn,children:l.jsx("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z"})}),ED=({fontSize:t})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:Kn,children:l.jsx("path",{d:"M14 17H4v2h10v-2zm6-8H4v2h16V9zM4 15h16v-2H4v2zM4 5v2h16V5H4z"})}),i3=({value:t,onChange:e=()=>!1,withFullScreen:r=!0,withTheme:n=!0,isEditMode:a=!1,height:i="55vh",language:s="json",monacoEditor:o,isShowCopy:A=!0,isShowDownload:u=!0,setIsDisableSave:c,withJsonGrid:d=!0,editorTheme:f,setEditorTheme:h,theme:p,className:m,enableAutoFormatting:y=!0,renderToolbarActions:b,onBlockClick:S,focusBlock:v,focusBlockTopLevelOnly:E=!1})=>{const T=x.useRef(null),[O,C]=x.useState("vs"),[k,w]=x.useState("light"),D=f??O,N=p??k,L=h??(de=>{C(de),w(de==="vs-dark"?"dark":"light")}),[I,_]=x.useState(!1),[M,H]=x.useState(null),[F,P]=x.useState(null),[q,B]=x.useState(!1);x.useEffect(()=>{(async()=>{try{const ie=await P2.initialize();P(ie),B(!0)}catch(ie){console.error("Failed to initialize Monaco Editor:",ie),B(!1)}})()},[]);const X=o||F,{handleFormatCode:G,pythonError:Q,pythonLoading:Y}=D2({code:t,setCode:e,currentEditorModel:M,monacoEditor:X,enable:a===!0&&s==="python"}),j=Po.useFullScreenHandle(),[ae,se]=x.useState("JSON"),[le,Ee]=x.useState(!1),ge=s==="json",Ce=()=>{j?.active?j.exit():j.enter()},Re=x.useRef(S);Re.current=S;const Te=x.useCallback(async(de,ie,fe)=>{if(!Re.current)return;const ye=de.getModel();if(!ye)return;const ke=($e,at)=>ye.getValueInRange({startLineNumber:$e,startColumn:1,endLineNumber:at,endColumn:ye.getLineMaxColumn(at)}),je=($e,at,Ot,wt,lt)=>{Re.current({startLine:$e,endLine:at,text:Ot,kind:wt,cursorLine:ie,cursorColumn:fe,parentBlock:lt})};try{const $e=de.getContribution("editor.contrib.folding");if($e){const pt=await $e.getFoldingModel();if(pt?.regions){const qe=pt.regions,Ut=ye.getLineCount(),bt=[];for(let Je=0;Je<qe.length;Je++){const vt=qe.getStartLineNumber(Je),Xe=qe.getEndLineNumber(Je),Yt=Math.min(Xe+1,Ut),sr=Yt-vt;if(ie>=vt&&ie<=Yt){const tr=qe.getType(Je),en=tr===1?"comment":tr===2?"imports":tr===3?"region":void 0;bt.push({start:vt,end:Yt,size:sr,kind:en})}}if(bt.length>0){bt.sort((sr,tr)=>sr.size-tr.size);const Je=bt[0],vt=ke(Je.start,Je.end);let Xe;for(let sr=bt.length-1;sr>0;sr--){const tr=bt[sr];if(!(tr.start<=1&&tr.end>=Ut)){Xe=tr;break}}const Yt=Xe&&Xe!==Je?{startLine:Xe.start,endLine:Xe.end,text:ke(Xe.start,Xe.end),kind:Xe.kind}:void 0;je(Je.start,Je.end,vt,Je.kind,Yt);return}}}const at={lineNumber:ie,column:fe},Ot=ye.bracketPairs?.findEnclosingBrackets?.(at);if(Ot&&Ot.length===2){const[pt,qe]=Ot,Ut=pt.startLineNumber,bt=qe.endLineNumber,Je=ke(Ut,bt);je(Ut,bt,Je);return}const wt=ye.getLineCount(),lt=ye.getValue();je(1,wt,lt)}catch{}},[]);x.useEffect(()=>{if(!v||!T.current)return;const de=T.current,ie=de.getModel();if(!ie)return;const fe=ie.findMatches(v,!0,!1,!0,null,!1);if(fe.length===0)return;let ye=fe[0];if(E&&fe.length>1){let at=1/0;for(const Ot of fe){const wt=ie.getLineContent(Ot.range.startLineNumber),lt=wt.length-wt.trimStart().length;lt<at&&(at=lt,ye=Ot)}}const ke=ye.range.startLineNumber,je=ye.range.startColumn;de.setPosition({lineNumber:ke,column:je}),de.revealLineInCenter(ke,1);const $e=async()=>{try{const at=de.getContribution("editor.contrib.folding");if(at){const lt=await at.getFoldingModel();if(lt?.regions){const pt=lt.regions;let qe=-1,Ut=-1,bt=1/0;for(let Je=0;Je<pt.length;Je++){const vt=pt.getStartLineNumber(Je),Xe=pt.getEndLineNumber(Je),Yt=Math.min(Xe+1,ie.getLineCount()),sr=Yt-vt;ke>=vt&&ke<=Yt&&sr<bt&&(qe=vt,Ut=Yt,bt=sr)}if(qe!==-1){de.setSelection({startLineNumber:qe,startColumn:1,endLineNumber:Ut,endColumn:ie.getLineMaxColumn(Ut)}),de.revealRangeInCenter({startLineNumber:qe,startColumn:1,endLineNumber:Ut,endColumn:ie.getLineMaxColumn(Ut)},1);return}}}const Ot={lineNumber:ke,column:je},wt=ie.bracketPairs?.findEnclosingBrackets?.(Ot);if(wt&&wt.length===2){const[lt,pt]=wt;de.setSelection({startLineNumber:lt.startLineNumber,startColumn:1,endLineNumber:pt.endLineNumber,endColumn:ie.getLineMaxColumn(pt.endLineNumber)}),de.revealRangeInCenter({startLineNumber:lt.startLineNumber,startColumn:1,endLineNumber:pt.endLineNumber,endColumn:ie.getLineMaxColumn(pt.endLineNumber)},1);return}de.setSelection(ye.range)}catch{de.setSelection(ye.range)}};requestAnimationFrame(()=>{$e()})},[v,E]);const $=de=>{T.current=de;const ie=()=>{try{if(s==="python"){const fe=de.getModel();fe&&H(fe)}s==="json"&&y&&requestAnimationFrame(()=>{oe()})}catch(fe){console.warn("Failed to initialize editor:",fe)}};if(de.getModel())ie();else{const fe=de.onDidChangeModel(()=>{ie(),fe.dispose()})}Re.current&&de.onMouseDown(()=>{requestAnimationFrame(()=>{const fe=de.getPosition();fe&&Te(de,fe.lineNumber,fe.column)})})},te=()=>{try{const de=JSON.parse(t),ie=JSON.stringify(de,null,4);e(ie),M&&X&&X.editor.setModelMarkers(M,"json",[])}catch(de){if(M&&X){const ie=de instanceof Error?de.message:"Invalid JSON";try{X.editor.setModelMarkers(M,"json",[{startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1,message:`Cannot format: ${ie}`,severity:X.MarkerSeverity.Error}])}catch(fe){console.warn("Failed to set JSON error markers:",fe)}}}},oe=()=>{if(s==="python"){G();return}if(s==="json"){te();return}if(T.current)try{const de=T.current.getAction("editor.action.formatDocument");de&&de.run()}catch(de){console.warn("Failed to format document:",de)}},Le=de=>{typeof de=="string"&&e(de)};if(x.useEffect(()=>{c&&c(Q||Y)},[Q,Y,c]),!o&&!q)return l.jsx("div",{className:"flex items-center justify-center p-8 border border-neutral-200 dark:border-neutral-700 rounded-lg",children:l.jsx("div",{className:"text-neutral-600 dark:text-neutral-400",children:"Loading editor..."})});const Ie=W("hover:bg-neutral-300 hover:dark:bg-neutral-700 p-0.5 rounded-md flex items-center justify-center"),Ye=()=>{if(s==="python")try{let de=t;de&&(de=de.replace(/\r\n/g,`
|
|
71
|
+
`,style:{...T()},disabled:n||i,id:o,onClick:A,onKeyDown:u,title:s,type:M,autoFocus:S,children:[i&&_(),a,I.length>0?l.jsx("span",{className:"inline-flex items-center gap-0.5 ml-1 flex-shrink-0",children:I.map((H,F)=>l.jsx("kbd",{className:`inline-flex items-center justify-center min-w-[20px] h-5 px-1 rounded text-[11px] font-medium leading-none ${N()}`,children:H},F))}):null,f?.length?l.jsx("div",{onClick:H=>H.stopPropagation(),children:l.jsx(Fe.Dropdown,{menu:{items:f},trigger:["click"],overlayClassName:"row-option-cell",placement:"bottomRight",children:l.jsx(he.ChevronRightRounded,{className:"rotate-90 text-neutral-300 hover:opacity-50"})})}):null,c?l.jsx("span",{className:"absolute -top-2 -right-2 bg-zinc-500 text-white rounded-full min-w-[1.5rem] min-h-[1.5rem] text-xs flex justify-center items-center",children:c}):null]})})});ut.displayName="Button";const N2=(t={})=>{const{primaryContainerId:e="layout-app-main-content-container",fallbackContainerId:r="full-screen-container",maxRetries:n=10,retryDelay:a=100}=t,[i,s]=x.useState(null);return x.useEffect(()=>{let o=0,A;const u=d=>{if(typeof document<"u"){const f=document.getElementById(d);if(f)return f}if(typeof globalThis<"u"&&globalThis.window&&globalThis.window.parent&&globalThis.window.parent!==globalThis.window)try{const f=globalThis.window.parent.document?.getElementById(d);if(f)return f}catch{}return null},c=()=>{let d=u(e);if(!d&&r&&(d=u(r)),d){s(d);return}o<n?(o++,A=setTimeout(c,a)):s(document.body)};return c(),()=>{A&&clearTimeout(A)}},[e,r,n,a]),i},Pr=t=>{const{open:e,children:r,title:n,mask:a=!0,onlyBody:i=!1,bodySpacing:s=!0,headerRightContent:o,parentContainer:A,zIndex:u,asForm:c=!0,onSubmit:d,showCloseButton:f=!0,noPadding:h=!1,...p}=t,m=N2({primaryContainerId:"layout-app-main-content-container",fallbackContainerId:"full-screen-container"}),y=l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex justify-between items-center",children:[f?l.jsx(ee,{size:"large",variant:"semibold",className:"tour__title",children:n}):l.jsx("div",{className:"flex flex-col w-full",children:n}),o||f&&l.jsx("button",{id:"btn-modal-close",onClick:p.onCancel,className:"",type:"button",children:l.jsx(he.CloseRounded,{sx:{fontSize:"20px"},className:"cursor-pointer text-neutral-400 hover:text-neutral-600"})})]}),p.addLineAfterHeader&&l.jsx("hr",{className:"mt-2"})]}),b=c?"form":"div",S=()=>{if(A){if(typeof document<"u"){const O=document.getElementById(A);if(O)return O}if(typeof globalThis<"u"&&globalThis.window&&globalThis.window.parent&&globalThis.window.parent!==globalThis.window)try{const O=globalThis.window.parent.document?.getElementById(A);if(O)return O}catch{}}return m};if(!e)return null;const v=S();if(!v)return null;const E=v!==document.body;return l.jsx(Fe.Modal,{open:e,centered:!0,closable:!1,title:i?null:y,modalRender:O=>l.jsx(b,{onSubmit:C=>{C.preventDefault(),d&&d()},children:l.jsx("div",{role:"none",onClick:C=>C.stopPropagation(),children:O})}),styles:{content:{padding:h?"0px":"20px 0px"},header:{padding:h?"0px":"0px 20px"},body:{padding:h?"0px":s?"0px 20px":"0px"},footer:{padding:h?"0px":"0px 20px"},mask:{zIndex:u||1e3,position:E?"absolute":void 0,top:E?0:void 0,right:E?0:void 0,bottom:E?0:void 0,left:E?0:void 0},wrapper:{zIndex:u||1e3,position:E?"absolute":void 0,top:E?0:void 0,right:E?0:void 0,bottom:E?0:void 0,left:E?0:void 0,backgroundColor:a?"rgb(16 24 40 / 80%)":void 0}},mask:a,...p,getContainer:()=>v,children:r})},yt={createSuccess:function(t){return`${t} created successfully.`},createFailure:function(t){return`${t} creation failed. Please retry.`},updateSuccess:function(t){return`${t} updated successfully.`},updateFailure:function(t){return`${t} update failed. Please retry.`},copySuccess:function(t){return`${t} copied successfully.`},copyFailure:function(t){return`${t} copy failed. Please retry.`},copyToClipboard:function(t){return`${t} copied to clipboard.`},moveSuccess:function(t){return`${t} moved successfully.`},moveFailure:function(t){return`${t} move failed. Please retry.`},restoreSuccess:function(t){return`${t} restored successfully.`},resetSuccess:function(t){return`${t} reset successfully.`},resetFailure:function(t){return`${t} reset failed. Please retry.`},restoreFailure:function(t){return`${t} restore failed. Please retry.`},deleteSuccess:function(t){return`${t} deleted successfully.`},deleteFailure:function(t){return`${t} delete failed. Please retry.`},addSuccess:function(t){return`${t} added successfully.`},addFailure:function(t){return`${t} add failed. Please retry.`},removeSuccess:function(t){return`${t} removed successfully.`},removeFailure:function(t){return`${t} remove failed. Please retry.`},importSuccess:function(t){return`${t} imported successfully.`},importFailure:function(t){return`${t} import failed. Please retry.`},exportSuccess:function(t){return`${t} exported successfully.`},exportFailure:function(t){return`${t} export failed. Please retry.`},installSuccess:function(t){return`${t} installed successfully.`},duplicateSuccess:function(t){return`${t} duplicated successfully.`},installFailure:function(t){return`${t} install failed. Please retry.`},uninstallSuccess:function(t){return`${t} uninstalled successfully.`},uninstallFailure:function(t){return`${t} uninstall failed. Please retry.`},approveSuccess:function(t){return`${t} approved successfully.`},approveFailure:function(t){return`${t} approve failed. Please retry.`},rejectSuccess:function(t){return`${t} rejected successfully.`},rejectFailure:function(t){return`${t} reject failed. Please retry.`},archiveSuccess:function(t){return`${t} archived successfully.`},archiveFailure:function(t){return`${t} archive failed. Please retry.`},activateSuccess:function(t){return`${t} activated successfully.`},activateFailure:function(t){return`${t} activation failed. Please retry.`},deactivateSuccess:function(t){return`${t} deactivated successfully.`},deactivateFailure:function(t){return`${t} deactivation failed. Please retry.`},fileSizeLimit:function(t,e){return`File size exceeds the limit of ${t} ${e}.`},fetchFailure:function(t){return`An error occurred while fetching ${t}. Please retry.`},requiredField:function(t){return`${t} is required.`},existsError:function(t){return`${t} already exists.`},shouldNotContainOnlySpaces:function(t){return`${t} shouldn't contain only spaces.`},notAllowed:function(t){return`${t} not allowed.`},allowed:function(t){return`${t} allowed.`},multipleNotAllowed:function(t){return`Multiple ${t} not allowed.`},notFound:function(t){return`${t} not found.`},sendForApproval:function(t){return`${t} sent for approval.`},invalidError:function(t){return`Invalid ${t}.`},success:function(t){return`${t} successful.`},initializationError:function(t){return`Please initialize the ${t}.`},selectError:function(t){return`Please select ${t}.`},importStarted:function(t){return`${t} import has started.`},initiationSuccess:function(t){return`${t} initiated successfully.`},initiationFailure:function(t){return`${t} initiation failed. Please retry.`},transferSuccess:function(t){return`${t} has been successfully transferred.`},transferFailure:function(t){return`${t} transfer has failed, Please retry.`},terminatedSuccess:function(t){return`${t} terminated successfully.`},terminatedFailure:function(t){return`${t} termination failed, Please retry.`},markedAs:function(t){return`Marked as ${t}.`},bulkStatusChangeSuccess:function(t){return`Status changed to ${t?"locked":"unlocked"} successfully.`},bulkStatusChangeFailure:function(t){return`Status change to ${t?"locked":"unlocked"} failed, Please retry.`},downloading:function(t){return`Downloading ${t}...`},downloadFailure:function(t){return`Download ${t} failed. Please retry.`},bulkStatusChangeInfo:"Status change default info",bulkStatusChangeDefault:"Unknown response type",bulkDeleteUsersSuccess:"Users deleted successfully.",bulkDeleteUsersFailure:"Bulk user delete failed, Please retry.",errorMessage:"Something went wrong.",requiredFieldError:"Please fill out all mandatory fields.",resetPasswordSuccess:"Password reset successfully.",noItemSelected:"No item selected.",fieldAlreadyExist:"Field has already been added to this step.",fetchingError:"An error occurred while fetching configuration details.",secondaryOwnerLimitExceed:"Can't add more than 3 users to 'Secondary Owner'.",saveChangesAlert:"Please save the changes before switching tabs.",visibleColumnError:"There must be at least one visible column.",sessionExpired:"Session expired. Please login.",invalidFileType:"Non acceptable file type.",triggerNodeError:"Trigger is required!",formatFailed:"Failed to format.",memberRemoveSuccess:"Team member removed successfully.",memberRemoveInfo:"Team member removed default info.",memberRemoveError:"Unable to remove team member.",memberRemoveWarning:"Unable to remove team member.",memberRemoveDefault:"Unknown response type."},D2=({monacoEditor:t,currentEditorModel:e,code:r,setCode:n,enable:a,checkSyntaxAPI:i,formatCodeAPI:s})=>{const[o,A]=x.useState(null),[u,c]=x.useState(!1);function d(m){const y={};let b=0;return{result:m.replace(/{{(.*?)}}/g,(v,E,T,O)=>{const C=O.slice(0,T),k=O.slice(T+v.length),w=C.endsWith('"')&&k.startsWith('"'),D=C.endsWith("'")&&k.startsWith("'");return w||D?v:(y[`__dynamic_value_${b}`]=v,`"__dynamic_value_${b++}"`)}),originalValues:y}}function f(m,y){return m.replace(/"__dynamic_value_\d+"/g,b=>{const S=b.slice(1,-1);return y[S]||b})}const h=async()=>{if(!t||!e||!i){console.warn("Monaco editor, model, or syntax check API not available");return}c(!0);try{const{result:m}=d(r),b=(await i(m))?.data?.error;if(b?.message){A(b);const S=[{startLineNumber:b.line||1,endLineNumber:b.line||1,startColumn:b.column||1,endColumn:b.column||1,message:b.message,severity:t.MarkerSeverity?.Error||8}];try{t.editor.setModelMarkers(e,"owner",S)}catch(v){console.warn("Failed to set error markers:",v)}}else{A(null);try{t.editor.setModelMarkers(e,"owner",[])}catch(S){console.warn("Failed to clear error markers:",S)}}}catch(m){if(console.warn("Syntax check failed:",m),A(null),t&&e)try{t.editor.setModelMarkers(e,"owner",[])}catch(y){console.warn("Failed to clear error markers after error:",y)}}finally{c(!1)}},p=async()=>{if(!t||!e||!s){console.warn("Monaco editor, model, or format API not available");return}c(!0);try{const{result:m,originalValues:y}=d(r),b=await s(m);if(b?.data?.formatted_code){const S=f(b.data.formatted_code,y);n(S)}else console.warn("No formatted code received from service")}catch(m){const y=m?.message||yt.formatFailed;console.warn("Code formatting failed:",y),ct.toast.error(y,{toastId:y})}finally{c(!1)}};return x.useEffect(()=>{if(t&&a&&i){const m=Nu.debounce(h,500);return m(),()=>{m.cancel()}}},[r,t]),{pythonError:o,pythonLoading:u,handleCheckSyntax:h,handleFormatCode:p}};class $a{static instance;monaco=null;initialized=!1;initializationPromise=null;static getInstance(){return $a.instance||($a.instance=new $a),$a.instance}async initialize(){return this.initialized&&this.monaco?this.monaco:this.initializationPromise?this.initializationPromise:(this.initializationPromise=this.performInitialization(),this.initializationPromise)}async performInitialization(){try{return this.monaco=await Vb.loader.init(),this.initialized=!0,this.initializationPromise=null,this.monaco}catch(e){throw this.initializationPromise=null,console.error("Failed to initialize Monaco Editor:",e),new Error(`Monaco Editor initialization failed: ${e instanceof Error?e.message:"Unknown error"}`)}}getMonaco(){return this.monaco}isInitialized(){return this.initialized}getEditorInstance(e=0){if(!this.monaco)return console.warn("Monaco Editor not initialized"),null;const r=this.monaco.editor.getEditors();return r.length<=e?(console.warn(`No editor found at index ${e}. Available editors: ${r.length}`),null):r[e]}getFirstEditorInstance(){return this.getEditorInstance(0)}static safeDispose(e){e.forEach(r=>{try{r&&typeof r.dispose=="function"&&r.dispose()}catch(n){console.warn("Error disposing Monaco resource:",n)}})}}const P2=$a.getInstance(),L2=["US","GB","IN","DE","FR","CN","JP","BR","CA","AU","IT","ES","RU","KR","ZA","MX","TR","ID","SA","AR","NL","CH","SE","BE","PL","EG","SG","TH","UA","PK","BD","PH","VN","MY","CO","CL","NO","DK","FI","IE","AT","GR","PT","HU","CZ","RO","NZ","AE","GH","EU","MA","NG","TW","HK","KE","IR","PE","QA","KW","LK","NP"];function Wu(t){return{US:"United States",GB:"United Kingdom",IN:"India",DE:"Germany",FR:"France",CN:"China",JP:"Japan",BR:"Brazil",CA:"Canada",AU:"Australia",IT:"Italy",ES:"Spain",RU:"Russia",KR:"South Korea",ZA:"South Africa",MX:"Mexico",TR:"Turkey",ID:"Indonesia",SA:"Saudi Arabia",AR:"Argentina",NL:"Netherlands",CH:"Switzerland",SE:"Sweden",BE:"Belgium",PL:"Poland",EG:"Egypt",SG:"Singapore",TH:"Thailand",UA:"Ukraine",PK:"Pakistan",BD:"Bangladesh",PH:"Philippines",VN:"Vietnam",MY:"Malaysia",CO:"Colombia",CL:"Chile",NO:"Norway",DK:"Denmark",FI:"Finland",IE:"Ireland",AT:"Austria",GR:"Greece",PT:"Portugal",HU:"Hungary",CZ:"Czech Republic",RO:"Romania",NZ:"New Zealand",AE:"United Arab Emirates",GH:"Ghana",EU:"European Union",MA:"Morocco",NG:"Nigeria",TW:"Taiwan",HK:"Hong Kong",KE:"Kenya",IR:"Iran",PE:"Peru",QA:"Qatar",KW:"Kuwait",LK:"Sri Lanka",NP:"Nepal"}[t]||t}const I2=x.createContext(null),_2=I2.Provider,Ja=()=>{const t=x.useContext(I2);if(!t)throw new Error("useJsonGridViewerContext must be used within a JsonGridViewerContextProvider");return t},we={STRING:"string",NUMBER:"number",BOOLEAN:"boolean",NULL:"null",OBJECT:"object",ARRAY:"array"},M2={[we.ARRAY]:"text-purple-600 bg-purple-100",[we.OBJECT]:"text-warning-600 bg-warning-100",[we.STRING]:"text-success-600 bg-success-100",[we.NUMBER]:"text-blue-600 bg-blue-100",[we.BOOLEAN]:"text-purple-600 bg-purple-100",[we.NULL]:"text-neutral-600 bg-neutral-100"},Wo=[{label:"String",value:we.STRING},{label:"Number",value:we.NUMBER},{label:"Boolean",value:we.BOOLEAN},{label:"Null",value:we.NULL},{label:"Object",value:we.OBJECT},{label:"Array",value:we.ARRAY}],Xu=t=>t===null?we.NULL:Array.isArray(t)?we.ARRAY:typeof t=="object"?we.OBJECT:typeof t,H2=t=>{const e=[...t].sort((n,a)=>n.length-a.length),r=[];for(const n of e)r.some(i=>n!==i&&n.startsWith(i+"."))||r.push(n);return r},R2=t=>!t||t.trim()===""?{}:JSON.parse(t),F2=(t,e)=>{const r=x.useCallback((i,s)=>{const o=[],A=(u,c)=>{Array.isArray(u)?u.forEach((d,f)=>{const h=`${c}.${f}`;o.push(h),typeof d=="object"&&d!==null&&A(d,h)}):u&&typeof u=="object"&&Object.entries(u).forEach(([d,f])=>{const h=`${c}.${d}`;o.push(h),typeof f=="object"&&f!==null&&A(f,h)})};return A(s,i),o},[]),n=x.useCallback((i,s,o,A)=>{if(s){const u=[i];if(A){const c=r(i,o);u.push(...c)}e(Array.from(new Set([...t,...u])))}else{const u=[i];if(A){const c=r(i,o);u.push(...c)}e(t?.filter(c=>!u.includes(c))||[])}},[t,e,r]),a=x.useCallback(i=>t?.includes(i)||!1,[t]);return{handleCheckboxChange:n,isPathSelected:a,getAllChildPaths:r}},U2=({value:t,path:e,onChange:r,isDarkMode:n=!1})=>{const[a,i]=x.useState(""),s=Xu(t),{selectedPathForEdit:o,setSelectedPathForEdit:A}=Ja();x.useEffect(()=>{s===we.STRING?i(t):s===we.NUMBER||s===we.BOOLEAN?i(String(t)):s===we.NULL&&i("null")},[t,s]);const u=d=>{i(d.target.value)},c=()=>{try{let d;if(s===we.NUMBER){if(d=Number(a),a.trim()==="")throw new Error("Empty number");if(d=Number(a),Number.isNaN(d))throw new Error("Invalid number")}else if(s===we.BOOLEAN)if(a.toLowerCase()==="true")d=!0;else if(a.toLowerCase()==="false")d=!1;else throw new Error("Invalid boolean value");else if(s===we.NULL)if(a.toLowerCase()==="null")d=null;else throw new Error("Invalid null value");else d=a;r(e,d),A(null)}catch{s===we.STRING?i(t):s===we.NUMBER||s===we.BOOLEAN?i(String(t)):s===we.NULL&&i("null")}};return s===we.BOOLEAN?l.jsx(kn,{isChecked:t,onChange:d=>r(e,d)}):s===we.NULL?l.jsx("span",{className:n?"text-neutral-400 italic":"text-neutral-500 italic",children:"null"}):o===e&&s===we.NUMBER?l.jsx(Gn,{value:a,onChange:d=>{const h=d.replace(/\.(?=.*\.)/g,"").replace(/[^\d.-]/g,"");i(h)},className:"w-full",onBlur:c}):o===e&&s===we.STRING?l.jsx("div",{className:"w-full min-w-36",children:l.jsx("textarea",{value:a,onChange:u,onBlur:c,className:`w-full min-w-36 rounded-lg px-2 py-1 text-sm focus:outline-none focus:border-blue-500 border resize-none hover:resize-y ${n?"bg-black-800 text-white":"bg-white text-black"}`,rows:1})}):l.jsx("span",{className:W(n?"text-neutral-400":"text-neutral-900","text-sm font-medium"),children:t})},xN=({isExpanded:t})=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",className:W(t?"rotate-90":"rotate-0","transition-transform duration-200"),children:l.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),ON=()=>l.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:l.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),wN=()=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",className:"text-neutral-500 dark:text-neutral-400",children:l.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),Qu=({data:t,path:e,onChange:r})=>{const n=Array.isArray(t),[a,i]=x.useState([]),{allExpanded:s,isDarkMode:o,selectedPaths:A,setSelectedPaths:u,setSelectedPathModification:c,isEditMode:d,handleCopy:f}=Ja(),{handleCheckboxChange:h,isPathSelected:p}=F2(A,u),m=()=>{const E=[],T=(O,C)=>{Array.isArray(O)?O.forEach((k,w)=>{const D=`${C}.${w}`;typeof k=="object"&&k!==null&&(E.push(D),T(k,D))}):O&&typeof O=="object"&&Object.entries(O).forEach(([k,w])=>{const D=`${C}.${k}`;typeof w=="object"&&w!==null&&(E.push(D),T(w,D))})};return T(t,e),E};x.useEffect(()=>{t&&i(s?m():[])},[s,t,e]);const y=E=>{i(T=>T.includes(E)?T.filter(O=>O!==E):[...T,E])},b=(E,T)=>{r(E,T)},S=e==="",v=(E,T,O,C,k)=>{const w=Xu(T),D=w===we.OBJECT||w===we.ARRAY,N=`${O}.${E}`,L=a.includes(N);return l.jsxs("tr",{className:W("border-neutral-300 dark:border-neutral-700",S?"border-b":k?"border-b-0":"border-b"),children:[l.jsx("td",{className:W("px-3 py-4 align-top border-r text-sm font-medium w-1/4",o?"text-neutral-200 bg-black-700":"bg-neutral-100 text-[#101828]",C&&!S&&"rounded-tl-xl",k&&!S&&"rounded-bl-xl"),children:l.jsxs("div",{className:"flex items-center",children:[d&&l.jsx(e2,{id:`checkbox-${N}`,label:"",isChecked:p(N),onChange:I=>h(N,I.target.checked,T,D)}),l.jsx("span",{className:"text-neutral-500 dark:text-neutral-400 whitespace-nowrap",children:E})]})}),l.jsx("td",{className:"!w-[120px] py-4 px-3 align-top bg-white dark:bg-black-800",children:l.jsx("div",{className:"flex items-start justify-center h-full",children:l.jsx("span",{className:`${M2[w]} px-2 py-1 rounded-xl text-xs`,children:w?.toUpperCase()})})}),l.jsx("td",{className:W("border-l border-neutral-300 dark:border-neutral-700 bg-white dark:bg-black-800",!d&&C&&!S&&"rounded-tr-xl",!d&&k&&!S&&"rounded-br-xl","!min-w-36"),children:l.jsx("div",{className:"py-2 px-3 flex items-center justify-start h-full",children:D?l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("button",{onClick:()=>y(N),className:`mr-1 p-0.5 flex items-center justify-center rounded ${o?"hover:bg-black-700 text-neutral-200":"hover:bg-neutral-300 text-neutral-600"}`,children:l.jsx(xN,{isExpanded:L})}),l.jsx("span",{className:W(o?"text-neutral-400":"text-neutral-900","text-sm font-medium"),children:L?w===we.ARRAY?`[${T.length} items]`:`{${Object.keys(T).length} items}`:w===we.ARRAY?`[${T.length} items]`:"{...}"}),!d&&l.jsx("button",{className:"ml-2",onClick:()=>f([N]),children:l.jsx(ON,{})})]}),L&&(Array.isArray(T)&&T?.length>0||Object.keys(T).length>0)&&l.jsx("div",{className:"ml-1.5 mt-3",children:l.jsx(Qu,{data:T,path:N,onChange:b})})]}):l.jsx(U2,{value:T,path:N,onChange:b,isDarkMode:o})})}),d&&l.jsx("td",{className:W("w-6 py-3.5 align-top bg-white dark:bg-black-800",C&&!S&&"rounded-tr-xl",k&&!S&&"rounded-br-xl"),children:l.jsx("button",{onClick:()=>c(N),className:"p-1 rounded hover:bg-neutral-100 dark:hover:bg-black-700",children:l.jsx(wN,{})})})]},N)};return t?l.jsx("div",{className:S?"border-none":"border border-neutral-300 dark:border-neutral-700 rounded-xl",children:l.jsx("table",{className:W("w-full"),children:l.jsx("tbody",{children:n?t.map((E,T)=>v(T,E,e,T===0,T===t.length-1)):Object.entries(t).map(([E,T],O)=>v(E,T,e,O===0,O===Object.keys(t).length-1))})})}):null},z2=({onChange:t,style:e})=>{const{isDarkMode:r,error:n,jsonData:a,setJsonData:i}=Ja();if(!a)return null;const s=(o,A)=>{if(!o||o===".")return;const u=o.split(".");u.shift();const c=structuredClone(a);let d=c;for(let h=0;h<u.length-1;h++){const p=u[h];if(Array.isArray(d)){const m=parseInt(p,10);d=d[m]}else d=d[p]}const f=u[u.length-1];if(Array.isArray(d)){const h=parseInt(f,10);d[h]=A}else d[f]=A;i(c),t?.(JSON.stringify(c,null,2))};return n?l.jsx("div",{className:r?"p-4 bg-red-900 text-red-300 border border-red-800 rounded":"p-4 bg-red-50 text-red-600 border border-red-300 rounded",children:n}):l.jsx("div",{className:W(r?"shadow-sm overflow-auto":"bg-white dark:bg-black-800 shadow-sm overflow-auto"),style:e,id:"json-grid-core-container",children:l.jsx("div",{className:"p-0 overflow-auto",children:l.jsx(Qu,{data:a,path:"",onChange:s})})})},B2=({visible:t,onClose:e,content:r,title:n,onConfirm:a,isLoading:i,variant:s,cancelText:o="Cancel",confirmText:A})=>{const u=x.useMemo(()=>l.jsxs("div",{className:"flex justify-end gap-3",children:[l.jsx(ut,{id:"btn-confirmation-modal-cancel",onClick:e,disabled:i,status:"secondary-neutral",children:o}),l.jsx(ut,{id:`btn-confirmation-modal-${s==="destructive"?"Delete":"Confirm"}`,onClick:a,isLoading:i,status:s==="destructive"?"error":"primary",autoFocus:!0,type:"submit",children:A||(s==="destructive"?"Delete":"Confirm")})]}),[e,a,i,s,o,A]);return t?l.jsx(Pr,{title:n,open:t,footer:u,onCancel:e,zIndex:9999,children:l.jsx("div",{className:"my-5",children:l.jsx("div",{className:"text-neutral-400 font-inter text-base",children:r})})}):null},CN=({size:t=24,fill:e="currentColor",className:r})=>l.jsx("svg",{className:r,width:t,height:t,viewBox:"0 0 20 20",fill:e,xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M10.0002 11.1666L5.91683 15.2499C5.76405 15.4027 5.56961 15.4791 5.3335 15.4791C5.09739 15.4791 4.90294 15.4027 4.75016 15.2499C4.59738 15.0971 4.521 14.9027 4.521 14.6666C4.521 14.4305 4.59738 14.236 4.75016 14.0833L8.8335 9.99992L4.75016 5.91659C4.59738 5.76381 4.521 5.56936 4.521 5.33325C4.521 5.09714 4.59738 4.9027 4.75016 4.74992C4.90294 4.59714 5.09739 4.52075 5.3335 4.52075C5.56961 4.52075 5.76405 4.59714 5.91683 4.74992L10.0002 8.83325L14.0835 4.74992C14.2363 4.59714 14.4307 4.52075 14.6668 4.52075C14.9029 4.52075 15.0974 4.59714 15.2502 4.74992C15.4029 4.9027 15.4793 5.09714 15.4793 5.33325C15.4793 5.56936 15.4029 5.76381 15.2502 5.91659L11.1668 9.99992L15.2502 14.0833C15.4029 14.236 15.4793 14.4305 15.4793 14.6666C15.4793 14.9027 15.4029 15.0971 15.2502 15.2499C15.0974 15.4027 14.9029 15.4791 14.6668 15.4791C14.4307 15.4791 14.2363 15.4027 14.0835 15.2499L10.0002 11.1666Z"})}),kN=({fill:t="#cccccc",className:e})=>l.jsx("svg",{height:"20",width:"20",viewBox:"0 0 20 20",focusable:"false",className:e,children:l.jsx("path",{fill:t,d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"})}),NN=({size:t=24,fill:e="currentColor",className:r,onClick:n})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 20 20",fill:e,xmlns:"http://www.w3.org/2000/svg",className:r,onClick:n,children:l.jsx("g",{mask:"url(#mask0_6454_18843)",children:l.jsx("path",{d:"M5.8335 17.5C5.37516 17.5 4.9828 17.3368 4.65641 17.0104C4.33002 16.684 4.16683 16.2917 4.16683 15.8333V5C3.93072 5 3.7328 4.92014 3.57308 4.76042C3.41336 4.60069 3.3335 4.40278 3.3335 4.16667C3.3335 3.93056 3.41336 3.73264 3.57308 3.57292C3.7328 3.41319 3.93072 3.33333 4.16683 3.33333H7.50016C7.50016 3.09722 7.58002 2.89931 7.73975 2.73958C7.89947 2.57986 8.09738 2.5 8.3335 2.5H11.6668C11.9029 2.5 12.1009 2.57986 12.2606 2.73958C12.4203 2.89931 12.5002 3.09722 12.5002 3.33333H15.8335C16.0696 3.33333 16.2675 3.41319 16.4272 3.57292C16.587 3.73264 16.6668 3.93056 16.6668 4.16667C16.6668 4.40278 16.587 4.60069 16.4272 4.76042C16.2675 4.92014 16.0696 5 15.8335 5V15.8333C15.8335 16.2917 15.6703 16.684 15.3439 17.0104C15.0175 17.3368 14.6252 17.5 14.1668 17.5H5.8335ZM5.8335 5V15.8333H14.1668V5H5.8335ZM7.50016 13.3333C7.50016 13.5694 7.58002 13.7674 7.73975 13.9271C7.89947 14.0868 8.09738 14.1667 8.3335 14.1667C8.56961 14.1667 8.76752 14.0868 8.92725 13.9271C9.08697 13.7674 9.16683 13.5694 9.16683 13.3333V7.5C9.16683 7.26389 9.08697 7.06597 8.92725 6.90625C8.76752 6.74653 8.56961 6.66667 8.3335 6.66667C8.09738 6.66667 7.89947 6.74653 7.73975 6.90625C7.58002 7.06597 7.50016 7.26389 7.50016 7.5V13.3333ZM10.8335 13.3333C10.8335 13.5694 10.9134 13.7674 11.0731 13.9271C11.2328 14.0868 11.4307 14.1667 11.6668 14.1667C11.9029 14.1667 12.1009 14.0868 12.2606 13.9271C12.4203 13.7674 12.5002 13.5694 12.5002 13.3333V7.5C12.5002 7.26389 12.4203 7.06597 12.2606 6.90625C12.1009 6.74653 11.9029 6.66667 11.6668 6.66667C11.4307 6.66667 11.2328 6.74653 11.0731 6.90625C10.9134 7.06597 10.8335 7.26389 10.8335 7.5V13.3333Z"})})}),ju=t=>{const{show:e,isFlowDashboard:r,onClose:n,actionItems:a,selectedItemsCount:i,deleteConfig:s,showActionBg:o}=t,{t:A}=kt.useTranslation(),[u,c]=x.useState(!1),[d,f]=x.useState(!0),h=x.useRef(null),p=x.useRef(null);x.useEffect(()=>{const b=new ResizeObserver(()=>{if(h.current&&p.current){const S=h.current.scrollWidth-100;a.length*180+100>S?f(!1):f(!0)}});return h.current&&b.observe(h.current),()=>{h.current&&b.unobserve(h.current)}});const m={label:A("Delete"),icon:l.jsx(NN,{size:16,className:"text-error-500"}),onClick:s?.onClick,...s},y=a.filter(b=>b.visible!==!1).map((b,S)=>({key:S,label:l.jsx(or,{icon:b.dropdownIcon,text:b?.label||"",onClick:b.onClick,className:"font-inter text-[14px] font-medium text-black-900 dark:text-black-200 gap-1.5"}),children:b.dropdownItems,disabled:!1}));return e?l.jsx(Ke.motion.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},exit:{y:20,opacity:0},transition:{duration:.2,ease:[.4,0,.2,1],opacity:{duration:.15}},ref:h,className:W("h-[40px]",r?"ml-60 w-1/2":"w-full"),children:l.jsxs("div",{className:W("h-[40px] border py-1.5 px-2 text-white bg-primary-800 dark:bg-black-700 flex justify-between items-center"),children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx(Zt,{tooltip:"Close",variant:"ghost",onClick:n,className:"hover:bg-primary-100 !p-0",children:l.jsx(CN,{size:20})}),l.jsxs("div",{className:"flex items-center gap-1.5 ml-2",children:[l.jsx("span",{className:"text-primary-600 dark:text-black-100 bg-primary-50 dark:bg-black-800 border-primary-200 dark:border-black-800 text-xs leading-4 font-normal border rounded-full pr-2 pl-2",children:i||0}),l.jsx(ee,{size:"extra-small",appearance:"custom",className:"text-white",children:A("Selected")})]})]}),l.jsx("div",{ref:p,className:W("h-[36px] flex items-center rounded-full font-inter",o?"bg-primary-900 dark:bg-black-800 px-[10px] rounded-[43px]":""),children:d?l.jsxs(Ke.motion.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"flex bg-primary-800 dark:bg-black-800 px-4 rounded-full",children:[a.map((b,S)=>b.visible!==!1&&l.jsx("div",{children:b.type==="dropdown"?l.jsx(Fe.Dropdown,{menu:{items:b.dropdownItems},trigger:[b.dropdownTrigger||"click"],overlayClassName:"!min-w-[148px]",placement:"bottomRight",getPopupContainer:v=>v.parentElement,open:u,onOpenChange:c,children:l.jsxs("button",{id:`btn-floating-bar-${b.label}`,onClick:b.onClick,disabled:b.disabled,className:W(b?.label?"flex items-center mx-1 gap-1.5 py-1 pr-3 pl-2 rounded-md text-white hover:text-primary-50 transition-all duration-300 bg-transparent":"bg-transparent p-1.5 hover:bg-primary-800 rounded-xl",b?.hideLabel&&"!p-1.5",(b.label==="Delete"||b.label==="Remove")&&"!text-error-500"),children:[l.jsx(Me,{hideTooltip:!b.tooltip,title:b.tooltip,className:"flex items-center",children:b.icon}),!b?.hideLabel&&b.label&&l.jsx(ee,{size:"small",variant:"medium",className:"text-inherit",appearance:"custom",children:b.label})]},S)}):l.jsxs("button",{id:`btn-floating-bar-${b.label}`,onClick:b.onClick,disabled:b.disabled,className:W(b?.label?"flex items-center mx-1 gap-1.5 py-1 pr-3 pl-2 rounded-md text-white hover:text-primary-50 transition-all duration-300 bg-transparent":"bg-transparent p-1.5 hover:bg-primary-800 rounded-xl",b?.hideLabel&&"!p-1.5",(b.label==="Delete"||b.label==="Remove")&&"!text-error-500"),children:[l.jsx(Me,{hideTooltip:!b.tooltip,title:b.tooltip,className:"flex items-center",children:b.icon}),!b?.hideLabel&&b.label&&l.jsx(ee,{size:"small",variant:"medium",className:"text-inherit",appearance:"custom",children:b.label})]})},S)),s?l.jsxs("button",{id:`btn-floating-bar-${m.label}`,onClick:m.onClick,disabled:!1,className:"flex items-center gap-1.5 py-1 pr-3 pl-2 rounded-md",children:[m.icon,l.jsx(ee,{size:"small",variant:"medium",className:"text-error-500",appearance:"custom",children:m.label})]}):null]}):l.jsxs(Ke.motion.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"minw-[150px] p-1.5 flex items-center",children:[l.jsx(Fe.Dropdown,{menu:{items:y},trigger:["click"],overlayClassName:"!min-w-[148px]",placement:"bottomRight",getPopupContainer:b=>b.parentElement,open:u,onOpenChange:c,children:l.jsxs("button",{id:"btn-floating-bar-actions",disabled:!1,className:"flex items-center gap-1.5 px-2 py-1 w-22 h-7 rounded-full bg-primary-700",type:"button",children:[l.jsx(ee,{size:"small",variant:"medium",className:"text-white",children:A("Actions")}),l.jsx(kN,{fill:"#FFFFFF",className:"w-[16px] h-[16px]"})]})}),s?l.jsxs("button",{id:`btn-floating-bar-${m.label}`,onClick:m.onClick,disabled:!1,className:"flex items-center gap-1.5 py-1 pr-3 pl-2 rounded-md",type:"button",children:[m.icon,l.jsx(ee,{size:"small",variant:"medium",className:"text-error-500",appearance:"custom",children:m.label})]}):null]})})]})}):null};ju.displayName="FloatingBar";const DN=()=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",className:"text-white",children:l.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),PN=()=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",className:"text-white",children:l.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"})}),LN=()=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",className:"text-[#F04438]",children:l.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})}),q2=()=>{const{selectedTopLevelPaths:t,setSelectedPaths:e,handleDelete:r,handleDuplicate:n,handleCopy:a}=Ja(),[i,s]=x.useState(!1),o=[{id:"copy",icon:l.jsx(DN,{}),tooltip:"Copy",label:"Copy",hideLabel:!0,onClick:()=>a(t)},{id:"duplicate",icon:l.jsx(PN,{}),tooltip:"Duplicate",label:"Duplicate",hideLabel:!0,onClick:()=>n(t)},{id:"delete",icon:l.jsx(LN,{}),tooltip:"Delete",label:"Delete",hideLabel:!0,onClick:()=>s(!0)}];return l.jsxs(l.Fragment,{children:[l.jsx(B2,{title:"Delete Keys",content:"Are you sure you want to delete the selected keys?",visible:i,variant:"destructive",onClose:()=>s(!1),onConfirm:()=>{r(t),e([]),s(!1)}}),l.jsx(ju,{show:t.length>0,onClose:()=>e([]),actionItems:o,showActionBg:!0,selectedItemsCount:t.length})]})},IN=t=>{if(t===we.BOOLEAN)return!1;if(t===we.STRING)return"";if(t===we.NUMBER)return 0;if(t===we.NULL)return null;if(t===we.ARRAY)return[];if(t===we.OBJECT)return{}},V2=({isVisible:t,onClose:e,parentContainer:r})=>{const[n,a]=x.useState(""),[i,s]=x.useState(Wo[0]),[o,A]=x.useState(null),[u,c]=x.useState(""),[d,f]=x.useState(null),{handleAddKey:h,selectedPathModification:p}=Ja();x.useEffect(()=>{i.value===we.BOOLEAN?A(!1):i.value===we.STRING?A(""):i.value===we.NUMBER?A(0):i.value===we.NULL?A(null):i.value===we.ARRAY?(A([]),c("")):i.value===we.OBJECT&&(A({}),c(""))},[i]);const m=()=>{a(""),s(Wo[0]),A(null),c(""),e(),f(null)};x.useEffect(()=>{if(i.value===we.ARRAY||i.value===we.OBJECT){if(u.trim()===""){f(null);return}try{const b=JSON.parse(u);i.value===we.ARRAY&&!Array.isArray(b)?f("Enter a valid JSON array."):i.value===we.OBJECT&&(typeof b!="object"||b===null||Array.isArray(b))?f("Enter a valid JSON object."):f(null)}catch{f("Enter valid JSON.")}}},[u,i]);const y=()=>o===null&&i.value===we.NULL?null:!o&&o!==0&&o!==!1?IN(i.value):i.value===we.NUMBER?Number(o):o;return l.jsx(Pr,{open:t,onCancel:m,title:"New Key",parentContainer:r,width:351,footer:l.jsx("div",{className:"flex justify-end mt-5 gap-4",children:l.jsx(ut,{id:"btn-add-key-modal-add",status:"primary",onClick:async()=>{await h(p||"",n,y()),m()},disabled:!n||o===null&&i.value!==we.NULL||!!d,children:"Add"})}),children:l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsx(Gn,{required:!0,label:l.jsx("span",{className:"text-neutral-600 dark:text-white text-xs font-medium",children:"Key"}),value:n,onChange:b=>a(b),placeholder:"Enter key"}),l.jsx(Mo,{label:l.jsx("span",{className:"text-neutral-600 dark:text-white text-xs font-medium",children:"Type"}),options:Wo,value:i,onChange:b=>s(b)}),(()=>{switch(i.value){case we.NULL:return null;case we.BOOLEAN:return l.jsx(kn,{label:l.jsx("span",{className:"text-neutral-600 dark:text-white text-xs font-medium",children:"Value"}),isChecked:!!o,onChange:b=>A(b),statusText:o?"true":"false"});case we.OBJECT:case we.ARRAY:return l.jsx(zu,{placeholder:i.value===we.ARRAY?"e.g. [1, 2, 3]":'e.g. {"key_1" : 1, "key_2":2}',onChange:b=>{const S=b;if(c(S),S.trim()==="")A(i.value===we.ARRAY?[]:{});else try{const v=JSON.parse(S);A(v)}catch{}}});default:return l.jsx(Gn,{label:l.jsx("span",{className:"text-neutral-600 dark:text-white text-xs font-medium",children:"Value"}),className:"w-full",value:o,onChange:b=>{if(i.value===we.NUMBER){const v=b.replace(/\.(?=.*\.)/g,"").replace(/[^\d.-]/g,"");A(v)}else A(b)},placeholder:"Enter value"})}})()]})})},Xo=({isFullScreen:t,allExpanded:e,toggleAll:r,isEditMode:n,isDarkMode:a,style:i,value:s,onChange:o,setIsAddKeyModalOpen:A,isAddKeyModalOpen:u})=>{const[c,d]=x.useState({}),[f,h]=x.useState(null),[p,m]=x.useState([]),[y,b]=x.useState([]),[S,v]=x.useState(null),[E,T]=x.useState(null);x.useEffect(()=>{b(H2(p))},[p]),x.useEffect(()=>{try{const D=R2(s);d(D),h(null)}catch(D){h("Invalid JSON: "+D.message)}},[s]);const O=D=>{if(!D.length)return;const N=Du.produce(c,L=>{D.forEach(I=>{if(!I||I===".")return;const _=I.split(".");if(_.shift(),_.length===0)return;let M=L;for(let F=0;F<_.length-1;F++)if(M=M[_[F]],M===void 0)return;const H=_[_.length-1];if(Array.isArray(M)){const F=Number(H);!isNaN(F)&&F>=0&&F<M.length&&M.splice(F,1)}else M&&typeof M=="object"&&delete M[H]})});o?.(JSON.stringify(N,null,2))},C=D=>{if(!D.length)return;const N=Du.produce(c,L=>{D.forEach(I=>{const _=I.split(".");_[0]===""&&_.shift();let M=L;for(let F=0;F<_.length-1;F++)if(M=M[_[F]],M===void 0)return;const H=_[_.length-1];if(Array.isArray(M)){const F=Number(H);if(!isNaN(F)&&F>=0&&F<M.length){const P=JSON.parse(JSON.stringify(M[F]));M.splice(F+1,0,P)}}else if(M&&typeof M=="object"&&Object.hasOwn(M,H)){let F=H+"_copy",P=2;for(;M.hasOwnProperty(F);)F=`${H}_copy_${P++}`;M[F]=JSON.parse(JSON.stringify(M[H]))}})});o?.(JSON.stringify(N,null,2))},k=async D=>{if(!D.length)return!1;if(D.length===1){const N=D[0].split(".");N[0]===""&&N.shift();let L=c;for(const _ of N){if(L==null)return!1;L=L[_]}if(L===void 0)return!1;let I;typeof L=="object"?I=JSON.stringify(L,null,2):I=String(L);try{return await navigator.clipboard.writeText(I),!0}catch{return!1}}else{const N={};for(const L of D){const I=L.split(".");I[0]===""&&I.shift();let _=c;for(const M of I)_!=null&&(_=_[M]);if(_!==void 0){const M=I[I.length-1]||"root";N[M]=_}}try{return await navigator.clipboard.writeText(JSON.stringify(N,null,2)),!0}catch{return!1}}},w=async(D,N,L)=>{const I=D.split(".");I[0]===""&&I.shift();const _=Du.produce(c,M=>{let H=M;if(I.length===0){if(H.hasOwnProperty(N)){let F=N,P=2;for(;H.hasOwnProperty(F);)F=`${N}_${P++}`;H[F]=L}else H[N]=L;return}for(let F=0;F<I.length;F++)if(H=H[I[F]],H===void 0)return;if(H.hasOwnProperty(N)){let F=N,P=2;for(;H.hasOwnProperty(F);)F=`${N}_${P++}`;H[F]=L}else H[N]=L});v(null),o?.(JSON.stringify(_,null,2))};return l.jsx(_2,{value:{allExpanded:e,toggleAll:r,isEditMode:n,isDarkMode:a,selectedPaths:p,setSelectedPaths:m,selectedTopLevelPaths:y,setSelectedTopLevelPaths:b,selectedPathModification:S,setSelectedPathModification:v,selectedPathForEdit:E,setSelectedPathForEdit:T,jsonData:c,setJsonData:d,error:f,setError:h,handleDelete:O,handleDuplicate:C,handleCopy:k,handleAddKey:w,setIsAddKeyModalOpen:A,isAddKeyModalOpen:u},children:l.jsxs("div",{className:"bg-white dark:bg-black-800 rounded-b-lg",children:[n&&l.jsx(q2,{}),l.jsx(z2,{onChange:o,style:i}),n&&l.jsx(V2,{parentContainer:t?"json-grid-core-container":"full-screen-container",isVisible:u,onClose:()=>A(!1)})]})})};function W2(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(r=W2(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function _N(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=W2(t))&&(n&&(n+=" "),n+=e);return n}const Gu="-",MN=t=>{const e=RN(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:s=>{const o=s.split(Gu);return o[0]===""&&o.length!==1&&o.shift(),X2(o,e)||HN(s)},getConflictingClassGroupIds:(s,o)=>{const A=r[s]||[];return o&&n[s]?[...A,...n[s]]:A}}},X2=(t,e)=>{if(t.length===0)return e.classGroupId;const r=t[0],n=e.nextPart.get(r),a=n?X2(t.slice(1),n):void 0;if(a)return a;if(e.validators.length===0)return;const i=t.join(Gu);return e.validators.find(({validator:s})=>s(i))?.classGroupId},Q2=/^\[(.+)\]$/,HN=t=>{if(Q2.test(t)){const e=Q2.exec(t)[1],r=e?.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},RN=t=>{const{theme:e,classGroups:r}=t,n={nextPart:new Map,validators:[]};for(const a in r)Yu(r[a],n,a,e);return n},Yu=(t,e,r,n)=>{t.forEach(a=>{if(typeof a=="string"){const i=a===""?e:j2(e,a);i.classGroupId=r;return}if(typeof a=="function"){if(FN(a)){Yu(a(n),e,r,n);return}e.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,s])=>{Yu(s,j2(e,i),r,n)})})},j2=(t,e)=>{let r=t;return e.split(Gu).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},FN=t=>t.isThemeGetter,UN=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map;const a=(i,s)=>{r.set(i,s),e++,e>t&&(e=0,n=r,r=new Map)};return{get(i){let s=r.get(i);if(s!==void 0)return s;if((s=n.get(i))!==void 0)return a(i,s),s},set(i,s){r.has(i)?r.set(i,s):a(i,s)}}},Ku="!",Zu=":",zN=Zu.length,BN=t=>{const{prefix:e,experimentalParseClassName:r}=t;let n=a=>{const i=[];let s=0,o=0,A=0,u;for(let p=0;p<a.length;p++){let m=a[p];if(s===0&&o===0){if(m===Zu){i.push(a.slice(A,p)),A=p+zN;continue}if(m==="/"){u=p;continue}}m==="["?s++:m==="]"?s--:m==="("?o++:m===")"&&o--}const c=i.length===0?a:a.substring(A),d=qN(c),f=d!==c,h=u&&u>A?u-A:void 0;return{modifiers:i,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:h}};if(e){const a=e+Zu,i=n;n=s=>s.startsWith(a)?i(s.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:s,maybePostfixModifierPosition:void 0}}if(r){const a=n;n=i=>r({className:i,parseClassName:a})}return n},qN=t=>t.endsWith(Ku)?t.substring(0,t.length-1):t.startsWith(Ku)?t.substring(1):t,VN=t=>{const e=Object.fromEntries(t.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const a=[];let i=[];return n.forEach(s=>{s[0]==="["||e[s]?(a.push(...i.sort(),s),i=[]):i.push(s)}),a.push(...i.sort()),a}},WN=t=>({cache:UN(t.cacheSize),parseClassName:BN(t),sortModifiers:VN(t),...MN(t)}),XN=/\s+/,QN=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:i}=e,s=[],o=t.trim().split(XN);let A="";for(let u=o.length-1;u>=0;u-=1){const c=o[u],{isExternal:d,modifiers:f,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}=r(c);if(d){A=c+(A.length>0?" "+A:A);continue}let y=!!m,b=n(y?p.substring(0,m):p);if(!b){if(!y){A=c+(A.length>0?" "+A:A);continue}if(b=n(p),!b){A=c+(A.length>0?" "+A:A);continue}y=!1}const S=i(f).join(":"),v=h?S+Ku:S,E=v+b;if(s.includes(E))continue;s.push(E);const T=a(b,y);for(let O=0;O<T.length;++O){const C=T[O];s.push(v+C)}A=c+(A.length>0?" "+A:A)}return A};function jN(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=G2(e))&&(n&&(n+=" "),n+=r);return n}const G2=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=G2(t[n]))&&(r&&(r+=" "),r+=e);return r};function GN(t,...e){let r,n,a,i=s;function s(A){const u=e.reduce((c,d)=>d(c),t());return r=WN(u),n=r.cache.get,a=r.cache.set,i=o,o(A)}function o(A){const u=n(A);if(u)return u;const c=QN(A,r);return a(A,c),c}return function(){return i(jN.apply(null,arguments))}}const It=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},Y2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,K2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,YN=/^\d+\/\d+$/,KN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZN=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,$N=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,JN=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ei=t=>YN.test(t),ze=t=>!!t&&!Number.isNaN(Number(t)),Yn=t=>!!t&&Number.isInteger(Number(t)),$u=t=>t.endsWith("%")&&ze(t.slice(0,-1)),Nn=t=>KN.test(t),tD=()=>!0,rD=t=>ZN.test(t)&&!$N.test(t),Z2=()=>!1,nD=t=>JN.test(t),aD=t=>eD.test(t),iD=t=>!xe(t)&&!Oe(t),sD=t=>ti(t,r3,Z2),xe=t=>Y2.test(t),Ta=t=>ti(t,n3,rD),Ju=t=>ti(t,cD,ze),$2=t=>ti(t,e3,Z2),oD=t=>ti(t,t3,aD),Qo=t=>ti(t,a3,nD),Oe=t=>K2.test(t),Gi=t=>ri(t,n3),AD=t=>ri(t,dD),J2=t=>ri(t,e3),lD=t=>ri(t,r3),uD=t=>ri(t,t3),jo=t=>ri(t,a3,!0),ti=(t,e,r)=>{const n=Y2.exec(t);return n?n[1]?e(n[1]):r(n[2]):!1},ri=(t,e,r=!1)=>{const n=K2.exec(t);return n?n[1]?e(n[1]):r:!1},e3=t=>t==="position"||t==="percentage",t3=t=>t==="image"||t==="url",r3=t=>t==="length"||t==="size"||t==="bg-size",n3=t=>t==="length",cD=t=>t==="number",dD=t=>t==="family-name",a3=t=>t==="shadow",fD=GN(()=>{const t=It("color"),e=It("font"),r=It("text"),n=It("font-weight"),a=It("tracking"),i=It("leading"),s=It("breakpoint"),o=It("container"),A=It("spacing"),u=It("radius"),c=It("shadow"),d=It("inset-shadow"),f=It("text-shadow"),h=It("drop-shadow"),p=It("blur"),m=It("perspective"),y=It("aspect"),b=It("ease"),S=It("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...E(),Oe,xe],O=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],k=()=>[Oe,xe,A],w=()=>[ei,"full","auto",...k()],D=()=>[Yn,"none","subgrid",Oe,xe],N=()=>["auto",{span:["full",Yn,Oe,xe]},Yn,Oe,xe],L=()=>[Yn,"auto",Oe,xe],I=()=>["auto","min","max","fr",Oe,xe],_=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],M=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...k()],F=()=>[ei,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],P=()=>[t,Oe,xe],q=()=>[...E(),J2,$2,{position:[Oe,xe]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],X=()=>["auto","cover","contain",lD,sD,{size:[Oe,xe]}],G=()=>[$u,Gi,Ta],Q=()=>["","none","full",u,Oe,xe],Y=()=>["",ze,Gi,Ta],j=()=>["solid","dashed","dotted","double"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[ze,$u,J2,$2],le=()=>["","none",p,Oe,xe],Ee=()=>["none",ze,Oe,xe],ge=()=>["none",ze,Oe,xe],Ce=()=>[ze,Oe,xe],Re=()=>[ei,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Nn],breakpoint:[Nn],color:[tD],container:[Nn],"drop-shadow":[Nn],ease:["in","out","in-out"],font:[iD],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Nn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Nn],shadow:[Nn],spacing:["px",ze],text:[Nn],"text-shadow":[Nn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ei,xe,Oe,y]}],container:["container"],columns:[{columns:[ze,xe,Oe,o]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{start:w()}],end:[{end:w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[Yn,"auto",Oe,xe]}],basis:[{basis:[ei,"full","auto",o,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ze,ei,"auto","initial","none",xe]}],grow:[{grow:["",ze,Oe,xe]}],shrink:[{shrink:["",ze,Oe,xe]}],order:[{order:[Yn,"first","last","none",Oe,xe]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[..._(),"normal"]}],"justify-items":[{"justify-items":[...M(),"normal"]}],"justify-self":[{"justify-self":["auto",...M()]}],"align-content":[{content:["normal",..._()]}],"align-items":[{items:[...M(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...M(),{baseline:["","last"]}]}],"place-content":[{"place-content":_()}],"place-items":[{"place-items":[...M(),"baseline"]}],"place-self":[{"place-self":["auto",...M()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],w:[{w:[o,"screen",...F()]}],"min-w":[{"min-w":[o,"screen","none",...F()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[s]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",r,Gi,Ta]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Oe,Ju]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$u,xe]}],"font-family":[{font:[AD,xe,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Oe,xe]}],"line-clamp":[{"line-clamp":[ze,"none",Oe,Ju]}],leading:[{leading:[i,...k()]}],"list-image":[{"list-image":["none",Oe,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Oe,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:[ze,"from-font","auto",Oe,Ta]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[ze,"auto",Oe,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Oe,xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Oe,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:X()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Yn,Oe,xe],radial:["",Oe,xe],conic:[Yn,Oe,xe]},uD,oD]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...j(),"hidden","none"]}],"divide-style":[{divide:[...j(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...j(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ze,Oe,xe]}],"outline-w":[{outline:["",ze,Gi,Ta]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",c,jo,Qo]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",d,jo,Qo]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[ze,Ta]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",f,jo,Qo]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[ze,Oe,xe]}],"mix-blend":[{"mix-blend":[...ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ze]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[Oe,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[ze]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:X()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Oe,xe]}],filter:[{filter:["","none",Oe,xe]}],blur:[{blur:le()}],brightness:[{brightness:[ze,Oe,xe]}],contrast:[{contrast:[ze,Oe,xe]}],"drop-shadow":[{"drop-shadow":["","none",h,jo,Qo]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",ze,Oe,xe]}],"hue-rotate":[{"hue-rotate":[ze,Oe,xe]}],invert:[{invert:["",ze,Oe,xe]}],saturate:[{saturate:[ze,Oe,xe]}],sepia:[{sepia:["",ze,Oe,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",Oe,xe]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[ze,Oe,xe]}],"backdrop-contrast":[{"backdrop-contrast":[ze,Oe,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ze,Oe,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ze,Oe,xe]}],"backdrop-invert":[{"backdrop-invert":["",ze,Oe,xe]}],"backdrop-opacity":[{"backdrop-opacity":[ze,Oe,xe]}],"backdrop-saturate":[{"backdrop-saturate":[ze,Oe,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",ze,Oe,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Oe,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ze,"initial",Oe,xe]}],ease:[{ease:["linear","initial",b,Oe,xe]}],delay:[{delay:[ze,Oe,xe]}],animate:[{animate:["none",S,Oe,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,Oe,xe]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:Ee()}],"rotate-x":[{"rotate-x":Ee()}],"rotate-y":[{"rotate-y":Ee()}],"rotate-z":[{"rotate-z":Ee()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":["scale-3d"],skew:[{skew:Ce()}],"skew-x":[{"skew-x":Ce()}],"skew-y":[{"skew-y":Ce()}],transform:[{transform:[Oe,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Re()}],"translate-x":[{"translate-x":Re()}],"translate-y":[{"translate-y":Re()}],"translate-z":[{"translate-z":Re()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Oe,xe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Oe,xe]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[ze,Gi,Ta,Ju]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Yi(...t){return fD(_N(t))}const Kn=W("text-neutral-600 cursor-pointer hover:text-neutral-800","dark:text-neutral-300 dark:hover:text-neutral-50"),hD=({fontSize:t})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",children:l.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})}),pD=({fontSize:t})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:Kn,children:l.jsx("path",{d:"M19 2h-4.18C14.4.84 13.3 0 12 0S9.6.84 9.18 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm7 18H5V4h2v3h10V4h2v16z"})}),mD=({fontSize:t})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:Kn,children:l.jsx("path",{d:"M9.5 2c-1.82 0-3.53.5-5 1.35 2.99 1.73 5 4.95 5 8.65s-2.01 6.92-5 8.65c1.47.85 3.18 1.35 5 1.35 5.52 0 10-4.48 10-10S15.02 2 9.5 2z"})}),gD=({fontSize:t})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:Kn,children:l.jsx("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4-5 5-5-5h3V4h4v7h3z"})}),bD=({fontSize:t})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:Kn,children:l.jsx("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})}),vD=({fontSize:t})=>l.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:Kn,children:[l.jsx("path",{d:"M18 6.41 16.59 5 12 9.58 7.41 5 6 6.41l6 6z"}),l.jsx("path",{d:"m18 13-1.41-1.41L12 16.17l-4.59-4.58L6 13l6 6z"})]}),yD=({fontSize:t})=>l.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:Kn,children:[l.jsx("path",{d:"M6 17.59 7.41 19 12 14.42 16.59 19 18 17.59l-6-6z"}),l.jsx("path",{d:"m6 11 1.41 1.41L12 7.83l4.59 4.58L18 11l-6-6z"})]}),SD=({fontSize:t})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:Kn,children:l.jsx("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z"})}),ED=({fontSize:t})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:Kn,children:l.jsx("path",{d:"M14 17H4v2h10v-2zm6-8H4v2h16V9zM4 15h16v-2H4v2zM4 5v2h16V5H4z"})}),i3=({value:t,onChange:e=()=>!1,withFullScreen:r=!0,withTheme:n=!0,isEditMode:a=!1,height:i="55vh",language:s="json",monacoEditor:o,isShowCopy:A=!0,isShowDownload:u=!0,setIsDisableSave:c,withJsonGrid:d=!0,editorTheme:f,setEditorTheme:h,theme:p,className:m,enableAutoFormatting:y=!0,renderToolbarActions:b,onBlockClick:S,focusBlock:v,focusBlockTopLevelOnly:E=!1})=>{const T=x.useRef(null),[O,C]=x.useState("vs"),[k,w]=x.useState("light"),D=f??O,N=p??k,L=h??(de=>{C(de),w(de==="vs-dark"?"dark":"light")}),[I,_]=x.useState(!1),[M,H]=x.useState(null),[F,P]=x.useState(null),[q,B]=x.useState(!1);x.useEffect(()=>{(async()=>{try{const ie=await P2.initialize();P(ie),B(!0)}catch(ie){console.error("Failed to initialize Monaco Editor:",ie),B(!1)}})()},[]);const X=o||F,{handleFormatCode:G,pythonError:Q,pythonLoading:Y}=D2({code:t,setCode:e,currentEditorModel:M,monacoEditor:X,enable:a===!0&&s==="python"}),j=Po.useFullScreenHandle(),[ae,se]=x.useState("JSON"),[le,Ee]=x.useState(!1),ge=s==="json",Ce=()=>{j?.active?j.exit():j.enter()},Re=x.useRef(S);Re.current=S;const Te=x.useCallback(async(de,ie,fe)=>{if(!Re.current)return;const ye=de.getModel();if(!ye)return;const ke=($e,at)=>ye.getValueInRange({startLineNumber:$e,startColumn:1,endLineNumber:at,endColumn:ye.getLineMaxColumn(at)}),je=($e,at,Ot,wt,lt)=>{Re.current({startLine:$e,endLine:at,text:Ot,kind:wt,cursorLine:ie,cursorColumn:fe,parentBlock:lt})};try{const $e=de.getContribution("editor.contrib.folding");if($e){const pt=await $e.getFoldingModel();if(pt?.regions){const qe=pt.regions,Ut=ye.getLineCount(),bt=[];for(let Je=0;Je<qe.length;Je++){const vt=qe.getStartLineNumber(Je),Xe=qe.getEndLineNumber(Je),Yt=Math.min(Xe+1,Ut),sr=Yt-vt;if(ie>=vt&&ie<=Yt){const tr=qe.getType(Je),en=tr===1?"comment":tr===2?"imports":tr===3?"region":void 0;bt.push({start:vt,end:Yt,size:sr,kind:en})}}if(bt.length>0){bt.sort((sr,tr)=>sr.size-tr.size);const Je=bt[0],vt=ke(Je.start,Je.end);let Xe;for(let sr=bt.length-1;sr>0;sr--){const tr=bt[sr];if(!(tr.start<=1&&tr.end>=Ut)){Xe=tr;break}}const Yt=Xe&&Xe!==Je?{startLine:Xe.start,endLine:Xe.end,text:ke(Xe.start,Xe.end),kind:Xe.kind}:void 0;je(Je.start,Je.end,vt,Je.kind,Yt);return}}}const at={lineNumber:ie,column:fe},Ot=ye.bracketPairs?.findEnclosingBrackets?.(at);if(Ot&&Ot.length===2){const[pt,qe]=Ot,Ut=pt.startLineNumber,bt=qe.endLineNumber,Je=ke(Ut,bt);je(Ut,bt,Je);return}const wt=ye.getLineCount(),lt=ye.getValue();je(1,wt,lt)}catch{}},[]);x.useEffect(()=>{if(!v||!T.current)return;const de=T.current,ie=de.getModel();if(!ie)return;const fe=ie.findMatches(v,!0,!1,!0,null,!1);if(fe.length===0)return;let ye=fe[0];if(E&&fe.length>1){let at=1/0;for(const Ot of fe){const wt=ie.getLineContent(Ot.range.startLineNumber),lt=wt.length-wt.trimStart().length;lt<at&&(at=lt,ye=Ot)}}const ke=ye.range.startLineNumber,je=ye.range.startColumn;de.setPosition({lineNumber:ke,column:je}),de.revealLineInCenter(ke,1);const $e=async()=>{try{const at=de.getContribution("editor.contrib.folding");if(at){const lt=await at.getFoldingModel();if(lt?.regions){const pt=lt.regions;let qe=-1,Ut=-1,bt=1/0;for(let Je=0;Je<pt.length;Je++){const vt=pt.getStartLineNumber(Je),Xe=pt.getEndLineNumber(Je),Yt=Math.min(Xe+1,ie.getLineCount()),sr=Yt-vt;ke>=vt&&ke<=Yt&&sr<bt&&(qe=vt,Ut=Yt,bt=sr)}if(qe!==-1){de.setSelection({startLineNumber:qe,startColumn:1,endLineNumber:Ut,endColumn:ie.getLineMaxColumn(Ut)}),de.revealRangeInCenter({startLineNumber:qe,startColumn:1,endLineNumber:Ut,endColumn:ie.getLineMaxColumn(Ut)},1);return}}}const Ot={lineNumber:ke,column:je},wt=ie.bracketPairs?.findEnclosingBrackets?.(Ot);if(wt&&wt.length===2){const[lt,pt]=wt;de.setSelection({startLineNumber:lt.startLineNumber,startColumn:1,endLineNumber:pt.endLineNumber,endColumn:ie.getLineMaxColumn(pt.endLineNumber)}),de.revealRangeInCenter({startLineNumber:lt.startLineNumber,startColumn:1,endLineNumber:pt.endLineNumber,endColumn:ie.getLineMaxColumn(pt.endLineNumber)},1);return}de.setSelection(ye.range)}catch{de.setSelection(ye.range)}};requestAnimationFrame(()=>{$e()})},[v,E]);const $=de=>{T.current=de;const ie=()=>{try{if(s==="python"){const fe=de.getModel();fe&&H(fe)}s==="json"&&y&&requestAnimationFrame(()=>{oe()})}catch(fe){console.warn("Failed to initialize editor:",fe)}};if(de.getModel())ie();else{const fe=de.onDidChangeModel(()=>{ie(),fe.dispose()})}Re.current&&de.onMouseDown(()=>{requestAnimationFrame(()=>{const fe=de.getPosition();fe&&Te(de,fe.lineNumber,fe.column)})})},te=()=>{try{const de=JSON.parse(t),ie=JSON.stringify(de,null,4);e(ie),M&&X&&X.editor.setModelMarkers(M,"json",[])}catch(de){if(M&&X){const ie=de instanceof Error?de.message:"Invalid JSON";try{X.editor.setModelMarkers(M,"json",[{startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1,message:`Cannot format: ${ie}`,severity:X.MarkerSeverity.Error}])}catch(fe){console.warn("Failed to set JSON error markers:",fe)}}}},oe=()=>{if(s==="python"){G();return}if(s==="json"){te();return}if(T.current)try{const de=T.current.getAction("editor.action.formatDocument");de&&de.run()}catch(de){console.warn("Failed to format document:",de)}},Le=de=>{typeof de=="string"&&e(de)};if(x.useEffect(()=>{c&&c(Q||Y)},[Q,Y,c]),!o&&!q)return l.jsx("div",{className:"flex items-center justify-center p-8 border border-neutral-200 dark:border-neutral-700 rounded-lg",children:l.jsx("div",{className:"text-neutral-600 dark:text-neutral-400",children:"Loading editor..."})});const Ie=W("hover:bg-neutral-300 hover:dark:bg-neutral-700 p-0.5 rounded-md flex items-center justify-center"),Ye=()=>{if(s==="python")try{let de=t;de&&(de=de.replace(/\r\n/g,`
|
|
72
72
|
`).replace(/\r/g,`
|
|
73
73
|
`),de=de.split(`
|
|
74
74
|
`).map(ie=>ie.trimEnd()).join(`
|