PageSourceSearch

https://app.dapta.ai/chunk-6VATPP6D.js

js dapta.ai collected 2026-09-29 00:05:11 UTC 80,769 bytes, 2 lines download raw bytes

1import{a as H,b as oe}from"./chunk-L65CFOGM.js";import{a as be,b as we,c as It}from"./chunk-D3OIRDRZ.js";import"./chunk-YZZ6CKB3.js";import{b as Pt}from"./chunk-PEJNXZNR.js";import{a as Ot}from"./chunk-FB4OBYQE.js";import{C as bt,G as wt,I as Te,Ka as St,Ta as De,u as Tt,v as ve}from"./chunk-KMATS7MR.js";import"./chunk-SOWBZJHY.js";import"./chunk-5PPGBWZY.js";import"./chunk-AJIXN4TP.js";import{e as yt}from"./chunk-W2WMVSUV.js";import"./chunk-Z5IDDGYY.js";import"./chunk-QPSR7IOW.js";import"./chunk-EW7HN6J6.js";import"./chunk-77A7GLJT.js";import"./chunk-NU5RVLAA.js";import"./chunk-4ZVJIHHJ.js";import"./chunk-FQIDAGIB.js";import{a as xe}from"./chunk-3RVQ53QU.js";import"./chunk-7ZBURVDA.js";import"./chunk-7SYR2AQN.js";import"./chunk-2WBHW3LQ.js";import"./chunk-6L2VFEGZ.js";import"./chunk-CZWE744E.js";import"./chunk-QDRIPFVV.js";import"./chunk-HH446EG3.js";import"./chunk-X4XHRKJK.js";import"./chunk-OUVDWREM.js";import{b as Et,c as Mt}from"./chunk-WWYUABQM.js";import"./chunk-DGOHN5MI.js";import"./chunk-P6TIZVOU.js";import"./chunk-DRMZ367D.js";import"./chunk-UVNRP7DL.js";import"./chunk-MPKK35XZ.js";import"./chunk-4HVR5UFO.js";import{f as ut,g as ge}from"./chunk-CLSAFS5Q.js";import"./chunk-CJXEOJFV.js";import"./chunk-DGJ3RKEZ.js";import"./chunk-4WAUMBH6.js";import{a as ht,b as _t}from"./chunk-DAYZHUJE.js";import"./chunk-KH7K5DGA.js";import"./chunk-THXGMAON.js";import{f as xt}from"./chunk-CBOWKMQR.js";import{a as mt,b as dt,c as he}from"./chunk-2EYN7LRM.js";import{b as ct}from"./chunk-XQXSI2MI.js";import{a as ie}from"./chunk-JZVF4UFD.js";import{a as Q}from"./chunk-EBRNEVEB.js";import{c as ae}from"./chunk-JFIIL3O5.js";import{a as ft}from"./chunk-QCRLQ6PS.js";import"./chunk-A3CGAD34.js";import{a as ue,b as fe}from"./chunk-ACAFCOC3.js";import"./chunk-VO63BEYI.js";import{a as G}from"./chunk-XXUVMEHX.js";import{a as z}from"./chunk-5WAKHBSE.js";import{a as Ce}from"./chunk-5QZ3NKAH.js";import"./chunk-TRRJULT5.js";import"./chunk-SIVW2O5K.js";import{a as Ct}from"./chunk-IXYALPCC.js";import{a as vt}from"./chunk-X25PQIQX.js";import"./chunk-ATONT6NO.js";import{a as gt,b as _e}from"./chunk-6KLVNBIT.js";import{a as pt}from"./chunk-YLMGPHJT.js";import"./chunk-2INMHT5S.js";import{b as W}from"./chunk-TW5YOGRO.js";import"./chunk-AV4I7H6P.js";import{B as lt,C as st,E as R,F as B,c as it,d as O,g as $,h as q,i as F,k as y,l as at,m as X,q as K,r as ot,s as rt,t as Y}from"./chunk-3G75FYOC.js";import{d as ne,f as A,g as k}from"./chunk-MIJHCTDG.js";import{U as nt}from"./chunk-PZHDZNOO.js";import"./chunk-ICVBEL6B.js";import{a as V}from"./chunk-GGODJQRR.js";import"./chunk-4ZHAVEY3.js";import"./chunk-EVJHW347.js";import"./chunk-ERNNOIEA.js";import"./chunk-BFJOYHTI.js";import"./chunk-SRQR6N6L.js";import"./chunk-7QCXACDV.js";import"./chunk-PQEV5SKX.js";import{Ac as me,Db as S,Fb as v,Ga as je,Hb as _,Kd as te,La as i,Lb as qe,Ma as Ue,Mb as Xe,Md as U,Nb as Ke,Pd as Fe,Rb as J,Sb as Ye,Ta as C,Ub as Ae,Vc as tt,Wa as I,Wb as p,Wc as j,Xa as pe,Xb as w,Xc as L,Yb as g,Zb as Qe,ab as x,ac as Je,ba as se,bc as Ze,cc as et,fd as de,gc as D,kb as We,la as T,lc as ke,ma as b,mb as $e,mc as ee,md as N,rb as c,sb as o,tb as l,ub as f,vc as m,wc as d,xa as He,xc as ce,yb as Ie,zb as Ne}from"./chunk-NMIDHYRA.js";import{a as Ge,b as ze,k as E}from"./chunk-ZOCHBAGS.js";function Rt(e,s){e&1&&f(0,"dapta-loader")}var Nt=(()=>{let s=class s{constructor(t,n,r){this.authService=t,this.daptaPopUpController=n,this.channelsService=r,this.loading=!1,this.form=new F({legal_company_name:new y("",[O.required]),tax_id:new y("",[O.required]),has_meta_business_account:new y(null),is_number_linked_already:new y(null)})}ngOnInit(){}scheduleMeeting(){return E(this,null,function*(){if(this.form.invalid){this.form.markAllAsTouched();return}this.loading=!0;try{let t=this.authService.userOrganization,n={organization_id:t.id,organization_name:t.name,legal_company_name:this.form.value.legal_company_name||"",tax_id:this.form.value.tax_id||"",has_meta_business_account:this.form.value.has_meta_business_account||!1,is_number_linked_already:this.form.value.is_number_linked_already||!1};yield this.channelsService.sendWhatsAppFormData(n),window.open("https://calendly.com/dapta-onboarding/onboarding-pro-clients-initial-meeting-bc","_blank"),this.daptaPopUpController.closePopUp()}catch(t){console.error("Error sending form data:",t)}finally{this.loading=!1}})}close(){this.daptaPopUpController.closePopUp()}};s.\u0275fac=function(n){return new(n||s)(C(W),C(Q),C(H))},s.\u0275cmp=I({type:s,selectors:[["app-company-connection-form"]],decls:86,vars:58,consts:[[1,"flex","flex-column","h-100","relative","company-connection-form-container"],[1,"header","flex","flex-row"],[1,"header__title-icon","flex","flex-row","align-items-center"],[1,"header__title"],[1,"company-connection-form-content","flex","flex-column","h-100","overflow-y-auto",3,"formGroup"],[1,"text"],[1,"margin-top--16"],[1,"text","company-connection-form-label"],[1,"text-danger"],["daptaTooltip","",1,"pi","pi-question-circle"],["width","200px","maxHeightContent","250px"],[1,"text-align--center","text--14","padding--8","line-height--16","display--block"],[1,"margin-top--8","w-full"],["pInputText","","type","text","formControlName","legal_company_name",1,"w-full",3,"placeholder"],["pInputText","","type","text","formControlName","tax_id",1,"w-full",3,"placeholder"],[1,"flex","flex-row","gap--16"],[1,"flex","flex-row","align-items-center","gap--8"],["name","has_meta_business_account","formControlName","has_meta_business_account",3,"value"],["name","is_number_linked_already","formControlName","is_number_linked_already",3,"value"],[1,"footer-buttons","flex","flex-row","justify-content-end","margin-top--16"],["variant","text","styleClass","cancel-button",3,"onClick","label"],[3,"onClick","label","disabled"]],template:function(n,r){n&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),p(4),m(5,"translate"),l()()(),o(6,"form",4)(7,"p",5),p(8),m(9,"translate"),l(),o(10,"div",6)(11,"div",7),p(12),m(13,"translate"),o(14,"span",8),p(15,"*"),l(),p(16," \xA0 "),o(17,"span",9)(18,"dapta-tooltip-content",10)(19,"span",11),p(20),m(21,"translate"),l()()()(),o(22,"div",12),f(23,"input",13),m(24,"translate"),l()(),o(25,"div",6)(26,"div",7),p(27),m(28,"translate"),o(29,"span",8),p(30,"*"),l(),p(31," \xA0 "),o(32,"span",9)(33,"dapta-tooltip-content",10)(34,"span",11),p(35),m(36,"translate"),l()()()(),o(37,"div",12),f(38,"input",14),m(39,"translate"),l()(),o(40,"div",6)(41,"div",7),p(42),m(43,"translate"),o(44,"span",8),p(45,"*"),l()(),o(46,"div",12)(47,"div",15)(48,"div",16)(49,"p-radioButton",17),p(50,"Yes"),l(),o(51,"label",5),p(
152),m(53,"translate"),l()(),o(54,"div",16)(55,"p-radioButton",17),p(56,"No"),l(),o(57,"label",5),p(58),m(59,"translate"),l()()()()(),o(60,"div",6)(61,"div",7),p(62),m(63,"translate"),o(64,"span",8),p(65,"*"),l()(),o(66,"div",12)(67,"div",15)(68,"div",16)(69,"p-radioButton",18),p(70,"Yes"),l(),o(71,"label",5),p(72),m(73,"translate"),l()(),o(74,"div",16)(75,"p-radioButton",18),p(76,"No"),l(),o(77,"label",5),p(78),m(79,"translate"),l()()()()()(),We(80,Rt,1,0,"dapta-loader"),o(81,"div",19)(82,"dui-button",20),m(83,"translate"),v("onClick",function(){return r.close()}),l(),o(84,"dui-button",21),m(85,"translate"),v("onClick",function(){return r.scheduleMeeting()}),l()()()),n&2&&(i(4),w(d(5,26,"whatsapp-connection")),i(2),c("formGroup",r.form),i(2),w(d(9,28,"to-continue-with-your-whatsapp-setup-fill-in-the-details-below-and-schedule-a-meeting-with-our-support-team")),i(4),g(" ",d(13,30,"legal-company-name")," "),i(8),g(" ",d(21,32,"the-legal-name-of-your-company")," "),i(3),c("placeholder",D(d(24,34,"enter-your-company-name"))),i(4),g(" ",d(28,36,"tax-id-nit")," "),i(8),g(" ",d(36,38,"the-tax-identification-number-of-your-company")," "),i(3),c("placeholder",D(d(39,40,"enter-your-tax-id-nit"))),i(4),g(" ",d(43,42,"do-you-have-a-meta-business-account-with-facebook")," "),i(7),c("value",!0),i(3),w(d(53,44,"COMMON.YES")),i(3),c("value",!1),i(3),w(d(59,46,"COMMON.NO")),i(4),g(" ",d(63,48,"is-the-number-you-will-use-linked-to-another-whatsapp-account")," "),i(7),c("value",!0),i(3),w(d(73,50,"COMMON.YES")),i(3),c("value",!1),i(3),w(d(79,52,"COMMON.NO")),i(2),$e(r.loading?80:-1),i(2),c("label",d(83,54,"COMMON.CANCEL")),i(2),c("label",D(d(85,56,"schedule-meeting")))("disabled",r.form.invalid))},dependencies:[V,xe,ue,fe,_t,ht,z,R,X,it,$,q,B,K,Y,Mt,Et,yt,k,A],styles:[".header[_ngcontent-%COMP%]{padding:16px 24px;position:sticky;background:var(--space-500);top:0;left:0;z-index:1;border-radius:8px}.header__title-icon[_ngcontent-%COMP%]{gap:8px}.header__title[_ngcontent-%COMP%]{font-size:var(--font-size-title)}.company-connection-form-container[_ngcontent-%COMP%]{padding:0}.company-connection-form-content[_ngcontent-%COMP%]{padding:0 24px 8px}.company-connection-form-label[_ngcontent-%COMP%]{font-weight:600}.footer-buttons[_ngcontent-%COMP%]{border-radius:8px;background-color:var(--space-500);position:sticky;bottom:0;left:0;padding:16px 24px;gap:8px}.cancel-button[_ngcontent-%COMP%]{max-width:120px;width:100%;padding:0}.dapta-input__copy-icon[_ngcontent-%COMP%]{color:var(--contrast-50);font-size:var(--font-size-title);padding:5px}.link[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px}.idea-icon-background[_ngcontent-%COMP%]{background-size:100%;background-repeat:no-repeat;object-fit:contain;background-image:var(--bulb-icon-idea-alt);width:14px;height:17px;position:relative;top:1px}"]});let e=s;return e})();function Bt(e,s){if(e&1&&f(0,"img",7),e&2){let a=s.$implicit;c("src",a,je)}}function Gt(e,s){e&1&&(Ie(0),f(1,"dapta-spinner",8),Ne())}function zt(e,s){if(e&1){let a=S();o(0,"dui-button",11),v("onClick",function(){T(a);let n=_(2);return b(n.openConnections())}),p(1),m(2,"translate"),f(3,"dapta-material-icon",12),l()}e&2&&(i(),g(" ",d(2,1,"view-connections")," "))}function Ht(e,s){e&1&&(o(0,"div"),p(1),m(2,"translate"),l()),e&2&&(i(),g(" ",d(2,1,"connected")," "))}function jt(e,s){if(e&1){let a=S();o(0,"dui-button",13),v("onClick",function(){T(a);let n=_(2);return b(n.connect())}),p(1),m(2,"translate"),f(3,"dapta-material-icon",14),l()}e&2&&(i(),g(" ",d(2,1,"WHATSAPP_CREDENTIALS.ADD_CONNECTION")," "))}function Ut(e,s){if(e&1&&(Ie(0),x(1,zt,4,3,"dui-button",9)(2,Ht,3,3,"div",6)(3,jt,4,3,"dui-button",10),Ne()),e&2){let a=_();i(),c("ngIf",(a.channel==null?null:a.channel.connections_count)&&a.canEditChannel()),i(),c("ngIf",!a.canEditChannel()&&(a.channel==null?null:a.channel.connections_count)),i(),c("ngIf",!(a.channel!=null&&a.channel.connections_count)&&a.canEditChannel())}}var ye=(()=>{let s=class s{constructor(t,n,r,h,u){this.router=t,this.authService=n,this.daptaPopUpController=r,this.iamAuthService=h,this.rolesPermissionsService=u,this.reload=new Ue,this.loading=!1,this.token="",this.credentialsExist=!1,this.iamAuthData=null,this.permissionsList=vt,this.canEditChannel=this.rolesPermissionsService.hasSignalPermission(this.permissionsList.TEXT_AGENTS.CHANNELS_WRITE)}ngOnInit(){this.iamAuthData=this.iamAuthService.ngxsAuthState}openConnections(){this.router.navigate(["/agents-studio/channels",this.channel?.id])}connect(){return E(this,null,function*(){let t=this.iamAuthData?.user?.email.endsWith("@daptatech.com")||!1,n=this.channel?.channel_provider==="aldeamo";(yield this.determineConnectionPopup(t,n)).popUpClosed().then(h=>{h?.reload&&this.router.navigate(["/agents-studio/channels",this.channel?.id])})})}determineConnectionPopup(t,n){return!t&&n?this.daptaPopUpController.openPopUp({id:"company-connection-form",component:Nt,styles:{height:"fit-content"},componentProps:{channel:this.channel}}):this.daptaPopUpController.openPopUp({id:"message-bird",component:oe,componentProps:{channel:this.channel,provider:this.channel?.channel_provider,fromChannels:!0,title:`${this.channel?.name} Credentials`},styles:{maxWidth:"600px",maxHeight:"560px",borderRadius:"8px"}})}};s.\u0275fac=function(n){return new(n||s)(C(U),C(W),C(Q),C(nt),C(Ct))},s.\u0275cmp=I({type:s,selectors:[["app-custom-integration"]],inputs:{channel:"channel"},outputs:{reload:"reload"},decls:10,vars:5,consts:[[1,"integration"],[1,"integration__icons-container"],["class","integration__icon",3,"src",4,"ngFor","ngForOf"],[1,"integration__name"],[1,"integration__description"],[1,"integration__actions"],[4,"ngIf"],[1,"integration__icon",3,"src"],["size","20px","weight","2px"],["variant","text","styleClass","dapta-button--w
1hite pointer p-0",3,"onClick",4,"ngIf"],["variant","text","styleClass","pointer p-0",3,"onClick",4,"ngIf"],["variant","text","styleClass","dapta-button--white pointer p-0",3,"onClick"],["iconName","arrow_forward",1,"common-icon"],["variant","text","styleClass","pointer p-0",3,"onClick"],["iconName","power",1,"common-icon"]],template:function(n,r){n&1&&(o(0,"div",0)(1,"div",1),x(2,Bt,1,1,"img",2),l(),o(3,"span",3),p(4),l(),o(5,"span",4),p(6),l(),o(7,"div",5),x(8,Gt,2,0,"ng-container",6)(9,Ut,4,3,"ng-container",6),l()()),n&2&&(i(2),c("ngForOf",r.channel==null?null:r.channel.icons),i(2),g(" ",r.channel==null?null:r.channel.name," "),i(2),g(" ",r.channel==null?null:r.channel.description," "),i(2),c("ngIf",r.loading),i(),c("ngIf",!r.loading))},dependencies:[V,N,j,L,G,Ce,k,A],styles:[".integration[_ngcontent-%COMP%]{position:relative;background-color:var(--space-300);border-radius:16px;padding:24px 16px;margin-bottom:4px;max-width:623px;font-size:var(--font-size-body);font-style:normal;font-weight:var(--font-weight-semibold);height:200px;display:flex;flex-direction:column;gap:8px}.integration__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;margin-top:auto}.integration__name[_ngcontent-%COMP%]{-webkit-line-clamp:1;line-clamp:1;-webkit-box-orient:vertical;box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.integration__description[_ngcontent-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;box-orient:vertical;overflow:hidden;font-weight:var(--font-weight-regular);font-size:var(--font-size-body)}.integration__icons-container[_ngcontent-%COMP%]{display:flex}.integration__icon[_ngcontent-%COMP%]{width:36px;height:36px;min-width:36px;min-height:36px;max-width:36px;max-height:36px;border:3px solid var(--space-300);border-radius:50%;object-fit:contain}.integration__icon[_ngcontent-%COMP%]:not(:first-of-type){margin-left:-8px}.menu-icon[_ngcontent-%COMP%]{position:absolute;top:16px;right:16px}.tooltip-item[_ngcontent-%COMP%]{padding:8px 16px;cursor:pointer;text-align:start}.tooltip-item[_ngcontent-%COMP%]:hover{background-color:var(--space-300)}"]});let e=s;return e})();function Wt(e,s){if(e&1&&(o(0,"h2",10),p(1),l()),e&2){let a=_().$implicit;i(),w(a.title_section)}}function $t(e,s){if(e&1){let a=S();o(0,"app-custom-integration",11),v("reload",function(){T(a);let n=_(3);return b(n.initialLoad())}),l()}if(e&2){let a=s.$implicit;c("channel",a)}}function qt(e,s){if(e&1&&(o(0,"div",5),x(1,Wt,2,1,"h2",6),o(2,"p",7),p(3),l(),o(4,"div",8)(5,"app-card-grid"),x(6,$t,1,1,"app-custom-integration",9),l()()()),e&2){let a=s.$implicit,t=_(2);i(),c("ngIf",!t.isWhiteBrand),i(2),w(a.description_section),i(3),c("ngForOf",a.channels)}}function Xt(e,s){if(e&1&&(o(0,"section",2)(1,"h1",3),p(2),m(3,"translate"),l(),x(4,qt,7,3,"div",4),l()),e&2){let a=_();i(2),w(d(3,2,"SIDEBAR.CHANNELS")),i(2),c("ngForOf",a.channelProviders)}}function Kt(e,s){e&1&&(o(0,"dapta-loader",15),p(1),m(2,"translate"),l()),e&2&&(c("showSpinner",!1),i(),g(" ",d(2,2,"something-went-wrong-while-getting-your-integrations-please-refresh-this-page-or-contact-us")," "))}function Yt(e,s){e&1&&f(0,"dapta-loader")}function Qt(e,s){if(e&1&&(o(0,"div",12),x(1,Kt,3,4,"dapta-loader",13)(2,Yt,1,0,"dapta-loader",14),l()),e&2){let a=_();i(),c("ngIf",a.error),i(),c("ngIf",a.loading)}}var Se=(()=>{let s=class s{constructor(t,n){this.channelsService=t,this.authService=n,this.channelProviders=[],this.loading=!1,this.error=!1}get isWhiteBrand(){return this.authService.isWhiteBrand}ngOnInit(){this.initialLoad()}initialLoad(){return E(this,null,function*(){this.loading=!0,yield this.loadChannelProviders(),this.loading=!1})}loadChannelProviders(){return E(this,null,function*(){try{this.channelProviders=yield this.channelsService.getChannelProviders()}catch(t){console.error(t),this.error=!0}})}};s.\u0275fac=function(n){return new(n||s)(C(H),C(W))},s.\u0275cmp=I({type:s,selectors:[["app-channels-panel"]],decls:2,vars:2,consts:[["class","channels",4,"ngIf"],["class","w-full h-full flex justify-center items-center",4,"ngIf"],[1,"channels"],[1,"text--title"],["class","flex flex-column margin-top--16",4,"ngFor","ngForOf"],[1,"flex","flex-column","margin-top--16"],["class","text--subtitle",4,"ngIf"],[1,"text"],[1,"margin-top--8"],[3,"channel","reload",4,"ngFor","ngForOf"],[1,"text--subtitle"],[3,"reload","channel"],[1,"w-full","h-full","flex","justify-center","items-center"],[3,"showSpinner",4,"ngIf"],[4,"ngIf"],[3,"showSpinner"]],template:function(n,r){n&1&&x(0,Xt,5,4,"section",0)(1,Qt,3,2,"div",1),n&2&&(c("ngIf",!r.error&&!r.loading),i(),c("ngIf",r.loading||r.error))},dependencies:[N,j,L,Ot,ye,z,k,A],styles:[".channels[_ngcontent-%COMP%]{height:100%;overflow:auto;padding:var(--page-padding);padding-bottom:16px}"]});let e=s;return e})();function Jt(e,s){e&1&&(p(0),m(1,"translate")),e&2&&w(d(1,1,"no-connections-created"))}function Zt(e,s){if(e&1){let a=S();o(0,"div",20),v("click",function(){let n=T(a).$implicit,r=_();return b(r.channelProvider==="aldeamo"?r.connectionDetail(n.row):r.editConnection(n.row))}),p(1),l()}if(e&2){let a=s.$implicit;i(),g(" ",a.row.name||"N/A"," ")}}function en(e,s){if(e&1&&(p(0),m(1,"date")),e&2){let a=s.$implicit;g(" ",ce(1,1,a.row.created_at,"MMM d, y")," ")}}
1function tn(e,s){if(e&1){let a=S();o(0,"dapta-switch",24),v("click",function(n){return T(a),b(n.stopPropagation())})("valueChange",function(n){T(a);let r=_().$implicit,h=_();return b(h.toggle(r.row,n))}),l()}if(e&2){let a=_().$implicit,t=_();c("disable",!!t.isEnabledLoadingCredentialId)("value",a.row.enabled)}}function nn(e,s){e&1&&f(0,"dapta-spinner",25)}function an(e,s){if(e&1&&(o(0,"div",21),x(1,tn,1,2,"dapta-switch",22)(2,nn,1,0,"dapta-spinner",23),l()),e&2){let a=s.$implicit,t=_();i(),c("ngIf",t.isEnabledLoadingCredentialId!==a.row.id),i(),c("ngIf",t.isEnabledLoadingCredentialId===a.row.id)}}function on(e,s){if(e&1){let a=S();o(0,"div",21)(1,"dapta-material-icon",26),v("click",function(n){let r=T(a).$implicit,h=_();return n.stopPropagation(),b(h.editConnection(r.row))}),l()()}}function rn(e,s){e&1&&(o(0,"div",27)(1,"div",28),f(2,"dapta-loader"),l()())}var Oe=(()=>{let s=class s{constructor(t,n,r,h,u,M,P){this.agentsService=t,this.channelsService=n,this.activatedRoute=r,this.router=h,this.daptaToastController=u,this.daptaPopUpController=M,this.translate=P,this.searchForm=new F({search:new y("")}),this.tableConfig={pagination:!0,serverPagination:!0,rowPointer:!0,colDefs:[]},this.isEnabledLoadingCredentialId="",this.connections=[],this.loadingChannel=!1,this.loadingConnections=!1,this.totalResults=0,this.currentPage=1}ngOnInit(){this.updateTableConfig(),this.channelId=this.activatedRoute.snapshot.params.id,this.channelId&&this.getChannel()}updateTableConfig(){this.tableConfig.colDefs=[{name:"name",displayName:this.translate.instant("CHANNEL_CONNECTIONS.NAME"),columnTemplateName:"name"},{name:"agent_name",displayName:this.translate.instant("CHANNEL_CONNECTIONS.AGENT")},{name:"created_at",displayName:this.translate.instant("CHANNEL_CONNECTIONS.CREATED_AT"),columnTemplateName:"created_at"},{name:"enabled",displayName:this.translate.instant("CHANNEL_CONNECTIONS.ENABLED"),columnTemplateName:"enabled"},{name:"actions",displayName:this.translate.instant("CHANNEL_CONNECTIONS.ACTIONS"),columnTemplateName:"actions"}]}getChannel(){return E(this,null,function*(){this.loadingChannel=!0;try{this.channel=yield this.channelsService.getChannel(this.channelId),this.channelProvider=this.channel?.channel_provider||"",yield this.getConnections(1,"")}catch(t){console.error(t),this.daptaToastController.handleError({message:this.translate.instant("CHANNEL_CONNECTIONS.ERROR_GETTING_CHANNEL")})}finally{this.loadingChannel=!1}})}getConnections(t,n){return E(this,null,function*(){this.loadingConnections=!0;try{let r=yield this.channelsService.getConnections(this.channel?.channel_provider||"",t,n);this.currentPage=t,this.totalResults=r.total_records,this.connections=r.records||[]}catch(r){console.error(r),this.daptaToastController.handleError({message:this.translate.instant("CHANNEL_CONNECTIONS.ERROR_GETTING_CONNECTIONS")})}finally{this.loadingConnections=!1}})}toggle(t,n){return E(this,null,function*(){try{this.isEnabledLoadingCredentialId=t.id,yield this.agentsService.updateCredentialsEnabled(n,t.id),t.enabled=n}catch{n=!n,this.daptaToastController.handleError({message:this.translate.instant("CHANNEL_CONNECTIONS.ERROR_UPDATING_CONNECTION_ENABLED")})}finally{this.isEnabledLoadingCredentialId=""}})}newConnection(){return E(this,null,function*(){(yield this.daptaPopUpController.openPopUp({id:"message-bird",component:oe,componentProps:{channel:this.channel,provider:this.channel?.channel_provider,fromChannels:!0,title:this.translate.instant("CHANNEL_CONNECTIONS.CHANNEL_CREDENTIALS",{name:this.channel?.name||""})},styles:{maxWidth:"600px",maxHeight:"560px",borderRadius:"8px"}})).popUpClosed().then(n=>{n?.reload&&this.getConnections(1,"")})})}connectionDetail(t){return E(this,null,function*(){this.router.navigate([`/agents-studio/channels/${this.channelId}/connections/${t.id}`])})}editConnection(t){return E(this,null,function*(){(yield this.daptaPopUpController.openPopUp({id:"message-bird",component:oe,componentProps:{credentialsObject:t,channel:this.channel,provider:this.channel?.channel_provider,agentId:t.agent_id,fromChannels:!0,title:this.translate.instant("CHANNEL_CONNECTIONS.CHANNEL_CREDENTIALS",{name:this.channel?.name||""})},styles:{maxWidth:"600px",maxHeight:"560px",borderRadius:"8px"}})).popUpClosed().then(r=>{r?.reload&&this.getConnections(1,"")})})}goBack(){this.router.navigate(["/agents-studio/channels"])}};s.\u0275fac=function(n){return new(n||s)(C(St),C(H),C(te),C(U),C(ie),C(Q),C(ne))},s.\u0275cmp=I({type:s,selectors:[["app-channel-connections"]],decls:25,vars:15,consts:[["input",""],["emptyTemplate",""],[1,"channel-connections"],[1,"channel-connections__header","flex","flex-row","align-items-center","gap--8"],[1,"flex","flex-row","align-items-center","pointer",3,"click"],["iconName","arrow_back","iconClass","common-icon--md"],[1,"text--title"],[1,"channel-connections__section"],[1,"flex","space-between"],[3,"formGroup"],["inputClass","filter-input","formControlName","search",3,"enter","placeholder"],["leftContent","",1,"pi","pi-search","common-icon--sm",2,"margin-left","8px"],[3,"onClick"],["iconName","add_circle","iconClass","dapta-button__icon"],["tableClass","channel-connections__table",3,"pageChange","rowClicked","totalResults","currentPage","dataSource","loading","tableConfig"],["daptaCellTemplate","name"],["daptaCellTemplate","created_at"],["daptaCellTemplate","enabled"],["daptaCellTemplate","actions"],["class","loading-container w-full h-full flex justify-center items-center",4,"ngIf"],[1,"clickable","flex","flex-row","align-items-center",3,"click"],[1,"flex","flex-row","align-items-center"],[3,"disable","value","click","valueChange",4,"ngIf"],["size","20px","weight","2px",4,"ngIf"],[3,"click","valueChange","disable","value"],["size","20px","weight","2px"],["iconName","edit","iconClass","common-icon--md",3,"click"],[1,"loading-container","w-full","h-full","flex","justify-center","items-center"],[1,"w-full","h-full","flex","justify-center","items-center"]],template:function(n,r){if(n&1){let h=S();o(0,"section",2)(1,"div",3)(2,"button",4),v("click",function(){return T(h),b(r.goBack())}),f(3,"dapta-material-icon",5),l(),o(4,"h1",6),p(5),l()(),o(6,"div",7)(7,"div",8)(8,"form",9)(9,"dapta-input",10,0),m(11,"translate"),v("enter",function(){T(h);let M=J(10);return b(r.getConnections(1,M.value))}),f(12,"div",11),l()(),o(13,"dui-button",12),v("onClick",function(){return T(h),b(r.newConnection())}),f(14,"dapta-material-icon",13),p(15),m(16,"translate"),l()(),o(17,"dapta-table",14),v("pageChange",function(M){return T(h),b(r.getConnections(M.currentPage,r.searchForm.value.search||""))})("rowClicked",function(M){return T(h),b(r.channelProvider==="aldeamo"?r.connectionDetail(M):r.editConnection(M))}),x(18,Jt,2,3,"ng-template",null,1,me)(20,Zt,2,1,"ng-template",15)(21,en,2,4,"ng-template",16)(22,an,3,2,"ng-template",17)(23,on,2,0,"ng-template",18),l()()(),x(24,rn,3,0,"div",19)}n&2&&(i(5),w(r.channel==null?null:r.channel.name),i(3),c("formGroup",r.searchForm),i(),c("placeholder",D(d(11,11,"connection-search"))),i(6),g(" ",d(16,13,"WHATSAPP_CREDENTIALS.ADD_CONNECTION")," "),i(2),c("totalResults",r.totalResults)("currentPage",r.currentPage)("dataSource",r.connections)("loading",r.loadingConnections)("tableConfig",r.tableConfig),i(7),c("ngIf",r.loadingChannel))},dependencies:[N,L,G,R,X,$,q,B,K,Y,ae,we,be,ft,z,Ce,k,V,de,A],styles:[".channel-connections[_ngcontent-%COMP%]{height:100%;overflow:auto;padding-top:0}.channel-connections__header[_ngcontent-%COMP%]{padding:var(--page-padding);padding-top:16px;padding-bottom:0}.channel-connections__section[_ngcontent-%COMP%]{padding:var(--page-padding);padding-top:0;padding-bottom:16px;margin-top:16px}.channel-connections__create-connection[_ngcontent-%COMP%]{width:100%;height:100%;margin-top:24px}@media(min-width:800px){.channel-connections__create-connection[_ngcontent-%COMP%]{text-align:center}}.channel-connections__create-connection[_ngcontent-%COMP%]   .dapta-button[_ngcontent-%COMP%]{width:100%;max-width:176px;margin-top:8px;font-size:var(--font-size-body)}@media(min-width:800px){.channel-connections__create-connection[_ngcontent-%COMP%]   .dapta-button[_ngcontent-%COMP%]{font-size:16px;max-width:224px;margin:8px auto 0}}.channel-connections__create-connection-text[_ngcontent-%COMP%]{font-family:var(--input-font-family);font-size:var(--subtitle-font-size);font-weight:var(--font-weight-semibold);line-height:var(--line-height-title)}.channel-connections__description[_ngcontent-%COMP%]{text-overflow:ellipsis;word-wrap:break-word;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}[_nghost-%COMP%]     .filter-input{height:40px!important}[_nghost-%COMP%]     .channel-connections__table{margin-top:16px;border:none;border-radius:0;border-collapse:collapse;height:min-content}[_nghost-%COMP%]     .channel-connections__table tr{border:none}[_nghost-%COMP%]     .channel-connections__table tbody tr{border-bottom:1px solid var(--space-200)}[_nghost-%COMP%]     .channel-connections__table tbody tr:hover{background-color:var(--space-400)}[_nghost-%COMP%]     .channel-connections__table th, [_nghost-%COMP%]     .channel-connections__table td{border:none;font-weight:400;font-size:16px;padding:8px;max-height:40px}[_nghost-%COMP%]     .channel-connections__table th{background-color:transparent;font-weight:700}[_nghost-%COMP%]     .channel-connections__table .tableHead{background-color:var(--space-400)}[_nghost-%COMP%]     .channel-connections__table .skeleton{width:30%;height:auto}[_nghost-%COMP%]     .channel-connections__table .row-pointer{cursor:pointer}@media screen and (max-width:800px){[_nghost-%COMP%]     .channel-connections__table{width:100%;display:block}}[_nghost-%COMP%]     .channel-connections__table .created_at, [_nghost-%COMP%]     .channel-connections__table .description{dis
1play:none}@media screen and (min-width:960px){[_nghost-%COMP%]     .channel-connections__table .created_at, [_nghost-%COMP%]     .channel-connections__table .description{display:table-cell}}[_nghost-%COMP%]     .channel-connections__table .clickable{cursor:pointer}[_nghost-%COMP%]     .channel-connections__table .clickable:hover{color:var(--primary-500)}.options__item[_ngcontent-%COMP%]{padding:8px 12px;text-align:start}.options__item[_ngcontent-%COMP%]:hover{background-color:var(--space-300)}.loading-container[_ngcontent-%COMP%]{position:fixed;left:0;top:0;z-index:10}"]});let e=s;return e})();function ln(e,s){if(e&1&&(o(0,"h1",15),p(1),l()),e&2){let a=_();i(),w((a.connection==null?null:a.connection.name)||"N/A")}}function sn(e,s){e&1&&(p(0),m(1,"translate")),e&2&&w(d(1,1,"no-templates-created"))}function pn(e,s){if(e&1&&(o(0,"div",32),p(1),l()),e&2){let a=s.$implicit;i(),g(" ",a.row.name||"N/A"," ")}}function cn(e,s){if(e&1&&(o(0,"div",33),p(1),l()),e&2){let a=s.$implicit;i(),g(" ",a.row.status||"N/A"," ")}}function mn(e,s){e&1&&(o(0,"span"),p(1,"WhatsApp"),l())}function dn(e,s){if(e&1&&(o(0,"div",33),x(1,mn,2,0,"span",34),l()),e&2){let a=_(2);i(),c("ngIf",(a.connection==null?null:a.connection.type)==="aldeamo")}}function hn(e,s){if(e&1&&(p(0),m(1,"date")),e&2){let a=s.$implicit;g(" ",ce(1,1,a.row.created_at,"MMM d, y")," ")}}function _n(e,s){if(e&1){let a=S();o(0,"div",35)(1,"dapta-material-icon",36),v("click",function(n){let r=T(a).$implicit,h=_(2);return n.stopPropagation(),b(h.editTemplate(r.row.id))}),l(),o(2,"dapta-material-icon",37),v("click",function(n){let r=T(a).$implicit,h=_(2);return n.stopPropagation(),b(h.deleteTemplate(r.row.id))}),l()()}}function gn(e,s){if(e&1){let a=S();o(0,"div",16)(1,"div",17)(2,"form",18)(3,"dapta-input",19,0),m(5,"translate"),v("enter",function(){T(a);let n=J(4),r=_();return b(r.getMessageTemplates(1,n.value))}),f(6,"div",20),l()(),o(7,"div",21)(8,"dui-button",22),v("onClick",function(){T(a);let n=_();return b(n.refreshTemplates())}),f(9,"dapta-material-icon",23),p(10),m(11,"translate"),l(),o(12,"dui-button",24),v("onClick",function(){T(a);let n=_();return b(n.newTemplate())}),f(13,"dapta-material-icon",25),p(14),m(15,"translate"),l()()(),o(16,"dapta-table",26),v("pageChange",function(n){T(a);let r=_();return b(r.getMessageTemplates(n.currentPage,r.searchForm.value.search||""))})("rowClicked",function(n){T(a);let r=_();return b(r.editTemplate(n.id))}),x(17,sn,2,3,"ng-template",null,1,me)(19,pn,2,1,"ng-template",27)(20,cn,2,1,"ng-template",28)(21,dn,2,1,"ng-template",29)(22,hn,2,4,"ng-template",30)(23,_n,3,0,"ng-template",31),l()()}if(e&2){let a=_();i(2),c("formGroup",a.searchForm),i(),c("placeholder",D(d(5,10,"template-search"))),i(7),g(" ",d(11,12,"refresh")," "),i(4),g(" ",d(15,14,"add-template")," "),i(2),c("totalResults",a.totalResults)("currentPage",a.currentPage)("dataSource",a.templates)("loading",a.loadingConnection||a.loadingTemplates)("tableConfig",a.tableConfig)}}function un(e,s){if(e&1&&(o(0,"div")(1,"h2",40),p(2),l(),o(3,"p"),p(4),l()()),e&2){let a=s.$implicit,t=_(2);i(2),w(a),i(2),w(a==="password"?"********":t.connection==null?null:t.connection.credentials[a])}}function fn(e,s){if(e&1&&(o(0,"div",16)(1,"div",38),x(2,un,5,2,"div",39),l()()),e&2){let a=_();i(2),c("ngForOf",a.connectionCredentialsKeys)}}function Cn(e,s){e&1&&(o(0,"div",41)(1,"div",42),f(2,"dapta-loader"),l()())}var Pe=(()=>{let s=class s{constructor(t,n,r,h,u,M,P){this.activatedRoute=t,this.channelsService=n,this.daptaAlertController=r,this.daptaToastController=h,this.daptaPopUpController=u,this.router=M,this.translate=P,this.loadingConnection=!1,this.segment="templates",this.connectionCredentialsKeys=[],this.searchForm=new F({search:new y("")}),this.tableConfig={pagination:!0,serverPagination:!0,rowPointer:!0,colDefs:[]},this.isEnabledLoadingCredentialId="",this.platforms=[],this.templates=[],this.loadingChannel=!1,this.loadingTemplates=!1,this.totalResults=0,this.currentPage=1}ngOnInit(){this.updateTableConfig(),this.activatedRoute.params.subscribe(t=>{this.channelId=t.id,this.connectionId=t.connectionId,this.connectionId&&this.getConnection()})}updateTableConfig(){this.tableConfig.colDefs=[{name:"name",displayName:this.translate.instant("CHANNEL_CONNECTION.NAME"),columnTemplateName:"name"},{name:"supportedPlatforms",displayName:this.translate.instant("CHANNEL_CONNECTION.PLATFORMS"),columnTemplateName:"supportedPlatforms"},{name:"status",displayName:this.translate.instant("CHANNEL_CONNECTION.STATUS"),columnTemplateName:"status"},{name:"created_at",displayName:this.translate.instant("CHANNEL_CONNECTION.
1CREATED_AT"),columnTemplateName:"created_at"},{name:"actions",displayName:this.translate.instant("CHANNEL_CONNECTION.ACTIONS"),columnTemplateName:"actions"}]}getConnection(){return E(this,null,function*(){this.loadingConnection=!0;try{let t=yield this.channelsService.getConnection(this.connectionId);this.connection=t,this.connectionCredentialsKeys=Object.keys(this.connection?.credentials);let n=yield this.channelsService.getChannelByChannelProvider(this.connection?.type||"");this.channel=n,this.connection?.type==="aldeamo"&&this.getMessageTemplates(1,"")}catch{this.daptaToastController.handleError({message:this.translate.instant("CHANNEL_CONNECTION.ERROR_GETTING_CONNECTION")})}finally{this.loadingConnection=!1}})}getDaptaWhatsAppTemplates(){return E(this,null,function*(){let t=yield this.channelsService.getDaptaWhatsAppTemplates(this.connectionId)})}getMessageTemplates(t,n){return E(this,null,function*(){this.loadingTemplates=!0;try{let h=(yield this.channelsService.getMessageTemplatesByConnection(this.connectionId,t,n)).result;this.currentPage=t,this.totalResults=h.total_records||0,this.templates=h.records||[],this.templates.forEac
1h(u=>{u.status=this.translate.instant("CHANNEL_CONNECTION.LOADING"),this.channelsService.getDaptaWhatsAppTemplate(this.connectionId,u.template_id).then(M=>{u.status=M.status}).catch(M=>{console.error(this.translate.instant("CHANNEL_CONNECTION.ERROR_FETCHING_TEMPLATE"),M.message||this.translate.instant("CHANNEL_CONNECTION.COULD_NOT_FETCH_TEMPLATE_DETAILS")),u.status=this.translate.instant("CHANNEL_CONNECTION.ERROR")})})}catch(r){console.error("Error fetching templates:",r),this.daptaToastController.handleError({message:this.translate.instant("CHANNEL_CONNECTION.ERROR_GETTING_TEMPLATES")})}finally{this.loadingTemplates=!1}})}refreshTemplates(){this.getMessageTemplates(this.currentPage,this.searchForm.value.search||"")}editTemplate(t){return E(this,null,function*(){this.router.navigate([`/agents-studio/channels/${this.channelId}/connections/${this.connectionId}/edit-template/${t}`])})}deleteTemplate(t){return E(this,null,function*(){this.daptaAlertController.confirmAction({message:this.translate.instant("CHANNEL_CONNECTION.DELETE_TEMPLATE_CONFIRM"),confirmFunction:()=>E(this,null,function*(){this.daptaAlertController.startLoading();try{let n=yield this.channelsService.updateMessageTemplateDaptaStatus(t,"DELETED");this.getMessageTemplates(this.currentPage,this.searchForm.value.search||""),this.daptaToastController.handleSuccess({message:this.translate.instant("CHANNEL_CONNECTION.TEMPLATE_DELETED_SUCCESS")})}catch{this.daptaAlertController.stopLoading(),this.daptaToastController.handleError({message:this.translate.instant("CHANNEL_CONNECTION.ERROR_DELETING_TEMPLATE")})}finally{this.daptaAlertController.stopLoading()}})})})}getTemplates(t,n){return E(this,null,function*(){this.loadingTemplates=!0;try{let r=yield this.channelsService.getProjectTemplates({workspaceId:this.connection?.credentials.workspace_id,accessKey:this.connection?.credentials.access_key,query:n,platforms:t});this.templates=r.results}catch(r){console.error("Error fetching templates:",r),this.daptaToastController.handleError({message:this.translate.instant("CHANNEL_CONNECTION.ERROR_GETTING_TEMPLATES")})}finally{this.loadingTemplates=!1}})}newTemplate(){return E(this,null,function*(){this.router.navigate([`/agents-studio/channels/${this.channelId}/connections/${this.connectionId}/create-template`])})}goBack(){this.router.navigate([`/agents-studio/channels/${this.channelId}`])}onChangeSegment(t){this.segment=t}};s.\u0275fac=function(n){return new(n||s)(C(te),C(H),C(pt),C(ie),C(Q),C(U),C(ne))},s.\u0275cmp=I({type:s,selectors:[["app-channel"]],decls:18,vars:13,consts:[["input",""],["emptyTemplate",""],[1,"channel-connection"],[1,"channel-connection__header","flex","flex-row","align-items-center","gap--8"],[1,"flex","flex-row","align-items-center","pointer",3,"click"],["iconName","arrow_back","iconClass","common-icon--md"],["class","text--title",4,"ngIf"],[1,"channel-connection__tabs"],["tabsStyle","segment",3,"ngModelChange","change","ngModel"],["value","templates",3,"disabled"],["iconName","browse","iconClass","icon"],["value","information",3,"disabled"],["iconName","article","iconClass","icon"],["class","channel-connection__section",4,"ngIf"],["class","loading-container w-full h-full flex justify-center items-center",4,"ngIf"],[1,"text--title"],[1,"channel-connection__section"],[1,"flex","space-between"],[3,"formGroup"],["inputClass","filter-input","formControlName","search",3,"enter","placeholder"],["leftContent","",1,"pi","pi-search","common-icon--sm",2,"margin-left","8px"],[1,"flex","flex-row","gap--8"],["variant","outlined",3,"onClick"],["iconName","refresh","iconClass","dapta-button__icon"],[3,"onClick"],["iconName","add_circle","iconClass","dapta-button__icon"],["tableClass","channel-connection__table",3,"pageChange","rowClicked","totalResults","currentPage","dataSource","loading","tableConfig"],["daptaCellTemplate","name"],["daptaCellTemplate","status"],["daptaCellTemplate","supportedPlatforms"],["daptaCellTemplate","created_at"],["daptaCellTemplate","actions"],[1,"clickable","flex","flex-row","align-items-center"],[1,"flex","flex-row","align-items-center"],[4,"ngIf"],[1,"flex","flex-row","align-items-center","gap--8"],["iconName","edit","iconClass","common-icon--md",3,"click"],["iconName","delete","iconClass","common-icon--md",3,"click"],[1,"flex","flex-column","gap--8"],[4,"ngFor","ngForOf"],[1,"text--subtitle"],[1,"loading-container","w-full","h-full","flex","justify-center","items-center"],[1,"w-full","h-full","flex","justify-center","items-center"]],template:function(n,r){n&1&&(o(0,"section",2)(1,"div",3)(2,"button",4),v("click",function(){return r.goBack()}),f(3,"dapta-material-icon",5),l(),x(4,ln,2,1,"h1",6),l(),o(5,"div",7)(6,"dapta-tabs",8),et("ngModelChange",function(u){return Ze(r.segment,u)||(r.segment=u),u}),v("change",function(u){return r.onChangeSegment(u)}),o(7,"dapta-tab-button",9),f(8,"dapta-material-icon",10),p(9),m(10,"translate"),l(),o(11,"dapta-tab-button",11),f(12,"dapta-material-icon",12),p(13),m(14,"translate"),l()()(),x(15,gn,24,16,"div",13)(16,fn,3,1,"div",13),l(),x(17,Cn,3,0,"div",14)),n&2&&(i(4),c("ngIf",!r.loadingConnection),i(2),Je("ngModel",r.segment),i(),c("disabled",!r.connection),i(2),g(" ",d(10,9,"templates")," "),i(2),c("disabled",!r.connection),i(2),g(" ",d(14,11,"information")," "),i(2),c("ngIf",r.segment==="templates"),i(),c("ngIf",r.segment==="information"),i(),c("ngIf",r.loadingConnection))},dependencies:[N,j,L,G,he,mt,dt,R,X,$,q,at,B,K,Y,ae,we,be,z,k,V,de,A],styles:[".channel-connection[_ngcontent-%COMP%]{height:100%;overflow:auto;padding-top:0}.channel-connection__header[_ngcontent-%COMP%]{padding:var(--page-padding);padding-top:16px;padding-bottom:0}.channel-connection__tabs[_ngcontent-%COMP%]{padding:var(--page-padding);padding-top:0;padding-bottom:0}.channel-connection__section[_ngcontent-%COMP%]{padding:var(--page-padding);padding-top:0;padding-bottom:16px;margin-top:16px}.channel-connection__create-connection[_ngcontent-%COMP%]{width:100%;height:100%;margin-top:24px}@media(min-width:800px){.channel-connection__create-connection[_ngcontent-%COMP%]{text-align:center}}.channel-connection__create-connection[_ngcontent-%COMP%]   .dapta-button[_ngcontent-%COMP%]{width:100%;max-width:176px;margin-top:8px;font-size:var(--font-size-body)}@media(min-width:800px){.channel-connection__create-connection[_ngcontent-%COMP%]   .dapta-button[_ngcontent-%COMP%]{font-size:16px;max-width:224px;margin:8px auto 0}}.channel-connection__create-connection-text[_ngcontent-%COMP%]{font-family:var(--input-font-family);font-size:var(--subtitle-font-size);font-weight:var(--font-weight-semibold);line-height:var(--line-height-title)}.channel-connection__description[_ngcontent-%COMP%]{text-overflow:ellipsis;word-wrap:break-word;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}[_nghost-%COMP%]     .filter-input{height:40px!important}[_nghost-%COMP%]     .channel-connection__table{margin-top:16px;border:none;border-radius:0;border-collapse:collapse;height:min-content}[_nghost-%COMP%]     .channel-connection__table tr{border:none}[_nghost-%COMP%]     .channel-connection__table tbody tr{border-bottom:1px solid var(--space-200)}[_nghost-%COMP%]     .channel-connection__table tbody tr:hover{background-color:var(--space-400)}[_nghost-%COMP%]     .channel-connection__table th, [_nghost-%COMP%]     .channel-connection__table td{border:none;font-weight:400;font-size:16px;padding:8px;max-height:40px}[_nghost-%COMP%]     .channel-connection__table th{background-color:transparent;font-weight:700}[_nghost-%COMP%]     .channel-connection__table .tableHead{background-color:var(--space-400)}[_nghost-%COMP%]     .channel-connection__table .skeleton{width:30%;height:auto}[_nghost-%COMP%]     .channel-connection__table .row-pointer{cursor:pointer}@media screen and (max-width:800px){[_nghost-%COMP%]     .channel-connection__table{width:100%;display:block}}[_nghost-%COMP%]     .channel-connection__table .created_at, [_nghost-%COMP%]     .channel-connection__table .description{dis
1play:none}@media screen and (min-width:960px){[_nghost-%COMP%]     .channel-connection__table .created_at, [_nghost-%COMP%]     .channel-connection__table .description{display:table-cell}}[_nghost-%COMP%]     .channel-connection__table .clickable{cursor:pointer}[_nghost-%COMP%]     .channel-connection__table .clickable:hover{color:var(--primary-500)}.options__item[_ngcontent-%COMP%]{padding:8px 12px;text-align:start}.options__item[_ngcontent-%COMP%]:hover{background-color:var(--space-300)}.loading-container[_ngcontent-%COMP%]{position:fixed;left:0;top:0;z-index:10}"]});let e=s;return e})();var vn=["variablesForm"],kt=e=>({"preview-mode":e}),xn=()=>({height:"150px",border:"1px solid white",borderRadius:"6px",paddingTop:"6px",position:"relative"}),Ft=e=>({error:e}),Tn=e=>({active:e}),bn=()=>({height:"80px",border:"1px solid white",borderRadius:"6px",paddingTop:"6px",position:"relative"});function wn(e,s){if(e&1){let a=S();o(0,"div",45)(1,"div",46)(2,"h3",47),p(3),m(4,"translate"),m(5,"translate"),m(6,"translate"),l()(),o(7,"div",48)(8,"dui-button",49),m(9,"translate"),v("onClick",function(){T(a);let n=_();return b(n.goBack())}),l(),o(10,"dui-button",50),v("onClick",function(){T(a);let n=_();return b(n.saveTemplate())}),p(11),m(12,"translate"),m(13,"translate"),l()()()}if(e&2){let a=_();i(3),Qe("",a.template?d(4,7,"MESSAGE_TEMPLATE.EDIT"):d(5,9,"MESSAGE_TEMPLATE.CREATE")," ",d(6,11,"MESSAGE_TEMPLATE.TEMPLATE")),i(5),c("label",d(9,13,"COMMON.CANCEL")),i(2),c("disabled",!!(a.savingTemplate||a.whatsappAldeamoTemplateForm.invalid||!a.canEditTemplate))("pTooltip",a.canEditTemplate?"":a.preventEditMessage)("tooltipPosition","bottom"),i(),g(" ",a.savingTemplate?d(12,15,"MESSAGE_TEMPLATE.SAVING"):d(13,17,"save-changes-0")," ")}}function En(e,s){if(e&1){let a=S();o(0,"div",68),v("click",function(){let n=T(a).$implicit,r=_(2);return b(r.selectHeaderFormat(n))}),o(1,"div",69),f(2,"dapta-material-icon",70),l(),o(3,"div",71)(4,"span",72),p(5),l()()()}if(e&2){let a=s.$implicit,t=_(2);c("ngClass",ee(3,Tn,t.whatsappAldeamoTemplateForm.controls.header_format.value===a.value)),i(2),c("iconName",a.icon),i(3),w(a.label)}}function Mn(e,s){e&1&&(o(0,"p",74),p(1),m(2,"translate"),o(3,"span",75),p(4,"5MB"),l()()),e&2&&(i(),g(" ",d(2,1,"max-file-size-for-images-is")," "))}function yn(e,s){e&1&&(o(0,"p",74),p(1),m(2,"translate"),o(3,"span",75),p(4,"jpg, jpeg, png"),l()()),e&2&&(i(),g(" ",d(2,1,"supported-formats")," "))}function Sn(e,s){e&1&&(o(0,"p",74),p(1),m(2,"translate"),o(3,"span",75),p(4,"16MB"),l()()),e&2&&(i(),g(" ",d(2,1,"max-file-size-for-videos-is")," "))}function On(e,s){e&1&&(o(0,"p",74),p(1),m(2,"translate"),o(3,"span",75),p(4,"mp4, 3gpp"),l()()),e&2&&(i(),g(" ",d(2,1,"supported-formats")," "))}function Pn(e,s){e&1&&(o(0,"p",74),p(1),m(2,"translate"),o(3,"span",75),p(4,"100MB"),l()()),e&2&&(i(),g(" ",d(2,1,"max-file-size-for-documents-is")," "))}function In(e,s){e&1&&(o(0,"p",74),p(1),m(2,"translate"),o(3,"span",75),p(4,"pdf, docx, pptx, xlsx, txt, zip"),l()()),e&2&&(i(),g(" ",d(2,1,"supported-formats")," "))}function Nn(e,s){if(e&1&&(o(0,"div"),x(1,Mn,5,3,"p",73)(2,yn,5,3,"p",73)(3,Sn,5,3,"p",73)(4,On,5,3,"p",73)(5,Pn,5,3,"p",73)(6,In,5,3,"p",73),l()),e&2){let a=_(2);i(),c("ngIf",a.whatsappAldeamoTemplateForm.controls.header_format.value==="IMAGE"),i(),c("ngIf",a.whatsappAldeamoTemplateForm.controls.header_format.value==="IMAGE"),i(),c("ngIf",a.whatsappAldeamoTemplateForm.controls.header_format.value==="VIDEO"),i(),c("ngIf",a.whatsappAldeamoTemplateForm.controls.header_format.value==="VIDEO"),i(),c("ngIf",a.whatsappAldeamoTemplateForm.controls.header_format.value==="DOCUMENT"),i(),c("ngIf",a.whatsappAldeamoTemplateForm.controls.header_format.value==="DOCUMENT")}}function An(e,s){if(e&1){let a=S();o(0,"ngx-monaco-editor",76,2),v("ngModelChange",function(){T(a);let n=_(2);return b(n.onHeaderChange())}),l()}if(e&2){let a=J(1),t=_(2);Ae(ke(6,bn)),c("options",t.codeEditorOptions2)("editorInstance",a)("spellcheck",!1)("promptEditorMode",!0)}}function kn(e,s){if(e&1&&(o(0,"small",67),p(1),l()),e&2){let a=_(2);c("ngClass",ee(2,Ft,(a.whatsappAldeamoTemplateForm.controls.header.value==null?null:a.whatsappAldeamoTemplateForm.controls.header.value.length)&&(a.whatsappAldeamoTemplateForm.controls.header.value==null?null:a.whatsappAldeamoTemplateForm.controls.header.value.length)>60)),i(),g(" ",(a.whatsappAldeamoTemplateForm.controls.header.value==null?null:a.whatsappAldeamoTemplateForm.controls.header.value.length)||0,"/60 ")}}function Fn(e,s){if(e&1){let a=S();o(0,"div",51)(1,"p"),p(2),m(3,"translate"),l(),o(4,"form",52)(5,"div",53)(6,"div",54),p(7),m(8,"translate"),o(9,"span",55),p(10,"*"),l(),p(11," \xA0 "),o(12,"span",56)(13,"dapta-tooltip-content",57)(14,"span",58),p(15),m(16,"translate"),l()()()(),f(17,"dapta-input",59),l(),o(18,"div",53)(19,"div",54),p(20),m(21,"translate"),o(22,"span",55),p(23,"*"),l(
1),p(24," \xA0 "),o(25,"span",56)(26,"dapta-tooltip-content",57)(27,"span",58),p(28),m(29,"translate"),l()()()(),f(30,"p-select",60),m(31,"translate"),l(),o(32,"div",53)(33,"div",54),p(34),m(35,"translate"),o(36,"span",55),p(37,"*"),l(),p(38," \xA0 "),o(39,"span",56)(40,"dapta-tooltip-content",57)(41,"span",58),p(42),m(43,"translate"),l()()()(),f(44,"p-select",61),m(45,"translate"),l(),o(46,"div",53)(47,"div",54),p(48),m(49,"translate"),o(50,"span",56)(51,"dapta-tooltip-content",57)(52,"span",58),p(53),m(54,"translate"),l()()()(),o(55,"div",62),x(56,En,6,5,"div",63),l(),x(57,Nn,7,6,"div",43)(58,An,2,7,"ngx-monaco-editor",64)(59,kn,2,4,"small",65),l(),o(60,"div",53)(61,"div",54),p(62),m(63,"translate"),o(64,"span",55),p(65,"*"),l(),p(66," \xA0 "),o(67,"span",56)(68,"dapta-tooltip-content",57)(69,"span",58),p(70),m(71,"translate"),l()()()(),o(72,"ngx-monaco-editor",66,1),v("ngModelChange",function(){T(a);let n=_();return b(n.onBodyChange())}),l(),o(74,"small",67),p(75),l()()()()}if(e&2){let a=J(73),t=_();i(2),w(d(3,37,"this-template-will-be-used-for-sending-whatsapp-notifications")),i(2),c("formGroup",t.whatsappAldeamoTemplateForm),i(3),g(" ",d(8,39,"CHANNEL_CONNECTIONS.NAME")," "),i(8),g(" ",d(16,41,"enter-the-name-of-the-template-it-should-be-unique-and-use-snake_case-this-cant-be-changed-after-creation")," "),i(2),c("type","variable")("placeholder","template_name")("readonly",t.whatsappAldeamoTemplateForm.controls.name.disabled),i(3),g(" ",d(21,43,"AGENT_SETTINGS.LABEL_LANGUAGE")," "),i(8),g(" ",d(29,45,"select-the-language-of-the-template-this-cant-be-changed-after-creation")," "),i(2),c("options",t.aldeamoLanguages)("placeholder",d(31,47,"MESSAGE_TEMPLATE.SELECT_LANGUAGE"))("optionLabel","label")("optionValue","value")("filter",!1),i(4),g(" ",d(35,49,"category")," "),i(8),g(" ",d(43,51,"select-the-category-of-the-template-this-cant-be-changed-after-creation")," "),i(2),c("options",t.aldeamoCategories)("placeholder",d(45,53,"MESSAGE_TEMPLATE.SELECT_CATEGORY"))("optionLabel","label")("optionValue","value")("filter",!1),i(4),g(" ",d(49,55,"header-optional")," \xA0 "),i(5),g(" ",d(54,57,"set-the-header-of-the-template-this-will-be-displayed-at-the-top-of-the-message")," "),i(3),c("ngForOf",t.headerFormats),i(),c("ngIf",t.whatsappAldeamoTemplateForm.controls.header_format.value&&t.whatsappAldeamoTemplateForm.controls.header_format.value!=="TEXT"),i(),c("ngIf",t.whatsappAldeamoTemplateForm.controls.header_format.value==="TEXT"),i(),c("ngIf",t.whatsappAldeamoTemplateForm.controls.header_format.value==="TEXT"),i(3),g(" ",d(63,59,"body")," "),i(8),g(" ",d(71,61,"enter-the-body-of-the-template")," "),i(2),Ae(ke(63,xn)),c("options",t.codeEditorOptions)("editorInstance",a)("spellcheck",!1)("promptEditorMode",!0),i(2),c("ngClass",ee(64,Ft,(t.whatsappAldeamoTemplateForm.controls.body.value==null?null:t.whatsappAldeamoTemplateForm.controls.body.value.length)&&(t.whatsappAldeamoTemplateForm.controls.body.value==null?null:t.whatsappAldeamoTemplateForm.controls.body.value.length)>1024)),i(),g(" ",(t.whatsappAldeamoTemplateForm.controls.body.value==null?null:t.whatsappAldeamoTemplateForm.controls.body.value.length)||0,"/1024 ")}}function Dn(e,s){e&1&&(o(0,"div",83),f(1,"img",84),l())}function Ln(e,s){e&1&&(o(0,"div",83),f(1,"video",85),l())}function Vn(e,s){e&1&&(o(0,"div",86),f(1,"img",87),o(2,"div")(3,"p",88),p(4),m(5,"translate"),l(),o(6,"p",89),p(7,"100 KB \u2022 PDF"),l()()()),e&2&&(i(4),w(d(5,1,"document")))}function Rn(e,s){if(e&1&&(o(0,"p",90),p(1),l()),e&2){let a=_(2);i(),g(" ",a.exampleHeaderText||""," ")}}function Bn(e,s){if(e&1&&(o(0,"div",77),x(1,Dn,2,0,"div",78)(2,Ln,2,0,"div",78)(3,Vn,8,3,"div",79)(4,Rn,2,1,"p",80),o(5,"p",81),p(6),l(),o(7,"span",82),p(8),l()()),e&2){let a=_();i(),c("ngIf",a.whatsappAldeamoTemplateForm.controls.header_format.value==="IMAGE"),i(),c("ngIf",a.whatsappAldeamoTemplateForm.controls.header_format.value==="VIDEO"),i(),c("ngIf",a.whatsappAldeamoTemplateForm.controls.header_format.value==="DOCUMENT"),i(),c("ngIf",a.whatsappAldeamoTemplateForm.controls.header_format.value==="TEXT"&&a.exampleHeaderText),i(2),w(a.exampleMessageText||""),i(2),w(a.currentTime)}}
1function Gn(e,s){if(e&1){let a=S();o(0,"div",93)(1,"dapta-input",94),m(2,"translate"),v("blur",function(){T(a);let n=_(2);return b(n.updateTemplatePreview())}),l(),o(3,"dapta-input",95),m(4,"translate"),v("blur",function(){T(a);let n=_(2);return b(n.updateTemplatePreview())}),l(),o(5,"dui-button",96),v("onClick",function(){let n=T(a).index,r=_(2);return b(r.removeVariable(n))}),f(6,"dapta-material-icon",97),l()()}if(e&2){let a=s.index,t=_(2);c("formGroupName",a),i(),c("label",D(d(2,14,"key")))("type","variable")("placeholder","Enter Key")("inputClass","w-full")("readonly",!t.canEditTemplate),i(2),c("label",D(d(4,16,"value")))("placeholder","Enter Value")("inputClass","w-full")("readonly",!t.canEditTemplate),i(2),c("disabled",!t.canEditTemplate),i(),c("size","20px")}}function zn(e,s){if(e&1&&(o(0,"div",91),x(1,Gn,7,18,"div",92),l()),e&2){let a=_();i(),c("ngForOf",a.variables.controls)}}function Hn(e,s){if(e&1){let a=S();o(0,"div",99)(1,"label",100),p(2),l(),o(3,"dapta-input",101),v("blur",function(){T(a);let n=_(2);return b(n.updateTemplatePreview())}),l()()}if(e&2){let a,t=s.$implicit,n=s.index;c("formGroupName",n),i(2),w((a=t.get("key"))==null?null:a.value),i(),c("placeholder","Enter Value")("inputClass","w-full")("readonly",!1)}}function jn(e,s){if(e&1&&(o(0,"div",91),x(1,Hn,4,5,"div",98),l()),e&2){let a=_();i(),c("ngForOf",a.variables.controls)}}function Un(e,s){if(e&1){let a=S();o(0,"dui-button",102),v("onClick",function(){T(a);let n=_();return b(n.addVariable())}),f(1,"dapta-material-icon",103),p(2),m(3,"translate"),l()}if(e&2){let a=_();c("disabled",!a.canEditTemplate),i(),c("size","18px"),i(),g(" ",d(3,3,"add-variable")," ")}}function Wn(e,s){e&1&&f(0,"dapta-loader")}function $n(e,s){e&1&&f(0,"dapta-loader",104),e&2&&c("setParentRelative",!1)}var le=(()=>{let s=class s{constructor(t,n,r,h,u,M,P){this.authService=t,this.formBuilder=n,this.daptaToastController=r,this.channelsService=h,this.activatedRoute=u,this.router=M,this.translate=P,this.existingWhatsAppTemplates=[],this.whatsappAldeamoTemplateForm=new F({name:new y("",[O.required]),language:new y("",[O.required]),category:new y("",[O.required]),header_format:new y(""),header:new y(""),body:new y("",[O.required]),variables:new lt([])}),this.exampleHeaderText="",this.exampleMessageText="",this.variablesExtracted=[],this.loadingConnection=!1,this.loadingForm=!1,this.loadingTemplate=!1,this.savingTemplate=!1,this.canEditTemplate=!0,this.currentTime=new Date().toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),this.aldeamoCategories=[],this.aldeamoLanguages=[],this.headerFormats=[],this.codeEditorOptions={theme:De(),language:"plaintext",automaticLayout:!0,wordWrap:"on",minimap:{enabled:!1},lineNumbers:"off",tabSize:4,fontFamily:"monospace",folding:!1,scrollBeyondLastLine:!1,unicodeHighlight:{ambiguousCharacters:!1},quickSuggestions:!1,suggestOnTriggerCharacters:!1,acceptSuggestionOnEnter:"off",tabCompletion:"off",wordBasedSuggestions:!1,parameterHints:{enabled:!1},suggest:{showMethods:!1,showFunctions:!1,showConstructors:!1,showDeprecated:!1,showFields:!1,showVariables:!1,showClasses:!1,showStructs:!1,showInterfaces:!1,showModules:!1,showProperties:!1,showEvents:!1,showOperators:!1,showUnits:!1,showValues:!1,showConstants:!1,showEnums:!1,showEnumMembers:!1,showKeywords:!1,showWords:!1,showColors:!1,showFiles:!1,showReferences:!1,showFolders:!1,showTypeParameters:!1,showSnippets:!1},suggestFontSize:0,suggestLineHeight:0,commands:{suggestions:!1,quickSuggestions:!1}},this.codeEditorOptions2={theme:De(),language:"plaintext",automaticLayout:!0,wordWrap:"on",minimap:{enabled:!1},lineNumbers:"off",tabSize:4,fontFamily:"monospace",folding:!1,scrollBeyondLastLine:!1,unicodeHighlight:{ambiguousCharacters:!1},quickSuggestions:!1,suggestOnTriggerCharacters:!1,acceptSuggestionOnEnter:"off",tabCompletion:"off",wordBasedSuggestions:!1,parameterHints:{enabled:!1},suggest:{showMethods:!1,showFunctions:!1,showConstructors:!1,showDeprecated:!1,showFields:!1,showVariables:!1,showClasses:!1,showStructs:!1,showInterfaces:!1,showModules:!1,showProperties:!1,showEvents:!1,showOperators:!1,showUnits:!1,showValues:!1,showConstants:!1,showEnums:!1,showEnumMembers:!1,showKeywords:!1,showWords:!1,showColors:!1,show
1Files:!1,showReferences:!1,showFolders:!1,showTypeParameters:!1,showSnippets:!1},suggestFontSize:0,suggestLineHeight:0,commands:{suggestions:!1,quickSuggestions:!1}},this.preventEditMessage="",this.previewMode=!1}ngOnInit(){this.initializeOptions(),this.loadData(),this.getExistingTemplates()}initializeOptions(){this.aldeamoCategories=[{value:"MARKETING",label:this.translate.instant("MESSAGE_TEMPLATE.MARKETING")},{value:"UTILITY",label:this.translate.instant("MESSAGE_TEMPLATE.UTILITY")}],this.aldeamoLanguages=[{value:"es",label:this.translate.instant("MESSAGE_TEMPLATE.SPANISH")},{value:"en",label:this.translate.instant("MESSAGE_TEMPLATE.ENGLISH")}],this.headerFormats=[{icon:"text_fields",value:"TEXT",label:this.translate.instant("MESSAGE_TEMPLATE.TEXT")},{icon:"file_present",value:"DOCUMENT",label:this.translate.instant("MESSAGE_TEMPLATE.DOCUMENT")},{icon:"image",value:"IMAGE",label:this.translate.instant("MESSAGE_TEMPLATE.IMAGE")},{icon:"video_library",value:"VIDEO",label:this.translate.instant("MESSAGE_TEMPLATE.VIDEO")},{icon:"disabled_by_default",value:"",label:this.translate.instant("MESSAGE_TEMPLATE.NONE")}],this.preventEditMessage=this.translate.instant("MESSAGE_TEMPLATE.EDIT_TEMPLATE_24_HOURS")}ngOnChanges(t){t.inputTemplate&&!t.inputTemplate.firstChange&&this.previewMode&&(this.template=this.inputTemplate,this.setTemplateValues()),t.inputConnection&&!t.inputConnection.firstChange&&this.previewMode&&(this.connection=this.inputConnection)}loadData(){return E(this,null,function*(){yield this.getConnection(),yield this.getTemplate()})}getTemplate(){return E(this,null,function*(){let t=this.activatedRoute.snapshot.params.templateId;if(t&&this.router.url.includes("/edit-template")||this.previewMode&&this.inputTemplate){this.loadingTemplate=!0;try{if(this.previewMode&&this.inputTemplate)this.template=this.inputTemplate;else{let n=yield this.channelsService.getMessageTemplate(t);this.template=n;let r=yield this.channelsService.getDaptaWhatsAppTemplate(this.connection.id,this.template.template_id);this.template.status=r.status,this.checkCanEditTemplate()}this.setTemplateValues()}catch(n){console.error(n),this.daptaToastController.handleError({message:n.message||this.translate.instant("MESSAGE_TEMPLATE.ERROR_GETTING_TEMPLATE")})}this.loadingTemplate=!1}else this.setDefaultValues()})}setTemplateValues(){let t=this.template?.components?.find(h=>h.type==="BODY"),n=this.template?.components?.find(h=>h.type==="HEADER");this.whatsappAldeamoTemplateForm.patchValue({name:this.template?.name,language:this.template?.language,category:this.template?.category,body:t?.text||"",header:n?.text||"",header_format:n?.format||""}),this.whatsappAldeamoTemplateForm.controls.name.disable(),this.whatsappAldeamoTemplateForm.controls.language.disable(),this.whatsappAldeamoTemplateForm.controls.category.disable();let r=(this.template?.variables||[]).map(h=>new F({key:new y(h.key,[O.required]),value:new y(h.value,[O.required]),manual:new y(h.manual)}));this.variables.clear(),r.forEach(h=>{this.variables.push(h)}),this.updateTemplatePreview()}setDefaultValues(){this.exampleMessageText=this.translate.instant("MESSAGE_TEMPLATE.DEFAULT_MESSAGE_TEXT"),this.whatsappAldeamoTemplateForm.controls.body.setValue(this.exampleMessageText),this.whatsappAldeamoTemplateForm.controls.header_format.setValue("");let t=this.authService.userData.givenName||"User",n=new F({key:new y("contact_name",[O.required]),value:new y(t,[O.required])});this.variables.insert(0,n),this.updateTemplatePreview()}getConnection(){return E(this,null,function*(){this.loadingConnection=!0;try{if(this.previewMode&&this.inputConnection)this.connection=this.inputConnection;else{let t=this.activatedRoute.snapshot.params.connectionId,n=yield this.channelsService.getConnection(t);this.connection=n}}catch(t){console.error(t),this.daptaToastController.handleError({message:t.message||this.translate.instant("MESSAGE_TEMPLATE.ERROR_GETTING_CONNECTION")})}this.loadingConnection=!1})}goBack(){this.activatedRoute.url.subscribe(t=>{if(this.template&&this.router.url.includes("/edit-template")){let n=t.map(u=>u.path),r=n.indexOf("edit-template"),h=r!==-1?n.slice(0,r).join("/"):n.join("/");this.router.navigate(["/agents-studio/channels/"+h])}else{let r=t.map(h=>h.path).filter(h=>h!=="create-template").join("/");this.router.navigate(["/agents-studio/channels/"+r])}})}checkIfTemplateExists(){return this.existingWhatsAppTemplates.find(n=>n.name===this.whatsappAldeamoTemplateForm.value.name)}
1saveTemplate(){if(this.whatsappAldeamoTemplateForm.invalid){this.daptaToastController.handleError({message:this.translate.instant("MESSAGE_TEMPLATE.PLEASE_FILL_ALL_REQUIRED_FIELDS")});return}if(this.whatsappAldeamoTemplateForm.value.header_format==="TEXT"){if(!this.whatsappAldeamoTemplateForm.value.header){this.daptaToastController.handleError({message:this.translate.instant("MESSAGE_TEMPLATE.TEXT_HEADER_CANNOT_BE_EMPTY")});return}if(this.whatsappAldeamoTemplateForm.value.header.length>60){this.daptaToastController.handleError({message:this.translate.instant("MESSAGE_TEMPLATE.TEXT_HEADER_TOO_LONG")});return}}if(!this.validateOnlyOneVariableInHeader())return;if(this.whatsappAldeamoTemplateForm.value.body.length>1024){this.daptaToastController.handleError({message:this.translate.instant("MESSAGE_TEMPLATE.BODY_TOO_LONG")});return}let t=this.checkIfTemplateExists();if(t&&this.template?.id!==t.id){this.daptaToastController.handleError({message:this.translate.instant("MESSAGE_TEMPLATE.TEMPLATE_NAME_EXISTS")});return}if(this.savingTemplate=!0,this.router.url.includes("/edit-template")&&this.template){if(!this.canEditTemplate){this.daptaToastController.handleError({message:this.translate.instant("MESSAGE_TEMPLATE.EDIT_TEMPLATE_24_HOURS")}),this.savingTemplate=!1;return}this.channelsService.updateDaptaWhatsAppTemplate(this.connection.id,this.template.id,ze(Ge({},this.whatsappAldeamoTemplateForm.value),{template_id:this.template.template_id})).then(n=>{this.daptaToastController.handleSuccess({message:this.translate.instant("MESSAGE_TEMPLATE.TEMPLATE_UPDATED_SUCCESS")}),this.goBack()}).catch(n=>{console.error(n),this.daptaToastController.handleError({message:n.message||n.reason||this.translate.instant("MESSAGE_TEMPLATE.ERROR_UPDATING_TEMPLATE")})}).finally(()=>{this.savingTemplate=!1})}else this.channelsService.createDaptaWhatsAppTemplate(this.connection.id,this.whatsappAldeamoTemplateForm.value).then(n=>{this.daptaToastController.handleSuccess({message:this.translate.instant("MESSAGE_TEMPLATE.TEMPLATE_CREATED_SUCCESS")}),this.goBack()}).catch(n=>{console.error(n),this.daptaToastController.handleError({message:n.message||n.reason||this.translate.instant("MESSAGE_TEMPLATE.ERROR_CREATING_TEMPLATE")})}).finally(()=>{this.savingTemplate=!1})}onHeaderChange(){this.setVariables();let t=this.whatsappAldeamoTemplateForm.value.header,n=/\{\{(.*?)\}\}/g,r=t.match(n);r&&r.forEach(h=>{let u=h.replace("{{","").replace("}}",""),M=this.variables.value.find(P=>P.key&&P.key===u)?.value;M&&(t=t.replace(h,M))}),this.exampleHeaderText=t}onBodyChange(){this.setVariables();let t=this.whatsappAldeamoTemplateForm.value.body,n=/\{\{(.*?)\}\}/g,r=t.match(n);r&&r.forEach(h=>{let u=h.replace("{{","").replace("}}",""),M=this.variables.value.find(P=>P.key&&P.key===u)?.value;M&&(t=t.replace(h,M))}),this.exampleMessageText=t}addVariable(){let t=new F({key:new y("",[O.required]),value:new y("",[O.required]),manual:new y(!0)});this.variables.insert(this.variables.length,t),this.whatsappAldeamoTemplateForm.controls.variables.updateValueAndValidity(),this.variablesForm?.nativeElement&&setTimeout(()=>{this.variablesForm.nativeElement.scrollTop=this.variablesForm.nativeElement.scrollHeight},0)}removeVariable(t){this.variables.removeAt(t),this.whatsappAldeamoTemplateForm.controls.variables.updateValueAndValidity(),this.updateTemplatePreview()}get variables(){return this.whatsappAldeamoTemplateForm.get("variables")}checkCanEditTemplate(){if(this.template?.status==="APPROVED"){this.canEditTemplate=!1,this.codeEditorOptions.readOnly=!0,this.codeEditorOptions2.readOnly=!0,this.preventEditMessage=this.translate.instant("MESSAGE_TEMPLATE.TEMPLATE_APPROVED_CANNOT_EDIT");return}if(this.template?.updated_at&&this.template.updated_at!==this.template.created_at){let t=new Date(this.template.updated_at),r=Math.abs(new Date().getTime()-t.getTime());Math.ceil(r/(1e3*60*60))<24?(this.canEditTemplate=!1,this.codeEditorOptions.readOnly=!0,this.codeEditorOptions2.readOnly=!0,this.preventEditMessage=this.translate.instant("MESSAGE_TEMPLATE.EDIT_TEMPLATE_24_HOURS")):this.canEditTemplate=!0}else this.canEditTemplate=!0}setVariables(){let t=this.getVariables();t.forEach(u=>{this.variablesExtracted.some(M=>M.key===u.key)||this.variablesExtracted.push(u)});let n=this.variables.controls.filter(u=>u.get("manual")?.value),r=[...this.variables.value];this.variables.clear();let h=new Set(n.map(u=>u.get("key")?.value));
1n.forEach(u=>{this.variables.push(u),h.add(u.get("key")?.value)}),t.forEach(u=>{if(u.key&&u.key.trim()!==""&&!h.has(u.key)&&!u.key.includes("current_time")){h.add(u.key);let M=r.find(Vt=>Vt.key===u.key)?.value||"",P=M===u.key?"":M,Lt=new F({key:new y(u.key,[O.required]),value:new y(P,[O.required])});this.variables.push(Lt)}})}getVariables(){let t=this.whatsappAldeamoTemplateForm.value.body;this.whatsappAldeamoTemplateForm.value.header_format==="TEXT"&&this.whatsappAldeamoTemplateForm.value.header&&(t=this.whatsappAldeamoTemplateForm.value.header+`
2`+t);let n=/{{(.*?)}}/g,r=[],h;for(;(h=n.exec(t))!==null;)r.push({key:h[1],value:h[1]});return r}getExistingTemplates(){return E(this,null,function*(){let t=this.activatedRoute.snapshot.params.connectionId;if(t){let n=yield this.channelsService.getDaptaWhatsAppTemplates(t);this.existingWhatsAppTemplates=n?.result?.data?.templates||[]}})}selectHeaderFormat(t){this.canEditTemplate&&this.whatsappAldeamoTemplateForm.controls.header_format.patchValue(t.value)}validateOnlyOneVariableInHeader(){if(this.whatsappAldeamoTemplateForm.value.header_format!=="TEXT")return!0;let t=/\{\{(.*?)\}\}/g,n=this.whatsappAldeamoTemplateForm.value.header.match(t);return n&&n.length>1?(this.daptaToastController.handleError({message:this.translate.instant("MESSAGE_TEMPLATE.ONLY_ONE_VARIABLE_IN_HEADER")}),!1):!0}updateTemplatePreview(){this.onHeaderChange(),this.onBodyChange()}};s.\u0275fac=function(n){return new(n||s)(C(W),C(st),C(ie),C(H),C(te),C(U),C(ne))},s.\u0275cmp=I({type:s,selectors:[["app-message-template"]],viewQuery:function(n,r){if(n&1&&qe(vn,5),n&2){let h;Xe(h=Ke())&&(r.variablesForm=h.first)}},inputs:{previewMode:"previewMode",inputConnection:"inputConnection",inputTemplate:"inputTemplate"},features:[He],decls:55,vars:30,consts:[["variablesForm",""],["editor",""],["editor2",""],[1,"flex","flex-column","h-100","relative","create-template",3,"ngClass"],["class","create-template__header flex flex-row justify-content-between",4,"ngIf"],[1,"flex","flex-column","md:flex-row","w-full","h-full","overflow-y-auto"],["class","create-template__form flex flex-column h-100 overflow-y-visible md:overflow-y-auto",4,"ngIf"],[1,"create-template__preview","flex","flex-column","align-items-center"],[1,"phone-preview",3,"ngClass"],[1,"top-bar"],[1,"top-bar-info"],[1,"time"],[1,"icons"],[1,"signal"],["iconName","signal_cellular_alt","size","14px"],[1,"wifi"],["iconName","wifi","size","14px"],[1,"battery"],["iconName","battery_horiz_075","size","14px"],[1,"contact-info"],["iconName","arrow_back","size","20px"],[1,"contact-icon"],[1,"contact-name","w-full"],["iconName","more_vert","size","20px"],[1,"message-container"],[1,"advice-bubble"],["class","message-bubble",4,"ngIf"],[1,"bottom-bar"],[1,"message-input"],["iconName","emoji_emotions","size","20px"],[1,"message-input-text","w-full"],["iconName","attach_file","size","20px"],["iconName","camera_alt","size","20px"],[1,"audio-button"],["iconName","mic","size","20px"],[1,"create-template__variables","overflow-y-visible","md:overflow-y-auto"],[1,"flex","flex-column","gap--8","overflow-y-auto",3,"formGroup"],[1,"flex","flex-row","align-items--center","variables-dropdown","justify-content-between"],[1,"text","text--bold"],["formArrayName","variables",1,"variables-form","overflow-auto"],[1,"text"],["class","flex flex-column variables-list gap-8px w-full",4,"ngIf"],["variant","text","styleClass","add-var-button",3,"disabled","onClick",4,"ngIf"],[4,"ngIf"],[3,"setParentRelative",4,"ngIf"],[1,"create-template__header","flex","flex-row","justify-content-between"],[1,"header__title-icon","flex","flex-row","align-items-center"],[1,"header__title"],[1,"header__actions","flex","flex-row","align-items-center"],["variant","text","styleClass","cancel-button",3,"onClick","label"],["styleClass","save-button",3,"onClick","disabled","pTooltip","tooltipPosition"],[1,"create-template__form","flex","flex-column","h-100","overflow-y-visible","md:overflow-y-auto"],[1,"flex","flex-column","gap--8",3,"formGroup"],[1,"flex","flex-column","w-full","form-field"],[1,"prime-label"],[1,"text-danger"],["daptaTooltip","",1,"pi","pi-question-circle"],["width","200px","maxHeightContent","250px"],[1,"text-align--center","text--14","padding--8","line-height--16","display--block"],["formControlName","name",3,"type","placeholder","readonly"],["appendTo","body","formControlName","language","styleClass","w-full",1,"w-full","notranslate",3,"options","placeholder","optionLabel","optionValue","filter"],["appendTo","body","formControlName","category","styleClass","w-full",1,"w-full","notranslate",3,"options","placeholder","optionLabel","optionValue","filter"],[1,"flex","flex-row","align-items-center","gap--8","margin-bottom--8","flex-wrap"],["class","header-type-card",3,"ngClass","click",4,"ngFor","ngForOf"],["formControlName","header","daptaInputVariables","","varsColorTheme","instructions-prompt","class","notranslate",3,"options","style","editorInstance","spellcheck","promptEditorMode","ngModelChange",4,"ngIf"],["class","characters-counter",3,"ngClass",4,"ngIf"],["formControlName","body","daptaInputVariables","","varsColorTheme","instructions-prompt",1,"notranslate",3,"ngModelChange","options","editorInstance","spellcheck","promptEditorMode"],[1,"characters-counter",3,"ngClass"],[1,"header-type-card",3,"click","ngClass"],[1,"header-type-card-icon"],["size","28px",3,"iconName"],[1,"header-type-card-content"],[1,"header-type-card-title"],["class","text--14",4,"ngIf"],[1,"text--14"],[1,"text--bold","text--focus"],["formControlName","header","daptaInputVariables","","varsColorTheme","instructions-prompt",1,"notranslate",3,"ngModelChange","options","editorInstance","spellcheck","promptEditorMode"],[1,"message-bubble"],["class","message-bubble-header",4,"ngIf"],["class","message-bubble-header document-header",4,"ngIf"],["class","message-bubble-text header-text",4,"ngIf"],[1,"message-bubble-text"],[1,"message-bubble-time"],[1,"message-bubble-header"],["src","../../../../../assets/layout/images/logo-dapta-fondo-negro.jpg","alt","Header Image",1,"message-bubble-image"],["src","https://dapta-media-files.s3.us-east-2.amazonaws.com/dapta-logo-short.mp4","alt","Header Video","controls","","loop","","muted","","playsinline","",1,"message-bubble-video"],[1,"message-bubble-header","document-header"],["src","../../../../../assets/layout/images/pdf-icon.png","alt","Header Image",1,"document-icon"],[1,"document-name"],[1,"document-size"],[1,"message-bubble-text","header-text"],[1,"flex","flex-column","variables-list","gap-8px","w-full"],["class","variable-row w-full",3,"formGroupName",4,"ngFor","ngForOf"],[1,"variable-row","w-full",3,"formGroupName"],["formControlName","key",1,"w-full",3,"blur","label","type","placeholder","inputClass","readonly"],["formControlName","value",1,"w-full",3,"blur","label","placeholder","inputClass","readonly"],["variant","text","styleClass","dapta-button--w
2hite delete-var-button",3,"onClick","disabled"],["iconName","delete","iconClass","agent-chat__add-icon ",3,"size"],["class","variable-preview flex flex-column gap--8 w-full",3,"formGroupName",4,"ngFor","ngForOf"],[1,"variable-preview","flex","flex-column","gap--8","w-full",3,"formGroupName"],[1,"text--bold"],["formControlName","value",1,"w-full",3,"blur","placeholder","inputClass","readonly"],["variant","text","styleClass","add-var-button",3,"onClick","disabled"],["iconName","add","iconClass","agent-chat__add-icon",3,"size"],[3,"setParentRelative"]],template:function(n,r){n&1&&(o(0,"div",3),x(1,wn,14,19,"div",4),o(2,"div",5),x(3,Fn,76,66,"div",6),o(4,"div",7)(5,"div",8)(6,"div",9)(7,"div",10)(8,"h5",11),p(9),l(),o(10,"div",12)(11,"div",13),f(12,"dapta-material-icon",14),l(),o(13,"div",15),f(14,"dapta-material-icon",16),l(),o(15,"div",17),f(16,"dapta-material-icon",18),l()()(),o(17,"div",19),f(18,"dapta-material-icon",20)(19,"div",21),o(20,"h3",22),p(21,"Andrea"),l(),f(22,"dapta-material-icon",23),l()(),o(23,"div",24)(24,"div",25)(25,"p"),p(26),m(27,"translate"),l()(),x(28,Bn,9,6,"div",26),l(),o(29,"div",27)(30,"div",28),f(31,"dapta-material-icon",29),o(32,"p",30),p(33),m(34,"translate"),l(),f(35,"dapta-material-icon",31)(36,"dapta-material-icon",32),l(),o(37,"button",33),f(38,"dapta-material-icon",34),l()()()(),o(39,"div",35)(40,"form",36)(41,"div",37)(42,"h3",38),p(43),m(44,"translate"),l()(),o(45,"div",39,0)(47,"p",40),p(48),m(49,"translate"),l(),x(50,zn,2,1,"div",41)(51,jn,2,1,"div",41),l(),x(52,Un,4,5,"dui-button",42),l()()(),x(53,Wn,1,0,"dapta-loader",43),l(),x(54,$n,1,1,"dapta-loader",44)),n&2&&(c("ngClass",ee(26,kt,r.previewMode)),i(),c("ngIf",!r.previewMode),i(2),c("ngIf",!r.loadingForm&&!r.previewMode),i(2),Ye("background-image","url(assets/layout/images/whatsapp-background.jpg)"),c("ngClass",ee(28,kt,r.previewMode)),i(4),w(r.currentTime),i(17),w(d(27,18,"this-chat-is-with-official-account-of-app-name-tap-to-learn-more")),i(2),c("ngIf",r.exampleMessageText),i(5),w(d(34,20,"message")),i(7),c("formGroup",r.whatsappAldeamoTemplateForm),i(3),w(d(44,22,"variables")),i(5),w(d(49,24,"add-example-variables-to-see-how-they-will-be-displayed-in-the-template")),i(2),c("ngIf",!r.previewMode),i(),c("ngIf",r.previewMode),i(),c("ngIf",!r.previewMode),i(),c("ngIf",r.loadingForm),i(),c("ngIf",r.savingTemplate||r.loadingTemplate||r.loadingConnection))},dependencies:[N,tt,j,L,_e,gt,R,X,$,q,B,K,Y,ot,rt,fe,ue,ae,ge,ut,Te,wt,ve,Tt,G,z,k,V,A],styles:['.create-template[_ngcontent-%COMP%]{width:100%;padding:var(--page-padding)}.create-template__header[_ngcontent-%COMP%]{padding:0 0 16px}.create-template__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;width:100%;padding:0 16px 1px 1px}.create-template__variables[_ngcontent-%COMP%]{width:100%;padding-left:16px}.create-template[_ngcontent-%COMP%]   .save-button[_ngcontent-%COMP%]{width:185px}.create-template.preview-mode[_ngcontent-%COMP%]{padding:0}.prime-label[_ngcontent-%COMP%]{margin-bottom:4px;font-size:var(--text-font-size);color:var(--contrast-50);font-weight:var(--font-weight-semibold);line-height:var(--line-height-title)}.text--bold[_ngcontent-%COMP%]{font-weight:var(--font-weight-semibold)}.text--focus[_ngcontent-%COMP%]{color:var(--primary-500)}.phone-preview[_ngcontent-%COMP%]{width:310px;height:610px;background-color:#e5ddd5;background-size:cover;background-position:center;background-repeat:no-repeat;border-radius:30px;border:10px solid #383838;position:relative;overflow:hidden;display:flex;flex-direction:column;margin:0 0 0 16px}.phone-preview[_ngcontent-%COMP%]   .top-bar[_ngcontent-%COMP%]{background-color:#008069;color:var(--contrast-100);padding:8px 10px;display:flex;flex-direction:column;gap:8px}.phone-preview[_ngcontent-%COMP%]   .top-bar-info[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.phone-preview[_ngcontent-%COMP%]   .top-bar[_ngcontent-%COMP%]   .time[_ngcontent-%COMP%]{font-size:var(--font-size-caption);font-weight:600;margin:0}.phone-preview[_ngcontent-%COMP%]   .top-bar[_ngcontent-%COMP%]   .icons[_ngcontent-%COMP%], .phone-preview[_ngcontent-%COMP%]   .to
2p-bar[_ngcontent-%COMP%]   .contact-info[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:8px}.phone-preview[_ngcontent-%COMP%]   .top-bar[_ngcontent-%COMP%]   .contact-info[_ngcontent-%COMP%]   .contact-icon[_ngcontent-%COMP%]{width:30px;min-width:30px;height:30px;border-radius:50%;background-color:var(--contrast-50);overflow:hidden}.phone-preview[_ngcontent-%COMP%]   .top-bar[_ngcontent-%COMP%]   .contact-info[_ngcontent-%COMP%]   .contact-name[_ngcontent-%COMP%]{font-size:var(--font-size-body);font-weight:600;margin:0}.phone-preview[_ngcontent-%COMP%]   .message-container[_ngcontent-%COMP%]{display:flex;padding:10px 12px;flex-direction:column;gap:16px;width:100%;height:100%;overflow-y:auto}.phone-preview[_ngcontent-%COMP%]   .advice-bubble[_ngcontent-%COMP%]{background:#ebfaf5;color:var(--space-200);padding:8px;border-radius:12px;text-align:center;font-size:var(--font-size-caption);width:fit-content}.phone-preview[_ngcontent-%COMP%]   .advice-bubble[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0}.phone-preview[_ngcontent-%COMP%]   .document-header[_ngcontent-%COMP%]{gap:8px;display:flex;flex-direction:row;align-items:center;width:100%;height:100%;background:#f7f7f7;border-radius:6px;padding:4px;margin-bottom:4px}.phone-preview[_ngcontent-%COMP%]   .document-header[_ngcontent-%COMP%]   .document-icon[_ngcontent-%COMP%]{width:30px;height:30px;object-fit:contain;border-radius:6px}.phone-preview[_ngcontent-%COMP%]   .document-header[_ngcontent-%COMP%]   .document-name[_ngcontent-%COMP%]{font-size:var(--font-size-caption);font-weight:var(--font-weight-semibold);margin:0;color:var(--space-500)}.phone-preview[_ngcontent-%COMP%]   .document-header[_ngcontent-%COMP%]   .document-size[_ngcontent-%COMP%]{font-size:var(--font-size-caption);font-weight:var(--font-weight-regular);margin:0;color:var(--space-200)}.phone-preview[_ngcontent-%COMP%]   .message-bubble[_ngcontent-%COMP%]{background:var(--contrast-50);border-radius:0 6px 6px;padding:4px 8px;width:fit-content;min-width:80%;max-width:80%;text-align:left;position:relative;margin:0 0 0 8px;display:flex;flex-direction:column}.phone-preview[_ngcontent-%COMP%]   .message-bubble[_ngcontent-%COMP%]:before{content:"";position:absolute;top:0;left:-8px;width:0;height:0;border:8px solid transparent;border-top:none;border-right-color:var(--contrast-50);border-left:none}.phone-preview[_ngcontent-%COMP%]   .message-bubble[_ngcontent-%COMP%]   .message-bubble-text[_ngcontent-%COMP%]{color:var(--space-500);font-size:var(--font-size-body);margin:0;word-break:break-word}.phone-preview[_ngcontent-%COMP%]   .message-bubble[_ngcontent-%COMP%]   .message-bubble-text.header-text[_ngcontent-%COMP%]{font-weight:var(--font-weight-semibold)}.phone-preview[_ngcontent-%COMP%]   .message-bubble[_ngcontent-%COMP%]   .message-bubble-video[_ngcontent-%COMP%]{width:100%;max-height:200px;object-fit:cover;border-radius:6px}.phone-preview[_ngcontent-%COMP%]   .message-bubble[_ngcontent-%COMP%]   .message-bubble-image[_ngcontent-%COMP%]{width:100%;height:100px;object-fit:cover;border-radius:6px}.phone-preview[_ngcontent-%COMP%]   .message-bubble[_ngcontent-%COMP%]   .message-bubble-time[_ngcontent-%COMP%]{font-size:8px;font-weight:600;margin:auto 0 0;color:var(--space-200);align-self:flex-end}.phone-preview[_ngcontent-%COMP%]   .bottom-bar[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:8px;width:100%;padding:0 8px 8px}.phone-preview[_ngcontent-%COMP%]   .bottom-bar[_ngcontent-%COMP%]   .message-input[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;color:var(--space-200);background:var(--contrast-50);border-radius:30px;padding:8px;gap:8px;width:100%}.phone-preview[_ngcontent-%COMP%]   .bottom-bar[_ngcontent-%COMP%]   .audio-button[_ngcontent-%COMP%]{background:#05a884;border-radius:30px;padding:8px;width:36px;height:36px;min-width:36px;min-height:36px;display:flex;align-items:center;justify-content:center}.phone-preview.preview-mode[_ngcontent-%COMP%]   .phone-preview[_ngcontent-%COMP%]{margin:0}.variables-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;height:100%}.variables-list[_ngcontent-%COMP%]{padding:1px}.variable-row[_ngcontent-%COMP%]{display:flex;gap:8px;align-items:start}.variable-input[_ngcontent-%COMP%]{flex:1}.add-var-button[_ngcontent-%COMP%]{padding:4px;margin-left:-6px;margin-top:12px;margin-bottom:8px;font-size:var(--font-size-body);gap:4px;display:flex;align-items:center}.delete-var-button[_ngcontent-%COMP%]{padding:4px 2px;font-size:var(--font-size-title);margin-top:34px}.header-type-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px;border-radius:6px;border:2px solid var(--space-500);background:var(--space-500);width:90px;min-width:90px;height:90px;min-height:90px;cursor:pointer;font-size:var(--font-size-body)}.header-type-card.active[_ngcontent-%COMP%]{border-color:var(--primary-500);background:var(--space-300);border-width:2px}.characters-counter[_ngcontent-%COMP%]{font-size:var(--font-size-caption);color:var(--space-100);margin-top:4px}.characters-counter.error[_ngcontent-%COMP%]{color:var(--danger-500)}@media(max-width:768px){.header__title[_ngcontent-%COMP%]{font-size:16px}.save-button[_ngcontent-%COMP%]{width:fit-content!important;max-width:unset}.create-template__form[_ngcontent-%COMP%]{order:0}.create-template__preview[_ngcontent-%COMP%]{order:2}.phone-preview[_ngcontent-%COMP%]{margin:16px 0 0}.create-template__variables[_ngcontent-%COMP%]{margin-top:16px;padding-left:0;order:1}}']});let e=s;return e})();var qn=[{path:"",component:Se},{path:":id",component:Oe},{path:":id/connections/:connectionId",component:Pe},{path:":id/connections/:connectionId/create-template",component:le},{path:":id/connections/:connectionId/edit-template/:templateId",component:le}],Dt=(()=>{let s=class s{};s.\u0275fac=function(n){return new(n||s)},s.\u0275mod=pe({type:s}),s.\u0275inj=se({imports:[Fe.forChild(qn),Fe]});let e=s;return e})();var to=(()=>{let s=class s{};s.\u0275fac=function(n){return new(n||s)},s.\u0275mod=pe({type:s}),s.\u0275inj=se({imports:[N,Dt,B,R,Pt,xe,xt,G,bt,It,ct,he,ge,Te,ve,_e,Se,ye,Oe,Pe,le]});let e=s;return e})();export{to as ChannelsModule};

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.