@iclips/ui 1.2.22 → 1.2.23
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 +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -218,7 +218,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
218
218
|
</div>
|
|
219
219
|
</body>
|
|
220
220
|
</html>
|
|
221
|
-
`),p.document.close(),p.onload=()=>{setTimeout(()=>{p.print(),p.close(),a==null||a()},250)}}catch(u){i==null||i(u),console.error("Erro ao imprimir contrato:",u)}},downloadPDF:()=>{try{s==null||s(),setTimeout(()=>{console.log("PDF gerado (simulado):",{contractNumber:e,timestamp:new Date().toISOString()}),o==null||o()},1500),console.info("usePrintContract: downloadPDF é uma implementação simulada. Para gerar PDFs reais, integre com html2pdf.js ou jsPDF. Veja a documentação do hook para exemplos.")}catch(u){f==null||f(u),console.error("Erro ao gerar PDF:",u)}}}}function QI({data:t,logo:e,showActions:n=!0,showSummary:r=!0,showServices:a=!0,showInfo:i=!1,className:s,onPrintStart:o,onPrintSuccess:f,onPrintError:c,onDownloadStart:d,onDownloadSuccess:u,onDownloadError:p}){const h=I.useRef(null),{printContract:m,downloadPDF:g}=j2(h,t.numeroContrato,{onPrintStart:o,onPrintSuccess:f,onPrintError:c,onDownloadStart:d,onDownloadSuccess:u,onDownloadError:p}),b=x=>new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(x);return l.jsxs("div",{className:w("space-y-6",s),children:[n&&l.jsxs(jr,{className:"no-print",children:[l.jsx(la,{children:l.jsxs(fa,{className:"flex items-center justify-between",children:[l.jsx("span",{children:"Ações do Documento"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(F,{variant:"outline",size:"sm",onClick:g,className:"gap-2",children:[l.jsx(k.Download,{className:"h-4 w-4"}),"Download PDF"]}),l.jsxs(F,{variant:"default",size:"sm",onClick:m,className:"gap-2",children:[l.jsx(k.Printer,{className:"h-4 w-4"}),"Imprimir"]})]})]})}),r&&l.jsx(ca,{children:l.jsxs("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-muted-foreground mb-1",children:"Nº do Contrato"}),l.jsx("p",{className:"font-semibold",children:t.numeroContrato})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-muted-foreground mb-1",children:"Cliente"}),l.jsx("p",{className:"font-semibold",children:t.cliente.nome})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-muted-foreground mb-1",children:"Valor do Fee"}),l.jsx("p",{className:"font-semibold",children:b(t.valorFee)})]})]})})]}),l.jsx("div",{className:"bg-white rounded-lg shadow-sm p-8",children:l.jsx("div",{ref:h,children:l.jsx(nu,{data:t,showPreview:!0,logo:e,showServices:a})})}),i&&l.jsxs(jr,{className:"no-print",children:[l.jsx(la,{children:l.jsxs(fa,{className:"flex items-center gap-2",children:[l.jsx(k.Eye,{className:"h-5 w-5"}),"Sobre este Template"]})}),l.jsx(ca,{children:l.jsxs("div",{className:"space-y-2 text-sm text-muted-foreground",children:[l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Design System:"})," Utiliza a paleta de cores e tipografia do iClips"]}),l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Impressão Otimizada:"})," Layout preparado para impressão em A4"]}),l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Componentes Reutilizáveis:"})," PrintHeader, PrintFooter, PrintTable, PrintSignature"]}),l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Quebras de Página:"})," Configuradas automaticamente para evitar cortes"]}),l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Profissional:"})," Layout clean e adequado para documentos legais"]})]})})]})]})}const C2=I.forwardRef(({data:t,logo:e,showServices:n=!0,className:r},a)=>l.jsx("div",{className:w("bg-white rounded-lg shadow-sm p-8",r),ref:a,children:l.jsx(nu,{data:t,showPreview:!0,logo:e,showServices:n})}));C2.displayName="ContractPrintPreview";const Go=I.forwardRef(({className:t,inputClassName:e,containerClassName:n,style:r,value:a,defaultValue:i=0,onChange:s,min:o=Number.MIN_SAFE_INTEGER,max:f=Number.MAX_SAFE_INTEGER,step:c=1,precision:d=0,formatOptions:u,locale:p="pt-BR",allowMouseWheel:h=!1,clampValueOnBlur:m=!0,keepWithinRange:g=!0,showButtons:b=!0,buttonLayout:x="vertical",buttonPosition:v="right",disabled:j,readOnly:y,...L},C)=>{const[N,S]=I.useState(i),[T,z]=I.useState(""),[P,U]=I.useState(!1),J=I.useRef(null),Y=a!==void 0?a:N,K=I.useCallback(B=>u?new Intl.NumberFormat(p,u).format(B):B.toFixed(d),[u,p,d]),E=B=>{const he=B.replace(/[^\d,.-]/g,"").replace(",","."),Oe=parseFloat(he);return isNaN(Oe)?0:Oe},G=B=>g?Math.min(Math.max(B,o),f):B,Z=I.useCallback((B,ee=!1)=>{const he=ee?G(B):B;a===void 0&&S(he),s&&s(he)},[a,s,o,f,g]);I.useEffect(()=>{P||z(K(Y))},[Y,K,P]);const le=()=>{if(j||y)return;const B=Y+c;B<=f&&Z(B)},we=()=>{if(j||y)return;const B=Y-c;B>=o&&Z(B)},Ie=B=>{const he=B.target.value.replace(/[^\d,.-]/g,"");z(he);const Oe=E(he);Z(Oe,!1)},Le=B=>{if(U(!1),m){const ee=G(Y);Z(ee,!1),z(K(ee))}else z(K(Y));L.onBlur&&L.onBlur(B)},V=B=>{U(!0),z(Y.toString()),B.target.select(),L.onFocus&&L.onFocus(B)},q=B=>{j||y||(B.key==="ArrowUp"?(B.preventDefault(),le()):B.key==="ArrowDown"&&(B.preventDefault(),we()),L.onKeyDown&&L.onKeyDown(B))},re=B=>{!h||j||y||!P||(B.preventDefault(),B.deltaY<0?le():B.deltaY>0&&we())};I.useImperativeHandle(C,()=>J.current);const A=()=>{if(!b)return null;const B=l.jsx("button",{type:"button",onClick:le,disabled:j||y||Y>=f,tabIndex:-1,"aria-label":"Increment",className:w("inline-flex items-center justify-center transition-colors","hover:bg-muted active:bg-accent","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",x==="vertical"&&"h-4 w-7 rounded-sm",x==="horizontal"&&"h-9 w-9 rounded-l-md border-r border-input bg-input-background"),children:x==="vertical"?l.jsx(k.ChevronUp,{className:"h-3 w-3"}):l.jsx(k.Plus,{className:"h-4 w-4"})},"inc"),ee=l.jsx("button",{type:"button",onClick:we,disabled:j||y||Y<=o,tabIndex:-1,"aria-label":"Decrement",className:w("inline-flex items-center justify-center transition-colors","hover:bg-muted active:bg-accent","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",x==="vertical"&&"h-4 w-7 rounded-sm",x==="horizontal"&&"h-9 w-9 rounded-r-md border-l border-input bg-input-background"),children:x==="vertical"?l.jsx(k.ChevronDown,{className:"h-3 w-3"}):l.jsx(k.Minus,{className:"h-4 w-4"})},"dec");if(x==="vertical")return l.jsxs("div",{className:w("flex flex-col items-center justify-center gap-[2px] self-stretch px-1 shrink-0 overflow-hidden",v==="right"?"order-2 border-l border-input rounded-r-md":"order-[-1] border-r border-input rounded-l-md"),children:[B,ee]});if(x==="horizontal")return[ee,B]};return x==="horizontal"&&b?l.jsxs("div",{className:w("inline-flex items-center w-full",n),style:r,children:[A(),l.jsx("input",{ref:J,type:"text",inputMode:"decimal","data-slot":"input",className:w("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 border-y px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","text-center tabular-nums",t),value:T,onChange:Ie,onBlur:Le,onFocus:V,onKeyDown:q,onWheel:re,disabled:j,readOnly:y,"aria-valuemin":o,"aria-valuemax":f,"aria-valuenow":Y,role:"spinbutton",...L})]}):l.jsxs("div",{className:w("inline-flex w-full items-stretch",n),style:r,children:[l.jsx("input",{ref:J,type:"text",inputMode:"decimal","data-slot":"input",className:w("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","tabular-nums",b&&x==="vertical"&&v==="right"&&"text-right rounded-r-none border-r-0",b&&x==="vertical"&&v==="left"&&"text-left rounded-l-none border-l-0",!b&&"text-right",e,t),value:T,onChange:Ie,onBlur:Le,onFocus:V,onKeyDown:q,onWheel:re,disabled:j,readOnly:y,"aria-valuemin":o,"aria-valuemax":f,"aria-valuenow":Y,role:"spinbutton",...L}),A()]})});Go.displayName="NumberInput";function ru({className:t,...e}){return l.jsx("textarea",{"data-slot":"textarea",className:w("resize-none border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-input-background px-3 py-2 text-base transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...e})}function L2({className:t,...e}){return l.jsx("div",{"data-slot":"input-group",role:"group",className:w("group/input-group cn-input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",t),...e})}const WI=$t.cva("cn-input-group-addon flex cursor-text items-center justify-center select-none",{variants:{align:{"inline-start":"cn-input-group-addon-align-inline-start order-first","inline-end":"cn-input-group-addon-align-inline-end order-last","block-start":"cn-input-group-addon-align-block-start order-first w-full justify-start","block-end":"cn-input-group-addon-align-block-end order-last w-full justify-start"}},defaultVariants:{align:"inline-start"}});function bc({className:t,align:e="inline-start",...n}){return l.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":e,className:w(WI({align:e}),t),onClick:r=>{var a,i;r.target.closest("button")||(i=(a=r.currentTarget.parentElement)==null?void 0:a.querySelector("input"))==null||i.focus()},...n})}const $I=$t.cva("flex items-center gap-2 text-sm shadow-none",{variants:{size:{default:"h-7",sm:"h-6",xs:"h-5","icon-xs":"size-5"}},defaultVariants:{size:"default"}});function ZI({className:t,size:e,variant:n="ghost",type:r="button",...a}){return l.jsx(F,{"data-slot":"input-group-button",type:r,variant:n,className:w($I({size:e}),t),...a})}function qI({className:t,...e}){return l.jsx("span",{"data-slot":"input-group-text",className:w("text-muted-foreground text-sm",t),...e})}function KI({className:t,...e}){return l.jsx(Ht,{"data-slot":"input-group-control",className:w("cn-input-group-input flex-1",t),...e})}function XI({className:t,...e}){return l.jsx(ru,{"data-slot":"input-group-control",className:w("cn-input-group-textarea flex-1 resize-none",t),...e})}const eD={BRL:{symbol:"R$",icon:k.Coins,locale:"pt-BR"},USD:{symbol:"$",icon:k.DollarSign,locale:"en-US"},EUR:{symbol:"€",icon:k.Euro,locale:"de-DE"}},N2=I.forwardRef(({className:t,currency:e="BRL",locale:n,showSymbol:r=!1,symbolPosition:a="start",min:i=0,...s},o)=>{const f=eD[e],c=n||f.locale,d=f.icon;return r?l.jsxs(L2,{className:t,children:[a==="start"&&l.jsx(bc,{children:l.jsx(d,{className:"h-4 w-4 text-muted-foreground"})}),l.jsx(Go,{ref:o,className:w("border-none shadow-none ring-0 focus-visible:ring-0 focus-visible:border-transparent",a==="start"?"pl-2":"pr-2"),min:i,precision:2,formatOptions:{style:"currency",currency:e,minimumFractionDigits:2,maximumFractionDigits:2},locale:c,...s}),a==="end"&&l.jsx(bc,{align:"inline-end",children:l.jsx(d,{className:"h-4 w-4 text-muted-foreground"})})]}):l.jsx(Go,{ref:o,className:t,min:i,precision:2,formatOptions:{style:"currency",currency:e,minimumFractionDigits:2,maximumFractionDigits:2},locale:c,...s})});N2.displayName="CurrencyInput";const tD=()=>{const t=new Date;return t.setHours(0,0,0,0),[{label:"Hoje",value:{from:t,to:t}},{label:"Últimos 7 dias",value:{from:H.subDays(t,6),to:t}},{label:"Últimos 30 dias",value:{from:H.subDays(t,29),to:t}},{label:"Este mês",value:{from:H.startOfMonth(t),to:t}},{label:"Mês passado",value:{from:H.startOfMonth(H.subMonths(t,1)),to:H.endOfMonth(H.subMonths(t,1))}}]};function k2({value:t,onChange:e,placeholder:n="Selecione um período",disabled:r=!1,minDate:a,maxDate:i,dateFormat:s="dd/MM/yyyy",locale:o=yt,className:f,error:c=!1,numberOfMonths:d=2,showTime:u=!1,timeFormat:p="24h",minuteStep:h=15,presets:m,showDefaultPresets:g=!0,id:b,name:x}){const[v,j]=I.useState(!1),[y,L]=I.useState(""),[C,N]=I.useState(!1),S=u?`${s} HH:mm`:s,T=I.useMemo(()=>u?["dd/MM/yyyy HH:mm","dd/MM/yy HH:mm","d/M/yyyy HH:mm","d/M/yy HH:mm"]:["dd/MM/yyyy","dd/MM/yy","d/M/yyyy","d/M/yy"],[u]);I.useEffect(()=>{if(t!=null&&t.from){const V=H.format(t.from,S,{locale:o}),q=t.to?H.format(t.to,S,{locale:o}):"";L(q?`${V} → ${q}`:V),N(!1)}else L(""),N(!1)},[t,S,o]);const z=I.useMemo(()=>[...g?tD():[],...m||[]],[m,g]),P=I.useMemo(()=>{if(!(t!=null&&t.from))return"00:00";const V=t.from.getHours().toString().padStart(2,"0"),q=t.from.getMinutes().toString().padStart(2,"0");return`${V}:${q}`},[t==null?void 0:t.from]),U=I.useMemo(()=>{if(!(t!=null&&t.to))return"23:59";const V=t.to.getHours().toString().padStart(2,"0"),q=t.to.getMinutes().toString().padStart(2,"0");return`${V}:${q}`},[t==null?void 0:t.to]),J=V=>{if(!V){e==null||e(void 0);return}if(u){if(V.from){const[q,re]=P.split(":").map(Number);V.from.setHours(q,re,0,0)}if(V.to){const[q,re]=U.split(":").map(Number);V.to.setHours(q,re,0,0)}}else V.from&&V.from.setHours(0,0,0,0),V.to&&V.to.setHours(23,59,59,999);e==null||e(V)},Y=V=>{if(!(t!=null&&t.from))return;const q=new Date(t.from),[re,A]=V.split(":").map(Number);q.setHours(re,A,0,0),e==null||e({...t,from:q})},K=V=>{if(!(t!=null&&t.to))return;const q=new Date(t.to),[re,A]=V.split(":").map(Number);q.setHours(re,A,0,0),e==null||e({...t,to:q})},E=V=>{const q={from:new Date(V.value.from),to:new Date(V.value.to)};if(u){const[re,A]=P.split(":").map(Number),[B,ee]=U.split(":").map(Number);q.from.setHours(re,A,0,0),q.to.setHours(B,ee,0,0)}e==null||e(q)},G=V=>{const q=V.trim();if(!q)return null;for(const re of T)try{const A=H.parse(q,re,new Date);if(H.isValid(A)){if(a&&A<a||i&&A>i)continue;return A}}catch{continue}return null},Z=V=>{const q=V.trim();if(!q)return null;const re=["→","-","até","a"];let A=null,B=null;for(const ee of re)if(q.includes(ee)){const he=q.split(ee).map(Oe=>Oe.trim());if(he.length===2&&(A=G(he[0]),B=G(he[1]),A&&B))break}return A||(A=G(q),A&&(B=new Date(A))),!A||!B?null:(A>B&&([A,B]=[B,A]),{from:A,to:B})},le=V=>{const q=V.target.value;L(q),N(!1)},we=()=>{if(!y.trim()){e==null||e(void 0),N(!1);return}const V=Z(y);V?(e==null||e(V),N(!1)):N(!0)},Ie=V=>{if(V.key==="Enter")V.preventDefault(),we(),C||j(!0);else if(V.key==="Escape"){if(V.preventDefault(),t!=null&&t.from){const q=H.format(t.from,S,{locale:o}),re=t.to?H.format(t.to,S,{locale:o}):"";L(re?`${q} → ${re}`:q)}else L("");N(!1)}},Le=V=>{V.stopPropagation(),e==null||e(void 0),L(""),N(!1)};return l.jsxs(st,{open:v,onOpenChange:j,children:[l.jsx($e,{asChild:!0,children:l.jsxs("div",{className:"relative w-full",children:[l.jsx(Ht,{id:b,name:x,value:y,onChange:le,onBlur:we,onKeyDown:Ie,placeholder:n,disabled:r,"aria-invalid":c||C,className:w("pr-20",(c||C)&&"border-destructive focus-visible:ring-destructive/20",f)}),l.jsxs("div",{className:"absolute inset-y-0 right-0 flex items-center gap-1 pr-1",children:[y&&!r&&l.jsxs(F,{type:"button",variant:"ghost",size:"sm",className:"h-7 w-7 p-0 hover:bg-transparent",onClick:Le,tabIndex:-1,children:[l.jsx(k.X,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),l.jsx("span",{className:"sr-only",children:"Limpar"})]}),l.jsxs(F,{type:"button",variant:"ghost",size:"sm",className:"h-7 w-7 p-0 hover:bg-transparent",disabled:r,onClick:()=>j(!0),tabIndex:-1,children:[l.jsx(k.CalendarIcon,{className:"h-4 w-4 text-muted-foreground"}),l.jsx("span",{className:"sr-only",children:"Abrir calendário"})]})]})]})}),l.jsx(Ze,{className:"w-auto p-0",align:"start",children:l.jsxs("div",{className:"flex",children:[z.length>0&&l.jsxs("div",{className:"border-r p-3 space-y-1 min-w-[140px]",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Atalhos"}),z.map(V=>l.jsx(F,{variant:"ghost",size:"sm",className:"w-full justify-start text-sm h-8",onClick:()=>E(V),children:V.label},V.label))]}),l.jsxs("div",{children:[l.jsx(Qo,{mode:"range",selected:t,onSelect:J,numberOfMonths:d,disabled:V=>!!(a&&V<a||i&&V>i),locale:o,autoFocus:!0}),u&&(t==null?void 0:t.from)&&(t==null?void 0:t.to)&&l.jsxs("div",{className:"border-t p-3 flex gap-6",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Hora início"}),l.jsx(mi,{value:P,onChange:Y,format:p,minuteStep:h,variant:"select",showIcon:!1})]}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Hora fim"}),l.jsx(mi,{value:U,onChange:K,format:p,minuteStep:h,variant:"select",showIcon:!1})]})]}),l.jsxs("div",{className:"border-t p-3 flex justify-end gap-2",children:[l.jsx(F,{variant:"outline",size:"sm",onClick:()=>{e==null||e(void 0)},children:"Limpar"}),l.jsx(F,{size:"sm",onClick:()=>j(!1),children:"Confirmar"})]})]})]})})]})}k2.displayName="DateRangePicker";var nD=bN,rD=Se.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).some(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).some(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),aD=rD;const au=$t.cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function S2({className:t,variant:e,size:n,...r}){return l.jsx(Ax.Root,{"data-slot":"toggle",className:w(au({variant:e,size:n,className:t})),...r})}const tt=({onClick:t,isActive:e=!1,disabled:n=!1,children:r,title:a})=>l.jsx(S2,{pressed:e,onPressedChange:t,disabled:n,size:"sm",className:"h-8 w-8 p-0",title:a,children:r}),iD=({editor:t,variant:e})=>{if(!t)return null;const n=()=>{const a=t.getAttributes("link").href,i=window.prompt("URL",a);if(i!==null){if(i===""){t.chain().focus().extendMarkRange("link").unsetLink().run();return}t.chain().focus().extendMarkRange("link").setLink({href:i}).run()}},r=()=>{const a=window.prompt("URL da imagem");a&&t.chain().focus().setImage({src:a}).run()};return l.jsxs("div",{className:w("flex flex-wrap items-center gap-1 p-2 border-b bg-muted/30 sticky top-0 z-10",e==="full"?"px-4 py-2":"px-2 py-1"),children:[l.jsxs("div",{className:"flex items-center gap-0.5 mr-2",children:[l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>t.chain().focus().undo().run(),disabled:!t.can().undo(),children:l.jsx(k.Undo,{className:"h-4 w-4"})}),l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>t.chain().focus().redo().run(),disabled:!t.can().redo(),children:l.jsx(k.Redo,{className:"h-4 w-4"})})]}),l.jsx(Hn,{orientation:"vertical",className:"h-6 mx-1"}),e==="full"&&l.jsxs(l.Fragment,{children:[l.jsx(tt,{onClick:()=>t.chain().focus().toggleHeading({level:1}).run(),isActive:t.isActive("heading",{level:1}),title:"Título 1",children:l.jsx(k.Heading1,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleHeading({level:2}).run(),isActive:t.isActive("heading",{level:2}),title:"Título 2",children:l.jsx(k.Heading2,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleHeading({level:3}).run(),isActive:t.isActive("heading",{level:3}),title:"Título 3",children:l.jsx(k.Heading3,{className:"h-4 w-4"})}),l.jsx(Hn,{orientation:"vertical",className:"h-6 mx-1"})]}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleBold().run(),isActive:t.isActive("bold"),title:"Negrito",children:l.jsx(k.Bold,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleItalic().run(),isActive:t.isActive("italic"),title:"Itálico",children:l.jsx(k.Italic,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleUnderline().run(),isActive:t.isActive("underline"),title:"Sublinhado",children:l.jsx(k.Underline,{className:"h-4 w-4"})}),e==="full"&&l.jsx(tt,{onClick:()=>t.chain().focus().toggleStrike().run(),isActive:t.isActive("strike"),title:"Tachado",children:l.jsx(k.Strikethrough,{className:"h-4 w-4"})}),l.jsx(Hn,{orientation:"vertical",className:"h-6 mx-1"}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleBulletList().run(),isActive:t.isActive("bulletList"),title:"Lista com marcadores",children:l.jsx(k.List,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleOrderedList().run(),isActive:t.isActive("orderedList"),title:"Lista numerada",children:l.jsx(k.ListOrdered,{className:"h-4 w-4"})}),e==="full"&&l.jsxs(l.Fragment,{children:[l.jsx(tt,{onClick:()=>t.chain().focus().setTextAlign("left").run(),isActive:t.isActive({textAlign:"left"}),title:"Alinhar à esquerda",children:l.jsx(k.AlignLeft,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().setTextAlign("center").run(),isActive:t.isActive({textAlign:"center"}),title:"Centralizar",children:l.jsx(k.AlignCenter,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().setTextAlign("right").run(),isActive:t.isActive({textAlign:"right"}),title:"Alinhar à direita",children:l.jsx(k.AlignRight,{className:"h-4 w-4"})})]}),l.jsx(Hn,{orientation:"vertical",className:"h-6 mx-1"}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleBlockquote().run(),isActive:t.isActive("blockquote"),title:"Citação",children:l.jsx(k.Quote,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:n,isActive:t.isActive("link"),title:"Link",children:l.jsx(k.Link,{className:"h-4 w-4"})}),e==="full"&&l.jsx(tt,{onClick:r,title:"Imagem",children:l.jsx(k.Image,{className:"h-4 w-4"})})]})};function sD({content:t="",onChange:e,placeholder:n="Comece a escrever...",variant:r="simple",className:a,readOnly:i=!1,label:s}){var c,d;const o=I.useMemo(()=>[Og.configure({heading:{levels:[1,2,3]}}),Pg.configure({HTMLAttributes:{class:"rounded-lg border shadow-sm max-w-full"}}),nD.configure({placeholder:n}),aD.configure({types:["heading","paragraph"]})],[n]),f=ig({extensions:o,content:t,editable:!i,onUpdate:({editor:u})=>{e==null||e(u.getHTML())},editorProps:{attributes:{class:w("prose prose-stone dark:prose-invert max-w-none focus:outline-none","prose-headings:font-semibold prose-headings:tracking-tight","prose-h1:text-3xl prose-h2:text-2xl prose-h3:text-xl","prose-p:leading-7 prose-p:my-3","prose-blockquote:border-l-4 prose-blockquote:border-primary/50 prose-blockquote:pl-4 prose-blockquote:italic","prose-ul:list-disc prose-ul:pl-6 prose-ol:list-decimal prose-ol:pl-6","prose-img:rounded-lg prose-img:shadow-md prose-img:my-6",r==="full"?"min-h-[400px] p-8":"min-h-[120px] px-3 py-2")}}});return f?l.jsxs("div",{className:w("flex flex-col w-full",a),children:[s&&l.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:s}),l.jsxs("div",{className:w("border rounded-lg bg-background overflow-hidden transition-shadow focus-within:ring-2 focus-within:ring-primary/20",i&&"opacity-80 bg-muted/30 pointer-events-none border-transparent"),children:[!i&&l.jsx(iD,{editor:f,variant:r}),l.jsx("div",{className:w("bg-background relative",r==="full"?"bg-white dark:bg-zinc-950":""),children:l.jsx(od,{editor:f})})]}),!i&&r==="full"&&l.jsxs("div",{className:"text-xs text-muted-foreground mt-1.5 text-right px-1",children:[((d=(c=f.storage.characterCount)==null?void 0:c.words)==null?void 0:d.call(c))||0," palavras"]})]}):null}function oD({...t}){return l.jsx(Kn.Drawer.Root,{"data-slot":"drawer",...t})}const T2=I.forwardRef(({...t},e)=>l.jsx(Kn.Drawer.Trigger,{ref:e,"data-slot":"drawer-trigger",...t}));T2.displayName="DrawerTrigger";function lD({...t}){return l.jsx(Kn.Drawer.Portal,{"data-slot":"drawer-portal",...t})}const I2=I.forwardRef(({...t},e)=>l.jsx(Kn.Drawer.Close,{ref:e,"data-slot":"drawer-close",...t}));I2.displayName="DrawerClose";const D2=I.forwardRef(({className:t,...e},n)=>l.jsx(Kn.Drawer.Overlay,{ref:n,"data-slot":"drawer-overlay",className:w("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e}));D2.displayName="DrawerOverlay";const E2=I.forwardRef(({className:t,children:e,...n},r)=>l.jsxs(lD,{"data-slot":"drawer-portal",children:[l.jsx(D2,{}),l.jsxs(Kn.Drawer.Content,{ref:r,"data-slot":"drawer-content",className:w("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",t),...n,children:[l.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e]})]}));E2.displayName="DrawerContent";function fD({className:t,...e}){return l.jsx("div",{"data-slot":"drawer-header",className:w("flex flex-col gap-1.5 p-4",t),...e})}function cD({className:t,...e}){return l.jsx("div",{"data-slot":"drawer-footer",className:w("mt-auto flex flex-col gap-2 p-4",t),...e})}const A2=I.forwardRef(({className:t,...e},n)=>l.jsx(Kn.Drawer.Title,{ref:n,"data-slot":"drawer-title",className:w("text-foreground font-semibold leading-[1.2]",t),...e}));A2.displayName="DrawerTitle";const z2=I.forwardRef(({className:t,...e},n)=>l.jsx(Kn.Drawer.Description,{ref:n,"data-slot":"drawer-description",className:w("text-muted-foreground text-sm leading-relaxed",t),...e}));z2.displayName="DrawerDescription";function dD({value:t,options:e,onValueChange:n,onCancel:r,disabled:a=!1,variant:i="default",confirmTitle:s="Confirmar alteração",confirmDescription:o="Tem certeza que deseja alterar este valor?",confirmButtonText:f="Confirmar",cancelButtonText:c="Cancelar",skipConfirmation:d=!1,isLoading:u=!1,renderValue:p,className:h,...m},g){const[b,x]=I.useState(null),[v,j]=I.useState(!1),[y,L]=I.useState(!1),[C,N]=I.useState(!1),S=I.useMemo(()=>e.find(E=>E.value===t),[e,t]),T=I.useMemo(()=>b?e.find(E=>E.value===b):null,[e,b]),z=I.useCallback(E=>{if(E===t){L(!1);return}x(E),L(!1),d?P(E):j(!0)},[t,d]),P=I.useCallback(async E=>{const G=E??b;if(G!=null){N(!0);try{await n(G),j(!1),x(null)}catch(Z){console.error("Error confirming value change:",Z)}finally{N(!1)}}},[b,n]),U=I.useCallback(()=>{j(!1),x(null),r==null||r()},[r]),J=I.useCallback(()=>p&&S?p(t,S):S?l.jsxs(l.Fragment,{children:[S.icon,S.label]}):t,[p,t,S]),Y=(S==null?void 0:S.variant)||i,K=S==null?void 0:S.className;return a?l.jsx("div",{ref:g,className:w("inline-flex",h),...m,children:l.jsx(pe,{variant:Y,className:K,children:J()})}):l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:g,className:w("inline-flex",h),...m,children:l.jsxs(Hi,{open:y,onOpenChange:L,children:[l.jsx(Fi,{asChild:!0,disabled:u,children:l.jsxs(pe,{variant:Y,className:w("cursor-pointer hover:opacity-80 transition-opacity gap-1.5",u&&"opacity-50 cursor-not-allowed",K),children:[J(),!u&&l.jsx(k.ChevronDown,{className:"h-3 w-3"})]})}),l.jsx(Ui,{align:"start",className:"w-48",children:e.map(E=>l.jsxs(gr,{onClick:()=>z(E.value),className:"gap-2",children:[E.icon&&l.jsx("span",{className:"w-4 h-4",children:E.icon}),l.jsx("span",{className:"flex-1",children:E.label}),E.value===t&&l.jsx(k.Check,{className:"h-4 w-4 text-primary"})]},String(E.value)))})]})}),l.jsx(_i,{open:v,onOpenChange:j,children:l.jsxs(Ji,{children:[l.jsxs(Vi,{children:[l.jsx(Gi,{children:s}),l.jsx(Yi,{children:o})]}),T&&l.jsxs("div",{className:"flex items-center gap-3 py-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"De:"}),l.jsxs(pe,{variant:(S==null?void 0:S.variant)||i,className:S==null?void 0:S.className,children:[S==null?void 0:S.icon,(S==null?void 0:S.label)||t]})]}),l.jsx("span",{className:"text-muted-foreground",children:"→"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"Para:"}),l.jsxs(pe,{variant:T.variant||i,className:T.className,children:[T.icon,T.label]})]})]}),l.jsxs(Zo,{children:[l.jsx(F,{variant:"outline",onClick:U,disabled:C,children:c}),l.jsx(F,{onClick:()=>P(),disabled:C,children:C?"Confirmando...":f})]})]})})]})}const O2=I.forwardRef(dD);O2.displayName="EditableBadge";function P2({className:t,...e}){return l.jsx(Yo.Root,{"data-slot":"tabs",className:w("flex flex-col gap-2",t),...e})}function R2({className:t,...e}){return l.jsx(Yo.List,{"data-slot":"tabs-list",className:w("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-xl p-[3px] flex",t),...e})}function _s({className:t,...e}){return l.jsx(Yo.Trigger,{"data-slot":"tabs-trigger",className:w("data-[state=active]:bg-card dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-xl border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...e})}function uD({className:t,...e}){return l.jsx(Yo.Content,{"data-slot":"tabs-content",className:w("flex-1 outline-none",t),...e})}const B2=M.createContext({dragDropManager:void 0});function St(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Yp=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Qp=function(){return Math.random().toString(36).substring(7).split("").join(".")},Wp={INIT:"@@redux/INIT"+Qp(),REPLACE:"@@redux/REPLACE"+Qp()};function hD(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function pD(t){if(t===void 0)return"undefined";if(t===null)return"null";var e=typeof t;switch(e){case"boolean":case"string":case"number":case"symbol":case"function":return e}if(Array.isArray(t))return"array";if(bD(t))return"date";if(gD(t))return"error";var n=mD(t);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return e.slice(8,-1).toLowerCase().replace(/\s/g,"")}function mD(t){return typeof t.constructor=="function"?t.constructor.name:null}function gD(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function bD(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function Zr(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=pD(t)),e}function H2(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?St(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?St(1):"Expected the enhancer to be a function. Instead, received: '"+Zr(n)+"'");return n(H2)(t,e)}if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?St(2):"Expected the root reducer to be a function. Instead, received: '"+Zr(t)+"'");var a=t,i=e,s=[],o=s,f=!1;function c(){o===s&&(o=s.slice())}function d(){if(f)throw new Error(process.env.NODE_ENV==="production"?St(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function u(g){if(typeof g!="function")throw new Error(process.env.NODE_ENV==="production"?St(4):"Expected the listener to be a function. Instead, received: '"+Zr(g)+"'");if(f)throw new Error(process.env.NODE_ENV==="production"?St(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var b=!0;return c(),o.push(g),function(){if(b){if(f)throw new Error(process.env.NODE_ENV==="production"?St(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,c();var v=o.indexOf(g);o.splice(v,1),s=null}}}function p(g){if(!hD(g))throw new Error(process.env.NODE_ENV==="production"?St(7):"Actions must be plain objects. Instead, the actual type was: '"+Zr(g)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof g.type>"u")throw new Error(process.env.NODE_ENV==="production"?St(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(f)throw new Error(process.env.NODE_ENV==="production"?St(9):"Reducers may not dispatch actions.");try{f=!0,i=a(i,g)}finally{f=!1}for(var b=s=o,x=0;x<b.length;x++){var v=b[x];v()}return g}function h(g){if(typeof g!="function")throw new Error(process.env.NODE_ENV==="production"?St(10):"Expected the nextReducer to be a function. Instead, received: '"+Zr(g));a=g,p({type:Wp.REPLACE})}function m(){var g,b=u;return g={subscribe:function(v){if(typeof v!="object"||v===null)throw new Error(process.env.NODE_ENV==="production"?St(11):"Expected the observer to be an object. Instead, received: '"+Zr(v)+"'");function j(){v.next&&v.next(d())}j();var y=b(j);return{unsubscribe:y}}},g[Yp]=function(){return this},g}return p({type:Wp.INIT}),r={dispatch:p,subscribe:u,getState:d,replaceReducer:h},r[Yp]=m,r}function ne(t,e,...n){if(xD()&&e===void 0)throw new Error("invariant requires an error message argument");if(!t){let r;if(e===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let a=0;r=new Error(e.replace(/%s/g,function(){return n[a++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function xD(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function yD(t,e,n){return e.split(".").reduce((r,a)=>r&&r[a]?r[a]:n||null,t)}function vD(t,e){return t.filter(n=>n!==e)}function F2(t){return typeof t=="object"}function wD(t,e){const n=new Map,r=i=>{n.set(i,n.has(i)?n.get(i)+1:1)};t.forEach(r),e.forEach(r);const a=[];return n.forEach((i,s)=>{i===1&&a.push(s)}),a}function MD(t,e){return t.filter(n=>e.indexOf(n)>-1)}const iu="dnd-core/INIT_COORDS",Sl="dnd-core/BEGIN_DRAG",su="dnd-core/PUBLISH_DRAG_SOURCE",Tl="dnd-core/HOVER",Il="dnd-core/DROP",Dl="dnd-core/END_DRAG";function $p(t,e){return{type:iu,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const jD={type:iu,payload:{clientOffset:null,sourceClientOffset:null}};function CD(t){return function(n=[],r={publishSource:!0}){const{publishSource:a=!0,clientOffset:i,getSourceClientOffset:s}=r,o=t.getMonitor(),f=t.getRegistry();t.dispatch($p(i)),LD(n,o,f);const c=SD(n,o);if(c==null){t.dispatch(jD);return}let d=null;if(i){if(!s)throw new Error("getSourceClientOffset must be defined");ND(s),d=s(c)}t.dispatch($p(i,d));const p=f.getSource(c).beginDrag(o,c);if(p==null)return;kD(p),f.pinSource(c);const h=f.getSourceType(c);return{type:Sl,payload:{itemType:h,item:p,sourceId:c,clientOffset:i||null,sourceClientOffset:d||null,isSourcePublic:!!a}}}}function LD(t,e,n){ne(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){ne(n.getSource(r),"Expected sourceIds to be registered.")})}function ND(t){ne(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function kD(t){ne(F2(t),"Item must be an object.")}function SD(t,e){let n=null;for(let r=t.length-1;r>=0;r--)if(e.canDragSource(t[r])){n=t[r];break}return n}function TD(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ID(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){TD(t,a,n[a])})}return t}function DD(t){return function(n={}){const r=t.getMonitor(),a=t.getRegistry();ED(r),OD(r).forEach((s,o)=>{const f=AD(s,o,a,r),c={type:Il,payload:{dropResult:ID({},n,f)}};t.dispatch(c)})}}function ED(t){ne(t.isDragging(),"Cannot call drop while not dragging."),ne(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function AD(t,e,n,r){const a=n.getTarget(t);let i=a?a.drop(r,t):void 0;return zD(i),typeof i>"u"&&(i=e===0?{}:r.getDropResult()),i}function zD(t){ne(typeof t>"u"||F2(t),"Drop result must either be an object or undefined.")}function OD(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function PD(t){return function(){const n=t.getMonitor(),r=t.getRegistry();RD(n);const a=n.getSourceId();return a!=null&&(r.getSource(a,!0).endDrag(n,a),r.unpinSource()),{type:Dl}}}function RD(t){ne(t.isDragging(),"Cannot call endDrag while not dragging.")}function xc(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function BD(t){return function(n,{clientOffset:r}={}){HD(n);const a=n.slice(0),i=t.getMonitor(),s=t.getRegistry(),o=i.getItemType();return UD(a,s,o),FD(a,i,s),_D(a,i,s),{type:Tl,payload:{targetIds:a,clientOffset:r||null}}}}function HD(t){ne(Array.isArray(t),"Expected targetIds to be an array.")}function FD(t,e,n){ne(e.isDragging(),"Cannot call hover while not dragging."),ne(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r<t.length;r++){const a=t[r];ne(t.lastIndexOf(a)===r,"Expected targetIds to be unique in the passed array.");const i=n.getTarget(a);ne(i,"Expected targetIds to be registered.")}}function UD(t,e,n){for(let r=t.length-1;r>=0;r--){const a=t[r],i=e.getTargetType(a);xc(i,n)||t.splice(r,1)}}function _D(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function JD(t){return function(){if(t.getMonitor().isDragging())return{type:su}}}function VD(t){return{beginDrag:CD(t),publishDragSource:JD(t),hover:BD(t),drop:DD(t),endDrag:PD(t)}}class GD{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:n}=this.store;function r(i){return(...s)=>{const o=i.apply(e,s);typeof o<"u"&&n(o)}}const a=VD(this);return Object.keys(a).reduce((i,s)=>{const o=a[s];return i[s]=r(o),i},{})}dispatch(e){this.store.dispatch(e)}constructor(e,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}}function YD(t,e){return{x:t.x+e.x,y:t.y+e.y}}function U2(t,e){return{x:t.x-e.x,y:t.y-e.y}}function QD(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:U2(YD(e,r),n)}function WD(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:U2(e,n)}const hi=[],ou=[];hi.__IS_NONE__=!0;ou.__IS_ALL__=!0;function $D(t,e){return t===hi?!1:t===ou||typeof e>"u"?!0:MD(e,t).length>0}class ZD{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;ne(typeof e=="function","listener must be a function."),ne(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const i=()=>{const s=this.store.getState(),o=s.stateId;try{o===a||o===a+1&&!$D(s.dirtyHandlerIds,r)||e()}finally{a=o}};return this.store.subscribe(i)}subscribeToOffsetChange(e){ne(typeof e=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const a=this.store.getState().dragOffset;a!==n&&(n=a,e())};return this.store.subscribe(r)}canDragSource(e){if(!e)return!1;const n=this.registry.getSource(e);return ne(n,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:n.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const n=this.registry.getTarget(e);if(ne(n,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(e),a=this.getItemType();return xc(r,a)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(ne(n,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(e),a=this.getItemType();return r!==a?!1:n.isDragging(this,e)}isOverTarget(e,n={shallow:!1}){if(!e)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const a=this.registry.getTargetType(e),i=this.getItemType();if(i&&!xc(a,i))return!1;const s=this.getTargetIds();if(!s.length)return!1;const o=s.indexOf(e);return r?o===s.length-1:o>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return QD(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return WD(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const Zp=typeof global<"u"?global:self,_2=Zp.MutationObserver||Zp.WebKitMutationObserver;function J2(t){return function(){const n=setTimeout(a,0),r=setInterval(a,50);function a(){clearTimeout(n),clearInterval(r),t()}}}function qD(t){let e=1;const n=new _2(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const KD=typeof _2=="function"?qD:J2;class XD{enqueueTask(e){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const n=this.index;if(this.index++,e[n].call(),this.index>this.capacity){for(let r=0,a=e.length-this.index;r<a;r++)e[r]=e[r+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=KD(this.flush),this.requestErrorThrow=J2(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class eE{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}class tE{create(e){const n=this.freeTasks,r=n.length?n.pop():new eE(this.onError,a=>n[n.length]=a);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const V2=new XD,nE=new tE(V2.registerPendingError);function rE(t){V2.enqueueTask(nE.create(t))}const lu="dnd-core/ADD_SOURCE",fu="dnd-core/ADD_TARGET",cu="dnd-core/REMOVE_SOURCE",El="dnd-core/REMOVE_TARGET";function aE(t){return{type:lu,payload:{sourceId:t}}}function iE(t){return{type:fu,payload:{targetId:t}}}function sE(t){return{type:cu,payload:{sourceId:t}}}function oE(t){return{type:El,payload:{targetId:t}}}function lE(t){ne(typeof t.canDrag=="function","Expected canDrag to be a function."),ne(typeof t.beginDrag=="function","Expected beginDrag to be a function."),ne(typeof t.endDrag=="function","Expected endDrag to be a function.")}function fE(t){ne(typeof t.canDrop=="function","Expected canDrop to be a function."),ne(typeof t.hover=="function","Expected hover to be a function."),ne(typeof t.drop=="function","Expected beginDrag to be a function.")}function yc(t,e){if(e&&Array.isArray(t)){t.forEach(n=>yc(n,!1));return}ne(typeof t=="string"||typeof t=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var At;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(At||(At={}));let cE=0;function dE(){return cE++}function uE(t){const e=dE().toString();switch(t){case At.SOURCE:return`S${e}`;case At.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function qp(t){switch(t[0]){case"S":return At.SOURCE;case"T":return At.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function Kp(t,e){const n=t.entries();let r=!1;do{const{done:a,value:[,i]}=n.next();if(i===e)return!0;r=!!a}while(!r);return!1}class hE{addSource(e,n){yc(e),lE(n);const r=this.addHandler(At.SOURCE,e,n);return this.store.dispatch(aE(r)),r}addTarget(e,n){yc(e,!0),fE(n);const r=this.addHandler(At.TARGET,e,n);return this.store.dispatch(iE(r)),r}containsHandler(e){return Kp(this.dragSources,e)||Kp(this.dropTargets,e)}getSource(e,n=!1){return ne(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return ne(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return ne(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return ne(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return qp(e)===At.SOURCE}isTargetId(e){return qp(e)===At.TARGET}removeSource(e){ne(this.getSource(e),"Expected an existing source."),this.store.dispatch(sE(e)),rE(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){ne(this.getTarget(e),"Expected an existing target."),this.store.dispatch(oE(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);ne(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){ne(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const a=uE(e);return this.types.set(a,n),e===At.SOURCE?this.dragSources.set(a,r):e===At.TARGET&&this.dropTargets.set(a,r),a}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const pE=(t,e)=>t===e;function mE(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function gE(t,e,n=pE){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!n(t[r],e[r]))return!1;return!0}function bE(t=hi,e){switch(e.type){case Tl:break;case lu:case fu:case El:case cu:return hi;case Sl:case su:case Dl:case Il:default:return ou}const{targetIds:n=[],prevTargetIds:r=[]}=e.payload,a=wD(n,r);if(!(a.length>0||!gE(n,r)))return hi;const s=r[r.length-1],o=n[n.length-1];return s!==o&&(s&&a.push(s),o&&a.push(o)),a}function xE(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yE(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){xE(t,a,n[a])})}return t}const Xp={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function vE(t=Xp,e){const{payload:n}=e;switch(e.type){case iu:case Sl:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Tl:return mE(t.clientOffset,n.clientOffset)?t:yE({},t,{clientOffset:n.clientOffset});case Dl:case Il:return Xp;default:return t}}function wE(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){wE(t,a,n[a])})}return t}const ME={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function jE(t=ME,e){const{payload:n}=e;switch(e.type){case Sl:return qr({},t,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case su:return qr({},t,{isSourcePublic:!0});case Tl:return qr({},t,{targetIds:n.targetIds});case El:return t.targetIds.indexOf(n.targetId)===-1?t:qr({},t,{targetIds:vD(t.targetIds,n.targetId)});case Il:return qr({},t,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Dl:return qr({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function CE(t=0,e){switch(e.type){case lu:case fu:return t+1;case cu:case El:return t-1;default:return t}}function LE(t=0){return t+1}function NE(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kE(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){NE(t,a,n[a])})}return t}function SE(t={},e){return{dirtyHandlerIds:bE(t.dirtyHandlerIds,{type:e.type,payload:kE({},e.payload,{prevTargetIds:yD(t,"dragOperation.targetIds",[])})}),dragOffset:vE(t.dragOffset,e),refCount:CE(t.refCount,e),dragOperation:jE(t.dragOperation,e),stateId:LE(t.stateId)}}function TE(t,e=void 0,n={},r=!1){const a=IE(r),i=new ZD(a,new hE(a)),s=new GD(a,i),o=t(s,e,n);return s.receiveBackend(o),s}function IE(t){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return H2(SE,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function DE(t,e){if(t==null)return{};var n=EE(t,e),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function EE(t,e){if(t==null)return{};var n={},r=Object.keys(t),a,i;for(i=0;i<r.length;i++)a=r[i],!(e.indexOf(a)>=0)&&(n[a]=t[a]);return n}let e0=0;const Js=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var G2=M.memo(function(e){var{children:n}=e,r=DE(e,["children"]);const[a,i]=AE(r);return M.useEffect(()=>{if(i){const s=Y2();return++e0,()=>{--e0===0&&(s[Js]=null)}}},[]),l.jsx(B2.Provider,{value:a,children:n})});function AE(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=zE(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function zE(t,e=Y2(),n,r){const a=e;return a[Js]||(a[Js]={dragDropManager:TE(t,e,n,r)}),a[Js]}function Y2(){return typeof global<"u"?global:window}function OE(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xf,t0;function PE(){return t0||(t0=1,xf=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,a,i;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(a=r;a--!==0;)if(!t(e[a],n[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(n).length)return!1;for(a=r;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[a]))return!1;for(a=r;a--!==0;){var s=i[a];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n}),xf}var RE=PE();const BE=OE(RE),Ir=typeof window<"u"?M.useLayoutEffect:M.useEffect;function HE(t,e,n){const[r,a]=M.useState(()=>e(t)),i=M.useCallback(()=>{const s=e(t);BE(r,s)||(a(s),n&&n())},[r,t,n]);return Ir(i),[r,i]}function FE(t,e,n){const[r,a]=HE(t,e,n);return Ir(function(){const s=t.getHandlerId();if(s!=null)return t.subscribeToStateChange(a,{handlerIds:[s]})},[t,a]),r}function Q2(t,e,n){return FE(e,t||(()=>({})),()=>n.reconnect())}function W2(t,e){const n=[...e||[]];return e==null&&typeof t!="function"&&n.push(t),M.useMemo(()=>typeof t=="function"?t():t,n)}function UE(t){return M.useMemo(()=>t.hooks.dragSource(),[t])}function _E(t){return M.useMemo(()=>t.hooks.dragPreview(),[t])}let yf=!1,vf=!1;class JE{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){ne(!yf,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return yf=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{yf=!1}}isDragging(){if(!this.sourceId)return!1;ne(!vf,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return vf=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{vf=!1}}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,n){return this.internalMonitor.isOverTarget(e,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let wf=!1;class VE{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;ne(!wf,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return wf=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{wf=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function GE(t,e,n){const r=n.getRegistry(),a=r.addTarget(t,e);return[a,()=>r.removeTarget(a)]}function YE(t,e,n){const r=n.getRegistry(),a=r.addSource(t,e);return[a,()=>r.removeSource(a)]}function vc(t,e,n,r){let a;if(a!==void 0)return!!a;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;const i=Object.keys(t),s=Object.keys(e);if(i.length!==s.length)return!1;const o=Object.prototype.hasOwnProperty.bind(e);for(let f=0;f<i.length;f++){const c=i[f];if(!o(c))return!1;const d=t[c],u=e[c];if(a=void 0,a===!1||a===void 0&&d!==u)return!1}return!0}function wc(t){return t!==null&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function QE(t){if(typeof t.type=="string")return;const e=t.type.displayName||t.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function WE(t){return(e=null,n=null)=>{if(!M.isValidElement(e)){const i=e;return t(i,n),i}const r=e;return QE(r),$E(r,n?i=>t(i,n):t)}}function $2(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const a=WE(r);e[n]=()=>a}}),e}function n0(t,e){typeof t=="function"?t(e):t.current=e}function $E(t,e){const n=t.ref;return ne(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?M.cloneElement(t,{ref:r=>{n0(n,r),n0(e,r)}}):M.cloneElement(t,{ref:e})}class ZE{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?e?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),n):(this.lastConnectedDragSource=e,n):n}reconnectDragPreview(e=!1){const n=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!vc(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!vc(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=$2({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,wc(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,wc(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class qE{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!vc(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=$2({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,wc(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function Ia(){const{dragDropManager:t}=M.useContext(B2);return ne(t!=null,"Expected drag drop context"),t}function KE(t,e){const n=Ia(),r=M.useMemo(()=>new ZE(n.getBackend()),[n]);return Ir(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),Ir(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function XE(){const t=Ia();return M.useMemo(()=>new JE(t),[t])}class e5{beginDrag(){const e=this.spec,n=this.monitor;let r=null;return typeof e.item=="object"?r=e.item:typeof e.item=="function"?r=e.item(n):r={},r??null}canDrag(){const e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(n):!0}isDragging(e,n){const r=this.spec,a=this.monitor,{isDragging:i}=r;return i?i(a):n===e.getSourceId()}endDrag(){const e=this.spec,n=this.monitor,r=this.connector,{end:a}=e;a&&a(n.getItem(),n),r.reconnect()}constructor(e,n,r){this.spec=e,this.monitor=n,this.connector=r}}function t5(t,e,n){const r=M.useMemo(()=>new e5(t,e,n),[e,n]);return M.useEffect(()=>{r.spec=t},[t]),r}function n5(t){return M.useMemo(()=>{const e=t.type;return ne(e!=null,"spec.type must be defined"),e},[t])}function r5(t,e,n){const r=Ia(),a=t5(t,e,n),i=n5(t);Ir(function(){if(i!=null){const[o,f]=YE(i,a,r);return e.receiveHandlerId(o),n.receiveHandlerId(o),f}},[r,e,n,a,i])}function a5(t,e){const n=W2(t,e);ne(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=XE(),a=KE(n.options,n.previewOptions);return r5(n,r,a),[Q2(n.collect,r,a),UE(a),_E(a)]}function i5(t){return M.useMemo(()=>t.hooks.dropTarget(),[t])}function s5(t){const e=Ia(),n=M.useMemo(()=>new qE(e.getBackend()),[e]);return Ir(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function o5(){const t=Ia();return M.useMemo(()=>new VE(t),[t])}function l5(t){const{accept:e}=t;return M.useMemo(()=>(ne(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class f5{canDrop(){const e=this.spec,n=this.monitor;return e.canDrop?e.canDrop(n.getItem(),n):!0}hover(){const e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}drop(){const e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}constructor(e,n){this.spec=e,this.monitor=n}}function c5(t,e){const n=M.useMemo(()=>new f5(t,e),[e]);return M.useEffect(()=>{n.spec=t},[t]),n}function d5(t,e,n){const r=Ia(),a=c5(t,e),i=l5(t);Ir(function(){const[o,f]=GE(i,a,r);return e.receiveHandlerId(o),n.receiveHandlerId(o),f},[r,e,a,n,i.map(s=>s.toString()).join("|")])}function du(t,e){const n=W2(t,e),r=o5(),a=s5(n.options);return d5(n,r,a),[Q2(n.collect,r,a),i5(a)]}function Z2(t){let e=null;return()=>(e==null&&(e=t()),e)}function u5(t,e){return t.filter(n=>n!==e)}function h5(t,e){const n=new Set,r=i=>n.add(i);t.forEach(r),e.forEach(r);const a=[];return n.forEach(i=>a.push(i)),a}class p5{enter(e){const n=this.entered.length,r=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(e));return this.entered=h5(this.entered.filter(r),[e]),n===0&&this.entered.length>0}leave(e){const n=this.entered.length;return this.entered=u5(this.entered.filter(this.isNodeInDocument),e),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class m5{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const a=this.config.exposeProperties[r];a!=null&&(n[r]={value:a(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,n){return n===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const q2="__NATIVE_FILE__",K2="__NATIVE_URL__",X2="__NATIVE_TEXT__",e4="__NATIVE_HTML__",r0=Object.freeze(Object.defineProperty({__proto__:null,FILE:q2,HTML:e4,TEXT:X2,URL:K2},Symbol.toStringTag,{value:"Module"}));function Mf(t,e,n){const r=e.reduce((a,i)=>a||t.getData(i),"");return r??n}const Mc={[q2]:{exposeProperties:{files:t=>Array.prototype.slice.call(t.files),items:t=>t.items,dataTransfer:t=>t},matchesTypes:["Files"]},[e4]:{exposeProperties:{html:(t,e)=>Mf(t,e,""),dataTransfer:t=>t},matchesTypes:["Html","text/html"]},[K2]:{exposeProperties:{urls:(t,e)=>Mf(t,e,"").split(`
|
|
221
|
+
`),p.document.close(),p.onload=()=>{setTimeout(()=>{p.print(),p.close(),a==null||a()},250)}}catch(u){i==null||i(u),console.error("Erro ao imprimir contrato:",u)}},downloadPDF:()=>{try{s==null||s(),setTimeout(()=>{console.log("PDF gerado (simulado):",{contractNumber:e,timestamp:new Date().toISOString()}),o==null||o()},1500),console.info("usePrintContract: downloadPDF é uma implementação simulada. Para gerar PDFs reais, integre com html2pdf.js ou jsPDF. Veja a documentação do hook para exemplos.")}catch(u){f==null||f(u),console.error("Erro ao gerar PDF:",u)}}}}function QI({data:t,logo:e,showActions:n=!0,showSummary:r=!0,showServices:a=!0,showInfo:i=!1,className:s,onPrintStart:o,onPrintSuccess:f,onPrintError:c,onDownloadStart:d,onDownloadSuccess:u,onDownloadError:p}){const h=I.useRef(null),{printContract:m,downloadPDF:g}=j2(h,t.numeroContrato,{onPrintStart:o,onPrintSuccess:f,onPrintError:c,onDownloadStart:d,onDownloadSuccess:u,onDownloadError:p}),b=x=>new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(x);return l.jsxs("div",{className:w("space-y-6",s),children:[n&&l.jsxs(jr,{className:"no-print",children:[l.jsx(la,{children:l.jsxs(fa,{className:"flex items-center justify-between",children:[l.jsx("span",{children:"Ações do Documento"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(F,{variant:"outline",size:"sm",onClick:g,className:"gap-2",children:[l.jsx(k.Download,{className:"h-4 w-4"}),"Download PDF"]}),l.jsxs(F,{variant:"default",size:"sm",onClick:m,className:"gap-2",children:[l.jsx(k.Printer,{className:"h-4 w-4"}),"Imprimir"]})]})]})}),r&&l.jsx(ca,{children:l.jsxs("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-muted-foreground mb-1",children:"Nº do Contrato"}),l.jsx("p",{className:"font-semibold",children:t.numeroContrato})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-muted-foreground mb-1",children:"Cliente"}),l.jsx("p",{className:"font-semibold",children:t.cliente.nome})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-muted-foreground mb-1",children:"Valor do Fee"}),l.jsx("p",{className:"font-semibold",children:b(t.valorFee)})]})]})})]}),l.jsx("div",{className:"bg-white rounded-lg shadow-sm p-8",children:l.jsx("div",{ref:h,children:l.jsx(nu,{data:t,showPreview:!0,logo:e,showServices:a})})}),i&&l.jsxs(jr,{className:"no-print",children:[l.jsx(la,{children:l.jsxs(fa,{className:"flex items-center gap-2",children:[l.jsx(k.Eye,{className:"h-5 w-5"}),"Sobre este Template"]})}),l.jsx(ca,{children:l.jsxs("div",{className:"space-y-2 text-sm text-muted-foreground",children:[l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Design System:"})," Utiliza a paleta de cores e tipografia do iClips"]}),l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Impressão Otimizada:"})," Layout preparado para impressão em A4"]}),l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Componentes Reutilizáveis:"})," PrintHeader, PrintFooter, PrintTable, PrintSignature"]}),l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Quebras de Página:"})," Configuradas automaticamente para evitar cortes"]}),l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Profissional:"})," Layout clean e adequado para documentos legais"]})]})})]})]})}const C2=I.forwardRef(({data:t,logo:e,showServices:n=!0,className:r},a)=>l.jsx("div",{className:w("bg-white rounded-lg shadow-sm p-8",r),ref:a,children:l.jsx(nu,{data:t,showPreview:!0,logo:e,showServices:n})}));C2.displayName="ContractPrintPreview";const Go=I.forwardRef(({className:t,inputClassName:e,containerClassName:n,style:r,value:a,defaultValue:i=0,onChange:s,min:o=Number.MIN_SAFE_INTEGER,max:f=Number.MAX_SAFE_INTEGER,step:c=1,precision:d=0,formatOptions:u,locale:p="pt-BR",allowMouseWheel:h=!1,clampValueOnBlur:m=!0,keepWithinRange:g=!0,showButtons:b=!0,buttonLayout:x="vertical",buttonPosition:v="right",disabled:j,readOnly:y,...L},C)=>{const[N,S]=I.useState(i),[T,z]=I.useState(""),[P,U]=I.useState(!1),J=I.useRef(null),Y=a!==void 0?a:N,K=I.useCallback(B=>u?new Intl.NumberFormat(p,u).format(B):B.toFixed(d),[u,p,d]),E=B=>{const he=B.replace(/[^\d,.-]/g,"").replace(",","."),Oe=parseFloat(he);return isNaN(Oe)?0:Oe},G=B=>g?Math.min(Math.max(B,o),f):B,Z=I.useCallback((B,ee=!1)=>{const he=ee?G(B):B;a===void 0&&S(he),s&&s(he)},[a,s,o,f,g]);I.useEffect(()=>{P||z(K(Y))},[Y,K,P]);const le=()=>{if(j||y)return;const B=Y+c;B<=f&&Z(B)},we=()=>{if(j||y)return;const B=Y-c;B>=o&&Z(B)},Ie=B=>{const he=B.target.value.replace(/[^\d,.-]/g,"");z(he);const Oe=E(he);Z(Oe,!1)},Le=B=>{if(U(!1),m){const ee=G(Y);Z(ee,!1),z(K(ee))}else z(K(Y));L.onBlur&&L.onBlur(B)},V=B=>{U(!0),z(Y.toString()),B.target.select(),L.onFocus&&L.onFocus(B)},q=B=>{j||y||(B.key==="ArrowUp"?(B.preventDefault(),le()):B.key==="ArrowDown"&&(B.preventDefault(),we()),L.onKeyDown&&L.onKeyDown(B))},re=B=>{!h||j||y||!P||(B.preventDefault(),B.deltaY<0?le():B.deltaY>0&&we())};I.useImperativeHandle(C,()=>J.current);const A=()=>{if(!b)return null;const B=l.jsx("button",{type:"button",onClick:le,disabled:j||y||Y>=f,tabIndex:-1,"aria-label":"Increment",className:w("inline-flex items-center justify-center transition-colors","hover:bg-muted active:bg-accent","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",x==="vertical"&&"h-4 w-7 rounded-sm",x==="horizontal"&&"h-9 w-9 rounded-l-md border-r border-input bg-input-background"),children:x==="vertical"?l.jsx(k.ChevronUp,{className:"h-3 w-3"}):l.jsx(k.Plus,{className:"h-4 w-4"})},"inc"),ee=l.jsx("button",{type:"button",onClick:we,disabled:j||y||Y<=o,tabIndex:-1,"aria-label":"Decrement",className:w("inline-flex items-center justify-center transition-colors","hover:bg-muted active:bg-accent","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",x==="vertical"&&"h-4 w-7 rounded-sm",x==="horizontal"&&"h-9 w-9 rounded-r-md border-l border-input bg-input-background"),children:x==="vertical"?l.jsx(k.ChevronDown,{className:"h-3 w-3"}):l.jsx(k.Minus,{className:"h-4 w-4"})},"dec");if(x==="vertical")return l.jsxs("div",{className:w("flex flex-col items-center justify-center gap-[2px] self-stretch px-1 shrink-0 overflow-hidden",v==="right"?"order-2 border-l border-input rounded-r-md":"order-[-1] border-r border-input rounded-l-md"),children:[B,ee]});if(x==="horizontal")return[ee,B]};return x==="horizontal"&&b?l.jsxs("div",{className:w("inline-flex items-center w-full",n),style:r,children:[A(),l.jsx("input",{ref:J,type:"text",inputMode:"decimal","data-slot":"input",className:w("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 border-y px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","text-center tabular-nums",t),value:T,onChange:Ie,onBlur:Le,onFocus:V,onKeyDown:q,onWheel:re,disabled:j,readOnly:y,"aria-valuemin":o,"aria-valuemax":f,"aria-valuenow":Y,role:"spinbutton",...L})]}):l.jsxs("div",{className:w("inline-flex w-full items-stretch",n),style:r,children:[l.jsx("input",{ref:J,type:"text",inputMode:"decimal","data-slot":"input",className:w("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","tabular-nums",b&&x==="vertical"&&v==="right"&&"text-right rounded-r-none border-r-0",b&&x==="vertical"&&v==="left"&&"text-left rounded-l-none border-l-0",!b&&"text-right",e,t),value:T,onChange:Ie,onBlur:Le,onFocus:V,onKeyDown:q,onWheel:re,disabled:j,readOnly:y,"aria-valuemin":o,"aria-valuemax":f,"aria-valuenow":Y,role:"spinbutton",...L}),A()]})});Go.displayName="NumberInput";function ru({className:t,...e}){return l.jsx("textarea",{"data-slot":"textarea",className:w("resize-none border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-input-background px-3 py-2 text-base transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...e})}function L2({className:t,...e}){return l.jsx("div",{"data-slot":"input-group",role:"group",className:w("group/input-group cn-input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",t),...e})}const WI=$t.cva("cn-input-group-addon flex cursor-text items-center justify-center select-none",{variants:{align:{"inline-start":"cn-input-group-addon-align-inline-start order-first","inline-end":"cn-input-group-addon-align-inline-end order-last","block-start":"cn-input-group-addon-align-block-start order-first w-full justify-start","block-end":"cn-input-group-addon-align-block-end order-last w-full justify-start"}},defaultVariants:{align:"inline-start"}});function bc({className:t,align:e="inline-start",...n}){return l.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":e,className:w(WI({align:e}),t),onClick:r=>{var a,i;r.target.closest("button")||(i=(a=r.currentTarget.parentElement)==null?void 0:a.querySelector("input"))==null||i.focus()},...n})}const $I=$t.cva("flex items-center gap-2 text-sm shadow-none",{variants:{size:{default:"h-7",sm:"h-6",xs:"h-5","icon-xs":"size-5"}},defaultVariants:{size:"default"}});function ZI({className:t,size:e,variant:n="ghost",type:r="button",...a}){return l.jsx(F,{"data-slot":"input-group-button",type:r,variant:n,className:w($I({size:e}),t),...a})}function qI({className:t,...e}){return l.jsx("span",{"data-slot":"input-group-text",className:w("text-muted-foreground text-sm",t),...e})}function KI({className:t,...e}){return l.jsx(Ht,{"data-slot":"input-group-control",className:w("cn-input-group-input flex-1",t),...e})}function XI({className:t,...e}){return l.jsx(ru,{"data-slot":"input-group-control",className:w("cn-input-group-textarea flex-1 resize-none",t),...e})}const eD={BRL:{symbol:"R$",icon:k.Coins,locale:"pt-BR"},USD:{symbol:"$",icon:k.DollarSign,locale:"en-US"},EUR:{symbol:"€",icon:k.Euro,locale:"de-DE"}},N2=I.forwardRef(({className:t,currency:e="BRL",locale:n,showSymbol:r=!1,symbolPosition:a="start",min:i=0,...s},o)=>{const f=eD[e],c=n||f.locale,d=f.icon;return r?l.jsxs(L2,{className:t,children:[a==="start"&&l.jsx(bc,{children:l.jsx(d,{className:"h-4 w-4 text-muted-foreground"})}),l.jsx(Go,{ref:o,className:w("border-none shadow-none ring-0 focus-visible:ring-0 focus-visible:border-transparent",a==="start"?"pl-2":"pr-2"),min:i,precision:2,formatOptions:{style:"currency",currency:e,minimumFractionDigits:2,maximumFractionDigits:2},locale:c,...s}),a==="end"&&l.jsx(bc,{align:"inline-end",children:l.jsx(d,{className:"h-4 w-4 text-muted-foreground"})})]}):l.jsx(Go,{ref:o,className:t,min:i,precision:2,formatOptions:{style:"currency",currency:e,minimumFractionDigits:2,maximumFractionDigits:2},locale:c,...s})});N2.displayName="CurrencyInput";const tD=()=>{const t=new Date;return t.setHours(0,0,0,0),[{label:"Hoje",value:{from:t,to:t}},{label:"Últimos 7 dias",value:{from:H.subDays(t,6),to:t}},{label:"Últimos 30 dias",value:{from:H.subDays(t,29),to:t}},{label:"Este mês",value:{from:H.startOfMonth(t),to:t}},{label:"Mês passado",value:{from:H.startOfMonth(H.subMonths(t,1)),to:H.endOfMonth(H.subMonths(t,1))}}]};function k2({value:t,onChange:e,placeholder:n="Selecione um período",disabled:r=!1,minDate:a,maxDate:i,dateFormat:s="dd/MM/yyyy",locale:o=yt,className:f,error:c=!1,numberOfMonths:d=2,showTime:u=!1,timeFormat:p="24h",minuteStep:h=15,presets:m,showDefaultPresets:g=!0,id:b,name:x}){const[v,j]=I.useState(!1),[y,L]=I.useState(""),[C,N]=I.useState(!1),S=u?`${s} HH:mm`:s,T=I.useMemo(()=>u?["dd/MM/yyyy HH:mm","dd/MM/yy HH:mm","d/M/yyyy HH:mm","d/M/yy HH:mm"]:["dd/MM/yyyy","dd/MM/yy","d/M/yyyy","d/M/yy"],[u]);I.useEffect(()=>{if(t!=null&&t.from){const V=H.format(t.from,S,{locale:o}),q=t.to?H.format(t.to,S,{locale:o}):"";L(q?`${V} → ${q}`:V),N(!1)}else L(""),N(!1)},[t,S,o]);const z=I.useMemo(()=>[...g?tD():[],...m||[]],[m,g]),P=I.useMemo(()=>{if(!(t!=null&&t.from))return"00:00";const V=t.from.getHours().toString().padStart(2,"0"),q=t.from.getMinutes().toString().padStart(2,"0");return`${V}:${q}`},[t==null?void 0:t.from]),U=I.useMemo(()=>{if(!(t!=null&&t.to))return"23:59";const V=t.to.getHours().toString().padStart(2,"0"),q=t.to.getMinutes().toString().padStart(2,"0");return`${V}:${q}`},[t==null?void 0:t.to]),J=V=>{if(!V){e==null||e(void 0);return}if(u){if(V.from){const[q,re]=P.split(":").map(Number);V.from.setHours(q,re,0,0)}if(V.to){const[q,re]=U.split(":").map(Number);V.to.setHours(q,re,0,0)}}else V.from&&V.from.setHours(0,0,0,0),V.to&&V.to.setHours(23,59,59,999);e==null||e(V)},Y=V=>{if(!(t!=null&&t.from))return;const q=new Date(t.from),[re,A]=V.split(":").map(Number);q.setHours(re,A,0,0),e==null||e({...t,from:q})},K=V=>{if(!(t!=null&&t.to))return;const q=new Date(t.to),[re,A]=V.split(":").map(Number);q.setHours(re,A,0,0),e==null||e({...t,to:q})},E=V=>{const q={from:new Date(V.value.from),to:new Date(V.value.to)};if(u){const[re,A]=P.split(":").map(Number),[B,ee]=U.split(":").map(Number);q.from.setHours(re,A,0,0),q.to.setHours(B,ee,0,0)}e==null||e(q)},G=V=>{const q=V.trim();if(!q)return null;for(const re of T)try{const A=H.parse(q,re,new Date);if(H.isValid(A)){if(a&&A<a||i&&A>i)continue;return A}}catch{continue}return null},Z=V=>{const q=V.trim();if(!q)return null;const re=["→","-","até","a"];let A=null,B=null;for(const ee of re)if(q.includes(ee)){const he=q.split(ee).map(Oe=>Oe.trim());if(he.length===2&&(A=G(he[0]),B=G(he[1]),A&&B))break}return A||(A=G(q),A&&(B=new Date(A))),!A||!B?null:(A>B&&([A,B]=[B,A]),{from:A,to:B})},le=V=>{const q=V.target.value;L(q),N(!1)},we=()=>{if(!y.trim()){e==null||e(void 0),N(!1);return}const V=Z(y);V?(e==null||e(V),N(!1)):N(!0)},Ie=V=>{if(V.key==="Enter")V.preventDefault(),we(),C||j(!0);else if(V.key==="Escape"){if(V.preventDefault(),t!=null&&t.from){const q=H.format(t.from,S,{locale:o}),re=t.to?H.format(t.to,S,{locale:o}):"";L(re?`${q} → ${re}`:q)}else L("");N(!1)}},Le=V=>{V.stopPropagation(),e==null||e(void 0),L(""),N(!1)};return l.jsxs(st,{open:v,onOpenChange:j,children:[l.jsx($e,{asChild:!0,children:l.jsxs("div",{className:"relative w-full",children:[l.jsx(Ht,{id:b,name:x,value:y,onChange:le,onBlur:we,onKeyDown:Ie,placeholder:n,disabled:r,"aria-invalid":c||C,className:w("pr-20",(c||C)&&"border-destructive focus-visible:ring-destructive/20",f)}),l.jsxs("div",{className:"absolute inset-y-0 right-0 flex items-center gap-1 pr-1",children:[y&&!r&&l.jsxs(F,{type:"button",variant:"ghost",size:"sm",className:"h-7 w-7 p-0 hover:bg-transparent",onClick:Le,tabIndex:-1,children:[l.jsx(k.X,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),l.jsx("span",{className:"sr-only",children:"Limpar"})]}),l.jsxs(F,{type:"button",variant:"ghost",size:"sm",className:"h-7 w-7 p-0 hover:bg-transparent",disabled:r,onClick:()=>j(!0),tabIndex:-1,children:[l.jsx(k.CalendarIcon,{className:"h-4 w-4 text-muted-foreground"}),l.jsx("span",{className:"sr-only",children:"Abrir calendário"})]})]})]})}),l.jsx(Ze,{className:"w-auto p-0",align:"start",children:l.jsxs("div",{className:"flex",children:[z.length>0&&l.jsxs("div",{className:"border-r p-3 space-y-1 min-w-[140px]",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Atalhos"}),z.map(V=>l.jsx(F,{variant:"ghost",size:"sm",className:"w-full justify-start text-sm h-8",onClick:()=>E(V),children:V.label},V.label))]}),l.jsxs("div",{children:[l.jsx(Qo,{mode:"range",selected:t,onSelect:J,numberOfMonths:d,disabled:V=>!!(a&&V<a||i&&V>i),locale:o,autoFocus:!0}),u&&(t==null?void 0:t.from)&&(t==null?void 0:t.to)&&l.jsxs("div",{className:"border-t p-3 flex gap-6",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Hora início"}),l.jsx(mi,{value:P,onChange:Y,format:p,minuteStep:h,variant:"select",showIcon:!1})]}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Hora fim"}),l.jsx(mi,{value:U,onChange:K,format:p,minuteStep:h,variant:"select",showIcon:!1})]})]}),l.jsxs("div",{className:"border-t p-3 flex justify-end gap-2",children:[l.jsx(F,{variant:"outline",size:"sm",onClick:()=>{e==null||e(void 0)},children:"Limpar"}),l.jsx(F,{size:"sm",onClick:()=>j(!1),children:"Confirmar"})]})]})]})})]})}k2.displayName="DateRangePicker";var nD=bN,rD=Se.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).some(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).some(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),aD=rD;const au=$t.cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function S2({className:t,variant:e,size:n,...r}){return l.jsx(Ax.Root,{"data-slot":"toggle",className:w(au({variant:e,size:n,className:t})),...r})}const tt=({onClick:t,isActive:e=!1,disabled:n=!1,children:r,title:a})=>l.jsx(S2,{pressed:e,onPressedChange:t,disabled:n,size:"sm",className:"h-8 w-8 p-0",title:a,children:r}),iD=({editor:t,variant:e})=>{if(!t)return null;const n=()=>{const a=t.getAttributes("link").href,i=window.prompt("URL",a);if(i!==null){if(i===""){t.chain().focus().extendMarkRange("link").unsetLink().run();return}t.chain().focus().extendMarkRange("link").setLink({href:i}).run()}},r=()=>{const a=window.prompt("URL da imagem");a&&t.chain().focus().setImage({src:a}).run()};return l.jsxs("div",{className:w("flex flex-wrap items-center gap-1 p-2 border-b bg-muted/30 sticky top-0 z-10",e==="full"?"px-4 py-2":"px-2 py-1"),children:[l.jsxs("div",{className:"flex items-center gap-0.5 mr-2",children:[l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>t.chain().focus().undo().run(),disabled:!t.can().undo(),children:l.jsx(k.Undo,{className:"h-4 w-4"})}),l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>t.chain().focus().redo().run(),disabled:!t.can().redo(),children:l.jsx(k.Redo,{className:"h-4 w-4"})})]}),l.jsx(Hn,{orientation:"vertical",className:"h-6 mx-1"}),e==="full"&&l.jsxs(l.Fragment,{children:[l.jsx(tt,{onClick:()=>t.chain().focus().toggleHeading({level:1}).run(),isActive:t.isActive("heading",{level:1}),title:"Título 1",children:l.jsx(k.Heading1,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleHeading({level:2}).run(),isActive:t.isActive("heading",{level:2}),title:"Título 2",children:l.jsx(k.Heading2,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleHeading({level:3}).run(),isActive:t.isActive("heading",{level:3}),title:"Título 3",children:l.jsx(k.Heading3,{className:"h-4 w-4"})}),l.jsx(Hn,{orientation:"vertical",className:"h-6 mx-1"})]}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleBold().run(),isActive:t.isActive("bold"),title:"Negrito",children:l.jsx(k.Bold,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleItalic().run(),isActive:t.isActive("italic"),title:"Itálico",children:l.jsx(k.Italic,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleUnderline().run(),isActive:t.isActive("underline"),title:"Sublinhado",children:l.jsx(k.Underline,{className:"h-4 w-4"})}),e==="full"&&l.jsx(tt,{onClick:()=>t.chain().focus().toggleStrike().run(),isActive:t.isActive("strike"),title:"Tachado",children:l.jsx(k.Strikethrough,{className:"h-4 w-4"})}),l.jsx(Hn,{orientation:"vertical",className:"h-6 mx-1"}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleBulletList().run(),isActive:t.isActive("bulletList"),title:"Lista com marcadores",children:l.jsx(k.List,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleOrderedList().run(),isActive:t.isActive("orderedList"),title:"Lista numerada",children:l.jsx(k.ListOrdered,{className:"h-4 w-4"})}),e==="full"&&l.jsxs(l.Fragment,{children:[l.jsx(tt,{onClick:()=>t.chain().focus().setTextAlign("left").run(),isActive:t.isActive({textAlign:"left"}),title:"Alinhar à esquerda",children:l.jsx(k.AlignLeft,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().setTextAlign("center").run(),isActive:t.isActive({textAlign:"center"}),title:"Centralizar",children:l.jsx(k.AlignCenter,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().setTextAlign("right").run(),isActive:t.isActive({textAlign:"right"}),title:"Alinhar à direita",children:l.jsx(k.AlignRight,{className:"h-4 w-4"})})]}),l.jsx(Hn,{orientation:"vertical",className:"h-6 mx-1"}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleBlockquote().run(),isActive:t.isActive("blockquote"),title:"Citação",children:l.jsx(k.Quote,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:n,isActive:t.isActive("link"),title:"Link",children:l.jsx(k.Link,{className:"h-4 w-4"})}),e==="full"&&l.jsx(tt,{onClick:r,title:"Imagem",children:l.jsx(k.Image,{className:"h-4 w-4"})})]})};function sD({content:t="",onChange:e,placeholder:n="Comece a escrever...",variant:r="simple",className:a,readOnly:i=!1,label:s}){var c,d;const o=I.useMemo(()=>[Og.configure({heading:{levels:[1,2,3]}}),Pg.configure({HTMLAttributes:{class:"rounded-lg border shadow-sm max-w-full"}}),nD.configure({placeholder:n}),aD.configure({types:["heading","paragraph"]})],[n]),f=ig({extensions:o,content:t,editable:!i,onUpdate:({editor:u})=>{e==null||e(u.getHTML())},editorProps:{attributes:{class:w("prose prose-stone dark:prose-invert max-w-none focus:outline-none","prose-headings:font-semibold prose-headings:tracking-tight","prose-h1:text-3xl prose-h2:text-2xl prose-h3:text-xl","prose-p:leading-7 prose-p:my-3","prose-blockquote:border-l-4 prose-blockquote:border-primary/50 prose-blockquote:pl-4 prose-blockquote:italic","prose-ul:list-disc prose-ul:pl-6 prose-ol:list-decimal prose-ol:pl-6","prose-img:rounded-lg prose-img:shadow-md prose-img:my-6",r==="full"?"min-h-[400px] p-8":"min-h-[120px] px-3 py-2")}}});return f?l.jsxs("div",{className:w("flex flex-col w-full",a),children:[s&&l.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:s}),l.jsxs("div",{className:w("border rounded-lg bg-background overflow-hidden transition-shadow focus-within:ring-2 focus-within:ring-primary/20",i&&"opacity-80 bg-muted/30 pointer-events-none border-transparent"),children:[!i&&l.jsx(iD,{editor:f,variant:r}),l.jsx("div",{className:w("bg-background relative",r==="full"?"bg-white dark:bg-zinc-950":""),children:l.jsx(od,{editor:f})})]}),!i&&r==="full"&&l.jsxs("div",{className:"text-xs text-muted-foreground mt-1.5 text-right px-1",children:[((d=(c=f.storage.characterCount)==null?void 0:c.words)==null?void 0:d.call(c))||0," palavras"]})]}):null}function oD({...t}){return l.jsx(Kn.Drawer.Root,{"data-slot":"drawer",...t})}const T2=I.forwardRef(({...t},e)=>l.jsx(Kn.Drawer.Trigger,{ref:e,"data-slot":"drawer-trigger",...t}));T2.displayName="DrawerTrigger";function lD({...t}){return l.jsx(Kn.Drawer.Portal,{"data-slot":"drawer-portal",...t})}const I2=I.forwardRef(({...t},e)=>l.jsx(Kn.Drawer.Close,{ref:e,"data-slot":"drawer-close",...t}));I2.displayName="DrawerClose";const D2=I.forwardRef(({className:t,...e},n)=>l.jsx(Kn.Drawer.Overlay,{ref:n,"data-slot":"drawer-overlay",className:w("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e}));D2.displayName="DrawerOverlay";const E2=I.forwardRef(({className:t,children:e,...n},r)=>l.jsxs(lD,{"data-slot":"drawer-portal",children:[l.jsx(D2,{}),l.jsxs(Kn.Drawer.Content,{ref:r,"data-slot":"drawer-content",className:w("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",t),...n,children:[l.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e]})]}));E2.displayName="DrawerContent";function fD({className:t,...e}){return l.jsx("div",{"data-slot":"drawer-header",className:w("flex flex-col gap-1.5 p-4",t),...e})}function cD({className:t,...e}){return l.jsx("div",{"data-slot":"drawer-footer",className:w("mt-auto flex flex-col gap-2 p-4",t),...e})}const A2=I.forwardRef(({className:t,...e},n)=>l.jsx(Kn.Drawer.Title,{ref:n,"data-slot":"drawer-title",className:w("text-foreground font-semibold leading-[1.2]",t),...e}));A2.displayName="DrawerTitle";const z2=I.forwardRef(({className:t,...e},n)=>l.jsx(Kn.Drawer.Description,{ref:n,"data-slot":"drawer-description",className:w("text-muted-foreground text-sm leading-relaxed",t),...e}));z2.displayName="DrawerDescription";function dD({value:t,options:e,onValueChange:n,onCancel:r,disabled:a=!1,variant:i="default",confirmTitle:s="Confirmar alteração",confirmDescription:o="Tem certeza que deseja alterar este valor?",confirmButtonText:f="Confirmar",cancelButtonText:c="Cancelar",skipConfirmation:d=!1,isLoading:u=!1,renderValue:p,className:h,...m},g){const[b,x]=I.useState(null),[v,j]=I.useState(!1),[y,L]=I.useState(!1),[C,N]=I.useState(!1),S=I.useMemo(()=>e.find(E=>E.value===t),[e,t]),T=I.useMemo(()=>b!=null?e.find(E=>E.value===b):null,[e,b]),z=I.useCallback(E=>{if(E===t){L(!1);return}x(E),L(!1),d?P(E):j(!0)},[t,d]),P=I.useCallback(async E=>{const G=E??b;if(G!=null){N(!0);try{await n(G),j(!1),x(null)}catch(Z){console.error("Error confirming value change:",Z)}finally{N(!1)}}},[b,n]),U=I.useCallback(()=>{j(!1),x(null),r==null||r()},[r]),J=I.useCallback(()=>p&&S?p(t,S):S?l.jsxs(l.Fragment,{children:[S.icon,S.label]}):t,[p,t,S]),Y=(S==null?void 0:S.variant)||i,K=S==null?void 0:S.className;return a?l.jsx("div",{ref:g,className:w("inline-flex",h),...m,children:l.jsx(pe,{variant:Y,className:K,children:J()})}):l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:g,className:w("inline-flex",h),...m,children:l.jsxs(Hi,{open:y,onOpenChange:L,children:[l.jsx(Fi,{asChild:!0,disabled:u,children:l.jsxs(pe,{variant:Y,className:w("cursor-pointer hover:opacity-80 transition-opacity gap-1.5",u&&"opacity-50 cursor-not-allowed",K),children:[J(),!u&&l.jsx(k.ChevronDown,{className:"h-3 w-3"})]})}),l.jsx(Ui,{align:"start",className:"w-48",children:e.map(E=>l.jsxs(gr,{onClick:()=>z(E.value),className:"gap-2",children:[E.icon&&l.jsx("span",{className:"w-4 h-4",children:E.icon}),l.jsx("span",{className:"flex-1",children:E.label}),E.value===t&&l.jsx(k.Check,{className:"h-4 w-4 text-primary"})]},String(E.value)))})]})}),l.jsx(_i,{open:v,onOpenChange:j,children:l.jsxs(Ji,{children:[l.jsxs(Vi,{children:[l.jsx(Gi,{children:s}),l.jsx(Yi,{children:o})]}),T&&l.jsxs("div",{className:"flex items-center gap-3 py-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"De:"}),l.jsxs(pe,{variant:(S==null?void 0:S.variant)||i,className:S==null?void 0:S.className,children:[S==null?void 0:S.icon,(S==null?void 0:S.label)||t]})]}),l.jsx("span",{className:"text-muted-foreground",children:"→"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"Para:"}),l.jsxs(pe,{variant:T.variant||i,className:T.className,children:[T.icon,T.label]})]})]}),l.jsxs(Zo,{children:[l.jsx(F,{variant:"outline",onClick:U,disabled:C,children:c}),l.jsx(F,{onClick:()=>P(),disabled:C,children:C?"Confirmando...":f})]})]})})]})}const O2=I.forwardRef(dD);O2.displayName="EditableBadge";function P2({className:t,...e}){return l.jsx(Yo.Root,{"data-slot":"tabs",className:w("flex flex-col gap-2",t),...e})}function R2({className:t,...e}){return l.jsx(Yo.List,{"data-slot":"tabs-list",className:w("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-xl p-[3px] flex",t),...e})}function _s({className:t,...e}){return l.jsx(Yo.Trigger,{"data-slot":"tabs-trigger",className:w("data-[state=active]:bg-card dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-xl border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...e})}function uD({className:t,...e}){return l.jsx(Yo.Content,{"data-slot":"tabs-content",className:w("flex-1 outline-none",t),...e})}const B2=M.createContext({dragDropManager:void 0});function St(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Yp=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Qp=function(){return Math.random().toString(36).substring(7).split("").join(".")},Wp={INIT:"@@redux/INIT"+Qp(),REPLACE:"@@redux/REPLACE"+Qp()};function hD(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function pD(t){if(t===void 0)return"undefined";if(t===null)return"null";var e=typeof t;switch(e){case"boolean":case"string":case"number":case"symbol":case"function":return e}if(Array.isArray(t))return"array";if(bD(t))return"date";if(gD(t))return"error";var n=mD(t);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return e.slice(8,-1).toLowerCase().replace(/\s/g,"")}function mD(t){return typeof t.constructor=="function"?t.constructor.name:null}function gD(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function bD(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function Zr(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=pD(t)),e}function H2(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?St(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?St(1):"Expected the enhancer to be a function. Instead, received: '"+Zr(n)+"'");return n(H2)(t,e)}if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?St(2):"Expected the root reducer to be a function. Instead, received: '"+Zr(t)+"'");var a=t,i=e,s=[],o=s,f=!1;function c(){o===s&&(o=s.slice())}function d(){if(f)throw new Error(process.env.NODE_ENV==="production"?St(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function u(g){if(typeof g!="function")throw new Error(process.env.NODE_ENV==="production"?St(4):"Expected the listener to be a function. Instead, received: '"+Zr(g)+"'");if(f)throw new Error(process.env.NODE_ENV==="production"?St(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var b=!0;return c(),o.push(g),function(){if(b){if(f)throw new Error(process.env.NODE_ENV==="production"?St(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,c();var v=o.indexOf(g);o.splice(v,1),s=null}}}function p(g){if(!hD(g))throw new Error(process.env.NODE_ENV==="production"?St(7):"Actions must be plain objects. Instead, the actual type was: '"+Zr(g)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof g.type>"u")throw new Error(process.env.NODE_ENV==="production"?St(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(f)throw new Error(process.env.NODE_ENV==="production"?St(9):"Reducers may not dispatch actions.");try{f=!0,i=a(i,g)}finally{f=!1}for(var b=s=o,x=0;x<b.length;x++){var v=b[x];v()}return g}function h(g){if(typeof g!="function")throw new Error(process.env.NODE_ENV==="production"?St(10):"Expected the nextReducer to be a function. Instead, received: '"+Zr(g));a=g,p({type:Wp.REPLACE})}function m(){var g,b=u;return g={subscribe:function(v){if(typeof v!="object"||v===null)throw new Error(process.env.NODE_ENV==="production"?St(11):"Expected the observer to be an object. Instead, received: '"+Zr(v)+"'");function j(){v.next&&v.next(d())}j();var y=b(j);return{unsubscribe:y}}},g[Yp]=function(){return this},g}return p({type:Wp.INIT}),r={dispatch:p,subscribe:u,getState:d,replaceReducer:h},r[Yp]=m,r}function ne(t,e,...n){if(xD()&&e===void 0)throw new Error("invariant requires an error message argument");if(!t){let r;if(e===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let a=0;r=new Error(e.replace(/%s/g,function(){return n[a++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function xD(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function yD(t,e,n){return e.split(".").reduce((r,a)=>r&&r[a]?r[a]:n||null,t)}function vD(t,e){return t.filter(n=>n!==e)}function F2(t){return typeof t=="object"}function wD(t,e){const n=new Map,r=i=>{n.set(i,n.has(i)?n.get(i)+1:1)};t.forEach(r),e.forEach(r);const a=[];return n.forEach((i,s)=>{i===1&&a.push(s)}),a}function MD(t,e){return t.filter(n=>e.indexOf(n)>-1)}const iu="dnd-core/INIT_COORDS",Sl="dnd-core/BEGIN_DRAG",su="dnd-core/PUBLISH_DRAG_SOURCE",Tl="dnd-core/HOVER",Il="dnd-core/DROP",Dl="dnd-core/END_DRAG";function $p(t,e){return{type:iu,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const jD={type:iu,payload:{clientOffset:null,sourceClientOffset:null}};function CD(t){return function(n=[],r={publishSource:!0}){const{publishSource:a=!0,clientOffset:i,getSourceClientOffset:s}=r,o=t.getMonitor(),f=t.getRegistry();t.dispatch($p(i)),LD(n,o,f);const c=SD(n,o);if(c==null){t.dispatch(jD);return}let d=null;if(i){if(!s)throw new Error("getSourceClientOffset must be defined");ND(s),d=s(c)}t.dispatch($p(i,d));const p=f.getSource(c).beginDrag(o,c);if(p==null)return;kD(p),f.pinSource(c);const h=f.getSourceType(c);return{type:Sl,payload:{itemType:h,item:p,sourceId:c,clientOffset:i||null,sourceClientOffset:d||null,isSourcePublic:!!a}}}}function LD(t,e,n){ne(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){ne(n.getSource(r),"Expected sourceIds to be registered.")})}function ND(t){ne(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function kD(t){ne(F2(t),"Item must be an object.")}function SD(t,e){let n=null;for(let r=t.length-1;r>=0;r--)if(e.canDragSource(t[r])){n=t[r];break}return n}function TD(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ID(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){TD(t,a,n[a])})}return t}function DD(t){return function(n={}){const r=t.getMonitor(),a=t.getRegistry();ED(r),OD(r).forEach((s,o)=>{const f=AD(s,o,a,r),c={type:Il,payload:{dropResult:ID({},n,f)}};t.dispatch(c)})}}function ED(t){ne(t.isDragging(),"Cannot call drop while not dragging."),ne(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function AD(t,e,n,r){const a=n.getTarget(t);let i=a?a.drop(r,t):void 0;return zD(i),typeof i>"u"&&(i=e===0?{}:r.getDropResult()),i}function zD(t){ne(typeof t>"u"||F2(t),"Drop result must either be an object or undefined.")}function OD(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function PD(t){return function(){const n=t.getMonitor(),r=t.getRegistry();RD(n);const a=n.getSourceId();return a!=null&&(r.getSource(a,!0).endDrag(n,a),r.unpinSource()),{type:Dl}}}function RD(t){ne(t.isDragging(),"Cannot call endDrag while not dragging.")}function xc(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function BD(t){return function(n,{clientOffset:r}={}){HD(n);const a=n.slice(0),i=t.getMonitor(),s=t.getRegistry(),o=i.getItemType();return UD(a,s,o),FD(a,i,s),_D(a,i,s),{type:Tl,payload:{targetIds:a,clientOffset:r||null}}}}function HD(t){ne(Array.isArray(t),"Expected targetIds to be an array.")}function FD(t,e,n){ne(e.isDragging(),"Cannot call hover while not dragging."),ne(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r<t.length;r++){const a=t[r];ne(t.lastIndexOf(a)===r,"Expected targetIds to be unique in the passed array.");const i=n.getTarget(a);ne(i,"Expected targetIds to be registered.")}}function UD(t,e,n){for(let r=t.length-1;r>=0;r--){const a=t[r],i=e.getTargetType(a);xc(i,n)||t.splice(r,1)}}function _D(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function JD(t){return function(){if(t.getMonitor().isDragging())return{type:su}}}function VD(t){return{beginDrag:CD(t),publishDragSource:JD(t),hover:BD(t),drop:DD(t),endDrag:PD(t)}}class GD{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:n}=this.store;function r(i){return(...s)=>{const o=i.apply(e,s);typeof o<"u"&&n(o)}}const a=VD(this);return Object.keys(a).reduce((i,s)=>{const o=a[s];return i[s]=r(o),i},{})}dispatch(e){this.store.dispatch(e)}constructor(e,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}}function YD(t,e){return{x:t.x+e.x,y:t.y+e.y}}function U2(t,e){return{x:t.x-e.x,y:t.y-e.y}}function QD(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:U2(YD(e,r),n)}function WD(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:U2(e,n)}const hi=[],ou=[];hi.__IS_NONE__=!0;ou.__IS_ALL__=!0;function $D(t,e){return t===hi?!1:t===ou||typeof e>"u"?!0:MD(e,t).length>0}class ZD{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;ne(typeof e=="function","listener must be a function."),ne(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const i=()=>{const s=this.store.getState(),o=s.stateId;try{o===a||o===a+1&&!$D(s.dirtyHandlerIds,r)||e()}finally{a=o}};return this.store.subscribe(i)}subscribeToOffsetChange(e){ne(typeof e=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const a=this.store.getState().dragOffset;a!==n&&(n=a,e())};return this.store.subscribe(r)}canDragSource(e){if(!e)return!1;const n=this.registry.getSource(e);return ne(n,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:n.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const n=this.registry.getTarget(e);if(ne(n,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(e),a=this.getItemType();return xc(r,a)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(ne(n,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(e),a=this.getItemType();return r!==a?!1:n.isDragging(this,e)}isOverTarget(e,n={shallow:!1}){if(!e)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const a=this.registry.getTargetType(e),i=this.getItemType();if(i&&!xc(a,i))return!1;const s=this.getTargetIds();if(!s.length)return!1;const o=s.indexOf(e);return r?o===s.length-1:o>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return QD(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return WD(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const Zp=typeof global<"u"?global:self,_2=Zp.MutationObserver||Zp.WebKitMutationObserver;function J2(t){return function(){const n=setTimeout(a,0),r=setInterval(a,50);function a(){clearTimeout(n),clearInterval(r),t()}}}function qD(t){let e=1;const n=new _2(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const KD=typeof _2=="function"?qD:J2;class XD{enqueueTask(e){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const n=this.index;if(this.index++,e[n].call(),this.index>this.capacity){for(let r=0,a=e.length-this.index;r<a;r++)e[r]=e[r+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=KD(this.flush),this.requestErrorThrow=J2(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class eE{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}class tE{create(e){const n=this.freeTasks,r=n.length?n.pop():new eE(this.onError,a=>n[n.length]=a);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const V2=new XD,nE=new tE(V2.registerPendingError);function rE(t){V2.enqueueTask(nE.create(t))}const lu="dnd-core/ADD_SOURCE",fu="dnd-core/ADD_TARGET",cu="dnd-core/REMOVE_SOURCE",El="dnd-core/REMOVE_TARGET";function aE(t){return{type:lu,payload:{sourceId:t}}}function iE(t){return{type:fu,payload:{targetId:t}}}function sE(t){return{type:cu,payload:{sourceId:t}}}function oE(t){return{type:El,payload:{targetId:t}}}function lE(t){ne(typeof t.canDrag=="function","Expected canDrag to be a function."),ne(typeof t.beginDrag=="function","Expected beginDrag to be a function."),ne(typeof t.endDrag=="function","Expected endDrag to be a function.")}function fE(t){ne(typeof t.canDrop=="function","Expected canDrop to be a function."),ne(typeof t.hover=="function","Expected hover to be a function."),ne(typeof t.drop=="function","Expected beginDrag to be a function.")}function yc(t,e){if(e&&Array.isArray(t)){t.forEach(n=>yc(n,!1));return}ne(typeof t=="string"||typeof t=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var At;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(At||(At={}));let cE=0;function dE(){return cE++}function uE(t){const e=dE().toString();switch(t){case At.SOURCE:return`S${e}`;case At.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function qp(t){switch(t[0]){case"S":return At.SOURCE;case"T":return At.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function Kp(t,e){const n=t.entries();let r=!1;do{const{done:a,value:[,i]}=n.next();if(i===e)return!0;r=!!a}while(!r);return!1}class hE{addSource(e,n){yc(e),lE(n);const r=this.addHandler(At.SOURCE,e,n);return this.store.dispatch(aE(r)),r}addTarget(e,n){yc(e,!0),fE(n);const r=this.addHandler(At.TARGET,e,n);return this.store.dispatch(iE(r)),r}containsHandler(e){return Kp(this.dragSources,e)||Kp(this.dropTargets,e)}getSource(e,n=!1){return ne(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return ne(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return ne(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return ne(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return qp(e)===At.SOURCE}isTargetId(e){return qp(e)===At.TARGET}removeSource(e){ne(this.getSource(e),"Expected an existing source."),this.store.dispatch(sE(e)),rE(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){ne(this.getTarget(e),"Expected an existing target."),this.store.dispatch(oE(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);ne(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){ne(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const a=uE(e);return this.types.set(a,n),e===At.SOURCE?this.dragSources.set(a,r):e===At.TARGET&&this.dropTargets.set(a,r),a}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const pE=(t,e)=>t===e;function mE(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function gE(t,e,n=pE){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!n(t[r],e[r]))return!1;return!0}function bE(t=hi,e){switch(e.type){case Tl:break;case lu:case fu:case El:case cu:return hi;case Sl:case su:case Dl:case Il:default:return ou}const{targetIds:n=[],prevTargetIds:r=[]}=e.payload,a=wD(n,r);if(!(a.length>0||!gE(n,r)))return hi;const s=r[r.length-1],o=n[n.length-1];return s!==o&&(s&&a.push(s),o&&a.push(o)),a}function xE(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yE(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){xE(t,a,n[a])})}return t}const Xp={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function vE(t=Xp,e){const{payload:n}=e;switch(e.type){case iu:case Sl:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Tl:return mE(t.clientOffset,n.clientOffset)?t:yE({},t,{clientOffset:n.clientOffset});case Dl:case Il:return Xp;default:return t}}function wE(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){wE(t,a,n[a])})}return t}const ME={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function jE(t=ME,e){const{payload:n}=e;switch(e.type){case Sl:return qr({},t,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case su:return qr({},t,{isSourcePublic:!0});case Tl:return qr({},t,{targetIds:n.targetIds});case El:return t.targetIds.indexOf(n.targetId)===-1?t:qr({},t,{targetIds:vD(t.targetIds,n.targetId)});case Il:return qr({},t,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Dl:return qr({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function CE(t=0,e){switch(e.type){case lu:case fu:return t+1;case cu:case El:return t-1;default:return t}}function LE(t=0){return t+1}function NE(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kE(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){NE(t,a,n[a])})}return t}function SE(t={},e){return{dirtyHandlerIds:bE(t.dirtyHandlerIds,{type:e.type,payload:kE({},e.payload,{prevTargetIds:yD(t,"dragOperation.targetIds",[])})}),dragOffset:vE(t.dragOffset,e),refCount:CE(t.refCount,e),dragOperation:jE(t.dragOperation,e),stateId:LE(t.stateId)}}function TE(t,e=void 0,n={},r=!1){const a=IE(r),i=new ZD(a,new hE(a)),s=new GD(a,i),o=t(s,e,n);return s.receiveBackend(o),s}function IE(t){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return H2(SE,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function DE(t,e){if(t==null)return{};var n=EE(t,e),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function EE(t,e){if(t==null)return{};var n={},r=Object.keys(t),a,i;for(i=0;i<r.length;i++)a=r[i],!(e.indexOf(a)>=0)&&(n[a]=t[a]);return n}let e0=0;const Js=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var G2=M.memo(function(e){var{children:n}=e,r=DE(e,["children"]);const[a,i]=AE(r);return M.useEffect(()=>{if(i){const s=Y2();return++e0,()=>{--e0===0&&(s[Js]=null)}}},[]),l.jsx(B2.Provider,{value:a,children:n})});function AE(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=zE(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function zE(t,e=Y2(),n,r){const a=e;return a[Js]||(a[Js]={dragDropManager:TE(t,e,n,r)}),a[Js]}function Y2(){return typeof global<"u"?global:window}function OE(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xf,t0;function PE(){return t0||(t0=1,xf=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,a,i;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(a=r;a--!==0;)if(!t(e[a],n[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(n).length)return!1;for(a=r;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[a]))return!1;for(a=r;a--!==0;){var s=i[a];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n}),xf}var RE=PE();const BE=OE(RE),Ir=typeof window<"u"?M.useLayoutEffect:M.useEffect;function HE(t,e,n){const[r,a]=M.useState(()=>e(t)),i=M.useCallback(()=>{const s=e(t);BE(r,s)||(a(s),n&&n())},[r,t,n]);return Ir(i),[r,i]}function FE(t,e,n){const[r,a]=HE(t,e,n);return Ir(function(){const s=t.getHandlerId();if(s!=null)return t.subscribeToStateChange(a,{handlerIds:[s]})},[t,a]),r}function Q2(t,e,n){return FE(e,t||(()=>({})),()=>n.reconnect())}function W2(t,e){const n=[...e||[]];return e==null&&typeof t!="function"&&n.push(t),M.useMemo(()=>typeof t=="function"?t():t,n)}function UE(t){return M.useMemo(()=>t.hooks.dragSource(),[t])}function _E(t){return M.useMemo(()=>t.hooks.dragPreview(),[t])}let yf=!1,vf=!1;class JE{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){ne(!yf,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return yf=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{yf=!1}}isDragging(){if(!this.sourceId)return!1;ne(!vf,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return vf=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{vf=!1}}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,n){return this.internalMonitor.isOverTarget(e,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let wf=!1;class VE{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;ne(!wf,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return wf=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{wf=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function GE(t,e,n){const r=n.getRegistry(),a=r.addTarget(t,e);return[a,()=>r.removeTarget(a)]}function YE(t,e,n){const r=n.getRegistry(),a=r.addSource(t,e);return[a,()=>r.removeSource(a)]}function vc(t,e,n,r){let a;if(a!==void 0)return!!a;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;const i=Object.keys(t),s=Object.keys(e);if(i.length!==s.length)return!1;const o=Object.prototype.hasOwnProperty.bind(e);for(let f=0;f<i.length;f++){const c=i[f];if(!o(c))return!1;const d=t[c],u=e[c];if(a=void 0,a===!1||a===void 0&&d!==u)return!1}return!0}function wc(t){return t!==null&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function QE(t){if(typeof t.type=="string")return;const e=t.type.displayName||t.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function WE(t){return(e=null,n=null)=>{if(!M.isValidElement(e)){const i=e;return t(i,n),i}const r=e;return QE(r),$E(r,n?i=>t(i,n):t)}}function $2(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const a=WE(r);e[n]=()=>a}}),e}function n0(t,e){typeof t=="function"?t(e):t.current=e}function $E(t,e){const n=t.ref;return ne(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?M.cloneElement(t,{ref:r=>{n0(n,r),n0(e,r)}}):M.cloneElement(t,{ref:e})}class ZE{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?e?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),n):(this.lastConnectedDragSource=e,n):n}reconnectDragPreview(e=!1){const n=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!vc(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!vc(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=$2({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,wc(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,wc(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class qE{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!vc(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=$2({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,wc(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function Ia(){const{dragDropManager:t}=M.useContext(B2);return ne(t!=null,"Expected drag drop context"),t}function KE(t,e){const n=Ia(),r=M.useMemo(()=>new ZE(n.getBackend()),[n]);return Ir(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),Ir(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function XE(){const t=Ia();return M.useMemo(()=>new JE(t),[t])}class e5{beginDrag(){const e=this.spec,n=this.monitor;let r=null;return typeof e.item=="object"?r=e.item:typeof e.item=="function"?r=e.item(n):r={},r??null}canDrag(){const e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(n):!0}isDragging(e,n){const r=this.spec,a=this.monitor,{isDragging:i}=r;return i?i(a):n===e.getSourceId()}endDrag(){const e=this.spec,n=this.monitor,r=this.connector,{end:a}=e;a&&a(n.getItem(),n),r.reconnect()}constructor(e,n,r){this.spec=e,this.monitor=n,this.connector=r}}function t5(t,e,n){const r=M.useMemo(()=>new e5(t,e,n),[e,n]);return M.useEffect(()=>{r.spec=t},[t]),r}function n5(t){return M.useMemo(()=>{const e=t.type;return ne(e!=null,"spec.type must be defined"),e},[t])}function r5(t,e,n){const r=Ia(),a=t5(t,e,n),i=n5(t);Ir(function(){if(i!=null){const[o,f]=YE(i,a,r);return e.receiveHandlerId(o),n.receiveHandlerId(o),f}},[r,e,n,a,i])}function a5(t,e){const n=W2(t,e);ne(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=XE(),a=KE(n.options,n.previewOptions);return r5(n,r,a),[Q2(n.collect,r,a),UE(a),_E(a)]}function i5(t){return M.useMemo(()=>t.hooks.dropTarget(),[t])}function s5(t){const e=Ia(),n=M.useMemo(()=>new qE(e.getBackend()),[e]);return Ir(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function o5(){const t=Ia();return M.useMemo(()=>new VE(t),[t])}function l5(t){const{accept:e}=t;return M.useMemo(()=>(ne(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class f5{canDrop(){const e=this.spec,n=this.monitor;return e.canDrop?e.canDrop(n.getItem(),n):!0}hover(){const e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}drop(){const e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}constructor(e,n){this.spec=e,this.monitor=n}}function c5(t,e){const n=M.useMemo(()=>new f5(t,e),[e]);return M.useEffect(()=>{n.spec=t},[t]),n}function d5(t,e,n){const r=Ia(),a=c5(t,e),i=l5(t);Ir(function(){const[o,f]=GE(i,a,r);return e.receiveHandlerId(o),n.receiveHandlerId(o),f},[r,e,a,n,i.map(s=>s.toString()).join("|")])}function du(t,e){const n=W2(t,e),r=o5(),a=s5(n.options);return d5(n,r,a),[Q2(n.collect,r,a),i5(a)]}function Z2(t){let e=null;return()=>(e==null&&(e=t()),e)}function u5(t,e){return t.filter(n=>n!==e)}function h5(t,e){const n=new Set,r=i=>n.add(i);t.forEach(r),e.forEach(r);const a=[];return n.forEach(i=>a.push(i)),a}class p5{enter(e){const n=this.entered.length,r=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(e));return this.entered=h5(this.entered.filter(r),[e]),n===0&&this.entered.length>0}leave(e){const n=this.entered.length;return this.entered=u5(this.entered.filter(this.isNodeInDocument),e),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class m5{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const a=this.config.exposeProperties[r];a!=null&&(n[r]={value:a(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,n){return n===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const q2="__NATIVE_FILE__",K2="__NATIVE_URL__",X2="__NATIVE_TEXT__",e4="__NATIVE_HTML__",r0=Object.freeze(Object.defineProperty({__proto__:null,FILE:q2,HTML:e4,TEXT:X2,URL:K2},Symbol.toStringTag,{value:"Module"}));function Mf(t,e,n){const r=e.reduce((a,i)=>a||t.getData(i),"");return r??n}const Mc={[q2]:{exposeProperties:{files:t=>Array.prototype.slice.call(t.files),items:t=>t.items,dataTransfer:t=>t},matchesTypes:["Files"]},[e4]:{exposeProperties:{html:(t,e)=>Mf(t,e,""),dataTransfer:t=>t},matchesTypes:["Html","text/html"]},[K2]:{exposeProperties:{urls:(t,e)=>Mf(t,e,"").split(`
|
|
222
222
|
`),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[X2]:{exposeProperties:{text:(t,e)=>Mf(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function g5(t,e){const n=Mc[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new m5(n);return r.loadDataTransfer(e),r}function jf(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(Mc).filter(n=>{const r=Mc[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(a=>e.indexOf(a)>-1):!1})[0]||null}const b5=Z2(()=>/firefox/i.test(navigator.userAgent)),t4=Z2(()=>!!window.safari);class a0{interpolate(e){const{xs:n,ys:r,c1s:a,c2s:i,c3s:s}=this;let o=n.length-1;if(e===n[o])return r[o];let f=0,c=s.length-1,d;for(;f<=c;){d=Math.floor(.5*(f+c));const h=n[d];if(h<e)f=d+1;else if(h>e)c=d-1;else return r[d]}o=Math.max(0,c);const u=e-n[o],p=u*u;return r[o]+a[o]*u+i[o]*p+s[o]*u*p}constructor(e,n){const{length:r}=e,a=[];for(let h=0;h<r;h++)a.push(h);a.sort((h,m)=>e[h]<e[m]?-1:1);const i=[],s=[];let o,f;for(let h=0;h<r-1;h++)o=e[h+1]-e[h],f=n[h+1]-n[h],i.push(o),s.push(f/o);const c=[s[0]];for(let h=0;h<i.length-1;h++){const m=s[h],g=s[h+1];if(m*g<=0)c.push(0);else{o=i[h];const b=i[h+1],x=o+b;c.push(3*x/((x+b)/m+(x+o)/g))}}c.push(s[s.length-1]);const d=[],u=[];let p;for(let h=0;h<c.length-1;h++){p=s[h];const m=c[h],g=1/i[h],b=m+c[h+1]-p-p;d.push((p-m-b)*g),u.push(b*g*g)}this.xs=e,this.ys=n,this.c1s=c,this.c2s=d,this.c3s=u}}const x5=1;function n4(t){const e=t.nodeType===x5?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function Ds(t){return{x:t.clientX,y:t.clientY}}function y5(t){var e;return t.nodeName==="IMG"&&(b5()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function v5(t,e,n,r){let a=t?e.width:n,i=t?e.height:r;return t4()&&t&&(i/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:i}}function w5(t,e,n,r,a){const i=y5(e),o=n4(i?t:e),f={x:n.x-o.x,y:n.y-o.y},{offsetWidth:c,offsetHeight:d}=t,{anchorX:u,anchorY:p}=r,{dragPreviewWidth:h,dragPreviewHeight:m}=v5(i,e,c,d),g=()=>{let C=new a0([0,.5,1],[f.y,f.y/d*m,f.y+m-d]).interpolate(p);return t4()&&i&&(C+=(window.devicePixelRatio-1)*m),C},b=()=>new a0([0,.5,1],[f.x,f.x/c*h,f.x+h-c]).interpolate(u),{offsetX:x,offsetY:v}=a,j=x===0||x,y=v===0||v;return{x:j?x:b(),y:y?v:g()}}class M5{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,n){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=n}}function j5(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i0(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){j5(t,a,n[a])})}return t}class C5{profile(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,n,r){this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);const a=s=>this.handleDragStart(s,e),i=s=>this.handleSelectStart(s);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",a),n.addEventListener("selectstart",i),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",a),n.removeEventListener("selectstart",i),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=s=>this.handleDragEnter(s,e),a=s=>this.handleDragOver(s,e),i=s=>this.handleDrop(s,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",a),n.addEventListener("drop",i),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",a),n.removeEventListener("drop",i)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return i0({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(e);return i0({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(r0).some(n=>r0[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=g5(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(e,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(e,n){this.dropTargetIds.unshift(n)}constructor(e,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=a=>{const i=this.sourceNodes.get(a);return i&&n4(i)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=a=>!!(a&&this.document&&this.document.body&&this.document.body.contains(a)),this.endDragIfSourceWasRemovedFromDOM=()=>{const a=this.currentDragSourceNode;a==null||this.isNodeInDocument(a)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=a=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(a||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=a=>{if(a.defaultPrevented)return;const{dragStartSourceIds:i}=this;this.dragStartSourceIds=null;const s=Ds(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(i||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:s});const{dataTransfer:o}=a,f=jf(o);if(this.monitor.isDragging()){if(o&&typeof o.setDragImage=="function"){const d=this.monitor.getSourceId(),u=this.sourceNodes.get(d),p=this.sourcePreviewNodes.get(d)||u;if(p){const{anchorX:h,anchorY:m,offsetX:g,offsetY:b}=this.getCurrentSourcePreviewNodeOptions(),j=w5(u,p,s,{anchorX:h,anchorY:m},{offsetX:g,offsetY:b});o.setDragImage(p,j.x,j.y)}}try{o==null||o.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(a.target);const{captureDraggingState:c}=this.getCurrentSourcePreviewNodeOptions();c?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(f)this.beginDragNativeItem(f);else{if(o&&!o.types&&(a.target&&!a.target.hasAttribute||!a.target.hasAttribute("draggable")))return;a.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=a=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}if(!this.enterLeaveCounter.enter(a.target)||this.monitor.isDragging())return;const{dataTransfer:o}=a,f=jf(o);f&&this.beginDragNativeItem(f,o)},this.handleTopDragEnter=a=>{const{dragEnterTargetIds:i}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=a.altKey,i.length>0&&this.actions.hover(i,{clientOffset:Ds(a)}),i.some(o=>this.monitor.canDropOnTarget(o))&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=a=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}},this.handleTopDragOver=a=>{const{dragOverTargetIds:i}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}this.altKeyPressed=a.altKey,this.lastClientOffset=Ds(a),this.scheduleHover(i),(i||[]).some(o=>this.monitor.canDropOnTarget(o))?(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?a.preventDefault():(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=a=>{this.isDraggingNativeItem()&&a.preventDefault(),this.enterLeaveCounter.leave(a.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=a=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var i;a.preventDefault(),(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}else jf(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:i}=this;this.dropTargetIds=[],this.actions.hover(i,{clientOffset:Ds(a)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=a=>{const i=a.target;typeof i.dragDrop=="function"&&(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName==="TEXTAREA"||i.isContentEditable||(a.preventDefault(),i.dragDrop()))},this.options=new M5(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new p5(this.isNodeInDocument)}}const r4=function(e,n,r){return new C5(e,n,r)},Bi={TASK:"task"},a4={instagram:k.Instagram,linkedin:k.Linkedin,facebook:k.Facebook,twitter:k.Twitter,youtube:k.Youtube,blog:k.Calendar,other:k.Calendar},Cf={instagram:"text-pink-600",linkedin:"text-blue-700",facebook:"text-blue-600",twitter:"text-sky-500",youtube:"text-red-600",blog:"text-orange-500",other:"text-gray-500"},jc={idea:"bg-gray-100 text-gray-600 border-gray-200",planned:"bg-blue-50 text-blue-600 border-blue-200","in-progress":"bg-yellow-50 text-yellow-600 border-yellow-200",approval:"bg-purple-50 text-purple-600 border-purple-200",scheduled:"bg-green-50 text-green-600 border-green-200",published:"bg-slate-800 text-white border-slate-700"},s0=["bg-blue-50 border-blue-100 text-blue-700","bg-green-50 border-green-100 text-green-700","bg-purple-50 border-purple-100 text-purple-700","bg-orange-50 border-orange-100 text-orange-700","bg-pink-50 border-pink-100 text-pink-700","bg-yellow-50 border-yellow-100 text-yellow-700"],o0=t=>{const e=t.split("").reduce((n,r)=>n+r.charCodeAt(0),0);return s0[e%s0.length]};function Al({task:t,view:e="month",mode:n="editorial",onClick:r,style:a}){var p;const[{isDragging:i},s]=a5(()=>({type:Bi.TASK,item:{id:t.id,type:Bi.TASK},collect:h=>({isDragging:!!h.isDragging()})}),[t.id]),o=t.channel?a4[t.channel]:k.Calendar,f=t.date?new Date(t.date):null,c=t.endDate?new Date(t.endDate):f?H.addHours(f,1):null,d=f?H.format(f,"HH:mm"):null,u=f&&c?`${H.format(f,"HH:mm")} - ${H.format(c,"HH:mm")}`:d;return n==="editorial"&&(e==="week"||e==="day")?l.jsxs("div",{ref:s,onClick:r,className:w("relative group cursor-pointer bg-white border rounded-md shadow-sm hover:shadow-md transition-all mb-3 overflow-hidden",i?"opacity-50":"opacity-100",t.status==="published"?"border-l-4 border-l-slate-800":"border-l-4 border-l-[#7F26BF]"),children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-gray-50/50",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(o,{size:14,className:w(t.channel?Cf[t.channel]:"text-gray-400")}),d&&l.jsx("span",{className:"text-xs font-medium text-gray-500",children:d})]}),l.jsx("div",{className:"opacity-0 group-hover:opacity-100 text-gray-400 cursor-grab",children:l.jsx(k.GripVertical,{size:14})})]}),t.imageUrl&&l.jsx("div",{className:"w-full aspect-video bg-gray-100 relative border-b",children:l.jsx("img",{src:t.imageUrl,alt:"",className:"w-full h-full object-cover"})}),l.jsxs("div",{className:"p-3",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-900 line-clamp-2 mb-2 leading-snug",children:t.title}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(pe,{variant:"outline",className:w("px-1.5 py-0 text-[10px] h-5 font-normal uppercase tracking-wide",jc[t.status]),children:t.status}),t.assignees&&t.assignees.length>0&&l.jsx("div",{className:"flex -space-x-2",children:t.assignees.slice(0,2).map((h,m)=>l.jsxs(Ft,{className:"w-5 h-5 border border-white",children:[l.jsx(Ln,{src:h.avatar}),l.jsx(Ut,{className:"text-[8px]",children:h.name[0]})]},m))})]})]})]}):n==="editorial"&&e==="month"?l.jsxs("div",{ref:s,onClick:r,className:w("relative group cursor-pointer bg-white border rounded-md shadow-sm hover:shadow-md transition-all mb-1 overflow-hidden flex items-center gap-2 p-1.5",i?"opacity-50":"opacity-100",t.status==="published"?"border-l-4 border-l-slate-800":"border-l-4 border-l-[#7F26BF]"),children:[t.imageUrl&&l.jsx("div",{className:"w-8 h-8 flex-shrink-0 bg-gray-100 rounded overflow-hidden",children:l.jsx("img",{src:t.imageUrl,alt:"",className:"w-full h-full object-cover"})}),l.jsx("div",{className:"min-w-0 flex-1",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(o,{size:12,className:w(t.channel?Cf[t.channel]:"text-gray-400")}),l.jsx("span",{className:"truncate font-medium text-xs",children:t.title})]})})]}):n==="execution"&&(e==="week"||e==="day")?l.jsxs("div",{ref:s,onClick:r,style:a,className:w("absolute z-10 rounded-md border shadow-sm p-1.5 text-xs flex flex-col overflow-hidden hover:overflow-visible hover:h-auto! hover:min-h-[min-content] hover:z-50 transition-all cursor-pointer group",i?"opacity-50":"opacity-100",t.color||o0(t.id)),children:[l.jsxs("div",{className:"flex items-center gap-1 mb-0.5 font-semibold opacity-75 text-[10px] leading-none",children:[l.jsx(k.Clock,{size:10}),l.jsx("span",{className:"truncate",children:u})]}),l.jsx("div",{className:"font-bold leading-tight mb-1 line-clamp-2 text-[11px]",children:t.title}),l.jsxs("div",{className:"mt-auto flex items-center justify-between pt-1",children:[l.jsx("div",{className:"flex -space-x-1.5",children:(p=t.assignees)==null?void 0:p.map((h,m)=>l.jsxs(Ft,{className:"w-4 h-4 border border-white",children:[l.jsx(Ln,{src:h.avatar}),l.jsx(Ut,{className:"text-[8px]",children:h.name[0]})]},m))}),t.status!=="published"&&l.jsx("div",{className:w("w-2 h-2 rounded-full",jc[t.status].split(" ")[1].replace("text-","bg-"))})]})]}):n==="execution"&&e==="month"?l.jsxs("div",{ref:s,onClick:r,className:w("relative group cursor-pointer rounded px-2 py-1 mb-1 text-xs truncate font-medium transition-all",i?"opacity-50":"opacity-100",t.color||o0(t.id).replace("bg-","bg-opacity-20 bg-")),children:[d," ",t.title]}):l.jsxs("div",{ref:s,onClick:r,className:w("relative group cursor-pointer bg-white border rounded-md shadow-sm hover:shadow-md transition-all mb-2 p-2 flex items-start gap-3",i?"opacity-50":"opacity-100",n==="editorial"&&(t.status==="published"?"border-l-4 border-l-slate-800":"border-l-4 border-l-[#7F26BF]")),children:[n==="editorial"&&t.imageUrl&&l.jsx("div",{className:"w-10 h-10 flex-shrink-0 bg-gray-100 rounded overflow-hidden",children:l.jsx("img",{src:t.imageUrl,alt:"",className:"w-full h-full object-cover"})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[n==="editorial"&&l.jsx(o,{size:12,className:w(t.channel?Cf[t.channel]:"text-gray-400")}),l.jsx("span",{className:"truncate font-medium text-sm",children:t.title})]}),l.jsx(pe,{variant:"secondary",className:"text-[10px] h-4 px-1 py-0",children:t.status})]})]})}function L5({days:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:a,view:i}){return l.jsx("div",{className:w("grid h-full min-h-[calc(100vh-200px)] bg-gray-50/30",i==="week"?"grid-cols-7 divide-x":"grid-cols-1 border-x"),children:t.map(s=>{const o=e.filter(f=>f.date&&H.isSameDay(new Date(f.date),s)).sort((f,c)=>f.date&&c.date?new Date(f.date).getTime()-new Date(c.date).getTime():0);return l.jsx(N5,{day:s,tasks:o,onDropTask:n,onTaskClick:r,onAddClick:a,isToday:H.isToday(s)},s.toISOString())})})}function N5({day:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:a,isToday:i}){const[{isOver:s},o]=du(()=>({accept:Bi.TASK,drop:f=>n(f.id,t),collect:f=>({isOver:!!f.isOver()})}),[t,n]);return l.jsxs("div",{ref:o,className:w("flex flex-col h-full min-h-0 transition-colors",s&&"bg-purple-50 ring-inset ring-2 ring-[#7F26BF]"),children:[l.jsxs("div",{className:w("p-2 text-center border-b bg-white sticky top-0 z-10",i&&"bg-purple-50/50"),children:[l.jsx("div",{className:"text-xs font-semibold uppercase text-gray-500 mb-1",children:H.format(t,"EEE")}),l.jsx("div",{className:w("w-8 h-8 rounded-full flex items-center justify-center mx-auto text-sm font-medium",i?"bg-[#7F26BF] text-white":"text-gray-900 bg-gray-100"),children:H.format(t,"d")})]}),l.jsxs("div",{className:"flex-1 p-2 space-y-3 overflow-y-auto",children:[l.jsxs(F,{variant:"outline",size:"sm",className:"w-full mb-2 justify-center px-1",onClick:()=>a(t),children:[l.jsx(k.Plus,{size:12,className:"flex-shrink-0"}),l.jsx("span",{className:"truncate ml-1.5 hidden xl:inline",children:"Add Post"}),l.jsx("span",{className:"truncate ml-1.5 inline xl:hidden",children:"Add"})]}),e.map(f=>l.jsx(Al,{task:f,view:"week",mode:"editorial",onClick:()=>r(f)},f.id))]})]})}function k5({days:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:a}){const i=Array.from({length:24},(s,o)=>o);return l.jsxs("div",{className:"flex h-full relative overflow-y-auto bg-white select-none",children:[l.jsxs("div",{className:"w-14 flex-shrink-0 border-r bg-white sticky left-0 z-30",children:[l.jsx("div",{className:"h-10 border-b bg-white sticky top-0 z-40 flex-shrink-0"})," ",i.map(s=>l.jsx("div",{className:"h-24 border-b text-right pr-2 pt-2 text-xs text-gray-400 font-medium relative",children:l.jsx("span",{className:"-top-2.5 relative",children:H.format(H.setHours(new Date,s),"ha")})},s))]}),l.jsxs("div",{className:"flex flex-1 min-w-0 relative",children:[t.map((s,o)=>{const f=e.filter(c=>c.date&&H.isSameDay(new Date(c.date),s));return l.jsx(S5,{day:s,tasks:f,onDropTask:n,onTaskClick:r,onAddClick:a,isLast:o===t.length-1,HOURS:i},s.toISOString())}),l.jsxs("div",{className:"absolute inset-0 pointer-events-none z-0",children:[l.jsx("div",{className:"h-10 border-b bg-transparent"})," ",i.map(s=>l.jsx("div",{className:"h-24 border-b border-dashed border-gray-100 w-full"},s))]})]})]})}function S5({day:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:a,isLast:i,HOURS:s}){const[{isOver:o},f]=du(()=>({accept:Bi.TASK,drop:(c,d)=>{n(c.id,t)},collect:c=>({isOver:!!c.isOver()})}),[t,n]);return l.jsxs("div",{ref:f,className:w("flex-1 relative min-w-[150px]",!i&&"border-r",o&&"bg-blue-50/30"),children:[l.jsx("div",{className:"sticky top-0 z-20 bg-white border-b h-10 flex items-center justify-center shadow-sm",children:l.jsxs("div",{className:"text-xs font-bold text-gray-500",children:[H.format(t,"EEE")," ",l.jsx("span",{className:w("ml-1",H.isToday(t)&&"text-blue-600"),children:H.format(t,"d")})]})}),s.map(c=>l.jsx("div",{className:"h-24 w-full absolute hover:bg-gray-50/50 transition-colors cursor-pointer z-10",style:{top:`${c*96+40}px`},onClick:d=>{d.stopPropagation();const u=new Date(t);u.setHours(c,0),a(u)}},c)),e.map(c=>{const d=c.date?new Date(c.date):new Date,u=c.endDate?new Date(c.endDate):H.addHours(d,1),p=H.getHours(d),h=H.getMinutes(d);let m=H.differenceInMinutes(u,d);m<30&&(m=30);const g=p*96+h/60*96+40,b=m/60*96;return l.jsx(Al,{task:c,view:"week",mode:"execution",onClick:()=>r(c),style:{top:`${g}px`,height:`${b}px`,left:"4px",right:"4px",position:"absolute"}},c.id)})]})}function i4({days:t,tasks:e,currentDate:n,onDropTask:r,onTaskClick:a,onAddClick:i,mode:s}){return l.jsx("div",{className:"grid grid-cols-7 auto-rows-fr min-h-[800px]",children:t.map(o=>{const f=e.filter(c=>c.date&&H.isSameDay(new Date(c.date),o));return l.jsx(T5,{date:o,tasks:f,isCurrentMonth:H.isSameMonth(o,n),onDropTask:r,onTaskClick:a,onAddClick:i,mode:s},o.toISOString())})})}function T5({date:t,tasks:e,isCurrentMonth:n,onDropTask:r,onTaskClick:a,onAddClick:i,mode:s}){const[{isOver:o},f]=du(()=>({accept:Bi.TASK,drop:d=>r(d.id,t),collect:d=>({isOver:!!d.isOver()})}),[t,r]),c=H.isToday(t);return l.jsxs("div",{ref:f,className:w("min-h-[120px] border-b border-r p-2 relative transition-colors group flex flex-col",!n&&"bg-gray-50/50 text-gray-400",o&&"bg-purple-50 ring-2 ring-inset ring-[#7F26BF]",c&&"bg-purple-50/30"),children:[l.jsxs("div",{className:"flex justify-between items-start mb-2",children:[l.jsx("span",{className:w("text-sm font-medium rounded-full w-7 h-7 flex items-center justify-center",c?"bg-[#7F26BF] text-white":"text-gray-700"),children:H.format(t,"d")}),l.jsx(F,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>i(t),children:l.jsx(k.Plus,{size:14})})]}),l.jsx("div",{className:"flex-1 flex flex-col gap-1",children:e.map(d=>l.jsx(Al,{task:d,view:"month",mode:s,onClick:()=>a(d)},d.id))})]})}function s4({isOpen:t,onClose:e,task:n,onSave:r,isNew:a=!1}){const[i,s]=M.useState(n||{});M.useMemo(()=>{s(n||{})},[n]);const o=()=>{r(i),e()};return l.jsx(_i,{open:t,onOpenChange:f=>!f&&e(),children:l.jsxs(Ji,{className:"sm:max-w-[600px]",children:[l.jsxs(Vi,{children:[l.jsx(Gi,{children:a?"Create New Task":"Edit Task"}),l.jsx(Yi,{children:a?"Enter the details for the new task below.":"Modify the details of the selected task."})]}),l.jsxs("div",{className:"grid gap-6 py-4",children:[l.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[l.jsx("label",{htmlFor:"title",className:"text-right text-sm font-medium",children:"Title"}),l.jsx("input",{id:"title",className:"col-span-3 flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",value:i.title||"",onChange:f=>s({...i,title:f.target.value}),placeholder:"e.g. New Feature Announcement"})]}),l.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[l.jsx("label",{className:"text-right text-sm font-medium",children:"Time"}),l.jsxs("div",{className:"col-span-3 flex gap-2 items-center",children:[l.jsx("input",{type:"date",className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm",value:i.date instanceof Date?H.format(i.date,"yyyy-MM-dd"):typeof i.date=="string"?i.date.split("T")[0]:"",onChange:f=>{const c=f.target.value,d=i.date instanceof Date?i.date:new Date,u=new Date(`${c}T${H.format(d,"HH:mm")}`);s({...i,date:u})}}),l.jsx("span",{className:"text-sm text-gray-500",children:"at"}),l.jsx("input",{type:"time",className:"w-32 flex h-9 rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm",value:i.date instanceof Date?H.format(i.date,"HH:mm"):"09:00",onChange:f=>{const c=f.target.value,d=i.date instanceof Date?H.format(i.date,"yyyy-MM-dd"):H.format(new Date,"yyyy-MM-dd");s({...i,date:new Date(`${d}T${c}`)})}})]})]}),l.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[l.jsx("label",{htmlFor:"channel",className:"text-right text-sm font-medium",children:"Channel / Category"}),l.jsx("select",{id:"channel",className:"col-span-3 flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm",value:i.channel||"instagram",onChange:f=>s({...i,channel:f.target.value}),children:Object.keys(a4).map(f=>l.jsx("option",{value:f,children:f.charAt(0).toUpperCase()+f.slice(1)},f))})]}),l.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[l.jsx("label",{htmlFor:"status",className:"text-right text-sm font-medium",children:"Status"}),l.jsx("select",{id:"status",className:"col-span-3 flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm",value:i.status||"idea",onChange:f=>s({...i,status:f.target.value}),children:Object.keys(jc).map(f=>l.jsx("option",{value:f,children:f.charAt(0).toUpperCase()+f.slice(1)},f))})]}),l.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[l.jsx("label",{htmlFor:"description",className:"text-right text-sm font-medium pt-2",children:"Description"}),l.jsx("textarea",{id:"description",className:"col-span-3 flex min-h-[80px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",value:i.description||"",onChange:f=>s({...i,description:f.target.value}),placeholder:"Details about this post..."})]})]}),l.jsxs(Zo,{children:[l.jsx(F,{variant:"outline",onClick:e,children:"Cancel"}),l.jsx(F,{className:"bg-[#7F26BF] hover:bg-[#6E21A6]",onClick:o,children:"Save Changes"})]})]})})}function o4({tasks:t,onTaskUpdate:e,onTaskCreate:n,defaultView:r="month"}){const[a,i]=M.useState(new Date),[s,o]=M.useState(r),[f,c]=M.useState(!0),[d,u]=M.useState(!1),[p,h]=M.useState(null),[m,g]=M.useState(!1),b=M.useMemo(()=>{let z,P;if(s==="month"){const U=H.startOfMonth(a),J=H.endOfMonth(U);z=H.startOfWeek(U),P=H.endOfWeek(J)}else s==="week"?(z=H.startOfWeek(a),P=H.endOfWeek(a)):(z=a,P=a);return H.eachDayOfInterval({start:z,end:P})},[a,s]),x=t.filter(z=>!z.date),v=t.filter(z=>z.date);return{currentDate:a,view:s,setView:o,isSidebarOpen:f,setIsSidebarOpen:c,isModalOpen:d,setIsModalOpen:u,editingTask:p,isNewTask:m,calendarDays:b,unplannedTasks:x,scheduledTasks:v,handlePrev:()=>{i(s==="month"?H.subMonths(a,1):s==="week"?H.addDays(a,-7):H.addDays(a,-1))},handleNext:()=>{i(s==="month"?H.addMonths(a,1):s==="week"?H.addDays(a,7):H.addDays(a,1))},handleToday:()=>i(new Date),handleDropTask:(z,P,U)=>{const J=t.find(Y=>Y.id===z);if(J){let Y=new Date(P);if(s==="month"||U==="editorial")if(J.date){const E=new Date(J.date);Y.setHours(E.getHours(),E.getMinutes())}else Y.setHours(9,0);const K={...J,date:Y};e(K)}},handleTaskClick:z=>{h(z),g(!1),u(!0)},handleAddClick:z=>{const P=z||new Date;H.getHours(P)===0&&H.getMinutes(P)===0&&P.setHours(9,0),h({date:P,status:"idea",channel:"instagram"}),g(!0),u(!0)},handleModalSave:z=>{m?n&&n(z):z.id&&e(z),u(!1)}}}function l4({isOpen:t,setIsOpen:e,tasks:n,onAddClick:r,onTaskClick:a,mode:i}){return t?l.jsxs("div",{className:"w-72 border-r bg-gray-50/50 flex flex-col transition-all duration-300 flex-shrink-0",children:[l.jsxs("div",{className:"p-4 border-b bg-white flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h3",{className:"font-semibold text-sm text-gray-900",children:"Backlog"}),l.jsx(pe,{variant:"secondary",className:"bg-gray-100 text-xs",children:n.length})]}),l.jsx(F,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>e(!1),children:l.jsx(k.PanelLeftClose,{size:16})})]}),l.jsx("div",{className:"px-4 pt-3 bg-white pb-3 border-b space-y-2",children:l.jsxs(F,{onClick:r,variant:"outline",size:"sm",className:"w-full justify-start pl-2",children:[l.jsx(k.Plus,{size:12,className:"mr-1.5"})," New Task"]})}),l.jsx(Wo,{className:"flex-1 p-3",children:l.jsx("div",{className:"space-y-2",children:n.length===0?l.jsx("div",{className:"text-center py-10 px-4 border-2 border-dashed border-gray-200 rounded-lg",children:l.jsx("p",{className:"text-xs text-gray-400",children:"No unscheduled items"})}):n.map(s=>l.jsx(Al,{task:s,view:"backlog",mode:i,onClick:()=>a(s)},s.id))})})]}):l.jsxs("div",{className:"border-r bg-white flex flex-col items-center py-4 w-12 flex-shrink-0 cursor-pointer hover:bg-gray-50 transition-colors",onClick:()=>e(!0),children:[l.jsx(k.PanelLeftOpen,{className:"text-gray-500 mb-4",size:20}),l.jsx("div",{className:"flex-1 flex items-center justify-center min-h-0",children:l.jsx("div",{className:"whitespace-nowrap text-xs font-medium text-gray-400 -rotate-90 transform",children:"BACKLOG"})}),l.jsx(pe,{className:"mt-2 h-5 w-5 p-0 flex items-center justify-center rounded-full bg-[#7F26BF] text-[10px]",children:n.length})]})}function f4({title:t,onPrev:e,onNext:n,onToday:r,onAdd:a,view:i,setView:s}){return l.jsxs("div",{className:"flex flex-col xl:flex-row items-center justify-between p-4 border-b gap-4 flex-shrink-0 bg-white",children:[l.jsxs("div",{className:"flex items-center gap-4 w-full xl:w-auto justify-between xl:justify-start",children:[l.jsxs("div",{className:"flex items-center border rounded-md bg-white shadow-sm",children:[l.jsx(F,{variant:"ghost",size:"icon",onClick:e,className:"h-8 w-8 rounded-r-none",children:l.jsx(k.ChevronLeft,{className:"h-4 w-4"})}),l.jsx(F,{variant:"ghost",onClick:r,className:"h-8 px-3 rounded-none border-x text-sm font-medium hover:bg-gray-50",children:"Today"}),l.jsx(F,{variant:"ghost",size:"icon",onClick:n,className:"h-8 w-8 rounded-l-none",children:l.jsx(k.ChevronRight,{className:"h-4 w-4"})})]}),l.jsx("h2",{className:"text-lg font-bold text-gray-900 whitespace-nowrap",children:t})]}),l.jsxs("div",{className:"flex items-center gap-3 w-full xl:w-auto overflow-x-auto pb-1 xl:pb-0 justify-end",children:[l.jsx(P2,{value:i,onValueChange:o=>s(o),className:"flex-shrink-0",children:l.jsxs(R2,{className:"h-9",children:[l.jsx(_s,{value:"month",className:"text-xs",children:"Month"}),l.jsx(_s,{value:"week",className:"text-xs",children:"Week"}),l.jsx(_s,{value:"day",className:"text-xs",children:"Day"})]})}),l.jsxs(F,{variant:"default",className:"h-9 px-4 flex-shrink-0",onClick:a,children:[l.jsx(k.Plus,{className:"mr-2 h-4 w-4"})," Create"]})]})]})}function c4({days:t}){return l.jsx("div",{className:"grid grid-cols-7 border-b bg-gray-50 flex-shrink-0 divide-x",children:t.slice(0,7).map((e,n)=>l.jsx("div",{className:"py-2 text-center group",children:l.jsx("div",{className:w("text-xs font-semibold uppercase tracking-wider",H.isToday(e)?"text-[#7F26BF]":"text-gray-500"),children:H.format(e,"EEE")})},n))})}function I5(t){const e=o4({...t,defaultView:"month"});return l.jsx(G2,{backend:r4,children:l.jsxs("div",{className:w("flex h-[calc(100vh-100px)] bg-background border rounded-lg overflow-hidden shadow-sm",t.className),children:[l.jsx(l4,{isOpen:e.isSidebarOpen,setIsOpen:e.setIsSidebarOpen,tasks:e.unplannedTasks,onAddClick:()=>e.handleAddClick(),onTaskClick:e.handleTaskClick,mode:"editorial"}),l.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-white",children:[l.jsx(f4,{title:e.view==="day"?H.format(e.currentDate,"MMM d, yyyy"):H.format(e.currentDate,"MMMM yyyy"),onPrev:e.handlePrev,onNext:e.handleNext,onToday:e.handleToday,onAdd:()=>e.handleAddClick(e.currentDate),view:e.view,setView:e.setView,mode:"editorial"}),e.view==="month"&&l.jsx(c4,{days:e.calendarDays}),l.jsx("div",{className:"flex-1 overflow-hidden flex flex-col relative",children:e.view==="month"?l.jsx(i4,{days:e.calendarDays,tasks:e.scheduledTasks,currentDate:e.currentDate,onDropTask:(n,r)=>e.handleDropTask(n,r,"editorial"),onTaskClick:e.handleTaskClick,onAddClick:e.handleAddClick,mode:"editorial"}):l.jsx(L5,{days:e.calendarDays,tasks:e.scheduledTasks,onDropTask:(n,r)=>e.handleDropTask(n,r,"editorial"),onTaskClick:e.handleTaskClick,onAddClick:e.handleAddClick,view:e.view})})]}),e.isModalOpen&&l.jsx(s4,{isOpen:e.isModalOpen,onClose:()=>e.setIsModalOpen(!1),task:e.editingTask||{},onSave:e.handleModalSave,isNew:e.isNewTask})]})})}function D5(t){const e=o4({...t,defaultView:"week"});return l.jsx(G2,{backend:r4,children:l.jsxs("div",{className:w("flex h-[calc(100vh-100px)] bg-background border rounded-lg overflow-hidden shadow-sm",t.className),children:[l.jsx(l4,{isOpen:e.isSidebarOpen,setIsOpen:e.setIsSidebarOpen,tasks:e.unplannedTasks,onAddClick:()=>e.handleAddClick(),onTaskClick:e.handleTaskClick,mode:"execution"}),l.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-white",children:[l.jsx(f4,{title:e.view==="day"?H.format(e.currentDate,"MMM d, yyyy"):H.format(e.currentDate,"MMMM yyyy"),onPrev:e.handlePrev,onNext:e.handleNext,onToday:e.handleToday,onAdd:()=>e.handleAddClick(e.currentDate),view:e.view,setView:e.setView,mode:"execution"}),e.view==="month"&&l.jsx(c4,{days:e.calendarDays}),l.jsx("div",{className:"flex-1 overflow-hidden flex flex-col relative",children:e.view==="month"?l.jsx(i4,{days:e.calendarDays,tasks:e.scheduledTasks,currentDate:e.currentDate,onDropTask:(n,r)=>e.handleDropTask(n,r,"execution"),onTaskClick:e.handleTaskClick,onAddClick:e.handleAddClick,mode:"execution"}):l.jsx(k5,{days:e.calendarDays,tasks:e.scheduledTasks,onDropTask:(n,r)=>e.handleDropTask(n,r,"execution"),onTaskClick:e.handleTaskClick,onAddClick:e.handleAddClick})})]}),e.isModalOpen&&l.jsx(s4,{isOpen:e.isModalOpen,onClose:()=>e.setIsModalOpen(!1),task:e.editingTask||{},onSave:e.handleModalSave,isNew:e.isNewTask})]})})}const E5=Vs.FormProvider,d4=I.createContext({}),A5=({...t})=>l.jsx(d4.Provider,{value:{name:t.name},children:l.jsx(Vs.Controller,{...t})}),ns=()=>{const t=I.useContext(d4),e=I.useContext(u4),{getFieldState:n}=Vs.useFormContext(),r=Vs.useFormState({name:t.name}),a=n(t.name,r);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:i}=e;return{id:i,name:t.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...a}},u4=I.createContext({});function z5({className:t,...e}){const n=I.useId();return l.jsx(u4.Provider,{value:{id:n},children:l.jsx("div",{"data-slot":"form-item",className:w("grid gap-2",t),...e})})}function O5({className:t,...e}){const{error:n,formItemId:r}=ns();return l.jsx(Ue,{"data-slot":"form-label","data-error":!!n,className:w("data-[error=true]:text-destructive",t),htmlFor:r,...e})}function P5({...t}){const{error:e,formItemId:n,formDescriptionId:r,formMessageId:a}=ns();return l.jsx(kn.Slot,{"data-slot":"form-control",id:n,"aria-describedby":e?`${r} ${a}`:`${r}`,"aria-invalid":!!e,...t})}function R5({className:t,...e}){const{formDescriptionId:n}=ns();return l.jsx("p",{"data-slot":"form-description",id:n,className:w("text-muted-foreground text-sm",t),...e})}function B5({className:t,...e}){const{error:n,formMessageId:r}=ns(),a=n?String((n==null?void 0:n.message)??""):e.children;return a?l.jsx("p",{"data-slot":"form-message",id:r,className:w("text-destructive text-sm",t),...e,children:a}):null}const h4={"not-started":{label:"Não iniciada",icon:k.Circle,variant:"outline",barColor:"bg-gray-300 dark:bg-gray-600"},"in-progress":{label:"Em progresso",icon:k.Clock,variant:"default",barColor:"bg-primary"},"on-hold":{label:"Em espera",icon:k.AlertCircle,variant:"secondary",barColor:"bg-cyan-500"},completed:{label:"Concluída",icon:k.CheckCircle2,variant:"outline",barColor:"bg-green-500"},delayed:{label:"Atrasada",icon:k.AlertCircle,variant:"destructive",barColor:"bg-red-500"},cancelled:{label:"Cancelada",icon:k.AlertCircle,variant:"destructive",barColor:"bg-orange-500"}},l0=["#7F26BF","#0086E6","#24B347","#F26924","#E91E63","#9C27B0","#00BCD4","#FF9800"];function H5(t,e,n,r,a){const i=H.differenceInDays(r,n),s=H.differenceInDays(t,n),o=H.differenceInDays(e,t)+1,f=s/i*100,c=o/i*100;return{left:f,width:c}}const p4=I.memo(({task:t,timelineStart:e,timelineEnd:n,columnWidth:r,rowHeight:a,onTaskClick:i,onTaskEdit:s})=>{const{left:o,width:f}=H5(t.startDate,t.endDate,e,n),c=h4[t.status],d=c.icon;return t.milestone?l.jsxs("div",{className:"absolute group/milestone",style:{left:`${o}%`,top:"50%",transform:"translateY(-50%)"},children:[l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx("div",{className:w("w-4 h-4 rotate-45 cursor-pointer transition-all hover:scale-125",c.barColor),onClick:()=>i==null?void 0:i(t),role:"button",tabIndex:0,"aria-label":`Milestone: ${t.name}`})}),l.jsx(at,{side:"top",className:"max-w-sm",children:l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"font-medium",children:t.name}),l.jsx("p",{className:"text-xs opacity-90",children:"📍 Marco importante"}),l.jsxs("p",{className:"text-xs opacity-90",children:["📅 ",H.format(t.startDate,"dd/MM/yyyy",{locale:yt})]})]})})]}),s&&l.jsx("button",{className:"absolute -right-6 top-1/2 -translate-y-1/2 opacity-0 group-hover/milestone:opacity-100 transition-opacity bg-background border rounded p-1 shadow-md hover:bg-primary hover:text-primary-foreground",onClick:u=>{u.stopPropagation(),s(t)},"aria-label":"Editar marco",children:l.jsx(k.Edit,{className:"size-3"})})]}):l.jsxs(st,{children:[l.jsx($e,{asChild:!0,children:l.jsxs("div",{className:"absolute group/task cursor-pointer",style:{left:`${o}%`,width:`${f}%`,top:"20%",height:"60%"},onClick:()=>i==null?void 0:i(t),role:"button",tabIndex:0,"aria-label":`Task: ${t.name}, Status: ${c.label}, Progress: ${t.progress}%`,children:[l.jsx("div",{className:w("absolute inset-0 rounded-lg transition-all",c.barColor,"group-hover/task:shadow-lg group-hover/task:scale-[1.02]","opacity-90 group-hover/task:opacity-100")}),t.progress>0&&l.jsx("div",{className:"absolute inset-0 rounded-lg bg-white/20 dark:bg-black/20",style:{clipPath:`inset(0 ${100-t.progress}% 0 0)`}}),l.jsxs("div",{className:"absolute inset-0 flex items-center px-2 gap-1.5",children:[l.jsx(d,{className:"size-3 text-white flex-shrink-0"}),l.jsx("span",{className:"text-xs text-white truncate",children:t.name}),t.assignee&&l.jsx("div",{className:"ml-auto flex-shrink-0",children:l.jsx(Ft,{className:"size-5 border border-white/50",children:l.jsx(Ut,{className:"bg-white/20 text-white text-[8px]",children:t.assignee.initials||t.assignee.name.substring(0,2).toUpperCase()})})})]}),s&&l.jsx("button",{className:"absolute -right-7 top-1/2 -translate-y-1/2 opacity-0 group-hover/task:opacity-100 transition-opacity bg-background border rounded p-1.5 shadow-lg hover:bg-primary hover:text-primary-foreground z-20",onClick:u=>{u.stopPropagation(),s(t)},"aria-label":"Editar tarefa",children:l.jsx(k.Edit,{className:"size-3.5"})})]})}),l.jsx(Ze,{className:"w-80",align:"start",children:l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{children:[l.jsx("h4",{className:"font-medium mb-1",children:t.name}),t.description&&l.jsx("p",{className:"text-sm text-muted-foreground",children:t.description})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(k.Calendar,{className:"size-4 text-muted-foreground"}),l.jsxs("span",{children:[H.format(t.startDate,"dd/MM/yyyy",{locale:yt})," -"," ",H.format(t.endDate,"dd/MM/yyyy",{locale:yt})]})]}),l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(k.Clock,{className:"size-4 text-muted-foreground"}),l.jsxs("span",{children:[H.differenceInDays(t.endDate,t.startDate)+1," dias"]})]}),t.assignee&&l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(k.User,{className:"size-4 text-muted-foreground"}),l.jsx("span",{children:t.assignee.name})]})]}),l.jsxs("div",{className:"flex items-center justify-between pt-2 border-t",children:[l.jsxs(pe,{variant:c.variant,className:"gap-1",children:[l.jsx(d,{className:"size-3"}),c.label]}),l.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.progress,"% concluído"]})]})]})})]})});p4.displayName="TaskRow";const F5=["DOM","SEG","TER","QUA","QUI","SEX","SAB"],m4=I.forwardRef(({tasks:t,projects:e=[],onTaskClick:n,onTaskEdit:r,rowHeight:a=48,columnWidth:i=40,groupBy:s="projects"},o)=>{const[f,c]=I.useState(new Date),[d,u]=I.useState(new Set),p=H.startOfMonth(f),h=H.endOfMonth(f),m=H.eachDayOfInterval({start:p,end:h}),g=()=>c(H.subMonths(f,1)),b=()=>c(H.addMonths(f,1)),x=()=>c(new Date),v=I.useMemo(()=>{if(s==="assignees"){const y=new Map;return t.forEach(C=>{var S;const N=((S=C.assignee)==null?void 0:S.name)||"Sem responsável";y.has(N)||y.set(N,[]),y.get(N).push(C)}),Array.from(y.entries()).map(([C,N],S)=>{var T,z,P;return{id:C,name:C,color:(T=N[0])!=null&&T.assignee?l0[S%l0.length]:"#999",initials:((P=(z=N[0])==null?void 0:z.assignee)==null?void 0:P.initials)||"??",tasks:N}})}else{const y=new Map;return t.forEach(L=>{const C=L.projectId;y.has(C)||y.set(C,[]),y.get(C).push(L)}),e.length>0?e.map(C=>({...C,tasks:y.get(C.id)||[]})).filter(C=>C.tasks.length>0):[{id:"default",name:"Tarefas",color:"#7F26BF",tasks:t}]}},[t,e,s]),j=y=>{u(L=>{const C=new Set(L);return C.has(y)?C.delete(y):C.add(y),C})};return l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(F,{variant:"ghost",size:"icon",onClick:g,children:l.jsx(k.ChevronLeft,{className:"h-4 w-4"})}),l.jsx("h2",{className:"text-lg font-bold min-w-[200px] text-center",children:H.format(f,"MMMM yyyy",{locale:yt})}),l.jsx(F,{variant:"ghost",size:"icon",onClick:b,children:l.jsx(k.ChevronRight,{className:"h-4 w-4"})})]}),l.jsx(F,{variant:"outline",size:"sm",onClick:x,children:"Hoje"})]}),l.jsx("div",{ref:o,className:w("gantt-chart overflow-hidden rounded-lg border bg-card flex flex-col"),role:"grid","aria-label":"Gantt Chart",children:l.jsx("div",{className:"overflow-auto max-h-[600px] relative",children:l.jsxs("div",{style:{minWidth:"max-content"},children:[l.jsxs("div",{className:"sticky top-0 z-40 flex bg-background border-b shadow-sm",children:[l.jsx("div",{className:"sticky left-0 z-50 border-r bg-background flex items-center px-4",style:{width:"280px",height:"50px"},children:l.jsx("span",{className:"font-medium text-sm",children:s==="assignees"?"Colaboradores":"Tarefas"})}),l.jsx("div",{className:"flex",children:m.map(y=>{const L=H.isWeekend(y);return l.jsx("div",{className:w("flex-shrink-0 border-r text-center bg-background",L&&"bg-muted/20"),style:{width:`${i}px`},children:l.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-0.5 py-1",children:[l.jsx("span",{className:"text-[10px] font-bold leading-none text-foreground",children:F5[y.getDay()]}),l.jsx("span",{className:"text-[10px] text-muted-foreground leading-none",children:H.format(y,"d",{locale:yt})})]})},y.toISOString())})})]}),l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 flex pointer-events-none pl-[280px]",children:m.map(y=>{const L=H.isWeekend(y),C=H.isSameDay(y,new Date);return l.jsx("div",{className:w("flex-shrink-0 h-full",L&&"bg-muted/10",C&&"bg-primary/5"),style:{width:`${i}px`}},`grid-${y.toISOString()}`)})}),v.map(y=>{const L=d.has(y.id);return l.jsxs("div",{children:[l.jsxs("div",{className:"flex sticky-container",children:[l.jsxs("div",{className:"sticky left-0 z-30 w-[280px] border-r bg-background flex items-center gap-2 px-3 py-2 border-b hover:bg-muted/50 transition-colors cursor-pointer",style:{height:`${a}px`},onClick:()=>j(y.id),children:[L?l.jsx(k.ChevronRight,{className:"size-4 text-muted-foreground"}):l.jsx(k.ChevronDown,{className:"size-4 text-muted-foreground"}),s==="assignees"&&y.initials?l.jsx(Ft,{className:"size-6",children:l.jsx(Ut,{style:{backgroundColor:y.color},className:"text-white text-[10px]",children:y.initials})}):l.jsx("div",{className:"size-3 rounded-full flex-shrink-0",style:{backgroundColor:y.color||"var(--primary)"}}),l.jsx("span",{className:"font-medium text-sm truncate",children:y.name}),l.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:y.tasks.length})]}),l.jsx("div",{className:"flex-1 border-b",style:{height:`${a}px`}})]}),!L&&y.tasks.map(C=>l.jsxs("div",{className:"flex sticky-container group",children:[l.jsxs("div",{className:"sticky left-0 z-30 w-[280px] border-r bg-background flex items-center gap-2 px-3 py-2 pl-9 border-b hover:bg-muted/20 transition-colors",style:{height:`${a}px`},children:[l.jsx("div",{className:w("size-2 rounded-full flex-shrink-0",C.milestone&&"rotate-45"),style:{backgroundColor:y.color}}),l.jsx("span",{className:"text-sm truncate flex-1",children:C.name}),s==="projects"&&C.assignee&&l.jsx(Ft,{className:"size-6 opacity-0 group-hover:opacity-100 transition-opacity",children:l.jsx(Ut,{className:"text-[10px]",children:C.assignee.initials||C.assignee.name.substring(0,2).toUpperCase()})}),r&&l.jsx(k.Edit,{className:"size-4 text-muted-foreground cursor-pointer hover:text-primary ml-2 opacity-0 group-hover:opacity-100",onClick:()=>r(C)})]}),l.jsx("div",{className:"relative flex-1 border-b",style:{height:`${a}px`},children:l.jsx(p4,{task:C,timelineStart:p,timelineEnd:h,columnWidth:i,rowHeight:a,onTaskClick:n,onTaskEdit:r})})]},C.id))]},y.id)}),(()=>{const y=new Date;if(y>=p&&y<=h){const C=280+H.differenceInDays(y,p)*i+i/2;return l.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-primary pointer-events-none z-20",style:{left:`${C}px`},children:l.jsx("div",{className:"absolute -top-1 -left-1.5 size-3 rounded-full bg-primary shadow-sm"})})}return null})()]})]})})})]})});m4.displayName="GanttChart";const g4=I.forwardRef(({className:t},e)=>l.jsxs("div",{ref:e,className:w("flex flex-wrap gap-4",t),children:[Object.entries(h4).map(([n,r])=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:w("size-3 rounded",r.barColor)}),l.jsx("span",{className:"text-sm text-muted-foreground",children:r.label})]},n)),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"size-3 rotate-45 bg-primary"}),l.jsx("span",{className:"text-sm text-muted-foreground",children:"Marco"})]})]}));g4.displayName="GanttLegend";function U5({...t}){return l.jsx(Gs.Root,{"data-slot":"hover-card",...t})}function _5({...t}){return l.jsx(Gs.Trigger,{"data-slot":"hover-card-trigger",...t})}function J5({className:t,align:e="center",sideOffset:n=4,...r}){return l.jsx(Gs.Portal,{"data-slot":"hover-card-portal",children:l.jsx(Gs.Content,{"data-slot":"hover-card-content",align:e,sideOffset:n,className:w("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...r})})}function V5({className:t,containerClassName:e,...n}){return l.jsx(u0.OTPInput,{"data-slot":"input-otp",containerClassName:w("flex items-center gap-2 has-disabled:opacity-50",e),className:w("disabled:cursor-not-allowed",t),...n})}function G5({className:t,...e}){return l.jsx("div",{"data-slot":"input-otp-group",className:w("flex items-center gap-1",t),...e})}function Y5({index:t,className:e,...n}){const r=I.useContext(u0.OTPInputContext),{char:a,hasFakeCaret:i,isActive:s}=(r==null?void 0:r.slots[t])??{};return l.jsxs("div",{"data-slot":"input-otp-slot","data-active":s,className:w("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm bg-input-background transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",e),...n,children:[a,i&&l.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:l.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function Q5({...t}){return l.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...t,children:l.jsx(k.MinusIcon,{})})}function W5({validationState:t,validate:e,onChange:n,className:r,...a}){const[i,s]=I.useState("idle"),o=t??i;function f(c){if(t===void 0&&e){const d=e(c.target.value);s(d===null?"idle":d?"valid":"invalid")}n==null||n(c)}return l.jsxs("div",{className:"relative flex items-center",children:[l.jsx(Ht,{className:w(o!=="idle"&&"pr-9",r),"aria-invalid":o==="invalid"||void 0,onChange:f,...a}),o==="valid"&&l.jsx(k.CheckCircle2,{className:"absolute right-3 size-4 text-green-600 pointer-events-none","aria-hidden":"true"}),o==="invalid"&&l.jsx(k.XCircle,{className:"absolute right-3 size-4 text-destructive pointer-events-none","aria-hidden":"true"})]})}function uu({className:t,value:e,...n}){return l.jsx(gu.Root,{"data-slot":"progress",className:w("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",t),...n,children:l.jsx(gu.Indicator,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})})}const $5={low:{color:"bg-blue-500",label:"Baixa",textColor:"text-blue-700",bgColor:"bg-blue-50 dark:bg-blue-950/20"},medium:{color:"bg-yellow-500",label:"Média",textColor:"text-yellow-700",bgColor:"bg-yellow-50 dark:bg-yellow-950/20"},high:{color:"bg-orange-500",label:"Alta",textColor:"text-orange-700",bgColor:"bg-orange-50 dark:bg-orange-950/20"},urgent:{color:"bg-red-500",label:"Urgente",textColor:"text-red-700",bgColor:"bg-red-50 dark:bg-red-950/20"}},b4=I.forwardRef(({title:t,description:e,coverImage:n,thumbnailImage:r,tags:a=[],assignees:i=[],priority:s,dueDate:o,comments:f,attachments:c,checklist:d,progress:u,status:p,variant:h="default",isDragging:m=!1,onClick:g,onEdit:b,onDelete:x,onDuplicate:v,className:j},y)=>{const L=o&&new Date(o)<new Date,C=s?$5[s]:null,N=T=>{const z=T.getDate().toString().padStart(2,"0"),P=(T.getMonth()+1).toString().padStart(2,"0");return`${z}/${P}`},S=T=>{T.target.closest("button")||T.target.closest("[role='menuitem']")||g==null||g()};return l.jsxs(jr,{ref:y,className:w("group cursor-grab active:cursor-grabbing transition-all duration-200","hover:shadow-lg hover:scale-[1.02]",m&&"opacity-50 rotate-2 scale-105 shadow-2xl cursor-grabbing",s&&"border-l-4",s==="low"&&"border-l-blue-500",s==="medium"&&"border-l-yellow-500",s==="high"&&"border-l-orange-500",s==="urgent"&&"border-l-red-500",h==="compact"&&"hover:scale-[1.01]",j),onClick:S,children:[n&&h!=="compact"&&l.jsxs("div",{className:"relative w-full h-40 overflow-hidden rounded-t-lg",children:[l.jsx("img",{src:n,alt:t,className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105"}),s&&l.jsx("div",{className:"absolute top-2 right-2",children:l.jsxs(pe,{variant:"secondary",className:w("shadow-sm",C==null?void 0:C.bgColor),children:[l.jsx("div",{className:w("w-2 h-2 rounded-full mr-1",C==null?void 0:C.color)}),C==null?void 0:C.label]})})]}),l.jsxs(la,{className:w(h==="compact"?"p-3 pb-2":"p-4 pb-3"),children:[l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[r&&!n&&l.jsx("img",{src:r,alt:t,className:"w-10 h-10 rounded object-cover flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx(fa,{className:w("line-clamp-2",h==="compact"?"text-sm":"text-base"),children:t}),p&&h==="detailed"&&l.jsx(pe,{variant:"outline",className:"mt-1 text-xs",children:p})]})]}),e&&h!=="compact"&&l.jsx(m0,{className:"mt-2 line-clamp-2 text-xs",children:e})]}),(b||x||v)&&l.jsxs(Hi,{children:[l.jsx(Fi,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",children:l.jsx(k.MoreVertical,{className:"h-4 w-4"})})}),l.jsxs(Ui,{align:"end",children:[b&&l.jsx(gr,{onClick:b,children:"Editar"}),v&&l.jsx(gr,{onClick:v,children:"Duplicar"}),x&&l.jsx(gr,{onClick:x,className:"text-destructive",children:"Excluir"})]})]})]}),a.length>0&&l.jsxs("div",{className:"flex flex-wrap gap-1 mt-2",children:[a.slice(0,h==="compact"?2:3).map(T=>l.jsx(pe,{variant:"secondary",className:"text-xs",style:T.color?{backgroundColor:T.color+"20",color:T.color,borderColor:T.color+"40"}:void 0,children:T.label},T.id)),a.length>(h==="compact"?2:3)&&l.jsxs(pe,{variant:"secondary",className:"text-xs",children:["+",a.length-(h==="compact"?2:3)]})]}),s&&!n&&h==="detailed"&&l.jsxs(pe,{variant:"secondary",className:w("mt-2 w-fit text-xs",C==null?void 0:C.bgColor),children:[l.jsx("div",{className:w("w-2 h-2 rounded-full mr-1",C==null?void 0:C.color)}),C==null?void 0:C.label]})]}),u!==void 0&&h!=="compact"&&l.jsx(ca,{className:"px-4 pb-3 pt-0",children:l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[l.jsx("span",{children:"Progresso"}),l.jsxs("span",{children:[u,"%"]})]}),l.jsx(uu,{value:u,className:"h-1.5"})]})}),l.jsxs(g0,{className:w("flex items-center justify-between gap-2",h==="compact"?"px-3 pb-3 pt-1":"px-4 pb-4 pt-2"),children:[l.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground flex-wrap",children:[o&&l.jsxs("div",{className:w("flex items-center gap-1",L&&"text-destructive font-medium"),children:[L&&l.jsx(k.AlertCircle,{className:"h-3 w-3"}),l.jsx(k.Calendar,{className:"h-3 w-3"}),l.jsx("span",{children:N(o)})]}),d&&l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(k.CheckSquare,{className:"h-3 w-3"}),l.jsxs("span",{children:[d.completed,"/",d.total]})]}),f!==void 0&&f>0&&l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(k.MessageSquare,{className:"h-3 w-3"}),l.jsx("span",{children:f})]}),c!==void 0&&c>0&&l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(k.Paperclip,{className:"h-3 w-3"}),l.jsx("span",{children:c})]})]}),i.length>0&&l.jsxs("div",{className:"flex -space-x-2",children:[i.slice(0,3).map(T=>l.jsxs(Ft,{className:"h-6 w-6 border-2 border-background",children:[T.avatar&&l.jsx(Ln,{src:T.avatar,alt:T.name}),l.jsx(Ut,{className:"text-xs",children:T.initials||T.name.slice(0,2).toUpperCase()})]},T.id)),i.length>3&&l.jsxs("div",{className:"h-6 w-6 rounded-full border-2 border-background bg-muted flex items-center justify-center text-xs",children:["+",i.length-3]})]})]})]})});b4.displayName="KanbanCard";const x4=I.forwardRef(({title:t,primaryContent:e,secondaryContent:n,trendValue:r,trendLabel:a,icon:i=k.Activity,isLoading:s=!1,onClick:o,className:f},c)=>s?l.jsxs(jr,{ref:c,className:f,children:[l.jsx(la,{className:"pb-1",children:l.jsxs(fa,{className:"text-sm flex items-center gap-2",children:[l.jsx(Bn,{className:"h-4 w-4 rounded"}),l.jsx(Bn,{className:"h-4 w-24"})]})}),l.jsxs(ca,{className:"space-y-1 pt-0",children:[l.jsx(Bn,{className:"h-8 w-32"}),l.jsx(Bn,{className:"h-3 w-full"})]})]}):l.jsxs(jr,{ref:c,onClick:o,className:w(o&&"cursor-pointer hover:bg-accent/50 transition-colors",f),children:[l.jsx(la,{className:"pb-1",children:l.jsxs(fa,{className:"text-sm flex items-center gap-2 text-muted-foreground",children:[l.jsx(i,{className:"h-4 w-4 text-muted-foreground"}),t]})}),l.jsxs(ca,{className:"space-y-1 pt-0",children:[l.jsxs("div",{className:"flex items-baseline flex-wrap gap-2",children:[l.jsx("span",{className:"text-2xl font-bold",children:e}),r!==void 0&&l.jsxs(pe,{variant:"secondary",className:w("px-1.5 py-0 h-auto text-xs",r>0?"text-green-600":"text-red-600"),children:[r>0?l.jsx(k.TrendingUp,{className:"h-3 w-3 mr-0.5 inline"}):l.jsx(k.TrendingDown,{className:"h-3 w-3 mr-0.5 inline"}),a]})]}),n&&l.jsx("p",{className:"text-xs text-muted-foreground",children:n})]})]}));x4.displayName="KPICard";function Z5(t){return t?t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(1)} GB`:""}function q5(t){if(!t)return"";try{return new Date(t).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return t}}function K5(t,e){if(t.length<=e)return t;const n=t.lastIndexOf(".");if(n===-1)return t.substring(0,e-3)+"...";const r=t.substring(n);return t.substring(0,n).substring(0,e-r.length-3)+"..."+r}function X5({attachments:t,onDownload:e,onRemove:n,onView:r,showDownload:a=!0,showRemove:i=!1,showView:s=!1,maxFilenameLength:o=40,variant:f="compact",emptyMessage:c="Nenhum anexo",isLoading:d=!1,className:u}){const[p,h]=M.useState({}),m=async(g,b,x)=>{if(!x)return;const v=g.chave||g.nomeOriginal;h(j=>({...j,[v]:b}));try{await x(g)}finally{h(j=>({...j,[v]:null}))}};return d?l.jsx("div",{className:w("space-y-2",u),children:[1,2,3].map(g=>l.jsxs("div",{className:"flex items-center gap-2 p-3 border rounded bg-muted/30 animate-pulse",children:[l.jsx("div",{className:"h-4 w-4 bg-muted-foreground/20 rounded"}),l.jsx("div",{className:"h-4 flex-1 bg-muted-foreground/20 rounded"})]},g))}):t.length===0?l.jsx("div",{className:w("text-center py-6 text-sm text-muted-foreground border rounded-lg bg-muted/20",u),children:c}):l.jsx("div",{className:w("space-y-2",u),children:t.map((g,b)=>{const x=g.chave||g.id||`${g.nomeOriginal}-${b}`,v=p[g.chave||g.nomeOriginal],j=v==="download",y=v==="view",L=(()=>{switch(g.status){case"completed":return l.jsx(pe,{variant:"outline",className:"bg-green-50 text-green-600 border-green-200 hover:bg-green-50",children:"✓ Enviado"});case"uploading":return l.jsx(pe,{variant:"outline",className:"bg-blue-50 text-blue-600 border-blue-200 hover:bg-blue-50",children:"Enviando..."});case"failed":return l.jsx(pe,{variant:"outline",className:"bg-red-50 text-red-600 border-red-200 hover:bg-red-50",children:"✗ Erro"});case"retrying":return l.jsx(pe,{variant:"outline",className:"bg-yellow-50 text-yellow-600 border-yellow-200 hover:bg-yellow-50",children:"Tentando..."});default:return null}})();return f==="detailed"?l.jsx("div",{className:w("p-4 border rounded-lg bg-card transition-colors",g.status==="failed"&&"border-red-200 bg-red-50/30"),children:l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[l.jsx(k.Paperclip,{className:"h-5 w-5 text-muted-foreground mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx("p",{className:"text-sm font-medium truncate",children:g.nomeOriginal})}),l.jsx(at,{children:l.jsx("p",{children:g.nomeOriginal})})]})}),l.jsxs("div",{className:"flex items-center gap-2 mt-1 text-xs text-muted-foreground",children:[g.tamanhoBytes&&l.jsx("span",{children:Z5(g.tamanhoBytes)}),g.tamanhoBytes&&g.dataUpload&&l.jsx("span",{children:"•"}),g.dataUpload&&l.jsx("span",{children:q5(g.dataUpload)})]}),g.status==="uploading"&&typeof g.progress=="number"&&l.jsx(uu,{value:g.progress,className:"h-1 mt-2"}),g.status==="failed"&&g.erro&&l.jsxs("div",{className:"flex items-center gap-1 mt-2 text-xs text-red-600",children:[l.jsx(k.AlertCircle,{className:"h-3 w-3"}),l.jsx("span",{children:g.erro})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[L,g.status==="completed"&&l.jsxs(l.Fragment,{children:[s&&r&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>m(g,"view",r),disabled:y,children:l.jsx(k.Eye,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Visualizar"})]})}),a&&e&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>m(g,"download",e),disabled:j,children:l.jsx(k.Download,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Baixar"})]})}),i&&n&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>n(g),children:l.jsx(k.Trash2,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Remover"})]})})]})]})]})},x):l.jsxs("div",{className:w("flex items-center justify-between gap-2 p-3 border rounded-lg bg-muted/30 transition-colors",g.status==="failed"&&"border-red-200 bg-red-50/30"),children:[l.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[l.jsx(k.Paperclip,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx("span",{className:"text-sm truncate",children:K5(g.nomeOriginal,o)})}),l.jsx(at,{children:l.jsx("p",{className:"max-w-xs break-all",children:g.nomeOriginal})})]})}),g.status==="uploading"&&typeof g.progress=="number"&&l.jsxs("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:[g.progress,"%"]}),L]}),g.status==="completed"&&l.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[s&&r&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>m(g,"view",r),disabled:y,children:l.jsx(k.Eye,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Visualizar"})]})}),a&&e&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>m(g,"download",e),disabled:j,children:l.jsx(k.Download,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Baixar"})]})}),i&&n&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>n(g),children:l.jsx(k.Trash2,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Remover"})]})})]}),g.status==="failed"&&g.erro&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(k.AlertCircle,{className:"h-4 w-4 text-red-600 flex-shrink-0"})}),l.jsx(at,{children:l.jsx("p",{children:g.erro})})]})})]},x)})})}function eA({className:t,...e}){return l.jsx(Qe.Root,{"data-slot":"menubar",className:w("bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",t),...e})}function tA({...t}){return l.jsx(Qe.Menu,{"data-slot":"menubar-menu",...t})}function nA({...t}){return l.jsx(Qe.Group,{"data-slot":"menubar-group",...t})}function y4({...t}){return l.jsx(Qe.Portal,{"data-slot":"menubar-portal",...t})}function rA({...t}){return l.jsx(Qe.RadioGroup,{"data-slot":"menubar-radio-group",...t})}function aA({className:t,...e}){return l.jsx(Qe.Trigger,{"data-slot":"menubar-trigger",className:w("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none",t),...e})}function iA({className:t,align:e="start",alignOffset:n=-4,sideOffset:r=8,...a}){return l.jsx(y4,{children:l.jsx(Qe.Content,{"data-slot":"menubar-content",align:e,alignOffset:n,sideOffset:r,className:w("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",t),...a})})}function sA({className:t,inset:e,variant:n="default",...r}){return l.jsx(Qe.Item,{"data-slot":"menubar-item","data-inset":e,"data-variant":n,className:w("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r})}function oA({className:t,children:e,checked:n,...r}){return l.jsxs(Qe.CheckboxItem,{"data-slot":"menubar-checkbox-item",className:w("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),checked:n,...r,children:[l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(Qe.ItemIndicator,{children:l.jsx(k.CheckIcon,{className:"size-4"})})}),e]})}function lA({className:t,children:e,...n}){return l.jsxs(Qe.RadioItem,{"data-slot":"menubar-radio-item",className:w("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n,children:[l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(Qe.ItemIndicator,{children:l.jsx(k.CircleIcon,{className:"size-2 fill-current"})})}),e]})}function fA({className:t,inset:e,...n}){return l.jsx(Qe.Label,{"data-slot":"menubar-label","data-inset":e,className:w("px-2 py-1.5 text-sm font-semibold data-[inset]:pl-8",t),...n})}function cA({className:t,...e}){return l.jsx(Qe.Separator,{"data-slot":"menubar-separator",className:w("bg-border -mx-1 my-1 h-px",t),...e})}function dA({className:t,...e}){return l.jsx("span",{"data-slot":"menubar-shortcut",className:w("text-muted-foreground ml-auto text-xs tracking-widest",t),...e})}function uA({...t}){return l.jsx(Qe.Sub,{"data-slot":"menubar-sub",...t})}function hA({className:t,inset:e,children:n,...r}){return l.jsxs(Qe.SubTrigger,{"data-slot":"menubar-sub-trigger","data-inset":e,className:w("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[inset]:pl-8",t),...r,children:[n,l.jsx(k.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]})}function pA({className:t,...e}){return l.jsx(Qe.SubContent,{"data-slot":"menubar-sub-content",className:w("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),...e})}function mA({className:t,children:e,viewport:n=!0,...r}){return l.jsxs(Er.Root,{"data-slot":"navigation-menu","data-viewport":n,className:w("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",t),...r,children:[e,n&&l.jsx(vA,{})]})}function gA({className:t,...e}){return l.jsx(Er.List,{"data-slot":"navigation-menu-list",className:w("group flex flex-1 list-none items-center justify-center gap-1",t),...e})}function bA({className:t,...e}){return l.jsx(Er.Item,{"data-slot":"navigation-menu-item",className:w("relative",t),...e})}const v4=$t.cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1");function xA({className:t,children:e,...n}){return l.jsxs(Er.Trigger,{"data-slot":"navigation-menu-trigger",className:w(v4(),"group",t),...n,children:[e," ",l.jsx(k.ChevronDownIcon,{className:"relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})}function yA({className:t,...e}){return l.jsx(Er.Content,{"data-slot":"navigation-menu-content",className:w("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto","group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",t),...e})}function vA({className:t,...e}){return l.jsx("div",{className:w("absolute top-full left-0 isolate z-50 flex justify-center"),children:l.jsx(Er.Viewport,{"data-slot":"navigation-menu-viewport",className:w("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",t),...e})})}function wA({className:t,...e}){return l.jsx(Er.Link,{"data-slot":"navigation-menu-link",className:w("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",t),...e})}function MA({title:t,description:e,breadcrumbs:n,secondaryNavCollapsed:r=!1,onSecondaryNavToggle:a,className:i}){return l.jsxs("div",{className:w("border-b bg-background",i),children:[l.jsxs("div",{className:"flex h-14 items-center gap-4 px-6",children:[a&&l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:a,title:r?"Mostrar menu lateral":"Ocultar menu lateral",children:r?l.jsx(k.PanelLeftOpen,{className:"h-4 w-4"}):l.jsx(k.PanelLeftClose,{className:"h-4 w-4"})}),n&&n.length>0&&l.jsx(z0,{children:l.jsx(O0,{children:n.map((s,o)=>l.jsxs(I.Fragment,{children:[o>0&&l.jsx(H0,{}),l.jsx(P0,{children:o===n.length-1?l.jsx(B0,{children:s.label}):s.href?l.jsx(R0,{href:s.href,children:s.label}):l.jsx("span",{children:s.label})})]},o))})}),!n&&l.jsx("div",{className:"flex-1",children:l.jsx("h1",{className:"text-lg font-semibold",children:t})})]}),e&&l.jsx("div",{className:"border-t px-6 py-3",children:l.jsx("p",{className:"text-sm text-muted-foreground",children:e})})]})}function jA({title:t,icon:e,badge:n,secondaryNavCollapsed:r=!1,onSecondaryNavToggle:a,className:i}){return l.jsxs("div",{className:w("flex h-14 items-center gap-3 border-b bg-background px-6",i),children:[a&&l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:a,title:r?"Mostrar menu lateral":"Ocultar menu lateral",children:r?l.jsx(k.PanelLeftOpen,{className:"h-4 w-4"}):l.jsx(k.PanelLeftClose,{className:"h-4 w-4"})}),e&&l.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/10",children:l.jsx(e,{className:"h-4 w-4 text-primary"})}),l.jsx("h1",{className:"flex-1 text-lg font-semibold",children:t}),n&&l.jsx("div",{className:"shrink-0",children:n})]})}function CA({title:t,subtitle:e,actions:n,className:r}){return l.jsxs("div",{className:w("flex items-start justify-between gap-4",r),children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("h2",{className:"text-2xl font-semibold tracking-tight",children:t}),e&&l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e})]}),n&&l.jsx("div",{className:"flex items-center gap-2",children:n})]})}function LA({className:t,...e}){return l.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:w("mx-auto flex w-full justify-center",t),...e})}function NA({className:t,...e}){return l.jsx("ul",{"data-slot":"pagination-content",className:w("flex flex-row items-center gap-1",t),...e})}function kA({...t}){return l.jsx("li",{"data-slot":"pagination-item",...t})}function hu({className:t,isActive:e,size:n="icon",...r}){return l.jsx("a",{"aria-current":e?"page":void 0,"data-slot":"pagination-link","data-active":e,className:w(Jn({variant:e?"outline":"ghost",size:n}),t),...r})}function SA({className:t,...e}){return l.jsxs(hu,{"aria-label":"Go to previous page",size:"default",className:w("gap-1 px-2.5 sm:pl-2.5",t),...e,children:[l.jsx(k.ChevronLeftIcon,{}),l.jsx("span",{className:"hidden sm:block",children:"Previous"})]})}function TA({className:t,...e}){return l.jsxs(hu,{"aria-label":"Go to next page",size:"default",className:w("gap-1 px-2.5 sm:pr-2.5",t),...e,children:[l.jsx("span",{className:"hidden sm:block",children:"Next"}),l.jsx(k.ChevronRightIcon,{})]})}function IA({className:t,...e}){return l.jsxs("span",{"aria-hidden":!0,"data-slot":"pagination-ellipsis",className:w("flex size-9 items-center justify-center",t),...e,children:[l.jsx(k.MoreHorizontalIcon,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]})}const w4=I.forwardRef(({className:t,showToggle:e=!0,...n},r)=>{const[a,i]=I.useState(!1);return l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:a?"text":"password","data-slot":"input",className:w("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e&&"pr-10",t),ref:r,...n}),e&&l.jsx("button",{type:"button",onClick:()=>i(!a),className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",tabIndex:-1,"aria-label":a?"Hide password":"Show password",children:a?l.jsx(k.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(k.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})});w4.displayName="PasswordInput";function DA({className:t,...e}){return l.jsx(Nf.Root,{"data-slot":"radio-group",className:w("grid gap-3",t),...e})}function EA({className:t,...e}){return l.jsx(Nf.Item,{"data-slot":"radio-group-item",className:w("peer h-5 w-5 shrink-0 rounded-full border border-gray-300 bg-white shadow-sm transition-all hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:l.jsx(Nf.Indicator,{"data-slot":"radio-group-indicator",className:"flex items-center justify-center",children:l.jsx("div",{className:"h-2 w-2 rounded-full bg-white"})})})}function AA({className:t,...e}){return l.jsx(Nc.PanelGroup,{"data-slot":"resizable-panel-group",className:w("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...e})}function zA({...t}){return l.jsx(Nc.Panel,{"data-slot":"resizable-panel",...t})}function OA({withHandle:t,className:e,...n}){return l.jsx(Nc.PanelResizeHandle,{"data-slot":"resizable-handle",className:w("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",e),...n,children:t&&l.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:l.jsx(k.GripVerticalIcon,{className:"size-2.5"})})})}function PA({filters:t=[],onSelectFilter:e,onToggleFavorite:n,onDeleteFilter:r,className:a}){const i=t.filter(o=>o.isFavorite),s=t.filter(o=>!o.isFavorite);return l.jsxs(Hi,{children:[l.jsx(Fi,{asChild:!0,children:l.jsxs(F,{variant:"outline",size:"sm",className:w("gap-2",a),children:[l.jsx(k.Download,{className:"h-4 w-4"}),"Filtros salvos",t.length>0&&l.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",t.length,")"]})]})}),l.jsx(Ui,{align:"start",className:"w-[280px]",children:t.length===0?l.jsx("div",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:"No saved filters yet"}):l.jsxs(l.Fragment,{children:[i.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground",children:"Favorites"}),i.map(o=>l.jsx(f0,{filter:o,onSelect:e,onToggleFavorite:n,onDelete:r},o.id)),s.length>0&&l.jsx(Qs,{})]}),s.length>0&&l.jsxs(l.Fragment,{children:[i.length>0&&l.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground",children:"Todos filtros"}),s.map(o=>l.jsx(f0,{filter:o,onSelect:e,onToggleFavorite:n,onDelete:r},o.id))]})]})})]})}function f0({filter:t,onSelect:e,onToggleFavorite:n,onDelete:r}){return l.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5 hover:bg-muted rounded-sm group",children:[l.jsx("button",{onClick:a=>{a.stopPropagation(),n==null||n(t.id)},className:"p-1 hover:bg-accent rounded-sm",children:l.jsx(k.Star,{className:w("h-3.5 w-3.5",t.isFavorite?"fill-yellow-500 text-yellow-500":"text-muted-foreground")})}),l.jsxs("button",{onClick:()=>e==null?void 0:e(t.id),className:"flex-1 text-left px-2",children:[l.jsx("div",{className:"text-sm",children:t.name}),t.description&&l.jsx("div",{className:"text-xs text-muted-foreground",children:t.description}),t.filterCount!==void 0&&l.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:[t.filterCount," ",t.filterCount===1?"filter":"filters"]})]}),l.jsx("button",{onClick:a=>{a.stopPropagation(),r==null||r(t.id)},className:"p-1 hover:bg-accent rounded-sm opacity-0 group-hover:opacity-100 transition-opacity",children:l.jsx(k.Trash2,{className:"h-3.5 w-3.5 text-destructive"})})]})}function M4({...t}){return l.jsx(Ae.Root,{"data-slot":"sheet",...t})}function RA({...t}){return l.jsx(Ae.Trigger,{"data-slot":"sheet-trigger",...t})}function BA({...t}){return l.jsx(Ae.Close,{"data-slot":"sheet-close",...t})}function HA({...t}){return l.jsx(Ae.Portal,{"data-slot":"sheet-portal",...t})}const j4=I.forwardRef(({className:t,...e},n)=>l.jsx(Ae.Overlay,{ref:n,"data-slot":"sheet-overlay",className:w("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e}));j4.displayName=Ae.Overlay.displayName;function C4({className:t,children:e,side:n="right",...r}){return l.jsxs(HA,{children:[l.jsx(j4,{}),l.jsxs(Ae.Content,{"data-slot":"sheet-content",className:w("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...r,children:[e,l.jsxs(Ae.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[l.jsx(k.XIcon,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function L4({className:t,...e}){return l.jsx("div",{"data-slot":"sheet-header",className:w("flex flex-col gap-1.5 p-4",t),...e})}function FA({className:t,...e}){return l.jsx("div",{"data-slot":"sheet-footer",className:w("mt-auto flex flex-col gap-2 p-4",t),...e})}function N4({className:t,...e}){return l.jsx(Ae.Title,{"data-slot":"sheet-title",className:w("text-foreground font-semibold leading-[1.2]",t),...e})}function k4({className:t,...e}){return l.jsx(Ae.Description,{"data-slot":"sheet-description",className:w("text-muted-foreground text-sm leading-relaxed",t),...e})}const Lf=768;function S4(){const[t,e]=I.useState(void 0);return I.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Lf-1}px)`),r=()=>{e(window.innerWidth<Lf)};return n.addEventListener("change",r),e(window.innerWidth<Lf),()=>n.removeEventListener("change",r)},[]),!!t}const UA="sidebar_state",_A=3600*24*7,JA="16rem",VA="18rem",GA="3rem",YA="b",T4=I.createContext(null);function rs(){const t=I.useContext(T4);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function QA({defaultOpen:t=!0,open:e,onOpenChange:n,className:r,style:a,children:i,...s}){const o=S4(),[f,c]=I.useState(!1),[d,u]=I.useState(t),p=e??d,h=I.useCallback(x=>{const v=typeof x=="function"?x(p):x;n?n(v):u(v),document.cookie=`${UA}=${v}; path=/; max-age=${_A}`},[n,p]),m=I.useCallback(()=>o?c(x=>!x):h(x=>!x),[o,h,c]);I.useEffect(()=>{const x=v=>{v.key===YA&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),m())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[m]);const g=p?"expanded":"collapsed",b=I.useMemo(()=>({state:g,open:p,setOpen:h,isMobile:o,openMobile:f,setOpenMobile:c,toggleSidebar:m}),[g,p,h,o,f,c,m]);return l.jsx(T4.Provider,{value:b,children:l.jsx(It,{delayDuration:0,children:l.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":JA,"--sidebar-width-icon":GA,...a},className:w("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...s,children:i})})})}function WA({side:t="left",variant:e="sidebar",collapsible:n="offcanvas",className:r,children:a,...i}){const{isMobile:s,state:o,openMobile:f,setOpenMobile:c}=rs();return n==="none"?l.jsx("div",{"data-slot":"sidebar",className:w("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...i,children:a}):s?l.jsx(M4,{open:f,onOpenChange:c,...i,children:l.jsxs(C4,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":VA},side:t,children:[l.jsxs(L4,{className:"sr-only",children:[l.jsx(N4,{children:"Sidebar"}),l.jsx(k4,{children:"Displays the mobile sidebar."})]}),l.jsx("div",{className:"flex h-full w-full flex-col",children:a})]})}):l.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":o,"data-collapsible":o==="collapsed"?n:"","data-variant":e,"data-side":t,"data-slot":"sidebar",children:[l.jsx("div",{"data-slot":"sidebar-gap",className:w("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),l.jsx("div",{"data-slot":"sidebar-container",className:w("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:l.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:a})})]})}function $A({className:t,onClick:e,...n}){const{toggleSidebar:r}=rs();return l.jsxs(F,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:w("size-7",t),onClick:a=>{e==null||e(a),r()},...n,children:[l.jsx(k.PanelLeftIcon,{}),l.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function ZA({className:t,...e}){const{toggleSidebar:n}=rs();return l.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:w("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...e})}function qA({className:t,...e}){return l.jsx("main",{"data-slot":"sidebar-inset",className:w("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),...e})}function KA({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:w("flex flex-col gap-2 p-2",t),...e})}function XA({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:w("flex flex-col gap-2 p-2",t),...e})}function e8({className:t,...e}){return l.jsx(Hn,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:w("bg-sidebar-border mx-2 w-auto",t),...e})}function t8({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:w("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...e})}function n8({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:w("relative flex w-full min-w-0 flex-col p-2",t),...e})}function r8({className:t,asChild:e=!1,...n}){const r=e?kn.Slot:"div";return l.jsx(r,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:w("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...n})}function a8({className:t,asChild:e=!1,...n}){const r=e?kn.Slot:"button";return l.jsx(r,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:w("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",t),...n})}function i8({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:w("w-full text-sm",t),...e})}function s8({className:t,...e}){return l.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:w("flex w-full min-w-0 flex-col gap-1",t),...e})}function o8({className:t,...e}){return l.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:w("group/menu-item relative",t),...e})}const l8=$t.cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function f8({asChild:t=!1,isActive:e=!1,variant:n="default",size:r="default",tooltip:a,className:i,...s}){const o=t?kn.Slot:"button",{isMobile:f,state:c}=rs(),d=l.jsx(o,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":e,className:w(l8({variant:n,size:r}),i),...s});return a?(typeof a=="string"&&(a={children:a}),l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:d}),l.jsx(at,{side:"right",align:"center",hidden:c!=="collapsed"||f,...a})]})):d}function c8({className:t,asChild:e=!1,showOnHover:n=!1,...r}){const a=e?kn.Slot:"button";return l.jsx(a,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:w("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",t),...r})}function d8({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:w("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...e})}function u8({className:t,showIcon:e=!1,...n}){const r=I.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return l.jsxs("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:w("flex h-8 items-center gap-2 rounded-md px-2",t),...n,children:[e&&l.jsx(Bn,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),l.jsx(Bn,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})}function h8({className:t,...e}){return l.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:w("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...e})}function p8({className:t,...e}){return l.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:w("group/menu-sub-item relative",t),...e})}function m8({asChild:t=!1,size:e="md",isActive:n=!1,className:r,...a}){const i=t?kn.Slot:"a";return l.jsx(i,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":e,"data-active":n,className:w("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",e==="sm"&&"text-xs",e==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...a})}function I4({className:t,defaultValue:e,value:n,min:r=0,max:a=100,...i}){const s=I.useMemo(()=>Array.isArray(n)?n:Array.isArray(e)?e:[r,a],[n,e,r,a]);return l.jsxs(hs.Root,{"data-slot":"slider",defaultValue:e,value:n,min:r,max:a,className:w("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...i,children:[l.jsx(hs.Track,{"data-slot":"slider-track",className:w("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-4 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:l.jsx(hs.Range,{"data-slot":"slider-range",className:w("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:s.length},(o,f)=>l.jsx(hs.Thumb,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},f))]})}const D4=$t.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-white dark:bg-zinc-900 border border-input hover:bg-accent hover:text-accent-foreground text-foreground",google:"bg-white dark:bg-zinc-900 border border-input hover:bg-accent text-foreground",github:"bg-[#24292F] hover:bg-[#24292F]/90 text-white dark:bg-[#24292F] dark:hover:bg-[#24292F]/80",facebook:"bg-[#1877F2] hover:bg-[#1877F2]/90 text-white",apple:"bg-black hover:bg-black/90 text-white dark:bg-white dark:hover:bg-white/90 dark:text-black",microsoft:"bg-white dark:bg-zinc-900 border border-input hover:bg-accent text-foreground"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),g8=()=>l.jsxs("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"none",children:[l.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),l.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),l.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),l.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),b8=()=>l.jsx("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"currentColor",children:l.jsx("path",{d:"M17.05 20.28c-.98.95-2.05.88-3.08.4-1.09-.5-2.08-.48-3.24 0-1.44.62-2.2.44-3.06-.4C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09l.01-.01zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})}),x8=()=>l.jsx("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"currentColor",children:l.jsx("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})}),y8=()=>l.jsxs("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"none",children:[l.jsx("path",{d:"M11.4 11.4H2V2h9.4v9.4z",fill:"#F25022"}),l.jsx("path",{d:"M22 11.4h-9.4V2H22v9.4z",fill:"#7FBA00"}),l.jsx("path",{d:"M11.4 22H2v-9.4h9.4V22z",fill:"#00A4EF"}),l.jsx("path",{d:"M22 22h-9.4v-9.4H22V22z",fill:"#FFB900"})]}),E4=I.forwardRef(({className:t,variant:e,size:n,provider:r,children:a,...i},s)=>{const o=e||r,f=()=>{switch(r){case"google":return l.jsx(g8,{});case"github":return l.jsx(k.Github,{className:"h-5 w-5"});case"facebook":return l.jsx(x8,{});case"apple":return l.jsx(b8,{});case"microsoft":return l.jsx(y8,{});default:return null}},c=()=>`Continue with ${{google:"Google",github:"GitHub",facebook:"Facebook",apple:"Apple",microsoft:"Microsoft"}[r]}`;return l.jsxs("button",{className:w(D4({variant:o,size:n,className:t})),ref:s,...i,children:[f(),l.jsx("span",{children:a||c()})]})});E4.displayName="SocialButton";function A4({className:t,...e}){return l.jsx(bu.Root,{"data-slot":"switch",className:w("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-switch-background focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:l.jsx(bu.Thumb,{"data-slot":"switch-thumb",className:w("bg-card dark:data-[state=unchecked]:bg-card-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}const v8=[{value:"not-started",label:"Não iniciada",color:"bg-gray-500"},{value:"in-progress",label:"Em progresso",color:"bg-primary"},{value:"on-hold",label:"Em espera",color:"bg-cyan-500"},{value:"completed",label:"Concluída",color:"bg-green-500"},{value:"delayed",label:"Atrasada",color:"bg-red-500"},{value:"cancelled",label:"Cancelada",color:"bg-orange-500"}];function w8({task:t,open:e,onOpenChange:n,onSave:r,availableTasks:a=[],availableAssignees:i=[]}){var x;const[s,o]=I.useState(null),[f,c]=I.useState(!1),[d,u]=I.useState(!1);if(I.useEffect(()=>{t&&o({...t})},[t]),!s)return null;const p=()=>{r(s),n(!1)},h=(v,j)=>{o(y=>y?{...y,[v]:j}:null)},m=v=>{o(j=>{if(!j)return null;const y=j.dependencies||[],L=y.includes(v)?y.filter(C=>C!==v):[...y,v];return{...j,dependencies:L}})},g=a.filter(v=>v.id!==s.id),b=s.name.trim()!==""&&s.startDate<=s.endDate;return l.jsx(_i,{open:e,onOpenChange:n,children:l.jsxs(Ji,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[l.jsxs(Vi,{children:[l.jsx(Gi,{children:"Editar Tarefa"}),l.jsx(Yi,{children:'Altere os detalhes da tarefa abaixo. As mudanças serão salvas ao clicar em "Salvar alterações".'})]}),l.jsxs("div",{className:"space-y-6 py-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{htmlFor:"task-name",children:"Nome da Tarefa *"}),l.jsx(Ht,{id:"task-name",value:s.name,onChange:v=>h("name",v.target.value),placeholder:"Ex: Briefing com cliente"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{htmlFor:"task-description",children:"Descrição"}),l.jsx(ru,{id:"task-description",value:s.description||"",onChange:v=>h("description",v.target.value),placeholder:"Adicione detalhes sobre esta tarefa...",rows:3})]}),l.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{children:"Data de Início *"}),l.jsxs(st,{open:f,onOpenChange:c,children:[l.jsx($e,{asChild:!0,children:l.jsxs(F,{variant:"outline",className:w("w-full justify-start text-left font-normal",!s.startDate&&"text-muted-foreground"),children:[l.jsx(k.CalendarIcon,{className:"mr-2 size-4"}),s.startDate?H.format(s.startDate,"dd/MM/yyyy",{locale:yt}):"Selecionar data"]})}),l.jsx(Ze,{className:"w-auto p-0",align:"start",children:l.jsx(Calendar,{mode:"single",selected:s.startDate,onSelect:v=>{v&&(h("startDate",v),c(!1))},initialFocus:!0})})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{children:"Data de Término *"}),l.jsxs(st,{open:d,onOpenChange:u,children:[l.jsx($e,{asChild:!0,children:l.jsxs(F,{variant:"outline",className:w("w-full justify-start text-left font-normal",!s.endDate&&"text-muted-foreground"),children:[l.jsx(k.CalendarIcon,{className:"mr-2 size-4"}),s.endDate?H.format(s.endDate,"dd/MM/yyyy",{locale:yt}):"Selecionar data"]})}),l.jsx(Ze,{className:"w-auto p-0",align:"start",children:l.jsx(Calendar,{mode:"single",selected:s.endDate,onSelect:v=>{v&&(h("endDate",v),u(!1))},disabled:v=>s.startDate?v<s.startDate:!1,initialFocus:!0})})]})]})]}),s.startDate>s.endDate&&l.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-900",children:[l.jsx(k.AlertCircle,{className:"size-4 text-red-600 flex-shrink-0"}),l.jsx("p",{className:"text-sm text-red-900 dark:text-red-200",children:"A data de término deve ser posterior à data de início"})]}),l.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{htmlFor:"task-status",children:"Status"}),l.jsxs(en,{value:s.status,onValueChange:v=>h("status",v),children:[l.jsx(nn,{id:"task-status",children:l.jsx(tn,{})}),l.jsx(rn,{children:v8.map(v=>l.jsx(Dt,{value:v.value,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:w("size-2 rounded-full",v.color)}),v.label]})},v.value))})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{htmlFor:"task-assignee",children:"Responsável"}),l.jsxs(en,{value:((x=s.assignee)==null?void 0:x.name)||"",onValueChange:v=>{const j=i.find(y=>y.name===v);h("assignee",j||void 0)},children:[l.jsx(nn,{id:"task-assignee",children:l.jsx(tn,{placeholder:"Selecionar responsável"})}),l.jsx(rn,{children:i.map(v=>l.jsx(Dt,{value:v.name,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(k.User,{className:"size-4"}),v.name]})},v.name))})]})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(Ue,{children:"Progresso"}),l.jsxs("span",{className:"text-sm font-medium",children:[s.progress,"%"]})]}),l.jsx(I4,{value:[s.progress],onValueChange:v=>h("progress",v[0]),max:100,step:5,className:"w-full"}),l.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[l.jsx("span",{children:"0%"}),l.jsx("span",{children:"50%"}),l.jsx("span",{children:"100%"})]})]}),l.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border",children:[l.jsxs("div",{className:"space-y-0.5",children:[l.jsx(Ue,{htmlFor:"milestone-toggle",className:"cursor-pointer",children:"Marco Importante (Milestone)"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Marcos aparecem como losangos no cronograma"})]}),l.jsx(A4,{id:"milestone-toggle",checked:s.milestone||!1,onCheckedChange:v=>h("milestone",v)})]}),g.length>0&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(k.Link2,{className:"size-4 text-muted-foreground"}),l.jsx(Ue,{children:"Dependências"})]}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Selecione as tarefas que precisam ser concluídas antes desta"}),l.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto border rounded-lg p-3",children:g.map(v=>{var y;const j=((y=s.dependencies)==null?void 0:y.includes(v.id))||!1;return l.jsxs("div",{className:w("flex items-center gap-3 p-2 rounded-md cursor-pointer transition-colors",j?"bg-primary/10 border border-primary/20":"hover:bg-muted/50"),onClick:()=>m(v.id),children:[l.jsx("div",{className:w("size-4 rounded border-2 flex items-center justify-center transition-all",j?"bg-primary border-primary":"border-muted-foreground"),children:j&&l.jsx("div",{className:"size-2 rounded-sm bg-white"})}),l.jsx("span",{className:"text-sm flex-1",children:v.name}),v.assignee&&l.jsx(pe,{variant:"outline",className:"text-xs",children:v.assignee.name})]},v.id)})}),s.dependencies&&s.dependencies.length>0&&l.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.dependencies.length," dependência(s) selecionada(s)"]})]})]}),l.jsxs(Zo,{children:[l.jsx(F,{variant:"outline",onClick:()=>n(!1),children:"Cancelar"}),l.jsx(F,{onClick:p,disabled:!b,children:"Salvar alterações"})]})]})})}const M8=t=>{switch(t){case"create":return l.jsx(k.PlusCircle,{className:"h-4 w-4 text-green-600"});case"status_change":return l.jsx(k.RefreshCw,{className:"h-4 w-4 text-blue-600"});case"comment":return l.jsx(k.MessageSquare,{className:"h-4 w-4 text-slate-500"});case"upload":return l.jsx(k.Paperclip,{className:"h-4 w-4 text-orange-600"});case"assignment":return l.jsx(k.User,{className:"h-4 w-4 text-purple-600"});case"update":return l.jsx(k.Pencil,{className:"h-4 w-4 text-amber-600"});default:return l.jsx(k.Circle,{className:"h-4 w-4 text-slate-400"})}},j8=t=>{switch(t){case"create":return"bg-green-50 border-green-200";case"status_change":return"bg-blue-50 border-blue-200";case"comment":return"bg-slate-50 border-slate-200";case"upload":return"bg-orange-50 border-orange-200";case"assignment":return"bg-purple-50 border-purple-200";case"update":return"bg-amber-50 border-amber-200";default:return"bg-slate-50 border-slate-200"}},C8=({event:t,isLast:e,onDetailsOpen:n})=>{var o,f,c,d,u,p,h;const[r,a]=I.useState(!1),i=!!((o=t.metadata)!=null&&o.before||(f=t.metadata)!=null&&f.after||(c=t.metadata)!=null&&c.details),s=m=>{a(m),m&&n&&n(t)};return l.jsxs("div",{className:"flex gap-4 group",children:[l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("div",{className:w("flex items-center justify-center w-8 h-8 rounded-full border shadow-sm z-10 transition-colors","bg-background group-hover:border-primary/50",j8(t.action)),children:M8(t.action)}),!e&&l.jsx("div",{className:"w-px h-full bg-border group-hover:bg-primary/20 transition-colors min-h-[2rem]"})]}),l.jsx("div",{className:"flex-1 pb-8 min-w-0",children:l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground/90",children:[l.jsx("span",{className:"font-semibold",children:t.user.name}),l.jsx("span",{className:"text-muted-foreground font-normal",children:t.title})]}),l.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",title:H.format(t.timestamp,"PPpp",{locale:yt}),children:H.formatDistanceToNow(t.timestamp,{addSuffix:!0,locale:yt})})]}),i&&l.jsxs(J0,{open:r,onOpenChange:s,className:"mt-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[t.action==="upload"&&((d=t.metadata)==null?void 0:d.fileName)&&l.jsxs(pe,{variant:"outline",className:"gap-1 font-normal bg-muted/30 text-muted-foreground hover:bg-muted/50",children:[l.jsx(k.FileText,{className:"h-3 w-3"}),t.metadata.fileName]}),l.jsx(V0,{asChild:!0,children:l.jsxs(F,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs text-muted-foreground hover:text-primary gap-1",children:[r?"Ocultar detalhes":"Ver detalhes",l.jsx(k.ChevronRight,{className:w("h-3 w-3 transition-transform duration-200",r&&"rotate-90")})]})})]}),l.jsx(G0,{className:"mt-2",children:l.jsxs("div",{className:"rounded-md border bg-muted/30 p-3 text-sm animate-in slide-in-from-top-2 duration-200",children:[(((u=t.metadata)==null?void 0:u.before)||((p=t.metadata)==null?void 0:p.after))&&l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-4",children:[t.metadata.before&&l.jsx("div",{className:"flex-1 p-2 rounded bg-background/50 border border-dashed text-muted-foreground line-through text-xs",children:t.metadata.before}),t.metadata.before&&t.metadata.after&&l.jsx(k.ArrowRight,{className:"h-4 w-4 text-muted-foreground hidden sm:block"}),t.metadata.after&&l.jsx("div",{className:"flex-1 p-2 rounded bg-background border border-l-4 border-l-[#7F26BF] shadow-sm text-foreground text-xs font-medium",children:t.metadata.after})]}),((h=t.metadata)==null?void 0:h.details)&&l.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none text-xs",children:t.metadata.details})]})})]})]})})]})},L8=({events:t,className:e,onDetailsOpen:n})=>l.jsx("div",{className:w("flex flex-col",e),children:t.map((r,a)=>l.jsx(C8,{event:r,isLast:a===t.length-1,onDetailsOpen:n},r.id))});function N8(t){const{theme:e="system"}=Sx.useTheme();return l.jsx(h0.Toaster,{theme:e,className:"toaster group",toastOptions:{unstyled:!0,classNames:{toast:"w-full rounded-lg border px-4 py-3 shadow-lg flex items-start gap-3 bg-card text-card-foreground border-border",title:"font-semibold text-sm leading-[1.2]",description:"text-sm mt-1 leading-relaxed",actionButton:"inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-8 px-3",cancelButton:"inline-flex items-center justify-center rounded-md text-sm font-medium bg-muted text-muted-foreground hover:bg-muted/90 h-8 px-3",closeButton:"absolute right-2 top-2 rounded-md p-1 text-foreground/50 hover:text-foreground",error:"!bg-red-50 dark:!bg-red-950/30 !text-red-700 dark:!text-red-400 !border-red-200 dark:!border-red-800 [&_[data-title]]:text-red-700 dark:[&_[data-title]]:text-red-400 [&_[data-description]]:text-red-700/90 dark:[&_[data-description]]:text-red-400/90",success:"!bg-green-100 dark:!bg-green-950/30 !text-green-800 dark:!text-green-400 !border-green-300 dark:!border-green-800 [&_[data-title]]:text-green-800 dark:[&_[data-title]]:text-green-400 [&_[data-description]]:text-green-800 dark:[&_[data-description]]:text-green-400",warning:"!bg-yellow-50 dark:!bg-yellow-950/30 !text-yellow-700 dark:!text-yellow-400 !border-yellow-200 dark:!border-yellow-800 [&_[data-title]]:text-yellow-700 dark:[&_[data-title]]:text-yellow-400 [&_[data-description]]:text-yellow-700/90 dark:[&_[data-description]]:text-yellow-400/90",info:"!bg-cyan-50 dark:!bg-cyan-950/30 !text-cyan-700 dark:!text-cyan-400 !border-cyan-200 dark:!border-cyan-800 [&_[data-title]]:text-cyan-700 dark:[&_[data-title]]:text-cyan-400 [&_[data-description]]:text-cyan-700/90 dark:[&_[data-description]]:text-cyan-400/90"}},...t})}const z4=I.createContext({size:"default",variant:"default"});function k8({className:t,variant:e,size:n,children:r,...a}){return l.jsx(p0.Root,{"data-slot":"toggle-group","data-variant":e,"data-size":n,className:w("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",t),...a,children:l.jsx(z4.Provider,{value:{variant:e,size:n},children:r})})}function S8({className:t,children:e,variant:n,size:r,...a}){const i=I.useContext(z4);return l.jsx(p0.Item,{"data-slot":"toggle-group-item","data-variant":i.variant||n,"data-size":i.size||r,className:w(au({variant:i.variant||n,size:i.size||r}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",t),...a,children:e})}const O4=I.createContext(void 0);function P4(){const t=I.useContext(O4);if(!t)throw new Error("UnderlineTabs components must be used within UnderlineTabs");return t}function T8({defaultValue:t,value:e,onValueChange:n,children:r,className:a}){const[i,s]=I.useState(t||""),o=e!==void 0?e:i,f=c=>{e===void 0&&s(c),n==null||n(c)};return l.jsx(O4.Provider,{value:{value:o,onValueChange:f},children:l.jsx("div",{className:w("w-full",a),role:"tablist",children:r})})}function I8({children:t,className:e}){return l.jsx("div",{className:w("border-b border-border bg-background",e),children:l.jsx("div",{className:"flex",children:t})})}function D8({value:t,children:e,className:n,disabled:r=!1}){const{value:a,onValueChange:i}=P4(),s=a===t;return l.jsx("button",{type:"button",role:"tab","aria-selected":s,"aria-disabled":r,disabled:r,onClick:()=>!r&&i(t),className:w("px-4 h-12 text-sm font-medium border-b-2 transition-colors relative","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50",s?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-border",n),children:e})}function E8({value:t,children:e,className:n}){const{value:r}=P4();return r!==t?null:l.jsx("div",{role:"tabpanel","aria-labelledby":t,className:w("mt-4",n),children:e})}function A8(t,e){const n=e*1024*1024;return t.size>n?`Arquivo muito grande. Máximo: ${e}MB`:null}function z8(t,e){if(!e)return null;const n=e.split(",").map(s=>s.trim().toLowerCase()),r=t.name.toLowerCase(),a=t.type.toLowerCase();return n.some(s=>{if(s.includes("*")){const[o]=s.split("/");return a.startsWith(o+"/")}return s.startsWith(".")?r.endsWith(s):a===s})?null:"Tipo de arquivo não suportado"}function O8({onFilesSelected:t,accept:e,multiple:n=!0,maxFiles:r=10,maxSizeMB:a=50,disabled:i=!1,isUploading:s=!1,title:o="Clique para fazer upload de arquivos",description:f,icon:c,className:d,onError:u}){const[p,h]=M.useState(!1),m=M.useRef(null),g=M.useCallback(N=>{u==null||u(N)},[u]),b=M.useCallback(N=>{if(!N||N.length===0)return;const S=Array.from(N);if(S.length>r){g(`Máximo de ${r} arquivo(s) permitido(s)`);return}const T=[],z=[];for(const P of S){const U=A8(P,a);if(U){z.push(`${P.name}: ${U}`);continue}const J=z8(P,e);if(J){z.push(`${P.name}: ${J}`);continue}T.push(P)}z.length>0&&g(z.join(`
|
|
223
223
|
`)),T.length>0&&t(T),m.current&&(m.current.value="")},[r,a,e,t,g]),x=M.useCallback(()=>{var N;i||s||(N=m.current)==null||N.click()},[i,s]),v=M.useCallback(N=>{b(N.target.files)},[b]),j=M.useCallback(N=>{N.preventDefault(),N.stopPropagation(),!i&&!s&&h(!0)},[i,s]),y=M.useCallback(N=>{N.preventDefault(),N.stopPropagation(),h(!1)},[]),L=M.useCallback(N=>{N.preventDefault(),N.stopPropagation(),h(!1),!(i||s)&&b(N.dataTransfer.files)},[i,s,b]),C=f||(()=>{const N=[];if(e){const S=e.split(",").map(T=>T.trim().replace(".","").toUpperCase()).join(", ");N.push(S)}return a&&N.push(`máx ${a}MB cada`),N.join(" • ")})();return l.jsxs("div",{className:w("relative border-2 border-dashed rounded-lg p-8 text-center transition-all cursor-pointer","hover:border-primary/50 hover:bg-muted/30",p&&"border-primary bg-primary/5 scale-[1.02]",(i||s)&&"opacity-50 cursor-not-allowed hover:border-dashed hover:bg-transparent",s&&"animate-pulse",d),onClick:x,onDragOver:j,onDragLeave:y,onDrop:L,children:[l.jsx("input",{ref:m,type:"file",multiple:n,accept:e,className:"hidden",onChange:v,disabled:i||s}),l.jsxs("div",{className:"flex flex-col items-center gap-3",children:[c||l.jsx("div",{className:w("transition-transform",p&&"scale-110"),children:s?l.jsx("div",{className:"h-12 w-12 mx-auto",children:l.jsxs("svg",{className:"animate-spin h-12 w-12 text-primary",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.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"})]})}):l.jsx(k.Upload,{className:w("h-12 w-12 mx-auto text-muted-foreground transition-colors",p&&"text-primary")})}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:w("font-medium transition-colors",p&&"text-primary",s&&"text-muted-foreground"),children:s?"Enviando arquivos...":p?"Solte os arquivos aqui":o}),C&&l.jsx("p",{className:"text-xs text-muted-foreground",children:C}),!i&&!s&&n&&r>1&&l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Você pode selecionar até ",r," arquivo(s)"]})]}),i&&l.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[l.jsx(k.AlertCircle,{className:"h-3 w-3"}),l.jsx("span",{children:"Upload desabilitado"})]})]})]})}const P8={sm:"w-24 h-24",md:"w-32 h-32",lg:"w-48 h-48"};function Jr({src:t,alt:e,size:n="md",className:r}){return l.jsx("img",{src:t,alt:e,className:w(P8[n],"object-contain",r)})}function R4({size:t="md",className:e}){return l.jsx(Jr,{src:"/illustrations/empty-task-approved.png",alt:"Caixa de entrada vazia",size:t,className:e})}function B4({size:t="md",className:e}){return l.jsx(Jr,{src:"/illustrations/empty-no-results.png",alt:"Nenhum resultado encontrado",size:t,className:e})}function H4({size:t="md",className:e}){return l.jsx(Jr,{src:"/illustrations/create-record.png",alt:"Nenhum projeto criado",size:t,className:e})}function F4({size:t="md",className:e}){return l.jsx(Jr,{src:"/illustrations/scheduled-tasks.png",alt:"Calendário sem eventos",size:t,className:e})}function U4({size:t="md",className:e}){return l.jsx(Jr,{src:"/illustrations/empty-not-found.png",alt:"Erro ou item não encontrado",size:t,className:e})}function _4({size:t="md",className:e}){return l.jsx(Jr,{src:"/illustrations/success-checkmark.png",alt:"Ação concluída com sucesso",size:t,className:e})}function J4({size:t="md",className:e}){return l.jsx(Jr,{src:"/illustrations/contract-agreement.png",alt:"Nenhum contrato cadastrado",size:t,className:e})}const R8={EmptyInbox:R4,EmptySearch:B4,EmptyProjects:H4,EmptyCalendar:F4,EmptyContracts:J4,ErrorState:U4,SuccessState:_4};function B8({data:t,showPreview:e=!1,logo:n}){const r=i=>new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(i),a=i=>new Date(i).toLocaleDateString("pt-BR",{year:"numeric",month:"long",day:"numeric"});return l.jsxs("div",{className:w("proposal-template bg-white text-black",e?"shadow-lg rounded-lg p-8 max-w-5xl mx-auto my-8":"p-0"),style:{fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"12pt",lineHeight:"1.6"},children:[l.jsx(eu,{logo:n,companyName:t.agency.name,contactInfo:{email:t.agency.email,phone:t.agency.phone},documentType:"Proposta Comercial",documentNumber:t.proposalNumber,issueDate:a(t.issueDate)}),l.jsx(it,{children:l.jsx(mr,{columns:2,items:[{label:"Nº da Proposta",value:t.proposalNumber,highlight:!0},{label:"Validade",value:a(t.validUntil)},{label:"Cliente",value:t.client.name,highlight:!0},...t.client.contact?[{label:"Contato",value:t.client.contact}]:[]]})}),l.jsxs(it,{title:"Projeto",children:[l.jsx("h3",{className:"text-base font-semibold text-primary mb-3",children:t.projectTitle}),t.projectDescription&&l.jsx("p",{className:"text-sm text-gray-700 leading-relaxed",children:t.projectDescription})]}),t.objectives&&t.objectives.length>0&&l.jsx(it,{title:"Objetivos",children:l.jsx("ul",{className:"list-disc list-inside space-y-2",children:t.objectives.map((i,s)=>l.jsx("li",{className:"text-sm text-gray-700",children:i},s))})}),l.jsxs(it,{title:"Escopo e Investimento",children:[l.jsx(Vo,{columns:[{header:"Item",key:"name",width:"35%"},{header:"Descrição",key:"description",width:"30%"},{header:"Qtd.",key:"quantity",align:"center",width:"10%",render:i=>i||"-"},{header:"Valor Unit.",key:"unitPrice",align:"right",width:"12.5%",render:i=>i?r(i):"-"},{header:"Valor Total",key:"totalPrice",align:"right",width:"12.5%",render:i=>r(i)}],data:t.items,striped:!0,density:"comfortable"}),l.jsx("div",{className:"mt-6 flex justify-end",children:l.jsxs("div",{className:"w-80 space-y-2",children:[l.jsxs("div",{className:"flex justify-between text-sm",children:[l.jsx("span",{className:"text-gray-600",children:"Subtotal:"}),l.jsx("span",{className:"font-semibold",children:r(t.subtotal)})]}),t.discount&&t.discount>0&&l.jsxs("div",{className:"flex justify-between text-sm",children:[l.jsx("span",{className:"text-gray-600",children:"Desconto:"}),l.jsxs("span",{className:"font-semibold text-green-600",children:["- ",r(t.discount)]})]}),l.jsxs("div",{className:"border-t-2 border-primary pt-2 flex justify-between",children:[l.jsx("span",{className:"font-semibold text-base",children:"Total:"}),l.jsx("span",{className:"font-semibold text-lg text-primary",children:r(t.total)})]})]})})]}),(t.paymentConditions||t.deliveryTime)&&l.jsx(it,{title:"Condições Comerciais",children:l.jsx(mr,{columns:1,items:[...t.paymentConditions?[{label:"Forma de Pagamento",value:t.paymentConditions}]:[],...t.deliveryTime?[{label:"Prazo de Entrega",value:t.deliveryTime}]:[]]})}),t.notes&&l.jsx(it,{title:"Observações",children:l.jsx("p",{className:"text-sm text-gray-700 leading-relaxed",children:t.notes})}),l.jsx(tu,{signatures:[{label:"APROVAÇÃO DO CLIENTE",name:t.client.name,role:t.client.contact}],layout:"vertical",instructionText:"Para aprovar esta proposta, assine abaixo e retorne para o e-mail indicado no cabeçalho."}),l.jsx(Xd,{pageNumber:1,totalPages:1,footerText:`Proposta válida até ${a(t.validUntil)}`})]})}Object.defineProperty(exports,"toast",{enumerable:!0,get:()=>h0.toast});exports.Accordion=zx;exports.AccordionContent=Rx;exports.AccordionItem=Ox;exports.AccordionTrigger=Px;exports.AdvancedDataTable=k0;exports.Alert=Ay;exports.AlertDescription=Oy;exports.AlertDialog=Py;exports.AlertDialogAction=Vy;exports.AlertDialogCancel=Gy;exports.AlertDialogContent=Hy;exports.AlertDialogDescription=Jy;exports.AlertDialogFooter=Uy;exports.AlertDialogHeader=Fy;exports.AlertDialogTitle=_y;exports.AlertDialogTrigger=Ry;exports.AlertTitle=zy;exports.AppLayoutPrimaryNav=nv;exports.AppLayoutSecondaryNav=rv;exports.AppLayoutUserMenu=E0;exports.AspectRatio=av;exports.AuthLayout=A0;exports.Avatar=Ft;exports.AvatarFallback=Ut;exports.AvatarImage=Ln;exports.Badge=pe;exports.BrandLogo=Ys;exports.Breadcrumb=z0;exports.BreadcrumbEllipsis=iv;exports.BreadcrumbItem=P0;exports.BreadcrumbLink=R0;exports.BreadcrumbList=O0;exports.BreadcrumbPage=B0;exports.BreadcrumbSeparator=H0;exports.Button=F;exports.Calendar=Qo;exports.Card=jr;exports.CardAction=Bx;exports.CardContent=ca;exports.CardDescription=m0;exports.CardFooter=g0;exports.CardHeader=la;exports.CardTitle=fa;exports.Carousel=sv;exports.CarouselContent=ov;exports.CarouselItem=lv;exports.CarouselNext=cv;exports.CarouselPrevious=fv;exports.ChartContainer=uv;exports.ChartLegend=gv;exports.ChartLegendContent=bv;exports.ChartTooltip=pv;exports.ChartTooltipContent=mv;exports.Checkbox=C0;exports.Collapsible=J0;exports.CollapsibleContent=G0;exports.CollapsibleTrigger=V0;exports.ColorPicker=xv;exports.Command=Q0;exports.CommandDialog=Mv;exports.CommandEmpty=Lv;exports.CommandGroup=Nv;exports.CommandInput=jv;exports.CommandItem=Sv;exports.CommandList=Cv;exports.CommandSeparator=kv;exports.CommandShortcut=Tv;exports.CommentSystem=TI;exports.CompactPageHeader=jA;exports.ContentSectionHeader=CA;exports.ContextMenu=II;exports.ContextMenuCheckboxItem=FI;exports.ContextMenuContent=BI;exports.ContextMenuGroup=EI;exports.ContextMenuItem=HI;exports.ContextMenuLabel=_I;exports.ContextMenuPortal=AI;exports.ContextMenuRadioGroup=OI;exports.ContextMenuRadioItem=UI;exports.ContextMenuSeparator=JI;exports.ContextMenuShortcut=VI;exports.ContextMenuSub=zI;exports.ContextMenuSubContent=RI;exports.ContextMenuSubTrigger=PI;exports.ContextMenuTrigger=DI;exports.ContractPrint=QI;exports.ContractPrintPreview=C2;exports.ContractTemplate=nu;exports.CurrencyInput=N2;exports.DataTable=N0;exports.DatePicker=Ec;exports.DateRangePicker=k2;exports.Dialog=_i;exports.DialogClose=wv;exports.DialogContent=Ji;exports.DialogDescription=Yi;exports.DialogFooter=Zo;exports.DialogHeader=Vi;exports.DialogTitle=Gi;exports.DialogTrigger=yv;exports.DocumentEditor=sD;exports.Drawer=oD;exports.DrawerClose=I2;exports.DrawerContent=E2;exports.DrawerDescription=z2;exports.DrawerFooter=cD;exports.DrawerHeader=fD;exports.DrawerTitle=A2;exports.DrawerTrigger=T2;exports.DropdownMenu=Hi;exports.DropdownMenuCheckboxItem=Qy;exports.DropdownMenuContent=Ui;exports.DropdownMenuGroup=I0;exports.DropdownMenuItem=gr;exports.DropdownMenuLabel=D0;exports.DropdownMenuPortal=Yy;exports.DropdownMenuRadioGroup=Wy;exports.DropdownMenuRadioItem=$y;exports.DropdownMenuSeparator=Qs;exports.DropdownMenuShortcut=Zy;exports.DropdownMenuSub=qy;exports.DropdownMenuSubContent=Xy;exports.DropdownMenuSubTrigger=Ky;exports.DropdownMenuTrigger=Fi;exports.EditableBadge=O2;exports.EditorialCalendar=I5;exports.EmptyCalendarIllustration=F4;exports.EmptyContractsIllustration=J4;exports.EmptyInboxIllustration=R4;exports.EmptyProjectsIllustration=H4;exports.EmptySearchIllustration=B4;exports.EmptyState=kf;exports.ErrorStateIllustration=U4;exports.FileAttachmentList=X5;exports.FileUploadZone=O8;exports.FilterBar=j0;exports.FilterBuilder=L0;exports.FilterChip=M0;exports.Form=E5;exports.FormControl=P5;exports.FormDescription=R5;exports.FormField=A5;exports.FormItem=z5;exports.FormLabel=O5;exports.FormMessage=B5;exports.GanttChart=m4;exports.GanttLegend=g4;exports.HoverCard=U5;exports.HoverCardContent=J5;exports.HoverCardTrigger=_5;exports.Illustrations=R8;exports.ImageWithFallback=M2;exports.Input=Ht;exports.InputGroup=L2;exports.InputGroupAddon=bc;exports.InputGroupButton=ZI;exports.InputGroupInput=KI;exports.InputGroupText=qI;exports.InputGroupTextarea=XI;exports.InputOTP=V5;exports.InputOTPGroup=G5;exports.InputOTPSeparator=Q5;exports.InputOTPSlot=Y5;exports.InputValidation=W5;exports.KPICard=x4;exports.KanbanCard=b4;exports.Label=Ue;exports.MentionList=Sd;exports.Menubar=eA;exports.MenubarCheckboxItem=oA;exports.MenubarContent=iA;exports.MenubarGroup=nA;exports.MenubarItem=sA;exports.MenubarLabel=fA;exports.MenubarMenu=tA;exports.MenubarPortal=y4;exports.MenubarRadioGroup=rA;exports.MenubarRadioItem=lA;exports.MenubarSeparator=cA;exports.MenubarShortcut=dA;exports.MenubarSub=uA;exports.MenubarSubContent=pA;exports.MenubarSubTrigger=hA;exports.MenubarTrigger=aA;exports.NavigationMenu=mA;exports.NavigationMenuContent=yA;exports.NavigationMenuItem=bA;exports.NavigationMenuLink=wA;exports.NavigationMenuList=gA;exports.NavigationMenuTrigger=xA;exports.NumberInput=Go;exports.PageHeader=MA;exports.Pagination=LA;exports.PaginationContent=NA;exports.PaginationEllipsis=IA;exports.PaginationItem=kA;exports.PaginationLink=hu;exports.PaginationNext=TA;exports.PaginationPrevious=SA;exports.PasswordInput=w4;exports.Popover=st;exports.PopoverContent=Ze;exports.PopoverTrigger=$e;exports.PrintFooter=Xd;exports.PrintHeader=eu;exports.PrintInfoGrid=mr;exports.PrintSection=it;exports.PrintSignature=tu;exports.PrintTable=Vo;exports.Progress=uu;exports.ProposalTemplate=B8;exports.RadioGroup=DA;exports.RadioGroupItem=EA;exports.ResizableHandle=OA;exports.ResizablePanel=zA;exports.ResizablePanelGroup=AA;exports.SavedFilters=PA;exports.ScrollArea=Wo;exports.ScrollBar=T0;exports.Select=en;exports.SelectContent=rn;exports.SelectGroup=Hx;exports.SelectItem=Dt;exports.SelectLabel=Fx;exports.SelectSeparator=Ux;exports.SelectTrigger=nn;exports.SelectValue=tn;exports.Separator=Hn;exports.Sheet=M4;exports.SheetClose=BA;exports.SheetContent=C4;exports.SheetDescription=k4;exports.SheetFooter=FA;exports.SheetHeader=L4;exports.SheetTitle=N4;exports.SheetTrigger=RA;exports.Sidebar=WA;exports.SidebarContent=t8;exports.SidebarFooter=XA;exports.SidebarGroup=n8;exports.SidebarGroupAction=a8;exports.SidebarGroupContent=i8;exports.SidebarGroupLabel=r8;exports.SidebarHeader=KA;exports.SidebarInset=qA;exports.SidebarMenu=s8;exports.SidebarMenuAction=c8;exports.SidebarMenuBadge=d8;exports.SidebarMenuButton=f8;exports.SidebarMenuItem=o8;exports.SidebarMenuSkeleton=u8;exports.SidebarMenuSub=h8;exports.SidebarMenuSubButton=m8;exports.SidebarMenuSubItem=p8;exports.SidebarProvider=QA;exports.SidebarRail=ZA;exports.SidebarSeparator=e8;exports.SidebarTrigger=$A;exports.Skeleton=Bn;exports.Slider=I4;exports.SocialButton=E4;exports.SuccessStateIllustration=_4;exports.Switch=A4;exports.Table=kc;exports.TableBody=Tc;exports.TableCaption=x0;exports.TableCell=qa;exports.TableFooter=b0;exports.TableHead=Ic;exports.TableHeader=Sc;exports.TablePagination=Dc;exports.TableRow=na;exports.Tabs=P2;exports.TabsContent=uD;exports.TabsList=R2;exports.TabsTrigger=_s;exports.TaskCalendar=D5;exports.TaskEditDialog=w8;exports.Textarea=ru;exports.TimePicker=mi;exports.Timeline=L8;exports.Toaster=N8;exports.Toggle=S2;exports.ToggleGroup=k8;exports.ToggleGroupItem=S8;exports.Tooltip=nt;exports.TooltipContent=at;exports.TooltipProvider=It;exports.TooltipTrigger=rt;exports.UnderlineTabs=T8;exports.UnderlineTabsContent=E8;exports.UnderlineTabsList=I8;exports.UnderlineTabsTrigger=D8;exports.badgeVariants=w0;exports.buttonVariants=Jn;exports.calculatePaginationMetadata=v0;exports.cn=w;exports.dadosContratoExemplo=YI;exports.getPageNumbers=y0;exports.navigationMenuTriggerStyle=v4;exports.socialButtonVariants=D4;exports.toggleVariants=au;exports.useFormField=ns;exports.useIsMobile=S4;exports.usePrintContract=j2;exports.useSidebar=rs;
|
|
224
224
|
//# sourceMappingURL=index.cjs.map
|