"use strict";(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["views/dns/records/dns-zone-sync"],{1530(e,n,t){t.r(n),t.d(n,{default:()=>l});var s=t(378),o=t(694),c=t(379);const l=({onClose:e,isOpen:n=!0,closeOnFormSuccess:t=!0,closeUrl:l="..",form:r,...a})=>{const u=(0,o.useNavigate)(),[i,d]=(0,s.useState)(n),f=(0,s.useRef)(null),p=(0,s.useCallback)((...n)=>{const t=e??(()=>u(l,{preventScrollReset:!0}));d(!1),f.current=setTimeout(()=>{t(...n),f.current=null},300)},[l,u,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(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,{...a,form:m,onClose:p,isOpen:i})}},2482(e,n,t){t.r(n),t.d(n,{default:()=>p});var s=t(786),o=t(677),c=t(379),l=t(788),r=t(1530),a=t(1403),u=t(95),i=t(378);const d=u.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)(r.default,{component:l.default,dataType:"dns-zone-sync",isOpen:!0,title:(0,i.jsx)(d,{content:"title"}),"aria-label":u.Locale.getSection("admin.controllers.dns.sync").lmsg("drawerAriaLabel"),form:(0,i.jsx)(a.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?c63f9b481ae014a0b4df