File: //volume1/@appstore/SynologyPhotos/ui/videojs/videojs-qualityselector.min.js
(()=>{"use strict";var t={n:e=>{var s=e&&e.__esModule?()=>e.default:()=>e;return t.d(s,{a:s}),s},d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};(()=>{const e=videojs;var s=t.n(e);function i(t,e,s){a(t,e),e.set(t,s)}function a(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function n(t,e){return t.get(o(t,e))}function r(t,e,s){return t.set(o(t,e),s),s}function o(t,e,s){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:s;throw new TypeError("Private element is not present on this object")}const c=s().getPlugin("plugin");var h=new WeakMap,l=new WeakMap,d=new WeakMap,u=new WeakMap,m=new WeakSet,p=new WeakMap,f=new WeakMap,v=new WeakMap;class g extends c{constructor(t,e){var s,c;super(t,e),a(s=this,c=m),c.add(s),i(this,h,void 0),i(this,l,void 0),i(this,d,void 0),i(this,u,void 0),i(this,p,(()=>{Array.from(n(d,this).firstChild.childNodes).forEach((t=>{t.dataset.code===this.state.currentFormat?t.setAttribute("class","current"):t.removeAttribute("class")}))})),i(this,f,(()=>{r(d,this,document.createElement("div")),n(d,this).className="vjs-quality-dropdown",document.getElementsByClassName("vjs-quality-container").length>0&&document.getElementsByClassName("vjs-quality-container")[0].remove();const t=document.createElement("button");t.classList.add("vjs-brand-quality-link","use-icon"),t.onclick=t=>o(m,this,y).call(this,t),t.innerText="",r(u,this,document.createElement("div")),n(u,this).classList.add("vjs-quality-container","vjs-control","vjs-button"),n(u,this).appendChild(n(d,this)),n(u,this).appendChild(t),n(h,this).controlBar.pictureInPictureToggle?n(h,this).controlBar.el().insertBefore(n(u,this),n(h,this).controlBar.pictureInPictureToggle.el()):n(h,this).controlBar.fullscreenToggle?n(h,this).controlBar.el().insertBefore(n(u,this),n(h,this).controlBar.fullscreenToggle.el()):n(h,this).controlBar.el().appendChild(n(u,this)),n(h,this).addClass("vjs-qualityselector")})),i(this,v,(()=>{if(1===this.state.formats.length)return void(n(u,this).hidden=!0);n(u,this).hidden=!1;const t=document.createElement("ul");for(this.state.formats.forEach((e=>{const s=document.createElement("li");s.dataset.code=e.code;const i=document.createElement("a");i.innerText=e.name,i.setAttribute("href","#"),i.addEventListener("click",(t=>{t.preventDefault(),o(m,this,w).call(this,e)})),s.appendChild(i),t.appendChild(s)}));n(d,this).firstChild;)n(d,this).removeChild(n(d,this).lastElementChild);n(d,this).appendChild(t),n(p,this).call(this)})),this.setState({sources:[],formats:[],currentFormat:"",onFormatSelected:()=>{}}),r(h,this,t),r(l,this,!1),r(d,this,void 0),r(u,this,void 0),n(h,this).on("ready",(()=>{n(l,this)||(r(l,this,!0),n(f,this).call(this)),n(v,this).call(this)})),this.on("statechanged",(t=>{let{changes:e}=t;n(l,this)&&Object.hasOwn(e,"formats")&&n(v,this).call(this)})),this.on("statechanged",(t=>{let{changes:e}=t;n(l,this)&&Object.hasOwn(e,"currentFormat")&&n(p,this).call(this)}))}setMenuOption(t){let{sources:e,formats:s,onFormatSelected:i}=t;this.setState({sources:e,formats:s,onFormatSelected:i})}setCurrentFormat(t){this.setState({currentFormat:t})}}function w(t){this.state.onFormatSelected(t);const e=this.state.sources.find((e=>e.format===t.code));e&&(n(h,this).src({src:e.src,type:e.type}),this.setCurrentFormat(t.code),n(h,this).on("loadedmetadata",(()=>{n(h,this).play()}))),o(m,this,y).call(this)}function y(){if(-1===n(d,this).className.indexOf("show"))n(d,this).className+=" show";else{const t=n(d,this).className.replace(" show","");n(d,this).className=t}}s().registerPlugin("qualityselector",g),g.VERSION="0.1.2"})()})();