@lax-wp/design-system 0.10.25 → 0.10.26

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.cjs.js CHANGED
@@ -50,7 +50,7 @@
50
50
  `,document.head.appendChild(ce)},[]);const ue=()=>{if(V){let ne="";Ae==null?ne="":typeof Ae=="string"||typeof Ae=="number"?ne=String(Ae):Array.isArray(Ae)?ne=Ae.map(be=>typeof be=="object"&&be!==null&&"value"in be?be.value:be).join(", "):typeof Ae=="object"&&"value"in Ae&&(ne=String(Ae.value)),V({key:h,value:ne})}},Ae=m_(e),G=g.useMemo(()=>b?PN(b,y):null,[b,y]),ee=(ne,ce)=>{if(fe.current&&W.id){const be=document.getElementById(W.id);if(be){const Ce=Array.isArray(ce)?ce.map(nt=>nt.value):ce?.value;be.dataset.selectedValue=JSON.stringify(Ce);const We=new Event("change",{bubbles:!0});Object.defineProperty(We,"target",{writable:!1,value:be}),be.dispatchEvent(We);const rt=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${W.id}`,value:Ce,type:"change"}});be.dispatchEvent(rt)}}if(r==="tags"){const be=Array.isArray(ne)?ne:[ne];p?.(be?.map(Ce=>({label:Ce,value:Ce})))}else p?.(ce)},ae=b_({options:a,value:e,defaultValue:W?.defaultValue}),Se=g.useMemo(()=>ae.length>0||Ae!=null,[ae,Ae]),Ne=g.useMemo(()=>{if(!r||r!=="multiple"||ae.length===0)return!1;const ne=Array.isArray(Ae)?Ae:[];return ae.map(be=>be.value).every(be=>ne.some(Ce=>typeof Ce=="object"&&Ce!==null&&"value"in Ce?String(Ce.value)===String(be):String(Ce)===String(be)))},[Ae,ae,r]),Ve=()=>{!r||r!=="multiple"||!p||p(Ne?[]:ae)},Ue=g.useCallback(ne=>{if(!ne)return;const ce=new Event("submit",{bubbles:!0,cancelable:!0});ne.dispatchEvent(ce);const be=ne.querySelector('button[type="submit"]');be&&be.click()},[]),Ze=g.useCallback(ne=>{if(ne.key==="Enter"&&!re&&(ne.preventDefault(),ne.stopPropagation(),Ae)){const ce=ne.currentTarget.closest("form");Ue(ce)}},[re,Ae,Ue]),Fe=g.useCallback(ne=>{const{label:ce,value:be,onClose:Ce}=ne,rt=ae.find(ot=>String(ot.value)===String(be))?.color||"blue",nt=ot=>{ot.preventDefault(),ot.stopPropagation()};return A.jsx("div",{className:"cursor-pointer me-1 inline-flex",children:A.jsx(mr,{label:ce,color:rt,size:"sm",onMouseDown:nt,onClick:_?void 0:Ce,isHashColor:!0,removable:!0,onRemove:Ce})})},[ae,_]),le=g.useCallback(ne=>{he(ne),(l||G)?.(ne)},[l,G]);return A.jsxs("div",{ref:X,className:U("flex gap-0.5 w-full relative",Q&&f?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>se(!0),onMouseLeave:()=>se(!1),id:W.id,children:[f&&!Q?A.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,A.jsxs("div",{className:U("w-full flex flex-col gap-1 risk-analysis-select-field",o),onMouseDown:ne=>ne.stopPropagation(),onKeyDownCapture:Ze,role:"group","aria-labelledby":t?"select-field-label":void 0,children:[t?A.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"} ${R||""}`,children:A.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[A.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[A.jsx(Xt,{label:t||"",required:i||!1,isRequiredConditional:F||!1}),B&&A.jsx(ge.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),d&&A.jsx(mn,{}),A.jsx(Xr,{labels:s}),u&&A.jsx(Pe,{placement:"top",title:u,children:A.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onKeyDown:ne=>{(ne.key==="Enter"||ne.key===" ")&&ne.preventDefault()},children:A.jsx(Wr,{})})})]}),f&&Q?A.jsx("button",{id:"btn-select-field-base-add-to-document",className:"cursor-pointer",onClick:ue,type:"button",children:A.jsx(Pe,{placement:"top",title:Y("Add to document"),children:A.jsx(ge.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}):null,A.jsx(qe.Select,{onOpenChange:ie,disabled:_,className:`w-full text-black-900 dark:text-black-200 ${n&&i?"ant-select-status-error":"#e2e8f0"} ${P&&D?.color?"risk-select-field":""}`,classNames:{popup:{root:"!z-[5001]"}},style:{width:"100%","--risk-color":P&&D?.hexBgColor?D?.hexBgColor:"","--risk-border-color":P&&D?.hexBorderColor?D?.hexBorderColor:""},"aria-required":i,mode:r,value:Ae,onChange:ee,filterOption:b?m:(ne,ce)=>(ce?.label||"")?.toLowerCase()?.includes(ne?.toLowerCase()),showSearch:!0,onSearch:le||void 0,onPopupScroll:v,popupClassName:"select-field-dropdown-popup",popupRender:ne=>A.jsx(y_,{showSelectAll:N,mode:r,options:ae,searchValue:me,handleSelectAll:Ve,isAllSelected:Ne,menu:ne,isLoading:S,hasExistingData:Se,t:Y}),options:ae.map(({label:ne,value:ce,color:be,...Ce})=>({label:String(ne),value:String(ce),key:String(ce),id:String(ce),color:be,...Ce})),optionRender:ne=>{const ce=ne?.data?.fullname;if(ce&&M){const[be,Ce]=ce.split(" ");return A.jsxs("div",{className:"flex items-center justify-start gap-1",children:[A.jsx(M,{firstName:be,lastName:Ce,profilePic:ne?.data?.url||"",size:"xs",enablePopper:!0,userId:ne?.data?.value}),A.jsx("span",{className:"ml-2",children:ne.label})]})}return A.jsx("span",{children:ne.label})},autoClearSearchValue:T,onClear:()=>p&&p(r==="tags"||r==="multiple"?[]:null),maxTagCount:r==="tags"&&w?void 0:"responsive",maxTagPlaceholder:ne=>A.jsx(Pe,{placement:"top",title:ne.length>3?ne.slice(0,3).map(({label:ce})=>ce).join(", ")+"...":ne.map(({label:ce})=>ce).join(", "),children:A.jsxs("span",{children:["+",ne.length," more"]})}),tagRender:O||Fe,allowClear:E,...W}),n&&A.jsx($,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:n})]}),Q&&D&&P&&j&&A.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:ne=>ne.stopPropagation(),onMouseDown:ne=>ne.preventDefault(),onKeyDown:ne=>{ne.key==="Escape"&&se(!1)},children:A.jsx(j,{riskDetails:D})})]})});Wo.displayName="SelectField";const y4=g.forwardRef(({id:t,label:e,checked:r,isChecked:n,onChange:a,disabled:i=!1,required:s=!1,message:o,messageType:l="default",wrapperClassName:u,checkboxClassName:c,labelClassName:d,size:f="medium",variant:h="default",labelPosition:p="right",checkboxProps:b},y)=>{const m=r!==void 0?r:n||!1,v=()=>{switch(f){case"small":return"w-3 h-3";case"large":return"w-5 h-5";default:return"w-4 h-4"}},S=()=>{if(l==="error")return"text-red-600 border-red-300 focus:ring-red-500 dark:focus:ring-red-600";if(l==="success")return"text-green-600 border-green-300 focus:ring-green-500 dark:focus:ring-green-600";if(l==="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=()=>l==="error"?"text-red-500 dark:text-red-400":l==="success"?"text-green-500 dark:text-green-400":l==="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"}},k=C=>{a(C.target.checked,C)},w=A.jsx(qe.Checkbox,{...b,ref:y,id:t,checked:m,onChange:k,disabled:i,className:U("rounded focus:ring-2 focus:ring-primary-500 dark:focus:ring-primary-400 focus:ring-offset-gray-800 transition-colors duration-200",v(),S(),i&&"opacity-50 cursor-not-allowed",c),"aria-required":s,"aria-invalid":o&&l==="error"?"true":"false","aria-describedby":o?`${t}-message`:void 0}),O=e?A.jsx("label",{htmlFor:t,className:U("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:A.jsxs($,{variant:"medium",size:T(),appearance:"body",children:[e,s&&A.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})}):null;return A.jsxs("div",{className:U("flex flex-col",u),children:[A.jsx("div",{className:U("flex items-center",p==="left"&&"flex-row-reverse justify-end"),children:p==="left"?A.jsxs(A.Fragment,{children:[w,O]}):A.jsxs(A.Fragment,{children:[w,O]})}),A.jsx(He.AnimatePresence,{children:o&&A.jsx(He.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${t}-message`,role:l==="error"?"alert":void 0,children:A.jsx($,{className:U("mt-1",E()),appearance:"custom",size:"extra-small",variant:"medium",children:o})})})]})});y4.displayName="Checkbox";const v4=({label:t,isChecked:e,onChange:r,id:n,...a})=>A.jsxs("div",{className:"flex items-center",children:[A.jsx(qe.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}),A.jsx("label",{className:"ml-2 text-sm font-medium text-neutral-900 dark:text-neutral-100",children:t})]}),S4=g.forwardRef(({id:t,label:e,value:r,defaultValue:n="#000000",onChange:a,onColorChange:i,disabled:s=!1,required:o=!1,message:l,messageType:u="default",wrapperClassName:c,inputClassName:d,labelClassName:f,size:h="medium",showValue:p=!1,valueFormat:b="hex",inputProps:y,helpText:m},v)=>{const S=g.useRef(null),E=v||S,T=g.useCallback(()=>{requestAnimationFrame(()=>{E.current?.focus()})},[E]),k=g.useCallback(z=>{if(z.key==="Enter"&&!z.shiftKey){z.preventDefault();const L=z.target.closest("form");if(L){const M=L.querySelector('button[type="submit"]');M?M.click():L.requestSubmit()}}y?.onKeyDown?.(z)},[y]),w=r!==void 0?r:n,O=()=>{switch(h){case"small":return"w-8 h-8";case"large":return"w-16 h-16";default:return"w-12 h-12"}},C=()=>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",_=()=>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"}},R=z=>{const L=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(z);if(!L)return z;const M=parseInt(L[1],16),V=parseInt(L[2],16),F=parseInt(L[3],16);return`rgb(${M}, ${V}, ${F})`},D=z=>{const L=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(z);if(!L)return z;const M=parseInt(L[1],16)/255,V=parseInt(L[2],16)/255,F=parseInt(L[3],16)/255,B=Math.max(M,V,F),W=Math.min(M,V,F);let X=0,Y=0;const Q=(B+W)/2;if(B!==W){const se=B-W;switch(Y=Q>.5?se/(2-B-W):se/(B+W),B){case M:X=(V-F)/se+(V<F?6:0);break;case V:X=(F-M)/se+2;break;case F:X=(M-V)/se+4;break}X/=6}return`hsl(${Math.round(X*360)}, ${Math.round(Y*100)}%, ${Math.round(Q*100)}%)`},P=()=>{switch(b){case"rgb":return R(w);case"hsl":return D(w);default:return w.toUpperCase()}},j=z=>{const L=z.target.value;a(L,z),i?.(L)};return A.jsxs("div",{className:U("flex flex-col w-full",c),children:[e&&A.jsx("label",{htmlFor:t,className:U("mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",f),children:A.jsx("div",{className:"flex flex-wrap items-center justify-between w-full",children:A.jsx("div",{className:"inline-flex flex-wrap items-center gap-1",children:A.jsxs($,{variant:"medium",size:N(),appearance:"subtitle",children:[e,o&&A.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})})})}),m&&A.jsx($,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:m}),A.jsxs("div",{className:"flex items-center gap-3",children:[A.jsx("div",{className:"relative",children:A.jsx("input",{...y,ref:E,onBlur:T,onKeyDown:k,type:"color",id:t,value:w,onChange:j,disabled:s,required:o,className:U("border rounded-md cursor-pointer transition-all duration-200","focus:outline-none focus:ring-2",O(),_(),s&&"opacity-50 cursor-not-allowed",d),style:{backgroundColor:w},"aria-required":o,"aria-invalid":l&&u==="error"?"true":"false","aria-describedby":l||m?`${t}-description`:void 0})}),p&&A.jsx("div",{className:"flex-1",children:A.jsx($,{variant:"medium",size:"small",appearance:"body",className:"font-mono text-neutral-700 dark:text-neutral-300",children:P()})})]}),A.jsx(He.AnimatePresence,{children:l&&A.jsx(He.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:A.jsx($,{className:U("mt-1",C()),appearance:"custom",size:"extra-small",variant:"medium",children:l})})}),m&&!l&&A.jsx("div",{id:`${t}-description`,className:"sr-only",children:m})]})});S4.displayName="ColorPicker";const Wg=()=>{const[t,e]=g.useState(!1);return g.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},E4=({id:t,label:e,errorMessage:r,selectOptions:n,loading:a,isClearable:i,multiSelect:s,selectedValues:o,disabled:l,required:u,value:c,className:d,tooltip:f,tags:h,originalCase:p=!1,onChange:b,filterOption:y,placeholder:m,...v})=>{const S=Wg(),[E,T]=g.useState(!1),k=(P,j)=>{b&&b(P);const z=document.getElementById(t);if(z){const L=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${t}`,value:P,type:"change"}});z.dispatchEvent(L)}},w={control:(P,j)=>({...P,borderColor:r&&u?S?"#F04438":"#fda49b":j.isFocused?"var(--color-primary-600)":S?"#434343":"#d9d9d9",backgroundColor:S?"#141414":j.isDisabled?"#f5f5f5":"#fff",borderRadius:"6px",minHeight:"32px",fontSize:"14px",padding:"0 4px 0 12px",opacity:j.isDisabled?.6:1,cursor:j.isDisabled?"not-allowed":"pointer",boxShadow:j.isFocused?S?"0 0 0 1.5px var(--color-primary-950)":"0 0 0 1.5px var(--color-primary-100)":"none","&:hover":{borderColor:r&&u?S?"#F04438":"#fda49b":"var(--color-primary-600)"}}),valueContainer:P=>({...P,fontSize:"14px",padding:0}),input:P=>({...P,margin:"0",padding:"0",color:S?"rgba(255,255,255,0.85)":"inherit"}),indicatorsContainer:P=>({...P,padding:0}),option:(P,j)=>({...P,fontSize:"14px",lineHeight:"22px",padding:"5px 12px",margin:0,backgroundColor:j.isSelected?S?"var(--color-primary-975)":"var(--color-primary-50)":j.isFocused?S?"var(--color-primary-950)":"var(--color-primary-100)":S?"#141414":"#fff",color:j.isDisabled?S?"rgba(255,255,255,0.25)":"#a3a3a3":S?j.isSelected?"var(--color-primary-600)":"rgba(255,255,255,0.85)":"rgba(0,0,0,0.88)",cursor:j.isDisabled?"not-allowed":"pointer",opacity:j.isDisabled?.6:1,"&:hover":{backgroundColor:j.isDisabled?S?"#141414":"#fff":S?"var(--color-primary-950)":"var(--color-primary-100)"},"&:active":{backgroundColor:S?"var(--color-primary-950)":"var(--color-primary-50)"}}),singleValue:(P,j)=>({...P,fontSize:"14px",lineHeight:"20px",color:j.isDisabled?S?"rgba(255,255,255,0.25)":"#a3a3a3":S?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.88)"}),placeholder:P=>({...P,fontSize:"14px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:S?"rgba(255,255,255,0.25)":"#bfbfbf"}),multiValue:P=>({...P,backgroundColor:S?"rgba(255,255,255,0.08)":"#f0f5ff",border:S?"1px solid transparent":"1px solid #adc6ff",borderRadius:"4px"}),multiValueLabel:P=>({...P,color:S?"rgba(255,255,255,0.85)":"var(--color-primary-600)",fontSize:"12px"}),multiValueRemove:P=>({...P,color:S?"rgba(255,255,255,0.85)":"var(--color-primary-600)","&:hover":{backgroundColor:S?"rgba(255,255,255,0.16)":"#e6f4ff",color:S?"#fff":"var(--color-primary-600)"}}),menu:P=>({...P,zIndex:5001,borderRadius:"8px",boxShadow:S?"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:S?"#141414":"#fff",border:S?"1px solid #303030":"none",overflow:"hidden"}),menuList:P=>({...P,padding:"0",maxHeight:"256px"})},O=!!o?.length,N=E&&!l&&(i?O||!!c:!1),R=P=>{P.stopPropagation(),P.preventDefault(),k(s?[]:null)},D=()=>A.jsx("div",{className:"flex items-center",children:N?A.jsx(ge.CancelRounded,{onClick:R,sx:{fontSize:"16px",cursor:"pointer",color:S?"rgba(255,255,255,0.45)":"rgba(0,0,0,0.25)","&:hover":{color:S?"rgba(255,255,255,0.65)":"rgba(0,0,0,0.45)"}}}):A.jsx(ge.ChevronLeftRounded,{className:"-rotate-90",sx:{fontSize:"18px",color:S?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.25)"}})});return A.jsxs("div",{id:t,className:U("w-full flex flex-col gap-1",d),onMouseDown:P=>P.stopPropagation(),role:"group","aria-labelledby":e?t+"Label":void 0,children:[e&&A.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:[A.jsx(Xt,{label:e||"",required:u||!1}),A.jsx(Xr,{labels:h}),f&&A.jsx(qe.Tooltip,{placement:"top",title:f,children:A.jsx("div",{className:"cursor-pointer",children:A.jsx(Wr,{})})})]}),A.jsx("div",{onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),children:A.jsx(LN,{...v,id:"cm"+e,classNamePrefix:"lax-select",required:u,options:n,isClearable:!1,isLoading:a,isDisabled:l,styles:w,isMulti:s,value:s?o:c,onChange:k,filterOption:y,placeholder:m,classNames:{menuList:()=>"nowheel"},components:{DropdownIndicator:D,IndicatorSeparator:()=>null}})}),r&&A.jsx($,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:r})]})};E4.displayName="CreatableSelectField";const Xg=({ref:t,handler:e,enabled:r=!0})=>{g.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])},v_={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"},T4=({id:t,label:e,options:r,placeholder:n,onChange:a,isLoading:i=!1,hideLabel:s=!1,errorMessage:o,required:l=!1,optionConfig:u,menuConfig:c,value:d,isMulti:f=!1,isClearable:h=!0,disabled:p=!1,className:b,isDark:y=!1,primaryColorShades:m=v_})=>{const v=g.useRef(null),[S,E]=g.useState(null),[T,k]=g.useState("");Xg({ref:v,handler:()=>{E(null)}});const w={control:(D,P)=>({...D,borderColor:o&&l?"#F04438":P.isFocused?y?m[400]:m[600]:y?"#1e1e1e":"#e2e8f0",backgroundColor:P.isDisabled?y?"#1a1a1a":"#f5f5f5":y?"#262626":"#FFFFFF",color:P.isDisabled?y?"#666666":"#a0a0a0":y?"#d4d4d4":"#0F172A",borderRadius:"6px",minHeight:"32px",fontSize:"14px",padding:"0px 10px",cursor:P.isDisabled?"not-allowed":"default",opacity:(P.isDisabled,1),boxShadow:P.isFocused?y?`0 0 0 3px ${m[950]}`:`0 0 0 3px ${m[100]}`:"none"}),valueContainer:D=>({...D,fontSize:"14px",maxHeight:"60px",overflowY:"auto",padding:"0px",margin:"0px",color:y?"#d4d4d4":"inherit","::-webkit-scrollbar":{display:"none"}}),input:D=>({...D,margin:"0"}),indicatorSeparator:()=>({display:"none"}),option:D=>({...D,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":m[50]},".icon":{height:"14px",width:"14px"}}),singleValue:(D,P)=>({...D,fontWeight:500,fontSize:"14px",lineHeight:"1.25rem",color:(P.isDisabled,y?"#d4d4d4":"#0F172A"),display:"flex",alignItems:"center",".icon":{height:"14px",width:"14px"}}),placeholder:(D,P)=>({...D,fontSize:"14px",fontWeight:500,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:(P.isDisabled,y?"#595959":"#9CA3AF")}),multiValue:D=>({...D,backgroundColor:y?"#000000":m[50],borderRadius:"6px",fontFamily:"Inter",fontSize:"12px",height:"20px",alignItems:"center"}),indicatorsContainer:D=>({...D,padding:"0",height:"30px"}),multiValueLabel:D=>({...D,color:y?"#d4d4d4":m[600],fontSize:"12px"}),multiValueRemove:D=>({...D,color:y?"#d4d4d4":m[600],height:"12px",fontSize:"8px",":hover":{backgroundColor:y?"#171717":m[50]},svg:{height:"12px",width:"12px"}})},O=D=>{const P=r.filter(j=>j?.label?.toLowerCase()?.includes(T?.toLowerCase()));return A.jsx(EA.components.MenuList,{...D,className:U("!z-50 rounded !visible overflow-x-scroll",y?"bg-black-800":"bg-white",y?"text-neutral-300":"text-navy-900",c?.className),ref:v,children:P?.length?P.map((j,z)=>A.jsxs("div",{className:U("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-navy-900",!p&&C(j)?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:L=>{p||(L.stopPropagation(),D.selectOption(j))},children:[u?.component?A.jsx(u.component,{...u.componentProps,...j}):A.jsx("div",{children:j.label}),A.jsx("div",{className:"flex items-center gap-1",children:C(j)&&u?.selectIndecator?u?.selectIndecator:null})]},z)):A.jsx("div",{className:U("opacity-50 flex justify-center items-center p-1 font-medium",y?"text-neutral-400":"text-gray-700"),children:"No options"})})},C=D=>f?S?.some(P=>P.value===D.value):D.value===S?.value,_=D=>{const{children:P,innerProps:j,isDisabled:z,getValue:L}=D,M=L();return A.jsx(EA.components.SingleValue,{...D,innerProps:j,isDisabled:z,children:M.length>0?M.map((V,F)=>A.jsx("span",{children:u?.component?A.jsx(u.component,{...u.componentProps,...V}):A.jsx("div",{children:V.label})},F)):A.jsx(A.Fragment,{children:P})})},N=D=>{const{innerProps:P,isDisabled:j,data:z}=D;return A.jsx(EA.components.MultiValue,{...D,innerProps:P,isDisabled:j,children:u?.component?A.jsx(u.component,{...u.componentProps,...z}):A.jsx("div",{children:z.label})})},R=(D,P)=>(k(P),!0);return A.jsxs("div",{className:U("flex flex-col",y?"text-black-300":"text-navy-900",i?"opacity-50":"opacity-100",p?"cursor-not-allowed":""),id:t,children:[s||!e?null:A.jsx(Xt,{label:e||"",required:l||!1}),A.jsx(EA,{required:!0,classNamePrefix:"lax-select",options:r,placeholder:n,value:d,onChange:D=>{E(D),a(D)},styles:w,isMulti:f,className:U(y&&"bg-black-800 border-black-700",b),components:{MenuList:O,SingleValue:_,MultiValue:N},filterOption:R,closeMenuOnSelect:!0,isClearable:h,isDisabled:p}),o&&A.jsx($,{className:U("mt-1",y?"text-red-400":"text-red-500"),appearance:"custom",size:"extra-small",variant:"medium",children:o})]})};T4.displayName="CustomizableSelectField";const k4=[{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"}],ku={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:"$"},_l=({classValue:t,size:e=24,fill:r="currentColor",...n})=>A.jsxs("svg",{className:U(t),width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[A.jsx("rect",{width:"12",height:"12",rx:"6",fill:r}),A.jsx("g",{clipPath:"url(#clip0_8212_362816)",children:A.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"})}),A.jsx("defs",{children:A.jsx("clipPath",{id:"clip0_8212_362816",children:A.jsx("rect",{width:"8",height:"8",fill:"white",transform:"translate(2 2)"})})})]});_l.displayName="CloseRounded";const w4=({width:t=15,height:e=15,fill:r="#98A2B3",className:n})=>A.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:A.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"})}),Qg=t=>{const{value:e,placeholder:r,onChange:n,id:a,debounceTimeout:i=0,classValues:s,handleKeyDown:o,isClearable:l,onFocusText:u,autoComplete:c="false",searchRef:d,hasNavigation:f=!1,autoFocus:h=!1,searchConfig:p,hideSearchIcon:b,allowAStarSearch:y=!1,...m}=t,{t:v}=Wt.useTranslation(),[S,E]=g.useState(!1),[T,k]=g.useState("search"),w=g.useRef(null),{searchCount:O,searchPointer:C,setSearchPointer:_}=p||{},N=()=>{E(!0),k(u||r||v("Search"));const D=d||w;D.current&&D.current.focus()},R=()=>{E(!1),k("")};return A.jsxs("label",{className:U("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:[!b&&A.jsx("div",{className:"flex items-center h-6 w-6 pointer-events-none",children:A.jsx(w4,{width:"16",height:"16"})}),A.jsx(jg.DebounceInput,{...m,spellCheck:"false",debounceTimeout:i,id:a,inputRef:d||w,type:"text",className:U(`absolute inset-0 dark:text-[#98A2B3] text-neutral-900 ${b?"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:D=>{D.key==="Enter"&&D.preventDefault(),o&&o(D)},value:e||"",placeholder:S?T:y?"":`${v("Search")}`,onChange:D=>n?.(D.target.value),autoComplete:c,onFocus:D=>{E(!0),N(),t.onFocus&&t.onFocus(D)},onBlur:D=>{E(!1),R(),t.onBlur&&t.onBlur(D)},autoFocus:h}),f&&e&&A.jsxs("div",{className:U("absolute mr-2 focus:outline-none flex gap-1",l?"right-6":"right-0"),children:[!!O&&(O||0)>0&&A.jsxs("span",{className:"text-xs border-r pr-2 border-gray-200",children:[(C||0)+1,"/",O]}),A.jsxs("div",{className:"flex gap-1 items-center",children:[A.jsx("button",{id:"btn-search-bar-set-search-pointer-forward",onClick:()=>{_&&_(D=>(D||0)-1)},disabled:C===0,children:A.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:A.jsx("path",{d:"M15 18l-6-6 6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),A.jsx("button",{id:"btn-search-bar-set-search-pointer-backward",onClick:()=>{_&&_(D=>(D||0)+1)},disabled:C===(O||0)-1,children:A.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:A.jsx("path",{d:"M9 18l6-6-6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),y&&!(l&&e)&&!S&&!e?A.jsxs("div",{className:"absolute flex ml-6 items-center justify-center focus:outline-none gap-1 flex-wrap-none",children:[A.jsxs($,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:[v("Search")," (use"]}),A.jsx("button",{className:" bg-[#EAECF0] dark:bg-black-800 rounded-sm text-sm w-3 h-5",children:A.jsx(qe.Tooltip,{placement:"bottomRight",color:"#141414",classNames:{root:"custom-tooltip dark:!bg-black-800"},title:A.jsxs("div",{className:"flex flex-col items-start justify-center p-2 w-full h-full gap-2 dark:bg-black-800",children:[A.jsx($,{variant:"semibold",size:"extra-small",className:"text-white",children:v("Normal Search")}),A.jsx($,{variant:"medium",size:"extra-small",className:"text-primary-400 dark:text-primary-400",appearance:"custom",children:v("Examples")}),A.jsxs("div",{className:"flex flex-col items-start justify-center ",children:[A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx($,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:A.jsx($,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:"data"})}),A.jsx($,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "data", "Data".'})]}),A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx($,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:A.jsx($,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:"text"})}),A.jsx($,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "text", "context", "plaintext".'})]}),A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx($,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:A.jsx($,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:"base"})}),A.jsx($,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "database", "baseball", "basename".'})]})]}),A.jsx("div",{className:"h-[1px] w-full bg-neutral-800 dark:bg-black-200 my-2"}),A.jsx($,{variant:"semibold",size:"extra-small",className:"text-white",children:"Wildcard Search"}),A.jsx($,{variant:"medium",size:"extra-small",className:"text-white dark:text-black-200",appearance:"custom",children:"Use * as a wildcard to refine your search."}),A.jsx($,{variant:"medium",size:"extra-small",className:"text-primary-400 dark:text-primary-400",appearance:"custom",children:"Examples:"}),A.jsxs("div",{className:"flex flex-col items-start justify-center ",children:[A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx($,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:A.jsx($,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ",appearance:"custom",children:"contract*"})}),A.jsx($,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ "contracts", "contractor", "CONTRACTOR".'})]}),A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx($,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:A.jsx($,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ",appearance:"custom",children:"*agreement"})}),A.jsx($,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "service agreement", "legal agreement".'})]}),A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx($,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:A.jsx($,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:"*clause*"})}),A.jsx($,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "clause", "subclause", "clauses".'})]}),A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx($,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:A.jsx($,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:"*l*s*"})}),A.jsx($,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "clause", "clauses".'})]})]})]}),children:A.jsx("div",{className:"text-[#475467] dark:text-black-300 dark:bg-black-600",children:"*"})})}),A.jsx($,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:"as a wildcard)"})]}):l&&e&&A.jsx("button",{id:"btn-search-bar-close",className:"absolute right-0 mr-2 focus:outline-none",onClick:()=>n?.(""),children:A.jsx(_l,{classValue:"text-neutral-200 dark:text-black-500",size:16})})]})};var Pi=(t=>(t.LEFT="left",t.RIGHT="right",t.TOP="top",t))(Pi||{});const S_=(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 U("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})},E_=({size:t=18,fill:e="#016DCF"})=>A.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:A.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:e})}),T_=({size:t=18,fill:e="#101828"})=>A.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:A.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})}),Bn=g.forwardRef(({isGTN:t=!1,isChecked:e,id:r,onChange:n,label:a,required:i,isRequiredConditional:s=!1,hideStatus:o=!1,labelDirection:l=Pi.TOP,statusText:u,withIcon:c=!1,tags:d,isAiExtracted:f=!1,tooltip:h="",className:p="",isDisabled:b=!1,icon:y,stopClickPropagation:m=!0,gtnName:v,variant:S="primary",labelClassName:E,isLiveField:T=!1,message:k,messageType:w="default",wrapperClassName:O,helpText:C,size:_="medium",renderGTNAddButton:N,onAddGTNToDocument:R},D)=>{const{t:P}=Wt.useTranslation(),j=l===Pi.TOP,z=l===Pi.LEFT,L=l===Pi.RIGHT,[M,V]=g.useState(!1),F=()=>{R&&R({key:v,value:e?"Yes":"No"})},B=()=>w==="error"?"text-red-500 dark:text-red-400":w==="success"?"text-green-500 dark:text-green-400":w==="info"?"text-primary-500 dark:text-primary-400":"text-neutral-500 dark:text-neutral-400";return A.jsxs("div",{className:U("flex gap-0.5",M&&t?"border rounded-lg border-primary-100 bg-primary-50 p-1":"",O),onMouseEnter:()=>V(!0),onMouseLeave:()=>V(!1),onClick:W=>{m&&W.stopPropagation()},children:[t&&!M?A.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-pulse mt-1.5"}):null,A.jsxs("div",{className:"w-full flex flex-col",children:[j&&a&&A.jsxs("div",{className:"w-full flex justify-between flex-wrap",children:[A.jsxs("h1",{className:U("mb-1 font-inter text-neutral-600 font-medium text-xs flex items-center gap-0.5 flex-wrap",E),children:[A.jsx(Xt,{label:a||"",required:i||!1,isRequiredConditional:s||!1}),T&&A.jsx(ge.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),f&&A.jsx(mn,{}),A.jsx(Xr,{labels:d||[]}),h&&A.jsx(Pe,{placement:"top",title:h,children:A.jsx("div",{className:"cursor-pointer",children:A.jsx(Wr,{})})})]}),t&&M?N?N(F):A.jsx("button",{id:"btn-toggle-add-to-document",className:"cursor-pointer",onClick:F,type:"button",children:A.jsx(qe.Tooltip,{placement:"top",title:P("Add to document"),children:A.jsx(ge.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]}),C&&A.jsx($,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:C}),A.jsxs("div",{className:"flex",children:[z&&A.jsx($,{size:"small",variant:"medium",className:U("mr-2 text-neutral-700 dark:text-black-200",E),appearance:"custom",children:a}),A.jsxs("label",{className:U("relative inline-flex items-center",L||u?"":"w-min",b?"cursor-not-allowed opacity-50":"cursor-pointer"),onClick:W=>W.stopPropagation(),children:[A.jsx("input",{ref:D,type:"checkbox",id:r,onChange:W=>!b&&n(W.target.checked),value:"",disabled:b,checked:e,className:U("sr-only peer w-full",p),"aria-required":i,"aria-invalid":k&&w==="error"?"true":"false","aria-describedby":k||C?`${r}-description`:void 0}),A.jsx("div",{className:S_(e,c,b,_),children:c?A.jsx("div",{className:"flex items-center justify-center h-full w-full",children:A.jsx("div",{className:U("z-10 transition-all transform",_==="small"&&(e?"translate-x-2":"translate-x-[-6px]"),_==="medium"&&(e?"translate-x-[8.5px]":"translate-x-[-8px]"),_==="large"&&(e?"translate-x-2.5":"translate-x-[-10px]")),children:e?y?.checkedIcon?y.checkedIcon:A.jsx(E_,{size:18,fill:"#016DCF"}):y?.uncheckedIcon?y.uncheckedIcon:A.jsx(T_,{size:18,fill:"#101828"})})}):null}),L&&A.jsx($,{size:"small",variant:"medium",className:U("ml-2 text-neutral-700 dark:text-black-300",E),appearance:"custom",children:a}),o?null:A.jsx($,{size:"small",variant:"medium",className:"ml-2 text-neutral-900 dark:text-black-100",appearance:"custom",children:u||(e?"Yes":"No")})]})]}),A.jsx(He.AnimatePresence,{children:k&&A.jsx(He.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${r}-description`,role:w==="error"?"alert":void 0,children:A.jsx($,{className:U("mt-1",B()),appearance:"custom",size:"extra-small",variant:"medium",children:k})})}),C&&!k&&A.jsx("div",{id:`${r}-description`,className:"sr-only",children:C})]})]})});Bn.displayName="Toggle";const k_=t=>{try{return JSON.parse(t)}catch{return null}},w_=t=>{let e="";const r="0123456789abcdef";for(let n=0;n<t;n++)e+=r.charAt(Math.floor(Math.random()*r.length));return e},O_=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),C_=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},Li=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},O4=({shortcuts:t,variant:e="dark",className:r})=>{const a=Vo()==="macos",i=g.useMemo(()=>t.map(s=>{const o=Tu[s];return o?a?o.macos:o.other:s}),[t,a]);return A.jsx("div",{className:U("flex flex-1 gap-1",r),children:i.map((s,o)=>A.jsx("kbd",{className:U("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))})},N_=({className:t="",fill:e="var(--color-primary-600)",size:r=24})=>A.jsx("svg",{className:t,width:r,height:r,viewBox:"0 0 20 20",fill:e,xmlns:"http://www.w3.org/2000/svg",children:A.jsx("g",{mask:"url(#mask0_6752_28309)",children:A.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:l,leadingIcon:u,suffixRecord:c,stopPropagation:d,onToggle:f,isChecked:h=!1,highlight:p,truncateText:b=!1,showTick:y=!1,width:m="100%",tooltip:v,isFlowAvailable:S=!0,shortcuts:E,textClassName:T})=>{const k=g.useCallback(D=>{s&&s(),D.preventDefault(),e?.(D),d&&D.stopPropagation()},[s,e,d]),w=(D,P)=>{if(!P||!D||typeof D!="string"&&typeof D!="number")return D;const j=O_(P),z=new RegExp(`(${j?.trim()})`,"gi"),L=D?.toString()?.split(z);return A.jsxs("span",{className:"overflow-clip text-ellipsis",children:[L[0],A.jsx("span",{className:"bg-yellow-300 dark:bg-primary-100 dark:text-black-900 rounded-sm",children:L[1]}),L?.slice(2)?.join("")]})},O=g.useCallback(D=>{f?.(),D.stopPropagation()},[f]),C=["delete","remove","clear","terminate session","terminate sessions","terminate all sessions","trash"].some(P=>n?.toLowerCase().includes(P)),_=i||!S;if(o)return null;const N=!!(e||f),R=N?"button":"div";return A.jsx(R,{id:t,className:U("w-full p-1 bg-white dark:bg-black-800 group",a,_&&"opacity-60"),...N?{onClick:f?()=>null:k,disabled:_}:{},onMouseMove:D=>D.stopPropagation(),children:A.jsxs("div",{className:U("option-button-inner flex w-full justify-start items-center gap-2 px-2 py-1 rounded-lg transition-all duration-300 ease-in-out",!l&&"hover:bg-gray-50 dark:hover:bg-black-600 hover:shadow-md dark:hover:shadow-lg dark:hover:shadow-primary-500/20"),children:[r?A.jsx("div",{className:U("h-5 w-5 flex-shrink-0 flex items-center text-neutral-900 dark:text-white transition-colors duration-300 ease-in-out",C?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:A.jsx(Pe,{placement:"top",title:v,children:r})}):null,A.jsxs("div",{className:"flex gap-2 flex-1 min-w-0 text-left justify-between items-center",children:[A.jsx("div",{className:U("flex-1 min-w-0",b&&"max-w-[150px]"),style:{width:m},children:A.jsx($,{className:U("font-medium text-sm truncate transition-colors duration-300 ease-in-out",C?"group-hover:!text-red-600":"group-hover:!text-primary-600 dark:group-hover:!text-primary-400",T),appearance:"custom",children:p?w(n,p):n})}),c?.[n]?A.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?A.jsx("div",{className:"flex-shrink-0",children:A.jsx(N_,{fill:"var(--color-primary-600)"})}):null]}),u?A.jsx(A.Fragment,{children:v?A.jsx(Pe,{placement:"top",title:v,children:A.jsx("div",{className:U("flex-shrink-0 transition-colors duration-300 ease-in-out",C?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:u})}):A.jsx("div",{className:U("flex-shrink-0 transition-colors duration-300 ease-in-out",C?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:u})}):null,E?A.jsx("div",{className:"flex items-center justify-end",children:A.jsx(O4,{variant:"light",shortcuts:E})}):null,f?A.jsx("div",{className:"flex-shrink-0",children:A.jsx(Bn,{onChange:O,isChecked:h,isDisabled:i,hideStatus:!0})}):null]})})};Or.displayName="OptionButton";const co=(t,e)=>{const r=t.slice(0,2),n=Bo[r];return n?A.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
- `,children:A.jsx(n,{style:{width:"110%",height:"110%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},__=t=>{const e=t.slice(0,2),r=Bo[e];return r?A.jsx("div",{className:"w-4 h-4 rounded-full overflow-hidden flex items-center justify-center relative",children:A.jsx(r,{style:{width:"120%",height:"120%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},D_=t=>{const e=t.slice(0,2),r=Bo[e];return r?A.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:A.jsx(r,{style:{width:"110%",height:"110%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},R_=t=>{const e=t.slice(0,2),r=Bo[e];return r?A.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:A.jsx(r,{style:{width:"120%",height:"120%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},C4=t=>{const e=t.slice(0,2),r=Bo[e];return r?A.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:A.jsx(r,{style:{width:"115%",height:"115%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},h1=t=>t===1||t==="1"||typeof t=="string"&&t.toLowerCase()==="yes"||typeof t=="string"&&t.toLowerCase()==="true"?"Yes":t===0||t==="0"||typeof t=="string"&&t.toLowerCase()==="no"||typeof t=="string"&&t.toLowerCase()==="false"?"No":t?.toString()||"-",ni=(t,e="USD")=>{try{if(t==null)return"";const r=Number(t);if(Number.isNaN(r))return t?.toString()||"";const n=r.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2});return`${ku[e]||"$"}${n}`}catch{return"-"}},P_=t=>{const e=new Date(t.replaceAll("-","/"));return e instanceof Date&&e.getHours()===0&&e.getMinutes()===0&&e.getSeconds()===0&&e.getMilliseconds()===0},L_=(t,e)=>{if(e){const n=t.replace(/Z$|[+-]\d{2}:?\d{2}$/,"");return new Date(n)}let r=t;return r.includes("+")&&(r=r.split("+")[0]),!r.includes("Z")&&!r.includes("GMT")&&!r.includes("+")&&(r+="Z"),new Date(r)},oa=(t,e={})=>{const{format:r,timezone:n,relative:a=!1,withTime:i=!0,fallback:s="-",skipTimezone:o=!1,onlyTime:l=!1}=e||{};if(!t)return s;try{if(!Pt(t).isValid())return s;const u=L_(t.toString(),o);if(Number.isNaN(u.getTime()))return s;const c=P_(t);let d;if(o)d=u;else{const h=Intl.DateTimeFormat().resolvedOptions().timeZone,p=n||h;d=MN.utcToZonedTime(u,p)}if(a)return Z2.formatDistanceToNow(new Date(d),{addSuffix:!0}).replace(/^about /,"");let f;if(r)f=r;else{const h="MM/dd/yyyy";f=i&&!c?`${h} hh:mm a`:h}return l&&(f="hh:mm a"),Z2.format(d,f)}catch{return s}},N4=t=>typeof t=="string"&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(t),_4=g.forwardRef(({id:t,label:e,value:r,onChange:n,errorMessage:a,defaultValue:i,required:s=!1,isRequiredConditional:o=!1,tags:l,className:u,originalCase:c=!1,tooltip:d,simpleMode:f=!1,inputFieldClassName:h="",isAiExtracted:p=!1,isGTN:b=!1,gtnName:y=null,allowMultiCurrency:m=!1,placeholder:v,disabled:S=!1,currencyCode:E="USD",inputStyle:T,labelClassName:k,isLiveField:w=!1,onBlur:O,autoFocus:C=!1,isRecording:_=!1,isPlaying:N=!1,onAddGTNToDocument:R,riskDetails:D,isRiskAnalysisOpen:P=!1,RiskDetailsCard:j,...z},L)=>{const{t:M}=Wt.useTranslation(),[V,F]=g.useState(!1),[B,W]=g.useState([]),[X,Y]=g.useState(""),[Q,se]=g.useState(E||"USD"),[fe,re]=g.useState(!1),ie=ee=>{if(R){const ae={key:y,value:ni(ee)};R(ae)}},me=ee=>{if(ee==null)return"";const ae=Number(ee);return isNaN(ae)?ee:ae?.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},he=ee=>{const ae=ee.target.value,Se=ae===""||ae===null||ae===void 0?0:Number(ae);n(Se,Q);const Ne=document.getElementById(t);if(Ne&&Ne.setAttribute("data-selected-value",JSON.stringify({value:Se,currency_code:Q})),Ne&&(_||N)){const Ve=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${t}`,value:{value:Se,currency_code:Q},type:"change"}});Ne.dispatchEvent(Ve)}},ue=()=>{F(!0)},Ae=()=>{F(!1),(r==null||r==="")&&he({target:{value:"0.00"}}),O?.()},G=()=>{const ee="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)]",ae=a?"border-red-300":P&&D?.color?`border-${D.color}-300`:"border-gray-300 dark:border-black-600",Se=`${P&&D?.color?`bg-${D.color}-50`:"bg-white dark:bg-black-600"}`;return`${ee} ${ae} ${Se} ${h}`};return g.useEffect(()=>{E&&se(E)},[E]),g.useEffect(()=>{if(Q){const ee=r===""||r===null||r===void 0?0:Number(r);E!==Q&&n(ee,Q);const ae=document.getElementById(t);if(ae&&(ae.setAttribute("data-selected-value",JSON.stringify({value:ee,currency_code:Q})),_||N)){const Se=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${t}`,value:{value:ee,currency_code:Q},type:"change"}});ae.dispatchEvent(Se)}}},[Q]),g.useEffect(()=>{const ee=k4.filter(ae=>(ae.value+" - "+ae.label).toLowerCase().includes(X.toLowerCase())).map(ae=>({label:A.jsx(Or,{text:`${ae.value} - ${ae.label}`,icon:co(ae.value),showTick:Q===ae.value,onClick:()=>se(ae.value),className:"text-black-900 dark:text-white"}),key:ae.value}));W(ee)},[X,Q]),g.useEffect(()=>{Y("")},[Q]),f?A.jsxs("label",{id:t,className:`mb-1 text-xs font-medium text-gray-600 h-full inline-flex items-center gap-1 ${c?"":"capitalize"} ${k||""}`,children:[A.jsx("span",{className:"absolute inset-y-0 left-1 top-0.5 flex items-center pl-3",children:"$"}),A.jsx("input",{...z,ref:L,type:V?"number":"text",required:s,className:U(h,"pl-8 h-[32px]"),onChange:he,min:0,onFocus:ue,onBlur:Ae,value:V?r:me(r),...i&&!r?{defaultValue:V?i:me(i)}:{},id:t||e,autoFocus:C})]}):A.jsxs("div",{className:U("flex gap-0.5 relative",fe&&b?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>re(!0),onMouseLeave:()=>re(!1),children:[b&&!fe?A.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,A.jsxs("div",{className:U("w-full flex flex-col",u),children:[A.jsx("label",{htmlFor:"text",className:`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${c?"":"uppercase"} ${k||""}`,children:A.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[A.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[A.jsx(Xt,{label:e||"",required:s||!1,isRequiredConditional:o||!1}),w&&A.jsx(ge.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),p&&A.jsx(mn,{}),A.jsx(Xr,{labels:l}),d&&A.jsx(Pe,{placement:"top",title:d,children:A.jsx("div",{className:"cursor-pointer",children:A.jsx(Wr,{})})})]}),b&&fe&&R?A.jsx("button",{id:"btn-currency-input-add-to-document",className:"cursor-pointer",onClick:()=>ie(me(r)),type:"button",children:A.jsx(qe.Tooltip,{placement:"top",title:M("Add to document"),children:A.jsx(ge.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}),A.jsxs("label",{className:"relative block",children:[A.jsx("span",{className:"absolute inset-y-0 left-1 flex items-center pl-3 text-neutral-900 dark:text-white",children:ku[Q]}),A.jsx("input",{...z,ref:L,placeholder:v,type:V?"number":"text",required:s,disabled:S,className:G(),onChange:he,min:0,onFocus:ue,onBlur:Ae,value:V?r:me(r),defaultValue:V?i:me(i),id:t||e,style:T,autoComplete:"off",autoFocus:C}),A.jsx("span",{className:`absolute inset-y-0 right-2 flex items-center z-[1000px] h-full cursor-pointer dark:text-black-200 ${m?"cursor-pointer":""}`,children:m?A.jsx(qe.Dropdown,{menu:{items:[...B]},trigger:["click"],overlayClassName:"row-option-cell",placement:"bottomRight",overlayStyle:{zIndex:999},getPopupContainer:ee=>ee.parentElement,popupRender:ee=>A.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:[A.jsx(Qg,{id:"search-bar-currency-input",value:X,onChange:ae=>Y(ae),className:"mb-2"}),ee]}),children:A.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:[co(Q)," ",Q]})}):Q})]}),a&&A.jsx($,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:a})]}),fe&&D&&P&&j&&A.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:ee=>ee.stopPropagation(),onMouseDown:ee=>ee.preventDefault(),onKeyDown:ee=>{ee.key==="Escape"&&re(!1)},children:A.jsx(j,{riskDetails:D})})]})});_4.displayName="CurrencyInputField";const D4=g.forwardRef(({id:t,label:e,value:r,defaultValue:n,onChange:a,disabled:i=!1,required:s=!1,message:o,messageType:l="default",wrapperClassName:u,inputClassName:c,labelClassName:d,helpText:f,size:h="medium",minDate:p,maxDate:b,startPlaceholder:y="Start date",endPlaceholder:m="End date",allowClear:v=!0,inputProps:S},E)=>{const T=r!==void 0?r:n||{startDate:null,endDate:null},k=()=>{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"}}},w=()=>l==="error"?"border-red-300 focus:border-red-500 focus:ring-red-200 dark:focus:ring-red-400/20":l==="success"?"border-green-300 focus:border-green-500 focus:ring-green-200 dark:focus:ring-green-400/20":l==="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",O=()=>l==="error"?"text-red-500 dark:text-red-400":l==="success"?"text-green-500 dark:text-green-400":l==="info"?"text-blue-500 dark:text-blue-400":"text-neutral-500 dark:text-neutral-400",C=()=>{switch(h){case"small":return"extra-small";case"large":return"medium";default:return"small"}},_=L=>{if(!L)return"";const M=L.getFullYear(),V=String(L.getMonth()+1).padStart(2,"0"),F=String(L.getDate()).padStart(2,"0");return`${M}-${V}-${F}`},N=L=>{if(!L)return null;const M=new Date(L);return isNaN(M.getTime())?null:M},R=L=>{const M=N(L.target.value);a({startDate:M,endDate:T.endDate})},D=L=>{const M=N(L.target.value);a({startDate:T.startDate,endDate:M})},P=()=>{a({startDate:null,endDate:null})},j=L=>L?_(L):void 0,z=k();return A.jsxs("div",{className:U("flex flex-col w-full",u),ref:E,children:[e&&A.jsx("label",{htmlFor:`${t}-start`,className:U("mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",d),children:A.jsx("div",{className:"flex flex-wrap items-center justify-between w-full",children:A.jsx("div",{className:"inline-flex flex-wrap items-center gap-1",children:A.jsxs($,{variant:"medium",size:C(),appearance:"subtitle",children:[e,s&&A.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})})})}),f&&A.jsx($,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:f}),A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx("div",{className:"flex-1",children:A.jsx("input",{...S,id:`${t}-start`,type:"date",value:_(T.startDate),onChange:R,disabled:i,required:s,min:j(p),max:j(b),placeholder:y,className:U("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",z.height,z.padding,z.fontSize,w(),i&&"opacity-50 cursor-not-allowed bg-neutral-50 dark:bg-neutral-700",c),"aria-required":s,"aria-invalid":o&&l==="error"?"true":"false","aria-describedby":o||f?`${t}-description`:void 0})}),A.jsx("div",{className:"flex-shrink-0 text-neutral-500 dark:text-neutral-400",children:A.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:A.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M18 12H6"})})}),A.jsx("div",{className:"flex-1",children:A.jsx("input",{...S,id:`${t}-end`,type:"date",value:_(T.endDate),onChange:D,disabled:i,required:s,min:j(T.startDate||p),max:j(b),placeholder:m,className:U("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",z.height,z.padding,z.fontSize,w(),i&&"opacity-50 cursor-not-allowed bg-neutral-50 dark:bg-neutral-700",c),"aria-required":s,"aria-invalid":o&&l==="error"?"true":"false","aria-describedby":o||f?`${t}-description`:void 0})}),v&&(T.startDate||T.endDate)&&!i&&A.jsx("button",{type:"button",onClick:P,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:A.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:A.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),A.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:A.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:A.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"})})}),A.jsx(He.AnimatePresence,{children:o&&A.jsx(He.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${t}-description`,role:l==="error"?"alert":void 0,children:A.jsx($,{className:U("mt-1",O()),appearance:"custom",size:"extra-small",variant:"medium",children:o})})}),f&&!o&&A.jsx("div",{id:`${t}-description`,className:"sr-only",children:f})]})});D4.displayName="DateRange2";const{RangePicker:t3}=qe.DatePicker,r3={ENTER:"Enter"},n3=()=>Math.random().toString(36).substring(2,9),I_=(t,e)=>{const r=g.useRef(e);g.useEffect(()=>{r.current=e},[e]),g.useEffect(()=>{const n=a=>r.current(a);return document.addEventListener(t,n),()=>{document.removeEventListener(t,n)}},[t])},R4=({onCalendarChange:t=void 0,onChange:e,required:r,label:n,startDate:a,endDate:i,errorMessage:s,className:o,id:l,disabled:u=!1,dateFormat:c,shouldPopOnParent:d=!0,getPopupContainer:f,maxDateRange:h,open:p,onOpenChange:b,placement:y="bottomLeft",renderAsIconButton:m=!1,iconButtonClassName:v,iconClassName:S})=>{const[E,T]=g.useState(!1),[k,w]=g.useState(!1),O=g.useRef(null),C=g.useRef(null),_=g.useRef(!1),N=g.useRef(!1),R=F=>F?Pt(F):null,D=`date-range-start-${n3()}`,P=`date-range-end-${n3()}`,j=()=>{T(!0),setTimeout(()=>{O.current&&O.current.focus()},0)};I_("keydown",F=>{if(F.key===r3.ENTER&&document.activeElement instanceof HTMLInputElement){if(document?.activeElement?.id===D){const B=Pt(document?.activeElement?.value);B.isValid()&&e([B,R(i)])}if(document?.activeElement?.id===P){const B=Pt(document?.activeElement?.value);B.isValid()&&e([R(a),B])}}});const z=g.useCallback(F=>{const[B,W]=[R(a),R(i)];return h?B?F.isBefore(B.startOf("day"))||F.isAfter(B.add(h,"day").endOf("day")):W?F.isBefore(W.subtract(h,"day").startOf("day"))||F.isAfter(W.endOf("day")):!1:!1},[a,i,h]),L=g.useCallback(F=>{if(F.key===r3.ENTER&&!(m?E:p??k)){F.preventDefault(),F.stopPropagation();const W=F.target.closest("form");if(W){const X=W.querySelector('button[type="submit"]');X?X.click():W.requestSubmit()}}},[m,E,p,k]),M=g.useCallback(F=>{if(F&&_.current){_.current=!1,T(!1);return}T(F),F||(_.current=!0,requestAnimationFrame(()=>{O.current?.focus(),requestAnimationFrame(()=>{_.current=!1})}))},[]),V=g.useCallback(F=>{if(F&&N.current){N.current=!1,w(!1),b?.(!1);return}w(F),b?.(F),F||(N.current=!0,requestAnimationFrame(()=>{C.current?.focus(),requestAnimationFrame(()=>{N.current=!1})}))},[b]);return m?A.jsxs("div",{id:l,className:o,onKeyDownCapture:L,children:[A.jsx(ir,{onClick:j,disabled:u,variant:"default",className:v,children:A.jsx(qs.BiCalendar,{className:U("w-5 h-5",S)})}),A.jsx(t3,{ref:O,onChange:F=>{e(F),T(!1)},onCalendarChange:t,value:[R(a),R(i)],id:{start:D,end:P},allowClear:!0,format:c||"DD MMM, YYYY",separator:A.jsx(Dn.BsDash,{className:"dark:text-gray-100"}),suffixIcon:A.jsx(qs.BiCalendar,{className:"dark:text-gray-100"}),getPopupContainer:f||(d?F=>F.parentElement:()=>document.body),disabled:u,disabledDate:h?z:void 0,autoComplete:"off",open:E,onOpenChange:M,placement:y,style:{position:"absolute",opacity:0,pointerEvents:"none",width:0,height:0}})]}):A.jsxs("div",{id:l,className:U("flex flex-col",o),onKeyDownCapture:L,children:[A.jsx(Xt,{label:n||"",required:r||!1}),A.jsx(t3,{ref:C,onChange:e,onCalendarChange:t,value:[R(a),R(i)],id:{start:D,end:P},allowClear:!0,format:c||"DD MMM, YYYY",separator:A.jsx(Dn.BsDash,{className:"dark:text-gray-100"}),suffixIcon:A.jsx(qs.BiCalendar,{className:"dark:text-gray-100"}),getPopupContainer:f||(d?F=>F.parentElement:()=>document.body),disabled:u,disabledDate:h?z:void 0,open:p??k,onOpenChange:V,autoComplete:"off",placement:y}),s&&A.jsx("p",{className:U("text-sm font-inter font-normal text-left pt-[6px]","text-red-500"),children:s})]})};R4.displayName="DateRange";Pt.extend(FN);Pt.extend(jN);Pt.extend(UN);Pt.extend(HN);const P4="MM/DD/YYYY",ol="MM/DD/YYYY - hh:mm A",a3="YYYY-MM-DD",i3="YYYY-MM-DDTHH:mm:ss",s3={ENTER:"Enter"},L4=["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"],M_=["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",...L4,"YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ssZ"],j_=()=>Math.random().toString(36).substring(2,9),Ts=(t,e=!1)=>{if(!t)return null;const r=e?M_:L4;for(const a of r){const i=Pt(t,a,!0);if(i.isValid())return i}const n=Pt(t);return n.isValid()?n:null},o3=(t,e)=>{const r=g.useRef(e);g.useEffect(()=>{r.current=e},[e]),g.useEffect(()=>{const n=a=>r.current(a);return document.addEventListener(t,n),()=>{document.removeEventListener(t,n)}},[t])},Gg=g.forwardRef(({label:t,value:e,required:r,isRequiredConditional:n=!1,disabled:a,className:i=void 0,errorMessage:s,handleOnChange:o,showTime:l=!0,tags:u,needConfirm:c=!1,simpleMode:d,originalCase:f=!1,dateFormat:h=void 0,tooltip:p,isAiExtracted:b=!1,isGTN:y=!1,gtnName:m=null,shouldPopOnParent:v=!1,allowTimezoneConversion:S=!0,inputStyle:E,labelClassName:T,isLiveField:k=!1,riskDetails:w,isRiskAnalysisOpen:O=!1,RiskDetailsCard:C,onAddGTNToDocument:_,formatDateForGTN:N,...R},D)=>{const{t:P}=Wt.useTranslation(),[j,z]=g.useState(!1),[L,M]=g.useState(null),[V,F]=g.useState(null),[B,W]=g.useState(!1),X=h||(l?ol:P4),Y=R?.id||`date-picker-${j_()}`,Q=g.useRef(null),se=g.useRef(!1);o3("paste",G=>{document.activeElement?.id===Y&&(G.preventDefault(),navigator.clipboard.readText().then(ee=>{const ae=Ts(ee,l);ae&&he(ae)}))}),o3("keydown",G=>{if(G.key===s3.ENTER&&document.activeElement instanceof HTMLInputElement&&document.activeElement.id===Y){const ee=Ts(document?.activeElement?.value,l);ee&&he(ee)}});const fe=g.useCallback(G=>{if(!_)return;let ee=G||"";if(N&&G)ee=N(G,{skipTimezone:!0,withTime:l});else if(G){const Se=Pt(G);Se.isValid()&&(ee=Se.format(X))}_({key:m,value:ee})},[_,m,N,l,X]),re=g.useCallback(()=>{const G=document.getElementsByClassName("ant-picker-footer")[0];G&&(G.style.display="none")},[]),ie=g.useCallback(G=>{if(!S){const ee=l?i3:a3;if(o(G?G.format(ee):null),G){const ae=document.getElementById(Y);if(ae){const Se=new CustomEvent("pilot-date-change",{bubbles:!0,detail:{selector:`#${Y}`,value:G.format?G.format(X):G,type:"date-change",elementId:Y}});ae.dispatchEvent(Se)}}return}if(G){let ee;if(l?ee=Pt(G).utc().toISOString():ee=Pt(G).utc().add(Pt(G).utcOffset(),"minute").startOf("day").toISOString(),ee){o(ee);const ae=document.getElementById(Y);if(ae){const Se=new CustomEvent("pilot-date-change",{bubbles:!0,detail:{selector:`#${Y}`,value:G.format(X),type:"date-change",elementId:Y}});ae.dispatchEvent(Se)}}}else o(null)},[S,o,l,Y,X]),me=g.useCallback(G=>{if(!G)return null;if(!S)try{const ee=Pt(G);if(ee.isValid())return ee;const ae=Pt(G,X);return ae.isValid()?ae:null}catch{return null}if(l){const ee=Pt(G);return Pt(ee).isValid()?ee:null}else if(G?.toString()?.includes("Z")){const ee=Pt.utc(G);return Pt(ee).isValid()?ee:null}else{const ee=Pt(G);return Pt(ee).isValid()?ee:null}},[S,X,l]),he=g.useCallback(G=>{if(G?.isValid()||G===null){M(G);const ee=l?i3:a3,ae=S?G?.toISOString():G?G.format(ee):"";if(o(ae||null),G?.isValid()){const Se=document.getElementById(Y);if(Se){const Ne=new CustomEvent("pilot-date-change",{bubbles:!0,detail:{selector:`#${Y}`,value:G.format(X),type:"date-change",elementId:Y}});Se.dispatchEvent(Ne)}}}},[S,X,o,Y,l]);g.useEffect(()=>{M(me(e))},[e,me]),g.useEffect(()=>{V&&F(null)},[V]),g.useEffect(()=>{const G=document.getElementById(Y);if(!G)return;const ee=ae=>{const{value:Se,type:Ne}=ae.detail;if(Ne==="date-playback"&&Se){const Ve=Ts(Se,l);Ve&&Ve.isValid()&&(M(Ve),ie(Ve),setTimeout(()=>{const Ue=G.querySelector("input");if(Ue&&(Ue.focus(),setTimeout(()=>{Ue.blur()},10)),Q.current)try{const Ze=Q.current;typeof Ze.blur=="function"&&Ze.blur()}catch{}setTimeout(()=>{document.querySelectorAll(".ant-picker-dropdown:not(.ant-picker-dropdown-hidden)").forEach(Fe=>{Fe instanceof HTMLElement&&(Fe.style.display="none",Fe.classList.add("ant-picker-dropdown-hidden"))})},50)},50))}};return G.addEventListener("pilot-date-playback",ee),()=>{G.removeEventListener("pilot-date-playback",ee)}},[Y,X,ie,l]);const ue=g.useCallback(G=>{if(G.key===s3.ENTER&&!B){G.preventDefault(),G.stopPropagation();const ee=G.target.closest("form");if(ee){const ae=ee.querySelector('button[type="submit"]');ae?ae.click():ee.requestSubmit()}}},[B]),Ae=g.useCallback(G=>{if(G&&se.current){se.current=!1,W(!1);return}W(G),G||(se.current=!0,requestAnimationFrame(()=>{Q.current?.focus(),requestAnimationFrame(()=>{se.current=!1})}))},[]);return d?A.jsx("div",{onKeyDownCapture:ue,children:A.jsx(qe.DatePicker,{...R,showTime:l,open:B,format:X,placeholder:X===ol?"MM/DD/YYYY hh:mm":X,value:L,needConfirm:!1,onChange:G=>{M(G),ie(G),F(G?.toISOString()||null)},className:i,showNow:!1,onFocus:re,onOpenChange:Ae,onBlur:G=>{const ee=G.target.value;if(ee){const ae=Ts(ee,l);ae&&he(ae)}},ref:Q,disabled:a,id:Y})}):A.jsxs("div",{ref:D,className:U("flex gap-0.5 relative",j&&y?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),children:[y&&!j?A.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,A.jsxs("div",{className:`w-full flex flex-col font-inter ${i||""}`,onKeyDownCapture:ue,children:[t?A.jsx("label",{className:`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${f?"":"capitalize"} ${T||""}`,children:A.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[A.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[A.jsx(Xt,{label:t||"",required:r||!1,isRequiredConditional:n||!1}),k&&A.jsx(ge.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),b&&A.jsx(mn,{}),A.jsx(Xr,{labels:u}),p&&A.jsx(Pe,{placement:"top",title:p,children:A.jsx("div",{className:"cursor-pointer",children:A.jsx(Wr,{})})})]}),y&&j&&_?A.jsx("button",{id:"btn-date-field-add-to-document",className:"cursor-pointer",onClick:()=>fe(e),type:"button",children:A.jsx(qe.Tooltip,{placement:"top",title:P("Add to document"),children:A.jsx(ge.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}):null,A.jsx(qe.DatePicker,{...R,showTime:l?{use12Hours:!0}:!1,open:B,format:X,placeholder:X===ol?"MM/DD/YYYY - HH:MM":X,className:`w-full h-8 text-inter font-medium ${s?"border-red-400":""} dark:text-black-300 ${O&&w?.color&&`bg-${w.color}-50 border-${w.color}-300`}`,styles:{root:{...E,borderRadius:"7px"}},showNow:!1,value:L,onChange:G=>{M(G),ie(G),F(G?.toISOString()||null)},onBlur:G=>{const ee=G.target.value;if(ee){const ae=Ts(ee,l);ae&&(M(ae),ie(ae))}},needConfirm:c,ref:Q,disabled:a,inputReadOnly:!1,onOpenChange:Ae,getPopupContainer:v?G=>G.parentElement:()=>document.body,id:Y,autoComplete:"off"}),s&&A.jsx($,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:s})]}),j&&w&&O&&C&&A.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:G=>G.stopPropagation(),onMouseDown:G=>G.preventDefault(),onKeyDown:G=>{G.key==="Escape"&&z(!1)},children:A.jsx(C,{riskDetails:w})})]})});Gg.displayName="DateTimeField";const I4=({id:t,label:e,onChange:r,errorMessage:n,required:a,bg:i,tags:s,color:o,debounceTimeout:l=0,className:u,isDarkMode:c,...d})=>{const{inputRef:f,...h}=d;return A.jsxs("div",{className:U("flex flex-col",u),children:[e&&A.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:[A.jsx(Xt,{label:e||"",required:a||!1}),A.jsx(Xr,{labels:s})]}),A.jsx("label",{className:"relative block h-8",children:g.createElement(jg.DebounceInput,{...h,debounceTimeout:l,id:t,key:t,required:a,className:U("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"})}),A.jsx(He.AnimatePresence,{children:n&&A.jsx(He.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.15},children:A.jsx($,{className:"pt-1 text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:n})})})]})};I4.displayName="DebounceInputField";const M4=g.forwardRef(({id:t,label:e,placeholder:r,value:n,onChange:a,errorMessage:i,defaultValue:s,required:o=!1,isRequiredConditional:l=!1,dataSource:u,dataKey:c,tags:d,tooltip:f="",originalCase:h=!1,color:p="",isGTN:b=!1,gtnName:y,isAiExtracted:m=!1,labelClassName:v,disabled:S=!1,isLiveField:E=!1,onAddGTNToDocument:T,riskDetails:k,isRiskAnalysisOpen:w=!1,RiskDetailsCard:O,primaryColorShades:C,isRecording:_=!1,isPlaying:N=!1,setDisableActions:R,showDeprecatedFieldWarning:D,DynamicDataModal:P},j)=>{const{t:z}=Wt.useTranslation(),[L,M]=g.useState(!1),[V,F]=g.useState(n),[B,W]=g.useState(!1),X=g.useRef(null),Y=j||X,Q=()=>{R?.(!B),W(!B)},se=me=>{if(me.keyCode===9||me.key==="Enter"){const he=Y.current||X.current;he&&(V!==null&&a(V),F(V),he.blur())}},fe=()=>{F(""),a("")},re=me=>{T&&y&&T({key:y,value:me})},ie=()=>{const me="border h-[32px] text-sm rounded-lg block w-full p-2.5 font-inter font-medium",he=i?"border-red-300":w&&k?.color?`border-${k?.color}-300`:"border-gray-300 dark:border-black-600",ue="placeholder:text-neutral-900 dark:placeholder:text-black-400",Ae=`${w&&k?.color?`bg-${k?.color}-50`:"bg-gray-200 dark:bg-black-600 "} ${p||"text-neutral-900 dark:text-black-200"}`;return`${me} ${he} ${Ae} ${ue}`};return g.useEffect(()=>{B&&!u&&(D?.(),W(!1))},[B,u,D]),g.useEffect(()=>{F(n)},[n]),A.jsxs("div",{className:U("flex gap-0.5 w-full relative",L&&b?"border rounded-lg border-primary-100 bg-primary-50 p-1":"",{"error-field":!!i}),onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:[b&&!L?A.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,A.jsxs("div",{className:U("flex flex-col w-full"),children:[A.jsx("label",{htmlFor:"text",className:`text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${h?"":"capitalize"} ${v||""}`,children:A.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[A.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[A.jsx(Xt,{label:e||"",required:o||!1,isRequiredConditional:l||!1}),E&&A.jsx(ge.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),m&&A.jsx(mn,{}),A.jsx(Xr,{labels:d}),f&&A.jsx(Pe,{placement:"top",title:f,children:A.jsx("div",{className:"cursor-pointer",children:A.jsx(Wr,{})})})]}),b&&L&&T?A.jsx("button",{id:"btn-dynamic-data-input-add-to-document",className:"cursor-pointer",onClick:()=>re(n?.toString()||""),type:"button",children:A.jsx(qe.Tooltip,{placement:"top",title:z("Add to document"),children:A.jsx(ge.NoteAddOutlined,{sx:{fontSize:16,color:C?.[600]||"var(--color-primary-600)"}})})}):null]})}),A.jsxs("label",{className:"relative block mt-1",children:[A.jsx("input",{id:t,ref:Y,required:o,placeholder:r,className:ie(),onChange:me=>{a(me.target.value),F(me.target?.value)},onKeyDown:se,value:V!==null?V:n,defaultValue:s,disabled:!0}),A.jsx(ir,{id:"btn-dynamic-data-input-rx-cross",onClick:fe,className:"absolute inset-y-0 right-1 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:S,children:A.jsx(ge.CloseRounded,{className:"text-neutral-900 dark:text-black-300",sx:{fontSize:16}})}),A.jsx(ir,{id:"btn-dynamic-data-input-ai-outline-pic-center",onClick:Q,className:"absolute inset-y-0 right-8 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:S,children:A.jsx(ge.TableChartRounded,{className:"text-neutral-900 dark:text-black-300",sx:{fontSize:16}})})]}),i&&A.jsx($,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:i}),B&&P&&A.jsx(P,{isVisible:B,onSelect:me=>{a(me),F(me)},onClose:Q,dataKey:c,dataSource:u})]}),L&&k&&w&&O&&A.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:me=>me.stopPropagation(),onMouseDown:me=>me.preventDefault(),onKeyDown:me=>{me.key==="Escape"&&M(!1)},children:A.jsx(O,{riskDetails:k})})]})});M4.displayName="DynamicDataInputField";const vt=g.forwardRef(({status:t="primary",appearance:e,className:r,disabled:n,children:a,isLoading:i,title:s,id:o,onClick:l,onKeyDown:u,badge:c,type:d="button",options:f,tooltip:h,tooltipPlacement:p="top",shortcuts:b,tooltipShortcuts:y,theme:m="light",autoFocus:v},S)=>{const E=g.useCallback(()=>{switch(e){case"outline":return k();case"ghost":return w();case"dashed":return O();default:return T()}},[e,t,n,m]),T=g.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,m]),k=g.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,m]),w=g.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,m]),O=g.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 [background-repeat:no-repeat] [background-size:1px_100%,100%_1px,1px_100%,100%_1px] [background-position:0_0,0_0,100%_0,0_100%] [background-image:repeating-linear-gradient(3deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px),repeating-linear-gradient(93deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px),repeating-linear-gradient(183deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px),repeating-linear-gradient(273deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px)] dark:[background-image:repeating-linear-gradient(3deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px),repeating-linear-gradient(93deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px),repeating-linear-gradient(183deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px),repeating-linear-gradient(273deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px)]";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 [background-repeat:no-repeat] [background-size:1px_100%,100%_1px,1px_100%,100%_1px] [background-position:0_0,0_0,100%_0,0_100%] [background-image:repeating-linear-gradient(3deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px),repeating-linear-gradient(93deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px),repeating-linear-gradient(183deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px),repeating-linear-gradient(273deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px)] dark:[background-image:repeating-linear-gradient(3deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px),repeating-linear-gradient(93deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px),repeating-linear-gradient(183deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px),repeating-linear-gradient(273deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px)]"}},[t,m]),C=g.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]),_=Vo(),N=g.useMemo(()=>b?.length?b.map(P=>{const j=Tu[P];return j?_==="macos"?j.macos:j.other:P}):[],[b,_]),R=()=>A.jsx(A.Fragment,{children:A.jsx(ka.CgSpinner,{size:24,className:"inline mr-2 spinner"})}),D=d||(t==="primary"&&e==="filled"?"submit":d);return A.jsx(Pe,{title:h,placement:p,shortcuts:y,delayShow:!0,children:A.jsxs("button",{ref:S,className:`
53
+ `,children:A.jsx(n,{style:{width:"110%",height:"110%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},__=t=>{const e=t.slice(0,2),r=Bo[e];return r?A.jsx("div",{className:"w-4 h-4 rounded-full overflow-hidden flex items-center justify-center relative",children:A.jsx(r,{style:{width:"120%",height:"120%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},D_=t=>{const e=t.slice(0,2),r=Bo[e];return r?A.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:A.jsx(r,{style:{width:"110%",height:"110%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},R_=t=>{const e=t.slice(0,2),r=Bo[e];return r?A.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:A.jsx(r,{style:{width:"120%",height:"120%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},C4=t=>{const e=t.slice(0,2),r=Bo[e];return r?A.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:A.jsx(r,{style:{width:"115%",height:"115%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},h1=t=>t===1||t==="1"||typeof t=="string"&&t.toLowerCase()==="yes"||typeof t=="string"&&t.toLowerCase()==="true"?"Yes":t===0||t==="0"||typeof t=="string"&&t.toLowerCase()==="no"||typeof t=="string"&&t.toLowerCase()==="false"?"No":t?.toString()||"-",ni=(t,e="USD")=>{try{if(t==null)return"";const r=Number(t);if(Number.isNaN(r))return t?.toString()||"";const n=r.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2});return`${ku[e]||"$"}${n}`}catch{return"-"}},P_=t=>{const e=new Date(t.replaceAll("-","/"));return e instanceof Date&&e.getHours()===0&&e.getMinutes()===0&&e.getSeconds()===0&&e.getMilliseconds()===0},L_=(t,e)=>{if(e){const n=t.replace(/Z$|[+-]\d{2}:?\d{2}$/,"");return new Date(n)}let r=t;return r.includes("+")&&(r=r.split("+")[0]),!r.includes("Z")&&!r.includes("GMT")&&!r.includes("+")&&(r+="Z"),new Date(r)},oa=(t,e={})=>{const{format:r,timezone:n,relative:a=!1,withTime:i=!0,fallback:s="-",skipTimezone:o=!1,onlyTime:l=!1}=e||{};if(!t)return s;try{if(!Pt(t).isValid())return s;const u=L_(t.toString(),o);if(Number.isNaN(u.getTime()))return s;const c=P_(t);let d;if(o)d=u;else{const h=Intl.DateTimeFormat().resolvedOptions().timeZone,p=n||h;d=MN.utcToZonedTime(u,p)}if(a)return Z2.formatDistanceToNow(new Date(d),{addSuffix:!0}).replace(/^about /,"");let f;if(r)f=r;else{const h="MM/dd/yyyy";f=i&&!c?`${h} hh:mm a`:h}return l&&(f="hh:mm a"),Z2.format(d,f)}catch{return s}},N4=t=>typeof t=="string"&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(t),_4=g.forwardRef(({id:t,label:e,value:r,onChange:n,errorMessage:a,defaultValue:i,required:s=!1,isRequiredConditional:o=!1,tags:l,className:u,originalCase:c=!1,tooltip:d,simpleMode:f=!1,inputFieldClassName:h="",isAiExtracted:p=!1,isGTN:b=!1,gtnName:y=null,allowMultiCurrency:m=!1,placeholder:v,disabled:S=!1,currencyCode:E="USD",inputStyle:T,labelClassName:k,isLiveField:w=!1,onBlur:O,autoFocus:C=!1,isRecording:_=!1,isPlaying:N=!1,onAddGTNToDocument:R,riskDetails:D,isRiskAnalysisOpen:P=!1,RiskDetailsCard:j,...z},L)=>{const{t:M}=Wt.useTranslation(),[V,F]=g.useState(!1),[B,W]=g.useState([]),[X,Y]=g.useState(""),[Q,se]=g.useState(E||"USD"),[fe,re]=g.useState(!1),ie=ee=>{if(R){const ae={key:y,value:ni(ee,Q)};R(ae)}},me=ee=>{if(ee==null)return"";const ae=Number(ee);return isNaN(ae)?ee:ae?.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},he=ee=>{const ae=ee.target.value,Se=ae===""||ae===null||ae===void 0?0:Number(ae);n(Se,Q);const Ne=document.getElementById(t);if(Ne&&Ne.setAttribute("data-selected-value",JSON.stringify({value:Se,currency_code:Q})),Ne&&(_||N)){const Ve=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${t}`,value:{value:Se,currency_code:Q},type:"change"}});Ne.dispatchEvent(Ve)}},ue=()=>{F(!0)},Ae=()=>{F(!1),(r==null||r==="")&&he({target:{value:"0.00"}}),O?.()},G=()=>{const ee="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)]",ae=a?"border-red-300":P&&D?.color?`border-${D.color}-300`:"border-gray-300 dark:border-black-600",Se=`${P&&D?.color?`bg-${D.color}-50`:"bg-white dark:bg-black-600"}`;return`${ee} ${ae} ${Se} ${h}`};return g.useEffect(()=>{E&&se(E)},[E]),g.useEffect(()=>{if(Q){const ee=r===""||r===null||r===void 0?0:Number(r);E!==Q&&n(ee,Q);const ae=document.getElementById(t);if(ae&&(ae.setAttribute("data-selected-value",JSON.stringify({value:ee,currency_code:Q})),_||N)){const Se=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${t}`,value:{value:ee,currency_code:Q},type:"change"}});ae.dispatchEvent(Se)}}},[Q]),g.useEffect(()=>{const ee=k4.filter(ae=>(ae.value+" - "+ae.label).toLowerCase().includes(X.toLowerCase())).map(ae=>({label:A.jsx(Or,{text:`${ae.value} - ${ae.label}`,icon:co(ae.value),showTick:Q===ae.value,onClick:()=>se(ae.value),className:"text-black-900 dark:text-white"}),key:ae.value}));W(ee)},[X,Q]),g.useEffect(()=>{Y("")},[Q]),f?A.jsxs("label",{id:t,className:`mb-1 text-xs font-medium text-gray-600 h-full inline-flex items-center gap-1 ${c?"":"capitalize"} ${k||""}`,children:[A.jsx("span",{className:"absolute inset-y-0 left-1 top-0.5 flex items-center pl-3",children:"$"}),A.jsx("input",{...z,ref:L,type:V?"number":"text",required:s,className:U(h,"pl-8 h-[32px]"),onChange:he,min:0,onFocus:ue,onBlur:Ae,value:V?r:me(r),...i&&!r?{defaultValue:V?i:me(i)}:{},id:t||e,autoFocus:C})]}):A.jsxs("div",{className:U("flex gap-0.5 relative",fe&&b?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>re(!0),onMouseLeave:()=>re(!1),children:[b&&!fe?A.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,A.jsxs("div",{className:U("w-full flex flex-col",u),children:[A.jsx("label",{htmlFor:"text",className:`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${c?"":"uppercase"} ${k||""}`,children:A.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[A.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[A.jsx(Xt,{label:e||"",required:s||!1,isRequiredConditional:o||!1}),w&&A.jsx(ge.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),p&&A.jsx(mn,{}),A.jsx(Xr,{labels:l}),d&&A.jsx(Pe,{placement:"top",title:d,children:A.jsx("div",{className:"cursor-pointer",children:A.jsx(Wr,{})})})]}),b&&fe&&R?A.jsx("button",{id:"btn-currency-input-add-to-document",className:"cursor-pointer",onClick:()=>ie(me(r)),type:"button",children:A.jsx(qe.Tooltip,{placement:"top",title:M("Add to document"),children:A.jsx(ge.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}),A.jsxs("label",{className:"relative block",children:[A.jsx("span",{className:"absolute inset-y-0 left-1 flex items-center pl-3 text-neutral-900 dark:text-white",children:ku[Q]}),A.jsx("input",{...z,ref:L,placeholder:v,type:V?"number":"text",required:s,disabled:S,className:G(),onChange:he,min:0,onFocus:ue,onBlur:Ae,value:V?r:me(r),defaultValue:V?i:me(i),id:t||e,style:T,autoComplete:"off",autoFocus:C}),A.jsx("span",{className:`absolute inset-y-0 right-2 flex items-center z-[1000px] h-full cursor-pointer dark:text-black-200 ${m?"cursor-pointer":""}`,children:m?A.jsx(qe.Dropdown,{menu:{items:[...B]},trigger:["click"],overlayClassName:"row-option-cell",placement:"bottomRight",overlayStyle:{zIndex:999},getPopupContainer:ee=>ee.parentElement,popupRender:ee=>A.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:[A.jsx(Qg,{id:"search-bar-currency-input",value:X,onChange:ae=>Y(ae),className:"mb-2"}),ee]}),children:A.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:[co(Q)," ",Q]})}):Q})]}),a&&A.jsx($,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:a})]}),fe&&D&&P&&j&&A.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:ee=>ee.stopPropagation(),onMouseDown:ee=>ee.preventDefault(),onKeyDown:ee=>{ee.key==="Escape"&&re(!1)},children:A.jsx(j,{riskDetails:D})})]})});_4.displayName="CurrencyInputField";const D4=g.forwardRef(({id:t,label:e,value:r,defaultValue:n,onChange:a,disabled:i=!1,required:s=!1,message:o,messageType:l="default",wrapperClassName:u,inputClassName:c,labelClassName:d,helpText:f,size:h="medium",minDate:p,maxDate:b,startPlaceholder:y="Start date",endPlaceholder:m="End date",allowClear:v=!0,inputProps:S},E)=>{const T=r!==void 0?r:n||{startDate:null,endDate:null},k=()=>{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"}}},w=()=>l==="error"?"border-red-300 focus:border-red-500 focus:ring-red-200 dark:focus:ring-red-400/20":l==="success"?"border-green-300 focus:border-green-500 focus:ring-green-200 dark:focus:ring-green-400/20":l==="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",O=()=>l==="error"?"text-red-500 dark:text-red-400":l==="success"?"text-green-500 dark:text-green-400":l==="info"?"text-blue-500 dark:text-blue-400":"text-neutral-500 dark:text-neutral-400",C=()=>{switch(h){case"small":return"extra-small";case"large":return"medium";default:return"small"}},_=L=>{if(!L)return"";const M=L.getFullYear(),V=String(L.getMonth()+1).padStart(2,"0"),F=String(L.getDate()).padStart(2,"0");return`${M}-${V}-${F}`},N=L=>{if(!L)return null;const M=new Date(L);return isNaN(M.getTime())?null:M},R=L=>{const M=N(L.target.value);a({startDate:M,endDate:T.endDate})},D=L=>{const M=N(L.target.value);a({startDate:T.startDate,endDate:M})},P=()=>{a({startDate:null,endDate:null})},j=L=>L?_(L):void 0,z=k();return A.jsxs("div",{className:U("flex flex-col w-full",u),ref:E,children:[e&&A.jsx("label",{htmlFor:`${t}-start`,className:U("mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",d),children:A.jsx("div",{className:"flex flex-wrap items-center justify-between w-full",children:A.jsx("div",{className:"inline-flex flex-wrap items-center gap-1",children:A.jsxs($,{variant:"medium",size:C(),appearance:"subtitle",children:[e,s&&A.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})})})}),f&&A.jsx($,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:f}),A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx("div",{className:"flex-1",children:A.jsx("input",{...S,id:`${t}-start`,type:"date",value:_(T.startDate),onChange:R,disabled:i,required:s,min:j(p),max:j(b),placeholder:y,className:U("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",z.height,z.padding,z.fontSize,w(),i&&"opacity-50 cursor-not-allowed bg-neutral-50 dark:bg-neutral-700",c),"aria-required":s,"aria-invalid":o&&l==="error"?"true":"false","aria-describedby":o||f?`${t}-description`:void 0})}),A.jsx("div",{className:"flex-shrink-0 text-neutral-500 dark:text-neutral-400",children:A.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:A.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M18 12H6"})})}),A.jsx("div",{className:"flex-1",children:A.jsx("input",{...S,id:`${t}-end`,type:"date",value:_(T.endDate),onChange:D,disabled:i,required:s,min:j(T.startDate||p),max:j(b),placeholder:m,className:U("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",z.height,z.padding,z.fontSize,w(),i&&"opacity-50 cursor-not-allowed bg-neutral-50 dark:bg-neutral-700",c),"aria-required":s,"aria-invalid":o&&l==="error"?"true":"false","aria-describedby":o||f?`${t}-description`:void 0})}),v&&(T.startDate||T.endDate)&&!i&&A.jsx("button",{type:"button",onClick:P,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:A.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:A.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),A.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:A.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:A.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"})})}),A.jsx(He.AnimatePresence,{children:o&&A.jsx(He.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${t}-description`,role:l==="error"?"alert":void 0,children:A.jsx($,{className:U("mt-1",O()),appearance:"custom",size:"extra-small",variant:"medium",children:o})})}),f&&!o&&A.jsx("div",{id:`${t}-description`,className:"sr-only",children:f})]})});D4.displayName="DateRange2";const{RangePicker:t3}=qe.DatePicker,r3={ENTER:"Enter"},n3=()=>Math.random().toString(36).substring(2,9),I_=(t,e)=>{const r=g.useRef(e);g.useEffect(()=>{r.current=e},[e]),g.useEffect(()=>{const n=a=>r.current(a);return document.addEventListener(t,n),()=>{document.removeEventListener(t,n)}},[t])},R4=({onCalendarChange:t=void 0,onChange:e,required:r,label:n,startDate:a,endDate:i,errorMessage:s,className:o,id:l,disabled:u=!1,dateFormat:c,shouldPopOnParent:d=!0,getPopupContainer:f,maxDateRange:h,open:p,onOpenChange:b,placement:y="bottomLeft",renderAsIconButton:m=!1,iconButtonClassName:v,iconClassName:S})=>{const[E,T]=g.useState(!1),[k,w]=g.useState(!1),O=g.useRef(null),C=g.useRef(null),_=g.useRef(!1),N=g.useRef(!1),R=F=>F?Pt(F):null,D=`date-range-start-${n3()}`,P=`date-range-end-${n3()}`,j=()=>{T(!0),setTimeout(()=>{O.current&&O.current.focus()},0)};I_("keydown",F=>{if(F.key===r3.ENTER&&document.activeElement instanceof HTMLInputElement){if(document?.activeElement?.id===D){const B=Pt(document?.activeElement?.value);B.isValid()&&e([B,R(i)])}if(document?.activeElement?.id===P){const B=Pt(document?.activeElement?.value);B.isValid()&&e([R(a),B])}}});const z=g.useCallback(F=>{const[B,W]=[R(a),R(i)];return h?B?F.isBefore(B.startOf("day"))||F.isAfter(B.add(h,"day").endOf("day")):W?F.isBefore(W.subtract(h,"day").startOf("day"))||F.isAfter(W.endOf("day")):!1:!1},[a,i,h]),L=g.useCallback(F=>{if(F.key===r3.ENTER&&!(m?E:p??k)){F.preventDefault(),F.stopPropagation();const W=F.target.closest("form");if(W){const X=W.querySelector('button[type="submit"]');X?X.click():W.requestSubmit()}}},[m,E,p,k]),M=g.useCallback(F=>{if(F&&_.current){_.current=!1,T(!1);return}T(F),F||(_.current=!0,requestAnimationFrame(()=>{O.current?.focus(),requestAnimationFrame(()=>{_.current=!1})}))},[]),V=g.useCallback(F=>{if(F&&N.current){N.current=!1,w(!1),b?.(!1);return}w(F),b?.(F),F||(N.current=!0,requestAnimationFrame(()=>{C.current?.focus(),requestAnimationFrame(()=>{N.current=!1})}))},[b]);return m?A.jsxs("div",{id:l,className:o,onKeyDownCapture:L,children:[A.jsx(ir,{onClick:j,disabled:u,variant:"default",className:v,children:A.jsx(qs.BiCalendar,{className:U("w-5 h-5",S)})}),A.jsx(t3,{ref:O,onChange:F=>{e(F),T(!1)},onCalendarChange:t,value:[R(a),R(i)],id:{start:D,end:P},allowClear:!0,format:c||"DD MMM, YYYY",separator:A.jsx(Dn.BsDash,{className:"dark:text-gray-100"}),suffixIcon:A.jsx(qs.BiCalendar,{className:"dark:text-gray-100"}),getPopupContainer:f||(d?F=>F.parentElement:()=>document.body),disabled:u,disabledDate:h?z:void 0,autoComplete:"off",open:E,onOpenChange:M,placement:y,style:{position:"absolute",opacity:0,pointerEvents:"none",width:0,height:0}})]}):A.jsxs("div",{id:l,className:U("flex flex-col",o),onKeyDownCapture:L,children:[A.jsx(Xt,{label:n||"",required:r||!1}),A.jsx(t3,{ref:C,onChange:e,onCalendarChange:t,value:[R(a),R(i)],id:{start:D,end:P},allowClear:!0,format:c||"DD MMM, YYYY",separator:A.jsx(Dn.BsDash,{className:"dark:text-gray-100"}),suffixIcon:A.jsx(qs.BiCalendar,{className:"dark:text-gray-100"}),getPopupContainer:f||(d?F=>F.parentElement:()=>document.body),disabled:u,disabledDate:h?z:void 0,open:p??k,onOpenChange:V,autoComplete:"off",placement:y}),s&&A.jsx("p",{className:U("text-sm font-inter font-normal text-left pt-[6px]","text-red-500"),children:s})]})};R4.displayName="DateRange";Pt.extend(FN);Pt.extend(jN);Pt.extend(UN);Pt.extend(HN);const P4="MM/DD/YYYY",ol="MM/DD/YYYY - hh:mm A",a3="YYYY-MM-DD",i3="YYYY-MM-DDTHH:mm:ss",s3={ENTER:"Enter"},L4=["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"],M_=["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",...L4,"YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ssZ"],j_=()=>Math.random().toString(36).substring(2,9),Ts=(t,e=!1)=>{if(!t)return null;const r=e?M_:L4;for(const a of r){const i=Pt(t,a,!0);if(i.isValid())return i}const n=Pt(t);return n.isValid()?n:null},o3=(t,e)=>{const r=g.useRef(e);g.useEffect(()=>{r.current=e},[e]),g.useEffect(()=>{const n=a=>r.current(a);return document.addEventListener(t,n),()=>{document.removeEventListener(t,n)}},[t])},Gg=g.forwardRef(({label:t,value:e,required:r,isRequiredConditional:n=!1,disabled:a,className:i=void 0,errorMessage:s,handleOnChange:o,showTime:l=!0,tags:u,needConfirm:c=!1,simpleMode:d,originalCase:f=!1,dateFormat:h=void 0,tooltip:p,isAiExtracted:b=!1,isGTN:y=!1,gtnName:m=null,shouldPopOnParent:v=!1,allowTimezoneConversion:S=!0,inputStyle:E,labelClassName:T,isLiveField:k=!1,riskDetails:w,isRiskAnalysisOpen:O=!1,RiskDetailsCard:C,onAddGTNToDocument:_,formatDateForGTN:N,...R},D)=>{const{t:P}=Wt.useTranslation(),[j,z]=g.useState(!1),[L,M]=g.useState(null),[V,F]=g.useState(null),[B,W]=g.useState(!1),X=h||(l?ol:P4),Y=R?.id||`date-picker-${j_()}`,Q=g.useRef(null),se=g.useRef(!1);o3("paste",G=>{document.activeElement?.id===Y&&(G.preventDefault(),navigator.clipboard.readText().then(ee=>{const ae=Ts(ee,l);ae&&he(ae)}))}),o3("keydown",G=>{if(G.key===s3.ENTER&&document.activeElement instanceof HTMLInputElement&&document.activeElement.id===Y){const ee=Ts(document?.activeElement?.value,l);ee&&he(ee)}});const fe=g.useCallback(G=>{if(!_)return;let ee=G||"";if(N&&G)ee=N(G,{skipTimezone:!0,withTime:l});else if(G){const Se=Pt(G);Se.isValid()&&(ee=Se.format(X))}_({key:m,value:ee})},[_,m,N,l,X]),re=g.useCallback(()=>{const G=document.getElementsByClassName("ant-picker-footer")[0];G&&(G.style.display="none")},[]),ie=g.useCallback(G=>{if(!S){const ee=l?i3:a3;if(o(G?G.format(ee):null),G){const ae=document.getElementById(Y);if(ae){const Se=new CustomEvent("pilot-date-change",{bubbles:!0,detail:{selector:`#${Y}`,value:G.format?G.format(X):G,type:"date-change",elementId:Y}});ae.dispatchEvent(Se)}}return}if(G){let ee;if(l?ee=Pt(G).utc().toISOString():ee=Pt(G).utc().add(Pt(G).utcOffset(),"minute").startOf("day").toISOString(),ee){o(ee);const ae=document.getElementById(Y);if(ae){const Se=new CustomEvent("pilot-date-change",{bubbles:!0,detail:{selector:`#${Y}`,value:G.format(X),type:"date-change",elementId:Y}});ae.dispatchEvent(Se)}}}else o(null)},[S,o,l,Y,X]),me=g.useCallback(G=>{if(!G)return null;if(!S)try{const ee=Pt(G);if(ee.isValid())return ee;const ae=Pt(G,X);return ae.isValid()?ae:null}catch{return null}if(l){const ee=Pt(G);return Pt(ee).isValid()?ee:null}else if(G?.toString()?.includes("Z")){const ee=Pt.utc(G);return Pt(ee).isValid()?ee:null}else{const ee=Pt(G);return Pt(ee).isValid()?ee:null}},[S,X,l]),he=g.useCallback(G=>{if(G?.isValid()||G===null){M(G);const ee=l?i3:a3,ae=S?G?.toISOString():G?G.format(ee):"";if(o(ae||null),G?.isValid()){const Se=document.getElementById(Y);if(Se){const Ne=new CustomEvent("pilot-date-change",{bubbles:!0,detail:{selector:`#${Y}`,value:G.format(X),type:"date-change",elementId:Y}});Se.dispatchEvent(Ne)}}}},[S,X,o,Y,l]);g.useEffect(()=>{M(me(e))},[e,me]),g.useEffect(()=>{V&&F(null)},[V]),g.useEffect(()=>{const G=document.getElementById(Y);if(!G)return;const ee=ae=>{const{value:Se,type:Ne}=ae.detail;if(Ne==="date-playback"&&Se){const Ve=Ts(Se,l);Ve&&Ve.isValid()&&(M(Ve),ie(Ve),setTimeout(()=>{const Ue=G.querySelector("input");if(Ue&&(Ue.focus(),setTimeout(()=>{Ue.blur()},10)),Q.current)try{const Ze=Q.current;typeof Ze.blur=="function"&&Ze.blur()}catch{}setTimeout(()=>{document.querySelectorAll(".ant-picker-dropdown:not(.ant-picker-dropdown-hidden)").forEach(Fe=>{Fe instanceof HTMLElement&&(Fe.style.display="none",Fe.classList.add("ant-picker-dropdown-hidden"))})},50)},50))}};return G.addEventListener("pilot-date-playback",ee),()=>{G.removeEventListener("pilot-date-playback",ee)}},[Y,X,ie,l]);const ue=g.useCallback(G=>{if(G.key===s3.ENTER&&!B){G.preventDefault(),G.stopPropagation();const ee=G.target.closest("form");if(ee){const ae=ee.querySelector('button[type="submit"]');ae?ae.click():ee.requestSubmit()}}},[B]),Ae=g.useCallback(G=>{if(G&&se.current){se.current=!1,W(!1);return}W(G),G||(se.current=!0,requestAnimationFrame(()=>{Q.current?.focus(),requestAnimationFrame(()=>{se.current=!1})}))},[]);return d?A.jsx("div",{onKeyDownCapture:ue,children:A.jsx(qe.DatePicker,{...R,showTime:l,open:B,format:X,placeholder:X===ol?"MM/DD/YYYY hh:mm":X,value:L,needConfirm:!1,onChange:G=>{M(G),ie(G),F(G?.toISOString()||null)},className:i,showNow:!1,onFocus:re,onOpenChange:Ae,onBlur:G=>{const ee=G.target.value;if(ee){const ae=Ts(ee,l);ae&&he(ae)}},ref:Q,disabled:a,id:Y})}):A.jsxs("div",{ref:D,className:U("flex gap-0.5 relative",j&&y?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),children:[y&&!j?A.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,A.jsxs("div",{className:`w-full flex flex-col font-inter ${i||""}`,onKeyDownCapture:ue,children:[t?A.jsx("label",{className:`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${f?"":"capitalize"} ${T||""}`,children:A.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[A.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[A.jsx(Xt,{label:t||"",required:r||!1,isRequiredConditional:n||!1}),k&&A.jsx(ge.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),b&&A.jsx(mn,{}),A.jsx(Xr,{labels:u}),p&&A.jsx(Pe,{placement:"top",title:p,children:A.jsx("div",{className:"cursor-pointer",children:A.jsx(Wr,{})})})]}),y&&j&&_?A.jsx("button",{id:"btn-date-field-add-to-document",className:"cursor-pointer",onClick:()=>fe(e),type:"button",children:A.jsx(qe.Tooltip,{placement:"top",title:P("Add to document"),children:A.jsx(ge.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}):null,A.jsx(qe.DatePicker,{...R,showTime:l?{use12Hours:!0}:!1,open:B,format:X,placeholder:X===ol?"MM/DD/YYYY - HH:MM":X,className:`w-full h-8 text-inter font-medium ${s?"border-red-400":""} dark:text-black-300 ${O&&w?.color&&`bg-${w.color}-50 border-${w.color}-300`}`,styles:{root:{...E,borderRadius:"7px"}},showNow:!1,value:L,onChange:G=>{M(G),ie(G),F(G?.toISOString()||null)},onBlur:G=>{const ee=G.target.value;if(ee){const ae=Ts(ee,l);ae&&(M(ae),ie(ae))}},needConfirm:c,ref:Q,disabled:a,inputReadOnly:!1,onOpenChange:Ae,getPopupContainer:v?G=>G.parentElement:()=>document.body,id:Y,autoComplete:"off"}),s&&A.jsx($,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:s})]}),j&&w&&O&&C&&A.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:G=>G.stopPropagation(),onMouseDown:G=>G.preventDefault(),onKeyDown:G=>{G.key==="Escape"&&z(!1)},children:A.jsx(C,{riskDetails:w})})]})});Gg.displayName="DateTimeField";const I4=({id:t,label:e,onChange:r,errorMessage:n,required:a,bg:i,tags:s,color:o,debounceTimeout:l=0,className:u,isDarkMode:c,...d})=>{const{inputRef:f,...h}=d;return A.jsxs("div",{className:U("flex flex-col",u),children:[e&&A.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:[A.jsx(Xt,{label:e||"",required:a||!1}),A.jsx(Xr,{labels:s})]}),A.jsx("label",{className:"relative block h-8",children:g.createElement(jg.DebounceInput,{...h,debounceTimeout:l,id:t,key:t,required:a,className:U("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"})}),A.jsx(He.AnimatePresence,{children:n&&A.jsx(He.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.15},children:A.jsx($,{className:"pt-1 text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:n})})})]})};I4.displayName="DebounceInputField";const M4=g.forwardRef(({id:t,label:e,placeholder:r,value:n,onChange:a,errorMessage:i,defaultValue:s,required:o=!1,isRequiredConditional:l=!1,dataSource:u,dataKey:c,tags:d,tooltip:f="",originalCase:h=!1,color:p="",isGTN:b=!1,gtnName:y,isAiExtracted:m=!1,labelClassName:v,disabled:S=!1,isLiveField:E=!1,onAddGTNToDocument:T,riskDetails:k,isRiskAnalysisOpen:w=!1,RiskDetailsCard:O,primaryColorShades:C,isRecording:_=!1,isPlaying:N=!1,setDisableActions:R,showDeprecatedFieldWarning:D,DynamicDataModal:P},j)=>{const{t:z}=Wt.useTranslation(),[L,M]=g.useState(!1),[V,F]=g.useState(n),[B,W]=g.useState(!1),X=g.useRef(null),Y=j||X,Q=()=>{R?.(!B),W(!B)},se=me=>{if(me.keyCode===9||me.key==="Enter"){const he=Y.current||X.current;he&&(V!==null&&a(V),F(V),he.blur())}},fe=()=>{F(""),a("")},re=me=>{T&&y&&T({key:y,value:me})},ie=()=>{const me="border h-[32px] text-sm rounded-lg block w-full p-2.5 font-inter font-medium",he=i?"border-red-300":w&&k?.color?`border-${k?.color}-300`:"border-gray-300 dark:border-black-600",ue="placeholder:text-neutral-900 dark:placeholder:text-black-400",Ae=`${w&&k?.color?`bg-${k?.color}-50`:"bg-gray-200 dark:bg-black-600 "} ${p||"text-neutral-900 dark:text-black-200"}`;return`${me} ${he} ${Ae} ${ue}`};return g.useEffect(()=>{B&&!u&&(D?.(),W(!1))},[B,u,D]),g.useEffect(()=>{F(n)},[n]),A.jsxs("div",{className:U("flex gap-0.5 w-full relative",L&&b?"border rounded-lg border-primary-100 bg-primary-50 p-1":"",{"error-field":!!i}),onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:[b&&!L?A.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,A.jsxs("div",{className:U("flex flex-col w-full"),children:[A.jsx("label",{htmlFor:"text",className:`text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${h?"":"capitalize"} ${v||""}`,children:A.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[A.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[A.jsx(Xt,{label:e||"",required:o||!1,isRequiredConditional:l||!1}),E&&A.jsx(ge.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),m&&A.jsx(mn,{}),A.jsx(Xr,{labels:d}),f&&A.jsx(Pe,{placement:"top",title:f,children:A.jsx("div",{className:"cursor-pointer",children:A.jsx(Wr,{})})})]}),b&&L&&T?A.jsx("button",{id:"btn-dynamic-data-input-add-to-document",className:"cursor-pointer",onClick:()=>re(n?.toString()||""),type:"button",children:A.jsx(qe.Tooltip,{placement:"top",title:z("Add to document"),children:A.jsx(ge.NoteAddOutlined,{sx:{fontSize:16,color:C?.[600]||"var(--color-primary-600)"}})})}):null]})}),A.jsxs("label",{className:"relative block mt-1",children:[A.jsx("input",{id:t,ref:Y,required:o,placeholder:r,className:ie(),onChange:me=>{a(me.target.value),F(me.target?.value)},onKeyDown:se,value:V!==null?V:n,defaultValue:s,disabled:!0}),A.jsx(ir,{id:"btn-dynamic-data-input-rx-cross",onClick:fe,className:"absolute inset-y-0 right-1 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:S,children:A.jsx(ge.CloseRounded,{className:"text-neutral-900 dark:text-black-300",sx:{fontSize:16}})}),A.jsx(ir,{id:"btn-dynamic-data-input-ai-outline-pic-center",onClick:Q,className:"absolute inset-y-0 right-8 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:S,children:A.jsx(ge.TableChartRounded,{className:"text-neutral-900 dark:text-black-300",sx:{fontSize:16}})})]}),i&&A.jsx($,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:i}),B&&P&&A.jsx(P,{isVisible:B,onSelect:me=>{a(me),F(me)},onClose:Q,dataKey:c,dataSource:u})]}),L&&k&&w&&O&&A.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:me=>me.stopPropagation(),onMouseDown:me=>me.preventDefault(),onKeyDown:me=>{me.key==="Escape"&&M(!1)},children:A.jsx(O,{riskDetails:k})})]})});M4.displayName="DynamicDataInputField";const vt=g.forwardRef(({status:t="primary",appearance:e,className:r,disabled:n,children:a,isLoading:i,title:s,id:o,onClick:l,onKeyDown:u,badge:c,type:d="button",options:f,tooltip:h,tooltipPlacement:p="top",shortcuts:b,tooltipShortcuts:y,theme:m="light",autoFocus:v},S)=>{const E=g.useCallback(()=>{switch(e){case"outline":return k();case"ghost":return w();case"dashed":return O();default:return T()}},[e,t,n,m]),T=g.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,m]),k=g.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,m]),w=g.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,m]),O=g.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 [background-repeat:no-repeat] [background-size:1px_100%,100%_1px,1px_100%,100%_1px] [background-position:0_0,0_0,100%_0,0_100%] [background-image:repeating-linear-gradient(3deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px),repeating-linear-gradient(93deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px),repeating-linear-gradient(183deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px),repeating-linear-gradient(273deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px)] dark:[background-image:repeating-linear-gradient(3deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px),repeating-linear-gradient(93deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px),repeating-linear-gradient(183deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px),repeating-linear-gradient(273deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px)]";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 [background-repeat:no-repeat] [background-size:1px_100%,100%_1px,1px_100%,100%_1px] [background-position:0_0,0_0,100%_0,0_100%] [background-image:repeating-linear-gradient(3deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px),repeating-linear-gradient(93deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px),repeating-linear-gradient(183deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px),repeating-linear-gradient(273deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px)] dark:[background-image:repeating-linear-gradient(3deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px),repeating-linear-gradient(93deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px),repeating-linear-gradient(183deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px),repeating-linear-gradient(273deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px)]"}},[t,m]),C=g.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]),_=Vo(),N=g.useMemo(()=>b?.length?b.map(P=>{const j=Tu[P];return j?_==="macos"?j.macos:j.other:P}):[],[b,_]),R=()=>A.jsx(A.Fragment,{children:A.jsx(ka.CgSpinner,{size:24,className:"inline mr-2 spinner"})}),D=d||(t==="primary"&&e==="filled"?"submit":d);return A.jsx(Pe,{title:h,placement:p,shortcuts:y,delayShow:!0,children:A.jsxs("button",{ref:S,className:`
54
54
  ${r||""}
55
55
  cursor-pointer
56
56
  font-inter