"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/dns/records/dns-zone-sync"],{1406:(e,n,t)=>{t.r(n),t.d(n,{default:()=>u});var s=t(285),o=t(580),c=t(286);const u=({onClose:e,isOpen:n=!0,closeOnFormSuccess:t=!0,closeUrl:u="..",form:r,...l})=>{const a=(0,o.useNavigate)(),[i,f]=(0,s.useState)(n),d=(0,s.useRef)(null),p=(0,s.useCallback)(((...n)=>{const t=e??(()=>a(u,{preventScrollReset:!0}));f(!1),d.current=setTimeout((()=>{t(...n),d.current=null}),300)}),[u,a,e]);(0,s.useEffect)((()=>()=>{d.current&&clearTimeout(d.current)}),[]),(0,s.useEffect)((()=>{n?d.current&&clearTimeout(d.current):f(n)}),[n]);const m=(0,s.useMemo)((()=>{if(r&&t){if((0,s.isValidElement)(r))return(0,s.cloneElement)(r,{onSuccess:(...e)=>{r.props.onSuccess?.(...e),p()}});if("object"==typeof r)return{...r,onSuccess:(...e)=>{r.onSuccess?.(...e),p()}}}return r}),[t,p,r]);return(0,s.jsx)(c.Drawer,{...l,form:m,onClose:p,isOpen:i})}},2281:(e,n,t)=>{t.r(n),t.d(n,{default:()=>p});var s=t(1120),o=t(628),c=t(286),u=t(624),r=t(1406),l=t(1289),a=t(89),i=t(285);const f=a.Locale.getTranslate("admin.controllers.dns.sync"),d=s.gql`
    mutation SyncDnsZone($input: SyncDnsZoneInput!) {
        syncDnsZone(input: $input) {
            task {
                id
            }
        }
    }
`,p=()=>{const[e]=(0,o.useMutation)(d);return(0,i.jsx)(r.default,{component:u.default,dataType:"dns-zone-sync",isOpen:!0,title:(0,i.jsx)(f,{content:"title"}),form:(0,i.jsx)(l.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?12a58a3cfeb9e71e9daf