(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/dns/records"],{1642:(e,n,t)=>{"use strict";t.r(n),t.d(n,{SORT_ASC:()=>c,SORT_DESC:()=>u,default:()=>f});var i=t(236),a=t(238),s=t.n(a),o=t(237),l=t(87);const r=l.Locale.getTranslate("components.list"),d=l.Locale.getSection("components.list"),c="ASC",u="DESC",m="all",p=({data:e,columns:n,itemsPerPage:t,itemsPerPageOptions:a,sortColumn:s,sortDirection:l,searchField:u,locale:p,emptyView:f,emptyFilteredView:v,toolbar:y,selection:g,onSelectionChange:S,searchBarInputProps:k,rowKey:x,...h})=>{const[b,j]=(0,i.useState)(1),[F,N]=(0,i.useState)(s??n.find((({sortable:e})=>e))?.key),[T,D]=(0,i.useState)(l),[V,w]=(0,i.useState)(a.includes(t)?t:a[0]),[E,C]=(0,i.useState)(""),O=(0,i.useMemo)((()=>E?v??(0,i.jsx)(o.ListEmptyView,{reason:"filtered",title:(0,i.jsx)(r,{content:"emptyViewFilteredTitle"}),description:(0,i.jsx)(r,{content:"emptyViewFilteredDescription"})}):f??(0,i.jsx)(o.ListEmptyView,{title:(0,i.jsx)(r,{content:"emptyViewTitle"})})),[E,f,v]),P=(0,i.useMemo)((()=>u?e.filter((e=>(Array.isArray(u)?u:[u]).some((n=>e[n]&&String(e[n]).toLowerCase().includes(E.toLowerCase()))))):e),[e,E,u]),_=(0,i.useMemo)((()=>{if(!F)return P;const e=n.find((({key:e})=>e===F))?.sortDataField??F,t=n.find((({key:e})=>e===F))?.sort??((n,t)=>n[e]<t[e]?-1:n[e]>t[e]?1:0);return[...P].sort(((e,n)=>c===T?t(e,n):t(n,e)))}),[P,F,T,n]),R=(0,i.useMemo)((()=>{if(V===m)return _;const e=V*(b-1),n=e+V;return _.slice(e,n)}),[b,_,V]),q=(0,i.useCallback)((e=>{C(e),e!==E&&j(1)}),[E]),z=(0,i.useCallback)((e=>{w(e);(e===m?1:Math.ceil(P.length/e))<b&&j(1)}),[P.length,b]);return(0,i.useEffect)((()=>{if("function"==typeof S&&g.length){const e=P.map((e=>{return n=e,"function"==typeof(t=x)?t(n):n[t];var n,t})).filter((e=>g.includes(e)));S(e)}}),[P]),(0,i.jsx)(o.List,{pagination:(0,i.jsx)(o.Pagination,{current:b,total:V===m?1:Math.ceil(P.length/V),onSelect:e=>j(e),itemsPerPage:V,itemsPerPageOptions:a,onItemsPerPageChange:z}),toolbar:(y||u)&&(0,i.jsxs)(o.Toolbar,{children:[y,u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.ToolbarExpander,{}),(0,i.jsx)(o.ToolbarGroup,{title:"",children:(0,i.jsx)(o.SearchBar,{inputProps:{placeholder:d.lmsg("searchPlaceholder"),"data-testid":"list-searchbar",...k??{}},onTyping:q})})]})]}),totalRows:P.length,sortColumn:F,sortDirection:T,onSortChange:({sortColumn:e,sortDirection:n})=>{N(e),D(n)},columns:n,data:R,filtered:!!E,locale:{totalRows:({totalRows:e})=>d.formatMessage("recordsTotal",{total:e}),...p},emptyView:O,onSelectionChange:S,selection:g,rowKey:x,...h})};p.propTypes={data:s().array.isRequired,columns:s().array.isRequired,itemsPerPage:s().number,itemsPerPageOptions:s().array,sortColumn:s().string,sortDirection:s().string,searchField:s().oneOfType([s().string,s().arrayOf(s().string.isRequired)]),locale:s().object,emptyView:s().node,emptyFilteredView:s().node,toolbar:s().node,onSelectionChange:s().func,selection:s().array,rowKey:s().oneOfType([s().string,s().func]),searchBarInputProps:s().object},p.defaultProps={itemsPerPage:25,itemsPerPageOptions:[10,25,100,m],sortColumn:void 0,sortDirection:c,searchField:void 0,locale:{},emptyView:void 0,emptyFilteredView:void 0,toolbar:void 0,onSelectionChange:void 0,selection:[],searchBarInputProps:void 0,rowKey:"key"};const f=p},1648:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>s});var i=t(237),a=t(236);const s=()=>Array.from({length:4}).map(((e,n)=>(0,a.jsx)(i.FormField,{label:(0,a.jsx)(i.SkeletonText,{lines:1}),children:(0,a.jsx)(i.Skeleton,{maxWidth:200})},n)))},1647:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>k});var i=t(236),a=t(443),s=t(709),o=t(1651),l=t(238),r=t.n(l),d=t(237),c=t(819),u=t(87),m=t(1648),p=t(1649);const f=u.Locale.getTranslate("smb.components.forms.dns-zone.record"),v=a.gql`
    query DnsRecordQuery {
        os {
            isUnix
        }
        dns {
            supportedRecordTypes
        }
    }
`,y=a.gql`
    query DnsRecordEditQuery($id: ID!) {
        os {
            isUnix
        }
        dns {
            supportedRecordTypes
        }
        node(id: $id) {
            id
            ... on DnsRecordTemplate {
                type
                host
                id
                displayVal
                displayHost
                domainName
                ttl
                opt
            }
        }
    }
`,g=a.gql`
    mutation UpdateDnsTemplateRecord($input: UpdateDnsTemplateRecordInput!) {
        updateDnsTemplate(input: $input) {
            id
        }
    }
`,S=({onClose:e,dnsEnabled:n,dnsId:a})=>{const[l,r]=(0,i.useState)(),[u,S]=(0,i.useState)({}),[k,{loading:x}]=(0,s.useMutation)(g,{refetchQueries:[{query:t(783),awaitRefetchQueries:!0}]}),h=n?"A":"NS",b=null!==a,j=0===a?n?"add-title":"add-ns-title":"edit-title",[F,{data:N,loading:T}]=(0,o.useLazyQuery)(a?y:v,{onCompleted:e=>{if(e.node){const{toFormValues:t}=(0,p.default)(e.os.isUnix,n)[e.node.type];S("function"==typeof t?t(e.node):e.node)}else S({...(0,p.default)(e.os.isUnix,n)[h].defaults,type:h})}}),{fields:D}=(0,i.useMemo)((()=>N?(0,p.default)(N?.os?.isUnix,n)[u.type]??{}:{}),[u.type,N,n]);(0,i.useEffect)((()=>{if(b){F(0===a?{}:{variables:{id:a}})}}),[b,a,F]);const V=()=>{r(null),e()};return(0,i.jsx)(d.Drawer,{"data-type":"dns-record-form",isOpen:b,onClose:V,title:(0,i.jsx)(f,{content:j}),form:(0,i.jsx)(c.default,{mutation:k,applyButton:!1,values:u,onSubmit:e=>{const{__typename:t,...i}=e;i.id||(i.id=btoa(":0"));const{toSubmitValues:a}=(0,p.default)(N.os.isUnix,n)[i.type];return"function"==typeof a?a(i):i},onFieldChange:(e,t)=>{"type"===e&&(r(null),S({...(0,p.default)(N?.os?.isUnix,n)[t]?.defaults,type:t}))},onSuccess:V,onError:e=>{r(e.general)},state:x?"submit":null,submitButton:{id:"btn-send"},children:!N||T?(0,i.jsx)(m.default,{}):(0,i.jsxs)(i.Fragment,{children:[l?(0,i.jsx)(d.StatusMessage,{intent:"danger",children:(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:l}})}):null,n?(0,i.jsx)(d.FormFieldSelect,{width:"90px","data-type":"dns-type",name:"type",label:(0,i.jsx)(f,{content:"type"}),children:N.dns.supportedRecordTypes.map((e=>(0,i.jsx)(d.SelectOption,{value:e,children:e},e)))}):null,(0,i.jsx)(d.FormField,{label:(0,i.jsx)(f,{content:"ttl"}),name:"ttl",children:({getName:e,getValue:n,setValue:t})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.Input,{min:0,max:4294967295,type:"number",name:e(),value:n(),onChange:({target:e})=>t(+e.value)})," ",(0,i.jsx)(f,{content:"ttl-seconds"})]})}),D]})})})};S.propTypes={dnsId:r().number,dnsEnabled:r().bool.isRequired,onClose:r().func.isRequired},S.defaultProps={dnsId:null};const k=S},1650:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>c});var i=t(237),a=t(238),s=t.n(a),o=t(87),l=t(236);const r=o.Locale.getTranslate("smb.components.forms.dns-zone.record"),d=({name:e="domainName",label:n="domainName"})=>(0,l.jsx)(i.FormField,{label:(0,l.jsx)(r,{content:n}),name:e,children:({getName:e,getValue:n,setValue:t})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(i.Input,{name:e(),value:n(),onChange:({target:e})=>t(e.value)})," ",(0,l.jsx)(r,{content:"domainNamePostfix"})]})});d.propTypes={name:s().string,label:s().string},d.defaultProps={name:"domainName",label:"domainName"};const c=d},1649:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>d});var i=t(237),a=t(87),s=t(1650),o=t(236);const l=a.Locale.getTranslate("smb.components.forms.dns-zone.record"),r=a.Locale.getSection("smb.components.forms.dns-zone.record"),d=(e,n)=>({NS:{defaults:{},toFormValues:({displayVal:e,...n})=>({displayVal:e.replace(/.$/,""),...n}),toSubmitValues:e=>e,fields:[n?(0,o.jsx)(s.default,{},"ns_domain_name"):null,(0,o.jsx)(i.FormFieldText,{required:!0,name:"displayVal",label:(0,o.jsx)(l,{content:"nameServer"}),inputProps:{suffix:".",size:"lg"}},"ns_ext_host")]},A:{defaults:{},fields:[(0,o.jsx)(s.default,{},"a_domain_name"),(0,o.jsx)(i.FormFieldText,{name:"displayVal",required:!0,label:(0,o.jsx)(l,{content:"ipAddress"}),description:(0,o.jsx)(l,{content:"ipAddressDescriptionExt"})},"A_ip")]},AAAA:{defaults:{},fields:[(0,o.jsx)(s.default,{},"aaaa_int_host"),(0,o.jsx)(i.FormFieldText,{name:"displayVal",required:!0,label:(0,o.jsx)(l,{content:"ipAddressV6"}),description:(0,o.jsx)(l,{content:"ipAddressV6DescriptionExt"})},"AAAA_ip")]},CNAME:{defaults:{},toFormValues:({displayVal:e,...n})=>({displayVal:e.replace(/.$/,""),...n}),toSubmitValues:e=>e,fields:[(0,o.jsx)(s.default,{},"cname_int_host"),(0,o.jsx)(i.FormFieldText,{name:"displayVal",required:!0,label:(0,o.jsx)(l,{content:"canonicalName"})},"CNAME_canonical")]},MX:{defaults:{opt:"0"},toFormValues:({displayVal:e,...n})=>({displayVal:e.replace(/.$/,""),...n}),toSubmitValues:e=>e,fields:[(0,o.jsx)(s.default,{label:"mailDomain"},"mx_displayHost"),(0,o.jsx)(i.FormFieldText,{size:"fill",name:"displayVal",required:!0,label:(0,o.jsx)(l,{content:"mxServer"})},"mx_displayVal"),(0,o.jsxs)(i.FormFieldSelect,{name:"opt",label:(0,o.jsx)(l,{content:"mxServerPriority"}),children:[(0,o.jsx)(i.SelectOption,{value:"0",children:r.lmsg("priorityHigh",{priority:0})}),Array.from({length:9}).map(((e,n)=>{const t=0===n?1:5*n;return(0,o.jsx)(i.SelectOption,{value:t.toString(),children:t.toString()},t)})),(0,o.jsx)(i.SelectOption,{value:50,children:r.lmsg("priorityLow",{priority:50})})]},"mx_opt")]},PTR:{defaults:{},toFormValues:({displayHost:e,opt:n,displayVal:t,...i})=>({...i,displayVal:t.replace(/\.?<domain>./,""),ipMask:{ip:e,mask:n}}),toSubmitValues:({ipMask:e,...n})=>({...n,displayHost:e?.ip,opt:e?.mask}),fields:[(0,o.jsx)(i.FormField,{required:!0,label:(0,o.jsx)(l,{content:"ipAddress"}),name:"ipMask",description:(0,o.jsx)(l,{content:"ipAddressWithMaskDescriptionExt"}),children:({getId:e,getName:n,getValue:t,setValue:a})=>{const{ip:s,mask:l}=t()??{};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.Input,{id:`${e()}-ip`,size:"lg",name:`${n()}[ip]`,value:s,onChange:({target:e})=>a({ip:e.value,mask:l})})," / ",(0,o.jsx)(i.Input,{id:`${e()}-mask`,size:"sm",name:`${n()}[mask]`,value:l,onChange:({target:e})=>a({ip:s,mask:e.value})})]})}},"prt_ip"),(0,o.jsx)(s.default,{name:"displayVal"},"ptr_int_host")]},TXT:{defaults:e?{}:{value:"+all",spfSyntax:"spf"},toFormValues:n=>{if(e)return n;const{displayVal:t,...i}=n,a=t.startsWith("v=spf1 ")?"spf":"multiline";return{...i,spfSyntax:a,value:"spf"===a?t.slice(7):"",multilineValue:"spf"!==a?t:""}},toSubmitValues:n=>{if(e)return n;const{spfSyntax:t,value:i,multilineValue:a,displayHost:s,...o}=n;return{...o,displayHost:s,displayVal:"spf"===t?`v=spf1 ${i}`:a}},fields:[(0,o.jsx)(s.default,{},"txt_int_host"),e?(0,o.jsx)(i.FormFieldText,{size:"fill",name:"displayVal",label:(0,o.jsx)(l,{content:"txtRecord"})},"TXT_ext_host"):(0,o.jsx)(i.FormFieldRadioButtons,{className:"dns-spf-radiobutton",name:"spfSyntax",label:(0,o.jsx)(l,{content:"txtRecordString"}),options:[{value:"spf",className:"mx-sfp",label:(0,o.jsx)(l,{content:"txtSpfSyntax"}),indentFields:[(0,o.jsx)(i.Input,{size:null,disabled:!0,value:"v=spf1",style:{width:"60px"}},"spf1"),(0,o.jsx)(i.FormFieldText,{name:"value",label:null},"txt_value")]},{value:"multiline",label:"",indentFields:[(0,o.jsx)(i.FormFieldText,{name:"multilineValue",multiline:!0,label:null},"txt_multiline_value")]}]},"txt_spf_syntax")]},SRV:{defaults:e?{priority:"5",weight:"25",displayVal:"."}:{priority:"5",weight:"10",displayVal:"."},toFormValues:({domainName:e,opt:n,...t})=>{const[i,a,s]=n.split(" "),{serviceName:o,protocol:l,domainName:r}=e.match(/_(?<serviceName>[a-zA-Z0-9-]+)\._(?<protocol>[a-zA-Z0-9-]+)(\.(?<domainName>[a-zA-Z0-9-]+))?$/)?.groups||{};return{...t,priority:i,weight:a,targetPort:s,serviceName:o,protocol:l,domainName:r}},toSubmitValues:({protocol:e,domainName:n,serviceName:t,priority:i,weight:a,targetPort:s,...o})=>({...o,domainName:t&&e?`_${t}._${e}${n?`.${n}`:""}`:void 0,opt:[i,a,s].join(" ")}),fields:[(0,o.jsx)(i.FormFieldText,{name:"serviceName",required:!0,label:(0,o.jsx)(l,{content:"serviceName"}),description:(0,o.jsx)(l,{content:"serviceNameDescription"})},"SRV_service_name"),(0,o.jsx)(i.FormFieldText,{name:"protocol",required:!0,label:(0,o.jsx)(l,{content:"protocol"}),description:(0,o.jsx)(l,{content:"protocolNameDescription"})},"SRV_protocol"),e?(0,o.jsx)(s.default,{name:"domainName"},"txt_int_host"):null,(0,o.jsx)(i.FormFieldText,{required:!0,name:"displayVal",label:(0,o.jsx)(l,{content:"targetHost"}),description:(0,o.jsx)(l,{content:"targetHostDescription"})},"SRV_target_host"),(0,o.jsx)(i.FormFieldText,{required:!0,name:"targetPort",inputProps:{type:"number",max:65535,min:0},label:(0,o.jsx)(l,{content:"targetPort"})},"SRV_target_port"),(0,o.jsx)(i.FormFieldSelect,{name:"priority",label:(0,o.jsx)(l,{content:"priority"}),children:Array.from({length:11}).map(((e,n)=>{const t=5*n;let a;switch(t){case 0:a=r.lmsg("priorityHigh",{priority:t});break;case 50:a=r.lmsg("priorityLow",{priority:t});break;default:a=t.toString()}return(0,o.jsx)(i.SelectOption,{value:t.toString(),children:a},t)}))},"SRV_priority"),(0,o.jsx)(i.FormFieldSelect,{name:"weight",label:(0,o.jsx)(l,{content:"srvWeight"}),children:Array.from({length:e?11:10}).map(((n,t)=>{const a=e?5*Math.abs(t-10):10*(t+1);let s;if(e)switch(a){case 0:s=r.lmsg("weightLow",{weight:a});break;case 50:s=r.lmsg("weightHigh",{weight:a});break;default:s=a.toString()}else s=a.toString();return(0,o.jsx)(i.SelectOption,{value:a.toString(),children:s},a)}))},"SRV_weight")]},CAA:{defaults:{opt:"issue"},fields:[(0,o.jsx)(s.default,{},"caa_int_host"),(0,o.jsxs)(i.FormFieldSelect,{name:"opt",label:(0,o.jsx)(l,{content:"caaTag"}),children:[(0,o.jsx)(i.SelectOption,{value:"issue",children:"issue"}),(0,o.jsx)(i.SelectOption,{value:"issuewild",children:"issuewild"}),(0,o.jsx)(i.SelectOption,{value:"iodef",children:"iodef"})]},"CAA_tag"),(0,o.jsx)(i.FormFieldText,{name:"displayVal",label:(0,o.jsx)(l,{content:"caaRecord"}),size:"fill"},"CAA_value")]}})},1646:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>i.default});var i=t(1647)},1641:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>E});var i=t(236),a=t(686),s=t(709),o=t(237),l=t(1642),r=t(692),d=t(87),c=t(1643),u=t(1645),m=t(1646),p=t(1652),f=t(703),v=t(684),y=t(783),g=t.n(y),S=t(1653),k=t.n(S),x=t(1654),h=t.n(x),b=t(1655),j=t.n(b),F=t(1656),N=t.n(F),T=t(1657),D=t(282);const V=d.Locale.getTranslate("smb.components.lists.dnsrecords"),w=d.Locale.getSection("smb.components.lists.dnsrecords"),E=(0,r.withPageLayout)((()=>{const{data:{os:{isUnix:e},dns:{template:{templateNotSynchronized:n,soaTemplateNotSynchronized:t,isExternalDnsEnabled:r,isEnabled:d,records:y}={}}}}=(0,a.useQuery)(g()),[S,{loading:x}]=(0,s.useMutation)(h(),{onError({message:e}){(0,v.addToast)({intent:"danger",message:e})}}),[b,{loading:F}]=(0,s.useMutation)(k()),[D,{loading:E}]=(0,s.useMutation)(j()),[C,{loading:O}]=(0,s.useMutation)(N()),[P,_]=(0,i.useState)([]),[R,q]=(0,i.useState)(null),[z,A]=(0,f.useModal)("dnsZoneSync"),[M,L]=(0,f.useModal)("dnsZoneSoaSync"),[H,B]=(0,f.useModal)("dnsRestore"),Z=(0,i.useCallback)((()=>{b({variables:{enable:!0}})}),[b]),$=(0,i.useCallback)((()=>{b({variables:{enable:!1}})}),[b]),I=(0,i.useCallback)(((e=!1)=>{e?C():D()}),[D,C]),W=(0,i.useCallback)((()=>{S({variables:{ids:P}})}),[S,P]),Q=(0,i.useMemo)((()=>(0,i.jsx)(o.ToolbarGroup,{title:"",children:(0,i.jsx)(o.Button,{"data-type":"add-dns-record",icon:"plus",intent:"primary",onClick:()=>q(0),children:(0,i.jsx)(V,{content:"addRecord"})})})),[]),U=(0,i.useMemo)((()=>(0,i.jsxs)(i.Fragment,{children:[Q,(0,i.jsxs)(o.ToolbarGroup,{title:w.lmsg("moreActions"),children:[d?(0,i.jsx)(o.Button,{"data-type":"dns-disable",state:F?"loading":void 0,onClick:$,children:(0,i.jsx)(V,{content:"turnOff"})}):(0,i.jsx)(o.Button,{"data-type":"dns-enable",state:F?"loading":void 0,onClick:Z,children:(0,i.jsx)(V,{content:"turnOn"})}),(0,i.jsx)(o.Button,{"data-type":"dns-restore-default",disabled:!d,onClick:()=>B(!0),children:(0,i.jsx)(V,{content:"restoreDefault"})}),e?(0,i.jsx)(o.Button,{"data-type":"dns-zone-sync",onClick:()=>A(!0),children:(0,i.jsx)(V,{content:"syncZoneFrom"})}):null]}),(0,i.jsx)(o.ToolbarGroup,{title:"",children:(0,i.jsx)(o.ListOperation,{critical:!0,confirmationText:e=>e.selectedRowTitle?(0,i.jsx)(V,{content:"removeRecord",params:e}):(0,i.jsx)(V,{content:"removeRecords",params:e}),actionButtonText:w.lmsg("remove"),children:(0,i.jsx)(o.Button,{"data-type":"dns-remove",disabled:!P.length,state:x?"loading":void 0,onClick:W,children:(0,i.jsx)(V,{content:"remove"})})})})]})),[Q,d,F,$,Z,e,P.length,x,W,B,A]),G=(0,i.useMemo)((()=>d?[{key:"displayHost",title:(0,i.jsx)(V,{content:"host"}),sortable:!0,type:"title",render:({displayHost:e,id:n})=>(0,i.jsx)("a",{onClick:()=>q(n),children:e})},{key:"ttl",title:(0,i.jsx)(V,{content:"ttl"}),sortable:!0},{key:"type",title:(0,i.jsx)(V,{content:"type"}),sortable:!0},{key:"displayVal",title:(0,i.jsx)(V,{content:"value"}),sortable:!0}]:[{key:"displayVal",type:"title",title:(0,i.jsx)(V,{content:"nameServer"}),render:({displayVal:e,id:n})=>(0,i.jsx)("a",{onClick:()=>q(n),children:e})}]),[d]),K=(0,i.useMemo)((()=>d?["displayVal","displayHost","ttl","type"]:"displayVal"),[d]);return(0,i.jsxs)(i.Fragment,{children:[n&&!E?(0,i.jsx)(o.StatusMessage,{intent:"warning",onClose:()=>I(),children:(0,i.jsx)(V,{content:"templateNotSynchronized",params:{link:(0,i.jsx)("a",{onClick:()=>A(!0),children:(0,i.jsx)(V,{content:"templateNotSynchronizedLinkText"})})}})}):null,t&&!O?(0,i.jsx)(o.StatusMessage,{intent:"warning",onClose:()=>I(!0),children:(0,i.jsx)(V,{content:"soaTemplateNotSynchronized",params:{link:(0,i.jsx)("a",{onClick:()=>L(!0),children:(0,i.jsx)(V,{content:"templateNotSynchronizedLinkText"})})}})}):null,(0,i.jsx)(T.default,{dnsEnabled:d,isExternalDnsEnabled:r}),!y.length&&(0,i.jsx)(o.Toolbar,{children:Q}),(0,i.jsx)(l.default,{rowKey:"id",itemsPerPage:25,searchField:K,searchBarInputProps:{placeholder:w.lmsg("search")},selection:P,columns:G,data:y,toolbar:U,onSelectionChange:e=>_(e)}),(0,i.jsx)(c.default,{isOpen:H,onClose:()=>B(!1)}),(0,i.jsx)(u.default,{isOpen:z,onClose:()=>A(!1)}),(0,i.jsx)(p.default,{isOpen:M,onClose:()=>L(!1)}),(0,i.jsx)(m.default,{dnsEnabled:d,dnsId:R,onClose:()=>{q(null)}})]})}),(e=>{const{showFrames:n,pageHeader:t,pageSidebar:i}=(0,D.default)();return{...e,showFrames:n,pageHeader:{...t,helpMenu:{...t.helpMenu,helpContext:"dns.records"}},pageSidebar:i,pageContentHeader:{breadcrumbs:[i.isPowerUserPanel?null:{title:d.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home/"},{title:d.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools/"},{title:d.Locale.getSection("components.pages.dns").lmsg("title"),href:"/cp/dns/"},{title:d.Locale.getSection("components.pages.dns-records").lmsg("title"),href:"/cp/dns/records/"}].filter(Boolean),tabs:[],tabsHasRootPage:!0}}}))},1652:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>p});var i=t(443),a=t(709),s=t(238),o=t.n(s),l=t(237),r=t(87),d=t(236);const c=r.Locale.getTranslate("admin.controllers.dns.soa-sync"),u=i.gql`
    mutation SyncDnsSoaZone {
        syncDnsSoaZone {
            task {
                id
            }
            query {
                dns {
                    template {
                        soaTemplateNotSynchronized
                    }
                }
            }
        }
    }
`,m=({isOpen:e,onClose:n})=>{const[t,{loading:i}]=(0,a.useMutation)(u);return(0,d.jsx)(l.Dialog,{dataType:"dns-zone-soa-sync",size:"sm",isOpen:e,onClose:n,title:(0,d.jsx)(c,{content:"title"}),form:{applyButton:!1,onSubmit:async()=>{await t(),n()},onSuccess:n,submitButton:{state:i?"loading":void 0,"data-type":"dns-zone-soa-apply"}},children:(0,d.jsx)(l.Paragraph,{children:(0,d.jsx)(c,{content:"title"})})})};m.propTypes={isOpen:o().bool,onClose:o().func.isRequired},m.defaultProps={isOpen:!1};const p=m},1645:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>v});var i=t(443),a=t(709),s=t(237),o=t(238),l=t.n(o),r=t(819),d=t(705),c=t(87),u=t(236);const m=c.Locale.getTranslate("admin.controllers.dns.sync"),p=i.gql`
    mutation SyncDnsZone($input: SyncDnsZoneInput!) {
        syncDnsZone(input: $input) {
            task {
                id
            }
        }
    }
`,f=({isOpen:e,onClose:n})=>{const[t]=(0,a.useMutation)(p);return(0,u.jsx)(d.default,{dataType:"dns-zone-sync",isOpen:e,onClose:n,title:(0,u.jsx)(m,{content:"title"}),form:(0,u.jsx)(r.default,{applyButton:!1,mutation:t,onSubmit:({sync:e})=>({forced:"forced"===e}),onSuccess:n,submitButton:{"data-type":"dns-sync-apply"},values:{sync:"safe"},children:(0,u.jsx)(s.FormFieldRadioButtons,{label:(0,u.jsx)(m,{content:"type-option"}),name:"sync",options:[{value:"safe",label:(0,u.jsx)(m,{content:"safe"})},{value:"forced",label:(0,u.jsx)(m,{content:"force"})}]})})})};f.propTypes={isOpen:l().bool,onClose:l().func.isRequired},f.defaultProps={isOpen:!1};const v=f},1643:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>p});var i=t(238),a=t.n(i),s=t(237),o=t(87),l=t(709),r=t(1644),d=t.n(r),c=t(236);const u=o.Locale.getTranslate("admin.controllers.dns.restore-default"),m=({isOpen:e,onClose:n})=>{const[t,{loading:i}]=(0,l.useMutation)(d());return(0,c.jsx)(s.Dialog,{size:"sm",isOpen:e,onClose:n,title:(0,c.jsx)(u,{content:"title"}),form:{onSubmit:async()=>{await t(),n()},submitButton:{state:i?"loading":void 0,"data-type":"dns-restore-submit"}},children:(0,c.jsx)(s.Paragraph,{children:(0,c.jsx)(u,{content:"text"})})})};m.propTypes={isOpen:a().bool,onClose:a().func.isRequired},m.defaultProps={isOpen:!1};const p=m},1640:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>i.default});var i=t(1641)},1657:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>m});var i=t(237),a=t(236),s=t(238),o=t.n(s),l=t(722),r=t(87),d=t(679);const c=r.Locale.getTranslate("admin.controllers.dns"),u=({dnsEnabled:e,isExternalDnsEnabled:n})=>{const t=(0,d.useLocation)(),s=(0,a.useMemo)((()=>[{title:(0,a.jsx)(c,{content:"records.title"}),to:"/cp/dns/records"},e?{title:(0,a.jsx)(c,{content:"soa-record.title"}),to:"/cp/dns/soa-record"}:null,{title:(0,a.jsx)(c,{content:"acl-records.title"}),to:"/admin/dns/acl-records"},{title:(0,a.jsx)(c,{content:"settings.title"}),to:"/admin/dns/settings"},n?{title:(0,a.jsx)(c,{content:"external-dns.title"}),to:"/admin/dns/external-dns"}:null].filter((e=>e))),[e,n]),o=(0,a.useMemo)((()=>s.findIndex((({to:e})=>t.pathname===e))+1),[t.pathname,s]);return(0,a.jsx)(i.Tabs,{active:o,children:s.map(((e,n)=>(0,a.jsx)(i.Tab,{title:e.title,component:l.default,to:e.to},n)))})};u.propTypes={dnsEnabled:o().bool.isRequired,isExternalDnsEnabled:o().bool},u.defaultProps={isExternalDnsEnabled:!1};const m=u},1654:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteDnsTemplateRecord"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ids"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteDnsTemplateRecord"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"ids"},value:{kind:"Variable",name:{kind:"Name",value:"ids"}}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"query"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"dns"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"template"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"records"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"host"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"val"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ttl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"displayHost"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"displayVal"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"domainName"},arguments:[],directives:[]}]}}]}}]}}]}}]}}]}}],loc:{start:0,end:531}};n.loc.source={body:"mutation DeleteDnsTemplateRecord($ids: [ID!]!) {\r\n    deleteDnsTemplateRecord(input: { ids: $ids }) {\r\n        query {\r\n            dns {\r\n                template {\r\n                    records {\r\n                        id\r\n                        type\r\n                        host\r\n                        val\r\n                        ttl\r\n                        displayHost\r\n                        displayVal\r\n                        domainName\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function t(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&n.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){t(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){t(e,n)})),e.definitions&&e.definitions.forEach((function(e){t(e,n)}))}var i={};function a(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n,e.exports.DeleteDnsTemplateRecord=function(e,n){var t={kind:e.kind,definitions:[a(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var s=i[n]||new Set,o=new Set,l=new Set;for(s.forEach((function(e){l.add(e)}));l.size>0;){var r=l;l=new Set,r.forEach((function(e){o.has(e)||(o.add(e),(i[e]||new Set).forEach((function(e){l.add(e)})))}))}return o.forEach((function(n){var i=a(e,n);i&&t.definitions.push(i)})),t}(n,"DeleteDnsTemplateRecord")},1656:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"HideDnsSyncSoaWarning"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hideDnsSoaTemplateWarning"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"query"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"dns"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"template"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"soaTemplateNotSynchronized"},arguments:[],directives:[]}]}}]}}]}}]}}]}}],loc:{start:0,end:234}};n.loc.source={body:"mutation HideDnsSyncSoaWarning {\r\n    hideDnsSoaTemplateWarning {\r\n        query {\r\n            dns {\r\n                template {\r\n                    soaTemplateNotSynchronized\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function t(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&n.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){t(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){t(e,n)})),e.definitions&&e.definitions.forEach((function(e){t(e,n)}))}var i={};function a(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n,e.exports.HideDnsSyncSoaWarning=function(e,n){var t={kind:e.kind,definitions:[a(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var s=i[n]||new Set,o=new Set,l=new Set;for(s.forEach((function(e){l.add(e)}));l.size>0;){var r=l;l=new Set,r.forEach((function(e){o.has(e)||(o.add(e),(i[e]||new Set).forEach((function(e){l.add(e)})))}))}return o.forEach((function(n){var i=a(e,n);i&&t.definitions.push(i)})),t}(n,"HideDnsSyncSoaWarning")},1655:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"HideDnsSyncWarning"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hideDnsTemplateWarning"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"query"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"dns"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"template"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"templateNotSynchronized"},arguments:[],directives:[]}]}}]}}]}}]}}]}}],loc:{start:0,end:225}};n.loc.source={body:"mutation HideDnsSyncWarning {\r\n    hideDnsTemplateWarning {\r\n        query {\r\n            dns {\r\n                template {\r\n                    templateNotSynchronized\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function t(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&n.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){t(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){t(e,n)})),e.definitions&&e.definitions.forEach((function(e){t(e,n)}))}var i={};function a(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n,e.exports.HideDnsSyncWarning=function(e,n){var t={kind:e.kind,definitions:[a(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var s=i[n]||new Set,o=new Set,l=new Set;for(s.forEach((function(e){l.add(e)}));l.size>0;){var r=l;l=new Set,r.forEach((function(e){o.has(e)||(o.add(e),(i[e]||new Set).forEach((function(e){l.add(e)})))}))}return o.forEach((function(n){var i=a(e,n);i&&t.definitions.push(i)})),t}(n,"HideDnsSyncWarning")},1644:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"RestoreDnsTemplateZone"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"restoreDnsTemplateZone"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"query"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"dns"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"template"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"records"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"host"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"val"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ttl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"displayHost"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"displayVal"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"domainName"},arguments:[],directives:[]}]}}]}}]}}]}}]}}]}}],loc:{start:0,end:493}};n.loc.source={body:"mutation RestoreDnsTemplateZone {\r\n    restoreDnsTemplateZone {\r\n        query {\r\n            dns {\r\n                template {\r\n                    records {\r\n                        id\r\n                        type\r\n                        host\r\n                        val\r\n                        ttl\r\n                        displayHost\r\n                        displayVal\r\n                        domainName\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function t(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&n.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){t(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){t(e,n)})),e.definitions&&e.definitions.forEach((function(e){t(e,n)}))}var i={};function a(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n,e.exports.RestoreDnsTemplateZone=function(e,n){var t={kind:e.kind,definitions:[a(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var s=i[n]||new Set,o=new Set,l=new Set;for(s.forEach((function(e){l.add(e)}));l.size>0;){var r=l;l=new Set,r.forEach((function(e){o.has(e)||(o.add(e),(i[e]||new Set).forEach((function(e){l.add(e)})))}))}return o.forEach((function(n){var i=a(e,n);i&&t.definitions.push(i)})),t}(n,"RestoreDnsTemplateZone")},1653:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ToggleDnsZone"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"enable"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"toggleDnsTemplateZone"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"enable"},value:{kind:"Variable",name:{kind:"Name",value:"enable"}}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"query"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"dns"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"template"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"templateNotSynchronized"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"soaTemplateNotSynchronized"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"isEnabled"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"records"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"host"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"val"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ttl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"displayHost"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"displayVal"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"domainName"},arguments:[],directives:[]}]}}]}}]}}]}}]}}]}}],loc:{start:0,end:655}};n.loc.source={body:"mutation ToggleDnsZone($enable: Boolean!) {\r\n    toggleDnsTemplateZone(input: { enable:  $enable }) {\r\n        query {\r\n            dns {\r\n                template {\r\n                    templateNotSynchronized\r\n                    soaTemplateNotSynchronized\r\n                    isEnabled\r\n                    records {\r\n                        id\r\n                        type\r\n                        host\r\n                        val\r\n                        ttl\r\n                        displayHost\r\n                        displayVal\r\n                        domainName\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function t(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&n.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){t(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){t(e,n)})),e.definitions&&e.definitions.forEach((function(e){t(e,n)}))}var i={};function a(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n,e.exports.ToggleDnsZone=function(e,n){var t={kind:e.kind,definitions:[a(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var s=i[n]||new Set,o=new Set,l=new Set;for(s.forEach((function(e){l.add(e)}));l.size>0;){var r=l;l=new Set,r.forEach((function(e){o.has(e)||(o.add(e),(i[e]||new Set).forEach((function(e){l.add(e)})))}))}return o.forEach((function(n){var i=a(e,n);i&&t.definitions.push(i)})),t}(n,"ToggleDnsZone")}}]);
//# sourceMappingURL=records.js.map?38c71be82731f8336598