"use strict";(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["views/dns/records/dns-zone-sync"],{1430:(e,n,t)=>{t.r(n),t.d(n,{default:()=>u});var s=t(296),o=t(599),c=t(297);const u=({onClose:e,isOpen:n=!0,closeOnFormSuccess:t=!0,closeUrl:u="..",form:l,...r})=>{const a=(0,o.useNavigate)(),[i,d]=(0,s.useState)(n),f=(0,s.useRef)(null),p=(0,s.useCallback)((...n)=>{const t=e??(()=>a(u,{preventScrollReset:!0}));d(!1),f.current=setTimeout(()=>{t(...n),f.current=null},300)},[u,a,e]);(0,s.useEffect)(()=>()=>{f.current&&clearTimeout(f.current)},[]),(0,s.useEffect)(()=>{n?f.current&&clearTimeout(f.current):d(n)},[n]);const m=(0,s.useMemo)(()=>{if(l&&t){if((0,s.isValidElement)(l))return(0,s.cloneElement)(l,{onSuccess:(...e)=>{l.props.onSuccess?.(...e),p()}});if("object"==typeof l)return{...l,onSuccess:(...e)=>{l.onSuccess?.(...e),p()}}}return l},[t,p,l]);return(0,s.jsx)(c.Drawer,{...r,form:m,onClose:p,isOpen:i})}},2327:(e,n,t)=>{t.r(n),t.d(n,{default:()=>p});var s=t(696),o=t(583),c=t(297),u=t(698),l=t(1430),r=t(1305),a=t(90),i=t(296);const d=a.Locale.getTranslate("admin.controllers.dns.sync"),f=o.gql`
    mutation SyncDnsZone($input: SyncDnsZoneInput!) {
        syncDnsZone(input: $input) {
            task {
                id
            }
        }
    }
`,p=()=>{const[e]=(0,s.useMutation)(f);return(0,i.jsx)(l.default,{component:u.default,dataType:"dns-zone-sync",isOpen:!0,title:(0,i.jsx)(d,{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)(d,{content:"type-option"}),name:"sync",options:[{value:"safe",label:(0,i.jsx)(d,{content:"safe"})},{value:"forced",label:(0,i.jsx)(d,{content:"force"})}]})})})}}}]);
//# sourceMappingURL=dns-zone-sync.js.map?3f760ef6fc911ba7c29c