':h+='
',e.title&&(h+='
'+o()(e.title)+"
"),e.text&&(h+='
'+o()(e.text)+"
");var L="actionSheetScroller";r.A.tv&&(L+=" actionSheetScroller-tv focuscontainer-x focuscontainer-y"),h+='
';var w="listItem listItem-button actionSheetMenuItem";(e.border||e.shaded)&&(w+=" listItem-border"),e.menuItemClass&&(w+=" "+e.menuItemClass),r.A.tv&&(w+=" listItem-focusscale"),r.A.mobile&&(w+=" actionsheet-xlargeFont");for(var C=0;C
':(h+="
")}if(e.showCancel&&(h+='
',h+='"),h+="
"),h+="
",v.innerHTML=h,r.A.tv){var T=v.querySelector(".actionSheetScroller");T&&u(T,!1,!0)}var I=v.querySelector(".btnCloseActionSheet");I&&I.addEventListener("click",(function(){a.default.close(v)}));var k,E=null;return e.timeout&&(k=setTimeout((function(){a.default.close(v)}),e.timeout)),new Promise((function(t,n){var i=!1;v.addEventListener("click",(function(n){var o=l.Ay.parentWithClass(n.target,"actionSheetMenuItem");o&&(E=o.getAttribute("data-id"),e.resolveOnClick&&(Array.isArray(e.resolveOnClick)?-1!==e.resolveOnClick.indexOf(E)&&(t(E),i=!0):(t(E),i=!0)),a.default.close(v))})),v.addEventListener("close",(function(){if(r.A.tv){var o=v.querySelector(".actionSheetScroller");o&&u(o,!1,!1)}k&&(clearTimeout(k),k=void 0),i||(null!=E?(e.callback&&e.callback(E),t(E)):n(new Error("ActionSheet closed without resolving")))})),a.default.open(v).catch((function(e){console.warn("DialogHelper.open error",e)}));var o=e.positionTo&&"fullscreen"!==d.size?function(e,t,n){var i=l.Ay.getWindowSize(),o=i.innerHeight,a=i.innerWidth,r=function(e){var t,n,i=[];if(!document)return i;try{for(var o=c(e),a=o.next();!a.done;a=o.next()){var r=a.value.getBoundingClientRect();i.push({top:r.top,left:r.left,width:r.width,height:r.height})}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return i}([e])[0];"top"!==t.positionY&&(r.top+=(r.height||0)/2),r.left+=(r.width||0)/2;var s=n.offsetHeight||300,u=n.offsetWidth||160;r.top-=s/2,r.left-=u/2;var d=r.left+u-a,v=r.top+s-o;return d>0&&(r.left-=d+20),v>0&&(r.top-=v+20),r.top+=t.offsetTop||0,r.left+=t.offsetLeft||0,r.top=Math.max(r.top,10),r.left=Math.max(r.left,10),r}(e.positionTo,e,v):null;o&&(v.style.position="fixed",v.style.margin="0",v.style.left=o.left+"px",v.style.top=o.top+"px")}))}t.default={show:d}},63001:function(e,t,n){var i=n(46782),o=n(34789),a=n(62882),r=(n(69177),Object.create(HTMLSelectElement.prototype));function s(){return!(o.A.edgeUwp||o.A.xboxOne||o.A.tizen||o.A.orsay||o.A.web0s||!o.A.tv&&i.A.tv)}function l(e){var t=c(e),n=t?t.textContent||t.innerText:null;a.default.show({items:e.options,positionTo:e,title:n}).then((function(t){!function(e,t){e.value=t}(e,t),function(e){var t=new Event("change",{bubbles:!1,cancelable:!0});e.dispatchEvent(t)}(e)}))}function c(e){for(var t=e.previousSibling;t&&"LABEL"!==t.tagName;)t=t.previousSibling;return t}function u(){var e=c(this);e&&e.classList.add("selectLabelFocused")}function d(){var e=c(this);e&&e.classList.remove("selectLabelFocused")}function v(e){e.button||s()||(e.preventDefault(),l(this))}function h(e){13!==e.keyCode&&195!==e.keyCode||s()||(e.preventDefault(),l(this))}var f=0;r.createdCallback=function(){this.id||(this.id="embyselect"+f,f++),this.classList.add("emby-select-withcolor"),i.A.tv&&this.classList.add("emby-select-focusscale"),this.addEventListener("mousedown",v),this.addEventListener("keydown",h),this.addEventListener("focus",u),this.addEventListener("blur",d)},r.attachedCallback=function(){var e;if(!this.classList.contains("emby-select")){this.classList.add("emby-select");var t,n=this.ownerDocument.createElement("label");n.innerText=this.getAttribute("label")||"",n.classList.add("selectLabel"),n.htmlFor=this.id,null===(e=this.parentNode)||void 0===e||e.insertBefore(n,this),this.classList.contains("emby-select-withcolor")&&(null===(t=this.parentNode)||void 0===t||t.insertAdjacentHTML("beforeend",'
'))}},r.setLabel=function(e){var t;(null===(t=this.parentNode)||void 0===t?void 0:t.querySelector("label")).innerText=e},document.registerElement("emby-select",{prototype:r,extends:"select"})}}]);