(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{30:function(e,t,i){"use strict";i.r(t);var r=i(6),n=i(0),s=i(8);let o,a,d,l,h,u=e=>e;class b extends r.a{static get properties(){return{url:{observe:!0,DOM:!0,fromAttributeConverter:n.d.fromAttribute,changedHandler:"_urlChanged"},subtitlesUrl:{observe:!0,DOM:!0,fromAttributeConverter:n.d.fromAttribute,attributeName:"subtitles-url"},playing:{observe:!0,DOM:!0,reflect:!0,fromAttributeConverter:n.a.fromAttribute,toAttributeConverter:n.a.toAttribute},paused:{observe:!0,DOM:!0,fromAttributeConverter:n.a.fromAttribute,changedHandler:"_pausedChanged"},loading:{observe:!0,DOM:!0,fromAttributeConverter:n.a.fromAttribute},error:{observe:!0,DOM:!0,fromAttributeConverter:n.a.fromAttribute},duration:{observe:!0},elapsedTime:{observe:!0,DOM:!0,fromAttributeConverter:n.b.fromAttribute,changedHandler:"_elapsedTimeChanged"},buffered:{observe:!0},loop:{observe:!0,DOM:!0,fromAttributeConverter:n.a.fromAttribute},muted:{observe:!0,DOM:!0,reflect:!0,fromAttributeConverter:n.a.fromAttribute,toAttributeConverter:n.a.toAttribute},userMuted:{observe:!0},objectFit:{observe:!0,DOM:!0,reflect:!0,attributeName:"object-fit",fromAttributeConverter:n.d.fromAttribute,toAttributeConverter:n.d.toAttribute},objectPosition:{observe:!0,DOM:!0,attributeName:"object-position",fromAttributeConverter:n.d.fromAttribute,changedHandler:"_objectPositionChanged"},unmuteSelector:{observe:!0,DOM:!0,attributeName:"unmute-selector",fromAttributeConverter:n.d.fromAttribute},_currentSubtitleText:{observe:!0},_savedTime:{observe:!0},_videoHeight:{observe:!0},_isEdge:{observe:!0}}}static get propertiesChangedHandlers(){return{render:["url","_savedTime","loop","_videoHeight","subtitlesUrl","_currentSubtitleText"],_toggleSound:["muted","userMuted"]}}constructor(){super(),this.url="#",this.playing=!1,this.paused=!1,this.loading=!0,this.error=!1,this.duration=0,this.elapsedTime=0,this.buffered=0,this.loop=!1,this.muted=!1,this.userMuted=!0,this.unmuteSelector=".unmute",this.objectFit="contain",this.objectPosition="50% 50%",this._currentSubtitleText="",this._savedTime=0,this._videoHeight=0,this._isEdge=/Edge\/\d./i.test(navigator.userAgent),window.addEventListener("online",this._handleOnline.bind(this)),window.addEventListener("click",this._handleClick.bind(this))}reset(){const e=this.shadowRoot.querySelector("video");e&&(e.currentTime=0)}setCurrentTime(e){this.shadowRoot.querySelector("video").currentTime=e}_handleClick(e){if(!this.userMuted)return;!!e.composedPath().filter(e=>e.matches&&e.matches(this.unmuteSelector))[0]&&(this.userMuted=!1,this._toggleSound())}_toggleSound(){const e=this.shadowRoot.querySelector("video");if(e)if(this.muted)e.muted=!0,e.setAttribute("muted","");else{if(this.userMuted)return;e.muted=!1,e.removeAttribute("muted")}}propertiesChangedCallback(e,t,i){super.propertiesChangedCallback(e,t,i),-1!==e.indexOf("playing")&&this._notifyPropChanged("playing",this.playing),-1!==e.indexOf("loading")&&this._notifyPropChanged("loading",this.loading),-1!==e.indexOf("duration")&&this._notifyPropChanged("duration",this.duration),-1!==e.indexOf("elapsedTime")&&this._notifyPropChanged("elapsed-time",this.elapsedTime),-1!==e.indexOf("buffered")&&this._notifyPropChanged("buffered",this.buffered)}_notifyPropChanged(e,t){this.dispatchEvent(new CustomEvent(e+"-changed",{detail:{value:t}}))}_urlChanged(e,t){t&&"#"!==t||(this._savedTime=this.elapsedTime,this.updateStyles("--slicesui-av-player-opacity",0))}_handleWaiting(){this.loading=!0}_handleCanPlay(e){if(this.error=!1,this.paused)return e.target.pause();let t=e.target.play();t&&t.then(()=>{}).catch(()=>{})}_handlePlaying(){this.playing=!0,this.loading=!1}_handlePause(){this.playing=!1}_handleTimeUpdate(e){this.url&&"#"!==this.url&&(this.elapsedTime=parseFloat(e.target.currentTime.toFixed(1)),this.duration=parseFloat(e.target.duration.toFixed(1)),this.paused&&e.target.pause())}_handleEnded(){this.dispatchEvent(new CustomEvent("track-finished")),this.loop||(this.elapsedTime=0)}_handleError(){this.error=!0}_handleLoadedMetadata(e){this._videoHeight=e.target.videoHeight,e.target.currentTime=this._savedTime||0,this.duration=parseFloat(e.target.duration.toFixed(1)),this.updateStyles("--slicesui-av-player-opacity",1)}_pausedChanged(){let e=this.shadowRoot.querySelector("video");if(this.paused&&e)return e.pause();!this.paused&&e&&this.url&&"#"!==this.url&&e.play()}_handleOnline(){this.error&&this.render()}_handleProgress(e){0!==e.target.buffered.length&&(this.buffered=parseFloat(e.target.buffered.end(0).toFixed(1)))}_elapsedTimeChanged(e,t){0===t&&e>0&&this._handleEnded()}_handleCueChange(e){let t=(e.target.track.activeCues||[])[0],i=t&&t.text||"";this._currentSubtitleText=i.replace(/\n/g,"
")}_objectPositionChanged(){const e=(this.objectPosition||"50% 50%").split(" "),t=(e[0]||"50%").trim(),i=(e[1]||"50%").trim();this.updateStyles("--slicesui-av-player-video-top",i),this.updateStyles("--slicesui-av-player-video-left",t),this.updateStyles("--slicesui-av-player-video-transform","translate(-"+t+", -"+i+")")}get template(){return Object(r.b)(o||(o=u` ${0}
${0}
`),'\n:host,\n:host *,\n*::before,\n*::after {\n box-sizing: border-box;\n}\na {\n color: inherit;\n}\n:host(:not(.focus-visible)),\n:host(.focus-visible),\n:host(:not(.focus-visible)) input,\n:host(:not(.focus-visible)) button,\n:host(:not(.focus-visible)) select {\n outline: none;\n}\n[hidden] {\n display: none !important;\n}\n:host {\n display: block;\n overflow: hidden;\n position: relative;\n}\n:host video {\n position: relative;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n object-fit: var(--slicesui-image-object-fit, contain);\n object-position: var(--slicesui-image-object-position, 50% 50%);\n box-sizing: border-box;\n padding: 0;\n background: transparent;\n transition: 0.5s opacity ease-in-out;\n opacity: var(--slicesui-av-player-opacity);\n}\n:host video[src="undefined"],\n:host video[src="#"],\n:host video[data-height="0"] {\n opacity: 0;\n visibility: hidden;\n}\n:host([object-fit="cover"]) video {\n position: absolute;\n top: var(--slicesui-av-player-video-top);\n left: var(--slicesui-av-player-video-left);\n transform: var(--slicesui-av-player-video-transform);\n min-width: 100%;\n min-height: 100%;\n}\n:host #textTrackContainer {\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n margin: 0;\n font-family: var(--slices-text-b1--font-family, var(--slices-text-b--font-family, var(--slices-text--font-family)));\n font-size: var(--slices-text-b1--font-size);\n font-weight: var(--slices-text-b1--font-weight, var(--slices-text-b--font-weight, 400));\n line-height: var(--slices-text-b1--line-height, var(--slices-text-b--line-height, 1.4));\n position: absolute;\n color: #fff;\n text-shadow: 0 0 2px #000;\n text-align: center;\n box-sizing: border-box;\n padding: var(--slicesui-av-player-caption-padding, 16px 0);\n transition: 0.5s padding-bottom ease;\n width: 660px;\n max-width: 100%;\n left: 50%;\n transform: translateX(-50%);\n bottom: 0;\n}\n:host video::-webkit-media-text-track-container {\n visibility: hidden;\n}\n:host video::-webkit-media-text-track-display-backdrop {\n visibility: hidden;\n}\n:host video::cue {\n visibility: hidden;\n}\n',this._renderVideo(),this._isEdge,Object(s.a)(this._currentSubtitleText))}_renderVideo(){return this.url?Object(r.b)(d||(d=u` `),this.url,this._savedTime,this.loop,this._videoHeight,this._handleWaiting,this._handleCanPlay,this._handlePlaying,this._handlePause,this._handleTimeUpdate,this._handleEnded,this._handleError,this._handleLoadedMetadata,this._handleProgress,this.subtitlesUrl?Object(r.b)(l||(l=u` `),this.subtitlesUrl,this.lang,this._handleCueChange):Object(r.b)(h||(h=u``))):Object(r.b)(a||(a=u``))}}window.customElements.define("slicesui-av-player",b)}}]); //# sourceMappingURL=3564448c0c7048a2c469.js.map