D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
psa
/
admin
/
cp
/
public
/
javascript
/
views
/
admin
/
reseller
/
Filename :
customers.js
back
Copy
(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/reseller/customers"],{1417:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>d});var s=n(286),i=n(596),o=n.n(i),r=n(89),a=n(285);const l=r.Locale.getTranslate("components.forms.ip-addresses-selector"),c=({ipAddresses:e,namePrefix:t,type:n,isOtherTypeAvailable:i,getIpAddressType:o,...r})=>{const c=(0,s.useTranslate)("components.forms.ip-addresses-selector");return!!e.length&&(0,a.jsxs)(s.FormFieldSelect,{label:(0,a.jsx)(l,{content:i?`${n}Address`:"ipAddress"}),name:`${t}[${n}]`,...r,children:[e.map((({id:e,ipAddress:t,publicIpAddress:n,type:i})=>(0,a.jsx)(s.SelectOption,{value:e,children:`${n||t}${o(i)}`},e))),i&&(0,a.jsx)(s.SelectOption,{value:"none",children:c("noIpAddressHint")})]},n)};c.propTypes={ipAddresses:o().array.isRequired,namePrefix:o().string.isRequired,type:o().string.isRequired,isOtherTypeAvailable:o().bool.isRequired,getIpAddressType:o().func.isRequired};const d=c},1416:(e,t,n)=>{"use strict";n.r(t),n.d(t,{TYPE_EXCLUSIVE:()=>m,TYPE_IPV4:()=>l,TYPE_IPV6:()=>c,TYPE_SHARED:()=>d,default:()=>p});var s=n(286),i=n(596),o=n.n(i),r=n(285),a=n(1417);const l="ipv4",c="ipv6",d="SHARED",m="EXCLUSIVE",u=({ipAddresses:e,namePrefix:t,isIPv6Supported:n=!0,...i})=>{const o=(0,s.useTranslate)("components.forms.ip-addresses-selector"),u=(0,r.useMemo)((()=>e.filter((({isIPv6:e,isBroken:t})=>!e&&!t))),[e]),p=(0,r.useMemo)((()=>e.filter((({isIPv6:e,isBroken:t})=>e&&!t))),[e]),h=(0,r.useCallback)((e=>{switch(e){case d:return` (${o("shared")})`;case m:return` (${o("exclusive")})`;default:return""}}),[o]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.default,{ipAddresses:u,namePrefix:t,type:l,isOtherTypeAvailable:n&&!!p.length,getIpAddressType:h,...i}),n&&(0,r.jsx)(a.default,{ipAddresses:p,namePrefix:t,type:c,isOtherTypeAvailable:!!u.length,getIpAddressType:h,...i})]})};u.propTypes={ipAddresses:o().array.isRequired,namePrefix:o().string.isRequired,isIPv6Supported:o().bool};const p=u},1415:(e,t,n)=>{"use strict";n.r(t),n.d(t,{TYPE_EXCLUSIVE:()=>s.TYPE_EXCLUSIVE,TYPE_SHARED:()=>s.TYPE_SHARED,default:()=>s.default,prepareBackendData:()=>i});var s=n(1416);const i=e=>{const t=[];return Object.keys(e).forEach((n=>{Object.keys(e[n]).forEach((i=>{"none"!==i&&t.push({id:i,ipAddress:e[n][i],isIPv6:n===s.TYPE_IPV6})}))})),t}},1648:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var s=n(285),i=n(286),o=n(1623),r=n(89),a=n(596),l=n.n(a),c=n(1415);const d=r.Locale.getTranslate("admin.components.forms.admin-panel.form.domain-info-section"),m=r.Locale.getTranslate("admin.components.forms.admin-panel.form.subscription-info-section"),u=r.Locale.getTranslate("components.forms.admin-info"),p=({values:e,servicePlans:t,ipAddresses:n,addonPlans:r,handleFieldChange:a,techDomainUrl:l,techDomainVendor:p,maxDomainLength:h,settingsEnabled:x=!1,settingsCollapsed:b=!1,withCustomer:g=!1,isWindows:j=!1,onToggleDomainSettings:f})=>{const[v,T]=(0,s.useState)(r.filter((({selected:e})=>e)).map((({id:e})=>e))),S=(0,i.getIn)(e,"subscription[subscriptionInfo][servicePlan]"),C=()=>"0"===S,y=(0,s.useMemo)((()=>"mail-hosting"===e.applicationName),[e.applicationName]);(0,s.useEffect)((()=>{const e={};r.forEach((({id:t})=>{e[t]=v.includes(t)})),a("subscription[subscriptionInfo][addonPlanSelector]",JSON.stringify(e))}),[v]),(0,s.useEffect)((()=>{a("subscription[subscriptionInfo][customize]",C()?"1":"0")}),[S]);const I=Object.keys(n).map((t=>{const s=e.subscription.domainInfo.ipSelector[t];return"none"===s?null:n[t][s].split(" ")[0]})).filter(Boolean)[0];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.default,{isEnabled:void 0!==e.subscription.domainInfo.type,isDefault:e.subscription.domainInfo.type===o.TYPE_TECH,url:l,vendor:p,maxDomainLength:h,typeName:"subscription[domainInfo][type]",name:"subscription[domainInfo][domainName]",ipAddress:I,onTypeChange:e=>a("subscription[domainInfo][type]",e),onDomainNameChange:e=>a("subscription[domainInfo][domainName]",e)}),(0,s.jsxs)(i.FormFieldSelect,{label:(0,s.jsx)(m,{content:"servicePlan"}),name:"subscription[subscriptionInfo][servicePlan]",size:"lg",children:[Object.keys(t).filter((e=>"0"!==e)).map((e=>(0,s.jsx)(i.SelectOption,{value:e,children:t[e]},e))),(0,s.jsx)(i.SelectOption,{value:"0",children:t[0]},"0")]}),!C()&&r.length?(0,s.jsx)(i.FormField,{label:(0,s.jsx)(m,{content:"addonPlans"}),children:({isDisabled:e})=>(0,s.jsx)(i.Select,{multiple:!0,searchable:!0,size:"lg",name:"subscription[subscriptionInfo][addonPlanSelector]",id:"subscription-subscriptionInfo-addonPlanSelector",defaultValue:v,onChange:e=>T(e),disabled:e(),children:r.map((({id:e,title:t})=>(0,s.jsx)(i.SelectOption,{value:e,children:t},e)))})}):null,(0,s.jsx)(i.FormFieldCheckbox,{label:(0,s.jsx)(m,{content:g?"customizeSubscriptionForCustomer":"customizeSubscriptionOnCreateSubscription"}),name:"subscription[subscriptionInfo][customize]",description:(0,s.jsx)(m,{content:"customizeSubscriptionHint"}),checkedValue:"1",uncheckedValue:"0"}),x?(0,s.jsxs)(i.Section,{id:"subscription-additionalSettings",title:(0,s.jsx)(d,{content:"subscriptionSettings"}),collapsible:!0,collapsed:b,onToggle:f,children:[(0,s.jsx)(c.default,{ipAddresses:(0,c.prepareBackendData)(n),namePrefix:"subscription[domainInfo][ipSelector]"}),!y&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("br",{}),(0,s.jsx)(i.Heading,{level:"4",children:(0,s.jsx)(d,{content:"credentials"})}),(0,s.jsx)(i.Text,{component:"p",intent:"muted",children:(0,s.jsx)(d,{content:j?"credentialsHintWin":"credentialsHint"})}),(0,s.jsx)(i.FormFieldText,{label:(0,s.jsx)(d,{content:"userName"}),name:"subscription[domainInfo][userName]",required:!0,autoComplete:"off"}),(0,s.jsx)(i.FormFieldPassword,{label:(0,s.jsx)(d,{content:"password"}),name:"subscription[domainInfo][password]",required:!0,autoComplete:"new-password"})]}),(0,s.jsx)(i.FormFieldText,{label:(0,s.jsx)(u,{content:"description"}),multiline:!0,size:"xl",name:"subscription[adminInfo][subscriptionDescription]",description:(0,s.jsx)(u,{content:"subscriptionDescriptionHint"})})]}):null]})};p.propTypes={values:l().object.isRequired,servicePlans:l().object.isRequired,addonPlans:l().array.isRequired,ipAddresses:l().object.isRequired,handleFieldChange:l().func.isRequired,techDomainUrl:l().string.isRequired,techDomainVendor:l().string.isRequired,maxDomainLength:l().number.isRequired,settingsEnabled:l().bool,settingsCollapsed:l().bool,withCustomer:l().bool,isWindows:l().bool,onToggleDomainSettings:l().func};const h=p},1623:(e,t,n)=>{"use strict";n.r(t),n.d(t,{TYPE_CUSTOM:()=>d,TYPE_TECH:()=>c,default:()=>b});var s=n(286),i=n(285),o=n(596),r=n.n(o),a=n(89),l=n(1624);const c="tech",d="custom",m=a.Locale.getTranslate("components.forms.domain.tech-domain-name"),u=({isEnabled:e,isDefault:t,url:n,vendor:o,maxDomainLength:r,typeName:a,name:l,ipAddress:u=null,onDomainNameChange:x,onTypeChange:b})=>{const[g,j]=(0,i.useState)(e&&t?c:d);if(!e)return(0,i.jsx)(p,{name:l,isEnabled:!1,onDomainNameChange:x});const f=[{key:d,icon:(0,i.jsx)(s.Icon,{name:"ribbon",intent:"success"})},{key:c,icon:(0,i.jsx)(s.Icon,{name:"rocket",intent:"info"})}];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.Section,{title:(0,i.jsx)(m,{content:"title"}),vertical:!0,children:(0,i.jsx)(s.FormField,{name:a,onChange:e=>(e=>{j(e),b(e),x("")})(e),children:({getId:e,getName:t,getValue:n,setValue:o,isDisabled:r})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.ItemList,{stretchable:!0,selectable:!0,minColumnWidth:270,gap:"sm",value:n(),onSelect:e=>{e!==g&&o(e)},children:f.map((({key:e,icon:t})=>(0,i.jsx)(s.Item,{icon:t,role:"button",value:e,"data-action":`use-${e}-domain`,title:(0,i.jsx)(s.Heading,{level:"4",children:(0,i.jsx)(s.Paragraph,{children:(0,i.jsx)(m,{content:`${e}DomainTitle`})})}),disabled:r(),children:(0,i.jsx)(s.Text,{fontSize:"md",children:(0,i.jsx)(m,{content:`${e}DomainText`})})},e)))}),(0,i.jsx)("input",{hidden:!0,id:e(),name:t(),value:n(),readOnly:!0})]})})}),g===c?(0,i.jsx)(h,{name:l,ipAddress:u,url:n,vendor:o,maxDomainLength:r,onDomainNameChange:x}):(0,i.jsx)(p,{name:l,isEnabled:!0,onDomainNameChange:x})]})},p=({name:e,isEnabled:t,onDomainNameChange:n})=>(0,i.jsx)(s.Section,{vertical:!0,children:(0,i.jsx)(l.default,{name:e,label:t?(0,i.jsx)(m,{content:"customDomain"}):(0,i.jsx)(m,{content:"domainName"}),onChange:n,required:!0})});p.propTypes={name:r().string.isRequired,isEnabled:r().bool.isRequired,onDomainNameChange:r().func.isRequired};const h=({name:e,onDomainNameChange:t,...n})=>(0,i.jsx)(s.Section,{vertical:!0,children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.FormField,{label:(0,i.jsx)(m,{content:"techDomain"}),name:e,onChange:e=>t(e),children:({getId:e,getName:t,...s})=>(0,i.jsx)(x,{id:e(),name:t(),...s,...n})}),(0,i.jsxs)(s.Cuttable,{maxHeight:24,children:[(0,i.jsx)(s.Paragraph,{children:(0,i.jsx)(m,{content:"techDomainDesc"})}),(0,i.jsxs)("ul",{children:[(0,i.jsx)("li",{children:(0,i.jsx)(m,{content:"techDomainRandom"})}),(0,i.jsx)("li",{children:(0,i.jsx)(m,{content:"techDomainDns"})})]}),(0,i.jsx)(s.Paragraph,{children:(0,i.jsx)(m,{content:"techDomainSwitch"})})]})]})});h.propTypes={name:r().string.isRequired,onDomainNameChange:r().func.isRequired};const x=({id:e,name:t,ipAddress:n=null,url:o,vendor:r,getValue:a,setValue:l,maxDomainLength:c})=>{const[d,u]=(0,i.useState)(!1),[p,h]=(0,i.useState)(n),[x,b]=(0,i.useState)({}),g=(0,i.useCallback)((async()=>{if(b({}),!a()||n!==p)if(n){u(!0);try{const e=await(async({url:e,ipAddress:t,vendor:n,maxDomainLength:s})=>{const i=await fetch(e,{method:"POST",body:JSON.stringify({ip_address:t,vendor:n,max_length:s})}),{subdomain:o}=await i.json();if(!o)throw new Error("subdomain is empty");return o})({url:o,ipAddress:n,vendor:r,maxDomainLength:c});l(e),h(n)}catch{b({error:(0,i.jsx)(m,{content:"error"})})}finally{u(!1)}}else b({noIpAddress:(0,i.jsx)(m,{content:"errorNoIpAddress"})})}),[a,l,n,p,o,r,c]);return(0,i.useEffect)((()=>{g()}),[n]),(0,i.jsxs)(i.Fragment,{children:[d?(0,i.jsx)(s.Status,{progress:!0,children:(0,i.jsx)(m,{content:"generating"})}):(0,i.jsx)(s.Text,{bold:!0,children:a()}),(0,i.jsx)("input",{hidden:!0,id:e,name:t,value:a(),readOnly:!0}),Object.keys(x).map((e=>(0,i.jsxs)(s.Alert,{intent:"danger",children:[(0,i.jsx)(s.Icon,{name:"exclamation-mark-circle-filled",intent:"danger"})," ",x[e]]},e)))]})};x.propTypes={id:r().string.isRequired,name:r().string.isRequired,ipAddress:r().string,url:r().string.isRequired,vendor:r().string.isRequired,maxDomainLength:r().number.isRequired,getValue:r().func.isRequired,setValue:r().func.isRequired},u.propTypes={isEnabled:r().bool.isRequired,isDefault:r().bool.isRequired,url:r().string.isRequired,vendor:r().string.isRequired,maxDomainLength:r().number.isRequired,typeName:r().string.isRequired,name:r().string.isRequired,ipAddress:r().string,onDomainNameChange:r().func.isRequired,onTypeChange:r().func.isRequired};const b=u},1624:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var s=n(286),i=n(596),o=n.n(i),r=n(285);const a=({size:e="lg",...t})=>(0,r.jsx)(s.FormField,{...t,children:({getId:t,getName:n,getValue:i,setValue:o,isDisabled:a})=>(0,r.jsxs)("div",{className:"composite-field",children:[(0,r.jsx)(s.Text,{className:"composite-field__prefix",children:"www. "}),(0,r.jsx)(s.Input,{id:t(),name:n(),value:i(),placeholder:"domain.name",size:e,onChange:e=>o(e.target.value),disabled:a()})]})});a.propTypes={size:o().string};const l=a},1647:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>T,useCreateCustomerFormInDrawer:()=>v});var s=n(285),i=n(596),o=n.n(i),r=n(286),a=n(1623),l=n(89),c=n(620),d=n(1637),m=n(1289),u=n(1648);const p=l.Locale.getTranslate("admin.components.forms.customer"),h=l.Locale.getTranslate("admin.components.forms.admin-panel.form.contact-info"),x=l.Locale.getTranslate("components.forms.admin-info"),b=l.Locale.getTranslate("admin.components.forms.admin-panel.form.domain-info-section"),g=l.Locale.getTranslate("components.buttons"),j=l.Locale.getTranslate("admin.components.forms.admin-panel.form.login-info"),f=({onCancel:e,onToggleDomainSettings:t,onProcess:n,id:i,action:o,values:c,countries:f,canCreateSubscription:v=!1,servicePlans:T,ipAddresses:S,addonPlans:C,customerSettingsEnabled:y=!1,customerSettingsCollapsed:I=!1,embeddedForms:w,maxSysnameSize:R,isWindows:P,techDomain:{url:k,vendor:D,maxDomainLength:N},settingsEnabled:A=!1,settingsCollapsed:E=!1,className:q,render:_,status:F=[]})=>{const[$,L]=(0,s.useState)(c),[U,H]=(0,s.useState)(v&&!c.subscription.domainInfo),O=()=>"1"===(0,r.getIn)($,"subscription[domainInfo][createSubscription]"),B=(e,t)=>{L((n=>{if(n=(0,r.setIn)(n,e,t),"subscription[domainInfo][domainName]"===e&&!U){const e=(0,d.generateUserName)({domainName:t,maxUserNameSize:R,isTechDomain:n.subscription.domainInfo.type===a.TYPE_TECH,isWindows:P});n=(0,r.setIn)(n,"subscription[domainInfo][userName]",e||c.subscription.domainInfo.userName)}return n})),["subscription[domainInfo][ipSelector][ipv4]","subscription[domainInfo][ipSelector][ipv6]","subscription[domainInfo][userName]","subscription[domainInfo][password]"].includes(e)&&l.UAT.dispatchAction("CUSTOM-VALUE",{name:e}),"subscription[domainInfo][userName]"===e&&H(!0)};return(0,s.jsxs)(m.default,{id:i,className:q,render:_,action:o,applyButton:!1,values:$,vertical:!0,onLongTask:n,onFieldChange:B,formPrefix:"subscription",embeddedForms:O()?w:[],embeddedFormsRender:e=>(0,s.jsx)(r.Section,{collapsible:!0,children:e}),submitButton:{id:"btn-send",children:(0,s.jsx)(p,{content:"buttonOk"})},cancelButton:{id:"btn-cancel",children:(0,s.jsx)(g,{content:"cancel"}),onClick:e},children:[(F||[]).filter((({status:e})=>"warning"===e)).map((({content:e})=>(0,s.jsx)(r.StatusMessage,{intent:"warning",children:(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:e}})},e))),(0,s.jsx)(r.Paragraph,{children:(0,s.jsx)(p,{content:"hint"})}),(0,s.jsxs)(r.Section,{title:(0,s.jsx)(p,{content:"contactInfoSection"}),children:[(0,s.jsx)(r.FormFieldText,{label:(0,s.jsx)(h,{content:"contactName"}),name:"contactInfoSection[contactInfo][contactName]",required:!0}),(0,s.jsx)(r.FormFieldText,{label:(0,s.jsx)(h,{content:"email"}),name:"contactInfoSection[contactInfo][email]",required:!0})]}),y?(0,s.jsxs)(r.Section,{id:"customer-additionalSettings",title:(0,s.jsx)(p,{content:"additionalInfoSection"}),collapsible:!0,collapsed:I,children:[(0,s.jsx)(r.FormFieldText,{label:(0,s.jsx)(h,{content:"companyName"}),name:"contactInfoSection[contactInfo][companyName]"}),(0,s.jsx)(r.FormFieldText,{label:(0,s.jsx)(h,{content:"phone"}),name:"contactInfoSection[contactInfo][phone]"}),(0,s.jsx)(r.FormFieldText,{label:(0,s.jsx)(h,{content:"address"}),multiline:!0,size:"xl",name:"contactInfoSection[contactInfo][address]"}),(0,s.jsx)(r.FormFieldText,{label:(0,s.jsx)(h,{content:"city"}),name:"contactInfoSection[contactInfo][city]"}),(0,s.jsx)(r.FormFieldText,{label:(0,s.jsx)(h,{content:"state"}),name:"contactInfoSection[contactInfo][state]"}),(0,s.jsx)(r.FormFieldText,{label:(0,s.jsx)(h,{content:"postalCode"}),name:"contactInfoSection[contactInfo][postalCode]"}),(0,s.jsx)(r.FormFieldSelect,{label:(0,s.jsx)(h,{content:"country"}),name:"contactInfoSection[contactInfo][country]",size:"lg",children:Object.keys(f).map((e=>(0,s.jsx)(r.SelectOption,{value:e,children:f[e]},e)))}),(0,s.jsx)(r.FormFieldText,{label:(0,s.jsx)(h,{content:"additionalInfo"}),multiline:!0,size:"xl",name:"contactInfoSection[contactInfo][additionalInfo]",description:(0,s.jsx)(h,{content:"additionalInfoHint"})}),(0,s.jsx)(r.Section,{title:(0,s.jsx)(x,{content:"adminInfoSection"}),children:(0,s.jsx)(r.FormFieldText,{label:(0,s.jsx)(x,{content:"description"}),multiline:!0,size:"xl",name:"adminInfoSection[clientDescription]",description:(0,s.jsx)(x,{content:"customerDescriptionHint"})})})]}):null,(0,s.jsxs)(r.Section,{id:"customer-panelAccess",title:(0,s.jsx)(p,{content:"accessToPanelSection"}),description:(0,s.jsx)(p,{content:"accessToPanelSection"}),collapsible:!0,children:[(0,s.jsx)(r.FormFieldText,{name:"accessToPanelSection[loginInfo][userName]",label:(0,s.jsx)(j,{content:"userName"}),required:!0,autoComplete:"off"}),(0,s.jsx)(r.FormFieldPassword,{name:"accessToPanelSection[loginInfo][password]",label:(0,s.jsx)(j,{content:"password"}),required:!0,autoComplete:"new-password"}),(0,s.jsx)(r.FormFieldCheckbox,{name:"accessToPanelSection[loginInfo][isActivationRequired]",label:(0,s.jsx)(j,{content:"emailActivation"}),description:(0,s.jsx)(j,{content:"emailActivationHint"}),checkedValue:"1",uncheckedValue:"0"})]}),v?(0,s.jsxs)(r.Section,{title:(0,s.jsx)(b,{content:"domainInfoSection"}),children:[(0,s.jsx)(r.FormFieldCheckbox,{name:"subscription[domainInfo][createSubscription]",label:(0,s.jsx)(b,{content:"createSubscription"}),description:(0,s.jsx)(b,{content:"createSubscriptionHint"}),checkedValue:"1",uncheckedValue:"0"}),O()?(0,s.jsx)(r.Section,{collapsible:!0,children:(0,s.jsx)(u.default,{values:$,servicePlans:T,ipAddresses:S,addonPlans:C,handleFieldChange:B,techDomainUrl:k,techDomainVendor:D,maxDomainLength:N,settingsEnabled:A,settingsCollapsed:E,isWindows:P,onToggleDomainSettings:t,withCustomer:!0})}):null]}):null]})};f.propTypes={onCancel:o().func.isRequired,onToggleDomainSettings:o().func,onProcess:o().func,id:o().string.isRequired,action:o().string.isRequired,values:o().object.isRequired,countries:o().object.isRequired,canCreateSubscription:o().bool,servicePlans:o().object.isRequired,ipAddresses:o().object.isRequired,addonPlans:o().array.isRequired,customerSettingsEnabled:o().bool,customerSettingsCollapsed:o().bool,embeddedForms:o().array,maxSysnameSize:o().number.isRequired,isWindows:o().bool.isRequired,techDomain:o().object.isRequired,settingsEnabled:o().bool,settingsCollapsed:o().bool,className:o().string,render:o().func,status:o().array};const v=(e,t)=>(0,c.useCreateFormInDrawer)(f,"create-customer",e,t),T=f},1534:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>d});var s=n(596),i=n.n(s),o=n(89),r=n(1535);const a={id:i().string,dataUrl:i().string,operations:i().array,itemActions:i().object,columns:i().array,data:i().shape({data:i().array,state:i().object,pager:i().object,locale:i().object,additional:i().object,pathbar:i().any}),searchFilters:i().object,searchOveral:i().string,disabledSelectHint:i().string,isDisabledItem:i().func,onRedraw:i().func,emptyViewMode:i().oneOf(["all","items"]),emptyView:i().any},l={id:void 0,dataUrl:void 0,operations:void 0,itemActions:void 0,columns:void 0,data:void 0,searchFilters:void 0,searchOveral:void 0,disabledSelectHint:void 0,isDisabledItem:void 0,onRedraw:void 0,emptyViewMode:void 0,emptyView:void 0},c=(0,r.default)(o.List,{propsList:Object.keys(a),defaultProps:l});c.displayName="JswList",c.propTypes=a;const d=c},1538:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>d});var s=n(596),i=n.n(s),o=n(286),r=n(89),a=n(646),l=n(285);const c=({items:e})=>e&&e.length>1?(0,l.jsx)(o.Tabs,{active:e.findIndex((({containerCls:e})=>"active"===e))+1,children:e.map((({title:e,href:t},n)=>(0,l.jsx)(o.Tab,{title:e,component:a.default,to:(0,r.prepareUrl)(t)},n)))}):null;c.propTypes={items:i().arrayOf(i().shape({title:i().string.isRequired,href:i().string.isRequired,containerCls:i().string}))};const d=c},1535:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var s=n(285),i=n(89);const o=(e,{propsList:t=[],setters:n={},defaultProps:o={}})=>r=>{const a=(0,s.useRef)(),l=(0,s.useRef)(),[c,d]=Object.entries({...o,...r}).reduce(((e,[n,s])=>(e[t.includes(n)?0:1][n]=s,e)),[{},{}]),m=t.map((e=>{const t=c[e];return n[e]?(l.current?.[n[e]](t),null):t}));return(0,s.useLayoutEffect)((()=>(l.current=new e(c),(0,i.render)(a.current,l.current),()=>{l.current.remove(),l.current=null})),[d.key,...m]),(0,s.jsx)("div",{ref:a,...d})}},1649:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>p});var s=n(285),i=n(596),o=n.n(i),r=n(89),a=n(646),l=n(1645),c=n(1534);const d=r.Locale.getSection("admin.components.lists.customers"),m=r.Locale.getSection("admin.components.lists.subscriptions"),u=({data:e,searchFilters:t,allowCreateCustomer:i=!1,resellersSupport:o=!1,isAdmin:u=!1,hasResellers:p=!1,hasResellerCustomers:h=!1,showOwnerName:x=!1,maxSubscriptionsDisplayed:b,dataUrl:g,createUrl:j,redirectUrl:f})=>{const v=(0,a.useNavigateCallback)(),T=(0,s.useMemo)((()=>[i?{componentType:r.SmallButton,id:"buttonAddNewCustomer",title:d.lmsg("buttonAddNewCustomer"),description:d.lmsg("hintAddNewCustomer"),addCls:"sb-add-new-customer btn-primary",href:j,handler:v}:null,i&&u&&o?{componentType:r.bar.Separator}:null,i&&u&&o?{componentType:r.SmallButton,id:"buttonConvertCustomersToReseller",title:d.lmsg("buttonConvertCustomersToReseller"),description:d.lmsg("hintConvertCustomersToReseller"),addCls:"sb-convert-to-reseller",handler:e=>{const t=(0,r.getComponent)("customers-list");t.checkNonEmptySelection()&&(Plesk.require("app/convert-customers-to-resellers",(e=>{new e({id:"convertCustomersToResellers",cls:"popup-panel",prepareUrl:(0,r.prepareUrl)("/customer/prepare-convert/"),handlerUrl:(0,r.prepareUrl)(`/customer/convert-to-reseller/?redirect=${f}`),ids:t.getSelectedItemsIds()})})),e.preventDefault(),e.stopPropagation())}}:null,i&&u&&p&&(o||h)?{componentType:r.bar.Separator}:null,i&&u&&p&&(o||h)?{componentType:r.SmallButton,id:"buttonChangeOwner",title:d.lmsg("buttonChangeOwner"),description:d.lmsg("hintChangeOwner"),addCls:"sb-move",handler:e=>{const t=(0,r.getComponent)("customers-list");t.checkNonEmptySelection()&&(Plesk.require("app/change-customers-owner",(e=>{new e({id:"changeOwner",cls:"popup-panel",prepareUrl:(0,r.prepareUrl)("/customer/prepare-change-owner/"),handlerUrl:(0,r.prepareUrl)(`/customer/change-owner/?redirect=${f}`),ids:t.getSelectedItemsIds()})})),e.preventDefault(),e.stopPropagation())}}:null,i?{componentType:r.bar.Separator}:null,{componentType:r.list.AdditionalActions,description:d.lmsg("hintChangeStatus"),title:d.lmsg("buttonChangeStatus"),operations:[{componentType:r.SmallButton,id:"buttonSuspendCustomers",title:d.lmsg("buttonSuspendCustomers"),description:d.lmsg("hintSuspendCustomers"),addCls:"sb-suspend",cls:"sb-btn",handler:()=>{(0,r.getComponent)("customers-list").execGroupOperation({url:`/customer/suspend/?redirect=${f}`,skipConfirmation:!0})}},{componentType:r.SmallButton,id:"buttonActivateCustomers",title:d.lmsg("buttonActivateCustomers"),description:d.lmsg("hintActivateCustomers"),addCls:"sb-activate",cls:"sb-btn",handler:()=>{(0,r.getComponent)("customers-list").execGroupOperation({url:`/customer/activate/?redirect=${f}`,skipConfirmation:!0})}}]},i?{componentType:r.bar.Separator}:null,i?{componentType:r.SmallButton,id:"buttonRemoveUser",title:d.lmsg("buttonRemoveCustomer"),description:d.lmsg("hintRemoveCustomer"),addCls:"sb-remove-selected",handler:e=>{const t=(0,r.getComponent)("customers-list"),n=t.getSelectedItems();t.execGroupOperation({url:`/customer/delete/?redirect=${f}`,subtype:r.messageBox.SUBTYPE_DELETE,mouseEvent:e,text:d.formatMessage("confirmOnDelete",{name:`<b>${(0,r.escapeHtml)(n[0]?.customerName)}</b>`,count:n.length}),toJsonPayload:!0,submitHandler:async(e,t)=>{const{task:n}=await r.api.post((0,r.prepareUrl)("/customer/delete-async/"),{ids:t.ids});n&&"Jsw.Task.ProgressBar.Item"===n.componentType&&(0,r.getComponent)("asyncProgressBarWrapper").progressDialog(n)}})}}:null]),[i,j,h,p,u,v,f,o]),S=(0,s.useMemo)((()=>[r.list.COLUMN_SELECTION,{header:d.lmsg("customerName"),sortable:!0,dataIndex:"customerName",renderer:({id:e,active:t,status:s,customerName:i,companyName:o,description:a})=>{let c="ok",m=n(1650),u=d.lmsg("statusOk");return t||(c="suspended",m=n(1651),u="1"===s?d.lmsg("statusInactive"):d.lmsg("statusSuspended")),(0,r.createElement)("div.b-indent",(0,r.createElement)("span.b-indent-icon",(0,r.createElement)("span.tooltipData",(0,r.escapeHtml)(u)),(0,r.createElement)("img",{src:m,alt:c,title:""}))," ",(0,r.createElement)("a",{href:`/admin/customer/overview/id/${e}`,onclick:v},(0,r.escapeHtml)(i)),o?.length?`, ${(0,r.escapeHtml)(o)}`:null,a?.length?(0,l.createDescription)(".minor",a):null)}},{header:d.lmsg("subscription"),sortable:!1,dataIndex:"subscriptions",renderer:e=>{const t=e.subscriptions.slice(0,b).map((({domainDisplayName:e,planName:t,domainId:n,subscriptionOveruse:s})=>`<div class="owned-subscription ${s?"status-overused":"status-ok"}">${(0,r.escapeHtml)(e)} (${(0,r.escapeHtml)(t)}) <span class="hint hint-info" id="hint-item-${n}"><span>${d.lmsg("hintInfo")}</span></span></div>`)).join("");return b<e.subscriptions.length?`${t}<div class="owned-subscription status-ok">...</div>`:t}},{header:d.lmsg("setupDate"),sortable:!0,dataIndex:"setupDateTimestamp",renderer:({setupDateString:e})=>(0,r.escapeHtml)(e)},x&&{header:d.lmsg("ownerName"),sortable:!0,dataIndex:"ownerName",renderer:({ownerType:e,ownerId:t,ownerName:n,ownerCompanyName:s})=>{let i=null;return"client"===e?i=`/admin/customer/overview/id/${t}`:"reseller"===e&&o&&(i=`/admin/reseller/overview/id/${t}`),[i?(0,r.createElement)("a",{href:i,onclick:v},(0,r.escapeHtml)(n)):(0,r.escapeHtml)(n),s?`, ${(0,r.escapeHtml)(s)}`:null]}},{header:"",sortable:!1,renderer:({id:e,allowLogin:t})=>t?(0,r.createElement)("a.s-btn.sb-login",{href:`/admin/customer/login/id/${e}/all/true`},(0,r.createElement)("span",d.lmsg("buttonLogin"))):""}]),[b,v,o,x]),C=(0,s.useCallback)((()=>{document.querySelectorAll("span.hint.hint-info").forEach((e=>{new r.DynamicPopupHint.Instance({title:m.lmsg("hintTitle"),waitMsg:m.lmsg("hintWaitMessage"),url:`/subscription/stats-hint/domainId/${e.id.replace("hint-item-","")}`,placement:"right",target:e.id})}))}),[]);return(0,s.jsx)(c.default,{data:e,dataUrl:g,searchFilters:t,id:"customers-list",searchOveral:"name",disabledSelectHint:d.lmsg("disabledSelectHint"),operations:T,columns:S,onRedraw:C})};u.propTypes={data:c.default.propTypes.data.isRequired,searchFilters:c.default.propTypes.searchFilters.isRequired,allowCreateCustomer:o().bool,resellersSupport:o().bool,isAdmin:o().bool,hasResellers:o().bool,hasResellerCustomers:o().bool,showOwnerName:o().bool,maxSubscriptionsDisplayed:o().number.isRequired,dataUrl:o().string.isRequired,createUrl:o().string.isRequired,redirectUrl:o().string.isRequired};const p=u},1676:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var s=n(596),i=n.n(s),o=n(89),r=n(1647),a=n(1538),l=n(603),c=n(1649),d=n(1677),m=n(285);const u=o.Locale.getTranslate("components.pages.reseller-customers"),p=({tabs:e,id:t,...n})=>{const[s]=(0,r.useCreateCustomerFormInDrawer)(`/admin/reseller/customers/id/${t}`,`/admin/reseller/new-customer/id/${t}`);return(0,m.jsxs)(m.Fragment,{children:[s,(0,m.jsx)(a.default,{items:e}),(0,m.jsx)("p",{children:(0,m.jsx)(u,{content:"hint"})}),(0,m.jsx)(c.default,{dataUrl:`/admin/reseller/customers-list-data/id/${t}`,createUrl:`/admin/reseller/new-customer/id/${t}`,redirectUrl:`/admin/reseller/customers/id/${t}`,...n})]})};p.propTypes={tabs:a.default.propTypes.items.isRequired,id:i().number.isRequired};const h=(0,l.withPageLayout)(p,(({sidebarProps:e})=>({secondary:(0,m.jsx)(d.default,{...e})})))},1677:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>b});var s=n(596),i=n.n(s),o=n(286),r=n(89),a=n(646),l=n(1172),c=n(1660),d=n(285);const m=r.Locale.getSection("admin.components.reseller-sidebar"),u=r.Locale.getTranslate("admin.components.reseller-sidebar"),p=r.Locale.getTranslate("admin.components.elements.status"),h=r.Locale.getTranslate("admin.components.lists.resellers"),x=({id:e,login:t,contactName:s,companyName:i,emailAddress:x,description:b,setupDate:g,isActive:j,ownCustomers:f,ownPlans:v,ownSubscriptions:T,isIisAppPoolsPolicyMixed:S=!1,subscription:C})=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(l.default,{id:"panel-reseller-overviewSection",title:(0,d.jsx)(u,{content:"overviewPanelTitle"}),children:[(0,d.jsxs)("div",{className:"side-panel__item",children:[(0,d.jsxs)(o.Text,{intent:"muted",children:[(0,d.jsx)(u,{content:"contactName"}),":"]})," ",(0,d.jsx)("b",{children:s})]}),i?(0,d.jsxs)("div",{className:"side-panel__item",children:[(0,d.jsxs)(o.Text,{intent:"muted",children:[(0,d.jsx)(u,{content:"companyName"}),":"]})," ",(0,d.jsx)("b",{children:i})]}):null,x?(0,d.jsxs)("div",{className:"side-panel__item",children:[(0,d.jsxs)(o.Text,{intent:"muted",children:[(0,d.jsx)(u,{content:"emailAddress"}),":"]})," ",(0,d.jsx)("b",{children:(0,d.jsx)("a",{href:`mailto:${x}`,children:x})})]}):null,(0,d.jsxs)("div",{className:"side-panel__item",children:[(0,d.jsxs)(o.Text,{intent:"muted",children:[(0,d.jsx)(u,{content:"setupDate"}),":"]})," ",(0,d.jsx)("b",{children:g})]}),(0,d.jsxs)("div",{className:"side-panel__item",children:[(0,d.jsxs)(o.Text,{intent:"muted",children:[(0,d.jsx)(u,{content:"status"}),":"]})," ",(0,d.jsx)("b",{children:(0,d.jsx)(o.Status,{intent:j?"success":"danger",children:j?(0,d.jsx)(p,{content:"onStateReseller"}):(0,d.jsx)(p,{content:"offStateReseller"})})})," ",(0,d.jsx)(o.AuxiliaryActions,{children:(0,d.jsx)(o.Tooltip,{title:j?(0,d.jsx)(u,{content:"buttonSuspendHint"}):(0,d.jsx)(u,{content:"buttonActivateHint"}),children:(0,d.jsx)("a",{id:"buttonToggle",onClick:()=>{(0,r.redirectPost)(`/admin/reseller/toggle/id/${e}`)},children:j?(0,d.jsx)(u,{content:"buttonSuspend"}):(0,d.jsx)(u,{content:"buttonActivate"})})})})]}),(0,d.jsx)(c.default,{type:"reseller",id:e,name:s,descriptions:{owner:b}}),(0,d.jsx)("div",{className:"side-panel__item",children:(0,d.jsx)(o.Tooltip,{title:(0,d.jsx)(u,{content:"buttonEditContactHint"}),children:(0,d.jsx)(o.Action,{id:"buttonEditContactInfo",icon:{src:n(1662)},href:`/admin/reseller/personal-info/id/${e}`,children:(0,d.jsx)(u,{content:"buttonEditContact"})})})})]}),(0,d.jsxs)(l.default,{id:"panel-reseller-resourcesSection",title:(0,d.jsx)(u,{content:"resourcesPanelTitle"}),children:[(0,d.jsxs)("div",{className:"side-panel__item",children:[(0,d.jsxs)(o.Text,{intent:"muted",children:[(0,d.jsx)(u,{content:"ownCustomers"}),":"]})," ",(0,d.jsx)("b",{children:(0,d.jsx)(a.default,{to:`/admin/customer/list/?force-show-search=true&searchFilter[ownership][searchText]=${encodeURIComponent(t)}`,children:f})})]}),(0,d.jsxs)("div",{className:"side-panel__item",children:[(0,d.jsxs)(o.Text,{intent:"muted",children:[(0,d.jsx)(u,{content:"ownPlans"}),":"]})," ",(0,d.jsx)("b",{children:(0,d.jsx)(a.default,{to:`/admin/customer-service-plan/list/?force-show-search=true&searchFilter[ownership][searchText]=${encodeURIComponent(t)}`,children:v})})]}),(0,d.jsxs)("div",{className:"side-panel__item",children:[(0,d.jsxs)(o.Text,{intent:"muted",children:[(0,d.jsx)(u,{content:"ownSubscriptions"}),":"]})," ",(0,d.jsx)("b",{children:(0,d.jsx)(a.default,{to:`/admin/subscription/list?force-show-search=true&searchFilter[subscriberName][searchText]=${encodeURIComponent(`login:${t}`)}`,children:T})})]}),(0,d.jsxs)("div",{className:"side-panel__item",children:[(0,d.jsxs)(o.Text,{intent:"muted",children:[(0,d.jsx)(u,{content:"plan"}),":"]})," ",(0,d.jsx)("b",{children:C?(0,d.jsxs)(d.Fragment,{children:[C.name,C.isLocked||!C.isSynchronized?(0,d.jsxs)(d.Fragment,{children:[" (",(0,d.jsx)(o.Tooltip,{title:C.isLocked?(0,d.jsx)(h,{content:"statusLocked"}):(0,d.jsx)(h,{content:"statusUnsynchronized"}),children:(0,d.jsx)(o.Status,{icon:{src:C.isLocked?n(1671):n(1672)},children:C.isLocked?(0,d.jsx)(p,{content:"lockedStateClient"}):(0,d.jsx)(p,{content:"unsynchronizedStateClient"})})}),")"]}):null]}):(0,d.jsx)(u,{content:"planCustom"})})," ",(0,d.jsxs)(o.AuxiliaryActions,{children:[(0,d.jsx)(o.Tooltip,{title:(0,d.jsx)(u,{content:"buttonChangeResellerSubscriptionHint"}),children:(0,d.jsx)(a.default,{id:"buttonChangeResellerSubscription",to:`/admin/reseller/change-reseller-subscription/id/${e}`,children:(0,d.jsx)(u,{content:"buttonChangeResellerSubscription"})})}),(0,d.jsx)(o.Tooltip,{title:(0,d.jsx)(u,{content:"buttonManuallyEditSubscriptionParametersHint"}),children:(0,d.jsx)(a.default,{id:"buttonEditSubscriptionParameters",to:`/admin/reseller/customize-subscription/id/${e}`,children:(0,d.jsx)(u,{content:"buttonManuallyEditSubscriptionParameters"})})}),!C||!C.isLocked&&C.isSynchronized?null:(0,d.jsx)(o.Tooltip,{title:C.isLocked?(0,d.jsx)(u,{content:"buttonUnlockAndSyncHint"}):(0,d.jsx)(u,{content:"buttonSyncHint"}),children:(0,d.jsx)("a",{id:"buttonUnlockAndSync",href:`/admin/reseller/synchronize/id/${e}`,"data-method":"post",children:C.isLocked?(0,d.jsx)(u,{content:"buttonUnlockAndSync"}):(0,d.jsx)(u,{content:"buttonSync"})})})]})]}),(0,d.jsx)("div",{className:"side-panel__item",children:(0,d.jsx)(o.Tooltip,{title:(0,d.jsx)(u,{content:"buttonMoreStatsHint"}),children:(0,d.jsx)(o.Action,{id:"buttonMoreStats",icon:{src:n(1515)},href:`/admin/reseller/stats/id/${e}`,children:(0,d.jsx)(u,{content:"buttonMoreStats"})})})})]}),(0,d.jsxs)(l.default,{id:"panel-reseller-loginSection",title:(0,d.jsx)(u,{content:"loginPanelTitle"}),children:[(0,d.jsxs)("div",{className:"side-panel__item",children:[(0,d.jsxs)(o.Text,{intent:"muted",children:[(0,d.jsx)(u,{content:"username"}),":"]})," ",(0,d.jsx)("b",{children:t})]}),j?(0,d.jsx)("p",{children:(0,d.jsx)(o.Tooltip,{title:(0,d.jsx)(u,{content:"buttonLoginHint"}),children:(0,d.jsx)(o.Action,{id:"buttonLogin",icon:{src:n(1678)},href:`/admin/reseller/login/id/${e}`,children:(0,d.jsx)(u,{content:"buttonLogin"})})})}):null,(0,d.jsx)("div",{className:"side-panel__item",children:(0,d.jsx)(o.Tooltip,{title:(0,d.jsx)(u,{content:"buttonChangePasswordHint"}),children:(0,d.jsx)(o.Action,{id:"buttonChangePassword",icon:{src:n(1664)},href:`/admin/reseller/login-info/id/${e}`,children:(0,d.jsx)(u,{content:"buttonChangePassword"})})})})]}),(0,d.jsxs)(l.default,{id:"panel-reseller-toolsSection",title:(0,d.jsx)(u,{content:"toolsPanelTitle"}),children:[(0,d.jsx)("div",{className:"side-panel__item",children:(0,d.jsx)(o.Tooltip,{title:(0,d.jsx)(u,{content:"buttonIPAddressesHint"}),children:(0,d.jsx)(o.Action,{id:"buttonManageIpPool",icon:{src:n(1679)},href:`/cp/client/${e}/ip-address`,children:(0,d.jsx)(u,{content:"buttonIPAddresses"})})})}),S?(0,d.jsx)("div",{className:"side-panel__item",children:(0,d.jsx)(o.Tooltip,{title:(0,d.jsx)(u,{content:"buttonIisAppPoolHint"}),children:(0,d.jsx)(o.Action,{id:"buttonIisAppPool",icon:{src:n(1666)},href:`/admin/iis-app-pool/settings/id/${e}`,children:(0,d.jsx)(u,{content:"buttonIisAppPool"})})})}):null,f?null:(0,d.jsx)("div",{className:"side-panel__item",children:(0,d.jsx)(o.Tooltip,{title:(0,d.jsx)(u,{content:"buttonConvertToCustomerHint"}),children:(0,d.jsx)(o.Action,{id:"buttonConvertToCustomer",icon:{src:n(1680)},onClick:async()=>{new(await Plesk.require("app/convert-resellers-to-customers"))({id:"convertResellersToCustomers",cls:"popup-panel",prepareUrl:"/admin/reseller/prepare-convert/",handlerUrl:"/admin/reseller/convert-to-customer/?redirect=/reseller/list/",ids:[e]})},children:(0,d.jsx)(u,{content:"buttonConvertToCustomer"})})})}),(0,d.jsx)("div",{className:"side-panel__item",children:(0,d.jsx)(o.Tooltip,{title:(0,d.jsx)(u,{content:"buttonRemoveHint"}),children:(0,d.jsx)(o.Action,{id:"buttonRemove",icon:{src:n(1667)},onClick:()=>{r.messageBox.show({type:r.messageBox.TYPE_YESNO,subtype:r.messageBox.SUBTYPE_DELETE,text:m.lmsg("buttonRemoveResellerConfirmationTitle",{name:`<b>${s}</b>`}),description:m.lmsg("buttonRemoveResellerConfirmationDescription"),async onYesClick(){const{task:t}=await r.api.post((0,r.prepareUrl)("/reseller/delete-async/"),{ids:[e]});t&&"Jsw.Task.ProgressBar.Item"===t.componentType&&(0,r.getComponent)("asyncProgressBarWrapper").progressDialog(t)}})},children:(0,d.jsx)(u,{content:"buttonRemove"})})})})]})]});x.propTypes={id:i().number.isRequired,login:i().string.isRequired,contactName:i().string.isRequired,companyName:i().string.isRequired,emailAddress:i().string.isRequired,description:i().string.isRequired,setupDate:i().string.isRequired,isActive:i().bool.isRequired,ownCustomers:i().number.isRequired,ownPlans:i().number.isRequired,ownSubscriptions:i().number.isRequired,isIisAppPoolsPolicyMixed:i().bool,subscription:i().shape({name:i().string.isRequired,isLocked:i().bool.isRequired,isSynchronized:i().bool.isRequired})};const b=x},1660:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>m});var s=n(596),i=n.n(s),o=n(286),r=n(89),a=n(1661),l=n(285);const c=r.Locale.getTranslate("components.forms.admin-info"),d=({type:e,id:t,name:n,descriptions:s})=>{const{edit:i,remove:r}=(0,a.createHandlers)({type:e,id:t,name:n});return Object.entries(s).map((([e,t])=>(0,l.jsxs)("div",{className:"side-panel__item",children:[(0,l.jsxs)(o.Text,{intent:"muted",children:[(0,l.jsx)(c,{content:`description-${e}`}),":"]})," ",(0,l.jsx)("b",{children:(0,l.jsx)("span",{id:`${e}-description`,children:t})})," ",(0,l.jsxs)(o.AuxiliaryActions,{children:[(0,l.jsx)(o.Link,{id:`${e}-description-edit`,onClick:()=>i(e,t),children:t?(0,l.jsx)(c,{content:"edit"}):(0,l.jsx)(c,{content:"add"})}),t?(0,l.jsx)(o.Link,{id:`${e}-description-remove`,onClick:()=>r(e),children:(0,l.jsx)(c,{content:"remove"})}):null]})]},e)))};d.propTypes={type:i().oneOf(["reseller","customer","subscription"]).isRequired,id:i().number.isRequired,name:i().string.isRequired,descriptions:i().shape({admin:i().string,reseller:i().string,owner:i().string}).isRequired};const m=d},1661:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EditPopupForm:()=>r,createHandlers:()=>a});var s=n(89);const i=s.Locale.getSection("components.forms.admin-info"),o=s.Locale.getSection("components.buttons");class r extends s.PopupForm{_initConfiguration(e){super._initConfiguration(e),this._hint=this._getConfigParam("hint",""),this._value=this._getConfigParam("value",""),this._handler=this._getConfigParam("handler",null),this._sendButtonId=this._getConfigParam("sendButtonId","btn-send"),this._cancelButtonId=this._getConfigParam("cancelButtonId","btn-cancel")}render(){super.render(),this.setBoxType("form-box"),this.setTitle(this.lmsg("popupTitle")),this.setTitleType(this._getConfigParam("titleCls","pp-edit-description")),document.getElementById(this._contentAreaId).innerHTML=`<p>${this._hint}</p><textarea id="${this._id}-description" class="js-auto-resize" rows="4" maxlength="255" cols="80">${(0,s.escapeHtml)(this._value)}</textarea>`,this.addOkButton(),this.addCancelButton()}addOkButton(){this.addRightButton(this.lmsg("buttonOk"),this._onOkClick,!0,!0,{id:this._sendButtonId})}addCancelButton(){this.addRightButton(this.lmsg("buttonCancel"),this._onCancelClick,!1,!1,{id:this._cancelButtonId})}_onOkClick(){this._handler(document.getElementById(`${this._id}-description`).value),this.hide()}_onCancelClick(){this.hide()}}const a=e=>{const t={reseller:"/admin/reseller/edit-description",customer:"/admin/customer/edit-description",subscription:"/admin/subscription/edit-description",site:"/smb/web/edit-description"}[e.type];if(!t)throw new Error(`Custom description not supported for '${e.type}' type`);return{edit:(n,a)=>{new r({id:"editDescription",cls:"popup-panel",hint:i.lmsg(`popupHint-${n}`),value:a,locale:{popupTitle:i.lmsg(`popupTitle-${e.type}`,{descriptionType:i.lmsg(`description-${n}`),name:(0,s.escapeHtml)(e.name)}),buttonOk:o.lmsg("save"),buttonCancel:o.lmsg("cancel")},handler(i){(0,s.redirectPost)(t,{id:e.id,type:n,description:i})}})},remove:n=>{s.messageBox.show({type:Jsw.messageBox.TYPE_YESNO,subtype:"delete",buttonTitles:{yes:o.lmsg("yes"),no:o.lmsg("no"),wait:o.lmsg("wait")},text:i.lmsg("confirmOnRemove"),onYesClick(){(0,s.redirectPost)(t,{id:e.id,type:n,description:""})}})}}}},1645:(e,t,n)=>{"use strict";n.r(t),n.d(t,{createDescription:()=>o,createSiteDescription:()=>r,truncate:()=>i});var s=n(89);const i=(e,t=50)=>e.length<t?e:`${e.slice(0,t-3)}...`,o=(e,t,n)=>(0,s.createElement)(e,[(n?`${n}: `:"")+(0,s.escapeHtml)(i(t,50)),(0,s.createElement)("span.tooltipData",(0,s.escapeHtml)(t))]),r=({adminDescription:e,resellerDescription:t,ownerDescription:n,hideResellerTitleDescription:s,hideOwnerTitleDescription:i},r,a="hint")=>[e?o(`.${a}`,e):"",t?o(`.${a}`,t,!s&&r.lmsg("resellerDescription")):"",n?o(`.${a}`,n,!i&&r.lmsg("ownerDescription")):""]},1637:(e,t,n)=>{"use strict";n.r(t),n.d(t,{generateUserName:()=>o,randomString:()=>s});const s=()=>Math.random().toString(36).slice(2),i=()=>`_${s()}`,o=({domainName:e,maxUserNameSize:t,isTechDomain:n,isWindows:s,postfix:o=i()})=>{let r=e;const a=!s,l=!/^[a-zA-Z0-9_.\-]+$/.test(e),c=/^[0-9]+/.test(e);if("string"!=typeof e||"string"!=typeof o)return"";if(l)return"";if(a&&c)return"";if("number"!=typeof t&&void 0!==t)return"";if(t){if(o.length>t)return"";t-=o.length}return n&&(r=r.split(".")[0]),r=r.toLowerCase().substr(0,t)+o,s&&(r=r.replace(/\.+$/,"")),r}},1664:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/change-password.png?54304f321bc897402075b73230593f04"},1680:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/convert-to-customer.png?597b1b6aa17102a0d694f2acd4275f1e"},1667:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/delete.png?27d654be29d57ad05641c2ff392035fa"},1662:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/edit-contact-info.png?052e4fc494a39464dad26f4f40e38eaf"},1666:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/iis-app-pool.png?1bcf2ef7b099732f96f82bfb815c5146"},1679:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/ip-pool.png?660f416531a7d16c58da56704aa08b79"},1678:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/login.png?b68531bba0e522a3a35a90de80b8892a"},1515:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/stats.png?6a39051adc0633466df48a83a804028c"},1671:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/subscription-status-locked.png?791d616dde33b19ebd4b7fbf3b305ffe"},1650:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/subscription-status-ok.png?6d52f91c87cbdc73b4ef0b5ded92c441"},1651:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/subscription-status-suspended.png?7968ea094f0aa3fdced5d59b0c7f3196"},1672:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/subscription-status-unsynchronized.png?c075e72041171bb35d0a9b6542518ccf"}}]); //# sourceMappingURL=customers.js.map?08686a61004fc0071b71