"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[47649],{47649:function(e,t,o){o.d(t,{default:function(){return i}}),o(24776),o(76281),o(44962),o(78557),o(64628),o(90076),o(83994),o(82367);var n=o(79096),l=o(79754),r=o(46782),s=o(5898);function a(e,t,n){Promise.resolve().then(o.bind(o,10838)).then((function(o){var l=n?"on":"off";o.centerFocus[l](e,t)}))}o(15453),o(98959),o(63001);var i={show:function(e){return new Promise((function(t,o){var i={removeOnClose:!0,scrollY:!1};r.A.tv?i.size="fullscreen":i.size="small";var c=l.default.createDialog(i);c.classList.add("formDialog");var u="",d=!1;u+=s.Ay.translateHtml('<div class="formDialogHeader"> <button is="paper-icon-button-light" class="btnCancel autoSize" tabindex="-1" title="${ButtonBack}"><span class="material-icons arrow_back" aria-hidden="true"></span></button> <h3 class="formDialogHeaderTitle"> ${Edit} </h3> </div> <div class="formDialogContent smoothScrollY" style="padding-top:2em"> <form class="popupEditPersonForm dialogContentInner dialog-content-centered"> <div class="inputContainer"> <input type="text" is="emby-input" class="txtPersonName" required="required" label="${LabelName}"/> </div> <div class="selectContainer"> <select is="emby-select" id="selectPersonType" class="selectPersonType" label="${LabelType}"></select> </div> <div class="inputContainer fldRole hide"> <input is="emby-input" type="text" class="txtPersonRole" label="${LabelPersonRole}"/> <div class="fieldDescription">${LabelPersonRoleHelp}</div> </div> <div class="formDialogFooter"> <button is="emby-button" type="submit" class="raised button-submit block formDialogFooterItem"> <span>${Save}</span> </button> </div> </form> </div> ',"core"),c.innerHTML=u,c.querySelector(".txtPersonName",c).value=e.Name||"",c.querySelector(".selectPersonType",c).value=e.Type||"",c.querySelector(".txtPersonRole",c).value=e.Role||"",r.A.tv&&a(c.querySelector(".formDialogContent"),!1,!0),l.default.open(c),c.addEventListener("close",(function(){r.A.tv&&a(c.querySelector(".formDialogContent"),!1,!1),d?t(e):o()}));for(var v="",p=0,f=Object.values(n.S);p<f.length;p++){var m=f[p];if(m!==n.S.Unknown){var y=e.Type===m?"selected":"";v+='<option value="'.concat(m,'" ').concat(y,">${").concat(m,"}</option>")}}c.querySelector(".selectPersonType").innerHTML=s.Ay.translateHtml(v),c.querySelector(".selectPersonType").addEventListener("change",(function(){c.querySelector(".fldRole").classList.toggle("hide",![n.S.Actor,n.S.GuestStar].includes(this.value))})),c.querySelector(".btnCancel").addEventListener("click",(function(){l.default.close(c)})),c.querySelector("form").addEventListener("submit",(function(t){return d=!0,e.Name=c.querySelector(".txtPersonName",c).value,e.Type=c.querySelector(".selectPersonType",c).value,e.Role=c.querySelector(".txtPersonRole",c).value||null,l.default.close(c),t.preventDefault(),!1})),c.querySelector(".selectPersonType").dispatchEvent(new CustomEvent("change",{bubbles:!0}))}))}}}}]);