nexaas-ui-components 1.0.6 → 1.0.7
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 +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/dist/index.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var Aa=Object.create;var ot=Object.defineProperty;var Oa=Object.getOwnPropertyDescriptor;var za=Object.getOwnPropertyNames;var Va=Object.getPrototypeOf,Ja=Object.prototype.hasOwnProperty;var ja=(e,t)=>{for(var a in t)ot(e,a,{get:t[a],enumerable:!0})}
|
|
1
|
+
var Aa=Object.create;var ot=Object.defineProperty;var Oa=Object.getOwnPropertyDescriptor;var za=Object.getOwnPropertyNames;var Va=Object.getPrototypeOf,Ja=Object.prototype.hasOwnProperty;var ja=(e,t)=>{for(var a in t)ot(e,a,{get:t[a],enumerable:!0})},$t=(e,t,a,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of za(t))!Ja.call(e,m)&&m!==a&&ot(e,m,{get:()=>t[m],enumerable:!(i=Oa(t,m))||i.enumerable});return e};var K=(e,t,a)=>(a=e!=null?Aa(Va(e)):{},$t(t||!e||!e.__esModule?ot(a,"default",{value:e,enumerable:!0}):a,e)),Xa=e=>$t(ot({},"__esModule",{value:!0}),e);var fo={};ja(fo,{Badge:()=>Ya,Button:()=>G,Calendar:()=>Za,Checkbox:()=>Qa,DataTable:()=>Ht,DataTablePagination:()=>Lt,DatePickerInput:()=>qa,FilterCalendar:()=>eo,FilterOptions:()=>to,Input:()=>Ze,InputMoney:()=>ia,InputNumber:()=>ca,InputPercentage:()=>ga,Logo:()=>Ka,MaskedInput:()=>no,ModalDialog:()=>io,PaginationSelect:()=>Mt,Popover:()=>uo,Radio:()=>po,RocketIcon:()=>Ga,SelectField:()=>co,SpinnerIcon:()=>Dt,Table:()=>yt,TableBody:()=>Nt,TableCaption:()=>Da,TableCell:()=>Rt,TableFooter:()=>Ct,TableHead:()=>Tt,TableHeader:()=>wt,TableRow:()=>et,Toggle:()=>bo,ValueContainer:()=>Ta});module.exports=Xa(fo);var Ye=require("react/jsx-runtime"),Dt=e=>(0,Ye.jsxs)("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,Ye.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,Ye.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]});var Re=require("react/jsx-runtime"),Wa={xxs:{text:"h-[18px]",icon:"text-[16px]"},xs:{text:"h-8 min-w-8 max-w-20",icon:"text-[16px]"},sm:{text:"h-[32px]",icon:"text-[14px]"},md:{text:"h-[38px]",icon:"text-[20px]"},lg:{text:"h-[46px]",icon:"text-[20px]"}},$a={primary:{text:"bg-gradient-to-b from-[#FF4D8B] to-[#DA3063] text-white shadow-[0_2px_6px_0_rgba(218,48,99,0.25)] hover:from-[#ff4d84] hover:to-[#df4573] active:from-[#ae264f] active:to-[#ae264f] disabled:opacity-50 disabled:shadow-none active:shadow-none disabled:hover:from-[#FF4D8B] disabled:hover:to-[#DA3063]"},secondary:{text:"shadow-button bg-surface border-[0.5px] border-neutral-400 text-neutral-600 hover:bg-neutral-100 active:shadow-none disabled:text-neutral-400 disabled:opacity-50"},icon:{text:"shadow-button bg-white border-[0.5px] border-neutral-300 hover:bg-[#f5f5f5] active:bg-neutral-100 disabled:text-neutral-400 disabled:border-[0.5px] disabled:border-disabled disabled:bg-white disabled:opacity-50 active:shadow-none"},outline:{text:"shadow-button bg-surface border-[0.5px] border-rose-500 text-rose-500 hover:bg-rose-50 active:bg-rose-100 disabled:bg-surface disabled:border-[0.5px] disabled:border-rose-700 disabled:opacity-50 active:shadow-none"},dangerOutline:{text:"shadow-button text-dangerous-500 bg-surface border-[0.5px] border-dangerous-500 hover:bg-dangerous-100 active:bg-dangerous-500 active:text-white disabled:opacity-50 disabled:bg-white disabled:text-dangerous-500 active:shadow-none"},danger:{text:"shadow-button text-white bg-gradient-to-b from-danger-start to-danger-end hover:from-[#fe6464] hover:to-[#e24e4e] active:from-dangerous-600 active:to-dangerous-600 disabled:opacity-50 disabled:from-dangerous-500 disabled:to-dangerous-500 active:shadow-none"},success:{text:"shadow-button text-white bg-gradient-to-b from-success-start to-success-end hover:from-[#40f09b] hover:to-[#28c67a] active:from-success-600 active:to-success-600 disabled:opacity-50 disabled:from-success-start disabled:to-success-end active:shadow-none"},warn:{text:"shadow-button text-white bg-gradient-to-b from-warning-start to-warning-end hover:from-[#febd5b] hover:to-[#f4a52e] active:from-warning-600 active:to-warning-600 disabled:opacity-50 disabled:from-warning-start disabled:to-warning-end active:shadow-none"},blue:{text:"shadow-button bg-blue-500 text-white text-bold"},link:{text:"text-left text-blue-500 hover:text-blue-600 hover:underline active:text-blue-600 disabled:text-blue-500 disabled:no-underline shadow-none font-normal disabled:opacity-50"},iconSecondary:{text:"border-[1px] border-none text-white active:bg-[#0A0A0A40]/20 hover:bg-[#F5F5F526]/10 hover:text-white disabled:text-neutral-400 disabled:border-[0.5px] disabled:border-disabled disabled:bg-white disabled:opacity-50 active:shadow-none"},outlineIcon:{text:"bg-white text-rose-500 hover:shadow-button active:bg-rose-500 active:text-white disabled:text-neutral-400 disabled:border-disabled disabled:bg-white disabled:opacity-50 active:shadow-none"}},Ut={xxs:{normal:"",icon:""},xs:{normal:"p-2",icon:"p-2"},sm:{normal:"px-3 py-[6px]",icon:"py-[6px] pl-2 pr-3"},md:{normal:"py-2 px-4",icon:"py-2 pl-3 pr-4"},lg:{normal:"py-3 px-4",icon:"p-3 pr-4"}},G=({variant:e="primary",size:t="lg",...a})=>{let i=a.icon&&a.children,m=$a[e].text,s=Wa[t],N=a.icon?Ut[t].icon:Ut[t].normal,d=i?"gap-[6px]":"gap-0";return(0,Re.jsx)("button",{type:a.type,id:"button-component",...a,disabled:a.disabled||a.loading,className:`
|
|
2
2
|
${a.className}
|
|
3
3
|
${m}
|
|
4
4
|
${s.text}
|
|
5
5
|
${N}
|
|
6
6
|
${d}
|
|
7
7
|
whitespace-nowrap group rounded-lg font-bold disabled:shadow-none active:shadow-none flex items-center
|
|
8
|
-
`,children:(0,Re.jsxs)(Re.Fragment,{children:[a.icon&&(0,Re.jsx)("div",{className:`flex items-center justify-center ${s.icon}`,children:a.icon&&!a.loading?a.icon:a.loadingIcon&&a.loading?a.loadingIcon:(0,Re.jsx)(
|
|
9
|
-
${R?"":"border-neutral-300"}`,icon:`absolute bg-neutral-100 h-[44px] top-[1px] left-[1.5px] w-[38px] rounded-l-lg text-[20px] ${R?"text-dangerous-500":"text-label peer-focus:text-blue-500"} peer-focus:border-blue-500`,rightIcon:"absolute h-[44px] top-[1px] right-[1.5px] w-[38px] text-[22px]",label:"absolute text-label top-[0.80rem] z-10 origin-[0] transform -translate-y-3 scale-75 duration-300 text-sm peer-focus:text-blue-500 peer-focus:scale-75 peer-focus:-translate-y-3 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0",clear:"absolute top-[8px] right-[8px] cursor-pointer text-label text-[22px]",error:"border-dangerous-500 text-dangerous-500"},o={inputWithIcon:{paddingLeft:"48px"},labelWithIcon:{left:"3rem"}},g=D?document==null?void 0:document.getElementById(D):null;return(0,se.jsxs)("div",{className:"relative",children:[(0,se.jsxs)("div",{className:"relative outline-none",children:[(0,se.jsx)("input",{id:D,type:t,name:D,value:h,defaultValue:f,style:!e&&c&&d||d?o.inputWithIcon:void 0,className:(0,je.default)({[r.error]:R,[r.input]:!0,"pr-10":T,"pr-2":!T}),placeholder:!e&&c?c:" ",onChange:F,onBlur:s,onClick:i,disabled:E,ref:b,...N,...a,onKeyUp:k,onKeyDown:u}),d&&(0,se.jsx)("div",{className:(0,je.default)(r.icon,"flex justify-center items-center"),children:d}),P&&(0,se.jsx)("div",{className:(0,je.default)(r.rightIcon,"flex justify-center items-center"),children:(0,se.jsx)("i",{className:"uil uil-eye text-label cursor-pointer text-[20px]"})}),(0,se.jsxs)("label",{style:d?o.labelWithIcon:void 0,className:(0,je.default)({[r.label]:!0,"left-2.5":!d},"cursor-text whitespace-nowrap text-ellipsis overflow-hidden pointer-events-none"),htmlFor:D,children:[e,x&&e&&(0,se.jsx)("strong",{className:"text-dangerous-500",children:"\xA0*"})]}),T&&h&&h!==""&&!E&&(0,se.jsx)("i",{className:(0,je.default)({[r.clear]:!0},"uil uil-times clear-icon"),onClick:()=>{g&&(g==null||g.focus()),v&&v()}})]}),n.map((L,O)=>(0,se.jsx)("div",{className:"text-dangerous-500 text-p-xs mt-1 ml-[2px]",role:"alert","aria-label":L,children:L},O))]})};var
|
|
8
|
+
`,children:(0,Re.jsxs)(Re.Fragment,{children:[a.icon&&(0,Re.jsx)("div",{className:`flex items-center justify-center ${s.icon}`,children:a.icon&&!a.loading?a.icon:a.loadingIcon&&a.loading?a.loadingIcon:(0,Re.jsx)(Dt,{className:"animate-spin"})}),a.children,a.dropdown&&(0,Re.jsx)("i",{className:"uil uil-angle-down text-[18px]"})]})})};var je=K(require("clsx"),1),se=require("react/jsx-runtime"),Ze=({label:e,type:t,registration:a,onClick:i,error:m,onBlur:s,inputProps:N,icon:d,clearField:T,name:D,required:x,disabled:E,value:h,placeholder:c,defaultValue:f,onKeyUp:k,onKeyDown:u,onClear:v,hideInput:P,onChange:F,ref:b})=>{let n=[m==null?void 0:m.message],R=n.some(L=>L!==void 0),r={input:`text-p-md pl-2 peer shadow-input border rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:border-1 focus-visible:border-blue-500 ${e?"pt-[22px]":"pt-[10px]"}
|
|
9
|
+
${R?"":"border-neutral-300"}`,icon:`absolute bg-neutral-100 h-[44px] top-[1px] left-[1.5px] w-[38px] rounded-l-lg text-[20px] ${R?"text-dangerous-500":"text-label peer-focus:text-blue-500"} peer-focus:border-blue-500`,rightIcon:"absolute h-[44px] top-[1px] right-[1.5px] w-[38px] text-[22px]",label:"absolute text-label top-[0.80rem] z-10 origin-[0] transform -translate-y-3 scale-75 duration-300 text-sm peer-focus:text-blue-500 peer-focus:scale-75 peer-focus:-translate-y-3 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0",clear:"absolute top-[8px] right-[8px] cursor-pointer text-label text-[22px]",error:"border-dangerous-500 text-dangerous-500"},o={inputWithIcon:{paddingLeft:"48px"},labelWithIcon:{left:"3rem"}},g=D?document==null?void 0:document.getElementById(D):null;return(0,se.jsxs)("div",{className:"relative",children:[(0,se.jsxs)("div",{className:"relative outline-none",children:[(0,se.jsx)("input",{id:D,type:t,name:D,value:h,defaultValue:f,style:!e&&c&&d||d?o.inputWithIcon:void 0,className:(0,je.default)({[r.error]:R,[r.input]:!0,"pr-10":T,"pr-2":!T}),placeholder:!e&&c?c:" ",onChange:F,onBlur:s,onClick:i,disabled:E,ref:b,...N,...a,onKeyUp:k,onKeyDown:u}),d&&(0,se.jsx)("div",{className:(0,je.default)(r.icon,"flex justify-center items-center"),children:d}),P&&(0,se.jsx)("div",{className:(0,je.default)(r.rightIcon,"flex justify-center items-center"),children:(0,se.jsx)("i",{className:"uil uil-eye text-label cursor-pointer text-[20px]"})}),(0,se.jsxs)("label",{style:d?o.labelWithIcon:void 0,className:(0,je.default)({[r.label]:!0,"left-2.5":!d},"cursor-text whitespace-nowrap text-ellipsis overflow-hidden pointer-events-none"),htmlFor:D,children:[e,x&&e&&(0,se.jsx)("strong",{className:"text-dangerous-500",children:"\xA0*"})]}),T&&h&&h!==""&&!E&&(0,se.jsx)("i",{className:(0,je.default)({[r.clear]:!0},"uil uil-times clear-icon"),onClick:()=>{g&&(g==null||g.focus()),v&&v()}})]}),n.map((L,O)=>(0,se.jsx)("div",{className:"text-dangerous-500 text-p-xs mt-1 ml-[2px]",role:"alert","aria-label":L,children:L},O))]})};var Kt='data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">%0A <rect width="100" height="100" fill="%23FF4D8B"/>%0A <text x="50" y="50" font-size="20" text-anchor="middle" dy=".3em" fill="white">LOGO</text>%0A</svg>%0A';var Gt=require("react/jsx-runtime"),Ka=({className:e})=>(0,Gt.jsx)("img",{src:Kt,alt:"Logo",className:e,width:100,height:100});var Me=require("react/jsx-runtime"),Ga=e=>(0,Me.jsxs)("svg",{width:"800px",height:"800px",viewBox:"0 0 1024 1024",className:"icon",version:"1.1",style:e.style,xmlns:"http://www.w3.org/2000/svg",children:[(0,Me.jsx)("path",{d:"M512 301.2m-10 0a10 10 0 1 0 20 0 10 10 0 1 0-20 0Z",fill:"#E73B37"}),(0,Me.jsx)("path",{d:"M400.3 744.5c2.1-0.7 4.1-1.4 6.2-2-2 0.6-4.1 1.3-6.2 2z m0 0c2.1-0.7 4.1-1.4 6.2-2-2 0.6-4.1 1.3-6.2 2z",fill:"#39393A"}),(0,Me.jsx)("path",{d:"M511.8 256.6c24.4 0 44.2 19.8 44.2 44.2S536.2 345 511.8 345s-44.2-19.8-44.2-44.2 19.9-44.2 44.2-44.2m0-20c-35.5 0-64.2 28.7-64.2 64.2s28.7 64.2 64.2 64.2 64.2-28.7 64.2-64.2-28.7-64.2-64.2-64.2z",fill:"#E73B37"}),(0,Me.jsx)("path",{d:"M730.7 529.5c0.4-8.7 0.6-17.4 0.6-26.2 0-179.6-86.1-339.1-219.3-439.5-133.1 100.4-219.2 259.9-219.2 439.5 0 8.8 0.2 17.5 0.6 26.1-56 56-90.6 133.3-90.6 218.7 0 61.7 18 119.1 49.1 167.3 30.3-49.8 74.7-90.1 127.7-115.3 39-18.6 82.7-29 128.8-29 48.3 0 93.9 11.4 134.3 31.7 52.5 26.3 96.3 67.7 125.6 118.4 33.4-49.4 52.9-108.9 52.9-173.1 0-85.4-34.6-162.6-90.5-218.6zM351.1 383.4c9.2-37.9 22.9-74.7 40.6-109.5a502.1 502.1 0 0 1 63.6-95.9c17.4-20.6 36.4-39.9 56.8-57.5 20.4 17.6 39.4 36.9 56.8 57.5 24.8 29.5 46.2 61.8 63.6 95.9 17.7 34.8 31.4 71.6 40.6 109.5 8.7 35.8 13.5 72.7 14.2 109.9C637.4 459 577 438.9 512 438.9c-65 0-125.3 20.1-175.1 54.4 0.7-37.2 5.5-74.1 14.2-109.9z m-90.6 449.2c-9.1-27-13.7-55.5-13.7-84.4 0-35.8 7-70.6 20.8-103.2 8.4-19.8 19-38.4 31.9-55.5 9.7 61.5 29.5 119.7 57.8 172.6-36.4 17.8-69 41.6-96.8 70.5z m364.2-85.3c-0.7-0.3-1.5-0.5-2.2-0.8-0.4-0.2-0.9-0.3-1.3-0.5-0.6-0.2-1.3-0.5-1.9-0.7-0.8-0.3-1.5-0.5-2.3-0.8-0.8-0.3-1.5-0.5-2.3-0.7l-0.9-0.3c-1-0.3-2.1-0.7-3.1-1-1.2-0.4-2.4-0.7-3.5-1.1l-3-0.9c-0.2-0.1-0.4-0.1-0.7-0.2-1.1-0.3-2.3-0.7-3.4-1-1.2-0.3-2.4-0.6-3.5-0.9l-3.6-0.9-3.6-0.9c-1-0.3-2.1-0.5-3.1-0.7-1.2-0.3-2.4-0.5-3.6-0.8-1.3-0.3-2.5-0.6-3.8-0.8h-0.3c-0.9-0.2-1.9-0.4-2.8-0.6-0.4-0.1-0.7-0.1-1.1-0.2-1.1-0.2-2.2-0.4-3.4-0.6-1.2-0.2-2.4-0.4-3.6-0.7l-5.4-0.9c-0.9-0.1-1.9-0.3-2.8-0.4-0.8-0.1-1.6-0.3-2.5-0.4-2.6-0.4-5.1-0.7-7.7-1-1.2-0.1-2.3-0.3-3.5-0.4h-0.4c-0.9-0.1-1.8-0.2-2.8-0.3-1.1-0.1-2.1-0.2-3.2-0.3-1.7-0.2-3.4-0.3-5.1-0.4-0.8-0.1-1.5-0.1-2.3-0.2-0.9-0.1-1.9-0.1-2.8-0.2-0.4 0-0.8 0-1.2-0.1-1.1-0.1-2.1-0.1-3.2-0.2-0.5 0-1-0.1-1.5-0.1-1.3-0.1-2.6-0.1-3.9-0.1-0.8 0-1.5-0.1-2.3-0.1-1.2 0-2.4 0-3.5-0.1h-13.9c-2.3 0-4.6 0.1-6.9 0.2-0.9 0-1.9 0.1-2.8 0.1-0.8 0-1.5 0.1-2.3 0.1-1.4 0.1-2.8 0.2-4.1 0.3-1.4 0.1-2.7 0.2-4.1 0.3-1.4 0.1-2.7 0.2-4.1 0.4-0.6 0-1.2 0.1-1.8 0.2l-7.8 0.9c-1.1 0.1-2.1 0.3-3.2 0.4-1 0.1-2.1 0.3-3.1 0.4-3.2 0.5-6.4 0.9-9.5 1.5-0.7 0.1-1.4 0.2-2.1 0.4-0.9 0.1-1.7 0.3-2.6 0.5-1.1 0.2-2.3 0.4-3.4 0.6-0.9 0.2-1.7 0.3-2.6 0.5-0.4 0.1-0.8 0.1-1.1 0.2-0.7 0.1-1.4 0.3-2.1 0.4-1.2 0.3-2.4 0.5-3.6 0.8-1.2 0.3-2.4 0.5-3.6 0.8-0.2 0-0.4 0.1-0.6 0.1-0.5 0.1-1 0.2-1.5 0.4-1.1 0.3-2.3 0.6-3.5 0.9-1.3 0.3-2.5 0.6-3.8 1-0.4 0.1-0.9 0.2-1.4 0.4-1.3 0.4-2.7 0.7-4 1.1-1.5 0.4-3 0.9-4.6 1.3-1 0.3-2.1 0.6-3.1 1-2.1 0.6-4.1 1.3-6.2 2-0.7 0.2-1.4 0.5-2.1 0.7-15-27.5-27.4-56.4-37-86.2-11.7-36.1-19.2-73.6-22.5-111.6-0.6-6.7-1-13.3-1.3-20-0.1-1.2-0.1-2.4-0.1-3.6-0.1-1.2-0.1-2.4-0.1-3.6 0-1.2-0.1-2.4-0.1-3.6 0-1.2-0.1-2.4-0.1-3.7 18.8-14 39.2-25.8 61-35 36.1-15.3 74.5-23 114.1-23 39.6 0 78 7.8 114.1 23 21.8 9.2 42.2 20.9 61 35v0.1c0 1 0 1.9-0.1 2.9 0 1.4-0.1 2.8-0.1 4.3 0 0.7 0 1.3-0.1 2-0.1 1.8-0.1 3.5-0.2 5.3-0.3 6.7-0.8 13.3-1.3 20-3.3 38.5-11 76.5-23 113-9.7 30.3-22.3 59.4-37.6 87.1z m136.8 90.9a342.27 342.27 0 0 0-96.3-73.2c29.1-53.7 49.5-112.8 59.4-175.5 12.8 17.1 23.4 35.6 31.8 55.5 13.8 32.7 20.8 67.4 20.8 103.2 0 31-5.3 61.3-15.7 90z",fill:"#39393A"}),(0,Me.jsx)("path",{d:"M512 819.3c8.7 0 24.7 22.9 24.7 60.4s-16 60.4-24.7 60.4-24.7-22.9-24.7-60.4 16-60.4 24.7-60.4m0-20c-24.7 0-44.7 36-44.7 80.4 0 44.4 20 80.4 44.7 80.4s44.7-36 44.7-80.4c0-44.4-20-80.4-44.7-80.4z",fill:"#E73B37"})]});var _t=require("@blueprintjs/datetime2"),he=require("react"),Yt=require("react-hook-form");var qt=require("zustand"),nt=(0,qt.create)(e=>({field:{},addValidationError:t=>e(a=>{let i={};return t==null||t.forEach(({position:m,path:s,code:N,message:d})=>{s==null||s.shift(),m!==null&&(s==null||s.splice(1,0,m==null?void 0:m.toString()));let T=s.join(".").replace(".","");i={...i,[T]:{code:N,message:d}}}),{...a,field:{...i}}}),dismissAllValidationErrors:()=>e(t=>({field:{}}))}));var rt=K(require("clsx"),1),st=require("date-fns"),ue=require("react/jsx-runtime"),qa=(0,he.forwardRef)(({icon:e,label:t,registration:a,error:i,inputProps:m,clearField:s,control:N,name:d,required:T,defaultValue:D,onChangeFunction:x,maxDate:E,minDate:h,disabled:c,small:f,onClear:k,popoverOffset:u},v)=>{var Z;let[P,F]=(0,he.useState)(!1),[b,n]=(0,he.useState)(!1),[R,r]=(0,he.useState)(0),o=(0,he.useRef)(null),g="dd/MM/yyyy";(0,he.useEffect)(()=>{let l=()=>{o.current&&r(o.current.offsetWidth+10)};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[]);let L=u||[R||250,-46],V=[(Z=nt(l=>l.field)[d||(a==null?void 0:a.name)])==null?void 0:Z.message,i==null?void 0:i.message],A={input:"text-p-md border rounded block pb-[10px] h-[46px] w-full disabled:bg-light-gray-100 ",icon:`absolute bg-light-gray-100 h-[44px] w-[38px] top-[1px] left-[1px] rounded-l-lg rounded-r-none ${V.some(l=>l!==void 0)?"text-dangerous-700":"text-label"}`,label:"absolute text-label text-sm",error:"border-dangerous-700 text-dangerous-700",clear:"absolute top-[8px] right-[8px] cursor-pointer text-label text-[22px]"},U=d?document==null?void 0:document.getElementById(d):null;return(0,ue.jsxs)("div",{children:[(0,ue.jsx)(Yt.Controller,{control:N,name:d,render:({field:l})=>(0,ue.jsxs)("div",{id:"group-input-calendar",className:"relative",ref:X=>{o.current=X,typeof v=="function"?v(X):v&&(v.current=X)},style:{"--popover-offset-x":`${L[0]}px`,"--popover-offset-y":"-100px"},children:[e&&(0,ue.jsx)("div",{id:"icon",className:(0,rt.default)(A.icon,"flex justify-center items-center text-[20px] bg-gray-100"),children:e}),(0,ue.jsx)(_t.DateInput3,{outOfRangeMessage:"Data n\xE3o permitida",invalidDateMessage:"Data inv\xE1lida",onError:()=>F(!0),defaultValue:l.value,inputProps:{className:A.input,style:{height:"46px"}},popoverProps:{placement:"bottom",usePortal:!1,minimal:!0,popoverClassName:"date-picker-popover"},disabled:c,onChange:(X,ye)=>{ye&&(l.onChange(X),n(!1),x&&x(X),F(!1))},value:l.value,locale:"pt",highlightCurrentDay:!0,formatDate:X=>(0,st.format)(X,g),parseDate:X=>(0,st.parse)(X,g,new Date),maxDate:E,minDate:h}),(0,ue.jsxs)("label",{className:(0,rt.default)("pointer-events-none ",A.label,`
|
|
10
10
|
${l.value&&l.value[0]!==null||P?" scale-75 -translate-y-3 ":""}
|
|
11
|
-
${e?"left-[3rem]":"left-2.5"}`),style:{top:"13px"},children:[t,T&&t&&(0,ue.jsx)("strong",{className:"text-dangerous-700 ml-1",children:"*"})]}),s&&(l==null?void 0:l.value)&&(l==null?void 0:l.value)!==""&&!c&&(0,ue.jsx)("i",{className:(0,rt.default)({[A.clear]:!0},"uil uil-times clear-icon"),onClick:()=>{U&&(U==null||U.focus()),k&&k()}})]})}),V.map((l,X)=>(0,ue.jsx)("div",{className:"absolute text-dangerous-700 text-xs mt-[2px] ml-1",role:"alert","aria-label":l,children:l},X))]})});var _t=K(require("clsx"),1),Yt=require("react/jsx-runtime"),_a={success:"bg-success-100 text-success-600",warning:"bg-warning-100 text-warning-600",blue:"bg-blue-100 text-blue-500",gray:"bg-neutral-100 text-neutral-400",dangerous:"bg-dangerous-100 text-dangerous-600",light:"bg-neutral-100 text-neutral-400",white:"bg-[#FFF] text-neutral-400 px-4 py-[6px] border border-light shadow-button text-paragraph",primary:"bg-rose-100 text-rose-800",dark:"bg-neutral-700 text-white",outline:"bg-white text-rose-700 border border-neutral-200","dark-gray":"bg-neutral-100 text-neutral-600"},Ya=({variant:e="blue",children:t,className:a,style:i})=>(0,Yt.jsx)("span",{className:(0,_t.default)({[_a[e]]:(e==null?void 0:e.length)>0},"py-1 px-2 text-p-md font-normal inline-flex items-center justify-center gap-1 rounded-full text-center",a),style:i,children:t});var lt=require("@blueprintjs/datetime2"),Zt=require("react-hook-form"),y=require("date-fns"),Le=require("react/jsx-runtime"),Za=({registration:e,error:t,control:a,name:i,rangeCalendar:m=!1,shortcutsChange:s,selectedShortcut:N,setSelectedShortcut:d,maxDate:T=new Date,singleMonth:D=!1})=>{let x=[t==null?void 0:t.message],E=[{label:"Todo o per\xEDodo",dateRange:[]},{label:"Hoje",dateRange:[(0,y.set)(new Date,{hours:0,minutes:0,seconds:0}),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"Ontem",dateRange:[(0,y.set)((0,y.sub)(new Date,{days:1}),{hours:0,minutes:0,seconds:0}),(0,y.set)((0,y.sub)(new Date,{days:1}),{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 7 dias",dateRange:[(0,y.set)((0,y.sub)(new Date,{days:7}),{hours:0,minutes:0,seconds:0}),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 14 dias",dateRange:[(0,y.set)((0,y.sub)(new Date,{days:14}),{hours:0,minutes:0,seconds:0}),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 30 dias",dateRange:[(0,y.set)((0,y.sub)(new Date,{days:30}),{hours:0,minutes:0,seconds:0}),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 60 dias",dateRange:[(0,y.set)((0,y.sub)(new Date,{days:60}),{hours:0,minutes:0,seconds:0}),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 90 dias",dateRange:[(0,y.set)((0,y.sub)(new Date,{days:90}),{hours:0,minutes:0,seconds:0}),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"Esta semana",dateRange:[(0,y.startOfWeek)(new Date),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"Semana passada",dateRange:[(0,y.startOfWeek)((0,y.sub)(new Date,{days:7})),(0,y.endOfWeek)((0,y.sub)(new Date,{days:7}))]},{label:"Este M\xEAs",dateRange:[(0,y.startOfMonth)(new Date),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"M\xEAs passado",dateRange:[(0,y.startOfMonth)((0,y.sub)(new Date,{months:1})),(0,y.endOfMonth)((0,y.sub)(new Date,{months:1}))]},{label:"\xDAltimos 6 meses",dateRange:[(0,y.startOfMonth)((0,y.sub)(new Date,{months:6})),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59}),,]}];return(0,Le.jsxs)("div",{children:[(0,Le.jsx)(Zt.Controller,{control:a,name:i,render:({field:{onChange:h,value:c}})=>(0,Le.jsx)("div",{id:"group-input-calendar",className:"relative",children:m?(0,Le.jsx)(lt.DateRangePicker3,{allowSingleDayRange:!0,shortcuts:E,selectedShortcutIndex:N||E[0],onChange:f=>{let k=[];f[0]&&f[0]!==null&&k.push((0,y.set)(f[0],{hours:0,minutes:0,seconds:0})),f[1]&&f[1]!==null&&k.push((0,y.set)(f[1],{hours:23,minutes:59,seconds:59})),f[0]!==null&&f[1]==null&&(s&&s(null),d&&d(null)),s&&s(""),h(k)},singleMonthOnly:D,value:c,highlightCurrentDay:!0,minDate:(0,y.subYears)(new Date,50),maxDate:T,locale:"pt",onShortcutChange:f=>{let k=E.findIndex(u=>u.label===f.label);k!==-1&&d&&d(k),s&&s(f)}}):(0,Le.jsx)(lt.DatePicker3,{onChange:f=>{h(f)},value:c,highlightCurrentDay:!0,locale:"pt"})})}),x.map((h,c)=>(0,Le.jsx)("div",{className:"text-dangerous-500 text-xs mt-[2px]",role:"alert","aria-label":h,children:h},c))]})};var Qt=K(require("clsx"),1),He=require("react/jsx-runtime"),Qa=({key:e="",label:t,registration:a,disabled:i})=>(0,He.jsx)("div",{children:(0,He.jsxs)("div",{className:"relative flex items-start",children:[(0,He.jsx)("div",{className:"flex h-5 items-center",children:(0,He.jsx)("input",{...a,id:a?a.name:e,disabled:i,type:"checkbox",className:(0,Qt.default)("disabled:hover:bg-neutral-100 disabled:cursor-default cursor-pointer h-[16px] w-[16px] rounded-[2.5px] border border-neutral-200 text-blue-500 focus:rounded-[4px] focus:border-[1.5px] focus:ring-blue-500 focus-visible:ring-blue-500 checked:after:text-blue-500 disabled:bg-neutral-100")})}),(0,He.jsx)("div",{className:"ml-3 text-sm",children:(0,He.jsx)("label",{htmlFor:a==null?void 0:a.name,className:"cursor-pointer font-medium text-gray-700",children:t})})]})});var We=require("react"),ea=require("react-hook-form"),$e=require("@headlessui/react"),Xe=K(require("clsx"),1),it=require("@headlessui-float/react");var ta=require("date-fns"),w=require("date-fns"),dt=require("@blueprintjs/datetime2"),q=require("react/jsx-runtime"),eo=({icon:e,label:t,onApply:a,onClear:i,control:m,name:s,rangeCalendar:N=!0,defaultShortcut:d,shortcutsChange:T,singleMonth:D=!1,maxDate:x=void 0})=>{let E={filter:"rounded-3xl shadow-input bg-white hover:bg-neutral-100 border border-neutral-300 active:text-blue-500 active:bg-blue-100 active:border-blue-500",filterOpen:"rounded-3xl shadow-input border border-blue-500 bg-blue-100 text-blue-500",filterActive:"rounded-3xl border border-blue-500 text-blue-500 bg-blue-100 shadow-input hover:bg-blue-500 hover:text-white active:text-white active:bg-blue-600 active:border-blue-600"},[h,c]=(0,We.useState)([]),[f,k]=(0,We.useState)(""),u=(window==null?void 0:window.innerWidth)<768,v=[{label:"Todo o per\xEDodo",dateRange:[]},{label:"Hoje",dateRange:[(0,w.set)(new Date,{hours:0,minutes:0,seconds:0}),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"Ontem",dateRange:[(0,w.set)((0,w.sub)(new Date,{days:1}),{hours:0,minutes:0,seconds:0}),(0,w.set)((0,w.sub)(new Date,{days:1}),{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 7 dias",dateRange:[(0,w.set)((0,w.sub)(new Date,{days:7}),{hours:0,minutes:0,seconds:0}),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 14 dias",dateRange:[(0,w.set)((0,w.sub)(new Date,{days:14}),{hours:0,minutes:0,seconds:0}),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 30 dias",dateRange:[(0,w.set)((0,w.sub)(new Date,{days:30}),{hours:0,minutes:0,seconds:0}),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 60 dias",dateRange:[(0,w.set)((0,w.sub)(new Date,{days:60}),{hours:0,minutes:0,seconds:0}),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 90 dias",dateRange:[(0,w.set)((0,w.sub)(new Date,{days:90}),{hours:0,minutes:0,seconds:0}),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"Esta semana",dateRange:[(0,w.startOfWeek)(new Date),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"Semana passada",dateRange:[(0,w.startOfWeek)((0,w.sub)(new Date,{days:7})),(0,w.endOfWeek)((0,w.sub)(new Date,{days:7}))]},{label:"Este M\xEAs",dateRange:[(0,w.startOfMonth)(new Date),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"M\xEAs passado",dateRange:[(0,w.startOfMonth)((0,w.sub)(new Date,{months:1})),(0,w.endOfMonth)((0,w.sub)(new Date,{months:1}))]},{label:"\xDAltimos 6 meses",dateRange:[(0,w.startOfMonth)((0,w.sub)(new Date,{months:6})),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59}),,]}],[P,F]=(0,We.useState)(d||v[0]),b=(0,q.jsx)("div",{id:"group-input-calendar",className:"relative",children:N?(0,q.jsx)(dt.DateRangePicker3,{allowSingleDayRange:!0,shortcuts:v,selectedShortcutIndex:P,onChange:n=>{let R=[];n[0]&&n[0]!==null&&R.push((0,w.set)(n[0],{hours:0,minutes:0,seconds:0})),n[1]&&n[1]!==null&&R.push((0,w.set)(n[1],{hours:23,minutes:59,seconds:59})),n[0]!==null&&n[1]==null&&(k(""),F&&F(null)),k(""),c(R)},singleMonthOnly:D,value:h,highlightCurrentDay:!0,minDate:(0,w.subYears)(new Date,50),maxDate:x,locale:"pt",onShortcutChange:n=>{let R=v.findIndex(r=>r.label===n.label);R!==-1&&F&&F(R),k(n==null?void 0:n.label)}}):(0,q.jsx)(dt.DatePicker3,{onChange:n=>{c(n)},value:h,highlightCurrentDay:!0,locale:"pt"})});return(0,q.jsx)(ea.Controller,{name:s,control:m,render:({field:n})=>{var r;let R=((r=n==null?void 0:n.value)==null?void 0:r.length)>0;return(0,q.jsx)($e.Popover,{className:(0,Xe.default)({"w-full":u},"relative text-paragraph"),children:({open:o})=>{var g,L;return(0,q.jsxs)(it.Float,{composable:!0,shift:8,zIndex:99,offset:2,children:[(0,q.jsx)(it.Float.Reference,{children:(0,q.jsx)($e.PopoverButton,{as:"button",children:(0,q.jsxs)("div",{className:(0,Xe.default)({[E.filter]:!R&&!o,[E.filterOpen]:o&&!R,[E.filterActive]:o&&R||!o&&R},"group px-3 h-[36px] text-p-ls font-bold disabled:shadow-none active:shadow-none flex items-center justify-between outline-none gap-2"),children:[e&&(0,q.jsx)("div",{className:(0,Xe.default)({"text-label group-active:text-blue-500":!n.value&&!o,"text-blue-500":o&&!n.value,"text-blue-500 group-hover:text-white group-active:text-white":o&&n.value}),children:e}),(0,q.jsx)("label",{className:(0,Xe.default)({"text-paragraph group-active:text-blue-500":!n.value&&!o,"text-blue-500":o&&!n.value,"text-blue-500 group-hover:text-white group-active:text-white":o&&n.value},"truncate cursor-pointer"),children:f||(((g=n==null?void 0:n.value)==null?void 0:g.length)>0?(L=n==null?void 0:n.value)==null?void 0:L.map(O=>O!==null?(0,ta.format)(O,"dd/MM/yyyy"):"").join(" - "):t)}),(0,q.jsx)("i",{className:(0,Xe.default)({"text-label group-active:text-blue-500":!n.value&&!o,"text-blue-500":o&&!n.value,"text-blue-500 group-hover:text-white group-active:text-white":o&&n.value},"uil uil-angle-down text-[18px]")})]})})}),o&&(0,q.jsx)(it.Float.Content,{children:(0,q.jsx)($e.PopoverPanel,{className:"p-3 whitespace-nowrap bg-white rounded-lg shadow-dropdown border-[0.5px] border-neutral-300",children:({close:O})=>{let V=()=>{c(n.value),O()};return(0,We.useEffect)(()=>{c(n.value)},[o]),(0,q.jsxs)("div",{className:"flex flex-col gap-2",children:[b,(0,q.jsxs)("div",{className:"flex gap-2 items-center justify-end border-t border-t-neutral-200 pt-3",children:[i&&(0,q.jsx)("div",{className:"mr-1",children:(0,q.jsx)(G,{variant:"link",size:"xxs",onClick:()=>{i&&(i(),c([]),n.onChange([])),O()},children:"Limpar"})}),(0,q.jsx)(G,{size:"xs",variant:"secondary",onClick:()=>{V()},children:"Cancelar"}),(0,q.jsx)(G,{size:"xs",variant:"primary",disabled:JSON.stringify(h)===JSON.stringify(n==null?void 0:n.value),onClick:()=>{n.onChange(h),a&&a(),O()},children:"Aplicar"})]})]})}})})]})}})}})};var pe=require("react"),oa=require("react-hook-form"),le=require("@headlessui/react"),ce=K(require("clsx"),1),ut=require("@headlessui-float/react");var aa=require("react"),Ue=K(require("clsx"),1),Se=require("react/jsx-runtime");function St({type:e,registration:t,onClick:a,onBlur:i,onChange:m,inputProps:s,icon:N,clearField:d,disabled:T,placeholder:D,className:x,onKeyDown:E,value:h,searchOnClick:c,onClear:f,collapsed:k}){let u=(0,aa.useRef)(null),v={input:"text-p-md text-paragraph w-full outline-none placeholder:text-label",icon:"text-label group-focus-within:text-neutral-600 m-[10px]",wrapper:`shadow-input border border-neutral-300 focus-within:border-blue-500 group rounded-lg h-9 w-full text-paragraph flex items-center justify-between disabled:bg-neutral-100 ${T?"bg-neutral-100":"bg-white"} ${x}`,clear:"pr-[5px] cursor-pointer text-label text-[16px]"},P=u==null?void 0:u.current;return(0,Se.jsxs)("div",{className:(0,Ue.default)(v.wrapper),children:[N&&!c&&(0,Se.jsx)("div",{className:(0,Ue.default)(v.icon),children:N}),(0,Se.jsx)("input",{...t,...s,type:"search-text",ref:u,className:(0,Ue.default)({"pl-1":k},v.input),placeholder:D,onBlur:i,onChange:F=>m(F.target.value),onClick:a,disabled:T,onKeyDown:E}),d&&h&&!T&&(0,Se.jsx)("i",{className:(0,Ue.default)(v.clear,"uil uil-times"),onClick:()=>{P.value="",P==null||P.focus(),m(""),f&&f()}}),c&&(0,Se.jsx)("div",{className:"py-1",children:(0,Se.jsx)("button",{type:"button",className:(0,Ue.default)({"border-l border-input pl-1":d&&h&&!T,"text-blue-500":!T,"text-neutral-300":T,"pl-[2px]":k}),onClick:c,children:(0,Se.jsx)("i",{className:"uil uil-search text-[16px] mr-2 pl-1"})})})]})}var C=require("react/jsx-runtime"),to=({icon:e,label:t,isMulti:a,options:i=[],onApply:m,onClear:s,onSelectAll:N,control:d,name:T,fetch:D,subFilters:x=[],emptyMessage:E,initialMessage:h,applyOnClick:c=!1,showFilter:f=!1})=>{let k={filter:"rounded-3xl shadow-input bg-white hover:bg-neutral-100 border border-neutral-300 active:text-blue-500 active:bg-blue-100 active:border-blue-500",filterOpen:"rounded-3xl shadow-input border border-blue-500 bg-blue-100 text-blue-500",filterActive:"rounded-3xl border border-blue-500 text-blue-500 bg-blue-100 shadow-input hover:bg-blue-500 hover:text-white active:text-white active:bg-blue-600 active:border-blue-600"},[u,v]=(0,pe.useState)(a?[]:{}),[P,F]=(0,pe.useState)(()=>i),[b,n]=(0,pe.useState)(""),[R,r]=(0,pe.useState)((x==null?void 0:x.length)>0?x[0].id:null),[o,g]=(0,pe.useState)(!1),L=async()=>{if((b==null?void 0:b.length)>0||(i==null?void 0:i.length)>0)if(D)F(await D(b,R));else{let A=i.filter(U=>{var Z;return(Z=U==null?void 0:U.label)==null?void 0:Z.toLowerCase().includes(b.toLowerCase())}).sort((U,Z)=>{var l;return(l=U==null?void 0:U.label)==null?void 0:l.toLowerCase()});F(A)}else F([]);g(!1)};(0,pe.useEffect)(()=>{g(!0);let p=setTimeout(()=>{L()},400);return()=>clearTimeout(p)},[b]);let O=(p,A)=>(0,C.jsx)(le.ListboxOption,{disabled:p.disabled,value:p,as:pe.Fragment,children:(0,C.jsxs)("div",{className:(0,ce.default)("relative cursor-pointer outline-none select-none p-3 rounded-lg pr-9 text-paragraph mt-1 first:mt-0 overflow-hidden w-full",{"hover:bg-neutral-200":!p.disabled&&!A,"text-gray-200":p.disabled,"bg-blue-500 hover:bg-blue-500":A}),children:[(0,C.jsx)("span",{className:(0,ce.default)({"font-semibold text-white":A},"text-wrap break-words font-normal block"),children:p==null?void 0:p.label}),(0,C.jsx)("span",{className:(0,ce.default)({"font-semibold text-white":A},"w-[200px] whitespace-nowrap text-ellipsis overflow-hidden text-label text-p-sm block"),children:p==null?void 0:p.description}),A?(0,C.jsx)("span",{className:(0,ce.default)("absolute inset-y-0 text-white right-0 flex items-center pr-4"),children:(0,C.jsx)("i",{className:"uil uil-check text-lg"})}):null]})},p.id),V=(window==null?void 0:window.innerWidth)<768;return(0,C.jsx)(oa.Controller,{name:T,control:d,render:({field:p})=>{var U,Z;let A=a?((U=p==null?void 0:p.value)==null?void 0:U.length)>0:!!((Z=p==null?void 0:p.value)!=null&&Z.id);return(0,C.jsx)(le.Popover,{className:(0,ce.default)({"w-full":V},"relative text-paragraph"),children:({open:l})=>{var X,ye;return(0,C.jsxs)(ut.Float,{composable:!0,shift:8,zIndex:99,offset:2,children:[(0,C.jsx)(ut.Float.Reference,{children:(0,C.jsx)(le.PopoverButton,{as:"button",children:(0,C.jsxs)("div",{className:(0,ce.default)({[k.filter]:!A&&!l,[k.filterOpen]:l&&!A,[k.filterActive]:l&&A||!l&&A},"group px-3 h-[36px] text-p-ls font-bold disabled:shadow-none active:shadow-none flex items-center justify-between outline-none gap-2"),children:[e&&(0,C.jsx)("div",{className:(0,ce.default)({"text-label group-active:text-blue-500":!p.value&&!l,"text-blue-500":l&&!p.value,"text-blue-500 group-hover:text-white group-active:text-white":l&&p.value}),children:e}),(0,C.jsx)("label",{className:(0,ce.default)({"text-paragraph group-active:text-blue-500":!p.value&&!l,"text-blue-500":l&&!p.value,"text-blue-500 group-hover:text-white group-active:text-white":l&&p.value},"truncate cursor-pointer"),children:a?t:(X=p==null?void 0:p.value)!=null&&X.id?(ye=p==null?void 0:p.value)==null?void 0:ye.label:t}),a&&p.value&&p.value.length>0&&(0,C.jsx)("div",{className:"bg-blue-500 text-white text-p-xs px-1 py-[2px] rounded group-hover:bg-blue-500",children:p.value.length}),(0,C.jsx)("i",{className:(0,ce.default)({"text-label group-active:text-blue-500":!p.value&&!l,"text-blue-500":l&&!p.value,"text-blue-500 group-hover:text-white group-active:text-white":l&&p.value},"uil uil-angle-down text-[18px]")})]})})}),l&&(0,C.jsx)(ut.Float.Content,{children:(0,C.jsx)(le.PopoverPanel,{className:"p-3 whitespace-nowrap bg-white rounded-lg shadow-dropdown border-[0.5px] border-neutral-300",children:({close:we})=>{let xe=()=>{v(p.value),we()};return(0,pe.useEffect)(()=>{v(p.value)},[l]),(0,C.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,C.jsx)(le.Listbox,{value:u||[],onChange:v,multiple:a,children:(0,C.jsxs)(le.ListboxOptions,{static:!0,className:"max-h-60 w-full overflow-x-hidden overflow-y-auto bg-white text-p-md focus:outline-none sm:text-sm relative",children:[(0,C.jsxs)("div",{className:"mr-1 sticky top-0 z-30",children:[f&&(0,C.jsx)(St,{icon:(0,C.jsx)("i",{className:"uil uil-search"}),onChange:W=>n(W),value:b,placeholder:"Pesquisar",clearField:!0,onKeyDown:W=>{(W.key===" "||W.code==="Space")&&W.stopPropagation()}}),x&&D&&(0,C.jsx)("div",{className:"flex items-center gap-2 pt-2 bg-white",children:x.map((W,ne)=>{let fe=(W==null?void 0:W.id)===R;return(0,C.jsx)("button",{className:(0,ce.default)({"bg-blue-500 text-white":fe,"text-paragraph":!fe},"rounded-[20px] border-[0.5px] border-neutral-200 px-4 py-[6px]"),onClick:()=>{R==W.id?r(null):r(W.id)},children:W.name},ne)})})]}),o&&(0,C.jsxs)("div",{className:"flex items-center justify-center gap-2 w-full my-4",children:[(0,C.jsx)("img",{className:"animate-spin",src:"/spinner-gray.svg",alt:"circle",width:13,height:13}),"Carregando"]}),(P==null?void 0:P.length)===0&&(b==null?void 0:b.length)>0&&!o&&(0,C.jsx)("div",{className:"py-4",children:(0,C.jsx)("span",{className:"text-label text-p-md",children:E})}),h&&(P==null?void 0:P.length)===0&&(b==null?void 0:b.length)===0&&!o&&(i==null?void 0:i.length)===0&&!(u!=null&&u.id)&&(0,C.jsx)("div",{className:"py-4",children:(0,C.jsx)("span",{className:"text-label text-p-md",children:h})}),h&&u&&(u==null?void 0:u.id)&&(b==null?void 0:b.length)===0&&(0,C.jsx)("div",{className:"py-2",children:a?(0,C.jsx)(C.Fragment,{children:u==null?void 0:u.map(W=>{let ne=a?u&&(u==null?void 0:u.length)>0&&(u==null?void 0:u.some(fe=>fe.id===W.id)):u&&(u==null?void 0:u.id)===W.id;return O(i,ne)})}):O(p.value,!0)}),!o&&(P==null?void 0:P.map(W=>{let ne=a?u&&u.length>0&&u.some(fe=>fe.id===W.id):u&&u.id===W.id;return O(W,ne)}))]})}),!c&&(0,C.jsxs)("div",{className:"flex gap-2 items-center justify-end border-t border-t-neutral-200 pt-3",children:[a&&N&&(0,C.jsx)("div",{className:"border-r pr-2 border-neutral-300",children:(0,C.jsx)(G,{variant:"link",size:"xxs",onClick:()=>{N(),p.onChange(i),v(i),we()},children:"Marcar todos"})}),s&&(0,C.jsx)("div",{className:"mr-1",children:(0,C.jsx)(G,{variant:"link",size:"xxs",onClick:()=>{s&&(s(),v([]),p.onChange([])),we()},children:"Limpar"})}),(0,C.jsx)(G,{size:"xs",variant:"secondary",onClick:()=>{xe()},children:"Cancelar"}),(0,C.jsx)(G,{size:"xs",variant:"primary",disabled:JSON.stringify(u)===JSON.stringify(p==null?void 0:p.value),onClick:()=>{p.onChange(u),m&&m(),we()},children:"Aplicar"})]})]})}})})]})}})}})};var na=require("react"),ra=require("react-hook-form"),ct=K(require("clsx"),1),sa=K(require("react-intl-currency-input"),1),me=require("react/jsx-runtime"),la=(0,na.forwardRef)(({label:e,type:t,onClick:a,error:i,onBlur:m,onChangeValue:s,inputProps:N,icon:d,clearField:T,name:D,required:x,disabled:E,value:h,placeholder:c,control:f,defaultValue:k,isWeightField:u,minFractionDigits:v=2},P)=>{let b={locale:"pt-BR",formats:{number:{BRL:u?{currency:"BRL",minimumFractionDigits:v,maximumFractionDigits:v,useGrouping:!1}:{style:"currency",currency:"BRL",minimumFractionDigits:v,maximumFractionDigits:v}}}},n=[i==null?void 0:i.message],R=n.some(o=>o!==void 0),r={input:`text-p-md pl-2 peer text-paragraph shadow-input border rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:border ${e?"pt-[22px]":"pt-[10px]"} ${R?"border-dangerous-500 text-dangerous-500":"border-neutral-300 focus-visible:border-blue-500"}`,icon:`absolute bg-neutral-100 h-[44px] top-[1px] left-[1px] w-[38px] rounded-l-lg ${R?"text-dangerous-500":"text-label"}
|
|
12
|
-
`,label:"absolute text-label top-[0.80rem] z-10 origin-[0] transform -translate-y-3 scale-75 duration-300 text-sm peer-focus:text-blue-500 peer-focus:scale-75 peer-focus:-translate-y-3 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0",buttonsWrapper:"absolute top-[7px] right-[10px] cursor-pointer text-label flex flex-col gap-[2px]",button:"border-[0.5px] border-neutral-300 rounded shadow-input"};return(0,me.jsx)(
|
|
13
|
-
`,label:"absolute text-label top-[0.80rem] z-10 origin-[0] transform -translate-y-3 scale-75 duration-300 text-sm peer-focus:text-blue-500 peer-focus:scale-75 peer-focus:-translate-y-3 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0",buttonsWrapper:"absolute top-[7px] right-[10px] cursor-pointer text-label flex flex-col gap-[2px]",button:"border-[0.5px] border-neutral-300 rounded shadow-input h-4 w-4 flex items-center justify-center"},[g,L]=(0,
|
|
14
|
-
`,label:"absolute text-label top-[0.80rem] z-10 origin-[0] transform -translate-y-3 scale-75 duration-300 text-sm peer-focus:text-blue-500 peer-focus:scale-75 peer-focus:-translate-y-3 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0",buttonsWrapper:"absolute top-[7px] right-[10px] cursor-pointer text-label flex flex-col gap-[2px]",button:"border-[0.5px] border-neutral-300 rounded shadow-input"},R=d?document==null?void 0:document.getElementById(d):null;return(0,ge.jsx)(pa.Controller,{control:E,name:d,defaultValue:h,render:({field:r})=>{let o=(g,L,O)=>{g.preventDefault(),r.onChange(L.toString()),f&&f(L.toString())};return typeof r.value=="string"&&(r.value=Number(r.value)),(0,ge.jsxs)("div",{children:[(0,ge.jsxs)("div",{className:"relative outline-none",children:[s&&(0,ge.jsx)("div",{className:(0,mt.default)(n.icon,"flex justify-center items-center"),children:s}),(0,ge.jsxs)("div",{children:[(0,ge.jsx)(ma.default,{...m,...r,type:"text",ref:P,className:(0,mt.default)({[n.input]:!0,"pr-10":N,"pr-2":!N,"pl-[3rem]":s}),placeholder:!e&&x?x:" ",onClick:t,disabled:D,currency:"BRL",config:v,onChange:o,max:k}),(0,ge.jsxs)("label",{className:(0,mt.default)({[n.label]:!0,"left-[3rem]":s,"left-2.5":!s},"cursor-text"),onClick:()=>R==null?void 0:R.focus(),children:[e,T&&e&&(0,ge.jsx)("strong",{className:"text-dangerous-500",children:"\xA0*"})]})]})]}),F.map((g,L)=>(0,ge.jsx)("div",{className:"text-dangerous-500 text-xs mt-1 ml-[2px]",role:"alert","aria-label":g,children:g},L))]})}})}ga.displayName="InputPercentage";var ba=require("react"),xa=require("react-hook-form"),fa=K(require("react-input-mask"),1);var gt=require("react/jsx-runtime"),ao=({type:e="text",name:t,label:a,placeholder:i,error:m,mask:s,control:N,required:d,onKeyUp:T,maskChar:D="",alwaysShowMask:x,defaultValue:E,disabled:h})=>{let c=(0,ba.useRef)(null);return(0,gt.jsx)(xa.Controller,{name:t,control:N,defaultValue:E,render:({field:f})=>{let k=u=>{let{nextState:v,previousState:P}=u;var{value:F}=v,b=v.selection,n=b?b.start:null,R=[".","-","/","(",")"," "],r=[...F];return R.includes(r[r.length-1])&&(n===F.length&&(n--,b={start:n,end:n}),F=F.slice(0,-1)),{value:F,selection:b}};return(0,gt.jsx)(fa.default,{...f,onKeyUp:T,disabled:h,mask:s,value:f.value||"",onChange:f.onChange,maskChar:D,alwaysShowMask:x,beforeMaskedStateChange:k,children:u=>(0,gt.jsx)(Ze,{onKeyUp:T,type:e,label:a,placeholder:i,required:d,inputProps:u,error:m,name:t,disabled:h,ref:c})})}})};var bt=K(require("clsx"),1),ha=require("react"),Dt=K(require("react-modal"),1);var te=require("react/jsx-runtime"),oo=Dt.default||Dt,no={success:"text-success-500",error:"text-dangerous-500",warning:"text-warning-500",info:"text-blue-500",primary:"text-rose-700"},ro={xs:"w-[350px]",sm:"w-[662px]",md:"w-[960px]",lg:"w-[80%] min-w-[800px]",null:""},so=({open:e,onOpen:t=()=>{},onClose:a,onCancel:i,triggerButton:m,confirmButton:s,title:N,cancelButton:d,icon:T,alertType:D,size:x="sm",info:E,description:h,children:c})=>{let f={content:{top:"50%",left:"50%",right:"auto",bottom:"auto",marginRight:"-50%",transform:"translate(-50%, -50%)",border:"1px solid #E8E8E9",padding:"24px",borderRadius:"8px",overflow:"initial"},overlay:{backgroundColor:"rgb(107,114,128,0.50)",zIndex:9999}},k=m?(0,ha.cloneElement)(m,{onClick:()=>{t()}}):null;return(0,te.jsxs)("div",{children:[k,(0,te.jsx)(oo,{ariaHideApp:!1,isOpen:e,onRequestClose:a,style:f,contentLabel:"Example Modal",children:(0,te.jsxs)("div",{className:(0,bt.default)(ro[x]),children:[(0,te.jsxs)("div",{className:"pb-2 border-b border-b-neutral-200 flex items-center justify-between",children:[(0,te.jsxs)("h3",{className:"text-[24px] font-bold flex items-center gap-2",children:[D&&(0,te.jsx)("div",{className:(0,bt.default)([no[D]],"text-[30px]"),children:T}),N]}),(0,te.jsx)("button",{onClick:i,className:"text-neutral-500 text-[24px]",children:(0,te.jsx)("i",{className:"uil uil-times"})})]}),(0,te.jsx)("div",{children:c}),(0,te.jsxs)("div",{className:"pt-6 border-t border-t-neutral-200 flex w-full items-center justify-between",children:[(0,te.jsx)("div",{className:(0,bt.default)({"flex-1":E}),children:E}),(0,te.jsxs)("div",{className:"flex flex-col-reverse md:flex-row gap-3 items-center md:justify-end w-full md:w-auto",children:[d||(0,te.jsx)(G,{onClick:()=>{i&&i()},variant:"secondary",size:"sm",children:"Cancelar"}),s]})]})]})})]})};var va=require("react-tooltip"),Qe=require("react/jsx-runtime"),lo=({id:e,displayArrow:t=!0,openOnClick:a=!1})=>(0,Qe.jsx)(Qe.Fragment,{children:(0,Qe.jsx)(va.Tooltip,{id:e,className:"absolute bg-neutral-700 text-sm text-neutral-100 py-2 px-4 max-w-[430px] break-words whitespace-normal",classNameArrow:t?"":{noArrow:"hidden"}.noArrow,openOnClick:a,delayHide:0,delayShow:0})});var wa=require("react"),Na=require("react-hook-form"),Et=require("react-select"),Ca=K(require("react-select/async"),1);var ya={indicatorSeparator:(e,t)=>{var a;return{...e,backgroundColor:t.hasValue&&((a=e==null?void 0:e.selectProps)!=null&&a.isSearchable)?"var(--input)":"transparent"}},clearIndicator:e=>({...e,color:"var(--label)",":hover":{color:"var(--label)"}}),dropdownIndicator:(e,t)=>{var a;return{...e,color:"var(--paragraph)",transform:(a=t==null?void 0:t.selectProps)!=null&&a.menuIsOpen?"rotate(180deg)":"rotate(0)",":hover":{color:"var(--paragraph)"}}},input:(e,t)=>({...e,paddingLeft:t.selectProps.hasIcon?"34px":"0px",paddingTop:t.selectProps.hasLabel?"10px":"0px"}),menu:e=>({...e,marginTop:"4px",border:"1px solid var(--neutral-300)",boxShadow:"none",borderRadius:"8px",background:"white",zIndex:20}),menuList:e=>({...e,padding:"8px"}),singleValue:(e,t)=>({...e,paddingLeft:t.selectProps.hasIcon?"34px":"0px",paddingTop:t.selectProps.hasLabel?"10px":"0",color:t.data.value==="active"?"#0EAF86":t.selectProps.hasError?"var(--dangerous-500)":"black",display:"flex"}),control:(e,t)=>({...e,cursor:"pointer",border:t.selectProps.hasError?"1px solid var(--dangerous-700)":t.menuIsOpen?"1px solid var(--blue-700)":"1px solid var(--dark-blue-300)",boxShadow:"none",outline:"none",borderRadius:"0.5rem",placeholder:" ",height:t.selectProps.smallField?"30px":"46px",backgroundColor:t.isDisabled?"var(--light-100)":"white",":hover":{border:t.selectProps.hasError?"1px solid var(--dangerous-700)":t.menuIsOpen?"1px solid var(--blue-700)":"1px solid var(--neutral-300)"}}),multiValue:e=>({...e,borderRadius:"20px",backgroundColor:"var(--neutral-100)",padding:"0px 8px"}),multiValueLabel:e=>({...e,color:"var(--paragraph)"}),multiValueRemove:e=>({...e,color:"var(--neutral-400)",":hover":{color:"var(--dangerous-500)"}}),option:(e,t)=>{let a=t.isSelected?"white":t!=null&&t.isDisabled?"var(--label)":"var(--paragraph)";return{...e,cursor:t.isDisabled?"auto":"pointer",pointerEvents:t.isDisabled?"none":"",borderRadius:"8px",margin:"4px 0px",padding:"12px",backgroundColor:t.isSelected?"var(--blue-500)":"white",color:a,fontWeight:t.isSelected?700:400,"&:hover":{backgroundColor:t.isSelected?"var(--blue-500)":"var(--neutral-200)"},"&:active":{backgroundColor:"var(--blue-500)",color:"white",fontWeight:700},"&:active i":{color:"white",fontWeight:700}," i":{color:"white"}}},container:e=>({...e,border:"none",outline:"none",boxShadow:"none",padding:"none",margin:"none"})};var De=require("react");var xt=K(require("clsx"),1),z=require("react/jsx-runtime"),io=({name:e,error:t,label:a,defaultValue:i,control:m,placeholder:s,isSearchable:N=!1,isClearable:d=!1,onChange:T,required:D,debounce:x=0,filterOptions:E,optionsList:h,disabled:c,onChangeValue:f,resize:k=!0,optionStyle:u,valueStyle:v,icon:P,emptyMessage:F,small:b=!1})=>{var Oe;let{Option:n,DropdownIndicator:R,ClearIndicator:r,SingleValue:o}=Et.components,g=(0,wa.useRef)(null),[L,O]=(0,De.useState)(""),[V,p]=(0,De.useState)(!1),[A,U]=(0,De.useState)(()=>h||[]),[Z,l]=(0,De.useState)(300),[X,ye]=(0,De.useState)(!1);(0,De.useEffect)(()=>{let _=()=>{var Ie,ze;if((Ie=g==null?void 0:g.current)!=null&&Ie.getBoundingClientRect){let qe=(ze=g==null?void 0:g.current)==null?void 0:ze.getBoundingClientRect(),Ve=window.innerHeight-qe.bottom-24;l(Ve<250?276:Ve)}};return _(),window.addEventListener("resize",_),()=>{window.removeEventListener("resize",_)}},[g]);let we=_=>{if(p(!0),N&&E){if(x&&_.length>=x||!x){let Ie=E(_);return p(!1),Ie}}else U(h)},W=[(Oe=nt(_=>_.field)[e])==null?void 0:Oe.message,t==null?void 0:t.message],ne={hasError:W.some(_=>_!==void 0)},fe={smallField:b},tt={hasLabel:(a==null?void 0:a.length)>0},Ge=k?{menuHeight:Z}:null,Y={hasIcon:P};return(0,De.useEffect)(()=>{U(()=>h)},[h]),(0,z.jsx)(Na.Controller,{name:e,control:m,defaultValue:i,render:({field:_})=>{let Ie=M=>(0,z.jsx)(o,{...M,children:v?v(M==null?void 0:M.data):(0,z.jsxs)(z.Fragment,{children:[M.data.label," "]})}),ze=M=>(0,z.jsx)(n,{...M,children:u?u(M==null?void 0:M.data):(0,z.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:(0,z.jsx)("span",{className:(0,xt.default)("text-p-md focus:text-white"),children:M.data.label})})}),qe=M=>{if(!x||x&&L.length>=x)return(0,z.jsxs)("div",{...M.innerProps,className:"flex items-center gap-[6px] p-2",children:[(0,z.jsx)("img",{className:"animate-spin ",src:"/spinner.svg",alt:"circle",width:16,height:16}),"Buscando..."]});if(x&&L.length<x)return(0,z.jsxs)("div",{className:"p-2 text-neutral-300",children:["Digite ",x," ou mais caracteres para pesquisar"]})},at=M=>{var Ce;if(M.selectProps.inputValue.length==0&&x>0||x>0&&M.selectProps.inputValue.length<x)return(0,z.jsxs)("div",{className:"text-dangerous-500 text-sm",children:["Digite ",x," ou mais caracteres para pesquisar"]});if(M.selectProps.inputValue.length>0&&((Ce=M==null?void 0:M.options)==null?void 0:Ce.length)==0)return(0,z.jsx)("div",{className:"text-dangerous-500 text-sm",children:"Nenhum dado encontrado"})},Ve=M=>(0,z.jsx)(R,{...M,children:(0,z.jsx)("i",{className:`uil uil-angle-down text-[20px] ${b?"h-[20px] -mt-[7px]":"h-full"}`})}),Ne=M=>(0,z.jsx)(r,{...M,children:(0,z.jsx)("i",{className:"uil uil-times text-[16px]"})}),de=M=>{_.onChange(M),f&&f(M)},Je=async M=>{var Ce;if(M.key==="Enter"){M.preventDefault();let Te=await we((Ce=M==null?void 0:M.target)==null?void 0:Ce.value);(Te==null?void 0:Te.length)>0&&de(Te[0])}};return(0,z.jsxs)("div",{className:"relative w-full",id:"select",ref:g,children:[P&&(0,z.jsx)("div",{className:(0,xt.default)("z-[70] absolute bg-neutral-100 top-[1px] left-[1px] rounded-l-lg flex justify-center items-center h-[44px] w-[38px] text-[22px] text-dark-blue-600",{"text-blue-500":X&&Y.hasIcon,"text-red-500":ne.hasError&&Y.hasIcon}),children:P}),(0,z.jsx)(Ca.default,{onKeyDown:Je,..._,...ne,...tt,...Ge,...Y,...fe,isDisabled:c,onFocus:()=>ye(!0),onBlur:()=>ye(!1),loadingMessage:()=>(0,z.jsx)("div",{children:"Carregando"}),isLoading:V,defaultOptions:x>0?!1:h?A:!0,loadOptions:we,name:_.name,isClearable:d,styles:ya,placeholder:s||" ",isSearchable:N,options:A,tabSelectsValue:!0,components:{SingleValue:Ie,ValueContainer:Ta,Option:ze,LoadingIndicator:()=>(0,z.jsx)(z.Fragment,{}),LoadingMessage:qe,NoOptionsMessage:at,DropdownIndicator:Ve,ClearIndicator:Ne},closeMenuOnSelect:!0,hideSelectedOptions:!1,onChange:de}),(0,z.jsxs)("span",{className:(0,xt.default)("text-label text-sm left-2.5 cursor-pointer pointer-events-none absolute transition-all duration-200",{"scale-75 -translate-y-3":_.value||L,"ml-[35px]":Y.hasIcon,"ml-[2px]":!Y.hasIcon,"top-2.5":!(_.value||L),"top-0":_.value||L}),children:[a,D&&a&&(0,z.jsx)("strong",{className:"text-dangerous-700",children:"\xA0*"})]}),W.map((M,Ce)=>(0,z.jsx)("div",{style:{color:"var(--dangerous-700)"},className:"text-xs ml-[2px]",role:"alert","aria-label":M,children:M},Ce))]})}})},Ta=({children:e,...t})=>(0,z.jsx)(Et.components.ValueContainer,{...t,children:e});var Ra=require("react-hook-form"),Be=require("react/jsx-runtime"),uo=({disabled:e,control:t,name:a,label:i,defaultChecked:m})=>(0,Be.jsx)(Ra.Controller,{name:a,control:t,render:({field:s})=>(0,Be.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,Be.jsxs)("label",{className:"custom-radio flex items-center",children:[(0,Be.jsx)("input",{name:a,id:a,type:"radio",className:"",onClick:N=>{s.onChange(N.target.value)},defaultChecked:m,disabled:e}),(0,Be.jsx)("span",{})]}),i&&(0,Be.jsx)("label",{htmlFor:a,className:"text-p-md cursor-pointer -pt-1",children:i})]})});var kt=require("@headlessui/react"),Sa=require("react-hook-form"),ie=require("react/jsx-runtime"),{Group:co,Label:po}=kt.Switch;function ft(...e){return e.filter(Boolean).join(" ")}var mo=({name:e,label:t,subLabel:a,control:i,disabled:m})=>(0,ie.jsxs)(co,{as:"div",className:"flex items-center",children:[(0,ie.jsx)(Sa.Controller,{control:i,name:e,render:({field:s})=>(0,ie.jsx)(kt.Switch,{disabled:m,...s,className:"h-[18px] w-[33px] focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 rounded-full",checked:!!s.value,onChange:N=>{s.onChange(N)},children:({checked:N})=>(0,ie.jsx)("div",{className:ft(N?"bg-blue-500":"bg-neutral-200","relative inline-flex h-[18px] p-[2px] w-[33px] flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out "),children:(0,ie.jsxs)("span",{className:ft("pointer-events-none relative inline-block -top-[2px] right-[2px] h-[14px] w-[14px] transform rounded-full shadow ring-0 transition duration-200 ease-in-out",N?"translate-x-[15px]":"translate-x-0",m?"bg-neutral-300":"bg-white"),children:[(0,ie.jsx)("span",{className:ft(N?"opacity-0 ease-out duration-100":"opacity-100 ease-in duration-200","absolute inset-0 flex h-full w-full items-center justify-center transition-opacity"),"aria-hidden":"true"}),(0,ie.jsx)("span",{className:ft(N?"opacity-100 ease-in duration-200":"opacity-0 ease-out duration-100","absolute inset-0 flex h-full w-full items-center justify-center transition-opacity"),"aria-hidden":"true"})]})})})}),t&&(0,ie.jsxs)(po,{as:"span",className:"flex flex-col gap-1 ml-2 cursor-pointer",children:[(0,ie.jsx)("span",{className:"text-sm text-paragraph",children:t}),a&&(0,ie.jsx)("span",{className:"text-sm",children:a})]})]});var ve=require("@headlessui/react"),be=require("react"),Pt=K(require("clsx"),1),$=require("react/jsx-runtime");function It({pageSizeOptions:e,table:t}){var v,P,F,b,n,R;let a=t==null?void 0:t.getPageCount(),i=a?[...Array(a)]:[],m=i==null?void 0:i.map((r,o)=>({id:o,name:o})),[s,N]=(0,be.useState)({id:((v=JSON.parse(sessionStorage.getItem("pageSize")))==null?void 0:v.id)||20,name:((P=JSON.parse(sessionStorage.getItem("pageSize")))==null?void 0:P.name)||20}),[d,T]=(0,be.useState)({id:((b=(F=t==null?void 0:t.getState())==null?void 0:F.pagination)==null?void 0:b.pageIndex)||0,name:((R=(n=t==null?void 0:t.getState())==null?void 0:n.pagination)==null?void 0:R.pageIndex)||0}),[D,x]=(0,be.useState)(()=>m),[E,h]=(0,be.useState)(e==null?void 0:e.map(r=>({id:r,name:r}))),[c,f]=(0,be.useState)(""),k=()=>{let r=[...m];x(r.filter(o=>(o.name+1).toString().startsWith(c)))},u=(r,o)=>{sessionStorage.setItem(r,JSON.stringify(o))};return(0,be.useEffect)(()=>{k()},[c]),(0,be.useEffect)(()=>{u("pageSize",s),t.setPageSize(s==null?void 0:s.id),t.setPageIndex(0),T({id:0,name:0})},[s]),(0,be.useEffect)(()=>{x(a?[...Array(a)].map((r,o)=>({id:o,name:o})):[])},[t==null?void 0:t.getPageCount()]),(0,be.useEffect)(()=>{var r,o,g,L,O,V;((o=(r=t==null?void 0:t.getState())==null?void 0:r.pagination)==null?void 0:o.pageIndex)>=0&&T({id:(L=(g=t==null?void 0:t.getState())==null?void 0:g.pagination)==null?void 0:L.pageIndex,name:(V=(O=t==null?void 0:t.getState())==null?void 0:O.pagination)==null?void 0:V.pageIndex})},[t==null?void 0:t.getState().pagination]),(0,$.jsxs)("div",{className:"hidden md:flex items-center gap-2",children:[(0,$.jsxs)("div",{className:"flex items-center gap-2 text-paragraph",children:[(0,$.jsx)("span",{children:"Exibir "}),(0,$.jsx)(ve.Combobox,{value:s,onChange:r=>{N(r)},children:({open:r})=>(0,$.jsxs)("div",{className:"relative",children:[(0,$.jsxs)(ve.Combobox.Button,{className:"flex items-center justify-between w-[70px] h-[42px] text-paragraph outline-none text-p-sm cursor-pointer peer relative shadow-input rounded-lg border p-2 disabled:bg-neutral-100 border-neutral-300",children:[s==null?void 0:s.name,r?(0,$.jsx)("i",{className:"uil uil-angle-up text-base top-[13px] pl-3 cursor-pointer text-label"}):(0,$.jsx)("i",{className:"uil uil-angle-down text-base top-[13px] pl-3 cursor-pointer text-label"})]}),(0,$.jsx)(ve.Combobox.Options,{className:"w-full outline-none max-h-[200px] overflow-auto border-[0.5px] mt-1 color-neutral-300 flex flex-col gap-y-2 p-1 absolute right-0 bottom-12 z-[999] rounded-lg bg-white",children:E==null?void 0:E.map(o=>{let g=(o==null?void 0:o.id)===(s==null?void 0:s.id);return(0,$.jsx)(ve.Combobox.Option,{value:o,className:(0,Pt.default)("p-2 rounded-lg items-center justify-center cursor-pointer flex whitespace-nowrap no-underline ",{"bg-blue-500 hover:bg-blue-500 hover:text-[#FFFFFF] text-[#FFFFFF]":g},{"hover:bg-neutral-100 text-paragraph":!g}),children:o.name},(s==null?void 0:s.id)+"size")})})]})}),(0,$.jsx)("span",{children:" resultados"})]}),(0,$.jsx)("div",{className:"bg-neutral-300 h-[20px] w-[1px]"}),(0,$.jsxs)("div",{className:"flex items-center gap-2 text-paragraph",children:[(0,$.jsx)("span",{children:"Ir para a p\xE1gina "}),(0,$.jsx)(ve.Combobox,{value:d,onChange:r=>{r&&(r!=null&&r.id)&&(T({id:r==null?void 0:r.id,name:r==null?void 0:r.id}),u("pageIndex",r==null?void 0:r.id),t.setPageIndex(r==null?void 0:r.id),f(""))},children:({open:r})=>(0,$.jsxs)("div",{className:"relative",children:[(0,$.jsxs)(ve.Combobox.Button,{className:"relative",children:[(0,$.jsx)(ve.Combobox.Input,{as:"input",onKeyDown:o=>{var L;let g=Number((L=o.target)==null?void 0:L.value);o.key=="Enter"&&g&&g<=a&&(T({id:g-1,name:g-1}),u("pageIndex",g),t.setPageIndex(g-1),f(""))},displayValue:o=>d?(d==null?void 0:d.id)+1:(o==null?void 0:o.id)+1,onChange:o=>{o.target.value&&f(o.target.value)},className:"h-[42px] w-[70px] outline-none text-p-md text-paragraph cursor-pointer border-neutral-300 peer shadow-input rounded-lg border block disabled:bg-neutral-100 p-2"}),r?(0,$.jsx)("i",{className:"uil uil-angle-up text-base absolute top-[10px] right-2 cursor-pointer text-label"}):(0,$.jsx)("i",{className:"uil uil-angle-down text-base absolute top-[10px] right-2 cursor-pointer text-label"})]}),(0,$.jsx)(ve.Combobox.Options,{className:"w-full outline-none max-h-[200px] overflow-auto border-[0.5px] mt-1 color-neutral-300 flex flex-col gap-y-2 p-1 absolute right-0 bottom-12 z-[999] rounded-lg bg-white",children:D.map(o=>{let g=(o==null?void 0:o.id)===(d==null?void 0:d.id);return(0,$.jsx)(ve.Combobox.Option,{value:o,className:(0,Pt.default)("p-2 rounded-lg items-center justify-center cursor-pointer flex whitespace-nowrap no-underline ",{"bg-blue-500 hover:bg-blue-500 hover:text-[#FFFFFF] text-[#FFFFFF]":g},{"hover:bg-neutral-100 text-paragraph":!g}),children:(o==null?void 0:o.name)+1},(d==null?void 0:d.id)+"page")})})]})})]})]})}var ae=require("@tanstack/react-table"),j=K(require("react"),1);var Ee=require("clsx"),ke=K(require("react"),1),Pe=require("react/jsx-runtime"),ht=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("table",{ref:a,className:(0,Ee.clsx)("table-scroll block text-left border-separate border-spacing-0 w-full",e),onScroll:t.onScroll,...t}));ht.displayName="Table";var vt=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("thead",{ref:a,className:(0,Ee.clsx)("w-full sticky top-0 z-[90]",e),...t}));vt.displayName="TableHeader";var yt=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("tbody",{ref:a,className:(0,Ee.clsx)(e),...t}));yt.displayName="TableBody";var wt=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("div",{ref:a,className:(0,Ee.clsx)(" flex flex-col md:flex-row gap-2 md:gap-0 justify-between items-center py-4 px-6 bg-white w-full h-full border border-neutral-200 rounded-t-lg",e),...t}));wt.displayName="TableFooter";var et=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("tr",{ref:a,className:(0,Ee.clsx)(e),...t}));et.displayName="TableRow";var Nt=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("th",{ref:a,className:(0,Ee.clsx)({"hover:bg-neutral-100":t.sortable},"text-p-md z-[50] bg-white font-normal text-neutral-700 p-4 text-left border-t border-b border-neutral-200 first:border-l last:border-r first:rounded-tl-lg first:rounded-bl-lg last:rounded-tr-lg last:rounded-br-lg",e),...t}));Nt.displayName="TableHead";var Ct=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("td",{ref:a,className:(0,Ee.clsx)("align-middle h-[80px] border-b border-neutral-200 whitespace-nowrap py-4 px-5",e),...t}));Ct.displayName="TableCell";var Da=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("caption",{ref:a,className:(0,Ee.clsx)("text-default mt-4 text-sm",e),...t}));Da.displayName="TableCaption";var Ea=require("react");var H=require("react/jsx-runtime");function Ft({table:e,footer:t=(0,H.jsx)("div",{}),totalData:a,selectAllOption:i,onSelectAll:m,rowsSelected:s,onRemoveAll:N,tableRef:d,paginationScroll:T,pageSizeOptions:D=[]}){var v,P,F,b,n;let x=(v=e==null?void 0:e.getState())==null?void 0:v.pagination.pageIndex,E=a,h=e==null?void 0:e.getPageCount(),c=((P=e==null?void 0:e.getState())==null?void 0:P.pagination.pageIndex)+2,f=((F=e==null?void 0:e.getState())==null?void 0:F.pagination.pageIndex)-2,k=h?[...Array(h)]:[],u=((n=(b=e==null?void 0:e.getRowModel())==null?void 0:b.rows)==null?void 0:n.length)||0;return(0,H.jsxs)("div",{className:"w-full flex flex-col sticky z-[90] bottom-0",children:[(0,H.jsx)("div",{className:"bg-none overflow-x-hidden md:overflow-x-auto overflow-y-hidden table-scroll rounded-lg relative top-[8px] -space-y-1 z-[302] h-[12px]",onScroll:R=>{d==null||d.current.scrollTo({left:R.currentTarget.scrollLeft})},children:(0,H.jsx)("div",{style:{width:T?T-2:0},children:"\xA0"})}),(0,H.jsxs)(wt,{children:[(D==null?void 0:D.length)>0&&(0,H.jsx)(It,{table:e,pageSizeOptions:D}),(0,H.jsxs)("div",{className:"flex flex-col md:flex-row items-center justify-center md:justify-normal gap-2 md:gap-4",children:[t,i&&(0,H.jsx)("div",{children:s!==a?(0,H.jsx)("div",{className:"md:border-l border-gray-300 pl-4",children:(0,H.jsxs)(G,{size:"xxs",onClick:m,variant:"link",children:["Selecionar todos os ",a]})}):(0,H.jsx)("div",{className:"md:border-l border-gray-300 pl-4",children:(0,H.jsx)(G,{size:"xxs",onClick:N,variant:"link",children:"Desmarcar todos"})})})]}),(0,H.jsxs)("div",{className:"flex flex-col md:flex-row items-center md:justify-end justify-center gap-2 flex-1",children:[(0,H.jsxs)("span",{className:"text-p-md text-paragraph mr-1",children:["Mostrando ",u," de ",E," resultados"]}),(0,H.jsxs)("div",{className:"flex items-center gap-2",children:[(0,H.jsx)(G,{onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),variant:"icon",icon:(0,H.jsx)("i",{className:"uil uil-angle-left text-base"}),size:"xs",className:"justify-center"}),f>=1&&(0,H.jsxs)("div",{className:"flex gap-2",children:[(0,H.jsx)(G,{onClick:()=>e.setPageIndex(0),variant:"icon",icon:(0,H.jsx)("div",{style:{fontSize:"12px",color:"#393C4D"},children:1}),size:"xs",className:"justify-center"}),f!==1&&(0,H.jsx)(G,{disabled:!0,variant:"icon",icon:(0,H.jsx)(H.Fragment,{children:"..."}),size:"xs",className:"justify-center"})]}),k.map((R,r)=>{let o=r<=c&&r>=f,g=r===x;return(0,H.jsx)(Ea.Fragment,{children:o&&(0,H.jsx)(G,{onClick:()=>e.setPageIndex(r),className:"font-normal text-xs justify-center",variant:g?"blue":"icon",size:"xs",icon:(0,H.jsx)("div",{style:{fontSize:"12px",color:g?"#FFF":"#393C4D"},children:(r+1).toLocaleString("pt-BR")})})},r+"pagination")}),c+1<h&&(0,H.jsxs)("div",{className:"flex gap-2",children:[c!==k.length-2&&(0,H.jsx)(G,{disabled:!0,variant:"icon",icon:(0,H.jsx)(H.Fragment,{children:"..."}),size:"xs",className:"justify-center"}),(0,H.jsx)(G,{onClick:()=>e.setPageIndex(h),variant:"icon",icon:(0,H.jsx)("div",{style:{fontSize:"12px",color:"#393C4D"},children:h.toLocaleString("pt-BR")}),size:"xs",className:"font-normal justify-center"})]}),(0,H.jsx)(G,{onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),variant:"icon",icon:(0,H.jsx)("i",{className:"uil uil-angle-right text-base"}),size:"xs",className:"justify-center"})]})]})]})]})}var Ke=K(require("clsx"),1),ka=require("@tanstack/match-sorter-utils");var B=require("react/jsx-runtime"),go=(e,t,a,i)=>{let m=(0,ka.rankItem)(e.getValue(t),a);return i({itemRank:m}),m.passed};function Mt({columns:e,tableClass:t="",data:a=[],hidePagination:i,emptyButtonAction:m,hideBlankState:s,renderSubComponent:N=()=>{},footer:d,borderFull:T=!1,withShadow:D=!0,actionsSelection:x,backgroundColor:E,emptyState:h,totalData:c=0,showFilter:f,placeholder:k,fetchData:u,openedSubComponent:v=!1,getRowCanExpand:P,enableRowSelection:F,onScroll:b,tableContainerRef:n,setRows:R,selectAllOption:r,autoPagination:o,rowClassName:g,listUpdate:L,setRowSelection:O,rowSelection:V,perPage:p,pageSizeOptions:A,onFinishFetch:U}){var Bt,At,Ot,zt,Vt,Jt;let Z=(0,j.useRef)(null),[l,X]=(0,j.useState)({}),[ye,we]=(0,j.useState)([]),[xe,W]=(0,j.useState)([]),[ne,fe]=(0,j.useState)([]),[tt,Ge]=(0,j.useState)(""),[Y,Oe]=(0,j.useState)([]),[_,Ie]=(0,j.useState)(!0),[ze,qe]=(0,j.useState)({}),[at,Ve]=(0,j.useState)(()=>c),[{pageIndex:Ne,pageSize:de},Je]=(0,j.useState)({pageIndex:0,pageSize:i?999999:p||20}),[M,Ce]=(0,j.useState)(),Te=(0,j.useMemo)(()=>({pageIndex:Ne,pageSize:de}),[Ne,de]),Pa=()=>{var I,J;u&&!o?u({pageSize:de,pageIndex:Ne,order:(I=xe[0])==null?void 0:I.id,orderDir:(J=xe[0])!=null&&J.desc?"DESC":"ASC"}).then(S=>{Oe(S.rows),!(S!=null&&S.rows)&&c>0&&Je({pageIndex:Ne-1,pageSize:de})}):Ia(Ne,de).then(S=>{Oe(S.rows),!(S!=null&&S.rows)&&c>0&&Je({pageIndex:Ne-1,pageSize:de})}),setTimeout(()=>{U&&U()},1e3)},Ia=async(I,J)=>({rows:(await new Promise((ee,Tt)=>{let _e=[],Fe,jt;for(Fe=0,jt=c;Fe<jt;Fe+=J)_e.push(a==null?void 0:a.slice(Fe,Fe+J));ee(_e)}))[I],pageCount:Number(J)});(0,j.useEffect)(()=>{if(!(n!=null&&n.current))return;let I=new ResizeObserver(()=>{var J;Ce((J=n==null?void 0:n.current)==null?void 0:J.scrollWidth)});return I.observe(n==null?void 0:n.current),()=>I.disconnect()},[]),(0,j.useEffect)(()=>{(u||o)&&Pa()},[Ne,de,xe]),(0,j.useEffect)(()=>{c!==at&&(Je({pageIndex:0,pageSize:Te.pageSize}),Ve(c))},[c]),(0,j.useEffect)(()=>{a&&(Oe(()=>o?a.slice(0,de):a),Ie(!1))},[a]);let Fa=c<Te.pageSize?1:Math.ceil(c/Te.pageSize),oe=(0,ae.useReactTable)({data:(Y==null?void 0:Y.length)>0?Y:[],columns:e,state:{sorting:xe,columnVisibility:l,rowSelection:V,globalFilter:tt,columnFilters:ye,pagination:Te,expanded:ze},pageCount:Fa,manualPagination:!0,enableRowSelection:F,onRowSelectionChange:O,onSortingChange:W,onColumnFiltersChange:we,onColumnVisibilityChange:X,onGlobalFilterChange:Ge,globalFilterFn:go,getCoreRowModel:(0,ae.getCoreRowModel)(),getFilteredRowModel:(0,ae.getFilteredRowModel)(),getFacetedRowModel:(0,ae.getFacetedRowModel)(),getFacetedUniqueValues:(0,ae.getFacetedUniqueValues)(),onPaginationChange:Je,getRowCanExpand:P,onExpandedChange:qe,getExpandedRowModel:(0,ae.getExpandedRowModel)(),enableExpanding:!0,getRowId:I=>I.id,meta:{getRowStyles:g}});(0,j.useEffect)(()=>{F&&V&&fe(Object.keys(V))},[V,F]);let Ma=()=>{oe.toggleAllRowsSelected(!0);let I=a==null?void 0:a.map(S=>S==null?void 0:S.id),J={};I==null||I.forEach(S=>{J={...J,[S]:!0}}),O(J)},La=()=>{oe.toggleAllRowsSelected(),O({})},Lt=Y&&(Y==null?void 0:Y.length)==0&&!_&&!s||!Y||((At=(Bt=oe==null?void 0:oe.getRowModel())==null?void 0:Bt.rows)==null?void 0:At.length)==0,Ha=!i&&c>0&&oe;function Ba(){var I;if(Lt&&c!==null)return h||(0,B.jsx)("div",{});if(Ha&&c!==null)return(0,B.jsx)(Ft,{table:oe,footer:d,totalData:c,tableRef:n,selectAllOption:r,onSelectAll:Ma,rowsSelected:(I=Object.keys(V||{}))==null?void 0:I.length,onRemoveAll:La,paginationScroll:M,pageSizeOptions:A});if(c==null)return(0,B.jsx)(B.Fragment,{})}(0,j.useEffect)(()=>{if(V&&Object.keys(V).length==0){let I=document.getElementsByClassName("th-shadow");Object.keys(I).forEach(J=>{var S,re;(re=(S=I[J])==null?void 0:S.classList)==null||re.add("with-shadow")})}else if(V&&Object.keys(V).length==1){let I=document.getElementsByClassName("th-shadow");Object.keys(I).forEach(J=>{var S,re;(re=(S=I[J])==null?void 0:S.classList)==null||re.remove("with-shadow")})}},[V]);let Ht=I=>{var S,re;let J=oe;return g?(re=(S=J==null?void 0:J.options)==null?void 0:S.meta)==null?void 0:re.getRowStyles(I):{}};return(0,B.jsxs)("div",{className:"w-full h-full flex flex-col",children:[f&&(0,B.jsxs)("div",{className:"w-full flex justify-between md:items-center flex-col md:flex-row gap-y-2 md:gap-y-0",children:[(0,B.jsx)("div",{className:"w-full md:max-w-[350px]",id:"filter-table",children:(0,B.jsx)(Ze,{onChange:I=>Ge(I.target.value),name:"filter",value:tt,icon:(0,B.jsx)("i",{className:"uil uil-search"}),placeholder:"Buscar pedido por ID, C\xF3digo ou Cliente",clearField:!0,onClear:()=>Ge("")})}),L]}),(0,B.jsxs)("div",{className:(0,Ke.default)("w-full flex mt-4 flex-col justify-between",{"flex-1":!Lt,[t]:t}),children:[(0,B.jsxs)(ht,{className:(0,Ke.default)("w-full table_container z-20 overflow-x-scroll md:overflow-x-hidden"),onScroll:b,ref:n,children:[V&&((Ot=Object.keys(V))==null?void 0:Ot.length)>0&&x&&(Y==null?void 0:Y.length)>0&&(0,B.jsxs)("div",{className:"h-[76px] flex items-center justify-between px-4 bg-gradient-to-b from-blue-start to-blue-end rounded-lg -mb-[1px]",children:[(0,B.jsxs)("div",{className:"flex gap-6",children:[(0,B.jsxs)("span",{className:"text-white text-p-lg",children:[Object.keys(V).length," selecionado(s)"]}),x]}),(0,B.jsx)("button",{title:"set-row",onClick:()=>O({}),children:(0,B.jsx)("i",{className:"uil uil-times text-white"})})]}),(0,B.jsxs)("div",{className:"table w-full mr-[2px]",ref:Z,children:[(0,B.jsx)(vt,{children:(zt=oe==null?void 0:oe.getHeaderGroups())==null?void 0:zt.map((I,J)=>(0,B.jsx)(et,{children:I.headers.map((S,re)=>{var Tt,_e,Fe;let ee=S.column.columnDef.meta;return(0,B.jsx)(Nt,{style:{width:S.getSize()},scope:"col",className:(0,Ke.default)({"hover:bg-neutral-100 th-shadow cursor-pointer":S.column.getCanSort(),"with-shadow":(ne==null?void 0:ne.length)==0&&D},ee==null?void 0:ee.header,ee==null?void 0:ee.className),children:(0,B.jsxs)("div",{onClick:S.column.getToggleSortingHandler(),children:[S.isPlaceholder?null:(0,ae.flexRender)(S.column.columnDef.header,S.getContext()),((Tt=xe[0])==null?void 0:Tt.id)==S.column.id?(0,B.jsx)("i",{className:(0,Ke.default)({"rotate-0":!((_e=xe[0])!=null&&_e.desc),"rotate-180":(Fe=xe[0])==null?void 0:Fe.desc},"uil uil-arrow-down text-blue-500 transform ml-1 text-[18px] duration-75")}):(0,B.jsx)(B.Fragment,{})]})},J+re+"th")})},I.id+J+"header"))}),(0,B.jsx)(yt,{children:(Jt=(Vt=oe==null?void 0:oe.getRowModel())==null?void 0:Vt.rows)==null?void 0:Jt.map((I,J)=>(0,B.jsx)(j.default.Fragment,{children:!I.original._destroy&&(0,B.jsxs)(j.default.Fragment,{children:[(0,B.jsx)(et,{id:I.id,className:"text-p-md font-normal h-[80px] text-paragraph w-fit",style:Ht(I),children:I.getVisibleCells().map((S,re)=>{let ee=S.column.columnDef.meta;return(0,B.jsx)(Ct,{id:S.id,style:{width:S.column.getSize(),backgroundColor:E||"",...Ht(I)},className:(0,Ke.default)({hidden:S.row.original._destroy,"first:border-l last:border-r":T,"first:rounded-bl-lg last:rounded-br-lg":T&&I.index===(a==null?void 0:a.length)-1},ee==null?void 0:ee.cell,ee==null?void 0:ee.className),children:(0,ae.flexRender)(S.column.columnDef.cell,S.getContext())},S.id)})},I.id),(I.getIsExpanded()||v)&&(0,B.jsx)("tr",{children:(0,B.jsx)("td",{colSpan:I.getVisibleCells().length,children:N({row:I})})})]})},J+"row"))})]})]}),Ba()]})]})}0&&(module.exports={Badge,Button,Calendar,Checkbox,DataTable,DataTablePagination,DatePickerInput,FilterCalendar,FilterOptions,Input,InputMoney,InputNumber,InputPercentage,Logo,MaskedInput,ModalDialog,PaginationSelect,Popover,Radio,RocketIcon,SelectField,SpinnerIcon,Table,TableBody,TableCaption,TableCell,TableFooter,TableHead,TableHeader,TableRow,Toggle,ValueContainer});
|
|
11
|
+
${e?"left-[3rem]":"left-2.5"}`),style:{top:"13px"},children:[t,T&&t&&(0,ue.jsx)("strong",{className:"text-dangerous-700 ml-1",children:"*"})]}),s&&(l==null?void 0:l.value)&&(l==null?void 0:l.value)!==""&&!c&&(0,ue.jsx)("i",{className:(0,rt.default)({[A.clear]:!0},"uil uil-times clear-icon"),onClick:()=>{U&&(U==null||U.focus()),k&&k()}})]})}),V.map((l,X)=>(0,ue.jsx)("div",{className:"absolute text-dangerous-700 text-xs mt-[2px] ml-1",role:"alert","aria-label":l,children:l},X))]})});var Zt=K(require("clsx"),1),Qt=require("react/jsx-runtime"),_a={success:"bg-success-100 text-success-600",warning:"bg-warning-100 text-warning-600",blue:"bg-blue-100 text-blue-500",gray:"bg-neutral-100 text-neutral-400",dangerous:"bg-dangerous-100 text-dangerous-600",light:"bg-neutral-100 text-neutral-400",white:"bg-[#FFF] text-neutral-400 px-4 py-[6px] border border-light shadow-button text-paragraph",primary:"bg-rose-100 text-rose-800",dark:"bg-neutral-700 text-white",outline:"bg-white text-rose-700 border border-neutral-200","dark-gray":"bg-neutral-100 text-neutral-600"},Ya=({variant:e="blue",children:t,className:a,style:i})=>(0,Qt.jsx)("span",{className:(0,Zt.default)({[_a[e]]:(e==null?void 0:e.length)>0},"py-1 px-2 text-p-md font-normal inline-flex items-center justify-center gap-1 rounded-full text-center",a),style:i,children:t});var lt=require("@blueprintjs/datetime2"),ea=require("react-hook-form"),y=require("date-fns"),Le=require("react/jsx-runtime"),Za=({registration:e,error:t,control:a,name:i,rangeCalendar:m=!1,shortcutsChange:s,selectedShortcut:N,setSelectedShortcut:d,maxDate:T=new Date,singleMonth:D=!1})=>{let x=[t==null?void 0:t.message],E=[{label:"Todo o per\xEDodo",dateRange:[]},{label:"Hoje",dateRange:[(0,y.set)(new Date,{hours:0,minutes:0,seconds:0}),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"Ontem",dateRange:[(0,y.set)((0,y.sub)(new Date,{days:1}),{hours:0,minutes:0,seconds:0}),(0,y.set)((0,y.sub)(new Date,{days:1}),{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 7 dias",dateRange:[(0,y.set)((0,y.sub)(new Date,{days:7}),{hours:0,minutes:0,seconds:0}),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 14 dias",dateRange:[(0,y.set)((0,y.sub)(new Date,{days:14}),{hours:0,minutes:0,seconds:0}),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 30 dias",dateRange:[(0,y.set)((0,y.sub)(new Date,{days:30}),{hours:0,minutes:0,seconds:0}),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 60 dias",dateRange:[(0,y.set)((0,y.sub)(new Date,{days:60}),{hours:0,minutes:0,seconds:0}),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 90 dias",dateRange:[(0,y.set)((0,y.sub)(new Date,{days:90}),{hours:0,minutes:0,seconds:0}),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"Esta semana",dateRange:[(0,y.startOfWeek)(new Date),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"Semana passada",dateRange:[(0,y.startOfWeek)((0,y.sub)(new Date,{days:7})),(0,y.endOfWeek)((0,y.sub)(new Date,{days:7}))]},{label:"Este M\xEAs",dateRange:[(0,y.startOfMonth)(new Date),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"M\xEAs passado",dateRange:[(0,y.startOfMonth)((0,y.sub)(new Date,{months:1})),(0,y.endOfMonth)((0,y.sub)(new Date,{months:1}))]},{label:"\xDAltimos 6 meses",dateRange:[(0,y.startOfMonth)((0,y.sub)(new Date,{months:6})),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59}),,]}];return(0,Le.jsxs)("div",{children:[(0,Le.jsx)(ea.Controller,{control:a,name:i,render:({field:{onChange:h,value:c}})=>(0,Le.jsx)("div",{id:"group-input-calendar",className:"relative",children:m?(0,Le.jsx)(lt.DateRangePicker3,{allowSingleDayRange:!0,shortcuts:E,selectedShortcutIndex:N||E[0],onChange:f=>{let k=[];f[0]&&f[0]!==null&&k.push((0,y.set)(f[0],{hours:0,minutes:0,seconds:0})),f[1]&&f[1]!==null&&k.push((0,y.set)(f[1],{hours:23,minutes:59,seconds:59})),f[0]!==null&&f[1]==null&&(s&&s(null),d&&d(null)),s&&s(""),h(k)},singleMonthOnly:D,value:c,highlightCurrentDay:!0,minDate:(0,y.subYears)(new Date,50),maxDate:T,locale:"pt",onShortcutChange:f=>{let k=E.findIndex(u=>u.label===f.label);k!==-1&&d&&d(k),s&&s(f)}}):(0,Le.jsx)(lt.DatePicker3,{onChange:f=>{h(f)},value:c,highlightCurrentDay:!0,locale:"pt"})})}),x.map((h,c)=>(0,Le.jsx)("div",{className:"text-dangerous-500 text-xs mt-[2px]",role:"alert","aria-label":h,children:h},c))]})};var ta=K(require("clsx"),1),He=require("react/jsx-runtime"),Qa=({key:e="",label:t,registration:a,disabled:i})=>(0,He.jsx)("div",{children:(0,He.jsxs)("div",{className:"relative flex items-start",children:[(0,He.jsx)("div",{className:"flex h-5 items-center",children:(0,He.jsx)("input",{...a,id:a?a.name:e,disabled:i,type:"checkbox",className:(0,ta.default)("disabled:hover:bg-neutral-100 disabled:cursor-default cursor-pointer h-[16px] w-[16px] rounded-[2.5px] border border-neutral-200 text-blue-500 focus:rounded-[4px] focus:border-[1.5px] focus:ring-blue-500 focus-visible:ring-blue-500 checked:after:text-blue-500 disabled:bg-neutral-100")})}),(0,He.jsx)("div",{className:"ml-3 text-sm",children:(0,He.jsx)("label",{htmlFor:a==null?void 0:a.name,className:"cursor-pointer font-medium text-gray-700",children:t})})]})});var We=require("react"),aa=require("react-hook-form"),$e=require("@headlessui/react"),Xe=K(require("clsx"),1),it=require("@headlessui-float/react");var oa=require("date-fns"),w=require("date-fns"),dt=require("@blueprintjs/datetime2"),q=require("react/jsx-runtime"),eo=({icon:e,label:t,onApply:a,onClear:i,control:m,name:s,rangeCalendar:N=!0,defaultShortcut:d,shortcutsChange:T,singleMonth:D=!1,maxDate:x=void 0})=>{let E={filter:"rounded-3xl shadow-input bg-white hover:bg-neutral-100 border border-neutral-300 active:text-blue-500 active:bg-blue-100 active:border-blue-500",filterOpen:"rounded-3xl shadow-input border border-blue-500 bg-blue-100 text-blue-500",filterActive:"rounded-3xl border border-blue-500 text-blue-500 bg-blue-100 shadow-input hover:bg-blue-500 hover:text-white active:text-white active:bg-blue-600 active:border-blue-600"},[h,c]=(0,We.useState)([]),[f,k]=(0,We.useState)(""),u=(window==null?void 0:window.innerWidth)<768,v=[{label:"Todo o per\xEDodo",dateRange:[]},{label:"Hoje",dateRange:[(0,w.set)(new Date,{hours:0,minutes:0,seconds:0}),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"Ontem",dateRange:[(0,w.set)((0,w.sub)(new Date,{days:1}),{hours:0,minutes:0,seconds:0}),(0,w.set)((0,w.sub)(new Date,{days:1}),{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 7 dias",dateRange:[(0,w.set)((0,w.sub)(new Date,{days:7}),{hours:0,minutes:0,seconds:0}),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 14 dias",dateRange:[(0,w.set)((0,w.sub)(new Date,{days:14}),{hours:0,minutes:0,seconds:0}),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 30 dias",dateRange:[(0,w.set)((0,w.sub)(new Date,{days:30}),{hours:0,minutes:0,seconds:0}),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 60 dias",dateRange:[(0,w.set)((0,w.sub)(new Date,{days:60}),{hours:0,minutes:0,seconds:0}),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 90 dias",dateRange:[(0,w.set)((0,w.sub)(new Date,{days:90}),{hours:0,minutes:0,seconds:0}),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"Esta semana",dateRange:[(0,w.startOfWeek)(new Date),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"Semana passada",dateRange:[(0,w.startOfWeek)((0,w.sub)(new Date,{days:7})),(0,w.endOfWeek)((0,w.sub)(new Date,{days:7}))]},{label:"Este M\xEAs",dateRange:[(0,w.startOfMonth)(new Date),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"M\xEAs passado",dateRange:[(0,w.startOfMonth)((0,w.sub)(new Date,{months:1})),(0,w.endOfMonth)((0,w.sub)(new Date,{months:1}))]},{label:"\xDAltimos 6 meses",dateRange:[(0,w.startOfMonth)((0,w.sub)(new Date,{months:6})),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59}),,]}],[P,F]=(0,We.useState)(d||v[0]),b=(0,q.jsx)("div",{id:"group-input-calendar",className:"relative",children:N?(0,q.jsx)(dt.DateRangePicker3,{allowSingleDayRange:!0,shortcuts:v,selectedShortcutIndex:P,onChange:n=>{let R=[];n[0]&&n[0]!==null&&R.push((0,w.set)(n[0],{hours:0,minutes:0,seconds:0})),n[1]&&n[1]!==null&&R.push((0,w.set)(n[1],{hours:23,minutes:59,seconds:59})),n[0]!==null&&n[1]==null&&(k(""),F&&F(null)),k(""),c(R)},singleMonthOnly:D,value:h,highlightCurrentDay:!0,minDate:(0,w.subYears)(new Date,50),maxDate:x,locale:"pt",onShortcutChange:n=>{let R=v.findIndex(r=>r.label===n.label);R!==-1&&F&&F(R),k(n==null?void 0:n.label)}}):(0,q.jsx)(dt.DatePicker3,{onChange:n=>{c(n)},value:h,highlightCurrentDay:!0,locale:"pt"})});return(0,q.jsx)(aa.Controller,{name:s,control:m,render:({field:n})=>{var r;let R=((r=n==null?void 0:n.value)==null?void 0:r.length)>0;return(0,q.jsx)($e.Popover,{className:(0,Xe.default)({"w-full":u},"relative text-paragraph"),children:({open:o})=>{var g,L;return(0,q.jsxs)(it.Float,{composable:!0,shift:8,zIndex:99,offset:2,children:[(0,q.jsx)(it.Float.Reference,{children:(0,q.jsx)($e.PopoverButton,{as:"button",children:(0,q.jsxs)("div",{className:(0,Xe.default)({[E.filter]:!R&&!o,[E.filterOpen]:o&&!R,[E.filterActive]:o&&R||!o&&R},"group px-3 h-[36px] text-p-ls font-bold disabled:shadow-none active:shadow-none flex items-center justify-between outline-none gap-2"),children:[e&&(0,q.jsx)("div",{className:(0,Xe.default)({"text-label group-active:text-blue-500":!n.value&&!o,"text-blue-500":o&&!n.value,"text-blue-500 group-hover:text-white group-active:text-white":o&&n.value}),children:e}),(0,q.jsx)("label",{className:(0,Xe.default)({"text-paragraph group-active:text-blue-500":!n.value&&!o,"text-blue-500":o&&!n.value,"text-blue-500 group-hover:text-white group-active:text-white":o&&n.value},"truncate cursor-pointer"),children:f||(((g=n==null?void 0:n.value)==null?void 0:g.length)>0?(L=n==null?void 0:n.value)==null?void 0:L.map(O=>O!==null?(0,oa.format)(O,"dd/MM/yyyy"):"").join(" - "):t)}),(0,q.jsx)("i",{className:(0,Xe.default)({"text-label group-active:text-blue-500":!n.value&&!o,"text-blue-500":o&&!n.value,"text-blue-500 group-hover:text-white group-active:text-white":o&&n.value},"uil uil-angle-down text-[18px]")})]})})}),o&&(0,q.jsx)(it.Float.Content,{children:(0,q.jsx)($e.PopoverPanel,{className:"p-3 whitespace-nowrap bg-white rounded-lg shadow-dropdown border-[0.5px] border-neutral-300",children:({close:O})=>{let V=()=>{c(n.value),O()};return(0,We.useEffect)(()=>{c(n.value)},[o]),(0,q.jsxs)("div",{className:"flex flex-col gap-2",children:[b,(0,q.jsxs)("div",{className:"flex gap-2 items-center justify-end border-t border-t-neutral-200 pt-3",children:[i&&(0,q.jsx)("div",{className:"mr-1",children:(0,q.jsx)(G,{variant:"link",size:"xxs",onClick:()=>{i&&(i(),c([]),n.onChange([])),O()},children:"Limpar"})}),(0,q.jsx)(G,{size:"xs",variant:"secondary",onClick:()=>{V()},children:"Cancelar"}),(0,q.jsx)(G,{size:"xs",variant:"primary",disabled:JSON.stringify(h)===JSON.stringify(n==null?void 0:n.value),onClick:()=>{n.onChange(h),a&&a(),O()},children:"Aplicar"})]})]})}})})]})}})}})};var pe=require("react"),ra=require("react-hook-form"),le=require("@headlessui/react"),ce=K(require("clsx"),1),ut=require("@headlessui-float/react");var na=require("react"),Ue=K(require("clsx"),1),Se=require("react/jsx-runtime");function Et({type:e,registration:t,onClick:a,onBlur:i,onChange:m,inputProps:s,icon:N,clearField:d,disabled:T,placeholder:D,className:x,onKeyDown:E,value:h,searchOnClick:c,onClear:f,collapsed:k}){let u=(0,na.useRef)(null),v={input:"text-p-md text-paragraph w-full outline-none placeholder:text-label",icon:"text-label group-focus-within:text-neutral-600 m-[10px]",wrapper:`shadow-input border border-neutral-300 focus-within:border-blue-500 group rounded-lg h-9 w-full text-paragraph flex items-center justify-between disabled:bg-neutral-100 ${T?"bg-neutral-100":"bg-white"} ${x}`,clear:"pr-[5px] cursor-pointer text-label text-[16px]"},P=u==null?void 0:u.current;return(0,Se.jsxs)("div",{className:(0,Ue.default)(v.wrapper),children:[N&&!c&&(0,Se.jsx)("div",{className:(0,Ue.default)(v.icon),children:N}),(0,Se.jsx)("input",{...t,...s,type:"search-text",ref:u,className:(0,Ue.default)({"pl-1":k},v.input),placeholder:D,onBlur:i,onChange:F=>m(F.target.value),onClick:a,disabled:T,onKeyDown:E}),d&&h&&!T&&(0,Se.jsx)("i",{className:(0,Ue.default)(v.clear,"uil uil-times"),onClick:()=>{P.value="",P==null||P.focus(),m(""),f&&f()}}),c&&(0,Se.jsx)("div",{className:"py-1",children:(0,Se.jsx)("button",{type:"button",className:(0,Ue.default)({"border-l border-input pl-1":d&&h&&!T,"text-blue-500":!T,"text-neutral-300":T,"pl-[2px]":k}),onClick:c,children:(0,Se.jsx)("i",{className:"uil uil-search text-[16px] mr-2 pl-1"})})})]})}var C=require("react/jsx-runtime"),to=({icon:e,label:t,isMulti:a,options:i=[],onApply:m,onClear:s,onSelectAll:N,control:d,name:T,fetch:D,subFilters:x=[],emptyMessage:E,initialMessage:h,applyOnClick:c=!1,showFilter:f=!1})=>{let k={filter:"rounded-3xl shadow-input bg-white hover:bg-neutral-100 border border-neutral-300 active:text-blue-500 active:bg-blue-100 active:border-blue-500",filterOpen:"rounded-3xl shadow-input border border-blue-500 bg-blue-100 text-blue-500",filterActive:"rounded-3xl border border-blue-500 text-blue-500 bg-blue-100 shadow-input hover:bg-blue-500 hover:text-white active:text-white active:bg-blue-600 active:border-blue-600"},[u,v]=(0,pe.useState)(a?[]:{}),[P,F]=(0,pe.useState)(()=>i),[b,n]=(0,pe.useState)(""),[R,r]=(0,pe.useState)((x==null?void 0:x.length)>0?x[0].id:null),[o,g]=(0,pe.useState)(!1),L=async()=>{if((b==null?void 0:b.length)>0||(i==null?void 0:i.length)>0)if(D)F(await D(b,R));else{let A=i.filter(U=>{var Z;return(Z=U==null?void 0:U.label)==null?void 0:Z.toLowerCase().includes(b.toLowerCase())}).sort((U,Z)=>{var l;return(l=U==null?void 0:U.label)==null?void 0:l.toLowerCase()});F(A)}else F([]);g(!1)};(0,pe.useEffect)(()=>{g(!0);let p=setTimeout(()=>{L()},400);return()=>clearTimeout(p)},[b]);let O=(p,A)=>(0,C.jsx)(le.ListboxOption,{disabled:p.disabled,value:p,as:pe.Fragment,children:(0,C.jsxs)("div",{className:(0,ce.default)("relative cursor-pointer outline-none select-none p-3 rounded-lg pr-9 text-paragraph mt-1 first:mt-0 overflow-hidden w-full",{"hover:bg-neutral-200":!p.disabled&&!A,"text-gray-200":p.disabled,"bg-blue-500 hover:bg-blue-500":A}),children:[(0,C.jsx)("span",{className:(0,ce.default)({"font-semibold text-white":A},"text-wrap break-words font-normal block"),children:p==null?void 0:p.label}),(0,C.jsx)("span",{className:(0,ce.default)({"font-semibold text-white":A},"w-[200px] whitespace-nowrap text-ellipsis overflow-hidden text-label text-p-sm block"),children:p==null?void 0:p.description}),A?(0,C.jsx)("span",{className:(0,ce.default)("absolute inset-y-0 text-white right-0 flex items-center pr-4"),children:(0,C.jsx)("i",{className:"uil uil-check text-lg"})}):null]})},p.id),V=(window==null?void 0:window.innerWidth)<768;return(0,C.jsx)(ra.Controller,{name:T,control:d,render:({field:p})=>{var U,Z;let A=a?((U=p==null?void 0:p.value)==null?void 0:U.length)>0:!!((Z=p==null?void 0:p.value)!=null&&Z.id);return(0,C.jsx)(le.Popover,{className:(0,ce.default)({"w-full":V},"relative text-paragraph"),children:({open:l})=>{var X,ye;return(0,C.jsxs)(ut.Float,{composable:!0,shift:8,zIndex:99,offset:2,children:[(0,C.jsx)(ut.Float.Reference,{children:(0,C.jsx)(le.PopoverButton,{as:"button",children:(0,C.jsxs)("div",{className:(0,ce.default)({[k.filter]:!A&&!l,[k.filterOpen]:l&&!A,[k.filterActive]:l&&A||!l&&A},"group px-3 h-[36px] text-p-ls font-bold disabled:shadow-none active:shadow-none flex items-center justify-between outline-none gap-2"),children:[e&&(0,C.jsx)("div",{className:(0,ce.default)({"text-label group-active:text-blue-500":!p.value&&!l,"text-blue-500":l&&!p.value,"text-blue-500 group-hover:text-white group-active:text-white":l&&p.value}),children:e}),(0,C.jsx)("label",{className:(0,ce.default)({"text-paragraph group-active:text-blue-500":!p.value&&!l,"text-blue-500":l&&!p.value,"text-blue-500 group-hover:text-white group-active:text-white":l&&p.value},"truncate cursor-pointer"),children:a?t:(X=p==null?void 0:p.value)!=null&&X.id?(ye=p==null?void 0:p.value)==null?void 0:ye.label:t}),a&&p.value&&p.value.length>0&&(0,C.jsx)("div",{className:"bg-blue-500 text-white text-p-xs px-1 py-[2px] rounded group-hover:bg-blue-500",children:p.value.length}),(0,C.jsx)("i",{className:(0,ce.default)({"text-label group-active:text-blue-500":!p.value&&!l,"text-blue-500":l&&!p.value,"text-blue-500 group-hover:text-white group-active:text-white":l&&p.value},"uil uil-angle-down text-[18px]")})]})})}),l&&(0,C.jsx)(ut.Float.Content,{children:(0,C.jsx)(le.PopoverPanel,{className:"p-3 whitespace-nowrap bg-white rounded-lg shadow-dropdown border-[0.5px] border-neutral-300",children:({close:we})=>{let xe=()=>{v(p.value),we()};return(0,pe.useEffect)(()=>{v(p.value)},[l]),(0,C.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,C.jsx)(le.Listbox,{value:u||[],onChange:v,multiple:a,children:(0,C.jsxs)(le.ListboxOptions,{static:!0,className:"max-h-60 w-full overflow-x-hidden overflow-y-auto bg-white text-p-md focus:outline-none sm:text-sm relative",children:[(0,C.jsxs)("div",{className:"mr-1 sticky top-0 z-30",children:[f&&(0,C.jsx)(Et,{icon:(0,C.jsx)("i",{className:"uil uil-search"}),onChange:W=>n(W),value:b,placeholder:"Pesquisar",clearField:!0,onKeyDown:W=>{(W.key===" "||W.code==="Space")&&W.stopPropagation()}}),x&&D&&(0,C.jsx)("div",{className:"flex items-center gap-2 pt-2 bg-white",children:x.map((W,ne)=>{let fe=(W==null?void 0:W.id)===R;return(0,C.jsx)("button",{className:(0,ce.default)({"bg-blue-500 text-white":fe,"text-paragraph":!fe},"rounded-[20px] border-[0.5px] border-neutral-200 px-4 py-[6px]"),onClick:()=>{R==W.id?r(null):r(W.id)},children:W.name},ne)})})]}),o&&(0,C.jsxs)("div",{className:"flex items-center justify-center gap-2 w-full my-4",children:[(0,C.jsx)("img",{className:"animate-spin",src:"/spinner-gray.svg",alt:"circle",width:13,height:13}),"Carregando"]}),(P==null?void 0:P.length)===0&&(b==null?void 0:b.length)>0&&!o&&(0,C.jsx)("div",{className:"py-4",children:(0,C.jsx)("span",{className:"text-label text-p-md",children:E})}),h&&(P==null?void 0:P.length)===0&&(b==null?void 0:b.length)===0&&!o&&(i==null?void 0:i.length)===0&&!(u!=null&&u.id)&&(0,C.jsx)("div",{className:"py-4",children:(0,C.jsx)("span",{className:"text-label text-p-md",children:h})}),h&&u&&(u==null?void 0:u.id)&&(b==null?void 0:b.length)===0&&(0,C.jsx)("div",{className:"py-2",children:a?(0,C.jsx)(C.Fragment,{children:u==null?void 0:u.map(W=>{let ne=a?u&&(u==null?void 0:u.length)>0&&(u==null?void 0:u.some(fe=>fe.id===W.id)):u&&(u==null?void 0:u.id)===W.id;return O(i,ne)})}):O(p.value,!0)}),!o&&(P==null?void 0:P.map(W=>{let ne=a?u&&u.length>0&&u.some(fe=>fe.id===W.id):u&&u.id===W.id;return O(W,ne)}))]})}),!c&&(0,C.jsxs)("div",{className:"flex gap-2 items-center justify-end border-t border-t-neutral-200 pt-3",children:[a&&N&&(0,C.jsx)("div",{className:"border-r pr-2 border-neutral-300",children:(0,C.jsx)(G,{variant:"link",size:"xxs",onClick:()=>{N(),p.onChange(i),v(i),we()},children:"Marcar todos"})}),s&&(0,C.jsx)("div",{className:"mr-1",children:(0,C.jsx)(G,{variant:"link",size:"xxs",onClick:()=>{s&&(s(),v([]),p.onChange([])),we()},children:"Limpar"})}),(0,C.jsx)(G,{size:"xs",variant:"secondary",onClick:()=>{xe()},children:"Cancelar"}),(0,C.jsx)(G,{size:"xs",variant:"primary",disabled:JSON.stringify(u)===JSON.stringify(p==null?void 0:p.value),onClick:()=>{p.onChange(u),m&&m(),we()},children:"Aplicar"})]})]})}})})]})}})}})};var sa=require("react"),la=require("react-hook-form"),pt=K(require("clsx"),1),ct=K(require("react-intl-currency-input"),1),me=require("react/jsx-runtime"),ao=(ct==null?void 0:ct.default)||ct,ia=(0,sa.forwardRef)(({label:e,type:t,onClick:a,error:i,onBlur:m,onChangeValue:s,inputProps:N,icon:d,clearField:T,name:D,required:x,disabled:E,value:h,placeholder:c,control:f,defaultValue:k,isWeightField:u,minFractionDigits:v=2},P)=>{let b={locale:"pt-BR",formats:{number:{BRL:u?{currency:"BRL",minimumFractionDigits:v,maximumFractionDigits:v,useGrouping:!1}:{style:"currency",currency:"BRL",minimumFractionDigits:v,maximumFractionDigits:v}}}},n=[i==null?void 0:i.message],R=n.some(o=>o!==void 0),r={input:`text-p-md pl-2 peer text-paragraph shadow-input border rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:border ${e?"pt-[22px]":"pt-[10px]"} ${R?"border-dangerous-500 text-dangerous-500":"border-neutral-300 focus-visible:border-blue-500"}`,icon:`absolute bg-neutral-100 h-[44px] top-[1px] left-[1px] w-[38px] rounded-l-lg ${R?"text-dangerous-500":"text-label"}
|
|
12
|
+
`,label:"absolute text-label top-[0.80rem] z-10 origin-[0] transform -translate-y-3 scale-75 duration-300 text-sm peer-focus:text-blue-500 peer-focus:scale-75 peer-focus:-translate-y-3 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0",buttonsWrapper:"absolute top-[7px] right-[10px] cursor-pointer text-label flex flex-col gap-[2px]",button:"border-[0.5px] border-neutral-300 rounded shadow-input"};return(0,me.jsx)(la.Controller,{control:f,name:D,defaultValue:k,render:({field:o})=>{let g=(L,O,V)=>{L.preventDefault(),o.onChange(O),s&&s(O)};return typeof o.value=="string"&&(o.value=Number(o.value)),(0,me.jsxs)("div",{children:[(0,me.jsxs)("div",{className:"relative outline-none",children:[d&&(0,me.jsx)("div",{className:(0,pt.default)(r.icon,"flex justify-center items-center"),children:d}),(0,me.jsxs)("div",{children:[(0,me.jsx)(ao,{...N,...o,type:"text",ref:P,className:(0,pt.default)({[r.input]:!0,"pr-10":T,"pr-2":!T,"pl-[46px]":!e&&c&&d||d}),placeholder:!e&&c?c:" ",onClick:a,disabled:E,currency:"BRL",config:b,onChange:g,onBlur:()=>{m&&m(o.value)}}),(0,me.jsxs)("label",{className:(0,pt.default)({[r.label]:!0,"left-[46px]":d,"left-2.5":!d},"cursor-text"),children:[e,x&&e&&(0,me.jsx)("strong",{className:"text-dangerous-500",children:"\xA0*"})]})]})]}),n.map((L,O)=>(0,me.jsx)("div",{className:"text-dangerous-500 text-xs mt-1 ml-[2px]",role:"alert","aria-label":L,children:L},O))]})}})});ia.displayName="InputMoney";var mt=require("react"),da=require("react-hook-form"),Ae=K(require("clsx"),1),ua=K(require("lodash/debounce"),1),Q=require("react/jsx-runtime");function ca({label:e,type:t,onClick:a,error:i,onBlur:m,onChangeValue:s,inputProps:N,icon:d,clearField:T,name:D,required:x,disabled:E,value:h,placeholder:c,control:f,defaultValue:k,hideArrows:u=!1,maxLength:v,onlyNumbers:P,showZero:F,maxValue:b}){let n=D?document==null?void 0:document.getElementById(D):null,R=[i==null?void 0:i.message],r=R.some(p=>p!==void 0),o={input:`text-p-md pl-2 peer shadow-input border rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:border-1 ${e?"pt-[22px]":"pt-[10px]"} ${r?"border-dangerous-500 text-dangerous-500":"border-neutral-300 focus-visible:border-blue-500"}`,icon:`absolute bg-neutral-100 h-[44px] top-[2px] left-[1.5px] w-[38px] rounded-l-lg ${r?"text-dangerous-500":"text-label"}
|
|
13
|
+
`,label:"absolute text-label top-[0.80rem] z-10 origin-[0] transform -translate-y-3 scale-75 duration-300 text-sm peer-focus:text-blue-500 peer-focus:scale-75 peer-focus:-translate-y-3 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0",buttonsWrapper:"absolute top-[7px] right-[10px] cursor-pointer text-label flex flex-col gap-[2px]",button:"border-[0.5px] border-neutral-300 rounded shadow-input h-4 w-4 flex items-center justify-center"},[g,L]=(0,mt.useState)(0),O=()=>{m&&m(h)},V=(0,mt.useMemo)(()=>(0,ua.default)(()=>{O()},1e3),[]);return(0,Q.jsx)(da.Controller,{control:f,name:D,defaultValue:k,render:({field:{onChange:p,value:A}})=>{let U=l=>{V(),L(l)},Z=l=>{if(p(l),s){let X={...l,target:{...l.target,value:l.target.value.replace(/^0+/,"")}};s(X)}U(g+1)};return(0,Q.jsxs)("div",{className:"relative",children:[(0,Q.jsxs)("div",{className:"relative outline-none",children:[d&&(0,Q.jsx)("div",{className:(0,Ae.default)(o.icon,"flex justify-center items-center"),children:d}),(0,Q.jsxs)("div",{children:[(0,Q.jsx)("input",{type:"number",autoComplete:"off",id:D,className:(0,Ae.default)({[o.input]:!0,"pr-10":T,"pr-2":!T,"pl-[57px]":!e&&c&&d}),placeholder:!e&&c?c:" ",onKeyDown:l=>{(l.code==="ArrowUp"||l.code==="ArrowDown"||l.code==="Enter"||l.key==="+"||l.key==="-"||l.key==="e"&&!P)&&l.preventDefault(),P&&!["Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Digit0","Backspace"].includes(l.code)&&l.preventDefault()},onClick:a,disabled:E,value:F?String(A):String(A).replace(/^0+/,""),onChange:l=>{let X=v?{...l,target:{...l.target,value:l.target.value.slice(0,v)}}:l;(!b||b&&Number(l.target.value)<=b)&&Z(X)},defaultValue:A,onBlur:l=>{m&&m(l.target.value)}}),(0,Q.jsxs)("label",{className:(0,Ae.default)({[o.label]:!0,"left-[3.5rem]":d,"left-2.5":!d},"cursor-text"),onClick:()=>n==null?void 0:n.focus(),children:[e,x&&e&&(0,Q.jsx)("strong",{className:"text-dangerous-500",children:"\xA0*"})]})]}),!u&&(0,Q.jsxs)("div",{className:(0,Ae.default)([o.buttonsWrapper]),children:[(0,Q.jsx)("button",{type:"button",className:(0,Ae.default)([o.button]),disabled:E,onClick:()=>{(!b||b&&Number(A||0)+1<=b)&&Z(String(Number(A||0)+1))},children:(0,Q.jsx)("i",{className:"uil uil-angle-up text-[12px] text-neutral-600"})}),(0,Q.jsx)("button",{type:"button",className:(0,Ae.default)([o.button]),disabled:E,onClick:()=>{(!b||b&&Number(A===0?0:Number(A)-1)<=b)&&Z(A===0?0:String(Number(A)-1))},children:(0,Q.jsx)("i",{className:"uil uil-angle-down text-[12px] text-neutral-600"})})]})]}),R.map((l,X)=>(0,Q.jsx)("div",{className:"absolute text-dangerous-500 text-xs left-[4px] -bottom-[18px]",role:"alert","aria-label":l,children:l},X))]})}})}ca.displayName="InputNumber";var pa=require("react"),ma=require("react-hook-form"),bt=K(require("clsx"),1),gt=K(require("react-intl-currency-input"),1),ge=require("react/jsx-runtime"),oo=(gt==null?void 0:gt.default)||gt;function ga({label:e,onClick:t,error:a,onBlur:i,inputProps:m,icon:s,clearField:N,name:d,required:T,disabled:D,placeholder:x,control:E,defaultValue:h,minFractionDigits:c=2,onChangeValue:f,maxLength:k}){let v={locale:"pt-BR",formats:{number:{BRL:{currency:"BRL",minimumFractionDigits:c,maximumFractionDigits:c,useGrouping:!1}}}},P=(0,pa.useRef)(null),F=[a==null?void 0:a.message],b=F.some(r=>r!==void 0),n={input:`text-p-md pl-2 peer shadow-input border rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:border-1 ${e?"pt-[22px]":"pt-[10px]"} ${b?"border-dangerous-500 text-dangerous-500":"border-neutral-300 focus-visible:border-blue-500"}`,icon:`absolute bg-neutral-100 h-[44px] top-[1px] left-[1.5px] w-[38px] text-[22px] rounded-lg ${b?"text-dangerous-500":"text-label"}
|
|
14
|
+
`,label:"absolute text-label top-[0.80rem] z-10 origin-[0] transform -translate-y-3 scale-75 duration-300 text-sm peer-focus:text-blue-500 peer-focus:scale-75 peer-focus:-translate-y-3 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0",buttonsWrapper:"absolute top-[7px] right-[10px] cursor-pointer text-label flex flex-col gap-[2px]",button:"border-[0.5px] border-neutral-300 rounded shadow-input"},R=d?document==null?void 0:document.getElementById(d):null;return(0,ge.jsx)(ma.Controller,{control:E,name:d,defaultValue:h,render:({field:r})=>{let o=(g,L,O)=>{g.preventDefault(),r.onChange(L.toString()),f&&f(L.toString())};return typeof r.value=="string"&&(r.value=Number(r.value)),(0,ge.jsxs)("div",{children:[(0,ge.jsxs)("div",{className:"relative outline-none",children:[s&&(0,ge.jsx)("div",{className:(0,bt.default)(n.icon,"flex justify-center items-center"),children:s}),(0,ge.jsxs)("div",{children:[(0,ge.jsx)(oo,{...m,...r,type:"text",ref:P,className:(0,bt.default)({[n.input]:!0,"pr-10":N,"pr-2":!N,"pl-[3rem]":s}),placeholder:!e&&x?x:" ",onClick:t,disabled:D,currency:"BRL",config:v,onChange:o,max:k}),(0,ge.jsxs)("label",{className:(0,bt.default)({[n.label]:!0,"left-[3rem]":s,"left-2.5":!s},"cursor-text"),onClick:()=>R==null?void 0:R.focus(),children:[e,T&&e&&(0,ge.jsx)("strong",{className:"text-dangerous-500",children:"\xA0*"})]})]})]}),F.map((g,L)=>(0,ge.jsx)("div",{className:"text-dangerous-500 text-xs mt-1 ml-[2px]",role:"alert","aria-label":g,children:g},L))]})}})}ga.displayName="InputPercentage";var ba=require("react"),xa=require("react-hook-form"),fa=K(require("react-input-mask"),1);var xt=require("react/jsx-runtime"),no=({type:e="text",name:t,label:a,placeholder:i,error:m,mask:s,control:N,required:d,onKeyUp:T,maskChar:D="",alwaysShowMask:x,defaultValue:E,disabled:h})=>{let c=(0,ba.useRef)(null);return(0,xt.jsx)(xa.Controller,{name:t,control:N,defaultValue:E,render:({field:f})=>{let k=u=>{let{nextState:v,previousState:P}=u;var{value:F}=v,b=v.selection,n=b?b.start:null,R=[".","-","/","(",")"," "],r=[...F];return R.includes(r[r.length-1])&&(n===F.length&&(n--,b={start:n,end:n}),F=F.slice(0,-1)),{value:F,selection:b}};return(0,xt.jsx)(fa.default,{...f,onKeyUp:T,disabled:h,mask:s,value:f.value||"",onChange:f.onChange,maskChar:D,alwaysShowMask:x,beforeMaskedStateChange:k,children:u=>(0,xt.jsx)(Ze,{onKeyUp:T,type:e,label:a,placeholder:i,required:d,inputProps:u,error:m,name:t,disabled:h,ref:c})})}})};var ft=K(require("clsx"),1),ha=require("react"),kt=K(require("react-modal"),1);var te=require("react/jsx-runtime"),ro=kt.default||kt,so={success:"text-success-500",error:"text-dangerous-500",warning:"text-warning-500",info:"text-blue-500",primary:"text-rose-700"},lo={xs:"w-[350px]",sm:"w-[662px]",md:"w-[960px]",lg:"w-[80%] min-w-[800px]",null:""},io=({open:e,onOpen:t=()=>{},onClose:a,onCancel:i,triggerButton:m,confirmButton:s,title:N,cancelButton:d,icon:T,alertType:D,size:x="sm",info:E,description:h,children:c})=>{let f={content:{top:"50%",left:"50%",right:"auto",bottom:"auto",marginRight:"-50%",transform:"translate(-50%, -50%)",border:"1px solid #E8E8E9",padding:"24px",borderRadius:"8px",overflow:"initial"},overlay:{backgroundColor:"rgb(107,114,128,0.50)",zIndex:9999}},k=m?(0,ha.cloneElement)(m,{onClick:()=>{t()}}):null;return(0,te.jsxs)("div",{children:[k,(0,te.jsx)(ro,{ariaHideApp:!1,isOpen:e,onRequestClose:a,style:f,contentLabel:"Example Modal",children:(0,te.jsxs)("div",{className:(0,ft.default)(lo[x]),children:[(0,te.jsxs)("div",{className:"pb-2 border-b border-b-neutral-200 flex items-center justify-between",children:[(0,te.jsxs)("h3",{className:"text-[24px] font-bold flex items-center gap-2",children:[D&&(0,te.jsx)("div",{className:(0,ft.default)([so[D]],"text-[30px]"),children:T}),N]}),(0,te.jsx)("button",{onClick:i,className:"text-neutral-500 text-[24px]",children:(0,te.jsx)("i",{className:"uil uil-times"})})]}),(0,te.jsx)("div",{children:c}),(0,te.jsxs)("div",{className:"pt-6 border-t border-t-neutral-200 flex w-full items-center justify-between",children:[(0,te.jsx)("div",{className:(0,ft.default)({"flex-1":E}),children:E}),(0,te.jsxs)("div",{className:"flex flex-col-reverse md:flex-row gap-3 items-center md:justify-end w-full md:w-auto",children:[d||(0,te.jsx)(G,{onClick:()=>{i&&i()},variant:"secondary",size:"sm",children:"Cancelar"}),s]})]})]})})]})};var va=require("react-tooltip"),Qe=require("react/jsx-runtime"),uo=({id:e,displayArrow:t=!0,openOnClick:a=!1})=>(0,Qe.jsx)(Qe.Fragment,{children:(0,Qe.jsx)(va.Tooltip,{id:e,className:"absolute bg-neutral-700 text-sm text-neutral-100 py-2 px-4 max-w-[430px] break-words whitespace-normal",classNameArrow:t?"":{noArrow:"hidden"}.noArrow,openOnClick:a,delayHide:0,delayShow:0})});var wa=require("react"),Na=require("react-hook-form"),Pt=require("react-select"),Ca=K(require("react-select/async"),1);var ya={indicatorSeparator:(e,t)=>{var a;return{...e,backgroundColor:t.hasValue&&((a=e==null?void 0:e.selectProps)!=null&&a.isSearchable)?"var(--input)":"transparent"}},clearIndicator:e=>({...e,color:"var(--label)",":hover":{color:"var(--label)"}}),dropdownIndicator:(e,t)=>{var a;return{...e,color:"var(--paragraph)",transform:(a=t==null?void 0:t.selectProps)!=null&&a.menuIsOpen?"rotate(180deg)":"rotate(0)",":hover":{color:"var(--paragraph)"}}},input:(e,t)=>({...e,paddingLeft:t.selectProps.hasIcon?"34px":"0px",paddingTop:t.selectProps.hasLabel?"10px":"0px"}),menu:e=>({...e,marginTop:"4px",border:"1px solid var(--neutral-300)",boxShadow:"none",borderRadius:"8px",background:"white",zIndex:20}),menuList:e=>({...e,padding:"8px"}),singleValue:(e,t)=>({...e,paddingLeft:t.selectProps.hasIcon?"34px":"0px",paddingTop:t.selectProps.hasLabel?"10px":"0",color:t.data.value==="active"?"#0EAF86":t.selectProps.hasError?"var(--dangerous-500)":"black",display:"flex"}),control:(e,t)=>({...e,cursor:"pointer",border:t.selectProps.hasError?"1px solid var(--dangerous-700)":t.menuIsOpen?"1px solid var(--blue-700)":"1px solid var(--dark-blue-300)",boxShadow:"none",outline:"none",borderRadius:"0.5rem",placeholder:" ",height:t.selectProps.smallField?"30px":"46px",backgroundColor:t.isDisabled?"var(--light-100)":"white",":hover":{border:t.selectProps.hasError?"1px solid var(--dangerous-700)":t.menuIsOpen?"1px solid var(--blue-700)":"1px solid var(--neutral-300)"}}),multiValue:e=>({...e,borderRadius:"20px",backgroundColor:"var(--neutral-100)",padding:"0px 8px"}),multiValueLabel:e=>({...e,color:"var(--paragraph)"}),multiValueRemove:e=>({...e,color:"var(--neutral-400)",":hover":{color:"var(--dangerous-500)"}}),option:(e,t)=>{let a=t.isSelected?"white":t!=null&&t.isDisabled?"var(--label)":"var(--paragraph)";return{...e,cursor:t.isDisabled?"auto":"pointer",pointerEvents:t.isDisabled?"none":"",borderRadius:"8px",margin:"4px 0px",padding:"12px",backgroundColor:t.isSelected?"var(--blue-500)":"white",color:a,fontWeight:t.isSelected?700:400,"&:hover":{backgroundColor:t.isSelected?"var(--blue-500)":"var(--neutral-200)"},"&:active":{backgroundColor:"var(--blue-500)",color:"white",fontWeight:700},"&:active i":{color:"white",fontWeight:700}," i":{color:"white"}}},container:e=>({...e,border:"none",outline:"none",boxShadow:"none",padding:"none",margin:"none"})};var De=require("react");var ht=K(require("clsx"),1),z=require("react/jsx-runtime"),co=({name:e,error:t,label:a,defaultValue:i,control:m,placeholder:s,isSearchable:N=!1,isClearable:d=!1,onChange:T,required:D,debounce:x=0,filterOptions:E,optionsList:h,disabled:c,onChangeValue:f,resize:k=!0,optionStyle:u,valueStyle:v,icon:P,emptyMessage:F,small:b=!1})=>{var Oe;let{Option:n,DropdownIndicator:R,ClearIndicator:r,SingleValue:o}=Pt.components,g=(0,wa.useRef)(null),[L,O]=(0,De.useState)(""),[V,p]=(0,De.useState)(!1),[A,U]=(0,De.useState)(()=>h||[]),[Z,l]=(0,De.useState)(300),[X,ye]=(0,De.useState)(!1);(0,De.useEffect)(()=>{let _=()=>{var Ie,ze;if((Ie=g==null?void 0:g.current)!=null&&Ie.getBoundingClientRect){let qe=(ze=g==null?void 0:g.current)==null?void 0:ze.getBoundingClientRect(),Ve=window.innerHeight-qe.bottom-24;l(Ve<250?276:Ve)}};return _(),window.addEventListener("resize",_),()=>{window.removeEventListener("resize",_)}},[g]);let we=_=>{if(p(!0),N&&E){if(x&&_.length>=x||!x){let Ie=E(_);return p(!1),Ie}}else U(h)},W=[(Oe=nt(_=>_.field)[e])==null?void 0:Oe.message,t==null?void 0:t.message],ne={hasError:W.some(_=>_!==void 0)},fe={smallField:b},tt={hasLabel:(a==null?void 0:a.length)>0},Ge=k?{menuHeight:Z}:null,Y={hasIcon:P};return(0,De.useEffect)(()=>{U(()=>h)},[h]),(0,z.jsx)(Na.Controller,{name:e,control:m,defaultValue:i,render:({field:_})=>{let Ie=M=>(0,z.jsx)(o,{...M,children:v?v(M==null?void 0:M.data):(0,z.jsxs)(z.Fragment,{children:[M.data.label," "]})}),ze=M=>(0,z.jsx)(n,{...M,children:u?u(M==null?void 0:M.data):(0,z.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:(0,z.jsx)("span",{className:(0,ht.default)("text-p-md focus:text-white"),children:M.data.label})})}),qe=M=>{if(!x||x&&L.length>=x)return(0,z.jsxs)("div",{...M.innerProps,className:"flex items-center gap-[6px] p-2",children:[(0,z.jsx)("img",{className:"animate-spin ",src:"/spinner.svg",alt:"circle",width:16,height:16}),"Buscando..."]});if(x&&L.length<x)return(0,z.jsxs)("div",{className:"p-2 text-neutral-300",children:["Digite ",x," ou mais caracteres para pesquisar"]})},at=M=>{var Ce;if(M.selectProps.inputValue.length==0&&x>0||x>0&&M.selectProps.inputValue.length<x)return(0,z.jsxs)("div",{className:"text-dangerous-500 text-sm",children:["Digite ",x," ou mais caracteres para pesquisar"]});if(M.selectProps.inputValue.length>0&&((Ce=M==null?void 0:M.options)==null?void 0:Ce.length)==0)return(0,z.jsx)("div",{className:"text-dangerous-500 text-sm",children:"Nenhum dado encontrado"})},Ve=M=>(0,z.jsx)(R,{...M,children:(0,z.jsx)("i",{className:`uil uil-angle-down text-[20px] ${b?"h-[20px] -mt-[7px]":"h-full"}`})}),Ne=M=>(0,z.jsx)(r,{...M,children:(0,z.jsx)("i",{className:"uil uil-times text-[16px]"})}),de=M=>{_.onChange(M),f&&f(M)},Je=async M=>{var Ce;if(M.key==="Enter"){M.preventDefault();let Te=await we((Ce=M==null?void 0:M.target)==null?void 0:Ce.value);(Te==null?void 0:Te.length)>0&&de(Te[0])}};return(0,z.jsxs)("div",{className:"relative w-full",id:"select",ref:g,children:[P&&(0,z.jsx)("div",{className:(0,ht.default)("z-[70] absolute bg-neutral-100 top-[1px] left-[1px] rounded-l-lg flex justify-center items-center h-[44px] w-[38px] text-[22px] text-dark-blue-600",{"text-blue-500":X&&Y.hasIcon,"text-red-500":ne.hasError&&Y.hasIcon}),children:P}),(0,z.jsx)(Ca.default,{onKeyDown:Je,..._,...ne,...tt,...Ge,...Y,...fe,isDisabled:c,onFocus:()=>ye(!0),onBlur:()=>ye(!1),loadingMessage:()=>(0,z.jsx)("div",{children:"Carregando"}),isLoading:V,defaultOptions:x>0?!1:h?A:!0,loadOptions:we,name:_.name,isClearable:d,styles:ya,placeholder:s||" ",isSearchable:N,options:A,tabSelectsValue:!0,components:{SingleValue:Ie,ValueContainer:Ta,Option:ze,LoadingIndicator:()=>(0,z.jsx)(z.Fragment,{}),LoadingMessage:qe,NoOptionsMessage:at,DropdownIndicator:Ve,ClearIndicator:Ne},closeMenuOnSelect:!0,hideSelectedOptions:!1,onChange:de}),(0,z.jsxs)("span",{className:(0,ht.default)("text-label text-sm left-2.5 cursor-pointer pointer-events-none absolute transition-all duration-200",{"scale-75 -translate-y-3":_.value||L,"ml-[35px]":Y.hasIcon,"ml-[2px]":!Y.hasIcon,"top-2.5":!(_.value||L),"top-0":_.value||L}),children:[a,D&&a&&(0,z.jsx)("strong",{className:"text-dangerous-700",children:"\xA0*"})]}),W.map((M,Ce)=>(0,z.jsx)("div",{style:{color:"var(--dangerous-700)"},className:"text-xs ml-[2px]",role:"alert","aria-label":M,children:M},Ce))]})}})},Ta=({children:e,...t})=>(0,z.jsx)(Pt.components.ValueContainer,{...t,children:e});var Ra=require("react-hook-form"),Be=require("react/jsx-runtime"),po=({disabled:e,control:t,name:a,label:i,defaultChecked:m})=>(0,Be.jsx)(Ra.Controller,{name:a,control:t,render:({field:s})=>(0,Be.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,Be.jsxs)("label",{className:"custom-radio flex items-center",children:[(0,Be.jsx)("input",{name:a,id:a,type:"radio",className:"",onClick:N=>{s.onChange(N.target.value)},defaultChecked:m,disabled:e}),(0,Be.jsx)("span",{})]}),i&&(0,Be.jsx)("label",{htmlFor:a,className:"text-p-md cursor-pointer -pt-1",children:i})]})});var It=require("@headlessui/react"),Sa=require("react-hook-form"),ie=require("react/jsx-runtime"),{Group:mo,Label:go}=It.Switch;function vt(...e){return e.filter(Boolean).join(" ")}var bo=({name:e,label:t,subLabel:a,control:i,disabled:m})=>(0,ie.jsxs)(mo,{as:"div",className:"flex items-center",children:[(0,ie.jsx)(Sa.Controller,{control:i,name:e,render:({field:s})=>(0,ie.jsx)(It.Switch,{disabled:m,...s,className:"h-[18px] w-[33px] focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 rounded-full",checked:!!s.value,onChange:N=>{s.onChange(N)},children:({checked:N})=>(0,ie.jsx)("div",{className:vt(N?"bg-blue-500":"bg-neutral-200","relative inline-flex h-[18px] p-[2px] w-[33px] flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out "),children:(0,ie.jsxs)("span",{className:vt("pointer-events-none relative inline-block -top-[2px] right-[2px] h-[14px] w-[14px] transform rounded-full shadow ring-0 transition duration-200 ease-in-out",N?"translate-x-[15px]":"translate-x-0",m?"bg-neutral-300":"bg-white"),children:[(0,ie.jsx)("span",{className:vt(N?"opacity-0 ease-out duration-100":"opacity-100 ease-in duration-200","absolute inset-0 flex h-full w-full items-center justify-center transition-opacity"),"aria-hidden":"true"}),(0,ie.jsx)("span",{className:vt(N?"opacity-100 ease-in duration-200":"opacity-0 ease-out duration-100","absolute inset-0 flex h-full w-full items-center justify-center transition-opacity"),"aria-hidden":"true"})]})})})}),t&&(0,ie.jsxs)(go,{as:"span",className:"flex flex-col gap-1 ml-2 cursor-pointer",children:[(0,ie.jsx)("span",{className:"text-sm text-paragraph",children:t}),a&&(0,ie.jsx)("span",{className:"text-sm",children:a})]})]});var ve=require("@headlessui/react"),be=require("react"),Ft=K(require("clsx"),1),$=require("react/jsx-runtime");function Mt({pageSizeOptions:e,table:t}){var v,P,F,b,n,R;let a=t==null?void 0:t.getPageCount(),i=a?[...Array(a)]:[],m=i==null?void 0:i.map((r,o)=>({id:o,name:o})),[s,N]=(0,be.useState)({id:((v=JSON.parse(sessionStorage.getItem("pageSize")))==null?void 0:v.id)||20,name:((P=JSON.parse(sessionStorage.getItem("pageSize")))==null?void 0:P.name)||20}),[d,T]=(0,be.useState)({id:((b=(F=t==null?void 0:t.getState())==null?void 0:F.pagination)==null?void 0:b.pageIndex)||0,name:((R=(n=t==null?void 0:t.getState())==null?void 0:n.pagination)==null?void 0:R.pageIndex)||0}),[D,x]=(0,be.useState)(()=>m),[E,h]=(0,be.useState)(e==null?void 0:e.map(r=>({id:r,name:r}))),[c,f]=(0,be.useState)(""),k=()=>{let r=[...m];x(r.filter(o=>(o.name+1).toString().startsWith(c)))},u=(r,o)=>{sessionStorage.setItem(r,JSON.stringify(o))};return(0,be.useEffect)(()=>{k()},[c]),(0,be.useEffect)(()=>{u("pageSize",s),t.setPageSize(s==null?void 0:s.id),t.setPageIndex(0),T({id:0,name:0})},[s]),(0,be.useEffect)(()=>{x(a?[...Array(a)].map((r,o)=>({id:o,name:o})):[])},[t==null?void 0:t.getPageCount()]),(0,be.useEffect)(()=>{var r,o,g,L,O,V;((o=(r=t==null?void 0:t.getState())==null?void 0:r.pagination)==null?void 0:o.pageIndex)>=0&&T({id:(L=(g=t==null?void 0:t.getState())==null?void 0:g.pagination)==null?void 0:L.pageIndex,name:(V=(O=t==null?void 0:t.getState())==null?void 0:O.pagination)==null?void 0:V.pageIndex})},[t==null?void 0:t.getState().pagination]),(0,$.jsxs)("div",{className:"hidden md:flex items-center gap-2",children:[(0,$.jsxs)("div",{className:"flex items-center gap-2 text-paragraph",children:[(0,$.jsx)("span",{children:"Exibir "}),(0,$.jsx)(ve.Combobox,{value:s,onChange:r=>{N(r)},children:({open:r})=>(0,$.jsxs)("div",{className:"relative",children:[(0,$.jsxs)(ve.Combobox.Button,{className:"flex items-center justify-between w-[70px] h-[42px] text-paragraph outline-none text-p-sm cursor-pointer peer relative shadow-input rounded-lg border p-2 disabled:bg-neutral-100 border-neutral-300",children:[s==null?void 0:s.name,r?(0,$.jsx)("i",{className:"uil uil-angle-up text-base top-[13px] pl-3 cursor-pointer text-label"}):(0,$.jsx)("i",{className:"uil uil-angle-down text-base top-[13px] pl-3 cursor-pointer text-label"})]}),(0,$.jsx)(ve.Combobox.Options,{className:"w-full outline-none max-h-[200px] overflow-auto border-[0.5px] mt-1 color-neutral-300 flex flex-col gap-y-2 p-1 absolute right-0 bottom-12 z-[999] rounded-lg bg-white",children:E==null?void 0:E.map(o=>{let g=(o==null?void 0:o.id)===(s==null?void 0:s.id);return(0,$.jsx)(ve.Combobox.Option,{value:o,className:(0,Ft.default)("p-2 rounded-lg items-center justify-center cursor-pointer flex whitespace-nowrap no-underline ",{"bg-blue-500 hover:bg-blue-500 hover:text-[#FFFFFF] text-[#FFFFFF]":g},{"hover:bg-neutral-100 text-paragraph":!g}),children:o.name},(s==null?void 0:s.id)+"size")})})]})}),(0,$.jsx)("span",{children:" resultados"})]}),(0,$.jsx)("div",{className:"bg-neutral-300 h-[20px] w-[1px]"}),(0,$.jsxs)("div",{className:"flex items-center gap-2 text-paragraph",children:[(0,$.jsx)("span",{children:"Ir para a p\xE1gina "}),(0,$.jsx)(ve.Combobox,{value:d,onChange:r=>{r&&(r!=null&&r.id)&&(T({id:r==null?void 0:r.id,name:r==null?void 0:r.id}),u("pageIndex",r==null?void 0:r.id),t.setPageIndex(r==null?void 0:r.id),f(""))},children:({open:r})=>(0,$.jsxs)("div",{className:"relative",children:[(0,$.jsxs)(ve.Combobox.Button,{className:"relative",children:[(0,$.jsx)(ve.Combobox.Input,{as:"input",onKeyDown:o=>{var L;let g=Number((L=o.target)==null?void 0:L.value);o.key=="Enter"&&g&&g<=a&&(T({id:g-1,name:g-1}),u("pageIndex",g),t.setPageIndex(g-1),f(""))},displayValue:o=>d?(d==null?void 0:d.id)+1:(o==null?void 0:o.id)+1,onChange:o=>{o.target.value&&f(o.target.value)},className:"h-[42px] w-[70px] outline-none text-p-md text-paragraph cursor-pointer border-neutral-300 peer shadow-input rounded-lg border block disabled:bg-neutral-100 p-2"}),r?(0,$.jsx)("i",{className:"uil uil-angle-up text-base absolute top-[10px] right-2 cursor-pointer text-label"}):(0,$.jsx)("i",{className:"uil uil-angle-down text-base absolute top-[10px] right-2 cursor-pointer text-label"})]}),(0,$.jsx)(ve.Combobox.Options,{className:"w-full outline-none max-h-[200px] overflow-auto border-[0.5px] mt-1 color-neutral-300 flex flex-col gap-y-2 p-1 absolute right-0 bottom-12 z-[999] rounded-lg bg-white",children:D.map(o=>{let g=(o==null?void 0:o.id)===(d==null?void 0:d.id);return(0,$.jsx)(ve.Combobox.Option,{value:o,className:(0,Ft.default)("p-2 rounded-lg items-center justify-center cursor-pointer flex whitespace-nowrap no-underline ",{"bg-blue-500 hover:bg-blue-500 hover:text-[#FFFFFF] text-[#FFFFFF]":g},{"hover:bg-neutral-100 text-paragraph":!g}),children:(o==null?void 0:o.name)+1},(d==null?void 0:d.id)+"page")})})]})})]})]})}var ae=require("@tanstack/react-table"),j=K(require("react"),1);var Ee=require("clsx"),ke=K(require("react"),1),Pe=require("react/jsx-runtime"),yt=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("table",{ref:a,className:(0,Ee.clsx)("table-scroll block text-left border-separate border-spacing-0 w-full",e),onScroll:t.onScroll,...t}));yt.displayName="Table";var wt=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("thead",{ref:a,className:(0,Ee.clsx)("w-full sticky top-0 z-[90]",e),...t}));wt.displayName="TableHeader";var Nt=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("tbody",{ref:a,className:(0,Ee.clsx)(e),...t}));Nt.displayName="TableBody";var Ct=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("div",{ref:a,className:(0,Ee.clsx)(" flex flex-col md:flex-row gap-2 md:gap-0 justify-between items-center py-4 px-6 bg-white w-full h-full border border-neutral-200 rounded-t-lg",e),...t}));Ct.displayName="TableFooter";var et=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("tr",{ref:a,className:(0,Ee.clsx)(e),...t}));et.displayName="TableRow";var Tt=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("th",{ref:a,className:(0,Ee.clsx)({"hover:bg-neutral-100":t.sortable},"text-p-md z-[50] bg-white font-normal text-neutral-700 p-4 text-left border-t border-b border-neutral-200 first:border-l last:border-r first:rounded-tl-lg first:rounded-bl-lg last:rounded-tr-lg last:rounded-br-lg",e),...t}));Tt.displayName="TableHead";var Rt=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("td",{ref:a,className:(0,Ee.clsx)("align-middle h-[80px] border-b border-neutral-200 whitespace-nowrap py-4 px-5",e),...t}));Rt.displayName="TableCell";var Da=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("caption",{ref:a,className:(0,Ee.clsx)("text-default mt-4 text-sm",e),...t}));Da.displayName="TableCaption";var Ea=require("react");var H=require("react/jsx-runtime");function Lt({table:e,footer:t=(0,H.jsx)("div",{}),totalData:a,selectAllOption:i,onSelectAll:m,rowsSelected:s,onRemoveAll:N,tableRef:d,paginationScroll:T,pageSizeOptions:D=[]}){var v,P,F,b,n;let x=(v=e==null?void 0:e.getState())==null?void 0:v.pagination.pageIndex,E=a,h=e==null?void 0:e.getPageCount(),c=((P=e==null?void 0:e.getState())==null?void 0:P.pagination.pageIndex)+2,f=((F=e==null?void 0:e.getState())==null?void 0:F.pagination.pageIndex)-2,k=h?[...Array(h)]:[],u=((n=(b=e==null?void 0:e.getRowModel())==null?void 0:b.rows)==null?void 0:n.length)||0;return(0,H.jsxs)("div",{className:"w-full flex flex-col sticky z-[90] bottom-0",children:[(0,H.jsx)("div",{className:"bg-none overflow-x-hidden md:overflow-x-auto overflow-y-hidden table-scroll rounded-lg relative top-[8px] -space-y-1 z-[302] h-[12px]",onScroll:R=>{d==null||d.current.scrollTo({left:R.currentTarget.scrollLeft})},children:(0,H.jsx)("div",{style:{width:T?T-2:0},children:"\xA0"})}),(0,H.jsxs)(Ct,{children:[(D==null?void 0:D.length)>0&&(0,H.jsx)(Mt,{table:e,pageSizeOptions:D}),(0,H.jsxs)("div",{className:"flex flex-col md:flex-row items-center justify-center md:justify-normal gap-2 md:gap-4",children:[t,i&&(0,H.jsx)("div",{children:s!==a?(0,H.jsx)("div",{className:"md:border-l border-gray-300 pl-4",children:(0,H.jsxs)(G,{size:"xxs",onClick:m,variant:"link",children:["Selecionar todos os ",a]})}):(0,H.jsx)("div",{className:"md:border-l border-gray-300 pl-4",children:(0,H.jsx)(G,{size:"xxs",onClick:N,variant:"link",children:"Desmarcar todos"})})})]}),(0,H.jsxs)("div",{className:"flex flex-col md:flex-row items-center md:justify-end justify-center gap-2 flex-1",children:[(0,H.jsxs)("span",{className:"text-p-md text-paragraph mr-1",children:["Mostrando ",u," de ",E," resultados"]}),(0,H.jsxs)("div",{className:"flex items-center gap-2",children:[(0,H.jsx)(G,{onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),variant:"icon",icon:(0,H.jsx)("i",{className:"uil uil-angle-left text-base"}),size:"xs",className:"justify-center"}),f>=1&&(0,H.jsxs)("div",{className:"flex gap-2",children:[(0,H.jsx)(G,{onClick:()=>e.setPageIndex(0),variant:"icon",icon:(0,H.jsx)("div",{style:{fontSize:"12px",color:"#393C4D"},children:1}),size:"xs",className:"justify-center"}),f!==1&&(0,H.jsx)(G,{disabled:!0,variant:"icon",icon:(0,H.jsx)(H.Fragment,{children:"..."}),size:"xs",className:"justify-center"})]}),k.map((R,r)=>{let o=r<=c&&r>=f,g=r===x;return(0,H.jsx)(Ea.Fragment,{children:o&&(0,H.jsx)(G,{onClick:()=>e.setPageIndex(r),className:"font-normal text-xs justify-center",variant:g?"blue":"icon",size:"xs",icon:(0,H.jsx)("div",{style:{fontSize:"12px",color:g?"#FFF":"#393C4D"},children:(r+1).toLocaleString("pt-BR")})})},r+"pagination")}),c+1<h&&(0,H.jsxs)("div",{className:"flex gap-2",children:[c!==k.length-2&&(0,H.jsx)(G,{disabled:!0,variant:"icon",icon:(0,H.jsx)(H.Fragment,{children:"..."}),size:"xs",className:"justify-center"}),(0,H.jsx)(G,{onClick:()=>e.setPageIndex(h),variant:"icon",icon:(0,H.jsx)("div",{style:{fontSize:"12px",color:"#393C4D"},children:h.toLocaleString("pt-BR")}),size:"xs",className:"font-normal justify-center"})]}),(0,H.jsx)(G,{onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),variant:"icon",icon:(0,H.jsx)("i",{className:"uil uil-angle-right text-base"}),size:"xs",className:"justify-center"})]})]})]})]})}var Ke=K(require("clsx"),1),ka=require("@tanstack/match-sorter-utils");var B=require("react/jsx-runtime"),xo=(e,t,a,i)=>{let m=(0,ka.rankItem)(e.getValue(t),a);return i({itemRank:m}),m.passed};function Ht({columns:e,tableClass:t="",data:a=[],hidePagination:i,emptyButtonAction:m,hideBlankState:s,renderSubComponent:N=()=>{},footer:d,borderFull:T=!1,withShadow:D=!0,actionsSelection:x,backgroundColor:E,emptyState:h,totalData:c=0,showFilter:f,placeholder:k,fetchData:u,openedSubComponent:v=!1,getRowCanExpand:P,enableRowSelection:F,onScroll:b,tableContainerRef:n,setRows:R,selectAllOption:r,autoPagination:o,rowClassName:g,listUpdate:L,setRowSelection:O,rowSelection:V,perPage:p,pageSizeOptions:A,onFinishFetch:U}){var Ot,zt,Vt,Jt,jt,Xt;let Z=(0,j.useRef)(null),[l,X]=(0,j.useState)({}),[ye,we]=(0,j.useState)([]),[xe,W]=(0,j.useState)([]),[ne,fe]=(0,j.useState)([]),[tt,Ge]=(0,j.useState)(""),[Y,Oe]=(0,j.useState)([]),[_,Ie]=(0,j.useState)(!0),[ze,qe]=(0,j.useState)({}),[at,Ve]=(0,j.useState)(()=>c),[{pageIndex:Ne,pageSize:de},Je]=(0,j.useState)({pageIndex:0,pageSize:i?999999:p||20}),[M,Ce]=(0,j.useState)(),Te=(0,j.useMemo)(()=>({pageIndex:Ne,pageSize:de}),[Ne,de]),Pa=()=>{var I,J;u&&!o?u({pageSize:de,pageIndex:Ne,order:(I=xe[0])==null?void 0:I.id,orderDir:(J=xe[0])!=null&&J.desc?"DESC":"ASC"}).then(S=>{Oe(S.rows),!(S!=null&&S.rows)&&c>0&&Je({pageIndex:Ne-1,pageSize:de})}):Ia(Ne,de).then(S=>{Oe(S.rows),!(S!=null&&S.rows)&&c>0&&Je({pageIndex:Ne-1,pageSize:de})}),setTimeout(()=>{U&&U()},1e3)},Ia=async(I,J)=>({rows:(await new Promise((ee,St)=>{let _e=[],Fe,Wt;for(Fe=0,Wt=c;Fe<Wt;Fe+=J)_e.push(a==null?void 0:a.slice(Fe,Fe+J));ee(_e)}))[I],pageCount:Number(J)});(0,j.useEffect)(()=>{if(!(n!=null&&n.current))return;let I=new ResizeObserver(()=>{var J;Ce((J=n==null?void 0:n.current)==null?void 0:J.scrollWidth)});return I.observe(n==null?void 0:n.current),()=>I.disconnect()},[]),(0,j.useEffect)(()=>{(u||o)&&Pa()},[Ne,de,xe]),(0,j.useEffect)(()=>{c!==at&&(Je({pageIndex:0,pageSize:Te.pageSize}),Ve(c))},[c]),(0,j.useEffect)(()=>{a&&(Oe(()=>o?a.slice(0,de):a),Ie(!1))},[a]);let Fa=c<Te.pageSize?1:Math.ceil(c/Te.pageSize),oe=(0,ae.useReactTable)({data:(Y==null?void 0:Y.length)>0?Y:[],columns:e,state:{sorting:xe,columnVisibility:l,rowSelection:V,globalFilter:tt,columnFilters:ye,pagination:Te,expanded:ze},pageCount:Fa,manualPagination:!0,enableRowSelection:F,onRowSelectionChange:O,onSortingChange:W,onColumnFiltersChange:we,onColumnVisibilityChange:X,onGlobalFilterChange:Ge,globalFilterFn:xo,getCoreRowModel:(0,ae.getCoreRowModel)(),getFilteredRowModel:(0,ae.getFilteredRowModel)(),getFacetedRowModel:(0,ae.getFacetedRowModel)(),getFacetedUniqueValues:(0,ae.getFacetedUniqueValues)(),onPaginationChange:Je,getRowCanExpand:P,onExpandedChange:qe,getExpandedRowModel:(0,ae.getExpandedRowModel)(),enableExpanding:!0,getRowId:I=>I.id,meta:{getRowStyles:g}});(0,j.useEffect)(()=>{F&&V&&fe(Object.keys(V))},[V,F]);let Ma=()=>{oe.toggleAllRowsSelected(!0);let I=a==null?void 0:a.map(S=>S==null?void 0:S.id),J={};I==null||I.forEach(S=>{J={...J,[S]:!0}}),O(J)},La=()=>{oe.toggleAllRowsSelected(),O({})},Bt=Y&&(Y==null?void 0:Y.length)==0&&!_&&!s||!Y||((zt=(Ot=oe==null?void 0:oe.getRowModel())==null?void 0:Ot.rows)==null?void 0:zt.length)==0,Ha=!i&&c>0&&oe;function Ba(){var I;if(Bt&&c!==null)return h||(0,B.jsx)("div",{});if(Ha&&c!==null)return(0,B.jsx)(Lt,{table:oe,footer:d,totalData:c,tableRef:n,selectAllOption:r,onSelectAll:Ma,rowsSelected:(I=Object.keys(V||{}))==null?void 0:I.length,onRemoveAll:La,paginationScroll:M,pageSizeOptions:A});if(c==null)return(0,B.jsx)(B.Fragment,{})}(0,j.useEffect)(()=>{if(V&&Object.keys(V).length==0){let I=document.getElementsByClassName("th-shadow");Object.keys(I).forEach(J=>{var S,re;(re=(S=I[J])==null?void 0:S.classList)==null||re.add("with-shadow")})}else if(V&&Object.keys(V).length==1){let I=document.getElementsByClassName("th-shadow");Object.keys(I).forEach(J=>{var S,re;(re=(S=I[J])==null?void 0:S.classList)==null||re.remove("with-shadow")})}},[V]);let At=I=>{var S,re;let J=oe;return g?(re=(S=J==null?void 0:J.options)==null?void 0:S.meta)==null?void 0:re.getRowStyles(I):{}};return(0,B.jsxs)("div",{className:"w-full h-full flex flex-col",children:[f&&(0,B.jsxs)("div",{className:"w-full flex justify-between md:items-center flex-col md:flex-row gap-y-2 md:gap-y-0",children:[(0,B.jsx)("div",{className:"w-full md:max-w-[350px]",id:"filter-table",children:(0,B.jsx)(Ze,{onChange:I=>Ge(I.target.value),name:"filter",value:tt,icon:(0,B.jsx)("i",{className:"uil uil-search"}),placeholder:"Buscar pedido por ID, C\xF3digo ou Cliente",clearField:!0,onClear:()=>Ge("")})}),L]}),(0,B.jsxs)("div",{className:(0,Ke.default)("w-full flex mt-4 flex-col justify-between",{"flex-1":!Bt,[t]:t}),children:[(0,B.jsxs)(yt,{className:(0,Ke.default)("w-full table_container z-20 overflow-x-scroll md:overflow-x-hidden"),onScroll:b,ref:n,children:[V&&((Vt=Object.keys(V))==null?void 0:Vt.length)>0&&x&&(Y==null?void 0:Y.length)>0&&(0,B.jsxs)("div",{className:"h-[76px] flex items-center justify-between px-4 bg-gradient-to-b from-blue-start to-blue-end rounded-lg -mb-[1px]",children:[(0,B.jsxs)("div",{className:"flex gap-6",children:[(0,B.jsxs)("span",{className:"text-white text-p-lg",children:[Object.keys(V).length," selecionado(s)"]}),x]}),(0,B.jsx)("button",{title:"set-row",onClick:()=>O({}),children:(0,B.jsx)("i",{className:"uil uil-times text-white"})})]}),(0,B.jsxs)("div",{className:"table w-full mr-[2px]",ref:Z,children:[(0,B.jsx)(wt,{children:(Jt=oe==null?void 0:oe.getHeaderGroups())==null?void 0:Jt.map((I,J)=>(0,B.jsx)(et,{children:I.headers.map((S,re)=>{var St,_e,Fe;let ee=S.column.columnDef.meta;return(0,B.jsx)(Tt,{style:{width:S.getSize()},scope:"col",className:(0,Ke.default)({"hover:bg-neutral-100 th-shadow cursor-pointer":S.column.getCanSort(),"with-shadow":(ne==null?void 0:ne.length)==0&&D},ee==null?void 0:ee.header,ee==null?void 0:ee.className),children:(0,B.jsxs)("div",{onClick:S.column.getToggleSortingHandler(),children:[S.isPlaceholder?null:(0,ae.flexRender)(S.column.columnDef.header,S.getContext()),((St=xe[0])==null?void 0:St.id)==S.column.id?(0,B.jsx)("i",{className:(0,Ke.default)({"rotate-0":!((_e=xe[0])!=null&&_e.desc),"rotate-180":(Fe=xe[0])==null?void 0:Fe.desc},"uil uil-arrow-down text-blue-500 transform ml-1 text-[18px] duration-75")}):(0,B.jsx)(B.Fragment,{})]})},J+re+"th")})},I.id+J+"header"))}),(0,B.jsx)(Nt,{children:(Xt=(jt=oe==null?void 0:oe.getRowModel())==null?void 0:jt.rows)==null?void 0:Xt.map((I,J)=>(0,B.jsx)(j.default.Fragment,{children:!I.original._destroy&&(0,B.jsxs)(j.default.Fragment,{children:[(0,B.jsx)(et,{id:I.id,className:"text-p-md font-normal h-[80px] text-paragraph w-fit",style:At(I),children:I.getVisibleCells().map((S,re)=>{let ee=S.column.columnDef.meta;return(0,B.jsx)(Rt,{id:S.id,style:{width:S.column.getSize(),backgroundColor:E||"",...At(I)},className:(0,Ke.default)({hidden:S.row.original._destroy,"first:border-l last:border-r":T,"first:rounded-bl-lg last:rounded-br-lg":T&&I.index===(a==null?void 0:a.length)-1},ee==null?void 0:ee.cell,ee==null?void 0:ee.className),children:(0,ae.flexRender)(S.column.columnDef.cell,S.getContext())},S.id)})},I.id),(I.getIsExpanded()||v)&&(0,B.jsx)("tr",{children:(0,B.jsx)("td",{colSpan:I.getVisibleCells().length,children:N({row:I})})})]})},J+"row"))})]})]}),Ba()]})]})}0&&(module.exports={Badge,Button,Calendar,Checkbox,DataTable,DataTablePagination,DatePickerInput,FilterCalendar,FilterOptions,Input,InputMoney,InputNumber,InputPercentage,Logo,MaskedInput,ModalDialog,PaginationSelect,Popover,Radio,RocketIcon,SelectField,SpinnerIcon,Table,TableBody,TableCaption,TableCell,TableFooter,TableHead,TableHeader,TableRow,Toggle,ValueContainer});
|
|
15
15
|
//# sourceMappingURL=index.cjs.map
|