@iclips/ui 1.2.3 → 1.2.4
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/components/ui/page-header.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -219,6 +219,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
219
219
|
</body>
|
|
220
220
|
</html>
|
|
221
221
|
`),p.document.close(),p.onload=()=>{setTimeout(()=>{p.print(),p.close(),i==null||i()},250)}}catch(u){a==null||a(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 DT({data:t,logo:e,showActions:n=!0,showSummary:r=!0,showServices:i=!0,showInfo:a=!1,className:s,onPrintStart:o,onPrintSuccess:f,onPrintError:c,onDownloadStart:d,onDownloadSuccess:u,onDownloadError:p}){const h=I.useRef(null),{printContract:g,downloadPDF:m}=db(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(li,{children:l.jsxs(fi,{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(B,{variant:"outline",size:"sm",onClick:m,className:"gap-2",children:[l.jsx(k.Download,{className:"h-4 w-4"}),"Download PDF"]}),l.jsxs(B,{variant:"default",size:"sm",onClick:g,className:"gap-2",children:[l.jsx(k.Printer,{className:"h-4 w-4"}),"Imprimir"]})]})]})}),r&&l.jsx(ci,{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($d,{data:t,showPreview:!0,logo:e,showServices:i})})}),a&&l.jsxs(jr,{className:"no-print",children:[l.jsx(li,{children:l.jsxs(fi,{className:"flex items-center gap-2",children:[l.jsx(k.Eye,{className:"h-5 w-5"}),"Sobre este Template"]})}),l.jsx(ci,{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 ub=I.forwardRef(({data:t,logo:e,showServices:n=!0,className:r},i)=>l.jsx("div",{className:w("bg-white rounded-lg shadow-sm p-8",r),ref:i,children:l.jsx($d,{data:t,showPreview:!0,logo:e,showServices:n})}));ub.displayName="ContractPrintPreview";const Vo=I.forwardRef(({className:t,inputClassName:e,containerClassName:n,style:r,value:i,defaultValue:a=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:g=!0,keepWithinRange:m=!0,showButtons:b=!0,buttonLayout:x="vertical",buttonPosition:y="right",disabled:j,readOnly:v,...L},C)=>{const[N,S]=I.useState(a),[T,D]=I.useState(""),[H,V]=I.useState(!1),Q=I.useRef(null),W=i!==void 0?i:N,F=I.useCallback(U=>u?new Intl.NumberFormat(p,u).format(U):U.toFixed(d),[u,p,d]),P=U=>{const Se=U.replace(/[^\d,.-]/g,"").replace(",","."),Oe=parseFloat(Se);return isNaN(Oe)?0:Oe},G=U=>m?Math.min(Math.max(U,o),f):U,te=I.useCallback((U,oe=!1)=>{const Se=oe?G(U):U;i===void 0&&S(Se),s&&s(Se)},[i,s,o,f,m]);I.useEffect(()=>{H||D(F(W))},[W,F,H]);const ce=()=>{if(j||v)return;const U=W+c;U<=f&&te(U)},ge=()=>{if(j||v)return;const U=W-c;U>=o&&te(U)},Te=U=>{const Se=U.target.value.replace(/[^\d,.-]/g,"");D(Se);const Oe=P(Se);te(Oe,!1)},Ce=U=>{if(V(!1),g){const oe=G(W);te(oe,!1),D(F(oe))}else D(F(W));L.onBlur&&L.onBlur(U)},Y=U=>{V(!0),D(W.toString()),U.target.select(),L.onFocus&&L.onFocus(U)},Z=U=>{j||v||(U.key==="ArrowUp"?(U.preventDefault(),ce()):U.key==="ArrowDown"&&(U.preventDefault(),ge()),L.onKeyDown&&L.onKeyDown(U))},A=U=>{!h||j||v||!H||(U.preventDefault(),U.deltaY<0?ce():U.deltaY>0&&ge())};I.useImperativeHandle(C,()=>Q.current);const _=()=>{if(!b)return null;const U=l.jsx("button",{type:"button",onClick:ce,disabled:j||v||W>=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"),oe=l.jsx("button",{type:"button",onClick:ge,disabled:j||v||W<=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",y==="right"?"order-2 border-l border-input rounded-r-md":"order-[-1] border-r border-input rounded-l-md"),children:[U,oe]});if(x==="horizontal")return[oe,U]};return x==="horizontal"&&b?l.jsxs("div",{className:w("inline-flex items-center w-full",n),style:r,children:[_(),l.jsx("input",{ref:Q,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:Te,onBlur:Ce,onFocus:Y,onKeyDown:Z,onWheel:A,disabled:j,readOnly:v,"aria-valuemin":o,"aria-valuemax":f,"aria-valuenow":W,role:"spinbutton",...L})]}):l.jsxs("div",{className:w("inline-flex w-full items-stretch",n),style:r,children:[l.jsx("input",{ref:Q,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"&&y==="right"&&"text-right rounded-r-none border-r-0",b&&x==="vertical"&&y==="left"&&"text-left rounded-l-none border-l-0",!b&&"text-right",e,t),value:T,onChange:Te,onBlur:Ce,onFocus:Y,onKeyDown:Z,onWheel:A,disabled:j,readOnly:v,"aria-valuemin":o,"aria-valuemax":f,"aria-valuenow":W,role:"spinbutton",...L}),_()]})});Vo.displayName="NumberInput";function Zd({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 hb({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 ET=fn.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 pc({className:t,align:e="inline-start",...n}){return l.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":e,className:w(ET({align:e}),t),onClick:r=>{var i,a;r.target.closest("button")||(a=(i=r.currentTarget.parentElement)==null?void 0:i.querySelector("input"))==null||a.focus()},...n})}const AT=fn.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 zT({className:t,size:e,variant:n="ghost",type:r="button",...i}){return l.jsx(B,{"data-slot":"input-group-button",type:r,variant:n,className:w(AT({size:e}),t),...i})}function OT({className:t,...e}){return l.jsx("span",{"data-slot":"input-group-text",className:w("text-muted-foreground text-sm",t),...e})}function PT({className:t,...e}){return l.jsx(Gt,{"data-slot":"input-group-control",className:w("cn-input-group-input flex-1",t),...e})}function RT({className:t,...e}){return l.jsx(Zd,{"data-slot":"input-group-control",className:w("cn-input-group-textarea flex-1 resize-none",t),...e})}const BT={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"}},pb=I.forwardRef(({className:t,currency:e="BRL",locale:n,showSymbol:r=!1,symbolPosition:i="start",min:a=0,...s},o)=>{const f=BT[e],c=n||f.locale,d=f.icon;return r?l.jsxs(hb,{className:t,children:[i==="start"&&l.jsx(pc,{children:l.jsx(d,{className:"h-4 w-4 text-muted-foreground"})}),l.jsx(Vo,{ref:o,className:w("border-none shadow-none ring-0 focus-visible:ring-0 focus-visible:border-transparent",i==="start"?"pl-2":"pr-2"),min:a,precision:2,formatOptions:{style:"currency",currency:e,minimumFractionDigits:2,maximumFractionDigits:2},locale:c,...s}),i==="end"&&l.jsx(pc,{align:"inline-end",children:l.jsx(d,{className:"h-4 w-4 text-muted-foreground"})})]}):l.jsx(Vo,{ref:o,className:t,min:a,precision:2,formatOptions:{style:"currency",currency:e,minimumFractionDigits:2,maximumFractionDigits:2},locale:c,...s})});pb.displayName="CurrencyInput";const HT=()=>{const t=new Date;return t.setHours(0,0,0,0),[{label:"Hoje",value:{from:t,to:t}},{label:"Últimos 7 dias",value:{from:R.subDays(t,6),to:t}},{label:"Últimos 30 dias",value:{from:R.subDays(t,29),to:t}},{label:"Este mês",value:{from:R.startOfMonth(t),to:t}},{label:"Mês passado",value:{from:R.startOfMonth(R.subMonths(t,1)),to:R.endOfMonth(R.subMonths(t,1))}}]};function mb({value:t,onChange:e,placeholder:n="Selecione um período",disabled:r=!1,minDate:i,maxDate:a,dateFormat:s="dd/MM/yyyy",locale:o=vt,className:f,error:c=!1,numberOfMonths:d=2,showTime:u=!1,timeFormat:p="24h",minuteStep:h=15,presets:g,showDefaultPresets:m=!0,id:b,name:x}){const[y,j]=I.useState(!1),[v,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 Y=R.format(t.from,S,{locale:o}),Z=t.to?R.format(t.to,S,{locale:o}):"";L(Z?`${Y} → ${Z}`:Y),N(!1)}else L(""),N(!1)},[t,S,o]);const D=I.useMemo(()=>[...m?HT():[],...g||[]],[g,m]),H=I.useMemo(()=>{if(!(t!=null&&t.from))return"00:00";const Y=t.from.getHours().toString().padStart(2,"0"),Z=t.from.getMinutes().toString().padStart(2,"0");return`${Y}:${Z}`},[t==null?void 0:t.from]),V=I.useMemo(()=>{if(!(t!=null&&t.to))return"23:59";const Y=t.to.getHours().toString().padStart(2,"0"),Z=t.to.getMinutes().toString().padStart(2,"0");return`${Y}:${Z}`},[t==null?void 0:t.to]),Q=Y=>{if(!Y){e==null||e(void 0);return}if(u){if(Y.from){const[Z,A]=H.split(":").map(Number);Y.from.setHours(Z,A,0,0)}if(Y.to){const[Z,A]=V.split(":").map(Number);Y.to.setHours(Z,A,0,0)}}else Y.from&&Y.from.setHours(0,0,0,0),Y.to&&Y.to.setHours(23,59,59,999);e==null||e(Y)},W=Y=>{if(!(t!=null&&t.from))return;const Z=new Date(t.from),[A,_]=Y.split(":").map(Number);Z.setHours(A,_,0,0),e==null||e({...t,from:Z})},F=Y=>{if(!(t!=null&&t.to))return;const Z=new Date(t.to),[A,_]=Y.split(":").map(Number);Z.setHours(A,_,0,0),e==null||e({...t,to:Z})},P=Y=>{const Z={from:new Date(Y.value.from),to:new Date(Y.value.to)};if(u){const[A,_]=H.split(":").map(Number),[U,oe]=V.split(":").map(Number);Z.from.setHours(A,_,0,0),Z.to.setHours(U,oe,0,0)}e==null||e(Z)},G=Y=>{const Z=Y.trim();if(!Z)return null;for(const A of T)try{const _=R.parse(Z,A,new Date);if(R.isValid(_)){if(i&&_<i||a&&_>a)continue;return _}}catch{continue}return null},te=Y=>{const Z=Y.trim();if(!Z)return null;const A=["→","-","até","a"];let _=null,U=null;for(const oe of A)if(Z.includes(oe)){const Se=Z.split(oe).map(Oe=>Oe.trim());if(Se.length===2&&(_=G(Se[0]),U=G(Se[1]),_&&U))break}return _||(_=G(Z),_&&(U=new Date(_))),!_||!U?null:(_>U&&([_,U]=[U,_]),{from:_,to:U})},ce=Y=>{const Z=Y.target.value;L(Z),N(!1)},ge=()=>{if(!v.trim()){e==null||e(void 0),N(!1);return}const Y=te(v);Y?(e==null||e(Y),N(!1)):N(!0)},Te=Y=>{if(Y.key==="Enter")Y.preventDefault(),ge(),C||j(!0);else if(Y.key==="Escape"){if(Y.preventDefault(),t!=null&&t.from){const Z=R.format(t.from,S,{locale:o}),A=t.to?R.format(t.to,S,{locale:o}):"";L(A?`${Z} → ${A}`:Z)}else L("");N(!1)}},Ce=Y=>{Y.stopPropagation(),e==null||e(void 0),L(""),N(!1)};return l.jsxs(st,{open:y,onOpenChange:j,children:[l.jsx(Ze,{asChild:!0,children:l.jsxs("div",{className:"relative w-full",children:[l.jsx(Gt,{id:b,name:x,value:v,onChange:ce,onBlur:ge,onKeyDown:Te,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:[v&&!r&&l.jsxs(B,{type:"button",variant:"ghost",size:"sm",className:"h-7 w-7 p-0 hover:bg-transparent",onClick:Ce,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(B,{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(qe,{className:"w-auto p-0",align:"start",children:l.jsxs("div",{className:"flex",children:[D.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"}),D.map(Y=>l.jsx(B,{variant:"ghost",size:"sm",className:"w-full justify-start text-sm h-8",onClick:()=>P(Y),children:Y.label},Y.label))]}),l.jsxs("div",{children:[l.jsx(Qo,{mode:"range",selected:t,onSelect:Q,numberOfMonths:d,disabled:Y=>!!(i&&Y<i||a&&Y>a),locale:o,initialFocus:!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(pa,{value:H,onChange:W,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(pa,{value:V,onChange:F,format:p,minuteStep:h,variant:"select",showIcon:!1})]})]}),l.jsxs("div",{className:"border-t p-3 flex justify-end gap-2",children:[l.jsx(B,{variant:"outline",size:"sm",onClick:()=>{e==null||e(void 0)},children:"Limpar"}),l.jsx(B,{size:"sm",onClick:()=>j(!1),children:"Confirmar"})]})]})]})})]})}mb.displayName="DateRangePicker";var FT=XL,UT=ke.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")}}}),_T=UT;const qd=fn.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 gb({className:t,variant:e,size:n,...r}){return l.jsx(wx.Root,{"data-slot":"toggle",className:w(qd({variant:e,size:n,className:t})),...r})}const nt=({onClick:t,isActive:e=!1,disabled:n=!1,children:r,title:i})=>l.jsx(gb,{pressed:e,onPressedChange:t,disabled:n,size:"sm",className:"h-8 w-8 p-0",title:i,children:r}),JT=({editor:t,variant:e})=>{if(!t)return null;const n=()=>{const i=t.getAttributes("link").href,a=window.prompt("URL",i);if(a!==null){if(a===""){t.chain().focus().extendMarkRange("link").unsetLink().run();return}t.chain().focus().extendMarkRange("link").setLink({href:a}).run()}},r=()=>{const i=window.prompt("URL da imagem");i&&t.chain().focus().setImage({src:i}).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(B,{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(B,{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(Bn,{orientation:"vertical",className:"h-6 mx-1"}),e==="full"&&l.jsxs(l.Fragment,{children:[l.jsx(nt,{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(nt,{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(nt,{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(Bn,{orientation:"vertical",className:"h-6 mx-1"})]}),l.jsx(nt,{onClick:()=>t.chain().focus().toggleBold().run(),isActive:t.isActive("bold"),title:"Negrito",children:l.jsx(k.Bold,{className:"h-4 w-4"})}),l.jsx(nt,{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(nt,{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(nt,{onClick:()=>t.chain().focus().toggleStrike().run(),isActive:t.isActive("strike"),title:"Tachado",children:l.jsx(k.Strikethrough,{className:"h-4 w-4"})}),l.jsx(Bn,{orientation:"vertical",className:"h-6 mx-1"}),l.jsx(nt,{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(nt,{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(nt,{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(nt,{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(nt,{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(Bn,{orientation:"vertical",className:"h-6 mx-1"}),l.jsx(nt,{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(nt,{onClick:n,isActive:t.isActive("link"),title:"Link",children:l.jsx(k.Link,{className:"h-4 w-4"})}),e==="full"&&l.jsx(nt,{onClick:r,title:"Imagem",children:l.jsx(k.Image,{className:"h-4 w-4"})})]})};function VT({content:t="",onChange:e,placeholder:n="Comece a escrever...",variant:r="simple",className:i,readOnly:a=!1,label:s}){var c,d;const o=I.useMemo(()=>[Cg.configure({heading:{levels:[1,2,3]}}),Lg.configure({HTMLAttributes:{class:"rounded-lg border shadow-sm max-w-full"}}),FT.configure({placeholder:n}),_T.configure({types:["heading","paragraph"]})],[n]),f=qm({extensions:o,content:t,editable:!a,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",i),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",a&&"opacity-80 bg-muted/30 pointer-events-none border-transparent"),children:[!a&&l.jsx(JT,{editor:f,variant:r}),l.jsx("div",{className:w("bg-background relative",r==="full"?"bg-white dark:bg-zinc-950":""),children:l.jsx($m,{editor:f})})]}),!a&&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 YT({...t}){return l.jsx(Kn.Drawer.Root,{"data-slot":"drawer",...t})}const bb=I.forwardRef(({...t},e)=>l.jsx(Kn.Drawer.Trigger,{ref:e,"data-slot":"drawer-trigger",...t}));bb.displayName="DrawerTrigger";function QT({...t}){return l.jsx(Kn.Drawer.Portal,{"data-slot":"drawer-portal",...t})}const xb=I.forwardRef(({...t},e)=>l.jsx(Kn.Drawer.Close,{ref:e,"data-slot":"drawer-close",...t}));xb.displayName="DrawerClose";const vb=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}));vb.displayName="DrawerOverlay";const wb=I.forwardRef(({className:t,children:e,...n},r)=>l.jsxs(QT,{"data-slot":"drawer-portal",children:[l.jsx(vb,{}),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]})]}));wb.displayName="DrawerContent";function GT({className:t,...e}){return l.jsx("div",{"data-slot":"drawer-header",className:w("flex flex-col gap-1.5 p-4",t),...e})}function WT({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 yb=I.forwardRef(({className:t,...e},n)=>l.jsx(Kn.Drawer.Title,{ref:n,"data-slot":"drawer-title",className:w("text-foreground font-semibold",t),...e}));yb.displayName="DrawerTitle";const Mb=I.forwardRef(({className:t,...e},n)=>l.jsx(Kn.Drawer.Description,{ref:n,"data-slot":"drawer-description",className:w("text-muted-foreground text-sm",t),...e}));Mb.displayName="DrawerDescription";function $T({value:t,options:e,onValueChange:n,onCancel:r,disabled:i=!1,variant:a="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,...g},m){const[b,x]=I.useState(null),[y,j]=I.useState(!1),[v,L]=I.useState(!1),[C,N]=I.useState(!1),S=I.useMemo(()=>e.find(P=>P.value===t),[e,t]),T=I.useMemo(()=>b?e.find(P=>P.value===b):null,[e,b]),D=I.useCallback(P=>{if(P===t){L(!1);return}x(P),L(!1),d?H(P):j(!0)},[t,d]),H=I.useCallback(async P=>{const G=P??b;if(G){N(!0);try{await n(G),j(!1),x(null)}catch(te){console.error("Error confirming value change:",te)}finally{N(!1)}}},[b,n]),V=I.useCallback(()=>{j(!1),x(null),r==null||r()},[r]),Q=I.useCallback(()=>p&&S?p(t,S):S?l.jsxs(l.Fragment,{children:[S.icon,S.label]}):t,[p,t,S]),W=(S==null?void 0:S.variant)||a,F=S==null?void 0:S.className;return i?l.jsx("div",{ref:m,className:w("inline-flex",h),...g,children:l.jsx(he,{variant:W,className:F,children:Q()})}):l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:m,className:w("inline-flex",h),...g,children:l.jsxs(Ra,{open:v,onOpenChange:L,children:[l.jsx(Ba,{asChild:!0,disabled:u,children:l.jsxs(he,{variant:W,className:w("cursor-pointer hover:opacity-80 transition-opacity gap-1.5",u&&"opacity-50 cursor-not-allowed",F),children:[Q(),!u&&l.jsx(k.ChevronDown,{className:"h-3 w-3"})]})}),l.jsx(Ha,{align:"start",className:"w-48",children:e.map(P=>l.jsxs(gr,{onClick:()=>D(P.value),className:"gap-2",children:[P.icon&&l.jsx("span",{className:"w-4 h-4",children:P.icon}),l.jsx("span",{className:"flex-1",children:P.label}),P.value===t&&l.jsx(k.Check,{className:"h-4 w-4 text-primary"})]},String(P.value)))})]})}),l.jsx(Fa,{open:y,onOpenChange:j,children:l.jsxs(Ua,{children:[l.jsxs(_a,{children:[l.jsx(Ja,{children:s}),l.jsx(Va,{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(he,{variant:(S==null?void 0:S.variant)||a,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(he,{variant:T.variant||a,className:T.className,children:[T.icon,T.label]})]})]}),l.jsxs(Wo,{children:[l.jsx(B,{variant:"outline",onClick:V,disabled:C,children:c}),l.jsx(B,{onClick:()=>H(),disabled:C,children:C?"Confirmando...":f})]})]})})]})}const jb=I.forwardRef($T);jb.displayName="EditableBadge";function Cb({className:t,...e}){return l.jsx(Yo.Root,{"data-slot":"tabs",className:w("flex flex-col gap-2",t),...e})}function Lb({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 ZT({className:t,...e}){return l.jsx(Yo.Content,{"data-slot":"tabs-content",className:w("flex-1 outline-none",t),...e})}const Nb=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 Rh=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Bh=function(){return Math.random().toString(36).substring(7).split("").join(".")},Hh={INIT:"@@redux/INIT"+Bh(),REPLACE:"@@redux/REPLACE"+Bh()};function qT(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 KT(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(tD(t))return"date";if(eD(t))return"error";var n=XT(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 XT(t){return typeof t.constructor=="function"?t.constructor.name:null}function eD(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function tD(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function Wr(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=KT(t)),e}function kb(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: '"+Wr(n)+"'");return n(kb)(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: '"+Wr(t)+"'");var i=t,a=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 a}function u(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?St(4):"Expected the listener to be a function. Instead, received: '"+Wr(m)+"'");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(m),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 y=o.indexOf(m);o.splice(y,1),s=null}}}function p(m){if(!qT(m))throw new Error(process.env.NODE_ENV==="production"?St(7):"Actions must be plain objects. Instead, the actual type was: '"+Wr(m)+"'. 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 m.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,a=i(a,m)}finally{f=!1}for(var b=s=o,x=0;x<b.length;x++){var y=b[x];y()}return m}function h(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?St(10):"Expected the nextReducer to be a function. Instead, received: '"+Wr(m));i=m,p({type:Hh.REPLACE})}function g(){var m,b=u;return m={subscribe:function(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?St(11):"Expected the observer to be an object. Instead, received: '"+Wr(y)+"'");function j(){y.next&&y.next(d())}j();var v=b(j);return{unsubscribe:v}}},m[Rh]=function(){return this},m}return p({type:Hh.INIT}),r={dispatch:p,subscribe:u,getState:d,replaceReducer:h},r[Rh]=g,r}function ne(t,e,...n){if(nD()&&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 i=0;r=new Error(e.replace(/%s/g,function(){return n[i++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function nD(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function rD(t,e,n){return e.split(".").reduce((r,i)=>r&&r[i]?r[i]:n||null,t)}function iD(t,e){return t.filter(n=>n!==e)}function Sb(t){return typeof t=="object"}function aD(t,e){const n=new Map,r=a=>{n.set(a,n.has(a)?n.get(a)+1:1)};t.forEach(r),e.forEach(r);const i=[];return n.forEach((a,s)=>{a===1&&i.push(s)}),i}function sD(t,e){return t.filter(n=>e.indexOf(n)>-1)}const Kd="dnd-core/INIT_COORDS",Ll="dnd-core/BEGIN_DRAG",Xd="dnd-core/PUBLISH_DRAG_SOURCE",Nl="dnd-core/HOVER",kl="dnd-core/DROP",Sl="dnd-core/END_DRAG";function Fh(t,e){return{type:Kd,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const oD={type:Kd,payload:{clientOffset:null,sourceClientOffset:null}};function lD(t){return function(n=[],r={publishSource:!0}){const{publishSource:i=!0,clientOffset:a,getSourceClientOffset:s}=r,o=t.getMonitor(),f=t.getRegistry();t.dispatch(Fh(a)),fD(n,o,f);const c=uD(n,o);if(c==null){t.dispatch(oD);return}let d=null;if(a){if(!s)throw new Error("getSourceClientOffset must be defined");cD(s),d=s(c)}t.dispatch(Fh(a,d));const p=f.getSource(c).beginDrag(o,c);if(p==null)return;dD(p),f.pinSource(c);const h=f.getSourceType(c);return{type:Ll,payload:{itemType:h,item:p,sourceId:c,clientOffset:a||null,sourceClientOffset:d||null,isSourcePublic:!!i}}}}function fD(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 cD(t){ne(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function dD(t){ne(Sb(t),"Item must be an object.")}function uD(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 hD(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pD(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(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){hD(t,i,n[i])})}return t}function mD(t){return function(n={}){const r=t.getMonitor(),i=t.getRegistry();gD(r),vD(r).forEach((s,o)=>{const f=bD(s,o,i,r),c={type:kl,payload:{dropResult:pD({},n,f)}};t.dispatch(c)})}}function gD(t){ne(t.isDragging(),"Cannot call drop while not dragging."),ne(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function bD(t,e,n,r){const i=n.getTarget(t);let a=i?i.drop(r,t):void 0;return xD(a),typeof a>"u"&&(a=e===0?{}:r.getDropResult()),a}function xD(t){ne(typeof t>"u"||Sb(t),"Drop result must either be an object or undefined.")}function vD(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function wD(t){return function(){const n=t.getMonitor(),r=t.getRegistry();yD(n);const i=n.getSourceId();return i!=null&&(r.getSource(i,!0).endDrag(n,i),r.unpinSource()),{type:Sl}}}function yD(t){ne(t.isDragging(),"Cannot call endDrag while not dragging.")}function mc(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function MD(t){return function(n,{clientOffset:r}={}){jD(n);const i=n.slice(0),a=t.getMonitor(),s=t.getRegistry(),o=a.getItemType();return LD(i,s,o),CD(i,a,s),ND(i,a,s),{type:Nl,payload:{targetIds:i,clientOffset:r||null}}}}function jD(t){ne(Array.isArray(t),"Expected targetIds to be an array.")}function CD(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 i=t[r];ne(t.lastIndexOf(i)===r,"Expected targetIds to be unique in the passed array.");const a=n.getTarget(i);ne(a,"Expected targetIds to be registered.")}}function LD(t,e,n){for(let r=t.length-1;r>=0;r--){const i=t[r],a=e.getTargetType(i);mc(a,n)||t.splice(r,1)}}function ND(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function kD(t){return function(){if(t.getMonitor().isDragging())return{type:Xd}}}function SD(t){return{beginDrag:lD(t),publishDragSource:kD(t),hover:MD(t),drop:mD(t),endDrag:wD(t)}}class ID{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(a){return(...s)=>{const o=a.apply(e,s);typeof o<"u"&&n(o)}}const i=SD(this);return Object.keys(i).reduce((a,s)=>{const o=i[s];return a[s]=r(o),a},{})}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 TD(t,e){return{x:t.x+e.x,y:t.y+e.y}}function Ib(t,e){return{x:t.x-e.x,y:t.y-e.y}}function DD(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:Ib(TD(e,r),n)}function ED(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:Ib(e,n)}const ua=[],eu=[];ua.__IS_NONE__=!0;eu.__IS_ALL__=!0;function AD(t,e){return t===ua?!1:t===eu||typeof e>"u"?!0:sD(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 i=this.store.getState().stateId;const a=()=>{const s=this.store.getState(),o=s.stateId;try{o===i||o===i+1&&!AD(s.dirtyHandlerIds,r)||e()}finally{i=o}};return this.store.subscribe(a)}subscribeToOffsetChange(e){ne(typeof e=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const i=this.store.getState().dragOffset;i!==n&&(n=i,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),i=this.getItemType();return mc(r,i)&&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),i=this.getItemType();return r!==i?!1:n.isDragging(this,e)}isOverTarget(e,n={shallow:!1}){if(!e)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const i=this.registry.getTargetType(e),a=this.getItemType();if(a&&!mc(i,a))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 DD(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return ED(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const Uh=typeof global<"u"?global:self,Tb=Uh.MutationObserver||Uh.WebKitMutationObserver;function Db(t){return function(){const n=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(n),clearInterval(r),t()}}}function OD(t){let e=1;const n=new Tb(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const PD=typeof Tb=="function"?OD:Db;class RD{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,i=e.length-this.index;r<i;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=PD(this.flush),this.requestErrorThrow=Db(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class BD{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 HD{create(e){const n=this.freeTasks,r=n.length?n.pop():new BD(this.onError,i=>n[n.length]=i);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const Eb=new RD,FD=new HD(Eb.registerPendingError);function UD(t){Eb.enqueueTask(FD.create(t))}const tu="dnd-core/ADD_SOURCE",nu="dnd-core/ADD_TARGET",ru="dnd-core/REMOVE_SOURCE",Il="dnd-core/REMOVE_TARGET";function _D(t){return{type:tu,payload:{sourceId:t}}}function JD(t){return{type:nu,payload:{targetId:t}}}function VD(t){return{type:ru,payload:{sourceId:t}}}function YD(t){return{type:Il,payload:{targetId:t}}}function QD(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 GD(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 gc(t,e){if(e&&Array.isArray(t)){t.forEach(n=>gc(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 WD=0;function $D(){return WD++}function ZD(t){const e=$D().toString();switch(t){case At.SOURCE:return`S${e}`;case At.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function _h(t){switch(t[0]){case"S":return At.SOURCE;case"T":return At.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function Jh(t,e){const n=t.entries();let r=!1;do{const{done:i,value:[,a]}=n.next();if(a===e)return!0;r=!!i}while(!r);return!1}class qD{addSource(e,n){gc(e),QD(n);const r=this.addHandler(At.SOURCE,e,n);return this.store.dispatch(_D(r)),r}addTarget(e,n){gc(e,!0),GD(n);const r=this.addHandler(At.TARGET,e,n);return this.store.dispatch(JD(r)),r}containsHandler(e){return Jh(this.dragSources,e)||Jh(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 _h(e)===At.SOURCE}isTargetId(e){return _h(e)===At.TARGET}removeSource(e){ne(this.getSource(e),"Expected an existing source."),this.store.dispatch(VD(e)),UD(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){ne(this.getTarget(e),"Expected an existing target."),this.store.dispatch(YD(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 i=ZD(e);return this.types.set(i,n),e===At.SOURCE?this.dragSources.set(i,r):e===At.TARGET&&this.dropTargets.set(i,r),i}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const KD=(t,e)=>t===e;function XD(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function eE(t,e,n=KD){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 tE(t=ua,e){switch(e.type){case Nl:break;case tu:case nu:case Il:case ru:return ua;case Ll:case Xd:case Sl:case kl:default:return eu}const{targetIds:n=[],prevTargetIds:r=[]}=e.payload,i=aD(n,r);if(!(i.length>0||!eE(n,r)))return ua;const s=r[r.length-1],o=n[n.length-1];return s!==o&&(s&&i.push(s),o&&i.push(o)),i}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 rE(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(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){nE(t,i,n[i])})}return t}const Vh={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function iE(t=Vh,e){const{payload:n}=e;switch(e.type){case Kd:case Ll:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Nl:return XD(t.clientOffset,n.clientOffset)?t:rE({},t,{clientOffset:n.clientOffset});case Sl:case kl:return Vh;default:return t}}function aE(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $r(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(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){aE(t,i,n[i])})}return t}const sE={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function oE(t=sE,e){const{payload:n}=e;switch(e.type){case Ll:return $r({},t,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Xd:return $r({},t,{isSourcePublic:!0});case Nl:return $r({},t,{targetIds:n.targetIds});case Il:return t.targetIds.indexOf(n.targetId)===-1?t:$r({},t,{targetIds:iD(t.targetIds,n.targetId)});case kl:return $r({},t,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Sl:return $r({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function lE(t=0,e){switch(e.type){case tu:case nu:return t+1;case ru:case Il:return t-1;default:return t}}function fE(t=0){return t+1}function cE(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dE(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(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){cE(t,i,n[i])})}return t}function uE(t={},e){return{dirtyHandlerIds:tE(t.dirtyHandlerIds,{type:e.type,payload:dE({},e.payload,{prevTargetIds:rD(t,"dragOperation.targetIds",[])})}),dragOffset:iE(t.dragOffset,e),refCount:lE(t.refCount,e),dragOperation:oE(t.dragOperation,e),stateId:fE(t.stateId)}}function hE(t,e=void 0,n={},r=!1){const i=pE(r),a=new zD(i,new qD(i)),s=new ID(i,a),o=t(s,e,n);return s.receiveBackend(o),s}function pE(t){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return kb(uE,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function mE(t,e){if(t==null)return{};var n=gE(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function gE(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}let Yh=0;const Js=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Ab=M.memo(function(e){var{children:n}=e,r=mE(e,["children"]);const[i,a]=bE(r);return M.useEffect(()=>{if(a){const s=zb();return++Yh,()=>{--Yh===0&&(s[Js]=null)}}},[]),l.jsx(Nb.Provider,{value:i,children:n})});function bE(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=xE(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function xE(t,e=zb(),n,r){const i=e;return i[Js]||(i[Js]={dragDropManager:hE(t,e,n,r)}),i[Js]}function zb(){return typeof global<"u"?global:window}function vE(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var mf,Qh;function wE(){return Qh||(Qh=1,mf=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,i,a;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))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(a=Object.keys(e),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var s=a[i];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n}),mf}var yE=wE();const ME=vE(yE),Tr=typeof window<"u"?M.useLayoutEffect:M.useEffect;function jE(t,e,n){const[r,i]=M.useState(()=>e(t)),a=M.useCallback(()=>{const s=e(t);ME(r,s)||(i(s),n&&n())},[r,t,n]);return Tr(a),[r,a]}function CE(t,e,n){const[r,i]=jE(t,e,n);return Tr(function(){const s=t.getHandlerId();if(s!=null)return t.subscribeToStateChange(i,{handlerIds:[s]})},[t,i]),r}function Ob(t,e,n){return CE(e,t||(()=>({})),()=>n.reconnect())}function Pb(t,e){const n=[...e||[]];return e==null&&typeof t!="function"&&n.push(t),M.useMemo(()=>typeof t=="function"?t():t,n)}function LE(t){return M.useMemo(()=>t.hooks.dragSource(),[t])}function NE(t){return M.useMemo(()=>t.hooks.dragPreview(),[t])}let gf=!1,bf=!1;class kE{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){ne(!gf,"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 gf=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{gf=!1}}isDragging(){if(!this.sourceId)return!1;ne(!bf,"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 bf=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{bf=!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 xf=!1;class SE{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(!xf,"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 xf=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{xf=!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 IE(t,e,n){const r=n.getRegistry(),i=r.addTarget(t,e);return[i,()=>r.removeTarget(i)]}function TE(t,e,n){const r=n.getRegistry(),i=r.addSource(t,e);return[i,()=>r.removeSource(i)]}function bc(t,e,n,r){let i;if(i!==void 0)return!!i;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;const a=Object.keys(t),s=Object.keys(e);if(a.length!==s.length)return!1;const o=Object.prototype.hasOwnProperty.bind(e);for(let f=0;f<a.length;f++){const c=a[f];if(!o(c))return!1;const d=t[c],u=e[c];if(i=void 0,i===!1||i===void 0&&d!==u)return!1}return!0}function xc(t){return t!==null&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function DE(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 EE(t){return(e=null,n=null)=>{if(!M.isValidElement(e)){const a=e;return t(a,n),a}const r=e;return DE(r),AE(r,n?a=>t(a,n):t)}}function Rb(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const i=EE(r);e[n]=()=>i}}),e}function Gh(t,e){typeof t=="function"?t(e):t.current=e}function AE(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=>{Gh(n,r),Gh(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!bc(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!bc(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=Rb({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,xc(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,xc(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 OE{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!bc(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=Rb({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,xc(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 Ti(){const{dragDropManager:t}=M.useContext(Nb);return ne(t!=null,"Expected drag drop context"),t}function PE(t,e){const n=Ti(),r=M.useMemo(()=>new zE(n.getBackend()),[n]);return Tr(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),Tr(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function RE(){const t=Ti();return M.useMemo(()=>new kE(t),[t])}class BE{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,i=this.monitor,{isDragging:a}=r;return a?a(i):n===e.getSourceId()}endDrag(){const e=this.spec,n=this.monitor,r=this.connector,{end:i}=e;i&&i(n.getItem(),n),r.reconnect()}constructor(e,n,r){this.spec=e,this.monitor=n,this.connector=r}}function HE(t,e,n){const r=M.useMemo(()=>new BE(t,e,n),[e,n]);return M.useEffect(()=>{r.spec=t},[t]),r}function FE(t){return M.useMemo(()=>{const e=t.type;return ne(e!=null,"spec.type must be defined"),e},[t])}function UE(t,e,n){const r=Ti(),i=HE(t,e,n),a=FE(t);Tr(function(){if(a!=null){const[o,f]=TE(a,i,r);return e.receiveHandlerId(o),n.receiveHandlerId(o),f}},[r,e,n,i,a])}function _E(t,e){const n=Pb(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=RE(),i=PE(n.options,n.previewOptions);return UE(n,r,i),[Ob(n.collect,r,i),LE(i),NE(i)]}function JE(t){return M.useMemo(()=>t.hooks.dropTarget(),[t])}function VE(t){const e=Ti(),n=M.useMemo(()=>new OE(e.getBackend()),[e]);return Tr(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function YE(){const t=Ti();return M.useMemo(()=>new SE(t),[t])}function QE(t){const{accept:e}=t;return M.useMemo(()=>(ne(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class GE{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 WE(t,e){const n=M.useMemo(()=>new GE(t,e),[e]);return M.useEffect(()=>{n.spec=t},[t]),n}function $E(t,e,n){const r=Ti(),i=WE(t,e),a=QE(t);Tr(function(){const[o,f]=IE(a,i,r);return e.receiveHandlerId(o),n.receiveHandlerId(o),f},[r,e,i,n,a.map(s=>s.toString()).join("|")])}function iu(t,e){const n=Pb(t,e),r=YE(),i=VE(n.options);return $E(n,r,i),[Ob(n.collect,r,i),JE(i)]}function Bb(t){let e=null;return()=>(e==null&&(e=t()),e)}function ZE(t,e){return t.filter(n=>n!==e)}function qE(t,e){const n=new Set,r=a=>n.add(a);t.forEach(r),e.forEach(r);const i=[];return n.forEach(a=>i.push(a)),i}class KE{enter(e){const n=this.entered.length,r=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(e));return this.entered=qE(this.entered.filter(r),[e]),n===0&&this.entered.length>0}leave(e){const n=this.entered.length;return this.entered=ZE(this.entered.filter(this.isNodeInDocument),e),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class XE{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 i=this.config.exposeProperties[r];i!=null&&(n[r]={value:i(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 Hb="__NATIVE_FILE__",Fb="__NATIVE_URL__",Ub="__NATIVE_TEXT__",_b="__NATIVE_HTML__",Wh=Object.freeze(Object.defineProperty({__proto__:null,FILE:Hb,HTML:_b,TEXT:Ub,URL:Fb},Symbol.toStringTag,{value:"Module"}));function vf(t,e,n){const r=e.reduce((i,a)=>i||t.getData(a),"");return r??n}const vc={[Hb]:{exposeProperties:{files:t=>Array.prototype.slice.call(t.files),items:t=>t.items,dataTransfer:t=>t},matchesTypes:["Files"]},[_b]:{exposeProperties:{html:(t,e)=>vf(t,e,""),dataTransfer:t=>t},matchesTypes:["Html","text/html"]},[Fb]:{exposeProperties:{urls:(t,e)=>vf(t,e,"").split(`
|
|
222
|
-
`),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[Ub]:{exposeProperties:{text:(t,e)=>vf(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function e5(t,e){const n=vc[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new XE(n);return r.loadDataTransfer(e),r}function wf(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(vc).filter(n=>{const r=vc[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(i=>e.indexOf(i)>-1):!1})[0]||null}const t5=Bb(()=>/firefox/i.test(navigator.userAgent)),Jb=Bb(()=>!!window.safari);class $h{interpolate(e){const{xs:n,ys:r,c1s:i,c2s:a,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]+i[o]*u+a[o]*p+s[o]*u*p}constructor(e,n){const{length:r}=e,i=[];for(let h=0;h<r;h++)i.push(h);i.sort((h,g)=>e[h]<e[g]?-1:1);const a=[],s=[];let o,f;for(let h=0;h<r-1;h++)o=e[h+1]-e[h],f=n[h+1]-n[h],a.push(o),s.push(f/o);const c=[s[0]];for(let h=0;h<a.length-1;h++){const g=s[h],m=s[h+1];if(g*m<=0)c.push(0);else{o=a[h];const b=a[h+1],x=o+b;c.push(3*x/((x+b)/g+(x+o)/m))}}c.push(s[s.length-1]);const d=[],u=[];let p;for(let h=0;h<c.length-1;h++){p=s[h];const g=c[h],m=1/a[h],b=g+c[h+1]-p-p;d.push((p-g-b)*m),u.push(b*m*m)}this.xs=e,this.ys=n,this.c1s=c,this.c2s=d,this.c3s=u}}const n5=1;function Vb(t){const e=t.nodeType===n5?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function Es(t){return{x:t.clientX,y:t.clientY}}function r5(t){var e;return t.nodeName==="IMG"&&(t5()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function i5(t,e,n,r){let i=t?e.width:n,a=t?e.height:r;return Jb()&&t&&(a/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:a}}function a5(t,e,n,r,i){const a=r5(e),o=Vb(a?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:g}=i5(a,e,c,d),m=()=>{let C=new $h([0,.5,1],[f.y,f.y/d*g,f.y+g-d]).interpolate(p);return Jb()&&a&&(C+=(window.devicePixelRatio-1)*g),C},b=()=>new $h([0,.5,1],[f.x,f.x/c*h,f.x+h-c]).interpolate(u),{offsetX:x,offsetY:y}=i,j=x===0||x,v=y===0||y;return{x:j?x:b(),y:v?y:m()}}class s5{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 o5(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zh(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(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){o5(t,i,n[i])})}return t}class l5{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 i=s=>this.handleDragStart(s,e),a=s=>this.handleSelectStart(s);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",a),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",a),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=s=>this.handleDragEnter(s,e),i=s=>this.handleDragOver(s,e),a=s=>this.handleDrop(s,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",i),n.addEventListener("drop",a),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",i),n.removeEventListener("drop",a)}}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 Zh({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 Zh({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(Wh).some(n=>Wh[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=e5(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=i=>{const a=this.sourceNodes.get(i);return a&&Vb(a)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{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=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:a}=this;this.dragStartSourceIds=null;const s=Es(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:s});const{dataTransfer:o}=i,f=wf(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:g,offsetX:m,offsetY:b}=this.getCurrentSourcePreviewNodeOptions(),j=a5(u,p,s,{anchorX:h,anchorY:g},{offsetX:m,offsetY:b});o.setDragImage(p,j.x,j.y)}}try{o==null||o.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.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&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:o}=i,f=wf(o);f&&this.beginDragNativeItem(f,o)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:a}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,a.length>0&&this.actions.hover(a,{clientOffset:Es(i)}),a.some(o=>this.monitor.canDropOnTarget(o))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:a}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=Es(i),this.scheduleHover(a),(a||[]).some(o=>this.monitor.canDropOnTarget(o))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var a;i.preventDefault(),(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}else wf(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:a}=this;this.dropTargetIds=[],this.actions.hover(a,{clientOffset:Es(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const a=i.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(i.preventDefault(),a.dragDrop()))},this.options=new s5(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new KE(this.isNodeInDocument)}}const Yb=function(e,n,r){return new l5(e,n,r)},Pa={TASK:"task"},Qb={instagram:k.Instagram,linkedin:k.Linkedin,facebook:k.Facebook,twitter:k.Twitter,youtube:k.Youtube,blog:k.Calendar,other:k.Calendar},yf={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"},wc={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"},qh=["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"],Kh=t=>{const e=t.split("").reduce((n,r)=>n+r.charCodeAt(0),0);return qh[e%qh.length]};function Tl({task:t,view:e="month",mode:n="editorial",onClick:r,style:i}){var p;const[{isDragging:a},s]=_E(()=>({type:Pa.TASK,item:{id:t.id,type:Pa.TASK},collect:h=>({isDragging:!!h.isDragging()})}),[t.id]),o=t.channel?Qb[t.channel]:k.Calendar,f=t.date?new Date(t.date):null,c=t.endDate?new Date(t.endDate):f?R.addHours(f,1):null,d=f?R.format(f,"HH:mm"):null,u=f&&c?`${R.format(f,"HH:mm")} - ${R.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",a?"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?yf[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(he,{variant:"outline",className:w("px-1.5 py-0 text-[10px] h-5 font-normal uppercase tracking-wide",wc[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,g)=>l.jsxs(Wt,{className:"w-5 h-5 border border-white",children:[l.jsx(Wn,{src:h.avatar}),l.jsx($t,{className:"text-[8px]",children:h.name[0]})]},g))})]})]})]}):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",a?"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?yf[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:i,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",a?"opacity-50":"opacity-100",t.color||Kh(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,g)=>l.jsxs(Wt,{className:"w-4 h-4 border border-white",children:[l.jsx(Wn,{src:h.avatar}),l.jsx($t,{className:"text-[8px]",children:h.name[0]})]},g))}),t.status!=="published"&&l.jsx("div",{className:w("w-2 h-2 rounded-full",wc[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",a?"opacity-50":"opacity-100",t.color||Kh(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",a?"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?yf[t.channel]:"text-gray-400")}),l.jsx("span",{className:"truncate font-medium text-sm",children:t.title})]}),l.jsx(he,{variant:"secondary",className:"text-[10px] h-4 px-1 py-0",children:t.status})]})]})}function f5({days:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:i,view:a}){return l.jsx("div",{className:w("grid h-full min-h-[calc(100vh-200px)] bg-gray-50/30",a==="week"?"grid-cols-7 divide-x":"grid-cols-1 border-x"),children:t.map(s=>{const o=e.filter(f=>f.date&&R.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(c5,{day:s,tasks:o,onDropTask:n,onTaskClick:r,onAddClick:i,isToday:R.isToday(s)},s.toISOString())})})}function c5({day:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:i,isToday:a}){const[{isOver:s},o]=iu(()=>({accept:Pa.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",a&&"bg-purple-50/50"),children:[l.jsx("div",{className:"text-xs font-semibold uppercase text-gray-500 mb-1",children:R.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",a?"bg-[#7F26BF] text-white":"text-gray-900 bg-gray-100"),children:R.format(t,"d")})]}),l.jsxs("div",{className:"flex-1 p-2 space-y-3 overflow-y-auto",children:[l.jsxs(B,{variant:"outline",size:"sm",className:"w-full mb-2 justify-center px-1",onClick:()=>i(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(Tl,{task:f,view:"week",mode:"editorial",onClick:()=>r(f)},f.id))]})]})}function d5({days:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:i}){const a=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"})," ",a.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:R.format(R.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&&R.isSameDay(new Date(c.date),s));return l.jsx(u5,{day:s,tasks:f,onDropTask:n,onTaskClick:r,onAddClick:i,isLast:o===t.length-1,HOURS:a},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"})," ",a.map(s=>l.jsx("div",{className:"h-24 border-b border-dashed border-gray-100 w-full"},s))]})]})]})}function u5({day:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:i,isLast:a,HOURS:s}){const[{isOver:o},f]=iu(()=>({accept:Pa.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]",!a&&"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:[R.format(t,"EEE")," ",l.jsx("span",{className:w("ml-1",R.isToday(t)&&"text-blue-600"),children:R.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),i(u)}},c)),e.map(c=>{const d=c.date?new Date(c.date):new Date,u=c.endDate?new Date(c.endDate):R.addHours(d,1),p=R.getHours(d),h=R.getMinutes(d);let g=R.differenceInMinutes(u,d);g<30&&(g=30);const m=p*96+h/60*96+40,b=g/60*96;return l.jsx(Tl,{task:c,view:"week",mode:"execution",onClick:()=>r(c),style:{top:`${m}px`,height:`${b}px`,left:"4px",right:"4px",position:"absolute"}},c.id)})]})}function Gb({days:t,tasks:e,currentDate:n,onDropTask:r,onTaskClick:i,onAddClick:a,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&&R.isSameDay(new Date(c.date),o));return l.jsx(h5,{date:o,tasks:f,isCurrentMonth:R.isSameMonth(o,n),onDropTask:r,onTaskClick:i,onAddClick:a,mode:s},o.toISOString())})})}function h5({date:t,tasks:e,isCurrentMonth:n,onDropTask:r,onTaskClick:i,onAddClick:a,mode:s}){const[{isOver:o},f]=iu(()=>({accept:Pa.TASK,drop:d=>r(d.id,t),collect:d=>({isOver:!!d.isOver()})}),[t,r]),c=R.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:R.format(t,"d")}),l.jsx(B,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>a(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(Tl,{task:d,view:"month",mode:s,onClick:()=>i(d)},d.id))})]})}function Wb({isOpen:t,onClose:e,task:n,onSave:r,isNew:i=!1}){const[a,s]=M.useState(n||{});M.useMemo(()=>{s(n||{})},[n]);const o=()=>{r(a),e()};return l.jsx(Fa,{open:t,onOpenChange:f=>!f&&e(),children:l.jsxs(Ua,{className:"sm:max-w-[600px]",children:[l.jsxs(_a,{children:[l.jsx(Ja,{children:i?"Create New Task":"Edit Task"}),l.jsx(Va,{children:i?"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:a.title||"",onChange:f=>s({...a,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:a.date instanceof Date?R.format(a.date,"yyyy-MM-dd"):typeof a.date=="string"?a.date.split("T")[0]:"",onChange:f=>{const c=f.target.value,d=a.date instanceof Date?a.date:new Date,u=new Date(`${c}T${R.format(d,"HH:mm")}`);s({...a,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:a.date instanceof Date?R.format(a.date,"HH:mm"):"09:00",onChange:f=>{const c=f.target.value,d=a.date instanceof Date?R.format(a.date,"yyyy-MM-dd"):R.format(new Date,"yyyy-MM-dd");s({...a,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:a.channel||"instagram",onChange:f=>s({...a,channel:f.target.value}),children:Object.keys(Qb).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:a.status||"idea",onChange:f=>s({...a,status:f.target.value}),children:Object.keys(wc).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:a.description||"",onChange:f=>s({...a,description:f.target.value}),placeholder:"Details about this post..."})]})]}),l.jsxs(Wo,{children:[l.jsx(B,{variant:"outline",onClick:e,children:"Cancel"}),l.jsx(B,{className:"bg-[#7F26BF] hover:bg-[#6E21A6]",onClick:o,children:"Save Changes"})]})]})})}function $b({tasks:t,onTaskUpdate:e,onTaskCreate:n,defaultView:r="month"}){const[i,a]=M.useState(new Date),[s,o]=M.useState(r),[f,c]=M.useState(!0),[d,u]=M.useState(!1),[p,h]=M.useState(null),[g,m]=M.useState(!1),b=M.useMemo(()=>{let D,H;if(s==="month"){const V=R.startOfMonth(i),Q=R.endOfMonth(V);D=R.startOfWeek(V),H=R.endOfWeek(Q)}else s==="week"?(D=R.startOfWeek(i),H=R.endOfWeek(i)):(D=i,H=i);return R.eachDayOfInterval({start:D,end:H})},[i,s]),x=t.filter(D=>!D.date),y=t.filter(D=>D.date);return{currentDate:i,view:s,setView:o,isSidebarOpen:f,setIsSidebarOpen:c,isModalOpen:d,setIsModalOpen:u,editingTask:p,isNewTask:g,calendarDays:b,unplannedTasks:x,scheduledTasks:y,handlePrev:()=>{a(s==="month"?R.subMonths(i,1):s==="week"?R.addDays(i,-7):R.addDays(i,-1))},handleNext:()=>{a(s==="month"?R.addMonths(i,1):s==="week"?R.addDays(i,7):R.addDays(i,1))},handleToday:()=>a(new Date),handleDropTask:(D,H,V)=>{const Q=t.find(W=>W.id===D);if(Q){let W=new Date(H);if(s==="month"||V==="editorial")if(Q.date){const P=new Date(Q.date);W.setHours(P.getHours(),P.getMinutes())}else W.setHours(9,0);const F={...Q,date:W};e(F)}},handleTaskClick:D=>{h(D),m(!1),u(!0)},handleAddClick:D=>{const H=D||new Date;R.getHours(H)===0&&R.getMinutes(H)===0&&H.setHours(9,0),h({date:H,status:"idea",channel:"instagram"}),m(!0),u(!0)},handleModalSave:D=>{g?n&&n(D):D.id&&e(D),u(!1)}}}function Zb({isOpen:t,setIsOpen:e,tasks:n,onAddClick:r,onTaskClick:i,mode:a}){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(he,{variant:"secondary",className:"bg-gray-100 text-xs",children:n.length})]}),l.jsx(B,{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(B,{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(mr,{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(Tl,{task:s,view:"backlog",mode:a,onClick:()=>i(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(he,{className:"mt-2 h-5 w-5 p-0 flex items-center justify-center rounded-full bg-[#7F26BF] text-[10px]",children:n.length})]})}function qb({title:t,onPrev:e,onNext:n,onToday:r,onAdd:i,view:a,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(B,{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(B,{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(B,{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(Cb,{value:a,onValueChange:o=>s(o),className:"flex-shrink-0",children:l.jsxs(Lb,{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(B,{variant:"default",className:"h-9 px-4 flex-shrink-0",onClick:i,children:[l.jsx(k.Plus,{className:"mr-2 h-4 w-4"})," Create"]})]})]})}function Kb({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",R.isToday(e)?"text-[#7F26BF]":"text-gray-500"),children:R.format(e,"EEE")})},n))})}function p5(t){const e=$b({...t,defaultView:"month"});return l.jsx(Ab,{backend:Yb,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(Zb,{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(qb,{title:e.view==="day"?R.format(e.currentDate,"MMM d, yyyy"):R.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(Kb,{days:e.calendarDays}),l.jsx("div",{className:"flex-1 overflow-hidden flex flex-col relative",children:e.view==="month"?l.jsx(Gb,{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(f5,{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(Wb,{isOpen:e.isModalOpen,onClose:()=>e.setIsModalOpen(!1),task:e.editingTask||{},onSave:e.handleModalSave,isNew:e.isNewTask})]})})}function m5(t){const e=$b({...t,defaultView:"week"});return l.jsx(Ab,{backend:Yb,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(Zb,{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(qb,{title:e.view==="day"?R.format(e.currentDate,"MMM d, yyyy"):R.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(Kb,{days:e.calendarDays}),l.jsx("div",{className:"flex-1 overflow-hidden flex flex-col relative",children:e.view==="month"?l.jsx(Gb,{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(d5,{days:e.calendarDays,tasks:e.scheduledTasks,onDropTask:(n,r)=>e.handleDropTask(n,r,"execution"),onTaskClick:e.handleTaskClick,onAddClick:e.handleAddClick})})]}),e.isModalOpen&&l.jsx(Wb,{isOpen:e.isModalOpen,onClose:()=>e.setIsModalOpen(!1),task:e.editingTask||{},onSave:e.handleModalSave,isNew:e.isNewTask})]})})}const g5=Vs.FormProvider,Xb=I.createContext({}),b5=({...t})=>l.jsx(Xb.Provider,{value:{name:t.name},children:l.jsx(Vs.Controller,{...t})}),ns=()=>{const t=I.useContext(Xb),e=I.useContext(e4),{getFieldState:n}=Vs.useFormContext(),r=Vs.useFormState({name:t.name}),i=n(t.name,r);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:a}=e;return{id:a,name:t.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...i}},e4=I.createContext({});function x5({className:t,...e}){const n=I.useId();return l.jsx(e4.Provider,{value:{id:n},children:l.jsx("div",{"data-slot":"form-item",className:w("grid gap-2",t),...e})})}function v5({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 w5({...t}){const{error:e,formItemId:n,formDescriptionId:r,formMessageId:i}=ns();return l.jsx(Ln.Slot,{"data-slot":"form-control",id:n,"aria-describedby":e?`${r} ${i}`:`${r}`,"aria-invalid":!!e,...t})}function y5({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 M5({className:t,...e}){const{error:n,formMessageId:r}=ns(),i=n?String((n==null?void 0:n.message)??""):e.children;return i?l.jsx("p",{"data-slot":"form-message",id:r,className:w("text-destructive text-sm",t),...e,children:i}):null}const t4={"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"}},Xh=["#7F26BF","#0086E6","#24B347","#F26924","#E91E63","#9C27B0","#00BCD4","#FF9800"];function j5(t,e,n,r,i){const a=R.differenceInDays(r,n),s=R.differenceInDays(t,n),o=R.differenceInDays(e,t)+1,f=s/a*100,c=o/a*100;return{left:f,width:c}}const n4=I.memo(({task:t,timelineStart:e,timelineEnd:n,columnWidth:r,rowHeight:i,onTaskClick:a,onTaskEdit:s})=>{const{left:o,width:f}=j5(t.startDate,t.endDate,e,n),c=t4[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(rt,{children:[l.jsx(it,{asChild:!0,children:l.jsx("div",{className:w("w-4 h-4 rotate-45 cursor-pointer transition-all hover:scale-125",c.barColor),onClick:()=>a==null?void 0:a(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:["📅 ",R.format(t.startDate,"dd/MM/yyyy",{locale:vt})]})]})})]}),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(Ze,{asChild:!0,children:l.jsxs("div",{className:"absolute group/task cursor-pointer",style:{left:`${o}%`,width:`${f}%`,top:"20%",height:"60%"},onClick:()=>a==null?void 0:a(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(Wt,{className:"size-5 border border-white/50",children:l.jsx($t,{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(qe,{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:[R.format(t.startDate,"dd/MM/yyyy",{locale:vt})," -"," ",R.format(t.endDate,"dd/MM/yyyy",{locale:vt})]})]}),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:[R.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(he,{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"]})]})]})})]})});n4.displayName="TaskRow";const C5=["DOM","SEG","TER","QUA","QUI","SEX","SAB"],r4=I.forwardRef(({tasks:t,projects:e=[],onTaskClick:n,onTaskEdit:r,rowHeight:i=48,columnWidth:a=40,groupBy:s="projects"},o)=>{const[f,c]=I.useState(new Date),[d,u]=I.useState(new Set),p=R.startOfMonth(f),h=R.endOfMonth(f),g=R.eachDayOfInterval({start:p,end:h}),m=()=>c(R.subMonths(f,1)),b=()=>c(R.addMonths(f,1)),x=()=>c(new Date),y=I.useMemo(()=>{if(s==="assignees"){const v=new Map;return t.forEach(C=>{var S;const N=((S=C.assignee)==null?void 0:S.name)||"Sem responsável";v.has(N)||v.set(N,[]),v.get(N).push(C)}),Array.from(v.entries()).map(([C,N],S)=>{var T,D,H;return{id:C,name:C,color:(T=N[0])!=null&&T.assignee?Xh[S%Xh.length]:"#999",initials:((H=(D=N[0])==null?void 0:D.assignee)==null?void 0:H.initials)||"??",tasks:N}})}else{const v=new Map;return t.forEach(L=>{const C=L.projectId;v.has(C)||v.set(C,[]),v.get(C).push(L)}),e.length>0?e.map(C=>({...C,tasks:v.get(C.id)||[]})).filter(C=>C.tasks.length>0):[{id:"default",name:"Tarefas",color:"#7F26BF",tasks:t}]}},[t,e,s]),j=v=>{u(L=>{const C=new Set(L);return C.has(v)?C.delete(v):C.add(v),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(B,{variant:"ghost",size:"icon",onClick:m,children:l.jsx(k.ChevronLeft,{className:"h-4 w-4"})}),l.jsx("h2",{className:"text-lg font-bold min-w-[200px] text-center",children:R.format(f,"MMMM yyyy",{locale:vt})}),l.jsx(B,{variant:"ghost",size:"icon",onClick:b,children:l.jsx(k.ChevronRight,{className:"h-4 w-4"})})]}),l.jsx(B,{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:g.map(v=>{const L=R.isWeekend(v);return l.jsx("div",{className:w("flex-shrink-0 border-r text-center bg-background",L&&"bg-muted/20"),style:{width:`${a}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:C5[v.getDay()]}),l.jsx("span",{className:"text-[10px] text-muted-foreground leading-none",children:R.format(v,"d",{locale:vt})})]})},v.toISOString())})})]}),l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 flex pointer-events-none pl-[280px]",children:g.map(v=>{const L=R.isWeekend(v),C=R.isSameDay(v,new Date);return l.jsx("div",{className:w("flex-shrink-0 h-full",L&&"bg-muted/10",C&&"bg-primary/5"),style:{width:`${a}px`}},`grid-${v.toISOString()}`)})}),y.map(v=>{const L=d.has(v.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:`${i}px`},onClick:()=>j(v.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"&&v.initials?l.jsx(Wt,{className:"size-6",children:l.jsx($t,{style:{backgroundColor:v.color},className:"text-white text-[10px]",children:v.initials})}):l.jsx("div",{className:"size-3 rounded-full flex-shrink-0",style:{backgroundColor:v.color||"var(--primary)"}}),l.jsx("span",{className:"font-medium text-sm truncate",children:v.name}),l.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:v.tasks.length})]}),l.jsx("div",{className:"flex-1 border-b",style:{height:`${i}px`}})]}),!L&&v.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:`${i}px`},children:[l.jsx("div",{className:w("size-2 rounded-full flex-shrink-0",C.milestone&&"rotate-45"),style:{backgroundColor:v.color}}),l.jsx("span",{className:"text-sm truncate flex-1",children:C.name}),s==="projects"&&C.assignee&&l.jsx(Wt,{className:"size-6 opacity-0 group-hover:opacity-100 transition-opacity",children:l.jsx($t,{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:`${i}px`},children:l.jsx(n4,{task:C,timelineStart:p,timelineEnd:h,columnWidth:a,rowHeight:i,onTaskClick:n,onTaskEdit:r})})]},C.id))]},v.id)}),(()=>{const v=new Date;if(v>=p&&v<=h){const C=280+R.differenceInDays(v,p)*a+a/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})()]})]})})})]})});r4.displayName="GanttChart";const i4=I.forwardRef(({className:t},e)=>l.jsxs("div",{ref:e,className:w("flex flex-wrap gap-4",t),children:[Object.entries(t4).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"})]})]}));i4.displayName="GanttLegend";function L5({...t}){return l.jsx(Ys.Root,{"data-slot":"hover-card",...t})}function N5({...t}){return l.jsx(Ys.Trigger,{"data-slot":"hover-card-trigger",...t})}function k5({className:t,align:e="center",sideOffset:n=4,...r}){return l.jsx(Ys.Portal,{"data-slot":"hover-card-portal",children:l.jsx(Ys.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 S5({className:t,containerClassName:e,...n}){return l.jsx(rp.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 I5({className:t,...e}){return l.jsx("div",{"data-slot":"input-otp-group",className:w("flex items-center gap-1",t),...e})}function T5({index:t,className:e,...n}){const r=I.useContext(rp.OTPInputContext),{char:i,hasFakeCaret:a,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:[i,a&&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 D5({...t}){return l.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...t,children:l.jsx(k.MinusIcon,{})})}function au({className:t,value:e,...n}){return l.jsx(fu.Root,{"data-slot":"progress",className:w("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",t),...n,children:l.jsx(fu.Indicator,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})})}const E5={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"}},a4=I.forwardRef(({title:t,description:e,coverImage:n,thumbnailImage:r,tags:i=[],assignees:a=[],priority:s,dueDate:o,comments:f,attachments:c,checklist:d,progress:u,status:p,variant:h="default",isDragging:g=!1,onClick:m,onEdit:b,onDelete:x,onDuplicate:y,className:j},v)=>{const L=o&&new Date(o)<new Date,C=s?E5[s]:null,N=T=>{const D=T.getDate().toString().padStart(2,"0"),H=(T.getMonth()+1).toString().padStart(2,"0");return`${D}/${H}`},S=T=>{T.target.closest("button")||T.target.closest("[role='menuitem']")||m==null||m()};return l.jsxs(jr,{ref:v,className:w("group cursor-grab active:cursor-grabbing transition-all duration-200","hover:shadow-lg hover:scale-[1.02]",g&&"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(he,{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(li,{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(fi,{className:w("line-clamp-2",h==="compact"?"text-sm":"text-base"),children:t}),p&&h==="detailed"&&l.jsx(he,{variant:"outline",className:"mt-1 text-xs",children:p})]})]}),e&&h!=="compact"&&l.jsx(sp,{className:"mt-2 line-clamp-2 text-xs",children:e})]}),(b||x||y)&&l.jsxs(Ra,{children:[l.jsx(Ba,{asChild:!0,children:l.jsx(B,{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(Ha,{align:"end",children:[b&&l.jsx(gr,{onClick:b,children:"Editar"}),y&&l.jsx(gr,{onClick:y,children:"Duplicar"}),x&&l.jsx(gr,{onClick:x,className:"text-destructive",children:"Excluir"})]})]})]}),i.length>0&&l.jsxs("div",{className:"flex flex-wrap gap-1 mt-2",children:[i.slice(0,h==="compact"?2:3).map(T=>l.jsx(he,{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)),i.length>(h==="compact"?2:3)&&l.jsxs(he,{variant:"secondary",className:"text-xs",children:["+",i.length-(h==="compact"?2:3)]})]}),s&&!n&&h==="detailed"&&l.jsxs(he,{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(ci,{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(au,{value:u,className:"h-1.5"})]})}),l.jsxs(op,{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})]})]}),a.length>0&&l.jsxs("div",{className:"flex -space-x-2",children:[a.slice(0,3).map(T=>l.jsxs(Wt,{className:"h-6 w-6 border-2 border-background",children:[T.avatar&&l.jsx(Wn,{src:T.avatar,alt:T.name}),l.jsx($t,{className:"text-xs",children:T.initials||T.name.slice(0,2).toUpperCase()})]},T.id)),a.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:["+",a.length-3]})]})]})]})});a4.displayName="KanbanCard";const s4=I.forwardRef(({title:t,primaryContent:e,secondaryContent:n,trendValue:r,trendLabel:i,icon:a=k.Activity,isLoading:s=!1,onClick:o,className:f},c)=>s?l.jsxs(jr,{ref:c,className:f,children:[l.jsx(li,{className:"pb-1",children:l.jsxs(fi,{className:"text-sm flex items-center gap-2",children:[l.jsx(Rn,{className:"h-4 w-4 rounded"}),l.jsx(Rn,{className:"h-4 w-24"})]})}),l.jsxs(ci,{className:"space-y-1 pt-0",children:[l.jsx(Rn,{className:"h-8 w-32"}),l.jsx(Rn,{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(li,{className:"pb-1",children:l.jsxs(fi,{className:"text-sm flex items-center gap-2 text-muted-foreground",children:[l.jsx(a,{className:"h-4 w-4 text-muted-foreground"}),t]})}),l.jsxs(ci,{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(he,{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"}),i]})]}),n&&l.jsx("p",{className:"text-xs text-muted-foreground",children:n})]})]}));s4.displayName="KPICard";function A5(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 z5(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 O5(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 P5({attachments:t,onDownload:e,onRemove:n,onView:r,showDownload:i=!0,showRemove:a=!1,showView:s=!1,maxFilenameLength:o=40,variant:f="compact",emptyMessage:c="Nenhum anexo",isLoading:d=!1,className:u}){const[p,h]=M.useState({}),g=async(m,b,x)=>{if(!x)return;const y=m.chave||m.nomeOriginal;h(j=>({...j,[y]:b}));try{await x(m)}finally{h(j=>({...j,[y]:null}))}};return d?l.jsx("div",{className:w("space-y-2",u),children:[1,2,3].map(m=>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"})]},m))}):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((m,b)=>{const x=m.chave||m.id||`${m.nomeOriginal}-${b}`,y=p[m.chave||m.nomeOriginal],j=y==="download",v=y==="view",L=(()=>{switch(m.status){case"completed":return l.jsx(he,{variant:"outline",className:"bg-green-50 text-green-600 border-green-200 hover:bg-green-50",children:"✓ Enviado"});case"uploading":return l.jsx(he,{variant:"outline",className:"bg-blue-50 text-blue-600 border-blue-200 hover:bg-blue-50",children:"Enviando..."});case"failed":return l.jsx(he,{variant:"outline",className:"bg-red-50 text-red-600 border-red-200 hover:bg-red-50",children:"✗ Erro"});case"retrying":return l.jsx(he,{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",m.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(Tt,{children:l.jsxs(rt,{children:[l.jsx(it,{asChild:!0,children:l.jsx("p",{className:"text-sm font-medium truncate",children:m.nomeOriginal})}),l.jsx(at,{children:l.jsx("p",{children:m.nomeOriginal})})]})}),l.jsxs("div",{className:"flex items-center gap-2 mt-1 text-xs text-muted-foreground",children:[m.tamanhoBytes&&l.jsx("span",{children:A5(m.tamanhoBytes)}),m.tamanhoBytes&&m.dataUpload&&l.jsx("span",{children:"•"}),m.dataUpload&&l.jsx("span",{children:z5(m.dataUpload)})]}),m.status==="uploading"&&typeof m.progress=="number"&&l.jsx(au,{value:m.progress,className:"h-1 mt-2"}),m.status==="failed"&&m.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:m.erro})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[L,m.status==="completed"&&l.jsxs(l.Fragment,{children:[s&&r&&l.jsx(Tt,{children:l.jsxs(rt,{children:[l.jsx(it,{asChild:!0,children:l.jsx(B,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>g(m,"view",r),disabled:v,children:l.jsx(k.Eye,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Visualizar"})]})}),i&&e&&l.jsx(Tt,{children:l.jsxs(rt,{children:[l.jsx(it,{asChild:!0,children:l.jsx(B,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>g(m,"download",e),disabled:j,children:l.jsx(k.Download,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Baixar"})]})}),a&&n&&l.jsx(Tt,{children:l.jsxs(rt,{children:[l.jsx(it,{asChild:!0,children:l.jsx(B,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>n(m),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",m.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(Tt,{children:l.jsxs(rt,{children:[l.jsx(it,{asChild:!0,children:l.jsx("span",{className:"text-sm truncate",children:O5(m.nomeOriginal,o)})}),l.jsx(at,{children:l.jsx("p",{className:"max-w-xs break-all",children:m.nomeOriginal})})]})}),m.status==="uploading"&&typeof m.progress=="number"&&l.jsxs("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:[m.progress,"%"]}),L]}),m.status==="completed"&&l.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[s&&r&&l.jsx(Tt,{children:l.jsxs(rt,{children:[l.jsx(it,{asChild:!0,children:l.jsx(B,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>g(m,"view",r),disabled:v,children:l.jsx(k.Eye,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Visualizar"})]})}),i&&e&&l.jsx(Tt,{children:l.jsxs(rt,{children:[l.jsx(it,{asChild:!0,children:l.jsx(B,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>g(m,"download",e),disabled:j,children:l.jsx(k.Download,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Baixar"})]})}),a&&n&&l.jsx(Tt,{children:l.jsxs(rt,{children:[l.jsx(it,{asChild:!0,children:l.jsx(B,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>n(m),children:l.jsx(k.Trash2,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Remover"})]})})]}),m.status==="failed"&&m.erro&&l.jsx(Tt,{children:l.jsxs(rt,{children:[l.jsx(it,{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:m.erro})})]})})]},x)})})}function R5({className:t,...e}){return l.jsx(Ge.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 B5({...t}){return l.jsx(Ge.Menu,{"data-slot":"menubar-menu",...t})}function H5({...t}){return l.jsx(Ge.Group,{"data-slot":"menubar-group",...t})}function o4({...t}){return l.jsx(Ge.Portal,{"data-slot":"menubar-portal",...t})}function F5({...t}){return l.jsx(Ge.RadioGroup,{"data-slot":"menubar-radio-group",...t})}function U5({className:t,...e}){return l.jsx(Ge.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 _5({className:t,align:e="start",alignOffset:n=-4,sideOffset:r=8,...i}){return l.jsx(o4,{children:l.jsx(Ge.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),...i})})}function J5({className:t,inset:e,variant:n="default",...r}){return l.jsx(Ge.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 V5({className:t,children:e,checked:n,...r}){return l.jsxs(Ge.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(Ge.ItemIndicator,{children:l.jsx(k.CheckIcon,{className:"size-4"})})}),e]})}function Y5({className:t,children:e,...n}){return l.jsxs(Ge.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(Ge.ItemIndicator,{children:l.jsx(k.CircleIcon,{className:"size-2 fill-current"})})}),e]})}function Q5({className:t,inset:e,...n}){return l.jsx(Ge.Label,{"data-slot":"menubar-label","data-inset":e,className:w("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...n})}function G5({className:t,...e}){return l.jsx(Ge.Separator,{"data-slot":"menubar-separator",className:w("bg-border -mx-1 my-1 h-px",t),...e})}function W5({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 $5({...t}){return l.jsx(Ge.Sub,{"data-slot":"menubar-sub",...t})}function Z5({className:t,inset:e,children:n,...r}){return l.jsxs(Ge.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 q5({className:t,...e}){return l.jsx(Ge.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 K5({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(rA,{})]})}function X5({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 eA({className:t,...e}){return l.jsx(Er.Item,{"data-slot":"navigation-menu-item",className:w("relative",t),...e})}const l4=fn.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 tA({className:t,children:e,...n}){return l.jsxs(Er.Trigger,{"data-slot":"navigation-menu-trigger",className:w(l4(),"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 nA({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 rA({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 iA({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 aA({title:t,description:e,breadcrumbs:n,actions:r,secondaryNavCollapsed:i=!1,onSecondaryNavToggle:a,className:s}){return l.jsxs("div",{className:w("border-b bg-background",s),children:[l.jsxs("div",{className:"flex h-14 items-center gap-4 px-6",children:[l.jsx(B,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:a,title:i?"Mostrar menu lateral":"Ocultar menu lateral",children:i?l.jsx(k.PanelLeftOpen,{className:"h-4 w-4"}):l.jsx(k.PanelLeftClose,{className:"h-4 w-4"})}),n&&n.length>0&&l.jsx(Lp,{children:l.jsx(Np,{children:n.map((o,f)=>l.jsxs(I.Fragment,{children:[f>0&&l.jsx(Tp,{}),l.jsx(kp,{children:f===n.length-1?l.jsx(Ip,{children:o.label}):o.href?l.jsx(Sp,{href:o.href,children:o.label}):l.jsx("span",{children:o.label})})]},f))})}),!n&&l.jsx("div",{className:"flex-1",children:l.jsx("h1",{className:"text-lg font-semibold",children:t})}),r&&l.jsx("div",{className:"ml-auto flex items-center gap-2",children:r})]}),e&&l.jsx("div",{className:"border-t px-6 py-3",children:l.jsx("p",{className:"text-sm text-muted-foreground",children:e})})]})}function sA({title:t,icon:e,badge:n,actions:r,secondaryNavCollapsed:i=!1,onSecondaryNavToggle:a,className:s}){return l.jsxs("div",{className:w("flex h-14 items-center gap-3 border-b bg-background px-6",s),children:[l.jsx(B,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:a,title:i?"Mostrar menu lateral":"Ocultar menu lateral",children:i?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}),r&&l.jsx("div",{className:"flex shrink-0 items-center gap-2",children:r})]})}function oA({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 lA({className:t,...e}){return l.jsx("ul",{"data-slot":"pagination-content",className:w("flex flex-row items-center gap-1",t),...e})}function fA({...t}){return l.jsx("li",{"data-slot":"pagination-item",...t})}function su({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(_n({variant:e?"outline":"ghost",size:n}),t),...r})}function cA({className:t,...e}){return l.jsxs(su,{"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 dA({className:t,...e}){return l.jsxs(su,{"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 uA({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 f4=I.forwardRef(({className:t,showToggle:e=!0,...n},r)=>{const[i,a]=I.useState(!1);return l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:i?"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:()=>a(!i),className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",tabIndex:-1,"aria-label":i?"Hide password":"Show password",children:i?l.jsx(k.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(k.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})});f4.displayName="PasswordInput";function hA({className:t,...e}){return l.jsx(jf.Root,{"data-slot":"radio-group",className:w("grid gap-3",t),...e})}function pA({className:t,...e}){return l.jsx(jf.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(jf.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 mA({className:t,...e}){return l.jsx(Cc.PanelGroup,{"data-slot":"resizable-panel-group",className:w("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...e})}function gA({...t}){return l.jsx(Cc.Panel,{"data-slot":"resizable-panel",...t})}function bA({withHandle:t,className:e,...n}){return l.jsx(Cc.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 xA({filters:t=[],onSelectFilter:e,onToggleFavorite:n,onDeleteFilter:r,className:i}){const a=t.filter(o=>o.isFavorite),s=t.filter(o=>!o.isFavorite);return l.jsxs(Ra,{children:[l.jsx(Ba,{asChild:!0,children:l.jsxs(B,{variant:"outline",size:"sm",className:w("gap-2",i),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(Ha,{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:[a.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"}),a.map(o=>l.jsx(ep,{filter:o,onSelect:e,onToggleFavorite:n,onDelete:r},o.id)),s.length>0&&l.jsx(Qs,{})]}),s.length>0&&l.jsxs(l.Fragment,{children:[a.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(ep,{filter:o,onSelect:e,onToggleFavorite:n,onDelete:r},o.id))]})]})})]})}function ep({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:i=>{i.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:i=>{i.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 c4({...t}){return l.jsx(Ae.Root,{"data-slot":"sheet",...t})}function vA({...t}){return l.jsx(Ae.Trigger,{"data-slot":"sheet-trigger",...t})}function wA({...t}){return l.jsx(Ae.Close,{"data-slot":"sheet-close",...t})}function yA({...t}){return l.jsx(Ae.Portal,{"data-slot":"sheet-portal",...t})}const d4=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}));d4.displayName=Ae.Overlay.displayName;function u4({className:t,children:e,side:n="right",...r}){return l.jsxs(yA,{children:[l.jsx(d4,{}),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 h4({className:t,...e}){return l.jsx("div",{"data-slot":"sheet-header",className:w("flex flex-col gap-1.5 p-4",t),...e})}function MA({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 p4({className:t,...e}){return l.jsx(Ae.Title,{"data-slot":"sheet-title",className:w("text-foreground font-semibold",t),...e})}function m4({className:t,...e}){return l.jsx(Ae.Description,{"data-slot":"sheet-description",className:w("text-muted-foreground text-sm",t),...e})}const Mf=768;function g4(){const[t,e]=I.useState(void 0);return I.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Mf-1}px)`),r=()=>{e(window.innerWidth<Mf)};return n.addEventListener("change",r),e(window.innerWidth<Mf),()=>n.removeEventListener("change",r)},[]),!!t}const jA="sidebar_state",CA=3600*24*7,LA="16rem",NA="18rem",kA="3rem",SA="b",b4=I.createContext(null);function rs(){const t=I.useContext(b4);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function IA({defaultOpen:t=!0,open:e,onOpenChange:n,className:r,style:i,children:a,...s}){const o=g4(),[f,c]=I.useState(!1),[d,u]=I.useState(t),p=e??d,h=I.useCallback(x=>{const y=typeof x=="function"?x(p):x;n?n(y):u(y),document.cookie=`${jA}=${y}; path=/; max-age=${CA}`},[n,p]),g=I.useCallback(()=>o?c(x=>!x):h(x=>!x),[o,h,c]);I.useEffect(()=>{const x=y=>{y.key===SA&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),g())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[g]);const m=p?"expanded":"collapsed",b=I.useMemo(()=>({state:m,open:p,setOpen:h,isMobile:o,openMobile:f,setOpenMobile:c,toggleSidebar:g}),[m,p,h,o,f,c,g]);return l.jsx(b4.Provider,{value:b,children:l.jsx(Tt,{delayDuration:0,children:l.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":LA,"--sidebar-width-icon":kA,...i},className:w("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...s,children:a})})})}function TA({side:t="left",variant:e="sidebar",collapsible:n="offcanvas",className:r,children:i,...a}){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),...a,children:i}):s?l.jsx(c4,{open:f,onOpenChange:c,...a,children:l.jsxs(u4,{"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":NA},side:t,children:[l.jsxs(h4,{className:"sr-only",children:[l.jsx(p4,{children:"Sidebar"}),l.jsx(m4,{children:"Displays the mobile sidebar."})]}),l.jsx("div",{className:"flex h-full w-full flex-col",children:i})]})}):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),...a,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:i})})]})}function DA({className:t,onClick:e,...n}){const{toggleSidebar:r}=rs();return l.jsxs(B,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:w("size-7",t),onClick:i=>{e==null||e(i),r()},...n,children:[l.jsx(k.PanelLeftIcon,{}),l.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function EA({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 AA({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 zA({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 OA({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 PA({className:t,...e}){return l.jsx(Bn,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:w("bg-sidebar-border mx-2 w-auto",t),...e})}function RA({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 BA({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 HA({className:t,asChild:e=!1,...n}){const r=e?Ln.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 FA({className:t,asChild:e=!1,...n}){const r=e?Ln.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 UA({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 _A({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 JA({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 VA=fn.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 YA({asChild:t=!1,isActive:e=!1,variant:n="default",size:r="default",tooltip:i,className:a,...s}){const o=t?Ln.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(VA({variant:n,size:r}),a),...s});return i?(typeof i=="string"&&(i={children:i}),l.jsxs(rt,{children:[l.jsx(it,{asChild:!0,children:d}),l.jsx(at,{side:"right",align:"center",hidden:c!=="collapsed"||f,...i})]})):d}function QA({className:t,asChild:e=!1,showOnHover:n=!1,...r}){const i=e?Ln.Slot:"button";return l.jsx(i,{"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 GA({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 WA({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(Rn,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),l.jsx(Rn,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})}function $A({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 ZA({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 qA({asChild:t=!1,size:e="md",isActive:n=!1,className:r,...i}){const a=t?Ln.Slot:"a";return l.jsx(a,{"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),...i})}function x4({className:t,defaultValue:e,value:n,min:r=0,max:i=100,...a}){const s=I.useMemo(()=>Array.isArray(n)?n:Array.isArray(e)?e:[r,i],[n,e,r,i]);return l.jsxs(ps.Root,{"data-slot":"slider",defaultValue:e,value:n,min:r,max:i,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),...a,children:[l.jsx(ps.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(ps.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(ps.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 v4=fn.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"}}),KA=()=>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"})]}),XA=()=>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"})}),e8=()=>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"})}),t8=()=>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"})]}),w4=I.forwardRef(({className:t,variant:e,size:n,provider:r,children:i,...a},s)=>{const o=e||r,f=()=>{switch(r){case"google":return l.jsx(KA,{});case"github":return l.jsx(k.Github,{className:"h-5 w-5"});case"facebook":return l.jsx(e8,{});case"apple":return l.jsx(XA,{});case"microsoft":return l.jsx(t8,{});default:return null}},c=()=>`Continue with ${{google:"Google",github:"GitHub",facebook:"Facebook",apple:"Apple",microsoft:"Microsoft"}[r]}`;return l.jsxs("button",{className:w(v4({variant:o,size:n,className:t})),ref:s,...a,children:[f(),l.jsx("span",{children:i||c()})]})});w4.displayName="SocialButton";function y4({className:t,...e}){return l.jsx(cu.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(cu.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 n8=[{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 r8({task:t,open:e,onOpenChange:n,onSave:r,availableTasks:i=[],availableAssignees:a=[]}){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=(y,j)=>{o(v=>v?{...v,[y]:j}:null)},g=y=>{o(j=>{if(!j)return null;const v=j.dependencies||[],L=v.includes(y)?v.filter(C=>C!==y):[...v,y];return{...j,dependencies:L}})},m=i.filter(y=>y.id!==s.id),b=s.name.trim()!==""&&s.startDate<=s.endDate;return l.jsx(Fa,{open:e,onOpenChange:n,children:l.jsxs(Ua,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[l.jsxs(_a,{children:[l.jsx(Ja,{children:"Editar Tarefa"}),l.jsx(Va,{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(Gt,{id:"task-name",value:s.name,onChange:y=>h("name",y.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(Zd,{id:"task-description",value:s.description||"",onChange:y=>h("description",y.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(Ze,{asChild:!0,children:l.jsxs(B,{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?R.format(s.startDate,"dd/MM/yyyy",{locale:vt}):"Selecionar data"]})}),l.jsx(qe,{className:"w-auto p-0",align:"start",children:l.jsx(Calendar,{mode:"single",selected:s.startDate,onSelect:y=>{y&&(h("startDate",y),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(Ze,{asChild:!0,children:l.jsxs(B,{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?R.format(s.endDate,"dd/MM/yyyy",{locale:vt}):"Selecionar data"]})}),l.jsx(qe,{className:"w-auto p-0",align:"start",children:l.jsx(Calendar,{mode:"single",selected:s.endDate,onSelect:y=>{y&&(h("endDate",y),u(!1))},disabled:y=>s.startDate?y<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(Xt,{value:s.status,onValueChange:y=>h("status",y),children:[l.jsx(tn,{id:"task-status",children:l.jsx(en,{})}),l.jsx(nn,{children:n8.map(y=>l.jsx(Dt,{value:y.value,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:w("size-2 rounded-full",y.color)}),y.label]})},y.value))})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{htmlFor:"task-assignee",children:"Responsável"}),l.jsxs(Xt,{value:((x=s.assignee)==null?void 0:x.name)||"",onValueChange:y=>{const j=a.find(v=>v.name===y);h("assignee",j||void 0)},children:[l.jsx(tn,{id:"task-assignee",children:l.jsx(en,{placeholder:"Selecionar responsável"})}),l.jsx(nn,{children:a.map(y=>l.jsx(Dt,{value:y.name,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(k.User,{className:"size-4"}),y.name]})},y.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(x4,{value:[s.progress],onValueChange:y=>h("progress",y[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(y4,{id:"milestone-toggle",checked:s.milestone||!1,onCheckedChange:y=>h("milestone",y)})]}),m.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:m.map(y=>{var v;const j=((v=s.dependencies)==null?void 0:v.includes(y.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:()=>g(y.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:y.name}),y.assignee&&l.jsx(he,{variant:"outline",className:"text-xs",children:y.assignee.name})]},y.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(Wo,{children:[l.jsx(B,{variant:"outline",onClick:()=>n(!1),children:"Cancelar"}),l.jsx(B,{onClick:p,disabled:!b,children:"Salvar alterações"})]})]})})}const i8=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"})}},a8=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"}},s8=({event:t,isLast:e,onDetailsOpen:n})=>{var o,f,c,d,u,p,h;const[r,i]=I.useState(!1),a=!!((o=t.metadata)!=null&&o.before||(f=t.metadata)!=null&&f.after||(c=t.metadata)!=null&&c.details),s=g=>{i(g),g&&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",a8(t.action)),children:i8(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:R.format(t.timestamp,"PPpp",{locale:vt}),children:R.formatDistanceToNow(t.timestamp,{addSuffix:!0,locale:vt})})]}),a&&l.jsxs(zp,{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(he,{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(Op,{asChild:!0,children:l.jsxs(B,{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(Pp,{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})]})})]})]})})]})},o8=({events:t,className:e,onDetailsOpen:n})=>l.jsx("div",{className:w("flex flex-col",e),children:t.map((r,i)=>l.jsx(s8,{event:r,isLast:i===t.length-1,onDetailsOpen:n},r.id))});function l8(t){const{theme:e="system"}=mx.useTheme();return l.jsx(ip.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-medium text-sm",description:"text-sm mt-1",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 M4=I.createContext({size:"default",variant:"default"});function f8({className:t,variant:e,size:n,children:r,...i}){return l.jsx(ap.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),...i,children:l.jsx(M4.Provider,{value:{variant:e,size:n},children:r})})}function c8({className:t,children:e,variant:n,size:r,...i}){const a=I.useContext(M4);return l.jsx(ap.Item,{"data-slot":"toggle-group-item","data-variant":a.variant||n,"data-size":a.size||r,className:w(qd({variant:a.variant||n,size:a.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),...i,children:e})}const j4=I.createContext(void 0);function C4(){const t=I.useContext(j4);if(!t)throw new Error("UnderlineTabs components must be used within UnderlineTabs");return t}function d8({defaultValue:t,value:e,onValueChange:n,children:r,className:i}){const[a,s]=I.useState(t||""),o=e!==void 0?e:a,f=c=>{e===void 0&&s(c),n==null||n(c)};return l.jsx(j4.Provider,{value:{value:o,onValueChange:f},children:l.jsx("div",{className:w("w-full",i),role:"tablist",children:r})})}function u8({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 h8({value:t,children:e,className:n,disabled:r=!1}){const{value:i,onValueChange:a}=C4(),s=i===t;return l.jsx("button",{type:"button",role:"tab","aria-selected":s,"aria-disabled":r,disabled:r,onClick:()=>!r&&a(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 p8({value:t,children:e,className:n}){const{value:r}=C4();return r!==t?null:l.jsx("div",{role:"tabpanel","aria-labelledby":t,className:w("mt-4",n),children:e})}function m8(t,e){const n=e*1024*1024;return t.size>n?`Arquivo muito grande. Máximo: ${e}MB`:null}function g8(t,e){if(!e)return null;const n=e.split(",").map(s=>s.trim().toLowerCase()),r=t.name.toLowerCase(),i=t.type.toLowerCase();return n.some(s=>{if(s.includes("*")){const[o]=s.split("/");return i.startsWith(o+"/")}return s.startsWith(".")?r.endsWith(s):i===s})?null:"Tipo de arquivo não suportado"}function b8({onFilesSelected:t,accept:e,multiple:n=!0,maxFiles:r=10,maxSizeMB:i=50,disabled:a=!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),g=M.useRef(null),m=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){m(`Máximo de ${r} arquivo(s) permitido(s)`);return}const T=[],D=[];for(const H of S){const V=m8(H,i);if(V){D.push(`${H.name}: ${V}`);continue}const Q=g8(H,e);if(Q){D.push(`${H.name}: ${Q}`);continue}T.push(H)}D.length>0&&m(D.join(`
|
|
222
|
+
`),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[Ub]:{exposeProperties:{text:(t,e)=>vf(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function e5(t,e){const n=vc[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new XE(n);return r.loadDataTransfer(e),r}function wf(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(vc).filter(n=>{const r=vc[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(i=>e.indexOf(i)>-1):!1})[0]||null}const t5=Bb(()=>/firefox/i.test(navigator.userAgent)),Jb=Bb(()=>!!window.safari);class $h{interpolate(e){const{xs:n,ys:r,c1s:i,c2s:a,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]+i[o]*u+a[o]*p+s[o]*u*p}constructor(e,n){const{length:r}=e,i=[];for(let h=0;h<r;h++)i.push(h);i.sort((h,g)=>e[h]<e[g]?-1:1);const a=[],s=[];let o,f;for(let h=0;h<r-1;h++)o=e[h+1]-e[h],f=n[h+1]-n[h],a.push(o),s.push(f/o);const c=[s[0]];for(let h=0;h<a.length-1;h++){const g=s[h],m=s[h+1];if(g*m<=0)c.push(0);else{o=a[h];const b=a[h+1],x=o+b;c.push(3*x/((x+b)/g+(x+o)/m))}}c.push(s[s.length-1]);const d=[],u=[];let p;for(let h=0;h<c.length-1;h++){p=s[h];const g=c[h],m=1/a[h],b=g+c[h+1]-p-p;d.push((p-g-b)*m),u.push(b*m*m)}this.xs=e,this.ys=n,this.c1s=c,this.c2s=d,this.c3s=u}}const n5=1;function Vb(t){const e=t.nodeType===n5?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function Es(t){return{x:t.clientX,y:t.clientY}}function r5(t){var e;return t.nodeName==="IMG"&&(t5()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function i5(t,e,n,r){let i=t?e.width:n,a=t?e.height:r;return Jb()&&t&&(a/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:a}}function a5(t,e,n,r,i){const a=r5(e),o=Vb(a?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:g}=i5(a,e,c,d),m=()=>{let C=new $h([0,.5,1],[f.y,f.y/d*g,f.y+g-d]).interpolate(p);return Jb()&&a&&(C+=(window.devicePixelRatio-1)*g),C},b=()=>new $h([0,.5,1],[f.x,f.x/c*h,f.x+h-c]).interpolate(u),{offsetX:x,offsetY:y}=i,j=x===0||x,v=y===0||y;return{x:j?x:b(),y:v?y:m()}}class s5{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 o5(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zh(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(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){o5(t,i,n[i])})}return t}class l5{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 i=s=>this.handleDragStart(s,e),a=s=>this.handleSelectStart(s);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",a),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",a),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=s=>this.handleDragEnter(s,e),i=s=>this.handleDragOver(s,e),a=s=>this.handleDrop(s,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",i),n.addEventListener("drop",a),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",i),n.removeEventListener("drop",a)}}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 Zh({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 Zh({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(Wh).some(n=>Wh[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=e5(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=i=>{const a=this.sourceNodes.get(i);return a&&Vb(a)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{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=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:a}=this;this.dragStartSourceIds=null;const s=Es(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:s});const{dataTransfer:o}=i,f=wf(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:g,offsetX:m,offsetY:b}=this.getCurrentSourcePreviewNodeOptions(),j=a5(u,p,s,{anchorX:h,anchorY:g},{offsetX:m,offsetY:b});o.setDragImage(p,j.x,j.y)}}try{o==null||o.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.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&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:o}=i,f=wf(o);f&&this.beginDragNativeItem(f,o)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:a}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,a.length>0&&this.actions.hover(a,{clientOffset:Es(i)}),a.some(o=>this.monitor.canDropOnTarget(o))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:a}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=Es(i),this.scheduleHover(a),(a||[]).some(o=>this.monitor.canDropOnTarget(o))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var a;i.preventDefault(),(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}else wf(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:a}=this;this.dropTargetIds=[],this.actions.hover(a,{clientOffset:Es(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const a=i.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(i.preventDefault(),a.dragDrop()))},this.options=new s5(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new KE(this.isNodeInDocument)}}const Yb=function(e,n,r){return new l5(e,n,r)},Pa={TASK:"task"},Qb={instagram:k.Instagram,linkedin:k.Linkedin,facebook:k.Facebook,twitter:k.Twitter,youtube:k.Youtube,blog:k.Calendar,other:k.Calendar},yf={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"},wc={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"},qh=["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"],Kh=t=>{const e=t.split("").reduce((n,r)=>n+r.charCodeAt(0),0);return qh[e%qh.length]};function Tl({task:t,view:e="month",mode:n="editorial",onClick:r,style:i}){var p;const[{isDragging:a},s]=_E(()=>({type:Pa.TASK,item:{id:t.id,type:Pa.TASK},collect:h=>({isDragging:!!h.isDragging()})}),[t.id]),o=t.channel?Qb[t.channel]:k.Calendar,f=t.date?new Date(t.date):null,c=t.endDate?new Date(t.endDate):f?R.addHours(f,1):null,d=f?R.format(f,"HH:mm"):null,u=f&&c?`${R.format(f,"HH:mm")} - ${R.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",a?"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?yf[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(he,{variant:"outline",className:w("px-1.5 py-0 text-[10px] h-5 font-normal uppercase tracking-wide",wc[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,g)=>l.jsxs(Wt,{className:"w-5 h-5 border border-white",children:[l.jsx(Wn,{src:h.avatar}),l.jsx($t,{className:"text-[8px]",children:h.name[0]})]},g))})]})]})]}):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",a?"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?yf[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:i,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",a?"opacity-50":"opacity-100",t.color||Kh(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,g)=>l.jsxs(Wt,{className:"w-4 h-4 border border-white",children:[l.jsx(Wn,{src:h.avatar}),l.jsx($t,{className:"text-[8px]",children:h.name[0]})]},g))}),t.status!=="published"&&l.jsx("div",{className:w("w-2 h-2 rounded-full",wc[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",a?"opacity-50":"opacity-100",t.color||Kh(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",a?"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?yf[t.channel]:"text-gray-400")}),l.jsx("span",{className:"truncate font-medium text-sm",children:t.title})]}),l.jsx(he,{variant:"secondary",className:"text-[10px] h-4 px-1 py-0",children:t.status})]})]})}function f5({days:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:i,view:a}){return l.jsx("div",{className:w("grid h-full min-h-[calc(100vh-200px)] bg-gray-50/30",a==="week"?"grid-cols-7 divide-x":"grid-cols-1 border-x"),children:t.map(s=>{const o=e.filter(f=>f.date&&R.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(c5,{day:s,tasks:o,onDropTask:n,onTaskClick:r,onAddClick:i,isToday:R.isToday(s)},s.toISOString())})})}function c5({day:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:i,isToday:a}){const[{isOver:s},o]=iu(()=>({accept:Pa.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",a&&"bg-purple-50/50"),children:[l.jsx("div",{className:"text-xs font-semibold uppercase text-gray-500 mb-1",children:R.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",a?"bg-[#7F26BF] text-white":"text-gray-900 bg-gray-100"),children:R.format(t,"d")})]}),l.jsxs("div",{className:"flex-1 p-2 space-y-3 overflow-y-auto",children:[l.jsxs(B,{variant:"outline",size:"sm",className:"w-full mb-2 justify-center px-1",onClick:()=>i(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(Tl,{task:f,view:"week",mode:"editorial",onClick:()=>r(f)},f.id))]})]})}function d5({days:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:i}){const a=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"})," ",a.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:R.format(R.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&&R.isSameDay(new Date(c.date),s));return l.jsx(u5,{day:s,tasks:f,onDropTask:n,onTaskClick:r,onAddClick:i,isLast:o===t.length-1,HOURS:a},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"})," ",a.map(s=>l.jsx("div",{className:"h-24 border-b border-dashed border-gray-100 w-full"},s))]})]})]})}function u5({day:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:i,isLast:a,HOURS:s}){const[{isOver:o},f]=iu(()=>({accept:Pa.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]",!a&&"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:[R.format(t,"EEE")," ",l.jsx("span",{className:w("ml-1",R.isToday(t)&&"text-blue-600"),children:R.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),i(u)}},c)),e.map(c=>{const d=c.date?new Date(c.date):new Date,u=c.endDate?new Date(c.endDate):R.addHours(d,1),p=R.getHours(d),h=R.getMinutes(d);let g=R.differenceInMinutes(u,d);g<30&&(g=30);const m=p*96+h/60*96+40,b=g/60*96;return l.jsx(Tl,{task:c,view:"week",mode:"execution",onClick:()=>r(c),style:{top:`${m}px`,height:`${b}px`,left:"4px",right:"4px",position:"absolute"}},c.id)})]})}function Gb({days:t,tasks:e,currentDate:n,onDropTask:r,onTaskClick:i,onAddClick:a,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&&R.isSameDay(new Date(c.date),o));return l.jsx(h5,{date:o,tasks:f,isCurrentMonth:R.isSameMonth(o,n),onDropTask:r,onTaskClick:i,onAddClick:a,mode:s},o.toISOString())})})}function h5({date:t,tasks:e,isCurrentMonth:n,onDropTask:r,onTaskClick:i,onAddClick:a,mode:s}){const[{isOver:o},f]=iu(()=>({accept:Pa.TASK,drop:d=>r(d.id,t),collect:d=>({isOver:!!d.isOver()})}),[t,r]),c=R.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:R.format(t,"d")}),l.jsx(B,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>a(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(Tl,{task:d,view:"month",mode:s,onClick:()=>i(d)},d.id))})]})}function Wb({isOpen:t,onClose:e,task:n,onSave:r,isNew:i=!1}){const[a,s]=M.useState(n||{});M.useMemo(()=>{s(n||{})},[n]);const o=()=>{r(a),e()};return l.jsx(Fa,{open:t,onOpenChange:f=>!f&&e(),children:l.jsxs(Ua,{className:"sm:max-w-[600px]",children:[l.jsxs(_a,{children:[l.jsx(Ja,{children:i?"Create New Task":"Edit Task"}),l.jsx(Va,{children:i?"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:a.title||"",onChange:f=>s({...a,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:a.date instanceof Date?R.format(a.date,"yyyy-MM-dd"):typeof a.date=="string"?a.date.split("T")[0]:"",onChange:f=>{const c=f.target.value,d=a.date instanceof Date?a.date:new Date,u=new Date(`${c}T${R.format(d,"HH:mm")}`);s({...a,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:a.date instanceof Date?R.format(a.date,"HH:mm"):"09:00",onChange:f=>{const c=f.target.value,d=a.date instanceof Date?R.format(a.date,"yyyy-MM-dd"):R.format(new Date,"yyyy-MM-dd");s({...a,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:a.channel||"instagram",onChange:f=>s({...a,channel:f.target.value}),children:Object.keys(Qb).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:a.status||"idea",onChange:f=>s({...a,status:f.target.value}),children:Object.keys(wc).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:a.description||"",onChange:f=>s({...a,description:f.target.value}),placeholder:"Details about this post..."})]})]}),l.jsxs(Wo,{children:[l.jsx(B,{variant:"outline",onClick:e,children:"Cancel"}),l.jsx(B,{className:"bg-[#7F26BF] hover:bg-[#6E21A6]",onClick:o,children:"Save Changes"})]})]})})}function $b({tasks:t,onTaskUpdate:e,onTaskCreate:n,defaultView:r="month"}){const[i,a]=M.useState(new Date),[s,o]=M.useState(r),[f,c]=M.useState(!0),[d,u]=M.useState(!1),[p,h]=M.useState(null),[g,m]=M.useState(!1),b=M.useMemo(()=>{let D,H;if(s==="month"){const V=R.startOfMonth(i),Q=R.endOfMonth(V);D=R.startOfWeek(V),H=R.endOfWeek(Q)}else s==="week"?(D=R.startOfWeek(i),H=R.endOfWeek(i)):(D=i,H=i);return R.eachDayOfInterval({start:D,end:H})},[i,s]),x=t.filter(D=>!D.date),y=t.filter(D=>D.date);return{currentDate:i,view:s,setView:o,isSidebarOpen:f,setIsSidebarOpen:c,isModalOpen:d,setIsModalOpen:u,editingTask:p,isNewTask:g,calendarDays:b,unplannedTasks:x,scheduledTasks:y,handlePrev:()=>{a(s==="month"?R.subMonths(i,1):s==="week"?R.addDays(i,-7):R.addDays(i,-1))},handleNext:()=>{a(s==="month"?R.addMonths(i,1):s==="week"?R.addDays(i,7):R.addDays(i,1))},handleToday:()=>a(new Date),handleDropTask:(D,H,V)=>{const Q=t.find(W=>W.id===D);if(Q){let W=new Date(H);if(s==="month"||V==="editorial")if(Q.date){const P=new Date(Q.date);W.setHours(P.getHours(),P.getMinutes())}else W.setHours(9,0);const F={...Q,date:W};e(F)}},handleTaskClick:D=>{h(D),m(!1),u(!0)},handleAddClick:D=>{const H=D||new Date;R.getHours(H)===0&&R.getMinutes(H)===0&&H.setHours(9,0),h({date:H,status:"idea",channel:"instagram"}),m(!0),u(!0)},handleModalSave:D=>{g?n&&n(D):D.id&&e(D),u(!1)}}}function Zb({isOpen:t,setIsOpen:e,tasks:n,onAddClick:r,onTaskClick:i,mode:a}){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(he,{variant:"secondary",className:"bg-gray-100 text-xs",children:n.length})]}),l.jsx(B,{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(B,{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(mr,{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(Tl,{task:s,view:"backlog",mode:a,onClick:()=>i(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(he,{className:"mt-2 h-5 w-5 p-0 flex items-center justify-center rounded-full bg-[#7F26BF] text-[10px]",children:n.length})]})}function qb({title:t,onPrev:e,onNext:n,onToday:r,onAdd:i,view:a,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(B,{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(B,{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(B,{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(Cb,{value:a,onValueChange:o=>s(o),className:"flex-shrink-0",children:l.jsxs(Lb,{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(B,{variant:"default",className:"h-9 px-4 flex-shrink-0",onClick:i,children:[l.jsx(k.Plus,{className:"mr-2 h-4 w-4"})," Create"]})]})]})}function Kb({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",R.isToday(e)?"text-[#7F26BF]":"text-gray-500"),children:R.format(e,"EEE")})},n))})}function p5(t){const e=$b({...t,defaultView:"month"});return l.jsx(Ab,{backend:Yb,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(Zb,{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(qb,{title:e.view==="day"?R.format(e.currentDate,"MMM d, yyyy"):R.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(Kb,{days:e.calendarDays}),l.jsx("div",{className:"flex-1 overflow-hidden flex flex-col relative",children:e.view==="month"?l.jsx(Gb,{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(f5,{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(Wb,{isOpen:e.isModalOpen,onClose:()=>e.setIsModalOpen(!1),task:e.editingTask||{},onSave:e.handleModalSave,isNew:e.isNewTask})]})})}function m5(t){const e=$b({...t,defaultView:"week"});return l.jsx(Ab,{backend:Yb,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(Zb,{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(qb,{title:e.view==="day"?R.format(e.currentDate,"MMM d, yyyy"):R.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(Kb,{days:e.calendarDays}),l.jsx("div",{className:"flex-1 overflow-hidden flex flex-col relative",children:e.view==="month"?l.jsx(Gb,{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(d5,{days:e.calendarDays,tasks:e.scheduledTasks,onDropTask:(n,r)=>e.handleDropTask(n,r,"execution"),onTaskClick:e.handleTaskClick,onAddClick:e.handleAddClick})})]}),e.isModalOpen&&l.jsx(Wb,{isOpen:e.isModalOpen,onClose:()=>e.setIsModalOpen(!1),task:e.editingTask||{},onSave:e.handleModalSave,isNew:e.isNewTask})]})})}const g5=Vs.FormProvider,Xb=I.createContext({}),b5=({...t})=>l.jsx(Xb.Provider,{value:{name:t.name},children:l.jsx(Vs.Controller,{...t})}),ns=()=>{const t=I.useContext(Xb),e=I.useContext(e4),{getFieldState:n}=Vs.useFormContext(),r=Vs.useFormState({name:t.name}),i=n(t.name,r);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:a}=e;return{id:a,name:t.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...i}},e4=I.createContext({});function x5({className:t,...e}){const n=I.useId();return l.jsx(e4.Provider,{value:{id:n},children:l.jsx("div",{"data-slot":"form-item",className:w("grid gap-2",t),...e})})}function v5({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 w5({...t}){const{error:e,formItemId:n,formDescriptionId:r,formMessageId:i}=ns();return l.jsx(Ln.Slot,{"data-slot":"form-control",id:n,"aria-describedby":e?`${r} ${i}`:`${r}`,"aria-invalid":!!e,...t})}function y5({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 M5({className:t,...e}){const{error:n,formMessageId:r}=ns(),i=n?String((n==null?void 0:n.message)??""):e.children;return i?l.jsx("p",{"data-slot":"form-message",id:r,className:w("text-destructive text-sm",t),...e,children:i}):null}const t4={"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"}},Xh=["#7F26BF","#0086E6","#24B347","#F26924","#E91E63","#9C27B0","#00BCD4","#FF9800"];function j5(t,e,n,r,i){const a=R.differenceInDays(r,n),s=R.differenceInDays(t,n),o=R.differenceInDays(e,t)+1,f=s/a*100,c=o/a*100;return{left:f,width:c}}const n4=I.memo(({task:t,timelineStart:e,timelineEnd:n,columnWidth:r,rowHeight:i,onTaskClick:a,onTaskEdit:s})=>{const{left:o,width:f}=j5(t.startDate,t.endDate,e,n),c=t4[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(rt,{children:[l.jsx(it,{asChild:!0,children:l.jsx("div",{className:w("w-4 h-4 rotate-45 cursor-pointer transition-all hover:scale-125",c.barColor),onClick:()=>a==null?void 0:a(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:["📅 ",R.format(t.startDate,"dd/MM/yyyy",{locale:vt})]})]})})]}),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(Ze,{asChild:!0,children:l.jsxs("div",{className:"absolute group/task cursor-pointer",style:{left:`${o}%`,width:`${f}%`,top:"20%",height:"60%"},onClick:()=>a==null?void 0:a(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(Wt,{className:"size-5 border border-white/50",children:l.jsx($t,{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(qe,{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:[R.format(t.startDate,"dd/MM/yyyy",{locale:vt})," -"," ",R.format(t.endDate,"dd/MM/yyyy",{locale:vt})]})]}),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:[R.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(he,{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"]})]})]})})]})});n4.displayName="TaskRow";const C5=["DOM","SEG","TER","QUA","QUI","SEX","SAB"],r4=I.forwardRef(({tasks:t,projects:e=[],onTaskClick:n,onTaskEdit:r,rowHeight:i=48,columnWidth:a=40,groupBy:s="projects"},o)=>{const[f,c]=I.useState(new Date),[d,u]=I.useState(new Set),p=R.startOfMonth(f),h=R.endOfMonth(f),g=R.eachDayOfInterval({start:p,end:h}),m=()=>c(R.subMonths(f,1)),b=()=>c(R.addMonths(f,1)),x=()=>c(new Date),y=I.useMemo(()=>{if(s==="assignees"){const v=new Map;return t.forEach(C=>{var S;const N=((S=C.assignee)==null?void 0:S.name)||"Sem responsável";v.has(N)||v.set(N,[]),v.get(N).push(C)}),Array.from(v.entries()).map(([C,N],S)=>{var T,D,H;return{id:C,name:C,color:(T=N[0])!=null&&T.assignee?Xh[S%Xh.length]:"#999",initials:((H=(D=N[0])==null?void 0:D.assignee)==null?void 0:H.initials)||"??",tasks:N}})}else{const v=new Map;return t.forEach(L=>{const C=L.projectId;v.has(C)||v.set(C,[]),v.get(C).push(L)}),e.length>0?e.map(C=>({...C,tasks:v.get(C.id)||[]})).filter(C=>C.tasks.length>0):[{id:"default",name:"Tarefas",color:"#7F26BF",tasks:t}]}},[t,e,s]),j=v=>{u(L=>{const C=new Set(L);return C.has(v)?C.delete(v):C.add(v),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(B,{variant:"ghost",size:"icon",onClick:m,children:l.jsx(k.ChevronLeft,{className:"h-4 w-4"})}),l.jsx("h2",{className:"text-lg font-bold min-w-[200px] text-center",children:R.format(f,"MMMM yyyy",{locale:vt})}),l.jsx(B,{variant:"ghost",size:"icon",onClick:b,children:l.jsx(k.ChevronRight,{className:"h-4 w-4"})})]}),l.jsx(B,{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:g.map(v=>{const L=R.isWeekend(v);return l.jsx("div",{className:w("flex-shrink-0 border-r text-center bg-background",L&&"bg-muted/20"),style:{width:`${a}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:C5[v.getDay()]}),l.jsx("span",{className:"text-[10px] text-muted-foreground leading-none",children:R.format(v,"d",{locale:vt})})]})},v.toISOString())})})]}),l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 flex pointer-events-none pl-[280px]",children:g.map(v=>{const L=R.isWeekend(v),C=R.isSameDay(v,new Date);return l.jsx("div",{className:w("flex-shrink-0 h-full",L&&"bg-muted/10",C&&"bg-primary/5"),style:{width:`${a}px`}},`grid-${v.toISOString()}`)})}),y.map(v=>{const L=d.has(v.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:`${i}px`},onClick:()=>j(v.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"&&v.initials?l.jsx(Wt,{className:"size-6",children:l.jsx($t,{style:{backgroundColor:v.color},className:"text-white text-[10px]",children:v.initials})}):l.jsx("div",{className:"size-3 rounded-full flex-shrink-0",style:{backgroundColor:v.color||"var(--primary)"}}),l.jsx("span",{className:"font-medium text-sm truncate",children:v.name}),l.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:v.tasks.length})]}),l.jsx("div",{className:"flex-1 border-b",style:{height:`${i}px`}})]}),!L&&v.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:`${i}px`},children:[l.jsx("div",{className:w("size-2 rounded-full flex-shrink-0",C.milestone&&"rotate-45"),style:{backgroundColor:v.color}}),l.jsx("span",{className:"text-sm truncate flex-1",children:C.name}),s==="projects"&&C.assignee&&l.jsx(Wt,{className:"size-6 opacity-0 group-hover:opacity-100 transition-opacity",children:l.jsx($t,{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:`${i}px`},children:l.jsx(n4,{task:C,timelineStart:p,timelineEnd:h,columnWidth:a,rowHeight:i,onTaskClick:n,onTaskEdit:r})})]},C.id))]},v.id)}),(()=>{const v=new Date;if(v>=p&&v<=h){const C=280+R.differenceInDays(v,p)*a+a/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})()]})]})})})]})});r4.displayName="GanttChart";const i4=I.forwardRef(({className:t},e)=>l.jsxs("div",{ref:e,className:w("flex flex-wrap gap-4",t),children:[Object.entries(t4).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"})]})]}));i4.displayName="GanttLegend";function L5({...t}){return l.jsx(Ys.Root,{"data-slot":"hover-card",...t})}function N5({...t}){return l.jsx(Ys.Trigger,{"data-slot":"hover-card-trigger",...t})}function k5({className:t,align:e="center",sideOffset:n=4,...r}){return l.jsx(Ys.Portal,{"data-slot":"hover-card-portal",children:l.jsx(Ys.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 S5({className:t,containerClassName:e,...n}){return l.jsx(rp.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 I5({className:t,...e}){return l.jsx("div",{"data-slot":"input-otp-group",className:w("flex items-center gap-1",t),...e})}function T5({index:t,className:e,...n}){const r=I.useContext(rp.OTPInputContext),{char:i,hasFakeCaret:a,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:[i,a&&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 D5({...t}){return l.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...t,children:l.jsx(k.MinusIcon,{})})}function au({className:t,value:e,...n}){return l.jsx(fu.Root,{"data-slot":"progress",className:w("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",t),...n,children:l.jsx(fu.Indicator,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})})}const E5={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"}},a4=I.forwardRef(({title:t,description:e,coverImage:n,thumbnailImage:r,tags:i=[],assignees:a=[],priority:s,dueDate:o,comments:f,attachments:c,checklist:d,progress:u,status:p,variant:h="default",isDragging:g=!1,onClick:m,onEdit:b,onDelete:x,onDuplicate:y,className:j},v)=>{const L=o&&new Date(o)<new Date,C=s?E5[s]:null,N=T=>{const D=T.getDate().toString().padStart(2,"0"),H=(T.getMonth()+1).toString().padStart(2,"0");return`${D}/${H}`},S=T=>{T.target.closest("button")||T.target.closest("[role='menuitem']")||m==null||m()};return l.jsxs(jr,{ref:v,className:w("group cursor-grab active:cursor-grabbing transition-all duration-200","hover:shadow-lg hover:scale-[1.02]",g&&"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(he,{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(li,{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(fi,{className:w("line-clamp-2",h==="compact"?"text-sm":"text-base"),children:t}),p&&h==="detailed"&&l.jsx(he,{variant:"outline",className:"mt-1 text-xs",children:p})]})]}),e&&h!=="compact"&&l.jsx(sp,{className:"mt-2 line-clamp-2 text-xs",children:e})]}),(b||x||y)&&l.jsxs(Ra,{children:[l.jsx(Ba,{asChild:!0,children:l.jsx(B,{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(Ha,{align:"end",children:[b&&l.jsx(gr,{onClick:b,children:"Editar"}),y&&l.jsx(gr,{onClick:y,children:"Duplicar"}),x&&l.jsx(gr,{onClick:x,className:"text-destructive",children:"Excluir"})]})]})]}),i.length>0&&l.jsxs("div",{className:"flex flex-wrap gap-1 mt-2",children:[i.slice(0,h==="compact"?2:3).map(T=>l.jsx(he,{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)),i.length>(h==="compact"?2:3)&&l.jsxs(he,{variant:"secondary",className:"text-xs",children:["+",i.length-(h==="compact"?2:3)]})]}),s&&!n&&h==="detailed"&&l.jsxs(he,{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(ci,{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(au,{value:u,className:"h-1.5"})]})}),l.jsxs(op,{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})]})]}),a.length>0&&l.jsxs("div",{className:"flex -space-x-2",children:[a.slice(0,3).map(T=>l.jsxs(Wt,{className:"h-6 w-6 border-2 border-background",children:[T.avatar&&l.jsx(Wn,{src:T.avatar,alt:T.name}),l.jsx($t,{className:"text-xs",children:T.initials||T.name.slice(0,2).toUpperCase()})]},T.id)),a.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:["+",a.length-3]})]})]})]})});a4.displayName="KanbanCard";const s4=I.forwardRef(({title:t,primaryContent:e,secondaryContent:n,trendValue:r,trendLabel:i,icon:a=k.Activity,isLoading:s=!1,onClick:o,className:f},c)=>s?l.jsxs(jr,{ref:c,className:f,children:[l.jsx(li,{className:"pb-1",children:l.jsxs(fi,{className:"text-sm flex items-center gap-2",children:[l.jsx(Rn,{className:"h-4 w-4 rounded"}),l.jsx(Rn,{className:"h-4 w-24"})]})}),l.jsxs(ci,{className:"space-y-1 pt-0",children:[l.jsx(Rn,{className:"h-8 w-32"}),l.jsx(Rn,{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(li,{className:"pb-1",children:l.jsxs(fi,{className:"text-sm flex items-center gap-2 text-muted-foreground",children:[l.jsx(a,{className:"h-4 w-4 text-muted-foreground"}),t]})}),l.jsxs(ci,{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(he,{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"}),i]})]}),n&&l.jsx("p",{className:"text-xs text-muted-foreground",children:n})]})]}));s4.displayName="KPICard";function A5(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 z5(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 O5(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 P5({attachments:t,onDownload:e,onRemove:n,onView:r,showDownload:i=!0,showRemove:a=!1,showView:s=!1,maxFilenameLength:o=40,variant:f="compact",emptyMessage:c="Nenhum anexo",isLoading:d=!1,className:u}){const[p,h]=M.useState({}),g=async(m,b,x)=>{if(!x)return;const y=m.chave||m.nomeOriginal;h(j=>({...j,[y]:b}));try{await x(m)}finally{h(j=>({...j,[y]:null}))}};return d?l.jsx("div",{className:w("space-y-2",u),children:[1,2,3].map(m=>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"})]},m))}):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((m,b)=>{const x=m.chave||m.id||`${m.nomeOriginal}-${b}`,y=p[m.chave||m.nomeOriginal],j=y==="download",v=y==="view",L=(()=>{switch(m.status){case"completed":return l.jsx(he,{variant:"outline",className:"bg-green-50 text-green-600 border-green-200 hover:bg-green-50",children:"✓ Enviado"});case"uploading":return l.jsx(he,{variant:"outline",className:"bg-blue-50 text-blue-600 border-blue-200 hover:bg-blue-50",children:"Enviando..."});case"failed":return l.jsx(he,{variant:"outline",className:"bg-red-50 text-red-600 border-red-200 hover:bg-red-50",children:"✗ Erro"});case"retrying":return l.jsx(he,{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",m.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(Tt,{children:l.jsxs(rt,{children:[l.jsx(it,{asChild:!0,children:l.jsx("p",{className:"text-sm font-medium truncate",children:m.nomeOriginal})}),l.jsx(at,{children:l.jsx("p",{children:m.nomeOriginal})})]})}),l.jsxs("div",{className:"flex items-center gap-2 mt-1 text-xs text-muted-foreground",children:[m.tamanhoBytes&&l.jsx("span",{children:A5(m.tamanhoBytes)}),m.tamanhoBytes&&m.dataUpload&&l.jsx("span",{children:"•"}),m.dataUpload&&l.jsx("span",{children:z5(m.dataUpload)})]}),m.status==="uploading"&&typeof m.progress=="number"&&l.jsx(au,{value:m.progress,className:"h-1 mt-2"}),m.status==="failed"&&m.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:m.erro})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[L,m.status==="completed"&&l.jsxs(l.Fragment,{children:[s&&r&&l.jsx(Tt,{children:l.jsxs(rt,{children:[l.jsx(it,{asChild:!0,children:l.jsx(B,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>g(m,"view",r),disabled:v,children:l.jsx(k.Eye,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Visualizar"})]})}),i&&e&&l.jsx(Tt,{children:l.jsxs(rt,{children:[l.jsx(it,{asChild:!0,children:l.jsx(B,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>g(m,"download",e),disabled:j,children:l.jsx(k.Download,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Baixar"})]})}),a&&n&&l.jsx(Tt,{children:l.jsxs(rt,{children:[l.jsx(it,{asChild:!0,children:l.jsx(B,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>n(m),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",m.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(Tt,{children:l.jsxs(rt,{children:[l.jsx(it,{asChild:!0,children:l.jsx("span",{className:"text-sm truncate",children:O5(m.nomeOriginal,o)})}),l.jsx(at,{children:l.jsx("p",{className:"max-w-xs break-all",children:m.nomeOriginal})})]})}),m.status==="uploading"&&typeof m.progress=="number"&&l.jsxs("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:[m.progress,"%"]}),L]}),m.status==="completed"&&l.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[s&&r&&l.jsx(Tt,{children:l.jsxs(rt,{children:[l.jsx(it,{asChild:!0,children:l.jsx(B,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>g(m,"view",r),disabled:v,children:l.jsx(k.Eye,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Visualizar"})]})}),i&&e&&l.jsx(Tt,{children:l.jsxs(rt,{children:[l.jsx(it,{asChild:!0,children:l.jsx(B,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>g(m,"download",e),disabled:j,children:l.jsx(k.Download,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Baixar"})]})}),a&&n&&l.jsx(Tt,{children:l.jsxs(rt,{children:[l.jsx(it,{asChild:!0,children:l.jsx(B,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>n(m),children:l.jsx(k.Trash2,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Remover"})]})})]}),m.status==="failed"&&m.erro&&l.jsx(Tt,{children:l.jsxs(rt,{children:[l.jsx(it,{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:m.erro})})]})})]},x)})})}function R5({className:t,...e}){return l.jsx(Ge.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 B5({...t}){return l.jsx(Ge.Menu,{"data-slot":"menubar-menu",...t})}function H5({...t}){return l.jsx(Ge.Group,{"data-slot":"menubar-group",...t})}function o4({...t}){return l.jsx(Ge.Portal,{"data-slot":"menubar-portal",...t})}function F5({...t}){return l.jsx(Ge.RadioGroup,{"data-slot":"menubar-radio-group",...t})}function U5({className:t,...e}){return l.jsx(Ge.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 _5({className:t,align:e="start",alignOffset:n=-4,sideOffset:r=8,...i}){return l.jsx(o4,{children:l.jsx(Ge.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),...i})})}function J5({className:t,inset:e,variant:n="default",...r}){return l.jsx(Ge.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 V5({className:t,children:e,checked:n,...r}){return l.jsxs(Ge.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(Ge.ItemIndicator,{children:l.jsx(k.CheckIcon,{className:"size-4"})})}),e]})}function Y5({className:t,children:e,...n}){return l.jsxs(Ge.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(Ge.ItemIndicator,{children:l.jsx(k.CircleIcon,{className:"size-2 fill-current"})})}),e]})}function Q5({className:t,inset:e,...n}){return l.jsx(Ge.Label,{"data-slot":"menubar-label","data-inset":e,className:w("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...n})}function G5({className:t,...e}){return l.jsx(Ge.Separator,{"data-slot":"menubar-separator",className:w("bg-border -mx-1 my-1 h-px",t),...e})}function W5({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 $5({...t}){return l.jsx(Ge.Sub,{"data-slot":"menubar-sub",...t})}function Z5({className:t,inset:e,children:n,...r}){return l.jsxs(Ge.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 q5({className:t,...e}){return l.jsx(Ge.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 K5({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(rA,{})]})}function X5({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 eA({className:t,...e}){return l.jsx(Er.Item,{"data-slot":"navigation-menu-item",className:w("relative",t),...e})}const l4=fn.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 tA({className:t,children:e,...n}){return l.jsxs(Er.Trigger,{"data-slot":"navigation-menu-trigger",className:w(l4(),"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 nA({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 rA({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 iA({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 aA({title:t,description:e,breadcrumbs:n,actions:r,secondaryNavCollapsed:i=!1,onSecondaryNavToggle:a,className:s}){return l.jsxs("div",{className:w("border-b bg-background",s),children:[l.jsxs("div",{className:"flex h-14 items-center gap-4 px-6",children:[a&&l.jsx(B,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:a,title:i?"Mostrar menu lateral":"Ocultar menu lateral",children:i?l.jsx(k.PanelLeftOpen,{className:"h-4 w-4"}):l.jsx(k.PanelLeftClose,{className:"h-4 w-4"})}),n&&n.length>0&&l.jsx(Lp,{children:l.jsx(Np,{children:n.map((o,f)=>l.jsxs(I.Fragment,{children:[f>0&&l.jsx(Tp,{}),l.jsx(kp,{children:f===n.length-1?l.jsx(Ip,{children:o.label}):o.href?l.jsx(Sp,{href:o.href,children:o.label}):l.jsx("span",{children:o.label})})]},f))})}),!n&&l.jsx("div",{className:"flex-1",children:l.jsx("h1",{className:"text-lg font-semibold",children:t})}),r&&l.jsx("div",{className:"ml-auto flex items-center gap-2",children:r})]}),e&&l.jsx("div",{className:"border-t px-6 py-3",children:l.jsx("p",{className:"text-sm text-muted-foreground",children:e})})]})}function sA({title:t,icon:e,badge:n,actions:r,secondaryNavCollapsed:i=!1,onSecondaryNavToggle:a,className:s}){return l.jsxs("div",{className:w("flex h-14 items-center gap-3 border-b bg-background px-6",s),children:[a&&l.jsx(B,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:a,title:i?"Mostrar menu lateral":"Ocultar menu lateral",children:i?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}),r&&l.jsx("div",{className:"flex shrink-0 items-center gap-2",children:r})]})}function oA({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 lA({className:t,...e}){return l.jsx("ul",{"data-slot":"pagination-content",className:w("flex flex-row items-center gap-1",t),...e})}function fA({...t}){return l.jsx("li",{"data-slot":"pagination-item",...t})}function su({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(_n({variant:e?"outline":"ghost",size:n}),t),...r})}function cA({className:t,...e}){return l.jsxs(su,{"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 dA({className:t,...e}){return l.jsxs(su,{"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 uA({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 f4=I.forwardRef(({className:t,showToggle:e=!0,...n},r)=>{const[i,a]=I.useState(!1);return l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:i?"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:()=>a(!i),className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",tabIndex:-1,"aria-label":i?"Hide password":"Show password",children:i?l.jsx(k.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(k.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})});f4.displayName="PasswordInput";function hA({className:t,...e}){return l.jsx(jf.Root,{"data-slot":"radio-group",className:w("grid gap-3",t),...e})}function pA({className:t,...e}){return l.jsx(jf.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(jf.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 mA({className:t,...e}){return l.jsx(Cc.PanelGroup,{"data-slot":"resizable-panel-group",className:w("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...e})}function gA({...t}){return l.jsx(Cc.Panel,{"data-slot":"resizable-panel",...t})}function bA({withHandle:t,className:e,...n}){return l.jsx(Cc.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 xA({filters:t=[],onSelectFilter:e,onToggleFavorite:n,onDeleteFilter:r,className:i}){const a=t.filter(o=>o.isFavorite),s=t.filter(o=>!o.isFavorite);return l.jsxs(Ra,{children:[l.jsx(Ba,{asChild:!0,children:l.jsxs(B,{variant:"outline",size:"sm",className:w("gap-2",i),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(Ha,{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:[a.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"}),a.map(o=>l.jsx(ep,{filter:o,onSelect:e,onToggleFavorite:n,onDelete:r},o.id)),s.length>0&&l.jsx(Qs,{})]}),s.length>0&&l.jsxs(l.Fragment,{children:[a.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(ep,{filter:o,onSelect:e,onToggleFavorite:n,onDelete:r},o.id))]})]})})]})}function ep({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:i=>{i.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:i=>{i.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 c4({...t}){return l.jsx(Ae.Root,{"data-slot":"sheet",...t})}function vA({...t}){return l.jsx(Ae.Trigger,{"data-slot":"sheet-trigger",...t})}function wA({...t}){return l.jsx(Ae.Close,{"data-slot":"sheet-close",...t})}function yA({...t}){return l.jsx(Ae.Portal,{"data-slot":"sheet-portal",...t})}const d4=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}));d4.displayName=Ae.Overlay.displayName;function u4({className:t,children:e,side:n="right",...r}){return l.jsxs(yA,{children:[l.jsx(d4,{}),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 h4({className:t,...e}){return l.jsx("div",{"data-slot":"sheet-header",className:w("flex flex-col gap-1.5 p-4",t),...e})}function MA({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 p4({className:t,...e}){return l.jsx(Ae.Title,{"data-slot":"sheet-title",className:w("text-foreground font-semibold",t),...e})}function m4({className:t,...e}){return l.jsx(Ae.Description,{"data-slot":"sheet-description",className:w("text-muted-foreground text-sm",t),...e})}const Mf=768;function g4(){const[t,e]=I.useState(void 0);return I.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Mf-1}px)`),r=()=>{e(window.innerWidth<Mf)};return n.addEventListener("change",r),e(window.innerWidth<Mf),()=>n.removeEventListener("change",r)},[]),!!t}const jA="sidebar_state",CA=3600*24*7,LA="16rem",NA="18rem",kA="3rem",SA="b",b4=I.createContext(null);function rs(){const t=I.useContext(b4);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function IA({defaultOpen:t=!0,open:e,onOpenChange:n,className:r,style:i,children:a,...s}){const o=g4(),[f,c]=I.useState(!1),[d,u]=I.useState(t),p=e??d,h=I.useCallback(x=>{const y=typeof x=="function"?x(p):x;n?n(y):u(y),document.cookie=`${jA}=${y}; path=/; max-age=${CA}`},[n,p]),g=I.useCallback(()=>o?c(x=>!x):h(x=>!x),[o,h,c]);I.useEffect(()=>{const x=y=>{y.key===SA&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),g())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[g]);const m=p?"expanded":"collapsed",b=I.useMemo(()=>({state:m,open:p,setOpen:h,isMobile:o,openMobile:f,setOpenMobile:c,toggleSidebar:g}),[m,p,h,o,f,c,g]);return l.jsx(b4.Provider,{value:b,children:l.jsx(Tt,{delayDuration:0,children:l.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":LA,"--sidebar-width-icon":kA,...i},className:w("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...s,children:a})})})}function TA({side:t="left",variant:e="sidebar",collapsible:n="offcanvas",className:r,children:i,...a}){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),...a,children:i}):s?l.jsx(c4,{open:f,onOpenChange:c,...a,children:l.jsxs(u4,{"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":NA},side:t,children:[l.jsxs(h4,{className:"sr-only",children:[l.jsx(p4,{children:"Sidebar"}),l.jsx(m4,{children:"Displays the mobile sidebar."})]}),l.jsx("div",{className:"flex h-full w-full flex-col",children:i})]})}):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),...a,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:i})})]})}function DA({className:t,onClick:e,...n}){const{toggleSidebar:r}=rs();return l.jsxs(B,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:w("size-7",t),onClick:i=>{e==null||e(i),r()},...n,children:[l.jsx(k.PanelLeftIcon,{}),l.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function EA({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 AA({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 zA({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 OA({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 PA({className:t,...e}){return l.jsx(Bn,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:w("bg-sidebar-border mx-2 w-auto",t),...e})}function RA({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 BA({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 HA({className:t,asChild:e=!1,...n}){const r=e?Ln.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 FA({className:t,asChild:e=!1,...n}){const r=e?Ln.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 UA({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 _A({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 JA({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 VA=fn.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 YA({asChild:t=!1,isActive:e=!1,variant:n="default",size:r="default",tooltip:i,className:a,...s}){const o=t?Ln.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(VA({variant:n,size:r}),a),...s});return i?(typeof i=="string"&&(i={children:i}),l.jsxs(rt,{children:[l.jsx(it,{asChild:!0,children:d}),l.jsx(at,{side:"right",align:"center",hidden:c!=="collapsed"||f,...i})]})):d}function QA({className:t,asChild:e=!1,showOnHover:n=!1,...r}){const i=e?Ln.Slot:"button";return l.jsx(i,{"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 GA({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 WA({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(Rn,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),l.jsx(Rn,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})}function $A({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 ZA({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 qA({asChild:t=!1,size:e="md",isActive:n=!1,className:r,...i}){const a=t?Ln.Slot:"a";return l.jsx(a,{"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),...i})}function x4({className:t,defaultValue:e,value:n,min:r=0,max:i=100,...a}){const s=I.useMemo(()=>Array.isArray(n)?n:Array.isArray(e)?e:[r,i],[n,e,r,i]);return l.jsxs(ps.Root,{"data-slot":"slider",defaultValue:e,value:n,min:r,max:i,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),...a,children:[l.jsx(ps.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(ps.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(ps.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 v4=fn.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"}}),KA=()=>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"})]}),XA=()=>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"})}),e8=()=>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"})}),t8=()=>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"})]}),w4=I.forwardRef(({className:t,variant:e,size:n,provider:r,children:i,...a},s)=>{const o=e||r,f=()=>{switch(r){case"google":return l.jsx(KA,{});case"github":return l.jsx(k.Github,{className:"h-5 w-5"});case"facebook":return l.jsx(e8,{});case"apple":return l.jsx(XA,{});case"microsoft":return l.jsx(t8,{});default:return null}},c=()=>`Continue with ${{google:"Google",github:"GitHub",facebook:"Facebook",apple:"Apple",microsoft:"Microsoft"}[r]}`;return l.jsxs("button",{className:w(v4({variant:o,size:n,className:t})),ref:s,...a,children:[f(),l.jsx("span",{children:i||c()})]})});w4.displayName="SocialButton";function y4({className:t,...e}){return l.jsx(cu.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(cu.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 n8=[{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 r8({task:t,open:e,onOpenChange:n,onSave:r,availableTasks:i=[],availableAssignees:a=[]}){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=(y,j)=>{o(v=>v?{...v,[y]:j}:null)},g=y=>{o(j=>{if(!j)return null;const v=j.dependencies||[],L=v.includes(y)?v.filter(C=>C!==y):[...v,y];return{...j,dependencies:L}})},m=i.filter(y=>y.id!==s.id),b=s.name.trim()!==""&&s.startDate<=s.endDate;return l.jsx(Fa,{open:e,onOpenChange:n,children:l.jsxs(Ua,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[l.jsxs(_a,{children:[l.jsx(Ja,{children:"Editar Tarefa"}),l.jsx(Va,{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(Gt,{id:"task-name",value:s.name,onChange:y=>h("name",y.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(Zd,{id:"task-description",value:s.description||"",onChange:y=>h("description",y.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(Ze,{asChild:!0,children:l.jsxs(B,{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?R.format(s.startDate,"dd/MM/yyyy",{locale:vt}):"Selecionar data"]})}),l.jsx(qe,{className:"w-auto p-0",align:"start",children:l.jsx(Calendar,{mode:"single",selected:s.startDate,onSelect:y=>{y&&(h("startDate",y),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(Ze,{asChild:!0,children:l.jsxs(B,{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?R.format(s.endDate,"dd/MM/yyyy",{locale:vt}):"Selecionar data"]})}),l.jsx(qe,{className:"w-auto p-0",align:"start",children:l.jsx(Calendar,{mode:"single",selected:s.endDate,onSelect:y=>{y&&(h("endDate",y),u(!1))},disabled:y=>s.startDate?y<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(Xt,{value:s.status,onValueChange:y=>h("status",y),children:[l.jsx(tn,{id:"task-status",children:l.jsx(en,{})}),l.jsx(nn,{children:n8.map(y=>l.jsx(Dt,{value:y.value,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:w("size-2 rounded-full",y.color)}),y.label]})},y.value))})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{htmlFor:"task-assignee",children:"Responsável"}),l.jsxs(Xt,{value:((x=s.assignee)==null?void 0:x.name)||"",onValueChange:y=>{const j=a.find(v=>v.name===y);h("assignee",j||void 0)},children:[l.jsx(tn,{id:"task-assignee",children:l.jsx(en,{placeholder:"Selecionar responsável"})}),l.jsx(nn,{children:a.map(y=>l.jsx(Dt,{value:y.name,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(k.User,{className:"size-4"}),y.name]})},y.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(x4,{value:[s.progress],onValueChange:y=>h("progress",y[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(y4,{id:"milestone-toggle",checked:s.milestone||!1,onCheckedChange:y=>h("milestone",y)})]}),m.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:m.map(y=>{var v;const j=((v=s.dependencies)==null?void 0:v.includes(y.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:()=>g(y.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:y.name}),y.assignee&&l.jsx(he,{variant:"outline",className:"text-xs",children:y.assignee.name})]},y.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(Wo,{children:[l.jsx(B,{variant:"outline",onClick:()=>n(!1),children:"Cancelar"}),l.jsx(B,{onClick:p,disabled:!b,children:"Salvar alterações"})]})]})})}const i8=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"})}},a8=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"}},s8=({event:t,isLast:e,onDetailsOpen:n})=>{var o,f,c,d,u,p,h;const[r,i]=I.useState(!1),a=!!((o=t.metadata)!=null&&o.before||(f=t.metadata)!=null&&f.after||(c=t.metadata)!=null&&c.details),s=g=>{i(g),g&&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",a8(t.action)),children:i8(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:R.format(t.timestamp,"PPpp",{locale:vt}),children:R.formatDistanceToNow(t.timestamp,{addSuffix:!0,locale:vt})})]}),a&&l.jsxs(zp,{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(he,{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(Op,{asChild:!0,children:l.jsxs(B,{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(Pp,{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})]})})]})]})})]})},o8=({events:t,className:e,onDetailsOpen:n})=>l.jsx("div",{className:w("flex flex-col",e),children:t.map((r,i)=>l.jsx(s8,{event:r,isLast:i===t.length-1,onDetailsOpen:n},r.id))});function l8(t){const{theme:e="system"}=mx.useTheme();return l.jsx(ip.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-medium text-sm",description:"text-sm mt-1",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 M4=I.createContext({size:"default",variant:"default"});function f8({className:t,variant:e,size:n,children:r,...i}){return l.jsx(ap.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),...i,children:l.jsx(M4.Provider,{value:{variant:e,size:n},children:r})})}function c8({className:t,children:e,variant:n,size:r,...i}){const a=I.useContext(M4);return l.jsx(ap.Item,{"data-slot":"toggle-group-item","data-variant":a.variant||n,"data-size":a.size||r,className:w(qd({variant:a.variant||n,size:a.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),...i,children:e})}const j4=I.createContext(void 0);function C4(){const t=I.useContext(j4);if(!t)throw new Error("UnderlineTabs components must be used within UnderlineTabs");return t}function d8({defaultValue:t,value:e,onValueChange:n,children:r,className:i}){const[a,s]=I.useState(t||""),o=e!==void 0?e:a,f=c=>{e===void 0&&s(c),n==null||n(c)};return l.jsx(j4.Provider,{value:{value:o,onValueChange:f},children:l.jsx("div",{className:w("w-full",i),role:"tablist",children:r})})}function u8({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 h8({value:t,children:e,className:n,disabled:r=!1}){const{value:i,onValueChange:a}=C4(),s=i===t;return l.jsx("button",{type:"button",role:"tab","aria-selected":s,"aria-disabled":r,disabled:r,onClick:()=>!r&&a(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 p8({value:t,children:e,className:n}){const{value:r}=C4();return r!==t?null:l.jsx("div",{role:"tabpanel","aria-labelledby":t,className:w("mt-4",n),children:e})}function m8(t,e){const n=e*1024*1024;return t.size>n?`Arquivo muito grande. Máximo: ${e}MB`:null}function g8(t,e){if(!e)return null;const n=e.split(",").map(s=>s.trim().toLowerCase()),r=t.name.toLowerCase(),i=t.type.toLowerCase();return n.some(s=>{if(s.includes("*")){const[o]=s.split("/");return i.startsWith(o+"/")}return s.startsWith(".")?r.endsWith(s):i===s})?null:"Tipo de arquivo não suportado"}function b8({onFilesSelected:t,accept:e,multiple:n=!0,maxFiles:r=10,maxSizeMB:i=50,disabled:a=!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),g=M.useRef(null),m=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){m(`Máximo de ${r} arquivo(s) permitido(s)`);return}const T=[],D=[];for(const H of S){const V=m8(H,i);if(V){D.push(`${H.name}: ${V}`);continue}const Q=g8(H,e);if(Q){D.push(`${H.name}: ${Q}`);continue}T.push(H)}D.length>0&&m(D.join(`
|
|
223
223
|
`)),T.length>0&&t(T),g.current&&(g.current.value="")},[r,i,e,t,m]),x=M.useCallback(()=>{var N;a||s||(N=g.current)==null||N.click()},[a,s]),y=M.useCallback(N=>{b(N.target.files)},[b]),j=M.useCallback(N=>{N.preventDefault(),N.stopPropagation(),!a&&!s&&h(!0)},[a,s]),v=M.useCallback(N=>{N.preventDefault(),N.stopPropagation(),h(!1)},[]),L=M.useCallback(N=>{N.preventDefault(),N.stopPropagation(),h(!1),!(a||s)&&b(N.dataTransfer.files)},[a,s,b]),C=f||(()=>{const N=[];if(e){const S=e.split(",").map(T=>T.trim().replace(".","").toUpperCase()).join(", ");N.push(S)}return i&&N.push(`máx ${i}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]",(a||s)&&"opacity-50 cursor-not-allowed hover:border-dashed hover:bg-transparent",s&&"animate-pulse",d),onClick:x,onDragOver:j,onDragLeave:v,onDrop:L,children:[l.jsx("input",{ref:g,type:"file",multiple:n,accept:e,className:"hidden",onChange:y,disabled:a||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}),!a&&!s&&n&&r>1&&l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Você pode selecionar até ",r," arquivo(s)"]})]}),a&&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 Di={sm:"w-24 h-24",md:"w-32 h-32",lg:"w-48 h-48"};function L4({className:t,size:e="md",primaryColor:n="var(--purple-500)",secondaryColor:r="var(--purple-100)"}){return l.jsxs("svg",{className:w(Di[e],t),viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("circle",{cx:"60",cy:"60",r:"55",fill:r,opacity:"0.5"}),l.jsx("rect",{x:"30",y:"45",width:"60",height:"40",rx:"4",fill:n,opacity:"0.2"}),l.jsx("rect",{x:"30",y:"45",width:"60",height:"15",rx:"4",fill:n}),l.jsx("path",{d:"M35 60 L60 75 L85 60",stroke:n,strokeWidth:"3",fill:"none"}),l.jsx("circle",{cx:"25",cy:"35",r:"3",fill:n,opacity:"0.6"}),l.jsx("circle",{cx:"95",cy:"40",r:"2",fill:n,opacity:"0.4"}),l.jsx("circle",{cx:"100",cy:"70",r:"2.5",fill:n,opacity:"0.5"})]})}function N4({className:t,size:e="md",primaryColor:n="var(--purple-500)",secondaryColor:r="var(--purple-100)"}){return l.jsxs("svg",{className:w(Di[e],t),viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("circle",{cx:"60",cy:"60",r:"55",fill:r,opacity:"0.5"}),l.jsx("circle",{cx:"52",cy:"52",r:"22",stroke:n,strokeWidth:"4",fill:"none"}),l.jsx("line",{x1:"68",y1:"68",x2:"88",y2:"88",stroke:n,strokeWidth:"4",strokeLinecap:"round"}),l.jsx("line",{x1:"45",y1:"45",x2:"59",y2:"59",stroke:n,strokeWidth:"3",strokeLinecap:"round",opacity:"0.6"}),l.jsx("line",{x1:"59",y1:"45",x2:"45",y2:"59",stroke:n,strokeWidth:"3",strokeLinecap:"round",opacity:"0.6"})]})}function k4({className:t,size:e="md",primaryColor:n="var(--purple-500)",secondaryColor:r="var(--purple-100)"}){return l.jsxs("svg",{className:w(Di[e],t),viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("circle",{cx:"60",cy:"60",r:"55",fill:r,opacity:"0.5"}),l.jsx("path",{d:"M25 40 L25 85 L95 85 L95 45 L55 45 L50 40 Z",fill:n,opacity:"0.3"}),l.jsx("path",{d:"M25 50 L25 85 L95 85 L95 50 Z",fill:n,opacity:"0.6"}),l.jsx("line",{x1:"60",y1:"60",x2:"60",y2:"76",stroke:"white",strokeWidth:"3",strokeLinecap:"round"}),l.jsx("line",{x1:"52",y1:"68",x2:"68",y2:"68",stroke:"white",strokeWidth:"3",strokeLinecap:"round"})]})}function S4({className:t,size:e="md",primaryColor:n="var(--purple-500)",secondaryColor:r="var(--purple-100)"}){return l.jsxs("svg",{className:w(Di[e],t),viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("circle",{cx:"60",cy:"60",r:"55",fill:r,opacity:"0.5"}),l.jsx("rect",{x:"28",y:"35",width:"64",height:"55",rx:"4",fill:n,opacity:"0.2"}),l.jsx("rect",{x:"28",y:"35",width:"64",height:"15",rx:"4",fill:n}),l.jsx("rect",{x:"40",y:"30",width:"4",height:"12",rx:"2",fill:n}),l.jsx("rect",{x:"76",y:"30",width:"4",height:"12",rx:"2",fill:n}),l.jsx("circle",{cx:"45",cy:"62",r:"3",fill:n,opacity:"0.3"}),l.jsx("circle",{cx:"60",cy:"62",r:"3",fill:n,opacity:"0.3"}),l.jsx("circle",{cx:"75",cy:"62",r:"3",fill:n,opacity:"0.3"}),l.jsx("circle",{cx:"45",cy:"77",r:"3",fill:n,opacity:"0.3"}),l.jsx("circle",{cx:"60",cy:"77",r:"3",fill:n,opacity:"0.3"}),l.jsx("circle",{cx:"75",cy:"77",r:"3",fill:n,opacity:"0.3"})]})}function I4({className:t,size:e="md",primaryColor:n="var(--red-500)",secondaryColor:r="var(--red-100)"}){return l.jsxs("svg",{className:w(Di[e],t),viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("circle",{cx:"60",cy:"60",r:"55",fill:r,opacity:"0.5"}),l.jsx("path",{d:"M60 30 L90 80 L30 80 Z",fill:n,opacity:"0.2",stroke:n,strokeWidth:"3"}),l.jsx("line",{x1:"60",y1:"48",x2:"60",y2:"62",stroke:n,strokeWidth:"4",strokeLinecap:"round"}),l.jsx("circle",{cx:"60",cy:"70",r:"2.5",fill:n})]})}function T4({className:t,size:e="md",primaryColor:n="var(--green-500)",secondaryColor:r="var(--green-100)"}){return l.jsxs("svg",{className:w(Di[e],t),viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("circle",{cx:"60",cy:"60",r:"55",fill:r,opacity:"0.5"}),l.jsx("circle",{cx:"60",cy:"60",r:"30",fill:n,opacity:"0.2",stroke:n,strokeWidth:"3"}),l.jsx("path",{d:"M45 60 L55 70 L75 50",stroke:n,strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]})}const x8={EmptyInbox:L4,EmptySearch:N4,EmptyProjects:k4,EmptyCalendar:S4,ErrorState:I4,SuccessState:T4};function v8({data:t,showPreview:e=!1,logo:n}){const r=a=>new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(a),i=a=>new Date(a).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(Gd,{logo:n,companyName:t.agency.name,contactInfo:{email:t.agency.email,phone:t.agency.phone},documentType:"Proposta Comercial",documentNumber:t.proposalNumber,issueDate:i(t.issueDate)}),l.jsx(mt,{children:l.jsx(pr,{columns:2,items:[{label:"Nº da Proposta",value:t.proposalNumber,highlight:!0},{label:"Validade",value:i(t.validUntil)},{label:"Cliente",value:t.client.name,highlight:!0},...t.client.contact?[{label:"Contato",value:t.client.contact}]:[]]})}),l.jsxs(mt,{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(mt,{title:"Objetivos",children:l.jsx("ul",{className:"list-disc list-inside space-y-2",children:t.objectives.map((a,s)=>l.jsx("li",{className:"text-sm text-gray-700",children:a},s))})}),l.jsxs(mt,{title:"Escopo e Investimento",children:[l.jsx(Jo,{columns:[{header:"Item",key:"name",width:"35%"},{header:"Descrição",key:"description",width:"30%"},{header:"Qtd.",key:"quantity",align:"center",width:"10%",render:a=>a||"-"},{header:"Valor Unit.",key:"unitPrice",align:"right",width:"12.5%",render:a=>a?r(a):"-"},{header:"Valor Total",key:"totalPrice",align:"right",width:"12.5%",render:a=>r(a)}],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(mt,{title:"Condições Comerciais",children:l.jsx(pr,{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(mt,{title:"Observações",children:l.jsx("p",{className:"text-sm text-gray-700 leading-relaxed",children:t.notes})}),l.jsx(Wd,{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(Qd,{pageNumber:1,totalPages:1,footerText:`Proposta válida até ${i(t.validUntil)}`})]})}Object.defineProperty(exports,"toast",{enumerable:!0,get:()=>ip.toast});exports.Accordion=yx;exports.AccordionContent=Cx;exports.AccordionItem=Mx;exports.AccordionTrigger=jx;exports.AdvancedDataTable=xp;exports.Alert=vv;exports.AlertDescription=yv;exports.AlertDialog=Mv;exports.AlertDialogAction=Tv;exports.AlertDialogCancel=Dv;exports.AlertDialogContent=Lv;exports.AlertDialogDescription=Iv;exports.AlertDialogFooter=kv;exports.AlertDialogHeader=Nv;exports.AlertDialogTitle=Sv;exports.AlertDialogTrigger=jv;exports.AlertTitle=wv;exports.AppLayout=zv;exports.AppLayoutPrimaryNav=Vv;exports.AppLayoutSecondaryNav=Yv;exports.AppLayoutUserMenu=jp;exports.AspectRatio=Qv;exports.AuthLayout=Cp;exports.Avatar=Wt;exports.AvatarFallback=$t;exports.AvatarImage=Wn;exports.Badge=he;exports.BrandLogo=di;exports.Breadcrumb=Lp;exports.BreadcrumbEllipsis=Gv;exports.BreadcrumbItem=kp;exports.BreadcrumbLink=Sp;exports.BreadcrumbList=Np;exports.BreadcrumbPage=Ip;exports.BreadcrumbSeparator=Tp;exports.Button=B;exports.Calendar=Qo;exports.Card=jr;exports.CardAction=Lx;exports.CardContent=ci;exports.CardDescription=sp;exports.CardFooter=op;exports.CardHeader=li;exports.CardTitle=fi;exports.Carousel=Wv;exports.CarouselContent=$v;exports.CarouselItem=Zv;exports.CarouselNext=Kv;exports.CarouselPrevious=qv;exports.ChartContainer=ew;exports.ChartLegend=iw;exports.ChartLegendContent=aw;exports.ChartTooltip=nw;exports.ChartTooltipContent=rw;exports.Checkbox=mp;exports.Collapsible=zp;exports.CollapsibleContent=Pp;exports.CollapsibleTrigger=Op;exports.ColorPicker=sw;exports.Command=Bp;exports.CommandDialog=cw;exports.CommandEmpty=hw;exports.CommandGroup=pw;exports.CommandInput=dw;exports.CommandItem=gw;exports.CommandList=uw;exports.CommandSeparator=mw;exports.CommandShortcut=bw;exports.CommentSystem=hT;exports.CompactPageHeader=sA;exports.ContextMenu=pT;exports.ContextMenuCheckboxItem=CT;exports.ContextMenuContent=MT;exports.ContextMenuGroup=gT;exports.ContextMenuItem=jT;exports.ContextMenuLabel=NT;exports.ContextMenuPortal=bT;exports.ContextMenuRadioGroup=vT;exports.ContextMenuRadioItem=LT;exports.ContextMenuSeparator=kT;exports.ContextMenuShortcut=ST;exports.ContextMenuSub=xT;exports.ContextMenuSubContent=yT;exports.ContextMenuSubTrigger=wT;exports.ContextMenuTrigger=mT;exports.ContractPrint=DT;exports.ContractPrintPreview=ub;exports.ContractTemplate=$d;exports.CurrencyInput=pb;exports.DataTable=bp;exports.DatePicker=Tc;exports.DateRangePicker=mb;exports.Dialog=Fa;exports.DialogClose=fw;exports.DialogContent=Ua;exports.DialogDescription=Va;exports.DialogFooter=Wo;exports.DialogHeader=_a;exports.DialogTitle=Ja;exports.DialogTrigger=ow;exports.DocumentEditor=VT;exports.Drawer=YT;exports.DrawerClose=xb;exports.DrawerContent=wb;exports.DrawerDescription=Mb;exports.DrawerFooter=WT;exports.DrawerHeader=GT;exports.DrawerTitle=yb;exports.DrawerTrigger=bb;exports.DropdownMenu=Ra;exports.DropdownMenuCheckboxItem=Pv;exports.DropdownMenuContent=Ha;exports.DropdownMenuGroup=yp;exports.DropdownMenuItem=gr;exports.DropdownMenuLabel=Mp;exports.DropdownMenuPortal=Ov;exports.DropdownMenuRadioGroup=Rv;exports.DropdownMenuRadioItem=Bv;exports.DropdownMenuSeparator=Qs;exports.DropdownMenuShortcut=Hv;exports.DropdownMenuSub=Fv;exports.DropdownMenuSubContent=_v;exports.DropdownMenuSubTrigger=Uv;exports.DropdownMenuTrigger=Ba;exports.EditableBadge=jb;exports.EditorialCalendar=p5;exports.EmptyCalendarIllustration=S4;exports.EmptyInboxIllustration=L4;exports.EmptyProjectsIllustration=k4;exports.EmptySearchIllustration=N4;exports.ErrorStateIllustration=I4;exports.FileAttachmentList=P5;exports.FileUploadZone=b8;exports.FilterBar=pp;exports.FilterBuilder=gp;exports.FilterChip=hp;exports.Form=g5;exports.FormControl=w5;exports.FormDescription=y5;exports.FormField=b5;exports.FormItem=x5;exports.FormLabel=v5;exports.FormMessage=M5;exports.GanttChart=r4;exports.GanttLegend=i4;exports.HoverCard=L5;exports.HoverCardContent=k5;exports.HoverCardTrigger=N5;exports.Illustrations=x8;exports.ImageWithFallback=cb;exports.Input=Gt;exports.InputGroup=hb;exports.InputGroupAddon=pc;exports.InputGroupButton=zT;exports.InputGroupInput=PT;exports.InputGroupText=OT;exports.InputGroupTextarea=RT;exports.InputOTP=S5;exports.InputOTPGroup=I5;exports.InputOTPSeparator=D5;exports.InputOTPSlot=T5;exports.KPICard=s4;exports.KanbanCard=a4;exports.Label=Ue;exports.MentionList=Nd;exports.Menubar=R5;exports.MenubarCheckboxItem=V5;exports.MenubarContent=_5;exports.MenubarGroup=H5;exports.MenubarItem=J5;exports.MenubarLabel=Q5;exports.MenubarMenu=B5;exports.MenubarPortal=o4;exports.MenubarRadioGroup=F5;exports.MenubarRadioItem=Y5;exports.MenubarSeparator=G5;exports.MenubarShortcut=W5;exports.MenubarSub=$5;exports.MenubarSubContent=q5;exports.MenubarSubTrigger=Z5;exports.MenubarTrigger=U5;exports.NavigationMenu=K5;exports.NavigationMenuContent=nA;exports.NavigationMenuItem=eA;exports.NavigationMenuLink=iA;exports.NavigationMenuList=X5;exports.NavigationMenuTrigger=tA;exports.NumberInput=Vo;exports.PageHeader=aA;exports.Pagination=oA;exports.PaginationContent=lA;exports.PaginationEllipsis=uA;exports.PaginationItem=fA;exports.PaginationLink=su;exports.PaginationNext=dA;exports.PaginationPrevious=cA;exports.PasswordInput=f4;exports.Popover=st;exports.PopoverContent=qe;exports.PopoverTrigger=Ze;exports.PrintFooter=Qd;exports.PrintHeader=Gd;exports.PrintInfoGrid=pr;exports.PrintSection=mt;exports.PrintSignature=Wd;exports.PrintTable=Jo;exports.Progress=au;exports.ProposalTemplate=v8;exports.RadioGroup=hA;exports.RadioGroupItem=pA;exports.ResizableHandle=bA;exports.ResizablePanel=gA;exports.ResizablePanelGroup=mA;exports.SavedFilters=xA;exports.ScrollArea=mr;exports.ScrollBar=wp;exports.Select=Xt;exports.SelectContent=nn;exports.SelectGroup=Nx;exports.SelectItem=Dt;exports.SelectLabel=kx;exports.SelectSeparator=Sx;exports.SelectTrigger=tn;exports.SelectValue=en;exports.Separator=Bn;exports.Sheet=c4;exports.SheetClose=wA;exports.SheetContent=u4;exports.SheetDescription=m4;exports.SheetFooter=MA;exports.SheetHeader=h4;exports.SheetTitle=p4;exports.SheetTrigger=vA;exports.Sidebar=TA;exports.SidebarContent=RA;exports.SidebarFooter=OA;exports.SidebarGroup=BA;exports.SidebarGroupAction=FA;exports.SidebarGroupContent=UA;exports.SidebarGroupLabel=HA;exports.SidebarHeader=zA;exports.SidebarInset=AA;exports.SidebarMenu=_A;exports.SidebarMenuAction=QA;exports.SidebarMenuBadge=GA;exports.SidebarMenuButton=YA;exports.SidebarMenuItem=JA;exports.SidebarMenuSkeleton=WA;exports.SidebarMenuSub=$A;exports.SidebarMenuSubButton=qA;exports.SidebarMenuSubItem=ZA;exports.SidebarProvider=IA;exports.SidebarRail=EA;exports.SidebarSeparator=PA;exports.SidebarTrigger=DA;exports.Skeleton=Rn;exports.Slider=x4;exports.SocialButton=w4;exports.SuccessStateIllustration=T4;exports.Switch=y4;exports.Table=Lc;exports.TableBody=kc;exports.TableCaption=fp;exports.TableCell=Zi;exports.TableFooter=lp;exports.TableHead=Sc;exports.TableHeader=Nc;exports.TablePagination=Ic;exports.TableRow=ti;exports.Tabs=Cb;exports.TabsContent=ZT;exports.TabsList=Lb;exports.TabsTrigger=_s;exports.TaskCalendar=m5;exports.TaskEditDialog=r8;exports.Textarea=Zd;exports.TimePicker=pa;exports.Timeline=o8;exports.Toaster=l8;exports.Toggle=gb;exports.ToggleGroup=f8;exports.ToggleGroupItem=c8;exports.Tooltip=rt;exports.TooltipContent=at;exports.TooltipProvider=Tt;exports.TooltipTrigger=it;exports.UnderlineTabs=d8;exports.UnderlineTabsContent=p8;exports.UnderlineTabsList=u8;exports.UnderlineTabsTrigger=h8;exports.badgeVariants=up;exports.buttonVariants=_n;exports.calculatePaginationMetadata=dp;exports.cn=w;exports.dadosContratoExemplo=TT;exports.getPageNumbers=cp;exports.navigationMenuTriggerStyle=l4;exports.socialButtonVariants=v4;exports.toggleVariants=qd;exports.useFormField=ns;exports.useIsMobile=g4;exports.usePrintContract=db;exports.useSidebar=rs;
|
|
224
224
|
//# sourceMappingURL=index.cjs.map
|