PageSourceSearch

https://weely.ai/_next/static/chunks/4567-4c04f8383050f05f.js

js weely.ai collected 2026-10-05 13:19:05 UTC 53,685 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4567],{56491:function(e,t,r){var n=r(57437),a=r(2265),l=r(30401),s=r(21047),o=r(28786),i=r(74685),c=r(48741),d=r(32211),u=r(88807);let m=(0,a.forwardRef)((e,t)=>{let{className:r,checked:i,defaultChecked:c,onCheckedChange:d,disabled:u,id:m,...f}=e,x=(0,a.useRef)(null),h=t||x,[g,p]=(0,a.useState)(()=>void 0!==i?i:void 0!==c&&c),b=void 0!==i,y=b?i:g,[v,w]=(0,a.useState)("indeterminate"===y);(0,a.useEffect)(()=>{"indeterminate"===i?w(!0):w(!1)},[i]),(0,a.useEffect)(()=>{h&&h.current&&(h.current.indeterminate=v)},[v,h]);let j=v?"indeterminate":y?"checked":"unchecked";return(0,n.jsxs)("span",{className:"relative inline-flex h-5 w-5 shrink-0 items-center justify-center",children:[(0,n.jsx)("input",{...f,ref:h,id:m,type:"checkbox",className:"peer absolute inset-0 z-10 m-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",checked:b?!0===y:void 0,defaultChecked:b?void 0:c,disabled:u,onChange:e=>{if(u)return;let t=e.target.checked;b||p(t),d&&d(t),f.onChange&&f.onChange(e)}}),(0,n.jsx)("span",{"data-state":j,"aria-hidden":!0,className:(0,o.cn)("pointer-events-none inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-[6px] border-2 bg-white text-white transition-all duration-200 ease-out peer-focus-visible:ring-2 peer-focus-visible:ring-[#06b470]/20 peer-disabled:opacity-50 data-[state=unchecked]:!border-gray-400 data-[state=unchecked]:!border-[1.5px] data-[state=checked]:!border-[#06b470] data-[state=checked]:!bg-[#06b470] data-[state=indeterminate]:!border-[#06b470] data-[state=indeterminate]:!bg-[#06b470] peer-hover:border-[#06b470]",r),children:(0,n.jsx)("span",{"data-state":j,className:(0,o.cn)("flex items-center justify-center text-current transition-transform duration-200 [&[data-state=checked]_.checkbox-minus]:hidden [&[data-state=indeterminate]_.checkbox-check]:hidden"),children:(0,n.jsxs)("span",{className:"relative flex h-4 w-4 items-center justify-center",children:[(0,n.jsx)(l.Z,{className:(0,o.cn)("absolute inset-0 m-auto h-4 w-4 stroke-[3]",y&&!v?"opacity-100":"opacity-0")}),(0,n.jsx)(s.Z,{className:(0,o.cn)("absolute inset-0 m-auto h-4 w-4 stroke-[3]",v?"opacity-100":"opacity-0")})]})})})]})});m.displayName="Checkbox";let f=(0,a.forwardRef)((e,t)=>{let{label:r,checked:a,id:l,name:s,onChange:o,className:f="",checkboxClassName:x="",disabled:h=!1,options:g,otherOption:p,error:b=!1,errorMessage:y,hint:v,value:w=[],required:j=!1,optional:N=!1,...k}=e,C=!!b,S=(0,u.$p)(y,v);if(g&&g.length>0){let e=new Set(g.map(e=>e.value)),t=Array.isArray(w)?w.find(t=>!e.has(t)):void 0,a=void 0!==t,d="Other",x=e=>{if(!o)return;let r=null!=t?t:d;o((Array.isArray(w)?w:[]).map(t=>t===r?e:t))},b=(e,t)=>{if(!o)return;let r=Array.isArray(w)?[...w]:[];t?r.includes(e)||r.push(e):r=r.filter(t=>t!==e),o(r)};return(0,n.jsxs)("div",{className:"space-y-2 ".concat(f),children:[r&&(0,n.jsx)(i.Z,{htmlFor:(0,u.dD)(l,s),required:j,optional:N,children:r}),(0,n.jsxs)("div",{className:"space-y-2.5",children:[g.map(e=>(0,n.jsxs)("label",{className:"flex items-center space-x-3 cursor-pointer select-none ".concat(h?"cursor-not-allowed opacity-60":""),children:[(0,n.jsx)(m,{checked:Array.isArray(w)&&w.includes(e.value),onCheckedChange:t=>b(e.value,t),disabled:h,className:C?"data-[state=unchecked]:!border-red-500":""}),(0,n.jsx)("span",{className:"text-sm font-medium text-gray-700",children:e.label})]},e.value)),p&&(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsxs)("label",{className:"flex items-center space-x-3 cursor-pointer select-none ".concat(h?"cursor-not-allowed opacity-60":""),children:[(0,n.jsx)(m,{checked:a,onCheckedChange:e=>{if(!o)return;let r=Array.isArray(w)?w:[];e?o([...r,d]):void 0!==t&&o(r.filter(e=>e!==t))},disabled:h,className:C?"data-[state=unchecked]:!border-red-500":""}),(0,n.jsx)("span",{className:"text-sm font-medium text-gray-700",children:d})]}),a&&(0,n.jsx)("div",{className:"pl-8 w-full max-w-xs",children:(0,n.jsx)("input",{type:"text",value:t===d?"":t,placeholder:"Please specify",onChange:e=>x(e.target.value),disabled:h,className:"w-full px-3 py-1.5 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#06b470] text-sm bg-white text-gray-800"})})]})]}),S&&(0,n.jsx)(c.z,{error:C,children:S})]})}return(0,n.jsxs)("div",{className:f,children:[(0,n.jsxs)("label",{className:"inline-flex items-center space-x-3 cursor-pointer select-none ".concat(h?"cursor-not-allowed opacity-60":""),children:[(0,n.jsx)(m,{...k,ref:t,id:l,name:s,checked:"boolean"==typeof a||"indeterminate"===a?a:!!w,onCheckedChange:e=>{o&&o(e)},disabled:h,className:"".concat(C?"data-[state=unchecked]:!border-red-500":""," ").concat(x)}),r&&(0,n.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:[r,j&&(0,n.jsx)("span",{className:d.zo.required,
1children:"*"}),N&&!j&&(0,n.jsx)("span",{className:d.zo.optional,children:"(Optional)"})]})]}),S&&(0,n.jsx)(c.z,{error:C,className:"ml-8",children:S})]})});f.displayName="CustomCheckbox",t.Z=f},56459:function(e,t,r){var n=r(57437),a=r(2265),l=r(28786),s=r(74685),o=r(48741),i=r(32211),c=r(88807);let d=a.forwardRef((e,t)=>{let{label:r,required:a=!1,optional:d=!1,type:u="text",id:m,name:f,placeholder:x="",value:h,onChange:g,className:p="",inputClassName:b="",wrapperClassName:y="",inputWrapperClassName:v="",min:w,max:j,step:N,disabled:k=!1,success:C=!1,error:S=!1,hint:D,errorMessage:L,showErrorMessage:M,leftIcon:_=null,rightIcon:Z=null,rightElement:E=null,preventLeadingSpace:z=!1,...U}=e,A=(0,c.dD)(m,f),P=!!(void 0!==M&&M||S),R=(0,i.MK)({disabled:k,error:P,success:C}),F=!1===M?D:(0,c.$p)(L,D);return(0,n.jsxs)(o.W,{className:y,children:[r&&(0,n.jsx)(s.Z,{htmlFor:A,required:a,optional:d,children:r}),(0,n.jsxs)("div",{className:(0,i.m4)(R,v),children:[_&&(0,n.jsx)("div",{className:(0,i.bI)(R,"left"),children:_}),(0,n.jsx)("input",{ref:t,type:u,id:A,name:f,value:h,onChange:e=>{(0,c.rL)(e,z),null==g||g(e)},placeholder:x,disabled:k,min:w,max:j,step:N,className:(0,i.qN)(R,(0,l.cn)(b,p)),...U}),(Z||E)&&(0,n.jsx)("div",{className:(0,i.bI)(R,"right"),children:E||Z})]}),(0,n.jsx)(o.z,{error:P,success:C,children:F})]})});d.displayName="CustomInput",t.Z=d},74685:function(e,t,r){var n=r(57437);r(2265);var a=r(28786),l=r(32211);t.Z=e=>{let{htmlFor:t,children:r,className:s="",required:o=!1,optional:i=!1,disabled:c=!1}=e;return(0,n.jsxs)("label",{htmlFor:t,className:(0,a.cn)(l.zo.base,"break-words [overflow-wrap:anywhere]",c&&l.zo.disabled,s),children:[r,o&&(0,n.jsx)("span",{className:l.zo.required,
1children:"*"}),i&&!o&&(0,n.jsx)("span",{className:l.zo.optional,children:"(Optional)"})]})}},44485:function(e,t,r){r.d(t,{_:function(){return l}});var n=r(57437);r(2265);var a=r(48741);let l="h-4 w-4 shrink-0 cursor-pointer rounded-full appearance-none bg-white border-2 border-gray-300 checked:border-[#06b470] checked:bg-[#06b470] checked:shadow-[inset_0_0_0_3px_#fff] accent-[#06b470] outline-none ring-0 focus:outline-none focus:ring-0 focus-visible:outline-none focus-visible:ring-0 active:outline-none active:ring-0 disabled:cursor-not-allowed disabled:opacity-60";t.Z=e=>{let{name:t,value:r,onChange:s,options:o=[],otherOption:i=!1,layout:c="column",disabled:d=!1,className:u="",error:m,hint:f,label:x,required:h=!1}=e,g=new Set(o.map(e=>e.value)),p=void 0!==r&&""!==r&&!g.has(r),b=p?r:"",y="Other",v=!!m;return(0,n.jsxs)("div",{className:"w-full ".concat(u),children:[x?(0,n.jsxs)("p",{className:"mb-2 text-sm font-semibold text-gray-800",children:[x,h?(0,n.jsx)("span",{className:"ml-0.5 text-app-danger",children:"*"}):null]}):null,(0,n.jsxs)("div",{className:"row"===c?"flex flex-wrap gap-4":"flex flex-col gap-2",role:"radiogroup","aria-invalid":v||void 0,children:[o.map(e=>(0,n.jsxs)("label",{className:"flex cursor-pointer items-center space-x-2.5 ".concat(d?"cursor-not-allowed opacity-60":""),children:[(0,n.jsx)("input",{type:"radio",name:t,value:e.value,checked:r===e.value,onChange:()=>null==s?void 0:s(e.value),disabled:d||e.disabled,className:l}),(0,n.jsx)("span",{className:"text-sm text-gray-700",children:e.label})]},e.value)),i?(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsxs)("label",{className:"flex cursor-pointer items-center space-x-2.5 ".concat(d?"cursor-not-allowed opacity-60":""),children:[(0,n.jsx)("input",{type:"radio",name:t,checked:p,onChange:()=>null==s?void 0:s(y),disabled:d,className:l}),(0,n.jsx)("span",{className:"text-sm text-gray-700",children:y})]}),p?(0,n.jsx)("div",{className:"w-full max-w-xs pl-6",children:(0,n.jsx)("input",{type:"text",value:b===y?"":b,placeholder:"Please specify",onChange:e=>null==s?void 0:s(e.target.value||y),disabled:d,className:"w-full rounded-lg border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-800 focus:outline-none focus:ring-2 focus:ring-[#06b470]/40"})}):null]}):null]}),(0,n.jsx)(a.z,{error:v,children:f})]})}},70979:function(e,t,r){var n=r(57437),a=r(2265),l=r(54887),s=r(30401),o=r(66337),i=r(73247),c=r(32489),d=r(40875),u=r(24902),m=r(28786),f=r(74685),x=r(48741),h=r(32211),g=r(88807);function p(e){let{option:t,isSelected:r,multiple:a,onSelect:l}=e;return(0,n.jsxs)("button",{type:"button",onClick:()=>!t.disabled&&l(t.value),className:(0,m.cn)("w-full text-left px-3.5 py-2 rounded-xl text-sm font-semibold transition-all duration-150 cursor-pointer flex items-center justify-between",(0,h.SF)({isSelected:r,disabled:t.disabled})),children:[(0,n.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[a&&(0,n.jsx)("span",{className:(0,m.cn)("w-4 h-4 rounded border flex items-center justify-center",r?"bg-white text-[#148785] border-white":"border-gray-300"),children:r&&(0,n.jsx)(s.Z,{size:12})}),t.icon&&(0,n.jsx)("span",{className:"shrink-0 flex items-center",children:t.icon}),(0,n.jsx)("span",{className:"truncate",children:t.label}),t.lock&&(0,n.jsx)(u.Z,{title:"Upgrade plan to unlock this feature",arrow:!0,children:(0,n.jsx)("span",{className:"inline-flex items-center text-gray-400 ml-0.5",children:(0,n.jsx)(o.Z,{size:13})})})]}),!a&&r&&(0,n.jsx)(s.Z,{size:16})]})}function b(e){let{enableSearch:t,searchTerm:r,onSearchChange:a,searchPlaceholder:l,searchInputRef:s,filteredOptions:o,multiple:d,selectedSet:u,value:f,onSelect:x,listClassName:g,listStyle:b}=e;return(0,n.jsxs)(n.Fragment,{children:[t&&(0,n.jsx)("div",{className:h.Mi,children:(0,n.jsxs)("div",{className:"relative flex items-center",children:[(0,n.jsx)(i.Z,{size:14,className:"text-gray-400 absolute left-2.5 pointer-events-none"}),(0,n.jsx)("input",{ref:s,type:"text",value:r,onChange:e=>a(e.target.value),placeholder:l,onClick:e=>e.stopPropagation(),className:(0,m.cn)(h.Dc,"pl-8 pr-7")}),r&&(0,n.jsx)("button",{type:"button",onClick:e=>{var t;e.stopPropagation(),a(""),null==s||null===(t=s.current)||void 0===t||t.focus()},className:"absolute right-2 text-gray-400 hover:text-gray-600 p-0.5 rounded cursor-pointer",children:(0,n.jsx)(c.Z,{size:12})})]})}),(0,n.jsx)("div",{className:g,style:b,children:o.length>0?o.map(e=>{let t=d?u.has(e.value):e.value===f;return(0,n.jsx)(p,{option:e,isSelected:t,multiple:d,onSelect:x},e.value)}):(0,n.jsx)("div",{className:"px-4 py-3 text-xs text-gray-400 text-center font-medium",children:"No options available"})})]})}let y=a.forwardRef((e,t)=>
1{let{id:r,name:s,value:o,onChange:i,multiple:c=!1,selectedValues:p,onSelectionChange:y,disabled:v=!1,required:w=!1,optional:j=!1,placeholder:N="Select an option",className:k="",wrapperClassName:C="",menuClassName:S="",selectClassName:D="",error:L=!1,errorMessage:M,hint:_,options:Z=[],label:E,tooltipTitle:z,enableSearch:U=!1,isSelectAbsolute:A=!1,searchPlaceholder:P="Search..."}=e,[R,F]=(0,a.useState)(!1),[I,W]=(0,a.useState)(""),T=(0,a.useRef)(null),B=(0,a.useRef)(null),q=(0,a.useRef)(null),[O,G]=(0,a.useState)(null),V=(0,g.dD)(r,s),$="select-portal-".concat(V||"menu"),K=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(e=>{var t,r;return"object"==typeof e&&null!==e?{...e,disabled:null!==(r=null!==(t=e.disabled)&&void 0!==t?t:e.lock)&&void 0!==r&&r}:{label:String(e),value:String(e),disabled:!1}})}(Z),H=!!L,Q=(0,h.MK)({disabled:v,error:H});(0,a.useEffect)(()=>{if(R&&U){let e=setTimeout(()=>{var e;null===(e=q.current)||void 0===e||e.focus()},50);return()=>clearTimeout(e)}W("")},[R,U]);let Y=(0,a.useCallback)(e=>{if(c){let t=Array.from(e.target.selectedOptions).map(e=>e.value);null==y||y(t)}null==i||i(e)},[c,y,i]);(0,a.useEffect)(()=>{let e=e=>{if(B.current&&!B.current.contains(e.target)){let t=document.getElementById($);t&&t.contains(e.target)||F(!1)}};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[$]),(0,a.useEffect)(()=>{let e=e=>{"Escape"===e.key&&F(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]);let J=(0,a.useCallback)(()=>{if(!A||!R||!B.current)return;let e=B.current.getBoundingClientRect(),t=window.innerHeight-e.bottom,r=e.top,n=t<80&&r>t,a=Math.max(80,Math.min(240,(n?r:t)-4-8)),l=Math.max(e.width,200),s=window.innerWidth,o=e.left;o+l>s-16&&(o=Math.max(16,s-l-16)),G({top:n?e.top-4-a:e.bottom+4,left:o,width:l,maxHeight:a})},[A,R]);(0,a.useEffect)(()=>{if(!A||!R){G(null);return}J();let e=()=>J();return window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[A,R,J]);let X=K.find(e=>e.value===o),ee=new Set(c&&p||[]),et=U&&I.trim()?K.filter(e=>e.label.toLowerCase().includes(I.trim().toLowerCase())):K,er=e=>{if(!v){if(c){if(!y)return;if(""===e){y([]),F(!1),W("");return}let t=Array.isArray(p)?p:[];y(t.includes(e)?t.filter(t=>t!==e):[...t,e]);return}i&&i({target:{value:e,name:s},currentTarget:{value:e,name:s}}),F(!1),W("")}},en=c?(p||[]).map(e=>{var t;return null===(t=K.find(t=>t.value===e))||void 0===t?void 0:t.label}).filter(Boolean).join(", "):"",ea=c?!!en:!!o,el=c?en||N:X?X.label:N;return(0,n.jsxs)(x.W,{className:C,children:[E&&(0,n.jsxs)("div",{className:"flex gap-2 items-center mb-1.5 text-left",children:[(0,n.jsx)(f.Z,{htmlFor:V,required:w,optional:j,disabled:v,className:"mb-0",children:E}),z&&(0,n.jsx)(u.Z,{title:z,placement:"top",arrow:!0,children:(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 hover:text-gray-600 cursor-pointer",fill:"currentColor",viewBox:"0 0 20 20",children:(0,n.jsx)("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})})})]}),(0,n.jsxs)("div",{className:"relative w-full",ref:B,children:[(0,n.jsxs)("button",{type:"button",disabled:v,onClick:()=>!v&&F(e=>!e),style:{outline:"none"},className:(0,h.MH)({state:Q,isOpen:R,extraClass:(0,m.cn)(D,k)}),children:[(0,n.jsxs)("span",{className:(0,m.cn)("truncate pr-2 text-left flex items-center gap-2",ea?"text-gray-800":"text-gray-400"),children:[!c&&(null==X?void 0:X.icon)&&(0,n.jsx)("span",{className:"shrink-0 flex items-center",children:X.icon}),(0,n.jsx)("span",{className:"truncate",children:el})]}),(0,n.jsx)(d.Z,{className:(0,m.cn)("w-4 h-4 text-gray-500 shrink-0 transition-transform duration-200",R&&"rotate-180 text-green-600")})]}),(0,n.jsxs)("select",{id:V,name:s,ref:e=>{T.current=e,"function"==typeof t?t(e):t&&(t.current=e)},multiple:c,value:c?p||[]:o,disabled:v,required:!1,onChange:Y,className:"sr-only",tabIndex:-1,"aria-hidden":"true",children:[N&&(0,n.jsx)("option",{value:"",children:N}),K.map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))]}),R&&!v&&!A&&(0,n.jsx)("div",{className:(0,m.cn)("absolute left-0 top-full mt-1 w-full z-[999] animate-in fade-in-50 zoom-in-95 duration-100",h.pL,S),children:(0,n.jsx)(b,{enableSearch:U,searchTerm:I,onSearchChange:W,searchPlaceholder:P,searchInputRef:q,filteredOptions:et,multiple:c,selectedSet:ee,value:o,onSelect:er,listClassName:"max-h-60 overflow-y-auto space-y-1 pr-0.5 custom-scrollbar"})}),R&&!v&&A&&O&&(0,l.createPortal)((0,n.jsx)("div",{id:$,style:{to
1p:O.top,left:O.left,width:O.width},className:(0,m.cn)("fixed",h.pL,S||"z-[100000]"),children:(0,n.jsx)(b,{enableSearch:U,searchTerm:I,onSearchChange:W,searchPlaceholder:P,searchInputRef:q,filteredOptions:et,multiple:c,selectedSet:ee,value:o,onSelect:er,listClassName:"overflow-y-auto space-y-1 pr-0.5 custom-scrollbar",listStyle:{maxHeight:O.maxHeight}})}),document.body)]}),(0,n.jsx)(x.z,{error:H,children:H&&M||_})]})});y.displayName="CustomSelect",t.Z=y},7799:function(e,t,r){var n=r(57437),a=r(2265),l=r(48741),s=r(32211),o=r(88807);let i=a.forwardRef((e,t)=>{let{id:r,name:a,placeholder:i,value:c="",onChange:d,rows:u=4,className:m="",disabled:f=!1,error:x=!1,hint:h,showCharacterCount:g=!1,maxLength:p,characterCountLabel:b="characters",preventLeadingSpace:y=!1,...v}=e,w=!!x,j=(0,s.MK)({disabled:f,error:w}),N="string"==typeof c?c.length:0;return(0,n.jsxs)("div",{className:"w-full",children:[(0,n.jsx)("textarea",{id:r,name:a,rows:u,placeholder:i,value:c,onChange:e=>{(0,o.rL)(e,y),null==d||d(e)},disabled:f,maxLength:p,className:(0,s.tU)(j,m),ref:t,...v}),(h||g&&p)&&(0,n.jsxs)("div",{className:"mt-1 flex items-center justify-between text-xs",children:[h?(0,n.jsx)(l.z,{error:w,className:"mt-0",children:h}):(0,n.jsx)("span",{}),g&&p&&(0,n.jsxs)("span",{className:"text-gray-400",children:[N,"/",p," ",b]})]})]})});i.displayName="CustomTextArea",t.Z=i},48741:function(e,t,r){r.d(t,{W:function(){return s},z:function(){return o}});var n=r(57437);r(2265);var a=r(28786),l=r(32211);function s(e){let{className:t="",children:r}=e;return(0,n.jsx)("div",{className:(0,a.cn)(l.t3,t),children:r})}function o(e){let{error:t=!1,success:r=!1,className:s="",children:o}=e;return o?(0,n.jsx)("p",{className:(0,a.cn)((0,l.QQ)(t,r),t?"weely-form-error":"",s),role:t?"alert":void 0,children:o}):null}},32211:function(e,t,r){r.d(t,{Dc:function(){return N},MH:function(){return v},MK:function(){return c},Mi:function(){return j},QQ:function(){return i},SF:function(){return k},YG:function(){return S},bI:function(){return x},m4:function(){return u},pL:function(){return w},q3:function(){return b},qN:function(){return f},t3:function(){return l},tU:function(){return g},zo:function(){return s}});var n=r(28786);let a={DISABLED:"disabled",ERROR:"error",SUCCESS:"success",DEFAULT:"default"},l="w-full",s={base:"mb-1.5 block text-sm font-semibold text-left text-gray-800",disabled:"text-app-light-grey",required:"text-app-danger ml-0.5",optional:"font-semibold text-gray-800 ml-1"},o="mt-1.5 text-xs text-left font-medium",i=(e,t)=>e?"".concat(o," ").concat("!text-red-500 text-app-danger"):t?"".concat(o," ").concat("!text-green-600 text-app-success"):"".concat(o," ").concat("text-gray-500 text-app-light-grey");function c(){let{disabled:e=!1,error:t=!1,success:r=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e?a.DISABLED:t?a.ERROR:r?a.SUCCESS:a.DEFAULT}let d={disabled:"bg-[#F3F4F6] border-gray-300 cursor-not-allowed opacity-90",error:"bg-white !border-red-500 border-red-500 focus-within:!border-red-500 focus-within:ring-2 focus-within:ring-red-500/20",success:"bg-white border-green-500 focus-within:border-green-500",default:"bg-white border-gray-300 focus-within:border-green-500 ".concat("[&:has(input:-webkit-autofill)]:!bg-[#e8f0fe] [&:has(input:-webkit-autofill)]:!border-[#93c5fd] [&:has(input:autofill)]:!bg-[#e8f0fe] [&:has(input:autofill)]:!border-[#93c5fd]")};function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,n.cn)("w-full h-[42px] rounded-md px-3 py-2 border transition-all duration-200 flex items-center gap-3",d[e],t)}let m={disabled:"text-app-light-grey cursor-not-allowed",error:"text-gray-800",success:"text-gray-800",default:"text-gray-800"};function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,n.cn)("focus:!bg-transparent focus:!outline-none !border-none !p-0 !m-0 w-full !bg-transparent text-sm","[&:-webkit-autofill]:[box-shadow:0_0_0px_1000px_transparent_inset!important] [&:-webkit-autofill]:[-webkit-box-shadow:0_0_0px_1000px_transparent_inset!important] [&:autofill]:[box-shadow:0_0_0px_1000px_transparent_inset!important] [&:autofill]:[-webkit-box-shadow:0_0_0px_1000px_transparent_inset!important]",m[e],t)}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"left",r=e===a.DISABLED?"text-gray-400":e===a.ERROR?"text-app-danger":"left"===t?"text-[#b3b8c1]":"text-app-light-grey";return(0,n.cn)(r,"flex items-center shrink-0")}let h={disabled:"text-app-light-grey bg-gray-100 border-gray-300 cursor-not-allowed",error:"text-gray-800 !border-red-500 border-red-500 focus:ring-2 focus:ring-red-500/20 focus:!border-red-500 bg-white",default:"bg-white text-gray-800 border-gray-300 focus:border-green-500"};function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,n.cn)("w-full rounded-lg border p-3 text-sm transition-colors duration-200 focus:outline-none",h[e]||h.default,t)}let p={disabled:"bg-gray-100 border-gray-300 cursor-not-allowed text-gray-400",error:"border-red-400 bg-red-50/50",default:"border-gray-300 hover:border-blue-500 bg-white"};function b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,n.cn)("border-2 border-dashed rounded-xl p-4 text-center cursor-pointer transition-colors duration-200 flex flex-col items-center justify-center gap-2",p[e]||p.default,t)}let y={disabled:"opacity-60 cursor-not-allowed bg-gray-50",error:"!border-red-500 focus:!border-red-500",default:"cursor-pointer hover:border-gray-400"};function v(){let{state:e,isOpen:t,extraClass:r=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,n.cn)("w-full flex items-center justify-between px-3.5 py-2.5 min-h-[42px] bg-white border border-gray-300 rounded-xl text-sm font-medium text-gray-800 shadow-xs transition-all duration-150 outline-none focus:outline-none focus-visible:outline-none focus:ring-0 focus-visible:ring-0 focus:border-green-500",y[e],t&&"!border-green-500",r)}let w="bg-white border border-gray-200 rounded-2xl p-1.5 shadow-xl min-w-[200px]",j="sticky top-0 z-10 py-1 bg-white border-b border-gray-100 mb-1 px-1",N="w-full px-3 py-1.5 text-sm border border-gray-200 rounded-lg bg-gray-50 text-gray-800 placeholder:text-gray-400 outline-none focus:outline-none focus-visible:outline-none focus:ring-0 focus:border-green-500";function k(){let{isSelected:e,disabled:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e?"bg-emerald-50 text-emerald-800 font-medium shadow-xs":t?"text-gray-300 cursor-not-allowed opacity-60":"text-gray-700 bg-transparent hover:bg-gray-100 hover:text-gray-900"}let C={error:"border-red-500 focus:ring-red-500/20",default:"border-gray-300 hover:border-emerald-500 focus:ring-emerald-500"};function S(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,n.cn)("flex w-full min-w-[200px] items-center justify-between rounded-lg border bg-white px-4 py-2.5 text-sm transition focus:outline-none focus:ring-2 disabled:cursor-not-allowed disabled:bg-gray-100 cursor-pointer",C[e]||C.default,t)}},44567:function(e,t,r){r.d(t,{hU:function(){return I},_H:function(){return c._},Px:function(){return q},Xl:function(){return i.Z},z4:function(){return z},Ip:function(){return A},t7:function(){return s.Z},UN:function(){return l.Z},rG:function(){return c.Z},AP:function(){return o.Z},Ks:function(){return d.Z},mx:function(){return W},hz:function(){return T}});var n=r(32211),a=r(48741),l=r(74685),s=r(56459),o=r(70979),i=r(56491),c=r(44485),d=r(7799),u=r(57437),m=r(2265),f=r(54887),x=r
1(92451),h=r(10407),g=r(88501),p=r(23988);r(19590);var b=r(54405),y=r(71519),v=r(26213),w=r(52255),j=r(8971),N=r(38549),k=r(88828),C=r(88807);let S=[{key:"today",label:"Today",getValue:()=>({from:(0,b.b)(new Date),to:(0,y.i)(new Date)})},{key:"yesterday",label:"Yesterday",getValue:()=>({from:(0,b.b)((0,v.k)(new Date,1)),to:(0,y.i)((0,v.k)(new Date,1))})},{key:"7",label:"Last 7 Days",getValue:()=>({from:(0,b.b)((0,v.k)(new Date,6)),to:(0,y.i)(new Date)})},{key:"15",label:"Last 15 Days",getValue:()=>({from:(0,b.b)((0,v.k)(new Date,14)),to:(0,y.i)(new Date)})},{key:"30",label:"Last 30 Days",getValue:()=>({from:(0,b.b)((0,v.k)(new Date,29)),to:(0,y.i)(new Date)})},{key:"90",label:"Last 90 Days",getValue:()=>({from:(0,b.b)((0,v.k)(new Date,89)),to:(0,y.i)(new Date)})}],D=e=>{if(null==e||""===e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;if("string"==typeof e){let t=e.match(/^(\d{4})-(\d{2})-(\d{2})/);if(t)return new Date(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10));let r=new Date(e);return isNaN(r.getTime())?null:r}if("number"==typeof e){let t=new Date(e);return isNaN(t.getTime())?null:t}return null},L="inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-gray-200 bg-white hover:bg-gray-100",M=e=>{let{dense:t,multiMonth:r}=e;return{root:"w-full",months:r?"flex w-full max-w-none flex-row justify-center gap-8":"flex w-full max-w-none justify-center",month:r?"relative w-[280px] shrink-0":"relative w-full",month_caption:r?"hidden":"relative mb-2 flex h-9 w-full items-center justify-center px-10",caption_label:"pointer-events-none text-sm font-semibold text-gray-900 xl:text-base",button_previous:r?"hidden":"absolute top-0 left-0 z-10 ".concat(L),button_next:r?"hidden":"absolute top-0 right-0 z-10 ".concat(L),month_grid:"w-full table-fixed border-collapse",weekdays:"flex w-full",weekday:t?"w-[14.285%] py-1 text-center text-[10px] font-semibold uppercase text-gray-500":"w-[14.285%] py-1 text-center text-xs font-semibold uppercase text-gray-500",weeks:"w-full",week:"flex w-full",day:"w-[14.285%] p-0 text-center",day_button:t?"mx-auto flex h-8 w-8 items-center justify-center rounded-md text-xs transition hover:bg-emerald-500 [[data-selected]_&]:hover:!bg-emerald-600 [[data-selected]_&]:focus:!bg-emerald-600":"mx-auto flex h-9 w-9 items-center justify-center rounded-lg text-sm transition hover:bg-emerald-50 [[data-selected]_&]:hover:!bg-emerald-600 [[data-selected]_&]:focus:!bg-emerald-600",today:"border border-emerald-500 font-semibold text-emerald-700",selected:"bg-emerald-600 text-white",range_start:"bg-emerald-600 text-white rounded-l-full [&>button]:!rounded-l-full",range_middle:"bg-emerald-100 rounded-none [&>button]:!rounded-none",range_end:"bg-emerald-600 text-white rounded-r-full [&>button]:!rounded-r-full",outside:"text-gray-300",disabled:"text-gray-300 cursor-not-allowed",hidden:"invisible"}},_=e=>{let{dense:t,multiMonth:r}=e;return{width:"100%","--rdp-day-height":t?"32px":"36px","--rdp-day-width":t?"32px":"36px","--rdp-day_button-height":t?"30px":"34px","--rdp-day_button-width":t?"30px":"34px","--rdp-nav-height":"2.25rem","--rdp-nav_button-height":"2rem","--rdp-nav_button-width":"2rem","--rdp-months-gap":r?"2rem":"0"}},Z=e=>{let{month:t,onPrev:r,onNext:n}=e;return(0,u.jsxs)("div",{className:"mb-3 flex items-center justify-between",style:{width:656},children:[(0,u.jsx)("button",{type:"button",onClick:r,className:L,"aria-label":"Previous month",children:(0,u.jsx)(x.Z,{className:"h-4 w-4"})}),(0,u.jsxs)("div",{className:"flex items-center gap-8",children:[(0,u.jsx)("span",{className:"text-center text-base font-semibold text-gray-900",style:{width:280},children:(0,w.WU)(t,"MMMM yyyy")}),(0,u.jsx)("span",{className:"text-center text-base font-semibold text-gray-900",style:{width:280},children:(0,w.WU)((0,j.z)(t,1),"MMMM yyyy")})]}),(0,u.jsx)("button",{type:"button",onClick:n,className:L,"aria-label":"Next month",children:(0,u.jsx)(h.Z,{className:"h-4 w-4"})})]})},E=(0,m.forwardRef)((e,t)=>{let{id:r,name:s,label:o,required:i=!1,optional:c=!1,mode:d="single",value:v,onCh
1ange:L,onBlur:E,placeholder:z="Select Date",disabled:U=!1,showPresets:A,error:P=!1,errorMessage:R,hint:F,min:I,max:W,minDate:T,maxDate:B,wrapperClassName:q="",className:O="",additionalPresets:G=[],onApply:V,onCancel:$,inline:K=!1,compact:H=!1,...Q}=e,Y=(0,m.useRef)(null),J=t||Y,X="range"===String(d),[ee,et]=(0,m.useState)(!1),er=(0,m.useMemo)(()=>"single"===d?D(v):X&&v&&"object"==typeof v?{from:D(v.from),to:D(v.to)}:v,[v,d,X]),[en,ea]=(0,m.useState)(er),[el,es]=(0,m.useState)(X?(null==er?void 0:er.from)||new Date:er||new Date),[eo,ei]=(0,m.useState)(""),ec=(0,m.useMemo)(()=>D(T||I),[T,I]),ed=(0,m.useMemo)(()=>D(B||W),[B,W]),eu=(0,m.useMemo)(()=>{if(U)return!0;let e=[];if(ec&&e.push({before:(0,b.b)(ec)}),ed&&e.push({after:(0,y.i)(ed)}),0!==e.length)return 1===e.length?e[0]:e},[U,ec,ed]),em=void 0!==A?A:X,ef=(0,C.dD)(r,s),ex=!!P,eh=(0,C.$p)(R,F),eg=(0,k.ac)({maxWidth:767}),ep=(0,k.ac)({minWidth:1280}),eb=(0,m.useMemo)(()=>{try{if(Array.isArray(G)){if(G.length>0)return G}else if(null!=G&&"object"==typeof G){let e=Object.keys(G);if(e.length>0)return e.map(e=>{let t=G[e],r=Array.isArray(t)?t[0]:t;return{key:e.toLowerCase().replace(/\s+/g,"-"),label:e,getValue:()=>r}})}}catch(e){console.warn("CustomDatePicker: additionalPresets parse error:",e)}return S.slice()},[G]);(0,m.useEffect)(()=>{ea(er),X?(null==er?void 0:er.from)&&es(er.from):er instanceof Date&&es(er)},[er,X]),(0,m.useEffect)(()=>{if(ee&&!H&&!K)return;let e=e=>{J.current&&!J.current.contains(e.target)&&et(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[J,ee,H,K]),(0,m.useEffect)(()=>{if(!ee||H||K)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[ee,H,K]);let ey=(0,m.useMemo)(()=>"single"===d?en instanceof Date?(0,w.WU)(en,"dd MMM yyyy"):z:(null==en?void 0:en.from)?en.to?"".concat((0,w.WU)(en.from,"dd MMM yyyy")," - ").concat((0,w.WU)(en.to,"dd MMM yyyy")):(0,w.WU)(en.from,"dd MMM yyyy"):z,[en,d,z]),ev=e=>{let t;try{t="function"==typeof e.getValue?e.getValue():e}catch(r){t=e}let r=t&&t.from?t:t instanceof Date?{from:(0,b.b)(t),to:(0,y.i)(t)}:{from:new Date,to:new Date};ea(r),es(r.from),ei(e.key||e.label||"")},ew=()=>{ea(void 0),ei("")},ej=H||K,eN=ee&&!ej,ek=eg||H,eC=ek||!ep?1:X?2:1,eS=!H&&X&&!!em&&eb.length>0,eD=eS&&ep&&!eg,eL="single"===d?en instanceof Date?(0,w.WU)(en,"dd MMM yyyy"):"No date selected":(null==en?void 0:en.from)?"".concat((0,w.WU)(en.from,"dd MMM yyyy")).concat(en.to?" - ".concat((0,w.WU)(en.to,"dd MMM yyyy")):""):"No range selected",eM=()=>(0,u.jsxs)("div",{className:"border-b border-gray-100 bg-gray-50 px-4 py-3",children:[(0,u.jsx)("p",{className:"mb-2 text-[10px] font-semibold uppercase tracking-wide text-gray-500",children:"Quick select"}),(0,u.jsx)("div",{className:"grid grid-cols-3 gap-2",children:eb.map(e=>(0,u.jsx)("button",{type:"button",onClick:()=>ev(e),className:"rounded-lg px-2 py-2 text-xs font-medium transition ".concat(eo===e.key?"bg-emerald-600 text-white shadow-sm":"bg-white text-gray-700 border border-gray-200 hover:border-emerald-300 hover:bg-emerald-50"),children:e.label},e.key))})]}),e_=(0,u.jsxs)("div",{className:"flex flex-col min-w-0 flex-1 ".concat(ek?"px-4 pb-4 pt-2":"px-5 py-4"),children:[(0,u.jsxs)("div",{className:ek?"mx-auto w-full max-w-[320px]":eC>1?"mx-auto w-fit":"w-full",children:[eC>1&&(0,u.jsx)(Z,{month:el instanceof Date?el:new Date(el),onPrev:()=>es(e=>(0,N.W)(e instanceof Date?e:new Date(e),1)),onNext:()=>es(e=>(0,j.z)(e instanceof Date?e:new Date(e),1))}),(0,u.jsx)(p._,{mode:d,selected:en,onSelect:e=>{if(ea(e),ei(""),H){if("single"===d){null==L||L(e),e&&et(!1);return}null==L||L(e),(null==e?void 0:e.from)&&(null==e?void 0:e.to)&&et(!1)}},month:el,onMonthChange:es,numberOfMonths:eC,navLayout:eC>1?void 0:"around",hideNavigation:eC>1,pagedNavigation:X&&eC>1,fixedWeeks:!1,showOutsideDays:!0,startMonth:ec?(0,b.b)(ec):void 0,endMonth:ed?(0,y.i)(ed):void 0,disabled:eu,classNames:M({dense:ek,multiMonth:eC>1}),style:_({dense:ek,multiMonth:eC>1}),components:{Chevron:e=>{let{orientation:t}=e;return"left"===t?(0,u.jsx)(x.Z,{className:"h-4 w-4"}):(0,u.jsx)(h.Z,{className:"h-4 w-4"})}}})]}),!H&&!eg&&(0,u.jsxs)("div",{className:"mt-3 rounded-lg border bg-gray-50 px-3 py-2",children:[(0,u.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-gray-500",children:"Selected"}),(0,u.jsx)("div",{className:"mt-0.5 text-sm font-medium text-gray-900 truncate",children:eL})]}),H?(0,u.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-2 border-t border-gray-100 pt-2",children:[(0,u.jsxs)("div",{className:"flex items-center gap-1",children:[(0,u.jsx)("button",{type:"button",onClick:()=>{ew(),null==L||L(void 0)},className:"rounded-md px-2 py-1 text-xs text-gray-600 hover:bg-gray-100",children:"Clear"}),(0,u.jsx)("button",{type:"button",onClick:()=>
1{if("single"===d){let e=new Date,t=new Date(e.getFullYear(),e.getMonth(),e.getDate());ea(t),es(t),ei(""),null==L||L(t),et(!1);return}let e={from:new Date,to:new Date};ea(e),es(e.from),ei(""),null==L||L(e),et(!1)},className:"rounded-md px-2 py-1 text-xs font-medium text-emerald-600 hover:bg-emerald-50",children:"Today"})]}),(0,u.jsx)("button",{type:"button",onClick:()=>et(!1),className:"rounded-md px-2.5 py-1 text-xs font-semibold text-gray-700 hover:bg-gray-100",children:"Done"})]}):(0,u.jsxs)("div",{className:"mt-4 border-t border-gray-100 pt-4 ".concat(eg?"flex flex-col gap-3":"flex items-center justify-between gap-3"),children:[(0,u.jsxs)("div",{className:"flex items-center gap-3",children:[(0,u.jsx)("button",{type:"button",onClick:ew,className:"text-sm text-gray-600 hover:text-gray-900",children:"Clear"}),!eg&&(0,u.jsx)("button",{type:"button",onClick:()=>{if("single"===d){let e=new Date,t=new Date(e.getFullYear(),e.getMonth(),e.getDate());ea(t),es(t)}else{let e={from:new Date,to:new Date};ea(e),es(e.from)}ei("")},className:"text-sm font-medium text-emerald-600 hover:text-emerald-700",children:"Today"})]}),(0,u.jsxs)("div",{className:"flex items-center gap-2 ".concat(eg?"w-full":""),children:[(0,u.jsx)("button",{type:"button",onClick:()=>{ea(er),null==$||$(),et(!1)},className:"rounded-lg border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 ".concat(eg?"flex-1 py-2.5":"px-4 py-2"),children:"Cancel"}),(0,u.jsx)("button",{type:"button",onClick:()=>{null==L||L(en),null==V||V(en),et(!1)},className:"rounded-lg bg-emerald-600 text-sm font-medium text-white hover:bg-emerald-700 ".concat(eg?"flex-1 py-2.5":"px-5 py-2"),children:"Apply"})]})]})]}),eZ=eN&&(0,u.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/40 p-3",role:"presentation",onMouseDown:e=>{e.target===e.currentTarget&&et(!1)},children:(0,u.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":X?"Select date range":"Select date",onMouseDown:e=>e.stopPropagation(),className:["bg-white shadow-2xl border border-gray-200 overflow-hidden","flex flex-col max-h-[calc(100dvh-1.5rem)]",eg?"w-full max-w-[380px] rounded-2xl":"w-auto max-w-[min(920px,calc(100vw-2rem))] rounded-xl"].join(" "),children:[(0,u.jsxs)("div",{className:"flex items-center justify-between gap-3 px-4 pt-4 pb-2 shrink-0",children:[(0,u.jsxs)("div",{className:"min-w-0",children:[(0,u.jsx)("span",{className:"block text-sm font-semibold text-gray-900",children:X?"Select date range":"Select date"}),eg&&(0,u.jsx)("span",{className:"block text-xs text-gray-500 truncate mt-0.5",children:eL})]}),(0,u.jsx)("button",{type:"button",onClick:()=>et(!1),className:"shrink-0 rounded-lg px-2.5 py-1.5 text-xs font-semibold text-gray-500 hover:bg-gray-100",children:"Close"})]}),eS&&!eD&&eM(),(0,u.jsxs)("div",{className:"flex min-h-0 ".concat(eD?"flex-row":"flex-col"),children:[eD&&(0,u.jsxs)("aside",{className:"w-44 shrink-0 border-r border-gray-200 bg-gray-50 p-3",children:[(0,u.jsx)("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-gray-500",children:"Presets"}),(0,u.jsx)("div",{className:"space-y-1",children:eb.map(e=>(0,u.jsx)("button",{type:"button",onClick:()=>ev(e),className:"flex w-full items-center rounded-md px-2.5 py-1.5 text-left text-sm transition ".concat(eo===e.key?"bg-emerald-100 text-emerald-700 font-medium":"text-gray-700 hover:bg-gray-200"),children:e.label},e.key))})]}),e_]})]})});return(0,u.jsxs)("div",{ref:J,className:"w-full ".concat(q),children:[o&&(0,u.jsx)(l.Z,{htmlFor:ef,required:i,optional:c,children:o}),(0,u.jsxs)("div",{className:"relative w-full ".concat(H?"block":"inline-block"),children:[(0,u.jsxs)("button",{type:"button",id:ef,name:s,disabled:U,onClick:()=>et(e=>!e),onBlur:E,className:(0,n.YG)(ex?"error":"default",H?"min-w-0 !px-3 !py-2 !text-sm ".concat(O):O),...Q,children:[(0,u.jsx)("span",{className:"truncate font-medium text-left",children:ey}),(0,u.jsx)(g.Z,{size:H?16:18,className:"text-gray-500 shrink-0"})]}),eN&&"undefined"!=typeof document&&(0,f.createPortal)(eZ,document.body),ee&&ej&&(0,u.jsx)("div",{className:H?"w-full rounded-lg border border-gray-200 bg-white shadow-sm overflow-hidden mt-2":"w-full rounded-xl border border-gray-200 bg-white shadow-sm overflow-hidden mt-3",children:(0,u.jsxs)("div",{className:"flex flex-col",children:[eS&&eM(),e_]})})]}),(0,u.jsx)(a.z,{error:ex,children:eh})]})});E.displayName="CustomDatePicker";var z=E,U=r(17689),A=e=>{let{id:t,name:r,label:s,placeholder:o="Click or drag files here to upload",accept:i,acceptLabel:c,multiple:d=!1,disabled:f=!1,required:x=!1,className:h="",error:g=!1,errorMessage:p,hint:b,value:y,onChange:v}=e,w=(0,m.useRef)(null),j=(0,m.useRef)(0),[N,k]=(0,m.useState)(!1),S=(0,C.dD)(t,r),D=!!g,L=(0,n.MK)({disabled:f,error:D}),M=y?"undefined"!=typeof File&&y instanceof File?[y]:"undefined"!=typeof FileList&&y instanceof FileList?Array.from(y):Array.isArray(y)?y.filter(
1Boolean):[]:[],_=e=>{e&&0!==e.length&&(null==v||v({target:{files:e}}))},Z=()=>{w.current&&(w.current.value="")};(0,m.useEffect)(()=>{y||Z()},[y]);let E=()=>{!f&&w.current&&w.current.click()},z=c||null;return(0,u.jsxs)(a.W,{className:h,children:[s&&(0,u.jsx)(l.Z,{htmlFor:S,required:x,children:s}),(0,u.jsxs)("div",{role:"button",tabIndex:f?-1:0,onClick:E,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),E())},onDragEnter:e=>{var t,r,n;e.preventDefault(),e.stopPropagation(),!f&&(j.current+=1,(null===(n=e.dataTransfer)||void 0===n?void 0:null===(r=n.types)||void 0===r?void 0:null===(t=r.includes)||void 0===t?void 0:t.call(r,"Files"))&&k(!0))},onDragOver:e=>{e.preventDefault(),e.stopPropagation(),!f&&e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),j.current=Math.max(0,j.current-1),0===j.current&&k(!1)},onDrop:e=>{var t;if(e.preventDefault(),e.stopPropagation(),j.current=0,k(!1),f)return;let r=null===(t=e.dataTransfer)||void 0===t?void 0:t.files;if(!(null==r?void 0:r.length))return;if(d){_(r);return}let n=new DataTransfer;n.items.add(r[0]),_(n.files),w.current&&(w.current.files=n.files)},className:(0,n.q3)(L,["min-w-0 overflow-hidden px-3",N&&!f?"border-[#06b470] bg-emerald-50/60 ring-2 ring-[#06b470]/20":""].filter(Boolean).join(" ")),"aria-disabled":f,children:[(0,u.jsx)(U.Z,{className:"h-6 w-6 shrink-0 ".concat(N?"text-[#06b470]":"text-gray-400")}),(0,u.jsx)("p",{className:"max-w-full px-1 text-xs font-medium text-gray-600",children:N?"Drop file to upload":M.length>0?"".concat(M.length," file(s) selected"):o}),z?(0,u.jsxs)("span",{className:"max-w-full break-words px-1 text-center text-[11px] leading-snug text-gray-400",children:["Allowed: ",z]}):null]}),(0,u.jsx)("input",{ref:w,type:"file",id:S,name:r,accept:i,multiple:d,disabled:f,onChange:e=>{_(e.target.files)},className:"hidden"}),M.length>0&&(0,u.jsx)("ul",{className:"mt-2 space-y-1 text-left text-xs text-gray-600",children:M.map((e,t)=>(0,u.jsxs)("li",{className:"truncate",children:[e.name," (",Math.round(e.size/1024)," KB)"]},t))}),(0,u.jsx)(a.z,{error:D,children:D&&p||b})]})},P=r(64627),R=r(67168),F=r(32193);let I=(0,P.ox)().map(e=>({code:e,name:F.Z[e]||e,Flag:R.ZP[e]})).sort((e,t)=>e.name.localeCompare(t.name)),W=e=>e?I.find(t=>t.code.toUpperCase()===String(e).toUpperCase()):null,T=e=>e?I.find(t=>t.name.toLowerCase()===String(e).toLowerCase()):null,B=(0,m.forwardRef)((e,t)=>{let{id:r,name:n,label:a,value:l,onChange:s,placeholder:i="Select a country",disabled:c=!1,required:d=!1,optional:f=!1,error:x=!1,hint:h,errorMessage:g,className:p="",wrapperClassName:b="",menuClassName:y="",selectClassName:v="",valueType:w="iso",showFlag:j=!0,showIso:N=!0,priorityCountries:k=["US","GB","CA","AU","IN"],onlyCountries:C=[],excludeCountries:S=[],enableSearch:D=!0,searchPlaceholder:L="Search countries...",isSelectAbsolute:M=!0,multiple:_=!1,selectedValues:Z,onSelectionChange:E,...z}=e,U=(0,m.useMemo)(()=>{let e=I;if(C&&C.length>0){let t=new Set(C.map(e=>String(e).toUpperCase()));e=e.filter(e=>t.has(e.code))}if(S&&S.length>0){let t=new Set(S.map(e=>String(e).toUpperCase()));e=e.filter(e=>!t.has(e.code))}if(k&&k.length>0){let t=new Set(k.map(e=>String(e).toUpperCase()));return[...k.map(t=>e.find(e=>e.code===String(t).toUpperCase())).filter(Boolean),...e.filter(e=>!t.has(e.code))]}return e},[k,C,S]),A=(0,m.useMemo)(()=>U.map(e=>{let t="name"===w?e.name:e.code,r=e.Flag;return{value:t,label:N?"".concat(e.name," (").concat(e.code,")"):e.name,code:e.code,countryName:e.name,icon:j&&r?(0,u.jsx)("span",{className:"w-5 h-3.5 overflow-hidden rounded-[2px] shadow-xs shrink-0 border border-gray-200/80 inline-flex items-center justify-center",children:(0,u.jsx)(r,{title:e.name,className:"w-full h-full object-cover"})}):null}}),[U,w,j,N]),P=(0,m.useMemo)(()=>{if(!l)return"";if("iso"===w){let e=String(l).toUpperCase();return A.some(t=>t.value===e)?e:l}return l},[l,w,A]);return(0,u.jsx)(o.Z,{ref:t,id:r,name:n,label:a,value:P,onChange:e=>{var t;if(!s)return;let r=null==e?void 0:null===(t=e.target)||void 0===t?void 0:t.value;s(e,U.find(e=>("name"===w?e.name:e.code)===r))},options:A,placeholder:i,disabled:c,required:d,optional:f,error:x,errorMessage:g,hint:h,className:p,wrapperClassName:b,menuClassName:y,selectClassName:v,enableSearch:D,searchPlaceholder:L,isSelectAbsolute:M,multiple:_,selectedValues:Z,onSelectionChange:E,...z})});B.displayName="CountryDropdown";var q=B;r(24353)},24353:function(e,t,r){r.d(t,{JD:function(){return S},ak:function(){return D},gD:function(){return L}});var n=r(57437),a=r(2265),l=r(40875),s=r(73247),o=r(30401),i=r(64627),c=r(67168),d=r(32193),u=r(85497),m=r(41554),f=r(83057),x=r(74685);r(56459);var h=r(48741),g=r(32211),p=r(88807),b=r(28786);let y=(()=>{let e={};
1return(0,i.ox)().forEach(t=>{let r=m.Z.countries[t]||[],n=r[0]||((0,i.Gg)(t)?String((0,i.Gg)(t)):"1"),a=r[2]||"",l=Array.isArray(r[3])?r[3]:[],s=f.Z[t]||"",o=null;if(a)try{o=new RegExp("^(?:".concat(a,")$"))}catch(e){o=null}let c=l.length>0?Math.min(...l):s?s.length:7,d=l.length>0?Math.max(...l):s?s.length:15,u=s?s.length:l[0]||10,x="";x=c===d?"".concat(c," digits"):"".concat(c," to ").concat(d," digits"),s&&(x+=" (e.g. ".concat(s,")")),e[t]={country:t,callingCode:n,regex:o,lengths:l,minLength:c,maxLength:d,preferredLength:u,example:s,description:x}}),e.IN={country:"IN",callingCode:"91",regex:/^[6-9][0-9]{9}$/,lengths:[10],minLength:10,maxLength:10,preferredLength:10,example:"9876543210",description:"10 digits starting with 6, 7, 8, or 9 (e.g. 9876543210)"},e.US={country:"US",callingCode:"1",regex:/^[2-9][0-9]{9}$/,lengths:[10],minLength:10,maxLength:10,preferredLength:10,example:f.Z.US||"2015550123",description:"10 digits starting with 2-9"},e.CA={country:"CA",callingCode:"1",regex:/^[2-9][0-9]{9}$/,lengths:[10],minLength:10,maxLength:10,preferredLength:10,example:f.Z.CA||"4165550123",description:"10 digits starting with 2-9"},e.GB={country:"GB",callingCode:"44",regex:/^(?:7[0-9]{9}|[1-9][0-9]{9})$/,lengths:[10],minLength:10,maxLength:10,preferredLength:10,example:f.Z.GB||"7400123456",description:"10 digits (e.g. 7400123456)"},e})(),v=(0,i.ox)().map(e=>{let t=(0,i.Gg)(e),r=d.Z[e]||e,n=f.Z[e]||"",a=y[e],l=(null==a?void 0:a.preferredLength)||(n?n.length:10);return{country:e,callingCode:t,name:r,Flag:c.ZP[e],example:n,phoneLength:l,minLength:(null==a?void 0:a.minLength)||6,maxLength:(null==a?void 0:a.maxLength)||15,validLengths:(null==a?void 0:a.lengths)||[l],description:(null==a?void 0:a.description)||"".concat(l," digits")}}).sort((e,t)=>e.name.localeCompare(t.name)),w=new Map,j=new Map,N=new Map,k=new Map;function C(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"US";if(!e)return r;let n=String(e).trim(),a=n.toUpperCase();if(v.some(e=>e.country===a))return a;let l=n.replace(/[^0-9]/g,"");if(!l)return r;if(t)try{if((0,i.Gg)(t)===l)return t}catch(e){}if(r)try{if((0,i.Gg)(r)===l)return r}catch(e){}let s=v.find(e=>e.callingCode===l);return s?s.country:r}function S(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15;if(!e)return t;let r=String(e).trim(),n=r.toUpperCase();if(y[n])return y[n].maxLength||y[n].preferredLength;let a=r.replace(/[^0-9]/g,"");if(a&&j.has(a))return j.get(a);let l=C(r,null,null);return l&&y[l]?y[l].maxLength||y[l].preferredLength:t}function D(e){var t,r;if(!e)return"";let n=String(e).trim(),a=n.toUpperCase();if(null===(t=y[a])||void 0===t?void 0:t.example)return y[a].example;if(N.has(a))return N.get(a);let l=n.replace(/[^0-9]/g,"");if(l&&k.has(l))return k.get(l);let s=C(n,null,null);return s&&(null===(r=y[s])||void 0===r?void 0:r.example)?y[s].example:s&&N.has(s)?N.get(s):""}function L(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{required:n=!0,isTyping:a=!1}=r,l=String(e||"").trim().replace(/[^0-9]/g,"");if(!l)return n&&!a?"Phone number is required":"";let s=C(t,null,"US"),o=y[s]||y.US||{callingCode:"1",minLength:10,maxLength:10,preferredLength:10,lengths:[10],description:"10 digits",regex:/^[1-9][0-9]{9}$/},i=v.find(e=>e.country===s),c=(null==i?void 0:i.name)||s||"selected country",d=o.callingCode?"+".concat(o.callingCode):"
1+1";if(/^(\d)\1+$/.test(l))return"Please enter a valid phone number (cannot be all identical digits)";if(l.startsWith("0")&&!(o.regex&&o.regex.test(l)))return"Phone number cannot start with 0 after ".concat(d);if("IN"===s||"+91"===d){if(!/^[6-9]/.test(l))return"Indian phone numbers must start with 6, 7, 8, or 9";if(10!==l.length)return"Indian phone numbers must be 10 digits";if(o.regex&&!o.regex.test(l))return"Please enter a valid Indian mobile number (10 digits starting with 6, 7, 8, or 9)"}else if("+1"===d){if(/^[01]/.test(l))return"US/Canada phone numbers cannot start with 0 or 1";if(10!==l.length)return"US/Canada phone numbers must be 10 digits";if(o.regex&&!o.regex.test(l))return"Please enter a valid phone number for ".concat(c," (").concat(o.description,")")}else{if(l.length>o.maxLength)return"Phone number cannot exceed ".concat(o.maxLength," digits for ").concat(c," (").concat(d,")");if(l.length<o.minLength)return o.minLength===o.maxLength?"Phone number must be ".concat(o.maxLength," digits for ").concat(c," (").concat(d,")"):"Phone number must be at least ".concat(o.minLength," digits for ").concat(c," (").concat(d,")");if(o.lengths&&o.lengths.length>0&&!o.lengths.includes(l.length))return"Invalid number of digits (".concat(l.length,") for ").concat(c," (").concat(d,")");if(o.regex&&!o.regex.test(l))return"Please enter a valid phone number for ".concat(c," (").concat(o.description,")")}try{let e=d.startsWith("+")?d:"+".concat(d),t="".concat(e).concat(l);if(!(0,u.y)(t)&&!(0,u.y)(l,s))return"Please enter a valid phone number for ".concat(c," (").concat(d,")")}catch(e){}return""}v.forEach(e=>{w.set(e.country,e.phoneLength),N.set(e.country,e.example),(!j.get(e.callingCode)||["US","IN","GB","RU","AU"].includes(e.country))&&(j.set(e.callingCode,e.phoneLength),k.set(e.callingCode,e.example))});let M=a.forwardRef((e,t)=>{let{id:r,name:c="countryCode",label:d,required:u=!1,optional:m=!1,disabled:f=!1,value:y="+1",defaultCountry:w="US",onChange:j,onCountryChange:N,onBlur:k,error:L=!1,errorMessage:M,showErrorMessage:_,hint:Z,className:E="",wrapperClassName:z="",buttonClassName:U="",searchPlaceholder:A="Search country or code..."}=e,P=(0,p.dD)(r,c),R=!!(void 0!==_&&_||L),F=(0,g.MK)({disabled:f,error:R}),I=!1===_?Z:(0,p.$p)(M,Z),[W,T]=(0,a.useState)(!1),[B,q]=(0,a.useState)(""),[O,G]=(0,a.useState)(()=>C(y,null,w)),V=(0,a.useRef)(null),$=(0,a.useRef)(null),K=(0,a.useRef)(null),H=(0,a.useRef)(null);(0,a.useEffect)(()=>{G(e=>C(y,e,w))},[y,w]),(0,a.useEffect)(()=>{if(!W)return;let e=e=>{V.current&&!V.current.contains(e.target)&&(T(!1),q(""),null==k||k())},t=e=>{"Escape"===e.key&&(T(!1),q(""),null==k||k())};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[W,k]),(0,a.useEffect)(()=>{W&&($.current&&$.current.focus(),H.current&&H.current.scrollIntoView({block:"nearest"}))},[W]);let Q=(0,a.useMemo)(()=>{if(!B.trim())return v;let e=B.trim().toLowerCase(),t=e.replace(/[^0-9]/g,"");return v.filter(r=>{let n=r.name.toLowerCase().includes(e),a=r.country.toLowerCase().includes(e),l=!!t&&r.callingCode.includes(t);return n||a||l})},[B]),Y=(0,a.useMemo)(()=>v.find(e=>e.country===O)||v.find(e=>e.country===w)||v[0],[O,w]),J=(0,a.useCallback)(e=>{if(f)return;let t="+".concat((0,i.Gg)(e)),r=S(e),n=D(e);G(e),T(!1),q(""),null==N||N(e,t,{maxLength:r,example:n,country:e}),j&&j(Object.assign(new String(t),{target:{name:c,value:t,country:e,maxLength:r,example:n},currentTarget:{name:c,value:t,country:e,maxLength:r,example:n},name:c,value:t,country:e,maxLength:r,example:n}),e,t,{maxLength:r,example:n,country:e}),null==k||k()},[f,c,j,N,k]),X=null==Y?void 0:Y.Flag;return(0,n.jsxs)(h.W,{className:(0,b.cn)("relative",z),children:[d&&(0,n.jsx)(x.Z,{htmlFor:P,required:u,optional:m,disabled:f,children:d}),(0,n.jsxs)("div",{ref:V,className:"relative",children:[(0,n.jsxs)("button",{ref:t,id:P,type:"button",disabled:f,onClick:()=>{!f&&(T(e=>!e),W&&(q(""),null==k||k()))},"aria-haspopup":"listbox","aria-expanded":W,className:(0,b.cn)("w-full h-[42px] rounded-md px-3 py-2 border bg-white flex items-center justify-between transition-all duration-200 text-left cursor-pointer","disabled"===F?"bg-[#F3F4F6] border-gray-300 cursor-not-allowed opacity-90 text-gray-400":"error"===F?"border-red-500 focus:border-red-500 ring-2 ring-red-500/20":W?"border-green-500 ring-2 ring-green-500/20":"border-gray-300 hover:border-gray-400 focus:border-green-500 focus:ring-2 focus:ring-green-500/20",U,E),children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden min-w-0",children:[X?(0,n.jsx)("div",{className:"w-5 h-3.5 overflow-hidden rounded-[2px] shadow-xs shrink-0 border border-gray-200/80 flex items-center justify-center",children:(0,n.jsx)(X,{title:Y.name,className:"w-full h-full object-cover"})}):(0,n.jsx)("span",{className:"text-xs text-gray-400 font-semibold",children:Y.country}),(0,n.jsxs)("span",{className:"text-sm font-medium text-gray-800 shrink-0",children:["+",Y.callingCode]}),(0,n.jsxs)("span",{className:"text-xs text-gray-400 uppercase hidden sm:inline-block truncate",children:["(",Y.country,")"]})]}),(0,n.jsx)(l.Z,{size:16,className:(0,b.cn)("text-gray-400 transition-transform duration-200 shrink-0 ml-1.5",W&&"rotate-180 text-green-600")})]}),W&&(0,n.jsxs)("div",{className:"absolute z-50 left-0 mt-1.5 w-full min-w-[280px] max-w-sm bg-white rounded-xl border border-gray-200 shadow-xl overflow-hidden animate-in fade-in zoom-in-95 duration-150",children:[(0,n.jsx)("div",{className:"p-2 border-b border-gray-100 bg-gray-50/70",children:(0,n.jsxs)("div",{className:"relative flex items-center",children:[(0,n.jsx)(s.Z,{size:15,className:"text-gray-400 absolute left-2.5 pointer-events-none"}),(0,n.jsx)("input",{ref:$,type:"text",value:B,onChange:e=>q(e.target.value),placeholder:A,className:"w-full pl-8 pr-3 py-1.5 text-xs bg-white border border-gray-200 rounded-lg focus:outline-none focus:border-green-500 focus:ring-1 focus:ring-green-500 text-gray-800 placeholder-gray-400"})]})}),(0,n.jsx)("div",{ref:K,className:"max-h-60 overflow-y-auto py-1 divide-y divide-gray-50",children:Q.length>0?Q.map(e=>{let t=e.country===O,r=e.Flag;return(0,n.jsxs)("button",{ref:t?H:null,type:"button",onClick:()=>J(e.country),className:(0,b.cn)("w-full px-3 py-2 text-left flex items-center justify-between gap-2.5 transition-colors cursor-pointer text-xs sm:text-sm",t?"bg-emerald-50/70 text-emerald-900 font-semibold":"hover:bg-gray-50 text-gray-700"),children:[(0,n.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[r?(0,n.jsx)("div",{className:"w-5 h-3.5 overflow-hidden rounded-[2px] shadow-xs shrink-0 border border-gray-200/80 flex items-center justify-center",children:(0,n.jsx)(r,{title:e.name,className:"w-full h-full object-cover"})}):(0,n.jsx)("span",{className:"w-5 text-center font-bold text-[10px] text-gray-400",children:e.country}),(0,n.jsx)("span",{className:"truncate",children:e.name})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,n.jsxs)("span",{className:"text-xs font-mono text-gray-400",children:["+",e.callingCode]}),t&&(0,n.jsx)(o.Z,{size:15,className:"text-green-600 shrink-0"})]})]},e.country)}):(0,n.jsx)("div",{className:"px-4 py-4 text-xs text-gray-400 text-center font-medium",children:"No countries found"})})]})]}),(0,n.jsx)(h.z,{error:R,success:!1,children:I})]})});M.displayName="CountrySelect",t.ZP=M},88807:function(e,t,r){function n(e,t){return e||t}function a(e,t){return e||t}function l(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return e;let r=e.target.value;return"string"==typeof r&&r.startsWith(" ")&&(e.target.value=r.trimStart()),e}r.d(t,{$p:function(){return a},dD:function(){return n},rL:function(){return l}})},28786:function(e,t,r){r.d(t,{cn:function(){return l}});var n=r(61994),a=r(53335);function l(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,a.m6)((0,n.W)(t))}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.