(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["components/pages/ProtectedDirectoryUserPasswordPage"],{1022:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>d});var r=n(270),i=n(574),o=n(272),s=n.n(o),a=n(271);const c=({onClose:e,isOpen:t=!0,closeOnFormSuccess:n=!0,closeUrl:o="..",form:s,...c})=>{const d=(0,i.useNavigate)(),[u,l]=(0,r.useState)(t),p=(0,r.useRef)(null),f=(0,r.useCallback)(((...t)=>{const n=e??(()=>d(o,{preventScrollReset:!0}));l(!1),p.current=setTimeout((()=>{n(...t),p.current=null}),300)}),[o,d,e]);(0,r.useEffect)((()=>()=>clearTimeout(p.current)),[]),(0,r.useEffect)((()=>{t?p.current&&clearTimeout(p.current):l(t)}),[t]);const m=(0,r.useMemo)((()=>{if(s&&n){if((0,r.isValidElement)(s))return(0,r.cloneElement)(s,{onSuccess:()=>{s.props.onSuccess?.(),f()}});if("object"==typeof s)return{...s,onSuccess:()=>{s.onSuccess?.(),f()}}}return s}),[n,f,s]);return(0,r.jsx)(a.Drawer,{...c,form:m,onClose:f,isOpen:u})};c.propTypes={onClose:s().func,isOpen:s().bool,form:s().oneOfType([s().object,s().node]),closeOnFormSuccess:s().bool,closeUrl:s().oneOfType([s().string,s().object])};const d=c},2235:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>y});var r=n(270),i=n(272),o=n.n(i),s=n(574),a=n(614),c=n(271),d=n(89),u=n(1022),l=n(835),p=n(530),f=n(2236),m=n.n(f);const v=d.Locale.getTranslate("components.pages.ProtectedDirectoryUserPassword"),k=({protectedDirectoryUser:{login:e}})=>{const{userId:t}=(0,s.useParams)(),n=(0,s.useLocation)(),[i,o]=(0,r.useState)({id:t,password:""}),[d]=(0,a.useMutation)(m(),{onCompleted(){(0,p.addToast)({intent:"success",message:(0,r.jsx)(v,{content:"success"})})}});return(0,r.jsx)(u.default,{isOpen:!0,"data-type":"protected-directory-user-password-drawer",title:(0,r.jsx)(v,{content:"title"}),subtitle:(0,r.jsx)(v,{content:"subtitle",params:{login:(0,r.jsx)(c.Label,{view:"light",size:"sm",caps:!1,children:e})}}),size:"sm",closeUrl:{...n,pathname:".."},form:(0,r.jsx)(l.default,{values:i,onFieldChange:(e,t)=>{o((n=>(0,c.setIn)(n,e,t)))},mutation:d,applyButton:!1,submitButton:{children:(0,r.jsx)(v,{content:"submit"}),"data-type":"protected-directory-user-password-submit"},children:(0,r.jsx)(c.FormFieldPassword,{name:"password",required:!0,autoFocus:!0,label:(0,r.jsx)(v,{content:"passwordLabel"}),inputProps:{maxLength:"255"}})})})};k.propTypes={protectedDirectoryUser:o().shape({login:o().string.isRequired}).isRequired};const y=k},2234:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.default});var r=n(2235)},2236:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateProtectedDirectoryUser"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UpdateProtectedDirectoryUserInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateProtectedDirectoryUser"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"protectedDirectoryUser"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:217}};t.loc.source={body:"mutation UpdateProtectedDirectoryUser(\r\n    $input: UpdateProtectedDirectoryUserInput!, \r\n) {\r\n    updateProtectedDirectoryUser(input: $input) {\r\n        protectedDirectoryUser {\r\n            id\r\n        }\r\n    }\r\n}\r\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function n(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var r=e.type;"NamedType"===r.kind&&t.add(r.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){n(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){n(e,t)})),e.definitions&&e.definitions.forEach((function(e){n(e,t)}))}var r={};function i(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}t.definitions.forEach((function(e){if(e.name){var t=new Set;n(e,t),r[e.name.value]=t}})),e.exports=t,e.exports.UpdateProtectedDirectoryUser=function(e,t){var n={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var o=r[t]||new Set,s=new Set,a=new Set;for(o.forEach((function(e){a.add(e)}));a.size>0;){var c=a;a=new Set,c.forEach((function(e){s.has(e)||(s.add(e),(r[e]||new Set).forEach((function(e){a.add(e)})))}))}return s.forEach((function(t){var r=i(e,t);r&&n.definitions.push(r)})),n}(t,"UpdateProtectedDirectoryUser")}}]);
//# sourceMappingURL=ProtectedDirectoryUserPasswordPage.js.map?603f61b0b1f3f20fc12e