1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fa24762d-c8ce-5dca-9ef0-b8a706ffba89")}catch(e){}}(); 3import {S}from'./chunk-ld32INqj.js';import {Y}from'./chunk-DLwVe265.js';import {X}from'./chunk-C5qd0XeM.js';import {c}from'./chunk-DJHlXQ1U.js';import {m,bu as Tn,a_ as O,aZ as $e,z as z$1,S as Sn,C as Ce,br as u,av as te$1,b8 as pe,b7 as U,i as it,a as Gt$1,p,e7 as Yd,f as Gw,aK as Bn,bv as kn,aL as Xe,aM as xn,aN as Rn,b9 as ln,aO as gn,aP as hn,a$ as Ht$1,b0 as Nt$1,b1 as zt$1,b2 as Vt$1,aQ as fe,aR as rt,aS as le,aT as de,aU as It$1,aV as Nt$2,aW as dn,aX as ln$1,g as hi$1,j as fi$1,az as Tn$1,y as yt,w as wt$1,aC as Yt$1,aD as mt,c9 as Ye,t as tt,E as vs,K as sT,T as TT,J as yl,a6 as zg,l as pC,V as mI,Y as am,_ as _T,a0 as Lg,ae as Pg,o as hC,aE as DT,q as Oy,I,ay as av,x,r as nB,s as tB,eo as iB,F as yC,at as em,W as vC,af as Qg,ag as LC,aH as xn$1,aJ as WE,cm as dl,am as J,an as Z,a5 as TC,a7 as Of,a4 as xC,a8 as kf,Q as jg,em as T,bt as e$1,a9 as Cl,ba as nw,bb as ow,Z as ST,bg as IT,U as jC}from'./main-4VLKDOCZ.js';import {v as vt$1,g as gt,q as qe}from'./chunk-Dpo4BF0S.js';import {X as Xn,$ as $n,D as Da,J as Ja,s as st,r as ri$1}from'./chunk-Dj_wg0ZJ.js';import {S as Si$1,O as Oi$1,U as U$1,p as pt}from'./chunk-cXqDMoZI.js';import'./chunk-CAt0gmil.js';import'./chunk-CnpvWcIg.js';import'./chunk-CFc4R64D.js';import'./chunk-O2Pt1p3i.js';var jt=["optionRef"],Gt=(t,n)=>n.code;function Yt(t,n){t&1&&(vs(0,"mat-icon",5),sT(1,"check_circle"),yl());}function Wt(t,n){if(t&1){let e=TC();vs(0,"button",3,0),zg("click",function(){let a=Of(e).$implicit,m=xC();return kf(m.select(a))})("keydown",function(a){let m=Of(e).$index,y=xC();return kf(y.onKeydown(a,m))}
3),vs(2,"span",4),sT(3),yl(),pC(4,Yt,2,0,"mat-icon",5),yl();}if(t&2){let e=n.$implicit,i=n.$index,a=xC();em("choice-list__option--selected",e.code===a.value()),Pg("aria-checked",e.code===a.value())("tabindex",i===a.activeIndex()?0:-1),mI(3),am(e.name),mI(),hC(e.code===a.value()?4:-1);}}var Ht=new Set(["ArrowDown","ArrowRight","ArrowUp","ArrowLeft","Home","End"]),vt=(()=>{class t{options=nB.required();value=nB(null);ariaLabel=nB("");invalid=nB(false);valueChange=tB();optionButtons=iB();activeIndex=Gt$1(()=>{let e=this.options().findIndex(i=>i.code===this.value());return e===-1?0:e});select(e){this.valueChange.emit(e.code);}onKeydown(e,i){if(!Ht.has(e.key))return;let a=this.options().length-1,m=i;switch(e.key){case "ArrowDown":case "ArrowRight":m=Math.min(i+1,a);break;case "ArrowUp":case "ArrowLeft":m=Math.max(i-1,0);break;case "Home":m=0;break;case "End":m=a;break}e.preventDefault(),m!==i&&(this.select(this.options()[m]),this.optionButtons()[m]?.nativeElement.focus());}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=Gw({type:t,selectors:[["app-choice-list"]],viewQuery:function(i,a){i&1&&Qg(a.optionButtons,jt,5),i&2&&LC();},inputs:{options:[1,"options"],value:[1,"value"],ariaLabel:[1,"ariaLabel"],invalid:[1,"invalid"]},outputs:{valueChange:"valueChange"},decls:3,vars:3,consts:[["optionRef",""],["role","radiogroup",1,"choice-list"],["type","button","role","radio",1,"choice-list__option",3,"choice-list__option--selected"],["type","button","role","radio",1,"choice-list__option",3,"click","keydown"],[1,"choice-list__label"],[1,"choice-list__icon"]],template:function(i,a){i&1&&(vs(0,"div",1),yC(1,Wt,5,6,"button",2,Gt),yl()),i&2&&(em("choice-list--invalid",a.invalid()),Pg("aria-label",a.ariaLabel()||null),mI(),vC(a.options()));},dependencies:[yt,wt$1],styles:[".choice-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.choice-list--invalid[_ngcontent-%COMP%] .choice-list__option[_ngcontent-%COMP%]{border-color:var(--mat-sys-error)}.choice-list__option[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:12px 14px;border:1px solid var(--mat-sys-outline-variant);border-radius:2px;background:var(--app-panel-bg);color:var(--mat-sys-on-surface);text-align:left;cursor:pointer;font-family:inherit;font-size:14px;line-height:1.4;transition:border-color .15s ease,background-color .15s ease}@media(prefers-reduced-motion:reduce){.choice-list__option[_ngcontent-%COMP%]{transition:none}}.choice-list__option[_ngcontent-%COMP%]:hover, .choice-list__option[_ngcontent-%COMP%]:focus-visible{border-color:color-mix(in srgb,var(--mat-sys-primary) 40%,var(--mat-sys-outline-variant));background:var(--app-hover-overlay)}.choice-list__option[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--mat-sys-primary);outline-offset:2px}.choice-list__option--selected[_ngcontent-%COMP%]{border-color:var(--mat-sys-primary);background:color-mix(in srgb,var(--mat-sys-primary) 6%,transparent)}.choice-list__label[_ngcontent-%COMP%]{flex:1 1 auto}.choice-list__icon[_ngcontent-%COMP%]{flex:0 0 auto;color:var(--mat-sys-primary)}"]})}return t})();function Zt(){return typeof matchMedia!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"}var xt=(()=>{class t{el=m(xn$1);enabled=nB(true,{alias:"appRevealScroll"});constructor(){WE(()=>{this.enabled()&&this.el.nativeElement.scrollIntoView?.({block:"nearest",behavior:Zt()});});}static \u0275fac=function(i){return new(i||t)};static \u0275dir=dl({type:t,selectors:[["","appRevealScroll",""]],inputs:{enabled:[1,"appRevealScroll","enabled"]}})}return t})();var Ct=["DFeTech.ProductInvoice","DFeTech.ServiceInvoice.Batch","DFeTech.ProductInvoice.Batch","DFeTech.ConsumerInvoice","DFeTech.ServiceInvoice","DFeTech.ProductInvoice.Inbound","DFeTech.TransportationInvoice.Inbound","DataTech.LegalEntity","DataTech.ProductInvoice","DataTech.NaturalPerson","DataTech.Batch","DataTech.Batch.ProductInvoice.Pdf","DataTech.Batch.ProductInvoice.Xml"];var K=["image/jpeg","image/jpg","image/png","application/pdf","text/plain","text/xml","application/xml"],kt={categories:[{code:"Problema",
3name:"enums.ticket.categories.problem"},{code:"D\xFAvidas",name:"enums.ticket.categories.doubt"},{code:"Cancelamento",name:"enums.ticket.categories.cancellation"}],departments:[{code:"Faturamento",name:"enums.ticket.departments.financial"},{code:"Tecnico",name:"enums.ticket.departments.technical"},{code:"Comercial",name:"enums.ticket.departments.comercial"}],financialProblemSubtypes:[{name:"enums.ticket.financialProblemSubtypes.changeTicketExpirationDate",code:"alteracao_vencimento_boleto"},{name:"enums.ticket.financialProblemSubtypes.accessBlock",code:"bloqueio_acesso"},{name:"enums.ticket.financialProblemSubtypes.paymentSlip",code:"envio_boleto"},{name:"enums.ticket.financialProblemSubtypes.refund",code:"estorno_reembolso"},{name:"enums.ticket.financialProblemSubtypes.missingInvoice",code:"falta_nota_fiscal"},{name:"enums.ticket.financialProblemSubtypes.generateTicketCopy",code:"segunda_via_boleto"},{name:"enums.ticket.financialProblemSubtypes.invoiceInfo",code:"informacao_fatura"},{name:"enums.ticket.financialProblemSubtypes.fine",code:"multa_juros"},{name:"enums.ticket.financialProblemSubtypes.cancellation",code:"cancelamento_contrato"}],technicalProblemSubtypes:[{name:"enums.ticket.technicalProblemSubtypes.integration",code:"integracoes"},{name:"enums.ticket.technicalProblemSubtypes.product",code:"produto"},{name:"enums.ticket.technicalProblemSubtypes.fiscal",code:"fiscal"}],dataQuerySubtypes:[{code:"dados_retorno",name:"enums.ticket.dataQuerySubtypes.queryResponse"},{code:"falha_consulta",name:"enums.ticket.dataQuerySubtypes.queryFailed"},{code:"outros",name:"enums.ticket.dataQuerySubtypes.others"}],"DFeTech.ServiceInvoice.Subtypes":[{code:"falha_emissao",name:"enums.ticket.DFeTech.ServiceInvoice.Subtypes.issueFailed"},{code:"estagio_processamento",name:"enums.ticket.DFeTech.ServiceInvoice.Subtypes.invoiceStuckedInProcessingState"},{code:"email_tomador",name:"enums.ticket.DFeTech.ServiceInvoice.Subtypes.borrowerEmail"},{code:"status_divergente",name:"enums.ticket.DFeTech.ServiceInvoice.Subtypes.divergingStatus"},{code:"informacoes",name:"enums.ticket.DFeTech.ServiceInvoice.Subtypes.invoiceInfomation"},{code:"pdf",name:"enums.ticket.DFeTech.ServiceInvoice.Subtypes.invoicePdf"},{code:"certificado_digital",name:"enums.ticket.DFeTech.ServiceInvoice.Subtypes.certificate"},{code:"outros",name:"enums.ticket.DFeTech.ServiceInvoice.Subtypes.others"}],"DFeTech.ProductInvoice.Subtypes":[{code:"falha_emitir",name:"enums.ticket.DFeTech.ProductInvoice.Subtypes.issueFailed"},{code:"nfe_denegada",name:"enums.ticket.DFeTech.ProductInvoice.Subtypes.invoiceDenied"},{code:"nfe_recusada",name:"enums.ticket.DFeTech.ProductInvoice.Subtypes.invoiceRefused"},{code:"erro_enviar_dados",name:"enums.ticket.DFeTech.ProductInvoice.Subtypes.errorSendInvoiceData"},{code:"pdf",name:"enums.ticket.DFeTech.ProductInvoice.Subtypes.invoicePdf"},{code:"certificado_digital",name:"enums.ticket.DFeTech.ProductInvoice.Subtypes.certificate"},{code:"outros",name:"enums.ticket.DFeTech.ProductInvoice.Subtypes.others"}],"DFeTech.ConsumerInvoice.Subtypes":[{code:"falha_emissao",name:"enums.ticket.DFeTech.ConsumerInvoice.Subtypes.issueFailed"},{code:"erro_enviar_dados",name:"enums.ticket.DFeTech.ConsumerInvoice.Subtypes.errorSendInvoiceData"},{code:"certificado_digital",name:"enums.ticket.DFeTech.ConsumerInvoice.Subtypes.certificate"},{code:"outros",name:"enums.ticket.DFeTech.ConsumerInvoice.Subtypes.others"}],integrationSubtypes:[{name:"enums.ticket.integrationSubtypes.internIntegration",code:"nfeio_integration"},{name:"enums.ticket.integrationSubtypes.batchPlataformIssue",code:"Planilha"},{name:"enums.ticket.integrationSubtypes.customerIntegration",code:"API"},{name:"enums.ticket.integrationSubtypes.vindi",code:"Vindi"},{name:"enums.ticket.integrationSubtypes.mundipagg",code:"Mundipagg"},{name:"enums.ticket.integrationSubtypes.pluga",code:"Pluga"},{name:"enums.ticket.integrationSubtypes.WooCommerce",code:"WooCommerce"},{name:"enums.ticket.integrationSubtypes.whmcs",code:"WHMCS"},{name:"enums.ticket.integrationSubtypes.gestaoDs",code:"Gestao_ds"}],fiscalSubtypes:[{name:"enums.ticket.fiscalSubtypes.cityServiceCodeRegistration",code:"codigo-de-Servi\xE7o"},{name:"enums.ticket.fiscalSubtypes.fiscalFailure",code:"erro-de-emissao"},{name:"enums.ticket.fiscalSubtypes.fiscalDoubt",code:"duvida-fiscal"},{name:"enums.ticket.fiscalSubtypes.prefectureIntegration",code:"integracao-prefeitura"},{name:"enums.ticket.fiscalSubtypes.taxCalculation",code:"calculo-imposto"},{name:"enums.ticket.fiscalSubtypes.others",code:"outros"}],clientDepartment:[{code:"Financeiro",name:"enums.ticket.departments.financial"}
3,{code:"T\xE9cnico",name:"enums.ticket.departments.technical"},{code:"Operacional",name:"enums.ticket.departments.comercial"},{code:"Outros",name:"enums.ticket.departments.others"}]},Dt=[{mask:"00.000.000/0000-00",type:"DataTech.LegalEntity",name:"CNPJ"},{masks:{federalTaxNumber:"000.000.000-00"},type:"DataTech.NaturalPerson",name:"CPF"},{mask:"0".repeat(44),type:"DataTech.ProductInvoice",name:"NF-e"}];function Jt(t){return t==null?"":String(t)}function St(t){for(let n of Object.keys(t)){let e=t[n];(e==null||e==="")&&delete t[n];}}var Tt=(()=>{class t{http=m(Oy);ticketBlobUrl(e,i,a){let m=I.AZURE_TICKET_BLOB_CONTAINER_HOST;if(!a)return `${m}/${e}/${i}`;let y=I.AZURE_TICKET_BLOB_CONTAINER_SAS_TOKEN,M=y.startsWith("?")?y:`?${y}`;return `${m}/${e}/${i}${M}`}async createStorageBlobFromFile(e,i,a){if(!K.includes(a.type.toLowerCase()))throw new Error(`File type ${a.type} is not allowed. Only JPG, PNG, PDF, TXT and XML files are supported.`);return await av(this.http.put(this.ticketBlobUrl(e,i,true),a,{headers:{"x-ms-blob-type":"BlockBlob","Content-Type":a.type},responseType:"text"})),{url:this.ticketBlobUrl(e,i,false),name:a.name}}async uploadTicketAttachments(e,i){if(!e||e.length===0)return [];let a="tickets",m=e.map(y=>{let M=new Date().getTime(),Z=y.name.replace(/[^a-zA-Z0-9.-]/g,"_"),J=`${i}_${M}_${Z}`;return this.createStorageBlobFromFile(a,J,y)});try{return await Promise.all(m)}catch(y){throw console.error("Error uploading ticket attachments:",y),new Error("Failed to upload one or more files",{cause:y})}}serializeTicket(e){let i={ticket:{subject:`Ticket aberto via plataforma: ${e.category} - ${e.product.providerNamespace}`,content:e.description,hs_pipeline:0,hs_pipeline_stage:1,hs_ticket_category:e.category,tipo:e.department,tipo_de_servico:e.product.providerNamespace,id_empresa:e.product.companyId,id_nota_fiscal:e.product.invoiceId,parametro_consulta:e.product.queryParameter,cpf_data_nascimento:e.product.naturalPersonbirthDate,data_consulta:e.product.queryDate,cnpj:Jt(e.product.federalTaxNumber),id_conta:e.accountId,ambiente_da_conta:e.accountEnvironment,status_conta:e.accountStatus,source_type:"Plataforma"},contact:{firstname:e.name,email:e.email,jobtitle:e.clientDepartment}};if(e.department==="Tecnico"){if(i.ticket.subcategoria_tecnico=e.type,e.type==="fiscal")i.ticket.sub_tipo_fiscal_=e.subtype;else if(e.type==="integracoes")i.ticket.integracao_via=e.subtype;else if(e.type==="produto"){let a=(e.product.providerNamespace||"").toLowerCase();a.includes("serviceinvoice")?i.ticket.subtipo_nfse=e.subtype:a.includes("productinvoice")?i.ticket.subtipo_nfe=e.subtype:a.includes("consumerinvoice")?i.ticket.subtipo_nfce=e.subtype:i.ticket.subtipo_consulta_dados=e.subtype;}}else e.department==="Faturamento"&&(i.ticket.subcategoria_financeiro=e.type);return e.phone&&(i.contact.phone=e.phone),St(i.ticket),St(i.contact),i}async sendTicket(e){let a=`<QueueMessage><MessageText>${JSON.stringify(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}</MessageText></QueueMessage>`,m={status:"success",message:"",body:null};try{m.body=await av(this.http.post(I.TICKET_API_URL,a,{headers:{"Content-Type":"application/xml"},responseType:"text"}));}catch(y){m.status="error",m.body=y?.error??null,console.error("ticket: sendTicket failed",y);}return m}static \u0275fac=function(i){return new(i||t)};static \u0275prov=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function ei(t,n){t&1&&(sT(0),TT(1,"translate")),t&2&&Cl(" ",_T(1,1,"ticketDialog.steps.uploadProgress.uploading")," ");}function ti(t,n){t&1&&(sT(0),TT(1,"translate")),t&2&&Cl(" ",_T(1,1,"ticketDialog.steps.send.awaitingSendMessage")," ");}function ii(t,n){if(t&1&&(vs(0,"div",0),jg(1,"mat-progress-spinner",3),vs(2,"p",4),pC(3,ei,2,3)(4,ti,2,3),yl()()),t&2){let e=xC();mI(),Lg("diameter",44),mI(2),hC(e.uploading()?3:4);}}function ni(t,n){if(t&1){let e=TC();vs(0,"div",1)(1,"span",5)(2,"mat-icon",6),sT(3,"check_circle"),yl()(),vs(4,"h3",4),sT(5),TT(6,"translate"),yl(),vs(7,"p",7),sT(8),TT(9,"translate"),yl(),vs(10,"p",8),sT(11),yl(),vs(12,"p",9),sT(13),TT(14,"translate"),yl(),vs(15,"div",10)(16,"button",11),zg("click",function(){Of(e);let a=xC();
3return kf(a.dismiss.emit())}),sT(17),TT(18,"translate"),yl()()();}if(t&2){let e=xC();mI(5),am(_T(6,5,"ticketDialog.steps.send.sentWithSuccess")),mI(3),am(_T(9,7,"ticketDialog.outcome.nextSteps")),mI(3),am(e.email()),mI(2),am(_T(14,9,"ticketDialog.outcome.inboxHint")),mI(4),Cl(" ",_T(18,11,"closeBtn")," ");}}function oi(t,n){if(t&1){let e=TC();vs(0,"div",2)(1,"span",12)(2,"mat-icon",6),sT(3,"error"),yl()(),vs(4,"h3",4),sT(5),TT(6,"translate"),yl(),vs(7,"p",7),sT(8),TT(9,"translate"),yl(),vs(10,"p",13),sT(11),TT(12,"translate"),yl(),vs(13,"div",10)(14,"button",11),zg("click",function(){Of(e);let a=xC();return kf(a.retry.emit())}),sT(15),TT(16,"translate"),yl(),vs(17,"button",14),zg("click",function(){Of(e);let a=xC();return kf(a.dismiss.emit())}),sT(18),TT(19,"translate"),yl()()();}t&2&&(mI(5),am(_T(6,5,"ticketDialog.steps.send.error.failedToSend")),mI(3),Cl(" ",_T(9,7,"ticketDialog.steps.send.error.failedExplanation")," "),mI(3),Cl(" ",_T(12,9,"ticketDialog.steps.send.error.sorryMessage")," "),mI(4),Cl(" ",_T(16,11,"ticketDialog.outcome.retry")," "),mI(3),Cl(" ",_T(19,13,"closeBtn")," "));}var It=(()=>{class t{state=nB.required();email=nB("");uploading=nB(false);retry=tB();dismiss=tB();static \u0275fac=function(i){return new(i||t)};static \u0275cmp=Gw({type:t,selectors:[["app-ticket-outcome"]],inputs:{state:[1,"state"],email:[1,"email"],uploading:[1,"uploading"]}
3,outputs:{retry:"retry",dismiss:"dismiss"},decls:3,vars:1,consts:[["role","status","aria-live","polite",1,"outcome","outcome--sending"],["role","status","aria-live","polite",1,"outcome"],["role","alert",1,"outcome"],["mode","indeterminate",3,"diameter"],[1,"outcome__title"],[1,"outcome__icon","outcome__icon--success"],["aria-hidden","true"],[1,"outcome__body"],[1,"outcome__email"],[1,"outcome__hint"],[1,"outcome__actions"],["mat-flat-button","","type","button",3,"click"],[1,"outcome__icon","outcome__icon--error"],[1,"outcome__body","outcome__body--muted"],["mat-button","","type","button",3,"click"]],template:function(i,a){if(i&1&&pC(0,ii,5,2,"div",0)(1,ni,19,13,"div",1)(2,oi,20,15,"div",2),i&2){let m;hC((m=a.state())==="sending"?0:m==="sent"?1:m==="failed"?2:-1);}},dependencies:[hi$1,fi$1,yt,wt$1,J,Z,tt],styles:["@keyframes _ngcontent-%COMP%_onboarding-fade-rise{0%{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}@keyframes _ngcontent-%COMP%_onboarding-pop{0%{opacity:0;transform:scale(.5)}70%{opacity:1;transform:scale(1.12)}to{opacity:1;transform:scale(1)}}@keyframes _ngcontent-%COMP%_onboarding-grow-down{0%{transform:scaleY(0)}to{transform:scaleY(1)}}.outcome[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-height:320px;padding:32px 24px;text-align:center}.outcome--sending[_ngcontent-%COMP%]{gap:20px}.outcome__icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:50%;animation:_ngcontent-%COMP%_onboarding-pop .3s cubic-bezier(.2,0,0,1) 0s both}@media(prefers-reduced-motion:reduce){.outcome__icon[_ngcontent-%COMP%]{animation:none}}.outcome__icon[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{width:40px;height:40px;font-size:40px;line-height:40px}.outcome__icon--success[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--app-status-success) 14%,transparent)}.outcome__icon--success[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--app-status-success)}.outcome__icon--error[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--app-status-error) 14%,transparent)}.outcome__icon--error[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--app-status-error)}.outcome__title[_ngcontent-%COMP%]{margin:0;font-size:18px;font-weight:600;line-height:1.3;color:var(--mat-sys-on-surface);animation:_ngcontent-%COMP%_onboarding-fade-rise .4s cubic-bezier(.2,0,0,1) .06s both}@media(prefers-reduced-motion:reduce){.outcome__title[_ngcontent-%COMP%]{animation:none}}.outcome__body[_ngcontent-%COMP%]{max-width:44ch;margin:0;font-size:14px;line-height:1.5;color:var(--mat-sys-on-surface-variant);animation:_ngcontent-%COMP%_onboarding-fade-rise .4s cubic-bezier(.2,0,0,1) .12s both}@media(prefers-reduced-motion:reduce){.outcome__body[_ngcontent-%COMP%]{animation:none}}.outcome__email[_ngcontent-%COMP%]{max-width:100%;margin:0;overflow-wrap:anywhere;font-size:15px;font-weight:600;color:var(--mat-sys-on-surface);animation:_ngcontent-%COMP%_onboarding-fade-rise .4s cubic-bezier(.2,0,0,1) .14s both}@media(prefers-reduced-motion:reduce){.outcome__email[_ngcontent-%COMP%]{animation:none}}.outcome__body--muted[_ngcontent-%COMP%], .outcome__hint[_ngcontent-%COMP%]{max-width:44ch;margin:0;font-size:13px;line-height:1.5;color:color-mix(in srgb,var(--mat-sys-on-surface) 55%,transparent)}.outcome__hint[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_onboarding-fade-rise .4s cubic-bezier(.2,0,0,1) .16s both}@media(prefers-reduced-motion:reduce){.outcome__hint[_ngcontent-%COMP%]{animation:none}}.outcome__actions[_ngcontent-%COMP%]{display:flex;gap:8px;margin-top:12px;animation:_ngcontent-%COMP%_onboarding-fade-rise .4s cubic-bezier(.2,0,0,1) .18s both}@media(prefers-reduced-motion:reduce){.outcome__actions[_ngcontent-%COMP%]{animation:none}}"]})}return t})();function Pt(t,n){return {accountId:n.accountId,accountEnvironment:n.accountEnvironment,accountStatus:n.accountStatus,category:t.category,department:t.department,type:t.type,subtype:t.subtype,name:t.name,clientDepartment:t.clientDepartment,email:t.email,description:t.description,phone:t.phone,product:{providerNamespace:t.providerNamespace,invoiceId:t.invoiceId,companyId:t.companyId,federalTaxNumber:n.federalTaxNumber,queryParameter:t.queryParameter,naturalPersonbirthDate:t.naturalPersonbirthDate,queryDate:t.queryDate}}}function Mt(t,n,e,i){let a=[...t],m=0,y=false;for(let M of n){if(!i.includes(M.type.toLowerCase())){m+=1;continue}if(a.length>=e){y=true;continue}a.push(M);}return {files:a,rejected:m,overflowed:y}}function Et(t){return t<1024?`${t} B`:t<1024*1024?`${Math.round(t/1024)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function ai(t,n){return t?t.length<=n?t:`${t.slice(0,n)}\u2026`:""}function ri(t){return [...t].sort((n,e)=>(e$1(n)??"").localeCompare(e$1(e)??"")).map(n=>({code:n.id,name:ai(e$1(n),80),document:n.federalTaxNumber?c(n.federalTaxNumber):"",federalTaxNumber:n.federalTaxNumber}))}
3async function te(t,n=""){let{companies:e}=await t(ci(n));return ri(e)}function Ft(t){return [t.name,t.document].filter(Boolean).join(" - ")}function ci(t){let n={limit:50};if(!t)return n;let e=t.replace(/\D/g,"");return n.search=e.length===11||e.length===14?e:t,n}var wt=[{id:"classify",labelKey:"ticketDialog.phases.classify"},{id:"details",labelKey:"ticketDialog.phases.details"}],ie=["category","providerNamespace","department","type","subtype"],ne=["companyId","queryParameter","queryDate","naturalPersonbirthDate","description","name","email","clientDepartment","phone"],Ot={type:"",subtype:"",companyId:"",invoiceId:"",queryParameter:"",phone:"",queryDate:null,naturalPersonbirthDate:null};var oe=Object.fromEntries(Ct.map(t=>[T(t),t])),Nt=["nfeio_integration","Planilha","API"];function F(t,n){return kt[t].map(e=>({code:e.code,name:n(e.name)}))}function li(t){let n=e=>{let i=Nt.indexOf(e);return i===-1?Nt.length:i};return [...t].sort((e,i)=>n(e.code)-n(i.code)||e.name.localeCompare(i.name))}function Bt(t){return {categories:F("categories",t),departments:F("departments",t),clientDepartments:F("clientDepartment",t),financialTypes:F("financialProblemSubtypes",t),technicalTypes:F("technicalProblemSubtypes",t),dataQuerySubtypes:F("dataQuerySubtypes",t),serviceInvoiceSubtypes:F("DFeTech.ServiceInvoice.Subtypes",t),productInvoiceSubtypes:F("DFeTech.ProductInvoice.Subtypes",t),consumerInvoiceSubtypes:F("DFeTech.ConsumerInvoice.Subtypes",t),integrationSubtypes:li(F("integrationSubtypes",t)),fiscalSubtypes:F("fiscalSubtypes",t)}}function At(t,n){return Object.entries(t??{}).filter(([e,i])=>!!oe[e]&&!!i).map(([e])=>({code:oe[e],name:n(`account.providers.tableBody.${oe[e]}`)})).sort((e,i)=>e.name.localeCompare(i.name))}var Vt=[{code:"Problema",icon:"report_problem",titleKey:"enums.ticket.categories.problem",subtitleKey:"ticketDialog.help.categoryProblem"},{code:"D\xFAvidas",icon:"help_outline",titleKey:"enums.ticket.categories.doubt",subtitleKey:"ticketDialog.help.categoryDoubt"},{code:"Cancelamento",icon:"cancel",titleKey:"enums.ticket.categories.cancellation",subtitleKey:"ticketDialog.help.categoryCancellation"}],qt=[{code:"Faturamento",icon:"receipt_long",titleKey:"enums.ticket.departments.financial",subtitleKey:"ticketDialog.help.departmentFinancial"},{code:"Tecnico",icon:"code",titleKey:"enums.ticket.departments.technical",subtitleKey:"ticketDialog.help.departmentTechnical"},{code:"Comercial",icon:"business_center",titleKey:"enums.ticket.departments.comercial",subtitleKey:"ticketDialog.help.departmentCommercial"}],si=[{labelKey:"ticketDialog.productGroups.issuing",matches:t=>t.startsWith("DFeTech")&&!t.includes(".Inbound")},{labelKey:"ticketDialog.productGroups.inbound",matches:t=>t.includes(".Inbound")},{labelKey:"ticketDialog.productGroups.queries",matches:t=>z(t)}];function Rt(t){return si.map(n=>({labelKey:n.labelKey,options:t.filter(e=>n.matches(e.code))})).filter(n=>n.options.length>0)}function z(t){return (t||"").includes("DataTech")}function ae(t,n){return !t||!n?false:t!=="Cancelamento"&&n!=="Comercial"}function re(t,n){return n==="Tecnico"&&t!=="Cancelamento"}function Lt(t,n){return n==="Faturamento"?t.financialTypes:t.technicalTypes}function ce(t,n,e){let i=e||"";return n==="integracoes"?t.integrationSubtypes:n==="fiscal"?t.fiscalSubtypes:z(i)?t.dataQuerySubtypes:i.includes("Service")?t.serviceInvoiceSubtypes:i.includes("Product")?t.productInvoiceSubtypes:i.includes("Consumer")?t.consumerInvoiceSubtypes:[]}function Kt(t){return t==="Faturamento"?"ticketDialog.ask.typeFinancial":"ticketDialog.ask.typeTechnical"}function zt(t){return t==="integracoes"?"ticketDialog.ask.subtypeIntegration":t==="fiscal"?"ticketDialog.ask.subtypeFiscal":"ticketDialog.ask.subtype"}function $t(t){let n=t||"",e=n==="DataTech.Batch"?"DataTech.ProductInvoice":n;return Dt.find(i=>i.type===e)??null}var mi=t=>({limit:t}),$=(t,n)=>n.code,di=(t,n)=>n.labelKey,ui=(t,n)=>n.name+n.size;function _i(t,n){if(t&1){let e=TC();vs(0,"app-ticket-outcome",8),zg("retry",function(){Of(e);let a=xC();return kf(a.retry())})("dismiss",function(){Of(e);let a=xC();return kf(a.close())}),yl();}if(t&2){let e=xC();Lg("appRevealScroll",true)("state",n)("email",e.current().email??"")("uploading",e.uploading());}}function fi(t,n){if(t&1){let e=TC();vs(0,"app-intent-card",15),zg("cardClick",function(){let a=Of(e).$implicit,m=xC(3);return kf(m.form.controls.category.setValue(a.code))}),yl();}if(t&2){let e=n.$implicit,i=xC(3);Lg("compact",true)("icon",e.icon)("titleKey",e.titleKey)("subtitleKey",e.subtitleKey)("selected",i.current().category===e.code);}}function gi(t,n){if(t&1&&(vs(0,"mat-option",19),sT(1),yl()),t&2){let e=n.$implicit;Lg("value",e.code),mI(),am(e.name);}}function hi(t,n){if(t&1&&(vs(0,"mat-optgroup",18),TT(1,"translate"),yC(2,gi,2,2,"mat-option",19,$),yl()),t&2){let e=n.$implicit;Lg("label",_T(1,1,e.labelKey)),mI(2),vC(e.options);}}function yi(t,n){if(t&1&&(vs(0,"section",11)(1,"h3",12),sT(2),TT(3,"translate"),yl(),vs(4,"mat-form-field",16)(5,"mat-label"),sT(6),TT(7,"translate"),yl(),vs(8,"mat-select",17),yC(9,hi,4,3,"mat-optgroup",18,di),yl(),nw(),vs(11,"mat-error"),sT(12),TT(13,"translate"),yl()()()),t&2){let e=xC(3);Lg("appRevealScroll",e.autoReveal()),mI(2),am(_T(3,4,"ticketDialog.ask.product")),mI(4),am(_T(7,6,"ticketDialog.steps.basicData.inputs.product.label")),mI(2),ow(),mI(),vC(e.productGroups()),mI(3),am(_T(13,8,"validations.required"));}}function bi(t,n){if(t&1){let e=TC();vs(0,"app-intent-card",15),zg("cardClick",function(){let a=Of(e).$implicit,m=xC(4);return kf(m.form.controls.department.setValue(a.code))}),yl();}if(t&2){let e=n.$implicit,i=xC(4);Lg("compact",true)("icon",e.icon)("titleKey",e.titleKey)("subtitleKey",e.subtitleKey)("selected",i.current().department===e.code);}}function vi(t,n){if(t&1&&(vs(0,"section",11)(1,"h3",12),sT(2),TT(3,"translate"),yl(),vs(4,"div",13),yC(5,bi,1,5,"app-intent-card",14,$),yl()()),t&2){let e=xC(3);Lg("appRevealScroll",e.autoReveal()),mI(2),am(_T(3,2,"ticketDialog.ask.department")),mI(3),vC(e.departmentCards);}}function xi(t,n){if(t&1){let e=TC();vs(0,"section",11)(1,"h3",12),sT(2),TT(3,"translate"),yl(),vs(4,"app-choice-list",20),TT(5,"translate"),zg("valueChange",function(a){Of(e);let m=xC(3);return kf(m.form.controls.type.setValue(a))}),yl()();}if(t&2){let e=xC(3);Lg("appRevealScroll",e.autoReveal()),mI(2),am(_T(3,6,e.typeAskKey())),mI(2),Lg("options",e.typeOptions())("value",e.current().type)("invalid",e.form.controls.type.touched&&e.form.controls.type.invalid)("ariaLabel",_T(5,8,e.typeAskKey()));}}function Ci(t,n){if(t&1){let e=TC();vs(0,"section",11)(1,"h3",12),sT(2),TT(3,"translate"),yl(),vs(4,"app-choice-list",20),TT(5,"translate"),zg("valueChange",function(a){Of(e);let m=xC(3);return kf(m.form.controls.subtype.setValue(a))}),yl()();}if(t&2){let e=xC(3);Lg("appRevealScroll",e.autoReveal()),mI(2),am(_T(3,6,e.subtypeAskKey())),mI(2),Lg("options",e.subtypeOptions())("value",e.current().subtype)("invalid",e.form.controls.subtype.touched&&e.form.controls.subtype.invalid)("ariaLabel",_T(5,8,e.subtypeAskKey()));}}function ki(t,n){if(t&1&&(vs(0,"section",11)(1,"h3",12),sT(2),TT(3,"translate"),yl(),vs(4,"div",13),yC(5,fi,1,5,"app-intent-card",14,$),yl()(),pC(7,yi,14,10,"section",11),pC(8,vi,7,4,"section",11),pC(9,xi,6,10,"section",11),pC(10,Ci,6,10,"section",11)),t&2){let e=xC(2);Lg("appRevealScroll",true),mI(2),am(_T(3,6,"ticketDialog.ask.category")),mI(3),vC(e.categoryCards),mI(2),hC(e.showProduct()?7:-1),mI(),hC(e.showDepartment()?8:-1),mI(),hC(e.showType()?9:-1),mI(),hC(e.showSubtype()?10:-1);}}function Di(t,n){if(t&1&&(vs(0,"span",38),sT(1),yl()),t&2){let e=xC().$implicit;mI(),am(e.document);}}function Si(t,n){if(t&1&&(vs(0,"mat-option",19)(1,"span",36)(2,"span",37),sT(3),yl(),pC(4,Di,2,1,"span",38),yl()()),t&2){let e=n.$implicit;Lg("value",e),mI(3),am(e.name),mI(),hC(e.document?4:-1);}}function Ti(t,n){t&1&&(vs(0,"p",35),sT(1),TT(2,"translate"),yl()),t&2&&(mI(),am(_T(2,1,"validations.required")));}function Ii(t,n){if(t&1){let e=TC();vs(0,"section",11)(1,"h3",12),sT(2),TT(3,"translate"),yl(),vs(4,"div",28)(5,"mat-form-field")(6,"mat-label"),sT(7),TT(8,"translate"),yl(),jg(9,"input",32),TT(10,"translate"),nw(),vs(11,"mat-autocomplete",33,0),zg("optionSelected",function(a){Of(e);let m=xC(3);return kf(m.onCompanySelected(a))}),yC(13,Si,5,3,"mat-option",19,$),yl()(),vs(15,"mat-form-field")(16,"mat-label"),sT(17),TT(18,"translate"),yl(),jg(19,"input",34),nw(),yl()(),pC(20,Ti,3,3,"p",35),yl();}if(t&2){let e=jC(12),i=xC(3);Lg("appRevealScroll",true),mI(2),am(_T(3,9,"ticketDialog.ask.context")),mI(5),am(_T(8,11,"ticketDialog.steps.advancedData.inputs.company.label")),mI(2),Lg("placeholder",_T(10,
313,"ticketDialog.steps.advancedData.inputs.company.searchPlaceholder"))("formControl",i.companySearchCtrl)("matAutocomplete",e),ow(),mI(2),Lg("displayWith",i.displayCompany),mI(2),vC(i.companies()),mI(4),am(_T(18,15,"ticketDialog.steps.advancedData.inputs.invoiceId.label")),mI(2),ow(),mI(),hC(i.form.controls.companyId.touched&&i.form.controls.companyId.invalid?20:-1);}}function Pi(t,n){if(t&1&&(vs(0,"mat-form-field")(1,"mat-label"),sT(2),TT(3,"translate"),yl(),jg(4,"input",42),nw(),jg(5,"mat-datepicker-toggle",41)(6,"mat-datepicker",null,2),vs(8,"mat-error"),sT(9),TT(10,"translate"),yl()()),t&2){let e=jC(7),i=xC(4);mI(2),am(_T(3,5,"ticketDialog.steps.advancedData.inputs.naturalPersonbirthDate.label")),mI(2),Lg("matDatepicker",e)("max",i.maxDate),ow(),mI(),Lg("for",e),mI(4),am(_T(10,7,"validations.required"));}}function Mi(t,n){if(t&1&&(vs(0,"section",11)(1,"h3",12),sT(2),TT(3,"translate"),yl(),vs(4,"div",28)(5,"mat-form-field")(6,"mat-label"),sT(7),TT(8,"translate"),yl(),jg(9,"input",39),nw(),vs(10,"mat-error"),sT(11),TT(12,"translate"),yl()(),vs(13,"mat-form-field")(14,"mat-label"),sT(15),TT(16,"translate"),yl(),jg(17,"input",40),nw(),jg(18,"mat-datepicker-toggle",41)(19,"mat-datepicker",null,1),vs(21,"mat-error"),sT(22),TT(23,"translate"),yl()(),pC(24,Pi,11,9,"mat-form-field"),yl()()),t&2){let e=jC(20),i=xC(3);Lg("appRevealScroll",true),mI(2),am(_T(3,11,"ticketDialog.ask.context")),mI(5),am(i.queryParameterType()?.name||_T(8,13,"ticketDialog.steps.advancedData.inputs.queryParameter.label")),mI(2),Lg("mask",i.queryParameterType()?.masks?.federalTaxNumber??i.queryParameterType()?.mask??""),ow(),mI(2),am(_T(12,15,"validations.required")),mI(4),am(_T(16,17,"ticketDialog.steps.advancedData.inputs.queryDate.label")),mI(2),Lg("matDatepicker",e)("max",i.maxDate),ow(),mI(),Lg("for",e),mI(4),am(_T(23,19,"validations.required")),mI(2),hC(i.showBirthDate()?24:-1);}}function Ei(t,n){if(t&1){let e=TC();vs(0,"li",43)(1,"mat-icon",44),sT(2,"description"),yl(),vs(3,"span",45),sT(4),yl(),vs(5,"span",46),sT(6),yl(),vs(7,"button",47),TT(8,"translate"),TT(9,"translate"),zg("click",function(){let a=Of(e).$implicit,m=xC(4);return kf(m.removeFile(a))}),vs(10,"mat-icon"),sT(11,"close"),yl()()();}if(t&2){let e=n.$implicit,i=xC(4);mI(4),am(e.name),mI(2),am(i.formatFileSize(e.size)),mI(),Lg("matTooltip",_T(8,4,"ticketDialog.attachments.remove")),Pg("aria-label",_T(9,6,"ticketDialog.attachments.remove"));}}function Fi(t,n){if(t&1&&(vs(0,"ul",27),yC(1,Ei,12,8,"li",43,ui),yl()),t&2){let e=xC(3);mI(),vC(e.files());}}function wi(t,n){t&1&&(sT(0),TT(1,"translate")),t&2&&Cl(" ",_T(1,1,"validations.required")," ");}function Oi(t,n){t&1&&(sT(0),TT(1,"translate")),t&2&&Cl(" ",_T(1,1,"validations.invalidEmail")," ");}function Ni(t,n){if(t&1&&(vs(0,"mat-option",19),sT(1),yl()),t&2){let e=n.$implicit;Lg("value",e.code),mI(),am(e.name);}}function Bi(t,n){t&1&&(vs(0,"mat-form-field")(1,"mat-label"),sT(2),TT(3,"translate"),yl(),jg(4,"input",48),nw(),vs(5,"mat-hint"),sT(6),TT(7,"translate"),yl(),vs(8,"mat-error"),sT(9),TT(10,"translate"),yl()()),t&2&&(mI(2),am(_T(3,3,"register.phone")),mI(2),ow(),mI(2),am(_T(7,5,"ticketDialog.steps.identification.inputs.phone.hint")),mI(3),am(_T(10,7,"validations.ticket.phone")));}function Ai(t,n){if(t&1){let e=TC();pC(0,Ii,21,17,"section",11),pC(1,Mi,25,21,"section",11),vs(2,"section",11)(3,"h3",12),sT(4),TT(5,"translate"),yl(),vs(6,"mat-form-field",16)(7,"mat-label"),sT(8),TT(9,"translate"),yl(),jg(10,"textarea",21),TT(11,"translate"),nw(),vs(12,"mat-error"),sT(13),TT(14,"translate"),yl()()(),vs(15,"section",22)(16,"h3",12),sT(17),TT(18,"translate"),yl(),vs(19,"p",23),sT(20),TT(21,"translate"),yl(),vs(22,"app-file-drop-zone",24),TT(23,"translate"),zg("filesSelected",function(a){Of(e);let m=xC(2);return kf(m.onFilesSelected(a))}),vs(24,"span",25)(25,"mat-icon",26),sT(26,"upload_file"),yl(),sT(27),TT(28,"translate"),yl()(),pC(29,Fi,3,0,"ul",27),yl(),vs(30,"section",22)(31,"h3",12),sT(32),TT(33,"translate"),yl(),vs(34,"div",28)(35,"mat-form-field")(36,"mat-label"),sT(37),TT(38,"translate"),yl(),jg(39,"input",29),nw(),vs(40,"mat-error"),sT(41),TT(42,"translate"),yl()(),vs(43,"mat-form-field")(44,"mat-label"),sT(45),TT(46,"translate"),yl(),jg(47,"input",30),nw(),vs(48,"mat-hint"),sT(49),TT(50,"translate"),yl(),vs(51,"mat-error"),pC(52,wi,2,3)(53,Oi,2,3),yl()(),vs(54,"mat-form-field")(55,"mat-label"),sT(56),TT(57,"translate"),yl(),vs(58,"mat-select",31),yC(
359,Ni,2,2,"mat-option",19,$),yl(),nw(),vs(61,"mat-error"),sT(62),TT(63,"translate"),yl()(),pC(64,Bi,11,9,"mat-form-field"),yl()();}if(t&2){let e=xC(2);hC(e.showCompany()?0:-1),mI(),hC(e.showQuery()?1:-1),mI(),Lg("appRevealScroll",!e.showCompany()&&!e.showQuery()),mI(2),am(_T(5,24,"ticketDialog.ask.describe")),mI(4),am(_T(9,26,"description")),mI(2),Lg("placeholder",_T(11,28,"ticketDialog.ask.describePlaceholder")),ow(),mI(3),am(_T(14,30,"validations.required")),mI(4),am(_T(18,32,"ticketDialog.attachments.title")),mI(3),Cl(" ",ST(21,34,"ticketDialog.attachments.hint",IT(55,mi,e.queueLimit))," "),mI(2),Lg("multiple",true)("accept",e.allowedFileTypes)("disabled",e.queueFull())("ariaLabel",_T(23,37,"ticketDialog.attachments.drop")),mI(5),Cl(" ",_T(28,39,"ticketDialog.attachments.drop")," "),mI(2),hC(e.files().length>0?29:-1),mI(3),am(_T(33,41,"ticketDialog.ask.contact")),mI(5),am(_T(38,43,"forms.account.name")),mI(2),ow(),mI(2),am(_T(42,45,"validations.required")),mI(4),am(_T(46,47,"ticketDialog.steps.identification.inputs.email.label")),mI(2),ow(),mI(2),am(_T(50,49,"ticketDialog.steps.identification.inputs.email.hint")),mI(3),hC(e.form.controls.email.hasError("required")?52:e.form.controls.email.hasError("email")?53:-1),mI(4),am(_T(57,51,"ticketDialog.steps.identification.inputs.clientDepartment.label")),mI(2),ow(),mI(),vC(e.clientDepartments),mI(3),am(_T(63,53,"validations.required")),mI(2),hC(e.isCancellation()?64:-1);}}function Vi(t,n){if(t&1&&(jg(0,"app-journey-steps",9),vs(1,"form",10),pC(2,ki,11,8)(3,Ai,65,57),yl()),t&2){let e=xC();Lg("trail",e.phases)("current",e.phase()),mI(),Lg("formGroup",e.form),mI(),hC(e.phase()==="classify"?2:3);}}function qi(t,n){if(t&1){let e=TC();vs(0,"button",49),zg("click",function(){Of(e);let a=xC(2);return kf(a.close())}),sT(1),TT(2,"translate"),yl(),vs(3,"button",50),zg("click",function(){Of(e);let a=xC(2);return kf(a.goToDetails())}),sT(4),TT(5,"translate"),yl();}t&2&&(mI(),am(_T(2,2,"cancelBtn")),mI(3),Cl(" ",_T(5,4,"nextBtn")," "));}function Ri(t,n){if(t&1){let e=TC();vs(0,"button",49),zg("click",function(){Of(e);let a=xC(2);return kf(a.backToClassify())}),sT(1),TT(2,"translate"),yl(),vs(3,"button",50),zg("click",function(){Of(e);let a=xC(2);return kf(a.send())}),sT(4),TT(5,"translate"),yl();}t&2&&(mI(),Cl(" ",_T(2,2,"returnBtn")," "),mI(3),Cl(" ",_T(5,4,"ticketDialog.steps.identification.sendButton")," "));}function Li(t,n){if(t&1&&(vs(0,"mat-dialog-actions",7),pC(1,qi,6,6)(2,Ri,6,6),yl()),t&2){let e=xC();mI(),hC(e.phase()==="classify"?1:2);}}var Qt=(()=>{class t{fb=m(Tn);dialogRef=m(O);dialogData=m($e,{optional:true});translate=m(z$1);sessionData=m(Sn);user=m(Ce);companiesApi=m(u);notify=m(te$1);ticketApi=m(Tt);maxDate=new Date;queueLimit=5;allowedFileTypes=K.join(",");categoryCards=Vt;departmentCards=qt;formatFileSize=Et;phases=wt;accountId=null;accountEnvironment=null;accountStatus=null;form=this.fb.group({category:["",[pe.required]],providerNamespace:["",[pe.required]],department:["",[pe.required]],type:["",[pe.required]],subtype:["",[pe.required]],invoiceId:[""],companyId:["",[pe.required]],queryParameter:["",[pe.required]],naturalPersonbirthDate:[null,[pe.required]],queryDate:[null,[pe.required]],name:["",[pe.required]],clientDepartment:["",[pe.required]],email:["",[pe.required,pe.email]],phone:["",[pe.required]],description:["",[pe.required]]});companySearchCtrl=new U("");catalog=Bt(e=>this.translate.instant(e));revision=it(0);phase=it("classify");autoReveal=it(true);submitState=it("idle");uploading=it(false);files=it([]);productGroups=it([]);companies=it([]);uploadedFiles=it(null);outcome=Gt$1(()=>{let e=this.submitState();return e==="idle"?null:e});clientDepartments=this.catalog.clientDepartments;current=Gt$1(()=>(this.revision(),this.form.getRawValue()));showProduct=Gt$1(()=>!!this.current().category);showDepartment=Gt$1(()=>!!this.current().providerNamespace);typeOptions=Gt$1(()=>Lt(this.catalog,this.current().department));subtypeOptions=Gt$1(()=>ce(this.catalog,this.current().type,this.current().providerNamespace));showType=Gt$1(()=>!!this.current().department&&ae(this.current().category,this.current().department));showSubtype=Gt$1(()=>!!this.current().type&&this.needsProduct()&&this.subtypeOptions().length>0);typeAskKey=Gt$1(()=>Kt(this.current().department));subtypeAskKey=Gt$1(()=>zt(this.current().type));needsProduct=Gt$1(()=>re(this.current().category,this.current().department));showQuery=Gt$1(()=>this.needsProduct()&&z(this.current().providerNamespace));showCompany=Gt$1(()=>this.needsProduct()&&!this.showQuery());showBirthDate=Gt$1(()=>this.showQuery()&&this.current().providerNamespace==="DataTech.NaturalPerson");queryParameterType=Gt$1(()=>$t(this.current().providerNamespace));isCancellation=Gt$1(()=>this.current().category==="Cancelamento");classifyValid=Gt$1(()=>this.groupValid(ie));detailsValid=Gt$1(()=>this.groupValid(ne));
3isSending=Gt$1(()=>this.submitState()==="sending");queueFull=Gt$1(()=>this.files().length>=this.queueLimit);constructor(){this.form.valueChanges.pipe(p()).subscribe(()=>this.revision.update(e=>e+1)),this.form.controls.category.valueChanges.pipe(p()).subscribe(()=>this.resetDependents("type","subtype")),this.form.controls.department.valueChanges.pipe(p()).subscribe(()=>this.resetDependents("type","subtype")),this.form.controls.providerNamespace.valueChanges.pipe(p()).subscribe(()=>this.resetDependents("subtype")),this.form.controls.type.valueChanges.pipe(p()).subscribe(()=>this.resetDependents("subtype")),this.companySearchCtrl.valueChanges.pipe(Yd(300),p()).subscribe(e=>{typeof e=="string"&&this.searchCompanies(e);});}async ngOnInit(){let e=this.dialogData;this.applySeed(e),this.syncControls(),e?.invoiceId&&this.form.controls.type.setValue("produto"),await this.loadAccountContext();}applySeed(e){e&&(e.invoiceId&&this.form.patchValue({invoiceId:e.invoiceId,category:"Problema",department:"Tecnico"}),e.companyId&&this.form.controls.companyId.setValue(e.companyId),e.providerNamespace&&this.form.controls.providerNamespace.setValue(e.providerNamespace));}async loadAccountContext(){try{let e=await this.sessionData.getCurrentAccount(),i=await this.user.getCurrentUser();this.accountId=e?.id??null,this.accountEnvironment=e?.environment??null,this.accountStatus=e?.status??null,this.form.patchValue({email:i?.email??"",name:i?.name??""});let a=m=>this.translate.instant(m);this.productGroups.set(Rt(At(e?.providers,a)));}catch(e){console.error("ticket-form: init failed",e);}}close(){this.isSending()||this.dialogRef.close();}goToDetails(){if(!this.classifyValid()){this.markGroupTouched(ie);return}this.showCompany()&&this.companies().length===0&&this.loadCompanies(),this.autoReveal.set(false),this.phase.set("details");}backToClassify(){this.autoReveal.set(false),this.phase.set("classify");}send(){if(!this.detailsValid()){this.markGroupTouched(ne);return}this.submitTicket();}retry(){this.submitTicket();}onFilesSelected(e){let i=Mt(this.files(),Array.from(e),this.queueLimit,K);i.rejected>0&&this.notify.error(this.translate.instant("ticketDialog.steps.uploadFiles.invalidFileType")),this.files.set(i.files),this.uploadedFiles.set(null);}removeFile(e){this.files.update(i=>i.filter(a=>a!==e)),this.uploadedFiles.set(null);}onCompanySelected(e){let i=e.option.value;this.form.controls.companyId.setValue(i.code);}displayCompany(e){return e?typeof e=="string"?e:Ft(e):""}control(e){return this.form.get(e)}groupValid(e){return this.revision(),e.every(i=>{let a=this.control(i);return a.disabled||a.valid})}markGroupTouched(e){e.forEach(i=>this.control(i).markAsTouched()),this.revision.update(i=>i+1);}resetDependents(...e){this.autoReveal.set(true),e.forEach(i=>{let a=this.control(i);a.setValue(Ot[i],{emitEvent:false}),a.markAsUntouched();}),this.syncControls();}syncControls(){let{category:e,department:i,providerNamespace:a,type:m}=this.form.getRawValue(),y=re(e,i),M=y&&z(a),Z=y&&!M,J=ce(this.catalog,m,a).length>0;this.toggle("type",ae(e,i)),this.toggle("subtype",y&&J),this.toggle("companyId",Z),this.toggle("queryParameter",M),this.toggle("queryDate",M),this.toggle("naturalPersonbirthDate",M&&a==="DataTech.NaturalPerson"),this.toggle("phone",e==="Cancelamento"),this.revision.update(Ut=>Ut+1);}toggle(e,i){let a=this.control(e);if(i){a.disabled&&a.enable({emitEvent:false});return}a.enabled&&a.disable({emitEvent:false});}async submitTicket(){this.submitState.set("sending"),this.dialogRef.disableClose=true;try{let e=this.ticketApi.serializeTicket(Pt(this.form.getRawValue(),{accountId:this.accountId,accountEnvironment:this.accountEnvironment,accountStatus:this.accountStatus,federalTaxNumber:this.selectedCompanyFederalTaxNumber()})),i=await this.resolveAttachments();i&&(e.files=i);let a=await this.ticketApi.sendTicket(e);this.submitState.set(a.status==="success"?"sent":"failed");}catch(e){console.error("ticket-form: submitTicket failed",e),this.submitState.set("failed");}finally{this.uploading.set(false),this.dialogRef.disableClose=false;}}async resolveAttachments(){let e=this.files();if(e.length===0)return null;let i=this.uploadedFiles();if(i)return i;this.uploading.set(true);let a=await this.ticketApi.uploadTicketAttachments(e,this.accountId??"");return this.uploading.set(false),this.uploadedFiles.set(a),a}async loadCompanies(){try{let e=await te(i=>this.companiesApi.list(i));if(!e.length)return;e.length===1&&(this.form.controls.companyId.setValue(e[0].code),this.companySearchCtrl.setValue(e[0],{emitEvent:!1})),this.companies.set(e);}catch(e){console.error("ticket-form: loadCompanies failed",e);}}async searchCompanies(e){try{this.companies.set(await te(i=>this.companiesApi.list(i),e));}catch(i){console.error("ticket-form: searchCompanies failed",i);}}selectedCompanyFederalTaxNumber(){let e=this.form.controls.companyId.value;return e?this.companies().find(i=>i.code===e)?.federalTaxNumber??null:null}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=Gw({type:t,selectors:[["app-ticket-form-dialog"]],features:[DT([ri$1(),{provide:st,useValue:"pt-BR"}])],decls:13,vars:12,consts:[["companyAuto","matAutocomplete"],["queryDatePicker",""],["birthDatePicker",""],["mat-dialog-title","",1,"ticket-dialog-header","dialog-title-row"],["mat-icon-button","","type","button",3,"click","disabled","matTooltip"],[1,"ticket-dialog-content"],[3,"appRevealScroll","state","email","uploading"],["align","end",1,"ticket-actions"],[3,"retry","dismiss","appRevealScroll","state","email","uploading"],[1,"ticket-phases",3,"trail","current"],[1,"ticket-form",3,"formGroup"],[1,"question",3,"appRevealScroll"],[1,"question__label"],[1,"card-grid"],[3,"compact","icon","titleKey","subtitleKey","selected"],[3,"cardClick","compact","icon","titleKey","subtitleKey","selected"],[1,"full-width"],["formControlName","providerNamespace"],[3,"label"],[3,"value"],[3,"valueChange","options","value","invali
3d","ariaLabel"],["matInput","","formControlName","description","rows","5",3,"placeholder"],[1,"question"],[1,"question__help"],[3,"filesSelected","multiple","accept","disabled","ariaLabel"],[1,"dropzone"],["aria-hidden","true"],[1,"attachments"],[1,"field-grid"],["matInput","","formControlName","name"],["matInput","","type","email","formControlName","email"],["formControlName","clientDepartment"],["matInput","",3,"placeholder","formControl","matAutocomplete"],[3,"optionSelected","displayWith"],["matInput","","formControlName","invoiceId"],["role","alert",1,"field-error"],[1,"company-option"],[1,"company-option__name"],[1,"company-option__doc"],["matInput","","formControlName","queryParameter",3,"mask"],["matInput","","formControlName","queryDate",3,"matDatepicker","max"],["matIconSuffix","",3,"for"],["matInput","","formControlName","naturalPersonbirthDate",3,"matDatepicker","max"],[1,"attachment"],["aria-hidden","true",1,"attachment__icon"],[1,"attachment__name"],[1,"attachment__size"],["mat-icon-button","","type","button",3,"click","matTooltip"],["matInput","","type","tel","formControlName","phone"],["mat-button","","type","button",3,"click"],["mat-flat-button","","type","button",3,"click"]],template:function(i,a){if(i&1&&(vs(0,"h2",3)(1,"span"),sT(2),TT(3,"translate"),yl(),vs(4,"button",4),TT(5,"translate"),TT(6,"translate"),zg("click",function(){return a.close()}),vs(7,"mat-icon"),sT(8,"close"),yl()()(),vs(9,"mat-dialog-content",5),pC(10,_i,1,4,"app-ticket-outcome",6)(11,Vi,4,4),yl(),pC(12,Li,3,1,"mat-dialog-actions",7)),i&2){let m;mI(2),am(_T(3,6,"ticketDialog.title")),mI(2),Lg("disabled",a.isSending())("matTooltip",_T(5,8,"closeBtn")),Pg("aria-label",_T(6,10,"closeBtn")),mI(6),hC((m=a.outcome())?10:11,m),mI(2),hC(a.outcome()?-1:12);}},dependencies:[Bn,kn,Xe,xn,Rn,ln,gn,hn,Ht$1,Nt$1,zt$1,Vt$1,fe,rt,le,de,It$1,Nt$2,dn,ln$1,Si$1,Oi$1,U$1,pt,vt$1,gt,qe,hi$1,fi$1,Tn$1,yt,wt$1,Yt$1,mt,Xn,$n,Da,Ja,Ye,vt,S,Y,X,xt,It,tt],styles:['@keyframes _ngcontent-%COMP%_onboarding-fade-rise{0%{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}@keyframes _ngcontent-%COMP%_onboarding-pop{0%{opacity:0;transform:scale(.5)}70%{opacity:1;transform:scale(1.12)}to{opacity:1;transform:scale(1)}}@keyframes _ngcontent-%COMP%_onboarding-grow-down{0%{transform:scaleY(0)}to{transform:scaleY(1)}}.ticket-dialog-content[_ngcontent-%COMP%]{max-height:min(68vh,620px);padding-top:16px}.ticket-phases[_ngcontent-%COMP%]{display:block;padding-bottom:24px;margin-bottom:24px;border-bottom:1px solid var(--mat-sys-outline-variant)}.ticket-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:28px}.question[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;animation:_ngcontent-%COMP%_onboarding-fade-rise .4s cubic-bezier(.2,0,0,1) 0s both}@media(prefers-reduced-motion:reduce){.question[_ngcontent-%COMP%]{animation:none}}.question__label[_ngcontent-%COMP%]{position:sticky;top:0;z-index:2;margin:0;padding:8px 0 10px;background-color:var(--mat-dialog-container-color, var(--mat-sys-surface));font-size:15px;font-weight:600;line-height:1.35;color:var(--mat-sys-on-surface)}.question__label[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:auto 0 100%;height:20px;background-color:inherit;pointer-events:none}.question__help[_ngcontent-%COMP%]{margin:-6px 0 0;font-size:13px;line-height:1.45;color:var(--mat-sys-on-surface-variant)}.card-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px}.field-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:4px 20px;align-items:start}.full-width[_ngcontent-%COMP%]{width:100%}.company-option[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:8px;min-width:0}.company-option__name[_ngcontent-%COMP%]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.company-option__doc[_ngcontent-%COMP%]{flex-shrink:0;font-size:12px;font-variant-numeric:tabular-nums;color:var(--mat-sys-on-surface-variant)}.field-error[_ngcontent-%COMP%]{margin:0;font-size:12px;color:var(--mat-sys-error)}.dropzone[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:8px;padding:20px 16px;font-size:14px;color:var(--mat-sys-on-surface-variant)}.dropzone[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.attachments[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;margin:0;padding:0;list-style:none}.attachment[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:4px 4px 4px 12px;border:1px solid var(--mat-sys-outline-variant);border-radius:2px;background-color:var(--app-panel-bg);font-size:13px;animation:_ngcontent-%COMP%_onboarding-fade-rise .4s cubic-bezier(.2,0,0,1) 0s both}@media(prefers-reduced-motion:reduce){.attachment[_ngcontent-%COMP%]{animation:none}}.attachment__icon[_ngcontent-%COMP%]{flex-shrink:0;width:18px;height:18px;font-size:18px;line-height:18px;color:var(--mat-sys-on-surface-variant)}.attachment__name[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--mat-sys-on-surface)}.attachment__size[_ngcontent-%COMP%]{flex-shrink:0;font-variant-numeric:tabular-nums;color:var(--mat-sys-on-surface-variant)}.ticket-actions[_ngcontent-%COMP%]{gap:8px;padding:12px 24px 16px}']})}return t})();function _o(t,n){return t.open(Qt,{width:"920px",maxWidth:"calc(100vw - 32px)",data:n??null})}export{_o as openTicketDialog}; 4//# debugId=fa24762d-c8ce-5dca-9ef0-b8a706ffba89
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.