Viewing File: /usr/local/cpanel/base/frontend/jupiter/dynamic-dns/main.js

"use strict";(self.webpackChunkdynamic_dns=self.webpackChunkdynamic_dns||[]).push([[792],{2611:(v,B,c)=>{var D=c(345),t=c(3953),_=c(177),I=c(8621),V=c(728),b=c(7901),m=c(9417),P=c(1562),N=c(6443),l=c(6928),j=c(1960),G=c(3658),A=c(7468),L=c(6381),u=c(6153),x=function(s){return s.up="icon-arrow-up",s.down="icon-arrow-down",s}(x||{}),X=c(1397),S=c(6354),Y=c(253),f=c(2940),g=c(6802),U=c(686),O=c(7673),H=c(1985);let T=(()=>{class s{constructor(e){this._http=e}createDDNSConfig(e){const i=new f.V({namespace:"DynamicDNS",method:"create",arguments:[new g.e("domain",e.domain),new g.e("description",e.description?e.description:""),new g.e("ip",e.ip?e.ip:"")]});return this._http.post(i).pipe((0,X.Z)(n=>{if(1===n.status)return e.ip?this.setManualIP(n.data.id,e.ip):(0,O.of)(n.data.id);throw n.errors.pop()}))}deleteDDNSConfig(e){const i=new f.V({namespace:"Batch",method:"strict",arguments:this._createBatchArgs(e,"delete")});return this._http.post(i).pipe((0,S.T)(n=>{if(1===n.status)return n.data;throw n.errors.pop()}))}fetchDDNSConfigs(e,i,n,o){const a=new f.V({namespace:"DynamicDNS",method:"list",sorts:[new u.FU(e,i)],pager:new U.is(n,o)});return this._http.post(a).pipe((0,S.T)(d=>{if(1===d.status)return d;throw d.errors.pop()}))}fetchDomains(){if(!this._zonesObsv$){const e=new f.V({namespace:"DomainInfo",method:"list_domains"});this._zonesObsv$=this._http.post(e).pipe((0,S.T)(i=>{let n=[i.data.main_domain];return n=n.concat(i.data.addon_domains,i.data.parked_domains),n}),(0,Y.t)(1))}return this._zonesObsv$}getSSLCert(e){const i=new f.V({namespace:"SSL",method:"fetch_cert_info",arguments:[new g.e("id",e)]});return this._http.post(i).pipe((0,S.T)(n=>{if(1===n.status)return n.data;throw n.data.statusmsg}))}getSSLCerts(e){const i=new f.V({namespace:"SSL",method:"fetch_certificates_for_fqdns",arguments:[new g.e("domains",e)]});return this._http.post(i).pipe((0,S.T)(n=>{if(1===n.status)return n.data;throw n.data.statusmsg}))}recreateDDNSURL(e){const i=new f.V({namespace:"Batch",method:"strict",arguments:this._createBatchArgs(e,"recreate")});return this._http.post(i).pipe((0,S.T)(n=>{if(1===n.status)return n.data;throw n.messages.pop()}))}saveDDNSDescription(e,i){const n=new f.V({namespace:"DynamicDNS",method:"set_description",arguments:[new g.e("id",e),new g.e("description",i)]});return this._http.post(n).pipe((0,S.T)(o=>{if(1===o.status)return!0;throw o.messages.pop()}))}setManualIP(e,i){const n=/^[0-9\.]+$/.test(i)?"ipv4":"ipv6",o=`/cpanelwebcall/${e}/${n}/${i}`;return new H.c(d=>{const h=new XMLHttpRequest;h.open("GET",o),h.addEventListener("error",C=>{d.error()}),h.addEventListener("load",C=>{d.next(e),d.complete()}),h.send()})}_createBatchArgs(e,i){const n=[];let o,a,d;return e.forEach((h,C)=>{o=["DynamicDNS",i,{id:h}],a=JSON.stringify(o),d=new g.e(`command-${C}`,a),n.push(d)}),n}static#t=this.\u0275fac=function(i){return new(i||s)(t.KVO(G.dF))};static#e=this.\u0275prov=t.jDH({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();const w=s=>({disabled:s}),z=s=>({"hidden-xs":s}),J=(s,r)=>({"fa-chevron-down":s,"fa-chevron-right":r});function Q(s,r){1&s&&t.nrm(0,"i",44)}function K(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",37)(1,"div",38)(2,"cp-callout",39)(3,"span",40),t.EFF(4),t.k0s(),t.nrm(5,"div",41),t.j41(6,"cp-action-button",42),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.deleteDDNSConfig())}),t.DNE(7,Q,1,0,"i",43),t.EFF(8),t.k0s()()()()}if(2&s){const e=t.XpG();t.R7$(4),t.JRh(e.deleteConfimationHeader),t.R7$(),t.Y8G("innerHTML",e.deleteConfirmationWarningText,t.npT),t.R7$(),t.Y8G("buttonState",e.deleteBtnState),t.R7$(),t.Y8G("ngIf",!e.isDeletingConfigs),t.R7$(),t.SpI(" ",e.locale.maketext("Delete ([_1])?",e.numberOfRowsChecked)," ")}}function q(s,r){if(1&s){const e=t.RV6();t.j41(0,"ul",45)(1,"li",46)(2,"a",47),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.recreateDDNSURL())}),t.EFF(3),t.k0s()(),t.j41(4,"li",46)(5,"a",47),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.toggleDeleteConfirmation(!0))}),t.EFF(6),t.k0s()()()}if(2&s){const e=t.XpG();t.R7$(2),t.BMQ("aria-label",e.aria.actionBtnRecreatelabel),t.R7$(),t.JRh(e.locale.maketext("Recreate URL")),t.R7$(2),t.BMQ("aria-label",e.aria.actionBtnDeleteLabel),t.R7$(),t.JRh(e.locale.maketext("Delete"))}}function W(s,r){if(1&s){const e=t.RV6();t.j41(0,"ul",48)(1,"li",46)(2,"cp-page-size-selector",49),t.bIt("optionSelected",function(n){t.eBV(e);const o=t.XpG();return t.Njj(o.updatePaginationByNums(n))}),t.k0s()()()}if(2&s){const e=t.XpG();t.R7$(2),t.Y8G("selectedPageSize",e.pagination.recordsPerPage)}}function Z(s,r){if(1&s&&t.nrm(0,"i",55),2&s){const e=t.XpG(3);t.Y8G("ngClass",e.caretClass)}}function tt(s,r){if(1&s){const e=t.RV6();t.j41(0,"a",53),t.bIt("click",function(){t.eBV(e);const n=t.XpG().$implicit,o=t.XpG();return t.Njj(o.sortColumn(n))}),t.EFF(1),t.DNE(2,Z,1,1,"i",54),t.k0s()}if(2&s){const e=t.XpG().$implicit,i=t.XpG();t.BMQ("title",i.getSortBtnTitle(e)),t.R7$(),t.SpI(" ",e.name," "),t.R7$(),t.Y8G("ngIf",e.hasCaret)}}function et(s,r){if(1&s&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&s){const e=t.XpG().$implicit;t.R7$(),t.JRh(e.name)}}function nt(s,r){if(1&s&&(t.qex(0),t.j41(1,"th",50),t.DNE(2,tt,3,3,"a",51)(3,et,2,1,"span",52),t.k0s(),t.bVm()),2&s){const e=r.$implicit;t.R7$(),t.Y8G("ngClass",t.eq3(3,z,"ip"===e.columnID||"url"===e.columnID)),t.R7$(),t.Y8G("ngIf",e.sortable),t.R7$(),t.Y8G("ngIf",!e.sortable)}}function it(s,r){if(1&s&&(t.j41(0,"tr",56)(1,"td",57),t.nrm(2,"i",58),t.EFF(3),t.k0s()()),2&s){const e=t.XpG();t.R7$(3),t.SpI(" ",e.locale.maketext("Fetching your dynamic [asis,DNS] configurations.")," ")}}function st(s,r){if(1&s&&(t.j41(0,"tr",56)(1,"td",57),t.EFF(2),t.k0s()()),2&s){const e=t.XpG();t.R7$(2),t.SpI(" ",e.locale.maketext("No [asis,DDNS] configuration. Click \u201cCreate\u201d to begin.")," ")}}function ot(s,r){if(1&s&&(t.j41(0,"p"),t.EFF(1),t.k0s()),2&s){const e=t.XpG(3);t.R7$(),t.SpI(" ",e.locale.maketext("None")," ")}}function at(s,r){if(1&s&&(t.qex(0),t.j41(1,"p"),t.EFF(2),t.k0s(),t.bVm()),2&s){const e=r.$implicit;t.R7$(2),t.JRh(e)}}function lt(s,r){if(1&s&&(t.j41(0,"p"),t.EFF(1),t.k0s()),2&s){const e=t.XpG(3);t.R7$(),t.JRh(e.noCertText)}}function rt(s,r){if(1&s&&(t.j41(0,"a",82),t.nrm(1,"span",83),t.EFF(2),t.k0s()),2&s){const e=t.XpG(2),i=e.$implicit,n=e.index,o=t.XpG();t.Mz_("id","viewDDNSSSLBtn_",n,""),t.FS9("href",i.certURL,t.B4B),t.R7$(2),t.SpI(" ",o.locale.maketext("View [asis,SSL] certificate[comment, this is button text to view an SSL certificate]")," ")}}function ct(s,r){if(1&s&&(t.j41(0,"a",84),t.nrm(1,"span",83),t.EFF(2),t.k0s()),2&s){const e=t.XpG(2),i=e.$implicit,n=e.index,o=t.XpG();t.Mz_("id","viewDDNSSSLBtnMobile_",n,""),t.FS9("href",i.certURL,t.B4B),t.R7$(2),t.SpI(" ",o.locale.maketext("View [asis,SSL] certificate[comment, this is button text to view an SSL certificate]")," ")}}function dt(s,r){if(1&s){const e=t.RV6();t.j41(0,"tr",61)(1,"td",62)(2,"label",63)(3,"input",64),t.mxI("ngModelChange",function(n){t.eBV(e);const o=t.XpG().$implicit;return t.DH7(o.checked,n)||(o.checked=n),t.Njj(n)}),t.bIt("click",function(){t.eBV(e);const n=t.XpG().$implicit,o=t.XpG();return t.Njj(o.toggleCheckbox(n))}),t.k0s()()(),t.j41(4,"td",65)(5,"div",66)(6,"button",67),t.bIt("click",function(){t.eBV(e);const n=t.XpG().$implicit,o=t.XpG();return t.Njj(o.toggleRolldown(n))}),t.j41(7,"span",27),t.EFF(8,"Expand row"),t.k0s(),t.nrm(9,"i",68),t.k0s()(),t.j41(10,"span",69),t.EFF(11),t.j41(12,"span",70,0)(14,"span",71),t.bIt("click",function(){t.eBV(e);const n=t.XpG().$implicit,o=t.XpG();return t.Njj(o.toggleRolldown(n))}),t.EFF(15),t.k0s(),t.j41(16,"button",72),t.bIt("click",function(){t.eBV(e);const n=t.XpG().$implicit,o=t.XpG();return t.Njj(o.toggleRolldown(n))}),t.nrm(17,"i",73),t.k0s()()()(),t.j41(18,"td",74),t.DNE(19,ot,2,1,"p",52)(20,at,3,1,"ng-container",31),t.k0s(),t.j41(21,"td",74)(22,"span",75)(23,"div",76),t.EFF(24),t.k0s(),t.j41(25,"a",77),t.bIt("click",function(){t.eBV(e);const n=t.XpG().$implicit,o=t.XpG();return t.Njj(o.copyTextToClipboard(n.ddnsURL))}),t.j41(26,"span",78),t.EFF(27),t.k0s(),t.nrm(28,"i",79),t.k0s()()(),t.j41(29,"td"),t.DNE(30,lt,2,1,"p",52)(31,rt,3,4,"a",80)(32,ct,3,4,"a",81),t.k0s()()}if(2&s){const e=t.XpG(),i=e.$implicit,n=e.index,o=t.XpG();t.Y8G("id","ddns-list__domain--"+i.domain),t.R7$(2),t.Mz_("for","rowCheckbox_",n,""),t.BMQ("aria-label",o.aria.selectRowLabel),t.R7$(),t.Mz_("id","rowCheckbox_",n,""),t.R50("ngModel",i.checked),t.R7$(3),t.Mz_("id","toggleRollDown_",n,""),t.R7$(3),t.Y8G("ngClass",t.l_i(26,J,i.isRolldownVisible,!i.isRolldownVisible)),t.R7$(2),t.SpI(" ",i.domain," "),t.R7$(3),t.Y8G("title",o.getDescriptionText(i)),t.R7$(),t.JRh(o.getDescriptionText(i)),t.R7$(),t.FS9("name",o.locale.maketext("Edit description.")),t.Mz_("id","descriptionEditBtn_",n,""),t.BMQ("aria-label",o.aria.editDescIconBtn),t.R7$(3),t.Y8G("ngIf",!i.ips.length),t.R7$(),t.Y8G("ngForOf",i.ips),t.R7$(4),t.JRh(i.ddnsURL),t.R7$(),t.Mz_("id","urlCopyBtn_",n,""),t.R7$(2),t.JRh(o.locale.maketext("Copy")),t.R7$(3),t.Y8G("ngIf",i.showNoCertText),t.R7$(),t.Y8G("ngIf",i.isViewSSLCertBtnVisible),t.R7$(),t.Y8G("ngIf",i.isViewSSLCertBtnVisible)}}function pt(s,r){1&s&&t.nrm(0,"span",100)}function mt(s,r){if(1&s&&(t.j41(0,"p"),t.EFF(1),t.k0s()),2&s){const e=t.XpG(3);t.R7$(),t.SpI(" ",e.locale.maketext("None")," ")}}function ut(s,r){if(1&s&&(t.qex(0,95),t.j41(1,"p"),t.EFF(2),t.k0s(),t.bVm()),2&s){const e=r.$implicit,i=t.XpG(2).index;t.Mz_("id","ddnsIPMobile_",i,""),t.R7$(2),t.JRh(e)}}function ht(s,r){if(1&s){const e=t.RV6();t.j41(0,"tr",85)(1,"td",86)(2,"div",87)(3,"div",37)(4,"div",88)(5,"label",63),t.EFF(6),t.k0s(),t.j41(7,"textarea",89,1),t.EFF(9),t.k0s(),t.j41(10,"cp-action-button",90),t.bIt("click",function(){t.eBV(e);const n=t.sdS(8),o=t.XpG().$implicit,a=t.XpG();return t.Njj(a.saveDescription(o,n))}),t.DNE(11,pt,1,0,"span",91),t.EFF(12),t.k0s(),t.j41(13,"button",92),t.bIt("click",function(){t.eBV(e);const n=t.XpG().$implicit,o=t.XpG();return t.Njj(o.toggleRolldown(n))}),t.EFF(14),t.k0s()(),t.j41(15,"div",93)(16,"cp-form-label",94),t.EFF(17),t.k0s(),t.j41(18,"p",95),t.EFF(19),t.k0s(),t.j41(20,"cp-form-label",94),t.EFF(21),t.k0s(),t.j41(22,"p",95),t.EFF(23),t.k0s(),t.j41(24,"div",96),t.nrm(25,"label",97),t.j41(26,"p",95),t.EFF(27),t.k0s(),t.j41(28,"a",98),t.bIt("click",function(){t.eBV(e);const n=t.XpG().$implicit,o=t.XpG();return t.Njj(o.copyTextToClipboard(n.ddnsURL))}),t.j41(29,"span",78),t.EFF(30),t.k0s(),t.nrm(31,"i",79),t.k0s()(),t.j41(32,"div",96),t.nrm(33,"label",97),t.DNE(34,mt,2,1,"p",52)(35,ut,3,3,"ng-container",99),t.k0s()()()()()()}if(2&s){const e=t.XpG(),i=e.$implicit,n=e.index,o=t.XpG();t.Y8G("id","ddns-list__rolldown--"+i.domain),t.R7$(5),t.Mz_("for","editDescriptionInput_",n,""),t.R7$(),t.JRh(o.locale.maketext("Description")),t.R7$(),t.Mz_("id","editDescriptionInput_",n,""),t.Mz_("name","editDescriptionInput_",n,""),t.R7$(2),t.JRh(i.description),t.R7$(),t.Mz_("id","saveDescriptionBtn_",n,""),t.Y8G("buttonClass",o.saveDescriptionBtnClass)("buttonState",i.editDescBtnState),t.R7$(),t.Y8G("ngIf","enabled"===i.editDescBtnState),t.R7$(),t.SpI(" ",o.locale.maketext("Save")," "),t.R7$(),t.Mz_("id","cancelEditDescription+",n,""),t.R7$(),t.SpI(" ",o.locale.maketext("Cancel")," "),t.R7$(2),t.Mz_("id","lastUpdatedTimeLabel_",n,""),t.Mz_("for","lastUpdatedTimeText_",n,""),t.Y8G("showInfoBlock",!0)("labelText",o.locale.maketext("Last Update Time")),t.R7$(),t.SpI(" ",o.locale.maketext("The last time the [asis,IP] address changed.")," "),t.R7$(),t.Mz_("id","lastUpdatedTimeText_",n,""),t.R7$(),t.SpI(" ",i.lastUpdatedTime," "),t.R7$(),t.Mz_("id","lastRunTimeLabel_",n,""),t.Mz_("for","lastRunTimeText_",n,""),t.Y8G("showInfoBlock",!0)("labelText",o.locale.maketext("Last Run Time")),t.R7$(),t.SpI(" ",o.locale.maketext("The last time a request to update the [asis,IP] address happened.")," "),t.R7$(),t.Mz_("id","lastRunTimeText_",n,""),t.R7$(),t.SpI(" ",i.lastRunTime," "),t.R7$(2),t.Mz_("id","ddnsURLMobileLabel_",n,""),t.Mz_("for","ddnsURLMobile_",n,""),t.Y8G("innerHTML",o.locale.maketext("[output,strong,URL][comment,this is a form element label]"),t.npT),t.R7$(),t.Mz_("id","ddnsURLMobile_",n,""),t.R7$(),t.SpI(" ",i.ddnsURL," "),t.R7$(),t.Mz_("id","urlCopyBtnMobile_",n,""),t.R7$(2),t.JRh(o.locale.maketext("Copy")),t.R7$(3),t.Mz_("id","ddnsIPMobileLabel_",n,""),t.Mz_("for","ddnsIPMobile_",n,""),t.Y8G("innerHTML",o.locale.maketext("[output,strong,IP Address][comment,this is a form element label]"),t.npT),t.R7$(),t.Y8G("ngIf",!i.ips.length),t.R7$(),t.Y8G("ngForOf",i.ips)}}function _t(s,r){if(1&s&&(t.qex(0),t.DNE(1,dt,33,29,"tr",59)(2,ht,36,56,"tr",60),t.bVm()),2&s){const e=r.$implicit,i=t.XpG();t.R7$(),t.Y8G("ngIf",!i.isContentLoading),t.R7$(),t.Y8G("ngIf",!i.isContentLoading&&e.isRolldownVisible)}}let E=(()=>{class s{constructor(e,i,n,o,a){this._alertService=e,this.locale=i,this._router=n,this._ddnsService=o,this._locationService=a,this.allRowsChecked=!1,this.anyRowChecked=!1,this.caretClass=x.up,this.deleteBtnState=l.kj.enabled,this.isContentLoading=!0,this.isDeleteConfirmationVisible=!1,this.pagination={page:1,recordsPerPage:20,totalPages:0,totalRecords:0,start:0}}get aria(){return{actionBtnControl:"tableRowsActionList",actionListLabelledBy:"tableRowsActionBtn",actionBtnRecreateLabel:this.locale.maketext("Recreate [asis,url]."),actionBtnDeleteLabel:this.locale.maketext("Delete [asis,url]."),editDescIconBtn:this.locale.maketext("Edit description."),selectAllRowsLabel:this.locale.maketext("Select all rows."),selectRowLabel:this.locale.maketext("Select row."),sectionTitleDescription:this.locale.maketext("Use this interface to view a list of your dynamic [asis,DNS] ([asis,DDNS]) domains.")}}get checkedRowIDs(){const e=[];return this.ddnsConfigs.forEach(i=>{i.checked&&e.push(i.id)}),e}get deleteConfimationHeader(){return this.locale.maketext("Delete the selected dynamic [asis,DNS] domains?")}get deleteConfirmationWarningText(){return this.locale.maketext("This will [output,strong,not] delete the associated [asis,SSL] certificate, if one exists.")}get descriptionTextPt1(){return this.locale.maketext("This feature lets you utilize a Domain Name System ([asis,DNS]) hosted on the [asis,cPanel] server to resolve a hostname that exists on an external network with a dynamic [asis,IP] address. This will let you manage your network devices without the need to manually update the devices\u2018 settings any time the [asis,IP] address changes.")}get descriptionTextPt2(){return`${this.locale.maketext("For example, a domain administrator can use this feature to have [asis,cPanel] host [asis,DNS] for a hostname that points to your office network\u2018s public [asis,IP] address.")} ${this.locale.maketext("For more information, read the [output,url,_1,feature documentation,class,externalLink,target,_2,id,_3].","https://go.cpanel.net/cpaneldocsDynamicDNS","cp-dynamic-dns-docs","linkDynamicDNSDocumentation")}`}get isDeletingConfigs(){return this.deleteBtnState===l.kj.loading}get noDescriptionText(){return this.locale.maketext("Add a description.")}get numberOfRowsChecked(){return this.ddnsConfigs.filter(i=>i.checked).length}get saveDescriptionBtnClass(){return"btn-outline-primary btn-sm"}copyTextToClipboard(e){const i=document.createElement("textarea");i.value=e,document.body.appendChild(i),i.select(),document.execCommand("copy")?this._alertService.success(this.locale.maketext("Successfully copied to the clipboard.")):this._alertService.error(this.locale.maketext("Copy failed.")),document.body.removeChild(i)}deleteDDNSConfig(){this.deleteBtnState=l.kj.loading;const e=this._ddnsService.deleteDDNSConfig(this.checkedRowIDs);this._ddnsRecreateConfigSub=e.subscribe({complete:()=>{this._alertService.success(this.locale.maketext("Successfully removed domain(s).")),this.allRowsChecked=!1,this.toggleDeleteConfirmation(!1),this.deleteBtnState=l.kj.enabled,this._fetchDDNSConfigs("domain",u.UE.Ascending)},error:i=>{this.deleteBtnState=l.kj.loading,this._alertService.error(i.message)}})}executeSearch(e){e.trim(),this.ddnsConfigs=e?this._origDDNSList.filter(i=>i.domain.includes(e)||i.ips.filter(o=>o.includes(e)).length?i:void 0):this._origDDNSList}getDescriptionText(e){return e.description.length?e.description:this.noDescriptionText}getShortestParent(e,i){let n;return i.forEach(o=>{const a=o.replace(/\./g,"\\.");new RegExp(`\\.${a}$`).test(e)&&(!n||o.length<n.length)&&(n=o)}),n}getSortBtnTitle(e){return this.locale.maketext("Sort table by \u201c[_1]\u201d.",e.name)}goToCreateForm(){this._router.navigate(["create"])}goToSSLForm(e){this._router.navigate(["ssl"],{queryParams:{cert_id:e.certURL}})}recreateDDNSURL(){const e=this._ddnsService.recreateDDNSURL(this.checkedRowIDs);this._ddnsRecreateConfigSub=e.subscribe({complete:()=>{this.allRowsChecked=!1,this._alertService.success(this.locale.maketext("Successfully recreated URL.")),this._fetchDDNSConfigs("domain",u.UE.Ascending)},error:i=>{this._alertService.error(i.message)}})}saveDescription(e,i){e.editDescBtnState=l.kj.loading;const n=i.value.trim().replace(/\r?\n|\r/g,""),o=this._ddnsService.saveDDNSDescription(e.id,n);this._saveDescriptionSub=o.subscribe({complete:()=>{this._alertService.success(this.locale.maketext("Successfully saved description for \u201c[_1]\u201d.",e.domain)),e.editDescBtnState=l.kj.enabled,e.description=n,this.toggleRolldown(e)},error:a=>{this._alertService.error(a.message),e.editDescBtnState=l.kj.enabled}})}sortColumn(e){if(e.hasCaret)this.caretClass=this.caretClass===x.up?x.down:x.up,e.direction=e.direction===u.UE.Ascending?u.UE.Descending:u.UE.Ascending;else{this.caretClass=x.up;const i=this.tableColumns.map(n=>(n.direction=u.UE.Ascending,n.hasCaret=n.columnID===e.columnID,n));this.tableColumns=i}this.ddnsConfigs.sort((i,n)=>e.direction===u.UE.Ascending?i[e.sortOnName]<n[e.sortOnName]?-1:1:i[e.sortOnName]<n[e.sortOnName]?1:-1)}trackByID(e,i){return i.id}toggleAllRows(){this.allRowsChecked=!this.allRowsChecked,this.anyRowChecked=!!this.allRowsChecked||!this.anyRowChecked,this.isDeleteConfirmationVisible=!1,this.ddnsConfigs.forEach(e=>{e.checked=this.allRowsChecked})}toggleCheckbox(e){if(e.checked=!e.checked,e.checked)this.anyRowChecked=!0;else for(let i=0,n=this.ddnsConfigs.length;i<n;i++){if(this.ddnsConfigs[i].checked){this.anyRowChecked=!0;break}this.anyRowChecked=!1}for(let i=0,n=this.ddnsConfigs.length;i<n;i++){if(!this.ddnsConfigs[i].checked){this.allRowsChecked=!1;break}this.allRowsChecked=!0}this.isDeleteConfirmationVisible=!(!this.isDeleteConfirmationVisible||!this.anyRowChecked)}toggleDeleteConfirmation(e){this.isDeleteConfirmationVisible=e}toggleRolldown(e){e.isRolldownVisible=!e.isRolldownVisible}updatePaginationByPage(e){this.pagination.page!==e&&(this.pagination.page=e,this._fetchDDNSConfigs("domain",u.UE.Ascending))}updatePaginationByNums(e){this.pagination.recordsPerPage!==e&&(this.pagination.recordsPerPage=e,this._fetchDDNSConfigs("domain",u.UE.Ascending))}ngOnInit(){this.noCertText=this.locale.maketext("No certificate available for this domain."),this.tableColumns=[{name:this.locale.maketext("Domain"),sortOnName:"domain",columnID:"domain",sortable:!0,hasCaret:!0,direction:u.UE.Ascending},{name:this.locale.maketext("[asis,IP] Address"),columnID:"ip",sortable:!1,hasCaret:!1,direction:u.UE.Ascending},{name:this.locale.maketext("URL"),sortable:!0,sortOnName:"domain",columnID:"url",hasCaret:!1,direction:u.UE.Ascending},{name:this.locale.maketext("[asis,SSL] Certificate"),columnID:"cert",sortable:!1,hasCaret:!1,direction:u.UE.Ascending}],this._fetchDDNSConfigs("domain",u.UE.Ascending)}ngOnDestroy(){this._ddnsConfigsSub.unsubscribe(),this._ddnsRecreateConfigSub&&this._ddnsRecreateConfigSub.unsubscribe(),this._ddnsDeleteConfigSub&&this._ddnsDeleteConfigSub.unsubscribe(),this._sslStatusSub&&this._sslStatusSub.unsubscribe(),this._checkAutoSSLQueueSub&&this._checkAutoSSLQueueSub.unsubscribe(),this._saveDescriptionSub&&this._saveDescriptionSub.unsubscribe()}_fetchDDNSConfigs(e,i){this.isContentLoading=!0;const n=this._ddnsService.fetchDDNSConfigs(e,i,this.pagination.page,this.pagination.recordsPerPage);let o;this._ddnsConfigsSub=n.subscribe({next:a=>{o=a.data,this.pagination={page:a.meta.page,recordsPerPage:a.meta.pageSize,totalPages:a.meta.totalPages,totalRecords:a.meta.totalRecords,start:a.meta.record}},complete:()=>{o.length?this._checkSSLStatuses(o):(this.isContentLoading=!1,this.ddnsConfigs=[])},error:a=>{this.isContentLoading=!1,this._alertService.error(a.message)}})}_formatDDNSConfigData(e,i,n){const o=[];let a,d,h,C;return e.forEach(p=>{let y="";a=p.last_update_time?this.locale.maketext("[local_datetime,_1,datetime_format_short][comment,this is needed to convert the date to a localized format]",p.last_update_time):this.locale.maketext("None"),d=p.last_run_times.length?this.locale.maketext("[local_datetime,_1,datetime_format_short][comment,this is needed to convert the date to a localized format]",p.last_run_times.sort()[p.last_run_times.length-1]):this.locale.maketext("None"),h=p.ipv4.concat(p.ipv6);for(let $=0,Gt=i.length;$<Gt;$++)i[$].domains.includes(p.domain)&&(C=i[$].id);y=this.getShortestParent(p.domain,n),y=`https://${y}/cpanelwebcall/${p.id}`;const F={domain:p.domain,id:p.id,ips:h.length?h:[],description:null===p.description?"":p.description.trim(),unixLastUpdatedTime:p.last_update_time,unixLastRun:p.last_run_times.length?p.last_run_times.sort()[p.last_run_times.length-1]:null,lastUpdatedTime:a,lastRunTime:d,ddnsURL:y,checked:!1,isViewSSLCertBtnVisible:!1,isRolldownVisible:!1,showNoCertText:!1,editDescBtnState:l.kj.enabled};C?(F.certURL=`https://${this._locationService.hostname}:${this._locationService.port}${this._locationService.pathname}#/ssl?cert_id=${C}`,F.isViewSSLCertBtnVisible=!0):F.showNoCertText=!0,o.push(F)}),o}_checkSSLStatuses(e){const i=e.map(n=>n.domain);this._sslStatusSub=(0,A.p)({sslCerts:this._ddnsService.getSSLCerts(i),userDomains:this._ddnsService.fetchDomains()}).subscribe({next:n=>{this.ddnsConfigs=this._formatDDNSConfigData(e,n.sslCerts,n.userDomains)},complete:()=>{this._origDDNSList=this.ddnsConfigs,this.isContentLoading=!1},error:n=>{this.isContentLoading=!1,this._alertService.error(n)}})}static#t=this.\u0275fac=function(i){return new(i||s)(t.rXU(l.uE),t.rXU(L.h),t.rXU(b.Ix),t.rXU(T),t.rXU(j.N))};static#e=this.\u0275cmp=t.VBU({type:s,selectors:[["cp-ddns-list"]],decls:49,vars:32,consts:[["testEl",""],["editDescInput",""],[1,"description",3,"innerHTML"],[1,"row","search-page-container"],[1,"col-md-6","col-lg-5"],["for","ddnsConfigSearch"],["id","ddnsConfigSearch","role","search",3,"valueChange","label"],[1,"pull-right","text-right","col-md-6","col-lg-7","hidden-xs"],["id","listDDNSDomainsPagination",3,"pageChanged","totalItems","pageSize"],["class","row",4,"ngIf"],[1,"row","action-bar"],[1,"col-xs-12"],[1,"pull-left","flip"],[1,"table-action-button-container"],["for","selectAllRowsCheckbox",1,"table-action-button-label","table-action-button"],["type","checkbox","id","selectAllRowsCheckbox","name","checkAllRows",3,"ngModelChange","click","ngClass","ngModel"],["dropdown","",1,"btn-group","pull-right"],["id","tableRowsActionBtn","dropdownToggle","","type","button",1,"btn","btn-default","dropdown-toggle",3,"ngClass"],["aria-hidden","true",1,"caret"],["id","tableRowsActionList","class","dropdown-menu","role","menu","aria-labelledby","tableRowsActionBtn",4,"dropdownMenu"],[1,"pull-right","flip"],["id","createDDNSBtn",1,"btn","btn-primary",3,"click","ngClass"],[1,"fas","fa-plus"],["dropdown","",1,"btn-group","hidden-xs","pull-right"],["id","pageSizeDropdownBtn","dropdownToggle","","type","button",1,"btn","btn-default","dropdown-toggle",3,"ngClass"],[1,"fas","fa-cog"],[1,"caret"],[1,"sr-only"],["id","paginationDropdownList","class","dropdown-menu dropdown-menu-right","role","menu","aria-labelledby","pageSizeDropdownBtn",4,"dropdownMenu"],["id","ddnsListTable",1,"table","table-striped","responsive-table","details-table"],["scope","col"],[4,"ngFor","ngForOf"],["class","info empty-row",4,"ngIf"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"row","search-page-container","visible-xs-block","visible-sm-block","hidden-md","hidden-lg"],[1,"col-xs-12","col-sm-12","pull-right","text-right"],["id","listDDNSDomainsPaginationMobile",3,"pageChanged","totalItems","pageSize"],[1,"row"],[1,"col-xs-12","col-md-6"],["id","deleteConfirmationCallout","calloutType","warning"],["callout-heading",""],[3,"innerHTML"],["id","confirmDeleteBtn",3,"click","buttonState"],["class","fas fa-trash","aria-hidden","true",4,"ngIf"],["aria-hidden","true",1,"fas","fa-trash"],["id","tableRowsActionList","role","menu","aria-labelledby","tableRowsActionBtn",1,"dropdown-menu"],["role","menuitem"],["href","javascript:void(0)",1,"dropdown-item",3,"click"],["id","paginationDropdownList","role","menu","aria-labelledby","pageSizeDropdownBtn",1,"dropdown-menu","dropdown-menu-right"],["id","listDDNSDomainsPageSizeSelection",3,"optionSelected","selectedPageSize"],["scope","col",3,"ngClass"],["role","button","href","javascript:void(0)",3,"click",4,"ngIf"],[4,"ngIf"],["role","button","href","javascript:void(0)",3,"click"],[3,"ngClass",4,"ngIf"],[3,"ngClass"],[1,"info","empty-row"],["colspan","5"],["aria-hidden","true",1,"fas","fa-spinner","fa-spin"],["class","data-row",3,"id",4,"ngIf"],["class","wordbreak",3,"id",4,"ngIf"],[1,"data-row",3,"id"],[1,"check-column"],[3,"for"],["type","checkbox",3,"ngModelChange","click","ngModel","id"],[1,"name-column"],[1,"row-expand-container"],[1,"btn","btn-link",3,"click","id"],["aria-hidden","true",1,"fas",3,"ngClass"],[1,"domain-name","collapse-text"],[1,"info-block","ddns-list__edit-description"],[1,"ddns-list__edit-description-text",3,"click","title"],[1,"btn","btn-sm","btn-link","url-content-copy",3,"click","name","id"],["aria-hidden","true",1,"fas","fa-pencil-alt"],[1,"hidden-xs"],[1,"url-content-container"],[1,"url-content"],["role","button","href","javascript:void(0)",1,"btn","btn-sm","btn-link","url-content-copy",3,"click","id"],[1,"table-btn-icon"],["aria-hidden","true",1,"fas","fa-copy"],["class","btn btn-outline-primary hidden-xs",3,"id","href",4,"ngIf"],["class","btn-outline-primary hidden-sm hidden-md hidden-lg",3,"id","href",4,"ngIf"],[1,"btn","btn-outline-primary","hidden-xs",3,"id","href"],["aria-hidden","true",1,"fas","fa-eye"],[1,"btn-outline-primary","hidden-sm","hidden-md","hidden-lg",3,"id","href"],[1,"wordbreak",3,"id"],["colspan","5",1,"expand-panel-data"],[1,"list-panel","expand-panel"],[1,"col-xs-12","col-sm-3","rolldown-content-container"],[1,"form-control","ddns__textarea",3,"id","name"],[3,"click","id","buttonClass","buttonState"],["class","fas fa-save","aria-hidden","true",4,"ngIf"],[1,"btn","btn-link","btn-sm",3,"click","id"],[1,"col-xs-12","col-sm-4","rolldown-content-container"],[3,"id","for","showInfoBlock","labelText"],[3,"id"],[1,"hidden-sm","hidden-md","hidden-lg"],[3,"id","for","innerHTML"],["href","javascript:void(0)",1,"btn","btn-sm","btn-link","url-content-copy",3,"click","id"],[3,"id",4,"ngFor","ngForOf"],["aria-hidden","true",1,"fas","fa-save"]],template:function(i,n){1&i&&(t.j41(0,"section"),t.nrm(1,"p",2)(2,"p",2),t.k0s(),t.nrm(3,"cp-alert-list"),t.j41(4,"section")(5,"div",3)(6,"div",4)(7,"label",5),t.EFF(8),t.k0s(),t.j41(9,"cp-search",6),t.bIt("valueChange",function(a){return n.executeSearch(a)}),t.k0s()(),t.j41(10,"div",7)(11,"cp-pagination",8),t.bIt("pageChanged",function(a){return n.updatePaginationByPage(a.page)}),t.k0s()()()(),t.j41(12,"section"),t.DNE(13,K,9,5,"div",9),t.j41(14,"div",10)(15,"div",11)(16,"div",12)(17,"div",13)(18,"label",14)(19,"input",15),t.mxI("ngModelChange",function(a){return t.DH7(n.allRowsChecked,a)||(n.allRowsChecked=a),a}),t.bIt("click",function(){return n.toggleAllRows()}),t.k0s()()(),t.j41(20,"div",16)(21,"button",17),t.EFF(22),t.nrm(23,"span",18),t.k0s(),t.DNE(24,q,7,4,"ul",19),t.k0s()(),t.j41(25,"div",20)(26,"button",21),t.bIt("click",function(){return n.goToCreateForm()}),t.nrm(27,"span",22),t.EFF(28),t.k0s(),t.j41(29,"div",23)(30,"button",24),t.nrm(31,"i",25)(32,"span",26),t.j41(33,"span",27),t.EFF(34,"Select entries per page"),t.k0s()(),t.DNE(35,W,3,1,"ul",28),t.k0s()()()()(),t.j41(36,"section")(37,"table",29)(38,"thead")(39,"tr"),t.nrm(40,"th",30),t.DNE(41,nt,4,5,"ng-container",31),t.k0s()(),t.j41(42,"tbody"),t.DNE(43,it,4,1,"tr",32)(44,st,3,1,"tr",32)(45,_t,3,2,"ng-container",33),t.k0s()(),t.j41(46,"div",34)(47,"div",35)(48,"cp-pagination",36),t.bIt("pageChanged",function(a){return n.updatePaginationByPage(a.page)}),t.k0s()()()()),2&i&&(t.BMQ("title",n.aria.sectionTitleDescription),t.R7$(),t.Y8G("innerHTML",n.descriptionTextPt1,t.npT),t.R7$(),t.Y8G("innerHTML",n.descriptionTextPt2,t.npT),t.R7$(6),t.SpI(" ",n.locale.maketext("Search by domain or [asis,IP] address.")," "),t.R7$(),t.FS9("label",n.locale.maketext("Search dynamic [asis,DNS] configurations.")),t.R7$(2),t.Y8G("totalItems",n.pagination.totalRecords)("pageSize",n.pagination.recordsPerPage),t.R7$(2),t.Y8G("ngIf",n.isDeleteConfirmationVisible&&n.anyRowChecked),t.R7$(5),t.BMQ("aria-label",n.aria.selectAllRowsLabel),t.R7$(),t.Y8G("ngClass",t.eq3(24,w,n.ddnsConfigs&&!n.ddnsConfigs.length||n.isContentLoading)),t.R50("ngModel",n.allRowsChecked),t.R7$(2),t.Y8G("ngClass",t.eq3(26,w,!n.anyRowChecked||n.isContentLoading)),t.BMQ("disabled",!n.anyRowChecked||n.isContentLoading||null),t.R7$(),t.SpI(" ",n.locale.maketext("Action")," "),t.R7$(4),t.Y8G("ngClass",t.eq3(28,w,n.isContentLoading)),t.R7$(2),t.SpI(" ",n.locale.maketext("Create")," "),t.R7$(2),t.Y8G("ngClass",t.eq3(30,w,n.isContentLoading)),t.R7$(11),t.Y8G("ngForOf",n.tableColumns),t.R7$(2),t.Y8G("ngIf",n.isContentLoading),t.R7$(),t.Y8G("ngIf",n.ddnsConfigs&&!n.ddnsConfigs.length),t.R7$(),t.Y8G("ngForOf",n.ddnsConfigs)("ngForTrackBy",n.trackByID),t.R7$(3),t.Y8G("totalItems",n.pagination.totalRecords)("pageSize",n.pagination.recordsPerPage))},dependencies:[l.C7,l.Ab,_.YU,_.Sq,_.bT,I.hs,I.UL,I.Kk,l.GV,l.Wp,m.Zm,m.BC,m.vS,l.br,l.eK,l.Sy],styles:[".ddns__textarea[_ngcontent-%COMP%]{resize:vertical}.ddns-list__edit-description[_ngcontent-%COMP%]{display:flex;align-items:center}.ddns-list__edit-description-text[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#paginationDropdownList[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{margin:0 5px}.description[_ngcontent-%COMP%]{padding-bottom:10px}"]})}return s})();var k=c(7410),R=function(s){return s.left="fa-arrow-left",s.right="fa-arrow-right",s}(R||{}),ft=c(9390);let M=(()=>{class s{constructor(e,i){this.locale=e,this._locationService=i}ngOnInit(){this._path=new ft.KL(this._locationService),this.sslStatusLink=this._createRestoreModulesLink()}_createRestoreModulesLink(){return`${this._path.protocol}//${this._path.domain}:${this._path.port}${this._path.themePath}security/tls_status/#/`}static#t=this.\u0275fac=function(i){return new(i||s)(t.rXU(L.h),t.rXU(j.N))};static#e=this.\u0275cmp=t.VBU({type:s,selectors:[["cp-ddns-resources"]],decls:16,vars:6,consts:[[1,"col-xs-12","col-sm-4","col-md-3"],[1,"section"],[1,"widget"],["href","https://go.cpanel.net/cpaneldocsdynamicdns","id","ddnsAboutTheInterface","target","cpanel_documentation",3,"title"],["aria-hidden","true",1,"fas","fa-fw","fa-external-link-alt"],[1,"widget-title"],["id","sslTLSStatusPageBtn","target","cpanel",3,"href","title"]],template:function(i,n){1&i&&(t.j41(0,"div",0)(1,"div",1)(2,"section",2)(3,"ul")(4,"li")(5,"a",3),t.nrm(6,"i",4),t.EFF(7),t.k0s()()()(),t.j41(8,"section",2)(9,"h3",5),t.EFF(10),t.k0s(),t.j41(11,"ul")(12,"li")(13,"a",6),t.nrm(14,"i",4),t.EFF(15),t.k0s()()()()()()),2&i&&(t.R7$(5),t.FS9("title",n.locale.maketext("Need help? Click here to read more about this interface.")),t.R7$(2),t.SpI(" ",n.locale.maketext("About This Interface")," "),t.R7$(3),t.SpI(" ",n.locale.maketext("Related Interfaces")," "),t.R7$(3),t.FS9("href",n.sslStatusLink,t.B4B),t.FS9("title",n.locale.maketext("Navigate to the [asis,SSL/TLS] Status interface.")),t.R7$(2),t.SpI(" ",n.locale.maketext("Check [asis,SSL/TLS] Status")," "))},encapsulation:2})}return s})();const gt=()=>["127.0.0.1","::1"];function bt(s,r){1&s&&(t.j41(0,"div",5),t.nrm(1,"cp-loading-spinner",6),t.k0s())}function St(s,r){1&s&&t.nrm(0,"i",39)}function kt(s,r){1&s&&t.nrm(0,"i",40)}function Ct(s,r){if(1&s&&(t.j41(0,"div",18)(1,"div",1)(2,"div",19)(3,"cp-form-label",41),t.EFF(4),t.k0s()(),t.nrm(5,"div",19),t.k0s(),t.j41(6,"div",1)(7,"div",19),t.nrm(8,"input",42),t.k0s()(),t.nrm(9,"cp-validation-container",43),t.k0s()),2&s){const e=t.XpG(2);t.R7$(3),t.Y8G("showInfoBlock",e.showAllHelp)("labelText",e.locale.maketext("[asis,IP] Address")),t.R7$(),t.SpI(" ",e.locale.maketext("Optionally, add the current [asis,IPv4] or [asis,IPv6] address of the router or DDNS-enabled device.")," "),t.R7$(4),t.FS9("placeholder",e.locale.maketext("Example: [list_or,_1]",t.lJ4(5,gt))),t.R7$(),t.Y8G("control",e.ipControl)}}function xt(s,r){1&s&&t.nrm(0,"i",44)}function vt(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",7)(1,"form",8)(2,"div",9)(3,"div",10)(4,"div",11),t.EFF(5),t.k0s(),t.j41(6,"div",12)(7,"button",13),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.toggleHelp())}),t.EFF(8),t.nrm(9,"i",14),t.k0s()(),t.nrm(10,"div",15),t.k0s(),t.j41(11,"div",16)(12,"section",17)(13,"div",18)(14,"div",1)(15,"div",19)(16,"cp-form-label",20),t.EFF(17),t.k0s()()(),t.j41(18,"div",1)(19,"div",19)(20,"input",21),t.bIt("keyup",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.validateSubdomain())}),t.k0s(),t.nrm(21,"ng-select",22),t.k0s()(),t.nrm(22,"cp-validation-container",23)(23,"cp-validation-container",24),t.k0s(),t.j41(24,"div",18)(25,"div",1)(26,"div",19)(27,"button",25),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.toggleIPInput())}),t.EFF(28),t.DNE(29,St,1,0,"i",26)(30,kt,1,0,"i",27),t.k0s()()()(),t.DNE(31,Ct,10,6,"div",28),t.j41(32,"div",18)(33,"div",1)(34,"div",19)(35,"cp-form-label",29),t.EFF(36),t.k0s()()(),t.j41(37,"div",1)(38,"div",19),t.nrm(39,"input",30),t.k0s()()()()(),t.j41(40,"div",31)(41,"div",32)(42,"label"),t.nrm(43,"input",33),t.EFF(44),t.k0s()(),t.nrm(45,"hr",34),t.j41(46,"cp-action-button",35),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.submitForm())}),t.DNE(47,xt,1,0,"i",36),t.EFF(48),t.k0s(),t.j41(49,"button",37),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.returnToTable())}),t.nrm(50,"i",38),t.EFF(51),t.k0s()()()()()}if(2&s){const e=t.XpG();t.R7$(),t.Y8G("formGroup",e.ddnsForm),t.R7$(4),t.SpI(" ",e.locale.maketext("Create Dynamic [asis,DNS] Domain")," "),t.R7$(3),t.SpI(" ",e.toggleHelpLabel," "),t.R7$(8),t.Y8G("showInfoBlock",e.showAllHelp)("labelText",e.locale.maketext("Dynamic [asis,DNS] Domain")),t.R7$(),t.SpI(" ",e.locale.maketext("Add a subdomain prefix and then select a domain to create a [asis,DDNS] domain (for example, \u201chome\u201d).")," "),t.R7$(3),t.FS9("placeholder",e.locale.maketext("Enter a subdomain prefix.")),t.R7$(),t.FS9("placeholder",e.locale.maketext("Select a domain.")),t.FS9("notFoundText",e.locale.maketext("No domains available.")),t.Y8G("readonly",e.isSelectDisabled)("clearable",!1)("items",e.availableDomains),t.BMQ("aria-label",e.aria.selectDomainLabel),t.R7$(),t.Y8G("control",e.subdomainControl),t.R7$(),t.Y8G("control",e.domainControl),t.R7$(5),t.SpI(" ",e.locale.maketext("Manually enter an [asis,IP] address (Optional)[comment,this is a dropdown for the user to display or hide an input]")," "),t.R7$(),t.Y8G("ngIf",!e.isIPInputShown),t.R7$(),t.Y8G("ngIf",e.isIPInputShown),t.R7$(),t.Y8G("ngIf",e.isIPInputShown),t.R7$(4),t.Y8G("showInfoBlock",e.showAllHelp)("labelText",e.locale.maketext("Description")),t.R7$(),t.SpI(" ",e.locale.maketext("Optionally, add a friendly name label to identify the DDNS domain (for example, \u201cHome Router\u201d).")," "),t.R7$(3),t.FS9("placeholder",e.locale.maketext("Enter a description.")),t.R7$(5),t.SpI(" ",e.stayOnFormText," "),t.R7$(2),t.Y8G("buttonClass",e.createBtnClass)("buttonState",e.createBtnState),t.R7$(),t.Y8G("ngIf",!e.isConfigCreating),t.R7$(),t.SpI(" ",e.locale.maketext("Create")," "),t.R7$(),t.FS9("title",e.locale.maketext("Go back to the list of dynamic [asis,DNS] configurations.")),t.R7$(),t.Y8G("ngClass",e.returnArrowDir),t.R7$(),t.SpI(" ",e.locale.maketext("Go Back")," ")}}function Rt(s,r){1&s&&t.nrm(0,"cp-ddns-resources")}let Dt=(()=>{class s{constructor(e,i,n,o,a){this._alertService=e,this.locale=i,this._router=n,this._ddnsService=o,this._ddnsBuilder=a,this.createBtnState=l.kj.enabled,this.isContentLoading=!0,this.isIPInputShown=!1,this.showAllHelp=!0}get aria(){return{selectDomainLabel:this.locale.maketext("Select domain.")}}get descriptionText(){return`${this.locale.maketext("Use this interface to create a dynamic [asis,DNS] ([asis,DDNS]) domain.")} ${this.locale.maketext("For more information, read the [output,url,_1,feature documentation,class,externalLink,target,_2,id,_3].","https://go.cpanel.net/cpaneldocsDynamicDNS","cp-dynamic-dns-docs","linkDynamicDNSDocumentation")}`}get domainControl(){return this.ddnsForm.get("domain")}get ipControl(){return this.ddnsForm.get("ip")}get isConfigCreating(){return this.createBtnState===l.kj.loading}get isSelectDisabled(){return this.availableDomains.length<=1}get returnArrowDir(){return this.locale.isRtl?R.right:R.left}get stayOnFormText(){return this.locale.maketext("Stay on this page after I click \u201cCreate\u201d.")}get subdomainControl(){return this.ddnsForm.get("subdomain")}get createBtnClass(){return"btn-primary"}get toggleHelpLabel(){return this.locale.maketext(this.showAllHelp?"Hide Help Text":"Show Help Text")}returnToTable(){this._router.navigate(["list"])}toggleIPInput(){this.isIPInputShown=!this.isIPInputShown}submitForm(){if(this.ddnsForm.valid){let n;this.createBtnState=l.kj.loading;const o={domain:`${this.ddnsForm.get("subdomain").value}.${this.ddnsForm.get("domain").value.slice(1)}`,description:this.ddnsForm.get("description").value,ip:this.ddnsForm.get("ip").value},a=this._ddnsService.createDDNSConfig(o);this._createSub=a.subscribe({error:d=>{this.createBtnState=l.kj.enabled,this._alertService.error(d.message)},next:d=>{n=d},complete:()=>{const d=this.ddnsForm.get("stayOnForm").value;this.createBtnState=l.kj.enabled,this._alertService.success(this.locale.maketext("Successfully created a dynamic [asis,DNS] configuration with the following ID: [_1]",n)),d?this._resetForm():this.returnToTable()}})}else Object.keys(this.ddnsForm.controls).forEach(e=>{this.ddnsForm.controls[e].markAsTouched(),this.ddnsForm.controls[e].markAsDirty(),this.ddnsForm.controls[e].updateValueAndValidity()})}toggleHelp(){this.showAllHelp=!this.showAllHelp}validateSubdomain(){const e=this.ddnsForm.get("subdomain").value;if(e){const i=e.split(".");let n;for(let o=0,a=i.length;o<a;o++){if(n=k.md.NONINITIAL_LABEL_REGEX.test(i[o]),!n){this.ddnsForm.get("subdomain").setValidators(k.md.validateLabel());break}this.ddnsForm.get("subdomain").clearValidators()}}else this.ddnsForm.get("subdomain").setValidators(k.ln.required(this.locale.maketext("You must enter a subdomain prefix.")));this.ddnsForm.get("subdomain").updateValueAndValidity()}ngOnInit(){k.uv.locale=this.locale,this.ddnsForm=this._ddnsBuilder.group({subdomain:[null,k.ln.required(this.locale.maketext("You must enter a subdomain prefix."))],domain:[null,k.ln.required(this.locale.maketext("You must choose a domain."))],description:[null],ip:[null,k.md.anyIP()],stayOnForm:[!1]}),this._fetchAvailableDomains()}ngOnDestroy(){this._domainsSub.unsubscribe(),this._createSub&&this._createSub.unsubscribe()}_fetchAvailableDomains(){const e=this._ddnsService.fetchDomains();this._domainsSub=e.subscribe({next:i=>{this.availableDomains=i.map(n=>`.${n}`),1===i.length&&this.ddnsForm.patchValue({domain:this.availableDomains[0]})},complete:()=>{this.isContentLoading=!1}})}_resetForm(){this.ddnsForm.reset(),1===this.availableDomains.length&&this.ddnsForm.patchValue({domain:this.availableDomains[0]})}static#t=this.\u0275fac=function(i){return new(i||s)(t.rXU(l.uE),t.rXU(L.h),t.rXU(b.Ix),t.rXU(T),t.rXU(m.ze))};static#e=this.\u0275cmp=t.VBU({type:s,selectors:[["cp-ddns-manage-form"]],decls:7,vars:4,consts:[[1,"description",3,"innerHTML"],[1,"row"],["class","col-xs-12 col-md-9",4,"ngIf"],["class","col-xs-12 col-sm-8 col-md-6",4,"ngIf"],[4,"ngIf"],[1,"col-xs-12","col-md-9"],["id","ddnsLoadingSpinner"],[1,"col-xs-12","col-sm-8","col-md-6"],["id","ddnsForm","name","ddnsForm",3,"formGroup"],[1,"panel","panel-default"],[1,"panel-heading"],[1,"widget-title","pull-left","flip"],[1,"pull-right","flip"],["type","button","id","transferAcctShowHideHelp",1,"btn","btn-default","btn-xs",3,"click"],[1,"far","fa-question-circle","form-info-sign"],[1,"clearfix"],[1,"panel-body"],["id","ddnsDataSection"],[1,"form-group"],[1,"col-xs-12"],["id","ddnsSubdomainLabel","for","ddnsSubdomain",3,"showInfoBlock","labelText"],["name","ddnsSubdomain","formControlName","subdomain","autocomplete","off","id","ddnsSubdomainInput",1,"form-control","domainInputs",3,"keyup","placeholder"],["id","ddnsDomainSelector","formControlName","domain",1,"domainInputs",3,"readonly","clearable","items","placeholder","notFoundText"],["id","subdomainInputsValidationContainer",3,"control"],["id","domainInputsValidationContainer",3,"control"],["type","button","id","showIPInputBtn",1,"btn","btn-link",3,"click"],["class","fas fa-chevron-right","aria-hidden","true",4,"ngIf"],["class","fas fa-chevron-down","aria-hidden","true",4,"ngIf"],["class","form-group",4,"ngIf"],["id","ddnsDescriptionLabel","for","ddnsDescription",3,"showInfoBlock","labelText"],["name","ddnsDescription","formControlName","description","id","ddnsDescriptionInput",1,"form-control",3,"placeholder"],[1,"panel-footer"],[1,"checkbox","create-email-checkbox"],["type","checkbox","formControlName","stayOnForm","name","stayOnForm","id","stayOnForm"],[1,"separator"],["id","submitDDNSFormBtn","type","submit",3,"click","buttonClass","buttonState"],["class","fas fa-plus","aria-hidden","true",4,"ngIf"],["id","cancelDDNSFormBtn","type","button",1,"btn","btn-link","pull-right","flip",3,"click","title"],["aria-hidden","true",1,"fas",3,"ngClass"],["aria-hidden","true",1,"fas","fa-chevron-right"],["aria-hidden","true",1,"fas","fa-chevron-down"],["id","ddnsIPInputLabel","for","ddnsIPInput",3,"showInfoBlock","labelText"],["name","ddnsIPInput","formControlName","ip","id","ddnsIPInput",1,"form-control",3,"placeholder"],["id","ipInputValidationContainer",3,"control"],["aria-hidden","true",1,"fas","fa-plus"]],template:function(i,n){1&i&&(t.j41(0,"section"),t.nrm(1,"p",0),t.k0s(),t.j41(2,"div",1),t.nrm(3,"cp-alert-list"),t.DNE(4,bt,2,0,"div",2)(5,vt,52,31,"div",3)(6,Rt,1,0,"cp-ddns-resources",4),t.k0s()),2&i&&(t.R7$(),t.Y8G("innerHTML",n.descriptionText,t.npT),t.R7$(3),t.Y8G("ngIf",n.isContentLoading),t.R7$(),t.Y8G("ngIf",!n.isContentLoading),t.R7$(),t.Y8G("ngIf",!n.isContentLoading))},dependencies:[l.C7,l.Ab,_.YU,_.bT,l.Wp,m.qT,m.me,m.Zm,m.BC,m.cb,l.NB,N.vr,m.j4,m.JD,l.kl,M],encapsulation:2})}return s})();var It=c(2584);function Lt(s,r){1&s&&(t.j41(0,"div",9),t.nrm(1,"cp-loading-spinner",10),t.k0s())}function Tt(s,r){if(1&s&&(t.j41(0,"cp-callout",11)(1,"span",12),t.EFF(2),t.k0s(),t.EFF(3),t.k0s()),2&s){const e=t.XpG();t.R7$(2),t.JRh(e.locale.maketext("Self-Signed Certificate")),t.R7$(),t.SpI(" ",e.locale.maketext("This is a self-signed certificate. Using this certificate will not be secure.")," ")}}function wt(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",24)(1,"cp-form-label",38),t.EFF(2),t.k0s(),t.j41(3,"figure",39)(4,"pre",null,2),t.EFF(6),t.k0s()(),t.j41(7,"div",4)(8,"div",27)(9,"a",40),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.copyTextToClipboard(n.cabundle))}),t.j41(10,"span",29),t.EFF(11),t.k0s(),t.nrm(12,"i",30),t.k0s()()()()}if(2&s){const e=t.XpG(2);t.R7$(),t.Y8G("showInfoBlock",e.showAllHelp)("labelText",e.locale.maketext("Certificate Authority Bundle")),t.R7$(),t.SpI(" ",e.locale.maketext("This is the certificate\u2019s Certificate Authority Bundle.")," "),t.R7$(4),t.JRh(e.sslConfig.cabundle),t.R7$(5),t.JRh(e.copyBtnText)}}function yt(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",13)(1,"form",14)(2,"div",15)(3,"div",16)(4,"div",17),t.EFF(5),t.k0s(),t.j41(6,"div",18)(7,"button",19),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.toggleHelp())}),t.EFF(8),t.nrm(9,"i",20),t.k0s()(),t.nrm(10,"div",21),t.k0s(),t.j41(11,"div",22)(12,"section",23)(13,"div",24)(14,"cp-form-label",25),t.EFF(15),t.k0s(),t.j41(16,"figure",26)(17,"pre",null,0),t.EFF(19),t.k0s()(),t.j41(20,"div",4)(21,"div",27)(22,"a",28),t.bIt("click",function(){t.eBV(e);const n=t.sdS(18),o=t.XpG();return t.Njj(o.copyTextToClipboard(n))}),t.j41(23,"span",29),t.EFF(24),t.k0s(),t.nrm(25,"i",30),t.k0s()()()(),t.j41(26,"div",24)(27,"cp-form-label",31),t.EFF(28),t.k0s(),t.j41(29,"figure",32)(30,"pre",null,1),t.EFF(32),t.k0s()(),t.j41(33,"div",4)(34,"div",27)(35,"a",33),t.bIt("click",function(){t.eBV(e);const n=t.sdS(31),o=t.XpG();return t.Njj(o.copyTextToClipboard(n))}),t.j41(36,"span",29),t.EFF(37),t.k0s(),t.nrm(38,"i",30),t.k0s()()()(),t.DNE(39,wt,13,5,"div",34),t.k0s()(),t.j41(40,"div",35)(41,"button",36),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.returnToTable())}),t.nrm(42,"i",37),t.EFF(43),t.k0s()()()()()}if(2&s){const e=t.XpG();t.R7$(5),t.SpI(" ",e.locale.maketext("Dynamic [asis,DNS] [asis,SSL]")," "),t.R7$(3),t.SpI(" ",e.toggleHelpLabel," "),t.R7$(6),t.Y8G("showInfoBlock",e.showAllHelp)("labelText",e.locale.maketext("Certificate")),t.R7$(),t.SpI(" ",e.locale.maketext("This is the [asis,SSL] certificate.")," "),t.R7$(4),t.JRh(e.sslConfig.cert),t.R7$(5),t.JRh(e.copyBtnText),t.R7$(3),t.Y8G("showInfoBlock",e.showAllHelp)("labelText",e.locale.maketext("Private Key")),t.R7$(),t.SpI(" ",e.locale.maketext("This is the certificate\u2019s private key.")," "),t.R7$(4),t.JRh(e.sslConfig.key),t.R7$(5),t.JRh(e.copyBtnText),t.R7$(2),t.Y8G("ngIf",e.sslConfig.cabundle),t.R7$(2),t.FS9("title",e.locale.maketext("Go back to the list of dynamic [asis,DNS] configurations.")),t.R7$(),t.Y8G("ngClass",e.returnArrowDir),t.R7$(),t.SpI(" ",e.locale.maketext("Go Back")," ")}}function Ft(s,r){1&s&&t.nrm(0,"cp-ddns-resources")}let $t=(()=>{class s{constructor(e,i,n,o,a){this.locale=e,this._ddnsService=i,this._router=n,this._activatedRoute=o,this._alertService=a,this.isContentLoading=!0,this.showAllHelp=!0}get descriptionText(){return`${this.locale.maketext("Use this interface to view the contents of the [asis,SSL] certificate for your dynamic [asis,DNS] (DDNS) domain. You can copy the contents to your DDNS-enabled device.")} ${this.locale.maketext("For more information, read the [output,url,_1,feature documentation,class,externalLink,target,_2,id,_3].","https://go.cpanel.net/cpaneldocsDynamicDNS","cp-dynamic-dns-docs","linkDynamicDNSDocumentation")}`}get returnArrowDir(){return this.locale.isRtl?R.right:R.left}get showSelfSignedCertMessage(){return!this.isContentLoading&&this.sslConfig.isSelfSigned}get toggleHelpLabel(){return this.locale.maketext(this.showAllHelp?"Hide Help Text":"Show Help Text")}get sslConfig(){return this._sslConfig}set sslConfig(e){this._sslConfig=e}copyTextToClipboard(e){const i=document.createElement("textarea");i.value=e.textContent,document.body.appendChild(i),i.select(),document.execCommand("copy")?this._alertService.success(this.locale.maketext("Successfully copied to the clipboard.")):this._alertService.error(this.locale.maketext("Copy failed.")),document.body.removeChild(i)}returnToTable(){this._router.navigate(["list"])}toggleHelp(){this.showAllHelp=!this.showAllHelp}ngOnInit(){this.copyBtnText=this.locale.maketext("Copy"),this._activatedRoute.queryParams.subscribe(e=>{this._getSSLCert(e.cert_id)})}ngOnDestroy(){this._sslSubs.unsubscribe()}_getSSLCert(e){const i=this._ddnsService.getSSLCert(e);this._sslSubs=i.subscribe({next:n=>{this.sslConfig={id:e,key:n.key,cert:n.certificate,cabundle:n.cabundle?n.cabundle:"",isSelfSigned:(0,It.G)(n.is_self_signed)}},complete:()=>{this.isContentLoading=!1},error:n=>{this._alertService.error(n),this.isContentLoading=!1}})}static#t=this.\u0275fac=function(i){return new(i||s)(t.rXU(L.h),t.rXU(T),t.rXU(b.Ix),t.rXU(b.nX),t.rXU(l.uE))};static#e=this.\u0275cmp=t.VBU({type:s,selectors:[["cp-ddns-ssl"]],decls:9,vars:5,consts:[["certText",""],["keyText",""],["cabundleText",""],[1,"description",3,"innerHTML"],[1,"row"],["class","col-xs-12 col-md-9",4,"ngIf"],["id","selfSignedCertCallout","calloutType","warning","class","col-xs-12 col-sm-8 col-md-6",4,"ngIf"],["class","col-xs-12 col-sm-8 col-md-6",4,"ngIf"],[4,"ngIf"],[1,"col-xs-12","col-md-9"],["id","ddnsSSLLoadingSpinner"],["id","selfSignedCertCallout","calloutType","warning",1,"col-xs-12","col-sm-8","col-md-6"],["callout-heading",""],[1,"col-xs-12","col-sm-8","col-md-6"],["id","ddnsSSLForm"],[1,"panel","panel-default"],[1,"panel-heading"],[1,"widget-title","pull-left","flip"],[1,"pull-right","flip"],["type","button","id","transferAcctShowHideHelp",1,"btn","btn-default","btn-xs",3,"click"],[1,"far","fa-question-circle","form-info-sign"],[1,"clearfix"],[1,"panel-body"],["id","ddnsCertSection"],[1,"form-group"],["id","ddnsSSLCertLabel","for","ddnsSSLCert",3,"showInfoBlock","labelText"],["id","ddnsSSLCert","aria-labelledby","ddnsSSLCertLabel"],[1,"col-xs-12","text-right"],["href","javascript:void(0)",1,"btn","btn-sm","btn-link",3,"click"],[1,"clipboardBtn"],["aria-hidden","true",1,"fas","fa-copy"],["id","ddnsSSLKeyLabel","for","ddnsSSLKey",3,"showInfoBlock","labelText"],["id","ddnsSSLKey","aria-labelledby","ddnsSSLKeyLabel"],["id","copyKeyBtn","href","javascript:void(0)",1,"btn","btn-sm","btn-link",3,"click"],["class","form-group",4,"ngIf"],[1,"panel-footer"],["id","cancelDDNSSSLFormBtn","type","button",1,"btn","btn-link","flip",3,"click","title"],["aria-hidden","true",1,"fas",3,"ngClass"],["id","ddnsSSLCABundleLabel","for","ddnsSSLCABundle",3,"showInfoBlock","labelText"],["id","ddnsSSLCABundle","aria-labelledby","ddnsSSLCABundleLabel"],["id","copyBundleBtn","href","javascript:void(0)",1,"btn","btn-sm","btn-link",3,"click"]],template:function(i,n){1&i&&(t.j41(0,"section"),t.nrm(1,"p",3),t.k0s(),t.j41(2,"div",4),t.nrm(3,"cp-alert-list"),t.DNE(4,Lt,2,0,"div",5)(5,Tt,4,2,"cp-callout",6),t.k0s(),t.j41(6,"div",4),t.DNE(7,yt,44,16,"div",7)(8,Ft,1,0,"cp-ddns-resources",8),t.k0s()),2&i&&(t.R7$(),t.Y8G("innerHTML",n.descriptionText,t.npT),t.R7$(3),t.Y8G("ngIf",n.isContentLoading),t.R7$(),t.Y8G("ngIf",n.showSelfSignedCertMessage),t.R7$(2),t.Y8G("ngIf",!n.isContentLoading),t.R7$(),t.Y8G("ngIf",!n.isContentLoading))},dependencies:[l.Ab,_.YU,_.bT,l.GV,l.Wp,m.qT,m.cb,m.cV,l.NB,M],encapsulation:2})}return s})(),jt=(()=>{class s{constructor(){}static#t=this.\u0275fac=function(i){return new(i||s)};static#e=this.\u0275cmp=t.VBU({type:s,selectors:[["cp-ddns-root"]],decls:2,vars:0,consts:[[1,"body-content"],["id","ddnsListRouterOutlet",1,"section","animate-view","ng-cloak"]],template:function(i,n){1&i&&(t.j41(0,"div",0),t.nrm(1,"router-outlet",1),t.k0s())},dependencies:[b.n3]})}return s})();const Bt=[{path:"create",component:Dt,data:{id:"create"}},{path:"ssl",component:$t,data:{id:"ssl"}},{path:"list",component:E,data:{id:"list"}},{path:"",redirectTo:"list",pathMatch:"full"},{path:"**",component:E,pathMatch:"full"}];let Nt=(()=>{class s{static#t=this.\u0275fac=function(i){return new(i||s)};static#e=this.\u0275mod=t.$C({type:s,bootstrap:[jt]});static#n=this.\u0275inj=t.G2t({providers:[l.uE,T,j.N],imports:[l.pt,l.sb,G.fg,V.wb,D.Bb,I.zE.forRoot(),l.jM,_.MD,l.rY,m.YN,P.q1,l.ys,N.MQ,l.Qg,l.x6,l.tq,m.X1,l.H7,b.iI.forRoot(Bt,{useHash:!0}),b.iI]})}return s})();(0,t.SmG)(),D.sG().bootstrapModule(Nt).catch(s=>console.error(s))}},v=>{v.O(0,[128,538],()=>v(v.s=2611)),v.O()}]);
Back to Directory File Manager