"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[18373],{19284:function(e,t,n){n.r(t),n.d(t,{default:function(){return O}});var l=n(62540),r=n(22696),i=n.n(r),o=n(63696),c=n(87404),a=n(9055),s=n(5898),d=n(50723),u=n(91281),h=n(84851),v=n(42301),y=n(30658),b=n(58702),f=n(8566),m=n(67692),p=n(65242),k=n(648),x=n(80401),A=n(69410),P=n(61432),S=function(){var e=(0,A.gf)().api;return(0,x.I)({queryKey:["AuthProviders"],queryFn:function(t){var n=t.signal;return function(e,t){return n=void 0,l=void 0,i=function(){return function(e,t){var n,l,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=c(0),o.throw=c(1),o.return=c(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(i=0)),i;)try{if(n=1,l&&(r=2&c[0]?l.return:c[0]?l.throw||((r=l.return)&&r.call(l),0):l.next)&&!(r=r.call(l,c[1])).done)return r;switch(l=0,r&&(c=[2&c[0],r.value]),c[0]){case 0:case 1:r=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,l=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!((r=(r=i.trys).length>0&&r[r.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]0&&r[r.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]0&&r[r.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]0)&&!(l=i.next()).done;)o.push(l.value)}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return o},T=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],l=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&l>=e.length&&(e=void 0),{value:e&&e[l++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},O=function(){var e,t=(0,c.Zp)(),r=R((0,a.ok)(),1)[0].get("userId"),x=R((0,o.useState)([]),2),P=x[0],q=x[1],O=(0,o.useMemo)((function(){return e=void 0,t=void 0,r=function(){return function(e,t){var n,l,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=c(0),o.throw=c(1),o.return=c(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(i=0)),i;)try{if(n=1,l&&(r=2&c[0]?l.return:c[0]?l.throw||((r=l.return)&&r.call(l),0):l.next)&&!(r=r.call(l,c[1])).done)return r;switch(l=0,r&&(c=[2&c[0],r.value]),c[0]){case 0:case 1:r=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,l=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!((r=(r=i.trys).length>0&&r[r.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]0?((null===(P=e.Policy)||void 0===P?void 0:P.RemoteClientBitrateLimit)/1e6).toLocaleString(void 0,{maximumFractionDigits:6}):"",w.querySelector("#txtLoginAttemptsBeforeLockout").value=String(null===(S=e.Policy)||void 0===S?void 0:S.LoginAttemptsBeforeLockout)||"-1",w.querySelector("#txtMaxActiveSessions").value=String(null===(g=e.Policy)||void 0===g?void 0:g.MaxActiveSessions)||"0",w.querySelector("#selectSyncPlayAccess").value=String(null===(j=e.Policy)||void 0===j?void 0:j.SyncPlayAccess),f.Ay.hide()}else console.error("[useredit] Unexpected null page reference")}),[O]),ye=(0,o.useCallback)((function(){J?(f.Ay.show(),ve(J)):console.error("[profile] No user available")}),[J,ve]);(0,o.useEffect)((function(){K&&ye()}),[ye,K]),(0,o.useEffect)((function(){var e=se.current;if(e){var n=function(n){return f.Ay.show(),J&&function(n){if(!n.Id||!n.Policy)throw new Error("Unexpected null user id or policy");var l;n.Name=e.querySelector("#txtUserName").value.trim(),n.Policy.IsAdministrator=e.querySelector(".chkIsAdmin").checked,n.Policy.IsHidden=e.querySelector(".chkIsHidden").checked,n.Policy.IsDisabled=e.querySelector(".chkDisabled").checked,n.Policy.EnableRemoteControlOfOtherUsers=e.querySelector(".chkEnableRemoteControlOtherUsers").checked,n.Policy.EnableLiveTvManagement=e.querySelector(".chkManageLiveTv").checked,n.Policy.EnableLiveTvAccess=e.querySelector(".chkEnableLiveTvAccess").checked,n.Policy.EnableSharedDeviceControl=e.querySelector(".chkRemoteControlSharedDevices").checked,n.Policy.EnableMediaPlayback=e.querySelector(".chkEnableMediaPlayback").checked,n.Policy.EnableAudioPlaybackTranscoding=e.querySelector(".chkEnableAudioPlaybackTranscoding").checked,n.Policy.EnableVideoPlaybackTranscoding=e.querySelector(".chkEnableVideoPlaybackTranscoding").checked,n.Policy.EnablePlaybackRemuxing=e.querySelector(".chkEnableVideoPlaybackRemuxing").checked,n.Policy.EnableCollectionManagement=e.querySelector(".chkEnableCollectionManagement").checked,n.Policy.EnableSubtitleManagement=e.querySelector(".chkEnableSubtitleManagement").checked,n.Policy.ForceRemoteSourceTranscoding=e.querySelector(".chkForceRemoteSourceTranscoding").checked,n.Policy.EnableContentDownloading=e.querySelector(".chkEnableDownloading").checked,n.Policy.EnableRemoteAccess=e.querySelector(".chkRemoteAccess").checked,n.Policy.RemoteClientBitrateLimit=Math.floor(1e6*parseFloat(e.querySelector("#txtRemoteClientBitrateLimit").value||"0")),n.Policy.LoginAttemptsBeforeLockout=parseInt(e.querySelector("#txtLoginAttemptsBeforeLockout").value||"0",10),n.Policy.MaxActiveSessions=parseInt(e.querySelector("#txtMaxActiveSessions").value||"0",10),n.Policy.AuthenticationProviderId=e.querySelector("#selectLoginProvider").value,n.Policy.PasswordResetProviderId=e.querySelector("#selectPasswordResetProvider").value,n.Policy.EnableContentDeletion=e.querySelector(".chkEnableDeleteAllFolders").checked,n.Policy.EnableContentDeletionFromFolders=n.Policy.EnableContentDeletion?[]:(l=e.querySelectorAll(".chkFolder"),Array.prototype.filter.call(l,(function(e){return e.checked})).map((function(e){return e.getAttribute("data-id")}))),n.Policy.SyncPlayAccess=e.querySelector("#selectSyncPlayAccess").value,ce.mutate({userId:n.Id,userDto:n},{onSuccess:function(){n.Id&&ae.mutate({userId:n.Id,userPolicy:n.Policy||{PasswordResetProviderId:"",AuthenticationProviderId:""}},{onSuccess:function(){f.Ay.hide(),t("/dashboard/users",{state:{openSavedToast:!0}})}})}})}(J),n.preventDefault(),n.stopPropagation(),!1},l=function(){window.history.back()};return e.querySelector(".chkEnableDeleteAllFolders").addEventListener("change",(function(){e.querySelector(".deleteAccess").classList.toggle("hide",this.checked)})),e.querySelector(".editUserProfileForm").addEventListener("submit",n),e.querySelector("#btnCancel").addEventListener("click",l),function(){e.querySelector(".editUserProfileForm").removeEventListener("submit",n),e.querySelector("#btnCancel").removeEventListener("click",l)}}console.error("[useredit] Unexpected null page reference")}),[ye,ce,J,ae,t]);var be,fe=null==z?void 0:z.map((function(e){var t=e.Id===U||z.length<2?" selected":"";return'")})),me=null==W?void 0:W.map((function(e){var t=e.Id===B||W.length<2?" selected":"";return'")}));return(0,l.jsx)(p.A,{id:"editUserPage",className:"mainAnimatedPage type-interior",children:(0,l.jsxs)("div",{ref:se,className:"content-primary",children:[(0,l.jsx)("div",{className:"verticalSection",children:(0,l.jsx)(y.A,{title:(null==J?void 0:J.Name)||""})}),(0,l.jsx)(b.A,{activeTab:"useredit"}),(0,l.jsx)("div",{className:"lnkEditUserPreferencesContainer",style:{paddingBottom:"1em"},children:(0,l.jsx)(h.A,{className:"lnkEditUserPreferences button-link",href:(null==J?void 0:J.Id)?"mypreferencesmenu?userId=".concat(J.Id):void 0,children:s.Ay.translate("ButtonEditOtherUserPreferences")})}),(0,l.jsxs)("form",{className:"editUserProfileForm",children:[(0,l.jsx)("div",{className:"disabledUserBanner hide",children:(0,l.jsxs)("div",{className:"btn btnDarkAccent btnStatic",children:[(0,l.jsx)("div",{children:s.Ay.translate("HeaderThisUserIsCurrentlyDisabled")}),(0,l.jsx)("div",{style:{marginTop:5},children:s.Ay.translate("MessageReenableUser")})]})}),(0,l.jsx)("div",{id:"fldUserName",className:"inputContainer",children:(0,l.jsx)(v.A,{type:"text",id:"txtUserName",label:s.Ay.translate("LabelName"),required:!0})}),(0,l.jsxs)("div",{className:"selectContainer fldSelectLoginProvider hide",children:[(0,l.jsx)(m.A,{id:"selectLoginProvider",label:"LabelAuthProvider",children:fe}),(0,l.jsx)("div",{className:"fieldDescription",children:s.Ay.translate("AuthProviderHelp")})]}),(0,l.jsxs)("div",{className:"selectContainer fldSelectPasswordResetProvider hide",children:[(0,l.jsx)(m.A,{id:"selectPasswordResetProvider",label:"LabelPasswordResetProvider",children:me}),(0,l.jsx)("div",{className:"fieldDescription",children:s.Ay.translate("PasswordResetProviderHelp")})]}),(0,l.jsxs)("div",{className:"checkboxContainer checkboxContainer-withDescription fldRemoteAccess hide",children:[(0,l.jsx)(u.A,{className:"chkRemoteAccess",title:"AllowRemoteAccess"}),(0,l.jsx)("div",{className:"fieldDescription checkboxFieldDescription",children:s.Ay.translate("AllowRemoteAccessHelp")})]}),(0,l.jsx)(u.A,{labelClassName:"checkboxContainer",className:"chkIsAdmin",title:"OptionAllowUserToManageServer"}),(0,l.jsx)(u.A,{labelClassName:"checkboxContainer",className:"chkEnableCollectionManagement",title:"AllowCollectionManagement"}),(0,l.jsx)(u.A,{labelClassName:"checkboxContainer",className:"chkEnableSubtitleManagement",title:"AllowSubtitleManagement"}),(0,l.jsxs)("div",{id:"featureAccessFields",className:"verticalSection",children:[(0,l.jsx)("h2",{className:"paperListLabel",children:s.Ay.translate("HeaderFeatureAccess")}),(0,l.jsxs)("div",{className:"checkboxList paperList",style:{padding:".5em 1em"},children:[(0,l.jsx)(u.A,{className:"chkEnableLiveTvAccess",title:"OptionAllowBrowsingLiveTv"}),(0,l.jsx)(u.A,{className:"chkManageLiveTv",title:"OptionAllowManageLiveTv"})]})]}),(0,l.jsxs)("div",{className:"verticalSection",children:[(0,l.jsx)("h2",{className:"paperListLabel",children:s.Ay.translate("HeaderPlayback")}),(0,l.jsxs)("div",{className:"checkboxList paperList",style:{padding:".5em 1em"},children:[(0,l.jsx)(u.A,{className:"chkEnableMediaPlayback",title:"OptionAllowMediaPlayback"}),(0,l.jsx)(u.A,{className:"chkEnableAudioPlaybackTranscoding",title:"OptionAllowAudioPlaybackTranscoding"}),(0,l.jsx)(u.A,{className:"chkEnableVideoPlaybackTranscoding",title:"OptionAllowVideoPlaybackTranscoding"}),(0,l.jsx)(u.A,{className:"chkEnableVideoPlaybackRemuxing",title:"OptionAllowVideoPlaybackRemuxing"}),(0,l.jsx)(u.A,{className:"chkForceRemoteSourceTranscoding",title:"OptionForceRemoteSourceTranscoding"})]}),(0,l.jsx)("div",{className:"fieldDescription",children:s.Ay.translate("OptionAllowMediaPlaybackTranscodingHelp")})]}),(0,l.jsx)("br",{}),(0,l.jsx)("div",{className:"verticalSection",children:(0,l.jsxs)("div",{className:"inputContainer",children:[(0,l.jsx)(v.A,{type:"number",id:"txtRemoteClientBitrateLimit",label:s.Ay.translate("LabelRemoteClientBitrateLimit"),inputMode:"decimal",pattern:"[0-9]*(.[0-9]+)?",min:"0",step:".25"}),(0,l.jsx)("div",{className:"fieldDescription",children:s.Ay.translate("LabelRemoteClientBitrateLimitHelp")}),(0,l.jsx)("div",{className:"fieldDescription",children:s.Ay.translate("LabelUserRemoteClientBitrateLimitHelp")})]})}),(0,l.jsx)("div",{className:"verticalSection",children:(0,l.jsxs)("div",{className:"selectContainer fldSelectSyncPlayAccess",children:[(0,l.jsx)(m.A,{id:"selectSyncPlayAccess",label:"LabelSyncPlayAccess",children:(be="",be+=""),be+=""),be+=""))}),(0,l.jsx)("div",{className:"fieldDescription",children:s.Ay.translate("SyncPlayAccessHelp")})]})}),(0,l.jsxs)("div",{className:"verticalSection",children:[(0,l.jsx)("h2",{className:"checkboxListLabel",style:{marginBottom:"1em"},children:s.Ay.translate("HeaderAllowMediaDeletionFrom")}),(0,l.jsxs)("div",{className:"checkboxList paperList checkboxList-paperList",children:[(0,l.jsx)(u.A,{labelClassName:"checkboxContainer",className:"chkEnableDeleteAllFolders",title:"AllLibraries"}),(0,l.jsx)("div",{className:"deleteAccess",children:P.map((function(e){return(0,l.jsx)(u.A,{className:"chkFolder",itemId:e.Id,itemName:e.Name,itemCheckedAttribute:e.checkedAttribute},e.Id)}))})]})]}),(0,l.jsxs)("div",{className:"verticalSection",children:[(0,l.jsx)("h2",{className:"checkboxListLabel",children:s.Ay.translate("HeaderRemoteControl")}),(0,l.jsxs)("div",{className:"checkboxList paperList",style:{padding:".5em 1em"},children:[(0,l.jsx)(u.A,{className:"chkEnableRemoteControlOtherUsers",title:"OptionAllowRemoteControlOthers"}),(0,l.jsx)(u.A,{className:"chkRemoteControlSharedDevices",title:"OptionAllowRemoteSharedDevices"})]}),(0,l.jsx)("div",{className:"fieldDescription",children:s.Ay.translate("OptionAllowRemoteSharedDevicesHelp")})]}),(0,l.jsx)("h2",{className:"checkboxListLabel",children:s.Ay.translate("Other")}),(0,l.jsxs)("div",{className:"checkboxContainer checkboxContainer-withDescription",children:[(0,l.jsx)(u.A,{className:"chkEnableDownloading",title:"OptionAllowContentDownload"}),(0,l.jsx)("div",{className:"fieldDescription checkboxFieldDescription",children:s.Ay.translate("OptionAllowContentDownloadHelp")})]}),(0,l.jsxs)("div",{className:"checkboxContainer checkboxContainer-withDescription",id:"fldIsEnabled",children:[(0,l.jsx)(u.A,{className:"chkDisabled",title:"OptionDisableUser"}),(0,l.jsx)("div",{className:"fieldDescription checkboxFieldDescription",children:s.Ay.translate("OptionDisableUserHelp")})]}),(0,l.jsxs)("div",{className:"checkboxContainer checkboxContainer-withDescription",id:"fldIsHidden",children:[(0,l.jsx)(u.A,{className:"chkIsHidden",title:"OptionHideUser"}),(0,l.jsx)("div",{className:"fieldDescription checkboxFieldDescription",children:s.Ay.translate("OptionHideUserFromLoginHelp")})]}),(0,l.jsx)("br",{}),(0,l.jsx)("div",{className:"verticalSection",children:(0,l.jsxs)("div",{className:"inputContainer",id:"fldLoginAttemptsBeforeLockout",children:[(0,l.jsx)(v.A,{type:"number",id:"txtLoginAttemptsBeforeLockout",label:s.Ay.translate("LabelUserLoginAttemptsBeforeLockout"),min:-1,step:1}),(0,l.jsx)("div",{className:"fieldDescription",children:s.Ay.translate("OptionLoginAttemptsBeforeLockout")}),(0,l.jsx)("div",{className:"fieldDescription",children:s.Ay.translate("OptionLoginAttemptsBeforeLockoutHelp")})]})}),(0,l.jsx)("br",{}),(0,l.jsx)("div",{className:"verticalSection",children:(0,l.jsxs)("div",{className:"inputContainer",id:"fldMaxActiveSessions",children:[(0,l.jsx)(v.A,{type:"number",id:"txtMaxActiveSessions",label:s.Ay.translate("LabelUserMaxActiveSessions"),min:0,step:1}),(0,l.jsx)("div",{className:"fieldDescription",children:s.Ay.translate("OptionMaxActiveSessions")}),(0,l.jsx)("div",{className:"fieldDescription",children:s.Ay.translate("OptionMaxActiveSessionsHelp")})]})}),(0,l.jsx)("br",{}),(0,l.jsxs)("div",{children:[(0,l.jsx)(d.A,{type:"submit",className:"raised button-submit block",title:s.Ay.translate("Save")}),(0,l.jsx)(d.A,{type:"button",id:"btnCancel",className:"raised button-cancel block",title:s.Ay.translate("ButtonCancel")})]})]})]})})}},58702:function(e,t,n){var l=n(62540),r=n(63696),i=n(5898),o=n(89100),c=n(84851);function a(e){return r.useCallback((function(){(0,o.navigate)(e,!0).catch((function(e){console.warn("Error navigating to dashboard url",e)}))}),[e])}t.A=function(e){var t=e.activeTab,n=a("/dashboard/users/profile"),r=a("/dashboard/users/access"),o=a("/dashboard/users/parentalcontrol"),s=a("/dashboard/users/password");return(0,l.jsxs)("div",{"data-role":"controlgroup","data-type":"horizontal",className:"localnav",children:[(0,l.jsx)(c.A,{href:"#","data-role":"button",className:"useredit"===t?"ui-btn-active":"",onClick:n,children:i.Ay.translate("Profile")}),(0,l.jsx)(c.A,{href:"#","data-role":"button",className:"userlibraryaccess"===t?"ui-btn-active":"",onClick:r,children:i.Ay.translate("TabAccess")}),(0,l.jsx)(c.A,{href:"#","data-role":"button",className:"userparentalcontrol"===t?"ui-btn-active":"",onClick:o,children:i.Ay.translate("TabParentalControl")}),(0,l.jsx)(c.A,{href:"#","data-role":"button",className:"userpassword"===t?"ui-btn-active":"",onClick:s,children:i.Ay.translate("HeaderPassword")})]})}},67692:function(e,t,n){var l=n(62540),r=(n(63696),n(5898)),i=function(e){var t=e.name,n=e.id,l=e.required,r=e.label,i=e.option;return{__html:'\n ').concat(i,"\n ")}};t.A=function(e){var t=e.name,n=e.id,o=e.required,c=e.label,a=e.children;return(0,l.jsx)("div",{dangerouslySetInnerHTML:i({name:t?"name='".concat(t,"'"):"",id:n,required:o?"required='".concat(o,"'"):"",label:r.Ay.translate(c),option:a})})}}}]);