"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/dns/records/dns-zone-sync"],{1043:(e,n,s)=>{s.r(n),s.d(n,{default:()=>a});var t=s(270),o=s(574),c=s(272),l=s.n(c),u=s(271);const r=({onClose:e,isOpen:n=!0,closeOnFormSuccess:s=!0,closeUrl:c="..",form:l,...r})=>{const a=(0,o.useNavigate)(),[i,f]=(0,t.useState)(n),p=(0,t.useRef)(null),d=(0,t.useCallback)(((...n)=>{const s=e??(()=>a(c,{preventScrollReset:!0}));f(!1),p.current=setTimeout((()=>{s(...n),p.current=null}),300)}),[c,a,e]);(0,t.useEffect)((()=>()=>clearTimeout(p.current)),[]),(0,t.useEffect)((()=>{n?p.current&&clearTimeout(p.current):f(n)}),[n]);const m=(0,t.useMemo)((()=>{if(l&&s){if((0,t.isValidElement)(l))return(0,t.cloneElement)(l,{onSuccess:()=>{l.props.onSuccess?.(),d()}});if("object"==typeof l)return{...l,onSuccess:()=>{l.onSuccess?.(),d()}}}return l}),[s,d,l]);return(0,t.jsx)(u.Drawer,{...r,form:m,onClose:d,isOpen:i})};r.propTypes={onClose:l().func,isOpen:l().bool,form:l().oneOfType([l().object,l().node]),closeOnFormSuccess:l().bool,closeUrl:l().oneOfType([l().string,l().object])};const a=r},1879:(e,n,s)=>{s.r(n),s.d(n,{default:()=>d});var t=s(495),o=s(617),c=s(271),l=s(613),u=s(1043),r=s(856),a=s(89),i=s(270);const f=a.Locale.getTranslate("admin.controllers.dns.sync"),p=t.gql`
    mutation SyncDnsZone($input: SyncDnsZoneInput!) {
        syncDnsZone(input: $input) {
            task {
                id
            }
        }
    }
`,d=()=>{const[e]=(0,o.useMutation)(p);return(0,i.jsx)(u.default,{component:l.default,dataType:"dns-zone-sync",isOpen:!0,title:(0,i.jsx)(f,{content:"title"}),form:(0,i.jsx)(r.default,{applyButton:!1,mutation:e,onSubmit:({sync:e})=>({forced:"forced"===e}),submitButton:{"data-type":"dns-sync-apply"},values:{sync:"safe"},children:(0,i.jsx)(c.FormFieldRadioButtons,{label:(0,i.jsx)(f,{content:"type-option"}),name:"sync",options:[{value:"safe",label:(0,i.jsx)(f,{content:"safe"})},{value:"forced",label:(0,i.jsx)(f,{content:"force"})}]})})})}}}]);
//# sourceMappingURL=dns-zone-sync.js.map?93022da7e180b7c8f8d8