@lax-wp/design-system 0.11.52 → 0.11.53
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 +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +22 -26
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
.dark [class*="virtual-list-scrollbar-thumb"] {
|
|
48
48
|
background: #454545 !important;
|
|
49
49
|
}
|
|
50
|
-
`,document.head.appendChild(De)},[]);const ve=()=>{if(B){let ge="";_e==null?ge="":typeof _e=="string"||typeof _e=="number"?ge=String(_e):Array.isArray(_e)?ge=_e.map(Le=>typeof Le=="object"&&Le!==null&&"value"in Le?Le.value:Le).join(", "):typeof _e=="object"&&"value"in _e&&(ge=String(_e.value)),B({key:x,value:ge})}},_e=cD(e),ue=h.useMemo(()=>S?NN(S,k):null,[S,k]),Q=(ge,De)=>{if(je.current&&G.id){const Le=document.getElementById(G.id);if(Le){const Ye=Array.isArray(De)?De.map(et=>et.value):De?.value;Le.dataset.selectedValue=JSON.stringify(Ye);const lt=new Event("change",{bubbles:!0});Object.defineProperty(lt,"target",{writable:!1,value:Le}),Le.dispatchEvent(lt);const nt=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${G.id}`,value:Ye,type:"change"}});Le.dispatchEvent(nt)}}if(r==="tags"){const Le=Array.isArray(ge)?ge:[ge];v?.(Le?.map(Ye=>({label:Ye,value:Ye})))}else v?.(De)},se=fD({options:i,value:e,defaultValue:G?.defaultValue}),ke=h.useMemo(()=>se.length>0||_e!=null,[se,_e]),ze=h.useMemo(()=>{if(!r||r!=="multiple"||se.length===0)return!1;const ge=Array.isArray(_e)?_e:[];return se.map(Le=>Le.value).every(Le=>ge.some(Ye=>typeof Ye=="object"&&Ye!==null&&"value"in Ye?String(Ye.value)===String(Le):String(Ye)===String(Le)))},[_e,se,r]),Ge=()=>{!r||r!=="multiple"||!v||v(ze?[]:se)},Je=h.useCallback(ge=>{if(!ge)return;const De=new Event("submit",{bubbles:!0,cancelable:!0});ge.dispatchEvent(De);const Le=ge.querySelector('button[type="submit"]');Le&&Le.click()},[]),Ue=h.useCallback(ge=>{if(ge.key==="Enter"&&!ye&&(ge.preventDefault(),ge.stopPropagation(),_e)){const De=ge.currentTarget.closest("form");Je(De)}},[ye,_e,Je]),we=h.useCallback(ge=>{const{label:De,value:Le,onClose:Ye}=ge,nt=se.find(Xe=>String(Xe.value)===String(Le))?.color||"primary",et=Xe=>{Xe.preventDefault(),Xe.stopPropagation()};return l.jsx("div",{className:"cursor-pointer me-1 inline-flex",children:l.jsx(dr,{label:De,color:nt,size:"sm",onMouseDown:et,onClick:R?void 0:Ye,isHashColor:!0,removable:!0,onRemove:Ye})})},[se,R]),Pe=h.useCallback(ge=>{pe(ge),(A||ue)?.(ge)},[A,ue]);return l.jsxs("div",{ref:K,className:F("flex gap-0.5 w-full relative",$&&g?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>oe(!0),onMouseLeave:()=>oe(!1),id:G.id,children:[g&&!$?l.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,l.jsxs("div",{className:F("w-full flex flex-col gap-1 risk-analysis-select-field",o),onMouseDown:ge=>ge.stopPropagation(),onKeyDownCapture:Ue,role:"group","aria-labelledby":t?"select-field-label":void 0,children:[t?l.jsx("label",{id:"select-field-label",htmlFor:"label",className:`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${c?"":"capitalize"} ${I||""}`,children:l.jsxs("div",{className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1",children:[l.jsxs("div",{className:"inline-flex min-w-0 items-center gap-1 flex-wrap",children:[l.jsx(Qt,{label:t||"",required:a||!1,isRequiredConditional:Y||!1}),re&&l.jsx(ce.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),d&&!zt(f)&&l.jsx(En,{}),l.jsx(Zr,{labels:s}),u&&l.jsx(Te,{placement:"top",title:u,children:l.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onKeyDown:ge=>{(ge.key==="Enter"||ge.key===" ")&&ge.preventDefault()},children:l.jsx(Kr,{})})})]}),l.jsxs("div",{className:"flex items-center gap-1 justify-self-end",children:[zt(f)&&p?l.jsx(Te,{placement:"top-end",title:m??"",hideTooltip:m==null,className:"cursor-pointer",children:l.jsxs("div",{className:F("inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5",ei(p)),onClick:()=>y?.(b),children:[l.jsx(fn,{size:12,fill:kn(p),fillSecondary:wn(p)}),l.jsxs("span",{className:F("text-xs font-medium leading-4",ti(p)),children:[f,"%"]})]})}):null,g&&$?l.jsx("button",{id:"btn-select-field-base-add-to-document",className:"cursor-pointer",onClick:ve,type:"button",children:l.jsx(Te,{placement:"top",title:te("Add to document"),children:l.jsx(ce.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})]})}):null,l.jsx(Ze.Select,{onOpenChange:me,disabled:R,className:`w-full text-black-900 dark:text-black-200 ${n&&a?"ant-select-status-error":"#e2e8f0"} ${z&&M?.color?"risk-select-field":""}`,classNames:{popup:{root:"!z-[5001]"}},style:{width:"100%","--risk-color":z&&M?.hexBgColor?M?.hexBgColor:"","--risk-border-color":z&&M?.hexBorderColor?M?.hexBorderColor:""},"aria-required":a,mode:r,value:_e,onChange:Q,filterOption:S?E:(ge,De)=>(De?.label||"")?.toLowerCase()?.includes(ge?.toLowerCase()),showSearch:!0,onSearch:Pe||void 0,onPopupScroll:w,popupClassName:"select-field-dropdown-popup",popupRender:ge=>l.jsx(hD,{showSelectAll:H,mode:r,options:se,searchValue:fe,handleSelectAll:Ge,isAllSelected:ze,menu:ge,isLoading:T,hasExistingData:ke,t:te}),options:se.map(({label:ge,value:De,color:Le,...Ye})=>({label:String(ge),value:String(De),key:String(De),id:String(De),color:Le,...Ye})),optionRender:ge=>{const De=ge?.data?.fullname;if(De&&W){const[Le,Ye]=De.split(" ");return l.jsxs("div",{className:"flex items-center justify-start gap-1",children:[l.jsx(W,{firstName:Le,lastName:Ye,profilePic:ge?.data?.url||"",size:"xs",enablePopper:!0,userId:ge?.data?.value}),l.jsx("span",{className:"ml-2",children:ge.label})]})}return l.jsx("span",{children:ge.label})},autoClearSearchValue:C,onClear:()=>v&&v(r==="tags"||r==="multiple"?[]:null),maxTagCount:r==="tags"&&P?void 0:"responsive",maxTagPlaceholder:ge=>l.jsx(Te,{placement:"top",title:ge.length>3?ge.slice(0,3).map(({label:De})=>De).join(", ")+"...":ge.map(({label:De})=>De).join(", "),children:l.jsxs("span",{children:["+",ge.length," more"]})}),tagRender:L||we,allowClear:O,...G}),n&&l.jsx(ne,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:n})]}),$&&M&&z&&V&&l.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:ge=>ge.stopPropagation(),onMouseDown:ge=>ge.preventDefault(),onKeyDown:ge=>{ge.key==="Escape"&&oe(!1)},children:l.jsx(V,{riskDetails:M})})]})});al.displayName="SelectField";const sS=h.forwardRef(({id:t,label:e,checked:r,isChecked:n,onChange:i,disabled:a=!1,required:s=!1,message:o,messageType:A="default",wrapperClassName:u,checkboxClassName:c,labelClassName:d,size:f="medium",variant:p="default",labelPosition:m="right",checkboxProps:b},y)=>{const g=r!==void 0?r:n||!1,x=()=>{switch(f){case"small":return"w-3 h-3";case"large":return"w-5 h-5";default:return"w-4 h-4"}},v=()=>{if(A==="error")return"text-red-600 border-red-300 focus:ring-red-500 dark:focus:ring-red-600";if(A==="success")return"text-green-600 border-green-300 focus:ring-green-500 dark:focus:ring-green-600";if(A==="info")return"text-blue-600 border-blue-300 focus:ring-blue-500 dark:focus:ring-blue-600";switch(p){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"}},S=()=>A==="error"?"text-red-500 dark:text-red-400":A==="success"?"text-green-500 dark:text-green-400":A==="info"?"text-blue-500 dark:text-blue-400":"text-neutral-500 dark:text-neutral-400",k=()=>{switch(f){case"small":return"extra-small";case"large":return"medium";default:return"small"}},E=O=>{i(O.target.checked,O)},w=l.jsx(Ze.Checkbox,{...b,ref:y,id:t,checked:g,onChange:E,disabled:a,className:F("rounded focus:ring-2 focus:ring-primary-500 dark:focus:ring-primary-400 focus:ring-offset-gray-800 transition-colors duration-200",x(),v(),a&&"opacity-50 cursor-not-allowed",c),"aria-required":s,"aria-invalid":o&&A==="error"?"true":"false","aria-describedby":o?`${t}-message`:void 0}),T=e?l.jsx("label",{htmlFor:t,className:F("font-medium cursor-pointer transition-colors duration-200",a?"text-neutral-400 dark:text-neutral-600 cursor-not-allowed":"text-neutral-900 dark:text-neutral-100",m==="right"?"ml-2":"mr-2",d),children:l.jsxs(ne,{variant:"medium",size:k(),appearance:"body",children:[e,s&&l.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})}):null;return l.jsxs("div",{className:F("flex flex-col",u),children:[l.jsx("div",{className:F("flex items-center",m==="left"&&"flex-row-reverse justify-end"),children:m==="left"?l.jsxs(l.Fragment,{children:[w,T]}):l.jsxs(l.Fragment,{children:[w,T]})}),l.jsx(Ve.AnimatePresence,{children:o&&l.jsx(Ve.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${t}-message`,role:A==="error"?"alert":void 0,children:l.jsx(ne,{className:F("mt-1",S()),appearance:"custom",size:"extra-small",variant:"medium",children:o})})})]})});sS.displayName="Checkbox";const oS=({label:t,isChecked:e,onChange:r,id:n,...i})=>l.jsxs("div",{className:"flex items-center",children:[l.jsx(Ze.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",...i}),l.jsx("label",{className:"ml-2 text-sm font-medium text-neutral-900 dark:text-neutral-100",children:t})]}),lS=h.forwardRef(({id:t,label:e,value:r,defaultValue:n="#000000",onChange:i,onColorChange:a,disabled:s=!1,required:o=!1,message:A,messageType:u="default",wrapperClassName:c,inputClassName:d,labelClassName:f,size:p="medium",showValue:m=!1,valueFormat:b="hex",inputProps:y,helpText:g},x)=>{const v=h.useRef(null),S=x||v,k=h.useCallback(()=>{requestAnimationFrame(()=>{S.current?.focus()})},[S]),E=h.useCallback(H=>{if(H.key==="Enter"&&!H.shiftKey){H.preventDefault();const I=H.target.closest("form");if(I){const M=I.querySelector('button[type="submit"]');M?M.click():I.requestSubmit()}}y?.onKeyDown?.(H)},[y]),w=r!==void 0?r:n,T=()=>{switch(p){case"small":return"w-8 h-8";case"large":return"w-16 h-16";default:return"w-12 h-12"}},O=()=>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",C=()=>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(p){case"small":return"extra-small";case"large":return"medium";default:return"small"}},P=H=>{const I=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(H);if(!I)return H;const M=parseInt(I[1],16),z=parseInt(I[2],16),V=parseInt(I[3],16);return`rgb(${M}, ${z}, ${V})`},L=H=>{const I=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(H);if(!I)return H;const M=parseInt(I[1],16)/255,z=parseInt(I[2],16)/255,V=parseInt(I[3],16)/255,X=Math.max(M,z,V),ee=Math.min(M,z,V);let W=0,B=0;const Y=(X+ee)/2;if(X!==ee){const re=X-ee;switch(B=Y>.5?re/(2-X-ee):re/(X+ee),X){case M:W=(z-V)/re+(z<V?6:0);break;case z:W=(V-M)/re+2;break;case V:W=(M-z)/re+4;break}W/=6}return`hsl(${Math.round(W*360)}, ${Math.round(B*100)}%, ${Math.round(Y*100)}%)`},D=()=>{switch(b){case"rgb":return P(w);case"hsl":return L(w);default:return w.toUpperCase()}},R=H=>{const I=H.target.value;i(I,H),a?.(I)};return l.jsxs("div",{className:F("flex flex-col w-full",c),children:[e&&l.jsx("label",{htmlFor:t,className:F("mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",f),children:l.jsx("div",{className:"flex flex-wrap items-center justify-between w-full",children:l.jsx("div",{className:"inline-flex flex-wrap items-center gap-1",children:l.jsxs(ne,{variant:"medium",size:N(),appearance:"subtitle",children:[e,o&&l.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})})})}),g&&l.jsx(ne,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:g}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"relative",children:l.jsx("input",{...y,ref:S,onBlur:k,onKeyDown:E,type:"color",id:t,value:w,onChange:R,disabled:s,required:o,className:F("border rounded-md cursor-pointer transition-all duration-200","focus:outline-none focus:ring-2",T(),C(),s&&"opacity-50 cursor-not-allowed",d),style:{backgroundColor:w},"aria-required":o,"aria-invalid":A&&u==="error"?"true":"false","aria-describedby":A||g?`${t}-description`:void 0})}),m&&l.jsx("div",{className:"flex-1",children:l.jsx(ne,{variant:"medium",size:"small",appearance:"body",className:"font-mono text-neutral-700 dark:text-neutral-300",children:D()})})]}),l.jsx(Ve.AnimatePresence,{children:A&&l.jsx(Ve.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${t}-description`,role:u==="error"?"alert":void 0,children:l.jsx(ne,{className:F("mt-1",O()),appearance:"custom",size:"extra-small",variant:"medium",children:A})})}),g&&!A&&l.jsx("div",{id:`${t}-description`,className:"sr-only",children:g})]})});lS.displayName="ColorPicker";const kb=()=>{const[t,e]=h.useState(!1);return h.useEffect(()=>{const r=()=>{e(document.documentElement.classList.contains("dark"))};r();const n=new MutationObserver(i=>{i.forEach(a=>{a.attributeName==="class"&&r()})});return n.observe(document.documentElement,{attributes:!0}),()=>n.disconnect()},[]),t},AS=({id:t,label:e,errorMessage:r,selectOptions:n,loading:i,isClearable:a,multiSelect:s,selectedValues:o,disabled:A,required:u,value:c,className:d,tooltip:f,tags:p,originalCase:m=!1,onChange:b,filterOption:y,placeholder:g,...x})=>{const v=kb(),[S,k]=h.useState(!1),E=(D,R)=>{b&&b(D);const H=document.getElementById(t);if(H){const I=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${t}`,value:D,type:"change"}});H.dispatchEvent(I)}},w={control:(D,R)=>({...D,borderColor:r&&u?v?"#F04438":"#fda49b":R.isFocused?"var(--color-primary-600)":v?"#434343":"#d9d9d9",backgroundColor:v?"#141414":R.isDisabled?"#f5f5f5":"#fff",borderRadius:"6px",minHeight:"32px",fontSize:"14px",padding:"0 4px 0 12px",opacity:R.isDisabled?.6:1,cursor:R.isDisabled?"not-allowed":"pointer",boxShadow:R.isFocused?v?"0 0 0 1.5px var(--color-primary-950)":"0 0 0 1.5px var(--color-primary-100)":"none","&:hover":{borderColor:r&&u?v?"#F04438":"#fda49b":"var(--color-primary-600)"}}),valueContainer:D=>({...D,fontSize:"14px",padding:0}),input:D=>({...D,margin:"0",padding:"0",color:v?"rgba(255,255,255,0.85)":"inherit"}),indicatorsContainer:D=>({...D,padding:0}),option:(D,R)=>({...D,fontSize:"14px",lineHeight:"22px",padding:"5px 12px",margin:0,backgroundColor:R.isSelected?v?"var(--color-primary-975)":"var(--color-primary-50)":R.isFocused?v?"var(--color-primary-950)":"var(--color-primary-100)":v?"#141414":"#fff",color:R.isDisabled?v?"rgba(255,255,255,0.25)":"#a3a3a3":v?R.isSelected?"var(--color-primary-600)":"rgba(255,255,255,0.85)":"rgba(0,0,0,0.88)",cursor:R.isDisabled?"not-allowed":"pointer",opacity:R.isDisabled?.6:1,"&:hover":{backgroundColor:R.isDisabled?v?"#141414":"#fff":v?"var(--color-primary-950)":"var(--color-primary-100)"},"&:active":{backgroundColor:v?"var(--color-primary-950)":"var(--color-primary-50)"}}),singleValue:(D,R)=>({...D,fontSize:"14px",lineHeight:"20px",color:R.isDisabled?v?"rgba(255,255,255,0.25)":"#a3a3a3":v?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.88)"}),placeholder:D=>({...D,fontSize:"14px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:v?"rgba(255,255,255,0.25)":"#bfbfbf"}),multiValue:D=>({...D,backgroundColor:v?"rgba(255,255,255,0.08)":"#f0f5ff",border:v?"1px solid transparent":"1px solid #adc6ff",borderRadius:"4px"}),multiValueLabel:D=>({...D,color:v?"rgba(255,255,255,0.85)":"var(--color-primary-600)",fontSize:"12px"}),multiValueRemove:D=>({...D,color:v?"rgba(255,255,255,0.85)":"var(--color-primary-600)","&:hover":{backgroundColor:v?"rgba(255,255,255,0.16)":"#e6f4ff",color:v?"#fff":"var(--color-primary-600)"}}),menu:D=>({...D,zIndex:5001,borderRadius:"8px",boxShadow:v?"0 6px 16px 0 rgba(0,0,0,0.45)":"0 6px 16px 0 rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12), 0 9px 28px 8px rgba(0,0,0,0.05)",backgroundColor:v?"#141414":"#fff",border:v?"1px solid #303030":"none",overflow:"hidden"}),menuList:D=>({...D,padding:"0",maxHeight:"256px"})},T=!!o?.length,N=S&&!A&&(a?T||!!c:!1),P=D=>{D.stopPropagation(),D.preventDefault(),E(s?[]:null)},L=()=>l.jsx("div",{className:"flex items-center",children:N?l.jsx(ce.CancelRounded,{onClick:P,sx:{fontSize:"16px",cursor:"pointer",color:v?"rgba(255,255,255,0.45)":"rgba(0,0,0,0.25)","&:hover":{color:v?"rgba(255,255,255,0.65)":"rgba(0,0,0,0.45)"}}}):l.jsx(ce.ChevronLeftRounded,{className:"-rotate-90",sx:{fontSize:"18px",color:v?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.25)"}})});return l.jsxs("div",{id:t,className:F("w-full flex flex-col gap-1",d),onMouseDown:D=>D.stopPropagation(),role:"group","aria-labelledby":e?t+"Label":void 0,children:[e&&l.jsxs("label",{id:t+"Label",htmlFor:"text",className:`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${m?"":"capitalize"}`,children:[l.jsx(Qt,{label:e||"",required:u||!1}),l.jsx(Zr,{labels:p}),f&&l.jsx(Ze.Tooltip,{placement:"top",title:f,children:l.jsx("div",{className:"cursor-pointer",children:l.jsx(Kr,{})})})]}),l.jsx("div",{onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:l.jsx(DN,{...x,id:"cm"+e,classNamePrefix:"lax-select",required:u,options:n,isClearable:!1,isLoading:i,isDisabled:A,styles:w,isMulti:s,value:s?o:c,onChange:E,filterOption:y,placeholder:g,classNames:{menuList:()=>"nowheel"},components:{DropdownIndicator:L,IndicatorSeparator:()=>null}})}),r&&l.jsx(ne,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:r})]})};AS.displayName="CreatableSelectField";const Yu=({ref:t,handler:e,enabled:r=!0})=>{h.useEffect(()=>{if(!r)return;const n=i=>{t.current&&!t.current.contains(i.target)&&e()};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[t,e,r])},mD={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"},uS=({id:t,label:e,options:r,placeholder:n,onChange:i,isLoading:a=!1,hideLabel:s=!1,errorMessage:o,required:A=!1,optionConfig:u,menuConfig:c,value:d,isMulti:f=!1,isClearable:p=!0,disabled:m=!1,className:b,isDark:y=!1,primaryColorShades:g=mD})=>{const x=h.useRef(null),[v,S]=h.useState(null),[k,E]=h.useState("");Yu({ref:x,handler:()=>{S(null)}});const w={control:(L,D)=>({...L,borderColor:o&&A?"#F04438":D.isFocused?y?g[400]:g[600]:y?"#1e1e1e":"#e2e8f0",backgroundColor:D.isDisabled?y?"#1a1a1a":"#f5f5f5":y?"#262626":"#FFFFFF",color:D.isDisabled?y?"#666666":"#a0a0a0":y?"#d4d4d4":"#0F172A",borderRadius:"6px",minHeight:"32px",fontSize:"14px",padding:"0px 10px",cursor:D.isDisabled?"not-allowed":"default",opacity:(D.isDisabled,1),boxShadow:D.isFocused?y?`0 0 0 3px ${g[950]}`:`0 0 0 3px ${g[100]}`:"none"}),valueContainer:L=>({...L,fontSize:"14px",maxHeight:"60px",overflowY:"auto",padding:"0px",margin:"0px",color:y?"#d4d4d4":"inherit","::-webkit-scrollbar":{display:"none"}}),input:L=>({...L,margin:"0"}),indicatorSeparator:()=>({display:"none"}),option:L=>({...L,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":g[50]},".icon":{height:"14px",width:"14px"}}),singleValue:(L,D)=>({...L,fontWeight:500,fontSize:"14px",lineHeight:"1.25rem",color:(D.isDisabled,y?"#d4d4d4":"#0F172A"),display:"flex",alignItems:"center",".icon":{height:"14px",width:"14px"}}),placeholder:(L,D)=>({...L,fontSize:"14px",fontWeight:500,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:(D.isDisabled,y?"#595959":"#9CA3AF")}),multiValue:L=>({...L,backgroundColor:y?"#000000":g[50],borderRadius:"6px",fontFamily:"Inter",fontSize:"12px",height:"20px",alignItems:"center"}),indicatorsContainer:L=>({...L,padding:"0",height:"30px"}),multiValueLabel:L=>({...L,color:y?"#d4d4d4":g[600],fontSize:"12px"}),multiValueRemove:L=>({...L,color:y?"#d4d4d4":g[600],height:"12px",fontSize:"8px",":hover":{backgroundColor:y?"#171717":g[50]},svg:{height:"12px",width:"12px"}})},T=L=>{const D=r.filter(R=>R?.label?.toLowerCase()?.includes(k?.toLowerCase()));return l.jsx(zl.components.MenuList,{...L,className:F("!z-50 rounded !visible overflow-x-scroll",y?"bg-black-800":"bg-white",y?"text-neutral-300":"text-navy-900",c?.className),ref:x,children:D?.length?D.map((R,H)=>l.jsxs("div",{className:F("item z-[9999] flex items-center justify-between px-4 py-1.5 no-wheel",m?"cursor-not-allowed opacity-50":"cursor-pointer",y?"text-neutral-300":"text-navy-900",!m&&O(R)?y?"bg-black-700":"bg-primary-50":m?"":y?"hover:bg-black-700":"hover:bg-primary-50",c?.optionClassName?"":y?"border-b border-black-700":"border-b border-[#eee]"),onClick:I=>{m||(I.stopPropagation(),L.selectOption(R))},children:[u?.component?l.jsx(u.component,{...u.componentProps,...R}):l.jsx("div",{children:R.label}),l.jsx("div",{className:"flex items-center gap-1",children:O(R)&&u?.selectIndecator?u?.selectIndecator:null})]},H)):l.jsx("div",{className:F("opacity-50 flex justify-center items-center p-1 font-medium",y?"text-neutral-400":"text-gray-700"),children:"No options"})})},O=L=>f?v?.some(D=>D.value===L.value):L.value===v?.value,C=L=>{const{children:D,innerProps:R,isDisabled:H,getValue:I}=L,M=I();return l.jsx(zl.components.SingleValue,{...L,innerProps:R,isDisabled:H,children:M.length>0?M.map((z,V)=>l.jsx("span",{children:u?.component?l.jsx(u.component,{...u.componentProps,...z}):l.jsx("div",{children:z.label})},V)):l.jsx(l.Fragment,{children:D})})},N=L=>{const{innerProps:D,isDisabled:R,data:H}=L;return l.jsx(zl.components.MultiValue,{...L,innerProps:D,isDisabled:R,children:u?.component?l.jsx(u.component,{...u.componentProps,...H}):l.jsx("div",{children:H.label})})},P=(L,D)=>(E(D),!0);return l.jsxs("div",{className:F("flex flex-col",y?"text-black-300":"text-navy-900",a?"opacity-50":"opacity-100",m?"cursor-not-allowed":""),id:t,children:[s||!e?null:l.jsx(Qt,{label:e||"",required:A||!1}),l.jsx(zl,{required:!0,classNamePrefix:"lax-select",options:r,placeholder:n,value:d,onChange:L=>{S(L),i(L)},styles:w,isMulti:f,className:F(y&&"bg-black-800 border-black-700",b),components:{MenuList:T,SingleValue:C,MultiValue:N},filterOption:P,closeMenuOnSelect:!0,isClearable:p,isDisabled:m}),o&&l.jsx(ne,{className:F("mt-1",y?"text-red-400":"text-red-500"),appearance:"custom",size:"extra-small",variant:"medium",children:o})]})};uS.displayName="CustomizableSelectField";const KA=[{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:"$"},ZA=({classValue:t,size:e=24,fill:r="currentColor",...n})=>l.jsxs("svg",{className:F(t),width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[l.jsx("rect",{width:"12",height:"12",rx:"6",fill:r}),l.jsx("g",{clipPath:"url(#clip0_8212_362816)",children:l.jsx("path",{d:"M8.10023 3.90357C7.97023 3.77357 7.76023 3.77357 7.63023 3.90357L6.00023 5.53023L4.37023 3.90023C4.24023 3.77023 4.03023 3.77023 3.90023 3.90023C3.77023 4.03023 3.77023 4.24023 3.90023 4.37023L5.53023 6.00023L3.90023 7.63023C3.77023 7.76023 3.77023 7.97023 3.90023 8.10023C4.03023 8.23023 4.24023 8.23023 4.37023 8.10023L6.00023 6.47023L7.63023 8.10023C7.76023 8.23023 7.97023 8.23023 8.10023 8.10023C8.23023 7.97023 8.23023 7.76023 8.10023 7.63023L6.47023 6.00023L8.10023 4.37023C8.2269 4.24357 8.2269 4.03023 8.10023 3.90357Z",fill:"#98A2B3"})}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_8212_362816",children:l.jsx("rect",{width:"8",height:"8",fill:"white",transform:"translate(2 2)"})})})]});ZA.displayName="CloseRounded";const cS=({width:t=15,height:e=15,fill:r="#98A2B3",className:n})=>l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:t.toString(),height:e.toString(),viewBox:"0 0 20 20",fill:"none",className:n,children:l.jsx("path",{d:"M17.5 17.5L12.5001 12.5M14.1667 8.33333C14.1667 11.555 11.555 14.1667 8.33333 14.1667C5.11167 14.1667 2.5 11.555 2.5 8.33333C2.5 5.11167 5.11167 2.5 8.33333 2.5C11.555 2.5 14.1667 5.11167 14.1667 8.33333Z",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),Zu=t=>{const{value:e,placeholder:r,onChange:n,id:i,debounceTimeout:a=0,classValues:s,handleKeyDown:o,isClearable:A,onFocusText:u,autoComplete:c="false",searchRef:d,hasNavigation:f=!1,autoFocus:p=!1,searchConfig:m,hideSearchIcon:b,allowAStarSearch:y=!1,...g}=t,{t:x}=Xt.useTranslation(),[v,S]=h.useState(!1),[k,E]=h.useState("search"),w=h.useRef(null),{searchCount:T,searchPointer:O,setSearchPointer:C}=m||{},N=()=>{const D=A&&!!e,R=f&&!!e;return D&&R?"pr-28":R?"pr-12":D?"pr-8":"pr-7"},P=()=>{S(!0),E(u||r||x("Search"));const D=d||w;D.current&&D.current.focus()},L=()=>{S(!1),E("")};return l.jsxs("label",{className:F("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&&l.jsx("div",{className:"flex items-center h-6 w-6 pointer-events-none",children:l.jsx(cS,{width:"16",height:"16"})}),l.jsx(bb.DebounceInput,{...g,spellCheck:"false",debounceTimeout:a,id:i,inputRef:d||w,type:"text",className:F(`absolute inset-0 dark:text-[#98A2B3] text-neutral-900 ${b?"pl-2":"pl-10"} pl-10 ${N()} 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:v?k:y?"":`${x("Search")}`,onChange:D=>n?.(D.target.value),autoComplete:c,onFocus:D=>{S(!0),P(),t.onFocus&&t.onFocus(D)},onBlur:D=>{S(!1),L(),t.onBlur&&t.onBlur(D)},autoFocus:p}),f&&e&&l.jsxs("div",{className:F("absolute mr-2 focus:outline-none flex gap-1",A?"right-6":"right-0"),children:[!!T&&(T||0)>0&&l.jsxs("span",{className:"text-xs border-r pr-2 border-gray-200",children:[(O||0)+1,"/",T]}),l.jsxs("div",{className:"flex gap-1 items-center",children:[l.jsx("button",{id:"btn-search-bar-set-search-pointer-forward",onClick:()=>{C&&C(D=>(D||0)-1)},disabled:O===0,children:l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M15 18l-6-6 6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),l.jsx("button",{id:"btn-search-bar-set-search-pointer-backward",onClick:()=>{C&&C(D=>(D||0)+1)},disabled:O===(T||0)-1,children:l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M9 18l6-6-6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),y&&!(A&&e)&&!v&&!e?l.jsxs("div",{className:"absolute flex ml-6 items-center justify-center focus:outline-none gap-1 flex-wrap-none",children:[l.jsxs(ne,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:[x("Search")," (use"]}),l.jsx("button",{className:" bg-[#EAECF0] dark:bg-black-800 rounded-sm text-sm w-3 h-5",children:l.jsx(Ze.Tooltip,{placement:"bottomRight",color:"#141414",classNames:{root:"custom-tooltip dark:!bg-black-800"},title:l.jsxs("div",{className:"flex flex-col items-start justify-center p-2 w-full h-full gap-2 dark:bg-black-800",children:[l.jsx(ne,{variant:"semibold",size:"extra-small",className:"text-white",children:x("Normal Search")}),l.jsx(ne,{variant:"medium",size:"extra-small",className:"text-primary-400 dark:text-primary-400",appearance:"custom",children:x("Examples")}),l.jsxs("div",{className:"flex flex-col items-start justify-center ",children:[l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ne,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:l.jsx(ne,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:"data"})}),l.jsx(ne,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "data", "Data".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ne,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:l.jsx(ne,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:"text"})}),l.jsx(ne,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "text", "context", "plaintext".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ne,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:l.jsx(ne,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:"base"})}),l.jsx(ne,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "database", "baseball", "basename".'})]})]}),l.jsx("div",{className:"h-[1px] w-full bg-neutral-800 dark:bg-black-200 my-2"}),l.jsx(ne,{variant:"semibold",size:"extra-small",className:"text-white",children:"Wildcard Search"}),l.jsx(ne,{variant:"medium",size:"extra-small",className:"text-white dark:text-black-200",appearance:"custom",children:"Use * as a wildcard to refine your search."}),l.jsx(ne,{variant:"medium",size:"extra-small",className:"text-primary-400 dark:text-primary-400",appearance:"custom",children:"Examples:"}),l.jsxs("div",{className:"flex flex-col items-start justify-center ",children:[l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ne,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:l.jsx(ne,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ",appearance:"custom",children:"contract*"})}),l.jsx(ne,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ "contracts", "contractor", "CONTRACTOR".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ne,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:l.jsx(ne,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ",appearance:"custom",children:"*agreement"})}),l.jsx(ne,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "service agreement", "legal agreement".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ne,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:l.jsx(ne,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:"*clause*"})}),l.jsx(ne,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "clause", "subclause", "clauses".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ne,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:l.jsx(ne,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:"*l*s*"})}),l.jsx(ne,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "clause", "clauses".'})]})]})]}),children:l.jsx("div",{className:"text-[#475467] dark:text-black-300 dark:bg-black-600",children:"*"})})}),l.jsx(ne,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:"as a wildcard)"})]}):A&&e&&l.jsx("button",{id:"btn-search-bar-close",className:"absolute right-0 mr-2 focus:outline-none",onClick:()=>n?.(""),children:l.jsx(ZA,{classValue:"text-neutral-200 dark:text-black-500",size:16})})]})};var Fa=(t=>(t.LEFT="left",t.RIGHT="right",t.TOP="top",t))(Fa||{});const gD=(t,e,r,n="medium")=>{const i={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"},a={small:"peer-checked:after:translate-x-3",medium:"peer-checked:after:translate-x-full",large:"peer-checked:after:translate-x-5"};return F("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)]",i[n],a[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})},bD=({size:t=18,fill:e="#016DCF"})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:l.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:e})}),xD=({size:t=18,fill:e="#101828"})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:l.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z",fill:e})}),Zn=h.forwardRef(({isGTN:t=!1,isChecked:e,id:r,onChange:n,label:i,required:a,isRequiredConditional:s=!1,hideStatus:o=!1,labelDirection:A=Fa.TOP,statusText:u,withIcon:c=!1,tags:d,isAiExtracted:f=!1,confidenceScore:p,confidenceType:m="high",confidenceTooltip:b,sourceMeta:y=[],onConfidenceScoreClick:g,tooltip:x="",className:v="",disabled:S,isDisabled:k=!1,icon:E,stopClickPropagation:w=!0,gtnName:T,variant:O="primary",labelClassName:C,isLiveField:N=!1,message:P,messageType:L="default",wrapperClassName:D,helpText:R,size:H="medium",renderGTNAddButton:I,onAddGTNToDocument:M},z)=>{const{t:V}=Xt.useTranslation(),X=S??k,ee=!!X,W=typeof X=="string"?X:void 0,B=A===Fa.TOP,Y=A===Fa.LEFT,re=A===Fa.RIGHT,[G,K]=h.useState(!1),te=()=>{M&&M({key:T,value:e?"Yes":"No"})},$=()=>L==="error"?"text-red-500 dark:text-red-400":L==="success"?"text-green-500 dark:text-green-400":L==="info"?"text-primary-500 dark:text-primary-400":"text-neutral-500 dark:text-neutral-400";return l.jsxs("div",{className:F("flex gap-0.5",G&&t?"border rounded-lg border-primary-100 bg-primary-50 p-1":"",D),onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1),onClick:oe=>{w&&oe.stopPropagation()},children:[t&&!G?l.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-pulse mt-1.5"}):null,l.jsxs("div",{className:"w-full flex flex-col",children:[B&&i&&l.jsxs("div",{className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1",children:[l.jsxs("h1",{className:F("mb-1 min-w-0 font-inter text-neutral-600 font-medium text-xs flex items-center gap-0.5 flex-wrap",C),children:[l.jsx(Qt,{label:i||"",required:a||!1,isRequiredConditional:s||!1}),N&&l.jsx(ce.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),f&&!zt(p)&&l.jsx(En,{}),l.jsx(Zr,{labels:d||[]}),x&&l.jsx(Te,{placement:"top",title:x,children:l.jsx("div",{className:"cursor-pointer",children:l.jsx(Kr,{})})})]}),l.jsxs("div",{className:"flex items-center gap-1 justify-self-end",children:[zt(p)&&m?l.jsx(Te,{placement:"top-end",title:b??"",hideTooltip:b==null,className:"cursor-pointer",children:l.jsxs("div",{className:F("inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5",ei(m)),onClick:()=>g?.(y),children:[l.jsx(fn,{size:12,fill:kn(m),fillSecondary:wn(m)}),l.jsxs("span",{className:F("text-xs font-medium leading-4",ti(m)),children:[p,"%"]})]})}):null,t&&G?I?I(te):l.jsx("button",{id:"btn-toggle-add-to-document",className:"cursor-pointer",onClick:te,type:"button",children:l.jsx(Ze.Tooltip,{placement:"top",title:V("Add to document"),children:l.jsx(ce.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})]}),R&&l.jsx(ne,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:R}),l.jsxs("div",{className:"flex",children:[Y&&l.jsx(ne,{size:"small",variant:"medium",className:F("mr-2 text-neutral-700 dark:text-black-200",C),appearance:"custom",children:i}),l.jsxs("label",{className:F("relative inline-flex items-center",re||u?"":"w-min",ee?"cursor-not-allowed opacity-50":"cursor-pointer"),onClick:oe=>oe.stopPropagation(),children:[l.jsx("input",{ref:z,type:"checkbox",id:r,onChange:oe=>!ee&&n(oe.target.checked),value:"",disabled:ee,checked:e,className:F("sr-only peer w-full",v),"aria-required":a,"aria-invalid":P&&L==="error"?"true":"false","aria-describedby":P||R?`${r}-description`:void 0}),l.jsx("div",{className:gD(e,c,ee,H),children:c?l.jsx("div",{className:"flex items-center justify-center h-full w-full",children:l.jsx("div",{className:F("z-10 transition-all transform",H==="small"&&(e?"translate-x-2":"translate-x-[-6px]"),H==="medium"&&(e?"translate-x-[8.5px]":"translate-x-[-8px]"),H==="large"&&(e?"translate-x-2.5":"translate-x-[-10px]")),children:e?E?.checkedIcon?E.checkedIcon:l.jsx(bD,{size:18,fill:"#016DCF"}):E?.uncheckedIcon?E.uncheckedIcon:l.jsx(xD,{size:18,fill:"#101828"})})}):null}),W&&l.jsx(Te,{placement:"top",title:W,className:"-ml-2",children:l.jsx("span",{className:F("absolute inset-y-0 left-0",H==="small"&&"w-7",H==="medium"&&"w-9",H==="large"&&"w-11")})}),re&&l.jsx(ne,{size:"small",variant:"medium",className:F("ml-2 text-neutral-700 dark:text-black-300",C),appearance:"custom",children:i}),o?null:l.jsx(ne,{size:"small",variant:"medium",className:"ml-2 text-neutral-900 dark:text-black-100",appearance:"custom",children:u||(e?"Yes":"No")})]})]}),l.jsx(Ve.AnimatePresence,{children:P&&l.jsx(Ve.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${r}-description`,role:L==="error"?"alert":void 0,children:l.jsx(ne,{className:F("mt-1",$()),appearance:"custom",size:"extra-small",variant:"medium",children:P})})}),R&&!P&&l.jsx("div",{id:`${r}-description`,className:"sr-only",children:R})]})]})});Zn.displayName="Toggle";const _D=t=>{try{return JSON.parse(t)}catch{return null}},yD=t=>{let e="";const r="0123456789abcdef";for(let n=0;n<t;n++)e+=r.charAt(Math.floor(Math.random()*r.length));return e},vD=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),SD=t=>{const e=[...t].sort((n,i)=>n.length-i.length),r=[];for(const n of e)r.some(a=>n!==a&&n.startsWith(a+"."))||r.push(n);return r},Ua=t=>{let e="";if(t){let r=0;Object.keys(t).forEach(n=>{if(t[n]!==void 0&&t[n]!==null&&t[n]!==""){let i=t[n];typeof i=="object"?i=JSON.stringify(i):Array.isArray(i)&&(i=i.join(",")),i!=null&&i!==""&&(r===0?e+=`?${n}=${encodeURIComponent(i)}`:e+=`&${n}=${encodeURIComponent(i)}`,r+=1)}})}return e},dS=({shortcuts:t,variant:e="dark",className:r})=>{const i=il()==="macos",a=h.useMemo(()=>t.map(s=>{const o=Gu[s];return o?i?o.macos:o.other:s}),[t,i]);return l.jsx("div",{className:F("flex flex-1 gap-1",r),children:a.map((s,o)=>l.jsx("kbd",{className:F("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))})},ED=({className:t="",fill:e="var(--color-primary-600)",size:r=24})=>l.jsx("svg",{className:t,width:r,height:r,viewBox:"0 0 20 20",fill:e,xmlns:"http://www.w3.org/2000/svg",children:l.jsx("g",{mask:"url(#mask0_6752_28309)",children:l.jsx("path",{d:"M8.33317 11.3333L13.2498 6.41667C13.4026 6.26389 13.5971 6.1875 13.8332 6.1875C14.0693 6.1875 14.2637 6.26389 14.4165 6.41667C14.5693 6.56944 14.6457 6.76389 14.6457 7C14.6457 7.23611 14.5693 7.43056 14.4165 7.58333L8.9165 13.0833C8.74984 13.25 8.55539 13.3333 8.33317 13.3333C8.11095 13.3333 7.9165 13.25 7.74984 13.0833L5.58317 10.9167C5.43039 10.7639 5.354 10.5694 5.354 10.3333C5.354 10.0972 5.43039 9.90278 5.58317 9.75C5.73595 9.59722 5.93039 9.52083 6.1665 9.52083C6.40262 9.52083 6.59706 9.59722 6.74984 9.75L8.33317 11.3333Z",fill:e})})}),Er=({id:t,onClick:e,icon:r,text:n,className:i,isDisabled:a,onClose:s,notVisible:o,hideHoverEffect:A,leadingIcon:u,suffixRecord:c,stopPropagation:d,onToggle:f,isChecked:p=!1,highlight:m,truncateText:b=!1,showTick:y=!1,width:g="100%",tooltip:x,isFlowAvailable:v=!0,shortcuts:S,textClassName:k,chevron:E})=>{const w=h.useCallback(D=>{s&&s(),D.preventDefault(),e?.(D),d&&D.stopPropagation()},[s,e,d]),T=(D,R)=>{if(!R||!D||typeof D!="string"&&typeof D!="number")return D;const H=vD(R),I=new RegExp(`(${H?.trim()})`,"gi"),M=D?.toString()?.split(I);return l.jsxs("span",{className:"overflow-clip text-ellipsis",children:[M[0],l.jsx("span",{className:"bg-yellow-300 dark:bg-primary-100 dark:text-black-900 rounded-sm",children:M[1]}),M?.slice(2)?.join("")]})},O=h.useCallback(D=>{f?.(),D.stopPropagation()},[f]),C=["delete","remove","clear","terminate session","terminate sessions","terminate all sessions","trash"].some(R=>n?.toLowerCase().includes(R)),N=a||!v;if(o)return null;const P=!!(e||f),L=P?"button":"div";return l.jsx(L,{id:t,className:F("w-full p-1 bg-white dark:bg-black-800 group",i,N&&"opacity-60"),...P?{onClick:f?()=>null:w,disabled:N}:{},onMouseMove:D=>D.stopPropagation(),children:l.jsxs("div",{className:F("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",!A&&"hover:bg-gray-50 dark:hover:bg-black-600 hover:shadow-md dark:hover:shadow-lg dark:hover:shadow-primary-500/20"),children:[r?l.jsx("div",{className:F("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:l.jsx(Te,{placement:"top",title:x,children:r})}):null,l.jsxs("div",{className:"flex gap-2 flex-1 min-w-0 text-left justify-between items-center",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx("div",{className:F("min-w-0",b&&"max-w-[150px]"),style:{width:g},children:l.jsx(ne,{className:F("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",k),appearance:"custom",children:m?T(n,m):n})}),S?l.jsx("div",{className:"flex items-center flex-shrink-0",children:l.jsx(dS,{variant:"light",shortcuts:S})}):null]}),c?.[n]||y?l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[c?.[n]?l.jsx("span",{className:"flex-shrink-0 text-neutral-500 dark:text-neutral-200 bg-neutral-100 dark:bg-black-700 border-[#D0D5DD] dark:border-black-700 text-xs leading-[18px] font-normal border rounded-full px-2 py-0.5",children:c[n]||""}):null,y?l.jsx("div",{className:"flex-shrink-0",children:l.jsx(ED,{fill:"var(--color-primary-600)"})}):null]}):null]}),u?l.jsx(l.Fragment,{children:x?l.jsx(Te,{placement:"top",title:x,children:l.jsx("div",{className:F("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})}):l.jsx("div",{className:F("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,f?l.jsx("div",{className:"flex-shrink-0",children:l.jsx(Zn,{onChange:O,isChecked:p,isDisabled:a,hideStatus:!0})}):null,E?l.jsx("div",{className:F("flex-shrink-0 flex items-center text-neutral-500 dark:text-neutral-400 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:E}):null]})})};Er.displayName="OptionButton";const is=(t,e)=>{const r=t.slice(0,2),n=rl[r];return n?l.jsx("div",{className:`
|
|
50
|
+
`,document.head.appendChild(De)},[]);const ve=()=>{if(B){let ge="";_e==null?ge="":typeof _e=="string"||typeof _e=="number"?ge=String(_e):Array.isArray(_e)?ge=_e.map(Le=>typeof Le=="object"&&Le!==null&&"value"in Le?Le.value:Le).join(", "):typeof _e=="object"&&"value"in _e&&(ge=String(_e.value)),B({key:x,value:ge})}},_e=cD(e),ue=h.useMemo(()=>S?NN(S,k):null,[S,k]),Q=(ge,De)=>{if(je.current&&G.id){const Le=document.getElementById(G.id);if(Le){const Ye=Array.isArray(De)?De.map(et=>et.value):De?.value;Le.dataset.selectedValue=JSON.stringify(Ye);const lt=new Event("change",{bubbles:!0});Object.defineProperty(lt,"target",{writable:!1,value:Le}),Le.dispatchEvent(lt);const nt=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${G.id}`,value:Ye,type:"change"}});Le.dispatchEvent(nt)}}if(r==="tags"){const Le=Array.isArray(ge)?ge:[ge];v?.(Le?.map(Ye=>({label:Ye,value:Ye})))}else v?.(De)},se=fD({options:i,value:e,defaultValue:G?.defaultValue}),ke=h.useMemo(()=>se.length>0||_e!=null,[se,_e]),ze=h.useMemo(()=>{if(!r||r!=="multiple"||se.length===0)return!1;const ge=Array.isArray(_e)?_e:[];return se.map(Le=>Le.value).every(Le=>ge.some(Ye=>typeof Ye=="object"&&Ye!==null&&"value"in Ye?String(Ye.value)===String(Le):String(Ye)===String(Le)))},[_e,se,r]),Ge=()=>{!r||r!=="multiple"||!v||v(ze?[]:se)},Je=h.useCallback(ge=>{if(!ge)return;const De=new Event("submit",{bubbles:!0,cancelable:!0});ge.dispatchEvent(De);const Le=ge.querySelector('button[type="submit"]');Le&&Le.click()},[]),Ue=h.useCallback(ge=>{if(ge.key==="Enter"&&!ye&&(ge.preventDefault(),ge.stopPropagation(),_e)){const De=ge.currentTarget.closest("form");Je(De)}},[ye,_e,Je]),we=h.useCallback(ge=>{const{label:De,value:Le,onClose:Ye}=ge,nt=se.find(Xe=>String(Xe.value)===String(Le))?.color||"primary",et=Xe=>{Xe.preventDefault(),Xe.stopPropagation()};return l.jsx("div",{className:"cursor-pointer me-1 inline-flex",children:l.jsx(dr,{label:De,color:nt,size:"sm",onMouseDown:et,onClick:R?void 0:Ye,isHashColor:!0,removable:!0,onRemove:Ye})})},[se,R]),Pe=h.useCallback(ge=>{pe(ge),(A||ue)?.(ge)},[A,ue]);return l.jsxs("div",{ref:K,className:F("flex gap-0.5 w-full relative",$&&g?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>oe(!0),onMouseLeave:()=>oe(!1),id:G.id,children:[g&&!$?l.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,l.jsxs("div",{className:F("w-full flex flex-col gap-1 risk-analysis-select-field",o),onMouseDown:ge=>ge.stopPropagation(),onKeyDownCapture:Ue,role:"group","aria-labelledby":t?"select-field-label":void 0,children:[t?l.jsx("label",{id:"select-field-label",htmlFor:"label",className:`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${c?"":"capitalize"} ${I||""}`,children:l.jsxs("div",{className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1",children:[l.jsxs("div",{className:"inline-flex min-w-0 items-center gap-1 flex-wrap",children:[l.jsx(Qt,{label:t||"",required:a||!1,isRequiredConditional:Y||!1}),re&&l.jsx(ce.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),d&&!zt(f)&&l.jsx(En,{}),l.jsx(Zr,{labels:s}),u&&l.jsx(Te,{placement:"top",title:u,children:l.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onKeyDown:ge=>{(ge.key==="Enter"||ge.key===" ")&&ge.preventDefault()},children:l.jsx(Kr,{})})})]}),l.jsxs("div",{className:"flex items-center gap-1 justify-self-end",children:[zt(f)&&p?l.jsx(Te,{placement:"top-end",title:m??"",hideTooltip:m==null,className:"cursor-pointer",children:l.jsxs("div",{className:F("inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5",ei(p)),onClick:()=>y?.(b),children:[l.jsx(fn,{size:12,fill:kn(p),fillSecondary:wn(p)}),l.jsxs("span",{className:F("text-xs font-medium leading-4",ti(p)),children:[f,"%"]})]})}):null,g&&$?l.jsx("button",{id:"btn-select-field-base-add-to-document",className:"cursor-pointer",onClick:ve,type:"button",children:l.jsx(Te,{placement:"top",title:te("Add to document"),children:l.jsx(ce.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})]})}):null,l.jsx(Ze.Select,{onOpenChange:me,disabled:R,className:`w-full text-black-900 dark:text-black-200 ${n&&a?"ant-select-status-error":"#e2e8f0"} ${z&&M?.color?"risk-select-field":""}`,classNames:{popup:{root:"!z-[5001]"}},style:{width:"100%","--risk-color":z&&M?.hexBgColor?M?.hexBgColor:"","--risk-border-color":z&&M?.hexBorderColor?M?.hexBorderColor:""},"aria-required":a,mode:r,value:_e,onChange:Q,filterOption:S?E:(ge,De)=>(De?.label||"")?.toLowerCase()?.includes(ge?.toLowerCase()),showSearch:!0,onSearch:Pe||void 0,onPopupScroll:w,popupClassName:"select-field-dropdown-popup",popupRender:ge=>l.jsx(hD,{showSelectAll:H,mode:r,options:se,searchValue:fe,handleSelectAll:Ge,isAllSelected:ze,menu:ge,isLoading:T,hasExistingData:ke,t:te}),options:se.map(({label:ge,value:De,color:Le,...Ye})=>({label:String(ge),value:String(De),key:String(De),id:String(De),color:Le,...Ye})),optionRender:ge=>{const De=ge?.data?.fullname;if(De&&W){const[Le,Ye]=De.split(" ");return l.jsxs("div",{className:"flex items-center justify-start gap-1",children:[l.jsx(W,{firstName:Le,lastName:Ye,profilePic:ge?.data?.url||"",size:"xs",enablePopper:!0,userId:ge?.data?.value}),l.jsx("span",{className:"ml-2",children:ge.label})]})}return l.jsx("span",{children:ge.label})},autoClearSearchValue:C,onClear:()=>v&&v(r==="tags"||r==="multiple"?[]:null),maxTagCount:r==="tags"&&P?void 0:"responsive",maxTagPlaceholder:ge=>l.jsx(Te,{placement:"top",title:ge.length>3?ge.slice(0,3).map(({label:De})=>De).join(", ")+"...":ge.map(({label:De})=>De).join(", "),children:l.jsxs("span",{children:["+",ge.length," more"]})}),tagRender:L||we,allowClear:O,...G}),n&&l.jsx(ne,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:n})]}),$&&M&&z&&V&&l.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:ge=>ge.stopPropagation(),onMouseDown:ge=>ge.preventDefault(),onKeyDown:ge=>{ge.key==="Escape"&&oe(!1)},children:l.jsx(V,{riskDetails:M})})]})});al.displayName="SelectField";const sS=h.forwardRef(({id:t,label:e,checked:r,isChecked:n,onChange:i,disabled:a=!1,required:s=!1,message:o,messageType:A="default",wrapperClassName:u,checkboxClassName:c,labelClassName:d,size:f="medium",variant:p="default",labelPosition:m="right",checkboxProps:b},y)=>{const g=r!==void 0?r:n||!1,x=()=>{switch(f){case"small":return"w-3 h-3";case"large":return"w-5 h-5";default:return"w-4 h-4"}},v=()=>{if(A==="error")return"text-red-600 border-red-300 focus:ring-red-500 dark:focus:ring-red-600";if(A==="success")return"text-green-600 border-green-300 focus:ring-green-500 dark:focus:ring-green-600";if(A==="info")return"text-blue-600 border-blue-300 focus:ring-blue-500 dark:focus:ring-blue-600";switch(p){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"}},S=()=>A==="error"?"text-red-500 dark:text-red-400":A==="success"?"text-green-500 dark:text-green-400":A==="info"?"text-blue-500 dark:text-blue-400":"text-neutral-500 dark:text-neutral-400",k=()=>{switch(f){case"small":return"extra-small";case"large":return"medium";default:return"small"}},E=O=>{i(O.target.checked,O)},w=l.jsx(Ze.Checkbox,{...b,ref:y,id:t,checked:g,onChange:E,disabled:a,className:F("rounded focus:ring-2 focus:ring-primary-500 dark:focus:ring-primary-400 focus:ring-offset-gray-800 transition-colors duration-200",x(),v(),a&&"opacity-50 cursor-not-allowed",c),"aria-required":s,"aria-invalid":o&&A==="error"?"true":"false","aria-describedby":o?`${t}-message`:void 0}),T=e?l.jsx("label",{htmlFor:t,className:F("font-medium cursor-pointer transition-colors duration-200",a?"text-neutral-400 dark:text-neutral-600 cursor-not-allowed":"text-neutral-900 dark:text-neutral-100",m==="right"?"ml-2":"mr-2",d),children:l.jsxs(ne,{variant:"medium",size:k(),appearance:"body",children:[e,s&&l.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})}):null;return l.jsxs("div",{className:F("flex flex-col",u),children:[l.jsx("div",{className:F("flex items-center",m==="left"&&"flex-row-reverse justify-end"),children:m==="left"?l.jsxs(l.Fragment,{children:[w,T]}):l.jsxs(l.Fragment,{children:[w,T]})}),l.jsx(Ve.AnimatePresence,{children:o&&l.jsx(Ve.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${t}-message`,role:A==="error"?"alert":void 0,children:l.jsx(ne,{className:F("mt-1",S()),appearance:"custom",size:"extra-small",variant:"medium",children:o})})})]})});sS.displayName="Checkbox";const oS=({label:t,isChecked:e,onChange:r,id:n,...i})=>l.jsxs("div",{className:"flex items-center",children:[l.jsx(Ze.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",...i}),l.jsx("label",{className:"ml-2 text-sm font-medium text-neutral-900 dark:text-neutral-100",children:t})]}),lS=h.forwardRef(({id:t,label:e,value:r,defaultValue:n="#000000",onChange:i,onColorChange:a,disabled:s=!1,required:o=!1,message:A,messageType:u="default",wrapperClassName:c,inputClassName:d,labelClassName:f,size:p="medium",showValue:m=!1,valueFormat:b="hex",inputProps:y,helpText:g},x)=>{const v=h.useRef(null),S=x||v,k=h.useCallback(()=>{requestAnimationFrame(()=>{S.current?.focus()})},[S]),E=h.useCallback(H=>{if(H.key==="Enter"&&!H.shiftKey){H.preventDefault();const I=H.target.closest("form");if(I){const M=I.querySelector('button[type="submit"]');M?M.click():I.requestSubmit()}}y?.onKeyDown?.(H)},[y]),w=r!==void 0?r:n,T=()=>{switch(p){case"small":return"w-8 h-8";case"large":return"w-16 h-16";default:return"w-12 h-12"}},O=()=>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",C=()=>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(p){case"small":return"extra-small";case"large":return"medium";default:return"small"}},P=H=>{const I=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(H);if(!I)return H;const M=parseInt(I[1],16),z=parseInt(I[2],16),V=parseInt(I[3],16);return`rgb(${M}, ${z}, ${V})`},L=H=>{const I=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(H);if(!I)return H;const M=parseInt(I[1],16)/255,z=parseInt(I[2],16)/255,V=parseInt(I[3],16)/255,X=Math.max(M,z,V),ee=Math.min(M,z,V);let W=0,B=0;const Y=(X+ee)/2;if(X!==ee){const re=X-ee;switch(B=Y>.5?re/(2-X-ee):re/(X+ee),X){case M:W=(z-V)/re+(z<V?6:0);break;case z:W=(V-M)/re+2;break;case V:W=(M-z)/re+4;break}W/=6}return`hsl(${Math.round(W*360)}, ${Math.round(B*100)}%, ${Math.round(Y*100)}%)`},D=()=>{switch(b){case"rgb":return P(w);case"hsl":return L(w);default:return w.toUpperCase()}},R=H=>{const I=H.target.value;i(I,H),a?.(I)};return l.jsxs("div",{className:F("flex flex-col w-full",c),children:[e&&l.jsx("label",{htmlFor:t,className:F("mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",f),children:l.jsx("div",{className:"flex flex-wrap items-center justify-between w-full",children:l.jsx("div",{className:"inline-flex flex-wrap items-center gap-1",children:l.jsxs(ne,{variant:"medium",size:N(),appearance:"subtitle",children:[e,o&&l.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})})})}),g&&l.jsx(ne,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:g}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"relative",children:l.jsx("input",{...y,ref:S,onBlur:k,onKeyDown:E,type:"color",id:t,value:w,onChange:R,disabled:s,required:o,className:F("border rounded-md cursor-pointer transition-all duration-200","focus:outline-none focus:ring-2",T(),C(),s&&"opacity-50 cursor-not-allowed",d),style:{backgroundColor:w},"aria-required":o,"aria-invalid":A&&u==="error"?"true":"false","aria-describedby":A||g?`${t}-description`:void 0})}),m&&l.jsx("div",{className:"flex-1",children:l.jsx(ne,{variant:"medium",size:"small",appearance:"body",className:"font-mono text-neutral-700 dark:text-neutral-300",children:D()})})]}),l.jsx(Ve.AnimatePresence,{children:A&&l.jsx(Ve.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${t}-description`,role:u==="error"?"alert":void 0,children:l.jsx(ne,{className:F("mt-1",O()),appearance:"custom",size:"extra-small",variant:"medium",children:A})})}),g&&!A&&l.jsx("div",{id:`${t}-description`,className:"sr-only",children:g})]})});lS.displayName="ColorPicker";const kb=()=>{const[t,e]=h.useState(!1);return h.useEffect(()=>{const r=()=>{e(document.documentElement.classList.contains("dark"))};r();const n=new MutationObserver(i=>{i.forEach(a=>{a.attributeName==="class"&&r()})});return n.observe(document.documentElement,{attributes:!0}),()=>n.disconnect()},[]),t},AS=({id:t,label:e,errorMessage:r,selectOptions:n,loading:i,isClearable:a,multiSelect:s,selectedValues:o,disabled:A,required:u,value:c,className:d,tooltip:f,tags:p,originalCase:m=!1,onChange:b,filterOption:y,placeholder:g,...x})=>{const v=kb(),[S,k]=h.useState(!1),E=(D,R)=>{b&&b(D);const H=document.getElementById(t);if(H){const I=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${t}`,value:D,type:"change"}});H.dispatchEvent(I)}},w={control:(D,R)=>({...D,borderColor:r&&u?v?"#F04438":"#fda49b":R.isFocused?"var(--color-primary-600)":v?"#434343":"#d9d9d9",backgroundColor:v?"#141414":R.isDisabled?"#f5f5f5":"#fff",borderRadius:"6px",minHeight:"32px",fontSize:"14px",padding:"0 4px 0 12px",opacity:R.isDisabled?.6:1,cursor:R.isDisabled?"not-allowed":"pointer",boxShadow:R.isFocused?v?"0 0 0 1.5px var(--color-primary-950)":"0 0 0 1.5px var(--color-primary-100)":"none","&:hover":{borderColor:r&&u?v?"#F04438":"#fda49b":"var(--color-primary-600)"}}),valueContainer:D=>({...D,fontSize:"14px",padding:0}),input:D=>({...D,margin:"0",padding:"0",color:v?"rgba(255,255,255,0.85)":"inherit"}),indicatorsContainer:D=>({...D,padding:0}),option:(D,R)=>({...D,fontSize:"14px",lineHeight:"22px",padding:"5px 12px",margin:0,backgroundColor:R.isSelected?v?"var(--color-primary-975)":"var(--color-primary-50)":R.isFocused?v?"var(--color-primary-950)":"var(--color-primary-100)":v?"#141414":"#fff",color:R.isDisabled?v?"rgba(255,255,255,0.25)":"#a3a3a3":v?R.isSelected?"var(--color-primary-600)":"rgba(255,255,255,0.85)":"rgba(0,0,0,0.88)",cursor:R.isDisabled?"not-allowed":"pointer",opacity:R.isDisabled?.6:1,"&:hover":{backgroundColor:R.isDisabled?v?"#141414":"#fff":v?"var(--color-primary-950)":"var(--color-primary-100)"},"&:active":{backgroundColor:v?"var(--color-primary-950)":"var(--color-primary-50)"}}),singleValue:(D,R)=>({...D,fontSize:"14px",lineHeight:"20px",color:R.isDisabled?v?"rgba(255,255,255,0.25)":"#a3a3a3":v?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.88)"}),placeholder:D=>({...D,fontSize:"14px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:v?"rgba(255,255,255,0.25)":"#bfbfbf"}),multiValue:D=>({...D,backgroundColor:v?"rgba(255,255,255,0.08)":"#f0f5ff",border:v?"1px solid transparent":"1px solid #adc6ff",borderRadius:"4px"}),multiValueLabel:D=>({...D,color:v?"rgba(255,255,255,0.85)":"var(--color-primary-600)",fontSize:"12px"}),multiValueRemove:D=>({...D,color:v?"rgba(255,255,255,0.85)":"var(--color-primary-600)","&:hover":{backgroundColor:v?"rgba(255,255,255,0.16)":"#e6f4ff",color:v?"#fff":"var(--color-primary-600)"}}),menu:D=>({...D,zIndex:5001,borderRadius:"8px",boxShadow:v?"0 6px 16px 0 rgba(0,0,0,0.45)":"0 6px 16px 0 rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12), 0 9px 28px 8px rgba(0,0,0,0.05)",backgroundColor:v?"#141414":"#fff",border:v?"1px solid #303030":"none",overflow:"hidden"}),menuList:D=>({...D,padding:"0",maxHeight:"256px"})},T=!!o?.length,N=S&&!A&&(a?T||!!c:!1),P=D=>{D.stopPropagation(),D.preventDefault(),E(s?[]:null)},L=()=>l.jsx("div",{className:"flex items-center",children:N?l.jsx(ce.CancelRounded,{onClick:P,sx:{fontSize:"16px",cursor:"pointer",color:v?"rgba(255,255,255,0.45)":"rgba(0,0,0,0.25)","&:hover":{color:v?"rgba(255,255,255,0.65)":"rgba(0,0,0,0.45)"}}}):l.jsx(ce.ChevronLeftRounded,{className:"-rotate-90",sx:{fontSize:"18px",color:v?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.25)"}})});return l.jsxs("div",{id:t,className:F("w-full flex flex-col gap-1",d),onMouseDown:D=>D.stopPropagation(),role:"group","aria-labelledby":e?t+"Label":void 0,children:[e&&l.jsxs("label",{id:t+"Label",htmlFor:"text",className:`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${m?"":"capitalize"}`,children:[l.jsx(Qt,{label:e||"",required:u||!1}),l.jsx(Zr,{labels:p}),f&&l.jsx(Ze.Tooltip,{placement:"top",title:f,children:l.jsx("div",{className:"cursor-pointer",children:l.jsx(Kr,{})})})]}),l.jsx("div",{onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:l.jsx(DN,{...x,id:"cm"+e,classNamePrefix:"lax-select",required:u,options:n,isClearable:!1,isLoading:i,isDisabled:A,styles:w,isMulti:s,value:s?o:c,onChange:E,filterOption:y,placeholder:g,classNames:{menuList:()=>"nowheel"},components:{DropdownIndicator:L,IndicatorSeparator:()=>null}})}),r&&l.jsx(ne,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:r})]})};AS.displayName="CreatableSelectField";const Yu=({ref:t,handler:e,enabled:r=!0})=>{h.useEffect(()=>{if(!r)return;const n=i=>{t.current&&!t.current.contains(i.target)&&e()};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[t,e,r])},mD={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"},uS=({id:t,label:e,options:r,placeholder:n,onChange:i,isLoading:a=!1,hideLabel:s=!1,errorMessage:o,required:A=!1,optionConfig:u,menuConfig:c,value:d,isMulti:f=!1,isClearable:p=!0,disabled:m=!1,className:b,isDark:y=!1,primaryColorShades:g=mD})=>{const x=h.useRef(null),[v,S]=h.useState(null),[k,E]=h.useState("");Yu({ref:x,handler:()=>{S(null)}});const w={control:(L,D)=>({...L,borderColor:o&&A?"#F04438":D.isFocused?y?g[400]:g[600]:y?"#1e1e1e":"#e2e8f0",backgroundColor:D.isDisabled?y?"#1a1a1a":"#f5f5f5":y?"#262626":"#FFFFFF",color:D.isDisabled?y?"#666666":"#a0a0a0":y?"#d4d4d4":"#0F172A",borderRadius:"6px",minHeight:"32px",fontSize:"14px",padding:"0px 10px",cursor:D.isDisabled?"not-allowed":"default",opacity:(D.isDisabled,1),boxShadow:D.isFocused?y?`0 0 0 3px ${g[950]}`:`0 0 0 3px ${g[100]}`:"none"}),valueContainer:L=>({...L,fontSize:"14px",maxHeight:"60px",overflowY:"auto",padding:"0px",margin:"0px",color:y?"#d4d4d4":"inherit","::-webkit-scrollbar":{display:"none"}}),input:L=>({...L,margin:"0"}),indicatorSeparator:()=>({display:"none"}),option:L=>({...L,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":g[50]},".icon":{height:"14px",width:"14px"}}),singleValue:(L,D)=>({...L,fontWeight:500,fontSize:"14px",lineHeight:"1.25rem",color:(D.isDisabled,y?"#d4d4d4":"#0F172A"),display:"flex",alignItems:"center",".icon":{height:"14px",width:"14px"}}),placeholder:(L,D)=>({...L,fontSize:"14px",fontWeight:500,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:(D.isDisabled,y?"#595959":"#9CA3AF")}),multiValue:L=>({...L,backgroundColor:y?"#000000":g[50],borderRadius:"6px",fontFamily:"Inter",fontSize:"12px",height:"20px",alignItems:"center"}),indicatorsContainer:L=>({...L,padding:"0",height:"30px"}),multiValueLabel:L=>({...L,color:y?"#d4d4d4":g[600],fontSize:"12px"}),multiValueRemove:L=>({...L,color:y?"#d4d4d4":g[600],height:"12px",fontSize:"8px",":hover":{backgroundColor:y?"#171717":g[50]},svg:{height:"12px",width:"12px"}})},T=L=>{const D=r.filter(R=>R?.label?.toLowerCase()?.includes(k?.toLowerCase()));return l.jsx(zl.components.MenuList,{...L,className:F("!z-50 rounded !visible overflow-x-scroll",y?"bg-black-800":"bg-white",y?"text-neutral-300":"text-navy-900",c?.className),ref:x,children:D?.length?D.map((R,H)=>l.jsxs("div",{className:F("item z-[9999] flex items-center justify-between px-4 py-1.5 no-wheel",m?"cursor-not-allowed opacity-50":"cursor-pointer",y?"text-neutral-300":"text-navy-900",!m&&O(R)?y?"bg-black-700":"bg-primary-50":m?"":y?"hover:bg-black-700":"hover:bg-primary-50",c?.optionClassName?"":y?"border-b border-black-700":"border-b border-[#eee]"),onClick:I=>{m||(I.stopPropagation(),L.selectOption(R))},children:[u?.component?l.jsx(u.component,{...u.componentProps,...R}):l.jsx("div",{children:R.label}),l.jsx("div",{className:"flex items-center gap-1",children:O(R)&&u?.selectIndecator?u?.selectIndecator:null})]},H)):l.jsx("div",{className:F("opacity-50 flex justify-center items-center p-1 font-medium",y?"text-neutral-400":"text-gray-700"),children:"No options"})})},O=L=>f?v?.some(D=>D.value===L.value):L.value===v?.value,C=L=>{const{children:D,innerProps:R,isDisabled:H,getValue:I}=L,M=I();return l.jsx(zl.components.SingleValue,{...L,innerProps:R,isDisabled:H,children:M.length>0?M.map((z,V)=>l.jsx("span",{children:u?.component?l.jsx(u.component,{...u.componentProps,...z}):l.jsx("div",{children:z.label})},V)):l.jsx(l.Fragment,{children:D})})},N=L=>{const{innerProps:D,isDisabled:R,data:H}=L;return l.jsx(zl.components.MultiValue,{...L,innerProps:D,isDisabled:R,children:u?.component?l.jsx(u.component,{...u.componentProps,...H}):l.jsx("div",{children:H.label})})},P=(L,D)=>(E(D),!0);return l.jsxs("div",{className:F("flex flex-col",y?"text-black-300":"text-navy-900",a?"opacity-50":"opacity-100",m?"cursor-not-allowed":""),id:t,children:[s||!e?null:l.jsx(Qt,{label:e||"",required:A||!1}),l.jsx(zl,{required:!0,classNamePrefix:"lax-select",options:r,placeholder:n,value:d,onChange:L=>{S(L),i(L)},styles:w,isMulti:f,className:F(y&&"bg-black-800 border-black-700",b),components:{MenuList:T,SingleValue:C,MultiValue:N},filterOption:P,closeMenuOnSelect:!0,isClearable:p,isDisabled:m}),o&&l.jsx(ne,{className:F("mt-1",y?"text-red-400":"text-red-500"),appearance:"custom",size:"extra-small",variant:"medium",children:o})]})};uS.displayName="CustomizableSelectField";const KA=[{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:"$"},ZA=({classValue:t,size:e=24,fill:r="currentColor",...n})=>l.jsxs("svg",{className:F(t),width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[l.jsx("rect",{width:"12",height:"12",rx:"6",fill:r}),l.jsx("g",{clipPath:"url(#clip0_8212_362816)",children:l.jsx("path",{d:"M8.10023 3.90357C7.97023 3.77357 7.76023 3.77357 7.63023 3.90357L6.00023 5.53023L4.37023 3.90023C4.24023 3.77023 4.03023 3.77023 3.90023 3.90023C3.77023 4.03023 3.77023 4.24023 3.90023 4.37023L5.53023 6.00023L3.90023 7.63023C3.77023 7.76023 3.77023 7.97023 3.90023 8.10023C4.03023 8.23023 4.24023 8.23023 4.37023 8.10023L6.00023 6.47023L7.63023 8.10023C7.76023 8.23023 7.97023 8.23023 8.10023 8.10023C8.23023 7.97023 8.23023 7.76023 8.10023 7.63023L6.47023 6.00023L8.10023 4.37023C8.2269 4.24357 8.2269 4.03023 8.10023 3.90357Z",fill:"#98A2B3"})}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_8212_362816",children:l.jsx("rect",{width:"8",height:"8",fill:"white",transform:"translate(2 2)"})})})]});ZA.displayName="CloseRounded";const cS=({width:t=15,height:e=15,fill:r="#98A2B3",className:n})=>l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:t.toString(),height:e.toString(),viewBox:"0 0 20 20",fill:"none",className:n,children:l.jsx("path",{d:"M17.5 17.5L12.5001 12.5M14.1667 8.33333C14.1667 11.555 11.555 14.1667 8.33333 14.1667C5.11167 14.1667 2.5 11.555 2.5 8.33333C2.5 5.11167 5.11167 2.5 8.33333 2.5C11.555 2.5 14.1667 5.11167 14.1667 8.33333Z",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),Zu=t=>{const{value:e,placeholder:r,onChange:n,id:i,debounceTimeout:a=0,classValues:s,handleKeyDown:o,isClearable:A,onFocusText:u,autoComplete:c="false",searchRef:d,hasNavigation:f=!1,autoFocus:p=!1,searchConfig:m,hideSearchIcon:b,allowAStarSearch:y=!1,...g}=t,{t:x}=Xt.useTranslation(),[v,S]=h.useState(!1),[k,E]=h.useState("search"),w=h.useRef(null),{searchCount:T,searchPointer:O,setSearchPointer:C}=m||{},N=()=>{const D=A&&!!e,R=f&&!!e;return D&&R?"pr-28":R?"pr-12":D?"pr-8":"pr-7"},P=()=>{S(!0),E(u||r||x("Search"));const D=d||w;D.current&&D.current.focus()},L=()=>{S(!1),E("")};return l.jsxs("label",{className:F("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&&l.jsx("div",{className:"flex items-center h-6 w-6 pointer-events-none",children:l.jsx(cS,{width:"16",height:"16"})}),l.jsx(bb.DebounceInput,{...g,spellCheck:"false",debounceTimeout:a,id:i,inputRef:d||w,type:"text",className:F(`absolute inset-0 dark:text-[#98A2B3] text-neutral-900 ${b?"pl-2":"pl-10"} pl-10 ${N()} 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:v?k:y?"":`${x("Search")}`,onChange:D=>n?.(D.target.value),autoComplete:c,onFocus:D=>{S(!0),P(),t.onFocus&&t.onFocus(D)},onBlur:D=>{S(!1),L(),t.onBlur&&t.onBlur(D)},autoFocus:p}),f&&e&&l.jsxs("div",{className:F("absolute mr-2 focus:outline-none flex gap-1",A?"right-6":"right-0"),children:[!!T&&(T||0)>0&&l.jsxs("span",{className:"text-xs border-r pr-2 border-gray-200",children:[(O||0)+1,"/",T]}),l.jsxs("div",{className:"flex gap-1 items-center",children:[l.jsx("button",{id:"btn-search-bar-set-search-pointer-forward",onClick:()=>{C&&C(D=>(D||0)-1)},disabled:O===0,children:l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M15 18l-6-6 6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),l.jsx("button",{id:"btn-search-bar-set-search-pointer-backward",onClick:()=>{C&&C(D=>(D||0)+1)},disabled:O===(T||0)-1,children:l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M9 18l6-6-6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),y&&!(A&&e)&&!v&&!e?l.jsxs("div",{className:"absolute flex ml-6 items-center justify-center focus:outline-none gap-1 flex-wrap-none",children:[l.jsxs(ne,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:[x("Search")," (use"]}),l.jsx("button",{className:" bg-[#EAECF0] dark:bg-black-800 rounded-sm text-sm w-3 h-5",children:l.jsx(Ze.Tooltip,{placement:"bottomRight",color:"#141414",classNames:{root:"custom-tooltip dark:!bg-black-800"},title:l.jsxs("div",{className:"flex flex-col items-start justify-center p-2 w-full h-full gap-2 dark:bg-black-800",children:[l.jsx(ne,{variant:"semibold",size:"extra-small",className:"text-white",children:x("Normal Search")}),l.jsx(ne,{variant:"medium",size:"extra-small",className:"text-primary-400 dark:text-primary-400",appearance:"custom",children:x("Examples")}),l.jsxs("div",{className:"flex flex-col items-start justify-center ",children:[l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ne,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:l.jsx(ne,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:"data"})}),l.jsx(ne,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "data", "Data".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ne,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:l.jsx(ne,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:"text"})}),l.jsx(ne,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "text", "context", "plaintext".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ne,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:l.jsx(ne,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:"base"})}),l.jsx(ne,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "database", "baseball", "basename".'})]})]}),l.jsx("div",{className:"h-[1px] w-full bg-neutral-800 dark:bg-black-200 my-2"}),l.jsx(ne,{variant:"semibold",size:"extra-small",className:"text-white",children:"Wildcard Search"}),l.jsx(ne,{variant:"medium",size:"extra-small",className:"text-white dark:text-black-200",appearance:"custom",children:"Use * as a wildcard to refine your search."}),l.jsx(ne,{variant:"medium",size:"extra-small",className:"text-primary-400 dark:text-primary-400",appearance:"custom",children:"Examples:"}),l.jsxs("div",{className:"flex flex-col items-start justify-center ",children:[l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ne,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:l.jsx(ne,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ",appearance:"custom",children:"contract*"})}),l.jsx(ne,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ "contracts", "contractor", "CONTRACTOR".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ne,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:l.jsx(ne,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ",appearance:"custom",children:"*agreement"})}),l.jsx(ne,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "service agreement", "legal agreement".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ne,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:l.jsx(ne,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:"*clause*"})}),l.jsx(ne,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "clause", "subclause", "clauses".'})]}),l.jsxs("div",{className:"flex items-center justify-center gap-1",children:[l.jsx(ne,{className:"flex-shrink-0",appearance:"custom",children:"•"}),l.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:l.jsx(ne,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:"*l*s*"})}),l.jsx(ne,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "clause", "clauses".'})]})]})]}),children:l.jsx("div",{className:"text-[#475467] dark:text-black-300 dark:bg-black-600",children:"*"})})}),l.jsx(ne,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:"as a wildcard)"})]}):A&&e&&l.jsx("button",{id:"btn-search-bar-close",className:"absolute right-0 mr-2 focus:outline-none",onClick:()=>n?.(""),children:l.jsx(ZA,{classValue:"text-neutral-200 dark:text-black-500",size:16})})]})};var Fa=(t=>(t.LEFT="left",t.RIGHT="right",t.TOP="top",t))(Fa||{});const gD=(t,e,r,n="medium")=>{const i={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"},a={small:"peer-checked:after:translate-x-3",medium:"peer-checked:after:translate-x-full",large:"peer-checked:after:translate-x-5"};return F("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)]",i[n],a[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})},bD=({size:t=18,fill:e="#016DCF"})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:l.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:e})}),xD=({size:t=18,fill:e="#101828"})=>l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:l.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z",fill:e})}),Zn=h.forwardRef(({isGTN:t=!1,isChecked:e,id:r,onChange:n,label:i,required:a,isRequiredConditional:s=!1,hideStatus:o=!1,labelDirection:A=Fa.TOP,statusText:u,withIcon:c=!1,tags:d,isAiExtracted:f=!1,confidenceScore:p,confidenceType:m="high",confidenceTooltip:b,sourceMeta:y=[],onConfidenceScoreClick:g,tooltip:x="",className:v="",disabled:S,isDisabled:k=!1,icon:E,stopClickPropagation:w=!0,gtnName:T,variant:O="primary",labelClassName:C,isLiveField:N=!1,message:P,messageType:L="default",wrapperClassName:D,helpText:R,size:H="medium",renderGTNAddButton:I,onAddGTNToDocument:M},z)=>{const{t:V}=Xt.useTranslation(),X=S??k,ee=!!X,W=typeof X=="string"?X:void 0,B=A===Fa.TOP,Y=A===Fa.LEFT,re=A===Fa.RIGHT,[G,K]=h.useState(!1),te=()=>{M&&M({key:T,value:e?"Yes":"No"})},$=()=>L==="error"?"text-red-500 dark:text-red-400":L==="success"?"text-green-500 dark:text-green-400":L==="info"?"text-primary-500 dark:text-primary-400":"text-neutral-500 dark:text-neutral-400";return l.jsxs("div",{className:F("flex gap-0.5",G&&t?"border rounded-lg border-primary-100 bg-primary-50 p-1":"",D),onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1),onClick:oe=>{w&&oe.stopPropagation()},children:[t&&!G?l.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-pulse mt-1.5"}):null,l.jsxs("div",{className:"w-full flex flex-col",children:[B&&i&&l.jsxs("div",{className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1",children:[l.jsxs("h1",{className:F("mb-1 min-w-0 font-inter text-neutral-600 font-medium text-xs flex items-center gap-0.5 flex-wrap",C),children:[l.jsx(Qt,{label:i||"",required:a||!1,isRequiredConditional:s||!1}),N&&l.jsx(ce.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),f&&!zt(p)&&l.jsx(En,{}),l.jsx(Zr,{labels:d||[]}),x&&l.jsx(Te,{placement:"top",title:x,children:l.jsx("div",{className:"cursor-pointer",children:l.jsx(Kr,{})})})]}),l.jsxs("div",{className:"flex items-center gap-1 justify-self-end",children:[zt(p)&&m?l.jsx(Te,{placement:"top-end",title:b??"",hideTooltip:b==null,className:"cursor-pointer",children:l.jsxs("div",{className:F("inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5",ei(m)),onClick:()=>g?.(y),children:[l.jsx(fn,{size:12,fill:kn(m),fillSecondary:wn(m)}),l.jsxs("span",{className:F("text-xs font-medium leading-4",ti(m)),children:[p,"%"]})]})}):null,t&&G?I?I(te):l.jsx("button",{id:"btn-toggle-add-to-document",className:"cursor-pointer",onClick:te,type:"button",children:l.jsx(Ze.Tooltip,{placement:"top",title:V("Add to document"),children:l.jsx(ce.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})]}),R&&l.jsx(ne,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:R}),l.jsxs("div",{className:"flex",children:[Y&&l.jsx(ne,{size:"small",variant:"medium",className:F("mr-2 text-neutral-700 dark:text-black-200",C),appearance:"custom",children:i}),l.jsxs("label",{className:F("relative inline-flex items-center",re||u?"":"w-min",ee?"cursor-not-allowed opacity-50":"cursor-pointer"),onClick:oe=>oe.stopPropagation(),children:[l.jsx("input",{ref:z,type:"checkbox",id:r,onChange:oe=>!ee&&n(oe.target.checked),value:"",disabled:ee,checked:e,className:F("sr-only peer w-full",v),"aria-required":a,"aria-invalid":P&&L==="error"?"true":"false","aria-describedby":P||R?`${r}-description`:void 0}),l.jsx("div",{className:gD(e,c,ee,H),children:c?l.jsx("div",{className:"flex items-center justify-center h-full w-full",children:l.jsx("div",{className:F("z-10 transition-all transform",H==="small"&&(e?"translate-x-2":"translate-x-[-6px]"),H==="medium"&&(e?"translate-x-[8.5px]":"translate-x-[-8px]"),H==="large"&&(e?"translate-x-2.5":"translate-x-[-10px]")),children:e?E?.checkedIcon?E.checkedIcon:l.jsx(bD,{size:18,fill:"#016DCF"}):E?.uncheckedIcon?E.uncheckedIcon:l.jsx(xD,{size:18,fill:"#101828"})})}):null}),W&&l.jsx(Te,{placement:"top",title:W,className:"-ml-2",children:l.jsx("span",{className:F("absolute inset-y-0 left-0",H==="small"&&"w-7",H==="medium"&&"w-9",H==="large"&&"w-11")})}),re&&l.jsx(ne,{size:"small",variant:"medium",className:F("ml-2 text-neutral-700 dark:text-black-300",C),appearance:"custom",children:i}),o?null:l.jsx(ne,{size:"small",variant:"medium",className:"ml-2 text-neutral-900 dark:text-black-100",appearance:"custom",children:u||(e?"Yes":"No")})]})]}),l.jsx(Ve.AnimatePresence,{children:P&&l.jsx(Ve.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${r}-description`,role:L==="error"?"alert":void 0,children:l.jsx(ne,{className:F("mt-1",$()),appearance:"custom",size:"extra-small",variant:"medium",children:P})})}),R&&!P&&l.jsx("div",{id:`${r}-description`,className:"sr-only",children:R})]})]})});Zn.displayName="Toggle";const _D=t=>{try{return JSON.parse(t)}catch{return null}},yD=t=>{let e="";const r="0123456789abcdef";for(let n=0;n<t;n++)e+=r.charAt(Math.floor(Math.random()*r.length));return e},vD=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),SD=t=>{const e=[...t].sort((n,i)=>n.length-i.length),r=[];for(const n of e)r.some(a=>n!==a&&n.startsWith(a+"."))||r.push(n);return r},Ua=t=>{let e="";if(t){let r=0;Object.keys(t).forEach(n=>{if(t[n]!==void 0&&t[n]!==null&&t[n]!==""){let i=t[n];typeof i=="object"?i=JSON.stringify(i):Array.isArray(i)&&(i=i.join(",")),i!=null&&i!==""&&(r===0?e+=`?${n}=${encodeURIComponent(i)}`:e+=`&${n}=${encodeURIComponent(i)}`,r+=1)}})}return e},dS=({shortcuts:t,variant:e="dark",className:r})=>{const i=il()==="macos",a=h.useMemo(()=>t.map(s=>{const o=Gu[s];return o?i?o.macos:o.other:s}),[t,i]);return l.jsx("div",{className:F("flex flex-1 gap-1",r),children:a.map((s,o)=>l.jsx("kbd",{className:F("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))})},ED=({className:t="",fill:e="var(--color-primary-600)",size:r=24})=>l.jsx("svg",{className:t,width:r,height:r,viewBox:"0 0 20 20",fill:e,xmlns:"http://www.w3.org/2000/svg",children:l.jsx("g",{mask:"url(#mask0_6752_28309)",children:l.jsx("path",{d:"M8.33317 11.3333L13.2498 6.41667C13.4026 6.26389 13.5971 6.1875 13.8332 6.1875C14.0693 6.1875 14.2637 6.26389 14.4165 6.41667C14.5693 6.56944 14.6457 6.76389 14.6457 7C14.6457 7.23611 14.5693 7.43056 14.4165 7.58333L8.9165 13.0833C8.74984 13.25 8.55539 13.3333 8.33317 13.3333C8.11095 13.3333 7.9165 13.25 7.74984 13.0833L5.58317 10.9167C5.43039 10.7639 5.354 10.5694 5.354 10.3333C5.354 10.0972 5.43039 9.90278 5.58317 9.75C5.73595 9.59722 5.93039 9.52083 6.1665 9.52083C6.40262 9.52083 6.59706 9.59722 6.74984 9.75L8.33317 11.3333Z",fill:e})})}),Er=({id:t,onClick:e,icon:r,text:n,className:i,isDisabled:a,onClose:s,notVisible:o,hideHoverEffect:A,leadingIcon:u,suffixRecord:c,stopPropagation:d,onToggle:f,isChecked:p=!1,highlight:m,truncateText:b=!1,showTick:y=!1,width:g="100%",tooltip:x,isFlowAvailable:v=!0,shortcuts:S,textClassName:k,chevron:E})=>{const w=h.useCallback(D=>{s&&s(),D.preventDefault(),e?.(D),d&&D.stopPropagation()},[s,e,d]),T=(D,R)=>{if(!R||!D||typeof D!="string"&&typeof D!="number")return D;const H=vD(R),I=new RegExp(`(${H?.trim()})`,"gi"),M=D?.toString()?.split(I);return l.jsxs("span",{className:"overflow-clip text-ellipsis",children:[M[0],l.jsx("span",{className:"bg-yellow-300 dark:bg-primary-100 dark:text-black-900 rounded-sm",children:M[1]}),M?.slice(2)?.join("")]})},O=h.useCallback(D=>{f?.(),D.stopPropagation()},[f]),C=["delete","remove","clear","terminate session","terminate sessions","terminate all sessions","trash"].some(R=>n?.toLowerCase().includes(R)),N=a||!v;if(o)return null;const P=!!(e||f),L=P?"button":"div";return l.jsx(L,{id:t,className:F("w-full p-1 bg-white dark:bg-black-800 group",i,N&&"opacity-60"),...P?{onClick:f?()=>null:w,disabled:N}:{},onMouseMove:D=>D.stopPropagation(),children:l.jsxs("div",{className:F("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",!A&&"hover:bg-gray-50 dark:hover:bg-black-600 hover:shadow-md dark:hover:shadow-lg dark:hover:shadow-primary-500/20"),children:[r?l.jsx("div",{className:F("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:l.jsx(Te,{placement:"top",title:x,children:r})}):null,l.jsxs("div",{className:"flex gap-2 flex-1 min-w-0 text-left justify-between items-center",children:[l.jsx("div",{className:F("flex-1 min-w-0",b&&"max-w-[150px]"),style:{width:g},children:l.jsx(ne,{className:F("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",k),appearance:"custom",children:m?T(n,m):n})}),c?.[n]?l.jsx("span",{className:"flex-shrink-0 text-neutral-500 dark:text-neutral-200 bg-neutral-100 dark:bg-black-700 border-[#D0D5DD] dark:border-black-700 text-xs leading-[18px] font-normal border rounded-full px-2 py-0.5",children:c[n]||""}):null,y?l.jsx("div",{className:"flex-shrink-0",children:l.jsx(ED,{fill:"var(--color-primary-600)"})}):null]}),u?l.jsx(l.Fragment,{children:x?l.jsx(Te,{placement:"top",title:x,children:l.jsx("div",{className:F("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})}):l.jsx("div",{className:F("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,S?l.jsx("div",{className:"flex items-center justify-end flex-shrink-0",children:l.jsx(dS,{variant:"light",shortcuts:S})}):null,f?l.jsx("div",{className:"flex-shrink-0",children:l.jsx(Zn,{onChange:O,isChecked:p,isDisabled:a,hideStatus:!0})}):null,E?l.jsx("div",{className:F("flex-shrink-0 flex items-center text-neutral-500 dark:text-neutral-400 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:E}):null]})})};Er.displayName="OptionButton";const is=(t,e)=>{const r=t.slice(0,2),n=rl[r];return n?l.jsx("div",{className:`
|
|
51
51
|
w-5 h-5 rounded-full overflow-hidden border-[0.9px] flex items-center justify-center relative
|
|
52
52
|
${e?"border-neutral-100 dark:border-neutral-100":"border-neutral-400 dark:border-neutral-500"}
|
|
53
53
|
`,children:l.jsx(n,{style:{width:"110%",height:"110%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},kD=t=>{const e=t.slice(0,2),r=rl[e];return r?l.jsx("div",{className:"w-4 h-4 rounded-full overflow-hidden flex items-center justify-center relative",children:l.jsx(r,{style:{width:"120%",height:"120%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},wD=t=>{const e=t.slice(0,2),r=rl[e];return r?l.jsx("div",{className:"w-7 h-5 rounded-md overflow-hidden border border-neutral-300 dark:border-neutral-300 flex items-center justify-center relative",children:l.jsx(r,{style:{width:"110%",height:"110%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},TD=t=>{const e=t.slice(0,2),r=rl[e];return r?l.jsx("div",{className:"w-4 h-3 rounded-sm overflow-hidden border border-neutral-300 dark:border-neutral-300 flex items-center justify-center relative",children:l.jsx(r,{style:{width:"120%",height:"120%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},fS=t=>{const e=t.slice(0,2),r=rl[e];return r?l.jsx("div",{className:"w-5 h-4 rounded-sm overflow-hidden border border-neutral-300 dark:border-neutral-300 flex items-center justify-center relative",children:l.jsx(r,{style:{width:"115%",height:"115%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},X1=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()||"-",da=(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"-"}},OD=t=>{const e=new Date(t.replaceAll("-","/"));return e instanceof Date&&e.getHours()===0&&e.getMinutes()===0&&e.getSeconds()===0&&e.getMilliseconds()===0},CD=(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)},zn=(t,e={})=>{const{format:r,timezone:n,relative:i=!1,withTime:a=!0,fallback:s="-",skipTimezone:o=!1,onlyTime:A=!1}=e||{};if(!t)return s;try{if(!Lt(t).isValid())return s;const u=CD(t.toString(),o);if(Number.isNaN(u.getTime()))return s;const c=OD(t);let d;if(o)d=u;else{const p=Intl.DateTimeFormat().resolvedOptions().timeZone,m=n||p;d=PN.utcToZonedTime(u,m)}if(i)return Dx.formatDistanceToNow(new Date(d),{addSuffix:!0}).replace(/^about /,"");let f;if(r)f=r;else{const p="MM/dd/yyyy";f=a&&!c?`${p} hh:mm a`:p}return A&&(f="hh:mm a"),Dx.format(d,f)}catch{return s}},pS=t=>typeof t=="string"&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(t),ND={"&":"&","<":"<",">":">",""":'"',"'":"'"," ":" ","–":"–","—":"—","«":"«","»":"»","©":"©","®":"®","™":"™","…":"…","•":"•","·":"·","‘":"‘","’":"’","“":"“","”":"”","€":"€","£":"£","¥":"¥","¢":"¢","×":"×","÷":"÷","±":"±","°":"°","½":"½","¼":"¼","¾":"¾","µ":"µ","¶":"¶","§":"§"},DD=t=>{if(typeof t!="string")return t;let e=t;return e=e.replace(/&[a-zA-Z]+;/g,r=>ND[r]??r),e=e.replace(/&#x([\dA-Fa-f]+);/gi,(r,n)=>String.fromCodePoint(parseInt(n,16))),e=e.replace(/&#(\d+);/g,(r,n)=>String.fromCodePoint(parseInt(n,10))),e=e.replace(/\\u([\dA-Fa-f]{4})/gi,(r,n)=>String.fromCharCode(parseInt(n,16))),e=e.replace(/\\u\{([\dA-Fa-f]+)\}/gi,(r,n)=>String.fromCodePoint(parseInt(n,16))),e},hS=h.forwardRef(({id:t,label:e,value:r,onChange:n,errorMessage:i,defaultValue:a,required:s=!1,isRequiredConditional:o=!1,tags:A,className:u,originalCase:c=!1,tooltip:d,simpleMode:f=!1,inputFieldClassName:p="",isAiExtracted:m=!1,confidenceScore:b,confidenceType:y="high",confidenceTooltip:g,sourceMeta:x=[],onConfidenceScoreClick:v,isGTN:S=!1,gtnName:k=null,allowMultiCurrency:E=!1,placeholder:w,disabled:T=!1,currencyCode:O="USD",inputStyle:C,labelClassName:N,isLiveField:P=!1,onBlur:L,autoFocus:D=!1,isRecording:R=!1,isPlaying:H=!1,onAddGTNToDocument:I,riskDetails:M,isRiskAnalysisOpen:z=!1,RiskDetailsCard:V,...X},ee)=>{const{t:W}=Xt.useTranslation(),[B,Y]=h.useState(!1),[re,G]=h.useState([]),[K,te]=h.useState(""),[$,oe]=h.useState(O||"USD"),[je,ye]=h.useState(!1),me=Q=>{if(I){const se={key:k,value:da(Q,$)};I(se)}},fe=Q=>{if(Q==null)return"";const se=Number(Q);return isNaN(se)?Q:se?.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},pe=Q=>{const se=Q.target.value,ke=se===""||se===null||se===void 0?0:Number(se);n(ke,$);const ze=document.getElementById(t);if(ze&&ze.setAttribute("data-selected-value",JSON.stringify({value:ke,currency_code:$})),ze&&(R||H)){const Ge=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${t}`,value:{value:ke,currency_code:$},type:"change"}});ze.dispatchEvent(Ge)}},ve=()=>{Y(!0)},_e=()=>{Y(!1),(r==null||r==="")&&pe({target:{value:"0.00"}}),L?.()},ue=()=>{const Q="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)]",se=i?"border-red-300":z&&M?.color?`border-${M.color}-300`:"border-gray-300 dark:border-black-600",ke=`${z&&M?.color?`bg-${M.color}-50`:"bg-white dark:bg-black-600"}`;return`${Q} ${se} ${ke} ${p}`};return h.useEffect(()=>{O&&oe(O)},[O]),h.useEffect(()=>{if($){const Q=r===""||r===null||r===void 0?0:Number(r);O!==$&&n(Q,$);const se=document.getElementById(t);if(se&&(se.setAttribute("data-selected-value",JSON.stringify({value:Q,currency_code:$})),R||H)){const ke=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${t}`,value:{value:Q,currency_code:$},type:"change"}});se.dispatchEvent(ke)}}},[$]),h.useEffect(()=>{const Q=KA.filter(se=>(se.value+" - "+se.label).toLowerCase().includes(K.toLowerCase())).map(se=>({label:l.jsx(Er,{text:`${se.value} - ${se.label}`,icon:is(se.value),showTick:$===se.value,onClick:()=>oe(se.value),className:"text-black-900 dark:text-white"}),key:se.value}));G(Q)},[K,$]),h.useEffect(()=>{te("")},[$]),f?l.jsxs("label",{id:t,className:`mb-1 text-xs font-medium text-gray-600 h-full inline-flex items-center gap-1 ${c?"":"capitalize"} ${N||""}`,children:[l.jsx("span",{className:"absolute inset-y-0 left-1 top-0.5 flex items-center pl-3",children:"$"}),l.jsx("input",{...X,ref:ee,type:B?"number":"text",required:s,className:F(p,"pl-8 h-[32px]"),onChange:pe,min:0,onFocus:ve,onBlur:_e,value:B?r:fe(r),...a&&!r?{defaultValue:B?a:fe(a)}:{},id:t||e,autoFocus:D})]}):l.jsxs("div",{className:F("flex gap-0.5 relative",je&&S?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>ye(!0),onMouseLeave:()=>ye(!1),children:[S&&!je?l.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,l.jsxs("div",{className:F("w-full flex flex-col",u),children:[l.jsx("label",{htmlFor:"text",className:`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${c?"":"uppercase"} ${N||""}`,children:l.jsxs("div",{className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1",children:[l.jsxs("div",{className:"inline-flex min-w-0 items-center gap-1 flex-wrap",children:[l.jsx(Qt,{label:e||"",required:s||!1,isRequiredConditional:o||!1}),P&&l.jsx(ce.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),m&&!zt(b)&&l.jsx(En,{}),l.jsx(Zr,{labels:A}),d&&l.jsx(Te,{placement:"top",title:d,children:l.jsx("div",{className:"cursor-pointer",children:l.jsx(Kr,{})})})]}),l.jsxs("div",{className:"flex items-center gap-1 justify-self-end",children:[zt(b)&&y?l.jsx(Te,{placement:"top-end",title:g??"",hideTooltip:g==null,className:"cursor-pointer",children:l.jsxs("div",{className:F("inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5",ei(y)),onClick:()=>v?.(x),children:[l.jsx(fn,{size:12,fill:kn(y),fillSecondary:wn(y)}),l.jsxs("span",{className:F("text-xs font-medium leading-4",ti(y)),children:[b,"%"]})]})}):null,S&&je&&I?l.jsx("button",{id:"btn-currency-input-add-to-document",className:"cursor-pointer",onClick:()=>me(fe(r)),type:"button",children:l.jsx(Ze.Tooltip,{placement:"top",title:W("Add to document"),children:l.jsx(ce.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})]})}),l.jsxs("label",{className:"relative block",children:[l.jsx("span",{className:"absolute inset-y-0 left-1 flex items-center pl-3 text-neutral-900 dark:text-white",children:Ku[$]}),l.jsx("input",{...X,ref:ee,placeholder:w,type:B?"number":"text",required:s,disabled:T,className:ue(),onChange:pe,min:0,onFocus:ve,onBlur:_e,value:B?r:fe(r),defaultValue:B?a:fe(a),id:t||e,style:C,autoComplete:"off",autoFocus:D}),l.jsx("span",{className:`absolute inset-y-0 right-2 flex items-center z-[1000px] h-full cursor-pointer dark:text-black-200 ${E?"cursor-pointer":""}`,children:E?l.jsx(Ze.Dropdown,{menu:{items:[...re]},trigger:["click"],overlayClassName:"row-option-cell",placement:"bottomRight",overlayStyle:{zIndex:999},getPopupContainer:Q=>Q.parentElement,popupRender:Q=>l.jsxs("div",{style:{maxHeight:"200px",width:"330px",textOverflow:"ellipsis",overflowY:"auto",zIndex:"999px",borderRadius:"6px"},className:"[&>*:nth-child(2)]:!shadow-none [&>*:nth-child(2)>*]:!px-2 flex flex-col gap-2 p-2 bg-white dark:bg-black-700 border border-solid border-neutral-200 dark:border-black-600",children:[l.jsx(Zu,{id:"search-bar-currency-input",value:K,onChange:se=>te(se),className:"mb-2"}),Q]}),children:l.jsxs("div",{className:"pl-4 pr-2 py-1.5 text-sm text-gray-700 dark:text-black-200 flex items-center gap-1",children:[is($)," ",$]})}):$})]}),i&&l.jsx(ne,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:i})]}),je&&M&&z&&V&&l.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:Q=>Q.stopPropagation(),onMouseDown:Q=>Q.preventDefault(),onKeyDown:Q=>{Q.key==="Escape"&&ye(!1)},children:l.jsx(V,{riskDetails:M})})]})});hS.displayName="CurrencyInputField";const mS=h.forwardRef(({id:t,label:e,value:r,defaultValue:n,onChange:i,disabled:a=!1,required:s=!1,message:o,messageType:A="default",wrapperClassName:u,inputClassName:c,labelClassName:d,helpText:f,size:p="medium",minDate:m,maxDate:b,startPlaceholder:y="Start date",endPlaceholder:g="End date",allowClear:x=!0,inputProps:v},S)=>{const k=r!==void 0?r:n||{startDate:null,endDate:null},E=()=>{switch(p){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=()=>A==="error"?"border-red-300 focus:border-red-500 focus:ring-red-200 dark:focus:ring-red-400/20":A==="success"?"border-green-300 focus:border-green-500 focus:ring-green-200 dark:focus:ring-green-400/20":A==="info"?"border-blue-300 focus:border-blue-500 focus:ring-blue-200 dark:focus:ring-blue-400/20":"border-neutral-300 dark:border-neutral-600 focus:border-primary-500 dark:focus:border-primary-400 focus:ring-primary-200 dark:focus:ring-primary-400/20",T=()=>A==="error"?"text-red-500 dark:text-red-400":A==="success"?"text-green-500 dark:text-green-400":A==="info"?"text-blue-500 dark:text-blue-400":"text-neutral-500 dark:text-neutral-400",O=()=>{switch(p){case"small":return"extra-small";case"large":return"medium";default:return"small"}},C=I=>{if(!I)return"";const M=I.getFullYear(),z=String(I.getMonth()+1).padStart(2,"0"),V=String(I.getDate()).padStart(2,"0");return`${M}-${z}-${V}`},N=I=>{if(!I)return null;const M=new Date(I);return isNaN(M.getTime())?null:M},P=I=>{const M=N(I.target.value);i({startDate:M,endDate:k.endDate})},L=I=>{const M=N(I.target.value);i({startDate:k.startDate,endDate:M})},D=()=>{i({startDate:null,endDate:null})},R=I=>I?C(I):void 0,H=E();return l.jsxs("div",{className:F("flex flex-col w-full",u),ref:S,children:[e&&l.jsx("label",{htmlFor:`${t}-start`,className:F("mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",d),children:l.jsx("div",{className:"flex flex-wrap items-center justify-between w-full",children:l.jsx("div",{className:"inline-flex flex-wrap items-center gap-1",children:l.jsxs(ne,{variant:"medium",size:O(),appearance:"subtitle",children:[e,s&&l.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})})})}),f&&l.jsx(ne,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:f}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex-1",children:l.jsx("input",{...v,id:`${t}-start`,type:"date",value:C(k.startDate),onChange:P,disabled:a,required:s,min:R(m),max:R(b),placeholder:y,className:F("border rounded-md bg-white dark:bg-neutral-800 block w-full font-medium text-neutral-900 dark:text-neutral-100","transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2",H.height,H.padding,H.fontSize,w(),a&&"opacity-50 cursor-not-allowed bg-neutral-50 dark:bg-neutral-700",c),"aria-required":s,"aria-invalid":o&&A==="error"?"true":"false","aria-describedby":o||f?`${t}-description`:void 0})}),l.jsx("div",{className:"flex-shrink-0 text-neutral-500 dark:text-neutral-400",children:l.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M18 12H6"})})}),l.jsx("div",{className:"flex-1",children:l.jsx("input",{...v,id:`${t}-end`,type:"date",value:C(k.endDate),onChange:L,disabled:a,required:s,min:R(k.startDate||m),max:R(b),placeholder:g,className:F("border rounded-md bg-white dark:bg-neutral-800 block w-full font-medium text-neutral-900 dark:text-neutral-100","transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2",H.height,H.padding,H.fontSize,w(),a&&"opacity-50 cursor-not-allowed bg-neutral-50 dark:bg-neutral-700",c),"aria-required":s,"aria-invalid":o&&A==="error"?"true":"false","aria-describedby":o||f?`${t}-description`:void 0})}),x&&(k.startDate||k.endDate)&&!a&&l.jsx("button",{type:"button",onClick:D,className:"flex-shrink-0 p-1 text-neutral-500 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-200 transition-colors","aria-label":"Clear date range",children:l.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),l.jsx("div",{className:"absolute right-3 top-1/2 transform -translate-y-1/2 pointer-events-none text-neutral-400 dark:text-neutral-500",children:l.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),l.jsx(Ve.AnimatePresence,{children:o&&l.jsx(Ve.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${t}-description`,role:A==="error"?"alert":void 0,children:l.jsx(ne,{className:F("mt-1",T()),appearance:"custom",size:"extra-small",variant:"medium",children:o})})}),f&&!o&&l.jsx("div",{id:`${t}-description`,className:"sr-only",children:f})]})});mS.displayName="DateRange2";const{RangePicker:Ix}=Ze.DatePicker,Mx={ENTER:"Enter"},jx=()=>Math.random().toString(36).substring(2,9),RD=(t,e)=>{const r=h.useRef(e);h.useEffect(()=>{r.current=e},[e]),h.useEffect(()=>{const n=i=>r.current(i);return document.addEventListener(t,n),()=>{document.removeEventListener(t,n)}},[t])},gS=({onCalendarChange:t=void 0,onChange:e,required:r,label:n,startDate:i,endDate:a,errorMessage:s,className:o,id:A,disabled:u=!1,dateFormat:c,shouldPopOnParent:d=!0,getPopupContainer:f,maxDateRange:p,open:m,onOpenChange:b,placement:y="bottomLeft",renderAsIconButton:g=!1,iconButtonClassName:x,iconClassName:v})=>{const[S,k]=h.useState(!1),[E,w]=h.useState(!1),T=h.useRef(null),O=h.useRef(null),C=h.useRef(!1),N=h.useRef(!1),P=V=>V?Lt(V):null,L=`date-range-start-${jx()}`,D=`date-range-end-${jx()}`,R=()=>{k(!0),setTimeout(()=>{T.current&&T.current.focus()},0)};RD("keydown",V=>{if(V.key===Mx.ENTER&&document.activeElement instanceof HTMLInputElement){if(document?.activeElement?.id===L){const X=Lt(document?.activeElement?.value);X.isValid()&&e([X,P(a)])}if(document?.activeElement?.id===D){const X=Lt(document?.activeElement?.value);X.isValid()&&e([P(i),X])}}});const H=h.useCallback(V=>{const[X,ee]=[P(i),P(a)];return p?X?V.isBefore(X.startOf("day"))||V.isAfter(X.add(p,"day").endOf("day")):ee?V.isBefore(ee.subtract(p,"day").startOf("day"))||V.isAfter(ee.endOf("day")):!1:!1},[i,a,p]),I=h.useCallback(V=>{if(V.key===Mx.ENTER&&!(g?S:m??E)){V.preventDefault(),V.stopPropagation();const ee=V.target.closest("form");if(ee){const W=ee.querySelector('button[type="submit"]');W?W.click():ee.requestSubmit()}}},[g,S,m,E]),M=h.useCallback(V=>{if(V&&C.current){C.current=!1,k(!1);return}k(V),V||(C.current=!0,requestAnimationFrame(()=>{T.current?.focus(),requestAnimationFrame(()=>{C.current=!1})}))},[]),z=h.useCallback(V=>{if(V&&N.current){N.current=!1,w(!1),b?.(!1);return}w(V),b?.(V),V||(N.current=!0,requestAnimationFrame(()=>{O.current?.focus(),requestAnimationFrame(()=>{N.current=!1})}))},[b]);return g?l.jsxs("div",{id:A,className:o,onKeyDownCapture:I,children:[l.jsx(or,{onClick:R,disabled:u,variant:"default",className:x,children:l.jsx(Ie.CalendarMonthIcon,{size:20,className:F("w-5 h-5",v)})}),l.jsx(Ix,{ref:T,onChange:V=>{e(V),k(!1)},onCalendarChange:t,value:[P(i),P(a)],id:{start:L,end:D},allowClear:!0,format:c||"DD MMM, YYYY",separator:l.jsx(Ie.CheckIndeterminateSmallFilledIcon,{size:20,className:"text-neutral-400 dark:text-gray-100"}),suffixIcon:l.jsx(Ie.CalendarMonthIcon,{size:14,className:"text-neutral-400 dark:text-gray-100"}),getPopupContainer:f||(d?V=>V.parentElement:()=>document.body),disabled:u,disabledDate:p?H:void 0,autoComplete:"off",open:S,onOpenChange:M,placement:y,style:{position:"absolute",opacity:0,pointerEvents:"none",width:0,height:0}})]}):l.jsxs("div",{id:A,className:F("flex flex-col",o),onKeyDownCapture:I,children:[l.jsx(Qt,{label:n||"",required:r||!1}),l.jsx(Ix,{ref:O,onChange:e,onCalendarChange:t,value:[P(i),P(a)],id:{start:L,end:D},allowClear:!0,format:c||"DD MMM, YYYY",separator:l.jsx(Ie.CheckIndeterminateSmallFilledIcon,{size:20,className:"text-neutral-400 dark:text-gray-100"}),suffixIcon:l.jsx(Ie.CalendarMonthIcon,{size:14,className:"text-neutral-400 dark:text-gray-100"}),getPopupContainer:f||(d?V=>V.parentElement:()=>document.body),disabled:u,disabledDate:p?H:void 0,open:m??E,onOpenChange:z,autoComplete:"off",placement:y}),s&&l.jsx("p",{className:F("text-sm font-inter font-normal text-left pt-[6px]","text-red-500"),children:s})]})};gS.displayName="DateRange";Lt.extend(MN);Lt.extend(LN);Lt.extend(jN);Lt.extend(IN);const bS="MM/DD/YYYY",TA="MM/DD/YYYY - hh:mm A",Hx="YYYY-MM-DD",Fx="YYYY-MM-DDTHH:mm:ss",Ux={ENTER:"Enter"},xS=["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"],PD=["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",...xS,"YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ssZ"],LD=()=>Math.random().toString(36).substring(2,9),Hs=(t,e=!1)=>{if(!t)return null;const r=e?PD:xS;for(const i of r){const a=Lt(t,i,!0);if(a.isValid())return a}const n=Lt(t);return n.isValid()?n:null},zx=(t,e)=>{const r=h.useRef(e);h.useEffect(()=>{r.current=e},[e]),h.useEffect(()=>{const n=i=>r.current(i);return document.addEventListener(t,n),()=>{document.removeEventListener(t,n)}},[t])},wb=h.forwardRef(({label:t,value:e,required:r,isRequiredConditional:n=!1,disabled:i,className:a=void 0,errorMessage:s,handleOnChange:o,showTime:A=!0,tags:u,needConfirm:c=!1,simpleMode:d,originalCase:f=!1,dateFormat:p=void 0,tooltip:m,isAiExtracted:b=!1,confidenceScore:y,confidenceType:g="high",confidenceTooltip:x,sourceMeta:v=[],onConfidenceScoreClick:S,isGTN:k=!1,gtnName:E=null,shouldPopOnParent:w=!1,allowTimezoneConversion:T=!0,inputStyle:O,labelClassName:C,isLiveField:N=!1,riskDetails:P,isRiskAnalysisOpen:L=!1,RiskDetailsCard:D,onAddGTNToDocument:R,formatDateForGTN:H,...I},M)=>{const{t:z}=Xt.useTranslation(),[V,X]=h.useState(!1),[ee,W]=h.useState(null),[B,Y]=h.useState(null),[re,G]=h.useState(!1),K=p||(A?TA:bS),te=I?.id||`date-picker-${LD()}`,$=h.useRef(null),oe=h.useRef(!1);zx("paste",ue=>{document.activeElement?.id===te&&(ue.preventDefault(),navigator.clipboard.readText().then(Q=>{const se=Hs(Q,A);se&&pe(se)}))}),zx("keydown",ue=>{if(ue.key===Ux.ENTER&&document.activeElement instanceof HTMLInputElement&&document.activeElement.id===te){const Q=Hs(document?.activeElement?.value,A);Q&&pe(Q)}});const je=h.useCallback(ue=>{if(!R)return;let Q=ue||"";if(H&&ue)Q=H(ue,{skipTimezone:!0,withTime:A});else if(ue){const ke=Lt(ue);ke.isValid()&&(Q=ke.format(K))}R({key:E,value:Q})},[R,E,H,A,K]),ye=h.useCallback(()=>{const ue=document.getElementsByClassName("ant-picker-footer")[0];ue&&(ue.style.display="none")},[]),me=h.useCallback(ue=>{if(!T){const Q=A?Fx:Hx;if(o(ue?ue.format(Q):null),ue){const se=document.getElementById(te);if(se){const ke=new CustomEvent("pilot-date-change",{bubbles:!0,detail:{selector:`#${te}`,value:ue.format?ue.format(K):ue,type:"date-change",elementId:te}});se.dispatchEvent(ke)}}return}if(ue){let Q;if(A?Q=Lt(ue).utc().toISOString():Q=Lt(ue).utc().add(Lt(ue).utcOffset(),"minute").startOf("day").toISOString(),Q){o(Q);const se=document.getElementById(te);if(se){const ke=new CustomEvent("pilot-date-change",{bubbles:!0,detail:{selector:`#${te}`,value:ue.format(K),type:"date-change",elementId:te}});se.dispatchEvent(ke)}}}else o(null)},[T,o,A,te,K]),fe=h.useCallback(ue=>{if(!ue)return null;if(!T)try{const Q=Lt(ue);if(Q.isValid())return Q;const se=Lt(ue,K);return se.isValid()?se:null}catch{return null}if(A){const Q=Lt(ue);return Lt(Q).isValid()?Q:null}else if(ue?.toString()?.includes("Z")){const Q=Lt.utc(ue);return Lt(Q).isValid()?Q:null}else{const Q=Lt(ue);return Lt(Q).isValid()?Q:null}},[T,K,A]),pe=h.useCallback(ue=>{if(ue?.isValid()||ue===null){W(ue);const Q=A?Fx:Hx,se=T?ue?.toISOString():ue?ue.format(Q):"";if(o(se||null),ue?.isValid()){const ke=document.getElementById(te);if(ke){const ze=new CustomEvent("pilot-date-change",{bubbles:!0,detail:{selector:`#${te}`,value:ue.format(K),type:"date-change",elementId:te}});ke.dispatchEvent(ze)}}}},[T,K,o,te,A]);h.useEffect(()=>{W(fe(e))},[e,fe]),h.useEffect(()=>{B&&Y(null)},[B]),h.useEffect(()=>{const ue=document.getElementById(te);if(!ue)return;const Q=se=>{const{value:ke,type:ze}=se.detail;if(ze==="date-playback"&&ke){const Ge=Hs(ke,A);Ge&&Ge.isValid()&&(W(Ge),me(Ge),setTimeout(()=>{const Je=ue.querySelector("input");if(Je&&(Je.focus(),setTimeout(()=>{Je.blur()},10)),$.current)try{const Ue=$.current;typeof Ue.blur=="function"&&Ue.blur()}catch{}setTimeout(()=>{document.querySelectorAll(".ant-picker-dropdown:not(.ant-picker-dropdown-hidden)").forEach(we=>{we instanceof HTMLElement&&(we.style.display="none",we.classList.add("ant-picker-dropdown-hidden"))})},50)},50))}};return ue.addEventListener("pilot-date-playback",Q),()=>{ue.removeEventListener("pilot-date-playback",Q)}},[te,K,me,A]);const ve=h.useCallback(ue=>{if(ue.key===Ux.ENTER&&!re){ue.preventDefault(),ue.stopPropagation();const Q=ue.target.closest("form");if(Q){const se=Q.querySelector('button[type="submit"]');se?se.click():Q.requestSubmit()}}},[re]),_e=h.useCallback(ue=>{if(ue&&oe.current){oe.current=!1,G(!1);return}G(ue),ue||(oe.current=!0,requestAnimationFrame(()=>{$.current?.focus(),requestAnimationFrame(()=>{oe.current=!1})}))},[]);return d?l.jsx("div",{onKeyDownCapture:ve,children:l.jsx(Ze.DatePicker,{...I,showTime:A,open:re,format:K,placeholder:K===TA?"MM/DD/YYYY hh:mm":K,value:ee,needConfirm:!1,onChange:ue=>{W(ue),me(ue),Y(ue?.toISOString()||null)},className:a,showNow:!1,onFocus:ye,onOpenChange:_e,onBlur:ue=>{const Q=ue.target.value;if(Q){const se=Hs(Q,A);se&&pe(se)}},ref:$,disabled:i,id:te})}):l.jsxs("div",{ref:M,className:F("flex gap-0.5 relative",V&&k?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>X(!0),onMouseLeave:()=>X(!1),children:[k&&!V?l.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,l.jsxs("div",{className:`w-full flex flex-col font-inter ${a||""}`,onKeyDownCapture:ve,children:[t?l.jsx("label",{className:`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${f?"":"capitalize"} ${C||""}`,children:l.jsxs("div",{className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1",children:[l.jsxs("div",{className:"inline-flex min-w-0 items-center gap-1 flex-wrap",children:[l.jsx(Qt,{label:t||"",required:r||!1,isRequiredConditional:n||!1}),N&&l.jsx(ce.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),b&&!zt(y)&&l.jsx(En,{}),l.jsx(Zr,{labels:u}),m&&l.jsx(Te,{placement:"top",title:m,children:l.jsx("div",{className:"cursor-pointer",children:l.jsx(Kr,{})})})]}),l.jsxs("div",{className:"flex items-center gap-1 justify-self-end",children:[zt(y)&&g?l.jsx(Te,{placement:"top-end",title:x??"",hideTooltip:x==null,className:"cursor-pointer",children:l.jsxs("div",{className:F("inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5",ei(g)),onClick:()=>S?.(v),children:[l.jsx(fn,{size:12,fill:kn(g),fillSecondary:wn(g)}),l.jsxs("span",{className:F("text-xs font-medium leading-4",ti(g)),children:[y,"%"]})]})}):null,k&&V&&R?l.jsx("button",{id:"btn-date-field-add-to-document",className:"cursor-pointer",onClick:()=>je(e),type:"button",children:l.jsx(Ze.Tooltip,{placement:"top",title:z("Add to document"),children:l.jsx(ce.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})]})}):null,l.jsx(Ze.DatePicker,{...I,showTime:A?{use12Hours:!0}:!1,open:re,format:K,placeholder:K===TA?"MM/DD/YYYY - HH:MM":K,className:`w-full h-8 text-inter font-medium ${s?"border-red-400":""} dark:text-black-300 ${L&&P?.color&&`bg-${P.color}-50 border-${P.color}-300`}`,styles:{root:{...O,borderRadius:"7px"}},showNow:!1,value:ee,onChange:ue=>{W(ue),me(ue),Y(ue?.toISOString()||null)},onBlur:ue=>{const Q=ue.target.value;if(Q){const se=Hs(Q,A);se&&(W(se),me(se))}},needConfirm:c,ref:$,disabled:i,inputReadOnly:!1,onOpenChange:_e,getPopupContainer:w?ue=>ue.parentElement:()=>document.body,id:te,autoComplete:"off"}),s&&l.jsx(ne,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:s})]}),V&&P&&L&&D&&l.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:ue=>ue.stopPropagation(),onMouseDown:ue=>ue.preventDefault(),onKeyDown:ue=>{ue.key==="Escape"&&X(!1)},children:l.jsx(D,{riskDetails:P})})]})});wb.displayName="DateTimeField";const _S=({id:t,label:e,onChange:r,errorMessage:n,required:i,bg:a,tags:s,color:o,debounceTimeout:A=0,className:u,isDarkMode:c,...d})=>{const{inputRef:f,...p}=d;return l.jsxs("div",{className:F("flex flex-col",u),children:[e&&l.jsxs("label",{htmlFor:t,className:"block mb-1 text-xs font-medium leading-[18px] text-neutral-600 dark:text-black-300 font-inter capitalize",children:[l.jsx(Qt,{label:e||"",required:i||!1}),l.jsx(Zr,{labels:s})]}),l.jsx("label",{className:"relative block h-8",children:h.createElement(bb.DebounceInput,{...p,debounceTimeout:A,id:t,key:t,required:i,className:F("border",n?"!border-error-300":"border-neutral-200 dark:border-black-600",a,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:m=>{r(m.target.value)},autoComplete:"off"})}),l.jsx(Ve.AnimatePresence,{children:n&&l.jsx(Ve.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.15},children:l.jsx(ne,{className:"pt-1 text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:n})})})]})};_S.displayName="DebounceInputField";const yS=h.forwardRef(({id:t,label:e,placeholder:r,value:n,onChange:i,errorMessage:a,defaultValue:s,required:o=!1,isRequiredConditional:A=!1,dataSource:u,dataKey:c,tags:d,tooltip:f="",originalCase:p=!1,color:m="",isGTN:b=!1,gtnName:y,isAiExtracted:g=!1,confidenceScore:x,confidenceType:v="high",confidenceTooltip:S,sourceMeta:k=[],onConfidenceScoreClick:E,labelClassName:w,disabled:T=!1,isLiveField:O=!1,onAddGTNToDocument:C,riskDetails:N,isRiskAnalysisOpen:P=!1,RiskDetailsCard:L,primaryColorShades:D,isRecording:R=!1,isPlaying:H=!1,setDisableActions:I,showDeprecatedFieldWarning:M,DynamicDataModal:z},V)=>{const{t:X}=Xt.useTranslation(),[ee,W]=h.useState(!1),[B,Y]=h.useState(n),[re,G]=h.useState(!1),K=h.useRef(null),te=V||K,$=()=>{I?.(!re),G(!re)},oe=fe=>{if(fe.keyCode===9||fe.key==="Enter"){const pe=te.current||K.current;pe&&(B!==null&&i(B),Y(B),pe.blur())}},je=()=>{Y(""),i("")},ye=fe=>{C&&y&&C({key:y,value:fe})},me=()=>{const fe="border h-[32px] text-sm rounded-lg block w-full p-2.5 font-inter font-medium",pe=a?"border-red-300":P&&N?.color?`border-${N?.color}-300`:"border-gray-300 dark:border-black-600",ve="placeholder:text-neutral-900 dark:placeholder:text-black-400",_e=`${P&&N?.color?`bg-${N?.color}-50`:"bg-gray-200 dark:bg-black-600 "} ${m||"text-neutral-900 dark:text-black-200"}`;return`${fe} ${pe} ${_e} ${ve}`};return h.useEffect(()=>{re&&!u&&(M?.(),G(!1))},[re,u,M]),h.useEffect(()=>{Y(n)},[n]),l.jsxs("div",{className:F("flex gap-0.5 w-full relative",ee&&b?"border rounded-lg border-primary-100 bg-primary-50 p-1":"",{"error-field":!!a}),onMouseEnter:()=>W(!0),onMouseLeave:()=>W(!1),children:[b&&!ee?l.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,l.jsxs("div",{className:F("flex flex-col w-full"),children:[l.jsx("label",{htmlFor:"text",className:`text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${p?"":"capitalize"} ${w||""}`,children:l.jsxs("div",{className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1",children:[l.jsxs("div",{className:"inline-flex min-w-0 items-center gap-1 flex-wrap",children:[l.jsx(Qt,{label:e||"",required:o||!1,isRequiredConditional:A||!1}),O&&l.jsx(ce.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),g&&!zt(x)&&l.jsx(En,{}),l.jsx(Zr,{labels:d}),f&&l.jsx(Te,{placement:"top",title:f,children:l.jsx("div",{className:"cursor-pointer",children:l.jsx(Kr,{})})})]}),l.jsxs("div",{className:"flex items-center gap-1 justify-self-end",children:[zt(x)&&v?l.jsx(Te,{placement:"top-end",title:S??"",hideTooltip:S==null,className:"cursor-pointer",children:l.jsxs("div",{className:F("inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5",ei(v)),onClick:()=>E?.(k),children:[l.jsx(fn,{size:12,fill:kn(v),fillSecondary:wn(v)}),l.jsxs("span",{className:F("text-xs font-medium leading-4",ti(v)),children:[x,"%"]})]})}):null,b&&ee&&C?l.jsx("button",{id:"btn-dynamic-data-input-add-to-document",className:"cursor-pointer",onClick:()=>ye(n?.toString()||""),type:"button",children:l.jsx(Ze.Tooltip,{placement:"top",title:X("Add to document"),children:l.jsx(ce.NoteAddOutlined,{sx:{fontSize:16,color:D?.[600]||"var(--color-primary-600)"}})})}):null]})]})}),l.jsxs("label",{className:"relative block mt-1",children:[l.jsx("input",{id:t,ref:te,required:o,placeholder:r,className:me(),onChange:fe=>{i(fe.target.value),Y(fe.target?.value)},onKeyDown:oe,value:B!==null?B:n,defaultValue:s,disabled:!0}),l.jsx(or,{id:"btn-dynamic-data-input-rx-cross",onClick:je,className:"absolute inset-y-0 right-1 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:T,children:l.jsx(ce.CloseRounded,{className:"text-neutral-900 dark:text-black-300",sx:{fontSize:16}})}),l.jsx(or,{id:"btn-dynamic-data-input-ai-outline-pic-center",onClick:$,className:"absolute inset-y-0 right-8 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:T,children:l.jsx(ce.TableChartRounded,{className:"text-neutral-900 dark:text-black-300",sx:{fontSize:16}})})]}),a&&l.jsx(ne,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:a}),re&&z&&l.jsx(z,{isVisible:re,onSelect:fe=>{i(fe),Y(fe)},onClose:$,dataKey:c,dataSource:u})]}),ee&&N&&P&&L&&l.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:fe=>fe.stopPropagation(),onMouseDown:fe=>fe.preventDefault(),onKeyDown:fe=>{fe.key==="Escape"&&W(!1)},children:l.jsx(L,{riskDetails:N})})]})});yS.displayName="DynamicDataInputField";const bt=h.forwardRef(({status:t="primary",appearance:e,className:r,disabled:n,children:i,isLoading:a,title:s,id:o,onClick:A,onKeyDown:u,badge:c,type:d="button",options:f,tooltip:p,tooltipPlacement:m="top",shortcuts:b,tooltipShortcuts:y,theme:g="light",autoFocus:x},v)=>{const S=h.useCallback(()=>{switch(e){case"outline":return E();case"ghost":return w();case"dashed":return T();default:return k()}},[e,t,n,g]),k=h.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,g]),E=h.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,g]),w=h.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,g]),T=h.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,g]),O=h.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]),C=il(),N=h.useMemo(()=>b?.length?b.map(D=>{const R=Gu[D];return R?C==="macos"?R.macos:R.other:D}):[],[b,C]),P=()=>l.jsx(l.Fragment,{children:l.jsx(Ie.LoadingSpinnerIcon,{size:20,className:"inline mr-2 text-white dark:text-white"})}),L=d||(t==="primary"&&e==="filled"?"submit":d);return l.jsx(Te,{title:p,placement:m,shortcuts:y,delayShow:!0,children:l.jsxs("button",{ref:v,className:`
|