(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/dns-helper/dns-settings"],{1011:(e,t,n)=>{"use strict";n.r(t);var l=n(155),a=n(154),r=n(261),s=n.n(r),i=n(144),o=n(302),c=n(405);const m=i.Locale.getTranslate("smb.components.dns-helper"),d=o.gql`
    query getDnsSettings($id: ID!) {
        node(id: $id) {
            ... on Domain {
                name(idn: false)
                ipAddresses {
                    ipAddress(publicIp: true)
                }    
                dnsZone {
                    nsRecords: records(filter: {type: [NS]}, orderBy: {value: asc}) {
                        host
                        value
                        type
                    }
                    aRecords: records(filter: {type: [A]}) {
                        host
                        value
                        type
                    }
                }        
            }
            ... on DomainAlias {
                name(idn: false)
                domain {
                    ipAddresses {
                        ipAddress
                    }                   
                }
                dnsZone {
                    nsRecords: records(filter: {type: [NS]}, orderBy: {value: asc}) {
                        host
                        value
                        type
                    }
                    aRecords: records(filter: {type: [A]}) {
                        host
                        value
                        type
                    }
                }               
            }
        }
        viewer {
            type
        }
        config {
            dns {
                enableResolveChecking
            }
        }
        dnsRegistrars {
            name
            url
        }
        dnsExtensions {
            name
            url
        }
        mode {
            isDnsServiceSupported
        }        
    }
`,u=({isOpen:e,onClose:t,id:n,isAlias:r})=>{var s,i,o,u;const{loading:p,data:E}=(0,c.useQuery)(d,{variables:{id:btoa(`${r?"DomainAlias":"Domain"}:${n}`)}});if(p)return null;const{dnsRegistrars:g,dnsExtensions:v}=E,k="ADMIN"===E.viewer.type,h=E.node.name,A=null!==(s=null===(i=E.node.dnsZone)||void 0===i?void 0:i.nsRecords)&&void 0!==s?s:[],b=null!==(o=null===(u=E.node.dnsZone)||void 0===u?void 0:u.aRecords)&&void 0!==o?o:[],f=A.map((e=>b.find((t=>t.host===e.value)))).filter((e=>!!e)),{ipv4:y,ipv6:w}=(r?E.node.domain.ipAddresses:E.node.ipAddresses).reduce(((e,{ipAddress:t})=>(e[t.includes(":")?"ipv6":"ipv4"]=t,e)),{}),x=E.config.dns.enableResolveChecking&&E.mode.isDnsServiceSupported;return(0,a.createElement)(l.Drawer,{title:(0,a.createElement)(m,{content:"drawerTitle",params:{domainName:h}}),size:"sm",isOpen:e,onClose:t,"data-type":"dns-helper"},x?(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",null,(0,a.createElement)(m,{content:"pleskResolve"})),(0,a.createElement)("p",null,(0,a.createElement)(m,{content:"domainSetup0"})),(0,a.createElement)("ol",null,(0,a.createElement)("li",null,(0,a.createElement)(m,{content:"domainSetup1"})),f.length>0?(0,a.createElement)("li",null,(0,a.createElement)(m,{content:"domainSetup2",params:{glueLink:(0,a.createElement)(l.Link,{"data-action":"glueLink",href:"https://en.wikipedia.org/wiki/Domain_Name_System#Circular_dependencies_and_glue_records",target:"_blank"},(0,a.createElement)("b",null,(0,a.createElement)(m,{content:"glueRecords"})))}}),(0,a.createElement)(l.Alert,null,f.map((({host:e,value:t})=>(0,a.createElement)("div",{key:t},e," ",t))))):null,(0,a.createElement)("li",null,(0,a.createElement)("p",null,(0,a.createElement)(m,{content:"domainSetup3"})),(0,a.createElement)(l.Alert,null,A.map((({value:e})=>(0,a.createElement)("div",{key:e},"NS"," ",e)))))),(0,a.createElement)("p",null,(0,a.createElement)(m,{content:"primaryDNS"})),(0,a.createElement)("p",null,(0,a.createElement)(m,{content:"forExample"})),y?(0,a.createElement)(l.Alert,null,`A @ ${y}`,(0,a.createElement)("br",null),`A www ${y}`):null,w?(0,a.createElement)(l.Alert,null,`AAAA @ ${w}`,(0,a.createElement)("br",null),`AAAA www ${w}`):null):null,(0,a.createElement)(l.Paragraph,null,(0,a.createElement)(m,{content:"chooseRegistrar"})),(0,a.createElement)(l.Text,{italic:!0,bold:!0},(0,a.createElement)(l.Link,{"data-action":"chooseRegistrar",href:"https://www.icann.org/resources/pages/who-2013-05-03-en",target:"_blank"},(0,a.createElement)(m,{content:"chooseRegistrarLink"}))),(0,a.createElement)("br",null),(0,a.createElement)("br",null),(0,a.createElement)(l.Cuttable,{maxHeight:160},(()=>{const e=[...g,{name:(0,a.createElement)(m,{content:"registrarSurveyLink"}),url:"https://pt-research.typeform.com/to/FkcDot10"}];return(0,a.createElement)(l.ItemList,{minColumnWidth:250,gap:"xs"},e.map((({name:e,url:t})=>(0,a.createElement)(l.Item,{"data-action":e,key:e,icon:(0,a.createElement)(l.Icon,{name:"chevron-right",size:"12"}),title:(0,a.createElement)("span",null,(0,a.createElement)(l.Link,{href:t,target:"_blank"},e))}))))})()),k&&x?(0,a.createElement)(l.Alert,{intent:"default"},(0,a.createElement)(l.Status,{intent:"warning"},(0,a.createElement)(m,{content:"adminHintTitle"}),(0,a.createElement)("ol",null,(0,a.createElement)("li",null,(0,a.createElement)(m,{content:"addIpOption",params:{useIpLink:(0,a.createElement)(l.Text,{bold:!0},(0,a.createElement)(l.Link,{"data-action":"addSecondIpGuide",href:"http://docs.plesk.com/en-US/obsidian/administrator-guide/dns/providing-redundant-dns-servers.74239/#configure-at-least-two-ip-addresses-on-your-plesk-server",target:"_blank"},(0,a.createElement)(m,{content:"useIpLink"})))}}),(0,a.createElement)(l.Text,{bold:!0},(0,a.createElement)(m,{content:"example"})),(0,a.createElement)("ul",null,(0,a.createElement)("li",null,(0,a.createElement)(l.Text,{italic:!0},"ns1.example.com 123.123.123.123")),(0,a.createElement)("li",null,(0,a.createElement)(l.Text,{italic:!0},"ns2.example.com 124.124.124.124")))),(0,a.createElement)("li",null,(0,a.createElement)(m,{content:"slaveDnsOption",params:{slaveExtensionLink:(0,a.createElement)(l.Text,{bold:!0},(0,a.createElement)(l.Link,{"data-action":"slaveDnsExtension",href:"https://www.plesk.com/extensions/slave-dns-manager/",target:"_blank"},(0,a.createElement)(m,{content:"slaveExtensionLink"})))}})),(0,a.createElement)("li",null,(0,a.createElement)(m,{content:"extensionOption",params:{extensions:(0,a.createElement)(a.Fragment,null,v.map((({name:e,url:t},n)=>(0,a.createElement)(a.Fragment,{key:e},(0,a.createElement)(l.Link,{href:t,target:"_blank","data-action":e},e),n<v.length-1?", ":""))))}}))))):null)};u.propTypes={isOpen:s().bool.isRequired,onClose:s().func.isRequired,id:s().number.isRequired,isAlias:s().bool},u.defaultProps={isAlias:!1},t.default=u},1041:(e,t,n)=>{"use strict";n.r(t);var l=n(153),a=n.n(l),r=n(154),s=n(1011);const i=e=>{const[t,n]=(0,r.useState)(!0);return(0,r.createElement)(s.default,a()({isOpen:t,onClose:()=>n(!1)},e))};t.default=e=>{Plesk.addWidget(i,e)}}}]);
//# sourceMappingURL=dns-settings.js.map?b5a59c2a07d003381c85