1var nt=Object.defineProperty,ct=Object.defineProperties;var lt=Object.getOwnPropertyDescriptors;var Re=Object.getOwnPropertySymbols;var rt=Object.prototype.hasOwnProperty,dt=Object.prototype.propertyIsEnumerable;var qe=(t,n,p)=>n in t?nt(t,n,{enumerable:!0,configurable:!0,writable:!0,value:p}):t[n]=p,d=(t,n)=>{for(var p in n||(n={}))rt.call(n,p)&&qe(t,p,n[p]);if(Re)for(var p of Re(n))dt.call(n,p)&&qe(t,p,n[p]);return t},m=(t,n)=>ct(t,lt(n));var Z=(t,n,p)=>new Promise((y,f)=>{var _=N=>{try{E(p.next(N))}catch(I){f(I)}},U=N=>{try{E(p.throw(N))}catch(I){f(I)}},E=N=>N.done?y(N.value):Promise.resolve(N.value).then(_,U);E((p=p.apply(t,n)).next())});import{r as l,j as e}from"./vendor-BlJ90GWG.js";import{a7 as fe,N as Pe,aE as Ve,c4 as Xe,ac as mt,dB as Te,aC as Be,Z as Le,L as Ce,x as _e,S as x,C as Qe,m as pt,u as ut,o as ht,l as Oe,i as xt,a6 as gt,P as ft,T as _t,_ as Ct,B as bt,z as vt,ak as jt,V as kt,al as wt}from"./index-BIHwndtW.js";import{A as Dt}from"./ActionsDropdown-CEk78LeB.js";import{B as Nt}from"./BackButton-BZFMqPGI.js";import{H as It}from"./HelpButton-BV0JJIfF.js";import{S as St}from"./SearchInput-DSeNCzLI.js";import{T as Ye}from"./Textarea-CvhZjv8C.js";import{F as At}from"./FileUploader-B_sVyQUJ.js";import{P as yt}from"./ProjectAutocomplete-GLsEmt6r.js";import{S as Et}from"./SearchableSelect-DIkZVRqk.js";import{a as Tt,M as Bt}from"./uploadLimits-C2_ye40O.js";import{u as $t}from"./useDebounce-DdJ7lloX.js";import{c as ee}from"./checklistService-CZgwRNvc.js";import{o as Fe,s as z,i as $e,u as be,n as ie,q as zt,e as Pt,t as Lt}from"./schemas-Zv2IiRs2.js";import{d as Ge,e as Ft}from"./download-BF9SZSEK.js";import"./pdf-Ba4Lif-1.js";import"./charts-i6LaAsIH.js";import"./tslib.es6-e8gerPB4.js";import"./projectService-Dp3HZKHv.js";import"./validators-DRPEAPaw.js";(function(){try{var t=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{};t.SENTRY_RELEASE={id:"0d78e8d78eda4804299eff0767f9df5613e65c75"};var n=new t.Error().stack;
1n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="c659fdcf-3fca-4a39-a56b-e089062ec4a6",t._sentryDebugIdIdentifier="sentry-dbid-c659fdcf-3fca-4a39-a56b-e089062ec4a6")}catch(p){}})();const Mt="_itemContainer_c0o10_2",Ht="_completed_c0o10_11",Ut="_itemHeader_c0o10_16",Rt="_itemCheckbox_c0o10_22",qt="_checkbox_c0o10_31",Ot="_checkboxLabel_c0o10_39",Gt="_checkmark_c0o10_46",Vt="_itemContent_c0o10_75",Xt="_itemText_c0o10_83",Qt="_itemActions_c0o10_97",Yt="_actionButton_c0o10_103",Wt="_removeButton_c0o10_122",Kt="_disabled_c0o10_127",Zt="_itemDetailsToggle_c0o10_137",Jt="_detailsButton_c0o10_141",es="_itemDetails_c0o10_137",ts="_detailsRow_c0o10_162",ss="_detailColumn_c0o10_168",as="_dateLabel_c0o10_172",os="_dateInput_c0o10_182",is="_notesContainer_c0o10_207",ns="_editingContainer_c0o10_211",cs="_editActions_c0o10_218",ls="_editButton_c0o10_223",rs="_saveButton_c0o10_235",ds="_cancelButton_c0o10_245",h={itemContainer:Mt,completed:Ht,itemHeader:Ut,itemCheckbox:Rt,checkbox:qt,checkboxLabel:Ot,checkmark:Gt,itemContent:Vt,itemText:Xt,itemActions:Qt,actionButton:Yt,removeButton:Wt,disabled:Kt,itemDetailsToggle:Zt,detailsButton:Jt,itemDetails:es,detailsRow:ts,detailColumn:ss,dateLabel:as,dateInput:os,notesContainer:is,editingContainer:ns,editActions:cs,editButton:ls,saveButton:rs,cancelButton:ds},ms=({item:t,categoryId:n,onUpdate:p,onRemove:y,onMoveUp:f,onMoveDown:_,onDuplicate:U,assignees:E,loadingAssignees:N,isFirst:I,isLast:T,isReadOnly:S=!1})=>{const[B,w]=l.useState(!1),[P,F]=l.useState(t.text),[M,H]=l.useState(!1),G=()=>{H(!M)},R=()=>{p(n,t.id,"completed",!t.completed)},q=v=>{p(n,t.id,"notes",v.target.value)},V=v=>{p(n,t.id,"responsibleId",v||null)},L=v=>{p(n,t.id,"completionDate",v.target.value)},X=()=>{F(t.text),w(!0)},k=()=>{P.trim()&&p(n,t.id,"text",P.trim()),w(!1)},O=()=>{F(t.text),w(!1)};return e.jsxs("div",{className:`${h.itemContainer} ${t.completed?h.completed:""}`,children:[e.jsxs("div",{className:h.itemHeader,children:[e.jsxs("div",{className:h.itemCheckbox,children:[e.jsx("input",{type:"checkbox",checked:t.completed,onChange:R,id:`item-${t.id}`,className:h.checkbox,disabled:S}),e.jsx("label",{htmlFor:`item-${t.id}`,className:h.checkboxLabel,children:e.jsx("span",{className:h.checkmark})})]}),B&&!S?e.jsxs("div",{className:h.editingContainer,children:[e.jsx(fe,{id:`edit-item-${t.id}`,name:`edit-item-${t.id}`,value:P,onChange:v=>F(v.target.value),autoFocus:!0,maxLength:250}),e.jsxs("div",{className:h.editActions,children:[e.jsx("button",{className:`${h.editButton} ${h.saveButton}`,onClick:k,title:"Salvar",children:e.jsx(Pe,{size:16})}),e.jsx("button",{className:`${h.editButton} ${h.cancelButton}`,onClick:O,title:"Cancelar",children:e.jsx(Ve,{size:16})})]})]}):e.jsxs("div",{className:h.itemContent,children:[e.jsx("span",{className:h.itemText,children:t.text}),!S&&e.jsxs("div",{className:h.itemActions,children:[e.jsx("button",{className:h.actionButton,onClick:X,title:"Editar item",children:e.jsx(Xe,{size:14})}),e.jsx("button",{className:h.actionButton,onClick:()=>U(n,t.id),title:"Duplicar item",children:e.jsx(mt,{size:14})}),e.jsx("button",{className:`${h.actionButton} ${I?h.disabled:""}`,onClick:()=>!I&&f(n,t.id),disabled:I,title:"Mover para cima",children:e.jsx(Te,{size:14})}),e.jsx("button",{className:`${h.actionButton} ${T?h.disabled:""}`,onClick:()=>!T&&_(n,t.id),disabled:T,title:"Mover para baixo",children:e.jsx(Be,{size:14})}),e.jsx("button",{className:`${h.actionButton} ${h.removeButton}`,onClick:()=>y(n,t.id),title:"Remover item",children:e.jsx(Le,{size:14})})]})]})]}),e.jsx("div",{className:h.itemDetailsToggle,children:e.jsx("button",{className:h.detailsButton,onClick:G,children:M?"Esconder detalhes":"Mostrar detalhes"})}),M&&e.jsxs("div",{className:h.itemDetails,children:[e.jsxs("div",{className:h.detailsRow,children:[e.jsx("div",{className:h.detailColumn,children:e.jsx(Et,{id:`responsible-${t.id}`,name:`responsible-${t.id}`,label:"Responsável",placeholder:"Selecione um responsável",searchPlaceholder:"Buscar responsável...",noOptionsMessage:"Nenhum responsável encontrado",options:E,value:t.responsibleId||"",onChange:V,isLoading:N,clearable:!0,disabled:S})}),e.jsxs("div",{className:h.detailColumn,children:[e.jsx("label",{htmlFor:`date-${t.id}`,className:h.dateLabel,children:"Data de conclusão"}),e.jsx("input",{id:`date-${t.id}`,type:"date",value:t.completionDate||"",onChange:L,className:h.dateInput,disabled:S})]})]}),e.jsx("div",{className:h.notesContainer,children:e.jsx(Ye,{id:`notes-${t.id}`,name:`notes-${t.id}`,label:"Anotações",value:t.notes,onChange:q,placeholder:"Adicione anotações, URLs ou informações adicionais...",maxLength:500,rows:3,resize:!1,disabled:S})})]})]})}
1,ps="_categoryContainer_tkdbk_2",us="_categoryHeader_tkdbk_10",hs="_categoryInfo_tkdbk_19",xs="_collapseButton_tkdbk_25",gs="_categoryTitle_tkdbk_45",fs="_categoryActions_tkdbk_52",_s="_actionButton_tkdbk_58",Cs="_removeButton_tkdbk_77",bs="_disabled_tkdbk_82",vs="_categoryContent_tkdbk_92",js="_addItemContainer_tkdbk_96",ks="_addItemButton_tkdbk_102",ws="_editingContainer_tkdbk_121",Ds="_editInput_tkdbk_127",Ns="_editActions_tkdbk_145",Is="_editButton_tkdbk_150",Ss="_saveButton_tkdbk_162",As="_cancelButton_tkdbk_172",j={categoryContainer:ps,categoryHeader:us,categoryInfo:hs,collapseButton:xs,categoryTitle:gs,categoryActions:fs,actionButton:_s,removeButton:Cs,disabled:bs,categoryContent:vs,addItemContainer:js,addItemButton:ks,editingContainer:ws,editInput:Ds,editActions:Ns,editButton:Is,saveButton:Ss,cancelButton:As},ys=({category:t,onUpdateCategoryName:n,onAddItem:p,onUpdateItem:y,onRemoveItem:f,onRemoveCategory:_,onMoveUp:U,onMoveDown:E,onMoveItemUp:N,onMoveItemDown:I,onDuplicateItem:T,assignees:S,loadingAssignees:B,isFirst:w,isLast:P,isReadOnly:F=!1})=>{const[M,H]=l.useState(!1),[G,R]=l.useState(t.name),[q,V]=l.useState(!1),L=()=>{V(!q)},X=()=>{R(t.name),H(!0)},k=()=>{G.trim()&&n(t.id,G.trim()),H(!1)},O=()=>{R(t.name),H(!1)};return e.jsxs("div",{className:j.categoryContainer,children:[e.jsxs("div",{className:j.categoryHeader,children:[e.jsxs("div",{className:j.categoryInfo,children:[e.jsx("button",{className:j.collapseButton,onClick:L,title:q?"Expandir":"Recolher",children:q?e.jsx(Be,{size:18}):e.jsx(Te,{size:18})}),M?e.jsxs("div",{className:j.editingContainer,children:[e.jsx("input",{type:"text",value:G,onChange:v=>R(v.target.value),className:j.editInput,autoFocus:!0,maxLength:100}),e.jsxs("div",{className:j.editActions,children:[e.jsx("button",{className:`${j.editButton} ${j.saveButton}`,onClick:k,title:"Salvar",children:e.jsx(Pe,{size:16})}),e.jsx("button",{className:`${j.editButton} ${j.cancelButton}`,onClick:O,title:"Cancelar",children:e.jsx(Ve,{size:16})})]})]}):e.jsx("h3",{className:j.categoryTitle,children:t.name})]}),!F&&e.jsx("div",{className:j.categoryActions,children:!M&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:j.actionButton,onClick:X,title:"Editar categoria",children:e.jsx(Xe,{size:16})}),e.jsx("button",{className:`${j.actionButton} ${w?j.disabled:""}`,onClick:()=>!w&&U(t.id),disabled:w,title:"Mover para cima",children:e.jsx(Te,{size:16})}),e.jsx("button",{className:`${j.actionButton} ${P?j.disabled:""}`,onClick:()=>!P&&E(t.id),disabled:P,title:"Mover para baixo",children:e.jsx(Be,{size:16})}),e.jsx("button",{className:`${j.actionButton} ${j.removeButton}`,onClick:()=>_(t.id),title:"Remover categoria",children:e.jsx(Le,{size:16})})]})})]}),!q&&e.jsxs("div",{className:j.categoryContent,children:[t.items.map((v,J)=>e.jsx(ms,{item:v,categoryId:t.id,onUpdate:y,onRemove:f,onMoveUp:N,onMoveDown:I,onDuplicate:T,assignees:S,loadingAssignees:B,isFirst:J===0,isLast:J===t.items.length-1,isReadOnly:F},v.id)),!F&&e.jsx("div",{className:j.addItemContainer,children:e.jsxs("button",{className:j.addItemButton,onClick:()=>p(t.id),children:[e.jsx(Ce,{size:16}),e.jsx("span",{children:"Adicionar Item"})]})})]})]})},Es=l.memo(ys),Ts="_formContainer_niz66_2",Bs="_formSection_niz66_6",$s="_formHeader_niz66_18",zs="_progressContainer_niz66_22",Ps="_progressInfo_niz66_28",Ls="_progressLabel_niz66_34",Fs="_progressValue_niz66_40",Ms="_progressBar_niz66_46",Hs="_progressFill_niz66_54",Us="_basicInfoSection_niz66_61",Rs="_formRow_niz66_68",qs="_formColumn_niz66_78",Os="_sectionHeader_niz66_105",Gs="_sectionTitle_niz66_112",Vs="_formError_niz66_119",Xs="_emptyState_niz66_128",Qs="_categoriesList_niz66_137",Ys="_addCategoryBottom_niz66_143",Ws="_formActions_niz66_251",g={formContainer:Ts,formSection:Bs,formHeader:$s,progressContainer:zs,progressInfo:Ps,progressLabel:Ls,progressValue:Fs,progressBar:Ms,progressFill:Hs,basicInfoSection:Us,formRow:Rs,formColumn:qs,sectionHeader:Os,sectionTitle:Gs,formError:Vs,emptyState:Xs,categoriesList:Qs,addCategoryBottom:Ys,formActions:Ws},Ks={"application/pdf":[".pdf"],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.ms-excel":[".xls"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":[".xlsx"],"image/jpeg":[".jpg",".jpeg"],"image/png":[".png"]},Zs=Bt,Js=Tt,ea=({checklist:t,errors:n,handleInputChange:p,handleProjectChange:y,assignees:f,loadingAssignees:_,addCategory:U,addItemToCategory:E,updateCategoryName:N,updateChecklistItem:I,removeCategory:T,removeItem:S,handleFileUpload:B,removeAttachment:w,downloadAttachment:P,saveChecklist:F,calculateProgress:M,moveCategoryUp:H,moveCategoryDown:G,moveItemUp:R,moveItemDown:q,duplicateItem:V,isEditing:L,saving:X,isReadOnly:k=!1})=>{var J,se;const O=M(),v=C=>{if(C==null){y({target:{value:"",selectedOption:null}});return}y({target:{value:String(C),selectedOption:{value:C,label:""}}
1})};return e.jsxs("div",{className:g.formContainer,children:[e.jsxs("div",{className:g.formSection,children:[e.jsx("div",{className:g.formHeader,children:e.jsxs("div",{className:g.progressContainer,children:[e.jsxs("div",{className:g.progressInfo,children:[e.jsx("span",{className:g.progressLabel,children:"Progresso:"}),e.jsxs("span",{className:g.progressValue,children:[O,"%"]})]}),e.jsx("div",{className:g.progressBar,children:e.jsx("div",{className:g.progressFill,style:{width:`${O}%`}})})]})}),e.jsxs("div",{className:g.basicInfoSection,children:[e.jsxs("div",{className:g.formRow,children:[e.jsx("div",{className:g.formColumn,children:e.jsx(fe,{id:"checklistTitle",name:"title",label:"TÃtulo do checklist",placeholder:"Ex: Checklist de implementação Black Friday",value:t.title,onChange:C=>p("title",C.target.value),error:n.title,required:!0,maxLength:100,disabled:k})}),e.jsx("div",{className:g.formColumn,children:e.jsx(yt,{id:"checklistProject",value:(J=t.projectId)!=null?J:null,onChange:v,queryKeyPrefix:"checklist-project-autocomplete",error:n.projectId,disabled:k})})]}),e.jsxs("div",{className:g.formRow,children:[e.jsx("div",{className:g.formColumn,children:e.jsx(fe,{id:"checklistCampaign",name:"campaign",label:"Campanha",placeholder:"Nome da campanha",value:t.campaign,onChange:C=>p("campaign",C.target.value),error:n.campaign,required:!0,maxLength:100,disabled:k})}),e.jsx("div",{className:g.formColumn,children:e.jsx(fe,{id:"checklistPlatform",name:"platform",label:"Plataforma",placeholder:"Ex: Google Ads, Meta, TikTok",value:t.platform,onChange:C=>p("platform",C.target.value),error:n.platform,required:!0,maxLength:100,disabled:k})})]})]})]}),e.jsxs("div",{className:g.formSection,children:[e.jsxs("div",{className:g.sectionHeader,children:[e.jsx("h2",{className:g.sectionTitle,children:"Categorias e itens"}),!k&&e.jsx(_e,{variant:"outline",size:"sm",icon:e.jsx(Ce,{size:16}),onClick:U,children:"Adicionar categoria"})]}),n.categories&&e.jsx("div",{className:g.formError,children:n.categories}),n.items&&e.jsx("div",{className:g.formError,children:n.items}),t.categories.length===0?e.jsx("div",{className:g.emptyState,children:e.jsx("p",{children:k?"Nenhuma categoria cadastrada.":"Nenhuma categoria adicionada. Clique no botão acima para adicionar."})}):e.jsx("div",{className:g.categoriesList,children:t.categories.map((C,te)=>e.jsx(Es,{category:C,onUpdateCategoryName:N,onAddItem:E,onUpdateItem:I,onRemoveItem:S,onRemoveCategory:T,onMoveUp:H,onMoveDown:G,onMoveItemUp:R,onMoveItemDown:q,onDuplicateItem:V,assignees:f,loadingAssignees:_,isFirst:te===0,isLast:te===t.categories.length-1,isReadOnly:k},C.id))}),!k&&t.categories.length>0&&e.jsx("div",{className:g.addCategoryBottom,children:e.jsx(_e,{variant:"outline",size:"sm",icon:e.jsx(Ce,{size:16}),onClick:U,children:"Adicionar categoria"})})]}),e.jsxs("div",{className:g.formSection,children:[e.jsx("div",{className:g.sectionHeader,children:e.jsx("h2",{className:g.sectionTitle,children:"Anotações gerais"})}),e.jsx(Ye,{id:"checklist-notes",name:"notes",placeholder:"Adicione aqui anotações gerais sobre o checklist, instruções especiais, links importantes, etc.",value:t.notes,onChange:C=>p("notes",C.target.value),maxLength:1e3,rows:8,resize:!1,disabled:k})]}),e.jsxs("div",{className:g.formSection,children:[e.jsx("div",{className:g.sectionHeader,children:e.jsx("h2",{className:g.sectionTitle,children:"Anexos"})}),e.jsx(At,{onDrop:C=>B(C),files:(se=t.attachments)!=null?se:[],accept:Ks,maxSize:Zs,maxFiles:Js,multiple:!0,disabled:k,onRemove:k?void 0:C=>w(C.id),onDownload:C=>P(C.id),title:"Arraste arquivos aqui ou clique para selecionar",subtitle:"PDF, DOC, DOCX, XLS, XLSX, JPG ou PNG · até 20 MB cada · máx. 10 arquivos",helperText:"Adicione capturas de tela, documentos de referência, etc."})]}),!k&&e.jsx("div",{className:g.formActions,children:e.jsx(_e,{variant:"primary",icon:e.jsx(Pe,{size:16}),onClick:F,isLoading:X,children:L?"Atualizar checklist":"Salvar checklist"})})]})},ta="_formContainer_sadmp_1",sa="_formSection_sadmp_8",aa="_progressContainer_sadmp_21",oa="_progressInfo_sadmp_28",ia="_basicInfoSection_sadmp_35",na="_formRow_sadmp_42",ca="_formColumn_sadmp_52",la="_inputGroup_sadmp_60",ra="_label_sadmp_67",da="_sectionHeader_sadmp_72",ma="_categoriesList_sadmp_80",pa="_categoryCard_sadmp_86",ua="_categoryHeader_sadmp_90",ha="_categoryHeaderLeft_sadmp_99",xa="_categoryActions_sadmp_105",ga="_itemsList_sadmp_111",fa="_checklistItem_sadmp_117",_a="_itemContent_sadmp_126",Ca="_itemActions_sadmp_131",ba="_addItemContainer_sadmp_136",va="_emptyAttachments_sadmp_145",ja="_attachmentText_sadmp_157",ka="_formActions_sadmp_162",u={formContainer:ta,formSection:sa,progressContainer:aa,progressInfo:oa,basicInfoSection:ia,formRow:na,formColumn:ca,inputGroup:la,label:ra,sectionHeader:da,categoriesList:ma,categoryCard:pa,categoryHeader:ua,categoryHeaderLeft:ha,categoryActions:xa,itemsList:ga,checklistItem:fa,itemContent:_a,itemActions:Ca,addItemContainer:ba,emptyAttachments:va,attachmentText:ja,formActions:ka},wa=()=>e.jsxs("div",{className:u.formContainer,children:[e.jsxs("div",{className:u.formSection,children:[e.jsxs("div",{className:u.progressContainer,children:[e.jsxs("div",{className:u.progressInfo,children:[e.jsx(x,{variant:"text",width:"80px",height:"14px"}),e.jsx(x,{variant:"text",width:"40px",height:"14px"})]}),e.jsx(x,{variant:"rectangular",height:"8px",borderRadius:"9999px"})]}),e.jsxs("div",{className:u.basicInfoSection,children:[e.jsx("div",{className:u.formRow,children:e.jsxs("div",{className:u.inputGroup,children:[e.jsx(x,{variant:"text",width:"140px",height:"14px",className:u.label}),e.jsx(x,{variant:"rectangular",height:"42px"})]})}),e.jsxs("div",{className:u.formRow,children:[e.jsxs("div",{className:u.formColumn,children:[e.jsx(x,{variant:"text",width:"60px",height:"14px",className:u.label}),e.jsx(x,{variant:"rectangular",height:"42px"})]}),e.jsxs("div",{className:u.formColumn,children:[e.jsx(x,{variant:"text",width:"80px",height:"14px",className:u.label}),e.jsx(x,{variant:"rectangular",height:"42px"})]})]}),e.jsx("div",{className:u.formRow,children:e.jsxs("div",{className:u.inputGroup,children:[e.jsx(x,{variant:"text",width:"80px",height:"14px",className:u.label}),e.jsx(x,{variant:"rectangular",height:"42px"})]})})]})]}),e.jsxs("div",{className:u.formSection,children:[e.jsxs("div",{className:u.sectionHeader,children:[e.jsx(x,{variant:"text",width:"180px",height:"22px"}),e.jsx(x,{variant:"rectangular",width:"160px",height:"36px",borderRadius:"6px"})]}),e.jsx("div",{className:u.categoriesList,children:[1,2].map(t=>e.jsxs(Qe,{className:u.categoryCard,children:[e.jsxs("div",{className:u.categoryHeader,children:[e.jsxs("div",{className:u.categoryHeaderLeft,children:[e.jsx(x,{variant:"rectangular",width:"24px",height:"24px",borderRadius:"4px"}),e.jsx(x,{variant:"rectangular",width:"200px",height:"36px"})]}),e.jsxs("div",{className:u.categoryActions,children:[e.jsx(x,{variant:"rectangular",width:"32px",height:"32px",borderRadius:"6px"}),e.jsx(x,{variant:"rectangular",width:"32px",height:"32px",borderRadius:"6px"}),e.jsx(x,{variant:"rectangular",width:"32px",height:"32px",borderRadius:"6px"})]})]}),e.jsx("div",{className:u.itemsList,children:[1,2,3].map(n=>e.jsxs("div",{className:u.checklistItem,children:[e.jsx(x,{variant:"rectangular",width:"20px",height:"20px",borderRadius:"4px"}),e.jsx("div",{className:u.itemContent,children:e.jsx(x,{variant:"text",width:"70%",height:"16px"})}),e.jsxs("div",{className:u.itemActions,children:[e.jsx(x,{variant:"rectangular",width:"28px",height:"28px",borderRadius:"4px"}),e.jsx(x,{variant:"rectangular",width:"28px",height:"28px",borderRadius:"4px"})]})]},n))}),e.jsx("div",{className:u.addItemContainer,children:e.jsx(x,{variant:"rectangular",width:"140px",height:"32px",borderRadius:"6px"})})]},t))})]}),e.jsxs("div",{className:u.formSection,children:[e.jsx("div",{className:u.sectionHeader,children:e.jsx(x,{variant:"text",width:"160px",height:"22px"})}),e.jsx(x,{variant:"rectangular",height:"100px"})]}),e.jsxs("div",{className:u.formSection,children:[e.jsxs("div",{className:u.sectionHeader,children:[e.jsx(x,{variant:"text",width:"80px",height:"22px"}),e.jsx(x,{variant:"rectangular",width:"150px",height:"36px",borderRadius:"6px"})]}),e.jsxs("div",{className:u.emptyAttachments,children:[e.jsx(x,{variant:"circular",width:"48px",height:"48px"}),e.jsx(x,{variant:"text",width:"180px",height:"14px",className:u.attachmentText})]})]}),e.jsxs("div",{className:u.formActions,children:[e.jsx(x,{variant:"rectangular",width:"100px",height:"40px",borderRadius:"6px"}),e.jsx(x,{variant:"rectangular",width:"160px",height:"40px",borderRadius:"6px"})]})]}),ze=(t,n)=>zt(p=>p==null?"":p,z().max(t,`${n} deve ter no máximo ${t} caracteres`)),Da=Fe({id:be([z(),ie()]),text:z().min(1,"Texto do item é obrigatório").max(500,"Texto muito longo"),completed:Pt(),notes:ze(500,"Notas").optional(),responsibleId:ie().nullable().optional(),completionDate:z().nullable().optional(),order:ie().optional()}),Na=Fe({id:be([z(),ie()]),name:z().min(1,"Nome da categoria é obrigatório").max(100,"Nome muito longo"),items:$e(Da).min(1,"Categoria precisa de pelo menos 1 item"),order:ie().optional()}),Ia=Fe({id:be([z(),ie()]).optional(),title:z().min(1,"TÃtulo é obrigatório").max(100,"TÃtulo muito longo").trim(),projectId:be([z(),ie()]).nullable().optional(),projectName:z().nullable().optional(),client:ze(100,"Cliente"),campaign:z().min(1,"Campanha é obrigatória").max(100,"Campanha muito longa").trim(),platform:z().min(1,"Plataforma é obrigatória").max(100,"Plataforma muito longa").trim(),notes:ze(1e3,"Notas"),categories:$e(Na).min(1,"Adicione pelo menos uma categoria"),attachments:$e(Lt()).optional(),createdAt:z().optional(),lastUpdatedAt:z().optional()});z().max(100,"Busca muito longa").trim();const Sa=()=>
1{var Me,He,Ue;const{showToast:t}=pt(),n=ut(),p=ht(),y=l.useMemo(()=>({id:Date.now(),title:"",createdAt:new Date().toISOString(),lastUpdatedAt:new Date().toISOString(),projectId:null,projectName:"",client:"",platform:"",campaign:"",categories:[{id:"cat-"+Date.now()+"-1",name:"Rastreamento e mensuração",items:[{id:"item-"+Date.now()+"-1",text:"Pixel instalado e validado (Meta / Google)",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-2",text:"GA4 configurado e recebendo eventos",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-3",text:"Eventos personalizados (Lead, Purchase etc.) ativados e testados",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-4",text:"Verificação com Tag Assistant ou Facebook Pixel Helper",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-5",text:"Conversões importadas no Google Ads",completed:!1,notes:"",responsibleId:null,completionDate:""}]},{id:"cat-"+Date.now()+"-2",name:"UTMs e URLs",items:[{id:"item-"+Date.now()+"-6",text:"Todos os links com UTM padrão definida",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-7",text:"Teste de redirecionamento e abertura da página de destino",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-8",text:"Encoders automáticos de UTM (se aplicável)",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-9",text:"Shortlink criado (opcional)",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-10",text:"UTM visÃvel em relatórios (GA, CRM, etc.)",completed:!1,notes:"",responsibleId:null,completionDate:""}]},{id:"cat-"+Date.now()+"-3",name:"Criativos",items:[{id:"item-"+Date.now()+"-11",text:"Tamanhos otimizados para cada canal (Ex: 1080x1080, 1080x1920)",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-12",text:"Texto final aprovado (sem erros gramaticais)",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-13",text:"Call-to-Action claro e alinhado",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-14",text:"VÃdeos testados e sem travamentos",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-15",text:"Pré-visualização dos anúncios nos formatos finais",completed:!1,notes:"",responsibleId:null,completionDate:""}]},{id:"cat-"+Date.now()+"-4",name:"Segmentações e públicos",items:[{id:"item-"+Date.now()+"-16",text:"Públicos salvos corretamente",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-17",text:"Públicos negativos aplicados",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-18",text:"Retargeting ativo",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-19",text:"Lookalike configurado (quando aplicável)",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-20",text:"Localização, idade e gênero conferidos",completed:!1,notes:"",responsibleId:null,completionDate:""}]},{id:"cat-"+Date.now()+"-5",name:"Orçamento e lances",items:[{id:"item-"+Date.now()+"-21",text:"Budget inserido corretamente (diário ou total)",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-22",text:"Estratégia de lance definida (CPC, CPA, Max conversões etc.)",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-23",text:"Limites de gasto diário por conjunto",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-24",text:"Revisão de distribuição entre campanhas",completed:!1,notes:"",responsibleId:null,completionDate:""}]},{id:"cat-"+Date.now()+"-6",name:"Programação e datas",items:[{id:"item-"+Date.now()+"-25",text:"Datas de inÃcio e fim corretas",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-26",text:"Horários de veiculação definidos (se aplicável)",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-27",text:"Exclusões por horário (ex: madrugada)",completed:!1,notes:"",responsibleId:null,completionDate:""}]},{id:"cat-"+Date.now()+"-7",name:"Landing pages",items:[{id:"item-"+Date.now()+"-28",text:"Páginas estão no ar e responsivas",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-29",text:"Tempo de carregamento testado (<3s)",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-30",text:"Teste de formulários, botões e CTAs",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-31",text:"Certificado SSL ativo",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-32",text:"Textos e imagens da página conferidos",completed:!1,notes:"",responsibleId:null,completionDate:""}]},{id:"cat-"+Date.now()+"-8",name:"Conformidade e aprovações",items:[{id:"item-"+Date.now()+"-33",text:"Termos e polÃticas conforme regras da plataforma",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-34",text:"Aprovação do cliente registrada",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-35",text:"Copy revisada para não infringir polÃticas",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-36",text:"Anúncios revisados para polÃtica de conteúdo",completed:!1,notes:"",responsibleId:null,completionDate:""}]},{id:"cat-"+Date.now()+"-9",name:"Checklist final",items:[{id:"item-"+Date.now()+"-37",text:"Validação cruzada por outro membro da equipe",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-38",text:"Print dos anúncios e configurações salvos",completed:!1,notes:"",responsibleId:null,completionDate:""},{id:"item-"+Date.now()+"-39",text:"Backup da campanha exportado (quando aplicável)",completed:!1,notes:"",responsibleId:null,completionDate:""}]}],attachments:[],notes:""}),[]),[f,_]=l.useState(()=>y),[U,E]=l.useState(!1),[N,I]=l.useState(!1),[T,S]=l.useState(!1),[B,w]=l.useState([]),[P,F]=l.useState(""),M=$t(P,500),[H,G]=l.useState(1),[R]=l.useState(10),[q,V]=l.useState(!1),[L,X]=l.useState(null),[k]=l.useState(!1),[O,v]=l.useState({}),[J,se]=l.useState(!1),[C,te]=l.useState([]),ne=l.useMemo(()=>({page:H,perPage:R,search:M}),[H,R,M]),le=l.useMemo(()=>["checklists",n,ne],[n,ne]),Q=Oe({queryKey:le,queryFn:()=>Z(null,null,function*(){var a;const i=yield ee.getChecklists(n,m(d({},ne),{sortBy:"created_at",sortOrder:"desc"}));return{savedChecklists:i.data||[],totalPages:((a=i.meta)==null?void 0:a.lastPage)||1}})});l.useEffect(()=>{var i,a,s;Q.isError&&t({type:"error",title:"Erro",message:((s=(a=(i=Q.error)==null?void 0:i.response)==null?void 0:a.data)==null?void 0:s.message)||"Erro ao carregar checklists."})},[Q.isError,Q.error,t]);const ae=l.useMemo(()=>{var i,a;return(a=(i=Q.data)==null?void 0:i.savedChecklists)!=null?a:[]},[Q.data]),ve=(He=(Me=Q.data)==null?void 0:Me.totalPages)!=null?He:1,ue=Q.isFetching,ce=Q.refetch,re=l.useCallback(i=>{p.setQueryData(le,a=>{var c,r;const s=(c=a==null?void 0:a.savedChecklists)!=null?c:[];return{savedChecklists:typeof i=="function"?i(s):i,totalPages:(r=a==null?void 0:a.totalPages)!=null?r:1}})},[p,le]),he=Oe({queryKey:["checklist-assignees",n],queryFn:()=>Z(null,null,function*(){return((yield ee.getAssignees(n)).data||[]).map(a=>({value:a.id,label:a.name||`Usuário ${a.id}`}))})}),je=(Ue=he.data)!=null?Ue:[],ke=he.isFetching,we=l.useCallback(i=>{G(i)},[]),oe=l.useCallback((i,a)=>{_(s=>m(d({},s),{[i]:a,lastUpdatedAt:new Date().toISOString()})),O[i]&&v(s=>m(d({},s),{[i]:""}))},[O]),xe=l.useCallback(i=>{var s,o;const a=(s=i.target)==null?void 0:s.selectedOption;if(a)_(c=>m(d({},c),{projectId:a.value,projectName:a.label,client:a.label,lastUpdatedAt:new Date().toISOString()})),v(c=>m(d({},c),{projectId:"",client:""}));else{const c=((o=i.target)==null?void 0:o.value)||"";_(r=>m(d({},r),{projectId:null,projectName:c,client:c,lastUpdatedAt:new Date().toISOString()}))}},[]),de=l.useCallback(()=>{const i="cat-"+Date.now();_(a=>m(d({},a),{categories:[...a.categories,{id:i,name:"Nova categoria",items:[{id:"item-"+Date.now(),text:"Novo item",completed:!1,notes:"",responsibleId:null,completionDate:""}]}],lastUpdatedAt:new Date().toISOString()}))},[]),me=l.useCallback(i=>{const a="item-"+Date.now();_(s=>m(d({}
1,s),{categories:s.categories.map(o=>o.id===i?m(d({},o),{items:[...o.items,{id:a,text:"Novo item",completed:!1,notes:"",responsibleId:null,completionDate:""}]}):o),lastUpdatedAt:new Date().toISOString()}))},[]),pe=l.useCallback((i,a)=>{_(s=>m(d({},s),{categories:s.categories.map(o=>o.id===i?m(d({},o),{name:a}):o),lastUpdatedAt:new Date().toISOString()}))},[]),De=l.useCallback((i,a,s,o)=>Z(null,null,function*(){const c=s==="completed"&&o?xt(new Date):null;let r="";const b=f.categories.find(A=>A.id===i);if(b){const A=b.items.find(D=>D.id===a);A&&(r=A.text)}if(_(A=>m(d({},A),{categories:A.categories.map(D=>D.id===i?m(d({},D),{items:D.items.map(W=>W.id===a?d(m(d({},W),{[s]:o}),s==="completed"&&o&&!W.completionDate?{completionDate:c}:{}):W)}):D),lastUpdatedAt:new Date().toISOString()})),s==="completed"&&typeof a=="number")try{const A={completed:o};o&&c&&(A.completion_date=c),yield ee.updateChecklistItem(n,a,A),yield ce();const D=r.length>50?r.substring(0,50)+"...":r;t({type:"success",title:"Salvo",message:o?`"${D}" marcado como concluÃdo.`:`"${D}" desmarcado.`})}catch(A){_(D=>m(d({},D),{categories:D.categories.map(W=>W.id===i?m(d({},W),{items:W.items.map(Ee=>Ee.id===a?m(d({},Ee),{completed:!o}):Ee)}):W)})),t({type:"error",title:"Erro",message:"Não foi possÃvel salvar o status do item."})}}),[n,t,ce,f.categories]),Ne=l.useCallback(i=>{_(a=>m(d({},a),{categories:a.categories.filter(s=>s.id!==i),lastUpdatedAt:new Date().toISOString()}))},[]),Ie=l.useCallback((i,a)=>{_(s=>m(d({},s),{categories:s.categories.map(o=>o.id===i?m(d({},o),{items:o.items.filter(c=>c.id!==a)}):o),lastUpdatedAt:new Date().toISOString()}))},[]),Se=l.useCallback(i=>{if(!Array.isArray(i)||i.length===0)return;const a=i.map(s=>({id:Date.now()+Math.random().toString(36).substring(7),name:s.name,size:s.size,type:s.type,file:s,url:URL.createObjectURL(s)}));w(s=>[...s,...a]),_(s=>m(d({},s),{attachments:[...s.attachments||[],...a]}))},[]),Ae=l.useCallback(i=>{const a=B.find(s=>s.id===i);a&&typeof a.id=="number"&&te(s=>[...s,a.id]),w(s=>s.filter(o=>o.id!==i)),_(s=>m(d({},s),{attachments:s.attachments.filter(o=>o.id!==i),lastUpdatedAt:new Date().toISOString()}))},[B]),ye=l.useCallback(()=>Z(null,null,function*(){I(!0),v({});try{Ia.parse(f)}catch(i){if(i.name==="ZodError"){const a={};return i.issues.forEach(s=>{const o=s.path;if(o.length===1)a[o[0]]=s.message;else if(o.length>1&&o[0]==="categories"){const c=o[1];if(o.length===3&&o[2]==="name"){const r=`categoryName_${c}`;a[r]=`Categoria ${c+1}: ${s.message}`}else if(o.length===3&&o[2]==="items"){const r=`categoryItems_${c}`;a[r]=`Categoria ${c+1}: ${s.message}`}else if(o.length>3&&o[2]==="items"){const r=o[3],b=`item_${c}_${r}`;a[b]=`Categoria ${c+1}, Item ${r+1}: ${s.message}`}}}),v(a),t({type:"error",title:"Erro de validação",message:"Corrija os erros antes de salvar."}),I(!1),!1}throw i}try{const i=m(d({},f),{categories:f.categories.map(a=>{const s=typeof a.id=="string"?null:a.id;return m(d({},a),{id:s,items:a.items.map(o=>{const c=typeof o.id=="string"?null:o.id;return m(d({},o),{id:c})}),attachments:B.map(o=>m(d({},o),{file:o.file||null}))})})});if(T&&f.id){const a=m(d({},i),{deleted_attachments:C});yield ee.updateChecklist(n,f.id,a)}else yield ee.createChecklist(n,i);return yield ce(),S(!0),t({type:"success",title:"Sucesso",message:`Checklist ${T?"atualizado":"criado"} com sucesso!`}),!0}catch(i){return t({type:"error",title:"Erro",message:`Ocorreu um erro ao ${T?"atualizar":"criar"} o checklist.`}),!1}finally{I(!1)}}),[n,f,T,t,ce,B,C]),$=l.useCallback(()=>{_(m(d({},y),{id:Date.now()})),w([]),te([]),S(!1),v({})},[y]);l.useEffect(()=>{f&&f.attachments?w(f.attachments):w([])},[f]);const Y=l.useCallback(i=>Z(null,null,function*(){try{const a=typeof i=="object"&&i!==null?i.id:i;if(!a)throw new Error("ID de checklist inválido");E(!0);const s=yield ee.getChecklistById(n,a);if(s){const o=s.attachments||[];return _(m(d(d({},y),s),{id:s.id,attachments:o,originalAttachments:[...o]})),w(o),S(!0),v({}),E(!1),s}else throw new Error("Dados do checklist não encontrados")}catch(a){t({type:"error",title:"Erro",message:"Não foi possÃvel carregar o checklist."}),E(!1)}}),[n,t,y]),ge=l.useCallback(i=>{X(i),V(!0)},[]),We=l.useCallback(()=>{X(null),V(!1)},[]),Ke=l.useCallback(()=>Z(null,null,function*(){if(!L)return;const i=typeof L=="object"?L.id:L,a=[...ae];re(s=>s.filter(o=>o.id!==i)),V(!1),X(null);try{yield ee.deleteChecklist(n,i),t({type:"success",title:"Sucesso",message:"Checklist excluÃdo com sucesso!"})}catch(s){re(a),t({type:"error",title:"Erro",message:"Ocorreu um erro ao excluir o checklist."})}}),[n,L,ae,re,t]),Ze=l.useCallback(i=>Z(null,null,function*(){var a,s;se(!0),t({type:"info",title:"Gerando PDF",message:"Aguarde enquanto o PDF é gerado..."});try{const o=yield ee.exportChecklistPdf(n,i),c=ae.find(b=>b.id===i),r=c!=null&&c.title?`checklist-${c.title.replace(/[^\w\s-]/g,"").trim().replace(/\s+/g,"-")}.pdf`:`checklist-${i}.pdf`;Ge(o,r),t({type:"success",title:"PDF Gerado",message:"O PDF foi baixado com sucesso."})}catch(o){t({type:"error",title:"Erro na Exportação",message:((s=(a=o==null?void 0:o.response)==null?void 0:a.data)==null?void 0:s.message)||"Não foi possÃvel gerar o PDF."})}finally{se(!1)}}),[n,ae,t]),Je=l.useCallback(i=>Z(null,null,function*(){var s;if(!f.id){t({type:"error",title:"Erro",message:"Não é possÃvel fazer download de anexos de um checklist não salvo."});return}const a=B.find(o=>o.id===i)||((s=f.attachments)==null?void 0:s.find(o=>o.id===i));if(!a){t({type:"error",title:"Erro",message:"Anexo não encontrado."});return}if(!a.isServerAttachment&&a.url){const o=document.createElement("a");o.href=a.url,o.download=a.name,document.body.appendChild(o),o.click(),document.body.removeChild(o);return}try{const{blob:o,filename:c}=yield ee.downloadAttachment(n,f.id,i);Ge(o,c||"arquivo"),t({type:"success",title:"Download iniciado",message:"O download do arquivo foi iniciado."})}catch(o){t({type:"error",title:"Erro",message:yield Ft(o,"Ocorreu um erro ao fazer download do anexo.")})}}),[n,f,B,t]),et=l.useCallback(i=>{_(a=>{const s=[...a.categories],o=s.findIndex(r=>
1r.id===i);if(o<=0)return a;const c=s[o];return s[o]=s[o-1],s[o-1]=c,m(d({},a),{categories:s,lastUpdatedAt:new Date().toISOString()})})},[]),tt=l.useCallback(i=>{_(a=>{const s=[...a.categories],o=s.findIndex(r=>r.id===i);if(o===-1||o>=s.length-1)return a;const c=s[o];return s[o]=s[o+1],s[o+1]=c,m(d({},a),{categories:s,lastUpdatedAt:new Date().toISOString()})})},[]),st=l.useCallback((i=null)=>{const a=i||f,s=a.categories.reduce((c,r)=>c+r.items.length,0),o=a.categories.reduce((c,r)=>c+r.items.filter(b=>b.completed).length,0);return s>0?Math.round(o/s*100):0},[f]),at=l.useCallback((i,a)=>{_(s=>{const o=s.categories.map(c=>{if(c.id!==i)return c;const r=[...c.items],b=r.findIndex(D=>D.id===a);if(b<=0)return c;const A=r[b];return r[b]=r[b-1],r[b-1]=A,m(d({},c),{items:r})});return m(d({},s),{categories:o,lastUpdatedAt:new Date().toISOString()})})},[]),ot=l.useCallback((i,a)=>{_(s=>{const o=s.categories.map(c=>{if(c.id!==i)return c;const r=[...c.items],b=r.findIndex(D=>D.id===a);if(b===-1||b>=r.length-1)return c;const A=r[b];return r[b]=r[b+1],r[b+1]=A,m(d({},c),{items:r})});return m(d({},s),{categories:o,lastUpdatedAt:new Date().toISOString()})})},[]),it=l.useCallback((i,a)=>{_(s=>{const o=s.categories.map(c=>{if(c.id!==i)return c;const r=[...c.items],b=r.findIndex(W=>W.id===a);if(b===-1)return c;const A=r[b],D=m(d({},A),{id:"item-"+Date.now(),completed:!1,notes:"",responsibleId:null,completionDate:""});return r.splice(b+1,0,D),m(d({},c),{items:r})});return m(d({},s),{categories:o,lastUpdatedAt:new Date().toISOString()})})},[]);return{checklist:f,savedChecklists:ae,loading:ue,loadingEdit:U,saving:N,isEditing:T,attachments:B,searchTerm:P,currentPage:H,showDeleteConfirm:q,checklistToDelete:L,deleting:k,errors:O,exporting:J,assignees:je,loadingAssignees:ke,setSearchTerm:F,handlePageChange:we,handleInputChange:oe,handleProjectChange:xe,addCategory:de,addItemToCategory:me,updateCategoryName:pe,updateChecklistItem:De,removeCategory:Ne,removeItem:Ie,handleFileUpload:Se,removeAttachment:Ae,downloadAttachment:Je,saveChecklist:ye,newChecklist:$,editChecklist:Y,confirmDelete:ge,cancelDelete:We,deleteChecklist:Ke,exportToPdf:Ze,calculateProgress:st,moveCategoryUp:et,moveCategoryDown:tt,moveItemUp:at,moveItemDown:ot,duplicateItem:it,totalPages:ve}},Aa="_container_19d8r_2",ya="_header_19d8r_7",Ea="_titleContainer_19d8r_15",Ta="_title_19d8r_15",Ba="_subtitle_19d8r_30",$a="_card_19d8r_36",za="_searchWrapper_19d8r_40",K={container:Aa,header:ya,titleContainer:Ea,title:Ta,subtitle:Ba,card:$a,searchWrapper:za};function Pa(t){return t>=100?"success":t>=50?"info":"warning"}function oo(){const{checklist:t,loading:n,loadingEdit:p,saving:y,isEditing:f,searchTerm:_,setSearchTerm:U,savedChecklists:E,currentPage:N,totalPages:I,showDeleteConfirm:T,checklistToDelete:S,deleting:B,errors:w,exporting:P,assignees:F,loadingAssignees:M,handlePageChange:H,handleInputChange:G,handleProjectChange:R,addCategory:q,addItemToCategory:V,updateCategoryName:L,updateChecklistItem:X,removeCategory:k,removeItem:O,handleFileUpload:v,removeAttachment:J,downloadAttachment:se,saveChecklist:C,newChecklist:te,editChecklist:ne,confirmDelete:le,cancelDelete:Q,deleteChecklist:ae,exportToPdf:ve,calculateProgress:ue,moveCategoryUp:ce,moveCategoryDown:re,moveItemUp:he,moveItemDown:je,duplicateItem:ke}=Sa(),[we,oe]=l.useState(!0),[xe,de]=l.useState(!1),[me,pe]=l.useState(!1),De=()=>{te(),de(!1),pe(!1),oe(!1)},Ne=$=>{de(!0),pe(!0),ne($),oe(!1)},Ie=$=>{de(!0),pe(!1),ne($),oe(!1)},Se=()=>Z(null,null,function*(){(yield C())&&oe(!0)}),Ae=()=>{te(),oe(!0)},ye=[{key:"title",title:"TÃtulo",width:"18%"},{key:"project",title:"Projeto",width:"14%",render:($,Y)=>Y.projectName||Y.client||"â"},{key:"campaign",title:"Campanha",width:"14%"},{key:"progress",title:"Progresso",width:"12%",render:($,Y)=>{const ge=ue(Y);return e.jsxs(bt,{variant:Pa(ge),size:"sm",children:[ge,"%"]})}},{key:"createdAt",title:"Criação",width:"14%",render:$=>vt($)},{key:"creatorName",title:"Criado por",width:"12%",render:$=>$||"-"},{key:"actions",title:"Ações",width:"8%",render:($,Y)=>e.jsx(Dt,{size:"sm",actions:[{icon:e.jsx(jt,{size:16}),label:"Visualizar",onClick:()=>Ne(Y)},{icon:e.jsx(kt,{size:16}),label:"Editar",onClick:()=>Ie(Y)},{icon:e.jsx(wt,{size:16}),label:"Exportar PDF",onClick:()=>ve(Y.id),disabled:P},{icon:e.jsx(Le,{size:16}),label:"Excluir",onClick:()=>le(Y),danger:!0}]})}];return e.jsxs(gt,{children:[e.jsx(ft,{title:"Checklist de implementação"}),e.jsx("div",{className:K.container,children:we?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:K.header,children:[e.jsxs("div",{className:K.titleContainer,children:[e.jsx("h1",{className:K.title,children:"Checklist de implementação"}),e.jsx("p",{className:K.subtitle,children:"Crie e gerencie checklists para suas implementações de campanhas"}),e.jsx(It,{collection:"checklist-de-implementacao"})]}),e.jsx(_e,{variant:"primary",icon:e.jsx(Ce,{size:16}),onClick:De,children:"Novo checklist"})]}),e.jsx(St,{id:"search-checklists",placeholder:"Buscar checklists...",value:_,onCh
1ange:$=>U($.target.value),className:K.searchWrapper,fullWidth:!0}),e.jsx(_t,{columns:ye,data:E,loading:n,emptyMessage:"Nenhum checklist encontrado. Crie seu primeiro checklist!",pagination:{currentPage:N,lastPage:I},onPageChange:H,paginationAlign:"right"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:K.header,children:[e.jsx(Nt,{onClick:Ae,label:"Voltar para lista"}),e.jsxs("div",{className:K.titleContainer,children:[e.jsx("h1",{className:K.title,children:me?"Visualizar checklist":xe?"Editar checklist de implementação":"Novo checklist de implementação"}),e.jsx("p",{className:K.subtitle,children:me?"Visualize os detalhes do checklist (somente leitura)":xe?"Edite os detalhes do seu checklist":"Preencha os detalhes do seu checklist"})]})]}),e.jsx(Qe,{className:K.card,children:p?e.jsx(wa,{}):e.jsx(ea,{checklist:t,errors:w,handleInputChange:G,handleProjectChange:R,assignees:F,loadingAssignees:M,addCategory:q,addItemToCategory:V,updateCategoryName:L,updateChecklistItem:X,removeCategory:k,removeItem:O,handleFileUpload:v,removeAttachment:J,downloadAttachment:se,saveChecklist:Se,calculateProgress:ue,moveCategoryUp:ce,moveCategoryDown:re,moveItemUp:he,moveItemDown:je,duplicateItem:ke,isEditing:f,saving:y,isReadOnly:me})})]})}),e.jsx(Ct,{isOpen:T,onClose:Q,onConfirm:ae,title:"Confirmar exclusão",message:S?`Tem certeza que deseja excluir o checklist "${S.title}"? Esta ação não pode ser desfeita.`:"Tem certeza que deseja excluir este checklist? Esta ação não pode ser desfeita.",confirmText:"Excluir",cancelText:"Cancelar",type:"error",isProcessing:B})]})}export{oo as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.